@seatlayer/js 0.109.2 → 0.110.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import{a as bi,b,c as Ye,d as yi,e as qo,f as Wo,g as _,h as Yo,i as vi,j as wi,k as xi,l as ki,m as gt,n as Zo,o as Qo,p as Xo,q as Jo,r as es,s as Si,t as ns,u as os}from"./chunk-U2Z2AGRX.js";import{a as Uo}from"./chunk-ICMSBXRJ.js";import{a as ts,b as is,d as Ti,e as bt,f as Ei,g as yt}from"./chunk-UBFNMA7U.js";import{a as h,b as C,c as x,d as w}from"./chunk-OSZ7DOEH.js";import{PickerController as Ap,formatMoney as sn,getLocale as to,loadLocale as Pp,localeDirection as Lp,LOCALE_NAMES as Mp,resolveLocale as Hp,seatPriceEntry as Rp,setStringOverrides as Ip,t as we}from"@seatlayer/core";var zc=/^[0-9A-Za-z.+-]{1,24}$/,jc=zc.test("0.109.2")?"0.109.2":"",Gc={host:"web",platform:"web",bundle:jc,protocol:0,chromeOwner:"web"},Kc={...Gc},Ci=null,ss=null;function Uc(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function qc(){let i=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:i(Uc()),documentMs:Ci==null?0:i(Ci),handshakeMs:Ci==null||ss==null?0:i(ss-Ci)}}function rs(){let{host:i,platform:e,bundle:t,protocol:n,chromeOwner:o}=Kc,s=qc();return{host:i,platform:e,...t?{bundle:t}:{},...n?{protocol:n}:{},chromeOwner:o,bootMs:s.bootMs,documentMs:s.documentMs,handshakeMs:s.handshakeMs}}var as=new Set,ls=new Map;function Ee(i){return as.has(i)?"repeat":"cold"}function Ai(i){let e=Ee(i);return as.add(i),e}function re(i){return typeof i=="number"&&Number.isFinite(i)&&i>=0?Math.round(i):0}function Wt(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function Wc(i){if(!/^[A-Za-z0-9_-]{1,80}$/.test(i.event))return null;let e=i.performanceProfile??{};return{event:i.event,scope:i.scope,surface:i.surface,outcome:i.outcome,stage:i.stage?.slice(0,32)??"",ms:re(i.ms),api:re(e.loadChartAndStatuses)||re(e.loadChart),scene:re(e.buildScene),panel:re(e.buildBuyerControls),paint:re(e.firstPaint),normalize:re(e.normalizeBuyerModel),renderer:re(e.createRenderer),seats:re(i.seats),floors:re(i.floors),view:i.view??"map",load:i.load??Ee(i.event),transport:i.transport??"pubapi",...rs(),availabilityMs:re(e.loadStatuses),...typeof i.revealWaitMs=="number"?{revealWaitMs:re(i.revealWaitMs)}:{},...typeof i.handoverMs=="number"?{handoverMs:re(i.handoverMs)}:{},mounts:(ls.get(i.event)??0)+1,reconnects:re(i.reconnects)}}var Yc=new Set;function ye(i){let e=Wc(i);if(e){ls.set(i.event,e.mounts);for(let t of Yc)try{t(e)}catch{}typeof fetch>"u"||Wt()||fetch(`${i.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}var Zc="realtime.fallback_polling",cs=new Set;function Qc(i){let e=/^(wss?):\/\/([^/]+)(.*?)\/pub\/events\/([^/?#]+)\/subscribe(?:[?#]|$)/.exec(i);if(!e)return null;let t;try{t=decodeURIComponent(e[4])}catch{return null}return/^[A-Za-z0-9_-]{1,80}$/.test(t)?{apiBase:`${e[1]==="wss"?"https":"http"}://${e[2]}${e[3]}`,eventKey:t}:null}function ds(i){let e=Qc(i);return!e||cs.has(e.eventKey)||(cs.add(e.eventKey),typeof fetch>"u"||Wt())?!1:(fetch(`${e.apiBase}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:Zc,eventKey:e.eventKey}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0)}var Ze="seatlayer.v1",ps="\0",hs=4401,Xc=15e3,Jc=25e3,ed=1e4,us=5e3,td=JSON.stringify({type:"resume"}),id=3e4,nd=6e4,od=["pointermove","touchstart","keydown"],sd=3,rd=15e3,ms=6e4;function ad(i){let e=typeof i.default=="string"?i.default:"free",t={};if(i.seats&&typeof i.seats=="object")for(let[n,o]of Object.entries(i.seats))typeof o=="string"&&o!==e&&(t[n]=o);return{default:e,exceptions:t}}function ld(i,e){if(!i||i.default!==e.default)return null;let t=[];for(let[n,o]of Object.entries(e.exceptions))i.exceptions[n]!==o&&t.push({label:n,status:o});for(let n of Object.keys(i.exceptions))n in e.exceptions||t.push({label:n,status:e.default});return t}function cd(i,e){for(let t of e)t.status===i.default?delete i.exceptions[t.label]:i.exceptions[t.label]=t.status}function fs(i){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var Ce=class{constructor(e){this.ws=null;this.watched=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.failedUpgrades=0;this.pollTimer=null;this.fellBack=!1;this.lastWake=-1/0;this.lastInput=0;this.detachWake=null;this.reconnectCount=0;this.opts=e,typeof e.url=="string"&&fs(e.url)}get polling(){return this.pollTimer!==null}get protocol(){return this.ws?this.v1?"v1":"legacy":null}get snapshotVersion(){return this.version}start(){this.stopped&&(this.stopped=!1,this.attachWake(),this.connect())}stop(){this.stopped=!0,this.clearTimers(),this.stopPolling(),this.detachWake?.(),this.detachWake=null;let e=this.ws;if(this.ws=null,e){e.onopen=null,e.onmessage=null,e.onclose=null,e.onerror=null;try{e.close()}catch{}}}restart(){this.stop(),this.projection=null,this.version=null,this.attempt=0,this.failedUpgrades=0,this.start()}async connect(){if(this.stopped)return;let e=[Ze];if(this.opts.mintTicket){let a;try{a=await this.opts.mintTicket()}catch(l){this.reportIfAccessError(l),this.scheduleReconnect();return}if(this.stopped)return;a?.protocols?.length?(e=[...a.protocols],e.includes(Ze)||e.unshift(Ze)):a?.ticket&&(e=[Ze,`tkt.${a.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let n=typeof this.opts.url=="function"?this.opts.url():this.opts.url,o=this.useQueryMarker?`${n}${n.includes("?")?"&":"?"}pv=1`:n;fs(o);let s;try{s=(this.opts.socketFactory??((l,c)=>new WebSocket(l,c)))(o,e)}catch{this.upgradeFailed(),this.scheduleReconnect();return}this.ws=s;let r=!1;s.onopen=()=>{this.ws===s&&(r=!0,this.attempt=0,this.failedUpgrades=0,this.stopPolling(),this.v1=s.protocol===Ze,this.v1||(this.useQueryMarker=!0),this.startKeepalive(s),this.watched=null,this.watchHold(this.opts.heldHoldId?.()??null),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},us):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},us))},s.onmessage=a=>{if(this.ws!==s)return;let l;try{l=JSON.parse(typeof a.data=="string"?a.data:"")}catch{return}!l||typeof l!="object"||this.handleFrame(l)},s.onclose=a=>{if(this.ws===s){if(this.ws=null,this.clearTimers(),!r&&a?.code!==hs&&this.upgradeFailed(),a?.code===hs){if(a.reason==="access_expired"){this.scheduleReconnect();return}if(a.reason==="idle_expired"&&this.opts.onIdleExpired){this.stopped=!0,this.stopPolling(),this.opts.onIdleExpired();return}this.stopped=!0,this.stopPolling(),this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},s.onerror=()=>{try{s.close()}catch{}}}watchHold(e){let t=this.ws;if(!(!e||e===this.watched||!t||t.readyState!==1))try{t.send(JSON.stringify({type:"watch",holdId:e})),this.watched=e}catch{}}handleFrame(e){let t=typeof e.type=="string"?e.type:"";if(e.protocol===1&&(this.v1=!0),typeof e.snapshotVersion=="number"&&(this.version=e.snapshotVersion),t==="pong"){this.clearPongTimer();return}if(t==="sales"){this.opts.sink.onSales?.(e);return}if(Array.isArray(e.hidden)||Array.isArray(e.closed)){let n=Array.isArray(e.hidden)?e.hidden:[],o=Array.isArray(e.closed)?e.closed:[],s=n.join(ps),r=o.join(ps);(s!==this.hidden||r!==this.closedSections)&&(this.hidden=s,this.closedSections=r,this.opts.sink.onSections?.(n,o,{withInventory:t==="snapshot"||!!e.seats}))}if(t!=="hidden"){if(t==="hold"){typeof e.holdId=="string"&&typeof e.state=="string"&&this.opts.onHoldState?.(e.holdId,e.state);return}if(t==="presence"){this.opts.sink.onPresence?.({shoppingSessions:Number(e.shoppingSessions)||0,activeHolds:Number(e.activeHolds)||0});return}if(t!=="allocation"){if(t==="snapshot"||!t&&e.seats){this.answered();let n=ad(e),o=ld(this.projection,n);this.projection=n,o===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(n):this.opts.sink.resync():o.length&&this.opts.sink.applyStatuses(o);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let n=e.changes.filter(o=>typeof o?.label=="string"&&typeof o?.status=="string").map(o=>({label:o.label,status:o.status}));if(!n.length)return;this.projection&&cd(this.projection,n),this.opts.sink.applyStatuses(n)}}}}answered(){this.resumeTimer&&(clearTimeout(this.resumeTimer),this.resumeTimer=null)}reportIfAccessError(e){let t=e?.reason;e?.name==="BuyerAccessUnavailableError"&&(this.stopped=!0,this.stopPolling(),this.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}upgradeFailed(){this.failedUpgrades+=1,this.failedUpgrades>=sd&&this.startPolling()}startPolling(){if(!(this.pollTimer||this.stopped)){if(!this.fellBack){this.fellBack=!0;try{this.opts.onFallbackPolling?.()}catch{}let e=typeof this.opts.url=="function"?this.opts.url():this.opts.url;ds(e)}this.pollTimer=setInterval(()=>{if(this.stopped){this.stopPolling();return}typeof document<"u"&&document.hidden||Promise.resolve().then(()=>this.opts.poll?this.opts.poll():this.opts.sink.resync({reason:"frame"})).catch(()=>{})},rd)}}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}now(){return this.opts.now?this.opts.now():Date.now()}attachWake(){if(this.detachWake||typeof document>"u"||typeof window>"u"||typeof document.addEventListener!="function"||typeof window.addEventListener!="function")return;this.lastInput=this.now();let e=()=>{document.visibilityState==="visible"&&this.wake()},t=()=>{let s=this.now(),r=s-this.lastInput>=nd;this.lastInput=s,r&&this.wake()},n={capture:!0,passive:!0},o=s=>{document[s]("visibilitychange",e),window[s]("focus",e);for(let r of od)document[s](r,t,n)};o("addEventListener"),this.detachWake=()=>o("removeEventListener")}wake(){let e=this.ws;if(!e||e.readyState!==1)return;let t=this.now();if(!(t-this.lastWake<id)){try{e.send(td)}catch{return}this.lastWake=t}}startKeepalive(e){this.pingTimer=setInterval(()=>{if(this.ws===e){try{e.send(JSON.stringify({type:"ping"}))}catch{return}this.clearPongTimer(),this.pongTimer=setTimeout(()=>{this.pongTimer=null;try{e.close()}catch{}},ed)}},Jc)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,Xc),n=this.pollTimer?ms/2+Math.random()*ms/2:Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.reconnectCount+=1,this.connect()},n)}get reconnects(){return this.reconnectCount}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 dd(i){return i==="blocked"?"not_for_sale":i==="unavailable"?"held":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}var pd="#f43f5e";function Yt(i,e={}){let t=n=>{let o=i.tableSelection(n);if(o)return o.physicalSeatIds;let s=i.idForLabel(n);return s?[s]:[]};return{applyStatuses(n){let o=new Set([...i.currentHold()?.labels??[],...e.ownLabels?.()??[]]),s={free:[],held:[],booked:[],not_for_sale:[]},r=[],a=[],l=new Map(i.getSelection().map(c=>[c.label,c.id]));for(let c of n){let d=t(c.label);if(!d.length)continue;let u=dd(c.status);if(s[u].push(...d),e.flashOnLiveChange&&u!=="free"&&!o.has(c.label)&&d.some(m=>i.getStatus(m)==="free"))for(let m of d)r.push({id:m,color:pd});u!=="free"&&!o.has(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])s[c].length&&i.setStatus(s[c],c);for(let c of r)i.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(u=>t(u));c.length&&i.deselect(c);let d=n.some(u=>u.status==="blocked"&&a.includes(u.label));e.onSelectedObjectUnavailable?.(a,d?"ineligible":"taken")}e.onStatusChange?.()},...i.applyProjection?{applyProjection:n=>{i.applyProjection(n)}}:{},async resync(n){await(i.resync?i.resync(n):i.refresh())},onSections(n,o,s){s?.withInventory||(i.resync?i.resync({reason:"frame"}):i.refresh()),e.onSections?.(n,o,s)}}}var Qe="pricingContract=matrix-v1&pricingContract=seat-v1",V=class extends Error{constructor(e,t,n,o,s,r,a,l){super(t),this.name="ApiError",this.status=e,this.code=n,this.conflicts=o,this.reason=s,this.retryAfterS=r,this.notice=a,l?.fields&&(this.fields=l.fields),typeof l?.retryable=="boolean"&&(this.retryable=l.retryable),l?.hint&&(this.hint=l.hint),l?.serverMessage&&(this.serverMessage=l.serverMessage)}},gs=10,bs=1;function Zt(i,e){let t=(i??"").trim();if(t){let n=Number(t);if(Number.isFinite(n)&&n>=0)return Math.ceil(n);let o=Date.parse(t);if(Number.isFinite(o))return Math.max(0,Math.ceil((o-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}function hd(i){let e=i;return!!e&&typeof e.ticketKey=="string"&&typeof e.label=="string"&&Number.isFinite(e.unitIndex)&&Number.isFinite(e.quantity)&&(e.displayLabel===void 0||typeof e.displayLabel=="string")}var ud={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"};function md(){return typeof crypto>"u"?null:typeof crypto.randomUUID=="function"?crypto.randomUUID():typeof crypto.getRandomValues!="function"?null:Array.from(crypto.getRandomValues(new Uint8Array(18)),i=>i.toString(16).padStart(2,"0")).join("")}function fd(i,e){let t=e.map(n=>[n.label,n.tierId??null,n.quantity??null]).sort((n,o)=>n[0]<o[0]?-1:n[0]>o[0]?1:0);return JSON.stringify([i,t])}function gd(i){return i instanceof V?i.status===408||i.status===429||i.status>=500:!0}function ys(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}var _e=class{constructor(e,t={}){this.base=e;this.viewerId=ys();this.holdAttempt=null;this.holdIdempotency=!0;this.ticketKeysByHold=new Map;this.access=t.access,this.onObjectUnavailable=t.onObjectUnavailable;let n=t.referral?.trim();this.referral=n?n.slice(0,120):void 0}rotateViewerId(){this.viewerId=ys()}async pickerIdleMinutes(){return null}get accessScoped(){return!!this.access?.configured}async request(e,t={},n={}){let o=t.method??"GET",s={},r;t.body!==void 0&&(s["Content-Type"]="application/json",r=JSON.stringify(t.body));let a=await this.access?.authorization(n.auth?"unauthorized":"initial");if(a&&(s.Authorization=a),t.idempotency){let m=this.holdAttemptKey(`${t.idempotency.binding}\0${a??""}`);t.idempotency.used(m??void 0),m&&(s["Idempotency-Key"]=m)}let l=o==="GET"||e.endsWith("/hold/resume")?new AbortController:null,c=l?setTimeout(()=>l.abort(),4e4):null,d,u;try{d=await fetch(`${this.base}${e}`,{method:o,headers:s,body:r,credentials:"omit",...l?{signal:l.signal}:{}}),u=(d.headers.get("content-type")??"").includes("application/json")?await d.json().catch(p=>{if(l?.signal.aborted)throw p;return null}):null}finally{c!==null&&clearTimeout(c)}if(!d.ok){let m=u,p=m?.code??m?.error,v=d.status===401&&p==="buyer_access_invalid"&&e.endsWith("/hold/resume");if(this.access?.configured&&!v&&(d.status===401||d.status===403||d.status===422)&&await this.access.handleFailure(d.status,p)&&!n.auth)return this.request(e,t,{...n,auth:!0});if(d.status===409){let T=p?ud[p]:void 0,S=m?.conflicts?.map(y=>y.label)??t.labels??[];T&&this.onObjectUnavailable?.({labels:S,reason:T,code:p})}let g;if(d.status===429&&(g=Zt(d.headers.get("Retry-After"),m?.retryAfterSeconds)??bs,o==="GET"&&!n.rateLimit&&g<=gs))return await new Promise(T=>setTimeout(T,g*1e3)),this.request(e,t,{...n,rateLimit:!0});throw d.status===503&&(g=Zt(d.headers.get("Retry-After"),m?.retryAfterSeconds)),new V(d.status,m?.error??`request_failed_${d.status}`,p,m?.conflicts,m?.reason,g,typeof m?.notice=="string"&&m.notice?m.notice:void 0,{...Array.isArray(m?.fields)?{fields:m.fields}:{},...typeof m?.retryable=="boolean"?{retryable:m.retryable}:{},...typeof m?.hint=="string"&&m.hint?{hint:m.hint}:{},...typeof m?.message=="string"&&m.message?{serverMessage:m.message}:{}})}return u}async requestBlob(e,t={}){let n={},o=await this.access?.authorization(t.auth?"unauthorized":"initial");o&&(n.Authorization=o);let s=await fetch(`${this.base}${e}`,{method:"GET",headers:n,credentials:"omit"});if(s.ok)return s.blob();let a=(s.headers.get("content-type")??"").includes("application/json")?await s.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(s.status===401||s.status===403||s.status===422)&&await this.access.handleFailure(s.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(s.status===429&&(c=Zt(s.headers.get("Retry-After"),a?.retryAfterSeconds)??bs,!t.rateLimit&&c<=gs))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new V(s.status,a?.error??`request_failed_${s.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new V(404,"not_found","not_found"))}async objects(e){return{...await this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1&${Qe}`),fetchedAt:Date.now()}}hold(e,t,n,o){let s=`/pub/events/${encodeURIComponent(e)}/hold?${Qe}`,r={method:"POST",body:{selections:t,...n?{ttlMs:n}:{},...o?{replaceHoldId:o}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(l=>l.label)};return(o||!this.holdIdempotency?this.request(s,r):this.keyedHold(s,r,fd(e,t))).then(l=>this.noteTicketKeys(l,o))}holdAttemptKey(e){if(this.holdAttempt?.binding===e)return this.holdAttempt.key;let t=md();return this.holdAttempt=t?{binding:e,key:t}:null,t}endHoldAttempt(e){e&&this.holdAttempt?.key===e&&(this.holdAttempt=null)}async keyedHold(e,t,n,o=!1){let s;try{let r=await this.request(e,{...t,idempotency:{binding:n,used:a=>{s=a}}});return this.endHoldAttempt(s),r}catch(r){if(gd(r))throw r;this.endHoldAttempt(s);let a=r.code;if(a==="idempotency_key_reused"&&!o)return this.keyedHold(e,t,n,!0);if(a==="invalid_idempotency_key")return this.holdIdempotency=!1,this.request(e,t);throw r}}noteTicketKeys(e,t){if(t&&this.ticketKeysByHold.delete(t),!e?.holdId)return e;let n=Array.isArray(e.ticketKeys)&&e.ticketKeys.every(s=>typeof s=="string")?[...e.ticketKeys]:null,o=Array.isArray(e.ticketKeyDetails)&&e.ticketKeyDetails.every(hd)?e.ticketKeyDetails.map(({ticketKey:s,label:r,unitIndex:a,quantity:l,displayLabel:c})=>({ticketKey:s,label:r,unitIndex:a,quantity:l,...c?{displayLabel:c}:{}})):null;return n||o?this.ticketKeysByHold.set(e.holdId,{...n?{ticketKeys:n}:{},...o?{ticketKeyDetails:o}:{}}):this.ticketKeysByHold.delete(e.holdId),e}ticketKeysFor(e){let t=this.ticketKeysByHold.get(e);return t?{...t}:null}bestAvailable(e,t,n,o,s){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available?${Qe}`,{method:"POST",body:{qty:t,...n?{categoryKey:n}:{},...o?{zoneId:o}:{},...s?{ttlMs:s}:{},...this.referral?{referral:this.referral}:{}}}).then(r=>this.noteTicketKeys(r))}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}}).then(n=>this.noteTicketKeys(n))}release(e,t,n){return this.holdAttempt=null,this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:n}}).then(o=>{let s=this.ticketKeysByHold.get(n);if(s){let r=new Set(o?.released??t);this.ticketKeysByHold.set(n,{...s.ticketKeys?{ticketKeys:s.ticketKeys.filter(a=>!r.has(a))}:{},...s.ticketKeyDetails?{ticketKeyDetails:s.ticketKeyDetails.filter(a=>!r.has(a.ticketKey))}:{}})}return o})}extend(e,t,n){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...n?{ttlMs:n}:{}}})}paymentOptions(e){return this.request(`/pub/events/${encodeURIComponent(e)}/payment-options`)}availability(e,t=!1){return this.request(`/pub/events/${encodeURIComponent(e)}/availability?${Qe}${t?"&live=1":""}`)}startCheckout(e,t){return this.holdAttempt=null,this.request(`/pub/events/${encodeURIComponent(e)}/checkout`,{method:"POST",body:t})}orderStatus(e){return this.request(`/pub/orders/${encodeURIComponent(e)}/status`)}subscribeTicket(e){return this.request(`/pub/events/${encodeURIComponent(e)}/subscribe-tickets`,{method:"POST",body:{}})}subscribeUrl(e){let t=this.base.replace(/^http/,"ws"),n=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${n}&${Qe}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[Ze]}createRealtime(e,t){return this.accessScoped?null:new Ce({url:this.subscribeUrl(e),sink:t})}};import{t as Ns,tCount as kd}from"@seatlayer/core";import{compactRowLabel as bd,seatNoteRowModel as yd,seatTypeIconSvg as ks,t as Xe}from"@seatlayer/core";import{seatConfidenceDisclosure as vd}from"@seatlayer/core/core/seatConfidence";function On(i){return/early[\s-]*bird/i.test(i?.trim()??"")}function vs(i){return On(i)?'<svg class="sl-offer-icon sl-offer-icon-discount" viewBox="0 0 32 32" aria-hidden="true"><defs><linearGradient id="sl-offer-discount-gradient" x1="29.492" y1="0" x2="20.028" y2="36.183" gradientUnits="userSpaceOnUse"><stop stop-color="#FD6D00"/><stop offset="1" stop-color="#F8B302"/></linearGradient></defs><path d="M16 22.751a1.071 1.071 0 1 0 0-2.142 1.071 1.071 0 0 0 0 2.142ZM16 11.39a1.071 1.071 0 1 0 0-2.141 1.071 1.071 0 0 0 0 2.141Z" fill="url(#sl-offer-discount-gradient)"/><path d="M31.137.863A2.928 2.928 0 0 0 29.054 0H17.836c-.787 0-1.527.307-2.083.863L.863 15.753A2.93 2.93 0 0 0 0 17.836c0 .787.307 1.527.863 2.083l11.218 11.218A2.927 2.927 0 0 0 14.164 32c.787 0 1.527-.307 2.083-.863l14.89-14.89A2.928 2.928 0 0 0 32 14.164V2.946c0-.788-.307-1.527-.863-2.083ZM16 7.374a2.946 2.946 0 1 1 0 5.891 2.946 2.946 0 0 1 0-5.891Zm0 17.252a2.946 2.946 0 1 1 0-5.891 2.946 2.946 0 0 1 0 5.891Zm6.025-7.689H9.975a.938.938 0 0 1 0-1.875h12.05a.938.938 0 0 1 0 1.875Zm4.017-10.041a.938.938 0 1 1 0-1.875.938.938 0 0 1 0 1.875Z" fill="url(#sl-offer-discount-gradient)"/></svg>':'<svg class="sl-offer-icon sl-offer-icon-tag" viewBox="0 0 24 24" aria-hidden="true"><path d="M20.6 13.6 13.7 20.5a2 2 0 0 1-2.8 0L3.5 13.1A2 2 0 0 1 3 11.7V4h7.7a2 2 0 0 1 1.4.6l8.5 8.5a.7.7 0 0 1 0 .5Z"/><circle cx="7.5" cy="8.5" r="1"/></svg>'}function Pi(i,e){return`<span class="sl-offer-mark" role="img" aria-label="${e(i)}" title="${e(i)}">${vs(i)}</span>`}function Li(i,e){return`<span class="sl-offer-badge">${vs(i)}<span>${e(i)}</span></span>`}function ws(i,e=Date.now()){let t=i-e;if(t<=0)return null;let n=Math.max(1,Math.ceil(t/6e4)),o=Math.floor(n/1440),s=Math.floor(n%1440/60),r=n%60;return`${(o>0?[`${o}d`,...s?[`${s}h`]:[]]:[...s?[`${s}h`]:[],...r||!s?[`${r}m`]:[]]).join(" ")} left`}function _n(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function E(i){return String(i??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Nn(i){return i?yd(i).map(e=>({...e,title:b(e.titleKey,e.titleFallback)})):[]}function Ss(i){return Nn(i).map(e=>e.title)}function Je(i,e={}){return Dn(Nn(i),e)}function Dn(i,e={}){if(!i.length)return"";let t=e.compact?15:17,n=i.map(o=>`<div class="sl-note sl-note-${E(o.tone)}"><span class="sl-note-i">${ks(o.icon,{size:t})}</span><span class="sl-note-t"><b>${E(o.title)}</b>`+(o.note?`<span class="sl-note-n">${E(o.note)}</span>`:"")+"</span></div>").join("");return`<div class="sl-notes${e.compact?" compact":""}">${n}</div>`}function Ts(i){return Nn(i).map(e=>{let t=E(e.note?`${e.title}: ${e.note}`:e.title);return`<span class="sl-cx-mark sl-cx-mark-${E(e.tone)}" role="img" aria-label="${t}" title="${t}">${ks(e.icon,{size:13})}</span>`}).join("")}function Mi(i){let e=[];return i?.restrictedView&&e.push(b("picker.restrictedView","Restricted view")),i?.obstructedView&&e.push(b("picker.obstructedView","Obstructed view")),e}function Bn(i,e){if(!i)return"";let t=e?b("picker.viewFromThisSeat","View from this seat"):b("picker.seeItIn3d","See it in 3D"),n=e?b("picker.viewFromHere","View from here"):t;return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${n}</span></button>`}function Es(i,e){if(!e)return"";let t=e,n=t.includes(i.id),o=n?t.length>1?b("picker.openComparison","Open comparison"):b("picker.savedForComparison","Saved for comparison"):t.length?b("picker.compareWithSaved","Compare with saved"):b("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${n&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${E(o)}</span></button>`}function Cs(i,e,t){if(!t)return"";let n=vd(i.confidenceEvidence),o=n.modeledTarget??n.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${E(i.displayLabel??i.label)}"><span><em>${E(e)}</em><strong>${E(n.headline)}</strong><small>${E(o)}</small></span><b>Passport</b></button>`}function q(i){let e=i?.rowLabel,t=i?.sectionLabel;if(!e||!t)return e;for(let n of["-"," ","\xB7","/","_"]){let o=`${t}${n}`;if(e.startsWith(o)&&e.length>o.length)return e.slice(o.length)}return bd(e,t)}function wd(i){switch(i){case"paused":return{title:b("picker.accessPausedTitle","These seats are on hold right now"),body:b("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:b("picker.accessRetry","Try again")};case"revoked":return{title:b("picker.accessRevokedTitle","This access link is no longer active"),body:b("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats."),action:b("picker.accessRefresh","Refresh")};case"idle":return{title:b("picker.idlePausedTitle","Your session expired"),body:b("picker.idlePausedBody","You were away for a while. Refresh to see which seats are free now."),action:b("picker.idleRefresh","Show latest seats")};case"no_token":case"provider_failed":return{title:b("picker.accessExpiredTitle","The seat map timed out"),body:b("picker.accessExpiredBody","Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now."),action:b("picker.accessRefresh","Refresh")};default:return{title:b("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:b("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest."),action:b("picker.accessRefresh","Refresh")}}}var xd=6;function As(i,e,t){let n=_n;return[i?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${i.sectionLabel.length>xd?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${b("picker.section","Section")}</span><span class="sl-confirm-value">${n(i.sectionLabel)}</span></div>`:"",i?.rowLabel||i?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${n(t)}</span><span class="sl-confirm-value">${n(q(i)??i?.displayLabel??e)}</span></div>`:"",i?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${b("picker.seat","Seat")}</span><span class="sl-confirm-value">${n(i?.seatNumber??i?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function Ps(i,e,t){let n=_n,o=i?.objectType==="booth",s=i?.objectType==="table"&&!!i?.bookingMode,r=o||s||!i?.seatNumber,a=i?.sectionLabel??(r?void 0:i?.displayLabel),l=s?`${b("picker.guests","Guests")} ${i?.bookingMode==="variable"?`${i?.minOccupancy}\u2013${i?.maxOccupancy}`:i?.capacity}`:void 0,d=(r?[l,a?i?.rowLabel??i?.displayLabel:void 0]:[i?.rowLabel?`${t} ${q(i)??""}`.trim():void 0,`${b("picker.seat","Seat")} ${i?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${n(a)}</span>`:"")+(d?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${n(d)}</span>`:"")+(a||d?"":`<span class="sl-confirm-pos">${n(e)}</span>`)}function Ls(i,e){if(!i)return"";let t=e?b("picker.viewFromThisSeat","View from this seat"):b("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-pill sl-confirm-3dpill" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function Ms(i,e){if(!i||e)return"";let t=b("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-3drow" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function xs(i){return i.buyerMessage?.trim()||(i.restriction==="companion"?b("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function Hi(i,e,t,n=()=>{}){let o=_n;if(i.length>1)return`<fieldset class="sl-confirm-tiers"><legend><span>${b("picker.ticketType","Ticket type")}</span></legend>`+i.map(a=>{let l=xs(a),c=n(a);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${o(a.id)}"${c?` data-offer-name="${o(c)}"`:""} aria-pressed="${a.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${o(a.name)}`+(c?`<span class="sl-confirm-tier-offer">${Li(c,o)}</span>`:"")+"</span>"+(l?`<small class="sl-confirm-tier-note">${o(l)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${o(t(a))}</span></button>`}).join("")+"</fieldset>";let s=i[0],r=s?xs(s):void 0;return r?`<p class="sl-confirm-tier-note">${o(r)}</p>`:""}function Hs(i){return'<div class="sl-confirm-grid">'+i.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${E(i.categoryLabel)}</span>`+(i.priceLabel?`<span class="sl-confirm-price">${E(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+i.marker+`<span class="sl-confirm-dot" style="background:${E(i.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${E(i.categoryLabel)}</span><span class="sl-confirm-who">`+i.identity+"</span>"+(i.priceLabel?`<span class="sl-confirm-idprice">${E(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+i.commercial+i.tierChoices+i.groupDates+i.wheelchair+(i.thumb||i.see3dPill?`<div class="sl-confirm-strip">${i.thumb}<span class="sl-confirm-pills">${i.see3dPill}</span></div>`:"")+i.inspect+'<div class="sl-confirm-row">'+(i.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${E(i.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${E(i.selectLabel)}</span></button></div></div>`}function Rs(i,e){let t=_,{variable:n}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(n?Xe("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):Xe("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(i.displayLabel??i.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(n?b("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):Xe("picker.allPlacesBookedTogether",{count:i.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t(Xe("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(b("picker.tableCapacity","Table capacity"))}</span><span>${t(Xe("picker.guestsCount",{count:i.capacity}))}</span>`+(i.entrance?`<span class="muted">${t(b("picker.entrance","Entrance"))}</span><span>${t(i.entrance)}</span>`:"")+(e.suppressPricing?"":`<span class="muted">${t(b("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(n?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(b("picker.numberOfGuests","Number of guests"))}</label><div class="sl-table-stepper" role="group" aria-labelledby="sl-table-qty-label"><button type="button" data-table-step="-1" aria-label="${t(b("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${i.quantity}</output><button type="button" data-table-step="1" aria-label="${t(b("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t(Xe("picker.chooseMinMaxGuests",{min:i.minOccupancy,max:i.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${i.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t(Xe("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?b("picker.updateTable","Update table"):n?b("picker.selectTable","Select table"):b("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function Is(i,e){let t=wd(i),n=document.createElement("div");n.className="sl-interrupt sl-access",n.setAttribute("role","status"),n.setAttribute("aria-live","polite");let o=document.createElement("div");o.className="sl-interrupt-card";let s=document.createElement("div");s.className="sl-interrupt-title",s.textContent=t.title;let r=document.createElement("div");r.className="sl-interrupt-body",r.textContent=t.body,o.append(s,r);let a=document.createElement("div");a.className="sl-interrupt-actions";let l=document.createElement("button");l.type="button",l.className="sl-interrupt-act";let c=document.createElement("span");c.className="sl-interrupt-act-icon",c.setAttribute("aria-hidden","true"),c.textContent="\u21BB";let d=document.createElement("span");return d.textContent=t.action,l.append(c,d),l.addEventListener("click",async()=>{n.classList.add("is-reloading"),l.disabled=!0;try{await e()}catch{}finally{n.isConnected&&(n.classList.remove("is-reloading"),l.disabled=!1)}}),a.appendChild(l),o.appendChild(a),n.appendChild(o),n}function Os(i,e){return`<div class="sl-a11yhead"><span class="sl-a11yhead-t">${E(i)}</span><button type="button" class="sl-a11yclose" data-a11y-close aria-label="${_(e)}"><svg viewBox="0 0 24 24" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function _s(i){return i.map(e=>{let t=`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${E(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${e.iconHtml}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${E(e.label)}</span></span>`+(e.count?`<span class="sl-a11yrow-c">${E(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>';return e.note?`<div class="sl-a11yrow-w">${t}${vt({id:`sl-info-${_(e.key.replace(/[^A-Za-z0-9]+/g,"-"))}`,label:e.note,text:E(e.note)})}</div>`:t}).join("")}function vt(i){return`<span class="sl-info"${i.wrapRef?` data-ref="${_(i.wrapRef)}"`:""}><button type="button" class="sl-info-btn" data-sl-info aria-label="${_(i.label)}" aria-describedby="${_(i.id)}" aria-expanded="false"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5"/><path d="M12 8h.01"/></svg></button><span class="sl-info-pop" role="tooltip" id="${_(i.id)}"${i.ref?` data-ref="${_(i.ref)}"`:""}>${i.text}</span></span>`}function Ds(i){let e=Math.max(0,i),t=Math.floor(e/6e4),n=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${n}`}function Bs(i){let e=i.performanceLabel?`<div class="sl-chip-when">${_(i.performanceLabel)}</div>`:"",t=i.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${_(i.performanceDates.summary)}</span><span class="sl-chip-date-list">${i.performanceDates.labels.map(n=>`<span class="sl-chip-date">${_(n)}</span>`).join("")}</span></div>`:"";return e+Sd(i)+t}function Sd(i){let{d:e,area:t,label:n,objectType:o,quantity:s=1,identity:r}=i,a=R=>String(R??"\u2014").replace(/[&<>"]/g,G=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[G]),l=o==="ga"?"ga":e?.objectType??o,c=r?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?b("picker.table","Table"):l==="booth"?b("picker.booth","Booth"):l==="ga"?b("picker.generalAdmission","General admission"):b("picker.row","Row")),d=r?.rowLabel??r?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??n,u=i.categoryLabel?.trim()??"",m="",p=[];l==="table"&&r?.bookingMode?(m=`${c} ${d}`,p.push([b("picker.guests","Guests"),String(s)])):l==="ga"?(m=String(t?.displayLabel??d),s>1&&p.push([b("picker.tickets","Tickets"),String(s)])):l==="booth"?(m=e?.sectionLabel??`${c} ${d}`,e?.sectionLabel&&p.push([c,String(d)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?m=String(d):(m=e.sectionLabel??"",e.rowLabel&&p.push([c,String(q(e)??e.rowLabel)]),e.seatNumber&&p.push([b("picker.seat","Seat"),String(e.seatNumber)]));let v=!m&&!!u,g=m||u||String(d),T=!!u&&!v&&u!==g,S=i.offerName?Pi(i.offerName,a):"",y=p.map(([R,G])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(R)}</span> <b>${a(G)}</b></span>`);T&&y.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(u)}</span>${S}</span>`);let P=[g,...p.map(([R,G])=>`${R} ${G}`),T?u:"",i.offerName??""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(P)}</span><span class="sl-chip-name" aria-hidden="true">${a(g)}${T?"":S}</span>`+(y.length?`<span class="sl-chip-pos" aria-hidden="true">${y.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function Fn(i,e,t){return i.map(n=>`<option value="${t(n.id)}"${n.id===e?" selected":""}>${t(n.name)}</option>`).join("")}function Td(i){let e=_;return` data-key="${e(i.key)}"`+(i.heldLabels.length?` data-held="${e(encodeURIComponent(i.heldLabels.join(`
2
- `)))}"`:"")+(i.seatIds.length?` data-seat="${e(i.seatIds.join(" "))}"`:"")+(i.locateId?` data-locate="${e(i.locateId)}"`:"")}function Fs(i){let e=_;return`<div class="sl-chip${i.held?" sl-held":""}${i.fresh?" sl-enter":""}"`+Td(i)+">"+(i.held?i.stateHtml:`<span class="sl-chip-dot" style="background:${E(i.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${i.identityHtml}`+(i.extrasHtml?`<div class="sl-chip-sub">${i.extrasHtml}</div>`:"")+`${i.noteHtml}</div>`+(i.amountText?`<span class="amt">${e(i.amountText)}</span>`:"")+i.railHtml+"</div>"}function Vn(i,e){let t=_(i),n=e?_(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${n}" aria-label="${_(Ns("picker.viewFromSeat",{label:e}))}"><svg viewBox="0 0 24 24"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"/><circle cx="12" cy="12" r="3"/></svg></button>`:"")+`<button type="button" class="rm" aria-label="${t}"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function Ri(i,e){return new Set(i.filter(t=>(e[t.key]??0)<=0).map(t=>t.key))}function Ii(i,e){let t=(i.doc?.categories??[]).filter(r=>!r.notForSale),n=e?t.filter(r=>r.key===e):t;if(!n.length)return null;let o=Ri(n,i.categoryAvailability());return o.size<n.length||(i.currentHold()?.items??[]).some(r=>o.has(r.categoryKey))?null:Object.assign(new Error("seatlayer: that ticket type is sold out"),{status:409,code:"sold_out",reason:"sold_out"})}function Vs(i){return i.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${b("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${Ns("picker.willFindSeatsTogether",{count:i.quantity})}</b><span>${b("picker.manualTicketsRemovedNote","Your manually selected tickets will be removed only after a new group is secured.")}</span></div><div class="sl-ba-actions"><button type="button" data-ba-cancel>${b("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${b("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="sl-ba-title-t">${b("picker.findSeatsTogether","Find seats together")}</span>`+vt({id:"sl-info-best-seats",label:b("picker.aboutBestSeats","About finding seats together"),text:b("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")})+(i.offerPremium?`<button type="button" class="sl-ba-premium${i.premium?" on":""}" data-ba-premium aria-pressed="${i.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${b("picker.bestSeatsPremium","Best seats")}</button>`:"")+`</div><div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${b("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${i.quantity}</span><button type="button" data-ba="1" aria-label="${b("picker.moreSeats","More seats")}">+</button></div>`+(i.categories.length>1?`<select class="sl-ba-cat" aria-label="${_(b("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${_(b("picker.anyTicketType","Any ticket type"))}</option>`+i.categories.map(e=>e.soldOut?`<option value="${_(e.key)}" disabled>${_(`${e.label} \xB7 ${b("picker.soldOutTitle","Sold out")}`)}</option>`:`<option value="${_(e.key)}"${i.selectedCategory===e.key?" selected":""}>${_(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(i.zones.length?`<select class="sl-ba-zone" aria-label="${b("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${b("picker.anyVenueZone","Any venue zone")}</option>`+i.zones.map(e=>`<option value="${_(e.id)}"${i.selectedZone===e.id?" selected":""}>${_(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${i.busy?" sl-busy":""}"${i.busy?" disabled":""}>`+(i.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${b("picker.findingBestSeats","Finding the best seats\u2026")}`:kd("picker.findBestSeatsCount",i.quantity))+"</button>"+(i.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${b("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function $s(i){return i==="setup"||i==="testable"?{heading:b("picker.salesNotOpenPill","Sales haven\u2019t opened yet"),sentence:b("picker.salesNotOpenCopy","Tickets for this event aren\u2019t on sale yet.")}:i==="paused"?{heading:b("picker.salesPausedPill","Sales are paused"),sentence:b("picker.salesPausedCopy","Ticket sales are paused for now.")}:{heading:b("picker.salesClosedPill","Sales are closed"),sentence:b("picker.salesClosedCopy","Ticket sales for this event have ended.")}}function zs(i,e=!1){if(!e&&(i==="setup"||i==="testable"||i==="paused")){let t=$s(i);return{pill:t.heading,cta:t.heading,toast:t.sentence}}return{pill:b("picker.salesClosedPill","Sales are closed"),cta:b("picker.salesClosedCta","Sales closed"),toast:b("picker.salesClosedToast","Sales are closed for this event.")}}function js(i){if(i.salesClosed&&!i.hasPicks){let e=i.whenText?`<span class="when">${_(i.whenText)}</span>`:"",t=i.note??$s(i.salesState);return`<div class="sl-closed-note" role="status"><b>${t.heading}</b><span>${t.sentence}${e}</span></div>`}return""}function Gs(i){return i.hasGaAreas?i.seated?i.venue3d?b("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue, or grab standing tickets below."):b("picker.trayHintTapOrStanding","Tap a seat on the map or grab standing tickets below."):i.venue3d?b("picker.gaTrayHintChoose3dArea","Choose an area in the 3D venue to select tickets."):b("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets."):i.groupMode==="per_performance"?b("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):i.groupMode?b("picker.groupTrayHint","Choose seats once. The same seats will be held for every performance."):i.venue3d?b("picker.trayHintChoose3dOrBest","Choose a seat in the 3D venue, or let us pick the best available for you."):b("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}import{getLocale as Ld,loadLocale as Md,LOCALE_NAMES as Hd,localeDirection as qs,resolveLocale as Ws,setStringOverrides as Rd,TRANSLATED_LOCALES as Id}from"@seatlayer/core";import{getLocale as Ed,localeDirection as Cd,t as Ad}from"@seatlayer/core";function Pd(){return`<svg class="sl-boot-venue" viewBox="0 0 200 140" preserveAspectRatio="xMidYMid meet" aria-hidden="true" focusable="false"><g class="sl-boot-shells">${["M20 92a80 52 0 0 1 160 0v14a94 62 0 0 0-160 0z","M32 74a68 42 0 0 1 136 0v12a80 50 0 0 0-136 0z","M46 58a54 32 0 0 1 108 0v10a64 38 0 0 0-108 0z"].map(e=>`<path d="${e}" />`).join("")}</g><rect class="sl-boot-stage" x="62" y="16" width="76" height="16" rx="4" /></svg>`}function Ks(i,e,t){let n=document.createElement("div");n.className="sl-picker",n.tabIndex=-1,n.lang=Ed(),n.dir=Cd(),i.appendChild(n),Object.entries(yt(void 0,t)).forEach(([s,r])=>n.style.setProperty(s,r)),n.innerHTML=`
1
+ import{a as Vs,b as $s}from"./chunk-JDMJI3WC.js";import{a as Ds}from"./chunk-ICMSBXRJ.js";import{a as Bs,b as Fs,d as Qn,e as _t,f as Jn,g as He}from"./chunk-3FEGZ5HA.js";import{a as p,b as E,c as k,d as w,e as Ns}from"./chunk-7I563G2N.js";import{PickerController as Kh,formatMoney as Vi,getLocale as Aa,loadLocale as Gh,localeDirection as Uh,LOCALE_NAMES as qh,resolveLocale as Wh,seatPriceEntry as Yh,setStringOverrides as Zh,t as Zt}from"@seatlayer/core";var Jd=/^[0-9A-Za-z.+-]{1,24}$/,ep=Jd.test("0.110.0")?"0.110.0":"",tp={host:"web",platform:"web",bundle:ep,protocol:0,chromeOwner:"web"},np={...tp},ei=null,zs=null;function ip(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function op(){let n=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:n(ip()),documentMs:ei==null?0:n(ei),handshakeMs:ei==null||zs==null?0:n(zs-ei)}}function js(){let{host:n,platform:e,bundle:t,protocol:i,chromeOwner:o}=np,s=op();return{host:n,platform:e,...t?{bundle:t}:{},...i?{protocol:i}:{},chromeOwner:o,bootMs:s.bootMs,documentMs:s.documentMs,handshakeMs:s.handshakeMs}}var Ks=new Set,Gs=new Map;function Re(n){return Ks.has(n)?"repeat":"cold"}function ti(n){let e=Re(n);return Ks.add(n),e}function he(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0?Math.round(n):0}function yn(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function sp(n){if(!/^[A-Za-z0-9_-]{1,80}$/.test(n.event))return null;let e=n.performanceProfile??{};return{event:n.event,scope:n.scope,surface:n.surface,outcome:n.outcome,stage:n.stage?.slice(0,32)??"",ms:he(n.ms),api:he(e.loadChartAndStatuses)||he(e.loadChart),scene:he(e.buildScene),panel:he(e.buildBuyerControls),paint:he(e.firstPaint),normalize:he(e.normalizeBuyerModel),renderer:he(e.createRenderer),seats:he(n.seats),floors:he(n.floors),view:n.view??"map",load:n.load??Re(n.event),transport:n.transport??"pubapi",...js(),availabilityMs:he(e.loadStatuses),...typeof n.revealWaitMs=="number"?{revealWaitMs:he(n.revealWaitMs)}:{},...typeof n.handoverMs=="number"?{handoverMs:he(n.handoverMs)}:{},mounts:(Gs.get(n.event)??0)+1,reconnects:he(n.reconnects)}}var rp=new Set;function Ee(n){let e=sp(n);if(e){Gs.set(n.event,e.mounts);for(let t of rp)try{t(e)}catch{}typeof fetch>"u"||yn()||fetch(`${n.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}var ap="realtime.fallback_polling",Us=new Set;function lp(n){let e=/^(wss?):\/\/([^/]+)(.*?)\/pub\/events\/([^/?#]+)\/subscribe(?:[?#]|$)/.exec(n);if(!e)return null;let t;try{t=decodeURIComponent(e[4])}catch{return null}return/^[A-Za-z0-9_-]{1,80}$/.test(t)?{apiBase:`${e[1]==="wss"?"https":"http"}://${e[2]}${e[3]}`,eventKey:t}:null}function qs(n){let e=lp(n);return!e||Us.has(e.eventKey)||(Us.add(e.eventKey),typeof fetch>"u"||yn())?!1:(fetch(`${e.apiBase}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:ap,eventKey:e.eventKey}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0)}var dt="seatlayer.v1",Ws="\0",Ys=4401,cp=15e3,dp=25e3,pp=1e4,Zs=5e3,hp=JSON.stringify({type:"resume"}),up=3e4,mp=6e4,fp=["pointermove","touchstart","keydown"],gp=3,bp=15e3,Xs=6e4;function yp(n){let e=typeof n.default=="string"?n.default:"free",t={};if(n.seats&&typeof n.seats=="object")for(let[i,o]of Object.entries(n.seats))typeof o=="string"&&o!==e&&(t[i]=o);return{default:e,exceptions:t}}function vp(n,e){if(!n||n.default!==e.default)return null;let t=[];for(let[i,o]of Object.entries(e.exceptions))n.exceptions[i]!==o&&t.push({label:i,status:o});for(let i of Object.keys(n.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function wp(n,e){for(let t of e)t.status===n.default?delete n.exceptions[t.label]:n.exceptions[t.label]=t.status}function Qs(n){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var Ie=class{constructor(e){this.ws=null;this.watched=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.failedUpgrades=0;this.pollTimer=null;this.fellBack=!1;this.lastWake=-1/0;this.lastInput=0;this.detachWake=null;this.reconnectCount=0;this.opts=e,typeof e.url=="string"&&Qs(e.url)}get polling(){return this.pollTimer!==null}get protocol(){return this.ws?this.v1?"v1":"legacy":null}get snapshotVersion(){return this.version}start(){this.stopped&&(this.stopped=!1,this.attachWake(),this.connect())}stop(){this.stopped=!0,this.clearTimers(),this.stopPolling(),this.detachWake?.(),this.detachWake=null;let e=this.ws;if(this.ws=null,e){e.onopen=null,e.onmessage=null,e.onclose=null,e.onerror=null;try{e.close()}catch{}}}restart(){this.stop(),this.projection=null,this.version=null,this.attempt=0,this.failedUpgrades=0,this.start()}async connect(){if(this.stopped)return;let e=[dt];if(this.opts.mintTicket){let a;try{a=await this.opts.mintTicket()}catch(l){this.reportIfAccessError(l),this.scheduleReconnect();return}if(this.stopped)return;a?.protocols?.length?(e=[...a.protocols],e.includes(dt)||e.unshift(dt)):a?.ticket&&(e=[dt,`tkt.${a.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let i=typeof this.opts.url=="function"?this.opts.url():this.opts.url,o=this.useQueryMarker?`${i}${i.includes("?")?"&":"?"}pv=1`:i;Qs(o);let s;try{s=(this.opts.socketFactory??((l,c)=>new WebSocket(l,c)))(o,e)}catch{this.upgradeFailed(),this.scheduleReconnect();return}this.ws=s;let r=!1;s.onopen=()=>{this.ws===s&&(r=!0,this.attempt=0,this.failedUpgrades=0,this.stopPolling(),this.v1=s.protocol===dt,this.v1||(this.useQueryMarker=!0),this.startKeepalive(s),this.watched=null,this.watchHold(this.opts.heldHoldId?.()??null),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},Zs):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},Zs))},s.onmessage=a=>{if(this.ws!==s)return;let l;try{l=JSON.parse(typeof a.data=="string"?a.data:"")}catch{return}!l||typeof l!="object"||this.handleFrame(l)},s.onclose=a=>{if(this.ws===s){if(this.ws=null,this.clearTimers(),!r&&a?.code!==Ys&&this.upgradeFailed(),a?.code===Ys){if(a.reason==="access_expired"){this.scheduleReconnect();return}if(a.reason==="idle_expired"&&this.opts.onIdleExpired){this.stopped=!0,this.stopPolling(),this.opts.onIdleExpired();return}this.stopped=!0,this.stopPolling(),this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},s.onerror=()=>{try{s.close()}catch{}}}watchHold(e){let t=this.ws;if(!(!e||e===this.watched||!t||t.readyState!==1))try{t.send(JSON.stringify({type:"watch",holdId:e})),this.watched=e}catch{}}handleFrame(e){let t=typeof e.type=="string"?e.type:"";if(e.protocol===1&&(this.v1=!0),typeof e.snapshotVersion=="number"&&(this.version=e.snapshotVersion),t==="pong"){this.clearPongTimer();return}if(t==="sales"){this.opts.sink.onSales?.(e);return}if(Array.isArray(e.hidden)||Array.isArray(e.closed)){let i=Array.isArray(e.hidden)?e.hidden:[],o=Array.isArray(e.closed)?e.closed:[],s=i.join(Ws),r=o.join(Ws);(s!==this.hidden||r!==this.closedSections)&&(this.hidden=s,this.closedSections=r,this.opts.sink.onSections?.(i,o,{withInventory:t==="snapshot"||!!e.seats}))}if(t!=="hidden"){if(t==="hold"){typeof e.holdId=="string"&&typeof e.state=="string"&&this.opts.onHoldState?.(e.holdId,e.state);return}if(t==="presence"){this.opts.sink.onPresence?.({shoppingSessions:Number(e.shoppingSessions)||0,activeHolds:Number(e.activeHolds)||0});return}if(t!=="allocation"){if(t==="snapshot"||!t&&e.seats){this.answered();let i=yp(e),o=vp(this.projection,i);this.projection=i,o===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():o.length&&this.opts.sink.applyStatuses(o);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(o=>typeof o?.label=="string"&&typeof o?.status=="string").map(o=>({label:o.label,status:o.status}));if(!i.length)return;this.projection&&wp(this.projection,i),this.opts.sink.applyStatuses(i)}}}}answered(){this.resumeTimer&&(clearTimeout(this.resumeTimer),this.resumeTimer=null)}reportIfAccessError(e){let t=e?.reason;e?.name==="BuyerAccessUnavailableError"&&(this.stopped=!0,this.stopPolling(),this.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}upgradeFailed(){this.failedUpgrades+=1,this.failedUpgrades>=gp&&this.startPolling()}startPolling(){if(!(this.pollTimer||this.stopped)){if(!this.fellBack){this.fellBack=!0;try{this.opts.onFallbackPolling?.()}catch{}let e=typeof this.opts.url=="function"?this.opts.url():this.opts.url;qs(e)}this.pollTimer=setInterval(()=>{if(this.stopped){this.stopPolling();return}typeof document<"u"&&document.hidden||Promise.resolve().then(()=>this.opts.poll?this.opts.poll():this.opts.sink.resync({reason:"frame"})).catch(()=>{})},bp)}}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}now(){return this.opts.now?this.opts.now():Date.now()}attachWake(){if(this.detachWake||typeof document>"u"||typeof window>"u"||typeof document.addEventListener!="function"||typeof window.addEventListener!="function")return;this.lastInput=this.now();let e=()=>{document.visibilityState==="visible"&&this.wake()},t=()=>{let s=this.now(),r=s-this.lastInput>=mp;this.lastInput=s,r&&this.wake()},i={capture:!0,passive:!0},o=s=>{document[s]("visibilitychange",e),window[s]("focus",e);for(let r of fp)document[s](r,t,i)};o("addEventListener"),this.detachWake=()=>o("removeEventListener")}wake(){let e=this.ws;if(!e||e.readyState!==1)return;let t=this.now();if(!(t-this.lastWake<up)){try{e.send(hp)}catch{return}this.lastWake=t}}startKeepalive(e){this.pingTimer=setInterval(()=>{if(this.ws===e){try{e.send(JSON.stringify({type:"ping"}))}catch{return}this.clearPongTimer(),this.pongTimer=setTimeout(()=>{this.pongTimer=null;try{e.close()}catch{}},pp)}},dp)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,cp),i=this.pollTimer?Xs/2+Math.random()*Xs/2:Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.reconnectCount+=1,this.connect()},i)}get reconnects(){return this.reconnectCount}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 xp(n){return n==="blocked"?"not_for_sale":n==="unavailable"?"held":n==="held"||n==="booked"||n==="free"||n==="not_for_sale"?n:"free"}var kp="#f43f5e";function vn(n,e={}){let t=i=>{let o=n.tableSelection(i);if(o)return o.physicalSeatIds;let s=n.idForLabel(i);return s?[s]:[]};return{applyStatuses(i){let o=new Set([...n.currentHold()?.labels??[],...e.ownLabels?.()??[]]),s={free:[],held:[],booked:[],not_for_sale:[]},r=[],a=[],l=new Map(n.getSelection().map(c=>[c.label,c.id]));for(let c of i){let d=t(c.label);if(!d.length)continue;let h=xp(c.status);if(s[h].push(...d),e.flashOnLiveChange&&h!=="free"&&!o.has(c.label)&&d.some(m=>n.getStatus(m)==="free"))for(let m of d)r.push({id:m,color:kp});h!=="free"&&!o.has(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])s[c].length&&n.setStatus(s[c],c);for(let c of r)n.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(h=>t(h));c.length&&n.deselect(c);let d=i.some(h=>h.status==="blocked"&&a.includes(h.label));e.onSelectedObjectUnavailable?.(a,d?"ineligible":"taken")}e.onStatusChange?.()},...n.applyProjection?{applyProjection:i=>{n.applyProjection(i)}}:{},async resync(i){await(n.resync?n.resync(i):n.refresh())},onSections(i,o,s){s?.withInventory||(n.resync?n.resync({reason:"frame"}):n.refresh()),e.onSections?.(i,o,s)}}}var pt="pricingContract=matrix-v1&pricingContract=seat-v1",j=class extends Error{constructor(e,t,i,o,s,r,a,l){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=o,this.reason=s,this.retryAfterS=r,this.notice=a,l?.fields&&(this.fields=l.fields),typeof l?.retryable=="boolean"&&(this.retryable=l.retryable),l?.hint&&(this.hint=l.hint),l?.serverMessage&&(this.serverMessage=l.serverMessage)}},Js=10,er=1;function wn(n,e){let t=(n??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let o=Date.parse(t);if(Number.isFinite(o))return Math.max(0,Math.ceil((o-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}function Sp(n){let e=n;return!!e&&typeof e.ticketKey=="string"&&typeof e.label=="string"&&Number.isFinite(e.unitIndex)&&Number.isFinite(e.quantity)&&(e.displayLabel===void 0||typeof e.displayLabel=="string")}var Tp={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"};function Ep(){return typeof crypto>"u"?null:typeof crypto.randomUUID=="function"?crypto.randomUUID():typeof crypto.getRandomValues!="function"?null:Array.from(crypto.getRandomValues(new Uint8Array(18)),n=>n.toString(16).padStart(2,"0")).join("")}function Cp(n,e){let t=e.map(i=>[i.label,i.tierId??null,i.quantity??null]).sort((i,o)=>i[0]<o[0]?-1:i[0]>o[0]?1:0);return JSON.stringify([n,t])}function Ap(n){return n instanceof j?n.status===408||n.status===429||n.status>=500:!0}function tr(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}var Ue=class{constructor(e,t={}){this.base=e;this.viewerId=tr();this.holdAttempt=null;this.holdIdempotency=!0;this.ticketKeysByHold=new Map;this.access=t.access,this.onObjectUnavailable=t.onObjectUnavailable;let i=t.referral?.trim();this.referral=i?i.slice(0,120):void 0}rotateViewerId(){this.viewerId=tr()}async pickerIdleMinutes(){return null}get accessScoped(){return!!this.access?.configured}async request(e,t={},i={}){let o=t.method??"GET",s={},r;t.body!==void 0&&(s["Content-Type"]="application/json",r=JSON.stringify(t.body));let a=await this.access?.authorization(i.auth?"unauthorized":"initial");if(a&&(s.Authorization=a),t.idempotency){let m=this.holdAttemptKey(`${t.idempotency.binding}\0${a??""}`);t.idempotency.used(m??void 0),m&&(s["Idempotency-Key"]=m)}let l=o==="GET"||e.endsWith("/hold/resume")?new AbortController:null,c=l?setTimeout(()=>l.abort(),4e4):null,d,h;try{d=await fetch(`${this.base}${e}`,{method:o,headers:s,body:r,credentials:"omit",...l?{signal:l.signal}:{}}),h=(d.headers.get("content-type")??"").includes("application/json")?await d.json().catch(u=>{if(l?.signal.aborted)throw u;return null}):null}finally{c!==null&&clearTimeout(c)}if(!d.ok){let m=h,u=m?.code??m?.error,g=d.status===401&&u==="buyer_access_invalid"&&e.endsWith("/hold/resume");if(this.access?.configured&&!g&&(d.status===401||d.status===403||d.status===422)&&await this.access.handleFailure(d.status,u)&&!i.auth)return this.request(e,t,{...i,auth:!0});if(d.status===409){let T=u?Tp[u]:void 0,S=m?.conflicts?.map(x=>x.label)??t.labels??[];T&&this.onObjectUnavailable?.({labels:S,reason:T,code:u})}let b;if(d.status===429&&(b=wn(d.headers.get("Retry-After"),m?.retryAfterSeconds)??er,o==="GET"&&!i.rateLimit&&b<=Js))return await new Promise(T=>setTimeout(T,b*1e3)),this.request(e,t,{...i,rateLimit:!0});throw d.status===503&&(b=wn(d.headers.get("Retry-After"),m?.retryAfterSeconds)),new j(d.status,m?.error??`request_failed_${d.status}`,u,m?.conflicts,m?.reason,b,typeof m?.notice=="string"&&m.notice?m.notice:void 0,{...Array.isArray(m?.fields)?{fields:m.fields}:{},...typeof m?.retryable=="boolean"?{retryable:m.retryable}:{},...typeof m?.hint=="string"&&m.hint?{hint:m.hint}:{},...typeof m?.message=="string"&&m.message?{serverMessage:m.message}:{}})}return h}async requestBlob(e,t={}){let i={},o=await this.access?.authorization(t.auth?"unauthorized":"initial");o&&(i.Authorization=o);let s=await fetch(`${this.base}${e}`,{method:"GET",headers:i,credentials:"omit"});if(s.ok)return s.blob();let a=(s.headers.get("content-type")??"").includes("application/json")?await s.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(s.status===401||s.status===403||s.status===422)&&await this.access.handleFailure(s.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(s.status===429&&(c=wn(s.headers.get("Retry-After"),a?.retryAfterSeconds)??er,!t.rateLimit&&c<=Js))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new j(s.status,a?.error??`request_failed_${s.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new j(404,"not_found","not_found"))}async objects(e){return{...await this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1&${pt}`),fetchedAt:Date.now()}}hold(e,t,i,o){let s=`/pub/events/${encodeURIComponent(e)}/hold?${pt}`,r={method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...o?{replaceHoldId:o}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(l=>l.label)};return(o||!this.holdIdempotency?this.request(s,r):this.keyedHold(s,r,Cp(e,t))).then(l=>this.noteTicketKeys(l,o))}holdAttemptKey(e){if(this.holdAttempt?.binding===e)return this.holdAttempt.key;let t=Ep();return this.holdAttempt=t?{binding:e,key:t}:null,t}endHoldAttempt(e){e&&this.holdAttempt?.key===e&&(this.holdAttempt=null)}async keyedHold(e,t,i,o=!1){let s;try{let r=await this.request(e,{...t,idempotency:{binding:i,used:a=>{s=a}}});return this.endHoldAttempt(s),r}catch(r){if(Ap(r))throw r;this.endHoldAttempt(s);let a=r.code;if(a==="idempotency_key_reused"&&!o)return this.keyedHold(e,t,i,!0);if(a==="invalid_idempotency_key")return this.holdIdempotency=!1,this.request(e,t);throw r}}noteTicketKeys(e,t){if(t&&this.ticketKeysByHold.delete(t),!e?.holdId)return e;let i=Array.isArray(e.ticketKeys)&&e.ticketKeys.every(s=>typeof s=="string")?[...e.ticketKeys]:null,o=Array.isArray(e.ticketKeyDetails)&&e.ticketKeyDetails.every(Sp)?e.ticketKeyDetails.map(({ticketKey:s,label:r,unitIndex:a,quantity:l,displayLabel:c})=>({ticketKey:s,label:r,unitIndex:a,quantity:l,...c?{displayLabel:c}:{}})):null;return i||o?this.ticketKeysByHold.set(e.holdId,{...i?{ticketKeys:i}:{},...o?{ticketKeyDetails:o}:{}}):this.ticketKeysByHold.delete(e.holdId),e}ticketKeysFor(e){let t=this.ticketKeysByHold.get(e);return t?{...t}:null}bestAvailable(e,t,i,o,s){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available?${pt}`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...o?{zoneId:o}:{},...s?{ttlMs:s}:{},...this.referral?{referral:this.referral}:{}}}).then(r=>this.noteTicketKeys(r))}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}}).then(i=>this.noteTicketKeys(i))}release(e,t,i){return this.holdAttempt=null,this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:i}}).then(o=>{let s=this.ticketKeysByHold.get(i);if(s){let r=new Set(o?.released??t);this.ticketKeysByHold.set(i,{...s.ticketKeys?{ticketKeys:s.ticketKeys.filter(a=>!r.has(a))}:{},...s.ticketKeyDetails?{ticketKeyDetails:s.ticketKeyDetails.filter(a=>!r.has(a.ticketKey))}:{}})}return o})}extend(e,t,i){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...i?{ttlMs:i}:{}}})}paymentOptions(e){return this.request(`/pub/events/${encodeURIComponent(e)}/payment-options`)}availability(e,t=!1){return this.request(`/pub/events/${encodeURIComponent(e)}/availability?${pt}${t?"&live=1":""}`)}startCheckout(e,t){return this.holdAttempt=null,this.request(`/pub/events/${encodeURIComponent(e)}/checkout`,{method:"POST",body:t})}orderStatus(e){return this.request(`/pub/orders/${encodeURIComponent(e)}/status`)}subscribeTicket(e){return this.request(`/pub/events/${encodeURIComponent(e)}/subscribe-tickets`,{method:"POST",body:{}})}subscribeUrl(e){let t=this.base.replace(/^http/,"ws"),i=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${i}&${pt}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[dt]}createRealtime(e,t){return this.accessScoped?null:new Ie({url:this.subscribeUrl(e),sink:t})}};import{t as Sn,tCount as Fp}from"@seatlayer/core";import{compactRowLabel as Op,seatNoteRowModel as _p,seatTypeIconSvg as mr,t as qe}from"@seatlayer/core";import{seatConfidenceDisclosure as Np}from"@seatlayer/core/core/seatConfidence";import{t as ir}from"@seatlayer/core";import{cdnAssetUrl as lg,importCdnAsset as ni}from"@seatlayer/core/core/cdnAsset";var Pp=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Lp=/[\s"'<>`\\]/;function Mp(n){return n.startsWith("//")?!1:n.startsWith("/")||n.startsWith("./")||n.startsWith("../")}function Hp(){try{let n=typeof location>"u"?"":location.origin;return n&&n!=="null"?n:null}catch{return null}}function Nt(n){if(typeof n!="string"||!n||n.length>2e6||n!==n.trim())return!1;if(n.startsWith("data:"))return Pp.test(n);if(Lp.test(n))return!1;let e=Hp();if(Mp(n)){if(!e)return!1;try{let t=new URL(n,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(n);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}import{SEATLAYER_MODULE_URL as hg}from"@seatlayer/core/core/cdnAsset";function y(n,e){let t=ir(n);return t===n?e:t}function ht(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?y("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):y("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function ii(){return{rotate:y("picker.dragToRotateVenue","Drag to rotate the venue"),move:y("picker.dragToMoveVenue","Drag to move the venue"),zoomIn:y("picker.zoomIn","Zoom in"),zoomOut:y("picker.zoomOut","Zoom out"),fitView:y("picker.fitWholeVenue","Show whole venue")}}function or(n,e){let t=e?n.toLocaleUpperCase(e):n.toLocaleUpperCase(),i=e?n.toLocaleLowerCase(e):n.toLocaleLowerCase();if(n!==t||t===i)return n;let o=[...i][0]??"";return(e?o.toLocaleUpperCase(e):o.toLocaleUpperCase())+i.slice(o.length)}function sr(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}function B(n){return String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function oi(n,e,t){let i=e.find(s=>Nt(s))??null;if(n.replaceChildren(),!i)return n.textContent=t.slice(0,1).toUpperCase(),null;let o=document.createElement("img");return o.alt="",o.referrerPolicy="no-referrer",o.src=i,n.appendChild(o),i}var Dt=null;function si(){if(Dt!==null)return Dt;try{if(typeof document>"u")return Dt=!1;Dt=!!document.createElement("canvas").getContext("webgl2")}catch{Dt=!1}return Dt}var xn=null;function kn(){return xn||(xn=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?ni("seatlayer-view3d.mjs"):import("@seatlayer/core/view3d")).catch(e=>{throw xn=null,e}),xn)}function ri(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||kn().catch(()=>{})}async function ai(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?ni("seatlayer-panorama.mjs"):import("@seatlayer/core")}async function Bt(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?ni("seatlayer-checkout.mjs"):import("./hostedCheckout-NA3IEXE4.js")}async function rr(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?ni("seatlayer-sales.mjs"):import("./pickerSalesClose-2APTQFVA.js")}function ar(n){return n==="unavailable_for_event"||n==="payments_off_for_event"?n:"not_configured"}function lr(n){return n.lineItems.reduce((e,t)=>e+t.quantity,0)}function xo(n,e){if(n.objectType!=="ga")return n.displayLabel??n.label;let t=e.find(i=>i.id===n.objectId);return n.displayLabel??t?.displayLabel??t?.label??y("picker.generalAdmission","General admission")}function Rp(n,e){let t=new Map;for(let i of n){let o=i.rowLabel&&i.seatNumber?[i.sectionLabel,`${y("picker.row","Row")} ${i.rowLabel}`,`${y("picker.seat","Seat")} ${i.seatNumber}`].filter(Boolean).join(" \xB7 "):xo(i,e),s=[i.categoryLabel,i.tierLabel].filter(Boolean).join(" \xB7 "),r=Math.max(1,Math.floor(i.quantity||1)),a=`${o}\0${s}`,l=t.get(a)??{label:o,detail:s,units:0,amount:0};l.units+=r,l.amount+=i.unitPrice*r,t.set(a,l)}return[...t.values()].map(i=>({label:i.units>1?`${i.label} \xD7${i.units}`:i.label,...i.detail?{detail:i.detail}:{},amount:i.amount}))}var nr=(n,e,t)=>ir("picker.bookingForm.guestOfCount",{label:n,index:e,total:t});function Ip(n,e,t=[]){let i=new Map,o=[];for(let d of n.lineItems){let h=xo(d,t),m=Math.max(1,Math.floor(d.quantity)||1);if(d.objectType!=="ga"&&!(d.objectType==="table"&&m>1)){o.push({key:d.label,name:h,unitIndex:1,quantity:1});continue}for(let u=1;u<=m;u+=1){let g=(i.get(d.label)??0)+1;i.set(d.label,g),o.push({key:`${d.label}#${g}`,name:h,unitIndex:u,quantity:m})}}let s=e?.ticketKeyDetails??[],r=e?.ticketKeys??s.map(d=>d.ticketKey),a=(r.length===o.length?r:o.map(d=>d.key)).map(d=>{let h=o.find(u=>u.key===d),m=s.find(u=>u.ticketKey===d);return{key:d,name:m?.displayLabel??h?.name,unitIndex:m?.unitIndex??h?.unitIndex??1,quantity:m?.quantity??h?.quantity??1}}),l=new Map;for(let d of a)d.name&&d.quantity<=1&&l.set(d.name,(l.get(d.name)??0)+1);let c=new Map;return a.map(({key:d,name:h,unitIndex:m,quantity:u})=>{if(!h)return{key:d};if(u>1)return{key:d,title:nr(h,m,u)};let g=(c.get(h)??0)+1;c.set(h,g);let b=l.get(h)??1;return{key:d,title:b>1?nr(h,g,b):h}})}function cr(n,e,t,i,o=[]){let s=new Map;for(let r of n.lineItems){let a=xo(r,o);s.set(a,(s.get(a)??0)+1)}return{kind:"pay",provider:e,order:{holdId:n.holdId,expiresAt:n.expiresAt,currency:n.currency,total:n.total,labels:[...s].map(([r,a])=>a>1?`${r} \xD7${a}`:r),tickets:Ip(n,i,o),lines:Rp(n.lineItems,o)},bookingForm:t?.bookingForm??null,...t?.bookingMode==="free"?{free:!0}:{}}}function dr(n){return String(n?.code).startsWith("booking_form_")}function li(n,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},o=new Date(n);if(e)try{return o.toLocaleString(t,{...i,timeZone:e})}catch{}return o.toLocaleString(t,i)}function ko(n){return/early[\s-]*bird/i.test(n?.trim()??"")}function pr(n){return ko(n)?'<svg class="sl-offer-icon sl-offer-icon-discount" viewBox="0 0 32 32" aria-hidden="true"><defs><linearGradient id="sl-offer-discount-gradient" x1="29.492" y1="0" x2="20.028" y2="36.183" gradientUnits="userSpaceOnUse"><stop stop-color="#FD6D00"/><stop offset="1" stop-color="#F8B302"/></linearGradient></defs><path d="M16 22.751a1.071 1.071 0 1 0 0-2.142 1.071 1.071 0 0 0 0 2.142ZM16 11.39a1.071 1.071 0 1 0 0-2.141 1.071 1.071 0 0 0 0 2.141Z" fill="url(#sl-offer-discount-gradient)"/><path d="M31.137.863A2.928 2.928 0 0 0 29.054 0H17.836c-.787 0-1.527.307-2.083.863L.863 15.753A2.93 2.93 0 0 0 0 17.836c0 .787.307 1.527.863 2.083l11.218 11.218A2.927 2.927 0 0 0 14.164 32c.787 0 1.527-.307 2.083-.863l14.89-14.89A2.928 2.928 0 0 0 32 14.164V2.946c0-.788-.307-1.527-.863-2.083ZM16 7.374a2.946 2.946 0 1 1 0 5.891 2.946 2.946 0 0 1 0-5.891Zm0 17.252a2.946 2.946 0 1 1 0-5.891 2.946 2.946 0 0 1 0 5.891Zm6.025-7.689H9.975a.938.938 0 0 1 0-1.875h12.05a.938.938 0 0 1 0 1.875Zm4.017-10.041a.938.938 0 1 1 0-1.875.938.938 0 0 1 0 1.875Z" fill="url(#sl-offer-discount-gradient)"/></svg>':'<svg class="sl-offer-icon sl-offer-icon-tag" viewBox="0 0 24 24" aria-hidden="true"><path d="M20.6 13.6 13.7 20.5a2 2 0 0 1-2.8 0L3.5 13.1A2 2 0 0 1 3 11.7V4h7.7a2 2 0 0 1 1.4.6l8.5 8.5a.7.7 0 0 1 0 .5Z"/><circle cx="7.5" cy="8.5" r="1"/></svg>'}function ci(n,e){return`<span class="sl-offer-mark" role="img" aria-label="${e(n)}" title="${e(n)}">${pr(n)}</span>`}function di(n,e){return`<span class="sl-offer-badge">${pr(n)}<span>${e(n)}</span></span>`}function hr(n,e=Date.now()){let t=n-e;if(t<=0)return null;let i=Math.max(1,Math.ceil(t/6e4)),o=Math.floor(i/1440),s=Math.floor(i%1440/60),r=i%60;return`${(o>0?[`${o}d`,...s?[`${s}h`]:[]]:[...s?[`${s}h`]:[],...r||!s?[`${r}m`]:[]]).join(" ")} left`}function So(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function C(n){return String(n??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function To(n){return n?_p(n).map(e=>({...e,title:y(e.titleKey,e.titleFallback)})):[]}function fr(n){return To(n).map(e=>e.title)}function ut(n,e={}){return Eo(To(n),e)}function Eo(n,e={}){if(!n.length)return"";let t=e.compact?15:17,i=n.map(o=>`<div class="sl-note sl-note-${C(o.tone)}"><span class="sl-note-i">${mr(o.icon,{size:t})}</span><span class="sl-note-t"><b>${C(o.title)}</b>`+(o.note?`<span class="sl-note-n">${C(o.note)}</span>`:"")+"</span></div>").join("");return`<div class="sl-notes${e.compact?" compact":""}">${i}</div>`}function gr(n){return To(n).map(e=>{let t=C(e.note?`${e.title}: ${e.note}`:e.title);return`<span class="sl-cx-mark sl-cx-mark-${C(e.tone)}" role="img" aria-label="${t}" title="${t}">${mr(e.icon,{size:13})}</span>`}).join("")}function pi(n){let e=[];return n?.restrictedView&&e.push(y("picker.restrictedView","Restricted view")),n?.obstructedView&&e.push(y("picker.obstructedView","Obstructed view")),e}function Co(n,e){if(!n)return"";let t=e?y("picker.viewFromThisSeat","View from this seat"):y("picker.seeItIn3d","See it in 3D"),i=e?y("picker.viewFromHere","View from here"):t;return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${i}</span></button>`}function br(n,e){if(!e)return"";let t=e,i=t.includes(n.id),o=i?t.length>1?y("picker.openComparison","Open comparison"):y("picker.savedForComparison","Saved for comparison"):t.length?y("picker.compareWithSaved","Compare with saved"):y("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${i&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${C(o)}</span></button>`}function yr(n,e,t){if(!t)return"";let i=Np(n.confidenceEvidence),o=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${C(n.displayLabel??n.label)}"><span><em>${C(e)}</em><strong>${C(i.headline)}</strong><small>${C(o)}</small></span><b>Passport</b></button>`}function Q(n){let e=n?.rowLabel,t=n?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let o=`${t}${i}`;if(e.startsWith(o)&&e.length>o.length)return e.slice(o.length)}return Op(e,t)}function Dp(n){switch(n){case"paused":return{title:y("picker.accessPausedTitle","These seats are on hold right now"),body:y("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:y("picker.accessRetry","Try again")};case"revoked":return{title:y("picker.accessRevokedTitle","This access link is no longer active"),body:y("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats."),action:y("picker.accessRefresh","Refresh")};case"idle":return{title:y("picker.idlePausedTitle","Your session expired"),body:y("picker.idlePausedBody","You were away for a while. Refresh to see which seats are free now."),action:y("picker.idleRefresh","Show latest seats")};case"no_token":case"provider_failed":return{title:y("picker.accessExpiredTitle","The seat map timed out"),body:y("picker.accessExpiredBody","Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now."),action:y("picker.accessRefresh","Refresh")};default:return{title:y("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:y("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest."),action:y("picker.accessRefresh","Refresh")}}}var Bp=6;function vr(n,e,t){let i=So;return[n?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${n.sectionLabel.length>Bp?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${y("picker.section","Section")}</span><span class="sl-confirm-value">${i(n.sectionLabel)}</span></div>`:"",n?.rowLabel||n?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${i(t)}</span><span class="sl-confirm-value">${i(Q(n)??n?.displayLabel??e)}</span></div>`:"",n?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${y("picker.seat","Seat")}</span><span class="sl-confirm-value">${i(n?.seatNumber??n?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function wr(n,e,t){let i=So,o=n?.objectType==="booth",s=n?.objectType==="table"&&!!n?.bookingMode,r=o||s||!n?.seatNumber,a=n?.sectionLabel??(r?void 0:n?.displayLabel),l=s?`${y("picker.guests","Guests")} ${n?.bookingMode==="variable"?`${n?.minOccupancy}\u2013${n?.maxOccupancy}`:n?.capacity}`:void 0,d=(r?[l,a?n?.rowLabel??n?.displayLabel:void 0]:[n?.rowLabel?`${t} ${Q(n)??""}`.trim():void 0,`${y("picker.seat","Seat")} ${n?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${i(a)}</span>`:"")+(d?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${i(d)}</span>`:"")+(a||d?"":`<span class="sl-confirm-pos">${i(e)}</span>`)}function xr(n,e){if(!n)return"";let t=e?y("picker.viewFromThisSeat","View from this seat"):y("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-pill sl-confirm-3dpill" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function kr(n,e){if(!n||e)return"";let t=y("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-3drow" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function ur(n){return n.buyerMessage?.trim()||(n.restriction==="companion"?y("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function hi(n,e,t,i=()=>{}){let o=So;if(n.length>1)return`<fieldset class="sl-confirm-tiers"><legend><span>${qe("picker.ticketType")}</span></legend>`+n.map(a=>{let l=ur(a),c=i(a);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${o(a.id)}"${c?` data-offer-name="${o(c)}"`:""} aria-pressed="${a.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${o(a.name)}`+(c?`<span class="sl-confirm-tier-offer">${di(c,o)}</span>`:"")+"</span>"+(l?`<small class="sl-confirm-tier-note">${o(l)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${o(t(a))}</span></button>`}).join("")+"</fieldset>";let s=n[0],r=s?ur(s):void 0;return r?`<p class="sl-confirm-tier-note">${o(r)}</p>`:""}function Sr(n){return'<div class="sl-confirm-grid">'+n.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${C(n.categoryLabel)}</span>`+(n.priceLabel?`<span class="sl-confirm-price">${C(n.priceLabel)}</span>`:"")+"</div>"+(n.priceLabel&&n.feeNote?`<div class="sl-confirm-fee">${C(n.feeNote)}</div>`:"")+'<div class="sl-confirm-id">'+n.marker+`<span class="sl-confirm-dot" style="background:${C(n.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${C(n.categoryLabel)}</span><span class="sl-confirm-who">`+n.identity+"</span>"+(n.priceLabel?`<span class="sl-confirm-idprice">${C(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+n.commercial+n.tierChoices+n.groupDates+n.wheelchair+(n.thumb||n.see3dPill?`<div class="sl-confirm-strip">${n.thumb}<span class="sl-confirm-pills">${n.see3dPill}</span></div>`:"")+n.inspect+'<div class="sl-confirm-row">'+(n.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${C(n.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${C(n.selectLabel)}</span></button></div></div>`}function Tr(n,e){let t=B,{variable:i}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(i?qe("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):qe("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(n.displayLabel??n.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(i?y("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):qe("picker.allPlacesBookedTogether",{count:n.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t(qe("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(y("picker.tableCapacity","Table capacity"))}</span><span>${t(qe("picker.guestsCount",{count:n.capacity}))}</span>`+(n.entrance?`<span class="muted">${t(y("picker.entrance","Entrance"))}</span><span>${t(n.entrance)}</span>`:"")+(e.suppressPricing?"":`<span class="muted">${t(y("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(i?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(y("picker.numberOfGuests","Number of guests"))}</label><div class="sl-table-stepper" role="group" aria-labelledby="sl-table-qty-label"><button type="button" data-table-step="-1" aria-label="${t(y("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${n.quantity}</output><button type="button" data-table-step="1" aria-label="${t(y("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t(qe("picker.chooseMinMaxGuests",{min:n.minOccupancy,max:n.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${n.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t(qe("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?y("picker.updateTable","Update table"):i?y("picker.selectTable","Select table"):y("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function Er(n,e){let t=Dp(n),i=document.createElement("div");i.className="sl-interrupt sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let o=document.createElement("div");o.className="sl-interrupt-card";let s=document.createElement("div");s.className="sl-interrupt-title",s.textContent=t.title;let r=document.createElement("div");r.className="sl-interrupt-body",r.textContent=t.body,o.append(s,r);let a=document.createElement("div");a.className="sl-interrupt-actions";let l=document.createElement("button");l.type="button",l.className="sl-interrupt-act";let c=document.createElement("span");c.className="sl-interrupt-act-icon",c.setAttribute("aria-hidden","true"),c.textContent="\u21BB";let d=document.createElement("span");return d.textContent=t.action,l.append(c,d),l.addEventListener("click",async()=>{i.classList.add("is-reloading"),l.disabled=!0;try{await e()}catch{}finally{i.isConnected&&(i.classList.remove("is-reloading"),l.disabled=!1)}}),a.appendChild(l),o.appendChild(a),i.appendChild(o),i}function Cr(n,e){return`<div class="sl-a11yhead"><span class="sl-a11yhead-t">${C(n)}</span><button type="button" class="sl-a11yclose" data-a11y-close aria-label="${B(e)}"><svg viewBox="0 0 24 24" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function Ar(n){return n.map(e=>{let t=`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${C(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${e.iconHtml}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${C(e.label)}</span></span>`+(e.count?`<span class="sl-a11yrow-c">${C(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>';return e.note?`<div class="sl-a11yrow-w">${t}${Ft({id:`sl-info-${B(e.key.replace(/[^A-Za-z0-9]+/g,"-"))}`,label:e.note,text:C(e.note)})}</div>`:t}).join("")}function Ft(n){return`<span class="sl-info"${n.wrapRef?` data-ref="${B(n.wrapRef)}"`:""}><button type="button" class="sl-info-btn" data-sl-info aria-label="${B(n.label)}" aria-describedby="${B(n.id)}" aria-expanded="false"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5"/><path d="M12 8h.01"/></svg></button><span class="sl-info-pop" role="tooltip" id="${B(n.id)}"${n.ref?` data-ref="${B(n.ref)}"`:""}>${n.text}</span></span>`}function Pr(n){let e=Math.max(0,n),t=Math.floor(e/6e4),i=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${i}`}function Lr(n){let e=n.performanceLabel?`<div class="sl-chip-when">${B(n.performanceLabel)}</div>`:"",t=n.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${B(n.performanceDates.summary)}</span><span class="sl-chip-date-list">${n.performanceDates.labels.map(i=>`<span class="sl-chip-date">${B(i)}</span>`).join("")}</span></div>`:"";return e+Vp(n)+t}function Vp(n){let{d:e,area:t,label:i,objectType:o,quantity:s=1,identity:r}=n,a=_=>String(_??"\u2014").replace(/[&<>"]/g,U=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[U]),l=o==="ga"?"ga":e?.objectType??o,c=r?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?y("picker.table","Table"):l==="booth"?y("picker.booth","Booth"):l==="ga"?y("picker.generalAdmission","General admission"):y("picker.row","Row")),d=r?.rowLabel??r?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??i,h=n.categoryLabel?.trim()??"",m="",u=[];l==="table"&&r?.bookingMode?(m=`${c} ${d}`,u.push([y("picker.guests","Guests"),String(s)])):l==="ga"?(m=String(t?.displayLabel??d),s>1&&u.push([y("picker.tickets","Tickets"),String(s)])):l==="booth"?(m=e?.sectionLabel??`${c} ${d}`,e?.sectionLabel&&u.push([c,String(d)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?m=String(d):(m=e.sectionLabel??"",e.rowLabel&&u.push([c,String(Q(e)??e.rowLabel)]),e.seatNumber&&u.push([y("picker.seat","Seat"),String(e.seatNumber)]));let g=!m&&!!h,b=m||h||String(d),T=!!h&&!g&&h!==b,S=n.offerName?ci(n.offerName,a):"",x=u.map(([_,U])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(_)}</span> <b>${a(U)}</b></span>`);T&&x.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(h)}</span>${S}</span>`);let P=[b,...u.map(([_,U])=>`${_} ${U}`),T?h:"",n.offerName??""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(P)}</span><span class="sl-chip-name" aria-hidden="true">${a(b)}${T?"":S}</span>`+(x.length?`<span class="sl-chip-pos" aria-hidden="true">${x.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function ui(n,e,t){return n.map(i=>`<option value="${t(i.id)}"${i.id===e?" selected":""}>${t(i.name)}</option>`).join("")}function $p(n){let e=B;return` data-key="${e(n.key)}"`+(n.heldLabels.length?` data-held="${e(encodeURIComponent(n.heldLabels.join(`
2
+ `)))}"`:"")+(n.seatIds.length?` data-seat="${e(n.seatIds.join(" "))}"`:"")+(n.locateId?` data-locate="${e(n.locateId)}"`:"")}function Mr(n){let e=B;return`<div class="sl-chip${n.held?" sl-held":""}${n.fresh?" sl-enter":""}"`+$p(n)+">"+(n.held?n.stateHtml:`<span class="sl-chip-dot" style="background:${C(n.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${n.identityHtml}`+(n.extrasHtml?`<div class="sl-chip-sub">${n.extrasHtml}</div>`:"")+`${n.noteHtml}</div>`+(n.amountText?`<span class="amt">${e(n.amountText)}</span>`:"")+n.railHtml+"</div>"}function Ao(n,e){let t=B(n),i=e?B(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${i}" aria-label="${B(Sn("picker.viewFromSeat",{label:e}))}"><svg viewBox="0 0 24 24"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"/><circle cx="12" cy="12" r="3"/></svg></button>`:"")+`<button type="button" class="rm" aria-label="${t}"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function mi(n,e){return new Set(n.filter(t=>(e[t.key]??0)<=0).map(t=>t.key))}function fi(n,e){let t=(n.doc?.categories??[]).filter(r=>!r.notForSale),i=e?t.filter(r=>r.key===e):t;if(!i.length)return null;let o=mi(i,n.categoryAvailability());return o.size<i.length||(n.currentHold()?.items??[]).some(r=>o.has(r.categoryKey))?null:Object.assign(new Error("seatlayer: that ticket type is sold out"),{status:409,code:"sold_out",reason:"sold_out"})}function Hr(n){return n.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${y("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${Sn("picker.willFindSeatsTogether",{count:n.quantity})}</b><span>${y("picker.manualTicketsRemovedNote","Your manually selected tickets will be removed only after a new group is secured.")}</span></div><div class="sl-ba-actions"><button type="button" data-ba-cancel>${y("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${y("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="sl-ba-title-t">${y("picker.findSeatsTogether","Find seats together")}</span>`+Ft({id:"sl-info-best-seats",label:y("picker.aboutBestSeats","About finding seats together"),text:y("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")})+(n.offerPremium?`<button type="button" class="sl-ba-premium${n.premium?" on":""}" data-ba-premium aria-pressed="${n.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${y("picker.bestSeatsPremium","Best seats")}</button>`:"")+`</div><div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${y("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${n.quantity}</span><button type="button" data-ba="1" aria-label="${y("picker.moreSeats","More seats")}">+</button></div>`+(n.categories.length>1?`<select class="sl-ba-cat" aria-label="${B(y("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${B(y("picker.anyTicketType","Any ticket type"))}</option>`+n.categories.map(e=>e.soldOut?`<option value="${B(e.key)}" disabled>${B(`${e.label} \xB7 ${y("picker.soldOutTitle","Sold out")}`)}</option>`:`<option value="${B(e.key)}"${n.selectedCategory===e.key?" selected":""}>${B(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(n.zones.length?`<select class="sl-ba-zone" aria-label="${y("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${y("picker.anyVenueZone","Any venue zone")}</option>`+n.zones.map(e=>`<option value="${B(e.id)}"${n.selectedZone===e.id?" selected":""}>${B(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${n.busy?" sl-busy":""}"${n.busy?" disabled":""}>`+(n.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${y("picker.findingBestSeats","Finding the best seats\u2026")}`:Fp("picker.findBestSeatsCount",n.quantity))+"</button>"+(n.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${y("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function Rr(n){return n==="setup"||n==="testable"?{heading:y("picker.salesNotOpenPill","Sales haven\u2019t opened yet"),sentence:y("picker.salesNotOpenCopy","Tickets for this event aren\u2019t on sale yet.")}:n==="paused"?{heading:y("picker.salesPausedPill","Sales are paused"),sentence:y("picker.salesPausedCopy","Ticket sales are paused for now.")}:{heading:y("picker.salesClosedPill","Sales are closed"),sentence:y("picker.salesClosedCopy","Ticket sales for this event have ended.")}}function Ir(n,e=!1){if(!e&&(n==="setup"||n==="testable"||n==="paused")){let t=Rr(n);return{pill:t.heading,cta:t.heading,toast:t.sentence}}return{pill:y("picker.salesClosedPill","Sales are closed"),cta:y("picker.salesClosedCta","Sales closed"),toast:y("picker.salesClosedToast","Sales are closed for this event.")}}function Or(n){if(n.salesClosed&&!n.hasPicks){let e=n.whenText?`<span class="when">${B(n.whenText)}</span>`:"",t=n.note??Rr(n.salesState);return`<div class="sl-closed-note" role="status"><b>${t.heading}</b><span>${t.sentence}${e}</span></div>`}return""}function _r(n){return n.hasGaAreas?n.seated?n.venue3d?Sn("picker.trayHintChoose3dOrStanding"):y("picker.trayHintTapOrStanding","Tap a seat on the map or grab standing tickets below."):n.venue3d?Sn("picker.gaTrayHintChoose3dArea"):y("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets."):n.groupMode==="per_performance"?y("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):n.groupMode?y("picker.groupTrayHint","Choose seats once. The same seats will be held for every performance."):n.venue3d?Sn("picker.trayHintChoose3dOrBest"):y("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}import{getLocale as Up,loadLocale as qp,LOCALE_NAMES as Wp,localeDirection as Dr,resolveLocale as Br,setStringOverrides as Yp,TRANSLATED_LOCALES as Zp}from"@seatlayer/core";import{getLocale as zp,localeDirection as jp,t as Kp}from"@seatlayer/core";function Gp(){return`<svg class="sl-boot-venue" viewBox="0 0 200 140" preserveAspectRatio="xMidYMid meet" aria-hidden="true" focusable="false"><g class="sl-boot-shells">${["M20 92a80 52 0 0 1 160 0v14a94 62 0 0 0-160 0z","M32 74a68 42 0 0 1 136 0v12a80 50 0 0 0-136 0z","M46 58a54 32 0 0 1 108 0v10a64 38 0 0 0-108 0z"].map(e=>`<path d="${e}" />`).join("")}</g><rect class="sl-boot-stage" x="62" y="16" width="76" height="16" rx="4" /></svg>`}function Nr(n,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,i.lang=zp(),i.dir=jp(),n.appendChild(i),Object.entries(He(void 0,t)).forEach(([s,r])=>i.style.setProperty(s,r)),i.innerHTML=`
3
3
  <div class="sl-head">
4
4
  <div class="sl-logo" data-ref="logo"></div>
5
5
  <div class="sl-head-info" data-ref="headInfo">
@@ -50,7 +50,7 @@ import{a as bi,b,c as Ye,d as yi,e as qo,f as Wo,g as _,h as Yo,i as vi,j as wi,
50
50
  </div>
51
51
  <div class="sl-boot" data-ref="boot">
52
52
  <div class="sl-boot-bar" aria-hidden="true"></div>
53
- ${Pd()}
53
+ ${Gp()}
54
54
  <span class="sl-boot-say" role="status" aria-live="polite" data-sl-t="picker.loadingSeatMap">${e("picker.loadingSeatMap","Loading seat map\u2026")}</span>
55
55
  </div>
56
56
  <div class="sl-toast" data-ref="toast" role="status" aria-live="polite"></div>
@@ -64,10 +64,10 @@ import{a as bi,b,c as Ye,d as yi,e as qo,f as Wo,g as _,h as Yo,i as vi,j as wi,
64
64
  <div class="sl-sec sl-filtersec" data-ref="filtersSec" data-sl-t="picker.filters">${e("picker.filters","Filters")}</div>
65
65
  <div class="sl-filters" data-ref="filters"></div>
66
66
  <div class="sl-offer" data-ref="offer" role="status" aria-live="polite"></div>
67
- <div class="sl-sec sl-prices-sec" data-ref="pricesSec"><span data-sl-t="picker.ticketPrices">${e("picker.ticketPrices","Ticket prices")}</span>${vt({id:"sl-info-prices",label:e("picker.aboutTicketPrices","About ticket prices"),text:e("picker.priceHint","Colours on the map are ticket types. Tap one below to show just those seats."),ref:"pricesHint",wrapRef:"pricesInfo"})}</div>
67
+ <div class="sl-sec sl-prices-sec" data-ref="pricesSec"><span data-sl-t="picker.ticketPrices">${e("picker.ticketPrices","Ticket prices")}</span>${Ft({id:"sl-info-prices",label:e("picker.aboutTicketPrices","About ticket prices"),text:e("picker.priceHint","Colours on the map are ticket types. Tap one below to show just those seats."),ref:"pricesHint",wrapRef:"pricesInfo"})}</div>
68
68
  <div class="sl-prices" data-ref="prices"></div>
69
69
  <div class="sl-sec sl-seats-sec">
70
- <span class="sl-sec-title"><span data-sl-t="picker.yourSeats">${e("picker.yourSeats","Your seats")}</span>${vt({id:"sl-info-seats",label:e("picker.aboutYourSeats","How to choose seats"),text:e("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you."),ref:"trayHint",wrapRef:"seatsInfo"})}</span>
70
+ <span class="sl-sec-title"><span data-sl-t="picker.yourSeats">${e("picker.yourSeats","Your seats")}</span>${Ft({id:"sl-info-seats",label:e("picker.aboutYourSeats","How to choose seats"),text:e("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you."),ref:"trayHint",wrapRef:"seatsInfo"})}</span>
71
71
  <span class="sl-seat-summary" data-ref="seatSummary"></span>
72
72
  </div>
73
73
  <div class="sl-tray" data-ref="tray"></div>
@@ -76,9 +76,9 @@ import{a as bi,b,c as Ye,d as yi,e as qo,f as Wo,g as _,h as Yo,i as vi,j as wi,
76
76
  <button type="button" class="sl-cta" data-ref="cta" disabled></button>
77
77
  </div>
78
78
  </div>
79
- </div>`;let o={};return n.querySelectorAll("[data-ref]").forEach(s=>{o[s.dataset.ref]=s}),{root:n,mapHost:o.map,els:o}}function Us(i){let e=(t,n)=>{for(let o of i.querySelectorAll(`[${t}]`)){let s=o.getAttribute(t);if(!s)continue;let r=Ad(s);r!==s&&n(o,r)}};e("data-sl-t",(t,n)=>{t.textContent=n}),e("data-sl-a",(t,n)=>{t.setAttribute("aria-label",n)}),e("data-sl-ti",(t,n)=>{t.setAttribute("title",n)})}function Oi(i,e){let t=Ws(i),n=Id.includes(t)?t:"en";return e&&Rd(e),{locale:n,direction:qs(n),ready:Md(i)}}function _i(i,e,t){i.lang=e.locale,i.dir=e.direction,e.ready.then(t)}function Ys(i,e){if(!i)return null;let t=(e.languages??[]).map(o=>Ws(o)).filter((o,s,r)=>r.indexOf(o)===s);if(t.length<2)return null;let n=document.createElement("select");n.className="sl-langsel",n.setAttribute("aria-label",e.label);for(let o of t){let s=document.createElement("option");s.value=o,s.textContent=Hd[o]??o,s.selected=o===Ld(),n.appendChild(s)}return n.addEventListener("change",()=>e.onChange(n.value)),i.appendChild(n),n}function Zs(i,e){e.root.lang=i,e.root.dir=qs(i),Us(e.root);for(let n of e.painters)try{n()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==i&&(t.value=i)}function wt(i,e,t,n=45e3){return new Promise(o=>{if(e.aborted){o({outcome:"cancelled"});return}let s=!1,r=d=>{s||(s=!0,clearTimeout(l),clearTimeout(c),e.removeEventListener("abort",a),o(d))},a=()=>r({outcome:"cancelled"}),l=setTimeout(()=>{s||t()},8e3),c=setTimeout(()=>r({outcome:"timeout"}),n);e.addEventListener("abort",a,{once:!0}),Promise.resolve().then(()=>s?void 0:i()).then(d=>{s||r({outcome:"loaded",value:d})},d=>r({outcome:"error",error:d}))})}var W=class extends Error{constructor(e){super(`buyer_access_unavailable:${e.reason}`),this.name="BuyerAccessUnavailableError",this.reason=e.reason,this.code=e.code,this.status=e.status}},Od=new Set(["buyer_access_expired"]),_d=new Set(["paused","provider_failed","channel_denied","sales_not_open"]);function Nd(i,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_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";case"audience_not_public":return"audience_not_public";case"sales_not_open":return"sales_not_open";case"origin_not_allowed":return"origin_not_allowed";default:break}return i===401?"invalid":null}function Dd(i){return/^Bearer\s+(\S+)$/i.exec(i?.trim()??"")?.[1]??null}function Di(i){return i instanceof W?i.reason!=="paused"&&i.reason!=="channel_denied":!i||typeof i!="object"?!1:i.status===401}function Bd(i,e){return i===401&&!!e&&Od.has(e)}var Fd=3e4,oe,se,et,xt,Qt,De,Be,Ae,kt,Xt,Jt,ei,tt,J,$n,Ni,Ne,ae=class{constructor(e){C(this,J);C(this,oe,null);C(this,se,0);C(this,et,null);C(this,xt);C(this,Qt);C(this,De,null);C(this,Be,null);C(this,Ae,null);C(this,kt,null);C(this,Xt);C(this,Jt);C(this,ei,!1);C(this,tt);if(x(this,xt,e.provider),x(this,Qt,e.skewMs??Fd),x(this,Xt,e.onExpired),x(this,Jt,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;w(this,J,$n).call(this,t)}x(this,ei,!!h(this,xt)||!!h(this,oe))}get configured(){return h(this,ei)}onRenewed(e){x(this,tt,e)}get unavailable(){return h(this,Ae)}get hasToken(){return!!h(this,oe)&&(h(this,se)===0||h(this,se)>Date.now())}get expiresAt(){return h(this,se)}async authorization(e="initial"){if(!this.configured)return null;if(h(this,Ae))throw new W(h(this,Ae));let t=Date.now();if(!h(this,oe)||h(this,se)>0&&h(this,se)-h(this,Qt)<=t){let o=!!h(this,oe)&&h(this,se)>0&&h(this,se)<=t,s=h(this,oe)?o?"expired":"expiring":e,r=await w(this,J,Ni).call(this,s);if(!r)throw new W(h(this,Ae)??h(this,kt)??w(this,J,Ne).call(this,"provider_failed"));return`Bearer ${r}`}return`Bearer ${h(this,oe)}`}async handleFailure(e,t,n){var s;if(!this.configured)return!1;if(Bd(e,t)){let r=Dd(n)??h(this,et);x(this,oe,null),x(this,se,0);let a=await w(this,J,Ni).call(this,"unauthorized",t),l=!!a&&a!==r;return(s=h(this,Xt))==null||s.call(this,{reason:"unauthorized",code:t,refreshed:l}),a&&!l&&w(this,J,Ne).call(this,"revoked",t,e),l}let o=Nd(e,t);return o&&w(this,J,Ne).call(this,o,t,e),!1}async refresh(e="manual"){return x(this,Ae,null),x(this,kt,null),x(this,oe,null),x(this,se,0),!!await w(this,J,Ni).call(this,e)}clear(){h(this,Be)?.abort(),x(this,Be,null),x(this,oe,null),x(this,et,null),x(this,se,0),x(this,De,null),x(this,tt,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};oe=new WeakMap,se=new WeakMap,et=new WeakMap,xt=new WeakMap,Qt=new WeakMap,De=new WeakMap,Be=new WeakMap,Ae=new WeakMap,kt=new WeakMap,Xt=new WeakMap,Jt=new WeakMap,ei=new WeakMap,tt=new WeakMap,J=new WeakSet,$n=function(e){return!e||typeof e.token!="string"||!e.token?null:(x(this,et,e.token),x(this,oe,e.token),x(this,se,typeof e.expiresAt=="number"?e.expiresAt:0),h(this,oe))},Ni=function(e,t){if(h(this,De))return h(this,De);let n=h(this,xt);if(!n)return w(this,J,Ne).call(this,"no_token",t),Promise.resolve(null);let o=h(this,et),s=new AbortController;x(this,Be,s);let r=(async()=>{try{let a=await wt(()=>Promise.resolve(n({reason:e})),s.signal,()=>{},4e4);if(s.signal.aborted||a.outcome==="cancelled")return null;if(a.outcome!=="loaded")return w(this,J,Ne).call(this,"provider_failed",t),null;let l=a.value,c=w(this,J,$n).call(this,l);if(!c)return w(this,J,Ne).call(this,"provider_failed",t),null;if(o&&o!==c&&h(this,tt))try{await h(this,tt).call(this,{previousToken:o,token:c,reason:e})}catch{}return s.signal.aborted?null:c}catch{return w(this,J,Ne).call(this,"provider_failed",t),null}finally{h(this,Be)===s&&(x(this,De,null),x(this,Be,null))}})();return x(this,De,r),r},Ne=function(e,t,n){var s;let o={reason:e,code:t,status:n,retryable:e==="paused"||e==="channel_denied"||e==="sales_not_open"};return x(this,kt,o),_d.has(e)||(x(this,Ae,o),x(this,oe,null),x(this,se,0)),(s=h(this,Jt))==null||s.call(this,o),o};function ti(i,e={}){return!i.buyerAccessTokenProvider&&!i.buyerAccessToken?null:new ae({provider:i.buyerAccessTokenProvider,token:i.buyerAccessToken,...e})}function Bi(i){let e={state:"none"};return{transport:new Proxy(i,{get(n,o){let s=Reflect.get(n,o,n);return typeof s!="function"?s:o!=="chart"?s.bind(n):(...r)=>{let a;try{a=s.apply(n,r)}catch(l){throw e={state:"rejected",error:l},l}return Promise.resolve(a).then(l=>(e={state:"resolved"},l),l=>{throw e={state:"rejected",error:l},l})}}}),outcome:()=>e}}function Fi(i,e){if(!e||!i)return null;if(i.state==="resolved")return"chart_load:transform_failed";if(i.state!=="rejected")return null;let t=i.error;return t instanceof V?t.status>=500&&t.status<=599?"chart_load:chart_fetch_5xx":t.status>=400&&t.status<=499?"chart_load:chart_fetch_4xx":null:typeof t=="object"&&t!==null&&t.name==="AbortError"?"chart_load:chart_fetch_timeout":"chart_load:chart_fetch_network"}var Qs=new Set;function Vi(i){return Qs.has(i.reason)||(Qs.add(i.reason),typeof fetch>"u"||Wt())?!1:(fetch(`${i.apiBase.replace(/\/+$/,"")}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:i.reason,eventKey:i.eventKey}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0)}function jn(i){return!!i&&typeof i=="object"&&!Array.isArray(i)}function Vd(i){return jn(i.availability)?i.availability:null}function $d(i){let e=i.subscribeTicket;if(!jn(e))return null;let t=e.ticket,n=e.protocols;return t!==void 0&&typeof t!="string"||n!==void 0&&(!Array.isArray(n)||n.some(o=>typeof o!="string"))||t===void 0&&n===void 0?null:{...t===void 0?{}:{ticket:t},...n===void 0?{}:{protocols:n}}}var Xs=3e4,zd=2e4;function jd(i){if(!i||typeof i!="object"||Array.isArray(i))return!1;let e=i;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}function Gd(i){return i>=400&&i<500&&i!==408&&i!==429}var $i=class{constructor(e,t,n){this.base=e;this.event=t;this.publicKey=n;this.value=null;this.inflight=null;this.refusal=null;this.fetchedAt=0}usable(){return this.inflight?!0:!!this.value&&this.value.expiresAt-Xs>Date.now()}refused(){return this.refusal}async load(e=!1){if(e&&(this.value=null,this.refusal=null),this.refusal)throw this.refusal;if(this.value&&this.value.expiresAt-Xs>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let n=new AbortController,o=setTimeout(()=>n.abort(),4e4);try{let s=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap?${Qe}`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit",signal:n.signal}),r=await s.json().catch(()=>null);if(!s.ok){let a=s.status===429?Zt(s.headers.get("Retry-After"),r?.retryAfterSeconds):void 0,l=new V(s.status,r?.error??`request_failed_${s.status}`,r?.code??r?.error,void 0,void 0,a,void 0,{...typeof r?.hint=="string"&&r.hint?{hint:r.hint}:{},...typeof r?.message=="string"&&r.message?{serverMessage:r.message}:{}});throw Gd(s.status)&&(this.refusal=l),l}if(!jd(r))throw new V(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=r,this.fetchedAt=Date.now(),r}finally{clearTimeout(o)}})();this.inflight=t;try{return await t}finally{this.inflight===t&&(this.inflight=null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.load(t);return{token:n.token,expiresAt:n.expiresAt}}},zn=class extends _e{constructor(t,n,o,s,r){super(t,{...r,access:s});this.event=n;this.loader=o;this.bootstrapAccess=s;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1;this.initialAvailabilityDelivered=!1;this.initialTicketDelivered=!1}assertEvent(t){if(t!==this.event)throw new V(404,"not_found","not_found")}async bundle(t){this.assertEvent(t);let n=this.loader.refused();if(n)throw n;try{await this.bootstrapAccess.authorization("initial")}catch(o){throw this.loader.refused()??o}return this.loader.load()}async chart(t){if(this.assertEvent(t),this.initialChartDelivered)return super.chart(t);let n=await this.bundle(t);return this.initialChartDelivered=!0,{event:n.event,doc:n.doc}}async objects(t){if(this.assertEvent(t),this.initialObjectsDelivered)return super.objects(t);let n=await this.bundle(t);return this.initialObjectsDelivered=!0,{...n.objects,fetchedAt:this.loader.fetchedAt}}async availability(t,n=!1){if(this.assertEvent(t),n||this.initialAvailabilityDelivered)return super.availability(t,n);let o=await this.bundle(t);return this.initialAvailabilityDelivered=!0,Vd(o)??super.availability(t,n)}async pickerIdleMinutes(){let t=await this.bundle(this.event),n=jn(t.realtime)?t.realtime.idleMinutes:void 0;return typeof n=="number"&&Number.isFinite(n)&&n>=0?n:null}async subscribeTicket(t){if(this.assertEvent(t),this.initialTicketDelivered)return super.subscribeTicket(t);let n=await this.bundle(t);return this.initialTicketDelivered=!0,Date.now()-this.loader.fetchedAt<zd?$d(n)??super.subscribeTicket(t):super.subscribeTicket(t)}},St=new Map;function Js(i,e,t){return`${i}
79
+ </div>`;let o={};return i.querySelectorAll("[data-ref]").forEach(s=>{o[s.dataset.ref]=s}),{root:i,mapHost:o.map,els:o}}function gi(n){let e=(t,i)=>{for(let o of n.querySelectorAll(`[${t}]`)){let s=o.getAttribute(t);if(!s)continue;let r=Kp(s);r!==s&&i(o,r)}};e("data-sl-t",(t,i)=>{t.textContent=i}),e("data-sl-a",(t,i)=>{t.setAttribute("aria-label",i)}),e("data-sl-ti",(t,i)=>{t.setAttribute("title",i)})}function bi(n,e){let t=Br(n),i=Zp.includes(t)?t:"en";return e&&Yp(e),{locale:i,direction:Dr(i),ready:qp(n)}}function yi(n,e,t){n.lang=e.locale,n.dir=e.direction,e.ready.then(t)}function Fr(n,e){if(!n)return null;let t=(e.languages??[]).map(o=>Br(o)).filter((o,s,r)=>r.indexOf(o)===s);if(t.length<2)return null;let i=document.createElement("select");i.className="sl-langsel",i.setAttribute("aria-label",e.label);for(let o of t){let s=document.createElement("option");s.value=o,s.textContent=Wp[o]??o,s.selected=o===Up(),i.appendChild(s)}return i.addEventListener("change",()=>e.onChange(i.value)),n.appendChild(i),i}function Vr(n,e){e.root.lang=n,e.root.dir=Dr(n),gi(e.root);for(let i of e.painters)try{i()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==n&&(t.value=n)}function Vt(n,e,t,i=45e3){return new Promise(o=>{if(e.aborted){o({outcome:"cancelled"});return}let s=!1,r=d=>{s||(s=!0,clearTimeout(l),clearTimeout(c),e.removeEventListener("abort",a),o(d))},a=()=>r({outcome:"cancelled"}),l=setTimeout(()=>{s||t()},8e3),c=setTimeout(()=>r({outcome:"timeout"}),i);e.addEventListener("abort",a,{once:!0}),Promise.resolve().then(()=>s?void 0:n()).then(d=>{s||r({outcome:"loaded",value:d})},d=>r({outcome:"error",error:d}))})}var ee=class extends Error{constructor(e){super(`buyer_access_unavailable:${e.reason}`),this.name="BuyerAccessUnavailableError",this.reason=e.reason,this.code=e.code,this.status=e.status}},Xp=new Set(["buyer_access_expired"]),Qp=new Set(["paused","provider_failed","channel_denied","sales_not_open"]);function Jp(n,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_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";case"audience_not_public":return"audience_not_public";case"sales_not_open":return"sales_not_open";case"origin_not_allowed":return"origin_not_allowed";default:break}return n===401?"invalid":null}function eh(n){return/^Bearer\s+(\S+)$/i.exec(n?.trim()??"")?.[1]??null}function wi(n){return n instanceof ee?n.reason!=="paused"&&n.reason!=="channel_denied":!n||typeof n!="object"?!1:n.status===401}function th(n,e){return n===401&&!!e&&Xp.has(e)}var nh=3e4,ce,de,mt,$t,Tn,Ye,Ze,Oe,zt,En,Cn,An,ft,se,Po,vi,We,pe=class{constructor(e){E(this,se);E(this,ce,null);E(this,de,0);E(this,mt,null);E(this,$t);E(this,Tn);E(this,Ye,null);E(this,Ze,null);E(this,Oe,null);E(this,zt,null);E(this,En);E(this,Cn);E(this,An,!1);E(this,ft);if(k(this,$t,e.provider),k(this,Tn,e.skewMs??nh),k(this,En,e.onExpired),k(this,Cn,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;w(this,se,Po).call(this,t)}k(this,An,!!p(this,$t)||!!p(this,ce))}get configured(){return p(this,An)}onRenewed(e){k(this,ft,e)}get unavailable(){return p(this,Oe)}get hasToken(){return!!p(this,ce)&&(p(this,de)===0||p(this,de)>Date.now())}get expiresAt(){return p(this,de)}async authorization(e="initial"){if(!this.configured)return null;if(p(this,Oe))throw new ee(p(this,Oe));let t=Date.now();if(!p(this,ce)||p(this,de)>0&&p(this,de)-p(this,Tn)<=t){let o=!!p(this,ce)&&p(this,de)>0&&p(this,de)<=t,s=p(this,ce)?o?"expired":"expiring":e,r=await w(this,se,vi).call(this,s);if(!r)throw new ee(p(this,Oe)??p(this,zt)??w(this,se,We).call(this,"provider_failed"));return`Bearer ${r}`}return`Bearer ${p(this,ce)}`}async handleFailure(e,t,i){var s;if(!this.configured)return!1;if(th(e,t)){let r=eh(i)??p(this,mt);k(this,ce,null),k(this,de,0);let a=await w(this,se,vi).call(this,"unauthorized",t),l=!!a&&a!==r;return(s=p(this,En))==null||s.call(this,{reason:"unauthorized",code:t,refreshed:l}),a&&!l&&w(this,se,We).call(this,"revoked",t,e),l}let o=Jp(e,t);return o&&w(this,se,We).call(this,o,t,e),!1}async refresh(e="manual"){return k(this,Oe,null),k(this,zt,null),k(this,ce,null),k(this,de,0),!!await w(this,se,vi).call(this,e)}clear(){p(this,Ze)?.abort(),k(this,Ze,null),k(this,ce,null),k(this,mt,null),k(this,de,0),k(this,Ye,null),k(this,ft,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};ce=new WeakMap,de=new WeakMap,mt=new WeakMap,$t=new WeakMap,Tn=new WeakMap,Ye=new WeakMap,Ze=new WeakMap,Oe=new WeakMap,zt=new WeakMap,En=new WeakMap,Cn=new WeakMap,An=new WeakMap,ft=new WeakMap,se=new WeakSet,Po=function(e){return!e||typeof e.token!="string"||!e.token?null:(k(this,mt,e.token),k(this,ce,e.token),k(this,de,typeof e.expiresAt=="number"?e.expiresAt:0),p(this,ce))},vi=function(e,t){if(p(this,Ye))return p(this,Ye);let i=p(this,$t);if(!i)return w(this,se,We).call(this,"no_token",t),Promise.resolve(null);let o=p(this,mt),s=new AbortController;k(this,Ze,s);let r=(async()=>{try{let a=await Vt(()=>Promise.resolve(i({reason:e})),s.signal,()=>{},4e4);if(s.signal.aborted||a.outcome==="cancelled")return null;if(a.outcome!=="loaded")return w(this,se,We).call(this,"provider_failed",t),null;let l=a.value,c=w(this,se,Po).call(this,l);if(!c)return w(this,se,We).call(this,"provider_failed",t),null;if(o&&o!==c&&p(this,ft))try{await p(this,ft).call(this,{previousToken:o,token:c,reason:e})}catch{}return s.signal.aborted?null:c}catch{return w(this,se,We).call(this,"provider_failed",t),null}finally{p(this,Ze)===s&&(k(this,Ye,null),k(this,Ze,null))}})();return k(this,Ye,r),r},We=function(e,t,i){var s;let o={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"||e==="sales_not_open"};return k(this,zt,o),Qp.has(e)||(k(this,Oe,o),k(this,ce,null),k(this,de,0)),(s=p(this,Cn))==null||s.call(this,o),o};function Pn(n,e={}){return!n.buyerAccessTokenProvider&&!n.buyerAccessToken?null:new pe({provider:n.buyerAccessTokenProvider,token:n.buyerAccessToken,...e})}function xi(n){let e={state:"none"};return{transport:new Proxy(n,{get(i,o){let s=Reflect.get(i,o,i);return typeof s!="function"?s:o!=="chart"?s.bind(i):(...r)=>{let a;try{a=s.apply(i,r)}catch(l){throw e={state:"rejected",error:l},l}return Promise.resolve(a).then(l=>(e={state:"resolved"},l),l=>{throw e={state:"rejected",error:l},l})}}}),outcome:()=>e}}function ki(n,e){if(!e||!n)return null;if(n.state==="resolved")return"chart_load:transform_failed";if(n.state!=="rejected")return null;let t=n.error;return t instanceof j?t.status>=500&&t.status<=599?"chart_load:chart_fetch_5xx":t.status>=400&&t.status<=499?"chart_load:chart_fetch_4xx":null:typeof t=="object"&&t!==null&&t.name==="AbortError"?"chart_load:chart_fetch_timeout":"chart_load:chart_fetch_network"}var $r=new Set;function Si(n){return $r.has(n.reason)||($r.add(n.reason),typeof fetch>"u"||yn())?!1:(fetch(`${n.apiBase.replace(/\/+$/,"")}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:n.reason,eventKey:n.eventKey}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0)}function Mo(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function ih(n){return Mo(n.availability)?n.availability:null}function oh(n){let e=n.subscribeTicket;if(!Mo(e))return null;let t=e.ticket,i=e.protocols;return t!==void 0&&typeof t!="string"||i!==void 0&&(!Array.isArray(i)||i.some(o=>typeof o!="string"))||t===void 0&&i===void 0?null:{...t===void 0?{}:{ticket:t},...i===void 0?{}:{protocols:i}}}var zr=3e4,sh=2e4;function rh(n){if(!n||typeof n!="object"||Array.isArray(n))return!1;let e=n;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}function ah(n){return n>=400&&n<500&&n!==408&&n!==429}var Ti=class{constructor(e,t,i){this.base=e;this.event=t;this.publicKey=i;this.value=null;this.inflight=null;this.refusal=null;this.fetchedAt=0}usable(){return this.inflight?!0:!!this.value&&this.value.expiresAt-zr>Date.now()}refused(){return this.refusal}async load(e=!1){if(e&&(this.value=null,this.refusal=null),this.refusal)throw this.refusal;if(this.value&&this.value.expiresAt-zr>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let i=new AbortController,o=setTimeout(()=>i.abort(),4e4);try{let s=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap?${pt}`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit",signal:i.signal}),r=await s.json().catch(()=>null);if(!s.ok){let a=s.status===429?wn(s.headers.get("Retry-After"),r?.retryAfterSeconds):void 0,l=new j(s.status,r?.error??`request_failed_${s.status}`,r?.code??r?.error,void 0,void 0,a,void 0,{...typeof r?.hint=="string"&&r.hint?{hint:r.hint}:{},...typeof r?.message=="string"&&r.message?{serverMessage:r.message}:{}});throw ah(s.status)&&(this.refusal=l),l}if(!rh(r))throw new j(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=r,this.fetchedAt=Date.now(),r}finally{clearTimeout(o)}})();this.inflight=t;try{return await t}finally{this.inflight===t&&(this.inflight=null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.load(t);return{token:i.token,expiresAt:i.expiresAt}}},Lo=class extends Ue{constructor(t,i,o,s,r){super(t,{...r,access:s});this.event=i;this.loader=o;this.bootstrapAccess=s;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1;this.initialAvailabilityDelivered=!1;this.initialTicketDelivered=!1}assertEvent(t){if(t!==this.event)throw new j(404,"not_found","not_found")}async bundle(t){this.assertEvent(t);let i=this.loader.refused();if(i)throw i;try{await this.bootstrapAccess.authorization("initial")}catch(o){throw this.loader.refused()??o}return this.loader.load()}async chart(t){if(this.assertEvent(t),this.initialChartDelivered)return super.chart(t);let i=await this.bundle(t);return this.initialChartDelivered=!0,{event:i.event,doc:i.doc}}async objects(t){if(this.assertEvent(t),this.initialObjectsDelivered)return super.objects(t);let i=await this.bundle(t);return this.initialObjectsDelivered=!0,{...i.objects,fetchedAt:this.loader.fetchedAt}}async availability(t,i=!1){if(this.assertEvent(t),i||this.initialAvailabilityDelivered)return super.availability(t,i);let o=await this.bundle(t);return this.initialAvailabilityDelivered=!0,ih(o)??super.availability(t,i)}async pickerIdleMinutes(){let t=await this.bundle(this.event),i=Mo(t.realtime)?t.realtime.idleMinutes:void 0;return typeof i=="number"&&Number.isFinite(i)&&i>=0?i:null}async subscribeTicket(t){if(this.assertEvent(t),this.initialTicketDelivered)return super.subscribeTicket(t);let i=await this.bundle(t);return this.initialTicketDelivered=!0,Date.now()-this.loader.fetchedAt<sh?oh(i)??super.subscribeTicket(t):super.subscribeTicket(t)}},jt=new Map;function jr(n,e,t){return`${n}
80
80
  ${e}
81
- ${t}`}function er(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let o=Js(e,t,n);if(St.get(o)?.usable())return;let r=new $i(e,t,n);St.set(o,r),r.load().catch(()=>{St.get(o)===r&&St.delete(o)})}function Kd(i,e,t){let n=Js(i,e,t),o=St.get(n);return o?(St.delete(n),o.usable()?o:null):null}function zi(i){let e=Kd(i.base,i.event,i.publicKey)??new $i(i.base,i.event,i.publicKey),t=new ae({provider:({reason:n})=>e.token(n),...i.accessHooks});return{access:t,api:new zn(i.base,i.event,e,t,i.apiOptions??{})}}import{t as Z,tCount as Pe}from"@seatlayer/core";var Y={enter:260,exit:180,spring:320,flight:500,stagger:30,crossfade:120,collapse:150,rung:200,reducedFade:120,easeEnter:"cubic-bezier(.2,.8,.2,1)",easeExit:"cubic-bezier(.4,0,1,1)",easeSpring:"cubic-bezier(.34,1.56,.64,1)"};var Ud=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${Y.enter}ms;--sl-dur-exit:${Y.exit}ms;--sl-dur-spring:${Y.spring}ms;--sl-dur-flight:${Y.flight}ms;--sl-dur-stagger:${Y.stagger}ms;--sl-dur-xfade:${Y.crossfade}ms;--sl-dur-collapse:${Y.collapse}ms;--sl-dur-rung:${Y.rung}ms;--sl-ease-enter:${Y.easeEnter};--sl-ease-exit:${Y.easeExit};--sl-ease-spring:${Y.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,qd=`@media (prefers-reduced-motion:reduce){.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:0ms;--sl-dur-exit:0ms;--sl-dur-spring:0ms;--sl-dur-flight:0ms;--sl-dur-stagger:0ms;--sl-dur-collapse:0ms;--sl-dur-rung:0ms;--sl-dur-xfade:${Y.reducedFade}ms}.sl-mo-in,.sl-mo-out,.sl-mo-slide-up,.sl-mo-slide-down,.sl-mo-spring,.sl-mo-rise,.sl-mo-zoom,.sl-mo-scrim,.sl-mo-stagger > *{animation-name:slMoFade;animation-duration:${Y.reducedFade}ms;animation-delay:0ms}.sl-mo-hint,.sl-mo-rotate-in,.sl-mo-fly,.sl-mo-collapse{animation:none}.sl-confirm-add-invite,.sl-confirm-add-invite::after{animation:none}.sl-mo-indicator{transition:none}}`,tr=Ud+`
81
+ ${t}`}function Kr(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let o=jr(e,t,i);if(jt.get(o)?.usable())return;let r=new Ti(e,t,i);jt.set(o,r),r.load().catch(()=>{jt.get(o)===r&&jt.delete(o)})}function lh(n,e,t){let i=jr(n,e,t),o=jt.get(i);return o?(jt.delete(i),o.usable()?o:null):null}function Ei(n){let e=lh(n.base,n.event,n.publicKey)??new Ti(n.base,n.event,n.publicKey),t=new pe({provider:({reason:i})=>e.token(i),...n.accessHooks});return{access:t,api:new Lo(n.base,n.event,e,t,n.apiOptions??{})}}import{t as ne,tCount as _e}from"@seatlayer/core";var te={enter:260,exit:180,spring:320,flight:500,stagger:30,crossfade:120,collapse:150,rung:200,reducedFade:120,easeEnter:"cubic-bezier(.2,.8,.2,1)",easeExit:"cubic-bezier(.4,0,1,1)",easeSpring:"cubic-bezier(.34,1.56,.64,1)"};var ch=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${te.enter}ms;--sl-dur-exit:${te.exit}ms;--sl-dur-spring:${te.spring}ms;--sl-dur-flight:${te.flight}ms;--sl-dur-stagger:${te.stagger}ms;--sl-dur-xfade:${te.crossfade}ms;--sl-dur-collapse:${te.collapse}ms;--sl-dur-rung:${te.rung}ms;--sl-ease-enter:${te.easeEnter};--sl-ease-exit:${te.easeExit};--sl-ease-spring:${te.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,dh=`@media (prefers-reduced-motion:reduce){.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:0ms;--sl-dur-exit:0ms;--sl-dur-spring:0ms;--sl-dur-flight:0ms;--sl-dur-stagger:0ms;--sl-dur-collapse:0ms;--sl-dur-rung:0ms;--sl-dur-xfade:${te.reducedFade}ms}.sl-mo-in,.sl-mo-out,.sl-mo-slide-up,.sl-mo-slide-down,.sl-mo-spring,.sl-mo-rise,.sl-mo-zoom,.sl-mo-scrim,.sl-mo-stagger > *{animation-name:slMoFade;animation-duration:${te.reducedFade}ms;animation-delay:0ms}.sl-mo-hint,.sl-mo-rotate-in,.sl-mo-fly,.sl-mo-collapse{animation:none}.sl-confirm-add-invite,.sl-confirm-add-invite::after{animation:none}.sl-mo-indicator{transition:none}}`,Gr=ch+`
82
82
  /* Anchored open/close. The translate is 8px TOWARD the anchor, which is what
83
83
  makes the card look attached to the seat rather than dropped on the map. */
84
84
  .sl-mo-in{transform-origin:var(--sl-mo-ox) var(--sl-mo-oy);
@@ -145,7 +145,7 @@ ${t}`}function er(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
145
145
  @keyframes slMoZoom{from{opacity:0;transform:scale(1.02)}to{opacity:1;transform:none}}
146
146
  .sl-mo-rotate-in{animation:slMoSpin var(--sl-dur-spring) var(--sl-ease-spring) 1 both}
147
147
  @keyframes slMoSpin{from{opacity:0;transform:rotate(-140deg) scale(.8)}to{opacity:1;transform:none}}
148
- `+qd;function ji(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function Gn(i,e){if(!e){i.style.removeProperty("--sl-mo-ox"),i.style.removeProperty("--sl-mo-oy");return}Gi(i,e,i.getBoundingClientRect())}function Gi(i,e,t){let n=t.width||1,o=t.height||1,s=r=>Math.max(0,Math.min(100,r));i.style.setProperty("--sl-mo-ox",`${s((e.x-t.left)/n*100).toFixed(1)}%`),i.style.setProperty("--sl-mo-oy",`${s((e.y-t.top)/o*100).toFixed(1)}%`)}function ir(i,e,t){let n=i.getBoundingClientRect(),o=t.getBoundingClientRect();Gi(i,e,{left:n.left-o.left,top:n.top-o.top,width:n.width,height:n.height})}function nr(i,e){i.classList.remove("sl-mo-out"),e!==void 0&&Gn(i,e),i.classList.remove("sl-mo-in"),i.offsetWidth,i.classList.add("sl-mo-in")}function or(i){i.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(i.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function Ki(i,e,t={className:"sl-mo-out",duration:Y.exit}){let n=()=>{o||(o=!0,!(typeof window>"u")&&(clearTimeout(s),i.removeEventListener("animationend",n),e?e():i.remove()))},o=!1;i.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),i.classList.add(t.className),i.addEventListener("animationend",n);let s=setTimeout(n,ji()?0:t.duration+60)}var af={className:"sl-mo-slide-down",duration:Y.exit};function sr(i){if(ji())return i.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=i.label??"",e.style.left=`${i.from.x}px`,e.style.top=`${i.from.y}px`,e.style.background=i.color??"var(--sl-accent,#6e7bff)",e.style.color=i.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(i.to.x-i.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(i.to.y-i.from.y)}px`),document.body.appendChild(e);let t=!1,n=()=>{t||(t=!0,window.clearTimeout(o),e.remove(),i.onArrive?.())};e.addEventListener("animationend",n);let o=window.setTimeout(n,Y.flight+80);return e}var B=i=>String(i??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function At(i,e){let t=0;for(let n of i.get(e)?.values()??[])t+=n;return t}function rr(i){let e=[];for(let[t,n]of i)for(let[o,s]of n)s>0&&e.push({areaId:t,tierId:o,qty:s});return e}function ar(i){let e=new Map;for(let t of i.keys())e.set(t,At(i,t));return e}function Et(i,e,t,n){let o=i.get(e)??new Map;n>0?o.set(t,n):o.delete(t),o.size?i.set(e,o):i.delete(e)}function lr(i){let e=new Map;for(let t of i)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function Fe(i,e){let t=lr(e),n=0;for(let o of i.keys())n+=Math.max(0,At(i,o)-(t.get(o)??0));return n}function cr(i,e,t){let n=lr(t),o=0;for(let s of e){let r=i.gaQty.get(s.id);if(!r)continue;let a=n.get(s.id)??0;for(let[l,c]of r){let d=Math.max(0,c-a);a=Math.max(0,a-c),o+=d*i.paidPrice(s.categoryKey,l,Wd(s,l),s.id)}}return o}function Wd(i,e){return e?i.tiers?.find(t=>t.id===e)?.price??i.price:i.price}function dr(i){let e=[],t=new Map;for(let n of i){if(n.objectType!=="ga"||!n.objectId){e.push({...n,labels:[n.label]});continue}let o=`${n.objectId}\0${n.tierId??""}`,s=t.get(o);if(s){s.quantity=(s.quantity??0)+(n.quantity??1),s.labels.push(n.label);continue}let r={...n,quantity:n.quantity??1,labels:[n.label]};t.set(o,r),e.push(r)}return e}function pr(i,e,t){let n=new Set(t);for(let o of e)o.objectType==="ga"&&o.objectId&&n.has(o.label)&&Et(i,o.objectId,o.tierId??null,0)}function qn(i,e){if(i.objectType!=="ga")return i.label;let t=e.find(n=>n.id===i.objectId);return t?.displayLabel??t?.label??i.label}function Yd(i){let e=new Map;for(let t of i){if(t.objectType!=="ga"||!t.objectId)continue;let n=`${t.objectId}\0${t.tierId??""}`;e.set(n,(e.get(n)??0)+(t.quantity??1))}return e}function Wn(i){let e=i.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:i.displayType??Z("picker.generalAdmission"),price:i.price}]}function hr(i,e){let t=i.totalTicketCount()-At(i.gaQty,e.id);return Math.max(0,Math.min(it(i,e),i.maxTickets-t))}function it(i,e){return Yn(i)?Ct(e)?e.wheelchairPlaces?e.available:0:Math.min(e.available,e.wheelchairAvailable??0):e.available}function Ct(i){if(i.bookingMode!=="whole"&&i.bookingMode!=="variable")return null;let e=Math.max(0,Math.floor(i.maxOccupancy??i.capacity)),t=i.bookingMode==="whole"?e:Math.max(1,Math.min(e,Math.floor(i.minOccupancy??1)));return{mode:i.bookingMode,min:t,max:e}}function ur(i,e){return Yn(i)&&e.available>0?i.tf("picker.noWheelchairSpace","No wheelchair space"):i.tf("picker.soldOutTitle","Sold out")}function Yn(i){return i.controller?.getAccessibilityFilter?.()?.includes("wheelchair")===!0}function Zd(i){return`${Z("picker.access.wheelchair")} \xB7 ${Pe("picker.leftCount",i.wheelchairAvailable??0)}`}function Qd(i){let e=[];return i.wheelchairPlaces&&e.push({icon:"wheelchair",title:Z("picker.access.wheelchair"),tone:"access",note:Pe("picker.leftCount",i.wheelchairAvailable??0)}),i.entrance&&e.push({icon:"entrance",title:Z("picker.entrance"),note:i.entrance,tone:"place"}),Dn(e,{compact:!0})}function mr(i,e){let t=Ct(i),n=Wn(i),o=it({controller:{getAccessibilityFilter:()=>e.wheelchairOnly?["wheelchair"]:null}},i),s=t?t.max:Math.max(0,Math.min(o,e.room));return{area:i,...t?{bookingMode:t.mode}:{},selected:{},min:t?t.min:0,max:s,tiers:n,confirm:r=>{if(typeof r=="number"){e.hold(r,t&&n.length>1?n[0].id:null);return}if(t){let a=Object.entries(r).find(([,l])=>l>0);a&&e.hold(a[1],a[0]||null);return}e.hold(Object.values(r).reduce((a,l)=>a+l,0),null)},cancel:()=>{}}}function Zn(i,e,t,n){if(ve(i,!1),i.salesClosed){i.toast(i.closedWords?.().toast??i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let o=Ct(e),s=Wn(e),r=i.gaQty.get(e.id),a=At(i.gaQty,e.id)>0,l=hr(i,e);if((o?l<o.min:l<=0)&&!a){i.toast(it(i,e)<=0||o&&it(i,e)<o.min?ur(i,e):Z("picker.maxTicketsForOrder",{count:i.maxTickets}),"warning");return}let c=o?[...r??[]].find(([,v])=>v>0)?.[0]??s[0].id:null;if(i.onGAPromptHook){let v={};for(let[T,S]of r??[])v[T??""]=S;if(i.onGAPromptHook({area:e,...o?{bookingMode:o.mode}:{},selected:v,min:o?o.min:0,max:o?Math.min(o.max,l):l,tiers:s,confirm:T=>{tp(i,e,s,T,l,o)},cancel:()=>ve(i)})===!0)return}let d=new Map;for(let v of s)d.set(v.id,r?.get(v.id)??0);!a&&l>0&&d.set(o?c:s[0].id,o?o.min:1);let u={area:e,tiers:s,draft:d,max:l,reopened:a,box:o,boxTier:c},m=i.root?.dataset.layout==="narrow",p=document.createElement("div");p.className=m?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",p.innerHTML=Xd(i,u,m),i.root?.appendChild(p),i.gaPromptEl=p,i.gaPromptReturnFocus=n??document.activeElement,m||ip(i,p,t,n),i.reducedMotion()&&(p.dataset.motion="reduced"),Kn(i,u),Jd(i,p,u),requestAnimationFrame(()=>p.querySelector('[data-ga-step="1"]')?.focus())}function Xd(i,e,t){let{area:n,tiers:o,box:s}=e,r=o.length>1,a=n.displayLabel??n.label,l=s&&r?Hi(o.map(d=>({id:d.id??"",name:d.label,price:d.price})),e.boxTier??void 0,d=>i.money(i.paidPrice(n.categoryKey,d.id,d.price,n.id))):"",c=s?l+(`<div class="sl-ga-prompt-row" data-ga-tier="${B(e.boxTier??"")}"><div class="sl-ga-prompt-label"><span>${B(i.tf("picker.numberOfGuests","Number of guests"))}</span>`+(s.mode==="variable"?`<small data-ga-range>${B(Z("picker.chooseMinMaxGuests",{min:s.min,max:s.max}))}</small>`:"")+"</div>"+(s.mode==="whole"?`<output data-ga-qty>${s.max}</output>`:`<div class="sl-ga-stepper" role="group" aria-label="${B(a)}"><button type="button" data-ga-step="-1" aria-label="${B(i.tf("picker.fewerGuests","Fewer guests"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${B(i.tf("picker.moreGuests","More guests"))}">+</button></div>`)+"</div>"):o.map(d=>`<div class="sl-ga-prompt-row" data-ga-tier="${B(d.id??"")}"><div class="sl-ga-prompt-label"><span>${B(r?d.label:i.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(r?`<small>${B(i.money(i.paidPrice(n.categoryKey,d.id,d.price,n.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${B(r?d.label:a)}"><button type="button" data-ga-step="-1" aria-label="${B(i.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${B(i.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${B(Z("picker.gaChooseForArea",{area:a}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${B(n.displayType??i.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${B(a)}</h2><p class="sl-ga-prompt-sub" data-ga-sub></p><button type="button" class="sl-ga-prompt-close" data-ga-cancel aria-label="${B(Z("common.close"))}">\xD7</button></div>`+Qd(n)+`<div class="sl-ga-prompt-body">${c}`+(o.length>1||s?`<div class="sl-ga-prompt-total"><span>${B(i.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${B(i.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${B(Z("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function Ui(i){let e=0;for(let t of i.draft.values())e+=t;return e}function fr(i,e){let t=0;for(let n of e.tiers)t+=(e.draft.get(n.id)??0)*i.paidPrice(e.area.categoryKey,n.id,n.price,e.area.id);return t}function Kn(i,e){let t=i.gaPromptEl;if(!t)return;let n=Ui(e),o=fr(i,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let d=c.dataset.gaTier?c.dataset.gaTier:null,u=e.draft.get(d)??0,m=c.querySelector("[data-ga-qty]");m&&(m.value=String(u)),c.querySelectorAll("[data-ga-step]").forEach(p=>{p.disabled=Number(p.dataset.gaStep)<0?u<=(e.box?e.box.min:0):n>=(e.box?Math.min(e.box.max,e.max):e.max)})});let s=t.querySelector("[data-ga-sub]");if(s){let c=e.box&&e.tiers.find(u=>u.id===e.boxTier)||e.tiers[0],d=i.money(i.paidPrice(e.area.categoryKey,c.id,c.price,e.area.id));s.textContent=e.box?Z("picker.perGuestPrice",{price:d}):`${d} \xB7 ${Pe("picker.leftCount",e.area.available)}`}let r=t.querySelector("[data-ga-total]");r&&(r.textContent=i.money(o));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=e.box?"":n>=e.max&&e.max>0?Yn(i)&&e.area.wheelchairPlaces?Zd(e.area):e.area.available<=e.max?Pe("picker.leftCount",e.area.available):Z("picker.maxTicketsForOrder",{count:i.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");if(l){let c=Z("picker.guestsCount",{count:n});l.textContent=e.reopened?Pe("picker.gaUpdate",n,{count:n}):e.box?.mode==="whole"?i.tf("picker.gaBookWholeArea","Book the whole area"):e.box?`${i.tf("picker.gaBook","Book")} \xB7 ${c} \xB7 ${i.money(o)}`:Pe("picker.gaAdd",n,{count:n,price:i.money(o)}),l.disabled=(e.box?n<e.box.min:n<=0)&&!e.reopened}}function Jd(i,e,t){e.querySelectorAll("[data-confirm-tier]").forEach(n=>{n.addEventListener("click",()=>{let o=t.tiers.find(a=>(a.id??"")===n.dataset.confirmTier);if(!o||!t.box)return;let s=Ui(t);for(let a of t.tiers)t.draft.set(a.id,0);t.draft.set(o.id,s),t.boxTier=o.id,e.querySelectorAll("[data-confirm-tier]").forEach(a=>{a.setAttribute("aria-pressed",String(a===n))});let r=e.querySelector("[data-ga-tier]");r&&(r.dataset.gaTier=o.id??""),Kn(i,t)})}),e.querySelectorAll("[data-ga-step]").forEach(n=>{n.addEventListener("click",()=>{let o=n.closest("[data-ga-tier]");if(!o)return;let s=o.dataset.gaTier?o.dataset.gaTier:null,r=Number(n.dataset.gaStep),a=t.draft.get(s)??0,l=(t.box?Math.min(t.box.max,t.max):t.max)-Ui(t),c=t.box?t.box.min:0;t.draft.set(s,Math.max(c,a+(r>0?Math.min(1,l):-1))),Kn(i,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(n=>n.addEventListener("click",()=>ve(i))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{i.gaQty.delete(t.area.id),ve(i),i.syncTray(),Un(i,Z("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{ep(i,t)}),e.addEventListener("mousedown",n=>{n.target===e&&ve(i)}),e.addEventListener("keydown",n=>{if(n.key==="Escape"){n.stopPropagation(),ve(i);return}if(n.key!=="Tab")return;let o=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!o.length)return;let s=o[0],r=o[o.length-1];n.shiftKey&&document.activeElement===s?(n.preventDefault(),r.focus()):!n.shiftKey&&document.activeElement===r&&(n.preventDefault(),s.focus())})}function ep(i,e){let t=Ui(e),n=fr(i,e);for(let s of e.tiers)Et(i.gaQty,e.area.id,s.id,e.draft.get(s.id)??0);ve(i),i.syncTray();let o=e.area.displayLabel??e.area.label;t>0?Un(i,Pe("picker.gaAdded",t,{count:t,area:o,price:i.money(n)})):Un(i,Z("picker.gaRemoved",{area:o}))}function tp(i,e,t,n,o,s=null){if(s){let r=typeof n=="number"?{tierId:t[0].id,wanted:n}:(()=>{let c=Object.entries(n).find(([,u])=>u>0);return{tierId:(t.find(u=>(u.id??"")===c?.[0])??t[0]).id,wanted:c?.[1]??0}})(),a=Math.floor(r.wanted),l=a<=0?0:s.mode==="whole"?s.max:Math.max(s.min,Math.min(s.max,o,a));i.gaQty.delete(e.id),Et(i.gaQty,e.id,r.tierId,l<=o?l:0)}else if(typeof n=="number")Et(i.gaQty,e.id,t[0].id,Math.max(0,Math.min(o,Math.floor(n))));else{i.gaQty.delete(e.id);let r=o;for(let a of t){let l=Math.max(0,Math.floor(n[a.id??""]??0)),c=Math.min(l,r);r-=c,Et(i.gaQty,e.id,a.id,c)}}i.syncTray()}function ve(i,e=!0){let t=i.gaPromptReturnFocus;i.gaPromptEl&&Ki(i.gaPromptEl),i.gaPromptEl=null,i.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:i.root)?.focus())}function ip(i,e,t,n){let o=i.root,s=e.querySelector(".sl-ga-pop");if(!o||!s)return;if(!t){n&&o.contains(n)&&np(o,s,n);return}let r=o.getBoundingClientRect(),a=t.x-r.left,l=t.y-r.top;e.style.setProperty("--sl-ga-anchor-x",`${a}px`),e.style.setProperty("--sl-ga-anchor-y",`${l}px`),requestAnimationFrame(()=>{let c=s.offsetWidth||260,d=s.offsetHeight||220,u=Math.max(8,Math.min(r.width-c-8,a-c/2)),m=l-d-14,p=m>=8?m:Math.min(r.height-d-8,l+14);s.style.left=`${u}px`,s.style.top=`${Math.max(8,p)}px`,s.dataset.side=m>=8?"above":"below",s.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(c-12,a-u))}px`)})}var Tt=14;function np(i,e,t){requestAnimationFrame(()=>{let n=i.getBoundingClientRect(),o=t.getBoundingClientRect(),s=e.offsetWidth||288,r=e.offsetHeight||220,a=o.left-n.left-Tt-8,l=n.right-o.right-Tt-8,c=a>=l?"left":"right";if(Math.max(a,l)<s){let p=o.left+o.width/2-n.left,v=o.top-n.top-r-Tt,g=v>=8?v:Math.min(n.height-r-8,o.bottom-n.top+Tt),T=Math.max(8,Math.min(n.width-s-8,p-s/2));e.style.left=`${T}px`,e.style.top=`${Math.max(8,g)}px`,e.dataset.side=v>=8?"above":"below",e.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(s-12,p-T))}px`);return}let d=o.top+o.height/2-n.top,u=Math.max(8,Math.min(n.height-r-8,d-r/2)),m=c==="left"?o.left-n.left-Tt-s:o.right-n.left+Tt;e.style.left=`${m}px`,e.style.top=`${u}px`,e.dataset.side=c,e.style.setProperty("--sl-ga-arrow-y",`${Math.max(16,Math.min(r-16,d-u))}px`)})}function Un(i,e){i.srEl&&(i.srEl.textContent=e)}function gr(i,e,t=[]){let n=[],o=Yd(t);for(let r of e){let a=i.gaQty.get(r.id);if(!a)continue;let l=Wn(r);for(let c of l){let d=(a.get(c.id)??0)-(o.get(`${r.id}\0${c.id??""}`)??0);if(d<=0)continue;let u=i.paidPrice(r.categoryKey,c.id,c.price,r.id),m=Ct(r);n.push(`<div class="sl-ga" data-ga="${B(r.id)}" data-ga-row-tier="${B(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${B(r.displayLabel??r.label)}</div><div class="sl-ga-sub">${B(m?[l.length>1?c.label:"",Z("picker.perGuestPrice",{price:i.money(u)})].filter(Boolean).join(" \xB7 "):`${l.length>1?c.label:r.displayType??i.tf("picker.generalAdmission","General admission")} \xB7 ${i.money(u)} \xB7 ${Pe("picker.leftCount",r.available)}`)}</div></div>`+(m?`<button type="button" class="sl-table-edit" data-ga-open="${B(r.id)}">${B(Z("picker.guestsCountEdit",{count:d}))}</button></div>`:`<div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${B(i.tf("picker.fewer","Fewer"))}">\u2212</button><span>${d}</span><button type="button" data-d="1" aria-label="${B(i.tf("picker.more","More"))}">+</button></div></div>`))}}let s=e.filter(r=>At(i.gaQty,r.id)<=0&&!t.some(a=>a.objectId===r.id));return s.length&&n.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${i.gaAreasExpanded}"><span>${B(i.tf("picker.gaAreasHeading","Areas"))}</span><small>${s.length}</small></button>`+(i.gaAreasExpanded?`<div class="sl-ga-areas-list">${s.map(r=>`<button type="button" class="sl-ga-area-open" data-ga-open="${B(r.id)}"${it(i,r)<=0?" disabled":""}><span class="name">${B(r.displayLabel??r.label)}<small>${B(r.displayType??i.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${B(it(i,r)<=0?ur(i,r):`${i.money(i.paidPrice(r.categoryKey,null,r.price,r.id))} \xB7 ${Ct(r)?Z("picker.capacityGuests",{count:Ct(r).max}):Pe("picker.leftCount",it(i,r))}`)}</span></button>`).join("")}</div>`:"")+"</div>"),n.join("")}function br(i,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(n=>{n.addEventListener("click",()=>{let o=n.closest(".sl-ga");if(!o?.dataset.ga)return;let s=t.find(c=>c.id===o.dataset.ga);if(!s)return;let r=o.dataset.gaRowTier?o.dataset.gaRowTier:null,a=Number(n.dataset.d),l=i.gaQty.get(s.id)?.get(r)??0;if(a>0&&hr(i,s)-At(i.gaQty,s.id)<=0){i.toast(Z("picker.maxTicketsForOrder",{count:i.maxTickets}),"warning");return}Et(i.gaQty,s.id,r,Math.max(0,l+a)),i.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{i.gaAreasExpanded=!i.gaAreasExpanded,i.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(n=>{n.addEventListener("click",()=>{let o=t.find(s=>s.id===n.dataset.gaOpen);o&&Zn(i,o,null,n)})})}var qi='<svg viewBox="0 0 64 56" width="12" height="11" fill="none" aria-hidden="true" focusable="false" style="display:block"><path d="M4 13 Q16 6 29 7 L28.5 17 Q17 16.5 7 22 Z" fill="#f4b740"/><path d="M4 13 Q16 6 29 7 L28.5 17 Q17 16.5 7 22 Z" fill="#f4b740" transform="translate(64 0) scale(-1 1)"/><path d="M8 28 Q18 22 28.6 23 L28.2 32 Q18 28.5 10 36 Z" fill="#fcf7ee"/><path d="M8 28 Q18 22 28.6 23 L28.2 32 Q18 28.5 10 36 Z" fill="#fcf7ee" transform="translate(64 0) scale(-1 1)"/><path d="M11 41 Q19 35 28.2 36 L27.8 45 Q19.5 42 13.5 49 Z" fill="#fcf7ee"/><path d="M11 41 Q19 35 28.2 36 L27.8 45 Q19.5 42 13.5 49 Z" fill="#fcf7ee" transform="translate(64 0) scale(-1 1)"/></svg>';var op=/^[a-zA-Z0-9._-]+$/;function Qn(i){let e;try{e=new URL(i,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;let t=/^\/pub\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!t)return null;try{let n=decodeURIComponent(t[1]),o=decodeURIComponent(t[2]);return!n||!op.test(o)?null:{eventKey:n,asset:o}}catch{return null}}function sp(i){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(i,"https://seatlayer.invalid").pathname)}catch{return!1}}var Pt=class{constructor(e,t){this.eventKey=e;this.load=t;this.pending=new Map;this.created=new Set;this.disposed=!1}resolve(e){let t=Qn(e);if(!t)return Promise.resolve(sp(e)||!bi(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let n=this.pending.get(e);if(n)return n;let o=this.load(this.eventKey,t.asset).then(s=>{let r=URL.createObjectURL(s);return this.disposed?(URL.revokeObjectURL(r),null):(this.created.add(r),r)}).catch(s=>{throw this.pending.delete(e),s});return this.pending.set(e,o),o}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};import{t as Mt}from"@seatlayer/core";import{isAuthoredSeatView as hp,seatViewDisclosure as up}from"@seatlayer/core/view3d/crossfade/panorama";var yr=`
148
+ `+dh;function Ci(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function Ho(n,e){if(!e){n.style.removeProperty("--sl-mo-ox"),n.style.removeProperty("--sl-mo-oy");return}Ai(n,e,n.getBoundingClientRect())}function Ai(n,e,t){let i=t.width||1,o=t.height||1,s=r=>Math.max(0,Math.min(100,r));n.style.setProperty("--sl-mo-ox",`${s((e.x-t.left)/i*100).toFixed(1)}%`),n.style.setProperty("--sl-mo-oy",`${s((e.y-t.top)/o*100).toFixed(1)}%`)}function Ur(n,e,t){let i=n.getBoundingClientRect(),o=t.getBoundingClientRect();Ai(n,e,{left:i.left-o.left,top:i.top-o.top,width:i.width,height:i.height})}function qr(n,e){n.classList.remove("sl-mo-out"),e!==void 0&&Ho(n,e),n.classList.remove("sl-mo-in"),n.offsetWidth,n.classList.add("sl-mo-in")}function Wr(n){n.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(n.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function Pi(n,e,t={className:"sl-mo-out",duration:te.exit}){let i=()=>{o||(o=!0,!(typeof window>"u")&&(clearTimeout(s),n.removeEventListener("animationend",i),e?e():n.remove()))},o=!1;n.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),n.classList.add(t.className),n.addEventListener("animationend",i);let s=setTimeout(i,Ci()?0:t.duration+60)}var $g={className:"sl-mo-slide-down",duration:te.exit};function Yr(n){if(Ci())return n.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=n.label??"",e.style.left=`${n.from.x}px`,e.style.top=`${n.from.y}px`,e.style.background=n.color??"var(--sl-accent,#6e7bff)",e.style.color=n.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(n.to.x-n.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(n.to.y-n.from.y)}px`),document.body.appendChild(e);let t=!1,i=()=>{t||(t=!0,window.clearTimeout(o),e.remove(),n.onArrive?.())};e.addEventListener("animationend",i);let o=window.setTimeout(i,te.flight+80);return e}var z=n=>String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function qt(n,e){let t=0;for(let i of n.get(e)?.values()??[])t+=i;return t}function Zr(n){let e=[];for(let[t,i]of n)for(let[o,s]of i)s>0&&e.push({areaId:t,tierId:o,qty:s});return e}function Xr(n){let e=new Map;for(let t of n.keys())e.set(t,qt(n,t));return e}function Gt(n,e,t,i){let o=n.get(e)??new Map;i>0?o.set(t,i):o.delete(t),o.size?n.set(e,o):n.delete(e)}function Qr(n){let e=new Map;for(let t of n)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function Xe(n,e){let t=Qr(e),i=0;for(let o of n.keys())i+=Math.max(0,qt(n,o)-(t.get(o)??0));return i}function Jr(n,e,t){let i=Qr(t),o=0;for(let s of e){let r=n.gaQty.get(s.id);if(!r)continue;let a=i.get(s.id)??0;for(let[l,c]of r){let d=Math.max(0,c-a);a=Math.max(0,a-c),o+=d*n.paidPrice(s.categoryKey,l,ph(s,l),s.id)}}return o}function ph(n,e){return e?n.tiers?.find(t=>t.id===e)?.price??n.price:n.price}function ea(n){let e=[],t=new Map;for(let i of n){if(i.objectType!=="ga"||!i.objectId){e.push({...i,labels:[i.label]});continue}let o=`${i.objectId}\0${i.tierId??""}`,s=t.get(o);if(s){s.quantity=(s.quantity??0)+(i.quantity??1),s.labels.push(i.label);continue}let r={...i,quantity:i.quantity??1,labels:[i.label]};t.set(o,r),e.push(r)}return e}function ta(n,e,t){let i=new Set(t);for(let o of e)o.objectType==="ga"&&o.objectId&&i.has(o.label)&&Gt(n,o.objectId,o.tierId??null,0)}function Oo(n,e){if(n.objectType!=="ga")return n.label;let t=e.find(i=>i.id===n.objectId);return t?.displayLabel??t?.label??n.label}function hh(n){let e=new Map;for(let t of n){if(t.objectType!=="ga"||!t.objectId)continue;let i=`${t.objectId}\0${t.tierId??""}`;e.set(i,(e.get(i)??0)+(t.quantity??1))}return e}function _o(n){let e=n.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:n.displayType??ne("picker.generalAdmission"),price:n.price}]}function na(n,e){let t=n.totalTicketCount()-qt(n.gaQty,e.id);return Math.max(0,Math.min(gt(n,e),n.maxTickets-t))}function gt(n,e){return No(n)?Ut(e)?e.wheelchairPlaces?e.available:0:Math.min(e.available,e.wheelchairAvailable??0):e.available}function Ut(n){if(n.bookingMode!=="whole"&&n.bookingMode!=="variable")return null;let e=Math.max(0,Math.floor(n.maxOccupancy??n.capacity)),t=n.bookingMode==="whole"?e:Math.max(1,Math.min(e,Math.floor(n.minOccupancy??1)));return{mode:n.bookingMode,min:t,max:e}}function ia(n,e){return No(n)&&e.available>0?n.tf("picker.noWheelchairSpace","No wheelchair space"):n.tf("picker.soldOutTitle","Sold out")}function No(n){return n.controller?.getAccessibilityFilter?.()?.includes("wheelchair")===!0}function uh(n){return`${ne("picker.access.wheelchair")} \xB7 ${_e("picker.leftCount",n.wheelchairAvailable??0)}`}function mh(n){let e=[];return n.wheelchairPlaces&&e.push({icon:"wheelchair",title:ne("picker.access.wheelchair"),tone:"access",note:_e("picker.leftCount",n.wheelchairAvailable??0)}),n.entrance&&e.push({icon:"entrance",title:ne("picker.entrance"),note:n.entrance,tone:"place"}),Eo(e,{compact:!0})}function oa(n,e){let t=Ut(n),i=_o(n),o=gt({controller:{getAccessibilityFilter:()=>e.wheelchairOnly?["wheelchair"]:null}},n),s=t?t.max:Math.max(0,Math.min(o,e.room));return{area:n,...t?{bookingMode:t.mode}:{},selected:{},min:t?t.min:0,max:s,tiers:i,confirm:r=>{if(typeof r=="number"){e.hold(r,t&&i.length>1?i[0].id:null);return}if(t){let a=Object.entries(r).find(([,l])=>l>0);a&&e.hold(a[1],a[0]||null);return}e.hold(Object.values(r).reduce((a,l)=>a+l,0),null)},cancel:()=>{}}}function Do(n,e,t,i){if(Ce(n,!1),n.salesClosed){n.toast(n.closedWords?.().toast??n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let o=Ut(e),s=_o(e),r=n.gaQty.get(e.id),a=qt(n.gaQty,e.id)>0,l=na(n,e);if((o?l<o.min:l<=0)&&!a){n.toast(gt(n,e)<=0||o&&gt(n,e)<o.min?ia(n,e):ne("picker.maxTicketsForOrder",{count:n.maxTickets}),"warning");return}let c=o?[...r??[]].find(([,g])=>g>0)?.[0]??s[0].id:null;if(n.onGAPromptHook){let g={};for(let[T,S]of r??[])g[T??""]=S;if(n.onGAPromptHook({area:e,...o?{bookingMode:o.mode}:{},selected:g,min:o?o.min:0,max:o?Math.min(o.max,l):l,tiers:s,confirm:T=>{yh(n,e,s,T,l,o)},cancel:()=>Ce(n)})===!0)return}let d=new Map;for(let g of s)d.set(g.id,r?.get(g.id)??0);!a&&l>0&&d.set(o?c:s[0].id,o?o.min:1);let h={area:e,tiers:s,draft:d,max:l,reopened:a,box:o,boxTier:c},m=n.root?.dataset.layout==="narrow",u=document.createElement("div");u.className=m?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",u.innerHTML=fh(n,h,m),n.root?.appendChild(u),n.gaPromptEl=u,n.gaPromptReturnFocus=i??document.activeElement,m||vh(n,u,t,i),n.reducedMotion()&&(u.dataset.motion="reduced"),Ro(n,h),gh(n,u,h),requestAnimationFrame(()=>u.querySelector('[data-ga-step="1"]')?.focus())}function fh(n,e,t){let{area:i,tiers:o,box:s}=e,r=o.length>1,a=i.displayLabel??i.label,l=s&&r?hi(o.map(d=>({id:d.id??"",name:d.label,price:d.price})),e.boxTier??void 0,d=>n.money(n.paidPrice(i.categoryKey,d.id,d.price,i.id))):"",c=s?l+(`<div class="sl-ga-prompt-row" data-ga-tier="${z(e.boxTier??"")}"><div class="sl-ga-prompt-label"><span>${z(n.tf("picker.numberOfGuests","Number of guests"))}</span>`+(s.mode==="variable"?`<small data-ga-range>${z(ne("picker.chooseMinMaxGuests",{min:s.min,max:s.max}))}</small>`:"")+"</div>"+(s.mode==="whole"?`<output data-ga-qty>${s.max}</output>`:`<div class="sl-ga-stepper" role="group" aria-label="${z(a)}"><button type="button" data-ga-step="-1" aria-label="${z(n.tf("picker.fewerGuests","Fewer guests"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${z(n.tf("picker.moreGuests","More guests"))}">+</button></div>`)+"</div>"):o.map(d=>`<div class="sl-ga-prompt-row" data-ga-tier="${z(d.id??"")}"><div class="sl-ga-prompt-label"><span>${z(r?d.label:n.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(r?`<small>${z(n.money(n.paidPrice(i.categoryKey,d.id,d.price,i.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${z(r?d.label:a)}"><button type="button" data-ga-step="-1" aria-label="${z(n.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${z(n.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${z(ne("picker.gaChooseForArea",{area:a}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${z(i.displayType??n.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${z(a)}</h2><p class="sl-ga-prompt-sub" data-ga-sub></p><button type="button" class="sl-ga-prompt-close" data-ga-cancel aria-label="${z(ne("common.close"))}">\xD7</button></div>`+mh(i)+`<div class="sl-ga-prompt-body">${c}`+(o.length>1||s?`<div class="sl-ga-prompt-total"><span>${z(n.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${z(n.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${z(ne("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function Li(n){let e=0;for(let t of n.draft.values())e+=t;return e}function sa(n,e){let t=0;for(let i of e.tiers)t+=(e.draft.get(i.id)??0)*n.paidPrice(e.area.categoryKey,i.id,i.price,e.area.id);return t}function Ro(n,e){let t=n.gaPromptEl;if(!t)return;let i=Li(e),o=sa(n,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let d=c.dataset.gaTier?c.dataset.gaTier:null,h=e.draft.get(d)??0,m=c.querySelector("[data-ga-qty]");m&&(m.value=String(h)),c.querySelectorAll("[data-ga-step]").forEach(u=>{u.disabled=Number(u.dataset.gaStep)<0?h<=(e.box?e.box.min:0):i>=(e.box?Math.min(e.box.max,e.max):e.max)})});let s=t.querySelector("[data-ga-sub]");if(s){let c=e.box&&e.tiers.find(h=>h.id===e.boxTier)||e.tiers[0],d=n.money(n.paidPrice(e.area.categoryKey,c.id,c.price,e.area.id));s.textContent=e.box?ne("picker.perGuestPrice",{price:d}):`${d} \xB7 ${_e("picker.leftCount",e.area.available)}`}let r=t.querySelector("[data-ga-total]");r&&(r.textContent=n.money(o));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=e.box?"":i>=e.max&&e.max>0?No(n)&&e.area.wheelchairPlaces?uh(e.area):e.area.available<=e.max?_e("picker.leftCount",e.area.available):ne("picker.maxTicketsForOrder",{count:n.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");if(l){let c=ne("picker.guestsCount",{count:i});l.textContent=e.reopened?_e("picker.gaUpdate",i,{count:i}):e.box?.mode==="whole"?n.tf("picker.gaBookWholeArea","Book the whole area"):e.box?`${n.tf("picker.gaBook","Book")} \xB7 ${c} \xB7 ${n.money(o)}`:_e("picker.gaAdd",i,{count:i,price:n.money(o)}),l.disabled=(e.box?i<e.box.min:i<=0)&&!e.reopened}}function gh(n,e,t){e.querySelectorAll("[data-confirm-tier]").forEach(i=>{i.addEventListener("click",()=>{let o=t.tiers.find(a=>(a.id??"")===i.dataset.confirmTier);if(!o||!t.box)return;let s=Li(t);for(let a of t.tiers)t.draft.set(a.id,0);t.draft.set(o.id,s),t.boxTier=o.id,e.querySelectorAll("[data-confirm-tier]").forEach(a=>{a.setAttribute("aria-pressed",String(a===i))});let r=e.querySelector("[data-ga-tier]");r&&(r.dataset.gaTier=o.id??""),Ro(n,t)})}),e.querySelectorAll("[data-ga-step]").forEach(i=>{i.addEventListener("click",()=>{let o=i.closest("[data-ga-tier]");if(!o)return;let s=o.dataset.gaTier?o.dataset.gaTier:null,r=Number(i.dataset.gaStep),a=t.draft.get(s)??0,l=(t.box?Math.min(t.box.max,t.max):t.max)-Li(t),c=t.box?t.box.min:0;t.draft.set(s,Math.max(c,a+(r>0?Math.min(1,l):-1))),Ro(n,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(i=>i.addEventListener("click",()=>Ce(n))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{n.gaQty.delete(t.area.id),Ce(n),n.syncTray(),Io(n,ne("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{bh(n,t)}),e.addEventListener("mousedown",i=>{i.target===e&&Ce(n)}),e.addEventListener("keydown",i=>{if(i.key==="Escape"){i.stopPropagation(),Ce(n);return}if(i.key!=="Tab")return;let o=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!o.length)return;let s=o[0],r=o[o.length-1];i.shiftKey&&document.activeElement===s?(i.preventDefault(),r.focus()):!i.shiftKey&&document.activeElement===r&&(i.preventDefault(),s.focus())})}function bh(n,e){let t=Li(e),i=sa(n,e);for(let s of e.tiers)Gt(n.gaQty,e.area.id,s.id,e.draft.get(s.id)??0);Ce(n),n.syncTray();let o=e.area.displayLabel??e.area.label;t>0?Io(n,_e("picker.gaAdded",t,{count:t,area:o,price:n.money(i)})):Io(n,ne("picker.gaRemoved",{area:o}))}function yh(n,e,t,i,o,s=null){if(s){let r=typeof i=="number"?{tierId:t[0].id,wanted:i}:(()=>{let c=Object.entries(i).find(([,h])=>h>0);return{tierId:(t.find(h=>(h.id??"")===c?.[0])??t[0]).id,wanted:c?.[1]??0}})(),a=Math.floor(r.wanted),l=a<=0?0:s.mode==="whole"?s.max:Math.max(s.min,Math.min(s.max,o,a));n.gaQty.delete(e.id),Gt(n.gaQty,e.id,r.tierId,l<=o?l:0)}else if(typeof i=="number")Gt(n.gaQty,e.id,t[0].id,Math.max(0,Math.min(o,Math.floor(i))));else{n.gaQty.delete(e.id);let r=o;for(let a of t){let l=Math.max(0,Math.floor(i[a.id??""]??0)),c=Math.min(l,r);r-=c,Gt(n.gaQty,e.id,a.id,c)}}n.syncTray()}function Ce(n,e=!0){let t=n.gaPromptReturnFocus;n.gaPromptEl&&Pi(n.gaPromptEl),n.gaPromptEl=null,n.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:n.root)?.focus())}function vh(n,e,t,i){let o=n.root,s=e.querySelector(".sl-ga-pop");if(!o||!s)return;if(!t){i&&o.contains(i)&&wh(o,s,i);return}let r=o.getBoundingClientRect(),a=t.x-r.left,l=t.y-r.top;e.style.setProperty("--sl-ga-anchor-x",`${a}px`),e.style.setProperty("--sl-ga-anchor-y",`${l}px`),requestAnimationFrame(()=>{let c=s.offsetWidth||260,d=s.offsetHeight||220,h=Math.max(8,Math.min(r.width-c-8,a-c/2)),m=l-d-14,u=m>=8?m:Math.min(r.height-d-8,l+14);s.style.left=`${h}px`,s.style.top=`${Math.max(8,u)}px`,s.dataset.side=m>=8?"above":"below",s.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(c-12,a-h))}px`)})}var Kt=14;function wh(n,e,t){requestAnimationFrame(()=>{let i=n.getBoundingClientRect(),o=t.getBoundingClientRect(),s=e.offsetWidth||288,r=e.offsetHeight||220,a=o.left-i.left-Kt-8,l=i.right-o.right-Kt-8,c=a>=l?"left":"right";if(Math.max(a,l)<s){let u=o.left+o.width/2-i.left,g=o.top-i.top-r-Kt,b=g>=8?g:Math.min(i.height-r-8,o.bottom-i.top+Kt),T=Math.max(8,Math.min(i.width-s-8,u-s/2));e.style.left=`${T}px`,e.style.top=`${Math.max(8,b)}px`,e.dataset.side=g>=8?"above":"below",e.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(s-12,u-T))}px`);return}let d=o.top+o.height/2-i.top,h=Math.max(8,Math.min(i.height-r-8,d-r/2)),m=c==="left"?o.left-i.left-Kt-s:o.right-i.left+Kt;e.style.left=`${m}px`,e.style.top=`${h}px`,e.dataset.side=c,e.style.setProperty("--sl-ga-arrow-y",`${Math.max(16,Math.min(r-16,d-h))}px`)})}function Io(n,e){n.srEl&&(n.srEl.textContent=e)}function ra(n,e,t=[]){let i=[],o=hh(t);for(let r of e){let a=n.gaQty.get(r.id);if(!a)continue;let l=_o(r);for(let c of l){let d=(a.get(c.id)??0)-(o.get(`${r.id}\0${c.id??""}`)??0);if(d<=0)continue;let h=n.paidPrice(r.categoryKey,c.id,c.price,r.id),m=Ut(r);i.push(`<div class="sl-ga" data-ga="${z(r.id)}" data-ga-row-tier="${z(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${z(r.displayLabel??r.label)}</div><div class="sl-ga-sub">${z(m?[l.length>1?c.label:"",ne("picker.perGuestPrice",{price:n.money(h)})].filter(Boolean).join(" \xB7 "):`${l.length>1?c.label:r.displayType??n.tf("picker.generalAdmission","General admission")} \xB7 ${n.money(h)} \xB7 ${_e("picker.leftCount",r.available)}`)}</div></div>`+(m?`<button type="button" class="sl-table-edit" data-ga-open="${z(r.id)}">${z(ne("picker.guestsCountEdit",{count:d}))}</button></div>`:`<div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${z(n.tf("picker.fewer","Fewer"))}">\u2212</button><span>${d}</span><button type="button" data-d="1" aria-label="${z(n.tf("picker.more","More"))}">+</button></div></div>`))}}let s=e.filter(r=>qt(n.gaQty,r.id)<=0&&!t.some(a=>a.objectId===r.id));return s.length&&i.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${n.gaAreasExpanded}"><span>${z(n.tf("picker.gaAreasHeading","Areas"))}</span><small>${s.length}</small></button>`+(n.gaAreasExpanded?`<div class="sl-ga-areas-list">${s.map(r=>`<button type="button" class="sl-ga-area-open" data-ga-open="${z(r.id)}"${gt(n,r)<=0?" disabled":""}><span class="name">${z(r.displayLabel??r.label)}<small>${z(r.displayType??n.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${z(gt(n,r)<=0?ia(n,r):`${n.money(n.paidPrice(r.categoryKey,null,r.price,r.id))} \xB7 ${Ut(r)?ne("picker.capacityGuests",{count:Ut(r).max}):_e("picker.leftCount",gt(n,r))}`)}</span></button>`).join("")}</div>`:"")+"</div>"),i.join("")}function aa(n,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(i=>{i.addEventListener("click",()=>{let o=i.closest(".sl-ga");if(!o?.dataset.ga)return;let s=t.find(c=>c.id===o.dataset.ga);if(!s)return;let r=o.dataset.gaRowTier?o.dataset.gaRowTier:null,a=Number(i.dataset.d),l=n.gaQty.get(s.id)?.get(r)??0;if(a>0&&na(n,s)-qt(n.gaQty,s.id)<=0){n.toast(ne("picker.maxTicketsForOrder",{count:n.maxTickets}),"warning");return}Gt(n.gaQty,s.id,r,Math.max(0,l+a)),n.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{n.gaAreasExpanded=!n.gaAreasExpanded,n.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(i=>{i.addEventListener("click",()=>{let o=t.find(s=>s.id===i.dataset.gaOpen);o&&Do(n,o,null,i)})})}var xh=/^[a-zA-Z0-9._-]+$/;function Bo(n){let e;try{e=new URL(n,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;let t=/^\/pub\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!t)return null;try{let i=decodeURIComponent(t[1]),o=decodeURIComponent(t[2]);return!i||!xh.test(o)?null:{eventKey:i,asset:o}}catch{return null}}function kh(n){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(n,"https://seatlayer.invalid").pathname)}catch{return!1}}var Wt=class{constructor(e,t){this.eventKey=e;this.load=t;this.pending=new Map;this.created=new Set;this.disposed=!1}resolve(e){let t=Bo(e);if(!t)return Promise.resolve(kh(e)||!Nt(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let i=this.pending.get(e);if(i)return i;let o=this.load(this.eventKey,t.asset).then(s=>{let r=URL.createObjectURL(s);return this.disposed?(URL.revokeObjectURL(r),null):(this.created.add(r),r)}).catch(s=>{throw this.pending.delete(e),s});return this.pending.set(e,o),o}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};import{t as bt}from"@seatlayer/core";import{isAuthoredSeatView as Lh,seatViewDisclosure as Mh}from"@seatlayer/core/view3d/crossfade/panorama";var la=`
149
149
  /* confirm card: a candidate is not in the tray until Select. Map gestures and
150
150
  floating chrome pause while the card owns focus, keeping the camera stable. */
151
151
  .sl-picker[data-confirming="true"] .sl-map-host>:not(.sl-confirm){pointer-events:none}
@@ -215,6 +215,9 @@ ${t}`}function er(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
215
215
  background:var(--sl-cat);color:var(--sl-cat-ink,#fff)}
216
216
  .sl-confirm-cat-name{font-size:15px;font-weight:800;color:inherit;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
217
217
  .sl-confirm-price{flex:none;font-size:18px;font-weight:850;color:inherit;font-variant-numeric:tabular-nums}
218
+ /* EH20: "includes \xA32.00 booking fee", the band's own last line under its price. */
219
+ .sl-confirm-fee{margin-top:-8px;padding:0 16px 10px 14px;text-align:end;font-size:11.5px;font-weight:650;
220
+ background:var(--sl-cat);color:var(--sl-cat-ink,#fff)}
218
221
  /* The 3D action's decision-row form: hidden by default, shown by the
219
222
  narrow no-photo rule below. Square, ghost, the same 44px as its neighbours. */
220
223
  .sl-confirm-3drow{display:none;flex:0 0 44px;width:44px;min-height:44px;padding:0!important;border-radius:9px;
@@ -419,7 +422,8 @@ ${t}`}function er(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
419
422
  .sl-picker[data-layout="narrow"] .sl-confirm-price{font-size:18px}
420
423
  .sl-picker[data-layout="narrow"] .sl-confirm-id{display:none;align-items:center;gap:7px;padding:10px 10px 0;min-height:28px}
421
424
  .sl-picker[data-layout="narrow"][data-density="compact"] .sl-confirm-grid,
422
- .sl-picker[data-layout="narrow"][data-density="compact"] .sl-confirm-cat{display:none}
425
+ .sl-picker[data-layout="narrow"][data-density="compact"] .sl-confirm-cat,
426
+ .sl-picker[data-layout="narrow"][data-density="compact"] .sl-confirm-fee{display:none}
423
427
  .sl-picker[data-layout="narrow"][data-density="compact"] .sl-confirm-id{display:flex}
424
428
  .sl-confirm-dot{flex:none;width:10px;height:10px;border-radius:50%;
425
429
  box-shadow:0 0 0 2px color-mix(in srgb,var(--sl-surface) 70%,transparent),0 0 0 3px color-mix(in srgb,var(--sl-line) 80%,transparent)}
@@ -524,7 +528,7 @@ ${t}`}function er(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
524
528
  color:var(--sl-text);font-weight:700;font-size:12px;display:flex;align-items:center;justify-content:center;gap:7px}
525
529
  .sl-confirm-view:hover{border-color:var(--sl-muted)}
526
530
  .sl-confirm-view svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
527
- `;var vr=`
531
+ `;var ca=`
528
532
  /* Test mode is environment context, not an action. The chip flows in the
529
533
  top-left anchor region: the old rotated corner ribbon sat at a negative
530
534
  offset and was clipped by the widget root's rounded overflow:hidden (its
@@ -684,6 +688,9 @@ ${t}`}function er(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
684
688
  is a line of its own, tucked under the row it belongs to. */
685
689
  .sl-tip-note{display:block;margin-top:-6px;padding:0 12px 9px 30px;
686
690
  font-size:10.5px;font-weight:700;color:var(--sl-muted)}
691
+ /* EH20: "includes \xA32.00 booking fee", under the price it qualifies. */
692
+ .sl-tip-fee{display:block;margin-top:-6px;padding:0 12px 9px 30px;text-align:end;
693
+ font-size:10.5px;font-weight:600;color:var(--sl-muted)}
687
694
 
688
695
  /* Why a tapped seat cannot be taken. Muted, wrapping, and separated from the
689
696
  card above it by a hairline \u2014 it is a sentence, not another status chip. */
@@ -785,7 +792,7 @@ ${t}`}function er(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
785
792
  .sl-pg-switch:hover{border-style:solid;color:var(--sl-text);border-color:var(--sl-accent)}
786
793
  @media(prefers-reduced-motion:reduce){.sl-tip{animation:none!important}.sl-tip,.sl-tip-switch,.sl-pg-switch{transition:none!important}}
787
794
  @media(max-width:639px){.sl-confirm-group-dates{width:min(340px,calc(100% - 20px))}.sl-confirm-date{min-height:32px}}
788
- `;var wr=`
795
+ `;var da=`
789
796
  /* \u2500\u2500 Selects \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
790
797
  /* One chevron for every select the panel owns: same glyph, same weight, same
791
798
  inset from the edge. The platform's own arrow is a different size, colour
@@ -885,7 +892,7 @@ ${t}`}function er(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
885
892
  .sl-ba-qty button:active:not(:disabled),.sl-ga-qty button:active:not(:disabled),
886
893
  .sl-picker .sl-ba-go:active:not(:disabled){transform:none}
887
894
  }
888
- `;var xr=`
895
+ `;var pa=`
889
896
  /* 3D venue overlay \u2014 mounts over the (paused) Konva stage inside the map host.
890
897
  Carries its own gradient so it paints instantly before the scene builds, and
891
898
  cross-fades on enter/exit via a compositor-only opacity transition. Sits below
@@ -1254,7 +1261,7 @@ ${t}`}function er(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
1254
1261
  .sl-view3d-passport-shell{padding:max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom))}
1255
1262
  .sl-view3d-passport{width:100%;max-height:100%;padding:14px 14px max(24px,calc(14px + env(safe-area-inset-bottom)));border-radius:15px}
1256
1263
  }
1257
- `;var kr=`
1264
+ `;var ha=`
1258
1265
  .sl-notes{display:flex;flex-direction:column;gap:0;margin:0}
1259
1266
  /* No radius, no border, no inset: a band is the card's full width or it is a
1260
1267
  plate again. The hairline lives on the JOIN, so the first band sits flush
@@ -1289,7 +1296,7 @@ ${t}`}function er(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
1289
1296
  .sl-notes.compact .sl-note{padding:7px 12px 7px 15px}
1290
1297
  .sl-notes.compact .sl-note-t b{font-size:11.5px;font-weight:750}
1291
1298
  .sl-notes.compact .sl-note-n{font-size:10.5px}
1292
- `;var Sr=`
1299
+ `;var ua=`
1293
1300
  /* The head is a bare 19.5px strip: the pill's upper half and nothing else. It
1294
1301
  used to reserve 26px (6px of ground above a 20px pill) and the sheet drew a
1295
1302
  border above that, so the chrome between the map and the cart was 33px of
@@ -1408,7 +1415,7 @@ ${t}`}function er(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
1408
1415
  above the line. The map now reaches the line, so the column keeps the same
1409
1416
  clearance from the pill's top rather than dropping onto the hairline. */
1410
1417
  .sl-picker[data-layout="narrow"] .sl-anchor[data-region="bottom-right"]{bottom:32px}
1411
- `;var Tr=`
1418
+ `;var ma=`
1412
1419
  /* THE PHONE SHOWS THE DESKTOP CARD (owner call 2026-09-06: "cards should be
1413
1420
  the same design as desktop"). What used to be here was a second rendering of
1414
1421
  the cart \u2014 a bordered .sl-tlist box of 44px hairline-divided .sl-tline rows,
@@ -1616,13 +1623,13 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
1616
1623
  .sl-picker .sl-fitpill.sl-fit-p2,.sl-picker .sl-fitpill.sl-fit-p3{font-size:11.5px}
1617
1624
  .sl-picker .sl-fitpill.sl-fit-p3{white-space:normal;text-align:center;
1618
1625
  padding-top:6px;padding-bottom:6px;line-height:1.2}
1619
- `;function Xn(i){return i?[...i.children].filter(e=>e instanceof HTMLElement&&e.offsetWidth>0&&e.offsetHeight>0):[]}function Er(i){return i.length?i.reduce((e,t)=>e+t.offsetWidth,0)+8*(i.length-1):0}function rp({mapWidth:i,leftWidth:e,centerWidth:t,rightWidth:n}){if(i<=0)return!0;let o=n>0?n+8:0;if(o>i*.38)return!1;if(t<=0)return!0;let s=i/2,r=s-12-(e>0?Math.min(e,i*.38)+8:0),a=s-12-(o>0?o+8:0);return t/2<=Math.min(r,a)}function Cr(i,e,t){if(!i)return;if(i.dataset.layout==="narrow"){delete i.dataset.topbar;return}let n=Xn(t["top-right"]),o={mapWidth:e.clientWidth,leftWidth:Er(Xn(t["top-left"])),centerWidth:Math.max(0,...Xn(t["top-center"]).filter(r=>r.classList.contains("sl-rungs")).map(r=>r.offsetWidth)),rightWidth:Er(n)};!rp(o)?i.dataset.topbar="stacked":delete i.dataset.topbar,e.style.setProperty("--sl-topright-w",`${Math.ceil(o.rightWidth+8)}px`)}var Ar=`
1626
+ `;function Fo(n){return n?[...n.children].filter(e=>e instanceof HTMLElement&&e.offsetWidth>0&&e.offsetHeight>0):[]}function fa(n){return n.length?n.reduce((e,t)=>e+t.offsetWidth,0)+8*(n.length-1):0}function Sh({mapWidth:n,leftWidth:e,centerWidth:t,rightWidth:i}){if(n<=0)return!0;let o=i>0?i+8:0;if(o>n*.38)return!1;if(t<=0)return!0;let s=n/2,r=s-12-(e>0?Math.min(e,n*.38)+8:0),a=s-12-(o>0?o+8:0);return t/2<=Math.min(r,a)}function ga(n,e,t){if(!n)return;if(n.dataset.layout==="narrow"){delete n.dataset.topbar;return}let i=Fo(t["top-right"]),o={mapWidth:e.clientWidth,leftWidth:fa(Fo(t["top-left"])),centerWidth:Math.max(0,...Fo(t["top-center"]).filter(r=>r.classList.contains("sl-rungs")).map(r=>r.offsetWidth)),rightWidth:fa(i)};!Sh(o)?n.dataset.topbar="stacked":delete n.dataset.topbar,e.style.setProperty("--sl-topright-w",`${Math.ceil(o.rightWidth+8)}px`)}var ba=`
1620
1627
  .sl-picker[data-layout="wide"][data-topbar="stacked"] .sl-anchor[data-region="top-right"]{flex-wrap:nowrap;max-width:none}
1621
1628
  .sl-picker[data-layout="wide"][data-topbar="stacked"] .sl-anchor[data-region="top-left"]{
1622
1629
  max-width:calc(100% - 32px - var(--sl-topright-w,160px))}
1623
1630
  .sl-picker[data-layout="wide"][data-topbar="stacked"] .sl-anchor[data-region="top-center"]{
1624
1631
  top:64px;max-width:calc(100% - 24px)}
1625
- `;var Pr="seatlayer-picker-style",ap=`
1632
+ `;var ya="seatlayer-picker-style",Th=`
1626
1633
  .sl-picker{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:420px;overflow:hidden;
1627
1634
  background:var(--sl-bg);color:var(--sl-text);font-family:var(--sl-font);border-radius:var(--sl-radius);
1628
1635
  /* iOS INFLATES FIXED-PX TYPE IN A HOST LAYOUT IT DECIDES IS TOO NARROW, and
@@ -2298,6 +2305,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
2298
2305
  fill and alpha mirror render/seatStatusPaint's UNAVAILABLE_SEAT_FILL and
2299
2306
  UNAVAILABLE_SEAT_OPACITY, so the key teaches the language the canvas speaks. */
2300
2307
  .sl-status-icon.unavailable{background:#9ca3af;opacity:.55;outline:none}
2308
+ .sl-status-icon.partial{background:linear-gradient(90deg,var(--sl-accent) 50%,#9ca3af 50%);outline:none}
2301
2309
 
2302
2310
  /* tray */
2303
2311
  .sl-seats-sec{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:13px}
@@ -2516,6 +2524,8 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
2516
2524
  /* footer */
2517
2525
  .sl-foot{position:relative;z-index:2;padding:10px 16px 8px;border-top:1px solid var(--sl-line);flex:none;
2518
2526
  background:var(--sl-bg);box-shadow:0 -10px 24px -22px rgba(0,0,0,.72)}
2527
+ /* checkoutBar: false: the host draws its own button and holds via holdSelection(). */
2528
+ .sl-picker[data-checkout-bar="off"] .sl-foot{display:none}
2519
2529
  .sl-total{display:flex;justify-content:space-between;align-items:center;font-size:13px;margin-bottom:10px}
2520
2530
  .sl-total b{font-size:17px;font-variant-numeric:tabular-nums}
2521
2531
  /* A COUNT THAT GOES 6 \u2192 7 SHOULD LOOK LIKE 6 GOING TO 7 (owner, 2026-09-06:
@@ -2837,19 +2847,6 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
2837
2847
  .sl-closed-pill.on{display:inline-flex}
2838
2848
  .sl-closed-pill svg{width:13px;height:13px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
2839
2849
 
2840
- /* "Powered by SeatLayer" attribution badge (side-panel foot) \u2014 the canonical
2841
- Layered Rows mark + wordmark. Hidden when the host opts out or the org's paid
2842
- theme sets hideBadge. */
2843
- .sl-powered{display:flex;align-items:center;justify-content:center;gap:5px;margin-top:2px;
2844
- font-size:11px;font-weight:600;letter-spacing:.02em;color:var(--sl-text);opacity:.72;
2845
- text-decoration:none;padding:2px 8px;border-radius:999px;width:fit-content;margin-inline:auto;
2846
- transition:opacity .15s ease,background-color .15s ease}
2847
- .sl-powered:hover{opacity:1;background:color-mix(in srgb,var(--sl-text) 8%,transparent)}
2848
- .sl-powered:focus-visible{opacity:1;outline:2px solid var(--sl-accent);outline-offset:2px}
2849
- .sl-powered-mark{width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;
2850
- background:#0c1220;color:#fcf7ee}
2851
- .sl-powered-mark svg{width:12px;height:11px}
2852
-
2853
2850
  /* a11y filter chips (flow within the top-left region) */
2854
2851
  .sl-chips{display:flex;gap:6px;flex-wrap:wrap}
2855
2852
  .sl-chip-f{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border-radius:999px;font-size:12px;font-weight:700;
@@ -3325,7 +3322,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3325
3322
  Paint twelve pixels of the frame ground below its box to cover that seam;
3326
3323
  this does not enlarge the picker or move its checkout controls. */
3327
3324
  @media(max-width:640px){.sl-modal-scrim{padding:0}.sl-modal-frame{width:100%;height:100%;border-radius:0;box-shadow:0 12px 0 var(--sl-bg)}}
3328
- `;function Lt(){if(document.getElementById(Pr))return;let i=document.createElement("style");i.id=Pr,i.textContent=ap+Sr+kr+yr+Tr+wr+xr+Ar+vr+tr,document.head.appendChild(i)}async function Wi(i,e){let t=i.overlay.productionElements;if(!t?.some(o=>o.contentImageUrl))return i;let n=await Promise.all(t.map(async o=>{if(!o.contentImageUrl)return o;try{let s=await e(o.contentImageUrl);if(!s){let{contentImageUrl:r,...a}=o;return a}return{...o,runtimeContentImageUrl:s}}catch{let{contentImageUrl:s,...r}=o;return r}}));return{...i,overlay:{...i.overlay,productionElements:n}}}async function Yi(i,e){if(i)try{let t=await e(i);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}import{browserPanoramaConstraints as lp,loadPanoramaImage as cp,planPanoramaDelivery as dp,schedulePanoramaUpgrade as pp}from"@seatlayer/core/view/panoramaDelivery";function Zi(i){let{root:e,source:t,caption:n,real:o,closeLabel:s,dragHint:r,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:d,onClose:u}=i,m=i.chrome??{},p=document.createElement("div");p.className="sl-view sl-mo-zoom",p.setAttribute("role","dialog"),p.setAttribute("aria-label",a),p.innerHTML='<div class="sl-view-head"><span class="sl-view-title"></span><span class="sl-view-cap"></span><button type="button" class="sl-view-x"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div><div class="sl-view-pano"><span class="sl-view-badge"></span><span class="sl-view-hint"></span></div>';let v=$=>p.querySelector($)?.remove();m.title===!1?v(".sl-view-title"):p.querySelector(".sl-view-title").textContent=a,m.caption===!1?v(".sl-view-cap"):p.querySelector(".sl-view-cap").textContent=n,p.querySelector(".sl-view-x").setAttribute("aria-label",s),m.badge===!1?v(".sl-view-badge"):p.querySelector(".sl-view-badge").textContent=o?l:c,p.querySelector(".sl-view-hint").textContent=r,e.appendChild(p);let g=p.querySelector(".sl-view-pano"),T=dp(t,lp()),S=new AbortController;g.style.backgroundImage=`url(${JSON.stringify(T.initialUrl)})`;let y=()=>{};T.upgradeUrl&&(y=pp(()=>{d(T.upgradeUrl).then($=>!$||S.signal.aborted?null:cp($,S.signal).then(()=>$)).then($=>{!$||!p.isConnected||S.signal.aborted||(g.style.backgroundImage=`url(${JSON.stringify($)})`)}).catch(()=>{})}));let P=70,R=35,G=1,f=g.clientHeight||1,L=g.clientWidth||1,D=-(f*(180/P)*2/2-L/2),M=0,O=()=>{let $=g.clientHeight||1,In=$*(180/P)*G,Go=Math.max(0,In-$),Ko=Math.min(Go/2,R/180*In);M=Math.min(Ko,Math.max(-Ko,M)),g.style.backgroundSize=`auto ${In}px`,g.style.backgroundPosition=`${D}px ${M-Go/2}px`};O();let A=!1,I=0,j=0,z=$=>{A=!0,I=$.clientX,j=$.clientY,g.classList.add("drag"),g.setPointerCapture?.($.pointerId)},de=$=>{A&&(D+=$.clientX-I,M+=$.clientY-j,I=$.clientX,j=$.clientY,O())},Te=$=>{A=!1,g.classList.remove("drag"),g.releasePointerCapture?.($.pointerId)},We=$=>{$.preventDefault(),G=Math.min(2.4,Math.max(1,G+($.deltaY<0?.12:-.12))),O()};g.addEventListener("pointerdown",z),g.addEventListener("pointermove",de),g.addEventListener("pointerup",Te),g.addEventListener("pointercancel",Te),g.addEventListener("wheel",We,{passive:!1});let be=p.querySelector(".sl-view-x");be.addEventListener("click",u);let ft=$=>{$.key==="Escape"&&($.stopPropagation(),u())};return p.addEventListener("keydown",ft),be.focus(),{element:p,dispose(){y(),S.abort(),g.removeEventListener("pointerdown",z),g.removeEventListener("pointermove",de),g.removeEventListener("pointerup",Te),g.removeEventListener("pointercancel",Te),g.removeEventListener("wheel",We),p.removeEventListener("keydown",ft),be.removeEventListener("click",u)}}}function mp(i,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=i.find(s=>s.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let n=i.filter(s=>s.rowId===t.rowId),o=n.findIndex(s=>s.id===e);return{targetSeatId:e,previousSeatId:o>0?n[o-1].id:null,nextSeatId:o>=0&&o+1<n.length?n[o+1].id:null}}var Lr=6e4,Qi=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.focusedSectionId_=null;this.navigationMode_="auto";this.overlay=null;this.handle=null;this.generation=0;this.seatViewGeneration=0;this.seatViewElement=null;this.seatViewDispose=null;this.navigationPinned_=!1;this.options=e}get buyerView(){return this.buyerView_}get targetSeatId(){return this.targetSeatId_}get focusedSectionId(){return this.focusedSectionId_}get seatPosition(){return mp(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_==="auto"?"orbit":this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!vi()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),n=this.options.host(),o=this.options.doc();if(!t||!n||!o)throw new Error("seat_view_unavailable");let s=++this.seatViewGeneration,r,a,l=!1;if(t.viewUrl){let v=t.viewMeta?.previewUrl,g=!!v&&v!==t.viewUrl,T=g?await this.options.resolveAsset(v):null,S=g?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(s!==this.seatViewGeneration||!S||g&&!T)return;r={url:S,...T?{previewUrl:T}:{},...g?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}},a=up(r),l=hp(r)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:v}=await ki();if(s!==this.seatViewGeneration)return;let g=o.floors?.find(y=>y.objects.some(P=>P.type==="row"&&P.id===t.rowId)),T=t.focalPoint??g?.focalPoint??o.focalPoint,S=v(t,T,[...this.options.seats()]);r={url:S.url,generated:!0},a=Mt("picker.illustrationCaption",{m:S.distanceM})}if(s!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(n,o),Lt();let c=this.options.chrome??{},d=Ye(),u=Mt("picker.viewFromSeat",{label:t.displayLabel||t.label}),m=l?Mt("picker.real360"):Mt("picker.preview"),p=Zi({root:n,source:r,caption:a,real:l,closeLabel:b("picker.close","Close"),dragHint:d,viewFromSeatLabel:u,real360Label:Mt("picker.real360"),previewLabel:Mt("picker.preview"),chrome:{title:c.seatViewTitle,caption:c.seatViewCaption,badge:c.seatViewBadge},resolveAsset:this.options.resolveAsset,onClose:()=>this.closeSeatView(!0,!0)});this.seatViewElement=p.element,this.seatViewDispose=p.dispose,this.options.onSeatViewChange?.({seatId:t.id,title:u,caption:a,badge:m,real:l,generated:!!r.generated,dragHint:d})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let n=t.floors.findIndex(o=>o.id===e);return n>=0&&this.handle.focusFloor(n)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}applyNavigationMode(e){this.navigationMode_==="auto"&&!this.navigationPinned_||e.setNavigationMode(this.navigationMode_)}setNavigationMode(e){return e!=="auto"&&(this.navigationPinned_=!0),this.navigationMode_=e,this.buyerView_!=="venue3d"||!this.handle?!1:(this.applyNavigationMode(this.handle),this.options.onViewChange(this.buyerView_,this.targetSeatId_),!0)}destroy(){this.generation+=1,this.closeSeatView(!0,!1);try{this.handle?.dispose()}catch{}this.handle=null,this.overlay?.remove(),this.overlay=null,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null}max3DSeats(){let e=this.options.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?Lr/2:Lr}async enter3D(e){let t=this.options.host(),n=this.options.doc();if(!t||!n||this.overlay)throw new Error("venue_3d_unavailable");Lt(),this.prepareHostTheme(t,n);let o=document.createElement("div");o.className="sl-view3d",o.setAttribute("role","group"),o.setAttribute("aria-label",b("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(o.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let s=document.createElement("div");s.className="sl-view3d-loading",s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),s.textContent=b("picker.loading3d","Building the 3D venue\u2026"),o.appendChild(s),t.appendChild(o),this.overlay=o;let r=++this.generation;if(this.reducedMotion()?o.style.opacity="1":requestAnimationFrame(()=>{o.style.opacity="1"}),await this.nextPaint(),!(r!==this.generation||this.overlay!==o))try{let[a,l]=await Promise.all([wi(),this.options.loadEventConfiguration()]),c=l?await Wi(l,this.options.resolveAsset):null,d=await Yi(n.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(r!==this.generation||this.overlay!==o)return;let u={doc:n,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};s.textContent=b("picker.building3d","Building venue geometry\u2026");let m=await a.prepareVenue3D(u);if(r!==this.generation||this.overlay!==o)return;let p=this.options.chrome??{},v=a.mountVenue3D(o,{...u,prepared:m},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:Ye(),navLabels:yi(),...p.view3dCaption===!1||p.view3dSeatStepper===!1||p.view3dControlDock===!1?{chrome:{caption:p.view3dCaption!==!1,seatStepper:p.view3dSeatStepper!==!1,controlDock:p.view3dControlDock!==!1}}:{},seatViewActionLabel:g=>this.findSeat(g)?.viewUrl?b("picker.openAuthored360","Open venue 360\xB0"):b("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:g=>this.toggleSeat(g),onSeatInspect:g=>this.toggleSeat(g),onViewTargetChange:g=>{this.targetSeatId_=g,g&&(this.focusedSectionId_=this.findSeat(g)?.sectionId??null),this.options.onViewChange("venue3d",g)},onSectionFocusChange:g=>{this.focusedSectionId_=g,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:g=>this.seatViewFor3D(g)}:{}});if(r!==this.generation||this.overlay!==o){v.dispose();return}this.handle=v,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,this.applyNavigationMode(v),requestAnimationFrame(()=>s.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await v.flyToSeat(e)}catch(a){if(r!==this.generation)return;throw this.options.onError?.(a),this.remove3DOverlay(!1),a}}exit3D(){this.buyerView_==="map"&&!this.overlay||(this.generation+=1,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null,this.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let n=this.handle,o=this.overlay;if(this.options.restoreMap(),t&&n&&o){o.style.pointerEvents="none";let s=()=>{this.buyerView_!=="map"||this.overlay!==o||(o.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(o.style.opacity="0",s()):(requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(s,280));return}if(this.handle=null,this.overlay=null,!o){try{n?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{n?.dispose()}catch{}o.remove(),this.options.restoreMap();return}o.style.pointerEvents="none",requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(()=>{try{n?.dispose()}catch{}o.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,n=this.handle;if(!t||!n)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),n.resize(),this.applyNavigationMode(n),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await n.flyToSeat(e.flyToSeatId):e.resetView&&n.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(o=>o.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let n=t.viewMeta?.previewUrl,o=!!n&&n!==t.viewUrl,s=o?await this.options.resolveAsset(n):null,r=o?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!r||o&&!s)throw new Error("seat_view_unavailable");return{url:r,...s?{previewUrl:s}:{},...o?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:b("picker.chartDerivedModel","Chart-derived model")}}closeSeatView(e=!0,t=!1){e&&(this.seatViewGeneration+=1);let n=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!n){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){n.remove();return}n.classList.add("is-leaving"),setTimeout(()=>n.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(n=>n.objects)??e.objects).some(n=>n.type==="shape"&&(n.role==="stage"||!!n.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let n=t.theme;e.style.setProperty("--sl-bg",n?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",n?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",n?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",n?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};import{seatPriceFor as Mr}from"@seatlayer/core";function Le(i,e,t,n){let o=e?i?.[e]:void 0;return o===void 0?n:typeof o=="number"?o:t&&o.tiers?.[t]!==void 0?o.tiers[t]:o.base??n}function Xi(i,e,t,n,o){let s=Mr(i?.objects,e,n);return s!==void 0?s:Mr(i?.seatPrices,e,n)!==void 0?o:Le(i?.prices,t,n,o)}function Ji(i){if(!i)return null;let e=i.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function fp(i){return Ji(i.foot?.querySelector(".sl-total"))??Ji(i.tray)??Ji(i.sheetHead)}function eo(i,e,t,n,o){let s=i,r=s.map;if(!r||!e){o?.();return}let a=r.getBoundingClientRect(),l={x:a.left+e.x,y:a.top+e.y},c=t.displayLabel??t.label,d=n?.find(m=>m.key===t.categoryKey)?.color,u=()=>{let m=fp(s);if(!m){o?.();return}sr({from:l,to:{x:m.left+m.width/2,y:m.top+m.height/2},label:c,color:d,onArrive:o})};s.sheetHead&&Ji(s.sheetHead)?requestAnimationFrame(u):u()}var Jn=60,gp=650;function Hr(i,e){if(!e.length||i.focusSeats?.(e.map(o=>o.id)))return;let t=e.find(o=>o.sectionId)?.sectionId;if(!t)return;let n=e.filter(o=>o.sectionId===t);i.focus(t,{x:n.reduce((o,s)=>o+s.x,0)/n.length,y:n.reduce((o,s)=>o+s.y,0)/n.length})}function Rr(i,e){let t=!ji();Hr({focusSeats:n=>i.focusSeats?.(n,{animate:t})===!0,focus:(n,o)=>i.focusSection(n,o)},(e?.items??[]).filter(n=>n.objectType!=="ga").slice(0,10).map(n=>i.seatByLabel(n.label)).filter(n=>!!n))}function Ir(i,e){if(!e.length)return;let t=i.reducedMotion===!0;t||e.forEach((r,a)=>{i.schedule(()=>i.pop(r.id),a*Jn)});let n=t?0:e.length*Jn,o=e.find(r=>r.sectionId)?.sectionId;if(i.schedule(()=>Hr(i,e),n),t)return;let s=n+(i.focusSeats||o?gp:0);e.forEach((r,a)=>{i.schedule(()=>eo(i.regions,i.screenPoint(r),r,i.categories),s+a*Jn)})}function bp(i,e,t){for(let n of i)if(e>=n.x&&t>=n.y&&e<=n.x+n.w&&t<=n.y+n.h)return!0;return!1}var en=class{constructor(){this.rects=[];this.host=null;this.pointers=new Set;this.touches=new Set;this.mouseDown=!1;this.onPointerDown=e=>{this.inside(e.clientX,e.clientY)&&(this.pointers.add(e.pointerId),this.swallow(e))};this.onPointerFollow=e=>{this.pointers.has(e.pointerId)&&this.swallow(e)};this.onPointerEnd=e=>{this.pointers.delete(e.pointerId)&&this.swallow(e)};this.onTouchStart=e=>{let t=this.changed(e);if(!t.length)return;let n=!0;for(let o of t)this.inside(o.clientX,o.clientY)?this.touches.add(o.identifier):n=!1;n&&this.swallow(e)};this.onTouchFollow=e=>{let t=this.changed(e);t.length&&t.every(n=>this.touches.has(n.identifier))&&this.swallow(e)};this.onTouchEnd=e=>{let t=this.changed(e);if(!t.length)return;let n=t.every(o=>this.touches.has(o.identifier));for(let o of t)this.touches.delete(o.identifier);n&&this.swallow(e)};this.onMouseDown=e=>{this.inside(e.clientX,e.clientY)&&(this.mouseDown=!0,this.swallow(e))};this.onMouseFollow=e=>{this.mouseDown&&this.swallow(e)};this.onMouseUp=e=>{this.mouseDown&&(this.mouseDown=!1,this.swallow(e))};this.onClick=e=>{this.inside(e.clientX,e.clientY)&&this.swallow(e)}}set(e){this.rects=e.map(t=>({x:t.x,y:t.y,w:t.w,h:t.h})),this.rects.length||(this.pointers.clear(),this.touches.clear(),this.mouseDown=!1)}get(){return this.rects}attach(e){if(this.host===e)return;this.detach(),this.host=e;let t={capture:!0,passive:!1};e.addEventListener("pointerdown",this.onPointerDown,t),e.addEventListener("pointermove",this.onPointerFollow,t),e.addEventListener("pointerup",this.onPointerEnd,t),e.addEventListener("pointercancel",this.onPointerEnd,t),e.addEventListener("touchstart",this.onTouchStart,t),e.addEventListener("touchmove",this.onTouchFollow,t),e.addEventListener("touchend",this.onTouchEnd,t),e.addEventListener("touchcancel",this.onTouchEnd,t),e.addEventListener("mousedown",this.onMouseDown,t),e.addEventListener("mousemove",this.onMouseFollow,t),e.addEventListener("mouseup",this.onMouseUp,t),e.addEventListener("click",this.onClick,t),e.addEventListener("dblclick",this.onClick,t)}detach(){let e=this.host;if(!e)return;let t={capture:!0};e.removeEventListener("pointerdown",this.onPointerDown,t),e.removeEventListener("pointermove",this.onPointerFollow,t),e.removeEventListener("pointerup",this.onPointerEnd,t),e.removeEventListener("pointercancel",this.onPointerEnd,t),e.removeEventListener("touchstart",this.onTouchStart,t),e.removeEventListener("touchmove",this.onTouchFollow,t),e.removeEventListener("touchend",this.onTouchEnd,t),e.removeEventListener("touchcancel",this.onTouchEnd,t),e.removeEventListener("mousedown",this.onMouseDown,t),e.removeEventListener("mousemove",this.onMouseFollow,t),e.removeEventListener("mouseup",this.onMouseUp,t),e.removeEventListener("click",this.onClick,t),e.removeEventListener("dblclick",this.onClick,t),this.host=null,this.pointers.clear(),this.touches.clear(),this.mouseDown=!1}inside(e,t){if(!this.rects.length||!this.host)return!1;let n=this.host.getBoundingClientRect();return bp(this.rects,e-n.left,t-n.top)}swallow(e){e.stopImmediatePropagation(),e.stopPropagation(),e.cancelable&&e.preventDefault()}changed(e){let t=e.changedTouches;return t?Array.from(t):[]}},Or=.48,yp=8;function vp(i,e,t,n=Or){let o=Math.max(0,t.top),s=e.height-Math.max(0,t.bottom);if(!(s>o))return 0;let r=Number.isFinite(n)?Math.min(1,Math.max(0,n)):Or,a=o+(s-o)*r-i;return Math.abs(a)<=yp?0:Math.round(a)}function _r(i,e,t={}){let n=i.gestureCount();if(t.gestures!==void 0&&t.gestures!==n)return{dy:0,gestures:n};let o=i.seatPoint(e);if(!o)return{dy:0,gestures:n};let s=vp(o.y,{height:i.mapHeight()},i.insets(),t.fraction);return s?{dy:i.panScreenBy({x:0,y:s},t.animate!==!1)?s:0,gestures:n}:{dy:0,gestures:n}}var ii=class i{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let n=t!==void 0&&"mapTheme"in t;e===this.mode&&!n||(n&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return bt(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??i.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=Ei(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};import{getLocale as kp}from"@seatlayer/core";import{seatConfidenceDisclosure as Sp}from"@seatlayer/core/core/seatConfidence";import{generateSeatThumb as wp}from"@seatlayer/core";function Ht(i){let e=i.viewMeta?.previewUrl??i.viewUrl;return e&&(Qn(e)||bi(e))?e:null}function nn(i){if(!i)return!1;let e=i.floors?.length?i.floors.map(t=>t.objects??[]):[i.objects??[]];for(let t of e)for(let n of t)if(n.type==="shape"&&(n.role==="stage"||n.stageKind))return!0;return!1}var xp=512,tn=new Map;function on(i,e){if(!e)return null;let t=`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`,n=tn.get(t);if(n!==void 0)return n;let o=null;try{o=wp(i,e).distanceM??null}catch{o=null}return tn.size>=xp&&tn.clear(),tn.set(t,o),o}function ni(i){return i.getFocusedSection()!==null||i.seatsRevealed()}function Tp(i){let e=i.atVenueFit?.(),t=i.canZoomIn?.();return{...typeof e=="boolean"?{atVenueFit:e}:{},...typeof t=="boolean"?{canZoomIn:t}:{}}}function Ep(i,e){return{accessibilityFilter:i.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function Cp(i,e,t,n){for(let o of e){if(o.count<=0)continue;let s=i.accessibilitySpread?.([o.key]);for(let r of s?.sections??[]){let a=t.get(r.id)??n.get(r.id);if(!a||r.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[o.key]=r.free}}}function Nr(i,e,t){let n=i.doc,o=n?.theme??{},s=i.categoryAvailability(),r=i.getGAAreas(),a=i.getFloors(),l=i.getExpandedSeats(),c=i.getAccessNeeds(),d=Ep(c,l),u=e.seatPosition,m=u.targetSeatId?i.seatDetails(u.targetSeatId):null,p=new Map(l.map(y=>[y.id,y])),v=nn(n),g=n?.floors?.flatMap(y=>y.objects)??n?.objects??[],T=new Map,S=new Map;for(let y of g){if(y.type!=="section")continue;let P={id:y.id,label:y.label,...y.displayLabel?{displayLabel:y.displayLabel}:{},...y.zone?{zoneId:y.zone}:{}};T.set(y.id,P);let R=y.logicalSectionId??y.id;S.has(R)||S.set(R,P)}return Cp(i,c,T,S),{event:{key:t.event,name:t.eventInfo?.name??n?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:kp()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...o.accent?{accent:o.accent}:{},...o.accentInk?{accentInk:o.accentInk}:{},...o.background?{background:o.background}:{},...o.textColor?{textColor:o.textColor}:{},...o.brandName?{brandName:o.brandName}:{},...o.logoUrl?{logoUrl:o.logoUrl}:{},attributionRequired:!o.hideBadge},features:{ga:r.length>0,tiers:!!n?.categories.some(y=>y.tiers?.length),floors:a.length>1,zones:!!n?.zones?.length,sections:T.size>0,bestAvailable:!0,...d,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(n?.categories??[]).filter(y=>!y.notForSale).map(y=>({key:y.key,label:y.label,color:y.color,price:Le(t.hostPrices_,y.key,null,y.price??y.tiers?.[0]?.price??0),available:s[y.key]??0,...Object.prototype.hasOwnProperty.call(s,y.key)?{free:s[y.key]}:{},tiers:(y.tiers??[]).map(P=>({id:P.id,name:P.name,price:Le(t.hostPrices_,y.key,P.id,P.price),...P.currency?{currency:P.currency}:{}}))})),zones:(n?.zones??[]).map(y=>({id:y.id,label:y.label,...y.color?{color:y.color}:{}})),sections:[...T.values()],gaAreas:r,bestAvailableZones:i.getBestAvailableZones()},map:{floors:a,activeFloorId:i.getActiveFloorId()||a[0]?.id||null,floorMode:i.isFloorOverview()?"all":"single",floorLabelStyle:i.getRenderer()?.getFloorLabelStyle?.()??"number",rung:i.getRung(),canZoomOut:ni(i)||t.focusedSection_!==null,...Tp(i),focusedSectionId:i.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:i.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:u.targetSeatId,view3dTargetSeat:m,view3dPreviousSeatId:u.previousSeatId,view3dNextSeatId:u.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:i.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:i.getSelection().map(y=>{let P=t.hostPrices_||t.hostObjects_?{...y,price:Xi({prices:t.hostPrices_,objects:t.hostObjects_,seatPrices:n?.seatPrices},y.label,y.categoryKey,y.tierId,y.price)}:y,R=p.get(P.id);if(!R)return P;let G=i.worldToScreen({x:R.x,y:R.y}),f=Ht(R),L=v?on(R,R.focalPoint??n?.focalPoint):null;return{...P,screenPoint:{x:G.x,y:G.y},...f?{seatViewThumb:{reference:f,kind:"real"}}:{},...L!=null?{sightlineMetres:L}:{},...R.confidenceEvidence?{seatViewConfidence:Sp(R.confidenceEvidence)}:{}}}),validity:i.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var Op="https://api.seatlayer.io",Dr=10;function _p(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}var io=class{constructor(e){this.renderErrorEmitted=!1;this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=null;this.localeGeneration=0;this.languageSelect=null;this.rendered=!1;this.mode_=null;this.eventInfo=null;this.categoryFilter_=null;this.accessibilityFilter_=null;this.hideLimitedView_=!1;this.focusedSection_=null;this.lastReportedViewRung_=null;this.lastReportedCanZoomOut_=!1;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.blockedRegions=null;this.realtime=null;this.holdingLabels=new Set;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.container)throw new Error("seatmap: `container` is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");this.opts=e,this.maxSelection_=e.maxSelection??Dr,this.colorblindSafe_=e.colorblindSafe??!1,this.hostPrices_=e.pricing?.prices,this.hostObjects_=e.pricing?.objects;let t=!!(e.buyerAccessTokenProvider||e.buyerAccessToken||e.publicKey);this.accessState_={configured:t,status:t?"ready":"public"},this.publicKey=e.publicKey;let n={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},o=(e.apiBase??Op).replace(/\/+$/,"");this.apiBase=o;let s=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?zi({base:o,event:e.event,publicKey:e.publicKey,accessHooks:n,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=s?.access??ti(e,n);let r=s?.api??new _e(o,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=r,this.chartFetch=Bi(r),this.controller=new Ap({transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxSelection_,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.hostPriceRanges(),seatPriceLabel:a=>this.hostSeatPriceLabel(a.label),onSelectionChange:a=>{this.immersive?.pushLiveState(),this.opts.onSelectionChange?.(a)},onSelectionValidityChange:a=>this.opts.onSelectionValidityChange?.(a),onSelectionValid:a=>this.opts.onSelectionValid?.(a),onSelectionInvalid:a=>this.opts.onSelectionInvalid?.(a),onDeselect:a=>{this.controller.currentHold()?.labels.includes(a.label)&&this.controller.releaseLabels([a.label])},retapKeepsSelection:!0,onSeatRetap:a=>this.opts.onSeatRetap?.(a),onSelectionLimit:a=>this.opts.onSelectionLimit?.(a),onHold:a=>this.opts.onHold?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldRestored:a=>this.opts.onHoldRestored?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:a=>{let l=this.controller.getGAAreas().find(c=>c.id===a);l&&(this.opts.onGAClick?.(l),this.opts.onGAPrompt?.(mr(l,{room:(this.opts.maxSelection??Dr)-this.controller.getSelection().length,wheelchairOnly:this.controller.getAccessibilityFilter()?.includes("wheelchair")===!0,hold:(c,d)=>{this.holdGA(l.id,c,d?{tierId:d}:{})}})))},onError:a=>{this.renderErrorEmitted=!0,this.opts.onError?.(a)},onDeckTap:a=>{this.opts.onDeckTap?.(a),this.notifyMapStateChange()},onHint:a=>this.opts.onHint?.(a),onSectionFocus:a=>{this.focusedSection_=a,this.opts.onSectionFocus?.(a),this.notifyMapStateChange()},onViewChange:()=>this.handleViewChange(),onStatusChange:()=>{this.immersive?.pushLiveState(),this.opts.onStatusChange?.()},onSalesClosed:()=>{this.eventInfo&&(this.eventInfo.salesClosed=!0),this.opts.onSalesClosed?.()},flashOnLiveChange:!0,onSeatHover:a=>{this.opts.onSeatHover?.(a),this.opts.seatTooltip!==!1&&this.updateTooltip(a)},colorblindSafe:e.colorblindSafe,mapTheme:e.mapTheme??ii.groundFor(e.theme?.mode)??null}),this.hostSurface=new ii({mapTheme:()=>this.opts.mapTheme,setHostMapTheme:a=>{this.opts.mapTheme=a},applyMapTheme:a=>this.controller.setMapTheme(a),applyViewportInsets:a=>this.controller.setViewportInsets(a),readViewportInsets:()=>this.controller.getViewportInsets(),changed:()=>this.notifyMapStateChange()},e.theme?.mode??null),this.buyerAssetUrls=new Pt(e.event,(a,l)=>r.asset(a,l)),this.immersive=new Qi({host:()=>this.hostEl,doc:()=>this.controller.doc,seats:()=>this.controller.getExpandedSeats(),selection:()=>this.controller.getSelection(),status:a=>this.controller.getStatus(a),select:a=>this.controller.select([a]),deselect:a=>this.controller.deselect([a]),loadEventConfiguration:()=>this.controller.loadEventConfiguration(),resolveAsset:a=>this.buyerAssetUrls.resolve(a),enable3D:e.enable3D!==!1,enableSeatView:e.enableSeatView!==!1,max3DSeats:e.max3DSeats,...e.chrome?{chrome:e.chrome}:{},restoreMap:()=>this.controller.refitCurrentView(),onViewChange:(a,l)=>{this.opts.onBuyerViewChange?.({view:a,...l?{seatId:l}:{}}),this.notifyMapStateChange()},onSeatViewChange:a=>this.opts.onSeatViewChange?.(a),onError:a=>this.opts.onError?.(a)}),this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=ni(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=ni(this.controller);e===this.lastReportedViewRung_&&t===this.lastReportedCanZoomOut_||(this.lastReportedViewRung_=e,this.lastReportedCanZoomOut_=t,this.opts.onMapStateChange?.())}notifyMapStateChange(){this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=ni(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=Oi(this.opts.locale,this.opts.messages),n=this.localeGeneration+=1,o=to();this.mount=_p(this.opts.container);let s=document.createElement("div");s.style.width="100%",s.style.height="100%",s.style.position="relative",this.mount.appendChild(s),this.hostEl=s,this.blockedRegions?.attach(s),_i(s,t,a=>{a!==o&&this.applyActiveLocale(a,n)}),this.applyInteractionState(),this.renderErrorEmitted=!1;let r=await this.controller.render(s);if(!r){let a=Fi(this.chartFetch?.outcome(),this.renderErrorEmitted);return a&&Vi({apiBase:this.apiBase,eventKey:this.opts.event,reason:a}),ye({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:Ee(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(s),this}if(this.eventLocale=r.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(s),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=r.mode==="test"?"test":"live",this.eventInfo={name:r.eventName,venue:r.venue??null,startsAt:r.startsAt??null,timezone:r.timezone??null,currency:r.currency??this.opts.currency??"USD",posterUrl:r.posterUrl??null,salesClosed:r.salesClosed},this.opts.seatTooltip!==!1){let a=document.createElement("div");a.setAttribute("role","tooltip"),a.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);',s.appendChild(a),this.tipEl=a,this.onTipMove=l=>{let c=s.getBoundingClientRect();this.tipPos={x:l.clientX-c.left,y:l.clientY-c.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},s.addEventListener("mousemove",this.onTipMove)}if(r.mode==="test"&&this.opts.showTestModeIndicator!==!1){s.style.overflow="hidden";let a=document.createElement("div");a.dataset.slI18n="testMode",a.textContent=we("picker.testMode"),a.setAttribute("aria-label",we("picker.testMode")),a.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;",s.appendChild(a)}return this.buildBadge(s),ye({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:r.performanceProfile,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:Ai(this.opts.event),transport:"pubapi"}),this}buildBadge(e){if(this.controller.doc?.theme?.hideBadge)return;let t=document.createElement("a");t.dataset.slI18n="badge",t.href="https://seatlayer.io",t.target="_blank",t.rel="noopener noreferrer",t.setAttribute("aria-label",we("picker.poweredBy")),t.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);';let n=document.createElement("span");n.setAttribute("aria-hidden","true"),n.style.cssText="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee",n.innerHTML=qi;let o=document.createElement("span");o.textContent=we("picker.poweredBy"),t.append(n,o),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,n=this.tipEl.offsetHeight,o=this.tipPos.x+14,s=this.tipPos.y-n-12;o+t>e-8&&(o=this.tipPos.x-t-14),s<8&&(s=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,o)}px`,this.tipEl.style.top=`${Math.max(8,s)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=sn(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),n=document.createElement("div");n.style.cssText="font-weight:700;font-size:13px",n.textContent=e.label;let o=document.createElement("div");o.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let s=document.createElement("span");s.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",s.style.background=e.categoryColor;let r=document.createElement("span");r.textContent=e.categoryLabel;let a=document.createElement("span");if(a.style.cssText="margin-left:auto;font-weight:700;color:#fff",a.textContent=t,o.append(s,r,a),this.tipEl.replaceChildren(n,o),e.status!=="free"){let l=document.createElement("div");l.style.cssText="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700",l.textContent=we("picker.group.legendUnavailable"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(o=>Hp(o)).filter((o,s,r)=>r.indexOf(o)===s);if(t.length<2)return;let n=document.createElement("select");n.setAttribute("aria-label",we("picker.preferredTicketType")),n.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let o of t){let s=document.createElement("option");s.value=o,s.textContent=Mp[o]??o,s.selected=o===to(),n.appendChild(s)}n.addEventListener("change",()=>{this.setLocale(n.value)}),e.appendChild(n),this.languageSelect=n}async setLocale(e){let t=to(),n=this.localeGeneration+=1,o=await Pp(e);return this.opts.messages&&Ip(this.opts.messages),o===t||this.applyActiveLocale(o,n),o}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let n=this.hostEl;if(n){n.lang=e,n.dir=Lp(e);for(let o of n.querySelectorAll("[data-sl-i18n]"))if(o.dataset.slI18n==="testMode")o.textContent=we("picker.testMode"),o.setAttribute("aria-label",we("picker.testMode"));else if(o.dataset.slI18n==="badge"){o.setAttribute("aria-label",we("picker.poweredBy"));let s=o.querySelector("span:last-child");s&&(s.textContent=we("picker.poweredBy"))}this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return Nr(this.controller,this.immersive,{event:this.opts.event,currency:this.opts.currency,mode_:this.mode_,eventInfo:this.eventInfo,eventLocale:this.eventLocale,focusedSection_:this.focusedSection_,colorblindSafe_:this.colorblindSafe_,categoryFilter_:this.categoryFilter_,accessibilityFilter_:this.accessibilityFilter_,hideLimitedView_:this.hideLimitedView_,maxSelection_:this.maxSelection_,accessState_:this.accessState_,hostPrices_:this.hostPrices_,hostObjects_:this.hostObjects_})}getHostPrices(){return this.hostPrices_}getHostPricing(){return{prices:this.hostPrices_,objects:this.hostObjects_,seatPrices:this.controller.doc?.seatPrices}}getCategoryAvailability(){return this.controller.categoryAvailability()}getBestAvailableZones(){return this.controller.getBestAvailableZones()}getActiveFloorId(){return this.controller.getActiveFloorId()||null}getRung(){return this.controller.getRung()}getFocusedSection(){return this.controller.getFocusedSection()}focusSection(e){if(this.immersive.buyerView==="venue3d"&&this.immersive.focusSection(e)){this.notifyMapStateChange();return}this.controller.focusSection(e),this.notifyMapStateChange()}overview(){if(this.immersive.focusOverview()){this.notifyMapStateChange();return}this.controller.overview(),this.notifyMapStateChange()}setRung(e){this.controller.setRung(e),this.notifyMapStateChange()}setCategoryFilter(e,t=!1){this.categoryFilter_=e?[...e]:null,this.controller.setCategoryFilter(e),t&&this.controller.focusCategoryFilter(e),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.notifyMapStateChange(),e?.length&&this.focusAccessibilityFilter()}focusAccessibilityFilter(){this.controller.focusAccessibilityFilter?.(),this.notifyMapStateChange()}focusNextAccessibleSection(e){let t=this.controller.focusNextAccessibleSection?.(e)??null;return t&&this.notifyMapStateChange(),t}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let n=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(n?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:n?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(n=>n.label));try{let n=await this.controller.hold(void 0,e.ttlMs);return n?{holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items}:null}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,n={}){try{return await this.holdGAOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async holdGAOrThrow(e,t,n={}){let o=await this.controller.holdGA(e,t,n);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}async bestAvailable(e,t,n={}){try{return await this.bestAvailableOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async bestAvailableOrThrow(e,t,n={}){let o=Ii(this.controller,t);if(o)throw o;let s=await this.controller.bestAvailable(e,t,n);return Rr(this.controller,s),s?{holdId:s.holdId,expiresAt:s.expiresAt,labels:s.labels,seats:s.seats,items:s.items,...n.zoneId?{zoneId:n.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,n){try{return await this.replaceTableQuantityOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async replaceTableQuantityOrThrow(e,t,n){let o=await this.controller.replaceTableQuantity(e,t,n);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.immersive.buyerView==="venue3d"&&e!=="all"&&this.immersive.focusFloor(e)){this.notifyMapStateChange();return}if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}e==="all"?this.controller.setFloorOverview(!0):this.controller.setFloor(e),this.notifyMapStateChange()}setFloorLabelStyle(e){this.controller.getRenderer()?.setFloorLabelStyle?.(e),this.notifyMapStateChange()}setSectionFocusDim(e){this.controller.setSectionFocusDim(e)}setSelectionFocus(e){this.controller.setSelectionFocus(e)}setBlockedRegions(e){if(!this.blockedRegions){if(!e.length)return;this.blockedRegions=new en,this.hostEl&&this.blockedRegions.attach(this.hostEl)}this.blockedRegions.set(e)}getBlockedRegions(){return this.blockedRegions?.get()??[]}frameSeat(e,t={}){let n=this.controller.getRenderer();return _r({seatPoint:o=>{let s=this.controller.getExpandedSeats().find(r=>r.id===o);return s?this.controller.worldToScreen({x:s.x,y:s.y}):null},mapHeight:()=>this.hostEl?.clientHeight??0,insets:()=>this.controller.getViewportInsets(),gestureCount:()=>n?.getCameraGestureCount?.()??0,panScreenBy:(o,s)=>n?.panScreenBy?(n.panScreenBy(o,{animate:s}),!0):!1},e,t)}setPricing(e){let t=e?.prices&&Object.keys(e.prices).length?e.prices:void 0,n=e?.objects&&Object.keys(e.objects).length?e.objects:void 0;JSON.stringify([t??null,n??null])!==JSON.stringify([this.hostPrices_??null,this.hostObjects_??null])&&(this.hostPrices_=t,this.hostObjects_=n,this.controller.getRenderer()?.setCategoryPriceRanges?.(this.hostPriceRanges()),this.notifyMapStateChange())}hostSeatPriceLabel(e){let t=Rp(this.hostObjects_,e);if(t===void 0)return;let n=typeof t=="number"?[t]:Object.values(t.tiers);if(!n.length)return;let o=this.eventInfo?.currency??this.opts.currency??"USD",s=Math.min(...n),r=Math.max(...n);return r>s?`${sn(s,o)}\u2013${sn(r,o)}`:sn(s,o)}hostPriceRanges(){let e=this.hostPrices_;if(e)return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(t=>{let n=t.tiers?.length?t.tiers.map(o=>Le(e,t.key,o.id,o.price)):t.price==null?[]:[Le(e,t.key,null,t.price)];return n.length?[[t.key,{min:Math.min(...n),max:Math.max(...n)}]]:[]}))}setColorblindSafe(e){this.colorblindSafe_=e,this.controller.setColorblindSafe(e),this.notifyMapStateChange()}setViewMode(e){this.controller.setViewMode(e),this.notifyMapStateChange()}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.immersive.zoomIn()||(this.controller.zoomIn(),this.notifyMapStateChange())}zoomOut(){this.immersive.zoomOut()||(this.controller.zoomOut(),this.notifyMapStateChange())}zoomToFit(){this.immersive.focusOverview()||(this.controller.zoomToFit(),this.notifyMapStateChange())}setThemeMode(e,t){this.hostSurface.setThemeMode(e,t)}getThemeMode(){return this.hostSurface.themeMode()}setViewportInsets(e){this.hostSurface.setViewportInsets(e)}getViewportInsets(){return this.hostSurface.viewportInsets()}setBuyerView(e,t){return this.immersive.setBuyerView(e,t)}getBuyerView(){return this.immersive.buyerView}openSeatView(e){return this.immersive.openSeatView(e)}setVenue3DNavigationMode(e){if(!this.immersive.setNavigationMode(e))throw new Error("venue_3d_not_active")}setInteractionEnabled(e){this.interactionEnabled_=e,this.applyInteractionState()}applyInteractionState(){let e=this.hostEl;e&&(e.style.pointerEvents=this.interactionEnabled_?"":"none",e.toggleAttribute("inert",!this.interactionEnabled_),this.interactionEnabled_?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true"))}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new Ce({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:Yt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.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;';let n=document.createElement("div");n.textContent="The seat map didn\u2019t load.",t.appendChild(n);let o=document.createElement("button");o.type="button",o.textContent="Try again",o.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;",o.addEventListener("click",()=>{this.destroy(),this.render().catch(s=>this.opts.onError?.(s))}),t.appendChild(o),e.appendChild(t)}destroy(){this.blockedRegions?.detach(),this.hostSurface.dispose(),this.immersive.destroy(),this.buyerAssetUrls.dispose(),this.realtime?.stop(),this.realtime=null,this.access?.clear(),this.hostEl&&this.onTipMove&&this.hostEl.removeEventListener("mousemove",this.onTipMove),this.tipEl=null,this.onTipMove=null,this.languageSelect=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,this.eventInfo=null,this.focusedSection_=null}};var Br=["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"],Np={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 Dp(i){let e={};for(let t of Br)e[t]=(...n)=>{let o=i();return o?o[t](...n):Np[t]()};return e}var Fr=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Vr=[...Fr,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],$r=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function Bp(i,e,t){let n={container:i};for(let o of Vr)n[o]=e[o];for(let o of $r)n[o]=t[o];return n}var Fp=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),Vp=2e4,$p=0,zp=180*1e3,jp=900*1e3,Gp=.8,Kp=30*1e3,Up=1e5,qp=4,Wp=50;function no(i){if(typeof i!="string")return i;let e=document.querySelector(i);if(!e)throw new Error(`EmbeddedDesigner container not found: ${i}`);return e}function Yp(i){let e=(i??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var Zp={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 \u2014 try again."},load:{title:"We couldn't load the designer",body:"Something went wrong while opening the editor. Please try again."}},oo=class{constructor(e){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;let t=e.data;if(t.type==="seatlayer.designer.handshake"&&typeof t.nonce=="string"&&t.nonce.length<=128){this.frame.contentWindow?.postMessage({type:"seatlayer.designer.parent",nonce:t.nonce},this.designerOrigin);return}if(t.type==="seatlayer.designer.resize"){!this.fillEnabled()&&this.autoResizeEnabled()&&typeof t.px=="number"&&Number.isFinite(t.px)&&t.px>0&&(this.lastAutoHeight=`${Math.round(t.px)}px`,this.pinned||this.setFrameHeight(this.lastAutoHeight));return}if(t.type==="seatlayer.designer.fullscreen"){t.on===!0?this.pinFullscreen():t.on===!1&&this.unpinFullscreen();return}if(typeof t.type!="string"||!Fp.has(t.type))return;let n={type:t.type,chartId:typeof t.chartId=="string"?t.chartId:void 0,workspaceId:typeof t.workspaceId=="string"?t.workspaceId:void 0,expiresAt:typeof t.expiresAt=="number"?t.expiresAt:void 0,code:typeof t.code=="string"?t.code:void 0,message:typeof t.message=="string"?t.message:void 0,meta:t.meta,fatal:typeof t.fatal=="boolean"?t.fatal:void 0,action:typeof t.action=="string"?t.action:void 0},o=this.identityEstablished||n.type==="seatlayer.designer.ready"||n.type==="seatlayer.designer.saved"||n.type==="seatlayer.designer.published"||n.type==="seatlayer.designer.close",s=this.options.expectedChartId!==void 0&&n.chartId!==this.options.expectedChartId&&(o||n.chartId!==void 0),r=this.options.expectedWorkspaceId!==void 0&&n.workspaceId!==this.options.expectedWorkspaceId&&(o||n.workspaceId!==void 0);if(s||r){this.showError("mismatch");return}switch(n.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=n.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(n.expiresAt),this.options.onReady?.(n);break;case"seatlayer.designer.saved":this.options.onSaved?.(n);break;case"seatlayer.designer.published":this.options.onPublished?.(n);break;case"seatlayer.designer.close":this.options.onClose?.(n);break;case"seatlayer.designer.error":{let a=Yp(n.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof n.fatal=="boolean"?n.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(n);break}}};this.options=e}mount(){this.destroy();let e=new URL(this.options.designerUrl,window.location.href);if(e.protocol!=="https:"&&e.hostname!=="localhost"&&e.hostname!=="127.0.0.1")throw new Error("EmbeddedDesigner requires an HTTPS designerUrl outside local development.");this.designerOrigin=e.origin;let t=document.createElement("iframe");t.title=this.options.title??"Venue chart Designer",t.allow=this.options.allow??"fullscreen; clipboard-write",t.referrerPolicy=this.options.referrerPolicy??"origin",t.src=e.toString(),t.style.setProperty("width","100%","important"),t.style.setProperty("height",typeof this.options.height=="number"?`${this.options.height}px`:"100%","important"),t.style.border="0",Object.assign(t.style,this.options.style),this.options.className&&(t.className=this.options.className);let n=no(this.options.container);if(this.containerEl=n,window.addEventListener("message",this.handleMessage),n.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(n),this.renderOverlay(n,"loading");let o=this.options.loadingTimeoutMs??Vp;o>0&&Number.isFinite(o)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},o))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.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(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let n=()=>e.getBoundingClientRect().height,o=t.style.getPropertyValue("height"),s=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let r=n();t.style.setProperty("height",`${Up}px`,"important");let a=n();return o?t.style.setProperty("height",o,s):t.style.removeProperty("height"),!(a-r>qp)&&r>=Wp?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??$p;if(this.fillMode==="container"&&this.containerEl){let o=getComputedStyle(this.containerEl),s=["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"].reduce((a,l)=>a+(parseFloat(o[l])||0),0),r=Math.max(e,Math.floor(this.containerEl.getBoundingClientRect().height-s));this.setFrameHeight(`${r}px`);return}let t=this.frame.getBoundingClientRect().top,n=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${n}px`)}syncContainerObserver(){let e=this.fillMode==="container"&&!!this.containerEl&&typeof ResizeObserver<"u";e&&!this.resizeObs?(this.resizeObs=new ResizeObserver(()=>this.scheduleFill()),this.resizeObs.observe(this.containerEl)):!e&&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");let e={position:"fixed",top:"0",right:"0",bottom:"0",left:"0",width:"100vw",height:"100vh",margin:"0",border:"0","z-index":"2147483000",background:"#101625"};for(let[n,o]of Object.entries(e))this.frame.style.setProperty(n,o,"important");let 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=n=>{n.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(e){if(this.clearRenewTimer(),!this.autoRenewEnabled()||typeof e!="number"||!Number.isFinite(e))return;let t=e-Date.now();if(t<=0)return;let n=t<jp?t*Gp:t-zp,o=Math.max(Kp,n);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},o)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{no(this.options.container).style.position=this.restoreContainerPosition}catch{}this.restoreContainerPosition=null}}removeOverlay(){this.overlay?.remove(),this.overlay=null}showError(e){if(this.phase="error",this.clearTimeoutTimer(),!this.loadingStateEnabled())return;let t;try{t=no(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,n){this.removeOverlay();let o=document.createElement("div");o.setAttribute("data-seatlayer-designer-overlay",t),o.setAttribute("role",t==="error"?"alert":"status"),o.setAttribute("aria-live","polite"),Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:t==="loading"?"#f7f8fb":"#101625",color:t==="loading"?"#0c1220":"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:t==="error"?"auto":"hidden"}),t==="loading"?this.buildSkeleton(o):this.buildErrorCard(o,n??"load"),e.append(o),this.overlay=o}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
3325
+ `;function Ne(){if(document.getElementById(ya))return;let n=document.createElement("style");n.id=ya,n.textContent=Th+ua+ha+la+ma+da+pa+ba+ca+Gr,document.head.appendChild(n)}async function Mi(n,e){let t=n.overlay.productionElements;if(!t?.some(o=>o.contentImageUrl))return n;let i=await Promise.all(t.map(async o=>{if(!o.contentImageUrl)return o;try{let s=await e(o.contentImageUrl);if(!s){let{contentImageUrl:r,...a}=o;return a}return{...o,runtimeContentImageUrl:s}}catch{let{contentImageUrl:s,...r}=o;return r}}));return{...n,overlay:{...n.overlay,productionElements:i}}}async function Hi(n,e){if(n)try{let t=await e(n);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}import{browserPanoramaConstraints as Eh,loadPanoramaImage as Ch,planPanoramaDelivery as Ah,schedulePanoramaUpgrade as Ph}from"@seatlayer/core/view/panoramaDelivery";function Ri(n){let{root:e,source:t,caption:i,real:o,closeLabel:s,dragHint:r,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:d,onClose:h}=n,m=n.chrome??{},u=document.createElement("div");u.className="sl-view sl-mo-zoom",u.setAttribute("role","dialog"),u.setAttribute("aria-label",a),u.innerHTML='<div class="sl-view-head"><span class="sl-view-title"></span><span class="sl-view-cap"></span><button type="button" class="sl-view-x"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div><div class="sl-view-pano"><span class="sl-view-badge"></span><span class="sl-view-hint"></span></div>';let g=V=>u.querySelector(V)?.remove();m.title===!1?g(".sl-view-title"):u.querySelector(".sl-view-title").textContent=a,m.caption===!1?g(".sl-view-cap"):u.querySelector(".sl-view-cap").textContent=i,u.querySelector(".sl-view-x").setAttribute("aria-label",s),m.badge===!1?g(".sl-view-badge"):u.querySelector(".sl-view-badge").textContent=o?l:c,u.querySelector(".sl-view-hint").textContent=r,e.appendChild(u);let b=u.querySelector(".sl-view-pano"),T=Ah(t,Eh()),S=new AbortController;b.style.backgroundImage=`url(${JSON.stringify(T.initialUrl)})`;let x=()=>{};T.upgradeUrl&&(x=Ph(()=>{d(T.upgradeUrl).then(V=>!V||S.signal.aborted?null:Ch(V,S.signal).then(()=>V)).then(V=>{!V||!u.isConnected||S.signal.aborted||(b.style.backgroundImage=`url(${JSON.stringify(V)})`)}).catch(()=>{})}));let P=70,_=35,U=1,R=b.clientHeight||1,f=b.clientWidth||1,I=-(R*(180/P)*2/2-f/2),L=0,O=()=>{let V=b.clientHeight||1,Ot=V*(180/P)*U,Ge=Math.max(0,Ot-V),_s=Math.min(Ge/2,_/180*Ot);L=Math.min(_s,Math.max(-_s,L)),b.style.backgroundSize=`auto ${Ot}px`,b.style.backgroundPosition=`${I}px ${L-Ge/2}px`};O();let N=!1,M=0,G=0,q=V=>{N=!0,M=V.clientX,G=V.clientY,b.classList.add("drag"),b.setPointerCapture?.(V.pointerId)},X=V=>{N&&(I+=V.clientX-M,L+=V.clientY-G,M=V.clientX,G=V.clientY,O())},me=V=>{N=!1,b.classList.remove("drag"),b.releasePointerCapture?.(V.pointerId)},fe=V=>{V.preventDefault(),U=Math.min(2.4,Math.max(1,U+(V.deltaY<0?.12:-.12))),O()};b.addEventListener("pointerdown",q),b.addEventListener("pointermove",X),b.addEventListener("pointerup",me),b.addEventListener("pointercancel",me),b.addEventListener("wheel",fe,{passive:!1});let ye=u.querySelector(".sl-view-x");ye.addEventListener("click",h);let Ke=V=>{V.key==="Escape"&&(V.stopPropagation(),h())};return u.addEventListener("keydown",Ke),ye.focus(),{element:u,dispose(){x(),S.abort(),b.removeEventListener("pointerdown",q),b.removeEventListener("pointermove",X),b.removeEventListener("pointerup",me),b.removeEventListener("pointercancel",me),b.removeEventListener("wheel",fe),u.removeEventListener("keydown",Ke),ye.removeEventListener("click",h)}}}function Hh(n,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=n.find(s=>s.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let i=n.filter(s=>s.rowId===t.rowId),o=i.findIndex(s=>s.id===e);return{targetSeatId:e,previousSeatId:o>0?i[o-1].id:null,nextSeatId:o>=0&&o+1<i.length?i[o+1].id:null}}var va=6e4,Ii=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.focusedSectionId_=null;this.navigationMode_="auto";this.overlay=null;this.handle=null;this.generation=0;this.seatViewGeneration=0;this.seatViewElement=null;this.seatViewDispose=null;this.navigationPinned_=!1;this.options=e}get buyerView(){return this.buyerView_}get targetSeatId(){return this.targetSeatId_}get focusedSectionId(){return this.focusedSectionId_}get seatPosition(){return Hh(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_==="auto"?"orbit":this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!si()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),i=this.options.host(),o=this.options.doc();if(!t||!i||!o)throw new Error("seat_view_unavailable");let s=++this.seatViewGeneration,r,a,l=!1;if(t.viewUrl){let g=t.viewMeta?.previewUrl,b=!!g&&g!==t.viewUrl,T=b?await this.options.resolveAsset(g):null,S=b?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(s!==this.seatViewGeneration||!S||b&&!T)return;r={url:S,...T?{previewUrl:T}:{},...b?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}},a=Mh(r),l=Lh(r)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:g}=await ai();if(s!==this.seatViewGeneration)return;let b=o.floors?.find(x=>x.objects.some(P=>P.type==="row"&&P.id===t.rowId)),T=t.focalPoint??b?.focalPoint??o.focalPoint,S=g(t,T,[...this.options.seats()]);r={url:S.url,generated:!0},a=bt("picker.illustrationCaption",{m:S.distanceM})}if(s!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(i,o),Ne();let c=this.options.chrome??{},d=ht(),h=bt("picker.viewFromSeat",{label:t.displayLabel||t.label}),m=l?bt("picker.real360"):bt("picker.preview"),u=Ri({root:i,source:r,caption:a,real:l,closeLabel:y("picker.close","Close"),dragHint:d,viewFromSeatLabel:h,real360Label:bt("picker.real360"),previewLabel:bt("picker.preview"),chrome:{title:c.seatViewTitle,caption:c.seatViewCaption,badge:c.seatViewBadge},resolveAsset:this.options.resolveAsset,onClose:()=>this.closeSeatView(!0,!0)});this.seatViewElement=u.element,this.seatViewDispose=u.dispose,this.options.onSeatViewChange?.({seatId:t.id,title:h,caption:a,badge:m,real:l,generated:!!r.generated,dragHint:d})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let i=t.floors.findIndex(o=>o.id===e);return i>=0&&this.handle.focusFloor(i)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}applyNavigationMode(e){this.navigationMode_==="auto"&&!this.navigationPinned_||e.setNavigationMode(this.navigationMode_)}setNavigationMode(e){return e!=="auto"&&(this.navigationPinned_=!0),this.navigationMode_=e,this.buyerView_!=="venue3d"||!this.handle?!1:(this.applyNavigationMode(this.handle),this.options.onViewChange(this.buyerView_,this.targetSeatId_),!0)}destroy(){this.generation+=1,this.closeSeatView(!0,!1);try{this.handle?.dispose()}catch{}this.handle=null,this.overlay?.remove(),this.overlay=null,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null}max3DSeats(){let e=this.options.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?va/2:va}async enter3D(e){let t=this.options.host(),i=this.options.doc();if(!t||!i||this.overlay)throw new Error("venue_3d_unavailable");Ne(),this.prepareHostTheme(t,i);let o=document.createElement("div");o.className="sl-view3d",o.setAttribute("role","group"),o.setAttribute("aria-label",y("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(o.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let s=document.createElement("div");s.className="sl-view3d-loading",s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),s.textContent=y("picker.loading3d","Building the 3D venue\u2026"),o.appendChild(s),t.appendChild(o),this.overlay=o;let r=++this.generation;if(this.reducedMotion()?o.style.opacity="1":requestAnimationFrame(()=>{o.style.opacity="1"}),await this.nextPaint(),!(r!==this.generation||this.overlay!==o))try{let[a,l]=await Promise.all([kn(),this.options.loadEventConfiguration()]),c=l?await Mi(l,this.options.resolveAsset):null,d=await Hi(i.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(r!==this.generation||this.overlay!==o)return;let h={doc:i,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};s.textContent=bt("picker.building3d");let m=await a.prepareVenue3D(h);if(r!==this.generation||this.overlay!==o)return;let u=this.options.chrome??{},g=a.mountVenue3D(o,{...h,prepared:m},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:ht(),navLabels:ii(),...u.view3dCaption===!1||u.view3dSeatStepper===!1||u.view3dControlDock===!1?{chrome:{caption:u.view3dCaption!==!1,seatStepper:u.view3dSeatStepper!==!1,controlDock:u.view3dControlDock!==!1}}:{},seatViewActionLabel:b=>this.findSeat(b)?.viewUrl?y("picker.openAuthored360","Open venue 360\xB0"):y("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:b=>this.toggleSeat(b),onSeatInspect:b=>this.toggleSeat(b),onViewTargetChange:b=>{this.targetSeatId_=b,b&&(this.focusedSectionId_=this.findSeat(b)?.sectionId??null),this.options.onViewChange("venue3d",b)},onSectionFocusChange:b=>{this.focusedSectionId_=b,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:b=>this.seatViewFor3D(b)}:{}});if(r!==this.generation||this.overlay!==o){g.dispose();return}this.handle=g,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,this.applyNavigationMode(g),requestAnimationFrame(()=>s.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await g.flyToSeat(e)}catch(a){if(r!==this.generation)return;throw this.options.onError?.(a),this.remove3DOverlay(!1),a}}exit3D(){this.buyerView_==="map"&&!this.overlay||(this.generation+=1,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null,this.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let i=this.handle,o=this.overlay;if(this.options.restoreMap(),t&&i&&o){o.style.pointerEvents="none";let s=()=>{this.buyerView_!=="map"||this.overlay!==o||(o.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(o.style.opacity="0",s()):(requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(s,280));return}if(this.handle=null,this.overlay=null,!o){try{i?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{i?.dispose()}catch{}o.remove(),this.options.restoreMap();return}o.style.pointerEvents="none",requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(()=>{try{i?.dispose()}catch{}o.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,i=this.handle;if(!t||!i)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),i.resize(),this.applyNavigationMode(i),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await i.flyToSeat(e.flyToSeatId):e.resetView&&i.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(o=>o.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let i=t.viewMeta?.previewUrl,o=!!i&&i!==t.viewUrl,s=o?await this.options.resolveAsset(i):null,r=o?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!r||o&&!s)throw new Error("seat_view_unavailable");return{url:r,...s?{previewUrl:s}:{},...o?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:y("picker.chartDerivedModel","Chart-derived model")}}closeSeatView(e=!0,t=!1){e&&(this.seatViewGeneration+=1);let i=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!i){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){i.remove();return}i.classList.add("is-leaving"),setTimeout(()=>i.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(i=>i.objects)??e.objects).some(i=>i.type==="shape"&&(i.role==="stage"||!!i.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let i=t.theme;e.style.setProperty("--sl-bg",i?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",i?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",i?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",i?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};import{seatPriceFor as wa}from"@seatlayer/core";function De(n,e,t,i){let o=e?n?.[e]:void 0;return o===void 0?i:typeof o=="number"?o:t&&o.tiers?.[t]!==void 0?o.tiers[t]:o.base??i}function Oi(n,e,t,i,o){let s=wa(n?.objects,e,i);return s!==void 0?s:wa(n?.seatPrices,e,i)!==void 0?o:De(n?.prices,t,i,o)}function _i(n){if(!n)return null;let e=n.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function Rh(n){return _i(n.foot?.querySelector(".sl-total"))??_i(n.tray)??_i(n.sheetHead)}function $o(n,e,t,i,o){let s=n,r=s.map;if(!r||!e){o?.();return}let a=r.getBoundingClientRect(),l={x:a.left+e.x,y:a.top+e.y},c=t.displayLabel??t.label,d=i?.find(m=>m.key===t.categoryKey)?.color,h=()=>{let m=Rh(s);if(!m){o?.();return}Yr({from:l,to:{x:m.left+m.width/2,y:m.top+m.height/2},label:c,color:d,onArrive:o})};s.sheetHead&&_i(s.sheetHead)?requestAnimationFrame(h):h()}var Vo=60,Ih=650;function xa(n,e){if(!e.length||n.focusSeats?.(e.map(o=>o.id)))return;let t=e.find(o=>o.sectionId)?.sectionId;if(!t)return;let i=e.filter(o=>o.sectionId===t);n.focus(t,{x:i.reduce((o,s)=>o+s.x,0)/i.length,y:i.reduce((o,s)=>o+s.y,0)/i.length})}function ka(n,e){let t=!Ci();xa({focusSeats:i=>n.focusSeats?.(i,{animate:t})===!0,focus:(i,o)=>n.focusSection(i,o)},(e?.items??[]).filter(i=>i.objectType!=="ga").slice(0,10).map(i=>n.seatByLabel(i.label)).filter(i=>!!i))}function Sa(n,e){if(!e.length)return;let t=n.reducedMotion===!0;t||e.forEach((r,a)=>{n.schedule(()=>n.pop(r.id),a*Vo)});let i=t?0:e.length*Vo,o=e.find(r=>r.sectionId)?.sectionId;if(n.schedule(()=>xa(n,e),i),t)return;let s=i+(n.focusSeats||o?Ih:0);e.forEach((r,a)=>{n.schedule(()=>$o(n.regions,n.screenPoint(r),r,n.categories),s+a*Vo)})}function Oh(n,e,t){for(let i of n)if(e>=i.x&&t>=i.y&&e<=i.x+i.w&&t<=i.y+i.h)return!0;return!1}var Ni=class{constructor(){this.rects=[];this.host=null;this.pointers=new Set;this.touches=new Set;this.mouseDown=!1;this.onPointerDown=e=>{this.inside(e.clientX,e.clientY)&&(this.pointers.add(e.pointerId),this.swallow(e))};this.onPointerFollow=e=>{this.pointers.has(e.pointerId)&&this.swallow(e)};this.onPointerEnd=e=>{this.pointers.delete(e.pointerId)&&this.swallow(e)};this.onTouchStart=e=>{let t=this.changed(e);if(!t.length)return;let i=!0;for(let o of t)this.inside(o.clientX,o.clientY)?this.touches.add(o.identifier):i=!1;i&&this.swallow(e)};this.onTouchFollow=e=>{let t=this.changed(e);t.length&&t.every(i=>this.touches.has(i.identifier))&&this.swallow(e)};this.onTouchEnd=e=>{let t=this.changed(e);if(!t.length)return;let i=t.every(o=>this.touches.has(o.identifier));for(let o of t)this.touches.delete(o.identifier);i&&this.swallow(e)};this.onMouseDown=e=>{this.inside(e.clientX,e.clientY)&&(this.mouseDown=!0,this.swallow(e))};this.onMouseFollow=e=>{this.mouseDown&&this.swallow(e)};this.onMouseUp=e=>{this.mouseDown&&(this.mouseDown=!1,this.swallow(e))};this.onClick=e=>{this.inside(e.clientX,e.clientY)&&this.swallow(e)}}set(e){this.rects=e.map(t=>({x:t.x,y:t.y,w:t.w,h:t.h})),this.rects.length||(this.pointers.clear(),this.touches.clear(),this.mouseDown=!1)}get(){return this.rects}attach(e){if(this.host===e)return;this.detach(),this.host=e;let t={capture:!0,passive:!1};e.addEventListener("pointerdown",this.onPointerDown,t),e.addEventListener("pointermove",this.onPointerFollow,t),e.addEventListener("pointerup",this.onPointerEnd,t),e.addEventListener("pointercancel",this.onPointerEnd,t),e.addEventListener("touchstart",this.onTouchStart,t),e.addEventListener("touchmove",this.onTouchFollow,t),e.addEventListener("touchend",this.onTouchEnd,t),e.addEventListener("touchcancel",this.onTouchEnd,t),e.addEventListener("mousedown",this.onMouseDown,t),e.addEventListener("mousemove",this.onMouseFollow,t),e.addEventListener("mouseup",this.onMouseUp,t),e.addEventListener("click",this.onClick,t),e.addEventListener("dblclick",this.onClick,t)}detach(){let e=this.host;if(!e)return;let t={capture:!0};e.removeEventListener("pointerdown",this.onPointerDown,t),e.removeEventListener("pointermove",this.onPointerFollow,t),e.removeEventListener("pointerup",this.onPointerEnd,t),e.removeEventListener("pointercancel",this.onPointerEnd,t),e.removeEventListener("touchstart",this.onTouchStart,t),e.removeEventListener("touchmove",this.onTouchFollow,t),e.removeEventListener("touchend",this.onTouchEnd,t),e.removeEventListener("touchcancel",this.onTouchEnd,t),e.removeEventListener("mousedown",this.onMouseDown,t),e.removeEventListener("mousemove",this.onMouseFollow,t),e.removeEventListener("mouseup",this.onMouseUp,t),e.removeEventListener("click",this.onClick,t),e.removeEventListener("dblclick",this.onClick,t),this.host=null,this.pointers.clear(),this.touches.clear(),this.mouseDown=!1}inside(e,t){if(!this.rects.length||!this.host)return!1;let i=this.host.getBoundingClientRect();return Oh(this.rects,e-i.left,t-i.top)}swallow(e){e.stopImmediatePropagation(),e.stopPropagation(),e.cancelable&&e.preventDefault()}changed(e){let t=e.changedTouches;return t?Array.from(t):[]}},Ta=.48,_h=8;function Nh(n,e,t,i=Ta){let o=Math.max(0,t.top),s=e.height-Math.max(0,t.bottom);if(!(s>o))return 0;let r=Number.isFinite(i)?Math.min(1,Math.max(0,i)):Ta,a=o+(s-o)*r-n;return Math.abs(a)<=_h?0:Math.round(a)}function Ea(n,e,t={}){let i=n.gestureCount();if(t.gestures!==void 0&&t.gestures!==i)return{dy:0,gestures:i};let o=n.seatPoint(e);if(!o)return{dy:0,gestures:i};let s=Nh(o.y,{height:n.mapHeight()},n.insets(),t.fraction);return s?{dy:n.panScreenBy({x:0,y:s},t.animate!==!1)?s:0,gestures:i}:{dy:0,gestures:i}}var Ln=class n{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let i=t!==void 0&&"mapTheme"in t;e===this.mode&&!i||(i&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return _t(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??n.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=Jn(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};import{getLocale as Fh}from"@seatlayer/core";import{seatConfidenceDisclosure as Vh}from"@seatlayer/core/core/seatConfidence";import{generateSeatThumb as Dh}from"@seatlayer/core";function Yt(n){let e=n.viewMeta?.previewUrl??n.viewUrl;return e&&(Bo(e)||Nt(e))?e:null}function Bi(n){if(!n)return!1;let e=n.floors?.length?n.floors.map(t=>t.objects??[]):[n.objects??[]];for(let t of e)for(let i of t)if(i.type==="shape"&&(i.role==="stage"||i.stageKind))return!0;return!1}var Bh=512,Di=new Map;function Fi(n,e){if(!e)return null;let t=`${n.id}|${Math.round(e.x)},${Math.round(e.y)}`,i=Di.get(t);if(i!==void 0)return i;let o=null;try{o=Dh(n,e).distanceM??null}catch{o=null}return Di.size>=Bh&&Di.clear(),Di.set(t,o),o}function Mn(n){return n.getFocusedSection()!==null||n.seatsRevealed()}function $h(n){let e=n.atVenueFit?.(),t=n.canZoomIn?.();return{...typeof e=="boolean"?{atVenueFit:e}:{},...typeof t=="boolean"?{canZoomIn:t}:{}}}function zh(n,e){return{accessibilityFilter:n.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function jh(n,e,t,i){for(let o of e){if(o.count<=0)continue;let s=n.accessibilitySpread?.([o.key]);for(let r of s?.sections??[]){let a=t.get(r.id)??i.get(r.id);if(!a||r.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[o.key]=r.free}}}function Ca(n,e,t){let i=n.doc,o=i?.theme??{},s=n.categoryAvailability(),r=n.getGAAreas(),a=n.getFloors(),l=n.getExpandedSeats(),c=n.getAccessNeeds(),d=zh(c,l),h=e.seatPosition,m=h.targetSeatId?n.seatDetails(h.targetSeatId):null,u=new Map(l.map(x=>[x.id,x])),g=Bi(i),b=i?.floors?.flatMap(x=>x.objects)??i?.objects??[],T=new Map,S=new Map;for(let x of b){if(x.type!=="section")continue;let P={id:x.id,label:x.label,...x.displayLabel?{displayLabel:x.displayLabel}:{},...x.zone?{zoneId:x.zone}:{}};T.set(x.id,P);let _=x.logicalSectionId??x.id;S.has(_)||S.set(_,P)}return jh(n,c,T,S),{event:{key:t.event,name:t.eventInfo?.name??i?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:Fh()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...o.accent?{accent:o.accent}:{},...o.accentInk?{accentInk:o.accentInk}:{},...o.background?{background:o.background}:{},...o.textColor?{textColor:o.textColor}:{},...o.brandName?{brandName:o.brandName}:{},...o.logoUrl?{logoUrl:o.logoUrl}:{},attributionRequired:!o.hideBadge},features:{ga:r.length>0,tiers:!!i?.categories.some(x=>x.tiers?.length),floors:a.length>1,zones:!!i?.zones?.length,sections:T.size>0,bestAvailable:!0,...d,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(i?.categories??[]).filter(x=>!x.notForSale).map(x=>({key:x.key,label:x.label,color:x.color,price:De(t.hostPrices_,x.key,null,x.price??x.tiers?.[0]?.price??0),available:s[x.key]??0,...Object.prototype.hasOwnProperty.call(s,x.key)?{free:s[x.key]}:{},tiers:(x.tiers??[]).map(P=>({id:P.id,name:P.name,price:De(t.hostPrices_,x.key,P.id,P.price),...P.currency?{currency:P.currency}:{}}))})),zones:(i?.zones??[]).map(x=>({id:x.id,label:x.label,...x.color?{color:x.color}:{}})),sections:[...T.values()],gaAreas:r,bestAvailableZones:n.getBestAvailableZones()},map:{floors:a,activeFloorId:n.getActiveFloorId()||a[0]?.id||null,floorMode:n.isFloorOverview()?"all":"single",floorLabelStyle:n.getRenderer()?.getFloorLabelStyle?.()??"number",rung:n.getRung(),canZoomOut:Mn(n)||t.focusedSection_!==null,...$h(n),focusedSectionId:n.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:n.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:h.targetSeatId,view3dTargetSeat:m,view3dPreviousSeatId:h.previousSeatId,view3dNextSeatId:h.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:n.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:n.getSelection().map(x=>{let P=t.hostPrices_||t.hostObjects_?{...x,price:Oi({prices:t.hostPrices_,objects:t.hostObjects_,seatPrices:i?.seatPrices},x.label,x.categoryKey,x.tierId,x.price)}:x,_=u.get(P.id);if(!_)return P;let U=n.worldToScreen({x:_.x,y:_.y}),R=Yt(_),f=g?Fi(_,_.focalPoint??i?.focalPoint):null;return{...P,screenPoint:{x:U.x,y:U.y},...R?{seatViewThumb:{reference:R,kind:"real"}}:{},...f!=null?{sightlineMetres:f}:{},..._.confidenceEvidence?{seatViewConfidence:Vh(_.confidenceEvidence)}:{}}}),validity:n.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var Xh="https://api.seatlayer.io",Pa=10;function Qh(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}var zo=class{constructor(e){this.renderErrorEmitted=!1;this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=null;this.localeGeneration=0;this.paintedLocale=null;this.languageSelect=null;this.rendered=!1;this.mode_=null;this.eventInfo=null;this.categoryFilter_=null;this.accessibilityFilter_=null;this.hideLimitedView_=!1;this.focusedSection_=null;this.lastReportedViewRung_=null;this.lastReportedCanZoomOut_=!1;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.blockedRegions=null;this.realtime=null;this.holdingLabels=new Set;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.container)throw new Error("seatmap: `container` is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");this.opts=e,this.maxSelection_=e.maxSelection??Pa,this.colorblindSafe_=e.colorblindSafe??!1,this.hostPrices_=e.pricing?.prices,this.hostObjects_=e.pricing?.objects;let t=!!(e.buyerAccessTokenProvider||e.buyerAccessToken||e.publicKey);this.accessState_={configured:t,status:t?"ready":"public"},this.publicKey=e.publicKey;let i={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},o=(e.apiBase??Xh).replace(/\/+$/,"");this.apiBase=o;let s=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Ei({base:o,event:e.event,publicKey:e.publicKey,accessHooks:i,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=s?.access??Pn(e,i);let r=s?.api??new Ue(o,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=r,this.chartFetch=xi(r),this.controller=new Kh({transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxSelection_,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.hostPriceRanges(),seatPriceLabel:a=>this.hostSeatPriceLabel(a.label),onSelectionChange:a=>{this.immersive?.pushLiveState(),this.opts.onSelectionChange?.(a)},onSelectionValidityChange:a=>this.opts.onSelectionValidityChange?.(a),onSelectionValid:a=>this.opts.onSelectionValid?.(a),onSelectionInvalid:a=>this.opts.onSelectionInvalid?.(a),onDeselect:a=>{this.controller.currentHold()?.labels.includes(a.label)&&this.controller.releaseLabels([a.label])},retapKeepsSelection:!0,onSeatRetap:a=>this.opts.onSeatRetap?.(a),onSelectionLimit:a=>this.opts.onSelectionLimit?.(a),onHold:a=>this.opts.onHold?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldRestored:a=>this.opts.onHoldRestored?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:a=>{let l=this.controller.getGAAreas().find(c=>c.id===a);l&&(this.opts.onGAClick?.(l),this.opts.onGAPrompt?.(oa(l,{room:(this.opts.maxSelection??Pa)-this.controller.getSelection().length,wheelchairOnly:this.controller.getAccessibilityFilter()?.includes("wheelchair")===!0,hold:(c,d)=>{this.holdGA(l.id,c,d?{tierId:d}:{})}})))},onError:a=>{this.renderErrorEmitted=!0,this.opts.onError?.(a)},onDeckTap:a=>{this.opts.onDeckTap?.(a),this.notifyMapStateChange()},onHint:a=>this.opts.onHint?.(a),onSectionFocus:a=>{this.focusedSection_=a,this.opts.onSectionFocus?.(a),this.notifyMapStateChange()},onViewChange:()=>this.handleViewChange(),onStatusChange:()=>{this.immersive?.pushLiveState(),this.opts.onStatusChange?.()},onSalesClosed:()=>{this.eventInfo&&(this.eventInfo.salesClosed=!0),this.opts.onSalesClosed?.()},flashOnLiveChange:!0,onSeatHover:a=>{this.opts.onSeatHover?.(a),this.opts.seatTooltip!==!1&&this.updateTooltip(a)},colorblindSafe:e.colorblindSafe,mapTheme:e.mapTheme??Ln.groundFor(e.theme?.mode)??null}),this.hostSurface=new Ln({mapTheme:()=>this.opts.mapTheme,setHostMapTheme:a=>{this.opts.mapTheme=a},applyMapTheme:a=>this.controller.setMapTheme(a),applyViewportInsets:a=>this.controller.setViewportInsets(a),readViewportInsets:()=>this.controller.getViewportInsets(),changed:()=>this.notifyMapStateChange()},e.theme?.mode??null),this.buyerAssetUrls=new Wt(e.event,(a,l)=>r.asset(a,l)),this.immersive=new Ii({host:()=>this.hostEl,doc:()=>this.controller.doc,seats:()=>this.controller.getExpandedSeats(),selection:()=>this.controller.getSelection(),status:a=>this.controller.getStatus(a),select:a=>this.controller.select([a]),deselect:a=>this.controller.deselect([a]),loadEventConfiguration:()=>this.controller.loadEventConfiguration(),resolveAsset:a=>this.buyerAssetUrls.resolve(a),enable3D:e.enable3D!==!1,enableSeatView:e.enableSeatView!==!1,max3DSeats:e.max3DSeats,...e.chrome?{chrome:e.chrome}:{},restoreMap:()=>this.controller.refitCurrentView(),onViewChange:(a,l)=>{this.opts.onBuyerViewChange?.({view:a,...l?{seatId:l}:{}}),this.notifyMapStateChange()},onSeatViewChange:a=>this.opts.onSeatViewChange?.(a),onError:a=>this.opts.onError?.(a)}),this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=Mn(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=Mn(this.controller);e===this.lastReportedViewRung_&&t===this.lastReportedCanZoomOut_||(this.lastReportedViewRung_=e,this.lastReportedCanZoomOut_=t,this.opts.onMapStateChange?.())}notifyMapStateChange(){this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=Mn(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=bi(this.opts.locale,this.opts.messages),i=this.localeGeneration+=1;this.paintedLocale=Aa(),this.mount=Qh(this.opts.container);let o=document.createElement("div");o.style.width="100%",o.style.height="100%",o.style.position="relative",this.mount.appendChild(o),this.hostEl=o,this.blockedRegions?.attach(o),yi(o,t,r=>{r!==this.paintedLocale&&this.applyActiveLocale(r,i)}),this.applyInteractionState(),this.renderErrorEmitted=!1;let s=await this.controller.render(o);if(!s){let r=ki(this.chartFetch?.outcome(),this.renderErrorEmitted);return r&&Si({apiBase:this.apiBase,eventKey:this.opts.event,reason:r}),Ee({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:Re(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(o),this}if(this.eventLocale=s.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(o),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=s.mode==="test"?"test":"live",this.eventInfo={name:s.eventName,venue:s.venue??null,startsAt:s.startsAt??null,timezone:s.timezone??null,currency:s.currency??this.opts.currency??"USD",posterUrl:s.posterUrl??null,salesClosed:s.salesClosed},this.opts.seatTooltip!==!1){let r=document.createElement("div");r.setAttribute("role","tooltip"),r.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);',o.appendChild(r),this.tipEl=r,this.onTipMove=a=>{let l=o.getBoundingClientRect();this.tipPos={x:a.clientX-l.left,y:a.clientY-l.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},o.addEventListener("mousemove",this.onTipMove)}if(s.mode==="test"&&this.opts.showTestModeIndicator!==!1){o.style.overflow="hidden";let r=document.createElement("div");r.dataset.slI18n="testMode",r.textContent=Zt("picker.testMode"),r.setAttribute("aria-label",Zt("picker.testMode")),r.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;",o.appendChild(r)}return Ee({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:s.performanceProfile,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:ti(this.opts.event),transport:"pubapi"}),this}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,o=this.tipPos.x+14,s=this.tipPos.y-i-12;o+t>e-8&&(o=this.tipPos.x-t-14),s<8&&(s=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,o)}px`,this.tipEl.style.top=`${Math.max(8,s)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=Vi(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),i=document.createElement("div");i.style.cssText="font-weight:700;font-size:13px",i.textContent=e.label;let o=document.createElement("div");o.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let s=document.createElement("span");s.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",s.style.background=e.categoryColor;let r=document.createElement("span");r.textContent=e.categoryLabel;let a=document.createElement("span");if(a.style.cssText="margin-left:auto;font-weight:700;color:#fff",a.textContent=t,o.append(s,r,a),this.tipEl.replaceChildren(i,o),e.status!=="free"){let l=document.createElement("div");l.style.cssText="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700",l.textContent=Zt("picker.group.legendUnavailable"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(o=>Wh(o)).filter((o,s,r)=>r.indexOf(o)===s);if(t.length<2)return;let i=document.createElement("select");i.setAttribute("aria-label",Zt("picker.preferredTicketType")),i.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let o of t){let s=document.createElement("option");s.value=o,s.textContent=qh[o]??o,s.selected=o===Aa(),i.appendChild(s)}i.addEventListener("change",()=>{this.setLocale(i.value)}),e.appendChild(i),this.languageSelect=i}async setLocale(e){let t=this.localeGeneration+=1,i=await Gh(e);return this.opts.messages&&Zh(this.opts.messages),i===this.paintedLocale||this.applyActiveLocale(i,t),i}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let i=this.hostEl;if(i){this.paintedLocale=e,i.lang=e,i.dir=Uh(e);for(let o of i.querySelectorAll("[data-sl-i18n]"))o.dataset.slI18n==="testMode"&&(o.textContent=Zt("picker.testMode"),o.setAttribute("aria-label",Zt("picker.testMode")));gi(i),this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return Ca(this.controller,this.immersive,{event:this.opts.event,currency:this.opts.currency,mode_:this.mode_,eventInfo:this.eventInfo,eventLocale:this.eventLocale,focusedSection_:this.focusedSection_,colorblindSafe_:this.colorblindSafe_,categoryFilter_:this.categoryFilter_,accessibilityFilter_:this.accessibilityFilter_,hideLimitedView_:this.hideLimitedView_,maxSelection_:this.maxSelection_,accessState_:this.accessState_,hostPrices_:this.hostPrices_,hostObjects_:this.hostObjects_})}getHostPrices(){return this.hostPrices_}getHostPricing(){return{prices:this.hostPrices_,objects:this.hostObjects_,seatPrices:this.controller.doc?.seatPrices}}getCategoryAvailability(){return this.controller.categoryAvailability()}getBestAvailableZones(){return this.controller.getBestAvailableZones()}getActiveFloorId(){return this.controller.getActiveFloorId()||null}getRung(){return this.controller.getRung()}getFocusedSection(){return this.controller.getFocusedSection()}focusSection(e){if(this.immersive.buyerView==="venue3d"&&this.immersive.focusSection(e)){this.notifyMapStateChange();return}this.controller.focusSection(e),this.notifyMapStateChange()}overview(){if(this.immersive.focusOverview()){this.notifyMapStateChange();return}this.controller.overview(),this.notifyMapStateChange()}setRung(e){this.controller.setRung(e),this.notifyMapStateChange()}setCategoryFilter(e,t=!1){this.categoryFilter_=e?[...e]:null,this.controller.setCategoryFilter(e),t&&this.controller.focusCategoryFilter(e),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.notifyMapStateChange(),e?.length&&this.focusAccessibilityFilter()}focusAccessibilityFilter(){this.controller.focusAccessibilityFilter?.(),this.notifyMapStateChange()}focusNextAccessibleSection(e){let t=this.controller.focusNextAccessibleSection?.(e)??null;return t&&this.notifyMapStateChange(),t}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let i=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(i?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:i?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(i=>i.label));try{let i=await this.controller.hold(void 0,e.ttlMs);return i?{holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}:null}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,i={}){try{return await this.holdGAOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async holdGAOrThrow(e,t,i={}){let o=await this.controller.holdGA(e,t,i);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async bestAvailableOrThrow(e,t,i={}){let o=fi(this.controller,t);if(o)throw o;let s=await this.controller.bestAvailable(e,t,i);return ka(this.controller,s),s?{holdId:s.holdId,expiresAt:s.expiresAt,labels:s.labels,seats:s.seats,items:s.items,...i.zoneId?{zoneId:i.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,i){try{return await this.replaceTableQuantityOrThrow(e,t,i)}catch(o){return this.opts.onError?.(o),null}}async replaceTableQuantityOrThrow(e,t,i){let o=await this.controller.replaceTableQuantity(e,t,i);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.immersive.buyerView==="venue3d"&&e!=="all"&&this.immersive.focusFloor(e)){this.notifyMapStateChange();return}if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}e==="all"?this.controller.setFloorOverview(!0):this.controller.setFloor(e),this.notifyMapStateChange()}setFloorLabelStyle(e){this.controller.getRenderer()?.setFloorLabelStyle?.(e),this.notifyMapStateChange()}setSectionFocusDim(e){this.controller.setSectionFocusDim(e)}setSelectionFocus(e){this.controller.setSelectionFocus(e)}setBlockedRegions(e){if(!this.blockedRegions){if(!e.length)return;this.blockedRegions=new Ni,this.hostEl&&this.blockedRegions.attach(this.hostEl)}this.blockedRegions.set(e)}getBlockedRegions(){return this.blockedRegions?.get()??[]}frameSeat(e,t={}){let i=this.controller.getRenderer();return Ea({seatPoint:o=>{let s=this.controller.getExpandedSeats().find(r=>r.id===o);return s?this.controller.worldToScreen({x:s.x,y:s.y}):null},mapHeight:()=>this.hostEl?.clientHeight??0,insets:()=>this.controller.getViewportInsets(),gestureCount:()=>i?.getCameraGestureCount?.()??0,panScreenBy:(o,s)=>i?.panScreenBy?(i.panScreenBy(o,{animate:s}),!0):!1},e,t)}setPricing(e){let t=e?.prices&&Object.keys(e.prices).length?e.prices:void 0,i=e?.objects&&Object.keys(e.objects).length?e.objects:void 0;JSON.stringify([t??null,i??null])!==JSON.stringify([this.hostPrices_??null,this.hostObjects_??null])&&(this.hostPrices_=t,this.hostObjects_=i,this.controller.getRenderer()?.setCategoryPriceRanges?.(this.hostPriceRanges()),this.notifyMapStateChange())}hostSeatPriceLabel(e){let t=Yh(this.hostObjects_,e);if(t===void 0)return;let i=typeof t=="number"?[t]:Object.values(t.tiers);if(!i.length)return;let o=this.eventInfo?.currency??this.opts.currency??"USD",s=Math.min(...i),r=Math.max(...i);return r>s?`${Vi(s,o)}\u2013${Vi(r,o)}`:Vi(s,o)}hostPriceRanges(){let e=this.hostPrices_;if(e)return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(t=>{let i=t.tiers?.length?t.tiers.map(o=>De(e,t.key,o.id,o.price)):t.price==null?[]:[De(e,t.key,null,t.price)];return i.length?[[t.key,{min:Math.min(...i),max:Math.max(...i)}]]:[]}))}setColorblindSafe(e){this.colorblindSafe_=e,this.controller.setColorblindSafe(e),this.notifyMapStateChange()}setViewMode(e){this.controller.setViewMode(e),this.notifyMapStateChange()}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.immersive.zoomIn()||(this.controller.zoomIn(),this.notifyMapStateChange())}zoomOut(){this.immersive.zoomOut()||(this.controller.zoomOut(),this.notifyMapStateChange())}zoomToFit(){this.immersive.focusOverview()||(this.controller.zoomToFit(),this.notifyMapStateChange())}setThemeMode(e,t){this.hostSurface.setThemeMode(e,t)}getThemeMode(){return this.hostSurface.themeMode()}setViewportInsets(e){this.hostSurface.setViewportInsets(e)}getViewportInsets(){return this.hostSurface.viewportInsets()}setBuyerView(e,t){return this.immersive.setBuyerView(e,t)}getBuyerView(){return this.immersive.buyerView}openSeatView(e){return this.immersive.openSeatView(e)}setVenue3DNavigationMode(e){if(!this.immersive.setNavigationMode(e))throw new Error("venue_3d_not_active")}setInteractionEnabled(e){this.interactionEnabled_=e,this.applyInteractionState()}applyInteractionState(){let e=this.hostEl;e&&(e.style.pointerEvents=this.interactionEnabled_?"":"none",e.toggleAttribute("inert",!this.interactionEnabled_),this.interactionEnabled_?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true"))}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new Ie({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:vn(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.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;';let i=document.createElement("div");i.textContent=y("picker.mapDidNotLoad","The seat map didn\u2019t load"),i.dataset.slT="picker.mapDidNotLoad",t.appendChild(i);let o=document.createElement("button");o.type="button",o.textContent=y("picker.accessRetry","Try again"),o.dataset.slT="picker.accessRetry",o.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;",o.addEventListener("click",()=>{this.destroy(),this.render().catch(s=>this.opts.onError?.(s))}),t.appendChild(o),e.appendChild(t)}destroy(){this.blockedRegions?.detach(),this.hostSurface.dispose(),this.immersive.destroy(),this.buyerAssetUrls.dispose(),this.realtime?.stop(),this.realtime=null,this.access?.clear(),this.hostEl&&this.onTipMove&&this.hostEl.removeEventListener("mousemove",this.onTipMove),this.tipEl=null,this.onTipMove=null,this.languageSelect=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,this.eventInfo=null,this.focusedSection_=null}};var La=["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"],Jh={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 eu(n){let e={};for(let t of La)e[t]=(...i)=>{let o=n();return o?o[t](...i):Jh[t]()};return e}var Ma=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Ha=[...Ma,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],Ra=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function tu(n,e,t){let i={container:n};for(let o of Ha)i[o]=e[o];for(let o of Ra)i[o]=t[o];return i}var nu=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),iu=2e4,ou=0,su=180*1e3,ru=900*1e3,au=.8,lu=30*1e3,cu=1e5,du=4,pu=50;function jo(n){if(typeof n!="string")return n;let e=document.querySelector(n);if(!e)throw new Error(`EmbeddedDesigner container not found: ${n}`);return e}function hu(n){let e=(n??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var uu={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 \u2014 try again."},load:{title:"We couldn't load the designer",body:"Something went wrong while opening the editor. Please try again."}},Ko=class{constructor(e){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;let t=e.data;if(t.type==="seatlayer.designer.handshake"&&typeof t.nonce=="string"&&t.nonce.length<=128){this.frame.contentWindow?.postMessage({type:"seatlayer.designer.parent",nonce:t.nonce},this.designerOrigin);return}if(t.type==="seatlayer.designer.resize"){!this.fillEnabled()&&this.autoResizeEnabled()&&typeof t.px=="number"&&Number.isFinite(t.px)&&t.px>0&&(this.lastAutoHeight=`${Math.round(t.px)}px`,this.pinned||this.setFrameHeight(this.lastAutoHeight));return}if(t.type==="seatlayer.designer.fullscreen"){t.on===!0?this.pinFullscreen():t.on===!1&&this.unpinFullscreen();return}if(typeof t.type!="string"||!nu.has(t.type))return;let i={type:t.type,chartId:typeof t.chartId=="string"?t.chartId:void 0,workspaceId:typeof t.workspaceId=="string"?t.workspaceId:void 0,expiresAt:typeof t.expiresAt=="number"?t.expiresAt:void 0,code:typeof t.code=="string"?t.code:void 0,message:typeof t.message=="string"?t.message:void 0,meta:t.meta,fatal:typeof t.fatal=="boolean"?t.fatal:void 0,action:typeof t.action=="string"?t.action:void 0},o=this.identityEstablished||i.type==="seatlayer.designer.ready"||i.type==="seatlayer.designer.saved"||i.type==="seatlayer.designer.published"||i.type==="seatlayer.designer.close",s=this.options.expectedChartId!==void 0&&i.chartId!==this.options.expectedChartId&&(o||i.chartId!==void 0),r=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(o||i.workspaceId!==void 0);if(s||r){this.showError("mismatch");return}switch(i.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=i.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(i.expiresAt),this.options.onReady?.(i);break;case"seatlayer.designer.saved":this.options.onSaved?.(i);break;case"seatlayer.designer.published":this.options.onPublished?.(i);break;case"seatlayer.designer.close":this.options.onClose?.(i);break;case"seatlayer.designer.error":{let a=hu(i.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof i.fatal=="boolean"?i.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(i);break}}};this.options=e}mount(){this.destroy();let e=new URL(this.options.designerUrl,window.location.href);if(e.protocol!=="https:"&&e.hostname!=="localhost"&&e.hostname!=="127.0.0.1")throw new Error("EmbeddedDesigner requires an HTTPS designerUrl outside local development.");this.designerOrigin=e.origin;let t=document.createElement("iframe");t.title=this.options.title??"Venue chart Designer",t.allow=this.options.allow??"fullscreen; clipboard-write",t.referrerPolicy=this.options.referrerPolicy??"origin",t.src=e.toString(),t.style.setProperty("width","100%","important"),t.style.setProperty("height",typeof this.options.height=="number"?`${this.options.height}px`:"100%","important"),t.style.border="0",Object.assign(t.style,this.options.style),this.options.className&&(t.className=this.options.className);let i=jo(this.options.container);if(this.containerEl=i,window.addEventListener("message",this.handleMessage),i.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(i),this.renderOverlay(i,"loading");let o=this.options.loadingTimeoutMs??iu;o>0&&Number.isFinite(o)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},o))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.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(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let i=()=>e.getBoundingClientRect().height,o=t.style.getPropertyValue("height"),s=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let r=i();t.style.setProperty("height",`${cu}px`,"important");let a=i();return o?t.style.setProperty("height",o,s):t.style.removeProperty("height"),!(a-r>du)&&r>=pu?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??ou;if(this.fillMode==="container"&&this.containerEl){let o=getComputedStyle(this.containerEl),s=["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"].reduce((a,l)=>a+(parseFloat(o[l])||0),0),r=Math.max(e,Math.floor(this.containerEl.getBoundingClientRect().height-s));this.setFrameHeight(`${r}px`);return}let t=this.frame.getBoundingClientRect().top,i=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${i}px`)}syncContainerObserver(){let e=this.fillMode==="container"&&!!this.containerEl&&typeof ResizeObserver<"u";e&&!this.resizeObs?(this.resizeObs=new ResizeObserver(()=>this.scheduleFill()),this.resizeObs.observe(this.containerEl)):!e&&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");let e={position:"fixed",top:"0",right:"0",bottom:"0",left:"0",width:"100vw",height:"100vh",margin:"0",border:"0","z-index":"2147483000",background:"#101625"};for(let[i,o]of Object.entries(e))this.frame.style.setProperty(i,o,"important");let 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=i=>{i.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(e){if(this.clearRenewTimer(),!this.autoRenewEnabled()||typeof e!="number"||!Number.isFinite(e))return;let t=e-Date.now();if(t<=0)return;let i=t<ru?t*au:t-su,o=Math.max(lu,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},o)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{jo(this.options.container).style.position=this.restoreContainerPosition}catch{}this.restoreContainerPosition=null}}removeOverlay(){this.overlay?.remove(),this.overlay=null}showError(e){if(this.phase="error",this.clearTimeoutTimer(),!this.loadingStateEnabled())return;let t;try{t=jo(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,i){this.removeOverlay();let o=document.createElement("div");o.setAttribute("data-seatlayer-designer-overlay",t),o.setAttribute("role",t==="error"?"alert":"status"),o.setAttribute("aria-live","polite"),Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:t==="loading"?"#f7f8fb":"#101625",color:t==="loading"?"#0c1220":"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:t==="error"?"auto":"hidden"}),t==="loading"?this.buildSkeleton(o):this.buildErrorCard(o,i??"load"),e.append(o),this.overlay=o}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
3329
3326
  [data-seatlayer-designer-overlay="loading"]{container-type:inline-size}
3330
3327
  .sl-designer-skeleton{position:absolute;inset:0;display:flex;flex-direction:column;pointer-events:none}
3331
3328
  .sl-designer-skeleton *{box-sizing:border-box}
@@ -3342,13 +3339,13 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3342
3339
  @container (max-width:899px){.sl-designer-skeleton-inspector{display:none}}
3343
3340
  @container (max-width:420px){.sl-designer-skeleton-caption{padding:12px;gap:8px}.sl-designer-skeleton-caption small{display:none}}
3344
3341
  @media(prefers-reduced-motion:no-preference){@keyframes sl-designer-spin{to{transform:rotate(360deg)}}.sl-designer-skeleton-spinner{animation:sl-designer-spin 1s linear infinite}}
3345
- `,e.append(t);let n=document.createElement("div");n.className="sl-designer-skeleton",n.innerHTML=`<div class="sl-designer-skeleton-top" aria-hidden="true"><span class="sl-designer-skeleton-bar"></span></div>
3342
+ `,e.append(t);let i=document.createElement("div");i.className="sl-designer-skeleton",i.innerHTML=`<div class="sl-designer-skeleton-top" aria-hidden="true"><span class="sl-designer-skeleton-bar"></span></div>
3346
3343
  <div class="sl-designer-skeleton-body">
3347
3344
  <div class="sl-designer-skeleton-rail" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></div>
3348
3345
  <div class="sl-designer-skeleton-canvas"><div class="sl-designer-skeleton-caption"><span class="sl-designer-skeleton-spinner" aria-hidden="true"></span><span>Loading designer\u2026<small>Preparing your floor plan</small></span></div></div>
3349
3346
  <div class="sl-designer-skeleton-inspector" aria-hidden="true"><div class="sl-designer-skeleton-bar"></div></div>
3350
- </div>`,e.append(n)}buildErrorCard(e,t){let n=Zp[t],o=document.createElement("div");Object.assign(o.style,{maxWidth:"420px",margin:"auto 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)"});let s=document.createElement("h2");s.textContent=n.title,Object.assign(s.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let r=document.createElement("p");r.textContent=n.body,Object.assign(r.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let 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()),o.append(s,r,a),e.append(o)}};function Rt(i,e){let t=document.createElement("div");t.className="sl-loading-state";let n=document.createElement("div");if(n.setAttribute("role",e.busy?"status":"alert"),n.setAttribute("aria-atomic","true"),e.busy){let r=document.createElement("div");r.className="sl-boot-spin",r.setAttribute("aria-hidden","true"),t.append(r)}let o=document.createElement("div");if(o.className="sl-boot-title",o.textContent=e.title,n.append(o),e.description){let r=document.createElement("p");r.className="sl-loading-description",r.textContent=e.description,n.append(r)}t.append(n);let s=null;return e.actionLabel&&(s=document.createElement("button"),s.type="button",s.className="sl-boot-retry",s.textContent=e.actionLabel,t.append(s)),i.replaceChildren(t),s}function Qp(i){let{viewportWidth:e,viewportHeight:t,offsetTop:n,offsetLeft:o,clientWidth:s,clientHeight:r,innerHeight:a,largeViewportHeight:l}=i;if(![e,t,n,o].every(Number.isFinite)||e<=0||t<=0)return null;let c=Number.isFinite(s)&&s>0?s:e,d=Number.isFinite(r)&&r>0?r:t,u=n;return Number.isFinite(l)&&a>l+1&&d<l-1&&(u=Math.max(u,l-d)),{width:Math.min(e,c),height:Math.min(t,d),top:u,left:o}}function zr(i){let e=window.visualViewport;if(!e)return()=>{};let t=document.createElement("div");t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",visibility:"hidden",pointerEvents:"none",width:"0",height:"100lvh",overflow:"hidden"}),document.body.appendChild(t);let n=()=>{let c=Qp({viewportWidth:e.width,viewportHeight:e.height,offsetTop:e.offsetTop,offsetLeft:e.offsetLeft,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight,innerHeight:window.innerHeight,largeViewportHeight:t.getBoundingClientRect().height});c&&Object.assign(i.style,{right:"auto",bottom:"auto",top:`${c.top}px`,left:`${c.left}px`,width:`${c.width}px`,height:`${c.height}px`})},o=0,s=0,r=0,a=()=>{o&&window.cancelAnimationFrame(o),s&&window.cancelAnimationFrame(s),r&&window.clearTimeout(r),o=window.requestAnimationFrame(()=>{o=0,s=window.requestAnimationFrame(()=>{s=0,n()})}),r=window.setTimeout(()=>{r=0,n()},250)},l=()=>{n(),a()};return l(),e.addEventListener("resize",l),e.addEventListener("scroll",l),window.addEventListener("resize",l),window.addEventListener("orientationchange",l),window.addEventListener("pageshow",l),()=>{o&&window.cancelAnimationFrame(o),s&&window.cancelAnimationFrame(s),r&&window.clearTimeout(r),e.removeEventListener("resize",l),e.removeEventListener("scroll",l),window.removeEventListener("resize",l),window.removeEventListener("orientationchange",l),window.removeEventListener("pageshow",l),t.remove()}}function jr(i,e){let t=new Set(["chart","objects","resume","availability"]),n=new Map;return new Proxy(Object.create(i),{get(o,s){let r=i,a=Reflect.get(r,s,r);return typeof a!="function"?a:(n.has(s)||n.set(s,t.has(String(s))?async(...l)=>{let c=await wt(()=>a.apply(r,l),e,()=>{});if(c.outcome==="loaded")return c.value;if(c.outcome==="error")throw c.error;let d=new Error(c.outcome==="timeout"?"request_timeout":"request_cancelled");throw d.name=c.outcome==="timeout"?"TimeoutError":"AbortError",d}:a.bind(r)),n.get(s))}})}import{PickerController as Su,effectiveFloorOverview as Tu,formatMoney as Eu,getLocale as En,loadLocale as Cu,setStringOverrides as Au,t as N,tCount as ai,seatPriceFor as hc}from"@seatlayer/core";import{isAuthoredSeatView as Pu,seatViewDisclosure as Lu}from"@seatlayer/core/view3d/crossfade/panorama";function Gr(i){return!!i&&i.clientWidth>0&&i.scrollWidth>i.clientWidth+1}function Xp(i){return i.some(e=>Gr(e))}var rn="data-fit-gone",Jp=12;function so(i,e,t=Gr){if(!i)return 0;for(let n of e)i.classList.remove(n.cls);if(i.querySelectorAll(`[${rn}]`).forEach(n=>{n.removeAttribute(rn),n.hidden=!1}),i.dataset.fit="0",i.clientWidth<=0||!t(i))return 0;for(let n=0;n<e.length;n+=1){let o=e[n];n>0&&i.classList.remove(e[n-1].cls),i.classList.add(o.cls),i.dataset.fit=String(n+1);let s=o.give?o.give(i):!0;if(!t(i))return n+1;if(o.repeat&&o.give){for(let r=1;s&&r<Jp;r+=1)if(s=o.give(i),!t(i))return n+1}}return e.length}function eh(i,e="[data-fit-seg]"){let t=[...i.querySelectorAll(e)].filter(n=>!n.hidden);return t.length<2?!1:Kr(t[t.length-1])}function th(i,e){let t=i.querySelector(e);return t&&!t.hidden?Kr(t):!1}function Kr(i){let e=i.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(rn,""),e.hidden=!0),i.setAttribute(rn,""),i.hidden=!0,!0}function ih(i){if(!i)return!1;let e=(i.getAttribute("aria-label")||i.textContent||"").trim();return e?(i.setAttribute("aria-label",e),i.setAttribute("title",e),!0):!1}function Ur(i){if(!i)return 0;let e=i.querySelector(".sl-confirm-cancel"),t=i.querySelector(".sl-confirm-add-t");return so(i,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>ih(e)}],()=>Xp([e,t]))}function qr(i){return so(i,[{cls:"sl-fit-notype",give:e=>th(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>eh(e),repeat:!0}])}function Wr(i){return i?(i.classList.add("sl-fitpill"),so(i,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var It;function Yr(i){if(!i)return!1;delete i.dataset.fit;let e=i.selectedOptions?.[0]?.textContent??i.options[i.selectedIndex]?.textContent??"",t=i.clientWidth;if(!e||!t)return!1;if(It===void 0)try{It=document.createElement("canvas").getContext("2d")}catch{It=null}if(!It)return!1;let n=getComputedStyle(i);It.font=`${n.fontStyle} ${n.fontWeight} ${n.fontSize} ${n.fontFamily}`;let o=It.measureText(e).width,s=(parseFloat(n.paddingLeft)||0)+(parseFloat(n.paddingRight)||0)+(parseFloat(n.borderLeftWidth)||0)+(parseFloat(n.borderRightWidth)||0);return o+s<=t?!1:(i.dataset.fit="row",!0)}var nh=["on-sale","low","sold-out","presale","closed"];function oi(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function ro(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function Zr(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i,t=e.count,n=e.index;if(typeof n!="number"||!Number.isInteger(n)||n<1||typeof t!="number"||!Number.isInteger(t)||t<n)return;let o=e.remaining;if(o!=null&&(typeof o!="number"||!Number.isInteger(o)||o<0))return;let s={index:n,count:t,remaining:o??null};if(e.pricingMode!==void 0){if(e.pricingMode!=="matrix")return;s.pricingMode="matrix"}if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;s.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;s.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;s.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let r of["startsAt","endsAt"]){if(e[r]===void 0)continue;let a=ro(e[r]);if(a===void 0)return;s[r]=a}return s}function oh(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],n=new Set;for(let r of e.channels){if(!r||typeof r!="object"||Array.isArray(r))return;let a=r,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||n.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],d=new Set;for(let u of a.priceOverrides){if(!u||typeof u!="object"||Array.isArray(u))return;let m=u,p=typeof m.categoryKey=="string"?m.categoryKey.trim():"",v=m.tierId===null?null:typeof m.tierId=="string"&&m.tierId.trim()?m.tierId.trim():void 0,g=oi(m.price);if(!p||v===void 0||g===void 0||g===null)return;let T=`${p}\0${v??""}`;if(d.has(T))return;d.add(T),c.push({categoryKey:p,tierId:v,price:g})}n.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let o=[],s=new Set;for(let r of e.objects){if(!r||typeof r!="object"||Array.isArray(r))return;let a=r,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||s.has(l)||!n.has(c))return;s.add(l),o.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:o}}function ao(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i,t=nh.find(u=>u===e.state);if(!t)return null;let n=oi(e.fromPrice),o=oi(e.previousPrice);if(n===void 0||o===void 0)return null;let s=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(s===void 0)return null;let r=Zr(e.release);if(r===void 0)return null;let a=e.upcoming===void 0?null:Zr(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let u=[];for(let m of e.prices){if(!m||typeof m!="object"||Array.isArray(m))return null;let p=m,v=typeof p.categoryKey=="string"?p.categoryKey.trim():"";if(!v)return null;let g=oi(p.price),T=oi(p.previousPrice);if(g==null||T===void 0)return null;let S={categoryKey:v,price:g,previousPrice:T};if(p.tierId!==void 0){if(p.tierId!==null&&(typeof p.tierId!="string"||!p.tierId.trim()))return null;S.tierId=p.tierId===null?null:p.tierId.trim()}if(p.offerId!==void 0){if(typeof p.offerId!="string"||!p.offerId.trim())return null;S.offerId=p.offerId.trim()}if(p.offerName!==void 0){if(typeof p.offerName!="string"||!p.offerName.trim())return null;S.offerName=p.offerName.trim()}if(p.remaining!==void 0){if(p.remaining!==null&&(typeof p.remaining!="number"||!Number.isInteger(p.remaining)||p.remaining<0))return null;S.remaining=p.remaining==null?null:p.remaining}for(let y of["startsAt","endsAt"]){if(p[y]===void 0)continue;let P=ro(p[y]);if(P===void 0)return null;S[y]=P}u.push(S)}l=u}let c=oh(e.channelPricing);if(c===void 0)return null;let d=ro(e.nextPriceChangeAt);return d===void 0?null:{state:t,fromPrice:n,previousPrice:o,currency:s,release:r,upcoming:a,prices:l,channelPricing:c,...e.nextPriceChangeAt!==void 0?{nextPriceChangeAt:d}:{}}}function Qr(i){return i?.changed!==!1}function Xr(i,e){if(!i)return null;let t=null,n=o=>{o!=null&&o>e&&(t===null||o<t)&&(t=o)};for(let o of[i.release,i.upcoming])n(o?.startsAt),n(o?.endsAt);for(let o of i.prices)n(o.startsAt),n(o.endsAt);return n(i.nextPriceChangeAt),t}function Jr(i){let e={};for(let t of i?.prices??[])if(t.tierId==null)e[t.categoryKey]=t.price;else{let n=e[t.categoryKey],o=typeof n=="number"?{base:n}:n??{};e[t.categoryKey]={...o,tiers:{...o.tiers,[t.tierId]:t.price}}}return e}function ea(i,e){let t={...i};for(let[n,o]of Object.entries(Jr(e))){let s=t[n];t[n]=typeof o=="number"?o:{...typeof s=="number"?{base:s}:s,...o,tiers:{...typeof s=="object"?s.tiers:{},...o.tiers}}}return t}import{tCount as sh}from"@seatlayer/core";var ta="maintenance_mode";function rh(i){if(!i||typeof i!="object")return!1;let e=i;return e.reason===ta||e.code===ta}function ah(i){return typeof i!="number"||!Number.isFinite(i)||i<0?null:Math.max(1,Math.ceil(i/60))}function lo(i){if(!rh(i))return null;if(typeof i.notice=="string"&&i.notice.trim())return i.notice.trim();let e=ah(i.retryAfterS);if(e===null)return b("picker.maintenancePausedShortly","Booking is paused for a few minutes for maintenance. Please try again shortly.");let t=sh("picker.maintenancePaused",e);return t==="picker.maintenancePaused"?`Booking is paused for maintenance. Please try again in about ${e} minute${e===1?"":"s"}.`:t}var ia=["pointerdown","pointermove","keydown","wheel","touchstart"],an=class{constructor(e){this.opts=e;this.timer=null;this.root=null;this.doc=null;this.disposed=!1;this.onInput=()=>this.touch();this.onVisibility=()=>{this.doc&&!this.doc.hidden&&this.check()};this.lastInput=this.now()}get enabled(){return this.opts.minutes>0}now(){return this.opts.now?this.opts.now():Date.now()}attach(e,t=e.ownerDocument){if(!(this.disposed||!this.enabled)){this.root=e,this.doc=t;for(let n of ia)e.addEventListener(n,this.onInput,{capture:!0,passive:!0});t.addEventListener("visibilitychange",this.onVisibility),this.touch()}}touch(){this.lastInput=this.now(),this.arm(this.opts.minutes*6e4)}recentlyActive(){return!this.enabled||this.now()-this.lastInput<this.opts.minutes*6e4}resume(){this.disposed||this.touch()}dispose(){if(this.disposed=!0,this.clear(),this.root)for(let e of ia)this.root.removeEventListener(e,this.onInput,{capture:!0});this.doc?.removeEventListener("visibilitychange",this.onVisibility),this.root=null,this.doc=null}arm(e){if(this.disposed||!this.enabled)return;this.clear();let t=this.opts.setTimeout??((n,o)=>setTimeout(n,o));this.timer=t(()=>{this.timer=null,this.check()},Math.max(0,e))}clear(){if(this.timer===null)return;(this.opts.clearTimeout??(t=>clearTimeout(t)))(this.timer),this.timer=null}check(){if(this.disposed||!this.enabled)return;let e=this.lastInput+this.opts.minutes*6e4-this.now();if(e>0){this.arm(e);return}if(this.opts.blocked()){this.arm(6e4);return}this.clear(),this.opts.onIdle()}};async function na(i,e){let t=await i.pubApi?.pickerIdleMinutes().catch(()=>null)??null;if(i.destroyed||i.idleClock)return;let n=new an({minutes:t??30,blocked:()=>!!i.hold,onIdle:()=>oa(i)});n.enabled&&(i.idleClock=n,n.attach(e))}function oa(i){i.destroyed||!i.root||i.holdExpiredEl||(i.realtime?.stop(),i.realtime=null,i.showAccessPanel({reason:"idle",retryable:!0}))}async function sa(i){if(i.destroyed)return!1;if(i.pubApi?.rotateViewerId(),i.access?.configured){let e=await i.refreshAccess();return e&&i.idleClock?.resume(),e}return i.dismissAccessPanel(),await i.controller.refresh(),i.realtime?i.realtime.restart():i.startRealtime(),i.idleClock?.resume(),!0}function ra(i){if(!i.destroyed){if(i.hold||i.idleClock?.recentlyActive()){i.pubApi?.rotateViewerId(),i.realtime?.restart();return}oa(i)}}function aa(i,e,t=[],n=8,o=[]){let s=e.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,c.bottom-i.top+n),0),r=t.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,i.bottom-c.top+n),s>0?n:0),a=o.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,i.right-c.left+n),0);return{top:Math.max(0,Math.ceil(s)),right:Math.max(0,Math.ceil(a)),bottom:Math.max(0,Math.ceil(r)),left:0}}function la(i){let e=document.createElement("div");e.className="sl-floors sl-levels on",e.setAttribute("role","group"),e.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level")),e.title=i.tf("picker.floorHelp","All levels shows the complete venue. Choose one level to inspect and select its seats.");let t=i.tf("picker.allLevels","All levels"),n=[...i.floors.map((o,s)=>({id:o.id,name:o.name,code:lh(s)})).reverse(),{id:"",name:t,code:""}];for(let o of n){let s=document.createElement("button");if(s.type="button",s.className="sl-level",s.dataset.level=o.id,s.setAttribute("aria-pressed","false"),s.title=o.name,o.code){let a=document.createElement("b");a.className="sl-level-code",a.textContent=o.code,s.appendChild(a),s.setAttribute("aria-label",`${o.name} (${o.code})`)}let r=document.createElement("span");if(r.className="sl-level-name",r.textContent=o.name,s.appendChild(r),!o.code){let a=document.createElement("span");a.className="sl-level-short",a.setAttribute("aria-hidden","true"),a.textContent=i.tf("picker.allLevelsShort","All"),s.appendChild(a)}s.addEventListener("click",()=>i.onChoose(o.id)),e.appendChild(s)}return e.addEventListener("keydown",o=>{if(o.key!=="ArrowUp"&&o.key!=="ArrowDown")return;let s=[...e.querySelectorAll(".sl-level")],r=s.indexOf(document.activeElement);r<0||(o.preventDefault(),s[Math.max(0,Math.min(s.length-1,r+(o.key==="ArrowUp"?-1:1)))].focus())}),e}function lh(i){return i===0?"G":String(i)}function ca(i,e,t){if(!i)return;let n=t?"":e;for(let o of i.querySelectorAll(".sl-level"))o.setAttribute("aria-pressed",String(o.dataset.level===n))}var ln=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}render(e){this.el?.remove(),this.el=null}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,n=this.host.map();if(!e||!t||!n)return 0;let o=this.host.activeFloorObjects().find(y=>y.type==="section"&&y.id===t.id)?.outline;if(!o||o.length<3)return 0;let s=o.map(y=>this.host.controller.worldToScreen(y)),r=s.map(y=>y.x),a=s.map(y=>y.y),l=Math.min(...r),c=Math.min(...a),d=Math.max(...r)-l,u=Math.max(...a)-c;if(d<=0||u<=0)return 0;let m=n.getBoundingClientRect(),p=e.getBoundingClientRect(),v=p.left-m.left,g=p.top-m.top,T=Math.max(0,Math.min(v+p.width,l+d)-Math.max(v,l)),S=Math.max(0,Math.min(g+p.height,c+u)-Math.max(g,c));return T*S/(d*u)}};import{t as fo,tCount as xh}from"@seatlayer/core";import{contrastRatio as kh}from"@seatlayer/core/core/color";import{t as da,tCount as cn}from"@seatlayer/core";function co(i,e,t){try{return new Intl.DateTimeFormat(e,{...t,...i.timezone?{timeZone:i.timezone}:{}}).format(new Date(i.startsAt))}catch{return new Date(i.startsAt).toLocaleString(e)}}var dn=(i,e)=>co(i,e,{dateStyle:"medium"}),pn=(i,e)=>co(i,e,{timeStyle:"short"}),Ot=(i,e)=>co(i,e,{weekday:"short",day:"numeric",month:"short"});function pa(i,e,t,n){return!i.length||i.length>=e?null:{summary:n,labels:i.map(o=>`${dn(o,t)} \xB7 ${pn(o,t)}`)}}function ch(i,e){let t=new Set(e);return i.map(n=>({...n,free:!t.has(n.eventKey)}))}function ha(i,e){let t=[...i];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function dh(i,e,t="",n=!1){if(!i.length)return"";let o=i.map(s=>{let r=s.free?e.free:e.blocked,a=n&&s.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${E(s.eventKey)}" aria-label="${E(`${s.shortDate}: ${r}`)}" checked>`:"";return`<li class="sl-night${s.free?" ok":" no"}" aria-label="${E(`${s.shortDate}: ${r}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${E(s.shortDate)}</span><span class="st">${E(r)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${E(e.title)}</div><ul class="sl-nightstrip">${o}</ul><p class="sl-tip-nights-note">${E(e.notAvailableOn)}</p>`+t+"</div>"}function ph(i){return i.selectPartialLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${E(i.selectPartialLabel)}</button>`:i.switchLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${E(i.switchLabel)}</button>`:i.switchLabel||i.selectPartialLabel?"":`<p class="sl-tip-advice">${E(i.advice)}</p>`}function hh(i){return Number(i.available)+Number(i.selected)+Number(i.partial)+Number(i.unavailable)}function ua(i,e,t){if(hh(i)<2)return"";let n=(s,r,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${E(r)}</li>`,o=[];return i.available&&o.push(n("sl-pg-sw-free",e.available,` style="background:${E(t)}"`)),i.selected&&o.push(n("sl-pg-sw-sel",e.selected)),i.partial&&o.push(n("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${E(t)}"`)),i.unavailable&&o.push(n("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${E(e.title)}">${o.join("")}</ul>`}function ma(i,e){if(!i.length)return"";let t=i.map(n=>{let o=n.labels.length?n.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${n.labels.length?"":" empty"}${n.active?" active":""}" role="button" tabindex="0"${n.active?' aria-current="true"':""} data-event-key="${E(n.eventKey)}"><span class="n">${E(n.name)}</span><span class="s">${E(o)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${E(e.title)}"><div class="sl-pg-nights-title">${E(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function po(i,e){if(i?.kind!=="partial"||!e?.length)return null;let t=i.data?.blockedEventKeys??[],n=ch(e,t);return{states:n,missing:n.filter(o=>!o.free).map(o=>o.shortDate)}}function fa(i,e){return i?dh(i.states,{title:b("picker.group.partlyAvailableTitle","Free on some nights only"),free:b("picker.group.nightFree","Free"),blocked:b("picker.group.nightBlocked","Not available"),notAvailableOn:da("picker.group.notAvailableOn",{dates:ha(i.missing,e.locale)})},ph({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:b("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function uh(i,e,t,n){if(!i.length)return"";let o=new Set(e),s=new Set(t),r=i.map(a=>{let l=o.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${E(a.eventKey)}" aria-label="${E(`${a.shortDate}: ${l?n.available:n.unavailable}`)}"${l&&s.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${E(a.shortDate)}</span><span class="sl-confirm-date-state">${E(l?n.available:n.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${E(n.title)}</legend><p class="sl-confirm-dates-copy">${E(n.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${E(n.selectAll)}</span></label><ul>${r}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function ga(i,e,t,n){let o=e.availableEventKeys(t);return uh(i,o,e.includedEventKeys(),{title:n("picker.group.confirmDatesTitle","Choose performance dates"),copy:o.length===i.length?n("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(i.length)):n("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(o.length)).replace("{total}",String(i.length)),selectAll:n("picker.group.confirmSelectAll","Select all available dates"),available:n("picker.group.nightFree","Available"),unavailable:n("picker.group.nightBlocked","Unavailable")})}function ba(i){return[...i.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function ya(i,e,t,n){let o=[...i.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!o.length)return;let s=i.querySelector(".sl-confirm-add"),r=i.querySelector("[data-pg-confirm-all]"),a=()=>{let l=o.filter(u=>!u.disabled),c=ba(i).length;r&&(r.checked=c===l.length,r.indeterminate=c>0&&c<l.length);let d=i.querySelector("[data-pg-confirm-summary]");d&&(d.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),s.disabled=c===0,s.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),n()};o.forEach(l=>l.addEventListener("change",a)),r?.addEventListener("change",()=>{o.filter(l=>!l.disabled).forEach(l=>{l.checked=r.checked}),a()}),a()}async function va(i,e,t){if(!i||!t||!i.querySelector("[data-pg-confirm-event-key]"))return!0;let n=ba(i);if(!n.length)return!1;let o=i.querySelector(".sl-confirm-add");return o?.setAttribute("aria-busy","true"),o&&(o.disabled=!0),await t.apply(e,n)?!0:(o?.removeAttribute("aria-busy"),o?.isConnected&&(o.disabled=!1),!1)}function wa(i,e,t){return i?da("picker.group.seatPartlyAvailable",{label:e,free:i.states.length-i.missing.length,total:i.states.length,dates:ha(i.missing,t)}):""}function xa(i,e){let t=i.map((n,o)=>{let s=n.state==="done"?e.done:n.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${E(n.id)}" data-state="${E(n.state)}"${n.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${n.state==="done"?"\u2713":String(o+1)}</span><span class="l">${E(n.label)}</span><span class="sl-pg-sr">${E(s)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${E(e.label)}">${t}</ol>`}function ho(i,e){return`<ul class="sl-pg-cards">${i.map(n=>`<li class="sl-pg-card" data-event-key="${E(n.eventKey)}"><span class="n">${E(n.name)}</span><time datetime="${E(n.iso)}"><span class="d">${E(n.date)}</span><span class="t">${E(n.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${E(e)}</p>`}function ka(i){let e=i.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${E(t.eventKey)}"><span class="n">${E(t.name)}</span><span class="s">${E(t.labels.length?t.labels.join(", "):i.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${E(i.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(i.note?`<p class="sl-pg-pane-note">${E(i.note)}</p>`:"")+(i.total?`<div class="sl-pg-pane-total"><span>${E(i.total.label)}</span><b>${E(i.total.amount)}</b></div>`:"")+(i.holdStatus?`<p class="sl-pg-hold-status" role="status">${E(i.holdStatus)}</p>`:"")}function Sa(i){let e=Math.max(0,i);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function Ta(i,e){if(!i||i.seats<=0)return"";if(e==="same_seat"){let t=i.perPerformance??i.seats;return i.totalPerformances&&i.performances<i.totalPerformances?cn("picker.group.performancesChosenOf",t,{chosen:i.performances,total:i.totalPerformances}):cn("picker.group.seatsEveryPerformance",t)}return i.perPerformance!=null&&i.performancesChosen===i.performances?cn("picker.group.seatsPerPerformance",i.seats,{per:i.perPerformance}):cn("picker.group.performancesChosenOf",i.seats,{chosen:i.performancesChosen,total:i.performances})}function Ea(i,e){i.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let n=()=>e(t.dataset.eventKey);t.addEventListener("click",n),t.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),n())})})}function Ve(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function mh(i,e){let t=i.objectType==="table"&&!!i.bookingMode,n=i.objectType==="booth",o=t||n||!i.seatNumber,s=o?i.rowLabel??i.displayLabel??i.label:i.seatNumber,r=t?`${b("picker.guests","Guests")} ${i.bookingMode==="variable"?`${i.minOccupancy}\u2013${i.maxOccupancy}`:i.capacity}`:!n&&i.rowLabel?`${e} ${q(i)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${o?" name":""}">${Ve(s)}</span>`+(r?`<span class="sl-tip-row">${Ve(r)}</span>`:"")+"</div>"+(i.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${b("picker.section","Section")}</span><span class="sl-tip-secname">${Ve(i.sectionLabel)}</span></div>`:"")+"</div>"}function Ca(i,e){let t=i.status==="not_for_sale",n=i.mark?.kind==="partial",o=i.status==="free"||n?"":`<span class="sl-tip-tag">${e.ownHold?b("picker.heldForYou","Held for you"):b("picker.group.legendUnavailable","Unavailable")}</span>`,s=t?"":e.price,r=s?`<span class="sl-tip-amt">${Ve(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${Ve(e.priceNote)}</div>`:"",l=Je(i,{compact:!0}),c=e.reason?`<div class="sl-tip-reason">${Ve(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+mh(i,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${Ve(i.categoryColor)}"></span><span class="sl-tip-name">${Ve(i.categoryLabel)}</span>`+o+r+"</div>"+a+c+l+(e.extra??"")}function Aa(i,e,t,n){let o=i.x+14,s=i.y-n.height-12,r=i.y+18,a=s;o+n.width>e-8&&(o=i.x-n.width-14),s<8&&r+n.height<=t-8&&(a=r);let l=Math.max(8,t-n.height-8);return{left:Math.max(8,Math.min(o,Math.max(8,e-n.width-8))),top:Math.max(8,Math.min(a,l))}}function Pa(i,e,t,n=22){let o=Math.max(8,Math.min(i.x-t.width/2,Math.max(8,e.width-t.width-8))),s=i.y-n-t.height,r=i.y+n;return s>=8?{left:o,top:s,placement:"above"}:r+t.height<=e.height-8?{left:o,top:r,placement:"below"}:{left:o,top:Math.max(8,Math.min(s<8?r:s,Math.max(8,e.height-t.height-8))),placement:s<8?"below":"above"}}var uo=14,fh=12,gh=12,bh=8;function La(i,e,t,n=fh){let o=e.height-uo-t.height,s=gh,r=o-n;if(r<=s)return{placement:"sheet",nudgeY:0};let a=(s+r)/2-i;return Math.abs(a)<=bh?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function Ma(i,e,t,n,o=0){let s=t.width/2+12,r=Math.max(s,Math.min(e.width-s,i.x)),a=i.y+o+t.height+24<=e.height,l=i.y-o<t.height+24&&a?"below":"above",c=l==="above"?i.y-o:i.y+o,d=n&&l==="above"?Math.max(t.height+24,c):c;return{left:r,top:Math.max(8,Math.min(e.height-8,d)),placement:l}}function Ha(i,e,t){let n=i.querySelector("[data-pg-select-partial]"),o=[...i.querySelectorAll("[data-pg-event-key]")],s=()=>o.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),r=()=>{if(!n)return;let a=s().length;n.disabled=a===0,n.textContent=e?.(a)??n.textContent};o.forEach(a=>{a.addEventListener("change",r);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,r())})}),n?.addEventListener("click",()=>{let a=s();a.length&&t?.(a)})}function nt(i){let e=i?.displayType?.trim()||i?.rowType?.trim();return e||(i?.objectType==="table"?b("picker.table","Table"):i?.objectType==="booth"?b("picker.booth","Booth"):b("picker.row","Row"))}var yh="sl-confirm-scrim",vh="--sl-scrim-mask";function wh(i){let e=Math.round(i.x),t=Math.round(i.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function Ra(i,e,t,n){let o=i??document.createElement("div");return i||(o.className=yh),o.style.setProperty(vh,wh(n)),t.parentNode===e?o.nextSibling!==t&&e.insertBefore(o,t):o.parentNode!==e&&e.appendChild(o),o}function mo(i){return i?.remove(),null}var Ia={passport:!1,compare:!1},Sh=360,Th=160,Eh=700,Oa=450,Ch=8;function _a(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function Ah(i){return kh("#ffffff",i)>=3?"#ffffff":"#0b0f19"}var hn=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let n=Ht(e)?e.viewUrl??"":"",o=nn(t);if(!n&&!o)return"";let s=n?null:on(e,e.focalPoint??t.focalPoint);if(!n&&s==null)return"";let r="";if(!n)return r;let a=_(fo("picker.viewFromSeat",{label:e.label})),l=_(this.host.tf("picker.viewFromHere","View from here"));return`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`+r}show(e,t="add"){let n=this.host;this.mode=t;let o=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,n.root()?.setAttribute("data-confirming","true"),n.els().side?.toggleAttribute("inert",!0),Object.values(n.regions()).forEach(A=>A.toggleAttribute("inert",!0)),n.controller.setSelectionFocus(e.id),o&&o!==e.id&&n.controller.deselect([o]),n.hideTooltip();let s=n.controller.seatDetails(e.id),r=n.controller.doc?.categories.find(A=>A.key===e.categoryKey),a=s?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),l=a!=null?n.paidPrice(e.categoryKey,s?.tierId??r?.tiers?.[0]?.id??null,a,e.label):void 0,c=As(s,e.displayLabel??e.label,nt(s)),d=s?.tiers??r?.tiers??[],u=s?.tierId??d[0]?.id,m=n.suppressPricing()?"":Hi(d,u,A=>n.money(n.paidPrice(e.categoryKey,A.id,A.price,e.label)),A=>n.offerName(e.categoryKey,A.id)),p=n.buyerView()==="venue3d",v=n.performanceGroup()?.confirmDateSelection??void 0,g=v?n.performanceGroup()?.nights?.()??[]:[],T=v?ga(g,v,e.id,(A,I)=>n.tf(A,I)):"";this.shownAt=performance.now();let S=document.createElement("div");S.className="sl-confirm sl-mo-in",t==="remove"&&S.classList.add("sl-confirm-removing"),T&&S.classList.add("sl-confirm-group-dates"),S.setAttribute("role","dialog"),S.setAttribute("aria-label",fo("picker.confirmSeatLabel",{label:e.label}));let y=n.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??r?.color??"#6e7bff";S.style.setProperty("--sl-cat",y),S.style.setProperty("--sl-cat-ink",Ah(y));let P=String(s?.categoryLabel??r?.label??e.categoryKey),R=n.controller.categoryAvailability()[e.categoryKey],G=typeof R=="number"&&R>0?xh("picker.leftCount",R):"",f=n.suppressPricing()?`${s?.displayLabel??e.displayLabel??e.label}`:`${s?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?n.tf("picker.priceNotSupplied","Price not supplied"):n.money(l)}`,L=Ia.passport?Cs(e,f,p):"",D=Ia.compare?Es(e,p?n.view3dCompareSeatIds():null):"";S.innerHTML=Hs({identityFields:c,identity:Ps(s,e.displayLabel??e.label,nt(s)),marker:Ts({...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{}}),see3dPill:Ls(n.canOffer3d(),p),categoryColor:y,categoryLabel:P,priceLabel:!n.suppressPricing()&&l!=null?n.money(l):"",categoryLeftLabel:G,tierChoices:m,groupDates:T,wheelchair:"",commercial:Je({...e.accessibility?.length?{accessibility:e.accessibility}:{},...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{},...s?.aisle?{aisle:!0}:{},...s?.boothType?{boothType:s.boothType}:{},...s?.entrance?{entrance:s.entrance}:{}}),thumb:n.seatViewEnabled()&&n.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:p?`<div class="sl-confirm-inspect-row">${L}${D}${Bn(n.canOffer3d(),p)}</div>`:Bn(n.canOffer3d(),p),see3dRow:Ms(n.canOffer3d(),p),cancelLabel:fo("common.cancel"),selectLabel:t==="remove"?n.tf("picker.removeSeat","Remove seat"):n.addSeatLabel(s?.objectType)}),t==="remove"&&S.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),n.els().map.appendChild(S),this.el=S;let M=S.querySelector(".sl-confirm-thumb"),O=M?.closest(".sl-confirm-thumbwrap")??null;if(M&&O){let A=!1,I=()=>{if(A||!O.isConnected)return;A=!0;let z=()=>{O.remove(),this.el===S&&n.reanchor()};if(n.reducedMotion()||typeof requestAnimationFrame!="function"){z();return}O.style.height=`${O.offsetHeight}px`,O.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{O.style.height="0px",O.style.opacity="0"}),setTimeout(z,Th)};M.addEventListener("error",I),M.addEventListener("load",()=>{M.naturalWidth||I()});let j=e.viewMeta?.previewUrl??e.viewUrl;j?n.resolveAssetUrl(j).then(z=>{if(!(!S.isConnected||this.el!==S)){if(!z){I();return}M.src=z}}).catch(z=>{I(),n.onError(z)}):I()}n.reanchor(),this.liftSeatClearOfSheet(e),S.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{n.openSeatView(e)}),S.querySelector(".sl-confirm-confidence")?.addEventListener("click",A=>{n.openSeatConfidencePassport(e,A.currentTarget instanceof HTMLElement?A.currentTarget:null)}),S.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>n.saveView3dComparisonSeat(e)),S.querySelectorAll("[data-confirm-tier]").forEach(A=>{A.addEventListener("click",()=>{let I=A.dataset.confirmTier,j=d.find(de=>de.id===I);if(!j)return;n.controller.setSeatTier(e.id,j.id),S.querySelectorAll("[data-confirm-tier]").forEach(de=>{de.setAttribute("aria-pressed",String(de===A))});let z=S.querySelector(".sl-confirm-price");z&&(z.textContent=n.money(n.paidPrice(e.categoryKey,j.id,j.price,e.label))),n.reanchor()})}),S.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(A=>{A.addEventListener("pointerdown",xi,{once:!0}),A.addEventListener("click",()=>{n.buyerView()==="venue3d"?(n.dismiss(),n.view3dHandle()?.flyToSeat(e.id)):(n.rememberView3dReturnSeat(e),n.dismiss(),n.enter3d(e.id))})}),ya(S,v,(A,I)=>n.tf(A,I),()=>n.reanchor()),S.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),S.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(S),requestAnimationFrame(()=>{let A=S.querySelector(".sl-confirm-add");A?.focus(),n.liftToastOverConfirm(),n.fitTranslatedRows(),n.inviteCommit(S,A)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,n=t.root();if(!this.el||n?.dataset.layout!=="narrow"||n?.dataset.view3d==="on")return;let o=t.els().map;if(!o)return;let s=t.controller.worldToScreen({x:e.x,y:e.y}),r=t.controller.getRenderer(),a=r?.getCameraGestureCount?.()??0,{nudgeY:l}=La(s.y,{height:o.clientHeight},{height:this.el.offsetHeight||230}),c=this.lift&&this.lift.gestures===a?this.lift.dy:0;if(!l){this.lift=c?{dy:c,gestures:a}:null;return}let d=!t.reducedMotion();r?.panScreenBy?.({x:0,y:l},{animate:d}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=d?this.now()+Eh:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),n=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=Ra(this.scrim,n,this.el,t),ir(this.el,t,n),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=mo(this.scrim);let o=n.clientWidth,s=n.clientHeight,r=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,d=Ma(t,{width:o,height:s},{width:r,height:a},l,c);this.el.dataset.placement=d.placement,this.el.style.left=`${d.left}px`,this.el.style.top=`${d.top}px`,Gi(this.el,t,{left:d.left,top:d.top,width:r,height:a})}ghostActivation(){return _a()?performance.now()-this.shownAt<Oa:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,n=new Map,o=r=>{if(this.el!==e){this.disarmOutsideTap();return}let a=r.target,l=r;if(r.type!=="pointerdown"){let d=n.get(l.pointerId);n.delete(l.pointerId),d&&r.type==="pointerup"&&n.size===0&&Math.hypot(l.clientX-d.x,l.clientY-d.y)<=Ch&&this.cancel();return}if(!(!a||e.contains(a)||t.els().tray?.contains(a))){if(a instanceof Element&&a.closest(".sl-view3d")){if(n.set(l.pointerId,{x:l.clientX,y:l.clientY}),n.size>1)for(let d of n.keys())n.set(d,{x:Number.NaN,y:Number.NaN});return}this.cancel()}};this.outsideTap=o;let s=t.root();setTimeout(()=>{this.outsideTap===o&&((s??document).addEventListener("pointerdown",o,!0),(s??document).addEventListener("pointerup",o,!0),(s??document).addEventListener("pointercancel",o,!0))},_a()?Oa:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null;for(let t of["pointerdown","pointerup","pointercancel"])(this.host.root()??document).removeEventListener(t,e,!0),document.removeEventListener(t,e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=mo(this.scrim),this.settleLift(),this.el&&Ki(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null),e.syncTray()}async commit(){let e=this.host,t=this.seat;if(!t)return;let o=this.el?.querySelector(".sl-confirm-add")??null;if(o?.classList.contains("is-adding")||!await va(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let s=()=>{let l=e.root()?.dataset.layout==="narrow"?this.lift:null;l&&(this.lift=null),e.dismiss();let c=e.controller.worldToScreen(t);eo(e.els(),c,t,e.controller.doc?.categories,()=>{e.cartLanded?.(),l&&(this.lift=l,this.settleLift())})};if(!o||e.reducedMotion()){s();return}o.classList.remove("sl-confirm-add-invite"),o.classList.add("is-adding"),o.setAttribute("aria-disabled","true");let r=o.querySelector(".sl-confirm-add-t");r&&(r.textContent=e.tf("picker.added","Added")),e.scheduleMotion(s,Sh)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"&&e.controller.deselect([t.id]),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}removeCommitted(){let e=this.host,t=this.seat;if(!t)return;let n=e.releaseHeldSeat(t);n||e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0})}};function Na(i,e,t){if(!e||t||i.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let n=()=>e.classList.remove("sl-confirm-add-invite");i.addEventListener("pointerdown",n,{once:!0}),i.addEventListener("keydown",n,{once:!0}),e.addEventListener("focus",n,{once:!0})}function Da(i,e){return i&&i!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}import{t as go}from"@seatlayer/core";var Ph=12;function Ba(i,e){let t=e.floors(),n=new Set(t.map(f=>f.label.trim().toLocaleLowerCase())),o=e.zones().filter(f=>f.seatCount>0&&!n.has(f.label.trim().toLocaleLowerCase())),s=e.sections().filter(f=>f.seatCount>0&&!n.has(f.label.trim().toLocaleLowerCase())),r=o.length>1?[]:s,a=t.length>1,l=o.length>1,c=r.length>1;if(!a&&!l&&!c)return null;let d=document.createElement("div");d.className="sl-view3d-nav";let u=null,m=document.createElement("button");m.type="button",m.className="sl-view3d-nav-toggle",m.setAttribute("aria-expanded","false");let p='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>',v=document.createElement("span");m.innerHTML=p,m.appendChild(v);let g=()=>{for(let f of d.querySelectorAll(":scope > div")){let L=f.querySelector('[aria-pressed="true"]');!L||f.scrollWidth<=f.clientWidth||L.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(u)return u;for(let f of d.querySelectorAll(":scope > div")){let L=f.querySelector('button[aria-pressed="true"]'),D=L?.textContent?.trim();if(D&&L?.dataset.floor!=="")return D}return a&&(l||c)?b("picker.levelsAndAreas","Levels & zones"):a?b("picker.levels","Levels"):b("picker.areas","Zones")},S=f=>{d.classList.toggle("is-open",f),m.setAttribute("aria-expanded",String(f)),f&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(g),v.textContent=T()};m.addEventListener("click",()=>S(!d.classList.contains("is-open"))),d.addEventListener("keydown",f=>{f.key!=="Escape"||!d.classList.contains("is-open")||(f.preventDefault(),f.stopPropagation(),S(!1),m.focus())});let y=document.createElement("button");y.type="button",y.className="sl-view3d-nav-close",y.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let P=b("picker.closeVenueNavigation","Close venue navigation");y.setAttribute("aria-label",P),y.title=P,y.addEventListener("click",()=>{S(!1),m.focus()}),S(!1),d.appendChild(m);let R=f=>{},G=f=>{};if(a){let f=document.createElement("div");f.setAttribute("role","group"),f.setAttribute("aria-label",b("picker.levels","Levels"));let L=[];G=O=>{L.forEach(A=>{A.setAttribute("aria-pressed",String((A.dataset.floor===""?null:Number(A.dataset.floor))===O))})};let D=O=>{e.focusFloor(O)&&(G(O),R(O))},M=(O,A)=>{let I=document.createElement("button");I.type="button",I.textContent=O,I.dataset.floor=A===null?"":String(A),I.setAttribute("aria-pressed",String(A===null)),I.addEventListener("click",()=>{D(A),S(!1)}),L.push(I),f.appendChild(I)};M(b("picker.allLevels","All levels"),null);for(let O of t)M(O.label||go("picker.levelNumber",{number:O.index+1}),O.index);d.appendChild(f)}if(l||c){let f=document.createElement("div");f.setAttribute("role","group"),f.setAttribute("aria-label",b("picker.areas","Zones"));let L=l?o.map(M=>({id:M.id,label:M.label||M.id,go:()=>{e.focusZone(M.id)}})):r.map(M=>({id:M.id,label:M.label||M.id,floorIndex:M.floorIndex,go:()=>{e.focusSection(M.id),Number.isFinite(M.floorIndex)&&G(M.floorIndex)}})),D=M=>{let O=l||M===null?L:L.filter(A=>A.floorIndex===void 0||A.floorIndex===M);if(f.replaceChildren(),!O.length){f.remove();return}if(f.isConnected||d.insertBefore(f,y.isConnected?y:null),!l&&O.length>Ph){let A=document.createElement("select");A.setAttribute("aria-label",b("picker.jumpToSection","Jump to section"));let I=document.createElement("option");I.value="",I.textContent=b("picker.jumpToSection","Jump to section"),A.appendChild(I);for(let j of O){let z=document.createElement("option");z.value=j.id,z.textContent=j.label,A.appendChild(z)}A.addEventListener("change",()=>{O.find(j=>j.id===A.value)?.go()}),f.appendChild(A);return}for(let A of O){let I=document.createElement("button");I.type="button",I.textContent=A.label,I.dataset.area=A.id,I.addEventListener("click",()=>{u=A.label,A.go(),S(!1)}),f.appendChild(I)}};R=D,D(null)}return d.appendChild(y),i.appendChild(d),d}var un=class{constructor(e){this.host=e;this.chip=null}sync(){let e=this.host.overlay();if(!e||this.host.savedSeatIds().length===0){this.chip?.remove(),this.chip=null;return}let t=this.chip;if(!t){t=document.createElement("div"),t.className="sl-view3d-compare-saved",t.setAttribute("role","group"),t.setAttribute("aria-label",b("picker.savedSeatComparison","Saved seat comparison"));let s=document.createElement("button");s.type="button",s.className="main",s.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(b("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let r=document.createElement("button");r.type="button",r.className="clear",r.textContent="\xD7",r.setAttribute("aria-label",b("picker.clearSavedSeatComparison","Clear saved seat comparison")),r.addEventListener("click",()=>this.host.clearComparison()),t.append(s,r),e.appendChild(t),this.chip=t}let n=this.host.savedSeatIds().length,o=t.querySelector(".main");o&&(o.textContent=n>1?go("picker.compareCount",{count:n}):b("picker.oneSeatSaved","1 seat saved"),o.setAttribute("aria-label",n>1?go("picker.openComparisonOfSeats",{count:n}):b("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function Fa(i){return!i?.querySelector('[data-ref="zfs"]')}var Va="sl:sheet-hint";function $a(i){let e=i.boot;if(!e?.isConnected)return;if(i.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),i.map?.appendChild(t),setTimeout(()=>t.remove(),450),i.rail?.classList.add("is-in"),i.root?.classList.add("is-arriving"),setTimeout(()=>{i.rail?.classList.remove("is-in"),i.root?.classList.remove("is-arriving"),Lh(i.root)},700)}function Lh(i){if(!i||i.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(Va))return;window.sessionStorage.setItem(Va,"1")}catch{}let e=i.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function za(i,e){i.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let n of e())if(n.open()){t.preventDefault(),t.stopPropagation(),n.close();return}}})}function fn(i){let e=i.committedSelection(),t=i.controller.getGAAreas(),n=i.hold?.items??[],o=new Set(n.map(m=>m.label)),s=cr(i,t,n),r=Fe(i.gaQty,n),a=n.reduce((m,p)=>m+i.heldPrice(p)*(p.quantity??1),0),l=n.reduce((m,p)=>m+(p.quantity??1),0),c=e.filter(m=>!o.has(m.label)),d=c.reduce((m,p)=>m+i.paidPrice(p.categoryKey,p.tierId??null,p.price,p.label)*(p.quantity??1),0)+s+a,u=c.reduce((m,p)=>m+(p.quantity??1),0)+r+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:n,heldLabels:o,heldCount:l,total:d,count:u}}function gn(i,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:i.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function bn(i,e){let t=e.tiers?.length?e.tiers.map(n=>i.paidPrice(e.key,n.id??null,n.price)):e.price==null?[]:[i.paidPrice(e.key,null,e.price)];if(e.key){for(let n of i.pricesByChannel.values())for(let o of n)o.categoryKey===e.key&&t.push(o.price);t.push(...Mh(i).get(e.key)??[])}return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var mn=null;function Mh(i){let e=i.controller.doc,t=i.hostObjectPrices();if(mn?.doc!==e||mn.host!==t){let n=new Map;for(let[o,s]of Object.entries({...e?.seatPrices,...t})){let r=i.controller.seatByLabel(o)?.categoryKey??i.controller.tableSelection(o)?.categoryKey;r&&(n.has(r)||n.set(r,[]),n.get(r).push(...typeof s=="number"?[s]:Object.values(s.tiers)))}mn={doc:e,host:t,spread:n}}return mn.spread}var si="seatlayer_";function Hh(){let i=globalThis;return i.document?.modelContext??i.navigator?.modelContext??null}function ce(i,e){return e?{ok:!1,reason:i,message:e}:{ok:!1,reason:i}}function Rh(i){return Array.isArray(i)?i.filter(e=>typeof e=="string"&&!!e):[]}function Ih(i,e){let t=i.event();if(!t)return ce("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits();return{ok:!0,event:t,selection:{max:n.max,...n.required!=null?{required:n.required}:{}},categories:i.categories(),zones:i.zones(),hasPremiumSeats:i.hasPremiumSeats(),holdsAllowed:e}}function ja(i,e){let t=o=>!!o&&o.toLowerCase()===e.toLowerCase(),n=i.find(o=>t(o.key??o.id))??i.find(o=>t(o.label));return n?.key??n?.id??null}function Ga(i,e){let t=e.map(n=>i.describeSeat(n.id));return{seatIds:e.map(n=>n.id),labels:e.map(n=>n.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((n,o)=>t[o]?.seat||n.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((n,o)=>n+o.price,0)}}function Oh(i,e,t){let n=new Map;for(let s of e){let r=n.get(s.rowKey);r?r.push(s):n.set(s.rowKey,[s])}let o=[];for(let s of n.values()){let r=[...s].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=r.length;l++)if(l===r.length||r[l].index!==r[l-1].index+1||r[l].categoryKey!==r[l-1].categoryKey){for(let d=a;d+t<=l;d+=t)o.push(Ga(i,r.slice(d,d+t)));a=l}}return o}function _h(i,e,t){let n=new Map;for(let s of e){let r=n.get(s.sectionKey);r?r.push(s):n.set(s.sectionKey,[s])}let o=[];for(let s of n.values()){if(s.length<t)continue;let r=[...s].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);o.push(Ga(i,r.slice(0,t)))}return o}function Nh(i,e){if(!i.event())return ce("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits(),o=Math.floor(Number(e.count));if(!Number.isInteger(o)||o<1||o>n.max)return ce("bad_count",`count must be a whole number between 1 and ${n.max}.`);let s=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,r=e.together===void 0?!0:!!e.together,a=typeof e.max_price=="number"&&Number.isFinite(e.max_price)?e.max_price:null,l=typeof e.category=="string"&&e.category?e.category:null,c=typeof e.zone=="string"&&e.zone?e.zone:null,d=l?ja(i.categories(),l):null;if(l&&!d)return ce("no_match",`No ticket type called "${l}".`);if(d&&i.categories().find(g=>g.key===d)?.available===0)return ce("sold_out",`"${l}" is sold out.`);let u=c?ja(i.zones(),c):null;if(c&&!u)return ce("no_match",`No zone called "${c}".`);let m=i.seats().filter(g=>g.available);if(!m.length)return ce("sold_out");let p=m.filter(g=>(!d||g.categoryKey===d)&&(!u||g.zoneId===u)&&(a==null||g.price<=a));if(!p.length)return ce("no_match");let v=r?Oh(i,p,o):_h(i,p,o);return v.length?(v.sort((g,T)=>T.unitPrice!==g.unitPrice?T.unitPrice-g.unitPrice:g.row.localeCompare(T.row)||g.labels[0].localeCompare(T.labels[0])),{ok:!0,groups:v.slice(0,s),searched:{count:o,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...u?{zone:u}:{},together:r}}}):ce(r?"not_enough_together":"no_match")}function Ka(i){return{ok:!0,...i.selection()}}function Dh(i,e){let t=i.event();if(!t)return ce("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return ce("event_closed","Sales are closed for this event.");let n=Rh(e.seat_ids);return n.length?(i.clearSelection(),i.selectObjects(n),Ka(i)):ce("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function Bh(i,e){let t=async o=>{try{return await o()}catch(s){return ce("error",s instanceof Error?s.message:String(s))}},n=[{name:`${si}describe_event`,title:"Describe this seated event",description:"Read the event, its ticket types with live availability and prices, its zones, and how many seats this buyer may select. Call this first.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>Ih(i,e))},{name:`${si}find_seats`,title:"Find available seats",description:"Search the seat map for groups of available seats. Read-only: it never selects, holds or reserves anything. Returns candidate groups with their seat ids, prices and location.",inputSchema:{type:"object",properties:{count:{type:"integer",minimum:1,description:"How many seats are needed."},max_price:{type:"number",description:"Highest acceptable price per seat."},category:{type:"string",description:"Ticket type key or label to restrict the search to."},zone:{type:"string",description:"Zone id or label to restrict the search to."},together:{type:"boolean",description:"Require the seats to be side by side in one row (default true)."},limit:{type:"integer",minimum:1,maximum:20,description:"How many candidate groups to return (default 5)."}},required:["count"],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:o=>t(()=>Nh(i,o))},{name:`${si}select_seats`,title:"Select seats on the map",description:"Replace the current selection with the given seats, exactly as tapping them would. The buyer sees the seats light up and the basket update. No reservation is made.",inputSchema:{type:"object",properties:{seat_ids:{type:"array",items:{type:"string"},description:"Seat ids or labels, e.g. from find_seats."}},required:["seat_ids"],additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:o=>t(()=>Dh(i,o))},{name:`${si}get_selection`,title:"Read the current selection",description:"Read the seats currently selected in the basket, their total, any open reservation, and whether the selection satisfies this event\u2019s rules.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>Ka(i))}];return e&&n.push({name:`${si}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>i.hold())}),n}async function Ua(i,e={}){let t=Hh();if(!t||typeof t.registerTool!="function")return null;let n=new AbortController,o=Bh(i,!!e.holds),s=[],r=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of o)await t.registerTool(a,{signal:n.signal,...r?{exposedTo:r}:{}}),s.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return s.length?{names:s,dispose:()=>{if(n.abort(),typeof t.unregisterTool=="function")for(let a of s)try{t.unregisterTool(a)}catch{}}}:null}async function qa(i){let e=i.opts.webMcp;if(!e||i.destroyed)return;let t=typeof e=="object"&&!!e.holds,n=typeof e=="object"?e.exposedTo:void 0;try{i.webMcp=await Ua(yo(i,t),{holds:t,exposedTo:n}),i.destroyed&&bo(i)}catch(o){console.warn("seatmap: WebMCP registration failed",o)}}function bo(i){i.webMcp?.dispose(),i.webMcp=null}function yo(i,e){let t=(n,o)=>{if(Number.isInteger(n.logicalSeatIndex))return n.logicalSeatIndex;let s=n.id.lastIndexOf(":"),r=s<0?NaN:Number(n.id.slice(s+1));return Number.isFinite(r)?r:o};return{event:()=>{let n=i.renderInfo;return n?{name:n.eventName??"",venue:n.venue??null,startsAt:n.startsAt??null,timezone:n.timezone??null,currency:i.currency,salesClosed:i.salesClosed}:null},selectionLimits:()=>({max:i.maxTickets,required:i.exactTickets}),categories:()=>{let n=i.controller.categoryAvailability();return(i.controller.doc?.categories??[]).filter(o=>!o.notForSale).map(o=>{let s=bn(i,o),r=gn(i,o);return{key:o.key,label:o.label??o.key,...r===void 0?{}:{price:r},...s&&s.min!==s.max?{priceRange:s}:{},available:n[o.key]??0}})},zones:()=>i.controller.getBestAvailableZones(),hasPremiumSeats:()=>i.controller.hasPremiumSeats(),seats:()=>{let n=i.controller.getActiveFloorId(),o=[];return i.allSeats().forEach((s,r)=>{if(s.floorId&&n&&s.floorId!==n)return;let a=i.controller.getStatus(s.id)??"free",l=i.controller.doc?.categories.find(d=>d.key===s.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;o.push({id:s.id,label:s.label,rowKey:s.logicalRowId??s.rowId,sectionKey:s.sectionId??s.rowId,index:t(s,r),categoryKey:s.categoryKey,price:i.paidPrice(s.categoryKey,l?.tiers?.[0]?.id??null,c,s.label),...s.zoneId?{zoneId:s.zoneId}:{},available:a==="free"&&!l?.notForSale})}),o},describeSeat:n=>{let o=i.controller.seatDetails(n);return o?{section:o.sectionLabel??"",row:q(o)??"",seat:o.seatNumber??o.label,category:o.categoryLabel??o.categoryKey}:null},selection:()=>{let{freshSeats:n,total:o,count:s}=fn(i);return{seats:n.map(r=>({id:r.id,label:r.label,section:r.sectionLabel??"",row:q(r)??"",seat:r.seatNumber??r.label,category:r.categoryKey,price:i.paidPrice(r.categoryKey,r.tierId??null,r.price,r.label)})),count:s,total:o,currency:i.currency,hold:i.hold?{id:i.hold.holdId,expiresAt:i.hold.expiresAt}:null,validity:i.getSelectionValidity()}},clearSelection:()=>i.clearSelection(),selectObjects:n=>{i.selectObjects(n)},hold:()=>e?Fh(i):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function Fh(i){if(i.salesClosed)return{ok:!1,reason:"event_closed"};if(!i.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=i.controller.getSelectionValidity(i.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await i.handleCta(),i.hold?{ok:!0,hold:{id:i.hold.holdId,expiresAt:i.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function Wa(i,e){if(e.objectType!=="seat"&&e.objectType!=="booth")return null;let t=i.seatByLabel(e.label),n=t?i.toSeat(t).tiers:void 0;return n&&n.length>1?n:null}async function Ya(i,e,t,n){let o=i.currentHold(),s=o?.items??[],r=s.find(c=>c.label===e);if(!o||!r||r.tierId===t)return null;let a=s.map(c=>({label:c.label,tierId:c.label===e?t:c.tierId,...c.quantity!=null?{quantity:c.quantity}:{}})),l=await i.api.hold(i.key,a,n,o.holdId);return i.setHold({holdId:l.holdId,labels:a.map(c=>c.label),expiresAt:l.expiresAt,items:l.items}),i.currentHold()}function vo(i){return{renderingTimeMillis:i.ms,performanceProfile:i.performanceProfile,seatCount:i.seatCount,objectCount:i.objectCount,sectionCount:i.sectionCount,view:i.view,eventKey:i.eventKey,chartName:i.chartName,floorCount:i.floorCount,transport:i.transport,load:i.load,metricScope:i.metricScope,operationalTelemetryReporter:"sdk"}}function Za(i,e){ye({apiBase:i.apiBase,event:i.eventKey,scope:i.metricScope,surface:i.surface,outcome:"success",ms:i.ms,performanceProfile:i.performanceProfile,seats:i.seatCount,floors:i.floorCount,view:i.view,load:i.load,transport:i.transport,revealWaitMs:i.revealWaitMs,handoverMs:i.handoverMs}),e("chart_rendered",vo(i))}import{seatConfidenceDisclosure as Vh}from"@seatlayer/core/core/seatConfidence";function te(i){return String(i??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Qa(i){let e=Vh(i.seat.confidenceEvidence),t=i.seat.confidenceEvidence,n=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${te(c)}</li>`).join("")}</ul>`:"",o=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${te(e.modeledTarget)}</dd></div>`:"",s=t?`<div><dt>Evidence ID</dt><dd>${te(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${te(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${te(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${te(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${te(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",r=Mi(i.seat.commercial).join(" \xB7 ")||i.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${te(r)}</dd></div>`+(i.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${te(i.seat.commercial.note)}</dd></div>`:""),l=i.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${te(i.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${te(e.headline)}</strong><span>${te(e.coverage)} \xB7 ${te(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${te(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${te(e.reality)}</dd></div><div><dt>Source</dt><dd>${te(e.provenance)}</dd></div>`+a+o+s+`</dl>${n}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function Xa(i){return i?i.closest("[data-report]")?"report":i.closest("[data-close]")||i.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function yn(i,e,t){let n=i?.querySelector("[data-report]"),o=i?.querySelector("[data-report-status]");n&&(n.disabled=e!=="failed",n.textContent=e==="received"?"Report received":"Report this view"),o&&(o.setAttribute("role",e==="failed"?"alert":"status"),o.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function wo(i,e,t=null){let n=i.view3dEl;if(!n)return;ri(i,!1);let o=e.confidenceEvidence,s=i.controller.seatDetails(e.id),r=document.createElement("div");r.className="sl-view3d-passport-shell",r.innerHTML=Qa({seat:e,title:s?.displayLabel??e.displayLabel??e.label,restrictionFallback:i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof i.api.reportViewEvidence=="function"});let a=[...new Set([...n.children,...[...i.els.map.children].filter(m=>m!==n)])].filter(m=>m instanceof HTMLElement),l=a.map(m=>({element:m,inert:m.inert,ariaHidden:m.getAttribute("aria-hidden")}));for(let m of a)m.inert=!0,m.setAttribute("aria-hidden","true");n.appendChild(r),n.classList.add("has-passport"),i.view3dPassportEl=r;let c=r.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=m=>{if(m.key==="Escape"){m.preventDefault(),m.stopPropagation(),m.stopImmediatePropagation(),ri(i);return}if(m.key!=="Tab")return;let p=d();if(!p.length)return;let v=p[0],g=p[p.length-1];m.shiftKey&&document.activeElement===v?(m.preventDefault(),g.focus()):!m.shiftKey&&document.activeElement===g&&(m.preventDefault(),v.focus())};window.addEventListener("keydown",u,!0),i.view3dPassportCleanup=()=>{window.removeEventListener("keydown",u,!0);for(let g of l)g.element.inert=g.inert,g.ariaHidden===null?g.element.removeAttribute("aria-hidden"):g.element.setAttribute("aria-hidden",g.ariaHidden);let m=t?.isConnected?t:i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareEl?.querySelector("[data-passport-seat]")??null,p=m?.closest(".sl-confirm,.sl-view3d-compare");p?.isConnected&&(p.inert=!1,p.removeAttribute("aria-hidden")),r.remove(),n.classList.remove("has-passport"),i.view3dPassportEl===r&&(i.view3dPassportEl=null);let v=m??i.view3dCompareEl?.querySelector("[data-passport-seat]")??i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareChip.mainButton();(t?.isConnected?t:v)?.focus()},r.addEventListener("click",m=>{let p=Xa(m.target instanceof HTMLElement?m.target:null);p==="close"&&ri(i),p==="report"&&$h(i,e)}),requestAnimationFrame(()=>d()[0]?.focus()),i.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:o?.evidenceId??null,eventConfigurationId:o?.eventConfigurationId??null,modelLevel:o?.modelLevel??"unverified",realityLevel:o?.realityLevel??"none"})}async function $h(i,e){if(i.api.reportViewEvidence){yn(i.view3dPassportEl,"sending");try{let t=await i.api.reportViewEvidence(i.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});i.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),yn(i.view3dPassportEl,"received",t.report.id)}catch{yn(i.view3dPassportEl,"failed")}}}function ri(i,e=!0){let t=i.view3dPassportCleanup;if(i.view3dPassportCleanup=null,!t){i.view3dPassportEl?.remove(),i.view3dPassportEl=null,i.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function Ja(i){let e=i.view3dEl;if(!e||i.view3dCompareSeatIds.length<2)return;ot(i,!1);let t=i.view3dCompareSeatIds.map(p=>i.view3dComparisonSnapshot(p)).filter(p=>!!p);if(t.length<2){i.clearView3dComparison();return}let n=p=>E(p),o=t.some(p=>!!p.price),s=document.createElement("div");s.className="sl-view3d-compare-shell";let r=t.map((p,v)=>`<article><span>Seat ${v===0?"A":"B"}</span><strong>${n(p.label)}</strong><small>Section ${n(p.section)} \xB7 Row ${n(p.row)}</small><dl>`+(o?`<div><dt>Current price</dt><dd>${n(p.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${n(p.category)}</dd></div><div><dt>Availability</dt><dd>${n(p.availability)}</dd></div><div><dt>View source</dt><dd>${n(p.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${n(p.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${n(p.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${n(p.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${n(p.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${n(p.seat.id)}">Passport</button><button type="button" data-view-seat="${n(p.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${n(p.seat.id)}"${p.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");s.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${o?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${r}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(p=>p instanceof HTMLElement),c=l.map(p=>({element:p,inert:p.inert,ariaHidden:p.getAttribute("aria-hidden")}));for(let p of l)p.inert=!0,p.setAttribute("aria-hidden","true");e.appendChild(s),e.classList.add("has-comparison"),i.view3dCompareEl=s;let d=s.querySelector(".sl-view3d-compare"),u=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],m=p=>{if(p.key==="Escape"){p.preventDefault(),ot(i);return}if(p.key!=="Tab")return;let v=u();if(!v.length)return;let g=v[0],T=v[v.length-1];p.shiftKey&&document.activeElement===g?(p.preventDefault(),T.focus()):!p.shiftKey&&document.activeElement===T&&(p.preventDefault(),g.focus())};window.addEventListener("keydown",m),i.view3dCompareCleanup=()=>{window.removeEventListener("keydown",m);for(let p of c)p.element.inert=p.inert,p.ariaHidden===null?p.element.removeAttribute("aria-hidden"):p.element.setAttribute("aria-hidden",p.ariaHidden);s.remove(),e.classList.remove("has-comparison"),i.view3dCompareEl===s&&(i.view3dCompareEl=null),a?.isConnected?a.focus():i.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>ot(i)),s.querySelectorAll("[data-passport-seat]").forEach(p=>p.addEventListener("click",()=>{let v=p.dataset.passportSeat,g=v?i.allSeats().find(T=>T.id===v):void 0;g&&wo(i,g,p)})),s.querySelectorAll("[data-view-seat]").forEach(p=>p.addEventListener("click",()=>{let v=p.dataset.viewSeat;ot(i,!1),v&&i.view3dHandle?.flyToSeat(v)})),s.querySelectorAll("[data-select-seat]").forEach(p=>p.addEventListener("click",()=>{let v=p.dataset.selectSeat;v&&zh(i,v)})),requestAnimationFrame(()=>u()[0]?.focus()),i.emit3dAnalytics("3d_comparison_opened",{seatIds:i.view3dCompareSeatIds.slice()})}function ot(i,e=!0){let t=i.view3dCompareCleanup;if(i.view3dCompareCleanup=null,!t){i.view3dCompareEl?.remove(),i.view3dCompareEl=null,i.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function zh(i,e){if(i.salesClosed){i.toast(i.closedWords?.().toast??i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=i.allSeats().find(o=>o.id===e);if(!t)return;if(ot(i,!1),!i.controller.select([e]).length){i.syncSelectionTo3d(),i.toast(i.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}i.syncSelectionTo3d(),i.showConfirm(t),i.emit3dAnalytics("3d_comparison_selected",{seatId:e})}import{seatViewDisclosure as Yh}from"@seatlayer/core/view3d/crossfade/panorama";import{t as el}from"@seatlayer/core";var jh=900,Gh=450;function Kh(i){switch(i){case"seat":return b("picker.stopYourSeat","Your seat");case"row":return b("picker.stopYourRow","Your row");case"section":return b("picker.stopYourSection","Your section");default:return b("picker.stopWholeVenue","Whole venue")}}function tl(i,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let n=b("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",n),t.title=n,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let o=document.createElement("div");o.className="sl-view3d-stop",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),i.append(t,o);let s=null,r=null;return{onStopChange(a){if(s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null),!a){o.classList.remove("is-shown"),o.textContent="",r=setTimeout(()=>{r=null,i.classList.remove("is-seat-view")},Gh);return}i.classList.add("is-seat-view"),o.textContent=Kh(a),o.classList.add("is-shown"),s=setTimeout(()=>{s=null,o.classList.remove("is-shown")},jh)},dispose(){s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null),t.remove(),o.remove(),i.classList.remove("is-seat-view")}}}var Uh=44,qh=92;function il(i,e,t,n={}){let o=i?.sectionLabel,s=q(i),r=Wh(i,e),a=[o,s?el("picker.rowLabel",{label:s}):null,r?el("picker.seatLabel",{label:r}):null].filter(Boolean).join(" \xB7 "),l=n.maxChars??(n.narrow?Uh:qh);for(let c of[t,n.shortTail??t,null]){let d=[a,c].filter(Boolean).join(" \xB7 ");if(d.length<=l||c==null)return d}return a}function Wh(i,e){if(i?.seatNumber)return i.seatNumber;let t=i?.displayLabel??e,n=o=>{!o||!t.startsWith(o)||t.length<=o.length||(t=t.slice(o.length).replace(/^[\s·\-\/_]+/,""))};return n(i?.sectionLabel),n(q(i)),t}import{seatConfidenceDisclosure as Zh}from"@seatlayer/core/core/seatConfidence";var Qh=220;function Xh(i,e,t){let n=null,o=null,s=null;return(r,a)=>{i()?.presentSeatHover?.(r,a,e),s=a,r!==o&&(o=r,n&&(clearTimeout(n),n=null),!(!r||!t)&&(n=setTimeout(()=>{if(n=null,o!==r)return;let c=t()?.(r)??null;c&&o===r&&i()?.presentSeatHover?.(r,s,e,c)},Qh)))}}function nl(i){return i.buyerView}function ol(i,e,t){if(e==="map"){i.exit3d();return}let n=t?.flyToSeatId;if(i.buyerView==="venue3d"){n?(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:n}),i.view3dHandle?.flyToSeat(n)):t?.resetView&&i.view3dHandle?.focusOverview();return}i.enter3d(n)}function sl(i,e){switch(i.controller.getStatus(e.id)){case"held":if(!al(i,e))return"held";break;case"booked":case"not_for_sale":return"sold";default:break}return i.priceBandKeys!=null&&!i.priceBandKeys.has(e.categoryKey)||i.controller.accessibilityFilterDims?.(e)||i.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function rl(i){if(!i.view3dHandle)return;let e=i.allSeats().map(t=>({seatId:t.id,state:i.seatState3dFor(t)}));i.view3dHandle.setAvailability(e),i.syncSelectionTo3d()}function al(i,e){return i.controller.currentHold()?.labels.includes(e.label)===!0}function Jh(i){return(i.controller.currentHold()?.labels??[]).map(e=>i.controller.seatByLabel(e)?.id).filter(e=>!!e)}function ll(i){if(!i.view3dHandle)return;let e=new Set(i.controller.getSelection().map(t=>t.id));for(let t of Jh(i))e.add(t);i.view3dHandle.setSelection([...e])}function cl(i,e){let t=i.view3dHandle;if(!t)return;i.pushAvailabilityTo3d(),i.syncSelectionTo3d();let n=e[0];!n||e.every(s=>s.rowId===n.rowId)&&t.focusRow(n.rowId)||n.sectionId&&t.focusSection(n.sectionId)}async function dl(i,e){let t=i.allSeats().find(n=>n.id===e);if(!t)return null;if(t.viewUrl)try{let n=t.viewMeta?.previewUrl,o=!!n&&n!==t.viewUrl,s=o?await i.buyerAssetUrls.resolve(n):null,r=o?t.viewUrl:await i.buyerAssetUrls.resolve(t.viewUrl);return!r||o&&!s?null:{url:r,...s?{previewUrl:s}:{},...o?{resolveUrl:a=>i.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(n){return i.opts.onError?.(n),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:i.tf("picker.chartDerivedModel","Chart-derived model")}}function pl(i,e){if(i.salesClosed){i.toast(i.closedWords?.().toast??i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),i.syncSelectionTo3d();return}let t=i.allSeats().find(a=>a.id===e);if(!t)return;let n=i.controller.tableSelection(e);if(i.committedSelection().some(a=>n?a.label===n.label:a.id===e)){i.controller.deselect([e]),i.dismissConfirm(),i.syncSelectionTo3d();return}let s=i.controller.getStatus(t.id);if(s==="held"||s==="booked"||s==="not_for_sale"){i.syncSelectionTo3d();return}if(!i.controller.select([e]).length){i.syncSelectionTo3d(),i.dismissConfirm();return}if(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),i.flashPickedSeat(e),n){i.showTableDialog(n,!1),i.syncSelectionTo3d();return}i.opts.confirmSelection!==!1?i.showConfirm(t):i.syncTray(),i.syncSelectionTo3d()}function hl(i,e){let t=i.allSeats().find(n=>n.id===e);return il(i.controller.seatDetails(e),t?.displayLabel??t?.label??e,i.tf("picker.viewFromYourSeat","view from your seat"),{narrow:i.root?.dataset.layout==="narrow",shortTail:i.tf("picker.fromYourSeat","from your seat")})}function ul(i,e){if(i.buyerView!=="venue3d")return;let t=i.view3dCompareSeatIds;t.includes(e.id)||(i.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),i.confirmSeat?.id===e.id&&(i.controller.deselect([e.id]),i.dismissConfirm(),i.syncSelectionTo3d(),i.syncTray()),i.view3dCompareChip.sync(),i.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:i.view3dCompareSeatIds.length}),i.view3dCompareSeatIds.length>1?i.openView3dComparison():i.toast(i.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function ml(i){i.closeView3dComparison(!1),i.view3dCompareSeatIds=[],i.view3dCompareChip.remove(),i.emit3dAnalytics("3d_comparison_cleared")}function fl(i,e){let t=i.allSeats().find(v=>v.id===e);if(!t)return null;let n=i.controller.seatDetails(t.id),o=i.controller.doc?.categories.find(v=>v.key===t.categoryKey),s=n?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),r=s!=null?i.paidPrice(t.categoryKey,n?.tierId??o?.tiers?.[0]?.id??null,s,t.label):void 0,a=i.controller.getStatus(t.id),l=a==="free"||!a?i.tf("picker.available","Available"):al(i,t)?i.tf("picker.heldForYou","Held for you"):i.tf("picker.group.legendUnavailable","Unavailable"),c=t.viewUrl?Yh({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):i.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=Mi(t.commercial).join(" \xB7 ")||i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),u=Ss({...t.accessibility?.length?{accessibility:t.accessibility}:{},...n?.wheelchairSpaceType?{wheelchairSpaceType:n.wheelchairSpaceType}:{}}),m=u.length?`${u.join(" \xB7 ")} \xB7 metadata, not access certification`:i.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),p=Zh(t.confidenceEvidence);return{seat:t,label:n?.displayLabel??t.displayLabel??t.label,section:n?.sectionLabel??t.sectionId??"\u2014",row:q(n)??n?.rowLabel??"\u2014",category:n?.categoryLabel??o?.label??t.categoryKey,price:i.suppressPricing||r==null?"":i.money(r),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:m,confidence:p}}async function gl(i,e){if(i.view3dEl||!i.canOffer3d()||!i.els.map)return;let t=i.controller.doc;if(!t)return;i.buyerView="venue3d",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),i.root?.setAttribute("data-view3d","on"),i.dismissConfirm(),i.syncProjection(),i.syncTray();let n=document.createElement("div");n.className="sl-view3d sl-mo-zoom",n.setAttribute("role","group"),n.setAttribute("aria-label",i.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let o=document.createElement("button");o.type="button",o.className="sl-view3d-back",o.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${i.tf("picker.backToMap","Back to map")}</span>`;let s=o.querySelector("span"),r=c=>{i.view3dTargetSeatId=c;let d=!!c;n.classList.toggle("is-seat-focused",d),i.root&&(i.root.dataset.view3dSeat=d?"on":"off");let u=d?i.tf("picker.backToVenue","Back to venue"):i.tf("picker.backToMap","Back to map");s&&(s.textContent=u),o.setAttribute("aria-label",u)};if(o.addEventListener("click",()=>{if(i.view3dTargetSeatId&&i.view3dHandle){i.view3dHandle.focusOverview();return}i.exit3d()}),i.regions["top-left"]?.prepend(o),i.view3dBack=o,i.publish3dTopInset(),Fa(i.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let d=i.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",d),c.title=d,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||i.fsFallback||i.framedFs)),c.addEventListener("click",()=>i.toggleFullscreen()),n.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=i.tf("picker.loading3d","Building the 3D venue\u2026"),n.appendChild(a),i.els.map.appendChild(n),i.view3dEl=n,i.view3dCompareChip.sync(),requestAnimationFrame(()=>{n.style.opacity="1"});let l=++i.view3dGen;try{let c=i.allSeats(),[d,u]=await Promise.all([wi(),i.controller.loadEventConfiguration()]),m=u?await Wi(u,y=>i.buyerAssetUrls.resolve(y)):null,p=t.theme?.venue3d?.shellAssetUrl,v=await Yi(p,y=>i.buyerAssetUrls.resolve(y));if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let g={doc:t,seats:c,...m?{eventConfigurationId:m.id,eventConfiguration:m}:{},...v?{registeredShellGlb:v}:{}};a.textContent=i.tf("picker.building3d","Building venue geometry\u2026");let T=await d.prepareVenue3D(g);if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let S=d.mountVenue3D(n,{...g,prepared:T},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:Ye(),navLabels:yi(),seatViewActionLabel:y=>i.allSeats().find(P=>P.id===y)?.viewUrl?i.tf("picker.openAuthored360","Open venue 360\xB0"):i.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:y=>i.seatViewCaption(y),onSeatViewStopChange:y=>i.view3dSeatViewChrome?.onStopChange(y),onSeatPick:y=>i.onView3dSeatPick(y),onSeatInspect:y=>i.onView3dSeatPick(y),onSeatHover:Xh(()=>i.controller.getRenderer(),n,()=>{let y=S.captureSeatView;return y?P=>y.call(S,P):void 0}),onSectionFocusChange:y=>{let P=n.querySelector('select[data-locator="section"]'),R=y??"";!P||P.value===R||(P.value=R,P.dispatchEvent(new Event("change")))},onViewTargetChange:y=>{n.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!y),r(y),i.opts.onBuyerViewChange?.({view:"venue3d",...y?{seatId:y}:{}})},...i.seatViewEnabled()?{getSeatView:y=>new Promise((P,R)=>{let G=()=>{i.seatViewFor3d(y).then(L=>{L?P(L):R(new Error("seat_view_unavailable"))})},f=globalThis.requestIdleCallback;typeof f=="function"?f(G,{timeout:1500}):setTimeout(G,50)})}:{},onAnalytics:(y,P)=>i.emit3dAnalytics(y,P)});i.view3dHandle=S,i.view3dSeatViewChrome=tl(n,{handle:()=>i.view3dHandle}),requestAnimationFrame(()=>a.remove()),i.pushAvailabilityTo3d(),i.syncSelectionTo3d(),i.view3dNav=Ba(i.regions["bottom-left"]??n,S),e&&S.flyToSeat(e)}catch(c){if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;i.opts.onError?.(c),i.toast(i.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),i.exit3d()}}function bl(i){let e=i.regions["top-left"];if(!i.root||!e)return;let t=()=>{!i.root||i.root.dataset.view3d!=="on"||i.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function yl(i){if(i.buyerView!=="venue3d"&&!i.view3dEl)return;i.view3dGen++,i.buyerView="map",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"map"}),i.root?.removeAttribute("data-view3d"),i.closeSeatConfidencePassport(!1),i.closeView3dComparison(!1),i.view3dCompareChip.remove(),i.view3dSeatViewChrome?.dispose(),i.view3dSeatViewChrome=null,i.view3dBack?.remove(),i.view3dBack=null,i.view3dNav?.remove(),i.view3dNav=null,i.root?.removeAttribute("data-view3d-seat"),i.root?.style.removeProperty("--sl-3d-top-inset");try{i.view3dHandle?.dispose()}catch{}i.view3dHandle=null;let e=i.view3dEl;i.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),i.syncProjection(),i.syncTray();let t=i.view3dReturnSeat;i.view3dReturnSeat=null,t&&i.committedSelection().some(n=>n.id===t.id)&&i.opts.confirmSelection!==!1&&i.showConfirm(t)}import{t as tu}from"@seatlayer/core";import{t as vn}from"@seatlayer/core";function vl(i){return Array.isArray(i)?i.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function wn(i,e,t=!1){let n=i.violations[0];return n==="numberOfPlacesToSelect"?i.remaining>0?vn("picker.selectExactMore",{count:i.remaining}):vn("picker.selectExactCount",{count:i.required}):n==="minimumSelectedPlaces"?vn("picker.selectMinimumMore",{count:i.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):n==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):vn("picker.orphanHint")}var xo=6e4,wl=5*6e4,iu=String(Math.round(wl/6e4));function xl(i){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(i.regions["bottom-center"]??i.els.map).appendChild(e),i.extendEl=e,i.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),i.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),i.els.extendBtn.textContent=kl(i),i.els.extendDismiss.setAttribute("aria-label",i.tf("picker.close","Close")),i.els.extendBtn.addEventListener("click",()=>{i.handleExtend()}),i.els.extendDismiss.addEventListener("click",()=>{i.extendDismissed=!0,i.setExtendPrompt(!1,0)})}function kl(i){return i.tf("picker.addMinutes","+{count} min").replace("{count}",iu)}function Sl(i){let e=i.hold?.items??[],t=new Set(e.map(o=>o.label));return i.committedSelection().filter(o=>!t.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0)+Fe(i.gaQty,i.hold?.items??[])}function Tl(i){return(i.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function El(i){let e=new Set((i.hold?.items??[]).map(n=>n.label)),t=i.committedSelection().filter(n=>!e.has(n.label)).reduce((n,o)=>n+(o.quantity??1),0);return i.heldTicketCount()+t+Fe(i.gaQty,i.hold?.items??[])}function Cl(i){let e=new Set((i.hold?.items??[]).map(o=>o.label)),t=i.committedSelection().filter(o=>e.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0),n=Math.max(0,i.maxTickets-i.heldTicketCount()-Fe(i.gaQty,i.hold?.items??[]));i.controller.setMaxSelection(t+n)}function Al(i,e=i.lastTrayCount,t=i.pendingSelectionCount()){let n=i.els.cta;if(!n)return;if(delete n.dataset.act,i.salesClosed&&!i.finishingHold?.()){n.disabled=!0,n.textContent=i.closedWords?.().cta??i.tf("picker.salesClosedCta","Sales closed");return}if(i.ctaPhase==="holding"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(i.ctaPhase==="checkout"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let o=!i.hold&&i.performanceGroup?.selectionMode==="per_performance"?i.performanceGroup.submissionState?.():null;if(o&&!o.ready){n.disabled=!0,n.textContent=i.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(o.complete)).replace("{total}",String(o.total));return}let s=i.controller.getSelectionValidity(e);if(s&&!s.isValid){n.disabled=!0,n.textContent=wn(s,(r,a)=>i.tf(r,a),!0);return}if(!e&&i.root?.dataset.layout==="narrow"&&!i.performanceGroup&&!i.hold&&!i.bestAvailableSoldOut){n.disabled=!1,n.dataset.act="find",n.textContent=i.tf("picker.findBestSeats","Find best seats");return}n.disabled=e===0,n.textContent=i.hold?t?tu("picker.secureMoreAndCheckout",{count:t}):i.tf("picker.continueToCheckout","Continue to checkout"):e?i.performanceGroup?i.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(i.performanceGroup.performanceCount)):i.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):i.tf("picker.selectSeats","Select seats")}function Pl(i,e){i.ctaPhase=e,i.syncCta()}async function Ll(i,e,t){i.setCtaPhase("checkout");try{await i.checkoutHandoff(e,t)}finally{i.ctaPhase==="checkout"&&!i.bookedShown&&i.setCtaPhase("idle")}}function Ml(i){return`@seatlayer/hold/v1/${encodeURIComponent(i.apiBase)}/${encodeURIComponent(i.opts.event)}`}function Hl(i){if(i.opts.initialHoldId)return i.opts.initialHoldId;if(i.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(i.holdStorageKey())}catch{return null}}function Rl(i,e){if(!(i.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(i.holdStorageKey(),e.holdId)}catch{}}function Il(i){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(i.holdStorageKey())}catch{}}async function Ol(i,e,t=!1){try{let n=await i.controller.resumeHold(e);if(!n||i.destroyed)return null;let o={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items};return i.hold=o,i.handedOff=!0,i.bookedShown=!1,i.ctaPhase="idle",i.startHoldTimer(o.expiresAt),i.rememberHold(o),i.syncTray(),i.emitHoldChange(),i.opts.onHoldRestored?.(o,o.seats??[],i.buildHandoff(o)),o}catch(n){let o=n?.status;if(o===404||o===409)i.forgetHold();else if(o===401&&n?.code==="buyer_access_invalid")i.forgetHold(),i.toast(i.tf("picker.savedSeatsNotRestored","Your earlier seats could not be restored. Please choose again."),"warning");else if(i.opts.onError?.(n),t)throw n;return null}}async function _l(i){let e=i.rememberedHoldId();e&&await i.resumeHoldFromServer(e,!0)}function Nl(i,e){i.stopHoldTimer(),i.holdExpiresAt=e,i.extendDismissed=!1,i.extendUsed=!1,i.hold&&i.rememberHold(i.hold);let t=i.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${i.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let n=t.querySelector('[data-ref="holdTime"]'),o=()=>{let s=Math.max(0,i.holdExpiresAt-Date.now());n&&(n.textContent=Ds(s)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=xo),i.setExtendPrompt(s>0&&s<=xo,s),(s<=0||!i.controller.currentHold())&&i.stopHoldTimer()};i.holdTimer=setInterval(o,500),o()}function Dl(i){i.holdTimer&&clearInterval(i.holdTimer),i.holdTimer=null,i.els.hold?.classList.remove("on","is-expiring"),i.setExtendPrompt(!1,0)}function Bl(i,e,t){if(!i.extendEl)return;let n=e&&t>0&&i.root?.dataset.layout!=="narrow"&&!i.extendDismissed&&!i.extendUsed&&!!i.controller.currentHold()&&!i.bookedShown;i.extendEl.classList.toggle("on",n)}function Fl(i){if(!i.holdTimer)return;let e=Math.max(0,i.holdExpiresAt-Date.now());i.setExtendPrompt(e>0&&e<=xo,e)}async function Vl(i){let e=i.els.extendBtn,t=i.controller.currentHold();if(!(!t||!i.api.extend||i.extendUsed)){e.disabled=!0,e.textContent=i.tf("picker.addingEllipsis","Adding\u2026");try{let n=await i.api.extend(i.controller.key,t.holdId,wl);if(i.controller.currentHold()?.holdId!==t.holdId)return;i.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:n.expiresAt,items:t.items});let o=i.controller.currentHold();if(!o)return;i.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},i.holdExpiresAt=o.expiresAt,i.extendUsed=!0,i.extendEl?.classList.remove("on"),i.rememberHold(i.hold),i.emitHoldChange(),i.toast(i.tf("picker.moreTimeAdded","More time added. Your seats are still held."),"success")}catch(n){if(n?.reason==="extend_limit"){i.extendUsed=!0,i.setExtendPrompt(!1,0);return}i.opts.onError?.(n),i.toast(i.tf("picker.couldNotAddMoreTime","Couldn't add more time. Please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=kl(i)}}}function ou(i){let e=i;return e?.status===404?"ended":e?.status!==409||e.code!=="hold_not_active"?"unknown":e.reason==="booked"?"booked":"ended"}async function $l(i,e){try{return await i(e),!1}catch(t){return ou(t)==="booked"}}import{t as Ul}from"@seatlayer/core";function zl(i){return i?.previousPrice!=null&&i.previousPrice>i.price?i.previousPrice:null}function jl(i){return su(i)+(i.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!i.collapsed}">${i.esc(i.moreLabel)}</button>`:"")+ru(i.status)}function su(i){let{esc:e,money:t}=i;return i.categories.map(n=>{let o=i.priceOf(n),s=i.rangeOf(n),r=i.offerOf(n.key),a=zl(r),l=i.activeKey===n.key;return`<div class="sl-price-row${i.bandKeys!=null&&!i.bandKeys.has(n.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(n.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(i.titleFor(n,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(i.colorOf(n))}"></span><span class="sl-price-label"><span class="sl-price-name">${e(n.label)}</span>`+(r?.offerName?Pi(r.offerName,e):"")+"</span>"+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(s!=null?`<span class="sl-price-amt">${s.min===s.max?e(t(s.min)):`${e(t(s.min))}\u2013${e(t(s.max))}`}</span>`:o!=null?`<span class="sl-price-amt">${e(t(o))}</span>`:"")+"</div>"}).join("")}function ru(i){let e=t=>t.replace(/[&<>"']/g,n=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[n]);return`<div class="sl-status-key" aria-label="${e(i.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(i.unavailable)}</span></div>`}function ko(i){let e=Math.abs(i.scrollLeft),t=e>2,n=e+i.clientWidth<i.scrollWidth-2;return i.dataset.fadeStart=String(t),i.dataset.fadeEnd=String(n),{start:t,end:n}}function Gl(i){let{esc:e,money:t}=i;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${i.allActive}" title="${e(i.allWord)}"><span class="sl-rc-t">${e(i.allWord)}</span></button>`+i.categories.map(o=>{let s=i.rangeOf(o),r=i.priceOf(o),a=s?s.min===s.max?t(s.min):`${t(s.min)}+`:r!=null?t(r):null,l=Object.prototype.hasOwnProperty.call(i.left,o.key)&&i.left[o.key]<=0,c=zl(i.offerOf(o.key)),d=a?`${o.label}: ${a}${l?` (${i.soldOutWord})`:""}`:o.label;return`<button type="button" class="sl-rc" data-cat="${e(o.key)}" aria-pressed="${i.activeKey===o.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(i.colorOf(o))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??o.label)}</span></button>`}).join("")}function Kl(i,e){let t=i.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let n=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(n.length<=5)return n.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let o=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),s=Math.ceil(o.length/4),r=[];for(let a=0;a<o.length;a+=s){let l=o.slice(a,a+s),c=Math.min(...l.map(u=>u.range.min)),d=Math.max(...l.map(u=>u.range.max));r.push({id:`b${a}`,label:c===d?e.money(c):`${e.money(c)}\u2013${e.money(d)}`,keys:l.map(u=>u.key),min:c,max:d})}return r}function ql(i){if(i.els.pricesSec?.querySelectorAll(".sl-price-select").forEach(o=>o.remove()),i.priceSelect=null,i.suppressPricing||!i.els.prices||!i.els.pricesSec)return;let e=Kl((i.controller.doc?.categories??[]).filter(o=>!o.notForSale),i.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",i.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let n=document.createElement("option");n.value="all",n.textContent=i.tf("picker.allPrices","All prices"),t.appendChild(n);for(let o of e){let s=document.createElement("option");s.value=o.id,s.textContent=o.label,t.appendChild(s)}i.els.pricesSec.appendChild(t),i.priceSelect=t,t.addEventListener("change",()=>{i.applyPriceBand(e.find(o=>o.id===t.value)?.keys??null)})}function Wl(i,e){if(i.focusedCatKey=null,i.priceBandKeys=e?new Set(e):null,i.priceSelect){let t=e?i.priceSelect.value:"all";i.priceSelect.value!==t&&(i.priceSelect.value=t)}i.controller.setCategoryFilter(e),i.controller.focusCategoryFilter(e),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}function Yl(i){return{colorOf:e=>i.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>i.catPriceRange(e),priceOf:e=>i.catPrice(e),offerOf:e=>i.offerPrice(e),money:e=>e?i.money(e):i.tf("checkout.free","Free"),esc:_}}function Zl(i,e,t,n=i.legendDeps()){let o=i.els.railScroll,s=e.length>1;if(i.els.rail?.classList.toggle("has",s),!o)return;o.innerHTML=s?Gl({...n,categories:e,left:t,activeKey:i.focusedCatKey,soldOutWord:i.tf("picker.soldOut","Sold out"),allWord:i.tf("picker.allPrices","All prices"),allActive:!i.focusedCatKey&&!i.priceBandKeys}):"";let r=e.map(a=>a.key).join("|");i.lastRailSignature!==r&&(i.lastRailSignature=r,o.scrollLeft=0),o.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){i.applyPriceBand(null);return}i.focusCategory(a.dataset.cat??"")})}),i.railEdgesBound||(i.railEdgesBound=!0,o.addEventListener("scroll",()=>ko(o),{passive:!0})),requestAnimationFrame(()=>ko(o))}function Ql(i){let e=i.controller.doc;if(!e||!i.els.prices)return;let t=i.controller.categoryAvailability(),n=e.categories.filter(u=>!u.notForSale);i.syncSoldout(n,t);let o=i.legendDeps(),s=i.suppressPricing,r=s?{...o,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:o;s&&(i.els.pricesSec?.querySelector("span")?.replaceChildren(i.tf("picker.seatCategories","Seat categories")),i.els.pricesInfo?.remove()),i.syncPriceRail(n,t,r);let a=5,l=n.length-a,c=l>1&&!i.pricesExpanded,d=c?n.slice(0,a):n;i.els.prices.classList.toggle("sl-expanded",l>1&&i.pricesExpanded),i.els.prices.innerHTML=jl({...r,categories:d,left:t,collapsed:c,activeKey:i.focusedCatKey,bandKeys:i.priceBandKeys,titleFor:(u,m)=>m?i.tf("picker.showAllSeats","Show all seats"):Ul("picker.showLabelSeatsOnMap",{label:u.label}),moreLabel:l>1?c?s?i.tf("picker.showAllCategories","Show all categories"):Ul("picker.showAllTicketTypes",{count:n.length}):i.tf("picker.showFewer","Show fewer"):null,status:{legend:i.tf("picker.seatStatusLegend","Seat status legend"),unavailable:i.tf("picker.group.legendUnavailable","Unavailable")}}),i.els.prices.querySelectorAll(".sl-price-row").forEach(u=>{u.addEventListener("mouseenter",()=>i.controller.getRenderer()?.setCategoryHighlight?.(u.dataset.cat??null)),u.addEventListener("mouseleave",()=>i.controller.getRenderer()?.setCategoryHighlight?.(null));let m=()=>i.focusCategory(u.dataset.cat??"");u.addEventListener("click",m),u.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),m())})}),i.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{i.pricesExpanded=!i.pricesExpanded,i.syncPrices()})}function Xl(i,e){if(!e)return;let t=i.focusedCatKey===e?null:e;i.focusedCatKey=t,i.priceBandKeys=t?new Set([t]):null;let n=i.els.pricesSec?.querySelector(".sl-price-select");n&&(n.value="all"),i.controller.setCategoryFilter(t?[t]:null),i.controller.focusCategoryFilter(t?[t]:null),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}import{t as Jl,tCount as ec}from"@seatlayer/core";function pe(i,e,t){let n=Jl(i,t);return n&&n!==i?n:t?e.replace(/\{(\w+)\}/g,(o,s)=>s in t?String(t[s]):o):e}function lu(i){let e=ec("picker.seatCount",i);return e.includes("picker.seatCount")?`${i} ${i===1?"seat":"seats"}`:e}function cu(i){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(i)}catch{}return i.join(", ")}function du(i){if(i.length<2)return!1;let e=[...i].sort((t,n)=>t-n);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function pu(i){let e=i.filter(o=>o.objectType==="ga"),t=i.filter(o=>o.objectType!=="ga"),n=[];if(t.length){let o=lu(t.length),s=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],r=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(s.length===1&&r.length===1&&a.length===t.length){let l=t.length===1?pe("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:s[0],row:r[0],seat:String(t[0].seatNumber??"")}):du(a)?pe("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:s[0],row:r[0],from:Math.min(...a),to:Math.max(...a)}):"";n.push(l?pe("picker.releasedPair","{first} \xB7 {second}",{first:o,second:l}):pe("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]}))}else s.length===1?n.push(pe("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]})):s.length>1?n.push(pe("picker.releasedInSections","{seats} in Sections {sections}",{seats:o,sections:cu(s)})):n.push(o)}for(let o of e)n.push(pe("picker.releasedGa","{quantity} \xD7 {area}",{quantity:o.quantity??1,area:o.label}));return n.length?n.reduce((o,s)=>pe("picker.releasedPair","{first} \xB7 {second}",{first:o,second:s})):""}function tc(i){if(!i)return[];let e=new Map((i.seats??[]).map(o=>[o.label,o])),t=i.items??[];return(t.length?t.map(o=>({label:o.label,objectType:o.objectType,quantity:o.quantity})):[...e.keys()].map(o=>({label:o}))).map(o=>{let s=e.get(o.label);return{label:o.label,...o.objectType?{objectType:o.objectType}:{},...o.quantity==null?{}:{quantity:o.quantity},...s?.sectionLabel?{sectionLabel:s.sectionLabel}:{},...s?.rowLabel?{rowLabel:q(s)??s.rowLabel}:{},...s?.seatNumber?{seatNumber:s.seatNumber}:{}}})}function ic(i,e){if(!i.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let n=i.seatByLabel(t.label);!n||i.statusOf(n.id)!=="free"||i.flash(n.id,i.accent)}}function nc(i,e){if(!e.recoverable.length||!i.isConnected)return;let t=i.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(r=>Jl("picker.seatJustTakenByAnother",{label:r})).join(" "):t.remove());let n=i.querySelector(".sl-interrupt-actions"),o=n?.querySelector(".sl-interrupt-act");if(!n||!o)return;o.classList.add("sl-interrupt-act-secondary");let s=document.createElement("button");s.type="button",s.className="sl-interrupt-act sl-hold-expired-recover",s.textContent=ec("picker.holdLapsedSelectAgain",e.recoverable.length),s.addEventListener("click",()=>e.onRecover([...e.recoverable])),n.insertBefore(s,o),i.classList.add("has-recovery"),s.focus()}function oc(i,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let n=document.createElement("div");n.className="sl-interrupt-card sl-mo-in";let o=document.createElement("div");o.className="sl-interrupt-title",o.id="sl-hold-expired-title";let s=document.createElement("span");s.className="sl-interrupt-glyph",s.setAttribute("aria-hidden","true"),s.textContent="\u23F1";let r=document.createElement("span");r.textContent=pe("picker.holdExpiredTitle","Your seats were released"),o.append(s,r);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=pe("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),n.append(o,a);let l=pu(e);if(l){let m=document.createElement("div");m.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",m.textContent=l,n.appendChild(m)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=pe("picker.holdExpiredPickAgain","Pick your seats again to continue. They may already be taken."),n.appendChild(c),t.setAttribute("aria-labelledby",o.id),t.setAttribute("aria-describedby",a.id);let d=document.createElement("div");d.className="sl-interrupt-actions";let u=document.createElement("button");return u.type="button",u.className="sl-interrupt-act sl-hold-expired-restart",u.textContent=pe("picker.holdExpiredRestart","Choose seats again"),u.addEventListener("click",()=>i.restart()),d.appendChild(u),n.appendChild(d),t.appendChild(n),t.addEventListener("pointerdown",m=>{m.target===t&&i.restart()}),t}import{ACCESSIBILITY_TYPES as So,seatTypeIconSvg as sc,t as hu}from"@seatlayer/core";var rc={wheelchair:"Wheelchair space",companion:"Companion seat","semi-ambulatory":"Limited mobility","designated-aisle":"Aisle / transfer","step-free":"Step-free",hearing:"Assistive listening",cart:"Live captions","sign-language":"Sign language","low-vision":"Low vision","sensory-friendly":"Sensory-friendly","plus-size":"Plus-size","lift-armrest":"Lift-up armrest"},uu='<svg viewBox="0 0 20 20" width="17" height="17" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="10" cy="10" r="7.5" /><path d="M10 2.5a7.5 7.5 0 0 1 0 15Z" fill="currentColor" stroke="none" /></svg>',mu='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="13" cy="4.4" r="1.9"/><path d="M11 8.2v5.1h5.1"/><path d="M16.6 13.3l1.9 6.3"/><path d="M15.4 14.9a5.6 5.6 0 1 1-5.9-3.4"/></svg>',fu=8,gu=8,bu=88;function yu(i){let e=i.gap??fu,t=i.margin??gu,n=i.min??bu,o=Math.max(i.boundsTop,0);return Math.max(Math.round(i.buttonTop-o-e-t),n)}var xn=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let o=this.offered().length>0?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",o),this.button.innerHTML=mu,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let s of this.stored())this.offeredFree().has(s)&&this.active.add(s);if(this.menu.innerHTML=Os(o,t.tf("picker.close","Close"))+_s(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",s=>s.stopPropagation()),this.button.addEventListener("click",s=>{s.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",s=>{s.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",s=>s.stopPropagation()),this.menu.addEventListener("click",s=>s.stopPropagation()),this.menu.addEventListener("focusin",s=>{let r=s.target;r&&typeof r.scrollIntoView=="function"&&r.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=s=>{s.key==="Escape"&&this.open(!1)},this.reflow=()=>{this.menu.hidden||this.fit()},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),window.addEventListener("resize",this.reflow),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let s=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:n,count:o})=>[n,o])),t=!1;for(let n of this.menu.querySelectorAll("[data-a11y-row]")){let o=n.dataset.a11yRow??"";if(!o.startsWith("a11y:"))continue;let s=o.slice(5),r=e.get(s);if(r===void 0)continue;let a=this.countNode(n),l=r==null?"":this.countText(r);a&&(a.textContent=l);let c=r===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(s,l))),n.disabled=c,c?n.setAttribute("aria-disabled","true"):n.removeAttribute("aria-disabled"),c&&this.active.delete(s)&&(this.paint(n,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let n=t.dataset.a11yRow??"";n.startsWith("a11y:")&&this.paint(t,this.active.has(n.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${yu({boundsTop:this.boundsTop(),buttonTop:this.button.getBoundingClientRect().top})}px`)}boundsTop(){let e=this.root.closest(".sl-map")??this.root.closest(".sl-picker");return e instanceof HTMLElement?e.getBoundingClientRect().top:0}open(e){if(e===!this.menu.hidden)return;if(this.button.setAttribute("aria-expanded",String(e)),!e){this.menu.hidden=!0,this.menu.classList.remove("sl-mo-in","sl-mo-stagger");return}this.menu.hidden=!1,this.fit(),this.menu.scrollTop=0;let t=this.button.getBoundingClientRect();Gn(this.menu,{x:t.left+t.width/2,y:t.top}),or(this.menu),nr(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:sc("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:uu,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:n,count:o})=>({key:n,count:o}));let t=this.deps.present;return t?So.filter(({key:n})=>t.has(n)).map(({key:n})=>({key:n,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(So.map(n=>[n.key,n]));return this.offered().flatMap(({key:n,count:o})=>{let s=t.get(n);return s?[{key:`a11y:${n}`,iconHtml:sc(n,{size:17}),label:this.deps.tf(`picker.accessShort.${n}`,rc[n]??s.label),...n==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...o==null?{}:{count:this.countText(o),disabled:o===0},on:this.active.has(n)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),n=!t?.classList.contains("open");for(let o of this.menu.querySelectorAll(".sl-info.open"))o.classList.remove("open"),o.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",n),e.setAttribute("aria-expanded",String(n))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let s=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(s),this.paint(e,s);return}if(t==="limited"){let s=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(s),s&&this.deps.focusSeatsForFilter(),this.paint(e,s);return}let n=t.slice(5),o=!this.active.has(n);o?this.active.add(n):this.active.delete(n),this.paint(e,o),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let n=(e.dataset.a11yRow??"").slice(5),o=e.parentElement;o?.classList.contains("sl-a11yrow-w")||(o=document.createElement("div"),o.className="sl-a11yrow-w",e.replaceWith(o),o.appendChild(e));let s=document.createElement("button");s.type="button",s.className="sl-a11yrow-c sl-a11yjump",s.dataset.a11yJump=n,s.textContent=t.textContent,s.disabled=e.disabled,s.setAttribute("aria-label",this.jumpLabel(n,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(n,s.textContent??""));let r=o.querySelector(".sl-info");r?r.after(s):e.after(s),o.dataset.a11yTapThrough||(o.dataset.a11yTapThrough="true",o.addEventListener("click",a=>{a.target===o&&!e.disabled&&e.click()})),s.addEventListener("click",a=>{a.stopPropagation(),this.active.has(n)||(this.active.add(n),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(n);l&&s.setAttribute("aria-label",this.jumpLabel(n,s.textContent??"",l.label))})}}countText(e){return e>0?hu("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=rc[e]??So.find(n=>n.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,n){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...n?[`${this.deps.tf("picker.section","Section")} ${n}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};import{attachVisibilityCatchUp as vu}from"@seatlayer/core";var wu=250;function ac(i,e=wu){let t=null,n=()=>{t===null&&(t=setTimeout(()=>{t=null,i()},e))},o=vu(n),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",n),()=>{t!==null&&(clearTimeout(t),t=null),o(),s&&window.removeEventListener("focus",n)}}import{holdRecoveryShape as xu,tCount as kn}from"@seatlayer/core";var Sn=class{constructor(e){this.note=null;this.told=!1;this.deps=e}deferExpiryToast(e){this.told=!1,queueMicrotask(()=>{this.told||e()})}handle(e){if(!e.holdLapsed)return;this.told=!0;let t=xu(e),n=e.lapsedLabels.length,o=n-e.recoverable.length,s=t==="all"?kn("picker.holdLapsedStillFree",n):t==="partial"?kn("picker.holdLapsedSomeTaken",o):kn("picker.holdLapsedAllTaken",n);this.note={message:s,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(s,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${_(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${_(this.note.message)}</span>${e}</div>`}wire(e){e?.querySelector("[data-lapse-again]")?.addEventListener("click",()=>this.recover())}clear(){this.note&&(this.note=null,this.deps.syncTray())}actionLabel(){return kn("picker.holdLapsedSelectAgain",this.note?.recoverable.length??0)}recover(){let e=this.note?.recoverable??[];this.note=null,this.deps.syncTray(),e.length&&this.deps.reselect(e)}};var lc=Symbol("seatlayer.performance-group-picker");function Tn(i,e){return Object.defineProperty(i,lc,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),i}function cc(i){return i[lc]??null}var dc="@seatlayer/pending-checkout/v1";function ku(i){return typeof i=="string"&&i.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(i)}function _t(i){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let n=null;try{let o=window.sessionStorage.getItem(dc);if(o){let s=null;try{s=JSON.parse(o)}catch{}if(s&&ku(s.orderId)){let r=Date.now()-Number(s.storedAt);if(r>=0&&r<=144e5){if(s.eventKey&&s.eventKey!==i)return null;n=s.orderId}}}window.sessionStorage.removeItem(dc)}catch{}e.delete("seatlayer_checkout");try{let o=e.toString();history.replaceState(history.state,"",`${location.pathname}${o?`?${o}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:n}}function pc(i){if(!i.framed)return null;let e=i.ancestorOrigins?.length?i.ancestorOrigins[0]:null;for(let t of[e,i.referrer])if(t)try{return new URL(t).origin}catch{}return null}var uc="https://api.seatlayer.io",Mu=10,Hu=250,mc=6e4,fc=4,Ru=10,Iu=40,Ou=220,To=["mini","peek","open"],gc="seatmap.a11y.cb";function _u(){try{if(typeof window>"u")return null;let i=window.localStorage.getItem(gc);return i==null?null:i==="1"}catch{return null}}function Nu(i){try{window.localStorage.setItem(gc,i?"1":"0")}catch{}}var $e=class i{constructor(e){this.renderErrorEmitted=!1;this.realtime=null;this.accessEl=null;this.idleClock=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.viewportResizeHandler=null;this.holdTimer=null;this.loadAbort=null;this.transportAbort=new AbortController;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerCountdownTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.currencyResolved=!1;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.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedWaiters=[];this.seatsRevealedReport=null;this.renderResolvedAt=null;this.revealWaitMs=null;this.handoverMs=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=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.bestAvailableConfirm=!1;this.baSoldOutSig="";this.bestAvailableSoldOut=!1;this.salesClosed=!1;this.salesState=null;this.salesInfo=null;this.salesUi=null;this.salesUiLoad=null;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.testBadgeEl=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 un({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(e,t)=>this.toast(e,t)});this.view3dCompareEl=null;this.view3dCompareCleanup=null;this.view3dSeatViewChrome=null;this.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.arenaViewportInsets={top:0,right:0,bottom:0,left:0};this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.fullscreenAffordanceSize={rootWidth:-1,rootHeight:-1,viewportWidth:-1,viewportHeight:-1};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.sectionCardCache=null;this.lastTrayCount=0;this.langSel=null;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yMenu=null;this.detachAttention=null;this.lapse=new Sn({toast:(e,t,n)=>this.toast(e,t,n),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalCleanup=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.fitScheduled=!1;this.perspectiveWarned=!1;if(!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.performanceGroup=cc(e),this.suppressPricing=!!this.performanceGroup?.suppressPricing,this.opts={...e,confirmSelection:e.confirmSelection??!0},this.eventDetailsHidden=!!e.hideEventDetails,this.hostPricing=e.pricing,this.apiBase=(e.apiBase??uc).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},n=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?zi({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:n?.access??ti(e,t),this.pubApi=e.transport?null:n?.api??new _e(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=jr(e.transport??this.pubApi,this.transportAbort.signal),this.chartFetch=Bi(this.api),this.buyerAssetUrls=new Pt(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 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";let o=e.numberOfPlacesToSelect;if(o!=null&&(!Number.isInteger(o)||o<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=o??null;let s=vl(e.selectionValidators);if(this.exactTickets!=null&&s>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let r=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(Mu,s)));if(this.exactTickets!=null&&r<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&r<s)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??r,this.cbSafe=_u()??!!e.colorblindSafe,this.controller=this.wireController(e)}get confirmEl(){return this.confirmCard.element}set confirmEl(e){this.confirmCard.element=e}get confirmSeat(){return this.confirmCard.candidate}set confirmSeat(e){this.confirmCard.candidate=e}get lastSection(){return this.sectionCard.summary}set lastSection(e){this.sectionCard.adopt(e)}deliverableViewReference(e){return Ht(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=pc({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let n=t<640?1.2:.62;return Math.max(420,Math.round(t*n))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!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()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-fc&&t.width>=window.innerWidth-fc}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let n=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=n,e.tabIndex=n?-1:0,e.setAttribute("aria-hidden",String(n))}fullscreenMeasurementChanged(e,t){let n=typeof window>"u"?0:window.innerWidth,o=typeof window>"u"?0:window.innerHeight,s=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||n!==this.fullscreenAffordanceSize.viewportWidth||o!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:n,viewportHeight:o},s}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.root?.setAttribute("data-fs",String(e)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let n=this.els.zfs?.querySelector(".sl-zfs-lbl");n&&(n.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e)),this.syncFullscreenAffordance()}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,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.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){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.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){Lt();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement("div");n.className="sl-modal-scrim";let o=document.createElement("div");o.className="sl-modal-frame",o.style.setProperty("--sl-bg",yt(void 0,e.theme)["--sl-bg"]),o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",b("picker.seatSelection","Seat selection")),o.tabIndex=-1,n.appendChild(o),document.body.appendChild(n);let s=document.body.style.overflow;document.body.style.overflow="hidden";let r=zr(n),a;try{a=new i({...e,container:o})}catch(g){throw r(),n.remove(),document.body.style.overflow=s,g}a.prevFocus=t,a.modalCleanup=()=>{a.modalCleanup=null,r(),document.body.style.overflow=s,a.escHandler&&document.removeEventListener("keydown",a.escHandler),n.remove();let g=a.prevFocus;a.prevFocus=null,g?.isConnected&&g.focus({preventScroll:!0})};let l=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),c=()=>{let g=[...o.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(T=>T.isConnected&&!T.closest('[hidden], [aria-hidden="true"], [inert]'));return g[g.length-1]??o},d=(g,T)=>{let S=g;for(;S;){let y=window.getComputedStyle(S);if(S.hidden||S.getAttribute("aria-hidden")==="true"||S.hasAttribute("inert")||y.display==="none"||y.visibility==="hidden"||y.visibility==="collapse")return!0;if(S===T)return!1;S=S.parentElement}return!0},u=g=>[...g.querySelectorAll(l)].filter(T=>T.tabIndex>=0&&!T.matches(":disabled")&&!d(T,g)),m=(g,T)=>{let S=u(g),y=T?S[S.length-1]:S[0];y?y.focus({preventScroll:!0}):(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus({preventScroll:!0}))},p=!1,v=()=>{if(p)return;p=!0,a.modalCleanup?.();let g=()=>{a.destroy(),e.onClose?.()};a.hold&&!a.handedOff&&e.holdOnClose!=="keep"?a.release().finally(g):g()};a.closeModal=v,n.addEventListener("mousedown",g=>{g.target===n&&v()}),a.escHandler=g=>{if(g.key==="Tab"){if(g.defaultPrevented)return;let T=c(),S=u(T),y=S[0],P=S[S.length-1],R=document.activeElement;!y||!P?(g.preventDefault(),m(T,g.shiftKey)):R===T||!R||!T.contains(R)?(g.preventDefault(),(g.shiftKey?P:y).focus({preventScroll:!0})):g.shiftKey&&R===y?(g.preventDefault(),P.focus({preventScroll:!0})):!g.shiftKey&&R===P&&(g.preventDefault(),y.focus({preventScroll:!0}));return}g.key==="Escape"&&(a.tableDialog?(g.preventDefault(),a.cancelTableDialog()):a.confirmSeat?(g.preventDefault(),a.cancelConfirm()):a.bestAvailableConfirm?(g.preventDefault(),a.bestAvailableConfirm=!1,a.syncTray()):(g.preventDefault(),v()))},document.addEventListener("keydown",a.escHandler);try{let g=a.render();a.els.close?.classList.add("on"),a.els.close?.addEventListener("click",v),await g}catch(g){throw a.destroy(),g}return a.destroyed||m(c(),!1),a}static prewarm(e){try{if(!e||typeof e!="object"||typeof e.event!="string"||!e.event||typeof e.publicKey!="string"||!e.publicKey)return;er({base:(e.apiBase??uc).replace(/\/+$/,""),event:e.event,publicKey:e.publicKey})}catch{}}wireController(e){return new Su({sectionPreview:!0,transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.mapPriceRanges(),seatPriceLabel:t=>{let n=this.seatPriceRangeOf(t.label,t.categoryKey);return n?this.moneyRange(n):void 0},flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:bt(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,this.drainSeatsRevealedWaiters(),this.revealWaitMs===null&&this.renderResolvedAt!==null&&(this.revealWaitMs=performance.now()-this.renderResolvedAt),e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let n=this.controller.getGAAreas().find(o=>o.id===t);n&&(this.collapseSheet(),Zn(this,n,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),Qr(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,n=this.holdConflicted;this.holdExpiredUnits=tc(this.hold);let o=this.hold;this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear();let s=this.api.resume,r=t&&!n&&o&&s?$l(a=>s.call(this.api,this.opts.event,a),o.holdId):null;this.lapse.deferExpiryToast(()=>{if(t||n){let a=()=>this.toast(N("picker.holdExpired",void 0)||"Your hold expired. Seats released. Pick again.","warning");if(!r){a();return}r.then(l=>{if(!(this.destroyed||this.hold)){if(!l){a();return}this.hold=o,this.showBooked()}});return}this.showHoldExpired()}),this.syncTray(),this.emitHoldChange(),r?r.then(a=>{a||this.opts.onHoldExpired?.()}):this.opts.onHoldExpired?.()},onAvailabilityRefresh:t=>this.lapse.handle(t),confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.closedWords().toast,"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.closedWords().toast,"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){if(this.opts.confirmSelection===!1||this.salesClosed){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}this.showConfirm(t,"remove");return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast(N("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onSalesNotice:t=>this.salesNotice(t),onError:t=>{this.renderErrorEmitted=!0,this.opts.onError?.(t)}})}async render(){if(this.rendered)return this;let e=performance.now(),t={},n=p=>Math.round((performance.now()-p)*100)/100;this.rendered=!0,Lt();let o=performance.now(),s=Oi(this.opts.locale,this.opts.messages),r=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=Wo(this.opts.container),{root:c,els:d,mapHost:u}=Ks(l,(p,v)=>this.tf(p,v),this.opts.theme);this.root=c,this.els=d,this.mapHost=u,_i(c,s,p=>{t.loadLocale=n(o),this.destroyed||this.applyActiveLocale(p,r)}),za(c,()=>[{open:()=>!!this.holdExpiredEl,close:()=>this.restartAfterHoldExpiry()},{open:()=>this.tipPinned,close:()=>this.unpinTooltip()},{open:()=>!!this.tableDialog,close:()=>this.cancelTableDialog()},{open:()=>!!this.confirmSeat,close:()=>this.cancelConfirm()},{open:()=>this.bestAvailableConfirm,close:()=>{this.bestAvailableConfirm=!1,this.syncTray()}}]),this.syncFullscreenButtons(),this.wireBuyerShell(c);let m=document.createElement("div");return m.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(m),t.mountBuyerShell=n(a),t.skeletonPaint=n(e),this.loadAndFinishChart(m,t,n,e,c)}async loadAndFinishChart(e,t,n,o,s){this.startRealtime(),this.startIdleClock(s);let r=await this.loadChart(e,t,n);if(!r)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=n(o);let a=performance.now();if(this.salesClosed=!!r.salesClosed||!!this.opts.readOnly,this.salesState=r.salesState??null,this.salesInfo=r,s.dataset.eventMode=r.mode==="test"?"test":"live",!this.opts.locale&&r.locale&&this.setLocale(r.locale),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),r.mode==="test"){let y=document.createElement("div");y.className="sl-testbadge",this.testBadgeEl=y,this.syncTestBadge(),this.regions["top-left"].appendChild(y)}let l=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(s),this.watchThemeMode(),this.currency=r.currency??this.opts.currency??"USD",this.currencyResolved=!0,this.eventTimezone=r.timezone??null,Yo(this.els.logo,[this.opts.theme?.logoUrl,l?.logoUrl,r.posterUrl],this.opts.theme?.brandName??l?.brandName??r.eventName??"?"),this.els.name.textContent=r.eventName??"";let c=r.startsAt?Si(r.startsAt,r.timezone??null,this.opts.locale):"";this.eventWhenText=c||null,this.els.meta.textContent=[r.venue,c].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(l);let d=!!this.controller.doc&&this.controller.getExpandedSeats().some(y=>y.commercial?.restrictedView||y.commercial?.obstructedView);this.buildAccessibilityMenu(d),this.buildLanguageSwitcher(this.els.zoom??this.regions["bottom-right"]),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),s.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(),t.buildBuyerControls=n(a);let u=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=n(u),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncOffer(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let m=this.controller.doc,p=Ai(this.opts.event),v=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),g=v??"event",T={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:g,surface:v==="season"?"season_picker":v==="performance_group"?"performance_group_picker":"seat_picker",ms:n(o),performanceProfile:t,seatCount:this.allSeats().length,objectCount:m?.objects.length??0,sectionCount:m?.objects.filter(y=>y.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:m?.name,view:this.buyerView,load:p,transport:this.opts.transport?"custom":"pubapi",revealWaitMs:this.revealWaitMs??this.sinceRenderResolved(),handoverMs:this.handoverMs??void 0};Za(T,(y,P)=>this.emitAnalytics(y,P));let S=r.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",vo({...T,performanceProfile:{...T.performanceProfile,...S}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=r,await this.registerAgentTools(),this}registerAgentTools(){return qa(this)}webMcpHost(e){return yo(this,e)}wireBuyerShell(e){this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler)),this.detachAttention=ac(()=>{this.destroyed||this.controller.refreshAvailability()}),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.overview()),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);let t=this.els.sheetHead;if(t){let o=this.els.sheetToggle;this.syncSheetAffordance();let s=0,r=!1,a=!1,l=!1;o?.addEventListener("click",c=>{c.stopPropagation(),!r&&this.cycleSheet()}),t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard")){a=!1;return}l=!!c.target.closest?.(".sl-sheet-toggle"),a=!0,r=!1,s=c.clientY,(l&&o?o:t).setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!a||r)return;let d=c.clientY-s;d<-18?(this.stepSheet(1),r=!0):d>18&&(this.stepSheet(-1),r=!0)}),t.addEventListener("pointerup",c=>{a&&!r&&!l&&Math.abs(c.clientY-s)<6&&this.cycleSheet(),a=!1,(l&&o?o:t).releasePointerCapture?.(c.pointerId),l=!1})}this.els.foot?.addEventListener("click",o=>{this.root?.dataset.layout==="narrow"&&(o.target.closest?.('.sl-chip,button,a,input,select,label,[role="button"]')||this.cycleSheet())});let n=()=>{if(this.root?.dataset.layout!=="narrow")return;let o=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!o)),this.els.pricesSec?.setAttribute("aria-expanded",String(!o)),!o&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",o=>{o.target.closest("select,button")||n()}),this.els.pricesSec?.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||o.target.closest("select,button")||(o.preventDefault(),n())}),e.addEventListener("click",o=>{let s=o.target.closest("[data-sl-info]");if(!s||!e.contains(s))return;o.stopPropagation();let r=s.closest(".sl-info"),a=!r?.classList.contains("open");this.closeInfoPops(r),r?.classList.toggle("open",a),s.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",o=>{o.target.closest(".sl-info")||this.closeInfoPops()}),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("pointerdown",o=>{this.handleMapPointerDown(o)},!0),this.els.map.addEventListener("mousemove",o=>{if(this.tipPinned)return;let s=this.els.map.getBoundingClientRect();this.tipPos={x:o.clientX-s.left,y:o.clientY-s.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.els.cta.dataset.act==="find"?this.openBestSeatsForm():this.handleCta()})}sheetState(){let e=this.root?.dataset.sheet;return e==="mini"||e==="open"?e:"peek"}sheetHasCards(){return this.root?.getAttribute("data-has-selection")==="true"}setSheetState(e){let t=this.root;if(!t)return;let n=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),n==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),n=this.els.sheetToggle;n?.setAttribute("aria-expanded",String(e==="open")),n?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=To.indexOf(this.sheetState()),n=Math.min(To.length-1,Math.max(0,t+e));this.setSheetState(To[n])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let n=e.clientWidth;if(n<=0)return;let o=e.clientHeight,s=n!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:n,height:o};let r=this.fullscreenMeasurementChanged(n,o);this.reportFramedHeight();let a=n<640?"narrow":"wide",l=o<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.setNarrowLayout?.(a==="narrow"),queueMicrotask(()=>this.syncFitClearance()),this.controller.getRenderer()?.setSectionFocusDim?.(a!=="narrow"),a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),(r||c)&&this.syncFullscreenAffordance(),this.syncArenaViewportInsets(),s&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),this.els.map&&this.ro.observe(this.els.map),this.viewportResizeHandler=()=>{this.fullscreenMeasurementChanged(e.clientWidth,e.clientHeight)&&this.syncFullscreenAffordance()},window.addEventListener("resize",this.viewportResizeHandler),t(),requestAnimationFrame(t)}async loadChart(e,t,n){let o=performance.now();this.seatsRevealed=!1,this.seatsRevealedWaiters=[],this.seatsRevealedReport=null,this.renderResolvedAt=null,this.revealWaitMs=null,this.handoverMs=null,this.loadAbort=new AbortController;let s=await wt(async()=>{this.renderErrorEmitted=!1;let l=await this.controller.render(e);return this.renderResolvedAt=performance.now(),this.seatsRevealed&&(this.revealWaitMs=0),this.viewportLoading()&&this.drainSeatsRevealedWaiters(),l},this.loadAbort.signal,()=>{let l=this.els.boot.querySelector(".sl-boot-say");l&&(l.classList.add("is-visible"),l.textContent=this.tf("picker.loadingTakingLonger","The seat map is taking longer to load. Please wait\u2026"))});if(this.loadAbort=null,s.outcome==="cancelled"||this.destroyed)return null;let r=s.outcome==="loaded"?s.value:null,a=s.outcome==="loaded"&&!r&&!this.opts.transport?Fi(this.chartFetch?.outcome(),this.renderErrorEmitted):null;if(r||this.controller.destroy(),t.loadChartAndStatuses=n(o),this.destroyed)return null;if(!r){a&&Vi({apiBase:this.apiBase,eventKey:this.opts.event,reason:a}),ye({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:s.outcome==="timeout"?"load_timeout":s.outcome==="error"?"render_error":"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:Ee(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let l=this.opts.transport?void 0:this.chartFetch?.outcome();if(l?.state==="rejected"&&l.error?.status===404){let c=l.error;c.serverMessage&&console.warn(`[SeatLayer] ${c.serverMessage}`),this.opts.onError?.(c),Rt(this.els.boot,{title:this.tf("picker.eventUnavailableTitle","This event isn\u2019t available"),description:this.tf("picker.eventUnavailable","Tickets can\u2019t be booked here right now.")});for(let d of[this.els.side,this.els.rail])d&&(d.setAttribute("inert",""),d.style.display="none");return null}return Rt(this.els.boot,{title:this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load"),description:this.tf("picker.checkConnection","Check your connection and try again."),actionLabel:this.tf("picker.accessRetry","Try again")}),this.els.boot.querySelector("button").addEventListener("click",()=>{if(this.destroyed||!this.root)return;this.controller=this.wireController(this.opts),Rt(this.els.boot,{title:this.tf("picker.loadingSeatMap","Loading seat map\u2026"),busy:!0});let c=performance.now();this.loadAndFinishChart(e,{},n,c,this.root)},{once:!0}),null}return Object.assign(t,r.performanceProfile),r}sinceRenderResolved(){return this.renderResolvedAt===null?void 0:performance.now()-this.renderResolvedAt}whenSeatsRevealed(e){if(!this.destroyed){if(this.seatsRevealed||this.viewportLoading()&&this.renderResolvedAt!==null){e();return}this.seatsRevealedWaiters.push(()=>{this.destroyed||e()})}}viewportLoading(){return this.opts.loadingReveal==="viewport"}drainSeatsRevealedWaiters(){let e=this.seatsRevealedWaiters;this.seatsRevealedWaiters=[];for(let t of e)try{t()}catch{}}async restoreHoldForFirstPaint(e){let t=[this.els.side,this.els.rail].filter(Boolean),n=t.map(o=>o.hasAttribute("inert"));t.forEach(o=>o.setAttribute("inert",""));try{for(;!this.destroyed;){let o=performance.now();try{return await this.restoreRememberedHold(),!this.destroyed}catch{if(this.destroyed)return!1;ye({apiBase:this.apiBase,event:this.opts.event,reconnects:this.realtime?.reconnects??0,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"restore_hold",ms:performance.now()-o,performanceProfile:e,view:"map",load:Ee(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let r=Rt(this.els.boot,{title:this.tf("picker.restoreUnavailableTitle","Unable to check saved seats"),description:this.tf("picker.restoreUnavailable","Try again to check whether your saved seats are still held."),actionLabel:this.tf("picker.accessRetry","Try again")}),a=this.transportAbort.signal;if(await new Promise(l=>{let c=()=>{r.removeEventListener("click",c),a.removeEventListener("abort",c),l()};r.addEventListener("click",c,{once:!0}),a.addEventListener("abort",c,{once:!0}),a.aborted&&c()}),this.destroyed||a.aborted)return!1;Rt(this.els.boot,{title:this.tf("picker.restoringSeats","Checking your saved seats\u2026"),busy:!0})}}return!1}finally{t.forEach((o,s)=>{n[s]||o.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=_t(this.opts.event);e?.outcome!=="success"||!e.orderId||this.openCheckoutPanel({kind:"resume",orderId:e.orderId})}buildPanelToggle(){if(!this.regions["top-right"])return;let 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(){let e=this.sideToggleEl;if(!e)return;let t=this.sideCollapsed;e.setAttribute("aria-expanded",String(!t)),e.setAttribute("aria-label",t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=t?`<svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span>${this.tf("picker.tickets","Tickets")}</span>`:'<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>'}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){let e=this.root?.dataset.layout!=="narrow";this.root?.setAttribute("data-side-collapsed",String(this.sideCollapsed)),this.els.side?.toggleAttribute("inert",this.sideCollapsed&&e),this.syncPanelToggle()}buildAccessibilityMenu(e){let t=this.els.zoom??this.regions["bottom-right"]??this.els.map;t&&(this.a11yMenu=new xn(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(n,o)=>this.tf(n,o),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:n=>this.setColorblindSafe(n),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:n=>{this.limitedViewFilter=n,this.controller.setCommercialLimitedFilter(n),this.pushAvailabilityTo3d()},applyAccessibilityFilter:n=>this.applyAccessibilityFilter(n),focusSeatsForFilter:()=>this.whenSeatsRevealed(()=>this.focusSeatsForFilter()),stepToAccessibleSection:n=>this.controller.focusNextAccessibleSection?.([n])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast(N("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,n=this.els.headInfo?.parentElement;t&&n&&t.parentElement!==n&&(t.classList.add("sl-fs-pill"),n.insertBefore(t,this.els.hold??null));let o=this.extendEl;if(o){let r=e?this.regions["bottom-center"]??this.els.map:n;r&&o.parentElement!==r&&(o.dataset.dock=e?"map":"head",r===n?r.insertBefore(o,this.els.close??null):r.appendChild(o))}let s=this.els.pricesSec;s&&(e?(s.setAttribute("role","button"),s.tabIndex=0,s.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(s.removeAttribute("role"),s.removeAttribute("aria-expanded"),s.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){xl(this)}buildBookedOverlay(){let e=document.createElement("div");e.className="sl-booked",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<div class="sl-booked-badge"><svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5"/></svg></div><div class="sl-booked-title">${this.tf("picker.allSetTitle","You're all set")}</div><div class="sl-booked-sub" data-ref="bookedSub"></div><ul class="sl-booked-list" data-ref="bookedList"></ul><button type="button" class="sl-booked-back" data-ref="bookedBack"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${_(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}closedWords(){return this.salesUi?.words(this)??zs(this.salesState,!!this.opts.readOnly)}finishingHold(){return!!this.salesUi?.finishing(this)}withSalesUi(){return this.salesUiLoad??=Zo().then(e=>(e.translate(N,ai),this.salesUi=e,this.destroyed||this.applySalesClosed(),e),()=>null)}salesNotice(e){(this.salesUi||e.state!=="live")&&this.withSalesUi().then(t=>t?.applyNotice(this,e))}tf(e,t){return b(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),n=document.createElement("div");n.className="sl-soldout-eyebrow",n.textContent=t;let o=document.createElement("div");o.className="sl-soldout-title",o.textContent=this.tf("picker.soldOutTitle","Sold out");let s=document.createElement("p");s.className="sl-soldout-copy",s.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(n,o,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let n=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,t,n),s=[...Ri(e,t)].join("|");s!==this.baSoldOutSig&&(this.baSoldOutSig=s,this.syncTray()),o!==this.soldOut&&(this.soldOut=o,this.soldoutEl?.classList.toggle("on",o))}isSoldOut(e,t,n){return!n&&e.length>0&&e.every(o=>(t[o.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog(),this.salesClosed&&!this.salesUi&&this.withSalesUi();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed&&!this.salesUi?.view(this));let t=this.els.closedPillText??e;t.textContent=this.closedWords().pill}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.closedWords().toast),this.syncCta(),this.syncTray()}badgeHidden(e){return!!e?.hideBadge}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let n=document.createElement("a");n.className="sl-powered",n.href="https://seatlayer.io/?ref=picker",n.target="_blank",n.rel="noopener noreferrer",n.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer")),n.dataset.slA="picker.poweredBy";let o=document.createElement("span");o.className="sl-powered-mark",o.setAttribute("aria-hidden","true"),o.innerHTML=qi;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),s.dataset.slT="picker.poweredBy",n.append(o,s),t.appendChild(n)}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let n=document.createElement("div");n.className="sl-anchor",n.dataset.region=t,this.els.map.appendChild(n),this.regions[t]=n}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let n=setTimeout(()=>{this.motionTimers.delete(n),this.destroyed||e()},t);this.motionTimers.add(n)}animateOnce(e,t,n=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),n))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),n=(e.items??[]).filter(o=>o.objectType!=="ga").slice(0,10).map(o=>this.controller.seatByLabel(o.label)).filter(o=>!!o);if(this.buyerView==="venue3d"&&this.view3dHandle){cl(this,n);return}Ir({regions:this.els,categories:this.controller.doc?.categories,pop:o=>this.controller.flashSeat(o,this.cssVar("--sl-accent")||"#f4b740"),focus:(o,s)=>this.controller.focusSection(o,s),focusSeats:o=>this.controller.focusSeats?.(o,{animate:!t})===!0,reducedMotion:t,screenPoint:o=>this.controller.worldToScreen(o),schedule:(o,s)=>this.scheduleMotion(o,s)},n)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(n=>n.id!==e&&n.id!==t)}pendingSelectionCount(){return Sl(this)}heldTicketCount(){return Tl(this)}totalTicketCount(){return El(this)}updateSelectionCapacity(){Cl(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){Al(this,e,t)}setCtaPhase(e){Pl(this,e)}runCheckoutHandoff(e,t){return Ll(this,e,t)}holdStorageKey(){return Ml(this)}rememberedHoldId(){return Hl(this)}rememberHold(e){Rl(this,e)}forgetHold(){Il(this)}resumeHoldFromServer(e,t=!1){return Ol(this,e,t)}restoreRememberedHold(){return _l(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let n=this.controller.getActiveFloorId();return(t.find(o=>o.id===n)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=os({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label,tint:e=>this.controller.getRenderer?.()?.categoryDisplayColor?.(e)||void 0},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return gn(this,e)}catPriceRange(e){return bn(this,e)}buildPriceFilter(){ql(this)}applyPriceBand(e){Wl(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(n=>n.type==="section")||(e.floors??[]).some(n=>n.objects.some(o=>o.type==="section"));if(this.canOffer3d()){let n=document.createElement("div");n.className="sl-projection",n.setAttribute("role","group"),n.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),n.dataset.slA="picker.venueView",n.innerHTML=`<button type="button" data-view="map" aria-pressed="true" data-sl-t="picker.map" data-sl-ti="picker.flat2dMap" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" data-sl-ti="picker.interactive3dVenueView" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,n.querySelectorAll("button").forEach(o=>{if(o.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])o.addEventListener(s,xi,{once:!0});o.addEventListener("click",()=>{this.setBuyerView(o.dataset.view)})}),this.regions["top-right"].appendChild(n),this.projectionEl=n,this.syncProjection()}if(t){let n=[...e.objects,...(e.floors??[]).flatMap(u=>u.objects)],o=new Set((e.zones??[]).map(u=>u.id)),a=Tu(e)==="combined"&&(e.floors?.length??0)>1&&o.size===0||n.some(u=>u.type==="section"&&typeof u.zone=="string"&&o.has(u.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",N("picker.zoomLevel")),l.dataset.slA="picker.zoomLevel";let c={zones:N("picker.rungLabel.zones"),sections:N("picker.rungLabel.sections"),seats:N("picker.rungLabel.seats")},d={zones:N("picker.rungTip.zones"),sections:N("picker.rungTip.sections"),seats:N("picker.rungTip.seats")};l.innerHTML=a.map(u=>`<button type="button" data-rung="${u}" data-sl-t="picker.rungLabel.${u}" data-sl-ti="picker.rungTip.${u}" title="${d[u]}" aria-pressed="false">${c[u]}</button>`).join(""),l.querySelectorAll("button").forEach(u=>{u.addEventListener("click",()=>{let m=u.dataset.rung;this.controller.setRung(m),m==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let n=la({floors:this.controller.getFloors(),tf:(o,s)=>this.tf(o,s),onChoose:o=>{o===""?this.controller.setFloorOverview(!0):this.controller.setFloor(o),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});(this.regions["bottom-right"]??this.regions["top-left"]).prepend(n),this.floorsEl=n,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map;e&&Cr(this.root,e,this.regions);let t=e?aa(e.getBoundingClientRect(),[this.rungsEl,this.projectionEl].map(n=>n?.isConnected?n.getBoundingClientRect():null),[],8,this.floorsEl?.isConnected?[this.floorsEl.getBoundingClientRect()]:[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(n=>t[n]===this.arenaViewportInsets[n])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t),this.syncFitClearance())}syncFitClearance(){let e=this.els.map,t=this.els.zoom,n=this.root?.dataset.layout==="narrow",o=0;if(n&&e&&t?.isConnected){let s=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.height>0&&(o=Math.max(0,s.bottom-r.top+8))}this.controller.setFitClearance?.(o)}syncTestBadge(){let e=this.testBadgeEl;e&&(e.textContent=qo(N("picker.testMode"),En()),e.setAttribute("aria-label",N("picker.testMode")),e.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"))}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(n=>{let o=n.dataset.rung===e;n.classList.toggle("on",o),n.setAttribute("aria-pressed",String(o))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,n=this.els?.zin;if(!e||!this.root)return;let o=this.controller.getRenderer?.(),s=this.controller.canZoomIn?.()===!1||o?.seatsPickable?.()===!0,r=ns({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.disabled!==r||!!t&&t.disabled!==r||!!n&&n.disabled!==s||e.hidden||!!n?.hidden||!!t?.hidden;e.disabled=r,e.hidden=!1,n&&(n.disabled=s,n.hidden=!1),t&&(t.disabled=r,t.hidden=!1),a&&this.a11yMenu?.refit()}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?this.tf("picker.priceHint3d","Colours in the venue are ticket types. Choose one below to show just those seats."):this.tf("picker.priceHint","Colours on the map are ticket types. Tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!vi()?!1:this.allSeats().length<=this.max3dSeats()}max3dSeats(){let e=this.opts.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?mc/2:mc}syncFloors(){ca(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new ln({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(o=>o.type==="section"&&!this.controller.isSectionClosed(o.id)&&this.controller.getSectionSeatCount(o.id)>0);if(t.length<2)return null;let n=t.findIndex(o=>o.id===e);return n<0?null:{previous:t[(n-1+t.length)%t.length],next:t[(n+1)%t.length]}}markedSeatAnnouncement(e){let t=po(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return wa(t,e.displayLabel??e.label,this.opts.locale)}seatPriceRangeOf(e,t){let n=this.controller.doc?.categories.find(s=>s.key===t),o=n?n.tiers?.length?n.tiers.map(s=>this.paidPrice(n.key,s.id??null,s.price,e)):n.price==null?[]:[this.paidPrice(n.key,null,n.price,e)]:[];return o.length?{min:Math.min(...o),max:Math.max(...o)}:void 0}moneyRange(e){return e.max>e.min?`${this.money(e.min)}\u2013${this.money(e.max)}`:this.money(e.min)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.markedSeatAnnouncement(e);if(t){this.srEl.textContent=t;return}let n=this.controller.doc?.categories.find(p=>p.key===e.categoryKey),s=(this.controller.getStatus(e.id)??"free")==="free"?this.tf("picker.statusAvailable","available"):this.controller.currentHold()?.labels.includes(e.label)?this.tf("picker.heldForYou","Held for you").toLocaleLowerCase(En()):this.tf("picker.group.legendUnavailable","Unavailable").toLocaleLowerCase(En()),r=this.seatPriceRangeOf(e.label,e.categoryKey),a=!this.suppressPricing&&r?this.moneyRange(r):void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=nt(c),u=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,m=l?`${d} ${u}, ${l.bookingMode==="variable"?N("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):N("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${u}`:c?.objectType==="table"?`${d} ${u}, ${N("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:N("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${m}, ${n?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,n){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=n??document.activeElement;let o=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),s=e.bookingMode==="variable",r=document.createElement("div");r.className="sl-table-scrim",r.innerHTML=Rs(e,{variable:s,held:t,typeWord:nt(e),categoryLabel:o?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(r),this.tableDialogEl=r,this.renderTableDialogState(),r.querySelectorAll("[data-table-step]").forEach(a=>{a.addEventListener("click",()=>{if(!this.tableDialog)return;let l=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(a.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:l},this.renderTableDialogState()})}),r.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),r.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),r.addEventListener("mousedown",a=>{a.target===r&&this.cancelTableDialog()}),r.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...r.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],d=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),d.focus()):!a.shiftKey&&document.activeElement===d&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>r.querySelector(s?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let n=t.querySelector("output[data-table-qty]");n&&(n.value=String(e.quantity));let o=t.querySelector("input[data-table-qty]");o&&(o.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let s=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),r=t.querySelector("[data-table-total]");r&&(r.textContent=this.money(s*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let n=this.tableDialogEl?.querySelector(".sl-table-confirm");if(n&&(n.disabled=!0,n.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let o=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!o){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:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},this.startHoldTimer(o.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast(N("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(o){this.opts.onError?.(o),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(e.label,e.quantity)){n&&(n.disabled=!1,n.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new hn({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,n,o)=>this.paidPrice(e,t,n,o),offerName:(e,t)=>this.offerPrice(e,t)?.offerName,suppressPricing:()=>this.suppressPricing,reducedMotion:()=>this.reducedMotion(),scheduleMotion:(e,t)=>this.scheduleMotion(e,t),canOffer3d:()=>this.canOffer3d(),buyerView:()=>this.buyerView,view3dHandle:()=>this.view3dHandle,view3dCompareSeatIds:()=>this.view3dCompareSeatIds,rememberView3dReturnSeat:e=>{this.view3dReturnSeat=e},enter3d:e=>{this.enter3d(e)},performanceGroup:()=>this.performanceGroup,seatViewEnabled:()=>this.seatViewEnabled(),openSeatView:e=>{this.openSeatView(e)},openSeatConfidencePassport:(e,t)=>this.openSeatConfidencePassport(e,t),saveView3dComparisonSeat:e=>this.saveView3dComparisonSeat(e),resolveAssetUrl:e=>this.buyerAssetUrls.resolve(e),onError:e=>this.opts.onError?.(e),liftToastOverConfirm:()=>this.liftToastOverConfirm(),fitTranslatedRows:()=>this.fitTranslatedRows(),syncTray:()=>this.syncTray(),syncSelectionTo3d:()=>this.syncSelectionTo3d(),collapseSectionCard:()=>this.collapseSectionCard(),applyPanelCollapsed:()=>this.applyPanelCollapsed(),dismiss:()=>this.dismissConfirm(),releaseHeldSeat:e=>this.controller.currentHold()?.labels.includes(e.label)?this.removeHeldLabels([e.label]):null,reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e),cartLanded:()=>this.cartLanded()})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}cartLanded(){this.animateOnce(this.els.count,"sl-value-pop",380),this.animateOnce(this.els.total,"sl-value-pop",380)}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){Na(e,t,this.reducedMotion())}addSeatLabel(e){return Da(e,(t,n)=>this.tf(t,n))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,n=this.controller.doc,o=this.controller.getActiveFloorId(),s=e.focalPoint??n?.floors?.find(u=>u.id===o)?.focalPoint??n?.focalPoint??{x:0,y:0},r,a,l=!1;if(e.viewUrl){let u,m=null;try{let v=e.viewMeta?.previewUrl;v&&v!==e.viewUrl?(m=await this.buyerAssetUrls.resolve(v),u=e.viewUrl):u=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(v){t===this.seatViewGen&&this.opts.onError?.(v);return}if(t!==this.seatViewGen||!u||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!m||!this.root||!this.seatViewEnabled())return;let p={url:u,...m?{previewUrl:m}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};r=p,a=Lu(p),l=Pu(p)}else{let u;try{let{generateSeatPanorama:m}=await ki();u=m(e,s,this.allSeats())}catch(m){t===this.seatViewGen&&this.opts.onError?.(m);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;r={url:u.url,generated:!0},a=N("picker.illustrationCaption",{m:u.distanceM})}this.closeSeatView(!1);let c=N("picker.viewFromSeat",{label:e.label}),d=Zi({root:this.root,source:r,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:Ye(),viewFromSeatLabel:c,real360Label:N("picker.real360"),previewLabel:N("picker.preview"),resolveAsset:u=>this.buyerAssetUrls.resolve(u),onClose:()=>this.closeSeatView()});this.viewEl=d.element,this.viewCleanup=()=>d.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let n=Number.isInteger(e);return Eu(e,this.currency,{locale:this.opts.locale,fallback:(o,s)=>`${o} ${s}`,...n?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),n=Xr(e,t);if(n==null)return;let o=6*36e5,s=Math.min(Math.max(n-t+1e3,1e3),o);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},s)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<Hu}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let n=ao(t);if(!n)return;this.offerAvailability=n,this.applyChannelPricing(n.channelPricing),this.scheduleOfferBoundary(n),this.setPricing(this.hostPricing),this.syncMapPriceRanges(),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(n)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e,t){if(!e)return null;let n=this.offerAvailability?.prices.filter(o=>o.categoryKey===e)??[];return t!==void 0?n.find(o=>(o.tierId??null)===t)??n.find(o=>o.tierId==null)??null:n[0]??null}mapPriceRanges(){if(this.api.availability&&!this.offerAvailability)return null;let e=this.offerAvailability?.prices.some(n=>n.tierId!==void 0)??!1,t=Object.keys(this.opts.pricing?.prices??{}).length>0||Object.keys(this.opts.pricing?.objects??{}).length>0||Object.keys(this.controller.doc?.seatPrices??{}).length>0;if(!(!e&&!t))return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(n=>{let o=this.catPriceRange(n);return o?[[n.key,o]]:[]}))}syncMapPriceRanges(){this.controller.getRenderer()?.setCategoryPriceRanges?.(this.mapPriceRanges())}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerCountdownTimer=null,e.classList.remove("sl-offer-compact","sl-offer-early-bird"),!this.currencyResolved){e.classList.remove("has"),e.replaceChildren();return}if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,n=t?.release??null,o=!n&&t?.upcoming?.pricingMode!=="matrix"?t?.upcoming??null:null;if(!t||t.state==="closed"||t.state==="sold-out"||!n&&!o){e.classList.remove("has"),e.replaceChildren();return}let s=n??o,r=s.pricingMode==="matrix",a=document.createElement("div");a.className="sl-offer-main";let l=document.createElement("div");l.className="sl-offer-copy";let c=document.createElement("span");c.className="sl-offer-kicker",c.textContent=n?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let d=document.createElement("strong");d.className="sl-offer-name";let u=s.name||(n?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));On(u)&&e.classList.add("sl-offer-early-bird"),d.innerHTML=Li(u,_);let m=document.createElement("span");m.className="sl-offer-line";let p=[];if(!r&&n&&t.fromPrice!=null&&p.push(this.money(t.fromPrice/100)),!r&&n&&s.remaining!=null&&p.push(N("picker.offerRemainingAvailable",{count:s.remaining})),n&&s.endsAt!=null){let y=!this.opts.locale||/^en(?:-|$)/i.test(this.opts.locale)?ws(s.endsAt):null;if(p.push(y??N("picker.offerUntil",{time:Si(s.endsAt,this.eventTimezone,this.opts.locale)})),y){let P=Math.max(1e3,s.endsAt-Date.now()),R=P%6e4||6e4;this.offerCountdownTimer=setTimeout(()=>{this.offerCountdownTimer=null,Date.now()>=s.endsAt?this.refreshOfferAvailability(!1):this.syncOffer()},Math.min(R+25,P+25))}}if(o?.startsAt!=null&&p.push(N("picker.offerStarts",{time:Si(o.startsAt,this.eventTimezone,this.opts.locale)})),m.textContent=p.join(" \xB7 "),r||l.append(c),l.append(d,m),r){e.classList.add("sl-offer-compact"),a.append(l),e.replaceChildren(a),e.classList.add("has");return}let v=document.createElement("details");v.className="sl-offer-info";let g=document.createElement("summary");g.setAttribute("aria-label",N("picker.howOfferWorks",{name:d.textContent??""})),g.textContent="i";let T=document.createElement("div");T.className="sl-offer-detail",T.textContent=n?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(g,T),a.append(l,v),e.replaceChildren(a),e.classList.add("has")}paidPrice(e,t,n,o){if(o){let r=hc(this.opts.pricing?.objects,o,t)??hc(this.controller.doc?.seatPrices,o,t);if(r!==void 0)return r}let s=o?this.channelByObject.get(o):void 0;if(s&&e){let r=this.pricesByChannel.get(s)?.find(a=>a.categoryKey===e&&a.tierId===(t??null));if(r)return r.price}return Le(this.opts.pricing?.prices,e,t,n)}heldPrice(e){return this.checkoutMode==="hosted"?e.unitPrice:Xi({...this.hostPricing,seatPrices:this.controller.doc?.seatPrices},e.label,e.categoryKey,e.tierId,e.unitPrice)}hostObjectPrices(){return this.opts.pricing?.objects}legendDeps(){return Yl(this)}syncPriceRail(e,t,n=this.legendDeps()){Zl(this,e,t,n)}syncPrices(){this.currencyResolved&&Ql(this)}focusCategory(e){Xl(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(n=>!e.has(n.label)&&(this.controller.getStatus(n.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(n=>n.id)),this.toast(N("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:n,heldLabels:o,total:s,count:r}=fn(this),a=[],l=new Set;if(!this.salesClosed){let f=this.performanceGroup?.nightSummary?.()??[];f.length&&a.push(ma(f,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let L=this.performanceGroup?.selectionModeSwitch;L&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${_(L.label)}</button>`)}let c={salesClosed:this.salesClosed,salesState:this.salesState,note:this.salesUi?.note(this),hasPicks:e.length>0||n.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(f=>f.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(js(c)),this.els.trayHint&&(this.els.trayHint.textContent=Gs(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed),this.salesUi?.sync(this);let d=!e.length&&!n.length&&!Fe(this.gaQty,this.hold?.items??[]);if(!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||this.bestAvailableBusy||this.bestAvailableConfirm)){let f=(this.controller.doc?.categories??[]).filter(M=>!M.notForSale),L=this.controller.getBestAvailableZones();this.baZone&&!L.some(M=>M.id===this.baZone)&&(this.baZone="");let D=Ri(f,this.controller.categoryAvailability());this.baSoldOutSig=[...D].join("|"),this.bestAvailableSoldOut=f.length>0&&D.size===f.length,D.has(this.baCat)&&(this.baCat=""),(!this.bestAvailableSoldOut||this.bestAvailableBusy||this.bestAvailableConfirm)&&a.push(Vs({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:f.map(M=>D.has(M.key)?{...M,soldOut:!0}:M),zones:L,selectedCategory:this.baCat,selectedZone:this.baZone}))}let u=(f,L,D,M=1,O,A,I,j)=>Bs({categoryLabel:I,offerName:j,d:f?this.controller.seatDetails(f):null,area:D==="ga"?t.find(z=>z.id===O):void 0,label:L,objectType:D,quantity:M,identity:A,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),m=_,p=[];for(let f of dr(n)){let L=f.objectType==="ga"?`held:ga:${f.objectId}:${f.tierId??""}`:`held:${f.label}`;l.add(L);let D=this.controller.doc?.categories.find(ft=>ft.key===f.categoryKey),M=this.performanceGroup||this.suppressPricing?null:Wa(this.controller,f),O=f.tierId&&!M?D?.tiers?.find(ft=>ft.id===f.tierId)?.name:void 0,A=this.offerPrice(f.categoryKey,f.tierId??null)?.offerName,I=f.objectType!=="ga"?this.controller.seatByLabel(f.label):null,j=f.objectType==="table"?this.controller.tableSelection(f.label):null,z=I?this.controller.seatDetails(I.id):null,de=this.seatViewEnabled()&&!!I&&f.objectType!=="table"&&!!this.deliverableViewReference(I),Te=m(this.tf("picker.heldForYou","Held for you")),We=(j?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(f.label))}">${m(N("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+(M?`<select class="tier" data-held-tier="${m(f.label)}" aria-label="${m(N("picker.ticketTierFor",{label:f.label}))}">${Fn(M,f.tierId??void 0,m)}</select>`:""),be=this.heldPrice(f)*(f.quantity??1);p.push({key:L,fresh:!this.lastTrayKeys.has(L),held:!0,seatIds:[],heldLabels:f.labels,removeAria:N("picker.removeHeldTicketLabel",{label:qn(f,t)}),locateId:I?.id??null,section:z?.sectionLabel??"",rowLabel:z&&q(z)||"",seatLabel:z?.seatNumber??f.label,categoryLabel:`${D?.label??f.categoryKey}${O?` \xB7 ${O}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??D?.color??"",identityHtml:u(I?.id??null,f.label,f.objectType,f.quantity??1,f.objectId,j??void 0,`${D?.label??f.categoryKey}${O?` \xB7 ${O}`:""}`,A),stateHtml:`<span class="sl-ticket-state held" aria-label="${Te}" title="${Te}"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></span>`,extrasHtml:We,amount:be,amountText:this.suppressPricing?"":this.money(be),noteHtml:Je(I??void 0),railHtml:this.performanceGroup?"":Vn(N("picker.removeHeldTicketLabel",{label:qn(f,t)}),de?f.label:null)})}let v=this.seatViewEnabled();for(let f of e.filter(L=>!o.has(L.label))){let L=`seat:${f.id}`;l.add(L);let D=this.controller.doc?.categories.find(be=>be.key===f.categoryKey),M=f.tiers&&f.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${m(f.id)}" aria-label="${m(N("picker.ticketTierFor",{label:f.label}))}">`+Fn(f.tiers,f.tierId,m)+"</select>":"",O=f.tiers?.find(be=>be.id===f.tierId)??f.tiers?.[0],A=this.offerPrice(f.categoryKey,O?.id??null)?.offerName,I=O?.buyerMessage?.trim()||(O?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),j=this.controller.seatDetails(f.id),z=m(this.tf("picker.selected","Selected")),de=N("picker.removeSeatLabel",{label:f.label}),Te=(f.objectType==="table"&&f.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(f.label))}">${m(N("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+M,We=this.paidPrice(f.categoryKey,f.tierId??null,f.price,f.label)*(f.quantity??1);p.push({key:L,fresh:!this.lastTrayKeys.has(L),held:!1,seatIds:[f.id],heldLabels:[],locateId:f.id,section:j?.sectionLabel??"",rowLabel:j&&q(j)||"",seatLabel:j?.seatNumber??f.label,categoryLabel:D?.label??f.categoryKey,identityHtml:u(f.id,f.label,f.objectType,f.quantity??1,f.objectId,f,D?.label??f.categoryKey,A),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??D?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${z}" title="${z}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:Te,amount:We,amountText:this.suppressPricing?"":this.money(We),removeAria:de,noteHtml:Je(f)+(I?`<small class="sl-tier-note">${m(I)}</small>`:""),railHtml:Vn(de,v&&f.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(f.label)??{})?f.label:null)})}p.length&&a.push(p.map(Fs).join("")),t.length&&a.push(gr(this,t,n)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let g=this.performanceGroup?.selectNight;g&&Ea(this.els.tray,f=>g(f)),this.els.tray.querySelectorAll("[data-ba]").forEach(f=>{f.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(f.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",f=>{this.baCat=f.target.value,this.scheduleFit()}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",f=>{this.baZone=f.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.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(f=>{f.addEventListener("click",()=>{let L=f.closest(".sl-chip");if(L.dataset.held){this.removeHeldLabels(decodeURIComponent(L.dataset.held).split(`
3351
- `),L);return}let D=L.dataset.seat.split(" "),M=()=>{this.controller.deselect(D)};if(this.reducedMotion()){M();return}L.classList.remove("sl-enter"),L.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(M,Y.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(f=>{f.addEventListener("click",L=>{L.stopPropagation();let D=decodeURIComponent(f.dataset.tableEdit??""),M=this.controller.tableSelection(D);if(!M)return;let O=n.find(A=>A.label===D&&A.objectType==="table");this.showTableDialog({...M,quantity:O?.quantity??M.quantity},!!O,f)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(f=>{f.addEventListener("change",()=>f.dataset.heldTier?void this.changeHeldTier(f,f.dataset.heldTier):this.controller.setSeatTier(f.dataset.tier,f.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(f=>{f.addEventListener("click",()=>{let L=this.controller.seatByLabel(f.dataset.viewLabel);L&&this.openSeatView(L)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(f=>{let L=()=>this.controller.flashSeat(f.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");f.addEventListener("mouseenter",L),f.addEventListener("focusin",L),f.addEventListener("click",D=>{D.target.closest?.('button,a,select,[role="button"],input')||!this.controller.focusSeats?.([f.dataset.locate],{animate:!this.reducedMotion()})||L()})}),br(this,this.els.tray,t),this.controller.setGASelection(ar(this.gaQty)),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(f=>{f.disabled=!0});let T=this.pendingSelectionCount(),S=this.lastTrayCount,y=this.lastTrayTotal,P=Ta(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");this.els.count.textContent=P||(r?ai("picker.ticketsCount",r):this.salesUi?.view(this)?this.closedWords().pill:this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=r&&!this.suppressPricing?this.money(s):"",this.root?.setAttribute("data-has-selection",String(r>0)),this.sheetState()==="mini"&&r===0?this.setSheetState("mini"):r>S&&this.root?.dataset.layout==="narrow"?this.setSheetState("mini"):this.syncSheetAffordance(),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy)),this.els.seatSummary&&(this.els.seatSummary.textContent=P||(r?ai("picker.seatsSelectedCount",r):"")),this.syncCta(r,T);let G=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";r!==S&&!G&&this.animateOnce(this.els.count,"sl-value-pop",380),s!==y&&!G&&this.animateOnce(this.els.total,"sl-value-pop",380),S===0&&r>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.lastTrayCount=r,this.lastTrayTotal=s,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(r,e),this.scheduleFit()}scheduleFit(){if(this.fitScheduled||this.destroyed)return;this.fitScheduled=!0;let e=()=>{this.fitScheduled=!1,this.destroyed||this.fitTranslatedRows()};typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}fitTranslatedRows(){Ur(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(qr),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(Wr),Yr(this.els.tray?.querySelector("select.sl-ba-cat"))}emitSelectionValidity(e,t){let n=this.controller.getSelectionValidity(e);n&&(n.seats=t,this.opts.onSelectionValidityChange?.(n),n.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(n),this.lastSelectionValidity=n.isValid)}async removeHeldLabels(e,t){let n=e.filter(r=>r&&!this.releasingLabels.has(r));if(!n.length)return!1;let o=n[0];n.forEach(r=>this.releasingLabels.add(r)),t?.setAttribute("aria-busy","true");let s=t?.querySelector(".rm");s&&(s.disabled=!0);try{let r=this.handedOff;if(!await this.controller.releaseLabels(n))return this.toast(N("picker.couldNotRemoveLabel",{label:o}),"error"),!1;pr(this.gaQty,this.hold?.items??[],n);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&r,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{n.forEach(r=>this.releasingLabels.delete(r)),t?.removeAttribute("aria-busy"),s?.isConnected&&(s.disabled=!1)}}async handleCta(){if(this.salesClosed&&!this.finishingHold())return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(wn(e,(n,o)=>this.tf(n,o)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast(N("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&(this.salesClosed||!t.some(n=>!(this.hold.items??[]).some(o=>o.label===n.label)))){let n=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,n);return}this.holdingLabels=new Set(t.map(n=>n.label)),this.setCtaPhase("holding");try{let n=null,o=rr(this.gaQty),s=this.committedSelection();if(s.length){let r=await this.controller.hold(void 0,this.opts.holdTtlMs);n=r?{holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items}:null}for(let{areaId:r,tierId:a,qty:l}of o){let c=await this.controller.holdGA(r,l,{tierId:a,ttlMs:this.opts.holdTtlMs});n=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:n}if(!n){this.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=n,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(n.expiresAt),this.flashHeldSeats(n),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(n,n.seats??s)}catch(n){this.opts.onError?.(n);let o=lo(n);if(o){this.toast(o,"warning"),this.setCtaPhase("idle");return}let s=n,r=(s.conflicts??[]).map(l=>l.label).filter(Boolean).slice(0,3);s.reason==="event_closed"&&this.setSalesClosed(!0);let a=s.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):s.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):r.length?r.length===1?N("picker.labelsNoLongerAvailable.one",{labels:r.join(", ")}):N("picker.labelsNoLongerAvailable.other",{labels:r.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(a),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){Nl(this,e)}stopHoldTimer(){Dl(this)}setExtendPrompt(e,t){Bl(this,e,t)}refreshExtendPrompt(){Fl(this)}handleExtend(){return Vl(this)}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.holdConflicted||this.controller.currentHold()===null&&this.showBooked()}settleBookedHold(e){this.hold?.holdId!==e||this.bookedShown||this.holdConflicted||(this.controller.clearHold(),this.showBooked())}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((o,s)=>o+s.quantity,0),n=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=n?.seats?`<span class="sl-booked-seats">${ai("picker.group.ticketsConfirmedAcross",n.seats,{performances:n.performances})}</span>`:`<span class="sl-booked-seats">${ai("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.els.bookedList&&(this.els.bookedList.innerHTML=e.lineItems.map(o=>{let r=[o.sectionLabel,o.rowLabel&&`${this.tf("picker.row","Row")} ${o.rowLabel}`,o.seatNumber&&`${this.tf("picker.seat","Seat")} ${o.seatNumber}`].filter(Boolean).join(" \xB7 ")||o.displayLabel||o.label,a=o.quantity>1?` <span class="sl-booked-qty">\xD7${o.quantity}</span>`:"";return`<li>${_(r)}${a}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0),this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.resetAfterBooking(),this.root?.focus({preventScroll:!0})}resetAfterBooking(){this.bookedShown=!1,this.hold=null,this.handedOff=!1,this.holdConflicted=!1,this.holdingLabels.clear(),this.gaQty.clear(),this.stopHoldTimer(),this.forgetHold(),this.clearSelection(),this.setCtaPhase("idle"),this.setSheetOpen(!1),this.syncTray(),this.syncCta(),this.emitHoldChange()}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let n=this.buildHandoff(e),o=null;try{o=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(a){this.opts.onError?.(a)}if(this.destroyed)return;let s=o?.bookingMode==="free",r=o?.providers?.[0]??null;if(!r&&!s){let a=Qo(o?.reason),l=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:a,handoff:n}),this.opts.onCheckout?.(e,t,n),l||this.openCheckoutPanel({kind:"unavailable",reason:a,seatCount:Xo(n)});return}await this.openCheckoutPanel(Jo(n,r,o,this.pubApi.ticketKeysFor(e.holdId),this.controller.getGAAreas()))}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await gt())}catch(n){this.opts.onError?.(n),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=t({root:this.root,state:e,eventKey:this.opts.event,event:{name:this.els.name?.textContent||null,detail:this.els.meta?.textContent||null},formatMoney:n=>this.money(n),t:N,startSession:n=>this.pubApi.startCheckout(this.opts.event,{...n,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:n=>this.pubApi.orderStatus(n),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:n=>{this.opts.onOrderConfirmed?.(n),this.controller.refresh()},onError:n=>{es(n)&&(this.paymentOptions=null),n?.code==="seats_unavailable"&&this.controller.refresh(),this.opts.onError?.(n)}}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let n=(e.items??[]).map(r=>{let a=this.controller.lineItemDisplay(r),l=r.objectType==="seat"||r.objectType==="booth"?this.controller.seatByLabel(r.label):null,c=l?this.controller.seatDetails(l.id):null,d=c?q(c):void 0,u=this.controller.doc?.categories.find(p=>p.key===r.categoryKey),m=r.tierId?u?.tiers?.find(p=>p.id===r.tierId)?.name:void 0;return{label:r.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},...c?.sectionLabel?{sectionLabel:c.sectionLabel}:{},...d?{rowLabel:d}:{},...c?.seatNumber?{seatNumber:c.seatNumber}:{},...u?.label?{categoryLabel:u.label}:{},...m?{tierLabel:m}:{},objectId:r.objectId,objectType:r.objectType,categoryKey:r.categoryKey,tierId:r.tierId,unitPrice:this.heldPrice(r),currency:r.currency??this.currency,quantity:r.quantity??1}}),o=n[0]?.currency??this.currency,s=n.reduce((r,a)=>r+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:o,lineItems:n,total:s}}emitHoldChange(){let e=this.hold;this.realtime?.watchHold(e?.holdId??null),this.syncSelectionTo3d(),this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",n){let o=this.els.toast;if(!o)return;o.replaceChildren();let s=document.createElement("span");if(s.textContent=e,o.appendChild(s),o.classList.toggle("has-action",!!n),n){let r=document.createElement("button");r.type="button",r.className="sl-toast-action",r.textContent=n.label,r.addEventListener("click",n.onClick,{once:!0}),o.appendChild(r)}o.dataset.tone=t,o.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{o.classList.remove("on","sl-mo-rise"),o.classList.remove("has-action"),o.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),n=this.confirmEl;if(!t||!n?.isConnected){e.style.removeProperty("bottom");return}let o=this.els.map.clientHeight;if(o<=0)return;let s=n.getBoundingClientRect(),r=s.height||n.offsetHeight||Ou,a=s.height?s.top-this.els.map.getBoundingClientRect().top:o-uo-r,l=Math.round(o-a+Ru);if(l+Iu>o){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){this.handoverMs===null&&this.renderResolvedAt!==null&&(this.handoverMs=performance.now()-this.renderResolvedAt),$a({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},n=this.tipPinned?Pa(this.tipPos,e,t):null,o=n??Aa(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${o.left}px`,this.tipEl.style.top=`${o.top}px`,n?this.tipEl.dataset.placement=n.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let n=this.performanceGroup,o=po(e.mark,n?.nights?.()),s=o?.states.filter(r=>r.free).length??0;return fa(o,{locale:this.opts.locale,switchLabel:n?.selectionModeSwitch?.label??null,selectPartialLabel:n?.partialSeatSelection?.label(s)??null,pinned:t})}unpinTooltip(){this.tipPinned&&(this.tipPinned=!1,this.tipEl?.classList.remove("sl-tip-pinned"),this.tipEl&&(this.tipEl.style.display="none"))}handleMapPointerDown(e){if(this.tipEl?.contains(e.target))return;this.lastMapPoint={x:e.clientX,y:e.clientY},this.lastPointerType=e.pointerType||"mouse";let t=this.els.map.getBoundingClientRect();this.tipPos={x:e.clientX-t.left,y:e.clientY-t.top},this.unpinTooltip()}closeInfoPops(e){this.root?.querySelectorAll(".sl-info.open").forEach(t=>{t!==e&&(t.classList.remove("open"),t.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false"))})}updateTooltip(e){if(!this.tipEl)return;if(this.confirmSeat){this.tipEl.style.display="none";return}if(this.tipPinned&&e?.interaction!=="press")return;if(!e){this.tipPinned||(this.tipEl.style.display="none",this.tipMarkedHoverLabel=null);return}let t=e.mark?.kind==="partial"&&this.tipMarkedHoverLabel===e.label;if(e.interaction!=="press"&&this.lastPointerType==="mouse"&&!e.mark&&!this.tipPinned){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}if(e.unavailable&&e.status==="free"&&e.interaction==="press"){this.toast(this.tf("picker.turnOffAccessibilityFilter","Turn off the wheelchair filter to pick this seat"),"neutral"),this.tipEl.style.display="none";return}if(e.unavailable&&!e.mark){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}let n=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t);this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let o=this.nightStripFor(e,n);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=Ca(e,{price:this.suppressPricing?"":this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label)),priceNote:this.suppressPricing?this.performanceGroup?.surface==="season"?this.tf("picker.season.includedInPackage","Included in the Season package"):this.tf("picker.group.pricesPerPerformance","Prices shown per performance"):"",rowTypeWord:nt(e),ownHold:this.controller.currentHold()?.labels.includes(e.label)===!0,extra:o+(n?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${_(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=n,this.tipEl.classList.toggle("sl-tip-pinned",n),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),Ha(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,s=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,s)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let n={};for(let[o,s]of Object.entries(e())){let r=this.controller.idForLabel(o);r&&(n[r]=s)}Object.keys(n).length&&t.setSeatMarks(n)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),n=this.controller.getSelection().filter(o=>t.has(o.id)||t.has(o.label));if(n.length===t.size)return n;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=Ti(this.themeMode),n=yt(this.controller.doc?.theme,this.opts.theme,t);for(let[o,s]of Object.entries(n))e.style.setProperty(o,s);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Ei(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(bt(this.opts.theme,this.themeMode)),this.applyMapChromeTokens(),this.minimap?.refreshMinimap(),this.syncPrices())}setThemeMode(e){this.destroyed||e===this.themeMode||(this.themeMode=e,this.opts.theme={...this.opts.theme??{},...e?{mode:e}:{mode:void 0}},this.watchThemeMode(),this.repaintForThemeMode(),this.emitAnalytics("theme_mode_changed",{mode:e,resolved:Ti(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Ti(this.themeMode),n=yt(this.controller.doc?.theme,this.opts.theme,t),o=bt(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,s=is(n,o);for(let r of ts)s?e.style.setProperty(r,s[r]):e.style.removeProperty(r)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){this.hostPricing=e;let t=ea(e?.prices,this.offerAvailability),n=Object.keys(t).length>0||e?.formatter||e?.objects?{prices:t,...e?.objects?{objects:e.objects}:{},...e?.formatter?{formatter:e.formatter}:{}}:void 0;JSON.stringify(this.opts.pricing??null)!==JSON.stringify(n??null)&&(this.opts.pricing=n,!(this.destroyed||!this.els.prices||!this.currencyResolved)&&(this.syncMapPriceRanges(),this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=Ys(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=En(),n=this.localeGeneration+=1,o=await Cu(e);return this.opts.messages&&Au(this.opts.messages),o===t||this.applyActiveLocale(o,n),o}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(Zs(e,{root:this.root,painters:[()=>this.syncTray(),()=>this.syncPrices(),()=>this.syncOffer(),()=>this.syncRung(),()=>this.syncFloors(),()=>this.syncPanelToggle(),()=>this.syncFullscreenButtons(),()=>this.syncTestBadge()],refreshMapCopy:()=>this.controller.refreshMapCopy(),languageSelect:this.langSel}),this.scheduleFit())}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),this.minimap?.refreshMinimap(),Nu(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??"flat"}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,t??{})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}getBuyerView(){return nl(this)}setBuyerView(e,t){ol(this,e,t)}seatState3dFor(e){return sl(this,e)}pushAvailabilityTo3d(){rl(this)}syncSelectionTo3d(){ll(this)}seatViewFor3d(e){return dl(this,e)}onView3dSeatPick(e){pl(this,e)}seatViewCaption(e){return hl(this,e)}saveView3dComparisonSeat(e){ul(this,e)}clearView3dComparison(){ml(this)}view3dComparisonSnapshot(e){return fl(this,e)}enter3d(e){return gl(this,e)}publish3dTopInset(){bl(this)}exit3d(){yl(this)}openSeatConfidencePassport(e,t=null){wo(this,e,t)}closeSeatConfidencePassport(e=!0){ri(this,e)}openView3dComparison(){Ja(this)}closeView3dComparison(e=!0){ot(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async changeHeldTier(e,t){e.disabled=!0;try{let n=await Ya(this.controller,t,e.value,this.opts.holdTtlMs);n&&(this.hold={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items},this.startHoldTimer(n.expiresAt),this.emitHoldChange())}catch(n){this.opts.onError?.(n),this.toast(this.tf("picker.ticketTypeNotChanged","That ticket type is not available for this seat. Your hold is unchanged."),"error")}finally{this.syncTray()}}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,n={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,n)}catch(o){this.opts.onError?.(o);let s=lo(o);if(s)return this.toast(s,"warning"),null;let r=o?.reason,a=r==="not_enough_together"?N("picker.couldNotFindSeatsTogether",{count:e}):r==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):r==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):r==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):r==="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(a,"error"),null}}async bestAvailableOrThrow(e,t,n={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");let o=Ii(this.controller,t);if(o)throw o;this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let s=this.els.tray?.querySelector(".sl-ba-go");s&&(s.disabled=!0,s.classList.add("sl-busy"),s.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let r=await this.controller.bestAvailable(e,t,{...n,ttlMs:this.opts.holdTtlMs});return r?(this.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(r.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),n.preferPremium&&r.seats.length&&!r.seats.every(a=>a.commercial?.premium)&&this.toast(N("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),n=!0;if(t)n=await this.controller.release();else if(e){let o=[...new Set([...(e.items??[]).map(s=>s.label),...(e.seats??[]).map(s=>s.label)])];if(o.length)try{await this.api.release(this.opts.event,o,e.holdId)}catch(s){this.opts.onError?.(s),n=!1}}if(!n){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(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new Ce({url:()=>this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},onIdleExpired:()=>ra(this.idlePauseHost),heldHoldId:()=>this.hold?.holdId??null,onHoldState:(t,n)=>{n==="booked"&&this.settleBookedHold(t)},sink:{...Yt(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,n)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,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")}}),onSales:t=>this.salesNotice(t)}}),this.realtime.start()}async refreshAccess(){return!this.access?.configured||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}clearDecisionSurfaces(){this.dismissConfirm(),this.dismissTableDialog(!1),ve(this,!1)}showAccessPanel(e){if(this.loadAbort&&e.reason==="provider_failed"||this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=Is(e.reason,e.reason==="idle"?()=>this.resumeFromIdle():()=>this.recoverAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}async recoverAccess(){return await this.refreshAccess()?!0:(this.opts.onAccessUnavailable||typeof window>"u"||window.location.reload(),!1)}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}get idlePauseHost(){return this}startIdleClock(e){return na(this.idlePauseHost,e)}resumeFromIdle(){return sa(this.idlePauseHost)}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=oc({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let n=t.filter(r=>r.objectType!=="ga"),o=[],s=[];for(let r of n){let a=this.controller.seatByLabel(r.label);(a&&this.controller.getStatus(a.id)==="free"?o:s).push(r.label)}nc(e,{recoverable:o,taken:s,onRecover:r=>this.recoverAfterHoldExpiry(r)})}).catch(()=>{})}recoverAfterHoldExpiry(e){this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.select(e),this.syncTray(),this.handleCta()}dismissHoldExpired(){this.holdExpiredEl?.remove(),this.holdExpiredEl=null}restartAfterHoldExpiry(){let e=this.holdExpiredUnits;this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.overview(),this.syncTray(),this.syncCta(),this.root?.focus({preventScroll:!0});let t=this.holdExpiredFresh;this.holdExpiredFresh=!1,(t?Promise.resolve():this.refreshAvailability()).then(()=>{this.destroyed||ic({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:n=>this.controller.seatByLabel(n),statusOf:n=>this.controller.getStatus(n),flash:(n,o)=>this.controller.flashSeat(n,o)},e)}).catch(()=>{})}destroy(){this.transportAbort.abort(),this.loadAbort?.abort(),this.loadAbort=null,this.destroyed=!0,bo(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.idleClock?.dispose(),this.idleClock=null,this.dismissAccessPanel(),this.dismissHoldExpired(),this.access?.clear(),this.hold&&!this.handedOff&&this.opts.holdOnClose!=="keep"&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),ve(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerCountdownTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.viewportResizeHandler&&window.removeEventListener("resize",this.viewportResizeHandler),this.viewportResizeHandler=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,this.root?.remove(),this.root=null,this.modalCleanup?.(),this.closeModal=null}};function Du(i){$e.prewarm(i)}import{formatMoney as Ju,loadLocale as em,setStringOverrides as tm,t as im}from"@seatlayer/core";var bc="seatlayer-performance-group-picker-style";function yc(){if(document.getElementById(bc))return;let i=document.createElement("style");i.id=bc,i.textContent=`
3347
+ </div>`,e.append(i)}buildErrorCard(e,t){let i=uu[t],o=document.createElement("div");Object.assign(o.style,{maxWidth:"420px",margin:"auto 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)"});let s=document.createElement("h2");s.textContent=i.title,Object.assign(s.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let r=document.createElement("p");r.textContent=i.body,Object.assign(r.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let 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()),o.append(s,r,a),e.append(o)}};function Xt(n,e){let t=(a,[l,c])=>{a.textContent=y(l,c??l),a.dataset.slT=l},i=document.createElement("div");i.className="sl-loading-state";let o=document.createElement("div");if(o.setAttribute("role",e.busy?"status":"alert"),o.setAttribute("aria-atomic","true"),e.busy){let a=document.createElement("div");a.className="sl-boot-spin",a.setAttribute("aria-hidden","true"),i.append(a)}let s=document.createElement("div");if(s.className="sl-boot-title",t(s,e.title),o.append(s),e.description){let a=document.createElement("p");a.className="sl-loading-description",t(a,e.description),o.append(a)}i.append(o);let r=null;return e.action&&(r=document.createElement("button"),r.type="button",r.className="sl-boot-retry",t(r,e.action),i.append(r)),n.replaceChildren(i),r}function mu(n){let{viewportWidth:e,viewportHeight:t,offsetTop:i,offsetLeft:o,clientWidth:s,clientHeight:r,innerHeight:a,largeViewportHeight:l}=n;if(![e,t,i,o].every(Number.isFinite)||e<=0||t<=0)return null;let c=Number.isFinite(s)&&s>0?s:e,d=Number.isFinite(r)&&r>0?r:t,h=i;return Number.isFinite(l)&&a>l+1&&d<l-1&&(h=Math.max(h,l-d)),{width:Math.min(e,c),height:Math.min(t,d),top:h,left:o}}function Ia(n){let e=window.visualViewport;if(!e)return()=>{};let t=document.createElement("div");t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",visibility:"hidden",pointerEvents:"none",width:"0",height:"100lvh",overflow:"hidden"}),document.body.appendChild(t);let i=()=>{let c=mu({viewportWidth:e.width,viewportHeight:e.height,offsetTop:e.offsetTop,offsetLeft:e.offsetLeft,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight,innerHeight:window.innerHeight,largeViewportHeight:t.getBoundingClientRect().height});c&&Object.assign(n.style,{right:"auto",bottom:"auto",top:`${c.top}px`,left:`${c.left}px`,width:`${c.width}px`,height:`${c.height}px`})},o=0,s=0,r=0,a=()=>{o&&window.cancelAnimationFrame(o),s&&window.cancelAnimationFrame(s),r&&window.clearTimeout(r),o=window.requestAnimationFrame(()=>{o=0,s=window.requestAnimationFrame(()=>{s=0,i()})}),r=window.setTimeout(()=>{r=0,i()},250)},l=()=>{i(),a()};return l(),e.addEventListener("resize",l),e.addEventListener("scroll",l),window.addEventListener("resize",l),window.addEventListener("orientationchange",l),window.addEventListener("pageshow",l),()=>{o&&window.cancelAnimationFrame(o),s&&window.cancelAnimationFrame(s),r&&window.clearTimeout(r),e.removeEventListener("resize",l),e.removeEventListener("scroll",l),window.removeEventListener("resize",l),window.removeEventListener("orientationchange",l),window.removeEventListener("pageshow",l),t.remove()}}var fu=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(",");function $i(n,e){let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let o=document.createElement("div");o.className="sl-modal-frame",o.style.setProperty("--sl-bg",e),o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",n),o.tabIndex=-1,i.appendChild(o),document.body.appendChild(i);let s=document.body.style.overflow;document.body.style.overflow="hidden";let r=Ia(i),a=()=>{let u=[...o.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(g=>g.isConnected&&!g.closest('[hidden], [aria-hidden="true"], [inert]'));return u[u.length-1]??o},l=(u,g)=>{let b=u;for(;b;){let T=window.getComputedStyle(b);if(b.hidden||b.getAttribute("aria-hidden")==="true"||b.hasAttribute("inert")||T.display==="none"||T.visibility==="hidden"||T.visibility==="collapse")return!0;if(b===g)return!1;b=b.parentElement}return!0},c=u=>[...u.querySelectorAll(fu)].filter(g=>g.tabIndex>=0&&!g.matches(":disabled")&&!l(g,u)),d=(u,g)=>{let b=c(u),T=g?b[b.length-1]:b[0];T?T.focus({preventScroll:!0}):(u.hasAttribute("tabindex")||(u.tabIndex=-1),u.focus({preventScroll:!0}))},h=null,m=!0;return{scrim:i,frame:o,trapKeys(u){let g=b=>{if(b.key==="Tab"){if(b.defaultPrevented)return;let T=a(),S=c(T),x=S[0],P=S[S.length-1],_=document.activeElement;!x||!P?(b.preventDefault(),d(T,b.shiftKey)):_===T||!_||!T.contains(_)?(b.preventDefault(),(b.shiftKey?P:x).focus({preventScroll:!0})):b.shiftKey&&_===x?(b.preventDefault(),P.focus({preventScroll:!0})):!b.shiftKey&&_===P&&(b.preventDefault(),x.focus({preventScroll:!0}));return}b.key==="Escape"&&u(b)};return h=g,document.addEventListener("keydown",g),g},onScrimPress(u){i.addEventListener("mousedown",g=>{g.target===i&&u()})},focusFirst(){d(a(),!1)},teardown(u=!0){m&&(m=!1,r(),document.body.style.overflow=s,h&&document.removeEventListener("keydown",h),h=null,i.remove(),u&&t?.isConnected&&t.focus({preventScroll:!0}))}}}function Oa(n,e){let t=new Set(["chart","objects","resume","availability"]),i=new Map;return new Proxy(Object.create(n),{get(o,s){let r=n,a=Reflect.get(r,s,r);return typeof a!="function"?a:(i.has(s)||i.set(s,t.has(String(s))?async(...l)=>{let c=await Vt(()=>a.apply(r,l),e,()=>{});if(c.outcome==="loaded")return c.value;if(c.outcome==="error")throw c.error;let d=new Error(c.outcome==="timeout"?"request_timeout":"request_cancelled");throw d.name=c.outcome==="timeout"?"TimeoutError":"AbortError",d}:a.bind(r)),i.get(s))}})}import{PickerController as Gm,effectiveFloorOverview as Um,formatMoney as qm,getLocale as lo,loadLocale as Wm,setStringOverrides as Ym,t as D,tCount as _n,seatPriceFor as ad}from"@seatlayer/core";import{isAuthoredSeatView as Zm,seatViewDisclosure as Xm}from"@seatlayer/core/view3d/crossfade/panorama";function _a(n){return!!n&&n.clientWidth>0&&n.scrollWidth>n.clientWidth+1}function gu(n){return n.some(e=>_a(e))}var zi="data-fit-gone",bu=12;function Go(n,e,t=_a){if(!n)return 0;for(let i of e)n.classList.remove(i.cls);if(n.querySelectorAll(`[${zi}]`).forEach(i=>{i.removeAttribute(zi),i.hidden=!1}),n.dataset.fit="0",n.clientWidth<=0||!t(n))return 0;for(let i=0;i<e.length;i+=1){let o=e[i];i>0&&n.classList.remove(e[i-1].cls),n.classList.add(o.cls),n.dataset.fit=String(i+1);let s=o.give?o.give(n):!0;if(!t(n))return i+1;if(o.repeat&&o.give){for(let r=1;s&&r<bu;r+=1)if(s=o.give(n),!t(n))return i+1}}return e.length}function yu(n,e="[data-fit-seg]"){let t=[...n.querySelectorAll(e)].filter(i=>!i.hidden);return t.length<2?!1:Na(t[t.length-1])}function vu(n,e){let t=n.querySelector(e);return t&&!t.hidden?Na(t):!1}function Na(n){let e=n.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(zi,""),e.hidden=!0),n.setAttribute(zi,""),n.hidden=!0,!0}function wu(n){if(!n)return!1;let e=(n.getAttribute("aria-label")||n.textContent||"").trim();return e?(n.setAttribute("aria-label",e),n.setAttribute("title",e),!0):!1}function Da(n){if(!n)return 0;let e=n.querySelector(".sl-confirm-cancel"),t=n.querySelector(".sl-confirm-add-t");return Go(n,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>wu(e)}],()=>gu([e,t]))}function Ba(n){return Go(n,[{cls:"sl-fit-notype",give:e=>vu(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>yu(e),repeat:!0}])}function Fa(n){return n?(n.classList.add("sl-fitpill"),Go(n,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Qt;function Va(n){if(!n)return!1;delete n.dataset.fit;let e=n.selectedOptions?.[0]?.textContent??n.options[n.selectedIndex]?.textContent??"",t=n.clientWidth;if(!e||!t)return!1;if(Qt===void 0)try{Qt=document.createElement("canvas").getContext("2d")}catch{Qt=null}if(!Qt)return!1;let i=getComputedStyle(n);Qt.font=`${i.fontStyle} ${i.fontWeight} ${i.fontSize} ${i.fontFamily}`;let o=Qt.measureText(e).width,s=(parseFloat(i.paddingLeft)||0)+(parseFloat(i.paddingRight)||0)+(parseFloat(i.borderLeftWidth)||0)+(parseFloat(i.borderRightWidth)||0);return o+s<=t?!1:(n.dataset.fit="row",!0)}function xu(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let{amountMinor:e,currency:t}=n;return typeof e!="number"||!Number.isSafeInteger(e)||e<=0||typeof t!="string"||!/^[A-Za-z]{3}$/.test(t)?null:{amountMinor:e,currency:t.toUpperCase()}}var ku=["on-sale","low","sold-out","presale","closed"];function Hn(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function Uo(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function $a(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n,t=e.count,i=e.index;if(typeof i!="number"||!Number.isInteger(i)||i<1||typeof t!="number"||!Number.isInteger(t)||t<i)return;let o=e.remaining;if(o!=null&&(typeof o!="number"||!Number.isInteger(o)||o<0))return;let s={index:i,count:t,remaining:o??null};if(e.pricingMode!==void 0){if(e.pricingMode!=="matrix")return;s.pricingMode="matrix"}if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;s.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;s.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;s.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let r of["startsAt","endsAt"]){if(e[r]===void 0)continue;let a=Uo(e[r]);if(a===void 0)return;s[r]=a}return s}function Su(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],i=new Set;for(let r of e.channels){if(!r||typeof r!="object"||Array.isArray(r))return;let a=r,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||i.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],d=new Set;for(let h of a.priceOverrides){if(!h||typeof h!="object"||Array.isArray(h))return;let m=h,u=typeof m.categoryKey=="string"?m.categoryKey.trim():"",g=m.tierId===null?null:typeof m.tierId=="string"&&m.tierId.trim()?m.tierId.trim():void 0,b=Hn(m.price);if(!u||g===void 0||b===void 0||b===null)return;let T=`${u}\0${g??""}`;if(d.has(T))return;d.add(T),c.push({categoryKey:u,tierId:g,price:b})}i.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let o=[],s=new Set;for(let r of e.objects){if(!r||typeof r!="object"||Array.isArray(r))return;let a=r,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||s.has(l)||!i.has(c))return;s.add(l),o.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:o}}function qo(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=ku.find(h=>h===e.state);if(!t)return null;let i=Hn(e.fromPrice),o=Hn(e.previousPrice);if(i===void 0||o===void 0)return null;let s=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(s===void 0)return null;let r=$a(e.release);if(r===void 0)return null;let a=e.upcoming===void 0?null:$a(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let h=[];for(let m of e.prices){if(!m||typeof m!="object"||Array.isArray(m))return null;let u=m,g=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!g)return null;let b=Hn(u.price),T=Hn(u.previousPrice);if(b==null||T===void 0)return null;let S={categoryKey:g,price:b,previousPrice:T};if(u.tierId!==void 0){if(u.tierId!==null&&(typeof u.tierId!="string"||!u.tierId.trim()))return null;S.tierId=u.tierId===null?null:u.tierId.trim()}if(u.offerId!==void 0){if(typeof u.offerId!="string"||!u.offerId.trim())return null;S.offerId=u.offerId.trim()}if(u.offerName!==void 0){if(typeof u.offerName!="string"||!u.offerName.trim())return null;S.offerName=u.offerName.trim()}if(u.remaining!==void 0){if(u.remaining!==null&&(typeof u.remaining!="number"||!Number.isInteger(u.remaining)||u.remaining<0))return null;S.remaining=u.remaining==null?null:u.remaining}for(let x of["startsAt","endsAt"]){if(u[x]===void 0)continue;let P=Uo(u[x]);if(P===void 0)return null;S[x]=P}h.push(S)}l=h}let c=Su(e.channelPricing);if(c===void 0)return null;let d=Uo(e.nextPriceChangeAt);return d===void 0?null:{state:t,fromPrice:i,previousPrice:o,currency:s,release:r,upcoming:a,prices:l,channelPricing:c,...e.nextPriceChangeAt!==void 0?{nextPriceChangeAt:d}:{},...e.bookingFee!==void 0?{bookingFee:xu(e.bookingFee)}:{}}}function za(n){return n?.changed!==!1}function ja(n,e){if(!n)return null;let t=null,i=o=>{o!=null&&o>e&&(t===null||o<t)&&(t=o)};for(let o of[n.release,n.upcoming])i(o?.startsAt),i(o?.endsAt);for(let o of n.prices)i(o.startsAt),i(o.endsAt);return i(n.nextPriceChangeAt),t}function Ka(n){let e={};for(let t of n?.prices??[])if(t.tierId==null)e[t.categoryKey]=t.price;else{let i=e[t.categoryKey],o=typeof i=="number"?{base:i}:i??{};e[t.categoryKey]={...o,tiers:{...o.tiers,[t.tierId]:t.price}}}return e}function Ga(n,e){let t={...n};for(let[i,o]of Object.entries(Ka(e))){let s=t[i];t[i]=typeof o=="number"?o:{...typeof s=="number"?{base:s}:s,...o,tiers:{...typeof s=="object"?s.tiers:{},...o.tiers}}}return t}import{fromMinorUnits as Tu,t as Ua}from"@seatlayer/core";var Eu={seat:()=>"",tray:n=>Wa(n)?Ya():""};function qa(n,e,t){let i=n?.bookingFee;return!i||i.amountMinor<=0||i.currency!==e.toUpperCase()||t?.prices&&Object.keys(t.prices).length||t?.objects&&Object.keys(t.objects).length?null:i}function Wa(n){return n.some(e=>(e.bookingFeeMinor??0)>0)}function Ya(){return` \xB7 ${Ua("picker.fee.included")}`}function Za(n,e,t){return n?{seat:i=>i>0?Ua("picker.fee.includesAmount",{amount:t(Tu(n.amountMinor,e))}):"",tray:(i,o,s)=>{let r=i.reduce((a,l)=>a+(l.quantity??1),0);return Wa(i)||o>r&&s>0?Ya():""}}:Eu}function Xa(n,e){let t=n.bookingFeeMinor;return typeof t!="number"||!Number.isSafeInteger(t)||t<=0?{}:typeof n.basePrice!="number"||!Number.isFinite(n.basePrice)||n.basePrice<0?{}:e!==n.unitPrice?{}:{basePrice:n.basePrice,bookingFeeMinor:t}}import{tCount as Cu}from"@seatlayer/core";var Qa="maintenance_mode";function Au(n){if(!n||typeof n!="object")return!1;let e=n;return e.reason===Qa||e.code===Qa}function Pu(n){return typeof n!="number"||!Number.isFinite(n)||n<0?null:Math.max(1,Math.ceil(n/60))}function Wo(n){if(!Au(n))return null;if(typeof n.notice=="string"&&n.notice.trim())return n.notice.trim();let e=Pu(n.retryAfterS);if(e===null)return y("picker.maintenancePausedShortly","Booking is paused for a few minutes for maintenance. Please try again shortly.");let t=Cu("picker.maintenancePaused",e);return t==="picker.maintenancePaused"?`Booking is paused for maintenance. Please try again in about ${e} minute${e===1?"":"s"}.`:t}var Ja=["pointerdown","pointermove","keydown","wheel","touchstart"],ji=class{constructor(e){this.opts=e;this.timer=null;this.root=null;this.doc=null;this.disposed=!1;this.onInput=()=>this.touch();this.onVisibility=()=>{this.doc&&!this.doc.hidden&&this.check()};this.lastInput=this.now()}get enabled(){return this.opts.minutes>0}now(){return this.opts.now?this.opts.now():Date.now()}attach(e,t=e.ownerDocument){if(!(this.disposed||!this.enabled)){this.root=e,this.doc=t;for(let i of Ja)e.addEventListener(i,this.onInput,{capture:!0,passive:!0});t.addEventListener("visibilitychange",this.onVisibility),this.touch()}}touch(){this.lastInput=this.now(),this.arm(this.opts.minutes*6e4)}recentlyActive(){return!this.enabled||this.now()-this.lastInput<this.opts.minutes*6e4}resume(){this.disposed||this.touch()}dispose(){if(this.disposed=!0,this.clear(),this.root)for(let e of Ja)this.root.removeEventListener(e,this.onInput,{capture:!0});this.doc?.removeEventListener("visibilitychange",this.onVisibility),this.root=null,this.doc=null}arm(e){if(this.disposed||!this.enabled)return;this.clear();let t=this.opts.setTimeout??((i,o)=>setTimeout(i,o));this.timer=t(()=>{this.timer=null,this.check()},Math.max(0,e))}clear(){if(this.timer===null)return;(this.opts.clearTimeout??(t=>clearTimeout(t)))(this.timer),this.timer=null}check(){if(this.disposed||!this.enabled)return;let e=this.lastInput+this.opts.minutes*6e4-this.now();if(e>0){this.arm(e);return}if(this.opts.blocked()){this.arm(6e4);return}this.clear(),this.opts.onIdle()}};async function el(n,e){let t=await n.pubApi?.pickerIdleMinutes().catch(()=>null)??null;if(n.destroyed||n.idleClock)return;let i=new ji({minutes:t??30,blocked:()=>!!n.hold,onIdle:()=>tl(n)});i.enabled&&(n.idleClock=i,i.attach(e))}function tl(n){n.destroyed||!n.root||n.holdExpiredEl||(n.realtime?.stop(),n.realtime=null,n.showAccessPanel({reason:"idle",retryable:!0}))}async function nl(n){if(n.destroyed)return!1;if(n.pubApi?.rotateViewerId(),n.access?.configured){let e=await n.refreshAccess();return e&&n.idleClock?.resume(),e}return n.dismissAccessPanel(),await n.controller.refresh(),n.realtime?n.realtime.restart():n.startRealtime(),n.idleClock?.resume(),!0}function il(n){if(!n.destroyed){if(n.hold||n.idleClock?.recentlyActive()){n.pubApi?.rotateViewerId(),n.realtime?.restart();return}tl(n)}}import{t as Yo}from"@seatlayer/core";function ol(n,e,t=[],i=8,o=[]){let s=e.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,c.bottom-n.top+i),0),r=t.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,n.bottom-c.top+i),s>0?i:0),a=o.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,n.right-c.left+i),0);return{top:Math.max(0,Math.ceil(s)),right:Math.max(0,Math.ceil(a)),bottom:Math.max(0,Math.ceil(r)),left:0}}function sl(n){let e=document.createElement("div");e.className="sl-floors sl-levels on",e.setAttribute("role","group"),e.setAttribute("aria-label",Yo("picker.chooseLevel")),e.title=Yo("picker.floorHelp");let t=n.tf("picker.allLevels","All levels"),i=[...n.floors.map((o,s)=>({id:o.id,name:o.name,code:Lu(s)})).reverse(),{id:"",name:t,code:""}];for(let o of i){let s=document.createElement("button");if(s.type="button",s.className="sl-level",s.dataset.level=o.id,s.setAttribute("aria-pressed","false"),s.title=o.name,o.code){let a=document.createElement("b");a.className="sl-level-code",a.textContent=o.code,s.appendChild(a),s.setAttribute("aria-label",`${o.name} (${o.code})`)}let r=document.createElement("span");if(r.className="sl-level-name",r.textContent=o.name,s.appendChild(r),!o.code){let a=document.createElement("span");a.className="sl-level-short",a.setAttribute("aria-hidden","true"),a.textContent=Yo("picker.allLevelsShort"),s.appendChild(a)}s.addEventListener("click",()=>n.onChoose(o.id)),e.appendChild(s)}return e.addEventListener("keydown",o=>{if(o.key!=="ArrowUp"&&o.key!=="ArrowDown")return;let s=[...e.querySelectorAll(".sl-level")],r=s.indexOf(document.activeElement);r<0||(o.preventDefault(),s[Math.max(0,Math.min(s.length-1,r+(o.key==="ArrowUp"?-1:1)))].focus())}),e}function Lu(n){return n===0?"G":String(n)}function rl(n,e,t){if(!n)return;let i=t?"":e;for(let o of n.querySelectorAll(".sl-level"))o.setAttribute("aria-pressed",String(o.dataset.level===i))}var Ki=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}render(e){this.el?.remove(),this.el=null}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,i=this.host.map();if(!e||!t||!i)return 0;let o=this.host.activeFloorObjects().find(x=>x.type==="section"&&x.id===t.id)?.outline;if(!o||o.length<3)return 0;let s=o.map(x=>this.host.controller.worldToScreen(x)),r=s.map(x=>x.x),a=s.map(x=>x.y),l=Math.min(...r),c=Math.min(...a),d=Math.max(...r)-l,h=Math.max(...a)-c;if(d<=0||h<=0)return 0;let m=i.getBoundingClientRect(),u=e.getBoundingClientRect(),g=u.left-m.left,b=u.top-m.top,T=Math.max(0,Math.min(g+u.width,l+d)-Math.max(g,l)),S=Math.max(0,Math.min(b+u.height,c+h)-Math.max(b,c));return T*S/(d*h)}};import{t as ts,tCount as zu}from"@seatlayer/core";import{contrastRatio as ju}from"@seatlayer/core/core/color";import{t as Be,tCount as Gi}from"@seatlayer/core";function Zo(n,e,t){try{return new Intl.DateTimeFormat(e,{...t,...n.timezone?{timeZone:n.timezone}:{}}).format(new Date(n.startsAt))}catch{return new Date(n.startsAt).toLocaleString(e)}}var Ui=(n,e)=>Zo(n,e,{dateStyle:"medium"}),qi=(n,e)=>Zo(n,e,{timeStyle:"short"}),Jt=(n,e)=>Zo(n,e,{weekday:"short",day:"numeric",month:"short"});function al(n,e,t,i){return!n.length||n.length>=e?null:{summary:i,labels:n.map(o=>`${Ui(o,t)} \xB7 ${qi(o,t)}`)}}function Mu(n,e){let t=new Set(e);return n.map(i=>({...i,free:!t.has(i.eventKey)}))}function ll(n,e){let t=[...n];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Hu(n,e,t="",i=!1){if(!n.length)return"";let o=n.map(s=>{let r=s.free?e.free:e.blocked,a=i&&s.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${C(s.eventKey)}" aria-label="${C(`${s.shortDate}: ${r}`)}" checked>`:"";return`<li class="sl-night${s.free?" ok":" no"}" aria-label="${C(`${s.shortDate}: ${r}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${C(s.shortDate)}</span><span class="st">${C(r)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${C(e.title)}</div><ul class="sl-nightstrip">${o}</ul><p class="sl-tip-nights-note">${C(e.notAvailableOn)}</p>`+t+"</div>"}function Ru(n){return n.selectPartialLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${C(n.selectPartialLabel)}</button>`:n.switchLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${C(n.switchLabel)}</button>`:n.switchLabel||n.selectPartialLabel?"":`<p class="sl-tip-advice">${C(n.advice)}</p>`}function Iu(n){return Number(n.available)+Number(n.selected)+Number(n.partial)+Number(n.unavailable)}function cl(n,e,t){if(Iu(n)<2)return"";let i=(s,r,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${C(r)}</li>`,o=[];return n.available&&o.push(i("sl-pg-sw-free",e.available,` style="background:${C(t)}"`)),n.selected&&o.push(i("sl-pg-sw-sel",e.selected)),n.partial&&o.push(i("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${C(t)}"`)),n.unavailable&&o.push(i("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${C(e.title)}">${o.join("")}</ul>`}function dl(n,e){if(!n.length)return"";let t=n.map(i=>{let o=i.labels.length?i.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${i.labels.length?"":" empty"}${i.active?" active":""}" role="button" tabindex="0"${i.active?' aria-current="true"':""} data-event-key="${C(i.eventKey)}"><span class="n">${C(i.name)}</span><span class="s">${C(o)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${C(e.title)}"><div class="sl-pg-nights-title">${C(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function Xo(n,e){if(n?.kind!=="partial"||!e?.length)return null;let t=n.data?.blockedEventKeys??[],i=Mu(e,t);return{states:i,missing:i.filter(o=>!o.free).map(o=>o.shortDate)}}function pl(n,e){return n?Hu(n.states,{title:e.words?.title??y("picker.group.partlyAvailableTitle","Free on some nights only"),free:y("picker.group.nightFree","Free"),blocked:y("picker.group.nightBlocked","Not available"),notAvailableOn:Be("picker.group.notAvailableOn",{dates:ll(n.missing,e.locale)})},Ru({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:e.words?.advice??y("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function Ou(n,e,t,i){if(!n.length)return"";let o=new Set(e),s=new Set(t),r=n.map(a=>{let l=o.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${C(a.eventKey)}" aria-label="${C(`${a.shortDate}: ${l?i.available:i.unavailable}`)}"${l&&s.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${C(a.shortDate)}</span><span class="sl-confirm-date-state">${C(l?i.available:i.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${C(i.title)}</legend><p class="sl-confirm-dates-copy">${C(i.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${C(i.selectAll)}</span></label><ul>${r}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function hl(n,e,t,i){let o=e.availableEventKeys(t);return Ou(n,o,e.includedEventKeys(),{title:Be("picker.group.confirmDatesTitle"),copy:o.length===n.length?Be("picker.group.confirmAllDatesCopy").replace("{count}",String(n.length)):Be("picker.group.confirmPartialDatesCopy").replace("{available}",String(o.length)).replace("{total}",String(n.length)),selectAll:Be("picker.group.confirmSelectAll"),available:i("picker.group.nightFree","Available"),unavailable:i("picker.group.nightBlocked","Unavailable")})}function ul(n){return[...n.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function ml(n,e,t){let i=[...n.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!i.length)return;let o=n.querySelector(".sl-confirm-add"),s=n.querySelector("[data-pg-confirm-all]"),r=()=>{let a=i.filter(d=>!d.disabled),l=ul(n).length;s&&(s.checked=l===a.length,s.indeterminate=l>0&&l<a.length);let c=n.querySelector("[data-pg-confirm-summary]");c&&(c.textContent=l===a.length?Be("picker.group.confirmAllSelected").replace("{count}",String(l)):Be("picker.group.confirmSelectedOfAvailable").replace("{selected}",String(l)).replace("{available}",String(a.length))),o.disabled=l===0,o.textContent=l?e.label(l):Be("picker.group.confirmChooseOne"),t()};i.forEach(a=>a.addEventListener("change",r)),s?.addEventListener("change",()=>{i.filter(a=>!a.disabled).forEach(a=>{a.checked=s.checked}),r()}),r()}async function fl(n,e,t){if(!n||!t||!n.querySelector("[data-pg-confirm-event-key]"))return!0;let i=ul(n);if(!i.length)return!1;let o=n.querySelector(".sl-confirm-add");return o?.setAttribute("aria-busy","true"),o&&(o.disabled=!0),await t.apply(e,i)?!0:(o?.removeAttribute("aria-busy"),o?.isConnected&&(o.disabled=!1),!1)}function gl(n,e,t){return n?Be("picker.group.seatPartlyAvailable",{label:e,free:n.states.length-n.missing.length,total:n.states.length,dates:ll(n.missing,t)}):""}function bl(n,e){let t=n.map((i,o)=>{let s=i.state==="done"?e.done:i.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${C(i.id)}" data-state="${C(i.state)}"${i.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${i.state==="done"?"\u2713":String(o+1)}</span><span class="l">${C(i.label)}</span><span class="sl-pg-sr">${C(s)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${C(e.label)}">${t}</ol>`}function Qo(n,e){return`<ul class="sl-pg-cards">${n.map(i=>`<li class="sl-pg-card" data-event-key="${C(i.eventKey)}"><span class="n">${C(i.name)}</span><time datetime="${C(i.iso)}"><span class="d">${C(i.date)}</span><span class="t">${C(i.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${C(e)}</p>`}function yl(n){let e=n.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${C(t.eventKey)}"><span class="n">${C(t.name)}</span><span class="s">${C(t.labels.length?t.labels.join(", "):n.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${C(n.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(n.note?`<p class="sl-pg-pane-note">${C(n.note)}</p>`:"")+(n.total?`<div class="sl-pg-pane-total"><span>${C(n.total.label)}</span><b>${C(n.total.amount)}</b></div>`:"")+(n.holdStatus?`<p class="sl-pg-hold-status" role="status">${C(n.holdStatus)}</p>`:"")}function vl(n){let e=Math.max(0,n);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function wl(n,e){if(!n||n.seats<=0)return"";if(e==="same_seat"){let t=n.perPerformance??n.seats;return n.totalPerformances&&n.performances<n.totalPerformances?Gi("picker.group.performancesChosenOf",t,{chosen:n.performances,total:n.totalPerformances}):Gi("picker.group.seatsEveryPerformance",t)}return n.perPerformance!=null&&n.performancesChosen===n.performances?Gi("picker.group.seatsPerPerformance",n.seats,{per:n.perPerformance}):Gi("picker.group.performancesChosenOf",n.seats,{chosen:n.performancesChosen,total:n.performances})}function xl(n,e){n.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let i=()=>e(t.dataset.eventKey);t.addEventListener("click",i),t.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),i())})})}function Fe(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function _u(n,e){let t=n.objectType==="table"&&!!n.bookingMode,i=n.objectType==="booth",o=t||i||!n.seatNumber,s=o?n.rowLabel??n.displayLabel??n.label:n.seatNumber,r=t?`${y("picker.guests","Guests")} ${n.bookingMode==="variable"?`${n.minOccupancy}\u2013${n.maxOccupancy}`:n.capacity}`:!i&&n.rowLabel?`${e} ${Q(n)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${o?" name":""}">${Fe(s)}</span>`+(r?`<span class="sl-tip-row">${Fe(r)}</span>`:"")+"</div>"+(n.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${y("picker.section","Section")}</span><span class="sl-tip-secname">${Fe(n.sectionLabel)}</span></div>`:"")+"</div>"}function kl(n,e){let t=n.status==="not_for_sale",i=n.mark?.kind==="partial",o=n.status==="free"||i?"":`<span class="sl-tip-tag">${e.ownHold?y("picker.heldForYou","Held for you"):y("picker.group.legendUnavailable","Unavailable")}</span>`,s=t?"":e.price,r=s?`<span class="sl-tip-amt">${Fe(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${Fe(e.priceNote)}</div>`:"",l=s&&e.feeNote?`<div class="sl-tip-fee">${Fe(e.feeNote)}</div>`:"",c=ut(n,{compact:!0}),d=e.reason?`<div class="sl-tip-reason">${Fe(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+_u(n,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${Fe(n.categoryColor)}"></span><span class="sl-tip-name">${Fe(n.categoryLabel)}</span>`+o+r+"</div>"+l+a+d+c+(e.extra??"")}function Sl(n,e,t,i){let o=n.x+14,s=n.y-i.height-12,r=n.y+18,a=s;o+i.width>e-8&&(o=n.x-i.width-14),s<8&&r+i.height<=t-8&&(a=r);let l=Math.max(8,t-i.height-8);return{left:Math.max(8,Math.min(o,Math.max(8,e-i.width-8))),top:Math.max(8,Math.min(a,l))}}function Tl(n,e,t,i=22){let o=Math.max(8,Math.min(n.x-t.width/2,Math.max(8,e.width-t.width-8))),s=n.y-i-t.height,r=n.y+i;return s>=8?{left:o,top:s,placement:"above"}:r+t.height<=e.height-8?{left:o,top:r,placement:"below"}:{left:o,top:Math.max(8,Math.min(s<8?r:s,Math.max(8,e.height-t.height-8))),placement:s<8?"below":"above"}}var Jo=14,Nu=12,Du=12,Bu=8;function El(n,e,t,i=Nu){let o=e.height-Jo-t.height,s=Du,r=o-i;if(r<=s)return{placement:"sheet",nudgeY:0};let a=(s+r)/2-n;return Math.abs(a)<=Bu?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function Cl(n,e,t,i,o=0){let s=t.width/2+12,r=Math.max(s,Math.min(e.width-s,n.x)),a=n.y+o+t.height+24<=e.height,l=n.y-o<t.height+24&&a?"below":"above",c=l==="above"?n.y-o:n.y+o,d=i&&l==="above"?Math.max(t.height+24,c):c;return{left:r,top:Math.max(8,Math.min(e.height-8,d)),placement:l}}function Al(n,e,t){let i=n.querySelector("[data-pg-select-partial]"),o=[...n.querySelectorAll("[data-pg-event-key]")],s=()=>o.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),r=()=>{if(!i)return;let a=s().length;i.disabled=a===0,i.textContent=e?.(a)??i.textContent};o.forEach(a=>{a.addEventListener("change",r);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,r())})}),i?.addEventListener("click",()=>{let a=s();a.length&&t?.(a)})}function yt(n){let e=n?.displayType?.trim()||n?.rowType?.trim();return e||(n?.objectType==="table"?y("picker.table","Table"):n?.objectType==="booth"?y("picker.booth","Booth"):y("picker.row","Row"))}var Fu="sl-confirm-scrim",Vu="--sl-scrim-mask";function $u(n){let e=Math.round(n.x),t=Math.round(n.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function Pl(n,e,t,i){let o=n??document.createElement("div");return n||(o.className=Fu),o.style.setProperty(Vu,$u(i)),t.parentNode===e?o.nextSibling!==t&&e.insertBefore(o,t):o.parentNode!==e&&e.appendChild(o),o}function es(n){return n?.remove(),null}var Ll={passport:!1,compare:!1},Ku=360,Gu=160,Uu=700,Ml=450,qu=8;function Hl(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function Wu(n){return ju("#ffffff",n)>=3?"#ffffff":"#0b0f19"}var Wi=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let i=Yt(e)?e.viewUrl??"":"",o=Bi(t);if(!i&&!o)return"";let s=i?null:Fi(e,e.focalPoint??t.focalPoint);if(!i&&s==null)return"";let r="";if(!i)return r;let a=B(ts("picker.viewFromSeat",{label:e.label})),l=B(this.host.tf("picker.viewFromHere","View from here"));return`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`+r}show(e,t="add"){let i=this.host;this.mode=t;let o=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,i.root()?.setAttribute("data-confirming","true"),i.els().side?.toggleAttribute("inert",!0),Object.values(i.regions()).forEach(M=>M.toggleAttribute("inert",!0)),i.controller.setSelectionFocus(e.id),o&&o!==e.id&&i.controller.deselect([o]),i.hideTooltip();let s=i.controller.seatDetails(e.id),r=i.controller.doc?.categories.find(M=>M.key===e.categoryKey),a=s?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),l=a!=null?i.paidPrice(e.categoryKey,s?.tierId??r?.tiers?.[0]?.id??null,a,e.label):void 0,c=vr(s,e.displayLabel??e.label,yt(s)),d=s?.tiers??r?.tiers??[],h=s?.tierId??d[0]?.id,m=i.suppressPricing()?"":hi(d,h,M=>i.money(i.paidPrice(e.categoryKey,M.id,M.price,e.label)),M=>i.offerName(e.categoryKey,M.id)),u=i.buyerView()==="venue3d",g=i.performanceGroup()?.confirmDateSelection??void 0,b=g?i.performanceGroup()?.nights?.()??[]:[],T=g?hl(b,g,e.id,(M,G)=>i.tf(M,G)):"";this.shownAt=performance.now();let S=document.createElement("div");S.className="sl-confirm sl-mo-in",t==="remove"&&S.classList.add("sl-confirm-removing"),T&&S.classList.add("sl-confirm-group-dates"),S.setAttribute("role","dialog"),S.setAttribute("aria-label",ts("picker.confirmSeatLabel",{label:e.label}));let x=i.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??r?.color??"#6e7bff";S.style.setProperty("--sl-cat",x),S.style.setProperty("--sl-cat-ink",Wu(x));let P=String(s?.categoryLabel??r?.label??e.categoryKey),_=i.controller.categoryAvailability()[e.categoryKey],U=typeof _=="number"&&_>0?zu("picker.leftCount",_):"",R=i.packagePrice?.(e.categoryKey)??null,f=i.suppressPricing()?`${s?.displayLabel??e.displayLabel??e.label}`:`${s?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?i.tf("picker.priceNotSupplied","Price not supplied"):i.money(l)}`,I=Ll.passport?yr(e,f,u):"",L=Ll.compare?br(e,u?i.view3dCompareSeatIds():null):"";S.innerHTML=Sr({identityFields:c,identity:wr(s,e.displayLabel??e.label,yt(s)),marker:gr({...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{}}),see3dPill:xr(i.canOffer3d(),u),categoryColor:x,categoryLabel:P,priceLabel:R?R.price:!i.suppressPricing()&&l!=null?i.money(l):"",feeNote:R?R.note:!i.suppressPricing()&&l!=null?i.feeNote?.(l)??"":"",categoryLeftLabel:U,tierChoices:m,groupDates:T,wheelchair:"",commercial:ut({...e.accessibility?.length?{accessibility:e.accessibility}:{},...s?.wheelchairSpaceType?{wheelchairSpaceType:s.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{},...s?.aisle?{aisle:!0}:{},...s?.boothType?{boothType:s.boothType}:{},...s?.entrance?{entrance:s.entrance}:{}}),thumb:i.seatViewEnabled()&&i.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:u?`<div class="sl-confirm-inspect-row">${I}${L}${Co(i.canOffer3d(),u)}</div>`:Co(i.canOffer3d(),u),see3dRow:kr(i.canOffer3d(),u),cancelLabel:ts("common.cancel"),selectLabel:t==="remove"?i.tf("picker.removeSeat","Remove seat"):i.addSeatLabel(s?.objectType)}),t==="remove"&&S.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),i.els().map.appendChild(S),this.el=S;let O=S.querySelector(".sl-confirm-thumb"),N=O?.closest(".sl-confirm-thumbwrap")??null;if(O&&N){let M=!1,G=()=>{if(M||!N.isConnected)return;M=!0;let X=()=>{N.remove(),this.el===S&&i.reanchor()};if(i.reducedMotion()||typeof requestAnimationFrame!="function"){X();return}N.style.height=`${N.offsetHeight}px`,N.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{N.style.height="0px",N.style.opacity="0"}),setTimeout(X,Gu)};O.addEventListener("error",G),O.addEventListener("load",()=>{O.naturalWidth||G()});let q=e.viewMeta?.previewUrl??e.viewUrl;q?i.resolveAssetUrl(q).then(X=>{if(!(!S.isConnected||this.el!==S)){if(!X){G();return}O.src=X}}).catch(X=>{G(),i.onError(X)}):G()}i.reanchor(),this.liftSeatClearOfSheet(e),S.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{i.openSeatView(e)}),S.querySelector(".sl-confirm-confidence")?.addEventListener("click",M=>{i.openSeatConfidencePassport(e,M.currentTarget instanceof HTMLElement?M.currentTarget:null)}),S.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>i.saveView3dComparisonSeat(e)),S.querySelectorAll("[data-confirm-tier]").forEach(M=>{M.addEventListener("click",()=>{let G=M.dataset.confirmTier,q=d.find(ye=>ye.id===G);if(!q)return;i.controller.setSeatTier(e.id,q.id),S.querySelectorAll("[data-confirm-tier]").forEach(ye=>{ye.setAttribute("aria-pressed",String(ye===M))});let X=S.querySelector(".sl-confirm-price"),me=i.paidPrice(e.categoryKey,q.id,q.price,e.label);X&&(X.textContent=i.money(me));let fe=S.querySelector(".sl-confirm-fee");fe&&(fe.textContent=i.feeNote?.(me)??""),i.reanchor()})}),S.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(M=>{M.addEventListener("pointerdown",ri,{once:!0}),M.addEventListener("click",()=>{i.buyerView()==="venue3d"?(i.dismiss(),i.view3dHandle()?.flyToSeat(e.id)):(i.rememberView3dReturnSeat(e),i.dismiss(),i.enter3d(e.id))})}),ml(S,g,()=>i.reanchor()),S.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),S.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(S),requestAnimationFrame(()=>{let M=S.querySelector(".sl-confirm-add");M?.focus(),i.liftToastOverConfirm(),i.fitTranslatedRows(),i.inviteCommit(S,M)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,i=t.root();if(!this.el||i?.dataset.layout!=="narrow"||i?.dataset.view3d==="on")return;let o=t.els().map;if(!o)return;let s=t.controller.worldToScreen({x:e.x,y:e.y}),r=t.controller.getRenderer(),a=r?.getCameraGestureCount?.()??0,{nudgeY:l}=El(s.y,{height:o.clientHeight},{height:this.el.offsetHeight||230}),c=this.lift&&this.lift.gestures===a?this.lift.dy:0;if(!l){this.lift=c?{dy:c,gestures:a}:null;return}let d=!t.reducedMotion();r?.panScreenBy?.({x:0,y:l},{animate:d}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=d?this.now()+Uu:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),i=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=Pl(this.scrim,i,this.el,t),Ur(this.el,t,i),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=es(this.scrim);let o=i.clientWidth,s=i.clientHeight,r=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,d=Cl(t,{width:o,height:s},{width:r,height:a},l,c);this.el.dataset.placement=d.placement,this.el.style.left=`${d.left}px`,this.el.style.top=`${d.top}px`,Ai(this.el,t,{left:d.left,top:d.top,width:r,height:a})}ghostActivation(){return Hl()?performance.now()-this.shownAt<Ml:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,i=new Map,o=r=>{if(this.el!==e){this.disarmOutsideTap();return}let a=r.target,l=r;if(r.type!=="pointerdown"){let d=i.get(l.pointerId);i.delete(l.pointerId),d&&r.type==="pointerup"&&i.size===0&&Math.hypot(l.clientX-d.x,l.clientY-d.y)<=qu&&this.cancel();return}if(!(!a||e.contains(a)||t.els().tray?.contains(a))){if(a instanceof Element&&a.closest(".sl-view3d")){if(i.set(l.pointerId,{x:l.clientX,y:l.clientY}),i.size>1)for(let d of i.keys())i.set(d,{x:Number.NaN,y:Number.NaN});return}this.cancel()}};this.outsideTap=o;let s=t.root();setTimeout(()=>{this.outsideTap===o&&((s??document).addEventListener("pointerdown",o,!0),(s??document).addEventListener("pointerup",o,!0),(s??document).addEventListener("pointercancel",o,!0))},Hl()?Ml:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null;for(let t of["pointerdown","pointerup","pointercancel"])(this.host.root()??document).removeEventListener(t,e,!0),document.removeEventListener(t,e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=es(this.scrim),this.settleLift(),this.el&&Pi(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null),e.syncTray()}async commit(){let e=this.host,t=this.seat;if(!t)return;let o=this.el?.querySelector(".sl-confirm-add")??null;if(o?.classList.contains("is-adding")||!await fl(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let s=()=>{let l=e.root()?.dataset.layout==="narrow"?this.lift:null;l&&(this.lift=null),e.dismiss();let c=e.controller.worldToScreen(t);$o(e.els(),c,t,e.controller.doc?.categories,()=>{e.cartLanded?.(),l&&(this.lift=l,this.settleLift())})};if(!o||e.reducedMotion()){s();return}o.classList.remove("sl-confirm-add-invite"),o.classList.add("is-adding"),o.setAttribute("aria-disabled","true");let r=o.querySelector(".sl-confirm-add-t");r&&(r.textContent=e.tf("picker.added","Added")),e.scheduleMotion(s,Ku)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"&&e.controller.deselect([t.id]),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}removeCommitted(){let e=this.host,t=this.seat;if(!t)return;let i=e.releaseHeldSeat(t);i||e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0})}};function Rl(n,e,t){if(!e||t||n.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let i=()=>e.classList.remove("sl-confirm-add-invite");n.addEventListener("pointerdown",i,{once:!0}),n.addEventListener("keydown",i,{once:!0}),e.addEventListener("focus",i,{once:!0})}function Il(n,e){return n&&n!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}import{t as ns}from"@seatlayer/core";var Yu=12;function Ol(n,e){let t=e.floors(),i=new Set(t.map(R=>R.label.trim().toLocaleLowerCase())),o=e.zones().filter(R=>R.seatCount>0&&!i.has(R.label.trim().toLocaleLowerCase())),s=e.sections().filter(R=>R.seatCount>0&&!i.has(R.label.trim().toLocaleLowerCase())),r=o.length>1?[]:s,a=t.length>1,l=o.length>1,c=r.length>1;if(!a&&!l&&!c)return null;let d=document.createElement("div");d.className="sl-view3d-nav";let h=null,m=document.createElement("button");m.type="button",m.className="sl-view3d-nav-toggle",m.setAttribute("aria-expanded","false");let u='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>',g=document.createElement("span");m.innerHTML=u,m.appendChild(g);let b=()=>{for(let R of d.querySelectorAll(":scope > div")){let f=R.querySelector('[aria-pressed="true"]');!f||R.scrollWidth<=R.clientWidth||f.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(h)return h;for(let R of d.querySelectorAll(":scope > div")){let f=R.querySelector('button[aria-pressed="true"]'),I=f?.textContent?.trim();if(I&&f?.dataset.floor!=="")return I}return a&&(l||c)?y("picker.levelsAndAreas","Levels & zones"):a?y("picker.levels","Levels"):y("picker.areas","Zones")},S=R=>{d.classList.toggle("is-open",R),m.setAttribute("aria-expanded",String(R)),R&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(b),g.textContent=T()};m.addEventListener("click",()=>S(!d.classList.contains("is-open"))),d.addEventListener("keydown",R=>{R.key!=="Escape"||!d.classList.contains("is-open")||(R.preventDefault(),R.stopPropagation(),S(!1),m.focus())});let x=document.createElement("button");x.type="button",x.className="sl-view3d-nav-close",x.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let P=y("picker.closeVenueNavigation","Close venue navigation");x.setAttribute("aria-label",P),x.title=P,x.addEventListener("click",()=>{S(!1),m.focus()}),S(!1),d.appendChild(m);let _=R=>{},U=R=>{};if(a){let R=document.createElement("div");R.setAttribute("role","group"),R.setAttribute("aria-label",y("picker.levels","Levels"));let f=[];U=O=>{f.forEach(N=>{N.setAttribute("aria-pressed",String((N.dataset.floor===""?null:Number(N.dataset.floor))===O))})};let I=O=>{e.focusFloor(O)&&(U(O),_(O))},L=(O,N)=>{let M=document.createElement("button");M.type="button",M.textContent=O,M.dataset.floor=N===null?"":String(N),M.setAttribute("aria-pressed",String(N===null)),M.addEventListener("click",()=>{I(N),S(!1)}),f.push(M),R.appendChild(M)};L(y("picker.allLevels","All levels"),null);for(let O of t)L(O.label||ns("picker.levelNumber",{number:O.index+1}),O.index);d.appendChild(R)}if(l||c){let R=document.createElement("div");R.setAttribute("role","group"),R.setAttribute("aria-label",y("picker.areas","Zones"));let f=l?o.map(L=>({id:L.id,label:L.label||L.id,go:()=>{e.focusZone(L.id)}})):r.map(L=>({id:L.id,label:L.label||L.id,floorIndex:L.floorIndex,go:()=>{e.focusSection(L.id),Number.isFinite(L.floorIndex)&&U(L.floorIndex)}})),I=L=>{let O=l||L===null?f:f.filter(N=>N.floorIndex===void 0||N.floorIndex===L);if(R.replaceChildren(),!O.length){R.remove();return}if(R.isConnected||d.insertBefore(R,x.isConnected?x:null),!l&&O.length>Yu){let N=document.createElement("select");N.setAttribute("aria-label",y("picker.jumpToSection","Jump to section"));let M=document.createElement("option");M.value="",M.textContent=y("picker.jumpToSection","Jump to section"),N.appendChild(M);for(let G of O){let q=document.createElement("option");q.value=G.id,q.textContent=G.label,N.appendChild(q)}N.addEventListener("change",()=>{O.find(G=>G.id===N.value)?.go()}),R.appendChild(N);return}for(let N of O){let M=document.createElement("button");M.type="button",M.textContent=N.label,M.dataset.area=N.id,M.addEventListener("click",()=>{h=N.label,N.go(),S(!1)}),R.appendChild(M)}};_=I,I(null)}return d.appendChild(x),n.appendChild(d),d}var Yi=class{constructor(e){this.host=e;this.chip=null}sync(){let e=this.host.overlay();if(!e||this.host.savedSeatIds().length===0){this.chip?.remove(),this.chip=null;return}let t=this.chip;if(!t){t=document.createElement("div"),t.className="sl-view3d-compare-saved",t.setAttribute("role","group"),t.setAttribute("aria-label",y("picker.savedSeatComparison","Saved seat comparison"));let s=document.createElement("button");s.type="button",s.className="main",s.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(y("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let r=document.createElement("button");r.type="button",r.className="clear",r.textContent="\xD7",r.setAttribute("aria-label",y("picker.clearSavedSeatComparison","Clear saved seat comparison")),r.addEventListener("click",()=>this.host.clearComparison()),t.append(s,r),e.appendChild(t),this.chip=t}let i=this.host.savedSeatIds().length,o=t.querySelector(".main");o&&(o.textContent=i>1?ns("picker.compareCount",{count:i}):y("picker.oneSeatSaved","1 seat saved"),o.setAttribute("aria-label",i>1?ns("picker.openComparisonOfSeats",{count:i}):y("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function _l(n){return!n?.querySelector('[data-ref="zfs"]')}var Nl="sl:sheet-hint";function Dl(n){let e=n.boot;if(!e?.isConnected)return;if(n.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),n.map?.appendChild(t),setTimeout(()=>t.remove(),450),n.rail?.classList.add("is-in"),n.root?.classList.add("is-arriving"),setTimeout(()=>{n.rail?.classList.remove("is-in"),n.root?.classList.remove("is-arriving"),Zu(n.root)},700)}function Zu(n){if(!n||n.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(Nl))return;window.sessionStorage.setItem(Nl,"1")}catch{}let e=n.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function Bl(n,e){n.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let i of e())if(i.open()){t.preventDefault(),t.stopPropagation(),i.close();return}}})}function Xi(n){let e=n.committedSelection(),t=n.controller.getGAAreas(),i=n.hold?.items??[],o=new Set(i.map(m=>m.label)),s=Jr(n,t,i),r=Xe(n.gaQty,i),a=i.reduce((m,u)=>m+n.heldPrice(u)*(u.quantity??1),0),l=i.reduce((m,u)=>m+(u.quantity??1),0),c=e.filter(m=>!o.has(m.label)),d=c.reduce((m,u)=>m+n.paidPrice(u.categoryKey,u.tierId??null,u.price,u.label)*(u.quantity??1),0)+s+a,h=c.reduce((m,u)=>m+(u.quantity??1),0)+r+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:i,heldLabels:o,heldCount:l,total:d,count:h}}function Qi(n,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:n.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function Ji(n,e){let t=e.tiers?.length?e.tiers.map(i=>n.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[n.paidPrice(e.key,null,e.price)];if(e.key){for(let i of n.pricesByChannel.values())for(let o of i)o.categoryKey===e.key&&t.push(o.price);t.push(...Xu(n).get(e.key)??[])}return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var Zi=null;function Xu(n){let e=n.controller.doc,t=n.hostObjectPrices();if(Zi?.doc!==e||Zi.host!==t){let i=new Map;for(let[o,s]of Object.entries({...e?.seatPrices,...t})){let r=n.controller.seatByLabel(o)?.categoryKey??n.controller.tableSelection(o)?.categoryKey;r&&(i.has(r)||i.set(r,[]),i.get(r).push(...typeof s=="number"?[s]:Object.values(s.tiers)))}Zi={doc:e,host:t,spread:i}}return Zi.spread}var Rn="seatlayer_";function Qu(){let n=globalThis;return n.document?.modelContext??n.navigator?.modelContext??null}function ge(n,e){return e?{ok:!1,reason:n,message:e}:{ok:!1,reason:n}}function Ju(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&!!e):[]}function em(n,e){let t=n.event();if(!t)return ge("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits();return{ok:!0,event:t,selection:{max:i.max,...i.required!=null?{required:i.required}:{}},categories:n.categories(),zones:n.zones(),hasPremiumSeats:n.hasPremiumSeats(),holdsAllowed:e}}function Fl(n,e){let t=o=>!!o&&o.toLowerCase()===e.toLowerCase(),i=n.find(o=>t(o.key??o.id))??n.find(o=>t(o.label));return i?.key??i?.id??null}function Vl(n,e){let t=e.map(i=>n.describeSeat(i.id));return{seatIds:e.map(i=>i.id),labels:e.map(i=>i.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((i,o)=>t[o]?.seat||i.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((i,o)=>i+o.price,0)}}function tm(n,e,t){let i=new Map;for(let s of e){let r=i.get(s.rowKey);r?r.push(s):i.set(s.rowKey,[s])}let o=[];for(let s of i.values()){let r=[...s].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=r.length;l++)if(l===r.length||r[l].index!==r[l-1].index+1||r[l].categoryKey!==r[l-1].categoryKey){for(let d=a;d+t<=l;d+=t)o.push(Vl(n,r.slice(d,d+t)));a=l}}return o}function nm(n,e,t){let i=new Map;for(let s of e){let r=i.get(s.sectionKey);r?r.push(s):i.set(s.sectionKey,[s])}let o=[];for(let s of i.values()){if(s.length<t)continue;let r=[...s].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);o.push(Vl(n,r.slice(0,t)))}return o}function im(n,e){if(!n.event())return ge("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits(),o=Math.floor(Number(e.count));if(!Number.isInteger(o)||o<1||o>i.max)return ge("bad_count",`count must be a whole number between 1 and ${i.max}.`);let s=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,r=e.together===void 0?!0:!!e.together,a=typeof e.max_price=="number"&&Number.isFinite(e.max_price)?e.max_price:null,l=typeof e.category=="string"&&e.category?e.category:null,c=typeof e.zone=="string"&&e.zone?e.zone:null,d=l?Fl(n.categories(),l):null;if(l&&!d)return ge("no_match",`No ticket type called "${l}".`);if(d&&n.categories().find(b=>b.key===d)?.available===0)return ge("sold_out",`"${l}" is sold out.`);let h=c?Fl(n.zones(),c):null;if(c&&!h)return ge("no_match",`No zone called "${c}".`);let m=n.seats().filter(b=>b.available);if(!m.length)return ge("sold_out");let u=m.filter(b=>(!d||b.categoryKey===d)&&(!h||b.zoneId===h)&&(a==null||b.price<=a));if(!u.length)return ge("no_match");let g=r?tm(n,u,o):nm(n,u,o);return g.length?(g.sort((b,T)=>T.unitPrice!==b.unitPrice?T.unitPrice-b.unitPrice:b.row.localeCompare(T.row)||b.labels[0].localeCompare(T.labels[0])),{ok:!0,groups:g.slice(0,s),searched:{count:o,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...h?{zone:h}:{},together:r}}}):ge(r?"not_enough_together":"no_match")}function $l(n){return{ok:!0,...n.selection()}}function om(n,e){let t=n.event();if(!t)return ge("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return ge("event_closed","Sales are closed for this event.");let i=Ju(e.seat_ids);return i.length?(n.clearSelection(),n.selectObjects(i),$l(n)):ge("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function sm(n,e){let t=async o=>{try{return await o()}catch(s){return ge("error",s instanceof Error?s.message:String(s))}},i=[{name:`${Rn}describe_event`,title:"Describe this seated event",description:"Read the event, its ticket types with live availability and prices, its zones, and how many seats this buyer may select. Call this first.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>em(n,e))},{name:`${Rn}find_seats`,title:"Find available seats",description:"Search the seat map for groups of available seats. Read-only: it never selects, holds or reserves anything. Returns candidate groups with their seat ids, prices and location.",inputSchema:{type:"object",properties:{count:{type:"integer",minimum:1,description:"How many seats are needed."},max_price:{type:"number",description:"Highest acceptable price per seat."},category:{type:"string",description:"Ticket type key or label to restrict the search to."},zone:{type:"string",description:"Zone id or label to restrict the search to."},together:{type:"boolean",description:"Require the seats to be side by side in one row (default true)."},limit:{type:"integer",minimum:1,maximum:20,description:"How many candidate groups to return (default 5)."}},required:["count"],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:o=>t(()=>im(n,o))},{name:`${Rn}select_seats`,title:"Select seats on the map",description:"Replace the current selection with the given seats, exactly as tapping them would. The buyer sees the seats light up and the basket update. No reservation is made.",inputSchema:{type:"object",properties:{seat_ids:{type:"array",items:{type:"string"},description:"Seat ids or labels, e.g. from find_seats."}},required:["seat_ids"],additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:o=>t(()=>om(n,o))},{name:`${Rn}get_selection`,title:"Read the current selection",description:"Read the seats currently selected in the basket, their total, any open reservation, and whether the selection satisfies this event\u2019s rules.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:()=>t(()=>$l(n))}];return e&&i.push({name:`${Rn}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>n.hold())}),i}async function zl(n,e={}){let t=Qu();if(!t||typeof t.registerTool!="function")return null;let i=new AbortController,o=sm(n,!!e.holds),s=[],r=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of o)await t.registerTool(a,{signal:i.signal,...r?{exposedTo:r}:{}}),s.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return s.length?{names:s,dispose:()=>{if(i.abort(),typeof t.unregisterTool=="function")for(let a of s)try{t.unregisterTool(a)}catch{}}}:null}async function jl(n){let e=n.opts.webMcp;if(!e||n.destroyed)return;let t=typeof e=="object"&&!!e.holds,i=typeof e=="object"?e.exposedTo:void 0;try{n.webMcp=await zl(os(n,t),{holds:t,exposedTo:i}),n.destroyed&&is(n)}catch(o){console.warn("seatmap: WebMCP registration failed",o)}}function is(n){n.webMcp?.dispose(),n.webMcp=null}function os(n,e){let t=(i,o)=>{if(Number.isInteger(i.logicalSeatIndex))return i.logicalSeatIndex;let s=i.id.lastIndexOf(":"),r=s<0?NaN:Number(i.id.slice(s+1));return Number.isFinite(r)?r:o};return{event:()=>{let i=n.renderInfo;return i?{name:i.eventName??"",venue:i.venue??null,startsAt:i.startsAt??null,timezone:i.timezone??null,currency:n.currency,salesClosed:n.salesClosed}:null},selectionLimits:()=>({max:n.maxTickets,required:n.exactTickets}),categories:()=>{let i=n.controller.categoryAvailability();return(n.controller.doc?.categories??[]).filter(o=>!o.notForSale).map(o=>{let s=Ji(n,o),r=Qi(n,o);return{key:o.key,label:o.label??o.key,...r===void 0?{}:{price:r},...s&&s.min!==s.max?{priceRange:s}:{},available:i[o.key]??0}})},zones:()=>n.controller.getBestAvailableZones(),hasPremiumSeats:()=>n.controller.hasPremiumSeats(),seats:()=>{let i=n.controller.getActiveFloorId(),o=[];return n.allSeats().forEach((s,r)=>{if(s.floorId&&i&&s.floorId!==i)return;let a=n.controller.getStatus(s.id)??"free",l=n.controller.doc?.categories.find(d=>d.key===s.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;o.push({id:s.id,label:s.label,rowKey:s.logicalRowId??s.rowId,sectionKey:s.sectionId??s.rowId,index:t(s,r),categoryKey:s.categoryKey,price:n.paidPrice(s.categoryKey,l?.tiers?.[0]?.id??null,c,s.label),...s.zoneId?{zoneId:s.zoneId}:{},available:a==="free"&&!l?.notForSale})}),o},describeSeat:i=>{let o=n.controller.seatDetails(i);return o?{section:o.sectionLabel??"",row:Q(o)??"",seat:o.seatNumber??o.label,category:o.categoryLabel??o.categoryKey}:null},selection:()=>{let{freshSeats:i,total:o,count:s}=Xi(n);return{seats:i.map(r=>({id:r.id,label:r.label,section:r.sectionLabel??"",row:Q(r)??"",seat:r.seatNumber??r.label,category:r.categoryKey,price:n.paidPrice(r.categoryKey,r.tierId??null,r.price,r.label)})),count:s,total:o,currency:n.currency,hold:n.hold?{id:n.hold.holdId,expiresAt:n.hold.expiresAt}:null,validity:n.getSelectionValidity()}},clearSelection:()=>n.clearSelection(),selectObjects:i=>{n.selectObjects(i)},hold:()=>e?rm(n):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function rm(n){if(n.salesClosed)return{ok:!1,reason:"event_closed"};if(!n.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=n.controller.getSelectionValidity(n.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await n.handleCta(),n.hold?{ok:!0,hold:{id:n.hold.holdId,expiresAt:n.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function Kl(n,e){if(e.objectType!=="seat"&&e.objectType!=="booth")return null;let t=n.seatByLabel(e.label),i=t?n.toSeat(t).tiers:void 0;return i&&i.length>1?i:null}async function Gl(n,e,t,i){let o=n.currentHold(),s=o?.items??[],r=s.find(c=>c.label===e);if(!o||!r||r.tierId===t)return null;let a=s.map(c=>({label:c.label,tierId:c.label===e?t:c.tierId,...c.quantity!=null?{quantity:c.quantity}:{}})),l=await n.api.hold(n.key,a,i,o.holdId);return n.setHold({holdId:l.holdId,labels:a.map(c=>c.label),expiresAt:l.expiresAt,items:l.items}),n.currentHold()}function ss(n){return{renderingTimeMillis:n.ms,performanceProfile:n.performanceProfile,seatCount:n.seatCount,objectCount:n.objectCount,sectionCount:n.sectionCount,view:n.view,eventKey:n.eventKey,chartName:n.chartName,floorCount:n.floorCount,transport:n.transport,load:n.load,metricScope:n.metricScope,operationalTelemetryReporter:"sdk"}}function Ul(n,e){Ee({apiBase:n.apiBase,event:n.eventKey,scope:n.metricScope,surface:n.surface,outcome:"success",ms:n.ms,performanceProfile:n.performanceProfile,seats:n.seatCount,floors:n.floorCount,view:n.view,load:n.load,transport:n.transport,revealWaitMs:n.revealWaitMs,handoverMs:n.handoverMs}),e("chart_rendered",ss(n))}import{seatConfidenceDisclosure as am}from"@seatlayer/core/core/seatConfidence";function re(n){return String(n??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function ql(n){let e=am(n.seat.confidenceEvidence),t=n.seat.confidenceEvidence,i=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${re(c)}</li>`).join("")}</ul>`:"",o=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${re(e.modeledTarget)}</dd></div>`:"",s=t?`<div><dt>Evidence ID</dt><dd>${re(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${re(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${re(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${re(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${re(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",r=pi(n.seat.commercial).join(" \xB7 ")||n.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${re(r)}</dd></div>`+(n.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${re(n.seat.commercial.note)}</dd></div>`:""),l=n.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${re(n.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${re(e.headline)}</strong><span>${re(e.coverage)} \xB7 ${re(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${re(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${re(e.reality)}</dd></div><div><dt>Source</dt><dd>${re(e.provenance)}</dd></div>`+a+o+s+`</dl>${i}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function Wl(n){return n?n.closest("[data-report]")?"report":n.closest("[data-close]")||n.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function eo(n,e,t){let i=n?.querySelector("[data-report]"),o=n?.querySelector("[data-report-status]");i&&(i.disabled=e!=="failed",i.textContent=e==="received"?"Report received":"Report this view"),o&&(o.setAttribute("role",e==="failed"?"alert":"status"),o.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function rs(n,e,t=null){let i=n.view3dEl;if(!i)return;In(n,!1);let o=e.confidenceEvidence,s=n.controller.seatDetails(e.id),r=document.createElement("div");r.className="sl-view3d-passport-shell",r.innerHTML=ql({seat:e,title:s?.displayLabel??e.displayLabel??e.label,restrictionFallback:n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof n.api.reportViewEvidence=="function"});let a=[...new Set([...i.children,...[...n.els.map.children].filter(m=>m!==i)])].filter(m=>m instanceof HTMLElement),l=a.map(m=>({element:m,inert:m.inert,ariaHidden:m.getAttribute("aria-hidden")}));for(let m of a)m.inert=!0,m.setAttribute("aria-hidden","true");i.appendChild(r),i.classList.add("has-passport"),n.view3dPassportEl=r;let c=r.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],h=m=>{if(m.key==="Escape"){m.preventDefault(),m.stopPropagation(),m.stopImmediatePropagation(),In(n);return}if(m.key!=="Tab")return;let u=d();if(!u.length)return;let g=u[0],b=u[u.length-1];m.shiftKey&&document.activeElement===g?(m.preventDefault(),b.focus()):!m.shiftKey&&document.activeElement===b&&(m.preventDefault(),g.focus())};window.addEventListener("keydown",h,!0),n.view3dPassportCleanup=()=>{window.removeEventListener("keydown",h,!0);for(let b of l)b.element.inert=b.inert,b.ariaHidden===null?b.element.removeAttribute("aria-hidden"):b.element.setAttribute("aria-hidden",b.ariaHidden);let m=t?.isConnected?t:n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareEl?.querySelector("[data-passport-seat]")??null,u=m?.closest(".sl-confirm,.sl-view3d-compare");u?.isConnected&&(u.inert=!1,u.removeAttribute("aria-hidden")),r.remove(),i.classList.remove("has-passport"),n.view3dPassportEl===r&&(n.view3dPassportEl=null);let g=m??n.view3dCompareEl?.querySelector("[data-passport-seat]")??n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareChip.mainButton();(t?.isConnected?t:g)?.focus()},r.addEventListener("click",m=>{let u=Wl(m.target instanceof HTMLElement?m.target:null);u==="close"&&In(n),u==="report"&&lm(n,e)}),requestAnimationFrame(()=>d()[0]?.focus()),n.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:o?.evidenceId??null,eventConfigurationId:o?.eventConfigurationId??null,modelLevel:o?.modelLevel??"unverified",realityLevel:o?.realityLevel??"none"})}async function lm(n,e){if(n.api.reportViewEvidence){eo(n.view3dPassportEl,"sending");try{let t=await n.api.reportViewEvidence(n.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});n.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),eo(n.view3dPassportEl,"received",t.report.id)}catch{eo(n.view3dPassportEl,"failed")}}}function In(n,e=!0){let t=n.view3dPassportCleanup;if(n.view3dPassportCleanup=null,!t){n.view3dPassportEl?.remove(),n.view3dPassportEl=null,n.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function Yl(n){let e=n.view3dEl;if(!e||n.view3dCompareSeatIds.length<2)return;vt(n,!1);let t=n.view3dCompareSeatIds.map(u=>n.view3dComparisonSnapshot(u)).filter(u=>!!u);if(t.length<2){n.clearView3dComparison();return}let i=u=>C(u),o=t.some(u=>!!u.price),s=document.createElement("div");s.className="sl-view3d-compare-shell";let r=t.map((u,g)=>`<article><span>Seat ${g===0?"A":"B"}</span><strong>${i(u.label)}</strong><small>Section ${i(u.section)} \xB7 Row ${i(u.row)}</small><dl>`+(o?`<div><dt>Current price</dt><dd>${i(u.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${i(u.category)}</dd></div><div><dt>Availability</dt><dd>${i(u.availability)}</dd></div><div><dt>View source</dt><dd>${i(u.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${i(u.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${i(u.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${i(u.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${i(u.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${i(u.seat.id)}">Passport</button><button type="button" data-view-seat="${i(u.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${i(u.seat.id)}"${u.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");s.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${o?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${r}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(u=>u instanceof HTMLElement),c=l.map(u=>({element:u,inert:u.inert,ariaHidden:u.getAttribute("aria-hidden")}));for(let u of l)u.inert=!0,u.setAttribute("aria-hidden","true");e.appendChild(s),e.classList.add("has-comparison"),n.view3dCompareEl=s;let d=s.querySelector(".sl-view3d-compare"),h=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],m=u=>{if(u.key==="Escape"){u.preventDefault(),vt(n);return}if(u.key!=="Tab")return;let g=h();if(!g.length)return;let b=g[0],T=g[g.length-1];u.shiftKey&&document.activeElement===b?(u.preventDefault(),T.focus()):!u.shiftKey&&document.activeElement===T&&(u.preventDefault(),b.focus())};window.addEventListener("keydown",m),n.view3dCompareCleanup=()=>{window.removeEventListener("keydown",m);for(let u of c)u.element.inert=u.inert,u.ariaHidden===null?u.element.removeAttribute("aria-hidden"):u.element.setAttribute("aria-hidden",u.ariaHidden);s.remove(),e.classList.remove("has-comparison"),n.view3dCompareEl===s&&(n.view3dCompareEl=null),a?.isConnected?a.focus():n.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>vt(n)),s.querySelectorAll("[data-passport-seat]").forEach(u=>u.addEventListener("click",()=>{let g=u.dataset.passportSeat,b=g?n.allSeats().find(T=>T.id===g):void 0;b&&rs(n,b,u)})),s.querySelectorAll("[data-view-seat]").forEach(u=>u.addEventListener("click",()=>{let g=u.dataset.viewSeat;vt(n,!1),g&&n.view3dHandle?.flyToSeat(g)})),s.querySelectorAll("[data-select-seat]").forEach(u=>u.addEventListener("click",()=>{let g=u.dataset.selectSeat;g&&cm(n,g)})),requestAnimationFrame(()=>h()[0]?.focus()),n.emit3dAnalytics("3d_comparison_opened",{seatIds:n.view3dCompareSeatIds.slice()})}function vt(n,e=!0){let t=n.view3dCompareCleanup;if(n.view3dCompareCleanup=null,!t){n.view3dCompareEl?.remove(),n.view3dCompareEl=null,n.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function cm(n,e){if(n.salesClosed){n.toast(n.closedWords?.().toast??n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=n.allSeats().find(o=>o.id===e);if(!t)return;if(vt(n,!1),!n.controller.select([e]).length){n.syncSelectionTo3d(),n.toast(n.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}n.syncSelectionTo3d(),n.showConfirm(t),n.emit3dAnalytics("3d_comparison_selected",{seatId:e})}import{t as gm}from"@seatlayer/core";import{seatViewDisclosure as bm}from"@seatlayer/core/view3d/crossfade/panorama";import{t as Zl}from"@seatlayer/core";var dm=900,pm=450;function hm(n){switch(n){case"seat":return y("picker.stopYourSeat","Your seat");case"row":return y("picker.stopYourRow","Your row");case"section":return y("picker.stopYourSection","Your section");default:return y("picker.stopWholeVenue","Whole venue")}}function Xl(n,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let i=y("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",i),t.title=i,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let o=document.createElement("div");o.className="sl-view3d-stop",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),n.append(t,o);let s=null,r=null;return{onStopChange(a){if(s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null),!a){o.classList.remove("is-shown"),o.textContent="",r=setTimeout(()=>{r=null,n.classList.remove("is-seat-view")},pm);return}n.classList.add("is-seat-view"),o.textContent=hm(a),o.classList.add("is-shown"),s=setTimeout(()=>{s=null,o.classList.remove("is-shown")},dm)},dispose(){s&&(clearTimeout(s),s=null),r&&(clearTimeout(r),r=null),t.remove(),o.remove(),n.classList.remove("is-seat-view")}}}var um=44,mm=92;function Ql(n,e,t,i={}){let o=n?.sectionLabel,s=Q(n),r=fm(n,e),a=[o,s?Zl("picker.rowLabel",{label:s}):null,r?Zl("picker.seatLabel",{label:r}):null].filter(Boolean).join(" \xB7 "),l=i.maxChars??(i.narrow?um:mm);for(let c of[t,i.shortTail??t,null]){let d=[a,c].filter(Boolean).join(" \xB7 ");if(d.length<=l||c==null)return d}return a}function fm(n,e){if(n?.seatNumber)return n.seatNumber;let t=n?.displayLabel??e,i=o=>{!o||!t.startsWith(o)||t.length<=o.length||(t=t.slice(o.length).replace(/^[\s·\-\/_]+/,""))};return i(n?.sectionLabel),i(Q(n)),t}import{seatConfidenceDisclosure as ym}from"@seatlayer/core/core/seatConfidence";var vm=220;function wm(n,e,t){let i=null,o=null,s=null;return(r,a)=>{n()?.presentSeatHover?.(r,a,e),s=a,r!==o&&(o=r,i&&(clearTimeout(i),i=null),!(!r||!t)&&(i=setTimeout(()=>{if(i=null,o!==r)return;let c=t()?.(r)??null;c&&o===r&&n()?.presentSeatHover?.(r,s,e,c)},vm)))}}function Jl(n){return n.buyerView}function ec(n,e,t){if(e==="map"){n.exit3d();return}let i=t?.flyToSeatId;if(n.buyerView==="venue3d"){i?(n.opts.onBuyerViewChange?.({view:"venue3d",seatId:i}),n.view3dHandle?.flyToSeat(i)):t?.resetView&&n.view3dHandle?.focusOverview();return}n.enter3d(i)}function tc(n,e){switch(n.controller.getStatus(e.id)){case"held":if(!ic(n,e))return"held";break;case"booked":case"not_for_sale":return"sold";default:break}return n.priceBandKeys!=null&&!n.priceBandKeys.has(e.categoryKey)||n.controller.accessibilityFilterDims?.(e)||n.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function nc(n){if(!n.view3dHandle)return;let e=n.allSeats().map(t=>({seatId:t.id,state:n.seatState3dFor(t)}));n.view3dHandle.setAvailability(e),n.syncSelectionTo3d()}function ic(n,e){return n.controller.currentHold()?.labels.includes(e.label)===!0}function xm(n){return(n.controller.currentHold()?.labels??[]).map(e=>n.controller.seatByLabel(e)?.id).filter(e=>!!e)}function oc(n){if(!n.view3dHandle)return;let e=new Set(n.controller.getSelection().map(t=>t.id));for(let t of xm(n))e.add(t);n.view3dHandle.setSelection([...e])}function sc(n,e){let t=n.view3dHandle;if(!t)return;n.pushAvailabilityTo3d(),n.syncSelectionTo3d();let i=e[0];!i||e.every(s=>s.rowId===i.rowId)&&t.focusRow(i.rowId)||i.sectionId&&t.focusSection(i.sectionId)}async function rc(n,e){let t=n.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,o=!!i&&i!==t.viewUrl,s=o?await n.buyerAssetUrls.resolve(i):null,r=o?t.viewUrl:await n.buyerAssetUrls.resolve(t.viewUrl);return!r||o&&!s?null:{url:r,...s?{previewUrl:s}:{},...o?{resolveUrl:a=>n.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(i){return n.opts.onError?.(i),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:n.tf("picker.chartDerivedModel","Chart-derived model")}}function ac(n,e){if(n.salesClosed){n.toast(n.closedWords?.().toast??n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),n.syncSelectionTo3d();return}let t=n.allSeats().find(a=>a.id===e);if(!t)return;let i=n.controller.tableSelection(e);if(n.committedSelection().some(a=>i?a.label===i.label:a.id===e)){n.controller.deselect([e]),n.dismissConfirm(),n.syncSelectionTo3d();return}let s=n.controller.getStatus(t.id);if(s==="held"||s==="booked"||s==="not_for_sale"){n.syncSelectionTo3d();return}if(!n.controller.select([e]).length){n.syncSelectionTo3d(),n.dismissConfirm();return}if(n.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),n.flashPickedSeat(e),i){n.showTableDialog(i,!1),n.syncSelectionTo3d();return}n.opts.confirmSelection!==!1?n.showConfirm(t):n.syncTray(),n.syncSelectionTo3d()}function lc(n,e){let t=n.allSeats().find(i=>i.id===e);return Ql(n.controller.seatDetails(e),t?.displayLabel??t?.label??e,n.tf("picker.viewFromYourSeat","view from your seat"),{narrow:n.root?.dataset.layout==="narrow",shortTail:n.tf("picker.fromYourSeat","from your seat")})}function cc(n,e){if(n.buyerView!=="venue3d")return;let t=n.view3dCompareSeatIds;t.includes(e.id)||(n.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),n.confirmSeat?.id===e.id&&(n.controller.deselect([e.id]),n.dismissConfirm(),n.syncSelectionTo3d(),n.syncTray()),n.view3dCompareChip.sync(),n.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:n.view3dCompareSeatIds.length}),n.view3dCompareSeatIds.length>1?n.openView3dComparison():n.toast(n.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function dc(n){n.closeView3dComparison(!1),n.view3dCompareSeatIds=[],n.view3dCompareChip.remove(),n.emit3dAnalytics("3d_comparison_cleared")}function pc(n,e){let t=n.allSeats().find(g=>g.id===e);if(!t)return null;let i=n.controller.seatDetails(t.id),o=n.controller.doc?.categories.find(g=>g.key===t.categoryKey),s=i?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),r=s!=null?n.paidPrice(t.categoryKey,i?.tierId??o?.tiers?.[0]?.id??null,s,t.label):void 0,a=n.controller.getStatus(t.id),l=a==="free"||!a?n.tf("picker.available","Available"):ic(n,t)?n.tf("picker.heldForYou","Held for you"):n.tf("picker.group.legendUnavailable","Unavailable"),c=t.viewUrl?bm({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):n.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=pi(t.commercial).join(" \xB7 ")||n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),h=fr({...t.accessibility?.length?{accessibility:t.accessibility}:{},...i?.wheelchairSpaceType?{wheelchairSpaceType:i.wheelchairSpaceType}:{}}),m=h.length?`${h.join(" \xB7 ")} \xB7 metadata, not access certification`:n.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),u=ym(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:Q(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??o?.label??t.categoryKey,price:n.suppressPricing||r==null?"":n.money(r),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:m,confidence:u}}async function hc(n,e){if(n.view3dEl||!n.canOffer3d()||!n.els.map)return;let t=n.controller.doc;if(!t)return;n.buyerView="venue3d",n.view3dTargetSeatId=null,n.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),n.root?.setAttribute("data-view3d","on"),n.dismissConfirm(),n.syncProjection(),n.syncTray();let i=document.createElement("div");i.className="sl-view3d sl-mo-zoom",i.setAttribute("role","group"),i.setAttribute("aria-label",n.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let o=document.createElement("button");o.type="button",o.className="sl-view3d-back",o.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${n.tf("picker.backToMap","Back to map")}</span>`;let s=o.querySelector("span"),r=c=>{n.view3dTargetSeatId=c;let d=!!c;i.classList.toggle("is-seat-focused",d),n.root&&(n.root.dataset.view3dSeat=d?"on":"off");let h=d?n.tf("picker.backToVenue","Back to venue"):n.tf("picker.backToMap","Back to map");s&&(s.textContent=h),o.setAttribute("aria-label",h)};if(o.addEventListener("click",()=>{if(n.view3dTargetSeatId&&n.view3dHandle){n.view3dHandle.focusOverview();return}n.exit3d()}),n.regions["top-left"]?.prepend(o),n.view3dBack=o,n.publish3dTopInset(),_l(n.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let d=n.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",d),c.title=d,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||n.fsFallback||n.framedFs)),c.addEventListener("click",()=>n.toggleFullscreen()),i.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=n.tf("picker.loading3d","Building the 3D venue\u2026"),i.appendChild(a),n.els.map.appendChild(i),n.view3dEl=i,n.view3dCompareChip.sync(),requestAnimationFrame(()=>{i.style.opacity="1"});let l=++n.view3dGen;try{let c=n.allSeats(),[d,h]=await Promise.all([kn(),n.controller.loadEventConfiguration()]),m=h?await Mi(h,x=>n.buyerAssetUrls.resolve(x)):null,u=t.theme?.venue3d?.shellAssetUrl,g=await Hi(u,x=>n.buyerAssetUrls.resolve(x));if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let b={doc:t,seats:c,...m?{eventConfigurationId:m.id,eventConfiguration:m}:{},...g?{registeredShellGlb:g}:{}};a.textContent=gm("picker.building3d");let T=await d.prepareVenue3D(b);if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let S=d.mountVenue3D(i,{...b,prepared:T},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:ht(),navLabels:ii(),seatViewActionLabel:x=>n.allSeats().find(P=>P.id===x)?.viewUrl?n.tf("picker.openAuthored360","Open venue 360\xB0"):n.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:x=>n.seatViewCaption(x),onSeatViewStopChange:x=>n.view3dSeatViewChrome?.onStopChange(x),onSeatPick:x=>n.onView3dSeatPick(x),onSeatInspect:x=>n.onView3dSeatPick(x),onSeatHover:wm(()=>n.controller.getRenderer(),i,()=>{let x=S.captureSeatView;return x?P=>x.call(S,P):void 0}),onSectionFocusChange:x=>{let P=i.querySelector('select[data-locator="section"]'),_=x??"";!P||P.value===_||(P.value=_,P.dispatchEvent(new Event("change")))},onViewTargetChange:x=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!x),r(x),n.opts.onBuyerViewChange?.({view:"venue3d",...x?{seatId:x}:{}})},...n.seatViewEnabled()?{getSeatView:x=>new Promise((P,_)=>{let U=()=>{n.seatViewFor3d(x).then(f=>{f?P(f):_(new Error("seat_view_unavailable"))})},R=globalThis.requestIdleCallback;typeof R=="function"?R(U,{timeout:1500}):setTimeout(U,50)})}:{},onAnalytics:(x,P)=>n.emit3dAnalytics(x,P)});n.view3dHandle=S,n.view3dSeatViewChrome=Xl(i,{handle:()=>n.view3dHandle}),requestAnimationFrame(()=>a.remove()),n.pushAvailabilityTo3d(),n.syncSelectionTo3d(),n.view3dNav=Ol(n.regions["bottom-left"]??i,S),e&&S.flyToSeat(e)}catch(c){if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;n.opts.onError?.(c),n.toast(n.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),n.exit3d()}}function uc(n){let e=n.regions["top-left"];if(!n.root||!e)return;let t=()=>{!n.root||n.root.dataset.view3d!=="on"||n.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function mc(n){if(n.buyerView!=="venue3d"&&!n.view3dEl)return;n.view3dGen++,n.buyerView="map",n.view3dTargetSeatId=null,n.opts.onBuyerViewChange?.({view:"map"}),n.root?.removeAttribute("data-view3d"),n.closeSeatConfidencePassport(!1),n.closeView3dComparison(!1),n.view3dCompareChip.remove(),n.view3dSeatViewChrome?.dispose(),n.view3dSeatViewChrome=null,n.view3dBack?.remove(),n.view3dBack=null,n.view3dNav?.remove(),n.view3dNav=null,n.root?.removeAttribute("data-view3d-seat"),n.root?.style.removeProperty("--sl-3d-top-inset");try{n.view3dHandle?.dispose()}catch{}n.view3dHandle=null;let e=n.view3dEl;n.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),n.syncProjection(),n.syncTray();let t=n.view3dReturnSeat;n.view3dReturnSeat=null,t&&n.committedSelection().some(i=>i.id===t.id)&&n.opts.confirmSelection!==!1&&n.showConfirm(t)}import{t as Sm}from"@seatlayer/core";var fc=Symbol("seatlayer.performance-group-picker");function to(n,e){return Object.defineProperty(n,fc,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),n}function no(n){return!n||n.surface==="season"}function gc(n){return n[fc]??null}import{t as io}from"@seatlayer/core";function bc(n){return Array.isArray(n)?n.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function oo(n,e,t=!1){let i=n.violations[0];return i==="numberOfPlacesToSelect"?n.remaining>0?io("picker.selectExactMore",{count:n.remaining}):io("picker.selectExactCount",{count:n.required}):i==="minimumSelectedPlaces"?io("picker.selectMinimumMore",{count:n.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):i==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):io("picker.orphanHint")}var as=6e4,yc=5*6e4,Tm=String(Math.round(yc/6e4));function vc(n){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(n.regions["bottom-center"]??n.els.map).appendChild(e),n.extendEl=e,n.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),n.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),n.els.extendBtn.textContent=wc(n),n.els.extendDismiss.setAttribute("aria-label",n.tf("picker.close","Close")),n.els.extendBtn.addEventListener("click",()=>{n.handleExtend()}),n.els.extendDismiss.addEventListener("click",()=>{n.extendDismissed=!0,n.setExtendPrompt(!1,0)})}function wc(n){return n.tf("picker.addMinutes","+{count} min").replace("{count}",Tm)}function xc(n){let e=n.hold?.items??[],t=new Set(e.map(o=>o.label));return n.committedSelection().filter(o=>!t.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0)+Xe(n.gaQty,n.hold?.items??[])}function kc(n){return(n.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function Sc(n){let e=new Set((n.hold?.items??[]).map(i=>i.label)),t=n.committedSelection().filter(i=>!e.has(i.label)).reduce((i,o)=>i+(o.quantity??1),0);return n.heldTicketCount()+t+Xe(n.gaQty,n.hold?.items??[])}function Tc(n){let e=new Set((n.hold?.items??[]).map(o=>o.label)),t=n.committedSelection().filter(o=>e.has(o.label)).reduce((o,s)=>o+(s.quantity??1),0),i=Math.max(0,n.maxTickets-n.heldTicketCount()-Xe(n.gaQty,n.hold?.items??[]));n.controller.setMaxSelection(t+i)}function Ec(n,e=n.lastTrayCount,t=n.pendingSelectionCount()){let i=n.els.cta;if(!i)return;if(delete i.dataset.act,n.salesClosed&&!n.finishingHold?.()){i.disabled=!0,i.textContent=n.closedWords?.().cta??n.tf("picker.salesClosedCta","Sales closed");return}if(n.ctaPhase==="holding"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${n.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(n.ctaPhase==="checkout"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${n.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let o=!n.hold&&n.performanceGroup?.selectionMode==="per_performance"?n.performanceGroup.submissionState?.():null;if(o&&!o.ready){i.disabled=!0,i.textContent=n.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(o.complete)).replace("{total}",String(o.total));return}let s=n.controller.getSelectionValidity(e);if(s&&!s.isValid){i.disabled=!0,i.textContent=oo(s,(r,a)=>n.tf(r,a),!0);return}if(!e&&n.root?.dataset.layout==="narrow"&&no(n.performanceGroup)&&!n.hold&&!n.bestAvailableSoldOut){i.disabled=!1,i.dataset.act="find",i.textContent=n.tf("picker.findBestSeats","Find best seats");return}i.disabled=e===0,i.textContent=n.hold?t?Sm("picker.secureMoreAndCheckout",{count:t}):n.tf("picker.continueToCheckout","Continue to checkout"):e?n.performanceGroup?n.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(n.performanceGroup.performanceCount)):n.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):n.tf("picker.selectSeats","Select seats")}function Cc(n,e){n.ctaPhase=e,n.syncCta()}async function Ac(n,e,t){n.setCtaPhase("checkout");try{await n.checkoutHandoff(e,t)}finally{n.ctaPhase==="checkout"&&!n.bookedShown&&n.setCtaPhase("idle")}}function Pc(n){return`@seatlayer/hold/v1/${encodeURIComponent(n.apiBase)}/${encodeURIComponent(n.opts.event)}`}function Lc(n){if(n.opts.initialHoldId)return n.opts.initialHoldId;if(n.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(n.holdStorageKey())}catch{return null}}function Mc(n,e){if(!(n.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(n.holdStorageKey(),e.holdId)}catch{}}function Hc(n){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(n.holdStorageKey())}catch{}}async function Rc(n,e,t=!1){try{let i=await n.controller.resumeHold(e);if(!i||n.destroyed)return null;let o={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return n.hold=o,n.handedOff=!0,n.bookedShown=!1,n.ctaPhase="idle",n.startHoldTimer(o.expiresAt),n.rememberHold(o),n.syncTray(),n.emitHoldChange(),n.opts.onHoldRestored?.(o,o.seats??[],n.buildHandoff(o)),o}catch(i){let o=i?.status;if(o===404||o===409)n.forgetHold();else if(o===401&&i?.code==="buyer_access_invalid")n.forgetHold(),n.toast(n.tf("picker.savedSeatsNotRestored","Your earlier seats could not be restored. Please choose again."),"warning");else if(n.opts.onError?.(i),t)throw i;return null}}async function Ic(n){let e=n.rememberedHoldId();e&&await n.resumeHoldFromServer(e,!0)}function Oc(n,e){n.stopHoldTimer(),n.holdExpiresAt=e,n.extendDismissed=!1,n.extendUsed=!1,n.hold&&n.rememberHold(n.hold);let t=n.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${n.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let i=t.querySelector('[data-ref="holdTime"]'),o=()=>{let s=Math.max(0,n.holdExpiresAt-Date.now());i&&(i.textContent=Pr(s)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=as),n.setExtendPrompt(s>0&&s<=as,s),(s<=0||!n.controller.currentHold())&&n.stopHoldTimer()};n.holdTimer=setInterval(o,500),o()}function _c(n){n.holdTimer&&clearInterval(n.holdTimer),n.holdTimer=null,n.els.hold?.classList.remove("on","is-expiring"),n.setExtendPrompt(!1,0)}function Nc(n,e,t){if(!n.extendEl)return;let i=e&&t>0&&n.root?.dataset.layout!=="narrow"&&!!n.api.extend&&!n.extendDismissed&&!n.extendUsed&&!!n.controller.currentHold()&&!n.bookedShown;n.extendEl.classList.toggle("on",i)}function Dc(n){if(!n.holdTimer)return;let e=Math.max(0,n.holdExpiresAt-Date.now());n.setExtendPrompt(e>0&&e<=as,e)}async function Bc(n){let e=n.els.extendBtn,t=n.controller.currentHold();if(!(!t||!n.api.extend||n.extendUsed)){e.disabled=!0,e.textContent=n.tf("picker.addingEllipsis","Adding\u2026");try{let i=await n.api.extend(n.controller.key,t.holdId,yc);if(n.controller.currentHold()?.holdId!==t.holdId)return;n.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:i.expiresAt,items:t.items});let o=n.controller.currentHold();if(!o)return;n.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},n.holdExpiresAt=o.expiresAt,n.extendUsed=!0,n.extendEl?.classList.remove("on"),n.rememberHold(n.hold),n.emitHoldChange(),n.toast(n.tf("picker.moreTimeAdded","More time added. Your seats are still held."),"success")}catch(i){if(i?.reason==="extend_limit"){n.extendUsed=!0,n.setExtendPrompt(!1,0);return}n.opts.onError?.(i),n.toast(n.tf("picker.couldNotAddMoreTime","Couldn't add more time. Please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=wc(n)}}}function Cm(n){let e=n;return e?.status===404?"ended":e?.status!==409||e.code!=="hold_not_active"?"unknown":e.reason==="booked"?"booked":"ended"}async function Fc(n,e){try{return await n(e),!1}catch(t){return Cm(t)==="booked"}}import{t as On}from"@seatlayer/core";function Vc(n){return n?.previousPrice!=null&&n.previousPrice>n.price?n.previousPrice:null}function $c(n){return Am(n)+(n.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!n.collapsed}">${n.esc(n.moreLabel)}</button>`:"")+Pm(n.status)}function Am(n){let{esc:e,money:t}=n;return n.categories.map(i=>{let o=n.priceOf(i),s=n.rangeOf(i),r=n.offerOf(i.key),a=Vc(r),l=n.activeKey===i.key;return`<div class="sl-price-row${n.bandKeys!=null&&!n.bandKeys.has(i.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(i.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(n.titleFor(i,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(n.colorOf(i))}"></span><span class="sl-price-label"><span class="sl-price-name">${e(i.label)}</span>`+(r?.offerName?ci(r.offerName,e):"")+"</span>"+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(s!=null?`<span class="sl-price-amt">${s.min===s.max?e(t(s.min)):`${e(t(s.min))}\u2013${e(t(s.max))}`}</span>`:o!=null?`<span class="sl-price-amt">${e(t(o))}</span>`:"")+"</div>"}).join("")}function Pm(n){let e=t=>t.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i]);return`<div class="sl-status-key" aria-label="${e(n.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(n.unavailable)}</span>`+(n.partial?`<span class="sl-status-item"><i class="sl-status-icon partial" aria-hidden="true"></i>${e(n.partial)}</span>`:"")+"</div>"}function ls(n){let e=Math.abs(n.scrollLeft),t=e>2,i=e+n.clientWidth<n.scrollWidth-2;return n.dataset.fadeStart=String(t),n.dataset.fadeEnd=String(i),{start:t,end:i}}function zc(n){let{esc:e,money:t}=n;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${n.allActive}" title="${e(n.allWord)}"><span class="sl-rc-t">${e(n.allWord)}</span></button>`+n.categories.map(o=>{let s=n.rangeOf(o),r=n.priceOf(o),a=s?s.min===s.max?t(s.min):`${t(s.min)}+`:r!=null?t(r):null,l=Object.prototype.hasOwnProperty.call(n.left,o.key)&&n.left[o.key]<=0,c=Vc(n.offerOf(o.key)),d=a?`${o.label}: ${a}${l?` (${n.soldOutWord})`:""}`:o.label;return`<button type="button" class="sl-rc" data-cat="${e(o.key)}" aria-pressed="${n.activeKey===o.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(n.colorOf(o))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??o.label)}</span></button>`}).join("")}function jc(n,e){let t=n.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let i=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(i.length<=5)return i.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let o=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),s=Math.ceil(o.length/4),r=[];for(let a=0;a<o.length;a+=s){let l=o.slice(a,a+s),c=Math.min(...l.map(h=>h.range.min)),d=Math.max(...l.map(h=>h.range.max));r.push({id:`b${a}`,label:c===d?e.money(c):`${e.money(c)}\u2013${e.money(d)}`,keys:l.map(h=>h.key),min:c,max:d})}return r}function Kc(n){if(n.els.pricesSec?.querySelectorAll(".sl-price-select").forEach(o=>o.remove()),n.priceSelect=null,n.suppressPricing||!n.els.prices||!n.els.pricesSec)return;let e=jc((n.controller.doc?.categories??[]).filter(o=>!o.notForSale),n.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",n.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let i=document.createElement("option");i.value="all",i.textContent=n.tf("picker.allPrices","All prices"),t.appendChild(i);for(let o of e){let s=document.createElement("option");s.value=o.id,s.textContent=o.label,t.appendChild(s)}n.els.pricesSec.appendChild(t),n.priceSelect=t,t.addEventListener("change",()=>{n.applyPriceBand(e.find(o=>o.id===t.value)?.keys??null)})}function Gc(n,e){if(n.focusedCatKey=null,n.priceBandKeys=e?new Set(e):null,n.priceSelect){let t=e?n.priceSelect.value:"all";n.priceSelect.value!==t&&(n.priceSelect.value=t)}n.controller.setCategoryFilter(e),n.controller.focusCategoryFilter(e),n.pushAvailabilityTo3d(),n.syncFloors(),n.syncRung(),n.minimap?.refreshMinimap(),n.syncPrices(),n.lastSection&&n.showSectionCard(n.lastSection)}function Uc(n){return{colorOf:e=>n.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>n.catPriceRange(e),priceOf:e=>n.catPrice(e),offerOf:e=>n.offerPrice(e),money:e=>e?n.money(e):n.tf("checkout.free","Free"),esc:B}}function qc(n,e,t,i=n.legendDeps()){let o=n.els.railScroll,s=e.length>1;if(n.els.rail?.classList.toggle("has",s),!o)return;o.innerHTML=s?zc({...i,categories:e,left:t,activeKey:n.focusedCatKey,soldOutWord:On("picker.soldOut"),allWord:n.tf("picker.allPrices","All prices"),allActive:!n.focusedCatKey&&!n.priceBandKeys}):"";let r=e.map(a=>a.key).join("|");n.lastRailSignature!==r&&(n.lastRailSignature=r,o.scrollLeft=0),o.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){n.applyPriceBand(null);return}n.focusCategory(a.dataset.cat??"")})}),n.railEdgesBound||(n.railEdgesBound=!0,o.addEventListener("scroll",()=>ls(o),{passive:!0})),requestAnimationFrame(()=>ls(o))}function Wc(n){let e=n.controller.doc;if(!e||!n.els.prices)return;let t=n.controller.categoryAvailability(),i=e.categories.filter(h=>!h.notForSale);n.syncSoldout(i,t);let o=n.legendDeps(),s=n.suppressPricing,r=s?{...o,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:o;s&&(n.els.pricesSec?.querySelector("span")?.replaceChildren(On("picker.seatCategories")),n.els.pricesInfo?.remove()),n.syncPriceRail(i,t,r);let a=5,l=i.length-a,c=l>1&&!n.pricesExpanded,d=c?i.slice(0,a):i;n.els.prices.classList.toggle("sl-expanded",l>1&&n.pricesExpanded),n.els.prices.innerHTML=$c({...r,categories:d,left:t,collapsed:c,activeKey:n.focusedCatKey,bandKeys:n.priceBandKeys,titleFor:(h,m)=>m?n.tf("picker.showAllSeats","Show all seats"):On("picker.showLabelSeatsOnMap",{label:h.label}),moreLabel:l>1?c?s?On("picker.showAllCategories"):On("picker.showAllTicketTypes",{count:i.length}):n.tf("picker.showFewer","Show fewer"):null,status:{legend:n.tf("picker.seatStatusLegend","Seat status legend"),unavailable:n.tf("picker.group.legendUnavailable","Unavailable"),partial:n.partialLegend()}}),n.els.prices.querySelectorAll(".sl-price-row").forEach(h=>{h.addEventListener("mouseenter",()=>n.controller.getRenderer()?.setCategoryHighlight?.(h.dataset.cat??null)),h.addEventListener("mouseleave",()=>n.controller.getRenderer()?.setCategoryHighlight?.(null));let m=()=>n.focusCategory(h.dataset.cat??"");h.addEventListener("click",m),h.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),m())})}),n.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{n.pricesExpanded=!n.pricesExpanded,n.syncPrices()})}function Yc(n,e){if(!e)return;let t=n.focusedCatKey===e?null:e;n.focusedCatKey=t,n.priceBandKeys=t?new Set([t]):null;let i=n.els.pricesSec?.querySelector(".sl-price-select");i&&(i.value="all"),n.controller.setCategoryFilter(t?[t]:null),n.controller.focusCategoryFilter(t?[t]:null),n.pushAvailabilityTo3d(),n.syncFloors(),n.syncRung(),n.minimap?.refreshMinimap(),n.syncPrices(),n.lastSection&&n.showSectionCard(n.lastSection)}import{t as Zc,tCount as Xc}from"@seatlayer/core";function ve(n,e,t){let i=Zc(n,t);return i&&i!==n?i:t?e.replace(/\{(\w+)\}/g,(o,s)=>s in t?String(t[s]):o):e}function Mm(n){let e=Xc("picker.seatCount",n);return e.includes("picker.seatCount")?`${n} ${n===1?"seat":"seats"}`:e}function Hm(n){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(n)}catch{}return n.join(", ")}function Rm(n){if(n.length<2)return!1;let e=[...n].sort((t,i)=>t-i);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function Im(n){let e=n.filter(o=>o.objectType==="ga"),t=n.filter(o=>o.objectType!=="ga"),i=[];if(t.length){let o=Mm(t.length),s=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],r=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(s.length===1&&r.length===1&&a.length===t.length){let l=t.length===1?ve("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:s[0],row:r[0],seat:String(t[0].seatNumber??"")}):Rm(a)?ve("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:s[0],row:r[0],from:Math.min(...a),to:Math.max(...a)}):"";i.push(l?ve("picker.releasedPair","{first} \xB7 {second}",{first:o,second:l}):ve("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]}))}else s.length===1?i.push(ve("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:s[0]})):s.length>1?i.push(ve("picker.releasedInSections","{seats} in Sections {sections}",{seats:o,sections:Hm(s)})):i.push(o)}for(let o of e)i.push(ve("picker.releasedGa","{quantity} \xD7 {area}",{quantity:o.quantity??1,area:o.label}));return i.length?i.reduce((o,s)=>ve("picker.releasedPair","{first} \xB7 {second}",{first:o,second:s})):""}function Qc(n){if(!n)return[];let e=new Map((n.seats??[]).map(o=>[o.label,o])),t=n.items??[];return(t.length?t.map(o=>({label:o.label,objectType:o.objectType,quantity:o.quantity})):[...e.keys()].map(o=>({label:o}))).map(o=>{let s=e.get(o.label);return{label:o.label,...o.objectType?{objectType:o.objectType}:{},...o.quantity==null?{}:{quantity:o.quantity},...s?.sectionLabel?{sectionLabel:s.sectionLabel}:{},...s?.rowLabel?{rowLabel:Q(s)??s.rowLabel}:{},...s?.seatNumber?{seatNumber:s.seatNumber}:{}}})}function Jc(n,e){if(!n.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let i=n.seatByLabel(t.label);!i||n.statusOf(i.id)!=="free"||n.flash(i.id,n.accent)}}function ed(n,e){if(!e.recoverable.length||!n.isConnected)return;let t=n.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(r=>Zc("picker.seatJustTakenByAnother",{label:r})).join(" "):t.remove());let i=n.querySelector(".sl-interrupt-actions"),o=i?.querySelector(".sl-interrupt-act");if(!i||!o)return;o.classList.add("sl-interrupt-act-secondary");let s=document.createElement("button");s.type="button",s.className="sl-interrupt-act sl-hold-expired-recover",s.textContent=Xc("picker.holdLapsedSelectAgain",e.recoverable.length),s.addEventListener("click",()=>e.onRecover([...e.recoverable])),i.insertBefore(s,o),n.classList.add("has-recovery"),s.focus()}function td(n,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let i=document.createElement("div");i.className="sl-interrupt-card sl-mo-in";let o=document.createElement("div");o.className="sl-interrupt-title",o.id="sl-hold-expired-title";let s=document.createElement("span");s.className="sl-interrupt-glyph",s.setAttribute("aria-hidden","true"),s.textContent="\u23F1";let r=document.createElement("span");r.textContent=ve("picker.holdExpiredTitle","Your seats were released"),o.append(s,r);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=ve("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),i.append(o,a);let l=Im(e);if(l){let m=document.createElement("div");m.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",m.textContent=l,i.appendChild(m)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=ve("picker.holdExpiredPickAgain","Pick your seats again to continue. They may already be taken."),i.appendChild(c),t.setAttribute("aria-labelledby",o.id),t.setAttribute("aria-describedby",a.id);let d=document.createElement("div");d.className="sl-interrupt-actions";let h=document.createElement("button");return h.type="button",h.className="sl-interrupt-act sl-hold-expired-restart",h.textContent=ve("picker.holdExpiredRestart","Choose seats again"),h.addEventListener("click",()=>n.restart()),d.appendChild(h),i.appendChild(d),t.appendChild(i),t.addEventListener("pointerdown",m=>{m.target===t&&n.restart()}),t}import{ACCESSIBILITY_TYPES as cs,seatTypeIconSvg as nd,t as Om}from"@seatlayer/core";var id={wheelchair:"Wheelchair space",companion:"Companion seat","semi-ambulatory":"Limited mobility","designated-aisle":"Aisle / transfer","step-free":"Step-free",hearing:"Assistive listening",cart:"Live captions","sign-language":"Sign language","low-vision":"Low vision","sensory-friendly":"Sensory-friendly","plus-size":"Plus-size","lift-armrest":"Lift-up armrest"},_m='<svg viewBox="0 0 20 20" width="17" height="17" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="10" cy="10" r="7.5" /><path d="M10 2.5a7.5 7.5 0 0 1 0 15Z" fill="currentColor" stroke="none" /></svg>',Nm='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="13" cy="4.4" r="1.9"/><path d="M11 8.2v5.1h5.1"/><path d="M16.6 13.3l1.9 6.3"/><path d="M15.4 14.9a5.6 5.6 0 1 1-5.9-3.4"/></svg>',Dm=8,Bm=8,Fm=88;function Vm(n){let e=n.gap??Dm,t=n.margin??Bm,i=n.min??Fm,o=Math.max(n.boundsTop,0);return Math.max(Math.round(n.buttonTop-o-e-t),i)}var so=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let o=this.offered().length>0?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",o),this.button.innerHTML=Nm,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let s of this.stored())this.offeredFree().has(s)&&this.active.add(s);if(this.menu.innerHTML=Cr(o,t.tf("picker.close","Close"))+Ar(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",s=>s.stopPropagation()),this.button.addEventListener("click",s=>{s.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",s=>{s.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",s=>s.stopPropagation()),this.menu.addEventListener("click",s=>s.stopPropagation()),this.menu.addEventListener("focusin",s=>{let r=s.target;r&&typeof r.scrollIntoView=="function"&&r.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=s=>{s.key==="Escape"&&this.open(!1)},this.reflow=()=>{this.menu.hidden||this.fit()},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),window.addEventListener("resize",this.reflow),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let s=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:i,count:o})=>[i,o])),t=!1;for(let i of this.menu.querySelectorAll("[data-a11y-row]")){let o=i.dataset.a11yRow??"";if(!o.startsWith("a11y:"))continue;let s=o.slice(5),r=e.get(s);if(r===void 0)continue;let a=this.countNode(i),l=r==null?"":this.countText(r);a&&(a.textContent=l);let c=r===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(s,l))),i.disabled=c,c?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),c&&this.active.delete(s)&&(this.paint(i,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let i=t.dataset.a11yRow??"";i.startsWith("a11y:")&&this.paint(t,this.active.has(i.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${Vm({boundsTop:this.boundsTop(),buttonTop:this.button.getBoundingClientRect().top})}px`)}boundsTop(){let e=this.root.closest(".sl-map")??this.root.closest(".sl-picker");return e instanceof HTMLElement?e.getBoundingClientRect().top:0}open(e){if(e===!this.menu.hidden)return;if(this.button.setAttribute("aria-expanded",String(e)),!e){this.menu.hidden=!0,this.menu.classList.remove("sl-mo-in","sl-mo-stagger");return}this.menu.hidden=!1,this.fit(),this.menu.scrollTop=0;let t=this.button.getBoundingClientRect();Ho(this.menu,{x:t.left+t.width/2,y:t.top}),Wr(this.menu),qr(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:nd("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:_m,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:i,count:o})=>({key:i,count:o}));let t=this.deps.present;return t?cs.filter(({key:i})=>t.has(i)).map(({key:i})=>({key:i,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(cs.map(i=>[i.key,i]));return this.offered().flatMap(({key:i,count:o})=>{let s=t.get(i);return s?[{key:`a11y:${i}`,iconHtml:nd(i,{size:17}),label:this.deps.tf(`picker.accessShort.${i}`,id[i]??s.label),...i==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...o==null?{}:{count:this.countText(o),disabled:o===0},on:this.active.has(i)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),i=!t?.classList.contains("open");for(let o of this.menu.querySelectorAll(".sl-info.open"))o.classList.remove("open"),o.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",i),e.setAttribute("aria-expanded",String(i))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let s=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(s),this.paint(e,s);return}if(t==="limited"){let s=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(s),s&&this.deps.focusSeatsForFilter(),this.paint(e,s);return}let i=t.slice(5),o=!this.active.has(i);o?this.active.add(i):this.active.delete(i),this.paint(e,o),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let i=(e.dataset.a11yRow??"").slice(5),o=e.parentElement;o?.classList.contains("sl-a11yrow-w")||(o=document.createElement("div"),o.className="sl-a11yrow-w",e.replaceWith(o),o.appendChild(e));let s=document.createElement("button");s.type="button",s.className="sl-a11yrow-c sl-a11yjump",s.dataset.a11yJump=i,s.textContent=t.textContent,s.disabled=e.disabled,s.setAttribute("aria-label",this.jumpLabel(i,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(i,s.textContent??""));let r=o.querySelector(".sl-info");r?r.after(s):e.after(s),o.dataset.a11yTapThrough||(o.dataset.a11yTapThrough="true",o.addEventListener("click",a=>{a.target===o&&!e.disabled&&e.click()})),s.addEventListener("click",a=>{a.stopPropagation(),this.active.has(i)||(this.active.add(i),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(i);l&&s.setAttribute("aria-label",this.jumpLabel(i,s.textContent??"",l.label))})}}countText(e){return e>0?Om("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=id[e]??cs.find(i=>i.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,i){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...i?[`${this.deps.tf("picker.section","Section")} ${i}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};import{attachVisibilityCatchUp as $m}from"@seatlayer/core";var zm=250;function od(n,e=zm){let t=null,i=()=>{t===null&&(t=setTimeout(()=>{t=null,n()},e))},o=$m(i),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",i),()=>{t!==null&&(clearTimeout(t),t=null),o(),s&&window.removeEventListener("focus",i)}}import{holdRecoveryShape as jm,tCount as ro}from"@seatlayer/core";var ao=class{constructor(e){this.note=null;this.told=!1;this.deps=e}deferExpiryToast(e){this.told=!1,queueMicrotask(()=>{this.told||e()})}handle(e){if(!e.holdLapsed)return;this.told=!0;let t=jm(e),i=e.lapsedLabels.length,o=i-e.recoverable.length,s=t==="all"?ro("picker.holdLapsedStillFree",i):t==="partial"?ro("picker.holdLapsedSomeTaken",o):ro("picker.holdLapsedAllTaken",i);this.note={message:s,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(s,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${B(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${B(this.note.message)}</span>${e}</div>`}wire(e){e?.querySelector("[data-lapse-again]")?.addEventListener("click",()=>this.recover())}clear(){this.note&&(this.note=null,this.deps.syncTray())}actionLabel(){return ro("picker.holdLapsedSelectAgain",this.note?.recoverable.length??0)}recover(){let e=this.note?.recoverable??[];this.note=null,this.deps.syncTray(),e.length&&this.deps.reselect(e)}};var sd="@seatlayer/pending-checkout/v1";function Km(n){return typeof n=="string"&&n.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(n)}function en(n){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let i=null;try{let o=window.sessionStorage.getItem(sd);if(o){let s=null;try{s=JSON.parse(o)}catch{}if(s&&Km(s.orderId)){let r=Date.now()-Number(s.storedAt);if(r>=0&&r<=144e5){if(s.eventKey&&s.eventKey!==n)return null;i=s.orderId}}}window.sessionStorage.removeItem(sd)}catch{}e.delete("seatlayer_checkout");try{let o=e.toString();history.replaceState(history.state,"",`${location.pathname}${o?`?${o}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:i}}function rd(n){if(!n.framed)return null;let e=n.ancestorOrigins?.length?n.ancestorOrigins[0]:null;for(let t of[e,n.referrer])if(t)try{return new URL(t).origin}catch{}return null}var ld="https://api.seatlayer.io",Qm=10,Jm=250,cd=6e4,dd=4,ef=10,tf=40,nf=220,ds=["mini","peek","open"],pd="seatmap.a11y.cb";function Qe(n,e,t){return t?{ok:!1,reason:n,message:e,labels:t}:{ok:!1,reason:n,message:e}}function of(){try{if(typeof window>"u")return null;let n=window.localStorage.getItem(pd);return n==null?null:n==="1"}catch{return null}}function sf(n){try{window.localStorage.setItem(pd,n?"1":"0")}catch{}}var Je=class n{constructor(e){this.renderErrorEmitted=!1;this.realtime=null;this.accessEl=null;this.idleClock=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.paintedLocale=null;this.els={};this.regions={};this.ro=null;this.viewportResizeHandler=null;this.holdTimer=null;this.loadAbort=null;this.transportAbort=new AbortController;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerCountdownTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.currencyResolved=!1;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.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedWaiters=[];this.seatsRevealedReport=null;this.renderResolvedAt=null;this.revealWaitMs=null;this.handoverMs=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=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.bestAvailableConfirm=!1;this.baSoldOutSig="";this.bestAvailableSoldOut=!1;this.salesClosed=!1;this.salesState=null;this.salesInfo=null;this.salesUi=null;this.salesUiLoad=null;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.testBadgeEl=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 Yi({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(e,t)=>this.toast(e,t)});this.view3dCompareEl=null;this.view3dCompareCleanup=null;this.view3dSeatViewChrome=null;this.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.arenaViewportInsets={top:0,right:0,bottom:0,left:0};this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.fullscreenAffordanceSize={rootWidth:-1,rootHeight:-1,viewportWidth:-1,viewportHeight:-1};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.sectionCardCache=null;this.lastTrayCount=0;this.langSel=null;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yMenu=null;this.detachAttention=null;this.lapse=new ao({toast:(e,t,i)=>this.toast(e,t,i),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalCleanup=null;this.escHandler=null;this.closeModal=null;this.markedSeatIds=new Set;this.fitScheduled=!1;this.perspectiveWarned=!1;if(!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.performanceGroup=gc(e),this.suppressPricing=!!this.performanceGroup?.suppressPricing,this.opts={...e,confirmSelection:e.confirmSelection??!0},this.eventDetailsHidden=!!e.hideEventDetails,this.hostPricing=e.pricing,this.apiBase=(e.apiBase??ld).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},i=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Ei({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:i?.access??Pn(e,t),this.pubApi=e.transport?null:i?.api??new Ue(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=Oa(e.transport??this.pubApi,this.transportAbort.signal),this.chartFetch=xi(this.api),this.buyerAssetUrls=new Wt(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 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";let o=e.numberOfPlacesToSelect;if(o!=null&&(!Number.isInteger(o)||o<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=o??null;let s=bc(e.selectionValidators);if(this.exactTickets!=null&&s>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let r=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(Qm,s)));if(this.exactTickets!=null&&r<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&r<s)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??r,this.cbSafe=of()??!!e.colorblindSafe,this.controller=this.wireController(e)}get confirmEl(){return this.confirmCard.element}set confirmEl(e){this.confirmCard.element=e}get confirmSeat(){return this.confirmCard.candidate}set confirmSeat(e){this.confirmCard.candidate=e}get lastSection(){return this.sectionCard.summary}set lastSection(e){this.sectionCard.adopt(e)}deliverableViewReference(e){return Yt(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=rd({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let i=t<640?1.2:.62;return Math.max(420,Math.round(t*i))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!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()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-dd&&t.width>=window.innerWidth-dd}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let i=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=i,e.tabIndex=i?-1:0,e.setAttribute("aria-hidden",String(i))}fullscreenMeasurementChanged(e,t){let i=typeof window>"u"?0:window.innerWidth,o=typeof window>"u"?0:window.innerHeight,s=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||i!==this.fullscreenAffordanceSize.viewportWidth||o!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:i,viewportHeight:o},s}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.root?.setAttribute("data-fs",String(e)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let i=this.els.zfs?.querySelector(".sl-zfs-lbl");i&&(i.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e)),this.syncFullscreenAffordance()}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,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.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){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.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){Ne();let t=$i(y("picker.seatSelection","Seat selection"),He(void 0,e.theme)["--sl-bg"]),i;try{i=new n({...e,container:t.frame})}catch(r){throw t.teardown(!1),r}i.modalCleanup=()=>{i.modalCleanup=null,t.teardown()};let o=!1,s=()=>{if(o)return;o=!0,i.modalCleanup?.();let r=()=>{i.destroy(),e.onClose?.()};i.hold&&!i.handedOff&&e.holdOnClose!=="keep"?i.release().finally(r):r()};i.closeModal=s,t.onScrimPress(s),i.escHandler=t.trapKeys(r=>{i.tableDialog?(r.preventDefault(),i.cancelTableDialog()):i.confirmSeat?(r.preventDefault(),i.cancelConfirm()):i.bestAvailableConfirm?(r.preventDefault(),i.bestAvailableConfirm=!1,i.syncTray()):(r.preventDefault(),s())});try{let r=i.render();i.els.close?.classList.add("on"),i.els.close?.addEventListener("click",s),await r}catch(r){throw i.destroy(),r}return i.destroyed||t.focusFirst(),i}static prewarm(e){try{if(!e||typeof e!="object"||typeof e.event!="string"||!e.event||typeof e.publicKey!="string"||!e.publicKey)return;Kr({base:(e.apiBase??ld).replace(/\/+$/,""),event:e.event,publicKey:e.publicKey})}catch{}}wireController(e){return new Gm({sectionPreview:!0,transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,unselectableAsUnavailable:e.unselectableAsUnavailable,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.mapPriceRanges(),seatPriceLabel:t=>{let i=this.seatPriceRangeOf(t.label,t.categoryKey);return i?this.moneyRange(i):void 0},flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:_t(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,this.drainSeatsRevealedWaiters(),this.revealWaitMs===null&&this.renderResolvedAt!==null&&(this.revealWaitMs=performance.now()-this.renderResolvedAt),e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let i=this.controller.getGAAreas().find(o=>o.id===t);i&&(this.collapseSheet(),Do(this,i,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),za(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,i=this.holdConflicted;this.holdExpiredUnits=Qc(this.hold);let o=this.hold;this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear();let s=this.api.resume,r=t&&!i&&o&&s?Fc(a=>s.call(this.api,this.opts.event,a),o.holdId):null;this.lapse.deferExpiryToast(()=>{if(t||i){let a=()=>this.toast(D("picker.holdExpired",void 0)||"Your hold expired. Seats released. Pick again.","warning");if(!r){a();return}r.then(l=>{if(!(this.destroyed||this.hold)){if(!l){a();return}this.hold=o,this.showBooked()}});return}this.showHoldExpired()}),this.syncTray(),this.emitHoldChange(),r?r.then(a=>{a||this.opts.onHoldExpired?.()}):this.opts.onHoldExpired?.()},onAvailabilityRefresh:t=>this.lapse.handle(t),confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.closedWords().toast,"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.closedWords().toast,"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){if(this.opts.confirmSelection===!1||this.salesClosed){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}this.showConfirm(t,"remove");return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast(D("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onSalesNotice:t=>this.salesNotice(t),onError:t=>{this.renderErrorEmitted=!0,this.opts.onError?.(t)}})}async render(){if(this.rendered)return this;let e=performance.now(),t={},i=b=>Math.round((performance.now()-b)*100)/100;this.rendered=!0,Ne();let o=performance.now(),s=bi(this.opts.locale,this.opts.messages),r=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=sr(this.opts.container),{root:c,els:d,mapHost:h}=Nr(l,(b,T)=>this.tf(b,T),this.opts.theme);this.root=c,this.els=d,this.mapHost=h,this.paintedLocale=lo(),this.opts.checkoutBar===!1&&(c.dataset.checkoutBar="off"),yi(c,s,b=>{t.loadLocale=i(o),this.destroyed||this.applyActiveLocale(b,r)}),Bl(c,()=>[{open:()=>!!this.holdExpiredEl,close:()=>this.restartAfterHoldExpiry()},{open:()=>this.tipPinned,close:()=>this.unpinTooltip()},{open:()=>!!this.tableDialog,close:()=>this.cancelTableDialog()},{open:()=>!!this.confirmSeat,close:()=>this.cancelConfirm()},{open:()=>this.bestAvailableConfirm,close:()=>{this.bestAvailableConfirm=!1,this.syncTray()}}]);let m=this.performanceGroup?.modalClose;m&&(this.els.close?.classList.add("on"),this.els.close?.addEventListener("click",()=>m()));let u=this.performanceGroup?.subheader;u&&c.querySelector(".sl-head")?.after(u),this.syncFullscreenButtons(),this.wireBuyerShell(c);let g=document.createElement("div");return g.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(g),t.mountBuyerShell=i(a),t.skeletonPaint=i(e),this.loadAndFinishChart(g,t,i,e,c)}async loadAndFinishChart(e,t,i,o,s){this.startRealtime(),this.startIdleClock(s);let r=await this.loadChart(e,t,i);if(!r)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=i(o);let a=performance.now();if(this.salesClosed=!!r.salesClosed||!!this.opts.readOnly,this.salesState=r.salesState??null,this.salesInfo=r,s.dataset.eventMode=r.mode==="test"?"test":"live",!this.opts.locale&&r.locale&&this.setLocale(r.locale),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),r.mode==="test"){let x=document.createElement("div");x.className="sl-testbadge",this.testBadgeEl=x,this.syncTestBadge(),this.regions["top-left"].appendChild(x)}let l=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(s),this.watchThemeMode(),this.currency=r.currency??this.opts.currency??"USD",this.currencyResolved=!0,this.eventTimezone=r.timezone??null,oi(this.els.logo,[this.opts.theme?.logoUrl,l?.logoUrl,this.performanceGroup?.brandLogoUrl,r.posterUrl],this.opts.theme?.brandName??l?.brandName??r.eventName??"?"),this.els.name.textContent=r.eventName??"";let c=r.startsAt?li(r.startsAt,r.timezone??null,this.opts.locale):"";this.eventWhenText=c||null,this.els.meta.textContent=[r.venue,c].filter(Boolean).join(" \xB7 "),this.syncProjection();let d=!!this.controller.doc&&this.controller.getExpandedSeats().some(x=>x.commercial?.restrictedView||x.commercial?.obstructedView);this.buildAccessibilityMenu(d),this.buildLanguageSwitcher(this.els.zoom??this.regions["bottom-right"]),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),s.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(),t.buildBuyerControls=i(a);let h=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=i(h),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncOffer(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let m=this.controller.doc,u=ti(this.opts.event),g=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),b=g??"event",T={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:b,surface:g==="season"?"season_picker":g==="performance_group"?"performance_group_picker":"seat_picker",ms:i(o),performanceProfile:t,seatCount:this.allSeats().length,objectCount:m?.objects.length??0,sectionCount:m?.objects.filter(x=>x.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:m?.name,view:this.buyerView,load:u,transport:this.opts.transport?"custom":"pubapi",revealWaitMs:this.revealWaitMs??this.sinceRenderResolved(),handoverMs:this.handoverMs??void 0};Ul(T,(x,P)=>this.emitAnalytics(x,P));let S=r.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",ss({...T,performanceProfile:{...T.performanceProfile,...S}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=r,await this.registerAgentTools(),this}registerAgentTools(){return jl(this)}webMcpHost(e){return os(this,e)}wireBuyerShell(e){this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler)),this.detachAttention=od(()=>{this.destroyed||this.controller.refreshAvailability()}),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.overview()),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);let t=this.els.sheetHead;if(t){let o=this.els.sheetToggle;this.syncSheetAffordance();let s=0,r=!1,a=!1,l=!1;o?.addEventListener("click",c=>{c.stopPropagation(),!r&&this.cycleSheet()}),t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard")){a=!1;return}l=!!c.target.closest?.(".sl-sheet-toggle"),a=!0,r=!1,s=c.clientY,(l&&o?o:t).setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!a||r)return;let d=c.clientY-s;d<-18?(this.stepSheet(1),r=!0):d>18&&(this.stepSheet(-1),r=!0)}),t.addEventListener("pointerup",c=>{a&&!r&&!l&&Math.abs(c.clientY-s)<6&&this.cycleSheet(),a=!1,(l&&o?o:t).releasePointerCapture?.(c.pointerId),l=!1})}this.els.foot?.addEventListener("click",o=>{this.root?.dataset.layout==="narrow"&&(o.target.closest?.('.sl-chip,button,a,input,select,label,[role="button"]')||this.cycleSheet())});let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let o=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!o)),this.els.pricesSec?.setAttribute("aria-expanded",String(!o)),!o&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",o=>{o.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||o.target.closest("select,button")||(o.preventDefault(),i())}),e.addEventListener("click",o=>{let s=o.target.closest("[data-sl-info]");if(!s||!e.contains(s))return;o.stopPropagation();let r=s.closest(".sl-info"),a=!r?.classList.contains("open");this.closeInfoPops(r),r?.classList.toggle("open",a),s.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",o=>{o.target.closest(".sl-info")||this.closeInfoPops()}),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("pointerdown",o=>{this.handleMapPointerDown(o)},!0),this.els.map.addEventListener("mousemove",o=>{if(this.tipPinned)return;let s=this.els.map.getBoundingClientRect();this.tipPos={x:o.clientX-s.left,y:o.clientY-s.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.els.cta.dataset.act==="find"?this.openBestSeatsForm():this.handleCta()})}sheetState(){let e=this.root?.dataset.sheet;return e==="mini"||e==="open"?e:"peek"}sheetHasCards(){return this.root?.getAttribute("data-has-selection")==="true"}setSheetState(e){let t=this.root;if(!t)return;let i=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),i==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),i=this.els.sheetToggle;i?.setAttribute("aria-expanded",String(e==="open")),i?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=ds.indexOf(this.sheetState()),i=Math.min(ds.length-1,Math.max(0,t+e));this.setSheetState(ds[i])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let i=e.clientWidth;if(i<=0)return;let o=e.clientHeight,s=i!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:o};let r=this.fullscreenMeasurementChanged(i,o);this.reportFramedHeight();let a=i<640?"narrow":"wide",l=o<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.setNarrowLayout?.(a==="narrow"),queueMicrotask(()=>this.syncFitClearance()),this.controller.getRenderer()?.setSectionFocusDim?.(a!=="narrow"),a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),(r||c)&&this.syncFullscreenAffordance(),this.syncArenaViewportInsets(),s&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),this.els.map&&this.ro.observe(this.els.map),this.viewportResizeHandler=()=>{this.fullscreenMeasurementChanged(e.clientWidth,e.clientHeight)&&this.syncFullscreenAffordance()},window.addEventListener("resize",this.viewportResizeHandler),t(),requestAnimationFrame(t)}async loadChart(e,t,i){let o=performance.now();this.seatsRevealed=!1,this.seatsRevealedWaiters=[],this.seatsRevealedReport=null,this.renderResolvedAt=null,this.revealWaitMs=null,this.handoverMs=null,this.loadAbort=new AbortController;let s=await Vt(async()=>{this.renderErrorEmitted=!1;let l=await this.controller.render(e);return this.renderResolvedAt=performance.now(),this.seatsRevealed&&(this.revealWaitMs=0),this.viewportLoading()&&this.drainSeatsRevealedWaiters(),l},this.loadAbort.signal,()=>{let l=this.els.boot.querySelector(".sl-boot-say");l&&(l.classList.add("is-visible"),l.textContent=D("picker.loadingTakingLonger"))});if(this.loadAbort=null,s.outcome==="cancelled"||this.destroyed)return null;let r=s.outcome==="loaded"?s.value:null,a=s.outcome==="loaded"&&!r&&!this.opts.transport?ki(this.chartFetch?.outcome(),this.renderErrorEmitted):null;if(r||this.controller.destroy(),t.loadChartAndStatuses=i(o),this.destroyed)return null;if(!r){a&&Si({apiBase:this.apiBase,eventKey:this.opts.event,reason:a}),Ee({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:s.outcome==="timeout"?"load_timeout":s.outcome==="error"?"render_error":"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:Re(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let l=this.opts.transport?void 0:this.chartFetch?.outcome();if(l?.state==="rejected"&&l.error?.status===404){let c=l.error;c.serverMessage&&console.warn(`[SeatLayer] ${c.serverMessage}`),this.opts.onError?.(c),Xt(this.els.boot,{title:["picker.eventUnavailableTitle","This event isn\u2019t available"],description:["picker.eventUnavailable","Tickets can\u2019t be booked here right now."]});for(let d of[this.els.side,this.els.rail])d&&(d.setAttribute("inert",""),d.style.display="none");return null}return Xt(this.els.boot,{title:["picker.mapDidNotLoad","The seat map didn\u2019t load"],description:["picker.checkConnection","Check your connection and try again."],action:["picker.accessRetry","Try again"]}),this.els.boot.querySelector("button").addEventListener("click",()=>{if(this.destroyed||!this.root)return;this.controller=this.wireController(this.opts),Xt(this.els.boot,{title:["picker.loadingSeatMap","Loading seat map\u2026"],busy:!0});let c=performance.now();this.loadAndFinishChart(e,{},i,c,this.root)},{once:!0}),null}return Object.assign(t,r.performanceProfile),r}sinceRenderResolved(){return this.renderResolvedAt===null?void 0:performance.now()-this.renderResolvedAt}whenSeatsRevealed(e){if(!this.destroyed){if(this.seatsRevealed||this.viewportLoading()&&this.renderResolvedAt!==null){e();return}this.seatsRevealedWaiters.push(()=>{this.destroyed||e()})}}viewportLoading(){return this.opts.loadingReveal==="viewport"}drainSeatsRevealedWaiters(){let e=this.seatsRevealedWaiters;this.seatsRevealedWaiters=[];for(let t of e)try{t()}catch{}}async restoreHoldForFirstPaint(e){let t=[this.els.side,this.els.rail].filter(Boolean),i=t.map(o=>o.hasAttribute("inert"));t.forEach(o=>o.setAttribute("inert",""));try{for(;!this.destroyed;){let o=performance.now();try{return await this.restoreRememberedHold(),!this.destroyed}catch{if(this.destroyed)return!1;Ee({apiBase:this.apiBase,event:this.opts.event,reconnects:this.realtime?.reconnects??0,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"restore_hold",ms:performance.now()-o,performanceProfile:e,view:"map",load:Re(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let r=Xt(this.els.boot,{title:["picker.restoreUnavailableTitle"],description:["picker.restoreUnavailable"],action:["picker.accessRetry","Try again"]}),a=this.transportAbort.signal;if(await new Promise(l=>{let c=()=>{r.removeEventListener("click",c),a.removeEventListener("abort",c),l()};r.addEventListener("click",c,{once:!0}),a.addEventListener("abort",c,{once:!0}),a.aborted&&c()}),this.destroyed||a.aborted)return!1;Xt(this.els.boot,{title:["picker.restoringSeats"],busy:!0})}}return!1}finally{t.forEach((o,s)=>{i[s]||o.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=en(this.opts.event);e?.outcome!=="success"||!e.orderId||this.openCheckoutPanel({kind:"resume",orderId:e.orderId})}buildPanelToggle(){if(!this.regions["top-right"])return;let 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(){let e=this.sideToggleEl;if(!e)return;let t=this.sideCollapsed;e.setAttribute("aria-expanded",String(!t)),e.setAttribute("aria-label",t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=t?`<svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span>${this.tf("picker.tickets","Tickets")}</span>`:'<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>'}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){let e=this.root?.dataset.layout!=="narrow";this.root?.setAttribute("data-side-collapsed",String(this.sideCollapsed)),this.els.side?.toggleAttribute("inert",this.sideCollapsed&&e),this.syncPanelToggle()}buildAccessibilityMenu(e){let t=this.els.zoom??this.regions["bottom-right"]??this.els.map;t&&(this.a11yMenu=new so(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(i,o)=>this.tf(i,o),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:i=>this.setColorblindSafe(i),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:i=>{this.limitedViewFilter=i,this.controller.setCommercialLimitedFilter(i),this.pushAvailabilityTo3d()},applyAccessibilityFilter:i=>this.applyAccessibilityFilter(i),focusSeatsForFilter:()=>this.whenSeatsRevealed(()=>this.focusSeatsForFilter()),stepToAccessibleSection:i=>this.controller.focusNextAccessibleSection?.([i])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast(D("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,i=this.els.headInfo?.parentElement;t&&i&&t.parentElement!==i&&(t.classList.add("sl-fs-pill"),i.insertBefore(t,this.els.hold??null));let o=this.extendEl;if(o){let r=e?this.regions["bottom-center"]??this.els.map:i;r&&o.parentElement!==r&&(o.dataset.dock=e?"map":"head",r===i?r.insertBefore(o,this.els.close??null):r.appendChild(o))}let s=this.els.pricesSec;s&&(e?(s.setAttribute("role","button"),s.tabIndex=0,s.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(s.removeAttribute("role"),s.removeAttribute("aria-expanded"),s.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){vc(this)}buildBookedOverlay(){let e=document.createElement("div");e.className="sl-booked",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<div class="sl-booked-badge"><svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5"/></svg></div><div class="sl-booked-title">${this.tf("picker.allSetTitle","You're all set")}</div><div class="sl-booked-sub" data-ref="bookedSub"></div><ul class="sl-booked-list" data-ref="bookedList"></ul><button type="button" class="sl-booked-back" data-ref="bookedBack"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${B(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}closedWords(){return this.salesUi?.words(this)??Ir(this.salesState,!!this.opts.readOnly)}finishingHold(){return!!this.salesUi?.finishing(this)}withSalesUi(){return this.salesUiLoad??=rr().then(e=>(e.translate(D,_n),this.salesUi=e,this.destroyed||this.applySalesClosed(),e),()=>null)}salesNotice(e){(this.salesUi||e.state!=="live")&&this.withSalesUi().then(t=>t?.applyNotice(this,e))}tf(e,t){return y(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),i=document.createElement("div");i.className="sl-soldout-eyebrow",i.textContent=t;let o=document.createElement("div");o.className="sl-soldout-title",o.textContent=this.tf("picker.soldOutTitle","Sold out");let s=document.createElement("p");s.className="sl-soldout-copy",s.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(i,o,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,t,i),s=[...mi(e,t)].join("|");s!==this.baSoldOutSig&&(this.baSoldOutSig=s,this.syncTray()),o!==this.soldOut&&(this.soldOut=o,this.soldoutEl?.classList.toggle("on",o))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(o=>(t[o.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog(),this.salesClosed&&!this.salesUi&&this.withSalesUi();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed&&!this.salesUi?.view(this));let t=this.els.closedPillText??e;t.textContent=this.closedWords().pill}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.closedWords().toast),this.syncCta(),this.syncTray()}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let i=document.createElement("div");i.className="sl-anchor",i.dataset.region=t,this.els.map.appendChild(i),this.regions[t]=i}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let i=setTimeout(()=>{this.motionTimers.delete(i),this.destroyed||e()},t);this.motionTimers.add(i)}animateOnce(e,t,i=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),i))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),i=(e.items??[]).filter(o=>o.objectType!=="ga").slice(0,10).map(o=>this.controller.seatByLabel(o.label)).filter(o=>!!o);if(this.buyerView==="venue3d"&&this.view3dHandle){sc(this,i);return}Sa({regions:this.els,categories:this.controller.doc?.categories,pop:o=>this.controller.flashSeat(o,this.cssVar("--sl-accent")||"#f4b740"),focus:(o,s)=>this.controller.focusSection(o,s),focusSeats:o=>this.controller.focusSeats?.(o,{animate:!t})===!0,reducedMotion:t,screenPoint:o=>this.controller.worldToScreen(o),schedule:(o,s)=>this.scheduleMotion(o,s)},i)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(i=>i.id!==e&&i.id!==t)}pendingSelectionCount(){return xc(this)}heldTicketCount(){return kc(this)}totalTicketCount(){return Sc(this)}updateSelectionCapacity(){Tc(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){Ec(this,e,t)}setCtaPhase(e){Cc(this,e)}runCheckoutHandoff(e,t){return Ac(this,e,t)}holdStorageKey(){return Pc(this)}rememberedHoldId(){return Lc(this)}rememberHold(e){Mc(this,e)}forgetHold(){Hc(this)}resumeHoldFromServer(e,t=!1){return Rc(this,e,t)}restoreRememberedHold(){return Ic(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let i=this.controller.getActiveFloorId();return(t.find(o=>o.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=$s({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label,tint:e=>this.controller.getRenderer?.()?.categoryDisplayColor?.(e)||void 0},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return Qi(this,e)}catPriceRange(e){return Ji(this,e)}buildPriceFilter(){Kc(this)}applyPriceBand(e){Gc(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(i=>i.type==="section")||(e.floors??[]).some(i=>i.objects.some(o=>o.type==="section"));if(this.canOffer3d()){let i=document.createElement("div");i.className="sl-projection",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),i.dataset.slA="picker.venueView",i.innerHTML=`<button type="button" data-view="map" aria-pressed="true" data-sl-t="picker.map" data-sl-ti="picker.flat2dMap" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" data-sl-ti="picker.interactive3dVenueView" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,i.querySelectorAll("button").forEach(o=>{if(o.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])o.addEventListener(s,ri,{once:!0});o.addEventListener("click",()=>{this.setBuyerView(o.dataset.view)})}),this.regions["top-right"].appendChild(i),this.projectionEl=i,this.syncProjection()}if(t){let i=[...e.objects,...(e.floors??[]).flatMap(h=>h.objects)],o=new Set((e.zones??[]).map(h=>h.id)),a=Um(e)==="combined"&&(e.floors?.length??0)>1&&o.size===0||i.some(h=>h.type==="section"&&typeof h.zone=="string"&&o.has(h.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",D("picker.zoomLevel")),l.dataset.slA="picker.zoomLevel";let c={zones:D("picker.rungLabel.zones"),sections:D("picker.rungLabel.sections"),seats:D("picker.rungLabel.seats")},d={zones:D("picker.rungTip.zones"),sections:D("picker.rungTip.sections"),seats:D("picker.rungTip.seats")};l.innerHTML=a.map(h=>`<button type="button" data-rung="${h}" data-sl-t="picker.rungLabel.${h}" data-sl-ti="picker.rungTip.${h}" title="${d[h]}" aria-pressed="false">${c[h]}</button>`).join(""),l.querySelectorAll("button").forEach(h=>{h.addEventListener("click",()=>{let m=h.dataset.rung;this.controller.setRung(m),m==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let i=sl({floors:this.controller.getFloors(),tf:(o,s)=>this.tf(o,s),onChoose:o=>{o===""?this.controller.setFloorOverview(!0):this.controller.setFloor(o),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});(this.regions["bottom-right"]??this.regions["top-left"]).prepend(i),this.floorsEl=i,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map;e&&ga(this.root,e,this.regions);let t=e?ol(e.getBoundingClientRect(),[this.rungsEl,this.projectionEl].map(i=>i?.isConnected?i.getBoundingClientRect():null),[],8,this.floorsEl?.isConnected?[this.floorsEl.getBoundingClientRect()]:[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(i=>t[i]===this.arenaViewportInsets[i])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t),this.syncFitClearance())}syncFitClearance(){let e=this.els.map,t=this.els.zoom,i=this.root?.dataset.layout==="narrow",o=0;if(i&&e&&t?.isConnected){let s=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.height>0&&(o=Math.max(0,s.bottom-r.top+8))}this.controller.setFitClearance?.(o)}syncTestBadge(){let e=this.testBadgeEl;e&&(e.textContent=or(D("picker.testMode"),lo()),e.setAttribute("aria-label",D("picker.testMode")),e.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"))}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(i=>{let o=i.dataset.rung===e;i.classList.toggle("on",o),i.setAttribute("aria-pressed",String(o))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,i=this.els?.zin;if(!e||!this.root)return;let o=this.controller.getRenderer?.(),s=this.controller.canZoomIn?.()===!1||o?.seatsPickable?.()===!0,r=Vs({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.disabled!==r||!!t&&t.disabled!==r||!!i&&i.disabled!==s||e.hidden||!!i?.hidden||!!t?.hidden;e.disabled=r,e.hidden=!1,i&&(i.disabled=s,i.hidden=!1),t&&(t.disabled=r,t.hidden=!1),a&&this.a11yMenu?.refit()}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?D("picker.priceHint3d"):this.tf("picker.priceHint","Colours on the map are ticket types. Tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!si()?!1:this.allSeats().length<=this.max3dSeats()}max3dSeats(){let e=this.opts.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?cd/2:cd}syncFloors(){rl(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new Ki({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(o=>o.type==="section"&&!this.controller.isSectionClosed(o.id)&&this.controller.getSectionSeatCount(o.id)>0);if(t.length<2)return null;let i=t.findIndex(o=>o.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}markedSeatAnnouncement(e){let t=Xo(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return gl(t,e.displayLabel??e.label,this.opts.locale)}seatPriceRangeOf(e,t){let i=this.controller.doc?.categories.find(s=>s.key===t),o=i?i.tiers?.length?i.tiers.map(s=>this.paidPrice(i.key,s.id??null,s.price,e)):i.price==null?[]:[this.paidPrice(i.key,null,i.price,e)]:[];return o.length?{min:Math.min(...o),max:Math.max(...o)}:void 0}moneyRange(e){return e.max>e.min?`${this.money(e.min)}\u2013${this.money(e.max)}`:this.money(e.min)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.markedSeatAnnouncement(e);if(t){this.srEl.textContent=t;return}let i=this.controller.doc?.categories.find(u=>u.key===e.categoryKey),s=(this.controller.getStatus(e.id)??"free")==="free"?this.tf("picker.statusAvailable","available"):this.controller.currentHold()?.labels.includes(e.label)?this.tf("picker.heldForYou","Held for you").toLocaleLowerCase(lo()):this.tf("picker.group.legendUnavailable","Unavailable").toLocaleLowerCase(lo()),r=this.seatPriceRangeOf(e.label,e.categoryKey),a=!this.suppressPricing&&r?this.moneyRange(r):void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=yt(c),h=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,m=l?`${d} ${h}, ${l.bookingMode==="variable"?D("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):D("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${h}`:c?.objectType==="table"?`${d} ${h}, ${D("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:D("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${m}, ${i?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let o=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),s=e.bookingMode==="variable",r=document.createElement("div");r.className="sl-table-scrim",r.innerHTML=Tr(e,{variable:s,held:t,typeWord:yt(e),categoryLabel:o?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(r),this.tableDialogEl=r,this.renderTableDialogState(),r.querySelectorAll("[data-table-step]").forEach(a=>{a.addEventListener("click",()=>{if(!this.tableDialog)return;let l=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(a.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:l},this.renderTableDialogState()})}),r.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),r.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),r.addEventListener("mousedown",a=>{a.target===r&&this.cancelTableDialog()}),r.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...r.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],d=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),d.focus()):!a.shiftKey&&document.activeElement===d&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>r.querySelector(s?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let i=t.querySelector("output[data-table-qty]");i&&(i.value=String(e.quantity));let o=t.querySelector("input[data-table-qty]");o&&(o.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let s=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),r=t.querySelector("[data-table-total]");r&&(r.textContent=this.money(s*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let i=this.tableDialogEl?.querySelector(".sl-table-confirm");if(i&&(i.disabled=!0,i.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let o=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!o){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},this.startHoldTimer(o.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast(D("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(o){this.opts.onError?.(o),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){i&&(i.disabled=!1,i.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new Wi({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),feeNote:e=>this.feeWords().seat(e),paidPrice:(e,t,i,o)=>this.paidPrice(e,t,i,o),offerName:(e,t)=>this.offerPrice(e,t)?.offerName,suppressPricing:()=>this.suppressPricing,packagePrice:e=>this.performanceGroup?.packagePricing?.seatCardPrice(e)??null,reducedMotion:()=>this.reducedMotion(),scheduleMotion:(e,t)=>this.scheduleMotion(e,t),canOffer3d:()=>this.canOffer3d(),buyerView:()=>this.buyerView,view3dHandle:()=>this.view3dHandle,view3dCompareSeatIds:()=>this.view3dCompareSeatIds,rememberView3dReturnSeat:e=>{this.view3dReturnSeat=e},enter3d:e=>{this.enter3d(e)},performanceGroup:()=>this.performanceGroup,seatViewEnabled:()=>this.seatViewEnabled(),openSeatView:e=>{this.openSeatView(e)},openSeatConfidencePassport:(e,t)=>this.openSeatConfidencePassport(e,t),saveView3dComparisonSeat:e=>this.saveView3dComparisonSeat(e),resolveAssetUrl:e=>this.buyerAssetUrls.resolve(e),onError:e=>this.opts.onError?.(e),liftToastOverConfirm:()=>this.liftToastOverConfirm(),fitTranslatedRows:()=>this.fitTranslatedRows(),syncTray:()=>this.syncTray(),syncSelectionTo3d:()=>this.syncSelectionTo3d(),collapseSectionCard:()=>this.collapseSectionCard(),applyPanelCollapsed:()=>this.applyPanelCollapsed(),dismiss:()=>this.dismissConfirm(),releaseHeldSeat:e=>this.controller.currentHold()?.labels.includes(e.label)?this.removeHeldLabels([e.label]):null,reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e),cartLanded:()=>this.cartLanded()})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}cartLanded(){this.animateOnce(this.els.count,"sl-value-pop",380),this.animateOnce(this.els.total,"sl-value-pop",380)}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){Rl(e,t,this.reducedMotion())}addSeatLabel(e){return Il(e,(t,i)=>this.tf(t,i))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,i=this.controller.doc,o=this.controller.getActiveFloorId(),s=e.focalPoint??i?.floors?.find(h=>h.id===o)?.focalPoint??i?.focalPoint??{x:0,y:0},r,a,l=!1;if(e.viewUrl){let h,m=null;try{let g=e.viewMeta?.previewUrl;g&&g!==e.viewUrl?(m=await this.buyerAssetUrls.resolve(g),h=e.viewUrl):h=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(g){t===this.seatViewGen&&this.opts.onError?.(g);return}if(t!==this.seatViewGen||!h||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!m||!this.root||!this.seatViewEnabled())return;let u={url:h,...m?{previewUrl:m}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};r=u,a=Xm(u),l=Zm(u)}else{let h;try{let{generateSeatPanorama:m}=await ai();h=m(e,s,this.allSeats())}catch(m){t===this.seatViewGen&&this.opts.onError?.(m);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;r={url:h.url,generated:!0},a=D("picker.illustrationCaption",{m:h.distanceM})}this.closeSeatView(!1);let c=D("picker.viewFromSeat",{label:e.label}),d=Ri({root:this.root,source:r,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:ht(),viewFromSeatLabel:c,real360Label:D("picker.real360"),previewLabel:D("picker.preview"),resolveAsset:h=>this.buyerAssetUrls.resolve(h),onClose:()=>this.closeSeatView()});this.viewEl=d.element,this.viewCleanup=()=>d.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}feeWords(){return Za(qa(this.offerAvailability,this.currency,this.hostPricing),this.currency,e=>this.money(e))}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let i=Number.isInteger(e);return qm(e,this.currency,{locale:this.opts.locale,fallback:(o,s)=>`${o} ${s}`,...i?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),i=ja(e,t);if(i==null)return;let o=6*36e5,s=Math.min(Math.max(i-t+1e3,1e3),o);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},s)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<Jm}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let i=qo(t);if(!i)return;let o=this.offerAvailability?.bookingFee?.amountMinor;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i),this.setPricing(this.hostPricing),i.bookingFee?.amountMinor!==o&&this.syncTray(),this.syncMapPriceRanges(),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(i)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e,t){if(!e)return null;let i=this.offerAvailability?.prices.filter(o=>o.categoryKey===e)??[];return t!==void 0?i.find(o=>(o.tierId??null)===t)??i.find(o=>o.tierId==null)??null:i[0]??null}mapPriceRanges(){if(this.api.availability&&!this.offerAvailability)return null;let e=this.offerAvailability?.prices.some(i=>i.tierId!==void 0)??!1,t=Object.keys(this.opts.pricing?.prices??{}).length>0||Object.keys(this.opts.pricing?.objects??{}).length>0||Object.keys(this.controller.doc?.seatPrices??{}).length>0;if(!(!e&&!t))return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(i=>{let o=this.catPriceRange(i);return o?[[i.key,o]]:[]}))}syncMapPriceRanges(){this.controller.getRenderer()?.setCategoryPriceRanges?.(this.mapPriceRanges())}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerCountdownTimer=null,e.classList.remove("sl-offer-compact","sl-offer-early-bird"),!this.currencyResolved){e.classList.remove("has"),e.replaceChildren();return}if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,i=t?.release??null,o=!i&&t?.upcoming?.pricingMode!=="matrix"?t?.upcoming??null:null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!o){e.classList.remove("has"),e.replaceChildren();return}let s=i??o,r=s.pricingMode==="matrix",a=document.createElement("div");a.className="sl-offer-main";let l=document.createElement("div");l.className="sl-offer-copy";let c=document.createElement("span");c.className="sl-offer-kicker",c.textContent=i?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let d=document.createElement("strong");d.className="sl-offer-name";let h=s.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));ko(h)&&e.classList.add("sl-offer-early-bird"),d.innerHTML=di(h,B);let m=document.createElement("span");m.className="sl-offer-line";let u=[];if(!r&&i&&t.fromPrice!=null&&u.push(this.money(t.fromPrice/100)),!r&&i&&s.remaining!=null&&u.push(D("picker.offerRemainingAvailable",{count:s.remaining})),i&&s.endsAt!=null){let x=!this.opts.locale||/^en(?:-|$)/i.test(this.opts.locale)?hr(s.endsAt):null;if(u.push(x??D("picker.offerUntil",{time:li(s.endsAt,this.eventTimezone,this.opts.locale)})),x){let P=Math.max(1e3,s.endsAt-Date.now()),_=P%6e4||6e4;this.offerCountdownTimer=setTimeout(()=>{this.offerCountdownTimer=null,Date.now()>=s.endsAt?this.refreshOfferAvailability(!1):this.syncOffer()},Math.min(_+25,P+25))}}if(o?.startsAt!=null&&u.push(D("picker.offerStarts",{time:li(o.startsAt,this.eventTimezone,this.opts.locale)})),m.textContent=u.join(" \xB7 "),r||l.append(c),l.append(d,m),r){e.classList.add("sl-offer-compact"),a.append(l),e.replaceChildren(a),e.classList.add("has");return}let g=document.createElement("details");g.className="sl-offer-info";let b=document.createElement("summary");b.setAttribute("aria-label",D("picker.howOfferWorks",{name:d.textContent??""})),b.textContent="i";let T=document.createElement("div");T.className="sl-offer-detail",T.textContent=i?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."),g.append(b,T),a.append(l,g),e.replaceChildren(a),e.classList.add("has")}paidPrice(e,t,i,o){if(o){let r=ad(this.opts.pricing?.objects,o,t)??ad(this.controller.doc?.seatPrices,o,t);if(r!==void 0)return r}let s=o?this.channelByObject.get(o):void 0;if(s&&e){let r=this.pricesByChannel.get(s)?.find(a=>a.categoryKey===e&&a.tierId===(t??null));if(r)return r.price}return De(this.opts.pricing?.prices,e,t,i)}heldPrice(e){return this.checkoutMode==="hosted"?e.unitPrice:Oi({...this.hostPricing,seatPrices:this.controller.doc?.seatPrices},e.label,e.categoryKey,e.tierId,e.unitPrice)}hostObjectPrices(){return this.opts.pricing?.objects}legendDeps(){return Uc(this)}seatPlaces(e){return e.map(t=>{let i=this.controller.seatByLabel(t),o=i?this.controller.seatDetails(i.id):null,s=o?Q(o)||o.rowLabel:null;return{label:t,...o?.sectionLabel?{section:o.sectionLabel}:{},...s?{row:String(s)}:{},...o?.seatNumber!=null?{seat:String(o.seatNumber)}:{}}})}partialLegend(){return this.markedSeatIds.size?this.performanceGroup?.partialWords?.legend??null:null}syncPriceRail(e,t,i=this.legendDeps()){qc(this,e,t,i)}syncPrices(){this.currencyResolved&&Wc(this)}focusCategory(e){Yc(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(i=>!e.has(i.label)&&(this.controller.getStatus(i.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(i=>i.id)),this.toast(D("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:i,heldLabels:o,total:s,count:r}=Xi(this),a=[],l=new Set;if(!this.salesClosed){let f=this.performanceGroup?.nightSummary?.()??[];f.length&&a.push(dl(f,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let I=this.performanceGroup?.selectionModeSwitch;I&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${B(I.label)}</button>`)}let c={salesClosed:this.salesClosed,salesState:this.salesState,note:this.salesUi?.note(this),hasPicks:e.length>0||i.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(f=>f.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(Or(c)),this.els.trayHint&&(this.els.trayHint.textContent=_r(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed),this.salesUi?.sync(this);let d=!e.length&&!i.length&&!Xe(this.gaQty,this.hold?.items??[]);if(no(this.performanceGroup)&&!this.salesClosed&&!this.hold&&(d||this.bestAvailableBusy||this.bestAvailableConfirm)){let f=(this.controller.doc?.categories??[]).filter(O=>!O.notForSale),I=this.controller.getBestAvailableZones();this.baZone&&!I.some(O=>O.id===this.baZone)&&(this.baZone="");let L=mi(f,this.controller.categoryAvailability());this.baSoldOutSig=[...L].join("|"),this.bestAvailableSoldOut=f.length>0&&L.size===f.length,L.has(this.baCat)&&(this.baCat=""),(!this.bestAvailableSoldOut||this.bestAvailableBusy||this.bestAvailableConfirm)&&a.push(Hr({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:f.map(O=>L.has(O.key)?{...O,soldOut:!0}:O),zones:I,selectedCategory:this.baCat,selectedZone:this.baZone}))}let h=(f,I,L,O=1,N,M,G,q)=>Lr({categoryLabel:G,offerName:q,d:f?this.controller.seatDetails(f):null,area:L==="ga"?t.find(X=>X.id===N):void 0,label:I,objectType:L,quantity:O,identity:M,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),m=B,u=[];for(let f of ea(i)){let I=f.objectType==="ga"?`held:ga:${f.objectId}:${f.tierId??""}`:`held:${f.label}`;l.add(I);let L=f.objectType!=="ga"?this.controller.seatByLabel(f.label):null,O=this.performanceGroup?.packagePricing?f.categoryKey||L?.categoryKey||"":f.categoryKey,N=this.controller.doc?.categories.find(Ge=>Ge.key===O),M=this.performanceGroup||this.suppressPricing?null:Kl(this.controller,f),G=this.performanceGroup?.packagePricing?.seat(f.label,O),q=(f.tierId&&!M?N?.tiers?.find(Ge=>Ge.id===f.tierId)?.name:void 0)??G?.types?.options.find(Ge=>Ge.id===G.types?.selected)?.name,X=this.offerPrice(f.categoryKey,f.tierId??null)?.offerName,me=f.objectType==="table"?this.controller.tableSelection(f.label):null,fe=L?this.controller.seatDetails(L.id):null,ye=this.seatViewEnabled()&&!!L&&f.objectType!=="table"&&!!this.deliverableViewReference(L),Ke=m(this.tf("picker.heldForYou","Held for you")),V=(me?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(f.label))}">${m(D("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+(M?`<select class="tier" data-held-tier="${m(f.label)}" aria-label="${m(D("picker.ticketTierFor",{label:f.label}))}">${ui(M,f.tierId??void 0,m)}</select>`:""),Ot=this.heldPrice(f)*(f.quantity??1);u.push({key:I,fresh:!this.lastTrayKeys.has(I),held:!0,seatIds:[],heldLabels:f.labels,removeAria:D("picker.removeHeldTicketLabel",{label:Oo(f,t)}),locateId:L?.id??null,section:fe?.sectionLabel??"",rowLabel:fe&&Q(fe)||"",seatLabel:fe?.seatNumber??f.label,categoryLabel:`${N?.label??O}${q?` \xB7 ${q}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(O)??N?.color??"",identityHtml:h(L?.id??null,f.label,f.objectType,f.quantity??1,f.objectId,me??void 0,`${N?.label??O}${q?` \xB7 ${q}`:""}`,X),stateHtml:`<span class="sl-ticket-state held" aria-label="${Ke}" title="${Ke}"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></span>`,extrasHtml:V,amount:Ot,amountText:G?G.amountText:this.suppressPricing?"":this.money(Ot),noteHtml:ut(L??void 0),railHtml:this.performanceGroup?"":Ao(D("picker.removeHeldTicketLabel",{label:Oo(f,t)}),ye?f.label:null)})}let g=this.seatViewEnabled();for(let f of e.filter(I=>!o.has(I.label))){let I=`seat:${f.id}`;l.add(I);let L=this.controller.doc?.categories.find(V=>V.key===f.categoryKey),O=this.performanceGroup?.packagePricing?.seat(f.label,f.categoryKey),N=O?.types?`<select class="tier" data-season-type="${m(f.label)}" aria-label="${m(D("picker.ticketTierFor",{label:f.label}))}">`+ui(O.types.options,O.types.selected,m)+"</select>":f.tiers&&f.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${m(f.id)}" aria-label="${m(D("picker.ticketTierFor",{label:f.label}))}">`+ui(f.tiers,f.tierId,m)+"</select>":"",M=f.tiers?.find(V=>V.id===f.tierId)??f.tiers?.[0],G=this.offerPrice(f.categoryKey,M?.id??null)?.offerName,q=M?.buyerMessage?.trim()||(M?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),X=this.controller.seatDetails(f.id),me=m(this.tf("picker.selected","Selected")),fe=D("picker.removeSeatLabel",{label:f.label}),ye=(f.objectType==="table"&&f.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${m(encodeURIComponent(f.label))}">${m(D("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+N,Ke=this.paidPrice(f.categoryKey,f.tierId??null,f.price,f.label)*(f.quantity??1);u.push({key:I,fresh:!this.lastTrayKeys.has(I),held:!1,seatIds:[f.id],heldLabels:[],locateId:f.id,section:X?.sectionLabel??"",rowLabel:X&&Q(X)||"",seatLabel:X?.seatNumber??f.label,categoryLabel:L?.label??f.categoryKey,identityHtml:h(f.id,f.label,f.objectType,f.quantity??1,f.objectId,f,L?.label??f.categoryKey,G),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??L?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${me}" title="${me}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:ye,amount:Ke,amountText:O?O.amountText:this.suppressPricing?"":this.money(Ke),removeAria:fe,noteHtml:ut(f)+(q?`<small class="sl-tier-note">${m(q)}</small>`:""),railHtml:Ao(fe,g&&f.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(f.label)??{})?f.label:null)})}u.length&&a.push(u.map(Mr).join("")),t.length&&a.push(ra(this,t,i)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let b=this.performanceGroup?.selectNight;b&&xl(this.els.tray,f=>b(f)),this.els.tray.querySelectorAll("[data-ba]").forEach(f=>{f.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(f.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",f=>{this.baCat=f.target.value,this.scheduleFit()}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",f=>{this.baZone=f.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.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(f=>{f.addEventListener("click",()=>{let I=f.closest(".sl-chip");if(I.dataset.held){this.removeHeldLabels(decodeURIComponent(I.dataset.held).split(`
3348
+ `),I);return}let L=I.dataset.seat.split(" "),O=()=>{this.controller.deselect(L)};if(this.reducedMotion()){O();return}I.classList.remove("sl-enter"),I.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(O,te.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(f=>{f.addEventListener("click",I=>{I.stopPropagation();let L=decodeURIComponent(f.dataset.tableEdit??""),O=this.controller.tableSelection(L);if(!O)return;let N=i.find(M=>M.label===L&&M.objectType==="table");this.showTableDialog({...O,quantity:N?.quantity??O.quantity},!!N,f)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(f=>{f.addEventListener("change",()=>{let I=f.dataset.seasonType,L=this.performanceGroup?.packagePricing;I&&L?(L.setType(I,f.value),this.syncTray()):f.dataset.heldTier?this.changeHeldTier(f,f.dataset.heldTier):this.controller.setSeatTier(f.dataset.tier,f.value||null)})}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(f=>{f.addEventListener("click",()=>{let I=this.controller.seatByLabel(f.dataset.viewLabel);I&&this.openSeatView(I)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(f=>{let I=()=>this.controller.flashSeat(f.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");f.addEventListener("mouseenter",I),f.addEventListener("focusin",I),f.addEventListener("click",L=>{L.target.closest?.('button,a,select,[role="button"],input')||!this.controller.focusSeats?.([f.dataset.locate],{animate:!this.reducedMotion()})||I()})}),aa(this,this.els.tray,t),this.controller.setGASelection(Xr(this.gaQty)),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(f=>{f.disabled=!0});let T=this.pendingSelectionCount(),S=this.lastTrayCount,x=this.lastTrayTotal,P=wl(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat"),_=r?this.performanceGroup?.packagePricing?.total([...i.filter(f=>f.objectType!=="ga"),...e.filter(f=>!o.has(f.label))].map(f=>({label:f.label,categoryKey:f.categoryKey||this.controller.seatByLabel(f.label)?.categoryKey||""}))):null;this.els.count.textContent=_?.countText||P||(r?_n("picker.ticketsCount",r)+(this.suppressPricing?"":this.feeWords().tray(i,r,s)):this.salesUi?.view(this)?this.closedWords().pill:this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=_?_.amountText:r&&!this.suppressPricing?this.money(s):"",this.root?.setAttribute("data-has-selection",String(r>0)),this.sheetState()==="mini"&&r===0?this.setSheetState("mini"):r>S&&this.root?.dataset.layout==="narrow"?this.setSheetState("mini"):this.syncSheetAffordance(),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy)),this.els.seatSummary&&(this.els.seatSummary.textContent=P||(r?_n("picker.seatsSelectedCount",r):"")),this.syncCta(r,T);let R=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";r!==S&&!R&&this.animateOnce(this.els.count,"sl-value-pop",380),s!==x&&!R&&this.animateOnce(this.els.total,"sl-value-pop",380),S===0&&r>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.lastTrayCount=r,this.lastTrayTotal=s,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(r,e),this.scheduleFit()}scheduleFit(){if(this.fitScheduled||this.destroyed)return;this.fitScheduled=!0;let e=()=>{this.fitScheduled=!1,this.destroyed||this.fitTranslatedRows()};typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}fitTranslatedRows(){Da(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(Ba),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(Fa),Va(this.els.tray?.querySelector("select.sl-ba-cat"))}emitSelectionValidity(e,t){let i=this.controller.getSelectionValidity(e);i&&(i.seats=t,this.opts.onSelectionValidityChange?.(i),i.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(i),this.lastSelectionValidity=i.isValid)}async removeHeldLabels(e,t){let i=e.filter(r=>r&&!this.releasingLabels.has(r));if(!i.length)return!1;let o=i[0];i.forEach(r=>this.releasingLabels.add(r)),t?.setAttribute("aria-busy","true");let s=t?.querySelector(".rm");s&&(s.disabled=!0);try{let r=this.handedOff;if(!await this.controller.releaseLabels(i))return this.toast(D("picker.couldNotRemoveLabel",{label:o}),"error"),!1;ta(this.gaQty,this.hold?.items??[],i);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&r,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{i.forEach(r=>this.releasingLabels.delete(r)),t?.removeAttribute("aria-busy"),s?.isConnected&&(s.disabled=!1)}}async holdSelection(){return this.ctaPhase!=="idle"?Qe("busy",this.tf("picker.securingSeats","Securing your seats\u2026")):!this.hold&&this.totalTicketCount()===0?Qe("nothing_selected",this.tf("picker.selectSeats","Select seats")):this.handleCta(!1)}async handleCta(e=!0){if(this.salesClosed&&!this.finishingHold())return Qe("sales_closed",this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."));let t=this.controller.getSelectionValidity(this.totalTicketCount());if(t&&!t.isValid){let o=oo(t,(s,r)=>this.tf(s,r));return this.toast(o,"warning"),Qe("selection_invalid",o)}if(this.totalTicketCount()>this.maxTickets){let o=D("picker.removeTicketsUntilOrFewer",{count:this.maxTickets});return this.toast(o,"warning"),Qe("too_many_tickets",o)}let i=this.committedSelection();if(this.hold&&(this.salesClosed||!i.some(o=>!(this.hold.items??[]).some(s=>s.label===o.label)))){let o=this.hold.seats??i;return this.handedOff=!0,this.holdConflicted=!1,e&&await this.runCheckoutHandoff(this.hold,o),{ok:!0,hold:this.hold,seats:o}}this.holdingLabels=new Set(i.map(o=>o.label)),this.setCtaPhase("holding");try{let o=null,s=Zr(this.gaQty),r=this.committedSelection();if(r.length){let a=await this.controller.hold(void 0,this.opts.holdTtlMs);o=a?{holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}:null}for(let{areaId:a,tierId:l,qty:c}of s){let d=await this.controller.holdGA(a,c,{tierId:l,ttlMs:this.opts.holdTtlMs});o=d?{holdId:d.holdId,expiresAt:d.expiresAt,seats:d.seats,items:d.items}:o}if(!o){let a=this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");return this.raiseHoldConflict(a),this.setCtaPhase("idle"),this.syncTray(),Qe("seats_taken",a)}return this.hold=o,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(o.expiresAt),this.flashHeldSeats(o),this.emitHoldChange(),this.performanceGroup||!e?this.setCtaPhase("idle"):await this.runCheckoutHandoff(o,o.seats??r),{ok:!0,hold:o,seats:o.seats??r}}catch(o){this.opts.onError?.(o);let s=Wo(o);if(s)return this.toast(s,"warning"),this.setCtaPhase("idle"),Qe("paused",s);let r=o,a=(r.conflicts??[]).map(d=>d.label).filter(Boolean).slice(0,3);r.reason==="event_closed"&&this.setSalesClosed(!0);let l=r.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):r.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):r.reason==="ticket_option_not_applicable"?D("picker.ticketOptionNotApplicable"):a.length?a.length===1?D("picker.labelsNoLongerAvailable.one",{labels:a.join(", ")}):D("picker.labelsNoLongerAvailable.other",{labels:a.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(l),this.setCtaPhase("idle");let c=r.reason==="event_closed"?"sales_closed":r.reason==="companion_pair_required"||r.reason==="ticket_option_not_applicable"?r.reason:"seats_taken";return Qe(c,l,a.length?a:void 0)}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){Oc(this,e)}stopHoldTimer(){_c(this)}setExtendPrompt(e,t){Nc(this,e,t)}refreshExtendPrompt(){Dc(this)}handleExtend(){return Bc(this)}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.holdConflicted||this.controller.currentHold()===null&&this.showBooked()}settleBookedHold(e){this.hold?.holdId!==e||this.bookedShown||this.holdConflicted||(this.controller.clearHold(),this.showBooked())}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((o,s)=>o+s.quantity,0),i=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=i?.seats?`<span class="sl-booked-seats">${_n("picker.group.ticketsConfirmedAcross",i.seats,{performances:i.performances})}</span>`:`<span class="sl-booked-seats">${_n("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.els.bookedList&&(this.els.bookedList.innerHTML=e.lineItems.map(o=>{let r=[o.sectionLabel,o.rowLabel&&`${this.tf("picker.row","Row")} ${o.rowLabel}`,o.seatNumber&&`${this.tf("picker.seat","Seat")} ${o.seatNumber}`].filter(Boolean).join(" \xB7 ")||o.displayLabel||o.label,a=o.quantity>1?` <span class="sl-booked-qty">\xD7${o.quantity}</span>`:"";return`<li>${B(r)}${a}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0),this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.resetAfterBooking(),this.root?.focus({preventScroll:!0})}resetAfterBooking(){this.bookedShown=!1,this.hold=null,this.handedOff=!1,this.holdConflicted=!1,this.holdingLabels.clear(),this.gaQty.clear(),this.stopHoldTimer(),this.forgetHold(),this.clearSelection(),this.setCtaPhase("idle"),this.setSheetOpen(!1),this.syncTray(),this.syncCta(),this.emitHoldChange()}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let i=this.buildHandoff(e),o=null;try{o=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(a){this.opts.onError?.(a)}if(this.destroyed)return;let s=o?.bookingMode==="free",r=o?.providers?.[0]??null;if(!r&&!s){let a=ar(o?.reason),l=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:a,handoff:i}),this.opts.onCheckout?.(e,t,i),l||this.openCheckoutPanel({kind:"unavailable",reason:a,seatCount:lr(i)});return}await this.openCheckoutPanel(cr(i,r,o,this.pubApi.ticketKeysFor(e.holdId),this.controller.getGAAreas()))}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await Bt())}catch(i){this.opts.onError?.(i),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=t({root:this.root,state:e,eventKey:this.opts.event,event:{name:this.els.name?.textContent||null,detail:this.els.meta?.textContent||null},formatMoney:i=>this.money(i),t:D,startSession:i=>this.pubApi.startCheckout(this.opts.event,{...i,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:i=>this.pubApi.orderStatus(i),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:i=>{this.opts.onOrderConfirmed?.(i),this.controller.refresh()},onError:i=>{dr(i)&&(this.paymentOptions=null),i?.code==="seats_unavailable"&&this.controller.refresh(),this.opts.onError?.(i)}}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let i=(e.items??[]).map(r=>{let a=this.controller.lineItemDisplay(r),l=r.objectType==="seat"||r.objectType==="booth"?this.controller.seatByLabel(r.label):null,c=l?this.controller.seatDetails(l.id):null,d=c?Q(c):void 0,h=this.controller.doc?.categories.find(g=>g.key===r.categoryKey),m=r.tierId?h?.tiers?.find(g=>g.id===r.tierId)?.name:void 0,u=this.heldPrice(r);return{label:r.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},...c?.sectionLabel?{sectionLabel:c.sectionLabel}:{},...d?{rowLabel:d}:{},...c?.seatNumber?{seatNumber:c.seatNumber}:{},...h?.label?{categoryLabel:h.label}:{},...m?{tierLabel:m}:{},objectId:r.objectId,objectType:r.objectType,categoryKey:r.categoryKey,tierId:r.tierId,unitPrice:u,...Xa(r,u),currency:r.currency??this.currency,quantity:r.quantity??1}}),o=i[0]?.currency??this.currency,s=i.reduce((r,a)=>r+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:o,lineItems:i,total:s}}emitHoldChange(){let e=this.hold;this.realtime?.watchHold(e?.holdId??null),this.syncSelectionTo3d(),this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",i){let o=this.els.toast;if(!o)return;o.replaceChildren();let s=document.createElement("span");if(s.textContent=e,o.appendChild(s),o.classList.toggle("has-action",!!i),i){let r=document.createElement("button");r.type="button",r.className="sl-toast-action",r.textContent=i.label,r.addEventListener("click",i.onClick,{once:!0}),o.appendChild(r)}o.dataset.tone=t,o.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{o.classList.remove("on","sl-mo-rise"),o.classList.remove("has-action"),o.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),i=this.confirmEl;if(!t||!i?.isConnected){e.style.removeProperty("bottom");return}let o=this.els.map.clientHeight;if(o<=0)return;let s=i.getBoundingClientRect(),r=s.height||i.offsetHeight||nf,a=s.height?s.top-this.els.map.getBoundingClientRect().top:o-Jo-r,l=Math.round(o-a+ef);if(l+tf>o){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){this.handoverMs===null&&this.renderResolvedAt!==null&&(this.handoverMs=performance.now()-this.renderResolvedAt),Dl({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},i=this.tipPinned?Tl(this.tipPos,e,t):null,o=i??Sl(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${o.left}px`,this.tipEl.style.top=`${o.top}px`,i?this.tipEl.dataset.placement=i.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let i=this.performanceGroup,o=Xo(e.mark,i?.nights?.()),s=o?.states.filter(r=>r.free).length??0;return pl(o,{locale:this.opts.locale,switchLabel:i?.selectionModeSwitch?.label??null,selectPartialLabel:i?.partialSeatSelection?.label(s)??null,pinned:t,words:i?.partialWords})}unpinTooltip(){this.tipPinned&&(this.tipPinned=!1,this.tipEl?.classList.remove("sl-tip-pinned"),this.tipEl&&(this.tipEl.style.display="none"))}handleMapPointerDown(e){if(this.tipEl?.contains(e.target))return;this.lastMapPoint={x:e.clientX,y:e.clientY},this.lastPointerType=e.pointerType||"mouse";let t=this.els.map.getBoundingClientRect();this.tipPos={x:e.clientX-t.left,y:e.clientY-t.top},this.unpinTooltip()}closeInfoPops(e){this.root?.querySelectorAll(".sl-info.open").forEach(t=>{t!==e&&(t.classList.remove("open"),t.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false"))})}updateTooltip(e){if(!this.tipEl)return;if(this.confirmSeat){this.tipEl.style.display="none";return}if(this.tipPinned&&e?.interaction!=="press")return;if(!e){this.tipPinned||(this.tipEl.style.display="none",this.tipMarkedHoverLabel=null);return}let t=e.mark?.kind==="partial"&&this.tipMarkedHoverLabel===e.label;if(e.interaction!=="press"&&this.lastPointerType==="mouse"&&!e.mark&&!this.tipPinned){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}if(e.unavailable&&e.status==="free"&&e.interaction==="press"){this.toast(this.tf("picker.turnOffAccessibilityFilter","Turn off the wheelchair filter to pick this seat"),"neutral"),this.tipEl.style.display="none";return}if(e.unavailable&&!e.mark){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}let i=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t);this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let o=this.nightStripFor(e,i);this.tipEl.style.setProperty("--sl-cat",e.categoryColor);let s=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),r=this.performanceGroup?.packagePricing?.seatCardPrice(e.categoryKey)??null;this.tipEl.innerHTML=kl(e,{price:r?r.price:this.suppressPricing?"":this.money(s),feeNote:r?r.note:this.suppressPricing?"":this.feeWords().seat(s),priceNote:r||!this.suppressPricing?"":this.performanceGroup?.surface==="season"?D("picker.season.includedInPackage"):this.tf("picker.group.pricesPerPerformance","Prices shown per performance"),rowTypeWord:yt(e),ownHold:this.controller.currentHold()?.labels.includes(e.label)===!0,extra:o+(i?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${B(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=i,this.tipEl.classList.toggle("sl-tip-pinned",i),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),Al(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,a=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,a)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let i={};for(let[o,s]of Object.entries(e())){let r=this.controller.idForLabel(o);r&&(i[r]=s,s?this.markedSeatIds.add(r):this.markedSeatIds.delete(r))}Object.keys(i).length&&t.setSeatMarks(i)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),i=this.controller.getSelection().filter(o=>t.has(o.id)||t.has(o.label));if(i.length===t.size)return i;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=Qn(this.themeMode),i=He(this.controller.doc?.theme,this.opts.theme,t,this.performanceGroup?.brandAccent);for(let[o,s]of Object.entries(i))e.style.setProperty(o,s);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Jn(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(_t(this.opts.theme,this.themeMode)),this.applyMapChromeTokens(),this.minimap?.refreshMinimap(),this.syncPrices())}setThemeMode(e){this.destroyed||e===this.themeMode||(this.themeMode=e,this.opts.theme={...this.opts.theme??{},...e?{mode:e}:{mode:void 0}},this.watchThemeMode(),this.repaintForThemeMode(),this.emitAnalytics("theme_mode_changed",{mode:e,resolved:Qn(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Qn(this.themeMode),i=He(this.controller.doc?.theme,this.opts.theme,t,this.performanceGroup?.brandAccent),o=_t(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,s=Fs(i,o);for(let r of Bs)s?e.style.setProperty(r,s[r]):e.style.removeProperty(r)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){this.hostPricing=e;let t=Ga(e?.prices,this.offerAvailability),i=Object.keys(t).length>0||e?.formatter||e?.objects?{prices:t,...e?.objects?{objects:e.objects}:{},...e?.formatter?{formatter:e.formatter}:{}}:void 0;JSON.stringify(this.opts.pricing??null)!==JSON.stringify(i??null)&&(this.opts.pricing=i,!(this.destroyed||!this.els.prices||!this.currencyResolved)&&(this.syncMapPriceRanges(),this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=Fr(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=this.localeGeneration+=1,i=await Wm(e);return this.opts.messages&&Ym(this.opts.messages),i===this.paintedLocale||this.applyActiveLocale(i,t),i}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(this.paintedLocale=e,Vr(e,{root:this.root,painters:[()=>this.syncTray(),()=>this.syncPrices(),()=>this.syncOffer(),()=>this.syncRung(),()=>this.syncFloors(),()=>this.syncPanelToggle(),()=>this.syncFullscreenButtons(),()=>this.syncTestBadge()],refreshMapCopy:()=>this.controller.refreshMapCopy(),languageSelect:this.langSel}),this.scheduleFit())}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),this.minimap?.refreshMinimap(),sf(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??"flat"}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,t??{})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}getBuyerView(){return Jl(this)}setBuyerView(e,t){ec(this,e,t)}seatState3dFor(e){return tc(this,e)}pushAvailabilityTo3d(){nc(this)}syncSelectionTo3d(){oc(this)}seatViewFor3d(e){return rc(this,e)}onView3dSeatPick(e){ac(this,e)}seatViewCaption(e){return lc(this,e)}saveView3dComparisonSeat(e){cc(this,e)}clearView3dComparison(){dc(this)}view3dComparisonSnapshot(e){return pc(this,e)}enter3d(e){return hc(this,e)}publish3dTopInset(){uc(this)}exit3d(){mc(this)}openSeatConfidencePassport(e,t=null){rs(this,e,t)}closeSeatConfidencePassport(e=!0){In(this,e)}openView3dComparison(){Yl(this)}closeView3dComparison(e=!0){vt(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async changeHeldTier(e,t){e.disabled=!0;try{let i=await Gl(this.controller,t,e.value,this.opts.holdTtlMs);i&&(this.hold={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items},this.startHoldTimer(i.expiresAt),this.emitHoldChange())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.ticketTypeNotChanged","That ticket type is not available for this seat. Your hold is unchanged."),"error")}finally{this.syncTray()}}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,i={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,i)}catch(o){this.opts.onError?.(o);let s=Wo(o);if(s)return this.toast(s,"warning"),null;let r=o?.reason,a=r==="not_enough_together"?D("picker.couldNotFindSeatsTogether",{count:e}):r==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):r==="ticket_option_not_applicable"?D("picker.ticketOptionNotApplicable"):r==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):r==="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(a,"error"),null}}async bestAvailableOrThrow(e,t,i={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");let o=fi(this.controller,t);if(o)throw o;this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let s=this.els.tray?.querySelector(".sl-ba-go");s&&(s.disabled=!0,s.classList.add("sl-busy"),s.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let r=await this.controller.bestAvailable(e,t,{...i,ttlMs:this.opts.holdTtlMs});return r?(this.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(r.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),i.preferPremium&&r.seats.length&&!r.seats.every(a=>a.commercial?.premium)&&this.toast(D("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),i=!0;if(t)i=await this.controller.release();else if(e){let o=[...new Set([...(e.items??[]).map(s=>s.label),...(e.seats??[]).map(s=>s.label)])];if(o.length)try{await this.api.release(this.opts.event,o,e.holdId)}catch(s){this.opts.onError?.(s),i=!1}}if(!i){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(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new Ie({url:()=>this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},onIdleExpired:()=>il(this.idlePauseHost),heldHoldId:()=>this.hold?.holdId??null,onHoldState:(t,i)=>{i==="booked"&&this.settleBookedHold(t)},sink:{...vn(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,i)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:i}),this.syncTray(),this.toast(i==="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")}}),onSales:t=>this.salesNotice(t)}}),this.realtime.start()}async refreshAccess(){return!this.access?.configured||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}clearDecisionSurfaces(){this.dismissConfirm(),this.dismissTableDialog(!1),Ce(this,!1)}showAccessPanel(e){if(this.loadAbort&&e.reason==="provider_failed"||this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=Er(e.reason,e.reason==="idle"?()=>this.resumeFromIdle():()=>this.recoverAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}async recoverAccess(){return await this.refreshAccess()?!0:(this.opts.onAccessUnavailable||typeof window>"u"||window.location.reload(),!1)}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}get idlePauseHost(){return this}startIdleClock(e){return el(this.idlePauseHost,e)}resumeFromIdle(){return nl(this.idlePauseHost)}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=td({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let i=t.filter(r=>r.objectType!=="ga"),o=[],s=[];for(let r of i){let a=this.controller.seatByLabel(r.label);(a&&this.controller.getStatus(a.id)==="free"?o:s).push(r.label)}ed(e,{recoverable:o,taken:s,onRecover:r=>this.recoverAfterHoldExpiry(r)})}).catch(()=>{})}recoverAfterHoldExpiry(e){this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.select(e),this.syncTray(),this.handleCta()}dismissHoldExpired(){this.holdExpiredEl?.remove(),this.holdExpiredEl=null}restartAfterHoldExpiry(){let e=this.holdExpiredUnits;this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.overview(),this.syncTray(),this.syncCta(),this.root?.focus({preventScroll:!0});let t=this.holdExpiredFresh;this.holdExpiredFresh=!1,(t?Promise.resolve():this.refreshAvailability()).then(()=>{this.destroyed||Jc({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:i=>this.controller.seatByLabel(i),statusOf:i=>this.controller.getStatus(i),flash:(i,o)=>this.controller.flashSeat(i,o)},e)}).catch(()=>{})}destroy(){this.transportAbort.abort(),this.loadAbort?.abort(),this.loadAbort=null,this.destroyed=!0,is(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.idleClock?.dispose(),this.idleClock=null,this.dismissAccessPanel(),this.dismissHoldExpired(),this.access?.clear(),this.hold&&!this.handedOff&&this.opts.holdOnClose!=="keep"&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),Ce(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerCountdownTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.viewportResizeHandler&&window.removeEventListener("resize",this.viewportResizeHandler),this.viewportResizeHandler=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,this.root?.remove(),this.root=null,this.modalCleanup?.(),this.closeModal=null}};function rf(n){Je.prewarm(n)}import{formatMoney as kf,loadLocale as Sf,setStringOverrides as Tf,t as Ef}from"@seatlayer/core";var hd="seatlayer-performance-group-picker-style";function ud(){if(document.getElementById(hd))return;let n=document.createElement("style");n.id=hd,n.textContent=`
3352
3349
  .sl-pg-root{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;min-width:0;max-width:100%;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
3353
3350
  .sl-pg-head{display:grid;gap:8px;padding:16px 18px;border:1px solid var(--sl-line,#dde3ea);border-radius:14px;background:var(--sl-surface,#fff)}
3354
3351
  .sl-pg-head h2{font:700 20px/1.25 inherit;margin:0}.sl-pg-summary{margin:0;color:var(--sl-muted,#627081);font-size:14px}
@@ -3408,20 +3405,100 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3408
3405
  @media(min-width:900px){.sl-pg-legend-list{justify-content:flex-start}}
3409
3406
  .sl-pg-live{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
3410
3407
  @media(max-width:640px){.sl-pg-head{padding:13px 14px}.sl-pg-head h2{font-size:18px}.sl-pg-inner{min-height:590px}}
3411
- `,document.head.appendChild(i)}var Bu="https://api.seatlayer.io",Fu=6e4,Vu=2e3,$u=1e3,zu=36e5,ju=5e3,Gu=5e3,Ku=15e3,Uu=12e4,qu=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),Q=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function Wu(i){return new Promise(e=>setTimeout(e,i))}function Eo(i){let e=Number(i.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(ju,e*1e3)):1e3}function Nt(i,e){return`/pub/performance-groups/${encodeURIComponent(i)}/operations/${encodeURIComponent(e)}`}function li(i){return i.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var Co=class{constructor(e,t,n){this.api=e;this.sink=t;this.intervalMs=n;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),o=[...new Set([...this.prior.keys(),...t.keys()])].filter(s=>this.prior.get(s)!==t.get(s)).map(s=>({label:s,status:t.get(s)??"blocked"}));this.prior=t,o.length&&this.sink.applyStatuses(o),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof Q){this.stop();return}if(Di(e)){this.stop(),this.api.sessionEnded(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Cn=class{constructor(e,t){this.descriptorCache=null;this.chartRequest=null;this.objectsCache=null;this.objectsEtag=null;this.activePerformanceKey=null;this.includedEventKeys=new Set;this.reuseObjectsCacheOnce=!1;this.selectionsByEvent=new Map;this.allocationsByHold=new Map;this.pendingOperationId=null;this.operationByHold=new Map;this.knownRevision=null;this.destroyed=!1;this.aborter=new AbortController;this.adoptFailure=null;this.settleTimer=null;this.settleOperationId=null;this.settleStartedAt=0;this.settleState=null;this.settleVisibility=null;this.lastRecovery={kind:"idle"};this.seededDescriptor=null;if(!e)throw new Error("seatlayer: `performanceGroup` key is required");this.groupKey=e,this.base=(t.apiBase??Bu).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??Fu,this.realtimePollMs=Math.max(500,t.realtimePollMs??Vu),this.selectionMode=t.selectionMode??"same_seat",this.partySize=t.partySize??null,this.onOperationState=t.onOperationState,this.onRecoveryState=t.onRecoveryState,this.onAvailability=t.onAvailability,this.onSessionEnded=t.onSessionEnded,this.access.onRenewed(o=>this.adoptSession(o));let n=this.readOperationRecord();n&&this.storedIsUndecided(n)&&(this.pendingOperationId=n.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}seedDescriptor(e){e.key===this.groupKey&&Array.isArray(e.performances)&&(this.seededDescriptor=e)}async descriptor(){let e=this.seededDescriptor;this.seededDescriptor=null;let t=e?{performanceGroup:e}:await this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/descriptor`);return this.descriptorCache=t.performanceGroup,this.includedEventKeys.size||(this.includedEventKeys=new Set(t.performanceGroup.performances.map(n=>n.eventKey))),t.performanceGroup.revision&&(this.knownRevision=t.performanceGroup.revision),this.activePerformanceKey??=t.performanceGroup.performances[0]?.eventKey??null,t.performanceGroup}async chart(e){this.chartRequest??=this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/chart`).catch(o=>{throw this.chartRequest=null,o});let[t,n]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:n,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new V(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",n=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let r=await this.authorized(n,this.objectsCache&&this.objectsEtag?{headers:{"If-None-Match":this.objectsEtag}}:{});if(r.status===304)this.objectsCache||(this.objectsEtag=null);else{if(!r.ok)return this.throwResponse(r);this.objectsCache=await this.responseJson(r),this.objectsEtag=r.headers.get("ETag")}}if(!this.objectsCache)throw new V(502,"group_projection_unavailable","group_projection_unavailable");if(this.selectionMode==="same_seat"&&!t){let r=this.objectsCache;return this.noteAvailability(r,r.salesClosed,r),r}let o=this.objectsCache;if(this.selectionMode==="same_seat"){let r=o.performances.filter(u=>this.includedEventKeys.has(u.eventKey));if(!r.length)throw new V(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(r[0]?.seats??{}),l=Object.fromEntries(a.map(u=>[u,r.every(m=>m.seats[u]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(u=>{let m=r.filter(p=>p.seats[u]!=="free").map(p=>p.eventKey);return m.length>0&&m.length<r.length?[[u,m]]:[]})),d={seats:l,partial:c,hidden:[...new Set(r.flatMap(u=>u.hidden??[]))],closed:[...new Set(r.flatMap(u=>u.closed??[]))],revision:o.revision,state:o.state,salesClosed:r.some(u=>u.salesClosed)};return this.noteAvailability(o,d.salesClosed,d),d}let s=o.performances.find(r=>r.eventKey===this.activePerformanceKey);if(!s)throw new V(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(o,o.salesClosed||o.performances.some(r=>r.salesClosed),s),s}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new V(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=null,this.objectsEtag=null,this.selectionsByEvent.clear(),this.activePerformanceKey=this.descriptorCache?.performances[0]?.eventKey??this.activePerformanceKey)}setActivePerformance(e){if(this.descriptorCache&&!this.descriptorCache.performances.some(t=>t.eventKey===e))throw new V(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(n=>n.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(n=>!t.has(n)))throw new V(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(n=>({...n})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(n=>({...n}))}))}async hold(e,t,n,o){if(this.assertUsable(),o)throw new V(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let s=t.map(c=>c.label),r={labels:s};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(r.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new V(409,"group_selection_incomplete","group_selection_incomplete");this.setPerformanceSelections(this.activePerformanceKey,t);let c=this.descriptorCache.performances.filter(d=>this.includedEventKeys.has(d.eventKey)).map(d=>({eventKey:d.eventKey,selections:this.selectionsByEvent.get(d.eventKey)??[]}));if(c.some(d=>d.selections.length!==this.partySize))throw new V(409,"group_selection_incomplete","group_selection_incomplete");r={selectionMode:"per_performance",allocations:c,...this.descriptorCache.inclusionMode==="flexible_dates"?{eventKeys:this.includedPerformanceKeys()}:{}}}let a=this.pendingOperationId??`pghop_${crypto.randomUUID()}`;this.beginOperation(a),this.onOperationState?.({operationId:a,state:"preparing",decision:null});let l;try{l=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/hold`,{method:"POST",body:JSON.stringify({operationId:a,...r,...n?{ttlMs:n}:{}})})}catch(c){if(c instanceof Q)throw c;if(c instanceof W)throw this.failOperation(a),c;return this.recover(a,s,Date.now()+this.recoveryTimeoutMs)}if(l.status===201||l.status===202||l.status===504){let c=await this.responseJson(l);return this.emit(c.operation),l.status===201?this.complete(c.operation):this.recover(a,s,Date.now()+this.recoveryTimeoutMs,Eo(l))}if(l.status===503){let c=await l.clone().json().catch(()=>null);if((c?.code??c?.error)==="performance_group_abort_pending"){let d=c?.operation?.operationId??a;return this.beginOperation(d),c?.operation&&this.emit(c.operation),this.recover(d,s,Date.now()+this.recoveryTimeoutMs,Eo(l))}}try{return await this.throwResponse(l,s)}catch(c){throw this.failOperation(a),c}}async release(e,t,n){this.assertUsable();let o=this.operationForHold(n),s=await this.json(`${Nt(this.groupKey,o)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(n),this.allocationsByHold.delete(n),this.clearOperationRecord(),s}async resume(e,t){this.assertUsable();let n=this.operationForHold(t),o=await this.json(Nt(this.groupKey,n));return this.complete(o.operation)}async extend(e,t,n=12e4){this.assertUsable();let o=this.operationForHold(t),s=Math.max($u,Math.min(zu,Math.round(n))),r=await this.json(`${Nt(this.groupKey,o)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:s})}),a=this.complete(r.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}async paymentOptions(){let e=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/payment-options`);return e.status===409?null:e.ok?this.responseJson(e):this.throwResponse(e)}async checkout(e){return this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/checkout`,{method:"POST",body:JSON.stringify(e)})}async orderStatus(e){let t=await this.fetcher(`${this.base}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit",signal:this.aborter.signal});return t.ok?t.json():this.throwResponse(t)}bestAvailable(){return Promise.reject(new V(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new Co(this,t,this.realtimePollMs)}sessionEnded(e){this.destroyed||this.onSessionEnded?.(e)}operationIdForHold(e){return this.operationByHold.get(e)??this.readMapping(e)}rememberOperation(e,t){!e||!t||(this.operationByHold.set(e,t),this.writeMapping(e,t))}async restoreOperation(){let e=this.readOperationRecord();if(!e)return null;if(!this.storedIsUndecided(e)&&e.state!=="committed"&&e.state!=="booked")return this.clearOperationRecord(),null;this.pendingOperationId=e.operationId,this.emitRecovery({kind:"pending",operationId:e.operationId,phase:e.state==="undecided"?"unknown":e.state,longRunning:!1,reference:li(e.operationId)});let t;try{t=await this.authorized(Nt(this.groupKey,e.operationId))}catch(s){return s instanceof Q||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let n=await this.responseJson(t);this.emit(n.operation);let o=n.operation.state;return o==="committed"||o==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(n.operation)):o==="aborted"||o==="expired"?(this.failOperation(e.operationId),null):this.recover(e.operationId,[],Date.now()+this.recoveryTimeoutMs)}async retryRecovery(){this.assertUsable();let e=this.pendingOperationId??this.readOperationRecord()?.operationId??null;return e?(this.pendingOperationId=e,this.recover(e,[],Date.now()+this.recoveryTimeoutMs)):null}watchSettlement(e){if(this.destroyed)return;let t=this.operationIdForHold(e);!t||t===this.settleOperationId||(this.stopSettlementWatch(),this.settleOperationId=t,this.settleStartedAt=Date.now(),this.settleState="committed",typeof document<"u"&&(this.settleVisibility=()=>{document.hidden||!this.settleOperationId||this.pollSettlement()},document.addEventListener("visibilitychange",this.settleVisibility)),this.scheduleSettlementPoll())}stopSettlementWatch(){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null,this.settleOperationId=null,this.settleState=null,this.settleVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",this.settleVisibility),this.settleVisibility=null}scheduleSettlementPoll(){if(this.destroyed||!this.settleOperationId)return;if(this.settleTimer&&clearTimeout(this.settleTimer),typeof document<"u"&&document.hidden){this.settleTimer=null;return}let t=Date.now()-this.settleStartedAt>=Uu?Ku:Gu;this.settleTimer=setTimeout(()=>{this.pollSettlement()},t)}settled(e){return e==="booked"||e==="expired"||e==="aborted"}async pollSettlement(){let e=this.settleOperationId;if(this.destroyed||!e)return;if(typeof document<"u"&&document.hidden){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null;return}let t;try{let o=await this.authorized(Nt(this.groupKey,e));if(!o.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(o)).operation}catch(o){return o instanceof Q?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let n=t.state!==this.settleState;if(this.settleState=t.state,n&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}n&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||qu.has(e.state)}writeOperationRecord(e){try{window.sessionStorage.setItem(this.operationRecordKey(),JSON.stringify(e))}catch{}}clearOperationRecord(){try{window.sessionStorage.removeItem(this.operationRecordKey())}catch{}}beginOperation(e){this.pendingOperationId=e;let t=this.readOperationRecord();this.writeOperationRecord({operationId:e,groupKey:this.groupKey,state:"undecided",createdAt:t?.operationId===e?t.createdAt:Date.now()})}noteOperationState(e,t){let n=this.readOperationRecord();!n||n.operationId!==e||this.writeOperationRecord({...n,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let o=0;o<2;o++){if(this.destroyed)return;try{if((await this.fetcher(`${this.base}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit",signal:this.aborter.signal})).ok){this.adoptFailure=null;return}}catch{}}if(this.destroyed)return;this.adoptFailure=new V(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let n=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:n,reference:n?li(n):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,n,o=100){let s=o,r=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=n;){if(this.destroyed)throw new Q;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=r,reference:li(e)}),await Wu(s),this.destroyed)throw new Q;let l;try{l=await this.authorized(Nt(this.groupKey,e))}catch(u){if(u instanceof Q)throw u;if(u instanceof W)throw this.recoveryFailed(e,"request_failed"),u;s=Math.min(2e3,Math.max(100,s*2));continue}if(l.status===404){s=Math.min(1e3,Math.max(100,s*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let d=(await this.responseJson(l)).operation;if(a=d.state,this.noteOperationState(e,d.state),this.emit(d),d.state==="committed"||d.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(d);if(d.state==="aborted"||d.state==="expired")throw this.failOperation(e),new V(409,"conflict","conflict",t.map(u=>({label:u,status:"held"})));s=Eo(l)}throw this.recoveryFailed(e,"deadline"),new V(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:li(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,n){if(this.destroyed||!this.onAvailability)return;let o=e.state??this.descriptorCache?.state??"active",s=e.revision??null,r=!!s&&!!this.knownRevision&&s!==this.knownRevision;s&&!this.knownRevision&&(this.knownRevision=s);let a=n?.partial??{},l=Object.values(n?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(n?.seats??{}).filter(c=>n.seats[c]!=="free"&&!(c in a)).length,state:o,salesClosed:!!t||o!=="active",revision:s,revisionChanged:r})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new V(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let n=t.find(o=>o.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:n??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new V(404,"group_hold_not_found","group_hold_not_found");return t}mappingKey(e){return`@seatlayer/performance-group-hold/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}/${encodeURIComponent(e)}`}readMapping(e){try{return window.sessionStorage.getItem(this.mappingKey(e))}catch{return null}}writeMapping(e,t){try{window.sessionStorage.setItem(this.mappingKey(e),t)}catch{}}assertUsable(){if(this.destroyed)throw new Q;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},n=!1){if(this.destroyed)throw new Q;if(this.adoptFailure)throw this.adoptFailure;let o={...t.headers};t.body!==void 0&&(o["Content-Type"]="application/json");let s=await this.access.authorization(n?"unauthorized":"initial");if(this.destroyed)throw new Q;if(this.adoptFailure)throw this.adoptFailure;if(!s)throw new Error("performance_group_buyer_access_required");o.Authorization=s;let r=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:o,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!n&&(r.status===401||r.status===403||r.status===422)){let a=await r.clone().json().catch(()=>null);if(await this.access.handleFailure(r.status,a?.code??a?.error,s))return this.authorized(e,t,!0)}return r}async json(e,t={}){let n=await this.authorized(e,t);return n.ok?this.responseJson(n):this.throwResponse(n)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let o=await e.json().catch(()=>null)??{},s=o.code??o.error??`request_failed_${e.status}`;throw e.status===409&&!o.conflicts?.length&&t.length&&(o.conflicts=t.map(r=>({label:r,status:"held"}))),new V(e.status,o.error??s,s,o.conflicts)}};import{formatMoney as Yu}from"@seatlayer/core";var Dt,st,ze,Bt,ci,je,vc,An,Pn=class{constructor(e){this.options=e;C(this,je);C(this,Dt,null);C(this,st,!1);C(this,ze,null);C(this,Bt,!1);C(this,ci,!1)}get mode(){return h(this,st)?"hosted":"handoff"}async prepare(){try{x(this,Dt,await this.options.api.paymentOptions()),x(this,st,!!h(this,Dt))}catch(e){x(this,st,!1),this.options.onError?.(e)}}async open(e,t){if(!h(this,st)||h(this,Bt))return;if(t.selectionMode!=="same_seat"){this.options.announce(b("picker.group.hostedPerPerformance","Seats chosen night by night can\u2019t be paid for on this page yet. Choose one seat for every date instead."));return}let n=h(this,Dt),o=t.seatLabels.length;if(n.bookingMode==="paid"&&!n.providers.length){await w(this,je,An).call(this,e,t.descriptor,{kind:"unavailable",reason:n.reason==="unavailable_for_run"?"unavailable_for_event":"not_configured",seatCount:o});return}x(this,Bt,!0);try{let{total:s,currency:r,lines:a}=w(this,je,vc).call(this,t.holdId,t.descriptor);await w(this,je,An).call(this,e,t.descriptor,{kind:"pay",provider:null,free:n.bookingMode==="free",order:{holdId:t.operationId,expiresAt:t.expiresAt,currency:r,total:s,labels:[...t.seatLabels],lines:a}})}finally{x(this,Bt,!1)}}resume(e,t,n){let o=_t(t);o?.outcome!=="success"||!o.orderId||w(this,je,An).call(this,e,n,{kind:"resume",orderId:o.orderId})}destroy(){x(this,ci,!0),h(this,ze)?.destroy(),x(this,ze,null)}};Dt=new WeakMap,st=new WeakMap,ze=new WeakMap,Bt=new WeakMap,ci=new WeakMap,je=new WeakSet,vc=function(e,t){let n=this.options.api.allocationsForHold(e),o=n.flatMap(a=>a.items)[0]?.currency??t.currency,s=0,r=n.map(a=>{let l=a.items.reduce((d,u)=>d+Math.round(u.unitPrice*100)*(u.quantity??1),0);s+=l;let c=t.performances.find(d=>d.eventKey===a.eventKey);return{label:a.items.map(d=>d.label).join(", "),detail:c?Ot(c,this.options.locale):null,amount:l/100}});return{total:s/100,currency:o,lines:r}},An=async function(e,t,n){let o;try{({mountCheckout:o}=await gt())}catch(r){this.options.onError?.(r),this.options.announce(b("picker.group.checkoutCouldNotOpen","Checkout could not be opened. Your seats are still held. Please try again."));return}if(h(this,ci)||!e)return;h(this,ze)?.destroy();let s=this.options.api;x(this,ze,o({root:e,state:n,eventKey:s.groupKey,event:{name:t.name,detail:b("picker.group.checkoutDates","{count} dates, one seat each").replace("{count}",String(t.performanceCount))},formatMoney:(r,a)=>Yu(r,a,{locale:this.options.locale,fallback:(l,c)=>`${l} ${c}`,...Number.isInteger(r)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:async r=>{let a=await s.checkout({operationId:r.holdId,buyerEmail:r.buyerEmail,...r.buyerName?{buyerName:r.buyerName}:{},...this.options.returnUrl?{returnUrl:this.options.returnUrl}:{}});return{orderId:a.orderId,totalMinor:a.totalMinor??0,currency:a.currency??t.currency,expiresAt:a.expiresAt??0,...a.redirectUrl?{redirectUrl:a.redirectUrl}:{},...a.status==="confirmed"?{status:"confirmed"}:{}}},orderStatus:r=>s.orderStatus(r),onCancel:()=>{x(this,ze,null)},onConfirmed:r=>this.options.onConfirmed?.(r),onError:r=>this.options.onError?.(r)}))};var Zu={audience_not_public:"audience_not_public",sales_not_open:"sales_not_open",invalid_origin:"origin_not_allowed"},Qu=3e4;function Xu(i,e){if(!i||typeof i!="object"||Array.isArray(i))return!1;let t=i;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.performanceGroupKey===e}var Ao=class extends Error{constructor(t,n){super(`performance_group_public_session_refused:${t}`);this.reason=t;this.status=n;this.name="PerformanceGroupPublicSessionRefused"}},Me,Ge,di,Ft,Po=class{constructor(e){this.options=e;C(this,Me,null);C(this,Ge,null);C(this,di);C(this,Ft);x(this,di,e.fetch??globalThis.fetch.bind(globalThis)),x(this,Ft,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return h(this,Me)}async mint(e=!1){if(e&&x(this,Me,null),h(this,Me)&&h(this,Me).expiresAt-Qu>Date.now())return h(this,Me);if(h(this,Ge))return h(this,Ge);let t=(async()=>{let n=await h(this,di).call(this,`${this.options.base}/pub/performance-groups/${encodeURIComponent(this.options.performanceGroup)}/sessions`,{method:"POST",body:JSON.stringify(h(this,Ft)?{origin:h(this,Ft)}:{}),credentials:"omit"}),o=await n.json().catch(()=>null);if(!n.ok){let s=o?.code??o?.error,r=n.status===403&&s?Zu[s]:void 0;throw r?(this.options.onRefused?.({reason:r,code:s,status:n.status,retryable:r==="sales_not_open"}),new Ao(r,n.status)):new Error(`performance_group_public_session_failed_${n.status}`)}if(!Xu(o,this.options.performanceGroup))throw new Error("performance_group_public_session_invalid");return x(this,Me,o),o})();x(this,Ge,t);try{return await t}finally{h(this,Ge)===t&&x(this,Ge,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.mint(t);return{token:n.token,expiresAt:n.expiresAt}}};Me=new WeakMap,Ge=new WeakMap,di=new WeakMap,Ft=new WeakMap;function wc(i){let e=new Po(i);return{access:new ae({provider:({reason:n})=>e.token(n),...i.accessHooks}),loader:e}}var xc="https://api.seatlayer.io";function kc(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var Lo=class{constructor(e){this.descriptorValue=null;this.picker=null;this.root=null;this.innerHost=null;this.tabsHost=null;this.prevButton=null;this.nextButton=null;this.heldSummary=null;this.live=null;this.statusHost=null;this.statusCopy=null;this.statusAction=null;this.rendered=!1;this.destroyed=!1;this.continued=!1;this.switchingPerformance=!1;this.operationPending=!1;this.recovery={kind:"idle"};this.availability=null;this.activePerformanceKey=null;this.selectionsByEvent=new Map;this.validByEvent=new Map;this.refreshingComposition=!1;this.activeHandoff=null;this.selectionModeValue="same_seat";this.progressHost=null;this.legendHost=null;this.paneHost=null;this.datesSummaryHost=null;this.datesCardsHost=null;this.resettingFlexibleSelection=!1;this.selectingPartialSeat=!1;this.partialSeatDates=new Map;this.markedLabels=new Set;this.holdTicker=null;this.switchingMode=!1;this.booked=!1;this.refusal=null;if(!e||typeof e!="object")throw new Error("seatlayer: options object is required");if(!e.performanceGroup)throw new Error("seatlayer: `performanceGroup` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!!e.initialHoldId!=!!e.initialOperationId)throw new Error("seatlayer: `initialHoldId` and `initialOperationId` must be supplied together");if((e.selectionMode==="per_performance"||e.allowSelectionModeSwitch)&&(!Number.isSafeInteger(e.numberOfPlacesToSelect)||(e.numberOfPlacesToSelect??0)<1))throw new Error("seatlayer: `numberOfPlacesToSelect` is required for per-performance selection");this.selectionModeValue=e.selectionMode??"same_seat",this.options=e,this.panelId=`sl-pg-panel-${e.performanceGroup}`;let t=n=>{this.refusal=this.refusal&&n.reason==="provider_failed"?this.refusal:n,e.onAccessUnavailable?.(this.refusal)};this.access=e.buyerAccessToken||e.buyerAccessTokenProvider?new ae({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:t}):wc({base:(e.apiBase??xc).replace(/\/$/,""),performanceGroup:e.performanceGroup,onRefused:n=>{this.refusal=n},accessHooks:{onExpired:e.onAccessExpired,onUnavailable:t}}).access,this.api=new Cn(e.performanceGroup,{apiBase:e.apiBase,access:this.access,selectionMode:e.selectionMode,partySize:e.selectionMode==="per_performance"?e.numberOfPlacesToSelect:void 0,onOperationState:n=>this.operationChanged(n),onRecoveryState:n=>this.recoveryChanged(n),onAvailability:n=>this.availabilityChanged(n),onSessionEnded:n=>this.sessionEnded(n)}),e.initialHoldId&&e.initialOperationId&&this.api.rememberOperation(e.initialHoldId,e.initialOperationId),e.initialDescriptor&&this.api.seedDescriptor(e.initialDescriptor),this.hosted=e.checkout==="hosted"?new Pn({api:this.api,locale:e.locale,returnUrl:e.returnUrl,announce:n=>this.showStatus("checkout",n),onConfirmed:n=>e.onOrderConfirmed?.(n),onError:e.onError}):null}get checkoutMode(){return this.hosted?.mode??"handoff"}get mode(){return this.selectionModeValue}get selectionMode(){return this.selectionModeValue}get descriptor(){return this.descriptorValue}get currentHold(){return this.activeHandoff}async render(){if(this.rendered)return this;let e=performance.now();if(this.rendered=!0,yc(),await em(this.options.locale),this.options.messages&&tm(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(n){throw ye({apiBase:this.options.apiBase??xc,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:Ee(this.options.performanceGroup),transport:"pubapi"}),n instanceof W&&this.refusal?new W(this.refusal):n}return await this.hosted?.prepare(),this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(kc(this.options.container),t),this.announce(this.copy("picker.group.checkingAvailability")),await this.mountPicker(t),this.destroyed?this:(await this.restoreOperation(),this.destroyed||this.hosted?.resume(this.picker?.root??null,t.key,t),this))}buildChrome(e,t){e.replaceChildren();let n=document.createElement("div");n.className="sl-pg-root",n.dataset.performanceGroup=t.key,n.dataset.selectionMode=this.mode;let o=document.createElement("div");o.className="sl-pg-progress";let s=document.createElement("section");s.className="sl-pg-head",s.setAttribute("aria-labelledby",`sl-pg-title-${t.key}`);let r=document.createElement("h2");r.id=`sl-pg-title-${t.key}`,r.textContent=t.name;let a=document.createElement("p");a.className="sl-pg-summary",a.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceSummary":"picker.group.sameSeatSummary",{count:t.performanceCount});let l=document.createElement("p");l.className="sl-pg-help",l.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceMapHelp":"picker.group.sameSeatMapHelp");let c=document.createElement("details");c.className="sl-pg-dates",c.open=t.performanceCount<=3;let d=document.createElement("summary");d.textContent=this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:t.performanceCount});let u=document.createElement("div");u.innerHTML=ho(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(d,u);let m=document.createElement("div");m.className="sl-pg-held-summary",m.hidden=!0,r.hidden=a.hidden=c.hidden=this.options.header===!1,s.append(r,a,l,c,m);let p=document.createElement("div");p.className="sl-pg-legend";let v=document.createElement("div");v.className="sl-pg-pane",v.setAttribute("role","group"),v.setAttribute("aria-label",this.copy("picker.group.yourSelection")),v.hidden=!0;let g=this.mode==="per_performance"?this.performanceTabs(t):null,T=document.createElement("div");T.className="sl-pg-inner",T.id=this.panelId,T.setAttribute("aria-busy","false"),T.dataset.locked="false",this.mode==="per_performance"&&(T.setAttribute("role","tabpanel"),T.tabIndex=-1);let S=document.createElement("div");S.className="sl-pg-status",S.setAttribute("role","status"),S.setAttribute("aria-live","polite"),S.hidden=!0;let y=document.createElement("p"),P=document.createElement("button");P.type="button",P.hidden=!0,P.textContent=this.copy("picker.group.retry"),P.addEventListener("click",()=>{this.retryRecovery()}),S.append(y,P),T.appendChild(S);let R=document.createElement("div");R.className="sl-pg-live",R.setAttribute("role","status"),R.setAttribute("aria-live","polite"),n.append(o,s),g&&n.append(g),n.append(p,T,v,R),e.appendChild(n),this.root=n,this.progressHost=o,this.legendHost=p,this.paneHost=v,this.datesSummaryHost=d,this.datesCardsHost=u,this.innerHost=T,this.heldSummary=m,this.live=R,this.statusHost=S,this.statusCopy=y,this.statusAction=P,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new $e(Tn({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(n,o)=>{try{this.options.onAnalytics?.(n,{...o,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:n=>this.selectionChanged(n),onSelectionValidityChange:n=>this.selectionValidityChanged(n),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(n,o)=>this.holdChanged(n,o),onCheckout:(n,o)=>this.checkout(n,o),onHoldExpired:()=>{this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()},onError:this.options.onError},{performanceCount:e.performanceCount,selectionMode:this.mode,submissionState:()=>this.submissionState(),suppressPricing:!0,nights:()=>this.nights(),seatMarks:()=>this.seatMarks(),nightSummary:()=>this.nightSummary(),groupSelectionSummary:()=>this.groupSelectionSummary(),activePerformanceLabel:()=>this.activePerformanceLabel(),selectedPerformanceDates:()=>this.mode==="same_seat"&&e.inclusionMode==="flexible_dates"?pa(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:n=>{this.switchPerformance(n)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),activate:(n,o)=>{this.selectPartialSeat(n,o)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:n=>this.partialSeatDates.get(n)??this.nights().map(o=>o.eventKey),label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),apply:(n,o)=>this.applySeatDates(n,o,!0)}:null}));this.picker=t,await t.render(),!this.destroyed&&this.updateTabs()}performanceCards(e){return e.performances.map(t=>({eventKey:t.eventKey,name:t.name,iso:new Date(t.startsAt).toISOString(),date:dn(t,this.options.locale),time:pn(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:Ot(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,n=!!t?.salesClosed||!!t&&t.state!=="active",o=this.mode==="same_seat"&&!n?t?.partial??{}:{},s={};for(let r of this.markedLabels)s[r]=null;if(this.markedLabels.clear(),e>0)for(let[r,a]of Object.entries(o))!a.length||a.length>=e||(s[r]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(r));return s}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!e)return null;let t=Ot(e,this.options.locale),n=e.name?.trim();return n&&n!==t?`${n} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:Ot(e,this.options.locale),labels:(this.selectionsByEvent.get(e.eventKey)??[]).map(t=>t.label),active:e.eventKey===this.activePerformanceKey}))}groupSelectionSummary(){let e=this.includedPerformances();if(!e.length)return null;if(this.mode==="same_seat"){let s=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:s*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:s?e.length:0,perPerformance:s}}let t=e.map(s=>this.selectionsByEvent.get(s.eventKey)?.length??0),n=t.filter(s=>s>0),o=n.length===t.length&&n.every(s=>s===n[0]);return{seats:t.reduce((s,r)=>s+r,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:n.length,perPerformance:o&&n.length?n[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=xa(t,{label:this.copy("picker.group.progressLabel"),done:this.copy("picker.group.stepDone"),current:this.copy("picker.group.stepCurrent"),upcoming:this.copy("picker.group.notStarted")})}syncLegend(){if(!this.legendHost)return;let e=this.availability,t=!!e?.salesClosed||e&&e.state!=="active";if(!e||t){this.legendHost.replaceChildren();return}this.legendHost.innerHTML=ua({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let n=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(s=>s.label)??[],o=this.heldTotal();e.hidden=!1,e.innerHTML=ka({title:this.copy("picker.group.yourSelection"),rows:t.map(s=>({eventKey:s.eventKey,name:`${dn(s,this.options.locale)} ${pn(s,this.options.locale)}`,labels:n})),empty:this.copy("picker.group.noSeatsChosenYet"),note:o?null:this.copy("picker.group.pricesPerPerformance"),total:o?{label:this.copy("picker.group.total"),amount:o}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Sa(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let o=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!o.length)return null;let s=o.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),r=o[0]?.currency??t.currency;try{return Ju(s,r,void 0,this.options.locale)}catch{return`${r} ${s.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(n=>t.has(n.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),n=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=n&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(n?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=ho(this.performanceCards({...e,performances:t}),this.copy(n&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":n?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,n){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let o=this.api.includedPerformanceKeys();if(o.length===t.length&&o.every(s=>t.includes(s)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(n?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(s){return o.length&&(this.api.setIncludedEventKeys(o),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(s),!1}finally{this.selectingPartialSeat=!1}}syncHoldTicker(){this.booked||(this.activeHandoff&&!this.holdTicker?this.holdTicker=setInterval(()=>this.syncPane(),1e3):!this.activeHandoff&&this.holdTicker&&(clearInterval(this.holdTicker),this.holdTicker=null))}async switchSelectionMode(e){if(!(this.destroyed||this.switchingMode||e===this.mode)&&!(this.activeHandoff||this.holdBlocked())){this.switchingMode=!0;try{this.api.setSelectionMode(e,this.options.numberOfPlacesToSelect),this.selectionModeValue=e,this.picker?.destroy(),this.picker=null,this.selectionsByEvent.clear(),this.validByEvent.clear(),this.markedLabels.clear(),this.availability=null;let t=this.descriptorValue;if(this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(kc(this.options.container),t),await this.mountPicker(t),this.destroyed)return;this.announce(this.copy("picker.group.nightByNightStarted")),this.options.onSelectionModeChange?.(e)}catch(t){if(t instanceof Q)return;this.options.onError?.(t)}finally{this.switchingMode=!1}}}async release(){await this.picker?.release()}close(){this.destroy()}destroy(){if(this.destroyed)return;this.destroyed=!0,this.api.destroy(),this.hosted?.destroy(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.picker;this.root?.setAttribute("hidden","");let t=()=>{e?.destroy(),this.access.clear(),this.root?.remove(),this.root=null,this.picker=null,this.innerHost=null,this.tabsHost=null,this.statusHost=null,this.statusCopy=null,this.statusAction=null,this.live=null};e?.getCurrentHold()&&!this.continued?e.release().catch(()=>{}).finally(t):t()}copy(e,t){let n=this.options.messages?.[e];return n!==void 0?t?n.replace(/\{(\w+)\}/g,(o,s)=>String(t[s]??`{${s}}`)):n:im(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let n=document.createElement("button");n.type="button",n.className="sl-pg-step",n.dataset.step="previous",n.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),n.textContent="\u2039",n.addEventListener("click",()=>{this.stepPerformance(-1)});let o=document.createElement("button");o.type="button",o.className="sl-pg-step",o.dataset.step="next",o.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),o.textContent="\u203A",o.addEventListener("click",()=>{this.stepPerformance(1)});let s=document.createElement("div");return s.className="sl-pg-tabs",s.setAttribute("role","tablist"),s.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((r,a)=>{let l=document.createElement("button");l.type="button",l.className="sl-pg-tab",l.id=`sl-pg-tab-${e.key}-${r.eventKey}`,l.dataset.eventKey=r.eventKey,l.dataset.state="not-started",l.setAttribute("role","tab"),l.setAttribute("aria-selected",String(a===0)),l.setAttribute("aria-controls",this.panelId),l.tabIndex=a===0?0:-1;let c=document.createElement("span");c.className="sl-pg-tab-name",c.textContent=r.name;let d=document.createElement("span");d.className="sl-pg-tab-state",d.textContent=this.copy("picker.group.stillNeedsSeat");let u=document.createElement("span");u.className="sl-pg-tab-badge",u.textContent=this.copy("picker.group.chosenOfTotal",{chosen:0,total:this.options.numberOfPlacesToSelect??1}),l.append(c,u,d),l.addEventListener("click",()=>{this.switchPerformance(r.eventKey)}),l.addEventListener("keydown",m=>this.tabKeydown(m)),s.appendChild(l)}),t.append(n,s,o),this.tabsHost=s,this.prevButton=n,this.nextButton=o,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),n=t.findIndex(a=>a===e.target);if(n<0)return;let o=getComputedStyle(this.tabsHost??document.body).direction==="rtl",s=-1;switch(e.key){case"ArrowRight":s=n+(o?-1:1);break;case"ArrowLeft":s=n+(o?1:-1);break;case"ArrowDown":s=n+1;break;case"ArrowUp":s=n-1;break;case"Home":s=0;break;case"End":s=t.length-1;break;default:return}if(s<0||s>=t.length)return;e.preventDefault();let r=t[s];r.focus({preventScroll:!0}),r.disabled||this.switchPerformance(r.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),n=t.findIndex(s=>s.dataset.eventKey===this.activePerformanceKey),o=t[n+e];!o||o.disabled||(o.focus({preventScroll:!0}),this.switchPerformance(o.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let o=!this.holdBlocked();return{complete:e.length,total:e.length,ready:o}}let t=this.options.numberOfPlacesToSelect,n=e.filter(o=>this.selectionsByEvent.get(o.eventKey)?.length===t&&this.validByEvent.get(o.eventKey)!==!1).length;return{complete:n,total:e.length,ready:n===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(n=>n.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(n=>this.options.onError?.(n)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(n=>({...n}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(n=>({label:n.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,n=(this.selectionsByEvent.get(e)??[]).map(s=>s.label),o=this.copy("picker.group.chosenOfTotal",{chosen:n.length,total:t});return n.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:o}:n.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:n.join(", ")}),badge:o}:n.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:o}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-n.length}),badge:o}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(o=>{let s=o.dataset.eventKey,r=this.tabState(s),a=s===this.activePerformanceKey;o.dataset.state=r.key,o.disabled=t,o.setAttribute("aria-selected",String(a)),o.tabIndex=a?0:-1;let l=o.querySelector(".sl-pg-tab-state");l&&(l.textContent=r.label);let c=o.querySelector(".sl-pg-tab-badge");c&&(c.textContent=r.badge);let d=o.querySelector(".sl-pg-tab-name")?.textContent??s;o.setAttribute("aria-label",`${d}: ${r.badge} \xB7 ${r.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",o.id)});let n=e.findIndex(o=>o.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||n<=0),this.nextButton&&(this.nextButton.disabled=t||n<0||n>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(n=>n.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let n=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(n),n.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(n);let o=this.descriptorValue?.performances.find(s=>s.eventKey===e);o&&this.announce(this.copy("picker.group.performanceOpened",{performance:o.name}))}catch(n){this.options.onError?.(n)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,n={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!n.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...n.reference?{reference:n.reference}:{}})}sessionEnded(e){this.destroyed||(this.showStatus("session_ended",this.copy("picker.accessExpiredTitle")),this.options.onError?.(e))}clearStatus(){this.statusHost&&(this.statusHost.hidden=!0),this.statusAction&&(this.statusAction.hidden=!0),this.options.onStatusChange?.({kind:"idle",message:""})}operationChanged(e){if(this.destroyed)return;let t=e.state==="preparing"||e.state==="commit_pending"||e.state==="abort_pending"||e.state==="expire_pending";if(this.operationPending=t,this.setInteractionLocked(t||this.recovery.kind!=="idle"),this.updateTabs(),t){this.showStatus("pending",this.copy(e.state==="commit_pending"?"picker.group.commitPending":e.state==="abort_pending"||e.state==="expire_pending"?"picker.group.abortPending":"picker.group.securing"));return}if(e.state==="booked"){this.bookingSettled();return}if(e.state==="expired"||e.state==="aborted"){this.activeHandoff&&this.holdLost();return}if(e.state==="committed"){this.clearStatus(),this.announce(this.copy("picker.group.secured")),queueMicrotask(()=>this.innerHost?.querySelector('[data-ref="cta"]')?.focus({preventScroll:!0}));return}e.decision==="abort"&&this.recovery.kind==="idle"&&(this.clearStatus(),this.announce(this.copy("picker.group.notSecured")))}bookingSettled(){if(this.booked)return;this.booked=!0,this.root&&(this.root.dataset.booking="booked"),this.clearStatus(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.activeHandoff?{...this.activeHandoff,bookingState:"booked"}:null;e&&(this.activeHandoff=e),this.syncProgress(),this.syncPane(),this.updateTabs(),this.picker?.notifyGroupSettled("booked"),this.announce(this.copy("picker.group.bookedAll",{count:this.descriptorValue?.performanceCount??0})),e&&this.options.onBooked?.(e)}holdLost(){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.picker?.notifyGroupSettled("lost"),this.announce(this.copy("picker.group.notSecured")),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()}recoveryChanged(e){if(!this.destroyed){if(this.recovery=e,this.setInteractionLocked(this.operationPending||e.kind!=="idle"),this.updateTabs(),this.refreshComposition(),e.kind==="idle"){this.operationPending||this.clearStatus();return}if(e.kind==="pending"){this.showStatus("pending",e.longRunning?this.copy("picker.group.longRunning",{reference:e.reference}):this.copy("picker.group.outcomeUnknown"),{reference:e.reference});return}this.showStatus("recovery_failed",this.copy("picker.group.longRunning",{reference:e.reference}),{retry:e.retryable,reference:e.reference}),this.setInteractionLocked(!1)}}async retryRecovery(){if(!(this.destroyed||this.recovery.kind!=="failed"||!this.recovery.retryable))try{await this.api.retryRecovery()}catch(e){if(e instanceof Q)return;this.options.onError?.(e)}}async restoreOperation(){try{let e=await this.api.restoreOperation();e&&!this.destroyed&&await this.picker?.adoptRestoredHold(e.holdId)}catch(e){if(e instanceof Q)return;this.options.onError?.(e)}}availabilityChanged(e){if(this.destroyed)return;let t=this.availability;if(this.availability=e,e.revisionChanged){this.showStatus("revision_changed",this.copy("picker.group.revisionChanged")),this.reloadDescriptor(e.revision);return}e.salesClosed?this.showStatus("sales_closed",this.copy("picker.group.salesClosed")):t?.salesClosed&&this.clearStatus(),this.updateTabs(),this.refreshComposition(),this.syncLegend()}async reloadDescriptor(e){this.api.acceptRevision(e);try{let t=await this.api.descriptor();if(this.destroyed)return;this.descriptorValue=t,await this.picker?.refreshAvailability()}catch(t){if(t instanceof Q)return;this.options.onError?.(t)}}handoff(e,t){let n=this.descriptorValue,o=this.api.operationIdForHold(e.holdId);if(!n||!o)throw new Error("seatlayer: Performance Group hold identity is unavailable");let s=this.api.allocationsForHold(e.holdId);return{operationId:o,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:n,selectionMode:this.mode,performanceKeys:s.map(r=>r.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(r=>r.label),...this.mode==="per_performance"?{allocations:s.map(r=>({eventKey:r.eventKey,seatLabels:r.items.map(a=>a.label)}))}:{}}}renderHeldAllocations(e){if(!(!this.heldSummary||this.mode!=="per_performance")){this.heldSummary.replaceChildren();for(let t of e){let n=this.descriptorValue?.performances.find(r=>r.eventKey===t.eventKey),o=document.createElement("p"),s=document.createElement("strong");s.textContent=n?.name??t.eventKey,o.append(s,document.createTextNode(t.items.map(r=>r.label).join(", "))),this.heldSummary.appendChild(o)}this.heldSummary.hidden=e.length===0}}resetPerPerformanceSelection(){this.mode==="per_performance"&&(this.selectionsByEvent.clear(),this.validByEvent.clear(),this.heldSummary?.replaceChildren(),this.heldSummary&&(this.heldSummary.hidden=!0),this.updateTabs(),this.picker?.refreshPerformanceGroupComposition())}holdChanged(e,t){if(!e){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null);return}let n=this.handoff(e,t),o=this.activeHandoff?.holdId!==n.holdId;this.activeHandoff=n,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),o&&this.options.onHold?.(n),this.options.onHoldChange?.(n)}checkout(e,t){let n=this.handoff(e,t);this.continued=!0,this.activeHandoff=n,this.options.onCheckout?.(n),this.hosted?.mode==="hosted"&&this.descriptorValue&&this.hosted.open(this.picker?.root??null,{...n,descriptor:this.descriptorValue})}};import{formatMoney as Lc,fromMinorUnits as Mc}from"@seatlayer/core";var Sc="seatlayer-season-picker-style";function Tc(){if(document.getElementById(Sc))return;let i=document.createElement("style");i.id=Sc,i.textContent=`
3412
- .sl-season-root{--sl-season-accent:var(--sl-accent,#7357d8);box-sizing:border-box;display:grid;gap:12px;min-width:0;max-width:100%;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
3413
- .sl-season-root *{box-sizing:border-box}.sl-season-root button,.sl-season-root summary{font:inherit}
3414
- .sl-season-hero{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;padding:20px;border:1px solid var(--sl-line,#dde3ea);border-radius:18px;background:linear-gradient(135deg,color-mix(in srgb,var(--sl-season-accent) 10%,var(--sl-surface,#fff)),var(--sl-surface,#fff) 58%);box-shadow:0 10px 30px #18202b0a}
3415
- .sl-season-copy{display:grid;align-content:start;gap:7px;min-width:0}.sl-season-eyebrow{margin:0;color:var(--sl-season-accent);font-size:11px;font-weight:800;letter-spacing:.13em;text-transform:uppercase}.sl-season-copy h2{margin:0;font:750 clamp(22px,3vw,30px)/1.12 inherit;letter-spacing:-.025em}.sl-season-promise{max-width:62ch;margin:0;color:var(--sl-muted,#627081);font-size:14px;line-height:1.5}
3416
- .sl-season-facts{display:flex;flex-wrap:wrap;gap:7px;margin-top:4px}.sl-season-fact{padding:6px 9px;border:1px solid color-mix(in srgb,var(--sl-season-accent) 20%,var(--sl-line,#dde3ea));border-radius:999px;background:color-mix(in srgb,var(--sl-surface,#fff) 78%,transparent);font-size:12px;font-weight:700}
3417
- .sl-season-offer{display:grid;align-content:start;gap:5px;min-width:190px;padding:15px 16px;border-radius:14px;background:var(--sl-text,#18202b);color:var(--sl-surface,#fff)}.sl-season-offer-label{font-size:11px;font-weight:750;letter-spacing:.08em;text-transform:uppercase;opacity:.72}.sl-season-price{font-size:25px;font-weight:800;line-height:1.1}.sl-season-was{text-decoration:line-through;opacity:.62;font-size:12px}.sl-season-saving{color:#d8ffca;font-size:12px;font-weight:750}.sl-season-price-note{max-width:24ch;font-size:12px;line-height:1.35;opacity:.76}
3418
- .sl-season-price-lines{display:grid;gap:9px;margin:0;padding:0;list-style:none}.sl-season-price-lines li{display:grid;gap:1px}.sl-season-price-category{font-size:11.5px;font-weight:700;opacity:.78}.sl-season-price-lines .sl-season-price{font-size:22px}.sl-season-price-scope{font-size:11.5px;opacity:.72}
3419
- .sl-season-package-total{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;margin:0;padding:10px 0 0;border-top:1px solid var(--sl-line,#dde3ea);font-size:12px;color:var(--sl-muted,#627081)}.sl-season-package-total strong{color:var(--sl-text,#18202b);font-size:18px}.sl-season-package-total-scope{flex-basis:100%;font-size:11.5px}
3420
- .sl-season-benefits{display:flex;flex-wrap:wrap;gap:7px;grid-column:1/-1;margin:2px 0 0;padding:0;list-style:none}.sl-season-benefits li{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border-radius:9px;background:color-mix(in srgb,var(--sl-season-accent) 9%,var(--sl-surface,#fff));font-size:12px;font-weight:650}.sl-season-benefits li:before{content:'\u2713';color:var(--sl-success,#16734b);font-weight:900}
3421
- .sl-season-dates{grid-column:1/-1;border-top:1px solid var(--sl-line,#dde3ea);padding-top:12px}.sl-season-dates summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;font-size:13px;font-weight:750;list-style:none}.sl-season-dates summary::-webkit-details-marker{display:none}.sl-season-dates summary:after{content:'+';font-size:18px;font-weight:500}.sl-season-dates[open] summary:after{content:'\u2212'}.sl-season-date-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:7px;margin:11px 0 0;padding:0;list-style:none}.sl-season-date{display:grid;gap:2px;padding:9px 10px;border:1px solid var(--sl-line,#dde3ea);border-radius:10px;background:var(--sl-surface,#fff)}.sl-season-date b{font-size:12.5px}.sl-season-date time{color:var(--sl-muted,#627081);font-size:11.5px}
3422
- .sl-season-progress{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:0;padding:0;list-style:none;border:1px solid var(--sl-line,#dde3ea);border-radius:13px;background:var(--sl-surface,#fff);overflow:hidden}.sl-season-progress li{display:flex;align-items:center;gap:8px;min-width:0;padding:10px 12px;color:var(--sl-muted,#627081);font-size:12px;font-weight:700}.sl-season-progress li+li{border-inline-start:1px solid var(--sl-line,#dde3ea)}.sl-season-progress span{display:grid;place-items:center;flex:none;width:22px;height:22px;border-radius:50%;background:var(--sl-soft,#f4f6f8);font-size:11px}.sl-season-progress li[data-state=current]{color:var(--sl-text,#18202b)}.sl-season-progress li[data-state=current] span{background:var(--sl-season-accent);color:#fff}.sl-season-progress li[data-state=done]{color:var(--sl-success,#16734b)}
3423
- .sl-season-stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(230px,290px);gap:12px;align-items:start}.sl-season-map{position:relative;min-width:0;height:640px;min-height:640px}.sl-season-summary-card{position:sticky;top:12px;display:grid;gap:10px;padding:16px;border:1px solid var(--sl-line,#dde3ea);border-radius:15px;background:var(--sl-surface,#fff)}.sl-season-summary-card h3{margin:0;font-size:15px}.sl-season-selection{margin:0;color:var(--sl-muted,#627081);font-size:13px;line-height:1.45}.sl-season-selection strong{color:var(--sl-text,#18202b)}.sl-season-rule{display:flex;gap:9px;align-items:flex-start;padding:10px;border-radius:10px;background:color-mix(in srgb,var(--sl-season-accent) 8%,var(--sl-soft,#f4f6f8));font-size:12px;line-height:1.4}.sl-season-rule i{display:grid;place-items:center;flex:none;width:20px;height:20px;border-radius:50%;background:var(--sl-season-accent);color:#fff;font-style:normal;font-size:11px;font-weight:850}.sl-season-availability{margin:0;color:var(--sl-success,#16734b);font-size:12px;font-weight:750}.sl-season-checkout-note{margin:0;padding-top:10px;border-top:1px solid var(--sl-line,#dde3ea);color:var(--sl-muted,#627081);font-size:11.5px;line-height:1.45}
3424
- .sl-season-status{min-height:20px;margin:0;padding:0 4px;color:var(--sl-muted,#627081);font-size:13px}.sl-season-status[data-kind=ready]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sl-season-status[data-kind=failed],.sl-season-status[data-kind=partial_terminal]{position:static;width:auto;height:auto;margin:0;padding:10px 12px;overflow:visible;clip:auto;border-radius:10px;background:#fff1f0;color:var(--sl-danger,#b42318);font-weight:700}.sl-season-root[data-busy=true] .sl-season-map{opacity:.82;pointer-events:none}
3425
- @media(max-width:820px){.sl-season-stage{grid-template-columns:1fr}.sl-season-summary-card{position:static;order:-1}.sl-season-map{height:590px;min-height:590px}}
3426
- @media(max-width:560px){.sl-season-root{gap:9px}.sl-season-hero{grid-template-columns:1fr;padding:15px;border-radius:14px}.sl-season-offer{min-width:0}.sl-season-progress{grid-template-columns:1fr}.sl-season-progress li+li{border-inline-start:0;border-top:1px solid var(--sl-line,#dde3ea)}.sl-season-progress li[data-state=upcoming]{display:none}.sl-season-date-list{grid-template-columns:1fr}.sl-season-map{height:560px;min-height:560px}.sl-season-summary-card{padding:13px}.sl-season-benefits{display:grid;grid-template-columns:1fr}}
3427
- `,document.head.appendChild(i)}var nm=new Set(["audience_not_public","sales_not_open","origin_not_allowed"]),om=3e4;function sm(i,e){if(!i||typeof i!="object"||Array.isArray(i))return!1;let t=i;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.seasonKey===e&&Array.isArray(t.planActivationIds)&&t.planActivationIds.every(n=>typeof n=="string"&&!!n)}var Ln=class extends Error{constructor(t,n){super(`season_public_session_refused:${t}`);this.reason=t;this.status=n;this.name="SeasonPublicSessionRefused"}},He,Ke,pi,Vt,Mo=class{constructor(e){this.options=e;C(this,He,null);C(this,Ke,null);C(this,pi);C(this,Vt);x(this,pi,e.fetch??globalThis.fetch.bind(globalThis)),x(this,Vt,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return h(this,He)}async mint(e=!1){if(e&&x(this,He,null),h(this,He)&&h(this,He).expiresAt-om>Date.now())return h(this,He);if(h(this,Ke))return h(this,Ke);let t=(async()=>{let n=await h(this,pi).call(this,`${this.options.base}/pub/seasons/${encodeURIComponent(this.options.season)}/sessions`,{method:"POST",body:JSON.stringify(h(this,Vt)?{origin:h(this,Vt)}:{}),credentials:"omit"}),o=await n.json().catch(()=>null);if(!n.ok){let s=o?.code??o?.error;if(n.status===403&&s&&nm.has(s)){let r=s;throw this.options.onRefused?.({reason:r,code:s,status:n.status,retryable:r==="sales_not_open"}),new Ln(r,n.status)}throw new Error(`season_public_session_failed_${n.status}`)}if(!sm(o,this.options.season))throw new Error("season_public_session_invalid");return x(this,He,o),o})();x(this,Ke,t);try{return await t}finally{h(this,Ke)===t&&x(this,Ke,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.mint(t);return{token:n.token,expiresAt:n.expiresAt}}};He=new WeakMap,Ke=new WeakMap,pi=new WeakMap,Vt=new WeakMap;function Ec(i){let e=new Mo(i);return{access:new ae({provider:({reason:n})=>e.token(n),...i.accessHooks}),loader:e}}var rm="https://api.seatlayer.io",am=6e4,lm=5e3,F=class extends Error{constructor(t,n,o){super(`season_request_failed:${t}`);this.code=t;this.status=n;this.name="SeasonApiError",o?.retryAfterS!==void 0&&(this.retryAfterS=o.retryAfterS),o?.retryable!==void 0&&(this.retryable=o.retryable),o?.reason!==void 0&&(this.reason=o.reason)}},Mn=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function cm(i,e){let t=Number(i.headers.get("Retry-After")),n=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(lm,n*1e3))}function dm(i,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,n)=>{let o=setTimeout(t,i);e?.addEventListener("abort",()=>{clearTimeout(o),n(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function Cc(i){if(!i||typeof i!="object")return"unknown";let e=i;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}function pm(i,e){let t=e&&typeof e=="object"?e:{},n=(i.headers.get("Retry-After")??"").trim(),o=n?Number(n):Number.NaN;return{...Number.isFinite(o)&&o>=0?{retryAfterS:Math.ceil(o)}:{},...typeof t.retryable=="boolean"?{retryable:t.retryable}:{},...typeof t.reason=="string"?{reason:t.reason}:{}}}var hm=/^shc_[a-f0-9]{40}$/,um=/^shh_[a-f0-9]{40}$/,mm=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),fm=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function Ho(i){return Array.isArray(i)?i.some(Ho):!i||typeof i!="object"?!1:Object.entries(i).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&hm.test(t)||Ho(t))}function hi(i,e,t="invalid_operation_response"){if(!i||typeof i!="object"||Array.isArray(i))throw new F(t,502);if(Ho(i))throw new F("unsafe_operation_response",502);let n=i,o=n.allocations,s=new Set,r=Array.isArray(o)&&o.length>0&&o.every(u=>{if(!u||typeof u!="object")return!1;let m=u.eventId,p=u.state;return typeof m!="string"||!m||typeof p!="string"||!fm.has(p)||s.has(m)?!1:(s.add(m),!0)}),a=n.bookingRef===null||typeof n.bookingRef=="string"&&n.bookingRef.length>0,l=n.state!=="booked"||typeof n.bookingRef=="string"&&r&&o.every(u=>u.state==="booked"),c=n.state!=="booking_pending"||typeof n.bookingRef=="string"&&r&&o.some(u=>u.state!=="booked"),d=n.state!=="committed"||n.bookingRef===null;if(n.operationId!==e.operationId||n.seasonId!==e.seasonId||n.kind!=="HOLD"||typeof n.holdId!="string"||!um.test(n.holdId)||n.policy!=="fixed_inclusion_same_seat"||typeof n.state!="string"||!mm.has(n.state)||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)||n.expiresAt<0||!a||typeof n.location!="string"||!n.location||typeof n.retryAfterSeconds!="number"||!Number.isFinite(n.retryAfterSeconds)||n.retryAfterSeconds<0||!r||!l||!c||!d||n.pricingAuthority!==void 0&&n.pricingAuthority!=="host"||n.authoritativeAmountIncluded!==void 0&&n.authoritativeAmountIncluded!==!1)throw new F(t,502);return{operationId:n.operationId,seasonId:n.seasonId,kind:n.kind,holdId:n.holdId,expiresAt:n.expiresAt,policy:n.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:n.state,bookingRef:n.bookingRef,location:n.location,retryAfterSeconds:n.retryAfterSeconds,allocations:o.map(u=>({eventId:u.eventId,state:u.state}))}}function gm(i,e,t){if(!Array.isArray(i)||i.length!==t||i.some(r=>typeof r!="string"||!r)||new Set(i).size!==i.length||!Array.isArray(e)||e.length!==i.length)throw new F("invalid_best_available_response",502);let n=i,o=new Set(n),s=new Map;for(let r of e){if(!r||typeof r!="object")throw new F("invalid_best_available_response",502);let a=r;if(typeof a.label!="string"||!o.has(a.label)||s.has(a.label)||typeof a.objectId!="string"||!a.objectId||a.objectType!=="seat"||typeof a.categoryKey!="string"||!a.categoryKey||a.tierId!==null&&(typeof a.tierId!="string"||!a.tierId)||a.quantity!==void 0&&a.quantity!==1)throw new F("invalid_best_available_response",502);s.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:n,items:n.map(r=>s.get(r))}}function bm(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i;if(typeof e.currency!="string"||!e.currency||!Array.isArray(e.packages))return null;let t=[];for(let n of e.packages){if(!n||typeof n!="object")continue;let o=n;if(typeof o.planKey!="string"||!o.planKey||!Array.isArray(o.prices))continue;let s=[],r=new Set;for(let a of o.prices){if(!a||typeof a!="object")continue;let l=a;typeof l.categoryKey!="string"||!l.categoryKey||r.has(l.categoryKey)||typeof l.unitPrice!="number"||!Number.isInteger(l.unitPrice)||l.unitPrice<0||(r.add(l.categoryKey),s.push({categoryKey:l.categoryKey,unitPrice:l.unitPrice}))}s.length&&t.push({planKey:o.planKey,name:typeof o.name=="string"&&o.name?o.name:o.planKey,prices:s})}return t.length?{currency:e.currency,packages:t}:null}function ym(i){if(!i||typeof i!="object"||Array.isArray(i))throw new F("invalid_checkout_response",502);let e=i,t=typeof e.redirectUrl=="string"&&!!e.redirectUrl,n=Uo(e.redirectUrl);if(t&&!n)throw new F("gateway_unavailable",502);if(typeof e.orderId!="string"||!e.orderId||typeof e.currency!="string"||!e.currency||typeof e.totalMinor!="number"||!Number.isFinite(e.totalMinor)||typeof e.expiresAt!="number"||!Number.isFinite(e.expiresAt)||!n)throw new F("invalid_checkout_response",502);return{orderId:e.orderId,totalMinor:e.totalMinor,currency:e.currency,expiresAt:e.expiresAt,redirectUrl:n}}function Ac(i,e){return{seasonKey:i.key,planActivationId:i.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:t,state:n})=>({eventKey:t,state:n}))}}var me,rt,xe,at,ui,ke,Se,ie,he,Pc,Hn=class{constructor(e,t){C(this,ie);C(this,me);C(this,rt);C(this,xe);C(this,at);C(this,ui);C(this,ke,!1);C(this,Se,null);x(this,me,e),x(this,rt,(t.apiBase??rm).replace(/\/$/,"")),x(this,xe,t.access),x(this,at,t.fetch??globalThis.fetch.bind(globalThis)),x(this,ui,t.recoveryTimeoutMs??am),h(this,xe).onRenewed(n=>w(this,ie,Pc).call(this,n))}async descriptor(){let{body:e}=await w(this,ie,he).call(this,"GET","");return e.season}async chart(){let{body:e}=await w(this,ie,he).call(this,"GET","/chart");return e}async availability(){let{body:e}=await w(this,ie,he).call(this,"GET","/availability"),t=Object.values(e.seats??{});return{...e,freeCount:t.filter(n=>n==="free").length,blockedCount:t.filter(n=>n!=="free").length}}async hold(e,t){let{body:n,response:o}=await w(this,ie,he).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:hi(n.operation,{seasonId:h(this,me),operationId:t}),response:o}}async bestAvailable(e){let{body:t,response:n}=await w(this,ie,he).call(this,"POST","/best-available",{operationId:e.operationId,qty:e.qty,...e.categoryKey?{categoryKey:e.categoryKey}:{},...e.zoneId?{zoneId:e.zoneId}:{},...e.accessibility?.length?{accessibility:[...e.accessibility]}:{},...e.requireContiguous===!0?{requireContiguous:!0}:{}}),o=hi(t.operation,{seasonId:h(this,me),operationId:e.operationId},"invalid_best_available_response"),{labels:s,items:r}=gm(t.labels,t.items,e.qty);return{operation:o,labels:s,items:r,response:n}}async operation(e){let{body:t,response:n}=await w(this,ie,he).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:hi(t.operation,{seasonId:h(this,me),operationId:e}),response:n}}async release(e,t){let{body:n,response:o}=await w(this,ie,he).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:hi(n.operation,{seasonId:h(this,me),operationId:e}),response:o}}async prices(){let e;try{({body:e}=await w(this,ie,he).call(this,"GET","/prices"))}catch(t){if(t instanceof F&&t.status===404)return null;throw t}return bm(e)}async checkout(e){let{body:t}=await w(this,ie,he).call(this,"POST","/checkout",{operationId:e.operationId,buyerEmail:e.buyerEmail,...e.buyerName?{buyerName:e.buyerName}:{},...e.provider?{provider:e.provider}:{},...e.returnUrl?{returnUrl:e.returnUrl}:{}});return ym(t)}async orderStatus(e){let t=await h(this,at).call(this,`${h(this,rt)}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit"}),n=await t.json().catch(()=>null);if(!t.ok)throw new F(Cc(n),t.status);if(n===null)throw new F("invalid_json_response",502);return n}async renewalIntent(e){let{body:t}=await w(this,ie,he).call(this,"POST","/renewal-intents",{offerId:e}),n=t.intent;if(!n||n.offerId!==e||n.state!=="intent_received"||!n.intentId||!Number.isFinite(n.receivedAt))throw new F("invalid_renewal_intent_response",502);return n}async waitForTerminal(e,t,n){let o=Date.now(),s=t?{operation:hi(t.operation,{seasonId:h(this,me),operationId:e}),response:t.response}:await this.operation(e);for(;s.operation.state==="preparing"||s.operation.state==="commit_pending"||s.operation.state==="expire_pending"||s.operation.state==="booking_pending"||s.operation.state==="abort_pending";){if(Date.now()-o>=h(this,ui))throw new Mn(e);await dm(cm(s.response,s.operation),n),s=await this.operation(e)}return s.operation}destroy(){h(this,ke)||(x(this,ke,!0),h(this,xe).onRenewed(void 0),h(this,xe).clear())}};me=new WeakMap,rt=new WeakMap,xe=new WeakMap,at=new WeakMap,ui=new WeakMap,ke=new WeakMap,Se=new WeakMap,ie=new WeakSet,he=async function(e,t,n,o=!0){if(h(this,ke))throw new F("season_api_destroyed",409);if(h(this,Se))throw h(this,Se);let s=await h(this,xe).authorization();if(h(this,ke))throw new F("season_api_destroyed",409);if(h(this,Se))throw h(this,Se);if(!s)throw new W({reason:"no_token",retryable:!1});let r=await h(this,at).call(this,`${h(this,rt)}/pub/seasons/${encodeURIComponent(h(this,me))}${t}`,{method:e,headers:{Authorization:s,...n===void 0?{}:{"Content-Type":"application/json"}},body:n===void 0?void 0:JSON.stringify(n)}),a=await r.json().catch(()=>null);if(!r.ok){let l=Cc(a);if(o&&await h(this,xe).handleFailure(r.status,l,s))return w(this,ie,he).call(this,e,t,n,!1);let c=h(this,xe).unavailable;throw c?new W(c):new F(l,r.status,pm(r,a))}if(a===null)throw new F("invalid_json_response",502);return{body:a,response:r}},Pc=async function(e){if(h(this,ke))return;let t=`/pub/seasons/${encodeURIComponent(h(this,me))}/session/adopt`;for(let n=0;n<2;n++){if(h(this,ke))return;try{if((await h(this,at).call(this,`${h(this,rt)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){x(this,Se,null);return}}catch{}}if(!h(this,ke))throw x(this,Se,new F("season_session_adopt_failed",409)),h(this,Se)};var vm=2500;function wm(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}function xm(i,e,t){if(i.startsAt==null)return{date:"Date to be announced",time:null};try{let n=new Date(i.startsAt),o=e?{timeZone:e}:{};return{date:new Intl.DateTimeFormat(t,{dateStyle:"medium",...o}).format(n),time:new Intl.DateTimeFormat(t,{timeStyle:"short",...o}).format(n)}}catch{return{date:"Date to be announced",time:null}}}function Hc(i){return i.state==="committed"||i.state==="booked"}var Ro=class{constructor(e,t,n,o){this.transport=e;this.sink=t;this.intervalMs=n;this.onSessionEnded=o;this.timer=null;this.stopped=!0;this.prior={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=Object.entries(e.seats).filter(([n,o])=>this.prior[n]!==o).map(([n,o])=>({label:n,status:o}));this.prior={...e.seats},t.length&&this.sink.applyStatuses(t)}catch(e){if(Di(e)){this.stop(),this.onSessionEnded?.(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Io=class{constructor(e,t,n){this.api=e;this.realtimePollMs=t;this.onSessionEnded=n;this.descriptorValue=null;this.availabilityValue=null;this.categoryLabels=new Map;this.reuseAvailabilityOnce=!1;this.nextOperationId=null;this.nextBestAvailable=null;this.nextReleaseActionId=null;this.operationByHold=new Map;this.chartPrefetch=null}prime(e,t){this.descriptorValue=e,this.availabilityValue=t,this.reuseAvailabilityOnce=!0}takeChartPrefetch(){let e=this.chartPrefetch;return this.chartPrefetch=null,e}primeChart(e){e.catch(()=>{}),this.chartPrefetch=e}queueOperation(e){this.nextOperationId=e}queueBestAvailable(e,t){if(this.nextBestAvailable)throw new F("season_best_available_in_progress",409);let n={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=n,n}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}async chart(e){let[t,n]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.takeChartPrefetch()??this.api.chart()]);this.descriptorValue=t;for(let o of n.categories??[])typeof o?.key=="string"&&typeof o.label=="string"&&this.categoryLabels.set(o.key,o.label);return{doc:n,event:{key:t.key,name:t.name,venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,n,o){if(o)throw new F("season_hold_replace_unsupported",409);let s=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let r=await this.api.hold(t.map(l=>l.label),s),a=await this.api.waitForTerminal(s,r);if(!Hc(a))throw new F(`season_operation_${a.state}`,409);return this.remember(a),{holdId:a.holdId,expiresAt:a.expiresAt,items:t.map(l=>({label:l.label,objectId:l.label,objectType:"seat",categoryKey:"",tierId:l.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...l.quantity==null?{}:{quantity:l.quantity}}))}}async release(e,t,n){let o=this.operationForHold(n);if(!o)throw new F("season_hold_not_found",404);let s=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let r=await this.api.release(o.operationId,s),a=await this.api.waitForTerminal(o.operationId,r);if(a.state==="partial_terminal")throw this.remember(a),new F("season_operation_partial_terminal",409);this.forget(n)}async bestAvailable(e,t,n,o){let s=this.nextBestAvailable;this.nextBestAvailable=null;let r=s?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:r,qty:t,...n?{categoryKey:n}:{},...o?{zoneId:o}:{},...s?.accessibility?.length?{accessibility:s.accessibility}:{},...s?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(r,a);if(!Hc(l))throw new F(`season_operation_${l.state}`,409);this.remember(l);let c=new Map(a.items.map(d=>[d.label,d]));return{holdId:l.holdId,expiresAt:l.expiresAt,labels:[...a.labels],items:a.labels.map(d=>{let u=c.get(d);return{label:d,objectId:u?.objectId??d,objectType:"seat",categoryKey:u?.categoryKey??n??"",tierId:u?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...u?.quantity==null?{}:{quantity:u.quantity}}})}}categoryLabel(e){return this.categoryLabels.get(e)??e}socketUrl(){return""}createRealtime(e,t){return new Ro(this,t,this.realtimePollMs,this.onSessionEnded)}},H,dt,zt,le,X,fi,ee,Ie,U,ne,fe,jt,Ue,Oe,pt,ue,gi,ge,Gt,Kt,ht,Ut,qe,ut,mt,qt,k,Rc,Ic,_o,No,Do,Bo,Rn,lt,Oc,_c,Re,mi,Nc,Dc,Fo,Vo,Bc,Fc,Vc,$o,zo,K,ct,$c,jo,$t,Oo=class{constructor(e){C(this,k);C(this,H);C(this,dt);C(this,zt);C(this,le);C(this,X);C(this,fi,new AbortController);C(this,ee,null);C(this,Ie,null);C(this,U,null);C(this,ne,null);C(this,fe,null);C(this,jt,null);C(this,Ue,null);C(this,Oe,null);C(this,pt,null);C(this,ue,[]);C(this,gi,new Map);C(this,ge,!1);C(this,Gt,!1);C(this,Kt);C(this,ht,null);C(this,Ut,null);C(this,qe,null);C(this,ut,"handoff");C(this,mt,null);C(this,qt,!1);if(!e?.season)throw new Error("seatlayer: `season` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if("event"in e||"performanceGroup"in e)throw new Error("seatlayer: SeasonPicker is not SeatPicker or PerformanceGroupPicker");x(this,H,e),x(this,dt,wm(e.container));let t={onExpired:o=>e.onAccessExpired?.(o),onUnavailable:o=>{let s=h(this,ht)&&o.reason==="provider_failed"?h(this,ht):o;x(this,ht,null),x(this,Ut,s.reason==="provider_failed"?null:s),e.onAccessUnavailable?.(s),w(this,k,Bc).call(this,s)}};if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider){let{access:o,loader:s}=Ec({base:(e.apiBase??"https://api.seatlayer.io").replace(/\/$/,""),season:e.season,fetch:e.fetch,onRefused:r=>{x(this,ht,r)},accessHooks:t});x(this,zt,o),x(this,Kt,s)}else x(this,Kt,null),x(this,zt,new ae({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,...t}));x(this,le,new Hn(e.season,{apiBase:e.apiBase,access:h(this,zt),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs})),x(this,X,new Io(h(this,le),Math.max(750,e.realtimePollMs??vm),o=>w(this,k,$c).call(this,o)))}async render(){w(this,k,jo).call(this),Tc(),w(this,k,Ic).call(this),w(this,k,K).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{h(this,X).primeChart(h(this,le).chart());let[e,t,n]=await Promise.all([h(this,le).descriptor(),h(this,le).availability(),h(this,le).prices().catch(()=>null)]);return h(this,ge)?this:(x(this,ee,e),x(this,Ie,t),x(this,qe,n),x(this,ut,h(this,H).checkout==="hosted"&&e.checkoutMode!=="server"&&n?"hosted":"handoff"),h(this,X).prime(e,t),w(this,k,_o).call(this),await w(this,k,Rc).call(this,e),h(this,ge)?this:(n&&w(this,k,_o).call(this),w(this,k,Vc).call(this),w(this,k,K).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included performance.`}),h(this,H).initialOperationId&&await this.restoreOperation(h(this,H).initialOperationId),this))}catch(e){if(h(this,ge))return this;throw w(this,k,ct).call(this,e)}}async holdSameSeat(e,t){if(w(this,k,$t).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!e.length)throw new Error("seatlayer: select at least one seat");if(h(this,X).queueOperation(t),h(this,ne).selectObjectsWithoutConfirmation([...e]),w(this,k,K).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await h(this,ne).handleCta(),!h(this,U))throw new F("season_hold_not_created",409);return h(this,U)}async holdBestAvailable(e,t,n={}){if(w(this,k,$t).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: positive Best Available quantity is required");let o=h(this,ne).maxTickets;if(e>o)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${o})`);if(h(this,Gt))throw new F("season_best_available_in_progress",409);x(this,Gt,!0);let s=null;try{if(s=h(this,X).queueBestAvailable(t,n),w(this,k,K).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await h(this,ne).bestAvailableOrThrow(e,n.categoryKey,{zoneId:n.zoneId})||!h(this,U))throw new F("season_hold_not_created",409);return h(this,U)}catch(r){throw w(this,k,ct).call(this,r,t)}finally{s&&h(this,X).clearBestAvailable(s),x(this,Gt,!1)}}async restoreOperation(e){w(this,k,$t).call(this),w(this,k,K).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await h(this,le).waitForTerminal(e,void 0,h(this,fi).signal);return t.state==="aborted"||t.state==="expired"?(x(this,U,null),h(this,H).onHoldChange?.(null),w(this,k,K).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(h(this,X).remember(t),w(this,k,Bo).call(this,t,!1))}catch(t){throw w(this,k,ct).call(this,t,e)}}async release(e){w(this,k,$t).call(this);let t=h(this,U);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");h(this,X).queueRelease(e),w(this,k,K).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{h(this,ne)?.getCurrentHold()?.holdId===t.holdId?await h(this,ne).release():(await h(this,X).release("",[],t.holdId),w(this,k,Rn).call(this)),w(this,k,K).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(n){throw w(this,k,ct).call(this,n,t.operationId)}}}async createRenewalIntent(e){if(w(this,k,$t).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");w(this,k,K).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await h(this,le).renewalIntent(e);return w(this,k,K).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),h(this,H).onRenewalIntent?.(t),t}catch(t){throw w(this,k,ct).call(this,t)}}getDescriptor(){return h(this,ee)}getAvailability(){return h(this,Ie)}getHandoff(){return h(this,U)}destroy(){h(this,ge)||(x(this,ge,!0),h(this,fi).abort(),w(this,k,zo).call(this),h(this,ne)?.destroy(),h(this,le).destroy(),h(this,dt).replaceChildren(),x(this,fe,null),x(this,jt,null),x(this,Ue,null),x(this,Oe,null),x(this,pt,null),x(this,ee,null),x(this,Ie,null),x(this,U,null))}};H=new WeakMap,dt=new WeakMap,zt=new WeakMap,le=new WeakMap,X=new WeakMap,fi=new WeakMap,ee=new WeakMap,Ie=new WeakMap,U=new WeakMap,ne=new WeakMap,fe=new WeakMap,jt=new WeakMap,Ue=new WeakMap,Oe=new WeakMap,pt=new WeakMap,ue=new WeakMap,gi=new WeakMap,ge=new WeakMap,Gt=new WeakMap,Kt=new WeakMap,ht=new WeakMap,Ut=new WeakMap,qe=new WeakMap,ut=new WeakMap,mt=new WeakMap,qt=new WeakMap,k=new WeakSet,Rc=async function(e){let t=new $e(Tn({container:h(this,jt),event:e.key,apiBase:h(this,H).apiBase,transport:h(this,X),hideEventDetails:!0,maxSelection:h(this,H).maxSelection,selectedObjects:h(this,H).selectedObjects,selectableObjects:h(this,H).selectableObjects,numberOfPlacesToSelect:h(this,H).numberOfPlacesToSelect,selectionValidators:h(this,H).selectionValidators,locale:h(this,H).locale,messages:h(this,H).messages,languages:h(this,H).languages,colorblindSafe:h(this,H).colorblindSafe,initialView:h(this,H).initialView,enable3D:h(this,H).enable3D,max3DSeats:h(this,H).max3DSeats,hideBadge:h(this,H).hideBadge,theme:h(this,H).theme,confirmSelection:h(this,H).confirmSelection,seatView:h(this,H).seatView,onBuyerViewChange:h(this,H).onBuyerViewChange,onAnalytics:(n,o)=>{try{h(this,H).onAnalytics?.(n,{...o,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:e.occurrenceCount})}catch{}},onSelectionChange:n=>{x(this,ue,n.map(o=>o.label)),x(this,gi,new Map(n.filter(o=>!!o.categoryKey).map(o=>[o.label,o.categoryKey]))),w(this,k,lt).call(this),h(this,H).onSelectionChange?.(n)},onSelectionValidityChange:h(this,H).onSelectionValidityChange,onHoldChange:n=>{if(!n){w(this,k,Rn).call(this);return}let o=h(this,X).operationForHold(n.holdId);o&&w(this,k,Bo).call(this,o,!0)},onCheckout:()=>{h(this,U)&&(w(this,k,Re).call(this,"checkout"),h(this,H).onContinue?.(h(this,U)),h(this,ut)==="hosted"&&w(this,k,Fc).call(this,h(this,U)))},onHoldExpired:()=>{w(this,k,Rn).call(this),w(this,k,K).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),h(this,H).onHoldExpired?.()},onError:n=>w(this,k,ct).call(this,n)},{surface:"season",performanceCount:e.occurrenceCount,selectionMode:"same_seat",suppressPricing:!0,groupSelectionSummary:()=>{let n=h(this,ue).length;return n?{seats:n,performances:e.occurrenceCount,performancesChosen:e.occurrenceCount,perPerformance:n}:null}}));x(this,ne,t),await t.render()},Ic=function(){h(this,dt).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection");let t=document.createElement("header");t.className="sl-season-hero",h(this,H).header===!1&&(t.style.display="none");let n=document.createElement("ol");n.className="sl-season-progress",n.setAttribute("aria-label","Season checkout progress");for(let[g,T]of["Choose seats","Review package","Checkout"].entries()){let S=document.createElement("li");S.dataset.state=g===0?"current":"upcoming";let y=document.createElement("span");y.textContent=String(g+1),S.append(y,T),n.append(S)}let o=document.createElement("div");o.className="sl-season-stage";let s=document.createElement("div");s.className="sl-season-map";let r=document.createElement("aside");r.className="sl-season-summary-card",r.setAttribute("aria-label","Your Season selection");let a=document.createElement("h3");a.textContent="Your Season seats";let l=document.createElement("p");l.className="sl-season-selection",l.textContent="Choose a seat on the map.";let c=document.createElement("p");c.className="sl-season-rule";let d=document.createElement("i");d.textContent="1\xD7";let u=document.createElement("span");u.textContent="Each seat you choose is reserved for every included performance.",c.append(d,u);let m=document.createElement("p");m.className="sl-season-availability";let p=document.createElement("p");p.className="sl-season-checkout-note",p.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits.",r.append(a,l,c,m,p),o.append(s,r);let v=document.createElement("p");v.className="sl-season-status",v.setAttribute("role","status"),v.setAttribute("aria-live","polite"),e.append(t,n,o,v),h(this,dt).append(e),x(this,fe,e),x(this,jt,s),x(this,Ue,v),x(this,Oe,l),x(this,pt,m)},_o=function(){let e=h(this,ee),t=h(this,H).offer,n=h(this,fe).querySelector(".sl-season-hero");n.replaceChildren();let o=document.createElement("div");o.className="sl-season-copy";let s=document.createElement("p");s.className="sl-season-eyebrow",s.textContent=t?.eyebrow??"Season ticket";let r=document.createElement("h2");r.textContent=e.edition?`${e.name} \xB7 ${e.edition}`:e.name;let a=document.createElement("p");a.className="sl-season-promise",a.textContent=`Choose once and keep the same seat for all ${e.occurrenceCount} included performances.`;let l=document.createElement("div");l.className="sl-season-facts";for(let p of[`${e.occurrenceCount} performances`,e.venue,t?.renewalLabel??"Same-seat package"].filter(Boolean)){let v=document.createElement("span");v.className="sl-season-fact",v.textContent=p,l.append(v)}o.append(s,r,a,l),n.append(o);let c=document.createElement("div");c.className="sl-season-offer";let d=document.createElement("span");d.className="sl-season-offer-label";let u=w(this,k,mi).call(this);if(u){d.textContent=b("season.packagePriceLabel","Package price"),c.append(d,w(this,k,Dc).call(this,u,e.occurrenceCount));let p=document.createElement("span");p.className="sl-season-price-note",p.textContent=b("season.packagePricePerSeat","Per seat, for the whole package."),c.append(p),n.append(c),w(this,k,No).call(this,n,t),w(this,k,Do).call(this,n,e),w(this,k,lt).call(this);return}d.textContent=t?.priceLabel?"Season package":"Package price";let m=document.createElement(t?.priceLabel?"strong":"span");if(m.className=t?.priceLabel?"sl-season-price":"sl-season-price-note",m.textContent=t?.priceLabel??"Confirmed by your ticketing platform at checkout",c.append(d,m),t?.compareAtPriceLabel){let p=document.createElement("span");p.className="sl-season-was",p.textContent=t.compareAtPriceLabel,c.append(p)}if(t?.savingsLabel){let p=document.createElement("span");p.className="sl-season-saving",p.textContent=t.savingsLabel,c.append(p)}if(t?.priceNote){let p=document.createElement("span");p.className="sl-season-price-note",p.textContent=t.priceNote,c.append(p)}n.append(c),w(this,k,No).call(this,n,t),w(this,k,Do).call(this,n,e),w(this,k,lt).call(this)},No=function(e,t){if(!t?.benefits?.length)return;let n=document.createElement("ul");n.className="sl-season-benefits";for(let o of t.benefits.slice(0,6)){let s=document.createElement("li");s.textContent=o,n.append(s)}e.append(n)},Do=function(e,t){let n=document.createElement("details");n.className="sl-season-dates";let o=document.createElement("summary");o.textContent=`All ${t.occurrenceCount} performances included`;let s=document.createElement("ol");s.className="sl-season-date-list";for(let r of t.occurrences){let a=document.createElement("li");a.className="sl-season-date";let l=document.createElement("b");l.textContent=r.name;let c=xm(r,t.timezone,h(this,H).locale),d=document.createElement("time");r.startsAt!=null&&(d.dateTime=new Date(r.startsAt).toISOString()),d.textContent=c.time?`${c.date} \xB7 ${c.time}`:c.date,a.append(l,d),s.append(a)}n.append(o,s),e.append(n)},Bo=function(e,t){if(e.state==="booked")return x(this,U,null),h(this,X).forget(e.holdId),h(this,ne)?.notifyGroupSettled("booked"),w(this,k,Re).call(this,"complete"),w(this,k,K).call(this,{kind:"booked",message:`Your Season booking is complete for all ${h(this,ee).occurrenceCount} performances. No further checkout action is needed.`,operationId:e.operationId}),h(this,H).onHoldChange?.(null),null;if(e.state==="partial_terminal")return x(this,U,null),x(this,ue,[]),h(this,X).forget(e.holdId),h(this,ne)?.notifyGroupSettled("lost"),w(this,k,lt).call(this),w(this,k,Re).call(this,"review"),w(this,k,K).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),h(this,H).onHoldChange?.(null),null;if(e.state!=="committed")return x(this,U,null),h(this,X).forget(e.holdId),h(this,ne)?.notifyGroupSettled("lost"),w(this,k,K).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),h(this,H).onHoldChange?.(null),null;let n=Ac(h(this,ee),e),o=h(this,U)?.holdId!==n.holdId;return x(this,U,n),w(this,k,lt).call(this),w(this,k,Re).call(this,"review"),h(this,H).onHoldChange?.(n),w(this,k,K).call(this,{kind:"held",message:`Your seats are held for all ${h(this,ee).occurrenceCount} performances. Review and continue to checkout.`,operationId:e.operationId}),o&&t&&h(this,H).onHold?.(n),n},Rn=function(){x(this,U,null),x(this,ue,[]),w(this,k,lt).call(this),w(this,k,Re).call(this,"choose"),h(this,H).onHoldChange?.(null)},lt=function(){if(!h(this,Oe))return;let e=h(this,ue).length;if(!e)h(this,Oe).textContent="Choose a seat on the map. Unavailable seats are already booked on at least one included performance.";else{h(this,Oe).replaceChildren();let t=document.createElement("strong");t.textContent=h(this,ue).join(", "),h(this,Oe).append(t,` \xB7 ${e} Season seat${e===1?"":"s"} across all ${h(this,ee)?.occurrenceCount??0} performances`)}h(this,pt)&&h(this,Ie)&&(h(this,pt).textContent=`${h(this,Ie).freeCount} seat${h(this,Ie).freeCount===1?"":"s"} currently available for the complete Season`),w(this,k,Oc).call(this),w(this,k,_c).call(this)},Oc=function(){let e=h(this,fe)?.querySelector(".sl-season-summary-card");if(!e)return;e.querySelector(".sl-season-package-total")?.remove();let t=w(this,k,Fo).call(this);if(t==null)return;let n=h(this,qe)?.currency??h(this,ee)?.currency??"USD",o=h(this,ee)?.occurrenceCount??0,s=document.createElement("p");s.className="sl-season-package-total";let r=document.createElement("span");r.textContent=b("season.packageTotal","Package total");let a=document.createElement("strong");a.textContent=w(this,k,Vo).call(this,t,n);let l=document.createElement("span");l.className="sl-season-package-total-scope",l.textContent=b("season.priceForAllDates","for all {count} dates").replace("{count}",String(o)),s.append(r,a,l);let c=e.querySelector(".sl-season-checkout-note");c?e.insertBefore(s,c):e.append(s)},_c=function(){let e=h(this,fe)?.querySelector(".sl-season-checkout-note");if(e){if(h(this,ut)==="hosted"){e.textContent=b("season.hostedCheckoutNote","You pay for the whole package here. Your tickets for every performance arrive by email.");return}if(w(this,k,mi).call(this)){e.textContent=b("season.serverCheckoutPricedNote","Payment and admission passes are completed in the checkout on this page.");return}e.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits."}},Re=function(e){let t=e==="choose"?0:e==="review"?1:e==="checkout"?2:3;h(this,fe)?.querySelectorAll(".sl-season-progress li").forEach((n,o)=>{n.dataset.state=o<t?"done":o===t?"current":"upcoming";let s=n.querySelector("span");s&&(s.textContent=o<t?"\u2713":String(o+1))})},mi=function(){let e=h(this,qe)?.packages;if(!e?.length)return null;let t=h(this,ee)?.planActivationId,n=e.find(r=>r.planKey===t);if(n)return n;let o=h(this,Kt)?.session?.planActivationIds;return(o?.length?e.filter(r=>o.includes(r.planKey)):[])[0]??e[0]},Nc=function(e){let t=w(this,k,mi).call(this)?.prices.find(n=>n.categoryKey===e);return t?t.unitPrice:null},Dc=function(e,t){let n=document.createElement("ul");n.className="sl-season-price-lines";let o=h(this,qe)?.currency??h(this,ee)?.currency??"USD";for(let s of e.prices){let r=document.createElement("li"),a=document.createElement("span");a.className="sl-season-price-category",a.textContent=h(this,X).categoryLabel(s.categoryKey);let l=document.createElement("strong");l.className="sl-season-price",l.textContent=w(this,k,Vo).call(this,s.unitPrice,o);let c=document.createElement("span");c.className="sl-season-price-scope",c.textContent=b("season.priceForAllDates","for all {count} dates").replace("{count}",String(t)),r.append(a,l,c),n.append(r)}return n},Fo=function(){if(!h(this,ue).length||!w(this,k,mi).call(this))return null;let e=0;for(let t of h(this,ue)){let n=h(this,gi).get(t),o=n?w(this,k,Nc).call(this,n):null;if(o==null)return null;e+=o}return e},Vo=function(e,t){let n=Mc(e,t),o=Number.isInteger(n);return Lc(n,t,{locale:h(this,H).locale,fallback:(s,r)=>`${s} ${r}`,...o?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},Bc=function(e){let t=e.reason==="audience_not_public"?b("season.accessNotPublic","This season isn't open for online booking yet."):e.reason==="sales_not_open"?b("season.accessSalesNotOpen","Season tickets aren't on sale right now. Check back when sales open."):e.reason==="origin_not_allowed"?b("season.accessOriginNotAllowed","This season can't be booked from this page."):b("season.accessUnavailable","Season tickets can't be loaded right now. Please try again later.");w(this,k,K).call(this,{kind:"failed",message:t})},Fc=async function(e){if(!h(this,qt)){x(this,qt,!0);try{let t=h(this,qe)?.currency??h(this,ee)?.currency??"USD",n=w(this,k,Fo).call(this);if(n==null){w(this,k,K).call(this,{kind:"failed",message:b("season.checkoutNotPriced","We can\u2019t price this package here. Your seats are still held \u2014 please continue in the checkout on this page."),operationId:e.operationId});return}await w(this,k,$o).call(this,{kind:"pay",provider:null,order:{holdId:e.operationId,expiresAt:e.expiresAt,currency:t,total:Mc(n,t),labels:[...h(this,ue)]}})}finally{x(this,qt,!1)}}},Vc=function(){if(h(this,ut)!=="hosted")return;let e=_t(h(this,H).season);e?.outcome!=="success"||!e.orderId||(w(this,k,Re).call(this,"checkout"),w(this,k,$o).call(this,{kind:"resume",orderId:e.orderId}))},$o=async function(e){let t;try{({mountCheckout:t}=await gt())}catch(o){h(this,H).onError?.(o),w(this,k,K).call(this,{kind:"failed",message:b("season.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held. Please try again.")});return}let n=h(this,ne)?.root;h(this,ge)||!n||(w(this,k,zo).call(this),x(this,mt,t({root:n,state:e,eventKey:h(this,H).season,formatMoney:(o,s)=>Lc(o,s,{locale:h(this,H).locale,fallback:(r,a)=>`${r} ${a}`,...Number.isInteger(o)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:o=>h(this,le).checkout({operationId:o.holdId,buyerEmail:o.buyerEmail,...o.buyerName?{buyerName:o.buyerName}:{},...h(this,H).returnUrl?{returnUrl:h(this,H).returnUrl}:{}}),orderStatus:o=>h(this,le).orderStatus(o),onCancel:()=>{x(this,mt,null),h(this,U)&&w(this,k,Re).call(this,"review")},onConfirmed:o=>{h(this,H).onOrderConfirmed?.(o),w(this,k,Re).call(this,"complete"),w(this,k,K).call(this,{kind:"booked",message:b("season.orderConfirmed","Your season tickets are confirmed for every included performance.")})},onError:o=>h(this,H).onError?.(o)})))},zo=function(){h(this,mt)?.destroy(),x(this,mt,null)},K=function(e,t=!1){h(this,Ue)&&(h(this,Ue).textContent=e.message,h(this,Ue).dataset.kind=e.kind),h(this,fe)&&(h(this,fe).dataset.busy=String(t)),h(this,H).onStatusChange?.(e)},ct=function(e,t){let n=e instanceof W&&e.reason==="provider_failed"&&h(this,Ut)?new W(h(this,Ut)):e;if(n instanceof W)return h(this,H).onError?.(n),n;let o=n instanceof F?`Season selection unavailable (${n.code}).`:"Season selection could not be completed.";return w(this,k,K).call(this,{kind:"failed",message:o,operationId:t}),h(this,H).onError?.(n),n},$c=function(e){h(this,ge)||(e instanceof W||w(this,k,K).call(this,{kind:"failed",message:b("season.sessionEnded","The seat map stopped updating. Reload the page to see which seats are free now.")}),h(this,H).onError?.(e))},jo=function(){if(h(this,ge))throw new Error("seatlayer: SeasonPicker was destroyed")},$t=function(){if(w(this,k,jo).call(this),!h(this,ee)||!h(this,ne))throw new Error("seatlayer: render SeasonPicker before using it")};function km(i,e={}){let t=e.origin??"";if(!t)try{t=new URL(i.src,window.location.href).origin}catch{t=""}let n=!1,o=null,s=null,r=null,a="",l=null,c="",d=()=>{if(n)return;n=!0,o=i.getAttribute("style"),Object.assign(i.style,{position:"fixed",inset:"0",margin:"0",border:"0",zIndex:"2147483000",background:c||"transparent"}),i.style.width="100vw",i.style.height="100vh",i.style.width="100dvw",i.style.height="100dvh";let p=document.documentElement;s=p.style.overflow,p.style.overflow="hidden",document.body&&(r=document.body.style.overflow,document.body.style.overflow="hidden"),l=v=>{v.key==="Escape"&&u()},window.addEventListener("keydown",l)},u=()=>{n&&(n=!1,o===null?i.removeAttribute("style"):i.setAttribute("style",o),o=null,a&&(i.style.height=a),s!==null&&(document.documentElement.style.overflow=s,s=null),r!==null&&document.body&&(document.body.style.overflow=r,r=null),l&&(window.removeEventListener("keydown",l),l=null))},m=p=>{if(p.source!==i.contentWindow||t&&p.origin!==t||!p.data||typeof p.data!="object")return;let v=p.data;if(v.type==="seatlayer:height"){typeof v.px=="number"&&Number.isFinite(v.px)&&v.px>0&&(a=`${Math.round(v.px)}px`,n||(i.style.height=a));return}v.type==="seatlayer:fullscreen"&&(typeof v.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(v.background)&&(c=v.background,n&&(i.style.background=c)),v.on===!0?d():v.on===!1&&u())};return window.addEventListener("message",m),()=>{window.removeEventListener("message",m),u()}}export{V as ApiError,ae as BuyerAccessContext,W as BuyerAccessUnavailableError,Ce as BuyerRealtimeClient,oo as EmbeddedDesigner,Q as PerformanceGroupDestroyedError,Lo as PerformanceGroupPicker,$r as SEATING_CHART_CALLBACK_PROPS,Br as SEATING_CHART_HANDLE_METHODS,Fr as SEATING_CHART_IDENTITY_PROPS,Vr as SEATING_CHART_VALUE_PROPS,F as SeasonApiError,Oo as SeasonPicker,Ln as SeasonPublicSessionRefused,Mn as SeasonRecoveryTimeoutError,$e as SeatPicker,io as SeatingChart,km as attachPickerFrame,Dp as bindSeatingChartHandle,Bp as buildSeatingChartOptions,ti as createBuyerAccessContext,Yt as createControllerSink,ao as parseTicketOfferAvailability,Du as prewarmSeatPicker,li as shortOperationReference,Jr as ticketOfferPrices};
3408
+ `,document.head.appendChild(n)}var af="https://api.seatlayer.io",lf=6e4,cf=2e3,df=1e3,pf=36e5,hf=5e3,uf=5e3,mf=15e3,ff=12e4,gf=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),ie=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function bf(n){return new Promise(e=>setTimeout(e,n))}function ps(n){let e=Number(n.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(hf,e*1e3)):1e3}function tn(n,e){return`/pub/performance-groups/${encodeURIComponent(n)}/operations/${encodeURIComponent(e)}`}function Nn(n){return n.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var hs=class{constructor(e,t,i){this.api=e;this.sink=t;this.intervalMs=i;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),o=[...new Set([...this.prior.keys(),...t.keys()])].filter(s=>this.prior.get(s)!==t.get(s)).map(s=>({label:s,status:t.get(s)??"blocked"}));this.prior=t,o.length&&this.sink.applyStatuses(o),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof ie){this.stop();return}if(wi(e)){this.stop(),this.api.sessionEnded(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},co=class{constructor(e,t){this.descriptorCache=null;this.chartRequest=null;this.objectsCache=null;this.objectsEtag=null;this.activePerformanceKey=null;this.includedEventKeys=new Set;this.reuseObjectsCacheOnce=!1;this.selectionsByEvent=new Map;this.allocationsByHold=new Map;this.pendingOperationId=null;this.operationByHold=new Map;this.knownRevision=null;this.destroyed=!1;this.aborter=new AbortController;this.adoptFailure=null;this.settleTimer=null;this.settleOperationId=null;this.settleStartedAt=0;this.settleState=null;this.settleVisibility=null;this.lastRecovery={kind:"idle"};this.seededDescriptor=null;if(!e)throw new Error("seatlayer: `performanceGroup` key is required");this.groupKey=e,this.base=(t.apiBase??af).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??lf,this.realtimePollMs=Math.max(500,t.realtimePollMs??cf),this.selectionMode=t.selectionMode??"same_seat",this.partySize=t.partySize??null,this.onOperationState=t.onOperationState,this.onRecoveryState=t.onRecoveryState,this.onAvailability=t.onAvailability,this.onSessionEnded=t.onSessionEnded,this.access.onRenewed(o=>this.adoptSession(o));let i=this.readOperationRecord();i&&this.storedIsUndecided(i)&&(this.pendingOperationId=i.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}seedDescriptor(e){e.key===this.groupKey&&Array.isArray(e.performances)&&(this.seededDescriptor=e)}async descriptor(){let e=this.seededDescriptor;this.seededDescriptor=null;let t=e?{performanceGroup:e}:await this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/descriptor`);return this.descriptorCache=t.performanceGroup,this.includedEventKeys.size||(this.includedEventKeys=new Set(t.performanceGroup.performances.map(i=>i.eventKey))),t.performanceGroup.revision&&(this.knownRevision=t.performanceGroup.revision),this.activePerformanceKey??=t.performanceGroup.performances[0]?.eventKey??null,t.performanceGroup}async chart(e){this.chartRequest??=this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/chart`).catch(o=>{throw this.chartRequest=null,o});let[t,i]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:i,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new j(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",i=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let r=await this.authorized(i,this.objectsCache&&this.objectsEtag?{headers:{"If-None-Match":this.objectsEtag}}:{});if(r.status===304)this.objectsCache||(this.objectsEtag=null);else{if(!r.ok)return this.throwResponse(r);this.objectsCache=await this.responseJson(r),this.objectsEtag=r.headers.get("ETag")}}if(!this.objectsCache)throw new j(502,"group_projection_unavailable","group_projection_unavailable");if(this.selectionMode==="same_seat"&&!t){let r=this.objectsCache;return this.noteAvailability(r,r.salesClosed,r),r}let o=this.objectsCache;if(this.selectionMode==="same_seat"){let r=o.performances.filter(h=>this.includedEventKeys.has(h.eventKey));if(!r.length)throw new j(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(r[0]?.seats??{}),l=Object.fromEntries(a.map(h=>[h,r.every(m=>m.seats[h]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(h=>{let m=r.filter(u=>u.seats[h]!=="free").map(u=>u.eventKey);return m.length>0&&m.length<r.length?[[h,m]]:[]})),d={seats:l,partial:c,hidden:[...new Set(r.flatMap(h=>h.hidden??[]))],closed:[...new Set(r.flatMap(h=>h.closed??[]))],revision:o.revision,state:o.state,salesClosed:r.some(h=>h.salesClosed)};return this.noteAvailability(o,d.salesClosed,d),d}let s=o.performances.find(r=>r.eventKey===this.activePerformanceKey);if(!s)throw new j(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(o,o.salesClosed||o.performances.some(r=>r.salesClosed),s),s}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new j(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=null,this.objectsEtag=null,this.selectionsByEvent.clear(),this.activePerformanceKey=this.descriptorCache?.performances[0]?.eventKey??this.activePerformanceKey)}setActivePerformance(e){if(this.descriptorCache&&!this.descriptorCache.performances.some(t=>t.eventKey===e))throw new j(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(i=>i.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(i=>!t.has(i)))throw new j(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(i=>({...i})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(i=>({...i}))}))}async hold(e,t,i,o){if(this.assertUsable(),o)throw new j(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let s=t.map(c=>c.label),r={labels:s};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(r.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new j(409,"group_selection_incomplete","group_selection_incomplete");this.setPerformanceSelections(this.activePerformanceKey,t);let c=this.descriptorCache.performances.filter(d=>this.includedEventKeys.has(d.eventKey)).map(d=>({eventKey:d.eventKey,selections:this.selectionsByEvent.get(d.eventKey)??[]}));if(c.some(d=>d.selections.length!==this.partySize))throw new j(409,"group_selection_incomplete","group_selection_incomplete");r={selectionMode:"per_performance",allocations:c,...this.descriptorCache.inclusionMode==="flexible_dates"?{eventKeys:this.includedPerformanceKeys()}:{}}}let a=this.pendingOperationId??`pghop_${crypto.randomUUID()}`;this.beginOperation(a),this.onOperationState?.({operationId:a,state:"preparing",decision:null});let l;try{l=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/hold`,{method:"POST",body:JSON.stringify({operationId:a,...r,...i?{ttlMs:i}:{}})})}catch(c){if(c instanceof ie)throw c;if(c instanceof ee)throw this.failOperation(a),c;return this.recover(a,s,Date.now()+this.recoveryTimeoutMs)}if(l.status===201||l.status===202||l.status===504){let c=await this.responseJson(l);return this.emit(c.operation),l.status===201?this.complete(c.operation):this.recover(a,s,Date.now()+this.recoveryTimeoutMs,ps(l))}if(l.status===503){let c=await l.clone().json().catch(()=>null);if((c?.code??c?.error)==="performance_group_abort_pending"){let d=c?.operation?.operationId??a;return this.beginOperation(d),c?.operation&&this.emit(c.operation),this.recover(d,s,Date.now()+this.recoveryTimeoutMs,ps(l))}}try{return await this.throwResponse(l,s)}catch(c){throw this.failOperation(a),c}}async release(e,t,i){this.assertUsable();let o=this.operationForHold(i),s=await this.json(`${tn(this.groupKey,o)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(i),this.allocationsByHold.delete(i),this.clearOperationRecord(),s}async resume(e,t){this.assertUsable();let i=this.operationForHold(t),o=await this.json(tn(this.groupKey,i));return this.complete(o.operation)}async extend(e,t,i=12e4){this.assertUsable();let o=this.operationForHold(t),s=Math.max(df,Math.min(pf,Math.round(i))),r=await this.json(`${tn(this.groupKey,o)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:s})}),a=this.complete(r.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}async paymentOptions(){let e=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/payment-options`);return e.status===409?null:e.ok?this.responseJson(e):this.throwResponse(e)}async checkout(e){return this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/checkout`,{method:"POST",body:JSON.stringify(e)})}async orderStatus(e){let t=await this.fetcher(`${this.base}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit",signal:this.aborter.signal});return t.ok?t.json():this.throwResponse(t)}bestAvailable(){return Promise.reject(new j(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new hs(this,t,this.realtimePollMs)}sessionEnded(e){this.destroyed||this.onSessionEnded?.(e)}operationIdForHold(e){return this.operationByHold.get(e)??this.readMapping(e)}rememberOperation(e,t){!e||!t||(this.operationByHold.set(e,t),this.writeMapping(e,t))}async restoreOperation(){let e=this.readOperationRecord();if(!e)return null;if(!this.storedIsUndecided(e)&&e.state!=="committed"&&e.state!=="booked")return this.clearOperationRecord(),null;this.pendingOperationId=e.operationId,this.emitRecovery({kind:"pending",operationId:e.operationId,phase:e.state==="undecided"?"unknown":e.state,longRunning:!1,reference:Nn(e.operationId)});let t;try{t=await this.authorized(tn(this.groupKey,e.operationId))}catch(s){return s instanceof ie||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let i=await this.responseJson(t);this.emit(i.operation);let o=i.operation.state;return o==="committed"||o==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(i.operation)):o==="aborted"||o==="expired"?(this.failOperation(e.operationId),null):this.recover(e.operationId,[],Date.now()+this.recoveryTimeoutMs)}async retryRecovery(){this.assertUsable();let e=this.pendingOperationId??this.readOperationRecord()?.operationId??null;return e?(this.pendingOperationId=e,this.recover(e,[],Date.now()+this.recoveryTimeoutMs)):null}watchSettlement(e){if(this.destroyed)return;let t=this.operationIdForHold(e);!t||t===this.settleOperationId||(this.stopSettlementWatch(),this.settleOperationId=t,this.settleStartedAt=Date.now(),this.settleState="committed",typeof document<"u"&&(this.settleVisibility=()=>{document.hidden||!this.settleOperationId||this.pollSettlement()},document.addEventListener("visibilitychange",this.settleVisibility)),this.scheduleSettlementPoll())}stopSettlementWatch(){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null,this.settleOperationId=null,this.settleState=null,this.settleVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",this.settleVisibility),this.settleVisibility=null}scheduleSettlementPoll(){if(this.destroyed||!this.settleOperationId)return;if(this.settleTimer&&clearTimeout(this.settleTimer),typeof document<"u"&&document.hidden){this.settleTimer=null;return}let t=Date.now()-this.settleStartedAt>=ff?mf:uf;this.settleTimer=setTimeout(()=>{this.pollSettlement()},t)}settled(e){return e==="booked"||e==="expired"||e==="aborted"}async pollSettlement(){let e=this.settleOperationId;if(this.destroyed||!e)return;if(typeof document<"u"&&document.hidden){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null;return}let t;try{let o=await this.authorized(tn(this.groupKey,e));if(!o.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(o)).operation}catch(o){return o instanceof ie?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let i=t.state!==this.settleState;if(this.settleState=t.state,i&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}i&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||gf.has(e.state)}writeOperationRecord(e){try{window.sessionStorage.setItem(this.operationRecordKey(),JSON.stringify(e))}catch{}}clearOperationRecord(){try{window.sessionStorage.removeItem(this.operationRecordKey())}catch{}}beginOperation(e){this.pendingOperationId=e;let t=this.readOperationRecord();this.writeOperationRecord({operationId:e,groupKey:this.groupKey,state:"undecided",createdAt:t?.operationId===e?t.createdAt:Date.now()})}noteOperationState(e,t){let i=this.readOperationRecord();!i||i.operationId!==e||this.writeOperationRecord({...i,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let o=0;o<2;o++){if(this.destroyed)return;try{if((await this.fetcher(`${this.base}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit",signal:this.aborter.signal})).ok){this.adoptFailure=null;return}}catch{}}if(this.destroyed)return;this.adoptFailure=new j(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let i=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:i,reference:i?Nn(i):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,i,o=100){let s=o,r=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=i;){if(this.destroyed)throw new ie;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=r,reference:Nn(e)}),await bf(s),this.destroyed)throw new ie;let l;try{l=await this.authorized(tn(this.groupKey,e))}catch(h){if(h instanceof ie)throw h;if(h instanceof ee)throw this.recoveryFailed(e,"request_failed"),h;s=Math.min(2e3,Math.max(100,s*2));continue}if(l.status===404){s=Math.min(1e3,Math.max(100,s*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let d=(await this.responseJson(l)).operation;if(a=d.state,this.noteOperationState(e,d.state),this.emit(d),d.state==="committed"||d.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(d);if(d.state==="aborted"||d.state==="expired")throw this.failOperation(e),new j(409,"conflict","conflict",t.map(h=>({label:h,status:"held"})));s=ps(l)}throw this.recoveryFailed(e,"deadline"),new j(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:Nn(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,i){if(this.destroyed||!this.onAvailability)return;let o=e.state??this.descriptorCache?.state??"active",s=e.revision??null,r=!!s&&!!this.knownRevision&&s!==this.knownRevision;s&&!this.knownRevision&&(this.knownRevision=s);let a=i?.partial??{},l=Object.values(i?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(i?.seats??{}).filter(c=>i.seats[c]!=="free"&&!(c in a)).length,state:o,salesClosed:!!t||o!=="active",revision:s,revisionChanged:r})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new j(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let i=t.find(o=>o.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:i??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new j(404,"group_hold_not_found","group_hold_not_found");return t}mappingKey(e){return`@seatlayer/performance-group-hold/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}/${encodeURIComponent(e)}`}readMapping(e){try{return window.sessionStorage.getItem(this.mappingKey(e))}catch{return null}}writeMapping(e,t){try{window.sessionStorage.setItem(this.mappingKey(e),t)}catch{}}assertUsable(){if(this.destroyed)throw new ie;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},i=!1){if(this.destroyed)throw new ie;if(this.adoptFailure)throw this.adoptFailure;let o={...t.headers};t.body!==void 0&&(o["Content-Type"]="application/json");let s=await this.access.authorization(i?"unauthorized":"initial");if(this.destroyed)throw new ie;if(this.adoptFailure)throw this.adoptFailure;if(!s)throw new Error("performance_group_buyer_access_required");o.Authorization=s;let r=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:o,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!i&&(r.status===401||r.status===403||r.status===422)){let a=await r.clone().json().catch(()=>null);if(await this.access.handleFailure(r.status,a?.code??a?.error,s))return this.authorized(e,t,!0)}return r}async json(e,t={}){let i=await this.authorized(e,t);return i.ok?this.responseJson(i):this.throwResponse(i)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let o=await e.json().catch(()=>null)??{},s=o.code??o.error??`request_failed_${e.status}`;throw e.status===409&&!o.conflicts?.length&&t.length&&(o.conflicts=t.map(r=>({label:r,status:"held"}))),new j(e.status,o.error??s,s,o.conflicts)}};import{formatMoney as yf,t as us}from"@seatlayer/core";var nn,wt,et,on,Dn,tt,md,po,ho=class{constructor(e){this.options=e;E(this,tt);E(this,nn,null);E(this,wt,!1);E(this,et,null);E(this,on,!1);E(this,Dn,!1)}get mode(){return p(this,wt)?"hosted":"handoff"}async prepare(){try{k(this,nn,await this.options.api.paymentOptions()),k(this,wt,!!p(this,nn))}catch(e){k(this,wt,!1),this.options.onError?.(e)}}async open(e,t){if(!p(this,wt)||p(this,on))return;if(t.selectionMode!=="same_seat"){this.options.announce(us("picker.group.hostedPerPerformance"));return}let i=p(this,nn),o=t.seatLabels.length;if(i.bookingMode==="paid"&&!i.providers.length){await w(this,tt,po).call(this,e,t.descriptor,{kind:"unavailable",reason:i.reason==="unavailable_for_run"?"unavailable_for_event":"not_configured",seatCount:o});return}k(this,on,!0);try{let{total:s,currency:r,lines:a}=w(this,tt,md).call(this,t.holdId,t.descriptor);await w(this,tt,po).call(this,e,t.descriptor,{kind:"pay",provider:null,free:i.bookingMode==="free",order:{holdId:t.operationId,expiresAt:t.expiresAt,currency:r,total:s,labels:[...t.seatLabels],lines:a}})}finally{k(this,on,!1)}}resume(e,t,i){let o=en(t);o?.outcome!=="success"||!o.orderId||w(this,tt,po).call(this,e,i,{kind:"resume",orderId:o.orderId})}destroy(){k(this,Dn,!0),p(this,et)?.destroy(),k(this,et,null)}};nn=new WeakMap,wt=new WeakMap,et=new WeakMap,on=new WeakMap,Dn=new WeakMap,tt=new WeakSet,md=function(e,t){let i=this.options.api.allocationsForHold(e),o=i.flatMap(a=>a.items)[0]?.currency??t.currency,s=0,r=i.map(a=>{let l=a.items.reduce((d,h)=>d+Math.round(h.unitPrice*100)*(h.quantity??1),0);s+=l;let c=t.performances.find(d=>d.eventKey===a.eventKey);return{label:a.items.map(d=>d.label).join(", "),detail:c?Jt(c,this.options.locale):null,amount:l/100}});return{total:s/100,currency:o,lines:r}},po=async function(e,t,i){let o;try{({mountCheckout:o}=await Bt())}catch(r){this.options.onError?.(r),this.options.announce(us("picker.group.checkoutCouldNotOpen"));return}if(p(this,Dn)||!e)return;p(this,et)?.destroy();let s=this.options.api;k(this,et,o({root:e,state:i,eventKey:s.groupKey,event:{name:t.name,detail:us("picker.group.checkoutDates").replace("{count}",String(t.performanceCount))},formatMoney:(r,a)=>yf(r,a,{locale:this.options.locale,fallback:(l,c)=>`${l} ${c}`,...Number.isInteger(r)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:async r=>{let a=await s.checkout({operationId:r.holdId,buyerEmail:r.buyerEmail,...r.buyerName?{buyerName:r.buyerName}:{},...this.options.returnUrl?{returnUrl:this.options.returnUrl}:{}});return{orderId:a.orderId,totalMinor:a.totalMinor??0,currency:a.currency??t.currency,expiresAt:a.expiresAt??0,...a.redirectUrl?{redirectUrl:a.redirectUrl}:{},...a.status==="confirmed"?{status:"confirmed"}:{}}},orderStatus:r=>s.orderStatus(r),onCancel:()=>{k(this,et,null)},onConfirmed:r=>this.options.onConfirmed?.(r),onError:r=>this.options.onError?.(r)}))};var vf={audience_not_public:"audience_not_public",sales_not_open:"sales_not_open",invalid_origin:"origin_not_allowed"},wf=3e4;function xf(n,e){if(!n||typeof n!="object"||Array.isArray(n))return!1;let t=n;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.performanceGroupKey===e}var ms=class extends Error{constructor(t,i){super(`performance_group_public_session_refused:${t}`);this.reason=t;this.status=i;this.name="PerformanceGroupPublicSessionRefused"}},Ve,nt,Bn,sn,fs=class{constructor(e){this.options=e;E(this,Ve,null);E(this,nt,null);E(this,Bn);E(this,sn);k(this,Bn,e.fetch??globalThis.fetch.bind(globalThis)),k(this,sn,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return p(this,Ve)}async mint(e=!1){if(e&&k(this,Ve,null),p(this,Ve)&&p(this,Ve).expiresAt-wf>Date.now())return p(this,Ve);if(p(this,nt))return p(this,nt);let t=(async()=>{let i=await p(this,Bn).call(this,`${this.options.base}/pub/performance-groups/${encodeURIComponent(this.options.performanceGroup)}/sessions`,{method:"POST",body:JSON.stringify(p(this,sn)?{origin:p(this,sn)}:{}),credentials:"omit"}),o=await i.json().catch(()=>null);if(!i.ok){let s=o?.code??o?.error,r=i.status===403&&s?vf[s]:void 0;throw r?(this.options.onRefused?.({reason:r,code:s,status:i.status,retryable:r==="sales_not_open"}),new ms(r,i.status)):new Error(`performance_group_public_session_failed_${i.status}`)}if(!xf(o,this.options.performanceGroup))throw new Error("performance_group_public_session_invalid");return k(this,Ve,o),o})();k(this,nt,t);try{return await t}finally{p(this,nt)===t&&k(this,nt,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.mint(t);return{token:i.token,expiresAt:i.expiresAt}}};Ve=new WeakMap,nt=new WeakMap,Bn=new WeakMap,sn=new WeakMap;function fd(n){let e=new fs(n);return{access:new pe({provider:({reason:i})=>e.token(i),...n.accessHooks}),loader:e}}var gd="https://api.seatlayer.io";function bd(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var gs=class{constructor(e){this.descriptorValue=null;this.picker=null;this.root=null;this.innerHost=null;this.tabsHost=null;this.prevButton=null;this.nextButton=null;this.heldSummary=null;this.live=null;this.statusHost=null;this.statusCopy=null;this.statusAction=null;this.rendered=!1;this.destroyed=!1;this.continued=!1;this.switchingPerformance=!1;this.operationPending=!1;this.recovery={kind:"idle"};this.availability=null;this.activePerformanceKey=null;this.selectionsByEvent=new Map;this.validByEvent=new Map;this.refreshingComposition=!1;this.activeHandoff=null;this.selectionModeValue="same_seat";this.progressHost=null;this.legendHost=null;this.paneHost=null;this.datesSummaryHost=null;this.datesCardsHost=null;this.resettingFlexibleSelection=!1;this.selectingPartialSeat=!1;this.partialSeatDates=new Map;this.markedLabels=new Set;this.holdTicker=null;this.switchingMode=!1;this.booked=!1;this.refusal=null;if(!e||typeof e!="object")throw new Error("seatlayer: options object is required");if(!e.performanceGroup)throw new Error("seatlayer: `performanceGroup` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!!e.initialHoldId!=!!e.initialOperationId)throw new Error("seatlayer: `initialHoldId` and `initialOperationId` must be supplied together");if((e.selectionMode==="per_performance"||e.allowSelectionModeSwitch)&&(!Number.isSafeInteger(e.numberOfPlacesToSelect)||(e.numberOfPlacesToSelect??0)<1))throw new Error("seatlayer: `numberOfPlacesToSelect` is required for per-performance selection");this.selectionModeValue=e.selectionMode??"same_seat",this.options=e,this.panelId=`sl-pg-panel-${e.performanceGroup}`;let t=i=>{this.refusal=this.refusal&&i.reason==="provider_failed"?this.refusal:i,e.onAccessUnavailable?.(this.refusal)};this.access=e.buyerAccessToken||e.buyerAccessTokenProvider?new pe({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:t}):fd({base:(e.apiBase??gd).replace(/\/$/,""),performanceGroup:e.performanceGroup,onRefused:i=>{this.refusal=i},accessHooks:{onExpired:e.onAccessExpired,onUnavailable:t}}).access,this.api=new co(e.performanceGroup,{apiBase:e.apiBase,access:this.access,selectionMode:e.selectionMode,partySize:e.selectionMode==="per_performance"?e.numberOfPlacesToSelect:void 0,onOperationState:i=>this.operationChanged(i),onRecoveryState:i=>this.recoveryChanged(i),onAvailability:i=>this.availabilityChanged(i),onSessionEnded:i=>this.sessionEnded(i)}),e.initialHoldId&&e.initialOperationId&&this.api.rememberOperation(e.initialHoldId,e.initialOperationId),e.initialDescriptor&&this.api.seedDescriptor(e.initialDescriptor),this.hosted=e.checkout==="hosted"?new ho({api:this.api,locale:e.locale,returnUrl:e.returnUrl,announce:i=>this.showStatus("checkout",i),onConfirmed:i=>e.onOrderConfirmed?.(i),onError:e.onError}):null}get checkoutMode(){return this.hosted?.mode??"handoff"}get mode(){return this.selectionModeValue}get selectionMode(){return this.selectionModeValue}get descriptor(){return this.descriptorValue}get currentHold(){return this.activeHandoff}async render(){if(this.rendered)return this;let e=performance.now();if(this.rendered=!0,ud(),await Sf(this.options.locale),this.options.messages&&Tf(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(i){throw Ee({apiBase:this.options.apiBase??gd,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:Re(this.options.performanceGroup),transport:"pubapi"}),i instanceof ee&&this.refusal?new ee(this.refusal):i}return await this.hosted?.prepare(),this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(bd(this.options.container),t),this.announce(this.copy("picker.group.checkingAvailability")),await this.mountPicker(t),this.destroyed?this:(await this.restoreOperation(),this.destroyed||this.hosted?.resume(this.picker?.root??null,t.key,t),this))}buildChrome(e,t){e.replaceChildren();let i=document.createElement("div");i.className="sl-pg-root",i.dataset.performanceGroup=t.key,i.dataset.selectionMode=this.mode;let o=document.createElement("div");o.className="sl-pg-progress";let s=document.createElement("section");s.className="sl-pg-head",s.setAttribute("aria-labelledby",`sl-pg-title-${t.key}`);let r=document.createElement("h2");r.id=`sl-pg-title-${t.key}`,r.textContent=t.name;let a=document.createElement("p");a.className="sl-pg-summary",a.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceSummary":"picker.group.sameSeatSummary",{count:t.performanceCount});let l=document.createElement("p");l.className="sl-pg-help",l.textContent=this.copy(this.mode==="per_performance"?"picker.group.perPerformanceMapHelp":"picker.group.sameSeatMapHelp");let c=document.createElement("details");c.className="sl-pg-dates",c.open=t.performanceCount<=3;let d=document.createElement("summary");d.textContent=this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:t.performanceCount});let h=document.createElement("div");h.innerHTML=Qo(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(d,h);let m=document.createElement("div");m.className="sl-pg-held-summary",m.hidden=!0,r.hidden=a.hidden=c.hidden=this.options.header===!1,s.append(r,a,l,c,m);let u=document.createElement("div");u.className="sl-pg-legend";let g=document.createElement("div");g.className="sl-pg-pane",g.setAttribute("role","group"),g.setAttribute("aria-label",this.copy("picker.group.yourSelection")),g.hidden=!0;let b=this.mode==="per_performance"?this.performanceTabs(t):null,T=document.createElement("div");T.className="sl-pg-inner",T.id=this.panelId,T.setAttribute("aria-busy","false"),T.dataset.locked="false",this.mode==="per_performance"&&(T.setAttribute("role","tabpanel"),T.tabIndex=-1);let S=document.createElement("div");S.className="sl-pg-status",S.setAttribute("role","status"),S.setAttribute("aria-live","polite"),S.hidden=!0;let x=document.createElement("p"),P=document.createElement("button");P.type="button",P.hidden=!0,P.textContent=this.copy("picker.group.retry"),P.addEventListener("click",()=>{this.retryRecovery()}),S.append(x,P),T.appendChild(S);let _=document.createElement("div");_.className="sl-pg-live",_.setAttribute("role","status"),_.setAttribute("aria-live","polite"),i.append(o,s),b&&i.append(b),i.append(u,T,g,_),e.appendChild(i),this.root=i,this.progressHost=o,this.legendHost=u,this.paneHost=g,this.datesSummaryHost=d,this.datesCardsHost=h,this.innerHost=T,this.heldSummary=m,this.live=_,this.statusHost=S,this.statusCopy=x,this.statusAction=P,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new Je(to({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(i,o)=>{try{this.options.onAnalytics?.(i,{...o,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:i=>this.selectionChanged(i),onSelectionValidityChange:i=>this.selectionValidityChanged(i),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(i,o)=>this.holdChanged(i,o),onCheckout:(i,o)=>this.checkout(i,o),onHoldExpired:()=>{this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()},onError:this.options.onError},{performanceCount:e.performanceCount,selectionMode:this.mode,submissionState:()=>this.submissionState(),suppressPricing:!0,nights:()=>this.nights(),seatMarks:()=>this.seatMarks(),nightSummary:()=>this.nightSummary(),groupSelectionSummary:()=>this.groupSelectionSummary(),activePerformanceLabel:()=>this.activePerformanceLabel(),selectedPerformanceDates:()=>this.mode==="same_seat"&&e.inclusionMode==="flexible_dates"?al(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:i=>{this.switchPerformance(i)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),activate:(i,o)=>{this.selectPartialSeat(i,o)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:i=>this.partialSeatDates.get(i)??this.nights().map(o=>o.eventKey),label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),apply:(i,o)=>this.applySeatDates(i,o,!0)}:null}));this.picker=t,await t.render(),!this.destroyed&&this.updateTabs()}performanceCards(e){return e.performances.map(t=>({eventKey:t.eventKey,name:t.name,iso:new Date(t.startsAt).toISOString(),date:Ui(t,this.options.locale),time:qi(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:Jt(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,i=!!t?.salesClosed||!!t&&t.state!=="active",o=this.mode==="same_seat"&&!i?t?.partial??{}:{},s={};for(let r of this.markedLabels)s[r]=null;if(this.markedLabels.clear(),e>0)for(let[r,a]of Object.entries(o))!a.length||a.length>=e||(s[r]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(r));return s}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!e)return null;let t=Jt(e,this.options.locale),i=e.name?.trim();return i&&i!==t?`${i} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:Jt(e,this.options.locale),labels:(this.selectionsByEvent.get(e.eventKey)??[]).map(t=>t.label),active:e.eventKey===this.activePerformanceKey}))}groupSelectionSummary(){let e=this.includedPerformances();if(!e.length)return null;if(this.mode==="same_seat"){let s=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:s*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:s?e.length:0,perPerformance:s}}let t=e.map(s=>this.selectionsByEvent.get(s.eventKey)?.length??0),i=t.filter(s=>s>0),o=i.length===t.length&&i.every(s=>s===i[0]);return{seats:t.reduce((s,r)=>s+r,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:i.length,perPerformance:o&&i.length?i[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=bl(t,{label:this.copy("picker.group.progressLabel"),done:this.copy("picker.group.stepDone"),current:this.copy("picker.group.stepCurrent"),upcoming:this.copy("picker.group.notStarted")})}syncLegend(){if(!this.legendHost)return;let e=this.availability,t=!!e?.salesClosed||e&&e.state!=="active";if(!e||t){this.legendHost.replaceChildren();return}this.legendHost.innerHTML=cl({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let i=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(s=>s.label)??[],o=this.heldTotal();e.hidden=!1,e.innerHTML=yl({title:this.copy("picker.group.yourSelection"),rows:t.map(s=>({eventKey:s.eventKey,name:`${Ui(s,this.options.locale)} ${qi(s,this.options.locale)}`,labels:i})),empty:this.copy("picker.group.noSeatsChosenYet"),note:o?null:this.copy("picker.group.pricesPerPerformance"),total:o?{label:this.copy("picker.group.total"),amount:o}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:vl(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let o=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!o.length)return null;let s=o.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),r=o[0]?.currency??t.currency;try{return kf(s,r,void 0,this.options.locale)}catch{return`${r} ${s.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(i=>t.has(i.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),i=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=i&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(i?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=Qo(this.performanceCards({...e,performances:t}),this.copy(i&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":i?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,i){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let o=this.api.includedPerformanceKeys();if(o.length===t.length&&o.every(s=>t.includes(s)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(i?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(s){return o.length&&(this.api.setIncludedEventKeys(o),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(s),!1}finally{this.selectingPartialSeat=!1}}syncHoldTicker(){this.booked||(this.activeHandoff&&!this.holdTicker?this.holdTicker=setInterval(()=>this.syncPane(),1e3):!this.activeHandoff&&this.holdTicker&&(clearInterval(this.holdTicker),this.holdTicker=null))}async switchSelectionMode(e){if(!(this.destroyed||this.switchingMode||e===this.mode)&&!(this.activeHandoff||this.holdBlocked())){this.switchingMode=!0;try{this.api.setSelectionMode(e,this.options.numberOfPlacesToSelect),this.selectionModeValue=e,this.picker?.destroy(),this.picker=null,this.selectionsByEvent.clear(),this.validByEvent.clear(),this.markedLabels.clear(),this.availability=null;let t=this.descriptorValue;if(this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(bd(this.options.container),t),await this.mountPicker(t),this.destroyed)return;this.announce(this.copy("picker.group.nightByNightStarted")),this.options.onSelectionModeChange?.(e)}catch(t){if(t instanceof ie)return;this.options.onError?.(t)}finally{this.switchingMode=!1}}}async release(){await this.picker?.release()}close(){this.destroy()}destroy(){if(this.destroyed)return;this.destroyed=!0,this.api.destroy(),this.hosted?.destroy(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.picker;this.root?.setAttribute("hidden","");let t=()=>{e?.destroy(),this.access.clear(),this.root?.remove(),this.root=null,this.picker=null,this.innerHost=null,this.tabsHost=null,this.statusHost=null,this.statusCopy=null,this.statusAction=null,this.live=null};e?.getCurrentHold()&&!this.continued?e.release().catch(()=>{}).finally(t):t()}copy(e,t){let i=this.options.messages?.[e];return i!==void 0?t?i.replace(/\{(\w+)\}/g,(o,s)=>String(t[s]??`{${s}}`)):i:Ef(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let i=document.createElement("button");i.type="button",i.className="sl-pg-step",i.dataset.step="previous",i.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),i.textContent="\u2039",i.addEventListener("click",()=>{this.stepPerformance(-1)});let o=document.createElement("button");o.type="button",o.className="sl-pg-step",o.dataset.step="next",o.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),o.textContent="\u203A",o.addEventListener("click",()=>{this.stepPerformance(1)});let s=document.createElement("div");return s.className="sl-pg-tabs",s.setAttribute("role","tablist"),s.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((r,a)=>{let l=document.createElement("button");l.type="button",l.className="sl-pg-tab",l.id=`sl-pg-tab-${e.key}-${r.eventKey}`,l.dataset.eventKey=r.eventKey,l.dataset.state="not-started",l.setAttribute("role","tab"),l.setAttribute("aria-selected",String(a===0)),l.setAttribute("aria-controls",this.panelId),l.tabIndex=a===0?0:-1;let c=document.createElement("span");c.className="sl-pg-tab-name",c.textContent=r.name;let d=document.createElement("span");d.className="sl-pg-tab-state",d.textContent=this.copy("picker.group.stillNeedsSeat");let h=document.createElement("span");h.className="sl-pg-tab-badge",h.textContent=this.copy("picker.group.chosenOfTotal",{chosen:0,total:this.options.numberOfPlacesToSelect??1}),l.append(c,h,d),l.addEventListener("click",()=>{this.switchPerformance(r.eventKey)}),l.addEventListener("keydown",m=>this.tabKeydown(m)),s.appendChild(l)}),t.append(i,s,o),this.tabsHost=s,this.prevButton=i,this.nextButton=o,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),i=t.findIndex(a=>a===e.target);if(i<0)return;let o=getComputedStyle(this.tabsHost??document.body).direction==="rtl",s=-1;switch(e.key){case"ArrowRight":s=i+(o?-1:1);break;case"ArrowLeft":s=i+(o?1:-1);break;case"ArrowDown":s=i+1;break;case"ArrowUp":s=i-1;break;case"Home":s=0;break;case"End":s=t.length-1;break;default:return}if(s<0||s>=t.length)return;e.preventDefault();let r=t[s];r.focus({preventScroll:!0}),r.disabled||this.switchPerformance(r.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),i=t.findIndex(s=>s.dataset.eventKey===this.activePerformanceKey),o=t[i+e];!o||o.disabled||(o.focus({preventScroll:!0}),this.switchPerformance(o.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let o=!this.holdBlocked();return{complete:e.length,total:e.length,ready:o}}let t=this.options.numberOfPlacesToSelect,i=e.filter(o=>this.selectionsByEvent.get(o.eventKey)?.length===t&&this.validByEvent.get(o.eventKey)!==!1).length;return{complete:i,total:e.length,ready:i===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(i=>i.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(i=>this.options.onError?.(i)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(i=>({...i}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(i=>({label:i.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,i=(this.selectionsByEvent.get(e)??[]).map(s=>s.label),o=this.copy("picker.group.chosenOfTotal",{chosen:i.length,total:t});return i.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:o}:i.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:i.join(", ")}),badge:o}:i.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:o}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-i.length}),badge:o}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(o=>{let s=o.dataset.eventKey,r=this.tabState(s),a=s===this.activePerformanceKey;o.dataset.state=r.key,o.disabled=t,o.setAttribute("aria-selected",String(a)),o.tabIndex=a?0:-1;let l=o.querySelector(".sl-pg-tab-state");l&&(l.textContent=r.label);let c=o.querySelector(".sl-pg-tab-badge");c&&(c.textContent=r.badge);let d=o.querySelector(".sl-pg-tab-name")?.textContent??s;o.setAttribute("aria-label",`${d}: ${r.badge} \xB7 ${r.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",o.id)});let i=e.findIndex(o=>o.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||i<=0),this.nextButton&&(this.nextButton.disabled=t||i<0||i>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(i=>i.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let i=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(i),i.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(i);let o=this.descriptorValue?.performances.find(s=>s.eventKey===e);o&&this.announce(this.copy("picker.group.performanceOpened",{performance:o.name}))}catch(i){this.options.onError?.(i)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,i={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!i.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...i.reference?{reference:i.reference}:{}})}sessionEnded(e){this.destroyed||(this.showStatus("session_ended",this.copy("picker.accessExpiredTitle")),this.options.onError?.(e))}clearStatus(){this.statusHost&&(this.statusHost.hidden=!0),this.statusAction&&(this.statusAction.hidden=!0),this.options.onStatusChange?.({kind:"idle",message:""})}operationChanged(e){if(this.destroyed)return;let t=e.state==="preparing"||e.state==="commit_pending"||e.state==="abort_pending"||e.state==="expire_pending";if(this.operationPending=t,this.setInteractionLocked(t||this.recovery.kind!=="idle"),this.updateTabs(),t){this.showStatus("pending",this.copy(e.state==="commit_pending"?"picker.group.commitPending":e.state==="abort_pending"||e.state==="expire_pending"?"picker.group.abortPending":"picker.group.securing"));return}if(e.state==="booked"){this.bookingSettled();return}if(e.state==="expired"||e.state==="aborted"){this.activeHandoff&&this.holdLost();return}if(e.state==="committed"){this.clearStatus(),this.announce(this.copy("picker.group.secured")),queueMicrotask(()=>this.innerHost?.querySelector('[data-ref="cta"]')?.focus({preventScroll:!0}));return}e.decision==="abort"&&this.recovery.kind==="idle"&&(this.clearStatus(),this.announce(this.copy("picker.group.notSecured")))}bookingSettled(){if(this.booked)return;this.booked=!0,this.root&&(this.root.dataset.booking="booked"),this.clearStatus(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.activeHandoff?{...this.activeHandoff,bookingState:"booked"}:null;e&&(this.activeHandoff=e),this.syncProgress(),this.syncPane(),this.updateTabs(),this.picker?.notifyGroupSettled("booked"),this.announce(this.copy("picker.group.bookedAll",{count:this.descriptorValue?.performanceCount??0})),e&&this.options.onBooked?.(e)}holdLost(){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.picker?.notifyGroupSettled("lost"),this.announce(this.copy("picker.group.notSecured")),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()}recoveryChanged(e){if(!this.destroyed){if(this.recovery=e,this.setInteractionLocked(this.operationPending||e.kind!=="idle"),this.updateTabs(),this.refreshComposition(),e.kind==="idle"){this.operationPending||this.clearStatus();return}if(e.kind==="pending"){this.showStatus("pending",e.longRunning?this.copy("picker.group.longRunning",{reference:e.reference}):this.copy("picker.group.outcomeUnknown"),{reference:e.reference});return}this.showStatus("recovery_failed",this.copy("picker.group.longRunning",{reference:e.reference}),{retry:e.retryable,reference:e.reference}),this.setInteractionLocked(!1)}}async retryRecovery(){if(!(this.destroyed||this.recovery.kind!=="failed"||!this.recovery.retryable))try{await this.api.retryRecovery()}catch(e){if(e instanceof ie)return;this.options.onError?.(e)}}async restoreOperation(){try{let e=await this.api.restoreOperation();e&&!this.destroyed&&await this.picker?.adoptRestoredHold(e.holdId)}catch(e){if(e instanceof ie)return;this.options.onError?.(e)}}availabilityChanged(e){if(this.destroyed)return;let t=this.availability;if(this.availability=e,e.revisionChanged){this.showStatus("revision_changed",this.copy("picker.group.revisionChanged")),this.reloadDescriptor(e.revision);return}e.salesClosed?this.showStatus("sales_closed",this.copy("picker.group.salesClosed")):t?.salesClosed&&this.clearStatus(),this.updateTabs(),this.refreshComposition(),this.syncLegend()}async reloadDescriptor(e){this.api.acceptRevision(e);try{let t=await this.api.descriptor();if(this.destroyed)return;this.descriptorValue=t,await this.picker?.refreshAvailability()}catch(t){if(t instanceof ie)return;this.options.onError?.(t)}}handoff(e,t){let i=this.descriptorValue,o=this.api.operationIdForHold(e.holdId);if(!i||!o)throw new Error("seatlayer: Performance Group hold identity is unavailable");let s=this.api.allocationsForHold(e.holdId);return{operationId:o,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:i,selectionMode:this.mode,performanceKeys:s.map(r=>r.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(r=>r.label),...this.mode==="per_performance"?{allocations:s.map(r=>({eventKey:r.eventKey,seatLabels:r.items.map(a=>a.label)}))}:{}}}renderHeldAllocations(e){if(!(!this.heldSummary||this.mode!=="per_performance")){this.heldSummary.replaceChildren();for(let t of e){let i=this.descriptorValue?.performances.find(r=>r.eventKey===t.eventKey),o=document.createElement("p"),s=document.createElement("strong");s.textContent=i?.name??t.eventKey,o.append(s,document.createTextNode(t.items.map(r=>r.label).join(", "))),this.heldSummary.appendChild(o)}this.heldSummary.hidden=e.length===0}}resetPerPerformanceSelection(){this.mode==="per_performance"&&(this.selectionsByEvent.clear(),this.validByEvent.clear(),this.heldSummary?.replaceChildren(),this.heldSummary&&(this.heldSummary.hidden=!0),this.updateTabs(),this.picker?.refreshPerformanceGroupComposition())}holdChanged(e,t){if(!e){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null);return}let i=this.handoff(e,t),o=this.activeHandoff?.holdId!==i.holdId;this.activeHandoff=i,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),o&&this.options.onHold?.(i),this.options.onHoldChange?.(i)}checkout(e,t){let i=this.handoff(e,t);this.continued=!0,this.activeHandoff=i,this.options.onCheckout?.(i),this.hosted?.mode==="hosted"&&this.descriptorValue&&this.hosted.open(this.picker?.root??null,{...i,descriptor:this.descriptorValue})}};import{formatMoney as Vd,fromMinorUnits as $d,t as ue}from"@seatlayer/core";var yd="seatlayer-season-picker-style";function vd(){if(document.getElementById(yd))return;let n=document.createElement("style");n.id=yd,n.textContent=`
3409
+ .sl-season-root{box-sizing:border-box;margin:0;display:flex;flex-direction:column;height:100%;min-width:0;min-height:0;max-width:100%;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
3410
+ .sl-season-root *{box-sizing:border-box}
3411
+ .sl-season-map{position:relative;flex:1 1 auto;min-width:0;min-height:0}
3412
+ .sl-season-status{margin:0;padding:12px 16px;color:var(--sl-muted,#627081);font-size:13px}
3413
+ .sl-season-status[data-kind=failed],.sl-season-status[data-kind=partial_terminal]{color:var(--sl-danger,#b42318);font-weight:650}
3414
+ .sl-season-status:not([data-kind=loading]):not([data-kind=failed]):not([data-kind=partial_terminal]){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
3415
+ .sl-season-root .sl-picker .sl-logo:not(:has(img)){display:none}
3416
+ .sl-season-root[data-placement=popup] .sl-picker{border-radius:0;min-height:0}
3417
+ .sl-season-root[data-placement=popup] .sl-picker .sl-head{min-height:52px;padding:0 16px;gap:12px;border-bottom-color:transparent;background:var(--sl-accent);color:var(--sl-accent-ink)}
3418
+ .sl-season-root[data-placement=popup] .sl-picker .sl-logo{width:30px;height:30px;border-radius:8px}
3419
+ .sl-season-root[data-placement=popup] .sl-picker .sl-head-name{font-size:15px;font-weight:700}
3420
+ .sl-season-root[data-placement=popup] .sl-picker .sl-head-meta{display:none}
3421
+ .sl-season-root[data-placement=popup] .sl-picker .sl-close{border-color:transparent;color:inherit}
3422
+ .sl-season-root[data-placement=popup] .sl-picker .sl-head .sl-hold-pill{background:var(--sl-accent-ink);color:var(--sl-accent)}
3423
+ .sl-season-root[data-placement=popup] .sl-picker[data-layout=narrow] .sl-head{min-height:48px;padding:0 14px;gap:10px}
3424
+ .sl-season-root[data-placement=popup] .sl-picker[data-layout=narrow] .sl-logo{width:28px;height:28px}
3425
+ .sl-season-root[data-placement=popup] .sl-picker[data-layout=narrow] .sl-head-name{font-size:14px}
3426
+ .sl-season-root .sl-step-frame{min-height:0}
3427
+ .sl-season-root .sl-season-step{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;container-type:inline-size}
3428
+ .sl-season-root .sl-step-body{flex:1 1 auto;min-height:0;overflow:auto;padding:20px 24px 8px;display:flex;flex-direction:column;gap:18px}
3429
+ .sl-season-root .sl-step-body>*{flex:none}
3430
+ .sl-season-root .sl-step-cols{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:22px;align-items:start}
3431
+ .sl-season-root .sl-step-col{display:flex;flex-direction:column;gap:18px;min-width:0}
3432
+ .sl-season-root .sl-step-title{margin:0;font-size:22px;font-weight:750;line-height:1.2}
3433
+ .sl-season-root .sl-step-facts{margin:4px 0 0;display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;color:var(--sl-muted);font-size:14px}
3434
+ .sl-season-root .sl-step-onsale{padding:2px 8px;border-radius:999px;background:color-mix(in srgb,var(--sl-accent) 16%,transparent);color:var(--sl-accent-text,var(--sl-text));font-size:12px;font-weight:650}
3435
+ .sl-season-root .sl-step-promise b,.sl-season-root .sl-step-packages>b{display:block;margin-bottom:8px;font-size:15px;font-weight:700}
3436
+ .sl-season-root .sl-step-promise ul{margin:0;padding-left:18px;display:grid;gap:4px;font-size:14px}
3437
+ .sl-season-root .sl-step-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px}
3438
+ .sl-season-root .sl-step-card{display:flex;flex-direction:column;gap:4px;padding:14px;border:1px solid var(--sl-line);border-radius:12px;background:var(--sl-surface)}
3439
+ .sl-season-root .sl-step-card[data-chosen]{border-color:var(--sl-accent);box-shadow:0 0 0 1px var(--sl-accent)}
3440
+ .sl-season-root .sl-step-card-name{font-size:15px}
3441
+ .sl-season-root .sl-step-card-dates,.sl-season-root .sl-step-card-price span,.sl-season-root .sl-step-prices-head span{color:var(--sl-muted);font-size:13px}
3442
+ .sl-season-root .sl-step-card-price{display:flex;align-items:baseline;gap:6px;margin-top:4px}
3443
+ .sl-season-root .sl-step-card-choose,.sl-season-root .sl-step-seats,.sl-season-root .sl-step-all{min-height:40px;padding:0 16px;border:1px solid var(--sl-line);border-radius:10px;background:var(--sl-surface);color:var(--sl-text);font:inherit;font-size:14px;font-weight:650;white-space:nowrap;cursor:pointer}
3444
+ .sl-season-root .sl-step-card-choose{margin-top:8px;align-self:flex-start}
3445
+ .sl-season-root .sl-step-card-choose[aria-pressed=true]{border-color:transparent;background:transparent;color:var(--sl-accent-text,var(--sl-text));cursor:default}
3446
+ .sl-season-root .sl-step-seats{border-color:var(--sl-accent);background:var(--sl-accent);color:var(--sl-accent-ink)}
3447
+ .sl-season-root .sl-season-step button:disabled:not([aria-pressed=true]){opacity:.6;cursor:wait}
3448
+ .sl-season-root .sl-season-step button:focus-visible{outline:2px solid var(--sl-accent);outline-offset:2px}
3449
+ .sl-season-root .sl-step-prices{border:1px solid var(--sl-line);border-radius:12px;overflow:hidden}
3450
+ .sl-season-root .sl-step-prices-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;padding:12px 14px;border-bottom:1px solid var(--sl-line)}
3451
+ .sl-season-root .sl-step-prices table{width:100%;border-collapse:collapse;font-size:14px}
3452
+ .sl-season-root .sl-step-prices th,.sl-season-root .sl-step-prices td{padding:9px 14px;text-align:left;border-top:1px solid var(--sl-line)}
3453
+ .sl-season-root .sl-step-prices tr:first-child th{border-top:0;color:var(--sl-muted);font-size:12px;font-weight:650}
3454
+ .sl-season-root .sl-step-prices td{font-variant-numeric:tabular-nums}
3455
+ .sl-season-root .sl-step-dates{margin:0;padding:0;list-style:none;display:grid;gap:8px}
3456
+ .sl-season-root .sl-step-date{display:flex;align-items:center;gap:12px;padding:10px 12px;border:1px solid var(--sl-line);border-radius:12px}
3457
+ .sl-season-root .sl-step-day{display:flex;flex-direction:column;align-items:center;min-width:40px;line-height:1.1}
3458
+ .sl-season-root .sl-step-day small{color:var(--sl-muted);font-size:11px;font-weight:700}
3459
+ .sl-season-root .sl-step-day b{font-size:18px}
3460
+ .sl-season-root .sl-step-date-text{display:flex;flex-direction:column;min-width:0;flex:1;font-size:14px}
3461
+ .sl-season-root .sl-step-date-text span{color:var(--sl-muted);font-size:13px}
3462
+ .sl-season-root .sl-step-date[data-state]{opacity:.6}
3463
+ .sl-season-root .sl-step-date[data-state=cancelled] .sl-step-date-text b{text-decoration:line-through}
3464
+ .sl-season-root .sl-step-date-tag{font-size:12px;font-weight:650;color:var(--sl-muted)}
3465
+ .sl-season-root .sl-step-all{align-self:flex-start}
3466
+ .sl-season-root .sl-step-narrow{display:none}
3467
+ .sl-season-root .sl-step-go{flex:none;display:flex;align-items:center;justify-content:flex-end;gap:12px;padding:12px 24px 16px}
3468
+ .sl-season-root .sl-step-go-price{display:none}
3469
+ .sl-season-root .sl-season-strip{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;padding:8px 16px;border-bottom:1px solid var(--sl-line);background:var(--sl-surface);font-size:13px;container-type:inline-size}
3470
+ .sl-season-root .sl-strip-steps{display:flex;flex-wrap:wrap;gap:6px 14px;margin:0;padding:0;list-style:none;font-size:13px}
3471
+ .sl-season-root .sl-strip-steps li{display:flex;align-items:center;gap:6px;color:var(--sl-muted)}
3472
+ .sl-season-root .sl-strip-steps li[data-state=current]{color:var(--sl-text);font-weight:650}
3473
+ .sl-season-root .sl-strip-n{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border:1px solid var(--sl-line);border-radius:999px;font-size:11px;font-weight:700}
3474
+ .sl-season-root .sl-strip-steps li:not([data-state=next]) .sl-strip-n{border-color:var(--sl-accent);background:var(--sl-accent);color:var(--sl-accent-ink)}
3475
+ .sl-season-root .sl-strip-pkg{color:var(--sl-muted)}
3476
+ .sl-season-root .sl-strip-pkg b{color:var(--sl-text)}
3477
+ .sl-season-root .sl-strip-change{margin-left:auto;padding:4px 2px;border:0;background:none;color:var(--sl-accent-text,var(--sl-text));font:inherit;font-weight:650;text-decoration:underline;cursor:pointer;white-space:nowrap}
3478
+ .sl-season-root .sl-step-intro .sl-strip-steps{margin-bottom:12px}
3479
+ @container (max-width:720px){
3480
+ .sl-season-root .sl-step-cols{grid-template-columns:minmax(0,1fr)}
3481
+ }
3482
+ @container (max-width:640px){
3483
+ .sl-season-root .sl-strip-steps li:not([data-state=current]){display:none}
3484
+ .sl-season-root .sl-strip-price{display:none}
3485
+ .sl-season-root .sl-step-body{padding:16px 16px 8px}
3486
+ .sl-season-root .sl-step-title{font-size:19px}
3487
+ .sl-season-root .sl-step-cards{grid-template-columns:1fr}
3488
+ .sl-season-root .sl-step-card{flex-direction:row;flex-wrap:wrap;align-items:center;column-gap:8px}
3489
+ .sl-season-root .sl-step-card-choose{margin:0 0 0 auto}
3490
+ .sl-season-root .sl-season-step [data-more]{display:none}
3491
+ .sl-season-root .sl-step-wide{display:none}
3492
+ .sl-season-root .sl-step-narrow{display:inline}
3493
+ .sl-season-root .sl-step-go{justify-content:space-between;padding:12px 16px;border-top:1px solid var(--sl-line);background:var(--sl-surface)}
3494
+ .sl-season-root .sl-step-go-price{display:block;font-size:13px;font-weight:650}
3495
+ }
3496
+ .sl-season-leave{position:fixed;inset:0;z-index:2147483001;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(5,7,12,.45);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
3497
+ .sl-season-leave-card{box-sizing:border-box;width:min(380px,100%);padding:22px;border-radius:16px;background:var(--sl-surface,#fff);color:var(--sl-text,#18202b);box-shadow:0 18px 48px rgba(5,7,12,.28)}
3498
+ .sl-season-leave h2{margin:0 0 6px;font-size:18px;font-weight:750;line-height:1.25}
3499
+ .sl-season-leave p{margin:0 0 18px;color:var(--sl-muted,#627081);font-size:14px;line-height:1.45}
3500
+ .sl-season-leave-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px}
3501
+ .sl-season-leave button{min-height:40px;padding:0 16px;border:1px solid var(--sl-line,#dde3ea);border-radius:10px;background:var(--sl-surface,#fff);color:var(--sl-text,#18202b);font:inherit;font-size:14px;font-weight:650;cursor:pointer}
3502
+ .sl-season-leave button[data-leave=keep]{border-color:var(--sl-accent,#7357d8);background:var(--sl-accent,#7357d8);color:var(--sl-accent-ink,#fff)}
3503
+ .sl-season-leave button:focus-visible{outline:2px solid var(--sl-accent,#7357d8);outline-offset:2px}
3504
+ `,document.head.appendChild(n)}var F=class extends Error{constructor(t,i,o){super(`season_request_failed:${t}`);this.code=t;this.status=i;this.name="SeasonApiError",o?.retryAfterS!==void 0&&(this.retryAfterS=o.retryAfterS),o?.retryable!==void 0&&(this.retryable=o.retryable),o?.reason!==void 0&&(this.reason=o.reason),o?.refusals?.length&&(this.refusals=o.refusals)}},Fn=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}},Vn=class extends Error{constructor(t,i){super(`season_public_session_refused:${t}`);this.reason=t;this.status=i;this.name="SeasonPublicSessionRefused"}};var Cf="https://api.seatlayer.io",Af=6e4,Pf=5e3,Lf=new Set(["seat_unavailable","seat_held_for_renewal"]);function kd(n){return typeof n=="string"&&Lf.has(n)?n:void 0}function ys(n){return Array.isArray(n)?n.flatMap(e=>{let t=e??{},i=typeof t.eventKey=="string"?t.eventKey:t.eventId,o=kd(t.code);return typeof i=="string"&&o?[{eventKey:i,code:o}]:[]}):[]}function Mf(n,e){let t=Number(n.headers.get("Retry-After")),i=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(Pf,i*1e3))}function Hf(n,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,i)=>{let o=setTimeout(t,n);e?.addEventListener("abort",()=>{clearTimeout(o),i(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function wd(n){if(!n||typeof n!="object")return"unknown";let e=n;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}function Rf(n,e){let t=e&&typeof e=="object"?e:{},i=ys(t.handoff?.allocations??t.operation?.allocations),o=(n.headers.get("Retry-After")??"").trim(),s=o?Number(o):Number.NaN;return{...Number.isFinite(s)&&s>=0?{retryAfterS:Math.ceil(s)}:{},...typeof t.retryable=="boolean"?{retryable:t.retryable}:{},...typeof t.reason=="string"?{reason:t.reason}:{},...i.length?{refusals:i}:{}}}var If=/^shc_[a-f0-9]{40}$/,Of=/^shh_[a-f0-9]{40}$/,_f=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),Nf=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function bs(n){return Array.isArray(n)?n.some(bs):!n||typeof n!="object"?!1:Object.entries(n).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&If.test(t)||bs(t))}function $n(n,e,t="invalid_operation_response"){if(!n||typeof n!="object"||Array.isArray(n))throw new F(t,502);if(bs(n))throw new F("unsafe_operation_response",502);let i=n,o=i.allocations,s=new Set,r=Array.isArray(o)&&o.length>0&&o.every(h=>{if(!h||typeof h!="object")return!1;let m=h.eventId,u=h.state;return typeof m!="string"||!m||typeof u!="string"||!Nf.has(u)||s.has(m)?!1:(s.add(m),!0)}),a=i.bookingRef===null||typeof i.bookingRef=="string"&&i.bookingRef.length>0,l=i.state!=="booked"||typeof i.bookingRef=="string"&&r&&o.every(h=>h.state==="booked"),c=i.state!=="booking_pending"||typeof i.bookingRef=="string"&&r&&o.some(h=>h.state!=="booked"),d=i.state!=="committed"||i.bookingRef===null;if(i.operationId!==e.operationId||i.seasonId!==e.seasonId||i.kind!=="HOLD"||typeof i.holdId!="string"||!Of.test(i.holdId)||i.policy!=="fixed_inclusion_same_seat"||typeof i.state!="string"||!_f.has(i.state)||typeof i.expiresAt!="number"||!Number.isFinite(i.expiresAt)||i.expiresAt<0||!a||typeof i.location!="string"||!i.location||typeof i.retryAfterSeconds!="number"||!Number.isFinite(i.retryAfterSeconds)||i.retryAfterSeconds<0||!r||!l||!c||!d||i.pricingAuthority!==void 0&&i.pricingAuthority!=="host"||i.authoritativeAmountIncluded!==void 0&&i.authoritativeAmountIncluded!==!1)throw new F(t,502);return{operationId:i.operationId,seasonId:i.seasonId,kind:i.kind,holdId:i.holdId,expiresAt:i.expiresAt,policy:i.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:i.state,bookingRef:i.bookingRef,location:i.location,retryAfterSeconds:i.retryAfterSeconds,allocations:o.map(h=>{let m=kd(h.code);return{eventId:h.eventId,state:h.state,...m?{code:m}:{}}})}}function Df(n,e,t){if(!Array.isArray(n)||n.length!==t||n.some(r=>typeof r!="string"||!r)||new Set(n).size!==n.length||!Array.isArray(e)||e.length!==n.length)throw new F("invalid_best_available_response",502);let i=n,o=new Set(i),s=new Map;for(let r of e){if(!r||typeof r!="object")throw new F("invalid_best_available_response",502);let a=r;if(typeof a.label!="string"||!o.has(a.label)||s.has(a.label)||typeof a.objectId!="string"||!a.objectId||a.objectType!=="seat"||typeof a.categoryKey!="string"||!a.categoryKey||a.tierId!==null&&(typeof a.tierId!="string"||!a.tierId)||a.quantity!==void 0&&a.quantity!==1)throw new F("invalid_best_available_response",502);s.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:i,items:i.map(r=>s.get(r))}}function xd(n){return typeof n=="number"&&Number.isFinite(n)?n:null}async function Sd(n,e,t=globalThis.fetch.bind(globalThis)){try{let i=await t(`${n.replace(/\/$/,"")}/pub/seasons/${encodeURIComponent(e)}/prices`,{method:"GET",credentials:"omit"});return i.ok?Td(await i.json()):null}catch{return null}}function Td(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n;if(typeof e.currency!="string"||!e.currency||!Array.isArray(e.packages))return null;let t=[];for(let i of e.packages){if(!i||typeof i!="object")continue;let o=i;if(typeof o.planKey!="string"||!o.planKey||typeof o.planActivationId!="string"||!o.planActivationId||!Array.isArray(o.prices))continue;let s=[],r=new Set;for(let a of o.prices){if(!a||typeof a!="object")continue;let l=a;if(typeof l.categoryKey!="string"||!l.categoryKey)continue;let c=typeof l.priceTypeKey=="string"?l.priceTypeKey:"",d=`${l.categoryKey}\0${c||"adult"}`;r.has(d)||typeof l.unitPrice!="number"||!Number.isInteger(l.unitPrice)||l.unitPrice<0||(r.add(d),s.push({categoryKey:l.categoryKey,...c?{priceTypeKey:c,priceTypeLabel:typeof l.priceTypeLabel=="string"?l.priceTypeLabel:c}:{},unitPrice:l.unitPrice}))}s.length&&t.push({planKey:o.planKey,planActivationId:o.planActivationId,name:typeof o.name=="string"&&o.name?o.name:o.planKey,prices:s,...Number.isInteger(o.datesToCome)&&o.datesToCome>=0?{datesToCome:o.datesToCome,firstDateAt:xd(o.firstDateAt),lastDateAt:xd(o.lastDateAt)}:{}})}return t.length?{currency:e.currency,packages:t}:null}function Bf(n){if(!n||typeof n!="object"||Array.isArray(n))throw new F("invalid_checkout_response",502);let e=n,t=typeof e.redirectUrl=="string"&&!!e.redirectUrl,i=Ds(e.redirectUrl);if(t&&!i)throw new F("gateway_unavailable",502);if(typeof e.orderId!="string"||!e.orderId||typeof e.currency!="string"||!e.currency||typeof e.totalMinor!="number"||!Number.isFinite(e.totalMinor)||typeof e.expiresAt!="number"||!Number.isFinite(e.expiresAt)||!i)throw new F("invalid_checkout_response",502);return{orderId:e.orderId,totalMinor:e.totalMinor,currency:e.currency,expiresAt:e.expiresAt,redirectUrl:i}}function Ed(n,e,t){return{seasonKey:n.key,planActivationId:n.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:i,state:o,code:s})=>({eventKey:i,state:o,...s?{code:s}:{}})),...t?{seats:t}:{}}}var xe,xt,Ae,kt,zn,Pe,Le,ae,we,Cd,uo=class{constructor(e,t){E(this,ae);E(this,xe);E(this,xt);E(this,Ae);E(this,kt);E(this,zn);E(this,Pe,!1);E(this,Le,null);k(this,xe,e),k(this,xt,(t.apiBase??Cf).replace(/\/$/,"")),k(this,Ae,t.access),k(this,kt,t.fetch??globalThis.fetch.bind(globalThis)),k(this,zn,t.recoveryTimeoutMs??Af),p(this,Ae).onRenewed(i=>w(this,ae,Cd).call(this,i))}async descriptor(){let{body:e}=await w(this,ae,we).call(this,"GET","");return e.season}async chart(){let{body:e}=await w(this,ae,we).call(this,"GET","/chart");return e}async availability(){let{body:e}=await w(this,ae,we).call(this,"GET","/availability"),t=Object.values(e.seats??{});return{...e,freeCount:t.filter(i=>i==="free").length,blockedCount:t.filter(i=>i!=="free").length}}async hold(e,t,i){let o=e.map(a=>{let l=i?.get(a);return l&&l!=="adult"?{label:a,priceTypeKey:l}:{label:a}}),{body:s,response:r}=await w(this,ae,we).call(this,"POST","/holds",{operationId:t,labels:[...e],...o.some(a=>"priceTypeKey"in a)?{selections:o}:{}});return{operation:$n(s.operation,{seasonId:p(this,xe),operationId:t}),response:r}}async bestAvailable(e){let{body:t,response:i}=await w(this,ae,we).call(this,"POST","/best-available",{operationId:e.operationId,qty:e.qty,...e.categoryKey?{categoryKey:e.categoryKey}:{},...e.zoneId?{zoneId:e.zoneId}:{},...e.accessibility?.length?{accessibility:[...e.accessibility]}:{},...e.requireContiguous===!0?{requireContiguous:!0}:{}}),o=$n(t.operation,{seasonId:p(this,xe),operationId:e.operationId},"invalid_best_available_response"),{labels:s,items:r}=Df(t.labels,t.items,e.qty);return{operation:o,labels:s,items:r,response:i}}async operation(e){let{body:t,response:i}=await w(this,ae,we).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:$n(t.operation,{seasonId:p(this,xe),operationId:e}),response:i}}async release(e,t){let{body:i,response:o}=await w(this,ae,we).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:$n(i.operation,{seasonId:p(this,xe),operationId:e}),response:o}}async prices(){let e;try{({body:e}=await w(this,ae,we).call(this,"GET","/prices"))}catch(t){if(t instanceof F&&t.status===404)return null;throw t}return Td(e)}async checkout(e){let{body:t}=await w(this,ae,we).call(this,"POST","/checkout",{operationId:e.operationId,buyerEmail:e.buyerEmail,...e.buyerName?{buyerName:e.buyerName}:{},...e.provider?{provider:e.provider}:{},...e.returnUrl?{returnUrl:e.returnUrl}:{}});return Bf(t)}async orderStatus(e){let t=await p(this,kt).call(this,`${p(this,xt)}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit"}),i=await t.json().catch(()=>null);if(!t.ok)throw new F(wd(i),t.status);if(i===null)throw new F("invalid_json_response",502);return i}async renewalIntent(e){let{body:t}=await w(this,ae,we).call(this,"POST","/renewal-intents",{offerId:e}),i=t.intent;if(!i||i.offerId!==e||i.state!=="intent_received"||!i.intentId||!Number.isFinite(i.receivedAt))throw new F("invalid_renewal_intent_response",502);return i}async waitForTerminal(e,t,i){let o=Date.now(),s=t?{operation:$n(t.operation,{seasonId:p(this,xe),operationId:e}),response:t.response}:await this.operation(e);for(;s.operation.state==="preparing"||s.operation.state==="commit_pending"||s.operation.state==="expire_pending"||s.operation.state==="booking_pending"||s.operation.state==="abort_pending";){if(Date.now()-o>=p(this,zn))throw new Fn(e);await Hf(Mf(s.response,s.operation),i),s=await this.operation(e)}return s.operation}destroy(){p(this,Pe)||(k(this,Pe,!0),p(this,Ae).onRenewed(void 0),p(this,Ae).clear())}};xe=new WeakMap,xt=new WeakMap,Ae=new WeakMap,kt=new WeakMap,zn=new WeakMap,Pe=new WeakMap,Le=new WeakMap,ae=new WeakSet,we=async function(e,t,i,o=!0){if(p(this,Pe))throw new F("season_api_destroyed",409);if(p(this,Le))throw p(this,Le);let s=await p(this,Ae).authorization();if(p(this,Pe))throw new F("season_api_destroyed",409);if(p(this,Le))throw p(this,Le);if(!s)throw new ee({reason:"no_token",retryable:!1});let r=await p(this,kt).call(this,`${p(this,xt)}/pub/seasons/${encodeURIComponent(p(this,xe))}${t}`,{method:e,headers:{Authorization:s,...i===void 0?{}:{"Content-Type":"application/json"}},body:i===void 0?void 0:JSON.stringify(i)}),a=await r.json().catch(()=>null);if(!r.ok){let l=wd(a);if(o&&await p(this,Ae).handleFailure(r.status,l,s))return w(this,ae,we).call(this,e,t,i,!1);let c=p(this,Ae).unavailable;throw c?new ee(c):new F(l,r.status,Rf(r,a))}if(a===null)throw new F("invalid_json_response",502);return{body:a,response:r}},Cd=async function(e){if(p(this,Pe))return;let t=`/pub/seasons/${encodeURIComponent(p(this,xe))}/session/adopt`;for(let i=0;i<2;i++){if(p(this,Pe))return;try{if((await p(this,kt).call(this,`${p(this,xt)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){k(this,Le,null);return}}catch{}}if(!p(this,Pe))throw k(this,Le,new F("season_session_adopt_failed",409)),p(this,Le)};function fo(n){let e=n.edition?.trim();return e&&!n.name.includes(e)?`${n.name} ${e}`:n.name}function Ad(n){return n.state==="committed"||n.state==="booked"}function Pd(n){return new F(`season_operation_${n.state}`,409,{refusals:ys(n.allocations)})}var vs=class{constructor(e,t,i,o){this.transport=e;this.sink=t;this.intervalMs=i;this.onSessionEnded=o;this.timer=null;this.stopped=!0;this.prior={};this.priorPartial={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=this.transport.latestAvailability?.partial??{},i=s=>(t[s]??[]).join("|"),o=Object.entries(e.seats).filter(([s,r])=>this.prior[s]!==r||this.priorPartial[s]!==i(s)).map(([s,r])=>({label:s,status:r}));this.prior={...e.seats},this.priorPartial=Object.fromEntries(Object.keys(e.seats).map(s=>[s,i(s)])),o.length&&this.sink.applyStatuses(o)}catch(e){if(wi(e)){this.stop(),this.onSessionEnded?.(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},mo=class{constructor(e,t,i,o=!1){this.api=e;this.realtimePollMs=t;this.onSessionEnded=i;this.typed=o;this.descriptorValue=null;this.availabilityValue=null;this.reuseAvailabilityOnce=!1;this.nextOperationId=null;this.nextBestAvailable=null;this.nextReleaseActionId=null;this.operationByHold=new Map;this.seatsByHold=new Map;this.typeRefusal=null;this.types=new Map;this.chartPrefetch=null;this.resumable=null}get latestAvailability(){return this.availabilityValue}typesInPlay(e){return this.typed||e.some(t=>this.types.has(t))}recordSeats(e,t){this.seatsByHold.set(e,t.map(i=>({label:i,priceTypeKey:this.types.get(i)||"adult"})))}prime(e,t){this.descriptorValue=e,this.availabilityValue=t,this.reuseAvailabilityOnce=!0}takeChartPrefetch(){let e=this.chartPrefetch;return this.chartPrefetch=null,e}primeChart(e){e.catch(()=>{}),this.chartPrefetch=e}queueOperation(e){this.nextOperationId=e}queueBestAvailable(e,t){if(this.nextBestAvailable)throw new F("season_best_available_in_progress",409);let i={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=i,i}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}prepareResume(e){this.resumable=e}async resume(e,t){let i=this.resumable;if(this.resumable=null,!i||i.holdId!==t)throw new F("season_hold_not_found",404);let o=await this.api.waitForTerminal(i.operationId);if(o.state!=="committed"||o.holdId!==t)throw new F("season_hold_not_found",404);if(i.typedSeats)for(let s of i.seats)this.types.set(s.label,s.priceTypeKey);return this.remember(o),this.recordSeats(t,i.seats.map(s=>s.label)),{holdId:t,expiresAt:o.expiresAt,items:i.seats.map(s=>({label:s.label,objectId:s.label,objectType:"seat",categoryKey:"",tierId:null,unitPrice:0,currency:this.descriptorValue?.currency??"USD"}))}}async chart(e){let[t,i]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.takeChartPrefetch()??this.api.chart()]);return this.descriptorValue=t,{doc:i,event:{key:t.key,name:fo(t),venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,i,o){if(o)throw new F("season_hold_replace_unsupported",409);let s=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let r=t.map(c=>c.label),a=await this.api.hold(r,s,this.types).catch(c=>{throw c instanceof F&&c.code==="price_type_not_offered"?this.typeRefusal=new F(c.code,c.status,{reason:"ticket_option_not_applicable"}):c}),l=await this.api.waitForTerminal(s,a);if(!Ad(l))throw Pd(l);return this.remember(l),this.recordSeats(l.holdId,r),{holdId:l.holdId,expiresAt:l.expiresAt,items:t.map(c=>({label:c.label,objectId:c.label,objectType:"seat",categoryKey:"",tierId:c.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...c.quantity==null?{}:{quantity:c.quantity}}))}}async release(e,t,i){let o=this.operationForHold(i);if(!o)throw new F("season_hold_not_found",404);let s=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let r=await this.api.release(o.operationId,s),a=await this.api.waitForTerminal(o.operationId,r);if(a.state==="partial_terminal")throw this.remember(a),new F("season_operation_partial_terminal",409);this.forget(i)}async bestAvailable(e,t,i,o){let s=this.nextBestAvailable;this.nextBestAvailable=null;let r=s?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:r,qty:t,...i?{categoryKey:i}:{},...o?{zoneId:o}:{},...s?.accessibility?.length?{accessibility:s.accessibility}:{},...s?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(r,a);if(!Ad(l))throw Pd(l);this.remember(l);for(let d of a.labels)this.types.delete(d);this.recordSeats(l.holdId,a.labels);let c=new Map(a.items.map(d=>[d.label,d]));return{holdId:l.holdId,expiresAt:l.expiresAt,labels:[...a.labels],items:a.labels.map(d=>{let h=c.get(d);return{label:d,objectId:h?.objectId??d,objectType:"seat",categoryKey:h?.categoryKey??i??"",tierId:h?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...h?.quantity==null?{}:{quantity:h.quantity}}})}}socketUrl(){return""}createRealtime(e,t){return new vs(this,t,this.realtimePollMs,this.onSessionEnded)}};import{t as $}from"@seatlayer/core";var Ff=["adult","child","concession","senior","student"];function H(n,e,t){let i=document.createElement(n);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function jn(n){return n===1?$("season.oneDate"):$("season.dateCount").replace("{count}",String(n))}function ws(n){return n===1?$("season.priceForOneDate"):$("season.priceForAllDates").replace("{count}",String(n))}function $e(n){return n.occurrences.length?n.occurrences.filter(e=>e.past!==!0&&e.cancelled!==!0).length:n.occurrenceCount}function rn(n,e,t,i){try{return new Intl.DateTimeFormat(t,{...i,...e?{timeZone:e}:{}}).format(n)}catch{return new Intl.DateTimeFormat(t,i).format(n)}}function Ld(n,e,t,i,o){let s={day:"numeric",month:"short",...o?{year:"numeric"}:{}},r=rn(n,t,i,s),a=rn(e,t,i,s);return r===a?r:$("season.dateRange").replace("{from}",r).replace("{to}",a)}function xs(n){let e=n.filter(i=>(i.priceTypeKey??"adult")==="adult"),t=e.length?e:n;return t.length?Math.min(...t.map(i=>i.unitPrice)):null}function Md(n){return n.occurrences.filter(e=>e.past!==!0&&e.cancelled!==!0)}function Vf(n,e,t){let i=H("div","sl-step-card");t&&(i.dataset.chosen="true"),i.append(H("b","sl-step-card-name",e.name));let o=t?Md(n.descriptor):null,s=o?o.length:e.datesToCome;if(s!==void 0){let l=o?o.find(h=>h.startsAt!=null)?.startsAt??null:e.firstDateAt??null,c=o?[...o].reverse().find(h=>h.startsAt!=null)?.startsAt??null:e.lastDateAt??null,d=l!=null&&c!=null?Ld(l,c,n.descriptor.timezone,n.locale,!1):"";i.append(H("span","sl-step-card-dates",[jn(s),d].filter(Boolean).join(" \xB7 ")))}let r=xs(e.prices);if(r!=null){let l=H("span","sl-step-card-price");l.append(H("b",void 0,$("season.fromPrice").replace("{price}",n.money(r))),H("span",void 0,$("season.perSeat"))),i.append(l)}let a=H("button","sl-step-card-choose",t?$("season.chosen"):$("season.choose"));return a.type="button",a.disabled=t||n.loading,a.setAttribute("aria-pressed",String(t)),t||a.addEventListener("click",()=>n.choose(e.planActivationId)),i.append(a),i}function $f(n,e,t){let i=H("div","sl-step-prices"),o=H("div","sl-step-prices-head");o.append(H("b",void 0,$("season.packagePrices").replace("{name}",e.name)),H("span",void 0,`${$("season.perSeat")}, ${ws(t)}`));let s=Ff.filter(d=>e.prices.some(h=>(h.priceTypeKey??"adult")===d)),r=d=>e.prices.find(h=>(h.priceTypeKey??"adult")===d)?.priceTypeLabel??(d==="adult"?$("season.adult"):d),a=[...n.areas.keys()].filter(d=>e.prices.some(h=>h.categoryKey===d));for(let d of e.prices)a.includes(d.categoryKey)||a.push(d.categoryKey);let l=H("table"),c=H("tr");c.append(H("th",void 0,$("season.area")),...s.map(d=>H("th",void 0,r(d)))),l.append(c);for(let d of a){let h=H("tr");h.append(H("th",void 0,n.areas.get(d)??d));for(let m of s){let u=e.prices.find(g=>g.categoryKey===d&&(g.priceTypeKey??"adult")===m);h.append(H("td",void 0,u?n.money(u.unitPrice):"\u2014"))}l.append(h)}return i.append(o,l),i}function zf(n,e){let t=H("li","sl-step-date");e.cancelled?t.dataset.state="cancelled":e.past&&(t.dataset.state="past");let i=n.descriptor.timezone,o=H("span","sl-step-day");e.startsAt!=null&&o.append(H("small",void 0,rn(e.startsAt,i,n.locale,{month:"short"}).toUpperCase()),H("b",void 0,rn(e.startsAt,i,n.locale,{day:"numeric"})));let s=H("span","sl-step-date-text");if(s.append(H("b",void 0,e.name)),e.startsAt!=null){let r=rn(e.startsAt,i,n.locale,{weekday:"short",day:"numeric",month:"short"}),a=rn(e.startsAt,i,n.locale,{hour:"2-digit",minute:"2-digit"});s.append(H("span",void 0,`${r} \xB7 ${a}`))}return t.append(o,s),(e.cancelled||e.past)&&t.append(H("span","sl-step-date-tag",e.cancelled?$("season.cancelled"):$("season.past"))),t}function Hd(n){let{descriptor:e}=n,t=H("div","sl-season-step"),i=H("div","sl-step-body"),o=Md(e),s=o.length,r=H("div","sl-step-intro");r.append(Rd("package")),n.titled||r.append(H("h2","sl-step-title",n.title));let a=o.find(f=>f.startsAt!=null)?.startsAt??null,l=[...o].reverse().find(f=>f.startsAt!=null)?.startsAt??null,c=[jn(s),e.venue,a!=null&&l!=null?Ld(a,l,e.timezone,n.locale,!0):""].filter(Boolean).join(" \xB7 "),d=H("p","sl-step-facts");d.append(H("span",void 0,c),H("span","sl-step-onsale",$("season.onSale"))),r.append(d);let h=H("div","sl-step-promise");h.append(H("b",void 0,$("season.whatYouGet")));let m=H("ul");m.append(H("li",void 0,$("season.sameSeat"))),n.emailTickets&&m.append(H("li",void 0,$("season.emailTickets"))),m.append(H("li",void 0,$("season.payOnce"))),h.append(m);let u=H("div","sl-step-cols"),g=H("div","sl-step-col"),b=H("div","sl-step-col");u.append(g,b),i.append(u),g.append(r,h);let T=n.prices?.packages??[],S=T.find(f=>f.planActivationId===n.chosen)??null;if(T.length){let f=H("div","sl-step-packages");f.append(H("b",void 0,$("season.choosePackage")));let I=H("div","sl-step-cards");n.loading&&I.setAttribute("aria-busy","true"),I.append(...T.map(L=>Vf(n,L,L.planActivationId===n.chosen))),f.append(I),g.append(f)}if(S){let f=$f(n,S,s);n.expanded||(f.dataset.more="true"),b.append(f)}let x=H("ul","sl-step-dates");if((n.expanded?e.occurrences:o.slice(0,3)).forEach((f,I)=>{let L=zf(n,f);!n.expanded&&I>0&&(L.dataset.more="true"),x.append(L)}),b.append(x),!n.expanded&&e.occurrences.length>1){let f=H("button","sl-step-all");f.type="button";let I=jn(e.occurrences.length);f.append(H("span","sl-step-wide",$("season.showAllDates").replace("{dates}",I)),H("span","sl-step-narrow",$("season.showAllDatesPrices").replace("{dates}",I))),f.addEventListener("click",()=>n.expand()),b.append(f)}let _=H("div","sl-step-go"),U=S?xs(S.prices):null;S&&U!=null&&_.append(H("span","sl-step-go-price",[$("season.fromPrice").replace("{price}",n.money(U)),S.name,$("season.perSeat")].join(" \xB7 ")));let R=H("button","sl-step-seats",$("season.chooseSeats"));return R.type="button",R.disabled=n.loading,R.addEventListener("click",()=>n.seats()),_.append(R),t.append(i,_),t}function Rd(n){let e=["package","seats","pay"],t={package:$("season.stepPackage"),seats:$("season.stepSeats"),pay:$("season.stepPay")},i=H("ol","sl-strip-steps");return e.forEach((o,s)=>{let r=s<e.indexOf(n)?"done":o===n?"current":"next",a=H("li");a.dataset.state=r,r==="current"&&a.setAttribute("aria-current","step"),a.append(H("span","sl-strip-n",r==="done"?"\u2713":String(s+1)),document.createTextNode(t[o])),i.append(a)}),i}function Id(n){let e=H("span","sl-strip-pkg");n.pkg?e.append(H("b",void 0,n.pkg.name),document.createTextNode(` \xB7 ${jn(n.dates)}`)):e.append(document.createTextNode(jn(n.dates)));let t=n.pkg?xs(n.pkg.prices):null;t!=null&&e.append(H("span","sl-strip-price",` \xB7 ${$("season.fromPrice").replace("{price}",n.money(t))} ${$("season.perSeat")}`));let i=H("button","sl-strip-change");return i.type="button",i.append(H("span","sl-step-wide",$("season.changePackage")),H("span","sl-step-narrow",$("season.change"))),i.addEventListener("click",()=>n.change()),[Rd(n.step),e,i]}import{t as ke}from"@seatlayer/core";function Od(n,e){for(let[t,i]of Object.entries(e))n.style.setProperty(t,i)}function _d(n,e,t,i={}){let o=document.createElement("div");Od(o,i),o.className="sl-season-leave",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true");let s=document.createElement("div");s.className="sl-season-leave-card";let r=document.createElement("h2");r.id=`sl-season-leave-${Math.random().toString(36).slice(2,10)}`,r.textContent=ke("season.leaveTitle"),o.setAttribute("aria-labelledby",r.id);let a=document.createElement("p"),l=document.createElement("div");l.className="sl-season-leave-actions";let c=document.createElement("button");c.type="button",c.dataset.leave="release",c.textContent=ke("season.leaveRelease");let d=document.createElement("button");d.type="button",d.dataset.leave="keep",d.textContent=ke("season.leaveKeep"),l.append(c,d),s.append(r,a,l),o.append(s);let h=null,m=()=>{h&&clearInterval(h),h=null,o.remove()},u=()=>{let g=Math.max(0,e-Date.now());if(g<=0){m(),t.lapsed();return}let b=Math.ceil(g/1e3),T=`${Math.floor(b/60)}:${String(b%60).padStart(2,"0")}`;a.textContent=ke("season.leaveBody").replace("{time}",T)};return c.addEventListener("click",()=>{m(),t.release()}),d.addEventListener("click",()=>{m(),t.keep()}),u(),h=setInterval(u,1e3),n.append(o),d.focus({preventScroll:!0}),{remove:m}}function Nd(n){let e=o=>{try{return new Intl.ListFormat(void 0,{type:"conjunction"}).format(o)}catch{return o.join(", ")}},t=[],i=new Map;for(let o of n){if(!o.row||!o.seat){t.push({head:[o.label],seats:[]});continue}let s=`${o.section??""}\0${o.row}`,r=i.get(s);r||(r={head:[o.section??"",`${ke("picker.row")} ${o.row}`].filter(Boolean),seats:[]},i.set(s,r),t.push(r)),r.seats.push(o.seat)}return t.map(({head:o,seats:s})=>[...o,...s.length===1?[`${ke("picker.seat")} ${s[0]}`]:[],...s.length>1?[`${ke("season.seats")} ${e(s)}`]:[]].join(", ")).join("; ")}function Dd(n,e,t,i={}){let o=document.createElement("div");Od(o,i),o.className="sl-season-leave",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true");let s=document.createElement("div");s.className="sl-season-leave-card";let r=document.createElement("h2");r.id=`sl-season-change-${Math.random().toString(36).slice(2,10)}`,r.textContent=ke("season.changeTitle"),o.setAttribute("aria-labelledby",r.id);let a=document.createElement("p");a.textContent=ke("season.changeBody").replace("{seats}",e);let l=document.createElement("div");l.className="sl-season-leave-actions";let c=document.createElement("button");c.type="button",c.dataset.leave="release",c.textContent=ke("season.changeConfirm");let d=document.createElement("button");d.type="button",d.dataset.leave="keep",d.textContent=ke("season.changeKeep"),l.append(c,d),s.append(r,a,l),o.append(s);let h=()=>{o.remove()};return c.addEventListener("click",()=>{h(),t.change()}),d.addEventListener("click",()=>{h(),t.keep()}),n.append(o),d.focus({preventScroll:!0}),{remove:h}}import{t as go}from"@seatlayer/core";function Bd(n){if(!(n instanceof F))return go("season.selectionFailed");let e=new Set((n.refusals??[]).map(t=>t.code));return e.has("seat_held_for_renewal")?go("season.seatHeldForRenewal"):e.has("seat_unavailable")||n.code==="seats_unavailable"?go("season.seatUnavailable"):n.code==="unknown"?go("season.selectionFailed"):`Season selection unavailable (${n.code}).`}var jf=new Set(["audience_not_public","sales_not_open","origin_not_allowed"]),Kf=3e4;function Gf(n,e){if(!n||typeof n!="object"||Array.isArray(n))return!1;let t=n;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.seasonKey===e&&Array.isArray(t.planActivationIds)&&t.planActivationIds.every(i=>typeof i=="string"&&!!i)}var ze,it,Kn,an,ks=class{constructor(e){this.options=e;E(this,ze,null);E(this,it,null);E(this,Kn);E(this,an);k(this,Kn,e.fetch??globalThis.fetch.bind(globalThis)),k(this,an,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return p(this,ze)}async mint(e=!1){if(e&&k(this,ze,null),p(this,ze)&&p(this,ze).expiresAt-Kf>Date.now())return p(this,ze);if(p(this,it))return p(this,it);let t=(async()=>{let i=await p(this,Kn).call(this,`${this.options.base}/pub/seasons/${encodeURIComponent(this.options.season)}/sessions`,{method:"POST",body:JSON.stringify({...p(this,an)?{origin:p(this,an)}:{},...this.options.planActivationId?{planActivationId:this.options.planActivationId}:{}}),credentials:"omit"}),o=await i.json().catch(()=>null);if(!i.ok){let s=o?.code??o?.error;if(i.status===403&&s&&jf.has(s)){let r=s;throw this.options.onRefused?.({reason:r,code:s,status:i.status,retryable:r==="sales_not_open"}),new Vn(r,i.status)}throw new Error(`season_public_session_failed_${i.status}`)}if(!Gf(o,this.options.season))throw new Error("season_public_session_invalid");return k(this,ze,o),o})();k(this,it,t);try{return await t}finally{p(this,it)===t&&k(this,it,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",i=await this.mint(t);return{token:i.token,expiresAt:i.expiresAt}}};ze=new WeakMap,it=new WeakMap,Kn=new WeakMap,an=new WeakMap;function Fd(n){let e=new ks(n);return{access:new pe({provider:({reason:i})=>e.token(i),...n.accessHooks}),loader:e}}var Uf=2500,Ss=new Map;function qf(){return typeof location<"u"&&new URLSearchParams(location.search).has("seatlayer_checkout")}function Wf(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}var A,Tt,Et,le,K,ot,pn,st,Ct,At,Pt,Wn,Yn,hn,Zn,J,Lt,W,Z,je,rt,at,be,Mt,oe,un,Ht,Rt,mn,lt,It,ct,fn,Me,gn,Te,Xn,v,Es,bo,Cs,St,As,Ps,zd,jd,Ls,bn,Kd,Gd,Ms,yo,Gn,ln,Ud,Hs,cn,qd,Wd,Yd,Rs,vo,Zd,Un,Xd,wo,Is,Y,Se,Qd,qn,dn,Os=class Os{constructor(e){E(this,v);E(this,A);E(this,Tt);E(this,Et);E(this,le);E(this,K);E(this,ot);E(this,pn,null);E(this,st,0);E(this,Ct,null);E(this,At,"package");E(this,Pt,null);E(this,Wn,!1);E(this,Yn,new Map);E(this,hn,null);E(this,Zn,new AbortController);E(this,J,null);E(this,Lt,null);E(this,W,null);E(this,Z,null);E(this,je,null);E(this,rt,null);E(this,at,null);E(this,be,[]);E(this,Mt,new Map);E(this,oe,!1);E(this,un,!1);E(this,Ht,null);E(this,Rt,null);E(this,mn,null);E(this,lt,null);E(this,It,"handoff");E(this,ct,null);E(this,fn,!1);E(this,Me,null);E(this,gn,null);E(this,Te,null);E(this,Xn,null);E(this,bn,new Set);if(!e?.season)throw new Error("seatlayer: `season` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if("event"in e||"performanceGroup"in e)throw new Error("seatlayer: SeasonPicker is not SeatPicker or PerformanceGroupPicker");k(this,A,e),k(this,Tt,Wf(e.container)),k(this,ot,!e.buyerAccessToken&&!e.buyerAccessTokenProvider),w(this,v,bo).call(this,null)}async render(){w(this,v,qn).call(this),Ne(),vd(),w(this,v,jd).call(this),w(this,v,Y).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let e;if(p(this,A).package&&w(this,v,Es).call(this)&&!p(this,Te)){if(e=await Sd(p(this,A).apiBase??"https://api.seatlayer.io",p(this,A).season,p(this,A).fetch),p(this,oe))return this;let t=e?.packages.find(i=>i.planKey===p(this,A).package);t&&(p(this,le).destroy(),w(this,v,bo).call(this,t.planActivationId))}return await w(this,v,Cs).call(this,p(this,st),e)?(p(this,Te)||p(this,A).initialOperationId||qf()?await this.chooseSeats():w(this,v,St).call(this),p(this,oe)?this:(w(this,v,Yd).call(this),w(this,v,As).call(this),p(this,A).initialOperationId&&await this.restoreOperation(p(this,A).initialOperationId),this)):this}catch(e){if(p(this,oe))return this;throw w(this,v,Se).call(this,e)}}async choosePackage(e){if(w(this,v,qn).call(this),(p(this,Ct)??p(this,J)?.planActivationId)===e)return;if(!w(this,v,Es).call(this))throw new F("season_package_fixed",409);if(p(this,W))throw new F("season_hold_open",409);k(this,Ct,e);let t=++Ns(this,st)._;p(this,Z)?.destroy(),k(this,Z,null),k(this,be,[]),p(this,Mt).clear(),p(this,le).destroy(),w(this,v,bo).call(this,e),w(this,v,St).call(this),w(this,v,Y).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{if(!await w(this,v,Cs).call(this,t))return;w(this,v,St).call(this),w(this,v,As).call(this)}catch(i){if(p(this,oe)||t!==p(this,st))return;throw w(this,v,Se).call(this,i)}}async chooseSeats(){if(w(this,v,qn).call(this),!(p(this,At)==="seats"&&p(this,Z))){if(!p(this,J))throw new Error("seatlayer: render SeasonPicker before using it");k(this,At,"seats"),p(this,Pt)?.remove(),k(this,Pt,null),await w(this,v,zd).call(this,p(this,J))}}async holdSameSeat(e,t,i){if(w(this,v,dn).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!e.length)throw new Error("seatlayer: select at least one seat");if(i)for(let o of e)p(this,K).types.set(o,i[o]||"adult");if(p(this,K).typeRefusal=null,p(this,K).queueOperation(t),p(this,Z).selectObjectsWithoutConfirmation([...e]),w(this,v,Y).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await p(this,Z).handleCta(),!p(this,W))throw p(this,K).typeRefusal??new F("season_hold_not_created",409);return p(this,W)}async holdBestAvailable(e,t,i={}){if(w(this,v,dn).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: positive Best Available quantity is required");let o=p(this,Z).maxTickets;if(e>o)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${o})`);if(p(this,un))throw new F("season_best_available_in_progress",409);k(this,un,!0);let s=null;try{if(s=p(this,K).queueBestAvailable(t,i),w(this,v,Y).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await p(this,Z).bestAvailableOrThrow(e,i.categoryKey,{zoneId:i.zoneId})||!p(this,W))throw new F("season_hold_not_created",409);return p(this,W)}catch(r){throw w(this,v,Se).call(this,r,t)}finally{s&&p(this,K).clearBestAvailable(s),k(this,un,!1)}}async restoreOperation(e){w(this,v,dn).call(this),w(this,v,Y).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await p(this,le).waitForTerminal(e,void 0,p(this,Zn).signal);return t.state==="aborted"||t.state==="expired"?(k(this,W,null),p(this,A).onHoldChange?.(null),w(this,v,Y).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(p(this,K).remember(t),w(this,v,Ms).call(this,t,!1))}catch(t){throw w(this,v,Se).call(this,t,e)}}async release(e){w(this,v,dn).call(this);let t=p(this,W);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");p(this,K).queueRelease(e),w(this,v,Y).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{p(this,Z)?.getCurrentHold()?.holdId===t.holdId?await p(this,Z).release():(await p(this,K).release("",[],t.holdId),w(this,v,yo).call(this)),w(this,v,Y).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(i){throw w(this,v,Se).call(this,i,t.operationId)}}}async createRenewalIntent(e){if(w(this,v,dn).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");w(this,v,Y).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await p(this,le).renewalIntent(e);return w(this,v,Y).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),p(this,A).onRenewalIntent?.(t),t}catch(t){throw w(this,v,Se).call(this,t)}}getDescriptor(){return p(this,J)}getAvailability(){return p(this,Lt)}getHandoff(){return p(this,W)}destroy(){if(p(this,oe))return;k(this,oe,!0),p(this,Zn).abort(),w(this,v,vo).call(this),p(this,Z)?.destroy(),p(this,le).destroy(),p(this,Tt).replaceChildren(),k(this,je,null),k(this,rt,null),k(this,at,null),k(this,J,null),k(this,Lt,null),k(this,W,null),k(this,Me,null);let e=p(this,gn);k(this,gn,null),e?.()}close(){p(this,Me)?p(this,Me).call(this):this.destroy()}static async open(e){Ne();let t=Ss.get(e.season)??null;Ss.delete(e.season);let i=t&&t.expiresAt>Date.now()?t:null,o=!!e.buyerAccessToken||!!e.buyerAccessTokenProvider,s=$i(ue("season.popupLabel"),He(void 0,e.theme)["--sl-bg"]),r;try{r=new Os({...e,...i?.token&&!o?{buyerAccessToken:i.token}:{},container:s.frame})}catch(h){throw s.teardown(!1),h}k(r,Te,i),k(r,ot,!o),k(r,gn,()=>s.teardown());let a=!1,l=null,c=()=>{a||(a=!0,l?.remove(),l=null,r.destroy(),e.onClose?.())},d=()=>{var m;if(a||l)return;let h=p(r,W);if(!h||h.expiresAt<=Date.now()){c();return}l=_d(s.frame,h.expiresAt,{keep:()=>{var u;w(u=r,v,Ps).call(u,h),c()},release:()=>{r.release(`sra_${crypto.randomUUID()}`).catch(u=>e.onError?.(u)).finally(c)},lapsed:()=>{l=null,c()}},w(m=r,v,wo).call(m))};k(r,Me,d),k(r,Xn,h=>{setTimeout(()=>{var m;a||l||(w(m=r,v,Ps).call(m,h),c())},0)}),s.onScrimPress(d),s.trapKeys(h=>{h.preventDefault(),l?(l.remove(),l=null):d()});try{await r.render()}catch(h){throw a=!0,r.destroy(),h}return p(r,oe)||s.focusFirst(),r}};A=new WeakMap,Tt=new WeakMap,Et=new WeakMap,le=new WeakMap,K=new WeakMap,ot=new WeakMap,pn=new WeakMap,st=new WeakMap,Ct=new WeakMap,At=new WeakMap,Pt=new WeakMap,Wn=new WeakMap,Yn=new WeakMap,hn=new WeakMap,Zn=new WeakMap,J=new WeakMap,Lt=new WeakMap,W=new WeakMap,Z=new WeakMap,je=new WeakMap,rt=new WeakMap,at=new WeakMap,be=new WeakMap,Mt=new WeakMap,oe=new WeakMap,un=new WeakMap,Ht=new WeakMap,Rt=new WeakMap,mn=new WeakMap,lt=new WeakMap,It=new WeakMap,ct=new WeakMap,fn=new WeakMap,Me=new WeakMap,gn=new WeakMap,Te=new WeakMap,Xn=new WeakMap,v=new WeakSet,Es=function(){return p(this,ot)||!!p(this,A).buyerAccessTokenProvider&&!p(this,A).buyerAccessToken},bo=function(e){let t=p(this,A),i={onExpired:s=>t.onAccessExpired?.(s),onUnavailable:s=>{let r=p(this,Rt)&&s.reason==="provider_failed"?p(this,Rt):s;k(this,Rt,null),k(this,mn,r.reason==="provider_failed"?null:r),t.onAccessUnavailable?.(r),w(this,v,qd).call(this,r)}},o=t.buyerAccessTokenProvider;if(e&&!p(this,ot)&&o)k(this,Ht,null),k(this,Et,new pe({provider:s=>o({...s,planActivationId:e}),...i}));else if(p(this,ot)){let{access:s,loader:r}=Fd({base:(t.apiBase??"https://api.seatlayer.io").replace(/\/$/,""),season:t.season,fetch:t.fetch,...e?{planActivationId:e}:{},onRefused:a=>{k(this,Rt,a)},accessHooks:i});k(this,Et,s),k(this,Ht,r)}else k(this,Ht,null),k(this,Et,new pe({token:t.buyerAccessToken,provider:t.buyerAccessTokenProvider,...i}));k(this,le,new uo(t.season,{apiBase:t.apiBase,access:p(this,Et),fetch:t.fetch,recoveryTimeoutMs:t.recoveryTimeoutMs})),k(this,K,new mo(p(this,le),Math.max(750,t.realtimePollMs??Uf),s=>w(this,v,Qd).call(this,s),!!t.priceTypes?.some(s=>s!=="adult")))},Cs=async function(e,t){let i=p(this,le).chart();p(this,K).primeChart(i),i.then(a=>{p(this,oe)||e!==p(this,st)||(k(this,Yn,new Map((a.categories??[]).map(l=>[l.key,l.label||l.key]))),k(this,hn,a.theme??null),p(this,At)==="package"&&w(this,v,St).call(this))},()=>{});let[o,s,r]=await Promise.all([p(this,le).descriptor(),p(this,le).availability(),t!==void 0?Promise.resolve(t):p(this,le).prices().catch(()=>null)]);return p(this,oe)||e!==p(this,st)?!1:(k(this,J,o),k(this,Ct,o.planActivationId),k(this,Lt,s),k(this,lt,r),k(this,It,p(this,A).checkout==="hosted"&&o.checkoutMode!=="server"&&r?"hosted":"handoff"),p(this,K).prime(o,s),!0)},St=function(){let e=p(this,J);if(!p(this,rt)||!e||p(this,oe))return;k(this,At,"package");let t=p(this,Ct)??e.planActivationId,i=document.createElement("div");i.className="sl-picker sl-step-frame";let o=w(this,v,wo).call(this);for(let[r,a]of Object.entries(o))i.style.setProperty(r,a);let s=p(this,Me);if(s){let r=document.createElement("div");r.className="sl-head";let a=document.createElement("div");a.className="sl-logo",oi(a,[p(this,A).theme?.logoUrl,p(this,hn)?.logoUrl,e.orgLogoUrl],"");let l=document.createElement("div");l.className="sl-head-info";let c=document.createElement("div");c.className="sl-head-name",c.textContent=fo(e),l.append(c);let d=document.createElement("button");d.type="button",d.className="sl-close on",d.setAttribute("aria-label",ue("picker.close")),d.innerHTML='<svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',d.addEventListener("click",()=>s()),r.append(a,l,d),i.append(r)}i.append(Hd({descriptor:e,prices:p(this,lt),chosen:t,loading:t!==e.planActivationId,expanded:p(this,Wn),areas:p(this,Yn),emailTickets:p(this,It)==="hosted"||p(this,A).ticketsByEmail===!0,titled:!!s,title:fo(e),locale:p(this,A).locale,money:r=>w(this,v,cn).call(this,r),choose:r=>{this.choosePackage(r).catch(a=>w(this,v,Se).call(this,a))},expand:()=>{k(this,Wn,!0),w(this,v,St).call(this)},seats:()=>{this.chooseSeats().catch(r=>w(this,v,Se).call(this,r))}})),p(this,Pt)?.remove(),p(this,rt).append(i),k(this,Pt,i)},As=function(){let e=p(this,Lt)?.freeCount??0;w(this,v,Y).call(this,{kind:"ready",message:`${e} seat${e===1?"":"s"} available for every included performance.`})},Ps=function(e){let t=p(this,Ht)?.session,i=p(this,K).seatsByHold.get(e.holdId),o=p(this,Z)?.getCurrentHold(),s=o?.holdId===e.holdId?[...new Set((o.items??[]).map(a=>a.label))]:[],r=i??s.map(a=>({label:a,priceTypeKey:"adult"}));Ss.set(p(this,A).season,{operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,seats:r,typedSeats:p(this,K).typesInPlay(r.map(a=>a.label)),token:t?{token:t.token,expiresAt:t.expiresAt}:p(this,Te)?.token??null})},zd=async function(e){p(this,Te)&&p(this,K).prepareResume(p(this,Te));let t=new Je(to({container:p(this,rt),event:e.key,apiBase:p(this,A).apiBase,transport:p(this,K),hideEventDetails:!0,...p(this,Te)?{initialHoldId:p(this,Te).holdId}:{},maxSelection:p(this,A).maxSelection,selectedObjects:p(this,A).selectedObjects,selectableObjects:p(this,A).selectableObjects,numberOfPlacesToSelect:p(this,A).numberOfPlacesToSelect,selectionValidators:p(this,A).selectionValidators,locale:p(this,A).locale,messages:p(this,A).messages,languages:p(this,A).languages,colorblindSafe:p(this,A).colorblindSafe,initialView:p(this,A).initialView,enable3D:p(this,A).enable3D,max3DSeats:p(this,A).max3DSeats,hideBadge:p(this,A).hideBadge,theme:p(this,A).theme,confirmSelection:p(this,A).confirmSelection,seatView:p(this,A).seatView,onBuyerViewChange:p(this,A).onBuyerViewChange,onAnalytics:(i,o)=>{try{p(this,A).onAnalytics?.(i,{...o,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:$e(e)})}catch{}},onSelectionChange:i=>{k(this,be,i.map(o=>o.label)),k(this,Mt,new Map(i.filter(o=>!!o.categoryKey).map(o=>[o.label,o.categoryKey]))),p(this,A).onSelectionChange?.(i)},onSelectionValidityChange:p(this,A).onSelectionValidityChange,onHoldChange:i=>{if(!i){w(this,v,yo).call(this);return}let o=p(this,K).operationForHold(i.holdId);o&&w(this,v,Ms).call(this,o,!0)},onCheckout:()=>{var i;p(this,W)&&(p(this,A).onContinue?.(p(this,W)),p(this,It)==="hosted"?w(this,v,Wd).call(this,p(this,W)):(i=p(this,Xn))==null||i.call(this,p(this,W)))},onHoldExpired:()=>{w(this,v,yo).call(this),w(this,v,Y).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),p(this,A).onHoldExpired?.()},onError:i=>w(this,v,Se).call(this,i)},{surface:"season",performanceCount:$e(e),selectionMode:"same_seat",suppressPricing:!0,packagePricing:w(this,v,Gn).call(this)?w(this,v,Gd).call(this):null,modalClose:p(this,Me),subheader:w(this,v,Zd).call(this),brandLogoUrl:e.orgLogoUrl??null,brandAccent:e.orgAccent??null,nights:()=>w(this,v,Ls).call(this),seatMarks:()=>w(this,v,Kd).call(this),partialWords:{title:ue("season.partlyFreeTitle"),advice:ue("season.partlyFreeAdvice"),legend:ue("season.partlyFreeLegend")},groupSelectionSummary:()=>{let i=p(this,be).length;return i?{seats:i,performances:$e(e),performancesChosen:$e(e),perPerformance:i}:null}}));k(this,Z,t),await t.render()},jd=function(){p(this,Tt).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection"),p(this,Me)&&(e.dataset.placement="popup");let t=document.createElement("div");t.className="sl-season-map";let i=document.createElement("p");i.className="sl-season-status",i.setAttribute("role","status"),i.setAttribute("aria-live","polite"),e.append(i,t),p(this,Tt).append(e),k(this,je,e),k(this,rt,t),k(this,at,i)},Ls=function(){let e=p(this,J);if(!e)return[];let t=e.timezone?{timeZone:e.timezone}:{},i=o=>{if(o==null)return ue("season.dateToBeAnnounced");try{return new Intl.DateTimeFormat(p(this,A).locale,{weekday:"short",day:"numeric",month:"short",...t}).format(new Date(o))}catch{return new Date(o).toDateString()}};return e.occurrences.filter(o=>o.past!==!0&&o.cancelled!==!0).map(o=>({eventKey:o.eventKey,name:o.name,shortDate:i(o.startsAt)}))},bn=new WeakMap,Kd=function(){let e=new Set(w(this,v,Ls).call(this).map(o=>o.eventKey)),t={};for(let o of p(this,bn))t[o]=null;p(this,bn).clear();let i=p(this,K).latestAvailability?.partial??{};if(e.size)for(let[o,s]of Object.entries(i)){let r=s.filter(a=>e.has(a));!r.length||r.length>=e.size||(t[o]={kind:"partial",fraction:(e.size-r.length)/e.size,data:{blockedEventKeys:r}},p(this,bn).add(o))}return t},Gd=function(){let e=p(this,K).types,t=[...new Set(p(this,A).priceTypes??["adult"])],i=a=>t.filter(l=>w(this,v,ln).call(this,a,l)!=null),o=a=>{let l=w(this,v,Gn).call(this)?.prices.find(c=>(c.priceTypeKey||"adult")===a);return y(`season.priceType.${a}`,l?.priceTypeLabel||a.charAt(0).toUpperCase()+a.slice(1))},s=(a,l)=>{let c=e.get(a);if(c)return c;let d=i(l),h=d.includes("adult")?"adult":d[0];return h&&h!=="adult"&&e.set(a,h),h??"adult"},r=()=>ws(p(this,J)?$e(p(this,J)):0);return{seat:(a,l)=>{let c=s(a,l),d=w(this,v,ln).call(this,l,c),h=p(this,K).typed?i(l):[];return{amountText:d==null?"":w(this,v,cn).call(this,d),types:h.length>1?{options:h.map(m=>({id:m,name:o(m)})),selected:c}:null}},total:a=>{let l=0;for(let{label:c,categoryKey:d}of a){let h=w(this,v,ln).call(this,d,s(c,d));if(h==null)return null;l+=h}return{amountText:w(this,v,cn).call(this,l),countText:`${a.length} seat${a.length===1?"":"s"} \xB7 ${r()}`}},setType:(a,l)=>{t.includes(l)&&e.set(a,l)},seatCardPrice:a=>{let l=i(a),c=w(this,v,ln).call(this,a,l.includes("adult")?"adult":l[0]);return c==null?null:{price:w(this,v,cn).call(this,c),note:r()}}}},Ms=function(e,t){if(e.state==="booked")return k(this,W,null),p(this,K).forget(e.holdId),p(this,Z)?.notifyGroupSettled("booked"),w(this,v,Y).call(this,{kind:"booked",message:`Your Season booking is complete for all ${$e(p(this,J))} performances. No further checkout action is needed.`,operationId:e.operationId}),p(this,A).onHoldChange?.(null),null;if(e.state==="partial_terminal")return k(this,W,null),k(this,be,[]),p(this,K).forget(e.holdId),p(this,Z)?.notifyGroupSettled("lost"),w(this,v,Y).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),p(this,A).onHoldChange?.(null),null;if(e.state!=="committed")return k(this,W,null),p(this,K).forget(e.holdId),p(this,Z)?.notifyGroupSettled("lost"),w(this,v,Y).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),p(this,A).onHoldChange?.(null),null;let i=Ed(p(this,J),e,p(this,K).seatsByHold.get(e.holdId)),o=p(this,W)?.holdId!==i.holdId;return k(this,W,i),p(this,A).onHoldChange?.(i),w(this,v,Y).call(this,{kind:"held",message:`Your seats are held for all ${$e(p(this,J))} performances. Review and continue to checkout.`,operationId:e.operationId}),o&&t&&p(this,A).onHold?.(i),i},yo=function(){k(this,W,null),k(this,be,[]),p(this,A).onHoldChange?.(null)},Gn=function(){let e=p(this,J)?.planActivationId;return p(this,lt)?.packages.find(t=>t.planActivationId===e)??null},ln=function(e,t="adult"){let i=w(this,v,Gn).call(this)?.prices.find(o=>o.categoryKey===e&&(o.priceTypeKey||"adult")===t);return i?i.unitPrice:null},Ud=function(){if(!p(this,be).length||!w(this,v,Gn).call(this))return null;let e=0;for(let t of p(this,be)){let i=p(this,Mt).get(t),o=i?w(this,v,ln).call(this,i,p(this,K).types.get(t)):null;if(o==null)return null;e+=o}return e},Hs=function(){return p(this,lt)?.currency??p(this,J)?.currency??"USD"},cn=function(e,t=w(this,v,Hs).call(this)){let i=$d(e,t),o=Number.isInteger(i);return Vd(i,t,{locale:p(this,A).locale,fallback:(s,r)=>`${s} ${r}`,...o?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},qd=function(e){let t=e.reason==="audience_not_public"?ue("season.accessNotPublic"):e.reason==="sales_not_open"?ue("season.accessSalesNotOpen"):e.reason==="origin_not_allowed"?ue("season.accessOriginNotAllowed"):ue("season.accessUnavailable");w(this,v,Y).call(this,{kind:"failed",message:t})},Wd=async function(e){if(!p(this,fn)){k(this,fn,!0);try{let t=w(this,v,Hs).call(this),i=w(this,v,Ud).call(this);if(i==null){w(this,v,Y).call(this,{kind:"failed",message:ue("season.checkoutNotPriced"),operationId:e.operationId});return}await w(this,v,Rs).call(this,{kind:"pay",provider:null,order:{holdId:e.operationId,expiresAt:e.expiresAt,currency:t,total:$d(i,t),labels:[...p(this,be)]}})}finally{k(this,fn,!1)}}},Yd=function(){if(p(this,It)!=="hosted")return;let e=en(p(this,A).season);e?.outcome!=="success"||!e.orderId||w(this,v,Rs).call(this,{kind:"resume",orderId:e.orderId})},Rs=async function(e){let t;try{({mountCheckout:t}=await Bt())}catch(o){p(this,A).onError?.(o),w(this,v,Y).call(this,{kind:"failed",message:ue("season.checkoutCouldNotBeOpened")});return}let i=p(this,Z)?.root;p(this,oe)||!i||(w(this,v,vo).call(this),k(this,ct,t({root:i,state:e,eventKey:p(this,A).season,formatMoney:(o,s)=>Vd(o,s,{locale:p(this,A).locale,fallback:(r,a)=>`${r} ${a}`,...Number.isInteger(o)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:o=>p(this,le).checkout({operationId:o.holdId,buyerEmail:o.buyerEmail,...o.buyerName?{buyerName:o.buyerName}:{},...p(this,A).returnUrl?{returnUrl:p(this,A).returnUrl}:{}}),orderStatus:o=>p(this,le).orderStatus(o),onCancel:()=>{k(this,ct,null),w(this,v,Un).call(this)},onConfirmed:o=>{p(this,A).onOrderConfirmed?.(o),w(this,v,Y).call(this,{kind:"booked",message:ue("season.orderConfirmed")})},onError:o=>p(this,A).onError?.(o)})),w(this,v,Un).call(this))},vo=function(){p(this,ct)?.destroy(),k(this,ct,null),w(this,v,Un).call(this)},Zd=function(){let e=document.createElement("div");return e.className="sl-season-strip",k(this,pn,e),w(this,v,Un).call(this),e},Un=function(){let e=p(this,pn),t=p(this,J);!e||!t||e.replaceChildren(...Id({step:p(this,ct)?"pay":"seats",pkg:p(this,lt)?.packages.find(i=>i.planActivationId===t.planActivationId)??null,dates:$e(t),money:i=>w(this,v,cn).call(this,i),change:()=>w(this,v,Xd).call(this)}))},Xd=function(){let e=p(this,W);if(!e){w(this,v,Is).call(this);return}if(!p(this,je))return;let t=e.seats?.map(o=>o.label)??p(this,be),i=p(this,Z)?.seatPlaces(t)??t.map(o=>({label:o}));Dd(p(this,je),Nd(i),{keep:()=>{},change:()=>{this.release(`sra_${crypto.randomUUID()}`).then(()=>w(this,v,Is).call(this),o=>w(this,v,Se).call(this,o))}},w(this,v,wo).call(this))},wo=function(){return He(p(this,hn)??void 0,p(this,A).theme,void 0,p(this,J)?.orgAccent)},Is=function(){p(this,oe)||(w(this,v,vo).call(this),p(this,Z)?.destroy(),k(this,Z,null),k(this,pn,null),k(this,be,[]),p(this,Mt).clear(),w(this,v,St).call(this))},Y=function(e,t=!1){p(this,at)&&(p(this,at).textContent=e.message,p(this,at).dataset.kind=e.kind),p(this,je)&&(p(this,je).dataset.busy=String(t)),p(this,A).onStatusChange?.(e)},Se=function(e,t){if(p(this,oe)||e instanceof F&&e.code==="season_api_destroyed")return e;let i=e instanceof ee&&e.reason==="provider_failed"&&p(this,mn)?new ee(p(this,mn)):e;return i instanceof ee?(p(this,A).onError?.(i),i):(w(this,v,Y).call(this,{kind:"failed",message:Bd(i),operationId:t}),p(this,A).onError?.(i),i)},Qd=function(e){p(this,oe)||(e instanceof ee||w(this,v,Y).call(this,{kind:"failed",message:ue("season.sessionEnded")}),p(this,A).onError?.(e))},qn=function(){if(p(this,oe))throw new Error("seatlayer: SeasonPicker was destroyed")},dn=function(){if(w(this,v,qn).call(this),!p(this,J)||!p(this,Z))throw new Error("seatlayer: render SeasonPicker before using it")};var Ts=Os;function Yf(n,e={}){let t=e.origin??"";if(!t)try{t=new URL(n.src,window.location.href).origin}catch{t=""}let i=!1,o=null,s=null,r=null,a="",l=null,c="",d=()=>{if(i)return;i=!0,o=n.getAttribute("style"),Object.assign(n.style,{position:"fixed",inset:"0",margin:"0",border:"0",zIndex:"2147483000",background:c||"transparent"}),n.style.width="100vw",n.style.height="100vh",n.style.width="100dvw",n.style.height="100dvh";let u=document.documentElement;s=u.style.overflow,u.style.overflow="hidden",document.body&&(r=document.body.style.overflow,document.body.style.overflow="hidden"),l=g=>{g.key==="Escape"&&h()},window.addEventListener("keydown",l)},h=()=>{i&&(i=!1,o===null?n.removeAttribute("style"):n.setAttribute("style",o),o=null,a&&(n.style.height=a),s!==null&&(document.documentElement.style.overflow=s,s=null),r!==null&&document.body&&(document.body.style.overflow=r,r=null),l&&(window.removeEventListener("keydown",l),l=null))},m=u=>{if(u.source!==n.contentWindow||t&&u.origin!==t||!u.data||typeof u.data!="object")return;let g=u.data;if(g.type==="seatlayer:height"){typeof g.px=="number"&&Number.isFinite(g.px)&&g.px>0&&(a=`${Math.round(g.px)}px`,i||(n.style.height=a));return}g.type==="seatlayer:fullscreen"&&(typeof g.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(g.background)&&(c=g.background,i&&(n.style.background=c)),g.on===!0?d():g.on===!1&&h())};return window.addEventListener("message",m),()=>{window.removeEventListener("message",m),h()}}export{j as ApiError,pe as BuyerAccessContext,ee as BuyerAccessUnavailableError,Ie as BuyerRealtimeClient,Ko as EmbeddedDesigner,ie as PerformanceGroupDestroyedError,gs as PerformanceGroupPicker,Ra as SEATING_CHART_CALLBACK_PROPS,La as SEATING_CHART_HANDLE_METHODS,Ma as SEATING_CHART_IDENTITY_PROPS,Ha as SEATING_CHART_VALUE_PROPS,F as SeasonApiError,Ts as SeasonPicker,Vn as SeasonPublicSessionRefused,Fn as SeasonRecoveryTimeoutError,Je as SeatPicker,zo as SeatingChart,Yf as attachPickerFrame,eu as bindSeatingChartHandle,tu as buildSeatingChartOptions,Pn as createBuyerAccessContext,vn as createControllerSink,qo as parseTicketOfferAvailability,rf as prewarmSeatPicker,Nn as shortOperationReference,Ka as ticketOfferPrices};