From 986ac49062ad810fd18e2be4936aafe322b2f1f8 Mon Sep 17 00:00:00 2001 From: navin10sharma <3096611+navin10sharma@users.noreply.github.com> Date: Fri, 21 Aug 2026 15:02:11 +0530 Subject: [PATCH] release: prepare React Native SDK 0.2.0 --- .github/workflows/publish.yml | 8 + CHANGELOG.md | 14 + README.md | 33 +- assets/index.html | 45 -- assets/seatlayer.js | 807 ------------------------------ package.json | 6 +- scripts/generate-web-document.mjs | 29 -- src/SeatLayerView.tsx | 51 +- src/controller.ts | 131 +++++ src/decode.ts | 85 ++++ src/generated/webDocument.ts | 2 - src/index.ts | 14 + src/types.ts | 104 +++- test/controller.test.ts | 118 ++++- 14 files changed, 527 insertions(+), 920 deletions(-) delete mode 100644 assets/index.html delete mode 100644 assets/seatlayer.js delete mode 100644 scripts/generate-web-document.mjs delete mode 100644 src/generated/webDocument.ts diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7f12295..7c65aee 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -28,5 +28,13 @@ jobs: run: | package_version="$(node -p "require('./package.json').version")" test "${GITHUB_REF_NAME#v}" = "$package_version" + - name: Verify deployed hosted runtime + run: | + runtime="$(sed -n "s/.*seatLayerHostedWebVersion = '\(.*\)';/\1/p" src/types.ts)" + metadata="$(curl --fail --silent --show-error "https://cdn.seatlayer.io/seatlayer-js@$runtime/release.json")" + METADATA="$metadata" RUNTIME="$runtime" node -e \ + 'const m=JSON.parse(process.env.METADATA); if(m.version!==process.env.RUNTIME || m.promotable!==true) process.exit(1)' + curl --fail --silent --show-error --output /dev/null \ + "https://cdn.seatlayer.io/seatlayer-js@$runtime/mobile.html" - run: pnpm validate - run: npm publish --access public diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bad4c1..066a1ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.2.0 + +- Uses the pinned hosted `seatlayer-js@0.66.0/mobile.html` document at + `https://cdn.seatlayer.io`; buyer access tokens must be minted for that exact + allowed origin. Private configuration fails closed unless the bridge advertises + `native-access-provider`. +- Adds programmatic selection/category controls, exact-count validators, typed + validity/access events, selected-object unavailability, and view-mode parity. +- Reloads the WebView when configuration identity changes without serializing + credentials into React keys; callback-only rerenders no longer restart the + handshake. +- Removes the unused legacy inline-document generation pipeline and reports the + production dependency as `seatLayerHostedWebVersion`. + ## 0.1.3 - Updated the vendored buyer runtime to `seatlayer-js@0.59.0` (sha256 diff --git a/README.md b/README.md index 42fcdc4..2c731bd 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ events over a versioned WebView bridge. [Native Android SDK](https://github.com/seatlayer/seatlayer-android) · [AI Toolkit](https://github.com/seatlayer/seatlayer-ai-toolkit) -> **Public preview:** Validate `0.1.x` using a SeatLayer test event and physical +> **Public preview:** Validate `0.2.x` using a SeatLayer test event and physical > iOS and Android devices before production rollout. ## Install @@ -117,8 +117,11 @@ try { `hold` · `resumeHold` · `extendHold` · `release` · `releaseLabels` · `bestAvailable` · `holdGA` · `setSeatTier` · `getSelection` · -`getCurrentHold` · `getGAAreas` · `getFloors` · `setFloor` · -`setColorblindSafe` · `zoomIn` · `zoomOut` · `zoomToFit` · `destroy` +`selectObjects` · `deselectObjects` · `clearSelection` · `selectCategories` · +`deselectCategories` · `setSelectableObjects` · `setMaxSelection` · +`getSelectionValidity` · `refreshAccess` · `getCurrentHold` · `getGAAreas` · +`getFloors` · `setFloor` · `setColorblindSafe` · `setViewMode` · +`getViewMode` · `zoomIn` · `zoomOut` · `zoomToFit` · `destroy` All asynchronous command failures reject with `SeatLayerError`. Inventory outcomes such as `sold_out`, `not_enough_together`, expired holds and conflicts @@ -143,8 +146,10 @@ useEffect(() => { ``` Events: `ready` · `selectionChanged` · `holdChanged` · `holdRestored` · -`holdExpired` · `error` · `hint` · `gaClick` · `seatHover` · `deckTap` · -`checkout` · `unknownEvent` +`holdExpired` · `selectionValidityChanged` · `selectionValid` · +`selectionInvalid` · `selectionLimit` · `accessExpired` · `accessUnavailable` · +`selectedObjectsUnavailable` · `error` · `hint` · `gaClick` · `seatHover` · +`deckTap` · `checkout` · `unknownEvent` Unknown future events remain observable through `unknownEvent`; adding a bundle event does not crash an older app. @@ -165,10 +170,15 @@ before connecting a payment flow. ## How the bridge works -The npm package embeds the verified `seatlayer-js@0.59.0` bundle (sha256 `89bc29fb…`) in generated -inline HTML. This avoids the inconsistent local-file behavior of iOS and Android -WebViews while keeping the SDK JavaScript independent of a runtime CDN download. -Chart data and live inventory still come from the configured SeatLayer API. +The SDK loads the immutable hosted `seatlayer-js@0.66.0/mobile.html` document +from `https://cdn.seatlayer.io`. This gives every platform the mintable HTTPS +origin `https://cdn.seatlayer.io` and lets the browser runtime load its pinned +lazy assets. Buyer-access sessions must be minted for that exact allowed origin; +tokens never belong in a URL, JavaScript source, or app logs. + +Configure `buyerAccessTokenProvider` with a function that calls your own backend +mint endpoint. Private configuration and selection policies fail closed if the +loaded runtime does not advertise the required bridge capabilities. The protocol guarantees: @@ -197,8 +207,9 @@ pnpm validate cd example && pnpm install && pnpm start ``` -`pnpm validate` regenerates the embedded document, type-checks, runs protocol -tests, builds ESM/CommonJS/types, and validates the npm tarball. +`pnpm validate` type-checks, runs protocol tests, builds ESM/CommonJS/types, +and validates the npm tarball. Production loads the exact hosted runtime; the +package no longer generates or ships an unused inline Web document. ## Related resources diff --git a/assets/index.html b/assets/index.html deleted file mode 100644 index 56947d4..0000000 --- a/assets/index.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - -SeatLayer - - - - -
- - - diff --git a/assets/seatlayer.js b/assets/seatlayer.js deleted file mode 100644 index ae9ff23..0000000 --- a/assets/seatlayer.js +++ /dev/null @@ -1,807 +0,0 @@ -var seatlayer=(function(X){Object.defineProperty(X,Symbol.toStringTag,{value:"Module"});var So=Object.defineProperty,rt=(t,e,i)=>()=>{if(i)throw i[0];try{return t&&(e=t(t=0)),e}catch(s){throw i=[s],s}},Ui=(t,e)=>{let i={};for(var s in t)So(i,s,{get:t[s],enumerable:!0});return e||So(i,Symbol.toStringTag,{value:"Module"}),i},Co=[{key:"wheelchair",label:"Wheelchair space",short:"Wheelchair",icon:"♿"},{key:"companion",label:"Companion seat",short:"Companion",icon:"🧑‍🤝‍🧑"},{key:"semi-ambulatory",label:"Semi-ambulatory (limited mobility)",short:"Limited mobility",icon:"🦯"},{key:"designated-aisle",label:"Designated aisle / transfer seat",short:"Aisle transfer",icon:"AS"},{key:"step-free",label:"Step-free accessible seat",short:"Step-free",icon:"SF"},{key:"hearing",label:"Assistive listening",short:"Hearing",icon:"🦻"},{key:"cart",label:"CART live-caption view",short:"CART captions",icon:"CC"},{key:"sign-language",label:"Sign-language view",short:"Sign language",icon:"🤟"},{key:"low-vision",label:"Blind / low-vision viewing",short:"Low vision",icon:"LV"},{key:"sensory-friendly",label:"Quiet / sensory-friendly seating",short:"Sensory-friendly",icon:"QS"},{key:"plus-size",label:"Plus-size seat",short:"Plus-size",icon:"💺"},{key:"lift-armrest",label:"Lift-up armrest",short:"Lift armrest",icon:"↕️"}],Xm=new Map(Co.map(t=>[t.key,t])),pc={wheelchair:"#3b82f6",companion:"#8b5cf6","semi-ambulatory":"#0ea5e9","designated-aisle":"#0284c7","step-free":"#16a34a",hearing:"#14b8a6",cart:"#7c3aed","sign-language":"#f59e0b","low-vision":"#d97706","sensory-friendly":"#6366f1","plus-size":"#ec4899","lift-armrest":"#22c55e"};function To(t){const e=t==null?void 0:t[0];return e&&pc[e]||"#3b82f6"}var fc=[{key:"obstructedView",label:"Obstructed view",short:"Obstructed",icon:"⛔"},{key:"restrictedView",label:"Restricted view",short:"Restricted",icon:"👁"},{key:"premium",label:"Premium seat",short:"Premium",icon:"★"}],Zm=new Map(fc.map(t=>[t.key,t])),vc=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],Qm=new Set(vc),Lo=t=>{var e;return Math.max(1,t.fontSize*.6+((e=t.letterSpacing)!==null&&e!==void 0?e:0))};function mc(t,e){const i=t.text.split(/\r?\n/);if(!t.width)return Math.max(1,i.length);const s=Math.max(1,Math.floor(e/Lo(t)));let n=0;for(const o of i){if(!o.length){n+=1;continue}let a=0;for(const r of o.split(/\s+/)){const l=r.length;a&&a+1+l<=s?a+=1+l:(n+=Math.max(1,Math.ceil(l/s)),a=l%s)}}return Math.max(1,n)}function gc(t){var e,i,s,n;const o=(e=(i=t.background)===null||i===void 0?void 0:i.padding)!==null&&e!==void 0?e:0,a=t.text.split(/\r?\n/),r=Math.max(1,...a.map(d=>d.length))*Lo(t),l=(s=t.width)!==null&&s!==void 0?s:r+o*2,c=mc(t,Math.max(1,l-o*2));return{width:l,height:c*t.fontSize*((n=t.lineHeight)!==null&&n!==void 0?n:1.2)+o*2,lineCount:c,padding:o}}function Ao(t,e){const i=1-e,s=i*i*i,n=3*i*i*e,o=3*i*e*e,a=e*e*e;return{x:s*t.start.x+n*t.control1.x+o*t.control2.x+a*t.end.x,y:s*t.start.y+n*t.control1.y+o*t.control2.y+a*t.end.y}}function bc(t,e,i=192){if(!Number.isInteger(e)||e<1)throw new Error("Path point count must be a positive integer");if(e===1)return[Ao(t,.5)];const s=Array.from({length:i+1},(l,c)=>Ao(t,c/i)),n=new Float64Array(s.length);for(let l=1;l({...t.start}));const a=[];let r=1;for(let l=0;lt.y!=l>t.y&&t.x<(r-o)*(t.y-a)/(l-a)+o&&(i=!i)}return i}function wc(t,e,i){const s=Io(t,e)&&!i.some(o=>Io(t,o)),n=Eo(t,[e,...i]);return s?n:-n}function zt(t,e,i,s,n){const o=wc({x:t,y:e},s,n);return{x:t,y:e,h:i,d:o,max:o+i*Math.SQRT2}}var xc=class{constructor(){this.items=[]}get size(){return this.items.length}push(t){const e=this.items;e.push(t);let i=e.length-1;for(;i>0;){const s=i-1>>1;if(e[s].max>=e[i].max)break;[e[s],e[i]]=[e[i],e[s]],i=s}}pop(){const t=this.items,e=t[0],i=t.pop();if(t.length&&i){t[0]=i;let s=0;for(;;){const n=s*2+1,o=n+1;let a=s;if(nt[a].max&&(a=n),ot[a].max&&(a=o),a===s)break;[t[a],t[s]]=[t[s],t[a]],s=a}}return e}};function Mo(t){if(t.length<3)return 0;let e=0;for(let i=0,s=t.length-1;ii+Mo(s),0))}function Cc(t,e){const i=e!=null?e:[];if(!t.length)return{point:{x:0,y:0},radius:0};if(t.length<3)return{point:{x:t.reduce((v,m)=>v+m.x,0)/t.length,y:t.reduce((v,m)=>v+m.y,0)/t.length},radius:0};let s=1/0,n=1/0,o=-1/0,a=-1/0;for(const v of t)v.xo&&(o=v.x),v.y>a&&(a=v.y);const r=o-s,l=a-n,c=Math.min(r,l);if(!(c>0))return{point:{x:(s+o)/2,y:(n+a)/2},radius:0};const d=Math.max(r,l)/150,u=new xc;let h=c/2;for(let v=s;vp.d&&(p=v),!(v.max-p.d<=d)&&(f>=yc||(f+=1,h=v.h/2,u.push(zt(v.x-h,v.y-h,h,t,i)),u.push(zt(v.x+h,v.y-h,h,t,i)),u.push(zt(v.x-h,v.y+h,h,t,i)),u.push(zt(v.x+h,v.y+h,h,t,i))))}return{point:{x:p.x,y:p.y},radius:Math.max(0,p.d)}}function _e(t,e,i){return Math.max(e,Math.min(i,t))}function yt(t,e,i){return ti?i:t}var Jm=Math.PI*2;function Tc(t,e,i){return Lc(t,n=>({x:n.x+e,y:n.y+i}))}function Lc(t,e,i=1,s=!1){return{...t,start:e(t.start),segments:t.segments.map(n=>n.kind==="line"?{...n,end:e(n.end)}:n.kind==="arc"?{...n,center:e(n.center),radius:n.radius*Math.abs(i),clockwise:s?!n.clockwise:n.clockwise,end:e(n.end)}:{...n,control1:e(n.control1),control2:e(n.control2),end:e(n.end)})}}function Ac(t){const e=new Map,i=new Map;for(const r of t){var s;if(r.type!=="row"||!r.segmentedRow)continue;const l=(s=i.get(r.segmentedRow.groupId))!==null&&s!==void 0?s:[];l.push(r),i.set(r.segmentedRow.groupId,l)}for(const[r,l]of i){var n,o,a;const c=l.slice().sort((v,m)=>v.segmentedRow.componentIndex-m.segmentedRow.componentIndex),d=(n=(o=c[0])===null||o===void 0||(o=o.segmentedRow)===null||o===void 0?void 0:o.componentCount)!==null&&n!==void 0?n:0,u=(a=c[0])===null||a===void 0?void 0:a.segmentedRow;if(!u||!(d>=2&&c.length===d&&(u==null?void 0:u.boundaryBefore)==="start"&&c.every((v,m)=>{var g;return((g=v.segmentedRow)===null||g===void 0?void 0:g.kind)==="segmented-row-v1"&&v.segmentedRow.groupId===r&&v.segmentedRow.componentCount===d&&v.segmentedRow.componentIndex===m&&v.segmentedRow.repeatLabelOnComponents===u.repeatLabelOnComponents&&(m===0?v.segmentedRow.boundaryBefore==="start":v.segmentedRow.boundaryBefore!=="start")&&v.segmentedRow.displayLabel===u.displayLabel})))continue;const h=c.reduce((v,m)=>v+m.seatCount,0);let p=0,f=0;for(const v of c)v.segmentedRow.boundaryBefore==="break"&&(p+=1),e.set(v.id,{groupId:r,adjacencyOffset:p,displayOffset:f,displayLabel:u.displayLabel,totalSeats:h,canonical:c[0],viewFromSeatUrl:u.viewFromSeatUrl,viewFromSeatMeta:u.viewFromSeatMeta,confidenceEvidence:u.confidenceEvidence}),p+=v.seatCount,f+=v.seatCount}return e}var Ec="ABCDEFGHIJKLMNOPQRSTUVWXYZ",Ic="abcdefghijklmnopqrstuvwxyz";function Mc(t,e){const i=e.length;let s=t+1,n="";for(;s>0;)s-=1,n=e[s%i]+n,s=Math.floor(s/i);return n}function _o(t,e=!1){const i=e?Ic:Ec;return Mc(Math.max(0,Math.floor(t)-1),i)}var _c=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];function Pc(t){if(!Number.isFinite(t)||t<=0)return String(t);let e=Math.floor(t),i="";for(const[s,n]of _c)for(;e>=s;)i+=n,e-=s;return i}function Rc(t){const e=new Array(t);return Array.from({length:t},(i,s)=>s).sort((i,s)=>Math.abs(2*i-(t-1))-Math.abs(2*s-(t-1))||i-s).forEach((i,s)=>e[i]=s),e}function qs(t,e){var i,s,n,o,a,r,l,c,d,u;const h=(i=t.seatLabelStart)!==null&&i!==void 0?i:1,p=(s=(n=t.seatNumbering)===null||n===void 0?void 0:n.direction)!==null&&s!==void 0?s:"ltr",f=(o=(a=t.seatNumbering)===null||a===void 0?void 0:a.step)!==null&&o!==void 0?o:1,v=(r=(l=t.seatNumbering)===null||l===void 0?void 0:l.scheme)!==null&&r!==void 0?r:"decimal",m=(c=(d=t.seatNumbering)===null||d===void 0?void 0:d.prefix)!==null&&c!==void 0?c:"",g=(u=t.seatNumbering)===null||u===void 0?void 0:u.endAt,b=t.seatCount;if(v==="updown"||v==="updown-descending"){const S=Math.ceil(b/2);return`${m}${v==="updown"?e1e-12?((e-o.x)*r+(i-o.y)*l)/c:0;d<0?d=0:d>1&&(d=1);const u=Math.hypot(e-(o.x+d*r),i-(o.y+d*l));un&&(n=a)}return{cx:e,cy:i,r:n}}function Oo(t,e){return Math.hypot(t.cx-e.cx,t.cy-e.cy)-t.r-e.r}function Ws(t,e){let i=1/0;for(const s of Ro(t)){const n=$o(e,s.x,s.y);nn&&(n=u,o=d)}let a=o.x-i,r=o.y-s;const l=Math.hypot(a,r);l>1e-9?(a/=l,r/=l):(a=1,r=0);const c=t.map((d,u)=>({p:d,i:u,t:(d.x-i)*a+(d.y-s)*r})).sort((d,u)=>d.t-u.t);return{pts:c.map(d=>d.p),seatIndices:c.map(d=>e[d.i])}}function Vc(t){const e=t.length;if(e<3)return null;let i=0,s=0;for(const b of t)i+=b.x,s+=b.y;i/=e,s/=e;let n=0,o=0,a=0,r=0,l=0,c=0,d=0;for(const b of t){const y=b.x-i,k=b.y-s;n+=y*y,a+=k*k,o+=y*k,r+=y*y*y,l+=k*k*k,c+=y*k*k,d+=k*y*y}const u=n*a-o*o;if(Math.abs(u)<1e-9)return null;const h=(r+c)/2,p=(l+d)/2,f=(h*a-p*o)/u,v=(p*n-h*o)/u,m=f+i,g=v+s;return!Number.isFinite(m)||!Number.isFinite(g)?null:{cx:m,cy:g}}var Gc=.15;function qc(t){if(t.length<2)return null;const e=t.map(g=>{let b=0,y=0;for(const k of g.pts)b+=k.x,y+=k.y;return{x:b/g.pts.length,y:y/g.pts.length}});let i=0,s=0;for(const g of e)i+=g.x,s+=g.y;i/=e.length,s/=e.length;let n=0,o=0,a=0;for(const g of e){const b=g.x-i,y=g.y-s;n+=b*b,o+=b*y,a+=y*y}const r=n+a,l=n*a-o*o,c=r/2+Math.sqrt(Math.max(0,r*r/4-l));let d,u;Math.abs(o)>1e-12?(d=c-a,u=o):n>=a?(d=1,u=0):(d=0,u=1);const h=Math.hypot(d,u);if(!(h>1e-12))return null;d/=h,u/=h;let p=1/0,f=-1/0;const v=[];for(const g of t){let b=1/0,y=-1/0;for(const k of g.pts){const w=k.x*d+k.y*u;wy&&(y=w),wf&&(f=w)}v.push(y-b)}const m=f-p;return m>1e-9?(v.sort((g,b)=>g-b),v[Math.min(v.length-1,Math.floor(v.length*.9))]/m<=jc?{x:d,y:u}:null):null}var jc=.35;function Uc(t,e,i,s){const n=new Map;for(const g of i){const b=e[g],y=b.rowId||`__seat-${g}`;let k=n.get(y);k||(k={pts:[],idx:[]},n.set(y,k)),k.pts.push({x:b.x,y:b.y}),k.idx.push(g)}if(!n.size)return{sectionId:t,rows:[],blockCount:0};const o=[];for(const[g,b]of n){const y=Nc(b.pts,b.idx);let k=0;for(const w of y.pts)k+=Math.hypot(w.x-s.x,w.y-s.y);o.push({id:g,pts:y.pts,seatIndices:y.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:k/y.pts.length})}const a=o.map(g=>Hc(g.pts)),r=[];for(let g=0;g=b)continue;const k=Ws(o[g].pts,o[y].pts);kg-b);const l=r.length?r[Math.floor(r.length/2)]:1,c=Math.max(l*Dc,1e-6),d=o.map(()=>[]);for(let g=0;gc||Ws(o[g].pts,o[b].pts)<=c&&(d[g].push(b),d[b].push(g));let u=0;for(let g=0;g=2?(()=>{const g=f.map(k=>k.x).sort((k,w)=>k-w),b=f.map(k=>k.y).sort((k,w)=>k-w),y=Math.floor(f.length/2);return{cx:g[y],cy:b[y]}})():null;if(v){const g=S=>Math.hypot(S.x-v.cx,S.y-v.cy);let b=1/0,y=-1/0;const k=[];for(const S of o){let T=1/0,E=-1/0;for(const L of S.pts){const I=g(L);IE&&(E=I)}k.push(E-T),Ty&&(y=E)}const w=y-b;k.sort((S,T)=>S-T);const C=k[Math.min(k.length-1,Math.floor(k.length*.9))];if(w>1e-9&&C/w<=Gc){const S=o.map(P=>{let N=0;for(const W of P.pts)N+=g(W);return{row:P,radius:N/P.pts.length}});let T=S[0],E=S[0];for(const P of S)P.radiusE.radius&&(E=P);if(T.row.focalDistance>E.row.focalDistance)for(const P of S)P.radius=-P.radius;let L=1/0;for(const P of S)P.radiusP.radius-N.radius);let I=-1,M=-1/0;const x=w/Math.max(1,S.length)*.5,A=[];for(const P of S)P.radius-M>x&&(I++,M=P.radius),P.row.ordinal=I,P.row.blockDepth=P.radius-L,A.push(P.row);return{sectionId:t,rows:A,blockCount:u}}}const m=[];for(const[,g]of h){const b=qc(g);if(b){const y=w=>{let C=0;for(const S of w.pts)C+=S.x*b.x+S.y*b.y;return C/w.pts.length};g.sort((w,C)=>y(w)-y(C)),g.length>=2&&g[0].focalDistance>g[g.length-1].focalDistance&&g.reverse();let k=0;for(let w=0;w0&&(k+=Ws(g[w-1].pts,g[w].pts)),g[w].ordinal=w,g[w].blockDepth=k,m.push(g[w])}else{let y=1/0;for(const k of g)k.focalDistancek.focalDistance-w.focalDistance);for(let k=0;k{var o,a,r,l;const c=i.get(n),d=Fo(c),u=Oc(t,n,c),h={...t.commercial,...c==null?void 0:c.commercial};return{index:n,x:s.x+((o=c==null?void 0:c.dx)!==null&&o!==void 0?o:0),y:s.y+((a=c==null?void 0:c.dy)!==null&&a!==void 0?a:0),label:u,displayLabel:Po(t,n,e,c),categoryKey:(r=c==null?void 0:c.categoryKey)!==null&&r!==void 0?r:t.categoryKey,skipped:!!(c!=null&&c.skip),accessible:d.length>0,accessibility:d,wheelchairSpaceType:c==null?void 0:c.wheelchairSpaceType,commercial:Object.values(h).some(p=>p!==void 0&&p!==!1&&p!=="")?h:void 0,viewUrl:(l=c==null?void 0:c.viewFromSeatUrl)!==null&&l!==void 0?l:t.viewFromSeatUrl,viewMeta:c!=null&&c.viewFromSeatUrl?c.viewFromSeatMeta:t.viewFromSeatMeta,labelStyle:c==null?void 0:c.labelStyle}})}function Ys(t){const e=[];for(const i of Kc(t))i.skipped||e.push({id:`${t.id}:${i.index}`,label:i.label,displayLabel:i.displayLabel===i.label?void 0:i.displayLabel,x:i.x,y:i.y,rowId:t.id,categoryKey:i.categoryKey,accessible:i.accessible||void 0,accessibility:i.accessibility.length?i.accessibility:void 0,wheelchairSpaceType:i.wheelchairSpaceType,commercial:i.commercial,viewUrl:i.viewUrl,viewMeta:i.viewMeta,labelStyle:i.labelStyle});return e}function Yc(t){if(t.seatCountsBySide)return{...t.seatCountsBySide};const e=t.sides&&t.sides.length?t.sides:["top","bottom"],i=["top","bottom","left","right"].filter(o=>e.includes(o)),s={top:0,bottom:0,left:0,right:0};if(!i.length)return s;const n=Math.max(0,Math.round(t.seatCount));for(let o=0;o[v.index,v])),r=(v,m,g,b)=>{var y,k,w,C,S,T;const E=a.get(v),L=Fo(E),I=(y=E==null?void 0:E.label)!==null&&y!==void 0?y:`${t.label}-${v+1}`,M=(k=t.displayLabel)!==null&&k!==void 0?k:t.label;return{index:v,label:I,displayLabel:(w=E==null?void 0:E.displayLabel)!==null&&w!==void 0?w:`${M}-${v+1}`,x:m+((C=E==null?void 0:E.dx)!==null&&C!==void 0?C:0),y:g+((S=E==null?void 0:E.dy)!==null&&S!==void 0?S:0),categoryKey:(T=E==null?void 0:E.categoryKey)!==null&&T!==void 0?T:t.categoryKey,skipped:!!(E!=null&&E.skip),accessible:L.length>0,accessibility:L,wheelchairSpaceType:E==null?void 0:E.wheelchairSpaceType,commercial:E==null?void 0:E.commercial,viewUrl:E==null?void 0:E.viewFromSeatUrl,viewMeta:E!=null&&E.viewFromSeatUrl?E.viewFromSeatMeta:void 0,labelStyle:E==null?void 0:E.labelStyle,...b?{side:b}:{}}};if(t.shape==="round"){var l,c;const v=((l=t.radius)!==null&&l!==void 0?l:40)+li,m=t.rotation*Yi,g=Math.max(0,Math.min(360,(c=t.seatArc)!==null&&c!==void 0?c:360));if(g>=360||o===1){for(let k=0;k!e.skipped).map(e=>({id:`${t.id}:${e.index}`,label:e.label,...e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.x,y:e.y,rowId:t.id,categoryKey:e.categoryKey,...e.accessible?{accessible:!0}:{},...e.accessibility.length?{accessibility:e.accessibility}:{},...e.wheelchairSpaceType?{wheelchairSpaceType:e.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{},...e.viewUrl?{viewUrl:e.viewUrl}:{},...e.viewUrl&&e.viewMeta?{viewMeta:e.viewMeta}:{},...e.labelStyle?{labelStyle:e.labelStyle}:{}}))}function zo(t){return[{id:`${t.id}:0`,label:t.label,...t.displayLabel&&t.displayLabel!==t.label?{displayLabel:t.displayLabel}:{},x:t.center.x,y:t.center.y,rowId:t.id,categoryKey:t.categoryKey,kind:"booth"}]}function Zs(t,e){let i=!1;for(let s=0,n=e.length-1;st.y!=l>t.y&&t.x<(r-o)*(t.y-a)/(l-a)+o&&(i=!i)}return i}function Zc(t,e){return e.some((i,s)=>{const n=e[(s+1)%e.length],o=(t.y-i.y)*(n.x-i.x)-(t.x-i.x)*(n.y-i.y);if(Math.abs(o)>1e-7)return!1;const a=(t.x-i.x)*(n.x-i.x)+(t.y-i.y)*(n.y-i.y),r=(n.x-i.x)**2+(n.y-i.y)**2;return a>=-1e-7&&a<=r+1e-7})}function Ke(t,e,i){return Zs(t,e)&&!(i!=null?i:[]).some(s=>Zs(t,s)||Zc(t,s))}function Qs(t,e){return Cc(t,e).point}function Js(t){if(!t.length)return{x:0,y:0};let e=0,i=0;for(const s of t)e+=s.x,i+=s.y;return{x:e/t.length,y:i/t.length}}function Qc(t){switch(t.type){case"row":{const s=Ys(t);if(!s.length)return{x:t.origin.x,y:t.origin.y};let n=0,o=0;for(const a of s)n+=a.x,o+=a.y;return{x:n/s.length,y:o/s.length}}case"table":case"booth":return{x:t.center.x,y:t.center.y};case"gaArea":return Js(t.points);case"section":return Js(t.outline);case"text":return{x:t.position.x,y:t.position.y};case"shape":var e,i;return t.points&&t.points.length?Js(t.points):t.x!=null&&t.y!=null&&t.width!=null&&t.height!=null?{x:t.x+t.width/2,y:t.y+t.height/2}:{x:(e=t.x)!==null&&e!==void 0?e:0,y:(i=t.y)!==null&&i!==void 0?i:0};case"decorImage":return{x:t.x+t.width/2,y:t.y+t.height/2}}}function Do(t,e){return t.length===e.length&&t.every((i,s)=>i.x===e[s].x&&i.y===e[s].y)}function Jc(t,e){var i,s;if(t.type!=="gaArea"||!Do(t.points,e.outline))return!1;const n=(i=t.holes)!==null&&i!==void 0?i:[],o=(s=e.holes)!==null&&s!==void 0?s:[];return n.length===o.length&&n.every((a,r)=>Do(a,o[r]))}function Ho(t,e){var i;const s=t.filter(r=>r.type==="section"),n="referenceInventorySource"in e?(i=e.referenceInventorySource)===null||i===void 0?void 0:i.logicalSectionId:void 0,o=Qc(e),a=n?s.find(r=>{var l;return((l=r.logicalSectionId)!==null&&l!==void 0?l:r.id)===n&&(Jc(e,r)||Ke(o,r.outline,r.holes))}):void 0;return a!=null?a:s.find(r=>Ke(o,r.outline,r.holes))}function Dt(t){return t.floors&&t.floors.length?t.floors:[{id:"floor-0",name:"Main",objects:t.objects,focalPoint:t.focalPoint,referenceImage:t.referenceImage,backgroundImage:t.backgroundImage}]}function ci(t){return t.floors&&t.floors.length?t.floors.flatMap(e=>e.objects):t.objects}function No(t,e,i){const s=o=>({x:o.x+e,y:o.y+i}),n=o=>o.map(s);switch(t.type){case"row":return{...t,origin:s(t.origin)};case"table":case"booth":return{...t,center:s(t.center)};case"gaArea":return{...t,points:n(t.points),...t.holes?{holes:t.holes.map(n)}:{}};case"section":return{...t,outline:n(t.outline),...t.outlinePath?{outlinePath:Tc(t.outlinePath,e,i)}:{},...t.holes?{holes:t.holes.map(n)}:{}};case"text":return{...t,position:s(t.position)};case"shape":return{...t,...t.points?{points:n(t.points)}:{},...t.x!=null?{x:t.x+e}:{},...t.y!=null?{y:t.y+i}:{}};case"decorImage":return{...t,x:t.x+e,y:t.y+i}}}function ed(t,e=900){if(!t.floors||t.floors.length<2)return t;const i=[];return t.floors.forEach((s,n)=>{const o=-n*e;for(const a of s.objects)i.push(o===0?a:No(a,0,o))}),{...t,objects:i,floors:void 0}}function td(t){const e=t.floors;if(!e||e.length<2)return t;const i=id(t),s=[];return e.forEach((n,o)=>{const{x:a,y:r}=i[o];for(const l of n.objects)s.push(No(l,a,r))}),{...t,objects:s,floors:void 0,referenceImage:void 0,backgroundImage:void 0}}function id(t){const e=t.floors;if(!(e!=null&&e.length))return[{x:0,y:0}];if(e.length<2)return e.map(()=>({x:0,y:0}));const i=e.map(h=>qo({...t,objects:h.objects,floors:void 0,focalPoint:h.focalPoint,referenceImage:void 0,backgroundImage:void 0})),s=Math.max(1,...i.map(h=>Math.max(h.width,h.height))),n=Math.max(64,Math.min(240,s*.08)),o=16/10;let a=null;for(let h=1;h<=e.length;h+=1){const p=Math.ceil(e.length/h),f=new Array(h).fill(0),v=new Array(p).fill(0);i.forEach((k,w)=>{const C=w%h,S=Math.floor(w/h);f[C]=Math.max(f[C],k.width),v[S]=Math.max(v[S],k.height)});const m=f.reduce((k,w)=>k+w,0)+n*(h-1),g=v.reduce((k,w)=>k+w,0)+n*(p-1),b=h*p-e.length,y=Math.abs(Math.log(m/Math.max(1,g)/o))+b*.04;(!a||y(d[f]=h,h+p+n),0),c.reduce((h,p,f)=>(u[f]=h,h+p+n),0),e.map((h,p)=>{const f=i[p],v=p%r,m=Math.floor(p/r),g=d[v]+(l[v]-f.width)/2,b=u[m]+(c[m]-f.height)/2;return{x:g-f.x,y:b-f.y}})}function Vo(t,e,i,s,n,o){const a=[],r=Ac(t),l=C=>!(C!=null&&C.eventConfigurationId)||C.eventConfigurationId===s,c=C=>!!C&&(!C.eventConfigurationId||C.eventConfigurationId===s),d=(C,S)=>c(C)?{...C,coverage:S}:void 0;for(const C of t){var u;let S=[];if(C.type==="row"?S=Ys(C):C.type==="table"?S=Xs(C):C.type==="booth"&&(S=zo(C)),!S.length)continue;for(const M of S)M.viewUrl&&!l(M.viewMeta)&&(M.viewUrl=void 0,M.viewMeta=void 0);if(C.type==="row"){const M=r.get(C.id);if(M){var h;const x=new Map(((h=C.overrides)!==null&&h!==void 0?h:[]).map(A=>[A.index,A]));for(const A of S){var p,f,v,m;const P=Number(A.id.slice(A.id.lastIndexOf(":")+1));Number.isInteger(P)&&(A.logicalRowId=M.groupId,A.logicalSeatIndex=M.adjacencyOffset+P,!((p=x.get(P))===null||p===void 0)&&p.displayLabel||(A.displayLabel=Po(C,P,M)),!A.viewUrl&&M.viewFromSeatUrl&&l(M.viewFromSeatMeta)&&(A.viewUrl=M.viewFromSeatUrl,A.viewMeta=M.viewFromSeatMeta),A.confidenceEvidence=(v=(m=d((f=x.get(P))===null||f===void 0?void 0:f.confidenceEvidence,"exact-seat"))!==null&&m!==void 0?m:d(C.confidenceEvidence,"row-representative"))!==null&&v!==void 0?v:d(M.confidenceEvidence,"row-representative"))}}}const T=Ho(t,C),E=T==null?void 0:T.viewFromSeatUrl,L=T!=null&&T.zone?e==null?void 0:e.find(M=>M.id===T.zone):void 0,I=(u=L==null?void 0:L.focalPoint)!==null&&u!==void 0?u:i;for(const M of S){var g,b,y;if(!M.confidenceEvidence){var k,w;const x=Number(M.id.slice(M.id.lastIndexOf(":")+1));M.confidenceEvidence=(w=d((C.type==="row"||C.type==="table")&&Number.isInteger(x)?(k=C.overrides)===null||k===void 0||(k=k.find(A=>A.index===x))===null||k===void 0?void 0:k.confidenceEvidence:void 0,"exact-seat"))!==null&&w!==void 0?w:C.type==="row"?d(C.confidenceEvidence,"row-representative"):void 0}(g=M.confidenceEvidence)!==null&&g!==void 0||(M.confidenceEvidence=(b=d(T==null?void 0:T.confidenceEvidence,"section-representative"))!==null&&b!==void 0?b:o?d(o.evidence,o.coverage):void 0),!M.viewUrl&&E&&l(T==null?void 0:T.viewFromSeatMeta)&&(M.viewUrl=E,M.viewMeta=T==null?void 0:T.viewFromSeatMeta),!M.viewUrl&&n&&l(n.meta)&&(M.viewUrl=n.url,M.viewMeta=n.meta),T&&(M.sectionId=(y=T.logicalSectionId)!==null&&y!==void 0?y:T.id),T!=null&&T.zone&&(M.zoneId=T.zone),I&&(M.focalPoint={...I})}a.push(...S)}return a}function Ye(t,e={}){var i;if(!((i=t.floors)===null||i===void 0)&&i.length){const l=[];for(const c of t.floors){var s;const d=(s=c.focalPoint)!==null&&s!==void 0?s:t.focalPoint,u=c.viewFromSeatUrl?{url:c.viewFromSeatUrl,meta:c.viewFromSeatMeta}:t.viewFromSeatUrl?{url:t.viewFromSeatUrl,meta:t.viewFromSeatMeta}:void 0,h=c.confidenceEvidence?{evidence:c.confidenceEvidence,coverage:"floor-representative"}:t.confidenceEvidence?{evidence:t.confidenceEvidence,coverage:"venue-representative"}:void 0,p=Vo(c.objects,t.zones,d,t.eventConfigurationId,u,h);if(e.resolveEyeHeights!==!1){var n,o;Go(c.objects,(n=c.focalPoint)!==null&&n!==void 0?n:t.focalPoint,(o=c.baseHeightM)!==null&&o!==void 0?o:0,p)}l.push(...p)}return l}const a=Vo(t.objects,t.zones,t.focalPoint,t.eventConfigurationId,t.viewFromSeatUrl?{url:t.viewFromSeatUrl,meta:t.viewFromSeatMeta}:void 0,t.confidenceEvidence?{evidence:t.confidenceEvidence,coverage:"venue-representative"}:void 0);if(e.resolveEyeHeights!==!1){var r;Go(t.objects,t.focalPoint,(r=e.floorBaseHeightM)!==null&&r!==void 0?r:0,a)}return a}function Go(t,e,i,s){const n=t.filter(h=>h.type==="section"),o=i>0||n.some(h=>{var p;return h.height!==void 0||h.rake!==void 0||((p=h.elevation)!==null&&p!==void 0?p:0)>0});if(!n.length||!o||!e){for(const h of s)h.eyeHeightM=i+lt;return}const a=new Array(s.length),r=new Map,l=new Map;for(let h=0;hKe({x:p.x,y:p.y},m.outline,m.holes)))!==null&&c!==void 0?c:null;if(a[h]=f,!f)continue;r.has(f.id)||r.set(f.id,Us(f,{floorBaseHeightM:i}));const v=l.get(f.id);v?v.push(h):l.set(f.id,[h])}const d=new Array(s.length).fill(void 0);for(const[h,p]of l){const f=r.get(h);if(!f)continue;const v=f.rake>0?Math.tan(f.rake*Math.PI/180):0,m=Uc(h,s,p,e);for(const g of m.rows){const b=g.blockDepth*Wi*v,y=f.height+b;for(const k of g.seatIndices)d[k]=y}}for(let h=0;h{us&&(s=u),h>n&&(n=h)};for(const u of ci(t))if(u.type==="row"){var a;const h=new Map(((a=u.overrides)!==null&&a!==void 0?a:[]).map(p=>[p.index,p]));Bo(u).forEach((p,f)=>{var v,m;const g=h.get(f);g!=null&&g.skip||o(p.x+((v=g==null?void 0:g.dx)!==null&&v!==void 0?v:0),p.y+((m=g==null?void 0:g.dy)!==null&&m!==void 0?m:0))})}else if(u.type==="gaArea")for(const h of u.points)o(h.x,h.y);else if(u.type==="section")for(const h of u.outline)o(h.x,h.y);else if(u.type==="decorImage")o(u.x,u.y),o(u.x+u.width,u.y+u.height);else if(u.type==="shape")if(u.points&&u.points.length)for(const h of u.points)o(h.x,h.y);else u.x!=null&&u.y!=null&&u.width!=null&&u.height!=null&&(o(u.x,u.y),o(u.x+u.width,u.y+u.height));else if(u.type==="table"){var r,l,c;const p=u.shape==="round"?((r=u.radius)!==null&&r!==void 0?r:40)+25:Math.max(((l=u.width)!==null&&l!==void 0?l:80)/2,((c=u.height)!==null&&c!==void 0?c:50)/2)+25;o(u.center.x-p,u.center.y-p),o(u.center.x+p,u.center.y+p)}else if(u.type==="booth"){const h=Math.max(u.width,u.height)/2;o(u.center.x-h,u.center.y-h),o(u.center.x+h,u.center.y+h)}else if(u.type==="text"){const h=gc(u);o(u.position.x,u.position.y),o(u.position.x+h.width,u.position.y+h.height)}for(const u of[t.referenceImage,t.backgroundImage]){if(!u)continue;const{center:h,width:p}=u,f=p*3/4;o(h.x-p/2,h.y-f/2),o(h.x+p/2,h.y+f/2)}if(!isFinite(e)){var d;const u=(d=t.focalPoint)!==null&&d!==void 0?d:{x:0,y:0};return{x:u.x-200,y:u.y-200,width:400,height:400}}return{x:e-Xi,y:i-Xi,width:s-e+Xi*2,height:n-i+Xi*2}}var sd="__sl_ga__",nd=1e5;function od(t,e){return`${sd}${encodeURIComponent(t)}__${e+1}`}function ad(t){const e=t.inventorySegments;if(e===void 0)return!0;if(!Array.isArray(e)||e.length<1||e.length>256)return!1;let i=0;const s=new Map;for(const o of e){var n;if(!o||typeof o.sourceAreaId!="string"||!o.sourceAreaId.trim()||o.sourceAreaId.length>160||!Number.isInteger(o.startIndex)||o.startIndex<0||!Number.isInteger(o.count)||o.count<1||o.startIndex+o.count>1e5||(i+=o.count,i>1e5))return!1;const a=(n=s.get(o.sourceAreaId))!==null&&n!==void 0?n:[],r=o.startIndex+o.count;if(a.some(l=>o.startIndexl.start))return!1;a.push({start:o.startIndex,end:r}),s.set(o.sourceAreaId,a)}return i===t.capacity}function rd(t){const e=Math.min(nd,Math.max(0,Math.floor(t.capacity)));return t.inventorySegments===void 0?e?[{sourceAreaId:t.id,startIndex:0,count:e}]:[]:ad(t)?t.inventorySegments.map(i=>({...i})):[]}function Zi(t){return rd(t).flatMap(e=>Array.from({length:e.count},(i,s)=>od(e.sourceAreaId,e.startIndex+s)))}function Qi(t){return ci(t).filter(e=>e.type==="gaArea")}var ct="__ungrouped__";function ld(t){return t.type==="row"?Ys(t).map(e=>e.label):t.type==="table"?Xs(t).map(e=>e.label):t.type==="booth"?zo(t).map(e=>e.label):t.type==="gaArea"?Zi(t):[]}function cd(t){return t.type==="row"||t.type==="table"||t.type==="booth"||t.type==="gaArea"}function Ji(t){const e=ci(t),i=e.filter(l=>l.type==="section"),s=new Map;for(const l of i){var n;const c=(n=l.logicalSectionId)!==null&&n!==void 0?n:l.id;s.get(c)||s.set(c,{id:c,label:l.displayLabel||l.label||"Section",zone:l.zone,seatCount:0,objectIds:[],seatLabels:[]})}const o={id:ct,label:"Other seats",seatCount:0,objectIds:[],seatLabels:[]},a=new Map;for(const l of e){var r;if(!cd(l))continue;const c=ld(l);if(c.length===0)continue;const d=Ho(e,l),u=d?s.get((r=d.logicalSectionId)!==null&&r!==void 0?r:d.id):o;u.seatCount+=c.length,u.objectIds.push(l.id),u.seatLabels.push(...c),a.set(l.id,u.id)}return{sections:[...s.values()],ungrouped:o.objectIds.length?o:null,objectToSection:a}}function dd(t,e){return e.has(t.id)||!!t.logicalSectionId&&e.has(t.logicalSectionId)||!!t.zone&&e.has(t.zone)}function hd(t,e){const i=new Set;if(!e.size)return i;const{sections:s,ungrouped:n,objectToSection:o}=Ji(t),a=new Set,r=new Map(s.map(c=>[c.id,c.zone]));for(const c of s){const d=r.get(c.id);(e.has(c.id)||d&&e.has(d))&&a.add(c.id)}const l=!!n&&e.has("__ungrouped__");for(const[c,d]of o)(a.has(d)||l&&d==="__ungrouped__")&&i.add(c);return i}function ud(t,e){if(!e.size)return t;const i=hd(t,e),s=e instanceof Set?e:new Set(e),n=a=>!(i.has(a.id)||a.type==="section"&&dd(a,s));if(t.floors&&t.floors.length){let a=!1;const r=t.floors.map(l=>{const c=l.objects.filter(n);return c.length!==l.objects.length&&(a=!0),c.length===l.objects.length?l:{...l,objects:c}});return a?{...t,floors:r,objects:r[0].objects}:t}const o=t.objects.filter(n);return o.length===t.objects.length?t:{...t,objects:o}}var jo=/^#?([\da-f]{3}|[\da-f]{6})$/i,pd=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?\s*\)$/i;function He(t){const e=jo.exec((t!=null?t:"").trim());if(!e)return null;const i=e[1].length===3?e[1].split("").map(n=>n+n).join(""):e[1],s=parseInt(i,16);return[s>>16&255,s>>8&255,s&255]}function fd({r:t,g:e,b:i}){const s=n=>Math.max(0,Math.min(255,Math.round(n))).toString(16).padStart(2,"0");return`#${s(t)}${s(e)}${s(i)}`}function Ht(t,e,i){return fd({r:t,g:e,b:i})}function Uo(t){const e=t.trim(),i=jo.exec(e);if(i&&e.startsWith("#"))return`#${(i[1].length===3?i[1].split("").map(o=>o+o).join(""):i[1]).toLowerCase()}`;const s=pd.exec(e);if(!s||s[4]!=null&&Number(s[4])<.999)return null;const n=[Number(s[1]),Number(s[2]),Number(s[3])];return n.some(o=>!Number.isInteger(o)||o<0||o>255)?null:`#${n.map(o=>o.toString(16).padStart(2,"0")).join("")}`}function en(t){const e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function tn(t){return .2126*en(t[0])+.7152*en(t[1])+.0722*en(t[2])}function vd(t,e){const i=He(t),s=He(e);if(!i||!s)return null;const n=tn(i),o=tn(s);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}function md(t){const e=t.trim();if(e.startsWith("#")){const s=He(e);return s?(.2126*s[0]+.7152*s[1]+.0722*s[2])/255:NaN}const i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/.exec(e);return i?(.2126*+i[1]+.7152*+i[2]+.0722*+i[3])/255:NaN}function sn(t,e=.6){const i=md(t);return!Number.isNaN(i)&&i>e}function Nt(t,e){const i=He(t);return i?Ht(...i.map(s=>s+(255-s)*e)):t}function Vt(t,e){const i=He(t);return i?Ht(...i.map(s=>s*(1-e))):t}function Wo(t,e,i){const s=He(t),n=He(e);return!s||!n?t:Ht(s[0]+(n[0]-s[0])*i,s[1]+(n[1]-s[1])*i,s[2]+(n[2]-s[2])*i)}function Ko(t,e){let i=0,s=0,n=0,o=0;for(const a of t){const r=He(a.hex);!r||a.w<=0||(i+=r[0]*a.w,s+=r[1]*a.w,n+=r[2]*a.w,o+=a.w)}return o>0?Ht(i/o,s/o,n/o):e}function gd(t,e){const i=He(t);if(!i)return t;const s=.2126*i[0]+.7152*i[1]+.0722*i[2];return Ht(...i.map(n=>n+(s-n)*e))}function bd(t,e){const i=He(t);return i?`rgba(${i[0]},${i[1]},${i[2]},${e})`:t}var kt=bd,es=.85,lg=12,yd=4.5,Yo="#000000",Xo="#ffffff";function Gt(t,e){return t*e>=12}var Zo={wheelchair:"M7.8 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM8 7L10.5 7L10.5 15L8 15ZM8 12.5L18 12.5L18 15L8 15ZM16 15L18 15L18 18L16 18ZM5.5 16a5.5 5.5 0 1 0 11 0a5.5 5.5 0 1 0 -11 0zM8 16a3 3 0 1 1 6 0a3 3 0 1 1 -6 0z",companion:"M5.5 6.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM4.5 18.5L6 11.5L11 11.5L12.5 18.5ZM12.5 7.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM11.5 19L13 12.5L18 12.5L19.5 19Z","semi-ambulatory":"M8.3 3.8a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM9 6.2L12 6.6L11 13.5L8.6 13L9 6.2ZM8.6 13L11 13L9.5 21L7 21ZM10.4 13L12.6 13L13.6 21L11.2 21ZM11.2 7.2L14 8L14.6 9.6L11.9 8.9ZM14.4 6.8L15.9 6.8L16.4 21L14.8 21Z","designated-aisle":"M3 5L6 5L6 14L3 14ZM3 12L13 12L13 15L3 15ZM5 15L7 15L7 20L5 20ZM11 15L13 15L13 20L11 20ZM13 7L20 7L17 4L19 4L23 8.5L19 13L17 13L20 10L13 10Z","step-free":"M4 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM4.4 7L7.5 7L7.5 13L11 15L9.5 17L5 14L4.4 7ZM2 19L8 19L17 10L22 10L22 13L18 13L10 21L2 21Z",hearing:"M15.5 3.5C9 2.2 5.5 6 5.5 11.5C5.5 16 8 19.5 10.5 21C13.2 22.6 16.4 20.8 15.4 18C14.8 16.4 12.9 16.1 13 14C13.1 11.9 15.8 11.4 15.8 8.5C15.8 5.4 13 4 15.5 3.5Z",cart:"M5.5 6L18.5 6a2.5 2.5 0 0 1 2.5 2.5L21 15.5a2.5 2.5 0 0 1 -2.5 2.5L11 18L7 20.5L7.5 18L5.5 18a2.5 2.5 0 0 1 -2.5 -2.5L3 8.5a2.5 2.5 0 0 1 2.5 -2.5zM6.5 11L17.5 11L17.5 12.6L6.5 12.6zM6.5 14L17.5 14L17.5 15.6L6.5 15.6z","sign-language":"M7 11L17 11L17 18a2 2 0 0 1 -2 2L9 20a2 2 0 0 1 -2 -2zM7.6 5L9.4 5L9.4 12L7.6 12zM9.9 3.5L11.7 3.5L11.7 12L9.9 12zM12.3 3.5L14.1 3.5L14.1 12L12.3 12zM14.6 5L16.4 5L16.4 12L14.6 12zM7.2 12.5L5 10.2L6.4 8.9L8.6 11.2Z","low-vision":"M2.5 12C6 6 18 6 21.5 12C18 18 6 18 2.5 12ZM9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM17.5 3L19 3L19 6L17.5 6ZM19 4L22 4L22 5.5L19 5.5Z","sensory-friendly":"M4 11C4 5 7 2.5 12 2.5S20 5 20 11L17 11C17 7 15.5 5.5 12 5.5S7 7 7 11ZM3 10L8 10L8 19L5 19a2 2 0 0 1 -2 -2ZM16 10L21 10L21 17a2 2 0 0 1 -2 2L16 19ZM9 12L15 12L15 14L9 14ZM10 16L14 16L14 18L10 18Z","plus-size":"M9.4 4.3a2.6 2.6 0 1 0 5.2 0a2.6 2.6 0 1 0 -5.2 0zM5 20L4 13C4 10.5 7 9.5 12 9.5C17 9.5 20 10.5 20 13L19 20Z","lift-armrest":"M5 6L8 6L8 19L5 19zM5 16L18 16L18 19L5 19zM8 12L17 12L17 14.5L8 14.5zM14 7L16 7L16 12L14 12zM12 7L18 7L15 3Z"},cg=Zo.wheelchair;function Qo(t){var e;if(!(t!=null&&t.length))return null;const i=t.includes("wheelchair")?"wheelchair":t[0];return(e=Zo[i])!==null&&e!==void 0?e:null}function Jo(t){var e,i;return(e=(i=/-(\d{1,5})$/.exec(t))===null||i===void 0?void 0:i[1])!==null&&e!==void 0?e:t}var Ae=vd;function kd(t,e,i){const s=He(t),n=He(e);if(!s||!n)return e;const o=Math.max(0,Math.min(1,i));return`#${s.map((a,r)=>Math.round(a*o+n[r]*(1-o))).map(a=>a.toString(16).padStart(2,"0")).join("")}`}function dt(t,e,i=yd){var s,n;const o=Ae(e,t);if(o!=null&&o>=i)return e;const a=(s=Ae("#000000",t))!==null&&s!==void 0?s:0,r=(n=Ae("#ffffff",t))!==null&&n!==void 0?n:0;return a===0&&r===0?e:a>=r?Yo:Xo}var wd=3;function ea(t){var e,i;const s=Ae("#ffffff",t);if(s!=null&&s>=wd)return"#ffffff";const n=(e=Ae("#000000",t))!==null&&e!==void 0?e:0,o=(i=Ae("#ffffff",t))!==null&&i!==void 0?i:0;return n===0&&o===0?"#ffffff":n>=o?Yo:Xo}var dg=3,qt=4.5,ts=3,ta=24,xd=20;function nn(t){return t.filter(e=>e.visible&&!!e.screenBox)}function jt(t,e){return t.xe.x&&t.ye.y}function ht(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function le(t,e,i){return i.length?{code:t,message:e,count:i.length,samples:i.slice(0,xd)}:null}function is(t,e,i){return{primaryId:t.seatId,primaryLabel:t.label,...e==null?{}:{measured:Math.round(e*100)/100},...i==null?{}:{minimum:i}}}function on(t,e,i){return{primaryId:t.id,primaryLabel:t.label,...e==null?{}:{measured:Math.round(e*100)/100},...i==null?{}:{minimum:i}}}function ia(t,e,i){return{primaryId:t.objectId,primaryLabel:t.text,...e==null?{}:{measured:Math.round(e*100)/100},...i==null?{}:{minimum:i}}}function Ut(t,e,i,s){return{primaryId:t,primaryLabel:e,secondaryId:i,secondaryLabel:s}}function Sd(t,e="overview",i=null){const s=nn(t.labels),n=nn(t.hierarchyLabels),o=nn(t.freeTextLabels),a=t.gaAreas.filter(x=>x.visible),r=s.map(x=>{var A;return(A=Ae(x.ink,x.fill))!==null&&A!==void 0?A:0}),l=n.map(x=>{var A;return(A=Ae(x.ink,x.fill))!==null&&A!==void 0?A:0}),c=o.map(x=>{var A;return(A=Ae(x.ink,x.background))!==null&&A!==void 0?A:0}),d=a.map(x=>{var A;return(A=Ae(x.effectiveBackground,t.canvasBackground))!==null&&A!==void 0?A:0}),u=i?t.labels.filter(x=>x.categoryKey===i):t.labels,h=i?t.gaAreas.filter(x=>x.categoryKey===i):t.gaAreas,p=u.filter(x=>x.selected),f=u.filter(x=>x.status==="held"),v=u.filter(x=>x.status==="booked"),m=u.filter(x=>x.pointerTarget.active),g=new Set([...t.labels.filter(x=>x.visible&&(x.opacity>.25||x.selected||x.status!=="free")).map(x=>x.categoryKey),...t.gaAreas.filter(x=>x.visible&&x.opacity>.1).map(x=>x.categoryKey)]),b=p.length?ht(p.flatMap(x=>{var A,P;return[(A=Ae(t.selectionRingColor,t.canvasBackground))!==null&&A!==void 0?A:0,(P=Ae(t.selectionRingColor,x.fill))!==null&&P!==void 0?P:0]})):null,y=[],k=(x,A)=>Array.from({length:x},(P,N)=>({primaryId:`overview:${N+1}`,primaryLabel:A}));if(e==="overview"&&t.rung==="sections"&&(y.push(le("overview-section-category-paint","Section overview shells must use the neutral hierarchy palette, not category paint",k(t.overviewStyle.categoryPaintedSectionShells,"category-painted section shell"))),y.push(le("overview-category-detail-visible","Category-tinted section detail must wait until section focus or seat zoom",k(t.overviewStyle.visibleCategoryDetailOutlines,"category detail outline"))),y.push(le("overview-row-hints-visible","Row and seat patterns must not clutter the section overview",k(t.overviewStyle.visibleSectionRowHints,"section row hint"))),y.push(le("overview-availability-clutter","Live availability counts belong in focused detail, not on section overview shells",k(t.overviewStyle.visibleSectionAvailabilityLabels,"section availability label"))),y.push(le("overview-ga-detail-visible","Section-contained standing paint belongs in focused detail, not on section overview shells",k(t.overviewStyle.visibleSectionGADetails,"section-contained GA detail")))),y.push(le("bookable-label-undersized","Visible bookable labels must meet the rendered small-text size floor",s.filter(x=>x.renderedFontPxis(x,x.renderedFontPx,t.minimumVisibleLabelPx)))),e==="interaction"){var w;const x=u.length>0,A=h.length>0,P=x||A,N=h.filter(_=>_.visible),W=new Set([...u.flatMap(_=>_.sectionId?[_.sectionId]:[]),...h.flatMap(_=>_.sectionId?[_.sectionId]:[])]),B=new Set([...t.labels.map(_=>_.categoryKey),...t.gaAreas.map(_=>_.categoryKey)]),z=_=>_.screenCenter.x>=0&&_.screenCenter.x<=t.viewport.width&&_.screenCenter.y>=0&&_.screenCenter.y<=t.viewport.height;y.push(le("detail-rung-missing","Interaction evidence with bookable inventory must render the seat-detail rung",P&&t.rung!=="seats"?[{primaryId:"renderer",primaryLabel:t.rung}]:[])),y.push(le("detail-inventory-not-visible","Interaction evidence must frame at least one real bookable unit",P&&!u.some(z)&&!N.length?[{primaryId:"renderer",primaryLabel:"no target inventory in viewport"}]:[])),y.push(le("pointer-target-inactive","Interaction evidence must expose a live production pointer target",x&&!m.some(z)||!x&&A&&!N.some(_=>_.interactive)?[{primaryId:"renderer",primaryLabel:"no active pointer target in viewport"}]:[])),y.push(le("pointer-target-undersized","Every active production pointer target must reach at least 24 CSS pixels",m.filter(_=>z(_)&&_.pointerTarget.effectiveMinimumPxis(_,_.pointerTarget.effectiveMinimumPx,ta)))),y.push(le("selected-state-missing","Interaction evidence must paint a selected unit and its renderer-owned ring",x&&(!p.length||!p.some(_=>t.selectionRingSeatIds.includes(_.seatId)))?[{primaryId:"renderer",primaryLabel:"selected state"}]:[])),y.push(le("selected-state-contrast-low","The selected-state ring must maintain 3:1 graphical contrast with the canvas",p.length&&(b!=null?b:0)=2&&!f.length?[{primaryId:"renderer",primaryLabel:"held state"}]:[])),y.push(le("booked-state-missing","Interaction evidence must paint a taken state when the floor has at least three status-managed units",u.length>=3&&!v.length?[{primaryId:"renderer",primaryLabel:"booked state"}]:[]));const j=new Set(f.map(_=>`${_.fill.toLowerCase()}:${_.opacity}`)),G=new Set(v.map(_=>`${_.fill.toLowerCase()}:${_.opacity}`));y.push(le("status-state-indistinct","Held and taken evidence must resolve to distinct renderer paint",f.length&&v.length&&[...j].some(_=>G.has(_))?[{primaryId:f[0].seatId,primaryLabel:f[0].label,secondaryId:v[0].seatId,secondaryLabel:v[0].label}]:[])),y.push(le("section-focus-missing","Interaction evidence must exercise section focus and its backdrop when section membership exists",W.size&&(!t.focusedSectionId||!t.focusBackdropVisible)?[{primaryId:"renderer",primaryLabel:"section focus"}]:[])),y.push(le("category-filter-missing","Interaction evidence must exercise a category filter when multiple categories exist",B.size>=2&&(!t.categoryFilterKeys||!t.categoryFilterKeys.length)?[{primaryId:"renderer",primaryLabel:"category filter"}]:[]));const D=t.labels.filter(_=>_.status==="free"&&!_.selected&&t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(_.categoryKey)),F=t.gaAreas.filter(_=>t.categoryFilterKeys!=null&&!t.categoryFilterKeys.includes(_.categoryKey));y.push(le("category-filter-ineffective","The active category filter must visibly dim excluded free inventory",(D.length||F.length)&&!D.some(_=>_.opacity<=.25)&&!F.some(_=>_.opacity<=.1)?[...D.map(_=>is(_,_.opacity)),...F.map(_=>({primaryId:_.areaId,primaryLabel:_.label,measured:_.opacity}))]:[])),y.push(le("target-category-not-visible","A category-specific interaction scene must visibly paint its exact target category",i&&!g.has(i)?[{primaryId:i,primaryLabel:i}]:[])),y.push(le("target-category-filter-mismatch","A category-specific interaction scene must bind its filter to only the exact target category",i&&(((w=t.categoryFilterKeys)===null||w===void 0?void 0:w.length)!==1||t.categoryFilterKeys[0]!==i)?[{primaryId:i,primaryLabel:i}]:[]))}y.push(le("bookable-label-contrast-low","Visible bookable labels must meet 4.5:1 contrast against their actual paint",s.flatMap(x=>{var A;const P=(A=Ae(x.ink,x.fill))!==null&&A!==void 0?A:0;return Px.renderedFontPx<12).map(x=>on(x,x.renderedFontPx,12)))),y.push(le("hierarchy-label-contrast-low","Visible section and zone labels must meet 4.5:1 contrast against their backing paint",n.flatMap(x=>{var A;const P=(A=Ae(x.ink,x.fill))!==null&&A!==void 0?A:0;return Px.kind==="section"&&x.fitsContainer===!1).map(x=>on(x))));const S=[];for(let x=0;xx.renderedFontPxia(x,x.renderedFontPx,t.minimumVisibleLabelPx)))),y.push(le("free-text-contrast-low","Visible chart text must meet 4.5:1 contrast against its measured background",o.flatMap(x=>{var A;const P=(A=Ae(x.ink,x.background))!==null&&A!==void 0?A:0;return P{var A;const P=(A=Ae(x.effectiveBackground,t.canvasBackground))!==null&&A!==void 0?A:0;return P!!x);return{version:3,passed:M.length===0,state:e,targetCategoryKey:i,resolvedRules:["rendered-overview-label-size","rendered-overview-label-contrast","rendered-overview-label-collision","rendered-overview-hierarchy-containment","rendered-overview-section-first-style","rendered-overview-ga-contrast",...e==="interaction"?["rendered-detail-inventory","rendered-pointer-target","rendered-selected-held-taken-states","rendered-section-focus","rendered-category-filter"]:[]],viewport:t.viewport,canvasBackground:t.canvasBackground,effectiveScale:t.effectiveScale,rung:t.rung,inventory:{totalBookableUnits:t.totalBookableUnits,totalLabelledBookableUnits:t.totalLabelledBookableUnits,visibleBookableLabels:s.length,hiddenBookableLabels:t.hiddenLabels,visibleHierarchyLabels:n.length,visibleFreeTextLabels:o.length,visibleGAAreas:a.length},overviewStyle:t.overviewStyle,composition:{hierarchy:t.hierarchyLabels.filter(x=>x.role==="name").map(x=>({id:x.id,kind:x.kind,label:x.label,visible:x.visible})).sort((x,A)=>x.kind.localeCompare(A.kind)||x.id.localeCompare(A.id)),labelledObjects:t.freeTextLabels.map(x=>({objectId:x.objectId,kind:x.kind,text:x.text,visible:x.visible})).sort((x,A)=>x.objectId.localeCompare(A.objectId)||x.kind.localeCompare(A.kind)),gaAreas:t.gaAreas.map(x=>({areaId:x.areaId,label:x.label,categoryKey:x.categoryKey,...x.sectionId?{sectionId:x.sectionId}:{},visible:x.visible})).sort((x,A)=>x.areaId.localeCompare(A.areaId)),bookableSectionIds:[...new Set(t.labels.flatMap(x=>x.sectionId?[x.sectionId]:[]))].sort(),categoryKeys:[...new Set([...t.labels.map(x=>x.categoryKey),...t.gaAreas.map(x=>x.categoryKey)])].sort(),activeCategoryKeys:[...g].sort()},metrics:{minimumRenderedBookableLabelPx:ht(s.map(x=>x.renderedFontPx)),minimumBookableLabelContrast:ht(r),minimumRenderedHierarchyLabelPx:ht(n.map(x=>x.renderedFontPx)),minimumHierarchyLabelContrast:ht(l),minimumRenderedFreeTextPx:ht(o.map(x=>x.renderedFontPx)),minimumFreeTextContrast:ht(c),minimumGAContrast:ht(d),minimumEffectivePointerTargetPx:ht(m.map(x=>x.pointerTarget.effectiveMinimumPx)),selectedRingContrast:b==null?null:Math.round(b*100)/100},interaction:{applicable:{detail:u.length>0||h.length>0,pointer:u.length>0||h.length>0,held:u.length>=2,booked:u.length>=3,sectionFocus:u.some(x=>!!x.sectionId)||h.some(x=>!!x.sectionId),categoryFilter:new Set([...t.labels.map(x=>x.categoryKey),...t.gaAreas.map(x=>x.categoryKey)]).size>=2},selectedUnits:p.length,heldUnits:f.length,bookedUnits:v.length,activePointerTargets:m.length,focusedSectionId:t.focusedSectionId,focusBackdropVisible:t.focusBackdropVisible,categoryFilterKeys:t.categoryFilterKeys},findings:M}}var Cd=Math.PI/180;function Td(){return typeof window!="undefined"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}var It=typeof global!="undefined"?global:typeof window!="undefined"?window:typeof WorkerGlobalScope!="undefined"?self:{},K={_global:It,version:"10.3.0",isBrowser:Td(),isUnminified:/param/.test(function(t){}.toString()),dblClickWindow:400,getAngle(t){return K.angleDeg?t*Cd:t},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window!="undefined"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return K.DD.isDragging},isTransforming(){var t,e;return(e=(t=K.Transformer)===null||t===void 0?void 0:t.isTransforming())!==null&&e!==void 0?e:!1},isDragReady(){return!!K.DD.node},releaseCanvasOnDestroy:!0,document:It.document,_injectGlobal(t){typeof It.Konva!="undefined"&&console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),It.Konva=t}},$e=t=>{K[t.prototype.getClassName()]=t};K._injectGlobal(K);var Ld=`Konva.js unsupported environment. - -Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined. - -To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module. - -bash: npm install canvas -js: import "konva/canvas-backend"; - -or - -bash: npm install skia-canvas -js: import "konva/skia-backend"; -`,sa=()=>{if(typeof document=="undefined")throw new Error(Ld)},Wt=class hc{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new hc(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){const i=this.m;return{x:i[0]*e.x+i[2]*e.y+i[4],y:i[1]*e.x+i[3]*e.y+i[5]}}translate(e,i){return this.m[4]+=this.m[0]*e+this.m[2]*i,this.m[5]+=this.m[1]*e+this.m[3]*i,this}scale(e,i){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=i,this.m[3]*=i,this}rotate(e){const i=Math.cos(e),s=Math.sin(e),n=this.m[0]*i+this.m[2]*s,o=this.m[1]*i+this.m[3]*s,a=this.m[0]*-s+this.m[2]*i,r=this.m[1]*-s+this.m[3]*i;return this.m[0]=n,this.m[1]=o,this.m[2]=a,this.m[3]=r,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,i){const s=this.m[0]+this.m[2]*i,n=this.m[1]+this.m[3]*i,o=this.m[2]+this.m[0]*e,a=this.m[3]+this.m[1]*e;return this.m[0]=s,this.m[1]=n,this.m[2]=o,this.m[3]=a,this}multiply(e){const i=this.m[0]*e.m[0]+this.m[2]*e.m[1],s=this.m[1]*e.m[0]+this.m[3]*e.m[1],n=this.m[0]*e.m[2]+this.m[2]*e.m[3],o=this.m[1]*e.m[2]+this.m[3]*e.m[3],a=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],r=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=i,this.m[1]=s,this.m[2]=n,this.m[3]=o,this.m[4]=a,this.m[5]=r,this}invert(){const e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),i=this.m[3]*e,s=-this.m[1]*e,n=-this.m[2]*e,o=this.m[0]*e,a=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),r=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=i,this.m[1]=s,this.m[2]=n,this.m[3]=o,this.m[4]=a,this.m[5]=r,this}getMatrix(){return this.m}decompose(){const e=this.m[0],i=this.m[1],s=this.m[2],n=this.m[3],o=this.m[4],a=this.m[5],r=e*n-i*s,l={x:o,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!=0||i!=0){const c=Math.sqrt(e*e+i*i);l.rotation=i>0?Math.acos(e/c):-Math.acos(e/c),l.scaleX=c,l.scaleY=r/c,l.skewX=(e*s+i*n)/r,l.skewY=0}else if(s!=0||n!=0){const c=Math.sqrt(s*s+n*n);l.rotation=Math.PI/2-(n>0?Math.acos(-s/c):-Math.acos(s/c)),l.scaleX=r/c,l.scaleY=c,l.skewX=0,l.skewY=(e*s+i*n)/r}return l.rotation=R._getRotation(l.rotation),l}},Ad="[object Array]",Ed="[object Number]",Id="[object String]",Md="[object Boolean]",_d=Math.PI/180,Pd=180/Math.PI,di="#",Rd="",$d="0",Od="Konva warning: ",na="Konva error: ",Fd="rgb(",an={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},Bd=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,ss=[],hi=null,zd=typeof requestAnimationFrame!="undefined"&&requestAnimationFrame||function(t){setTimeout(t,16)},R={_isElement(t){return!!(t&&t.nodeType==1)},_isFunction(t){return!!(t&&t.constructor&&t.call&&t.apply)},_isPlainObject(t){return!!t&&t.constructor===Object},_isArray(t){return Object.prototype.toString.call(t)===Ad},_isNumber(t){return Object.prototype.toString.call(t)===Ed&&!isNaN(t)&&isFinite(t)},_isString(t){return Object.prototype.toString.call(t)===Id},_isBoolean(t){return Object.prototype.toString.call(t)===Md},isObject(t){return t instanceof Object},isValidSelector(t){if(typeof t!="string")return!1;const e=t[0];return e==="#"||e==="."||e===e.toUpperCase()},_sign(t){return t===0||t>0?1:-1},requestAnimFrame(t){ss.push(t),ss.length===1&&zd(function(){const e=ss;ss=[],e.forEach(function(i){i()})})},createCanvasElement(){sa();const t=document.createElement("canvas");try{t.style=t.style||{}}catch{}return t},createImageElement(){return sa(),document.createElement("img")},_isInDocument(t){for(;t=t.parentNode;)if(t==document)return!0;return!1},_urlToImage(t,e){const i=R.createImageElement();i.onload=function(){e(i)},i.src=t},_rgbToHex(t,e,i){return((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},_hexToRgb(t){t=t.replace(di,Rd);const e=parseInt(t,16);return{r:e>>16&255,g:e>>8&255,b:e&255}},getRandomColor(){let t=(Math.random()*16777215<<0).toString(16);for(;t.length<6;)t=$d+t;return di+t},isCanvasFarblingActive(){if(hi!==null)return hi;if(typeof document=="undefined")return hi=!1,!1;const t=this.createCanvasElement();t.width=10,t.height=10;const e=t.getContext("2d",{willReadFrequently:!0});e.clearRect(0,0,10,10),e.fillStyle="#282828",e.fillRect(0,0,10,10);const i=e.getImageData(0,0,10,10).data;let s=!1;for(let n=0;n<100;n++)if(i[n*4]!==40||i[n*4+1]!==40||i[n*4+2]!==40||i[n*4+3]!==255){s=!0;break}return hi=s,this.releaseCanvas(t),hi},getHitColor(){const t=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(t):t},getHitColorKey(t,e,i){return this.isCanvasFarblingActive()&&(t=Math.round(t/5)*5,e=Math.round(e/5)*5,i=Math.round(i/5)*5),di+this._rgbToHex(t,e,i)},getSnappedHexColor(t){const e=this._hexToRgb(t);return di+this._rgbToHex(Math.round(e.r/5)*5,Math.round(e.g/5)*5,Math.round(e.b/5)*5)},getRGB(t){let e;return t in an?(e=an[t],{r:e[0],g:e[1],b:e[2]}):t[0]===di?this._hexToRgb(t.substring(1)):t.substr(0,4)===Fd?(e=Bd.exec(t.replace(/ /g,"")),{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10)}):{r:0,g:0,b:0}},colorToRGBA(t){return t=t||"black",R._namedColorToRBA(t)||R._hex3ColorToRGBA(t)||R._hex4ColorToRGBA(t)||R._hex6ColorToRGBA(t)||R._hex8ColorToRGBA(t)||R._rgbColorToRGBA(t)||R._rgbaColorToRGBA(t)||R._hslColorToRGBA(t)},_namedColorToRBA(t){const e=an[t.toLowerCase()];return e?{r:e[0],g:e[1],b:e[2],a:1}:null},_rgbColorToRGBA(t){if(t.indexOf("rgb(")===0){t=t.match(/rgb\(([^)]+)\)/)[1];const e=t.split(/ *, */).map(Number);return{r:e[0],g:e[1],b:e[2],a:1}}},_rgbaColorToRGBA(t){if(t.indexOf("rgba(")===0){t=t.match(/rgba\(([^)]+)\)/)[1];const e=t.split(/ *, */).map((i,s)=>i.slice(-1)==="%"?s===3?parseInt(i)/100:parseInt(i)/100*255:Number(i));return{r:e[0],g:e[1],b:e[2],a:e[3]}}},_hex8ColorToRGBA(t){if(t[0]==="#"&&t.length===9)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:parseInt(t.slice(7,9),16)/255}},_hex6ColorToRGBA(t){if(t[0]==="#"&&t.length===7)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:1}},_hex4ColorToRGBA(t){if(t[0]==="#"&&t.length===5)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:parseInt(t[4]+t[4],16)/255}},_hex3ColorToRGBA(t){if(t[0]==="#"&&t.length===4)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:1}},_hslColorToRGBA(t){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(t)){const[e,...i]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t),s=Number(i[0])/360,n=Number(i[1])/100,o=Number(i[2])/100;let a,r,l;if(n===0)return l=o*255,{r:Math.round(l),g:Math.round(l),b:Math.round(l),a:1};o<.5?a=o*(1+n):a=o+n-o*n;const c=2*o-a,d=[0,0,0];for(let u=0;u<3;u++)r=s+1/3*-(u-1),r<0&&r++,r>1&&r--,6*r<1?l=c+(a-c)*6*r:2*r<1?l=a:3*r<2?l=c+(a-c)*(2/3-r)*6:l=c,d[u]=l*255;return{r:Math.round(d[0]),g:Math.round(d[1]),b:Math.round(d[2]),a:1}}},haveIntersection(t,e){return!(e.x>t.x+t.width||e.x+e.widtht.y+t.height||e.y+e.height1?(a=i,r=s,l=(i-n)*(i-n)+(s-o)*(s-o)):(a=t+d*(i-t),r=e+d*(s-e),l=(a-n)*(a-n)+(r-o)*(r-o))}return[a,r,l]},_getProjectionToLine(t,e,i){const s=R.cloneObject(t);let n=Number.MAX_VALUE;return e.forEach(function(o,a){if(!i&&a===e.length-1)return;const r=e[(a+1)%e.length],l=R._getProjectionToSegment(o.x,o.y,r.x,r.y,t.x,t.y),c=l[0],d=l[1],u=l[2];ue.length){const a=e;e=t,t=a}for(let a=0;a{e.width=0,e.height=0})},drawRoundedRectPath(t,e,i,s){let n=e<0?e:0,o=i<0?i:0;e=Math.abs(e),i=Math.abs(i);let a=0,r=0,l=0,c=0;typeof s=="number"?a=r=l=c=Math.min(s,e/2,i/2):(a=Math.min(s[0]||0,e/2,i/2),r=Math.min(s[1]||0,e/2,i/2),c=Math.min(s[2]||0,e/2,i/2),l=Math.min(s[3]||0,e/2,i/2)),t.moveTo(n+a,o),t.lineTo(n+e-r,o),t.arc(n+e-r,o+r,r,Math.PI*3/2,0,!1),t.lineTo(n+e,o+i-c),t.arc(n+e-c,o+i-c,c,0,Math.PI/2,!1),t.lineTo(n+l,o+i),t.arc(n+l,o+i-l,l,Math.PI/2,Math.PI,!1),t.lineTo(n,o+a),t.arc(n+a,o+a,a,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(t,e,i,s,n){s=Math.abs(s);for(let o=0;otypeof c=="number"?Math.floor(c):c)),n+=Hd+l.join(oa)+Nd)):(n+=a.property,t||(n+=Ud+a.val)),n+=qd;return n}clearTrace(){this.traceArr=[]}_trace(t){let e=this.traceArr,i;e.push(t),i=e.length,i>=Kd&&e.shift()}reset(){const t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){const e=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,e.getWidth()/e.pixelRatio,e.getHeight()/e.pixelRatio)}_applyLineCap(t){const e=t.attrs.lineCap;e&&this.setAttr("lineCap",e)}_applyOpacity(t){const e=t.getAbsoluteOpacity();e!==1&&this.setAttr("globalAlpha",e)}_applyLineJoin(t){const e=t.attrs.lineJoin;e&&this.setAttr("lineJoin",e)}_applyMiterLimit(t){const e=t.attrs.miterLimit;e!=null&&this.setAttr("miterLimit",e)}setAttr(t,e){this._context[t]=e}arc(t,e,i,s,n,o){this._context.arc(t,e,i,s,n,o)}arcTo(t,e,i,s,n){this._context.arcTo(t,e,i,s,n)}beginPath(){this._context.beginPath()}bezierCurveTo(t,e,i,s,n,o){this._context.bezierCurveTo(t,e,i,s,n,o)}clearRect(t,e,i,s){this._context.clearRect(t,e,i,s)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,e){const i=arguments;if(i.length===2)return this._context.createImageData(t,e);if(i.length===1)return this._context.createImageData(t)}createLinearGradient(t,e,i,s){return this._context.createLinearGradient(t,e,i,s)}createPattern(t,e){return this._context.createPattern(t,e)}createRadialGradient(t,e,i,s,n,o){return this._context.createRadialGradient(t,e,i,s,n,o)}drawImage(t,e,i,s,n,o,a,r,l){const c=arguments,d=this._context;c.length===3?d.drawImage(t,e,i):c.length===5?d.drawImage(t,e,i,s,n):c.length===9&&d.drawImage(t,e,i,s,n,o,a,r,l)}ellipse(t,e,i,s,n,o,a,r){this._context.ellipse(t,e,i,s,n,o,a,r)}isPointInPath(t,e,i,s){return i?this._context.isPointInPath(i,t,e,s):this._context.isPointInPath(t,e,s)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,e,i,s){this._context.fillRect(t,e,i,s)}strokeRect(t,e,i,s){this._context.strokeRect(t,e,i,s)}fillText(t,e,i,s){s?this._context.fillText(t,e,i,s):this._context.fillText(t,e,i)}measureText(t){return this._context.measureText(t)}getImageData(t,e,i,s){return this._context.getImageData(t,e,i,s)}lineTo(t,e){this._context.lineTo(t,e)}moveTo(t,e){this._context.moveTo(t,e)}rect(t,e,i,s){this._context.rect(t,e,i,s)}roundRect(t,e,i,s,n){this._context.roundRect(t,e,i,s,n)}putImageData(t,e,i){this._context.putImageData(t,e,i)}quadraticCurveTo(t,e,i,s){this._context.quadraticCurveTo(t,e,i,s)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,e){this._context.scale(t,e)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,e,i,s,n,o){this._context.setTransform(t,e,i,s,n,o)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,e,i,s){this._context.strokeText(t,e,i,s)}transform(t,e,i,s,n,o){this._context.transform(t,e,i,s,n,o)}translate(t,e){this._context.translate(t,e)}_enableTrace(){let t=this,e=aa.length,i=this.setAttr,s,n;const o=function(a){let r=t[a],l;t[a]=function(){return n=Dd(Array.prototype.slice.call(arguments,0)),l=r.apply(t,arguments),t._trace({method:a,args:n}),l}};for(s=0;s{e.dragStatus==="dragging"&&(t=!0)}),t},justDragged:!1,get node(){let t;return ce._dragElements.forEach(e=>{t=e.node}),t},_dragElements:new Map,_drag(t){const e=[];ce._dragElements.forEach((i,s)=>{const{node:n}=i,o=n.getStage();o.setPointersPositions(t),i.pointerId===void 0&&(i.pointerId=R._getFirstPointerId(t));const a=o._changedPointerPositions.find(r=>r.id===i.pointerId);if(a){if(i.dragStatus!=="dragging"){const r=n.dragDistance();if(Math.max(Math.abs(a.x-i.startPointerPos.x),Math.abs(a.y-i.startPointerPos.y)){i.getStage()&&i.fire("dragmove",{type:"dragmove",target:i,evt:t},!0)})},_endDragBefore(t){const e=[];ce._dragElements.forEach(i=>{const{node:s}=i,n=s.getStage();if(t&&n.setPointersPositions(t),!n._changedPointerPositions.find(a=>a.id===i.pointerId))return;(i.dragStatus==="dragging"||i.dragStatus==="stopped")&&(ce.justDragged=!0,K._mouseListenClick=!1,K._touchListenClick=!1,K._pointerListenClick=!1,i.dragStatus="stopped");const o=i.node.getLayer()||i.node instanceof K.Stage&&i.node;o&&e.indexOf(o)===-1&&e.push(o)}),e.forEach(i=>{i.draw()})},_endDragAfter(t){ce._dragElements.forEach((e,i)=>{e.dragStatus==="stopped"&&e.node.fire("dragend",{type:"dragend",target:e.node,evt:t},!0),e.dragStatus!=="dragging"&&ce._dragElements.delete(i)})}};K.isBrowser&&(window.addEventListener("mouseup",ce._endDragBefore,!0),window.addEventListener("touchend",ce._endDragBefore,!0),window.addEventListener("touchcancel",ce._endDragBefore,!0),window.addEventListener("mousemove",ce._drag),window.addEventListener("touchmove",ce._drag),window.addEventListener("mouseup",ce._endDragAfter,!1),window.addEventListener("touchend",ce._endDragAfter,!1),window.addEventListener("touchcancel",ce._endDragAfter,!1));function xt(t){return R._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||R._isBoolean(t)?t:Object.prototype.toString.call(t)}function se(){if(K.isUnminified)return function(t,e){return R._isNumber(t)||R.warn(xt(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}function la(t){if(K.isUnminified)return function(e,i){let s=R._isNumber(e),n=R._isArray(e)&&e.length==t;return!s&&!n&&R.warn(xt(e)+' is a not valid value for "'+i+'" attribute. The value should be a number or Array('+t+")"),e}}function cn(){if(K.isUnminified)return function(t,e){return R._isNumber(t)||t==="auto"||R.warn(xt(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function Mt(){if(K.isUnminified)return function(t,e){return R._isString(t)||R.warn(xt(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function ca(){if(K.isUnminified)return function(t,e){const i=R._isString(t),s=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return i||s||R.warn(xt(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function Qd(){if(K.isUnminified)return function(t,e){const i=Int8Array?Object.getPrototypeOf(Int8Array):null;return i&&t instanceof i||(R._isArray(t)?t.forEach(function(s){R._isNumber(s)||R.warn('"'+e+'" attribute has non numeric element '+s+". Make sure that all elements are numbers.")}):R.warn(xt(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}function ut(){if(K.isUnminified)return function(t,e){return t===!0||t===!1||R.warn(xt(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}function Jd(t){if(K.isUnminified)return function(e,i){return e==null||R.isObject(e)||R.warn(xt(e)+' is a not valid value for "'+i+'" attribute. The value should be an object with properties '+t),e}}var ui="get",pi="set",O={addGetterSetter(t,e,i,s,n){O.addGetter(t,e,i),O.addSetter(t,e,s,n),O.addOverloadedGetterSetter(t,e)},addGetter(t,e,i){const s=ui+R._capitalize(e);t.prototype[s]=t.prototype[s]||function(){const n=this.attrs[e];return n===void 0?i:n}},addSetter(t,e,i,s){const n=pi+R._capitalize(e);t.prototype[n]||O.overWriteSetter(t,e,i,s)},overWriteSetter(t,e,i,s){const n=pi+R._capitalize(e);t.prototype[n]=function(o){return i&&o!==void 0&&o!==null&&(o=i.call(this,o,e)),this._setAttr(e,o),s&&s.call(this),this}},addComponentsGetterSetter(t,e,i,s,n){const o=i.length,a=R._capitalize,r=ui+a(e),l=pi+a(e);t.prototype[r]=function(){const d={};for(let u=0;u{this._setAttr(e+a(h),void 0)}),this._fireChangeEvent(e,u,d),n&&n.call(this),this},O.addOverloadedGetterSetter(t,e)},addOverloadedGetterSetter(t,e){const i=R._capitalize(e),s=pi+i,n=ui+i;t.prototype[e]=function(){return arguments.length?(this[s](arguments[0]),this):this[n]()}},addDeprecatedGetterSetter(t,e,i,s){R.error("Adding deprecated "+e);const n=ui+R._capitalize(e),o=e+" property is deprecated and will be removed soon. Look at Konva change log for more information.";t.prototype[n]=function(){R.error(o);const a=this.attrs[e];return a===void 0?i:a},O.addSetter(t,e,s,function(){R.error(o)}),O.addOverloadedGetterSetter(t,e)},backCompat(t,e){R.each(e,function(i,s){const n=t.prototype[s],o=ui+R._capitalize(i),a=pi+R._capitalize(i);function r(){n.apply(this,arguments),R.error('"'+i+'" method is deprecated and will be removed soon. Use ""'+s+'" instead.')}t.prototype[i]=r,t.prototype[o]=r,t.prototype[a]=r})},afterSetFilter(){this._filterUpToDate=!1}};function eh(t){const e=/(\w+)\(([^)]+)\)/g;let i;for(;(i=e.exec(t))!==null;){const[,s,n]=i;switch(s){case"blur":{const o=parseFloat(n.replace("px",""));return function(a){this.blurRadius(o*.5);const r=K.Filters;r&&r.Blur&&r.Blur.call(this,a)}}case"brightness":{const o=n.includes("%")?parseFloat(n)/100:parseFloat(n);return function(a){this.brightness(o);const r=K.Filters;r&&r.Brightness&&r.Brightness.call(this,a)}}case"contrast":{const o=parseFloat(n);return function(a){const r=100*(Math.sqrt(o)-1);this.contrast(r);const l=K.Filters;l&&l.Contrast&&l.Contrast.call(this,a)}}case"grayscale":return function(o){const a=K.Filters;a&&a.Grayscale&&a.Grayscale.call(this,o)};case"sepia":return function(o){const a=K.Filters;a&&a.Sepia&&a.Sepia.call(this,o)};case"invert":return function(o){const a=K.Filters;a&&a.Invert&&a.Invert.call(this,o)};default:R.warn(`CSS filter "${s}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}var rs="absoluteOpacity",da="allEventListeners",pt="absoluteTransform",ha="absoluteScale",_t="canvas",th="Change",ih="children",sh="konva",dn="listening",nh="mouseenter",oh="mouseleave",ah="pointerenter",rh="pointerleave",lh="touchenter",ch="touchleave",ua="set",pa="Shape",ls=" ",fa="stage",St="transform",dh="Stage",hn="visible",hh=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(ls),uh=1,te=class ji{constructor(e){this._id=uh++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===St||e===pt)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,i){let s=this._cache.get(e);return(s===void 0||(e===St||e===pt)&&s.dirty===!0)&&(s=i.call(this),this._cache.set(e,s)),s}_calculate(e,i,s){if(!this._attachedDepsListeners.get(e)){const n=i.map(o=>o+"Change.konva").join(ls);this.on(n,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,s)}_getCanvasCache(){return this._cache.get(_t)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===pt&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(_t)){const{scene:e,filter:i,hit:s}=this._cache.get(_t);R.releaseCanvas(e._canvas,i._canvas,s._canvas),this._cache.delete(_t)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){const i=e||{};let s={};(i.x===void 0||i.y===void 0||i.width===void 0||i.height===void 0)&&(s=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let n=Math.ceil(i.width||s.width),o=Math.ceil(i.height||s.height),a=i.pixelRatio,r=i.x===void 0?Math.floor(s.x):i.x,l=i.y===void 0?Math.floor(s.y):i.y,c=i.offset||0,d=i.drawBorder||!1,u=i.hitCanvasPixelRatio||1;if(!n||!o){R.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const h=Math.abs(Math.round(s.x)-r)>.5?1:0,p=Math.abs(Math.round(s.y)-l)>.5?1:0;n+=c*2+h,o+=c*2+p,r-=c,l-=c;const f=new wt({pixelRatio:a,width:n,height:o}),v=new wt({pixelRatio:a,width:0,height:0,willReadFrequently:!0}),m=new ln({pixelRatio:u,width:n,height:o}),g=f.getContext(),b=m.getContext(),y=new wt({width:f.width/f.pixelRatio+Math.abs(r),height:f.height/f.pixelRatio+Math.abs(l),pixelRatio:f.pixelRatio}),k=y.getContext();return m.isCache=!0,f.isCache=!0,this._cache.delete(_t),this._filterUpToDate=!1,i.imageSmoothingEnabled===!1&&(f.getContext()._context.imageSmoothingEnabled=!1,v.getContext()._context.imageSmoothingEnabled=!1),g.save(),b.save(),k.save(),g.translate(-r,-l),b.translate(-r,-l),k.translate(-r,-l),y.x=r,y.y=l,this._isUnderCache=!0,this._clearSelfAndDescendantCache(rs),this._clearSelfAndDescendantCache(ha),this.drawScene(f,this,y),this.drawHit(m,this),this._isUnderCache=!1,g.restore(),b.restore(),d&&(g.save(),g.beginPath(),g.rect(0,0,n,o),g.closePath(),g.setAttr("strokeStyle","red"),g.setAttr("lineWidth",5),g.stroke(),g.restore()),R.releaseCanvas(y._canvas),this._cache.set(_t,{scene:f,filter:v,hit:m,x:r,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(_t)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,i){const s=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}];let n=1/0,o=1/0,a=-1/0,r=-1/0;const l=this.getAbsoluteTransform(i);return s.forEach(function(c){const d=l.point(c);n===void 0&&(n=a=d.x,o=r=d.y),n=Math.min(n,d.x),o=Math.min(o,d.y),a=Math.max(a,d.x),r=Math.max(r,d.y)}),{x:n,y:o,width:a-n,height:r-o}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const i=this._getCanvasCache();e.translate(i.x,i.y);const s=this._getCachedSceneCanvas(),n=s.pixelRatio;e.drawImage(s._canvas,0,0,s.width/n,s.height/n),e.restore()}_drawCachedHitCanvas(e){const i=this._getCanvasCache(),s=i.hit;e.save(),e.translate(i.x,i.y),e.drawImage(s._canvas,0,0,s.width/s.pixelRatio,s.height/s.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),i=this._getCanvasCache(),s=i.scene,n=i.filter,o=n.getContext(),a,r,l,c;if(!e||e.length===0)return s;if(this._filterUpToDate)return n;let d=!0;for(let h=0;h{this.isAncestorOf(e.node)&&ce._dragElements.delete(i)}),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(pt),this._clearSelfAndDescendantCache(rs),this._clearSelfAndDescendantCache(ha),this._clearSelfAndDescendantCache(fa),this._clearSelfAndDescendantCache(hn),this._clearSelfAndDescendantCache(dn)}_remove(){this._clearCaches();const e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){const i="get"+R._capitalize(e);return R._isFunction(this[i])?this[i]():this.attrs[e]}getAncestors(){let e=this.getParent(),i=[];for(;e;)i.push(e),e=e.getParent();return i}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let i,s;if(!e)return this;for(i in e)i!==ih&&(s=ua+R._capitalize(i),R._isFunction(this[s])?this[s](e[i]):this._setAttr(i,e[i]))}),this}isListening(){return this._getCache(dn,this._isListening)}_isListening(e){if(!this.listening())return!1;const i=this.getParent();return i&&i!==e&&this!==e?i._isListening(e):!0}isVisible(){return this._getCache(hn,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const i=this.getParent();return i&&i!==e&&this!==e?i._isVisible(e):!0}shouldDrawHit(e,i=!1){if(e)return this._isVisible(e)&&this._isListening(e);const s=this.getLayer();let n=!1;ce._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===s)&&(n=!0)});const o=!i&&!K.hitOnDragEnabled&&(n||K.isTransforming());return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),i=this,s=0,n,o,a,r;function l(d){for(n=[],o=d.length,a=0;a0&&n[0].getDepth()<=e&&l(n)}const c=this.getStage();return i.nodeType!==dh&&c&&l(c.getChildren()),s}getDepth(){let e=0,i=this.parent;for(;i;)e++,i=i.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(St),this._clearSelfAndDescendantCache(pt)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;const i=e.getPointerPosition();if(!i)return null;const s=this.getAbsoluteTransform().copy();return s.invert(),s.point(i)}getAbsolutePosition(e){let i=!1,s=this.parent;for(;s;){if(s.isCached()){i=!0;break}s=s.parent}i&&!e&&(e=!0);const n=this.getAbsoluteTransform(e).getMatrix(),o=new Wt,a=this.offset();return o.m=n.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(e){const{x:i,y:s,...n}=this._clearTransform();this.attrs.x=i,this.attrs.y=s,this._clearCache(St);const o=this._getAbsoluteTransform().copy();return o.invert(),o.translate(e.x,e.y),e={x:this.attrs.x+o.getTranslation().x,y:this.attrs.y+o.getTranslation().y},this._setTransform(n),this.setPosition({x:e.x,y:e.y}),this._clearCache(St),this._clearSelfAndDescendantCache(pt),this}_setTransform(e){let i;for(i in e)this.attrs[i]=e[i]}_clearTransform(){const e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){let i=e.x,s=e.y,n=this.x(),o=this.y();return i!==void 0&&(n+=i),s!==void 0&&(o+=s),this.setPosition({x:n,y:o}),this}_eachAncestorReverse(e,i){let s=[],n=this.getParent(),o,a;if(!(i&&i._id===this._id)){for(s.unshift(this);n&&(!i||n._id!==i._id);)s.unshift(n),n=n.parent;for(o=s.length,a=0;a0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return R.warn("Node has no parent. moveToBottom function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return R.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&R.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const i=this.index;return this.parent.children.splice(i,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(rs,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity();const i=this.getParent();return i&&!i._isUnderCache&&(e*=i.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),i,s,n,o,a;const r={attrs:{},className:this.getClassName()};for(i in e)s=e[i],a=R.isObject(s)&&!R._isPlainObject(s)&&!R._isArray(s),!a&&(n=typeof this[i]=="function"&&this[i],delete e[i],o=n?n.call(this):null,e[i]=s,o!==s&&(r.attrs[i]=s));return R._prepareToStringify(r)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,i,s){const n=[];i&&this._isMatch(e)&&n.push(this);let o=this.parent;for(;o;){if(o===s)return n;o._isMatch(e)&&n.push(o),o=o.parent}return n}isAncestorOf(e){return!1}findAncestor(e,i,s){return this.findAncestors(e,i,s)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);let i=e.replace(/ /g,"").split(","),s=i.length,n,o;for(n=0;n{try{const n=e==null?void 0:e.callback;n&&delete e.callback,R._urlToImage(this.toDataURL(e),function(o){i(o),n==null||n(o)})}catch(n){s(n)}})}toBlob(e){return new Promise((i,s)=>{try{const n=e==null?void 0:e.callback;n&&delete e.callback,this.toCanvas(e).toBlob(o=>{i(o),n==null||n(o)},e==null?void 0:e.mimeType,e==null?void 0:e.quality)}catch(n){s(n)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():K.dragDistance}_off(e,i,s){let n=this.eventListeners[e],o,a,r;for(o=0;o=0)||this.isDragging())return;let i=!1;ce._dragElements.forEach(s=>{this.isAncestorOf(s.node)&&(i=!0)}),i||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const e=ce._dragElements.get(this._id),i=e&&e.dragStatus==="dragging",s=e&&e.dragStatus==="ready";i?this.stopDrag():s&&ce._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const i=this.getStage();if(!i)return!1;const s={x:-e.x,y:-e.y,width:i.width()+2*e.x,height:i.height()+2*e.y};return R.haveIntersection(s,this.getClientRect())}static create(e,i){return R._isString(e)&&(e=JSON.parse(e)),this._createNode(e,i)}static _createNode(e,i){let s=ji.prototype.getClassName.call(e),n=e.children,o,a,r;i&&(e.attrs.container=i),K[s]||(R.warn('Can not find a node with class name "'+s+'". Fallback to "Shape".'),s="Shape");const l=K[s];if(o=new l(e.attrs),n)for(a=n.length,r=0;r0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(let i=0;i0?e[0]:void 0}_generalFind(t,e){const i=[];return this._descendants(s=>{const n=s._isMatch(t);return n&&i.push(s),!!(n&&e)}),i}_descendants(t){let e=!1;const i=this.getChildren();for(const s of i){if(e=t(s),e)return!0;if(s.hasChildren()&&(e=s._descendants(t),e))return!0}return!1}toObject(){const t=te.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(e=>{t.children.push(e.toObject())}),t}isAncestorOf(t){let e=t.getParent();for(;e;){if(e._id===this._id)return!0;e=e.getParent()}return!1}clone(t){const e=te.prototype.clone.call(this,t);return this.getChildren().forEach(function(i){e.add(i.clone())}),e}getAllIntersections(t){const e=[];return this.find("Shape").forEach(i=>{i.isVisible()&&i.intersects(t)&&e.push(i)}),e}_clearSelfAndDescendantCache(t){var e;super._clearSelfAndDescendantCache(t),!this.isCached()&&((e=this.children)===null||e===void 0||e.forEach(function(i){i._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(e,i){e.index=i}),this._requestDraw()}drawScene(t,e,i){const s=this.getLayer(),n=t||s&&s.getCanvas(),o=n&&n.getContext(),a=this._getCanvasCache(),r=a&&a.scene,l=n&&n.isCache;if(!this.isVisible()&&!l)return this;if(r){o.save();const c=this.getAbsoluteTransform(e).getMatrix();o.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",n,e,i);return this}drawHit(t,e){if(!this.shouldDrawHit(e))return this;const i=this.getLayer(),s=t||i&&i.hitCanvas,n=s&&s.getContext(),o=this._getCanvasCache();if(o&&o.hit){n.save();const a=this.getAbsoluteTransform(e).getMatrix();n.transform(a[0],a[1],a[2],a[3],a[4],a[5]),this._drawCachedHitCanvas(n),n.restore()}else this._drawChildren("drawHit",s,e);return this}_drawChildren(t,e,i,s){var n;const o=e&&e.getContext(),a=this.clipWidth(),r=this.clipHeight(),l=this.clipFunc(),c=typeof a=="number"&&typeof r=="number"||l,d=i===this;if(c){o.save();const h=this.getAbsoluteTransform(i);let p=h.getMatrix();o.transform(p[0],p[1],p[2],p[3],p[4],p[5]),o.beginPath();let f;if(l)f=l.call(this,o,this);else{const v=this.clipX(),m=this.clipY();o.rect(v||0,m||0,a,r)}o.clip.apply(o,f),p=h.copy().invert().getMatrix(),o.transform(p[0],p[1],p[2],p[3],p[4],p[5])}const u=!d&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";u&&(o.save(),o._applyGlobalCompositeOperation(this)),(n=this.children)===null||n===void 0||n.forEach(function(h){h[t](e,i,s)}),u&&o.restore(),c&&o.restore()}getClientRect(t={}){var e;const i=t.skipTransform,s=t.relativeTo;let n,o,a,r,l={x:1/0,y:1/0,width:0,height:0};const c=this;(e=this.children)===null||e===void 0||e.forEach(function(h){if(!h.visible())return;const p=h.getClientRect({relativeTo:c,skipShadow:t.skipShadow,skipStroke:t.skipStroke});p.width===0&&p.height===0||(n===void 0?(n=p.x,o=p.y,a=p.x+p.width,r=p.y+p.height):(n=Math.min(n,p.x),o=Math.min(o,p.y),a=Math.max(a,p.x+p.width),r=Math.max(r,p.y+p.height)))});const d=this.find("Shape");let u=!1;for(let h=0;ht.indexOf("pointer")>=0?"pointer":t.indexOf("touch")>=0?"touch":"mouse",Yt=t=>{const e=ki(t);if(e==="pointer")return K.pointerEventsEnabled&&mn.pointer;if(e==="touch")return mn.touch;if(e==="mouse")return mn.mouse};function Ia(t={}){return(t.clipFunc||t.clipWidth||t.clipHeight)&&R.warn("Stage does not support clipping. Please use clip for Layers or Groups."),t}var yh="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",wi=[],xi=class extends Oe{constructor(t){super(Ia(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),wi.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{Ia(this.attrs)}),this._checkVisibility()}_validateAdd(t){const e=t.getType()==="Layer",i=t.getType()==="FastLayer";e||i||R.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if(typeof t===fh){let e;if(t.charAt(0)==="."){const i=t.slice(1);t=document.getElementsByClassName(i)[0]}else t.charAt(0)!=="#"?e=t:e=t.slice(1),t=document.getElementById(e);if(!t)throw"Can not find container in document with id "+e}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const t=this.children,e=t.length;for(let i=0;i-1&&wi.splice(e,1),R.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(R.warn(yh),null)}_getPointerById(t){return this._pointerPositions.find(e=>e.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){t={...t},t.x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();const e=new wt({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),i=e.getContext()._context,s=this.children;return(t.x||t.y)&&i.translate(-1*t.x,-1*t.y),s.forEach(function(n){if(!n.isVisible())return;const o=n._toKonvaCanvas(t);i.drawImage(o._canvas,t.x,t.y,o.getWidth()/o.getPixelRatio(),o.getHeight()/o.getPixelRatio())}),e}getIntersection(t){if(!t)return null;const e=this.children,i=e.length-1;for(let s=i;s>=0;s--){const n=e[s].getIntersection(t);if(n)return n}return null}_resizeDOM(){const t=this.width(),e=this.height();this.content&&(this.content.style.width=t+ba,this.content.style.height=e+ba),this.bufferCanvas.setSize(t,e),this.bufferHitCanvas.setSize(t,e),this.children.forEach(i=>{i.setSize({width:t,height:e}),i.draw()})}add(t,...e){if(arguments.length>1){for(let s=0;sgh&&R.warn("The stage has "+i+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),K.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return ma(t,this)}setPointerCapture(t){ga(t,this)}releaseCapture(t){vi(t,this)}getLayers(){return this.children}_bindContentEvents(){K.isBrowser&&bh.forEach(([t,e])=>{this.content.addEventListener(t,i=>{this[e](i)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);const e=Yt(t.type);e&&this._fire(e.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);const e=Yt(t.type);e&&this._fire(e.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let e=this[t+"targetShape"];return e&&!e.getStage()&&(e=null),e}_pointerleave(t){const e=Yt(t.type),i=ki(t.type);if(!e)return;this.setPointersPositions(t);const s=this._getTargetShape(i),n=!(K.isDragging()||K.isTransforming())||K.hitOnDragEnabled;s&&n?(s._fireAndBubble(e.pointerout,{evt:t}),s._fireAndBubble(e.pointerleave,{evt:t}),this._fire(e.pointerleave,{evt:t,target:this,currentTarget:this}),this[i+"targetShape"]=null):n&&(this._fire(e.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(e.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(t){const e=Yt(t.type),i=ki(t.type);if(!e)return;this.setPointersPositions(t);let s=!1;this._changedPointerPositions.forEach(n=>{const o=this.getIntersection(n);if(ce.justDragged=!1,K["_"+i+"ListenClick"]=!0,!o||!o.isListening()){this[i+"ClickStartShape"]=void 0;return}K.capturePointerEventsEnabled&&o.setPointerCapture(n.id),this[i+"ClickStartShape"]=o,o._fireAndBubble(e.pointerdown,{evt:t,pointerId:n.id}),s=!0;const a=t.type.indexOf("touch")>=0;o.preventDefault()&&t.cancelable&&a&&t.preventDefault()}),s||this._fire(e.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(t){const e=Yt(t.type),i=ki(t.type);if(!e)return;const s=t.type.indexOf("touch")>=0||t.pointerType==="touch";if(K.isDragging()&&ce.node.preventDefault()&&t.cancelable&&s&&t.preventDefault(),this.setPointersPositions(t),!(!(K.isDragging()||K.isTransforming())||K.hitOnDragEnabled))return;const n={};let o=!1;const a=this._getTargetShape(i);this._changedPointerPositions.forEach(r=>{const l=un(r.id)||this.getIntersection(r),c=r.id,d={evt:t,pointerId:c},u=a!==l;if(u&&a&&(a._fireAndBubble(e.pointerout,{...d},l),a._fireAndBubble(e.pointerleave,{...d},l)),l){if(n[l._id])return;n[l._id]=!0}l&&l.isListening()?(o=!0,u&&(l._fireAndBubble(e.pointerover,{...d},a),l._fireAndBubble(e.pointerenter,{...d},a),this[i+"targetShape"]=l),l._fireAndBubble(e.pointermove,{...d})):a&&(this._fire(e.pointerover,{evt:t,target:this,currentTarget:this,pointerId:c}),this[i+"targetShape"]=null)}),o||this._fire(e.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){const e=Yt(t.type),i=ki(t.type);if(!e)return;this.setPointersPositions(t);const s=this[i+"ClickStartShape"],n=this[i+"ClickEndShape"],o={};let a=!1;this._changedPointerPositions.forEach(r=>{const l=un(r.id)||this.getIntersection(r);if(l){if(l.releaseCapture(r.id),o[l._id])return;o[l._id]=!0}const c=r.id,d={evt:t,pointerId:c};let u=!1;K["_"+i+"InDblClickWindow"]?(u=!0,clearTimeout(this[i+"DblTimeout"])):ce.justDragged||(K["_"+i+"InDblClickWindow"]=!0,clearTimeout(this[i+"DblTimeout"])),this[i+"DblTimeout"]=setTimeout(function(){K["_"+i+"InDblClickWindow"]=!1},K.dblClickWindow),l&&l.isListening()?(a=!0,this[i+"ClickEndShape"]=l,l._fireAndBubble(e.pointerup,{...d}),K["_"+i+"ListenClick"]&&s&&s===l&&(l._fireAndBubble(e.pointerclick,{...d}),u&&n&&n===l&&l._fireAndBubble(e.pointerdblclick,{...d}))):(this[i+"ClickEndShape"]=null,a||(this._fire(e.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),a=!0),K["_"+i+"ListenClick"]&&this._fire(e.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:c}),u&&this._fire(e.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:c}))}),a||this._fire(e.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),K["_"+i+"ListenClick"]=!1,t.cancelable&&i!=="touch"&&i!=="pointer"&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);const e=this.getIntersection(this.getPointerPosition());e&&e.isListening()?e._fireAndBubble(fn,{evt:t}):this._fire(fn,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);const e=this.getIntersection(this.getPointerPosition());e&&e.isListening()?e._fireAndBubble(vn,{evt:t}):this._fire(vn,{evt:t,target:this,currentTarget:this})}_pointercancel(t){this.setPointersPositions(t);const e=un(t.pointerId)||this.getIntersection(this.getPointerPosition());e&&e._fireAndBubble(Kt,pn(t)),vi(t.pointerId)}_lostpointercapture(t){vi(t.pointerId)}setPointersPositions(t){const e=this._getContentPosition();let i=null,s=null;t=t||window.event,t.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,n=>{this._pointerPositions.push({id:n.identifier,x:(n.clientX-e.left)/e.scaleX,y:(n.clientY-e.top)/e.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,n=>{this._changedPointerPositions.push({id:n.identifier,x:(n.clientX-e.left)/e.scaleX,y:(n.clientY-e.top)/e.scaleY})})):(i=(t.clientX-e.left)/e.scaleX,s=(t.clientY-e.top)/e.scaleY,this.pointerPos={x:i,y:s},this._pointerPositions=[{x:i,y:s,id:R._getFirstPointerId(t)}],this._changedPointerPositions=[{x:i,y:s,id:R._getFirstPointerId(t)}])}_setPointerPosition(t){R.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const t=this.content.getBoundingClientRect();return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new wt({width:this.width(),height:this.height()}),this.bufferHitCanvas=new ln({pixelRatio:1,width:this.width(),height:this.height()}),!K.isBrowser)return;const t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}cache(){return R.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(t){t.batchDraw()}),this}};xi.prototype.nodeType=ph,$e(xi),O.addGetterSetter(xi,"container"),K.isBrowser&&document.addEventListener("visibilitychange",()=>{wi.forEach(t=>{t.batchDraw()})});var Ma="hasShadow",_a="shadowRGBA",Pa="patternImage",Ra="linearGradient",$a="radialGradient",us;function gn(){return us||(us=R.createCanvasElement().getContext("2d"),us)}var Si={};function kh(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function wh(t){t.stroke()}function xh(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function Sh(t){t.stroke()}function Ch(){this._clearCache(Ma)}function Th(){this._clearCache(_a)}function Lh(){this._clearCache(Pa)}function Ah(){this._clearCache(Ra)}function Eh(){this._clearCache($a)}var q=class extends te{constructor(t){super(t);let e,i=0;for(;e=R.getHitColor(),!(e&&!(e in Si));)if(i++,i>=1e4){R.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),e=R.getRandomColor();break}this.colorKey=e,Si[e]=this}getContext(){return R.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return R.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(Ma,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(Pa,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const t=gn().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(t&&t.setTransform){const e=new Wt;e.translate(this.fillPatternX(),this.fillPatternY()),e.rotate(K.getAngle(this.fillPatternRotation())),e.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),e.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=e.getMatrix(),s=typeof DOMMatrix=="undefined"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);t.setTransform(s)}return t}}_getLinearGradient(){return this._getCache(Ra,this.__getLinearGradient)}__getLinearGradient(){const t=this.fillLinearGradientColorStops();if(t){const e=gn(),i=this.fillLinearGradientStartPoint(),s=this.fillLinearGradientEndPoint(),n=e.createLinearGradient(i.x,i.y,s.x,s.y);for(let o=0;othis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const t=this.hitStrokeWidth();return t==="auto"?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){const e=this.getStage();if(!e)return!1;const i=e.bufferHitCanvas;return i.getContext().clear(),this.drawHit(i,void 0,!0),i.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data[3]>0}destroy(){return te.prototype.destroy.call(this),delete Si[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var e;if(!(!((e=this.attrs.perfectDrawEnabled)!==null&&e!==void 0)||e))return!1;const i=t||this.hasFill(),s=this.hasStroke(),n=this.getAbsoluteOpacity()!==1;if(i&&s&&n)return!0;const o=this.hasShadow(),a=this.shadowForStrokeEnabled();return!!(i&&s&&o&&a)}setStrokeHitEnabled(t){R.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){let e=!1,i=this.getParent();for(;i;){if(i.isCached()){e=!0;break}i=i.getParent()}const s=t.skipTransform,n=t.relativeTo||e&&this.getStage()||void 0,o=this.getSelfRect(),a=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,r=o.width+a,l=o.height+a,c=!t.skipShadow&&this.hasShadow(),d=c?this.shadowOffsetX():0,u=c?this.shadowOffsetY():0,h=r+Math.abs(d),p=l+Math.abs(u),f=c&&this.shadowBlur()||0,v={width:h+f*2,height:p+f*2,x:-(a/2+f)+Math.min(d,0)+o.x,y:-(a/2+f)+Math.min(u,0)+o.y};return s?v:this._transformedRect(v,n)}drawScene(t,e,i){const s=this.getLayer(),n=(t||s.getCanvas()).getContext(),o=this._getCanvasCache(),a=this.getSceneFunc(),r=this.hasShadow();let l;const c=e===this;if(!this.isVisible()&&!c)return this;if(o){n.save();const d=this.getAbsoluteTransform(e).getMatrix();return n.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedSceneCanvas(n),n.restore(),this}if(!a)return this;if(n.save(),this._useBufferCanvas()){l=this.getStage();const d=i||l.bufferCanvas,u=d.getContext();i?(u.save(),u.setTransform(1,0,0,1,0,0),u.clearRect(0,0,d.width,d.height),u.restore()):u.clear(),u.save(),u._applyLineJoin(this),u._applyMiterLimit(this);const h=this.getAbsoluteTransform(e).getMatrix();u.transform(h[0],h[1],h[2],h[3],h[4],h[5]),a.call(this,u,this),u.restore();const p=d.pixelRatio;r&&n._applyShadow(this),c||(n._applyOpacity(this),n._applyGlobalCompositeOperation(this)),n.drawImage(d._canvas,d.x||0,d.y||0,d.width/p,d.height/p)}else{if(n._applyLineJoin(this),n._applyMiterLimit(this),!c){const d=this.getAbsoluteTransform(e).getMatrix();n.transform(d[0],d[1],d[2],d[3],d[4],d[5]),n._applyOpacity(this),n._applyGlobalCompositeOperation(this)}r&&n._applyShadow(this),a.call(this,n,this)}return n.restore(),this}drawHit(t,e,i=!1){if(!this.shouldDrawHit(e,i))return this;const s=this.getLayer(),n=t||s.hitCanvas,o=n&&n.getContext(),a=this.hitFunc()||this.sceneFunc(),r=this._getCanvasCache(),l=r&&r.hit;if(this.colorKey||R.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),l){o.save();const c=this.getAbsoluteTransform(e).getMatrix();return o.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedHitCanvas(o),o.restore(),this}if(!a)return this;if(o.save(),o._applyLineJoin(this),o._applyMiterLimit(this),this!==e){const c=this.getAbsoluteTransform(e).getMatrix();o.transform(c[0],c[1],c[2],c[3],c[4],c[5])}return a.call(this,o,this),o.restore(),this}drawHitFromCache(t=0){const e=this._getCanvasCache(),i=this._getCachedSceneCanvas(),s=e.hit,n=s.getContext(),o=s.getWidth(),a=s.getHeight();n.clear(),n.drawImage(i._canvas,0,0,o,a);try{const r=n.getImageData(0,0,o,a),l=r.data,c=l.length,d=R._hexToRgb(this.colorKey);for(let u=0;ut?(l[u]=d.r,l[u+1]=d.g,l[u+2]=d.b,l[u+3]=255):l[u+3]=0;n.putImageData(r,0,0)}catch(r){R.error("Unable to draw hit graph from cached scene canvas. "+r.message)}return this}hasPointerCapture(t){return ma(t,this)}setPointerCapture(t){ga(t,this)}releaseCapture(t){vi(t,this)}};q.prototype._fillFunc=kh,q.prototype._strokeFunc=wh,q.prototype._fillFuncHit=xh,q.prototype._strokeFuncHit=Sh,q.prototype._centroid=!1,q.prototype.nodeType="Shape",$e(q),q.prototype.eventListeners={},q.prototype.on("shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",Ch),q.prototype.on("shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",Th),q.prototype.on("fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",Lh),q.prototype.on("fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",Ah),q.prototype.on("fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",Eh),O.addGetterSetter(q,"stroke",void 0,ca()),O.addGetterSetter(q,"strokeWidth",2,se()),O.addGetterSetter(q,"fillAfterStrokeEnabled",!1),O.addGetterSetter(q,"hitStrokeWidth","auto",cn()),O.addGetterSetter(q,"strokeHitEnabled",!0,ut()),O.addGetterSetter(q,"perfectDrawEnabled",!0,ut()),O.addGetterSetter(q,"shadowForStrokeEnabled",!0,ut()),O.addGetterSetter(q,"lineJoin"),O.addGetterSetter(q,"lineCap"),O.addGetterSetter(q,"miterLimit"),O.addGetterSetter(q,"sceneFunc"),O.addGetterSetter(q,"hitFunc"),O.addGetterSetter(q,"dash"),O.addGetterSetter(q,"dashOffset",0,se()),O.addGetterSetter(q,"shadowColor",void 0,Mt()),O.addGetterSetter(q,"shadowBlur",0,se()),O.addGetterSetter(q,"shadowOpacity",1,se()),O.addComponentsGetterSetter(q,"shadowOffset",["x","y"]),O.addGetterSetter(q,"shadowOffsetX",0,se()),O.addGetterSetter(q,"shadowOffsetY",0,se()),O.addGetterSetter(q,"fillPatternImage"),O.addGetterSetter(q,"fill",void 0,ca()),O.addGetterSetter(q,"fillPatternX",0,se()),O.addGetterSetter(q,"fillPatternY",0,se()),O.addGetterSetter(q,"fillLinearGradientColorStops"),O.addGetterSetter(q,"strokeLinearGradientColorStops"),O.addGetterSetter(q,"fillRadialGradientStartRadius",0),O.addGetterSetter(q,"fillRadialGradientEndRadius",0),O.addGetterSetter(q,"fillRadialGradientColorStops"),O.addGetterSetter(q,"fillPatternRepeat","repeat"),O.addGetterSetter(q,"fillEnabled",!0),O.addGetterSetter(q,"strokeEnabled",!0),O.addGetterSetter(q,"shadowEnabled",!0),O.addGetterSetter(q,"dashEnabled",!0),O.addGetterSetter(q,"strokeScaleEnabled",!0),O.addGetterSetter(q,"fillPriority","color"),O.addComponentsGetterSetter(q,"fillPatternOffset",["x","y"]),O.addGetterSetter(q,"fillPatternOffsetX",0,se()),O.addGetterSetter(q,"fillPatternOffsetY",0,se()),O.addComponentsGetterSetter(q,"fillPatternScale",["x","y"]),O.addGetterSetter(q,"fillPatternScaleX",1,se()),O.addGetterSetter(q,"fillPatternScaleY",1,se()),O.addComponentsGetterSetter(q,"fillLinearGradientStartPoint",["x","y"]),O.addComponentsGetterSetter(q,"strokeLinearGradientStartPoint",["x","y"]),O.addGetterSetter(q,"fillLinearGradientStartPointX",0),O.addGetterSetter(q,"strokeLinearGradientStartPointX",0),O.addGetterSetter(q,"fillLinearGradientStartPointY",0),O.addGetterSetter(q,"strokeLinearGradientStartPointY",0),O.addComponentsGetterSetter(q,"fillLinearGradientEndPoint",["x","y"]),O.addComponentsGetterSetter(q,"strokeLinearGradientEndPoint",["x","y"]),O.addGetterSetter(q,"fillLinearGradientEndPointX",0),O.addGetterSetter(q,"strokeLinearGradientEndPointX",0),O.addGetterSetter(q,"fillLinearGradientEndPointY",0),O.addGetterSetter(q,"strokeLinearGradientEndPointY",0),O.addComponentsGetterSetter(q,"fillRadialGradientStartPoint",["x","y"]),O.addGetterSetter(q,"fillRadialGradientStartPointX",0),O.addGetterSetter(q,"fillRadialGradientStartPointY",0),O.addComponentsGetterSetter(q,"fillRadialGradientEndPoint",["x","y"]),O.addGetterSetter(q,"fillRadialGradientEndPointX",0),O.addGetterSetter(q,"fillRadialGradientEndPointY",0),O.addGetterSetter(q,"fillPatternRotation",0),O.addGetterSetter(q,"fillRule",void 0,Mt()),O.backCompat(q,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var Ih="beforeDraw",Mh="draw",Oa=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],_h=Oa.length,Qe=class extends Oe{constructor(t){super(t),this.canvas=new wt,this.hitCanvas=new ln({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);const e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),t{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;let e=1,i=!1;for(;;){for(let s=0;s<_h;s++){const n=Oa[s],o=this._getIntersection({x:t.x+n.x*e,y:t.y+n.y*e}),a=o.shape;if(a)return a;if(i=!!o.antialiased,!o.antialiased)break}if(i)e+=1;else return null}}_getIntersection(t){const e=this.hitCanvas.pixelRatio,i=this.hitCanvas.context.getImageData(Math.round(t.x*e),Math.round(t.y*e),1,1).data,s=i[3];if(s===255){const n=Si[R.getHitColorKey(i[0],i[1],i[2])];return n?{shape:n}:{antialiased:!0}}else if(s>0)return{antialiased:!0};return{}}drawScene(t,e,i){const s=this.getLayer(),n=t||s&&s.getCanvas();return this._fire(Ih,{node:this}),this.clearBeforeDraw()&&n.getContext().clear(),Oe.prototype.drawScene.call(this,n,e,i),this._fire(Mh,{node:this}),this}drawHit(t,e){const i=this.getLayer(),s=t||i&&i.hitCanvas;return i&&i.clearBeforeDraw()&&i.getHitCanvas().getContext().clear(),Oe.prototype.drawHit.call(this,s,e),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){R.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return R.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const t=this.parent;this.hitCanvas._canvas.parentNode?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}destroy(){return R.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Qe.prototype.nodeType="Layer",$e(Qe),O.addGetterSetter(Qe,"imageSmoothingEnabled",!0),O.addGetterSetter(Qe,"clearBeforeDraw",!0),O.addGetterSetter(Qe,"hitGraphEnabled",!0,ut());var bn=class extends Qe{constructor(t){super(t),this.listening(!1),R.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};bn.prototype.nodeType="FastLayer",$e(bn);var Ne=class extends Oe{_validateAdd(t){const e=t.getType();e!=="Group"&&e!=="Shape"&&R.throw("You may only add groups and shapes to groups.")}};Ne.prototype.nodeType="Group",$e(Ne);var yn=(function(){return It.performance&&It.performance.now?function(){return It.performance.now()}:function(){return new Date().getTime()}})(),Ci=class ri{constructor(e,i){this.id=ri.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:yn(),frameRate:0},this.func=e,this.setLayers(i)}setLayers(e){let i=[];return e&&(i=Array.isArray(e)?e:[e]),this.layers=i,this}getLayers(){return this.layers}addLayer(e){const i=this.layers,s=i.length;for(let n=0;nthis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return t===void 0&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=Fa,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=Ba,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const t=this.getTimer()-this._startTime;this.state===Fa?this.setTime(t):this.state===Ba&&this.setTime(this.duration-t)}pause(){this.state=Rh,this.fire("onPause")}getTimer(){return new Date().getTime()}},ps=class xe{constructor(e){const i=this,s=e.node,n=s._id,o=e.easing||Ti.Linear,a=!!e.yoyo;let r,l;typeof e.duration=="undefined"?r=.3:e.duration===0?r=.001:r=e.duration,this.node=s,this._id=$h++;const c=s.getLayer()||(s instanceof K.Stage?s.getLayers():null);c||R.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new Ci(function(){i.tween.onEnterFrame()},c),this.tween=new Oh(l,function(d){i._tweenFunc(d)},o,0,1,r*1e3,a),this._addListeners(),xe.attrs[n]||(xe.attrs[n]={}),xe.attrs[n][this._id]||(xe.attrs[n][this._id]={}),xe.tweens[n]||(xe.tweens[n]={});for(l in e)Ph[l]===void 0&&this._addAttr(l,e[l]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,i){const s=this.node,n=s._id;let o,a,r,l,c;const d=xe.tweens[n][e];d&&delete xe.attrs[n][d][e];let u=s.getAttr(e);if(R._isArray(i))if(o=[],a=Math.max(i.length,u.length),e==="points"&&i.length!==u.length&&(i.length>u.length?(l=u,u=R._prepareArrayForTween(u,i,s.closed())):(r=i,i=R._prepareArrayForTween(i,u,s.closed()))),e.indexOf("fill")===0)for(let h=0;h{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const e=this.node,i=xe.attrs[e._id][this._id];i.points&&i.points.trueEnd&&e.setAttr("points",i.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const e=this.node,i=xe.attrs[e._id][this._id];i.points&&i.points.trueStart&&e.points(i.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(e*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const e=this.node._id,i=this._id,s=xe.tweens[e];this.pause(),this.anim&&this.anim.stop();for(const n in s)delete xe.tweens[e][n];delete xe.attrs[e][i],xe.tweens[e]&&(Object.keys(xe.tweens[e]).length===0&&delete xe.tweens[e],Object.keys(xe.attrs[e]).length===0&&delete xe.attrs[e])}};ps.attrs={},ps.tweens={},te.prototype.to=function(t){const e=t.onFinish;t.node=this,t.onFinish=function(){this.destroy(),e&&e()},new ps(t).play()};var Ti={BackEaseIn(t,e,i,s){return i*(t/=s)*t*(2.70158*t-1.70158)+e},BackEaseOut(t,e,i,s){return i*((t=t/s-1)*t*(2.70158*t+1.70158)+1)+e},BackEaseInOut(t,e,i,s){let n=1.70158;return(t/=s/2)<1?i/2*(t*t*(((n*=1.525)+1)*t-n))+e:i/2*((t-=2)*t*(((n*=1.525)+1)*t+n)+2)+e},ElasticEaseIn(t,e,i,s,n,o){let a=0;return t===0?e:(t/=s)===1?e+i:(o||(o=s*.3),!n||n=0){const l=Math.sqrt(r);i.push((-o+l)/(2*n)),i.push((-o-l)/(2*n))}}}return i.filter(s=>s>0&&s<1).flatMap(s=>e.map(n=>{const o=1-s;return o*o*o*n[0]+3*o*o*s*n[1]+3*o*s*s*n[2]+s*s*s*n[3]}))}var Ee=class extends q{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){const e=this.points(),i=e.length,s=this.tension(),n=this.closed(),o=this.bezier();if(!i)return;let a=0;if(t.beginPath(),t.moveTo(e[0],e[1]),s!==0&&i>4){const r=this.getTensionPoints(),l=r.length;for(a=n?0:4,n||t.quadraticCurveTo(r[0],r[1],r[2],r[3]);a{if(/\p{Emoji}/u.test(i)){const o=n[s+1];o&&/\p{Emoji_Modifier}|\u200D/u.test(o)?(e.push(i+o),n[s+1]=""):e.push(i)}else/\p{Regional_Indicator}{2}/u.test(i+(n[s+1]||""))?e.push(i+n[s+1]):s>0&&/\p{Mn}|\p{Me}|\p{Mc}/u.test(i)?e[e.length-1]+=i:i&&e.push(i);return e},[])}var Xt="auto",Bh="center",Ha="inherit",Li="justify",zh="Change.konva",Na="2d",Va="-",Ga="left",Dh="text",Hh="Text",Nh="top",Vh="bottom",qa="middle",ja="normal",Gh="px ",vs=" ",qh="right",Ua="rtl",jh="word",Uh="char",Wa="none",wn="…",Ka=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],Wh=Ka.length,Ai=null;function Kh(){if(Ai!==null)return Ai;Ai=!1;try{const t=document.createElement("canvas");t.width=10,t.height=10;const e=t.getContext(Na);if(e){e.globalAlpha=0,e.shadowColor="black",e.shadowBlur=5,e.shadowOffsetX=5,e.shadowOffsetY=5,e.fillStyle="black",e.font="10px Arial",e.fillText("X",0,10);const i=e.getImageData(0,0,10,10).data;for(let s=3;s0){Ai=!0;break}}}catch{}return Ai}function Yh(t){return t.split(",").map(e=>{e=e.trim();const i=e.indexOf(" ")>=0,s=e.indexOf('"')>=0||e.indexOf("'")>=0;return i&&!s&&(e=`"${e}"`),e}).join(", ")}var ms;function xn(){return ms||(ms=R.createCanvasElement().getContext(Na),ms)}function Xh(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function Zh(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Qh(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}var re=class extends q{constructor(t){super(Qh(t)),this._partialTextX=0,this._partialTextY=0;for(let e=0;ez+Pt(j.text).length,0);f({char:W,index:N+B,x:S,y:w+T,lineIndex:k,column:N,isLastInLine:M,width:this.measureSize(W).width,context:t})}t.fillStrokeShape(this),f&&t.restore(),S+=this.measureSize(W).width+p}}else p!==0&&t.setAttr("letterSpacing",`${p}px`),this._partialTextX=S,this._partialTextY=w+T,this._partialText=L,t.fillStrokeShape(this);if(y){t.save(),t.beginPath();const A=K.legacyTextRendering?0:-Math.round(a/4),P=x;t.moveTo(P,w+T+A);const N=u===Li&&!M?h-o*2:I;t.lineTo(P+Math.round(N),w+T+A),t.lineWidth=a/15,t.strokeStyle=this._getLinearGradient()||v,t.stroke(),t.restore()}t.restore(),n>1&&(w+=r)}}_hitFunc(t){const e=this.getWidth(),i=this.getHeight();t.beginPath(),t.rect(0,0,e,i),t.closePath(),t.fillStrokeShape(this)}setText(t){const e=R._isString(t)?t:t==null?"":t+"";return this._setAttr(Dh,e),this}getWidth(){return this.attrs.width===Xt||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===Xt||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return R.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var e,i,s,n,o,a,r,l,c,d,u;let h=xn(),p=this.fontSize(),f;h.save(),h.font=this._getContextFont(),f=h.measureText(t),h.restore();const v=p/100;return{actualBoundingBoxAscent:(e=f.actualBoundingBoxAscent)!==null&&e!==void 0?e:71.58203125*v,actualBoundingBoxDescent:(i=f.actualBoundingBoxDescent)!==null&&i!==void 0?i:0,actualBoundingBoxLeft:(s=f.actualBoundingBoxLeft)!==null&&s!==void 0?s:-7.421875*v,actualBoundingBoxRight:(n=f.actualBoundingBoxRight)!==null&&n!==void 0?n:75.732421875*v,alphabeticBaseline:(o=f.alphabeticBaseline)!==null&&o!==void 0?o:0,emHeightAscent:(a=f.emHeightAscent)!==null&&a!==void 0?a:100*v,emHeightDescent:(r=f.emHeightDescent)!==null&&r!==void 0?r:-20*v,fontBoundingBoxAscent:(l=f.fontBoundingBoxAscent)!==null&&l!==void 0?l:91*v,fontBoundingBoxDescent:(c=f.fontBoundingBoxDescent)!==null&&c!==void 0?c:21*v,hangingBaseline:(d=f.hangingBaseline)!==null&&d!==void 0?d:72.80000305175781*v,ideographicBaseline:(u=f.ideographicBaseline)!==null&&u!==void 0?u:-21*v,width:f.width,height:p}}_getContextFont(){return this.fontStyle()+vs+this.fontVariant()+vs+(this.fontSize()+Gh)+Yh(this.fontFamily())}_addTextLine(t){this.align()===Li&&(t=t.trim());const e=this._getTextWidth(t);return this.textArr.push({text:t,width:e,lastInParagraph:!1})}_getTextWidth(t){const e=this.letterSpacing(),i=t.length;return xn().measureText(t).width+e*i}_setTextData(){let t=this.text().split(` -`),e=+this.fontSize(),i=0,s=this.lineHeight()*e,n=this.attrs.width,o=this.attrs.height,a=n!==Xt&&n!==void 0,r=o!==Xt&&o!==void 0,l=this.padding(),c=n-l*2,d=o-l*2,u=0,h=this.wrap(),p=h!==Uh&&h!==Wa,f=this.ellipsis();this.textArr=[],xn().font=this._getContextFont();const v=f?this._getTextWidth(wn):0;for(let m=0,g=t.length;mc)for(;b.length>0;){let k=0,w=Pt(b).length,C="",S=0;for(;k>>1,E=Pt(b).slice(0,T+1).join(""),L=this._getTextWidth(E);(f&&r&&u+s>d?L+v:L)<=c?(k=T+1,C=E,S=L):w=T}if(C){if(p){const T=Pt(b),E=Pt(C),L=T[E.length],I=L===vs||L===Va;let M;if(I&&S<=c)M=E.length;else{const x=E.lastIndexOf(vs),A=E.lastIndexOf(Va);M=Math.max(x,A)+1}M>0&&(k=M,C=T.slice(0,k).join(""),S=this._getTextWidth(C))}if(C=C.trimRight(),this._addTextLine(C),i=Math.max(i,S),u+=s,this._shouldHandleEllipsis(u)){this._tryToAddEllipsisToLastLine();break}if(b=Pt(b).slice(k).join("").trimLeft(),b.length>0&&(y=this._getTextWidth(b),y<=c)){this._addTextLine(b),u+=s,i=Math.max(i,y);break}}else break}else this._addTextLine(b),u+=s,i=Math.max(i,y),this._shouldHandleEllipsis(u)&&md)break}this.textHeight=e,this.textWidth=i}_shouldHandleEllipsis(t){const e=+this.fontSize(),i=this.lineHeight()*e,s=this.attrs.height,n=s!==Xt&&s!==void 0,o=s-this.padding()*2;return this.wrap()===Wa||n&&t+i>o}_tryToAddEllipsisToLastLine(){const t=this.attrs.width,e=t!==Xt&&t!==void 0,i=t-this.padding()*2,s=this.ellipsis(),n=this.textArr[this.textArr.length-1];!n||!s||(e&&(this._getTextWidth(n.text+wn){let s,n;const a=i/2;s=0;for(let r=0;r<20;r++)n=a*Jh[20][r]+a,s+=eu[20][r]*iu(t,e,n);return a*s},Xa=(t,e,i)=>{i===void 0&&(i=1);const s=t[0]-2*t[1]+t[2],n=e[0]-2*e[1]+e[2],o=2*t[1]-2*t[0],a=2*e[1]-2*e[0],r=4*(s*s+n*n),l=4*(s*o+n*a),c=o*o+a*a;if(r===0)return i*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(e[2]-e[0],2));const d=l/(2*r),u=c/r,h=i+d,p=u-d*d,f=h*h+p>0?Math.sqrt(h*h+p):0,v=d*d+p>0?Math.sqrt(d*d+p):0,m=d+Math.sqrt(d*d+p)!==0?p*Math.log(Math.abs((h+f)/(d+v))):0;return Math.sqrt(r)/2*(h*f-d*v+m)};function iu(t,e,i){const s=Sn(1,i,t),n=Sn(1,i,e),o=s*s+n*n;return Math.sqrt(o)}var Sn=(t,e,i)=>{const s=i.length-1;let n,o;if(s===0)return 0;if(t===0){o=0;for(let a=0;a<=s;a++)o+=tu[s][a]*Math.pow(1-e,s-a)*Math.pow(e,a)*i[a];return o}else{n=new Array(s);for(let a=0;a{let s=1,n=t/e,o=(t-i(n))/e,a=0;for(;s>.001;){const r=i(n+o),l=Math.abs(t-r)/e;if(l500)break}return n},Ct=class Re extends q{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Re.parsePathData(this.data()),this.pathLength=Re.getPathLength(this.dataArray)}_sceneFunc(e){const i=this.dataArray;e.beginPath();let s=!1;for(let n=0;nd?c:d,m=c>d?1:c/d,g=c>d?d/c:1;e.translate(r,l),e.rotate(p),e.scale(m,g),e.arc(0,0,v,u,u+h,1-f),e.scale(1/m,1/g),e.rotate(-p),e.translate(-r,-l);break;case"z":s=!0,e.closePath();break}}!s&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let e=[];this.dataArray.forEach(function(l){if(l.command==="A"){const c=l.points[4],d=l.points[5],u=l.points[4]+d;let h=Math.PI/180;if(Math.abs(c-u)u;p-=h){const f=Re.getPointOnEllipticalArc(l.points[0],l.points[1],l.points[2],l.points[3],p,0);e.push(f.x,f.y)}else for(let p=c+h;pi[n].pathLength;)e-=i[n].pathLength,++n;if(n===o)return s=i[n-1].points.slice(-2),{x:s[0],y:s[1]};if(e<.01)return i[n].command==="M"?(s=i[n].points.slice(0,2),{x:s[0],y:s[1]}):{x:i[n].start.x,y:i[n].start.y};const a=i[n],r=a.points;switch(a.command){case"L":return Re.getPointOnLine(e,a.start.x,a.start.y,r[0],r[1]);case"C":return Re.getPointOnCubicBezier(Za(e,Re.getPathLength(i),v=>Ya([a.start.x,r[0],r[2],r[4]],[a.start.y,r[1],r[3],r[5]],v)),a.start.x,a.start.y,r[0],r[1],r[2],r[3],r[4],r[5]);case"Q":return Re.getPointOnQuadraticBezier(Za(e,Re.getPathLength(i),v=>Xa([a.start.x,r[0],r[2]],[a.start.y,r[1],r[3]],v)),a.start.x,a.start.y,r[0],r[1],r[2],r[3]);case"A":const l=r[0],c=r[1],d=r[2],u=r[3],h=r[5],p=r[6];let f=r[4];return f+=h*e/a.pathLength,Re.getPointOnEllipticalArc(l,c,d,u,f,p)}return null}static getPointOnLine(e,i,s,n,o,a,r){a=a!=null?a:i,r=r!=null?r:s;const l=this.getLineLength(i,s,n,o);if(l<1e-10)return{x:i,y:s};if(n===i)return{x:a,y:r+(o>s?e:-e)};const c=(o-s)/(n-i),d=Math.sqrt(e*e/(1+c*c))*(n=0&&(v+=2,v>=7&&(v-=7));continue}if(v>=0){if(v===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(b)){f.push(parseInt(b[0],10)),f.push(parseInt(b[1],10)),f.push(parseFloat(b.slice(2))),v+=3,v>=7&&(v-=7);continue}if(b==="11"||b==="10"||b==="01"){f.push(parseInt(b[0],10)),f.push(parseInt(b[1],10)),v+=2,v>=7&&(v-=7);continue}if(b==="0"||b==="1"){f.push(parseInt(b,10)),v+=1,v>=7&&(v-=7);continue}}else if(v===4){if(/^[01]\d+(?:\.\d+)?$/.test(b)){f.push(parseInt(b[0],10)),f.push(parseFloat(b.slice(1))),v+=2,v>=7&&(v-=7);continue}if(b==="0"||b==="1"){f.push(parseInt(b,10)),v+=1,v>=7&&(v-=7);continue}}const y=parseFloat(b);isNaN(y)?f.push(0):f.push(y),v+=1,v>=7&&(v-=7)}else{const y=parseFloat(b);isNaN(y)?f.push(0):f.push(y)}}for(;f.length>0&&!isNaN(f[0]);){let m="",g=[];const b=r,y=l;let k,w,C,S,T,E,L,I,M,x;switch(p){case"l":r+=f.shift(),l+=f.shift(),m="L",g.push(r,l);break;case"L":r=f.shift(),l=f.shift(),g.push(r,l);break;case"m":const A=f.shift(),P=f.shift();if(r+=A,l+=P,m="M",o.length>2&&o[o.length-1].command==="z"){for(let N=o.length-2;N>=0;N--)if(o[N].command==="M"){r=o[N].points[0]+A,l=o[N].points[1]+P;break}}g.push(r,l),p="l";break;case"M":r=f.shift(),l=f.shift(),m="M",g.push(r,l),p="L";break;case"h":r+=f.shift(),m="L",g.push(r,l);break;case"H":r=f.shift(),m="L",g.push(r,l);break;case"v":l+=f.shift(),m="L",g.push(r,l);break;case"V":l=f.shift(),m="L",g.push(r,l);break;case"C":g.push(f.shift(),f.shift(),f.shift(),f.shift()),r=f.shift(),l=f.shift(),g.push(r,l);break;case"c":g.push(r+f.shift(),l+f.shift(),r+f.shift(),l+f.shift()),r+=f.shift(),l+=f.shift(),m="C",g.push(r,l);break;case"S":w=r,C=l,k=o[o.length-1],k.command==="C"&&(w=r+(r-k.points[2]),C=l+(l-k.points[3])),g.push(w,C,f.shift(),f.shift()),r=f.shift(),l=f.shift(),m="C",g.push(r,l);break;case"s":w=r,C=l,k=o[o.length-1],k.command==="C"&&(w=r+(r-k.points[2]),C=l+(l-k.points[3])),g.push(w,C,r+f.shift(),l+f.shift()),r+=f.shift(),l+=f.shift(),m="C",g.push(r,l);break;case"Q":g.push(f.shift(),f.shift()),r=f.shift(),l=f.shift(),g.push(r,l);break;case"q":g.push(r+f.shift(),l+f.shift()),r+=f.shift(),l+=f.shift(),m="Q",g.push(r,l);break;case"T":w=r,C=l,k=o[o.length-1],k.command==="Q"&&(w=r+(r-k.points[0]),C=l+(l-k.points[1])),r=f.shift(),l=f.shift(),m="Q",g.push(w,C,r,l);break;case"t":w=r,C=l,k=o[o.length-1],k.command==="Q"&&(w=r+(r-k.points[0]),C=l+(l-k.points[1])),r+=f.shift(),l+=f.shift(),m="Q",g.push(w,C,r,l);break;case"A":S=f.shift(),T=f.shift(),E=f.shift(),L=f.shift(),I=f.shift(),M=r,x=l,r=f.shift(),l=f.shift(),m="A",g=this.convertEndpointToCenterParameterization(M,x,r,l,L,I,S,T,E);break;case"a":S=f.shift(),T=f.shift(),E=f.shift(),L=f.shift(),I=f.shift(),M=r,x=l,r+=f.shift(),l+=f.shift(),m="A",g=this.convertEndpointToCenterParameterization(M,x,r,l,L,I,S,T,E);break}o.push({command:m||p,points:g,start:{x:b,y},pathLength:this.calcLength(b,y,m||p,g)})}(p==="z"||p==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(e,i,s,n){let o,a,r,l;const c=Re;switch(s){case"L":return c.getLineLength(e,i,n[0],n[1]);case"C":return Ya([e,n[0],n[2],n[4]],[i,n[1],n[3],n[5]],1);case"Q":return Xa([e,n[0],n[2]],[i,n[1],n[3]],1);case"A":o=0;const d=n[4],u=n[5],h=n[4]+u;let p=Math.PI/180;if(Math.abs(d-h)h;l-=p)r=c.getPointOnEllipticalArc(n[0],n[1],n[2],n[3],l,0),o+=c.getLineLength(a.x,a.y,r.x,r.y),a=r;else for(l=d+p;l1&&(r*=Math.sqrt(p),l*=Math.sqrt(p));let f=Math.sqrt((r*r*(l*l)-r*r*(h*h)-l*l*(u*u))/(r*r*(h*h)+l*l*(u*u)));o===a&&(f*=-1),isNaN(f)&&(f=0);const v=f*r*h/l,m=f*-l*u/r,g=(e+s)/2+Math.cos(d)*v-Math.sin(d)*m,b=(i+n)/2+Math.sin(d)*v+Math.cos(d)*m,y=function(L){return Math.sqrt(L[0]*L[0]+L[1]*L[1])},k=function(L,I){return(L[0]*I[0]+L[1]*I[1])/(y(L)*y(I))},w=function(L,I){return(L[0]*I[1]=1&&(E=0),a===0&&E>0&&(E=E-2*Math.PI),a===1&&E<0&&(E=E+2*Math.PI),[g,b,r,l,C,E,d,a]}};Ct.prototype.className="Path",Ct.prototype._attrsAffectingSize=["data"],$e(Ct),O.addGetterSetter(Ct,"data");var Ve=class uc extends q{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",i=>{this._removeImageLoad(i.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",this._loadListener)}_removeImageLoad(e){e&&e.removeEventListener&&e.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const e=!!this.cornerRadius(),i=this.hasShadow();return e&&i?!0:super._useBufferCanvas(!0)}_sceneFunc(e){const i=this.getWidth(),s=this.getHeight(),n=this.cornerRadius(),o=this.attrs.image;let a;if(o){const r=this.attrs.cropWidth,l=this.attrs.cropHeight;r&&l?a=[o,this.cropX(),this.cropY(),r,l,0,0,i,s]:a=[o,0,0,i,s]}(this.hasFill()||this.hasStroke()||n)&&(e.beginPath(),n?R.drawRoundedRectPath(e,i,s,n):e.rect(0,0,i,s),e.closePath(),e.fillStrokeShape(this)),o&&(n&&e.clip(),e.drawImage.apply(e,a))}_hitFunc(e){const i=this.width(),s=this.height(),n=this.cornerRadius();e.beginPath(),n?R.drawRoundedRectPath(e,i,s,n):e.rect(0,0,i,s),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,i,s;return(s=(e=this.attrs.width)!==null&&e!==void 0?e:(i=this.image())===null||i===void 0?void 0:i.width)!==null&&s!==void 0?s:0}getHeight(){var e,i,s;return(s=(e=this.attrs.height)!==null&&e!==void 0?e:(i=this.image())===null||i===void 0?void 0:i.height)!==null&&s!==void 0?s:0}static fromURL(e,i,s=null){const n=R.createImageElement();n.onload=function(){i(new uc({image:n}))},n.onerror=s,n.crossOrigin="Anonymous",n.src=e}};Ve.prototype.className="Image",Ve.prototype._attrsAffectingSize=["image"],$e(Ve),O.addGetterSetter(Ve,"cornerRadius",0,la(4)),O.addGetterSetter(Ve,"image"),O.addComponentsGetterSetter(Ve,"crop",["x","y","width","height"]),O.addGetterSetter(Ve,"cropX",0,se()),O.addGetterSetter(Ve,"cropY",0,se()),O.addGetterSetter(Ve,"cropWidth",0,se()),O.addGetterSetter(Ve,"cropHeight",0,se());function su(t){let e=0;for(let i=0,s=t.length;i=e&&t.seat.y-t.hy<=n&&t.seat.y+t.hy>=i;const r=a*Math.PI/180,l=Math.cos(r),c=Math.sin(r),d=t.shape.width/2,u=t.shape.height/2,h=[[-d,-u],[d,-u],[d,u],[-d,u]].map(([v,m])=>[t.seat.x+v*l-m*c,t.seat.y+v*c+m*l]),p=[[e,i],[s,i],[s,n],[e,n]],f=[[1,0],[0,1],[l,c],[-c,l]];for(const[v,m]of f){let g=1/0,b=-1/0;for(const[w,C]of h){const S=w*v+C*m;Sb&&(b=S)}let y=1/0,k=-1/0;for(const[w,C]of p){const S=w*v+C*m;Sk&&(k=S)}if(bc&&(c=I.x+x),I.y+A>d&&(d=I.y+A),x>u&&(u=x),A>u&&(u=A)}o===0&&(r=0,l=0,c=0,d=0);const f=u>0?u*4:1,v=Math.max(c-r,0),m=Math.max(d-l,0),g=Math.max(64,(s=e.maxCells)!==null&&s!==void 0?s:o*4);let b=f,y=Math.max(1,Math.ceil(v/b)||1),k=Math.max(1,Math.ceil(m/b)||1);for(;y*k>g&&(y>1||k>1);)b*=2,y=Math.max(1,Math.ceil(v/b)||1),k=Math.max(1,Math.ceil(m/b)||1);const w=y*k,C=new Int32Array(w+1);let S=0;for(let L=0;Lb||y>k)return[];const w=[],C=t.stamp,S=++t.epoch;for(let T=y;T<=k;T++){const E=T*c;for(let L=g;L<=b;L++){const I=E+L,M=f[I+1];for(let x=f[I];x=n&&P.seat.x<=o&&P.seat.y>=a&&P.seat.y<=r:ou(P,n,a,o,r))&&w.push(A)}}}return w.sort((T,E)=>T-E),w.map(T=>m[T].seat.id)}function ru(t,e=0){const i=Math.max(1,t.width,t.height),s={x:t.x+t.width/2,y:t.y+t.height/2},n=i*1.55,o=Math.max(i*.82,Math.max(0,e)+i*.45);return{target:s,distance:n,height:o,focalLength:Math.hypot(n,o),yawRad:-8*Math.PI/180}}function Je(t,e,i=0){const s=e.x-t.target.x,n=e.y-t.target.y,o=Math.cos(t.yawRad),a=Math.sin(t.yawRad),r=s*o-n*a,l=s*a+n*o-t.distance,c=i-t.height,d=Math.hypot(t.distance,t.height),u=(-t.distance*l-t.height*c)/d,h=(-t.height*l+t.distance*c)/d,p=Math.max(d*.08,u),f=t.focalLength/p;return{x:t.target.x+r*f,y:t.target.y-h*f,depth:p,scale:f}}function ft(t,e){return{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function lu(t){const e=t.a*t.d-t.b*t.c;if(!Number.isFinite(e)||Math.abs(e)<1e-9)throw new Error("perspective projection produced a singular affine");const i=t.d/e,s=-t.b/e,n=-t.c/e,o=t.a/e;return{a:i,b:s,c:n,d:o,e:-(i*t.e+n*t.f),f:-(s*t.e+o*t.f)}}function cu(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function Ja(t,e,i=()=>0){const s=Je(t,e,i(e)),n={x:e.x+1,y:e.y},o={x:e.x,y:e.y+1},a=Je(t,n,i(n)),r=Je(t,o,i(o)),l=a.x-s.x,c=a.y-s.y,d=r.x-s.x,u=r.y-s.y;return{a:l,b:c,c:d,d:u,e:s.x-l*e.x-d*e.y,f:s.y-c*e.x-u*e.y}}function du(t){const e=Math.hypot(t.a,t.b),i=t.a*t.d-t.b*t.c;return{rotationDeg:Math.atan2(t.b,t.a)*180/Math.PI,scaleX:e,scaleY:i/Math.max(e,1e-9),skewX:(t.a*t.c+t.b*t.d)/Math.max(i,1e-9)}}var hu;function uu(t){hu=t}var ug="USD",er;function pu(t){er=t}var tr=new Map;function ir(t,e,i,s){const n=s!=null?s:er,o=`${n!=null?n:""}|${t}|${e!=null?e:"auto"}|${i!=null?i:"auto"}`;let a=tr.get(o);return a||(a=new Intl.NumberFormat(n,{style:"currency",currency:t,minimumFractionDigits:e,maximumFractionDigits:i}),tr.set(o,a)),a}function gs(t,e="USD",i,s){if(typeof i=="object"){const o=i;try{return ir(e,o.minimumFractionDigits,o.maximumFractionDigits,o.locale).format(t)}catch(a){if(o.fallback)return o.fallback(t,e);throw a}}const n=i!=null?i:Number.isInteger(t)?0:void 0;return ir(e,n,n,s).format(t)}var bs={"common.cancel":"Cancel","common.close":"Close","common.done":"Done","common.copied":"✓ Copied","picker.holdExpired":"Your hold expired — the seats were released. Pick again.","picker.poweredBy":"Powered by SeatLayer","picker.testMode":"TEST MODE","picker.orphanHint":"This leaves a single seat stranded — consider shifting one seat over.","picker.companionRequiresWheelchair":"Requires the adjacent wheelchair place","picker.companionPairRequired":"Select the adjacent wheelchair place with each companion ticket.","map.aria":"Seating map. Use arrow keys to move between seats, Enter to select.","map.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 — groups of sections such as North Stand or VIP","picker.rungTip.sections":"Section blocks — sold-out and nearly-gone sections shade to show availability at a glance","picker.rungTip.seats":"Individual seats — blocks melt into dots","picker.rungLabel.zones":"ZONES","picker.rungLabel.sections":"SECTIONS","picker.rungLabel.seats":"SEATS","picker.sectionSummaryAria":"{label} section summary","picker.closeSectionSummary":"Close section summary","picker.seatsLeftInSection.one":"{count} seat left","picker.seatsLeftInSection.other":"{count} seats left","picker.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°","picker.preview":"PREVIEW","picker.sightline":"≈ {m} m to stage","picker.panorama360":"360° venue photo","picker.illustrationCaption":"illustration · ≈ {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} — showing best overall","picker.loading3d":"Building the 3D venue…","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} — you won’t be charged yet.","picker.securingSeats":"Securing your seats…","picker.openingCheckout":"Opening secure checkout…","picker.peekSecured":"✓ {count} secured · {total} — you won’t be charged yet","picker.priceHint":"Colours on the map are ticket types — 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’t 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…","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’re 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":"✦ Best seats","picker.booth":"Booth","picker.capacityGuests":"{count} guests","picker.change":"Change","picker.chartDerivedModel":"Chart-derived model","picker.chartDerivedSeatEye":"Live 3D · chart-derived seat-eye · not surveyed","picker.checkConnection":"Check your connection and try again.","picker.checkoutCouldNotBeOpened":"Checkout could not be opened. Your seats are still held — please try again.","picker.chooseAnotherToCompare":"Choose another seat to compare.","picker.chooseGuestsCopy":"Choose how many guests will sit together. This table is held exclusively for your party.","picker.chooseMinMaxGuests":"Choose {min}–{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’t add more time — please head to checkout now.","picker.couldNotFindSeatsTogether":"We couldn’t find {count} seats together. Try fewer seats or another ticket type.","picker.couldNotReleaseTickets":"Couldn’t release your tickets. Your hold is unchanged.","picker.couldNotRemoveLabel":"Couldn’t remove {label}. Your hold is unchanged.","picker.currentOffer":"Current offer","picker.currentTicketOffer":"Current ticket offer","picker.dragToLookAround":"Drag to look around · 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…","picker.findingEllipsis":"Finding…","picker.fitToScreen":"Fit to screen","picker.flat2dMap":"Flat 2D map","picker.flexiblePartyTypeWord":"Flexible party · {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 · 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 — seats update in real time","picker.loadingSeatMap":"Loading seat map…","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’t 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 — 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’t 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°","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 · {total}","picker.peekTicketsTotal.other":"{count} tickets · {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…","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 {time}. Need more time?","picker.seatsJustTaken":"One or more seats were just taken. Please pick again.","picker.seatsJustTakenInCategory.one":"{count} seat just taken in {label} · {left} left","picker.seatsJustTakenInCategory.other":"{count} seats just taken in {label} · {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…","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 — or grab standing tickets below.","picker.undo":"Undo","picker.upcomingTicketOffer":"Upcoming ticket offer","picker.updateTable":"Update table","picker.updatingEllipsis":"Updating…","picker.venueView":"Venue view","picker.viewFromHere":"View from here","picker.viewFromThisSeat":"View from this seat","picker.wholeTypeWord":"Whole {typeWord}","picker.willChooseClosestGroup":"We’ll choose the closest available group for you.","picker.willFindSeatsTogether":"We’ll find {count} seats together.","picker.yourSeats":"Your seats","picker.zoomIn":"Zoom in","picker.zoomOut":"Zoom out","picker.closeVenueNav":"Close","picker.levelsAndAreas":"Levels & areas"},fu=["en","es","de","fr"],Zt={en:bs},ys={},Tt="en";function vu(t,e){for(const i of[t,e,typeof navigator!="undefined"?navigator.language:null]){if(!i)continue;const s=i.toLowerCase().split("-")[0];if(fu.includes(s))return s}return"en"}function Tn(t,e){e&&(Zt[t]={...Zt[t],...e}),Tt=Zt[t]?t:"en",pu(Tt),uu(Tt),typeof document!="undefined"&&(document.documentElement.lang=Tt)}function sr(t){ys=t}var nr=/\{(\w+)\}/g;function V(t,e){var i,s,n,o;const a=(i=(s=(n=ys[t])!==null&&n!==void 0?n:(o=Zt[Tt])===null||o===void 0?void 0:o[t])!==null&&s!==void 0?s:bs[t])!==null&&i!==void 0?i:t;return e?a.replace(nr,(r,l)=>{var c;return String((c=e[l])!==null&&c!==void 0?c:`{${l}}`)}):a}function vt(t,e,i){var s,n,o,a,r,l,c;const d=new Intl.PluralRules(Tt).select(e),u=(s=(n=ys[`${t}.${d}`])!==null&&n!==void 0?n:(o=Zt[Tt])===null||o===void 0?void 0:o[`${t}.${d}`])!==null&&s!==void 0?s:bs[`${t}.${d}`];return((a=(r=(l=u!=null?u:ys[`${t}.other`])!==null&&l!==void 0?l:(c=Zt[Tt])===null||c===void 0?void 0:c[`${t}.other`])!==null&&r!==void 0?r:bs[`${t}.other`])!==null&&a!==void 0?a:t).replace(nr,(h,p)=>{var f;return String((f={count:e,...i}[p])!==null&&f!==void 0?f:`{${p}}`)})}var Qt=.9,or=.55*Qt,Lt=12/7,Ii=.45*Qt,ks=.9*Qt,mu=Math.max(Qt*1.1,ks),gu=12,ar=.55*Ii,bu=2500,rr=-11.5,Ln=.58,yu=[.85,.72,.62];function lr(t){return Math.min(1,Math.max(.55,t/900))}var pg=.1,ku="#e5e7eb",wu="#c7cbd1",xu="#595f69",Su="#d1d5db",Cu="#b8bdc4",Tu="#273142",Lu="#526078",Au="#f1f5f9",Eu="#374151",Iu="#64748b",cr="#111827",Mu="#6b7280",An="#374151",_u="#4b5563",Pu="#4b5563",Ru=.4,ws=.16,$u="rgba(244,246,248,0.06)",En=["#E69F00","#56B4E9","#009E73","#F0E442","#0072B2","#D55E00","#CC79A7"];function Jt(t){return sn(t)?{sectionFill:ku,sectionStroke:wu,sectionInk:xu,focalFill:Su,focalStroke:Cu}:{sectionFill:Tu,sectionStroke:Lu,sectionInk:Au,focalFill:Eu,focalStroke:Iu}}function In(t,e){const i=t.sectionFill,s=gd(Vt(i,.2),.85);switch(e){case"closed":return Vt(i,.12);case"sold-out":return s;case"nearly-gone":return Wo(i,s,.4);default:return i}}function Ou(t,e){return t.xs&&(s=a.x),a.y>n&&(n=a.y));return o?{minX:e,minY:i,maxX:s,maxY:n}:null}function Bu(t){const e=Fu(t);return e?zu(e):null}function zu(t){return{x:t.minX,y:t.minY,width:t.maxX-t.minX,height:t.maxY-t.minY}}function Ge(t){const e=Bu(t);return e?{x:e.x,y:e.y,width:Math.max(1,e.width),height:Math.max(1,e.height)}:{x:0,y:0,width:1,height:1}}function hr(t,e,i,s){const n=s*Math.PI/180,o=Math.cos(n),a=Math.sin(n);return[{x:-e/2,y:-i/2},{x:e/2,y:-i/2},{x:e/2,y:i/2},{x:-e/2,y:i/2}].map(r=>({x:t.x+r.x*o-r.y*a,y:t.y+r.x*a+r.y*o}))}function ur(t,e,i,s,n,o){const a=s*Math.PI/180,r=Math.cos(a),l=Math.sin(a);for(let c=0;c<=4;c++)for(let d=0;d<=6;d++){const u=e*(d/6-.5),h=i*(c/4-.5);if(!Ke({x:t.x+u*r-h*l,y:t.y+u*l+h*r},n,o))return!1}return!0}function Du(t,e,i){const s=Ge(t),n=[i];for(let a=1;a<12;a+=1)for(let r=1;r<12;r+=1){const l={x:s.x+s.width*r/12,y:s.y+s.height*a/12};Ke(l,t,e)&&n.push(l)}const o=[t,...e];return n.map(a=>({point:a,room:Eo(a,o)})).sort((a,r)=>r.room-a.room).map(a=>a.point).filter((a,r,l)=>r===l.findIndex(c=>Math.abs(c.x-a.x)<1e-6&&Math.abs(c.y-a.y)<1e-6))}function Hu(t,e,i){const s=e.length,n={x:(e[s-1].x+e[0].x)/2,y:(e[s-1].y+e[0].y)/2};t.moveTo(n.x,n.y);for(let o=0;o0,o=i.cornerRadius&&i.cornerRadius>0?i.cornerRadius:0;return new q({...i,sceneFunc(a,r){a.beginPath();const l=d=>{if(d.length){if(o>0&&d.length>=3)return Hu(a,d,o);a.moveTo(d[0].x,d[0].y);for(let u=1;u{a.moveTo(d.start.x,d.start.y);let u=d.start;for(const h of d.segments)h.kind==="line"?a.lineTo(h.end.x,h.end.y):h.kind==="arc"?a.arc(h.center.x,h.center.y,h.radius,Math.atan2(u.y-h.center.y,u.x-h.center.x),Math.atan2(h.end.y-h.center.y,h.end.x-h.center.x),!h.clockwise):a.bezierCurveTo(h.control1.x,h.control1.y,h.control2.x,h.control2.y,h.end.x,h.end.y),u=h.end;a.closePath()})(s):l(t);for(const d of e!=null?e:[])l(Cn(d)>0===n?[...d].reverse():d);a.fillStrokeShape(r)},perfectDrawEnabled:!1})}var pr=class extends Ne{constructor(...t){super(...t),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)}},Nu=class{constructor(t){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();const i=this.toLocal(e);if(this.pointers.set(e.pointerId,i),this.pointers.size===1)this.movedPx=0,this.pinch=null,this.panStart=i,this.panStarted=!1,this.host.marqueeShouldStart(e)?(this.host.beginMarquee(i),this.panLast=null):this.panLast=i;else if(this.pointers.size===2){this.host.marqueeActive()&&this.host.cancelMarquee();const[s,n]=[...this.pointers.values()],o={x:(s.x+n.x)/2,y:(s.y+n.y)/2},a=this.host.stage.scaleX();this.pinch={startDist:Math.hypot(n.x-s.x,n.y-s.y),startScale:a,worldMid:{x:(o.x-this.host.stage.x())/a,y:(o.y-this.host.stage.y())/a}},this.panLast=null,this.panStart=null,this.panStarted=!0,this.movedPx=9}},this.onPointerMove=e=>{if(!this.pointers.has(e.pointerId))return;e.preventDefault();const i=this.toLocal(e);if(this.pointers.set(e.pointerId,i),this.pointers.size===1&&this.panStart?this.movedPx=Math.max(this.movedPx,Math.hypot(i.x-this.panStart.x,i.y-this.panStart.y)):this.pointers.size>=2&&(this.movedPx=9),this.host.marqueeActive()){this.host.updateMarquee(i);return}if(this.pinch&&this.pointers.size>=2){this.host.releaseSectionFocusDim();const[s,n]=[...this.pointers.values()],o=Math.hypot(n.x-s.x,n.y-s.y);if(this.pinch.startDist<1)return;const a={x:(s.x+n.x)/2,y:(s.y+n.y)/2},{min:r,max:l}=this.host.zoomBounds(),c=_e(this.pinch.startScale*(o/this.pinch.startDist),r,l);this.host.stage.scale({x:c,y:c}),this.host.stage.position({x:a.x-this.pinch.worldMid.x*c,y:a.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<=8)return;this.panStarted=!0,this.host.releaseSectionFocusDim()}this.host.stage.position({x:this.host.stage.x()+(i.x-this.panLast.x),y:this.host.stage.y()+(i.y-this.panLast.y)}),this.panLast=i,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=t}get moved(){return this.movedPx}attach(){const{container:t}=this.host;t.addEventListener("pointerdown",this.onPointerDown,{passive:!1}),t.addEventListener("pointermove",this.onPointerMove,{passive:!1}),t.addEventListener("pointerup",this.onPointerEnd,{passive:!1}),t.addEventListener("pointercancel",this.onPointerEnd,{passive:!1})}detach(){const{container:t}=this.host;t.removeEventListener("pointerdown",this.onPointerDown),t.removeEventListener("pointermove",this.onPointerMove),t.removeEventListener("pointerup",this.onPointerEnd),t.removeEventListener("pointercancel",this.onPointerEnd)}resetPan(){this.panLast=null,this.panStart=null,this.panStarted=!1}isGhostClick(t){return t.type==="tap"?(this.lastTapAt=performance.now(),!1):this.lastTapAt>0&&performance.now()-this.lastTapAt<700}toLocal(t){const e=this.host.container.getBoundingClientRect();return{x:t.clientX-e.left,y:t.clientY-e.top}}};function Vu(t,e){return t===null||e===null?t===e:t.size===e.size&&[...t].every(i=>e.has(i))}function Gu(t,e){if(!(e!=null&&e.size))return!1;for(const i of t)if(e.has(i))return!1;return!0}function qu(t){var e;const i=t.effScale(),s=t.stage.scaleX(),n={width:t.stage.width(),height:t.stage.height()},o=m=>Math.round(m*100)/100,a=t.seats.map(m=>{var g,b,y,k,w,C;const S=t.circleById.get(m.id),T=(g=t.boothLabelById.get(m.id))!==null&&g!==void 0?g:t.seatLabelById.get(m.id),E=t.viewMode==="perspective"&&(b=t.perspectiveSeatScale.get(m.id))!==null&&b!==void 0?b:1,L=(t.viewMode==="perspective"?s:i)*E,I=m.kind==="booth"?10:7*t.seatLabelScale(m),M=t.viewMode==="perspective"&&m.kind!=="booth"?i*E:L,x=o(((y=T==null?void 0:T.fontSize())!==null&&y!==void 0?y:I)*M),A=t.worldToScreen(m),P=A.x<0||A.x>n.width||A.y<0||A.y>n.height,N=t.focusedSeatOpacity(m.id,(k=S==null?void 0:S.getAbsoluteOpacity())!==null&&k!==void 0?k:0),W=t.seatSection.get(m.id),B=!!(T!=null&&T.isVisible())&&N>=.5&&!P;let z;B||(N<.5?z="dimmed-or-unavailable":x<12?z="below-minimum-size":P?z="outside-viewport":T?z="renderer-hidden":z="clutter-or-fit");const j=T?T.width()*s*E:0,G=T?T.height()*(t.viewMode==="perspective"&&m.kind==="booth"?s:i)*E:0,D=S instanceof Ie?S.width()*s*E:t.seatR*2*L,F=S instanceof Ie?S.height()*(t.viewMode==="perspective"?s:i)*E:t.seatR*2*L,_=2*(t.seatR*L+14),U=S==null?void 0:S.fill(),Y=T==null?void 0:T.fill(),ie=t.accessGlyphById.get(m.id),ae=ie==null?void 0:ie.getAbsoluteScale();return{seatId:m.id,label:m.label,kind:m.kind==="booth"?"booth":"seat",markerShape:m.kind==="booth"?"booth":m.wheelchairSpaceType==="no-seat"?"square":"circle",...m.wheelchairSpaceType?{wheelchairSpaceType:m.wheelchairSpaceType}:{},categoryKey:m.categoryKey,...W?{sectionId:W.id}:{},...W!=null&&W.zone?{zoneId:W.zone}:{},status:(w=t.statusById.get(m.id))!==null&&w!==void 0?w:"free",selected:t.selection.has(m.id),visible:B,renderedFontPx:x,fill:typeof U=="string"?U:"",ink:typeof Y=="string"?Y:S?t.seatLabelInk(m,S):t.seatPreferredLabelInk(m),opacity:o(N),...ie?{accessibilityMarker:{glyphVisible:ie.isVisible(),glyphWidthPx:o(24*Math.abs((C=ae==null?void 0:ae.x)!==null&&C!==void 0?C:0)),emphasizedByFilter:t.accessGlyphFilterEmphasized(m.id)}}:{},pointerTarget:{active:!t.cached&&!t.seatViewportCulled(m.id)&&!!(S!=null&&S.isVisible())&&!!(S!=null&&S.isListening())&&t.isSelectable(m.id),directWidthPx:o(D),directHeightPx:o(F),effectiveMinimumPx:o(Math.max(Math.min(D,F),_))},screenCenter:{x:o(A.x),y:o(A.y)},...B?{screenBox:{x:o(A.x-j/2),y:o(A.y-G/2),width:o(j),height:o(G)}}:{},...z?{hiddenReason:z}:{}}}),r=a.filter(m=>m.visible).length,l=(m,g,b,y,k,w)=>{const C=hr({x:y.x(),y:y.y()},y.width(),y.height(),y.rotation()),S=w&&w.liftWorld>0?t.isoLiftLocal(w.liftWorld):{x:0,y:0},T=Ge(C.map(A=>t.worldToScreen({x:A.x+S.x,y:A.y+S.y}))),E=o(y.opacity()),L=y.fill(),I=T.x+T.width<0||T.x>n.width||T.y+T.height<0||T.y>n.height,M=y.isVisible()&&E>.05&&!I,x=w?ur({x:y.x(),y:y.y()},y.width(),y.height(),y.rotation(),w.outline,w.holes):void 0;return{id:m,kind:g,role:b,label:y.text(),visible:M,renderedFontPx:o(y.fontSize()*s),opacity:E,fill:k,ink:typeof L=="string"?L:"",...x==null?{}:{fitsContainer:x},...M?{screenBox:{x:o(T.x),y:o(T.y),width:o(T.width),height:o(T.height)}}:{}}},c=[...t.sections.map(m=>{const g=m.blockPoly.fill();return l(m.id,"section","name",m.nameLabel,typeof g=="string"?g:m.baseFill,m)}),...t.sections.map(m=>{const g=m.blockPoly.fill();return l(`${m.id}:availability`,"section","availability",m.subLabel,typeof g=="string"?g:m.baseFill,m)}),...t.zones.flatMap(m=>[l(m.id,"zone","name",m.label,m.background),...m.sub?[l(`${m.id}:price`,"zone","price",m.sub,m.background)]:[]])],d=[...t.gaById].map(([m,g])=>{const b=g.points.map(I=>t.worldToScreen(I)),y=Math.min(...b.map(I=>I.x)),k=Math.min(...b.map(I=>I.y)),w=Math.max(...b.map(I=>I.x)),C=Math.max(...b.map(I=>I.y)),S=w<0||y>n.width||C<0||k>n.height,T=o(g.polygon.opacity()),E=T>=.1&&!S,L=g.polygon.fill();return{areaId:m,label:g.label,capacity:g.capacity,categoryKey:g.categoryKey,...g.sectionId?{sectionId:g.sectionId}:{},visible:E,interactive:g.polygon.listening(),opacity:T,fill:typeof L=="string"?L:"",effectiveBackground:g.effectiveBackground,...E?{screenBox:{x:o(y),y:o(k),width:o(w-y),height:o(C-k)}}:{}}}),u=[...t.freeTextById].map(([m,g])=>{var b;const{node:y,background:k,kind:w}=g,C=t.worldToScreen({x:y.x(),y:y.y()}),S=y.width()*s,T=y.height()*i,E=C.x-y.offsetX()*s,L=C.y-y.offsetY()*i,I=o(y.fontSize()*i),M=E+S<0||E>n.width||L+T<0||L>n.height,x=y.isVisible()&&!M,A=y.fill(),P=o(y.getAbsoluteOpacity());let N;return x||(I<12?N="below-minimum-size":M?N="outside-viewport":N="renderer-hidden"),{objectId:(b=g.objectId)!==null&&b!==void 0?b:m,kind:w,text:y.text(),visible:x,renderedFontPx:I,ink:typeof A=="string"?A:"",background:k,opacity:P,...x?{screenBox:{x:o(E),y:o(L),width:o(S),height:o(T)}}:{},...N?{hiddenReason:N}:{}}}),h=t.labelGroup.find(m=>m.getAttr("rowLabel")===!0).filter(m=>m instanceof re).map(m=>{const g=m.getClientRect({skipShadow:!0,skipStroke:!0}),b=g.x+g.width<0||g.x>n.width||g.y+g.height<0||g.y>n.height,y=m.fill();return{text:m.text(),visible:m.isVisible()&&!b,renderedFontPx:o(m.fontSize()*i),ink:typeof y=="string"?y:"",...b?{}:{screenBox:{x:o(g.x),y:o(g.y),width:o(g.width),height:o(g.height)}}}}),p=Jt(t.canvasBackground),f=new Set(["normal","nearly-gone","sold-out","closed"].map(m=>In(p,m).toLowerCase())),v=t.sections.filter(m=>m.blockPoly.opacity()>.05);return{viewport:n,projection:t.viewMode,...t.viewMode==="perspective"?{perspective:{model:"pinhole-exact-seat-anchors",sectionSurfaceModel:"tangent-plane",exactSeatAnchorCount:t.perspectiveSeatProjected.size,depthSorted:!0}}:{},canvasBackground:t.canvasBackground,effectiveScale:o(i),rung:t.getRung(),minimumVisibleLabelPx:12,totalLabelledBookableUnits:a.length,visibleLabels:r,hiddenLabels:a.length-r,totalBookableUnits:a.length+d.reduce((m,g)=>m+g.capacity,0),selectionRingSeatIds:t.overlayLayer.find(".selection-ring").map(m=>{var g;return String((g=m.getAttr("seatId"))!==null&&g!==void 0?g:"")}).filter(Boolean),selectionRingColor:t.effSelection,focusedSectionId:t.focusedSectionId,focusBackdropVisible:!!(!((e=t.focusBackdrop)===null||e===void 0)&&e.isVisible()),categoryFilterKeys:t.categoryFilter?[...t.categoryFilter].sort():null,overviewStyle:{visibleSectionShells:v.length,categoryPaintedSectionShells:v.filter(m=>{const g=m.blockPoly.fill();return typeof g!="string"||!f.has(g.toLowerCase())}).length,visibleCategoryDetailOutlines:t.sections.filter(m=>m.outlinePoly.opacity()>.05).length,visibleSectionRowHints:0,visibleSectionAvailabilityLabels:t.sections.filter(m=>m.subLabel.opacity()>.05).length,visibleSectionGADetails:[...t.gaById.values()].filter(m=>m.sectionId!=null&&m.polygon.opacity()>.05).length},labels:a,gaAreas:d,hierarchyLabels:c,freeTextLabels:u,rowLabels:h}}var At=class extends q{_sceneFunc(t){const e=this.radiusX(),i=this.radiusY();t.beginPath(),t.save(),e!==i&&t.scale(1,i/e),t.arc(0,0,e,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}};At.prototype.className="Ellipse",At.prototype._centroid=!0,At.prototype._attrsAffectingSize=["radiusX","radiusY"],$e(At),O.addComponentsGetterSetter(At,"radius",["x","y"]),O.addGetterSetter(At,"radiusX",0,se()),O.addGetterSetter(At,"radiusY",0,se());var Rt=class extends Ee{_sceneFunc(t){super._sceneFunc(t);const e=Math.PI*2,i=this.points();let s=i;const n=this.tension()!==0&&i.length>4;n&&(s=this.getTensionPoints());const o=this.pointerLength(),a=i.length;let r,l;if(n){const u=[s[s.length-4],s[s.length-3],s[s.length-2],s[s.length-1],i[a-2],i[a-1]],h=Ct.calcLength(s[s.length-4],s[s.length-3],"C",u),p=Ct.getPointOnQuadraticBezier(Math.min(1,1-o/h),u[0],u[1],u[2],u[3],u[4],u[5]);r=i[a-2]-p.x,l=i[a-1]-p.y}else r=i[a-2]-i[a-4],l=i[a-1]-i[a-3];const c=(Math.atan2(l,r)+e)%e,d=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(i[a-2],i[a-1]),t.rotate(c),t.moveTo(0,0),t.lineTo(-o,d/2),t.lineTo(-o,-d/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(i[0],i[1]),n?(r=(s[0]+s[2])/2-i[0],l=(s[1]+s[3])/2-i[1]):(r=i[2]-i[0],l=i[3]-i[1]),t.rotate((Math.atan2(-l,-r)+e)%e),t.moveTo(0,0),t.lineTo(-o,d/2),t.lineTo(-o,-d/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){const e=this.dashEnabled();e&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),e&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),e=this.pointerWidth()/2;return{x:t.x,y:t.y-e,width:t.width,height:t.height+e*2}}};Rt.prototype.className="Arrow",$e(Rt),O.addGetterSetter(Rt,"pointerLength",10,se()),O.addGetterSetter(Rt,"pointerWidth",10,se()),O.addGetterSetter(Rt,"pointerAtBeginning",!1),O.addGetterSetter(Rt,"pointerAtEnding",!0);var fr="M13 4.6a1.6 1.6 0 1 0-3.2 0 1.6 1.6 0 0 0 3.2 0 M11 6.5V13h5l2.4 6 M15 16.4A5 5 0 1 1 9 11.3",vr=[{key:"restroom-men",label:"Men's restroom",group:"facilities",path:"M16 7a4 4 0 1 0-8 0 4 4 0 0 0 8 0 M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"},{key:"restroom-women",label:"Women's restroom",group:"facilities",path:"M15 5a3 3 0 1 0-6 0 3 3 0 0 0 6 0 M12 8l-4 10h8l-4-10 M10 18v4 M14 18v4"},{key:"restroom-accessible",label:"Accessible restroom",group:"facilities",path:fr},{key:"first-aid",label:"First aid",group:"facilities",path:"M5 4h14a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1Z M12 8v8 M8 12h8"},{key:"coat-check",label:"Coat check",group:"facilities",path:"M12 6a2 2 0 0 1 0-4 2 2 0 0 1 1.6 3.2L21 13H3l8.4-7.8 M3 13h18"},{key:"atm",label:"ATM / cash",group:"facilities",path:"M2 6h20v12H2V6Z M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0 M6 9h.01 M18 15h.01"},{key:"info",label:"Info point",group:"facilities",path:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18 M12 11v5 M12 8h.01"},{key:"lost-found",label:"Lost & found",group:"facilities",path:"M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14 M16 16l5 5 M9 8.5a2 2 0 1 1 3 1.7c-.8.5-1 .8-1 1.8 M11 15h.01"},{key:"restrooms",label:"Restrooms",group:"facilities",path:"M6 3h12a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z M12 8a2 2 0 1 0 0 4 2 2 0 0 0 0-4 M9 18v-3.5a3 3 0 0 1 6 0V18"},{key:"charging",label:"Charging point",group:"facilities",path:"M3 8h13v8H3V8Z M16 10h3v4h-3 M9.6 9l-2 3.5h2.5l-1.5 3"},{key:"smoking",label:"Smoking area",group:"facilities",path:"M2 15h13v3H2v-3Z M18 16h2 M19 8c0 1 1 1.5 1 2.5S19 12 19 13"},{key:"no-smoking",label:"No smoking",group:"facilities",path:"M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18 M5.6 5.6l12.8 12.8 M7 13h6v2H7v-2Z"},{key:"food",label:"Food",group:"food-drink",path:"M7 3v6a2 2 0 0 0 4 0V3 M9 11v10 M17 3c-1.6 1-2.2 3-2.2 6 0 2 .9 3.2 2.2 3.6V21"},{key:"bar",label:"Bar",group:"food-drink",path:"M4 5h16l-8 8-8-8Z M12 13v6 M8 20h8"},{key:"coffee",label:"Café / coffee",group:"food-drink",path:"M4 8h13v4a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5V8Z M17 9h2a2 2 0 0 1 0 4h-2 M8 2v2 M11 2v2 M4 21h14"},{key:"water",label:"Water / drinks",group:"food-drink",path:"M12 22a7 7 0 0 1-7-7c0-5 7-12 7-12s7 7 7 12a7 7 0 0 1-7 7Z"},{key:"merch",label:"Merch / shop",group:"food-drink",path:"M6 8h12l-1 12H7L6 8Z M9 8V6a3 3 0 0 1 6 0v2"},{key:"screen",label:"Screen",group:"facilities",path:"M3 4h18v12H3V4Z M9 20h6 M12 16v4 M10 8l4 2-4 2V8Z"},{key:"sound-booth",label:"Sound booth",group:"facilities",path:"M6 4v16 M6 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4 M12 4v16 M12 8a2 2 0 1 0 0 4 2 2 0 0 0 0-4 M18 4v16 M18 12a2 2 0 1 0 0 4 2 2 0 0 0 0-4"},{key:"entrance",label:"Entrance",group:"navigation",path:"M14 3h5a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-5 M3 12h11 M10 8l4 4-4 4"},{key:"exit",label:"Exit",group:"navigation",path:"M10 3H5a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h5 M14 12h7 M17 8l4 4-4 4"},{key:"emergency-exit",label:"Emergency exit",group:"navigation",path:"M14 4.6a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0 M12.5 8l-3.5 2 1.6 3.6-2 4.4 M12.5 10l3.5 1.5 M9 10.5l-3.5 1 M15 12h6 M18 9l3 3-3 3"},{key:"stairs",label:"Stairs",group:"navigation",path:"M3 20v-4h4v-4h4v-4h4V4h5"},{key:"elevator",label:"Elevator",group:"navigation",path:"M5 3h14a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z M8 11l1.5-2 1.5 2 M8 14l1.5 2 1.5-2 M15 8v8"},{key:"parking",label:"Parking",group:"navigation",path:"M5 3h14a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Z M9 17V7h4a3 3 0 0 1 0 6H9"},{key:"wheelchair",label:"Wheelchair access",group:"accessibility",path:fr},{key:"hearing",label:"Hearing assistance",group:"accessibility",path:"M8 20a4 4 0 0 1-2-3c0-1 .5-2 .5-3a4.5 4.5 0 1 1 9 0c0 1.4-1 2-2 2.4-1.2.5-1.5 1-1.5 2.2 M17 6a5 5 0 0 1 1 6 M19.5 4a8 8 0 0 1 1.2 9"}],ju=new Map(vr.map(t=>[t.key,t]));function Uu(t){return t?ju.get(t):void 0}function Wu(t){var e;return(e=Uu(t))===null||e===void 0?void 0:e.path}var fg=vr.map(t=>t.key),Ku="round",Yu="round",mr="none";function Xu(t){var e,i,s,n;return{lineCap:(e=t.lineCap)!==null&&e!==void 0?e:Ku,lineJoin:(i=t.lineJoin)!==null&&i!==void 0?i:Yu,startEnding:(s=t.startEnding)!==null&&s!==void 0?s:mr,endEnding:(n=t.endEnding)!==null&&n!==void 0?n:mr}}function Zu(t){return{pointerLength:Math.min(48,Math.max(8,t*3)),pointerWidth:Math.min(40,Math.max(8,t*2.25))}}function gr(t,e){var i;return e.length===0?!!t.accessible:!!(!((i=t.accessibility)===null||i===void 0)&&i.some(s=>e.includes(s)))}var Mn="#0b1220",br="#ffffff",Qu="#0b1220",Ju="#232c40",ep="#8b93a7";function tp(t,e,i="normal"){const s=t?"bold":i;return e?`italic ${s}`.trim():s}var yr="#0e1117";function ip(t,e){var i,s;const n=new window.Image,o=new Ve({image:n,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:(i=e.rotation)!==null&&i!==void 0?i:0,opacity:_e((s=e.opacity)!==null&&s!==void 0?s:1,0,1),listening:!1,perfectDrawEnabled:!1});e.layer==="foreground"?t.fgDecorGroup.add(o):t.bgLayer.add(o),t.trackAssetImage(n,e.href,`Decor image “${e.label||e.id}”`,()=>{const a=o.getLayer();a&&a.batchDraw()})}function sp(t,e){var i;if(e.shape==="round"){var s;t.bgLayer.add(new Pe({x:e.center.x,y:e.center.y,radius:(s=e.radius)!==null&&s!==void 0?s:40,fill:"#232c40",stroke:"#2a3348",strokeWidth:1.5,listening:!1}))}else{var n,o;const r=(n=e.width)!==null&&n!==void 0?n:80,l=(o=e.height)!==null&&o!==void 0?o:50;t.bgLayer.add(new Ie({x:e.center.x,y:e.center.y,width:r,height:l,offsetX:r/2,offsetY:l/2,rotation:e.rotation,fill:"#232c40",stroke:"#2a3348",strokeWidth:1.5,cornerRadius:4,listening:!1}))}const a=Mi(t,t.bgLayer,(i=e.displayLabel)!==null&&i!==void 0?i:e.label,e.center.x,e.center.y,"#cbd5e1",12,!0);t.freeTextById.set(e.id,{node:a,background:"#232c40",kind:"table"})}function np(t,e){var i,s,n,o,a,r,l,c,d,u,h;const p=(i=(s=e.background)===null||s===void 0?void 0:s.color)!==null&&i!==void 0?i:t.canvasBackground,f=(n=(o=e.color)!==null&&o!==void 0?o:t.theme.textColor)!==null&&n!==void 0?n:ep,v=e.semanticKind==="icon"?Wu(e.iconKey):void 0;if(v){const C=e.fontSize/24,S=new Ct({x:e.position.x,y:e.position.y,data:v,rotation:e.rotation,scaleX:C,scaleY:C,stroke:dt(p,f),strokeWidth:2,lineCap:"round",lineJoin:"round",fillEnabled:!1,listening:!1,perfectDrawEnabled:!1});t.iconNodeById.set(e.id,{node:S,fontSize:e.fontSize}),t.bgLayer.add(S);return}const m=(a=(r=e.background)===null||r===void 0?void 0:r.padding)!==null&&a!==void 0?a:0,g=(l=e.opacity)!==null&&l!==void 0?l:1,b=new re({x:e.position.x,y:e.position.y,text:e.text,fontSize:e.fontSize,rotation:e.rotation,fontStyle:tp(e.bold,e.italic,"600"),fill:dt(p,f),fontFamily:(c=e.fontFamily)!==null&&c!==void 0?c:t.labelFont(),...e.width!=null?{width:e.width}:{},align:(d=e.align)!==null&&d!==void 0?d:"left",lineHeight:(u=e.lineHeight)!==null&&u!==void 0?u:1.2,letterSpacing:(h=e.letterSpacing)!==null&&h!==void 0?h:0,textDecoration:e.underline?"underline":"",padding:m,opacity:g,wrap:"word",listening:!1,perfectDrawEnabled:!1,name:"buyer-free-text"});let y;if(e.background){var k,w;y=new Ie({x:e.position.x,y:e.position.y,width:b.width(),height:b.height(),rotation:e.rotation,fill:e.background.color,opacity:g*((k=e.background.opacity)!==null&&k!==void 0?k:.9),cornerRadius:(w=e.background.cornerRadius)!==null&&w!==void 0?w:4,listening:!1,perfectDrawEnabled:!1,name:"buyer-text-background"}),t.bgLayer.add(y)}t.freeTextById.set(e.id,{node:b,backdrop:y,background:p,kind:"free-text"}),t.bgLayer.add(b)}function op(t,e){var i,s,n,o,a,r;const l=(i=(s=e.fill)!==null&&s!==void 0?s:t.theme.decorFill)!==null&&i!==void 0?i:Ju,c=e.role==="stage",d=e.role==="reference-focal",u=!!e.role&&!c,h=Jt(t.canvasBackground),p=d?h.focalFill:l,f=e.kind==="line"||e.kind==="polyline",v=(n=(o=e.stroke)===null||o===void 0?void 0:o.color)!==null&&n!==void 0?n:c?Nt(p,.28):d?h.focalStroke:f?"#9aa3b5":void 0,m=(a=(r=e.stroke)===null||r===void 0?void 0:r.width)!==null&&a!==void 0?a:c?1:d||f?2:0,g=e.opacity!=null?_e(e.opacity,.1,1):1;let b=0,y=0;if(f&&e.points&&e.points.length>=2){var k;b=e.points.reduce((M,x)=>M+x.x,0)/e.points.length,y=e.points.reduce((M,x)=>M+x.y,0)/e.points.length;const E=Xu(e),L=Zu(m),I=new Rt({points:e.points.flatMap(M=>[M.x,M.y]),closed:!1,x:b,y,offsetX:b,offsetY:y,rotation:(k=e.rotation)!==null&&k!==void 0?k:0,stroke:v,fill:v,strokeWidth:m,opacity:g,lineCap:E.lineCap,lineJoin:E.lineJoin,pointerAtBeginning:E.startEnding==="arrow",pointerAtEnding:E.endEnding==="arrow",...L,listening:!1,name:"buyer-shape-open-path"});I.setAttr("shapeObjectId",e.id),t.bgLayer.add(I)}else if(e.kind==="rect"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){var w,C;const E=c?{fillLinearGradientStartPoint:{x:0,y:0},fillLinearGradientEndPoint:{x:0,y:e.height},fillLinearGradientColorStops:[0,Vt(p,.3),1,Nt(p,.12)]}:{fill:p};b=e.x+e.width/2,y=e.y+e.height/2,t.bgLayer.add(new Ie({x:b,y,offsetX:e.width/2,offsetY:e.height/2,rotation:(w=e.rotation)!==null&&w!==void 0?w:0,width:e.width,height:e.height,...E,stroke:v,strokeWidth:m,cornerRadius:_e((C=e.cornerRadius)!==null&&C!==void 0?C:4,0,Math.min(e.width,e.height)/2),opacity:g,listening:!1}))}else if(e.kind==="ellipse"&&e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null){var S;b=e.x+e.width/2,y=e.y+e.height/2;const E=c?{fillLinearGradientStartPoint:{x:0,y:-e.height/2},fillLinearGradientEndPoint:{x:0,y:e.height/2},fillLinearGradientColorStops:[0,Vt(p,.3),1,Nt(p,.12)]}:{fill:p};t.bgLayer.add(new At({x:b,y,rotation:(S=e.rotation)!==null&&S!==void 0?S:0,radiusX:e.width/2,radiusY:e.height/2,...E,stroke:v,strokeWidth:m,opacity:g,listening:!1}))}else if(e.kind==="polygon"&&e.points&&e.points.length){var T;const E=e.points.flatMap(M=>[M.x,M.y]),L=Ge(e.points);b=e.points.reduce((M,x)=>M+x.x,0)/e.points.length,y=e.points.reduce((M,x)=>M+x.y,0)/e.points.length;const I=c?{fillLinearGradientStartPoint:{x:0,y:L.y},fillLinearGradientEndPoint:{x:0,y:L.y+L.height},fillLinearGradientColorStops:[0,Vt(p,.3),1,Nt(p,.12)]}:{fill:p};t.bgLayer.add(new Ee({points:E,closed:!0,x:b,y,offsetX:b,offsetY:y,rotation:(T=e.rotation)!==null&&T!==void 0?T:0,...I,stroke:v,strokeWidth:m,opacity:g,listening:!1}))}if(e.label)if(c){const E=ap(t,b,y,e.label,p);t.primaryFocalLabels.set(E,22),t.freeTextById.set(e.id,{node:E,background:p,kind:"stage"})}else if(u){const E=Mi(t,t.bgLayer,e.label,b,y,d?dt(p,"#e6e9f0"):"#9aa3b5",d?18:12,!1);d&&t.primaryFocalLabels.set(E,18),t.freeTextById.set(e.id,{node:E,background:p,kind:"decor"})}else{const E=Mi(t,t.bgLayer,e.label,b,y,"#cbd5e1",16,!0);t.freeTextById.set(e.id,{node:E,background:p,kind:"decor"})}}function ap(t,e,i,s,n){const o=dt(n,"#e6e9f0"),a=new re({x:e,y:i,text:s.toUpperCase(),fontSize:22,fontStyle:"700",letterSpacing:4,fontFamily:t.labelFont(),fill:o,listening:!1,perfectDrawEnabled:!1});return a.offsetX(a.width()/2),a.offsetY(a.height()/2),t.bgLayer.add(a),a}function rp(t,e){var i,s,n,o;const a=(i=t.catColor.get(e.categoryKey))!==null&&i!==void 0?i:"#6e7bff",r=t.canvasBackground,l=kd(a,r,es),c=dt(l,(s=t.theme.textColor)!==null&&s!==void 0?s:"#e6e9f0"),d=xs(e.points,e.holes,{fill:a,opacity:es,stroke:a,strokeWidth:1.5,cornerRadius:e.cornerRadius});d.setAttr("gaId",e.id),d.on("click tap",v=>{var m,g;t.isGhostClick(v)||(m=(g=t.opts).onGAClick)===null||m===void 0||m.call(g,e.id)}),d.on("mouseenter",()=>{t.container.style.cursor="pointer"}),d.on("mouseleave",()=>{t.container.style.cursor="default"}),t.bgLayer.add(d);const u=Qs(e.points,e.holes),h=t.sections.find(v=>Ke(u,v.outline,v.holes)),p=Mi(t,t.bgLayer,(n=e.displayLabel)!==null&&n!==void 0?n:e.label,u.x,u.y-8,c,15,!1),f=Mi(t,t.bgLayer,`cap ${e.capacity}`,u.x,u.y+10,c,11,!1);t.freeTextById.set(`${e.id}:label`,{objectId:e.id,node:p,background:l,kind:"ga-label",categoryKey:e.categoryKey}),t.freeTextById.set(`${e.id}:capacity`,{objectId:e.id,node:f,background:l,kind:"ga-capacity",categoryKey:e.categoryKey}),t.gaById.set(e.id,{label:(o=e.displayLabel)!==null&&o!==void 0?o:e.label,capacity:e.capacity,categoryKey:e.categoryKey,points:e.points,polygon:d,effectiveBackground:l,...h?{sectionId:h.logicalId}:{}})}function Mi(t,e,i,s,n,o,a,r){const l=new re({x:s,y:n,text:i,fontSize:a,fontStyle:r?"700":"500",fontFamily:t.labelFont(),fill:o,listening:!1,perfectDrawEnabled:!1});return l.offsetX(l.width()/2),l.offsetY(l.height()/2),e.add(l),l}function lp(t,e){var i;const s=[],n=(i=e.theme.background)!==null&&i!==void 0?i:"#0e1117",o=new Map,a=(T,E)=>{var L;const I=(L=o.get(T))!==null&&L!==void 0?L:[];I.push(E),o.set(T,I)};for(const T of e.seats){var r;if(T.kind==="booth")continue;const E=(r=T.logicalRowId)!==null&&r!==void 0?r:T.rowId;a(E,T),E!==T.rowId&&a(T.rowId,T)}const l=T=>{var E,L;return(E=T.logicalSeatIndex)!==null&&E!==void 0?E:Number((L=T.id.split(":").pop())!==null&&L!==void 0?L:0)};for(const T of t.objects){var c,d,u,h,p,f,v,m,g,b,y,k,w;if(T.type!=="row")continue;const E=((c=T.segmentedRow)===null||c===void 0?void 0:c.repeatLabelOnComponents)===!0;if(T.segmentedRow&&!E&&T.segmentedRow.componentIndex!==0)continue;const L=E?T.labelPresentation:(d=(u=T.segmentedRow)===null||u===void 0?void 0:u.labelPresentation)!==null&&d!==void 0?d:T.labelPresentation;if((L==null?void 0:L.visible)===!1||(L==null?void 0:L.positionPreset)==="none")continue;const I=T.segmentedRow&&!E?T.segmentedRow.groupId:T.id,M=((h=o.get(I))!==null&&h!==void 0?h:[]).slice().sort((Y,ie)=>l(Y)-l(ie));if(!M.length)continue;const x=M[0],A=M[M.length-1],P=L==null?void 0:L.labelStyle,N=dt(n,(p=(f=(v=P==null?void 0:P.color)!==null&&v!==void 0?v:e.theme.rowLabelColor)!==null&&f!==void 0?f:e.theme.textColor)!==null&&p!==void 0?p:"#e6e9f0",3),W=(m=P==null?void 0:P.size)!==null&&m!==void 0?m:12,B=(g=L==null?void 0:L.rotation)!==null&&g!==void 0?g:0,z=(b=(y=(k=T.segmentedRow)===null||k===void 0?void 0:k.displayLabel)!==null&&y!==void 0?y:T.displayLabel)!==null&&b!==void 0?b:T.label,j=e.objectFilteredOut(T)?.15:1,G=e.seatSection.get(x.id),D=G?[...new Set([G.id,G.logicalId,G.zone].filter(Y=>!!Y))]:void 0,F=(Y,ie,ae)=>s.push({text:z,x:Y,y:ie,rotation:B,fontSize:W,ink:N,opacity:j,...D!=null&&D.length?{focusKeys:D}:{},...ae?{automaticAway:ae}:{}});if(L!=null&&L.position){F(L.position.x,L.position.y);continue}const _=e.seatR+12,U=(w=L==null?void 0:L.positionPreset)!==null&&w!==void 0?w:"start";if(U==="start"||U==="both"){const Y=T.rotation*Math.PI/180,ie={x:-Math.cos(Y),y:-Math.sin(Y)};F(x.x+ie.x*_,x.y+ie.y*_,ie)}if(U==="end"||U==="both"){const Y=(T.rotation+T.curve)*Math.PI/180,ie={x:Math.cos(Y),y:Math.sin(Y)};F(A.x+ie.x*_,A.y+ie.y*_,ie)}}const C=(e.seatR+12)*2.2,S=[];for(const T of s){const E=S.find(L=>L.text===T.text&&Math.hypot(L.x-T.x,L.y-T.y)<=C);if(E){E.x=(E.x+T.x)/2,E.y=(E.y+T.y)/2;continue}S.push(T)}return S}function kr(t,e,i=2){const s=t.rotation()*Math.PI/180,n=Math.abs(Math.cos(s)),o=Math.abs(Math.sin(s)),a=(t.width()*n+t.height()*o)/2+i,r=(t.width()*o+t.height()*n)/2+i;return{x:e.x-a,y:e.y-r,width:a*2,height:r*2}}function cp(t,e,i,s){const n={x:e.x,y:e.y},o=e.automaticAway;if(!o)return n;const a={x:-o.y,y:o.x},r=Math.max(7,Math.min(16,e.fontSize*.75)),l=[{x:0,y:0}];for(let h=1;h<=4;h++){const p=r*h;l.push({x:a.x*p,y:a.y*p},{x:-a.x*p,y:-a.y*p},{x:o.x*p,y:o.y*p},{x:(o.x+a.x)*p,y:(o.y+a.y)*p},{x:(o.x-a.x)*p,y:(o.y-a.y)*p})}let c=n,d=1/0,u=1/0;for(const h of l){const p={x:n.x+h.x,y:n.y+h.y},f=kr(t,p),v=(s?Qa(s,f,{mode:"overlap"}).length:0)+i.collisionCount(f),m=Math.hypot(h.x,h.y);if((v2500;t.seatLayer.opacity(n||o?0:1-i);const a=t.stageScaleX,r=!t.glideInProgress&&(t.lodScale===0||Math.abs(e-t.lodScale)/(t.lodScale||1)>.08);r&&t.setLodScale(e);const l=t.focusedSectionId,c=Jt(t.canvasBackground),d=_e((i-.2)/.8,0,1);for(const h of t.sections){const p=t.hasFocusDimOverlay?1:l&&h.id!==l&&h.logicalId!==l&&h.zone!==l?ws:1,f=Math.min(p,Gu(h.memberCategoryKeys,t.categoryFilter)?ws:1);h.outlinePoly.opacity(n?0:(1-i)*f),h.blockPoly.opacity(1*i*f),h.blockPoly.stroke(c.sectionStroke),h.blockPoly.strokeWidth(1/Math.max(a,1e-4));const v=h.blockPoly.fill(),m=dt(typeof v=="string"?v:h.baseFill,h.preferredInk);h.nameLabel.fill(m),h.subLabel.fill(m),r&&d>.01&&vp(t,h,a),h.nameLabel.opacity(h.nameLabelFits?d*(1-s)*f:0),h.subLabel.opacity(0)}const u=s*(1-t.isoT);for(const h of t.zones)h.back.opacity(u),h.label.opacity(u),h.sub&&h.sub.opacity(t.stageWidth<640?0:u),r&&mp(t,h,a);if(!t.glideInProgress&&(d>.01||u>.01)){fp(t,a),pp(t.sections);for(const h of t.zones){const p=h.label.opacity();h.back.opacity(p),h.sub&&h.sub.opacity(t.stageWidth<640?0:p)}}t.bgLayer.batchDraw()}function pp(t){const e=new Map;for(const s of t){var i;((i=e.get(s.logicalId))!==null&&i!==void 0?i:e.set(s.logicalId,[]).get(s.logicalId)).push(s)}for(const s of e.values()){if(s.length<2)continue;const n=s.filter(o=>o.nameLabel.opacity()>.05).sort((o,a)=>{const r=Ge(o.outline),l=Ge(a.outline);return l.width*l.height-r.width*r.height});for(const o of n.slice(1))o.nameLabel.opacity(0)}}function fp(t,e){const s=[],n=r=>{const l=t.worldToScreen({x:r.x(),y:r.y()}),c=Ge(hr({x:0,y:0},r.width()*e,r.height()*e,r.rotation()));return{x:l.x-c.width/2,y:l.y-c.height/2,w:c.width,h:c.height}};for(const r of t.zones){if(r.label.opacity()<=.05)continue;const l=t.worldToScreen(r.anchor),c=r.back.width()*e,d=r.back.height()*e;s.push({node:r.label,tier:0,section:!1,box:{x:l.x-c/2,y:l.y-d/2,w:c,h:d}})}for(const r of t.sections)r.nameLabel.opacity()>.05&&s.push({node:r.nameLabel,tier:1,section:!0,area:r.labelArea,box:n(r.nameLabel)});if(s.length<2)return;s.sort((r,l)=>{var c,d;return r.tier-l.tier||((c=l.area)!==null&&c!==void 0?c:0)-((d=r.area)!==null&&d!==void 0?d:0)||r.box.y-l.box.y||r.box.x-l.box.x});const o=[],a=r=>o.some(l=>r.x=o;a-=1)for(const r of[0,-90]){e.nameLabel.rotation(r),_i(e.nameLabel,a/i,e.nameLabel.y());for(const l of e.labelAnchors){e.nameLabel.position(l);const c=8/i;if(ur(l,e.nameLabel.width()+c,e.nameLabel.height()+c,r,e.outline,e.holes)){e.nameLabelFits=!0;return}}}e.nameLabel.position(e.centroid),e.nameLabel.rotation(0),e.nameLabelFits=!1}function mp(t,e,i){const s=lr(t.stageWidth),n=e.sub!=null&&t.stageWidth>=640,o=t.stageWidth<640,a=(o?7:10)*s/i,r=(o?4:6)*s/i,l=n?3*s/i:0;_i(e.label,18*s/i,e.anchor.y),n&&_i(e.sub,12*s/i,e.anchor.y);const c=Math.max(e.label.width(),n?e.sub.width():0)+a*2,d=e.label.height()+(n?l+e.sub.height():0)+r*2;e.label.y(e.anchor.y-(n?(l+e.sub.height())/2:0)),n&&e.sub.y(e.anchor.y+(e.label.height()+l)/2),e.back.position(e.anchor),e.back.size({width:c,height:d}),e.back.offset({x:c/2,y:d/2}),e.back.cornerRadius(7*s/i),e.back.strokeWidth(1/i);const u=e.back.getAbsolutePosition(),h=62+d*i/2;if(u.y=Lt;for(const[d,u]of t.boothLabelById){var s;const h=t.circleById.get(d);u.visible(Gt(u.fontSize(),e)&&!!(h!=null&&h.isVisible())&&t.focusedSeatOpacity(d,(s=h==null?void 0:h.getAbsoluteOpacity())!==null&&s!==void 0?s:1)>=.5)}t.labelGroup.destroyChildren(),t.labelLiftGroups.clear(),t.seatLabelById.clear();let n=0;if(i)for(const d of t.visibleSeatCandidates()){var o,a,r;if(d.kind==="booth")continue;const u=t.worldToScreen(d);if(u.x<-20||u.x>t.stage.width()+20||u.y<-20||u.y>t.stage.height()+20||t.accessGlyphById.has(d.id)&&t.accessGlyphShouldShow(d.id))continue;const h=t.circleById.get(d.id);if(!(h!=null&&h.isVisible())||t.focusedSeatOpacity(d.id,h.getAbsoluteOpacity())<.5)continue;const p=(o=t.statusById.get(d.id))!==null&&o!==void 0?o:"free",f=t.renderedSeatPoint(d),v=t.viewMode==="perspective"&&(a=t.perspectiveSeatScale.get(d.id))!==null&&a!==void 0?a:1;if(p==="booked"||p==="held"&&!t.ownedHold.has(d.id)&&!t.opts.manageMode){const y=new Ne({x:f.x,y:f.y,listening:!1});if(y.scale({x:v,y:v}),p==="held"?(y.add(new Ie({x:-4.2,y:-.7,width:8.4,height:6.5,cornerRadius:1.3,stroke:"#ffffff",strokeWidth:1.25,listening:!1})),y.add(new Ee({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 Ee({points:[-4.2,4.2,4.2,-4.2],stroke:"#ffffff",strokeWidth:1.8,lineCap:"round",listening:!1})),t.seatLabelContainer(d.id).add(y),++n>=700)break;continue}const m=7*t.seatLabelScale(d),g=new re({x:f.x,y:f.y,text:Jo((r=d.displayLabel)!==null&&r!==void 0?r:d.label),fontSize:m,fontStyle:"600",fontFamily:t.labelFont(),fill:h?t.seatLabelInk(d,h):t.seatPreferredLabelInk(d),listening:!1,perfectDrawEnabled:!1}),b=t.seatR*2-3;if(g.width()>b&&g.fontSize(Math.max(4,m*b/g.width())),g.width()>b+.01){g.destroy();continue}if(!Gt(g.fontSize(),e)){g.destroy();continue}if(g.offsetX(g.width()/2),g.offsetY(g.height()/2),g.scale({x:v,y:v}),t.seatLabelContainer(d.id).add(g),t.seatLabelById.set(d.id,g),++n>=700)break}const l=new dr;for(const{node:d}of t.freeTextById.values()){if(!d.isVisible())continue;const u=d.getClientRect({relativeTo:t.bgLayer,skipShadow:!0,skipStroke:!0});l.insert({x:u.x-2,y:u.y-2,width:u.width+4,height:u.height+4})}for(const d of t.rowLabelPlan){var c;const u=t.focusedSectionId!=null&&((c=d.focusKeys)===null||c===void 0?void 0:c.includes(t.focusedSectionId)),h=u?Math.max(d.fontSize,gu/Math.max(e,1e-4)):d.fontSize;if(!u&&!Gt(h,e))continue;const p=t.worldToScreen({x:d.x,y:d.y});if(p.x<-40||p.x>t.stage.width()+40||p.y<-40||p.y>t.stage.height()+40)continue;const f=new re({x:d.x,y:d.y,text:d.text,fontSize:h,fontStyle:"700",fontFamily:t.labelFont(),fill:d.ink,rotation:d.rotation,opacity:d.opacity,shadowColor:"#05070c",shadowBlur:d.ink.toLowerCase()==="#ffffff"?5:0,shadowOpacity:d.ink.toLowerCase()==="#ffffff"?.8:0,shadowForStrokeEnabled:!1,listening:!1,perfectDrawEnabled:!1});f.offsetX(f.width()/2),f.offsetY(f.height()/2);const v=t.resolveAutomaticRowLabelPosition(f,d,l);f.position(v),f.setAttr("rowLabel",!0),l.insert(t.rowLabelBox(f,v)),t.labelGroup.add(f)}t.isoT>0&&t.viewMode!=="perspective"&&t.applyUprightLabels(),t.overlayLayer.batchDraw()}function Ss(t){return{th:rr*Math.PI/180*t.isoT,sg:1-(1-Ln)*t.isoT}}function bp(t,e){const{th:i,sg:s}=Ss(e),n=e.centre,o=t.x-n.x,a=t.y-n.y,r=o*Math.cos(i)-a*Math.sin(i),l=(o*Math.sin(i)+a*Math.cos(i))*s;return{x:n.x+r,y:n.y+l}}function yp(t,e){const{th:i,sg:s}=Ss(e),n=e.centre,o=t.x-n.x,a=(t.y-n.y)/s,r=o*Math.cos(i)+a*Math.sin(i),l=-o*Math.sin(i)+a*Math.cos(i);return{x:n.x+r,y:n.y+l}}function kp(t,e){const{th:i,sg:s}=Ss(e),n=t*e.isoT;return{x:-(n/s)*Math.sin(i),y:-(n/s)*Math.cos(i)}}function wp(t,e,i){const s=du(e);t.offset(i),t.position(ft(e,i)),t.rotation(s.rotationDeg),t.scale({x:s.scaleX,y:s.scaleY}),t.skewX(s.skewX),t.skewY(0)}function xp(t){t.position({x:0,y:0}),t.offset({x:0,y:0}),t.scale({x:1,y:1}),t.rotation(0),t.skewX(0),t.skewY(0)}function Sp(t,e){const i=Math.hypot(e.x-t.surfaceFocal.x,e.y-t.surfaceFocal.y),s=Math.max(0,i-t.frontDistanceWorld);return t.liftWorld+s*Math.tan(t.rakeDeg*Math.PI/180)}function Cp(t,e,i){return t.perspectiveAffine?ft(t.perspectiveAffine,e):ft(i,e)}function Tp(t,e){return e?ft(e,t):t}function Lp(t,e){let i=0;for(const p of t.seats){var s;const f=Math.max(0,((s=p.eyeHeightM)!==null&&s!==void 0?s:lt)-lt);i=Math.max(i,f*Ki)}for(const p of t.objects)p.type==="section"&&(i=Math.max(i,Us(p,{floorBaseHeightM:t.floorBaseHeightMFor(p.id)}).height*Ki));const n=ru(t.bounds,i),o=Ja(n,n.target),a=lu(o);e.seatLocal.clear(),e.seatProjected.clear(),e.seatDepth.clear(),e.seatScale.clear();let r=1/0,l=1/0,c=-1/0,d=-1/0;for(const p of t.seats){var u;const f=Je(n,p,Math.max(0,((u=p.eyeHeightM)!==null&&u!==void 0?u:lt)-lt)*Ki),v={x:f.x,y:f.y};e.seatProjected.set(p.id,v),e.seatLocal.set(p.id,ft(a,v)),e.seatDepth.set(p.id,f.depth),e.seatScale.set(p.id,f.scale),r=Math.min(r,f.x),l=Math.min(l,f.y),c=Math.max(c,f.x),d=Math.max(d,f.y)}for(const p of[{x:t.bounds.x,y:t.bounds.y},{x:t.bounds.x+t.bounds.width,y:t.bounds.y},{x:t.bounds.x+t.bounds.width,y:t.bounds.y+t.bounds.height},{x:t.bounds.x,y:t.bounds.y+t.bounds.height}]){const f=Je(n,p,0);r=Math.min(r,f.x),l=Math.min(l,f.y),c=Math.max(c,f.x),d=Math.max(d,f.y)}const h=Math.max(24,t.seatR*3);return{camera:n,baseAffine:o,baseInverse:a,bounds:Number.isFinite(r)?{x:r-h,y:l-h,width:Math.max(1,c-r+h*2),height:Math.max(1,d-l+h*2)}:null}}function Ap(t,e,i){const s=i?[...i].map(a=>t.seatById.get(a)).filter(a=>!!a):e?t.seats:[...t.perspectiveAppliedSeats].map(a=>t.seatById.get(a)).filter(a=>!!a);for(const a of s){var n,o;if(e&&t.perspectiveAppliedSeats.has(a.id))continue;const r=e&&(n=t.perspectiveSeatProjected.get(a.id))!==null&&n!==void 0?n:a,l=e&&(o=t.perspectiveSeatScale.get(a.id))!==null&&o!==void 0?o:1,c=t.circleById.get(a.id);c==null||c.position(r),c==null||c.scale({x:l,y:l});const d=t.accessRingById.get(a.id);d==null||d.position(r),d==null||d.scale({x:l,y:l});const u=t.accessGlyphById.get(a.id);if(u){const p=t.seatR*1.5/24;u.position(r),u.scale({x:p*l,y:p*l})}const h=t.boothLabelById.get(a.id);h==null||h.position(r),h==null||h.scale({x:l,y:l}),e&&t.perspectiveAppliedSeats.add(a.id)}e||t.perspectiveAppliedSeats.clear()}var Sr;function _n(t){var e,i;const s=t;return(e=s==null||(i=s.getAttr)===null||i===void 0?void 0:i.call(s,"seatId"))!==null&&e!==void 0?e:void 0}var Pn=class wo{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()}}constructor(e,i={}){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.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.theme={},this.canvasBackground=yr,this.effSelection=br,this.colorblind=!1,this.cbHueByKey=new Map,this.rowLabelPlan=[],this.catOrder=[],this.selection=new Set,this.selectionMarkers=new Map,this.ownedHold=new Set,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!="undefined"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.fitScale=1,this.seatR=9,this.bounds={x:0,y:0,width:1,height:1},this.cached=!1,this.dpr=Math.min(typeof window!="undefined"&&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=n=>{if(this.opts.manageMode){if((n.metaKey||n.ctrlKey)&&(n.key==="a"||n.key==="A")){var o,a;n.preventDefault(),(o=(a=this.opts).onMarquee)===null||o===void 0||o.call(a,this.selectAllSelectable());return}if(n.key==="Escape"&&this.selection.size){var r,l;n.preventDefault(),this.clearSelection(),(r=(l=this.opts).onMarquee)===null||r===void 0||r.call(l,[]);return}}const c=n.key==="ArrowLeft"?{x:-1,y:0}:n.key==="ArrowRight"?{x:1,y:0}:n.key==="ArrowUp"?{x:0,y:-1}:n.key==="ArrowDown"?{x:0,y:1}:null;if(c){var d,u;n.preventDefault();const f=this.focusedId?this.nearestSeat(this.focusedId,c):(d=(u=this.seats[0])===null||u===void 0?void 0:u.id)!==null&&d!==void 0?d:null;f&&this.focusSeat(f);return}if((n.key==="Enter"||n.key===" ")&&this.focusedId){var h,p;n.preventDefault(),this.toggleSeat(this.focusedId);const f=this.seatById.get(this.focusedId);f&&((h=(p=this.opts).onFocusSeat)===null||h===void 0||h.call(p,f))}},this.container=e,this.opts={maxSelection:10,selectableStatuses:["free"],...i},this.exportMode=i.exportMode===!0,this.currency=i.currency;const s=fs.pixelRatio;this.exportMode&&(this.dpr=1),fs.pixelRatio=this.dpr,this.stage=new xi({container:e,width:e.clientWidth||1,height:e.clientHeight||1,draggable:!1}),this.gestures=new Nu(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",V("map.aria")),e.addEventListener("keydown",this.onKeyDown)),this.bgLayer=new Qe({listening:!this.exportMode}),this.seatLayer=new Qe({listening:!this.exportMode}),this.overlayLayer=new Qe({listening:!1}),this.labelGroup=new Ne({listening:!1}),this.overlayLayer.add(this.labelGroup),this.fgDecorGroup=new Ne({listening:!1}),this.overlayLayer.add(this.fgDecorGroup),this.hoverRing=new Pe({radius:11,stroke:"#ffffff",strokeWidth:2,opacity:.85,listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),this.overlayLayer.add(this.hoverRing),this.focusRing=new Pe({radius:12,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&&(fs.pixelRatio=s),this.exportMode||(this.wireInteraction(),this.startFpsLoop()),!this.exportMode&&typeof ResizeObserver!="undefined"&&(this.resizeObs=new ResizeObserver(()=>this.handleResize()),this.resizeObs.observe(e))}setChart(e,i){var s,n,o,a,r;if(e!==this.chartDoc&&(this.stacked=!1,this.floorOverview=!1),this.cancelAssetLoads(),this.chartDoc=e,this.activeFloorId=(s=i==null?void 0:i.floorId)!==null&&s!==void 0?s:Dt(e)[0].id,this.objectFloor.clear(),e.floors&&e.floors.length>1)for(const c of e.floors)for(const d of c.objects)this.objectFloor.set(d.id,c.id),d.type==="section"&&d.logicalSectionId&&this.objectFloor.set(d.logicalSectionId,c.id);const l=this.floorView(e);this.focusedId=null,this.focusRing.visible(!1),this.bgLayer.destroyChildren(),(n=this.focusDimOverlay)===null||n===void 0||n.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.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(const c of this.selectionMarkers.values())c.destroy();this.selectionMarkers.clear(),this.ownedHold.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=l.objects.some(c=>c.type==="section");for(const c of(o=e.zones)!==null&&o!==void 0?o:[])c.color&&this.zoneColor.set(c.id,c.color);this.seatLayer.opacity(1),this.hoverRing.visible(!1),this.hoveredId=null,this.theme=(a=e.theme)!==null&&a!==void 0?a:{},this.seatR=_e((r=this.theme.seatScale)!==null&&r!==void 0?r:1,.7,1.6)*9,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.catPrice.clear(),this.catOrder=e.categories.map(c=>c.key),this.cbHueByKey.clear(),[...this.catOrder].sort().forEach((c,d)=>{this.cbHueByKey.set(c,En[d%En.length])});for(const c of e.categories)this.catColor.set(c.key,c.color),typeof c.price=="number"&&this.catPrice.set(c.key,c.price);for(const c of l.objects)c.type==="booth"&&this.boothDims.set(c.id,{width:c.width,height:c.height,rotation:c.rotation,...c.points&&c.points.length>=3?{points:c.points.map(d=>({x:d.x,y:d.y}))}:{}});this.seats=Ye(l,{floorBaseHeightM:this.stacked||this.floorOverview?0:this.floorBaseHeightMFor()});for(const c of this.seats)this.seatById.set(c.id,c),this.statusById.set(c.id,"free");this.seatIndex=au(this.seats,{seatRadius:this.seatR}),this.bounds=qo(l),this.isoCentre={x:this.bounds.x+this.bounds.width/2,y:this.bounds.y+this.bounds.height/2},this.buildPerspectiveProjection(l),this.renderBackground(l),this.unsectionedSeatGroup=new Ne({listening:!this.exportMode}),this.seatLayer.add(this.unsectionedSeatGroup),this.renderSeats(),this.buildRowLabelPlan(l),this.overlayLayer.add(this.labelGroup),this.overlayLayer.add(this.fgDecorGroup),this.overlayLayer.add(this.hoverRing),this.overlayLayer.add(this.focusRing),this.zoomToFit()}floorView(e){var i;if(!e.floors||!e.floors.length)return{...e,referenceImage:void 0,backgroundImage:Ei(e)};if(this.floorOverview&&e.floors.length>=2)return{...td(e),referenceImage:void 0,backgroundImage:Ei(e)};if(this.stacked&&e.floors.length>=2)return{...ed(e),referenceImage:void 0,backgroundImage:Ei(e)};const s=(i=e.floors.find(n=>n.id===this.activeFloorId))!==null&&i!==void 0?i:e.floors[0];return{...e,objects:s.objects,focalPoint:s.focalPoint,referenceImage:void 0,backgroundImage:Ei(s),floors:void 0}}floorBaseHeightMFor(e){var i,s,n,o;const a=(i=this.chartDoc)===null||i===void 0?void 0:i.floors;if(!(a!=null&&a.length))return 0;const r=this.stacked&&e?(s=this.objectFloor.get(e))!==null&&s!==void 0?s:this.activeFloorId:this.activeFloorId;return(n=(o=a.find(l=>l.id===r))===null||o===void 0?void 0:o.baseHeightM)!==null&&n!==void 0?n: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?Dt(this.chartDoc).map(e=>({id:e.id,name:e.name})):[]}getActiveFloorId(){return this.activeFloorId}setStatus(e,i){let s=!1;const n=this.hasSections?new Set:null;for(const o of e){if(!this.statusById.has(o))continue;const a=this.statusById.get(o);this.statusById.set(o,i);const r=this.circleById.get(o);if(r&&(this.paintSeat(r,o),s=!0),n){const l=this.seatSection.get(o);l&&(a==="free"!=(i==="free")&&(l.free+=i==="free"?1:-1),n.add(l))}}if(n&&n.size){for(const o of n)this.refreshSectionFill(o);this.bgLayer.batchDraw()}s&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>Lt&&this.updateLabels())}setSeatCategories(e){let i=!1;const s=new Set;for(const[r,l]of Object.entries(e)){const c=this.seatById.get(r);if(!c||!this.catColor.has(l)||c.categoryKey===l)continue;c.categoryKey=l;const d=this.circleById.get(r);d&&(this.paintSeat(d,r),i=!0);const u=this.seatSection.get(r);u&&s.add(u)}if(!i)return;const n=new Map((this.chartDoc?Dt(this.chartDoc):[]).flatMap(r=>r.objects).filter(r=>r.type==="section").map(r=>[r.id,r]));for(const r of s){const l=n.get(r.id);if(!(l!=null&&l.color)){const c=new Map;for(const d of r.memberIds){var o,a;const u=(o=this.seatById.get(d))===null||o===void 0?void 0:o.categoryKey;u&&c.set(u,((a=c.get(u))!==null&&a!==void 0?a:0)+1)}r.baseFill=Ko([...c].map(([d,u])=>{var h;return{hex:(h=this.catColor.get(d))!==null&&h!==void 0?h:"#6e7bff",w:u}}),"#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()>Lt&&this.updateLabels()}setOwnedHold(e){const i=new Set((e!=null?e:[]).filter(n=>this.statusById.has(n))),s=new Set([...this.ownedHold,...i]);this.ownedHold=i;for(const n of s){const o=this.circleById.get(n);o&&this.paintSeat(o,n),this.syncSelectionMarker(n)}s.size&&(this.cached?(this.recacheTimer&&clearTimeout(this.recacheTimer),this.recacheTimer=setTimeout(()=>this.cacheSeatLayer(),150)):this.seatLayer.batchDraw(),this.effScale()>Lt&&this.updateLabels(),this.overlayLayer.batchDraw())}setSelectionFocus(e){const i=e&&this.selection.has(e)?e:null;if(i===this.selectionFocusId)return;const s=this.selectionFocusId;this.selectionFocusId=i;for(const n of this.seats){const o=this.circleById.get(n.id);o&&this.paintSeat(o,n.id)}s&&this.syncSelectionMarker(s),i&&this.syncSelectionMarker(i);for(const[n,o]of this.selectionMarkers)o.opacity(!i||n===i?1:.2);this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}getStatus(e){var i;return(i=this.statusById.get(e))!==null&&i!==void 0?i:"free"}getSelection(){const e=[];for(const i of this.selection){const s=this.seatById.get(i);s&&e.push(s)}return e}clearSelection(){const e=[...this.selection];for(const i of e)this.setSelected(i,!1,!0);this.overlayLayer.batchDraw()}setMaxSelection(e){this.opts.maxSelection=Math.max(0,Math.floor(e))}select(e){const i=[];for(const o of e){if(this.selection.has(o)||!this.isSelectable(o))continue;if(this.selection.size>=this.opts.maxSelection){var s,n;(s=(n=this.opts).onSelectionLimit)===null||s===void 0||s.call(n,this.opts.maxSelection);break}this.setSelected(o,!0,!0);const a=this.seatById.get(o);a&&i.push(a)}return i.length&&this.overlayLayer.batchDraw(),i}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);const i=[...this.selection].filter(s=>!this.isSelectable(s));i.length&&this.deselect(i),!e.manageMode&&this.selection.size&&this.clearSelection(),this.container.style.cursor="default",this.overlayLayer.batchDraw()}setSectionHeat(e){this.sectionHeat.clear();for(const[i,s]of Object.entries(e!=null?e:{}))Number.isFinite(s)&&this.sectionHeat.set(i,Math.max(0,Math.min(1,s)));for(const i of this.sections)this.refreshSectionHeat(i);this.bgLayer.batchDraw()}deselect(e){let i=!1;for(const s of e)this.selection.has(s)&&(this.setSelected(s,!1,!0),i=!0);i&&this.overlayLayer.batchDraw()}selectAllSelectable(){if(!this.opts.manageMode)return[];const e=[];for(const i of this.seats)this.isSelectable(i.id)&&e.push(i.id);return this.selectMany(e)}selectByLabels(e){if(!this.opts.manageMode)return[];const i=new Set(e),s=[];for(const n of this.seats)i.has(n.label)&&this.isSelectable(n.id)&&s.push(n.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){const i=[],s=new Set;for(const n of this.sections)if(!(n.id!==e&&n.logicalId!==e&&n.zone!==e))for(const o of n.memberIds){if(s.has(o)||(s.add(o),!this.isSelectable(o)))continue;const a=this.seatById.get(o);a&&i.push(a)}return i}selectMany(e){const i=e.filter(n=>!this.selection.has(n));if(!i.length)return this.getSelection();const s=this.selection.size+i.length<=bu;for(const n of i)if(s)this.setSelected(n,!0,!0);else{this.selection.add(n);const o=this.circleById.get(n);o&&this.paintSeat(o,n)}return this.cached||this.seatLayer.batchDraw(),this.overlayLayer.batchDraw(),this.getSelection()}beginMarquee(e){const i=this.screenToWorld(e),s=this.stage.scaleX()||1,n=new Ie({x:i.x,y:i.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(n),this.marquee={start:i,rect:n},this.marqueeCur=i,this.overlayLayer.batchDraw()}updateMarquee(e){if(!this.marquee)return;const i=this.screenToWorld(e),{start:s,rect:n}=this.marquee;n.setAttrs({x:Math.min(s.x,i.x),y:Math.min(s.y,i.y),width:Math.abs(i.x-s.x),height:Math.abs(i.y-s.y)}),this.marqueeCur=i,this.overlayLayer.batchDraw()}cancelMarquee(){this.marquee&&(this.marquee.rect.destroy(),this.marquee=null,this.marqueeCur=null,this.overlayLayer.batchDraw())}finishMarquee(){var e,i,s;const n=this.marquee;if(this.marquee=null,!n)return;n.rect.destroy(),this.overlayLayer.batchDraw();const o=(e=this.marqueeCur)!==null&&e!==void 0?e:n.start;this.marqueeCur=null;const a=Math.min(n.start.x,o.x),r=Math.max(n.start.x,o.x),l=Math.min(n.start.y,o.y),c=Math.max(n.start.y,o.y),d=this.stage.scaleX()||1;if((r-a)*d<4&&(c-l)*d<4){if(this.selection.size){var u,h;this.clearSelection(),(u=(h=this.opts).onMarquee)===null||u===void 0||u.call(h,[])}return}const p=[];for(const f of this.seats){const v=this.renderedSeatPoint(f);v.xr||v.yc||this.isSelectable(f.id)&&p.push(f.id)}this.selectMany(p),(i=(s=this.opts).onMarquee)===null||i===void 0||i.call(s,this.getSelection())}flashSeat(e,i="#f43f5e"){var s;const n=this.seatById.get(e);if(!n)return;const o=this.renderedSeatPoint(n),a=new Pe({x:o.x,y:o.y,radius:this.seatR,stroke:i,strokeWidth:3,opacity:.9,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1}),r=this.viewMode==="perspective"&&(s=this.perspectiveSeatScale.get(e))!==null&&s!==void 0?s:1;a.scale({x:r,y:r}),this.overlayLayer.add(a);const l=performance.now(),c=620,d=u=>{if(!a.getLayer())return;const h=Math.min(1,(u-l)/c);a.radius(this.seatR*(1+h*1.8)),a.opacity(.9*(1-h)),this.overlayLayer.batchDraw(),h<1?requestAnimationFrame(d):(a.destroy(),this.overlayLayer.batchDraw())};requestAnimationFrame(d)}flashSection(e,i="#22a06b"){const s=this.sections.filter(n=>n.id===e||n.zone===e);if(s.length)for(const n of s){const o=this.viewMode==="perspective"&&n.perspectiveAffine?n.outline.map(h=>this.perspectiveLocalPoint(this.projectedSectionPoint(n,h))):n.outline.map(h=>{const p=n.liftWorld>0?this.isoLiftLocal(n.liftWorld):{x:0,y:0};return{x:h.x+p.x,y:h.y+p.y}}),a=o.reduce((h,p)=>({x:h.x+p.x,y:h.y+p.y}),{x:0,y:0});a.x/=o.length,a.y/=o.length;const r=new Ee({x:a.x,y:a.y,points:o.flatMap(h=>[h.x-a.x,h.y-a.y]),closed:!0,stroke:i,strokeWidth:3,strokeScaleEnabled:!1,opacity:.92,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!0,shadowColor:i,shadowBlur:14,shadowOpacity:.7});this.overlayLayer.add(r),this.overlayLayer.batchDraw();const l=()=>{r.getLayer()&&(r.destroy(),this.overlayLayer.batchDraw())};if(this.reducedMotion||typeof document!="undefined"&&document.hidden){setTimeout(l,520);continue}const c=performance.now(),d=820,u=h=>{if(this.destroyed||!r.getLayer())return;const p=Math.min(1,(h-c)/d),f=1+(1-Math.pow(1-p,3))*.04;r.scale({x:f,y:f}),r.opacity(.92*(1-p)),this.overlayLayer.batchDraw(),p<1?requestAnimationFrame(u):l()};requestAnimationFrame(u)}}nearestSeat(e,i){var s;const n=this.seatById.get(e);if(!n)return null;const o=this.viewMode==="perspective"&&(s=this.perspectiveSeatProjected.get(n.id))!==null&&s!==void 0?s:n;let a=null,r=1/0;for(const c of this.seats){var l;if(c.id===e)continue;const d=this.viewMode==="perspective"&&(l=this.perspectiveSeatProjected.get(c.id))!==null&&l!==void 0?l:c,u=d.x-o.x,h=d.y-o.y,p=u*i.x+h*i.y;if(p<=.5)continue;const f=p+Math.abs(u*i.y-h*i.x)*2.5;fi-a||o.ys-a;if(this.stage.scaleX()s===e[n])}setCommercialLimitedFilter(e){if(this.commercialLimitedFilter!==e){this.commercialLimitedFilter=e;for(const i of this.seats){const s=this.circleById.get(i.id);s&&this.paintSeat(s,i.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setCategoryFilter(e){const i=e===null?null:new Set(e);if(!Vu(i,this.categoryFilter)){this.categoryFilter=i;for(const s of this.seats){const n=this.circleById.get(s.id);n&&this.paintSeat(n,s.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState()}}gaCategoryDimmed(e){return!!(this.categoryHighlight&&e!==this.categoryHighlight||this.categoryFilter&&!this.categoryFilter.has(e))}applyGAFilterState(){this.paintGAStateForView(),this.updateFreeTextVisibility(),this.bgLayer.batchDraw()}paintGAStateForView(){for(const e of this.gaById.values()){const i=!!(this.categoryFilter&&!this.categoryFilter.has(e.categoryKey)),s=!this.exportMode&&e.sectionId!=null&&this.effScale()<.49500000000000005;e.polygon.opacity(s?0:this.gaCategoryDimmed(e.categoryKey)?es*.08:es),e.polygon.listening(!this.exportMode&&!s&&!i)}}focusCategories(e){if(!(e!=null&&e.length)){this.focusRegion(this.bounds,{durationMs:650});return}const i=new Set(e),s=this.seats.filter(c=>{var d;return!i.has(c.categoryKey)||this.seatInClosedSection(c.id)?!1:((d=this.statusById.get(c.id))!==null&&d!==void 0?d:"free")==="free"||this.ownedHold.has(c.id)});if(!s.length)return;let n=1/0,o=-1/0,a=1/0,r=-1/0;for(const c of s){const d=this.renderedSeatPoint(c);n=Math.min(n,d.x),o=Math.max(o,d.x),a=Math.min(a,d.y),r=Math.max(r,d.y)}const l=Math.max(24,this.seatR*3);n-=l,o+=l,a-=l,r+=l,this.focusRegion({x:n,y:a,width:Math.max(40,o-n),height:Math.max(40,r-a)},{durationMs:650})}setViewMode(e){if(e==="perspective"){if(this.viewMode===e){this.afterViewChange();return}const r=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(r),this.zoomToFit();return}const i=e==="isometric"?1:0,s=this.viewMode==="perspective";if(this.viewMode=e,this.isoTarget=i,this.isoRaf&&(cancelAnimationFrame(this.isoRaf),this.isoRaf=0),s){this.isoT=i,this.applyIso(),this.afterViewChange();return}if(this.reducedMotion){this.isoT=i,this.applyIso(),this.afterViewChange();return}const n=this.isoT;if(n===i){this.applyIso(),this.afterViewChange();return}const o=performance.now(),a=r=>{if(this.destroyed)return;const l=Math.min(1,(r-o)/320),c=l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2;this.isoT=n+(this.isoTarget-n)*c,this.applyIso(),this.scheduleViewChange(),l<1?this.isoRaf=requestAnimationFrame(a):(this.isoT=this.isoTarget,this.isoRaf=0,this.applyIso(),this.afterViewChange())};this.isoRaf=requestAnimationFrame(a)}getViewMode(){return this.viewMode}get isoState(){return{isoT:this.isoT,centre:this.isoCentre}}isoParams(){return Ss(this.isoState)}effScale(){if(this.viewMode==="perspective"&&this.perspectiveBaseAffine){const e=Math.hypot(this.perspectiveBaseAffine.a,this.perspectiveBaseAffine.b),i=Math.hypot(this.perspectiveBaseAffine.c,this.perspectiveBaseAffine.d);return this.stage.scaleX()*Math.min(e,i)}return this.stage.scaleX()*(1-(1-Ln)*this.isoT)}isoForward(e){return bp(e,this.isoState)}isoInverse(e){return yp(e,this.isoState)}buildPerspectiveProjection(e){const i=Lp({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=i.camera,this.perspectiveBaseAffine=i.baseAffine,this.perspectiveBaseInverse=i.baseInverse,this.perspectiveBounds=i.bounds}setContainerAffine(e,i,s){wp(e,i,s)}resetContainerTransform(e){xp(e)}sectionSurfaceHeight(e,i){return Sp(e,i)}projectedSectionPoint(e,i){return Cp(e,i,this.perspectiveBaseAffine)}perspectiveLocalPoint(e){return Tp(e,this.perspectiveBaseInverse)}isoLiftLocal(e){return kp(e,this.isoState)}resetLayerTransforms(e=!0){const i=e?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(const s of i)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(const i of this.sections){this.resetContainerTransform(i.rootGroupBg),this.resetContainerTransform(i.liftGroupBg),e&&this.resetContainerTransform(i.liftGroupSeat),i.rootGroupBg.zIndex(i.bgZIndex),e&&i.liftGroupSeat.zIndex(i.seatZIndex);const s=this.labelLiftGroups.get(i.id);s&&e&&this.resetContainerTransform(s),i.perspectiveAffine=void 0,i.perspectiveCorrection=void 0,i.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,i){Ap(this.seatAnchorContext,e,i)}applyPerspective(e=!0){var i;const s=this.perspectiveCamera,n=this.perspectiveBaseAffine,o=this.perspectiveBaseInverse;if(!s||!n||!o)return;const a=this.seats.length>2500&&this.sections.length>0;this.cached&&!a&&(this.seatLayer.clearCache(),this.seatLayer.listening(!0),this.cached=!1),this.resetLayerTransforms(e),this.resetSectionProjection(e);for(const l of[this.bgLayer,this.overlayLayer])this.setContainerAffine(l,n,s.target);this.perspectiveAppliedSeats.clear(),a||this.applyExactSeatAnchors(!0);for(const l of this.sections){const c=h=>this.sectionSurfaceHeight(l,h),d=Ja(s,l.centroid,c),u=cu(o,d);l.perspectiveAffine=d,l.perspectiveCorrection=u,l.perspectiveDepth=Je(s,l.centroid,c(l.centroid)).depth,this.setContainerAffine(l.liftGroupBg,u,l.centroid);for(let h=0;h{var d,u;return((d=c.perspectiveDepth)!==null&&d!==void 0?d:0)-((u=l.perspectiveDepth)!==null&&u!==void 0?u:0)});for(const l of r)l.rootGroupBg.moveToTop(),l.liftGroupSeat.moveToTop();(i=this.unsectionedSeatGroup)===null||i===void 0||i.moveToTop(),this.syncSeatOverlayPositions(),a||this.updateSeatGroupVisibility(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}applyIso(){if(this.resetSectionProjection(),this.applyExactSeatAnchors(!1),this.isoT===0)this.resetLayerTransforms();else{const{th:e,sg:i}=this.isoParams(),s=Math.cos(e),n=i*Math.sin(e),o=-Math.sin(e),a=i*Math.cos(e),r=Math.sqrt(s*s+n*n),l=s*a-n*o,c=Math.atan2(n,s)*180/Math.PI,d=r,u=l/r,h=(s*o+n*a)/l,p=this.isoCentre;for(const f of[this.bgLayer,this.seatLayer,this.overlayLayer])f.position({x:p.x,y:p.y}),f.offset({x:p.x,y:p.y}),f.rotation(c),f.scaleX(d),f.scaleY(u),f.skewX(h),f.skewY(0)}this.applyUprightLabels(),this.applyElevation(),this.updateSeatGroupVisibility(),this.bgLayer.batchDraw(),this.seatLayer.batchDraw(),this.overlayLayer.batchDraw()}applyUprightLabels(){const e=rr*this.isoT,i=1/(1-(1-Ln)*this.isoT),s=this.hasBoothText?[this.bgLayer,this.seatLayer,this.overlayLayer]:[this.bgLayer,this.overlayLayer];for(const n of s){const o=n.find("Text");for(const a of o){let r=a.getAttr("uprightBase");r==null&&(r=a.rotation(),a.setAttr("uprightBase",r)),a.rotation(r-e),a.scaleX(1),a.scaleY(i),a.skewX(0)}}}applyElevation(){const e=this.isoT;for(const n of this.sections){var i,s;if(n.liftWorld<=0)continue;const o=this.isoLiftLocal(n.liftWorld);(i=n.liftGroupBg)===null||i===void 0||i.position(o),n.liftGroupSeat.position(o),(s=this.labelLiftGroups.get(n.id))===null||s===void 0||s.position(o);const a=.9*e;for(let r=0;r{const d=this.projectedSectionPoint(e,c);return{x:d.x*a+r,y:d.y*a+l}}))}const i=e.liftWorld>0?this.isoLiftLocal(e.liftWorld):{x:0,y:0},s=this.stage.scaleX(),n=this.stage.x(),o=this.stage.y();return Ge(e.outline.map(a=>{const r={x:a.x+i.x,y:a.y+i.y},l=this.isoT===0?r:this.isoForward(r);return{x:l.x*s+n,y:l.y*s+o}}))}updateSeatGroupVisibility(){const e=this.exportMode||this.effScale()>=.49500000000000005,i=this.viewMode==="perspective"&&this.glideInProgress&&this.seats.length>2500,s=96,n=this.stage.width(),o=this.stage.height();for(const a of this.sections){let r=!0;if(e){const c=this.sectionScreenBounds(a);r=c.x+c.width>=-96&&c.y+c.height>=-96&&c.x<=n+s&&c.y<=o+s,r&&this.viewMode==="perspective"&&!i&&this.applyExactSeatAnchors(!0,a.memberIds)}a.liftGroupSeat.setViewportCulled(!r);const l=this.labelLiftGroups.get(a.id);l==null||l.setViewportCulled(!r)}this.unsectionedSeatGroup&&!this.unsectionedSeatGroup.visible()&&this.unsectionedSeatGroup.visible(!0),e&&this.viewMode==="perspective"&&!i&&this.applyExactSeatAnchors(!0,this.seats.filter(a=>!this.seatSection.has(a.id)).map(a=>a.id))}visibleSeatCandidates(){if(!this.sections.length)return this.seats;const e=[];for(const i of this.sections)if(!i.liftGroupSeat.isViewportCulled())for(const s of i.memberIds){const n=this.seatById.get(s);n&&e.push(n)}for(const i of this.seats)this.seatSection.has(i.id)||e.push(i);return e}seatViewportCulled(e){var i,s;return(i=(s=this.seatSection.get(e))===null||s===void 0?void 0:s.liftGroupSeat.isViewportCulled())!==null&&i!==void 0?i:!1}renderedSeatPoint(e){var i;if(this.viewMode==="perspective")return(i=this.perspectiveSeatLocal.get(e.id))!==null&&i!==void 0?i:e;const s=this.seatSection.get(e.id);if(!s||s.liftWorld<=0||this.isoT===0)return e;const n=this.isoLiftLocal(s.liftWorld);return{x:e.x+n.x,y:e.y+n.y}}seatLabelContainer(e){const i=this.seatSection.get(e);if(!i)return this.labelGroup;let s=this.labelLiftGroups.get(i.id);return s||(s=new pr({listening:!1}),s.setViewportCulled(i.liftGroupSeat.isViewportCulled()),s.position(this.viewMode==="perspective"?{x:0,y:0}:this.isoLiftLocal(i.liftWorld)),this.labelGroup.add(s),this.labelLiftGroups.set(i.id,s)),s}syncSeatOverlayPositions(){if(this.hoveredId){const n=this.seatById.get(this.hoveredId);if(n){var e;this.hoverRing.position(this.renderedSeatPoint(n));const o=this.viewMode==="perspective"&&(e=this.perspectiveSeatScale.get(n.id))!==null&&e!==void 0?e:1;this.hoverRing.scale({x:o,y:o})}}if(this.focusedId){const n=this.seatById.get(this.focusedId);if(n){var i;this.focusRing.position(this.renderedSeatPoint(n));const o=this.viewMode==="perspective"&&(i=this.perspectiveSeatScale.get(n.id))!==null&&i!==void 0?i:1;this.focusRing.scale({x:o,y:o})}}for(const[n,o]of this.selectionMarkers){const a=this.seatById.get(n);if(a){var s;o.position(this.renderedSeatPoint(a));const r=this.viewMode==="perspective"&&(s=this.perspectiveSeatScale.get(a.id))!==null&&s!==void 0?s:1;o.scale({x:r,y:r})}}}renderSeats(){const e=[...this.seats].sort((s,n)=>{var o,a;return((o=this.perspectiveSeatDepth.get(n.id))!==null&&o!==void 0?o:0)-((a=this.perspectiveSeatDepth.get(s.id))!==null&&a!==void 0?a:0)});for(const s of e){if(s.kind==="booth"){this.renderBoothUnit(s);continue}const n=this.seatContainer(s.id),o=s.wheelchairSpaceType==="no-seat"?new Ie({x:s.x,y:s.y,width:this.seatR*2,height:this.seatR*2,offsetX:this.seatR,offsetY:this.seatR,cornerRadius:2,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}):new Pe({x:s.x,y:s.y,radius:this.seatR,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0});if(o.setAttr("seatId",s.id),this.circleById.set(s.id,o),this.paintSeat(o,s.id),n.add(o),s.accessible){var i;if(s.wheelchairSpaceType!=="no-seat"){const a=new Pe({x:s.x,y:s.y,radius:this.seatR+1.5,stroke:To(s.accessibility),strokeWidth:2.5,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1});this.accessRingById.set(s.id,a),n.add(a)}if(!((i=s.accessibility)===null||i===void 0)&&i.includes("wheelchair")&&Qo(s.accessibility)){const a=this.buildAccessGlyph(s,typeof o.fill()=="string"?o.fill():"");this.accessGlyphById.set(s.id,a),n.add(a)}}}}renderBoothUnit(e){var i,s,n;const o=this.seatContainer(e.id),a=(i=this.boothDims.get(e.rowId))!==null&&i!==void 0?i:{width:40,height:30,rotation:0};let r=e.x,l=e.y,c;a.points&&a.points.length>=3?(c=new Ee({x:e.x,y:e.y,points:a.points.flatMap(u=>[u.x,u.y]),closed:!0,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),r=e.x+a.points.reduce((u,h)=>u+h.x,0)/a.points.length,l=e.y+a.points.reduce((u,h)=>u+h.y,0)/a.points.length):c=new Ie({x:e.x,y:e.y,width:a.width,height:a.height,offsetX:a.width/2,offsetY:a.height/2,rotation:a.rotation,cornerRadius:4,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1,hitStrokeWidth:0}),c.setAttr("seatId",e.id),this.circleById.set(e.id,c),o.add(c);const d=new re({x:r,y:l,text:(s=e.displayLabel)!==null&&s!==void 0?s:e.label,fontSize:10,fontStyle:"600",fontFamily:this.labelFont(),fill:(n=this.theme.seatLabelColor)!==null&&n!==void 0?n:Mn,listening:!1,perfectDrawEnabled:!1});d.offsetX(d.width()/2),d.offsetY(d.height()/2),d.visible(!1),this.hasBoothText=!0,this.boothLabelById.set(e.id,d),o.add(d),this.paintSeat(c,e.id)}buildAccessGlyph(e,i){var s,n;const o=this.seatR*1.5/24;return new Ct({x:e.x,y:e.y,data:(s=Qo((n=e.accessibility)!==null&&n!==void 0?n:[]))!==null&&s!==void 0?s:"",offsetX:24/2,offsetY:24/2,scaleX:o,scaleY:o,fill:ea(i),listening:!1,visible:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1})}updateAccessGlyphs(e){if(this.accessGlyphById.size)for(const[s,n]of this.accessGlyphById){var i;const o=this.viewMode==="perspective"&&(i=this.perspectiveSeatScale.get(s))!==null&&i!==void 0?i:1,a=this.seatR*1.5/24*o,r=this.accessGlyphFilterEmphasized(s)?14:10,l=Math.max(a,r/(24*Math.max(e,.001)));n.scale({x:l,y:l}),n.visible(this.accessGlyphShouldShow(s))}}accessGlyphFilterEmphasized(e){var i;const s=this.seatById.get(e),n=this.accessFilter;return!!s&&n!==null&&!!(!((i=s.accessibility)===null||i===void 0)&&i.includes("wheelchair"))&&(n.length===0||n.includes("wheelchair"))&&gr(s,n)}accessGlyphShouldShow(e){return this.accessGlyphById.has(e)&&this.accessGlyphEligible(e)}accessGlyphEligible(e){var i;const s=(i=this.statusById.get(e))!==null&&i!==void 0?i:"free";return!(s==="booked"||s==="held"&&!this.ownedHold.has(e)&&!this.opts.manageMode)}categoryDisplayColor(e){var i,s;return this.colorblind?(s=this.cbHueByKey.get(e))!==null&&s!==void 0?s:En[0]:(i=this.catColor.get(e))!==null&&i!==void 0?i:"#6e7bff"}seatLabelScale(e){var i,s;return((i=(s=e.labelStyle)===null||s===void 0?void 0:s.size)!==null&&i!==void 0?i:18)/18}seatPreferredLabelInk(e){var i,s,n;return(i=(s=(n=e.labelStyle)===null||n===void 0?void 0:n.color)!==null&&s!==void 0?s:this.theme.seatLabelColor)!==null&&i!==void 0?i:Mn}seatLabelInk(e,i){const s=i.fill();return dt(typeof s=="string"?s:"",this.seatPreferredLabelInk(e),3)}paintSeat(e,i){var s,n,o,a,r;const l=this.seatById.get(i),c=(s=this.statusById.get(i))!==null&&s!==void 0?s:"free",d=this.selection.has(i),u=this.categoryDisplayColor(l.categoryKey),h=this.boothLabelById.get(i);switch(e.dash([]),e.strokeWidth(0),e.stroke(""),e.opacity(1),c){case"free":e.fill(d&&this.effSelection==="#ffffff"?Nt(u,.28):u);break;case"held":this.ownedHold.has(i)?(e.fill(Nt(u,this.effSelection==="#ffffff"?.24:.1)),e.stroke(this.effSelection),e.strokeWidth(3)):e.fill(Mu);break;case"booked":this.colorblind?(e.fill("rgba(0,0,0,0)"),e.stroke(An),e.strokeWidth(1.5),e.opacity(.9)):(e.fill(An),e.opacity(.45));break;case"not_for_sale":e.fill(An),e.stroke(_u),e.strokeWidth(1),e.dash([2,2]);break}if(l.wheelchairSpaceType==="no-seat"&&c==="free"&&(e.stroke(To(l.accessibility)),e.strokeWidth(d?3:2),e.dash([3,2])),h){var p,f,v;h.text(c==="booked"?"SOLD":c==="held"?"HELD":l.label),h.fontSize(c==="free"?10:Math.min(10,Math.max(6,(p=(f=this.boothDims.get(l.rowId))===null||f===void 0?void 0:f.width)!==null&&p!==void 0?p:40)/6)),h.fontStyle(c==="free"?"600":"800"),h.fill(c==="free"?(v=this.theme.seatLabelColor)!==null&&v!==void 0?v:Mn:"#ffffff"),h.offsetX(h.width()/2),h.offsetY(h.height()/2)}if(this.accessFilter&&c==="free"&&!d&&!gr(l,this.accessFilter)&&e.opacity(.25),this.categoryHighlight&&c==="free"&&!d&&l.categoryKey!==this.categoryHighlight&&e.opacity(.25),this.categoryFilter&&c==="free"&&!d&&!this.categoryFilter.has(l.categoryKey)&&e.opacity(.22),this.commercialLimitedFilter&&c==="free"&&!d&&(!((n=l.commercial)===null||n===void 0)&&n.restrictedView||!((o=l.commercial)===null||o===void 0)&&o.obstructedView)&&e.opacity(.22),this.dimmedSections.size){const b=this.seatSection.get(i);(!b&&this.dimmedSections.has("__ungrouped__")||b&&(this.dimmedSections.has(b.id)||this.dimmedSections.has(b.logicalId)||b.zone!=null&&this.dimmedSections.has(b.zone)))&&e.opacity(.18)}this.closedSections.size&&this.seatInClosedSection(i)&&(e.fill(Pu),e.stroke(""),e.strokeWidth(0),e.dash([]),e.opacity(Ru)),this.selectionFocusId&&i!==this.selectionFocusId&&e.opacity(Math.min(e.opacity(),.16));const m=(a=this.boothLabelById.get(i))!==null&&a!==void 0?a:this.seatLabelById.get(i);m&&(m.fill(this.seatLabelInk(l,e)),m.visible(Gt(m.fontSize(),this.effScale())&&e.opacity()>=.5));const g=this.accessGlyphById.get(i);if(g){const b=e.fill();g.fill(ea(typeof b=="string"?b:"")),g.opacity(e.opacity()),g.visible(this.accessGlyphShouldShow(i))}(r=this.accessRingById.get(i))===null||r===void 0||r.opacity(e.opacity())}seatInClosedSection(e){if(!this.closedSections.size)return!1;const i=this.seatSection.get(e);return!!i&&(this.closedSections.has(i.id)||this.closedSections.has(i.logicalId)||i.zone!=null&&this.closedSections.has(i.zone))}setColorblindSafe(e){if(e!==this.colorblind){this.colorblind=e;for(const i of this.seats){const s=this.circleById.get(i.id);s&&this.paintSeat(s,i.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setDimmedSections(e){const i=new Set(e!=null?e:[]);if(!(i.size===this.dimmedSections.size&&[...i].every(s=>this.dimmedSections.has(s)))){this.dimmedSections=i;for(const s of this.seats){const n=this.circleById.get(s.id);n&&this.paintSeat(n,s.id)}this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw()}}setClosedSections(e){const i=new Set(e!=null?e:[]);i.size===this.closedSections.size&&[...i].every(s=>this.closedSections.has(s))||(this.closedSections=i,this.repaintSectionsAndSeats())}focusSection(e){this.sections.some(i=>i.id===e||i.logicalId===e)&&(this.focusedSectionId=e,this.drawFocusBackdrop(e),this.bgLayer.batchDraw(),this.overlayLayer.batchDraw(),this.updateLOD(),this.focusRegion(e))}releaseSectionFocusDim(){var e,i;!this.focusBackdrop&&!this.focusDimOverlay||((e=this.focusBackdrop)===null||e===void 0||e.destroy(),this.focusBackdrop=null,(i=this.focusDimOverlay)===null||i===void 0||i.destroy(),this.focusDimOverlay=null,this.bgLayer.batchDraw(),this.overlayLayer.batchDraw())}clearSectionFocus(){var e;this.focusedSectionId&&(this.focusedSectionId=null,this.focusBackdrop&&(this.focusBackdrop.destroy(),this.focusBackdrop=null),(e=this.focusDimOverlay)===null||e===void 0||e.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);const i=this.sections.filter(n=>n.id===e||n.logicalId===e);if(!i.length)return;const s=new Ne({listening:!1});for(const n of i){const o=this.viewMode==="perspective"&&n.perspectiveAffine,a=o?n.outline.map(l=>this.perspectiveLocalPoint(this.projectedSectionPoint(n,l))):n.outline,r=o?n.holes.map(l=>l.map(c=>this.perspectiveLocalPoint(this.projectedSectionPoint(n,c)))):n.holes;s.add(xs(a,r,{fill:$u,stroke:kt("#ffffff",.1),strokeWidth:1,listening:!1},o?void 0:n.outlinePath))}this.bgLayer.add(s),s.moveToTop(),this.focusBackdrop=s,this.drawFocusDimOverlay(i)}drawFocusDimOverlay(e){var i;(i=this.focusDimOverlay)===null||i===void 0||i.destroy();const s=Math.max(this.bounds.width,this.bounds.height,1)*4+1e3,n=[{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}],o=new q({fill:this.canvasBackground,opacity:1-ws,listening:!1,perfectDrawEnabled:!1,sceneFunc:(a,r)=>{const l=c=>{if(c.length){a.moveTo(c[0].x,c[0].y);for(let d=1;dthis.perspectiveLocalPoint(this.projectedSectionPoint(c,u))):c.outline.map(u=>{const h=c.liftWorld>0?this.isoLiftLocal(c.liftWorld):{x:0,y:0};return{x:u.x+h.x,y:u.y+h.y}});l(Cn(d)>0?[...d].reverse():d)}a.fillStrokeShape(r)}});this.overlayLayer.add(o),o.moveToTop();for(const a of this.selectionMarkers.values())a.moveToTop();this.hoverRing.moveToTop(),this.focusRing.moveToTop(),this.focusDimOverlay=o}repaintSectionsAndSeats(){for(const e of this.seats){const i=this.circleById.get(e.id);i&&this.paintSeat(i,e.id)}for(const e of this.sections)e.blockPoly.fill(this.sectionBlockFill(e));this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.bgLayer.batchDraw()}getVisibleWorldRect(){const e=this.screenToWorld({x:0,y:0}),i=this.screenToWorld({x:this.stage.width(),y:this.stage.height()});return{x:Math.min(e.x,i.x),y:Math.min(e.y,i.y),width:Math.abs(i.x-e.x),height:Math.abs(i.y-e.y)}}getWorldBounds(){let e=1/0,i=1/0,s=-1/0,n=-1/0;const o=(a,r)=>{as&&(s=a),r>n&&(n=r)};for(const a of this.seats)o(a.x,a.y);for(const a of this.sections)for(const r of a.outline)o(r.x,r.y);for(const a of this.gaById.values())for(const r of a.points)o(r.x,r.y);return Number.isFinite(e)?{x:e,y:i,width:Math.max(1,s-e),height:Math.max(1,n-i)}:{x:0,y:0,width:1,height:1}}getMinimapSnapshot(){const e=this.sections.map(i=>{const s=this.isSectionClosed(i)||i.free<=0,n=i.memberIds.some(a=>this.selection.has(a)),o=this.focusedSectionId===i.id||this.focusedSectionId===i.logicalId;return{id:i.logicalId,label:i.label,outline:i.outline.map(a=>({...a})),...this.objectFloor.get(i.id)?{floorId:this.objectFloor.get(i.id)}:{},state:n?"selected":s?"inactive":"available",active:o}});return{sections:e,seats:e.length?[]:this.seats.map(i=>({x:i.x,y:i.y,categoryKey:i.categoryKey,state:this.selection.has(i.id)?"selected":this.statusById.get(i.id)==="free"?"available":"inactive"}))}}panToWorld(e){this.cancelGlide();const i=this.worldToScreen(e);this.stage.position({x:this.stage.x()+this.stage.width()/2-i.x,y:this.stage.y()+this.stage.height()/2-i.y}),this.afterViewChange(),this.stage.batchDraw()}setCategoryHighlight(e){if(this.categoryHighlight!==e){this.categoryHighlight=e;for(const i of this.seats){const s=this.circleById.get(i.id);s&&this.paintSeat(s,i.id)}this.updateLabels(),this.cached?(this.seatLayer.clearCache(),this.cacheSeatLayer()):this.seatLayer.batchDraw(),this.applyGAFilterState()}}renderBackground(e){const i=Ei(e);i&&this.renderBackgroundImage(i);for(const s of e.objects)s.type==="decorImage"&&this.renderDecorImage(s);for(const s of e.objects)s.type==="section"&&this.renderSection(s);this.renderZones(e);for(const 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)}trackAssetImage(e,i,s,n){const o=this.assetGeneration;/^https?:\/\//i.test(i)&&(e.crossOrigin="anonymous");const a=new Promise(r=>{let l=!1;const c=()=>{l||(l=!0,this.assetCancels.delete(d),r())},d=()=>{e.onload=null,e.onerror=null;try{e.removeAttribute("src"),e.src=""}catch{}c()};this.assetCancels.add(d),e.onload=()=>{if(!this.exportMode){o===this.assetGeneration&&n(),c();return}(typeof e.decode=="function"?e.decode():Promise.resolve()).then(()=>{o===this.assetGeneration&&n()}).catch(()=>{o===this.assetGeneration&&this.assetErrors.push(`${s} could not be decoded.`)}).finally(c)},e.onerror=()=>{o===this.assetGeneration&&this.assetErrors.push(`${s} could not be loaded.`),c()},e.src=i});this.assetPromises.push(a)}cancelAssetLoads(){this.assetGeneration++;for(const e of[...this.assetCancels])e();this.assetCancels.clear(),this.assetPromises=[],this.assetErrors=[]}renderBackgroundImage(e){if(!e.url||e.visible===!1)return;const i=new window.Image;this.trackAssetImage(i,e.url,"Buyer background image",()=>{var s,n;const o=i.naturalWidth||4,a=i.naturalHeight||3,r=(s=e.crop)!==null&&s!==void 0?s:{x:0,y:0,width:1,height:1},l=Math.max(0,Math.min(.99,r.x)),c=Math.max(0,Math.min(.99,r.y)),d={x:l,y:c,width:Math.max(.01,Math.min(1-l,r.width)),height:Math.max(.01,Math.min(1-c,r.height))},u=e.width,h=u*(a*d.height/(o*d.width)),p=new Ve({image:i,x:e.center.x,y:e.center.y,offsetX:u/2,offsetY:h/2,width:u,height:h,rotation:(n=e.rotation)!==null&&n!==void 0?n:0,crop:{x:d.x*o,y:d.y*a,width:d.width*o,height:d.height*a},opacity:e.opacity,listening:!1});this.bgLayer.add(p),p.moveToBottom(),this.bgLayer.batchDraw()})}get objectDrawContext(){return{bgLayer:this.bgLayer,fgDecorGroup:this.fgDecorGroup,container:this.container,opts:this.opts,theme:this.theme,canvasBackground:this.canvasBackground,catColor:this.catColor,sections:this.sections,freeTextById:this.freeTextById,gaById:this.gaById,iconNodeById:this.iconNodeById,primaryFocalLabels:this.primaryFocalLabels,labelFont:()=>this.labelFont(),trackAssetImage:(e,i,s,n)=>this.trackAssetImage(e,i,s,n),isGhostClick:e=>this.isGhostClick(e)}}renderDecorImage(e){ip(this.objectDrawContext,e)}renderTable(e){sp(this.objectDrawContext,e)}renderText(e){np(this.objectDrawContext,e)}renderShape(e){op(this.objectDrawContext,e)}renderGA(e){rp(this.objectDrawContext,e)}renderSection(e){var i,s,n,o,a,r,l,c,d,u,h,p,f,v,m,g,b,y,k,w,C,S,T;const E=Qs(e.outline,e.holes),L=Jt(this.canvasBackground),I=[],M=new Map;let x=0;const A=Ge(e.outline),P=this.seatIndex?Qa(this.seatIndex,A).map(ue=>this.seatById.get(ue)).filter(ue=>!!ue):this.seats;for(const ue of P){var N,W;this.seatSection.has(ue.id)||Ke(ue,e.outline,e.holes)&&(I.push(ue.id),M.set(ue.categoryKey,((N=M.get(ue.categoryKey))!==null&&N!==void 0?N:0)+1),((W=this.statusById.get(ue.id))!==null&&W!==void 0?W:"free")==="free"&&x++)}const B=(i=e.color)!==null&&i!==void 0?i:Ko([...M].map(([ue,ot])=>{var at;return{hex:(at=this.catColor.get(ue))!==null&&at!==void 0?at:"#6e7bff",w:ot}}),"#3a4358"),z=Bc(e.elevation),j=Us(e,{floorBaseHeightM:this.floorBaseHeightMFor(e.id)}),G=j.height*Ki,D=new Ne({listening:!1});this.bgLayer.add(D);const F=new Ne({listening:!1});D.add(F);const _=new pr({listening:!0});this.seatLayer.add(_);const U=[];if(G>0){var Y,ie;const ue=Vt((Y=this.zoneColor.get((ie=e.zone)!==null&&ie!==void 0?ie:""))!==null&&Y!==void 0?Y:B,.42);for(let ot=0;ot{var ot;return(ot=this.seatById.get(ue))===null||ot===void 0?void 0:ot.categoryKey}).filter(Boolean)),labelArea:Sc(e.outline,e.holes),zone:e.zone,memberIds:I,total:I.length,free:x,baseFill:B,outlineTint:ne,outlinePoly:ve,blockPoly:Le,nameLabel:oe,subLabel:ge,preferredInk:Ze,labelScale:nt,nameLabelFits:!1,subLabelFits:!0,elevation:z,liftWorld:G,rakeDeg:j.rake,surfaceFocal:I.length?{...(w=(C=this.seatById.get(I[0]))===null||C===void 0?void 0:C.focalPoint)!==null&&w!==void 0?w:this.isoCentre}:{...(S=(T=this.chartDoc)===null||T===void 0?void 0:T.focalPoint)!==null&&S!==void 0?S:this.isoCentre},frontDistanceWorld:0,rootGroupBg:D,bgZIndex:D.zIndex(),seatZIndex:_.zIndex(),liftGroupBg:F,liftGroupSeat:_,sideFaces:U},ke=I.map(ue=>this.seatById.get(ue)).filter(ue=>!!ue),We=ke.length?ke:e.outline;Se.frontDistanceWorld=Math.min(...We.map(ue=>Math.hypot(ue.x-Se.surfaceFocal.x,ue.y-Se.surfaceFocal.y)));for(const ue of I)this.seatSection.set(ue,Se);this.refreshSectionFill(Se),this.refreshSectionHeat(Se),this.sections.push(Se)}refreshSectionHeat(e){dp(this.sectionLodPaintContext,e)}refreshSectionFill(e){hp(this.sectionLodPaintContext,e)}isSectionClosed(e){return wr(this.sectionLodPaintContext,e)}sectionAvailabilityState(e){return xr(this.sectionLodPaintContext,e)}sectionBlockFill(e){return In(Jt(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){var i;if(!(!((i=e.zones)===null||i===void 0)&&i.length)||!this.sections.length)return;const s=new Map;for(const a of this.sections){var n;a.zone&&((n=s.get(a.zone))!==null&&n!==void 0?n:s.set(a.zone,[]).get(a.zone)).push(a)}for(const a of e.zones){var o;const r=s.get(a.id);if(!r||!r.length)continue;let l=r[0];for(const v of r)v.centroid.y{if(this.viewMode==="perspective"&&n.perspectiveAffine)return Ke(i,n.outline.map(a=>this.perspectiveLocalPoint(this.projectedSectionPoint(n,a))),n.holes.map(a=>a.map(r=>this.perspectiveLocalPoint(this.projectedSectionPoint(n,r)))));const o=n.liftWorld>0?this.isoLiftLocal(n.liftWorld):{x:0,y:0};return Ke({x:i.x-o.x,y:i.y-o.y},n.outline,n.holes)});return s?s.logicalId:null}sectionMembers(e){return[...new Set(this.sections.filter(i=>i.id===e||i.logicalId===e||i.zone===e).flatMap(i=>i.memberIds))]}isSelectable(e){var i,s;return this.seatInClosedSection(e)?!1:((i=this.opts.selectableStatuses)!==null&&i!==void 0?i:["free"]).includes((s=this.statusById.get(e))!==null&&s!==void 0?s:"free")}toggleSeat(e){if(this.selection.has(e)){var i,s;this.setSelected(e,!1);const l=this.seatById.get(e);l&&((i=(s=this.opts).onDeselect)===null||i===void 0||i.call(s,l))}else{var n,o;if(!this.isSelectable(e))return;if(this.selection.size>=this.opts.maxSelection){var a,r;(a=(r=this.opts).onSelectionLimit)===null||a===void 0||a.call(r,this.opts.maxSelection);return}this.setSelected(e,!0);const l=this.seatById.get(e);l&&((n=(o=this.opts).onSelect)===null||n===void 0||n.call(o,l))}this.overlayLayer.batchDraw()}resolveCanvasBackground(){const e=this.theme.background?Uo(this.theme.background):null;if(e)return e;if(typeof getComputedStyle=="function"){let i=this.container;for(;i;){const s=Uo(getComputedStyle(i).backgroundColor);if(s)return s;i=i.parentElement}}return yr}resolveSelectionColor(){return this.theme.selectionColor?this.theme.selectionColor:sn(this.canvasBackground)?Qu:br}setSelected(e,i,s=!1){const n=this.circleById.get(e);i?this.selection.add(e):(this.selectionFocusId===e&&this.setSelectionFocus(null),this.selection.delete(e)),this.syncSelectionMarker(e),n&&(this.paintSeat(n,e),!s&&!this.cached&&this.seatLayer.batchDraw())}syncSelectionMarker(e){var i,s;if((i=this.selectionMarkers.get(e))===null||i===void 0||i.destroy(),this.selectionMarkers.delete(e),!this.selection.has(e)&&!this.ownedHold.has(e))return;const n=this.seatById.get(e);if(!n)return;const o=this.selectionFocusId===e,a=this.boothDims.get(n.rowId),r=this.renderedSeatPoint(n),l=new Ne({name:"selection-ring",x:r.x,y:r.y,rotation:(s=a==null?void 0:a.rotation)!==null&&s!==void 0?s:0,listening:!1,perfectDrawEnabled:!1,opacity:this.selectionFocusId&&!o?.2:1});if(this.viewMode==="perspective"){var c;const u=(c=this.perspectiveSeatScale.get(e))!==null&&c!==void 0?c:1;l.scale({x:u,y:u})}l.setAttr("seatId",e);const d={stroke:this.effSelection,listening:!1,perfectDrawEnabled:!1,shadowForStrokeEnabled:!1};if(a)if(l.add(new Ie({...d,width:a.width,height:a.height,offsetX:a.width/2,offsetY:a.height/2,cornerRadius:4,strokeWidth:o?4:3})),o)l.add(new Ie({...d,width:a.width+10,height:a.height+10,offsetX:(a.width+10)/2,offsetY:(a.height+10)/2,cornerRadius:7,strokeWidth:2,opacity:.55}));else{const u=Math.max(0,a.width/2-14),h=-Math.max(0,a.height/2-14);l.add(new Pe({x:u,y:h,radius:10,fill:this.effSelection,listening:!1})),l.add(new Ee({x:u,y:h,points:[-4.5,0,-1,3.5,5.5,-4.5],stroke:sn(this.effSelection)?"#0b1220":"#ffffff",strokeWidth:2.4,lineCap:"round",lineJoin:"round",listening:!1}))}else l.add(new Pe({...d,radius:Math.max(1,this.seatR-1.25),strokeWidth:Math.min(2.5,Math.max(1.8,this.seatR*.22))})),o?l.add(new Pe({...d,radius:this.seatR+2,strokeWidth:2,opacity:.55})):l.add(new Ee({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){const i=this.sections.filter(v=>v.id===e||v.logicalId===e),s=i.map(v=>{if(this.viewMode==="perspective"&&v.perspectiveAffine)return Ge(v.outline.map(g=>this.projectedSectionPoint(v,g)));const m=v.liftWorld>0?this.isoLiftLocal(v.liftWorld):{x:0,y:0};return Ge(v.outline.map(g=>{const b={x:g.x+m.x,y:g.y+m.y};return this.isoT===0?b:this.isoForward(b)}))});if(!s.length)return null;let n=Math.min(...s.map(v=>v.x)),o=Math.min(...s.map(v=>v.y)),a=Math.max(...s.map(v=>v.x+v.width)),r=Math.max(...s.map(v=>v.y+v.height));const l=new Set(i.flatMap(v=>v.memberIds));for(const v of l){const m=this.seatById.get(v);if(!m)continue;const g=this.renderedSeatPoint(m);n=Math.min(n,g.x-this.seatR),o=Math.min(o,g.y-this.seatR),a=Math.max(a,g.x+this.seatR),r=Math.max(r,g.y+this.seatR)}const c=v=>{[v.x,v.y,v.width,v.height].every(Number.isFinite)&&(n=Math.min(n,v.x),o=Math.min(o,v.y),a=Math.max(a,v.x+v.width),r=Math.max(r,v.y+v.height))},d=v=>{const m={x:v.x+v.width/2,y:v.y+v.height/2};return i.some(g=>Ke(m,g.outline,g.holes))};for(const{node:v,backdrop:m}of this.freeTextById.values()){const g=v.getClientRect({relativeTo:this.bgLayer,skipShadow:!0});d(g)&&(c(g),m&&c(m.getClientRect({relativeTo:this.bgLayer,skipShadow:!0})))}for(const{node:v}of this.iconNodeById.values()){const m=v.getClientRect({relativeTo:this.bgLayer,skipShadow:!0});d(m)&&c(m)}const u=new dr;for(const{node:v}of this.freeTextById.values()){const m=v.getClientRect({relativeTo:this.bgLayer,skipShadow:!0,skipStroke:!0});u.insert({x:m.x-2,y:m.y-2,width:m.width+4,height:m.height+4})}for(const v of this.rowLabelPlan){var h;const m=((h=v.focusKeys)!==null&&h!==void 0?h:[]).some(k=>k===e||i.some(w=>k===w.id||k===w.logicalId)),g=new re({text:v.text,fontSize:v.fontSize,fontStyle:"700",fontFamily:this.labelFont(),rotation:v.rotation,listening:!1});g.offsetX(g.width()/2),g.offsetY(g.height()/2);const b=this.resolveAutomaticRowLabelPosition(g,v,u),y=this.rowLabelBox(g,b);m&&c(y),u.insert(y),g.destroy()}const p=Math.max(a-n,r-o),f=Math.max(this.seatR*2,Math.min(24,p*.025));return{x:n-f,y:o-f,width:Math.max(1,a-n+f*2),height:Math.max(1,r-o+f*2)}}sectionFrameScale(e){const i=this.sectionBounds(e);if(!i)return this.stage.scaleX();const s=this.stage.width(),n=this.stage.height(),{min:o,max:a}=this.zoomBounds(),r=1.12;return i.width<=0||i.height<=0?this.stage.scaleX():_e(Math.min(s/(i.width*r),n/(i.height*r)),o,a)}handleSeatTap(e){if((this.stacked||this.floorOverview)&&this.opts.onDeckTap){var i,s;const n=this.objectFloor.get((i=(s=this.seatById.get(e))===null||s===void 0?void 0:s.rowId)!==null&&i!==void 0?i:"");if(n){this.opts.onDeckTap(n);return}}if(this.effScale()this.stage.scaleX()*1.02;if(!o&&a){this.opts.onSectionTap?this.opts.onSectionTap(n.logicalId):this.focusSection(n.logicalId);return}}}this.toggleSeat(e)}nearestSeatToScreen(e,i){let s=null,n=1/0;const o=this.stage.scaleX()||1;for(const r of this.seats){var a;if(!this.selection.has(r.id)&&!this.isSelectable(r.id))continue;const l=this.worldToScreen(r),c=this.viewMode==="perspective"&&(a=this.perspectiveSeatScale.get(r.id))!==null&&a!==void 0?a:1,d=this.seatR*o*c+i,u=Math.hypot(l.x-e.x,l.y-e.y);u<=d&&u{if(this.moved>8||this.isGhostClick(e))return;const i=_n(e.target);i&&this.handleSeatTap(i)}),this.seatLayer.on("mouseover",e=>{var i,s,n;const o=_n(e.target);if(!o)return;const a=this.seatById.get(o);if(!a)return;this.hoveredId=o,this.hoverRing.position(this.renderedSeatPoint(a));const r=this.viewMode==="perspective"&&(i=this.perspectiveSeatScale.get(o))!==null&&i!==void 0?i:1;this.hoverRing.scale({x:r,y:r}),this.hoverRing.visible(!0),this.overlayLayer.batchDraw(),this.container.style.cursor="pointer",(s=(n=this.opts).onHover)===null||s===void 0||s.call(n,a)}),this.seatLayer.on("mouseout",()=>{var e,i;this.hoveredId=null,this.hoverRing.visible(!1),this.overlayLayer.batchDraw(),this.container.style.cursor="default",(e=(i=this.opts).onHover)===null||e===void 0||e.call(i,null)}),this.stage.on("wheel",e=>{e.evt.preventDefault(),this.releaseSectionFocusDim();const i=this.container.getBoundingClientRect(),s={x:e.evt.clientX-i.left,y:e.evt.clientY-i.top},n=Math.exp(-e.evt.deltaY*.002);this.zoomAbout(this.stage.scaleX()*_e(n,.5,2),s)}),this.stage.on("click tap",e=>{if(this.moved>8||this.isGhostClick(e))return;const i=this.stage.getPointerPosition();if(!i)return;if(!this.cached){if(_n(e.target))return;const o=this.nearestSeatToScreen(i,14);o&&this.handleSeatTap(o);return}if((this.stacked||this.floorOverview)&&this.opts.onDeckTap){var s;const o=this.floorOverview?this.sectionAt(i):null,a=(s=o?this.objectFloor.get(o):null)!==null&&s!==void 0?s:this.deckFloorAt();if(a){this.opts.onDeckTap(a);return}}if(this.sections.length){const o=this.sectionAt(i);if(o){this.opts.onSectionTap?this.opts.onSectionTap(o):this.focusRegion(o);return}}const n=Math.max(Qt*1.2,this.stage.scaleX()*2.5);this.zoomAbout(n,i)})}deckFloorAt(){var e;if(!this.objectFloor.size)return null;const i=this.stage.getPointerPosition();if(!i)return null;const s=this.screenToWorld(i);let n=null,o=1/0;for(const a of this.seats){const r=this.renderedSeatPoint(a),l=r.x-s.x,c=r.y-s.y,d=l*l+c*c;d{if(this.destroyed){this.glideRaf=0,this.glideInProgress=!1;return}const C=Math.min(1,(w-b)/y),S=C<.5?4*C*C*C:1-Math.pow(-2*C+2,3)/2,T=v+(h-v)*S;this.stage.scale({x:T,y:T}),this.stage.position({x:m+(p-m)*S,y:g+(f-g)*S}),this.updateSeatGroupVisibility(),this.updateLOD(),this.scheduleViewChange(),this.stage.batchDraw(),C<1?this.glideRaf=requestAnimationFrame(k):(this.glideRaf=0,this.glideInProgress=!1,this.afterViewChange())};this.glideRaf=requestAnimationFrame(k)}cancelGlide(){this.glideRaf&&(cancelAnimationFrame(this.glideRaf),this.glideRaf=0),this.glideInProgress=!1}getRung(){const e=this.effScale();return e>=.49500000000000005?"seats":this.zones.length&&e<.22275000000000003?"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,i)=>this.focusedSeatOpacity(e,i),accessGlyphFilterEmphasized:e=>this.accessGlyphFilterEmphasized(e),seatLabelScale:e=>this.seatLabelScale(e),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e)}}getRenderedQualityEvidence(){return qu(this.renderedQualityContext)}setRung(e){if(e==="zones"){this.cancelGlide(),this.zoomToFit();return}const i=e==="sections"?(Ii+or)/2:Math.max(this.seatLabelTargetScale()*1.05,mu,or*1.3),s=this.stage.width(),n=this.stage.height(),o=this.getVisibleWorldRect(),a={x:o.x+o.width/2,y:o.y+o.height/2};let r=a.x,l=a.y;if(e==="sections"&&this.sections.length>0){const h=this.sections.map(v=>{const m=Ge(v.outline);return{x:m.x+m.width/2,y:m.y+m.height/2}}),p=s/(i*2),f=n/(i*2);if(!h.some(v=>Math.abs(v.x-a.x)<=p&&Math.abs(v.y-a.y)<=f)){const v=h.reduce((m,g)=>{const b=(g.x-a.x)**2+(g.y-a.y)**2;return bh.kind!=="booth"):[];if(c.length>0){let h=c[0],p=1/0;for(const f of c){const v=f.x-a.x,m=f.y-a.y,g=v*v+m*m;gs?Math.max(4,a*s/i.width()):a;e=Math.min(e,r)}return i.destroy(),12/Math.max(4,e)}afterViewChange(){this.updateSeatGroupVisibility(),this.updateLOD(),this.updateFreeTextVisibility(),this.updateLabels(),this.scheduleViewChange()}scheduleViewChange(){this.exportMode||this.viewChangeRaf||(this.viewChangeRaf=requestAnimationFrame(()=>{var e,i;this.viewChangeRaf=0,(e=(i=this.opts).onViewChange)===null||e===void 0||e.call(i)}))}sizeLabel(e,i,s){e.fontSize(Math.max(1,i)),e.offsetX(e.width()/2),e.offsetY(e.height()/2),e.y(s)}updateLOD(){const e=this.exportMode?Math.max(this.effScale(),ks+.01,Lt):this.effScale(),i=Math.max(e,1e-4);for(const[n,o]of this.primaryFocalLabels)this.sizeLabel(n,o/i,n.y());this.hasSections?up(this.sectionLodPaintContext,e):this.primaryFocalLabels.size&&this.bgLayer.batchDraw(),this.paintGAStateForView(),this.updateAccessGlyphs(e);const s=!this.exportMode&&e<.49500000000000005;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();const e=_e(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(){const e=this.seatLayer,i=e._cache.get("canvas");i&&(fs.Util.releaseCanvas(i.scene._canvas,i.filter._canvas,i.hit._canvas),e._cache.delete("canvas"))}forceDraw(){this.recacheTimer&&(clearTimeout(this.recacheTimer),this.recacheTimer=null,this.effScale()<.49500000000000005?this.rebuildSeatCache():this.cached&&(this.releaseSeatLayerBitmap(),this.seatLayer.listening(!0),this.cached=!1)),this.bgLayer.draw(),this.seatLayer.draw(),this.overlayLayer.draw()}async ready(){const e=this.assetGeneration,i=typeof document!="undefined"&&"fonts"in document?document.fonts:null;if(await Promise.all([...this.assetPromises.slice(),...i?[i.ready.then(()=>{}),i.load("700 24px Inter").then(()=>{}),i.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(){const e=[this.bgLayer,this.seatLayer,this.overlayLayer].map(a=>a.getClientRect({relativeTo:this.stage})).filter(a=>a.width>0&&a.height>0);if(!e.length)return this.bounds;const i=Math.min(...e.map(a=>a.x)),s=Math.min(...e.map(a=>a.y)),n=Math.max(...e.map(a=>a.x+a.width)),o=Math.max(...e.map(a=>a.y+a.height));return{x:i,y:s,width:Math.max(1,n-i),height:Math.max(1,o-s)}}fitExportContent(){if(!this.exportMode)return;const e=this.stage.width(),i=this.stage.height(),s=Math.max(12,Math.min(36,Math.min(e,i)*.025)),n=()=>{const o=this.exportSceneBounds(),a=Math.max(1,e-s*2),r=Math.max(1,i-s*2),l=Math.min(a/o.width,r/o.height)||1;this.fitScale=l,this.stage.scale({x:l,y:l}),this.stage.position({x:(e-o.width*l)/2-o.x*l,y:(i-o.height*l)/2-o.y*l}),this.afterViewChange()};n(),n()}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(n){const o=n instanceof Error?n.message:String(n);throw new Error(`The chart canvas could not be captured. A buyer-visible image may block export. ${o}`)}const i=document.createElement("canvas");i.width=this.stage.width(),i.height=this.stage.height();const s=i.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,i.width,i.height);try{s.drawImage(e,0,0)}finally{e.width=1,e.height=1}return i}updateFreeTextVisibility(){const e=this.exportMode?Math.max(this.effScale(),Lt):this.effScale();for(const{objectId:s,node:n,backdrop:o,categoryKey:a,kind:r}of this.freeTextById.values()){var i;const l=a!=null&&(r==="ga-label"||r==="ga-capacity")&&this.gaCategoryDimmed(a),c=s!=null&&(r==="ga-label"||r==="ga-capacity")&&((i=this.gaById.get(s))===null||i===void 0?void 0:i.sectionId)!=null&&e<.49500000000000005,d=r==="free-text"&&this.nodeBelongsToFocusedSection(n),u=!l&&!c&&(d||Gt(n.fontSize(),e));n.visible(u),o==null||o.visible(u)}for(const{node:s,fontSize:n}of this.iconNodeById.values())s.visible(this.nodeBelongsToFocusedSection(s)||Gt(n,e))}nodeBelongsToFocusedSection(e){const i=this.focusedSectionId;if(!i)return!1;const s=this.sections.filter(a=>a.id===i||a.logicalId===i||a.zone===i);if(!s.length)return!1;const n=e.getClientRect({relativeTo:this.bgLayer,skipShadow:!0}),o={x:n.x+n.width/2,y:n.y+n.height/2};return s.some(a=>Ke(o,a.outline,a.holes))}buildRowLabelPlan(e){this.rowLabelPlan=lp(e,{theme:this.theme,seats:this.seats,seatSection:this.seatSection,seatR:this.seatR,objectFilteredOut:i=>this.objectFilteredOut(i)})}rowLabelBox(e,i,s=2){return kr(e,i,s)}resolveAutomaticRowLabelPosition(e,i,s){return cp(e,i,s,this.seatIndex)}objectFilteredOut(e){const i=e.categoryKey;return i?!!(this.categoryHighlight&&i!==this.categoryHighlight||this.categoryFilter&&!this.categoryFilter.has(i)):!1}updateLabels(){gp(this.viewportLabelContext)}get viewportLabelContext(){return{exportMode:this.exportMode,effScale:()=>this.effScale(),boothLabelById:this.boothLabelById,circleById:this.circleById,focusedSeatOpacity:(e,i)=>this.focusedSeatOpacity(e,i),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,opts:this.opts,seatLabelContainer:e=>this.seatLabelContainer(e),seatLabelScale:e=>this.seatLabelScale(e),labelFont:()=>this.labelFont(),seatLabelInk:(e,i)=>this.seatLabelInk(e,i),seatPreferredLabelInk:e=>this.seatPreferredLabelInk(e),seatR:this.seatR,freeTextById:this.freeTextById,bgLayer:this.bgLayer,rowLabelPlan:this.rowLabelPlan,focusedSectionId:this.focusedSectionId,resolveAutomaticRowLabelPosition:(e,i,s)=>this.resolveAutomaticRowLabelPosition(e,i,s),rowLabelBox:(e,i)=>this.rowLabelBox(e,i),isoT:this.isoT,applyUprightLabels:()=>this.applyUprightLabels(),overlayLayer:this.overlayLayer}}handleResize(){const e=this.container.clientWidth||1,i=this.container.clientHeight||1;e===this.stage.width()&&i===this.stage.height()||(this.stage.size({width:e,height:i}),this.refitCurrentView())}startFpsLoop(){const e=i=>{this.lastFpsAt||(this.lastFpsAt=i),this.frames++;const s=i-this.lastFpsAt;if(s>=1e3){var n,o;(n=(o=this.opts).onFps)===null||n===void 0||n.call(o,Math.round(this.frames*1e3/s)),this.frames=0,this.lastFpsAt=i}this.rafId=requestAnimationFrame(e)};this.rafId=requestAnimationFrame(e)}};Sr=Pn,Sr.ZOOM_STEP=1.4;function Cr(t,e){return new Pn(t,e)}function ei(t){const e=Number(t.slice(t.lastIndexOf(":")+1));return Number.isFinite(e)?e:-1}function Tr(t,e,i){const s=new Map;for(const a of t){if(a.kind==="booth")continue;const r=s.get(a.rowId);r?r.push(a):s.set(a.rowId,[a])}const n=a=>i.has(a.id)||e(a.id)!=="free",o=[];for(const a of s.values())if(!(a.length<3)){a.sort((r,l)=>ei(r.id)-ei(l.id));for(let r=1;rn.focalPoint))===null||s===void 0?void 0:s.focalPoint)!==null&&i!==void 0?i:e}function $n(t){var e;return((e=t.commercial)===null||e===void 0?void 0:e.premium)===!0}function _p(t,e,i){const s=Math.floor(i.qty);if(!Number.isFinite(s)||s<=0)return{labels:[],reason:"sold_out"};const{categoryKey:n,zoneId:o,focal:a,preferPremium:r}=i,l=new Map,c=[];if(t.forEach((h,p)=>{var f;const v=e.has(h.label)&&(!n||h.categoryKey===n)&&(!o||h.zoneId===o),m=(f=h.logicalRowId)!==null&&f!==void 0?f:h.rowId;let g=l.get(m);g||(g=[],l.set(m,g)),g.push({seat:h,index:Rn(h,p),elig:v}),v&&c.push(h)}),c.length===0)return{labels:[],reason:"sold_out"};let d=null;const u=h=>{if(!d)return!0;if(r&&h.nonPremium!==d.nonPremium)return h.nonPremiumm.index-g.index);let v=0;for(;vT.seat),S={labels:C.map(T=>T.label),seats:C,rowId:h,startIndex:f[v+b].index,orphan:w,nonPremium:r?C.reduce((T,E)=>T+($n(E)?0:1),0):0,d2:Lr(Ip(C),Mp(C,a))};u(S)&&(d=S)}v=m}}return d?{labels:d.labels}:c.length{var f;return{seat:h,i:p,d2:Lr(h,(f=h.focalPoint)!==null&&f!==void 0?f:a)}}).sort((h,p)=>{var f,v;if(r){const g=$n(h.seat)?0:1,b=$n(p.seat)?0:1;if(g!==b)return g-b}if(h.d2!==p.d2)return h.d2-p.d2;const m=((f=h.seat.logicalRowId)!==null&&f!==void 0?f:h.seat.rowId).localeCompare((v=p.seat.logicalRowId)!==null&&v!==void 0?v:p.seat.rowId);return m!==0?m:Rn(h.seat,h.i)-Rn(p.seat,p.i)}).slice(0,s).map(h=>h.seat.label)}}function On(t){return{code:"ticket_option_not_applicable",labels:t,message:"That ticket choice is not available for the selected seat."}}function Fn(t,e){var i,s;const n=t.applicability;return n?!(!((i=n.seatLabels)===null||i===void 0)&&i.length&&!n.seatLabels.includes(e.label)||!((s=n.accessibility)===null||s===void 0)&&s.length&&!n.accessibility.some(o=>{var a;return(a=e.accessibility)===null||a===void 0?void 0:a.includes(o)})):!0}function Pp(t,e){var i,s;return((i=(s=t.categories.find(n=>n.key===e.categoryKey))===null||s===void 0?void 0:s.tiers)!==null&&i!==void 0?i:[]).filter(n=>Fn(n,e))}function Pi(t,e,i){var s;const n=(s=t.categories.find(a=>a.key===e.categoryKey))===null||s===void 0?void 0:s.tiers;if(!(n!=null&&n.length))return{kind:"none"};const o=i==null?n.find(a=>Fn(a,e)):n.find(a=>a.id===i&&Fn(a,e));return o?{kind:"resolved",tier:o}:{kind:"invalid"}}function Rp(t,e){var i,s;return((i=t.logicalRowId)!==null&&i!==void 0?i:t.rowId)===((s=e.logicalRowId)!==null&&s!==void 0?s:e.rowId)}function Ar(t){if(Number.isInteger(t.logicalSeatIndex))return t.logicalSeatIndex;const e=t.id.slice(t.id.lastIndexOf(":")+1),i=Number(e);return Number.isInteger(i)?i:void 0}function $p(t,e){if(!Rp(t,e))return!1;const i=Ar(t),s=Ar(e);return i!=null&&s!=null&&Math.abs(i-s)===1}function Op(t,e){if(!e.length)return null;const i=new Map(Ye(t,{resolveEyeHeights:!1}).map(r=>[r.label,r])),s=e.flatMap(r=>{const l=i.get(r.label);return l?[{selection:r,seat:l}]:[]}),n=s.map(({seat:r})=>r).filter(r=>{var l;return(l=r.accessibility)===null||l===void 0?void 0:l.includes("wheelchair")}),o=[];for(const{selection:r,seat:l}of s){var a;const c=Pi(t,l,r.tierId),d=c.kind==="resolved"?c.tier:void 0;(!((a=l.accessibility)===null||a===void 0)&&a.includes("companion")||(d==null?void 0:d.restriction)==="companion")&&!n.some(u=>u.id!==l.id&&$p(l,u))&&o.push(l.label)}return o.length?{code:"companion_pair_required",labels:o,message:"Select the adjacent wheelchair place with each companion ticket."}:null}function Fp(t,e){if(!e.length)return null;const i=new Map(Ye(t,{resolveEyeHeights:!1}).map(a=>[a.label,a])),s=new Set(t.categories.filter(a=>a.notForSale).map(a=>a.key)),n=[],o=[];for(const a of e){const r=i.get(a.label);if(r){if(s.has(r.categoryKey)){n.push(r.label);continue}Pi(t,r,a.tierId).kind==="invalid"&&o.push(r.label)}}return n.length?{code:"not_for_sale",labels:n,message:"These seats are not for sale."}:o.length?On(o):Op(t,e)}var Bn=class extends Error{constructor(t,e){super(e),this.objectId=t,this.name="GroupedTableProjectionError"}};function Bp(t){const e=t.minOccupancy,i=t.maxOccupancy;if(!Number.isInteger(e)||!Number.isInteger(i)||e<1||it.seatCount)throw new Bn(t.id,`Table "${t.label}" has invalid variable-occupancy bounds`);return{min:e,max:i}}function zp(t,e){if(e!==2)return[];const i=[];for(const s of ci(t)){if(s.type!=="table"||!s.bookAsWhole&&!s.variableOccupancy)continue;if(s.bookAsWhole&&s.variableOccupancy)throw new Bn(s.id,`Table "${s.label}" cannot be whole-table and variable-occupancy inventory`);if(!Number.isInteger(s.seatCount)||s.seatCount<1||!s.label.trim())throw new Bn(s.id,"Grouped tables require a label and at least one chair");const n=s.variableOccupancy?"variable":"whole",o=n==="variable"?Bp(s):{min:s.seatCount,max:s.seatCount};i.push({objectId:s.id,label:s.label,...s.displayLabel?{displayLabel:s.displayLabel}:{},...s.displayType?{displayType:s.displayType}:{},categoryKey:s.categoryKey,mode:n,capacity:s.seatCount,minOccupancy:o.min,maxOccupancy:o.max,chairs:Xs(s)})}return i}var Cs=class extends Error{constructor(t){super(t.message),this.status=422,this.name="PickerSelectionError",this.reason=t.code,this.labels=t.labels}};function Dp(t){if(t!=null&&(!Number.isInteger(t)||t<1))throw new Error("picker: `numberOfPlacesToSelect` must be a positive integer");return t!=null?t:null}function Hp(t,e,i,s){var n;if(i!=null&&!Array.isArray(i))throw new TypeError("picker: `selectionValidators` must be an array");const o=[];let a=0,r=!1,l=!1;for(const u of i!=null?i:[])if((u==null?void 0:u.type)==="minimumSelectedPlaces"){if(!Number.isInteger(u.minimum)||Number(u.minimum)<1)throw new TypeError("picker: `minimumSelectedPlaces.minimum` must be a positive integer");a=Math.max(a,Number(u.minimum))}else if((u==null?void 0:u.type)==="consecutiveSeats")r=!0;else if((u==null?void 0:u.type)==="noOrphanSeats")l=!0;else{var c;throw new TypeError(`picker: unsupported selection validator "${String((c=u==null?void 0:u.type)!==null&&c!==void 0?c:"")}"`)}if(a&&o.push({type:"minimumSelectedPlaces",minimum:a}),r&&o.push({type:"consecutiveSeats"}),l&&o.push({type:"noOrphanSeats"}),t!=null&&a>t)throw new Error("picker: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");const d=Math.max(0,Math.floor((n=e!=null?e:t)!==null&&n!==void 0?n:Math.max(s,a)));if(t!=null&&da.objectId!==s||a.categoryKey!==n))return!0;const o=t.map(a=>Np(a.id)).sort((a,r)=>a-r);return o.some((a,r)=>a<0||r>0&&a!==o[r-1]+1)}function Gp(t,e,i,s,n){var o,a;const r=(o=(a=s.find(d=>d.type==="minimumSelectedPlaces"))===null||a===void 0?void 0:a.minimum)!==null&&o!==void 0?o:0,l=i!=null?i:r,c=[];return i!=null&&e!==i&&c.push("numberOfPlacesToSelect"),r&&ed.type==="consecutiveSeats")&&Vp(t)&&c.push("consecutiveSeats"),s.some(d=>d.type==="noOrphanSeats")&&n()&&c.push("noOrphanSeats"),{isValid:c.length===0,count:e,required:l,remaining:Math.max(0,l-e),seats:t,violations:c}}var qp=10,jp=15e3,Er=["background","rowLabelColor","textColor","selectionColor"];function Up(t,e){return!t||!e?!t&&!e:Er.every(i=>t[i]===e[i])}function Ts(t){const e=t!=null?t:{};return{status:e.status,conflicts:e.conflicts,reason:e.reason}}function zn(t){return t==="blocked"?"not_for_sale":t==="held"||t==="booked"||t==="free"||t==="not_for_sale"?t:"free"}var Ir=class{constructor(t){var e;this.selectableSeatIds=null,this.lastSelectionValidity=null,this.renderer=null,this._doc=null,this.hidden=new Set,this.mapTheme=null,this.closedSections=new Set,this.labelToId=new Map,this.labelToSeat=new Map,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=t,this.api=t.transport,this.key=t.eventKey,this.numberOfPlacesToSelect=Dp(t.numberOfPlacesToSelect);const i=Hp(this.numberOfPlacesToSelect,t.maxSelection,t.selectionValidators,qp);this.selectionValidators=i.validators,this.maxSelection=i.maxSelection,this.selectableObjectRefs=t.selectableObjects==null?null:[...new Set(t.selectableObjects.filter(s=>typeof s=="string"&&!!s))],this.mapTheme=(e=t.mapTheme)!==null&&e!==void 0?e:null}get doc(){return this._doc}visibleDoc(){var t;if(!this._doc)return{objects:[]};const e=ud(this._doc,this.hidden);if(!this.mapTheme)return e;const i={...(t=e.theme)!==null&&t!==void 0?t:{}};for(const s of Er){const n=this.mapTheme[s];n&&(i[s]=n)}return{...e,theme:i}}setMapTheme(t){var e,i,s,n,o,a;if(Up(this.mapTheme,t!=null?t:null))return!1;this.mapTheme=t!=null?t:null;const r=this.renderer;if(!r)return!0;const l=r.getSelection().map(u=>u.id),c=this.getActiveFloorId(),d=(e=(i=r.isFloorOverview)===null||i===void 0?void 0:i.call(r))!==null&&e!==void 0?e:!1;return r.setChart(this.visibleDoc(),c?{floorId:c}:void 0),d&&((s=r.setFloorOverview)===null||s===void 0||s.call(r,!0)),this.opts.colorblindSafe&&((n=r.setColorblindSafe)===null||n===void 0||n.call(r,!0)),this.closedSections.size&&((o=r.setClosedSections)===null||o===void 0||o.call(r,[...this.closedSections])),this.applySeatsMap(Object.fromEntries(this.liveStatuses),this.liveDefault),l.length&&((a=r.select)===null||a===void 0||a.call(r,l)),!0}syncHidden(t){var e,i,s,n,o,a;const r=t.filter(c=>typeof c=="string");if(r.length===this.hidden.size&&r.every(c=>this.hidden.has(c)))return!1;this.hidden=new Set(r);const l=(e=(i=this.renderer)===null||i===void 0||(s=i.isFloorOverview)===null||s===void 0?void 0:s.call(i))!==null&&e!==void 0?e:!1;return(n=this.renderer)===null||n===void 0||n.setChart(this.visibleDoc()),l&&((o=this.renderer)===null||o===void 0||(a=o.setFloorOverview)===null||a===void 0||a.call(o,!0)),!0}syncClosed(t){var e,i;const s=(t!=null?t:[]).filter(n=>typeof n=="string");return s.length===this.closedSections.size&&s.every(n=>this.closedSections.has(n))?!1:(this.closedSections=new Set(s),(e=this.renderer)===null||e===void 0||(i=e.setClosedSections)===null||i===void 0||i.call(e,s),!0)}isSectionClosed(t){return this.closedSections.has(t)}currentHold(){return this.hold_}getRenderer(){return this.renderer}seatByLabel(t){return this.labelToSeat.get(t)}idForLabel(t){return this.labelToId.get(t)}idsForLabel(t){const e=this.groupedTablesByLabel.get(t);if(e)return e.chairs.map(s=>s.id);const i=this.labelToId.get(t);return i?[i]:[]}idsForLabels(t){return[...new Set([...t].flatMap(e=>this.idsForLabel(e)))]}tableSelection(t){var e;const i=(e=this.groupedTableBySeatId.get(t))!==null&&e!==void 0?e:this.groupedTablesByLabel.get(t);return i?this.toTableSeat(i):null}lineItemDisplay(t){if(t.objectType==="ga"){const s=Qi(this.visibleDoc()).find(n=>n.id===t.objectId);return{...s!=null&&s.displayLabel?{displayLabel:s.displayLabel}:{},...s!=null&&s.displayType?{displayType:s.displayType}:{}}}if(t.objectType==="table"){const s=this.groupedTablesByLabel.get(t.label);return{...s!=null&&s.displayLabel&&s.displayLabel!==s.label?{displayLabel:s.displayLabel}:{},...s!=null&&s.displayType?{displayType:s.displayType}:{}}}const e=this.labelToSeat.get(t.label),i=e?this.seatContext.get(e.id):void 0;return{...e!=null&&e.displayLabel?{displayLabel:e.displayLabel}:{},...i!=null&&i.displayType?{displayType:i.displayType}:{}}}async render(t){var e,i,s,n,o,a,r,l,c,d;if(this.renderer)return null;const u=performance.now(),h={},p=F=>Math.round((performance.now()-F)*100)/100;this.closed=!1;let f;const v=performance.now();try{f=await this.api.chart(this.key)}catch(F){return this.emitError(F),null}if(h.loadChart=p(v),this.closed)return null;this._doc=f.doc;const m=performance.now();try{const F=zp(f.doc,f.event.inventoryModelVersion===2?2:1);this.groupedTablesByObject=new Map(F.map(_=>[_.objectId,_])),this.groupedTablesByLabel=new Map(F.map(_=>[_.label,_])),this.groupedTableBySeatId=new Map(F.flatMap(_=>_.chairs.map(U=>[U.id,_]))),this.tableQuantities=new Map(F.map(_=>[_.label,_.mode==="whole"?_.capacity:_.minOccupancy])),this.confirmedVariableTables=new Set,this.groupedSelectionOverhead=F.reduce((_,U)=>_+Math.max(0,U.chairs.length-1),0)}catch(F){return this.emitError(F),null}this.labelToId=new Map,this.labelToSeat=new Map,this.seatById=new Map,this.seatContext=new Map,this.allIds=[];const g=new Map(ci(f.doc).map(F=>[F.id,F])),b=Ji(f.doc),y=new Map([...b.sections,...b.ungrouped?[b.ungrouped]:[]].map(F=>[F.id,F.label]));for(const F of Ye(f.doc)){var k,w,C,S,T;this.labelToId.set(F.label,F.id),this.labelToSeat.set(F.label,F),this.seatById.set(F.id,F),this.allIds.push(F.id);const _=g.get(F.rowId),U=_&&"label"in _&&typeof _.label=="string"?_.label:void 0,Y=(_==null?void 0:_.type)==="row"?_.segmentedRow:void 0,ie=(k=Y==null?void 0:Y.displayLabel)!==null&&k!==void 0?k:_&&"displayLabel"in _&&typeof _.displayLabel=="string"&&_.displayLabel?_.displayLabel:U,ae=this.groupedTablesByObject.get(F.rowId),ne=(_==null?void 0:_.type)==="table"?"table":(_==null?void 0:_.type)==="booth"?"booth":"seat",ve=ie,Le=(Y==null||(w=Y.displayType)===null||w===void 0?void 0:w.trim())||(_&&"displayType"in _&&typeof _.displayType=="string"&&_.displayType.trim()?_.displayType.trim():void 0),Ce=(C=F.displayLabel)!==null&&C!==void 0?C:F.label,Ze=Ce.split("-"),nt=ae||F.kind==="booth"?void 0:ie&&Ce.startsWith(`${ie}-`)?Ce.slice(ie.length+1):(S=Ze[Ze.length-1])!==null&&S!==void 0?S:Ce;this.seatContext.set(F.id,{objectId:F.rowId,objectType:ne,sectionLabel:y.get((T=b.objectToSection.get(F.rowId))!==null&&T!==void 0?T:""),rowLabel:ve,seatNumber:nt,...Le?{displayType:Le,rowType:Le}:{}})}for(const F of this.groupedTablesByLabel.values()){const _=F.chairs[0];_&&(this.labelToId.set(F.label,_.id),this.labelToSeat.set(F.label,_))}h.normalizeBuyerModel=p(m);const E=(e=f.event.currency)!==null&&e!==void 0?e:this.opts.currency;this.currency=E!=null?E:"USD";const L=performance.now(),I=Cr(t,{maxSelection:this.rendererSelectionCap(),confirmSelection:this.opts.confirmSelection,portraitFitCrop:!1,currency:E,onSelect:F=>{this.handleRendererSelect(F)},onDeselect:F=>{this.handleRendererDeselect(F)},onSelectionLimit:this.opts.onSelectionLimit,onHover:F=>{var _,U;(_=(U=this.opts).onHover)===null||_===void 0||_.call(U,F),this.opts.onSeatHover&&this.opts.onSeatHover(F?this.describeSeat(F):null)},onFocusSeat:this.opts.onFocusSeat,onViewChange:this.opts.onViewChange,onGAClick:this.opts.onGAClick,onSectionTap:F=>this.handleSectionTap(F),onDeckTap:F=>this.handleDeckTap(F),onFps:this.opts.onFps});if(h.createRenderer=p(L),this.closed)return I.destroy(),null;this.renderer=I;let M=null,x="free",A=[];const P=performance.now();try{var N,W,B;const F=await this.api.objects(this.key);this.hidden=new Set((N=F.hidden)!==null&&N!==void 0?N:[]),A=((W=F.closed)!==null&&W!==void 0?W:[]).filter(_=>typeof _=="string"),M=F.seats,x=(B=F.default)!==null&&B!==void 0?B:"free"}catch{}if(h.loadStatuses=p(P),this.closed)return I.destroy(),this.renderer=null,null;const z=performance.now();I.setChart(this.visibleDoc()),((i=(s=f.doc.floors)===null||s===void 0?void 0:s.length)!==null&&i!==void 0?i:0)>1&&((n=I.setFloorOverview)===null||n===void 0||n.call(I,!0)),this.opts.colorblindSafe&&((o=I.setColorblindSafe)===null||o===void 0||o.call(I,!0)),h.buildScene=p(z),this.closedSections=new Set(A);const j=performance.now();A.length&&((a=I.setClosedSections)===null||a===void 0||a.call(I,A)),M&&this.applySeatsMap(M,x),this.rebuildSelectableSeatIds(),!((r=this.opts.selectedObjects)===null||r===void 0)&&r.length?this.select(this.opts.selectedObjects):this.emitSelectionValidity(),h.applyInitialState=p(j);const G=performance.now();I.forceDraw(),h.firstPaint=p(G);const D=performance.now();return this.attachVisibilityListener(),this.connect(),h.startRealtime=p(D),h.controllerTotal=p(u),{doc:f.doc,salesClosed:!!f.event.salesClosed,eventName:f.event.name,venue:f.event.venue,startsAt:f.event.startsAt,timezone:(l=f.event.timezone)!==null&&l!==void 0?l:null,currency:E,mode:(c=f.event.mode)!==null&&c!==void 0?c:"live",posterUrl:(d=f.event.posterUrl)!==null&&d!==void 0?d:null,performanceProfile:h}}getSelection(){if(!this.renderer)return[];const t=[],e=new Set;for(const i of this.renderer.getSelection()){const s=this.groupedTableBySeatId.get(i.id);s?e.has(s.label)||(e.add(s.label),t.push(this.toTableSeat(s))):t.push(this.toSeat(i))}return t}seatDetails(t){const e=this.seatById.get(t);return e?this.describeSeat(e):null}clearSelection(){var t;(t=this.renderer)===null||t===void 0||t.clearSelection(),this.resetUnheldTableQuantities(),this.emitSelectionChange()}deselect(t){var e;const i=new Set;for(const o of t){var s;const a=(s=this.groupedTableBySeatId.get(o))!==null&&s!==void 0?s:this.groupedTablesByLabel.get(o);if(a){var n;a.chairs.forEach(r=>i.add(r.id)),!((n=this.hold_)===null||n===void 0)&&n.labels.includes(a.label)||(this.tableQuantities.set(a.label,a.mode==="whole"?a.capacity:a.minOccupancy),a.mode==="variable"&&this.confirmedVariableTables.delete(a.label))}else{const r=this.seatById.has(o)?o:this.labelToId.get(o);r&&i.add(r)}}(e=this.renderer)===null||e===void 0||e.deselect([...i]),this.emitSelectionChange()}setMaxSelection(t){var e,i;this.maxSelection=Math.max(0,Math.floor(t)),(e=this.renderer)===null||e===void 0||(i=e.setMaxSelection)===null||i===void 0||i.call(e,this.rendererSelectionCap())}select(t){var e,i;const s=new Set(this.getSelection().map(u=>u.label)),n=new Set,o=[];for(const u of t){var a;const h=(a=this.groupedTableBySeatId.get(u))!==null&&a!==void 0?a:this.groupedTablesByLabel.get(u);if(h)this.tableTierResolution(h).kind==="invalid"?o.push(h.label):h.chairs.forEach(p=>{this.isSelectableByPolicy(p.id)&&n.add(p.id)});else{const p=this.seatById.has(u)?u:this.labelToId.get(u);if(!p||!this.isSelectableByPolicy(p))continue;const f=this.seatById.get(p);f&&this.seatTierResolution(f).kind==="invalid"?o.push(f.label):n.add(p)}}if(o.length&&this.emitError(new Cs(On(o))),!n.size)return[];if((e=this.renderer)===null||e===void 0||(i=e.select)===null||i===void 0||i.call(e,[...n]),this.selectionGuestCount()>this.maxSelection){var r,l,c;return(r=this.renderer)===null||r===void 0||r.deselect([...n]),(l=(c=this.opts).onSelectionLimit)===null||l===void 0||l.call(c,this.maxSelection),[]}const d=this.getSelection().filter(u=>!s.has(u.label));return d.length&&this.emitSelectionChange(),d}selectCategories(t){const e=new Set(t);return this.select([...this.seatById.values()].filter(i=>e.has(i.categoryKey)).map(i=>i.id))}deselectCategories(t){const e=new Set(t);this.deselect(this.getSelection().filter(i=>e.has(i.categoryKey)).map(i=>i.id))}setSelectableObjects(t){var e,i;this.selectableObjectRefs=t==null?null:[...new Set(t.filter(n=>typeof n=="string"&&!!n))],this.rebuildSelectableSeatIds();const s=(e=(i=this.renderer)===null||i===void 0?void 0:i.getSelection().filter(n=>!this.isSelectableByPolicy(n.id)).map(n=>n.id))!==null&&e!==void 0?e:[];s.length&&this.deselect(s)}getSelectionValidity(t){if(this.numberOfPlacesToSelect==null&&!this.selectionValidators.length)return null;const e=this.getSelection();return Gp(e,t!=null?t:e.reduce((i,s)=>{var n;return i+((n=s.quantity)!==null&&n!==void 0?n:1)},0),this.numberOfPlacesToSelect,this.selectionValidators,()=>this.hasOrphanedSelection())}hasOrphanedSelection(){const t=this.renderer;if(!t)return!1;const e=new Set(t.getSelection().map(i=>i.id));return e.size>0&&Tr(this.seatById.values(),i=>t.getStatus(i),e).length>0}rebuildSelectableSeatIds(){if(this.selectableObjectRefs==null){this.selectableSeatIds=null;return}const t=new Set;for(const i of this.selectableObjectRefs){var e;const s=(e=this.groupedTableBySeatId.get(i))!==null&&e!==void 0?e:this.groupedTablesByLabel.get(i);if(s){s.chairs.forEach(o=>t.add(o.id));continue}const n=this.seatById.has(i)?i:this.labelToId.get(i);n&&t.add(n)}this.selectableSeatIds=t}isSelectableByPolicy(t){return this.selectableSeatIds==null||this.selectableSeatIds.has(t)}setTableQuantity(t,e){var i;const s=this.groupedTablesByLabel.get(t);if(!s)return!1;const n=s.mode==="whole"?s.capacity:Math.floor(e);if(!Number.isInteger(n)||ns.maxOccupancy)return!1;const o=(i=this.tableQuantities.get(t))!==null&&i!==void 0?i:s.minOccupancy;if(this.tableQuantities.set(t,n),this.selectionGuestCount()>this.maxSelection){var a,r;return this.tableQuantities.set(t,o),(a=(r=this.opts).onSelectionLimit)===null||a===void 0||a.call(r,this.maxSelection),!1}return s.mode==="variable"&&this.confirmedVariableTables.add(t),this.emitSelectionChange(),!0}async replaceTableQuantity(t,e,i){var s,n;const o=this.groupedTablesByLabel.get(t),a=this.hold_;if(!o||o.mode!=="variable"||!(a!=null&&a.labels.includes(t)))return null;const r=Math.floor(e);if(!Number.isInteger(r)||ro.maxOccupancy)return null;if(((s=a.items)!==null&&s!==void 0?s:[]).filter(h=>h.label!==t).reduce((h,p)=>{var f;return h+((f=p.quantity)!==null&&f!==void 0?f:1)},0)+r>this.maxSelection){var l,c;return(l=(c=this.opts).onSelectionLimit)===null||l===void 0||l.call(c,this.maxSelection),null}const d=((n=a.items)!==null&&n!==void 0?n:[]).map(h=>({label:h.label,tierId:h.tierId,quantity:h.label===t?r:h.quantity}));if(!d.some(h=>h.label===t))return null;const u=await this.api.hold(this.key,d,i,a.holdId);return this.tableQuantities.set(t,r),this.setHold({holdId:u.holdId,labels:d.map(h=>h.label),expiresAt:u.expiresAt,items:u.items}),this.hold_}rendererSelectionCap(){return this.maxSelection+this.groupedSelectionOverhead}selectionGuestCount(){return this.getSelection().reduce((t,e)=>{var i;return t+((i=e.quantity)!==null&&i!==void 0?i:1)},0)}handleRendererSelect(t){var e,i;const s=this.groupedTableBySeatId.get(t.id);if(!this.isSelectableByPolicy(t.id)){var n;(n=this.renderer)===null||n===void 0||n.deselect(s?s.chairs.map(k=>k.id):[t.id]),this.emitSelectionChange();return}if((s?this.tableTierResolution(s):this.seatTierResolution(t)).kind==="invalid"){var o,a;(o=this.renderer)===null||o===void 0||o.deselect(s?s.chairs.map(k=>k.id):[t.id]),this.emitError(new Cs(On([(a=s==null?void 0:s.label)!==null&&a!==void 0?a:t.label]))),this.emitSelectionChange();return}if(s){var r,l,c,d,u,h,p;if(this.selectionGuestCount()>this.maxSelection){var f,v,m;(f=this.renderer)===null||f===void 0||f.deselect(s.chairs.map(k=>k.id)),(v=(m=this.opts).onSelectionLimit)===null||v===void 0||v.call(m,this.maxSelection),this.emitSelectionChange();return}(r=this.renderer)===null||r===void 0||(l=r.select)===null||l===void 0||l.call(r,s.chairs.map(k=>k.id)),(c=(d=this.opts).onSelect)===null||c===void 0||c.call(d,(u=s.chairs[0])!==null&&u!==void 0?u:t),(h=(p=this.opts).onTableSelectionRequest)===null||h===void 0||h.call(p,this.toTableSeat(s)),this.emitSelectionChange();return}if(this.selectionGuestCount()>this.maxSelection){var g,b,y;(g=this.renderer)===null||g===void 0||g.deselect([t.id]),(b=(y=this.opts).onSelectionLimit)===null||b===void 0||b.call(y,this.maxSelection),this.emitSelectionChange();return}(e=(i=this.opts).onSelect)===null||e===void 0||e.call(i,t),this.emitSelectionChange()}handleRendererDeselect(t){const e=this.groupedTableBySeatId.get(t.id);if(e){var i,s,n,o,a;(i=this.renderer)===null||i===void 0||i.deselect(e.chairs.map(c=>c.id)),!((s=this.hold_)===null||s===void 0)&&s.labels.includes(e.label)||(this.tableQuantities.set(e.label,e.mode==="whole"?e.capacity:e.minOccupancy),e.mode==="variable"&&this.confirmedVariableTables.delete(e.label)),(n=(o=this.opts).onDeselect)===null||n===void 0||n.call(o,(a=e.chairs[0])!==null&&a!==void 0?a:t)}else{var r,l;(r=(l=this.opts).onDeselect)===null||r===void 0||r.call(l,t)}this.emitSelectionChange()}resetUnheldTableQuantities(){for(const e of this.groupedTablesByLabel.values()){var t;!((t=this.hold_)===null||t===void 0)&&t.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(t){for(const e of t){const i=this.groupedTablesByLabel.get(e);i&&(this.tableQuantities.set(e,i.mode==="whole"?i.capacity:i.minOccupancy),i.mode==="variable"&&this.confirmedVariableTables.delete(e))}}tableQuantityRequest(t){if((t==null?void 0:t.objectType)!=="table")return{};if(t.bookingMode==="variable"&&!this.confirmedVariableTables.has(t.label))throw new Error("picker: confirm a variable table guest quantity before holding");return{quantity:t.quantity}}async hold(t,e){var i,s;if(!this.renderer)return null;const n=t!=null?t:this.getSelection().map(c=>c.label),o=((i=(s=this.hold_)===null||s===void 0?void 0:s.items)!==null&&i!==void 0?i:[]).filter(c=>c.objectType==="ga"),a=[...new Set([...o.map(c=>c.label),...n])];if(!a.length)return null;const r=this.ticketIssue(a);if(r)throw new Cs(r);if(this.hold_&&this.holdCovers(a))return this.hold_;try{var l;const c=a.map(u=>{const h=o.find(v=>v.label===u);if(h)return{label:u,tierId:h.tierId,quantity:h.quantity};const p=this.labelToSeat.get(u),f=p?this.toSeat(p):null;return{label:u,...f!=null&&f.tierId?{tierId:f.tierId}:{},...this.tableQuantityRequest(f)}}),d=await this.api.hold(this.key,c,e,(l=this.hold_)===null||l===void 0?void 0:l.holdId);return this.setHold({holdId:d.holdId,labels:a,expiresAt:d.expiresAt,items:d.items}),this.hold_}catch(c){throw this.handle409Conflicts(c),c}}async resumeHold(t){if(this.closed||!t||!this.api.resume)return null;const e=await this.api.resume(this.key,t);if(this.closed)return null;const i=[...new Set(e.items.map(s=>s.label))];return i.length?(this.setHold({holdId:e.holdId,labels:i,expiresAt:e.expiresAt,items:e.items},"restored"),this.hold_):null}async extendHold(t){const e=this.hold_;if(!e||!this.api.extend)return null;try{var i;const s=await this.api.extend(this.key,e.holdId,t);return((i=this.hold_)===null||i===void 0?void 0:i.holdId)!==e.holdId?this.hold_:(this.setHold({holdId:e.holdId,labels:e.labels,expiresAt:s.expiresAt,items:e.items}),this.hold_)}catch{return null}}categoryAvailability(){const t={},e=this.closedMemberIds();for(const[a,r]of this.seatById){var i;if(!this.groupedTableBySeatId.has(a)&&!e.has(a)&&((i=this.getStatus(a))!==null&&i!==void 0?i:"free")==="free"){var s;t[r.categoryKey]=((s=t[r.categoryKey])!==null&&s!==void 0?s:0)+1}}for(const a of this.groupedTablesByLabel.values()){var n;if(a.chairs.some(l=>e.has(l.id)))continue;const r=a.chairs[0];if(r&&((n=this.getStatus(r.id))!==null&&n!==void 0?n:"free")==="free"){var o;t[a.categoryKey]=((o=t[a.categoryKey])!==null&&o!==void 0?o:0)+a.maxOccupancy}}return t}closedMemberIds(){var t,e;const i=new Set,s=this.renderer;if(!s||!this.closedSections.size)return i;for(const n of this.closedSections)for(const o of(t=(e=s.sectionMembers)===null||e===void 0?void 0:e.call(s,n))!==null&&t!==void 0?t:[])i.add(o);return i}getGAAreas(){const t=this.visibleDoc();return t?Qi(t).map(e=>{var i,s,n;const o=t.categories.find(a=>a.key===e.categoryKey);return{id:e.id,label:e.label,...e.displayLabel?{displayLabel:e.displayLabel}:{},...e.displayType?{displayType:e.displayType}:{},capacity:Math.max(0,Math.floor(e.capacity)),available:Zi(e).filter(a=>this.statusOf(a)==="free").length,categoryKey:e.categoryKey,tiers:o==null?void 0:o.tiers,price:(i=(s=o==null||(n=o.tiers)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.price)!==null&&s!==void 0?s:o==null?void 0:o.price)!==null&&i!==void 0?i:0,currency:this.currency}}):[]}async holdGA(t,e,i={}){var s,n,o,a;const r=this.visibleDoc();if(!r||!Number.isFinite(e)||e<1)return null;const l=Qi(r).find(p=>p.id===t);if(!l)return null;const c=Zi(l).filter(p=>{var f;return!(!((f=this.hold_)===null||f===void 0)&&f.labels.includes(p))&&this.statusOf(p)==="free"}).slice(0,Math.floor(e));if(c.length!==Math.floor(e))return null;const d=new Map;for(const p of(s=(n=this.hold_)===null||n===void 0?void 0:n.items)!==null&&s!==void 0?s:[])d.set(p.label,{label:p.label,tierId:p.tierId,quantity:p.quantity});if(this.hold_&&!(!((o=this.hold_)===null||o===void 0||(o=o.items)===null||o===void 0)&&o.length))for(const p of this.hold_.seats)d.set(p.label,{label:p.label,...p.tierId?{tierId:p.tierId}:{}});for(const p of this.getSelection())d.set(p.label,{label:p.label,...p.tierId?{tierId:p.tierId}:{},...this.tableQuantityRequest(p)});for(const p of c)d.set(p,{label:p,...i.tierId?{tierId:i.tierId}:{}});const u=[...d.values()],h=await this.api.hold(this.key,u,i.ttlMs,(a=this.hold_)===null||a===void 0?void 0:a.holdId);return this.setHold({holdId:h.holdId,labels:u.map(p=>p.label),expiresAt:h.expiresAt,items:h.items}),this.hold_}hasPremiumSeats(){for(const e of this.labelToSeat.values()){var t;if(!((t=e.commercial)===null||t===void 0)&&t.premium)return!0}return!1}getBestAvailableZones(){var t;const e=this.visibleDoc();if(!(!(e==null||(t=e.zones)===null||t===void 0)&&t.length))return[];const i=new Set(Ji(e).sections.filter(s=>s.seatCount>0&&!!s.zone).map(s=>s.zone));return e.zones.filter(s=>i.has(s.id)).map(s=>({id:s.id,label:s.label}))}pickPremiumBlock(t,e,i){var s,n,o,a;const r=this.visibleDoc();if(!(!(r==null||(s=r.objects)===null||s===void 0)&&s.length))return null;const l=(n=r.focalPoint)!==null&&n!==void 0?n:{x:0,y:0},c=new Set(this.groupedTablesByObject.keys()),d=Ye(r).filter(f=>!c.has(f.rowId)),u=new Set((o=(a=this.hold_)===null||a===void 0?void 0:a.labels)!==null&&o!==void 0?o:[]),h=new Set;for(const f of d){if(u.has(f.label)||this.seatTierResolution(f).kind==="invalid")continue;const v=this.labelToId.get(f.label),m=v?this.getStatus(v):void 0;(m!=null?m:"free")==="free"&&h.add(f.label)}const p=_p(d,h,{qty:t,categoryKey:e,zoneId:i,focal:l,preferPremium:!0});return p.labels.length!==t?null:p.labels.every(f=>{var v;return(v=this.labelToSeat.get(f))===null||v===void 0||(v=v.commercial)===null||v===void 0?void 0:v.premium})?[...p.labels]:null}async bestAvailable(t,e,i={}){const s=this.renderer;if(!s)return null;if(i.preferPremium){const h=this.pickPremiumBlock(t,e,i.zoneId);if(h){if(this.hold_&&!await this.release())return null;try{var n,o;const p=h.map(g=>{const b=this.labelToSeat.get(g),y=b?this.toSeat(b):null;return{label:g,...y!=null&&y.tierId?{tierId:y.tierId}:{}}}),f=await this.api.hold(this.key,p,i.ttlMs);s.clearSelection();const v=this.idsForLabels(h);v.length&&s.setStatus(v,"held"),this.setHold({holdId:f.holdId,labels:[...h],expiresAt:f.expiresAt,items:f.items});const m=h.map(g=>this.labelToSeat.get(g)).filter(g=>!!g).map(g=>this.toSeat(g));return(n=(o=this.opts).onSelectionChange)===null||n===void 0||n.call(o,m),this.hold_}catch(p){const{status:f,reason:v}=Ts(p);if(f===409&&v==="event_closed"){var a,r;throw(a=(r=this.opts).onSalesClosed)===null||a===void 0||a.call(r),p}}}}if(this.hold_&&!await this.release())return null;try{var l,c;const h=await this.api.bestAvailable(this.key,t,e,i.zoneId,i.ttlMs);s.clearSelection();const p=this.idsForLabels(h.labels);p.length&&s.setStatus(p,"held"),this.setHold({holdId:h.holdId,labels:[...h.labels],expiresAt:h.expiresAt,items:h.items});const f=h.labels.map(v=>this.labelToSeat.get(v)).filter(v=>!!v).map(v=>this.toSeat(v));return(l=(c=this.opts).onSelectionChange)===null||l===void 0||l.call(c,f),this.hold_}catch(h){var d,u;const{status:p,reason:f}=Ts(h);throw p===409&&f==="event_closed"&&((d=(u=this.opts).onSalesClosed)===null||d===void 0||d.call(u)),h}}async book(t,e,i){var s,n;const o=this.renderer;if(!o)return null;if(!this.api.book)throw new Error("picker: transport has no book() — hold-only mode");const a=e!=null?e:this.getSelection().map(p=>p.label);if(!a.length)return null;const r=this.ticketIssue(a);if(r)throw new Cs(r);let l;try{if(this.hold_&&this.holdCovers(a))l=this.hold_.holdId;else{var c;const p=(c=this.hold_)===null||c===void 0?void 0:c.holdId,f=await this.api.hold(this.key,a.map(v=>{const m=this.labelToSeat.get(v),g=m?this.toSeat(m):null;return{label:v,...g!=null&&g.tierId?{tierId:g.tierId}:{},...this.tableQuantityRequest(g)}}),i,p);l=f.holdId,this.setHold({holdId:l,labels:[...a],expiresAt:f.expiresAt,items:f.items})}await this.api.book(this.key,a,l,t)}catch(p){const{status:f,conflicts:v,reason:m}=Ts(p);if(this.clearHold(),f===409&&m==="event_closed"){var d,u;(d=(u=this.opts).onSalesClosed)===null||d===void 0||d.call(u)}else if(f===409&&(v!=null&&v.length)){const g=new Set(v.map(k=>k.label)),b=this.idsForLabels(g);b.length&&(o.setStatus(b,"booked"),o.deselect(b),this.resetTableQuantitiesForLabels(g));const y=a.filter(k=>!g.has(k));y.length&&l&&this.api.release(this.key,y,l).catch(()=>{}),this.emitSelectionChange()}else l&&this.api.release(this.key,a,l).catch(()=>{});throw p}const h=this.idsForLabels(a);return h.length&&(o.setStatus(h,"booked"),o.deselect(h)),this.clearHold(),this.resetTableQuantitiesForLabels(a),this.emitSelectionChange(),(s=(n=this.opts).onBook)===null||s===void 0||s.call(n,t),a}async release(){var t;const e=this.hold_;if(!e)return!0;try{const o=await this.api.release(this.key,e.labels,e.holdId);if(!this.releaseConfirmed(o,e.labels))return await this.resnapshot(),!1}catch(o){return this.emitError(o),!1}if(((t=this.hold_)===null||t===void 0?void 0:t.holdId)!==e.holdId)return!0;this.clearHold(),this.resetTableQuantitiesForLabels(e.labels);const i=this.idsForLabels(e.labels);if(i.length){var s,n;(s=this.renderer)===null||s===void 0||s.deselect(i),(n=this.renderer)===null||n===void 0||n.setStatus(i,"free")}return!0}async releaseLabels(t){var e,i;const s=this.hold_;if(!s)return!0;const n=t.filter(d=>s.labels.includes(d));if(!n.length)return!0;try{const d=await this.api.release(this.key,n,s.holdId);if(!this.releaseConfirmed(d,n))return await this.resnapshot(),!1}catch(d){return this.emitError(d),!1}if(((e=this.hold_)===null||e===void 0?void 0:e.holdId)!==s.holdId)return!0;const o=s.labels.filter(d=>!n.includes(d)),a=(i=s.items)===null||i===void 0?void 0:i.filter(d=>!n.includes(d.label));o.length?this.setHold({...s,labels:o,items:a}):this.clearHold(),this.resetTableQuantitiesForLabels(n);const r=this.idsForLabels(n);if(r.length){var l,c;(l=this.renderer)===null||l===void 0||l.deselect(r),(c=this.renderer)===null||c===void 0||c.setStatus(r,"free")}return!0}releaseConfirmed(t,e){const i=t==null?void 0:t.released;return!Array.isArray(i)||e.every(s=>i.includes(s))}setStatus(t,e){var i;(i=this.renderer)===null||i===void 0||i.setStatus(t,e)}getStatus(t){var e;return(e=this.renderer)===null||e===void 0?void 0:e.getStatus(t)}notForSaleCategorySeatIds(){const t=this.doc;if(!t)return[];const e=new Set(t.categories.filter(s=>s.notForSale).map(s=>s.key));if(!e.size)return[];const i=[];for(const[s,n]of this.seatById)e.has(n.categoryKey)&&i.push(s);return i}flashSeat(t,e){var i;(i=this.renderer)===null||i===void 0||i.flashSeat(t,e)}zoomIn(){var t;(t=this.renderer)===null||t===void 0||t.zoomIn()}zoomOut(){var t;(t=this.renderer)===null||t===void 0||t.zoomOut()}zoomToFit(){var t;(t=this.renderer)===null||t===void 0||t.zoomToFit()}refitCurrentView(){var t,e;!((t=this.renderer)===null||t===void 0)&&t.refitCurrentView?this.renderer.refitCurrentView():(e=this.renderer)===null||e===void 0||e.zoomToFit()}worldToScreen(t){var e,i;return(e=(i=this.renderer)===null||i===void 0?void 0:i.worldToScreen(t))!==null&&e!==void 0?e:{x:0,y:0}}setSelectionFocus(t){var e,i;(e=this.renderer)===null||e===void 0||(i=e.setSelectionFocus)===null||i===void 0||i.call(e,t)}setAccessibilityFilter(t){var e,i;(e=this.renderer)===null||e===void 0||(i=e.setAccessibilityFilter)===null||i===void 0||i.call(e,t)}setCommercialLimitedFilter(t){var e,i;(e=this.renderer)===null||e===void 0||(i=e.setCommercialLimitedFilter)===null||i===void 0||i.call(e,t)}getFloors(){var t,e,i;return(t=(e=this.renderer)===null||e===void 0||(i=e.getFloors)===null||i===void 0?void 0:i.call(e))!==null&&t!==void 0?t:[]}getActiveFloorId(){var t,e,i;return(t=(e=this.renderer)===null||e===void 0||(i=e.getActiveFloorId)===null||i===void 0?void 0:i.call(e))!==null&&t!==void 0?t:""}setFloor(t){var e,i,s,n;const o=this.renderer;!(o!=null&&o.setActiveFloor)||t===((e=o.getActiveFloorId)===null||e===void 0?void 0:e.call(o))&&!(!((i=o.isFloorOverview)===null||i===void 0)&&i.call(o))||((s=o.setFloorOverview)===null||s===void 0||s.call(o,!1),(n=o.setStacked)===null||n===void 0||n.call(o,!1),o.setActiveFloor(t),this.resnapshot(),this.emitSelectionChange())}setStacked(t){var e;const i=this.renderer;!(i!=null&&i.setStacked)||t===((e=i.isStacked)===null||e===void 0?void 0:e.call(i))||(i.setStacked(t),this.resnapshot())}isMultiFloor(){var t,e;return((t=(e=this._doc)===null||e===void 0||(e=e.floors)===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)>1}setFloorOverview(t){var e;const i=this.renderer;!(i!=null&&i.setFloorOverview)||t===((e=i.isFloorOverview)===null||e===void 0?void 0:e.call(i))||(i.setFloorOverview(t),this.resnapshot(),this.emitSelectionChange())}isFloorOverview(){var t,e,i;return(t=(e=this.renderer)===null||e===void 0||(i=e.isFloorOverview)===null||i===void 0?void 0:i.call(e))!==null&&t!==void 0?t:!1}handleDeckTap(t){var e,i,s,n,o,a;const r=this.renderer;r&&((e=r.setViewMode)===null||e===void 0||e.call(r,"flat"),(i=r.setFloorOverview)===null||i===void 0||i.call(r,!1),(s=r.setStacked)===null||s===void 0||s.call(r,!1),(n=r.setActiveFloor)===null||n===void 0||n.call(r,t),this.resnapshot(),this.emitSelectionChange(),(o=(a=this.opts).onDeckTap)===null||o===void 0||o.call(a,t))}setViewMode(t){var e,i;(e=this.renderer)===null||e===void 0||(i=e.setViewMode)===null||i===void 0||i.call(e,t)}getViewMode(){var t,e,i;return(t=(e=this.renderer)===null||e===void 0||(i=e.getViewMode)===null||i===void 0?void 0:i.call(e))!==null&&t!==void 0?t:"flat"}getRung(){var t,e,i;return(t=(e=this.renderer)===null||e===void 0||(i=e.getRung)===null||i===void 0?void 0:i.call(e))!==null&&t!==void 0?t:"seats"}setRung(t){var e,i;if(t==="zones"){this.overview();return}(e=this.renderer)===null||e===void 0||(i=e.setRung)===null||i===void 0||i.call(e,t)}setCategoryFilter(t){var e,i;(e=this.renderer)===null||e===void 0||(i=e.setCategoryFilter)===null||i===void 0||i.call(e,t)}focusCategoryFilter(t){var e,i,s;const n=this.renderer;if(n){if((e=n.clearSectionFocus)===null||e===void 0||e.call(n),(i=(s=this.opts).onSectionFocus)===null||i===void 0||i.call(s,null),t!=null&&t.length){const o=this.floorForCategories(t);o&&this.setFloor(o)}n.focusCategories?n.focusCategories(t):n.zoomToFit()}}floorForCategories(t){var e,i;const s=this._doc;if(!(s!=null&&s.floors)||s.floors.length<2)return null;const n=new Set(t),o=l=>l.some(c=>{var d;return c.type==="row"&&(n.has(c.categoryKey)||((d=c.overrides)!==null&&d!==void 0?d:[]).some(u=>u.categoryKey!=null&&n.has(u.categoryKey)))||c.type==="gaArea"&&n.has(c.categoryKey)}),a=this.getActiveFloorId(),r=s.floors.find(l=>l.id===a);return r&&o(r.objects)?null:(e=(i=s.floors.find(l=>o(l.objects)))===null||i===void 0?void 0:i.id)!==null&&e!==void 0?e:null}getViewport(){const t=this.renderer;return!(t!=null&&t.getVisibleWorldRect)||!t.getWorldBounds?null:{visible:t.getVisibleWorldRect(),bounds:t.getWorldBounds()}}getMinimapSnapshot(){var t,e,i;return(t=(e=this.renderer)===null||e===void 0||(i=e.getMinimapSnapshot)===null||i===void 0?void 0:i.call(e))!==null&&t!==void 0?t:{sections:[],seats:[]}}panToWorld(t){var e,i;(e=this.renderer)===null||e===void 0||(i=e.panToWorld)===null||i===void 0||i.call(e,t)}clearSectionFocus(){var t,e,i,s;(t=this.renderer)===null||t===void 0||(e=t.clearSectionFocus)===null||e===void 0||e.call(t),(i=(s=this.opts).onSectionFocus)===null||i===void 0||i.call(s,null)}getRenderedQualityEvidence(){var t,e;return(t=(e=this.renderer)===null||e===void 0?void 0:e.getRenderedQualityEvidence())!==null&&t!==void 0?t:null}focusSection(t){this.handleSectionTap(t)}getSectionSeatCount(t){var e,i,s;return(e=(i=this.renderer)===null||i===void 0||(s=i.sectionMembers)===null||s===void 0||(s=s.call(i,t))===null||s===void 0?void 0:s.length)!==null&&e!==void 0?e:0}overview(){var t,e,i,s,n;(t=this.renderer)===null||t===void 0||(e=t.clearSectionFocus)===null||e===void 0||e.call(t),(i=this.renderer)===null||i===void 0||i.zoomToFit(),(s=(n=this.opts).onSectionFocus)===null||s===void 0||s.call(n,null)}handleSectionTap(t){var e,i,s;const n=this.renderer;if(n){if(n.focusSection?n.focusSection(t):(e=n.focusRegion)===null||e===void 0||e.call(n,t),this.isSectionClosed(t)){var o,a;(o=(a=this.opts).onSectionFocus)===null||o===void 0||o.call(a,null);return}(i=(s=this.opts).onSectionFocus)===null||i===void 0||i.call(s,this.sectionSummary(t))}}sectionSummary(t){var e,i,s,n,o,a,r,l,c;const d=this.renderer,u=this._doc;if(!d||!u)return null;const h=u.objects.find(L=>L.type==="section"&&L.id===t);if(!h)return null;const p=(e=(i=d.sectionMembers)===null||i===void 0?void 0:i.call(d,t))!==null&&e!==void 0?e:[],f=new Map,v=new Set;let m=0;for(const L of p){const I=this.seatById.get(L);if(!I)continue;const M=this.groupedTableBySeatId.get(L);if(M){var g,b,y;if(v.has(M.label))continue;v.add(M.label),f.set(M.categoryKey,((g=f.get(M.categoryKey))!==null&&g!==void 0?g:0)+M.maxOccupancy),d.getStatus((b=(y=M.chairs[0])===null||y===void 0?void 0:y.id)!==null&&b!==void 0?b:L)==="free"&&(m+=M.maxOccupancy)}else{var k;f.set(I.categoryKey,((k=f.get(I.categoryKey))!==null&&k!==void 0?k:0)+1),d.getStatus(L)==="free"&&m++}}const w=[...f.entries()].map(([L,I])=>{var M,x,A,P;const N=u.categories.find(j=>j.key===L),W=!(N==null||(M=N.tiers)===null||M===void 0)&&M.length?N.tiers.map(j=>j.price):[(x=N==null?void 0:N.price)!==null&&x!==void 0?x:0],B=Math.min(...W),z=Math.max(...W);return{key:L,count:I,label:(A=N==null?void 0:N.label)!==null&&A!==void 0?A:L,color:(P=N==null?void 0:N.color)!==null&&P!==void 0?P:"#6e7bff",price:B,priceMin:B,priceMax:z}}).sort((L,I)=>L.price-I.price),C=w.map(L=>L.priceMin),S=w.map(L=>L.priceMax),T=h.zone?(s=u.zones)===null||s===void 0?void 0:s.find(L=>L.id===h.zone):void 0,E=(n=(o=(a=h.color)!==null&&a!==void 0?a:T==null?void 0:T.color)!==null&&o!==void 0?o:(r=w[0])===null||r===void 0?void 0:r.color)!==null&&n!==void 0?n:"#6e7bff";return{id:t,label:(l=h.displayLabel)!==null&&l!==void 0?l:h.label,zoneLabel:(c=T==null?void 0:T.label)!==null&&c!==void 0?c:"",...h.entrance&&h.entrance.trim()?{entrance:h.entrance.trim()}:{},color:E,seatsLeft:m,priceMin:C.length?Math.min(...C):0,priceMax:S.length?Math.max(...S):0,categories:w}}destroy(){var t;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}(t=this.renderer)===null||t===void 0||t.destroy(),this.renderer=null}toSeat(t){var e;const i=this.groupedTableBySeatId.get(t.id);if(i)return this.toTableSeat(i);const s=t.commercial?{commercial:t.commercial}:void 0,n=t.displayLabel?{displayLabel:t.displayLabel}:void 0,o=!((e=t.accessibility)===null||e===void 0)&&e.length?{accessibility:t.accessibility}:void 0,a=t.wheelchairSpaceType?{wheelchairSpaceType:t.wheelchairSpaceType}:void 0,r=this.seatContext.get(t.id),l=this.tiersForSeat(t),c=this.seatTierResolution(t);if(c.kind!=="resolved"||!l)return{id:t.id,label:t.label,...n,...r,categoryKey:t.categoryKey,price:this.priceFor(t.categoryKey),currency:this.currency,...s,...o,...a};const d=c.tier;return{id:t.id,label:t.label,...n,...r,categoryKey:t.categoryKey,price:d.price,currency:this.currency,tiers:l,tierId:d.id,...s,...o,...a}}toTableSeat(t){var e,i,s,n,o,a,r;const l=t.chairs[0],c=(e=this.tiersFor(t.categoryKey))===null||e===void 0?void 0:e.filter(h=>Pi(this._doc,this.tableTierSeat(t),h.id).kind==="resolved"),d=this.tableTierResolution(t),u=d.kind==="resolved"?d.tier:void 0;return{id:(i=l==null?void 0:l.id)!==null&&i!==void 0?i:t.objectId,label:t.label,displayLabel:(s=t.displayLabel)!==null&&s!==void 0?s:t.label,...t.displayType?{displayType:t.displayType,rowType:t.displayType}:{},objectId:t.objectId,sectionLabel:l?(n=this.seatContext.get(l.id))===null||n===void 0?void 0:n.sectionLabel:void 0,rowLabel:(o=t.displayLabel)!==null&&o!==void 0?o:t.label,categoryKey:t.categoryKey,price:(a=u==null?void 0:u.price)!==null&&a!==void 0?a:this.priceFor(t.categoryKey),currency:this.currency,...c?{tiers:c,tierId:u==null?void 0:u.id}:{},objectType:"table",bookingMode:t.mode,quantity:(r=this.tableQuantities.get(t.label))!==null&&r!==void 0?r:t.mode==="whole"?t.capacity:t.minOccupancy,capacity:t.capacity,minOccupancy:t.minOccupancy,maxOccupancy:t.maxOccupancy,physicalSeatIds:t.chairs.map(h=>h.id)}}describeSeat(t){var e,i,s,n,o;const a=(e=this._doc)===null||e===void 0?void 0:e.categories.find(r=>r.key===t.categoryKey);return{...this.toSeat(t),categoryLabel:(i=a==null?void 0:a.label)!==null&&i!==void 0?i:t.categoryKey,categoryColor:(s=a==null?void 0:a.color)!==null&&s!==void 0?s:"#6e7bff",status:(n=(o=this.renderer)===null||o===void 0?void 0:o.getStatus(t.id))!==null&&n!==void 0?n:"free",currency:this.currency,...this.seatContext.get(t.id)}}priceFor(t){var e,i;return(e=(i=this._doc)===null||i===void 0||(i=i.categories.find(s=>s.key===t))===null||i===void 0?void 0:i.price)!==null&&e!==void 0?e:0}tiersFor(t){var e;const i=(e=this._doc)===null||e===void 0||(e=e.categories.find(s=>s.key===t))===null||e===void 0?void 0:e.tiers;return i&&i.length?i:void 0}tiersForSeat(t){if(!this._doc)return;const e=Pp(this._doc,t);return e.length?e:void 0}seatTierResolution(t){return this._doc?Pi(this._doc,t,this.seatTiers.get(t.id)):{kind:"none"}}tableTierSeat(t){return{label:t.label,categoryKey:t.categoryKey,accessibility:t.chairs.flatMap(e=>{var i;return(i=e.accessibility)!==null&&i!==void 0?i:[]})}}tableTierResolution(t){var e,i;if(!this._doc)return{kind:"none"};const s=(e=(i=t.chairs[0])===null||i===void 0?void 0:i.id)!==null&&e!==void 0?e:"";return Pi(this._doc,this.tableTierSeat(t),this.seatTiers.get(s))}setSeatTier(t,e){const i=this.seatById.get(t);if(!i)return;const s=this.tiersForSeat(i);if(s){if(e==null)this.seatTiers.delete(t);else if(s.some(n=>n.id===e))this.seatTiers.set(t,e);else return;this.emitSelectionChange(),this.hold_&&(this.hold_={...this.hold_,seats:this.seatsForLabels(this.hold_.labels)})}}seatsForLabels(t){const e=[];for(const i of t){const s=this.labelToSeat.get(i);s&&e.push(this.toSeat(s))}return e}emitSelectionChange(){var t,e;const i=this.getSelection();(t=(e=this.opts).onSelectionChange)===null||t===void 0||t.call(e,i),this.emitSelectionValidity(),this.emitOrphanHint()}emitSelectionValidity(){var t,e;const i=this.getSelectionValidity();if(i){if((t=(e=this.opts).onSelectionValidityChange)===null||t===void 0||t.call(e,i),i.isValid){var s,n;this.lastSelectionValidity!==!0&&((s=(n=this.opts).onSelectionValid)===null||s===void 0||s.call(n,i.seats))}else if(this.lastSelectionValidity!==!1){var o,a;(o=(a=this.opts).onSelectionInvalid)===null||o===void 0||o.call(a,i)}this.lastSelectionValidity=i.isValid}}ticketIssue(t){if(!this._doc)return null;const e=t?this.seatsForLabels(t):this.getSelection();return Fp(this._doc,e.map(i=>({label:i.label,...i.tierId?{tierId:i.tierId}:{}})))}emitOrphanHint(){if(!this.opts.onHint)return;const t=this.renderer;if(!t)return;const e=this.ticketIssue();if(e){this.hintShown=!0,this.opts.onHint(e.code==="companion_pair_required"?V("picker.companionPairRequired"):"That ticket choice is not available for the selected seat.");return}const i=new Set(t.getSelection().map(s=>s.id));(i.size?Tr(this.seatById.values(),s=>t.getStatus(s),i):[]).length>0?(this.hintShown=!0,this.opts.onHint(V("picker.orphanHint"))):this.hintShown&&(this.hintShown=!1,this.opts.onHint(null))}setColorblindSafe(t){var e,i;(e=this.renderer)===null||e===void 0||(i=e.setColorblindSafe)===null||i===void 0||i.call(e,t)}emitError(t){this.opts.onError?this.opts.onError(t):console.error("[picker]",t)}holdCovers(t){var e,i;const s=this.hold_;if(!s||s.labels.length!==t.length||!t.every(a=>s.labels.includes(a)))return!1;const n=new Map(((e=s.items)!==null&&e!==void 0?e:[]).map(a=>[a.label,a.tierId])),o=new Map(((i=s.items)!==null&&i!==void 0?i:[]).map(a=>{var r;return[a.label,(r=a.quantity)!==null&&r!==void 0?r:1]}));return t.every(a=>{var r;const l=this.labelToSeat.get(a),c=l?this.toSeat(l):null,d=(r=c==null?void 0:c.tierId)!==null&&r!==void 0?r:null;return((c==null?void 0:c.objectType)!=="table"||(c.bookingMode!=="variable"||this.confirmedVariableTables.has(a))&&(!o.has(a)||o.get(a)===c.quantity))&&(!n.has(a)||n.get(a)===d)})}handle409Conflicts(t){const{status:e,conflicts:i}=Ts(t);if(e!==409||!(i!=null&&i.length))return;const s=this.renderer;if(!s)return;const n=this.idsForLabels(i.map(o=>o.label));n.length&&(s.deselect(n),s.setStatus(n,"held"),this.resetTableQuantitiesForLabels(i.map(o=>o.label))),this.emitSelectionChange()}setHold(t,e="created"){var i,s,n,o,a,r,l;for(const h of(i=t.items)!==null&&i!==void 0?i:[])if(this.groupedTablesByLabel.has(h.label)&&h.quantity!=null){var c;this.tableQuantities.set(h.label,h.quantity),((c=this.groupedTablesByLabel.get(h.label))===null||c===void 0?void 0:c.mode)==="variable"&&this.confirmedVariableTables.add(h.label)}const d={...t,seats:this.seatsForLabels(t.labels)};this.hold_=d,(s=this.renderer)===null||s===void 0||(n=s.setOwnedHold)===null||n===void 0||n.call(s,this.idsForLabels(d.labels)),this.expiryTimer&&clearTimeout(this.expiryTimer);const u=Math.max(0,d.expiresAt-Date.now());this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},u),e==="restored"?(o=(a=this.opts).onHoldRestored)===null||o===void 0||o.call(a,d):(r=(l=this.opts).onHold)===null||r===void 0||r.call(l,d)}clearHold(){var t,e;this.hold_=null,(t=this.renderer)===null||t===void 0||(e=t.setOwnedHold)===null||e===void 0||e.call(t,null),this.expiryTimer&&(clearTimeout(this.expiryTimer),this.expiryTimer=null)}async expireActiveHold(){var t,e,i;const s=this.hold_;if(s){try{var n,o;const r=await this.api.objects(this.key);if(((n=this.hold_)===null||n===void 0?void 0:n.holdId)!==s.holdId)return;this.applySeatsMap(r.seats,(o=r.default)!==null&&o!==void 0?o:"free")}catch{var a;((a=this.hold_)===null||a===void 0?void 0:a.holdId)===s.holdId&&(this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},2e3));return}if(((t=this.hold_)===null||t===void 0?void 0:t.holdId)===s.holdId){if(s.labels.some(r=>this.statusOf(r)==="held")){this.expiryTimer=setTimeout(()=>{this.expireActiveHold()},1e3);return}this.clearHold(),(e=(i=this.opts).onHoldExpired)===null||e===void 0||e.call(i)}}}applySeatsMap(t,e="free"){var i,s,n,o,a;const r=this.renderer;if(!r)return;this.liveStatuses=new Map(Object.entries(t)),this.liveDefault=e;const l=zn(e);this.allIds.length&&r.setStatus(this.allIds,l),(i=r.setOwnedHold)===null||i===void 0||i.call(r,this.idsForLabels((s=(n=this.hold_)===null||n===void 0?void 0:n.labels)!==null&&s!==void 0?s:[]));const c={free:[],held:[],booked:[],not_for_sale:[]};for(const[u,h]of Object.entries(t))c[zn(h)].push(...this.idsForLabel(u));["free","held","booked","not_for_sale"].forEach(u=>{u!==l&&c[u].length&&r.setStatus(c[u],u)});const d=this.notForSaleCategorySeatIds();d.length&&r.setStatus(d,"not_for_sale"),this.clearBookedHoldIfSettled(),(o=(a=this.opts).onStatusChange)===null||o===void 0||o.call(a)}statusOf(t){var e;return(e=this.liveStatuses.get(t))!==null&&e!==void 0?e:this.liveDefault}clearBookedHoldIfSettled(){const t=this.hold_;t!=null&&t.labels.every(e=>this.statusOf(e)==="booked")&&(this.clearHold(),this.resetTableQuantitiesForLabels(t.labels))}async resnapshot(){try{var t;const e=await this.api.objects(this.key);this.applySeatsMap(e.seats,(t=e.default)!==null&&t!==void 0?t:"free")}catch{}}async refresh(){await this.resnapshot()}attachVisibilityListener(){if(this.onVisibilityChange||typeof document=="undefined"||typeof document.addEventListener!="function")return;const t=()=>{this.closed||document.visibilityState==="visible"&&this.resnapshot().then(()=>{var e;this.closed||(e=this.renderer)===null||e===void 0||e.forceDraw()})};this.onVisibilityChange=t,document.addEventListener("visibilitychange",t)}detachVisibilityListener(){this.onVisibilityChange&&(typeof document!="undefined"&&typeof document.removeEventListener=="function"&&document.removeEventListener("visibilitychange",this.onVisibilityChange),this.onVisibilityChange=null)}realtimeSink(){return{applyStatuses:t=>this.applyStatusChanges(t),applyProjection:t=>this.applySeatsMap(t.exceptions,t.default),resync:()=>this.resnapshot(),onSections:(t,e)=>{var i,s;const n=this.syncHidden(t),o=this.syncClosed(e);n&&this.resnapshot(),(n||o)&&((i=(s=this.opts).onStatusChange)===null||i===void 0||i.call(s))}}}applyStatusChanges(t){var e,i;const s=this.renderer;if(s){for(const o of t){var n;this.liveStatuses.set(o.label,o.status);const a=this.idsForLabel(o.label);if(!a.length)continue;const r=zn(o.status);this.opts.flashOnLiveChange&&r!=="free"&&a.some(l=>s.getStatus(l)==="free")&&!(!((n=this.hold_)===null||n===void 0)&&n.labels.includes(o.label))&&a.forEach(l=>s.flashSeat(l,r==="held"?"#f4b740":"#f43f5e")),s.setStatus(a,r)}this.opts.keepLiveWhileHidden&&typeof document!="undefined"&&document.visibilityState==="hidden"&&s.forceDraw(),this.clearBookedHoldIfSettled(),(e=(i=this.opts).onStatusChange)===null||e===void 0||e.call(i)}}connect(){if(this.closed)return;const t=this.api.socketUrl(this.key);if(!t)return;if(!this.realtime&&this.api.createRealtime){let n=null;try{n=this.api.createRealtime(this.key,this.realtimeSink())}catch{n=null}if(n){this.realtime=n,n.start();return}}if(this.realtime)return;let e;try{var i,s;const n=(i=(s=this.api).socketProtocols)===null||i===void 0?void 0:i.call(s,this.key);e=n&&n.length?new WebSocket(t,n):new WebSocket(t)}catch{this.scheduleReconnect();return}this.ws=e,e.onopen=()=>{this.attempt=0,this.resnapshot()},e.onmessage=n=>{let o;try{o=JSON.parse(typeof n.data=="string"?n.data:"")}catch{return}if(!this.renderer||!o||typeof o!="object")return;const a=o;if(Array.isArray(a.hidden)&&this.syncHidden(a.hidden)){var r,l;this.resnapshot(),(r=(l=this.opts).onStatusChange)===null||r===void 0||r.call(l)}if(Array.isArray(a.closed)&&this.syncClosed(a.closed)){var c,d;(c=(d=this.opts).onStatusChange)===null||c===void 0||c.call(d)}a.type!=="hidden"&&(a.seats&&typeof a.seats=="object"?this.applySeatsMap(a.seats):Array.isArray(a.changes)&&this.applyStatusChanges(a.changes))},e.onclose=()=>{this.ws===e&&(this.ws=null),this.scheduleReconnect()},e.onerror=()=>{try{e.close()}catch{}}}scheduleReconnect(){if(this.closed||this.reconnectTimer)return;const t=Ep(Math.min(this.attempt++,5),{baseMs:1e3,maxMs:jp,jitter:1});this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}},vg=5,Wp=-1.1;function Kp(t,e){const i=t-lt;let s=Math.atan2(5-i,e)*180/Math.PI,n=Math.atan2(Wp-i,e)*180/Math.PI;return n<-35&&(s+=-35-n,n=-35),{topPitch:s,basePitch:n}}var Yp=1024,Xp=Wi,ti=Math.PI*2,mg=Yp/180;function Zp(t){let e=2166136261;for(let i=0;i>>0}function Qp(t){let e=t>>>0;return()=>{e|=0,e=e+1831565813|0;let i=Math.imul(e^e>>>15,1|e);return i=i+Math.imul(i^i>>>7,61|i)^i,((i^i>>>14)>>>0)/4294967296}}var Jp=96,gg=360/Jp;function Ri(t,e,i){const s=(1-Math.abs(2*i-1))*e,n=(t%360+360)%360/60,o=s*(1-Math.abs(n%2-1));let a=0,r=0,l=0;n<1?[a,r,l]=[s,o,0]:n<2?[a,r,l]=[o,s,0]:n<3?[a,r,l]=[0,s,o]:n<4?[a,r,l]=[0,o,s]:n<5?[a,r,l]=[o,0,s]:[a,r,l]=[s,0,o];const c=i-s/2;return[Math.round((a+c)*255),Math.round((r+c)*255),Math.round((l+c)*255)]}function ef(t,e,i,s,n){const o=s*.1,a=i-s*.9,r=i-s*.74,l=i-s*.46,c=s*.13,d=s*.09,u=`rgba(${n.tone[0]},${n.tone[1]},${n.tone[2]},${n.alpha})`,h=t.createRadialGradient(e,i,1,e,i,s*.24);h.addColorStop(0,"rgba(0,0,0,0.4)"),h.addColorStop(1,"rgba(0,0,0,0)"),t.save(),t.scale(1,.28),t.fillStyle=h,t.beginPath(),t.ellipse(e,i/.28,s*.24,s*.24,0,0,ti),t.fill(),t.restore(),t.fillStyle=u,t.beginPath(),t.moveTo(e-d,l),t.lineTo(e-d*.7,i),t.lineTo(e-d*.1,i),t.lineTo(e-d*.1,l+s*.02),t.lineTo(e+d*.1,l+s*.02),t.lineTo(e+d*.1,i),t.lineTo(e+d*.7,i),t.lineTo(e+d,l),t.closePath(),t.fill(),t.beginPath(),t.moveTo(e-c,r),t.quadraticCurveTo(e-c*.9,l-s*.12,e-d,l),t.lineTo(e+d,l),t.quadraticCurveTo(e+c*.9,l-s*.12,e+c,r),t.quadraticCurveTo(e,r-s*.05,e-c,r),t.closePath(),t.fill(),t.lineCap="round",t.lineJoin="round",t.strokeStyle=u,t.lineWidth=s*.055;const p=r+s*.02;n.pose===1?(t.beginPath(),t.moveTo(e-c*.8,p),t.lineTo(e-c*1.5,i-s*1.02),t.moveTo(e+c*.8,p),t.lineTo(e+c*1.5,i-s*1.02),t.stroke()):n.pose===2?(t.beginPath(),t.moveTo(e-c*.8,p),t.lineTo(e+d*1.4,l-s*.02),t.moveTo(e+c*.8,p),t.lineTo(e-d*.4,l-s*.06),t.stroke(),t.fillStyle=u,t.beginPath(),t.ellipse(e+d*1.5,l-s*.04,s*.07,s*.09,-.5,0,ti),t.fill()):n.pose===3?(t.beginPath(),t.moveTo(e-c*.8,p),t.lineTo(e-c*.2,a+o*.6),t.moveTo(e+c*.8,p),t.lineTo(e+c*1.1,l),t.stroke(),t.lineWidth=s*.02,t.beginPath(),t.moveTo(e-c*.2,a+o*.9),t.lineTo(e-c*.2,i-s*.02),t.stroke()):(t.beginPath(),t.moveTo(e-c*.85,p),t.lineTo(e-c*.95,l+s*.02),t.moveTo(e+c*.85,p),t.lineTo(e+c*.95,l+s*.02),t.stroke()),t.fillStyle=u,t.fillRect(e-o*.34,a+o*.6,o*.68,o*.9),t.beginPath(),t.ellipse(e,a,o*.86,o*1.05,0,0,ti),t.fill(),n.rimStrength>.01&&(t.strokeStyle=`rgba(${n.rim[0]},${n.rim[1]},${n.rim[2]},${(.6*n.rimStrength).toFixed(3)})`,t.lineWidth=Math.max(1,s*.02),t.beginPath(),t.moveTo(e-c,r),t.lineTo(e-o*.6,a+o*.4),t.moveTo(e-o*.7,a),t.ellipse(e,a,o*.84,o*1.02,0,Math.PI*1.05,Math.PI*1.55),t.stroke())}function tf(t,e,i,s,n,o,a,r,l){t.save(),t.globalCompositeOperation="lighter";const c=t.createLinearGradient(0,i,0,n);c.addColorStop(0,`rgba(${r},${l})`),c.addColorStop(.5,`rgba(${r},${(l*.4).toFixed(3)})`),c.addColorStop(1,`rgba(${r},0)`),t.fillStyle=c,t.beginPath(),t.moveTo(e-o,i),t.lineTo(s-a,n),t.lineTo(s+a,n),t.lineTo(e+o,i),t.closePath(),t.fill(),t.restore()}function sf(t,e,i,s,n){const o=t.createRadialGradient(e,i,0,e,i,s*3);o.addColorStop(0,`rgba(${n},0.9)`),o.addColorStop(.4,`rgba(${n},0.35)`),o.addColorStop(1,`rgba(${n},0)`),t.fillStyle=o,t.beginPath(),t.arc(e,i,s*3,0,ti),t.fill(),t.fillStyle=`rgba(${n},1)`,t.beginPath(),t.arc(e,i,s,0,ti),t.fill()}var qe=480,ii=270,Dn=50,si=30,Mr=t=>(t+Dn)/(2*Dn)*qe,$i=t=>(si-t)/(2*si)*ii;function nf(t,e,i){var s;const n=document.createElement("canvas");n.width=qe,n.height=ii;const o=n.getContext("2d"),a=e.x-t.x,r=e.y-t.y,l=Math.max(2,Math.hypot(a,r)*Xp),c=Qp(Zp(`${t.id}|${Math.round(e.x)},${Math.round(e.y)}`)),d=210+c()*150,u=Ri(220+(c()-.5)*60,.55,.82),h=`${u[0]},${u[1]},${u[2]}`,p=o.createLinearGradient(0,0,0,ii);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,qe,ii);const f=Kp((s=t.eyeHeightM)!==null&&s!==void 0?s:lt,l),v=Math.min(Dn-2,Math.atan2(4,l)*180/Math.PI),m=Math.min(si-2,f.topPitch),g=Math.max(-28,f.basePitch),b=Mr(-v),y=Mr(v),k=$i(m),w=$i(g),C=y-b,S=w-k,T=Math.max(.35,Math.min(1,1-(l-6)/60)),E=$i(Math.min(si-1,m+8)),L=o.createRadialGradient(qe/2,(k+w)/2,4,qe/2,(k+w)/2,C*1.15);L.addColorStop(0,"rgba(255,214,150,0.34)"),L.addColorStop(.28,"rgba(150,150,230,0.3)"),L.addColorStop(.6,"rgba(99,102,241,0.12)"),L.addColorStop(1,"rgba(99,102,241,0)"),o.fillStyle=L,o.fillRect(b-C*.6,k-S*1.2,C*2.2,S*3.4);const I=Ri(d,.62,.55),M=Ri(d+40,.7,.5),x=Ri(d+70,.78,.52);o.save(),o.beginPath(),o.rect(b,k,C,S),o.clip();const A=o.createLinearGradient(0,k,0,w);A.addColorStop(0,`rgb(${I[0]},${I[1]},${I[2]})`),A.addColorStop(.5,`rgb(${M[0]},${M[1]},${M[2]})`),A.addColorStop(1,`rgb(${x[0]},${x[1]},${x[2]})`),o.globalAlpha=.8,o.fillStyle=A,o.fillRect(b,k,C,S),o.globalAlpha=1;const P=o.createRadialGradient(qe/2,(k+w)/2,C*.12,qe/2,(k+w)/2,C*.6);P.addColorStop(0,"rgba(6,8,14,0)"),P.addColorStop(.7,"rgba(6,8,14,0.15)"),P.addColorStop(1,"rgba(5,6,11,0.9)"),o.fillStyle=P,o.fillRect(b,k,C,S),o.restore();const N=3,W=w-S*.08;for(let G=0;G_r}),_r,af=rt((()=>{_r={"common.cancel":"Cancelar","common.close":"Cerrar","common.done":"Listo","common.copied":"✓ Copiado","picker.holdExpired":"Tu retención expiró — los asientos fueron liberados. Elige de nuevo.","picker.poweredBy":"Con la tecnología de SeatLayer","picker.testMode":"MODO DE PRUEBA","picker.orphanHint":"Esto deja un asiento aislado — considera desplazarte un asiento.","picker.companionRequiresWheelchair":"Requiere la plaza accesible contigua","picker.companionPairRequired":"Selecciona la plaza accesible contigua con cada entrada de acompañante.","map.aria":"Mapa de asientos. Usa las flechas para moverte entre asientos, Intro para seleccionar.","map.seatsLeft":"{count} LIBRES","map.soldOut":"AGOTADO","map.statusHeld":"En espera","map.statusTaken":"Ocupado","map.fromPrice":"DESDE {price}","picker.floor":"Piso","picker.zoomLevel":"Nivel de zoom","picker.rungTip.zones":"Vista general — grupos de secciones como Grada norte o VIP","picker.rungTip.sections":"Bloques de sección — las secciones agotadas y casi llenas se atenúan para ver la disponibilidad de un vistazo","picker.rungTip.seats":"Asientos individuales — los bloques se convierten en puntos","picker.rungLabel.zones":"ZONAS","picker.rungLabel.sections":"SECCIONES","picker.rungLabel.seats":"ASIENTOS","picker.sectionSummaryAria":"Resumen de sección {label}","picker.closeSectionSummary":"Cerrar resumen de sección","picker.seatsLeftInSection.one":"{count} asiento disponible","picker.seatsLeftInSection.other":"{count} asientos disponibles","picker.overview":"Descripción general","picker.entrance":"Entrada","picker.tapSeatHint":"Toca cualquier asiento para ver su vista","picker.ticketTierFor":"Categoría de entrada para {label}","picker.viewFromSeat":"Vista desde el asiento {label}","picker.real360":"REAL 360°","picker.preview":"VISTA PREVIA","picker.sightline":"≈ {m} m al escenario","picker.panorama360":"Foto de 360° del lugar","picker.illustrationCaption":"ilustración · ≈ {m} m del escenario","picker.restrictedView":"Visibilidad restringida","picker.obstructedView":"Visibilidad obstruida","picker.premiumSeat":"Asiento premium","picker.hideLimitedView":"Ocultar asientos con visibilidad limitada","picker.bestSeatsPremium":"Mejores asientos","picker.premiumFallbackNote":"No hay un bloque premium de {count}: mostrando los mejores disponibles","picker.loading3d":"Creando el recinto en 3D…","picker.unavailable3d":"No se pudo iniciar la vista 3D. El mapa de asientos sigue disponible.","picker.jumpToSection":"Ir a una sección","picker.salesClosedPill":"Las ventas están cerradas","picker.salesClosedCopy":"La venta de entradas para este evento ha finalizado.","picker.salesClosedCta":"Venta cerrada","picker.salesClosedToast":"Las ventas de este evento están cerradas.","picker.holdReassurance":"Tuyos durante {time} — aún no se te cobrará nada.","picker.securingSeats":"Asegurando tus asientos…","picker.openingCheckout":"Abriendo el pago seguro…","picker.peekSecured":"✓ {count} asegurados · {total} — aún no se te cobrará nada","picker.priceHint":"Los colores del plano son tipos de entrada — toca uno abajo para ver solo esos asientos.","picker.findTogetherInstead":"Buscar asientos juntos en su lugar","picker.keepMyPicks":"Mantener mi selección","picker.accessExpiredBody":"Vuelve a iniciar sesión o recarga la página para seguir viendo estos asientos. Lo que ya tengas retenido seguirá siendo tuyo.","picker.accessExpiredTitle":"Tu sesión de acceso ha finalizado","picker.accessInvalidBody":"Aún puedes reservar todo lo que aparezca como disponible. Contacta a quien te envió este enlace para acceder al resto.","picker.accessInvalidTitle":"No pudimos verificar tu acceso","picker.accessPausedBody":"El organizador ha pausado esta selección. Inténtalo de nuevo en unos minutos.","picker.accessPausedTitle":"Estos asientos están retenidos en este momento","picker.accessRetry":"Intentar de nuevo","picker.accessRevokedBody":"Pide a quien te envió aquí un nuevo enlace para seguir reservando estos asientos.","picker.accessRevokedTitle":"Este enlace de acceso ya no está activo","picker.accessiblePhysicalSeat":"Asiento físico accesible","picker.addTime":"Añadir tiempo","picker.addingEllipsis":"Añadiendo…","picker.allLevels":"Todos los niveles","picker.allPlacesBookedTogether":"Los {count} lugares se reservan juntos como una mesa exclusiva.","picker.allPrices":"Todos los precios","picker.allSeats":"Todos los asientos","picker.allSetTitle":"Todo listo","picker.anyTicketType":"Cualquier tipo de entrada","picker.anyVenueZone":"Cualquier zona del recinto","picker.areas":"Zonas","picker.available":"Disponible","picker.backToMap":"Volver al mapa","picker.backToVenue":"Volver al recinto","picker.bestSeatsStar":"✦ Mejores asientos","picker.booth":"Palco","picker.capacityGuests":"{count} invitados","picker.change":"Cambiar","picker.chartDerivedModel":"Modelo derivado del plano","picker.chartDerivedSeatEye":"3D en vivo · vista desde el asiento derivada del plano · no verificada","picker.checkConnection":"Comprueba tu conexión e inténtalo de nuevo.","picker.checkoutCouldNotBeOpened":"No se pudo abrir el pago. Tus asientos siguen retenidos — inténtalo de nuevo.","picker.chooseAnotherToCompare":"Elige otro asiento para comparar.","picker.chooseGuestsCopy":"Elige cuántos invitados se sentarán juntos. Esta mesa está reservada en exclusiva para tu grupo.","picker.chooseMinMaxGuests":"Elige entre {min} y {max} invitados","picker.clearSavedSeatComparison":"Borrar comparación de asientos guardada","picker.close":"Cerrar","picker.closeSeatStatus":"Cerrar estado del asiento","picker.closestGroupChosenInstantly":"El grupo disponible más cercano, elegido al instante.","picker.collapseTicketPanel":"Contraer el panel de entradas","picker.compareCount":"Comparar {count}","picker.compareWithSaved":"Comparar con el guardado","picker.confirmOrCancelSeat":"Confirma o cancela este asiento","picker.confirmSeatLabel":"Confirmar asiento {label}","picker.confirmYourTable":"Confirma tu mesa","picker.confirmedAndOnWay":"confirmados. Una confirmación está en camino.","picker.continue":"Continuar","picker.continueToCheckout":"Continuar al pago","picker.couldNotAddMoreTime":"No se pudo añadir más tiempo — dirígete al pago ahora.","picker.couldNotFindSeatsTogether":"No pudimos encontrar {count} asientos juntos. Prueba con menos asientos u otro tipo de entrada.","picker.couldNotReleaseTickets":"No se pudieron liberar tus entradas. Tu retención no ha cambiado.","picker.couldNotRemoveLabel":"No se pudo quitar {label}. Tu retención no ha cambiado.","picker.currentOffer":"Oferta actual","picker.currentTicketOffer":"Oferta de entradas actual","picker.dragToLookAround":"Arrastra para mirar alrededor · desplázate para hacer zoom","picker.emptyWheelchairSpace":"Espacio vacío para silla de ruedas","picker.exitFullScreen":"Salir de pantalla completa","picker.fewer":"Menos","picker.fewerGuests":"Menos invitados","picker.fewerSeats":"Menos asientos","picker.filterAndFocusByPrice":"Filtrar y enfocar asientos por precio","picker.filters":"Filtros","picker.findBestSeatsCount.one":"Buscar {count} mejor asiento","picker.findBestSeatsCount.other":"Buscar {count} mejores asientos","picker.findBestSeatsTogether":"Buscar los mejores asientos juntos","picker.findNewSeats":"Buscar nuevos asientos","picker.findingBestSeats":"Buscando los mejores asientos…","picker.findingEllipsis":"Buscando…","picker.fitToScreen":"Ajustar a la pantalla","picker.flat2dMap":"Mapa plano 2D","picker.flexiblePartyTypeWord":"Grupo flexible · {typeWord}","picker.fullScreen":"Pantalla completa","picker.generalAdmission":"Entrada general","picker.guestCountCouldNotBeSecured":"No se pudo asegurar ese número de invitados. Tu retención de mesa actual no ha cambiado.","picker.guestCountNoLongerAvailable":"Ese número de invitados ya no está disponible. Tu retención actual no ha cambiado.","picker.guests":"Invitados","picker.guestsCount":"{count} invitados","picker.guestsCountEdit":"{count} invitados · Editar","picker.held":"Retenido","picker.heldForYou":"Retenido para ti","picker.heldSeatExplanation":"Otro comprador está reteniendo este asiento. Puede volver a estar disponible.","picker.heldTicketsReleased":"Se liberaron las entradas retenidas. Elige tus nuevos asientos.","picker.heldTicketsRestored":"Tus entradas retenidas se han restaurado.","picker.hidePanel":"Ocultar panel","picker.hideTicketPanel":"Ocultar el panel de entradas","picker.holdSeatsAndCheckout":"Retener asientos y pagar","picker.howOfferWorks":"Cómo funciona la oferta «{name}»","picker.interactive3dVenueView":"Vista 3D interactiva del recinto","picker.keepMine":"Mantener los míos","picker.labelNoLongerAvailable":"{label} ya no está disponible.","picker.labelRemoved":"{label} eliminado.","picker.labelRemovedFromHold":"{label} eliminado de tu retención.","picker.labelRestored":"{label} restaurado.","picker.labelsNoLongerAvailable.one":"{labels} ya no está disponible. Elige otro asiento.","picker.labelsNoLongerAvailable.other":"{labels} ya no están disponibles. Elige otro grupo.","picker.leftCount.one":"quedan {count}","picker.leftCount.other":"quedan {count}","picker.levelNumber":"Nivel {number}","picker.levels":"Niveles","picker.liveAvailability":"Disponibilidad en vivo — los asientos se actualizan en tiempo real","picker.loadingSeatMap":"Cargando el mapa de asientos…","picker.lookAroundLive3d":"Mirar alrededor en 3D en vivo","picker.manualTicketsRemovedNote":"Tus entradas seleccionadas manualmente solo se eliminarán una vez que se asegure un nuevo grupo.","picker.map":"Mapa","picker.mapDidNotLoad":"El mapa de asientos no se pudo cargar","picker.maxTicketsForOrder":"Puedes seleccionar hasta {count} entradas para este pedido.","picker.selectExactMore":"Selecciona {count} más","picker.selectExactCount":"Selecciona exactamente {count} entradas","picker.selectMinimumMore":"Selecciona {count} más","picker.adjustSeatSelection":"Ajusta la selección de asientos","picker.selectSeatsTogether":"Elige asientos juntos en la misma fila y categoría.","picker.minToMaxGuests":"De {min} a {max} invitados","picker.more":"Más","picker.moreGuests":"Más invitados","picker.moreSeats":"Más asientos","picker.moreSelectedCount":"{count} más seleccionados","picker.moreTimeAdded":"Se añadió más tiempo — tus asientos siguen retenidos.","picker.noAccessibilityMetadata":"No hay información de accesibilidad disponible","picker.noAuthoredRestriction":"Sin restricción indicada por el organizador","picker.noSeatsSelected":"Ningún asiento seleccionado","picker.notChargedYet":"Aún no se te cobrará nada.","picker.notForSale":"No está a la venta","picker.notForSaleExplanation":"Este asiento no está incluido en la venta actual.","picker.numberOfGuests":"Número de invitados","picker.offerDetailActive":"Este precio se aplica automáticamente a los asientos elegibles. Las entradas en carritos activos reducen temporalmente la cantidad disponible; las retenciones liberadas o vencidas la devuelven. Cuando la oferta termine, se aplicará la siguiente oferta coincidente o el precio normal de la entrada.","picker.offerDetailUpcoming":"Las entradas están disponibles ahora a su precio normal. Esta oferta programada se aplicará automáticamente a los asientos elegibles cuando comience.","picker.offerRemainingAvailable":"{count} disponibles","picker.offerStarts":"comienza {time}","picker.offerUntil":"hasta {time}","picker.oneSeatSaved":"1 asiento guardado","picker.oneSeatSavedChooseAnother":"Un asiento guardado; elige otro para comparar","picker.openAuthored360":"Abrir vista 360° del recinto","picker.openComparison":"Abrir comparación","picker.openComparisonOfSeats":"Abrir comparación de {count} asientos","picker.openTicketPanel":"Abrir el panel de entradas","picker.peekFromPrice":"Desde {price}","picker.peekTicketsTotal.one":"{count} entrada · {total}","picker.peekTicketsTotal.other":"{count} entradas · {total}","picker.perGuestPrice":"{price} por invitado","picker.pickYourSeats":"Elige tus asientos","picker.preferredTicketType":"Tipo de entrada preferido","picker.preferredVenueZone":"Zona del recinto preferida","picker.priceNotSupplied":"Precio no indicado","picker.releaseHeldTickets":"Liberar entradas retenidas y elegir otros asientos","picker.releasingEllipsis":"Liberando…","picker.removeHeldTicketLabel":"Quitar entrada retenida {label}","picker.removeSeatLabel":"Quitar {label}","picker.removeTicketsUntilOrFewer":"Quita entradas hasta que tu pedido tenga {count} o menos.","picker.replaceCurrentChoices":"¿Reemplazar tu selección actual?","picker.review":"Revisar","picker.row":"Fila","picker.rowLabel":"Fila {label}","picker.saveToCompare":"Guardar para comparar","picker.savedForComparison":"Guardado para comparar","picker.savedSeatComparison":"Comparación de asientos guardada","picker.scheduledOffer":"Oferta programada","picker.seat":"Asiento","picker.seatCount.one":"{count} asiento","picker.seatCount.other":"{count} asientos","picker.seatJustTakenByAnother":"El asiento {label} acaba de ser tomado por otro comprador.","picker.seatLabel":"Asiento {label}","picker.seatNoLongerAvailable":"Ese asiento ya no está disponible.","picker.seatNoLongerYours":"Algunos asientos ya no están disponibles para ti. Se han eliminado de tu pedido.","picker.seatNumberLower":"asiento {label}","picker.seatSalesClosedForEvent":"La venta de asientos para este evento ha finalizado.","picker.seatSelection":"Selección de asientos","picker.seatStatusLegend":"Leyenda del estado de los asientos","picker.seatTaken":"Otro comprador tomó un asiento que habías elegido. Se ha eliminado de tu pedido.","picker.seatsHeldForNeedMoreTime":"Tus asientos están retenidos durante {time}. ¿Necesitas más tiempo?","picker.seatsJustTaken":"Se acaban de ocupar uno o más asientos. Vuelve a elegir.","picker.seatsJustTakenInCategory.one":"{count} asiento recién ocupado en {label} · quedan {left}","picker.seatsJustTakenInCategory.other":"{count} asientos recién ocupados en {label} · quedan {left}","picker.seatsNoLongerAvailableTryAnother":"Esos asientos ya no están disponibles. Prueba otra cantidad o tipo de entrada.","picker.seatsSecured":"Asientos asegurados","picker.seatsSelectedCount.one":"{count} seleccionado","picker.seatsSelectedCount.other":"{count} seleccionados","picker.section":"Sección","picker.secureMore":"Asegurar más","picker.secureMoreAndCheckout":"Asegurar {count} más y pagar","picker.securedCount":"{count} asegurados","picker.seeItIn3d":"Verlo en 3D","picker.select":"Seleccionar","picker.selectSeats":"Seleccionar asientos","picker.selectTable":"Seleccionar mesa","picker.selectWholeTable":"Seleccionar mesa completa","picker.selected":"Seleccionado","picker.selectingEllipsis":"Seleccionando…","picker.showAllSeats":"Mostrar todos los asientos","picker.showAllTicketTypes":"Mostrar los {count} tipos de entrada","picker.showFewer":"Mostrar menos","picker.showLabelSeatsOnMap":"Mostrar los asientos de {label} en el mapa","picker.showTicketPanel":"Mostrar el panel de entradas","picker.sold":"Vendido","picker.soldOutCopy":"No hay asientos reservados disponibles actualmente para este evento.","picker.soldOutEyebrow":"Este evento","picker.soldOutTitle":"Agotado","picker.soldSeatExplanation":"Este asiento ya ha sido reservado.","picker.statusAvailable":"disponible","picker.statusOnHold":"en espera","picker.statusTaken2":"ocupado","picker.table":"Mesa","picker.tableCapacity":"Capacidad de la mesa","picker.tableUpdatedForGuests":"{label} actualizado para {count} invitados.","picker.temporarilyHeld":"Retenido temporalmente","picker.ticketPrices":"Precios de entradas","picker.ticketTypeSoldOut":"Ese tipo de entrada está agotado. Prueba con otro tipo de entrada.","picker.tickets":"Entradas","picker.ticketsCount.one":"{count} entrada","picker.ticketsCount.other":"{count} entradas","picker.toggleColorblindColors":"Alternar colores para daltónicos","picker.total":"Total","picker.trayHintTapOrBest":"Toca un asiento en el mapa, o deja que elijamos los mejores disponibles por ti.","picker.trayHintTapOrStanding":"Toca un asiento en el mapa — o consigue entradas de pie abajo.","picker.undo":"Deshacer","picker.upcomingTicketOffer":"Próxima oferta de entradas","picker.updateTable":"Actualizar mesa","picker.updatingEllipsis":"Actualizando…","picker.venueView":"Vista del recinto","picker.viewFromHere":"Vista desde aquí","picker.viewFromThisSeat":"Vista desde este asiento","picker.wholeTypeWord":"{typeWord} completo","picker.willChooseClosestGroup":"Elegiremos el grupo disponible más cercano por ti.","picker.willFindSeatsTogether":"Buscaremos {count} asientos juntos.","picker.yourSeats":"Tus asientos","picker.zoomIn":"Acercar","picker.zoomOut":"Alejar","picker.closeVenueNav":"Cerrar","picker.levelsAndAreas":"Niveles y zonas"}})),rf=Ui({de:()=>Pr}),Pr,lf=rt((()=>{Pr={"common.cancel":"Abbrechen","common.close":"Schließen","common.done":"Fertig","common.copied":"✓ Kopiert","picker.holdExpired":"Ihre Reservierung ist abgelaufen — die Plätze wurden freigegeben. Bitte erneut auswählen.","picker.poweredBy":"Bereitgestellt von SeatLayer","picker.testMode":"TESTMODUS","picker.orphanHint":"Dadurch bleibt ein einzelner Platz übrig — rücken Sie ggf. einen Platz weiter.","picker.companionRequiresWheelchair":"Benachbarter Rollstuhlplatz erforderlich","picker.companionPairRequired":"Wählen Sie zu jedem Begleitticket den benachbarten Rollstuhlplatz aus.","map.aria":"Sitzplan. Mit Pfeiltasten zwischen Plätzen navigieren, Eingabe zum Auswählen.","map.seatsLeft":"{count} FREI","map.soldOut":"AUSVERKAUFT","map.statusHeld":"Reserviert","map.statusTaken":"Vergeben","map.fromPrice":"AB {price}","picker.floor":"Etage","picker.zoomLevel":"Zoomstufe","picker.rungTip.zones":"Übersicht — Bereichsgruppen wie Nordtribüne oder VIP","picker.rungTip.sections":"Bereichs-Blöcke — ausverkaufte und fast volle Bereiche werden abgedunkelt, um die Verfügbarkeit auf einen Blick zu zeigen","picker.rungTip.seats":"Einzelne Plätze — Blöcke lösen sich zu Punkten auf","picker.rungLabel.zones":"ZONEN","picker.rungLabel.sections":"BEREICHE","picker.rungLabel.seats":"PLÄTZE","picker.sectionSummaryAria":"Bereichszusammenfassung {label}","picker.closeSectionSummary":"Bereichszusammenfassung schließen","picker.seatsLeftInSection.one":"{count} Platz verfügbar","picker.seatsLeftInSection.other":"{count} Plätze verfügbar","picker.overview":"Übersicht","picker.entrance":"Eingang","picker.tapSeatHint":"Tippen Sie auf einen Platz, um die Ansicht zu prüfen","picker.ticketTierFor":"Ticketklasse für {label}","picker.viewFromSeat":"Ansicht von Platz {label}","picker.real360":"REAL 360°","picker.preview":"VORSCHAU","picker.sightline":"≈ {m} m zur Bühne","picker.panorama360":"360°-Veranstaltungsfotos","picker.illustrationCaption":"Illustration · ≈ {m} m von der Bühne","picker.restrictedView":"Eingeschränkte Sicht","picker.obstructedView":"Sichtbehinderung","picker.premiumSeat":"Premium-Platz","picker.hideLimitedView":"Plätze mit eingeschränkter Sicht ausblenden","picker.bestSeatsPremium":"Beste Plätze","picker.premiumFallbackNote":"Kein Premium-Block mit {count} Plätzen — beste verfügbare werden angezeigt","picker.loading3d":"3D-Veranstaltungsort wird aufgebaut…","picker.unavailable3d":"3D konnte nicht gestartet werden. Der Sitzplan bleibt verfügbar.","picker.jumpToSection":"Zum Bereich springen","picker.salesClosedPill":"Der Verkauf ist beendet","picker.salesClosedCopy":"Der Ticketverkauf für diese Veranstaltung ist beendet.","picker.salesClosedCta":"Verkauf beendet","picker.salesClosedToast":"Der Verkauf für diese Veranstaltung ist beendet.","picker.holdReassurance":"Für {time} reserviert — noch wird nichts abgebucht.","picker.securingSeats":"Ihre Plätze werden gesichert…","picker.openingCheckout":"Sicherer Checkout wird geöffnet…","picker.peekSecured":"✓ {count} gesichert · {total} — noch wird nichts abgebucht","picker.priceHint":"Die Farben auf dem Plan sind Ticketkategorien — tippen Sie eine an, um nur diese Plätze zu sehen.","picker.findTogetherInstead":"Stattdessen Plätze nebeneinander finden","picker.keepMyPicks":"Meine Auswahl behalten","picker.accessExpiredBody":"Melden Sie sich erneut an oder laden Sie die Seite neu, um diese Plätze weiter durchzusehen. Bereits gehaltene Plätze bleiben Ihnen erhalten.","picker.accessExpiredTitle":"Ihre Zugangssitzung ist beendet","picker.accessInvalidBody":"Sie können weiterhin alles buchen, was als verfügbar angezeigt wird. Wenden Sie sich für Zugang zum Rest an die Person, die Ihnen den Link geschickt hat.","picker.accessInvalidTitle":"Ihr Zugang konnte nicht bestätigt werden","picker.accessPausedBody":"Der Veranstalter hat diese Auswahl pausiert. Versuchen Sie es in ein paar Minuten erneut.","picker.accessPausedTitle":"Diese Plätze sind gerade reserviert","picker.accessRetry":"Erneut versuchen","picker.accessRevokedBody":"Bitten Sie die Person, die Ihnen diesen Link geschickt hat, um einen neuen, um weiter buchen zu können.","picker.accessRevokedTitle":"Dieser Zugangslink ist nicht mehr aktiv","picker.accessiblePhysicalSeat":"Barrierefreier fester Sitzplatz","picker.addTime":"Zeit hinzufügen","picker.addingEllipsis":"Wird hinzugefügt…","picker.allLevels":"Alle Ebenen","picker.allPlacesBookedTogether":"Alle {count} Plätze werden gemeinsam als ein exklusiver Tisch gebucht.","picker.allPrices":"Alle Preise","picker.allSeats":"Alle Plätze","picker.allSetTitle":"Alles bereit","picker.anyTicketType":"Beliebige Ticketart","picker.anyVenueZone":"Beliebiger Bereich","picker.areas":"Bereiche","picker.available":"Verfügbar","picker.backToMap":"Zurück zur Karte","picker.backToVenue":"Zurück zur Übersicht","picker.bestSeatsStar":"✦ Beste Plätze","picker.booth":"Loge","picker.capacityGuests":"{count} Gäste","picker.change":"Ändern","picker.chartDerivedModel":"Aus dem Plan abgeleitetes Modell","picker.chartDerivedSeatEye":"Live-3D · aus dem Plan abgeleitete Sitzperspektive · nicht vermessen","picker.checkConnection":"Bitte überprüfen Sie Ihre Verbindung und versuchen Sie es erneut.","picker.checkoutCouldNotBeOpened":"Der Checkout konnte nicht geöffnet werden. Ihre Plätze sind weiterhin reserviert — bitte versuchen Sie es erneut.","picker.chooseAnotherToCompare":"Wählen Sie einen weiteren Platz zum Vergleichen.","picker.chooseGuestsCopy":"Wählen Sie, wie viele Gäste zusammensitzen. Dieser Tisch ist exklusiv für Ihre Gruppe reserviert.","picker.chooseMinMaxGuests":"Wählen Sie {min}–{max} Gäste","picker.clearSavedSeatComparison":"Gespeicherten Sitzvergleich löschen","picker.close":"Schließen","picker.closeSeatStatus":"Sitzstatus schließen","picker.closestGroupChosenInstantly":"Nächstgelegene verfügbare Gruppe, sofort ausgewählt.","picker.collapseTicketPanel":"Ticketbereich einklappen","picker.compareCount":"{count} vergleichen","picker.compareWithSaved":"Mit Gespeichertem vergleichen","picker.confirmOrCancelSeat":"Diesen Platz bestätigen oder abbrechen","picker.confirmSeatLabel":"Platz {label} bestätigen","picker.confirmYourTable":"Ihren Tisch bestätigen","picker.confirmedAndOnWay":"bestätigt. Eine Bestätigung ist unterwegs.","picker.continue":"Weiter","picker.continueToCheckout":"Weiter zum Checkout","picker.couldNotAddMoreTime":"Zusätzliche Zeit konnte nicht hinzugefügt werden — bitte jetzt zum Checkout gehen.","picker.couldNotFindSeatsTogether":"Wir konnten keine {count} zusammenhängenden Plätze finden. Versuchen Sie es mit weniger Plätzen oder einer anderen Ticketart.","picker.couldNotReleaseTickets":"Ihre Tickets konnten nicht freigegeben werden. Ihre Reservierung bleibt unverändert.","picker.couldNotRemoveLabel":"{label} konnte nicht entfernt werden. Ihre Reservierung bleibt unverändert.","picker.currentOffer":"Aktuelles Angebot","picker.currentTicketOffer":"Aktuelles Ticketangebot","picker.dragToLookAround":"Ziehen zum Umsehen · Scrollen zum Zoomen","picker.emptyWheelchairSpace":"Leerer Rollstuhlplatz","picker.exitFullScreen":"Vollbild verlassen","picker.fewer":"Weniger","picker.fewerGuests":"Weniger Gäste","picker.fewerSeats":"Weniger Plätze","picker.filterAndFocusByPrice":"Plätze nach Preis filtern und fokussieren","picker.filters":"Filter","picker.findBestSeatsCount.one":"{count} besten Platz finden","picker.findBestSeatsCount.other":"{count} beste Plätze finden","picker.findBestSeatsTogether":"Die besten Plätze zusammen finden","picker.findNewSeats":"Neue Plätze finden","picker.findingBestSeats":"Beste Plätze werden gesucht…","picker.findingEllipsis":"Wird gesucht…","picker.fitToScreen":"An Bildschirm anpassen","picker.flat2dMap":"Flache 2D-Karte","picker.flexiblePartyTypeWord":"Flexible Gruppe · {typeWord}","picker.fullScreen":"Vollbild","picker.generalAdmission":"Stehplatz","picker.guestCountCouldNotBeSecured":"Diese Gästeanzahl konnte nicht gesichert werden. Ihre aktuelle Tischreservierung bleibt unverändert.","picker.guestCountNoLongerAvailable":"Diese Gästeanzahl ist nicht mehr verfügbar. Ihre aktuelle Reservierung bleibt unverändert.","picker.guests":"Gäste","picker.guestsCount":"{count} Gäste","picker.guestsCountEdit":"{count} Gäste · Bearbeiten","picker.held":"Reserviert","picker.heldForYou":"Für Sie reserviert","picker.heldSeatExplanation":"Ein anderer Käufer hält diesen Platz gerade. Er könnte wieder verfügbar werden.","picker.heldTicketsReleased":"Reservierte Tickets wurden freigegeben. Wählen Sie neue Plätze.","picker.heldTicketsRestored":"Ihre reservierten Tickets wurden wiederhergestellt.","picker.hidePanel":"Bereich ausblenden","picker.hideTicketPanel":"Ticketbereich ausblenden","picker.holdSeatsAndCheckout":"Plätze reservieren & zum Checkout","picker.howOfferWorks":"So funktioniert das Angebot „{name}“","picker.interactive3dVenueView":"Interaktive 3D-Ansicht des Veranstaltungsorts","picker.keepMine":"Meine behalten","picker.labelNoLongerAvailable":"{label} ist nicht mehr verfügbar.","picker.labelRemoved":"{label} entfernt.","picker.labelRemovedFromHold":"{label} aus Ihrer Reservierung entfernt.","picker.labelRestored":"{label} wiederhergestellt.","picker.labelsNoLongerAvailable.one":"{labels} ist nicht mehr verfügbar. Wählen Sie einen anderen Platz.","picker.labelsNoLongerAvailable.other":"{labels} sind nicht mehr verfügbar. Wählen Sie eine andere Gruppe.","picker.leftCount.one":"noch {count}","picker.leftCount.other":"noch {count}","picker.levelNumber":"Ebene {number}","picker.levels":"Ebenen","picker.liveAvailability":"Live-Verfügbarkeit — Plätze aktualisieren sich in Echtzeit","picker.loadingSeatMap":"Sitzplan wird geladen…","picker.lookAroundLive3d":"In Live-3D umsehen","picker.manualTicketsRemovedNote":"Ihre manuell gewählten Tickets werden erst entfernt, nachdem eine neue Gruppe gesichert wurde.","picker.map":"Karte","picker.mapDidNotLoad":"Der Sitzplan konnte nicht geladen werden","picker.maxTicketsForOrder":"Sie können für diese Bestellung bis zu {count} Tickets auswählen.","picker.selectExactMore":"Noch {count} auswählen","picker.selectExactCount":"Genau {count} Tickets auswählen","picker.selectMinimumMore":"Noch {count} auswählen","picker.adjustSeatSelection":"Sitzauswahl anpassen","picker.selectSeatsTogether":"Wählen Sie zusammenhängende Plätze in derselben Reihe und Kategorie.","picker.minToMaxGuests":"{min} bis {max} Gäste","picker.more":"Mehr","picker.moreGuests":"Mehr Gäste","picker.moreSeats":"Mehr Plätze","picker.moreSelectedCount":"{count} weitere ausgewählt","picker.moreTimeAdded":"Zusätzliche Zeit hinzugefügt — Ihre Plätze sind weiterhin reserviert.","picker.noAccessibilityMetadata":"Keine Barrierefreiheits-Angaben vorhanden","picker.noAuthoredRestriction":"Keine vom Veranstalter angegebene Einschränkung","picker.noSeatsSelected":"Keine Plätze ausgewählt","picker.notChargedYet":"Es wird noch nichts abgebucht.","picker.notForSale":"Nicht verkäuflich","picker.notForSaleExplanation":"Dieser Platz ist im aktuellen Verkauf nicht enthalten.","picker.numberOfGuests":"Anzahl der Gäste","picker.offerDetailActive":"Dieser Preis gilt automatisch für berechtigte Plätze. Tickets in aktiven Warenkörben verringern vorübergehend die verfügbare Menge; freigegebene oder abgelaufene Reservierungen geben sie zurück. Wenn das Angebot endet, greift das nächste passende Angebot oder der reguläre Ticketpreis.","picker.offerDetailUpcoming":"Tickets sind derzeit zum regulären Preis erhältlich. Dieses geplante Angebot gilt automatisch für berechtigte Plätze, sobald es beginnt.","picker.offerRemainingAvailable":"{count} verfügbar","picker.offerStarts":"beginnt {time}","picker.offerUntil":"bis {time}","picker.oneSeatSaved":"1 Platz gespeichert","picker.oneSeatSavedChooseAnother":"Ein Platz gespeichert; wählen Sie einen weiteren zum Vergleichen","picker.openAuthored360":"360°-Ansicht des Veranstaltungsorts öffnen","picker.openComparison":"Vergleich öffnen","picker.openComparisonOfSeats":"Vergleich von {count} Plätzen öffnen","picker.openTicketPanel":"Ticketbereich öffnen","picker.peekFromPrice":"Ab {price}","picker.peekTicketsTotal.one":"{count} Ticket · {total}","picker.peekTicketsTotal.other":"{count} Tickets · {total}","picker.perGuestPrice":"{price} pro Gast","picker.pickYourSeats":"Wählen Sie Ihre Plätze","picker.preferredTicketType":"Bevorzugte Ticketart","picker.preferredVenueZone":"Bevorzugter Bereich","picker.priceNotSupplied":"Preis nicht angegeben","picker.releaseHeldTickets":"Reservierte Tickets freigeben und andere Plätze wählen","picker.releasingEllipsis":"Wird freigegeben…","picker.removeHeldTicketLabel":"Reserviertes Ticket {label} entfernen","picker.removeSeatLabel":"{label} entfernen","picker.removeTicketsUntilOrFewer":"Entfernen Sie Tickets, bis Ihre Bestellung {count} oder weniger enthält.","picker.replaceCurrentChoices":"Ihre aktuelle Auswahl ersetzen?","picker.review":"Überprüfen","picker.row":"Reihe","picker.rowLabel":"Reihe {label}","picker.saveToCompare":"Zum Vergleich speichern","picker.savedForComparison":"Zum Vergleich gespeichert","picker.savedSeatComparison":"Gespeicherter Sitzvergleich","picker.scheduledOffer":"Geplantes Angebot","picker.seat":"Platz","picker.seatCount.one":"{count} Platz","picker.seatCount.other":"{count} Plätze","picker.seatJustTakenByAnother":"Platz {label} wurde gerade von einem anderen Käufer übernommen.","picker.seatLabel":"Platz {label}","picker.seatNoLongerAvailable":"Dieser Platz ist nicht mehr verfügbar.","picker.seatNoLongerYours":"Einige Plätze sind für Sie nicht mehr verfügbar. Sie wurden aus Ihrer Bestellung entfernt.","picker.seatNumberLower":"Platz {label}","picker.seatSalesClosedForEvent":"Der Ticketverkauf für diese Veranstaltung ist beendet.","picker.seatSelection":"Sitzplatzauswahl","picker.seatStatusLegend":"Legende zum Sitzstatus","picker.seatTaken":"Ein anderer Käufer hat einen von Ihnen gewählten Platz übernommen. Er wurde aus Ihrer Bestellung entfernt.","picker.seatsHeldForNeedMoreTime":"Ihre Plätze sind für {time} reserviert. Mehr Zeit benötigt?","picker.seatsJustTaken":"Ein oder mehrere Plätze wurden gerade vergeben. Bitte wählen Sie erneut.","picker.seatsJustTakenInCategory.one":"{count} Platz gerade vergeben in {label} · noch {left}","picker.seatsJustTakenInCategory.other":"{count} Plätze gerade vergeben in {label} · noch {left}","picker.seatsNoLongerAvailableTryAnother":"Diese Plätze sind nicht mehr verfügbar. Versuchen Sie eine andere Anzahl oder Ticketart.","picker.seatsSecured":"Plätze gesichert","picker.seatsSelectedCount.one":"{count} ausgewählt","picker.seatsSelectedCount.other":"{count} ausgewählt","picker.section":"Bereich","picker.secureMore":"Mehr sichern","picker.secureMoreAndCheckout":"{count} weitere sichern & zum Checkout","picker.securedCount":"{count} gesichert","picker.seeItIn3d":"In 3D ansehen","picker.select":"Auswählen","picker.selectSeats":"Plätze auswählen","picker.selectTable":"Tisch auswählen","picker.selectWholeTable":"Ganzen Tisch auswählen","picker.selected":"Ausgewählt","picker.selectingEllipsis":"Wird ausgewählt…","picker.showAllSeats":"Alle Plätze anzeigen","picker.showAllTicketTypes":"Alle {count} Ticketarten anzeigen","picker.showFewer":"Weniger anzeigen","picker.showLabelSeatsOnMap":"{label}-Plätze auf der Karte anzeigen","picker.showTicketPanel":"Ticketbereich anzeigen","picker.sold":"Verkauft","picker.soldOutCopy":"Für diese Veranstaltung sind derzeit keine reservierten Plätze verfügbar.","picker.soldOutEyebrow":"Diese Veranstaltung","picker.soldOutTitle":"Ausverkauft","picker.soldSeatExplanation":"Dieser Platz wurde bereits gebucht.","picker.statusAvailable":"verfügbar","picker.statusOnHold":"reserviert","picker.statusTaken2":"vergeben","picker.table":"Tisch","picker.tableCapacity":"Tischkapazität","picker.tableUpdatedForGuests":"{label} auf {count} Gäste aktualisiert.","picker.temporarilyHeld":"Vorübergehend reserviert","picker.ticketPrices":"Ticketpreise","picker.ticketTypeSoldOut":"Diese Ticketart ist ausverkauft. Versuchen Sie eine andere Ticketart.","picker.tickets":"Tickets","picker.ticketsCount.one":"{count} Ticket","picker.ticketsCount.other":"{count} Tickets","picker.toggleColorblindColors":"Farbenblindenfreundliche Farben umschalten","picker.total":"Gesamt","picker.trayHintTapOrBest":"Tippen Sie auf einen Platz in der Karte, oder lassen Sie uns die besten verfügbaren für Sie wählen.","picker.trayHintTapOrStanding":"Tippen Sie auf einen Platz in der Karte — oder holen Sie sich unten Stehplatztickets.","picker.undo":"Rückgängig","picker.upcomingTicketOffer":"Bevorstehendes Ticketangebot","picker.updateTable":"Tisch aktualisieren","picker.updatingEllipsis":"Wird aktualisiert…","picker.venueView":"Ansicht des Veranstaltungsorts","picker.viewFromHere":"Ansicht von hier","picker.viewFromThisSeat":"Ansicht von diesem Platz","picker.wholeTypeWord":"Ganzer {typeWord}","picker.willChooseClosestGroup":"Wir wählen die nächstgelegene verfügbare Gruppe für Sie.","picker.willFindSeatsTogether":"Wir finden {count} Plätze zusammen für Sie.","picker.yourSeats":"Ihre Plätze","picker.zoomIn":"Vergrößern","picker.zoomOut":"Verkleinern","picker.closeVenueNav":"Schließen","picker.levelsAndAreas":"Ebenen & Bereiche"}})),cf=Ui({fr:()=>Rr}),Rr,df=rt((()=>{Rr={"common.cancel":"Annuler","common.close":"Fermer","common.done":"Terminé","common.copied":"✓ Copié","picker.holdExpired":"Votre réservation a expiré — les sièges ont été libérés. Sélectionnez à nouveau.","picker.poweredBy":"Propulsé par SeatLayer","picker.testMode":"MODE TEST","picker.orphanHint":"Cela laisse un siège isolé — pensez à vous décaler d'un siège.","picker.companionRequiresWheelchair":"Nécessite la place fauteuil roulant adjacente","picker.companionPairRequired":"Sélectionnez la place fauteuil roulant adjacente avec chaque billet accompagnateur.","map.aria":"Plan de salle. Utilisez les flèches pour naviguer entre les sièges, Entrée pour sélectionner.","map.seatsLeft":"{count} LIBRES","map.soldOut":"COMPLET","map.statusHeld":"En attente","map.statusTaken":"Pris","map.fromPrice":"DÈS {price}","picker.floor":"Étage","picker.zoomLevel":"Niveau de zoom","picker.rungTip.zones":"Vue générale — groupes de sections comme Tribune nord ou VIP","picker.rungTip.sections":"Blocs de sections — les sections complètes ou presque pleines sont estompées pour voir la disponibilité en un coup d’œil","picker.rungTip.seats":"Sièges individuels — les blocs se transforment en points","picker.rungLabel.zones":"ZONES","picker.rungLabel.sections":"SECTIONS","picker.rungLabel.seats":"SIÈGES","picker.sectionSummaryAria":"Résumé de la section {label}","picker.closeSectionSummary":"Fermer le résumé de la section","picker.seatsLeftInSection.one":"{count} siège restant","picker.seatsLeftInSection.other":"{count} sièges restants","picker.overview":"Vue d'ensemble","picker.entrance":"Entrée","picker.tapSeatHint":"Appuyez sur un siège pour vérifier sa vue","picker.ticketTierFor":"Catégorie de billet pour {label}","picker.viewFromSeat":"Vue depuis le siège {label}","picker.real360":"VRAI 360°","picker.preview":"APERÇU","picker.sightline":"≈ {m} m de la scène","picker.panorama360":"Photo panoramique 360° du lieu","picker.illustrationCaption":"illustration · ≈ {m} m de la scène","picker.restrictedView":"Visibilité réduite","picker.obstructedView":"Vue obstruée","picker.premiumSeat":"Place premium","picker.hideLimitedView":"Masquer les places à visibilité réduite","picker.bestSeatsPremium":"Meilleures places","picker.premiumFallbackNote":"Aucun bloc premium de {count} — affichage des meilleures places disponibles","picker.loading3d":"Création de la salle en 3D…","picker.unavailable3d":"La 3D n’a pas pu démarrer. Le plan des sièges reste disponible.","picker.jumpToSection":"Accéder à une section","picker.salesClosedPill":"Les ventes sont closes","picker.salesClosedCopy":"La vente de billets pour cet événement est terminée.","picker.salesClosedCta":"Ventes closes","picker.salesClosedToast":"Les ventes sont closes pour cet événement.","picker.holdReassurance":"À vous pendant {time} — vous ne serez pas encore débité.","picker.securingSeats":"Réservation de vos places…","picker.openingCheckout":"Ouverture du paiement sécurisé…","picker.peekSecured":"✓ {count} réservées · {total} — vous ne serez pas encore débité","picker.priceHint":"Les couleurs du plan correspondent aux types de billets — touchez-en un ci-dessous pour ne voir que ces places.","picker.findTogetherInstead":"Trouver plutôt des places côte à côte","picker.keepMyPicks":"Garder ma sélection","picker.accessExpiredBody":"Reconnectez-vous ou rechargez la page pour continuer à consulter ces places. Ce que vous avez déjà réservé reste à vous.","picker.accessExpiredTitle":"Votre session d’accès a pris fin","picker.accessInvalidBody":"Vous pouvez toujours réserver tout ce qui est indiqué comme disponible. Contactez la personne qui vous a envoyé ce lien pour accéder au reste.","picker.accessInvalidTitle":"Nous n’avons pas pu vérifier votre accès","picker.accessPausedBody":"L’organisateur a mis cette sélection en pause. Réessayez dans quelques minutes.","picker.accessPausedTitle":"Ces places sont actuellement en attente","picker.accessRetry":"Réessayer","picker.accessRevokedBody":"Demandez à la personne qui vous a envoyé ce lien de vous en fournir un nouveau pour continuer à réserver ces places.","picker.accessRevokedTitle":"Ce lien d’accès n’est plus actif","picker.accessiblePhysicalSeat":"Siège physique accessible","picker.addTime":"Ajouter du temps","picker.addingEllipsis":"Ajout en cours…","picker.allLevels":"Tous les niveaux","picker.allPlacesBookedTogether":"Les {count} places sont réservées ensemble comme une table exclusive.","picker.allPrices":"Tous les prix","picker.allSeats":"Toutes les places","picker.allSetTitle":"Tout est prêt","picker.anyTicketType":"Tout type de billet","picker.anyVenueZone":"Toute zone du lieu","picker.areas":"Zones","picker.available":"Disponible","picker.backToMap":"Retour au plan","picker.backToVenue":"Retour au lieu","picker.bestSeatsStar":"✦ Meilleures places","picker.booth":"Loge","picker.capacityGuests":"{count} invités","picker.change":"Modifier","picker.chartDerivedModel":"Modèle dérivé du plan","picker.chartDerivedSeatEye":"3D en direct · point de vue dérivé du plan · non vérifié","picker.checkConnection":"Vérifiez votre connexion et réessayez.","picker.checkoutCouldNotBeOpened":"Le paiement n’a pas pu s’ouvrir. Vos places sont toujours réservées — veuillez réessayer.","picker.chooseAnotherToCompare":"Choisissez une autre place à comparer.","picker.chooseGuestsCopy":"Choisissez combien d’invités seront assis ensemble. Cette table est réservée exclusivement à votre groupe.","picker.chooseMinMaxGuests":"Choisissez de {min} à {max} invités","picker.clearSavedSeatComparison":"Effacer la comparaison de places enregistrée","picker.close":"Fermer","picker.closeSeatStatus":"Fermer le statut de la place","picker.closestGroupChosenInstantly":"Groupe disponible le plus proche, choisi instantanément.","picker.collapseTicketPanel":"Réduire le panneau des billets","picker.compareCount":"Comparer {count}","picker.compareWithSaved":"Comparer avec l’enregistrée","picker.confirmOrCancelSeat":"Confirmer ou annuler cette place","picker.confirmSeatLabel":"Confirmer la place {label}","picker.confirmYourTable":"Confirmez votre table","picker.confirmedAndOnWay":"confirmés. Une confirmation arrive.","picker.continue":"Continuer","picker.continueToCheckout":"Continuer vers le paiement","picker.couldNotAddMoreTime":"Impossible d’ajouter du temps — veuillez passer au paiement maintenant.","picker.couldNotFindSeatsTogether":"Nous n’avons pas trouvé {count} places ensemble. Essayez avec moins de places ou un autre type de billet.","picker.couldNotReleaseTickets":"Impossible de libérer vos billets. Votre réservation reste inchangée.","picker.couldNotRemoveLabel":"Impossible de retirer {label}. Votre réservation reste inchangée.","picker.currentOffer":"Offre actuelle","picker.currentTicketOffer":"Offre de billets actuelle","picker.dragToLookAround":"Faites glisser pour regarder autour · défilez pour zoomer","picker.emptyWheelchairSpace":"Emplacement vide pour fauteuil roulant","picker.exitFullScreen":"Quitter le plein écran","picker.fewer":"Moins","picker.fewerGuests":"Moins d’invités","picker.fewerSeats":"Moins de places","picker.filterAndFocusByPrice":"Filtrer et cibler les places par prix","picker.filters":"Filtres","picker.findBestSeatsCount.one":"Trouver {count} meilleure place","picker.findBestSeatsCount.other":"Trouver {count} meilleures places","picker.findBestSeatsTogether":"Trouver les meilleures places ensemble","picker.findNewSeats":"Trouver de nouvelles places","picker.findingBestSeats":"Recherche des meilleures places…","picker.findingEllipsis":"Recherche…","picker.fitToScreen":"Ajuster à l’écran","picker.flat2dMap":"Plan 2D à plat","picker.flexiblePartyTypeWord":"Groupe flexible · {typeWord}","picker.fullScreen":"Plein écran","picker.generalAdmission":"Entrée générale","picker.guestCountCouldNotBeSecured":"Ce nombre d’invités n’a pas pu être sécurisé. Votre réservation de table actuelle reste inchangée.","picker.guestCountNoLongerAvailable":"Ce nombre d’invités n’est plus disponible. Votre réservation actuelle reste inchangée.","picker.guests":"Invités","picker.guestsCount":"{count} invités","picker.guestsCountEdit":"{count} invités · Modifier","picker.held":"Réservé","picker.heldForYou":"Réservé pour vous","picker.heldSeatExplanation":"Un autre acheteur retient cette place actuellement. Elle pourrait redevenir disponible.","picker.heldTicketsReleased":"Les billets réservés ont été libérés. Choisissez vos nouvelles places.","picker.heldTicketsRestored":"Vos billets réservés ont été restaurés.","picker.hidePanel":"Masquer le panneau","picker.hideTicketPanel":"Masquer le panneau des billets","picker.holdSeatsAndCheckout":"Réserver les places et payer","picker.howOfferWorks":"Comment fonctionne l’offre « {name} »","picker.interactive3dVenueView":"Vue 3D interactive du lieu","picker.keepMine":"Garder les miennes","picker.labelNoLongerAvailable":"{label} n’est plus disponible.","picker.labelRemoved":"{label} retiré.","picker.labelRemovedFromHold":"{label} retiré de votre réservation.","picker.labelRestored":"{label} restauré.","picker.labelsNoLongerAvailable.one":"{labels} n’est plus disponible. Choisissez une autre place.","picker.labelsNoLongerAvailable.other":"{labels} ne sont plus disponibles. Choisissez un autre groupe.","picker.leftCount.one":"{count} restante","picker.leftCount.other":"{count} restantes","picker.levelNumber":"Niveau {number}","picker.levels":"Niveaux","picker.liveAvailability":"Disponibilité en direct — les places se mettent à jour en temps réel","picker.loadingSeatMap":"Chargement du plan de salle…","picker.lookAroundLive3d":"Regarder autour en 3D en direct","picker.manualTicketsRemovedNote":"Vos billets sélectionnés manuellement ne seront retirés qu’après qu’un nouveau groupe soit sécurisé.","picker.map":"Plan","picker.mapDidNotLoad":"Le plan de salle n’a pas pu se charger","picker.maxTicketsForOrder":"Vous pouvez sélectionner jusqu’à {count} billets pour cette commande.","picker.selectExactMore":"Sélectionnez-en encore {count}","picker.selectExactCount":"Sélectionnez exactement {count} billets","picker.selectMinimumMore":"Sélectionnez-en encore {count}","picker.adjustSeatSelection":"Ajustez la sélection des sièges","picker.selectSeatsTogether":"Choisissez des sièges contigus dans la même rangée et catégorie.","picker.minToMaxGuests":"De {min} à {max} invités","picker.more":"Plus","picker.moreGuests":"Plus d’invités","picker.moreSeats":"Plus de places","picker.moreSelectedCount":"{count} de plus sélectionnées","picker.moreTimeAdded":"Du temps supplémentaire a été ajouté — vos places restent réservées.","picker.noAccessibilityMetadata":"Aucune information d’accessibilité fournie","picker.noAuthoredRestriction":"Aucune restriction indiquée par l’organisateur","picker.noSeatsSelected":"Aucune place sélectionnée","picker.notChargedYet":"Vous ne serez pas encore débité.","picker.notForSale":"Non disponible à la vente","picker.notForSaleExplanation":"Cette place n’est pas incluse dans la vente en cours.","picker.numberOfGuests":"Nombre d’invités","picker.offerDetailActive":"Ce prix s’applique automatiquement aux places éligibles. Les billets dans les paniers actifs réduisent temporairement la quantité disponible ; les réservations libérées ou expirées la restituent. Lorsque l’offre se termine, l’offre correspondante suivante ou le prix normal du billet prend le relais.","picker.offerDetailUpcoming":"Les billets sont disponibles maintenant à leur prix normal. Cette offre programmée s’appliquera automatiquement aux places éligibles dès son démarrage.","picker.offerRemainingAvailable":"{count} disponibles","picker.offerStarts":"débute {time}","picker.offerUntil":"jusqu’à {time}","picker.oneSeatSaved":"1 place enregistrée","picker.oneSeatSavedChooseAnother":"Une place enregistrée ; choisissez-en une autre à comparer","picker.openAuthored360":"Ouvrir la vue 360° du lieu","picker.openComparison":"Ouvrir la comparaison","picker.openComparisonOfSeats":"Ouvrir la comparaison de {count} places","picker.openTicketPanel":"Ouvrir le panneau des billets","picker.peekFromPrice":"Dès {price}","picker.peekTicketsTotal.one":"{count} billet · {total}","picker.peekTicketsTotal.other":"{count} billets · {total}","picker.perGuestPrice":"{price} par invité","picker.pickYourSeats":"Choisissez vos places","picker.preferredTicketType":"Type de billet préféré","picker.preferredVenueZone":"Zone du lieu préférée","picker.priceNotSupplied":"Prix non fourni","picker.releaseHeldTickets":"Libérer les billets réservés et choisir d’autres places","picker.releasingEllipsis":"Libération en cours…","picker.removeHeldTicketLabel":"Retirer le billet réservé {label}","picker.removeSeatLabel":"Retirer {label}","picker.removeTicketsUntilOrFewer":"Retirez des billets jusqu’à ce que votre commande en contienne {count} ou moins.","picker.replaceCurrentChoices":"Remplacer votre sélection actuelle ?","picker.review":"Vérifier","picker.row":"Rangée","picker.rowLabel":"Rangée {label}","picker.saveToCompare":"Enregistrer pour comparer","picker.savedForComparison":"Enregistré pour comparaison","picker.savedSeatComparison":"Comparaison de places enregistrée","picker.scheduledOffer":"Offre programmée","picker.seat":"Place","picker.seatCount.one":"{count} place","picker.seatCount.other":"{count} places","picker.seatJustTakenByAnother":"La place {label} vient d’être prise par un autre acheteur.","picker.seatLabel":"Place {label}","picker.seatNoLongerAvailable":"Cette place n’est plus disponible.","picker.seatNoLongerYours":"Certaines places ne vous sont plus disponibles. Elles ont été retirées de votre commande.","picker.seatNumberLower":"place {label}","picker.seatSalesClosedForEvent":"La vente de places pour cet événement est terminée.","picker.seatSelection":"Sélection des places","picker.seatStatusLegend":"Légende du statut des places","picker.seatTaken":"Un autre acheteur a pris une place que vous aviez choisie. Elle a été retirée de votre commande.","picker.seatsHeldForNeedMoreTime":"Vos places sont réservées pendant {time}. Besoin de plus de temps ?","picker.seatsJustTaken":"Une ou plusieurs places viennent d’être prises. Veuillez choisir à nouveau.","picker.seatsJustTakenInCategory.one":"{count} place tout juste prise dans {label} · {left} restante","picker.seatsJustTakenInCategory.other":"{count} places tout juste prises dans {label} · {left} restantes","picker.seatsNoLongerAvailableTryAnother":"Ces places ne sont plus disponibles. Essayez une autre quantité ou un autre type de billet.","picker.seatsSecured":"Places sécurisées","picker.seatsSelectedCount.one":"{count} sélectionnée","picker.seatsSelectedCount.other":"{count} sélectionnées","picker.section":"Section","picker.secureMore":"Sécuriser plus","picker.secureMoreAndCheckout":"Sécuriser {count} de plus et payer","picker.securedCount":"{count} sécurisées","picker.seeItIn3d":"Voir en 3D","picker.select":"Sélectionner","picker.selectSeats":"Sélectionner des places","picker.selectTable":"Sélectionner la table","picker.selectWholeTable":"Sélectionner la table entière","picker.selected":"Sélectionnée","picker.selectingEllipsis":"Sélection en cours…","picker.showAllSeats":"Afficher toutes les places","picker.showAllTicketTypes":"Afficher les {count} types de billets","picker.showFewer":"Afficher moins","picker.showLabelSeatsOnMap":"Afficher les places {label} sur le plan","picker.showTicketPanel":"Afficher le panneau des billets","picker.sold":"Vendu","picker.soldOutCopy":"Aucune place réservée n’est actuellement disponible pour cet événement.","picker.soldOutEyebrow":"Cet événement","picker.soldOutTitle":"Complet","picker.soldSeatExplanation":"Cette place a déjà été réservée.","picker.statusAvailable":"disponible","picker.statusOnHold":"en attente","picker.statusTaken2":"prise","picker.table":"Table","picker.tableCapacity":"Capacité de la table","picker.tableUpdatedForGuests":"{label} mise à jour pour {count} invités.","picker.temporarilyHeld":"Temporairement réservé","picker.ticketPrices":"Prix des billets","picker.ticketTypeSoldOut":"Ce type de billet est épuisé. Essayez un autre type de billet.","picker.tickets":"Billets","picker.ticketsCount.one":"{count} billet","picker.ticketsCount.other":"{count} billets","picker.toggleColorblindColors":"Activer/désactiver les couleurs adaptées au daltonisme","picker.total":"Total","picker.trayHintTapOrBest":"Touchez une place sur le plan, ou laissez-nous choisir les meilleures disponibles pour vous.","picker.trayHintTapOrStanding":"Touchez une place sur le plan — ou prenez des billets debout ci-dessous.","picker.undo":"Annuler","picker.upcomingTicketOffer":"Offre de billets à venir","picker.updateTable":"Mettre à jour la table","picker.updatingEllipsis":"Mise à jour en cours…","picker.venueView":"Vue du lieu","picker.viewFromHere":"Vue depuis ici","picker.viewFromThisSeat":"Vue depuis cette place","picker.wholeTypeWord":"{typeWord} entier","picker.willChooseClosestGroup":"Nous choisirons le groupe disponible le plus proche pour vous.","picker.willFindSeatsTogether":"Nous trouverons {count} places ensemble.","picker.yourSeats":"Vos places","picker.zoomIn":"Zoomer","picker.zoomOut":"Dézoomer","picker.closeVenueNav":"Fermer","picker.levelsAndAreas":"Niveaux et zones"}})),hf={es:()=>Promise.resolve().then(()=>(af(),of)).then(t=>({default:t.es})),de:()=>Promise.resolve().then(()=>(lf(),rf)).then(t=>({default:t.de})),fr:()=>Promise.resolve().then(()=>(df(),cf)).then(t=>({default:t.fr}))},$r=new Set(["en"]);async function Or(t){const e=vu(t);if(e==="en"||$r.has(e))return Tn(e),e;try{return Tn(e,(await hf[e]()).default),$r.add(e),e}catch{return Tn("en"),"en"}}var Oi="seatlayer.v1",Fr="\0",bg=4401,uf=15e3,pf=25e3,ff=1e4,vf=5e3;function mf(t){const e=typeof t.default=="string"?t.default:"free",i={};if(t.seats&&typeof t.seats=="object")for(const[s,n]of Object.entries(t.seats))typeof n=="string"&&n!==e&&(i[s]=n);return{default:e,exceptions:i}}function gf(t,e){if(!t||t.default!==e.default)return null;const i=[];for(const[s,n]of Object.entries(e.exceptions))t.exceptions[s]!==n&&i.push({label:s,status:n});for(const s of Object.keys(t.exceptions))s in e.exceptions||i.push({label:s,status:e.default});return i}function bf(t,e){for(const i of e)i.status===t.default?delete t.exceptions[i.label]:t.exceptions[i.label]=i.status}function Br(t){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(t))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(t))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var Ls=class{constructor(t){this.ws=null,this.stopped=!0,this.attempt=0,this.reconnectTimer=null,this.pingTimer=null,this.pongTimer=null,this.resumeTimer=null,this.projection=null,this.version=null,this.v1=!1,this.useQueryMarker=!1,this.hidden=null,this.closedSections=null,this.opts=t,Br(t.url)}get protocol(){return this.ws?this.v1?"v1":"legacy":null}get snapshotVersion(){return this.version}start(){this.stopped&&(this.stopped=!1,this.connect())}stop(){this.stopped=!0,this.clearTimers();const t=this.ws;if(this.ws=null,t){t.onopen=null,t.onmessage=null,t.onclose=null,t.onerror=null;try{t.close()}catch{}}}restart(){this.stop(),this.projection=null,this.version=null,this.attempt=0,this.start()}async connect(){if(this.stopped)return;let t=[Oi];if(this.opts.mintTicket){var e;let a;try{a=await this.opts.mintTicket()}catch(r){this.reportIfAccessError(r),this.scheduleReconnect();return}if(this.stopped)return;!(a==null||(e=a.protocols)===null||e===void 0)&&e.length?(t=[...a.protocols],t.includes("seatlayer.v1")||t.unshift(Oi)):a!=null&&a.ticket&&(t=[Oi,`tkt.${a.ticket}`])}const i=this.version!==null;i&&t.push(`sv.${this.version}`);const s=this.useQueryMarker?`${this.opts.url}${this.opts.url.includes("?")?"&":"?"}pv=1`:this.opts.url;Br(s);let n;try{var o;n=((o=this.opts.socketFactory)!==null&&o!==void 0?o:((a,r)=>new WebSocket(a,r)))(s,t)}catch{this.scheduleReconnect();return}this.ws=n,n.onopen=()=>{this.ws===n&&(this.attempt=0,this.v1=n.protocol===Oi,this.v1||(this.useQueryMarker=!0),this.startKeepalive(n),i?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},vf):this.opts.sink.resync())},n.onmessage=a=>{if(this.ws!==n)return;let r;try{r=JSON.parse(typeof a.data=="string"?a.data:"")}catch{return}!r||typeof r!="object"||this.handleFrame(r)},n.onclose=a=>{if(this.ws===n){if(this.ws=null,this.clearTimers(),(a==null?void 0:a.code)===4401){var r,l;this.stopped=!0,(r=(l=this.opts).onAccessUnavailable)===null||r===void 0||r.call(l,{reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},n.onerror=()=>{try{n.close()}catch{}}}handleFrame(t){const e=typeof t.type=="string"?t.type:"";if(t.protocol===1&&(this.v1=!0),typeof t.snapshotVersion=="number"&&(this.version=t.snapshotVersion),e==="pong"){this.clearPongTimer();return}if(Array.isArray(t.hidden)||Array.isArray(t.closed)){const a=Array.isArray(t.hidden)?t.hidden:[],r=Array.isArray(t.closed)?t.closed:[],l=a.join(Fr),c=r.join(Fr);if(l!==this.hidden||c!==this.closedSections){var i,s;this.hidden=l,this.closedSections=c,(i=(s=this.opts.sink).onSections)===null||i===void 0||i.call(s,a,r)}}if(e!=="hidden"){if(e==="presence"){var n,o;(n=(o=this.opts.sink).onPresence)===null||n===void 0||n.call(o,{shoppingSessions:Number(t.shoppingSessions)||0,activeHolds:Number(t.activeHolds)||0});return}if(e!=="allocation"){if(e==="snapshot"||!e&&t.seats){this.answered();const a=mf(t),r=gf(this.projection,a);this.projection=a,r===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(a):this.opts.sink.resync():r.length&&this.opts.sink.applyStatuses(r);return}if(e==="delta"&&Array.isArray(t.changes)){this.answered();const a=t.changes.filter(r=>typeof(r==null?void 0:r.label)=="string"&&typeof(r==null?void 0:r.status)=="string").map(r=>({label:r.label,status:r.status}));if(!a.length)return;this.projection&&bf(this.projection,a),this.opts.sink.applyStatuses(a)}}}}answered(){this.resumeTimer&&(clearTimeout(this.resumeTimer),this.resumeTimer=null)}reportIfAccessError(t){var e,i;const s=t==null?void 0:t.reason;(t==null?void 0:t.name)==="BuyerAccessUnavailableError"&&(this.stopped=!0,(e=(i=this.opts).onAccessUnavailable)===null||e===void 0||e.call(i,{reason:s!=null?s:"invalid",code:t.code,status:t.status,retryable:s==="paused"}))}startKeepalive(t){this.pingTimer=setInterval(()=>{if(this.ws===t){try{t.send(JSON.stringify({type:"ping"}))}catch{return}this.clearPongTimer(),this.pongTimer=setTimeout(()=>{this.pongTimer=null;try{t.close()}catch{}},ff)}},pf)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;const t=Math.min(this.attempt++,5),e=Math.min(1e3*2**t,uf),i=Math.random()*e;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}clearPongTimer(){this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null)}clearTimers(){this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null,this.clearPongTimer(),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.resumeTimer&&clearTimeout(this.resumeTimer),this.resumeTimer=null}};function yf(t){return t==="blocked"?"not_for_sale":t==="held"||t==="booked"||t==="free"||t==="not_for_sale"?t:"free"}function Hn(t,e={}){const i=s=>{const n=t.tableSelection(s);if(n)return n.physicalSeatIds;const o=t.idForLabel(s);return o?[o]:[]};return{applyStatuses(s){var n,o,a;const r=(n=(o=t.currentHold())===null||o===void 0?void 0:o.labels)!==null&&n!==void 0?n:[],l={free:[],held:[],booked:[],not_for_sale:[]},c=[],d=[],u=new Map(t.getSelection().map(p=>[p.label,p.id]));for(const p of s){const f=i(p.label);if(!f.length)continue;const v=yf(p.status);if(l[v].push(...f),e.flashOnLiveChange&&v!=="free"&&!r.includes(p.label)&&f.some(m=>t.getStatus(m)==="free")){const m=v==="held"?"#f4b740":"#f43f5e";for(const g of f)c.push({id:g,color:m})}v!=="free"&&!r.includes(p.label)&&u.has(p.label)&&d.push(p.label)}for(const p of["free","held","booked","not_for_sale"])l[p].length&&t.setStatus(l[p],p);for(const p of c)t.flashSeat(p.id,p.color);if(d.length){var h;const p=d.flatMap(v=>i(v));p.length&&t.deselect(p);const f=s.some(v=>v.status==="blocked"&&d.includes(v.label));(h=e.onSelectedObjectUnavailable)===null||h===void 0||h.call(e,d,f?"ineligible":"taken")}(a=e.onStatusChange)===null||a===void 0||a.call(e)},async resync(){await t.refresh()},onSections(s,n){var o;t.refresh(),(o=e.onSections)===null||o===void 0||o.call(e,s,n)}}}var As=class extends Error{constructor(t,e,i,s,n,o){super(e),this.name="ApiError",this.status=t,this.code=i,this.conflicts=s,this.reason=n,this.retryAfterS=o}},zr=10,Dr=1;function Hr(t,e){const i=(t!=null?t:"").trim();if(i){const s=Number(i);if(Number.isFinite(s)&&s>=0)return Math.ceil(s);const n=Date.parse(i);if(Number.isFinite(n))return Math.max(0,Math.ceil((n-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var kf={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},Nr=class{constructor(t,e={}){this.base=t,this.viewerId=typeof crypto!="undefined"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`,this.access=e.access,this.onObjectUnavailable=e.onObjectUnavailable}get accessScoped(){var t;return!!(!((t=this.access)===null||t===void 0)&&t.configured)}async request(t,e={},i={}){var s,n,o;const a=(s=e.method)!==null&&s!==void 0?s:"GET",r={};let l;e.body!==void 0&&(r["Content-Type"]="application/json",l=JSON.stringify(e.body));const c=await((n=this.access)===null||n===void 0?void 0:n.authorization(i.auth?"unauthorized":"initial"));c&&(r.Authorization=c);const d=await fetch(`${this.base}${t}`,{method:a,headers:r,body:l,credentials:"omit"}),u=((o=d.headers.get("content-type"))!==null&&o!==void 0?o:"").includes("application/json")?await d.json().catch(()=>null):null;if(!d.ok){var h,p,f;const k=u,w=(h=k==null?void 0:k.code)!==null&&h!==void 0?h:k==null?void 0:k.error;if(!((p=this.access)===null||p===void 0)&&p.configured&&(d.status===401||d.status===403||d.status===422)&&await this.access.handleFailure(d.status,w)&&!i.auth)return this.request(t,e,{...i,auth:!0});if(d.status===409){var v,m,g,b;const S=w?kf[w]:void 0,T=(v=(m=k==null||(g=k.conflicts)===null||g===void 0?void 0:g.map(E=>E.label))!==null&&m!==void 0?m:e.labels)!==null&&v!==void 0?v:[];S&&((b=this.onObjectUnavailable)===null||b===void 0||b.call(this,{labels:T,reason:S,code:w}))}let C;if(d.status===429){var y;if(C=(y=Hr(d.headers.get("Retry-After"),k==null?void 0:k.retryAfterSeconds))!==null&&y!==void 0?y:Dr,a==="GET"&&!i.rateLimit&&C<=zr)return await new Promise(S=>setTimeout(S,C*1e3)),this.request(t,e,{...i,rateLimit:!0})}throw new As(d.status,(f=k==null?void 0:k.error)!==null&&f!==void 0?f:`request_failed_${d.status}`,w,k==null?void 0:k.conflicts,k==null?void 0:k.reason,C)}return u}async requestBlob(t,e={}){var i,s,n,o,a;const r={},l=await((i=this.access)===null||i===void 0?void 0:i.authorization(e.auth?"unauthorized":"initial"));l&&(r.Authorization=l);const c=await fetch(`${this.base}${t}`,{method:"GET",headers:r,credentials:"omit"});if(c.ok)return c.blob();const d=((s=c.headers.get("content-type"))!==null&&s!==void 0?s:"").includes("application/json")?await c.json().catch(()=>null):null,u=(n=d==null?void 0:d.code)!==null&&n!==void 0?n:d==null?void 0:d.error;if(!((o=this.access)===null||o===void 0)&&o.configured&&(c.status===401||c.status===403||c.status===422)&&await this.access.handleFailure(c.status,u)&&!e.auth)return this.requestBlob(t,{...e,auth:!0});let h;if(c.status===429){var p;if(h=(p=Hr(c.headers.get("Retry-After"),d==null?void 0:d.retryAfterSeconds))!==null&&p!==void 0?p:Dr,!e.rateLimit&&h<=zr)return await new Promise(f=>setTimeout(f,h*1e3)),this.requestBlob(t,{...e,rateLimit:!0})}throw new As(c.status,(a=d==null?void 0:d.error)!==null&&a!==void 0?a:`request_failed_${c.status}`,u,void 0,void 0,h)}chart(t){return this.request(`/pub/events/${encodeURIComponent(t)}/chart`)}asset(t,e){return/^[a-zA-Z0-9._-]+$/.test(e)?this.requestBlob(`/pub/events/${encodeURIComponent(t)}/assets/${encodeURIComponent(e)}`):Promise.reject(new As(404,"not_found","not_found"))}objects(t){return this.request(`/pub/events/${encodeURIComponent(t)}/objects?compact=1`)}hold(t,e,i,s){return this.request(`/pub/events/${encodeURIComponent(t)}/hold`,{method:"POST",body:{selections:e,...i?{ttlMs:i}:{},...s?{replaceHoldId:s}:{}},labels:e.map(n=>n.label)})}bestAvailable(t,e,i,s,n){return this.request(`/pub/events/${encodeURIComponent(t)}/best-available`,{method:"POST",body:{qty:e,...i?{categoryKey:i}:{},...s?{zoneId:s}:{},...n?{ttlMs:n}:{}}})}resume(t,e){return this.request(`/pub/events/${encodeURIComponent(t)}/hold/resume`,{method:"POST",body:{holdId:e}})}release(t,e,i){return this.request(`/pub/events/${encodeURIComponent(t)}/release`,{method:"POST",body:{labels:e,holdId:i}})}extend(t,e,i){return this.request(`/pub/events/${encodeURIComponent(t)}/extend`,{method:"POST",body:{holdId:e,...i?{ttlMs:i}:{}}})}paymentOptions(t){return this.request(`/pub/events/${encodeURIComponent(t)}/payment-options`)}availability(t,e=!1){return this.request(`/pub/events/${encodeURIComponent(t)}/availability${e?"?live=1":""}`)}startCheckout(t,e){return this.request(`/pub/events/${encodeURIComponent(t)}/checkout`,{method:"POST",body:e})}orderStatus(t){return this.request(`/pub/orders/${encodeURIComponent(t)}/status`)}subscribeTicket(t){return this.request(`/pub/events/${encodeURIComponent(t)}/subscribe-tickets`,{method:"POST",body:{}})}subscribeUrl(t){const e=this.base.replace(/^http/,"ws"),i=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${e}/pub/events/${encodeURIComponent(t)}/subscribe?${i}`}socketUrl(t){return this.accessScoped?"":this.subscribeUrl(t)}socketProtocols(t){return this.accessScoped?[]:[Oi]}createRealtime(t,e){return this.accessScoped?null:new Ls({url:this.subscribeUrl(t),sink:e})}};function Vr(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function wf(t,e){Vr(t,e),e.add(t)}function et(t,e,i){Vr(t,e),e.set(t,i)}function je(t,e,i){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}function ye(t,e,i){return t.set(je(t,e),i),i}function fe(t,e){return t.get(je(t,e))}var Nn=class extends Error{constructor(t){super(`buyer_access_unavailable:${t.reason}`),this.name="BuyerAccessUnavailableError",this.reason=t.reason,this.code=t.code,this.status=t.status}},xf=new Set(["buyer_access_expired"]),Sf=new Set(["paused","provider_failed","channel_denied"]);function Cf(t,e){switch(e){case"buyer_access_invalid":return"invalid";case"buyer_access_revoked":return"revoked";case"buyer_access_origin_mismatch":return"origin_mismatch";case"buyer_access_event_mismatch":return"event_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";default:break}return t===401?"invalid":null}function Tf(t,e){return t===401&&!!e&&xf.has(e)}var Lf=3e4,Fe=new WeakMap,Be=new WeakMap,Es=new WeakMap,Vn=new WeakMap,ni=new WeakMap,$t=new WeakMap,Is=new WeakMap,Gn=new WeakMap,qn=new WeakMap,jn=new WeakMap,Xe=new WeakSet,Gr=class{constructor(t){var e;if(wf(this,Xe),et(this,Fe,null),et(this,Be,0),et(this,Es,void 0),et(this,Vn,void 0),et(this,ni,null),et(this,$t,null),et(this,Is,null),et(this,Gn,void 0),et(this,qn,void 0),et(this,jn,!1),ye(Es,this,t.provider),ye(Vn,this,(e=t.skewMs)!==null&&e!==void 0?e:Lf),ye(Gn,this,t.onExpired),ye(qn,this,t.onUnavailable),t.token){const i=typeof t.token=="string"?{token:t.token}:t.token;je(Xe,this,qr).call(this,i)}ye(jn,this,!!fe(Es,this)||!!fe(Fe,this))}get configured(){return fe(jn,this)}get unavailable(){return fe($t,this)}get hasToken(){return!!fe(Fe,this)&&(fe(Be,this)===0||fe(Be,this)>Date.now())}get expiresAt(){return fe(Be,this)}async authorization(t="initial"){if(!this.configured)return null;if(fe($t,this))throw new Nn(fe($t,this));const e=Date.now();if(!fe(Fe,this)||fe(Be,this)>0&&fe(Be,this)-fe(Vn,this)<=e){const n=!!fe(Fe,this)&&fe(Be,this)>0&&fe(Be,this)<=e,o=fe(Fe,this)?n?"expired":"expiring":t,a=await je(Xe,this,Un).call(this,o);if(!a){var i,s;throw new Nn((i=(s=fe($t,this))!==null&&s!==void 0?s:fe(Is,this))!==null&&i!==void 0?i:je(Xe,this,Fi).call(this,"provider_failed"))}return`Bearer ${a}`}return`Bearer ${fe(Fe,this)}`}async handleFailure(t,e){if(!this.configured)return!1;if(Tf(t,e)){var i;ye(Fe,this,null),ye(Be,this,0);const n=await je(Xe,this,Un).call(this,"unauthorized",e);return(i=fe(Gn,this))===null||i===void 0||i.call(this,{reason:"unauthorized",code:e,refreshed:!!n}),!!n}const s=Cf(t,e);return s&&je(Xe,this,Fi).call(this,s,e,t),!1}async refresh(t="manual"){return ye($t,this,null),ye(Is,this,null),ye(Fe,this,null),ye(Be,this,0),!!await je(Xe,this,Un).call(this,t)}clear(){ye(Fe,this,null),ye(Be,this,0),ye(ni,this,null)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};function qr(t){return!t||typeof t.token!="string"||!t.token?null:(ye(Fe,this,t.token),ye(Be,this,typeof t.expiresAt=="number"?t.expiresAt:0),fe(Fe,this))}function Un(t,e){if(fe(ni,this))return fe(ni,this);const i=fe(Es,this);if(!i)return je(Xe,this,Fi).call(this,"no_token",e),Promise.resolve(null);const s=(async()=>{try{const n=await i({reason:t}),o=je(Xe,this,qr).call(this,n);return o||(je(Xe,this,Fi).call(this,"provider_failed",e),null)}catch{return je(Xe,this,Fi).call(this,"provider_failed",e),null}finally{ye(ni,this,null)}})();return ye(ni,this,s),s}function Fi(t,e,i){var s;const n={reason:t,code:e,status:i,retryable:t==="paused"||t==="channel_denied"};return ye(Is,this,n),Sf.has(t)||(ye($t,this,n),ye(Fe,this,null),ye(Be,this,0)),(s=fe(qn,this))===null||s===void 0||s.call(this,n),n}function Wn(t,e={}){return!t.buyerAccessTokenProvider&&!t.buyerAccessToken?null:new Gr({provider:t.buyerAccessTokenProvider,token:t.buyerAccessToken,...e})}var jr='',Af="https://api.seatlayer.io",Ef=10;function If(t){if(typeof t=="string"){const e=document.querySelector(t);if(!e)throw new Error(`seatmap: container "${t}" not found`);return e}if(!(t instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return t}var Ur=class{constructor(t){var e,i,s;if(this.mount=null,this.hostEl=null,this.rendered=!1,this.mode_=null,this.tipEl=null,this.tipPos={x:0,y:0},this.onTipMove=null,this.realtime=null,!t||typeof t!="object")throw new Error("seatmap: options object is required");if(!t.container)throw new Error("seatmap: `container` is required");if(!t.event||typeof t.event!="string")throw new Error("seatmap: `event` key is required");this.opts=t,this.publicKey=t.publicKey,this.access=Wn(t,{onExpired:o=>{var a,r;return(a=(r=this.opts).onAccessExpired)===null||a===void 0?void 0:a.call(r,o)},onUnavailable:o=>{var a,r;return(a=(r=this.opts).onAccessUnavailable)===null||a===void 0?void 0:a.call(r,o)}});const n=new Nr(((e=t.apiBase)!==null&&e!==void 0?e:Af).replace(/\/+$/,""),{access:(i=this.access)!==null&&i!==void 0?i:void 0,onObjectUnavailable:o=>{var a,r;return(a=(r=this.opts).onSelectedObjectUnavailable)===null||a===void 0?void 0:a.call(r,o)}});this.api=n,this.controller=new Ir({transport:n,eventKey:t.event,maxSelection:(s=t.maxSelection)!==null&&s!==void 0?s:Ef,selectedObjects:t.selectedObjects,selectableObjects:t.selectableObjects,numberOfPlacesToSelect:t.numberOfPlacesToSelect,selectionValidators:t.selectionValidators,currency:t.currency,onSelectionChange:o=>{var a,r;return(a=(r=this.opts).onSelectionChange)===null||a===void 0?void 0:a.call(r,o)},onSelectionValidityChange:o=>{var a,r;return(a=(r=this.opts).onSelectionValidityChange)===null||a===void 0?void 0:a.call(r,o)},onSelectionValid:o=>{var a,r;return(a=(r=this.opts).onSelectionValid)===null||a===void 0?void 0:a.call(r,o)},onSelectionInvalid:o=>{var a,r;return(a=(r=this.opts).onSelectionInvalid)===null||a===void 0?void 0:a.call(r,o)},onSelectionLimit:o=>{var a,r;return(a=(r=this.opts).onSelectionLimit)===null||a===void 0?void 0:a.call(r,o)},onHold:o=>{var a,r;return(a=(r=this.opts).onHold)===null||a===void 0?void 0:a.call(r,{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items})},onHoldRestored:o=>{var a,r;return(a=(r=this.opts).onHoldRestored)===null||a===void 0?void 0:a.call(r,{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items})},onHoldExpired:()=>{var o,a;return(o=(a=this.opts).onHoldExpired)===null||o===void 0?void 0:o.call(a)},onGAClick:o=>{var a,r;const l=this.controller.getGAAreas().find(c=>c.id===o);l&&((a=(r=this.opts).onGAClick)===null||a===void 0||a.call(r,l))},onError:o=>{var a,r;return(a=(r=this.opts).onError)===null||a===void 0?void 0:a.call(r,o)},onDeckTap:o=>{var a,r;return(a=(r=this.opts).onDeckTap)===null||a===void 0?void 0:a.call(r,o)},onHint:o=>{var a,r;return(a=(r=this.opts).onHint)===null||a===void 0?void 0:a.call(r,o)},flashOnLiveChange:!0,onSeatHover:o=>{var a,r;(a=(r=this.opts).onSeatHover)===null||a===void 0||a.call(r,o),this.opts.seatTooltip!==!1&&this.updateTooltip(o)},colorblindSafe:t.colorblindSafe})}async render(){var t;if(this.rendered)return this;this.rendered=!0,await Or(this.opts.locale),this.opts.messages&&sr(this.opts.messages),this.mount=If(this.opts.container);const e=document.createElement("div");e.style.width="100%",e.style.height="100%",e.style.position="relative",this.mount.appendChild(e),this.hostEl=e;const i=await this.controller.render(e);if(!i)return this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(e),this;if(this.controller.setViewMode((t=this.opts.initialView)!==null&&t!==void 0?t:"flat"),this.startRealtime(),this.mode_=i.mode==="test"?"test":"live",this.opts.seatTooltip!==!1){const s=document.createElement("div");s.setAttribute("role","tooltip"),s.style.cssText='position:absolute;z-index:7;pointer-events:none;display:none;max-width:240px;background:#10162a;color:#fff;border-radius:10px;padding:9px 12px;font:500 12px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 10px 30px -10px rgba(0,0,0,.5);',e.appendChild(s),this.tipEl=s,this.onTipMove=n=>{const o=e.getBoundingClientRect();this.tipPos={x:n.clientX-o.left,y:n.clientY-o.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},e.addEventListener("mousemove",this.onTipMove)}if(i.mode==="test"){e.style.overflow="hidden";const s=document.createElement("div");s.textContent=V("picker.testMode"),s.setAttribute("aria-label",V("picker.testMode")),s.style.cssText="position:absolute;top:18px;right:-34px;z-index:6;transform:rotate(45deg);width:140px;text-align:center;padding:4px 0;background:#f4b740;color:#1a1200;font:800 10.5px/1.4 -apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:.12em;box-shadow:0 2px 8px rgba(0,0,0,.25);pointer-events:none;",e.appendChild(s)}return this.buildBadge(e),this}buildBadge(t){var e;if(!((e=this.controller.doc)===null||e===void 0||(e=e.theme)===null||e===void 0)&&e.hideBadge)return;const i=document.createElement("a");i.href="https://seatlayer.io",i.target="_blank",i.rel="noopener noreferrer",i.setAttribute("aria-label",V("picker.poweredBy")),i.style.cssText='position:absolute;bottom:10px;right:12px;z-index:5;display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;background:rgba(255,255,255,.92);color:#4a5163;text-decoration:none;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:.02em;box-shadow:0 2px 8px rgba(0,0,0,.12);',i.innerHTML='${V("picker.poweredBy")}`,t.appendChild(i)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;const t=this.hostEl.clientWidth,e=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight;let s=this.tipPos.x+14,n=this.tipPos.y-i-12;s+e>t-8&&(s=this.tipPos.x-e-14),n<8&&(n=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,s)}px`,this.tipEl.style.top=`${Math.max(8,n)}px`}updateTooltip(t){if(!this.tipEl)return;if(!t){this.tipEl.style.display="none";return}const e=gs(t.price,t.currency,{locale:this.opts.locale,fallback:(s,n)=>`${s} ${n}`}),i=t.status==="free"?"":`
${t.status==="held"?V("map.statusHeld"):V("map.statusTaken")}
`;this.tipEl.innerHTML=`
${t.label}
${t.categoryLabel}${e}
`+i,this.tipEl.style.display="block",this.placeTooltip()}getMode(){return this.mode_}getSelection(){return this.controller.getSelection()}selectObjects(t){return this.controller.select(t)}deselectObjects(t){this.controller.deselect(t)}clearSelection(){this.controller.clearSelection()}selectCategories(t){return this.controller.selectCategories(t)}deselectCategories(t){this.controller.deselectCategories(t)}setSelectableObjects(t){this.controller.setSelectableObjects(t)}setMaxSelection(t){this.controller.setMaxSelection(t)}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(t={}){try{return await this.holdOrThrow(t)}catch(s){var e,i;return(e=(i=this.opts).onError)===null||e===void 0||e.call(i,s),null}}async holdOrThrow(t={}){const e=this.controller.getSelectionValidity();if(e&&!e.isValid){const s=e.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(s?`seatmap: select exactly ${e.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:s?"selection_count_mismatch":"selection_invalid",selection:e})}const i=await this.controller.hold(void 0,t.ttlMs);return i?{holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}:null}async resumeHold(t){try{return await this.resumeHoldOrThrow(t)}catch(s){var e,i;return(e=(i=this.opts).onError)===null||e===void 0||e.call(i,s),null}}async resumeHoldOrThrow(t){const e=await this.controller.resumeHold(t);return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}async extendHold(t){try{const s=await this.controller.extendHold(t);return s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items}:null}catch(s){var e,i;return(e=(i=this.opts).onError)===null||e===void 0||e.call(i,s),null}}getCurrentHold(){const t=this.controller.currentHold();return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(t,e,i={}){try{return await this.holdGAOrThrow(t,e,i)}catch(o){var s,n;return(s=(n=this.opts).onError)===null||s===void 0||s.call(n,o),null}}async holdGAOrThrow(t,e,i={}){const s=await this.controller.holdGA(t,e,i);return s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items}:null}async bestAvailable(t,e,i={}){try{return await this.bestAvailableOrThrow(t,e,i)}catch(o){var s,n;return(s=(n=this.opts).onError)===null||s===void 0||s.call(n,o),null}}async bestAvailableOrThrow(t,e,i={}){const s=await this.controller.bestAvailable(t,e,i);return s?{holdId:s.holdId,expiresAt:s.expiresAt,labels:s.labels,seats:s.seats,items:s.items,...i.zoneId?{zoneId:i.zoneId}:{}}:null}setSeatTier(t,e){this.controller.setSeatTier(t,e)}getFloors(){return this.controller.getFloors()}setFloor(t){if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored — this chart has a single floor");return}this.controller.setFloor(t)}setColorblindSafe(t){this.controller.setColorblindSafe(t)}setViewMode(t){this.controller.setViewMode(t)}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.controller.zoomIn()}zoomOut(){this.controller.zoomOut()}zoomToFit(){this.controller.zoomToFit()}async release(){await this.controller.release()}async releaseLabels(t){return this.controller.releaseLabels(t)}startRealtime(){var t;!(!((t=this.access)===null||t===void 0)&&t.configured)||this.realtime||(this.realtime=new Ls({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>{var i,s;return(i=(s=this.opts).onAccessUnavailable)===null||i===void 0?void 0:i.call(s,e)},sink:Hn(this.controller,{flashOnLiveChange:!0,onSelectedObjectUnavailable:(e,i)=>{var s,n;return(s=(n=this.opts).onSelectedObjectUnavailable)===null||s===void 0?void 0:s.call(n,{labels:e,reason:i})}})}),this.realtime.start())}async refreshAccess(){var t;if(!(!((t=this.access)===null||t===void 0)&&t.configured))return!1;const e=await this.access.refresh("manual");if(e){var i;await this.controller.refresh(),(i=this.realtime)===null||i===void 0||i.restart(),this.realtime||this.startRealtime()}return e}showLoadFailure(t){const e=document.createElement("div");e.setAttribute("role","status"),e.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';const i=document.createElement("div");i.textContent="The seat map didn’t load.",e.appendChild(i);const s=document.createElement("button");s.type="button",s.textContent="Try again",s.style.cssText="appearance:none;border:1px solid #c9cede;background:#fff;color:#10162a;border-radius:8px;padding:8px 16px;font:600 13px/1 inherit;cursor:pointer;",s.addEventListener("click",()=>{this.destroy(),this.render().catch(n=>{var o,a;return(o=(a=this.opts).onError)===null||o===void 0?void 0:o.call(a,n)})}),e.appendChild(s),t.appendChild(e)}destroy(){var t,e;(t=this.realtime)===null||t===void 0||t.stop(),this.realtime=null,(e=this.access)===null||e===void 0||e.clear(),this.hostEl&&this.onTipMove&&this.hostEl.removeEventListener("mousemove",this.onTipMove),this.tipEl=null,this.onTipMove=null,this.controller.destroy(),this.hostEl&&this.hostEl.parentNode&&this.hostEl.parentNode.removeChild(this.hostEl),this.hostEl=null,this.mount=null,this.rendered=!1,this.mode_=null}},Wr=["hold","resumeHold","getCurrentHold","getGAAreas","holdGA","bestAvailable","release","releaseLabels","getSelection","selectObjects","deselectObjects","clearSelection","selectCategories","deselectCategories","setSelectableObjects","setMaxSelection","getSelectionValidity","setSeatTier","getFloors","setFloor","setColorblindSafe","zoomIn","zoomOut","zoomToFit","refreshAccess"],Mf={hold:()=>Promise.resolve(null),resumeHold:()=>Promise.resolve(null),getCurrentHold:()=>null,getGAAreas:()=>[],holdGA:()=>Promise.resolve(null),bestAvailable:()=>Promise.resolve(null),release:()=>Promise.resolve(),releaseLabels:()=>Promise.resolve(!1),getSelection:()=>[],selectObjects:()=>[],deselectObjects:()=>{},clearSelection:()=>{},selectCategories:()=>[],deselectCategories:()=>{},setSelectableObjects:()=>{},setMaxSelection:()=>{},getSelectionValidity:()=>null,setSeatTier:()=>{},getFloors:()=>[],setFloor:()=>{},setColorblindSafe:()=>{},zoomIn:()=>{},zoomOut:()=>{},zoomToFit:()=>{},refreshAccess:()=>Promise.resolve(!1)};function _f(t){const e={};for(const i of Wr)e[i]=(...s)=>{const n=t();return n?n[i](...s):Mf[i]()};return e}var Kr=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Yr=[...Kr,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],Xr=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function Pf(t,e,i){const s={container:t};for(const n of Yr)s[n]=e[n];for(const n of Xr)s[n]=i[n];return s}var Rf=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),$f=2e4,Of=480,Ff=180*1e3,Bf=900*1e3,zf=.8,Df=30*1e3,Hf=1e5,Nf=4,Vf=50;function Kn(t){if(typeof t!="string")return t;const e=document.querySelector(t);if(!e)throw new Error(`EmbeddedDesigner container not found: ${t}`);return e}function Gf(t){const e=(t!=null?t:"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var qf={expired:{title:"This design session expired",body:"For your security, editing sessions are short-lived. Start a fresh one to keep designing."},mismatch:{title:"This editor doesn't match this chart",body:"The session that loaded belongs to a different chart or workspace. Reopen the designer to continue."},timeout:{title:"The designer is taking too long",body:"It did not finish loading in time. This is usually a slow connection — try again."},load:{title:"We couldn't load the designer",body:"Something went wrong while opening the editor. Please try again."}},jf=class{constructor(t){this.frame=null,this.designerOrigin="",this.overlay=null,this.timeoutTimer=null,this.renewTimer=null,this.autoRecoverUsed=!1,this.phase="loading",this.identityEstablished=!1,this.restoreContainerPosition=null,this.pinned=!1,this.frameStyleBeforeFs=null,this.docOverflowBeforeFs=null,this.bodyOverflowBeforeFs=null,this.fsKeyHandler=null,this.lastAutoHeight="",this.fillRaf=null,this.reprobeRaf=null,this.fillListening=!1,this.containerEl=null,this.fillMode=null,this.resizeObs=null,this.scheduleFill=()=>{this.fillRaf===null&&(this.fillRaf=requestAnimationFrame(()=>{this.fillRaf=null,this.applyFill()}))},this.scheduleReprobe=()=>{this.reprobeRaf===null&&(this.reprobeRaf=requestAnimationFrame(()=>{this.reprobeRaf=null,!this.pinned&&(this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill())}))},this.handleMessage=e=>{if(!this.frame||e.origin!==this.designerOrigin||e.source!==this.frame.contentWindow||!e.data||typeof e.data!="object")return;const i=e.data;if(i.type==="seatlayer.designer.resize"){!this.fillEnabled()&&this.autoResizeEnabled()&&typeof i.px=="number"&&Number.isFinite(i.px)&&i.px>0&&(this.lastAutoHeight=`${Math.round(i.px)}px`,this.pinned||this.setFrameHeight(this.lastAutoHeight));return}if(i.type==="seatlayer.designer.fullscreen"){i.on===!0?this.pinFullscreen():i.on===!1&&this.unpinFullscreen();return}if(typeof i.type!="string"||!Rf.has(i.type))return;const s={type:i.type,chartId:typeof i.chartId=="string"?i.chartId:void 0,workspaceId:typeof i.workspaceId=="string"?i.workspaceId:void 0,expiresAt:typeof i.expiresAt=="number"?i.expiresAt:void 0,code:typeof i.code=="string"?i.code:void 0,message:typeof i.message=="string"?i.message:void 0,meta:i.meta,fatal:typeof i.fatal=="boolean"?i.fatal:void 0,action:typeof i.action=="string"?i.action:void 0},n=this.identityEstablished||s.type==="seatlayer.designer.ready"||s.type==="seatlayer.designer.saved"||s.type==="seatlayer.designer.published"||s.type==="seatlayer.designer.close",o=this.options.expectedChartId!==void 0&&s.chartId!==this.options.expectedChartId&&(n||s.chartId!==void 0),a=this.options.expectedWorkspaceId!==void 0&&s.workspaceId!==this.options.expectedWorkspaceId&&(n||s.workspaceId!==void 0);if(o||a){this.showError("mismatch");return}switch(s.type){case"seatlayer.designer.ready":var r,l;this.identityEstablished=!0,this.sessionExpiresAt=s.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(s.expiresAt),(r=(l=this.options).onReady)===null||r===void 0||r.call(l,s);break;case"seatlayer.designer.saved":var c,d;(c=(d=this.options).onSaved)===null||c===void 0||c.call(d,s);break;case"seatlayer.designer.published":var u,h;(u=(h=this.options).onPublished)===null||u===void 0||u.call(h,s);break;case"seatlayer.designer.close":var p,f;(p=(f=this.options).onClose)===null||p===void 0||p.call(f,s);break;case"seatlayer.designer.error":{var v,m;const g=Gf(s.code);if(g==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof s.fatal=="boolean"?s.fatal:g!=="load"||this.phase!=="ready")&&this.showError(g),(v=(m=this.options).onError)===null||v===void 0||v.call(m,s);break}}},this.options=t}mount(){var t,e,i;this.destroy();const s=new URL(this.options.designerUrl,window.location.href);if(s.protocol!=="https:"&&s.hostname!=="localhost"&&s.hostname!=="127.0.0.1")throw new Error("EmbeddedDesigner requires an HTTPS designerUrl outside local development.");this.designerOrigin=s.origin;const n=document.createElement("iframe");n.title=(t=this.options.title)!==null&&t!==void 0?t:"Venue chart Designer",n.allow=(e=this.options.allow)!==null&&e!==void 0?e:"fullscreen; clipboard-write",n.referrerPolicy=(i=this.options.referrerPolicy)!==null&&i!==void 0?i:"origin",n.src=s.toString(),n.style.setProperty("width","100%","important"),n.style.setProperty("height",typeof this.options.height=="number"?`${this.options.height}px`:"100%","important"),n.style.border="0",Object.assign(n.style,this.options.style),this.options.className&&(n.className=this.options.className);const o=Kn(this.options.container);if(this.containerEl=o,window.addEventListener("message",this.handleMessage),o.append(n),this.frame=n,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){var a;this.ensureContainerPositioned(o),this.renderOverlay(o,"loading");const r=(a=this.options.loadingTimeoutMs)!==null&&a!==void 0?a:$f;r>0&&Number.isFinite(r)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},r))}return n}setDesignerUrl(t){return this.options={...this.options,designerUrl:t},this.mount()}getIframe(){return this.frame}setSizing(t,e){this.options={...this.options,height:t,minHeight:e},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${t}px`))}setRelaunchPolicy(t,e){this.options={...this.options,onRequestRelaunch:t,autoRenewSession:e},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){var t;window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),(t=this.frame)===null||t===void 0||t.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(t){var e;(e=this.frame)===null||e===void 0||e.style.setProperty("height",t,"important")}detectFillMode(){var t;const e=this.containerEl,i=this.frame;if(this.pinned||!e||!i)return(t=this.fillMode)!==null&&t!==void 0?t:"viewport";const s=()=>e.getBoundingClientRect().height,n=i.style.getPropertyValue("height"),o=i.style.getPropertyPriority("height");i.style.setProperty("height","0px","important");const a=s();i.style.setProperty("height",`${Hf}px`,"important");const r=s();return n?i.style.setProperty("height",n,o):i.style.removeProperty("height"),!(r-a>Nf)&&a>=Vf?"container":"viewport"}applyFill(){var t;if(!this.frame||this.pinned)return;const e=(t=this.options.minHeight)!==null&&t!==void 0?t:Of;if(this.fillMode==="container"&&this.containerEl){const n=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));this.setFrameHeight(`${n}px`);return}const i=this.frame.getBoundingClientRect().top,s=Math.max(e,Math.round(window.innerHeight-i));this.setFrameHeight(`${s}px`)}syncContainerObserver(){const t=this.fillMode==="container"&&!!this.containerEl&&typeof ResizeObserver!="undefined";t&&!this.resizeObs?(this.resizeObs=new ResizeObserver(()=>this.scheduleFill()),this.resizeObs.observe(this.containerEl)):!t&&this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null)}startFill(){this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill(),!this.fillListening&&(this.fillListening=!0,window.addEventListener("resize",this.scheduleReprobe),window.addEventListener("orientationchange",this.scheduleReprobe),window.addEventListener("scroll",this.scheduleFill,{passive:!0}))}stopFill(){this.fillRaf!==null&&(cancelAnimationFrame(this.fillRaf),this.fillRaf=null),this.reprobeRaf!==null&&(cancelAnimationFrame(this.reprobeRaf),this.reprobeRaf=null),this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null),this.fillListening&&(this.fillListening=!1,window.removeEventListener("resize",this.scheduleReprobe),window.removeEventListener("orientationchange",this.scheduleReprobe),window.removeEventListener("scroll",this.scheduleFill))}pinFullscreen(){if(this.pinned||!this.frame)return;this.pinned=!0,this.frameStyleBeforeFs=this.frame.getAttribute("style");for(const[e,i]of Object.entries({position:"fixed",top:"0",right:"0",bottom:"0",left:"0",width:"100vw",height:"100vh",margin:"0",border:"0","z-index":"2147483000",background:"#101625"}))this.frame.style.setProperty(e,i,"important");const t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=e=>{e.key==="Escape"&&this.unpinFullscreen()},window.addEventListener("keydown",this.fsKeyHandler)}unpinFullscreen(){this.pinned&&(this.pinned=!1,this.frame&&(this.frameStyleBeforeFs===null?this.frame.removeAttribute("style"):this.frame.setAttribute("style",this.frameStyleBeforeFs),this.fillEnabled()?this.applyFill():this.autoResizeEnabled()&&this.lastAutoHeight?this.setFrameHeight(this.lastAutoHeight):typeof this.options.height=="number"&&this.setFrameHeight(`${this.options.height}px`)),this.frameStyleBeforeFs=null,this.docOverflowBeforeFs!==null&&(document.documentElement.style.overflow=this.docOverflowBeforeFs,this.docOverflowBeforeFs=null),this.bodyOverflowBeforeFs!==null&&document.body&&(document.body.style.overflow=this.bodyOverflowBeforeFs,this.bodyOverflowBeforeFs=null),this.fsKeyHandler&&(window.removeEventListener("keydown",this.fsKeyHandler),this.fsKeyHandler=null))}clearTimeoutTimer(){this.timeoutTimer!==null&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)}autoRenewEnabled(){return!!this.options.onRequestRelaunch&&this.options.autoRenewSession!==!1}clearRenewTimer(){this.renewTimer!==null&&(clearTimeout(this.renewTimer),this.renewTimer=null)}scheduleRenewal(t){if(this.clearRenewTimer(),!this.autoRenewEnabled()||typeof t!="number"||!Number.isFinite(t))return;const e=t-Date.now();if(e<=0)return;const i=e{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},s)}ensureContainerPositioned(t){getComputedStyle(t).position==="static"&&(this.restoreContainerPosition=t.style.position,t.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{Kn(this.options.container).style.position=this.restoreContainerPosition}catch{}this.restoreContainerPosition=null}}removeOverlay(){var t;(t=this.overlay)===null||t===void 0||t.remove(),this.overlay=null}showError(t){if(this.phase="error",this.clearTimeoutTimer(),!this.loadingStateEnabled())return;let e;try{e=Kn(this.options.container)}catch{return}this.renderOverlay(e,"error",t)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(t,e,i){this.removeOverlay();const s=document.createElement("div");s.setAttribute("data-seatlayer-designer-overlay",e),s.setAttribute("role",e==="error"?"alert":"status"),s.setAttribute("aria-live","polite"),Object.assign(s.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:"#101625",color:"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:"hidden"}),e==="loading"?this.buildSkeleton(s):this.buildErrorCard(s,i!=null?i:"load"),t.append(s),this.overlay=s}buildSkeleton(t){const e=document.createElement("style");e.textContent="@media(prefers-reduced-motion:no-preference){@keyframes seatlayer-designer-shimmer{0%{background-position:-320px 0}to{background-position:320px 0}}[data-seatlayer-designer-overlay=loading] .sl-shimmer{animation:seatlayer-designer-shimmer 1.25s ease-in-out infinite;background-size:640px 100%}}",t.append(e);const i="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",s=document.createElement("div");Object.assign(s.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});const n=l=>{const c=document.createElement("div");return c.className="sl-shimmer",Object.assign(c.style,{background:i,borderRadius:"8px"}),Object.assign(c.style,l),c};s.append(n({height:"40px",width:"100%",flex:"0 0 auto"}));const o=document.createElement("div");Object.assign(o.style,{display:"flex",gap:"14px",flex:"1 1 auto",minHeight:"0"}),o.append(n({width:"220px",height:"100%",flex:"0 0 auto"})),o.append(n({flex:"1 1 auto",height:"100%"})),s.append(o),t.append(s);const a=document.createElement("div");Object.assign(a.style,{position:"relative",zIndex:"1",display:"flex",alignItems:"center",gap:"10px",padding:"10px 16px",borderRadius:"999px",background:"rgba(16, 22, 37, 0.72)",fontSize:"13px",fontWeight:"500",letterSpacing:"0.01em"});const r=document.createElement("span");r.className="sl-shimmer",Object.assign(r.style,{width:"9px",height:"9px",borderRadius:"50%",background:i,flex:"0 0 auto"}),a.append(r),a.append(document.createTextNode("Loading designer…")),t.append(a)}buildErrorCard(t,e){const i=qf[e],s=document.createElement("div");Object.assign(s.style,{maxWidth:"420px",margin:"0 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});const n=document.createElement("h2");n.textContent=i.title,Object.assign(n.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});const o=document.createElement("p");o.textContent=i.body,Object.assign(o.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});const a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),s.append(n,o,a),t.append(s)}};function Uf(t,e){return!Number.isFinite(t)||!Number.isFinite(e)||t<=0||e<=0?0:Math.ceil(t*e*4*1.3333333333333333)}function Wf(t){return(t!==void 0&&t<=2?32:t!==void 0&&t>=8?192:96)*1024*1024}function Kf(t){var e;const i=typeof navigator=="undefined"?void 0:navigator;return{saveData:(i==null||(e=i.connection)===null||e===void 0?void 0:e.saveData)===!0,maxTextureSize:t,maxDecodedBytes:Wf(i==null?void 0:i.deviceMemory)}}function Yf(t,e={}){var i;const s=(i=t.previewUrl)===null||i===void 0?void 0:i.trim();if(!s||s===t.url)return{initialUrl:t.url,initialWidth:t.sourceWidth,initialHeight:t.sourceHeight,reason:"full-only"};const n={initialUrl:s,initialWidth:t.previewWidth,initialHeight:t.previewHeight};return e.saveData?{...n,reason:"save-data"}:e.maxTextureSize!==void 0&&t.sourceWidth!==void 0&&t.sourceHeight!==void 0&&Math.max(t.sourceWidth,t.sourceHeight)>e.maxTextureSize?{...n,reason:"texture-limit"}:e.maxDecodedBytes!==void 0&&t.sourceWidth!==void 0&&t.sourceHeight!==void 0&&Uf(t.sourceWidth,t.sourceHeight)>e.maxDecodedBytes?{...n,reason:"memory-limit"}:{...n,upgradeUrl:t.url,reason:"progressive"}}function Zr(){return new DOMException("Panorama image load aborted","AbortError")}function Xf(t,e){return new Promise((i,s)=>{if(e!=null&&e.aborted){s(Zr());return}const n=new Image;n.crossOrigin="anonymous";let o=!1;const a=()=>{n.onload=null,n.onerror=null,e==null||e.removeEventListener("abort",l)},r=c=>{o||(o=!0,a(),c?s(c):i(n))},l=()=>{n.src="",r(Zr())};n.onload=()=>{(typeof n.decode=="function"?n.decode():Promise.resolve()).then(()=>r(),()=>r())},n.onerror=()=>r(new Error("panorama_image_failed")),e==null||e.addEventListener("abort",l,{once:!0}),n.src=t})}function Zf(t){const e=globalThis;if(e.requestIdleCallback){const s=e.requestIdleCallback(t,{timeout:1200});return()=>{var n;return(n=e.cancelIdleCallback)===null||n===void 0?void 0:n.call(e,s)}}const i=globalThis.setTimeout(t,32);return()=>globalThis.clearTimeout(i)}function Qr(t){var e;const i=t.mediaKind==="demo-render",s=t.generated||t.mediaKind==="model"?"Live 3D · chart-derived seat-eye":i?t.coverage==="exact-seat"?"AI-generated exact-seat demo":t.coverage==="row-representative"?"AI-generated representative row demo":t.coverage==="section-representative"?"AI-generated representative section demo":"AI-generated illustrative venue demo":t.coverage==="exact-seat"?"Exact seat photo":t.coverage==="row-representative"?"Representative row view":t.coverage==="section-representative"?"Representative section view":t.coverage==="venue-representative"?"Representative venue view":"Venue photo",n=t.capturedAt&&/^\d{4}/.test(t.capturedAt)?t.capturedAt.slice(0,4):"";return[s,n?`${i?"created":"captured"} ${n}`:"",(e=t.sourceLabel)!==null&&e!==void 0?e:""].filter(Boolean).join(" · ")}function Qf(t){var e,i;if(t.generated||t.mediaKind==="model"||t.mediaKind==="demo-render")return!1;const s=(e=(i=t.sourceLabel)===null||i===void 0?void 0:i.trim())!==null&&e!==void 0?e:"";return!/^(?:AI[- ]generated|generated\s+(?:demo|preview))/i.test(s)}function Jf(t){return t==="exact-seat"?"Exact seat in the model":t==="row-representative"?"Representative row evidence":t==="section-representative"?"Representative section evidence":t==="floor-representative"?"Representative floor evidence":"Representative venue evidence"}function ev(t){if(!t)return"No assessment date supplied";const e=new Date(t);return Number.isFinite(e.getTime())?`Assessed ${e.toISOString().slice(0,10)}`:"No assessment date supplied"}function Yn(t){var e,i,s;if(!t)return{headline:"Generated view · unverified",model:"No geometry or event-configuration verification supplied",reality:"No real-world check supplied",coverage:"Selected chart seat",provenance:"Chart-derived model",freshness:"No evidence date supplied",limitations:["Generated view is not surveyed sightline truth."]};const n=t.evidenceKind==="synthetic-model",o=t.modelLevel==="configuration-verified"?"Event configuration verified":t.modelLevel==="geometry-verified"?"Venue geometry verified":n?"Versioned synthetic model":"Generated model · not verified",a=t.realityLevel==="actual-build-checked"?"Actual event build reality checked":t.realityLevel==="comparable-build-reference"?"Comparable-build reference only":"No real-world check supplied",r=n?"Synthetic model evidence":t.modelLevel==="configuration-verified"?"Configuration verified":t.modelLevel==="geometry-verified"?"Geometry verified":"Generated view · unverified",l=[...(e=t.limitations)!==null&&e!==void 0?e:[],...n?["Synthetic demo; not surveyed or venue-certified."]:[]],c=t.modeledTarget?`${t.modeledTarget.clearRayCount}/${t.modeledTarget.totalRayCount} target rays clear · ${t.modeledTarget.classification} in bounded model`:void 0;return c&&l.push("Modeled target is not a percentage of the show visible."),{headline:r,model:o,reality:a,coverage:Jf(t.coverage),provenance:(i=(s=t.sourceLabel)!==null&&s!==void 0?s:t.approvedByRole)!==null&&i!==void 0?i:"Source not supplied",freshness:ev(t.assessedAt),limitations:l,...c?{modeledTarget:c}:{}}}function Jr(t){return(t==null?void 0:t.previousPrice)!=null&&t.previousPrice>t.price?t.previousPrice:null}function tv(t){return iv(t)+(t.moreLabel?``:"")+sv(t.status)}function iv(t){const{esc:e,money:i}=t;return t.categories.map(s=>{var n;const o=t.priceOf(s),a=t.rangeOf(s),r=t.offerOf(s.key),l=Jr(r),c=t.activeKey===s.key;return`
${e(s.label)}`+(r!=null&&r.offerName?`${e(r.offerName)}`:"")+`${t.leftCount((n=t.left[s.key])!==null&&n!==void 0?n:0)}`+(l!=null?`${e(i(l))}`:"")+(a!=null?`${a.min===a.max?i(a.min):`${i(a.min)}–${i(a.max)}`}`:o!=null?`${i(o)}`:"")+"
"}).join("")}function sv(t){return`
${t.held}${t.sold}
`}function nv(t){const{esc:e,money:i}=t;return t.categories.map(s=>{const n=t.rangeOf(s),o=t.priceOf(s),a=n?n.min===n.max?i(n.min):`${i(n.min)}+`:o!=null?i(o):null,r=Object.prototype.hasOwnProperty.call(t.left,s.key)&&t.left[s.key]<=0,l=Jr(t.offerOf(s.key)),c=a?`${s.label} — ${a}${r?` (${t.soldOutWord})`:""}`:s.label;return``}).join("")}var ov=/^[a-zA-Z0-9._-]+$/;function av(t){let e;try{e=new URL(t,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;const i=/^\/pub\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!i)return null;try{const s=decodeURIComponent(i[1]),n=decodeURIComponent(i[2]);return!s||!ov.test(n)?null:{eventKey:s,asset:n}}catch{return null}}function rv(t){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(t,"https://seatlayer.invalid").pathname)}catch{return!1}}var lv=class{constructor(t,e){this.eventKey=t,this.load=e,this.pending=new Map,this.created=new Set,this.disposed=!1}resolve(t){const e=av(t);if(!e)return Promise.resolve(rv(t)?null:t);if(e.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);const i=this.pending.get(t);if(i)return i;const s=this.load(this.eventKey,e.asset).then(n=>{const o=URL.createObjectURL(n);return this.disposed?(URL.revokeObjectURL(o),null):(this.created.add(o),o)}).catch(n=>{throw this.pending.delete(t),n});return this.pending.set(t,s),s}dispose(){if(!this.disposed){this.disposed=!0;for(const t of this.created)URL.revokeObjectURL(t);this.created.clear(),this.pending.clear()}}},cv=["on-sale","low","sold-out","presale","closed"];function Bi(t){return t==null?null:typeof t=="number"&&Number.isFinite(t)&&t>=0?t:void 0}function el(t){return t==null?null:typeof t=="number"&&Number.isFinite(t)&&t>=0?t:void 0}function tl(t){if(t==null)return null;if(typeof t!="object"||Array.isArray(t))return;const e=t,i=e.count,s=e.index;if(typeof s!="number"||!Number.isInteger(s)||s<1||typeof i!="number"||!Number.isInteger(i)||id===e.state);if(!i)return null;const s=Bi(e.fromPrice),n=Bi(e.previousPrice);if(s===void 0||n===void 0)return null;const o=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(o===void 0)return null;const a=tl(e.release);if(a===void 0)return null;const r=e.upcoming===void 0?null:tl(e.upcoming);if(r===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;const d=[];for(const u of e.prices){if(!u||typeof u!="object"||Array.isArray(u))return null;const h=u,p=typeof h.categoryKey=="string"?h.categoryKey.trim():"";if(!p)return null;const f=Bi(h.price),v=Bi(h.previousPrice);if(f==null||v===void 0)return null;const m={categoryKey:p,price:f,previousPrice:v};if(h.offerId!==void 0){if(typeof h.offerId!="string"||!h.offerId.trim())return null;m.offerId=h.offerId.trim()}if(h.offerName!==void 0){if(typeof h.offerName!="string"||!h.offerName.trim())return null;m.offerName=h.offerName.trim()}if(h.remaining!==void 0){if(h.remaining!==null&&(typeof h.remaining!="number"||!Number.isInteger(h.remaining)||h.remaining<0))return null;m.remaining=h.remaining==null?null:h.remaining}for(const g of["startsAt","endsAt"]){if(h[g]===void 0)continue;const b=el(h[g]);if(b===void 0)return null;m[g]=b}d.push(m)}l=d}const c=dv(e.channelPricing);return c===void 0?null:{state:i,fromPrice:s,previousPrice:n,currency:o,release:a,upcoming:r,prices:l,channelPricing:c}}function hv(t,e){if(!t)return null;let i=null;const s=n=>{n!=null&&n>e&&(i===null||n*{min-width:300px}.sl-side-toggle{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:0 12px;border-radius:999px;font-size:11px;font-weight:800;letter-spacing:.02em;white-space:nowrap;background:var(--sl-surface);border:1px solid var(--sl-line);color:var(--sl-text);transition:border-color .15s}.sl-side-toggle:hover{border-color:var(--sl-muted)}.sl-side-toggle svg{width:13px;height:13px;stroke:currentColor;stroke-width:2.2;fill:none;stroke-linecap:round;stroke-linejoin:round}.sl-picker[data-layout=narrow] .sl-side-toggle{display:none}.sl-picker[data-layout=narrow] .sl-body{flex-direction:column}.sl-picker[data-layout=narrow] .sl-map{min-height:0;flex:1}.sl-picker[data-layout=narrow] .sl-side{width:100%;border-left:0;border-top:1px solid var(--sl-line);flex:none;height:calc(min(72%,480px) + var(--sl-safe-b));padding-bottom:var(--sl-safe-b);overflow:hidden;transition:height .3s cubic-bezier(.2,.8,.2,1);overscroll-behavior:contain}.sl-picker[data-layout=narrow][data-sheet=open][data-has-selection=false] .sl-side{height:calc(min(380px,64%) + var(--sl-safe-b))}.sl-picker[data-layout=narrow][data-sheet=open][data-prices-open=true] .sl-side{height:calc(min(480px,74%) + var(--sl-safe-b))}.sl-picker[data-layout=narrow][data-sheet=peek] .sl-side{height:calc(76px + var(--sl-safe-b));overflow:hidden}.sl-picker[data-layout=narrow][data-sheet=peek] .sl-side>:not(.sl-sheet-head){display:none}.sl-picker[data-layout=narrow] .sl-tray{flex:1;min-height:96px;overflow-y:auto;overscroll-behavior:contain}.sl-picker[data-layout=narrow][data-prices-open=true] .sl-tray{min-height:48px}.sl-picker[data-layout=narrow] .sl-prices{max-height:150px;overflow-y:auto;overscroll-behavior:contain}.sl-picker[data-layout=narrow] .sl-foot{position:static;background:var(--sl-bg)}.sl-picker[data-layout=narrow] .sl-total{display:none}.sl-picker[data-layout=narrow] .sl-foot{padding:8px 12px}.sl-picker[data-layout=narrow] .sl-hold-note{margin-bottom:6px;padding:5px 9px}.sl-picker[data-layout=narrow] .sl-hold-note svg{display:none}.sl-picker[data-layout=narrow] .sl-hold-note b{display:inline;margin-right:6px;font-size:11px}.sl-picker[data-layout=narrow] .sl-hold-copy{display:inline;white-space:normal;font-size:10.5px}.sl-picker[data-layout=narrow] .sl-powered{margin-top:4px;padding:2px 8px;font-size:11px}.sl-picker[data-layout=narrow] .sl-tray{scrollbar-width:thin}.sl-picker[data-layout=narrow] .sl-foot.empty{display:none}.sl-picker[data-layout=narrow] .sl-sheet-head{order:0}.sl-picker[data-layout=narrow] .sl-seats-sec{display:none}.sl-picker[data-layout=narrow] .sl-tray{order:2}.sl-picker[data-layout=narrow] .sl-filtersec{order:3}.sl-picker[data-layout=narrow] .sl-filters{order:4}.sl-picker[data-layout=narrow] .sl-prices-sec{order:5}.sl-picker[data-layout=narrow] .sl-prices-hint,.sl-picker[data-layout=narrow] .sl-pricef{order:6}.sl-picker[data-layout=narrow] .sl-prices{order:7}.sl-picker[data-layout=narrow] .sl-foot{order:8}.sl-picker[data-layout=narrow] .sl-tray-hint,.sl-picker[data-layout=narrow] .sl-filtersec,.sl-picker[data-layout=narrow] .sl-filters,.sl-picker[data-layout=narrow] .sl-prices-sec,.sl-picker[data-layout=narrow] .sl-prices-hint,.sl-picker[data-layout=narrow] .sl-prices{display:none!important}.sl-picker[data-layout=narrow][data-has-selection=true] .sl-filtersec,.sl-picker[data-layout=narrow][data-has-selection=true] .sl-filters,.sl-picker[data-layout=narrow][data-has-selection=true] .sl-prices-sec{display:none}.sl-picker[data-layout=narrow][data-has-selection=true]:not([data-ba-active=true]) .sl-ba{display:none}.sl-picker[data-layout=narrow] .sl-zoom [data-ref=zin],.sl-picker[data-layout=narrow] .sl-zoom [data-ref=zout]{display:none}.sl-picker[data-layout=narrow][data-zoomed=true] .sl-zoom [data-ref=zout]{display:inline-flex}.sl-rail{display:none;align-items:center;gap:7px;padding:7px 10px;flex:none;background:var(--sl-surface);border-bottom:1px solid var(--sl-line)}.sl-picker[data-layout=narrow] .sl-rail.has{display:flex}.sl-picker[data-view3d=on] .sl-rail{display:none!important}.sl-picker[data-layout=narrow] .sl-rail .sl-chips{flex:none;display:flex;gap:6px;padding-right:7px;margin-right:1px;border-right:1px solid var(--sl-line)}.sl-rail-scroll{display:flex;align-items:center;gap:6px;flex:1;min-width:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity;padding:1px}.sl-rail-scroll::-webkit-scrollbar{display:none}.sl-rc{display:inline-flex;align-items:center;gap:6px;flex:none;min-height:34px;padding:7px 11px;border-radius:999px;background:var(--sl-bg);border:1px solid var(--sl-line);color:var(--sl-text);font-size:12px;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap;scroll-snap-align:start;transition:border-color .15s,background .15s}.sl-rc:hover,.sl-rc:focus-visible{border-color:var(--sl-muted)}.sl-rc-dot{width:9px;height:9px;border-radius:50%;flex:none}.sl-rc-was{color:var(--sl-muted);font-weight:500;text-decoration:line-through}.sl-rc[aria-pressed=true]{background:var(--sl-accent);color:var(--sl-accent-ink);border-color:transparent}.sl-rc[aria-pressed=true] .sl-rc-was{color:color-mix(in srgb,var(--sl-accent-ink) 55%,transparent)}.sl-rc:disabled{opacity:.45;cursor:default}.sl-rc:disabled .sl-rc-t{text-decoration:line-through}.sl-sheet-head{display:none;flex-direction:column;justify-content:center;padding:6px 12px 8px;min-height:56px;cursor:pointer;touch-action:none;user-select:none;-webkit-user-select:none;flex:none}.sl-picker[data-layout=narrow] .sl-sheet-head{display:flex;min-height:52px;padding:3px 10px 5px}.sl-picker[data-layout=narrow][data-sheet=open] .sl-sheet-head{min-height:42px}.sl-picker[data-layout=narrow][data-sheet=open] .sl-sheet-bar{min-height:32px}.sl-picker[data-layout=narrow][data-sheet=open] .sl-sheet-peek .go{display:none}.sl-picker[data-layout=narrow][data-sheet=peek] .sl-sheet-head{height:100%}.sl-sheet-grab{width:36px;height:4px;border-radius:999px;background:var(--sl-muted);opacity:.55;margin:1px auto 5px}.sl-sheet-bar{display:flex;align-items:center;gap:8px;min-height:44px}.sl-sheet-peek{display:flex;align-items:center;gap:7px;flex:1;min-width:0;font-size:13px;font-weight:700;color:var(--sl-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sl-sheet-peek .sub{color:var(--sl-muted);font-weight:600}.sl-sheet-peek .go{margin-left:auto;flex:none;display:inline-flex;align-items:center;min-height:30px;padding:6px 13px;border-radius:999px;background:var(--sl-accent);color:var(--sl-accent-ink);font-weight:800;font-size:12.5px}.sl-sheet-peek .go.ghost{background:transparent;color:var(--sl-text);border:1px solid var(--sl-line);font-weight:750}.sl-sheet-peek .go.ghost:hover,.sl-sheet-peek .go.ghost:focus-visible{border-color:var(--sl-accent);color:var(--sl-accent-text)}.sl-sheet-peek .go.ghost+.go{margin-left:0}.sl-sheet-toggle{width:44px;height:44px;margin:-8px -8px -8px 0;border-radius:999px;flex:none;display:flex;align-items:center;justify-content:center;color:var(--sl-muted);transition:color .15s,background .15s}.sl-sheet-toggle:hover,.sl-sheet-toggle:focus-visible{color:var(--sl-text);background:color-mix(in srgb,var(--sl-line) 44%,transparent)}.sl-sheet-toggle svg{width:21px;height:21px;stroke:currentColor;stroke-width:2.4;fill:none;stroke-linecap:round;stroke-linejoin:round}.sl-sheet-toggle svg{transform:rotate(0);transition:transform .24s cubic-bezier(.2,.8,.2,1)}.sl-picker[data-sheet=open] .sl-sheet-toggle svg{transform:rotate(180deg)}.sl-filtersec{display:none}.sl-filters{display:none;gap:6px;flex-wrap:wrap;align-items:center;padding:2px 16px 10px}.sl-picker[data-layout=narrow][data-sheet=open][data-prices-open=true] .sl-prices-sec{display:flex!important}.sl-picker[data-layout=narrow][data-sheet=open][data-prices-open=true] .sl-prices-hint{display:block!important}.sl-picker[data-layout=narrow][data-sheet=open][data-prices-open=true] .sl-prices{display:flex!important}.sl-picker[data-layout=narrow][data-sheet=open] .sl-tray-hint{display:block!important}.sl-picker[data-layout=narrow] .sl-prices-sec{cursor:pointer}.sl-picker[data-layout=narrow] .sl-prices-sec:after{content:"";width:8px;height:8px;flex:none;margin-left:auto;border-right:2px solid var(--sl-muted);border-bottom:2px solid var(--sl-muted);transform:rotate(45deg);transition:transform .2s cubic-bezier(.2,.8,.2,1)}.sl-picker[data-layout=narrow][data-prices-open=true] .sl-prices-sec:after{transform:rotate(-135deg)}.sl-cbbtn{width:32px;height:32px;border-radius:999px;background:var(--sl-surface);border:1px solid var(--sl-line);color:var(--sl-text);display:flex;align-items:center;justify-content:center;transition:border-color .15s}.sl-cbbtn:hover{border-color:var(--sl-muted)}.sl-cbbtn svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}.sl-offer{display:none;margin:12px 14px 2px;padding:12px;border:1px solid color-mix(in srgb,var(--sl-accent) 34%,var(--sl-line));border-radius:12px;background:color-mix(in srgb,var(--sl-accent) 8%,var(--sl-surface));color:var(--sl-text)}.sl-offer.has{display:block}.sl-offer-main{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.sl-offer-copy{min-width:0}.sl-offer-kicker{display:block;font-size:10px;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:var(--sl-accent-text)}.sl-offer-name{display:block;margin-top:2px;font-size:13px;font-weight:800;line-height:1.3}.sl-offer-line{display:block;margin-top:3px;font-size:11px;line-height:1.35;color:var(--sl-muted)}.sl-offer-info{position:relative;flex:none}.sl-offer-info>summary{list-style:none;width:25px;height:25px;border:1px solid var(--sl-line);border-radius:999px;display:grid;place-items:center;cursor:pointer;font-size:12px;font-weight:850;color:var(--sl-text);background:var(--sl-surface)}.sl-offer-info>summary::-webkit-details-marker{display:none}.sl-offer-info[open]>summary{border-color:var(--sl-accent);color:var(--sl-accent-text)}.sl-offer-detail{margin-top:10px;padding-top:9px;border-top:1px solid var(--sl-line);font-size:10.5px;line-height:1.45;color:var(--sl-muted)}.sl-sec{padding:14px 14px 4px;font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--sl-muted);font-weight:700}.sl-prices-sec{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:13px}.sl-price-select{min-height:32px;max-width:130px;padding:5px 28px 5px 9px;border:1px solid var(--sl-line);border-radius:9px;background-color:var(--sl-surface);color:var(--sl-text);font:inherit;font-size:11px;font-weight:750;letter-spacing:0;text-transform:none}.sl-prices-hint{padding:0 14px 7px;font-size:11px;line-height:1.45;color:var(--sl-muted)}.sl-picker[data-has-selection=true] .sl-prices-hint,.sl-picker[data-sales-closed=true] .sl-prices-hint{display:none}.sl-prices{display:flex;flex-direction:column;padding:4px 14px 8px;border-bottom:1px solid var(--sl-line)}.sl-prices-sec,.sl-prices,.sl-seats-sec{flex:none}.sl-price-row{display:flex;align-items:center;gap:7px;min-height:28px;font-size:12px;padding:0 6px;margin:0 -6px;border-radius:8px;cursor:pointer;transition:background .15s}.sl-price-row:hover,.sl-price-row:focus-visible{background:color-mix(in srgb,var(--sl-line) 40%,transparent)}.sl-price-row.sl-active{background:color-mix(in srgb,var(--sl-accent) 9%,transparent)}.sl-price-was{margin-left:auto;color:var(--sl-muted);font-size:10px;text-decoration:line-through}.sl-price-offer{display:block;color:var(--sl-accent-text);font-size:10px;font-weight:750}.sl-price-row.sl-active .sl-price-label{color:var(--sl-accent-text)}.sl-dot{width:9px;height:9px;border-radius:50%;flex:none}.sl-price-label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}.sl-price-left{font-size:11px;color:var(--sl-muted);font-variant-numeric:tabular-nums}.sl-price-amt{font-weight:800;font-variant-numeric:tabular-nums}.sl-prices.sl-expanded{max-height:196px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.sl-price-more{display:flex;align-items:center;min-height:26px;padding:0;color:var(--sl-muted);font-size:11px;font-weight:750;transition:color .15s}.sl-price-more:hover,.sl-price-more:focus-visible{color:var(--sl-text)}.sl-status-key{display:flex;gap:11px;flex-wrap:wrap;padding:5px 0 0;margin-top:4px;border-top:1px solid var(--sl-line);color:var(--sl-muted);font-size:10px}.sl-status-item{display:inline-flex;align-items:center;gap:5px}.sl-status-icon{width:13px;height:13px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;color:#fff;background:#6b7280;line-height:1}.sl-status-icon svg{width:8px;height:8px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}.sl-status-icon.sold{background:#8b93a0}.sl-status-icon.sold svg{width:9px;height:9px;stroke-width:2.4}.sl-seats-sec{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:13px}.sl-seat-summary{font-size:10px;letter-spacing:0;text-transform:none;white-space:nowrap}.sl-tray{flex:1;padding:10px 14px 14px;display:flex;flex-direction:column;gap:7px;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}.sl-tray-hint{font-size:12.5px;color:var(--sl-muted);line-height:1.5}.sl-chip{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 34px;align-items:stretch;flex:none;min-height:53px;border:1px solid var(--sl-line);border-radius:var(--sl-r-sm);overflow:hidden;background:var(--sl-surface);font-size:13px;transform-origin:center;transition:border-color .15s,background .15s}.sl-chip:hover{border-color:color-mix(in srgb,var(--sl-accent) 38%,var(--sl-line))}.sl-chip.sl-enter{animation:slChipIn .38s cubic-bezier(.2,.8,.2,1) both}.sl-chip.sl-leave{pointer-events:none;animation:slChipOut .16s ease-in both}.sl-chip.sl-held{border-color:var(--sl-line);background:color-mix(in srgb,var(--sl-accent) 7%,var(--sl-surface));box-shadow:inset 3px 0 color-mix(in srgb,var(--sl-accent) 72%,transparent)}.sl-ticket-state{width:17px;height:17px;border-radius:999px;flex:none;display:flex;align-items:center;justify-content:center;background:var(--sl-accent);color:var(--sl-accent-ink)}.sl-ticket-state.held{background:color-mix(in srgb,var(--sl-accent) 18%,var(--sl-surface));color:var(--sl-accent-text)}.sl-ticket-state svg{width:10px;height:10px;stroke:currentColor;stroke-width:2.6;fill:none;stroke-linecap:round;stroke-linejoin:round}.sl-chip-main{min-width:0;padding:8px 10px 8px 11px;display:flex;flex-direction:column;justify-content:center;gap:5px}.sl-chip-id{display:flex;gap:12px;min-width:0}.sl-chip-id .fld{min-width:0}.sl-chip-id .fld.sec{flex:1}.sl-chip-id .fld.mid{flex:none;text-align:center}.sl-chip-eb{display:block;font-size:10px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--sl-muted);margin-bottom:1px}.sl-chip-id .val{display:block;font-weight:600;font-size:13px;line-height:1.25;white-space:nowrap}.sl-chip-id .fld.sec .val{overflow:hidden;text-overflow:ellipsis}.sl-chip-sub{display:flex;align-items:center;gap:6px;min-width:0}.sl-chip .cat{color:var(--sl-muted);font-size:10.5px;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sl-chip .amt{font-weight:700;font-variant-numeric:tabular-nums;flex:none;white-space:nowrap}.sl-chip-rail{display:flex;flex-direction:column;border-left:1px solid var(--sl-line)}.sl-chip .rm,.sl-chip .view{flex:1;min-height:26px;border-radius:0;display:flex;align-items:center;justify-content:center;color:var(--sl-muted);transition:color .15s,background .15s}.sl-chip .view{border-top:1px solid var(--sl-line)}.sl-chip .rm:hover,.sl-chip .rm:focus-visible{color:var(--sl-danger);background:color-mix(in srgb,var(--sl-danger) 9%,transparent)}.sl-chip .view:hover,.sl-chip .view:focus-visible{color:var(--sl-text);background:color-mix(in srgb,var(--sl-accent) 10%,transparent)}.sl-chip .rm svg{width:11px;height:11px;stroke:currentColor;stroke-width:2.4;fill:none;stroke-linecap:round}.sl-chip .view svg{width:13px;height:13px;stroke:currentColor;stroke-width:1.8;fill:none}.sl-live{display:none;align-items:center;gap:7px;margin:10px 14px 0;padding:7px 9px;flex:none;border:1px solid var(--sl-line);border-radius:8px;background:color-mix(in srgb,var(--sl-accent) 4%,var(--sl-surface));font-size:11px;color:var(--sl-muted)}.sl-live .dot{width:6px;height:6px;border-radius:999px;background:var(--sl-success);box-shadow:0 0 6px color-mix(in srgb,var(--sl-success) 75%,transparent);flex:none}.sl-live span:last-child{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sl-live.on{display:flex;animation:slNoticeIn .38s cubic-bezier(.2,.8,.2,1) both}.sl-ga{display:flex;align-items:center;gap:10px;padding:9px 11px;border:1px dashed var(--sl-line);border-radius:var(--sl-r-sm)}.sl-ga-info{flex:1;min-width:0}.sl-ga-name{font-weight:700;font-size:13px}.sl-ga-sub{font-size:11px;color:var(--sl-muted);margin-top:2px}.sl-ga-qty{display:flex;align-items:center;gap:8px}.sl-ga-qty button{width:26px;height:26px;border-radius:999px;background:var(--sl-surface);border:1px solid var(--sl-line);font-size:15px;font-weight:700;display:flex;align-items:center;justify-content:center;transition:border-color .15s}.sl-ga-qty button:hover{border-color:var(--sl-muted)}.sl-ga-qty span{min-width:16px;text-align:center;font-weight:800;font-variant-numeric:tabular-nums}.sl-foot{position:relative;z-index:2;padding:10px 16px 8px;border-top:1px solid var(--sl-line);flex:none;background:var(--sl-bg);box-shadow:0 -10px 24px -22px #000000b8}.sl-hold-note{display:none;align-items:center;gap:7px;margin-bottom:8px;padding:7px 8px;border-radius:var(--sl-r-sm);border:1px solid var(--sl-line);background:color-mix(in srgb,var(--sl-accent) 7%,var(--sl-surface));box-shadow:inset 3px 0 color-mix(in srgb,var(--sl-accent) 72%,transparent);font-size:11.5px;line-height:1.35;color:var(--sl-muted)}.sl-hold-note.on{display:flex;animation:slNoticeIn .38s cubic-bezier(.2,.8,.2,1) both}.sl-hold-note svg{width:16px;height:16px;flex:none;stroke:var(--sl-accent);stroke-width:2.4;fill:none;stroke-linecap:round;stroke-linejoin:round}.sl-hold-note b{display:block;color:var(--sl-text);font-size:11.5px;white-space:nowrap}.sl-hold-copy{display:block;white-space:nowrap;font-size:10.5px}.sl-hold-note>span{flex:1;min-width:0}.sl-hold-change{flex:none;min-height:30px;padding:5px 8px;border-radius:8px;border:1px solid var(--sl-line);color:var(--sl-text);font-size:10.5px;font-weight:750;white-space:nowrap}.sl-hold-change:hover,.sl-hold-change:focus-visible{border-color:var(--sl-accent);color:var(--sl-accent-text)}.sl-hold-change:disabled{opacity:.58;cursor:wait}.sl-total{display:flex;justify-content:space-between;align-items:center;font-size:13px;margin-bottom:10px}.sl-total b{font-size:17px;font-variant-numeric:tabular-nums}.sl-value-pop{animation:slValuePop .32s cubic-bezier(.2,.8,.2,1)}.sl-picker .sl-cta{display:flex;align-items:center;justify-content:center;width:100%;min-height:44px;padding:12px 16px;border-radius:var(--sl-r-sm);font-weight:800;font-size:14px;line-height:1.1;background:var(--sl-accent);color:var(--sl-accent-ink);transition:filter .15s,background .22s,color .22s,transform .12s,box-shadow .22s;gap:8px}.sl-picker .sl-cta:hover{filter:brightness(1.08)}.sl-picker .sl-cta:active{transform:translateY(1px);filter:brightness(.94)}.sl-picker .sl-cta.sl-ready{animation:slCtaReady .42s cubic-bezier(.2,.8,.2,1)}.sl-cta-spin,.sl-ba-spin{width:14px;height:14px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:slspin .7s linear infinite;flex:none}.sl-picker .sl-cta:disabled{background:color-mix(in srgb,var(--sl-bg) 35%,var(--sl-surface));color:var(--sl-muted);box-shadow:inset 0 0 0 1px var(--sl-line);opacity:1;cursor:not-allowed;filter:none;transform:none}.sl-anchor{position:absolute;z-index:5;display:flex;align-items:center;gap:8px;pointer-events:none}.sl-anchor>*{pointer-events:auto}.sl-anchor[data-region=top-left]{top:12px;left:12px;flex-wrap:wrap;max-width:38%}.sl-anchor[data-region=top-center]{top:12px;left:50%;transform:translate(-50%);flex-direction:column;align-items:center;max-width:44%}.sl-anchor[data-region=top-right]{top:12px;right:12px;justify-content:flex-end;flex-wrap:wrap;max-width:38%}.sl-anchor[data-region=left-rail]{top:50%;left:12px;transform:translateY(-50%);flex-direction:column;max-width:42%;gap:6px}.sl-anchor[data-region=bottom-left]{left:12px;bottom:12px;flex-direction:column;align-items:flex-start}.sl-anchor[data-region=bottom-center]{left:50%;bottom:14px;transform:translate(-50%);z-index:9;flex-direction:column;align-items:center;gap:8px;max-width:92%}.sl-anchor[data-region=bottom-right]{right:12px;bottom:12px;flex-direction:column;align-items:flex-end;gap:6px}.sl-picker[data-layout=narrow] .sl-anchor[data-region=top-left]{max-width:30%}.sl-picker[data-layout=narrow] .sl-anchor[data-region=top-center]{max-width:44%}.sl-testbadge{display:inline-flex;align-items:center;padding:5px 10px;border-radius:7px;pointer-events:none;font-size:10px;font-weight:850;letter-spacing:.13em;line-height:1.2;text-transform:uppercase;white-space:nowrap;color:var(--sl-warn-text);background:color-mix(in srgb,var(--sl-warn) 13%,var(--sl-surface));border:1px dashed color-mix(in srgb,var(--sl-warn) 55%,transparent)}.sl-zoom{display:flex;flex-direction:column;gap:6px}.sl-picker.sl-fs{position:fixed;inset:0;z-index:2147483000;width:auto;height:auto;max-height:none;border-radius:0}.sl-zoom button{width:36px;height:36px;border-radius:999px;background:color-mix(in srgb,var(--sl-surface) 72%,transparent);backdrop-filter:blur(8px);border:1px solid color-mix(in srgb,var(--sl-line) 80%,transparent);color:var(--sl-text);font-size:17px;font-weight:700;display:flex;align-items:center;justify-content:center;transition:border-color .15s}.sl-zoom button:hover{border-color:var(--sl-muted)}.sl-zoom svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}.sl-zfs-lbl{display:none}.sl-fs-pill.sl-fs-pill{display:inline-flex;align-items:center;justify-content:center;width:auto;min-height:40px;height:auto;padding:0 13px;gap:6px;border-radius:999px;font-size:11px;font-weight:800;background:var(--sl-surface);border:1px solid var(--sl-line);color:var(--sl-text);transition:border-color .15s}.sl-fs-pill.sl-fs-pill:hover{border-color:var(--sl-muted)}.sl-fs-pill svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}.sl-fs-pill .sl-zfs-lbl{display:inline;letter-spacing:.02em;white-space:nowrap}.sl-head .sl-fs-pill{min-height:34px;min-width:34px;width:34px;padding:0;flex:none}.sl-head .sl-fs-pill .sl-zfs-lbl{display:none}.sl-toast{transform:translateY(6px) scale(.98);max-width:100%;background:var(--sl-surface);border:1px solid var(--sl-line);color:var(--sl-text);border-radius:999px;padding:9px 16px;font-size:12.5px;font-weight:600;opacity:0;pointer-events:none;transition:opacity .22s,transform .22s;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sl-toast.on{opacity:1;transform:translateY(0) scale(1)}.sl-toast.has-action{pointer-events:auto;display:flex;align-items:center;gap:12px;padding-right:8px}.sl-toast-action{min-height:30px;padding:5px 10px;border-radius:999px;background:var(--sl-accent);color:var(--sl-accent-ink);font:inherit;font-weight:800}.sl-toast[data-tone=error]{border-color:var(--sl-danger)}.sl-toast[data-tone=warning]{border-color:var(--sl-accent)}.sl-toast[data-tone=success]{border-color:var(--sl-success)}.sl-toast.on[data-tone=error]{animation:slToastNudge .32s ease-out}.sl-boot{position:absolute;inset:0;z-index:6;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:var(--sl-bg);font-size:13px;font-weight:600;color:var(--sl-muted)}.sl-boot-spin{width:24px;height:24px;border-radius:50%;border:3px solid var(--sl-line);border-top-color:var(--sl-accent);animation:slspin .8s linear infinite}@keyframes slspin{to{transform:rotate(360deg)}}.sl-boot-title{font-weight:800;font-size:15px;color:var(--sl-text)}.sl-boot-retry{margin-top:4px;padding:9px 20px;border-radius:var(--sl-r-sm);background:var(--sl-accent);color:var(--sl-accent-ink);font-weight:700;font-size:13px}.sl-extend{transform:translateY(6px);display:none;align-items:center;gap:12px;max-width:100%;background:var(--sl-surface);border:1px solid var(--sl-line);color:var(--sl-text);border-radius:14px;padding:10px 12px 10px 16px;box-shadow:0 18px 50px -18px #0009;opacity:0;transition:opacity .2s,transform .2s}.sl-extend.on{display:flex;opacity:1;transform:translateY(0)}.sl-extend-txt{font-size:12.5px;font-weight:600;line-height:1.35}.sl-extend-txt b{font-variant-numeric:tabular-nums}.sl-extend-btn{flex:none;padding:8px 14px;border-radius:999px;font-weight:800;font-size:12.5px;background:var(--sl-accent);color:var(--sl-accent-ink);transition:filter .15s,opacity .15s}.sl-extend-btn:hover{filter:brightness(1.08)}.sl-extend-btn:disabled{opacity:.62;cursor:not-allowed}.sl-booked{position:absolute;inset:0;z-index:11;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;text-align:center;padding:28px;background:var(--sl-bg);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .34s ease,visibility 0s linear .34s}.sl-booked.on{opacity:1;visibility:visible;pointer-events:auto;transition:opacity .34s ease,visibility 0s}.sl-booked-badge{width:60px;height:60px;border-radius:999px;display:flex;align-items:center;justify-content:center;background:var(--sl-accent);color:var(--sl-accent-ink);transform:scale(.72)}.sl-booked.on .sl-booked-badge{animation:slSuccessPop .58s cubic-bezier(.2,1.25,.3,1) .08s both}.sl-booked-badge svg{width:30px;height:30px;stroke:currentColor;stroke-width:2.6;fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:30;stroke-dashoffset:30}.sl-booked.on .sl-booked-badge svg{animation:slCheckDraw .42s ease-out .32s forwards}.sl-booked-title{font-weight:800;font-size:19px;color:var(--sl-text)}.sl-booked-sub{font-size:13px;color:var(--sl-muted);line-height:1.5;max-width:320px}.sl-booked-seats{font-weight:700;color:var(--sl-text)}.sl-booked.on .sl-booked-title,.sl-booked.on .sl-booked-sub{animation:slCopyRise .42s ease-out both}.sl-booked.on .sl-booked-title{animation-delay:.22s}.sl-booked.on .sl-booked-sub{animation-delay:.3s}.sl-soldout{position:absolute;inset:0;z-index:10;display:none;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:8px;padding:24px;background:color-mix(in srgb,var(--sl-bg) 82%,transparent);backdrop-filter:blur(4px)}.sl-soldout.on{display:flex}.sl-soldout-eyebrow{font-size:10px;letter-spacing:.2em;text-transform:uppercase;color:var(--sl-accent-text);font-weight:800}.sl-soldout-title{font-size:32px;font-weight:800;color:var(--sl-text);line-height:1.05}.sl-soldout-copy{max-width:360px;font-size:13px;color:var(--sl-muted);line-height:1.5}.sl-closed-pill{display:none;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;flex:none;background:color-mix(in srgb,var(--sl-text) 12%,var(--sl-surface));color:var(--sl-text);font-weight:700;font-size:12px;white-space:nowrap}.sl-closed-pill.on{display:inline-flex}.sl-closed-pill svg{width:13px;height:13px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}.sl-powered{display:flex;align-items:center;justify-content:center;gap:5px;margin-top:2px;font-size:11px;font-weight:600;letter-spacing:.02em;color:var(--sl-text);opacity:.72;text-decoration:none;padding:2px 8px;border-radius:999px;width:fit-content;margin-inline:auto;transition:opacity .15s ease,background-color .15s ease}.sl-powered:hover{opacity:1;background:color-mix(in srgb,var(--sl-text) 8%,transparent)}.sl-powered:focus-visible{opacity:1;outline:2px solid var(--sl-accent);outline-offset:2px}.sl-powered-mark{width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee}.sl-powered-mark svg{width:12px;height:11px}.sl-chips{display:flex;gap:6px;flex-wrap:wrap}.sl-chip-f{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border-radius:999px;font-size:12px;font-weight:700;background:var(--sl-surface);border:1px solid var(--sl-line);color:var(--sl-muted);transition:color .15s,border-color .15s}.sl-chip-f:hover{color:var(--sl-text)}.sl-chip-f.on{background:var(--sl-accent);color:var(--sl-accent-ink);border-color:transparent}.sl-picker[data-confirming=true] .sl-map-host>:not(.sl-confirm){pointer-events:none}.sl-picker[data-confirming=true] .sl-anchor{pointer-events:none;opacity:.28;transition:opacity .16s}.sl-picker[data-confirming=true] .sl-side{pointer-events:none;opacity:.58;transition:opacity .16s}.sl-confirm{position:absolute;z-index:10;width:276px;max-width:calc(100% - 24px);overflow:hidden;pointer-events:auto;background:var(--sl-surface);border:1px solid color-mix(in srgb,var(--sl-line) 70%,var(--sl-text));border-radius:15px;box-shadow:0 24px 64px -18px #000000b8;transform:translate(-50%,calc(-100% - 16px));animation:slConfirmIn .24s cubic-bezier(.2,.8,.2,1) both}.sl-confirm[data-placement=below]{transform:translate(-50%,16px);animation:slConfirmBelowIn .24s cubic-bezier(.2,.8,.2,1) both}.sl-confirm-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(52px,auto) minmax(52px,auto);border-bottom:1px solid var(--sl-line)}.sl-confirm-field{min-width:0;padding:12px 11px 10px;border-right:1px solid var(--sl-line)}.sl-confirm-field:last-child{border-right:0;text-align:center}.sl-confirm-field:nth-child(2){text-align:center}.sl-confirm-key{display:block;font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--sl-muted);font-weight:800}.sl-confirm-value{display:block;margin-top:4px;color:var(--sl-text);font-size:17px;line-height:1.1;font-weight:850;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sl-confirm-field:first-child .sl-confirm-value{font-size:13.5px;line-height:1.25;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.sl-confirm-cat{display:flex;align-items:center;gap:8px;padding:10px 12px;background:color-mix(in srgb,var(--sl-cat) 76%,var(--sl-surface))}.sl-confirm-cat .sl-dot{border:2px solid color-mix(in srgb,var(--sl-cat-ink) 78%,transparent);width:11px;height:11px}.sl-confirm-cat-name{font-size:13.5px;font-weight:800;color:var(--sl-cat-ink);flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sl-confirm-price{font-size:17px;font-weight:850;color:var(--sl-cat-ink);font-variant-numeric:tabular-nums}.sl-confirm-body{padding:11px 12px 12px}.sl-confirm-tiers{display:grid;gap:6px;margin:0 0 9px;padding:0;border:0}.sl-confirm-tiers legend{margin:0 0 6px;padding:0;color:var(--sl-muted);font-size:10px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.sl-confirm-tier{display:flex;align-items:center;gap:9px;width:100%;min-height:40px;padding:8px 10px;border:1px solid var(--sl-line);border-radius:9px;color:var(--sl-text);background:color-mix(in srgb,var(--sl-bg) 72%,var(--sl-surface));text-align:left}.sl-confirm-tier:hover{border-color:color-mix(in srgb,var(--sl-accent) 58%,var(--sl-line))}.sl-confirm-tier[aria-pressed=true]{border-color:var(--sl-accent);background:color-mix(in srgb,var(--sl-accent) 13%,var(--sl-surface));box-shadow:inset 3px 0 0 var(--sl-accent)}.sl-confirm-tier-copy{min-width:0;flex:1;display:grid;gap:2px}.sl-confirm-tier-name{min-width:0;font-size:12.5px;font-weight:800}.sl-confirm-tier-note,.sl-tier-note{color:var(--sl-muted);font-size:10.5px;line-height:1.3}.sl-confirm-tier[aria-pressed=true] .sl-confirm-tier-note{color:var(--sl-text)}.sl-confirm-tier-price{font-size:13px;font-weight:850;font-variant-numeric:tabular-nums}.sl-confirm-row{display:flex;gap:8px;margin-top:10px}.sl-confirm-row button{flex:1;min-height:44px;padding:9px 12px;border-radius:9px;font-weight:800;font-size:13px}.sl-confirm-add{background:var(--sl-accent)!important;color:var(--sl-accent-ink)!important;display:flex;align-items:center;justify-content:center;gap:7px}.sl-confirm-add svg{width:16px;height:16px;stroke:currentColor;stroke-width:2.8;fill:none;stroke-linecap:round;stroke-linejoin:round}.sl-confirm-cancel{background:color-mix(in srgb,var(--sl-line) 44%,transparent)!important;border:1px solid var(--sl-line)!important;color:var(--sl-muted)!important}.sl-confirm-cancel:hover{color:var(--sl-text)}.sl-picker[data-layout=narrow] .sl-confirm{left:50%!important;top:auto!important;bottom:14px;width:min(310px,calc(100% - 24px));transform:translate(-50%);animation:slConfirmMobileIn .24s cubic-bezier(.2,.8,.2,1) both}.sl-picker[data-layout=narrow] .sl-confirm-field{padding:9px 9px 8px}.sl-picker[data-layout=narrow] .sl-confirm-value{font-size:15px}.sl-picker[data-layout=narrow] .sl-confirm-cat{padding:8px 10px}.sl-picker[data-layout=narrow] .sl-confirm-cat-name{font-size:12.5px}.sl-picker[data-layout=narrow] .sl-confirm-price{font-size:15px}.sl-picker[data-layout=narrow] .sl-confirm-body{padding:9px 10px 10px}.sl-picker[data-layout=narrow] .sl-confirm-tier{min-height:38px;padding:7px 9px}.sl-picker[data-layout=narrow] .sl-confirm-thumbwrap{height:62px;margin-bottom:6px}.sl-picker[data-layout=narrow] .sl-confirm-3d{margin-top:7px;padding:6px}.sl-picker[data-layout=narrow] .sl-confirm-row{margin-top:8px}.sl-picker[data-layout=narrow] .sl-confirm-row button{min-height:42px}.sl-table-scrim{position:absolute;inset:0;z-index:45;display:flex;align-items:center;justify-content:center;padding:18px;background:color-mix(in srgb,var(--sl-bg) 66%,transparent);backdrop-filter:blur(3px)}.sl-table-dialog{width:min(408px,100%);max-height:calc(100% - 24px);overflow:auto;border:1px solid var(--sl-line);border-radius:calc(var(--sl-radius) * 1.15);background:var(--sl-surface);box-shadow:0 28px 70px #0000006b}.sl-table-head{padding:18px 18px 14px;border-bottom:1px solid var(--sl-line)}.sl-table-eyebrow{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--sl-muted);font-weight:800}.sl-table-title{margin-top:5px;font-size:22px;line-height:1.15;font-weight:850}.sl-table-copy{margin-top:7px;color:var(--sl-muted);font-size:13px;line-height:1.45}.sl-table-body{padding:16px 18px 18px}.sl-table-summary{display:grid;grid-template-columns:1fr auto;gap:8px 16px;padding:12px;border:1px solid var(--sl-line);border-radius:var(--sl-r-sm);background:color-mix(in srgb,var(--sl-line) 22%,transparent);font-size:13px}.sl-table-summary b{font-size:15px}.sl-table-summary .muted{color:var(--sl-muted)}.sl-table-qtylabel{display:block;margin:16px 0 8px;font-size:12px;font-weight:800}.sl-table-stepper{display:grid;grid-template-columns:48px 1fr 48px;align-items:center;border:1px solid var(--sl-line);border-radius:12px;overflow:hidden;background:var(--sl-bg)}.sl-table-stepper button{height:48px;font-size:24px;font-weight:700;background:color-mix(in srgb,var(--sl-line) 34%,transparent)!important}.sl-table-stepper button:disabled{opacity:.58;cursor:not-allowed}.sl-table-stepper output{text-align:center;font-size:19px;font-weight:850;font-variant-numeric:tabular-nums}.sl-table-range{margin-top:7px;color:var(--sl-muted);font-size:11px;text-align:center}.sl-table-actions{display:flex;gap:9px;margin-top:17px}.sl-table-actions button{flex:1;min-height:46px;border-radius:10px;font-weight:800}.sl-table-cancel{border:1px solid var(--sl-line)!important;color:var(--sl-muted)!important}.sl-table-confirm{background:var(--sl-accent)!important;color:var(--sl-accent-ink)!important}.sl-table-confirm:disabled{opacity:.62;cursor:wait}.sl-table-edit{margin-left:4px;padding:2px 7px!important;border:1px solid var(--sl-line)!important;border-radius:999px!important;color:var(--sl-muted)!important;font-size:10px!important;font-weight:800!important}.sl-picker[data-layout=narrow] .sl-table-scrim{align-items:flex-end;padding:0;background:#05070c94}.sl-picker[data-layout=narrow] .sl-table-dialog{width:100%;max-height:min(78%,620px);border-radius:18px 18px 0 0;border-width:1px 0 0}.sl-picker[data-layout=narrow] .sl-table-head{padding-top:22px}.sl-picker[data-layout=narrow] .sl-table-body{padding-bottom:max(20px,env(safe-area-inset-bottom))}.sl-tip{position:absolute;z-index:7;pointer-events:none;display:none;width:190px;overflow:hidden;background:var(--sl-surface);color:var(--sl-text);border:1px solid var(--sl-line);border-radius:11px;box-shadow:0 12px 30px -14px #0009}.sl-tip-grid{display:grid;grid-template-columns:1.3fr .85fr .85fr;border-bottom:1px solid var(--sl-line)}.sl-tip-grid.one{grid-template-columns:1fr}.sl-tip-field{min-width:0;padding:6px 9px;border-right:1px solid var(--sl-line)}.sl-tip-field:last-child{border-right:0;text-align:center}.sl-tip-grid:not(.one) .sl-tip-field:nth-child(2){text-align:center}.sl-tip-key{display:block;font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--sl-muted);font-weight:800}.sl-tip-val{display:block;margin-top:2px;color:var(--sl-text);font-size:13px;line-height:1.1;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sl-tip-cat{display:flex;align-items:center;gap:7px;padding:6px 10px;font-size:11px;background:color-mix(in srgb,var(--sl-cat) 12%,var(--sl-surface))}.sl-tip-dot{width:8px;height:8px;border-radius:50%;flex:none}.sl-tip-name{color:var(--sl-muted);flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sl-tip-amt{margin-left:auto;font-weight:800;color:var(--sl-text);font-variant-numeric:tabular-nums;font-size:12px}.sl-tip-status{padding:5px 10px 7px;font-size:10px;letter-spacing:.09em;text-transform:uppercase;font-weight:700;color:var(--sl-muted)}.sl-ba{position:relative;flex:none;overflow:hidden;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:7px;padding:13px;border:1px solid color-mix(in srgb,var(--sl-accent) 34%,var(--sl-line));border-radius:13px;background:linear-gradient(135deg,color-mix(in srgb,var(--sl-accent) 5%,var(--sl-surface)),color-mix(in srgb,var(--sl-accent) 11%,var(--sl-surface)))}.sl-ba:after{content:"\\2726";position:absolute;right:10px;top:3px;color:color-mix(in srgb,var(--sl-accent) 20%,transparent);font-size:42px;line-height:1}.sl-ba-title,.sl-ba-copy,.sl-ba select,.sl-ba-qty,.sl-ba-go{position:relative;z-index:1}.sl-ba-title{grid-column:1/-1;display:flex;align-items:center;gap:7px;font-size:13px;font-weight:850}.sl-ba-title .spark{color:var(--sl-accent-text);font-size:16px}.sl-ba-copy{grid-column:1/-1;margin:-4px 0 2px 23px;color:var(--sl-muted);font-size:10.5px;line-height:1.35}.sl-ba-copy .narrow{display:none}.sl-ba-premium{position:relative;z-index:1;grid-column:1/-1;justify-self:start;display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;font-size:11px;font-weight:800;letter-spacing:.02em;cursor:pointer;color:var(--sl-premium-text);background:color-mix(in srgb,var(--sl-premium) 10%,var(--sl-surface));border:1px solid color-mix(in srgb,var(--sl-premium) 34%,var(--sl-line));transition:filter .15s,background .15s,color .15s}.sl-ba-premium .star{font-size:12px;line-height:1;color:var(--sl-premium)}.sl-ba-premium:hover{filter:brightness(1.05)}.sl-ba-premium.on{color:var(--sl-premium-ink);background:linear-gradient(135deg,#f0cf6b,#e0b23f);border-color:transparent;box-shadow:0 6px 16px color-mix(in srgb,var(--sl-premium) 26%,transparent)}.sl-ba-premium.on .star{color:#5a4410}.sl-ba select,.sl-price-select{appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23949ca9' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center}.sl-ba select{background-color:var(--sl-surface);color:var(--sl-text);border:1px solid var(--sl-line);border-radius:8px;font:inherit;font-size:11px;padding:7px 26px 7px 8px;min-width:0;width:100%;max-width:none}.sl-ba-qty{display:flex;align-items:center;gap:7px;padding:3px;border:1px solid var(--sl-line);border-radius:9px;background:var(--sl-surface)}.sl-ba-qty button{width:25px;height:25px;border-radius:7px;background:color-mix(in srgb,var(--sl-line) 35%,transparent);border:0;font-size:14px;font-weight:800;display:flex;align-items:center;justify-content:center}.sl-ba-qty span{min-width:14px;text-align:center;font-weight:800}.sl-picker .sl-ba-go{grid-column:1/-1;width:100%;min-height:37px;padding:7px 12px;border-radius:9px;background:var(--sl-accent);color:var(--sl-accent-ink);font-weight:800;font-size:12px;transition:filter .15s,opacity .15s;display:flex;align-items:center;justify-content:center;gap:6px;box-shadow:0 8px 18px color-mix(in srgb,var(--sl-accent) 18%,transparent)}.sl-picker .sl-ba-go:hover{filter:brightness(1.06)}.sl-picker .sl-ba-go:disabled{background:var(--sl-surface);color:var(--sl-muted);cursor:not-allowed;filter:none;box-shadow:none}.sl-picker .sl-ba-go.sl-busy:disabled{background:var(--sl-accent);color:var(--sl-accent-ink);opacity:.85;cursor:wait;box-shadow:0 8px 18px color-mix(in srgb,var(--sl-accent) 18%,transparent)}.sl-ba-replace{grid-column:1/-1;padding:3px 0 1px}.sl-ba-replace b{display:block;font-size:12.5px}.sl-ba-replace span{display:block;margin-top:3px;color:var(--sl-muted);font-size:10.5px;line-height:1.35}.sl-ba-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:7px}.sl-ba-actions button{min-height:36px;border-radius:9px;border:1px solid var(--sl-line);font-size:11.5px;font-weight:800}.sl-ba-actions .replace{border-color:var(--sl-accent);background:var(--sl-accent);color:var(--sl-accent-ink)}.sl-picker[data-layout=narrow] .sl-ba{padding:9px;gap:6px}.sl-picker[data-layout=narrow] .sl-ba:after{display:none}.sl-picker[data-layout=narrow] .sl-ba-title{font-size:12.5px}.sl-picker[data-layout=narrow] .sl-ba-copy,.sl-picker[data-layout=narrow] .sl-ba-copy .wide{display:none}.sl-picker[data-layout=narrow] .sl-ba-copy .narrow{display:inline}.sl-picker[data-layout=narrow] .sl-ba{grid-template-columns:auto minmax(0,1fr)}.sl-picker[data-layout=narrow] .sl-ba select{grid-column:1/-1;min-height:38px}.sl-picker[data-layout=narrow] .sl-ba-qty button{width:30px;height:30px}.sl-picker[data-layout=narrow] .sl-ba-qty{grid-column:1}.sl-picker[data-layout=narrow] .sl-ba-go{grid-column:2;min-height:40px}.sl-ba-reopen{align-self:flex-start;display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:5px 12px;margin-top:2px;border:1px dashed color-mix(in srgb,var(--sl-accent) 40%,var(--sl-line));border-radius:999px;color:var(--sl-accent-text);font-size:11.5px;font-weight:750;transition:border-color .15s,background .15s}.sl-ba-reopen:hover,.sl-ba-reopen:focus-visible{background:color-mix(in srgb,var(--sl-accent) 8%,transparent)}.sl-ba-back{grid-column:1/-1;justify-self:start;min-height:30px;padding:3px 0;color:var(--sl-muted);font-size:11px;font-weight:700;text-decoration:underline;text-underline-offset:3px;transition:color .15s}.sl-ba-back:hover,.sl-ba-back:focus-visible{color:var(--sl-text)}.sl-closed-note{flex:none;display:flex;flex-direction:column;gap:4px;padding:13px;border-radius:13px;border:1px solid var(--sl-line);background:color-mix(in srgb,var(--sl-text) 5%,var(--sl-surface))}.sl-closed-note b{font-size:13px;font-weight:850}.sl-closed-note span{font-size:11.5px;line-height:1.45;color:var(--sl-muted)}.sl-closed-note .when{display:block;margin-top:2px;font-size:11.5px;font-weight:700;color:var(--sl-text)}@media(pointer:coarse){.sl-zoom button,.sl-cbbtn,.sl-close,.sl-ga-qty button,.sl-ba-qty button,.sl-price-more,.sl-hold-change,.sl-seccard-x,.sl-fs-pill,.sl-side-toggle,.sl-ba-reopen{position:relative}.sl-zoom button:after,.sl-cbbtn:after,.sl-close:after,.sl-ga-qty button:after,.sl-ba-qty button:after,.sl-price-more:after,.sl-hold-change:after,.sl-seccard-x:after,.sl-fs-pill:after,.sl-side-toggle:after,.sl-ba-reopen:after{content:"";position:absolute;top:50%;left:50%;width:max(100%,44px);height:max(100%,44px);transform:translate(-50%,-50%)}.sl-picker[data-layout=narrow] .sl-chip{min-height:64px}.sl-picker[data-layout=narrow] .sl-chip .rm,.sl-picker[data-layout=narrow] .sl-chip .view{min-height:32px}}.sl-sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.sl-chip .tier{background:var(--sl-bg);color:var(--sl-text);border:1px solid var(--sl-line);border-radius:6px;font:inherit;font-size:10px;padding:2px 4px;min-width:0;max-width:100%;cursor:pointer}.sl-rungs{display:none;background:var(--sl-surface);border:1px solid var(--sl-line);border-radius:999px;padding:3px}.sl-rungs.on{display:inline-flex;gap:2px}.sl-rungs button{padding:6px 13px;border-radius:999px;font-size:10.5px;font-weight:800;letter-spacing:.07em;color:var(--sl-muted);white-space:nowrap;transition:color .15s}.sl-rungs button:hover{color:var(--sl-text)}.sl-rungs button.on{background:var(--sl-accent);color:var(--sl-accent-ink)}.sl-picker[data-layout=narrow] .sl-rungs{display:none!important}.sl-projection{display:inline-flex;align-items:center;gap:2px;padding:3px;border-radius:999px;background:var(--sl-surface);border:1px solid var(--sl-line);box-shadow:0 8px 24px -16px #000000a6}.sl-projection button{min-width:42px;min-height:30px;padding:5px 10px;border-radius:999px;color:var(--sl-muted);font-size:10px;font-weight:800;letter-spacing:.04em;white-space:nowrap}.sl-projection button:hover,.sl-projection button:focus-visible{color:var(--sl-text)}.sl-projection button.on{background:var(--sl-accent);color:var(--sl-accent-ink)}.sl-picker[data-layout=narrow] .sl-projection button{min-width:38px;min-height:32px;padding:5px 8px;font-size:9.5px}.sl-view3d{position:absolute;inset:0;z-index:4;opacity:0;touch-action:none;transition:opacity .3s ease;background:radial-gradient(120% 120% at 50% 0%,#191f28,#0d1014 70%)}.sl-view3d.has-comparison,.sl-view3d.has-passport{z-index:20}.sl-picker[data-confirming=true] .sl-view3d.has-comparison,.sl-picker[data-confirming=true] .sl-view3d.has-passport{pointer-events:auto}.sl-view3d canvas{display:block;width:100%;height:100%}.sl-view3d canvas:focus-visible{outline:2px solid var(--sl-accent);outline-offset:-3px}.sl-view3d-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:10px;z-index:1;color:#d9e2f2;font-size:13px;font-weight:700;letter-spacing:.02em;pointer-events:none}.sl-view3d-loading:before{content:"";width:18px;height:18px;border-radius:50%;border:2px solid rgba(217,226,242,.28);border-top-color:#d9e2f2;animation:slSpin .8s linear infinite}[data-view3d=on] .sl-chips,[data-view3d=on] .sl-rungs{display:none}.sl-view3d-back{position:absolute;top:12px;left:12px;z-index:2;display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:7px 13px 7px 9px;border-radius:999px;font-size:11px;font-weight:800;letter-spacing:.03em;color:#e6edf3;background:#0a0e149e;border:1px solid rgba(255,255,255,.22);backdrop-filter:blur(6px)}.sl-view3d-back:hover,.sl-view3d-back:focus-visible{background:#10161ed1;border-color:#fff6}.sl-view3d-back svg{width:15px;height:15px;stroke:currentColor;stroke-width:2.4;fill:none;stroke-linecap:round;stroke-linejoin:round}.sl-view3d:not(.is-seat-focused) .sl-view3d-back{display:none}.sl-view3d-fs{position:absolute;top:12px;right:12px;z-index:2;min-width:44px;min-height:44px;padding:8px 12px;border-radius:999px;font-size:16px;color:#e6edf3;background:#0a0e149e;border:1px solid rgba(255,255,255,.22);backdrop-filter:blur(6px)}.sl-view3d-fs:hover,.sl-view3d-fs:focus-visible{background:#10161ed1;border-color:#fff6}.sl-view3d-nav{position:absolute;left:12px;bottom:16px;z-index:3;display:flex;flex-direction:column;gap:6px;max-width:calc(100% - 150px);pointer-events:none}.sl-view3d-nav>div{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;pointer-events:auto;padding:1px;-webkit-overflow-scrolling:touch}.sl-view3d-nav>div::-webkit-scrollbar{display:none}.sl-view3d-nav button{flex:0 0 auto;min-height:32px;padding:7px 12px;border-radius:999px;white-space:nowrap;font-size:11.5px;font-weight:700;color:#c9d4ea;background:#0c1220b8;border:1px solid rgba(150,165,205,.35);backdrop-filter:blur(6px);cursor:pointer}.sl-view3d-nav button:hover,.sl-view3d-nav button:focus-visible{color:#eef1f8;border-color:#becdf099}.sl-view3d-nav button[aria-pressed=true]{background:var(--sl-accent);color:var(--sl-accent-ink);border-color:transparent}.sl-view3d-nav button:disabled{opacity:.6;cursor:not-allowed}.sl-view3d-nav-toggle{display:none!important}.sl-view3d-nav select{min-height:38px;max-width:100%;padding:7px 34px 7px 12px;border-radius:999px;font:700 11.5px/1 inherit;color:#eef1f8;background:#0c1220db;border:1px solid rgba(150,165,205,.45);backdrop-filter:blur(6px);cursor:pointer}.sl-view3d-nav select:focus-visible{outline:2px solid var(--sl-accent);outline-offset:2px}.sl-picker[data-layout=narrow] .sl-view3d-nav{left:120px;top:12px;bottom:auto;max-width:calc(100% - 132px)}.sl-picker[data-layout=narrow] .sl-view3d-nav-toggle{display:inline-flex!important;align-items:center;pointer-events:auto;min-height:44px}.sl-picker[data-layout=narrow] .sl-view3d-nav:not(.is-open)>div{display:none!important}.sl-picker[data-layout=narrow] .sl-view3d-nav.is-open{left:12px;top:68px;max-width:calc(100% - 24px);padding:8px;border:1px solid rgba(150,165,205,.35);border-radius:14px;background:#080c16e6;backdrop-filter:blur(10px)}.sl-picker[data-layout=narrow] .sl-view3d-nav.is-open>div{display:flex}.sl-view3d.is-seat-focused .sl-view3d-nav,.sl-view3d.is-seat-focused .sl-3d-overview-control,.sl-view3d.is-seat-focused .sl-view3d-compare-saved,.sl-picker[data-view3d=on] .sl-rungs,.sl-picker[data-view3d=on] .sl-floors,.sl-picker[data-view3d=on] .sl-zoom,.sl-picker[data-view3d=on] .sl-seccard,.sl-picker[data-view3d=on] .sl-minimap{display:none!important}.sl-picker[data-view3d=on] .sl-confirm{left:50%!important;top:auto!important;bottom:16px;transform:translate(-50%);width:min(342px,calc(100% - 24px))}.sl-picker[data-view3d=on] .sl-confirm[data-placement]{transform:translate(-50%)}.sl-confirm-inspect-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:9px}.sl-confirm-inspect-row .sl-confirm-3d{margin-top:0;min-height:44px}.sl-confirm-compare{min-height:44px;padding:8px;border-radius:8px;border:1px solid var(--sl-line);display:flex;align-items:center;justify-content:center;gap:7px;font-size:12px;font-weight:800;color:var(--sl-text);background:transparent}.sl-confirm-compare:hover,.sl-confirm-compare:focus-visible{border-color:var(--sl-accent);background:color-mix(in srgb,var(--sl-accent) 10%,transparent)}.sl-confirm-compare:disabled{opacity:.62;cursor:default}.sl-confirm-confidence{width:100%;min-height:44px;margin-top:8px;padding:8px 10px;border-radius:9px;border:1px solid color-mix(in srgb,var(--sl-accent) 35%,var(--sl-line));display:flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;color:var(--sl-text);background:color-mix(in srgb,var(--sl-accent) 7%,var(--sl-surface))}.sl-confirm-confidence>span{min-width:0}.sl-confirm-confidence strong,.sl-confirm-confidence small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sl-confirm-confidence strong{font-size:11px}.sl-confirm-confidence small{margin-top:2px;color:var(--sl-muted);font-size:9.5px}.sl-confirm-confidence em{display:none;font-style:normal}.sl-confirm-confidence>b{flex:none;font-size:11px;color:var(--sl-accent-text)}.sl-confirm-confidence:hover,.sl-confirm-confidence:focus-visible{border-color:var(--sl-accent)}.sl-picker[data-view3d=on][data-layout=narrow] .sl-confirm{bottom:10px}.sl-picker[data-view3d=on][data-layout=narrow] .sl-confirm-field{padding:8px 9px 7px}.sl-picker[data-view3d=on][data-layout=narrow] .sl-confirm-value{font-size:14px;margin-top:2px}.sl-picker[data-view3d=on][data-layout=narrow] .sl-confirm-field:first-child .sl-confirm-value{font-size:12px}.sl-picker[data-view3d=on][data-layout=narrow] .sl-confirm-cat{padding:7px 10px}.sl-picker[data-view3d=on][data-layout=narrow] .sl-confirm-price{font-size:15px}.sl-picker[data-view3d=on][data-layout=narrow] .sl-confirm-body{padding:8px 10px 9px}.sl-picker[data-view3d=on][data-layout=narrow] .sl-confirm-row{margin-top:7px}.sl-picker[data-view3d=on][data-layout=narrow][data-density=compact] .sl-confirm{bottom:6px}.sl-picker[data-view3d=on][data-layout=narrow][data-density=compact] .sl-confirm-grid,.sl-picker[data-view3d=on][data-layout=narrow][data-density=compact] .sl-confirm-cat,.sl-picker[data-view3d=on][data-layout=narrow][data-density=compact] .sl-confirm-body>.sl-cx{display:none}.sl-picker[data-view3d=on][data-layout=narrow][data-density=compact] .sl-confirm-body{padding:6px 8px 7px}.sl-picker[data-view3d=on][data-layout=narrow][data-density=compact] .sl-confirm-confidence{margin-top:0}.sl-picker[data-view3d=on][data-layout=narrow][data-density=compact] .sl-confirm-confidence em{display:block;margin-bottom:2px;color:var(--sl-text);font-size:12px;font-weight:850;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sl-picker[data-view3d=on][data-layout=narrow][data-density=compact] .sl-confirm-confidence strong{font-size:9.5px}.sl-picker[data-view3d=on][data-layout=narrow][data-density=compact] .sl-confirm-confidence small{display:none}.sl-picker[data-view3d=on][data-layout=narrow][data-density=compact] .sl-confirm-inspect-row,.sl-picker[data-view3d=on][data-layout=narrow][data-density=compact] .sl-confirm-row{margin-top:5px}.sl-view3d-compare-saved{position:absolute;top:12px;left:136px;z-index:5;display:flex;align-items:stretch;max-width:180px;min-height:38px;border-radius:999px;overflow:hidden;color:#e6edf3;background:#0a0e14b8;border:1px solid rgba(255,255,255,.22);backdrop-filter:blur(6px)}.sl-view3d-compare-saved button{min-width:0;padding:7px 10px;color:inherit;font-size:11px;font-weight:800;white-space:nowrap}.sl-view3d-compare-saved .main{overflow:hidden;text-overflow:ellipsis}.sl-view3d-compare-saved .clear{width:34px;padding:7px;border-left:1px solid rgba(255,255,255,.18)}.sl-view3d-compare-saved button:hover,.sl-view3d-compare-saved button:focus-visible{background:#ffffff1a}.sl-picker[data-layout=narrow] .sl-view3d-compare-saved{left:126px;max-width:calc(100% - 194px);min-height:44px}.sl-view3d-unavailable{position:absolute;left:50%;bottom:18px;z-index:9;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 14px;width:min(330px,calc(100% - 24px));padding:13px 14px;border:1px solid rgba(255,255,255,.22);border-radius:14px;color:#eef3fb;background:#0a0e16f0;box-shadow:0 18px 48px #0000007a;backdrop-filter:blur(10px);transform:translate(-50%)}.sl-view3d-unavailable[data-state=held]{border-color:#f2a838b3}.sl-view3d-unavailable[data-state=sold],.sl-view3d-unavailable[data-state=dimmed]{border-color:#a0aabc7a}.sl-view3d-unavailable-copy{min-width:0}.sl-view3d-unavailable-eyebrow{display:block;font-size:9px;line-height:1.2;letter-spacing:.13em;text-transform:uppercase;color:#aab7cc;font-weight:850}.sl-view3d-unavailable strong{display:block;margin-top:3px;font-size:17px;line-height:1.2}.sl-view3d-unavailable p{grid-column:1/-1;margin:4px 0 0;color:#b9c4d7;font-size:11px;line-height:1.4}.sl-view3d-unavailable button{align-self:start;min-width:44px;min-height:44px;margin:-5px -6px 0 0;border-radius:999px;color:#eef3fb;font-size:18px;border:1px solid rgba(255,255,255,.18)}.sl-view3d-unavailable button:hover,.sl-view3d-unavailable button:focus-visible{background:#ffffff1a}.sl-picker[data-layout=narrow] .sl-view3d-unavailable{bottom:10px;padding-bottom:max(13px,env(safe-area-inset-bottom))}.sl-view3d-compare-shell{position:absolute;inset:0;z-index:30;display:grid;place-items:center;padding:16px}.sl-view3d-compare-scrim{position:absolute;inset:0;background:#03060cbd;backdrop-filter:blur(5px)}.sl-view3d-compare{position:relative;width:min(720px,100%);max-height:min(680px,calc(100% - 20px));overflow:auto;border:1px solid rgba(160,177,214,.34);border-radius:18px;background:var(--sl-bg);color:var(--sl-text);box-shadow:0 28px 90px #0000008c;padding:18px}.sl-view3d-compare>header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.sl-view3d-compare>header span{display:block;font-size:9px;letter-spacing:.14em;text-transform:uppercase;color:var(--sl-muted);font-weight:850}.sl-view3d-compare>header strong{display:block;margin-top:4px;font-size:20px}.sl-view3d-compare>header button{min-width:44px;min-height:44px;border-radius:999px;border:1px solid var(--sl-line);color:var(--sl-text)}.sl-view3d-compare-note{margin:12px 0;color:var(--sl-muted);font-size:12px;line-height:1.45}.sl-view3d-compare-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.sl-view3d-compare article{min-width:0;padding:14px;border:1px solid var(--sl-line);border-radius:13px;background:var(--sl-surface)}.sl-view3d-compare article>span{font-size:9px;letter-spacing:.12em;text-transform:uppercase;color:var(--sl-muted);font-weight:850}.sl-view3d-compare article>strong{display:block;margin-top:3px;font-size:20px}.sl-view3d-compare article>small{display:block;margin-top:3px;color:var(--sl-muted)}.sl-view3d-compare dl{margin:12px 0 0}.sl-view3d-compare dl div{display:grid;grid-template-columns:minmax(90px,.8fr) minmax(0,1.2fr);gap:10px;padding:8px 0;border-top:1px solid var(--sl-line)}.sl-view3d-compare dt{font-size:10.5px;color:var(--sl-muted)}.sl-view3d-compare dd{margin:0;text-align:right;font-size:11px;font-weight:750;overflow-wrap:anywhere}.sl-view3d-compare-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-top:12px}.sl-view3d-compare-actions button{min-height:44px;border-radius:9px;border:1px solid var(--sl-line);font-size:12px;font-weight:800}.sl-view3d-compare-actions .select{background:var(--sl-accent);color:var(--sl-accent-ink);border-color:transparent}.sl-view3d-compare-actions button:disabled{opacity:.62;cursor:not-allowed}.sl-view3d-passport-shell{position:absolute;inset:0;z-index:40;display:grid;place-items:center;padding:16px}.sl-view3d-passport-scrim{position:absolute;inset:0;background:#03060ccc;backdrop-filter:blur(6px)}.sl-view3d-passport{position:relative;width:min(540px,100%);max-height:min(700px,calc(100% - 20px));overflow:auto;padding:18px;border:1px solid rgba(160,177,214,.38);border-radius:18px;background:var(--sl-bg);color:var(--sl-text);box-shadow:0 28px 90px #0009}.sl-view3d-passport>header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.sl-view3d-passport>header span{display:block;font-size:9px;letter-spacing:.14em;text-transform:uppercase;color:var(--sl-muted);font-weight:850}.sl-view3d-passport>header strong{display:block;margin-top:4px;font-size:20px}.sl-view3d-passport>header button{min-width:44px;min-height:44px;border:1px solid var(--sl-line);border-radius:999px;color:var(--sl-text)}.sl-view3d-passport-summary{margin:14px 0;padding:12px;border-radius:12px;background:color-mix(in srgb,var(--sl-accent) 9%,var(--sl-surface));border:1px solid color-mix(in srgb,var(--sl-accent) 30%,var(--sl-line))}.sl-view3d-passport-summary strong{display:block;font-size:15px}.sl-view3d-passport-summary span{display:block;margin-top:4px;font-size:11px;color:var(--sl-muted)}.sl-view3d-passport dl{margin:0}.sl-view3d-passport dl div{display:grid;grid-template-columns:minmax(105px,.75fr) minmax(0,1.25fr);gap:12px;padding:9px 0;border-top:1px solid var(--sl-line)}.sl-view3d-passport dt{font-size:10.5px;color:var(--sl-muted)}.sl-view3d-passport dd{margin:0;text-align:right;font-size:11px;font-weight:750;overflow-wrap:anywhere}.sl-view3d-passport h4{margin:14px 0 6px;font-size:11px}.sl-view3d-passport ul{margin:0;padding-left:18px;color:var(--sl-muted);font-size:10.5px;line-height:1.5}.sl-view3d-passport-note{margin:14px 0 0;color:var(--sl-muted);font-size:10.5px;line-height:1.45}@media(max-width:640px){.sl-view3d-compare-shell{padding:max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom))}.sl-view3d-compare{width:100%;max-height:100%;padding:14px 14px max(86px,calc(14px + env(safe-area-inset-bottom)));border-radius:15px}.sl-view3d-compare-grid{grid-template-columns:1fr}.sl-view3d-compare article{padding:12px}.sl-view3d-passport-shell{padding:max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom))}.sl-view3d-passport{width:100%;max-height:100%;padding:14px 14px max(24px,calc(14px + env(safe-area-inset-bottom)));border-radius:15px}}.sl-confirm-viewbtn{width:100%;margin-top:9px;padding:8px;border-radius:8px;border:1px solid var(--sl-line);display:flex;align-items:center;justify-content:center;gap:7px;font-size:12px;font-weight:800;color:var(--sl-text);background:transparent;transition:border-color .15s,background .15s}.sl-confirm-viewbtn:hover,.sl-confirm-viewbtn:focus-visible{border-color:var(--sl-accent);background:color-mix(in srgb,var(--sl-accent) 10%,transparent)}.sl-confirm-3d{width:100%;margin-top:9px;padding:8px;border-radius:8px;border:1px solid var(--sl-line);display:flex;align-items:center;justify-content:center;gap:7px;font-size:12px;font-weight:800;color:var(--sl-text);background:color-mix(in srgb,var(--sl-accent) 12%,transparent);transition:border-color .15s,background .15s}.sl-confirm-3d:hover,.sl-confirm-3d:focus-visible{border-color:var(--sl-accent);background:color-mix(in srgb,var(--sl-accent) 20%,transparent)}.sl-confirm-3d svg{width:15px;height:15px;stroke:currentColor;stroke-width:1.9;fill:none;stroke-linecap:round;stroke-linejoin:round}.sl-floors{display:none;align-items:center;gap:6px;max-width:min(260px,100%);padding:5px;border-radius:999px;background:color-mix(in srgb,var(--sl-surface) 92%,transparent);border:1px solid var(--sl-line);box-shadow:var(--sl-shadow);backdrop-filter:blur(8px)}.sl-floors.on{display:flex}.sl-floors select{min-width:0;max-width:210px;min-height:34px;padding:6px 30px 6px 10px;border:0;border-radius:999px;font:700 12px/1 inherit;color:var(--sl-text);background:var(--sl-surface);cursor:pointer}.sl-floors select:focus-visible,.sl-floor-info:focus-visible{outline:2px solid var(--sl-accent);outline-offset:2px}.sl-floor-info{display:inline-grid;place-items:center;flex:0 0 30px;width:30px;height:30px;border-radius:999px;border:1px solid var(--sl-line);color:var(--sl-muted);background:transparent;font:800 13px/1 inherit;cursor:help}.sl-floor-info:hover{color:var(--sl-text);border-color:var(--sl-accent)}.sl-seccard{width:250px;max-width:100%;background:var(--sl-surface);border:1px solid var(--sl-line);border-radius:12px;padding:12px 14px;box-shadow:0 18px 50px -18px #0009;display:none}.sl-seccard.on{display:block}.sl-seccard.mini{width:auto;padding:5px 7px 5px 12px;border-radius:999px;cursor:pointer}.sl-seccard.mini.on{display:inline-flex;align-items:center;gap:7px}.sl-seccard.mini .sl-seccard-name{font-size:12px;flex:none;max-width:120px}.sl-seccard.mini .sl-seccard-left{font-size:11px}.sl-seccard.strip{position:absolute;left:50%;transform:translate(-50%);bottom:12px;z-index:6;width:auto;max-width:calc(100% - 24px);padding:6px 8px 6px 12px;border-radius:999px;border:1px solid var(--sl-line);background:var(--sl-surface);box-shadow:0 12px 30px -12px #0000008c;cursor:default}.sl-seccard.strip.on{display:flex;align-items:center;gap:7px;font-size:12.5px}.sl-seccard.strip .sl-seccard-name{font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sl-picker[data-layout=narrow][data-confirming=true] .sl-seccard.strip,.sl-picker[data-view3d=on] .sl-seccard.strip{display:none}.sl-seccard.strip .sl-seccard-price{margin-left:auto}.sl-seccard-head{display:flex;align-items:center;gap:8px}.sl-seccard-dot{width:10px;height:10px;border-radius:50%;flex:none}.sl-seccard-name{font-weight:800;font-size:14px;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sl-seccard-price{font-weight:800;font-size:12.5px;font-variant-numeric:tabular-nums}.sl-seccard-x{width:22px;height:22px;border-radius:999px;flex:none;display:flex;align-items:center;justify-content:center;color:var(--sl-muted);font-size:12px}.sl-seccard-x:hover{color:var(--sl-text)}.sl-seccard-zone{font-size:11.5px;color:var(--sl-muted);margin-top:6px}.sl-seccard-left{color:var(--sl-text);font-weight:700}.sl-seccard-mix{display:flex;flex-wrap:wrap;gap:6px 10px;margin-top:8px}.sl-seccard-mix-item{display:inline-flex;align-items:center;gap:5px;font-size:11.5px;color:var(--sl-muted)}.sl-seccard-mix-dot{width:8px;height:8px;border-radius:50%;flex:none}.sl-seccard-mix-price{font-weight:700;color:var(--sl-text)}.sl-seccard-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px}.sl-seccard-overview{font-size:12px;font-weight:800;color:var(--sl-accent-text)}.sl-seccard-hint{font-size:10.5px;color:var(--sl-muted)}.sl-seccard-nav{display:inline-flex;align-items:center;gap:4px;margin-left:auto}.sl-seccard-nav button{width:28px;height:28px;border:1px solid var(--sl-line);border-radius:999px;color:var(--sl-text);background:color-mix(in srgb,var(--sl-surface) 88%,var(--sl-bg));font-size:14px;font-weight:850;line-height:1}.sl-seccard-nav button:hover,.sl-seccard-nav button:focus-visible{border-color:var(--sl-accent);color:var(--sl-accent-text)}.sl-seccard.mini .sl-seccard-nav,.sl-seccard.strip .sl-seccard-nav{margin-left:2px}.sl-seccard.mini .sl-seccard-nav button,.sl-seccard.strip .sl-seccard-nav button{width:24px;height:24px;font-size:12px}.sl-confirm-thumbwrap{position:relative;display:block;width:100%;height:74px;margin:0 0 8px;padding:0!important;border-radius:9px;overflow:hidden;border:1px solid var(--sl-line);cursor:pointer}.sl-confirm-thumb{display:block;width:100%;height:100%;object-fit:cover}.sl-confirm-thumb-badge{position:absolute;right:7px;top:7px;display:inline-flex;align-items:center;gap:5px;font-size:10px;font-weight:700;color:#fff;background:#0a0e16b8;border-radius:12px;padding:4px 9px;backdrop-filter:blur(3px)}.sl-confirm-sight{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--sl-muted);margin-bottom:2px}.sl-confirm-view{width:100%;margin-top:9px;padding:8px;border-radius:8px;border:1px solid var(--sl-line);color:var(--sl-text);font-weight:700;font-size:12px;display:flex;align-items:center;justify-content:center;gap:7px}.sl-confirm-view:hover{border-color:var(--sl-muted)}.sl-confirm-view svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}.sl-cx{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}.sl-cx-warn{display:flex;align-items:flex-start;gap:7px;padding:8px 10px;border-radius:9px;background:color-mix(in srgb,#f4b740 13%,var(--sl-surface));border:1px solid color-mix(in srgb,#f4b740 40%,var(--sl-line));animation:slNoticeIn .28s ease both}.sl-cx-glyph{flex:none;font-size:14px;line-height:1.2;color:#f4b740}.sl-cx-txt{min-width:0;display:flex;flex-direction:column;gap:2px}.sl-cx-txt b{font-size:12px;font-weight:800;color:var(--sl-text)}.sl-cx-note{font-size:11px;line-height:1.4;color:var(--sl-muted)}.sl-cx-premium{display:inline-flex;align-items:center;gap:6px;align-self:flex-start;padding:4px 10px;border-radius:999px;font-size:11px;font-weight:800;letter-spacing:.02em;color:#c9a24b;background:color-mix(in srgb,#e8c15a 13%,var(--sl-surface));border:1px solid color-mix(in srgb,#e8c15a 38%,var(--sl-line))}.sl-cx-star{font-size:12px;line-height:1;color:#e8c15a}.sl-cx-mark{flex:none;font-size:12px;line-height:1;color:#f4b740;cursor:help}.sl-tip-cx{display:flex;align-items:center;gap:6px;padding:5px 10px 7px;font-size:10.5px;font-weight:700;color:#e8b24a}.sl-tip-cx .g{font-size:12px}.sl-view{position:absolute;inset:0;z-index:12;display:flex;flex-direction:column;background:var(--sl-bg)}.sl-view-head{display:flex;align-items:center;gap:8px;padding:12px 16px;border-bottom:1px solid var(--sl-line);flex:none}.sl-view-title{font-weight:800;font-size:15px}.sl-view-cap{font-size:11px;color:var(--sl-muted)}.sl-view-x{margin-left:auto;width:32px;height:32px;border-radius:999px;border:1px solid var(--sl-line);color:var(--sl-muted);flex:none;display:flex;align-items:center;justify-content:center;transition:color .15s,border-color .15s}.sl-view-x:hover{color:var(--sl-text);border-color:var(--sl-muted)}.sl-view-x svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round}.sl-view-pano{position:relative;flex:1;min-height:0;overflow:hidden;cursor:grab;background-color:#05070c;background-repeat:repeat-x;touch-action:none;user-select:none}.sl-view-pano.drag{cursor:grabbing}.sl-view-badge{position:absolute;top:12px;left:12px;padding:5px 11px;border-radius:999px;font-size:10px;font-weight:800;letter-spacing:.08em;background:var(--sl-surface);border:1px solid var(--sl-line);color:var(--sl-muted)}.sl-view-hint{position:absolute;left:50%;bottom:12px;transform:translate(-50%);padding:6px 14px;border-radius:999px;font-size:11.5px;font-weight:600;background:var(--sl-surface);border:1px solid var(--sl-line);color:var(--sl-muted);white-space:nowrap;pointer-events:none;max-width:90%;overflow:hidden;text-overflow:ellipsis}.sl-minimap{border:1px solid var(--sl-line);border-radius:9px;overflow:hidden;background:var(--sl-surface);box-shadow:0 12px 34px -14px #0000008c;line-height:0;touch-action:none}.sl-minimap-bar{min-height:24px;padding:3px 5px 3px 8px;display:flex;align-items:center;gap:6px;border-bottom:1px solid var(--sl-line);color:var(--sl-muted);font-size:9px;font-weight:800;line-height:1.2;letter-spacing:.06em;text-transform:uppercase}.sl-minimap-label{min-width:0;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sl-minimap-key{display:inline-flex;align-items:center;gap:3px;flex:none}.sl-minimap-key i{width:6px;height:6px;border-radius:999px;background:var(--sl-success)}.sl-minimap-key i.selected{background:var(--sl-accent)}.sl-minimap-key i.inactive{background:var(--sl-muted);opacity:.45}.sl-minimap-key i.focused{background:transparent;border:1.5px solid var(--sl-accent);width:7px;height:7px}.sl-minimap-close{display:none;width:24px;height:24px;border-radius:6px;color:var(--sl-muted);font-size:15px;line-height:1}.sl-minimap canvas{display:block}.sl-minimap canvas:focus-visible{outline:2px solid var(--sl-accent);outline-offset:-3px}.sl-minimap canvas.sl-dragging{cursor:grabbing}.sl-minimap-toggle{display:none;width:42px;height:42px;border-radius:10px;border:1px solid color-mix(in srgb,var(--sl-line) 80%,transparent);background:color-mix(in srgb,var(--sl-surface) 72%,transparent);backdrop-filter:blur(8px);color:var(--sl-text);box-shadow:0 10px 28px -14px #000000a6;align-items:center;justify-content:center}.sl-minimap-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round}.sl-picker[data-layout=narrow] .sl-minimap{display:none}.sl-picker[data-layout=narrow] .sl-minimap-toggle{display:flex}.sl-picker[data-layout=narrow][data-minimap-open=true] .sl-minimap{display:block}.sl-picker[data-layout=narrow] .sl-minimap-bar{display:none}.sl-picker[data-layout=narrow] .sl-minimap canvas{width:min(112px,30vw)!important;height:auto!important}.sl-picker[data-layout=narrow][data-minimap-open=true] .sl-minimap-toggle{display:flex;border-color:var(--sl-accent);color:var(--sl-accent-text)}.sl-price-row.sl-dim .sl-dot{opacity:.35}.sl-price-row.sl-dim .sl-price-label,.sl-price-row.sl-dim .sl-price-left,.sl-price-row.sl-dim .sl-price-amt{color:var(--sl-muted)}.sl-seccard-mix-item.sl-dim{opacity:.55}@keyframes slPillIn{0%{opacity:0;transform:translate(7px) scale(.9)}to{opacity:1;transform:translate(0) scale(1)}}@keyframes slHoldPulse{0%{box-shadow:0 0 0 0 currentColor;opacity:.9}75%,to{box-shadow:0 0 0 7px transparent;opacity:.55}}@keyframes slChipIn{0%{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes slChipOut{to{opacity:0;transform:translate(10px) scale(.98)}}@keyframes slNoticeIn{0%{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}@keyframes slValuePop{0%{opacity:.6;transform:translateY(3px)}55%{transform:translateY(-1px) scale(1.05)}to{opacity:1;transform:none}}@keyframes slCtaReady{0%{transform:scale(.98);box-shadow:0 0 0 0 transparent}55%{transform:scale(1.01);box-shadow:0 0 0 5px color-mix(in srgb,var(--sl-accent) 18%,transparent)}to{transform:none;box-shadow:none}}@keyframes slToastNudge{0%,to{margin-left:0}30%{margin-left:-4px}60%{margin-left:3px}}@keyframes slSuccessPop{0%{opacity:0;transform:scale(.72)}65%{opacity:1;transform:scale(1.08)}to{opacity:1;transform:scale(1)}}@keyframes slCheckDraw{to{stroke-dashoffset:0}}@keyframes slCopyRise{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes slConfirmIn{0%{opacity:0;transform:translate(-50%,calc(-100% - 8px)) scale(.96)}to{opacity:1;transform:translate(-50%,calc(-100% - 14px)) scale(1)}}@keyframes slConfirmBelowIn{0%{opacity:0;transform:translate(-50%,8px) scale(.96)}to{opacity:1;transform:translate(-50%,16px) scale(1)}}@keyframes slConfirmMobileIn{0%{opacity:0;transform:translate(-50%,10px) scale(.97)}to{opacity:1;transform:translate(-50%) scale(1)}}.sl-access{position:absolute;left:50%;bottom:18px;z-index:9;transform:translate(-50%);max-width:min(420px,calc(100% - 24px));display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border-radius:var(--sl-r-sm);background:var(--sl-panel,#151b2c);color:var(--sl-text);border:1px solid var(--sl-line);box-shadow:0 18px 44px -18px #0009;animation:slAccessIn var(--slm-mo-base) var(--slm-mo-out) both}.sl-access-title{font-weight:700;font-size:13px}.sl-access-body{font-size:12px;line-height:1.5;opacity:.82;margin-top:2px}.sl-access-act{margin-top:8px;padding:6px 12px;border-radius:999px;font-size:12px;font-weight:700;background:var(--sl-accent);color:var(--sl-accent-ink)}@keyframes slAccessIn{0%{opacity:0;transform:translate(-50%,10px)}to{opacity:1;transform:translate(-50%)}}@media(prefers-reduced-motion:reduce){.sl-picker *,.sl-modal-scrim *{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}.sl-access{animation:none;opacity:1;transform:translate(-50%)}}.sl-ba [data-ba-zone]{grid-column:1/-1;width:100%}.sl-modal-scrim{position:fixed;inset:0;z-index:2147483000;background:#05070ca8;display:flex;align-items:center;justify-content:center;padding:18px}.sl-modal-frame{width:min(1200px,100%);height:min(820px,100%);border-radius:16px;overflow:hidden;box-shadow:0 40px 120px -30px #000c}.sl-modal-frame>.sl-picker{border-radius:0}@media(max-width:640px){.sl-modal-scrim{padding:0}.sl-modal-frame{width:100%;height:100%;border-radius:0}}`;function ol(){if(document.getElementById(nl))return;const t=document.createElement("style");t.id=nl,t.textContent=uv,document.head.appendChild(t)}function Ot(t){var e;if(!t)return null;const i=t.trim().toLowerCase();if(i==="white")return{r:255,g:255,b:255};if(i==="black")return{r:0,g:0,b:0};const s=(e=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(i))===null||e===void 0?void 0:e[1];if(s){const o=s.length<=4?[...s].map(a=>`${a}${a}`).join(""):s;return{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16)}}const n=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i.exec(i);return n?{r:Math.max(0,Math.min(255,Number(n[1]))),g:Math.max(0,Math.min(255,Number(n[2]))),b:Math.max(0,Math.min(255,Number(n[3])))}:null}function Ms(t){return tn([t.r,t.g,t.b])}function mt(t,e){const i=Ot(t),s=Ot(e);if(!i||!s)return null;const n=Math.max(Ms(i),Ms(s)),o=Math.min(Ms(i),Ms(s));return(n+.05)/(o+.05)}function _s(t,e="#172033",i="#eef1f8"){var s,n;return((s=mt(e,t))!==null&&s!==void 0?s:0)>=((n=mt(i,t))!==null&&n!==void 0?n:0)?e:i}function pv(t){return Ht(t.r,t.g,t.b)}function al(t,e,i){const s=Ot(t),n=Ot(e);if(!s||!n)return null;const o=Math.max(0,Math.min(1,i));return pv({r:s.r*o+n.r*(1-o),g:s.g*o+n.g*(1-o),b:s.b*o+n.b*(1-o)})}function fv(t,e,i,s){var n,o;if(((n=mt(t,i))!==null&&n!==void 0?n:4.5)>=4.5&&((o=mt(t,s))!==null&&o!==void 0?o:4.5)>=4.5)return t;if(!Ot(t)||!Ot(e))return e;for(let l=.15;l<=1;l+=.05){var a,r;const c=al(t,e,1-l);if(c&&((a=mt(c,i))!==null&&a!==void 0?a:0)>=4.5&&((r=mt(c,s))!==null&&r!==void 0?r:0)>=4.5)return c}return e}function rl(t,e){var i,s,n,o,a,r,l,c,d,u,h,p,f,v,m;const g=(i=(s=e==null?void 0:e.background)!==null&&s!==void 0?s:t==null?void 0:t.background)!==null&&i!==void 0?i:"#0f1522",b=Ot(g)?_s(g)==="#172033":!1,y=(n=e==null?void 0:e.surface)!==null&&n!==void 0?n:b?"#ffffff":"#1a2234",k=(o=(a=e==null?void 0:e.accent)!==null&&a!==void 0?a:t==null?void 0:t.accent)!==null&&o!==void 0?o:"#f4b740",w=t==null?void 0:t.accentInk,C=(r=e==null?void 0:e.accentInk)!==null&&r!==void 0?r:w&&((l=mt(w,k))!==null&&l!==void 0?l:4.5)>=4.5?w:_s(k,"#1a1200","#ffffff"),S=t==null?void 0:t.textColor,T=(c=e==null?void 0:e.text)!==null&&c!==void 0?c:S&&((d=mt(S,g))!==null&&d!==void 0?d:4.5)>=4.5&&((u=mt(S,y))!==null&&u!==void 0?u:4.5)>=4.5?S:_s(g);return{"--sl-accent":k,"--sl-accent-ink":C,"--sl-accent-text":fv(k,T,g,y),"--sl-bg":g,"--sl-surface":y,"--sl-text":T,"--sl-muted":(h=e==null?void 0:e.muted)!==null&&h!==void 0?h:b?"#667085":"#a5aec2","--sl-line":(p=e==null?void 0:e.line)!==null&&p!==void 0?p:b?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-font":(f=(v=e==null?void 0:e.fontFamily)!==null&&v!==void 0?v:t==null?void 0:t.fontFamily)!==null&&f!==void 0?f:"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${(m=e==null?void 0:e.radius)!==null&&m!==void 0?m:14}px`}}function vv(t,e,i){const s=document.createElement("div");s.className="sl-picker",s.tabIndex=-1,t.appendChild(s),Object.entries(rl(void 0,i)).forEach(([o,a])=>s.style.setProperty(o,a)),s.innerHTML=` -
- -
-
-
-
- - - - - - -
-
-
-
-
-
-
-
- - - - -
-
${e("picker.loadingSeatMap","Loading seat map…")}
-
-
-
-
-
-
-
- -
-
-
${e("picker.filters","Filters")}
-
-
-
${e("picker.ticketPrices","Ticket prices")}
-
-
-
- - ${e("picker.liveAvailability","Live availability — seats update in real time")} -
-
- ${e("picker.yourSeats","Your seats")} - -
-
-
-
- - - ${e("picker.seatsSecured","Seats secured")} - ${e("picker.notChargedYet","You won’t be charged yet.")} - - -
-
- -
-
-
`;const n={};return s.querySelectorAll("[data-ref]").forEach(o=>{n[o.dataset.ref]=o}),{root:s,mapHost:n.map,els:n}}function mv(t){const{root:e,source:i,caption:s,real:n,closeLabel:o,dragHint:a,viewFromSeatLabel:r,real360Label:l,previewLabel:c,resolveAsset:d,onClose:u}=t,h=document.createElement("div");h.className="sl-view",h.setAttribute("role","dialog"),h.setAttribute("aria-label",r),h.innerHTML=`
${r}${s}
${n?l:c}${a}
`,e.appendChild(h);const p=h.querySelector(".sl-view-pano"),f=Yf(i,Kf()),v=new AbortController;p.style.backgroundImage=`url("${f.initialUrl}")`;let m=()=>{};f.upgradeUrl&&(m=Zf(()=>{d(f.upgradeUrl).then(B=>!B||v.signal.aborted?null:Xf(B,v.signal).then(()=>B)).then(B=>{!B||!h.isConnected||v.signal.aborted||(p.style.backgroundImage=`url("${B}")`)}).catch(()=>{})}));const g=70,b=35;let y=1;const k=p.clientHeight||1,w=p.clientWidth||1;let C=-(k*(180/g)*2/2-w/2),S=0;const T=()=>{const B=p.clientHeight||1,z=B*(180/g)*y,j=Math.max(0,z-B),G=Math.min(j/2,b/180*z);S=Math.min(G,Math.max(-G,S)),p.style.backgroundSize=`auto ${z}px`,p.style.backgroundPosition=`${C}px ${S-j/2}px`};T();let E=!1,L=0,I=0;const M=B=>{var z;E=!0,L=B.clientX,I=B.clientY,p.classList.add("drag"),(z=p.setPointerCapture)===null||z===void 0||z.call(p,B.pointerId)},x=B=>{E&&(C+=B.clientX-L,S+=B.clientY-I,L=B.clientX,I=B.clientY,T())},A=B=>{var z;E=!1,p.classList.remove("drag"),(z=p.releasePointerCapture)===null||z===void 0||z.call(p,B.pointerId)},P=B=>{B.preventDefault(),y=Math.min(2.4,Math.max(1,y+(B.deltaY<0?.12:-.12))),T()};p.addEventListener("pointerdown",M),p.addEventListener("pointermove",x),p.addEventListener("pointerup",A),p.addEventListener("pointercancel",A),p.addEventListener("wheel",P,{passive:!1});const N=h.querySelector(".sl-view-x");N.addEventListener("click",u);const W=B=>{B.key==="Escape"&&(B.stopPropagation(),u())};return h.addEventListener("keydown",W),N.focus(),{element:h,dispose(){m(),v.abort(),p.removeEventListener("pointerdown",M),p.removeEventListener("pointermove",x),p.removeEventListener("pointerup",A),p.removeEventListener("pointercancel",A),p.removeEventListener("wheel",P),h.removeEventListener("keydown",W),N.removeEventListener("click",u)}}}function Q(t,e){const i=V(t);return i===t?e:i}function gv(t){if(typeof t=="string"){const e=document.querySelector(t);if(!e)throw new Error(`seatmap: container "${t}" not found`);return e}if(!(t instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return t}function tt(t){return String(t!=null?t:"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}var Xn=(()=>{if(typeof document!="undefined"&&document.currentScript instanceof HTMLScriptElement&&document.currentScript.src)return document.currentScript.src;try{const t={}.url;if(typeof t=="string"&&t)return t}catch{}})(),oi=null;function bv(){if(oi!==null)return oi;try{if(typeof document=="undefined")return oi=!1;oi=!!document.createElement("canvas").getContext("webgl2")}catch{oi=!1}return oi}function Zn(t){const e=Xn!=null?Xn:typeof location!="undefined"?location.href:void 0;if(!e)throw new Error(`seatlayer: cannot resolve the ${t} chunk URL`);return new URL(`./${t}`,e).href}async function ll(){return import(Zn("seatlayer-view3d.mjs"))}async function yv(){return import(Zn("seatlayer-panorama.mjs"))}async function kv(){return import(Zn("seatlayer-checkout.mjs"))}function wv(t){return t==="unavailable_for_event"||t==="payments_off_for_event"?t:"not_configured"}function Qn(t,e,i){const s={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},n=new Date(t);if(e)try{return n.toLocaleString(i,{...s,timeZone:e})}catch{}return n.toLocaleString(i,s)}function it(t){return String(t!=null?t:"").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function zi(t){return t!=null&&t.restrictedView?Q("picker.restrictedView","Restricted view"):t!=null&&t.obstructedView?Q("picker.obstructedView","Obstructed view"):""}function xv(t){if(!t)return"";const e=[];t.premium&&e.push(`
${Q("picker.premiumSeat","Premium seat")}
`);const i=zi(t);return i?e.push(`
${i}${t.note?`${it(t.note)}`:""}
`):t.note&&e.push(`
${it(t.note)}
`),e.length?`
${e.join("")}
`:""}function cl(t){const e=zi(t);if(!e)return"";const i=it(t!=null&&t.note?t.note:e);return``}function Ps(t){return t==="no-seat"?Q("picker.emptyWheelchairSpace","Empty wheelchair space"):t==="seat-present"?Q("picker.accessiblePhysicalSeat","Accessible physical seat"):""}function Sv(t){const e=Ps(t);return e?`
${e}
`:""}function dl(t){const e=Ps(t);return e?``:""}function hl(t,e){if(!t)return"";const i=e?Q("picker.viewFromThisSeat","View from this seat"):Q("picker.seeItIn3d","See it in 3D");return``}function Cv(t){if(!t)return"";const e=t.previous.label||t.previous.id,i=t.next.label||t.next.id;return``}function Tv(t,e){if(!e)return"";const i=e,s=i.includes(t.id),n=s?i.length>1?Q("picker.openComparison","Open comparison"):Q("picker.savedForComparison","Saved for comparison"):i.length?Q("picker.compareWithSaved","Compare with saved"):Q("picker.saveToCompare","Save to compare");return``}function Lv(t,e,i){var s,n;if(!i)return"";const o=Yn(t.confidenceEvidence),a=(s=o.modeledTarget)!==null&&s!==void 0?s:o.reality;return``}function Di(t){const e=t==null?void 0:t.rowLabel,i=t==null?void 0:t.sectionLabel;if(!e||!i)return e;for(const s of["-"," ","·","/","_"]){const n=`${i}${s}`;if(e.startsWith(n)&&e.length>n.length)return e.slice(n.length)}return e}function Av(t,e,i,s,n=6){const o=n*s,a=Math.min((e-o*2)/Math.max(1,t.width),(i-o*2)/Math.max(1,t.height));return{scale:a,offX:(e-t.width*a)/2-t.x*a,offY:(i-t.height*a)/2-t.y*a,dpr:s}}function Ev(t,e){return{x:t.x*e.scale+e.offX,y:t.y*e.scale+e.offY,width:t.width*e.scale,height:t.height*e.scale}}function Iv(t,e,i,s,n=2){const o=Ev(t,e),a=Math.max(n,o.x),r=Math.max(n,o.y),l=Math.min(i-n,o.x+o.width),c=Math.min(s-n,o.y+o.height);return{raw:o,clipped:l>a&&c>r?{x:a,y:r,width:l-a,height:c-r}:null,clippedEdges:{left:o.xi-n,bottom:o.y+o.height>s-n}}}function Mv(t,e){return{x:(t.x-e.offX)/e.scale,y:(t.y-e.offY)/e.scale}}function _v(t,e){const i=new Pv(t);return i.build(e),i}var Pv=class{constructor(t){this.host=t,this.miniCanvas=null,this.miniBase=null,this.miniWrap=null,this.miniToggle=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.miniSuppressClick=!1,this.userClosed=!1}build(t){if(!this.host.controller.getViewport())return;const e=document.createElement("button");e.type="button",e.className="sl-minimap-toggle",e.setAttribute("aria-label",Q("picker.openVenueMap","Open venue overview map")),e.setAttribute("aria-expanded","false"),e.innerHTML='',t.appendChild(e),this.miniToggle=e;const i=document.createElement("div");i.className="sl-minimap",i.setAttribute("role","group");const s=document.createElement("div");s.className="sl-minimap-bar";const n=document.createElement("span");n.className="sl-minimap-label";const o=document.createElement("span");o.className="sl-minimap-key",o.setAttribute("aria-label",Q("picker.minimapStateKey","Focused, selected, available, and inactive sections")),o.innerHTML='';const a=document.createElement("button");a.type="button",a.className="sl-minimap-close",a.setAttribute("aria-label",Q("picker.closeVenueMap","Close venue overview map")),a.textContent="×",s.append(n,o,a);const r=document.createElement("canvas");r.tabIndex=0,r.setAttribute("role","application"),r.setAttribute("aria-label",Q("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),i.append(s,r),t.appendChild(i),this.miniWrap=i,this.miniLabel=n,this.miniCanvas=r;const l=document.createElement("canvas");this.miniBase=l,e.addEventListener("click",()=>{var c;const d=((c=this.host.root())===null||c===void 0?void 0:c.dataset.minimapOpen)==="true";this.userClosed=d,this.setMinimapOpen(!d)}),a.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),r.addEventListener("click",c=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(c)}),r.addEventListener("pointerdown",c=>this.minimapPointerDown(c)),r.addEventListener("pointermove",c=>this.minimapPointerMove(c)),r.addEventListener("pointerup",c=>this.minimapPointerUp(c)),r.addEventListener("pointercancel",c=>this.minimapPointerUp(c)),r.addEventListener("keydown",c=>this.minimapKeydown(c)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setAutoOpen(t){var e;if(this.miniWrap){if(!t){var i;this.userClosed=!1,((i=this.host.root())===null||i===void 0?void 0:i.dataset.minimapOpen)==="true"&&this.setMinimapOpen(!1,!1);return}this.userClosed||((e=this.host.root())===null||e===void 0?void 0:e.dataset.minimapOpen)==="true"||this.setMinimapOpen(!0,!1)}}setMinimapOpen(t,e=!0){var i,s,n,o;(i=this.host.root())===null||i===void 0||i.setAttribute("data-minimap-open",String(t)),(s=this.miniToggle)===null||s===void 0||s.setAttribute("aria-expanded",String(t)),e&&(t?(n=this.miniCanvas)===null||n===void 0||n.focus():(o=this.miniToggle)===null||o===void 0||o.focus())}layoutMinimap(){var t;const e=this.miniCanvas,i=this.miniBase,s=(t=this.host.controller.getViewport())===null||t===void 0?void 0:t.bounds;if(!e||!i||!s||!(s.width>0&&s.height>0))return;const n=196,o=146,a=6,r=s.width/Math.max(1,s.height);let l=n,c=Math.round(n/r);c>o&&(c=o,l=Math.round(o*r)),l=Math.max(64,l),c=Math.max(48,c);const d=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*d),e.height=Math.round(c*d),e.style.width=`${l}px`,e.style.height=`${c}px`,i.width=e.width,i.height=e.height,this.miniTf=Av(s,e.width,e.height,d,a)}syncMinimapLabel(){var t,e,i,s;if(!this.miniLabel||!this.miniWrap)return;const n=this.host.controller.getFloors(),o=this.host.controller.isFloorOverview()?Q("picker.allFloors","All floors"):(t=(e=n.find(p=>p.id===this.host.controller.getActiveFloorId()))===null||e===void 0?void 0:e.name)!==null&&t!==void 0?t:Q("picker.venueOverview","Venue overview"),a=this.host.controller.getMinimapSnapshot().sections,r=a.find(p=>p.active),l=(i=r==null?void 0:r.label)!==null&&i!==void 0?i:this.host.focusedSectionLabel(),c=l?`${o} · ${l}`:o;this.miniLabel.textContent=c;const d=a.filter(p=>p.state==="selected").length,u=a.filter(p=>p.state==="available").length,h=a.filter(p=>p.state==="inactive").length;this.miniWrap.setAttribute("aria-label",a.length?`${c}. ${d} selected, ${u} available, ${h} inactive sections.`:c),(s=this.miniCanvas)===null||s===void 0||s.setAttribute("aria-label",a.length?`${c}. ${d} selected, ${u} available, ${h} inactive sections. ${Q("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${c}. ${Q("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click elsewhere, or use arrow keys to pan.")}`)}refreshMinimap(){this.miniBase&&(this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect())}drawMinimapStatic(){const t=this.miniBase,e=this.miniTf;if(!t||!e)return;const i=t.getContext("2d");if(!i)return;i.clearRect(0,0,t.width,t.height);const s=d=>d*e.scale+e.offX,n=d=>d*e.scale+e.offY,o=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",a=this.host.cssVar("--sl-muted")||"#8b93a7",r=this.host.cssVar("--sl-accent")||"#6e7bff",l=this.host.cssVar("--sl-success")||"#22a06b",c=this.host.controller.getMinimapSnapshot();for(const d of c.sections)d.outline.length<3||(i.beginPath(),d.outline.forEach((u,h)=>h===0?i.moveTo(s(u.x),n(u.y)):i.lineTo(s(u.x),n(u.y))),i.closePath(),i.globalAlpha=d.state==="inactive"?.18:d.state==="selected"?.72:.34,i.fillStyle=d.state==="inactive"?a:d.state==="selected"?r:l,i.fill(),i.globalAlpha=.82,i.lineWidth=Math.max(1,e.dpr),i.strokeStyle=o,i.stroke(),d.active&&(i.globalAlpha=1,i.lineJoin="round",i.lineWidth=Math.max(4,e.dpr*3.5),i.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",i.stroke(),i.lineWidth=Math.max(2,e.dpr*1.75),i.strokeStyle=r,i.stroke()));if(i.globalAlpha=1,!c.sections.length){const d=Math.max(1,e.dpr);for(const u of c.seats)i.globalAlpha=u.state==="inactive"?.22:.78,i.fillStyle=u.state==="inactive"?a:u.state==="selected"?r:l,i.beginPath(),i.arc(s(u.x),n(u.y),d,0,Math.PI*2),i.fill();i.globalAlpha=1}}drawMinimapRect(){const t=this.miniCanvas,e=this.miniBase,i=this.miniTf;if(!t||!e||!i)return;const s=t.getContext("2d");if(!s)return;s.clearRect(0,0,t.width,t.height),s.drawImage(e,0,0);const n=this.host.controller.getViewport();if(!n)return;const o=Iv(n.visible,i,t.width,t.height,Math.max(2,i.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",r=this.host.cssVar("--sl-surface")||"#fff";s.save(),s.globalAlpha=.1,s.fillStyle=a,s.fillRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),s.globalAlpha=.9,s.lineJoin="round",s.lineWidth=Math.max(4,i.dpr*3.25),s.strokeStyle=r,s.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),s.globalAlpha=1,s.lineWidth=Math.max(2,i.dpr*1.75),s.strokeStyle=a,s.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),o.clipped&&Object.values(o.clippedEdges).some(Boolean)&&(s.setLineDash([Math.max(3,i.dpr*3),Math.max(2,i.dpr*2)]),s.strokeRect(o.clipped.x,o.clipped.y,o.clipped.width,o.clipped.height)),s.restore()}minimapWorldPoint(t){const e=this.miniCanvas,i=this.miniTf;if(!e||!i)return null;const s=e.getBoundingClientRect(),n=(t.clientX-s.left)*(e.width/Math.max(1,s.width)),o=(t.clientY-s.top)*(e.height/Math.max(1,s.height));return{...Mv({x:n,y:o},i),px:n,py:o}}minimapPointerDown(t){var e,i,s;const n=this.minimapWorldPoint(t),o=(e=this.host.controller.getViewport())===null||e===void 0?void 0:e.visible;!n||!o||n.x>=o.x&&n.x<=o.x+o.width&&n.y>=o.y&&n.y<=o.y+o.height&&(this.miniDrag={pointerId:t.pointerId,offsetX:n.x-(o.x+o.width/2),offsetY:n.y-(o.y+o.height/2),startX:t.clientX,startY:t.clientY,moved:!1},(i=this.miniCanvas)===null||i===void 0||i.setPointerCapture(t.pointerId),(s=this.miniCanvas)===null||s===void 0||s.classList.add("sl-dragging"),t.preventDefault())}minimapPointerMove(t){const e=this.miniDrag;if(!e||e.pointerId!==t.pointerId)return;const i=this.minimapWorldPoint(t);i&&(!e.moved&&Math.hypot(t.clientX-e.startX,t.clientY-e.startY)>2&&(e.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:i.x-e.offsetX,y:i.y-e.offsetY}),t.preventDefault())}minimapPointerUp(t){var e,i;const s=this.miniDrag;!s||s.pointerId!==t.pointerId||(this.miniSuppressClick=s.moved,this.miniDrag=null,(e=this.miniCanvas)===null||e===void 0||e.classList.remove("sl-dragging"),!((i=this.miniCanvas)===null||i===void 0)&&i.hasPointerCapture(t.pointerId)&&this.miniCanvas.releasePointerCapture(t.pointerId))}minimapKeydown(t){var e;const i=(e=this.host.controller.getViewport())===null||e===void 0?void 0:e.visible;if(!i)return;if(t.key==="Home"){this.host.controller.overview(),t.preventDefault();return}const s=t.key==="ArrowLeft"?-i.width*.2:t.key==="ArrowRight"?i.width*.2:0,n=t.key==="ArrowUp"?-i.height*.2:t.key==="ArrowDown"?i.height*.2:0;!s&&!n||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:i.x+i.width/2+s,y:i.y+i.height/2+n}),t.preventDefault())}minimapJump(t){const e=this.minimapWorldPoint(t);if(e){for(const i of this.host.controller.getMinimapSnapshot().sections)if(!(i.state==="inactive"||i.outline.length<3)&&Zs(e,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(e)}}},Rv=12;function $v(t,e){const i=e.floors(),s=new Set(i.map(v=>v.label.trim().toLocaleLowerCase())),n=e.zones().filter(v=>v.seatCount>0&&!s.has(v.label.trim().toLocaleLowerCase())),o=e.sections().filter(v=>v.seatCount>0&&!s.has(v.label.trim().toLocaleLowerCase())),a=n.length>1?[]:o,r=i.length>1,l=n.length>1,c=a.length>1;if(!r&&!l&&!c)return;const d=document.createElement("div");d.className="sl-view3d-nav";const u=document.createElement("button");u.type="button",u.className="sl-view3d-nav-toggle",u.setAttribute("aria-expanded","false");const h=v=>{d.classList.toggle("is-open",v),u.setAttribute("aria-expanded",String(v)),u.textContent=v?Q("picker.closeVenueNav","Close"):r&&(l||c)?Q("picker.levelsAndAreas","Levels & areas"):r?Q("picker.levels","Levels"):Q("picker.areas","Areas")};u.addEventListener("click",()=>h(!d.classList.contains("is-open"))),d.addEventListener("keydown",v=>{v.key!=="Escape"||!d.classList.contains("is-open")||(v.preventDefault(),v.stopPropagation(),h(!1),u.focus())}),h(!1),d.appendChild(u);let p=v=>{},f=v=>{};if(r){const v=document.createElement("div");v.setAttribute("role","group"),v.setAttribute("aria-label",Q("picker.levels","Levels"));const m=[];f=y=>{m.forEach(k=>{k.setAttribute("aria-pressed",String((k.dataset.floor===""?null:Number(k.dataset.floor))===y))})};const g=y=>{e.focusFloor(y)&&(f(y),p(y))},b=(y,k)=>{const w=document.createElement("button");w.type="button",w.textContent=y,w.dataset.floor=k===null?"":String(k),w.setAttribute("aria-pressed",String(k===null)),w.addEventListener("click",()=>{g(k),h(!1)}),m.push(w),v.appendChild(w)};b(Q("picker.allLevels","All levels"),null);for(const y of i)b(y.label||V("picker.levelNumber",{number:y.index+1}),y.index);d.appendChild(v)}if(l||c){const v=document.createElement("div");v.setAttribute("role","group"),v.setAttribute("aria-label",Q("picker.areas","Areas"));const m=l?n.map(b=>({id:b.id,label:b.label||b.id,go:()=>{e.focusZone(b.id)}})):a.map(b=>({id:b.id,label:b.label||b.id,floorIndex:b.floorIndex,go:()=>{e.focusSection(b.id),Number.isFinite(b.floorIndex)&&f(b.floorIndex)}})),g=b=>{const y=l||b===null?m:m.filter(k=>k.floorIndex===void 0||k.floorIndex===b);if(v.replaceChildren(),!y.length){v.remove();return}if(v.isConnected||d.appendChild(v),!l&&y.length>Rv){const k=document.createElement("select");k.setAttribute("aria-label",Q("picker.jumpToSection","Jump to section"));const w=document.createElement("option");w.value="",w.textContent=Q("picker.jumpToSection","Jump to section"),k.appendChild(w);for(const C of y){const S=document.createElement("option");S.value=C.id,S.textContent=C.label,k.appendChild(S)}k.addEventListener("change",()=>{var C;(C=y.find(S=>S.id===k.value))===null||C===void 0||C.go()}),v.appendChild(k);return}for(const k of y){const w=document.createElement("button");w.type="button",w.textContent=k.label,w.addEventListener("click",()=>{k.go(),h(!1)}),v.appendChild(w)}};p=g,g(null)}t.appendChild(d)}var Ov=class{constructor(t){this.host=t,this.chip=null}sync(){const t=this.host.overlay();if(!t||this.host.savedSeatIds().length===0){var e;(e=this.chip)===null||e===void 0||e.remove(),this.chip=null;return}let i=this.chip;if(!i){i=document.createElement("div"),i.className="sl-view3d-compare-saved",i.setAttribute("role","group"),i.setAttribute("aria-label",Q("picker.savedSeatComparison","Saved seat comparison"));const o=document.createElement("button");o.type="button",o.className="main",o.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(Q("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});const a=document.createElement("button");a.type="button",a.className="clear",a.textContent="×",a.setAttribute("aria-label",Q("picker.clearSavedSeatComparison","Clear saved seat comparison")),a.addEventListener("click",()=>this.host.clearComparison()),i.append(o,a),t.appendChild(i),this.chip=i}const s=this.host.savedSeatIds().length,n=i.querySelector(".main");n&&(n.textContent=s>1?V("picker.compareCount",{count:s}):Q("picker.oneSeatSaved","1 seat saved"),n.setAttribute("aria-label",s>1?V("picker.openComparisonOfSeats",{count:s}):Q("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){var t;(t=this.chip)===null||t===void 0||t.remove(),this.chip=null}mainButton(){var t,e;return(t=(e=this.chip)===null||e===void 0?void 0:e.querySelector(".main"))!==null&&t!==void 0?t:null}};function Fv(t){return Array.isArray(t)?t.reduce((e,i)=>i.type==="minimumSelectedPlaces"?Math.max(e,i.minimum):e,0):0}function ul(t,e,i=!1){const s=t.violations[0];return s==="numberOfPlacesToSelect"?t.remaining>0?V("picker.selectExactMore",{count:t.remaining}):V("picker.selectExactCount",{count:t.required}):s==="minimumSelectedPlaces"?V("picker.selectMinimumMore",{count:t.remaining}):i?e("picker.adjustSeatSelection","Adjust seat selection"):s==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):V("picker.orphanHint")}function pl(t){const e=Math.max(0,t);return`${Math.floor(e/6e4)}:${String(Math.floor(e%6e4/1e3)).padStart(2,"0")}`}function Bv({d:t,area:e,label:i,objectType:s,quantity:n=1,identity:o}){var a,r,l,c,d,u,h,p,f,v;const m=k=>String(k!=null?k:"—").replace(/[&<>"]/g,w=>({"&":"&","<":"<",">":">",'"':"""})[w]),g=s==="ga"?"ga":(a=t==null?void 0:t.objectType)!==null&&a!==void 0?a:s,b=(o==null||(r=o.displayType)===null||r===void 0?void 0:r.trim())||(t==null||(l=t.displayType)===null||l===void 0?void 0:l.trim())||(e==null||(c=e.displayType)===null||c===void 0?void 0:c.trim())||(g==="table"?Q("picker.table","Table"):g==="booth"?Q("picker.booth","Booth"):g==="ga"?Q("picker.generalAdmission","General admission"):Q("picker.row","Row")),y=(d=(u=(h=(p=(f=(v=o==null?void 0:o.rowLabel)!==null&&v!==void 0?v:o==null?void 0:o.displayLabel)!==null&&f!==void 0?f:t==null?void 0:t.rowLabel)!==null&&p!==void 0?p:t==null?void 0:t.displayLabel)!==null&&h!==void 0?h:e==null?void 0:e.displayLabel)!==null&&u!==void 0?u:e==null?void 0:e.label)!==null&&d!==void 0?d:i;return g==="table"&&(o!=null&&o.bookingMode)?`
${m(b)}${m(y)}${Q("picker.guests","Guests")}${n}
`:g==="ga"?`
${m(b)}${m(y)}`+(n>1?`${Q("picker.tickets","Tickets")}${n}`:"")+"
":g==="booth"?'
'+(t!=null&&t.sectionLabel?`${Q("picker.section","Section")}${m(t.sectionLabel)}`:"")+`${m(b)}${m(y)}
`:!(t!=null&&t.sectionLabel)&&!(t!=null&&t.rowLabel)&&!(t!=null&&t.seatNumber)?`
${Q("picker.seat","Seat")}${m(y)}
`:'
'+(t.sectionLabel?`${Q("picker.section","Section")}${m(t.sectionLabel)}`:"")+(t.rowLabel?`${m(b)}${m(Di(t))}`:"")+(t.seatNumber?`${Q("picker.seat","Seat")}${m(t.seatNumber)}`:"")+"
"}function zv(t,e){return`
`+(e?``:"")+"
"}function Dv(t){return t.salesClosed||t.hasHold||t.ctaPhase!=="idle"||t.formOpen||t.room<=0?null:Math.max(1,Math.min(t.wanted,t.room))}function Hv({count:t,total:e,pendingCount:i,ctaPhase:s,hasHold:n,salesClosed:o,fromPrice:a,addMore:r,money:l}){if(t&&s==="holding")return`${Q("picker.securingSeats","Securing your seats…")}`;if(t&&s==="checkout")return`${V("picker.peekSecured",{count:t,total:l(e)})}`;if(t){const c=!!n;return`${vt("picker.peekTicketsTotal",t,{total:l(e)})}`+(r?``:"")+``}else return o?`${Q("picker.salesClosedPill","Sales are closed")}`:(a!=null?`${V("picker.peekFromPrice",{price:l(a)})}`:`${Q("picker.pickYourSeats","Pick your seats")}`)+``}function fl(t,e=Date.now()){return V("picker.holdReassurance",{time:pl(t-e)})}var Nv="https://api.seatlayer.io",Vv=10,vl=6e4,ml=6e4,gl=new Set;function Gv(t){const e=gl.has(t);return gl.add(t),e}var bl="seatmap.a11y.cb";function qv(){try{if(typeof window=="undefined")return null;const t=window.localStorage.getItem(bl);return t==null?null:t==="1"}catch{return null}}function jv(t){try{window.localStorage.setItem(bl,t?"1":"0")}catch{}}var Uv=class xo{chartHasStage(){var e,i;const s=this.controller.doc;if(!s)return!1;const n=!((e=s.floors)===null||e===void 0)&&e.length?s.floors.map(o=>{var a;return(a=o.objects)!==null&&a!==void 0?a:[]}):[(i=s.objects)!==null&&i!==void 0?i:[]];for(const o of n)for(const a of o)if(a.type==="shape"&&(a.role==="stage"||a.stageKind))return!0;return!1}confirmThumbHtml(e){var i;const s=this.controller.doc;if(!s)return"";const n=(i=e.viewUrl)!==null&&i!==void 0?i:"",o=this.chartHasStage();if(!n&&!o)return"";let a=null;if(!n)try{var r,l;a=(l=nf(e,(r=e.focalPoint)!==null&&r!==void 0?r:s.focalPoint).distanceM)!==null&&l!==void 0?l:null}catch{return""}const c=o&&a!=null?`
${V("picker.sightline",{m:a})}
`:"";return(n?``:``)+c}isFramed(){return typeof window!="undefined"&&window.parent!==window}postToHost(e){if(this.isFramed())try{window.parent.postMessage(e,"*")}catch{}}measureFramedHeight(){const e=this.root;if(!e)return 0;const i=e.clientWidth||(typeof window!="undefined"?window.innerWidth:0)||0;return i<=0?0:Math.max(420,Math.round(i*(i<640?1.2:.62)))}reportFramedHeight(){if(!this.isFramed())return;const e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){const e=this.root;e&&(document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback())}syncFullscreenButtons(){var e,i,s,n,o;const a=!!document.fullscreenElement||this.fsFallback||this.framedFs,r=this.eventDetailsHidden&&!a;(e=this.root)===null||e===void 0||e.setAttribute("data-event-details-hidden",String(r)),(i=this.els.zfs)===null||i===void 0||i.setAttribute("aria-pressed",String(a)),(s=this.els.zfs)===null||s===void 0||s.setAttribute("title",a?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));const l=(n=this.els.zfs)===null||n===void 0?void 0:n.querySelector(".sl-zfs-lbl");l&&(l.textContent=a?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),(o=this.view3dEl)===null||o===void 0||(o=o.querySelector(".sl-view3d-fs"))===null||o===void 0||o.setAttribute("aria-pressed",String(a))}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e}),e&&!this.fsEscHandler?(this.fsEscHandler=i=>{i.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){var i;this.fsFallback!==e&&(this.fsFallback=e,(i=this.root)===null||i===void 0||i.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=s=>{s.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){var i,s;ol();const n=document.activeElement instanceof HTMLElement?document.activeElement:null,o=document.createElement("div");o.className="sl-modal-scrim";const a=document.createElement("div");a.className="sl-modal-frame",a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true"),a.setAttribute("aria-label",Q("picker.seatSelection","Seat selection")),a.tabIndex=-1,o.appendChild(a),document.body.appendChild(o);const r=document.body.style.overflow;document.body.style.overflow="hidden";const l=new xo({...e,container:a});l.modalScrim=o,l.prevFocus=n;const c=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),d=()=>{var m;const g=[...a.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(b=>b.isConnected&&!b.closest('[hidden], [aria-hidden="true"], [inert]'));return(m=g[g.length-1])!==null&&m!==void 0?m:a},u=(m,g)=>{let b=m;for(;b;){const y=window.getComputedStyle(b);if(b.hidden||b.getAttribute("aria-hidden")==="true"||b.hasAttribute("inert")||y.display==="none"||y.visibility==="hidden"||y.visibility==="collapse")return!0;if(b===g)return!1;b=b.parentElement}return!0},h=m=>[...m.querySelectorAll(c)].filter(g=>g.tabIndex>=0&&!g.matches(":disabled")&&!u(g,m)),p=(m,g)=>{const b=h(m),y=g?b[b.length-1]:b[0];y?y.focus({preventScroll:!0}):(m.hasAttribute("tabindex")||(m.tabIndex=-1),m.focus({preventScroll:!0}))};let f=!1;const v=()=>{if(f)return;f=!0,document.body.style.overflow=r,l.escHandler&&document.removeEventListener("keydown",l.escHandler),o.remove(),l.modalScrim=null;const m=l.prevFocus;l.prevFocus=null,m!=null&&m.isConnected&&m.focus({preventScroll:!0});const g=()=>{var b;l.destroy(),(b=e.onClose)===null||b===void 0||b.call(e)};l.hold&&!l.handedOff?l.release().finally(g):g()};return l.closeModal=v,o.addEventListener("mousedown",m=>{m.target===o&&v()}),l.escHandler=m=>{if(m.key==="Tab"){if(m.defaultPrevented)return;const g=d(),b=h(g),y=b[0],k=b[b.length-1],w=document.activeElement;!y||!k?(m.preventDefault(),p(g,m.shiftKey)):w===g||!w||!g.contains(w)?(m.preventDefault(),(m.shiftKey?k:y).focus({preventScroll:!0})):m.shiftKey&&w===y?(m.preventDefault(),k.focus({preventScroll:!0})):!m.shiftKey&&w===k&&(m.preventDefault(),y.focus({preventScroll:!0}));return}m.key==="Escape"&&(l.tableDialog?(m.preventDefault(),l.cancelTableDialog()):l.confirmSeat?(m.preventDefault(),l.cancelConfirm()):l.bestAvailableConfirm?(m.preventDefault(),l.bestAvailableConfirm=!1,l.syncTray()):(m.preventDefault(),v()))},document.addEventListener("keydown",l.escHandler),await l.render(),(i=l.els.close)===null||i===void 0||i.classList.add("on"),(s=l.els.close)===null||s===void 0||s.addEventListener("click",v),p(d(),!1),l}constructor(e){var i,s,n,o,a,r,l,c;if(this.realtime=null,this.accessEl=null,this.lastSelectionValidity=null,this.root=null,this.mapHost=null,this.rendered=!1,this.destroyed=!1,this.els={},this.regions={},this.ro=null,this.holdTimer=null,this.toastTimer=null,this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerVisibilityHandler=null,this.motionTimers=new Set,this.currency="USD",this.eventTimezone=null,this.eventWhenText=null,this.offerAvailability=null,this.channelByObject=new Map,this.pricesByChannel=new Map,this.hold=null,this.holdExpiresAt=0,this.handedOff=!1,this.bookedShown=!1,this.paymentOptions=null,this.checkoutPanel=null,this.extendEl=null,this.bookedEl=null,this.gaQty=new Map,this.tipEl=null,this.tipPos={x:0,y:0},this.confirmEl=null,this.confirmSeat=null,this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,this.srEl=null,this.baQty=2,this.baCat="",this.baZone="",this.baPremium=!1,this.baReopen=!1,this.bestAvailableConfirm=!1,this.releasingHold=!1,this.salesClosed=!1,this.soldOut=!1,this.soldoutEl=null,this.cbSafe=!1,this.rungsEl=null,this.projectionEl=null,this.buyerView="map",this.view3dEl=null,this.view3dHandle=null,this.view3dGen=0,this.view3dReturnSeat=null,this.view3dTargetSeatId=null,this.view3dCompareSeatIds=[],this.view3dCompareChip=new Ov({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(p,f)=>this.toast(p,f)}),this.view3dCompareEl=null,this.view3dCompareCleanup=null,this.view3dPassportEl=null,this.view3dPassportCleanup=null,this.floorsEl=null,this.secCardEl=null,this.viewEl=null,this.viewCleanup=null,this.seatViewGen=0,this.allSeatsCache=null,this.minimap=null,this.pickerLayoutSize={width:0,height:0},this.priceBandKeys=null,this.focusedCatKey=null,this.limitedViewFilter=!1,this.pricesExpanded=!1,this.lastSection=null,this.secCardCollapsed=!1,this.secCardShownAt=0,this.lastTrayCount=0,this.lastTrayTotal=0,this.lastTrayKeys=new Set,this.bestAvailableBusy=!1,this.releasingLabels=new Set,this.holdingLabels=new Set,this.ctaPhase="idle",this.a11yChipsEl=null,this.fsFallback=!1,this.fsChangeHandler=null,this.fsEscHandler=null,this.eventDetailsHidden=!1,this.holdCopyPending=!1,this.sideCollapsed=!1,this.sideToggleEl=null,this.framedFs=!1,this.lastPostedHeight=0,this.cbEl=null,this.modalScrim=null,this.prevFocus=null,this.escHandler=null,this.closeModal=null,this.lastCatAvail=null,this.lastAvailFloorId="",this.availQuietUntil=0,this.liveTimer=null,this.perspectiveWarned=!1,!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.opts={...e,confirmSelection:(i=e.confirmSelection)!==null&&i!==void 0?i:!0},this.eventDetailsHidden=!!e.hideEventDetails,this.hostPricing=e.pricing,this.apiBase=((s=e.apiBase)!==null&&s!==void 0?s:Nv).replace(/\/+$/,""),this.access=e.transport?null:Wn(e,{onExpired:p=>{var f,v;(f=(v=this.opts).onAccessExpired)===null||f===void 0||f.call(v,p),p.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:p=>{var f,v;(f=(v=this.opts).onAccessUnavailable)===null||f===void 0||f.call(v,p),this.showAccessPanel(p)}}),this.pubApi=e.transport?null:new Nr(this.apiBase,{access:(n=this.access)!==null&&n!==void 0?n:void 0,onObjectUnavailable:p=>{var f,v;return(f=(v=this.opts).onSelectedObjectUnavailable)===null||f===void 0?void 0:f.call(v,p)}}),this.api=(o=e.transport)!==null&&o!==void 0?o:this.pubApi,this.buyerAssetUrls=new lv(e.event,this.api.asset?(p,f)=>this.api.asset(p,f):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport — a custom `transport` owns its backend, so the picker is staying on onCheckout for this mount.'),this.checkoutMode=e.checkout==="hosted"&&this.pubApi?"hosted":"handoff";const d=e.numberOfPlacesToSelect;if(d!=null&&(!Number.isInteger(d)||d<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=d!=null?d:null;const u=Fv(e.selectionValidators);if(this.exactTickets!=null&&u>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");const h=Math.max(1,Math.floor((a=(r=e.maxSelection)!==null&&r!==void 0?r:this.exactTickets)!==null&&a!==void 0?a:Math.max(Vv,u)));if(this.exactTickets!=null&&h{var n;this.syncTray(),(n=this.minimap)===null||n===void 0||n.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:()=>{var n;this.syncPrices(),this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),(n=this.minimap)===null||n===void 0||n.refreshMinimap(),this.pushAvailabilityTo3d()},onHoldExpired:()=>{var n,o;this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.toast(V("picker.holdExpired",void 0)||"Your hold expired — seats released. Pick again.","warning"),this.syncTray(),this.emitHoldChange(),(n=(o=this.opts).onHoldExpired)===null||n===void 0||n.call(o)},confirmSelection:this.opts.confirmSelection,onSelect:n=>{if(this.salesClosed){this.controller.deselect([n.id]),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.controller.tableSelection(n.id)||(this.flashPickedSeat(n.id),this.opts.confirmSelection&&this.showConfirm(n))},onTableSelectionRequest:n=>{if(this.salesClosed){this.controller.deselect(n.physicalSeatIds),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.showTableDialog(n,!1)},onDeselect:n=>{var o,a;((o=this.confirmSeat)===null||o===void 0?void 0:o.id)===n.id&&this.dismissConfirm(),!((a=this.tableDialog)===null||a===void 0)&&a.physicalSeatIds.includes(n.id)&&this.dismissTableDialog()},onSelectionLimit:()=>{var n,o;this.toast(V("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),(n=(o=this.opts).onSelectionLimit)===null||n===void 0||n.call(o,this.maxTickets)},onViewChange:()=>{var n;this.reanchorConfirm(),this.syncRung(),this.syncProjection(),(n=this.minimap)===null||n===void 0||n.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:n=>this.showSectionCard(n),onDeckTap:()=>{var n;this.showSectionCard(null),this.syncFloors(),this.syncRung(),(n=this.minimap)===null||n===void 0||n.refreshMinimap()},onFocusSeat:n=>this.announceSeat(n),onSeatHover:n=>this.updateTooltip(n),onHint:n=>{n&&this.toast(n)},onSalesClosed:()=>this.setSalesClosed(!0),onError:n=>{var o,a;return(o=(a=this.opts).onError)===null||o===void 0?void 0:o.call(a,n)}})}async render(){var e,i,s,n,o,a,r,l,c,d,u,h,p,f,v,m;if(this.rendered)return this;const g=performance.now(),b={},y=U=>Math.round((performance.now()-U)*100)/100;this.rendered=!0,ol();const k=performance.now();await Or(this.opts.locale),b.loadLocale=y(k),this.opts.messages&&sr(this.opts.messages),this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));const w=performance.now(),{root:C,els:S,mapHost:T}=vv(gv(this.opts.container),(U,Y)=>this.tf(U,Y),this.opts.theme);this.root=C,this.els=S,this.mapHost=T,C.addEventListener("keydown",U=>{U.key==="Escape"&&(this.tableDialog?(U.preventDefault(),U.stopPropagation(),this.cancelTableDialog()):this.confirmSeat?(U.preventDefault(),U.stopPropagation(),this.cancelConfirm()):this.bestAvailableConfirm&&(U.preventDefault(),U.stopPropagation(),this.bestAvailableConfirm=!1,this.syncTray()))}),this.syncFullscreenButtons(),this.wireBuyerShell(C);const E=document.createElement("div");E.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(E),b.mountBuyerShell=y(w);const L=await this.loadChart(E,b,y);if(!L)return this;this.els.boot.remove();const I=performance.now();if(this.startRealtime(),this.salesClosed=!!L.salesClosed||!!this.opts.readOnly,C.dataset.eventMode=L.mode==="test"?"test":"live",this.controller.setViewMode(this.normalizeInitialView(this.opts.initialView)),this.buildRegions(),this.regions["bottom-right"].appendChild(this.els.zoom),this.regions["bottom-center"].appendChild(this.els.toast),L.mode==="test"){const U=document.createElement("div");U.className="sl-testbadge",U.textContent=V("picker.testMode"),U.setAttribute("aria-label",V("picker.testMode")),this.regions["top-left"].appendChild(U)}const M=(e=this.controller.doc)===null||e===void 0?void 0:e.theme;Object.entries(rl(M,this.opts.theme)).forEach(([U,Y])=>C.style.setProperty(U,Y)),this.currency=(i=(s=L.currency)!==null&&s!==void 0?s:this.opts.currency)!==null&&i!==void 0?i:"USD",this.eventTimezone=(n=L.timezone)!==null&&n!==void 0?n:null;const x=(o=(a=(r=(l=this.opts.theme)===null||l===void 0?void 0:l.logoUrl)!==null&&r!==void 0?r:M==null?void 0:M.logoUrl)!==null&&a!==void 0?a:L.posterUrl)!==null&&o!==void 0?o:null;x?this.els.logo.innerHTML=``:this.els.logo.textContent=((c=(d=(u=(h=this.opts.theme)===null||h===void 0?void 0:h.brandName)!==null&&u!==void 0?u:M==null?void 0:M.brandName)!==null&&d!==void 0?d:L.eventName)!==null&&c!==void 0?c:"?").slice(0,1).toUpperCase(),this.els.name.textContent=(p=L.eventName)!==null&&p!==void 0?p:"";const A=L.startsAt?Qn(L.startsAt,(f=L.timezone)!==null&&f!==void 0?f:null,this.opts.locale):"";this.eventWhenText=A||null,this.els.meta.textContent=[L.venue,A].filter(Boolean).join(" · "),this.els.pricesHint&&(this.els.pricesHint.textContent=this.tf("picker.priceHint","Colours on the map are ticket types — tap one below to show just those seats.")),this.buildBadge(M);const P=new Set;let N=!1;if(this.controller.doc)for(const U of Ye(this.controller.doc)){var W,B,z,j;for(const Y of(W=U.accessibility)!==null&&W!==void 0?W:[])P.add(Y);U.accessible&&!(!((B=U.accessibility)===null||B===void 0)&&B.length)&&P.add("wheelchair"),(!((z=U.commercial)===null||z===void 0)&&z.restrictedView||!((j=U.commercial)===null||j===void 0)&&j.obstructedView)&&(N=!0)}const G=()=>{this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())};if(P.size||N){const U=document.createElement("div");if(U.className="sl-chips",this.regions["top-left"].appendChild(U),this.a11yChipsEl=U,P.size){const Y=(ne,ve)=>``;U.insertAdjacentHTML("beforeend",Y("all",this.tf("picker.allSeats","All seats"))+Co.filter(({key:ne})=>P.has(ne)).map(({key:ne,short:ve,icon:Le})=>Y(ne,`${Le} ${ve}`)).join(""));const ie=new Set,ae=()=>{U.querySelectorAll("button[data-a11y]").forEach(ve=>{const Le=ve.dataset.f,Ce=Le==="all"?ie.size===0:ie.has(Le);ve.classList.toggle("on",Ce),ve.setAttribute("aria-pressed",String(Ce))});const ne=ie.size?[...ie]:null;this.controller.setAccessibilityFilter(ne),ne&&G()};U.querySelectorAll("button[data-a11y]").forEach(ne=>{ne.addEventListener("click",()=>{const ve=ne.dataset.f;ve==="all"?ie.clear():ie.has(ve)?ie.delete(ve):ie.add(ve),ae()})})}if(N){const Y=document.createElement("button");Y.type="button",Y.className="sl-chip-f",Y.setAttribute("aria-pressed","false"),Y.innerHTML=`◐ ${this.tf("picker.hideLimitedView","Hide limited-view seats")}`,U.appendChild(Y),Y.addEventListener("click",()=>{const ie=!this.limitedViewFilter;this.limitedViewFilter=ie,Y.classList.toggle("on",ie),Y.setAttribute("aria-pressed",String(ie)),this.controller.setCommercialLimitedFilter(ie),this.pushAvailabilityTo3d(),ie&&G()})}}const D=document.createElement("button");D.type="button",D.className="sl-cbbtn",this.cbEl=D,D.setAttribute("aria-label",this.tf("picker.toggleColorblindColors","Toggle colorblind-friendly colors")),D.setAttribute("aria-pressed",String(this.cbSafe)),D.innerHTML='',this.els.zfit.parentElement.appendChild(D),D.addEventListener("click",()=>{this.setColorblindSafe(!this.cbSafe)}),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),C.appendChild(this.srEl),this.buildArenaChrome(),this.buildMinimap(),this.buildPriceFilter(),this.buildExtendPrompt(),this.buildBookedOverlay(),this.buildSoldoutOverlay(),this.buildPanelToggle(),this.opts.panelCollapsed&&this.setPanelCollapsed(!0),this.dockLayoutChrome(),b.buildBuyerControls=y(I);const F=performance.now();if(await this.restoreRememberedHold(),b.restoreHold=y(F),this.destroyed)return this;this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();const _=this.controller.doc;return this.emitAnalytics("chart_rendered",{renderingTimeMillis:y(g),performanceProfile:b,seatCount:this.allSeats().length,objectCount:(v=_==null?void 0:_.objects.length)!==null&&v!==void 0?v:0,sectionCount:(m=_==null?void 0:_.objects.filter(U=>U.type==="section").length)!==null&&m!==void 0?m:0,view:this.buyerView,eventKey:this.opts.event,chartName:_==null?void 0:_.name,floorCount:this.controller.getFloors().length,transport:this.opts.transport?"custom":"pubapi",load:Gv(this.opts.event)?"repeat":"cold"}),this}wireBuyerShell(e){var i,s,n;this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler)),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit.addEventListener("click",()=>this.controller.zoomToFit()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);const o=this.els.sheetHead;if(o){var a;const l=this.els.sheetToggle,c=p=>{e.dataset.sheet=p?"open":"peek",l==null||l.setAttribute("aria-expanded",String(p)),l==null||l.setAttribute("aria-label",p?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))};c(e.dataset.sheet==="open"),l==null||l.addEventListener("click",p=>{p.stopPropagation(),c(e.dataset.sheet!=="open")}),(a=this.els.peek)===null||a===void 0||a.addEventListener("click",p=>{const f=p.target.closest(".sl-sheet-go");if(f)if(p.stopPropagation(),f.dataset.act==="checkout")this.handleCta();else if(f.dataset.act==="best"){var v;this.baReopen=!0,this.baQty=Math.max(1,Math.min(this.baQty,this.maxTickets-this.totalTicketCount())),this.syncTray(),c(!0),(v=this.els.tray)===null||v===void 0||(v=v.querySelector(".sl-ba-go"))===null||v===void 0||v.focus()}else c(!0)});let d=0,u=!1,h=!1;o.addEventListener("pointerdown",p=>{var f,v,m;if(!((f=(v=p.target).closest)===null||f===void 0)&&f.call(v,".sl-seccard,.sl-sheet-toggle,.sl-sheet-go")){h=!1;return}h=!0,u=!1,d=p.clientY,(m=o.setPointerCapture)===null||m===void 0||m.call(o,p.pointerId)}),o.addEventListener("pointermove",p=>{if(!h||u)return;const f=p.clientY-d;f<-18?(c(!0),u=!0):f>18&&(c(!1),u=!0)}),o.addEventListener("pointerup",p=>{var f;h&&!u&&Math.abs(p.clientY-d)<6&&c(e.dataset.sheet!=="open"),h=!1,(f=o.releasePointerCapture)===null||f===void 0||f.call(o,p.pointerId)})}const r=()=>{var l,c;if(((l=this.root)===null||l===void 0?void 0:l.dataset.layout)!=="narrow")return;const d=this.root.getAttribute("data-prices-open")==="true";if(this.root.setAttribute("data-prices-open",String(!d)),(c=this.els.pricesSec)===null||c===void 0||c.setAttribute("aria-expanded",String(!d)),!d&&this.root.dataset.sheet!=="open"){this.root.dataset.sheet="open";const u=this.els.sheetToggle;u==null||u.setAttribute("aria-expanded","true"),u==null||u.setAttribute("aria-label","Collapse ticket panel")}};(i=this.els.pricesSec)===null||i===void 0||i.addEventListener("click",l=>{l.target.closest("select,button")||r()}),(s=this.els.pricesSec)===null||s===void 0||s.addEventListener("keydown",l=>{l.key!=="Enter"&&l.key!==" "||l.target.closest("select,button")||(l.preventDefault(),r())}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("mousemove",l=>{const c=this.els.map.getBoundingClientRect();this.tipPos={x:l.clientX-c.left,y:l.clientY-c.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.handleCta()}),(n=this.els.holdChange)===null||n===void 0||n.addEventListener("click",()=>{this.handleChangeSeats()})}observeLayout(e){const i=()=>{var s;const n=e.clientWidth;if(n<=0)return;const o=e.clientHeight,a=n!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:n,height:o},this.reportFramedHeight();const r=n<640?"narrow":"wide",l=o<560?"compact":"comfortable";(e.dataset.layout!==r||e.dataset.density!==l)&&(e.dataset.layout=r,e.dataset.density=l,r==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome()),a&&((s=this.minimap)===null||s===void 0||s.refreshMinimap())};this.ro=new ResizeObserver(i),this.ro.observe(e),i(),requestAnimationFrame(i)}async loadChart(e,i,s){const n=performance.now(),o=await this.controller.render(e);return i.loadChartAndStatuses=s(n),this.destroyed?null:o?(Object.assign(i,o.performanceProfile),o):(this.els.boot.innerHTML=`
${this.tf("picker.mapDidNotLoad","The seat map didn’t load")}
${this.tf("picker.checkConnection","Check your connection and try again.")}
`,this.els.boot.querySelector("button").addEventListener("click",()=>{const a=this.opts.container,r=this.opts;this.destroy(),new xo({...r,container:a}).render()}),null)}resumeHostedOrder(){if(this.checkoutMode!=="hosted"||typeof location=="undefined")return;const e=new URLSearchParams(location.search),i=e.get("order");if(!i)return;const s=e.get("status");e.delete("order"),e.delete("status");try{const n=e.toString();history.replaceState(history.state,"",`${location.pathname}${n?`?${n}`:""}${location.hash}`)}catch{}s==="success"&&this.openCheckoutPanel({kind:"resume",orderId:i})}buildPanelToggle(){if(!this.regions["top-right"])return;const e=document.createElement("button");e.type="button",e.className="sl-side-toggle",e.addEventListener("click",()=>this.setPanelCollapsed(!this.sideCollapsed)),this.sideToggleEl=e,this.regions["top-right"].appendChild(e),this.syncPanelToggle()}syncPanelToggle(){const e=this.sideToggleEl;if(!e)return;const i=this.sideCollapsed;e.setAttribute("aria-expanded",String(!i)),e.setAttribute("aria-label",i?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=i?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=i?`${this.tf("picker.tickets","Tickets")}`:''}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){var e,i,s;const n=((e=this.root)===null||e===void 0?void 0:e.dataset.layout)!=="narrow";(i=this.root)===null||i===void 0||i.setAttribute("data-side-collapsed",String(this.sideCollapsed)),(s=this.els.side)===null||s===void 0||s.toggleAttribute("inert",this.sideCollapsed&&n),this.syncPanelToggle()}dockLayoutChrome(){var e,i,s;const n=((e=this.root)===null||e===void 0?void 0:e.dataset.layout)==="narrow";this.applyPanelCollapsed();const o=this.els.zfs,a=(i=this.els.headInfo)===null||i===void 0?void 0:i.parentElement;if(o&&a&&o.parentElement!==a){var r;o.classList.add("sl-fs-pill"),a.insertBefore(o,(r=this.els.hold)!==null&&r!==void 0?r:null)}const l=this.els.pricesSec;if(l)if(n){var c;l.setAttribute("role","button"),l.tabIndex=0,l.setAttribute("aria-expanded",String(((c=this.root)===null||c===void 0?void 0:c.getAttribute("data-prices-open"))==="true"))}else l.removeAttribute("role"),l.removeAttribute("aria-expanded"),l.tabIndex=-1;if(this.cbEl&&((s=this.els.zoom)===null||s===void 0||s.appendChild(this.cbEl)),this.a11yChipsEl){var d,u,h;n?(d=this.els.rail)===null||d===void 0||d.insertBefore(this.a11yChipsEl,(u=this.els.railScroll)!==null&&u!==void 0?u:null):(h=this.regions["top-left"])===null||h===void 0||h.appendChild(this.a11yChipsEl)}this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){var e;const i=document.createElement("div");i.className="sl-extend",i.setAttribute("role","status"),i.innerHTML='',((e=this.regions["bottom-center"])!==null&&e!==void 0?e:this.els.map).appendChild(i),this.extendEl=i,this.els.extendTxt=i.querySelector('[data-ref="extendTxt"]'),this.els.extendBtn=i.querySelector('[data-ref="extendBtn"]'),this.els.extendBtn.textContent=this.tf("picker.addTime","Add time"),this.els.extendBtn.addEventListener("click",()=>{this.handleExtend()})}buildBookedOverlay(){const e=document.createElement("div");e.className="sl-booked",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`
${this.tf("picker.allSetTitle","You're all set")}
`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]')}tf(e,i){return Q(e,i)}buildSoldoutOverlay(){var e,i,s,n,o,a;if(!this.els.map)return;const r=document.createElement("div");r.className="sl-soldout",r.setAttribute("role","status"),r.innerHTML=`
${((e=(i=(s=(n=this.controller.doc)===null||n===void 0||(n=n.theme)===null||n===void 0?void 0:n.brandName)!==null&&s!==void 0?s:(o=this.opts.theme)===null||o===void 0?void 0:o.brandName)!==null&&i!==void 0?i:(a=this.els.name)===null||a===void 0?void 0:a.textContent)!==null&&e!==void 0?e:this.tf("picker.soldOutEyebrow","This event")).toUpperCase()}
${this.tf("picker.soldOutTitle","Sold out")}

${this.tf("picker.soldOutCopy","No reserved seats are currently available for this event.")}

`,this.els.map.appendChild(r),this.soldoutEl=r}syncSoldout(e,i){var s;const n=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,i,n);o!==this.soldOut&&(this.soldOut=o,(s=this.soldoutEl)===null||s===void 0||s.classList.toggle("on",o))}isSoldOut(e,i,s){return!s&&e.length>0&&e.every(n=>{var o;return((o=i[n.key])!==null&&o!==void 0?o:0)===0})}setSalesClosed(e){const i=e||!!this.opts.readOnly;this.salesClosed!==i&&(this.salesClosed=i,this.applySalesClosed())}applySalesClosed(){var e;this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();const i=this.els.closedPill;if(i){var s;i.classList.toggle("on",this.salesClosed);const n=(s=this.els.closedPillText)!==null&&s!==void 0?s:i;n.textContent=this.tf("picker.salesClosedPill","Sales are closed")}(e=this.root)===null||e===void 0||e.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.tf("picker.salesClosedToast","Sales are closed for this event.")),this.syncCta(),this.syncTray()}badgeHidden(e){return!!(this.opts.hideBadge||e!=null&&e.hideBadge)}buildBadge(e){if(this.badgeHidden(e))return;const i=this.els.foot;if(!i)return;const s=document.createElement("a");s.className="sl-powered",s.href="https://seatlayer.io/?ref=picker",s.target="_blank",s.rel="noopener noreferrer",s.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer")),s.innerHTML='${this.tf("picker.poweredBy","Powered by SeatLayer")}`,i.appendChild(s)}buildRegions(){if(this.els.map)for(const e of["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"]){const i=document.createElement("div");i.className="sl-anchor",i.dataset.region=e,this.els.map.appendChild(i),this.regions[e]=i}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window!="undefined"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,i){const s=setTimeout(()=>{this.motionTimers.delete(s),this.destroyed||e()},i);this.motionTimers.add(s)}animateOnce(e,i,s=600){!e||this.reducedMotion()||(e.classList.remove(i),e.offsetWidth,e.classList.add(i),this.scheduleMotion(()=>e.classList.remove(i),s))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){var i;this.reducedMotion()||((i=e.items)!==null&&i!==void 0?i:[]).filter(s=>s.objectType!=="ga").map(s=>s.label).slice(0,10).forEach((s,n)=>{const o=this.controller.seatByLabel(s);o&&this.scheduleMotion(()=>this.controller.flashSeat(o.id,this.cssVar("--sl-accent")||"#f4b740"),n*55)})}committedSelection(){var e;const i=(e=this.confirmSeat)===null||e===void 0?void 0:e.id,s=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(n=>n.id!==i&&n.id!==s)}pendingSelectionCount(){var e,i;const s=(e=(i=this.hold)===null||i===void 0?void 0:i.items)!==null&&e!==void 0?e:[],n=new Set(s.map(o=>o.label));return this.committedSelection().filter(o=>!n.has(o.label)).reduce((o,a)=>{var r;return o+((r=a.quantity)!==null&&r!==void 0?r:1)},0)+this.pendingGACount()}heldGACounts(){var e,i;const s=new Map;for(const a of((e=(i=this.hold)===null||i===void 0?void 0:i.items)!==null&&e!==void 0?e:[]).filter(r=>r.objectType==="ga")){var n,o;s.set(a.objectId,((n=s.get(a.objectId))!==null&&n!==void 0?n:0)+((o=a.quantity)!==null&&o!==void 0?o:1))}return s}pendingGACount(){const e=this.heldGACounts();return[...this.gaQty.entries()].reduce((i,[s,n])=>{var o;return i+Math.max(0,n-((o=e.get(s))!==null&&o!==void 0?o:0))},0)}heldTicketCount(){var e,i;return((e=(i=this.hold)===null||i===void 0?void 0:i.items)!==null&&e!==void 0?e:[]).reduce((s,n)=>{var o;return s+((o=n.quantity)!==null&&o!==void 0?o:1)},0)}totalTicketCount(){var e,i;const s=new Set(((e=(i=this.hold)===null||i===void 0?void 0:i.items)!==null&&e!==void 0?e:[]).map(o=>o.label)),n=this.committedSelection().filter(o=>!s.has(o.label)).reduce((o,a)=>{var r;return o+((r=a.quantity)!==null&&r!==void 0?r:1)},0);return this.heldTicketCount()+n+this.pendingGACount()}updateSelectionCapacity(){var e,i;const s=new Set(((e=(i=this.hold)===null||i===void 0?void 0:i.items)!==null&&e!==void 0?e:[]).map(a=>a.label)),n=this.committedSelection().filter(a=>s.has(a.label)).reduce((a,r)=>{var l;return a+((l=r.quantity)!==null&&l!==void 0?l:1)},0),o=Math.max(0,this.maxTickets-this.heldTicketCount()-this.pendingGACount());this.controller.setMaxSelection(n+o)}canAddTicket(){return this.totalTicketCount()l.objectType==="ga")){var o,a;n.set(r.objectId,((o=n.get(r.objectId))!==null&&o!==void 0?o:0)+((a=r.quantity)!==null&&a!==void 0?a:1))}return e.reduce((r,l)=>{var c,d;return r+this.paidPrice(l.categoryKey,null,l.price,l.id)*Math.max(0,((c=this.gaQty.get(l.id))!==null&&c!==void 0?c:0)-((d=n.get(l.id))!==null&&d!==void 0?d:0))},0)}syncCta(e=this.lastTrayCount,i=this.pendingSelectionCount()){const s=this.els.cta;if(!s)return;if(this.salesClosed){s.disabled=!0,s.textContent=this.tf("picker.salesClosedCta","Sales closed");return}if(this.confirmSeat||this.tableDialog&&!this.tableDialogHeld){s.disabled=!0,s.textContent=this.tableDialog?this.tf("picker.confirmYourTable","Confirm your table"):this.tf("picker.confirmOrCancelSeat","Confirm or cancel this seat");return}if(this.ctaPhase==="holding"){s.disabled=!0,s.innerHTML=`${this.tf("picker.securingSeats","Securing your seats…")}`;return}if(this.ctaPhase==="checkout"){s.disabled=!0,s.innerHTML=`${this.tf("picker.openingCheckout","Opening secure checkout…")}`;return}const n=this.controller.getSelectionValidity(e);if(n&&!n.isValid){s.disabled=!0,s.textContent=ul(n,(o,a)=>this.tf(o,a),!0);return}s.disabled=e===0,s.textContent=this.hold?i?V("picker.secureMoreAndCheckout",{count:i}):this.tf("picker.continueToCheckout","Continue to checkout"):e?this.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):this.tf("picker.selectSeats","Select seats")}setCtaPhase(e){this.ctaPhase=e,this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount()),e==="checkout"&&this.scheduleMotion(()=>{this.ctaPhase==="checkout"&&(this.ctaPhase="idle",this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount()))},1100)}holdStorageKey(){return`@seatlayer/hold/v1/${encodeURIComponent(this.apiBase)}/${encodeURIComponent(this.opts.event)}`}rememberedHoldId(){if(this.opts.initialHoldId)return this.opts.initialHoldId;if(this.opts.restoreHold===!1||typeof window=="undefined")return null;try{return window.sessionStorage.getItem(this.holdStorageKey())}catch{return null}}rememberHold(e){if(!(this.opts.restoreHold===!1||typeof window=="undefined"))try{window.sessionStorage.setItem(this.holdStorageKey(),e.holdId)}catch{}}forgetHold(){if(typeof window!="undefined")try{window.sessionStorage.removeItem(this.holdStorageKey())}catch{}}async resumeHoldFromServer(e,i){try{var s,n,o;const l=await this.controller.resumeHold(e);if(!l)return null;const c={holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items};return this.hold=c,this.handedOff=!0,this.bookedShown=!1,this.ctaPhase="idle",this.startHoldTimer(c.expiresAt),this.rememberHold(c),this.syncTray(),this.emitHoldChange(),(s=(n=this.opts).onHoldRestored)===null||s===void 0||s.call(n,c,(o=c.seats)!==null&&o!==void 0?o:[],this.buildHandoff(c)),i&&this.toast(this.tf("picker.heldTicketsRestored","Your held tickets have been restored."),"success"),c}catch(l){const c=l==null?void 0:l.status;if(c===404||c===409)this.forgetHold();else{var a,r;(a=(r=this.opts).onError)===null||a===void 0||a.call(r,l)}return null}}async restoreRememberedHold(){const e=this.rememberedHoldId();e&&await this.resumeHoldFromServer(e,!0)}activeFloorObjects(){var e;const i=this.controller.doc;if(!i)return[];const s=i.floors;if(s!=null&&s.length){var n,o;const a=this.controller.getActiveFloorId();return(n=((o=s.find(r=>r.id===a))!==null&&o!==void 0?o:s[0]).objects)!==null&&n!==void 0?n:[]}return(e=i.objects)!==null&&e!==void 0?e:[]}buildMinimap(){var e;this.els.map&&(this.minimap=_v({controller:this.controller,root:()=>this.root,cssVar:i=>this.cssVar(i),focusedSectionLabel:()=>{var i;return(i=this.lastSection)===null||i===void 0?void 0:i.label}},(e=this.regions["bottom-left"])!==null&&e!==void 0?e:this.els.map))}catPrice(e){var i,s,n;const o=!((i=e.tiers)===null||i===void 0)&&i.length?e.tiers[0].price:e.price;return o===void 0||!e.key?o:this.paidPrice(e.key,(s=(n=e.tiers)===null||n===void 0||(n=n[0])===null||n===void 0?void 0:n.id)!==null&&s!==void 0?s:null,o)}catPriceRange(e){var i;const s=!((i=e.tiers)===null||i===void 0)&&i.length?e.tiers.map(n=>{var o;return this.paidPrice(e.key,(o=n.id)!==null&&o!==void 0?o:null,n.price)}):e.price==null?[]:[this.paidPrice(e.key,null,e.price)];if(e.key)for(const n of this.pricesByChannel.values())for(const o of n)o.categoryKey===e.key&&s.push(o.price);return s.length?{min:Math.min(...s),max:Math.max(...s)}:void 0}priceBands(){const e=this.controller.doc;if(!e)return[];const i=e.categories.map(r=>({key:r.key,range:this.catPriceRange(r)})).filter(r=>r.range!=null);if(!i.length)return[];const s=[...new Map(i.map(r=>[`${r.range.min}:${r.range.max}`,r.range])).values()].sort((r,l)=>r.min-l.min||r.max-l.max);if(s.length<=5)return s.map(r=>({id:`p${r.min}-${r.max}`,label:r.min===r.max?this.money(r.min):`${this.money(r.min)}–${this.money(r.max)}`,keys:i.filter(l=>l.range.min===r.min&&l.range.max===r.max).map(l=>l.key),min:r.min,max:r.max}));const n=[...i].sort((r,l)=>r.range.min-l.range.min||r.range.max-l.range.max),o=Math.ceil(n.length/4),a=[];for(let r=0;ru.range.min)),d=Math.max(...l.map(u=>u.range.max));a.push({id:`b${r}`,label:c===d?this.money(c):`${this.money(c)}–${this.money(d)}`,keys:l.map(u=>u.key),min:c,max:d})}return a}buildPriceFilter(){if(!this.els.prices||!this.els.pricesSec)return;const e=this.priceBands();if(e.length<2)return;const i=document.createElement("select");i.className="sl-price-select",i.setAttribute("aria-label",this.tf("picker.filterAndFocusByPrice","Filter and focus seats by price")),i.innerHTML=``+e.map(s=>``).join(""),this.els.pricesSec.appendChild(i),i.addEventListener("change",()=>{var s,n;const o=e.find(r=>r.id===i.value),a=(s=o==null?void 0:o.keys)!==null&&s!==void 0?s:null;this.focusedCatKey=null,this.priceBandKeys=a?new Set(a):null,this.controller.setCategoryFilter(a),this.controller.focusCategoryFilter(a),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),(n=this.minimap)===null||n===void 0||n.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)})}buildArenaChrome(){var e;const i=this.controller.doc;if(!i||!this.els.map)return;const s=i.objects.some(a=>a.type==="section")||((e=i.floors)!==null&&e!==void 0?e:[]).some(a=>a.objects.some(r=>r.type==="section"));if(this.canOffer3d()){const a=document.createElement("div");a.className="sl-projection",a.setAttribute("role","group"),a.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),a.innerHTML=``,a.querySelectorAll("button").forEach(r=>{r.addEventListener("click",()=>{this.setBuyerView(r.dataset.view)})}),this.regions["top-right"].appendChild(a),this.projectionEl=a,this.syncProjection()}if(s){var n,o;const a=[...i.objects,...((n=i.floors)!==null&&n!==void 0?n:[]).flatMap(h=>h.objects)],r=new Set(((o=i.zones)!==null&&o!==void 0?o:[]).map(h=>h.id)),l=a.some(h=>h.type==="section"&&typeof h.zone=="string"&&r.has(h.zone))?["zones","sections","seats"]:["sections","seats"],c=document.createElement("div");c.className="sl-rungs on",c.setAttribute("role","group"),c.setAttribute("aria-label",V("picker.zoomLevel"));const d={zones:V("picker.rungLabel.zones"),sections:V("picker.rungLabel.sections"),seats:V("picker.rungLabel.seats")},u={zones:V("picker.rungTip.zones"),sections:V("picker.rungTip.sections"),seats:V("picker.rungTip.seats")};c.innerHTML=l.map(h=>``).join(""),c.querySelectorAll("button").forEach(h=>{h.addEventListener("click",()=>{const p=h.dataset.rung;this.controller.setRung(p),p==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(c),this.rungsEl=c,this.syncRung()}if(this.controller.isMultiFloor()){const a=this.controller.getFloors(),r=document.createElement("div");r.className="sl-floors on";const l=document.createElement("select");l.setAttribute("aria-label",this.tf("picker.chooseLevel","Choose level"));const c=document.createElement("option");c.value="",c.textContent=this.tf("picker.allFloors","All floors"),l.appendChild(c);for(const h of a){const p=document.createElement("option");p.value=h.id,p.textContent=h.name,l.appendChild(p)}l.addEventListener("change",()=>{var h;l.value===""?this.controller.setFloorOverview(!0):this.controller.setFloor(l.value),this.showSectionCard(null),this.syncFloors(),this.syncRung(),(h=this.minimap)===null||h===void 0||h.refreshMinimap()}),r.appendChild(l);const d=document.createElement("button");d.type="button",d.className="sl-floor-info",d.textContent="i";const u=this.tf("picker.floorHelp","All floors shows the complete venue. Choose one level to inspect and select its seats.");d.setAttribute("aria-label",u),d.title=u,r.appendChild(d),this.regions["left-rail"].appendChild(r),this.floorsEl=r,this.syncFloors()}}syncRung(){var e;const i=this.controller.getRung(),s=i==="seats";this.root&&(this.root.dataset.zoomed=String(s)),(e=this.minimap)===null||e===void 0||e.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(n=>{const o=n.dataset.rung===i;n.classList.toggle("on",o),n.setAttribute("aria-pressed",String(o))})}syncProjection(){this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{const i=e.dataset.view===this.buyerView;e.classList.toggle("on",i),e.setAttribute("aria-pressed",String(i))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!bv()?!1:this.allSeats().length<=this.max3dSeats()}max3dSeats(){var e,i,s,n,o;const a=this.opts.max3DSeats;if(typeof a=="number"&&a>0)return a;const r=globalThis.navigator;return((e=r==null?void 0:r.hardwareConcurrency)!==null&&e!==void 0?e:8)<=4||((i=r==null?void 0:r.deviceMemory)!==null&&i!==void 0?i:8)<=4||(s=(n=(o=globalThis).matchMedia)===null||n===void 0?void 0:n.call(o,"(pointer: coarse)").matches)!==null&&s!==void 0&&s?ml/2:ml}syncFloors(){if(!this.floorsEl)return;const e=this.controller.getActiveFloorId(),i=this.controller.isFloorOverview(),s=this.floorsEl.querySelector("select");s&&(s.value=i?"":e)}showSectionCard(e){var i,s;if(this.lastSection=e,(i=this.secCardEl)===null||i===void 0||i.remove(),this.secCardEl=null,!e){var n;(n=this.minimap)===null||n===void 0||n.refreshMinimap();return}this.secCardCollapsed=this.controller.getRung()==="seats",this.secCardShownAt=Date.now(),this.renderSectionCard(e),(s=this.minimap)===null||s===void 0||s.refreshMinimap()}sectionNeighbours(e){const i=this.activeFloorObjects().filter(n=>n.type==="section"&&!this.controller.isSectionClosed(n.id)&&this.controller.getSectionSeatCount(n.id)>0);if(i.length<2)return null;const s=i.findIndex(n=>n.id===e);return s<0?null:{previous:i[(s-1+i.length)%i.length],next:i[(s+1)%i.length]}}wireSectionNavigation(e){e.querySelectorAll("[data-section-nav]").forEach(i=>{i.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();const n=i.dataset.sectionNav;n&&this.controller.focusSection(n)})})}renderSectionCard(e){var i,s;if(!this.els.map)return;(i=this.secCardEl)===null||i===void 0||i.remove();const n=e.categories.length?e.categories.map(f=>{var v;const m=(v=this.controller.doc)===null||v===void 0?void 0:v.categories.find(g=>g.key===f.key);return m?this.catPriceRange(m):{min:f.priceMin,max:f.priceMax}}).filter(f=>f!=null):[{min:e.priceMin,max:e.priceMax}],o=Math.min(...n.map(f=>f.min)),a=Math.max(...n.map(f=>f.max)),r=o===a?this.money(o):`${this.money(o)}–${this.money(a)}`,l=vt("picker.seatsLeftInSection",e.seatsLeft),c=``,d=Cv(this.sectionNeighbours(e.id)),u=document.createElement("div");if(((s=this.root)===null||s===void 0?void 0:s.dataset.layout)==="narrow")u.className="sl-seccard strip on",u.setAttribute("role","status"),u.setAttribute("aria-label",V("picker.sectionSummaryAria",{label:e.label})),u.innerHTML=`${e.label}${l}`+d+c,this.wireSectionNavigation(u),u.querySelector(".sl-seccard-x").addEventListener("click",()=>this.controller.overview()),this.els.map.appendChild(u);else if(this.secCardCollapsed){var h;u.className="sl-seccard mini on",u.setAttribute("role","button"),u.setAttribute("aria-label",V("picker.sectionSummaryAria",{label:e.label})),u.innerHTML=`${e.label}${l}`+d+c,this.wireSectionNavigation(u),u.addEventListener("click",f=>{f.target.closest(".sl-seccard-x")||(this.secCardCollapsed=!1,this.secCardShownAt=Date.now(),this.renderSectionCard(e))}),u.querySelector(".sl-seccard-x").addEventListener("click",()=>this.controller.overview()),((h=this.regions["top-center"])!==null&&h!==void 0?h:this.els.map).appendChild(u)}else{var p;u.className="sl-seccard on",u.setAttribute("role","dialog"),u.setAttribute("aria-label",V("picker.sectionSummaryAria",{label:e.label}));const f=e.categories.map(v=>{var m,g;const b=this.priceBandKeys!=null&&!this.priceBandKeys.has(v.key),y=(m=this.controller.doc)===null||m===void 0?void 0:m.categories.find(C=>C.key===v.key),k=y?this.catPriceRange(y):{min:v.priceMin,max:v.priceMax},w=k&&k.min!==k.max?`${this.money(k.min)}–${this.money(k.max)}`:this.money((g=k==null?void 0:k.min)!==null&&g!==void 0?g:v.price);return`${v.label} ${w}`}).join("");u.innerHTML=`
${e.label}`+(e.categories.length?`${r}`:"")+c+`
${e.zoneLabel?`${e.zoneLabel} · `:""}${l}
`+(e.entrance?`
${V("picker.entrance")} ${String(e.entrance).replace(/[&<>"]/g,v=>({"&":"&","<":"<",">":">",'"':"""})[v])}
`:"")+(f?`
${f}
`:"")+`
`+d+`${V("picker.tapSeatHint")}
`,this.wireSectionNavigation(u),u.querySelector(".sl-seccard-x").addEventListener("click",()=>this.controller.overview()),u.querySelector(".sl-seccard-overview").addEventListener("click",()=>this.controller.overview()),((p=this.regions["top-center"])!==null&&p!==void 0?p:this.els.map).appendChild(u)}this.secCardEl=u}collapseSectionCard(){var e;!this.secCardEl||this.secCardCollapsed||!this.lastSection||((e=this.root)===null||e===void 0?void 0:e.dataset.layout)!=="narrow"&&(this.secCardCollapsed=!0,this.renderSectionCard(this.lastSection))}sectionCardOnView(){var e;if(!(!this.secCardEl||this.secCardCollapsed||!this.lastSection)&&((e=this.root)===null||e===void 0?void 0:e.dataset.layout)!=="narrow"){if(this.controller.getRung()==="seats"){this.collapseSectionCard();return}if(Date.now()-this.secCardShownAt<1400){this.sectionCardCoverage()>.25&&this.collapseSectionCard();return}this.collapseSectionCard()}}sectionCardCoverage(){var e;const i=this.secCardEl,s=this.lastSection;if(!i||!s||!this.els.map)return 0;const n=(e=this.activeFloorObjects().find(m=>m.type==="section"&&m.id===s.id))===null||e===void 0?void 0:e.outline;if(!n||n.length<3)return 0;const o=n.map(m=>this.controller.worldToScreen(m)),a=o.map(m=>m.x),r=o.map(m=>m.y),l=Math.min(...a),c=Math.min(...r),d=Math.max(...a)-l,u=Math.max(...r)-c;if(d<=0||u<=0)return 0;const h=this.els.map.getBoundingClientRect(),p=i.getBoundingClientRect(),f=p.left-h.left,v=p.top-h.top;return Math.max(0,Math.min(f+p.width,l+d)-Math.max(f,l))*Math.max(0,Math.min(v+p.height,c+u)-Math.max(v,c))/(d*u)}announceSeat(e){var i,s,n,o,a,r,l,c,d;if(!this.srEl)return;if(!e){this.srEl.textContent="";return}const u=(i=this.controller.doc)===null||i===void 0?void 0:i.categories.find(w=>w.key===e.categoryKey),h=(s=this.controller.getStatus(e.id))!==null&&s!==void 0?s:"free",p=h==="free"?this.tf("picker.statusAvailable","available"):h==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),f=u?this.catPriceRange(u):void 0,v=f?f.min===f.max?this.money(f.min):`${this.money(f.min)}–${this.money(f.max)}`:void 0,m=this.controller.tableSelection(e.id),g=m!=null?m:this.controller.seatDetails(e.id),b=this.rowTypeWord(g),y=(n=(o=(a=g==null?void 0:g.rowLabel)!==null&&a!==void 0?a:g==null?void 0:g.displayLabel)!==null&&o!==void 0?o:e.displayLabel)!==null&&n!==void 0?n:e.label,k=m?`${b} ${y}, ${m.bookingMode==="variable"?V("picker.minToMaxGuests",{min:m.minOccupancy,max:m.maxOccupancy}):V("picker.capacityGuests",{count:m.capacity})}`:(g==null?void 0:g.objectType)==="booth"?`${b} ${y}`:(g==null?void 0:g.objectType)==="table"?`${b} ${y}, ${V("picker.seatNumberLower",{label:(r=g.seatNumber)!==null&&r!==void 0?r:e.label})}`:V("picker.seatLabel",{label:(l=(c=g==null?void 0:g.displayLabel)!==null&&c!==void 0?c:e.displayLabel)!==null&&l!==void 0?l:e.label});this.srEl.textContent=`${k}, ${(d=u==null?void 0:u.label)!==null&&d!==void 0?d:e.categoryKey}${v?`, ${v}`:""}, ${p}`}showTableDialog(e,i,s){var n,o,a,r;this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=i,this.tableDialogReturnFocus=s!=null?s:document.activeElement;const l=p=>String(p!=null?p:"").replace(/[&<>"']/g,f=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[f]),c=(n=this.controller.doc)===null||n===void 0?void 0:n.categories.find(p=>p.key===e.categoryKey),d=e.bookingMode==="variable",u=this.rowTypeWord(e),h=document.createElement("div");h.className="sl-table-scrim",h.innerHTML=``,this.root.appendChild(h),this.tableDialogEl=h,this.renderTableDialogState(),h.querySelectorAll("[data-table-step]").forEach(p=>{p.addEventListener("click",()=>{if(!this.tableDialog)return;const f=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(p.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:f},this.renderTableDialogState()})}),h.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),h.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),h.addEventListener("mousedown",p=>{p.target===h&&this.cancelTableDialog()}),h.addEventListener("keydown",p=>{if(p.key!=="Tab")return;const f=[...h.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!f.length)return;const v=f[0],m=f[f.length-1];p.shiftKey&&document.activeElement===v?(p.preventDefault(),m.focus()):!p.shiftKey&&document.activeElement===m&&(p.preventDefault(),v.focus())}),requestAnimationFrame(()=>{var p;return(p=h.querySelector(d?'[data-table-step="-1"]':".sl-table-confirm"))===null||p===void 0?void 0:p.focus()})}renderTableDialogState(){var e;const i=this.tableDialog,s=this.tableDialogEl;if(!i||!s)return;const n=s.querySelector("output[data-table-qty]");n&&(n.value=String(i.quantity));const o=s.querySelector("input[data-table-qty]");o&&(o.value=String(i.quantity)),s.querySelectorAll("[data-table-step]").forEach(l=>{l.disabled=Number(l.dataset.tableStep)<0?i.quantity<=i.minOccupancy:i.quantity>=i.maxOccupancy});const a=this.paidPrice(i.categoryKey,(e=i.tierId)!==null&&e!==void 0?e:null,i.price,i.label),r=s.querySelector("[data-table-total]");r&&(r.textContent=this.money(a*i.quantity))}async confirmTableDialog(){var e;const i=this.tableDialog,s=this.tableDialogHeld;if(!i)return;const n=(e=this.tableDialogEl)===null||e===void 0?void 0:e.querySelector(".sl-table-confirm");if(n&&(n.disabled=!0,n.textContent=s?this.tf("picker.updatingEllipsis","Updating…"):this.tf("picker.selectingEllipsis","Selecting…")),s){try{const r=await this.controller.replaceTableQuantity(i.label,i.quantity,this.opts.holdTtlMs);if(!r){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},this.startHoldTimer(r.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast(V("picker.tableUpdatedForGuests",{label:i.label,count:i.quantity}),"success")}catch(r){var o,a;(o=(a=this.opts).onError)===null||o===void 0||o.call(a,r),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(i.label,i.quantity)){n&&(n.disabled=!1,n.textContent=i.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){const e=this.tableDialog,i=this.tableDialogHeld;this.dismissTableDialog(),e&&!i&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){var i;const s=this.tableDialogReturnFocus;(i=this.tableDialogEl)===null||i===void 0||i.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>{var n;return(n=s!=null&&s.isConnected?s:this.root)===null||n===void 0?void 0:n.focus()})}showConfirm(e){var i,s,n,o,a,r,l,c,d,u,h,p,f,v,m,g,b,y,k,w,C,S,T,E,L,I,M,x,A,P,N;const W=(i=this.confirmSeat)===null||i===void 0?void 0:i.id;(s=this.confirmEl)===null||s===void 0||s.remove(),this.confirmEl=null,this.confirmSeat=e,(n=this.root)===null||n===void 0||n.setAttribute("data-confirming","true"),(o=this.els.side)===null||o===void 0||o.toggleAttribute("inert",!0),Object.values(this.regions).forEach(oe=>oe.toggleAttribute("inert",!0)),this.controller.setSelectionFocus(e.id),W&&W!==e.id&&this.controller.deselect([W]),this.tipEl&&(this.tipEl.style.display="none");const B=this.controller.seatDetails(e.id),z=(a=this.controller.doc)===null||a===void 0?void 0:a.categories.find(oe=>oe.key===e.categoryKey),j=(r=B==null?void 0:B.price)!==null&&r!==void 0?r:!(z==null||(l=z.tiers)===null||l===void 0)&&l.length?z.tiers[0].price:z==null?void 0:z.price,G=j!=null?this.paidPrice(e.categoryKey,(c=(d=B==null?void 0:B.tierId)!==null&&d!==void 0?d:z==null||(u=z.tiers)===null||u===void 0||(u=u[0])===null||u===void 0?void 0:u.id)!==null&&c!==void 0?c:null,j,e.label):void 0,D=oe=>String(oe!=null?oe:"—").replace(/[&<>"]/g,ge=>({"&":"&","<":"<",">":">",'"':"""})[ge]),F=[B!=null&&B.sectionLabel?`
${this.tf("picker.section","Section")}${D(B.sectionLabel)}
`:"",B!=null&&B.rowLabel||(B==null?void 0:B.objectType)==="booth"?`
${D(this.rowTypeWord(B))}${D((h=(p=(f=Di(B))!==null&&f!==void 0?f:B==null?void 0:B.displayLabel)!==null&&p!==void 0?p:e.displayLabel)!==null&&h!==void 0?h:e.label)}
`:"",(B==null?void 0:B.objectType)!=="booth"?`
${this.tf("picker.seat","Seat")}${D((v=(m=(g=B==null?void 0:B.seatNumber)!==null&&g!==void 0?g:B==null?void 0:B.displayLabel)!==null&&m!==void 0?m:e.displayLabel)!==null&&v!==void 0?v:e.label)}
`:""].filter(Boolean).join(""),_=(b=(y=B==null?void 0:B.tiers)!==null&&y!==void 0?y:z==null?void 0:z.tiers)!==null&&b!==void 0?b:[],U=(k=B==null?void 0:B.tierId)!==null&&k!==void 0?k:(w=_[0])===null||w===void 0?void 0:w.id,Y=oe=>{var ge;return((ge=oe.buyerMessage)===null||ge===void 0?void 0:ge.trim())||(oe.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)},ie=_.length>1?`
${this.tf("picker.ticketType","Ticket type")}`+_.map(oe=>{const ge=Y(oe);return``}).join("")+"
":_[0]&&Y(_[0])?`

${D(Y(_[0]))}

`:"",ae=this.buyerView==="venue3d",ne=document.createElement("div");ne.className="sl-confirm",ne.setAttribute("role","dialog"),ne.setAttribute("aria-label",V("picker.confirmSeatLabel",{label:e.label}));const ve=(C=z==null?void 0:z.color)!==null&&C!==void 0?C:"#6e7bff",Le=(S=al(ve,this.cssVar("--sl-surface")||"#1a2234",.76))!==null&&S!==void 0?S:ve;ne.style.setProperty("--sl-cat",ve),ne.style.setProperty("--sl-cat-ink",_s(Le,"#172033","#ffffff")),ne.innerHTML='
'+F+`
${D((E=(L=B==null?void 0:B.categoryLabel)!==null&&L!==void 0?L:z==null?void 0:z.label)!==null&&E!==void 0?E:e.categoryKey)}`+(G!=null?`${this.money(G)}`:"")+'
'+ie+Sv(B==null?void 0:B.wheelchairSpaceType)+xv(e.commercial)+(this.seatViewEnabled()&&this.buyerView!=="venue3d"?this.confirmThumbHtml(e):"")+(ae?`${Lv(e,`${(I=(M=B==null?void 0:B.displayLabel)!==null&&M!==void 0?M:e.displayLabel)!==null&&I!==void 0?I:e.label} · ${G==null?this.tf("picker.priceNotSupplied","Price not supplied"):this.money(G)}`,ae)}
${Tv(e,ae?this.view3dCompareSeatIds:null)}${hl(this.canOffer3d(),ae)}
`:hl(this.canOffer3d(),ae))+`
`,this.els.map.appendChild(ne),this.confirmEl=ne;const Ce=ne.querySelector(".sl-confirm-thumb");if(Ce&&e.viewUrl){var Ze,nt;const oe=(Ze=(nt=e.viewMeta)===null||nt===void 0?void 0:nt.previewUrl)!==null&&Ze!==void 0?Ze:e.viewUrl;this.buyerAssetUrls.resolve(oe).then(ge=>{ge&&ne.isConnected&&this.confirmEl===ne&&(Ce.src=ge)}).catch(ge=>{var Se,ke;return(Se=(ke=this.opts).onError)===null||Se===void 0?void 0:Se.call(ke,ge)})}this.reanchorConfirm(),(x=ne.querySelector(".sl-confirm-view"))===null||x===void 0||x.addEventListener("click",()=>{this.openSeatView(e)}),(A=ne.querySelector(".sl-confirm-confidence"))===null||A===void 0||A.addEventListener("click",oe=>{this.openSeatConfidencePassport(e,oe.currentTarget instanceof HTMLElement?oe.currentTarget:null)}),(P=ne.querySelector(".sl-confirm-compare"))===null||P===void 0||P.addEventListener("click",()=>this.saveView3dComparisonSeat(e)),ne.querySelectorAll("[data-confirm-tier]").forEach(oe=>{oe.addEventListener("click",()=>{const ge=oe.dataset.confirmTier,Se=_.find(We=>We.id===ge);if(!Se)return;this.controller.setSeatTier(e.id,Se.id),ne.querySelectorAll("[data-confirm-tier]").forEach(We=>{We.setAttribute("aria-pressed",String(We===oe))});const ke=ne.querySelector(".sl-confirm-price");ke&&(ke.textContent=this.money(this.paidPrice(e.categoryKey,Se.id,Se.price,e.label))),this.reanchorConfirm()})}),(N=ne.querySelector(".sl-confirm-3d"))===null||N===void 0||N.addEventListener("click",()=>{if(this.buyerView==="venue3d"){var oe;this.dismissConfirm(),(oe=this.view3dHandle)===null||oe===void 0||oe.flyToSeat(e.id)}else this.view3dReturnSeat=e,this.dismissConfirm(),this.enter3d(e.id)}),ne.querySelector(".sl-confirm-add").addEventListener("click",()=>this.commitConfirm()),ne.querySelector(".sl-confirm-cancel").addEventListener("click",()=>this.cancelConfirm()),requestAnimationFrame(()=>{var oe;return(oe=ne.querySelector(".sl-confirm-add"))===null||oe===void 0?void 0:oe.focus()})}reanchorConfirm(){var e,i;if(!this.confirmEl||!this.confirmSeat||((e=this.root)===null||e===void 0?void 0:e.dataset.view3d)==="on")return;const s=this.controller.worldToScreen({x:this.confirmSeat.x,y:this.confirmSeat.y});if(((i=this.root)===null||i===void 0?void 0:i.dataset.layout)==="narrow")return;const n=this.els.map.clientWidth,o=this.els.map.clientHeight,a=this.confirmEl.offsetWidth||276,r=this.confirmEl.offsetHeight||230,l=a/2+12,c=Math.max(l,Math.min(n-l,s.x)),d=s.y+r+24<=o,u=s.ys.toggleAttribute("inert",!1)),this.applyPanelCollapsed(),this.controller.setSelectionFocus(null)}commitConfirm(){this.confirmSeat&&(this.dismissConfirm(),this.collapseSectionCard(),this.syncTray(),this.syncSelectionTo3d())}cancelConfirm(){var e;const i=this.confirmSeat;i&&(this.controller.deselect([i.id]),this.confirmSeat&&this.dismissConfirm(),this.syncSelectionTo3d(),(e=this.root)===null||e===void 0||e.focus({preventScroll:!0}))}closeConfirm(){this.dismissConfirm()}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){if(!this.allSeatsCache){const e=this.controller.doc;this.allSeatsCache=e?Ye(e):[]}return this.allSeatsCache}async openSeatView(e){var i,s,n,o;if(!this.root||!this.seatViewEnabled())return;const a=++this.seatViewGen,r=this.controller.doc,l=this.controller.getActiveFloorId(),c=(i=(s=(n=e.focalPoint)!==null&&n!==void 0?n:r==null||(o=r.floors)===null||o===void 0||(o=o.find(M=>M.id===l))===null||o===void 0?void 0:o.focalPoint)!==null&&s!==void 0?s:r==null?void 0:r.focalPoint)!==null&&i!==void 0?i:{x:0,y:0};let d,u,h=!1;if(e.viewUrl){var p,f,v,m,g,b,y,k;let M,x=null;try{var w;const P=(w=e.viewMeta)===null||w===void 0?void 0:w.previewUrl;P&&P!==e.viewUrl?(x=await this.buyerAssetUrls.resolve(P),M=e.viewUrl):M=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(P){var C,S;a===this.seatViewGen&&((C=(S=this.opts).onError)===null||C===void 0||C.call(S,P));return}if(a!==this.seatViewGen||!M||!((p=e.viewMeta)===null||p===void 0)&&p.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!x||!this.root||!this.seatViewEnabled())return;const A={url:M,...x?{previewUrl:x}:{},...((f=e.viewMeta)===null||f===void 0?void 0:f.sourceWidth)!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...((v=e.viewMeta)===null||v===void 0?void 0:v.sourceHeight)!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...((m=e.viewMeta)===null||m===void 0?void 0:m.previewWidth)!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...((g=e.viewMeta)===null||g===void 0?void 0:g.previewHeight)!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...!((b=e.viewMeta)===null||b===void 0)&&b.coverage?{coverage:e.viewMeta.coverage}:{},...!((y=e.viewMeta)===null||y===void 0)&&y.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...!((k=e.viewMeta)===null||k===void 0)&&k.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};d=A,u=Qr(A),h=Qf(A)}else{let M;try{const{generateSeatPanorama:x}=await yv();M=x(e,c,this.allSeats())}catch(x){var T,E;a===this.seatViewGen&&((T=(E=this.opts).onError)===null||T===void 0||T.call(E,x));return}if(a!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;d={url:M.url,generated:!0},u=V("picker.illustrationCaption",{m:M.distanceM})}this.closeSeatView(!1);const L=V("picker.viewFromSeat",{label:e.label}),I=mv({root:this.root,source:d,caption:u,real:h,closeLabel:this.tf("picker.close","Close"),dragHint:this.tf("picker.dragToLookAround","Drag to look around · scroll to zoom"),viewFromSeatLabel:L,real360Label:V("picker.real360"),previewLabel:V("picker.preview"),resolveAsset:M=>this.buyerAssetUrls.resolve(M),onClose:()=>this.closeSeatView()});this.viewEl=I.element,this.viewCleanup=()=>I.dispose()}closeSeatView(e=!0){var i,s;e&&(this.seatViewGen+=1),(i=this.viewCleanup)===null||i===void 0||i.call(this),this.viewCleanup=null,(s=this.viewEl)===null||s===void 0||s.remove(),this.viewEl=null}money(e){var i;const s=(i=this.opts.pricing)===null||i===void 0?void 0:i.formatter;return s?s(e,this.currency):gs(e,this.currency,{locale:this.opts.locale,fallback:(n,o)=>`${n} ${o}`})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;const i=Date.now(),s=hv(e,i);if(s==null)return;const n=Math.min(Math.max(s-i+1e3,1e3),6*36e5);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},n)}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}async refreshOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{var i,s,n,o,a,r;const l=await this.api.availability(this.opts.event,e);if(this.destroyed)return;const c=il(l);if(!c)return;this.offerAvailability=c,this.applyChannelPricing(c.channelPricing),this.scheduleOfferBoundary(c);const d=sl(c),u={...(i=(s=this.hostPricing)===null||s===void 0?void 0:s.prices)!==null&&i!==void 0?i:{},...d},h=Object.keys(u).length>0||!((n=this.hostPricing)===null||n===void 0)&&n.formatter?{prices:u,...!((o=this.hostPricing)===null||o===void 0)&&o.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(h),this.syncOffer(),(a=(r=this.opts).onOfferAvailabilityChange)===null||a===void 0||a.call(r,c)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e){var i,s;return e&&(i=(s=this.offerAvailability)===null||s===void 0?void 0:s.prices.find(n=>n.categoryKey===e))!==null&&i!==void 0?i:null}applyChannelPricing(e){var i,s;this.channelByObject.clear(),this.pricesByChannel.clear();for(const n of(i=e==null?void 0:e.channels)!==null&&i!==void 0?i:[])this.pricesByChannel.set(n.channelId,n.priceOverrides);for(const n of(s=e==null?void 0:e.objects)!==null&&s!==void 0?s:[])this.pricesByChannel.has(n.channelId)&&this.channelByObject.set(n.label,n.channelId)}syncOffer(){var e,i,s;const n=this.els.offer;if(!n)return;const o=this.offerAvailability,a=(e=o==null?void 0:o.release)!==null&&e!==void 0?e:null,r=a?null:(i=o==null?void 0:o.upcoming)!==null&&i!==void 0?i:null;if(!o||o.state==="closed"||o.state==="sold-out"||!a&&!r){n.classList.remove("has"),n.replaceChildren();return}const l=a!=null?a:r,c=document.createElement("div");c.className="sl-offer-main";const d=document.createElement("div");d.className="sl-offer-copy";const u=document.createElement("span");u.className="sl-offer-kicker",u.textContent=a?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");const h=document.createElement("strong");h.className="sl-offer-name",h.textContent=l.name||(a?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));const p=document.createElement("span");p.className="sl-offer-line";const f=[];a&&o.fromPrice!=null&&f.push(this.money(o.fromPrice/100)),a&&l.remaining!=null&&f.push(V("picker.offerRemainingAvailable",{count:l.remaining})),a&&l.endsAt!=null&&f.push(V("picker.offerUntil",{time:Qn(l.endsAt,this.eventTimezone,this.opts.locale)})),(r==null?void 0:r.startsAt)!=null&&f.push(V("picker.offerStarts",{time:Qn(r.startsAt,this.eventTimezone,this.opts.locale)})),p.textContent=f.join(" · "),d.append(u,h,p);const v=document.createElement("details");v.className="sl-offer-info";const m=document.createElement("summary");m.setAttribute("aria-label",V("picker.howOfferWorks",{name:(s=h.textContent)!==null&&s!==void 0?s:""})),m.textContent="i";const g=document.createElement("div");g.className="sl-offer-detail",g.textContent=a?this.tf("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."):this.tf("picker.offerDetailUpcoming","Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts."),v.append(m,g),c.append(d,v),n.replaceChildren(c),n.classList.add("has")}paidPrice(e,i,s,n){var o,a,r;const l=n?this.channelByObject.get(n):void 0;if(l&&e){var c;const u=(c=this.pricesByChannel.get(l))===null||c===void 0?void 0:c.find(h=>h.categoryKey===e&&h.tierId===(i!=null?i:null));if(u)return u.price}const d=e?(o=this.opts.pricing)===null||o===void 0||(o=o.prices)===null||o===void 0?void 0:o[e]:void 0;return d===void 0?s:typeof d=="number"?d:i&&((a=d.tiers)===null||a===void 0?void 0:a[i])!==void 0?d.tiers[i]:(r=d.base)!==null&&r!==void 0?r:s}legendDeps(){return{colorOf:e=>{var i,s,n;return(i=(s=this.controller.getRenderer())===null||s===void 0||(n=s.categoryDisplayColor)===null||n===void 0?void 0:n.call(s,e.key))!==null&&i!==void 0?i:e.color},rangeOf:e=>this.catPriceRange(e),priceOf:e=>this.catPrice(e),offerOf:e=>this.offerPrice(e),money:e=>this.money(e),esc:tt}}syncPriceRail(e,i){var s,n;const o=this.els.railScroll,a=e.length>1;(s=this.els.rail)===null||s===void 0||s.classList.toggle("has",a||!!(!((n=this.a11yChipsEl)===null||n===void 0)&&n.children.length)),o&&(o.innerHTML=a?nv({...this.legendDeps(),categories:e,left:i,activeKey:this.focusedCatKey,soldOutWord:this.tf("picker.soldOut","Sold out")}):"",o.querySelectorAll(".sl-rc").forEach(r=>{r.addEventListener("click",()=>{var l;return this.focusCategory((l=r.dataset.cat)!==null&&l!==void 0?l:"")})}))}syncPrices(){var e;const i=this.controller.doc;if(!i||!this.els.prices)return;const s=this.controller.categoryAvailability(),n=i.categories.filter(c=>!c.notForSale);this.narrateAvailability(n,s),this.syncSoldout(n,s),this.syncPriceRail(n,s);const o=5,a=n.length-o,r=a>1&&!this.pricesExpanded,l=r?n.slice(0,o):n;this.els.prices.classList.toggle("sl-expanded",a>1&&this.pricesExpanded),this.els.prices.innerHTML=tv({...this.legendDeps(),categories:l,left:s,collapsed:r,activeKey:this.focusedCatKey,bandKeys:this.priceBandKeys,leftCount:c=>vt("picker.leftCount",c),titleFor:(c,d)=>d?this.tf("picker.showAllSeats","Show all seats"):V("picker.showLabelSeatsOnMap",{label:c.label}),moreLabel:a>1?r?V("picker.showAllTicketTypes",{count:n.length}):this.tf("picker.showFewer","Show fewer"):null,status:{legend:this.tf("picker.seatStatusLegend","Seat status legend"),held:this.tf("picker.temporarilyHeld","Temporarily held"),sold:this.tf("picker.sold","Sold")}}),this.els.prices.querySelectorAll(".sl-price-row").forEach(c=>{c.addEventListener("mouseenter",()=>{var u,h,p;return(u=this.controller.getRenderer())===null||u===void 0||(h=u.setCategoryHighlight)===null||h===void 0?void 0:h.call(u,(p=c.dataset.cat)!==null&&p!==void 0?p:null)}),c.addEventListener("mouseleave",()=>{var u,h;return(u=this.controller.getRenderer())===null||u===void 0||(h=u.setCategoryHighlight)===null||h===void 0?void 0:h.call(u,null)});const d=()=>{var u;return this.focusCategory((u=c.dataset.cat)!==null&&u!==void 0?u:"")};c.addEventListener("click",d),c.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),d())})}),(e=this.els.prices.querySelector(".sl-price-more"))===null||e===void 0||e.addEventListener("click",()=>{this.pricesExpanded=!this.pricesExpanded,this.syncPrices()})}focusCategory(e){var i,s;if(!e)return;const n=this.focusedCatKey===e?null:e;this.focusedCatKey=n,this.priceBandKeys=n?new Set([n]):null;const o=(i=this.els.pricesSec)===null||i===void 0?void 0:i.querySelector(".sl-price-select");o&&(o.value="all"),this.controller.setCategoryFilter(n?[n]:null),this.controller.focusCategoryFilter(n?[n]:null),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),(s=this.minimap)===null||s===void 0||s.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)}narrateAvailability(e,i){const s=this.els.liveText,n=this.lastCatAvail;this.lastCatAvail={...i};const o=this.controller.getActiveFloorId();if(o!==this.lastAvailFloorId&&(this.lastAvailFloorId=o,this.availQuietUntil=performance.now()+2e3),!(!s||!n||performance.now()=u)){s.textContent=vt("picker.seatsJustTakenInCategory",u-h,{label:d.label,left:h}),(r=this.els.live)===null||r===void 0||r.classList.remove("on"),(l=this.els.live)===null||l===void 0||l.offsetWidth,(c=this.els.live)===null||c===void 0||c.classList.add("on"),this.liveTimer&&clearTimeout(this.liveTimer),this.liveTimer=setTimeout(()=>{var p;return(p=this.els.live)===null||p===void 0?void 0:p.classList.remove("on")},8e3);return}}}evictTakenSelections(){var e,i;const s=new Set([...(e=(i=this.controller.currentHold())===null||i===void 0?void 0:i.labels)!==null&&e!==void 0?e:[],...this.holdingLabels]),n=this.controller.getSelection().filter(o=>{var a;return!s.has(o.label)&&((a=this.controller.getStatus(o.id))!==null&&a!==void 0?a:"free")!=="free"});n.length&&(this.controller.deselect(n.map(o=>o.id)),this.toast(V("picker.seatJustTakenByAnother",{label:n[0].label}),"error"))}syncTray(){var e,i,s,n,o,a,r,l,c,d,u,h,p,f,v;if(!this.els.tray)return;this.updateSelectionCapacity();const m=this.committedSelection(),g=this.controller.getGAAreas(),b=(e=(i=this.hold)===null||i===void 0?void 0:i.items)!==null&&e!==void 0?e:[],y=[],k=new Set;if(this.salesClosed&&!m.length&&!b.length){const $=this.eventWhenText?`${String(this.eventWhenText).replace(/[&<>"]/g,J=>({"&":"&","<":"<",">":">",'"':"""})[J])}`:"";y.push(`
${this.tf("picker.salesClosedPill","Sales are closed")}${this.tf("picker.salesClosedCopy","Ticket sales for this event have ended.")}${$}
`)}else!m.length&&!b.length&&!g.length?y.push(`
${this.tf("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}
`):!m.length&&!b.length&&y.push(`
${this.tf("picker.trayHintTapOrStanding","Tap a seat on the map — or grab standing tickets below.")}
`);const w=!m.length&&!b.length&&!this.pendingGACount();if(w&&(this.baReopen=!1),!this.salesClosed&&!this.hold&&(w||this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm)){var C,S;const $=((C=(S=this.controller.doc)===null||S===void 0?void 0:S.categories)!==null&&C!==void 0?C:[]).filter(ee=>!ee.notForSale),J=this.controller.getBestAvailableZones();this.baZone&&!J.some(ee=>ee.id===this.baZone)&&(this.baZone=""),y.push(this.bestAvailableConfirm?``:`
${this.tf("picker.findBestSeatsTogether","Find the best seats together")}
${this.tf("picker.willChooseClosestGroup","We’ll choose the closest available group for you.")}${this.tf("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")}
`+(this.controller.hasPremiumSeats()?``:"")+($.length>1?`":'')+(J.length?`":"")+`
${this.baQty}
"+(this.baReopen?``:"")+"
")}const T=($,J,ee,me=1,de,we)=>Bv({d:$?this.controller.seatDetails($):null,area:ee==="ga"?g.find(be=>be.id===de):void 0,label:J,objectType:ee,quantity:me,identity:we}),E=zv;for(const $ of b){var L,I,M,x,A,P,N;const J=`held:${$.label}`;k.add(J);const ee=(L=this.controller.doc)===null||L===void 0?void 0:L.categories.find(De=>De.key===$.categoryKey),me=$.tierId?ee==null||(I=ee.tiers)===null||I===void 0||(I=I.find(De=>De.id===$.tierId))===null||I===void 0?void 0:I.name:void 0,de=$.objectType!=="ga"?this.controller.seatByLabel($.label):null,we=$.objectType==="table"?this.controller.tableSelection($.label):null,be=this.seatViewEnabled()&&!!de&&$.objectType!=="table";y.push(`
`+T((M=de==null?void 0:de.id)!==null&&M!==void 0?M:null,$.label,$.objectType,(x=$.quantity)!==null&&x!==void 0?x:1,$.objectId,we!=null?we:void 0)+`
${(A=ee==null?void 0:ee.label)!==null&&A!==void 0?A:$.categoryKey}${me?` · ${me}`:""}`+((we==null?void 0:we.bookingMode)==="variable"?``:"")+dl(de==null?void 0:de.wheelchairSpaceType)+cl(de==null?void 0:de.commercial)+`${this.money(this.paidPrice($.categoryKey,$.tierId,$.unitPrice,$.label)*((N=$.quantity)!==null&&N!==void 0?N:1))}
`+E(V("picker.removeHeldTicketLabel",{label:$.label}),be?$.label:null)+"
")}const W=new Set(b.map($=>$.label)),B=this.seatViewEnabled();for(const $ of m.filter(J=>!W.has(J.label))){var z,j,G,D,F,_,U,Y,ie,ae;const J=`seat:${$.id}`;k.add(J);const ee=(z=this.controller.doc)===null||z===void 0?void 0:z.categories.find(be=>be.key===$.categoryKey),me=$.tiers&&$.tiers.length?`":"",de=(j=(G=$.tiers)===null||G===void 0?void 0:G.find(be=>be.id===$.tierId))!==null&&j!==void 0?j:(D=$.tiers)===null||D===void 0?void 0:D[0],we=(de==null||(F=de.buyerMessage)===null||F===void 0?void 0:F.trim())||((de==null?void 0:de.restriction)==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):"");y.push(`
`+T($.id,$.label,$.objectType,(_=$.quantity)!==null&&_!==void 0?_:1,$.objectId,$)+`
${(U=ee==null?void 0:ee.label)!==null&&U!==void 0?U:$.categoryKey}`+($.objectType==="table"&&$.bookingMode==="variable"?``:"")+`${dl($.wheelchairSpaceType)}${cl($.commercial)}${me}${this.money(this.paidPrice($.categoryKey,(ie=$.tierId)!==null&&ie!==void 0?ie:null,$.price,$.label)*((ae=$.quantity)!==null&&ae!==void 0?ae:1))}
`+(we?`${tt(we)}`:"")+"
"+E(V("picker.removeSeatLabel",{label:$.label}),B&&$.objectType!=="table"?$.label:null)+"
")}for(const $ of g){var ne,ve,Le;const J=(ne=this.gaQty.get($.id))!==null&&ne!==void 0?ne:0;y.push(`
${(ve=$.displayLabel)!==null&&ve!==void 0?ve:$.label}
${(Le=$.displayType)!==null&&Le!==void 0?Le:this.tf("picker.generalAdmission","General admission")} · ${this.money(this.paidPrice($.categoryKey,null,$.price,$.id))} · ${vt("picker.leftCount",$.available)}
${J}
`)}!this.salesClosed&&!this.hold&&!w&&!this.baReopen&&!this.bestAvailableBusy&&!this.bestAvailableConfirm&&y.push(``),this.els.tray.innerHTML=y.join(""),this.lastTrayKeys=k,this.els.tray.querySelectorAll("[data-ba]").forEach($=>{$.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number($.dataset.ba))),this.syncTray()})}),(s=this.els.tray.querySelector("[data-ba-cat]"))===null||s===void 0||s.addEventListener("change",$=>{this.baCat=$.target.value}),(n=this.els.tray.querySelector("[data-ba-zone]"))===null||n===void 0||n.addEventListener("change",$=>{this.baZone=$.target.value}),(o=this.els.tray.querySelector("[data-ba-premium]"))===null||o===void 0||o.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),(a=this.els.tray.querySelector(".sl-ba-go"))===null||a===void 0||a.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){var $;this.bestAvailableConfirm=!0,this.syncTray(),($=this.els.tray.querySelector("[data-ba-replace]"))===null||$===void 0||$.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),(r=this.els.tray.querySelector("[data-ba-cancel]"))===null||r===void 0||r.addEventListener("click",()=>{var $;this.bestAvailableConfirm=!1,this.syncTray(),($=this.els.tray.querySelector(".sl-ba-go"))===null||$===void 0||$.focus()}),(l=this.els.tray.querySelector("[data-ba-reopen]"))===null||l===void 0||l.addEventListener("click",()=>{var $;this.baReopen=!0,this.syncTray(),($=this.els.tray.querySelector(".sl-ba-go"))===null||$===void 0||$.focus()}),(c=this.els.tray.querySelector("[data-ba-close]"))===null||c===void 0||c.addEventListener("click",()=>{var $;this.baReopen=!1,this.syncTray(),($=this.els.tray.querySelector("[data-ba-reopen]"))===null||$===void 0||$.focus()}),(d=this.els.tray.querySelector("[data-ba-replace]"))===null||d===void 0||d.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach($=>{$.addEventListener("click",()=>{var J,ee;const me=$.closest(".sl-chip");if(me.dataset.held){this.removeHeldLabel(decodeURIComponent(me.dataset.held),me);return}const de=me.dataset.seat,we=(J=(ee=this.controller.getSelection().find(De=>De.id===de))===null||ee===void 0?void 0:ee.label)!==null&&J!==void 0?J:this.tf("picker.seat","Seat"),be=()=>{this.controller.deselect([de]),this.toast(V("picker.labelRemoved",{label:we}),"neutral",{label:this.tf("picker.undo","Undo"),onClick:()=>{const De=this.controller.select([de]);this.toast(De.length?V("picker.labelRestored",{label:we}):V("picker.labelNoLongerAvailable",{label:we}),De.length?"success":"warning")}})};if(this.reducedMotion()){be();return}me.classList.add("sl-leave"),this.scheduleMotion(be,150)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach($=>{$.addEventListener("click",J=>{var ee,me;J.stopPropagation();const de=decodeURIComponent((ee=$.dataset.tableEdit)!==null&&ee!==void 0?ee:""),we=this.controller.tableSelection(de);if(!we)return;const be=b.find(De=>De.label===de&&De.objectType==="table");this.showTableDialog({...we,quantity:(me=be==null?void 0:be.quantity)!==null&&me!==void 0?me:we.quantity},!!be,$)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach($=>{$.addEventListener("change",()=>this.controller.setSeatTier($.dataset.tier,$.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach($=>{$.addEventListener("click",()=>{const J=this.controller.seatByLabel($.dataset.viewLabel);J&&this.openSeatView(J)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach($=>{const J=()=>this.controller.flashSeat($.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");$.addEventListener("mouseenter",J),$.addEventListener("focusin",J)}),this.els.tray.querySelectorAll(".sl-ga button").forEach($=>{$.addEventListener("click",()=>{var J,ee;const me=$.closest(".sl-ga").dataset.ga,de=g.find(De=>De.id===me),we=Number($.dataset.d);if(we>0&&!this.canAddTicket())return;const be=Math.max(0,Math.min((J=de==null?void 0:de.available)!==null&&J!==void 0?J:0,((ee=this.gaQty.get(me))!==null&&ee!==void 0?ee:0)+we));this.gaQty.set(me,be),this.syncTray()})}),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach($=>{$.disabled=!0});const Ce=this.pendingGATotal(g),Ze=this.pendingGACount(),nt=b.reduce(($,J)=>{var ee;return $+this.paidPrice(J.categoryKey,J.tierId,J.unitPrice,J.label)*((ee=J.quantity)!==null&&ee!==void 0?ee:1)},0),oe=b.reduce(($,J)=>{var ee;return $+((ee=J.quantity)!==null&&ee!==void 0?ee:1)},0),ge=m.filter($=>!W.has($.label)),Se=ge.reduce(($,J)=>{var ee,me;return $+this.paidPrice(J.categoryKey,(ee=J.tierId)!==null&&ee!==void 0?ee:null,J.price,J.label)*((me=J.quantity)!==null&&me!==void 0?me:1)},0)+Ce+nt,ke=ge.reduce(($,J)=>{var ee;return $+((ee=J.quantity)!==null&&ee!==void 0?ee:1)},0)+Ze+oe,We=this.pendingSelectionCount(),ue=this.lastTrayCount,ot=this.lastTrayTotal;if(this.els.count.textContent=ke?vt("picker.ticketsCount",ke):this.tf("picker.noSeatsSelected","No seats selected"),this.els.total.textContent=ke?this.money(Se):"",(u=this.root)===null||u===void 0||u.setAttribute("data-has-selection",String(ke>0)),(h=this.root)===null||h===void 0||h.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy||this.baReopen)),(p=this.els.foot)===null||p===void 0||p.classList.toggle("empty",ke===0),this.els.seatSummary&&(this.els.seatSummary.textContent=ke?vt("picker.seatsSelectedCount",ke):""),this.syncCta(ke,We),this.hold){var at;const $=oe||((at=this.hold.seats)===null||at===void 0?void 0:at.length)||0;this.els.holdTitle&&(this.els.holdTitle.textContent=V("picker.securedCount",{count:$})),this.els.holdCopy&&(this.holdCopyPending=We>0,this.els.holdCopy.textContent=We?V("picker.moreSelectedCount",{count:We}):fl(this.holdExpiresAt));const J=this.els.holdChange;J&&(J.disabled=this.releasingHold,J.textContent=this.releasingHold?this.tf("picker.releasingEllipsis","Releasing…"):this.tf("picker.change","Change"))}if(ke!==ue&&this.animateOnce(this.els.count,"sl-value-pop",380),Se!==ot&&this.animateOnce(this.els.total,"sl-value-pop",380),ue===0&&ke>0){var ko;this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&((ko=this.root)===null||ko===void 0?void 0:ko.dataset.layout)!=="narrow"&&this.setPanelCollapsed(!1)}this.renderPeek(ke,Se,We),this.lastTrayCount=ke,this.lastTrayTotal=Se,(f=(v=this.opts).onSelectionChange)===null||f===void 0||f.call(v,m),this.emitSelectionValidity(ke,m)}emitSelectionValidity(e,i){var s,n;const o=this.controller.getSelectionValidity(e);if(o){if(o.seats=i,(s=(n=this.opts).onSelectionValidityChange)===null||s===void 0||s.call(n,o),o.isValid){var a,r;this.lastSelectionValidity!==!0&&((a=(r=this.opts).onSelectionValid)===null||a===void 0||a.call(r,i))}else if(this.lastSelectionValidity!==!1){var l,c;(l=(c=this.opts).onSelectionInvalid)===null||l===void 0||l.call(c,o)}this.lastSelectionValidity=o.isValid}}renderPeek(e,i,s){var n,o;if(!this.els.peek)return;const a=((n=(o=this.controller.doc)===null||o===void 0?void 0:o.categories)!==null&&n!==void 0?n:[]).map(r=>this.catPrice(r)).filter(r=>r!=null);this.els.peek.innerHTML=Hv({count:e,total:i,pendingCount:s,ctaPhase:this.ctaPhase,hasHold:!!this.hold,salesClosed:this.salesClosed,fromPrice:a.length?Math.min(...a):null,addMore:Dv({salesClosed:this.salesClosed,hasHold:!!this.hold,ctaPhase:this.ctaPhase,formOpen:this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm,room:this.maxTickets-this.totalTicketCount(),wanted:this.baQty}),money:r=>this.money(r)})}async removeHeldLabel(e,i){if(!e||this.releasingLabels.has(e))return!1;this.releasingLabels.add(e),i==null||i.setAttribute("aria-busy","true");const s=i==null?void 0:i.querySelector(".rm");s&&(s.disabled=!0);try{const n=this.handedOff;if(!await this.controller.releaseLabels([e]))return this.toast(V("picker.couldNotRemoveLabel",{label:e}),"error"),!1;const o=this.controller.currentHold();return this.hold=o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null,this.handedOff=!!this.hold&&n,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),this.toast(V("picker.labelRemovedFromHold",{label:e}),"success"),!0}finally{this.releasingLabels.delete(e),i==null||i.removeAttribute("aria-busy"),s!=null&&s.isConnected&&(s.disabled=!1)}}async handleChangeSeats(){if(!this.hold||this.releasingHold)return;this.releasingHold=!0;const e=this.els.holdChange;e&&(e.disabled=!0,e.textContent=this.tf("picker.releasingEllipsis","Releasing…"));try{await this.release(),this.hold||this.toast(this.tf("picker.heldTicketsReleased","Held tickets released. Choose your new seats."),"success")}finally{this.releasingHold=!1,e!=null&&e.isConnected&&(e.disabled=!1,e.textContent=this.tf("picker.change","Change"))}}async handleCta(){if(this.salesClosed)return;const e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(ul(e,(l,c)=>this.tf(l,c)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast(V("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}const i=this.committedSelection();if(this.hold&&!i.some(l=>{var c;return!((c=this.hold.items)!==null&&c!==void 0?c:[]).some(d=>d.label===l.label)})){var s;const l=(s=this.hold.seats)!==null&&s!==void 0?s:i;this.handedOff=!0,this.setCtaPhase("checkout"),this.checkoutHandoff(this.hold,l);return}this.holdingLabels=new Set(i.map(l=>l.label)),this.setCtaPhase("holding");try{var n;let l=null;const c=[...this.gaQty.entries()].filter(([,u])=>u>0),d=this.committedSelection();if(d.length){const u=await this.controller.hold(void 0,this.opts.holdTtlMs);l=u?{holdId:u.holdId,expiresAt:u.expiresAt,seats:u.seats,items:u.items}:null}for(const[u,h]of c){const p=await this.controller.holdGA(u,h,{ttlMs:this.opts.holdTtlMs});l=p?{holdId:p.holdId,expiresAt:p.expiresAt,seats:p.seats,items:p.items}:l}if(!l){this.toast(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again."),"error"),this.setCtaPhase("idle"),this.syncTray();return}this.hold=l,this.handedOff=!0,this.startHoldTimer(l.expiresAt),this.flashHeldSeats(l),this.setCtaPhase("checkout"),this.emitHoldChange(),this.checkoutHandoff(l,(n=l.seats)!==null&&n!==void 0?n:d)}catch(l){var o,a,r;(o=(a=this.opts).onError)===null||o===void 0||o.call(a,l);const c=l,d=((r=c.conflicts)!==null&&r!==void 0?r:[]).map(h=>h.label).filter(Boolean).slice(0,3);c.reason==="event_closed"&&this.setSalesClosed(!0);const u=c.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):c.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):c.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):d.length?d.length===1?V("picker.labelsNoLongerAvailable.one",{labels:d.join(", ")}):V("picker.labelsNoLongerAvailable.other",{labels:d.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.toast(u,"error"),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){var i;this.stopHoldTimer(),this.holdExpiresAt=e,this.hold&&this.rememberHold(this.hold);const s=this.els.hold;s.innerHTML=`${this.tf("picker.held","Held")}`;const n=s.querySelector('[data-ref="holdTime"]');(i=this.els.holdNote)===null||i===void 0||i.classList.add("on");const o=()=>{const a=Math.max(0,this.holdExpiresAt-Date.now());n&&(n.textContent=pl(a)),!this.holdCopyPending&&this.els.holdCopy&&(this.els.holdCopy.textContent=fl(this.holdExpiresAt)),s.classList.add("on"),s.classList.toggle("is-expiring",a>0&&a<=vl),this.setExtendPrompt(a>0&&a<=vl,a),a<=0&&this.stopHoldTimer()};o(),this.holdTimer=setInterval(o,500)}stopHoldTimer(){var e,i;this.holdTimer&&clearInterval(this.holdTimer),this.holdTimer=null,(e=this.els.hold)===null||e===void 0||e.classList.remove("on","is-expiring"),(i=this.els.holdNote)===null||i===void 0||i.classList.remove("on"),this.setExtendPrompt(!1,0)}setExtendPrompt(e,i){if(this.extendEl)if(e&&this.controller.currentHold()&&!this.bookedShown){const s=Math.ceil(i/1e3),n=Math.floor(s/60),o=String(s%60).padStart(2,"0");this.els.extendTxt.innerHTML=V("picker.seatsHeldForNeedMoreTime",{time:`${n}:${o}`}),this.extendEl.classList.add("on")}else this.extendEl.classList.remove("on")}async handleExtend(){const e=this.els.extendBtn;e.disabled=!0;const i=e.textContent;e.textContent=this.tf("picker.addingEllipsis","Adding…");try{const a=await this.controller.extendHold(this.opts.holdTtlMs);if(a){var s;this.hold={holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items},this.holdExpiresAt=a.expiresAt,(s=this.extendEl)===null||s===void 0||s.classList.remove("on"),this.rememberHold(this.hold),this.emitHoldChange(),this.toast(this.tf("picker.moreTimeAdded","More time added — your seats are still held."),"success")}else this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time — please head to checkout now."),"warning")}catch(a){var n,o;(n=(o=this.opts).onError)===null||n===void 0||n.call(o,a),this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time — please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=i}}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&this.showBooked()}showBooked(){var e,i,s;if(this.bookedShown||!this.hold)return;this.bookedShown=!0;const n=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();const o=n.lineItems.reduce((a,r)=>a+r.quantity,0);this.els.bookedSub&&(this.els.bookedSub.innerHTML=`${vt("picker.ticketsCount",o)} ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),(e=this.bookedEl)===null||e===void 0||e.classList.add("on"),(i=(s=this.opts).onBooked)===null||i===void 0||i.call(s,n)}checkoutHandoff(e,i){var s,n;if(this.checkoutMode==="hosted"){this.startHostedCheckout(e,i);return}(s=(n=this.opts).onCheckout)===null||s===void 0||s.call(n,e,i,this.buildHandoff(e))}async startHostedCheckout(e,i){var s;const n=this.buildHandoff(e);let o=null;try{var a;o=await((a=this.paymentOptions)!==null&&a!==void 0?a:this.paymentOptions=this.pubApi.paymentOptions(this.opts.event))}catch(f){var r,l;(r=(l=this.opts).onError)===null||r===void 0||r.call(l,f)}if(this.destroyed)return;const c=o==null||(s=o.providers)===null||s===void 0?void 0:s[0];if(!c){var d,u,h,p;const f=wv(o==null?void 0:o.reason),v=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;(d=(u=this.opts).onCheckoutUnavailable)===null||d===void 0||d.call(u,{reason:f,handoff:n}),(h=(p=this.opts).onCheckout)===null||h===void 0||h.call(p,e,i,n),v||this.openCheckoutPanel({kind:"unavailable",reason:f,seatCount:n.lineItems.reduce((m,g)=>m+g.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:c,order:{holdId:n.holdId,expiresAt:n.expiresAt,currency:n.currency,total:n.total,labels:n.lineItems.map(f=>{var v;return(v=f.displayLabel)!==null&&v!==void 0?v:f.label})}})}async openCheckoutPanel(e){let i;try{({mountCheckout:i}=await kv())}catch(o){var s,n;(s=(n=this.opts).onError)===null||s===void 0||s.call(n,o),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held — please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=i({root:this.root,state:e,formatMoney:o=>this.money(o),startSession:o=>this.pubApi.startCheckout(this.opts.event,{...o,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:o=>this.pubApi.orderStatus(o),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:o=>{var a,r;(a=(r=this.opts).onOrderConfirmed)===null||a===void 0||a.call(r,o),this.controller.refresh()},onError:o=>{var a,r;return(a=(r=this.opts).onError)===null||a===void 0?void 0:a.call(r,o)}}))}closeCheckoutPanel(){var e;(e=this.checkoutPanel)===null||e===void 0||e.destroy(),this.checkoutPanel=null}buildHandoff(e){var i,s,n;const o=((i=e.items)!==null&&i!==void 0?i:[]).map(l=>{var c,d;const u=this.controller.lineItemDisplay(l);return{label:l.label,...u.displayLabel?{displayLabel:u.displayLabel}:{},...u.displayType?{displayType:u.displayType}:{},objectId:l.objectId,objectType:l.objectType,categoryKey:l.categoryKey,tierId:l.tierId,unitPrice:this.paidPrice(l.categoryKey,l.tierId,l.unitPrice,l.label),currency:(c=l.currency)!==null&&c!==void 0?c:this.currency,quantity:(d=l.quantity)!==null&&d!==void 0?d:1}}),a=(s=(n=o[0])===null||n===void 0?void 0:n.currency)!==null&&s!==void 0?s:this.currency,r=o.reduce((l,c)=>l+c.unitPrice*c.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:a,lineItems:o,total:r}}emitHoldChange(){var e,i,s;const n=this.hold;this.scheduleOfferRefresh(!0),(e=(i=this.opts).onHoldChange)===null||e===void 0||e.call(i,n,(s=n==null?void 0:n.seats)!==null&&s!==void 0?s:[],n?this.buildHandoff(n):null)}toast(e,i="neutral",s){const n=this.els.toast;if(!n)return;n.replaceChildren();const o=document.createElement("span");if(o.textContent=e,n.appendChild(o),n.classList.toggle("has-action",!!s),s){const a=document.createElement("button");a.type="button",a.className="sl-toast-action",a.textContent=s.label,a.addEventListener("click",s.onClick,{once:!0}),n.appendChild(a)}n.dataset.tone=i,n.classList.add("on"),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{n.classList.remove("on"),n.classList.remove("has-action"),n.dataset.tone="neutral"},4200)}placeTooltip(){if(!this.tipEl)return;const e=this.els.map.clientWidth,i=this.tipEl.offsetWidth,s=this.tipEl.offsetHeight;let n=this.tipPos.x+14,o=this.tipPos.y-s-12;n+i>e-8&&(n=this.tipPos.x-i-14),o<8&&(o=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,n)}px`,this.tipEl.style.top=`${Math.max(8,o)}px`}rowTypeWord(e){var i,s;const n=(e==null||(i=e.displayType)===null||i===void 0?void 0:i.trim())||(e==null||(s=e.rowType)===null||s===void 0?void 0:s.trim());return n||((e==null?void 0:e.objectType)==="table"?this.tf("picker.table","Table"):(e==null?void 0:e.objectType)==="booth"?this.tf("picker.booth","Booth"):this.tf("picker.row","Row"))}updateTooltip(e){var i,s,n,o,a,r;if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}const l=k=>String(k!=null?k:"—").replace(/[&<>"]/g,w=>({"&":"&","<":"<",">":">",'"':"""})[w]),c=this.money(this.paidPrice(e.categoryKey,(i=e.tierId)!==null&&i!==void 0?i:null,e.price,e.label)),d=e.objectType==="table"&&!!e.bookingMode,u=e.objectType==="booth",h=e.sectionLabel||e.rowLabel||e.seatNumber,p=d?`
${l(this.rowTypeWord(e))}${l((s=(n=e.rowLabel)!==null&&n!==void 0?n:e.displayLabel)!==null&&s!==void 0?s:e.label)}
${this.tf("picker.guests","Guests")}${e.bookingMode==="variable"?`${e.minOccupancy}–${e.maxOccupancy}`:e.capacity}
`:u?'
'+(e.sectionLabel?`
${this.tf("picker.section","Section")}${l(e.sectionLabel)}
`:"")+`
${l(this.rowTypeWord(e))}${l((o=(a=e.rowLabel)!==null&&a!==void 0?a:e.displayLabel)!==null&&o!==void 0?o:e.label)}
`:h?'
'+(e.sectionLabel?`
${this.tf("picker.section","Section")}${l(e.sectionLabel)}
`:"")+(e.rowLabel?`
${l(this.rowTypeWord(e))}${l(Di(e))}
`:"")+(e.seatNumber?`
${this.tf("picker.seat","Seat")}${l(e.seatNumber)}
`:"")+"
":`
${this.tf("picker.seat","Seat")}${l((r=e.displayLabel)!==null&&r!==void 0?r:e.label)}
`,f=e.status==="not_for_sale",v=e.status==="free"?"":`
${f?this.tf("picker.notAvailable","Not available"):e.status==="held"?V("map.statusHeld"):V("map.statusTaken")}
`,m=zi(e.commercial),g=m?`
${l(m)}
`:"",b=Ps(e.wheelchairSpaceType),y=b?`
${l(b)}
`:"";this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=p+`
${l(e.categoryLabel)}`+(f?"":`${c}`)+"
"+y+g+v,this.tipEl.style.display="block",this.placeTooltip()}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){var i;this.maxTickets=Math.max((i=this.exactTickets)!==null&&i!==void 0?i:1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){const e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){var i;this.destroyed||(this.opts.theme={...(i=this.opts.theme)!==null&&i!==void 0?i:{},map:e!=null?e:void 0},this.controller.setMapTheme(e))}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){var i,s;JSON.stringify((i=this.opts.pricing)!==null&&i!==void 0?i:null)!==JSON.stringify(e!=null?e:null)&&(this.opts.pricing=e,!(this.destroyed||!this.els.prices)&&((s=this.els.pricesSec)===null||s===void 0||(s=s.querySelector(".sl-price-select"))===null||s===void 0||s.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){var i;e!==this.cbSafe&&(this.cbSafe=e,(i=this.cbEl)===null||i===void 0||i.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),jv(e))}setViewMode(e){this.controller.setViewMode(this.normalizeInitialView(e)),this.syncProjection(),this.dismissConfirm()}getViewMode(){return this.controller.getViewMode()}normalizeInitialView(e){return e==="perspective"?(this.perspectiveWarned||(this.perspectiveWarned=!0,console.warn("[seatlayer] initialView:'perspective' (2.5D) is deprecated for the buyer picker and was coerced to 'flat'. Use the Map | 3D control for the immersive view.")),"flat"):e!=null?e:"flat"}getBuyerView(){return this.buyerView}setBuyerView(e,i){if(e==="map"){this.exit3d();return}const s=i==null?void 0:i.flyToSeatId;if(this.buyerView==="venue3d"){if(s){var n,o,a;(n=(o=this.opts).onBuyerViewChange)===null||n===void 0||n.call(o,{view:"venue3d",seatId:s}),(a=this.view3dHandle)===null||a===void 0||a.flyToSeat(s)}else if(i!=null&&i.resetView){var r;(r=this.view3dHandle)===null||r===void 0||r.focusOverview()}return}this.enter3d(s)}seatState3dFor(e){var i,s;switch(this.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return this.priceBandKeys!=null&&!this.priceBandKeys.has(e.categoryKey)||this.limitedViewFilter&&(!((i=e.commercial)===null||i===void 0)&&i.restrictedView||!((s=e.commercial)===null||s===void 0)&&s.obstructedView)?"dimmed":"available"}pushAvailabilityTo3d(){if(!this.view3dHandle)return;const e=this.allSeats().map(i=>({seatId:i.id,state:this.seatState3dFor(i)}));this.view3dHandle.setAvailability(e)}syncSelectionTo3d(){this.view3dHandle&&this.view3dHandle.setSelection(this.controller.getSelection().map(e=>e.id))}async seatViewFor3d(e){const i=this.allSeats().find(v=>v.id===e);if(!i)return null;if(i.viewUrl)try{var s,n,o,a,r,l,c,d,u,h;const v=(s=i.viewMeta)===null||s===void 0?void 0:s.previewUrl,m=!!v&&v!==i.viewUrl,g=m?await this.buyerAssetUrls.resolve(v):null,b=m?i.viewUrl:await this.buyerAssetUrls.resolve(i.viewUrl);return!b||m&&!g?null:{url:b,...g?{previewUrl:g}:{},...m?{resolveUrl:y=>this.buyerAssetUrls.resolve(y)}:{},...((n=i.viewMeta)===null||n===void 0?void 0:n.sourceWidth)!==void 0?{sourceWidth:i.viewMeta.sourceWidth}:{},...((o=i.viewMeta)===null||o===void 0?void 0:o.sourceHeight)!==void 0?{sourceHeight:i.viewMeta.sourceHeight}:{},...((a=i.viewMeta)===null||a===void 0?void 0:a.previewWidth)!==void 0?{previewWidth:i.viewMeta.previewWidth}:{},...((r=i.viewMeta)===null||r===void 0?void 0:r.previewHeight)!==void 0?{previewHeight:i.viewMeta.previewHeight}:{},...((l=i.viewMeta)===null||l===void 0?void 0:l.initialBearingDeg)!==void 0?{initialBearingDeg:i.viewMeta.initialBearingDeg}:{},...((c=i.viewMeta)===null||c===void 0?void 0:c.initialPitchDeg)!==void 0?{initialPitchDeg:i.viewMeta.initialPitchDeg}:{},...!((d=i.viewMeta)===null||d===void 0)&&d.coverage?{coverage:i.viewMeta.coverage}:{},...!((u=i.viewMeta)===null||u===void 0)&&u.capturedAt?{capturedAt:i.viewMeta.capturedAt}:{},...!((h=i.viewMeta)===null||h===void 0)&&h.sourceLabel?{sourceLabel:i.viewMeta.sourceLabel}:{}}}catch(v){var p,f;return(p=(f=this.opts).onError)===null||p===void 0||p.call(f,v),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:this.tf("picker.chartDerivedModel","Chart-derived model")}}emitAnalytics(e,i){try{var s,n;(s=(n=this.opts).onAnalytics)===null||s===void 0||s.call(n,e,{...i,surface:"buyer"})}catch{}}emit3dAnalytics(e,i){this.emitAnalytics(e,i)}onView3dSeatPick(e){var i,s;if(this.salesClosed){this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),this.syncSelectionTo3d();return}const n=this.allSeats().find(r=>r.id===e);if(!n)return;const o=this.controller.tableSelection(e);if(this.committedSelection().some(r=>o?r.label===o.label:r.id===e)){this.controller.deselect([e]),this.dismissConfirm(),this.syncSelectionTo3d();return}const a=this.controller.getStatus(n.id);if(a==="held"||a==="booked"||a==="not_for_sale"){this.showUnavailable3dSeat(n,this.seatState3dFor(n),a),this.syncSelectionTo3d();return}if(this.dismissUnavailable3dSeat(),!this.controller.select([e]).length){this.syncSelectionTo3d(),this.dismissConfirm();return}if((i=(s=this.opts).onBuyerViewChange)===null||i===void 0||i.call(s,{view:"venue3d",seatId:e}),this.flashPickedSeat(e),o){this.showTableDialog(o,!1),this.syncSelectionTo3d();return}this.opts.confirmSelection!==!1?this.showConfirm(n):this.syncTray(),this.syncSelectionTo3d()}showUnavailable3dSeat(e,i,s){var n,o;const a=this.view3dEl;if(!a)return;this.dismissUnavailable3dSeat();const r=this.controller.seatDetails(e.id),l=(n=(o=r==null?void 0:r.displayLabel)!==null&&o!==void 0?o:e.displayLabel)!==null&&n!==void 0?n:e.label,c=r==null?void 0:r.sectionLabel,d=Di(r),u=[c,d?V("picker.rowLabel",{label:d}):null,l].filter(Boolean).join(" · "),h=s==="held"?{title:this.tf("picker.temporarilyHeld","Temporarily held"),message:this.tf("picker.heldSeatExplanation","Another buyer is holding this seat. It may become available again.")}:s==="booked"?{title:this.tf("picker.sold","Sold"),message:this.tf("picker.soldSeatExplanation","This seat has already been booked.")}:{title:this.tf("picker.notForSale","Not for sale"),message:this.tf("picker.notForSaleExplanation","This seat is not included in the current sale.")},p=document.createElement("div");p.className="sl-view3d-unavailable",p.dataset.state=i,p.setAttribute("role","status"),p.setAttribute("aria-live","polite");const f=document.createElement("span");f.className="sl-view3d-unavailable-eyebrow",f.textContent=u||l;const v=document.createElement("strong");v.textContent=h.title;const m=document.createElement("div");m.className="sl-view3d-unavailable-copy",m.append(f,v);const g=document.createElement("button");g.type="button",g.setAttribute("aria-label",this.tf("picker.closeSeatStatus","Close seat status")),g.textContent="×";const b=document.createElement("p");b.textContent=h.message,p.append(m,g,b),g.addEventListener("click",()=>p.remove()),a.appendChild(p),this.announceSeat(e)}dismissUnavailable3dSeat(){var e;(e=this.view3dEl)===null||e===void 0||(e=e.querySelector(".sl-view3d-unavailable"))===null||e===void 0||e.remove()}saveView3dComparisonSeat(e){var i;if(this.buyerView!=="venue3d")return;const s=this.view3dCompareSeatIds;s.includes(e.id)||(this.view3dCompareSeatIds=s.length===0?[e.id]:[s[0],e.id]),((i=this.confirmSeat)===null||i===void 0?void 0:i.id)===e.id&&(this.controller.deselect([e.id]),this.dismissConfirm(),this.syncSelectionTo3d(),this.syncTray()),this.view3dCompareChip.sync(),this.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:this.view3dCompareSeatIds.length}),this.view3dCompareSeatIds.length>1?this.openView3dComparison():this.toast(this.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}clearView3dComparison(){this.closeView3dComparison(!1),this.view3dCompareSeatIds=[],this.view3dCompareChip.remove(),this.emit3dAnalytics("3d_comparison_cleared")}view3dComparisonSnapshot(e){var i,s,n,o,a,r,l,c,d,u,h,p,f,v,m,g,b;const y=this.allSeats().find(A=>A.id===e);if(!y)return null;const k=this.controller.seatDetails(y.id),w=(i=this.controller.doc)===null||i===void 0?void 0:i.categories.find(A=>A.key===y.categoryKey),C=(s=k==null?void 0:k.price)!==null&&s!==void 0?s:!(w==null||(n=w.tiers)===null||n===void 0)&&n.length?w.tiers[0].price:w==null?void 0:w.price,S=C!=null?this.paidPrice(y.categoryKey,(o=(a=k==null?void 0:k.tierId)!==null&&a!==void 0?a:w==null||(r=w.tiers)===null||r===void 0||(r=r[0])===null||r===void 0?void 0:r.id)!==null&&o!==void 0?o:null,C,y.label):void 0,T=this.controller.getStatus(y.id),E=T==="held"?this.tf("picker.temporarilyHeld","Temporarily held"):T==="booked"?this.tf("picker.sold","Sold"):T==="not_for_sale"?this.tf("picker.notForSale","Not for sale"):this.tf("picker.available","Available"),L=y.viewUrl?Qr({url:y.viewUrl,...!((l=y.viewMeta)===null||l===void 0)&&l.coverage?{coverage:y.viewMeta.coverage}:{},...!((c=y.viewMeta)===null||c===void 0)&&c.capturedAt?{capturedAt:y.viewMeta.capturedAt}:{},...!((d=y.viewMeta)===null||d===void 0)&&d.sourceLabel?{sourceLabel:y.viewMeta.sourceLabel}:{}}):this.tf("picker.chartDerivedSeatEye","Live 3D · chart-derived seat-eye · not surveyed"),I=zi(y.commercial)||this.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),M=k!=null&&k.wheelchairSpaceType?`${Ps(k.wheelchairSpaceType)} · metadata, not access certification`:this.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),x=Yn(y.confidenceEvidence);return{seat:y,label:(u=(h=k==null?void 0:k.displayLabel)!==null&&h!==void 0?h:y.displayLabel)!==null&&u!==void 0?u:y.label,section:(p=(f=k==null?void 0:k.sectionLabel)!==null&&f!==void 0?f:y.sectionId)!==null&&p!==void 0?p:"—",row:(v=(m=Di(k))!==null&&m!==void 0?m:k==null?void 0:k.rowLabel)!==null&&v!==void 0?v:"—",category:(g=(b=k==null?void 0:k.categoryLabel)!==null&&b!==void 0?b:w==null?void 0:w.label)!==null&&g!==void 0?g:y.categoryKey,price:S==null?this.tf("picker.priceNotSupplied","Not supplied"):this.money(S),availability:E,selectable:T==null||T==="free",viewSource:L,limited:I,accessibility:M,confidence:x}}openSeatConfidencePassport(e,i=null){var s,n,o,a,r,l,c,d,u;const h=this.view3dEl;if(!h)return;this.closeSeatConfidencePassport(!1);const p=Yn(e.confidenceEvidence),f=e.confidenceEvidence,v=this.controller.seatDetails(e.id),m=I=>it(I),g=p.limitations.length?`

Known limits

    ${p.limitations.map(I=>`
  • ${m(I)}
  • `).join("")}
`:"",b=p.modeledTarget?`
Modeled target
${m(p.modeledTarget)}
`:"",y=f?`
Evidence ID
${m(f.evidenceId)}
Model version
${m(f.modelVersion)}
Event configuration
${m((s=f.eventConfigurationId)!==null&&s!==void 0?s:"Not configuration-specific")}
Approval
${m((n=f.approvedByRole)!==null&&n!==void 0?n:"No external approval supplied")}
`+(f.validUntil?`
Valid until
${m(f.validUntil.slice(0,10))}
`:""):"
Evidence ID
None supplied
",k=`
View restriction
${m(zi(e.commercial)||this.tf("picker.noAuthoredRestriction","No organizer-authored restriction"))}
`+(!((o=e.commercial)===null||o===void 0)&&o.note?`
Organizer note
${m(e.commercial.note)}
`:""),w=document.createElement("div");w.className="sl-view3d-passport-shell",w.innerHTML=``;const C=[...new Set([...h.children,...[...this.els.map.children].filter(I=>I!==h)])].filter(I=>I instanceof HTMLElement),S=C.map(I=>({element:I,inert:I.inert,ariaHidden:I.getAttribute("aria-hidden")}));for(const I of C)I.inert=!0,I.setAttribute("aria-hidden","true");h.appendChild(w),h.classList.add("has-passport"),this.view3dPassportEl=w;const T=w.querySelector(".sl-view3d-passport"),E=()=>[...T.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],L=I=>{if(I.key==="Escape"){I.preventDefault(),I.stopPropagation(),I.stopImmediatePropagation(),this.closeSeatConfidencePassport();return}if(I.key!=="Tab")return;const M=E();if(!M.length)return;const x=M[0],A=M[M.length-1];I.shiftKey&&document.activeElement===x?(I.preventDefault(),A.focus()):!I.shiftKey&&document.activeElement===A&&(I.preventDefault(),x.focus())};window.addEventListener("keydown",L,!0),this.view3dPassportCleanup=()=>{var I,M,x,A,P,N,W,B,z;window.removeEventListener("keydown",L,!0);for(const F of S)F.element.inert=F.inert,F.ariaHidden===null?F.element.removeAttribute("aria-hidden"):F.element.setAttribute("aria-hidden",F.ariaHidden);const j=i!=null&&i.isConnected?i:(I=(M=(x=this.confirmEl)===null||x===void 0?void 0:x.querySelector(".sl-confirm-confidence"))!==null&&M!==void 0?M:(A=this.view3dCompareEl)===null||A===void 0?void 0:A.querySelector("[data-passport-seat]"))!==null&&I!==void 0?I:null,G=j==null?void 0:j.closest(".sl-confirm,.sl-view3d-compare");G!=null&&G.isConnected&&(G.inert=!1,G.removeAttribute("aria-hidden")),w.remove(),h.classList.remove("has-passport"),this.view3dPassportEl===w&&(this.view3dPassportEl=null);const D=(P=(N=j!=null?j:(W=this.view3dCompareEl)===null||W===void 0?void 0:W.querySelector("[data-passport-seat]"))!==null&&N!==void 0?N:(B=this.confirmEl)===null||B===void 0?void 0:B.querySelector(".sl-confirm-confidence"))!==null&&P!==void 0?P:this.view3dCompareChip.mainButton();(z=i!=null&&i.isConnected?i:D)===null||z===void 0||z.focus()},w.addEventListener("click",I=>{const M=I.target instanceof HTMLElement?I.target:null;(M!=null&&M.closest("[data-close]")||M!=null&&M.classList.contains("sl-view3d-passport-scrim"))&&this.closeSeatConfidencePassport()}),requestAnimationFrame(()=>{var I;return(I=E()[0])===null||I===void 0?void 0:I.focus()}),this.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:(l=f==null?void 0:f.evidenceId)!==null&&l!==void 0?l:null,eventConfigurationId:(c=f==null?void 0:f.eventConfigurationId)!==null&&c!==void 0?c:null,modelLevel:(d=f==null?void 0:f.modelLevel)!==null&&d!==void 0?d:"unverified",realityLevel:(u=f==null?void 0:f.realityLevel)!==null&&u!==void 0?u:"none"})}closeSeatConfidencePassport(e=!0){var i,s;const n=this.view3dPassportCleanup;if(this.view3dPassportCleanup=null,!n){var o,a;(o=this.view3dPassportEl)===null||o===void 0||o.remove(),this.view3dPassportEl=null,(a=this.view3dEl)===null||a===void 0||a.classList.remove("has-passport");return}e||(i=document.activeElement instanceof HTMLElement?document.activeElement:null)===null||i===void 0||i.blur(),n(),e||(s=this.root)===null||s===void 0||s.focus({preventScroll:!0})}openView3dComparison(){var e;const i=this.view3dEl;if(!i||this.view3dCompareSeatIds.length<2)return;this.closeView3dComparison(!1);const s=this.view3dCompareSeatIds.map(h=>this.view3dComparisonSnapshot(h)).filter(h=>!!h);if(s.length<2){this.clearView3dComparison();return}const n=h=>it(h),o=document.createElement("div");o.className="sl-view3d-compare-shell",o.innerHTML=``;const a=document.activeElement instanceof HTMLElement?document.activeElement:null,r=[...i.children].filter(h=>h instanceof HTMLElement),l=r.map(h=>({element:h,inert:h.inert,ariaHidden:h.getAttribute("aria-hidden")}));for(const h of r)h.inert=!0,h.setAttribute("aria-hidden","true");i.appendChild(o),i.classList.add("has-comparison"),this.view3dCompareEl=o;const c=o.querySelector(".sl-view3d-compare"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=h=>{if(h.key==="Escape"){h.preventDefault(),this.closeView3dComparison();return}if(h.key!=="Tab")return;const p=d();if(!p.length)return;const f=p[0],v=p[p.length-1];h.shiftKey&&document.activeElement===f?(h.preventDefault(),v.focus()):!h.shiftKey&&document.activeElement===v&&(h.preventDefault(),f.focus())};window.addEventListener("keydown",u),this.view3dCompareCleanup=()=>{var h;window.removeEventListener("keydown",u);for(const p of l)p.element.inert=p.inert,p.ariaHidden===null?p.element.removeAttribute("aria-hidden"):p.element.setAttribute("aria-hidden",p.ariaHidden);o.remove(),i.classList.remove("has-comparison"),this.view3dCompareEl===o&&(this.view3dCompareEl=null),a!=null&&a.isConnected?a.focus():(h=this.view3dCompareChip.mainButton())===null||h===void 0||h.focus()},(e=o.querySelector("[data-close]"))===null||e===void 0||e.addEventListener("click",()=>this.closeView3dComparison()),o.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{const p=h.dataset.passportSeat,f=p?this.allSeats().find(v=>v.id===p):void 0;f&&this.openSeatConfidencePassport(f,h)})),o.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{var p;const f=h.dataset.viewSeat;this.closeView3dComparison(!1),f&&((p=this.view3dHandle)===null||p===void 0||p.flyToSeat(f))})),o.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{const p=h.dataset.selectSeat;p&&this.selectComparedSeat(p)})),requestAnimationFrame(()=>{var h;return(h=d()[0])===null||h===void 0?void 0:h.focus()}),this.emit3dAnalytics("3d_comparison_opened",{seatIds:this.view3dCompareSeatIds.slice()})}closeView3dComparison(e=!0){var i;const s=this.view3dCompareCleanup;if(this.view3dCompareCleanup=null,!s){var n,o;(n=this.view3dCompareEl)===null||n===void 0||n.remove(),this.view3dCompareEl=null,(o=this.view3dEl)===null||o===void 0||o.classList.remove("has-comparison");return}if(!e){const a=document.activeElement instanceof HTMLElement?document.activeElement:null;a==null||a.blur()}s(),e||(i=this.root)===null||i===void 0||i.focus({preventScroll:!0})}selectComparedSeat(e){if(this.salesClosed){this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}const i=this.allSeats().find(s=>s.id===e);if(i){if(this.closeView3dComparison(!1),!this.controller.select([e]).length){this.syncSelectionTo3d(),this.toast(this.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}this.syncSelectionTo3d(),this.showConfirm(i),this.emit3dAnalytics("3d_comparison_selected",{seatId:e})}}async enter3d(e){var i,s,n;if(this.view3dEl||!this.canOffer3d()||!this.els.map)return;const o=this.controller.doc;if(!o)return;this.buyerView="venue3d",this.view3dTargetSeatId=null,(i=(s=this.opts).onBuyerViewChange)===null||i===void 0||i.call(s,{view:"venue3d",...e?{seatId:e}:{}}),(n=this.root)===null||n===void 0||n.setAttribute("data-view3d","on"),this.dismissConfirm(),this.syncProjection();const a=document.createElement("div");a.className="sl-view3d",a.setAttribute("role","group"),a.setAttribute("aria-label",this.tf("picker.interactive3dVenueView","Interactive 3D venue view"));const r=document.createElement("button");r.type="button",r.className="sl-view3d-back",r.innerHTML=`${this.tf("picker.backToMap","Back to map")}`;const l=r.querySelector("span"),c=v=>{this.view3dTargetSeatId=v;const m=!!v;a.classList.toggle("is-seat-focused",m);const g=m?this.tf("picker.backToVenue","Back to venue"):this.tf("picker.backToMap","Back to map");l&&(l.textContent=g),r.setAttribute("aria-label",g)};r.addEventListener("click",()=>{if(this.view3dTargetSeatId&&this.view3dHandle){this.view3dHandle.focusOverview();return}this.exit3d()}),a.appendChild(r);const d=document.createElement("button");d.type="button",d.className="sl-view3d-fs",d.textContent="⛶",d.setAttribute("aria-label",this.tf("picker.fullScreen","Full screen")),d.setAttribute("aria-pressed",String(!!document.fullscreenElement||this.fsFallback||this.framedFs)),d.addEventListener("click",()=>this.toggleFullscreen()),a.appendChild(d);const u=document.createElement("div");u.className="sl-view3d-loading",u.setAttribute("role","status"),u.setAttribute("aria-live","polite"),u.textContent=this.tf("picker.loading3d","Building the 3D venue…"),a.appendChild(u),this.els.map.appendChild(a),this.view3dEl=a,this.view3dCompareChip.sync(),requestAnimationFrame(()=>{a.style.opacity="1"});const h=++this.view3dGen;try{const v=Ye(o),m=await ll();if(h!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==a)return;const g=await m.prepareVenue3D({doc:o,seats:v});if(h!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==a)return;const b=m.mountVenue3D(a,{doc:o,seats:v,prepared:g},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,seatViewActionLabel:y=>{var k;return!((k=this.allSeats().find(w=>w.id===y))===null||k===void 0)&&k.viewUrl?this.tf("picker.openAuthored360","Open venue 360°"):this.tf("picker.lookAroundLive3d","Look around in live 3D")},onSeatPick:y=>this.onView3dSeatPick(y),onSeatInspect:y=>this.onView3dSeatPick(y),onSectionFocusChange:y=>{const k=a.querySelector('select[data-locator="section"]'),w=y!=null?y:"";!k||k.value===w||(k.value=w,k.dispatchEvent(new Event("change")))},onViewTargetChange:y=>{var k,w,C;(k=a.querySelector(".sl-view3d-nav"))===null||k===void 0||k.classList.toggle("is-seat-focused",!!y),c(y),(w=(C=this.opts).onBuyerViewChange)===null||w===void 0||w.call(C,{view:"venue3d",...y?{seatId:y}:{}})},getSeatView:y=>new Promise((k,w)=>{const C=()=>{this.seatViewFor3d(y).then(T=>{T?k(T):w(new Error("seat_view_unavailable"))})},S=globalThis.requestIdleCallback;typeof S=="function"?S(C,{timeout:1500}):setTimeout(C,50)}),onAnalytics:(y,k)=>this.emit3dAnalytics(y,k)});this.view3dHandle=b,u.remove(),this.pushAvailabilityTo3d(),this.syncSelectionTo3d(),$v(a,b),e&&b.flyToSeat(e)}catch(v){var p,f;if(h!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==a)return;(p=(f=this.opts).onError)===null||p===void 0||p.call(f,v),this.toast(this.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),this.exit3d()}}exit3d(){var e,i,s;if(this.buyerView!=="venue3d"&&!this.view3dEl)return;this.view3dGen++,this.buyerView="map",this.view3dTargetSeatId=null,(e=(i=this.opts).onBuyerViewChange)===null||e===void 0||e.call(i,{view:"map"}),(s=this.root)===null||s===void 0||s.removeAttribute("data-view3d"),this.closeSeatConfidencePassport(!1),this.closeView3dComparison(!1),this.view3dCompareChip.remove();try{var n;(n=this.view3dHandle)===null||n===void 0||n.dispose()}catch{}this.view3dHandle=null;const o=this.view3dEl;this.view3dEl=null,o&&(o.style.opacity="0",setTimeout(()=>o.remove(),320)),this.syncProjection();const a=this.view3dReturnSeat;this.view3dReturnSeat=null,a&&this.committedSelection().some(r=>r.id===a.id)&&this.opts.confirmSelection!==!1&&this.showConfirm(a)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e,!1)}async removeHeldTicket(e){return this.removeHeldLabel(e)}async bestAvailable(e,i,s={}){var n;if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e))),this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;const o=(n=this.els.tray)===null||n===void 0?void 0:n.querySelector(".sl-ba-go");o&&(o.disabled=!0,o.classList.add("sl-busy"),o.innerHTML=`${this.tf("picker.findingEllipsis","Finding…")}`);try{const l=await this.controller.bestAvailable(e,i,{...s,ttlMs:this.opts.holdTtlMs});return l?(this.hold={holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(l.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),s.preferPremium&&l.seats.length&&!l.seats.every(c=>{var d;return(d=c.commercial)===null||d===void 0?void 0:d.premium})&&this.toast(V("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}catch(l){var a,r;(a=(r=this.opts).onError)===null||a===void 0||a.call(r,l);const c=l==null?void 0:l.reason,d=c==="not_enough_together"?V("picker.couldNotFindSeatsTogether",{count:e}):c==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):c==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):c==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):c==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):this.tf("picker.seatsNoLongerAvailableTryAnother","Those seats are no longer available. Try another quantity or ticket type.");return this.toast(d,"error"),null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){const e=this.hold,i=this.controller.currentHold();let s=!0;if(i)s=await this.controller.release();else if(e){var n,o;const l=[...new Set([...((n=e.items)!==null&&n!==void 0?n:[]).map(c=>c.label),...((o=e.seats)!==null&&o!==void 0?o:[]).map(c=>c.label)])];if(l.length)try{await this.api.release(this.opts.event,l,e.holdId)}catch(c){var a,r;(a=(r=this.opts).onError)===null||a===void 0||a.call(r,c),s=!1}}if(!s){this.toast(this.tf("picker.couldNotReleaseTickets","Couldn't release your tickets. Your hold is unchanged."),"error");return}this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.syncTray(),this.emitHoldChange()}startRealtime(){var e;if(!(!((e=this.access)===null||e===void 0)&&e.configured)||!this.pubApi||this.realtime)return;const i=this.opts.event;this.realtime=new Ls({url:this.pubApi.subscribeUrl(i),mintTicket:()=>this.pubApi.subscribeTicket(i),onAccessUnavailable:s=>{var n,o;(n=(o=this.opts).onAccessUnavailable)===null||n===void 0||n.call(o,s),this.showAccessPanel(s)},sink:Hn(this.controller,{flashOnLiveChange:!0,onStatusChange:()=>{var s;this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),(s=this.minimap)===null||s===void 0||s.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(s,n)=>{var o,a;(o=(a=this.opts).onSelectedObjectUnavailable)===null||o===void 0||o.call(a,{labels:s,reason:n}),this.syncTray(),this.toast(n==="ineligible"?this.tf("picker.seatNoLongerYours","Some seats are no longer available to you. They have been removed from your order."):this.tf("picker.seatTaken","Someone else took a seat you had picked. It has been removed from your order."),"warning")}})}),this.realtime.start()}async refreshAccess(){var e;return!(!((e=this.access)===null||e===void 0)&&e.configured)||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}showAccessPanel(e){var i,s;if(this.destroyed||!this.root)return;const n=this.accessCopy(e.reason);this.dismissAccessPanel();const o=document.createElement("div");o.className="sl-access",o.setAttribute("role","status"),o.setAttribute("aria-live","polite");const a=document.createElement("div"),r=document.createElement("div");r.className="sl-access-title",r.textContent=n.title;const l=document.createElement("div");if(l.className="sl-access-body",l.textContent=n.body,a.appendChild(r),a.appendChild(l),n.action){const c=document.createElement("button");c.type="button",c.className="sl-access-act",c.textContent=n.action,c.addEventListener("click",()=>{this.refreshAccess()}),a.appendChild(c)}o.appendChild(a),((i=(s=this.regions)===null||s===void 0?void 0:s["bottom-center"])!==null&&i!==void 0?i:this.root).appendChild(o),this.accessEl=o}dismissAccessPanel(){var e;(e=this.accessEl)===null||e===void 0||e.remove(),this.accessEl=null}accessCopy(e){switch(e){case"paused":return{title:this.tf("picker.accessPausedTitle","These seats are on hold right now"),body:this.tf("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:this.tf("picker.accessRetry","Try again")};case"revoked":return{title:this.tf("picker.accessRevokedTitle","This access link is no longer active"),body:this.tf("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats.")};case"no_token":case"provider_failed":return{title:this.tf("picker.accessExpiredTitle","Your access session has ended"),body:this.tf("picker.accessExpiredBody","Sign in again, or reload the page, to keep browsing these seats. Anything you are already holding stays yours."),action:this.tf("picker.accessRetry","Try again")};default:return{title:this.tf("picker.accessInvalidTitle","We couldn’t verify your access"),body:this.tf("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest.")}}}destroy(){var e,i,s,n;this.destroyed=!0,(e=this.realtime)===null||e===void 0||e.stop(),this.realtime=null,this.dismissAccessPanel(),(i=this.access)===null||i===void 0||i.clear(),this.hold&&!this.handedOff&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.toastTimer&&clearTimeout(this.toastTimer),this.liveTimer&&clearTimeout(this.liveTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(const a of this.motionTimers)clearTimeout(a);if(this.motionTimers.clear(),(s=this.ro)===null||s===void 0||s.disconnect(),this.ro=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,(n=this.root)===null||n===void 0||n.remove(),this.root=null,this.modalScrim){var o;this.modalScrim.remove(),this.modalScrim=null,!((o=this.prevFocus)===null||o===void 0)&&o.isConnected&&this.prevFocus.focus({preventScroll:!0}),this.prevFocus=null}}};function Wv(t,e={}){var i;let s=(i=e.origin)!==null&&i!==void 0?i:"";if(!s)try{s=new URL(t.src,window.location.href).origin}catch{s=""}let n=!1,o=null,a=null,r=null,l="",c=null;const d=()=>{if(n)return;n=!0,o=t.getAttribute("style"),Object.assign(t.style,{position:"fixed",inset:"0",width:"100vw",height:"100vh",margin:"0",border:"0",zIndex:"2147483000",background:"#101625"});const p=document.documentElement;a=p.style.overflow,p.style.overflow="hidden",document.body&&(r=document.body.style.overflow,document.body.style.overflow="hidden"),c=f=>{f.key==="Escape"&&u()},window.addEventListener("keydown",c)},u=()=>{n&&(n=!1,o===null?t.removeAttribute("style"):t.setAttribute("style",o),o=null,l&&(t.style.height=l),a!==null&&(document.documentElement.style.overflow=a,a=null),r!==null&&document.body&&(document.body.style.overflow=r,r=null),c&&(window.removeEventListener("keydown",c),c=null))},h=p=>{if(p.source!==t.contentWindow||s&&p.origin!==s||!p.data||typeof p.data!="object")return;const f=p.data;if(f.type==="seatlayer:height"){typeof f.px=="number"&&Number.isFinite(f.px)&&f.px>0&&(l=`${Math.round(f.px)}px`,n||(t.style.height=l));return}f.type==="seatlayer:fullscreen"&&(f.on===!0?d():f.on===!1&&u())};return window.addEventListener("message",h),()=>{window.removeEventListener("message",h),u()}}async function yl(t){var e;const i=((e=t.headers.get("content-type"))!==null&&e!==void 0?e:"").includes("application/json")?await t.json().catch(()=>null):null;if(!t.ok){var s;const n=i;throw new he(t.status,(s=n==null?void 0:n.error)!==null&&s!==void 0?s:`request_failed_${t.status}`,n==null?void 0:n.code,n==null?void 0:n.conflicts,n==null?void 0:n.details,typeof(n==null?void 0:n.message)=="string"?n.message:void 0)}return i}function Te(t){return t&&typeof t=="object"?t:{}}function Rs(t,e,i=0){return typeof t=="number"&&Number.isFinite(t)?t:typeof e=="number"&&Number.isFinite(e)?e:i}function kl(t,e){return t===null?null:typeof t=="number"&&Number.isFinite(t)?t:t!==void 0?null:typeof e=="number"&&Number.isFinite(e)?e:null}function wl(t){const e=Te(t),i=Rs(e.bookedValue,e.bookedRevenue);return{...e,bookedValue:i,bookedRevenue:i}}function Kv(t){const e=Te(t),i=Te(e.report),s=Array.isArray(i.byCategory)?i.byCategory.map(o=>{const a=Te(o),r=Rs(a.bookedValue,a.bookedRevenue);return{...a,bookedValue:r,bookedRevenue:r}}):[],n=Array.isArray(i.bySection)?i.bySection.map(wl):void 0;return{...e,report:{...i,byCategory:s,...n?{bySection:n}:{}}}}function Yv(t){const e=Te(t),i=Te(e.bookedValue),s=Te(e.revenue),n=Object.keys(i).length?i:s,o=Array.isArray(i.bySection)?i.bySection:Array.isArray(s.bySection)?s.bySection:[],a={...n,gross:Rs(i.gross,s.gross),bySection:o.map(wl)},r=Te(e.velocity),l=Array.isArray(r.bySection)?r.bySection.map(c=>{const d=Te(c),u=Rs(d.bookedValue,d.grossRevenue);return{...d,bookedValue:u,grossRevenue:u}}):[];return{...e,bookedValue:a,revenue:a,velocity:{...r,bySection:l}}}function Xv(t){const e=Te(t),i=Te(e.report),s=typeof i.includesBookedValue=="boolean"?i.includesBookedValue:i.includesRevenue===!0,n=Array.isArray(i.rows)?i.rows.map(r=>{const l=Te(r),c=Te(l.attribution),d=kl(c.bookedValue,c.revenue);return{...l,attribution:{...c,bookedValue:d,revenue:d}}}):[],o=Te(i.totals),a=kl(o.bookedValue,o.revenue);return{...e,report:{...i,includesBookedValue:s,includesRevenue:s,rows:n,totals:{...o,bookedValue:a,revenue:a}}}}function Jn(t){const e=Te(t),i=typeof e.includesBookedValue=="boolean"?e.includesBookedValue:e.includesRevenue===!0;return{...e,includesBookedValue:i,includesRevenue:i}}var he,eo,to=rt((()=>{he=class extends Error{constructor(t,e,i,s,n,o){super(e),this.name="ManageApiError",this.status=t,this.code=i,this.conflicts=s,this.details=n,this.serverMessage=o}},eo=class{constructor(t,e){this.base=t.replace(/\/+$/,""),this.token=e}setToken(t){this.token=t}auth(t,e={}){var i;const s=(i=e.method)!==null&&i!==void 0?i:"GET",n={Authorization:`Bearer ${this.token}`};let o;return e.body!==void 0&&(n["Content-Type"]="application/json",o=JSON.stringify(e.body)),fetch(`${this.base}${t}`,{method:s,headers:n,body:o,credentials:"omit"}).then(a=>yl(a))}async authBlob(t){const e=await fetch(`${this.base}${t}`,{method:"GET",headers:{Authorization:`Bearer ${this.token}`},credentials:"omit"});return e.ok||await yl(e),e.blob()}chart(t){return this.auth(`/v1/events/${encodeURIComponent(t)}/chart`)}asset(t,e){return/^[a-zA-Z0-9._-]+$/.test(e)?this.authBlob(`/v1/events/${encodeURIComponent(t)}/assets/${encodeURIComponent(e)}`):Promise.reject(new he(404,"not_found","not_found"))}objects(t){return this.auth(`/v1/events/${encodeURIComponent(t)}/objects`)}subscribeTicket(t){return this.auth(`/v1/events/${encodeURIComponent(t)}/subscribe-tickets`,{method:"POST"})}socketUrl(t){return`${this.base.replace(/^http/,"ws")}/pub/events/${encodeURIComponent(t)}/subscribe?surface=manager`}block(t,e,i={}){const s={labels:e};return typeof i.releaseAt=="number"&&(s.releaseAt=i.releaseAt),i.reason&&(s.reason=i.reason),this.auth(`/v1/events/${encodeURIComponent(t)}/block`,{method:"POST",body:s})}unblock(t,e){return this.auth(`/v1/events/${encodeURIComponent(t)}/unblock`,{method:"POST",body:{labels:e}})}unblockAll(t){return this.auth(`/v1/events/${encodeURIComponent(t)}/unblock-all`,{method:"POST"})}unbook(t,e,i){return this.auth(`/v1/events/${encodeURIComponent(t)}/unbook`,{method:"POST",body:{labels:e,bookingRef:i}})}setHoldTtl(t,e){return this.auth(`/v1/events/${encodeURIComponent(t)}/hold-ttl`,{method:"POST",body:{holdTtlMs:e}})}setCategory(t,e,i){return this.auth(`/v1/events/${encodeURIComponent(t)}/category-assignments`,{method:"POST",body:{labels:e,categoryKey:i}})}setTableBooking(t,e,i,s={}){return this.auth(`/v1/events/${encodeURIComponent(t)}/table-booking`,{method:"POST",body:{tableIds:e,mode:i,...s}})}bookings(t,e={}){const i=new URLSearchParams;e.q&&i.set("q",e.q),e.state&&i.set("state",e.state),e.cursor&&i.set("cursor",e.cursor),e.limit!=null&&i.set("limit",String(e.limit));const s=i.toString();return this.auth(`/v1/events/${encodeURIComponent(t)}/bookings${s?`?${s}`:""}`)}booking(t,e){return this.auth(`/v1/events/${encodeURIComponent(t)}/bookings/${encodeURIComponent(e)}`)}listBookings(t,e={}){return this.bookings(t,e)}retrieveBooking(t,e){return this.booking(t,e)}availability(t){return this.auth(`/v1/events/${encodeURIComponent(t)}/availability`)}setAvailability(t,e){return this.auth(`/v1/events/${encodeURIComponent(t)}/availability`,{method:"POST",body:{rules:e}})}channels(t,e={}){const i=e.includeArchived?"?includeArchived=1":"";return this.auth(`/v1/events/${encodeURIComponent(t)}/channels${i}`)}channelAllocation(t,e={}){const i=new URLSearchParams;e.afterLabel&&i.set("afterLabel",e.afterLabel),e.limit!=null&&i.set("limit",String(e.limit));const s=i.toString();return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/allocation${s?`?${s}`:""}`)}channelAudit(t,e={}){const i=new URLSearchParams;e.limit!=null&&i.set("limit",String(e.limit)),e.before!=null&&i.set("before",String(e.before));const s=i.toString();return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/audit${s?`?${s}`:""}`)}createChannel(t,e){return this.auth(`/v1/events/${encodeURIComponent(t)}/channels`,{method:"POST",body:e})}renameChannel(t,e,i){return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/${encodeURIComponent(e)}`,{method:"PATCH",body:{name:i}})}updateChannelPricing(t,e,i,s){return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/${encodeURIComponent(e)}`,{method:"PATCH",body:{priceOverrides:i,expectedPricingVersion:s}})}setChannelPaused(t,e,i){const s=i?"pause":"unpause";return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/${encodeURIComponent(e)}/${s}`,{method:"POST",body:{}})}archiveChannel(t,e,i){return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/${encodeURIComponent(e)}/archive`,{method:"POST",body:{destination:i}})}applyChannelAssignment(t,e){return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/assignments`,{method:"POST",body:{targetChannelId:e.targetChannelId||null,labels:e.labels,assignmentVersion:e.assignmentVersion}})}channelPreview(t,e,i={}){const s=new URLSearchParams;e.length&&s.set("channelIds",e.join(",")),i.includePublic!=null&&s.set("includePublic",i.includePublic?"1":"0");const n=s.toString();return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/preview${n?`?${n}`:""}`)}setChannelAccessIntent(t,e,i,s={}){return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/${encodeURIComponent(e)}`,{method:"PATCH",body:{accessIntent:i,...s.acknowledgeLiveAccess?{acknowledgeLiveAccess:!0}:{},...s.reason?{reason:s.reason}:{}}})}createAccessLink(t,e,i={}){return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/${encodeURIComponent(e)}/access-links`,{method:"POST",body:i})}accessLinks(t,e){return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/${encodeURIComponent(e)}/access-links`)}rotateAccessLink(t,e,i,s){return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/${encodeURIComponent(e)}/access-links/${encodeURIComponent(i)}/rotate`,{method:"POST",body:{endActiveSessions:s}})}revokeAccessLink(t,e,i,s=!1){const n=s?"?endActiveSessions=1":"";return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/${encodeURIComponent(e)}/access-links/${encodeURIComponent(i)}${n}`,{method:"DELETE"})}report(t){return this.auth(`/v1/events/${encodeURIComponent(t)}/report`).then(Kv)}controlRoom(t,e=15){return this.auth(`/v1/events/${encodeURIComponent(t)}/control-room?window=${e}`).then(Yv)}channelReport(t){return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/report`).then(Xv)}createChannelReportLink(t,e,i={}){return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/${encodeURIComponent(e)}/report-links`,{method:"POST",body:i}).then(s=>{const n=Te(s);return{...n,link:Jn(n.link)}})}channelReportLinks(t,e){return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/${encodeURIComponent(e)}/report-links`).then(i=>{const s=Te(i);return{links:Array.isArray(s.links)?s.links.map(Jn):[]}})}revokeChannelReportLink(t,e,i){return this.auth(`/v1/events/${encodeURIComponent(t)}/channels/${encodeURIComponent(e)}/report-links/${encodeURIComponent(i)}`,{method:"DELETE"}).then(s=>{const n=Te(s);return{...n,link:Jn(n.link)}})}log(t,e={}){const i=new URLSearchParams;e.limit!=null&&i.set("limit",String(e.limit)),e.before!=null&&i.set("before",String(e.before));const s=i.toString();return this.auth(`/v1/events/${encodeURIComponent(t)}/log${s?`?${s}`:""}`)}async reportCsv(t){const e=await fetch(`${this.base}/v1/events/${encodeURIComponent(t)}/report.csv`,{headers:{Authorization:`Bearer ${this.token}`},credentials:"omit"});if(!e.ok)throw new he(e.status,`request_failed_${e.status}`);return e.blob()}}})),Zv=/^[a-zA-Z0-9._-]+$/;function Qv(t){let e;try{e=new URL(t,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;const i=/^\/v1\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!i)return null;try{const s=decodeURIComponent(i[1]),n=decodeURIComponent(i[2]);return!s||!Zv.test(n)?null:{eventKey:s,asset:n}}catch{return null}}function Jv(t){try{return/^\/v1\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(t,"https://seatlayer.invalid").pathname)}catch{return!1}}var em=class{constructor(t,e){this.eventKey=t,this.load=e,this.pending=new Map,this.created=new Set,this.disposed=!1}resolve(t){const e=Qv(t);if(!e)return Promise.resolve(Jv(t)?null:t);if(e.eventKey!==this.eventKey||this.disposed)return Promise.resolve(null);const i=`${e.eventKey}/${e.asset}`,s=this.pending.get(i);if(s)return s;const n=this.load(e.eventKey,e.asset).then(o=>{const a=URL.createObjectURL(o);return this.disposed?(URL.revokeObjectURL(a),null):(this.created.add(a),a)}).catch(o=>{throw this.pending.delete(i),o});return this.pending.set(i,n),n}async prepareRendererChart(t){var e;const i=async o=>{if(!(o!=null&&o.url))return;const a=await this.resolve(o.url);if(!a)throw new Error("organizer_event_asset_scope_mismatch");o.url=a},s=async o=>{for(const a of o){if(a.type!=="decorImage")continue;const r=a,l=await this.resolve(r.href);if(!l)throw new Error("organizer_event_asset_scope_mismatch");r.href=l}},n=async o=>{await i(o.backgroundImage),await s(o.objects)};await n(t);for(const o of(e=t.floors)!==null&&e!==void 0?e:[])await n(o);return t}dispose(){if(!this.disposed){this.disposed=!0;for(const t of this.created)URL.revokeObjectURL(t);this.created.clear(),this.pending.clear()}}},xl="seatlayer-manager-style",Sl="seatlayer-manager-channels-style",tm=".slm{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:320px;overflow:hidden;background:var(--slm-bg);color:var(--slm-text);font-family:var(--slm-font);border-radius:var(--slm-radius);--slm-mo-instant:80ms;--slm-mo-quick:.14s;--slm-mo-base:.2s;--slm-mo-slow:.32s;--slm-mo-ambient:2s;--slm-mo-out:cubic-bezier(.2,.8,.2,1);--slm-mo-in-out:cubic-bezier(.4,0,.2,1);--slm-mo-exit:cubic-bezier(.4,0,1,1);--slm-mo-spring:cubic-bezier(.34,1.3,.64,1)}.slm *{box-sizing:border-box;margin:0;padding:0}.slm button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}.slm input{font:inherit}.slm-bar{display:grid;grid-template-columns:auto auto auto minmax(0,1fr);align-items:center;column-gap:14px;row-gap:10px;padding:10px 16px;border-bottom:1px solid var(--slm-line);flex:none}.slm-modes{display:inline-flex;flex-wrap:wrap;row-gap:4px;background:var(--slm-surface);border:1px solid var(--slm-line);border-radius:999px;padding:3px}.slm-modegroup{display:inline-flex;align-items:center;gap:1px;padding:0 4px 0 6px}.slm-modegroup[hidden]{display:none}.slm-modegroup+.slm-modegroup{border-left:1px solid var(--slm-line);margin-left:2px}.slm-modegroup-label{padding:0 8px 0 4px;font-size:9.5px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:var(--slm-muted);opacity:.8;white-space:nowrap}.slm-tools{display:none}.slm-mode{padding:6px 13px;border-radius:999px;font-weight:700;font-size:13px;color:var(--slm-muted);white-space:nowrap}.slm-mode[hidden]{display:none}.slm-mode.on{background:var(--slm-accent);color:var(--slm-accent-ink)}.slm-live{display:inline-flex;align-items:center;gap:6px;font-size:11px;letter-spacing:.12em;font-weight:800;color:var(--slm-muted)}.slm-live-dot{width:8px;height:8px;border-radius:50%;background:#8b94ac}.slm.live .slm-live-dot{background:#22a06b;box-shadow:0 0 #22a06b8c;animation:slm-pulse var(--slm-mo-ambient) infinite}@keyframes slm-pulse{0%{box-shadow:0 0 #22a06b80}70%{box-shadow:0 0 0 7px #22a06b00}to{box-shadow:0 0 #22a06b00}}.slm-kpis{grid-column:1/-1;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));width:100%;padding-top:10px;border-top:1px solid var(--slm-line)}.slm-kpi{position:relative;display:flex;min-width:0;flex-direction:column;align-items:center;padding:0 5px;line-height:1.15;text-align:center}.slm-kpi b{display:flex;min-width:0;align-items:baseline;justify-content:center;font-size:17px;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap}.slm-kpi span{font-size:9.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--slm-muted);font-weight:700}.slm-kpi .dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px;vertical-align:baseline}.slm-kpi.changed b{animation:slm-kpi-bump var(--slm-mo-base) var(--slm-mo-spring)}.slm-kpidelta{position:absolute;right:4px;top:-12px;padding:2px 5px;border-radius:999px;background:#22a06b2b;color:#5bd39b!important;font-size:9px!important;letter-spacing:0!important;text-transform:none!important;white-space:nowrap;animation:slm-kpi-delta 1.45s ease-out both;pointer-events:none}.slm-kpidelta.down{background:#f4b74024;color:#f7ca6b!important}@keyframes slm-kpi-bump{0%,to{transform:none}35%{transform:translateY(-2px) scale(1.08);text-shadow:0 0 18px rgba(255,255,255,.24)}}@keyframes slm-kpi-delta{0%{opacity:0;transform:translateY(5px)}18%,72%{opacity:1;transform:none}to{opacity:0;transform:translateY(-5px)}}.slm-barbtn{padding:7px 13px;border-radius:9px;border:1px solid var(--slm-line);color:var(--slm-text);font-weight:700;font-size:12.5px}.slm-barbtn:hover{border-color:var(--slm-muted)}.slm-barbtn.follow.on{background:#22a06b21;border-color:#22a06b;color:#5bd39b}.slm-body{display:flex;flex:1;min-height:0}.slm-map{position:relative;flex:1;min-width:0}.slm-map-host{position:absolute;inset:0}.slm-hud{position:absolute;left:12px;bottom:12px;display:flex;gap:8px}.slm-hud-chip{padding:6px 11px;border-radius:999px;font-size:12px;font-weight:700;background:var(--slm-surface);border:1px solid var(--slm-line);color:var(--slm-text)}.slm-zoomhint{position:absolute;left:50%;top:14px;transform:translate(-50%);padding:6px 13px;border-radius:999px;background:#0000008c;color:#fff;font-size:12px;font-weight:700;pointer-events:none;opacity:0;transition:opacity var(--slm-mo-base) var(--slm-mo-out)}.slm-zoomhint.on{opacity:1}.slm-liveevent{position:absolute;left:50%;top:14px;z-index:4;display:flex;align-items:center;gap:8px;max-width:min(560px,calc(100% - 32px));padding:8px 12px;border:1px solid var(--slm-line);border-radius:999px;background:color-mix(in srgb,var(--slm-surface) 92%,transparent);box-shadow:0 10px 34px #00000052;opacity:0;transform:translate(-50%,-8px);pointer-events:none;transition:opacity var(--slm-mo-quick) var(--slm-mo-out),transform var(--slm-mo-base) var(--slm-mo-out);backdrop-filter:blur(10px)}.slm-liveevent.on{opacity:1;transform:translate(-50%)}.slm.block-mode .slm-liveevent{top:52px}.slm-liveeventdot{width:8px;height:8px;border-radius:50%;flex:none}.slm-liveeventcopy{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:800}.slm-liveeventhint{color:var(--slm-muted);font-size:10px;white-space:nowrap}.slm-rail{width:320px;flex:none;border-left:1px solid var(--slm-line);display:flex;flex-direction:column;min-height:0}.slm-railscroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px}.slm-eyebrow{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--slm-muted);font-weight:800;margin-bottom:6px}.slm-hint{font-size:12.5px;color:var(--slm-muted);line-height:1.5;margin-bottom:14px}.slm-railhead{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:6px}.slm-railhead .slm-eyebrow{margin-bottom:0;font-size:11px;color:var(--slm-text)}.slm-scope{flex:none;padding:2px 8px;border-radius:999px;font-size:9.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap}.slm-scope.read{background:#8b94ac29;color:#c2c9d8}.slm-scope.event{background:#f4b74029;color:#f7ca6b}.slm-scope.host{background:color-mix(in srgb,var(--slm-accent) 18%,transparent);color:var(--slm-accent)}.slm-step{display:flex;align-items:center;gap:7px}.slm-stepnum{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:var(--slm-accent);color:var(--slm-accent-ink);font-size:9.5px;letter-spacing:0}.slm-legend{display:flex;flex-direction:column;gap:2px;margin-bottom:16px}.slm-legrow{display:flex;align-items:center;gap:9px;padding:7px 2px;border-bottom:1px solid var(--slm-line)}.slm-legdot{width:10px;height:10px;border-radius:50%;flex:none}.slm-leglabel{flex:1;font-size:13px;font-weight:600}.slm-legcount{font-size:13px;font-weight:800;font-variant-numeric:tabular-nums}.slm-feed{display:flex;flex-direction:column;gap:0}.slm-feedrow{display:flex!important;width:100%;align-items:center;gap:9px;padding:8px 2px!important;border-bottom:1px solid var(--slm-line)!important;border-radius:6px;font-size:12.5px;text-align:left!important;animation:slm-in var(--slm-mo-quick) var(--slm-mo-out)}.slm-feedrow:hover{background:#ffffff09!important}@keyframes slm-in{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}.slm-feeddot{width:8px;height:8px;border-radius:50%;flex:none}.slm-feedtext{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.slm-feedtext b{font-weight:800}.slm-feedsection{display:block;overflow:hidden;text-overflow:ellipsis;color:var(--slm-muted);font-size:10px;font-weight:750}.slm-feedmeta{display:flex;flex:none;flex-direction:column;align-items:flex-end;gap:1px}.slm-feedtime{font-size:10px;color:var(--slm-muted);font-variant-numeric:tabular-nums}.slm-feedlocate{font-size:9.5px;color:var(--slm-accent);font-weight:800}.slm-empty{font-size:12.5px;color:var(--slm-muted);padding:12px 0}.slm-selbar{display:flex;align-items:baseline;gap:8px;margin-bottom:10px}.slm-selnum{font-size:26px;font-weight:800;font-variant-numeric:tabular-nums}.slm-sellabel{font-size:12px;color:var(--slm-muted);font-weight:600}.slm-row{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}.slm-btn{flex:1;min-width:120px;padding:10px 14px;border-radius:10px;background:var(--slm-accent);color:var(--slm-accent-ink);font-weight:800;font-size:13px;text-align:center}.slm-btn:disabled{opacity:.45;cursor:not-allowed}.slm-btn.ghost{background:var(--slm-surface);border:1px solid var(--slm-line);color:var(--slm-text)}.slm-btn.danger{background:#c0392b;color:#fff}.slm-chiprow{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:6px}.slm-chip{padding:6px 11px;border-radius:999px;border:1px solid var(--slm-line);background:var(--slm-surface);font-size:12px;font-weight:700;color:var(--slm-text);display:inline-flex;align-items:center;gap:6px}.slm-chip:hover{border-color:var(--slm-muted)}.slm-chip .dot{width:8px;height:8px;border-radius:50%}.slm-chip .slm-chipcount{min-width:18px;padding:1px 5px;border-radius:999px;background:#ffffff12;color:var(--slm-muted);font-size:10px;font-variant-numeric:tabular-nums;text-align:center}.slm-chip .slm-chipcheck{display:none;font-size:11px;line-height:1}.slm-chip.on{border-color:var(--slm-accent);background:color-mix(in srgb,var(--slm-accent) 20%,var(--slm-surface));box-shadow:0 0 0 1px color-mix(in srgb,var(--slm-accent) 45%,transparent)}.slm-chip.on .slm-chipcount{background:var(--slm-accent);color:var(--slm-accent-ink)}.slm-chip.on .slm-chipcheck{display:inline}.slm-chip.partial{border-style:dashed;border-color:var(--slm-accent)}.slm-chip:disabled{opacity:.42;cursor:not-allowed}.slm-selecthelp{margin:-1px 0 9px;color:var(--slm-muted);font-size:11px;line-height:1.4}.slm-field{margin:14px 0}.slm-field label{display:block;font-size:11px;font-weight:700;color:var(--slm-muted);margin-bottom:5px}.slm-input,.slm-select{width:100%;padding:8px 10px;border-radius:9px;border:1px solid var(--slm-line);background:var(--slm-surface);color:var(--slm-text)}.slm-note{font-size:11.5px;color:var(--slm-muted);margin-top:5px}.slm-blocked{margin-top:17px;padding-top:15px;border-top:1px solid var(--slm-line)}.slm-blockedhead{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:8px}.slm-blockedhead .slm-eyebrow{margin-bottom:0}.slm-blockedtotal{font-size:11px;color:var(--slm-muted)}.slm-blockedtotal b{color:var(--slm-text);font-variant-numeric:tabular-nums}.slm-blockedtools{display:grid;grid-template-columns:minmax(0,1fr);gap:7px}.slm-blockedsummary{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:9px 0 6px;color:var(--slm-muted);font-size:10.5px}.slm-linkbtn{font-size:11px!important;font-weight:800!important;color:var(--slm-accent)!important;text-align:right}.slm-linkbtn:disabled{opacity:.45;cursor:not-allowed}.slm-blockedlist{max-height:246px;overflow:auto;overscroll-behavior:contain;border:1px solid var(--slm-line);border-radius:10px;background:var(--slm-surface)}.slm-blockeditem{display:grid!important;grid-template-columns:18px minmax(0,1fr);width:100%;gap:8px;padding:8px 9px!important;border-bottom:1px solid var(--slm-line)!important;text-align:left!important}.slm-blockeditem:last-child{border-bottom:0!important}.slm-blockeditem:hover{background:#ffffff09!important}.slm-blockeditem.on{background:color-mix(in srgb,var(--slm-accent) 13%,var(--slm-surface))!important}.slm-blockedcheck{display:flex;align-items:center;justify-content:center;width:16px;height:16px;margin-top:1px;border-radius:4px;border:1px solid var(--slm-muted);color:transparent;font-size:10px;font-weight:900}.slm-blockeditem.on .slm-blockedcheck{border-color:var(--slm-accent);background:var(--slm-accent);color:var(--slm-accent-ink)}.slm-blockedcopy{min-width:0}.slm-blockedlabel{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:800}.slm-blockedmeta{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px;color:var(--slm-muted);font-size:10px}.slm-blockedmore{width:100%;padding:9px!important;color:var(--slm-accent)!important;font-size:11px!important;font-weight:800!important}.slm-blockedempty{padding:12px;color:var(--slm-muted);font-size:11.5px;line-height:1.45}.slm-allnote{margin-top:-4px;margin-bottom:10px}.slm-toast{position:absolute;left:50%;bottom:16px;transform:translate(-50%);padding:10px 16px;border-radius:10px;font-size:13px;font-weight:700;box-shadow:0 8px 24px #00000047;opacity:0;pointer-events:none;transition:opacity var(--slm-mo-base) var(--slm-mo-out);background:var(--slm-surface);color:var(--slm-text);border:1px solid var(--slm-line);z-index:5}.slm-toast.on{opacity:1}.slm-toast.err{background:#c0392b;color:#fff;border-color:#c0392b}.slm-toast.ok{background:#1f7a4d;color:#fff;border-color:#1f7a4d}.slm-bar-actions{display:flex;align-items:center;justify-self:end;gap:7px}.slm-barbtn.on{background:#f4b74021;border-color:#f4b740;color:#f7ca6b}.slm-sectionlist{display:flex;flex-direction:column;gap:8px;margin-top:4px}.slm-sectionlist+.slm-eyebrow{margin-top:18px}.slm-sectionrow{width:100%;padding:10px!important;border:1px solid var(--slm-line)!important;border-radius:10px;background:var(--slm-surface)!important;text-align:left!important;transition:border-color var(--slm-mo-quick) var(--slm-mo-out),transform var(--slm-mo-quick) var(--slm-mo-out)}.slm-sectionrow:hover{border-color:var(--slm-muted)!important;transform:translateY(-1px)}.slm-sectiontop,.slm-sectionmeta{display:flex;align-items:center;justify-content:space-between;gap:10px}.slm-sectiontop{font-size:12.5px;font-weight:800}.slm-sectionmeta{margin-top:5px;color:var(--slm-muted);font-size:11px}.slm-sectionmeta>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slm-trend{font-size:10px;text-transform:uppercase;letter-spacing:.08em}.slm-trend.rising{color:#22a06b}.slm-trend.cooling{color:#f4b740}.slm-sectionlocate{color:var(--slm-accent);font-size:9.5px;font-weight:800}.slm-health{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:16px}.slm-healthitem{padding:10px;border:1px solid var(--slm-line);border-radius:10px;background:var(--slm-surface)}.slm-healthitem b{display:block;font-size:17px;font-variant-numeric:tabular-nums}.slm-healthitem span{display:block;margin-top:2px;color:var(--slm-muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em}.slm-sectionhead{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-top:18px}.slm-windows{display:flex;gap:3px;padding:2px;border:1px solid var(--slm-line);border-radius:8px;background:var(--slm-surface)}.slm-window{padding:4px 6px;border-radius:6px;font-size:10px;font-weight:800;color:var(--slm-muted)}.slm-window.on{background:var(--slm-accent);color:var(--slm-accent-ink)}.slm-momentumhelp{margin:10px 0 14px;padding:10px;border:1px solid rgba(244,183,64,.28);border-radius:10px;background:#f4b74012}.slm-momentumhelp[hidden]{display:none}.slm-momentumscale{display:flex;align-items:center;gap:7px;color:var(--slm-muted);font-size:10px;font-weight:750;text-transform:uppercase;letter-spacing:.07em}.slm-momentumgradient{height:6px;min-width:64px;flex:1;border-radius:999px;background:linear-gradient(90deg,#f4b740,#ef4444)}.slm-momentumcopy{margin-top:7px;color:var(--slm-muted);font-size:11px;line-height:1.45}.slm-availlist{display:flex;flex-direction:column;gap:8px;margin:2px 0 12px}.slm-availrow{padding:10px;border:1px solid var(--slm-line);border-radius:10px;background:var(--slm-surface);transition:border-color var(--slm-mo-quick) var(--slm-mo-out),opacity var(--slm-mo-quick) var(--slm-mo-out)}.slm-availrow.zone{background:color-mix(in srgb,var(--slm-surface) 82%,#000)}.slm-availrow.hidden{opacity:.62}.slm-availrow.closed{opacity:.82}.slm-availhead{display:flex;align-items:center;gap:8px}.slm-availlabel{display:flex;align-items:center;gap:5px;flex:1;min-width:0;font-size:12.5px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slm-availcaret{flex:none;color:var(--slm-muted);font-size:10px}.slm-availcount{flex:none;font-size:11px;font-weight:700;color:var(--slm-muted);font-variant-numeric:tabular-nums}.slm-availbadge{flex:none;font-size:9px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;padding:2px 6px;border-radius:999px}.slm-availbadge.hidden{background:#8b94ac2e;color:#c2c9d8}.slm-availbadge.closed{background:#f4b74029;color:#f7ca6b}.slm-availselwrap{position:relative;flex:none;display:inline-flex}.slm-availmode{width:auto;max-width:190px;padding:6px 8px;font-size:11.5px;font-weight:700;cursor:pointer}.slm-availmode.on{border-color:var(--slm-accent);color:var(--slm-text)}.slm-availmode:disabled{opacity:.55;cursor:progress}.slm-availfollows{flex:none;padding:5px 10px;border:1px solid var(--slm-line);border-radius:7px;background:var(--slm-surface);color:var(--slm-muted);font-size:11px;font-weight:600;white-space:nowrap}.slm-availdetail{display:flex;align-items:center;gap:8px;margin-top:9px}.slm-availdetail .slm-input{flex:1}.slm-availpct{max-width:74px;flex:none!important}.slm-availpctlabel{font-size:11px;color:var(--slm-muted);font-weight:600;white-space:nowrap}.slm-availsummary{display:flex;align-items:center;gap:8px;padding:10px 12px;border:1px solid var(--slm-line);border-radius:9px;color:var(--slm-muted);font-size:12.5px}.slm-availdot{width:9px;height:9px;border-radius:50%;flex:none;background:#22a06b}.slm-availdot.warn{background:#f4b740}.slm-availcallout{display:flex;align-items:flex-start;gap:8px;margin-top:10px;padding:10px 12px;border:1px solid rgba(244,183,64,.45);border-radius:9px;background:#f4b7401a}.slm-availstar{flex:none;margin-top:1px;color:#f4b740;font-size:13px;line-height:1}.slm-availcallout p{font-size:11.5px;line-height:1.55;color:#f4d58a}.slm-availcallout b{color:#ffe4a3;font-weight:800}.slm-inspect-card{padding:16px;border:1px solid var(--slm-line);border-radius:12px;background:var(--slm-surface)}.slm-inspect-label{font-size:24px;font-weight:850;letter-spacing:-.02em;line-height:1.1}.slm-inspect-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;margin-top:18px}.slm-inspect-grid>div{min-width:0}.slm-inspect-grid span{display:block;color:var(--slm-muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em}.slm-inspect-grid b{display:block;margin-top:4px;font-size:13px;line-height:1.35;overflow-wrap:anywhere}.slm-categoryassign{display:flex;flex-direction:column;gap:6px}.slm-categoryrow{display:grid!important;width:100%;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:9px 10px!important;border:1px solid var(--slm-line)!important;border-radius:10px;background:var(--slm-surface)!important;text-align:left!important;transition:border-color var(--slm-mo-quick) var(--slm-mo-out),background var(--slm-mo-quick) var(--slm-mo-out)}.slm-categoryrow:not(:disabled):hover{border-color:var(--slm-accent)!important;background:color-mix(in srgb,var(--slm-accent) 10%,var(--slm-surface))!important}.slm-categoryrow:disabled{cursor:not-allowed}.slm-categoryrow:disabled:not(.current){opacity:.55}.slm-categoryrow.current{border-style:dashed!important}.slm-categoryrow>.dot{width:10px;height:10px;border-radius:50%;flex:none}.slm-categorycopy{display:flex;min-width:0;flex-direction:column;gap:2px}.slm-categorycopy b{font-size:12.5px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slm-categorycopy small{font-size:10px;color:var(--slm-muted);font-variant-numeric:tabular-nums}.slm-categoryact{flex:none;font-size:11px;font-weight:800;color:var(--slm-accent);white-space:nowrap}.slm-categoryrow:disabled .slm-categoryact{color:var(--slm-muted)}.slm-categoryrow.current .slm-categoryact{color:var(--slm-muted)}.slm-tablesummary{display:flex;align-items:baseline;gap:8px;padding:9px 12px;border:1px solid var(--slm-line);border-radius:9px;background:var(--slm-surface);font-size:12px;color:var(--slm-muted)}.slm-tablesummary b{color:var(--slm-text);font-variant-numeric:tabular-nums}.slm-tablelist{display:flex;flex-direction:column;gap:8px;margin-top:4px}.slm-tablerow{display:grid;grid-template-columns:minmax(0,1fr) minmax(128px,auto);align-items:center;gap:10px;padding:10px;border:1px solid var(--slm-line);border-radius:10px;background:var(--slm-surface)}.slm-tablerow.locked{border-style:dashed}.slm-tablecopy{display:flex;min-width:0;flex-direction:column;gap:2px}.slm-tablecopy b{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slm-tablecopy small{font-size:10px;color:var(--slm-muted)}.slm-tablerow .slm-select{min-width:128px}.slm-tablelock{color:#f7ca6b;font-weight:700}.slm-select:disabled{opacity:.55;cursor:not-allowed}.slm:fullscreen{border-radius:0;min-height:100vh;background:var(--slm-bg)}.slm:fullscreen .slm-bar{padding:14px 22px}.slm:fullscreen .slm-kpi b{font-size:21px}.slm:fullscreen .slm-rail{width:360px}.slm.compact .slm-rail{width:100%;border-left:0;border-top:1px solid var(--slm-line);height:44%}.slm.compact .slm-body{flex-direction:column}.slm.compact .slm-bar{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:8px}.slm.compact .slm-modes{display:none}.slm.compact .slm-tools{display:block;width:100%;padding:9px 13px;min-height:44px;border:1px solid var(--slm-line);border-radius:10px;background:var(--slm-surface);color:var(--slm-text);font-size:13px;font-weight:800}.slm.compact .slm-live{justify-self:end}.slm.compact .slm-bar-actions{grid-column:1/-1;justify-self:stretch}.slm.compact .slm-barbtn{flex:1;padding:6px 9px}.slm.compact .slm-kpis{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.slm.compact .slm-kpi[data-kpi=viewing-map],.slm.compact .slm-kpi[data-kpi=active-holds],.slm.compact .slm-kpi[data-kpi=booked-pct],.slm.compact .slm-kpi[data-kpi=booked-value]{display:none}@media(prefers-reduced-motion:reduce){.slm,.slm *,.slm *:before,.slm *:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}";function im(){if(typeof document=="undefined"||document.getElementById(xl))return;const t=document.createElement("style");t.id=xl,t.textContent=tm,document.head.appendChild(t)}function sm(t){if(typeof document=="undefined"||document.getElementById(Sl))return;const e=document.createElement("style");e.id=Sl,e.textContent=t,document.head.appendChild(e)}function nm(t){return t?t.mode:"open"}function om(t,e,i){switch(t){case"open":return null;case"hidden":return{mode:"hidden",labels:e};case"closed":return{mode:"closed",labels:e};case"timed":var s;return{mode:"timed",revealAt:(s=i==null?void 0:i.revealAt)!==null&&s!==void 0?s:Date.now()+36e5,labels:e};case"threshold":var n;return{mode:"threshold",thresholdPct:(n=i==null?void 0:i.thresholdPct)!==null&&n!==void 0?n:80,labels:e}}}function am(t){return new Date(t-new Date().getTimezoneOffset()*6e4).toISOString().slice(0,16)}function rm(t){if(typeof t=="string"){const e=document.querySelector(t);if(!e)throw new Error(`seatmanager: container "${t}" not found`);return e}if(!(t instanceof HTMLElement))throw new Error("seatmanager: container must be a CSS selector or an HTMLElement");return t}function Cl(t){if(!t.startsWith("mse_"))throw new Error("seatmanager: token must be a short-lived event-scoped mse_ grant minted by your backend; tenant secret keys are unsupported in browsers")}function io(t){return t==="blocked"?"not_for_sale":t}var lm=[{key:"free",label:"Free",color:"#6e7bff"},{key:"held",label:"Held",color:"#f4b740"},{key:"booked",label:"Booked",color:"#22a06b"},{key:"blocked",label:"Blocked",color:"#8b94ac"}];function Tl(t){var e,i,s;const n=t!=null?t:{};return{"--slm-bg":(e=n.background)!==null&&e!==void 0?e:"#0e1017","--slm-surface":"#181b24","--slm-text":"#eef1f7","--slm-muted":"#8b93a7","--slm-line":"rgba(255,255,255,.09)","--slm-accent":(i=n.accent)!==null&&i!==void 0?i:"#6e7bff","--slm-accent-ink":(s=n.accentInk)!==null&&s!==void 0?s:"#ffffff","--slm-font":"-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif","--slm-radius":"14px"}}function Ll(t,e){const i=Math.max(0,Math.round((e-t)/1e3));if(i<5)return"just now";if(i<60)return`${i}s ago`;const s=Math.round(i/60);return s<60?`${s}m ago`:`${Math.round(s/60)}h ago`}function $s(t,e){return gs(t,e,{maximumFractionDigits:0,fallback:(i,s)=>`${s} ${Math.round(i).toLocaleString()}`})}function Z(t){return String(t!=null?t:"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Al(t){return Object.entries(t).filter(([,e])=>e.mode==="closed").map(([e])=>e)}function so(t){var e,i;const s=t.sectionsBase;if(!s)return{rows:[],hiddenSections:0,closedSections:0};const n=(e=(i=t.doc)===null||i===void 0?void 0:i.zones)!==null&&e!==void 0?e:[],o=new Map,a=[];for(const p of s.sections)if(p.zone&&n.some(f=>f.id===p.zone)){var r;const f=(r=o.get(p.zone))!==null&&r!==void 0?r:[];f.push(p),o.set(p.zone,f)}else a.push(p);const l=[];let c=0,d=0;const u=(p,f,v,m=!1)=>{var g;const b=(g=t.availabilityRules[f.id])!==null&&g!==void 0?g:null,y=t.effectiveClosed.has(f.id)||m,k=t.effectiveHidden.has(f.id)||v&&!y;p==="section"&&k&&(c+=1),p==="section"&&y&&(d+=1),l.push({kind:p,id:f.id,label:f.label,seatCount:f.seatCount,seatLabels:f.seatLabels,rule:b,hidden:k,closed:y,followsZone:p==="section"&&v})};for(const p of n){var h;const f=o.get(p.id);if(!f||!f.length)continue;const v={id:p.id,label:p.label||"Zone",seatCount:f.reduce((b,y)=>b+y.seatCount,0),seatLabels:f.flatMap(b=>b.seatLabels)},m=!!t.availabilityRules[p.id],g=((h=t.availabilityRules[p.id])===null||h===void 0?void 0:h.mode)==="closed";u("zone",v,!1);for(const b of f)u("section",b,m,g)}for(const p of a)u("section",p,!1);if(s.ungrouped){const p=s.ungrouped;u("section",{id:ct,label:p.label,seatCount:p.seatCount,seatLabels:p.seatLabels},!1)}return{rows:l,hiddenSections:c,closedSections:d}}function cm(t,e){const i=nm(t.rule),s=`slm-availrow${t.kind==="zone"?" zone":""}${t.hidden?" hidden":""}${t.closed?" closed":""}`,n=e?" disabled":"",o=(h,p)=>``,a=t.followsZone?'Follows zone':` - - `;let r="";if(!t.followsZone&&i==="timed"){var l;const h=!((l=t.rule)===null||l===void 0)&&l.revealAt?Z(am(t.rule.revealAt)):"";r=`
- -
`}else if(!t.followsZone&&i==="threshold"){var c,d;const h=(c=(d=t.rule)===null||d===void 0?void 0:d.thresholdPct)!==null&&c!==void 0?c:80;r=`
- Reveal at - - % sold -
`}const u=t.closed?'Closed':t.hidden?'':"";return`
-
- ${t.kind==="zone"?``:""}${Z(t.label)} - ${u} - ${t.seatCount.toLocaleString()} - ${a} -
- ${r} -
`}function gt(t){return t==null||t===""||t==="public"}function Ft(t,e){var i,s,n;const o=(t!=null?t:"").trim();return(((i=(s=(n=/\p{L}/u.exec(o))===null||n===void 0?void 0:n[0])!==null&&s!==void 0?s:o[0])!==null&&i!==void 0?i:"")||e).toUpperCase().slice(0,1)}function no(t,e){var i;const s=new Set([...e].map(o=>Ft(o,"")).filter(Boolean)),n=Ft(t,"");return{letter:ho.includes(n)&&!s.has(n)?n:(i=[...ho].find(o=>!s.has(o)))!==null&&i!==void 0?i:n||"X",color:Ni[s.size%Ni.length]}}function El(t,e=0){return gt(t.id)?{letter:Ft(t.marker,"P"),color:t.color||"#f4b740"}:{letter:Ft(t.marker||t.name,"?"),color:t.color||Ni[e%Ni.length]}}function Il(t,e,i){var s,n,o;const a=new Map;for(const d of t){var r;const u=oo(e.get(d));a.set(u,((r=a.get(u))!==null&&r!==void 0?r:0)+1)}const l=[{id:Ue,name:(s=i==null||(n=i.publicSale)===null||n===void 0?void 0:n.name)!==null&&s!==void 0?s:ze},...((o=i==null?void 0:i.channels)!==null&&o!==void 0?o:[]).map(d=>({id:d.id,name:d.name}))],c=[];for(const d of l){const u=a.get(d.id);u&&c.push({channelId:d.id,name:d.name,count:u}),a.delete(d.id)}for(const[d,u]of a)c.push({channelId:d,name:gt(d)?ze:"Another channel",count:u});return c}function oo(t){return gt(t)?Ue:t}function ao(t){return{count:t.length,labels:t.slice(0,uo),truncated:t.length>uo}}function Ml(t){const{labels:e,allocation:i,statusOf:s,nameOf:n}=t,o=oo(t.targetChannelId),a=new Set;let r=0,l=0;const c=new Map,d=[],u=[],h=[];for(const v of e){var p;if(a.has(v))continue;a.add(v);const m=s(v);if(!m){h.push(v);continue}const g=oo(i.get(v));if(g===o){l+=1;continue}if(m==="held"){d.push(v);continue}if(m==="booked"){u.push(v);continue}g==="public"?r+=1:c.set(g,((p=c.get(g))!==null&&p!==void 0?p:0)+1)}const f=[...c.entries()].map(([v,m])=>({channelId:v,name:n(v),count:m}));return{changedFromPublic:{count:r},movedFromOtherChannel:{count:f.reduce((v,m)=>v+m.count,0),channels:f},alreadyInTarget:{count:l},skippedHeld:ao(d),skippedBooked:ao(u),notFound:ao(h)}}function Os(t){return t.changedFromPublic.count+t.movedFromOtherChannel.count}function _l(t){return t.movedFromOtherChannel.count>0}function Pl(t,e){const i=[];t.changedFromPublic.count&&i.push({kind:"add",icon:"+",count:t.changedFromPublic.count,text:`${t.changedFromPublic.count.toLocaleString()} from ${ze}`});for(const n of t.movedFromOtherChannel.channels){var s;i.push({kind:"move",icon:"⇄",count:n.count,text:`${n.count.toLocaleString()} moved out of ${(s=n.name)!==null&&s!==void 0?s:"another channel"}`,why:"needs this confirmation"})}return t.alreadyInTarget.count&&i.push({kind:"same",icon:"=",count:t.alreadyInTarget.count,text:`${t.alreadyInTarget.count.toLocaleString()} already in ${e}`,why:"unchanged"}),t.skippedHeld.count&&i.push({kind:"skip",icon:"⏸",count:t.skippedHeld.count,text:`${t.skippedHeld.count.toLocaleString()} in a buyer's checkout`,why:"can't move while held",peek:Fs(t.skippedHeld)}),t.skippedBooked.count&&i.push({kind:"skip",icon:"🔒",count:t.skippedBooked.count,text:`${t.skippedBooked.count.toLocaleString()} already sold`,why:"sales are never rewritten",peek:Fs(t.skippedBooked)}),t.notFound.count&&i.push({kind:"skip",icon:"?",count:t.notFound.count,text:`${t.notFound.count.toLocaleString()} not on this map`,why:"these seats are no longer part of the event",peek:Fs(t.notFound)}),i}function Fs(t){if(!t.labels.length)return;const e=t.labels.slice(0,4).join(", ");return t.truncated||t.labels.length>4?`${e}…`:e}function Rl(t){var e;const i=(e=t==null?void 0:t.retryAfterMs)!==null&&e!==void 0?e:t!=null&&t.latestHoldExpiresAt?Math.max(0,t.latestHoldExpiresAt-Date.now()):0;if(!i)return"in a moment";const s=Math.ceil(i/6e4);return s<=1?"in about a minute":`in about ${s} minutes`}function $l(t){var e;if(!t||!t.intent)return"—";const i=t.intent==="server"?"Website integration":t.intent==="hosted_link"?"Buyer link":t.intent==="internal"?"Your staff sell these":"Protected reserve",s=t.hasActiveGrants?"in use now":t.lastMintAt?`last used ${new Date(t.lastMintAt).toLocaleDateString()}`:null,n=(e=t.detail)!==null&&e!==void 0?e:s;return n?`${i} · ${n}`:i}function Bt(t){return t==="internal"?"Sell through your own staff":t==="server"?"Integrate a website or app":t==="hosted_link"?"Sell with a buyer link":"Keep as protected reserve"}function Ol(t){switch(t){case"internal":return"Only your own box office can sell these seats, through your secret key. Buyer links and website integrations are refused.";case"server":return"Your website's backend mints each buyer a short-lived session for these seats. Buyer links are refused; the code lives on the Embed page.";case"hosted_link":return"SeatLayer makes a link you send to a named group. They open it and buy only these seats. No other route can sell them.";default:return"Nobody can buy these seats. Every way of letting a buyer in — a buyer link, your website, even your own staff — is refused while this is the route. The seats stay out of public sale."}}function dm(t){return t==="hosted_link"?"hosted_link":t==="server"?"server":t==="staff"?"internal":null}function Bs(t){const e=ro(t==null?void 0:t.accessIntent),i=dm(t==null?void 0:t.route),s=`This channel is set to "${Bt(e)}"`;return i?`${s}, so it cannot do that. Switch it to "${Bt(i)}" first.`:`${s}, so it cannot do that. Choose a different route for this channel first.`}function ro(t){return t==="internal"||t==="server"||t==="hosted_link"||t==="none"?t:"none"}function zs(t,e,i){return`${t.toLocaleString()} ${t===1?e:i}`}function Fl(t){var e,i;const s=Math.max(0,(e=t==null?void 0:t.liveAccessLinks)!==null&&e!==void 0?e:0),n=Math.max(0,(i=t==null?void 0:t.activeSessions)!==null&&i!==void 0?i:0),o=ro(t==null?void 0:t.from),a=ro(t==null?void 0:t.to),r=`${[s?zs(s,"buyer link is live","buyer links are live"):null,n?zs(n,"buyer is in a checkout","buyers are in a checkout"):null].filter(Boolean).join(", and ")||"Buyers are inside this channel"} on "${Bt(o)}". Moving it to "${Bt(a)}" changes what happens to them.`,l=[];return s&&l.push(`${zs(s,"buyer link closes","buyer links close")} immediately. Anyone who has not opened it yet never will — send a new link if you still need one.`),n&&l.push(`${zs(n,"buyer who is already in a checkout keeps","buyers who are already in a checkout keep")} their seats and can finish paying. Nobody is thrown out. No new buyers come in this way, so the old route empties on its own within 12 hours.`),{headline:r,consequences:l}}function Bl(t){var e;switch((e=t.status)!==null&&e!==void 0?e:t.state){case"active":return{text:"Active",kind:"active"};case"expired":return{text:"Expired",kind:"archived"};case"exhausted":return{text:"All used",kind:"paused"};case"rotated":return{text:"Replaced",kind:"archived"};default:return{text:"Revoked",kind:"archived"}}}function lo(t){return t.state==="active"&&t.status==="active"}function hm(t){return Number.isFinite(t)?new Date(t).toLocaleString(void 0,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"}):"—"}function co(t){return[{k:"Expires",v:hm(t.expiresAt)},{k:"Redemptions",v:`${t.redemptions.toLocaleString()} of ${t.maxRedemptions.toLocaleString()} used`},{k:"Seats per buyer",v:`${t.maxQuantity.toLocaleString()} seat${t.maxQuantity===1?"":"s"} maximum`},{k:"Covers",v:t.includePublic?"This channel's allocation and Public sale seats":"This channel's allocation only"}]}function Hi(t){var e;const i=t==null||(e=t.serverMessage)===null||e===void 0?void 0:e.trim();switch(t==null?void 0:t.code){case"invalid_expiry":case"invalid_max_redemptions":case"invalid_max_quantity":case"invalid_session_ttl":case"invalid_label":return i||"That setting is outside what a hosted link allows. Adjust it and try again.";case"too_many_access_links":return i||"This channel already has as many live links as it can hold. Revoke one before creating another.";case"access_link_not_active":return"That link is no longer active, so it cannot be rotated or revoked.";case"channel_unavailable":return"This channel is paused or archived, so it cannot let new buyers in. Resume it first.";case"channel_access_intent_forbids":return Bs(t==null?void 0:t.details);case"end_active_sessions_required":return"Choose what happens to the buyers who already came in through this link.";case"not_found":return"That link is no longer here. Refresh and try again.";default:return(t==null?void 0:t.status)===403?"Hosted access links need channel-management permission.":i||"That did not go through. Try again."}}function um(t){var e;return((e=t==null?void 0:t.channels)!==null&&e!==void 0?e:[]).map(i=>{var s,n,o;return{kind:"skip",icon:"⚠",count:i.count,text:`${i.count.toLocaleString()} would leave ${(s=i.name)!==null&&s!==void 0?s:"a channel"}`,why:"the new chart no longer has these seats",peek:!((n=i.labels)===null||n===void 0)&&n.length?Fs({count:i.count,labels:i.labels,truncated:(o=i.truncated)!==null&&o!==void 0?o:!1}):void 0}})}function zl(t){return t==="builtin"?"Built-in":t==="active"?"Active":t==="paused"?"Paused":"Archived"}var Ue,ze,Ni,pm,ho,uo,Ds,po=rt((()=>{Ue="public",ze="Public sale",Ni=["#a78bfa","#2dd4bf","#fb923c","#60a5fa","#f472b6","#a3e635","#f87171","#38bdf8","#c084fc","#facc15"],pm="#f4b740",ho="ABCDEFGHJKLMNPQRSTUVWXYZ",uo=12,Ds={maxRedemptions:100,maxQuantity:4}}));function fo(t){return t.map((e,i)=>` -
- - ${e.count.toLocaleString()} ${H(e.text.replace(/^[\d,.\s]+/,""))} - ${e.why?`— ${H(e.why)}`:""} - ${e.peek?`${H(e.peek)}`:""} -
`).join("")}function H(t){return String(t!=null?t:"").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function fm(t){return new Date(t-new Date(t).getTimezoneOffset()*6e4).toISOString().slice(0,16)}function Dl(t,e){var i,s;const n=(i=(s=t.querySelector(e))===null||s===void 0?void 0:s.value.trim())!==null&&i!==void 0?i:"",o=Number(n);return n!==""&&Number.isInteger(o)?o:null}function Hl(t){const e=t.querySelector("[data-ch-lk-url]");if(e)try{const i=document.createRange();i.selectNodeContents(e);const s=window.getSelection();s==null||s.removeAllRanges(),s==null||s.addRange(i)}catch{}}var Nl,vo=rt((()=>{Nl=` -

On your website

-

There is nothing more to set up on this screen. Your own server mints a short-lived buyer - access session for this channel with the SeatLayer server SDK and hands it to the widget. A channel name - on its own never grants access.

-

Read the website integration guide →

`}));function vm(t){var e;const i=t.canvas,s=t.layer;if(!i||!s)return;const n=t.host.mapLayer.getBoundingClientRect(),o=Math.max(1,Math.round(n.width)),a=Math.max(1,Math.round(n.height)),r=typeof devicePixelRatio=="number"?Math.min(3,Math.max(1,devicePixelRatio)):1;(i.width!==o*r||i.height!==a*r)&&(i.width=o*r,i.height=a*r);const l=t.resolveCtx();if(!l)return;l.setTransform(r,0,0,r,0,0),l.clearRect(0,0,o,a);const c=t.host.isSeatDetail(),d=Math.max(3,t.host.seatPixelSize()),u=d/2,h=t.view==="preview"?t.previewProjection:null,p=h?new Set(h.available===!1?[]:(e=h.eligible)!==null&&e!==void 0?e:[]):null,f=new Map,v=!c&&t.host.sections().length>1?new Map:null,m=t.view==="preview"&&c&&d<=15?new Map:null;for(const S of t.host.seats()){var g,b;const T=(g=t.host.statusOf(S.label))!==null&&g!==void 0?g:"free",E=(b=t.allocation.get(S.label))!==null&&b!==void 0?b:Ue;if(E!=="public"){var y;const x=(y=f.get(E))!==null&&y!==void 0?y:{x:0,y:0,n:0};x.x+=S.x,x.y+=S.y,x.n+=1,f.set(E,x)}if(!c){const x=t.host.sectionOfLabel(S.label),A=x?t.host.worldToScreen({x:S.x,y:S.y}):null;if(v&&x&&A){var k;const P=(k=v.get(x.id))!==null&&k!==void 0?k:{label:x.label,minX:A.x,minY:A.y,maxX:A.x,maxY:A.y};P.minX=Math.min(P.minX,A.x),P.minY=Math.min(P.minY,A.y),P.maxX=Math.max(P.maxX,A.x),P.maxY=Math.max(P.maxY,A.y),v.set(x.id,P)}continue}if(T!=="free")continue;let L=null,I=null;if(t.view==="preview"?p!=null&&p.has(S.label)?(L=Gl,I=ql):(L=jl,I=Ul):E!=="public"&&(L=t.markerFor(E).color,I=Wl),!L)continue;const M=t.host.worldToScreen({x:S.x,y:S.y});if(M&&!(M.x<-d||M.y<-d||M.x>o+d||M.y>a+d)){if(m){const x=t.host.sectionOfLabel(S.label);if(x){var w;const A=(w=m.get(x.id))!==null&&w!==void 0?w:{label:x.label,minX:M.x,minY:M.y,maxX:M.x,maxY:M.y};A.minX=Math.min(A.minX,M.x),A.minY=Math.min(A.minY,M.y),A.maxX=Math.max(A.maxX,M.x),A.maxY=Math.max(A.maxY,M.y),m.set(x.id,A)}}if(l.fillStyle=L,t.view==="preview"||E!=="public"){var C;const x=Math.max(2,u+Math.min(1.5,u*.06));l.globalAlpha=1,l.beginPath(),l.arc(M.x,M.y,x,0,Math.PI*2),l.fill(),l.strokeStyle=(C=I)!==null&&C!==void 0?C:L,l.lineWidth=t.view==="preview"?Math.max(1,Math.min(1.75,d*.13)):Math.max(1,Math.min(1.5,d*.1)),l.stroke(),t.view==="preview"&&(p!=null&&p.has(S.label))&&d>=22&&mm(l,S.label,M.x,M.y,x)}else l.globalAlpha=.85,l.fillRect(M.x-u,M.y-u,d,d)}}l.globalAlpha=1,m&&bm(l,m),gm(v,t),ym(f,t,l)}function mm(t,e,i,s,n){const o=n*1.55;let a=Math.min(13,Math.max(7,n*.55));const r=6;for(;a>=r&&(t.font=`800 ${a}px var(--slm-font, system-ui, sans-serif)`,!(t.measureText(e).width<=o));)a-=.5;as.remove()),!!t))for(const[s,n]of t){const o=n.maxX-n.minX,a=n.maxY-n.minY;if(o<20||a<20)continue;const r=document.createElement("button");r.type="button",r.className="slm-ch-section-target",r.style.left=`${n.minX-8}px`,r.style.top=`${n.minY-8}px`,r.style.width=`${o+16}px`,r.style.height=`${a+16}px`,r.setAttribute("aria-label",`Open ${n.label} seats`),r.addEventListener("click",()=>e.onSectionTargetClick(s)),i.appendChild(r)}}function bm(t,e){for(const i of e.values()){const s=i.maxX-i.minX,n=i.maxY-i.minY;if(s<52||n<26)continue;const o=(i.minX+i.maxX)/2,a=(i.minY+i.maxY)/2,r=Math.max(11,Math.min(15,n*.16));t.font=`800 ${r}px var(--slm-font, system-ui, sans-serif)`;const l=Math.min(s-8,t.measureText(i.label).width+18),c=r+10;t.fillStyle="rgba(11, 16, 28, .88)",t.fillRect(o-l/2,a-c/2,l,c),t.fillStyle="#f8fafc",t.textAlign="center",t.textBaseline="middle",t.fillText(i.label,o,a)}}function ym(t,e,i){const s=e.layer;if(!s||(s.querySelectorAll(".slm-ch-flag").forEach(a=>a.remove()),e.view==="preview"))return;const n=[...t.entries()].sort((a,r)=>r[1].n-a[1].n).slice(0,Vl);for(const[a,r]of n){var o;const l=(o=e.list)===null||o===void 0?void 0:o.channels.find(h=>h.id===a);if(!l)continue;const c=e.host.worldToScreen({x:r.x/r.n,y:r.y/r.n});if(!c)continue;const d=e.markerFor(a),u=document.createElement("span");u.className="slm-ch-flag",u.style.left=`${c.x}px`,u.style.top=`${c.y}px`,u.innerHTML=`${H(d.letter)}${H(l.name)}${l.state==="paused"?" · Paused":""}`,s.appendChild(u)}}var Vl,Gl,ql,jl,Ul,Wl,km=rt((()=>{po(),vo(),Vl=8,Gl="#6e7bff",ql="#b9c0ff",jl="#303846",Ul="#4b5669",Wl="#101723"})),Kl,wm=rt((()=>{Kl='.slm{--slm-mo-instant:80ms;--slm-mo-quick:.14s;--slm-mo-base:.2s;--slm-mo-slow:.32s;--slm-mo-ambient:2s;--slm-mo-out:cubic-bezier(.2,.8,.2,1);--slm-mo-in-out:cubic-bezier(.4,0,.2,1);--slm-mo-exit:cubic-bezier(.4,0,1,1);--slm-mo-spring:cubic-bezier(.34,1.3,.64,1)}.slm-ch-layer{position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity var(--slm-mo-base) var(--slm-mo-out)}.slm-ch-layer.on{opacity:1}.slm-ch-canvas{position:absolute;inset:0;width:100%;height:100%}.slm-ch-flag{position:absolute;display:flex;align-items:center;gap:5px;padding:3px 8px;border-radius:999px;background:#0e1017e0;border:1px solid var(--slm-line);font-size:10px;font-weight:800;letter-spacing:.04em;transform:translate(-50%,-50%);white-space:nowrap}.slm-ch-flag .mk{width:14px;height:14px;border-radius:4px;display:grid;place-items:center;font-size:8.5px;font-weight:800;color:#0e1017}.slm-ch-section-target{position:absolute;pointer-events:auto;padding:0;border:0;border-radius:8px;background:transparent;cursor:zoom-in}.slm-ch-section-target:focus-visible{outline:2px solid var(--slm-accent);outline-offset:-3px;background:color-mix(in srgb,var(--slm-accent) 12%,transparent)}.slm-ch-banner{position:absolute;left:50%;top:14px;z-index:6;display:flex;align-items:center;gap:9px;padding:8px 14px;border-radius:999px;background:#0e1017eb;border:1px solid var(--slm-line);font-size:12px;font-weight:700;transform:translate(-50%,-8px);opacity:0;pointer-events:none;transition:opacity var(--slm-mo-base) var(--slm-mo-out),transform var(--slm-mo-base) var(--slm-mo-out)}.slm-ch-banner.on{opacity:1;transform:translate(-50%);pointer-events:auto}.slm-ch-banner .dot{width:8px;height:8px;border-radius:50%}.slm-ch-banner button{color:var(--slm-accent);font-weight:800;font-size:11.5px;min-height:32px}.slm.ch-preview .slm-ch-flag{opacity:0;transition:opacity var(--slm-mo-base) var(--slm-mo-out)}.slm-ch-staged{position:absolute;left:12px;right:12px;bottom:12px;z-index:6;display:flex;align-items:center;gap:12px;padding:10px 14px;min-height:44px;border-radius:12px;background:#181b24f5;border:1px solid var(--slm-line);box-shadow:0 12px 34px #00000073;font-size:12.5px;pointer-events:auto;transform:translateY(calc(100% + 18px));opacity:0;transition:transform var(--slm-mo-slow) var(--slm-mo-out),opacity var(--slm-mo-base) var(--slm-mo-out)}.slm-ch-staged.on{transform:none;opacity:1}.slm-ch-staged.done{background:#1f7a4df5;border-color:#1f7a4d}.slm-ch-staged.shake{animation:slm-ch-shake var(--slm-mo-slow) var(--slm-mo-in-out) 2}.slm-ch-staged b{font-variant-numeric:tabular-nums}.slm-ch-staged .grow{flex:1}.slm-ch-staged .go{padding:9px 16px;min-height:44px;display:inline-flex;align-items:center;border-radius:9px;background:#f4b740;color:#1a1200;font-weight:800;font-size:12.5px}.slm-ch-staged .go:disabled{opacity:.48;cursor:not-allowed}.slm-ch-staged .drop{color:var(--slm-muted);font-weight:700;font-size:11.5px;min-height:44px;padding-inline:8px}.slm-ch-tick{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;background:#fff;color:#1f7a4d;font-weight:900;font-size:11px;animation:slm-ch-tick var(--slm-mo-base) var(--slm-mo-spring)}@keyframes slm-ch-shake{0%,to{transform:none}25%{transform:translate(-4px)}75%{transform:translate(4px)}}@keyframes slm-ch-tick{0%{transform:scale(.4);opacity:0}to{transform:scale(1);opacity:1}}.slm-ch-viewseg{display:flex;gap:3px;padding:3px;border:1px solid var(--slm-line);border-radius:9px;background:var(--slm-surface);margin-bottom:12px}.slm-ch-viewseg button{flex:1;padding:6px 8px;min-height:34px;border-radius:7px;font-size:11px;font-weight:800;color:var(--slm-muted)}.slm-ch-viewseg button.on{background:var(--slm-accent);color:var(--slm-accent-ink)}.slm-ch-viewseg button:disabled{opacity:.5;cursor:not-allowed}.slm-ch-mapnav{margin:-2px 0 12px;padding:10px;border:1px solid var(--slm-line);border-radius:10px;background:var(--slm-surface)}.slm-ch-mapnav-head{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--slm-muted)}.slm-ch-mapnav-head button{color:var(--slm-accent);font-size:11px;font-weight:800;letter-spacing:0;text-transform:none;min-height:30px}.slm-ch-mapnav .slm-ch-viewseg{margin:8px 0 5px}.slm-ch-mapnav p{margin:0;font-size:11px;line-height:1.45;color:var(--slm-muted)}.slm-ch-list{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}.slm-ch-row{padding:10px 11px;border:1px solid var(--slm-line);border-radius:10px;background:var(--slm-surface);text-align:left;width:100%;display:block;transition:border-color var(--slm-mo-quick) var(--slm-mo-out)}.slm-ch-row:hover{border-color:var(--slm-muted)}.slm-ch-row.on{border-color:var(--slm-accent);box-shadow:0 0 0 1px color-mix(in srgb,var(--slm-accent) 40%,transparent)}.slm-ch-row.public{background:linear-gradient(100deg,rgba(244,183,64,.09),var(--slm-surface) 60%)}.slm-ch-row.archived{opacity:.68}.slm-ch-head{display:flex;align-items:center;gap:8px}.slm-ch-mk{width:20px;height:20px;border-radius:6px;display:grid;place-items:center;font-size:10px;font-weight:800;color:#0e1017;flex:none}.slm-ch-mk.dim{opacity:.55}.slm-ch-name{flex:1;min-width:0;font-size:13px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slm-ch-badge{flex:none;font-size:9px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;padding:2px 7px;border-radius:999px}.slm-ch-badge.active{background:#22a06b29;color:#5bd39b}.slm-ch-badge.paused,.slm-ch-badge.builtin{background:#f4b74026;color:#f7ca6b}.slm-ch-badge.archived{background:#8b94ac2e;color:#c2c9d8}.slm-ch-counts{display:flex;gap:10px;flex-wrap:wrap;margin-top:7px;font-size:11px;color:var(--slm-muted);font-variant-numeric:tabular-nums}.slm-ch-counts b{color:var(--slm-text);font-weight:800}.slm-ch-counts .free b{color:#5bd39b}.slm-ch-counts b.bump{animation:slm-ch-bump var(--slm-mo-base) var(--slm-mo-spring)}@keyframes slm-ch-bump{0%,to{transform:none}35%{transform:translateY(-2px) scale(1.08)}}.slm-ch-access{margin-top:6px;font-size:10.5px;color:var(--slm-muted)}.slm-ch-row.open{cursor:pointer}.slm-ch-row.open:hover{border-color:var(--slm-accent);background:color-mix(in srgb,var(--slm-accent) 6%,var(--slm-surface))}.slm-ch-row.open:focus-visible{outline:2px solid var(--slm-accent);outline-offset:2px}.slm-ch-row.open:active{border-color:var(--slm-accent)}.slm-ch-more{flex:none;color:var(--slm-muted);font-weight:800;padding:0 4px;min-height:28px;border-radius:6px}.slm-ch-more:hover{color:var(--slm-text)}.slm-ch-more:focus-visible{outline:2px solid var(--slm-accent);outline-offset:1px;color:var(--slm-text)}.slm-ch-menu{display:flex;flex-direction:column;gap:8px}.slm-ch-menu .slm-btn{width:100%}.slm-ch-busy{display:flex;align-items:center;gap:9px;font-size:12.5px;color:var(--slm-muted);padding:12px 0}.slm-ch-busy:before{content:"";width:9px;height:9px;border-radius:50%;background:var(--slm-accent);flex:none;animation:slm-ch-pulse var(--slm-mo-ambient) var(--slm-mo-in-out) infinite}@keyframes slm-ch-pulse{0%,to{opacity:.25;transform:scale(.7)}50%{opacity:1;transform:scale(1)}}.slm-ch-selsrc{display:flex;flex-direction:column;gap:5px;margin:8px 0 12px}.slm-ch-selsrc-row{display:flex;align-items:center;gap:8px;font-size:12px;font-variant-numeric:tabular-nums}.slm-ch-selsrc-row .mk{width:15px;height:15px;border-radius:4px;display:grid;place-items:center;font-size:8px;font-weight:800;color:#0e1017}.slm-ch-selsrc-row b{min-width:30px;text-align:right;font-weight:800}.slm-ch-selsrc-row span{color:var(--slm-muted)}.slm-ch-selnum.bump{animation:slm-ch-bump var(--slm-mo-base) var(--slm-mo-spring)}.slm-ch-row2{display:flex;gap:8px;margin-top:8px}.slm-ch-row2 .slm-btn{flex:1;min-width:0}.slm-ch-price-summary{display:flex;align-items:center;gap:10px;padding:11px;border:1px solid var(--slm-line);border-radius:10px;background:var(--slm-surface);font-size:11.5px;line-height:1.45;color:var(--slm-muted)}.slm-ch-price-summary span{flex:1;min-width:0}.slm-ch-price-summary .slm-btn{flex:none;min-height:36px;padding:7px 10px}.slm-ch-dist{display:flex;flex-direction:column;gap:6px;padding:12px;margin-bottom:8px;border:1px solid var(--slm-line);border-radius:10px;background:var(--slm-surface)}.slm-ch-dist.on{border-color:var(--slm-accent,#8b7cf6)}.slm-ch-dist b{font-size:13px;font-weight:800;display:flex;align-items:center;gap:8px;justify-content:space-between}.slm-ch-dist b .cur{font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--slm-accent,#8b7cf6);white-space:nowrap}.slm-ch-dist .why{color:var(--slm-muted);font-size:11.5px;line-height:1.45}.slm-ch-dist .slm-btn{width:100%;margin-top:2px}.slm-ch-alert{display:flex;align-items:flex-start;gap:9px;padding:11px 13px;border-radius:10px;font-size:12.5px;line-height:1.5;margin-bottom:12px}.slm-ch-alert.warn{background:#f4b7401a;border:1px solid rgba(244,183,64,.4);color:#f4d58a}.slm-ch-alert.info{background:#6e7bff1f;border:1px solid rgba(110,123,255,.44);color:#c5cbff}.slm-ch-alert.err{background:#e5484d1a;border:1px solid rgba(229,72,77,.45);color:#f1a4a6}.slm-ch-alert b{color:#fff}.slm-ch-alert button{display:block;margin-top:6px;color:#fff;font-weight:800;min-height:36px}.slm-ch-legend{display:flex;flex-direction:column;gap:6px;margin-top:10px}.slm-ch-legend .r{display:flex;align-items:center;gap:9px;font-size:12px;color:var(--slm-muted)}.slm-ch-legend .sw{width:13px;height:13px;border-radius:3.5px;flex:none}.slm-ch-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.slm-ch-scrim{position:absolute;inset:0;z-index:12;background:#04060c9e;display:grid;place-items:center;padding:18px;animation:slm-ch-fade var(--slm-mo-quick) var(--slm-mo-out)}.slm-ch-dialog{width:min(460px,100%);max-height:100%;overflow:auto;overscroll-behavior:contain;background:#12151f;border:1px solid var(--slm-line);border-radius:14px;padding:20px;box-shadow:0 24px 70px #0009;animation:slm-ch-rise var(--slm-mo-base) var(--slm-mo-out)}.slm-ch-dialog h3{margin:0 0 4px;font-size:16px;font-weight:800;letter-spacing:-.01em}.slm-ch-dialog .sub{font-size:12.5px;color:var(--slm-muted);line-height:1.5;margin-bottom:14px}.slm-ch-dialog .foot{display:flex;gap:8px;margin-top:16px}.slm-ch-dialog .foot .slm-btn{flex:1;min-width:0}.slm-ch-dialog .foot .quiet{flex:none;padding:10px 14px;min-height:44px;color:var(--slm-muted);font-weight:700;font-size:13px}@keyframes slm-ch-fade{0%{opacity:0}to{opacity:1}}@keyframes slm-ch-rise{0%{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}.slm-ch-bucket{display:grid;grid-template-columns:24px 1fr auto;align-items:center;gap:10px;padding:9px 4px;border-top:1px solid var(--slm-line);font-size:12.5px;animation:slm-ch-bucket var(--slm-mo-base) var(--slm-mo-out) both}.slm-ch-bucket:first-of-type{border-top:0}.slm-ch-bucket .ico{width:20px;height:20px;border-radius:6px;display:grid;place-items:center;font-size:10px;font-weight:800}.slm-ch-bucket .ico.add{background:#22a06b2e;color:#5bd39b}.slm-ch-bucket .ico.move{background:#a78bfa2e;color:#c4b5fd}.slm-ch-bucket .ico.same{background:#8b94ac24;color:#aab2c4}.slm-ch-bucket .ico.skip{background:#f4b74029;color:#f7ca6b}.slm-ch-bucket b{font-variant-numeric:tabular-nums;font-weight:800}.slm-ch-bucket .why{color:var(--slm-muted);font-size:11px}.slm-ch-bucket .peek{color:var(--slm-muted);font-size:11px;font-variant-numeric:tabular-nums}@keyframes slm-ch-bucket{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.slm-ch-secret{display:flex;align-items:center;gap:8px;padding:10px 12px;border:1px dashed rgba(244,183,64,.55);border-radius:10px;background:#f4b7400f;font-family:ui-monospace,Menlo,monospace;font-size:11px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.slm-ch-err{color:#f1a4a6;font-size:11.5px;margin-top:6px}.slm-ch-price-list{display:flex;flex-direction:column;gap:7px}.slm-ch-price-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(100px,132px);align-items:center;gap:12px;padding:9px 0;border-bottom:1px solid var(--slm-line)}.slm-ch-price-row:last-child{border-bottom:0}.slm-ch-price-row>span{min-width:0;display:flex;flex-direction:column;gap:3px}.slm-ch-price-row b{font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slm-ch-price-row small{font-size:10.5px;color:var(--slm-muted);font-weight:500}.slm-ch-price-row .slm-input{margin:0;text-align:right;font-variant-numeric:tabular-nums}.slm-ch-link{padding:10px 11px;border:1px solid var(--slm-line);border-radius:10px;background:var(--slm-surface);margin-bottom:8px}.slm-ch-link .lk-head{display:flex;align-items:center;gap:8px}.slm-ch-link .lk-name{flex:1;min-width:0;font-size:12.5px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.slm-ch-lkrow{display:flex;gap:8px;margin-top:5px;font-size:11px;color:var(--slm-muted)}.slm-ch-lkrow .k{flex:none;min-width:104px}.slm-ch-lkrow .v{color:var(--slm-text);font-variant-numeric:tabular-nums}.slm-ch-meter{height:5px;border-radius:3px;background:#ffffff17;overflow:hidden;margin-top:8px}.slm-ch-meter i{display:block;height:100%;background:var(--slm-accent);transition:width var(--slm-mo-base) var(--slm-mo-out)}.slm-ch-radio{display:flex;gap:9px;align-items:flex-start;padding:11px 12px;border:1px solid var(--slm-line);border-radius:10px;margin-top:8px;font-size:12.5px;cursor:pointer;transition:border-color var(--slm-mo-quick) var(--slm-mo-out)}.slm-ch-radio:hover{border-color:var(--slm-muted)}.slm-ch-radio input{flex:none;margin-top:2px}.slm-ch-radio b{display:block;font-weight:800;margin-bottom:2px}.slm-ch-radio .why{display:block;color:var(--slm-muted);font-size:11.5px;line-height:1.45}.slm-ch-seatlist{max-height:44vh;overflow:auto;overscroll-behavior:contain;border:1px solid var(--slm-line);border-radius:10px;background:var(--slm-surface);margin-top:10px}.slm-ch-seatgroup{padding:8px 10px;border-bottom:1px solid var(--slm-line);display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;font-weight:800;color:var(--slm-muted);position:sticky;top:0;background:var(--slm-surface)}.slm-ch-seatgroup button{color:var(--slm-accent);font-weight:800;font-size:11px;min-height:32px}.slm-ch-seatitem{display:flex;width:100%;align-items:center;gap:9px;padding:8px 10px;border-bottom:1px solid var(--slm-line);text-align:left;font-size:12px}.slm-ch-seatitem .box{width:16px;height:16px;border-radius:4px;border:1px solid var(--slm-muted);display:grid;place-items:center;font-size:10px;font-weight:900;color:transparent;flex:none}.slm-ch-seatitem[aria-checked=true] .box{border-color:var(--slm-accent);background:var(--slm-accent);color:var(--slm-accent-ink)}.slm-ch-seatitem .meta{margin-left:auto;color:var(--slm-muted);font-size:10.5px}.slm-ch-scopebar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:10px;margin-top:12px}.slm-ch-scopebar label{display:grid;gap:5px;color:var(--slm-muted);font-size:10.5px;font-weight:800}.slm-ch-scopebar input{width:100%;min-height:40px;padding:8px 10px;border:1px solid var(--slm-line);border-radius:8px;background:var(--slm-surface);color:var(--slm-text);font:inherit}.slm-ch-scopesummary{padding-bottom:10px;color:var(--slm-muted);font-size:11px;font-variant-numeric:tabular-nums;white-space:nowrap}.slm-ch-scopegroup{position:sticky;top:0;z-index:1;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px;padding:6px 8px;border-bottom:1px solid var(--slm-line);background:var(--slm-surface)}.slm-ch-groupcheck{display:flex;min-width:0;align-items:center;gap:8px;padding:5px 2px;text-align:left;font-size:11px;font-weight:800}.slm-ch-groupcheck .box{width:16px;height:16px;flex:none;display:grid;place-items:center;border:1px solid var(--slm-muted);border-radius:4px;color:transparent;font-size:10px}.slm-ch-groupcheck[aria-checked=true] .box,.slm-ch-groupcheck[aria-checked=mixed] .box{border-color:var(--slm-accent);background:var(--slm-accent);color:var(--slm-accent-ink)}.slm-ch-groupcheck .meta{min-width:0;margin-left:auto;color:var(--slm-muted);font-size:10.5px;font-weight:600;white-space:nowrap}.slm-ch-grouptoggle{min-height:32px;padding:5px 8px;color:var(--slm-accent);font-size:11px;font-weight:800}.slm-ch-scopehint{padding:8px 10px;color:var(--slm-muted);font-size:10.5px;border-bottom:1px solid var(--slm-line)}.slm-ch-scope-empty{padding:18px 12px;color:var(--slm-muted);font-size:11.5px;text-align:center}@media(max-width:560px){.slm-ch-scopebar{grid-template-columns:1fr}.slm-ch-scopesummary{padding-bottom:0}}.slm.compact.ch-sheet .slm-rail{position:absolute;left:0;right:0;bottom:0;z-index:8;border-top:1px solid var(--slm-line);border-radius:18px 18px 0 0;background:#12151f;transition:height var(--slm-mo-slow) var(--slm-mo-in-out)}.slm.compact.ch-sheet.detent-collapsed .slm-rail{height:132px}.slm.compact.ch-sheet.detent-medium .slm-rail{height:46%}.slm.compact.ch-sheet.detent-full .slm-rail{height:92%}.slm.compact.ch-sheet .slm-railscroll{padding:8px 14px calc(12px + env(safe-area-inset-bottom,0px))}.slm-ch-grab{display:none}.slm.compact.ch-sheet .slm-ch-grab{display:flex;align-items:center;gap:10px;width:100%;padding:6px 0 10px}.slm-ch-grabbar{width:42px;height:4px;border-radius:2px;background:#ffffff38;margin:0 auto}.slm.compact .slm-ch-staged{bottom:auto;top:8px}.slm.compact .slm-btn,.slm.compact .slm-ch-row,.slm.compact .slm-ch-viewseg button{min-height:44px}@media(prefers-reduced-motion:reduce){.slm-ch-layer,.slm-ch-banner,.slm-ch-staged,.slm-ch-row,.slm.compact.ch-sheet .slm-rail,.slm-ch-meter i,.slm-ch-radio{transition:none!important}.slm-ch-staged.shake,.slm-ch-tick,.slm-ch-bucket,.slm-ch-scrim,.slm-ch-dialog,.slm-ch-counts b.bump,.slm-ch-selnum.bump{animation:none!important}.slm-ch-busy:before{animation:none!important;opacity:1}.slm-ch-staged.shake{outline:2px solid #e5484d;outline-offset:2px}.slm-ch-staged.done{outline:2px solid #5bd39b;outline-offset:2px}}'})),xm=Ui({CHANNELS_CSS:()=>Kl,ChannelsMode:()=>go,bucketRowsHtml:()=>fo}),Yl,mo,Me,go,Xl=rt((()=>{po(),to(),km(),vo(),wm(),Yl=3e4,mo=300,Me=5e3,go=class{constructor(t,e){this.active=!1,this.list=null,this.allocation=new Map,this.assignmentVersion=0,this.loadError=null,this.loading=!0,this.view="inspect",this.mapIntent="pan",this.focusedSectionId=null,this.showArchived=!1,this.detailChannelId=null,this.assignOpen=!1,this.targetChannelId="",this.conflict=!1,this.dialog=null,this.detent="medium",this.seatListLimit=mo,this.links=[],this.linksChannelId=null,this.linksState="idle",this.listSeq=0,this.linksSeq=0,this.previewAudience=[],this.previewIncludePublic=!1,this.previewProjection=null,this.previewState="idle",this.pollTimer=null,this.layer=null,this.canvas=null,this.ctx=void 0,this.bannerEl=null,this.stagedEl=null,this.liveEl=null,this.scrimEl=null,this.lastFocus=null,this.stagedDoneTimer=null,this.lastSelectionCount=0,this.lastCounts=new Map,this.assignmentRowsCache=null,this.railHtml=null,this.allocationVersion=null,this.onVisibility=null,this.host=t,this.caps=e}enter(){var t;this.active||(this.active=!0,this.mapIntent="pan",this.assignOpen=!1,this.focusedSectionId=null,this.assignmentRowsCache=null,this.railHtml=null,this.ensureLayer(),this.host.root.classList.add("ch-mode"),this.applySheetClasses(),this.host.sections().length>1&&this.host.showSectionOverview(),this.paintRail(),(t=this.onInteractionChange)===null||t===void 0||t.call(this),this.refresh(),this.pollTimer=setInterval(()=>{typeof document!="undefined"&&document.hidden||this.refresh({quiet:!0})},Yl),typeof document!="undefined"&&typeof document.addEventListener=="function"&&(this.onVisibility=()=>{this.active&&!document.hidden&&this.refresh({quiet:!0})},document.addEventListener("visibilitychange",this.onVisibility)))}leave(){var t;this.active&&(this.active=!1,this.pollTimer&&clearInterval(this.pollTimer),this.pollTimer=null,this.onVisibility&&typeof document!="undefined"&&document.removeEventListener("visibilitychange",this.onVisibility),this.onVisibility=null,this.railHtml=null,this.closeDialog({restoreFocus:!1}),this.links=[],this.linksChannelId=null,this.linksState="idle",(t=this.layer)===null||t===void 0||t.classList.remove("on"),this.host.root.classList.remove("ch-mode","ch-preview","ch-sheet","detent-collapsed","detent-medium","detent-full"),this.setBanner(!1),this.setStaged(null))}destroy(){var t;this.leave(),this.stagedDoneTimer&&clearTimeout(this.stagedDoneTimer),(t=this.layer)===null||t===void 0||t.remove(),this.layer=null}setCapabilities(t){this.caps=t,this.active&&this.paintRail()}isActive(){return this.active}canSelect(){return this.caps.manage&&this.view==="inspect"}usesMarqueeSelection(){return this.canSelect()&&this.mapIntent==="assign"}handleSectionFocus(t){this.active&&(this.focusedSectionId=t,this.paintRail())}applyRealtimeHint(){this.active&&this.refresh({quiet:!0})}handleSelectionChange(){this.active&&(this.paintSelection(),this.paintStagedBar())}handleViewChange(){this.active&&this.paintOverlay()}handleLayoutChange(){this.active&&(this.applySheetClasses(),this.paintOverlay())}async refresh(t={}){if(!this.caps.view)return;const e=++this.listSeq,i=()=>e!==this.listSeq;try{const o=await this.host.api.channels(this.host.eventKey,{includeArchived:this.showArchived});if(i())return;if(this.list=o,this.assignmentVersion=o.assignmentVersion,this.loadError=null,!this.targetChannelId){var s,n;this.targetChannelId=(s=(n=o.channels.find(a=>a.state==="active"))===null||n===void 0?void 0:n.id)!==null&&s!==void 0?s:Ue}if(this.allocationVersion!==o.assignmentVersion){if(await this.loadAllocation(e),i())return;this.allocationVersion=o.assignmentVersion}if(this.detailChannelId&&await this.loadLinks(this.detailChannelId),i())return;this.loading=!1,this.active&&(this.paintRail(),this.paintOverlay())}catch(o){if(i())return;this.loading=!1,o instanceof he&&o.status===403&&(this.caps={view:!1,manage:!1}),this.loadError=o,t.quiet||this.host.onError(o),this.active&&this.paintRail()}}async loadAllocation(t){const e=new Map;let i;for(let s=0;s<200;s+=1){if(t!==void 0&&t!==this.listSeq)return;const n=await this.host.api.channelAllocation(this.host.eventKey,{afterLabel:i,limit:1e3});for(const o of n.allocations)gt(o.channelId)||e.set(o.label,o.channelId);if(this.assignmentVersion=n.assignmentVersion,!n.nextAfterLabel)break;i=n.nextAfterLabel}t!==void 0&&t!==this.listSeq||(this.allocation=e)}channelById(t){var e;if(gt(t)){var i,s;return{id:Ue,name:(i=(s=this.list)===null||s===void 0||(s=s.publicSale)===null||s===void 0?void 0:s.name)!==null&&i!==void 0?i:ze,marker:"P",color:null}}const n=(e=this.list)===null||e===void 0?void 0:e.channels.find(o=>o.id===t);return n?{id:t,name:n.name,marker:n.marker,color:n.color}:null}nameOf(t){var e,i;return(e=(i=this.channelById(t))===null||i===void 0?void 0:i.name)!==null&&e!==void 0?e:null}markerFor(t){var e,i;const s=Math.max(0,(e=(i=this.list)===null||i===void 0?void 0:i.channels.findIndex(o=>o.id===t))!==null&&e!==void 0?e:0),n=this.channelById(t);return El(n!=null?n:{id:t,name:"?",marker:null,color:null},s)}assignableChannels(){var t,e,i,s;return[{id:Ue,name:(t=(e=this.list)===null||e===void 0?void 0:e.publicSale.name)!==null&&t!==void 0?t:ze},...((i=(s=this.list)===null||s===void 0?void 0:s.channels)!==null&&i!==void 0?i:[]).filter(n=>n.state!=="archived").map(n=>({id:n.id,name:n.name}))]}currentPlan(){const t=this.host.selectionLabels();return{labels:t,buckets:Ml({labels:t,targetChannelId:this.targetChannelId,allocation:this.allocation,statusOf:e=>this.host.statusOf(e),nameOf:e=>this.nameOf(e)}),target:this.targetChannelId}}ensureLayer(){if(this.layer)return;const t=document.createElement("div");t.className="slm-ch-layer",t.innerHTML=` - -
-
-
`,this.host.mapLayer.appendChild(t),this.layer=t,this.canvas=t.querySelector('[data-ch="canvas"]'),this.bannerEl=t.querySelector('[data-ch="banner"]'),this.stagedEl=t.querySelector('[data-ch="staged"]'),this.liveEl=t.querySelector('[data-ch="live"]'),requestAnimationFrame(()=>t.classList.add("on"))}announce(t){this.liveEl&&(this.liveEl.textContent=t)}paintOverlay(){const t=this.canvas,e=this.layer;!t||!e||vm({layer:e,canvas:t,resolveCtx:()=>{if(this.ctx===void 0)try{this.ctx=t.getContext("2d")}catch{this.ctx=null}return this.ctx},host:this.host,view:this.view,previewProjection:this.previewProjection,allocation:this.allocation,focusedSectionId:this.focusedSectionId,list:this.list,markerFor:i=>this.markerFor(i),onSectionTargetClick:i=>{this.focusedSectionId=i,this.host.focusSection(i),this.paintRail()}})}setStaged(t,e=""){const i=this.stagedEl;if(i){if(!t){i.classList.remove("on","done","shake"),i.innerHTML="";return}i.innerHTML=t,i.className=`slm-ch-staged on${e?` ${e}`:""}`}}paintStagedBar(){var t,e,i,s;if(!this.active||this.view==="preview"||!this.caps.manage){this.setStaged(null);return}const{labels:n,buckets:o}=this.currentPlan();if((t=(e=this.host).onStagedChange)===null||t===void 0||t.call(e,Os(o)),!n.length){this.setStaged(null);return}const a=(i=this.nameOf(this.targetChannelId))!==null&&i!==void 0?i:ze,r=Os(o),l=n.length>Me,c=o.skippedHeld.count+o.skippedBooked.count,d=[`${n.length.toLocaleString()} selected`,`+${r.toLocaleString()} to ${H(a)}`];o.alreadyInTarget.count&&d.push(`${o.alreadyInTarget.count.toLocaleString()} already in`),c&&d.push(`${c.toLocaleString()} can't move now`),this.setStaged(` - ${d.join(" · ")} - - - `),(s=this.stagedEl)===null||s===void 0||s.querySelectorAll("[data-ch-act]").forEach(u=>{u.addEventListener("click",()=>{u.dataset.chAct==="discard"?this.host.clearSelection():this.openDialog({kind:"review"})})})}setBanner(t,e="",i){var s;const n=this.bannerEl;if(!n)return;if(this.host.root.classList.toggle("ch-preview",t),!t){n.classList.remove("on"),n.innerHTML="";return}const o=this.previewAudience.length===1?this.markerFor(this.previewAudience[0]):{color:"var(--slm-accent)",letter:""},a=i==null?"":` · ${i.toLocaleString()} ${i===1?"seat":"seats"} available now`;n.innerHTML=` - Previewing buyer access · ${H(e)}${a} · read-only - `,n.classList.add("on"),(s=n.querySelector('[data-ch-act="exit-preview"]'))===null||s===void 0||s.addEventListener("click",()=>this.setView("inspect"))}setView(t){var e;if(this.view=t,t==="inspect")this.previewProjection=null,this.previewState="idle",this.setBanner(!1);else{if(!this.previewAudience.length){var i;const s=(i=this.list)===null||i===void 0?void 0:i.channels.find(n=>n.state==="active");this.previewAudience=[s?s.id:Ue]}this.loadPreview()}this.paintRail(),this.paintOverlay(),this.paintStagedBar(),(e=this.onInteractionChange)===null||e===void 0||e.call(this)}async loadPreview(){const t=[...this.previewAudience],e=t.map(o=>{var a;return(a=this.nameOf(o))!==null&&a!==void 0?a:ze}).join(" + ");this.setBanner(!0,e),this.previewProjection=null,this.previewState="loading",this.active&&this.paintRail();try{var i,s,n;this.previewProjection=await this.host.api.channelPreview(this.host.eventKey,t,{includePublic:this.previewIncludePublic||t.some(gt)}),this.previewState="ready";const o=this.previewProjection.available===!1?void 0:(i=(s=this.previewProjection.counts)===null||s===void 0?void 0:s.eligible)!==null&&i!==void 0?i:(n=this.previewProjection.eligible)===null||n===void 0?void 0:n.length;this.setBanner(!0,e,o)}catch(o){const a=o instanceof he?o.status:0;this.previewState=a===404||a===405||a===501?"unsupported":"error",this.previewProjection=null,this.previewState==="error"&&this.host.onError(o)}this.active&&(this.paintRail(),this.paintOverlay())}setRailHtml(t){if(t===this.railHtml)return!1;const e=this.host.rail,i=e.scrollTop;return e.innerHTML=t,this.railHtml=t,i&&(e.scrollTop=i),!0}paintRail(){if(!this.active)return;const t=this.host.rail;if(!this.caps.view){this.setRailHtml(`

Sales channels

-

You need channel-management permission on this event to see allocations.

`);return}if(this.loading&&!this.list){this.setRailHtml(`

Sales channels

-
Loading channels and allocations…
`);return}if(!this.list&&this.loadError){if(this.setRailHtml(`

Sales channels

- `)){var e;(e=t.querySelector('[data-ch-act="retry"]'))===null||e===void 0||e.addEventListener("click",()=>{this.refresh()})}return}const i=this.host.selectionLabels(),s=this.host.isCompact()?'
':"",n=this.viewSegmentHtml(),o=this.view==="preview"?this.previewRailHtml():this.detailChannelId?this.detailRailHtml(this.detailChannelId):i.length&&this.caps.manage?this.selectionRailHtml(i):this.listRailHtml();this.setRailHtml(`${s}${n}${o}`)&&this.wireRail(),this.paintStagedBar()}viewSegmentHtml(){const t=this.view==="inspect"?" on":"",e=this.view==="preview"?" on":"";return`
- - -
${this.mapNavigationHtml()}`}mapNavigationHtml(){var t,e;if(this.host.sections().length<2)return"";const i=this.focusedSectionId?(t=(e=this.host.sections().find(a=>a.id===this.focusedSectionId))===null||e===void 0?void 0:e.label)!==null&&t!==void 0?t:"section":null,s=this.mapIntent==="pan"?" on":"",n=this.mapIntent==="assign"?" on":"",o=this.view==="inspect"&&this.caps.manage?`
- - -
-

${this.mapIntent==="pan"?"Drag to explore. Click a section to open its seats.":"Drag across seats to select them for allocation."}

`:"

Drag to explore. Click a section to open its seats.

";return`
-
${i?`Viewing ${H(i)}`:"Section overview"} -
- ${o} -
`}countsHtml(t,e){const i=(s,n,o,a="")=>{const r=this.lastCounts.get(`${e}:${s}`),l=r!=null&&r!==n?" bump":"";return this.lastCounts.set(`${e}:${s}`,n),`${n.toLocaleString()} ${o}`};return` - ${i("allocated",t.allocated,"allocated")} - ${i("free",t.free,"free","free")} - ${i("booked",t.booked,"sold")} - ${t.held?i("held",t.held,"held"):""} - `}channelRowHtml(t,e={}){const i=this.markerFor(t.id),s=e.builtin?"builtin":t.state,n=t.state==="paused"||t.state==="archived"?" dim":"",o=!e.builtin&&this.caps.manage&&this.detailChannelId!==t.id,a=`slm-ch-row${e.builtin?" public":""}${t.state==="archived"?" archived":""}${this.detailChannelId===t.id?" on":""}${o?" open":""}`,r=!e.builtin&&this.caps.manage?``:"";return`
- - - ${H(t.name)} - ${H(zl(e.builtin?"builtin":t.state))} - ${r} - - ${this.countsHtml(t.counts,t.id||"public")} - ${e.builtin?"":`${H($l(t.access))}`} -
`}listRailHtml(){const t=this.list,e=t.channels.filter(s=>s.state==="archived").length,i=t.channels.filter(s=>this.showArchived||s.state!=="archived");return` -

Sales channels

-

Channel colours and names are only visible to organizers, never to buyers.

-
${[this.channelRowHtml(t.publicSale,{builtin:!0}),...i.map((s,n)=>this.channelRowHtml(s,{index:n}))].join("")}
- ${i.length?"":`

${e&&!this.showArchived?`No open channels — every seat is on public sale. ${e.toLocaleString()} archived channel${e===1?" is":"s are"} hidden below.`:"No private channels yet — every seat is on public sale."}

`} - ${this.caps.manage?'':""} - ${this.caps.manage?"":'

You can see how inventory is allocated. Changing it needs channel-management permission.

'} - ${this.assignEntryHtml()} -

- -

`}assignEntryHtml(){return this.caps.manage?this.assignOpen?`
${this.assignmentToolsHtml({collapsible:!0})}
`:` - -

Move whole sections, rows, a dragged area or single seats out of public sale - and into a channel. Nothing moves until you review and apply.

`:""}assignmentToolsHtml(t={}){const e=this.assignableChannels().map(o=>``).join(""),i=this.host.sections().length?'':"",s=this.assignmentRows().length?'':"",n=this.mapIntent==="assign"?"slm-btn":"slm-btn ghost";return` -

${t.collapsible?``:""}Assign inventory

-
- - -
-

Select by

-
- ${i}${s} - -
-
- - -
-

Choose a destination, then add whole sections, - multiple rows, a dragged area, or individual seats.

`}selectionRailHtml(t){const e=Il(t,this.allocation,this.list),i=this.conflict?``:"",s=t.length!==this.lastSelectionCount?" bump":"";this.lastSelectionCount=t.length;const n=t.length>Me,o=e.map(a=>{const r=this.markerFor(a.channelId);return`
- - ${a.count.toLocaleString()}${H(a.name)}
`}).join("");return` - ${i} - ${this.assignmentToolsHtml()} -
${t.length.toLocaleString()} - selected
-
${o}
- ${n?``:""} -

Changes are staged — nothing moves until you review and apply. - Seats in checkout or already sold are never moved.

-
- - -
-

The seat list offers the same selection with checkboxes for keyboard and screen-reader use.

`}detailRailHtml(t){var e,i,s;const n=`

- -

`,o=(e=this.list)===null||e===void 0?void 0:e.channels.find(d=>d.id===t);if(!o)return`${n} -
- This channel is no longer on this event. It was archived or removed while you had it open. - ${this.showArchived?"":"Archived channels are hidden — use “Show archived” on the list to see it."}
`;const a=this.caps.manage?` -

Lifecycle

-
- - - -
-

Archive returns the allocation to a destination you choose. Nothing is ever deleted silently.

`:"",r=this.caps.manage?this.distributeHtml(o):"",l=(i=(s=o.priceOverrides)===null||s===void 0?void 0:s.length)!==null&&i!==void 0?i:0,c=this.caps.manage&&this.host.api.updateChannelPricing?` -

Prices

-
- ${l?`${l.toLocaleString()} custom price${l===1?"":"s"} override the event price for this channel.`:"This channel uses the event prices."} - -
-

Only buyers admitted to this channel see and pay these prices. Existing holds keep the price already promised.

`:"";return` - ${n} -

Channel · ${H(o.name)}

-
${this.channelRowHtml(o)}
- ${c} - ${r} - ${a}`}distributeHtml(t){var e,i,s;const n=(e=(i=t.access)===null||i===void 0?void 0:i.intent)!==null&&e!==void 0?e:"none",o=((s=t.access)===null||s===void 0?void 0:s.hasActiveGrants)===!0,a=this.linksState!=="unsupported",r=this.links.some(lo),l=n==="none"?"Protected reserve — no route can sell these seats. Every buyer path is refused.":n==="internal"?"Your staff sell these seats. No buyer-facing route is open.":o?n==="server"?"Your website is letting buyers in. Only they can buy these seats.":"A buyer link is live. Only people with that link can buy these seats.":n==="server"?"Set up for your website — no buyer has come through yet. Seats stay reserved.":"Set up for buyer links — no buyer has come through yet. Seats stay reserved.",c=(d,u,h,p)=>{const f=d===n;return`
- ${H(Bt(d))}${f?'Current route':""} - ${H(Ol(d))} - ${f&&!h?"":``} -
`};return` -

Distribute

-

${H(l)}

- ${a?c("hosted_link","link-create",r?"Create another buyer link":"Create buyer link",!0):""} - ${c("server","embed-code",n==="server"?"Get embed code":"Use a website or app",!1)} - ${c("internal","route-internal",n==="internal"?"":"Hand to your staff",!1)} - ${c("none","route-none",n==="none"?"":"Keep as reserve",!1)} - ${this.hostedLinksHtml()} - ${n==="server"?Nl:""}`}async loadLinks(t){if(!this.caps.view)return;const e=++this.linksSeq,i=()=>e!==this.linksSeq||this.linksChannelId!==t;this.linksChannelId!==t&&(this.links=[],this.linksChannelId=t,this.linksState="loading");try{var s;const n=await this.host.api.accessLinks(this.host.eventKey,t);if(i())return;this.links=(s=n.links)!==null&&s!==void 0?s:[],this.linksState="ready"}catch(n){if(i())return;const o=n instanceof he?n.status:0;this.links=[],this.linksState=o===404||o===405||o===501?"unsupported":"error",this.linksState==="error"&&this.host.onError(n)}}hostedLinksHtml(){const t='

Buyer links

';return this.linksState==="unsupported"?`${t}
- Buyer links need a newer server. Everything else on this channel works normally.
`:this.linksState==="error"?`${t}`:this.linksState==="idle"||this.linksState==="loading"&&!this.links.length?`${t}
Loading buyer links…
`:this.links.length?`${t} - ${this.links.map(e=>this.linkCardHtml(e)).join("")} -

A link is shown once, when you create it. SeatLayer keeps only a fingerprint of it, so it - can never be shown again — if a link is lost, rotate it and send the fresh one.

`:""}linkCardHtml(t){const e=Bl(t),i=t.maxRedemptions>0?Math.min(100,Math.round(t.redemptions/t.maxRedemptions*100)):0,s=co(t).map(r=>`
${H(r.k)} - ${H(r.v)}
`).join(""),n=t.activeSessions?`
Buyers inside now - ${t.activeSessions.toLocaleString()}
`:"",o=t.lastRedeemedAt?`
Last opened - ${H(new Date(t.lastRedeemedAt).toLocaleString())}
`:"",a=this.caps.manage&&lo(t)?`
- - -
`:"";return``}previewRailHtml(){var t,e,i,s,n,o,a,r,l,c,d,u;const h=[{id:Ue,name:(t=(e=this.list)===null||e===void 0?void 0:e.publicSale.name)!==null&&t!==void 0?t:ze},...((i=(s=this.list)===null||s===void 0?void 0:s.channels)!==null&&i!==void 0?i:[]).filter(w=>w.state!=="archived").map(w=>({id:w.id,name:w.name}))],p=(n=this.previewAudience[0])!==null&&n!==void 0?n:Ue,f=h.map(w=>``).join(""),v=this.previewState==="unsupported"?`
- Preview needs a newer server. Allocation management works normally; - the buyer-view simulation will appear once this event's API is updated.
`:"",m=this.previewState==="loading"?'
Asking the server what this audience sees…
':"",g=this.previewState==="error"?``:"",b=((o=this.previewProjection)===null||o===void 0?void 0:o.available)===!1?`
- This private sale is not available. ${H(((a=this.previewProjection.unavailable)!==null&&a!==void 0?a:[]).map(w=>{var C;return`${(C=this.nameOf(w.channelId))!==null&&C!==void 0?C:"This channel"} is ${w.state}`}).join("; ")||"The audience cannot buy right now")}. - A buyer arriving with this access sees this message, not these seats.
`:"",y=(r=(l=this.previewProjection)===null||l===void 0||(l=l.counts)===null||l===void 0?void 0:l.eligible)!==null&&r!==void 0?r:(c=this.previewProjection)===null||c===void 0||(c=c.eligible)===null||c===void 0?void 0:c.length,k=y!=null&&((d=this.previewProjection)===null||d===void 0?void 0:d.available)!==!1?`
${y.toLocaleString()} ${y===1?"seat is":"seats are"} available now. - This is the exact buyer-visible allocation.${((u=this.previewProjection)===null||u===void 0?void 0:u.includePublic)===!1?" Public sale seats are not included in this access.":""}
`:"";return` -

Preview buyer access

-
- - -
- ${gt(p)?"":` - `} -

This is the same projection the buyer SDK receives for this audience — not a local - approximation. It is read-only: clicks open seat details, and no holds are created.

- ${m}${g}${v}${b} -
-
Eligible & free — buyable by this audience
-
Unavailable to this audience (one neutral state)
-
Sold — same as any buyer sees
-
- ${k}`}paintSelection(){this.caps.manage&&this.host.selectionLabels().length&&(this.assignOpen=!0),this.view==="inspect"&&!this.detailChannelId&&this.paintRail()}wireRail(){const t=this.host.rail;t.querySelectorAll("[data-ch-view]").forEach(o=>{o.addEventListener("click",()=>this.setView(o.dataset.chView))}),t.querySelectorAll("[data-ch-map]").forEach(o=>{o.addEventListener("click",()=>{var a;this.mapIntent=o.dataset.chMap==="assign"?"assign":"pan",this.mapIntent==="assign"&&(this.assignOpen=!0),this.paintRail(),(a=this.onInteractionChange)===null||a===void 0||a.call(this)})}),t.querySelectorAll("[data-ch-open]").forEach(o=>{const a=()=>this.openChannel(o.dataset.chOpen);o.addEventListener("click",a),o.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "&&r.key!=="Spacebar"||(r.preventDefault(),a())})}),t.querySelectorAll("[data-ch-menu]").forEach(o=>{o.addEventListener("click",a=>{a.stopPropagation(),this.openDialog({kind:"menu",channelId:o.dataset.chMenu})}),o.addEventListener("keydown",a=>{a.stopPropagation()})}),t.querySelectorAll("[data-ch-rotate]").forEach(o=>{o.addEventListener("click",()=>this.openDialog({kind:"linkRotate",channelId:this.detailChannelId,linkId:o.dataset.chRotate}))}),t.querySelectorAll("[data-ch-revoke]").forEach(o=>{o.addEventListener("click",()=>this.openDialog({kind:"linkRevoke",channelId:this.detailChannelId,linkId:o.dataset.chRevoke}))});const e=t.querySelector("[data-ch-target]");e==null||e.addEventListener("change",()=>{this.targetChannelId=e.value,this.conflict=!1,this.paintRail()});const i=t.querySelector("[data-ch-audience]");i==null||i.addEventListener("change",()=>{this.previewAudience=[i.value],this.loadPreview()});const s=t.querySelector("[data-ch-includepublic]");s==null||s.addEventListener("change",()=>{this.previewIncludePublic=s.checked,this.loadPreview()});const n=t.querySelector(".slm-ch-grab");n==null||n.addEventListener("click",()=>this.cycleDetent()),t.querySelectorAll("[data-ch-act]").forEach(o=>{o.addEventListener("click",()=>this.railAction(o.dataset.chAct))})}openChannel(t){this.detailChannelId=t,this.paintRail(),this.loadLinks(t).then(()=>this.paintRail())}railAction(t){switch(t){case"sections":this.focusedSectionId=null,this.host.showSectionOverview(),this.paintRail();break;case"create":this.openDialog({kind:"create"});break;case"review":this.openDialog({kind:"review"});break;case"rename":this.openDialog({kind:"rename",channelId:this.detailChannelId});break;case"pricing":this.openDialog({kind:"pricing",channelId:this.detailChannelId});break;case"archive":this.openDialog({kind:"archive",channelId:this.detailChannelId});break;case"seatlist":this.openDialog({kind:"seatlist"});break;case"pause":this.togglePause();break;case"discard":this.host.clearSelection();break;case"back":this.detailChannelId=null,this.linksChannelId=null,this.links=[],this.linksState="idle",this.paintRail();break;case"link-create":this.openDialog({kind:"linkCreate",channelId:this.detailChannelId});break;case"embed-code":this.chooseWebsiteIntegration();break;case"route-internal":this.setAccessIntent("internal");break;case"route-none":this.setAccessIntent("none");break;case"link-reload":this.detailChannelId&&this.reloadLinks();break;case"retry":this.refresh();break;case"toggle-archived":this.showArchived=!this.showArchived,this.refresh();break;case"refresh-review":this.conflict=!1,this.refresh().then(()=>this.openDialog({kind:"review"}));break;case"pick-sections":this.openDialog({kind:"scope",scope:"sections"});break;case"pick-rows":this.openDialog({kind:"scope",scope:"rows"});break;case"drag-select":var e;this.mapIntent="assign",this.paintRail(),(e=this.onInteractionChange)===null||e===void 0||e.call(this);break;case"pick-category":this.pickCategory();break;case"assign-open":this.assignOpen=!0,this.paintRail();break;case"assign-close":var i;this.assignOpen=!1,this.mapIntent="pan",this.paintRail(),(i=this.onInteractionChange)===null||i===void 0||i.call(this);break;case"preview-retry":this.loadPreview();break;default:break}}assignmentRows(){return this.assignmentRowsCache||(this.assignmentRowsCache=this.host.rows()),this.assignmentRowsCache}pickCategory(){const t=this.host.categories();t.length&&this.promptChoice("Select a whole category",t.map(e=>({value:e.key,label:e.label})),e=>{this.host.selectByLabels(this.host.labelsInCategory(e))})}promptChoice(t,e,i){this.renderScrim(` -

${H(t)}

-
- - -
-
- - -
`,s=>{var n;(n=s.querySelector("[data-ch-confirm]"))===null||n===void 0||n.addEventListener("click",()=>{const o=s.querySelector("#slm-ch-choice"),a=o==null?void 0:o.value;this.closeDialog(),a&&i(a)})})}renderScopeDialog(t){const e=t.scope==="rows"?"rows":"sections",i=(e==="sections"?this.host.sections().map(a=>({id:a.id,label:a.label,group:"Sections",labels:this.host.labelsInSection(a.id)})):this.assignmentRows().map(a=>({id:a.id,label:a.label,group:a.sectionLabel,labels:a.labels}))).filter(a=>a.labels.length>0),s=new Map;for(const a of i){var n;const r=(n=s.get(a.group))!==null&&n!==void 0?n:[];r.push(a),s.set(a.group,r)}if(e==="rows"){const a=[...s.entries()];this.renderScrim(` -

Add multiple rows

-

Sections stay collapsed for speed. Select a whole section, expand only the rows you need, or search across every row.

-
- - 0 rows selected -
-

Showing section groups. Expand one or search to see rows.

-
- -
- - -
`,r=>{const l=new Map(i.map(S=>[S.id,S])),c=new Set,d=new Set,u=new Set(this.host.selectionLabels()),h=r.querySelector("[data-ch-add-scope]"),p=r.querySelector("[data-ch-error]"),f=r.querySelector("[data-ch-scope-list]"),v=r.querySelector("[data-ch-scope-search]"),m=r.querySelector("[data-ch-scope-summary]"),g=r.querySelector("[data-ch-scope-filter]"),b=200;let y="";const k=()=>{var S,T;const E=new Set(u);for(const L of c)for(const I of(S=(T=l.get(L))===null||T===void 0?void 0:T.labels)!==null&&S!==void 0?S:[])E.add(I);return E},w=()=>{const S=k(),T=S.size-u.size,E=S.size>Me;h.disabled=T===0||E,h.textContent=E?`Maximum ${Me.toLocaleString()} seats`:`Add ${T.toLocaleString()} seat${T===1?"":"s"}`,p.hidden=!E,p.textContent=E?`That would make ${S.size.toLocaleString()} selected seats. Choose fewer rows or sections.`:"",m.textContent=`${c.size.toLocaleString()} row${c.size===1?"":"s"} · ${T.toLocaleString()} seat${T===1?"":"s"} added`},C=()=>{const S=[];let T=0,E=0;a.forEach(([L,I],M)=>{const x=L.toLocaleLowerCase(),A=y?I.filter(G=>`${x} ${G.label.toLocaleLowerCase()}`.includes(y)):I;if(y&&!A.length)return;T+=A.length;const P=I.every(G=>c.has(G.id)),N=!P&&I.some(G=>c.has(G.id)),W=!!y||d.has(M),B=Math.max(0,b-E),z=W?A.slice(0,B):[];E+=z.length;const j=I.reduce((G,D)=>G+D.labels.length,0);S.push(`
- - -
`),S.push(...z.map(G=>``)),W&&A.length>z.length&&S.push(`

${(A.length-z.length).toLocaleString()} more row${A.length-z.length===1?"":"s"}. Search to narrow the list.

`)}),f.innerHTML=S.join("")||(y?`
No sections or rows match “${H(y)}”.
`:`
This chart has no rows with selectable seats. - Use Drag box or the seat list instead.
`),g.textContent=y?`Showing ${E.toLocaleString()} of ${T.toLocaleString()} matching rows. Section checkboxes still select every row in that section.`:"Showing section groups. Expand one or search to see rows.",f.querySelectorAll("[data-ch-scope-group]").forEach(L=>L.addEventListener("click",()=>{var I,M;const x=(I=(M=a[Number(L.dataset.chScopeGroup)])===null||M===void 0?void 0:M[1])!==null&&I!==void 0?I:[],A=x.every(P=>c.has(P.id));for(const P of x)A?c.delete(P.id):c.add(P.id);C(),w()})),f.querySelectorAll("[data-ch-scope-toggle]").forEach(L=>L.addEventListener("click",()=>{const I=Number(L.dataset.chScopeToggle);d.has(I)?d.delete(I):d.add(I),C()})),f.querySelectorAll("[data-ch-scope-id]").forEach(L=>L.addEventListener("click",()=>{const I=L.dataset.chScopeId;c.has(I)?c.delete(I):c.add(I),C(),w()}))};v.addEventListener("input",()=>{y=v.value.trim().toLocaleLowerCase(),C(),w()}),h.addEventListener("click",()=>{const S=[...k()];!c.size||S.length>Me||(this.closeDialog(),this.host.selectByLabels(S))}),C(),w()});return}const o=[...s.entries()].map(([a,r])=>` -
${H(a)}
- ${r.map(l=>``).join("")}`).join("");this.renderScrim(` -

Add whole sections

-

Choose one or more. They are added to the seats already selected on the map.

-
${o||`
This chart has no sections with selectable seats. - Use Drag box or the seat list instead.
`}
- -
- - -
`,a=>{const r=new Map(i.map(f=>[f.id,f])),l=new Set,c=new Set(this.host.selectionLabels()),d=a.querySelector("[data-ch-add-scope]"),u=a.querySelector("[data-ch-error]"),h=()=>{var f,v;const m=new Set(c);for(const g of l)for(const b of(f=(v=r.get(g))===null||v===void 0?void 0:v.labels)!==null&&f!==void 0?f:[])m.add(b);return m},p=()=>{const f=h(),v=f.size-c.size,m=f.size>Me;d.disabled=v===0||m,d.textContent=m?`Maximum ${Me.toLocaleString()} seats`:`Add ${v.toLocaleString()} seat${v===1?"":"s"}`,u.hidden=!m,u.textContent=m?`That would make ${f.size.toLocaleString()} selected seats. Choose fewer rows or sections.`:""};a.querySelectorAll("[data-ch-scope-id]").forEach(f=>{f.addEventListener("click",()=>{const v=f.dataset.chScopeId;l.has(v)?l.delete(v):l.add(v),f.setAttribute("aria-checked",String(l.has(v))),p()})}),d.addEventListener("click",()=>{const f=[...h()];!l.size||f.length>Me||(this.closeDialog(),this.host.selectByLabels(f))}),p()})}openDialog(t){this.dialog=t,this.renderDialog()}renderDialog(){const t=this.dialog;t&&(t.kind==="create"?this.renderCreateDialog(t):t.kind==="review"?this.renderReviewDialog(t):t.kind==="scope"?this.renderScopeDialog(t):t.kind==="archive"?this.renderArchiveDialog(t):t.kind==="rename"?this.renderRenameDialog(t):t.kind==="pricing"?this.renderPricingDialog(t):t.kind==="seatlist"?this.renderSeatListDialog():t.kind==="menu"?this.renderMenuDialog(t):t.kind==="linkCreate"?this.renderLinkCreateDialog(t):t.kind==="linkRotate"?this.renderLinkRotateDialog(t):t.kind==="linkRevoke"?this.renderLinkRevokeDialog(t):t.kind==="intentSwitch"&&this.renderIntentSwitchDialog(t))}renderIntentSwitchDialog(t){var e,i;const s=(e=this.list)===null||e===void 0?void 0:e.channels.find(r=>r.id===t.channelId),n=t.intentTo;if(!s||!n||!this.caps.manage){this.closeDialog();return}const{headline:o,consequences:a}=Fl(t.switchBlocked);this.renderScrim(` -

Change how ${H(s.name)} reaches buyers?

-

${H(o)}

- - ${t.pendingLink?`

Your new buyer link is created as soon as - the route changes — you will not have to fill the form in again.

`:""} -

${H((i=t.error)!==null&&i!==void 0?i:"")}

-
- - -
`,r=>{var l;(l=r.querySelector("[data-ch-intent-ack]"))===null||l===void 0||l.addEventListener("click",()=>{var c;this.acknowledgeIntentSwitch(n,(c=t.pendingLink)!==null&&c!==void 0?c:null)})})}async acknowledgeIntentSwitch(t,e){var i;const s=this.detailChannelId;if(!s){this.closeDialog();return}if(this.dialog&&(this.dialog.busy=!0,this.renderDialog()),!await this.setAccessIntent(t,{acknowledgeLiveAccess:!0})){var n;((n=this.dialog)===null||n===void 0?void 0:n.kind)==="intentSwitch"&&(this.dialog.busy=!1,this.renderDialog());return}if(!e){this.closeDialog();return}((i=this.dialog)===null||i===void 0?void 0:i.kind)==="intentSwitch"&&(this.dialog.busy=!1,this.renderDialog()),await this.mintLink(s,e)}renderScrim(t,e){var i;const s=this.scrimEl;s||(this.lastFocus=(i=document.activeElement)!==null&&i!==void 0?i:null),s==null||s.remove();const n=document.createElement("div");n.className="slm-ch-scrim",n.innerHTML=``,this.host.root.appendChild(n),this.scrimEl=n;const o=n.firstElementChild;o.querySelectorAll("[data-ch-close]").forEach(r=>{r.addEventListener("click",()=>this.closeDialog())}),n.addEventListener("keydown",r=>{if(r.key==="Escape"){r.stopPropagation(),this.closeDialog();return}if(r.key!=="Tab")return;const l=[...o.querySelectorAll('button:not([disabled]),select,input,textarea,a[href],[tabindex]:not([tabindex="-1"])')];if(!l.length)return;const c=l[0],d=l[l.length-1];r.shiftKey&&document.activeElement===c?(r.preventDefault(),d.focus()):!r.shiftKey&&document.activeElement===d&&(r.preventDefault(),c.focus())}),e(o);const a=o.querySelector("input,select,button");(a!=null?a:o).focus()}closeDialog(t={}){var e,i,s;this.dialog=null,(e=this.scrimEl)===null||e===void 0||e.remove(),this.scrimEl=null,t.restoreFocus!==!1&&((i=this.lastFocus)===null||i===void 0||(s=i.focus)===null||s===void 0||s.call(i)),this.lastFocus=null}renderCreateDialog(t){var e,i,s;const n=((e=(i=this.list)===null||i===void 0?void 0:i.channels)!==null&&e!==void 0?e:[]).map(a=>Ft(a.marker||a.name,"")),o=no("",n);this.renderScrim(` -

Create channel

-

A named allocation only the right audience can buy from. You'll pick the seats next.

-
- - -

Shown to your team and in reports — never to buyers.

-
-
- -
- ${H(o.letter)} - Letter comes from the name; colour is chosen automatically from the next available palette. Buyers never see either. -
-
-
- - -

A stable ID for your own system and webhooks.

-
-

${H((s=t.error)!==null&&s!==void 0?s:"")}

-
- - - -
`,a=>{const r=a.querySelector("#slm-ch-name"),l=a.querySelector("[data-ch-marker]");r.addEventListener("input",()=>{const c=no(r.value,n);l.textContent=c.letter,l.style.background=c.color}),a.querySelectorAll("[data-ch-create]").forEach(c=>{c.addEventListener("click",()=>{var d,u,h;const p=c.dataset.chCreate==="allocate";this.createChannel(r.value,(d=l.textContent)!==null&&d!==void 0?d:"",l.style.background,(u=(h=a.querySelector("#slm-ch-ref"))===null||h===void 0?void 0:h.value)!==null&&u!==void 0?u:"",p)})})})}async createChannel(t,e,i,s,n){const o=t.trim();if(!o){this.showDialogError("Give the channel a name your team will recognise.");return}try{const a=await this.host.api.createChannel(this.host.eventKey,{name:o,marker:Ft(e,"")||null,color:i||null,externalRef:s.trim()||null});this.closeDialog(),await this.refresh(),this.targetChannelId=a.channel.id,this.detailChannelId=n?null:a.channel.id,this.announce(`Channel ${o} created with 0 seats allocated.`),this.host.toast(n?`${o} created. Select seats on the map to allocate them.`:`${o} created.`,"ok"),this.paintRail()}catch(a){const r=a instanceof he?a.code:void 0;this.showDialogError(r==="channel_name_taken"?"That name is already used on this event. Pick another.":"Couldn't create the channel. Try again."),this.host.onError(a)}}showDialogError(t){var e;const i=(e=this.scrimEl)===null||e===void 0?void 0:e.querySelector("[data-ch-error]");i&&(i.textContent=t,i.hidden=!1)}renderReviewDialog(t){var e,i,s;const{labels:n,buckets:o}=this.currentPlan(),a=t.applied,r=a?a.buckets:o,l=(e=this.nameOf((i=a==null?void 0:a.targetChannelId)!==null&&i!==void 0?i:this.targetChannelId))!==null&&e!==void 0?e:ze,c=Pl(r,l),d=a?a.applied:Os(o),u=!a&&n.length>0&&d===0,h=!a&&n.length>Me,p=fo(c),f=a?'
':`
- - -
`,v=!a&&_l(o)?'

Applying moves inventory out of another private channel. That is the line marked above.

':"",m=u?`
Nothing in this selection can move right now — - every seat is in a buyer's checkout, already sold, or already in ${H(l)}.
`:"",g=h?``:"";this.renderScrim(` -

${a?`Moved ${a.applied.toLocaleString()} seat${a.applied===1?"":"s"} to ${H(l)}`:`Move ${n.length.toLocaleString()} selected seat${n.length===1?"":"s"} to ${H(l)}`}

-

${a?"These are the exact counts the server applied.":"Every selected seat is in exactly one line below."}

- ${m} - ${g} - ${p||'
Nothing selected.
'} - ${v} -

${H((s=t.error)!==null&&s!==void 0?s:"")}

- ${f}`,b=>{var y;(y=b.querySelector("[data-ch-apply]"))===null||y===void 0||y.addEventListener("click",()=>{this.apply()})}),a&&this.announce(`Applied ${a.applied} change${a.applied===1?"":"s"} to ${l}.`)}async apply(){if(!this.dialog||!this.caps.manage)return;const{labels:t}=this.currentPlan();if(t.length){if(t.length>Me){this.showDialogError(`Choose at most ${Me.toLocaleString()} seats for one Apply.`);return}this.dialog={...this.dialog,busy:!0,error:null},this.renderDialog();try{const e=await this.host.api.applyChannelAssignment(this.host.eventKey,{targetChannelId:gt(this.targetChannelId)?null:this.targetChannelId,labels:t,assignmentVersion:this.assignmentVersion});this.assignmentVersion=e.assignmentVersion,this.conflict=!1,await this.refresh({quiet:!0}),this.closeDialog({restoreFocus:!1}),this.host.clearSelection(),this.showApplied(e)}catch(e){if(e instanceof he&&e.status===409&&e.code==="channel_assignment_conflict"){this.conflict=!0,this.closeDialog(),this.shakeStaged(),this.paintRail(),this.announce("Assignments changed while you were editing. Nothing was applied and your selection is kept.");return}if(e instanceof he&&e.status===403){this.caps={view:this.caps.view,manage:!1},this.closeDialog(),this.paintRail(),this.host.toast("Changing channels needs channel-management permission.","err");return}this.dialog={kind:"review",busy:!1,error:"Couldn't apply those changes. Try again."},this.renderDialog(),this.host.onError(e)}}}showApplied(t){var e,i;const s=(e=this.nameOf(t.targetChannelId))!==null&&e!==void 0?e:ze,n=t.buckets.skippedHeld.count+t.buckets.skippedBooked.count+t.buckets.notFound.count;this.setStaged(` - Assigned ${t.applied.toLocaleString()} seat${t.applied===1?"":"s"} to ${H(s)} - ${n?` · ${n.toLocaleString()} skipped`:""} - - `,"done"),(i=this.stagedEl)===null||i===void 0||(i=i.querySelector("[data-ch-applied-details]"))===null||i===void 0||i.addEventListener("click",()=>{this.openDialog({kind:"review",applied:t})}),this.announce(`Assigned ${t.applied} seat${t.applied===1?"":"s"} to ${s}${n?`; ${n} skipped`:""}.`),this.stagedDoneTimer&&clearTimeout(this.stagedDoneTimer),this.stagedDoneTimer=setTimeout(()=>this.setStaged(null),5e3)}shakeStaged(){const t=this.stagedEl;!t||!t.classList.contains("on")||(t.classList.remove("shake"),t.offsetWidth,t.classList.add("shake"))}renderMenuDialog(t){var e;const i=(e=this.list)===null||e===void 0?void 0:e.channels.find(n=>n.id===t.channelId);if(!i||!this.caps.manage){this.closeDialog();return}const s=i.state==="paused";this.renderScrim(` -

${H(i.name)}

-

Open the channel to allocate seats and hand out buyer access. - These are the rest of its actions.

-
- - - - -
-

Pausing stops new buyer access; checkouts already running can finish. - Archiving closes the channel for good and returns its free seats to a destination you choose. - Nothing is ever deleted silently.

-
`,n=>{n.querySelectorAll("[data-ch-menu-act]").forEach(o=>{o.addEventListener("click",()=>{const a=o.dataset.chMenuAct;if(a==="open"){this.closeDialog(),this.openChannel(i.id);return}if(a==="rename"){this.openDialog({kind:"rename",channelId:i.id});return}if(a==="archive"){this.openDialog({kind:"archive",channelId:i.id});return}this.closeDialog(),this.togglePause(i.id)})})})}renderRenameDialog(t){var e,i;const s=(e=this.list)===null||e===void 0?void 0:e.channels.find(n=>n.id===t.channelId);if(!s){this.closeDialog();return}this.renderScrim(` -

Rename ${H(s.name)}

-

Only your team and your reports see this name.

-
- - -
-

${H((i=t.error)!==null&&i!==void 0?i:"")}

-
- - -
`,n=>{var o;(o=n.querySelector("[data-ch-rename]"))===null||o===void 0||o.addEventListener("click",()=>{var a,r;const l=(a=(r=n.querySelector("#slm-ch-newname"))===null||r===void 0?void 0:r.value)!==null&&a!==void 0?a:"";if(!l.trim()){this.showDialogError("A channel needs a name.");return}this.host.api.renameChannel(this.host.eventKey,s.id,l.trim()).then(()=>(this.closeDialog(),this.refresh())).catch(c=>{this.showDialogError(c instanceof he&&c.code==="channel_name_taken"?"That name is already used on this event.":"Couldn't rename the channel."),this.host.onError(c)})})})}renderPricingDialog(t){var e,i,s;const n=(e=this.list)===null||e===void 0?void 0:e.channels.find(l=>l.id===t.channelId),o=this.host.api.updateChannelPricing;if(!n||!o||!this.caps.manage){this.closeDialog();return}const a=new Map(((i=n.priceOverrides)!==null&&i!==void 0?i:[]).map(l=>{var c;return[`${l.categoryKey}\0${(c=l.tierId)!==null&&c!==void 0?c:""}`,l.price]})),r=this.host.categories().flatMap(l=>{var c;return(!((c=l.tiers)===null||c===void 0)&&c.length?l.tiers:[null]).map(d=>{var u,h,p;const f=(u=d==null?void 0:d.id)!==null&&u!==void 0?u:null,v=`${l.key}\0${f!=null?f:""}`,m=(h=(p=d==null?void 0:d.price)!==null&&p!==void 0?p:l.price)!==null&&h!==void 0?h:0,g=a.get(v),b=d?`${l.label} · ${d.name}`:l.label;return``})}).join("");this.renderScrim(` -

Prices for ${H(n.name)}

-

Set only the prices that differ for this audience. Leave a field blank to use the event price.

-
${r||'

This event has no priced categories.

'}
-

${H((s=t.error)!==null&&s!==void 0?s:"")}

-
- - -
`,l=>{var c;(c=l.querySelector("[data-ch-price-save]"))===null||c===void 0||c.addEventListener("click",()=>{const d=[];for(const u of l.querySelectorAll("[data-ch-price-category]")){const h=u.value.trim();if(!h)continue;const p=Number(h);if(!Number.isFinite(p)||p<0||p>1e6){u.focus(),this.showDialogError("Enter a price from 0 to 1,000,000, or leave the field blank.");return}d.push({categoryKey:u.dataset.chPriceCategory,tierId:u.dataset.chPriceTier||null,price:p})}this.saveChannelPricing(n,d)})})}async saveChannelPricing(t,e){const i=this.host.api.updateChannelPricing;if(!(!i||!this.dialog||this.dialog.kind!=="pricing")){this.dialog={...this.dialog,busy:!0,error:null},this.renderDialog();try{var s;await i.call(this.host.api,this.host.eventKey,t.id,e,(s=t.pricingVersion)!==null&&s!==void 0?s:0),this.closeDialog(),await this.refresh(),this.host.toast(e.length?`Custom prices saved for ${t.name}.`:`${t.name} now uses event prices.`,"ok")}catch(n){if(n instanceof he&&n.code==="channel_pricing_conflict"){await this.refresh({quiet:!0}),this.dialog={kind:"pricing",channelId:t.id,error:"Prices changed in another window. Latest values are shown — review and save again."},this.renderDialog();return}this.dialog={kind:"pricing",channelId:t.id,error:n instanceof he&&n.serverMessage?n.serverMessage:"Couldn't save these prices. Try again."},this.renderDialog(),this.host.onError(n)}}}async chooseWebsiteIntegration(){this.detailChannelId&&await this.setAccessIntent("server")}async setAccessIntent(t,e={}){const i=this.detailChannelId;if(!i||!this.caps.manage)return!1;try{const s=await this.host.api.setChannelAccessIntent(this.host.eventKey,i,t,e);return await this.refresh(),this.host.toast(this.intentSavedCopy(t,s==null?void 0:s.intentSwitch),"ok"),!0}catch(s){return s instanceof he&&s.code==="channel_intent_switch_blocked"?(this.openDialog({kind:"intentSwitch",channelId:i,intentTo:t,switchBlocked:s.details}),!1):s instanceof he&&s.code==="channel_access_intent_forbids"?(this.host.toast(Bs(s.details),"err"),!1):(this.host.toast("Couldn't change how this channel reaches buyers.","err"),this.host.onError(s),!1)}}intentSavedCopy(t,e){const i=t==="server"?"Set to your website or app. The embed code is on the Embed page.":t==="internal"?"Only your own staff can sell this channel now.":t==="hosted_link"?"Set to buyer links. Create one to let buyers in.":"Kept as a protected reserve. No route can sell these seats.";return e?`${i}${e.closedLinks?` ${e.closedLinks.toLocaleString()} buyer link${e.closedLinks===1?"":"s"} closed.`:""}${e.keptSessions?` ${e.keptSessions.toLocaleString()} buyer${e.keptSessions===1?"":"s"} already in a checkout can still finish.`:""}`:i}async togglePause(t=this.detailChannelId){var e;const i=(e=this.list)===null||e===void 0?void 0:e.channels.find(n=>n.id===t);if(!i||!this.caps.manage)return;const s=i.state!=="paused";try{await this.host.api.setChannelPaused(this.host.eventKey,i.id,s),await this.refresh(),this.host.toast(s?`${i.name} paused. Existing checkouts can finish; no new buyer access is issued.`:`${i.name} resumed.`,"ok")}catch(n){this.host.toast("Couldn't change that channel.","err"),this.host.onError(n)}}renderArchiveDialog(t){var e,i,s,n,o;const a=(e=this.list)===null||e===void 0?void 0:e.channels.find(u=>u.id===t.channelId);if(!a){this.closeDialog();return}const r=(i=t.archiveBlocked)!==null&&i!==void 0?i:null,l=!r&&a.counts.held>0,c=this.assignableChannels().filter(u=>u.id!==a.id),d=r?``:l?`
- ${a.counts.held.toLocaleString()} seats are in a buyer's checkout right now. - Archive is refused while any seat is held — you can try, and we'll tell you when to come back.
`:"";this.renderScrim(` -

Archive ${H(a.name)}

-

The channel closes for good. Its seats move to a destination you choose; - sales history keeps its attribution.

- ${d} -
- - -
-

${a.counts.booked.toLocaleString()} sold seats keep "${H(a.name)}" on their sale - record. If one is cancelled later it returns to the destination above. Any buyer access for this channel - stops working.

-

${H((o=t.error)!==null&&o!==void 0?o:"")}

-
- - -
`,u=>{var h;(h=u.querySelector("[data-ch-archive]"))===null||h===void 0||h.addEventListener("click",()=>{var p,f;const v=(p=(f=u.querySelector("#slm-ch-dest"))===null||f===void 0?void 0:f.value)!==null&&p!==void 0?p:"";this.archive(a.id,v||null)})})}async archive(t,e){try{await this.host.api.archiveChannel(this.host.eventKey,t,e),this.closeDialog(),this.detailChannelId=null,await this.refresh(),this.host.toast("Channel archived. Its remaining seats moved to the destination you chose.","ok")}catch(s){if(s instanceof he&&s.status===409&&s.code==="channel_archive_blocked_by_holds"){var i;this.dialog={kind:"archive",channelId:t,archiveBlocked:(i=s.details)!==null&&i!==void 0?i:{}},this.renderDialog();return}this.showDialogError("Couldn't archive that channel. Try again."),this.host.onError(s)}}renderSeatListDialog(){const t=new Set(this.host.selectionLabels()),e=new Map;let i=0;for(const l of this.host.seats()){var s,n,o,a;if(i+=1,i>this.seatListLimit)break;const c=this.host.sectionOfLabel(l.label),d=(s=c==null?void 0:c.id)!==null&&s!==void 0?s:"",u=(n=e.get(d))!==null&&n!==void 0?n:{label:(o=c==null?void 0:c.label)!==null&&o!==void 0?o:"Other seats",seats:[]};u.seats.push({label:l.label,status:(a=this.host.statusOf(l.label))!==null&&a!==void 0?a:"free"}),e.set(d,u)}const r=[...e.entries()].map(([l,c])=>` -
- ${H(c.label)} - ${l?``:""} -
- ${c.seats.map(d=>{var u,h;const p=(u=this.allocation.get(d.label))!==null&&u!==void 0?u:Ue,f=(h=this.nameOf(p))!==null&&h!==void 0?h:ze;return``}).join("")}`).join("");this.renderScrim(` -

Seat list

-

The same selection as the map, with checkboxes. Space or Enter toggles a seat.

-
${r||'
No seats on this chart.
'}
- ${i>this.seatListLimit?'
':""} -
`,l=>{var c;l.querySelectorAll("[data-ch-seat]").forEach(d=>{d.addEventListener("click",()=>{const u=d.dataset.chSeat,h=new Set(this.host.selectionLabels());h.has(u)?h.delete(u):h.add(u),this.host.clearSelection(),h.size&&this.host.selectByLabels([...h]),this.renderSeatListDialog()})}),l.querySelectorAll("[data-ch-section]").forEach(d=>{d.addEventListener("click",()=>{this.host.selectSection(d.dataset.chSection),this.renderSeatListDialog()})}),(c=l.querySelector("[data-ch-more]"))===null||c===void 0||c.addEventListener("click",()=>{this.seatListLimit+=mo,this.renderSeatListDialog()})})}async reloadLinks(){const t=this.detailChannelId;t&&(this.linksState=this.links.length?this.linksState:"loading",await this.loadLinks(t),this.paintRail())}async reloadAfterLinkChange(t){if(this.detailChannelId===t){await this.refresh({quiet:!0});return}await this.loadLinks(t),this.active&&this.paintRail()}linkById(t){var e;return(e=this.links.find(i=>i.id===t))!==null&&e!==void 0?e:null}renderLinkCreateDialog(t){var e,i;const s=(e=this.list)===null||e===void 0?void 0:e.channels.find(n=>n.id===t.channelId);if(!s||!this.caps.manage){this.closeDialog();return}this.renderScrim(` -

Create a buyer link for ${H(s.name)}

-

Anyone who opens the link can buy from this channel's allocation — and only from it. - You'll see the link once, right after you create it.

-
- - -

So you can tell your links apart later. Buyers never see it.

-
-
- - -
- -
- - -

Each buyer who opens the link uses one.

-
-
- - -
- -

${H((i=t.error)!==null&&i!==void 0?i:"")}

-
- - -
`,n=>{var o;const a=n.querySelector("[data-ch-lk-expiry]"),r=n.querySelector("[data-ch-lk-when-field]"),l=n.querySelector("#slm-ch-lk-when");a.addEventListener("change",()=>{const c=a.value==="custom";r.hidden=!c,c&&!l.value&&(l.value=fm(Date.now()+7*864e5))}),(o=n.querySelector("[data-ch-lk-create]"))===null||o===void 0||o.addEventListener("click",()=>{var c,d,u;const h=Dl(n,"#slm-ch-lk-redemptions"),p=Dl(n,"#slm-ch-lk-quantity");if(h==null||p==null){this.showDialogError("Those two settings need to be whole numbers.");return}let f;if(a.value==="custom"&&(f=Date.parse(l.value),!Number.isFinite(f))){this.showDialogError("Pick the date and time the link should stop working.");return}this.createLink(s.id,{label:((c=n.querySelector("#slm-ch-lk-label"))===null||c===void 0?void 0:c.value.trim())||null,includePublic:(d=(u=n.querySelector("#slm-ch-lk-public"))===null||u===void 0?void 0:u.checked)!==null&&d!==void 0?d:!1,...f===void 0?{}:{expiresAt:f},maxRedemptions:h,maxQuantity:p})})})}async createLink(t,e){await this.ensureHostedLinkRoute(t,e)&&await this.mintLink(t,e)}async mintLink(t,e){try{const i=await this.host.api.createAccessLink(this.host.eventKey,t,e);this.revealLink(i,{channelId:t}),await this.reloadAfterLinkChange(t)}catch(i){this.showDialogError(Hi(i instanceof he?i:void 0)),i instanceof he||this.host.onError(i)}}async ensureHostedLinkRoute(t,e){var i,s,n;const o=(i=this.list)===null||i===void 0?void 0:i.channels.find(a=>a.id===t);if(((s=o==null||(n=o.access)===null||n===void 0?void 0:n.intent)!==null&&s!==void 0?s:"none")==="hosted_link")return!0;try{return await this.host.api.setChannelAccessIntent(this.host.eventKey,t,"hosted_link"),await this.refresh(),!0}catch(a){return a instanceof he&&a.code==="channel_intent_switch_blocked"?(this.openDialog({kind:"intentSwitch",channelId:t,intentTo:"hosted_link",switchBlocked:a.details,pendingLink:e}),!1):(this.showDialogError(a instanceof he&&a.code==="channel_access_intent_forbids"?Bs(a.details):"Couldn't set this channel up for buyer links. Try again."),a instanceof he||this.host.onError(a),!1)}}revealLink(t,e){const i=t.url;this.dialog=null;const s=e.rotated?`
- The old link has stopped working. ${t.endedSessions?`${t.endedSessions.toLocaleString()} buyer${t.endedSessions===1?"":"s"} lost access immediately.`:"Buyers who already came in can finish; every new visit needs this link."}
`:"",n=co(t.link).map(o=>`
${H(o.k)} - ${H(o.v)}
`).join("");this.renderScrim(` -

Copy this link now

-

This is the only time SeatLayer can show it. We keep just a fingerprint, so it cannot be - shown again — if it is lost, rotate the link for a fresh one.

- ${s} -
${H(i)}
-
- -
-
- Anyone who opens this link can buy from this allocation. Send it only to the people it is meant - for — forwarding it hands on the same access, and SeatLayer cannot tell the difference.
-

What this link allows

- ${n} -
- -
`,o=>{const a=o.querySelector("[data-ch-lk-copy]");a==null||a.addEventListener("click",()=>{const r=()=>{a.textContent="Copied",this.announce("Buyer link copied.")},l=typeof navigator=="undefined"?null:navigator.clipboard;if(l!=null&&l.writeText){l.writeText(i).then(r,()=>Hl(o));return}Hl(o)})}),this.announce("Your buyer link is ready and is shown once.")}renderLinkRotateDialog(t){var e,i;const s=this.linkById(t.linkId);if(!s||!this.caps.manage){this.closeDialog();return}const n=(e=s.activeSessions)!==null&&e!==void 0?e:0,o=n?`
- ${n.toLocaleString()} buyer${n===1?"":"s"} got in with the current link - and still ${n===1?"has":"have"} active access.
`:"";this.renderScrim(` -

Rotate the ${H(s.label||"buyer")} link?

-

The current link stops opening immediately and cannot be restored. You will get a new - link to copy — shown once.

- ${o} - - -

Choose one — SeatLayer will not decide this for you.

-

${H((i=t.error)!==null&&i!==void 0?i:"")}

-
- - -
`,a=>{const r=a.querySelector("[data-ch-lk-rotate]");a.querySelectorAll("[data-ch-rot]").forEach(l=>{l.addEventListener("change",()=>{r.disabled=!1})}),r.addEventListener("click",()=>{const l=[...a.querySelectorAll("[data-ch-rot]")].find(c=>c.checked);if(!l){this.showDialogError(Hi({code:"end_active_sessions_required"}));return}this.rotateLink(t.channelId,s.id,l.value==="end")})})}async rotateLink(t,e,i){try{const s=await this.host.api.rotateAccessLink(this.host.eventKey,t,e,i);this.revealLink(s,{channelId:t,rotated:!0}),await this.reloadAfterLinkChange(t)}catch(s){this.showDialogError(Hi(s instanceof he?s:void 0)),s instanceof he||this.host.onError(s)}}renderLinkRevokeDialog(t){var e,i;const s=this.linkById(t.linkId);if(!s||!this.caps.manage){this.closeDialog();return}const n=(e=s.activeSessions)!==null&&e!==void 0?e:0;this.renderScrim(` -

Revoke the ${H(s.label||"buyer")} link?

-

It stops opening immediately and cannot be restored — there is no undo, and no way to - bring the same URL back. Seats already bought through it keep their sale.

- ${n?``:""} -

${H((i=t.error)!==null&&i!==void 0?i:"")}

-
- - -
`,o=>{var a;(a=o.querySelector("[data-ch-lk-revoke]"))===null||a===void 0||a.addEventListener("click",()=>{var r,l;const c=(r=(l=o.querySelector("[data-ch-lk-endsessions]"))===null||l===void 0?void 0:l.checked)!==null&&r!==void 0?r:!1;this.revokeLink(t.channelId,s.id,c)})})}async revokeLink(t,e,i){try{const s=await this.host.api.revokeAccessLink(this.host.eventKey,t,e,i);this.closeDialog(),await this.reloadAfterLinkChange(t),this.host.toast(s.endedSessions?`Link revoked. ${s.endedSessions.toLocaleString()} buyer${s.endedSessions===1?"":"s"} lost access.`:"Link revoked. It no longer opens for anyone.","ok")}catch(s){this.showDialogError(Hi(s instanceof he?s:void 0)),s instanceof he||this.host.onError(s)}}applySheetClasses(){const t=this.host.root,e=this.host.isCompact();t.classList.toggle("ch-sheet",e&&this.active);for(const i of["collapsed","medium","full"])t.classList.toggle(`detent-${i}`,e&&this.active&&this.detent===i);this.host.setMapInert(e&&this.active&&this.detent==="full")}cycleDetent(){const t=["collapsed","medium","full"];this.detent=t[(t.indexOf(this.detent)+1)%t.length],this.applySheetClasses()}handleBack(){return this.scrimEl?(this.closeDialog(),!0):this.host.isCompact()&&this.detent==="full"?(this.detent="medium",this.applySheetClasses(),!0):!1}}}));to();var Sm="https://api.seatlayer.io",Hs=80,Cm=16,Zl=4,Ql=[{key:"watch",label:"Watch",tools:[{mode:"view",label:"Monitor",shortcut:"M",title:"Live board — inventory, activity and booking momentum. Read-only."},{mode:"inspect",label:"Inspect",shortcut:"I",title:"Click one seat to read its live status and booking context. Read-only."}]},{key:"manage",label:"Manage",tools:[{mode:"block",label:"Block",shortcut:"B",title:"Take seats off sale for this event, or put them back."},{mode:"sections",label:"Sections",shortcut:"S",title:"Open, close or hide sections for this event, on a schedule or on demand."},{mode:"categories",label:"Categories",shortcut:"G",title:"Move seats to a different price category for this event only."},{mode:"tables",label:"Tables",shortcut:"T",title:"Sell each table per chair or as one whole-table booking."},{mode:"channels",label:"Channels",shortcut:"C",title:"Allocate inventory to sales channels and share their links."}]},{key:"host",label:"Host tools",tools:[{mode:"select",label:"Select",shortcut:"X",title:"Select seats for your own back-office operation. The selection is handed to your app; nothing changes here."},{mode:"filterSections",label:"Filter",shortcut:"L",title:"Filter the map to one section for your own reporting."}]}],Tm=Object.fromEntries(Ql.flatMap(t=>t.tools.map(e=>[e.shortcut.toLowerCase(),e.mode]))),Lm=class{constructor(t){var e,i,s,n,o,a,r,l,c;this.els={},this.renderer=null,this.doc=null,this.inventoryModelVersion=1,this.selectableObjectLabels=new Set,this.lastSelectionLabels=new Set,this.selectionWasValid=null,this.initialSelectionApplied=!1,this.labelToId=new Map,this.labelToSeat=new Map,this.allIds=[],this.gaUnitLabelSet=new Set,this.status=new Map,this.counts={held:0,booked:0,blocked:0},this.modelVersion=0,this.currency="USD",this.authoritativeCurrency=null,this.authoritativeGrossRevenue=0,this.revenueStatus="loading",this.revenueRequest=0,this.controlRoomSnapshot=null,this.serverBaseline=null,this.livePresence=null,this.liveGross=null,this.paintHandle=null,this.trendWindowMinutes=15,this.heatEnabled=!1,this.lastKpiValues=new Map,this.activeKpiDeltas=new Map,this.ws=null,this.reconnectTimer=null,this.attempt=0,this.closed=!1,this.connectionStatus="reconnecting",this.lastMessageAt=null,this.ready=!1,this.feed=[],this.feedTimer=null,this.toastTimer=null,this.liveEventTimer=null,this.kpiCleanupTimer=null,this.followLiveTimer=null,this.followSeatTimer=null,this.releaseAt=null,this.layoutObserver=null,this.tokenExpiresAt=null,this.tokenRefreshTimer=null,this.tokenRefreshInFlight=!1,this.sectionByObject=new Map,this.sectionLabelById=new Map,this.sectionsBase=null,this.filteredSectionLabel=null,this.availabilityRules={},this.effectiveHidden=new Set,this.effectiveClosed=new Set,this.availabilitySaving=!1,this.lastSyncedAt=null,this.blockedQuery="",this.blockedSection="",this.blockedResultLimit=100,this.unblockAllConfirmTimer=null,this.channels=null,this.channelCaps={view:!1,manage:!1},this.categoryCanManage=!1,this.tableCanManage=!1,this.tableBookingSaving=!1,this.channelCapabilityResolution=0,this.channelsLoading=null,this.onFullscreenChange=()=>{var d;this.paintFullscreenButton(),this.updateContainerLayout(),(d=this.renderer)===null||d===void 0||d.forceDraw()},this.onKeyDown=d=>{if(d.metaKey||d.ctrlKey||d.altKey)return;const u=d.target;if(u!=null&&u.matches('input,select,textarea,[contenteditable="true"]'))return;const h=d.key.toLowerCase(),p=Tm[h];if(p){if(!this.toolAvailable(p))return;this.setMode(p)}else if(h==="f")this.toggleFullscreen();else if(h==="escape"){var f;if(!(!((f=this.channels)===null||f===void 0)&&f.handleBack()))return}else return;d.preventDefault()},this.onRailClick=d=>{const u=d.target,h=u==null?void 0:u.closest("[data-section-focus]");if(h!=null&&h.dataset.sectionFocus){this.locateSection(h.dataset.sectionFocus);return}const p=u==null?void 0:u.closest("[data-feed-id]");p!=null&&p.dataset.feedId&&this.locateActivity(p.dataset.feedId)},this.sectionOptions=[],Cl(t.token),this.assertSelectionOptions(t.maxSelectedObjects,t.numberOfPlacesToSelect),this.opts=t,this.key=t.eventKey,this.mode=(e=t.mode)!==null&&e!==void 0?e:"view",this.selectableObjectLabels=new Set((i=t.selectableObjects)!==null&&i!==void 0?i:[]),this.categoryCanManage=new Set((s=t.capabilities)!==null&&s!==void 0?s:[]).has("event:categories:manage"),this.tableCanManage=new Set((n=t.capabilities)!==null&&n!==void 0?n:[]).has("event:tables:manage"),this.keepLive=(o=t.keepLiveWhileHidden)!==null&&o!==void 0?o:!0,this.followLive=(a=t.followLive)!==null&&a!==void 0?a:!1,this.currency=(r=t.currency)!==null&&r!==void 0?r:"USD",this.tokenExpiresAt=(l=t.tokenExpiresAt)!==null&&l!==void 0?l:null,this.api=new eo((c=t.apiBase)!==null&&c!==void 0?c:Sm,t.token),this.organizerAssetUrls=new em(this.key,(d,u)=>this.withAuthRetry(()=>this.api.asset(d,u))),this.host=rm(t.container)}assertSelectionOptions(t,e){const i=s=>s===void 0||Number.isInteger(s)&&s>0;if(!i(t))throw new TypeError("maxSelectedObjects must be a positive integer");if(!i(e))throw new TypeError("numberOfPlacesToSelect must be a positive integer");if(t!==void 0&&e!==void 0&&tthis.api.chart(this.key));this.inventoryModelVersion=o.event.inventoryModelVersion===2?2:1,this.doc=await this.organizerAssetUrls.prepareRendererChart(o.doc),this.authoritativeCurrency=(t=o.event.currency)!==null&&t!==void 0?t:null,this.currency=(e=(i=this.authoritativeCurrency)!==null&&i!==void 0?i:this.opts.currency)!==null&&e!==void 0?e:this.currency,this.buildUnitUniverse(this.doc),this.buildRenderer(),this.buildSectionOptions(),this.settleMode();const[,a]=await Promise.all([this.resnapshot(),this.refreshControlRoom().catch(r=>{var l,c;return(l=(c=this.opts).onError)===null||l===void 0?void 0:l.call(c,r)}),this.refreshAvailability()]);a!=null&&a.activity?this.seedFeed(a.activity):this.api.log(this.key,{limit:24}).then(r=>this.seedFeed(r.entries)).catch(()=>{}),this.connect(),this.startFeedClock(),this.ready=!0,await this.resolveChannelCapabilities(),this.setMode(this.mode),this.applyInitialSelection(),this.scheduleTokenRefresh(),(s=(n=this.opts).onReady)===null||s===void 0||s.call(n)}catch(o){this.fail(o)}return this}setMode(t){var e,i,s,n,o;this.toolAvailable(t)||(t="view"),t==="channels"&&!this.channels&&this.ensureChannels();const a=t!==this.mode,r=this.mode==="channels",l=this.mode==="filterSections";if(this.mode=t,!this.renderer&&this.doc?this.buildRenderer():this.updateRendererInteraction(),a){var c;(c=this.renderer)===null||c===void 0||c.clearSelection(),this.syncSelection()}r&&t!=="channels"&&((e=this.channels)===null||e===void 0||e.leave()),this.paintModeTabs(),this.paintRail(),this.applySectionCanvasTreatment(),l&&t!=="filterSections"&&((i=this.renderer)===null||i===void 0||i.zoomToFit()),t==="channels"&&((s=this.channels)===null||s===void 0||s.enter()),t==="select"&&this.applyInitialSelection(),a&&((n=(o=this.opts).onModeChange)===null||n===void 0||n.call(o,t))}async resolveChannelCapabilities(){var t;const e=++this.channelCapabilityResolution,i=this.opts.capabilities;let s;if(i){const o=new Set(i);s={view:o.has("event:channels:view"),manage:o.has("event:channels:view")&&o.has("event:channels:manage")}}else s={view:!1,manage:!1};if(!s.view&&!i)try{await this.api.channels(this.key),s={view:!0,manage:!1}}catch{s={view:!1,manage:!1}}if(e===this.channelCapabilityResolution){if(this.channelCaps=s,!this.channelCaps.view){var n;(n=this.channels)===null||n===void 0||n.destroy(),this.channels=null,this.mode==="channels"?this.setMode("view"):this.paintModeTabs();return}(t=this.channels)===null||t===void 0||t.setCapabilities(this.channelCaps),this.paintModeTabs()}}ensureChannels(){if(this.channelsLoading)return this.channelsLoading;if(this.channels)return Promise.resolve();const t=(async()=>{try{const s=await Promise.resolve().then(()=>(Xl(),xm));if(this.closed||!this.channelCaps.view||(this.channels||(sm(s.CHANNELS_CSS),this.channels=new s.ChannelsMode(this.buildChannelsHost(),this.channelCaps),this.channels.onInteractionChange=()=>this.updateRendererInteraction()),this.mode!=="channels"))return;this.updateRendererInteraction(),this.paintRail(),this.channels.enter()}catch(s){var e,i;if(this.closed)return;this.channelsLoading=null,this.mode==="channels"&&this.paintRail(),(e=(i=this.opts).onError)===null||e===void 0||e.call(i,s)}})();return this.channelsLoading=t,t}buildChannelsHost(){return{eventKey:this.key,api:this.api,rail:this.els.rail,mapLayer:this.root.querySelector(".slm-map"),root:this.root,seats:()=>[...this.labelToSeat.values()].map(t=>({id:t.id,label:t.label,x:t.x,y:t.y})),statusOf:t=>{var e;return(e=this.status.get(t))!==null&&e!==void 0?e:this.labelToSeat.has(t)?"free":void 0},selectionLabels:()=>this.selectionLabels(),selectByLabels:t=>{this.selectByLabels(t)},clearSelection:()=>this.clearSelection(),selectSection:t=>{this.selectSection(t)},sections:()=>this.sectionOptions,labelsInSection:t=>{var e,i;return(e=(i=this.renderer)===null||i===void 0?void 0:i.getSelectableInSection(t).map(s=>s.label))!==null&&e!==void 0?e:[]},rows:()=>{var t,e;const i=new Map(((t=(e=this.doc)===null||e===void 0?void 0:e.objects)!==null&&t!==void 0?t:[]).map(h=>[h.id,h])),s=new Map;for(const h of this.labelToSeat.values()){var n,o,a,r,l,c,d,u;const p=i.get(h.rowId);if(!p||p.type!=="row"&&p.type!=="table")continue;const f=(n=h.logicalRowId)!==null&&n!==void 0?n:h.rowId,v=(o=this.sectionByObject.get(h.rowId))!==null&&o!==void 0?o:ct,m=(a=s.get(f))!==null&&a!==void 0?a:{id:f,label:p.type==="row"?(r=(l=(c=p.segmentedRow)===null||c===void 0?void 0:c.displayLabel)!==null&&l!==void 0?l:p.displayLabel)!==null&&r!==void 0?r:p.label:(d=p.displayLabel)!==null&&d!==void 0?d:p.label,sectionId:v,sectionLabel:(u=this.sectionLabelById.get(v))!==null&&u!==void 0?u:"Other seats",labels:[]};m.labels.push(h.label),s.set(f,m)}return[...s.values()].sort((h,p)=>h.sectionLabel.localeCompare(p.sectionLabel,void 0,{numeric:!0,sensitivity:"base"})||h.label.localeCompare(p.label,void 0,{numeric:!0,sensitivity:"base"}))},categories:()=>{var t,e;return((t=(e=this.doc)===null||e===void 0?void 0:e.categories)!==null&&t!==void 0?t:[]).map(i=>{var s,n;return{key:i.key,label:(s=i.label)!==null&&s!==void 0?s:i.key,color:i.color,price:i.price,tiers:(n=i.tiers)===null||n===void 0?void 0:n.map(o=>({id:o.id,name:o.name,price:o.price}))}})},labelsInCategory:t=>[...this.labelToSeat.entries()].filter(([,e])=>e.categoryKey===t).map(([e])=>e),sectionOfLabel:t=>{var e,i;const s=this.labelToSeat.get(t);if(!s)return null;const n=(e=this.sectionByObject.get(s.rowId))!==null&&e!==void 0?e:ct;return{id:n,label:(i=this.sectionLabelById.get(n))!==null&&i!==void 0?i:"Other seats"}},worldToScreen:t=>{var e,i;return(e=(i=this.renderer)===null||i===void 0?void 0:i.worldToScreen(t))!==null&&e!==void 0?e:null},seatPixelSize:()=>this.seatPixelSize(),isSeatDetail:()=>{var t,e;return((t=this.renderer)===null||t===void 0||(e=t.getRung)===null||e===void 0?void 0:e.call(t))==="seats"},showSectionOverview:()=>{var t,e,i;(t=this.renderer)===null||t===void 0||t.clearSectionFocus(),(e=this.renderer)===null||e===void 0||(i=e.setRung)===null||i===void 0||i.call(e,"sections")},focusSection:t=>{var e;return(e=this.renderer)===null||e===void 0?void 0:e.focusSection(t)},isCompact:()=>{var t;return!!(!((t=this.root)===null||t===void 0)&&t.classList.contains("compact"))},setMapInert:t=>{this.mapHost.toggleAttribute("inert",t),this.mapHost.setAttribute("aria-hidden",String(t))},toast:(t,e)=>this.toast(t,e),onError:t=>{var e,i;return(e=(i=this.opts).onError)===null||e===void 0?void 0:e.call(i,t)}}}seatPixelSize(){var t,e,i,s;const n=(t=this.renderer)===null||t===void 0||(e=t.getVisibleWorldRect)===null||e===void 0?void 0:e.call(t),o=(i=(s=this.mapHost)===null||s===void 0?void 0:s.clientWidth)!==null&&i!==void 0?i:0;return!(n!=null&&n.width)||!o?6:Math.max(3,o/n.width*18)}setHeatOverlay(t){this.heatEnabled=t,this.applyHeatOverlay(),this.paintHeatButton()}setFollowLive(t){var e,i;const s=this.followLive!==t;this.followLive=t,t||(this.followLiveTimer&&clearTimeout(this.followLiveTimer),this.followSeatTimer&&clearTimeout(this.followSeatTimer),this.followLiveTimer=null,this.followSeatTimer=null),this.paintFollowLiveButton(),s&&((e=(i=this.opts).onFollowLiveChange)===null||e===void 0||e.call(i,t))}setKeepLiveWhileHidden(t){this.keepLive=t!=null?t:!0,this.opts.keepLiveWhileHidden=t}setCurrency(t){this.opts.currency=t,!this.authoritativeCurrency&&(this.currency=t!=null?t:"USD",this.ready&&this.recomputeTallies())}setTheme(t){if(this.opts.theme=t,!!this.root)for(const[e,i]of Object.entries(Tl(t)))this.root.style.setProperty(e,i)}setCapabilities(t){this.opts.capabilities=t,this.categoryCanManage=new Set(t!=null?t:[]).has("event:categories:manage"),this.tableCanManage=new Set(t!=null?t:[]).has("event:tables:manage"),!this.categoryCanManage&&this.mode==="categories"||!this.tableCanManage&&this.mode==="tables"?this.setMode("view"):this.paintModeTabs(),this.ready&&this.resolveChannelCapabilities()}setTokenRefresh(t){this.opts.onTokenRefresh=t,this.scheduleTokenRefresh()}setTrendWindow(t){const e=Number.isFinite(t)?Math.floor(t):15;return this.trendWindowMinutes=Math.max(5,Math.min(60,e)),this.paintTrendWindow(),this.refreshControlRoom()}async enterFullscreen(){var t;!(!((t=this.root)===null||t===void 0)&&t.requestFullscreen)||this.isFullscreen()||(await this.root.requestFullscreen(),this.root.focus({preventScroll:!0}))}async exitFullscreen(){typeof document=="undefined"||!this.isFullscreen()||await document.exitFullscreen()}isFullscreen(){return typeof document!="undefined"&&document.fullscreenElement===this.root}toggleFullscreen(){(this.isFullscreen()?this.exitFullscreen():this.enterFullscreen()).catch(t=>{var e,i;return(e=(i=this.opts).onError)===null||e===void 0?void 0:e.call(i,t)})}setToken(t,e){Cl(t),this.api.setToken(t),this.opts.token=t,this.opts.tokenExpiresAt=e,this.tokenExpiresAt=e!=null?e:null,this.scheduleTokenRefresh(),this.ready&&this.resolveChannelCapabilities()}scheduleTokenRefresh(){this.tokenRefreshTimer&&clearTimeout(this.tokenRefreshTimer),this.tokenRefreshTimer=null;const t=this.opts.onTokenRefresh,e=this.tokenExpiresAt;if(this.closed||!t||!e||!Number.isFinite(e))return;const i=e-Date.now(),s=Math.min(12e4,Math.max(3e4,i*.2)),n=Math.max(0,i-s);this.tokenRefreshTimer=setTimeout(()=>{this.tokenRefreshTimer=null,this.rotateToken()},n)}async rotateToken(){if(!(this.closed||this.tokenRefreshInFlight||!this.opts.onTokenRefresh)){this.tokenRefreshInFlight=!0;try{const i=await this.opts.onTokenRefresh();if(!(i!=null&&i.token)||!Number.isFinite(i.expiresAt))throw new Error("invalid_token_refresh_result");this.setToken(i.token,i.expiresAt)}catch(i){var t,e;(t=(e=this.opts).onError)===null||t===void 0||t.call(e,i),this.closed||(this.tokenRefreshTimer=setTimeout(()=>{this.tokenRefreshTimer=null,this.rotateToken()},3e4))}finally{this.tokenRefreshInFlight=!1}}}async block(t,e={}){var i,s;const n=(t!=null?t:this.selectionLabels()).filter(l=>this.status.get(l)==="free");if(!n.length)return;const o=(i=(s=e.releaseAt)!==null&&s!==void 0?s:this.releaseAt)!==null&&i!==void 0?i:void 0;this.setSeatsLocal(n,"blocked");try{await this.api.block(this.key,n,{...e,releaseAt:o}),this.clearSelection(),this.done("block",n,o?`Blocked ${n.length} — auto-release ${new Date(o).toLocaleString()}.`:`Blocked ${n.length} seat${n.length===1?"":"s"}.`)}catch(l){var a,r;this.setSeatsLocal(n,"free"),this.toastErr(l instanceof he&&l.status===409?"Some seats were just taken. Try again.":"Couldn't block those seats."),(a=(r=this.opts).onError)===null||a===void 0||a.call(r,l)}}async unblock(t){const e=(t!=null?t:this.selectionLabels()).filter(n=>this.status.get(n)==="blocked");if(e.length){this.setSeatsLocal(e,"free");try{await this.api.unblock(this.key,e),this.clearSelection(),this.done("unblock",e,`Unblocked ${e.length} seat${e.length===1?"":"s"}.`)}catch(n){var i,s;this.setSeatsLocal(e,"blocked"),this.toastErr("Couldn't unblock those seats."),(i=(s=this.opts).onError)===null||i===void 0||i.call(s,n)}}}async unblockAll(){const t=[...this.status.entries()].filter(([,s])=>s==="blocked").map(([s])=>s);if(t.length){this.setSeatsLocal(t,"free");try{const s=await this.api.unblockAll(this.key);this.clearSelection(),this.done("unblockAll",t,`Unblocked ${s.freed} seat${s.freed===1?"":"s"}.`)}catch(s){var e,i;await this.resnapshot(),this.toastErr("Couldn't mark everything for sale."),(e=(i=this.opts).onError)===null||e===void 0||e.call(i,s)}}}async cancelBooking(t,e){const i=t.filter(o=>this.status.get(o)==="booked");if(!(!i.length||!e)){this.setSeatsLocal(i,"free");try{await this.api.unbook(this.key,i,e),this.clearSelection(),this.done("cancelBooking",i,`Released ${i.length} booked unit${i.length===1?"":"s"}.`)}catch(o){var s,n;this.setSeatsLocal(i,"booked"),this.toastErr("Couldn't release that booked inventory. Check the booking reference."),(s=(n=this.opts).onError)===null||s===void 0||s.call(n,o)}}}async setCategory(t,e){var i;const s=(i=this.doc)===null||i===void 0?void 0:i.categories.find(d=>d.key===t),n=[...new Set(e!=null?e:this.selectionLabels())].filter(d=>this.labelToSeat.has(d));if(!(!s||!n.length))try{var o,a,r;const d=await this.withAuthRetry(()=>this.api.setCategory(this.key,n,t)),u={};for(const h of d.labels){const p=this.labelToSeat.get(h),f=this.labelToId.get(h);p&&(p.categoryKey=t),f&&(u[f]=t)}(o=this.renderer)===null||o===void 0||(a=o.setSeatCategories)===null||a===void 0||a.call(o,u),this.clearSelection(),this.done("setCategory",d.labels,`Assigned ${d.labels.length.toLocaleString()} object${d.labels.length===1?"":"s"} to ${(r=s.label)!==null&&r!==void 0?r:s.key}.`)}catch(d){var l,c;this.toastErr("Couldn't update those event categories."),(l=(c=this.opts).onError)===null||l===void 0||l.call(c,d)}}async setTableBooking(t,e,i={}){const s=[...new Set(t)].filter(Boolean);if(!(!s.length||this.tableBookingSaving)){if(this.inventoryModelVersion!==2){this.toastErr("Table booking controls require inventory model 2 for this event.");return}this.tableBookingSaving=!0,this.mode==="tables"&&this.renderTablesRail();try{const a=await this.withAuthRetry(()=>this.api.setTableBooking(this.key,s,e,i));await this.reloadEventChart(),this.done("setTableBooking",a.tableIds,`Updated ${a.tableIds.length.toLocaleString()} table${a.tableIds.length===1?"":"s"} to ${e==="individual"?"per-chair":e==="whole"?"whole-table":"flexible-group"} booking.`)}catch(a){var n,o;const r=a instanceof he&&a.code==="table_inventory_in_use";this.toastErr(r?"Release held, booked, or blocked table inventory before changing its booking mode.":"Couldn't update table booking. No table mode was changed."),(n=(o=this.opts).onError)===null||n===void 0||n.call(o,a)}finally{this.tableBookingSaving=!1,this.mode==="tables"&&this.renderTablesRail()}}}async reloadEventChart(){var t;const e=await this.withAuthRetry(()=>this.api.chart(this.key));this.inventoryModelVersion=e.event.inventoryModelVersion===2?2:1;const i=await this.organizerAssetUrls.prepareRendererChart(e.doc);(t=this.renderer)===null||t===void 0||t.destroy(),this.renderer=null,this.doc=i,this.labelToId.clear(),this.labelToSeat.clear(),this.allIds=[],this.gaUnitLabelSet.clear(),this.status.clear(),this.counts={held:0,booked:0,blocked:0},this.serverBaseline=null,this.lastSelectionLabels.clear(),this.buildUnitUniverse(i),this.buildRenderer(),this.buildSectionOptions(),this.settleMode(),await Promise.all([this.resnapshot(),this.refreshAvailability()]),this.paintRail()}selectAll(){var t,e;if(this.mode==="select")return this.selectByLabels([...this.labelToSeat.values()].filter(s=>this.canSelectObject(s)).map(s=>s.label));const i=(t=(e=this.renderer)===null||e===void 0?void 0:e.selectAllSelectable())!==null&&t!==void 0?t:[];return this.syncSelection(),i}selectSection(t){if(!this.renderer)return[];const e=this.renderer.getSelectableInSection(t);return this.renderer.selectByLabels(e.map(i=>i.label)),this.syncSelection(),this.renderer.getSelection()}setFilteredSection(t){var e,i;const s=t.trim(),n=this.filterableSections().filter(r=>r.label===s);if(!n.length)throw new Error(`Unknown event section: ${t}`);const o=s!==this.filteredSectionLabel;this.filteredSectionLabel=s,this.mode==="filterSections"&&(this.applyFilteredSectionCanvas(n),this.renderFilterSectionsRail());const a=n.map(({id:r,label:l,seatCount:c,zone:d})=>({id:r,label:l,seatCount:c,...d?{zone:d}:{}}));return o&&((e=(i=this.opts).onFilteredSectionChange)===null||e===void 0||e.call(i,a)),a}clearFilteredSection(){var t,e,i,s,n;const o=this.filteredSectionLabel!==null;this.filteredSectionLabel=null,(t=this.renderer)===null||t===void 0||t.setDimmedSections(null),(e=this.renderer)===null||e===void 0||e.clearSectionFocus(),(i=this.renderer)===null||i===void 0||i.zoomToFit(),this.mode==="filterSections"&&this.renderFilterSectionsRail(),o&&((s=(n=this.opts).onFilteredSectionChange)===null||s===void 0||s.call(n,[]))}getFilteredSections(){return this.filteredSectionLabel?this.filterableSections().filter(t=>t.label===this.filteredSectionLabel).map(({id:t,label:e,seatCount:i,zone:s})=>({id:t,label:e,seatCount:i,...s?{zone:s}:{}})):[]}selectByLabels(t){var e;let i=t;if(this.mode==="select"){var s,n;const o=new Set(this.selectionLabels()),a=this.selectionCap(),r=[...new Set(t)].filter(c=>!o.has(c)).map(c=>this.labelToSeat.get(c)).filter(c=>!!c&&this.canSelectObject(c)),l=Math.max(0,a-o.size);r.length>l&&((s=(n=this.opts).onSelectionLimit)===null||s===void 0||s.call(n,a)),i=r.slice(0,l).map(c=>c.label)}return(e=this.renderer)===null||e===void 0||e.selectByLabels(i),this.syncSelection(),this.getSelection()}selectObjects(t){return this.selectByLabels(t)}deselectObjects(t){var e;const i=t.map(s=>this.labelToId.get(s)).filter(s=>!!s);return(e=this.renderer)===null||e===void 0||e.deselect(i),this.syncSelection(),this.getSelection()}selectCategories(t){const e=new Set(t);return this.selectByLabels([...this.labelToSeat.values()].filter(i=>e.has(i.categoryKey)).map(i=>i.label))}deselectCategories(t){const e=new Set(t);return this.deselectObjects(this.getSelection().filter(i=>e.has(i.categoryKey)).map(i=>i.label))}setSelectableObjects(t){this.opts.selectableObjects=[...t],this.selectableObjectLabels=new Set(t),this.reconcileSelectPolicy()}setUnavailableObjectsSelectable(t){this.opts.unavailableObjectsSelectable=t,this.reconcileSelectPolicy()}setObjectSelectable(t){this.opts.isObjectSelectable=t,this.reconcileSelectPolicy()}setMaxSelectedObjects(t){this.assertSelectionOptions(t,this.opts.numberOfPlacesToSelect),this.opts.maxSelectedObjects=t,this.trimSelectionToCap(),this.updateRendererInteraction(),this.syncSelection()}setNumberOfPlacesToSelect(t){this.assertSelectionOptions(this.opts.maxSelectedObjects,t),this.opts.numberOfPlacesToSelect=t,this.selectionWasValid=null,this.trimSelectionToCap(),this.updateRendererInteraction(),this.syncSelection()}getSelectionValidity(){const t=this.opts.numberOfPlacesToSelect;if(t===void 0)return null;const e=this.getSelection(),i=e.length;return{isValid:i===t,count:i,required:t,remaining:Math.max(0,t-i),objects:e}}clearSelection(){var t;(t=this.renderer)===null||t===void 0||t.clearSelection(),this.syncSelection()}getSelection(){var t,e;return(t=(e=this.renderer)===null||e===void 0?void 0:e.getSelection())!==null&&t!==void 0?t:[]}getReport(){return this.api.report(this.key).then(t=>(this.applyReportRevenue(t),t))}getControlRoomSnapshot(t=this.trendWindowMinutes){return this.setTrendWindow(t)}getConnection(){return{status:this.connectionStatus,lastMessageAt:this.lastMessageAt}}getLog(t={}){return this.api.log(this.key,t)}async setHoldTtl(t){try{await this.api.setHoldTtl(this.key,t),this.done("setHoldTtl",[],t?`Hold window set to ${Math.round(t/6e4)} min.`:"Hold window reset.")}catch(s){var e,i;this.toastErr("Couldn't update the hold window."),(e=(i=this.opts).onError)===null||e===void 0||e.call(i,s)}}zoomToFit(){var t,e;if(this.mode==="filterSections"&&this.filteredSectionLabel){this.clearFilteredSection();return}(t=this.renderer)===null||t===void 0||t.clearSectionFocus(),(e=this.renderer)===null||e===void 0||e.zoomToFit()}destroy(){var t,e,i,s,n;if(this.closed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.feedTimer&&clearInterval(this.feedTimer),this.toastTimer&&clearTimeout(this.toastTimer),this.liveEventTimer&&clearTimeout(this.liveEventTimer),this.kpiCleanupTimer&&clearTimeout(this.kpiCleanupTimer),this.followLiveTimer&&clearTimeout(this.followLiveTimer),this.followSeatTimer&&clearTimeout(this.followSeatTimer),this.unblockAllConfirmTimer&&clearTimeout(this.unblockAllConfirmTimer),this.paintHandle!==null&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(this.paintHandle),this.paintHandle=null,(t=this.channels)===null||t===void 0||t.destroy(),this.channels=null,this.channelsLoading=null,this.tokenRefreshTimer&&clearTimeout(this.tokenRefreshTimer),(e=this.layoutObserver)===null||e===void 0||e.disconnect(),this.layoutObserver=null,(i=this.root)===null||i===void 0||i.removeEventListener("keydown",this.onKeyDown),(s=this.els.rail)===null||s===void 0||s.removeEventListener("click",this.onRailClick),typeof document!="undefined"&&document.removeEventListener("fullscreenchange",this.onFullscreenChange),this.ws){try{this.ws.close()}catch{}this.ws=null}(n=this.renderer)===null||n===void 0||n.destroy(),this.renderer=null,this.organizerAssetUrls.dispose(),this.root&&this.root.parentNode===this.host&&this.host.removeChild(this.root)}buildRenderer(){if(!this.doc)return;const t=this.isBulkSelectMode();this.renderer=new Pn(this.mapHost,{manageMode:!0,marqueeSelect:t,maxSelection:this.selectionCap(),selectableStatuses:this.selectableStatuses(),currency:this.currency,onSelect:e=>this.handleSeatSelect(e),onDeselect:()=>this.syncSelection(),onSelectionLimit:e=>{var i,s;return(i=(s=this.opts).onSelectionLimit)===null||i===void 0?void 0:i.call(s,e)},onMarquee:()=>this.syncSelection(),onSectionTap:e=>{var i,s;if(this.mode==="filterSections"){const n=this.filterableSections().find(o=>o.id===e);n&&this.setFilteredSection(n.label);return}(i=this.renderer)===null||i===void 0||i.focusSection(e),(s=this.channels)===null||s===void 0||s.handleSectionFocus(e)},onViewChange:()=>{var e;this.updateZoomHint(),(e=this.channels)===null||e===void 0||e.handleViewChange()}}),this.renderer.setChart(this.doc),this.repaintAll(),this.applyHeatOverlay(),this.updateZoomHint()}isBulkSelectMode(){var t;return this.mode==="block"||this.mode==="categories"||this.mode==="channels"&&((t=this.channels)===null||t===void 0?void 0:t.usesMarqueeSelection())===!0}selectableStatuses(){var t;return this.mode==="block"?["free","not_for_sale"]:this.mode==="select"||this.mode==="categories"||this.mode==="inspect"||this.isBulkSelectMode()||this.mode==="channels"&&((t=this.channels)===null||t===void 0?void 0:t.canSelect())===!0?["free","held","booked","not_for_sale"]:[]}updateRendererInteraction(){var t;const e=this.isBulkSelectMode();(t=this.renderer)===null||t===void 0||t.setManageInteraction({manageMode:!0,marqueeSelect:e,maxSelection:this.selectionCap(),selectableStatuses:this.selectableStatuses()}),this.updateZoomHint()}handleSeatSelect(t){if(this.mode==="select"&&!this.canSelectObject(t)){var e;(e=this.renderer)===null||e===void 0||e.deselect([t.id]),this.syncSelection();return}if(this.mode==="inspect"){var i;const s=this.getSelection().filter(n=>n.id!==t.id).map(n=>n.id);s.length&&((i=this.renderer)===null||i===void 0||i.deselect(s))}this.syncSelection()}buildUnitUniverse(t){for(const e of Ye(t))this.labelToId.set(e.label,e.id),this.labelToSeat.set(e.label,e),this.allIds.push(e.id);for(const e of Qi(t))for(const i of Zi(e))this.labelToId.has(i)||this.gaUnitLabelSet.add(i)}unitTotal(){return this.allIds.length+this.gaUnitLabelSet.size}knownLabels(){return[...this.labelToId.keys(),...this.gaUnitLabelSet]}repaintAll(){const t=this.renderer;if(!t)return;this.allIds.length&&t.setStatus(this.allIds,"free");const e={free:[],held:[],booked:[],not_for_sale:[]};for(const[i,s]of this.status.entries()){const n=this.labelToId.get(i);n&&e[io(s)].push(n)}["held","booked","not_for_sale"].forEach(i=>{e[i].length&&t.setStatus(e[i],i)})}async connect(){if(this.closed)return;let t;try{if(t=(await this.withAuthRetry(()=>this.api.subscribeTicket(this.key))).protocols,!t.length)throw new Error("manage_subscribe_ticket_missing")}catch(a){var e,i;this.setLive(!1),(e=(i=this.opts).onError)===null||e===void 0||e.call(i,a),this.scheduleReconnect();return}if(this.closed)return;let s;try{s=new WebSocket(this.api.socketUrl(this.key),t)}catch(a){var n,o;(n=(o=this.opts).onError)===null||n===void 0||n.call(o,a),this.scheduleReconnect();return}this.ws=s,s.onopen=()=>{this.attempt=0,this.setLive(!0),this.resnapshot().then(()=>this.refreshControlRoom()).catch(a=>{var r,l;return(r=(l=this.opts).onError)===null||r===void 0?void 0:r.call(l,a)}),this.refreshAvailability()},s.onmessage=a=>this.onMessage(a),s.onclose=()=>{this.ws===s&&(this.ws=null),this.setLive(!1),this.scheduleReconnect()},s.onerror=()=>{try{s.close()}catch{}}}scheduleReconnect(){if(this.closed||this.reconnectTimer)return;const t=Math.min(1e3*2**Math.min(this.attempt++,5),15e3);this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}onMessage(t){let e;try{e=JSON.parse(typeof t.data=="string"?t.data:"")}catch{return}if(!e||typeof e!="object")return;this.lastMessageAt=Date.now();const i=e;if((Array.isArray(i.hidden)||Array.isArray(i.closed))&&this.updateEffectiveAvailability(i.hidden,i.closed),i.type==="presence"){if(typeof i.shoppingSessions=="number"&&typeof i.activeHolds=="number"){if(this.livePresence={at:Date.now(),value:{shoppingSessions:i.shoppingSessions,activeHolds:i.activeHolds}},this.controlRoomSnapshot){var s,n;this.controlRoomSnapshot={...this.controlRoomSnapshot,presence:this.livePresence.value},(s=(n=this.opts).onControlRoom)===null||s===void 0||s.call(n,this.controlRoomSnapshot)}this.lastSyncedAt=Date.now(),this.recomputeTallies(),this.paintMonitorInsights()}return}if(i.type!=="hidden"){if(i.seats&&typeof i.seats=="object")this.applySnapshot(i.seats,typeof i.default=="string"?i.default:void 0);else if(Array.isArray(i.changes)){var o,a;const d=[],u=new Map;for(const p of i.changes){var r,l;const f=["free","held","booked","blocked"].includes(p.status)?p.status:"free",v=(r=this.status.get(p.label))!==null&&r!==void 0?r:"free";if(v===f)continue;this.setStatusLabel(p.label,f,v);const m=this.labelToId.get(p.label);if(m){var c;(c=this.renderer)===null||c===void 0||c.setStatus([m],io(f)),d.push(m)}const g=this.verbFor(v,f),b=`${g}:${f}`,y=(l=u.get(b))!==null&&l!==void 0?l:{labels:[],verb:g,status:f};y.labels.push(p.label),u.set(b,y)}for(const p of u.values()){const f=this.pushActivity(p.labels,p.verb,p.status);f&&this.paintSpatialActivity(f)}d.length&&(this.lastSyncedAt=Date.now(),this.afterPaint());const h=typeof((o=i.bookedValue)===null||o===void 0?void 0:o.gross)=="number"?i.bookedValue.gross:(a=i.revenue)===null||a===void 0?void 0:a.gross;typeof h=="number"&&Number.isFinite(h)&&this.applyLiveGross(h),this.recomputeTallies()}}}applyLiveGross(t){if(this.liveGross={at:Date.now(),value:t},this.authoritativeGrossRevenue=t,this.revenueStatus="current",this.controlRoomSnapshot){var e,i,s;const n={...(e=this.controlRoomSnapshot.bookedValue)!==null&&e!==void 0?e:this.controlRoomSnapshot.revenue,gross:t};this.controlRoomSnapshot={...this.controlRoomSnapshot,bookedValue:n,revenue:n},(i=(s=this.opts).onControlRoom)===null||i===void 0||i.call(s,this.controlRoomSnapshot)}}setStatusLabel(t,e,i=(s=>(s=this.status.get(t))!==null&&s!==void 0?s:"free")()){this.status.set(t,e),i!==e&&(i!=="free"&&(this.counts[i]-=1),e!=="free"&&(this.counts[e]+=1))}async resnapshot(){try{const t=await this.api.objects(this.key);this.applySnapshot(t.seats),this.updateEffectiveAvailability(t.hidden,t.closed),this.lastMessageAt=Date.now()}catch{}}applySnapshot(t,e){const i=n=>["free","held","booked","blocked"].includes(n)?n:"free",s=new Map;if(e!==void 0){const n=i(e);for(const o of this.knownLabels())s.set(o,n)}for(const[n,o]of Object.entries(t))s.set(n,i(o));this.status=s,this.modelVersion+=1,this.recountAll(),this.lastSyncedAt=Date.now(),this.repaintAll(),this.afterPaint(),this.recomputeTallies()}recountAll(){const t={held:0,booked:0,blocked:0};for(const e of this.status.values())e!=="free"&&(t[e]+=1);this.counts=t}setSeatsLocal(t,e){var i;const s=[];for(const n of t){this.setStatusLabel(n,e);const o=this.labelToId.get(n);o&&s.push(o)}s.length&&((i=this.renderer)===null||i===void 0||i.setStatus(s,io(e))),this.afterPaint(),this.recomputeTallies()}afterPaint(){if(this.keepLive&&typeof document!="undefined"&&document.hidden){var t;(t=this.renderer)===null||t===void 0||t.forceDraw()}}activityColor(t){return t==="held"?"#f4b740":t==="booked"?"#22a06b":t==="blocked"?"#8b94ac":"#6e7bff"}sectionsForLabels(t){const e=new Set;for(const s of t){const n=this.labelToSeat.get(s);if(!n)continue;const o=this.sectionByObject.get(n.rowId);o&&o!=="__ungrouped__"&&e.add(o)}const i=[...e];return{ids:i,labels:i.map(s=>{var n;return(n=this.sectionLabelById.get(s))!==null&&n!==void 0?n:s})}}pulseSeatLabels(t,e){const i=this.activityColor(e);for(const n of t.slice(0,Cm)){var s;const o=this.labelToId.get(n);o&&((s=this.renderer)===null||s===void 0||s.flashSeat(o,i))}}paintSpatialActivity(t){var e,i,s;const n=(e=t.sectionIds)!==null&&e!==void 0?e:this.sectionsForLabels(t.labels).ids,o=(i=(s=this.renderer)===null||s===void 0?void 0:s.getFocusedSection())!==null&&i!==void 0?i:null,a=this.followLive&&n.length===1&&(t.status==="held"||t.status==="booked");if(a&&o===n[0]){this.pulseSeatLabels(t.labels,t.status);return}if(a){this.followLiveTimer&&clearTimeout(this.followLiveTimer),this.followSeatTimer&&clearTimeout(this.followSeatTimer),this.followLiveTimer=setTimeout(()=>{var l;this.followLiveTimer=null,(l=this.renderer)===null||l===void 0||l.focusSection(n[0]),this.followSeatTimer=setTimeout(()=>{this.followSeatTimer=null,this.pulseSeatLabels(t.labels,t.status)},520)},220);return}if(!o&&n.length){const l=this.activityColor(t.status);for(const c of n.slice(0,Zl)){var r;(r=this.renderer)===null||r===void 0||r.flashSection(c,l)}return}(!n.length||o&&n.includes(o))&&this.pulseSeatLabels(t.labels,t.status)}locateSection(t){var e;(e=this.renderer)===null||e===void 0||e.focusSection(t)}locateActivity(t){var e;const i=this.feed.find(n=>n.id===t);if(!i)return;const s=(e=i.sectionIds)!==null&&e!==void 0?e:this.sectionsForLabels(i.labels).ids;if(this.followSeatTimer&&clearTimeout(this.followSeatTimer),s.length===1){this.locateSection(s[0]),this.followSeatTimer=setTimeout(()=>{this.followSeatTimer=null,this.pulseSeatLabels(i.labels,i.status)},520);return}this.zoomToFit(),this.followSeatTimer=setTimeout(()=>{if(this.followSeatTimer=null,s.length){const o=this.activityColor(i.status);for(const a of s.slice(0,Zl)){var n;(n=this.renderer)===null||n===void 0||n.flashSection(a,o)}}else this.pulseSeatLabels(i.labels,i.status)},280)}showLiveEvent(t){var e;const i=this.els.liveevent;if(!i)return;const s=(e=t.sectionLabels)!==null&&e!==void 0?e:[],n=s.length===1?s[0]:s.length>1?`${s.length} sections`:t.label,o=t.count===1?"seat":"seats";i.innerHTML=` - ${Z(n)} · ${t.count.toLocaleString()} ${o} ${Z(t.verb)} - Live`,i.classList.add("on"),this.liveEventTimer&&clearTimeout(this.liveEventTimer),this.liveEventTimer=setTimeout(()=>{this.liveEventTimer=null,i.classList.remove("on"),i.innerHTML=""},2800)}applyReportRevenue(t){this.authoritativeGrossRevenue=t.report.byCategory.reduce((e,i)=>{const s=Number.isFinite(i.bookedValue)?i.bookedValue:i.bookedRevenue;return e+(Number.isFinite(s)?s:0)},0),this.revenueStatus="current",this.recomputeTallies()}async refreshControlRoom(){const t=++this.revenueRequest,e=Date.now();try{var i,s,n;const r=await this.api.controlRoom(this.key,this.trendWindowMinutes),l=(i=(s=r.bookedValue)!==null&&s!==void 0?s:r.revenue)!==null&&i!==void 0?i:{gross:0,bySection:[]},c=((n=l.bySection)!==null&&n!==void 0?n:[]).map(h=>{const p=Number.isFinite(h.bookedValue)?h.bookedValue:h.bookedRevenue;return{...h,bookedValue:p!=null?p:0,bookedRevenue:p!=null?p:0}}),d={...l,bySection:c};let u={...r,bookedValue:d,revenue:d};if(t===this.revenueRequest){var o,a;if(this.livePresence&&this.livePresence.at>=e?u={...u,presence:this.livePresence.value}:this.livePresence=null,this.liveGross&&this.liveGross.at>=e){const h={...u.bookedValue,gross:this.liveGross.value};u={...u,bookedValue:h,revenue:h}}else this.liveGross=null;this.controlRoomSnapshot=u,this.rebaseServerTotals(u),this.lastSyncedAt=Date.now(),this.authoritativeGrossRevenue=u.bookedValue.gross,this.authoritativeCurrency=u.currency,this.currency=u.currency,this.revenueStatus="current",this.recomputeTallies(),this.applyHeatOverlay(),this.paintMonitorInsights(),(o=(a=this.opts).onControlRoom)===null||o===void 0||o.call(a,u)}return u}catch(r){throw t===this.revenueRequest&&(this.revenueStatus="stale",this.recomputeTallies()),r}}rebaseServerTotals(t){const e=t.totals;if(!e||["free","held","booked","blocked"].some(i=>!Number.isFinite(e[i]))){this.serverBaseline=null;return}this.serverBaseline={model:this.modelVersion,server:{free:e.free,held:e.held,booked:e.booked,blocked:e.blocked},client:this.clientTallies()}}clientTallies(){const{held:t,booked:e,blocked:i}=this.counts;return{held:t,booked:e,blocked:i,free:Math.max(0,this.unitTotal()-t-e-i)}}buildTallies(){var t,e;const i=this.clientTallies(),s=((t=this.serverBaseline)===null||t===void 0?void 0:t.model)===this.modelVersion?this.serverBaseline:null,n=l=>s?Math.max(0,s.server[l]+(i[l]-s.client[l])):i[l],o=(e=this.controlRoomSnapshot)===null||e===void 0||(e=e.event)===null||e===void 0?void 0:e.seatTotal,a={free:n("free"),held:n("held"),booked:n("booked"),blocked:n("blocked"),total:Number.isFinite(o)?o:this.unitTotal(),capacityPct:0,sellThroughPct:0,bookedValue:this.authoritativeGrossRevenue,grossRevenue:this.authoritativeGrossRevenue,bookedValueStatus:this.revenueStatus,revenueStatus:this.revenueStatus,currency:this.currency};a.capacityPct=a.total?Math.round(a.booked/a.total*100):0;const r=a.total-a.blocked;return a.sellThroughPct=r>0?Math.round(a.booked/r*100):0,a}recomputeTallies(){if(!this.closed){if(typeof requestAnimationFrame!="function"){this.flushTallies();return}this.paintHandle===null&&(this.paintHandle=requestAnimationFrame(()=>{this.paintHandle=null,this.flushTallies()}))}}flushTallies(){var t,e,i;if(this.closed)return;const s=this.buildTallies();this.paintKpis(s),this.mode==="view"?(this.paintLegend(s),this.paintMonitorInsights()):this.mode==="inspect"?this.renderInspectRail(this.getSelection()):this.mode==="block"?this.paintSelBar(this.getSelection()):this.mode==="channels"&&((t=this.channels)===null||t===void 0||t.handleSelectionChange()),(e=(i=this.opts).onTallies)===null||e===void 0||e.call(i,s)}verbFor(t,e){return e==="held"?"held":e==="booked"?"booked":e==="blocked"?"blocked":e==="free"?t==="blocked"?"unblocked":t==="booked"?"cancelled":"released":e}pushActivity(t,e,i,s=Date.now()){var n,o;const a=t[0];if(!a)return null;const r=this.sectionsForLabels(t),l={id:`${a}:${s}:${Math.random().toString(36).slice(2,6)}`,at:s,label:a,labels:[...t],count:t.length,verb:e,status:i,sectionIds:r.ids,sectionLabels:r.labels};return this.feed.unshift(l),this.feed.length>Hs&&(this.feed.length=Hs),this.mode==="view"&&this.paintFeed(),this.showLiveEvent(l),(n=(o=this.opts).onActivity)===null||n===void 0||n.call(o,l),l}seedFeed(t){const e={hold:"held",book:"booked",release:"released",expire:"expired",block:"blocked",unblock:"unblocked",unbook:"cancelled"},i={hold:"held",book:"booked",release:"free",expire:"free",block:"blocked",unblock:"free",unbook:"free"};for(const r of t){var s,n,o,a;const l=r.labels[0];if(!l)continue;const c=this.sectionsForLabels(r.labels),d={id:`log:${r.id}`,at:r.at,label:l,labels:[...r.labels],count:r.labels.length,verb:(s=e[r.action])!==null&&s!==void 0?s:r.action,status:(n=i[r.action])!==null&&n!==void 0?n:"free",sectionIds:c.ids,sectionLabels:c.labels};this.feed.push(d),(o=(a=this.opts).onActivity)===null||o===void 0||o.call(a,d)}this.feed.sort((r,l)=>l.at-r.at),this.feed.length>Hs&&(this.feed.length=Hs),this.mode==="view"&&this.paintFeed()}startFeedClock(){this.feedTimer=setInterval(()=>{this.mode==="view"&&(this.paintFeed(),this.paintMonitorInsights())},1e4)}selectionCap(){var t,e;return this.mode!=="select"?1e6:(t=(e=this.opts.numberOfPlacesToSelect)!==null&&e!==void 0?e:this.opts.maxSelectedObjects)!==null&&t!==void 0?t:1e6}canSelectObject(t){var e,i;const s=(e=this.status.get(t.label))!==null&&e!==void 0?e:"free",n=(i=this.opts.unavailableObjectsSelectable)!==null&&i!==void 0?i:!0,o=s==="free"||n||this.selectableObjectLabels.has(t.label);if(!this.opts.isObjectSelectable)return o;try{return this.opts.isObjectSelectable(t,o)===!0}catch(l){var a,r;return(a=(r=this.opts).onError)===null||a===void 0||a.call(r,l),!1}}applyInitialSelection(){var t;this.initialSelectionApplied||this.mode!=="select"||!this.renderer||(this.initialSelectionApplied=!0,this.selectByLabels((t=this.opts.selectedObjects)!==null&&t!==void 0?t:[]))}trimSelectionToCap(){var t;if(this.mode!=="select")return;const e=this.getSelection(),i=this.selectionCap();e.length<=i||(t=this.renderer)===null||t===void 0||t.deselect(e.slice(i).map(s=>s.id))}reconcileSelectPolicy(){var t;if(this.mode!=="select")return;const e=this.getSelection().filter(i=>!this.canSelectObject(i));e.length&&((t=this.renderer)===null||t===void 0||t.deselect(e.map(i=>i.id))),this.trimSelectionToCap(),this.syncSelection()}selectionLabels(){return this.getSelection().map(t=>t.label)}syncSelection(){var t,e,i;const s=this.getSelection();this.mode==="block"?this.paintSelBar(s):this.mode==="inspect"?this.renderInspectRail(s):this.mode==="select"?this.paintSelectSelection(s):this.mode==="categories"?this.paintCategorySelection(s):this.mode==="channels"&&((t=this.channels)===null||t===void 0||t.handleSelectionChange());const n=new Map(s.map(v=>[v.label,v]));if(this.mode==="select"){for(const[m,g]of n){var o,a;this.lastSelectionLabels.has(m)||(o=(a=this.opts).onObjectSelected)===null||o===void 0||o.call(a,g)}for(const m of this.lastSelectionLabels)if(!n.has(m)){var r,l;const g=this.labelToSeat.get(m);g&&((r=(l=this.opts).onObjectDeselected)===null||r===void 0||r.call(l,g))}const v=this.getSelectionValidity();if(v){var c,d;if((c=(d=this.opts).onSelectionValidityChange)===null||c===void 0||c.call(d,v),this.selectionWasValid!==v.isValid){var u,h,p,f;v.isValid?(u=(h=this.opts).onSelectionValid)===null||u===void 0||u.call(h,v):(p=(f=this.opts).onSelectionInvalid)===null||p===void 0||p.call(f,v)}this.selectionWasValid=v.isValid}}this.lastSelectionLabels=new Set(n.keys()),(e=(i=this.opts).onSelectionChange)===null||e===void 0||e.call(i,s)}buildChrome(){const t=document.createElement("div");t.className="slm",t.tabIndex=0,t.setAttribute("role","region"),t.setAttribute("aria-label","SeatLayer live control room");const e=Tl(this.opts.theme);for(const[s,n]of Object.entries(e))t.style.setProperty(s,n);t.innerHTML=` -
-
- ${Ql.map(s=>``).join("")} -
- - CONNECTING -
- - - -
-
-
-
-
-
-
Zoom in to marquee-select
-
-
-
- -
-
- `,this.host.appendChild(t),this.root=t,this.updateContainerLayout(),typeof ResizeObserver!="undefined"&&(this.layoutObserver=new ResizeObserver(()=>this.updateContainerLayout()),this.layoutObserver.observe(t));const i=s=>t.querySelector(`[data-ref="${s}"]`);this.mapHost=i("maphost"),this.els={modes:i("modes"),tools:i("tools"),livetext:i("livetext"),kpis:i("kpis"),follow:i("follow"),heat:i("heat"),fullscreen:i("fullscreen"),zoomhint:i("zoomhint"),liveevent:i("liveevent"),rail:i("rail"),toast:i("toast"),zfit:i("zfit")},this.els.modes.querySelectorAll("[data-mode]").forEach(s=>s.addEventListener("click",()=>this.setMode(s.dataset.mode))),this.els.tools.addEventListener("change",()=>this.setMode(this.els.tools.value)),this.els.zfit.addEventListener("click",()=>this.zoomToFit()),this.els.follow.addEventListener("click",()=>this.setFollowLive(!this.followLive)),this.els.heat.addEventListener("click",()=>this.setHeatOverlay(!this.heatEnabled)),this.els.fullscreen.addEventListener("click",()=>this.toggleFullscreen()),t.addEventListener("keydown",this.onKeyDown),this.els.rail.addEventListener("click",this.onRailClick),document.addEventListener("fullscreenchange",this.onFullscreenChange),this.paintModeTabs(),this.paintFollowLiveButton(),this.paintHeatButton(),this.paintFullscreenButton()}updateContainerLayout(){var t,e,i;const s=((t=this.root)===null||t===void 0?void 0:t.getBoundingClientRect().width)||this.host.clientWidth;(e=this.root)===null||e===void 0||e.classList.toggle("compact",s>0&&s<800),(i=this.channels)===null||i===void 0||i.handleLayoutChange()}filterableSections(){return this.sectionsBase?[...this.sectionsBase.sections,...this.sectionsBase.ungrouped?[this.sectionsBase.ungrouped]:[]]:[]}applyFilteredSectionCanvas(t=this.filterableSections().filter(e=>e.label===this.filteredSectionLabel)){if(!this.renderer||this.mode!=="filterSections"||!t.length)return;const e=new Set(t.map(c=>c.id)),i=this.filterableSections().filter(c=>!e.has(c.id)).map(c=>c.id);this.renderer.clearSectionFocus(),this.renderer.setClosedSections(null),this.renderer.setDimmedSections(i);const s=t.flatMap(c=>c.seatLabels).map(c=>this.labelToSeat.get(c)).filter(c=>!!c&&Number.isFinite(c.x)&&Number.isFinite(c.y));if(!s.length){this.renderer.focusRegion(t[0].id);return}const n=Math.min(...s.map(c=>c.x)),o=Math.min(...s.map(c=>c.y)),a=Math.max(...s.map(c=>c.x)),r=Math.max(...s.map(c=>c.y)),l=Math.max(40,Math.max(a-n,r-o)*.08);this.renderer.focusRegion({x:n-l,y:o-l,width:Math.max(1,a-n)+l*2,height:Math.max(1,r-o)+l*2})}buildSectionOptions(){if(this.doc)try{const t=Ji(this.doc);this.sectionsBase=t,this.sectionOptions=[],this.sectionByObject=new Map(t.objectToSection),this.sectionLabelById.clear();for(const e of t.sections)this.sectionOptions.push({id:e.id,label:e.label}),this.sectionLabelById.set(e.id,e.label);t.ungrouped&&(this.sectionOptions.push({id:ct,label:t.ungrouped.label}),this.sectionLabelById.set(ct,t.ungrouped.label))}catch{}}toolAvailable(t){return t==="view"?!0:t==="channels"&&!this.channelCaps.view||t==="categories"&&!this.categoryCanManage||t==="tables"&&(!this.tableCanManage||!this.tables().length)?!1:!this.opts.tools||this.opts.tools.includes(t)}settleMode(){this.toolAvailable(this.mode)?this.paintModeTabs():this.setMode("view")}tables(){return(this.doc?Dt(this.doc):[]).flatMap(t=>t.objects).filter(t=>t.type==="table")}paintModeTabs(){var t,e;const i=[];(t=this.els.modes)===null||t===void 0||t.querySelectorAll(".slm-modegroup").forEach(n=>{var o,a;const r=[];n.querySelectorAll("[data-mode]").forEach(l=>{var c;const d=l.dataset.mode,u=this.toolAvailable(d);if(l.hidden=!u,!u)return;r.push({mode:d,label:(c=l.textContent)!==null&&c!==void 0?c:d});const h=d===this.mode;l.classList.toggle("on",h),l.setAttribute("aria-selected",String(h)),l.tabIndex=h?0:-1}),n.hidden=r.length===0,r.length&&i.push({label:(o=(a=n.querySelector(".slm-modegroup-label"))===null||a===void 0?void 0:a.textContent)!==null&&o!==void 0?o:"",tools:r})});const s=this.els.tools;s&&(s.innerHTML=i.map(n=>`${n.tools.map(o=>``).join("")}`).join(""),s.value=this.mode),(e=this.root)===null||e===void 0||e.classList.toggle("block-mode",this.mode==="block")}railHeader(t,e,i){const s=e==="read"?"Read-only":e==="event"?"This event only":"Your app";return`

${Z(t)}

${s}
-

${i}

`}paintFollowLiveButton(){const t=this.els.follow;t&&(t.classList.toggle("on",this.followLive),t.setAttribute("aria-pressed",String(this.followLive)),t.setAttribute("title",this.followLive?"Following new holds and bookings. Turn off to keep the current view.":"Stay on the current map view. Enable to follow new holds and bookings."))}paintHeatButton(){const t=this.els.heat;t&&(t.classList.toggle("on",this.heatEnabled),t.setAttribute("aria-pressed",String(this.heatEnabled)),t.setAttribute("aria-label",`Booking momentum overlay ${this.heatEnabled?"on":"off"}`),t.setAttribute("title",`${this.heatEnabled?"Hide":"Highlight"} sections booking fastest in the selected time window`),t.textContent="Booking momentum",this.paintMomentumHelp())}paintMomentumHelp(){var t,e;const i=(t=this.els.rail)===null||t===void 0?void 0:t.querySelector('[data-ref="momentumhelp"]');if(!i)return;i.hidden=!this.heatEnabled;const s=i.querySelector('[data-ref="momentumcopy"]');s&&(s.textContent=!((e=this.controlRoomSnapshot)===null||e===void 0)&&e.velocity.bySection.some(n=>n.netBooked>0)?"Warmer sections have more completed bookings, adjusted for section size. Holds and viewers are not counted.":`No completed bookings in the last ${this.trendWindowMinutes} minutes.`)}paintFullscreenButton(){this.els.fullscreen&&(this.els.fullscreen.textContent=this.isFullscreen()?"Exit full screen":"Full screen")}paintTrendWindow(){var t;(t=this.els.rail)===null||t===void 0||t.querySelectorAll("[data-window]").forEach(e=>{const i=Number(e.dataset.window);e.classList.toggle("on",i===this.trendWindowMinutes)})}setLive(t){var e;(e=this.root)===null||e===void 0||e.classList.toggle("live",t),this.els.livetext&&(this.els.livetext.textContent=t?"LIVE":"RECONNECTING"),this.paintMonitorInsights();const i=t?"live":"reconnecting";if(i!==this.connectionStatus){this.connectionStatus=i;try{var s,n;(s=(n=this.opts).onConnectionChange)===null||s===void 0||s.call(n,this.getConnection())}catch(r){var o,a;(o=(a=this.opts).onError)===null||o===void 0||o.call(a,r)}}}updateZoomHint(){var t,e;const i=this.els.zoomhint;if(!i)return;const s=this.mode==="block"&&((t=this.renderer)===null||t===void 0||(e=t.getRung)===null||e===void 0?void 0:e.call(t))!=="seats";i.classList.toggle("on",!!s)}formatKpiDelta(t,e,i){const s=e>0?"+":"−",n=Math.abs(e);return t==="booked-value"?`${s}${$s(n,i)}`:t==="booked-pct"?`${s}${n.toLocaleString()}pt`:`${s}${n.toLocaleString()}`}paintKpis(t){var e,i;if(!this.els.kpis)return;const s=t.bookedValueStatus==="current"?$s(t.bookedValue,t.currency):"—",n=this.presenceCounts(),o=[{key:"booked-inventory",raw:t.booked,n:t.booked.toLocaleString(),l:"Booked inventory",dot:"#22a06b",title:"Inventory units booked"},{key:"held-seats",raw:t.held,n:t.held.toLocaleString(),l:"Held inventory",dot:"#f4b740",title:"Inventory currently held"},{key:"free-seats",raw:t.free,n:t.free.toLocaleString(),l:"Available",dot:"#6e7bff",title:"Inventory available to book"},{key:"blocked",raw:t.blocked,n:t.blocked.toLocaleString(),l:"Blocked",dot:"#8b94ac",title:"Inventory withheld from booking"},{key:"viewing-map",raw:(e=n==null?void 0:n.shoppingSessions)!==null&&e!==void 0?e:null,n:n?n.shoppingSessions.toLocaleString():"—",l:"Viewing map",title:"Active map sessions right now"},{key:"active-holds",raw:(i=n==null?void 0:n.activeHolds)!==null&&i!==void 0?i:null,n:n?n.activeHolds.toLocaleString():"—",l:"Active holds",title:"Sessions currently holding inventory"},{key:"booked-pct",raw:t.capacityPct,n:`${t.capacityPct}%`,l:"Booked",title:"Booked inventory as a share of the whole event"},{key:"booked-value",raw:t.bookedValueStatus==="current"?t.bookedValue:null,n:s,l:"Booked value",title:"Configured value attached to booked inventory"}];let a=!1;this.els.kpis.innerHTML=o.map(r=>{const l=this.lastKpiValues.get(r.key),c=r.raw!=null&&l!=null&&r.raw!==l,d=c?r.raw-l:0;c&&(a=!0,this.activeKpiDeltas.set(r.key,{text:this.formatKpiDelta(r.key,d,t.currency),down:d<0})),r.raw!=null&&this.lastKpiValues.set(r.key,r.raw);const u=this.activeKpiDeltas.get(r.key);return`
- ${r.dot?``:""}${r.n}${r.l} - ${u?`${u.text}`:""} -
`}).join(""),a&&(this.kpiCleanupTimer&&clearTimeout(this.kpiCleanupTimer),this.kpiCleanupTimer=setTimeout(()=>{var r,l;this.kpiCleanupTimer=null,this.activeKpiDeltas.clear(),(r=this.els.kpis)===null||r===void 0||r.querySelectorAll(".slm-kpidelta").forEach(c=>c.remove()),(l=this.els.kpis)===null||l===void 0||l.querySelectorAll(".slm-kpi.changed").forEach(c=>c.classList.remove("changed"))},1500))}paintRail(){this.mode==="view"?this.renderViewRail():this.mode==="inspect"?this.renderInspectRail(this.getSelection()):this.mode==="select"?this.renderSelectRail():this.mode==="filterSections"?this.renderFilterSectionsRail():this.mode==="sections"?this.renderSectionsRail():this.mode==="categories"?this.renderCategoriesRail():this.mode==="tables"?this.renderTablesRail():this.mode==="channels"?this.channels?this.channels.paintRail():this.channelsLoading?this.els.rail.innerHTML='
Loading sales channels…
':this.els.rail.innerHTML='':this.renderBlockRail(),this.updateZoomHint()}renderViewRail(){this.els.rail.innerHTML=` - ${this.railHeader("Monitor","read","Watch the event live. Inventory, buyers on the map and booking movement update on this board as they happen — nothing here changes the event.")} -
-
-
-

Section inventory

Configured booked value · booking momentum

-
- ${[5,15,30,60].map(t=>``).join("")} -
-
-
-
WarmHot
-

-
-
-

Activity

-
- `,this.els.presence=this.els.rail.querySelector('[data-ref="presence"]'),this.els.legend=this.els.rail.querySelector('[data-ref="legend"]'),this.els.sections=this.els.rail.querySelector('[data-ref="sections"]'),this.els.feed=this.els.rail.querySelector('[data-ref="feed"]'),this.els.rail.querySelectorAll("[data-window]").forEach(t=>t.addEventListener("click",()=>{const e=Number(t.dataset.window);this.setTrendWindow(e).catch(i=>{var s,n;return(s=(n=this.opts).onError)===null||s===void 0?void 0:s.call(n,i)})})),this.recomputeTallies(),this.paintMonitorInsights(),this.paintTrendWindow(),this.paintMomentumHelp(),this.paintFeed()}presenceCounts(){var t,e,i,s;return(t=(e=(i=this.livePresence)===null||i===void 0?void 0:i.value)!==null&&e!==void 0?e:(s=this.controlRoomSnapshot)===null||s===void 0?void 0:s.presence)!==null&&t!==void 0?t:null}paintMonitorInsights(){if(this.mode!=="view")return;const t=this.controlRoomSnapshot;if(this.els.presence){var e;const n=(e=this.root)===null||e===void 0?void 0:e.classList.contains("live"),o=this.lastSyncedAt?Ll(this.lastSyncedAt,Date.now()):"waiting",a=this.presenceCounts();this.els.presence.innerHTML=` -
${a?a.shoppingSessions.toLocaleString():"—"}Viewing map
-
${a?a.activeHolds.toLocaleString():"—"}Active holds
-
${n?"Healthy":"Reconnecting"}Live connection
-
${o}Last sync
`}if(!this.els.sections)return;if(!t){this.els.sections.innerHTML='
Loading authoritative section metrics…
';return}const i=new Map(t.velocity.bySection.map(n=>[n.sectionId,n])),s=[...t.bookedValue.bySection].sort((n,o)=>{var a,r,l,c;const d=(a=(r=i.get(n.sectionId))===null||r===void 0?void 0:r.netBooked)!==null&&a!==void 0?a:0;return((l=(c=i.get(o.sectionId))===null||c===void 0?void 0:c.netBooked)!==null&&l!==void 0?l:0)-d||o.bookedValue-n.bookedValue});this.els.sections.innerHTML=s.length?s.map(n=>{var o;const a=i.get(n.sectionId),r=(o=a==null?void 0:a.netBooked)!==null&&o!==void 0?o:0,l=`${r>0?"+":""}${r}`,c=(a==null?void 0:a.trend)==="rising"||(a==null?void 0:a.trend)==="cooling"?a.trend:"steady";return``}).join(""):'
No section metrics are available for this chart.
',this.paintTrendWindow(),this.paintMomentumHelp()}applyHeatOverlay(){var t;const e=this.controlRoomSnapshot;if(!this.heatEnabled||!e){var i;(i=this.renderer)===null||i===void 0||i.setSectionHeat(null);return}const s=new Map(e.bookedValue.bySection.map(r=>[r.sectionId,Math.max(1,r.total)])),n=e.velocity.bySection.map(r=>{var l;return{sectionId:r.sectionId,rate:Math.max(0,r.netBooked)/((l=s.get(r.sectionId))!==null&&l!==void 0?l:1)/e.velocity.windowMinutes}}),o=Math.max(0,...n.map(r=>r.rate)),a={};for(const r of n)a[r.sectionId]=o>0?Math.sqrt(r.rate/o):0;(t=this.renderer)===null||t===void 0||t.setSectionHeat(a)}renderSelectRail(){var t,e,i;const s=(t=(e=this.doc)===null||e===void 0?void 0:e.categories)!==null&&t!==void 0?t:[],n=this.opts.numberOfPlacesToSelect,o=this.selectionCap();this.els.rail.innerHTML=` - ${this.railHeader("Select","host","Pick seats for your own back-office operation — the selection is handed to your app. This tool is read-only inside the control room: it never books, releases or blocks seats by itself.")} -
0selected
-

${n?`Select exactly ${n.toLocaleString()} object${n===1?"":"s"}.`:`Up to ${o.toLocaleString()} objects may be selected.`}

-
- - -
- ${s.length?`

Select by category

-
${s.map(a=>{var r,l;return` - `}).join("")}
`:""}`,this.els.selectnum=this.els.rail.querySelector('[data-ref="selectnum"]'),this.els.selectmeta=this.els.rail.querySelector('[data-ref="selectmeta"]'),this.els.selectvalidity=this.els.rail.querySelector('[data-ref="selectvalidity"]'),this.els.selectclear=this.els.rail.querySelector('[data-ref="selectclear"]'),(i=this.els.rail.querySelector('[data-ref="selectall"]'))===null||i===void 0||i.addEventListener("click",()=>this.selectAll()),this.els.selectclear.addEventListener("click",()=>this.clearSelection()),this.els.rail.querySelectorAll("[data-select-cat]").forEach(a=>{a.addEventListener("click",()=>{const r=a.dataset.selectCat,l=[...this.labelToSeat.values()].filter(d=>d.categoryKey===r&&this.canSelectObject(d)),c=new Set(this.selectionLabels());l.length>0&&l.every(d=>c.has(d.label))?this.deselectCategories([r]):this.selectCategories([r])})}),this.paintSelectSelection(this.getSelection())}paintSelectSelection(t){var e;if(!this.els.selectnum||!this.els.selectmeta)return;const i=t.length;this.els.selectnum.textContent=i.toLocaleString(),this.els.selectmeta.textContent=i===1?"object selected":"objects selected",this.els.selectclear.disabled=i===0;const s=this.getSelectionValidity();this.els.selectvalidity&&(this.els.selectvalidity.textContent=s?s.isValid?`Ready — exactly ${s.required.toLocaleString()} selected.`:`Select ${s.remaining.toLocaleString()} more to continue.`:`${Math.max(0,this.selectionCap()-i).toLocaleString()} selections remaining.`);const n=new Set(t.map(o=>o.label));(e=this.els.rail)===null||e===void 0||e.querySelectorAll("[data-select-cat]").forEach(o=>{const a=o.dataset.selectCat,r=[...this.labelToSeat.values()].filter(u=>u.categoryKey===a&&this.canSelectObject(u)),l=r.filter(u=>n.has(u.label)).length,c=r.length>0&&l===r.length;o.classList.toggle("on",c),o.setAttribute("aria-pressed",String(c));const d=o.querySelector("[data-cat-count]");d&&(d.textContent=l?`${l}/${r.length}`:r.length.toLocaleString()),o.disabled=r.length===0})}renderFilterSectionsRail(){var t;const e=new Map;for(const s of this.filterableSections()){var i;e.set(s.label,[...(i=e.get(s.label))!==null&&i!==void 0?i:[],s])}this.els.rail.innerHTML=` - ${this.railHeader("Filter sections","host","Narrow the map to one section for your own reporting. Sections sharing a label stay together and the map frames their combined inventory. Nothing changes for buyers.")} - ${e.size?`
${[...e].map(([s,n])=>{const o=s===this.filteredSectionLabel,a=n.reduce((r,l)=>r+l.seatCount,0);return``}).join("")}
- `:'
This chart has no filterable sections.
'}`,this.els.rail.querySelectorAll("[data-filter-section]").forEach(s=>{s.addEventListener("click",()=>this.setFilteredSection(s.dataset.filterSection))}),(t=this.els.rail.querySelector("[data-clear-filter]"))===null||t===void 0||t.addEventListener("click",()=>this.clearFilteredSection())}categorySeats(t){return[...this.labelToSeat.values()].filter(e=>e.categoryKey===t&&this.canSelectObject(e))}renderCategoriesRail(){var t,e;const i=(t=(e=this.doc)===null||e===void 0?void 0:e.categories)!==null&&t!==void 0?t:[];this.els.rail.innerHTML=` - ${this.railHeader("Categories","event","Move seats to a different price category for this event only. The reusable chart keeps its design, and seats already held or booked keep the price they were sold at.")} -

1Choose seats

-

Click or drag seats on the map, press ⌘A for all, or tick a whole category. A ticked category is selected; tick it again to remove it.

-
${i.length?i.map(n=>{var o,a;return` - `}).join(""):'This chart has no categories.'}
-
- 0 - selected -
-
- - -
-

2Move them to

-

Select seats first — then pick the category they should sell under.

-
${i.map(n=>{var o,a;return` - `}).join("")}
`;const s=n=>this.els.rail.querySelector(`[data-ref="${n}"]`);this.els.categorynum=s("categorynum"),this.els.categorymeta=s("categorymeta"),this.els.categoryhelp=s("categoryhelp"),this.els.categoryclear=s("categoryclear"),s("categoryall").addEventListener("click",()=>this.selectAll()),this.els.categoryclear.addEventListener("click",()=>this.clearSelection()),this.els.rail.querySelectorAll("[data-pick-category]").forEach(n=>{n.addEventListener("click",()=>{const o=n.dataset.pickCategory,a=this.categorySeats(o),r=new Set(this.selectionLabels());a.length>0&&a.every(l=>r.has(l.label))?this.deselectCategories([o]):this.selectCategories([o])})}),this.els.rail.querySelectorAll("[data-assign-category]").forEach(n=>{n.addEventListener("click",()=>{this.setCategory(n.dataset.assignCategory)})}),this.paintCategorySelection(this.getSelection())}paintCategorySelection(t){var e,i,s;if(!this.els.categorynum)return;const n=t.length;this.els.categorynum.textContent=n.toLocaleString(),this.els.categoryclear.disabled=n===0;const o=new Map;for(const l of t)o.set(l.categoryKey,((e=o.get(l.categoryKey))!==null&&e!==void 0?e:0)+1);const a=l=>{var c,d;return(c=(d=this.doc)===null||d===void 0||(d=d.categories.find(u=>u.key===l))===null||d===void 0?void 0:d.label)!==null&&c!==void 0?c:l};this.els.categorymeta&&(this.els.categorymeta.textContent=n===0?"selected":`${n===1?"seat":"seats"} selected · ${[...o].map(([l,c])=>`${c.toLocaleString()} ${a(l)}`).join(", ")}`),this.els.categoryhelp&&(this.els.categoryhelp.textContent=n===0?"Select seats first — then pick the category they should sell under.":`Choose the category the ${n===1?"selected seat":`${n.toLocaleString()} selected seats`} should sell under. Applies immediately.`);const r=new Set(t.map(l=>l.label));(i=this.els.rail)===null||i===void 0||i.querySelectorAll("[data-pick-category]").forEach(l=>{const c=l.dataset.pickCategory,d=this.categorySeats(c),u=d.filter(f=>r.has(f.label)).length,h=d.length>0&&u===d.length;l.classList.toggle("on",h),l.classList.toggle("partial",u>0&&!h),l.setAttribute("aria-pressed",String(h));const p=l.querySelector("[data-cat-count]");p&&(p.textContent=u?`${u.toLocaleString()}/${d.length.toLocaleString()}`:d.length.toLocaleString()),l.disabled=d.length===0}),(s=this.els.rail)===null||s===void 0||s.querySelectorAll("[data-assign-category]").forEach(l=>{var c;const d=l.dataset.assignCategory,u=[...this.labelToSeat.values()].filter(m=>m.categoryKey===d).length,h=(c=o.get(d))!==null&&c!==void 0?c:0,p=n>0&&h===n;l.disabled=n===0||p,l.classList.toggle("current",p);const f=l.querySelector("[data-cat-current]");f&&(f.textContent=`${u.toLocaleString()} ${u===1?"seat":"seats"} now`);const v=l.querySelector("[data-cat-action]");v&&(v.textContent=n===0?"Move here":p?"Already here":`Move ${(n-h).toLocaleString()} here`)})}renderTablesRail(){const t=this.tables(),e="Decide how each table sells for this event: every chair on its own, or the whole table as one booking. A table with held, booked, or blocked chairs is locked until that inventory is released, and channel allocations are kept.";if(this.inventoryModelVersion!==2){this.els.rail.innerHTML=` - ${this.railHeader("Tables","event",e)} -
This event still uses the older inventory model, which cannot switch tables between per-chair and whole-table selling. Upgrade the event's inventory model to unlock this tool.
`;return}if(!t.length){this.els.rail.innerHTML=` - ${this.railHeader("Tables","event",e)} -
This chart has no tables. Add tables in the designer and they will appear here.
`;return}const i=d=>d.variableOccupancy?"variable":d.bookAsWhole?"whole":"individual",s=d=>{let u=0,h=0,p=0;for(const[v,m]of this.labelToSeat){if(m.rowId!==d.id)continue;const g=this.status.get(v);g==="held"?u++:g==="booked"?h++:g==="blocked"&&p++}const f=[h&&`${h} booked`,u&&`${u} held`,p&&`${p} blocked`].filter(Boolean);return f.length?f.join(" · "):null},n=t.map(d=>({table:d,current:i(d),locked:s(d)})),o=n.filter(d=>d.current==="individual").length,a=n.filter(d=>d.current==="whole").length,r=n.length-o-a,l=[`${o.toLocaleString()} per chair`,`${a.toLocaleString()} whole table`,r?`${r.toLocaleString()} flexible group`:""].filter(Boolean).join(" · "),c=this.tableBookingSaving;this.els.rail.innerHTML=` - ${this.railHeader("Tables","event",e)} -
${n.length.toLocaleString()} ${n.length===1?"table":"tables"}${Z(l)}
-

Set every table at once

-
- - -
-

Or one table at a time

-
${n.map(({table:d,current:u,locked:h})=>{var p,f;return`
- ${Z((p=d.displayLabel)!==null&&p!==void 0?p:d.label)}${d.seatCount.toLocaleString()} chairs${h?` · Locked: ${Z(h)}`:""} - -
`}).join("")}
-

Changes apply immediately to this event. Flexible group sizes (minimum and maximum guests) are set through the API, never guessed here.

`,this.els.rail.querySelectorAll("[data-table-all]").forEach(d=>{d.addEventListener("click",()=>{this.setTableBooking(n.filter(u=>!u.locked).map(u=>u.table.id),d.dataset.tableAll)})}),this.els.rail.querySelectorAll("[data-table-mode]").forEach(d=>{d.addEventListener("change",()=>{this.setTableBooking([d.dataset.tableMode],d.value)})})}renderInspectRail(t){var e,i,s,n,o,a,r;const l=t[t.length-1];if(!l){this.els.rail.innerHTML=` - ${this.railHeader("Inspect","read","Click one seat on the map to read its live status, category, section and booking context. Nothing changes in this view.")} -
Select a seat on the map.
`;return}const c=(e=this.status.get(l.label))!==null&&e!==void 0?e:"free",d={free:"Free",held:"Held",booked:"Booked",blocked:"Blocked"},u=(i=this.sectionByObject.get(l.rowId))!==null&&i!==void 0?i:ct,h=(s=this.sectionLabelById.get(u))!==null&&s!==void 0?s:"Other seats",p=(n=this.doc)===null||n===void 0?void 0:n.categories.find(b=>b.key===l.categoryKey),f=(o=this.controlRoomSnapshot)===null||o===void 0?void 0:o.bookedValue.bySection.find(b=>b.sectionId===u),v=(a=this.doc)===null||a===void 0?void 0:a.objects.find(b=>b.id===l.rowId),m=(v==null?void 0:v.type)==="row"?{label:"Row",value:v.label}:(v==null?void 0:v.type)==="table"?{label:"Table",value:v.label}:l.kind==="booth"?{label:"Type",value:"Booth"}:null,g=l.kind==="booth"?"Booth":"Seat";this.els.rail.innerHTML=` - ${this.railHeader("Inspect","read",`Live status and section performance for this ${g.toLowerCase()}. Click another seat to switch.`)} -
-
${Z(l.label)}
-
-
Status${d[c]}
-
Section${Z(h)}
- ${m?`
${m.label}${Z(m.value)}
`:""} -
Category${Z((r=p==null?void 0:p.label)!==null&&r!==void 0?r:l.categoryKey)}
-
Booked in section${f?`${f.booked} of ${f.total}`:"—"}
-
Section booked value${f&&this.controlRoomSnapshot?$s(f.bookedValue,this.controlRoomSnapshot.currency):"—"}
-
-
`}async refreshAvailability(){try{var t;const s=await this.withAuthRetry(()=>this.api.availability(this.key));this.availabilityRules=(t=s.rules)!==null&&t!==void 0?t:{},this.effectiveClosed=new Set(Al(this.availabilityRules)),this.mode==="sections"&&this.renderSectionsRail(),this.applySectionCanvasTreatment()}catch(s){var e,i;(e=(i=this.opts).onError)===null||e===void 0||e.call(i,s)}}async withAuthRetry(t){try{return await t()}catch(e){if(e instanceof he&&e.status===401&&this.opts.onTokenRefresh&&!this.tokenRefreshInFlight)return await this.rotateToken(),t();throw e}}updateEffectiveAvailability(t,e){let i=!1;Array.isArray(t)&&(this.effectiveHidden=new Set(t.filter(s=>typeof s=="string")),i=!0),Array.isArray(e)&&(this.effectiveClosed=new Set(e.filter(s=>typeof s=="string")),i=!0),i&&(this.mode==="sections"&&this.renderSectionsRail(),this.applySectionCanvasTreatment())}applySectionCanvasTreatment(){this.renderer&&(this.mode==="sections"?(this.renderer.setDimmedSections([...this.effectiveHidden]),this.renderer.setClosedSections([...this.effectiveClosed])):this.mode==="filterSections"&&this.filteredSectionLabel?this.applyFilteredSectionCanvas():(this.renderer.setDimmedSections(null),this.renderer.setClosedSections(null)))}sectionRowsInput(){return{sectionsBase:this.sectionsBase,doc:this.doc,availabilityRules:this.availabilityRules,effectiveHidden:this.effectiveHidden,effectiveClosed:this.effectiveClosed}}renderSectionsRail(){const{rows:t,hiddenSections:e,closedSections:i}=so(this.sectionRowsInput());if(!t.length){this.els.rail.innerHTML=` - ${this.railHeader("Sections","event","Draw sections or zones in the designer to schedule availability per area. This chart has none yet.")} -
No sections on this chart.
`;return}const s=[];e&&s.push(`${e} hidden`),i&&s.push(`${i} closed`);const n=s.length?s.join(" · "):"All sections open and on sale",o=e>0||i>0;this.els.rail.innerHTML=` - ${this.railHeader("Sections","event","Decide when each zone or section goes on sale for this event. Keep it hidden, reveal it at a set time, or auto-reveal once the rest sells past a threshold. Hidden seats vanish for buyers; closed seats stay on the map (flat grey) but can't be bought.")} -
${t.map(a=>cm(a,this.availabilitySaving)).join("")}
-
- - ${Z(n)} -
-
- -

Auto-reveal at % sold is demand-triggered release: the balcony opens itself the moment the stalls cross the threshold — no one has to be watching.

-
`,this.wireSectionRail(),this.applySectionCanvasTreatment()}wireSectionRail(){const t=this.els.rail;t&&(t.querySelectorAll("[data-avail-id]").forEach(e=>{e.addEventListener("change",()=>this.setSectionMode(e.dataset.availId,e.value))}),t.querySelectorAll("[data-avail-reveal]").forEach(e=>{e.addEventListener("change",()=>{const i=new Date(e.value).getTime();Number.isFinite(i)&&this.setSectionRulePatch(e.dataset.availReveal,{revealAt:i})})}),t.querySelectorAll("[data-avail-pct]").forEach(e=>{e.addEventListener("change",()=>{const i=Math.max(1,Math.min(100,Number(e.value)||0));this.setSectionRulePatch(e.dataset.availPct,{thresholdPct:i})})}))}setSectionMode(t,e){var i,s,n;const o=so(this.sectionRowsInput()).rows.find(c=>c.id===t),a=(i=(s=o==null?void 0:o.seatLabels)!==null&&s!==void 0?s:(n=this.availabilityRules[t])===null||n===void 0?void 0:n.labels)!==null&&i!==void 0?i:[],r={...this.availabilityRules},l=om(e,a,this.availabilityRules[t]);if(l?r[t]=l:delete r[t],(o==null?void 0:o.kind)==="zone"&&this.sectionsBase)for(const c of this.sectionsBase.sections)c.zone===t&&delete r[c.id];this.persistAvailability(r)}setSectionRulePatch(t,e){var i,s;const n=this.availabilityRules[t];if(!n)return;const o=so(this.sectionRowsInput()).rows.find(r=>r.id===t),a=(i=(s=o==null?void 0:o.seatLabels)!==null&&s!==void 0?s:n.labels)!==null&&i!==void 0?i:[];this.persistAvailability({...this.availabilityRules,[t]:{...n,...e,labels:a}})}async persistAvailability(t){const e=this.availabilityRules;this.availabilityRules=t,this.availabilitySaving=!0,this.mode==="sections"&&this.renderSectionsRail();try{const n=await this.withAuthRetry(()=>this.api.setAvailability(this.key,t));this.availabilityRules=n.rules,this.effectiveHidden=new Set(n.hidden),this.effectiveClosed=new Set(Al(n.rules)),this.availabilitySaving=!1,this.mode==="sections"&&this.renderSectionsRail(),this.applySectionCanvasTreatment()}catch(n){var i,s;this.availabilityRules=e,this.availabilitySaving=!1,this.mode==="sections"&&this.renderSectionsRail(),this.toastErr("Couldn't update availability. Try again."),(i=(s=this.opts).onError)===null||i===void 0||i.call(s,n)}}paintLegend(t){this.els.legend&&(this.els.legend.innerHTML=lm.map(e=>`
- ${e.label}${t[e.key].toLocaleString()}
`).join(""))}paintFeed(){if(!this.els.feed)return;if(!this.feed.length){this.els.feed.innerHTML=`
No activity yet — it'll stream in live.
`;return}const t=Date.now(),e={free:"#6e7bff",held:"#f4b740",booked:"#22a06b",blocked:"#8b94ac"};this.els.feed.innerHTML=this.feed.map(i=>{var s;const n=i.count>1?` +${i.count-1}`:"",o=(s=i.sectionLabels)!==null&&s!==void 0?s:[],a=o.length===1?o[0]:o.length>1?`${o.length} sections`:"";return``}).join("")}renderBlockRail(){var t,e;const i=((t=(e=this.doc)===null||e===void 0?void 0:e.categories)!==null&&t!==void 0?t:[]).map(d=>{var u,h;return``}).join(""),s=this.sectionOptions.length?`
-
`:"",n=this.sectionOptions.map(d=>``).join("");this.els.rail.innerHTML=` - ${this.railHeader("Block","event","Take seats off sale for this event, or put blocked seats back. Drag a box on the map, press ⌘A for all, or pick a whole category or section below. Booked and held seats are never touched.")} -
0selected
-
- - -
-
- - -
-

Select by category

-

Choose one or more. A checked category is selected; click it again to remove it.

-
${i||'No categories.'}
- ${s} -
- - -

Leave empty to block permanently.

-
-
-
-

Blocked inventory

- 0 out of sale -
-

Find blocked seats, select only the ones you need, then use “Put back on sale”.

-
- - -
-
- No blocked seats - -
-
-
-
- -

For a full reset only. You will be asked to confirm.

-
- `;const o=d=>this.els.rail.querySelector(`[data-ref="${d}"]`);this.els.selnum=o("selnum"),this.els.doblock=o("doblock"),this.els.dounblock=o("dounblock"),this.els.selmeta=o("selmeta"),this.els.blockedcount=o("blockedcount"),this.els.blockedshowing=o("blockedshowing"),this.els.blockedlist=o("blockedlist"),this.els.selblocked=o("selblocked"),this.els.markall=o("markall"),this.els.markallnote=o("markallnote"),o("doblock").addEventListener("click",()=>{this.block()}),o("dounblock").addEventListener("click",()=>{this.unblock()}),o("selall").addEventListener("click",()=>this.selectAll()),o("clearsel").addEventListener("click",()=>this.clearSelection()),o("markall").addEventListener("click",()=>this.confirmUnblockAll()),this.els.rail.querySelectorAll("[data-cat]").forEach(d=>d.addEventListener("click",()=>this.toggleCategory(d.dataset.cat)));const a=this.els.rail.querySelector('[data-ref="section"]');a==null||a.addEventListener("change",()=>{a.value&&(this.selectSection(a.value),a.value="")});const r=o("blockedsearch"),l=o("blockedsection");r.value=this.blockedQuery,l.value=this.blockedSection,r.addEventListener("input",()=>{this.blockedQuery=r.value,this.blockedResultLimit=100,this.paintBlockedInventory()}),l.addEventListener("change",()=>{this.blockedSection=l.value,this.blockedResultLimit=100,this.paintBlockedInventory()}),o("selblocked").addEventListener("click",()=>{this.toggleLabels(this.filteredBlockedSeats().map(d=>d.label))}),o("blockedlist").addEventListener("click",d=>{const u=d.target,h=u.closest("[data-blocked-label]");h!=null&&h.dataset.blockedLabel?this.toggleLabels([h.dataset.blockedLabel]):u.closest("[data-blocked-more]")&&(this.blockedResultLimit+=100,this.paintBlockedInventory())});const c=o("release");c.addEventListener("change",()=>{const d=c.value?new Date(c.value).getTime():NaN;this.releaseAt=Number.isFinite(d)&&d>Date.now()?d:null;const u=o("releasenote");u.textContent=this.releaseAt?`New blocks auto-release ${new Date(this.releaseAt).toLocaleString()}.`:c.value?"Pick a time in the future.":"Leave empty to block permanently."}),this.paintSelBar(this.getSelection())}toggleCategory(t){const e=[];for(const[i,s]of this.labelToSeat.entries())s.categoryKey===t&&this.isBlockSelectable(i)&&e.push(i);this.toggleLabels(e)}toggleLabels(t){if(!this.renderer)return;const e=t.filter(s=>this.labelToSeat.has(s)&&this.isBlockSelectable(s));if(!e.length)return;const i=new Set(this.selectionLabels());if(e.every(s=>i.has(s))){const s=e.map(n=>this.labelToId.get(n)).filter(n=>!!n);this.renderer.deselect(s)}else this.renderer.selectByLabels(e);this.syncSelection()}isBlockSelectable(t){var e;const i=(e=this.status.get(t))!==null&&e!==void 0?e:"free";return i==="free"||i==="blocked"}paintSelBar(t){if(!this.els.selnum)return;this.els.selnum.textContent=t.length.toLocaleString();const e=t.filter(o=>{var a;return((a=this.status.get(o.label))!==null&&a!==void 0?a:"free")==="free"}).length,i=t.filter(o=>this.status.get(o.label)==="blocked").length;this.els.selmeta.textContent=t.length?`${e.toLocaleString()} available · ${i.toLocaleString()} blocked`:"selected";const s=this.els.doblock,n=this.els.dounblock;s.disabled=e===0,n.disabled=i===0,s.textContent=e?`Block ${e.toLocaleString()}`:"Block selected",n.textContent=i?`Put ${i.toLocaleString()} on sale`:"Put back on sale",this.paintCategoryControls(t),this.paintBlockedInventory()}paintCategoryControls(t){var e;const i=new Set(t.map(s=>s.label));(e=this.els.rail)===null||e===void 0||e.querySelectorAll("[data-cat]").forEach(s=>{const n=s.dataset.cat,o=[];for(const[d,u]of this.labelToSeat.entries())u.categoryKey===n&&this.isBlockSelectable(d)&&o.push(d);const a=o.filter(d=>i.has(d)).length,r=o.length>0&&a===o.length,l=a>0&&!r;s.disabled=o.length===0,s.classList.toggle("on",r),s.classList.toggle("partial",l),s.setAttribute("aria-pressed",r?"true":l?"mixed":"false"),s.setAttribute("title",r?`Remove all ${o.length.toLocaleString()} seats in this category from the selection`:l?`Select the remaining ${(o.length-a).toLocaleString()} seats in this category`:`Select all ${o.length.toLocaleString()} seats in this category`);const c=s.querySelector("[data-cat-count]");c&&(c.textContent=a?`${a.toLocaleString()}/${o.length.toLocaleString()}`:o.length.toLocaleString())})}filteredBlockedSeats(){const t=this.blockedQuery.trim().toLocaleLowerCase(),e=[];for(const[r,l]of this.labelToSeat.entries()){var i;if(this.status.get(r)!=="blocked")continue;const c=(i=this.sectionByObject.get(l.rowId))!==null&&i!==void 0?i:ct;if(!(this.blockedSection&&c!==this.blockedSection)){if(t){var s,n,o,a;const d=(s=(n=this.doc)===null||n===void 0||(n=n.categories.find(p=>p.key===l.categoryKey))===null||n===void 0?void 0:n.label)!==null&&s!==void 0?s:l.categoryKey,u=(o=this.sectionLabelById.get(c))!==null&&o!==void 0?o:"Other seats",h=(a=this.doc)===null||a===void 0?void 0:a.objects.find(p=>p.id===l.rowId);if(!`${r} ${d} ${u} ${(h==null?void 0:h.type)==="row"||(h==null?void 0:h.type)==="table"?h.label:""}`.toLocaleLowerCase().includes(t))continue}e.push(l)}}return e.sort((r,l)=>r.label.localeCompare(l.label,void 0,{numeric:!0,sensitivity:"base"}))}paintBlockedInventory(){if(!this.els.blockedlist)return;const t=[...this.status.entries()].filter(([,c])=>c==="blocked").length,e=this.filteredBlockedSeats(),i=e.slice(0,this.blockedResultLimit),s=new Set(this.selectionLabels()),n=e.filter(c=>s.has(c.label)).length,o=e.length>0&&n===e.length;this.els.blockedcount.textContent=t.toLocaleString(),this.els.blockedshowing.textContent=e.length?`Showing ${i.length.toLocaleString()} of ${e.length.toLocaleString()}`:t?"No matches":"No blocked seats";const a=this.els.selblocked;a.disabled=e.length===0,a.textContent=o?`Remove ${e.length.toLocaleString()} results`:`Select ${e.length.toLocaleString()} results`,this.els.blockedlist.innerHTML=i.length?i.map(c=>{var d,u,h,p;const f=(d=this.sectionByObject.get(c.rowId))!==null&&d!==void 0?d:ct,v=(u=this.sectionLabelById.get(f))!==null&&u!==void 0?u:"Other seats",m=(h=(p=this.doc)===null||p===void 0||(p=p.categories.find(b=>b.key===c.categoryKey))===null||p===void 0?void 0:p.label)!==null&&h!==void 0?h:c.categoryKey,g=s.has(c.label);return``}).join("")+(e.length>i.length?'':""):`
${t?"No blocked seats match this search or section.":"No seats are blocked. Newly blocked seats will appear here."}
`;const r=this.els.markall,l=r.dataset.confirm==="true";r.disabled=t===0,r.textContent=l?`Confirm: put all ${t.toLocaleString()} on sale`:`Put all ${t.toLocaleString()} blocked seats on sale`}confirmUnblockAll(){const t=this.els.markall;if(!(!t||t.disabled)){if(t.dataset.confirm==="true"){this.resetUnblockAllConfirm(),this.unblockAll();return}t.dataset.confirm="true",t.classList.add("danger"),this.els.markallnote.textContent="This changes every blocked seat. Click the red button again to confirm.",this.paintBlockedInventory(),this.unblockAllConfirmTimer&&clearTimeout(this.unblockAllConfirmTimer),this.unblockAllConfirmTimer=setTimeout(()=>this.resetUnblockAllConfirm(),6e3)}}resetUnblockAllConfirm(){this.unblockAllConfirmTimer&&clearTimeout(this.unblockAllConfirmTimer),this.unblockAllConfirmTimer=null;const t=this.els.markall;t&&(delete t.dataset.confirm,t.classList.remove("danger"),this.els.markallnote&&(this.els.markallnote.textContent="For a full reset only. You will be asked to confirm."),this.paintBlockedInventory())}done(t,e,i){var s,n;if(this.toastOk(i),e.length){const o=t==="block"?this.pushActivity(e,"blocked","blocked"):t==="unblock"||t==="unblockAll"?this.pushActivity(e,"unblocked","free"):t==="cancelBooking"?this.pushActivity(e,"cancelled","free"):null;o&&this.paintSpatialActivity(o)}t!=="setHoldTtl"&&this.refreshControlRoom().catch(o=>{var a,r;return(a=(r=this.opts).onError)===null||a===void 0?void 0:a.call(r,o)}),(s=(n=this.opts).onActionComplete)===null||s===void 0||s.call(n,{action:t,labels:e,count:e.length})}toastOk(t){this.toast(t,"ok")}toastErr(t){this.toast(t,"err")}toast(t,e){const i=this.els.toast;i&&(i.textContent=t,i.className=`slm-toast on ${e}`,this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{i.className="slm-toast"},3200))}fail(t){var e,i;(e=(i=this.opts).onError)===null||e===void 0||e.call(i,t),this.els.rail&&(this.els.rail.innerHTML=`
Couldn't load this event. Check the event key and token.
`)}},Am=4;function Em(){return new Promise(t=>requestAnimationFrame(()=>t()))}async function Im(t){for(let e=0;e<240;e+=1){await Em();const i=t.stats();if(i.rendered>0&&i.idle)return}throw new Error("seatlayer: hosted 3D preview did not reach a stable frame")}function Mm(t,e){let i=null,s=!1;const n=(async()=>{const a=Ye(t.chart),r=await ll(),l=await r.prepareVenue3D({doc:t.chart,seats:a});if(s)return;const c=r.mountVenue3D(e,{doc:t.chart,seats:a,prepared:l},{portraitOverviewCrop:!0,skipInitialOverviewAnimation:!0});i=c,await Im(c)})(),o=()=>{if(s)throw new Error("seatlayer: hosted 3D preview has been destroyed");if(!i)throw new Error("seatlayer: hosted 3D preview is not ready");return i};return{contractVersion:4,state:"venue3d",ready:n,getQualityEvidence:()=>o().getQualityEvidence(),getQualityReport:()=>o().getQualityReport(),forceDraw:()=>{o()},destroy:()=>{s||(s=!0,i==null||i.dispose(),e.remove())}}}function _m(t,e,i,s,n){var o,a,r,l,c,d,u;const h=t.getRenderedQualityEvidence(),p=new Set([...h.labels.map(D=>D.categoryKey),...h.gaAreas.map(D=>D.categoryKey)]);if(n&&!p.has(n))throw new Error(`seatlayer: evidence category "${n}" has no inventory on this floor`);if(!h.labels.length&&!h.gaAreas.length){t.zoomToFit();return}const f=s?Dt(e).find(D=>D.id===s):Dt(e)[0];if(!f)throw new Error("seatlayer: preview floor does not exist");const v={...e,objects:f.objects,floors:void 0},m=new Map(Ye(v).map(D=>[D.id,D])),g=n?h.labels.filter(D=>D.categoryKey===n):h.labels,b=new Map;for(const D of g){var y;if(!D.sectionId)continue;const F=(y=b.get(D.sectionId))!==null&&y!==void 0?y:[];F.push(D),b.set(D.sectionId,F)}const k=[...b].sort((D,F)=>{const _=new Set(D[1].map(Y=>Y.categoryKey)).size,U=new Set(F[1].map(Y=>Y.categoryKey)).size;return+(F[1].length>=3)-+(D[1].length>=3)||U-_||F[1].length-D[1].length||D[0].localeCompare(F[0])})[0],w=(o=k==null?void 0:k[1])!==null&&o!==void 0?o:g,C=new Map;for(const D of w)C.set(D.categoryKey,((a=C.get(D.categoryKey))!==null&&a!==void 0?a:0)+1);const S=(r=n!=null?n:(l=[...C].sort((D,F)=>F[1]-D[1]||D[0].localeCompare(F[0]))[0])===null||l===void 0?void 0:l[0])!==null&&r!==void 0?r:(c=h.gaAreas[0])===null||c===void 0?void 0:c.categoryKey;if(!S){t.zoomToFit();return}const T=n?w:[...w.filter(D=>D.categoryKey===S),...w.filter(D=>D.categoryKey!==S),...h.labels.filter(D=>!w.includes(D))],E=[...new Map(T.map(D=>[D.seatId,D])).values()],L=E[0],I=E[1],M=E[2];if(L){var x,A;if(I&&t.setStatus([I.seatId],"held"),M&&t.setStatus([M.seatId],"booked"),(x=t.setManageInteraction)===null||x===void 0||x.call(t,{manageMode:!0,marqueeSelect:!1,selectableStatuses:["free"],maxSelection:1}),!(!((A=t.setEvidenceSelection)===null||A===void 0)&&A.call(t,L.seatId))){var P;(P=t.selectByLabels)===null||P===void 0||P.call(t,[L.label])}}if(n||p.size>=2){var N;(N=t.setCategoryFilter)===null||N===void 0||N.call(t,[S])}const W=L?void 0:h.gaAreas.filter(D=>D.categoryKey===S).sort((D,F)=>F.capacity-D.capacity||D.areaId.localeCompare(F.areaId))[0],B=(d=k==null?void 0:k[0])!==null&&d!==void 0?d:W==null?void 0:W.sectionId;B&&((u=t.focusSection)===null||u===void 0||u.call(t,B));const z=L?m.get(L.seatId):void 0,j=W?f.objects.find(D=>D.type==="gaArea"&&D.id===W.areaId):void 0,G=z!=null?z:(j==null?void 0:j.type)==="gaArea"?Qs(j.points,j.holes):void 0;if(G&&t.focusRegion){const D=i.clientWidth||1200,F=i.clientHeight||900,_=2,U=D/(_*1.12),Y=F/(_*1.12);t.focusRegion({x:G.x-U/2,y:G.y-Y/2,width:U,height:Y},{animate:!1})}}function Pm(t){if(typeof t=="string"){const e=document.querySelector(t);if(!e)throw new Error(`seatlayer: preview container "${t}" not found`);return e}if(!(t instanceof HTMLElement))throw new Error("seatlayer: preview container must be a CSS selector or an HTMLElement");return t}function Rm(t){var e,i;if(!t||typeof t!="object")throw new Error("seatlayer: preview options are required");if(!t.chart||typeof t.chart!="object")throw new Error("seatlayer: preview chart is required");if(t.view==="chart"&&t.state==="venue3d")throw new Error("seatlayer: venue3d evidence requires the venue3d preview view");if(t.view==="venue3d"&&t.state&&t.state!=="venue3d")throw new Error("seatlayer: the venue3d preview view requires venue3d evidence state");const s=t.view==="venue3d"||t.state==="venue3d",n=(e=t.state)!==null&&e!==void 0?e:"overview";if(!s&&n!=="overview"&&n!=="interaction")throw new Error(`seatlayer: unsupported preview evidence state "${String(n)}"`);const o=Pm(t.container),a=document.createElement("div");if(a.dataset.seatlayerBuyerRenderer=String(4),a.style.cssText="position:relative;width:100%;height:100%;overflow:hidden;",o.replaceChildren(a),s)return Mm(t,a);const r=n,l=Cr(a,{maxSelection:10,currency:t.currency});l.setChart(t.chart,t.floorId?{floorId:t.floorId}:void 0),t.colorblindSafe&&((i=l.setColorblindSafe)===null||i===void 0||i.call(l,!0)),r==="interaction"?_m(l,t.chart,a,t.floorId,t.evidenceCategoryKey):l.zoomToFit(),l.forceDraw();let c=!1;return{contractVersion:4,state:r,getQualityEvidence:()=>l.getRenderedQualityEvidence(),getQualityReport:()=>{var d;return Sd(l.getRenderedQualityEvidence(),r,(d=t.evidenceCategoryKey)!==null&&d!==void 0?d:null)},forceDraw:()=>l.forceDraw(),destroy:()=>{c||(c=!0,l.destroy(),a.remove())}}}var yg=1,$m=1,Om=1,Fm=["hello","init","cmd","res","err","evt"],bt={UNSUPPORTED_COMMAND:"unsupported_command",BAD_PAYLOAD:"bad_payload",NOT_READY:"not_ready",DESTROYED:"destroyed"},ai=class extends Error{constructor(t,e,i){super(e),this.name="BridgeError",this.code=t,this.details=i}};function Vi(t){return typeof t=="number"&&Number.isFinite(t)&&Math.floor(t)===t}function Bm(t){if(Vi(t))return{min:t,max:t};if(t&&typeof t=="object"){const{min:e,max:i}=t;if(Vi(e)&&Vi(i)&&e<=i)return{min:e,max:i}}return null}function Jl(t,e={min:1,max:1}){const i=Math.min(t.max,e.max);return iGi(()=>a.postMessage(r))}}if(Vs((i=t.SeatLayerNative)===null||i===void 0?void 0:i.post)){const a=t.SeatLayerNative;return{name:"android",send:r=>Gi(()=>a.post(Ns(r)))}}if(Vs((s=t.SeatLayer)===null||s===void 0?void 0:s.postMessage)){const a=t.SeatLayer;return{name:"flutter",send:r=>Gi(()=>a.postMessage(Ns(r)))}}if(Vs((n=t.ReactNativeWebView)===null||n===void 0?void 0:n.postMessage)){const a=t.ReactNativeWebView;return{name:"rn",send:r=>Gi(()=>a.postMessage(Ns(r)))}}const o=t.parent;return o&&o!==t&&typeof o.postMessage=="function"?{name:"frame",send:a=>Gi(()=>o.postMessage(a,"*"))}:{name:"none",send:()=>{}}}function Gi(t){try{t()}catch{}}function Nm(t,e=window){const i=e.__slBridge,s={recv(n){try{t(n)}catch{}}};return e.__slBridge=s,()=>{e.__slBridge===s&&(i?e.__slBridge=i:delete e.__slBridge)}}function Vm(t,e=window){if(typeof e.addEventListener!="function")return()=>{};const i=s=>{try{t(s.data)}catch{}};return e.addEventListener("message",i),()=>e.removeEventListener("message",i)}var sc=["sys.ready","sys.error","sys.incompatible","selection.changed","hold.changed","hold.restored","hold.expired","ga.click","hint","error","seat.hover","deck.tap"],Gm=new Set(["seat.hover","selection.changed"]),nc=["hold","hold.extend","hold.resume","hold.partial-release","best-available","ga","tiers","floors","zoom","colorblind-safe","view-modes","seat-hover"];function Et(t){throw new ai(bt.BAD_PAYLOAD,t)}function st(t){return t==null?{}:((typeof t!="object"||Array.isArray(t))&&Et("payload must be an object"),t)}function qi(t,e){const i=t[e];return(typeof i!="string"||!i)&&Et(`\`${e}\` must be a non-empty string`),i}function yo(t,e){const i=t[e];return(typeof i!="number"||!Number.isFinite(i))&&Et(`\`${e}\` must be a finite number`),i}function Gs(t,e){if(!(t[e]===void 0||t[e]===null))return yo(t,e)}function oc(t,e){const i=t[e];if(i!=null)return typeof i!="string"&&Et(`\`${e}\` must be a string`),i}function ac(t,e){const i=t[e];return typeof i!="boolean"&&Et(`\`${e}\` must be a boolean`),i}function qm(t,e){if(!(t[e]===void 0||t[e]===null))return ac(t,e)}function rc(t,e){const i=qi(t,e);return i!=="flat"&&i!=="iso"&&i!=="perspective"&&Et(`\`${e}\` must be flat, iso or perspective`),i}function jm(t,e){const i=t[e];return(!Array.isArray(i)||i.some(s=>typeof s!="string"))&&Et(`\`${e}\` must be an array of strings`),i}function lc(t,e){const i=t[e];return i==null?null:(typeof i!="string"&&Et(`\`${e}\` must be a string or null`),i)}var cc={hold:async(t,e)=>({hold:await t.holdOrThrow({ttlMs:Gs(st(e),"ttlMs")})}),resumeHold:async(t,e)=>({hold:await t.resumeHoldOrThrow(qi(st(e),"holdId"))}),extendHold:async(t,e)=>({hold:await t.extendHold(Gs(st(e),"ttlMs"))}),release:async t=>(await t.release(),{}),releaseLabels:async(t,e)=>({released:await t.releaseLabels(jm(st(e),"labels"))}),bestAvailable:async(t,e)=>{const i=st(e);return{hold:await t.bestAvailableOrThrow(yo(i,"qty"),oc(i,"categoryKey"),{zoneId:oc(i,"zoneId"),preferPremium:qm(i,"preferPremium"),ttlMs:Gs(i,"ttlMs")})}},holdGA:async(t,e)=>{const i=st(e);return{hold:await t.holdGAOrThrow(qi(i,"areaId"),yo(i,"qty"),{tierId:i.tierId===void 0?void 0:lc(i,"tierId"),ttlMs:Gs(i,"ttlMs")})}},setSeatTier:(t,e)=>{const i=st(e);return t.setSeatTier(qi(i,"seatId"),lc(i,"tierId")),{}},getSelection:t=>({seats:t.getSelection()}),getCurrentHold:t=>({hold:t.getCurrentHold()}),getGAAreas:t=>({areas:t.getGAAreas()}),getFloors:t=>({floors:t.getFloors()}),setFloor:(t,e)=>(t.setFloor(qi(st(e),"floorId")),{}),setColorblindSafe:(t,e)=>(t.setColorblindSafe(ac(st(e),"on")),{}),setViewMode:(t,e)=>(t.setViewMode(rc(st(e),"mode")),{}),getViewMode:t=>({mode:t.getViewMode()}),zoomIn:t=>(t.zoomIn(),{}),zoomOut:t=>(t.zoomOut(),{}),zoomToFit:t=>(t.zoomToFit(),{}),destroy:t=>(t.destroy(),{})},dc=Object.keys(cc),Um=1e4;function Wm(t={}){var e,i,s,n,o,a;const r=(e=t.win)!==null&&e!==void 0?e:globalThis,l=(i=t.transport)!==null&&i!==void 0?i:ic(r),c=(s=t.createChart)!==null&&s!==void 0?s:(z=>new Ur(z)),d=(n=t.timeoutMs)!==null&&n!==void 0?n:Um,u=(o=t.schedule)!==null&&o!==void 0?o:(z=>{const j=r.requestAnimationFrame;typeof j=="function"?j.call(r,()=>z()):setTimeout(z,0)});let h=0,p=null,f=null,v=!1,m=!1,g=!1,b=!1;const y=new Map;let k=!1;const w=z=>{g||l.send(z)},C=(z,j)=>{w(Hm(z,++h,j))},S=()=>{if(k=!1,g)return;const z=[...y.entries()];y.clear();for(const[j,G]of z)C(j,G)},T=(z,j)=>{if(!g){if(!Gm.has(z)){C(z,j);return}y.set(z,j),!k&&(k=!0,u(S))}},E=(z,j="internal_error")=>{try{C("sys.error",bo(z,j))}catch{}},L=(z,j)=>(...G)=>{try{T(z,j(...G))}catch(D){E(D)}};let I=null;const M=()=>{I!==null&&(clearTimeout(I),I=null)},x=async z=>{var j;if(b)return;b=!0,M();const G=(j=z.p)!==null&&j!==void 0?j:{},D=Bm(G.protocol);if(!D){C("sys.incompatible",{code:bt.BAD_PAYLOAD,message:"`init.protocol` must be a number or {min,max}",web:{min:1,max:1}});return}const F=Jl(D);if(!F.ok){C("sys.incompatible",{message:F.reason,host:F.host,web:F.web});return}p=F.protocol;try{var _,U,Y;f=c(A(G)),await f.render(),v=!0,C("sys.ready",{protocol:p,mode:(_=f.getMode())!==null&&_!==void 0?_:"live",transport:l.name,chart:{event:(U=(Y=G.config)===null||Y===void 0?void 0:Y.event)!==null&&U!==void 0?U:null}})}catch(ie){f=null,E(ie,"render_failed")}},A=z=>{var j,G,D,F,_;const U=(j=z.config)!==null&&j!==void 0?j:{},Y=U.event;if(typeof Y!="string"||!Y)throw new ai(bt.BAD_PAYLOAD,"`init.config.event` is required");const ie=(G=(D=U.container)!==null&&D!==void 0?D:t.container)!==null&&G!==void 0?G:(F=r.document)===null||F===void 0?void 0:F.body;if(!ie)throw new ai(bt.BAD_PAYLOAD,"no container available to mount into");return{container:ie,event:Y,apiBase:U.apiBase,publicKey:U.publicKey,maxSelection:U.maxSelection,locale:U.locale,messages:U.messages,currency:U.currency,colorblindSafe:U.colorblindSafe,initialView:U.initialView===void 0?void 0:rc(U,"initialView"),seatTooltip:(_=z.chrome)===null||_===void 0?void 0:_.seatTooltip,onSelectionChange:L("selection.changed",ae=>({seats:ae})),onHold:L("hold.changed",ae=>({hold:ae})),onHoldRestored:L("hold.restored",ae=>({hold:ae})),onHoldExpired:L("hold.expired",()=>({})),onGAClick:L("ga.click",ae=>({area:ae})),onHint:L("hint",ae=>({message:ae})),onError:L("error",ae=>bo(ae,"picker_error")),onSeatHover:L("seat.hover",ae=>({details:ae})),onDeckTap:L("deck.tap",ae=>({floorId:ae}))}},P=async z=>{const j=z.id;if(!j){E(new ai(bt.BAD_PAYLOAD,`cmd \`${z.t}\` is missing \`id\``));return}const G=(F,_)=>{w(tc(j,z.t,{code:F,message:_}))},D=cc[z.t];if(!D){G(bt.UNSUPPORTED_COMMAND,`unknown command \`${z.t}\``);return}if(m){G(bt.DESTROYED,"the chart has been destroyed");return}if(!v||!f){G(bt.NOT_READY,"the chart is not ready yet");return}try{const F=await D(f,z.p);z.t==="destroy"&&(m=!0),w(Dm(j,z.t,F))}catch(F){w(tc(j,z.t,bo(F,"command_failed")))}},N=z=>{if(g)return;const j=ec(z);if(j)try{j.k==="init"?x(j):j.k==="cmd"&&P(j)}catch(G){E(G)}},W=Nm(N,r),B=Vm(N,r);return I=setTimeout(()=>{I=null,!b&&(b=!0,C("sys.error",{code:"host_timeout",message:`no init from the host within ${d}ms`}))},d),w(zm({bundle:(a=t.bundle)!==null&&a!==void 0?a:"unknown",protocol:{min:1,max:1},capabilities:[...nc],events:[...sc],commands:dc})),{close(){if(!g){g=!0,M(),y.clear(),B(),W();try{f==null||f.destroy()}catch{}f=null,v=!1}},get protocol(){return p},get transport(){return l.name}}}Xl(),vo(),po(),to();var Km="0.59.0";function Ym(t={}){return Wm({bundle:"0.59.0",...t})}return X.ACCESS_LINK_DEFAULTS=Ds,X.ApiError=As,X.BRIDGE_CAPABILITIES=nc,X.BRIDGE_COMMANDS=dc,X.BRIDGE_ERROR_CODES=bt,X.BRIDGE_EVENTS=sc,X.BRIDGE_PROTOCOL_MAX=Om,X.BRIDGE_PROTOCOL_MIN=$m,X.BUYER_RENDERER_CONTRACT_VERSION=Am,X.BridgeError=ai,X.BuyerAccessContext=Gr,X.BuyerAccessUnavailableError=Nn,X.BuyerRealtimeClient=Ls,X.ChannelsMode=go,X.EmbeddedDesigner=jf,X.ManageApi=eo,X.ManageApiError=he,X.PUBLIC_CHANNEL_ID=Ue,X.PUBLIC_CHANNEL_NAME=ze,X.SEATING_CHART_CALLBACK_PROPS=Xr,X.SEATING_CHART_HANDLE_METHODS=Wr,X.SEATING_CHART_IDENTITY_PROPS=Kr,X.SEATING_CHART_VALUE_PROPS=Yr,X.SeatManager=Lm,X.SeatPicker=Uv,X.SeatingChart=Ur,X.accessIntentDescription=Ol,X.accessIntentLabel=Bt,X.accessLine=$l,X.accessLinkBadge=Bl,X.accessLinkErrorCopy=Hi,X.accessLinkIsLive=lo,X.accessLinkPolicyLines=co,X.attachPickerFrame=Wv,X.bindSeatingChartHandle=_f,X.bucketRows=Pl,X.bucketRowsHtml=fo,X.buildSeatingChartOptions=Pf,X.createBuyerAccessContext=Wn,X.createControllerSink=Hn,X.decodeBridgeEnvelope=ec,X.detectBridgeTransport=ic,X.dropReviewRows=um,X.encodeBridgeEnvelope=Ns,X.intentForbidsCopy=Bs,X.intentSwitchBlockedCopy=Fl,X.isPublicChannelId=gt,X.markerLetter=Ft,X.markerOf=El,X.mutationCount=Os,X.needsMoveConfirmation=_l,X.negotiateBridgeProtocol=Jl,X.parseTicketOfferAvailability=il,X.planAssignment=Ml,X.renderChartDocument=Rm,X.retryAfterCopy=Rl,X.selectionSources=Il,X.startBridge=Ym,X.stateBadge=zl,X.suggestMarker=no,X.ticketOfferPrices=sl,X.version=Km,X})({});typeof window!="undefined"&&window.seatlayer&&(window.seatmap=window.seatmap||window.seatlayer); diff --git a/package.json b/package.json index c01c14b..5d38121 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@seatlayer/react-native", - "version": "0.1.3", + "version": "0.2.0", "description": "Official React Native SDK for interactive SeatLayer reserved-seating maps on iOS and Android.", "license": "MIT", "homepage": "https://docs.seatlayer.io/buyer-sdk/mobile/", @@ -35,14 +35,12 @@ ], "sideEffects": false, "scripts": { - "generate:web": "node scripts/generate-web-document.mjs", - "prebuild": "pnpm generate:web", "build": "tsup", "typecheck": "tsc --noEmit", "test": "vitest run", "test:watch": "vitest", "lint:package": "publint && attw --pack .", - "validate": "pnpm generate:web && pnpm typecheck && pnpm test && pnpm build && pnpm lint:package", + "validate": "pnpm typecheck && pnpm test && pnpm build && pnpm lint:package", "prepublishOnly": "pnpm validate" }, "peerDependencies": { diff --git a/scripts/generate-web-document.mjs b/scripts/generate-web-document.mjs deleted file mode 100644 index bb7249f..0000000 --- a/scripts/generate-web-document.mjs +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env node - -import { mkdirSync, readFileSync, writeFileSync } from 'node:fs'; -import { dirname, resolve } from 'node:path'; -import { fileURLToPath } from 'node:url'; - -const root = resolve(dirname(fileURLToPath(import.meta.url)), '..'); -const templatePath = resolve(root, 'assets/index.html'); -const bundlePath = resolve(root, 'assets/seatlayer.js'); -const outputPath = resolve(root, 'src/generated/webDocument.ts'); -const marker = '/*__SEATLAYER_BUNDLE__*/'; - -const template = readFileSync(templatePath, 'utf8'); -if (!template.includes(marker)) { - throw new Error(`Missing ${marker} in ${templatePath}`); -} - -const bundle = readFileSync(bundlePath, 'utf8') - .replaceAll(' >; +const configurationIds = new WeakMap(); +let nextConfigurationId = 0; + +function configurationIdentity(configuration: object): number { + const existing = configurationIds.get(configuration); + if (existing !== undefined) return existing; + nextConfigurationId += 1; + configurationIds.set(configuration, nextConfigurationId); + return nextConfigurationId; +} + export function SeatLayerView({ controller, configuration, @@ -49,22 +57,27 @@ export function SeatLayerView({ onLoadError, }: SeatLayerViewProps): React.ReactElement { const webView = useRef(null); - const configurationKey = useMemo( - () => JSON.stringify(configuration), - [configuration], - ); - const viewKey = `${configurationKey}:${String(reloadKey ?? '')}`; + const onReadyRef = useRef(onReady); + const onLoadErrorRef = useRef(onLoadError); + onReadyRef.current = onReady; + onLoadErrorRef.current = onLoadError; + // Credentials and provider functions must never be serialized into a React + // key. Depending on the configuration object reloads safely when either is + // replaced, without putting the token in a string, log, or native view key. + const viewKey = `${configurationIdentity(configuration)}:${String( + reloadKey ?? 'seatlayer', + )}`; useLayoutEffect(() => { const transport = new ReactNativeWebViewTransport(() => webView.current); let active = true; controller.beginHandshake(transport, configuration).then( (info) => { - if (active) onReady?.(info); + if (active) onReadyRef.current?.(info); }, (error: unknown) => { if (!active) return; - onLoadError?.( + onLoadErrorRef.current?.( error instanceof SeatLayerError ? error : SeatLayerError.transport('SeatLayer handshake failed.', error), @@ -78,10 +91,12 @@ export function SeatLayerView({ false, ); }; - }, [configurationKey, controller, onLoadError, onReady, reloadKey]); + }, [configuration, controller, reloadKey]); const onMessage = (event: WebViewMessageEvent): void => { - controller.ingestRaw(event.nativeEvent.data); + if (event.nativeEvent.url === seatLayerMobilePageUrl) { + controller.ingestRaw(event.nativeEvent.data); + } }; const reportLoadFailure = (message: string): void => { @@ -95,8 +110,8 @@ export function SeatLayerView({ testID={testID} accessibilityLabel={accessibilityLabel} style={[styles.webView, style]} - source={{ html: seatLayerWebDocument, baseUrl: documentBaseUrl }} - originWhitelist={['*']} + source={{ uri: seatLayerMobilePageUrl }} + originWhitelist={[seatLayerMobileOrigin]} javaScriptEnabled domStorageEnabled mixedContentMode="never" @@ -118,9 +133,7 @@ export function SeatLayerView({ ) } onShouldStartLoadWithRequest={(request) => - request.url === 'about:blank' || - request.url.startsWith(documentBaseUrl) || - request.url.startsWith('data:text/html') + request.url === seatLayerMobilePageUrl } /> ); diff --git a/src/controller.ts b/src/controller.ts index 6c89f7d..5dbc8bc 100644 --- a/src/controller.ts +++ b/src/controller.ts @@ -7,13 +7,17 @@ import { } from './bridge/protocol'; import { decodeBestAvailable, + decodeBuyerAccessExpired, + decodeBuyerAccessUnavailable, decodeBundleInfo, decodeFloor, decodeGAArea, decodeHold, decodeReadyInfo, decodeSeatHover, + decodeSelectedObjectsUnavailable, decodeSelectedSeat, + decodeSelectionValidity, } from './decode'; import { TypedEmitter } from './emitter'; import { SeatLayerError } from './errors'; @@ -36,7 +40,9 @@ import { type ReadyInfo, type SeatLayerConfiguration, type SeatLayerEventMap, + type SeatLayerViewMode, type SelectedSeat, + type SelectionValidity, } from './types'; interface Handshake { @@ -198,6 +204,29 @@ export class SeatLayerController { await this.run('setSeatTier', { seatId, tierId }); } + async selectObjects(objects: string[]): Promise { + const result = await this.run('selectObjects', { objects }); + return asArray(asObject(result)?.seats).map(decodeSelectedSeat).filter((seat): seat is SelectedSeat => seat !== undefined); + } + + async deselectObjects(objects: string[]): Promise { await this.run('deselectObjects', { objects }); } + async clearSelection(): Promise { await this.run('clearSelection'); } + async selectCategories(categoryKeys: string[]): Promise { + const result = await this.run('selectCategories', { categoryKeys }); + return asArray(asObject(result)?.seats).map(decodeSelectedSeat).filter((seat): seat is SelectedSeat => seat !== undefined); + } + async deselectCategories(categoryKeys: string[]): Promise { await this.run('deselectCategories', { categoryKeys }); } + async setSelectableObjects(objects: string[] | null): Promise { await this.run('setSelectableObjects', { objects }); } + async setMaxSelection(maxSelection: number): Promise { await this.run('setMaxSelection', { maxSelection }); } + async getSelectionValidity(): Promise { + const result = await this.run('getSelectionValidity'); + return decodeSelectionValidity(asObject(result)?.validity); + } + async refreshAccess(): Promise { + const result = await this.run('refreshAccess'); + return asBoolean(asObject(result)?.refreshed) ?? false; + } + async getSelection(): Promise { const result = await this.run('getSelection'); return asArray(asObject(result)?.seats) @@ -232,6 +261,15 @@ export class SeatLayerController { await this.run('setColorblindSafe', { on }); } + async setViewMode(mode: SeatLayerViewMode): Promise { + await this.run('setViewMode', { mode }); + } + + async getViewMode(): Promise { + const result = await this.run('getViewMode'); + return asString(asObject(result)?.mode) ?? 'flat'; + } + async zoomIn(): Promise { await this.run('zoomIn'); } @@ -296,15 +334,44 @@ export class SeatLayerController { const configuration = this.configuration; if (!configuration) return; + const privateAccess = configuration.buyerAccessToken !== undefined || configuration.buyerAccessTokenProvider !== undefined; + if (privateAccess && !info.capabilities.includes('native-access-provider')) { + this.finishHandshake(SeatLayerError.incompatible('The loaded web bundle cannot securely handle buyer access. Refusing to initialize private inventory.')); + return; + } + const selectionPolicy = configuration.selectedObjects !== undefined || + configuration.selectableObjects !== undefined || + configuration.numberOfPlacesToSelect !== undefined || + configuration.selectionValidators !== undefined; + if (selectionPolicy && + (!info.capabilities.includes('selection-controls') || + !info.capabilities.includes('selection-validity'))) { + this.finishHandshake(SeatLayerError.incompatible( + 'The loaded web bundle cannot enforce the configured selection policy.', + )); + return; + } const config = compactObject({ event: configuration.event, apiBase: configuration.apiBase, publicKey: configuration.publicKey, + buyerAccessToken: configuration.buyerAccessToken === undefined + ? undefined + : compactObject({ + token: configuration.buyerAccessToken.token, + expiresAt: configuration.buyerAccessToken.expiresAt, + }), + nativeAccessProvider: configuration.buyerAccessTokenProvider === undefined ? undefined : true, maxSelection: configuration.maxSelection, + selectedObjects: configuration.selectedObjects, + selectableObjects: configuration.selectableObjects, + numberOfPlacesToSelect: configuration.numberOfPlacesToSelect, + selectionValidators: configuration.selectionValidators, locale: configuration.locale, messages: configuration.messages, currency: configuration.currency, colorblindSafe: configuration.colorblindSafe, + initialView: configuration.initialView, }); const host: JsonObject = { platform: 'react-native', @@ -342,6 +409,70 @@ export class SeatLayerController { case 'sys.error': this.finishHandshake(SeatLayerError.bridge(payload)); return; + case 'access.token.request': { + const requestId = asString(object?.requestId); + const reason = asString(object?.reason) ?? 'refresh'; + const provider = this.configuration?.buyerAccessTokenProvider; + const client = this.client; + if (!requestId) return; + const answerUnavailable = () => { + void client?.command('access.token.unavailable', { requestId }).catch(() => {}); + }; + if (!provider) { answerUnavailable(); return; } + Promise.resolve().then(() => provider({ reason })).then((token) => { + if (!token || typeof token.token !== 'string' || !token.token || + (token.expiresAt !== undefined && (!Number.isFinite(token.expiresAt)))) { + answerUnavailable(); + return; + } + void client?.command('access.token.provide', { + requestId, token: token.token, + ...(token.expiresAt === undefined ? {} : { expiresAt: token.expiresAt }), + }).catch(() => {}); + }, answerUnavailable); + return; + } + case 'selection.validity.changed': { + const validity = decodeSelectionValidity(object?.validity); + if (validity) this.events.emit('selectionValidityChanged', validity); + return; + } + case 'selection.valid': + this.events.emit( + 'selectionValid', + asArray(object?.seats) + .map(decodeSelectedSeat) + .filter((item): item is SelectedSeat => item !== undefined), + ); + return; + case 'selection.invalid': { + const validity = decodeSelectionValidity(object?.validity); + if (validity) this.events.emit('selectionInvalid', validity); + return; + } + case 'selection.limit': { + const maximum = typeof object?.maxSelection === 'number' && + Number.isInteger(object.maxSelection) + ? object.maxSelection + : undefined; + if (maximum !== undefined) this.events.emit('selectionLimit', maximum); + return; + } + case 'access.expired': { + const event = decodeBuyerAccessExpired(payload); + if (event) this.events.emit('accessExpired', event); + return; + } + case 'access.unavailable': { + const event = decodeBuyerAccessUnavailable(payload); + if (event) this.events.emit('accessUnavailable', event); + return; + } + case 'selection.unavailable': { + const event = decodeSelectedObjectsUnavailable(payload); + if (event) this.events.emit('selectedObjectsUnavailable', event); + return; + } case 'selection.changed': this.events.emit( 'selectionChanged', diff --git a/src/decode.ts b/src/decode.ts index 6d07ce9..aa66b43 100644 --- a/src/decode.ts +++ b/src/decode.ts @@ -9,6 +9,8 @@ import { import { decodeProtocolRange, nativeProtocolRange } from './bridge/protocol'; import type { BestAvailableResult, + BuyerAccessExpiredEvent, + BuyerAccessUnavailableEvent, BundleInfo, CategoryTier, FloorInfo, @@ -18,7 +20,9 @@ import type { ReadyInfo, SeatCommercialAttributes, SeatHoverDetails, + SelectedObjectUnavailableEvent, SelectedSeat, + SelectionValidity, } from './types'; function strings(value: unknown): string[] { @@ -82,6 +86,86 @@ export function decodeSelectedSeat(value: unknown): SelectedSeat | undefined { } as SelectedSeat; } +export function decodeSelectionValidity( + value: unknown, +): SelectionValidity | undefined { + const object = asObject(value); + const isValid = typeof object?.isValid === 'boolean' ? object.isValid : undefined; + const count = asInteger(object?.count); + const required = asInteger(object?.required); + const remaining = asInteger(object?.remaining); + if ( + isValid === undefined || + count === undefined || + required === undefined || + remaining === undefined + ) return undefined; + return { + isValid, + count, + required, + remaining, + seats: asArray(object?.seats) + .map(decodeSelectedSeat) + .filter((seat): seat is SelectedSeat => seat !== undefined), + violations: strings(object?.violations), + }; +} + +export function decodeBuyerAccessExpired( + value: unknown, +): BuyerAccessExpiredEvent | undefined { + const object = asObject(value); + const reason = asString(object?.reason); + const refreshed = typeof object?.refreshed === 'boolean' + ? object.refreshed + : undefined; + if (!reason || refreshed === undefined) return undefined; + return { + reason, + refreshed, + ...(asString(object?.code) === undefined + ? {} + : { code: asString(object?.code) }), + }; +} + +export function decodeBuyerAccessUnavailable( + value: unknown, +): BuyerAccessUnavailableEvent | undefined { + const object = asObject(value); + const reason = asString(object?.reason); + const retryable = typeof object?.retryable === 'boolean' + ? object.retryable + : undefined; + if (!reason || retryable === undefined) return undefined; + return { + reason, + retryable, + ...(asString(object?.code) === undefined + ? {} + : { code: asString(object?.code) }), + ...(asInteger(object?.status) === undefined + ? {} + : { status: asInteger(object?.status) }), + }; +} + +export function decodeSelectedObjectsUnavailable( + value: unknown, +): SelectedObjectUnavailableEvent | undefined { + const object = asObject(value); + const reason = asString(object?.reason); + if (!reason) return undefined; + return { + labels: strings(object?.labels), + reason, + ...(asString(object?.code) === undefined + ? {} + : { code: asString(object?.code) }), + }; +} + function decodeLineItem(value: unknown): HoldLineItem | undefined { const object = asObject(value); const label = asString(object?.label); @@ -221,6 +305,7 @@ export function decodeBundleInfo(value: JsonValue | undefined): BundleInfo { : { version: asString(object?.bundle) }), commands: strings(object?.commands), events: strings(object?.events), + capabilities: strings(object?.capabilities), raw: value, }; } diff --git a/src/generated/webDocument.ts b/src/generated/webDocument.ts deleted file mode 100644 index f41ef6a..0000000 --- a/src/generated/webDocument.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Generated by scripts/generate-web-document.mjs. Do not edit. -export const seatLayerWebDocument = "\n\n\n\n\n\nSeatLayer\n\n\n\n\n
\n\n\n\n"; diff --git a/src/index.ts b/src/index.ts index 484b6c0..da01004 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,8 +4,17 @@ export { SeatLayerView, type SeatLayerViewProps } from './SeatLayerView'; export { useSeatLayerController } from './useSeatLayerController'; export { seatLayerBundledWebVersion, + seatLayerHostedWebVersion, + seatLayerMobileOrigin, + seatLayerMobilePageUrl, seatLayerSdkVersion, type BestAvailableResult, + type BuyerAccessExpiredEvent, + type BuyerAccessRefreshReason, + type BuyerAccessToken, + type BuyerAccessTokenProvider, + type BuyerAccessUnavailableEvent, + type BuyerAccessUnavailableReason, type BridgeErrorDetails, type BundleInfo, type CategoryTier, @@ -20,6 +29,11 @@ export { type SeatHoverDetails, type SeatLayerConfiguration, type SeatLayerEventMap, + type SeatLayerViewMode, + type SelectedObjectUnavailableEvent, type SelectedSeat, + type SelectionValidator, + type SelectionValidity, + type SelectionViolation, type UnknownEvent, } from './types'; diff --git a/src/types.ts b/src/types.ts index 2446682..463d9ce 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,7 +1,11 @@ import type { JsonObject, JsonValue } from './json'; -export const seatLayerSdkVersion = '0.1.2'; -export const seatLayerBundledWebVersion = '0.30.1'; +export const seatLayerSdkVersion = '0.2.0'; +export const seatLayerHostedWebVersion = '0.66.0'; +/** @deprecated Production uses the hosted runtime; use seatLayerHostedWebVersion. */ +export const seatLayerBundledWebVersion = seatLayerHostedWebVersion; +export const seatLayerMobileOrigin = 'https://cdn.seatlayer.io'; +export const seatLayerMobilePageUrl = `${seatLayerMobileOrigin}/seatlayer-js@${seatLayerHostedWebVersion}/mobile.html`; export interface ProtocolRange { min: number; @@ -15,13 +19,22 @@ export interface SeatLayerConfiguration { apiBase?: string; /** Reserved for future authenticated rendering. Never pass a secret key. */ publicKey?: string; + /** Opaque buyer session minted by your backend for https://cdn.seatlayer.io. */ + buyerAccessToken?: BuyerAccessToken; + /** Called only over the native bridge; its token is never put in a URL or event. */ + buyerAccessTokenProvider?: BuyerAccessTokenProvider; maxSelection?: number; + selectedObjects?: string[]; + selectableObjects?: string[] | null; + numberOfPlacesToSelect?: number; + selectionValidators?: SelectionValidator[]; /** BCP 47 UI locale. Built-in bundles currently include en, es, de and fr. */ locale?: string; messages?: Record; /** ISO 4217 display currency. */ currency?: string; colorblindSafe?: boolean; + initialView?: SeatLayerViewMode; /** Leave false when the app renders its own touch-friendly seat sheet. */ showsWebSeatTooltip?: boolean; /** Native command deadline. Defaults to 15 seconds. */ @@ -32,12 +45,83 @@ export interface SeatLayerConfiguration { hostInfo?: Record; } +export type BuyerAccessRefreshReason = + | 'initial' + | 'expiring' + | 'expired' + | 'unauthorized' + | 'reconnect' + | 'manual' + | (string & {}); + +export interface BuyerAccessToken { + token: string; + /** Epoch milliseconds. Omit to refresh reactively. */ + expiresAt?: number; +} + +export type BuyerAccessTokenProvider = (context: { + reason: BuyerAccessRefreshReason; +}) => Promise | BuyerAccessToken; + +export type BuyerAccessUnavailableReason = + | 'revoked' + | 'paused' + | 'invalid' + | 'origin_mismatch' + | 'event_mismatch' + | 'group_mismatch' + | 'mode_mismatch' + | 'channel_denied' + | 'invalid_scope' + | 'provider_failed' + | 'no_token' + | (string & {}); + +export interface BuyerAccessExpiredEvent { + reason: BuyerAccessRefreshReason; + code?: string; + refreshed: boolean; +} + +export interface BuyerAccessUnavailableEvent { + reason: BuyerAccessUnavailableReason; + code?: string; + status?: number; + retryable: boolean; +} + +export interface SelectedObjectUnavailableEvent { + labels: string[]; + reason: 'ineligible' | 'taken' | 'exhausted' | (string & {}); + code?: string; +} + +export type SeatLayerViewMode = + | 'flat' + | 'iso' + | 'perspective' + | (string & {}); + +export type SelectionValidator = + | { type: 'minimumSelectedPlaces'; minimum: number } + | { type: 'consecutiveSeats' } + | { type: 'noOrphanSeats' }; + +export type SelectionViolation = + | 'numberOfPlacesToSelect' + | 'minimumSelectedPlaces' + | 'consecutiveSeats' + | 'noOrphanSeats' + | (string & {}); + export interface BundleInfo { protocol: ProtocolRange; version?: string; platform?: string; commands: string[]; events: string[]; + capabilities: string[]; raw: JsonValue | undefined; } @@ -75,6 +159,15 @@ export interface SelectedSeat { commercial?: SeatCommercialAttributes; } +export interface SelectionValidity { + isValid: boolean; + count: number; + required: number; + remaining: number; + seats: SelectedSeat[]; + violations: SelectionViolation[]; +} + export interface HoldLineItem { label: string; objectId?: string; @@ -154,5 +247,12 @@ export interface SeatLayerEventMap { gaClick: GAArea; seatHover: SeatHoverDetails | undefined; deckTap: string; + selectionValidityChanged: SelectionValidity; + selectionValid: SelectedSeat[]; + selectionInvalid: SelectionValidity; + selectionLimit: number; + accessExpired: BuyerAccessExpiredEvent; + accessUnavailable: BuyerAccessUnavailableEvent; + selectedObjectsUnavailable: SelectedObjectUnavailableEvent; unknownEvent: UnknownEvent; } diff --git a/test/controller.test.ts b/test/controller.test.ts index 48bebed..1c8ec38 100644 --- a/test/controller.test.ts +++ b/test/controller.test.ts @@ -3,6 +3,19 @@ import { describe, expect, it } from 'vitest'; import type { BridgeTransport } from '../src/bridge/client'; import type { Envelope } from '../src/bridge/envelope'; import { SeatLayerController } from '../src/controller'; +import { + seatLayerHostedWebVersion, + seatLayerMobilePageUrl, +} from '../src/types'; + +describe('runtime metadata', () => { + it('keeps the hosted version and immutable page in lockstep', () => { + expect(seatLayerHostedWebVersion).toBe('0.66.0'); + expect(seatLayerMobilePageUrl).toBe( + `https://cdn.seatlayer.io/seatlayer-js@${seatLayerHostedWebVersion}/mobile.html`, + ); + }); +}); class RecordingTransport implements BridgeTransport { readonly frames: Envelope[] = []; @@ -36,7 +49,7 @@ describe('SeatLayerController', () => { expect(transport.frames[0]).toMatchObject({ kind: 'init', payload: { - host: { platform: 'react-native', sdk: '0.1.2' }, + host: { platform: 'react-native', sdk: '0.2.0' }, config: { event: 'ev_test', currency: 'USD' }, }, }); @@ -115,4 +128,107 @@ describe('SeatLayerController', () => { await expect(ready).resolves.toMatchObject({ protocolRevision: 1 }); controller.dispose(); }); + + it('negotiates private selection capabilities and correlates token refresh', async () => { + const controller = new SeatLayerController(); + const transport = new RecordingTransport(); + const ready = controller.beginHandshake(transport, { + event: 'ev_private', + numberOfPlacesToSelect: 2, + selectionValidators: [{ type: 'consecutiveSeats' }], + buyerAccessTokenProvider: async ({ reason }) => ({ + token: `bse_${reason}`, + expiresAt: 123, + }), + }); + + controller.ingestRaw({ + sl: 1, + k: 'hello', + t: 'hello', + p: { + protocol: { min: 1, max: 1 }, + capabilities: [ + 'native-access-provider', + 'selection-controls', + 'selection-validity', + ], + commands: [], + events: [], + }, + }); + expect(transport.frames[0]).toMatchObject({ + kind: 'init', + payload: { + config: { + event: 'ev_private', + nativeAccessProvider: true, + numberOfPlacesToSelect: 2, + selectionValidators: [{ type: 'consecutiveSeats' }], + }, + }, + }); + + controller.ingestRaw({ + sl: 1, + k: 'evt', + t: 'sys.ready', + n: 1, + p: { protocol: 1 }, + }); + await ready; + + let validity: unknown; + controller.on('selectionValidityChanged', (event) => { + validity = event; + }); + controller.ingestRaw({ + sl: 1, + k: 'evt', + t: 'selection.validity.changed', + n: 2, + p: { + validity: { + isValid: false, + count: 1, + required: 2, + remaining: 1, + seats: [{ id: 's1', label: 'A-1' }], + violations: ['numberOfPlacesToSelect'], + }, + }, + }); + expect(validity).toMatchObject({ + isValid: false, + count: 1, + violations: ['numberOfPlacesToSelect'], + }); + + controller.ingestRaw({ + sl: 1, + k: 'evt', + t: 'access.token.request', + n: 3, + p: { requestId: 'access-1', reason: 'reconnect' }, + }); + await new Promise((resolve) => setTimeout(resolve, 0)); + const response = transport.frames[transport.frames.length - 1]!; + expect(response).toMatchObject({ + kind: 'cmd', + type: 'access.token.provide', + payload: { + requestId: 'access-1', + token: 'bse_reconnect', + expiresAt: 123, + }, + }); + controller.ingestRaw({ + sl: 1, + k: 'res', + t: 'access.token.provide', + id: response.id, + p: {}, + }); + controller.dispose(); + }); });