@seatlayer/js 0.112.0 → 0.113.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 ir,b as sr}from"./chunk-JDMJI3WC.js";import{a as er}from"./chunk-ICMSBXRJ.js";import{a as tr,b as nr,d as ni,e as Bt,f as ii,g as Re}from"./chunk-3FEGZ5HA.js";import{a as p,b as C,c as x,d as w,e as Jo}from"./chunk-7I563G2N.js";import{PickerController as Au,formatMoney as Qi,getLocale as Ja,loadLocale as Pu,localeDirection as Lu,LOCALE_NAMES as Mu,resolveLocale as Hu,seatPriceEntry as Ru,setStringOverrides as Iu,t as Jt}from"@seatlayer/core";var Hp=/^[0-9A-Za-z.+-]{1,24}$/,Rp=Hp.test("0.112.0")?"0.112.0":"",Ip={host:"web",platform:"web",bundle:Rp,protocol:0,chromeOwner:"web"},rr={...Ip},si=null,or=null;function Op(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function ar(){return{...rr}}function _p(){let n=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:n(Op()),documentMs:si==null?0:n(si),handshakeMs:si==null||or==null?0:n(or-si)}}function lr(){let{host:n,platform:e,bundle:t,protocol:i,chromeOwner:s}=rr,o=_p();return{host:n,platform:e,...t?{bundle:t}:{},...i?{protocol:i}:{},chromeOwner:s,bootMs:o.bootMs,documentMs:o.documentMs,handshakeMs:o.handshakeMs}}var cr=new Set,dr=new Map;function Ie(n){return cr.has(n)?"repeat":"cold"}function oi(n){let e=Ie(n);return cr.add(n),e}function he(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0?Math.round(n):0}function kn(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function Dp(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??Ie(n.event),transport:n.transport??"pubapi",...lr(),availabilityMs:he(e.loadStatuses),...typeof n.revealWaitMs=="number"?{revealWaitMs:he(n.revealWaitMs)}:{},...typeof n.handoverMs=="number"?{handoverMs:he(n.handoverMs)}:{},mounts:(dr.get(n.event)??0)+1,reconnects:he(n.reconnects)}}var Np=new Set;function Ee(n){let e=Dp(n);if(e){dr.set(n.event,e.mounts);for(let t of Np)try{t(e)}catch{}typeof fetch>"u"||kn()||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 Bp="realtime.fallback_polling",pr=new Set;function Fp(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 hr(n){let e=Fp(n);if(!e||pr.has(e.eventKey)||(pr.add(e.eventKey),typeof fetch>"u"||kn()))return!1;let t=ar().bundle;return fetch(`${e.apiBase}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:Bp,severity:"warning",eventKey:e.eventKey,...t?{appVersion:t}:{}}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0}var ut="seatlayer.v1",ur="\0",mr=4401,Vp=15e3,$p=25e3,zp=1e4,fr=5e3,jp=JSON.stringify({type:"resume"}),Gp=3e4,Kp=6e4,Up=["pointermove","touchstart","keydown"],qp=3,Wp=15e3,gr=6e4;function Yp(n){let e=typeof n.default=="string"?n.default:"free",t={};if(n.seats&&typeof n.seats=="object")for(let[i,s]of Object.entries(n.seats))typeof s=="string"&&s!==e&&(t[i]=s);return{default:e,exceptions:t}}function Zp(n,e){if(!n||n.default!==e.default)return null;let t=[];for(let[i,s]of Object.entries(e.exceptions))n.exceptions[i]!==s&&t.push({label:i,status:s});for(let i of Object.keys(n.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function Qp(n,e){for(let t of e)t.status===n.default?delete n.exceptions[t.label]:n.exceptions[t.label]=t.status}function br(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 Oe=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"&&br(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=[ut];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(ut)||e.unshift(ut)):a?.ticket&&(e=[ut,`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,s=this.useQueryMarker?`${i}${i.includes("?")?"&":"?"}pv=1`:i;br(s);let o;try{o=(this.opts.socketFactory??((l,c)=>new WebSocket(l,c)))(s,e)}catch{this.upgradeFailed(),this.scheduleReconnect();return}this.ws=o;let r=!1;o.onopen=()=>{this.ws===o&&(r=!0,this.attempt=0,this.failedUpgrades=0,this.stopPolling(),this.v1=o.protocol===ut,this.v1||(this.useQueryMarker=!0),this.startKeepalive(o),this.watched=null,this.watchHold(this.opts.heldHoldId?.()??null),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},fr):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},fr))},o.onmessage=a=>{if(this.ws!==o)return;let l;try{l=JSON.parse(typeof a.data=="string"?a.data:"")}catch{return}!l||typeof l!="object"||this.handleFrame(l)},o.onclose=a=>{if(this.ws===o){if(this.ws=null,this.clearTimers(),!r&&a?.code!==mr&&this.upgradeFailed(),a?.code===mr){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()}},o.onerror=()=>{try{o.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:[],s=Array.isArray(e.closed)?e.closed:[],o=i.join(ur),r=s.join(ur);(o!==this.hidden||r!==this.closedSections)&&(this.hidden=o,this.closedSections=r,this.opts.sink.onSections?.(i,s,{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),s=Zp(this.projection,i);this.projection=i,s===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():s.length&&this.opts.sink.applyStatuses(s);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(s=>typeof s?.label=="string"&&typeof s?.status=="string").map(s=>({label:s.label,status:s.status}));if(!i.length)return;this.projection&&Qp(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>=qp&&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;hr(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(()=>{})},Wp)}}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 o=this.now(),r=o-this.lastInput>=Kp;this.lastInput=o,r&&this.wake()},i={capture:!0,passive:!0},s=o=>{document[o]("visibilitychange",e),window[o]("focus",e);for(let r of Up)document[o](r,t,i)};s("addEventListener"),this.detachWake=()=>s("removeEventListener")}wake(){let e=this.ws;if(!e||e.readyState!==1)return;let t=this.now();if(!(t-this.lastWake<Gp)){try{e.send(jp)}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{}},zp)}},$p)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,Vp),i=this.pollTimer?gr/2+Math.random()*gr/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 Jp="#f43f5e";function Sn(n,e={}){let t=i=>{let s=n.tableSelection(i);if(s)return s.physicalSeatIds;let o=n.idForLabel(i);return o?[o]:[]};return{applyStatuses(i){let s=new Set([...n.currentHold()?.labels??[],...e.ownLabels?.()??[]]),o={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(o[h].push(...d),e.flashOnLiveChange&&h!=="free"&&!s.has(c.label)&&d.some(m=>n.getStatus(m)==="free"))for(let m of d)r.push({id:m,color:Jp});h!=="free"&&!s.has(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])o[c].length&&n.setStatus(o[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,s,o){o?.withInventory||(n.resync?n.resync({reason:"frame"}):n.refresh()),e.onSections?.(i,s,o)}}}var mt="pricingContract=matrix-v1&pricingContract=seat-v1",j=class extends Error{constructor(e,t,i,s,o,r,a,l){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=s,this.reason=o,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)}},yr=10,vr=1;function Tn(n,e){let t=(n??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let s=Date.parse(t);if(Number.isFinite(s))return Math.max(0,Math.ceil((s-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}function eh(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 th={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"};function nh(){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 ih(n,e){let t=e.map(i=>[i.label,i.tierId??null,i.quantity??null]).sort((i,s)=>i[0]<s[0]?-1:i[0]>s[0]?1:0);return JSON.stringify([n,t])}function sh(n){return n instanceof j?n.status===408||n.status===429||n.status>=500:!0}function wr(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}var We=class{constructor(e,t={}){this.base=e;this.viewerId=wr();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=wr()}async pickerIdleMinutes(){return null}get accessScoped(){return!!this.access?.configured}async request(e,t={},i={}){let s=t.method??"GET",o={},r;t.body!==void 0&&(o["Content-Type"]="application/json",r=JSON.stringify(t.body));let a=await this.access?.authorization(i.auth?"unauthorized":"initial");if(a&&(o.Authorization=a),t.idempotency){let m=this.holdAttemptKey(`${t.idempotency.binding}\0${a??""}`);t.idempotency.used(m??void 0),m&&(o["Idempotency-Key"]=m)}let l=s==="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:s,headers:o,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,y=d.status===401&&u==="buyer_access_invalid"&&e.endsWith("/hold/resume");if(this.access?.configured&&!y&&(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?th[u]:void 0,S=m?.conflicts?.map(k=>k.label)??t.labels??[];T&&this.onObjectUnavailable?.({labels:S,reason:T,code:u})}let g;if(d.status===429&&(g=Tn(d.headers.get("Retry-After"),m?.retryAfterSeconds)??vr,s==="GET"&&!i.rateLimit&&g<=yr))return await new Promise(T=>setTimeout(T,g*1e3)),this.request(e,t,{...i,rateLimit:!0});throw d.status===503&&(g=Tn(d.headers.get("Retry-After"),m?.retryAfterSeconds)),new j(d.status,m?.error??`request_failed_${d.status}`,u,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 h}async requestBlob(e,t={}){let i={},s=await this.access?.authorization(t.auth?"unauthorized":"initial");s&&(i.Authorization=s);let o=await fetch(`${this.base}${e}`,{method:"GET",headers:i,credentials:"omit"});if(o.ok)return o.blob();let a=(o.headers.get("content-type")??"").includes("application/json")?await o.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(o.status===401||o.status===403||o.status===422)&&await this.access.handleFailure(o.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(o.status===429&&(c=Tn(o.headers.get("Retry-After"),a?.retryAfterSeconds)??vr,!t.rateLimit&&c<=yr))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new j(o.status,a?.error??`request_failed_${o.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&${mt}`),fetchedAt:Date.now()}}hold(e,t,i,s){let o=`/pub/events/${encodeURIComponent(e)}/hold?${mt}`,r={method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...s?{replaceHoldId:s}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(l=>l.label)};return(s||!this.holdIdempotency?this.request(o,r):this.keyedHold(o,r,ih(e,t))).then(l=>this.noteTicketKeys(l,s))}holdAttemptKey(e){if(this.holdAttempt?.binding===e)return this.holdAttempt.key;let t=nh();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,s=!1){let o;try{let r=await this.request(e,{...t,idempotency:{binding:i,used:a=>{o=a}}});return this.endHoldAttempt(o),r}catch(r){if(sh(r))throw r;this.endHoldAttempt(o);let a=r.code;if(a==="idempotency_key_reused"&&!s)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(o=>typeof o=="string")?[...e.ticketKeys]:null,s=Array.isArray(e.ticketKeyDetails)&&e.ticketKeyDetails.every(eh)?e.ticketKeyDetails.map(({ticketKey:o,label:r,unitIndex:a,quantity:l,displayLabel:c})=>({ticketKey:o,label:r,unitIndex:a,quantity:l,...c?{displayLabel:c}:{}})):null;return i||s?this.ticketKeysByHold.set(e.holdId,{...i?{ticketKeys:i}:{},...s?{ticketKeyDetails:s}:{}}):this.ticketKeysByHold.delete(e.holdId),e}ticketKeysFor(e){let t=this.ticketKeysByHold.get(e);return t?{...t}:null}bestAvailable(e,t,i,s,o){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available?${mt}`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...s?{zoneId:s}:{},...o?{ttlMs:o}:{},...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(s=>{let o=this.ticketKeysByHold.get(i);if(o){let r=new Set(s?.released??t);this.ticketKeysByHold.set(i,{...o.ticketKeys?{ticketKeys:o.ticketKeys.filter(a=>!r.has(a))}:{},...o.ticketKeyDetails?{ticketKeyDetails:o.ticketKeyDetails.filter(a=>!r.has(a.ticketKey))}:{}})}return s})}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?${mt}${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}&${mt}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[ut]}createRealtime(e,t){return this.accessScoped?null:new Oe({url:this.subscribeUrl(e),sink:t})}};import{t as jt,tCount as yh}from"@seatlayer/core";import{compactRowLabel as uh,seatNoteRowModel as mh,seatTypeIconSvg as Or,t as Ye}from"@seatlayer/core";import{seatConfidenceDisclosure as fh}from"@seatlayer/core/core/seatConfidence";import{gaAvailabilityText as ch}from"@seatlayer/core";import{t as Sr}from"@seatlayer/core";import{cdnAssetUrl as Yg,importCdnAsset as ri}from"@seatlayer/core/core/cdnAsset";var oh=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,rh=/[\s"'<>`\\]/;function ah(n){return n.startsWith("//")?!1:n.startsWith("/")||n.startsWith("./")||n.startsWith("../")}function lh(){try{let n=typeof location>"u"?"":location.origin;return n&&n!=="null"?n:null}catch{return null}}function Ft(n){if(typeof n!="string"||!n||n.length>2e6||n!==n.trim())return!1;if(n.startsWith("data:"))return oh.test(n);if(rh.test(n))return!1;let e=lh();if(ah(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 Jg}from"@seatlayer/core/core/cdnAsset";function v(n,e){let t=Sr(n);return t===n?e:t}function ft(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?v("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):v("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function ai(){return{rotate:v("picker.dragToRotateVenue","Drag to rotate the venue"),move:v("picker.dragToMoveVenue","Drag to move the venue"),zoomIn:v("picker.zoomIn","Zoom in"),zoomOut:v("picker.zoomOut","Zoom out"),fitView:v("picker.fitWholeVenue","Show whole venue")}}function li(n){return n==="map"||n==="classic"?{touchNavigation:n}:{}}function ci(n){return typeof n=="boolean"?{crowdFigures:n?Number.POSITIVE_INFINITY:0}:{}}var xr=new WeakMap;function di(n){let e=n.doc??null,t=e?xr.get(e):void 0;if(t)return t;let i=new Map(n.getGAAreas().map(s=>[s.id,{categoryKey:s.categoryKey??"",wheelchairPlaces:s.wheelchairPlaces??0}]));return e&&xr.set(e,i),i}function pi(n,e=()=>!1,t=()=>0){let i={};for(let[s,o]of Object.entries(n)){let r=o.available==null?"":ch({available:o.available,wheelchairFree:o.wheelchairFree});i[s]={available:o.available,selected:o.selected??0,wheelchairFree:o.wheelchairFree??null,filteredOut:e(s),statusText:r&&t(s)>0?`${dh} ${r}`:r}}return i}var dh="\u267F",Is=new WeakSet;function hi(n,e){if(Is.has(n))return;Is.add(n);let t=()=>{Is.delete(n),e()};typeof requestAnimationFrame=="function"?requestAnimationFrame(t):setTimeout(t,16)}function Tr(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 s=[...i][0]??"";return(e?s.toLocaleUpperCase(e):s.toLocaleUpperCase())+i.slice(s.length)}function Er(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 F(n){return String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function ui(n,e,t){let i=e.find(o=>Ft(o))??null;if(n.replaceChildren(),!i)return n.textContent=t.slice(0,1).toUpperCase(),null;let s=document.createElement("img");return s.alt="",s.referrerPolicy="no-referrer",s.src=i,n.appendChild(s),i}var Vt=null;function mi(){if(Vt!==null)return Vt;try{if(typeof document>"u")return Vt=!1;Vt=!!document.createElement("canvas").getContext("webgl2")}catch{Vt=!1}return Vt}var En=null;function Cn(){return En||(En=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?ri("seatlayer-view3d.mjs"):import("@seatlayer/core/view3d")).catch(e=>{throw En=null,e}),En)}function fi(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Cn().catch(()=>{})}async function gi(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?ri("seatlayer-panorama.mjs"):import("@seatlayer/core")}async function $t(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?ri("seatlayer-checkout.mjs"):import("./hostedCheckout-2JDHIDPG.js")}async function Cr(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?ri("seatlayer-sales.mjs"):import("./pickerSalesClose-Y7RUQ2MY.js")}function Ar(n){return n==="unavailable_for_event"||n==="payments_off_for_event"?n:"not_configured"}function Pr(n){return n.lineItems.reduce((e,t)=>e+t.quantity,0)}function Os(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??v("picker.generalAdmission","General admission")}function ph(n,e){let t=new Map;for(let i of n){let s=i.rowLabel&&i.seatNumber?[i.sectionLabel,`${v("picker.row","Row")} ${i.rowLabel}`,`${v("picker.seat","Seat")} ${i.seatNumber}`].filter(Boolean).join(" \xB7 "):Os(i,e),o=[i.categoryLabel,i.tierLabel].filter(Boolean).join(" \xB7 "),r=Math.max(1,Math.floor(i.quantity||1)),a=`${s}\0${o}`,l=t.get(a)??{label:s,detail:o,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 kr=(n,e,t)=>Sr("picker.bookingForm.guestOfCount",{label:n,index:e,total:t});function hh(n,e,t=[]){let i=new Map,s=[];for(let d of n.lineItems){let h=Os(d,t),m=Math.max(1,Math.floor(d.quantity)||1);if(d.objectType!=="ga"&&!(d.objectType==="table"&&m>1)){s.push({key:d.label,name:h,unitIndex:1,quantity:1});continue}for(let u=1;u<=m;u+=1){let y=(i.get(d.label)??0)+1;i.set(d.label,y),s.push({key:`${d.label}#${y}`,name:h,unitIndex:u,quantity:m})}}let o=e?.ticketKeyDetails??[],r=e?.ticketKeys??o.map(d=>d.ticketKey),a=(r.length===s.length?r:s.map(d=>d.key)).map(d=>{let h=s.find(u=>u.key===d),m=o.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:kr(h,m,u)};let y=(c.get(h)??0)+1;c.set(h,y);let g=l.get(h)??1;return{key:d,title:g>1?kr(h,y,g):h}})}function Lr(n,e,t,i,s=[]){let o=new Map;for(let r of n.lineItems){let a=Os(r,s);o.set(a,(o.get(a)??0)+1)}return{kind:"pay",provider:e,order:{holdId:n.holdId,expiresAt:n.expiresAt,currency:n.currency,total:n.total,labels:[...o].map(([r,a])=>a>1?`${r} \xD7${a}`:r),tickets:hh(n,i,s),lines:ph(n.lineItems,s)},bookingForm:t?.bookingForm??null,...t?.bookingMode==="free"?{free:!0}:{}}}function Mr(n){return String(n?.code).startsWith("booking_form_")}function bi(n,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},s=new Date(n);if(e)try{return s.toLocaleString(t,{...i,timeZone:e})}catch{}return s.toLocaleString(t,i)}function _s(n){return/early[\s-]*bird/i.test(n?.trim()??"")}function Hr(n){return _s(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 yi(n,e){return`<span class="sl-offer-mark" role="img" aria-label="${e(n)}" title="${e(n)}">${Hr(n)}</span>`}function vi(n,e){return`<span class="sl-offer-badge">${Hr(n)}<span>${e(n)}</span></span>`}function Rr(n,e=Date.now()){let t=n-e;if(t<=0)return null;let i=Math.max(1,Math.ceil(t/6e4)),s=Math.floor(i/1440),o=Math.floor(i%1440/60),r=i%60;return`${(s>0?[`${s}d`,...o?[`${o}h`]:[]]:[...o?[`${o}h`]:[],...r||!o?[`${r}m`]:[]]).join(" ")} left`}function Ds(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function A(n){return String(n??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Ns(n){return n?mh(n).map(e=>({...e,title:v(e.titleKey,e.titleFallback)})):[]}function _r(n){return Ns(n).map(e=>e.title)}function gt(n,e={}){return Bs(Ns(n),e)}function Bs(n,e={}){if(!n.length)return"";let t=e.compact?15:17,i=n.map(s=>`<div class="sl-note sl-note-${A(s.tone)}"><span class="sl-note-i">${Or(s.icon,{size:t})}</span><span class="sl-note-t"><b>${A(s.title)}</b>`+(s.note?`<span class="sl-note-n">${A(s.note)}</span>`:"")+"</span></div>").join("");return`<div class="sl-notes${e.compact?" compact":""}">${i}</div>`}function Dr(n){return Ns(n).map(e=>{let t=A(e.note?`${e.title}: ${e.note}`:e.title);return`<span class="sl-cx-mark sl-cx-mark-${A(e.tone)}" role="img" aria-label="${t}" title="${t}">${Or(e.icon,{size:13})}</span>`}).join("")}function wi(n){let e=[];return n?.restrictedView&&e.push(v("picker.restrictedView","Restricted view")),n?.obstructedView&&e.push(v("picker.obstructedView","Obstructed view")),e}function Fs(n,e){if(!n)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("picker.seeItIn3d","See it in 3D"),i=e?v("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 Nr(n,e){if(!e)return"";let t=e,i=t.includes(n.id),s=i?t.length>1?v("picker.openComparison","Open comparison"):v("picker.savedForComparison","Saved for comparison"):t.length?v("picker.compareWithSaved","Compare with saved"):v("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>${A(s)}</span></button>`}function Br(n,e,t){if(!t)return"";let i=fh(n.confidenceEvidence),s=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${A(n.displayLabel??n.label)}"><span><em>${A(e)}</em><strong>${A(i.headline)}</strong><small>${A(s)}</small></span><b>Passport</b></button>`}function J(n){let e=n?.rowLabel,t=n?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let s=`${t}${i}`;if(e.startsWith(s)&&e.length>s.length)return e.slice(s.length)}return uh(e,t)}function gh(n){switch(n){case"paused":return{title:v("picker.accessPausedTitle","These seats are on hold right now"),body:v("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:v("picker.accessRetry","Try again")};case"revoked":return{title:v("picker.accessRevokedTitle","This access link is no longer active"),body:v("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats."),action:v("picker.accessRefresh","Refresh")};case"idle":return{title:v("picker.idlePausedTitle","Your session expired"),body:v("picker.idlePausedBody","You were away for a while. Refresh to see which seats are free now."),action:v("picker.idleRefresh","Show latest seats")};case"no_token":case"provider_failed":return{title:v("picker.accessExpiredTitle","The seat map timed out"),body:v("picker.accessExpiredBody","Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now."),action:v("picker.accessRefresh","Refresh")};default:return{title:v("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:v("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest."),action:v("picker.accessRefresh","Refresh")}}}var bh=6;function Fr(n,e,t){let i=Ds;return[n?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${n.sectionLabel.length>bh?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${v("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(J(n)??n?.displayLabel??e)}</span></div>`:"",n?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${v("picker.seat","Seat")}</span><span class="sl-confirm-value">${i(n?.seatNumber??n?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function Vr(n,e,t){let i=Ds,s=n?.objectType==="booth",o=n?.objectType==="table"&&!!n?.bookingMode,r=s||o||!n?.seatNumber,a=n?.sectionLabel??(r?void 0:n?.displayLabel),l=o?`${v("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} ${J(n)??""}`.trim():void 0,`${v("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 $r(n,e){if(!n)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("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 zr(n,e){if(!n||e)return"";let t=v("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 Ir(n){return n.buyerMessage?.trim()||(n.restriction==="companion"?v("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function xi(n,e,t,i=()=>{}){let s=Ds;if(n.length>1)return`<fieldset class="sl-confirm-tiers"><legend><span>${Ye("picker.ticketType")}</span></legend>`+n.map(a=>{let l=Ir(a),c=i(a);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${s(a.id)}"${c?` data-offer-name="${s(c)}"`:""} aria-pressed="${a.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${s(a.name)}`+(c?`<span class="sl-confirm-tier-offer">${vi(c,s)}</span>`:"")+"</span>"+(l?`<small class="sl-confirm-tier-note">${s(l)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${s(t(a))}</span></button>`}).join("")+"</fieldset>";let o=n[0],r=o?Ir(o):void 0;return r?`<p class="sl-confirm-tier-note">${s(r)}</p>`:""}function jr(n){return'<div class="sl-confirm-grid">'+n.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${A(n.categoryLabel)}</span>`+(n.priceLabel?`<span class="sl-confirm-price">${A(n.priceLabel)}</span>`:"")+"</div>"+(n.priceLabel&&n.feeNote?`<div class="sl-confirm-fee">${A(n.feeNote)}</div>`:"")+'<div class="sl-confirm-id">'+n.marker+`<span class="sl-confirm-dot" style="background:${A(n.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${A(n.categoryLabel)}</span><span class="sl-confirm-who">`+n.identity+"</span>"+(n.priceLabel?`<span class="sl-confirm-idprice">${A(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">${A(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">${A(n.selectLabel)}</span></button></div></div>`}function Gr(n,e){let t=F,{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?Ye("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):Ye("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?v("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):Ye("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(Ye("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(v("picker.tableCapacity","Table capacity"))}</span><span>${t(Ye("picker.guestsCount",{count:n.capacity}))}</span>`+(n.entrance?`<span class="muted">${t(v("picker.entrance","Entrance"))}</span><span>${t(n.entrance)}</span>`:"")+(e.suppressPricing?"":`<span class="muted">${t(v("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(i?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(v("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(v("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(v("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t(Ye("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(Ye("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?v("picker.updateTable","Update table"):i?v("picker.selectTable","Select table"):v("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function Kr(n,e){let t=gh(n),i=document.createElement("div");i.className="sl-interrupt sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let s=document.createElement("div");s.className="sl-interrupt-card";let o=document.createElement("div");o.className="sl-interrupt-title",o.textContent=t.title;let r=document.createElement("div");r.className="sl-interrupt-body",r.textContent=t.body,s.append(o,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),s.appendChild(a),i.appendChild(s),i}function Ur(n,e){return`<div class="sl-a11yhead"><span class="sl-a11yhead-t">${A(n)}</span><button type="button" class="sl-a11yclose" data-a11y-close aria-label="${F(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 qr(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="${A(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">${A(e.label)}</span></span>`+(e.count?`<span class="sl-a11yrow-c">${A(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>';return e.note?`<div class="sl-a11yrow-w">${t}${zt({id:`sl-info-${F(e.key.replace(/[^A-Za-z0-9]+/g,"-"))}`,label:e.note,text:A(e.note)})}</div>`:t}).join("")}function zt(n){return`<span class="sl-info"${n.wrapRef?` data-ref="${F(n.wrapRef)}"`:""}><button type="button" class="sl-info-btn" data-sl-info aria-label="${F(n.label)}" aria-describedby="${F(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="${F(n.id)}"${n.ref?` data-ref="${F(n.ref)}"`:""}>${n.text}</span></span>`}function Wr(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 Yr(n){let e=n.performanceLabel?`<div class="sl-chip-when">${F(n.performanceLabel)}</div>`:"",t=n.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${F(n.performanceDates.summary)}</span><span class="sl-chip-date-list">${n.performanceDates.labels.map(i=>`<span class="sl-chip-date">${F(i)}</span>`).join("")}</span></div>`:"";return e+vh(n)+t}function vh(n){let{d:e,area:t,label:i,objectType:s,quantity:o=1,identity:r}=n,a=L=>String(L??"\u2014").replace(/[&<>"]/g,U=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[U]),l=s==="ga"?"ga":e?.objectType??s,c=r?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?v("picker.table","Table"):l==="booth"?v("picker.booth","Booth"):l==="ga"?v("picker.generalAdmission","General admission"):v("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([v("picker.guests","Guests"),String(o)])):l==="ga"?(m=String(t?.displayLabel??d),o>1&&u.push([v("picker.tickets","Tickets"),String(o)])):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(J(e)??e.rowLabel)]),e.seatNumber&&u.push([v("picker.seat","Seat"),String(e.seatNumber)]));let y=!m&&!!h,g=m||h||String(d),T=!!h&&!y&&h!==g,S=n.offerName?yi(n.offerName,a):"",k=u.map(([L,U])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(L)}</span> <b>${a(U)}</b></span>`);T&&k.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(h)}</span>${S}</span>`);let E=[g,...u.map(([L,U])=>`${L} ${U}`),T?h:"",n.offerName??""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(E)}</span><span class="sl-chip-name" aria-hidden="true">${a(g)}${T?"":S}</span>`+(k.length?`<span class="sl-chip-pos" aria-hidden="true">${k.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function ki(n,e,t){return n.map(i=>`<option value="${t(i.id)}"${i.id===e?" selected":""}>${t(i.name)}</option>`).join("")}function wh(n){let e=F;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 Zr(n){let e=F;return`<div class="sl-chip${n.held?" sl-held":""}${n.fresh?" sl-enter":""}"`+wh(n)+">"+(n.held?n.stateHtml:`<span class="sl-chip-dot" style="background:${A(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 Vs(n,e){let t=F(n),i=e?F(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${i}" aria-label="${F(jt("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 Si(n,e){return new Set(n.filter(t=>(e[t.key]??0)<=0).map(t=>t.key))}function Ti(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 s=Si(i,n.categoryAvailability());return s.size<i.length||(n.currentHold()?.items??[]).some(r=>s.has(r.categoryKey))?null:Object.assign(new Error("seatlayer: that ticket type is sold out"),{status:409,code:"sold_out",reason:"sold_out"})}function Qr(n){return n.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${v("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${jt("picker.willFindSeatsTogether",{count:n.quantity})}</b><span>${v("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>${v("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${v("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="sl-ba-title-t">${v("picker.findSeatsTogether","Find seats together")}</span>`+zt({id:"sl-info-best-seats",label:v("picker.aboutBestSeats","About finding seats together"),text:v("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>${v("picker.bestSeatsPremium","Best seats")}</button>`:"")+`</div><div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${v("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${n.quantity}</span><button type="button" data-ba="1" aria-label="${v("picker.moreSeats","More seats")}">+</button></div>`+(n.categories.length>1?`<select class="sl-ba-cat" aria-label="${F(v("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${F(v("picker.anyTicketType","Any ticket type"))}</option>`+n.categories.map(e=>e.soldOut?`<option value="${F(e.key)}" disabled>${F(`${e.label} \xB7 ${v("picker.soldOutTitle","Sold out")}`)}</option>`:`<option value="${F(e.key)}"${n.selectedCategory===e.key?" selected":""}>${F(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(n.zones.length?`<select class="sl-ba-zone" aria-label="${v("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${v("picker.anyVenueZone","Any venue zone")}</option>`+n.zones.map(e=>`<option value="${F(e.id)}"${n.selectedZone===e.id?" selected":""}>${F(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>${v("picker.findingBestSeats","Finding the best seats\u2026")}`:yh("picker.findBestSeatsCount",n.quantity))+"</button>"+(n.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${v("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function Xr(n){return n==="setup"||n==="testable"?{heading:v("picker.salesNotOpenPill","Sales haven\u2019t opened yet"),sentence:v("picker.salesNotOpenCopy","Tickets for this event aren\u2019t on sale yet.")}:n==="paused"?{heading:v("picker.salesPausedPill","Sales are paused"),sentence:v("picker.salesPausedCopy","Ticket sales are paused for now.")}:{heading:v("picker.salesClosedPill","Sales are closed"),sentence:v("picker.salesClosedCopy","Ticket sales for this event have ended.")}}function Jr(n,e=!1){if(!e&&(n==="setup"||n==="testable"||n==="paused")){let t=Xr(n);return{pill:t.heading,cta:t.heading,toast:t.sentence}}return{pill:v("picker.salesClosedPill","Sales are closed"),cta:v("picker.salesClosedCta","Sales closed"),toast:v("picker.salesClosedToast","Sales are closed for this event.")}}function ea(n){if(n.salesClosed&&!n.hasPicks){let e=n.whenText?`<span class="when">${F(n.whenText)}</span>`:"",t=n.note??Xr(n.salesState);return`<div class="sl-closed-note" role="status"><b>${t.heading}</b><span>${t.sentence}${e}</span></div>`}return""}function ta(n){return n.hasGaAreas?n.seated?n.venue3d?jt("picker.trayHintChoose3dOrStanding"):v("picker.trayHintTapOrStanding","Tap a seat on the map or grab standing tickets below."):n.venue3d?jt("picker.gaTrayHintChoose3dArea"):v("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets."):n.groupMode==="per_performance"?v("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):n.groupMode?n.season?jt("picker.season.trayHint"):v("picker.groupTrayHint","Choose seats once. The same seats will be held for every performance."):n.venue3d?jt("picker.trayHintChoose3dOrBest"):v("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}import{getLocale as Eh,loadLocale as Ch,LOCALE_NAMES as Ah,localeDirection as ia,resolveLocale as sa,setStringOverrides as Ph,TRANSLATED_LOCALES as Lh}from"@seatlayer/core";import{getLocale as xh,localeDirection as kh,t as Sh}from"@seatlayer/core";function Th(){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 na(n,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,i.lang=xh(),i.dir=kh(),n.appendChild(i),Object.entries(Re(void 0,t)).forEach(([o,r])=>i.style.setProperty(o,r)),i.innerHTML=`
1
+ import{a as rr,b as ar}from"./chunk-JDMJI3WC.js";import{a as ir}from"./chunk-ICMSBXRJ.js";import{a as sr,b as or,d as ii,e as Bt,f as si,g as Ie}from"./chunk-3FEGZ5HA.js";import{a as p,b as C,c as x,d as w,e as nr}from"./chunk-7I563G2N.js";import{PickerController as $u,formatMoney as es,getLocale as sl,loadLocale as zu,localeDirection as ju,LOCALE_NAMES as Gu,resolveLocale as Ku,seatPriceEntry as Uu,setStringOverrides as qu,t as en}from"@seatlayer/core";var Dp=/^[0-9A-Za-z.+-]{1,24}$/,Np=Dp.test("0.113.0")?"0.113.0":"",Bp={host:"web",platform:"web",bundle:Np,protocol:0,chromeOwner:"web"},cr={...Bp},oi=null,lr=null;function Fp(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function dr(){return{...cr}}function Vp(){let n=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:n(Fp()),documentMs:oi==null?0:n(oi),handshakeMs:oi==null||lr==null?0:n(lr-oi)}}function pr(){let{host:n,platform:e,bundle:t,protocol:i,chromeOwner:s}=cr,o=Vp();return{host:n,platform:e,...t?{bundle:t}:{},...i?{protocol:i}:{},chromeOwner:s,bootMs:o.bootMs,documentMs:o.documentMs,handshakeMs:o.handshakeMs}}var hr=new Set,ur=new Map;function Oe(n){return hr.has(n)?"repeat":"cold"}function ri(n){let e=Oe(n);return hr.add(n),e}function he(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0?Math.round(n):0}function Sn(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function $p(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??Oe(n.event),transport:n.transport??"pubapi",...pr(),availabilityMs:he(e.loadStatuses),...typeof n.revealWaitMs=="number"?{revealWaitMs:he(n.revealWaitMs)}:{},...typeof n.handoverMs=="number"?{handoverMs:he(n.handoverMs)}:{},mounts:(ur.get(n.event)??0)+1,reconnects:he(n.reconnects)}}var zp=new Set;function Ee(n){let e=$p(n);if(e){ur.set(n.event,e.mounts);for(let t of zp)try{t(e)}catch{}typeof fetch>"u"||Sn()||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 jp="realtime.fallback_polling",mr=new Set;function Gp(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 fr(n){let e=Gp(n);if(!e||mr.has(e.eventKey)||(mr.add(e.eventKey),typeof fetch>"u"||Sn()))return!1;let t=dr().bundle;return fetch(`${e.apiBase}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:jp,severity:"warning",eventKey:e.eventKey,...t?{appVersion:t}:{}}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0}var ut="seatlayer.v1",gr="\0",br=4401,Kp=15e3,Up=25e3,qp=1e4,yr=5e3,Wp=JSON.stringify({type:"resume"}),Yp=3e4,Zp=6e4,Xp=["pointermove","touchstart","keydown"],Qp=3,Jp=15e3,vr=6e4;function eh(n){let e=typeof n.default=="string"?n.default:"free",t={};if(n.seats&&typeof n.seats=="object")for(let[i,s]of Object.entries(n.seats))typeof s=="string"&&s!==e&&(t[i]=s);return{default:e,exceptions:t}}function th(n,e){if(!n||n.default!==e.default)return null;let t=[];for(let[i,s]of Object.entries(e.exceptions))n.exceptions[i]!==s&&t.push({label:i,status:s});for(let i of Object.keys(n.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function nh(n,e){for(let t of e)t.status===n.default?delete n.exceptions[t.label]:n.exceptions[t.label]=t.status}function wr(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 _e=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"&&wr(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=[ut];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(ut)||e.unshift(ut)):a?.ticket&&(e=[ut,`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,s=this.useQueryMarker?`${i}${i.includes("?")?"&":"?"}pv=1`:i;wr(s);let o;try{o=(this.opts.socketFactory??((l,c)=>new WebSocket(l,c)))(s,e)}catch{this.upgradeFailed(),this.scheduleReconnect();return}this.ws=o;let r=!1;o.onopen=()=>{this.ws===o&&(r=!0,this.attempt=0,this.failedUpgrades=0,this.stopPolling(),this.v1=o.protocol===ut,this.v1||(this.useQueryMarker=!0),this.startKeepalive(o),this.watched=null,this.watchHold(this.opts.heldHoldId?.()??null),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},yr):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},yr))},o.onmessage=a=>{if(this.ws!==o)return;let l;try{l=JSON.parse(typeof a.data=="string"?a.data:"")}catch{return}!l||typeof l!="object"||this.handleFrame(l)},o.onclose=a=>{if(this.ws===o){if(this.ws=null,this.clearTimers(),!r&&a?.code!==br&&this.upgradeFailed(),a?.code===br){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()}},o.onerror=()=>{try{o.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:[],s=Array.isArray(e.closed)?e.closed:[],o=i.join(gr),r=s.join(gr);(o!==this.hidden||r!==this.closedSections)&&(this.hidden=o,this.closedSections=r,this.opts.sink.onSections?.(i,s,{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=eh(e),s=th(this.projection,i);this.projection=i,s===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():s.length&&this.opts.sink.applyStatuses(s);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(s=>typeof s?.label=="string"&&typeof s?.status=="string").map(s=>({label:s.label,status:s.status}));if(!i.length)return;this.projection&&nh(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>=Qp&&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;fr(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(()=>{})},Jp)}}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 o=this.now(),r=o-this.lastInput>=Zp;this.lastInput=o,r&&this.wake()},i={capture:!0,passive:!0},s=o=>{document[o]("visibilitychange",e),window[o]("focus",e);for(let r of Xp)document[o](r,t,i)};s("addEventListener"),this.detachWake=()=>s("removeEventListener")}wake(){let e=this.ws;if(!e||e.readyState!==1)return;let t=this.now();if(!(t-this.lastWake<Yp)){try{e.send(Wp)}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{}},qp)}},Up)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,Kp),i=this.pollTimer?vr/2+Math.random()*vr/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 ih(n){return n==="blocked"?"not_for_sale":n==="unavailable"?"held":n==="held"||n==="booked"||n==="free"||n==="not_for_sale"?n:"free"}var sh="#f43f5e";function Tn(n,e={}){let t=i=>{let s=n.tableSelection(i);if(s)return s.physicalSeatIds;let o=n.idForLabel(i);return o?[o]:[]};return{applyStatuses(i){let s=new Set([...n.currentHold()?.labels??[],...e.ownLabels?.()??[]]),o={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=ih(c.status);if(o[h].push(...d),e.flashOnLiveChange&&h!=="free"&&!s.has(c.label)&&d.some(m=>n.getStatus(m)==="free"))for(let m of d)r.push({id:m,color:sh});h!=="free"&&!s.has(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])o[c].length&&n.setStatus(o[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,s,o){o?.withInventory||(n.resync?n.resync({reason:"frame"}):n.refresh()),e.onSections?.(i,s,o)}}}var mt="pricingContract=matrix-v1&pricingContract=seat-v1",j=class extends Error{constructor(e,t,i,s,o,r,a,l){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=s,this.reason=o,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)}},xr=10,kr=1;function En(n,e){let t=(n??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let s=Date.parse(t);if(Number.isFinite(s))return Math.max(0,Math.ceil((s-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}function oh(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 rh={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"};function Sr(){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 ah(n,e){let t=e.map(i=>[i.label,i.tierId??null,i.quantity??null]).sort((i,s)=>i[0]<s[0]?-1:i[0]>s[0]?1:0);return JSON.stringify([n,t])}function lh(n){return n instanceof j?n.status===408||n.status===429||n.status>=500:!0}var Er=3,ch=7e3,dh=500,ph=.25;function Ft(n){if(n instanceof TypeError)return!0;let e=n;return!e||typeof e!="object"||typeof e.status!="number"?!1:e.status===503&&e.retryable===!0?!0:e.status>=500&&e.message===`request_failed_${e.status}`}var li=class extends Error{},hh=2;async function ai(n,e,t=Er,i){let s=0;for(let o=1;;o+=1)try{return await n()}catch(r){if(o>=t||!Ft(r)||i&&!i())throw r;let a=r.retryAfterS,l=typeof a=="number"&&a>0?a*1e3:dh*2**(o-1),c=Math.round(l*(1+ph*Math.random()));if(s+c>ch)throw r;s+=c,await new Promise(d=>setTimeout(d,c)),e?.()}}function Tr(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}var We=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 s=t.method??"GET",o={},r;t.body!==void 0&&(o["Content-Type"]="application/json",r=JSON.stringify(t.body));let a=await this.access?.authorization(i.auth?"unauthorized":"initial");if(a&&(o.Authorization=a),t.idempotency){let m=`${t.idempotency.binding}\0${a??""}`,{resendOf:u}=t.idempotency;if(u!==void 0&&(this.holdAttempt?.binding!==m||this.holdAttempt.key!==u))throw new li;let b=u??this.holdAttemptKey(m);t.idempotency.used(b??void 0),b&&(o["Idempotency-Key"]=b)}t.idempotencyKey&&(o["Idempotency-Key"]=t.idempotencyKey);let l=s==="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:s,headers:o,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,b=d.status===401&&u==="buyer_access_invalid"&&e.endsWith("/hold/resume");if(this.access?.configured&&!b&&(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?rh[u]:void 0,S=m?.conflicts?.map(k=>k.label)??t.labels??[];T&&this.onObjectUnavailable?.({labels:S,reason:T,code:u})}let g;if(d.status===429&&(g=En(d.headers.get("Retry-After"),m?.retryAfterSeconds)??kr,s==="GET"&&!i.rateLimit&&g<=xr))return await new Promise(T=>setTimeout(T,g*1e3)),this.request(e,t,{...i,rateLimit:!0});throw d.status===503&&(g=En(d.headers.get("Retry-After"),m?.retryAfterSeconds)),new j(d.status,m?.error??`request_failed_${d.status}`,u,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 h}async requestBlob(e,t={}){let i={},s=await this.access?.authorization(t.auth?"unauthorized":"initial");s&&(i.Authorization=s);let o=await fetch(`${this.base}${e}`,{method:"GET",headers:i,credentials:"omit"});if(o.ok)return o.blob();let a=(o.headers.get("content-type")??"").includes("application/json")?await o.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(o.status===401||o.status===403||o.status===422)&&await this.access.handleFailure(o.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(o.status===429&&(c=En(o.headers.get("Retry-After"),a?.retryAfterSeconds)??kr,!t.rateLimit&&c<=xr))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new j(o.status,a?.error??`request_failed_${o.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&${mt}`),fetchedAt:Date.now()}}hold(e,t,i,s){let o=`/pub/events/${encodeURIComponent(e)}/hold?${mt}`,r={method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...s?{replaceHoldId:s}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(l=>l.label)};return(s||!this.holdIdempotency?this.request(o,r):this.keyedHold(o,r,ah(e,t))).then(l=>this.noteTicketKeys(l,s))}holdAttemptKey(e){if(this.holdAttempt?.binding===e)return this.holdAttempt.key;let t=Sr();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,s=!1){let o,r,a,l=0;try{let c=await ai(async()=>{l+=1;let d=l>1;try{return await this.request(e,{...t,idempotency:{binding:i,used:h=>{o=h},...d?{resendOf:r}:{}}})}catch(h){throw d||(r=o,a=h),h}},void 0,Er,()=>r!==void 0);return this.endHoldAttempt(o),c}catch(c){let d=c instanceof li?a:c;if(lh(d))throw d;this.endHoldAttempt(o);let h=d.code;if(h==="idempotency_key_reused"&&!s)return this.keyedHold(e,t,i,!0);if(h==="invalid_idempotency_key")return this.holdIdempotency=!1,this.request(e,t);throw d}}noteTicketKeys(e,t){if(t&&this.ticketKeysByHold.delete(t),!e?.holdId)return e;let i=Array.isArray(e.ticketKeys)&&e.ticketKeys.every(o=>typeof o=="string")?[...e.ticketKeys]:null,s=Array.isArray(e.ticketKeyDetails)&&e.ticketKeyDetails.every(oh)?e.ticketKeyDetails.map(({ticketKey:o,label:r,unitIndex:a,quantity:l,displayLabel:c})=>({ticketKey:o,label:r,unitIndex:a,quantity:l,...c?{displayLabel:c}:{}})):null;return i||s?this.ticketKeysByHold.set(e.holdId,{...i?{ticketKeys:i}:{},...s?{ticketKeyDetails:s}:{}}):this.ticketKeysByHold.delete(e.holdId),e}ticketKeysFor(e){let t=this.ticketKeysByHold.get(e);return t?{...t}:null}bestAvailable(e,t,i,s,o){let r=Sr()??void 0,a=()=>this.request(`/pub/events/${encodeURIComponent(e)}/best-available?${mt}`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...s?{zoneId:s}:{},...o?{ttlMs:o}:{},...this.referral?{referral:this.referral}:{}},...r?{idempotencyKey:r}:{}});return(r?ai(a,void 0,hh):a()).then(l=>this.noteTicketKeys(l))}resume(e,t){return ai(()=>this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}})).then(i=>this.noteTicketKeys(i))}release(e,t,i){this.holdAttempt=null;let s=!1;return ai(()=>this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:i}}),()=>{s=!0}).then(o=>{let r=s?{...o,released:[...t]}:o,a=this.ticketKeysByHold.get(i);if(a){let l=new Set(r?.released??t);this.ticketKeysByHold.set(i,{...a.ticketKeys?{ticketKeys:a.ticketKeys.filter(c=>!l.has(c))}:{},...a.ticketKeyDetails?{ticketKeyDetails:a.ticketKeyDetails.filter(c=>!l.has(c.ticketKey))}:{}})}return r})}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?${mt}${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}&${mt}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[ut]}createRealtime(e,t){return this.accessScoped?null:new _e({url:this.subscribeUrl(e),sink:t})}};import{t as Gt,tCount as Ch}from"@seatlayer/core";import{compactRowLabel as xh,seatNoteRowModel as kh,seatTypeIconSvg as Fr,t as Ye}from"@seatlayer/core";import{seatConfidenceDisclosure as Sh}from"@seatlayer/core/core/seatConfidence";import{gaAvailabilityText as bh}from"@seatlayer/core";import{t as Pr}from"@seatlayer/core";import{cdnAssetUrl as cb,importCdnAsset as ci}from"@seatlayer/core/core/cdnAsset";var uh=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,mh=/[\s"'<>`\\]/;function fh(n){return n.startsWith("//")?!1:n.startsWith("/")||n.startsWith("./")||n.startsWith("../")}function gh(){try{let n=typeof location>"u"?"":location.origin;return n&&n!=="null"?n:null}catch{return null}}function Vt(n){if(typeof n!="string"||!n||n.length>2e6||n!==n.trim())return!1;if(n.startsWith("data:"))return uh.test(n);if(mh.test(n))return!1;let e=gh();if(fh(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 ub}from"@seatlayer/core/core/cdnAsset";function v(n,e){let t=Pr(n);return t===n?e:t}function ft(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?v("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):v("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function di(){return{rotate:v("picker.dragToRotateVenue","Drag to rotate the venue"),move:v("picker.dragToMoveVenue","Drag to move the venue"),zoomIn:v("picker.zoomIn","Zoom in"),zoomOut:v("picker.zoomOut","Zoom out"),fitView:v("picker.fitWholeVenue","Show whole venue")}}function pi(n){return n==="map"||n==="classic"?{touchNavigation:n}:{}}function hi(n){return typeof n=="boolean"?{crowdFigures:n?Number.POSITIVE_INFINITY:0}:{}}var Cr=new WeakMap;function ui(n){let e=n.doc??null,t=e?Cr.get(e):void 0;if(t)return t;let i=new Map(n.getGAAreas().map(s=>[s.id,{categoryKey:s.categoryKey??"",wheelchairPlaces:s.wheelchairPlaces??0}]));return e&&Cr.set(e,i),i}function mi(n,e=()=>!1,t=()=>0){let i={};for(let[s,o]of Object.entries(n)){let r=o.available==null?"":bh({available:o.available,wheelchairFree:o.wheelchairFree});i[s]={available:o.available,selected:o.selected??0,wheelchairFree:o.wheelchairFree??null,filteredOut:e(s),statusText:r&&t(s)>0?`${yh} ${r}`:r}}return i}var yh="\u267F",Ds=new WeakSet;function fi(n,e){if(Ds.has(n))return;Ds.add(n);let t=()=>{Ds.delete(n),e()};typeof requestAnimationFrame=="function"?requestAnimationFrame(t):setTimeout(t,16)}function Lr(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 s=[...i][0]??"";return(e?s.toLocaleUpperCase(e):s.toLocaleUpperCase())+i.slice(s.length)}function Mr(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 F(n){return String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function gi(n,e,t){let i=e.find(o=>Vt(o))??null;if(n.replaceChildren(),!i)return n.textContent=t.slice(0,1).toUpperCase(),null;let s=document.createElement("img");return s.alt="",s.referrerPolicy="no-referrer",s.src=i,n.appendChild(s),i}var $t=null;function bi(){if($t!==null)return $t;try{if(typeof document>"u")return $t=!1;$t=!!document.createElement("canvas").getContext("webgl2")}catch{$t=!1}return $t}var Cn=null;function An(){return Cn||(Cn=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?ci("seatlayer-view3d.mjs"):import("@seatlayer/core/view3d")).catch(e=>{throw Cn=null,e}),Cn)}function yi(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||An().catch(()=>{})}async function vi(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?ci("seatlayer-panorama.mjs"):import("@seatlayer/core")}async function zt(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?ci("seatlayer-checkout.mjs"):import("./hostedCheckout-2JDHIDPG.js")}async function Hr(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?ci("seatlayer-sales.mjs"):import("./pickerSalesClose-Y7RUQ2MY.js")}function Rr(n){return n==="unavailable_for_event"||n==="payments_off_for_event"?n:"not_configured"}function Ir(n){return n.lineItems.reduce((e,t)=>e+t.quantity,0)}function Ns(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??v("picker.generalAdmission","General admission")}function vh(n,e){let t=new Map;for(let i of n){let s=i.rowLabel&&i.seatNumber?[i.sectionLabel,`${v("picker.row","Row")} ${i.rowLabel}`,`${v("picker.seat","Seat")} ${i.seatNumber}`].filter(Boolean).join(" \xB7 "):Ns(i,e),o=[i.categoryLabel,i.tierLabel].filter(Boolean).join(" \xB7 "),r=Math.max(1,Math.floor(i.quantity||1)),a=`${s}\0${o}`,l=t.get(a)??{label:s,detail:o,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 Ar=(n,e,t)=>Pr("picker.bookingForm.guestOfCount",{label:n,index:e,total:t});function wh(n,e,t=[]){let i=new Map,s=[];for(let d of n.lineItems){let h=Ns(d,t),m=Math.max(1,Math.floor(d.quantity)||1);if(d.objectType!=="ga"&&!(d.objectType==="table"&&m>1)){s.push({key:d.label,name:h,unitIndex:1,quantity:1});continue}for(let u=1;u<=m;u+=1){let b=(i.get(d.label)??0)+1;i.set(d.label,b),s.push({key:`${d.label}#${b}`,name:h,unitIndex:u,quantity:m})}}let o=e?.ticketKeyDetails??[],r=e?.ticketKeys??o.map(d=>d.ticketKey),a=(r.length===s.length?r:s.map(d=>d.key)).map(d=>{let h=s.find(u=>u.key===d),m=o.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:Ar(h,m,u)};let b=(c.get(h)??0)+1;c.set(h,b);let g=l.get(h)??1;return{key:d,title:g>1?Ar(h,b,g):h}})}function Or(n,e,t,i,s=[]){let o=new Map;for(let r of n.lineItems){let a=Ns(r,s);o.set(a,(o.get(a)??0)+1)}return{kind:"pay",provider:e,order:{holdId:n.holdId,expiresAt:n.expiresAt,currency:n.currency,total:n.total,labels:[...o].map(([r,a])=>a>1?`${r} \xD7${a}`:r),tickets:wh(n,i,s),lines:vh(n.lineItems,s)},bookingForm:t?.bookingForm??null,...t?.bookingMode==="free"?{free:!0}:{}}}function _r(n){return String(n?.code).startsWith("booking_form_")}function wi(n,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},s=new Date(n);if(e)try{return s.toLocaleString(t,{...i,timeZone:e})}catch{}return s.toLocaleString(t,i)}function Bs(n){return/early[\s-]*bird/i.test(n?.trim()??"")}function Dr(n){return Bs(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 xi(n,e){return`<span class="sl-offer-mark" role="img" aria-label="${e(n)}" title="${e(n)}">${Dr(n)}</span>`}function ki(n,e){return`<span class="sl-offer-badge">${Dr(n)}<span>${e(n)}</span></span>`}function Nr(n,e=Date.now()){let t=n-e;if(t<=0)return null;let i=Math.max(1,Math.ceil(t/6e4)),s=Math.floor(i/1440),o=Math.floor(i%1440/60),r=i%60;return`${(s>0?[`${s}d`,...o?[`${o}h`]:[]]:[...o?[`${o}h`]:[],...r||!o?[`${r}m`]:[]]).join(" ")} left`}function Fs(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function A(n){return String(n??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Vs(n){return n?kh(n).map(e=>({...e,title:v(e.titleKey,e.titleFallback)})):[]}function Vr(n){return Vs(n).map(e=>e.title)}function gt(n,e={}){return $s(Vs(n),e)}function $s(n,e={}){if(!n.length)return"";let t=e.compact?15:17,i=n.map(s=>`<div class="sl-note sl-note-${A(s.tone)}"><span class="sl-note-i">${Fr(s.icon,{size:t})}</span><span class="sl-note-t"><b>${A(s.title)}</b>`+(s.note?`<span class="sl-note-n">${A(s.note)}</span>`:"")+"</span></div>").join("");return`<div class="sl-notes${e.compact?" compact":""}">${i}</div>`}function $r(n){return Vs(n).map(e=>{let t=A(e.note?`${e.title}: ${e.note}`:e.title);return`<span class="sl-cx-mark sl-cx-mark-${A(e.tone)}" role="img" aria-label="${t}" title="${t}">${Fr(e.icon,{size:13})}</span>`}).join("")}function Si(n){let e=[];return n?.restrictedView&&e.push(v("picker.restrictedView","Restricted view")),n?.obstructedView&&e.push(v("picker.obstructedView","Obstructed view")),e}function zs(n,e){if(!n)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("picker.seeItIn3d","See it in 3D"),i=e?v("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 zr(n,e){if(!e)return"";let t=e,i=t.includes(n.id),s=i?t.length>1?v("picker.openComparison","Open comparison"):v("picker.savedForComparison","Saved for comparison"):t.length?v("picker.compareWithSaved","Compare with saved"):v("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>${A(s)}</span></button>`}function jr(n,e,t){if(!t)return"";let i=Sh(n.confidenceEvidence),s=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${A(n.displayLabel??n.label)}"><span><em>${A(e)}</em><strong>${A(i.headline)}</strong><small>${A(s)}</small></span><b>Passport</b></button>`}function J(n){let e=n?.rowLabel,t=n?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let s=`${t}${i}`;if(e.startsWith(s)&&e.length>s.length)return e.slice(s.length)}return xh(e,t)}function Th(n){switch(n){case"paused":return{title:v("picker.accessPausedTitle","These seats are on hold right now"),body:v("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:v("picker.accessRetry","Try again")};case"revoked":return{title:v("picker.accessRevokedTitle","This access link is no longer active"),body:v("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats."),action:v("picker.accessRefresh","Refresh")};case"idle":return{title:v("picker.idlePausedTitle","Your session expired"),body:v("picker.idlePausedBody","You were away for a while. Refresh to see which seats are free now."),action:v("picker.idleRefresh","Show latest seats")};case"no_token":case"provider_failed":return{title:v("picker.accessExpiredTitle","The seat map timed out"),body:v("picker.accessExpiredBody","Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now."),action:v("picker.accessRefresh","Refresh")};default:return{title:v("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:v("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest."),action:v("picker.accessRefresh","Refresh")}}}var Eh=6;function Gr(n,e,t){let i=Fs;return[n?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${n.sectionLabel.length>Eh?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${v("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(J(n)??n?.displayLabel??e)}</span></div>`:"",n?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${v("picker.seat","Seat")}</span><span class="sl-confirm-value">${i(n?.seatNumber??n?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function Kr(n,e,t){let i=Fs,s=n?.objectType==="booth",o=n?.objectType==="table"&&!!n?.bookingMode,r=s||o||!n?.seatNumber,a=n?.sectionLabel??(r?void 0:n?.displayLabel),l=o?`${v("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} ${J(n)??""}`.trim():void 0,`${v("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 Ur(n,e){if(!n)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("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 qr(n,e){if(!n||e)return"";let t=v("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 Br(n){return n.buyerMessage?.trim()||(n.restriction==="companion"?v("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function Ti(n,e,t,i=()=>{}){let s=Fs;if(n.length>1)return`<fieldset class="sl-confirm-tiers"><legend><span>${Ye("picker.ticketType")}</span></legend>`+n.map(a=>{let l=Br(a),c=i(a);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${s(a.id)}"${c?` data-offer-name="${s(c)}"`:""} aria-pressed="${a.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${s(a.name)}`+(c?`<span class="sl-confirm-tier-offer">${ki(c,s)}</span>`:"")+"</span>"+(l?`<small class="sl-confirm-tier-note">${s(l)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${s(t(a))}</span></button>`}).join("")+"</fieldset>";let o=n[0],r=o?Br(o):void 0;return r?`<p class="sl-confirm-tier-note">${s(r)}</p>`:""}function Wr(n){return'<div class="sl-confirm-grid">'+n.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${A(n.categoryLabel)}</span>`+(n.priceLabel?`<span class="sl-confirm-price">${A(n.priceLabel)}</span>`:"")+"</div>"+(n.priceLabel&&n.feeNote?`<div class="sl-confirm-fee">${A(n.feeNote)}</div>`:"")+'<div class="sl-confirm-id">'+n.marker+`<span class="sl-confirm-dot" style="background:${A(n.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${A(n.categoryLabel)}</span><span class="sl-confirm-who">`+n.identity+"</span>"+(n.priceLabel?`<span class="sl-confirm-idprice">${A(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">${A(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">${A(n.selectLabel)}</span></button></div></div>`}function Yr(n,e){let t=F,{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?Ye("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):Ye("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?v("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):Ye("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(Ye("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(v("picker.tableCapacity","Table capacity"))}</span><span>${t(Ye("picker.guestsCount",{count:n.capacity}))}</span>`+(n.entrance?`<span class="muted">${t(v("picker.entrance","Entrance"))}</span><span>${t(n.entrance)}</span>`:"")+(e.suppressPricing?"":`<span class="muted">${t(v("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(i?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(v("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(v("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(v("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t(Ye("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(Ye("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?v("picker.updateTable","Update table"):i?v("picker.selectTable","Select table"):v("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function Zr(n,e){let t=Th(n),i=document.createElement("div");i.className="sl-interrupt sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let s=document.createElement("div");s.className="sl-interrupt-card";let o=document.createElement("div");o.className="sl-interrupt-title",o.textContent=t.title;let r=document.createElement("div");r.className="sl-interrupt-body",r.textContent=t.body,s.append(o,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),s.appendChild(a),i.appendChild(s),i}function Xr(n,e){return`<div class="sl-a11yhead"><span class="sl-a11yhead-t">${A(n)}</span><button type="button" class="sl-a11yclose" data-a11y-close aria-label="${F(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 Qr(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="${A(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">${A(e.label)}</span></span>`+(e.count?`<span class="sl-a11yrow-c">${A(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>';return e.note?`<div class="sl-a11yrow-w">${t}${jt({id:`sl-info-${F(e.key.replace(/[^A-Za-z0-9]+/g,"-"))}`,label:e.note,text:A(e.note)})}</div>`:t}).join("")}function jt(n){return`<span class="sl-info"${n.wrapRef?` data-ref="${F(n.wrapRef)}"`:""}><button type="button" class="sl-info-btn" data-sl-info aria-label="${F(n.label)}" aria-describedby="${F(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="${F(n.id)}"${n.ref?` data-ref="${F(n.ref)}"`:""}>${n.text}</span></span>`}function Jr(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 ea(n){let e=n.performanceLabel?`<div class="sl-chip-when">${F(n.performanceLabel)}</div>`:"",t=n.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${F(n.performanceDates.summary)}</span><span class="sl-chip-date-list">${n.performanceDates.labels.map(i=>`<span class="sl-chip-date">${F(i)}</span>`).join("")}</span></div>`:"";return e+Ah(n)+t}function Ah(n){let{d:e,area:t,label:i,objectType:s,quantity:o=1,identity:r}=n,a=L=>String(L??"\u2014").replace(/[&<>"]/g,U=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[U]),l=s==="ga"?"ga":e?.objectType??s,c=r?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?v("picker.table","Table"):l==="booth"?v("picker.booth","Booth"):l==="ga"?v("picker.generalAdmission","General admission"):v("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([v("picker.guests","Guests"),String(o)])):l==="ga"?(m=String(t?.displayLabel??d),o>1&&u.push([v("picker.tickets","Tickets"),String(o)])):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(J(e)??e.rowLabel)]),e.seatNumber&&u.push([v("picker.seat","Seat"),String(e.seatNumber)]));let b=!m&&!!h,g=m||h||String(d),T=!!h&&!b&&h!==g,S=n.offerName?xi(n.offerName,a):"",k=u.map(([L,U])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(L)}</span> <b>${a(U)}</b></span>`);T&&k.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(h)}</span>${S}</span>`);let E=[g,...u.map(([L,U])=>`${L} ${U}`),T?h:"",n.offerName??""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(E)}</span><span class="sl-chip-name" aria-hidden="true">${a(g)}${T?"":S}</span>`+(k.length?`<span class="sl-chip-pos" aria-hidden="true">${k.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function Ei(n,e,t){return n.map(i=>`<option value="${t(i.id)}"${i.id===e?" selected":""}>${t(i.name)}</option>`).join("")}function Ph(n){let e=F;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 ta(n){let e=F;return`<div class="sl-chip${n.held?" sl-held":""}${n.fresh?" sl-enter":""}"`+Ph(n)+">"+(n.held?n.stateHtml:`<span class="sl-chip-dot" style="background:${A(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 js(n,e){let t=F(n),i=e?F(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${i}" aria-label="${F(Gt("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 Ci(n,e){return new Set(n.filter(t=>(e[t.key]??0)<=0).map(t=>t.key))}function Ai(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 s=Ci(i,n.categoryAvailability());return s.size<i.length||(n.currentHold()?.items??[]).some(r=>s.has(r.categoryKey))?null:Object.assign(new Error("seatlayer: that ticket type is sold out"),{status:409,code:"sold_out",reason:"sold_out"})}function na(n){return n.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${v("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${Gt("picker.willFindSeatsTogether",{count:n.quantity})}</b><span>${v("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>${v("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${v("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="sl-ba-title-t">${v("picker.findSeatsTogether","Find seats together")}</span>`+jt({id:"sl-info-best-seats",label:v("picker.aboutBestSeats","About finding seats together"),text:v("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>${v("picker.bestSeatsPremium","Best seats")}</button>`:"")+`</div><div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${v("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${n.quantity}</span><button type="button" data-ba="1" aria-label="${v("picker.moreSeats","More seats")}">+</button></div>`+(n.categories.length>1?`<select class="sl-ba-cat" aria-label="${F(v("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${F(v("picker.anyTicketType","Any ticket type"))}</option>`+n.categories.map(e=>e.soldOut?`<option value="${F(e.key)}" disabled>${F(`${e.label} \xB7 ${v("picker.soldOutTitle","Sold out")}`)}</option>`:`<option value="${F(e.key)}"${n.selectedCategory===e.key?" selected":""}>${F(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(n.zones.length?`<select class="sl-ba-zone" aria-label="${v("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${v("picker.anyVenueZone","Any venue zone")}</option>`+n.zones.map(e=>`<option value="${F(e.id)}"${n.selectedZone===e.id?" selected":""}>${F(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>${v("picker.findingBestSeats","Finding the best seats\u2026")}`:Ch("picker.findBestSeatsCount",n.quantity))+"</button>"+(n.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${v("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function ia(n){return n==="setup"||n==="testable"?{heading:v("picker.salesNotOpenPill","Sales haven\u2019t opened yet"),sentence:v("picker.salesNotOpenCopy","Tickets for this event aren\u2019t on sale yet.")}:n==="paused"?{heading:v("picker.salesPausedPill","Sales are paused"),sentence:v("picker.salesPausedCopy","Ticket sales are paused for now.")}:{heading:v("picker.salesClosedPill","Sales are closed"),sentence:v("picker.salesClosedCopy","Ticket sales for this event have ended.")}}function sa(n,e=!1){if(!e&&(n==="setup"||n==="testable"||n==="paused")){let t=ia(n);return{pill:t.heading,cta:t.heading,toast:t.sentence}}return{pill:v("picker.salesClosedPill","Sales are closed"),cta:v("picker.salesClosedCta","Sales closed"),toast:v("picker.salesClosedToast","Sales are closed for this event.")}}function oa(n){if(n.salesClosed&&!n.hasPicks){let e=n.whenText?`<span class="when">${F(n.whenText)}</span>`:"",t=n.note??ia(n.salesState);return`<div class="sl-closed-note" role="status"><b>${t.heading}</b><span>${t.sentence}${e}</span></div>`}return""}function ra(n){return n.hasGaAreas?n.seated?n.venue3d?Gt("picker.trayHintChoose3dOrStanding"):v("picker.trayHintTapOrStanding","Tap a seat on the map or grab standing tickets below."):n.venue3d?Gt("picker.gaTrayHintChoose3dArea"):v("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets."):n.groupMode==="per_performance"?v("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):n.groupMode?n.season?Gt("picker.season.trayHint"):v("picker.groupTrayHint","Choose seats once. The same seats will be held for every performance."):n.venue3d?Gt("picker.trayHintChoose3dOrBest"):v("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}import{getLocale as Ih,loadLocale as Oh,LOCALE_NAMES as _h,localeDirection as la,resolveLocale as ca,setStringOverrides as Dh,TRANSLATED_LOCALES as Nh}from"@seatlayer/core";import{getLocale as Lh,localeDirection as Mh,t as Hh}from"@seatlayer/core";function Rh(){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 aa(n,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,i.lang=Lh(),i.dir=Mh(),n.appendChild(i),Object.entries(Ie(void 0,t)).forEach(([o,r])=>i.style.setProperty(o,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 ir,b as sr}from"./chunk-JDMJI3WC.js";import{a as er}from"./chunk-ICM
50
50
  </div>
51
51
  <div class="sl-boot" data-ref="boot">
52
52
  <div class="sl-boot-bar" aria-hidden="true"></div>
53
- ${Th()}
53
+ ${Rh()}
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 ir,b as sr}from"./chunk-JDMJI3WC.js";import{a as er}from"./chunk-ICM
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>${zt({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>${jt({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>${zt({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>${jt({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 ir,b as sr}from"./chunk-JDMJI3WC.js";import{a as er}from"./chunk-ICM
76
76
  <button type="button" class="sl-cta" data-ref="cta" disabled></button>
77
77
  </div>
78
78
  </div>
79
- </div>`;let s={};return i.querySelectorAll("[data-ref]").forEach(o=>{s[o.dataset.ref]=o}),{root:i,mapHost:s.map,els:s}}function Ei(n){let e=(t,i)=>{for(let s of n.querySelectorAll(`[${t}]`)){let o=s.getAttribute(t);if(!o)continue;let r=Sh(o);r!==o&&i(s,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 Ci(n,e){let t=sa(n),i=Lh.includes(t)?t:"en";return e&&Ph(e),{locale:i,direction:ia(i),ready:Ch(n)}}function Ai(n,e,t){n.lang=e.locale,n.dir=e.direction,e.ready.then(t)}function oa(n,e){if(!n)return null;let t=(e.languages??[]).map(s=>sa(s)).filter((s,o,r)=>r.indexOf(s)===o);if(t.length<2)return null;let i=document.createElement("select");i.className="sl-langsel",i.setAttribute("aria-label",e.label);for(let s of t){let o=document.createElement("option");o.value=s,o.textContent=Ah[s]??s,o.selected=s===Eh(),i.appendChild(o)}return i.addEventListener("change",()=>e.onChange(i.value)),n.appendChild(i),i}function ra(n,e){e.root.lang=n,e.root.dir=ia(n),Ei(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 Gt(n,e,t,i=45e3){return new Promise(s=>{if(e.aborted){s({outcome:"cancelled"});return}let o=!1,r=d=>{o||(o=!0,clearTimeout(l),clearTimeout(c),e.removeEventListener("abort",a),s(d))},a=()=>r({outcome:"cancelled"}),l=setTimeout(()=>{o||t()},8e3),c=setTimeout(()=>r({outcome:"timeout"}),i);e.addEventListener("abort",a,{once:!0}),Promise.resolve().then(()=>o?void 0:n()).then(d=>{o||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}},Mh=new Set(["buyer_access_expired"]),Hh=new Set(["paused","provider_failed","channel_denied","sales_not_open"]);function Rh(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 Ih(n){return/^Bearer\s+(\S+)$/i.exec(n?.trim()??"")?.[1]??null}function Li(n){return n instanceof ee?n.reason!=="paused"&&n.reason!=="channel_denied":!n||typeof n!="object"?!1:n.status===401}function Oh(n,e){return n===401&&!!e&&Mh.has(e)}var _h=3e4,ce,de,bt,Kt,An,Qe,Xe,_e,Ut,Pn,Ln,Mn,yt,se,$s,Pi,Ze,pe=class{constructor(e){C(this,se);C(this,ce,null);C(this,de,0);C(this,bt,null);C(this,Kt);C(this,An);C(this,Qe,null);C(this,Xe,null);C(this,_e,null);C(this,Ut,null);C(this,Pn);C(this,Ln);C(this,Mn,!1);C(this,yt);if(x(this,Kt,e.provider),x(this,An,e.skewMs??_h),x(this,Pn,e.onExpired),x(this,Ln,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;w(this,se,$s).call(this,t)}x(this,Mn,!!p(this,Kt)||!!p(this,ce))}get configured(){return p(this,Mn)}onRenewed(e){x(this,yt,e)}get unavailable(){return p(this,_e)}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,_e))throw new ee(p(this,_e));let t=Date.now();if(!p(this,ce)||p(this,de)>0&&p(this,de)-p(this,An)<=t){let s=!!p(this,ce)&&p(this,de)>0&&p(this,de)<=t,o=p(this,ce)?s?"expired":"expiring":e,r=await w(this,se,Pi).call(this,o);if(!r)throw new ee(p(this,_e)??p(this,Ut)??w(this,se,Ze).call(this,"provider_failed"));return`Bearer ${r}`}return`Bearer ${p(this,ce)}`}async handleFailure(e,t,i){var o;if(!this.configured)return!1;if(Oh(e,t)){let r=Ih(i)??p(this,bt);x(this,ce,null),x(this,de,0);let a=await w(this,se,Pi).call(this,"unauthorized",t),l=!!a&&a!==r;return(o=p(this,Pn))==null||o.call(this,{reason:"unauthorized",code:t,refreshed:l}),a&&!l&&w(this,se,Ze).call(this,"revoked",t,e),l}let s=Rh(e,t);return s&&w(this,se,Ze).call(this,s,t,e),!1}async refresh(e="manual"){return x(this,_e,null),x(this,Ut,null),x(this,ce,null),x(this,de,0),!!await w(this,se,Pi).call(this,e)}clear(){p(this,Xe)?.abort(),x(this,Xe,null),x(this,ce,null),x(this,bt,null),x(this,de,0),x(this,Qe,null),x(this,yt,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};ce=new WeakMap,de=new WeakMap,bt=new WeakMap,Kt=new WeakMap,An=new WeakMap,Qe=new WeakMap,Xe=new WeakMap,_e=new WeakMap,Ut=new WeakMap,Pn=new WeakMap,Ln=new WeakMap,Mn=new WeakMap,yt=new WeakMap,se=new WeakSet,$s=function(e){return!e||typeof e.token!="string"||!e.token?null:(x(this,bt,e.token),x(this,ce,e.token),x(this,de,typeof e.expiresAt=="number"?e.expiresAt:0),p(this,ce))},Pi=function(e,t){if(p(this,Qe))return p(this,Qe);let i=p(this,Kt);if(!i)return w(this,se,Ze).call(this,"no_token",t),Promise.resolve(null);let s=p(this,bt),o=new AbortController;x(this,Xe,o);let r=(async()=>{try{let a=await Gt(()=>Promise.resolve(i({reason:e})),o.signal,()=>{},4e4);if(o.signal.aborted||a.outcome==="cancelled")return null;if(a.outcome!=="loaded")return w(this,se,Ze).call(this,"provider_failed",t),null;let l=a.value,c=w(this,se,$s).call(this,l);if(!c)return w(this,se,Ze).call(this,"provider_failed",t),null;if(s&&s!==c&&p(this,yt))try{await p(this,yt).call(this,{previousToken:s,token:c,reason:e})}catch{}return o.signal.aborted?null:c}catch{return w(this,se,Ze).call(this,"provider_failed",t),null}finally{p(this,Xe)===o&&(x(this,Qe,null),x(this,Xe,null))}})();return x(this,Qe,r),r},Ze=function(e,t,i){var o;let s={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"||e==="sales_not_open"};return x(this,Ut,s),Hh.has(e)||(x(this,_e,s),x(this,ce,null),x(this,de,0)),(o=p(this,Ln))==null||o.call(this,s),s};function Hn(n,e={}){return!n.buyerAccessTokenProvider&&!n.buyerAccessToken?null:new pe({provider:n.buyerAccessTokenProvider,token:n.buyerAccessToken,...e})}function aa(n){let e=n?.event;if(e?.guestsOnly!==!0)return null;let t=e.guestsOnlyForMs;return{forMs:typeof t=="number"&&Number.isFinite(t)&&t>=0?t:null}}var Dh=2147483647,Nh=1e3;function la(n,e,t=typeof document>"u"?null:document){let i=e+Nh,s=Date.now()+i,o=i<=Dh?setTimeout(l,i):null;function r(){o&&clearTimeout(o),t?.removeEventListener("visibilitychange",a)}function a(){t?.visibilityState==="visible"&&Date.now()>=s&&l()}function l(){r(),!(n.destroyed||!n.guestsOnly)&&(n.guestsOnly=!1,n.salesClosed=!!n.opts.readOnly||n.salesState==="paused"||n.salesState==="ended",n.applySalesClosed())}return t?.addEventListener("visibilitychange",a),r}function ca(n){let e=n?.code;return e==="guests_only"||e==="guest_choice_closed"?e:null}function Mi(){return{pill:v("picker.guestsOnlyPill","Invited guests only"),cta:v("picker.guestsOnlyPill","Invited guests only"),toast:v("picker.guestsOnlyToast","This event is for invited guests.")}}function da(){return{heading:v("picker.guestsOnlyPill","Invited guests only"),sentence:v("picker.guestsOnlyCopy","Each guest chooses their seats from their own link.")}}function pa(){return v("picker.guestChoiceClosed","Seat choice isn\u2019t open right now.")}function ha(n){n.guestsOnly=!0;let e=new Set((n.hold?.items??[]).map(i=>i.label)),t=n.controller.getSelection().filter(i=>!e.has(i.label)).map(i=>i.id);t.length&&n.controller.deselect(t),n.gaQty&&Bh(n.gaQty,n.hold?.items??[])}function Bh(n,e){let t=new Map;for(let i of e){if(i.objectType!=="ga"||!i.objectId)continue;let s=t.get(i.objectId)??new Map,o=i.tierId??null;s.set(o,(s.get(o)??0)+(i.quantity??1)),t.set(i.objectId,s)}for(let[i,s]of[...n]){for(let[o,r]of[...s]){let a=Math.min(r,t.get(i)?.get(o)??0);a>0?s.set(o,a):s.delete(o)}s.size||n.delete(i)}}function Hi(n){let e={state:"none"};return{transport:new Proxy(n,{get(i,s){let o=Reflect.get(i,s,i);return typeof o!="function"?o:s!=="chart"?o.bind(i):(...r)=>{let a;try{a=o.apply(i,r)}catch(l){throw e={state:"rejected",error:l},l}return Promise.resolve(a).then(l=>{let c=aa(l);return e=c?{state:"resolved",guestsOnly:c}:{state:"resolved"},l},l=>{throw e={state:"rejected",error:l},l})}}}),outcome:()=>e}}function Ri(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 ua=new Set;function Ii(n){return ua.has(n.reason)||(ua.add(n.reason),typeof fetch>"u"||kn())?!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 js(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function Fh(n){return js(n.availability)?n.availability:null}function Vh(n){let e=n.subscribeTicket;if(!js(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(s=>typeof s!="string"))||t===void 0&&i===void 0?null:{...t===void 0?{}:{ticket:t},...i===void 0?{}:{protocols:i}}}var ma=3e4,$h=2e4;function zh(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 jh(n){return n>=400&&n<500&&n!==408&&n!==429}var Oi=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-ma>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-ma>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let i=new AbortController,s=setTimeout(()=>i.abort(),4e4);try{let o=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap?${mt}`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit",signal:i.signal}),r=await o.json().catch(()=>null);if(!o.ok){let a=o.status===429?Tn(o.headers.get("Retry-After"),r?.retryAfterSeconds):void 0,l=new j(o.status,r?.error??`request_failed_${o.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 jh(o.status)&&(this.refusal=l),l}if(!zh(r))throw new j(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=r,this.fetchedAt=Date.now(),r}finally{clearTimeout(s)}})();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}}};function Gh(n,e){let t=n?.guestsOnlyForMs;return typeof t!="number"||!e?n:{...n,guestsOnlyForMs:Math.max(0,t-Math.max(0,Date.now()-e))}}var zs=class extends We{constructor(t,i,s,o,r){super(t,{...r,access:o});this.event=i;this.loader=s;this.bootstrapAccess=o;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(s){throw this.loader.refused()??s}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:Gh(i.event,this.loader.fetchedAt),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 s=await this.bundle(t);return this.initialAvailabilityDelivered=!0,Fh(s)??super.availability(t,i)}async pickerIdleMinutes(){let t=await this.bundle(this.event),i=js(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<$h?Vh(i)??super.subscribeTicket(t):super.subscribeTicket(t)}},qt=new Map;function fa(n,e,t){return`${n}
79
+ </div>`;let s={};return i.querySelectorAll("[data-ref]").forEach(o=>{s[o.dataset.ref]=o}),{root:i,mapHost:s.map,els:s}}function Pi(n){let e=(t,i)=>{for(let s of n.querySelectorAll(`[${t}]`)){let o=s.getAttribute(t);if(!o)continue;let r=Hh(o);r!==o&&i(s,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 Li(n,e){let t=ca(n),i=Nh.includes(t)?t:"en";return e&&Dh(e),{locale:i,direction:la(i),ready:Oh(n)}}function Mi(n,e,t){n.lang=e.locale,n.dir=e.direction,e.ready.then(t)}function da(n,e){if(!n)return null;let t=(e.languages??[]).map(s=>ca(s)).filter((s,o,r)=>r.indexOf(s)===o);if(t.length<2)return null;let i=document.createElement("select");i.className="sl-langsel",i.setAttribute("aria-label",e.label);for(let s of t){let o=document.createElement("option");o.value=s,o.textContent=_h[s]??s,o.selected=s===Ih(),i.appendChild(o)}return i.addEventListener("change",()=>e.onChange(i.value)),n.appendChild(i),i}function pa(n,e){e.root.lang=n,e.root.dir=la(n),Pi(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 Kt(n,e,t,i=45e3){return new Promise(s=>{if(e.aborted){s({outcome:"cancelled"});return}let o=!1,r=d=>{o||(o=!0,clearTimeout(l),clearTimeout(c),e.removeEventListener("abort",a),s(d))},a=()=>r({outcome:"cancelled"}),l=setTimeout(()=>{o||t()},8e3),c=setTimeout(()=>r({outcome:"timeout"}),i);e.addEventListener("abort",a,{once:!0}),Promise.resolve().then(()=>o?void 0:n()).then(d=>{o||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}},Bh=new Set(["buyer_access_expired"]),Fh=new Set(["paused","provider_failed","channel_denied","sales_not_open"]);function Vh(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 $h(n){return/^Bearer\s+(\S+)$/i.exec(n?.trim()??"")?.[1]??null}function Ri(n){return n instanceof ee?n.reason!=="paused"&&n.reason!=="channel_denied":!n||typeof n!="object"?!1:n.status===401}function zh(n,e){return n===401&&!!e&&Bh.has(e)}var jh=3e4,ce,de,bt,Ut,Pn,Xe,Qe,De,qt,Ln,Mn,Hn,yt,se,Gs,Hi,Ze,pe=class{constructor(e){C(this,se);C(this,ce,null);C(this,de,0);C(this,bt,null);C(this,Ut);C(this,Pn);C(this,Xe,null);C(this,Qe,null);C(this,De,null);C(this,qt,null);C(this,Ln);C(this,Mn);C(this,Hn,!1);C(this,yt);if(x(this,Ut,e.provider),x(this,Pn,e.skewMs??jh),x(this,Ln,e.onExpired),x(this,Mn,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;w(this,se,Gs).call(this,t)}x(this,Hn,!!p(this,Ut)||!!p(this,ce))}get configured(){return p(this,Hn)}onRenewed(e){x(this,yt,e)}get unavailable(){return p(this,De)}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,De))throw new ee(p(this,De));let t=Date.now();if(!p(this,ce)||p(this,de)>0&&p(this,de)-p(this,Pn)<=t){let s=!!p(this,ce)&&p(this,de)>0&&p(this,de)<=t,o=p(this,ce)?s?"expired":"expiring":e,r=await w(this,se,Hi).call(this,o);if(!r)throw new ee(p(this,De)??p(this,qt)??w(this,se,Ze).call(this,"provider_failed"));return`Bearer ${r}`}return`Bearer ${p(this,ce)}`}async handleFailure(e,t,i){var o;if(!this.configured)return!1;if(zh(e,t)){let r=$h(i)??p(this,bt);x(this,ce,null),x(this,de,0);let a=await w(this,se,Hi).call(this,"unauthorized",t),l=!!a&&a!==r;return(o=p(this,Ln))==null||o.call(this,{reason:"unauthorized",code:t,refreshed:l}),a&&!l&&w(this,se,Ze).call(this,"revoked",t,e),l}let s=Vh(e,t);return s&&w(this,se,Ze).call(this,s,t,e),!1}async refresh(e="manual"){return x(this,De,null),x(this,qt,null),x(this,ce,null),x(this,de,0),!!await w(this,se,Hi).call(this,e)}clear(){p(this,Qe)?.abort(),x(this,Qe,null),x(this,ce,null),x(this,bt,null),x(this,de,0),x(this,Xe,null),x(this,yt,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};ce=new WeakMap,de=new WeakMap,bt=new WeakMap,Ut=new WeakMap,Pn=new WeakMap,Xe=new WeakMap,Qe=new WeakMap,De=new WeakMap,qt=new WeakMap,Ln=new WeakMap,Mn=new WeakMap,Hn=new WeakMap,yt=new WeakMap,se=new WeakSet,Gs=function(e){return!e||typeof e.token!="string"||!e.token?null:(x(this,bt,e.token),x(this,ce,e.token),x(this,de,typeof e.expiresAt=="number"?e.expiresAt:0),p(this,ce))},Hi=function(e,t){if(p(this,Xe))return p(this,Xe);let i=p(this,Ut);if(!i)return w(this,se,Ze).call(this,"no_token",t),Promise.resolve(null);let s=p(this,bt),o=new AbortController;x(this,Qe,o);let r=(async()=>{try{let a=await Kt(()=>Promise.resolve(i({reason:e})),o.signal,()=>{},4e4);if(o.signal.aborted||a.outcome==="cancelled")return null;if(a.outcome!=="loaded")return w(this,se,Ze).call(this,"provider_failed",t),null;let l=a.value,c=w(this,se,Gs).call(this,l);if(!c)return w(this,se,Ze).call(this,"provider_failed",t),null;if(s&&s!==c&&p(this,yt))try{await p(this,yt).call(this,{previousToken:s,token:c,reason:e})}catch{}return o.signal.aborted?null:c}catch{return w(this,se,Ze).call(this,"provider_failed",t),null}finally{p(this,Qe)===o&&(x(this,Xe,null),x(this,Qe,null))}})();return x(this,Xe,r),r},Ze=function(e,t,i){var o;let s={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"||e==="sales_not_open"};return x(this,qt,s),Fh.has(e)||(x(this,De,s),x(this,ce,null),x(this,de,0)),(o=p(this,Mn))==null||o.call(this,s),s};function Rn(n,e={}){return!n.buyerAccessTokenProvider&&!n.buyerAccessToken?null:new pe({provider:n.buyerAccessTokenProvider,token:n.buyerAccessToken,...e})}function ha(n){let e=n?.event;if(e?.guestsOnly!==!0)return null;let t=e.guestsOnlyForMs;return{forMs:typeof t=="number"&&Number.isFinite(t)&&t>=0?t:null}}var Gh=2147483647,Kh=1e3;function ua(n,e,t=typeof document>"u"?null:document){let i=e+Kh,s=Date.now()+i,o=i<=Gh?setTimeout(l,i):null;function r(){o&&clearTimeout(o),t?.removeEventListener("visibilitychange",a)}function a(){t?.visibilityState==="visible"&&Date.now()>=s&&l()}function l(){r(),!(n.destroyed||!n.guestsOnly)&&(n.guestsOnly=!1,n.salesClosed=!!n.opts.readOnly||n.salesState==="paused"||n.salesState==="ended",n.applySalesClosed())}return t?.addEventListener("visibilitychange",a),r}function ma(n){let e=n?.code;return e==="guests_only"||e==="guest_choice_closed"?e:null}function Ii(){return{pill:v("picker.guestsOnlyPill","Invited guests only"),cta:v("picker.guestsOnlyPill","Invited guests only"),toast:v("picker.guestsOnlyToast","This event is for invited guests.")}}function fa(){return{heading:v("picker.guestsOnlyPill","Invited guests only"),sentence:v("picker.guestsOnlyCopy","Each guest chooses their seats from their own link.")}}function ga(){return v("picker.guestChoiceClosed","Seat choice isn\u2019t open right now.")}function ba(n){n.guestsOnly=!0;let e=new Set((n.hold?.items??[]).map(i=>i.label)),t=n.controller.getSelection().filter(i=>!e.has(i.label)).map(i=>i.id);t.length&&n.controller.deselect(t),n.gaQty&&Uh(n.gaQty,n.hold?.items??[])}function Uh(n,e){let t=new Map;for(let i of e){if(i.objectType!=="ga"||!i.objectId)continue;let s=t.get(i.objectId)??new Map,o=i.tierId??null;s.set(o,(s.get(o)??0)+(i.quantity??1)),t.set(i.objectId,s)}for(let[i,s]of[...n]){for(let[o,r]of[...s]){let a=Math.min(r,t.get(i)?.get(o)??0);a>0?s.set(o,a):s.delete(o)}s.size||n.delete(i)}}function Oi(n){let e={state:"none"};return{transport:new Proxy(n,{get(i,s){let o=Reflect.get(i,s,i);return typeof o!="function"?o:s!=="chart"?o.bind(i):(...r)=>{let a;try{a=o.apply(i,r)}catch(l){throw e={state:"rejected",error:l},l}return Promise.resolve(a).then(l=>{let c=ha(l);return e=c?{state:"resolved",guestsOnly:c}:{state:"resolved"},l},l=>{throw e={state:"rejected",error:l},l})}}}),outcome:()=>e}}function _i(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 ya=new Set;function Di(n){return ya.has(n.reason)||(ya.add(n.reason),typeof fetch>"u"||Sn())?!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 Us(n){return!!n&&typeof n=="object"&&!Array.isArray(n)}function qh(n){return Us(n.availability)?n.availability:null}function Wh(n){let e=n.subscribeTicket;if(!Us(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(s=>typeof s!="string"))||t===void 0&&i===void 0?null:{...t===void 0?{}:{ticket:t},...i===void 0?{}:{protocols:i}}}var va=3e4,Yh=2e4;function Zh(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 Xh(n){return n>=400&&n<500&&n!==408&&n!==429}var Qh=4e4,Jh=[2e3,4e3,8e3],eu=.5,tu=10,nu=3e4;function iu(n,e,t,i=Math.random){if(n instanceof TypeError||!Ft(n))return null;let s=Jh[e];if(s===void 0)return null;let o=n.retryAfterS??0;if(o>tu)return null;let r=Math.round(Math.max(s,o*1e3)*(1+eu*i()));return t+r>nu?null:r}var Ni=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-va>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-va>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let i=Date.now();for(let s=0;;s+=1)try{return await this.fetchOnce(i+Qh)}catch(o){let r=iu(o,s,Date.now()-i);if(r===null)throw o;await new Promise(a=>setTimeout(a,r))}})();this.inflight=t;try{return await t}finally{this.inflight===t&&(this.inflight=null)}}async fetchOnce(e){let t=new AbortController,i=setTimeout(()=>t.abort(),Math.max(0,e-Date.now()));try{let s=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap?${mt}`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit",signal:t.signal}),o=await s.json().catch(()=>null);if(!s.ok){let r=s.status===429||s.status===503?En(s.headers.get("Retry-After"),o?.retryAfterSeconds):void 0,a=new j(s.status,o?.error??`request_failed_${s.status}`,o?.code??o?.error,void 0,void 0,r,void 0,{...typeof o?.retryable=="boolean"?{retryable:o.retryable}:{},...typeof o?.hint=="string"&&o.hint?{hint:o.hint}:{},...typeof o?.message=="string"&&o.message?{serverMessage:o.message}:{}});throw Xh(s.status)&&(this.refusal=a),a}if(!Zh(o))throw new j(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=o,this.fetchedAt=Date.now(),o}finally{clearTimeout(i)}}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}}};function su(n,e){let t=n?.guestsOnlyForMs;return typeof t!="number"||!e?n:{...n,guestsOnlyForMs:Math.max(0,t-Math.max(0,Date.now()-e))}}var Ks=class extends We{constructor(t,i,s,o,r){super(t,{...r,access:o});this.event=i;this.loader=s;this.bootstrapAccess=o;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(s){throw this.loader.refused()??s}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:su(i.event,this.loader.fetchedAt),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 s=await this.bundle(t);return this.initialAvailabilityDelivered=!0,qh(s)??super.availability(t,i)}async pickerIdleMinutes(){let t=await this.bundle(this.event),i=Us(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<Yh?Wh(i)??super.subscribeTicket(t):super.subscribeTicket(t)}},Wt=new Map;function wa(n,e,t){return`${n}
80
80
  ${e}
81
- ${t}`}function ga(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let s=fa(e,t,i);if(qt.get(s)?.usable())return;let r=new Oi(e,t,i);qt.set(s,r),r.load().catch(()=>{qt.get(s)===r&&qt.delete(s)})}function Kh(n,e,t){let i=fa(n,e,t),s=qt.get(i);return s?(qt.delete(i),s.usable()?s:null):null}function _i(n){let e=Kh(n.base,n.event,n.publicKey)??new Oi(n.base,n.event,n.publicKey),t=new pe({provider:({reason:i})=>e.token(i),...n.accessHooks});return{access:t,api:new zs(n.base,n.event,e,t,n.apiOptions??{})}}import{t as re,tCount as De}from"@seatlayer/core";var ne={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 Uh=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${ne.enter}ms;--sl-dur-exit:${ne.exit}ms;--sl-dur-spring:${ne.spring}ms;--sl-dur-flight:${ne.flight}ms;--sl-dur-stagger:${ne.stagger}ms;--sl-dur-xfade:${ne.crossfade}ms;--sl-dur-collapse:${ne.collapse}ms;--sl-dur-rung:${ne.rung}ms;--sl-ease-enter:${ne.easeEnter};--sl-ease-exit:${ne.easeExit};--sl-ease-spring:${ne.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,qh=`@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:${ne.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:${ne.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}}`,ba=Uh+`
81
+ ${t}`}function xa(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let s=wa(e,t,i);if(Wt.get(s)?.usable())return;let r=new Ni(e,t,i);Wt.set(s,r),r.load().catch(()=>{Wt.get(s)===r&&Wt.delete(s)})}function ou(n,e,t){let i=wa(n,e,t),s=Wt.get(i);return s?(Wt.delete(i),s.usable()?s:null):null}function Bi(n){let e=ou(n.base,n.event,n.publicKey)??new Ni(n.base,n.event,n.publicKey),t=new pe({provider:({reason:i})=>e.token(i),...n.accessHooks});return{access:t,api:new Ks(n.base,n.event,e,t,n.apiOptions??{})}}import{t as re,tCount as Ne}from"@seatlayer/core";var ne={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 ru=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${ne.enter}ms;--sl-dur-exit:${ne.exit}ms;--sl-dur-spring:${ne.spring}ms;--sl-dur-flight:${ne.flight}ms;--sl-dur-stagger:${ne.stagger}ms;--sl-dur-xfade:${ne.crossfade}ms;--sl-dur-collapse:${ne.collapse}ms;--sl-dur-rung:${ne.rung}ms;--sl-ease-enter:${ne.easeEnter};--sl-ease-exit:${ne.easeExit};--sl-ease-spring:${ne.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,au=`@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:${ne.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:${ne.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}}`,ka=ru+`
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 ga(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)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
- `+qh;function Di(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function Gs(n,e){if(!e){n.style.removeProperty("--sl-mo-ox"),n.style.removeProperty("--sl-mo-oy");return}Ni(n,e,n.getBoundingClientRect())}function Ni(n,e,t){let i=t.width||1,s=t.height||1,o=r=>Math.max(0,Math.min(100,r));n.style.setProperty("--sl-mo-ox",`${o((e.x-t.left)/i*100).toFixed(1)}%`),n.style.setProperty("--sl-mo-oy",`${o((e.y-t.top)/s*100).toFixed(1)}%`)}function ya(n,e,t){let i=n.getBoundingClientRect(),s=t.getBoundingClientRect();Ni(n,e,{left:i.left-s.left,top:i.top-s.top,width:i.width,height:i.height})}function va(n,e){n.classList.remove("sl-mo-out"),e!==void 0&&Gs(n,e),n.classList.remove("sl-mo-in"),n.offsetWidth,n.classList.add("sl-mo-in")}function wa(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 Bi(n,e,t={className:"sl-mo-out",duration:ne.exit}){let i=()=>{s||(s=!0,!(typeof window>"u")&&(clearTimeout(o),n.removeEventListener("animationend",i),e?e():n.remove()))},s=!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 o=setTimeout(i,Di()?0:t.duration+60)}var Hb={className:"sl-mo-slide-down",duration:ne.exit};function xa(n){if(Di())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(s),e.remove(),n.onArrive?.())};e.addEventListener("animationend",i);let s=window.setTimeout(i,ne.flight+80);return e}var z=n=>String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function Rn(n){let e=re("picker.maxTicketsForOrder",{count:n});return n===1?v("picker.maxOneTicketForOrder",e):e}function Zt(n,e){let t=0;for(let i of n.get(e)?.values()??[])t+=i;return t}function ka(n){let e=new Map;for(let t of n.keys())e.set(t,Zt(n,t));return e}function vt(n,e,t,i){let s=n.get(e)??new Map;i>0?s.set(t,i):s.delete(t),s.size?n.set(e,s):n.delete(e)}function qs(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 Sa(n,e){let t=qs(e),i=[];for(let[s,o]of n){let r=t.get(s)??0;for(let[a,l]of o){let c=Math.max(0,l-r);r=Math.max(0,r-l),c>0&&i.push({areaId:s,tierId:a,qty:c})}}return i}function Ta(n,e){let t=new Map;for(let i of e)i.objectType!=="ga"||!i.objectId||n.has(i.objectId)||vt(t,i.objectId,i.tierId??null,(t.get(i.objectId)?.get(i.tierId??null)??0)+(i.quantity??1));for(let[i,s]of t)n.set(i,s)}function Ne(n,e){let t=qs(e),i=0;for(let s of n.keys())i+=Math.max(0,Zt(n,s)-(t.get(s)??0));return i}function Ea(n,e,t){let i=qs(t),s=0;for(let o of e){let r=n.gaQty.get(o.id);if(!r)continue;let a=i.get(o.id)??0;for(let[l,c]of r){let d=Math.max(0,c-a);a=Math.max(0,a-c),s+=d*n.paidPrice(o.categoryKey,l,Wh(o,l),o.id)}}return s}function Wh(n,e){return e?n.tiers?.find(t=>t.id===e)?.price??n.price:n.price}function Ca(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 s=`${i.objectId}\0${i.tierId??""}`,o=t.get(s);if(o){o.quantity=(o.quantity??0)+(i.quantity??1),o.labels.push(i.label);continue}let r={...i,quantity:i.quantity??1,labels:[i.label]};t.set(s,r),e.push(r)}return e}function Aa(n,e,t){let i=new Set(t);for(let s of e)s.objectType==="ga"&&s.objectId&&i.has(s.label)&&vt(n,s.objectId,s.tierId??null,0)}function Vi(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 Yh(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 Ws(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??re("picker.generalAdmission"),price:n.price}]}function Pa(n,e){let t=n.totalTicketCount()-Zt(n.gaQty,e.id);return Math.max(0,Math.min(wt(n,e),n.maxTickets-t))}function wt(n,e){return Ys(n)?Yt(e)?e.wheelchairPlaces?e.available:0:Math.min(e.available,e.wheelchairAvailable??0):e.available}function Yt(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 La(n,e){return Ys(n)&&e.available>0?n.tf("picker.noWheelchairSpace","No wheelchair space"):n.tf("picker.soldOutTitle","Sold out")}function Ys(n){return n.controller?.getAccessibilityFilter?.()?.includes("wheelchair")===!0}function Zh(n){return`${re("picker.access.wheelchair")} \xB7 ${De("picker.leftCount",n.wheelchairAvailable??0)}`}function Qh(n){let e=[];return n.wheelchairPlaces&&e.push({icon:"wheelchair",title:re("picker.access.wheelchair"),tone:"access",note:De("picker.leftCount",n.wheelchairAvailable??0)}),n.entrance&&e.push({icon:"entrance",title:re("picker.entrance"),note:n.entrance,tone:"place"}),Bs(e,{compact:!0})}function Ma(n,e){let t=Yt(n),i=Ws(n),s=wt({controller:{getAccessibilityFilter:()=>e.wheelchairOnly?["wheelchair"]:null}},n),o=t?t.max:Math.max(0,Math.min(s,e.room));return{area:n,...t?{bookingMode:t.mode}:{},selected:{},min:t?t.min:0,max:o,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 Zs(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 s=Yt(e),o=Ws(e),r=n.gaQty.get(e.id),a=Zt(n.gaQty,e.id)>0,l=Pa(n,e);if((s?l<s.min:l<=0)&&!a){n.toast(wt(n,e)<=0||s&&wt(n,e)<s.min?La(n,e):Rn(n.maxTickets),"warning");return}let c=s?[...r??[]].find(([,y])=>y>0)?.[0]??o[0].id:null;if(n.onGAPromptHook){let y={};for(let[T,S]of r??[])y[T??""]=S;if(n.onGAPromptHook({area:e,...s?{bookingMode:s.mode}:{},selected:y,min:s?s.min:0,max:s?Math.min(s.max,l):l,tiers:o,confirm:T=>{tu(n,e,o,T,l,s)},cancel:()=>Ce(n)})===!0)return}let d=new Map;for(let y of o)d.set(y.id,r?.get(y.id)??0);!a&&l>0&&d.set(s?c:o[0].id,s?s.min:1);let h={area:e,tiers:o,draft:d,max:l,reopened:a,box:s,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=Xh(n,h,m),n.root?.appendChild(u),n.gaPromptEl=u,n.gaPromptReturnFocus=i??document.activeElement,m||nu(n,u,t,i),n.reducedMotion()&&(u.dataset.motion="reduced"),Ks(n,h),Jh(n,u,h),requestAnimationFrame(()=>u.querySelector('[data-ga-step="1"]')?.focus())}function Xh(n,e,t){let{area:i,tiers:s,box:o}=e,r=s.length>1,a=i.displayLabel??i.label,l=o&&r?xi(s.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=o?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>`+(o.mode==="variable"?`<small data-ga-range>${z(re("picker.chooseMinMaxGuests",{min:o.min,max:o.max}))}</small>`:"")+"</div>"+(o.mode==="whole"?`<output data-ga-qty>${o.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>"):s.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(re("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(re("common.close"))}">\xD7</button></div>`+Qh(i)+`<div class="sl-ga-prompt-body">${c}`+(s.length>1||o?`<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(re("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function Fi(n){let e=0;for(let t of n.draft.values())e+=t;return e}function Ha(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 Ks(n,e){let t=n.gaPromptEl;if(!t)return;let i=Fi(e),s=Ha(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 o=t.querySelector("[data-ga-sub]");if(o){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));o.textContent=e.box?re("picker.perGuestPrice",{price:d}):`${d} \xB7 ${De("picker.leftCount",e.area.available)}`}let r=t.querySelector("[data-ga-total]");r&&(r.textContent=n.money(s));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=e.box?"":i>=e.max&&e.max>0?Ys(n)&&e.area.wheelchairPlaces?Zh(e.area):e.area.available<=e.max?De("picker.leftCount",e.area.available):Rn(n.maxTickets):"");let l=t.querySelector("[data-ga-confirm]");if(l){let c=re("picker.guestsCount",{count:i});l.textContent=e.reopened?De("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(s)}`:De("picker.gaAdd",i,{count:i,price:n.money(s)}),l.disabled=(e.box?i<e.box.min:i<=0)&&!e.reopened}}function Jh(n,e,t){e.querySelectorAll("[data-confirm-tier]").forEach(i=>{i.addEventListener("click",()=>{let s=t.tiers.find(a=>(a.id??"")===i.dataset.confirmTier);if(!s||!t.box)return;let o=Fi(t);for(let a of t.tiers)t.draft.set(a.id,0);t.draft.set(s.id,o),t.boxTier=s.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=s.id??""),Ks(n,t)})}),e.querySelectorAll("[data-ga-step]").forEach(i=>{i.addEventListener("click",()=>{let s=i.closest("[data-ga-tier]");if(!s)return;let o=s.dataset.gaTier?s.dataset.gaTier:null,r=Number(i.dataset.gaStep),a=t.draft.get(o)??0,l=(t.box?Math.min(t.box.max,t.max):t.max)-Fi(t),c=t.box?t.box.min:0;t.draft.set(o,Math.max(c,a+(r>0?Math.min(1,l):-1))),Ks(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(),Us(n,re("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{eu(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 s=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!s.length)return;let o=s[0],r=s[s.length-1];i.shiftKey&&document.activeElement===o?(i.preventDefault(),r.focus()):!i.shiftKey&&document.activeElement===r&&(i.preventDefault(),o.focus())})}function eu(n,e){let t=Fi(e),i=Ha(n,e);for(let o of e.tiers)vt(n.gaQty,e.area.id,o.id,e.draft.get(o.id)??0);Ce(n),n.syncTray();let s=e.area.displayLabel??e.area.label;t>0?Us(n,De("picker.gaAdded",t,{count:t,area:s,price:n.money(i)})):Us(n,re("picker.gaRemoved",{area:s}))}function tu(n,e,t,i,s,o=null){if(o){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:o.mode==="whole"?o.max:Math.max(o.min,Math.min(o.max,s,a));n.gaQty.delete(e.id),vt(n.gaQty,e.id,r.tierId,l<=s?l:0)}else if(typeof i=="number")vt(n.gaQty,e.id,t[0].id,Math.max(0,Math.min(s,Math.floor(i))));else{n.gaQty.delete(e.id);let r=s;for(let a of t){let l=Math.max(0,Math.floor(i[a.id??""]??0)),c=Math.min(l,r);r-=c,vt(n.gaQty,e.id,a.id,c)}}n.syncTray()}function Ce(n,e=!0){let t=n.gaPromptReturnFocus;n.gaPromptEl&&Bi(n.gaPromptEl),n.gaPromptEl=null,n.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:n.root)?.focus())}function nu(n,e,t,i){let s=n.root,o=e.querySelector(".sl-ga-pop");if(!s||!o)return;if(!t){i&&s.contains(i)&&iu(s,o,i);return}let r=s.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=o.offsetWidth||260,d=o.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);o.style.left=`${h}px`,o.style.top=`${Math.max(8,u)}px`,o.dataset.side=m>=8?"above":"below",o.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(c-12,a-h))}px`)})}var Wt=14;function iu(n,e,t){requestAnimationFrame(()=>{let i=n.getBoundingClientRect(),s=t.getBoundingClientRect(),o=e.offsetWidth||288,r=e.offsetHeight||220,a=s.left-i.left-Wt-8,l=i.right-s.right-Wt-8,c=a>=l?"left":"right";if(Math.max(a,l)<o){let u=s.left+s.width/2-i.left,y=s.top-i.top-r-Wt,g=y>=8?y:Math.min(i.height-r-8,s.bottom-i.top+Wt),T=Math.max(8,Math.min(i.width-o-8,u-o/2));e.style.left=`${T}px`,e.style.top=`${Math.max(8,g)}px`,e.dataset.side=y>=8?"above":"below",e.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(o-12,u-T))}px`);return}let d=s.top+s.height/2-i.top,h=Math.max(8,Math.min(i.height-r-8,d-r/2)),m=c==="left"?s.left-i.left-Wt-o:s.right-i.left+Wt;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 Us(n,e){n.srEl&&(n.srEl.textContent=e)}function Ra(n,e,t=[]){let i=[],s=Yh(t);for(let r of e){let a=n.gaQty.get(r.id);if(!a)continue;let l=Ws(r);for(let c of l){let d=(a.get(c.id)??0)-(s.get(`${r.id}\0${c.id??""}`)??0);if(d<=0)continue;let h=n.paidPrice(r.categoryKey,c.id,c.price,r.id),m=Yt(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:"",re("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 ${De("picker.leftCount",r.available)}`)}</div></div>`+(m?`<button type="button" class="sl-table-edit" data-ga-open="${z(r.id)}">${z(re("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 o=e.filter(r=>Zt(n.gaQty,r.id)<=0&&!t.some(a=>a.objectId===r.id));return o.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>${o.length}</small></button>`+(n.gaAreasExpanded?`<div class="sl-ga-areas-list">${o.map(r=>`<button type="button" class="sl-ga-area-open" data-ga-open="${z(r.id)}"${wt(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(wt(n,r)<=0?La(n,r):`${n.money(n.paidPrice(r.categoryKey,null,r.price,r.id))} \xB7 ${Yt(r)?re("picker.capacityGuests",{count:Yt(r).max}):De("picker.leftCount",wt(n,r))}`)}</span></button>`).join("")}</div>`:"")+"</div>"),i.join("")}function Ia(n,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(i=>{i.addEventListener("click",()=>{let s=i.closest(".sl-ga");if(!s?.dataset.ga)return;let o=t.find(c=>c.id===s.dataset.ga);if(!o)return;let r=s.dataset.gaRowTier?s.dataset.gaRowTier:null,a=Number(i.dataset.d),l=n.gaQty.get(o.id)?.get(r)??0;if(a>0&&Pa(n,o)-Zt(n.gaQty,o.id)<=0){n.toast(Rn(n.maxTickets),"warning");return}vt(n.gaQty,o.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 s=t.find(o=>o.id===i.dataset.gaOpen);s&&Zs(n,s,null,i)})})}var su=/^[a-zA-Z0-9._-]+$/;function Qs(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]),s=decodeURIComponent(t[2]);return!i||!su.test(s)?null:{eventKey:i,asset:s}}catch{return null}}function ou(n){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(n,"https://seatlayer.invalid").pathname)}catch{return!1}}var Qt=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=Qs(e);if(!t)return Promise.resolve(ou(e)||!Ft(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 s=this.load(this.eventKey,t.asset).then(o=>{let r=URL.createObjectURL(o);return this.disposed?(URL.revokeObjectURL(r),null):(this.created.add(r),r)}).catch(o=>{throw this.pending.delete(e),o});return this.pending.set(e,s),s}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 xt}from"@seatlayer/core";import{isAuthoredSeatView as hu,seatViewDisclosure as uu}from"@seatlayer/core/view3d/crossfade/panorama";var Oa=`
148
+ `+au;function Fi(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function qs(n,e){if(!e){n.style.removeProperty("--sl-mo-ox"),n.style.removeProperty("--sl-mo-oy");return}Vi(n,e,n.getBoundingClientRect())}function Vi(n,e,t){let i=t.width||1,s=t.height||1,o=r=>Math.max(0,Math.min(100,r));n.style.setProperty("--sl-mo-ox",`${o((e.x-t.left)/i*100).toFixed(1)}%`),n.style.setProperty("--sl-mo-oy",`${o((e.y-t.top)/s*100).toFixed(1)}%`)}function Sa(n,e,t){let i=n.getBoundingClientRect(),s=t.getBoundingClientRect();Vi(n,e,{left:i.left-s.left,top:i.top-s.top,width:i.width,height:i.height})}function Ta(n,e){n.classList.remove("sl-mo-out"),e!==void 0&&qs(n,e),n.classList.remove("sl-mo-in"),n.offsetWidth,n.classList.add("sl-mo-in")}function Ea(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 $i(n,e,t={className:"sl-mo-out",duration:ne.exit}){let i=()=>{s||(s=!0,!(typeof window>"u")&&(clearTimeout(o),n.removeEventListener("animationend",i),e?e():n.remove()))},s=!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 o=setTimeout(i,Fi()?0:t.duration+60)}var Kb={className:"sl-mo-slide-down",duration:ne.exit};function Ca(n){if(Fi())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(s),e.remove(),n.onArrive?.())};e.addEventListener("animationend",i);let s=window.setTimeout(i,ne.flight+80);return e}var z=n=>String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function In(n){let e=re("picker.maxTicketsForOrder",{count:n});return n===1?v("picker.maxOneTicketForOrder",e):e}function Xt(n,e){let t=0;for(let i of n.get(e)?.values()??[])t+=i;return t}function Aa(n){let e=new Map;for(let t of n.keys())e.set(t,Xt(n,t));return e}function vt(n,e,t,i){let s=n.get(e)??new Map;i>0?s.set(t,i):s.delete(t),s.size?n.set(e,s):n.delete(e)}function Zs(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 Pa(n,e){let t=Zs(e),i=[];for(let[s,o]of n){let r=t.get(s)??0;for(let[a,l]of o){let c=Math.max(0,l-r);r=Math.max(0,r-l),c>0&&i.push({areaId:s,tierId:a,qty:c})}}return i}function La(n,e){let t=new Map;for(let i of e)i.objectType!=="ga"||!i.objectId||n.has(i.objectId)||vt(t,i.objectId,i.tierId??null,(t.get(i.objectId)?.get(i.tierId??null)??0)+(i.quantity??1));for(let[i,s]of t)n.set(i,s)}function Be(n,e){let t=Zs(e),i=0;for(let s of n.keys())i+=Math.max(0,Xt(n,s)-(t.get(s)??0));return i}function Ma(n,e,t){let i=Zs(t),s=0;for(let o of e){let r=n.gaQty.get(o.id);if(!r)continue;let a=i.get(o.id)??0;for(let[l,c]of r){let d=Math.max(0,c-a);a=Math.max(0,a-c),s+=d*n.paidPrice(o.categoryKey,l,lu(o,l),o.id)}}return s}function lu(n,e){return e?n.tiers?.find(t=>t.id===e)?.price??n.price:n.price}function Ha(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 s=`${i.objectId}\0${i.tierId??""}`,o=t.get(s);if(o){o.quantity=(o.quantity??0)+(i.quantity??1),o.labels.push(i.label);continue}let r={...i,quantity:i.quantity??1,labels:[i.label]};t.set(s,r),e.push(r)}return e}function Ra(n,e,t){let i=new Set(t);for(let s of e)s.objectType==="ga"&&s.objectId&&i.has(s.label)&&vt(n,s.objectId,s.tierId??null,0)}function ji(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 cu(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 Xs(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??re("picker.generalAdmission"),price:n.price}]}function Ia(n,e){let t=n.totalTicketCount()-Xt(n.gaQty,e.id);return Math.max(0,Math.min(wt(n,e),n.maxTickets-t))}function wt(n,e){return Qs(n)?Zt(e)?e.wheelchairPlaces?e.available:0:Math.min(e.available,e.wheelchairAvailable??0):e.available}function Zt(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 Oa(n,e){return Qs(n)&&e.available>0?n.tf("picker.noWheelchairSpace","No wheelchair space"):n.tf("picker.soldOutTitle","Sold out")}function Qs(n){return n.controller?.getAccessibilityFilter?.()?.includes("wheelchair")===!0}function du(n){return`${re("picker.access.wheelchair")} \xB7 ${Ne("picker.leftCount",n.wheelchairAvailable??0)}`}function pu(n){let e=[];return n.wheelchairPlaces&&e.push({icon:"wheelchair",title:re("picker.access.wheelchair"),tone:"access",note:Ne("picker.leftCount",n.wheelchairAvailable??0)}),n.entrance&&e.push({icon:"entrance",title:re("picker.entrance"),note:n.entrance,tone:"place"}),$s(e,{compact:!0})}function _a(n,e){let t=Zt(n),i=Xs(n),s=wt({controller:{getAccessibilityFilter:()=>e.wheelchairOnly?["wheelchair"]:null}},n),o=t?t.max:Math.max(0,Math.min(s,e.room));return{area:n,...t?{bookingMode:t.mode}:{},selected:{},min:t?t.min:0,max:o,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 Js(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 s=Zt(e),o=Xs(e),r=n.gaQty.get(e.id),a=Xt(n.gaQty,e.id)>0,l=Ia(n,e);if((s?l<s.min:l<=0)&&!a){n.toast(wt(n,e)<=0||s&&wt(n,e)<s.min?Oa(n,e):In(n.maxTickets),"warning");return}let c=s?[...r??[]].find(([,b])=>b>0)?.[0]??o[0].id:null;if(n.onGAPromptHook){let b={};for(let[T,S]of r??[])b[T??""]=S;if(n.onGAPromptHook({area:e,...s?{bookingMode:s.mode}:{},selected:b,min:s?s.min:0,max:s?Math.min(s.max,l):l,tiers:o,confirm:T=>{fu(n,e,o,T,l,s)},cancel:()=>Ce(n)})===!0)return}let d=new Map;for(let b of o)d.set(b.id,r?.get(b.id)??0);!a&&l>0&&d.set(s?c:o[0].id,s?s.min:1);let h={area:e,tiers:o,draft:d,max:l,reopened:a,box:s,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=hu(n,h,m),n.root?.appendChild(u),n.gaPromptEl=u,n.gaPromptReturnFocus=i??document.activeElement,m||gu(n,u,t,i),n.reducedMotion()&&(u.dataset.motion="reduced"),Ws(n,h),uu(n,u,h),requestAnimationFrame(()=>u.querySelector('[data-ga-step="1"]')?.focus())}function hu(n,e,t){let{area:i,tiers:s,box:o}=e,r=s.length>1,a=i.displayLabel??i.label,l=o&&r?Ti(s.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=o?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>`+(o.mode==="variable"?`<small data-ga-range>${z(re("picker.chooseMinMaxGuests",{min:o.min,max:o.max}))}</small>`:"")+"</div>"+(o.mode==="whole"?`<output data-ga-qty>${o.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>"):s.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(re("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(re("common.close"))}">\xD7</button></div>`+pu(i)+`<div class="sl-ga-prompt-body">${c}`+(s.length>1||o?`<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(re("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function zi(n){let e=0;for(let t of n.draft.values())e+=t;return e}function Da(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 Ws(n,e){let t=n.gaPromptEl;if(!t)return;let i=zi(e),s=Da(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 o=t.querySelector("[data-ga-sub]");if(o){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));o.textContent=e.box?re("picker.perGuestPrice",{price:d}):`${d} \xB7 ${Ne("picker.leftCount",e.area.available)}`}let r=t.querySelector("[data-ga-total]");r&&(r.textContent=n.money(s));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=e.box?"":i>=e.max&&e.max>0?Qs(n)&&e.area.wheelchairPlaces?du(e.area):e.area.available<=e.max?Ne("picker.leftCount",e.area.available):In(n.maxTickets):"");let l=t.querySelector("[data-ga-confirm]");if(l){let c=re("picker.guestsCount",{count:i});l.textContent=e.reopened?Ne("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(s)}`:Ne("picker.gaAdd",i,{count:i,price:n.money(s)}),l.disabled=(e.box?i<e.box.min:i<=0)&&!e.reopened}}function uu(n,e,t){e.querySelectorAll("[data-confirm-tier]").forEach(i=>{i.addEventListener("click",()=>{let s=t.tiers.find(a=>(a.id??"")===i.dataset.confirmTier);if(!s||!t.box)return;let o=zi(t);for(let a of t.tiers)t.draft.set(a.id,0);t.draft.set(s.id,o),t.boxTier=s.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=s.id??""),Ws(n,t)})}),e.querySelectorAll("[data-ga-step]").forEach(i=>{i.addEventListener("click",()=>{let s=i.closest("[data-ga-tier]");if(!s)return;let o=s.dataset.gaTier?s.dataset.gaTier:null,r=Number(i.dataset.gaStep),a=t.draft.get(o)??0,l=(t.box?Math.min(t.box.max,t.max):t.max)-zi(t),c=t.box?t.box.min:0;t.draft.set(o,Math.max(c,a+(r>0?Math.min(1,l):-1))),Ws(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(),Ys(n,re("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{mu(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 s=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!s.length)return;let o=s[0],r=s[s.length-1];i.shiftKey&&document.activeElement===o?(i.preventDefault(),r.focus()):!i.shiftKey&&document.activeElement===r&&(i.preventDefault(),o.focus())})}function mu(n,e){let t=zi(e),i=Da(n,e);for(let o of e.tiers)vt(n.gaQty,e.area.id,o.id,e.draft.get(o.id)??0);Ce(n),n.syncTray();let s=e.area.displayLabel??e.area.label;t>0?Ys(n,Ne("picker.gaAdded",t,{count:t,area:s,price:n.money(i)})):Ys(n,re("picker.gaRemoved",{area:s}))}function fu(n,e,t,i,s,o=null){if(o){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:o.mode==="whole"?o.max:Math.max(o.min,Math.min(o.max,s,a));n.gaQty.delete(e.id),vt(n.gaQty,e.id,r.tierId,l<=s?l:0)}else if(typeof i=="number")vt(n.gaQty,e.id,t[0].id,Math.max(0,Math.min(s,Math.floor(i))));else{n.gaQty.delete(e.id);let r=s;for(let a of t){let l=Math.max(0,Math.floor(i[a.id??""]??0)),c=Math.min(l,r);r-=c,vt(n.gaQty,e.id,a.id,c)}}n.syncTray()}function Ce(n,e=!0){let t=n.gaPromptReturnFocus;n.gaPromptEl&&$i(n.gaPromptEl),n.gaPromptEl=null,n.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:n.root)?.focus())}function gu(n,e,t,i){let s=n.root,o=e.querySelector(".sl-ga-pop");if(!s||!o)return;if(!t){i&&s.contains(i)&&bu(s,o,i);return}let r=s.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=o.offsetWidth||260,d=o.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);o.style.left=`${h}px`,o.style.top=`${Math.max(8,u)}px`,o.dataset.side=m>=8?"above":"below",o.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(c-12,a-h))}px`)})}var Yt=14;function bu(n,e,t){requestAnimationFrame(()=>{let i=n.getBoundingClientRect(),s=t.getBoundingClientRect(),o=e.offsetWidth||288,r=e.offsetHeight||220,a=s.left-i.left-Yt-8,l=i.right-s.right-Yt-8,c=a>=l?"left":"right";if(Math.max(a,l)<o){let u=s.left+s.width/2-i.left,b=s.top-i.top-r-Yt,g=b>=8?b:Math.min(i.height-r-8,s.bottom-i.top+Yt),T=Math.max(8,Math.min(i.width-o-8,u-o/2));e.style.left=`${T}px`,e.style.top=`${Math.max(8,g)}px`,e.dataset.side=b>=8?"above":"below",e.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(o-12,u-T))}px`);return}let d=s.top+s.height/2-i.top,h=Math.max(8,Math.min(i.height-r-8,d-r/2)),m=c==="left"?s.left-i.left-Yt-o:s.right-i.left+Yt;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 Ys(n,e){n.srEl&&(n.srEl.textContent=e)}function Na(n,e,t=[]){let i=[],s=cu(t);for(let r of e){let a=n.gaQty.get(r.id);if(!a)continue;let l=Xs(r);for(let c of l){let d=(a.get(c.id)??0)-(s.get(`${r.id}\0${c.id??""}`)??0);if(d<=0)continue;let h=n.paidPrice(r.categoryKey,c.id,c.price,r.id),m=Zt(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:"",re("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 ${Ne("picker.leftCount",r.available)}`)}</div></div>`+(m?`<button type="button" class="sl-table-edit" data-ga-open="${z(r.id)}">${z(re("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 o=e.filter(r=>Xt(n.gaQty,r.id)<=0&&!t.some(a=>a.objectId===r.id));return o.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>${o.length}</small></button>`+(n.gaAreasExpanded?`<div class="sl-ga-areas-list">${o.map(r=>`<button type="button" class="sl-ga-area-open" data-ga-open="${z(r.id)}"${wt(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(wt(n,r)<=0?Oa(n,r):`${n.money(n.paidPrice(r.categoryKey,null,r.price,r.id))} \xB7 ${Zt(r)?re("picker.capacityGuests",{count:Zt(r).max}):Ne("picker.leftCount",wt(n,r))}`)}</span></button>`).join("")}</div>`:"")+"</div>"),i.join("")}function Ba(n,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(i=>{i.addEventListener("click",()=>{let s=i.closest(".sl-ga");if(!s?.dataset.ga)return;let o=t.find(c=>c.id===s.dataset.ga);if(!o)return;let r=s.dataset.gaRowTier?s.dataset.gaRowTier:null,a=Number(i.dataset.d),l=n.gaQty.get(o.id)?.get(r)??0;if(a>0&&Ia(n,o)-Xt(n.gaQty,o.id)<=0){n.toast(In(n.maxTickets),"warning");return}vt(n.gaQty,o.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 s=t.find(o=>o.id===i.dataset.gaOpen);s&&Js(n,s,null,i)})})}var yu=/^[a-zA-Z0-9._-]+$/;function eo(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]),s=decodeURIComponent(t[2]);return!i||!yu.test(s)?null:{eventKey:i,asset:s}}catch{return null}}function vu(n){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(n,"https://seatlayer.invalid").pathname)}catch{return!1}}var Qt=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=eo(e);if(!t)return Promise.resolve(vu(e)||!Vt(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 s=this.load(this.eventKey,t.asset).then(o=>{let r=URL.createObjectURL(o);return this.disposed?(URL.revokeObjectURL(r),null):(this.created.add(r),r)}).catch(o=>{throw this.pending.delete(e),o});return this.pending.set(e,s),s}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 xt}from"@seatlayer/core";import{isAuthoredSeatView as Cu,seatViewDisclosure as Au}from"@seatlayer/core/view3d/crossfade/panorama";var Fa=`
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}
@@ -528,7 +528,7 @@ ${t}`}function ga(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
528
528
  color:var(--sl-text);font-weight:700;font-size:12px;display:flex;align-items:center;justify-content:center;gap:7px}
529
529
  .sl-confirm-view:hover{border-color:var(--sl-muted)}
530
530
  .sl-confirm-view svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
531
- `;var _a=`
531
+ `;var Va=`
532
532
  /* Test mode is environment context, not an action. The chip flows in the
533
533
  top-left anchor region: the old rotated corner ribbon sat at a negative
534
534
  offset and was clipped by the widget root's rounded overflow:hidden (its
@@ -792,7 +792,7 @@ ${t}`}function ga(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
792
792
  .sl-pg-switch:hover{border-style:solid;color:var(--sl-text);border-color:var(--sl-accent)}
793
793
  @media(prefers-reduced-motion:reduce){.sl-tip{animation:none!important}.sl-tip,.sl-tip-switch,.sl-pg-switch{transition:none!important}}
794
794
  @media(max-width:639px){.sl-confirm-group-dates{width:min(340px,calc(100% - 20px))}.sl-confirm-date{min-height:32px}}
795
- `;var Da=`
795
+ `;var $a=`
796
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 */
797
797
  /* One chevron for every select the panel owns: same glyph, same weight, same
798
798
  inset from the edge. The platform's own arrow is a different size, colour
@@ -892,7 +892,7 @@ ${t}`}function ga(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
892
892
  .sl-ba-qty button:active:not(:disabled),.sl-ga-qty button:active:not(:disabled),
893
893
  .sl-picker .sl-ba-go:active:not(:disabled){transform:none}
894
894
  }
895
- `;var Na=`
895
+ `;var za=`
896
896
  /* 3D venue overlay \u2014 mounts over the (paused) Konva stage inside the map host.
897
897
  Carries its own gradient so it paints instantly before the scene builds, and
898
898
  cross-fades on enter/exit via a compositor-only opacity transition. Sits below
@@ -1261,7 +1261,7 @@ ${t}`}function ga(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
1261
1261
  .sl-view3d-passport-shell{padding:max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom))}
1262
1262
  .sl-view3d-passport{width:100%;max-height:100%;padding:14px 14px max(24px,calc(14px + env(safe-area-inset-bottom)));border-radius:15px}
1263
1263
  }
1264
- `;var Ba=`
1264
+ `;var ja=`
1265
1265
  .sl-notes{display:flex;flex-direction:column;gap:0;margin:0}
1266
1266
  /* No radius, no border, no inset: a band is the card's full width or it is a
1267
1267
  plate again. The hairline lives on the JOIN, so the first band sits flush
@@ -1296,7 +1296,7 @@ ${t}`}function ga(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
1296
1296
  .sl-notes.compact .sl-note{padding:7px 12px 7px 15px}
1297
1297
  .sl-notes.compact .sl-note-t b{font-size:11.5px;font-weight:750}
1298
1298
  .sl-notes.compact .sl-note-n{font-size:10.5px}
1299
- `;var Fa=`
1299
+ `;var Ga=`
1300
1300
  /* The head is a bare 19.5px strip: the pill's upper half and nothing else. It
1301
1301
  used to reserve 26px (6px of ground above a 20px pill) and the sheet drew a
1302
1302
  border above that, so the chrome between the map and the cart was 33px of
@@ -1415,7 +1415,7 @@ ${t}`}function ga(n){let{base:e,event:t,publicKey:i}=n;if(!e||!t||!i)return;let
1415
1415
  above the line. The map now reaches the line, so the column keeps the same
1416
1416
  clearance from the pill's top rather than dropping onto the hairline. */
1417
1417
  .sl-picker[data-layout="narrow"] .sl-anchor[data-region="bottom-right"]{bottom:32px}
1418
- `;var Va=`
1418
+ `;var Ka=`
1419
1419
  /* THE PHONE SHOWS THE DESKTOP CARD (owner call 2026-09-06: "cards should be
1420
1420
  the same design as desktop"). What used to be here was a second rendering of
1421
1421
  the cart \u2014 a bordered .sl-tlist box of 44px hairline-divided .sl-tline rows,
@@ -1623,13 +1623,13 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
1623
1623
  .sl-picker .sl-fitpill.sl-fit-p2,.sl-picker .sl-fitpill.sl-fit-p3{font-size:11.5px}
1624
1624
  .sl-picker .sl-fitpill.sl-fit-p3{white-space:normal;text-align:center;
1625
1625
  padding-top:6px;padding-bottom:6px;line-height:1.2}
1626
- `;function Xs(n){return n?[...n.children].filter(e=>e instanceof HTMLElement&&e.offsetWidth>0&&e.offsetHeight>0):[]}function $a(n){return n.length?n.reduce((e,t)=>e+t.offsetWidth,0)+8*(n.length-1):0}function ru({mapWidth:n,leftWidth:e,centerWidth:t,rightWidth:i}){if(n<=0)return!0;let s=i>0?i+8:0;if(s>n*.38)return!1;if(t<=0)return!0;let o=n/2,r=o-12-(e>0?Math.min(e,n*.38)+8:0),a=o-12-(s>0?s+8:0);return t/2<=Math.min(r,a)}function za(n,e,t){if(!n)return;if(n.dataset.layout==="narrow"){delete n.dataset.topbar;return}let i=Xs(t["top-right"]),s={mapWidth:e.clientWidth,leftWidth:$a(Xs(t["top-left"])),centerWidth:Math.max(0,...Xs(t["top-center"]).filter(r=>r.classList.contains("sl-rungs")).map(r=>r.offsetWidth)),rightWidth:$a(i)};!ru(s)?n.dataset.topbar="stacked":delete n.dataset.topbar,e.style.setProperty("--sl-topright-w",`${Math.ceil(s.rightWidth+8)}px`)}var ja=`
1626
+ `;function to(n){return n?[...n.children].filter(e=>e instanceof HTMLElement&&e.offsetWidth>0&&e.offsetHeight>0):[]}function Ua(n){return n.length?n.reduce((e,t)=>e+t.offsetWidth,0)+8*(n.length-1):0}function wu({mapWidth:n,leftWidth:e,centerWidth:t,rightWidth:i}){if(n<=0)return!0;let s=i>0?i+8:0;if(s>n*.38)return!1;if(t<=0)return!0;let o=n/2,r=o-12-(e>0?Math.min(e,n*.38)+8:0),a=o-12-(s>0?s+8:0);return t/2<=Math.min(r,a)}function qa(n,e,t){if(!n)return;if(n.dataset.layout==="narrow"){delete n.dataset.topbar;return}let i=to(t["top-right"]),s={mapWidth:e.clientWidth,leftWidth:Ua(to(t["top-left"])),centerWidth:Math.max(0,...to(t["top-center"]).filter(r=>r.classList.contains("sl-rungs")).map(r=>r.offsetWidth)),rightWidth:Ua(i)};!wu(s)?n.dataset.topbar="stacked":delete n.dataset.topbar,e.style.setProperty("--sl-topright-w",`${Math.ceil(s.rightWidth+8)}px`)}var Wa=`
1627
1627
  .sl-picker[data-layout="wide"][data-topbar="stacked"] .sl-anchor[data-region="top-right"]{flex-wrap:nowrap;max-width:none}
1628
1628
  .sl-picker[data-layout="wide"][data-topbar="stacked"] .sl-anchor[data-region="top-left"]{
1629
1629
  max-width:calc(100% - 32px - var(--sl-topright-w,160px))}
1630
1630
  .sl-picker[data-layout="wide"][data-topbar="stacked"] .sl-anchor[data-region="top-center"]{
1631
1631
  top:64px;max-width:calc(100% - 24px)}
1632
- `;var Ga="seatlayer-picker-style",au=`
1632
+ `;var Ya="seatlayer-picker-style",xu=`
1633
1633
  .sl-picker{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:420px;overflow:hidden;
1634
1634
  background:var(--sl-bg);color:var(--sl-text);font-family:var(--sl-font);border-radius:var(--sl-radius);
1635
1635
  /* iOS INFLATES FIXED-PX TYPE IN A HOST LAYOUT IT DECIDES IS TOO NARROW, and
@@ -3322,7 +3322,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3322
3322
  Paint twelve pixels of the frame ground below its box to cover that seam;
3323
3323
  this does not enlarge the picker or move its checkout controls. */
3324
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)}}
3325
- `;function Be(){if(document.getElementById(Ga))return;let n=document.createElement("style");n.id=Ga,n.textContent=au+Fa+Ba+Oa+Va+Da+Na+ja+_a+ba,document.head.appendChild(n)}async function $i(n,e){let t=n.overlay.productionElements;if(!t?.some(s=>s.contentImageUrl))return n;let i=await Promise.all(t.map(async s=>{if(!s.contentImageUrl)return s;try{let o=await e(s.contentImageUrl);if(!o){let{contentImageUrl:r,...a}=s;return a}return{...s,runtimeContentImageUrl:o}}catch{let{contentImageUrl:o,...r}=s;return r}}));return{...n,overlay:{...n.overlay,productionElements:i}}}async function zi(n,e){if(n)try{let t=await e(n);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}import{browserPanoramaConstraints as lu,loadPanoramaImage as cu,planPanoramaDelivery as du,schedulePanoramaUpgrade as pu}from"@seatlayer/core/view/panoramaDelivery";function ji(n){let{root:e,source:t,caption:i,real:s,closeLabel:o,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 y=V=>u.querySelector(V)?.remove();m.title===!1?y(".sl-view-title"):u.querySelector(".sl-view-title").textContent=a,m.caption===!1?y(".sl-view-cap"):u.querySelector(".sl-view-cap").textContent=i,u.querySelector(".sl-view-x").setAttribute("aria-label",o),m.badge===!1?y(".sl-view-badge"):u.querySelector(".sl-view-badge").textContent=s?l:c,u.querySelector(".sl-view-hint").textContent=r,e.appendChild(u);let g=u.querySelector(".sl-view-pano"),T=du(t,lu()),S=new AbortController;g.style.backgroundImage=`url(${JSON.stringify(T.initialUrl)})`;let k=()=>{};T.upgradeUrl&&(k=pu(()=>{d(T.upgradeUrl).then(V=>!V||S.signal.aborted?null:cu(V,S.signal).then(()=>V)).then(V=>{!V||!u.isConnected||S.signal.aborted||(g.style.backgroundImage=`url(${JSON.stringify(V)})`)}).catch(()=>{})}));let E=70,L=35,U=1,O=g.clientHeight||1,f=g.clientWidth||1,R=-(O*(180/E)*2/2-f/2),M=0,_=()=>{let V=g.clientHeight||1,Nt=V*(180/E)*U,qe=Math.max(0,Nt-V),Xo=Math.min(qe/2,L/180*Nt);M=Math.min(Xo,Math.max(-Xo,M)),g.style.backgroundSize=`auto ${Nt}px`,g.style.backgroundPosition=`${R}px ${M-qe/2}px`};_();let D=!1,I=0,q=0,Y=V=>{D=!0,I=V.clientX,q=V.clientY,g.classList.add("drag"),g.setPointerCapture?.(V.pointerId)},X=V=>{D&&(R+=V.clientX-I,M+=V.clientY-q,I=V.clientX,q=V.clientY,_())},fe=V=>{D=!1,g.classList.remove("drag"),g.releasePointerCapture?.(V.pointerId)},ge=V=>{V.preventDefault(),U=Math.min(2.4,Math.max(1,U+(V.deltaY<0?.12:-.12))),_()};g.addEventListener("pointerdown",Y),g.addEventListener("pointermove",X),g.addEventListener("pointerup",fe),g.addEventListener("pointercancel",fe),g.addEventListener("wheel",ge,{passive:!1});let be=u.querySelector(".sl-view-x");be.addEventListener("click",h);let Ue=V=>{V.key==="Escape"&&(V.stopPropagation(),h())};return u.addEventListener("keydown",Ue),be.focus(),{element:u,dispose(){k(),S.abort(),g.removeEventListener("pointerdown",Y),g.removeEventListener("pointermove",X),g.removeEventListener("pointerup",fe),g.removeEventListener("pointercancel",fe),g.removeEventListener("wheel",ge),u.removeEventListener("keydown",Ue),be.removeEventListener("click",h)}}}function mu(n,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=n.find(o=>o.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let i=n.filter(o=>o.rowId===t.rowId),s=i.findIndex(o=>o.id===e);return{targetSeatId:e,previousSeatId:s>0?i[s-1].id:null,nextSeatId:s>=0&&s+1<i.length?i[s+1].id:null}}var Ka=6e4,Gi=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 mu(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()||!mi()?!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(),s=this.options.doc();if(!t||!i||!s)throw new Error("seat_view_unavailable");let o=++this.seatViewGeneration,r,a,l=!1;if(t.viewUrl){let y=t.viewMeta?.previewUrl,g=!!y&&y!==t.viewUrl,T=g?await this.options.resolveAsset(y):null,S=g?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(o!==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=uu(r),l=hu(r)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:y}=await gi();if(o!==this.seatViewGeneration)return;let g=s.floors?.find(k=>k.objects.some(E=>E.type==="row"&&E.id===t.rowId)),T=t.focalPoint??g?.focalPoint??s.focalPoint,S=y(t,T,[...this.options.seats()]);r={url:S.url,generated:!0},a=xt("picker.illustrationCaption",{m:S.distanceM})}if(o!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(i,s),Be();let c=this.options.chrome??{},d=ft(),h=xt("picker.viewFromSeat",{label:t.displayLabel||t.label}),m=l?xt("picker.real360"):xt("picker.preview"),u=ji({root:i,source:r,caption:a,real:l,closeLabel:v("picker.close","Close"),dragHint:d,viewFromSeatLabel:h,real360Label:xt("picker.real360"),previewLabel:xt("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)),this.options.areaStates&&this.handle.setAreaStates&&hi(this,()=>{let e=this.options.areaStates?.();e&&this.handle?.setAreaStates?.(e)}))}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(s=>s.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)?Ka/2:Ka}async enter3D(e){let t=this.options.host(),i=this.options.doc();if(!t||!i||this.overlay)throw new Error("venue_3d_unavailable");Be(),this.prepareHostTheme(t,i);let s=document.createElement("div");s.className="sl-view3d",s.setAttribute("role","group"),s.setAttribute("aria-label",v("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(s.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 o=document.createElement("div");o.className="sl-view3d-loading",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.textContent=v("picker.loading3d","Building the 3D venue\u2026"),s.appendChild(o),t.appendChild(s),this.overlay=s;let r=++this.generation;if(this.reducedMotion()?s.style.opacity="1":requestAnimationFrame(()=>{s.style.opacity="1"}),await this.nextPaint(),!(r!==this.generation||this.overlay!==s))try{let[a,l]=await Promise.all([Cn(),this.options.loadEventConfiguration()]),c=l?await $i(l,this.options.resolveAsset):null,d=await zi(i.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(r!==this.generation||this.overlay!==s)return;let h={doc:i,seats:[...this.options.seats()],...ci(this.options.enable3DCrowd),crowdSeatCeiling:this.max3DSeats(),...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};o.textContent=xt("picker.building3d");let m=await a.prepareVenue3D(h);if(r!==this.generation||this.overlay!==s)return;let u=this.options.chrome??{},y=a.mountVenue3D(s,{...h,prepared:m},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:ft(),navLabels:ai(),...li(this.options.touchNavigation3D),...u.view3dCaption===!1||u.view3dSeatStepper===!1||u.view3dControlDock===!1?{chrome:{caption:u.view3dCaption!==!1,seatStepper:u.view3dSeatStepper!==!1,controlDock:u.view3dControlDock!==!1}}:{},seatViewActionLabel:g=>this.findSeat(g)?.viewUrl?v("picker.openAuthored360","Open venue 360\xB0"):v("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:g=>this.toggleSeat(g),onSeatInspect:g=>this.toggleSeat(g),onObjectPick:g=>{g.kind==="area"&&this.options.onAreaPick?.(g.id)},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!==s){y.dispose();return}this.handle=y,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,this.applyNavigationMode(y),requestAnimationFrame(()=>o.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await y.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,s=this.overlay;if(this.options.restoreMap(),t&&i&&s){s.style.pointerEvents="none";let o=()=>{this.buyerView_!=="map"||this.overlay!==s||(s.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(s.style.opacity="0",o()):(requestAnimationFrame(()=>{s.style.opacity="0"}),setTimeout(o,280));return}if(this.handle=null,this.overlay=null,!s){try{i?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{i?.dispose()}catch{}s.remove(),this.options.restoreMap();return}s.style.pointerEvents="none",requestAnimationFrame(()=>{s.style.opacity="0"}),setTimeout(()=>{try{i?.dispose()}catch{}s.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(s=>s.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,s=!!i&&i!==t.viewUrl,o=s?await this.options.resolveAsset(i):null,r=s?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!r||s&&!o)throw new Error("seat_view_unavailable");return{url:r,...o?{previewUrl:o}:{},...s?{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:v("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 Ua}from"@seatlayer/core";function Fe(n,e,t,i){let s=e?n?.[e]:void 0;return s===void 0?i:typeof s=="number"?s:t&&s.tiers?.[t]!==void 0?s.tiers[t]:s.base??i}function Ki(n,e,t,i,s){let o=Ua(n?.objects,e,i);return o!==void 0?o:Ua(n?.seatPrices,e,i)!==void 0?s:Fe(n?.prices,t,i,s)}function Ui(n){if(!n)return null;let e=n.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function fu(n){return Ui(n.foot?.querySelector(".sl-total"))??Ui(n.tray)??Ui(n.sheetHead)}function eo(n,e,t,i,s){let o=n,r=o.map;if(!r||!e){s?.();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=fu(o);if(!m){s?.();return}xa({from:l,to:{x:m.left+m.width/2,y:m.top+m.height/2},label:c,color:d,onArrive:s})};o.sheetHead&&Ui(o.sheetHead)?requestAnimationFrame(h):h()}var Js=60,gu=650;function qa(n,e){if(!e.length||n.focusSeats?.(e.map(s=>s.id)))return;let t=e.find(s=>s.sectionId)?.sectionId;if(!t)return;let i=e.filter(s=>s.sectionId===t);n.focus(t,{x:i.reduce((s,o)=>s+o.x,0)/i.length,y:i.reduce((s,o)=>s+o.y,0)/i.length})}function Wa(n,e){let t=!Di();qa({focusSeats:i=>n.focusSeats?.(i,{animate:t})===!0,focus:(i,s)=>n.focusSection(i,s)},(e?.items??[]).filter(i=>i.objectType!=="ga").slice(0,10).map(i=>n.seatByLabel(i.label)).filter(i=>!!i))}function Ya(n,e){if(!e.length)return;let t=n.reducedMotion===!0;t||e.forEach((r,a)=>{n.schedule(()=>n.pop(r.id),a*Js)});let i=t?0:e.length*Js,s=e.find(r=>r.sectionId)?.sectionId;if(n.schedule(()=>qa(n,e),i),t)return;let o=i+(n.focusSeats||s?gu:0);e.forEach((r,a)=>{n.schedule(()=>eo(n.regions,n.screenPoint(r),r,n.categories),o+a*Js)})}function bu(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 qi=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 s of t)this.inside(s.clientX,s.clientY)?this.touches.add(s.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(s=>this.touches.has(s.identifier));for(let s of t)this.touches.delete(s.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 bu(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):[]}},Za=.48,yu=8;function vu(n,e,t,i=Za){let s=Math.max(0,t.top),o=e.height-Math.max(0,t.bottom);if(!(o>s))return 0;let r=Number.isFinite(i)?Math.min(1,Math.max(0,i)):Za,a=s+(o-s)*r-n;return Math.abs(a)<=yu?0:Math.round(a)}function Qa(n,e,t={}){let i=n.gestureCount();if(t.gestures!==void 0&&t.gestures!==i)return{dy:0,gestures:i};let s=n.seatPoint(e);if(!s)return{dy:0,gestures:i};let o=vu(s.y,{height:n.mapHeight()},n.insets(),t.fraction);return o?{dy:n.panScreenBy({x:0,y:o},t.animate!==!1)?o:0,gestures:i}:{dy:0,gestures:i}}var In=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 Bt(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=ii(()=>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 ku}from"@seatlayer/core";import{seatConfidenceDisclosure as Su}from"@seatlayer/core/core/seatConfidence";import{generateSeatThumb as wu}from"@seatlayer/core";function Xt(n){let e=n.viewMeta?.previewUrl??n.viewUrl;return e&&(Qs(e)||Ft(e))?e:null}function Yi(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 xu=512,Wi=new Map;function Zi(n,e){if(!e)return null;let t=`${n.id}|${Math.round(e.x)},${Math.round(e.y)}`,i=Wi.get(t);if(i!==void 0)return i;let s=null;try{s=wu(n,e).distanceM??null}catch{s=null}return Wi.size>=xu&&Wi.clear(),Wi.set(t,s),s}function On(n){return n.getFocusedSection()!==null||n.seatsRevealed()}function Tu(n){let e=n.atVenueFit?.(),t=n.canZoomIn?.();return{...typeof e=="boolean"?{atVenueFit:e}:{},...typeof t=="boolean"?{canZoomIn:t}:{}}}function Eu(n,e){return{accessibilityFilter:n.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function Cu(n,e,t,i){for(let s of e){if(s.count<=0)continue;let o=n.accessibilitySpread?.([s.key]);for(let r of o?.sections??[]){let a=t.get(r.id)??i.get(r.id);if(!a||r.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[s.key]=r.free}}}function Xa(n,e,t){let i=n.doc,s=i?.theme??{},o=n.categoryAvailability(),r=n.getGAAreas(),a=n.getFloors(),l=n.getExpandedSeats(),c=n.getAccessNeeds(),d=Eu(c,l),h=e.seatPosition,m=h.targetSeatId?n.seatDetails(h.targetSeatId):null,u=new Map(l.map(k=>[k.id,k])),y=Yi(i),g=i?.floors?.flatMap(k=>k.objects)??i?.objects??[],T=new Map,S=new Map;for(let k of g){if(k.type!=="section")continue;let E={id:k.id,label:k.label,...k.displayLabel?{displayLabel:k.displayLabel}:{},...k.zone?{zoneId:k.zone}:{}};T.set(k.id,E);let L=k.logicalSectionId??k.id;S.has(L)||S.set(L,E)}return Cu(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:ku()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...s.accent?{accent:s.accent}:{},...s.accentInk?{accentInk:s.accentInk}:{},...s.background?{background:s.background}:{},...s.textColor?{textColor:s.textColor}:{},...s.brandName?{brandName:s.brandName}:{},...s.logoUrl?{logoUrl:s.logoUrl}:{},attributionRequired:!s.hideBadge},features:{ga:r.length>0,tiers:!!i?.categories.some(k=>k.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(k=>!k.notForSale).map(k=>({key:k.key,label:k.label,color:k.color,price:Fe(t.hostPrices_,k.key,null,k.price??k.tiers?.[0]?.price??0),available:o[k.key]??0,...Object.prototype.hasOwnProperty.call(o,k.key)?{free:o[k.key]}:{},tiers:(k.tiers??[]).map(E=>({id:E.id,name:E.name,price:Fe(t.hostPrices_,k.key,E.id,E.price),...E.currency?{currency:E.currency}:{}}))})),zones:(i?.zones??[]).map(k=>({id:k.id,label:k.label,...k.color?{color:k.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:On(n)||t.focusedSection_!==null,...Tu(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(k=>{let E=t.hostPrices_||t.hostObjects_?{...k,price:Ki({prices:t.hostPrices_,objects:t.hostObjects_,seatPrices:i?.seatPrices},k.label,k.categoryKey,k.tierId,k.price)}:k,L=u.get(E.id);if(!L)return E;let U=n.worldToScreen({x:L.x,y:L.y}),O=Xt(L),f=y?Zi(L,L.focalPoint??i?.focalPoint):null;return{...E,screenPoint:{x:U.x,y:U.y},...O?{seatViewThumb:{reference:O,kind:"real"}}:{},...f!=null?{sightlineMetres:f}:{},...L.confidenceEvidence?{seatViewConfidence:Su(L.confidenceEvidence)}:{}}}),validity:n.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var Ou="https://api.seatlayer.io",el=10;function _u(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 to=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??el,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()}},s=(e.apiBase??Ou).replace(/\/+$/,"");this.apiBase=s;let o=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?_i({base:s,event:e.event,publicKey:e.publicKey,accessHooks:i,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=o?.access??Hn(e,i);let r=o?.api??new We(s,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=r,this.chartFetch=Hi(r),this.controller=new Au({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=>this.areaClicked(a),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??In.groundFor(e.theme?.mode)??null}),this.hostSurface=new In({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 Qt(e.event,(a,l)=>r.asset(a,l)),this.immersive=new Gi({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,enable3DCrowd:e.enable3DCrowd,touchNavigation3D:e.touchNavigation3D,onAreaPick:a=>this.areaClicked(a),areaStates:()=>this.areaStates3d(),...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_=On(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=On(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_=On(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=Ci(this.opts.locale,this.opts.messages),i=this.localeGeneration+=1;this.paintedLocale=Ja(),this.mount=_u(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),Ai(s,t,r=>{r!==this.paintedLocale&&this.applyActiveLocale(r,i)}),this.applyInteractionState(),this.renderErrorEmitted=!1;let o=await this.controller.render(s);if(!o){let r=Ri(this.chartFetch?.outcome(),this.renderErrorEmitted);return r&&Ii({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:Ie(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(s),this}if(this.eventLocale=o.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_=o.mode==="test"?"test":"live",this.eventInfo={name:o.eventName,venue:o.venue??null,startsAt:o.startsAt??null,timezone:o.timezone??null,currency:o.currency??this.opts.currency??"USD",posterUrl:o.posterUrl??null,salesClosed:o.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);',s.appendChild(r),this.tipEl=r,this.onTipMove=a=>{let l=s.getBoundingClientRect();this.tipPos={x:a.clientX-l.left,y:a.clientY-l.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},s.addEventListener("mousemove",this.onTipMove)}if(o.mode==="test"&&this.opts.showTestModeIndicator!==!1){s.style.overflow="hidden";let r=document.createElement("div");r.dataset.slI18n="testMode",r.textContent=Jt("picker.testMode"),r.setAttribute("aria-label",Jt("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;",s.appendChild(r)}return Ee({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:o.performanceProfile,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:oi(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,s=this.tipPos.x+14,o=this.tipPos.y-i-12;s+t>e-8&&(s=this.tipPos.x-t-14),o<8&&(o=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,s)}px`,this.tipEl.style.top=`${Math.max(8,o)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=Qi(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 s=document.createElement("div");s.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let o=document.createElement("span");o.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",o.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,s.append(o,r,a),this.tipEl.replaceChildren(i,s),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=Jt("picker.group.legendUnavailable"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(s=>Hu(s)).filter((s,o,r)=>r.indexOf(s)===o);if(t.length<2)return;let i=document.createElement("select");i.setAttribute("aria-label",Jt("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 s of t){let o=document.createElement("option");o.value=s,o.textContent=Mu[s]??s,o.selected=s===Ja(),i.appendChild(o)}i.addEventListener("change",()=>{this.setLocale(i.value)}),e.appendChild(i),this.languageSelect=i}async setLocale(e){let t=this.localeGeneration+=1,i=await Pu(e);return this.opts.messages&&Iu(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=Lu(e);for(let s of i.querySelectorAll("[data-sl-i18n]"))s.dataset.slI18n==="testMode"&&(s.textContent=Jt("picker.testMode"),s.setAttribute("aria-label",Jt("picker.testMode")));Ei(i),this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy(),this.immersive?.pushLiveState()}}getMode(){return this.mode_}getPickerState(){return Xa(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.immersive?.pushLiveState(),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.immersive?.pushLiveState(),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}}areaStates3d(){let e=this.categoryFilter_,t=di(this.controller);return pi(this.controller.gaStates(),i=>e!=null&&!e.includes(t.get(i)?.categoryKey??""),i=>t.get(i)?.wheelchairPlaces??0)}areaClicked(e){let t=this.controller.getGAAreas().find(i=>i.id===e);t&&(this.opts.onGAClick?.(t),this.opts.onGAPrompt?.(Ma(t,{room:(this.opts.maxSelection??el)-this.controller.getSelection().length,wheelchairOnly:this.controller.getAccessibilityFilter()?.includes("wheelchair")===!0,hold:(i,s)=>{this.holdGA(t.id,i,s?{tierId:s}:{})}})))}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(s){return this.opts.onError?.(s),null}}async holdGAOrThrow(e,t,i={}){let s=await this.controller.holdGA(e,t,i);return s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(s){return this.opts.onError?.(s),null}}async bestAvailableOrThrow(e,t,i={}){let s=Ti(this.controller,t);if(s)throw s;let o=await this.controller.bestAvailable(e,t,i);return Wa(this.controller,o),o?{holdId:o.holdId,expiresAt:o.expiresAt,labels:o.labels,seats:o.seats,items:o.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(s){return this.opts.onError?.(s),null}}async replaceTableQuantityOrThrow(e,t,i){let s=await this.controller.replaceTableQuantity(e,t,i);return s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.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 qi,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 Qa({seatPoint:s=>{let o=this.controller.getExpandedSeats().find(r=>r.id===s);return o?this.controller.worldToScreen({x:o.x,y:o.y}):null},mapHeight:()=>this.hostEl?.clientHeight??0,insets:()=>this.controller.getViewportInsets(),gestureCount:()=>i?.getCameraGestureCount?.()??0,panScreenBy:(s,o)=>i?.panScreenBy?(i.panScreenBy(s,{animate:o}),!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=Ru(this.hostObjects_,e);if(t===void 0)return;let i=typeof t=="number"?[t]:Object.values(t.tiers);if(!i.length)return;let s=this.eventInfo?.currency??this.opts.currency??"USD",o=Math.min(...i),r=Math.max(...i);return r>o?`${Qi(o,s)}\u2013${Qi(r,s)}`:Qi(o,s)}hostPriceRanges(){let e=this.hostPrices_;if(e)return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(t=>{let i=t.tiers?.length?t.tiers.map(s=>Fe(e,t.key,s.id,s.price)):t.price==null?[]:[Fe(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 Oe({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:Sn(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=v("picker.mapDidNotLoad","The seat map didn\u2019t load"),i.dataset.slT="picker.mapDidNotLoad",t.appendChild(i);let s=document.createElement("button");s.type="button",s.textContent=v("picker.accessRetry","Try again"),s.dataset.slT="picker.accessRetry",s.style.cssText="appearance:none;border:1px solid #c9cede;background:#fff;color:#10162a;border-radius:8px;padding:8px 16px;font:600 13px/1 inherit;cursor:pointer;",s.addEventListener("click",()=>{this.destroy(),this.render().catch(o=>this.opts.onError?.(o))}),t.appendChild(s),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 tl=["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"],Du={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 Nu(n){let e={};for(let t of tl)e[t]=(...i)=>{let s=n();return s?s[t](...i):Du[t]()};return e}var nl=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay","enable3D","enable3DCrowd","touchNavigation3D"],il=[...nl,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],sl=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function Bu(n,e,t){let i={container:n};for(let s of il)i[s]=e[s];for(let s of sl)i[s]=t[s];return i}var Fu=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),Vu=2e4,$u=0,zu=180*1e3,ju=900*1e3,Gu=.8,Ku=30*1e3,Uu=1e5,qu=4,Wu=50;function no(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 Yu(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 Zu={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."}},io=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"||!Fu.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},s=this.identityEstablished||i.type==="seatlayer.designer.ready"||i.type==="seatlayer.designer.saved"||i.type==="seatlayer.designer.published"||i.type==="seatlayer.designer.close",o=this.options.expectedChartId!==void 0&&i.chartId!==this.options.expectedChartId&&(s||i.chartId!==void 0),r=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(s||i.workspaceId!==void 0);if(o||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=Yu(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=no(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 s=this.options.loadingTimeoutMs??Vu;s>0&&Number.isFinite(s)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},s))}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,s=t.style.getPropertyValue("height"),o=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let r=i();t.style.setProperty("height",`${Uu}px`,"important");let a=i();return s?t.style.setProperty("height",s,o):t.style.removeProperty("height"),!(a-r>qu)&&r>=Wu?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??$u;if(this.fillMode==="container"&&this.containerEl){let s=getComputedStyle(this.containerEl),o=["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"].reduce((a,l)=>a+(parseFloat(s[l])||0),0),r=Math.max(e,Math.floor(this.containerEl.getBoundingClientRect().height-o));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,s]of Object.entries(e))this.frame.style.setProperty(i,s,"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<ju?t*Gu:t-zu,s=Math.max(Ku,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},s)}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,i){this.removeOverlay();let s=document.createElement("div");s.setAttribute("data-seatlayer-designer-overlay",t),s.setAttribute("role",t==="error"?"alert":"status"),s.setAttribute("aria-live","polite"),Object.assign(s.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(s):this.buildErrorCard(s,i??"load"),e.append(s),this.overlay=s}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
3325
+ `;function Fe(){if(document.getElementById(Ya))return;let n=document.createElement("style");n.id=Ya,n.textContent=xu+Ga+ja+Fa+Ka+$a+za+Wa+Va+ka,document.head.appendChild(n)}async function Gi(n,e){let t=n.overlay.productionElements;if(!t?.some(s=>s.contentImageUrl))return n;let i=await Promise.all(t.map(async s=>{if(!s.contentImageUrl)return s;try{let o=await e(s.contentImageUrl);if(!o){let{contentImageUrl:r,...a}=s;return a}return{...s,runtimeContentImageUrl:o}}catch{let{contentImageUrl:o,...r}=s;return r}}));return{...n,overlay:{...n.overlay,productionElements:i}}}async function Ki(n,e){if(n)try{let t=await e(n);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}import{browserPanoramaConstraints as ku,loadPanoramaImage as Su,planPanoramaDelivery as Tu,schedulePanoramaUpgrade as Eu}from"@seatlayer/core/view/panoramaDelivery";function Ui(n){let{root:e,source:t,caption:i,real:s,closeLabel:o,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 b=V=>u.querySelector(V)?.remove();m.title===!1?b(".sl-view-title"):u.querySelector(".sl-view-title").textContent=a,m.caption===!1?b(".sl-view-cap"):u.querySelector(".sl-view-cap").textContent=i,u.querySelector(".sl-view-x").setAttribute("aria-label",o),m.badge===!1?b(".sl-view-badge"):u.querySelector(".sl-view-badge").textContent=s?l:c,u.querySelector(".sl-view-hint").textContent=r,e.appendChild(u);let g=u.querySelector(".sl-view-pano"),T=Tu(t,ku()),S=new AbortController;g.style.backgroundImage=`url(${JSON.stringify(T.initialUrl)})`;let k=()=>{};T.upgradeUrl&&(k=Eu(()=>{d(T.upgradeUrl).then(V=>!V||S.signal.aborted?null:Su(V,S.signal).then(()=>V)).then(V=>{!V||!u.isConnected||S.signal.aborted||(g.style.backgroundImage=`url(${JSON.stringify(V)})`)}).catch(()=>{})}));let E=70,L=35,U=1,O=g.clientHeight||1,f=g.clientWidth||1,R=-(O*(180/E)*2/2-f/2),M=0,_=()=>{let V=g.clientHeight||1,Nt=V*(180/E)*U,qe=Math.max(0,Nt-V),tr=Math.min(qe/2,L/180*Nt);M=Math.min(tr,Math.max(-tr,M)),g.style.backgroundSize=`auto ${Nt}px`,g.style.backgroundPosition=`${R}px ${M-qe/2}px`};_();let D=!1,I=0,q=0,Y=V=>{D=!0,I=V.clientX,q=V.clientY,g.classList.add("drag"),g.setPointerCapture?.(V.pointerId)},Q=V=>{D&&(R+=V.clientX-I,M+=V.clientY-q,I=V.clientX,q=V.clientY,_())},fe=V=>{D=!1,g.classList.remove("drag"),g.releasePointerCapture?.(V.pointerId)},ge=V=>{V.preventDefault(),U=Math.min(2.4,Math.max(1,U+(V.deltaY<0?.12:-.12))),_()};g.addEventListener("pointerdown",Y),g.addEventListener("pointermove",Q),g.addEventListener("pointerup",fe),g.addEventListener("pointercancel",fe),g.addEventListener("wheel",ge,{passive:!1});let be=u.querySelector(".sl-view-x");be.addEventListener("click",h);let Ue=V=>{V.key==="Escape"&&(V.stopPropagation(),h())};return u.addEventListener("keydown",Ue),be.focus(),{element:u,dispose(){k(),S.abort(),g.removeEventListener("pointerdown",Y),g.removeEventListener("pointermove",Q),g.removeEventListener("pointerup",fe),g.removeEventListener("pointercancel",fe),g.removeEventListener("wheel",ge),u.removeEventListener("keydown",Ue),be.removeEventListener("click",h)}}}function Pu(n,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=n.find(o=>o.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let i=n.filter(o=>o.rowId===t.rowId),s=i.findIndex(o=>o.id===e);return{targetSeatId:e,previousSeatId:s>0?i[s-1].id:null,nextSeatId:s>=0&&s+1<i.length?i[s+1].id:null}}var Za=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 Pu(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()||!bi()?!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(),s=this.options.doc();if(!t||!i||!s)throw new Error("seat_view_unavailable");let o=++this.seatViewGeneration,r,a,l=!1;if(t.viewUrl){let b=t.viewMeta?.previewUrl,g=!!b&&b!==t.viewUrl,T=g?await this.options.resolveAsset(b):null,S=g?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(o!==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=Au(r),l=Cu(r)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:b}=await vi();if(o!==this.seatViewGeneration)return;let g=s.floors?.find(k=>k.objects.some(E=>E.type==="row"&&E.id===t.rowId)),T=t.focalPoint??g?.focalPoint??s.focalPoint,S=b(t,T,[...this.options.seats()]);r={url:S.url,generated:!0},a=xt("picker.illustrationCaption",{m:S.distanceM})}if(o!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(i,s),Fe();let c=this.options.chrome??{},d=ft(),h=xt("picker.viewFromSeat",{label:t.displayLabel||t.label}),m=l?xt("picker.real360"):xt("picker.preview"),u=Ui({root:i,source:r,caption:a,real:l,closeLabel:v("picker.close","Close"),dragHint:d,viewFromSeatLabel:h,real360Label:xt("picker.real360"),previewLabel:xt("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)),this.options.areaStates&&this.handle.setAreaStates&&fi(this,()=>{let e=this.options.areaStates?.();e&&this.handle?.setAreaStates?.(e)}))}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(s=>s.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)?Za/2:Za}async enter3D(e){let t=this.options.host(),i=this.options.doc();if(!t||!i||this.overlay)throw new Error("venue_3d_unavailable");Fe(),this.prepareHostTheme(t,i);let s=document.createElement("div");s.className="sl-view3d",s.setAttribute("role","group"),s.setAttribute("aria-label",v("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(s.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 o=document.createElement("div");o.className="sl-view3d-loading",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.textContent=v("picker.loading3d","Building the 3D venue\u2026"),s.appendChild(o),t.appendChild(s),this.overlay=s;let r=++this.generation;if(this.reducedMotion()?s.style.opacity="1":requestAnimationFrame(()=>{s.style.opacity="1"}),await this.nextPaint(),!(r!==this.generation||this.overlay!==s))try{let[a,l]=await Promise.all([An(),this.options.loadEventConfiguration()]),c=l?await Gi(l,this.options.resolveAsset):null,d=await Ki(i.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(r!==this.generation||this.overlay!==s)return;let h={doc:i,seats:[...this.options.seats()],...hi(this.options.enable3DCrowd),crowdSeatCeiling:this.max3DSeats(),...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};o.textContent=xt("picker.building3d");let m=await a.prepareVenue3D(h);if(r!==this.generation||this.overlay!==s)return;let u=this.options.chrome??{},b=a.mountVenue3D(s,{...h,prepared:m},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:ft(),navLabels:di(),...pi(this.options.touchNavigation3D),...u.view3dCaption===!1||u.view3dSeatStepper===!1||u.view3dControlDock===!1?{chrome:{caption:u.view3dCaption!==!1,seatStepper:u.view3dSeatStepper!==!1,controlDock:u.view3dControlDock!==!1}}:{},seatViewActionLabel:g=>this.findSeat(g)?.viewUrl?v("picker.openAuthored360","Open venue 360\xB0"):v("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:g=>this.toggleSeat(g),onSeatInspect:g=>this.toggleSeat(g),onObjectPick:g=>{g.kind==="area"&&this.options.onAreaPick?.(g.id)},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!==s){b.dispose();return}this.handle=b,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,this.applyNavigationMode(b),requestAnimationFrame(()=>o.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await b.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,s=this.overlay;if(this.options.restoreMap(),t&&i&&s){s.style.pointerEvents="none";let o=()=>{this.buyerView_!=="map"||this.overlay!==s||(s.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(s.style.opacity="0",o()):(requestAnimationFrame(()=>{s.style.opacity="0"}),setTimeout(o,280));return}if(this.handle=null,this.overlay=null,!s){try{i?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{i?.dispose()}catch{}s.remove(),this.options.restoreMap();return}s.style.pointerEvents="none",requestAnimationFrame(()=>{s.style.opacity="0"}),setTimeout(()=>{try{i?.dispose()}catch{}s.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(s=>s.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,s=!!i&&i!==t.viewUrl,o=s?await this.options.resolveAsset(i):null,r=s?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!r||s&&!o)throw new Error("seat_view_unavailable");return{url:r,...o?{previewUrl:o}:{},...s?{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:v("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 Xa}from"@seatlayer/core";function Ve(n,e,t,i){let s=e?n?.[e]:void 0;return s===void 0?i:typeof s=="number"?s:t&&s.tiers?.[t]!==void 0?s.tiers[t]:s.base??i}function Wi(n,e,t,i,s){let o=Xa(n?.objects,e,i);return o!==void 0?o:Xa(n?.seatPrices,e,i)!==void 0?s:Ve(n?.prices,t,i,s)}function Yi(n){if(!n)return null;let e=n.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function Lu(n){return Yi(n.foot?.querySelector(".sl-total"))??Yi(n.tray)??Yi(n.sheetHead)}function io(n,e,t,i,s){let o=n,r=o.map;if(!r||!e){s?.();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=Lu(o);if(!m){s?.();return}Ca({from:l,to:{x:m.left+m.width/2,y:m.top+m.height/2},label:c,color:d,onArrive:s})};o.sheetHead&&Yi(o.sheetHead)?requestAnimationFrame(h):h()}var no=60,Mu=650;function Qa(n,e){if(!e.length||n.focusSeats?.(e.map(s=>s.id)))return;let t=e.find(s=>s.sectionId)?.sectionId;if(!t)return;let i=e.filter(s=>s.sectionId===t);n.focus(t,{x:i.reduce((s,o)=>s+o.x,0)/i.length,y:i.reduce((s,o)=>s+o.y,0)/i.length})}function Ja(n,e){let t=!Fi();Qa({focusSeats:i=>n.focusSeats?.(i,{animate:t})===!0,focus:(i,s)=>n.focusSection(i,s)},(e?.items??[]).filter(i=>i.objectType!=="ga").slice(0,10).map(i=>n.seatByLabel(i.label)).filter(i=>!!i))}function el(n,e){if(!e.length)return;let t=n.reducedMotion===!0;t||e.forEach((r,a)=>{n.schedule(()=>n.pop(r.id),a*no)});let i=t?0:e.length*no,s=e.find(r=>r.sectionId)?.sectionId;if(n.schedule(()=>Qa(n,e),i),t)return;let o=i+(n.focusSeats||s?Mu:0);e.forEach((r,a)=>{n.schedule(()=>io(n.regions,n.screenPoint(r),r,n.categories),o+a*no)})}function Hu(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 Zi=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 s of t)this.inside(s.clientX,s.clientY)?this.touches.add(s.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(s=>this.touches.has(s.identifier));for(let s of t)this.touches.delete(s.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 Hu(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):[]}},tl=.48,Ru=8;function Iu(n,e,t,i=tl){let s=Math.max(0,t.top),o=e.height-Math.max(0,t.bottom);if(!(o>s))return 0;let r=Number.isFinite(i)?Math.min(1,Math.max(0,i)):tl,a=s+(o-s)*r-n;return Math.abs(a)<=Ru?0:Math.round(a)}function nl(n,e,t={}){let i=n.gestureCount();if(t.gestures!==void 0&&t.gestures!==i)return{dy:0,gestures:i};let s=n.seatPoint(e);if(!s)return{dy:0,gestures:i};let o=Iu(s.y,{height:n.mapHeight()},n.insets(),t.fraction);return o?{dy:n.panScreenBy({x:0,y:o},t.animate!==!1)?o:0,gestures:i}:{dy:0,gestures:i}}var On=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 Bt(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=si(()=>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 Du}from"@seatlayer/core";import{seatConfidenceDisclosure as Nu}from"@seatlayer/core/core/seatConfidence";import{generateSeatThumb as Ou}from"@seatlayer/core";function Jt(n){let e=n.viewMeta?.previewUrl??n.viewUrl;return e&&(eo(e)||Vt(e))?e:null}function Qi(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 _u=512,Xi=new Map;function Ji(n,e){if(!e)return null;let t=`${n.id}|${Math.round(e.x)},${Math.round(e.y)}`,i=Xi.get(t);if(i!==void 0)return i;let s=null;try{s=Ou(n,e).distanceM??null}catch{s=null}return Xi.size>=_u&&Xi.clear(),Xi.set(t,s),s}function _n(n){return n.getFocusedSection()!==null||n.seatsRevealed()}function Bu(n){let e=n.atVenueFit?.(),t=n.canZoomIn?.();return{...typeof e=="boolean"?{atVenueFit:e}:{},...typeof t=="boolean"?{canZoomIn:t}:{}}}function Fu(n,e){return{accessibilityFilter:n.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function Vu(n,e,t,i){for(let s of e){if(s.count<=0)continue;let o=n.accessibilitySpread?.([s.key]);for(let r of o?.sections??[]){let a=t.get(r.id)??i.get(r.id);if(!a||r.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[s.key]=r.free}}}function il(n,e,t){let i=n.doc,s=i?.theme??{},o=n.categoryAvailability(),r=n.getGAAreas(),a=n.getFloors(),l=n.getExpandedSeats(),c=n.getAccessNeeds(),d=Fu(c,l),h=e.seatPosition,m=h.targetSeatId?n.seatDetails(h.targetSeatId):null,u=new Map(l.map(k=>[k.id,k])),b=Qi(i),g=i?.floors?.flatMap(k=>k.objects)??i?.objects??[],T=new Map,S=new Map;for(let k of g){if(k.type!=="section")continue;let E={id:k.id,label:k.label,...k.displayLabel?{displayLabel:k.displayLabel}:{},...k.zone?{zoneId:k.zone}:{}};T.set(k.id,E);let L=k.logicalSectionId??k.id;S.has(L)||S.set(L,E)}return Vu(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:Du()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...s.accent?{accent:s.accent}:{},...s.accentInk?{accentInk:s.accentInk}:{},...s.background?{background:s.background}:{},...s.textColor?{textColor:s.textColor}:{},...s.brandName?{brandName:s.brandName}:{},...s.logoUrl?{logoUrl:s.logoUrl}:{},attributionRequired:!s.hideBadge},features:{ga:r.length>0,tiers:!!i?.categories.some(k=>k.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(k=>!k.notForSale).map(k=>({key:k.key,label:k.label,color:k.color,price:Ve(t.hostPrices_,k.key,null,k.price??k.tiers?.[0]?.price??0),available:o[k.key]??0,...Object.prototype.hasOwnProperty.call(o,k.key)?{free:o[k.key]}:{},tiers:(k.tiers??[]).map(E=>({id:E.id,name:E.name,price:Ve(t.hostPrices_,k.key,E.id,E.price),...E.currency?{currency:E.currency}:{}}))})),zones:(i?.zones??[]).map(k=>({id:k.id,label:k.label,...k.color?{color:k.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:_n(n)||t.focusedSection_!==null,...Bu(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(k=>{let E=t.hostPrices_||t.hostObjects_?{...k,price:Wi({prices:t.hostPrices_,objects:t.hostObjects_,seatPrices:i?.seatPrices},k.label,k.categoryKey,k.tierId,k.price)}:k,L=u.get(E.id);if(!L)return E;let U=n.worldToScreen({x:L.x,y:L.y}),O=Jt(L),f=b?Ji(L,L.focalPoint??i?.focalPoint):null;return{...E,screenPoint:{x:U.x,y:U.y},...O?{seatViewThumb:{reference:O,kind:"real"}}:{},...f!=null?{sightlineMetres:f}:{},...L.confidenceEvidence?{seatViewConfidence:Nu(L.confidenceEvidence)}:{}}}),validity:n.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var Wu="https://api.seatlayer.io",ol=10;function Yu(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 so=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??ol,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()}},s=(e.apiBase??Wu).replace(/\/+$/,"");this.apiBase=s;let o=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Bi({base:s,event:e.event,publicKey:e.publicKey,accessHooks:i,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=o?.access??Rn(e,i);let r=o?.api??new We(s,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=r,this.chartFetch=Oi(r),this.controller=new $u({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=>this.areaClicked(a),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??On.groundFor(e.theme?.mode)??null}),this.hostSurface=new On({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 Qt(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,enable3DCrowd:e.enable3DCrowd,touchNavigation3D:e.touchNavigation3D,onAreaPick:a=>this.areaClicked(a),areaStates:()=>this.areaStates3d(),...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_=_n(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=_n(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_=_n(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=Li(this.opts.locale,this.opts.messages),i=this.localeGeneration+=1;this.paintedLocale=sl(),this.mount=Yu(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),Mi(s,t,r=>{r!==this.paintedLocale&&this.applyActiveLocale(r,i)}),this.applyInteractionState(),this.renderErrorEmitted=!1;let o=await this.controller.render(s);if(!o){let r=_i(this.chartFetch?.outcome(),this.renderErrorEmitted);return r&&Di({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:Oe(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(s),this}if(this.eventLocale=o.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_=o.mode==="test"?"test":"live",this.eventInfo={name:o.eventName,venue:o.venue??null,startsAt:o.startsAt??null,timezone:o.timezone??null,currency:o.currency??this.opts.currency??"USD",posterUrl:o.posterUrl??null,salesClosed:o.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);',s.appendChild(r),this.tipEl=r,this.onTipMove=a=>{let l=s.getBoundingClientRect();this.tipPos={x:a.clientX-l.left,y:a.clientY-l.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},s.addEventListener("mousemove",this.onTipMove)}if(o.mode==="test"&&this.opts.showTestModeIndicator!==!1){s.style.overflow="hidden";let r=document.createElement("div");r.dataset.slI18n="testMode",r.textContent=en("picker.testMode"),r.setAttribute("aria-label",en("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;",s.appendChild(r)}return Ee({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:o.performanceProfile,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:ri(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,s=this.tipPos.x+14,o=this.tipPos.y-i-12;s+t>e-8&&(s=this.tipPos.x-t-14),o<8&&(o=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,s)}px`,this.tipEl.style.top=`${Math.max(8,o)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=es(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 s=document.createElement("div");s.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let o=document.createElement("span");o.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",o.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,s.append(o,r,a),this.tipEl.replaceChildren(i,s),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=en("picker.group.legendUnavailable"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(s=>Ku(s)).filter((s,o,r)=>r.indexOf(s)===o);if(t.length<2)return;let i=document.createElement("select");i.setAttribute("aria-label",en("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 s of t){let o=document.createElement("option");o.value=s,o.textContent=Gu[s]??s,o.selected=s===sl(),i.appendChild(o)}i.addEventListener("change",()=>{this.setLocale(i.value)}),e.appendChild(i),this.languageSelect=i}async setLocale(e){let t=this.localeGeneration+=1,i=await zu(e);return this.opts.messages&&qu(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=ju(e);for(let s of i.querySelectorAll("[data-sl-i18n]"))s.dataset.slI18n==="testMode"&&(s.textContent=en("picker.testMode"),s.setAttribute("aria-label",en("picker.testMode")));Pi(i),this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy(),this.immersive?.pushLiveState()}}getMode(){return this.mode_}getPickerState(){return il(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.immersive?.pushLiveState(),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.immersive?.pushLiveState(),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}}areaStates3d(){let e=this.categoryFilter_,t=ui(this.controller);return mi(this.controller.gaStates(),i=>e!=null&&!e.includes(t.get(i)?.categoryKey??""),i=>t.get(i)?.wheelchairPlaces??0)}areaClicked(e){let t=this.controller.getGAAreas().find(i=>i.id===e);t&&(this.opts.onGAClick?.(t),this.opts.onGAPrompt?.(_a(t,{room:(this.opts.maxSelection??ol)-this.controller.getSelection().length,wheelchairOnly:this.controller.getAccessibilityFilter()?.includes("wheelchair")===!0,hold:(i,s)=>{this.holdGA(t.id,i,s?{tierId:s}:{})}})))}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(s){return this.opts.onError?.(s),null}}async holdGAOrThrow(e,t,i={}){let s=await this.controller.holdGA(e,t,i);return s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(s){return this.opts.onError?.(s),null}}async bestAvailableOrThrow(e,t,i={}){let s=Ai(this.controller,t);if(s)throw s;let o=await this.controller.bestAvailable(e,t,i);return Ja(this.controller,o),o?{holdId:o.holdId,expiresAt:o.expiresAt,labels:o.labels,seats:o.seats,items:o.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(s){return this.opts.onError?.(s),null}}async replaceTableQuantityOrThrow(e,t,i){let s=await this.controller.replaceTableQuantity(e,t,i);return s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.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 Zi,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 nl({seatPoint:s=>{let o=this.controller.getExpandedSeats().find(r=>r.id===s);return o?this.controller.worldToScreen({x:o.x,y:o.y}):null},mapHeight:()=>this.hostEl?.clientHeight??0,insets:()=>this.controller.getViewportInsets(),gestureCount:()=>i?.getCameraGestureCount?.()??0,panScreenBy:(s,o)=>i?.panScreenBy?(i.panScreenBy(s,{animate:o}),!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=Uu(this.hostObjects_,e);if(t===void 0)return;let i=typeof t=="number"?[t]:Object.values(t.tiers);if(!i.length)return;let s=this.eventInfo?.currency??this.opts.currency??"USD",o=Math.min(...i),r=Math.max(...i);return r>o?`${es(o,s)}\u2013${es(r,s)}`:es(o,s)}hostPriceRanges(){let e=this.hostPrices_;if(e)return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(t=>{let i=t.tiers?.length?t.tiers.map(s=>Ve(e,t.key,s.id,s.price)):t.price==null?[]:[Ve(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 _e({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:Tn(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=v("picker.mapDidNotLoad","The seat map didn\u2019t load"),i.dataset.slT="picker.mapDidNotLoad",t.appendChild(i);let s=document.createElement("button");s.type="button",s.textContent=v("picker.accessRetry","Try again"),s.dataset.slT="picker.accessRetry",s.style.cssText="appearance:none;border:1px solid #c9cede;background:#fff;color:#10162a;border-radius:8px;padding:8px 16px;font:600 13px/1 inherit;cursor:pointer;",s.addEventListener("click",()=>{this.destroy(),this.render().catch(o=>this.opts.onError?.(o))}),t.appendChild(s),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 rl=["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"],Zu={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 Xu(n){let e={};for(let t of rl)e[t]=(...i)=>{let s=n();return s?s[t](...i):Zu[t]()};return e}var al=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay","enable3D","enable3DCrowd","touchNavigation3D"],ll=[...al,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],cl=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function Qu(n,e,t){let i={container:n};for(let s of ll)i[s]=e[s];for(let s of cl)i[s]=t[s];return i}var Ju=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),em=2e4,tm=0,nm=180*1e3,im=900*1e3,sm=.8,om=30*1e3,rm=1e5,am=4,lm=50;function oo(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 cm(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 dm={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."}},ro=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"||!Ju.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},s=this.identityEstablished||i.type==="seatlayer.designer.ready"||i.type==="seatlayer.designer.saved"||i.type==="seatlayer.designer.published"||i.type==="seatlayer.designer.close",o=this.options.expectedChartId!==void 0&&i.chartId!==this.options.expectedChartId&&(s||i.chartId!==void 0),r=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(s||i.workspaceId!==void 0);if(o||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=cm(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=oo(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 s=this.options.loadingTimeoutMs??em;s>0&&Number.isFinite(s)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},s))}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,s=t.style.getPropertyValue("height"),o=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let r=i();t.style.setProperty("height",`${rm}px`,"important");let a=i();return s?t.style.setProperty("height",s,o):t.style.removeProperty("height"),!(a-r>am)&&r>=lm?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??tm;if(this.fillMode==="container"&&this.containerEl){let s=getComputedStyle(this.containerEl),o=["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"].reduce((a,l)=>a+(parseFloat(s[l])||0),0),r=Math.max(e,Math.floor(this.containerEl.getBoundingClientRect().height-o));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,s]of Object.entries(e))this.frame.style.setProperty(i,s,"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<im?t*sm:t-nm,s=Math.max(om,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},s)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{oo(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=oo(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 s=document.createElement("div");s.setAttribute("data-seatlayer-designer-overlay",t),s.setAttribute("role",t==="error"?"alert":"status"),s.setAttribute("aria-live","polite"),Object.assign(s.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(s):this.buildErrorCard(s,i??"load"),e.append(s),this.overlay=s}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
3326
3326
  [data-seatlayer-designer-overlay="loading"]{container-type:inline-size}
3327
3327
  .sl-designer-skeleton{position:absolute;inset:0;display:flex;flex-direction:column;pointer-events:none}
3328
3328
  .sl-designer-skeleton *{box-sizing:border-box}
@@ -3344,8 +3344,8 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3344
3344
  <div class="sl-designer-skeleton-rail" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></div>
3345
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>
3346
3346
  <div class="sl-designer-skeleton-inspector" aria-hidden="true"><div class="sl-designer-skeleton-bar"></div></div>
3347
- </div>`,e.append(i)}buildErrorCard(e,t){let i=Zu[t],s=document.createElement("div");Object.assign(s.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 o=document.createElement("h2");o.textContent=i.title,Object.assign(o.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()),s.append(o,r,a),e.append(s)}};function en(n,e){let t=(a,[l,c])=>{a.textContent=v(l,c??l),a.dataset.slT=l},i=document.createElement("div");i.className="sl-loading-state";let s=document.createElement("div");if(s.setAttribute("role",e.busy?"status":"alert"),s.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 o=document.createElement("div");if(o.className="sl-boot-title",t(o,e.title),s.append(o),e.description){let a=document.createElement("p");a.className="sl-loading-description",t(a,e.description),s.append(a)}i.append(s);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 Qu(n){let{viewportWidth:e,viewportHeight:t,offsetTop:i,offsetLeft:s,clientWidth:o,clientHeight:r,innerHeight:a,largeViewportHeight:l}=n;if(![e,t,i,s].every(Number.isFinite)||e<=0||t<=0)return null;let c=Number.isFinite(o)&&o>0?o: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:s}}function ol(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=Qu({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`})},s=0,o=0,r=0,a=()=>{s&&window.cancelAnimationFrame(s),o&&window.cancelAnimationFrame(o),r&&window.clearTimeout(r),s=window.requestAnimationFrame(()=>{s=0,o=window.requestAnimationFrame(()=>{o=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),()=>{s&&window.cancelAnimationFrame(s),o&&window.cancelAnimationFrame(o),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 Xu=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(",");function Xi(n,e){let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let s=document.createElement("div");s.className="sl-modal-frame",s.style.setProperty("--sl-bg",e),s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.setAttribute("aria-label",n),s.tabIndex=-1,i.appendChild(s),document.body.appendChild(i);let o=document.body.style.overflow;document.body.style.overflow="hidden";let r=ol(i),a=()=>{let u=[...s.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(y=>y.isConnected&&!y.closest('[hidden], [aria-hidden="true"], [inert]'));return u[u.length-1]??s},l=(u,y)=>{let g=u;for(;g;){let T=window.getComputedStyle(g);if(g.hidden||g.getAttribute("aria-hidden")==="true"||g.hasAttribute("inert")||T.display==="none"||T.visibility==="hidden"||T.visibility==="collapse")return!0;if(g===y)return!1;g=g.parentElement}return!0},c=u=>[...u.querySelectorAll(Xu)].filter(y=>y.tabIndex>=0&&!y.matches(":disabled")&&!l(y,u)),d=(u,y)=>{let g=c(u),T=y?g[g.length-1]:g[0];T?T.focus({preventScroll:!0}):(u.hasAttribute("tabindex")||(u.tabIndex=-1),u.focus({preventScroll:!0}))},h=null,m=!0;return{scrim:i,frame:s,trapKeys(u){let y=g=>{if(g.key==="Tab"){if(g.defaultPrevented)return;let T=a(),S=c(T),k=S[0],E=S[S.length-1],L=document.activeElement;!k||!E?(g.preventDefault(),d(T,g.shiftKey)):L===T||!L||!T.contains(L)?(g.preventDefault(),(g.shiftKey?E:k).focus({preventScroll:!0})):g.shiftKey&&L===k?(g.preventDefault(),E.focus({preventScroll:!0})):!g.shiftKey&&L===E&&(g.preventDefault(),k.focus({preventScroll:!0}));return}g.key==="Escape"&&u(g)};return h=y,document.addEventListener("keydown",y),y},onScrimPress(u){i.addEventListener("mousedown",y=>{y.target===i&&u()})},focusFirst(){d(a(),!1)},teardown(u=!0){m&&(m=!1,r(),document.body.style.overflow=o,h&&document.removeEventListener("keydown",h),h=null,i.remove(),u&&t?.isConnected&&t.focus({preventScroll:!0}))}}}function rl(n,e){let t=new Set(["chart","objects","resume","availability"]),i=new Map;return new Proxy(Object.create(n),{get(s,o){let r=n,a=Reflect.get(r,o,r);return typeof a!="function"?a:(i.has(o)||i.set(o,t.has(String(o))?async(...l)=>{let c=await Gt(()=>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(o))}})}import{PickerController as Lf,effectiveFloorOverview as Mf,formatMoney as Hf,getLocale as ys,loadLocale as Rf,setStringOverrides as If,t as N,tCount as on,seatPriceFor as Dd}from"@seatlayer/core";import{isAuthoredSeatView as Of,seatViewDisclosure as _f}from"@seatlayer/core/view3d/crossfade/panorama";function al(n){return!!n&&n.clientWidth>0&&n.scrollWidth>n.clientWidth+1}function Ju(n){return n.some(e=>al(e))}var Ji="data-fit-gone",em=12;function so(n,e,t=al){if(!n)return 0;for(let i of e)n.classList.remove(i.cls);if(n.querySelectorAll(`[${Ji}]`).forEach(i=>{i.removeAttribute(Ji),i.hidden=!1}),n.dataset.fit="0",n.clientWidth<=0||!t(n))return 0;for(let i=0;i<e.length;i+=1){let s=e[i];i>0&&n.classList.remove(e[i-1].cls),n.classList.add(s.cls),n.dataset.fit=String(i+1);let o=s.give?s.give(n):!0;if(!t(n))return i+1;if(s.repeat&&s.give){for(let r=1;o&&r<em;r+=1)if(o=s.give(n),!t(n))return i+1}}return e.length}function tm(n,e="[data-fit-seg]"){let t=[...n.querySelectorAll(e)].filter(i=>!i.hidden);return t.length<2?!1:ll(t[t.length-1])}function nm(n,e){let t=n.querySelector(e);return t&&!t.hidden?ll(t):!1}function ll(n){let e=n.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(Ji,""),e.hidden=!0),n.setAttribute(Ji,""),n.hidden=!0,!0}function im(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 cl(n){if(!n)return 0;let e=n.querySelector(".sl-confirm-cancel"),t=n.querySelector(".sl-confirm-add-t");return so(n,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>im(e)}],()=>Ju([e,t]))}function dl(n){return so(n,[{cls:"sl-fit-notype",give:e=>nm(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>tm(e),repeat:!0}])}function pl(n){return n?(n.classList.add("sl-fitpill"),so(n,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var tn;function hl(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(tn===void 0)try{tn=document.createElement("canvas").getContext("2d")}catch{tn=null}if(!tn)return!1;let i=getComputedStyle(n);tn.font=`${i.fontStyle} ${i.fontWeight} ${i.fontSize} ${i.fontFamily}`;let s=tn.measureText(e).width,o=(parseFloat(i.paddingLeft)||0)+(parseFloat(i.paddingRight)||0)+(parseFloat(i.borderLeftWidth)||0)+(parseFloat(i.borderRightWidth)||0);return s+o<=t?!1:(n.dataset.fit="row",!0)}function sm(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 om=["on-sale","low","sold-out","presale","closed"];function _n(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function oo(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function ul(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 s=e.remaining;if(s!=null&&(typeof s!="number"||!Number.isInteger(s)||s<0))return;let o={index:i,count:t,remaining:s??null};if(e.pricingMode!==void 0){if(e.pricingMode!=="matrix")return;o.pricingMode="matrix"}if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;o.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;o.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;o.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let r of["startsAt","endsAt"]){if(e[r]===void 0)continue;let a=oo(e[r]);if(a===void 0)return;o[r]=a}return o}function rm(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():"",y=m.tierId===null?null:typeof m.tierId=="string"&&m.tierId.trim()?m.tierId.trim():void 0,g=_n(m.price);if(!u||y===void 0||g===void 0||g===null)return;let T=`${u}\0${y??""}`;if(d.has(T))return;d.add(T),c.push({categoryKey:u,tierId:y,price:g})}i.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let s=[],o=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||o.has(l)||!i.has(c))return;o.add(l),s.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:s}}function ro(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=om.find(h=>h===e.state);if(!t)return null;let i=_n(e.fromPrice),s=_n(e.previousPrice);if(i===void 0||s===void 0)return null;let o=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(o===void 0)return null;let r=ul(e.release);if(r===void 0)return null;let a=e.upcoming===void 0?null:ul(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,y=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!y)return null;let g=_n(u.price),T=_n(u.previousPrice);if(g==null||T===void 0)return null;let S={categoryKey:y,price:g,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 k of["startsAt","endsAt"]){if(u[k]===void 0)continue;let E=oo(u[k]);if(E===void 0)return null;S[k]=E}h.push(S)}l=h}let c=rm(e.channelPricing);if(c===void 0)return null;let d=oo(e.nextPriceChangeAt);return d===void 0?null:{state:t,fromPrice:i,previousPrice:s,currency:o,release:r,upcoming:a,prices:l,channelPricing:c,...e.nextPriceChangeAt!==void 0?{nextPriceChangeAt:d}:{},...e.bookingFee!==void 0?{bookingFee:sm(e.bookingFee)}:{}}}function ml(n){return n?.changed!==!1}function fl(n,e){if(!n)return null;let t=null,i=s=>{s!=null&&s>e&&(t===null||s<t)&&(t=s)};for(let s of[n.release,n.upcoming])i(s?.startsAt),i(s?.endsAt);for(let s of n.prices)i(s.startsAt),i(s.endsAt);return i(n.nextPriceChangeAt),t}function gl(n){let e={};for(let t of n?.prices??[])if(t.tierId==null)e[t.categoryKey]=t.price;else{let i=e[t.categoryKey],s=typeof i=="number"?{base:i}:i??{};e[t.categoryKey]={...s,tiers:{...s.tiers,[t.tierId]:t.price}}}return e}function bl(n,e){let t={...n};for(let[i,s]of Object.entries(gl(e))){let o=t[i];t[i]=typeof s=="number"?s:{...typeof o=="number"?{base:o}:o,...s,tiers:{...typeof o=="object"?o.tiers:{},...s.tiers}}}return t}import{fromMinorUnits as am,t as yl}from"@seatlayer/core";var lm={seat:()=>"",tray:n=>wl(n)?xl():""};function vl(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 wl(n){return n.some(e=>(e.bookingFeeMinor??0)>0)}function xl(){return` \xB7 ${yl("picker.fee.included")}`}function kl(n,e,t){return n?{seat:i=>i>0?yl("picker.fee.includesAmount",{amount:t(am(n.amountMinor,e))}):"",tray:(i,s,o)=>{let r=i.reduce((a,l)=>a+(l.quantity??1),0);return wl(i)||s>r&&o>0?xl():""}}:lm}function Sl(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 cm}from"@seatlayer/core";var Tl="maintenance_mode";function dm(n){if(!n||typeof n!="object")return!1;let e=n;return e.reason===Tl||e.code===Tl}function pm(n){return typeof n!="number"||!Number.isFinite(n)||n<0?null:Math.max(1,Math.ceil(n/60))}function ao(n){if(!dm(n))return null;if(typeof n.notice=="string"&&n.notice.trim())return n.notice.trim();let e=pm(n.retryAfterS);if(e===null)return v("picker.maintenancePausedShortly","Booking is paused for a few minutes for maintenance. Please try again shortly.");let t=cm("picker.maintenancePaused",e);return t==="picker.maintenancePaused"?`Booking is paused for maintenance. Please try again in about ${e} minute${e===1?"":"s"}.`:t}var El=["pointerdown","pointermove","keydown","wheel","touchstart"],es=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 El)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 El)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,s)=>setTimeout(i,s));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 Cl(n,e){let t=await n.pubApi?.pickerIdleMinutes().catch(()=>null)??null;if(n.destroyed||n.idleClock)return;let i=new es({minutes:t??30,blocked:()=>!!n.hold,onIdle:()=>Al(n)});i.enabled&&(n.idleClock=i,i.attach(e))}function Al(n){n.destroyed||!n.root||n.holdExpiredEl||(n.realtime?.stop(),n.realtime=null,n.showAccessPanel({reason:"idle",retryable:!0}))}async function Pl(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 Ll(n){if(!n.destroyed){if(n.hold||n.idleClock?.recentlyActive()){n.pubApi?.rotateViewerId(),n.realtime?.restart();return}Al(n)}}import{t as lo}from"@seatlayer/core";function Ml(n,e,t=[],i=8,s=[]){let o=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),o>0?i:0),a=s.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(o)),right:Math.max(0,Math.ceil(a)),bottom:Math.max(0,Math.ceil(r)),left:0}}function Hl(n){let e=document.createElement("div");e.className="sl-floors sl-levels on",e.setAttribute("role","group"),e.setAttribute("aria-label",lo("picker.chooseLevel")),e.title=lo("picker.floorHelp");let t=n.tf("picker.allLevels","All levels"),i=[...n.floors.map((s,o)=>({id:s.id,name:s.name,code:hm(o)})).reverse(),{id:"",name:t,code:""}];for(let s of i){let o=document.createElement("button");if(o.type="button",o.className="sl-level",o.dataset.level=s.id,o.setAttribute("aria-pressed","false"),o.title=s.name,s.code){let a=document.createElement("b");a.className="sl-level-code",a.textContent=s.code,o.appendChild(a),o.setAttribute("aria-label",`${s.name} (${s.code})`)}let r=document.createElement("span");if(r.className="sl-level-name",r.textContent=s.name,o.appendChild(r),!s.code){let a=document.createElement("span");a.className="sl-level-short",a.setAttribute("aria-hidden","true"),a.textContent=lo("picker.allLevelsShort"),o.appendChild(a)}o.addEventListener("click",()=>n.onChoose(s.id)),e.appendChild(o)}return e.addEventListener("keydown",s=>{if(s.key!=="ArrowUp"&&s.key!=="ArrowDown")return;let o=[...e.querySelectorAll(".sl-level")],r=o.indexOf(document.activeElement);r<0||(s.preventDefault(),o[Math.max(0,Math.min(o.length-1,r+(s.key==="ArrowUp"?-1:1)))].focus())}),e}function hm(n){return n===0?"G":String(n)}function Rl(n,e,t){if(!n)return;let i=t?"":e;for(let s of n.querySelectorAll(".sl-level"))s.setAttribute("aria-pressed",String(s.dataset.level===i))}var ts=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 s=this.host.activeFloorObjects().find(k=>k.type==="section"&&k.id===t.id)?.outline;if(!s||s.length<3)return 0;let o=s.map(k=>this.host.controller.worldToScreen(k)),r=o.map(k=>k.x),a=o.map(k=>k.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(),y=u.left-m.left,g=u.top-m.top,T=Math.max(0,Math.min(y+u.width,l+d)-Math.max(y,l)),S=Math.max(0,Math.min(g+u.height,c+h)-Math.max(g,c));return T*S/(d*h)}};import{t as fo,tCount as Em}from"@seatlayer/core";import{contrastRatio as Cm}from"@seatlayer/core/core/color";import{t as Ae,tCount as Dn}from"@seatlayer/core";function co(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 ns=(n,e)=>co(n,e,{dateStyle:"medium"}),is=(n,e)=>co(n,e,{timeStyle:"short"}),nn=(n,e)=>co(n,e,{weekday:"short",day:"numeric",month:"short"});function Il(n,e,t,i){return!n.length||n.length>=e?null:{summary:i,labels:n.map(s=>`${ns(s,t)} \xB7 ${is(s,t)}`)}}function um(n,e){let t=new Set(e);return n.map(i=>({...i,free:!t.has(i.eventKey)}))}function Ol(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 mm(n,e,t="",i=!1){if(!n.length)return"";let s=n.map(o=>{let r=o.free?e.free:e.blocked,a=i&&o.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${A(o.eventKey)}" aria-label="${A(`${o.shortDate}: ${r}`)}" checked>`:"";return`<li class="sl-night${o.free?" ok":" no"}" aria-label="${A(`${o.shortDate}: ${r}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${A(o.shortDate)}</span><span class="st">${A(r)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${A(e.title)}</div><ul class="sl-nightstrip">${s}</ul><p class="sl-tip-nights-note">${A(e.notAvailableOn)}</p>`+t+"</div>"}function fm(n){return n.selectPartialLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${A(n.selectPartialLabel)}</button>`:n.switchLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${A(n.switchLabel)}</button>`:n.switchLabel||n.selectPartialLabel?"":`<p class="sl-tip-advice">${A(n.advice)}</p>`}function gm(n){return Number(n.available)+Number(n.selected)+Number(n.partial)+Number(n.unavailable)}function _l(n,e,t){if(gm(n)<2)return"";let i=(o,r,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${o}"${a}></i>${A(r)}</li>`,s=[];return n.available&&s.push(i("sl-pg-sw-free",e.available,` style="background:${A(t)}"`)),n.selected&&s.push(i("sl-pg-sw-sel",e.selected)),n.partial&&s.push(i("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${A(t)}"`)),n.unavailable&&s.push(i("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${A(e.title)}">${s.join("")}</ul>`}function Dl(n,e){if(!n.length)return"";let t=n.map(i=>{let s=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="${A(i.eventKey)}"><span class="n">${A(i.name)}</span><span class="s">${A(s)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${A(e.title)}"><div class="sl-pg-nights-title">${A(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function po(n,e){if(n?.kind!=="partial"||!e?.length)return null;let t=n.data?.blockedEventKeys??[],i=um(e,t);return{states:i,missing:i.filter(s=>!s.free).map(s=>s.shortDate)}}function Nl(n,e){return n?mm(n.states,{title:e.words?.title??v("picker.group.partlyAvailableTitle","Free on some nights only"),free:v("picker.group.nightFree","Free"),blocked:v("picker.group.nightBlocked","Not available"),notAvailableOn:Ae("picker.group.notAvailableOn",{dates:Ol(n.missing,e.locale)})},fm({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:e.words?.advice??v("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function bm(n,e,t,i){if(!n.length)return"";let s=new Set(e),o=new Set(t),r=n.map(a=>{let l=s.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${A(a.eventKey)}" aria-label="${A(`${a.shortDate}: ${l?i.available:i.unavailable}`)}"${l&&o.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${A(a.shortDate)}</span><span class="sl-confirm-date-state">${A(l?i.available:i.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${A(i.title)}</legend><p class="sl-confirm-dates-copy">${A(i.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${A(i.selectAll)}</span></label><ul>${r}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function Bl(n,e,t,i){let s=e.availableEventKeys(t);return bm(n,s,e.includedEventKeys(),{title:Ae("picker.group.confirmDatesTitle"),copy:s.length===n.length?Ae("picker.group.confirmAllDatesCopy").replace("{count}",String(n.length)):Ae("picker.group.confirmPartialDatesCopy").replace("{available}",String(s.length)).replace("{total}",String(n.length)),selectAll:Ae("picker.group.confirmSelectAll"),available:i("picker.group.nightFree","Available"),unavailable:i("picker.group.nightBlocked","Unavailable")})}function Fl(n){return[...n.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function Vl(n,e,t){let i=[...n.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!i.length)return;let s=n.querySelector(".sl-confirm-add"),o=n.querySelector("[data-pg-confirm-all]"),r=()=>{let a=i.filter(d=>!d.disabled),l=Fl(n).length;o&&(o.checked=l===a.length,o.indeterminate=l>0&&l<a.length);let c=n.querySelector("[data-pg-confirm-summary]");c&&(c.textContent=l===a.length?Ae("picker.group.confirmAllSelected").replace("{count}",String(l)):Ae("picker.group.confirmSelectedOfAvailable").replace("{selected}",String(l)).replace("{available}",String(a.length))),s.disabled=l===0,s.textContent=l?e.label(l):Ae("picker.group.confirmChooseOne"),t()};i.forEach(a=>a.addEventListener("change",r)),o?.addEventListener("change",()=>{i.filter(a=>!a.disabled).forEach(a=>{a.checked=o.checked}),r()}),r()}async function $l(n,e,t){if(!n||!t||!n.querySelector("[data-pg-confirm-event-key]"))return!0;let i=Fl(n);if(!i.length)return!1;let s=n.querySelector(".sl-confirm-add");return s?.setAttribute("aria-busy","true"),s&&(s.disabled=!0),await t.apply(e,i)?!0:(s?.removeAttribute("aria-busy"),s?.isConnected&&(s.disabled=!1),!1)}function zl(n,e,t,i=!1){if(!n)return"";let s={label:e,free:n.states.length-n.missing.length,total:n.states.length,dates:Ol(n.missing,t)};return i?Ae("picker.season.seatPartlyAvailable",s):Ae("picker.group.seatPartlyAvailable",s)}function jl(n,e){let t=n.map((i,s)=>{let o=i.state==="done"?e.done:i.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${A(i.id)}" data-state="${A(i.state)}"${i.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${i.state==="done"?"\u2713":String(s+1)}</span><span class="l">${A(i.label)}</span><span class="sl-pg-sr">${A(o)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${A(e.label)}">${t}</ol>`}function ho(n,e){return`<ul class="sl-pg-cards">${n.map(i=>`<li class="sl-pg-card" data-event-key="${A(i.eventKey)}"><span class="n">${A(i.name)}</span><time datetime="${A(i.iso)}"><span class="d">${A(i.date)}</span><span class="t">${A(i.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${A(e)}</p>`}function Gl(n){let e=n.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${A(t.eventKey)}"><span class="n">${A(t.name)}</span><span class="s">${A(t.labels.length?t.labels.join(", "):n.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${A(n.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(n.note?`<p class="sl-pg-pane-note">${A(n.note)}</p>`:"")+(n.total?`<div class="sl-pg-pane-total"><span>${A(n.total.label)}</span><b>${A(n.total.amount)}</b></div>`:"")+(n.holdStatus?`<p class="sl-pg-hold-status" role="status">${A(n.holdStatus)}</p>`:"")}function Kl(n){let e=Math.max(0,n);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function Ul(n,e,t=!1){if(!n||n.seats<=0)return"";if(e==="same_seat"){let i=n.perPerformance??n.seats;return n.totalPerformances&&n.performances<n.totalPerformances?Dn("picker.group.performancesChosenOf",i,{chosen:n.performances,total:n.totalPerformances}):t?Dn("picker.season.seatsEveryDate",i):Dn("picker.group.seatsEveryPerformance",i)}return n.perPerformance!=null&&n.performancesChosen===n.performances?Dn("picker.group.seatsPerPerformance",n.seats,{per:n.perPerformance}):Dn("picker.group.performancesChosenOf",n.seats,{chosen:n.performancesChosen,total:n.performances})}function ql(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",s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),i())})})}function Ve(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function ym(n,e){let t=n.objectType==="table"&&!!n.bookingMode,i=n.objectType==="booth",s=t||i||!n.seatNumber,o=s?n.rowLabel??n.displayLabel??n.label:n.seatNumber,r=t?`${v("picker.guests","Guests")} ${n.bookingMode==="variable"?`${n.minOccupancy}\u2013${n.maxOccupancy}`:n.capacity}`:!i&&n.rowLabel?`${e} ${J(n)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${s?" name":""}">${Ve(o)}</span>`+(r?`<span class="sl-tip-row">${Ve(r)}</span>`:"")+"</div>"+(n.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${v("picker.section","Section")}</span><span class="sl-tip-secname">${Ve(n.sectionLabel)}</span></div>`:"")+"</div>"}function Wl(n,e){let t=n.status==="not_for_sale",i=n.mark?.kind==="partial",s=n.status==="free"||i?"":`<span class="sl-tip-tag">${e.ownHold?v("picker.heldForYou","Held for you"):v("picker.group.legendUnavailable","Unavailable")}</span>`,o=t?"":e.price,r=o?`<span class="sl-tip-amt">${Ve(o)}</span>`:"",a=!o&&e.priceNote?`<div class="sl-tip-note">${Ve(e.priceNote)}</div>`:"",l=o&&e.feeNote?`<div class="sl-tip-fee">${Ve(e.feeNote)}</div>`:"",c=gt(n,{compact:!0}),d=e.reason?`<div class="sl-tip-reason">${Ve(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+ym(n,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${Ve(n.categoryColor)}"></span><span class="sl-tip-name">${Ve(n.categoryLabel)}</span>`+s+r+"</div>"+l+a+d+c+(e.extra??"")}function Yl(n,e,t,i){let s=n.x+14,o=n.y-i.height-12,r=n.y+18,a=o;s+i.width>e-8&&(s=n.x-i.width-14),o<8&&r+i.height<=t-8&&(a=r);let l=Math.max(8,t-i.height-8);return{left:Math.max(8,Math.min(s,Math.max(8,e-i.width-8))),top:Math.max(8,Math.min(a,l))}}function Zl(n,e,t,i=22){let s=Math.max(8,Math.min(n.x-t.width/2,Math.max(8,e.width-t.width-8))),o=n.y-i-t.height,r=n.y+i;return o>=8?{left:s,top:o,placement:"above"}:r+t.height<=e.height-8?{left:s,top:r,placement:"below"}:{left:s,top:Math.max(8,Math.min(o<8?r:o,Math.max(8,e.height-t.height-8))),placement:o<8?"below":"above"}}var uo=14,vm=12,wm=12,xm=8;function Ql(n,e,t,i=vm){let s=e.height-uo-t.height,o=wm,r=s-i;if(r<=o)return{placement:"sheet",nudgeY:0};let a=(o+r)/2-n;return Math.abs(a)<=xm?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function Xl(n,e,t,i,s=0){let o=t.width/2+12,r=Math.max(o,Math.min(e.width-o,n.x)),a=n.y+s+t.height+24<=e.height,l=n.y-s<t.height+24&&a?"below":"above",c=l==="above"?n.y-s:n.y+s,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 Jl(n,e,t){let i=n.querySelector("[data-pg-select-partial]"),s=[...n.querySelectorAll("[data-pg-event-key]")],o=()=>s.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),r=()=>{if(!i)return;let a=o().length;i.disabled=a===0,i.textContent=e?.(a)??i.textContent};s.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=o();a.length&&t?.(a)})}function Je(n){let e=n?.displayType?.trim()||n?.rowType?.trim();return e||(n?.objectType==="table"?v("picker.table","Table"):n?.objectType==="booth"?v("picker.booth","Booth"):v("picker.row","Row"))}var km="sl-confirm-scrim",Sm="--sl-scrim-mask";function Tm(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 ec(n,e,t,i){let s=n??document.createElement("div");return n||(s.className=km),s.style.setProperty(Sm,Tm(i)),t.parentNode===e?s.nextSibling!==t&&e.insertBefore(s,t):s.parentNode!==e&&e.appendChild(s),s}function mo(n){return n?.remove(),null}var tc={passport:!1,compare:!1},Am=360,Pm=160,Lm=700,nc=450,Mm=8;function ic(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function Hm(n){return Cm("#ffffff",n)>=3?"#ffffff":"#0b0f19"}var ss=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.closedByThisPress=null;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=Xt(e)?e.viewUrl??"":"",s=Yi(t);if(!i&&!s)return"";let o=i?null:Zi(e,e.focalPoint??t.focalPoint);if(!i&&o==null)return"";let r="";if(!i)return r;let a=F(fo("picker.viewFromSeat",{label:e.label})),l=F(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;if(t==="remove"&&this.closedByThisPress===e.id){this.closedByThisPress=null;return}if(t==="remove"&&i.performanceGroup()&&i.controller.currentHold()?.labels.includes(e.label))return;let s=this.mode==="remove"?void 0:this.seat?.id;this.mode=t,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(I=>I.toggleAttribute("inert",!0)),i.controller.setSelectionFocus(e.id),s&&s!==e.id&&i.controller.deselect([s]),i.hideTooltip();let o=i.controller.seatDetails(e.id),r=i.controller.doc?.categories.find(I=>I.key===e.categoryKey),a=o?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),l=a!=null?i.paidPrice(e.categoryKey,o?.tierId??r?.tiers?.[0]?.id??null,a,e.label):void 0,c=Fr(o,e.displayLabel??e.label,Je(o)),d=o?.tiers??r?.tiers??[],h=o?.tierId??d[0]?.id,m=i.suppressPricing()?"":xi(d,h,I=>i.money(i.paidPrice(e.categoryKey,I.id,I.price,e.label)),I=>i.offerName(e.categoryKey,I.id)),u=i.buyerView()==="venue3d",y=i.performanceGroup()?.confirmDateSelection??void 0,g=y?i.performanceGroup()?.nights?.()??[]:[],T=y?Bl(g,y,e.id,(I,q)=>i.tf(I,q)):"";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 k=i.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??r?.color??"#6e7bff";S.style.setProperty("--sl-cat",k),S.style.setProperty("--sl-cat-ink",Hm(k));let E=String(o?.categoryLabel??r?.label??e.categoryKey),L=i.controller.categoryAvailability()[e.categoryKey],U=typeof L=="number"&&L>0?Em("picker.leftCount",L):"",O=i.packagePrice?.(e.categoryKey)??null,f=i.suppressPricing()?`${o?.displayLabel??e.displayLabel??e.label}`:`${o?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?i.tf("picker.priceNotSupplied","Price not supplied"):i.money(l)}`,R=tc.passport?Br(e,f,u):"",M=tc.compare?Nr(e,u?i.view3dCompareSeatIds():null):"";S.innerHTML=jr({identityFields:c,identity:Vr(o,e.displayLabel??e.label,Je(o)),marker:Dr({...o?.wheelchairSpaceType?{wheelchairSpaceType:o.wheelchairSpaceType}:{}}),see3dPill:$r(i.canOffer3d(),u),categoryColor:k,categoryLabel:E,priceLabel:O?O.price:!i.suppressPricing()&&l!=null?i.money(l):"",feeNote:O?O.note:!i.suppressPricing()&&l!=null?i.feeNote?.(l)??"":"",categoryLeftLabel:U,tierChoices:m,groupDates:T,wheelchair:"",commercial:gt({...e.accessibility?.length?{accessibility:e.accessibility}:{},...o?.wheelchairSpaceType?{wheelchairSpaceType:o.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{},...o?.aisle?{aisle:!0}:{},...o?.boothType?{boothType:o.boothType}:{},...o?.entrance?{entrance:o.entrance}:{}}),thumb:i.seatViewEnabled()&&i.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:u?`<div class="sl-confirm-inspect-row">${R}${M}${Fs(i.canOffer3d(),u)}</div>`:Fs(i.canOffer3d(),u),see3dRow:zr(i.canOffer3d(),u),cancelLabel:fo("common.cancel"),selectLabel:t==="remove"?i.tf("picker.removeSeat","Remove seat"):i.addSeatLabel(o?.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 _=S.querySelector(".sl-confirm-thumb"),D=_?.closest(".sl-confirm-thumbwrap")??null;if(_&&D){let I=!1,q=()=>{if(I||!D.isConnected)return;I=!0;let X=()=>{D.remove(),this.el===S&&i.reanchor()};if(i.reducedMotion()||typeof requestAnimationFrame!="function"){X();return}D.style.height=`${D.offsetHeight}px`,D.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{D.style.height="0px",D.style.opacity="0"}),setTimeout(X,Pm)};_.addEventListener("error",q),_.addEventListener("load",()=>{_.naturalWidth||q()});let Y=e.viewMeta?.previewUrl??e.viewUrl;Y?i.resolveAssetUrl(Y).then(X=>{if(!(!S.isConnected||this.el!==S)){if(!X){q();return}_.src=X}}).catch(X=>{q(),i.onError(X)}):q()}i.reanchor(),this.liftSeatClearOfSheet(e),S.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{i.openSeatView(e)}),S.querySelector(".sl-confirm-confidence")?.addEventListener("click",I=>{i.openSeatConfidencePassport(e,I.currentTarget instanceof HTMLElement?I.currentTarget:null)}),S.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>i.saveView3dComparisonSeat(e)),S.querySelectorAll("[data-confirm-tier]").forEach(I=>{I.addEventListener("click",()=>{let q=I.dataset.confirmTier,Y=d.find(be=>be.id===q);if(!Y)return;i.controller.setSeatTier(e.id,Y.id),S.querySelectorAll("[data-confirm-tier]").forEach(be=>{be.setAttribute("aria-pressed",String(be===I))});let X=S.querySelector(".sl-confirm-price"),fe=i.paidPrice(e.categoryKey,Y.id,Y.price,e.label);X&&(X.textContent=i.money(fe));let ge=S.querySelector(".sl-confirm-fee");ge&&(ge.textContent=i.feeNote?.(fe)??""),i.reanchor()})}),S.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(I=>{I.addEventListener("pointerdown",fi,{once:!0}),I.addEventListener("click",()=>{i.buyerView()==="venue3d"?(i.dismiss(),i.view3dHandle()?.flyToSeat(e.id)):(i.rememberView3dReturnSeat(e),i.dismiss(),i.enter3d(e.id))})}),Vl(S,y,()=>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 I=S.querySelector(".sl-confirm-add");I?.focus(),i.liftToastOverConfirm(),i.fitTranslatedRows(),i.inviteCommit(S,I)})}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 s=t.els().map;if(!s)return;let o=t.controller.worldToScreen({x:e.x,y:e.y}),r=t.controller.getRenderer(),a=r?.getCameraGestureCount?.()??0,{nudgeY:l}=Ql(o.y,{height:s.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()+Lm: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=ec(this.scrim,i,this.el,t),ya(this.el,t,i),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=mo(this.scrim);let s=i.clientWidth,o=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=Xl(t,{width:s,height:o},{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`,Ni(this.el,t,{left:d.left,top:d.top,width:r,height:a})}ghostActivation(){return ic()?performance.now()-this.shownAt<nc:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,i=new Map,s=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)<=Mm&&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=s;let o=t.root();setTimeout(()=>{this.outsideTap===s&&((o??document).addEventListener("pointerdown",s,!0),(o??document).addEventListener("pointerup",s,!0),(o??document).addEventListener("pointercancel",s,!0))},ic()?nc: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&&Bi(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 s=this.el?.querySelector(".sl-confirm-add")??null;if(s?.classList.contains("is-adding")||!await $l(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let o=()=>{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(!s||e.reducedMotion()){o();return}s.classList.remove("sl-confirm-add-invite"),s.classList.add("is-adding"),s.setAttribute("aria-disabled","true");let r=s.querySelector(".sl-confirm-add-t");r&&(r.textContent=e.tf("picker.added","Added")),e.scheduleMotion(o,Am)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"?e.controller.deselect([t.id]):(this.closedByThisPress=t.id,setTimeout(()=>{this.closedByThisPress=null},0)),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 sc(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 oc(n,e){return n&&n!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}import{t as go}from"@seatlayer/core";var Rm=12;function rc(n,e){let t=e.floors(),i=new Set(t.map(O=>O.label.trim().toLocaleLowerCase())),s=e.zones().filter(O=>O.seatCount>0&&!i.has(O.label.trim().toLocaleLowerCase())),o=e.sections().filter(O=>O.seatCount>0&&!i.has(O.label.trim().toLocaleLowerCase())),r=s.length>1?[]:o,a=t.length>1,l=s.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>',y=document.createElement("span");m.innerHTML=u,m.appendChild(y);let g=()=>{for(let O of d.querySelectorAll(":scope > div")){let f=O.querySelector('[aria-pressed="true"]');!f||O.scrollWidth<=O.clientWidth||f.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(h)return h;for(let O of d.querySelectorAll(":scope > div")){let f=O.querySelector('button[aria-pressed="true"]'),R=f?.textContent?.trim();if(R&&f?.dataset.floor!=="")return R}return a&&(l||c)?v("picker.levelsAndAreas","Levels & zones"):a?v("picker.levels","Levels"):v("picker.areas","Zones")},S=O=>{d.classList.toggle("is-open",O),m.setAttribute("aria-expanded",String(O)),O&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(g),y.textContent=T()};m.addEventListener("click",()=>S(!d.classList.contains("is-open"))),d.addEventListener("keydown",O=>{O.key!=="Escape"||!d.classList.contains("is-open")||(O.preventDefault(),O.stopPropagation(),S(!1),m.focus())});let k=document.createElement("button");k.type="button",k.className="sl-view3d-nav-close",k.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let E=v("picker.closeVenueNavigation","Close venue navigation");k.setAttribute("aria-label",E),k.title=E,k.addEventListener("click",()=>{S(!1),m.focus()}),S(!1),d.appendChild(m);let L=O=>{},U=O=>{};if(a){let O=document.createElement("div");O.setAttribute("role","group"),O.setAttribute("aria-label",v("picker.levels","Levels"));let f=[];U=_=>{f.forEach(D=>{D.setAttribute("aria-pressed",String((D.dataset.floor===""?null:Number(D.dataset.floor))===_))})};let R=_=>{e.focusFloor(_)&&(U(_),L(_))},M=(_,D)=>{let I=document.createElement("button");I.type="button",I.textContent=_,I.dataset.floor=D===null?"":String(D),I.setAttribute("aria-pressed",String(D===null)),I.addEventListener("click",()=>{R(D),S(!1)}),f.push(I),O.appendChild(I)};M(v("picker.allLevels","All levels"),null);for(let _ of t)M(_.label||go("picker.levelNumber",{number:_.index+1}),_.index);d.appendChild(O)}if(l||c){let O=document.createElement("div");O.setAttribute("role","group"),O.setAttribute("aria-label",v("picker.areas","Zones"));let f=l?s.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)&&U(M.floorIndex)}})),R=M=>{let _=l||M===null?f:f.filter(D=>D.floorIndex===void 0||D.floorIndex===M);if(O.replaceChildren(),!_.length){O.remove();return}if(O.isConnected||d.insertBefore(O,k.isConnected?k:null),!l&&_.length>Rm){let D=document.createElement("select");D.setAttribute("aria-label",v("picker.jumpToSection","Jump to section"));let I=document.createElement("option");I.value="",I.textContent=v("picker.jumpToSection","Jump to section"),D.appendChild(I);for(let q of _){let Y=document.createElement("option");Y.value=q.id,Y.textContent=q.label,D.appendChild(Y)}D.addEventListener("change",()=>{_.find(q=>q.id===D.value)?.go()}),O.appendChild(D);return}for(let D of _){let I=document.createElement("button");I.type="button",I.textContent=D.label,I.dataset.area=D.id,I.addEventListener("click",()=>{h=D.label,D.go(),S(!1)}),O.appendChild(I)}};L=R,R(null)}return d.appendChild(k),n.appendChild(d),d}var os=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",v("picker.savedSeatComparison","Saved seat comparison"));let o=document.createElement("button");o.type="button",o.className="main",o.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(v("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",v("picker.clearSavedSeatComparison","Clear saved seat comparison")),r.addEventListener("click",()=>this.host.clearComparison()),t.append(o,r),e.appendChild(t),this.chip=t}let i=this.host.savedSeatIds().length,s=t.querySelector(".main");s&&(s.textContent=i>1?go("picker.compareCount",{count:i}):v("picker.oneSeatSaved","1 seat saved"),s.setAttribute("aria-label",i>1?go("picker.openComparisonOfSeats",{count:i}):v("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function ac(n){return!n?.querySelector('[data-ref="zfs"]')}var lc="sl:sheet-hint";function cc(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"),Im(n.root)},700)}function Im(n){if(!n||n.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(lc))return;window.sessionStorage.setItem(lc,"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 dc(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 as(n){let e=n.committedSelection(),t=n.controller.getGAAreas(),i=n.hold?.items??[],s=new Set(i.map(m=>m.label)),o=Ea(n,t,i),r=Ne(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=>!s.has(m.label)),d=c.reduce((m,u)=>m+n.paidPrice(u.categoryKey,u.tierId??null,u.price,u.label)*(u.quantity??1),0)+o+a,h=c.reduce((m,u)=>m+(u.quantity??1),0)+r+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:i,heldLabels:s,heldCount:l,total:d,count:h}}function ls(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 cs(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 s of i)s.categoryKey===e.key&&t.push(s.price);t.push(...Om(n).get(e.key)??[])}return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var rs=null;function Om(n){let e=n.controller.doc,t=n.hostObjectPrices();if(rs?.doc!==e||rs.host!==t){let i=new Map;for(let[s,o]of Object.entries({...e?.seatPrices,...t})){let r=n.controller.seatByLabel(s)?.categoryKey??n.controller.tableSelection(s)?.categoryKey;r&&(i.has(r)||i.set(r,[]),i.get(r).push(...typeof o=="number"?[o]:Object.values(o.tiers)))}rs={doc:e,host:t,spread:i}}return rs.spread}var Nn="seatlayer_";function _m(){let n=globalThis;return n.document?.modelContext??n.navigator?.modelContext??null}function ue(n,e){return e?{ok:!1,reason:n,message:e}:{ok:!1,reason:n}}function Dm(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&!!e):[]}function Nm(n,e){let t=n.event();if(!t)return ue("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 pc(n,e){let t=s=>!!s&&s.toLowerCase()===e.toLowerCase(),i=n.find(s=>t(s.key??s.id))??n.find(s=>t(s.label));return i?.key??i?.id??null}function hc(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,s)=>t[s]?.seat||i.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((i,s)=>i+s.price,0)}}function Bm(n,e,t){let i=new Map;for(let o of e){let r=i.get(o.rowKey);r?r.push(o):i.set(o.rowKey,[o])}let s=[];for(let o of i.values()){let r=[...o].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)s.push(hc(n,r.slice(d,d+t)));a=l}}return s}function Fm(n,e,t){let i=new Map;for(let o of e){let r=i.get(o.sectionKey);r?r.push(o):i.set(o.sectionKey,[o])}let s=[];for(let o of i.values()){if(o.length<t)continue;let r=[...o].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);s.push(hc(n,r.slice(0,t)))}return s}function Vm(n,e){if(!n.event())return ue("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits(),s=Math.floor(Number(e.count));if(!Number.isInteger(s)||s<1||s>i.max)return ue("bad_count",`count must be a whole number between 1 and ${i.max}.`);let o=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?pc(n.categories(),l):null;if(l&&!d)return ue("no_match",`No ticket type called "${l}".`);if(d&&n.categories().find(g=>g.key===d)?.available===0)return ue("sold_out",`"${l}" is sold out.`);let h=c?pc(n.zones(),c):null;if(c&&!h)return ue("no_match",`No zone called "${c}".`);let m=n.seats().filter(g=>g.available);if(!m.length)return ue("sold_out");let u=m.filter(g=>(!d||g.categoryKey===d)&&(!h||g.zoneId===h)&&(a==null||g.price<=a));if(!u.length)return ue("no_match");let y=r?Bm(n,u,s):Fm(n,u,s);return y.length?(y.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:y.slice(0,o),searched:{count:s,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...h?{zone:h}:{},together:r}}}):ue(r?"not_enough_together":"no_match")}function uc(n){return{ok:!0,...n.selection()}}function $m(n,e){let t=n.event();if(!t)return ue("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return t.guestsOnly?ue("guests_only","This event is for invited guests."):ue("event_closed","Sales are closed for this event.");let i=Dm(e.seat_ids);return i.length?(n.clearSelection(),n.selectObjects(i),uc(n)):ue("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function zm(n,e){let t=async s=>{try{return await s()}catch(o){return ue("error",o instanceof Error?o.message:String(o))}},i=[{name:`${Nn}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(()=>Nm(n,e))},{name:`${Nn}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:s=>t(()=>Vm(n,s))},{name:`${Nn}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:s=>t(()=>$m(n,s))},{name:`${Nn}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(()=>uc(n))}];return e&&i.push({name:`${Nn}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 mc(n,e={}){let t=_m();if(!t||typeof t.registerTool!="function")return null;let i=new AbortController,s=zm(n,!!e.holds),o=[],r=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of s)await t.registerTool(a,{signal:i.signal,...r?{exposedTo:r}:{}}),o.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return o.length?{names:o,dispose:()=>{if(i.abort(),typeof t.unregisterTool=="function")for(let a of o)try{t.unregisterTool(a)}catch{}}}:null}async function fc(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 mc(yo(n,t),{holds:t,exposedTo:i}),n.destroyed&&bo(n)}catch(s){console.warn("seatmap: WebMCP registration failed",s)}}function bo(n){n.webMcp?.dispose(),n.webMcp=null}function yo(n,e){let t=(i,s)=>{if(Number.isInteger(i.logicalSeatIndex))return i.logicalSeatIndex;let o=i.id.lastIndexOf(":"),r=o<0?NaN:Number(i.id.slice(o+1));return Number.isFinite(r)?r:s};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,...n.guestsOnly?{guestsOnly:!0}:{}}:null},selectionLimits:()=>({max:n.maxTickets,required:n.exactTickets}),categories:()=>{let i=n.controller.categoryAvailability();return(n.controller.doc?.categories??[]).filter(s=>!s.notForSale).map(s=>{let o=cs(n,s),r=ls(n,s);return{key:s.key,label:s.label??s.key,...r===void 0?{}:{price:r},...o&&o.min!==o.max?{priceRange:o}:{},available:i[s.key]??0}})},zones:()=>n.controller.getBestAvailableZones(),hasPremiumSeats:()=>n.controller.hasPremiumSeats(),seats:()=>{let i=n.controller.getActiveFloorId(),s=[];return n.allSeats().forEach((o,r)=>{if(o.floorId&&i&&o.floorId!==i)return;let a=n.controller.getStatus(o.id)??"free",l=n.controller.doc?.categories.find(d=>d.key===o.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;s.push({id:o.id,label:o.label,rowKey:o.logicalRowId??o.rowId,sectionKey:o.sectionId??o.rowId,index:t(o,r),categoryKey:o.categoryKey,price:n.paidPrice(o.categoryKey,l?.tiers?.[0]?.id??null,c,o.label),...o.zoneId?{zoneId:o.zoneId}:{},available:a==="free"&&!l?.notForSale})}),s},describeSeat:i=>{let s=n.controller.seatDetails(i);return s?{section:s.sectionLabel??"",row:J(s)??"",seat:s.seatNumber??s.label,category:s.categoryLabel??s.categoryKey}:null},selection:()=>{let{freshSeats:i,total:s,count:o}=as(n);return{seats:i.map(r=>({id:r.id,label:r.label,section:r.sectionLabel??"",row:J(r)??"",seat:r.seatNumber??r.label,category:r.categoryKey,price:n.paidPrice(r.categoryKey,r.tierId??null,r.price,r.label)})),count:o,total:s,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?jm(n):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function jm(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 gc(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 bc(n,e,t,i){let s=n.currentHold(),o=s?.items??[],r=o.find(c=>c.label===e);if(!s||!r||r.tierId===t)return null;let a=o.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,s.holdId);return n.setHold({holdId:l.holdId,labels:a.map(c=>c.label),expiresAt:l.expiresAt,items:l.items}),n.currentHold()}function vo(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 yc(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",vo(n))}import{seatConfidenceDisclosure as Gm}from"@seatlayer/core/core/seatConfidence";function ae(n){return String(n??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function vc(n){let e=Gm(n.seat.confidenceEvidence),t=n.seat.confidenceEvidence,i=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${ae(c)}</li>`).join("")}</ul>`:"",s=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${ae(e.modeledTarget)}</dd></div>`:"",o=t?`<div><dt>Evidence ID</dt><dd>${ae(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${ae(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${ae(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${ae(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${ae(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",r=wi(n.seat.commercial).join(" \xB7 ")||n.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${ae(r)}</dd></div>`+(n.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${ae(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">${ae(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>${ae(e.headline)}</strong><span>${ae(e.coverage)} \xB7 ${ae(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${ae(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${ae(e.reality)}</dd></div><div><dt>Source</dt><dd>${ae(e.provenance)}</dd></div>`+a+s+o+`</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 wc(n){return n?n.closest("[data-report]")?"report":n.closest("[data-close]")||n.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function ds(n,e,t){let i=n?.querySelector("[data-report]"),s=n?.querySelector("[data-report-status]");i&&(i.disabled=e!=="failed",i.textContent=e==="received"?"Report received":"Report this view"),s&&(s.setAttribute("role",e==="failed"?"alert":"status"),s.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function wo(n,e,t=null){let i=n.view3dEl;if(!i)return;Bn(n,!1);let s=e.confidenceEvidence,o=n.controller.seatDetails(e.id),r=document.createElement("div");r.className="sl-view3d-passport-shell",r.innerHTML=vc({seat:e,title:o?.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(),Bn(n);return}if(m.key!=="Tab")return;let u=d();if(!u.length)return;let y=u[0],g=u[u.length-1];m.shiftKey&&document.activeElement===y?(m.preventDefault(),g.focus()):!m.shiftKey&&document.activeElement===g&&(m.preventDefault(),y.focus())};window.addEventListener("keydown",h,!0),n.view3dPassportCleanup=()=>{window.removeEventListener("keydown",h,!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: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 y=m??n.view3dCompareEl?.querySelector("[data-passport-seat]")??n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareChip.mainButton();(t?.isConnected?t:y)?.focus()},r.addEventListener("click",m=>{let u=wc(m.target instanceof HTMLElement?m.target:null);u==="close"&&Bn(n),u==="report"&&Km(n,e)}),requestAnimationFrame(()=>d()[0]?.focus()),n.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:s?.evidenceId??null,eventConfigurationId:s?.eventConfigurationId??null,modelLevel:s?.modelLevel??"unverified",realityLevel:s?.realityLevel??"none"})}async function Km(n,e){if(n.api.reportViewEvidence){ds(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}),ds(n.view3dPassportEl,"received",t.report.id)}catch{ds(n.view3dPassportEl,"failed")}}}function Bn(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 xc(n){let e=n.view3dEl;if(!e||n.view3dCompareSeatIds.length<2)return;kt(n,!1);let t=n.view3dCompareSeatIds.map(u=>n.view3dComparisonSnapshot(u)).filter(u=>!!u);if(t.length<2){n.clearView3dComparison();return}let i=u=>A(u),s=t.some(u=>!!u.price),o=document.createElement("div");o.className="sl-view3d-compare-shell";let r=t.map((u,y)=>`<article><span>Seat ${y===0?"A":"B"}</span><strong>${i(u.label)}</strong><small>Section ${i(u.section)} \xB7 Row ${i(u.row)}</small><dl>`+(s?`<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("");o.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">${s?"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(o),e.classList.add("has-comparison"),n.view3dCompareEl=o;let d=o.querySelector(".sl-view3d-compare"),h=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],m=u=>{if(u.key==="Escape"){u.preventDefault(),kt(n);return}if(u.key!=="Tab")return;let y=h();if(!y.length)return;let g=y[0],T=y[y.length-1];u.shiftKey&&document.activeElement===g?(u.preventDefault(),T.focus()):!u.shiftKey&&document.activeElement===T&&(u.preventDefault(),g.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);o.remove(),e.classList.remove("has-comparison"),n.view3dCompareEl===o&&(n.view3dCompareEl=null),a?.isConnected?a.focus():n.view3dCompareChip.mainButton()?.focus()},o.querySelector("[data-close]")?.addEventListener("click",()=>kt(n)),o.querySelectorAll("[data-passport-seat]").forEach(u=>u.addEventListener("click",()=>{let y=u.dataset.passportSeat,g=y?n.allSeats().find(T=>T.id===y):void 0;g&&wo(n,g,u)})),o.querySelectorAll("[data-view-seat]").forEach(u=>u.addEventListener("click",()=>{let y=u.dataset.viewSeat;kt(n,!1),y&&n.view3dHandle?.flyToSeat(y)})),o.querySelectorAll("[data-select-seat]").forEach(u=>u.addEventListener("click",()=>{let y=u.dataset.selectSeat;y&&Um(n,y)})),requestAnimationFrame(()=>h()[0]?.focus()),n.emit3dAnalytics("3d_comparison_opened",{seatIds:n.view3dCompareSeatIds.slice()})}function kt(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 Um(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(s=>s.id===e);if(!t)return;if(kt(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 Jm}from"@seatlayer/core";import{seatViewDisclosure as ef}from"@seatlayer/core/view3d/crossfade/panorama";import{t as kc}from"@seatlayer/core";var qm=900,Wm=450;function Ym(n){switch(n){case"seat":return v("picker.stopYourSeat","Your seat");case"row":return v("picker.stopYourRow","Your row");case"section":return v("picker.stopYourSection","Your section");default:return v("picker.stopWholeVenue","Whole venue")}}function Sc(n,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let i=v("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",i),t.title=i,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let s=document.createElement("div");s.className="sl-view3d-stop",s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),n.append(t,s);let o=null,r=null;return{onStopChange(a){if(o&&(clearTimeout(o),o=null),r&&(clearTimeout(r),r=null),!a){s.classList.remove("is-shown"),s.textContent="",r=setTimeout(()=>{r=null,n.classList.remove("is-seat-view")},Wm);return}n.classList.add("is-seat-view"),s.textContent=Ym(a),s.classList.add("is-shown"),o=setTimeout(()=>{o=null,s.classList.remove("is-shown")},qm)},dispose(){o&&(clearTimeout(o),o=null),r&&(clearTimeout(r),r=null),t.remove(),s.remove(),n.classList.remove("is-seat-view")}}}var Zm=44,Qm=92;function Tc(n,e,t,i={}){let s=n?.sectionLabel,o=J(n),r=Xm(n,e),a=[s,o?kc("picker.rowLabel",{label:o}):null,r?kc("picker.seatLabel",{label:r}):null].filter(Boolean).join(" \xB7 "),l=i.maxChars??(i.narrow?Zm:Qm);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 Xm(n,e){if(n?.seatNumber)return n.seatNumber;let t=n?.displayLabel??e,i=s=>{!s||!t.startsWith(s)||t.length<=s.length||(t=t.slice(s.length).replace(/^[\s·\-\/_]+/,""))};return i(n?.sectionLabel),i(J(n)),t}import{seatConfidenceDisclosure as tf}from"@seatlayer/core/core/seatConfidence";var nf=220;function sf(n,e,t){let i=null,s=null,o=null;return(r,a)=>{n()?.presentSeatHover?.(r,a,e),o=a,r!==s&&(s=r,i&&(clearTimeout(i),i=null),!(!r||!t)&&(i=setTimeout(()=>{if(i=null,s!==r)return;let c=t()?.(r)??null;c&&s===r&&n()?.presentSeatHover?.(r,o,e,c)},nf)))}}function Ec(n){return n.buyerView}function Cc(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 Ac(n,e){switch(n.controller.getStatus(e.id)){case"held":if(!Lc(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 Pc(n){if(!n.view3dHandle)return;let e=n.allSeats().map(t=>({seatId:t.id,state:n.seatState3dFor(t)}));n.view3dHandle.setAvailability(e),n.syncSelectionTo3d(),xo(n)}function xo(n){n.view3dHandle?.setAreaStates&&hi(n,()=>{let e=n.view3dHandle;if(!e?.setAreaStates)return;let t=n.priceBandKeys,i=di(n.controller);e.setAreaStates(pi(n.controller.gaStates(),s=>t!=null&&!t.has(i.get(s)?.categoryKey??""),s=>i.get(s)?.wheelchairPlaces??0))})}function Lc(n,e){return Mc(n,e)!=null}function Mc(n,e){let t=n.controller.currentHold()?.labels;if(!t?.length)return null;if(t.includes(e.label))return e.label;let i=n.controller.tableSelection(e.id)?.label;return i!=null&&t.includes(i)?i:null}function of(n){return(n.controller.currentHold()?.labels??[]).flatMap(e=>{let t=n.controller.tableSelection(e)?.physicalSeatIds;if(t?.length)return t;let i=n.controller.seatByLabel(e)?.id;return i?[i]:[]})}function Hc(n){if(!n.view3dHandle)return;let e=new Set;for(let t of n.controller.getSelection()){let i=t.physicalSeatIds;if(i?.length)for(let s of i)e.add(s);else e.add(t.id)}for(let t of of(n))e.add(t);n.view3dHandle.setSelection([...e])}function Rc(n,e){let t=n.view3dHandle;if(!t)return;n.pushAvailabilityTo3d(),n.syncSelectionTo3d();let i=e[0];!i||e.every(o=>o.rowId===i.rowId)&&t.focusRow(i.rowId)||i.sectionId&&t.focusSection(i.sectionId)}async function Ic(n,e){let t=n.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,s=!!i&&i!==t.viewUrl,o=s?await n.buyerAssetUrls.resolve(i):null,r=s?t.viewUrl:await n.buyerAssetUrls.resolve(t.viewUrl);return!r||s&&!o?null:{url:r,...o?{previewUrl:o}:{},...s?{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 Oc(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(l=>l.id===e);if(!t)return;let i=n.controller.tableSelection(e),s=Mc(n,t);if(s!=null){if(n.syncSelectionTo3d(),n.performanceGroup)return;if(n.opts.confirmSelection===!1){n.removeHeldTicket(s);return}if(n.confirmSeat?.id===t.id){n.dismissConfirm();return}n.showConfirm(s===t.label?t:{...t,label:s},"remove");return}if(n.committedSelection().some(l=>i?l.label===i.label:l.id===e)){if(i||n.opts.confirmSelection===!1){n.controller.deselect([e]),n.dismissConfirm(),n.syncSelectionTo3d();return}n.syncSelectionTo3d(),n.showConfirm(t,"remove");return}let r=n.controller.getStatus(t.id);if(r==="held"||r==="booked"||r==="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 _c(n,e){let t=n.allSeats().find(i=>i.id===e);return Tc(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 Dc(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 Nc(n){n.closeView3dComparison(!1),n.view3dCompareSeatIds=[],n.view3dCompareChip.remove(),n.emit3dAnalytics("3d_comparison_cleared")}function Bc(n,e){let t=n.allSeats().find(y=>y.id===e);if(!t)return null;let i=n.controller.seatDetails(t.id),s=n.controller.doc?.categories.find(y=>y.key===t.categoryKey),o=i?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),r=o!=null?n.paidPrice(t.categoryKey,i?.tierId??s?.tiers?.[0]?.id??null,o,t.label):void 0,a=n.controller.getStatus(t.id),l=a==="free"||!a?n.tf("picker.available","Available"):Lc(n,t)?n.tf("picker.heldForYou","Held for you"):n.tf("picker.group.legendUnavailable","Unavailable"),c=t.viewUrl?ef({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=wi(t.commercial).join(" \xB7 ")||n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),h=_r({...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=tf(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:J(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??s?.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 Fc(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 s=document.createElement("button");s.type="button",s.className="sl-view3d-back",s.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 o=s.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");o&&(o.textContent=h),s.setAttribute("aria-label",h)};if(s.addEventListener("click",()=>{if(n.view3dTargetSeatId&&n.view3dHandle){n.view3dHandle.focusOverview();return}n.exit3d()}),n.regions["top-left"]?.prepend(s),n.view3dBack=s,n.publish3dTopInset(),ac(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([Cn(),n.controller.loadEventConfiguration()]),m=h?await $i(h,E=>n.buyerAssetUrls.resolve(E)):null,u=t.theme?.venue3d?.shellAssetUrl,y=await zi(u,E=>n.buyerAssetUrls.resolve(E));if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let g={...ci(n.opts.enable3DCrowd),crowdSeatCeiling:n.max3dSeats()},T={doc:t,seats:c,...g,...m?{eventConfigurationId:m.id,eventConfiguration:m}:{},...y?{registeredShellGlb:y}:{}};a.textContent=Jm("picker.building3d");let S=await d.prepareVenue3D(T);if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let k=d.mountVenue3D(i,{...T,prepared:S},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:ft(),navLabels:ai(),...li(n.opts.touchNavigation3D),seatViewActionLabel:E=>n.allSeats().find(L=>L.id===E)?.viewUrl?n.tf("picker.openAuthored360","Open venue 360\xB0"):n.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:E=>n.seatViewCaption(E),onSeatViewStopChange:E=>n.view3dSeatViewChrome?.onStopChange(E),onSeatPick:E=>n.onView3dSeatPick(E),onSeatInspect:E=>n.onView3dSeatPick(E),onObjectPick:E=>{E.kind==="area"&&n.openAreaChooser(E.id,E.point)},onSeatHover:sf(()=>n.controller.getRenderer(),i,()=>{let E=k.captureSeatView;return E?L=>E.call(k,L):void 0}),onSectionFocusChange:E=>{let L=i.querySelector('select[data-locator="section"]'),U=E??"";!L||L.value===U||(L.value=U,L.dispatchEvent(new Event("change")))},onViewTargetChange:E=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!E),r(E),n.opts.onBuyerViewChange?.({view:"venue3d",...E?{seatId:E}:{}})},...n.seatViewEnabled()?{getSeatView:E=>new Promise((L,U)=>{let O=()=>{n.seatViewFor3d(E).then(R=>{R?L(R):U(new Error("seat_view_unavailable"))})},f=globalThis.requestIdleCallback;typeof f=="function"?f(O,{timeout:1500}):setTimeout(O,50)})}:{},onAnalytics:(E,L)=>n.emit3dAnalytics(E,L)});n.view3dHandle=k,n.view3dSeatViewChrome=Sc(i,{handle:()=>n.view3dHandle}),requestAnimationFrame(()=>a.remove()),n.pushAvailabilityTo3d(),n.syncSelectionTo3d(),n.view3dNav=rc(n.regions["bottom-left"]??i,k),e&&k.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 Vc(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 $c(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 Kc}from"@seatlayer/core";var zc=Symbol("seatlayer.performance-group-picker");function ps(n,e){return Object.defineProperty(n,zc,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),n}function hs(n){return!n||n.surface==="season"}function St(n){return n?.surface==="season"}function jc(n){return n[zc]??null}import{t as us}from"@seatlayer/core";function Gc(n){return Array.isArray(n)?n.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function ms(n,e,t=!1){let i=n.violations[0];return i==="numberOfPlacesToSelect"?n.remaining>0?us("picker.selectExactMore",{count:n.remaining}):us("picker.selectExactCount",{count:n.required}):i==="minimumSelectedPlaces"?us("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."):us("picker.orphanHint")}var ko=6e4,Uc=5*6e4,af=String(Math.round(Uc/6e4));function qc(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}",af)}function Yc(n){let e=n.hold?.items??[],t=new Set(e.map(s=>s.label));return n.committedSelection().filter(s=>!t.has(s.label)).reduce((s,o)=>s+(o.quantity??1),0)+Ne(n.gaQty,n.hold?.items??[])}function Zc(n){return(n.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function Qc(n){let e=new Set((n.hold?.items??[]).map(i=>i.label)),t=n.committedSelection().filter(i=>!e.has(i.label)).reduce((i,s)=>i+(s.quantity??1),0);return n.heldTicketCount()+t+Ne(n.gaQty,n.hold?.items??[])}function Xc(n){let e=new Set((n.hold?.items??[]).map(s=>s.label)),t=n.committedSelection().filter(s=>e.has(s.label)).reduce((s,o)=>s+(o.quantity??1),0),i=Math.max(0,n.maxTickets-n.heldTicketCount()-Ne(n.gaQty,n.hold?.items??[]));n.controller.setMaxSelection(t+i)}function Jc(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 s=!n.hold&&n.performanceGroup?.selectionMode==="per_performance"?n.performanceGroup.submissionState?.():null;if(s&&!s.ready){i.disabled=!0,i.textContent=n.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(s.complete)).replace("{total}",String(s.total));return}let o=n.controller.getSelectionValidity(e);if(o&&!o.isValid){i.disabled=!0,i.textContent=ms(o,(r,a)=>n.tf(r,a),!0);return}if(!e&&n.root?.dataset.layout==="narrow"&&hs(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?Kc("picker.secureMoreAndCheckout",{count:t}):n.tf("picker.continueToCheckout","Continue to checkout"):e?n.performanceGroup?lf(n,n.performanceGroup):n.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):n.tf("picker.selectSeats","Select seats")}function lf(n,e){let t=St(e),i=t?Kc("picker.season.holdSeatsForAllDates"):n.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances");return(e.performanceCount===1?n.tf(t?"picker.season.holdSeatsForOneDate":"picker.holdSeatsForOnePerformance",i):i).replace("{count}",String(e.performanceCount))}function ed(n,e){n.ctaPhase=e,n.syncCta()}async function td(n,e,t){n.setCtaPhase("checkout");try{await n.checkoutHandoff(e,t)}finally{n.ctaPhase==="checkout"&&!n.bookedShown&&n.setCtaPhase("idle")}}function nd(n){return`@seatlayer/hold/v1/${encodeURIComponent(n.apiBase)}/${encodeURIComponent(n.opts.event)}`}function id(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 sd(n,e){if(!(n.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(n.holdStorageKey(),e.holdId)}catch{}}function od(n){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(n.holdStorageKey())}catch{}}async function rd(n,e,t=!1){try{let i=await n.controller.resumeHold(e);if(!i||n.destroyed)return null;let s={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return n.hold=s,Ta(n.gaQty,s.items??[]),n.handedOff=!0,n.bookedShown=!1,n.ctaPhase="idle",n.startHoldTimer(s.expiresAt),n.rememberHold(s),n.syncTray(),n.emitHoldChange(),n.opts.onHoldRestored?.(s,s.seats??[],n.buildHandoff(s)),s}catch(i){let s=i?.status;if(s===404||s===409)n.forgetHold();else if(s===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 ad(n){let e=n.rememberedHoldId();e&&await n.resumeHoldFromServer(e,!0)}function ld(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"]'),s=()=>{let o=Math.max(0,n.holdExpiresAt-Date.now());i&&(i.textContent=Wr(o)),t.classList.add("on"),t.classList.toggle("is-expiring",o>0&&o<=ko),n.setExtendPrompt(o>0&&o<=ko,o),(o<=0||!n.controller.currentHold())&&n.stopHoldTimer()};n.holdTimer=setInterval(s,500),s()}function cd(n){n.holdTimer&&clearInterval(n.holdTimer),n.holdTimer=null,n.els.hold?.classList.remove("on","is-expiring"),n.setExtendPrompt(!1,0)}function dd(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 pd(n){if(!n.holdTimer)return;let e=Math.max(0,n.holdExpiresAt-Date.now());n.setExtendPrompt(e>0&&e<=ko,e)}async function hd(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,Uc);if(n.controller.currentHold()?.holdId!==t.holdId)return;n.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:i.expiresAt,items:t.items});let s=n.controller.currentHold();if(!s)return;n.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},n.holdExpiresAt=s.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 ud(n,e){if(n.destroyed)return!1;let t=n.hold,i=!!t&&(e===void 0||t.holdId===e);if(i){let s=new Set([...(t.items??[]).map(r=>r.label),...(t.seats??[]).map(r=>r.label),...n.controller.currentHold()?.labels??[]]);n.controller.clearHold(),n.notifyGroupSettled("booked");let o=n.controller.getSelection().filter(r=>s.has(r.label));o.length&&n.controller.deselect(o.map(r=>r.id))}return n.controller.refresh().catch(()=>{}),i}function df(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 md(n,e){try{return await n(e),!1}catch(t){return df(t)==="booked"}}import{t as Fn}from"@seatlayer/core";function fd(n){return n?.previousPrice!=null&&n.previousPrice>n.price?n.previousPrice:null}function gd(n){return pf(n)+(n.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!n.collapsed}">${n.esc(n.moreLabel)}</button>`:"")+hf(n.status)}function pf(n){let{esc:e,money:t}=n;return n.categories.map(i=>{let s=n.priceOf(i),o=n.rangeOf(i),r=n.offerOf(i.key),a=fd(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?yi(r.offerName,e):"")+"</span>"+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(o!=null?`<span class="sl-price-amt">${o.min===o.max?e(t(o.min)):`${e(t(o.min))}\u2013${e(t(o.max))}`}</span>`:s!=null?`<span class="sl-price-amt">${e(t(s))}</span>`:"")+"</div>"}).join("")}function hf(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 So(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 bd(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(s=>{let o=n.rangeOf(s),r=n.priceOf(s),a=o?o.min===o.max?t(o.min):`${t(o.min)}+`:r!=null?t(r):null,l=Object.prototype.hasOwnProperty.call(n.left,s.key)&&n.left[s.key]<=0,c=fd(n.offerOf(s.key)),d=a?`${s.label}: ${a}${l?` (${n.soldOutWord})`:""}`:s.label;return`<button type="button" class="sl-rc" data-cat="${e(s.key)}" aria-pressed="${n.activeKey===s.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(n.colorOf(s))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??s.label)}</span></button>`}).join("")}function yd(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 s=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),o=Math.ceil(s.length/4),r=[];for(let a=0;a<s.length;a+=o){let l=s.slice(a,a+o),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 vd(n){if(n.els.pricesSec?.querySelectorAll(".sl-price-select").forEach(s=>s.remove()),n.priceSelect=null,n.suppressPricing||!n.els.prices||!n.els.pricesSec)return;let e=yd((n.controller.doc?.categories??[]).filter(s=>!s.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 s of e){let o=document.createElement("option");o.value=s.id,o.textContent=s.label,t.appendChild(o)}n.els.pricesSec.appendChild(t),n.priceSelect=t,t.addEventListener("change",()=>{n.applyPriceBand(e.find(s=>s.id===t.value)?.keys??null)})}function wd(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 xd(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:F}}function kd(n,e,t,i=n.legendDeps()){let s=n.els.railScroll,o=e.length>1;if(n.els.rail?.classList.toggle("has",o),!s)return;s.innerHTML=o?bd({...i,categories:e,left:t,activeKey:n.focusedCatKey,soldOutWord:Fn("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,s.scrollLeft=0),s.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,s.addEventListener("scroll",()=>So(s),{passive:!0})),requestAnimationFrame(()=>So(s))}function Sd(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 s=n.legendDeps(),o=n.suppressPricing,r=o?{...s,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:s;o&&(n.els.pricesSec?.querySelector("span")?.replaceChildren(Fn("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=gd({...r,categories:d,left:t,collapsed:c,activeKey:n.focusedCatKey,bandKeys:n.priceBandKeys,titleFor:(h,m)=>m?n.tf("picker.showAllSeats","Show all seats"):Fn("picker.showLabelSeatsOnMap",{label:h.label}),moreLabel:l>1?c?o?Fn("picker.showAllCategories"):Fn("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 Td(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 Ed,tCount as Cd}from"@seatlayer/core";function ye(n,e,t){let i=Ed(n,t);return i&&i!==n?i:t?e.replace(/\{(\w+)\}/g,(s,o)=>o in t?String(t[o]):s):e}function mf(n){let e=Cd("picker.seatCount",n);return e.includes("picker.seatCount")?`${n} ${n===1?"seat":"seats"}`:e}function ff(n){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(n)}catch{}return n.join(", ")}function gf(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 bf(n){let e=n.filter(s=>s.objectType==="ga"),t=n.filter(s=>s.objectType!=="ga"),i=[];if(t.length){let s=mf(t.length),o=[...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(o.length===1&&r.length===1&&a.length===t.length){let l=t.length===1?ye("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:o[0],row:r[0],seat:String(t[0].seatNumber??"")}):gf(a)?ye("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:o[0],row:r[0],from:Math.min(...a),to:Math.max(...a)}):"";i.push(l?ye("picker.releasedPair","{first} \xB7 {second}",{first:s,second:l}):ye("picker.releasedInSection","{seats} in Section {section}",{seats:s,section:o[0]}))}else o.length===1?i.push(ye("picker.releasedInSection","{seats} in Section {section}",{seats:s,section:o[0]})):o.length>1?i.push(ye("picker.releasedInSections","{seats} in Sections {sections}",{seats:s,sections:ff(o)})):i.push(s)}for(let s of e)i.push(ye("picker.releasedGa","{quantity} \xD7 {area}",{quantity:s.quantity??1,area:s.label}));return i.length?i.reduce((s,o)=>ye("picker.releasedPair","{first} \xB7 {second}",{first:s,second:o})):""}function Ad(n){if(!n)return[];let e=new Map((n.seats??[]).map(s=>[s.label,s])),t=n.items??[];return(t.length?t.map(s=>({label:s.label,objectType:s.objectType,quantity:s.quantity})):[...e.keys()].map(s=>({label:s}))).map(s=>{let o=e.get(s.label);return{label:s.label,...s.objectType?{objectType:s.objectType}:{},...s.quantity==null?{}:{quantity:s.quantity},...o?.sectionLabel?{sectionLabel:o.sectionLabel}:{},...o?.rowLabel?{rowLabel:J(o)??o.rowLabel}:{},...o?.seatNumber?{seatNumber:o.seatNumber}:{}}})}function Pd(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 Ld(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=>Ed("picker.seatJustTakenByAnother",{label:r})).join(" "):t.remove());let i=n.querySelector(".sl-interrupt-actions"),s=i?.querySelector(".sl-interrupt-act");if(!i||!s)return;s.classList.add("sl-interrupt-act-secondary");let o=document.createElement("button");o.type="button",o.className="sl-interrupt-act sl-hold-expired-recover",o.textContent=Cd("picker.holdLapsedSelectAgain",e.recoverable.length),o.addEventListener("click",()=>e.onRecover([...e.recoverable])),i.insertBefore(o,s),n.classList.add("has-recovery"),o.focus()}function Md(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 s=document.createElement("div");s.className="sl-interrupt-title",s.id="sl-hold-expired-title";let o=document.createElement("span");o.className="sl-interrupt-glyph",o.setAttribute("aria-hidden","true"),o.textContent="\u23F1";let r=document.createElement("span");r.textContent=ye("picker.holdExpiredTitle","Your seats were released"),s.append(o,r);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=ye("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),i.append(s,a);let l=bf(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=ye("picker.holdExpiredPickAgain","Pick your seats again to continue. They may already be taken."),i.appendChild(c),t.setAttribute("aria-labelledby",s.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=ye("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 To,seatTypeIconSvg as Hd,t as yf}from"@seatlayer/core";var Rd={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"},vf='<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>',wf='<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>',xf=8,kf=8,Sf=88;function Tf(n){let e=n.gap??xf,t=n.margin??kf,i=n.min??Sf,s=Math.max(n.boundsTop,0);return Math.max(Math.round(n.buttonTop-s-e-t),i)}var fs=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 s=this.offered().length>0?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",s),this.button.innerHTML=wf,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let o of this.stored())this.offeredFree().has(o)&&this.active.add(o);if(this.menu.innerHTML=Ur(s,t.tf("picker.close","Close"))+qr(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",o=>o.stopPropagation()),this.button.addEventListener("click",o=>{o.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",o=>{o.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",o=>o.stopPropagation()),this.menu.addEventListener("click",o=>o.stopPropagation()),this.menu.addEventListener("focusin",o=>{let r=o.target;r&&typeof r.scrollIntoView=="function"&&r.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=o=>{o.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 o=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(o):o()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:i,count:s})=>[i,s])),t=!1;for(let i of this.menu.querySelectorAll("[data-a11y-row]")){let s=i.dataset.a11yRow??"";if(!s.startsWith("a11y:"))continue;let o=s.slice(5),r=e.get(o);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(o,l))),i.disabled=c,c?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),c&&this.active.delete(o)&&(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",`${Tf({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();Gs(this.menu,{x:t.left+t.width/2,y:t.top}),wa(this.menu),va(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:Hd("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:vf,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:s})=>({key:i,count:s}));let t=this.deps.present;return t?To.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(To.map(i=>[i.key,i]));return this.offered().flatMap(({key:i,count:s})=>{let o=t.get(i);return o?[{key:`a11y:${i}`,iconHtml:Hd(i,{size:17}),label:this.deps.tf(`picker.accessShort.${i}`,Rd[i]??o.label),...i==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...s==null?{}:{count:this.countText(s),disabled:s===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 s of this.menu.querySelectorAll(".sl-info.open"))s.classList.remove("open"),s.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 o=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(o),this.paint(e,o);return}if(t==="limited"){let o=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(o),o&&this.deps.focusSeatsForFilter(),this.paint(e,o);return}let i=t.slice(5),s=!this.active.has(i);s?this.active.add(i):this.active.delete(i),this.paint(e,s),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),s=e.parentElement;s?.classList.contains("sl-a11yrow-w")||(s=document.createElement("div"),s.className="sl-a11yrow-w",e.replaceWith(s),s.appendChild(e));let o=document.createElement("button");o.type="button",o.className="sl-a11yrow-c sl-a11yjump",o.dataset.a11yJump=i,o.textContent=t.textContent,o.disabled=e.disabled,o.setAttribute("aria-label",this.jumpLabel(i,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(i,o.textContent??""));let r=s.querySelector(".sl-info");r?r.after(o):e.after(o),s.dataset.a11yTapThrough||(s.dataset.a11yTapThrough="true",s.addEventListener("click",a=>{a.target===s&&!e.disabled&&e.click()})),o.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&&o.setAttribute("aria-label",this.jumpLabel(i,o.textContent??"",l.label))})}}countText(e){return e>0?yf("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=Rd[e]??To.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 Ef}from"@seatlayer/core";var Cf=250;function Id(n,e=Cf){let t=null,i=()=>{t===null&&(t=setTimeout(()=>{t=null,n()},e))},s=Ef(i),o=typeof window<"u"&&typeof window.addEventListener=="function";return o&&window.addEventListener("focus",i),()=>{t!==null&&(clearTimeout(t),t=null),s(),o&&window.removeEventListener("focus",i)}}import{holdRecoveryShape as Af,tCount as gs}from"@seatlayer/core";var bs=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=Af(e),i=e.lapsedLabels.length,s=i-e.recoverable.length,o=t==="all"?gs("picker.holdLapsedStillFree",i):t==="partial"?gs("picker.holdLapsedSomeTaken",s):gs("picker.holdLapsedAllTaken",i);this.note={message:o,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(o,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>${F(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${F(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 gs("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 Od="@seatlayer/pending-checkout/v1";function Pf(n){return typeof n=="string"&&n.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(n)}function sn(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 s=window.sessionStorage.getItem(Od);if(s){let o=null;try{o=JSON.parse(s)}catch{}if(o&&Pf(o.orderId)){let r=Date.now()-Number(o.storedAt);if(r>=0&&r<=144e5){if(o.eventKey&&o.eventKey!==n)return null;i=o.orderId}}}window.sessionStorage.removeItem(Od)}catch{}e.delete("seatlayer_checkout");try{let s=e.toString();history.replaceState(history.state,"",`${location.pathname}${s?`?${s}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:i}}function _d(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 Nd="https://api.seatlayer.io",Df=10,Nf=250,Bd=6e4,Fd=4,Bf=10,Ff=40,Vf=220,Eo=["mini","peek","open"],Vd="seatmap.a11y.cb";function $e(n,e,t){return t?{ok:!1,reason:n,message:e,labels:t}:{ok:!1,reason:n,message:e}}function $f(){try{if(typeof window>"u")return null;let n=window.localStorage.getItem(Vd);return n==null?null:n==="1"}catch{return null}}function zf(n){try{window.localStorage.setItem(Vd,n?"1":"0")}catch{}}var et=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.guestsOnly=!1;this.guestsDeadlineStop=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 os({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 bs({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=jc(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??Nd).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?_i({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??Hn(e,t),this.pubApi=e.transport?null:i?.api??new We(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=rl(e.transport??this.pubApi,this.transportAbort.signal),this.chartFetch=Hi(this.api),this.buyerAssetUrls=new Qt(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 s=e.numberOfPlacesToSelect;if(s!=null&&(!Number.isInteger(s)||s<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=s??null;let o=Gc(e.selectionValidators);if(this.exactTickets!=null&&o>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let r=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(Df,o)));if(this.exactTickets!=null&&r<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&r<o)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??r,this.baQty=Math.min(this.baQty,this.maxTickets),this.cbSafe=$f()??!!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 Xt(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=_d({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-Fd&&t.width>=window.innerWidth-Fd}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,s=typeof window>"u"?0:window.innerHeight,o=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||i!==this.fullscreenAffordanceSize.viewportWidth||s!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:i,viewportHeight:s},o}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){Be();let t=Xi(v("picker.seatSelection","Seat selection"),Re(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 s=!1,o=()=>{if(s)return;s=!0,i.modalCleanup?.();let r=()=>{i.destroy(),e.onClose?.()};i.hold&&!i.handedOff&&e.holdOnClose!=="keep"?i.release().finally(r):r()};i.closeModal=o,t.onScrimPress(o),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(),o())});try{let r=i.render();i.els.close?.classList.add("on"),i.els.close?.addEventListener("click",o),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;ga({base:(e.apiBase??Nd).replace(/\/+$/,""),event:e.event,publicKey:e.publicKey})}catch{}}wireController(e){return new Lf({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: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=>this.openAreaChooser(t,this.lastMapPoint),onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),ml(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,i=this.holdConflicted;this.holdExpiredUnits=Ad(this.hold);let s=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 o=this.api.resume,r=t&&!i&&s&&o?md(a=>o.call(this.api,this.opts.event,a),s.holdId):null;this.lapse.deferExpiryToast(()=>{if(t||i){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=s,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(Rn(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=g=>Math.round((performance.now()-g)*100)/100;this.rendered=!0,Be();let s=performance.now(),o=Ci(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=Er(this.opts.container),{root:c,els:d,mapHost:h}=na(l,(g,T)=>this.tf(g,T),this.opts.theme);this.root=c,this.els=d,this.mapHost=h,this.paintedLocale=ys(),this.opts.checkoutBar===!1&&(c.dataset.checkoutBar="off"),Ai(c,o,g=>{t.loadLocale=i(s),this.destroyed||this.applyActiveLocale(g,r)}),dc(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 y=document.createElement("div");return y.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(y),t.mountBuyerShell=i(a),t.skeletonPaint=i(e),this.loadAndFinishChart(y,t,i,e,c)}async loadAndFinishChart(e,t,i,s,o){this.startRealtime(),this.startIdleClock(o);let r=await this.loadChart(e,t,i);if(!r)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=i(s);let a=performance.now();this.salesClosed=!!r.salesClosed||!!this.opts.readOnly,this.salesState=r.salesState??null,this.salesInfo=r;let l=this.chartFetch.outcome();if(this.guestsDeadlineStop?.(),this.guestsDeadlineStop=null,l.state==="resolved"&&l.guestsOnly){this.guestsOnly=!0,this.salesClosed=!0;let{forMs:E}=l.guestsOnly;E!==null&&(this.guestsDeadlineStop=la(this,E))}if(o.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 E=document.createElement("div");E.className="sl-testbadge",this.testBadgeEl=E,this.syncTestBadge(),this.regions["top-left"].appendChild(E)}let c=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(o),this.watchThemeMode(),this.currency=r.currency??this.opts.currency??"USD",this.currencyResolved=!0,this.eventTimezone=r.timezone??null,ui(this.els.logo,[this.opts.theme?.logoUrl,c?.logoUrl,this.performanceGroup?.brandLogoUrl,r.posterUrl],this.opts.theme?.brandName??c?.brandName??r.eventName??"?"),this.els.name.textContent=r.eventName??"";let d=r.startsAt?bi(r.startsAt,r.timezone??null,this.opts.locale):"";this.eventWhenText=d||null,this.els.meta.textContent=[r.venue,d].filter(Boolean).join(" \xB7 "),this.syncProjection();let h=!!this.controller.doc&&this.controller.getExpandedSeats().some(E=>E.commercial?.restrictedView||E.commercial?.obstructedView);this.buildAccessibilityMenu(h),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"),o.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 m=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=i(m),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncOffer(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let u=this.controller.doc,y=oi(this.opts.event),g=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),T=g??"event",S={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:T,surface:g==="season"?"season_picker":g==="performance_group"?"performance_group_picker":"seat_picker",ms:i(s),performanceProfile:t,seatCount:this.allSeats().length,objectCount:u?.objects.length??0,sectionCount:u?.objects.filter(E=>E.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:u?.name,view:this.buyerView,load:y,transport:this.opts.transport?"custom":"pubapi",revealWaitMs:this.revealWaitMs??this.sinceRenderResolved(),handoverMs:this.handoverMs??void 0};yc(S,(E,L)=>this.emitAnalytics(E,L));let k=r.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",vo({...S,performanceProfile:{...S.performanceProfile,...k}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=r,await this.registerAgentTools(),this}registerAgentTools(){return fc(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=Id(()=>{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 s=this.els.sheetToggle;this.syncSheetAffordance();let o=0,r=!1,a=!1,l=!1;s?.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,o=c.clientY,(l&&s?s:t).setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!a||r)return;let d=c.clientY-o;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-o)<6&&this.cycleSheet(),a=!1,(l&&s?s:t).releasePointerCapture?.(c.pointerId),l=!1})}this.els.foot?.addEventListener("click",s=>{this.root?.dataset.layout==="narrow"&&(s.target.closest?.('.sl-chip,button,a,input,select,label,[role="button"]')||this.cycleSheet())});let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let s=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!s)),this.els.pricesSec?.setAttribute("aria-expanded",String(!s)),!s&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",s=>{s.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",s=>{s.key!=="Enter"&&s.key!==" "||s.target.closest("select,button")||(s.preventDefault(),i())}),e.addEventListener("click",s=>{let o=s.target.closest("[data-sl-info]");if(!o||!e.contains(o))return;s.stopPropagation();let r=o.closest(".sl-info"),a=!r?.classList.contains("open");this.closeInfoPops(r),r?.classList.toggle("open",a),o.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",s=>{s.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",s=>{this.handleMapPointerDown(s)},!0),this.els.map.addEventListener("mousemove",s=>{if(this.tipPinned)return;let o=this.els.map.getBoundingClientRect();this.tipPos={x:s.clientX-o.left,y:s.clientY-o.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=Eo.indexOf(this.sheetState()),i=Math.min(Eo.length-1,Math.max(0,t+e));this.setSheetState(Eo[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 s=e.clientHeight,o=i!==this.pickerLayoutSize.width||s!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:s};let r=this.fullscreenMeasurementChanged(i,s);this.reportFramedHeight();let a=i<640?"narrow":"wide",l=s<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(),o&&(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 s=performance.now();this.seatsRevealed=!1,this.seatsRevealedWaiters=[],this.seatsRevealedReport=null,this.renderResolvedAt=null,this.revealWaitMs=null,this.handoverMs=null,this.loadAbort=new AbortController;let o=await Gt(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=N("picker.loadingTakingLonger"))});if(this.loadAbort=null,o.outcome==="cancelled"||this.destroyed)return null;let r=o.outcome==="loaded"?o.value:null,a=o.outcome==="loaded"&&!r&&!this.opts.transport?Ri(this.chartFetch?.outcome(),this.renderErrorEmitted):null;if(r||this.controller.destroy(),t.loadChartAndStatuses=i(s),this.destroyed)return null;if(!r){a&&Ii({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:o.outcome==="timeout"?"load_timeout":o.outcome==="error"?"render_error":"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:Ie(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),en(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 en(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),en(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(s=>s.hasAttribute("inert"));t.forEach(s=>s.setAttribute("inert",""));try{for(;!this.destroyed;){let s=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()-s,performanceProfile:e,view:"map",load:Ie(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let r=en(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;en(this.els.boot,{title:["picker.restoringSeats"],busy:!0})}}return!1}finally{t.forEach((s,o)=>{i[o]||s.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=sn(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 fs(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(i,s)=>this.tf(i,s),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(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,i=this.els.headInfo?.parentElement;t&&i&&t.parentElement!==i&&(t.classList.add("sl-fs-pill"),i.insertBefore(t,this.els.hold??null));let s=this.extendEl;if(s){let r=e?this.regions["bottom-center"]??this.els.map:i;r&&s.parentElement!==r&&(s.dataset.dock=e?"map":"head",r===i?r.insertBefore(s,this.els.close??null):r.appendChild(s))}let o=this.els.pricesSec;o&&(e?(o.setAttribute("role","button"),o.tabIndex=0,o.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(o.removeAttribute("role"),o.removeAttribute("aria-expanded"),o.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){qc(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>${F(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.guestsOnly?Mi():this.salesUi?.words(this)??Jr(this.wordsSalesState(),!!this.opts.readOnly)}wordsSalesState(){return this.salesState==="testable"&&this.salesInfo?.mode==="test"?"live":this.salesState}finishingHold(){return!!this.salesUi?.finishing(this)}withSalesUi(){return this.salesUiLoad??=Cr().then(e=>(e.translate(N,on),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 v(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 s=document.createElement("div");s.className="sl-soldout-title",s.textContent=this.tf("picker.soldOutTitle","Sold out");let o=document.createElement("p");o.className="sl-soldout-copy",o.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(i,s,o),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,s=this.isSoldOut(e,t,i),o=[...Si(e,t)].join("|");o!==this.baSoldOutSig&&(this.baSoldOutSig=o,this.syncTray()),s!==this.soldOut&&(this.soldOut=s,this.soldoutEl?.classList.toggle("on",s))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(s=>(t[s.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(s=>s.objectType!=="ga").slice(0,10).map(s=>this.controller.seatByLabel(s.label)).filter(s=>!!s);if(this.buyerView==="venue3d"&&this.view3dHandle){Rc(this,i);return}Ya({regions:this.els,categories:this.controller.doc?.categories,pop:s=>this.controller.flashSeat(s,this.cssVar("--sl-accent")||"#f4b740"),focus:(s,o)=>this.controller.focusSection(s,o),focusSeats:s=>this.controller.focusSeats?.(s,{animate:!t})===!0,reducedMotion:t,screenPoint:s=>this.controller.worldToScreen(s),schedule:(s,o)=>this.scheduleMotion(s,o)},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 Yc(this)}heldTicketCount(){return Zc(this)}totalTicketCount(){return Qc(this)}updateSelectionCapacity(){Xc(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){Jc(this,e,t)}setCtaPhase(e){ed(this,e)}runCheckoutHandoff(e,t){return td(this,e,t)}holdStorageKey(){return nd(this)}rememberedHoldId(){return id(this)}rememberHold(e){sd(this,e)}forgetHold(){od(this)}resumeHoldFromServer(e,t=!1){return rd(this,e,t)}restoreRememberedHold(){return ad(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(s=>s.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=sr({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 ls(this,e)}catPriceRange(e){return cs(this,e)}buildPriceFilter(){vd(this)}applyPriceBand(e){wd(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(s=>s.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(s=>{if(s.dataset.view==="venue3d")for(let o of["pointerenter","focus","pointerdown"])s.addEventListener(o,fi,{once:!0});s.addEventListener("click",()=>{this.setBuyerView(s.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)],s=new Set((e.zones??[]).map(h=>h.id)),a=Mf(e)==="combined"&&(e.floors?.length??0)>1&&s.size===0||i.some(h=>h.type==="section"&&typeof h.zone=="string"&&s.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",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(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=Hl({floors:this.controller.getFloors(),tf:(s,o)=>this.tf(s,o),onChoose:s=>{s===""?this.controller.setFloorOverview(!0):this.controller.setFloor(s),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&&za(this.root,e,this.regions);let t=e?Ml(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",s=0;if(i&&e&&t?.isConnected){let o=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.height>0&&(s=Math.max(0,o.bottom-r.top+8))}this.controller.setFitClearance?.(s)}syncTestBadge(){let e=this.testBadgeEl;e&&(e.textContent=Tr(N("picker.testMode"),ys()),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(i=>{let s=i.dataset.rung===e;i.classList.toggle("on",s),i.setAttribute("aria-pressed",String(s))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,i=this.els?.zin;if(!e||!this.root)return;let s=this.controller.getRenderer?.(),o=this.controller.canZoomIn?.()===!1||s?.seatsPickable?.()===!0,r=ir({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!==o||e.hidden||!!i?.hidden||!!t?.hidden;e.disabled=r,e.hidden=!1,i&&(i.disabled=o,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"?N("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||!mi()?!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)?Bd/2:Bd}syncFloors(){Rl(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new ts({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(s=>s.type==="section"&&!this.controller.isSectionClosed(s.id)&&this.controller.getSectionSeatCount(s.id)>0);if(t.length<2)return null;let i=t.findIndex(s=>s.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}markedSeatAnnouncement(e){let t=po(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return zl(t,e.displayLabel??e.label,this.opts.locale,St(this.performanceGroup))}seatPriceRangeOf(e,t){let i=this.controller.doc?.categories.find(o=>o.key===t),s=i?i.tiers?.length?i.tiers.map(o=>this.paidPrice(i.key,o.id??null,o.price,e)):i.price==null?[]:[this.paidPrice(i.key,null,i.price,e)]:[];return s.length?{min:Math.min(...s),max:Math.max(...s)}: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),o=(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(ys()):this.tf("picker.group.legendUnavailable","Unavailable").toLocaleLowerCase(ys()),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=Je(c),h=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,m=l?`${d} ${h}, ${l.bookingMode==="variable"?N("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):N("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${h}`:c?.objectType==="table"?`${d} ${h}, ${N("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:N("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${m}, ${i?.label??e.categoryKey}${a?`, ${a}`:""}, ${o}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let s=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),o=e.bookingMode==="variable",r=document.createElement("div");r.className="sl-table-scrim",r.innerHTML=Gr(e,{variable:o,held:t,typeWord:Je(e),categoryLabel:s?.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(o?'[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 s=t.querySelector("input[data-table-qty]");s&&(s.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 o=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),r=t.querySelector("[data-table-total]");r&&(r.textContent=this.money(o*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 s=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!s){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:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.startHoldTimer(s.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast(N("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(s){this.opts.onError?.(s),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 ss({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,s)=>this.paidPrice(e,t,i,s),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){sc(e,t,this.reducedMotion())}addSeatLabel(e){return oc(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,s=this.controller.getActiveFloorId(),o=e.focalPoint??i?.floors?.find(h=>h.id===s)?.focalPoint??i?.focalPoint??{x:0,y:0},r,a,l=!1;if(e.viewUrl){let h,m=null;try{let y=e.viewMeta?.previewUrl;y&&y!==e.viewUrl?(m=await this.buyerAssetUrls.resolve(y),h=e.viewUrl):h=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(y){t===this.seatViewGen&&this.opts.onError?.(y);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=_f(u),l=Of(u)}else{let h;try{let{generateSeatPanorama:m}=await gi();h=m(e,o,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=N("picker.illustrationCaption",{m:h.distanceM})}this.closeSeatView(!1);let c=N("picker.viewFromSeat",{label:e.label}),d=ji({root:this.root,source:r,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:ft(),viewFromSeatLabel:c,real360Label:N("picker.real360"),previewLabel:N("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 kl(vl(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 Hf(e,this.currency,{locale:this.opts.locale,fallback:(s,o)=>`${s} ${o}`,...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=fl(e,t);if(i==null)return;let s=6*36e5,o=Math.min(Math.max(i-t+1e3,1e3),s);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},o)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<Nf}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=ro(t);if(!i)return;let s=this.offerAvailability?.bookingFee?.amountMinor;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i),this.setPricing(this.hostPricing),i.bookingFee?.amountMinor!==s&&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(s=>s.categoryKey===e)??[];return t!==void 0?i.find(s=>(s.tierId??null)===t)??i.find(s=>s.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 s=this.catPriceRange(i);return s?[[i.key,s]]:[]}))}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,s=!i&&t?.upcoming?.pricingMode!=="matrix"?t?.upcoming??null:null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!s){e.classList.remove("has"),e.replaceChildren();return}let o=i??s,r=o.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=o.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));_s(h)&&e.classList.add("sl-offer-early-bird"),d.innerHTML=vi(h,F);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&&o.remaining!=null&&u.push(N("picker.offerRemainingAvailable",{count:o.remaining})),i&&o.endsAt!=null){let k=!this.opts.locale||/^en(?:-|$)/i.test(this.opts.locale)?Rr(o.endsAt):null;if(u.push(k??N("picker.offerUntil",{time:bi(o.endsAt,this.eventTimezone,this.opts.locale)})),k){let E=Math.max(1e3,o.endsAt-Date.now()),L=E%6e4||6e4;this.offerCountdownTimer=setTimeout(()=>{this.offerCountdownTimer=null,Date.now()>=o.endsAt?this.refreshOfferAvailability(!1):this.syncOffer()},Math.min(L+25,E+25))}}if(s?.startsAt!=null&&u.push(N("picker.offerStarts",{time:bi(s.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 y=document.createElement("details");y.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=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."),y.append(g,T),a.append(l,y),e.replaceChildren(a),e.classList.add("has")}paidPrice(e,t,i,s){if(s){let r=Dd(this.opts.pricing?.objects,s,t)??Dd(this.controller.doc?.seatPrices,s,t);if(r!==void 0)return r}let o=s?this.channelByObject.get(s):void 0;if(o&&e){let r=this.pricesByChannel.get(o)?.find(a=>a.categoryKey===e&&a.tierId===(t??null));if(r)return r.price}return Fe(this.opts.pricing?.prices,e,t,i)}heldPrice(e){return this.checkoutMode==="hosted"?e.unitPrice:Ki({...this.hostPricing,seatPrices:this.controller.doc?.seatPrices},e.label,e.categoryKey,e.tierId,e.unitPrice)}hostObjectPrices(){return this.opts.pricing?.objects}legendDeps(){return xd(this)}seatCategory(e){return this.controller.seatByLabel(e)?.categoryKey||null}seatPlaces(e){return e.map(t=>{let i=this.controller.seatByLabel(t),s=i?this.controller.seatDetails(i.id):null,o=s?J(s)||s.rowLabel:null;return{label:t,...s?.sectionLabel?{section:s.sectionLabel}:{},...o?{row:String(o)}:{},...s?.seatNumber!=null?{seat:String(s.seatNumber)}:{}}})}partialLegend(){return this.markedSeatIds.size?this.performanceGroup?.partialWords?.legend??null:null}syncPriceRail(e,t,i=this.legendDeps()){kd(this,e,t,i)}syncPrices(){this.currencyResolved&&Sd(this)}focusCategory(e){Td(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(o=>!e.has(o.label)&&(this.controller.getStatus(o.id)??"free")!=="free");if(!t.length)return;this.controller.deselect(t.map(o=>o.id));let i=this.handedOff&&!this.holdConflicted?(this.hold?.items??this.hold?.seats??[]).map(o=>o.label):[],s=t.find(o=>!i.includes(o.label));s&&this.toast(N("picker.seatJustTakenByAnother",{label:s.label}),"error")}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:i,heldLabels:s,total:o,count:r}=as(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 R=this.performanceGroup?.selectionModeSwitch;R&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${F(R.label)}</button>`)}let c={salesClosed:this.salesClosed,salesState:this.wordsSalesState(),note:this.guestsOnly?da():this.salesUi?.note(this),hasPicks:e.length>0||i.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,season:St(this.performanceGroup),seated:!!this.controller.doc?.objects?.some(f=>f.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(ea(c)),this.els.trayHint&&(this.els.trayHint.textContent=ta(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed),this.salesUi?.sync(this);let d=!e.length&&!i.length&&!Ne(this.gaQty,this.hold?.items??[]);if(hs(this.performanceGroup)&&!this.salesClosed&&!this.hold&&(d||this.bestAvailableBusy||this.bestAvailableConfirm)){let f=(this.controller.doc?.categories??[]).filter(_=>!_.notForSale),R=this.controller.getBestAvailableZones();this.baZone&&!R.some(_=>_.id===this.baZone)&&(this.baZone="");let M=Si(f,this.controller.categoryAvailability());this.baSoldOutSig=[...M].join("|"),this.bestAvailableSoldOut=f.length>0&&M.size===f.length,M.has(this.baCat)&&(this.baCat=""),(!this.bestAvailableSoldOut||this.bestAvailableBusy||this.bestAvailableConfirm)&&a.push(Qr({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:f.map(_=>M.has(_.key)?{..._,soldOut:!0}:_),zones:R,selectedCategory:this.baCat,selectedZone:this.baZone}))}let h=(f,R,M,_=1,D,I,q,Y)=>Yr({categoryLabel:q,offerName:Y,d:f?this.controller.seatDetails(f):null,area:M==="ga"?t.find(X=>X.id===D):void 0,label:R,objectType:M,quantity:_,identity:I,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),m=F,u=[];for(let f of Ca(i)){let R=f.objectType==="ga"?`held:ga:${f.objectId}:${f.tierId??""}`:`held:${f.label}`;l.add(R);let M=f.objectType!=="ga"?this.controller.seatByLabel(f.label):null,_=this.performanceGroup?.packagePricing?f.categoryKey||M?.categoryKey||"":f.categoryKey,D=this.controller.doc?.categories.find(qe=>qe.key===_),I=this.performanceGroup||this.suppressPricing?null:gc(this.controller,f),q=this.performanceGroup?.packagePricing?.seat(f.label,_),Y=(f.tierId&&!I?D?.tiers?.find(qe=>qe.id===f.tierId)?.name:void 0)??q?.types?.options.find(qe=>qe.id===q.types?.selected)?.name,X=this.offerPrice(f.categoryKey,f.tierId??null)?.offerName,fe=f.objectType==="table"?this.controller.tableSelection(f.label):null,ge=M?this.controller.seatDetails(M.id):null,be=this.seatViewEnabled()&&!!M&&f.objectType!=="table"&&!!this.deliverableViewReference(M),Ue=m(this.tf("picker.heldForYou","Held for you")),V=(fe?.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>`:"")+(I?`<select class="tier" data-held-tier="${m(f.label)}" aria-label="${m(N("picker.ticketTierFor",{label:f.label}))}">${ki(I,f.tierId??void 0,m)}</select>`:""),Nt=this.heldPrice(f)*(f.quantity??1);u.push({key:R,fresh:!this.lastTrayKeys.has(R),held:!0,seatIds:[],heldLabels:f.labels,removeAria:N("picker.removeHeldTicketLabel",{label:Vi(f,t)}),locateId:M?.id??null,section:ge?.sectionLabel??"",rowLabel:ge&&J(ge)||"",seatLabel:ge?.seatNumber??f.label,categoryLabel:`${D?.label??_}${Y?` \xB7 ${Y}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(_)??D?.color??"",identityHtml:h(M?.id??null,f.label,f.objectType,f.quantity??1,f.objectId,fe??void 0,`${D?.label??_}${Y?` \xB7 ${Y}`:""}`,X),stateHtml:`<span class="sl-ticket-state held" aria-label="${Ue}" title="${Ue}"><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:Nt,amountText:q?q.amountText:this.suppressPricing?"":this.money(Nt),noteHtml:gt(M??void 0),railHtml:this.performanceGroup?"":Vs(N("picker.removeHeldTicketLabel",{label:Vi(f,t)}),be?f.label:null)})}let y=this.seatViewEnabled();for(let f of e.filter(R=>!s.has(R.label))){let R=`seat:${f.id}`;l.add(R);let M=this.controller.doc?.categories.find(V=>V.key===f.categoryKey),_=this.performanceGroup?.packagePricing?.seat(f.label,f.categoryKey),D=_?.types?`<select class="tier" data-season-type="${m(f.label)}" aria-label="${m(N("picker.ticketTierFor",{label:f.label}))}">`+ki(_.types.options,_.types.selected,m)+"</select>":f.tiers&&f.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${m(f.id)}" aria-label="${m(N("picker.ticketTierFor",{label:f.label}))}">`+ki(f.tiers,f.tierId,m)+"</select>":"",I=f.tiers?.find(V=>V.id===f.tierId)??f.tiers?.[0],q=this.offerPrice(f.categoryKey,I?.id??null)?.offerName,Y=I?.buyerMessage?.trim()||(I?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),X=this.controller.seatDetails(f.id),fe=m(this.tf("picker.selected","Selected")),ge=N("picker.removeSeatLabel",{label:f.label}),be=(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>`:"")+D,Ue=this.paidPrice(f.categoryKey,f.tierId??null,f.price,f.label)*(f.quantity??1);u.push({key:R,fresh:!this.lastTrayKeys.has(R),held:!1,seatIds:[f.id],heldLabels:[],locateId:f.id,section:X?.sectionLabel??"",rowLabel:X&&J(X)||"",seatLabel:X?.seatNumber??f.label,categoryLabel:M?.label??f.categoryKey,identityHtml:h(f.id,f.label,f.objectType,f.quantity??1,f.objectId,f,M?.label??f.categoryKey,q),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??M?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${fe}" title="${fe}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:be,amount:Ue,amountText:_?_.amountText:this.suppressPricing?"":this.money(Ue),removeAria:ge,noteHtml:gt(f)+(Y?`<small class="sl-tier-note">${m(Y)}</small>`:""),railHtml:Vs(ge,y&&f.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(f.label)??{})?f.label:null)})}u.length&&a.push(u.map(Zr).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 g=this.performanceGroup?.selectNight;g&&ql(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 R=f.closest(".sl-chip");if(R.dataset.held){this.removeHeldLabels(decodeURIComponent(R.dataset.held).split(`
3348
- `),R);return}let M=R.dataset.seat.split(" "),_=()=>{this.controller.deselect(M)};if(this.reducedMotion()){_();return}R.classList.remove("sl-enter"),R.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(_,ne.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(f=>{f.addEventListener("click",R=>{R.stopPropagation();let M=decodeURIComponent(f.dataset.tableEdit??""),_=this.controller.tableSelection(M);if(!_)return;let D=i.find(I=>I.label===M&&I.objectType==="table");this.showTableDialog({..._,quantity:D?.quantity??_.quantity},!!D,f)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(f=>{f.addEventListener("change",()=>{let R=f.dataset.seasonType,M=this.performanceGroup?.packagePricing;R&&M?(M.setType(R,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 R=this.controller.seatByLabel(f.dataset.viewLabel);R&&this.openSeatView(R)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(f=>{let R=()=>this.controller.flashSeat(f.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");f.addEventListener("mouseenter",R),f.addEventListener("focusin",R),f.addEventListener("click",M=>{M.target.closest?.('button,a,select,[role="button"],input')||!this.controller.focusSeats?.([f.dataset.locate],{animate:!this.reducedMotion()})||R()})}),Ia(this,this.els.tray,t),this.controller.setGASelection(ka(this.gaQty)),xo(this),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,k=this.lastTrayTotal,E=Ul(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat",St(this.performanceGroup)),L=r?this.performanceGroup?.packagePricing?.total([...i.filter(f=>f.objectType!=="ga"),...e.filter(f=>!s.has(f.label))].map(f=>({label:f.label,categoryKey:f.categoryKey||this.controller.seatByLabel(f.label)?.categoryKey||""}))):null;this.els.count.textContent=L?.countText||E||(r?on("picker.ticketsCount",r)+(this.suppressPricing?"":this.feeWords().tray(i,r,o)):this.salesUi?.view(this)?this.closedWords().pill:this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=L?L.amountText:r&&!this.suppressPricing?this.money(o):"",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=E||(r?on("picker.seatsSelectedCount",r):"")),this.syncCta(r,T);let O=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";r!==S&&!O&&this.animateOnce(this.els.count,"sl-value-pop",380),o!==k&&!O&&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=o,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(){cl(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(dl),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(pl),hl(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||this.performanceGroup)return!1;let s=i[0];i.forEach(r=>this.releasingLabels.add(r)),t?.setAttribute("aria-busy","true");let o=t?.querySelector(".rm");o&&(o.disabled=!0);try{let r=this.handedOff;if(!await this.controller.releaseLabels(i))return this.toast(N("picker.couldNotRemoveLabel",{label:s}),"error"),!1;Aa(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"),o?.isConnected&&(o.disabled=!1)}}async holdSelection(){return this.ctaPhase!=="idle"?$e("busy",this.tf("picker.securingSeats","Securing your seats\u2026")):!this.hold&&this.totalTicketCount()===0?$e("nothing_selected",this.tf("picker.selectSeats","Select seats")):this.handleCta(!1)}async handleCta(e=!0,t=e){if(this.salesClosed&&!this.finishingHold())return $e("sales_closed",this.guestsOnly?Mi().toast:this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."));let i=this.controller.getSelectionValidity(this.totalTicketCount());if(i&&!i.isValid){let o=ms(i,(r,a)=>this.tf(r,a));return this.toast(o,"warning"),$e("selection_invalid",o)}if(this.totalTicketCount()>this.maxTickets){let o=N("picker.removeTicketsUntilOrFewer",{count:this.maxTickets});return this.toast(o,"warning"),$e("too_many_tickets",o)}let s=this.committedSelection();if(this.hold&&(this.salesClosed||!s.some(o=>!(this.hold.items??[]).some(r=>r.label===o.label))&&!Ne(this.gaQty,this.hold.items??[]))){let o=this.hold.seats??s;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(s.map(o=>o.label)),this.setCtaPhase("holding");try{let o=null,r=Sa(this.gaQty,this.controller.currentHold?.()?.items??this.hold?.items??[]),a=this.committedSelection();if(a.length){let d=await this.controller.hold(void 0,this.opts.holdTtlMs);o=d?{holdId:d.holdId,expiresAt:d.expiresAt,seats:d.seats,items:d.items}:null}for(let{areaId:d,tierId:h,qty:m}of r){let u=await this.controller.holdGA(d,m,{tierId:h,ttlMs:this.opts.holdTtlMs});o=u?{holdId:u.holdId,expiresAt:u.expiresAt,seats:u.seats,items:u.items}:o}if(!o){let d=this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");return this.raiseHoldConflict(d),this.setCtaPhase("idle"),this.syncTray(),$e("seats_taken",d)}this.hold=o,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(o.expiresAt),this.flashHeldSeats(o),this.emitHoldChange();let l=this.performanceGroup;return e&&(!l||t&&l.checkoutReady?.(o.holdId)===!0)?(this.handedOff=!0,await this.runCheckoutHandoff(o,o.seats??a)):this.setCtaPhase("idle"),{ok:!0,hold:o,seats:o.seats??a}}catch(o){this.opts.onError?.(o);let r=ao(o);if(r)return this.toast(r,"warning"),this.setCtaPhase("idle"),$e("paused",r);let a=this.guestRefusalMessage(o);if(a)return this.toast(a,"warning"),this.setCtaPhase("idle"),$e("sales_closed",a);let l=o,c=(l.conflicts??[]).map(m=>m.label).filter(Boolean).slice(0,3);l.reason==="event_closed"&&this.setSalesClosed(!0);let d=l.buyerMessage?l.buyerMessage:l.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):l.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):l.reason==="ticket_option_not_applicable"?N("picker.ticketOptionNotApplicable"):c.length?c.length===1?N("picker.labelsNoLongerAvailable.one",{labels:c.join(", ")}):N("picker.labelsNoLongerAvailable.other",{labels:c.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(d),this.setCtaPhase("idle");let h=l.reason==="event_closed"?"sales_closed":l.reason==="companion_pair_required"||l.reason==="ticket_option_not_applicable"?l.reason:"seats_taken";return $e(h,d,c.length?c:void 0)}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){ld(this,e)}stopHoldTimer(){cd(this)}setExtendPrompt(e,t){dd(this,e,t)}refreshExtendPrompt(){pd(this)}handleExtend(){return hd(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())}guestRefusalMessage(e){let t=ca(e);return t==="guest_choice_closed"?pa():t!=="guests_only"?null:(ha(this),this.salesClosed=!0,this.applySalesClosed(),Mi().toast)}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}bookedLine(){return this.checkoutMode==="hosted"?this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way."):this.tf("picker.confirmedOnly","confirmed.")}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((s,o)=>s+o.quantity,0),i=this.performanceGroup?.groupSelectionSummary?.();if(this.els.bookedSub&&(this.els.bookedSub.innerHTML=i?.seats?`<span class="sl-booked-seats">${St(this.performanceGroup)?on("picker.season.ticketsConfirmedAcross",i.seats,{performances:i.performances}):on("picker.group.ticketsConfirmedAcross",i.seats,{performances:i.performances})}</span>`:`<span class="sl-booked-seats">${on("picker.ticketsCount",t)}</span> ${this.bookedLine()}`),this.els.bookedList){let s=this.controller.getGAAreas();this.els.bookedList.innerHTML=e.lineItems.map(o=>{let r=o.rowLabel&&o.objectType!=="ga"?this.controller.seatDetails(this.controller.seatByLabel(o.label)?.id??""):null,a=Je({displayType:o.displayType??r?.displayType,rowType:r?.rowType,objectType:r?.objectType??o.objectType}),c=(o.objectType==="ga"?"":[o.sectionLabel,o.rowLabel&&`${a} ${o.rowLabel}`,o.seatNumber&&`${this.tf("picker.seat","Seat")} ${o.seatNumber}`].filter(Boolean).join(" \xB7 "))||(o.objectType==="ga"?o.displayLabel||Vi(o,s):o.objectType==="table"?`${a} ${o.displayLabel||o.label}`:o.displayLabel||o.label),d=o.quantity>1?` <span class="sl-booked-qty">\xD7${o.quantity}</span>`:"";return`<li>${F(c)}${d}</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),s=null;try{s=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(a){this.opts.onError?.(a)}if(this.destroyed)return;let o=s?.bookingMode==="free",r=s?.providers?.[0]??null;if(!r&&!o){let a=Ar(s?.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:Pr(i)});return}await this.openCheckoutPanel(Lr(i,r,s,this.pubApi.ticketKeysFor(e.holdId),this.controller.getGAAreas()))}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await $t())}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:N,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=>{Mr(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?J(c):void 0,h=this.controller.doc?.categories.find(y=>y.key===r.categoryKey),m=r.tierId?h?.tiers?.find(y=>y.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,...Sl(r,u),currency:r.currency??this.currency,quantity:r.quantity??1}}),s=i[0]?.currency??this.currency,o=i.reduce((r,a)=>r+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:s,lineItems:i,total:o}}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 s=this.els.toast;if(!s)return;s.replaceChildren();let o=document.createElement("span");if(o.textContent=e,s.appendChild(o),s.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}),s.appendChild(r)}s.dataset.tone=t,s.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{s.classList.remove("on","sl-mo-rise"),s.classList.remove("has-action"),s.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 s=this.els.map.clientHeight;if(s<=0)return;let o=i.getBoundingClientRect(),r=o.height||i.offsetHeight||Vf,a=o.height?o.top-this.els.map.getBoundingClientRect().top:s-uo-r,l=Math.round(s-a+Bf);if(l+Ff>s){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),cc({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?Zl(this.tipPos,e,t):null,s=i??Yl(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${s.left}px`,this.tipEl.style.top=`${s.top}px`,i?this.tipEl.dataset.placement=i.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let i=this.performanceGroup,s=po(e.mark,i?.nights?.()),o=s?.states.filter(r=>r.free).length??0;return Nl(s,{locale:this.opts.locale,switchLabel:i?.selectionModeSwitch?.label??null,selectPartialLabel:i?.partialSeatSelection?.label(o)??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 s=this.nightStripFor(e,i);this.tipEl.style.setProperty("--sl-cat",e.categoryColor);let o=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),r=this.performanceGroup?.packagePricing?.seatCardPrice(e.categoryKey)??null;this.tipEl.innerHTML=Wl(e,{price:r?r.price:this.suppressPricing?"":this.money(o),feeNote:r?r.note:this.suppressPricing?"":this.feeWords().seat(o),priceNote:r||!this.suppressPricing?"":this.performanceGroup?.surface==="season"?N("picker.season.includedInPackage"):this.tf("picker.group.pricesPerPerformance","Prices shown per performance"),rowTypeWord:Je(e),ownHold:this.controller.currentHold()?.labels.includes(e.label)===!0,extra:s+(i?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${F(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()}),Jl(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[s,o]of Object.entries(e())){let r=this.controller.idForLabel(s);r&&(i[r]=o,o?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(s=>t.has(s.id)||t.has(s.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.baQty=Math.min(this.baQty,this.maxTickets),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=ni(this.themeMode),i=Re(this.controller.doc?.theme,this.opts.theme,t,this.performanceGroup?.brandAccent);for(let[s,o]of Object.entries(i))e.style.setProperty(s,o);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=ii(()=>{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:ni(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=ni(this.themeMode),i=Re(this.controller.doc?.theme,this.opts.theme,t,this.performanceGroup?.brandAccent),s=Bt(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,o=nr(i,s);for(let r of tr)o?e.style.setProperty(r,o[r]):e.style.removeProperty(r)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){this.hostPricing=e;let t=bl(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=oa(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 Rf(e);return this.opts.messages&&If(this.opts.messages),i===this.paintedLocale||this.applyActiveLocale(i,t),i}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(this.paintedLocale=e,ra(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(),zf(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 Ec(this)}setBuyerView(e,t){Cc(this,e,t)}seatState3dFor(e){return Ac(this,e)}pushAvailabilityTo3d(){Pc(this)}syncSelectionTo3d(){Hc(this)}seatViewFor3d(e){return Ic(this,e)}onView3dSeatPick(e){Oc(this,e)}openAreaChooser(e,t){let i=this.controller.getGAAreas().find(s=>s.id===e);i&&(this.collapseSheet(),Zs(this,i,t))}seatViewCaption(e){return _c(this,e)}saveView3dComparisonSeat(e){Dc(this,e)}clearView3dComparison(){Nc(this)}view3dComparisonSnapshot(e){return Bc(this,e)}enter3d(e){return Fc(this,e)}publish3dTopInset(){Vc(this)}exit3d(){$c(this)}openSeatConfidencePassport(e,t=null){wo(this,e,t)}closeSeatConfidencePassport(e=!0){Bn(this,e)}openView3dComparison(){xc(this)}closeView3dComparison(e=!0){kt(this,e)}getCurrentHold(){return this.hold}async markBooked(e){return ud(this,e)}async resumeHold(e){return this.resumeHoldFromServer(e)}async changeHeldTier(e,t){e.disabled=!0;try{let i=await bc(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(s){this.opts.onError?.(s);let o=ao(s);if(o)return this.toast(o,"warning"),null;let r=this.guestRefusalMessage(s);if(r)return this.toast(r,"warning"),null;let a=s?.reason,l=s?.buyerMessage,c=l||(a==="not_enough_together"?N("picker.couldNotFindSeatsTogether",{count:e}):a==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):a==="ticket_option_not_applicable"?N("picker.ticketOptionNotApplicable"):a==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):a==="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(c,"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 s=Ti(this.controller,t);if(s)throw s;this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let o=this.els.tray?.querySelector(".sl-ba-go");o&&(o.disabled=!0,o.classList.add("sl-busy"),o.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(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(),i=!0;if(t)i=await this.controller.release();else if(e){let s=[...new Set([...(e.items??[]).map(o=>o.label),...(e.seats??[]).map(o=>o.label)])];if(s.length)try{await this.api.release(this.opts.event,s,e.holdId)}catch(o){this.opts.onError?.(o),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 Oe({url:()=>this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},onIdleExpired:()=>Ll(this.idlePauseHost),heldHoldId:()=>this.hold?.holdId??null,onHoldState:(t,i)=>{i==="booked"&&this.settleBookedHold(t)},sink:{...Sn(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=Kr(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 Cl(this.idlePauseHost,e)}resumeFromIdle(){return Pl(this.idlePauseHost)}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=Md({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"),s=[],o=[];for(let r of i){let a=this.controller.seatByLabel(r.label);(a&&this.controller.getStatus(a.id)==="free"?s:o).push(r.label)}Ld(e,{recoverable:s,taken:o,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||Pd({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:i=>this.controller.seatByLabel(i),statusOf:i=>this.controller.getStatus(i),flash:(i,s)=>this.controller.flashSeat(i,s)},e)}).catch(()=>{})}destroy(){this.transportAbort.abort(),this.loadAbort?.abort(),this.loadAbort=null,this.destroyed=!0,this.guestsDeadlineStop?.(),this.guestsDeadlineStop=null,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),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 jf(n){et.prewarm(n)}import{formatMoney as og,loadLocale as rg,setStringOverrides as ag,t as lg}from"@seatlayer/core";var $d="seatlayer-performance-group-picker-style";function zd(){if(document.getElementById($d))return;let n=document.createElement("style");n.id=$d,n.textContent=`
3347
+ </div>`,e.append(i)}buildErrorCard(e,t){let i=dm[t],s=document.createElement("div");Object.assign(s.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 o=document.createElement("h2");o.textContent=i.title,Object.assign(o.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()),s.append(o,r,a),e.append(s)}};function tn(n,e){let t=(a,[l,c])=>{a.textContent=v(l,c??l),a.dataset.slT=l},i=document.createElement("div");i.className="sl-loading-state";let s=document.createElement("div");if(s.setAttribute("role",e.busy?"status":"alert"),s.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 o=document.createElement("div");if(o.className="sl-boot-title",t(o,e.title),s.append(o),e.description){let a=document.createElement("p");a.className="sl-loading-description",t(a,e.description),s.append(a)}i.append(s);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 pm(n){let{viewportWidth:e,viewportHeight:t,offsetTop:i,offsetLeft:s,clientWidth:o,clientHeight:r,innerHeight:a,largeViewportHeight:l}=n;if(![e,t,i,s].every(Number.isFinite)||e<=0||t<=0)return null;let c=Number.isFinite(o)&&o>0?o: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:s}}function dl(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=pm({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`})},s=0,o=0,r=0,a=()=>{s&&window.cancelAnimationFrame(s),o&&window.cancelAnimationFrame(o),r&&window.clearTimeout(r),s=window.requestAnimationFrame(()=>{s=0,o=window.requestAnimationFrame(()=>{o=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),()=>{s&&window.cancelAnimationFrame(s),o&&window.cancelAnimationFrame(o),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 hm=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(",");function ts(n,e){let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let s=document.createElement("div");s.className="sl-modal-frame",s.style.setProperty("--sl-bg",e),s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.setAttribute("aria-label",n),s.tabIndex=-1,i.appendChild(s),document.body.appendChild(i);let o=document.body.style.overflow;document.body.style.overflow="hidden";let r=dl(i),a=()=>{let u=[...s.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(b=>b.isConnected&&!b.closest('[hidden], [aria-hidden="true"], [inert]'));return u[u.length-1]??s},l=(u,b)=>{let g=u;for(;g;){let T=window.getComputedStyle(g);if(g.hidden||g.getAttribute("aria-hidden")==="true"||g.hasAttribute("inert")||T.display==="none"||T.visibility==="hidden"||T.visibility==="collapse")return!0;if(g===b)return!1;g=g.parentElement}return!0},c=u=>[...u.querySelectorAll(hm)].filter(b=>b.tabIndex>=0&&!b.matches(":disabled")&&!l(b,u)),d=(u,b)=>{let g=c(u),T=b?g[g.length-1]:g[0];T?T.focus({preventScroll:!0}):(u.hasAttribute("tabindex")||(u.tabIndex=-1),u.focus({preventScroll:!0}))},h=null,m=!0;return{scrim:i,frame:s,trapKeys(u){let b=g=>{if(g.key==="Tab"){if(g.defaultPrevented)return;let T=a(),S=c(T),k=S[0],E=S[S.length-1],L=document.activeElement;!k||!E?(g.preventDefault(),d(T,g.shiftKey)):L===T||!L||!T.contains(L)?(g.preventDefault(),(g.shiftKey?E:k).focus({preventScroll:!0})):g.shiftKey&&L===k?(g.preventDefault(),E.focus({preventScroll:!0})):!g.shiftKey&&L===E&&(g.preventDefault(),k.focus({preventScroll:!0}));return}g.key==="Escape"&&u(g)};return h=b,document.addEventListener("keydown",b),b},onScrimPress(u){i.addEventListener("mousedown",b=>{b.target===i&&u()})},focusFirst(){d(a(),!1)},teardown(u=!0){m&&(m=!1,r(),document.body.style.overflow=o,h&&document.removeEventListener("keydown",h),h=null,i.remove(),u&&t?.isConnected&&t.focus({preventScroll:!0}))}}}function pl(n,e){let t=new Set(["chart","objects","resume","availability"]),i=new Map;return new Proxy(Object.create(n),{get(s,o){let r=n,a=Reflect.get(r,o,r);return typeof a!="function"?a:(i.has(o)||i.set(o,t.has(String(o))?async(...l)=>{let c=await Kt(()=>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(o))}})}import{PickerController as jf,effectiveFloorOverview as Gf,formatMoney as Kf,getLocale as xs,loadLocale as Uf,setStringOverrides as qf,t as N,tCount as rn,seatPriceFor as $d}from"@seatlayer/core";import{isAuthoredSeatView as Wf,seatViewDisclosure as Yf}from"@seatlayer/core/view3d/crossfade/panorama";function hl(n){return!!n&&n.clientWidth>0&&n.scrollWidth>n.clientWidth+1}function um(n){return n.some(e=>hl(e))}var ns="data-fit-gone",mm=12;function ao(n,e,t=hl){if(!n)return 0;for(let i of e)n.classList.remove(i.cls);if(n.querySelectorAll(`[${ns}]`).forEach(i=>{i.removeAttribute(ns),i.hidden=!1}),n.dataset.fit="0",n.clientWidth<=0||!t(n))return 0;for(let i=0;i<e.length;i+=1){let s=e[i];i>0&&n.classList.remove(e[i-1].cls),n.classList.add(s.cls),n.dataset.fit=String(i+1);let o=s.give?s.give(n):!0;if(!t(n))return i+1;if(s.repeat&&s.give){for(let r=1;o&&r<mm;r+=1)if(o=s.give(n),!t(n))return i+1}}return e.length}function fm(n,e="[data-fit-seg]"){let t=[...n.querySelectorAll(e)].filter(i=>!i.hidden);return t.length<2?!1:ul(t[t.length-1])}function gm(n,e){let t=n.querySelector(e);return t&&!t.hidden?ul(t):!1}function ul(n){let e=n.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(ns,""),e.hidden=!0),n.setAttribute(ns,""),n.hidden=!0,!0}function bm(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 ml(n){if(!n)return 0;let e=n.querySelector(".sl-confirm-cancel"),t=n.querySelector(".sl-confirm-add-t");return ao(n,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>bm(e)}],()=>um([e,t]))}function fl(n){return ao(n,[{cls:"sl-fit-notype",give:e=>gm(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>fm(e),repeat:!0}])}function gl(n){return n?(n.classList.add("sl-fitpill"),ao(n,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var nn;function bl(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(nn===void 0)try{nn=document.createElement("canvas").getContext("2d")}catch{nn=null}if(!nn)return!1;let i=getComputedStyle(n);nn.font=`${i.fontStyle} ${i.fontWeight} ${i.fontSize} ${i.fontFamily}`;let s=nn.measureText(e).width,o=(parseFloat(i.paddingLeft)||0)+(parseFloat(i.paddingRight)||0)+(parseFloat(i.borderLeftWidth)||0)+(parseFloat(i.borderRightWidth)||0);return s+o<=t?!1:(n.dataset.fit="row",!0)}function ym(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 vm=["on-sale","low","sold-out","presale","closed"];function Dn(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function lo(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function yl(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 s=e.remaining;if(s!=null&&(typeof s!="number"||!Number.isInteger(s)||s<0))return;let o={index:i,count:t,remaining:s??null};if(e.pricingMode!==void 0){if(e.pricingMode!=="matrix")return;o.pricingMode="matrix"}if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;o.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;o.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;o.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let r of["startsAt","endsAt"]){if(e[r]===void 0)continue;let a=lo(e[r]);if(a===void 0)return;o[r]=a}return o}function wm(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():"",b=m.tierId===null?null:typeof m.tierId=="string"&&m.tierId.trim()?m.tierId.trim():void 0,g=Dn(m.price);if(!u||b===void 0||g===void 0||g===null)return;let T=`${u}\0${b??""}`;if(d.has(T))return;d.add(T),c.push({categoryKey:u,tierId:b,price:g})}i.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let s=[],o=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||o.has(l)||!i.has(c))return;o.add(l),s.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:s}}function co(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=vm.find(h=>h===e.state);if(!t)return null;let i=Dn(e.fromPrice),s=Dn(e.previousPrice);if(i===void 0||s===void 0)return null;let o=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(o===void 0)return null;let r=yl(e.release);if(r===void 0)return null;let a=e.upcoming===void 0?null:yl(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,b=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!b)return null;let g=Dn(u.price),T=Dn(u.previousPrice);if(g==null||T===void 0)return null;let S={categoryKey:b,price:g,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 k of["startsAt","endsAt"]){if(u[k]===void 0)continue;let E=lo(u[k]);if(E===void 0)return null;S[k]=E}h.push(S)}l=h}let c=wm(e.channelPricing);if(c===void 0)return null;let d=lo(e.nextPriceChangeAt);return d===void 0?null:{state:t,fromPrice:i,previousPrice:s,currency:o,release:r,upcoming:a,prices:l,channelPricing:c,...e.nextPriceChangeAt!==void 0?{nextPriceChangeAt:d}:{},...e.bookingFee!==void 0?{bookingFee:ym(e.bookingFee)}:{}}}function vl(n){return n?.changed!==!1}function wl(n,e){if(!n)return null;let t=null,i=s=>{s!=null&&s>e&&(t===null||s<t)&&(t=s)};for(let s of[n.release,n.upcoming])i(s?.startsAt),i(s?.endsAt);for(let s of n.prices)i(s.startsAt),i(s.endsAt);return i(n.nextPriceChangeAt),t}function xl(n){let e={};for(let t of n?.prices??[])if(t.tierId==null)e[t.categoryKey]=t.price;else{let i=e[t.categoryKey],s=typeof i=="number"?{base:i}:i??{};e[t.categoryKey]={...s,tiers:{...s.tiers,[t.tierId]:t.price}}}return e}function kl(n,e){let t={...n};for(let[i,s]of Object.entries(xl(e))){let o=t[i];t[i]=typeof s=="number"?s:{...typeof o=="number"?{base:o}:o,...s,tiers:{...typeof o=="object"?o.tiers:{},...s.tiers}}}return t}import{fromMinorUnits as xm,t as Sl}from"@seatlayer/core";var km={seat:()=>"",tray:n=>El(n)?Cl():""};function Tl(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 El(n){return n.some(e=>(e.bookingFeeMinor??0)>0)}function Cl(){return` \xB7 ${Sl("picker.fee.included")}`}function Al(n,e,t){return n?{seat:i=>i>0?Sl("picker.fee.includesAmount",{amount:t(xm(n.amountMinor,e))}):"",tray:(i,s,o)=>{let r=i.reduce((a,l)=>a+(l.quantity??1),0);return El(i)||s>r&&o>0?Cl():""}}:km}function Pl(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 Sm}from"@seatlayer/core";var Ll="maintenance_mode";function Tm(n){if(!n||typeof n!="object")return!1;let e=n;return e.reason===Ll||e.code===Ll}function Em(n){return typeof n!="number"||!Number.isFinite(n)||n<0?null:Math.max(1,Math.ceil(n/60))}function po(n){if(!Tm(n))return null;if(typeof n.notice=="string"&&n.notice.trim())return n.notice.trim();let e=Em(n.retryAfterS);if(e===null)return v("picker.maintenancePausedShortly","Booking is paused for a few minutes for maintenance. Please try again shortly.");let t=Sm("picker.maintenancePaused",e);return t==="picker.maintenancePaused"?`Booking is paused for maintenance. Please try again in about ${e} minute${e===1?"":"s"}.`:t}var Ml=["pointerdown","pointermove","keydown","wheel","touchstart"],is=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 Ml)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 Ml)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,s)=>setTimeout(i,s));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 Hl(n,e){let t=await n.pubApi?.pickerIdleMinutes().catch(()=>null)??null;if(n.destroyed||n.idleClock)return;let i=new is({minutes:t??30,blocked:()=>!!n.hold,onIdle:()=>Rl(n)});i.enabled&&(n.idleClock=i,i.attach(e))}function Rl(n){n.destroyed||!n.root||n.holdExpiredEl||(n.realtime?.stop(),n.realtime=null,n.showAccessPanel({reason:"idle",retryable:!0}))}async function Il(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 Ol(n){if(!n.destroyed){if(n.hold||n.idleClock?.recentlyActive()){n.pubApi?.rotateViewerId(),n.realtime?.restart();return}Rl(n)}}import{t as ho}from"@seatlayer/core";function _l(n,e,t=[],i=8,s=[]){let o=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),o>0?i:0),a=s.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(o)),right:Math.max(0,Math.ceil(a)),bottom:Math.max(0,Math.ceil(r)),left:0}}function Dl(n){let e=document.createElement("div");e.className="sl-floors sl-levels on",e.setAttribute("role","group"),e.setAttribute("aria-label",ho("picker.chooseLevel")),e.title=ho("picker.floorHelp");let t=n.tf("picker.allLevels","All levels"),i=[...n.floors.map((s,o)=>({id:s.id,name:s.name,code:Cm(o)})).reverse(),{id:"",name:t,code:""}];for(let s of i){let o=document.createElement("button");if(o.type="button",o.className="sl-level",o.dataset.level=s.id,o.setAttribute("aria-pressed","false"),o.title=s.name,s.code){let a=document.createElement("b");a.className="sl-level-code",a.textContent=s.code,o.appendChild(a),o.setAttribute("aria-label",`${s.name} (${s.code})`)}let r=document.createElement("span");if(r.className="sl-level-name",r.textContent=s.name,o.appendChild(r),!s.code){let a=document.createElement("span");a.className="sl-level-short",a.setAttribute("aria-hidden","true"),a.textContent=ho("picker.allLevelsShort"),o.appendChild(a)}o.addEventListener("click",()=>n.onChoose(s.id)),e.appendChild(o)}return e.addEventListener("keydown",s=>{if(s.key!=="ArrowUp"&&s.key!=="ArrowDown")return;let o=[...e.querySelectorAll(".sl-level")],r=o.indexOf(document.activeElement);r<0||(s.preventDefault(),o[Math.max(0,Math.min(o.length-1,r+(s.key==="ArrowUp"?-1:1)))].focus())}),e}function Cm(n){return n===0?"G":String(n)}function Nl(n,e,t){if(!n)return;let i=t?"":e;for(let s of n.querySelectorAll(".sl-level"))s.setAttribute("aria-pressed",String(s.dataset.level===i))}var ss=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 s=this.host.activeFloorObjects().find(k=>k.type==="section"&&k.id===t.id)?.outline;if(!s||s.length<3)return 0;let o=s.map(k=>this.host.controller.worldToScreen(k)),r=o.map(k=>k.x),a=o.map(k=>k.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(),b=u.left-m.left,g=u.top-m.top,T=Math.max(0,Math.min(b+u.width,l+d)-Math.max(b,l)),S=Math.max(0,Math.min(g+u.height,c+h)-Math.max(g,c));return T*S/(d*h)}};import{t as yo,tCount as Fm}from"@seatlayer/core";import{contrastRatio as Vm}from"@seatlayer/core/core/color";import{t as Ae,tCount as Nn}from"@seatlayer/core";function uo(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 os=(n,e)=>uo(n,e,{dateStyle:"medium"}),rs=(n,e)=>uo(n,e,{timeStyle:"short"}),sn=(n,e)=>uo(n,e,{weekday:"short",day:"numeric",month:"short"});function Bl(n,e,t,i){return!n.length||n.length>=e?null:{summary:i,labels:n.map(s=>`${os(s,t)} \xB7 ${rs(s,t)}`)}}function Am(n,e){let t=new Set(e);return n.map(i=>({...i,free:!t.has(i.eventKey)}))}function Fl(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 Pm(n,e,t="",i=!1){if(!n.length)return"";let s=n.map(o=>{let r=o.free?e.free:e.blocked,a=i&&o.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${A(o.eventKey)}" aria-label="${A(`${o.shortDate}: ${r}`)}" checked>`:"";return`<li class="sl-night${o.free?" ok":" no"}" aria-label="${A(`${o.shortDate}: ${r}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${A(o.shortDate)}</span><span class="st">${A(r)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${A(e.title)}</div><ul class="sl-nightstrip">${s}</ul><p class="sl-tip-nights-note">${A(e.notAvailableOn)}</p>`+t+"</div>"}function Lm(n){return n.selectPartialLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${A(n.selectPartialLabel)}</button>`:n.switchLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${A(n.switchLabel)}</button>`:n.switchLabel||n.selectPartialLabel?"":`<p class="sl-tip-advice">${A(n.advice)}</p>`}function Mm(n){return Number(n.available)+Number(n.selected)+Number(n.partial)+Number(n.unavailable)}function Vl(n,e,t){if(Mm(n)<2)return"";let i=(o,r,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${o}"${a}></i>${A(r)}</li>`,s=[];return n.available&&s.push(i("sl-pg-sw-free",e.available,` style="background:${A(t)}"`)),n.selected&&s.push(i("sl-pg-sw-sel",e.selected)),n.partial&&s.push(i("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${A(t)}"`)),n.unavailable&&s.push(i("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${A(e.title)}">${s.join("")}</ul>`}function $l(n,e){if(!n.length)return"";let t=n.map(i=>{let s=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="${A(i.eventKey)}"><span class="n">${A(i.name)}</span><span class="s">${A(s)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${A(e.title)}"><div class="sl-pg-nights-title">${A(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function mo(n,e){if(n?.kind!=="partial"||!e?.length)return null;let t=n.data?.blockedEventKeys??[],i=Am(e,t);return{states:i,missing:i.filter(s=>!s.free).map(s=>s.shortDate)}}function zl(n,e){return n?Pm(n.states,{title:e.words?.title??v("picker.group.partlyAvailableTitle","Free on some nights only"),free:v("picker.group.nightFree","Free"),blocked:v("picker.group.nightBlocked","Not available"),notAvailableOn:Ae("picker.group.notAvailableOn",{dates:Fl(n.missing,e.locale)})},Lm({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:e.words?.advice??v("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function Hm(n,e,t,i){if(!n.length)return"";let s=new Set(e),o=new Set(t),r=n.map(a=>{let l=s.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${A(a.eventKey)}" aria-label="${A(`${a.shortDate}: ${l?i.available:i.unavailable}`)}"${l&&o.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${A(a.shortDate)}</span><span class="sl-confirm-date-state">${A(l?i.available:i.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${A(i.title)}</legend><p class="sl-confirm-dates-copy">${A(i.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${A(i.selectAll)}</span></label><ul>${r}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function jl(n,e,t,i){let s=e.availableEventKeys(t);return Hm(n,s,e.includedEventKeys(),{title:Ae("picker.group.confirmDatesTitle"),copy:s.length===n.length?Ae("picker.group.confirmAllDatesCopy").replace("{count}",String(n.length)):Ae("picker.group.confirmPartialDatesCopy").replace("{available}",String(s.length)).replace("{total}",String(n.length)),selectAll:Ae("picker.group.confirmSelectAll"),available:i("picker.group.nightFree","Available"),unavailable:i("picker.group.nightBlocked","Unavailable")})}function Gl(n){return[...n.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function Kl(n,e,t){let i=[...n.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!i.length)return;let s=n.querySelector(".sl-confirm-add"),o=n.querySelector("[data-pg-confirm-all]"),r=()=>{let a=i.filter(d=>!d.disabled),l=Gl(n).length;o&&(o.checked=l===a.length,o.indeterminate=l>0&&l<a.length);let c=n.querySelector("[data-pg-confirm-summary]");c&&(c.textContent=l===a.length?Ae("picker.group.confirmAllSelected").replace("{count}",String(l)):Ae("picker.group.confirmSelectedOfAvailable").replace("{selected}",String(l)).replace("{available}",String(a.length))),s.disabled=l===0,s.textContent=l?e.label(l):Ae("picker.group.confirmChooseOne"),t()};i.forEach(a=>a.addEventListener("change",r)),o?.addEventListener("change",()=>{i.filter(a=>!a.disabled).forEach(a=>{a.checked=o.checked}),r()}),r()}async function Ul(n,e,t){if(!n||!t||!n.querySelector("[data-pg-confirm-event-key]"))return!0;let i=Gl(n);if(!i.length)return!1;let s=n.querySelector(".sl-confirm-add");return s?.setAttribute("aria-busy","true"),s&&(s.disabled=!0),await t.apply(e,i)?!0:(s?.removeAttribute("aria-busy"),s?.isConnected&&(s.disabled=!1),!1)}function ql(n,e,t,i=!1){if(!n)return"";let s={label:e,free:n.states.length-n.missing.length,total:n.states.length,dates:Fl(n.missing,t)};return i?Ae("picker.season.seatPartlyAvailable",s):Ae("picker.group.seatPartlyAvailable",s)}function Wl(n,e){let t=n.map((i,s)=>{let o=i.state==="done"?e.done:i.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${A(i.id)}" data-state="${A(i.state)}"${i.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${i.state==="done"?"\u2713":String(s+1)}</span><span class="l">${A(i.label)}</span><span class="sl-pg-sr">${A(o)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${A(e.label)}">${t}</ol>`}function fo(n,e){return`<ul class="sl-pg-cards">${n.map(i=>`<li class="sl-pg-card" data-event-key="${A(i.eventKey)}"><span class="n">${A(i.name)}</span><time datetime="${A(i.iso)}"><span class="d">${A(i.date)}</span><span class="t">${A(i.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${A(e)}</p>`}function Yl(n){let e=n.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${A(t.eventKey)}"><span class="n">${A(t.name)}</span><span class="s">${A(t.labels.length?t.labels.join(", "):n.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${A(n.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(n.note?`<p class="sl-pg-pane-note">${A(n.note)}</p>`:"")+(n.total?`<div class="sl-pg-pane-total"><span>${A(n.total.label)}</span><b>${A(n.total.amount)}</b></div>`:"")+(n.holdStatus?`<p class="sl-pg-hold-status" role="status">${A(n.holdStatus)}</p>`:"")}function Zl(n){let e=Math.max(0,n);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function Xl(n,e,t=!1){if(!n||n.seats<=0)return"";if(e==="same_seat"){let i=n.perPerformance??n.seats;return n.totalPerformances&&n.performances<n.totalPerformances?Nn("picker.group.performancesChosenOf",i,{chosen:n.performances,total:n.totalPerformances}):t?Nn("picker.season.seatsEveryDate",i):Nn("picker.group.seatsEveryPerformance",i)}return n.perPerformance!=null&&n.performancesChosen===n.performances?Nn("picker.group.seatsPerPerformance",n.seats,{per:n.perPerformance}):Nn("picker.group.performancesChosenOf",n.seats,{chosen:n.performancesChosen,total:n.performances})}function Ql(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",s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),i())})})}function $e(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Rm(n,e){let t=n.objectType==="table"&&!!n.bookingMode,i=n.objectType==="booth",s=t||i||!n.seatNumber,o=s?n.rowLabel??n.displayLabel??n.label:n.seatNumber,r=t?`${v("picker.guests","Guests")} ${n.bookingMode==="variable"?`${n.minOccupancy}\u2013${n.maxOccupancy}`:n.capacity}`:!i&&n.rowLabel?`${e} ${J(n)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${s?" name":""}">${$e(o)}</span>`+(r?`<span class="sl-tip-row">${$e(r)}</span>`:"")+"</div>"+(n.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${v("picker.section","Section")}</span><span class="sl-tip-secname">${$e(n.sectionLabel)}</span></div>`:"")+"</div>"}function Jl(n,e){let t=n.status==="not_for_sale",i=n.mark?.kind==="partial",s=n.status==="free"||i?"":`<span class="sl-tip-tag">${e.ownHold?v("picker.heldForYou","Held for you"):v("picker.group.legendUnavailable","Unavailable")}</span>`,o=t?"":e.price,r=o?`<span class="sl-tip-amt">${$e(o)}</span>`:"",a=!o&&e.priceNote?`<div class="sl-tip-note">${$e(e.priceNote)}</div>`:"",l=o&&e.feeNote?`<div class="sl-tip-fee">${$e(e.feeNote)}</div>`:"",c=gt(n,{compact:!0}),d=e.reason?`<div class="sl-tip-reason">${$e(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Rm(n,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${$e(n.categoryColor)}"></span><span class="sl-tip-name">${$e(n.categoryLabel)}</span>`+s+r+"</div>"+l+a+d+c+(e.extra??"")}function ec(n,e,t,i){let s=n.x+14,o=n.y-i.height-12,r=n.y+18,a=o;s+i.width>e-8&&(s=n.x-i.width-14),o<8&&r+i.height<=t-8&&(a=r);let l=Math.max(8,t-i.height-8);return{left:Math.max(8,Math.min(s,Math.max(8,e-i.width-8))),top:Math.max(8,Math.min(a,l))}}function tc(n,e,t,i=22){let s=Math.max(8,Math.min(n.x-t.width/2,Math.max(8,e.width-t.width-8))),o=n.y-i-t.height,r=n.y+i;return o>=8?{left:s,top:o,placement:"above"}:r+t.height<=e.height-8?{left:s,top:r,placement:"below"}:{left:s,top:Math.max(8,Math.min(o<8?r:o,Math.max(8,e.height-t.height-8))),placement:o<8?"below":"above"}}var go=14,Im=12,Om=12,_m=8;function nc(n,e,t,i=Im){let s=e.height-go-t.height,o=Om,r=s-i;if(r<=o)return{placement:"sheet",nudgeY:0};let a=(o+r)/2-n;return Math.abs(a)<=_m?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function ic(n,e,t,i,s=0){let o=t.width/2+12,r=Math.max(o,Math.min(e.width-o,n.x)),a=n.y+s+t.height+24<=e.height,l=n.y-s<t.height+24&&a?"below":"above",c=l==="above"?n.y-s:n.y+s,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 sc(n,e,t){let i=n.querySelector("[data-pg-select-partial]"),s=[...n.querySelectorAll("[data-pg-event-key]")],o=()=>s.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),r=()=>{if(!i)return;let a=o().length;i.disabled=a===0,i.textContent=e?.(a)??i.textContent};s.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=o();a.length&&t?.(a)})}function Je(n){let e=n?.displayType?.trim()||n?.rowType?.trim();return e||(n?.objectType==="table"?v("picker.table","Table"):n?.objectType==="booth"?v("picker.booth","Booth"):v("picker.row","Row"))}var Dm="sl-confirm-scrim",Nm="--sl-scrim-mask";function Bm(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 oc(n,e,t,i){let s=n??document.createElement("div");return n||(s.className=Dm),s.style.setProperty(Nm,Bm(i)),t.parentNode===e?s.nextSibling!==t&&e.insertBefore(s,t):s.parentNode!==e&&e.appendChild(s),s}function bo(n){return n?.remove(),null}var rc={passport:!1,compare:!1},$m=360,zm=160,jm=700,ac=450,Gm=8;function lc(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function Km(n){return Vm("#ffffff",n)>=3?"#ffffff":"#0b0f19"}var as=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.closedByThisPress=null;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=Jt(e)?e.viewUrl??"":"",s=Qi(t);if(!i&&!s)return"";let o=i?null:Ji(e,e.focalPoint??t.focalPoint);if(!i&&o==null)return"";let r="";if(!i)return r;let a=F(yo("picker.viewFromSeat",{label:e.label})),l=F(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;if(t==="remove"&&this.closedByThisPress===e.id){this.closedByThisPress=null;return}if(t==="remove"&&i.performanceGroup()&&i.controller.currentHold()?.labels.includes(e.label))return;let s=this.mode==="remove"?void 0:this.seat?.id;this.mode=t,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(I=>I.toggleAttribute("inert",!0)),i.controller.setSelectionFocus(e.id),s&&s!==e.id&&i.controller.deselect([s]),i.hideTooltip();let o=i.controller.seatDetails(e.id),r=i.controller.doc?.categories.find(I=>I.key===e.categoryKey),a=o?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),l=a!=null?i.paidPrice(e.categoryKey,o?.tierId??r?.tiers?.[0]?.id??null,a,e.label):void 0,c=Gr(o,e.displayLabel??e.label,Je(o)),d=o?.tiers??r?.tiers??[],h=o?.tierId??d[0]?.id,m=i.suppressPricing()?"":Ti(d,h,I=>i.money(i.paidPrice(e.categoryKey,I.id,I.price,e.label)),I=>i.offerName(e.categoryKey,I.id)),u=i.buyerView()==="venue3d",b=i.performanceGroup()?.confirmDateSelection??void 0,g=b?i.performanceGroup()?.nights?.()??[]:[],T=b?jl(g,b,e.id,(I,q)=>i.tf(I,q)):"";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",yo("picker.confirmSeatLabel",{label:e.label}));let k=i.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??r?.color??"#6e7bff";S.style.setProperty("--sl-cat",k),S.style.setProperty("--sl-cat-ink",Km(k));let E=String(o?.categoryLabel??r?.label??e.categoryKey),L=i.controller.categoryAvailability()[e.categoryKey],U=typeof L=="number"&&L>0?Fm("picker.leftCount",L):"",O=i.packagePrice?.(e.categoryKey)??null,f=i.suppressPricing()?`${o?.displayLabel??e.displayLabel??e.label}`:`${o?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?i.tf("picker.priceNotSupplied","Price not supplied"):i.money(l)}`,R=rc.passport?jr(e,f,u):"",M=rc.compare?zr(e,u?i.view3dCompareSeatIds():null):"";S.innerHTML=Wr({identityFields:c,identity:Kr(o,e.displayLabel??e.label,Je(o)),marker:$r({...o?.wheelchairSpaceType?{wheelchairSpaceType:o.wheelchairSpaceType}:{}}),see3dPill:Ur(i.canOffer3d(),u),categoryColor:k,categoryLabel:E,priceLabel:O?O.price:!i.suppressPricing()&&l!=null?i.money(l):"",feeNote:O?O.note:!i.suppressPricing()&&l!=null?i.feeNote?.(l)??"":"",categoryLeftLabel:U,tierChoices:m,groupDates:T,wheelchair:"",commercial:gt({...e.accessibility?.length?{accessibility:e.accessibility}:{},...o?.wheelchairSpaceType?{wheelchairSpaceType:o.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{},...o?.aisle?{aisle:!0}:{},...o?.boothType?{boothType:o.boothType}:{},...o?.entrance?{entrance:o.entrance}:{}}),thumb:i.seatViewEnabled()&&i.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:u?`<div class="sl-confirm-inspect-row">${R}${M}${zs(i.canOffer3d(),u)}</div>`:zs(i.canOffer3d(),u),see3dRow:qr(i.canOffer3d(),u),cancelLabel:yo("common.cancel"),selectLabel:t==="remove"?i.tf("picker.removeSeat","Remove seat"):i.addSeatLabel(o?.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 _=S.querySelector(".sl-confirm-thumb"),D=_?.closest(".sl-confirm-thumbwrap")??null;if(_&&D){let I=!1,q=()=>{if(I||!D.isConnected)return;I=!0;let Q=()=>{D.remove(),this.el===S&&i.reanchor()};if(i.reducedMotion()||typeof requestAnimationFrame!="function"){Q();return}D.style.height=`${D.offsetHeight}px`,D.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{D.style.height="0px",D.style.opacity="0"}),setTimeout(Q,zm)};_.addEventListener("error",q),_.addEventListener("load",()=>{_.naturalWidth||q()});let Y=e.viewMeta?.previewUrl??e.viewUrl;Y?i.resolveAssetUrl(Y).then(Q=>{if(!(!S.isConnected||this.el!==S)){if(!Q){q();return}_.src=Q}}).catch(Q=>{q(),i.onError(Q)}):q()}i.reanchor(),this.liftSeatClearOfSheet(e),S.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{i.openSeatView(e)}),S.querySelector(".sl-confirm-confidence")?.addEventListener("click",I=>{i.openSeatConfidencePassport(e,I.currentTarget instanceof HTMLElement?I.currentTarget:null)}),S.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>i.saveView3dComparisonSeat(e)),S.querySelectorAll("[data-confirm-tier]").forEach(I=>{I.addEventListener("click",()=>{let q=I.dataset.confirmTier,Y=d.find(be=>be.id===q);if(!Y)return;i.controller.setSeatTier(e.id,Y.id),S.querySelectorAll("[data-confirm-tier]").forEach(be=>{be.setAttribute("aria-pressed",String(be===I))});let Q=S.querySelector(".sl-confirm-price"),fe=i.paidPrice(e.categoryKey,Y.id,Y.price,e.label);Q&&(Q.textContent=i.money(fe));let ge=S.querySelector(".sl-confirm-fee");ge&&(ge.textContent=i.feeNote?.(fe)??""),i.reanchor()})}),S.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(I=>{I.addEventListener("pointerdown",yi,{once:!0}),I.addEventListener("click",()=>{i.buyerView()==="venue3d"?(i.dismiss(),i.view3dHandle()?.flyToSeat(e.id)):(i.rememberView3dReturnSeat(e),i.dismiss(),i.enter3d(e.id))})}),Kl(S,b,()=>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 I=S.querySelector(".sl-confirm-add");I?.focus(),i.liftToastOverConfirm(),i.fitTranslatedRows(),i.inviteCommit(S,I)})}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 s=t.els().map;if(!s)return;let o=t.controller.worldToScreen({x:e.x,y:e.y}),r=t.controller.getRenderer(),a=r?.getCameraGestureCount?.()??0,{nudgeY:l}=nc(o.y,{height:s.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()+jm: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=oc(this.scrim,i,this.el,t),Sa(this.el,t,i),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=bo(this.scrim);let s=i.clientWidth,o=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=ic(t,{width:s,height:o},{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`,Vi(this.el,t,{left:d.left,top:d.top,width:r,height:a})}ghostActivation(){return lc()?performance.now()-this.shownAt<ac:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,i=new Map,s=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)<=Gm&&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=s;let o=t.root();setTimeout(()=>{this.outsideTap===s&&((o??document).addEventListener("pointerdown",s,!0),(o??document).addEventListener("pointerup",s,!0),(o??document).addEventListener("pointercancel",s,!0))},lc()?ac: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=bo(this.scrim),this.settleLift(),this.el&&$i(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 s=this.el?.querySelector(".sl-confirm-add")??null;if(s?.classList.contains("is-adding")||!await Ul(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let o=()=>{let l=e.root()?.dataset.layout==="narrow"?this.lift:null;l&&(this.lift=null),e.dismiss();let c=e.controller.worldToScreen(t);io(e.els(),c,t,e.controller.doc?.categories,()=>{e.cartLanded?.(),l&&(this.lift=l,this.settleLift())})};if(!s||e.reducedMotion()){o();return}s.classList.remove("sl-confirm-add-invite"),s.classList.add("is-adding"),s.setAttribute("aria-disabled","true");let r=s.querySelector(".sl-confirm-add-t");r&&(r.textContent=e.tf("picker.added","Added")),e.scheduleMotion(o,$m)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"?e.controller.deselect([t.id]):(this.closedByThisPress=t.id,setTimeout(()=>{this.closedByThisPress=null},0)),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 cc(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 dc(n,e){return n&&n!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}import{t as vo}from"@seatlayer/core";var Um=12;function pc(n,e){let t=e.floors(),i=new Set(t.map(O=>O.label.trim().toLocaleLowerCase())),s=e.zones().filter(O=>O.seatCount>0&&!i.has(O.label.trim().toLocaleLowerCase())),o=e.sections().filter(O=>O.seatCount>0&&!i.has(O.label.trim().toLocaleLowerCase())),r=s.length>1?[]:o,a=t.length>1,l=s.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>',b=document.createElement("span");m.innerHTML=u,m.appendChild(b);let g=()=>{for(let O of d.querySelectorAll(":scope > div")){let f=O.querySelector('[aria-pressed="true"]');!f||O.scrollWidth<=O.clientWidth||f.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(h)return h;for(let O of d.querySelectorAll(":scope > div")){let f=O.querySelector('button[aria-pressed="true"]'),R=f?.textContent?.trim();if(R&&f?.dataset.floor!=="")return R}return a&&(l||c)?v("picker.levelsAndAreas","Levels & zones"):a?v("picker.levels","Levels"):v("picker.areas","Zones")},S=O=>{d.classList.toggle("is-open",O),m.setAttribute("aria-expanded",String(O)),O&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(g),b.textContent=T()};m.addEventListener("click",()=>S(!d.classList.contains("is-open"))),d.addEventListener("keydown",O=>{O.key!=="Escape"||!d.classList.contains("is-open")||(O.preventDefault(),O.stopPropagation(),S(!1),m.focus())});let k=document.createElement("button");k.type="button",k.className="sl-view3d-nav-close",k.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let E=v("picker.closeVenueNavigation","Close venue navigation");k.setAttribute("aria-label",E),k.title=E,k.addEventListener("click",()=>{S(!1),m.focus()}),S(!1),d.appendChild(m);let L=O=>{},U=O=>{};if(a){let O=document.createElement("div");O.setAttribute("role","group"),O.setAttribute("aria-label",v("picker.levels","Levels"));let f=[];U=_=>{f.forEach(D=>{D.setAttribute("aria-pressed",String((D.dataset.floor===""?null:Number(D.dataset.floor))===_))})};let R=_=>{e.focusFloor(_)&&(U(_),L(_))},M=(_,D)=>{let I=document.createElement("button");I.type="button",I.textContent=_,I.dataset.floor=D===null?"":String(D),I.setAttribute("aria-pressed",String(D===null)),I.addEventListener("click",()=>{R(D),S(!1)}),f.push(I),O.appendChild(I)};M(v("picker.allLevels","All levels"),null);for(let _ of t)M(_.label||vo("picker.levelNumber",{number:_.index+1}),_.index);d.appendChild(O)}if(l||c){let O=document.createElement("div");O.setAttribute("role","group"),O.setAttribute("aria-label",v("picker.areas","Zones"));let f=l?s.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)&&U(M.floorIndex)}})),R=M=>{let _=l||M===null?f:f.filter(D=>D.floorIndex===void 0||D.floorIndex===M);if(O.replaceChildren(),!_.length){O.remove();return}if(O.isConnected||d.insertBefore(O,k.isConnected?k:null),!l&&_.length>Um){let D=document.createElement("select");D.setAttribute("aria-label",v("picker.jumpToSection","Jump to section"));let I=document.createElement("option");I.value="",I.textContent=v("picker.jumpToSection","Jump to section"),D.appendChild(I);for(let q of _){let Y=document.createElement("option");Y.value=q.id,Y.textContent=q.label,D.appendChild(Y)}D.addEventListener("change",()=>{_.find(q=>q.id===D.value)?.go()}),O.appendChild(D);return}for(let D of _){let I=document.createElement("button");I.type="button",I.textContent=D.label,I.dataset.area=D.id,I.addEventListener("click",()=>{h=D.label,D.go(),S(!1)}),O.appendChild(I)}};L=R,R(null)}return d.appendChild(k),n.appendChild(d),d}var ls=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",v("picker.savedSeatComparison","Saved seat comparison"));let o=document.createElement("button");o.type="button",o.className="main",o.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(v("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",v("picker.clearSavedSeatComparison","Clear saved seat comparison")),r.addEventListener("click",()=>this.host.clearComparison()),t.append(o,r),e.appendChild(t),this.chip=t}let i=this.host.savedSeatIds().length,s=t.querySelector(".main");s&&(s.textContent=i>1?vo("picker.compareCount",{count:i}):v("picker.oneSeatSaved","1 seat saved"),s.setAttribute("aria-label",i>1?vo("picker.openComparisonOfSeats",{count:i}):v("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function hc(n){return!n?.querySelector('[data-ref="zfs"]')}var uc="sl:sheet-hint";function mc(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"),qm(n.root)},700)}function qm(n){if(!n||n.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(uc))return;window.sessionStorage.setItem(uc,"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 fc(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 ds(n){let e=n.committedSelection(),t=n.controller.getGAAreas(),i=n.hold?.items??[],s=new Set(i.map(m=>m.label)),o=Ma(n,t,i),r=Be(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=>!s.has(m.label)),d=c.reduce((m,u)=>m+n.paidPrice(u.categoryKey,u.tierId??null,u.price,u.label)*(u.quantity??1),0)+o+a,h=c.reduce((m,u)=>m+(u.quantity??1),0)+r+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:i,heldLabels:s,heldCount:l,total:d,count:h}}function ps(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 hs(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 s of i)s.categoryKey===e.key&&t.push(s.price);t.push(...Wm(n).get(e.key)??[])}return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var cs=null;function Wm(n){let e=n.controller.doc,t=n.hostObjectPrices();if(cs?.doc!==e||cs.host!==t){let i=new Map;for(let[s,o]of Object.entries({...e?.seatPrices,...t})){let r=n.controller.seatByLabel(s)?.categoryKey??n.controller.tableSelection(s)?.categoryKey;r&&(i.has(r)||i.set(r,[]),i.get(r).push(...typeof o=="number"?[o]:Object.values(o.tiers)))}cs={doc:e,host:t,spread:i}}return cs.spread}var Bn="seatlayer_";function Ym(){let n=globalThis;return n.document?.modelContext??n.navigator?.modelContext??null}function ue(n,e){return e?{ok:!1,reason:n,message:e}:{ok:!1,reason:n}}function Zm(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&!!e):[]}function Xm(n,e){let t=n.event();if(!t)return ue("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 gc(n,e){let t=s=>!!s&&s.toLowerCase()===e.toLowerCase(),i=n.find(s=>t(s.key??s.id))??n.find(s=>t(s.label));return i?.key??i?.id??null}function bc(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,s)=>t[s]?.seat||i.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((i,s)=>i+s.price,0)}}function Qm(n,e,t){let i=new Map;for(let o of e){let r=i.get(o.rowKey);r?r.push(o):i.set(o.rowKey,[o])}let s=[];for(let o of i.values()){let r=[...o].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)s.push(bc(n,r.slice(d,d+t)));a=l}}return s}function Jm(n,e,t){let i=new Map;for(let o of e){let r=i.get(o.sectionKey);r?r.push(o):i.set(o.sectionKey,[o])}let s=[];for(let o of i.values()){if(o.length<t)continue;let r=[...o].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);s.push(bc(n,r.slice(0,t)))}return s}function ef(n,e){if(!n.event())return ue("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits(),s=Math.floor(Number(e.count));if(!Number.isInteger(s)||s<1||s>i.max)return ue("bad_count",`count must be a whole number between 1 and ${i.max}.`);let o=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?gc(n.categories(),l):null;if(l&&!d)return ue("no_match",`No ticket type called "${l}".`);if(d&&n.categories().find(g=>g.key===d)?.available===0)return ue("sold_out",`"${l}" is sold out.`);let h=c?gc(n.zones(),c):null;if(c&&!h)return ue("no_match",`No zone called "${c}".`);let m=n.seats().filter(g=>g.available);if(!m.length)return ue("sold_out");let u=m.filter(g=>(!d||g.categoryKey===d)&&(!h||g.zoneId===h)&&(a==null||g.price<=a));if(!u.length)return ue("no_match");let b=r?Qm(n,u,s):Jm(n,u,s);return b.length?(b.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:b.slice(0,o),searched:{count:s,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...h?{zone:h}:{},together:r}}}):ue(r?"not_enough_together":"no_match")}function yc(n){return{ok:!0,...n.selection()}}function tf(n,e){let t=n.event();if(!t)return ue("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return t.guestsOnly?ue("guests_only","This event is for invited guests."):ue("event_closed","Sales are closed for this event.");let i=Zm(e.seat_ids);return i.length?(n.clearSelection(),n.selectObjects(i),yc(n)):ue("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function nf(n,e){let t=async s=>{try{return await s()}catch(o){return ue("error",o instanceof Error?o.message:String(o))}},i=[{name:`${Bn}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(()=>Xm(n,e))},{name:`${Bn}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:s=>t(()=>ef(n,s))},{name:`${Bn}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:s=>t(()=>tf(n,s))},{name:`${Bn}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(()=>yc(n))}];return e&&i.push({name:`${Bn}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 vc(n,e={}){let t=Ym();if(!t||typeof t.registerTool!="function")return null;let i=new AbortController,s=nf(n,!!e.holds),o=[],r=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of s)await t.registerTool(a,{signal:i.signal,...r?{exposedTo:r}:{}}),o.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return o.length?{names:o,dispose:()=>{if(i.abort(),typeof t.unregisterTool=="function")for(let a of o)try{t.unregisterTool(a)}catch{}}}:null}async function wc(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 vc(xo(n,t),{holds:t,exposedTo:i}),n.destroyed&&wo(n)}catch(s){console.warn("seatmap: WebMCP registration failed",s)}}function wo(n){n.webMcp?.dispose(),n.webMcp=null}function xo(n,e){let t=(i,s)=>{if(Number.isInteger(i.logicalSeatIndex))return i.logicalSeatIndex;let o=i.id.lastIndexOf(":"),r=o<0?NaN:Number(i.id.slice(o+1));return Number.isFinite(r)?r:s};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,...n.guestsOnly?{guestsOnly:!0}:{}}:null},selectionLimits:()=>({max:n.maxTickets,required:n.exactTickets}),categories:()=>{let i=n.controller.categoryAvailability();return(n.controller.doc?.categories??[]).filter(s=>!s.notForSale).map(s=>{let o=hs(n,s),r=ps(n,s);return{key:s.key,label:s.label??s.key,...r===void 0?{}:{price:r},...o&&o.min!==o.max?{priceRange:o}:{},available:i[s.key]??0}})},zones:()=>n.controller.getBestAvailableZones(),hasPremiumSeats:()=>n.controller.hasPremiumSeats(),seats:()=>{let i=n.controller.getActiveFloorId(),s=[];return n.allSeats().forEach((o,r)=>{if(o.floorId&&i&&o.floorId!==i)return;let a=n.controller.getStatus(o.id)??"free",l=n.controller.doc?.categories.find(d=>d.key===o.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;s.push({id:o.id,label:o.label,rowKey:o.logicalRowId??o.rowId,sectionKey:o.sectionId??o.rowId,index:t(o,r),categoryKey:o.categoryKey,price:n.paidPrice(o.categoryKey,l?.tiers?.[0]?.id??null,c,o.label),...o.zoneId?{zoneId:o.zoneId}:{},available:a==="free"&&!l?.notForSale})}),s},describeSeat:i=>{let s=n.controller.seatDetails(i);return s?{section:s.sectionLabel??"",row:J(s)??"",seat:s.seatNumber??s.label,category:s.categoryLabel??s.categoryKey}:null},selection:()=>{let{freshSeats:i,total:s,count:o}=ds(n);return{seats:i.map(r=>({id:r.id,label:r.label,section:r.sectionLabel??"",row:J(r)??"",seat:r.seatNumber??r.label,category:r.categoryKey,price:n.paidPrice(r.categoryKey,r.tierId??null,r.price,r.label)})),count:o,total:s,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?sf(n):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function sf(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 xc(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 kc(n,e,t,i){let s=n.currentHold(),o=s?.items??[],r=o.find(c=>c.label===e);if(!s||!r||r.tierId===t)return null;let a=o.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,s.holdId);return n.setHold({holdId:l.holdId,labels:a.map(c=>c.label),expiresAt:l.expiresAt,items:l.items}),n.currentHold()}function ko(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 Sc(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",ko(n))}import{seatConfidenceDisclosure as of}from"@seatlayer/core/core/seatConfidence";function ae(n){return String(n??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Tc(n){let e=of(n.seat.confidenceEvidence),t=n.seat.confidenceEvidence,i=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${ae(c)}</li>`).join("")}</ul>`:"",s=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${ae(e.modeledTarget)}</dd></div>`:"",o=t?`<div><dt>Evidence ID</dt><dd>${ae(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${ae(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${ae(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${ae(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${ae(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",r=Si(n.seat.commercial).join(" \xB7 ")||n.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${ae(r)}</dd></div>`+(n.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${ae(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">${ae(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>${ae(e.headline)}</strong><span>${ae(e.coverage)} \xB7 ${ae(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${ae(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${ae(e.reality)}</dd></div><div><dt>Source</dt><dd>${ae(e.provenance)}</dd></div>`+a+s+o+`</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 Ec(n){return n?n.closest("[data-report]")?"report":n.closest("[data-close]")||n.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function us(n,e,t){let i=n?.querySelector("[data-report]"),s=n?.querySelector("[data-report-status]");i&&(i.disabled=e!=="failed",i.textContent=e==="received"?"Report received":"Report this view"),s&&(s.setAttribute("role",e==="failed"?"alert":"status"),s.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function So(n,e,t=null){let i=n.view3dEl;if(!i)return;Fn(n,!1);let s=e.confidenceEvidence,o=n.controller.seatDetails(e.id),r=document.createElement("div");r.className="sl-view3d-passport-shell",r.innerHTML=Tc({seat:e,title:o?.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(),Fn(n);return}if(m.key!=="Tab")return;let u=d();if(!u.length)return;let b=u[0],g=u[u.length-1];m.shiftKey&&document.activeElement===b?(m.preventDefault(),g.focus()):!m.shiftKey&&document.activeElement===g&&(m.preventDefault(),b.focus())};window.addEventListener("keydown",h,!0),n.view3dPassportCleanup=()=>{window.removeEventListener("keydown",h,!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: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 b=m??n.view3dCompareEl?.querySelector("[data-passport-seat]")??n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareChip.mainButton();(t?.isConnected?t:b)?.focus()},r.addEventListener("click",m=>{let u=Ec(m.target instanceof HTMLElement?m.target:null);u==="close"&&Fn(n),u==="report"&&rf(n,e)}),requestAnimationFrame(()=>d()[0]?.focus()),n.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:s?.evidenceId??null,eventConfigurationId:s?.eventConfigurationId??null,modelLevel:s?.modelLevel??"unverified",realityLevel:s?.realityLevel??"none"})}async function rf(n,e){if(n.api.reportViewEvidence){us(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}),us(n.view3dPassportEl,"received",t.report.id)}catch{us(n.view3dPassportEl,"failed")}}}function Fn(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 Cc(n){let e=n.view3dEl;if(!e||n.view3dCompareSeatIds.length<2)return;kt(n,!1);let t=n.view3dCompareSeatIds.map(u=>n.view3dComparisonSnapshot(u)).filter(u=>!!u);if(t.length<2){n.clearView3dComparison();return}let i=u=>A(u),s=t.some(u=>!!u.price),o=document.createElement("div");o.className="sl-view3d-compare-shell";let r=t.map((u,b)=>`<article><span>Seat ${b===0?"A":"B"}</span><strong>${i(u.label)}</strong><small>Section ${i(u.section)} \xB7 Row ${i(u.row)}</small><dl>`+(s?`<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("");o.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">${s?"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(o),e.classList.add("has-comparison"),n.view3dCompareEl=o;let d=o.querySelector(".sl-view3d-compare"),h=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],m=u=>{if(u.key==="Escape"){u.preventDefault(),kt(n);return}if(u.key!=="Tab")return;let b=h();if(!b.length)return;let g=b[0],T=b[b.length-1];u.shiftKey&&document.activeElement===g?(u.preventDefault(),T.focus()):!u.shiftKey&&document.activeElement===T&&(u.preventDefault(),g.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);o.remove(),e.classList.remove("has-comparison"),n.view3dCompareEl===o&&(n.view3dCompareEl=null),a?.isConnected?a.focus():n.view3dCompareChip.mainButton()?.focus()},o.querySelector("[data-close]")?.addEventListener("click",()=>kt(n)),o.querySelectorAll("[data-passport-seat]").forEach(u=>u.addEventListener("click",()=>{let b=u.dataset.passportSeat,g=b?n.allSeats().find(T=>T.id===b):void 0;g&&So(n,g,u)})),o.querySelectorAll("[data-view-seat]").forEach(u=>u.addEventListener("click",()=>{let b=u.dataset.viewSeat;kt(n,!1),b&&n.view3dHandle?.flyToSeat(b)})),o.querySelectorAll("[data-select-seat]").forEach(u=>u.addEventListener("click",()=>{let b=u.dataset.selectSeat;b&&af(n,b)})),requestAnimationFrame(()=>h()[0]?.focus()),n.emit3dAnalytics("3d_comparison_opened",{seatIds:n.view3dCompareSeatIds.slice()})}function kt(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 af(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(s=>s.id===e);if(!t)return;if(kt(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 mf}from"@seatlayer/core";import{seatViewDisclosure as ff}from"@seatlayer/core/view3d/crossfade/panorama";import{t as Ac}from"@seatlayer/core";var lf=900,cf=450;function df(n){switch(n){case"seat":return v("picker.stopYourSeat","Your seat");case"row":return v("picker.stopYourRow","Your row");case"section":return v("picker.stopYourSection","Your section");default:return v("picker.stopWholeVenue","Whole venue")}}function Pc(n,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let i=v("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",i),t.title=i,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let s=document.createElement("div");s.className="sl-view3d-stop",s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),n.append(t,s);let o=null,r=null;return{onStopChange(a){if(o&&(clearTimeout(o),o=null),r&&(clearTimeout(r),r=null),!a){s.classList.remove("is-shown"),s.textContent="",r=setTimeout(()=>{r=null,n.classList.remove("is-seat-view")},cf);return}n.classList.add("is-seat-view"),s.textContent=df(a),s.classList.add("is-shown"),o=setTimeout(()=>{o=null,s.classList.remove("is-shown")},lf)},dispose(){o&&(clearTimeout(o),o=null),r&&(clearTimeout(r),r=null),t.remove(),s.remove(),n.classList.remove("is-seat-view")}}}var pf=44,hf=92;function Lc(n,e,t,i={}){let s=n?.sectionLabel,o=J(n),r=uf(n,e),a=[s,o?Ac("picker.rowLabel",{label:o}):null,r?Ac("picker.seatLabel",{label:r}):null].filter(Boolean).join(" \xB7 "),l=i.maxChars??(i.narrow?pf:hf);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 uf(n,e){if(n?.seatNumber)return n.seatNumber;let t=n?.displayLabel??e,i=s=>{!s||!t.startsWith(s)||t.length<=s.length||(t=t.slice(s.length).replace(/^[\s·\-\/_]+/,""))};return i(n?.sectionLabel),i(J(n)),t}import{seatConfidenceDisclosure as gf}from"@seatlayer/core/core/seatConfidence";var bf=220;function yf(n,e,t){let i=null,s=null,o=null;return(r,a)=>{n()?.presentSeatHover?.(r,a,e),o=a,r!==s&&(s=r,i&&(clearTimeout(i),i=null),!(!r||!t)&&(i=setTimeout(()=>{if(i=null,s!==r)return;let c=t()?.(r)??null;c&&s===r&&n()?.presentSeatHover?.(r,o,e,c)},bf)))}}function Mc(n){return n.buyerView}function Hc(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 Rc(n,e){switch(n.controller.getStatus(e.id)){case"held":if(!Oc(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 Ic(n){if(!n.view3dHandle)return;let e=n.allSeats().map(t=>({seatId:t.id,state:n.seatState3dFor(t)}));n.view3dHandle.setAvailability(e),n.syncSelectionTo3d(),To(n)}function To(n){n.view3dHandle?.setAreaStates&&fi(n,()=>{let e=n.view3dHandle;if(!e?.setAreaStates)return;let t=n.priceBandKeys,i=ui(n.controller);e.setAreaStates(mi(n.controller.gaStates(),s=>t!=null&&!t.has(i.get(s)?.categoryKey??""),s=>i.get(s)?.wheelchairPlaces??0))})}function Oc(n,e){return _c(n,e)!=null}function _c(n,e){let t=n.controller.currentHold()?.labels;if(!t?.length)return null;if(t.includes(e.label))return e.label;let i=n.controller.tableSelection(e.id)?.label;return i!=null&&t.includes(i)?i:null}function vf(n){return(n.controller.currentHold()?.labels??[]).flatMap(e=>{let t=n.controller.tableSelection(e)?.physicalSeatIds;if(t?.length)return t;let i=n.controller.seatByLabel(e)?.id;return i?[i]:[]})}function Dc(n){if(!n.view3dHandle)return;let e=new Set;for(let t of n.controller.getSelection()){let i=t.physicalSeatIds;if(i?.length)for(let s of i)e.add(s);else e.add(t.id)}for(let t of vf(n))e.add(t);n.view3dHandle.setSelection([...e])}function Nc(n,e){let t=n.view3dHandle;if(!t)return;n.pushAvailabilityTo3d(),n.syncSelectionTo3d();let i=e[0];!i||e.every(o=>o.rowId===i.rowId)&&t.focusRow(i.rowId)||i.sectionId&&t.focusSection(i.sectionId)}async function Bc(n,e){let t=n.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,s=!!i&&i!==t.viewUrl,o=s?await n.buyerAssetUrls.resolve(i):null,r=s?t.viewUrl:await n.buyerAssetUrls.resolve(t.viewUrl);return!r||s&&!o?null:{url:r,...o?{previewUrl:o}:{},...s?{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 Fc(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(l=>l.id===e);if(!t)return;let i=n.controller.tableSelection(e),s=_c(n,t);if(s!=null){if(n.syncSelectionTo3d(),n.performanceGroup)return;if(n.opts.confirmSelection===!1){n.removeHeldTicket(s);return}if(n.confirmSeat?.id===t.id){n.dismissConfirm();return}n.showConfirm(s===t.label?t:{...t,label:s},"remove");return}if(n.committedSelection().some(l=>i?l.label===i.label:l.id===e)){if(i||n.opts.confirmSelection===!1){n.controller.deselect([e]),n.dismissConfirm(),n.syncSelectionTo3d();return}n.syncSelectionTo3d(),n.showConfirm(t,"remove");return}let r=n.controller.getStatus(t.id);if(r==="held"||r==="booked"||r==="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 Vc(n,e){let t=n.allSeats().find(i=>i.id===e);return Lc(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 $c(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 zc(n){n.closeView3dComparison(!1),n.view3dCompareSeatIds=[],n.view3dCompareChip.remove(),n.emit3dAnalytics("3d_comparison_cleared")}function jc(n,e){let t=n.allSeats().find(b=>b.id===e);if(!t)return null;let i=n.controller.seatDetails(t.id),s=n.controller.doc?.categories.find(b=>b.key===t.categoryKey),o=i?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),r=o!=null?n.paidPrice(t.categoryKey,i?.tierId??s?.tiers?.[0]?.id??null,o,t.label):void 0,a=n.controller.getStatus(t.id),l=a==="free"||!a?n.tf("picker.available","Available"):Oc(n,t)?n.tf("picker.heldForYou","Held for you"):n.tf("picker.group.legendUnavailable","Unavailable"),c=t.viewUrl?ff({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=Si(t.commercial).join(" \xB7 ")||n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),h=Vr({...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=gf(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:J(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??s?.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 Gc(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 s=document.createElement("button");s.type="button",s.className="sl-view3d-back",s.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 o=s.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");o&&(o.textContent=h),s.setAttribute("aria-label",h)};if(s.addEventListener("click",()=>{if(n.view3dTargetSeatId&&n.view3dHandle){n.view3dHandle.focusOverview();return}n.exit3d()}),n.regions["top-left"]?.prepend(s),n.view3dBack=s,n.publish3dTopInset(),hc(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([An(),n.controller.loadEventConfiguration()]),m=h?await Gi(h,E=>n.buyerAssetUrls.resolve(E)):null,u=t.theme?.venue3d?.shellAssetUrl,b=await Ki(u,E=>n.buyerAssetUrls.resolve(E));if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let g={...hi(n.opts.enable3DCrowd),crowdSeatCeiling:n.max3dSeats()},T={doc:t,seats:c,...g,...m?{eventConfigurationId:m.id,eventConfiguration:m}:{},...b?{registeredShellGlb:b}:{}};a.textContent=mf("picker.building3d");let S=await d.prepareVenue3D(T);if(l!==n.view3dGen||n.buyerView!=="venue3d"||n.view3dEl!==i)return;let k=d.mountVenue3D(i,{...T,prepared:S},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:ft(),navLabels:di(),...pi(n.opts.touchNavigation3D),seatViewActionLabel:E=>n.allSeats().find(L=>L.id===E)?.viewUrl?n.tf("picker.openAuthored360","Open venue 360\xB0"):n.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:E=>n.seatViewCaption(E),onSeatViewStopChange:E=>n.view3dSeatViewChrome?.onStopChange(E),onSeatPick:E=>n.onView3dSeatPick(E),onSeatInspect:E=>n.onView3dSeatPick(E),onObjectPick:E=>{E.kind==="area"&&n.openAreaChooser(E.id,E.point)},onSeatHover:yf(()=>n.controller.getRenderer(),i,()=>{let E=k.captureSeatView;return E?L=>E.call(k,L):void 0}),onSectionFocusChange:E=>{let L=i.querySelector('select[data-locator="section"]'),U=E??"";!L||L.value===U||(L.value=U,L.dispatchEvent(new Event("change")))},onViewTargetChange:E=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!E),r(E),n.opts.onBuyerViewChange?.({view:"venue3d",...E?{seatId:E}:{}})},...n.seatViewEnabled()?{getSeatView:E=>new Promise((L,U)=>{let O=()=>{n.seatViewFor3d(E).then(R=>{R?L(R):U(new Error("seat_view_unavailable"))})},f=globalThis.requestIdleCallback;typeof f=="function"?f(O,{timeout:1500}):setTimeout(O,50)})}:{},onAnalytics:(E,L)=>n.emit3dAnalytics(E,L)});n.view3dHandle=k,n.view3dSeatViewChrome=Pc(i,{handle:()=>n.view3dHandle}),requestAnimationFrame(()=>a.remove()),n.pushAvailabilityTo3d(),n.syncSelectionTo3d(),n.view3dNav=pc(n.regions["bottom-left"]??i,k),e&&k.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 Kc(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 Uc(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 Zc}from"@seatlayer/core";var qc=Symbol("seatlayer.performance-group-picker");function ms(n,e){return Object.defineProperty(n,qc,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),n}function fs(n){return!n||n.surface==="season"}function St(n){return n?.surface==="season"}function Wc(n){return n[qc]??null}import{t as gs}from"@seatlayer/core";function Yc(n){return Array.isArray(n)?n.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function bs(n,e,t=!1){let i=n.violations[0];return i==="numberOfPlacesToSelect"?n.remaining>0?gs("picker.selectExactMore",{count:n.remaining}):gs("picker.selectExactCount",{count:n.required}):i==="minimumSelectedPlaces"?gs("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."):gs("picker.orphanHint")}var Eo=6e4,Xc=5*6e4,xf=String(Math.round(Xc/6e4));function Qc(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=Jc(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 Jc(n){return n.tf("picker.addMinutes","+{count} min").replace("{count}",xf)}function ed(n){let e=n.hold?.items??[],t=new Set(e.map(s=>s.label));return n.committedSelection().filter(s=>!t.has(s.label)).reduce((s,o)=>s+(o.quantity??1),0)+Be(n.gaQty,n.hold?.items??[])}function td(n){return(n.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function nd(n){let e=new Set((n.hold?.items??[]).map(i=>i.label)),t=n.committedSelection().filter(i=>!e.has(i.label)).reduce((i,s)=>i+(s.quantity??1),0);return n.heldTicketCount()+t+Be(n.gaQty,n.hold?.items??[])}function id(n){let e=new Set((n.hold?.items??[]).map(s=>s.label)),t=n.committedSelection().filter(s=>e.has(s.label)).reduce((s,o)=>s+(o.quantity??1),0),i=Math.max(0,n.maxTickets-n.heldTicketCount()-Be(n.gaQty,n.hold?.items??[]));n.controller.setMaxSelection(t+i)}function sd(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 s=!n.hold&&n.performanceGroup?.selectionMode==="per_performance"?n.performanceGroup.submissionState?.():null;if(s&&!s.ready){i.disabled=!0,i.textContent=n.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(s.complete)).replace("{total}",String(s.total));return}let o=n.controller.getSelectionValidity(e);if(o&&!o.isValid){i.disabled=!0,i.textContent=bs(o,(r,a)=>n.tf(r,a),!0);return}if(!e&&n.root?.dataset.layout==="narrow"&&fs(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?Zc("picker.secureMoreAndCheckout",{count:t}):n.tf("picker.continueToCheckout","Continue to checkout"):e?n.performanceGroup?kf(n,n.performanceGroup):n.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):n.tf("picker.selectSeats","Select seats")}function kf(n,e){let t=St(e),i=t?Zc("picker.season.holdSeatsForAllDates"):n.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances");return(e.performanceCount===1?n.tf(t?"picker.season.holdSeatsForOneDate":"picker.holdSeatsForOnePerformance",i):i).replace("{count}",String(e.performanceCount))}function od(n,e){n.ctaPhase=e,n.syncCta()}async function rd(n,e,t){n.setCtaPhase("checkout");try{await n.checkoutHandoff(e,t)}finally{n.ctaPhase==="checkout"&&!n.bookedShown&&n.setCtaPhase("idle")}}function ad(n){return`@seatlayer/hold/v1/${encodeURIComponent(n.apiBase)}/${encodeURIComponent(n.opts.event)}`}function ld(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 cd(n,e){if(!(n.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(n.holdStorageKey(),e.holdId)}catch{}}function dd(n){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(n.holdStorageKey())}catch{}}async function pd(n,e,t=!1){try{let i=await n.controller.resumeHold(e);if(!i||n.destroyed)return null;let s={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return n.hold=s,La(n.gaQty,s.items??[]),n.handedOff=!0,n.bookedShown=!1,n.ctaPhase="idle",n.startHoldTimer(s.expiresAt),n.rememberHold(s),n.syncTray(),n.emitHoldChange(),n.opts.onHoldRestored?.(s,s.seats??[],n.buildHandoff(s)),s}catch(i){let s=i?.status;if(s===404||s===409)n.forgetHold();else if(s===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 hd(n){let e=n.rememberedHoldId();e&&await n.resumeHoldFromServer(e,!0)}function ud(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"]'),s=()=>{let o=Math.max(0,n.holdExpiresAt-Date.now());i&&(i.textContent=Jr(o)),t.classList.add("on"),t.classList.toggle("is-expiring",o>0&&o<=Eo),n.setExtendPrompt(o>0&&o<=Eo,o),(o<=0||!n.controller.currentHold())&&n.stopHoldTimer()};n.holdTimer=setInterval(s,500),s()}function md(n){n.holdTimer&&clearInterval(n.holdTimer),n.holdTimer=null,n.els.hold?.classList.remove("on","is-expiring"),n.setExtendPrompt(!1,0)}function fd(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 gd(n){if(!n.holdTimer)return;let e=Math.max(0,n.holdExpiresAt-Date.now());n.setExtendPrompt(e>0&&e<=Eo,e)}async function bd(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,Xc);if(n.controller.currentHold()?.holdId!==t.holdId)return;n.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:i.expiresAt,items:t.items});let s=n.controller.currentHold();if(!s)return;n.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},n.holdExpiresAt=s.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=Jc(n)}}}function yd(n,e){if(n.destroyed)return!1;let t=n.hold,i=!!t&&(e===void 0||t.holdId===e);if(i){let s=new Set([...(t.items??[]).map(r=>r.label),...(t.seats??[]).map(r=>r.label),...n.controller.currentHold()?.labels??[]]);n.controller.clearHold(),n.notifyGroupSettled("booked");let o=n.controller.getSelection().filter(r=>s.has(r.label));o.length&&n.controller.deselect(o.map(r=>r.id))}return n.controller.refresh().catch(()=>{}),i}function Tf(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 vd(n,e){try{return await n(e),!1}catch(t){return Tf(t)==="booked"}}import{t as Vn}from"@seatlayer/core";function wd(n){return n?.previousPrice!=null&&n.previousPrice>n.price?n.previousPrice:null}function xd(n){return Ef(n)+(n.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!n.collapsed}">${n.esc(n.moreLabel)}</button>`:"")+Cf(n.status)}function Ef(n){let{esc:e,money:t}=n;return n.categories.map(i=>{let s=n.priceOf(i),o=n.rangeOf(i),r=n.offerOf(i.key),a=wd(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?xi(r.offerName,e):"")+"</span>"+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(o!=null?`<span class="sl-price-amt">${o.min===o.max?e(t(o.min)):`${e(t(o.min))}\u2013${e(t(o.max))}`}</span>`:s!=null?`<span class="sl-price-amt">${e(t(s))}</span>`:"")+"</div>"}).join("")}function Cf(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 Co(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 kd(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(s=>{let o=n.rangeOf(s),r=n.priceOf(s),a=o?o.min===o.max?t(o.min):`${t(o.min)}+`:r!=null?t(r):null,l=Object.prototype.hasOwnProperty.call(n.left,s.key)&&n.left[s.key]<=0,c=wd(n.offerOf(s.key)),d=a?`${s.label}: ${a}${l?` (${n.soldOutWord})`:""}`:s.label;return`<button type="button" class="sl-rc" data-cat="${e(s.key)}" aria-pressed="${n.activeKey===s.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(n.colorOf(s))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??s.label)}</span></button>`}).join("")}function Sd(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 s=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),o=Math.ceil(s.length/4),r=[];for(let a=0;a<s.length;a+=o){let l=s.slice(a,a+o),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 Td(n){if(n.els.pricesSec?.querySelectorAll(".sl-price-select").forEach(s=>s.remove()),n.priceSelect=null,n.suppressPricing||!n.els.prices||!n.els.pricesSec)return;let e=Sd((n.controller.doc?.categories??[]).filter(s=>!s.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 s of e){let o=document.createElement("option");o.value=s.id,o.textContent=s.label,t.appendChild(o)}n.els.pricesSec.appendChild(t),n.priceSelect=t,t.addEventListener("change",()=>{n.applyPriceBand(e.find(s=>s.id===t.value)?.keys??null)})}function Ed(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 Cd(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:F}}function Ad(n,e,t,i=n.legendDeps()){let s=n.els.railScroll,o=e.length>1;if(n.els.rail?.classList.toggle("has",o),!s)return;s.innerHTML=o?kd({...i,categories:e,left:t,activeKey:n.focusedCatKey,soldOutWord:Vn("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,s.scrollLeft=0),s.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,s.addEventListener("scroll",()=>Co(s),{passive:!0})),requestAnimationFrame(()=>Co(s))}function Pd(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 s=n.legendDeps(),o=n.suppressPricing,r=o?{...s,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:s;o&&(n.els.pricesSec?.querySelector("span")?.replaceChildren(Vn("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=xd({...r,categories:d,left:t,collapsed:c,activeKey:n.focusedCatKey,bandKeys:n.priceBandKeys,titleFor:(h,m)=>m?n.tf("picker.showAllSeats","Show all seats"):Vn("picker.showLabelSeatsOnMap",{label:h.label}),moreLabel:l>1?c?o?Vn("picker.showAllCategories"):Vn("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 Ld(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 Md,tCount as Hd}from"@seatlayer/core";function ye(n,e,t){let i=Md(n,t);return i&&i!==n?i:t?e.replace(/\{(\w+)\}/g,(s,o)=>o in t?String(t[o]):s):e}function Pf(n){let e=Hd("picker.seatCount",n);return e.includes("picker.seatCount")?`${n} ${n===1?"seat":"seats"}`:e}function Lf(n){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(n)}catch{}return n.join(", ")}function Mf(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 Hf(n){let e=n.filter(s=>s.objectType==="ga"),t=n.filter(s=>s.objectType!=="ga"),i=[];if(t.length){let s=Pf(t.length),o=[...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(o.length===1&&r.length===1&&a.length===t.length){let l=t.length===1?ye("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:o[0],row:r[0],seat:String(t[0].seatNumber??"")}):Mf(a)?ye("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:o[0],row:r[0],from:Math.min(...a),to:Math.max(...a)}):"";i.push(l?ye("picker.releasedPair","{first} \xB7 {second}",{first:s,second:l}):ye("picker.releasedInSection","{seats} in Section {section}",{seats:s,section:o[0]}))}else o.length===1?i.push(ye("picker.releasedInSection","{seats} in Section {section}",{seats:s,section:o[0]})):o.length>1?i.push(ye("picker.releasedInSections","{seats} in Sections {sections}",{seats:s,sections:Lf(o)})):i.push(s)}for(let s of e)i.push(ye("picker.releasedGa","{quantity} \xD7 {area}",{quantity:s.quantity??1,area:s.label}));return i.length?i.reduce((s,o)=>ye("picker.releasedPair","{first} \xB7 {second}",{first:s,second:o})):""}function Rd(n){if(!n)return[];let e=new Map((n.seats??[]).map(s=>[s.label,s])),t=n.items??[];return(t.length?t.map(s=>({label:s.label,objectType:s.objectType,quantity:s.quantity})):[...e.keys()].map(s=>({label:s}))).map(s=>{let o=e.get(s.label);return{label:s.label,...s.objectType?{objectType:s.objectType}:{},...s.quantity==null?{}:{quantity:s.quantity},...o?.sectionLabel?{sectionLabel:o.sectionLabel}:{},...o?.rowLabel?{rowLabel:J(o)??o.rowLabel}:{},...o?.seatNumber?{seatNumber:o.seatNumber}:{}}})}function Id(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 Od(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=>Md("picker.seatJustTakenByAnother",{label:r})).join(" "):t.remove());let i=n.querySelector(".sl-interrupt-actions"),s=i?.querySelector(".sl-interrupt-act");if(!i||!s)return;s.classList.add("sl-interrupt-act-secondary");let o=document.createElement("button");o.type="button",o.className="sl-interrupt-act sl-hold-expired-recover",o.textContent=Hd("picker.holdLapsedSelectAgain",e.recoverable.length),o.addEventListener("click",()=>e.onRecover([...e.recoverable])),i.insertBefore(o,s),n.classList.add("has-recovery"),o.focus()}function _d(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 s=document.createElement("div");s.className="sl-interrupt-title",s.id="sl-hold-expired-title";let o=document.createElement("span");o.className="sl-interrupt-glyph",o.setAttribute("aria-hidden","true"),o.textContent="\u23F1";let r=document.createElement("span");r.textContent=ye("picker.holdExpiredTitle","Your seats were released"),s.append(o,r);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=ye("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),i.append(s,a);let l=Hf(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=ye("picker.holdExpiredPickAgain","Pick your seats again to continue. They may already be taken."),i.appendChild(c),t.setAttribute("aria-labelledby",s.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=ye("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 Ao,seatTypeIconSvg as Dd,t as Rf}from"@seatlayer/core";var Nd={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"},If='<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>',Of='<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>',_f=8,Df=8,Nf=88;function Bf(n){let e=n.gap??_f,t=n.margin??Df,i=n.min??Nf,s=Math.max(n.boundsTop,0);return Math.max(Math.round(n.buttonTop-s-e-t),i)}var ys=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 s=this.offered().length>0?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",s),this.button.innerHTML=Of,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let o of this.stored())this.offeredFree().has(o)&&this.active.add(o);if(this.menu.innerHTML=Xr(s,t.tf("picker.close","Close"))+Qr(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",o=>o.stopPropagation()),this.button.addEventListener("click",o=>{o.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",o=>{o.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",o=>o.stopPropagation()),this.menu.addEventListener("click",o=>o.stopPropagation()),this.menu.addEventListener("focusin",o=>{let r=o.target;r&&typeof r.scrollIntoView=="function"&&r.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=o=>{o.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 o=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(o):o()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:i,count:s})=>[i,s])),t=!1;for(let i of this.menu.querySelectorAll("[data-a11y-row]")){let s=i.dataset.a11yRow??"";if(!s.startsWith("a11y:"))continue;let o=s.slice(5),r=e.get(o);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(o,l))),i.disabled=c,c?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),c&&this.active.delete(o)&&(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",`${Bf({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();qs(this.menu,{x:t.left+t.width/2,y:t.top}),Ea(this.menu),Ta(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:Dd("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:If,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:s})=>({key:i,count:s}));let t=this.deps.present;return t?Ao.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(Ao.map(i=>[i.key,i]));return this.offered().flatMap(({key:i,count:s})=>{let o=t.get(i);return o?[{key:`a11y:${i}`,iconHtml:Dd(i,{size:17}),label:this.deps.tf(`picker.accessShort.${i}`,Nd[i]??o.label),...i==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...s==null?{}:{count:this.countText(s),disabled:s===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 s of this.menu.querySelectorAll(".sl-info.open"))s.classList.remove("open"),s.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 o=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(o),this.paint(e,o);return}if(t==="limited"){let o=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(o),o&&this.deps.focusSeatsForFilter(),this.paint(e,o);return}let i=t.slice(5),s=!this.active.has(i);s?this.active.add(i):this.active.delete(i),this.paint(e,s),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),s=e.parentElement;s?.classList.contains("sl-a11yrow-w")||(s=document.createElement("div"),s.className="sl-a11yrow-w",e.replaceWith(s),s.appendChild(e));let o=document.createElement("button");o.type="button",o.className="sl-a11yrow-c sl-a11yjump",o.dataset.a11yJump=i,o.textContent=t.textContent,o.disabled=e.disabled,o.setAttribute("aria-label",this.jumpLabel(i,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(i,o.textContent??""));let r=s.querySelector(".sl-info");r?r.after(o):e.after(o),s.dataset.a11yTapThrough||(s.dataset.a11yTapThrough="true",s.addEventListener("click",a=>{a.target===s&&!e.disabled&&e.click()})),o.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&&o.setAttribute("aria-label",this.jumpLabel(i,o.textContent??"",l.label))})}}countText(e){return e>0?Rf("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=Nd[e]??Ao.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 Ff}from"@seatlayer/core";var Vf=250;function Bd(n,e=Vf){let t=null,i=()=>{t===null&&(t=setTimeout(()=>{t=null,n()},e))},s=Ff(i),o=typeof window<"u"&&typeof window.addEventListener=="function";return o&&window.addEventListener("focus",i),()=>{t!==null&&(clearTimeout(t),t=null),s(),o&&window.removeEventListener("focus",i)}}import{holdRecoveryShape as $f,tCount as vs}from"@seatlayer/core";var ws=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=$f(e),i=e.lapsedLabels.length,s=i-e.recoverable.length,o=t==="all"?vs("picker.holdLapsedStillFree",i):t==="partial"?vs("picker.holdLapsedSomeTaken",s):vs("picker.holdLapsedAllTaken",i);this.note={message:o,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(o,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>${F(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${F(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 vs("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 Fd="@seatlayer/pending-checkout/v1";function zf(n){return typeof n=="string"&&n.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(n)}function on(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 s=window.sessionStorage.getItem(Fd);if(s){let o=null;try{o=JSON.parse(s)}catch{}if(o&&zf(o.orderId)){let r=Date.now()-Number(o.storedAt);if(r>=0&&r<=144e5){if(o.eventKey&&o.eventKey!==n)return null;i=o.orderId}}}window.sessionStorage.removeItem(Fd)}catch{}e.delete("seatlayer_checkout");try{let s=e.toString();history.replaceState(history.state,"",`${location.pathname}${s?`?${s}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:i}}function Vd(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 zd="https://api.seatlayer.io",Zf=10,Xf=250,jd=6e4,Gd=4,Qf=10,Jf=40,eg=220,Po=["mini","peek","open"],Kd="seatmap.a11y.cb";function Pe(n,e,t){return t?{ok:!1,reason:n,message:e,labels:t}:{ok:!1,reason:n,message:e}}function tg(){try{if(typeof window>"u")return null;let n=window.localStorage.getItem(Kd);return n==null?null:n==="1"}catch{return null}}function ng(n){try{window.localStorage.setItem(Kd,n?"1":"0")}catch{}}var et=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.guestsOnly=!1;this.guestsDeadlineStop=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 ls({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 ws({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=Wc(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??zd).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?Bi({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??Rn(e,t),this.pubApi=e.transport?null:i?.api??new We(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=pl(e.transport??this.pubApi,this.transportAbort.signal),this.chartFetch=Oi(this.api),this.buyerAssetUrls=new Qt(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 s=e.numberOfPlacesToSelect;if(s!=null&&(!Number.isInteger(s)||s<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=s??null;let o=Yc(e.selectionValidators);if(this.exactTickets!=null&&o>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let r=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(Zf,o)));if(this.exactTickets!=null&&r<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&r<o)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??r,this.baQty=Math.min(this.baQty,this.maxTickets),this.cbSafe=tg()??!!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 Jt(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=Vd({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-Gd&&t.width>=window.innerWidth-Gd}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,s=typeof window>"u"?0:window.innerHeight,o=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||i!==this.fullscreenAffordanceSize.viewportWidth||s!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:i,viewportHeight:s},o}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){Fe();let t=ts(v("picker.seatSelection","Seat selection"),Ie(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 s=!1,o=()=>{if(s)return;s=!0,i.modalCleanup?.();let r=()=>{i.destroy(),e.onClose?.()};i.hold&&!i.handedOff&&e.holdOnClose!=="keep"?i.release().finally(r):r()};i.closeModal=o,t.onScrimPress(o),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(),o())});try{let r=i.render();i.els.close?.classList.add("on"),i.els.close?.addEventListener("click",o),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;xa({base:(e.apiBase??zd).replace(/\/+$/,""),event:e.event,publicKey:e.publicKey})}catch{}}wireController(e){return new jf({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: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=>this.openAreaChooser(t,this.lastMapPoint),onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),vl(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,i=this.holdConflicted;this.holdExpiredUnits=Rd(this.hold);let s=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 o=this.api.resume,r=t&&!i&&s&&o?vd(a=>o.call(this.api,this.opts.event,a),s.holdId):null;this.lapse.deferExpiryToast(()=>{if(t||i){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=s,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(In(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=g=>Math.round((performance.now()-g)*100)/100;this.rendered=!0,Fe();let s=performance.now(),o=Li(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=Mr(this.opts.container),{root:c,els:d,mapHost:h}=aa(l,(g,T)=>this.tf(g,T),this.opts.theme);this.root=c,this.els=d,this.mapHost=h,this.paintedLocale=xs(),this.opts.checkoutBar===!1&&(c.dataset.checkoutBar="off"),Mi(c,o,g=>{t.loadLocale=i(s),this.destroyed||this.applyActiveLocale(g,r)}),fc(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 b=document.createElement("div");return b.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(b),t.mountBuyerShell=i(a),t.skeletonPaint=i(e),this.loadAndFinishChart(b,t,i,e,c)}async loadAndFinishChart(e,t,i,s,o){this.startRealtime(),this.startIdleClock(o);let r=await this.loadChart(e,t,i);if(!r)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=i(s);let a=performance.now();this.salesClosed=!!r.salesClosed||!!this.opts.readOnly,this.salesState=r.salesState??null,this.salesInfo=r;let l=this.chartFetch.outcome();if(this.guestsDeadlineStop?.(),this.guestsDeadlineStop=null,l.state==="resolved"&&l.guestsOnly){this.guestsOnly=!0,this.salesClosed=!0;let{forMs:E}=l.guestsOnly;E!==null&&(this.guestsDeadlineStop=ua(this,E))}if(o.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 E=document.createElement("div");E.className="sl-testbadge",this.testBadgeEl=E,this.syncTestBadge(),this.regions["top-left"].appendChild(E)}let c=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(o),this.watchThemeMode(),this.currency=r.currency??this.opts.currency??"USD",this.currencyResolved=!0,this.eventTimezone=r.timezone??null,gi(this.els.logo,[this.opts.theme?.logoUrl,c?.logoUrl,this.performanceGroup?.brandLogoUrl,r.posterUrl],this.opts.theme?.brandName??c?.brandName??r.eventName??"?"),this.els.name.textContent=r.eventName??"";let d=r.startsAt?wi(r.startsAt,r.timezone??null,this.opts.locale):"";this.eventWhenText=d||null,this.els.meta.textContent=[r.venue,d].filter(Boolean).join(" \xB7 "),this.syncProjection();let h=!!this.controller.doc&&this.controller.getExpandedSeats().some(E=>E.commercial?.restrictedView||E.commercial?.obstructedView);this.buildAccessibilityMenu(h),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"),o.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 m=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=i(m),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncOffer(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let u=this.controller.doc,b=ri(this.opts.event),g=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),T=g??"event",S={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:T,surface:g==="season"?"season_picker":g==="performance_group"?"performance_group_picker":"seat_picker",ms:i(s),performanceProfile:t,seatCount:this.allSeats().length,objectCount:u?.objects.length??0,sectionCount:u?.objects.filter(E=>E.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:u?.name,view:this.buyerView,load:b,transport:this.opts.transport?"custom":"pubapi",revealWaitMs:this.revealWaitMs??this.sinceRenderResolved(),handoverMs:this.handoverMs??void 0};Sc(S,(E,L)=>this.emitAnalytics(E,L));let k=r.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",ko({...S,performanceProfile:{...S.performanceProfile,...k}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=r,await this.registerAgentTools(),this}registerAgentTools(){return wc(this)}webMcpHost(e){return xo(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=Bd(()=>{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 s=this.els.sheetToggle;this.syncSheetAffordance();let o=0,r=!1,a=!1,l=!1;s?.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,o=c.clientY,(l&&s?s:t).setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!a||r)return;let d=c.clientY-o;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-o)<6&&this.cycleSheet(),a=!1,(l&&s?s:t).releasePointerCapture?.(c.pointerId),l=!1})}this.els.foot?.addEventListener("click",s=>{this.root?.dataset.layout==="narrow"&&(s.target.closest?.('.sl-chip,button,a,input,select,label,[role="button"]')||this.cycleSheet())});let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let s=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!s)),this.els.pricesSec?.setAttribute("aria-expanded",String(!s)),!s&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",s=>{s.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",s=>{s.key!=="Enter"&&s.key!==" "||s.target.closest("select,button")||(s.preventDefault(),i())}),e.addEventListener("click",s=>{let o=s.target.closest("[data-sl-info]");if(!o||!e.contains(o))return;s.stopPropagation();let r=o.closest(".sl-info"),a=!r?.classList.contains("open");this.closeInfoPops(r),r?.classList.toggle("open",a),o.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",s=>{s.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",s=>{this.handleMapPointerDown(s)},!0),this.els.map.addEventListener("mousemove",s=>{if(this.tipPinned)return;let o=this.els.map.getBoundingClientRect();this.tipPos={x:s.clientX-o.left,y:s.clientY-o.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=Po.indexOf(this.sheetState()),i=Math.min(Po.length-1,Math.max(0,t+e));this.setSheetState(Po[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 s=e.clientHeight,o=i!==this.pickerLayoutSize.width||s!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:s};let r=this.fullscreenMeasurementChanged(i,s);this.reportFramedHeight();let a=i<640?"narrow":"wide",l=s<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(),o&&(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 s=performance.now();this.seatsRevealed=!1,this.seatsRevealedWaiters=[],this.seatsRevealedReport=null,this.renderResolvedAt=null,this.revealWaitMs=null,this.handoverMs=null,this.loadAbort=new AbortController;let o=await Kt(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=N("picker.loadingTakingLonger"))});if(this.loadAbort=null,o.outcome==="cancelled"||this.destroyed)return null;let r=o.outcome==="loaded"?o.value:null,a=o.outcome==="loaded"&&!r&&!this.opts.transport?_i(this.chartFetch?.outcome(),this.renderErrorEmitted):null;if(r||this.controller.destroy(),t.loadChartAndStatuses=i(s),this.destroyed)return null;if(!r){a&&Di({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:o.outcome==="timeout"?"load_timeout":o.outcome==="error"?"render_error":"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:Oe(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),tn(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 tn(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),tn(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(s=>s.hasAttribute("inert"));t.forEach(s=>s.setAttribute("inert",""));try{for(;!this.destroyed;){let s=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()-s,performanceProfile:e,view:"map",load:Oe(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let r=tn(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;tn(this.els.boot,{title:["picker.restoringSeats"],busy:!0})}}return!1}finally{t.forEach((s,o)=>{i[o]||s.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=on(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 ys(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(i,s)=>this.tf(i,s),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(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,i=this.els.headInfo?.parentElement;t&&i&&t.parentElement!==i&&(t.classList.add("sl-fs-pill"),i.insertBefore(t,this.els.hold??null));let s=this.extendEl;if(s){let r=e?this.regions["bottom-center"]??this.els.map:i;r&&s.parentElement!==r&&(s.dataset.dock=e?"map":"head",r===i?r.insertBefore(s,this.els.close??null):r.appendChild(s))}let o=this.els.pricesSec;o&&(e?(o.setAttribute("role","button"),o.tabIndex=0,o.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(o.removeAttribute("role"),o.removeAttribute("aria-expanded"),o.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){Qc(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>${F(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.guestsOnly?Ii():this.salesUi?.words(this)??sa(this.wordsSalesState(),!!this.opts.readOnly)}wordsSalesState(){return this.salesState==="testable"&&this.salesInfo?.mode==="test"?"live":this.salesState}finishingHold(){return!!this.salesUi?.finishing(this)}withSalesUi(){return this.salesUiLoad??=Hr().then(e=>(e.translate(N,rn),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 v(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 s=document.createElement("div");s.className="sl-soldout-title",s.textContent=this.tf("picker.soldOutTitle","Sold out");let o=document.createElement("p");o.className="sl-soldout-copy",o.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(i,s,o),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,s=this.isSoldOut(e,t,i),o=[...Ci(e,t)].join("|");o!==this.baSoldOutSig&&(this.baSoldOutSig=o,this.syncTray()),s!==this.soldOut&&(this.soldOut=s,this.soldoutEl?.classList.toggle("on",s))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(s=>(t[s.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(s=>s.objectType!=="ga").slice(0,10).map(s=>this.controller.seatByLabel(s.label)).filter(s=>!!s);if(this.buyerView==="venue3d"&&this.view3dHandle){Nc(this,i);return}el({regions:this.els,categories:this.controller.doc?.categories,pop:s=>this.controller.flashSeat(s,this.cssVar("--sl-accent")||"#f4b740"),focus:(s,o)=>this.controller.focusSection(s,o),focusSeats:s=>this.controller.focusSeats?.(s,{animate:!t})===!0,reducedMotion:t,screenPoint:s=>this.controller.worldToScreen(s),schedule:(s,o)=>this.scheduleMotion(s,o)},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 ed(this)}heldTicketCount(){return td(this)}totalTicketCount(){return nd(this)}updateSelectionCapacity(){id(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){sd(this,e,t)}setCtaPhase(e){od(this,e)}runCheckoutHandoff(e,t){return rd(this,e,t)}holdStorageKey(){return ad(this)}rememberedHoldId(){return ld(this)}rememberHold(e){cd(this,e)}forgetHold(){dd(this)}resumeHoldFromServer(e,t=!1){return pd(this,e,t)}restoreRememberedHold(){return hd(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(s=>s.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=ar({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 ps(this,e)}catPriceRange(e){return hs(this,e)}buildPriceFilter(){Td(this)}applyPriceBand(e){Ed(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(s=>s.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(s=>{if(s.dataset.view==="venue3d")for(let o of["pointerenter","focus","pointerdown"])s.addEventListener(o,yi,{once:!0});s.addEventListener("click",()=>{this.setBuyerView(s.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)],s=new Set((e.zones??[]).map(h=>h.id)),a=Gf(e)==="combined"&&(e.floors?.length??0)>1&&s.size===0||i.some(h=>h.type==="section"&&typeof h.zone=="string"&&s.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",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(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=Dl({floors:this.controller.getFloors(),tf:(s,o)=>this.tf(s,o),onChoose:s=>{s===""?this.controller.setFloorOverview(!0):this.controller.setFloor(s),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&&qa(this.root,e,this.regions);let t=e?_l(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",s=0;if(i&&e&&t?.isConnected){let o=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.height>0&&(s=Math.max(0,o.bottom-r.top+8))}this.controller.setFitClearance?.(s)}syncTestBadge(){let e=this.testBadgeEl;e&&(e.textContent=Lr(N("picker.testMode"),xs()),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(i=>{let s=i.dataset.rung===e;i.classList.toggle("on",s),i.setAttribute("aria-pressed",String(s))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,i=this.els?.zin;if(!e||!this.root)return;let s=this.controller.getRenderer?.(),o=this.controller.canZoomIn?.()===!1||s?.seatsPickable?.()===!0,r=rr({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!==o||e.hidden||!!i?.hidden||!!t?.hidden;e.disabled=r,e.hidden=!1,i&&(i.disabled=o,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"?N("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||!bi()?!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)?jd/2:jd}syncFloors(){Nl(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new ss({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(s=>s.type==="section"&&!this.controller.isSectionClosed(s.id)&&this.controller.getSectionSeatCount(s.id)>0);if(t.length<2)return null;let i=t.findIndex(s=>s.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}markedSeatAnnouncement(e){let t=mo(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return ql(t,e.displayLabel??e.label,this.opts.locale,St(this.performanceGroup))}seatPriceRangeOf(e,t){let i=this.controller.doc?.categories.find(o=>o.key===t),s=i?i.tiers?.length?i.tiers.map(o=>this.paidPrice(i.key,o.id??null,o.price,e)):i.price==null?[]:[this.paidPrice(i.key,null,i.price,e)]:[];return s.length?{min:Math.min(...s),max:Math.max(...s)}: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),o=(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(xs()):this.tf("picker.group.legendUnavailable","Unavailable").toLocaleLowerCase(xs()),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=Je(c),h=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,m=l?`${d} ${h}, ${l.bookingMode==="variable"?N("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):N("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${h}`:c?.objectType==="table"?`${d} ${h}, ${N("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:N("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${m}, ${i?.label??e.categoryKey}${a?`, ${a}`:""}, ${o}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let s=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),o=e.bookingMode==="variable",r=document.createElement("div");r.className="sl-table-scrim",r.innerHTML=Yr(e,{variable:o,held:t,typeWord:Je(e),categoryLabel:s?.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(o?'[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 s=t.querySelector("input[data-table-qty]");s&&(s.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 o=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),r=t.querySelector("[data-table-total]");r&&(r.textContent=this.money(o*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 s=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!s){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:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.startHoldTimer(s.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast(N("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(s){this.opts.onError?.(s),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 as({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,s)=>this.paidPrice(e,t,i,s),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){cc(e,t,this.reducedMotion())}addSeatLabel(e){return dc(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,s=this.controller.getActiveFloorId(),o=e.focalPoint??i?.floors?.find(h=>h.id===s)?.focalPoint??i?.focalPoint??{x:0,y:0},r,a,l=!1;if(e.viewUrl){let h,m=null;try{let b=e.viewMeta?.previewUrl;b&&b!==e.viewUrl?(m=await this.buyerAssetUrls.resolve(b),h=e.viewUrl):h=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(b){t===this.seatViewGen&&this.opts.onError?.(b);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=Yf(u),l=Wf(u)}else{let h;try{let{generateSeatPanorama:m}=await vi();h=m(e,o,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=N("picker.illustrationCaption",{m:h.distanceM})}this.closeSeatView(!1);let c=N("picker.viewFromSeat",{label:e.label}),d=Ui({root:this.root,source:r,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:ft(),viewFromSeatLabel:c,real360Label:N("picker.real360"),previewLabel:N("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 Al(Tl(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 Kf(e,this.currency,{locale:this.opts.locale,fallback:(s,o)=>`${s} ${o}`,...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=wl(e,t);if(i==null)return;let s=6*36e5,o=Math.min(Math.max(i-t+1e3,1e3),s);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},o)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<Xf}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=co(t);if(!i)return;let s=this.offerAvailability?.bookingFee?.amountMinor;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i),this.setPricing(this.hostPricing),i.bookingFee?.amountMinor!==s&&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(s=>s.categoryKey===e)??[];return t!==void 0?i.find(s=>(s.tierId??null)===t)??i.find(s=>s.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 s=this.catPriceRange(i);return s?[[i.key,s]]:[]}))}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,s=!i&&t?.upcoming?.pricingMode!=="matrix"?t?.upcoming??null:null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!s){e.classList.remove("has"),e.replaceChildren();return}let o=i??s,r=o.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=o.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));Bs(h)&&e.classList.add("sl-offer-early-bird"),d.innerHTML=ki(h,F);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&&o.remaining!=null&&u.push(N("picker.offerRemainingAvailable",{count:o.remaining})),i&&o.endsAt!=null){let k=!this.opts.locale||/^en(?:-|$)/i.test(this.opts.locale)?Nr(o.endsAt):null;if(u.push(k??N("picker.offerUntil",{time:wi(o.endsAt,this.eventTimezone,this.opts.locale)})),k){let E=Math.max(1e3,o.endsAt-Date.now()),L=E%6e4||6e4;this.offerCountdownTimer=setTimeout(()=>{this.offerCountdownTimer=null,Date.now()>=o.endsAt?this.refreshOfferAvailability(!1):this.syncOffer()},Math.min(L+25,E+25))}}if(s?.startsAt!=null&&u.push(N("picker.offerStarts",{time:wi(s.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 b=document.createElement("details");b.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=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."),b.append(g,T),a.append(l,b),e.replaceChildren(a),e.classList.add("has")}paidPrice(e,t,i,s){if(s){let r=$d(this.opts.pricing?.objects,s,t)??$d(this.controller.doc?.seatPrices,s,t);if(r!==void 0)return r}let o=s?this.channelByObject.get(s):void 0;if(o&&e){let r=this.pricesByChannel.get(o)?.find(a=>a.categoryKey===e&&a.tierId===(t??null));if(r)return r.price}return Ve(this.opts.pricing?.prices,e,t,i)}heldPrice(e){return this.checkoutMode==="hosted"?e.unitPrice:Wi({...this.hostPricing,seatPrices:this.controller.doc?.seatPrices},e.label,e.categoryKey,e.tierId,e.unitPrice)}hostObjectPrices(){return this.opts.pricing?.objects}legendDeps(){return Cd(this)}seatCategory(e){return this.controller.seatByLabel(e)?.categoryKey||null}seatPlaces(e){return e.map(t=>{let i=this.controller.seatByLabel(t),s=i?this.controller.seatDetails(i.id):null,o=s?J(s)||s.rowLabel:null;return{label:t,...s?.sectionLabel?{section:s.sectionLabel}:{},...o?{row:String(o)}:{},...s?.seatNumber!=null?{seat:String(s.seatNumber)}:{}}})}partialLegend(){return this.markedSeatIds.size?this.performanceGroup?.partialWords?.legend??null:null}syncPriceRail(e,t,i=this.legendDeps()){Ad(this,e,t,i)}syncPrices(){this.currencyResolved&&Pd(this)}focusCategory(e){Ld(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(o=>!e.has(o.label)&&(this.controller.getStatus(o.id)??"free")!=="free");if(!t.length)return;this.controller.deselect(t.map(o=>o.id));let i=this.handedOff&&!this.holdConflicted?(this.hold?.items??this.hold?.seats??[]).map(o=>o.label):[],s=t.find(o=>!i.includes(o.label));s&&this.toast(N("picker.seatJustTakenByAnother",{label:s.label}),"error")}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:i,heldLabels:s,total:o,count:r}=ds(this),a=[],l=new Set;if(!this.salesClosed){let f=this.performanceGroup?.nightSummary?.()??[];f.length&&a.push($l(f,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let R=this.performanceGroup?.selectionModeSwitch;R&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${F(R.label)}</button>`)}let c={salesClosed:this.salesClosed,salesState:this.wordsSalesState(),note:this.guestsOnly?fa():this.salesUi?.note(this),hasPicks:e.length>0||i.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,season:St(this.performanceGroup),seated:!!this.controller.doc?.objects?.some(f=>f.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(oa(c)),this.els.trayHint&&(this.els.trayHint.textContent=ra(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed),this.salesUi?.sync(this);let d=!e.length&&!i.length&&!Be(this.gaQty,this.hold?.items??[]);if(fs(this.performanceGroup)&&!this.salesClosed&&!this.hold&&(d||this.bestAvailableBusy||this.bestAvailableConfirm)){let f=(this.controller.doc?.categories??[]).filter(_=>!_.notForSale),R=this.controller.getBestAvailableZones();this.baZone&&!R.some(_=>_.id===this.baZone)&&(this.baZone="");let M=Ci(f,this.controller.categoryAvailability());this.baSoldOutSig=[...M].join("|"),this.bestAvailableSoldOut=f.length>0&&M.size===f.length,M.has(this.baCat)&&(this.baCat=""),(!this.bestAvailableSoldOut||this.bestAvailableBusy||this.bestAvailableConfirm)&&a.push(na({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:f.map(_=>M.has(_.key)?{..._,soldOut:!0}:_),zones:R,selectedCategory:this.baCat,selectedZone:this.baZone}))}let h=(f,R,M,_=1,D,I,q,Y)=>ea({categoryLabel:q,offerName:Y,d:f?this.controller.seatDetails(f):null,area:M==="ga"?t.find(Q=>Q.id===D):void 0,label:R,objectType:M,quantity:_,identity:I,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),m=F,u=[];for(let f of Ha(i)){let R=f.objectType==="ga"?`held:ga:${f.objectId}:${f.tierId??""}`:`held:${f.label}`;l.add(R);let M=f.objectType!=="ga"?this.controller.seatByLabel(f.label):null,_=this.performanceGroup?.packagePricing?f.categoryKey||M?.categoryKey||"":f.categoryKey,D=this.controller.doc?.categories.find(qe=>qe.key===_),I=this.performanceGroup||this.suppressPricing?null:xc(this.controller,f),q=this.performanceGroup?.packagePricing?.seat(f.label,_),Y=(f.tierId&&!I?D?.tiers?.find(qe=>qe.id===f.tierId)?.name:void 0)??q?.types?.options.find(qe=>qe.id===q.types?.selected)?.name,Q=this.offerPrice(f.categoryKey,f.tierId??null)?.offerName,fe=f.objectType==="table"?this.controller.tableSelection(f.label):null,ge=M?this.controller.seatDetails(M.id):null,be=this.seatViewEnabled()&&!!M&&f.objectType!=="table"&&!!this.deliverableViewReference(M),Ue=m(this.tf("picker.heldForYou","Held for you")),V=(fe?.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>`:"")+(I?`<select class="tier" data-held-tier="${m(f.label)}" aria-label="${m(N("picker.ticketTierFor",{label:f.label}))}">${Ei(I,f.tierId??void 0,m)}</select>`:""),Nt=this.heldPrice(f)*(f.quantity??1);u.push({key:R,fresh:!this.lastTrayKeys.has(R),held:!0,seatIds:[],heldLabels:f.labels,removeAria:N("picker.removeHeldTicketLabel",{label:ji(f,t)}),locateId:M?.id??null,section:ge?.sectionLabel??"",rowLabel:ge&&J(ge)||"",seatLabel:ge?.seatNumber??f.label,categoryLabel:`${D?.label??_}${Y?` \xB7 ${Y}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(_)??D?.color??"",identityHtml:h(M?.id??null,f.label,f.objectType,f.quantity??1,f.objectId,fe??void 0,`${D?.label??_}${Y?` \xB7 ${Y}`:""}`,Q),stateHtml:`<span class="sl-ticket-state held" aria-label="${Ue}" title="${Ue}"><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:Nt,amountText:q?q.amountText:this.suppressPricing?"":this.money(Nt),noteHtml:gt(M??void 0),railHtml:this.performanceGroup?"":js(N("picker.removeHeldTicketLabel",{label:ji(f,t)}),be?f.label:null)})}let b=this.seatViewEnabled();for(let f of e.filter(R=>!s.has(R.label))){let R=`seat:${f.id}`;l.add(R);let M=this.controller.doc?.categories.find(V=>V.key===f.categoryKey),_=this.performanceGroup?.packagePricing?.seat(f.label,f.categoryKey),D=_?.types?`<select class="tier" data-season-type="${m(f.label)}" aria-label="${m(N("picker.ticketTierFor",{label:f.label}))}">`+Ei(_.types.options,_.types.selected,m)+"</select>":f.tiers&&f.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${m(f.id)}" aria-label="${m(N("picker.ticketTierFor",{label:f.label}))}">`+Ei(f.tiers,f.tierId,m)+"</select>":"",I=f.tiers?.find(V=>V.id===f.tierId)??f.tiers?.[0],q=this.offerPrice(f.categoryKey,I?.id??null)?.offerName,Y=I?.buyerMessage?.trim()||(I?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),Q=this.controller.seatDetails(f.id),fe=m(this.tf("picker.selected","Selected")),ge=N("picker.removeSeatLabel",{label:f.label}),be=(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>`:"")+D,Ue=this.paidPrice(f.categoryKey,f.tierId??null,f.price,f.label)*(f.quantity??1);u.push({key:R,fresh:!this.lastTrayKeys.has(R),held:!1,seatIds:[f.id],heldLabels:[],locateId:f.id,section:Q?.sectionLabel??"",rowLabel:Q&&J(Q)||"",seatLabel:Q?.seatNumber??f.label,categoryLabel:M?.label??f.categoryKey,identityHtml:h(f.id,f.label,f.objectType,f.quantity??1,f.objectId,f,M?.label??f.categoryKey,q),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??M?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${fe}" title="${fe}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:be,amount:Ue,amountText:_?_.amountText:this.suppressPricing?"":this.money(Ue),removeAria:ge,noteHtml:gt(f)+(Y?`<small class="sl-tier-note">${m(Y)}</small>`:""),railHtml:js(ge,b&&f.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(f.label)??{})?f.label:null)})}u.length&&a.push(u.map(ta).join("")),t.length&&a.push(Na(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 g=this.performanceGroup?.selectNight;g&&Ql(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 R=f.closest(".sl-chip");if(R.dataset.held){this.removeHeldLabels(decodeURIComponent(R.dataset.held).split(`
3348
+ `),R);return}let M=R.dataset.seat.split(" "),_=()=>{this.controller.deselect(M)};if(this.reducedMotion()){_();return}R.classList.remove("sl-enter"),R.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(_,ne.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(f=>{f.addEventListener("click",R=>{R.stopPropagation();let M=decodeURIComponent(f.dataset.tableEdit??""),_=this.controller.tableSelection(M);if(!_)return;let D=i.find(I=>I.label===M&&I.objectType==="table");this.showTableDialog({..._,quantity:D?.quantity??_.quantity},!!D,f)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(f=>{f.addEventListener("change",()=>{let R=f.dataset.seasonType,M=this.performanceGroup?.packagePricing;R&&M?(M.setType(R,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 R=this.controller.seatByLabel(f.dataset.viewLabel);R&&this.openSeatView(R)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(f=>{let R=()=>this.controller.flashSeat(f.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");f.addEventListener("mouseenter",R),f.addEventListener("focusin",R),f.addEventListener("click",M=>{M.target.closest?.('button,a,select,[role="button"],input')||!this.controller.focusSeats?.([f.dataset.locate],{animate:!this.reducedMotion()})||R()})}),Ba(this,this.els.tray,t),this.controller.setGASelection(Aa(this.gaQty)),To(this),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,k=this.lastTrayTotal,E=Xl(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat",St(this.performanceGroup)),L=r?this.performanceGroup?.packagePricing?.total([...i.filter(f=>f.objectType!=="ga"),...e.filter(f=>!s.has(f.label))].map(f=>({label:f.label,categoryKey:f.categoryKey||this.controller.seatByLabel(f.label)?.categoryKey||""}))):null;this.els.count.textContent=L?.countText||E||(r?rn("picker.ticketsCount",r)+(this.suppressPricing?"":this.feeWords().tray(i,r,o)):this.salesUi?.view(this)?this.closedWords().pill:this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=L?L.amountText:r&&!this.suppressPricing?this.money(o):"",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=E||(r?rn("picker.seatsSelectedCount",r):"")),this.syncCta(r,T);let O=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";r!==S&&!O&&this.animateOnce(this.els.count,"sl-value-pop",380),o!==k&&!O&&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=o,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(){ml(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(fl),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(gl),bl(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||this.performanceGroup)return!1;let s=i[0];i.forEach(r=>this.releasingLabels.add(r)),t?.setAttribute("aria-busy","true");let o=t?.querySelector(".rm");o&&(o.disabled=!0);try{let r=this.handedOff;if(!await this.controller.releaseLabels(i))return this.toast(N("picker.couldNotRemoveLabel",{label:s}),"error"),!1;Ra(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"),o?.isConnected&&(o.disabled=!1)}}async holdSelection(){return this.ctaPhase!=="idle"?Pe("busy",this.tf("picker.securingSeats","Securing your seats\u2026")):!this.hold&&this.totalTicketCount()===0?Pe("nothing_selected",this.tf("picker.selectSeats","Select seats")):this.handleCta(!1)}async handleCta(e=!0,t=e){if(this.salesClosed&&!this.finishingHold())return Pe("sales_closed",this.guestsOnly?Ii().toast:this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."));let i=this.controller.getSelectionValidity(this.totalTicketCount());if(i&&!i.isValid){let o=bs(i,(r,a)=>this.tf(r,a));return this.toast(o,"warning"),Pe("selection_invalid",o)}if(this.totalTicketCount()>this.maxTickets){let o=N("picker.removeTicketsUntilOrFewer",{count:this.maxTickets});return this.toast(o,"warning"),Pe("too_many_tickets",o)}let s=this.committedSelection();if(this.hold&&(this.salesClosed||!s.some(o=>!(this.hold.items??[]).some(r=>r.label===o.label))&&!Be(this.gaQty,this.hold.items??[]))){let o=this.hold.seats??s;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(s.map(o=>o.label)),this.setCtaPhase("holding");try{let o=null,r=Pa(this.gaQty,this.controller.currentHold?.()?.items??this.hold?.items??[]),a=this.committedSelection();if(a.length){let d=await this.controller.hold(void 0,this.opts.holdTtlMs);o=d?{holdId:d.holdId,expiresAt:d.expiresAt,seats:d.seats,items:d.items}:null}for(let{areaId:d,tierId:h,qty:m}of r){let u=await this.controller.holdGA(d,m,{tierId:h,ttlMs:this.opts.holdTtlMs});o=u?{holdId:u.holdId,expiresAt:u.expiresAt,seats:u.seats,items:u.items}:o}if(!o){let d=this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");return this.raiseHoldConflict(d),this.setCtaPhase("idle"),this.syncTray(),Pe("seats_taken",d)}this.hold=o,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(o.expiresAt),this.flashHeldSeats(o),this.emitHoldChange();let l=this.performanceGroup;return e&&(!l||t&&l.checkoutReady?.(o.holdId)===!0)?(this.handedOff=!0,await this.runCheckoutHandoff(o,o.seats??a)):this.setCtaPhase("idle"),{ok:!0,hold:o,seats:o.seats??a}}catch(o){this.opts.onError?.(o);let r=po(o);if(r)return this.toast(r,"warning"),this.setCtaPhase("idle"),Pe("paused",r);if(Ft(o)){let m=this.tf("picker.checkConnection","Check your connection and try again.");return this.toast(m,"warning"),this.setCtaPhase("idle"),Pe("seats_taken",m)}let a=this.guestRefusalMessage(o);if(a)return this.toast(a,"warning"),this.setCtaPhase("idle"),Pe("sales_closed",a);let l=o,c=(l.conflicts??[]).map(m=>m.label).filter(Boolean).slice(0,3);l.reason==="event_closed"&&this.setSalesClosed(!0);let d=l.buyerMessage?l.buyerMessage:l.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):l.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):l.reason==="ticket_option_not_applicable"?N("picker.ticketOptionNotApplicable"):c.length?c.length===1?N("picker.labelsNoLongerAvailable.one",{labels:c.join(", ")}):N("picker.labelsNoLongerAvailable.other",{labels:c.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(d),this.setCtaPhase("idle");let h=l.reason==="event_closed"?"sales_closed":l.reason==="companion_pair_required"||l.reason==="ticket_option_not_applicable"?l.reason:"seats_taken";return Pe(h,d,c.length?c:void 0)}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){ud(this,e)}stopHoldTimer(){md(this)}setExtendPrompt(e,t){fd(this,e,t)}refreshExtendPrompt(){gd(this)}handleExtend(){return bd(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())}guestRefusalMessage(e){let t=ma(e);return t==="guest_choice_closed"?ga():t!=="guests_only"?null:(ba(this),this.salesClosed=!0,this.applySalesClosed(),Ii().toast)}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}bookedLine(){return this.checkoutMode==="hosted"?this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way."):this.tf("picker.confirmedOnly","confirmed.")}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((s,o)=>s+o.quantity,0),i=this.performanceGroup?.groupSelectionSummary?.();if(this.els.bookedSub&&(this.els.bookedSub.innerHTML=i?.seats?`<span class="sl-booked-seats">${St(this.performanceGroup)?rn("picker.season.ticketsConfirmedAcross",i.seats,{performances:i.performances}):rn("picker.group.ticketsConfirmedAcross",i.seats,{performances:i.performances})}</span>`:`<span class="sl-booked-seats">${rn("picker.ticketsCount",t)}</span> ${this.bookedLine()}`),this.els.bookedList){let s=this.controller.getGAAreas();this.els.bookedList.innerHTML=e.lineItems.map(o=>{let r=o.rowLabel&&o.objectType!=="ga"?this.controller.seatDetails(this.controller.seatByLabel(o.label)?.id??""):null,a=Je({displayType:o.displayType??r?.displayType,rowType:r?.rowType,objectType:r?.objectType??o.objectType}),c=(o.objectType==="ga"?"":[o.sectionLabel,o.rowLabel&&`${a} ${o.rowLabel}`,o.seatNumber&&`${this.tf("picker.seat","Seat")} ${o.seatNumber}`].filter(Boolean).join(" \xB7 "))||(o.objectType==="ga"?o.displayLabel||ji(o,s):o.objectType==="table"?`${a} ${o.displayLabel||o.label}`:o.displayLabel||o.label),d=o.quantity>1?` <span class="sl-booked-qty">\xD7${o.quantity}</span>`:"";return`<li>${F(c)}${d}</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),s=null;try{s=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(a){this.opts.onError?.(a)}if(this.destroyed)return;let o=s?.bookingMode==="free",r=s?.providers?.[0]??null;if(!r&&!o){let a=Rr(s?.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:Ir(i)});return}await this.openCheckoutPanel(Or(i,r,s,this.pubApi.ticketKeysFor(e.holdId),this.controller.getGAAreas()))}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await zt())}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:N,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=>{_r(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?J(c):void 0,h=this.controller.doc?.categories.find(b=>b.key===r.categoryKey),m=r.tierId?h?.tiers?.find(b=>b.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,...Pl(r,u),currency:r.currency??this.currency,quantity:r.quantity??1}}),s=i[0]?.currency??this.currency,o=i.reduce((r,a)=>r+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:s,lineItems:i,total:o}}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 s=this.els.toast;if(!s)return;s.replaceChildren();let o=document.createElement("span");if(o.textContent=e,s.appendChild(o),s.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}),s.appendChild(r)}s.dataset.tone=t,s.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{s.classList.remove("on","sl-mo-rise"),s.classList.remove("has-action"),s.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 s=this.els.map.clientHeight;if(s<=0)return;let o=i.getBoundingClientRect(),r=o.height||i.offsetHeight||eg,a=o.height?o.top-this.els.map.getBoundingClientRect().top:s-go-r,l=Math.round(s-a+Qf);if(l+Jf>s){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),mc({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?tc(this.tipPos,e,t):null,s=i??ec(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${s.left}px`,this.tipEl.style.top=`${s.top}px`,i?this.tipEl.dataset.placement=i.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let i=this.performanceGroup,s=mo(e.mark,i?.nights?.()),o=s?.states.filter(r=>r.free).length??0;return zl(s,{locale:this.opts.locale,switchLabel:i?.selectionModeSwitch?.label??null,selectPartialLabel:i?.partialSeatSelection?.label(o)??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 s=this.nightStripFor(e,i);this.tipEl.style.setProperty("--sl-cat",e.categoryColor);let o=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),r=this.performanceGroup?.packagePricing?.seatCardPrice(e.categoryKey)??null;this.tipEl.innerHTML=Jl(e,{price:r?r.price:this.suppressPricing?"":this.money(o),feeNote:r?r.note:this.suppressPricing?"":this.feeWords().seat(o),priceNote:r||!this.suppressPricing?"":this.performanceGroup?.surface==="season"?N("picker.season.includedInPackage"):this.tf("picker.group.pricesPerPerformance","Prices shown per performance"),rowTypeWord:Je(e),ownHold:this.controller.currentHold()?.labels.includes(e.label)===!0,extra:s+(i?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${F(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()}),sc(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[s,o]of Object.entries(e())){let r=this.controller.idForLabel(s);r&&(i[r]=o,o?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(s=>t.has(s.id)||t.has(s.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.baQty=Math.min(this.baQty,this.maxTickets),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=ii(this.themeMode),i=Ie(this.controller.doc?.theme,this.opts.theme,t,this.performanceGroup?.brandAccent);for(let[s,o]of Object.entries(i))e.style.setProperty(s,o);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=si(()=>{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:ii(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=ii(this.themeMode),i=Ie(this.controller.doc?.theme,this.opts.theme,t,this.performanceGroup?.brandAccent),s=Bt(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,o=or(i,s);for(let r of sr)o?e.style.setProperty(r,o[r]):e.style.removeProperty(r)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){this.hostPricing=e;let t=kl(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=da(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 Uf(e);return this.opts.messages&&qf(this.opts.messages),i===this.paintedLocale||this.applyActiveLocale(i,t),i}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(this.paintedLocale=e,pa(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(),ng(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 Mc(this)}setBuyerView(e,t){Hc(this,e,t)}seatState3dFor(e){return Rc(this,e)}pushAvailabilityTo3d(){Ic(this)}syncSelectionTo3d(){Dc(this)}seatViewFor3d(e){return Bc(this,e)}onView3dSeatPick(e){Fc(this,e)}openAreaChooser(e,t){let i=this.controller.getGAAreas().find(s=>s.id===e);i&&(this.collapseSheet(),Js(this,i,t))}seatViewCaption(e){return Vc(this,e)}saveView3dComparisonSeat(e){$c(this,e)}clearView3dComparison(){zc(this)}view3dComparisonSnapshot(e){return jc(this,e)}enter3d(e){return Gc(this,e)}publish3dTopInset(){Kc(this)}exit3d(){Uc(this)}openSeatConfidencePassport(e,t=null){So(this,e,t)}closeSeatConfidencePassport(e=!0){Fn(this,e)}openView3dComparison(){Cc(this)}closeView3dComparison(e=!0){kt(this,e)}getCurrentHold(){return this.hold}async markBooked(e){return yd(this,e)}async resumeHold(e){return this.resumeHoldFromServer(e)}async changeHeldTier(e,t){e.disabled=!0;try{let i=await kc(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(s){this.opts.onError?.(s);let o=po(s);if(o)return this.toast(o,"warning"),null;if(Ft(s))return this.toast(this.tf("picker.checkConnection","Check your connection and try again."),"warning"),null;let r=this.guestRefusalMessage(s);if(r)return this.toast(r,"warning"),null;let a=s?.reason,l=s?.buyerMessage,c=l||(a==="not_enough_together"?N("picker.couldNotFindSeatsTogether",{count:e}):a==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):a==="ticket_option_not_applicable"?N("picker.ticketOptionNotApplicable"):a==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):a==="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(c,"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 s=Ai(this.controller,t);if(s)throw s;this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let o=this.els.tray?.querySelector(".sl-ba-go");o&&(o.disabled=!0,o.classList.add("sl-busy"),o.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(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(),i=!0;if(t)i=await this.controller.release();else if(e){let s=[...new Set([...(e.items??[]).map(o=>o.label),...(e.seats??[]).map(o=>o.label)])];if(s.length)try{await this.api.release(this.opts.event,s,e.holdId)}catch(o){this.opts.onError?.(o),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 _e({url:()=>this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},onIdleExpired:()=>Ol(this.idlePauseHost),heldHoldId:()=>this.hold?.holdId??null,onHoldState:(t,i)=>{i==="booked"&&this.settleBookedHold(t)},sink:{...Tn(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=Zr(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 Hl(this.idlePauseHost,e)}resumeFromIdle(){return Il(this.idlePauseHost)}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=_d({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"),s=[],o=[];for(let r of i){let a=this.controller.seatByLabel(r.label);(a&&this.controller.getStatus(a.id)==="free"?s:o).push(r.label)}Od(e,{recoverable:s,taken:o,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||Id({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:i=>this.controller.seatByLabel(i),statusOf:i=>this.controller.getStatus(i),flash:(i,s)=>this.controller.flashSeat(i,s)},e)}).catch(()=>{})}destroy(){this.transportAbort.abort(),this.loadAbort?.abort(),this.loadAbort=null,this.destroyed=!0,this.guestsDeadlineStop?.(),this.guestsDeadlineStop=null,wo(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 ig(n){et.prewarm(n)}import{formatMoney as vg,loadLocale as wg,setStringOverrides as xg,t as kg}from"@seatlayer/core";var Ud="seatlayer-performance-group-picker-style";function qd(){if(document.getElementById(Ud))return;let n=document.createElement("style");n.id=Ud,n.textContent=`
3349
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)}
3350
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)}
3351
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}
@@ -3405,7 +3405,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3405
3405
  @media(min-width:900px){.sl-pg-legend-list{justify-content:flex-start}}
3406
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}
3407
3407
  @media(max-width:640px){.sl-pg-head{padding:13px 14px}.sl-pg-head h2{font-size:18px}.sl-pg-inner{min-height:590px}}
3408
- `,document.head.appendChild(n)}var Gf="https://api.seatlayer.io",Kf=6e4,Uf=2e3,qf=1e3,Wf=36e5,Yf=5e3,Zf=5e3,Qf=15e3,Xf=12e4,Jf=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),ie=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function eg(n){return new Promise(e=>setTimeout(e,n))}function Co(n){let e=Number(n.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(Yf,e*1e3)):1e3}function rn(n,e){return`/pub/performance-groups/${encodeURIComponent(n)}/operations/${encodeURIComponent(e)}`}function Vn(n){return n.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var Ao=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)),s=[...new Set([...this.prior.keys(),...t.keys()])].filter(o=>this.prior.get(o)!==t.get(o)).map(o=>({label:o,status:t.get(o)??"blocked"}));this.prior=t,s.length&&this.sink.applyStatuses(s),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof ie){this.stop();return}if(Li(e)){this.stop(),this.api.sessionEnded(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},vs=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??Gf).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??Kf,this.realtimePollMs=Math.max(500,t.realtimePollMs??Uf),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(s=>this.adoptSession(s));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(s=>{throw this.chartRequest=null,s});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 s=this.objectsCache;if(this.selectionMode==="same_seat"){let r=s.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:s.revision,state:s.state,salesClosed:r.some(h=>h.salesClosed)};return this.noteAvailability(s,d.salesClosed,d),d}let o=s.performances.find(r=>r.eventKey===this.activePerformanceKey);if(!o)throw new j(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(s,s.salesClosed||s.performances.some(r=>r.salesClosed),o),o}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,s){if(this.assertUsable(),s)throw new j(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let o=t.map(c=>c.label),r={labels:o};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,o,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,o,Date.now()+this.recoveryTimeoutMs,Co(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,o,Date.now()+this.recoveryTimeoutMs,Co(l))}}try{return await this.throwResponse(l,o)}catch(c){throw this.failOperation(a),c}}async release(e,t,i){this.assertUsable();let s=this.operationForHold(i),o=await this.json(`${rn(this.groupKey,s)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(i),this.allocationsByHold.delete(i),this.clearOperationRecord(),o}async resume(e,t){this.assertUsable();let i=this.operationForHold(t),s=await this.json(rn(this.groupKey,i));return this.complete(s.operation)}async extend(e,t,i=12e4){this.assertUsable();let s=this.operationForHold(t),o=Math.max(qf,Math.min(Wf,Math.round(i))),r=await this.json(`${rn(this.groupKey,s)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:o})}),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 Ao(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:Vn(e.operationId)});let t;try{t=await this.authorized(rn(this.groupKey,e.operationId))}catch(o){return o 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 s=i.operation.state;return s==="committed"||s==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(i.operation)):s==="aborted"||s==="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>=Xf?Qf:Zf;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 s=await this.authorized(rn(this.groupKey,e));if(!s.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(s)).operation}catch(s){return s 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"||Jf.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 s=0;s<2;s++){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?Vn(i):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,i,s=100){let o=s,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:Vn(e)}),await eg(o),this.destroyed)throw new ie;let l;try{l=await this.authorized(rn(this.groupKey,e))}catch(h){if(h instanceof ie)throw h;if(h instanceof ee)throw this.recoveryFailed(e,"request_failed"),h;o=Math.min(2e3,Math.max(100,o*2));continue}if(l.status===404){o=Math.min(1e3,Math.max(100,o*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"})));o=Co(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:Vn(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 s=e.state??this.descriptorCache?.state??"active",o=e.revision??null,r=!!o&&!!this.knownRevision&&o!==this.knownRevision;o&&!this.knownRevision&&(this.knownRevision=o);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:s,salesClosed:!!t||s!=="active",revision:o,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(s=>s.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 s={...t.headers};t.body!==void 0&&(s["Content-Type"]="application/json");let o=await this.access.authorization(i?"unauthorized":"initial");if(this.destroyed)throw new ie;if(this.adoptFailure)throw this.adoptFailure;if(!o)throw new Error("performance_group_buyer_access_required");s.Authorization=o;let r=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:s,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,o))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 s=await e.json().catch(()=>null)??{},o=s.code??s.error??`request_failed_${e.status}`;throw e.status===409&&!s.conflicts?.length&&t.length&&(s.conflicts=t.map(r=>({label:r,status:"held"}))),new j(e.status,s.error??o,o,s.conflicts)}};import{formatMoney as tg,t as Po}from"@seatlayer/core";var an,Tt,tt,ln,$n,nt,jd,ws,xs=class{constructor(e){this.options=e;C(this,nt);C(this,an,null);C(this,Tt,!1);C(this,tt,null);C(this,ln,!1);C(this,$n,!1)}get mode(){return p(this,Tt)?"hosted":"handoff"}async prepare(){try{x(this,an,await this.options.api.paymentOptions()),x(this,Tt,!!p(this,an))}catch(e){x(this,Tt,!1),this.options.onError?.(e)}}async open(e,t){if(!p(this,Tt)||p(this,ln))return;if(t.selectionMode!=="same_seat"){this.options.announce(Po("picker.group.hostedPerPerformance"));return}let i=p(this,an),s=t.seatLabels.length;if(i.bookingMode==="paid"&&!i.providers.length){await w(this,nt,ws).call(this,e,t.descriptor,{kind:"unavailable",reason:i.reason==="unavailable_for_run"?"unavailable_for_event":"not_configured",seatCount:s});return}x(this,ln,!0);try{let{total:o,currency:r,lines:a}=w(this,nt,jd).call(this,t.holdId,t.descriptor);await w(this,nt,ws).call(this,e,t.descriptor,{kind:"pay",provider:null,free:i.bookingMode==="free",order:{holdId:t.operationId,expiresAt:t.expiresAt,currency:r,total:o,labels:[...t.seatLabels],lines:a}})}finally{x(this,ln,!1)}}resume(e,t,i){let s=sn(t);s?.outcome!=="success"||!s.orderId||w(this,nt,ws).call(this,e,i,{kind:"resume",orderId:s.orderId})}destroy(){x(this,$n,!0),p(this,tt)?.destroy(),x(this,tt,null)}};an=new WeakMap,Tt=new WeakMap,tt=new WeakMap,ln=new WeakMap,$n=new WeakMap,nt=new WeakSet,jd=function(e,t){let i=this.options.api.allocationsForHold(e),s=i.flatMap(a=>a.items)[0]?.currency??t.currency,o=0,r=i.map(a=>{let l=a.items.reduce((d,h)=>d+Math.round(h.unitPrice*100)*(h.quantity??1),0);o+=l;let c=t.performances.find(d=>d.eventKey===a.eventKey);return{label:a.items.map(d=>d.label).join(", "),detail:c?nn(c,this.options.locale):null,amount:l/100}});return{total:o/100,currency:s,lines:r}},ws=async function(e,t,i){let s;try{({mountCheckout:s}=await $t())}catch(r){this.options.onError?.(r),this.options.announce(Po("picker.group.checkoutCouldNotOpen"));return}if(p(this,$n)||!e)return;p(this,tt)?.destroy();let o=this.options.api;x(this,tt,s({root:e,state:i,eventKey:o.groupKey,event:{name:t.name,detail:Po("picker.group.checkoutDates").replace("{count}",String(t.performanceCount))},formatMoney:(r,a)=>tg(r,a,{locale:this.options.locale,fallback:(l,c)=>`${l} ${c}`,...Number.isInteger(r)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:async r=>{let a=await o.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=>o.orderStatus(r),onCancel:()=>{x(this,tt,null)},onConfirmed:r=>this.options.onConfirmed?.(r),onError:r=>this.options.onError?.(r)}))};var ng={audience_not_public:"audience_not_public",sales_not_open:"sales_not_open",invalid_origin:"origin_not_allowed"},ig=3e4;function sg(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 Lo=class extends Error{constructor(t,i){super(`performance_group_public_session_refused:${t}`);this.reason=t;this.status=i;this.name="PerformanceGroupPublicSessionRefused"}},ze,it,zn,cn,Mo=class{constructor(e){this.options=e;C(this,ze,null);C(this,it,null);C(this,zn);C(this,cn);x(this,zn,e.fetch??globalThis.fetch.bind(globalThis)),x(this,cn,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return p(this,ze)}async mint(e=!1){if(e&&x(this,ze,null),p(this,ze)&&p(this,ze).expiresAt-ig>Date.now())return p(this,ze);if(p(this,it))return p(this,it);let t=(async()=>{let i=await p(this,zn).call(this,`${this.options.base}/pub/performance-groups/${encodeURIComponent(this.options.performanceGroup)}/sessions`,{method:"POST",body:JSON.stringify(p(this,cn)?{origin:p(this,cn)}:{}),credentials:"omit"}),s=await i.json().catch(()=>null);if(!i.ok){let o=s?.code??s?.error,r=i.status===403&&o?ng[o]:void 0;throw r?(this.options.onRefused?.({reason:r,code:o,status:i.status,retryable:r==="sales_not_open"}),new Lo(r,i.status)):new Error(`performance_group_public_session_failed_${i.status}`)}if(!sg(s,this.options.performanceGroup))throw new Error("performance_group_public_session_invalid");return x(this,ze,s),s})();x(this,it,t);try{return await t}finally{p(this,it)===t&&x(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,zn=new WeakMap,cn=new WeakMap;function Gd(n){let e=new Mo(n);return{access:new pe({provider:({reason:i})=>e.token(i),...n.accessHooks}),loader:e}}var Kd="https://api.seatlayer.io";function Ud(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 Ho=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}):Gd({base:(e.apiBase??Kd).replace(/\/$/,""),performanceGroup:e.performanceGroup,onRefused:i=>{this.refusal=i},accessHooks:{onExpired:e.onAccessExpired,onUnavailable:t}}).access,this.api=new vs(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 xs({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,zd(),await rg(this.options.locale),this.options.messages&&ag(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(i){throw Ee({apiBase:this.options.apiBase??Kd,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:Ie(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(Ud(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 s=document.createElement("div");s.className="sl-pg-progress";let o=document.createElement("section");o.className="sl-pg-head",o.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=ho(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,o.append(r,a,l,c,m);let u=document.createElement("div");u.className="sl-pg-legend";let y=document.createElement("div");y.className="sl-pg-pane",y.setAttribute("role","group"),y.setAttribute("aria-label",this.copy("picker.group.yourSelection")),y.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 k=document.createElement("p"),E=document.createElement("button");E.type="button",E.hidden=!0,E.textContent=this.copy("picker.group.retry"),E.addEventListener("click",()=>{this.retryRecovery()}),S.append(k,E),T.appendChild(S);let L=document.createElement("div");L.className="sl-pg-live",L.setAttribute("role","status"),L.setAttribute("aria-live","polite"),i.append(s,o),g&&i.append(g),i.append(u,T,y,L),e.appendChild(i),this.root=i,this.progressHost=s,this.legendHost=u,this.paneHost=y,this.datesSummaryHost=d,this.datesCardsHost=h,this.innerHost=T,this.heldSummary=m,this.live=L,this.statusHost=S,this.statusCopy=k,this.statusAction=E,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new et(ps({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,enable3DCrowd:this.options.enable3DCrowd,touchNavigation3D:this.options.touchNavigation3D,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(i,s)=>{try{this.options.onAnalytics?.(i,{...s,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,s)=>this.holdChanged(i,s),onCheckout:(i,s)=>this.checkout(i,s),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"?Il(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,s)=>{this.selectPartialSeat(i,s)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:i=>this.partialSeatDates.get(i)??this.nights().map(s=>s.eventKey),label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),apply:(i,s)=>this.applySeatDates(i,s,!0)}:null,checkoutReady:i=>!this.booked&&this.activeHandoff?.holdId===i}));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:ns(t,this.options.locale),time:is(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:nn(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,i=!!t?.salesClosed||!!t&&t.state!=="active",s=this.mode==="same_seat"&&!i?t?.partial??{}:{},o={};for(let r of this.markedLabels)o[r]=null;if(this.markedLabels.clear(),e>0)for(let[r,a]of Object.entries(s))!a.length||a.length>=e||(o[r]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(r));return o}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(s=>s.eventKey===this.activePerformanceKey);if(!e)return null;let t=nn(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:nn(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 o=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:o*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:o?e.length:0,perPerformance:o}}let t=e.map(o=>this.selectionsByEvent.get(o.eventKey)?.length??0),i=t.filter(o=>o>0),s=i.length===t.length&&i.every(o=>o===i[0]);return{seats:t.reduce((o,r)=>o+r,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:i.length,perPerformance:s&&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=jl(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=_l({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(o=>o.label)??[],s=this.heldTotal();e.hidden=!1,e.innerHTML=Gl({title:this.copy("picker.group.yourSelection"),rows:t.map(o=>({eventKey:o.eventKey,name:`${ns(o,this.options.locale)} ${is(o,this.options.locale)}`,labels:i})),empty:this.copy("picker.group.noSeatsChosenYet"),note:s?null:this.copy("picker.group.pricesPerPerformance"),total:s?{label:this.copy("picker.group.total"),amount:s}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Kl(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let s=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!s.length)return null;let o=s.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),r=s[0]?.currency??t.currency;try{return og(o,r,void 0,this.options.locale)}catch{return`${r} ${o.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=ho(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 s=this.api.includedPerformanceKeys();if(s.length===t.length&&s.every(o=>t.includes(o)))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(o){return s.length&&(this.api.setIncludedEventKeys(s),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(o),!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(Ud(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,(s,o)=>String(t[o]??`{${o}}`)):i:lg(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 s=document.createElement("button");s.type="button",s.className="sl-pg-step",s.dataset.step="next",s.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),s.textContent="\u203A",s.addEventListener("click",()=>{this.stepPerformance(1)});let o=document.createElement("div");return o.className="sl-pg-tabs",o.setAttribute("role","tablist"),o.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)),o.appendChild(l)}),t.append(i,o,s),this.tabsHost=o,this.prevButton=i,this.nextButton=s,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 s=getComputedStyle(this.tabsHost??document.body).direction==="rtl",o=-1;switch(e.key){case"ArrowRight":o=i+(s?-1:1);break;case"ArrowLeft":o=i+(s?1:-1);break;case"ArrowDown":o=i+1;break;case"ArrowUp":o=i-1;break;case"Home":o=0;break;case"End":o=t.length-1;break;default:return}if(o<0||o>=t.length)return;e.preventDefault();let r=t[o];r.focus({preventScroll:!0}),r.disabled||this.switchPerformance(r.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),i=t.findIndex(o=>o.dataset.eventKey===this.activePerformanceKey),s=t[i+e];!s||s.disabled||(s.focus({preventScroll:!0}),this.switchPerformance(s.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let s=!this.holdBlocked();return{complete:e.length,total:e.length,ready:s}}let t=this.options.numberOfPlacesToSelect,i=e.filter(s=>this.selectionsByEvent.get(s.eventKey)?.length===t&&this.validByEvent.get(s.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(o=>o.label),s=this.copy("picker.group.chosenOfTotal",{chosen:i.length,total:t});return i.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:s}:i.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:i.join(", ")}),badge:s}:i.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:s}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-i.length}),badge:s}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(s=>{let o=s.dataset.eventKey,r=this.tabState(o),a=o===this.activePerformanceKey;s.dataset.state=r.key,s.disabled=t,s.setAttribute("aria-selected",String(a)),s.tabIndex=a?0:-1;let l=s.querySelector(".sl-pg-tab-state");l&&(l.textContent=r.label);let c=s.querySelector(".sl-pg-tab-badge");c&&(c.textContent=r.badge);let d=s.querySelector(".sl-pg-tab-name")?.textContent??o;s.setAttribute("aria-label",`${d}: ${r.badge} \xB7 ${r.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",s.id)});let i=e.findIndex(s=>s.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 s=this.descriptorValue?.performances.find(o=>o.eventKey===e);s&&this.announce(this.copy("picker.group.performanceOpened",{performance:s.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"){if(this.activeHandoff){this.holdLost();return}this.recovery.kind==="idle"&&this.clearStatus()}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,s=this.api.operationIdForHold(e.holdId);if(!i||!s)throw new Error("seatlayer: Performance Group hold identity is unavailable");let o=this.api.allocationsForHold(e.holdId);return{operationId:s,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:i,selectionMode:this.mode,performanceKeys:o.map(r=>r.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(r=>r.label),...this.mode==="per_performance"?{allocations:o.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),s=document.createElement("p"),o=document.createElement("strong");o.textContent=i?.name??t.eventKey,s.append(o,document.createTextNode(t.items.map(r=>r.label).join(", "))),this.heldSummary.appendChild(s)}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),s=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(),s&&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 fp,fromMinorUnits as Bo,t as me,tCount as Lg}from"@seatlayer/core";var qd="seatlayer-season-picker-style";function Wd(){if(document.getElementById(qd))return;let n=document.createElement("style");n.id=qd,n.textContent=`
3408
+ `,document.head.appendChild(n)}var sg="https://api.seatlayer.io",og=6e4,rg=2e3,ag=1e3,lg=36e5,cg=5e3,dg=5e3,pg=15e3,hg=12e4,ug=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),ie=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function mg(n){return new Promise(e=>setTimeout(e,n))}function Lo(n){let e=Number(n.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(cg,e*1e3)):1e3}function an(n,e){return`/pub/performance-groups/${encodeURIComponent(n)}/operations/${encodeURIComponent(e)}`}function $n(n){return n.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var Mo=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)),s=[...new Set([...this.prior.keys(),...t.keys()])].filter(o=>this.prior.get(o)!==t.get(o)).map(o=>({label:o,status:t.get(o)??"blocked"}));this.prior=t,s.length&&this.sink.applyStatuses(s),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof ie){this.stop();return}if(Ri(e)){this.stop(),this.api.sessionEnded(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},ks=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??sg).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??og,this.realtimePollMs=Math.max(500,t.realtimePollMs??rg),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(s=>this.adoptSession(s));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(s=>{throw this.chartRequest=null,s});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 s=this.objectsCache;if(this.selectionMode==="same_seat"){let r=s.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:s.revision,state:s.state,salesClosed:r.some(h=>h.salesClosed)};return this.noteAvailability(s,d.salesClosed,d),d}let o=s.performances.find(r=>r.eventKey===this.activePerformanceKey);if(!o)throw new j(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(s,s.salesClosed||s.performances.some(r=>r.salesClosed),o),o}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,s){if(this.assertUsable(),s)throw new j(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let o=t.map(c=>c.label),r={labels:o};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,o,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,o,Date.now()+this.recoveryTimeoutMs,Lo(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,o,Date.now()+this.recoveryTimeoutMs,Lo(l))}}try{return await this.throwResponse(l,o)}catch(c){throw this.failOperation(a),c}}async release(e,t,i){this.assertUsable();let s=this.operationForHold(i),o=await this.json(`${an(this.groupKey,s)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(i),this.allocationsByHold.delete(i),this.clearOperationRecord(),o}async resume(e,t){this.assertUsable();let i=this.operationForHold(t),s=await this.json(an(this.groupKey,i));return this.complete(s.operation)}async extend(e,t,i=12e4){this.assertUsable();let s=this.operationForHold(t),o=Math.max(ag,Math.min(lg,Math.round(i))),r=await this.json(`${an(this.groupKey,s)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:o})}),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 Mo(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:$n(e.operationId)});let t;try{t=await this.authorized(an(this.groupKey,e.operationId))}catch(o){return o 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 s=i.operation.state;return s==="committed"||s==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(i.operation)):s==="aborted"||s==="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>=hg?pg:dg;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 s=await this.authorized(an(this.groupKey,e));if(!s.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(s)).operation}catch(s){return s 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"||ug.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 s=0;s<2;s++){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?$n(i):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,i,s=100){let o=s,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:$n(e)}),await mg(o),this.destroyed)throw new ie;let l;try{l=await this.authorized(an(this.groupKey,e))}catch(h){if(h instanceof ie)throw h;if(h instanceof ee)throw this.recoveryFailed(e,"request_failed"),h;o=Math.min(2e3,Math.max(100,o*2));continue}if(l.status===404){o=Math.min(1e3,Math.max(100,o*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"})));o=Lo(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:$n(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 s=e.state??this.descriptorCache?.state??"active",o=e.revision??null,r=!!o&&!!this.knownRevision&&o!==this.knownRevision;o&&!this.knownRevision&&(this.knownRevision=o);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:s,salesClosed:!!t||s!=="active",revision:o,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(s=>s.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 s={...t.headers};t.body!==void 0&&(s["Content-Type"]="application/json");let o=await this.access.authorization(i?"unauthorized":"initial");if(this.destroyed)throw new ie;if(this.adoptFailure)throw this.adoptFailure;if(!o)throw new Error("performance_group_buyer_access_required");s.Authorization=o;let r=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:s,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,o))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 s=await e.json().catch(()=>null)??{},o=s.code??s.error??`request_failed_${e.status}`;throw e.status===409&&!s.conflicts?.length&&t.length&&(s.conflicts=t.map(r=>({label:r,status:"held"}))),new j(e.status,s.error??o,o,s.conflicts)}};import{formatMoney as fg,t as Ho}from"@seatlayer/core";var ln,Tt,tt,cn,zn,nt,Wd,Ss,Ts=class{constructor(e){this.options=e;C(this,nt);C(this,ln,null);C(this,Tt,!1);C(this,tt,null);C(this,cn,!1);C(this,zn,!1)}get mode(){return p(this,Tt)?"hosted":"handoff"}async prepare(){try{x(this,ln,await this.options.api.paymentOptions()),x(this,Tt,!!p(this,ln))}catch(e){x(this,Tt,!1),this.options.onError?.(e)}}async open(e,t){if(!p(this,Tt)||p(this,cn))return;if(t.selectionMode!=="same_seat"){this.options.announce(Ho("picker.group.hostedPerPerformance"));return}let i=p(this,ln),s=t.seatLabels.length;if(i.bookingMode==="paid"&&!i.providers.length){await w(this,nt,Ss).call(this,e,t.descriptor,{kind:"unavailable",reason:i.reason==="unavailable_for_run"?"unavailable_for_event":"not_configured",seatCount:s});return}x(this,cn,!0);try{let{total:o,currency:r,lines:a}=w(this,nt,Wd).call(this,t.holdId,t.descriptor);await w(this,nt,Ss).call(this,e,t.descriptor,{kind:"pay",provider:null,free:i.bookingMode==="free",order:{holdId:t.operationId,expiresAt:t.expiresAt,currency:r,total:o,labels:[...t.seatLabels],lines:a}})}finally{x(this,cn,!1)}}resume(e,t,i){let s=on(t);s?.outcome!=="success"||!s.orderId||w(this,nt,Ss).call(this,e,i,{kind:"resume",orderId:s.orderId})}destroy(){x(this,zn,!0),p(this,tt)?.destroy(),x(this,tt,null)}};ln=new WeakMap,Tt=new WeakMap,tt=new WeakMap,cn=new WeakMap,zn=new WeakMap,nt=new WeakSet,Wd=function(e,t){let i=this.options.api.allocationsForHold(e),s=i.flatMap(a=>a.items)[0]?.currency??t.currency,o=0,r=i.map(a=>{let l=a.items.reduce((d,h)=>d+Math.round(h.unitPrice*100)*(h.quantity??1),0);o+=l;let c=t.performances.find(d=>d.eventKey===a.eventKey);return{label:a.items.map(d=>d.label).join(", "),detail:c?sn(c,this.options.locale):null,amount:l/100}});return{total:o/100,currency:s,lines:r}},Ss=async function(e,t,i){let s;try{({mountCheckout:s}=await zt())}catch(r){this.options.onError?.(r),this.options.announce(Ho("picker.group.checkoutCouldNotOpen"));return}if(p(this,zn)||!e)return;p(this,tt)?.destroy();let o=this.options.api;x(this,tt,s({root:e,state:i,eventKey:o.groupKey,event:{name:t.name,detail:Ho("picker.group.checkoutDates").replace("{count}",String(t.performanceCount))},formatMoney:(r,a)=>fg(r,a,{locale:this.options.locale,fallback:(l,c)=>`${l} ${c}`,...Number.isInteger(r)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:async r=>{let a=await o.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=>o.orderStatus(r),onCancel:()=>{x(this,tt,null)},onConfirmed:r=>this.options.onConfirmed?.(r),onError:r=>this.options.onError?.(r)}))};var gg={audience_not_public:"audience_not_public",sales_not_open:"sales_not_open",invalid_origin:"origin_not_allowed"},bg=3e4;function yg(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 Ro=class extends Error{constructor(t,i){super(`performance_group_public_session_refused:${t}`);this.reason=t;this.status=i;this.name="PerformanceGroupPublicSessionRefused"}},ze,it,jn,dn,Io=class{constructor(e){this.options=e;C(this,ze,null);C(this,it,null);C(this,jn);C(this,dn);x(this,jn,e.fetch??globalThis.fetch.bind(globalThis)),x(this,dn,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return p(this,ze)}async mint(e=!1){if(e&&x(this,ze,null),p(this,ze)&&p(this,ze).expiresAt-bg>Date.now())return p(this,ze);if(p(this,it))return p(this,it);let t=(async()=>{let i=await p(this,jn).call(this,`${this.options.base}/pub/performance-groups/${encodeURIComponent(this.options.performanceGroup)}/sessions`,{method:"POST",body:JSON.stringify(p(this,dn)?{origin:p(this,dn)}:{}),credentials:"omit"}),s=await i.json().catch(()=>null);if(!i.ok){let o=s?.code??s?.error,r=i.status===403&&o?gg[o]:void 0;throw r?(this.options.onRefused?.({reason:r,code:o,status:i.status,retryable:r==="sales_not_open"}),new Ro(r,i.status)):new Error(`performance_group_public_session_failed_${i.status}`)}if(!yg(s,this.options.performanceGroup))throw new Error("performance_group_public_session_invalid");return x(this,ze,s),s})();x(this,it,t);try{return await t}finally{p(this,it)===t&&x(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,jn=new WeakMap,dn=new WeakMap;function Yd(n){let e=new Io(n);return{access:new pe({provider:({reason:i})=>e.token(i),...n.accessHooks}),loader:e}}var Zd="https://api.seatlayer.io";function Xd(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 Oo=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}):Yd({base:(e.apiBase??Zd).replace(/\/$/,""),performanceGroup:e.performanceGroup,onRefused:i=>{this.refusal=i},accessHooks:{onExpired:e.onAccessExpired,onUnavailable:t}}).access,this.api=new ks(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 Ts({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,qd(),await wg(this.options.locale),this.options.messages&&xg(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(i){throw Ee({apiBase:this.options.apiBase??Zd,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:Oe(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(Xd(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 s=document.createElement("div");s.className="sl-pg-progress";let o=document.createElement("section");o.className="sl-pg-head",o.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=fo(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,o.append(r,a,l,c,m);let u=document.createElement("div");u.className="sl-pg-legend";let b=document.createElement("div");b.className="sl-pg-pane",b.setAttribute("role","group"),b.setAttribute("aria-label",this.copy("picker.group.yourSelection")),b.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 k=document.createElement("p"),E=document.createElement("button");E.type="button",E.hidden=!0,E.textContent=this.copy("picker.group.retry"),E.addEventListener("click",()=>{this.retryRecovery()}),S.append(k,E),T.appendChild(S);let L=document.createElement("div");L.className="sl-pg-live",L.setAttribute("role","status"),L.setAttribute("aria-live","polite"),i.append(s,o),g&&i.append(g),i.append(u,T,b,L),e.appendChild(i),this.root=i,this.progressHost=s,this.legendHost=u,this.paneHost=b,this.datesSummaryHost=d,this.datesCardsHost=h,this.innerHost=T,this.heldSummary=m,this.live=L,this.statusHost=S,this.statusCopy=k,this.statusAction=E,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new et(ms({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,enable3DCrowd:this.options.enable3DCrowd,touchNavigation3D:this.options.touchNavigation3D,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(i,s)=>{try{this.options.onAnalytics?.(i,{...s,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,s)=>this.holdChanged(i,s),onCheckout:(i,s)=>this.checkout(i,s),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"?Bl(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,s)=>{this.selectPartialSeat(i,s)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:i=>this.partialSeatDates.get(i)??this.nights().map(s=>s.eventKey),label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),apply:(i,s)=>this.applySeatDates(i,s,!0)}:null,checkoutReady:i=>!this.booked&&this.activeHandoff?.holdId===i}));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:os(t,this.options.locale),time:rs(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:sn(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,i=!!t?.salesClosed||!!t&&t.state!=="active",s=this.mode==="same_seat"&&!i?t?.partial??{}:{},o={};for(let r of this.markedLabels)o[r]=null;if(this.markedLabels.clear(),e>0)for(let[r,a]of Object.entries(s))!a.length||a.length>=e||(o[r]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(r));return o}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(s=>s.eventKey===this.activePerformanceKey);if(!e)return null;let t=sn(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:sn(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 o=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:o*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:o?e.length:0,perPerformance:o}}let t=e.map(o=>this.selectionsByEvent.get(o.eventKey)?.length??0),i=t.filter(o=>o>0),s=i.length===t.length&&i.every(o=>o===i[0]);return{seats:t.reduce((o,r)=>o+r,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:i.length,perPerformance:s&&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=Wl(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=Vl({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(o=>o.label)??[],s=this.heldTotal();e.hidden=!1,e.innerHTML=Yl({title:this.copy("picker.group.yourSelection"),rows:t.map(o=>({eventKey:o.eventKey,name:`${os(o,this.options.locale)} ${rs(o,this.options.locale)}`,labels:i})),empty:this.copy("picker.group.noSeatsChosenYet"),note:s?null:this.copy("picker.group.pricesPerPerformance"),total:s?{label:this.copy("picker.group.total"),amount:s}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Zl(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let s=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!s.length)return null;let o=s.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),r=s[0]?.currency??t.currency;try{return vg(o,r,void 0,this.options.locale)}catch{return`${r} ${o.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=fo(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 s=this.api.includedPerformanceKeys();if(s.length===t.length&&s.every(o=>t.includes(o)))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(o){return s.length&&(this.api.setIncludedEventKeys(s),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(o),!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(Xd(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,(s,o)=>String(t[o]??`{${o}}`)):i:kg(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 s=document.createElement("button");s.type="button",s.className="sl-pg-step",s.dataset.step="next",s.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),s.textContent="\u203A",s.addEventListener("click",()=>{this.stepPerformance(1)});let o=document.createElement("div");return o.className="sl-pg-tabs",o.setAttribute("role","tablist"),o.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)),o.appendChild(l)}),t.append(i,o,s),this.tabsHost=o,this.prevButton=i,this.nextButton=s,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 s=getComputedStyle(this.tabsHost??document.body).direction==="rtl",o=-1;switch(e.key){case"ArrowRight":o=i+(s?-1:1);break;case"ArrowLeft":o=i+(s?1:-1);break;case"ArrowDown":o=i+1;break;case"ArrowUp":o=i-1;break;case"Home":o=0;break;case"End":o=t.length-1;break;default:return}if(o<0||o>=t.length)return;e.preventDefault();let r=t[o];r.focus({preventScroll:!0}),r.disabled||this.switchPerformance(r.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),i=t.findIndex(o=>o.dataset.eventKey===this.activePerformanceKey),s=t[i+e];!s||s.disabled||(s.focus({preventScroll:!0}),this.switchPerformance(s.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let s=!this.holdBlocked();return{complete:e.length,total:e.length,ready:s}}let t=this.options.numberOfPlacesToSelect,i=e.filter(s=>this.selectionsByEvent.get(s.eventKey)?.length===t&&this.validByEvent.get(s.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(o=>o.label),s=this.copy("picker.group.chosenOfTotal",{chosen:i.length,total:t});return i.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:s}:i.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:i.join(", ")}),badge:s}:i.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:s}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-i.length}),badge:s}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(s=>{let o=s.dataset.eventKey,r=this.tabState(o),a=o===this.activePerformanceKey;s.dataset.state=r.key,s.disabled=t,s.setAttribute("aria-selected",String(a)),s.tabIndex=a?0:-1;let l=s.querySelector(".sl-pg-tab-state");l&&(l.textContent=r.label);let c=s.querySelector(".sl-pg-tab-badge");c&&(c.textContent=r.badge);let d=s.querySelector(".sl-pg-tab-name")?.textContent??o;s.setAttribute("aria-label",`${d}: ${r.badge} \xB7 ${r.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",s.id)});let i=e.findIndex(s=>s.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 s=this.descriptorValue?.performances.find(o=>o.eventKey===e);s&&this.announce(this.copy("picker.group.performanceOpened",{performance:s.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"){if(this.activeHandoff){this.holdLost();return}this.recovery.kind==="idle"&&this.clearStatus()}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,s=this.api.operationIdForHold(e.holdId);if(!i||!s)throw new Error("seatlayer: Performance Group hold identity is unavailable");let o=this.api.allocationsForHold(e.holdId);return{operationId:s,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:i,selectionMode:this.mode,performanceKeys:o.map(r=>r.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(r=>r.label),...this.mode==="per_performance"?{allocations:o.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),s=document.createElement("p"),o=document.createElement("strong");o.textContent=i?.name??t.eventKey,s.append(o,document.createTextNode(t.items.map(r=>r.label).join(", "))),this.heldSummary.appendChild(s)}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),s=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(),s&&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 wp,fromMinorUnits as $o,t as me,tCount as jg}from"@seatlayer/core";var Qd="seatlayer-season-picker-style";function Jd(){if(document.getElementById(Qd))return;let n=document.createElement("style");n.id=Qd,n.textContent=`
3409
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
3410
  .sl-season-root *{box-sizing:border-box}
3411
3411
  .sl-season-map{position:relative;flex:1 1 auto;min-width:0;min-height:0}
@@ -3501,4 +3501,4 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
3501
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
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
3503
  .sl-season-leave button:focus-visible{outline:2px solid var(--sl-accent,#7357d8);outline-offset:2px}
3504
- `,document.head.appendChild(n)}import{t as qn}from"@seatlayer/core";var B=class extends Error{constructor(t,i,s){super(`season_request_failed:${t}`);this.code=t;this.status=i;this.name="SeasonApiError",s?.retryAfterS!==void 0&&(this.retryAfterS=s.retryAfterS),s?.retryable!==void 0&&(this.retryable=s.retryable),s?.reason!==void 0&&(this.reason=s.reason),s?.refusals?.length&&(this.refusals=s.refusals),s?.buyerMessage&&(this.buyerMessage=s.buyerMessage)}},jn=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}},Gn=class extends Error{constructor(t,i){super(`season_public_session_refused:${t}`);this.reason=t;this.status=i;this.name="SeasonPublicSessionRefused"}};var cg="https://api.seatlayer.io",dg=6e4,pg=5e3,hg=new Set(["seat_unavailable","seat_held_for_renewal"]);function Qd(n){return typeof n=="string"&&hg.has(n)?n:void 0}function Io(n){return Array.isArray(n)?n.flatMap(e=>{let t=e??{},i=typeof t.eventKey=="string"?t.eventKey:t.eventId,s=Qd(t.code);return typeof i=="string"&&s?[{eventKey:i,code:s}]:[]}):[]}function ug(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(pg,i*1e3))}function mg(n,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,i)=>{let s=setTimeout(t,n);e?.addEventListener("abort",()=>{clearTimeout(s),i(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function Yd(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 fg(n,e){let t=e&&typeof e=="object"?e:{},i=Io(t.handoff?.allocations??t.operation?.allocations),s=(n.headers.get("Retry-After")??"").trim(),o=s?Number(s):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}:{},...i.length?{refusals:i}:{}}}var gg=/^shc_[a-f0-9]{40}$/,bg=/^shh_[a-f0-9]{40}$/,yg=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),vg=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function Ro(n){return Array.isArray(n)?n.some(Ro):!n||typeof n!="object"?!1:Object.entries(n).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&gg.test(t)||Ro(t))}function Kn(n,e,t="invalid_operation_response"){if(!n||typeof n!="object"||Array.isArray(n))throw new B(t,502);if(Ro(n))throw new B("unsafe_operation_response",502);let i=n,s=i.allocations,o=new Set,r=Array.isArray(s)&&s.length>0&&s.every(h=>{if(!h||typeof h!="object")return!1;let m=h.eventId,u=h.state;return typeof m!="string"||!m||typeof u!="string"||!vg.has(u)||o.has(m)?!1:(o.add(m),!0)}),a=i.bookingRef===null||typeof i.bookingRef=="string"&&i.bookingRef.length>0,l=i.state!=="booked"||typeof i.bookingRef=="string"&&r&&s.every(h=>h.state==="booked"),c=i.state!=="booking_pending"||typeof i.bookingRef=="string"&&r&&s.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"||!bg.test(i.holdId)||i.policy!=="fixed_inclusion_same_seat"||typeof i.state!="string"||!yg.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 B(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:s.map(h=>{let m=Qd(h.code);return{eventId:h.eventId,state:h.state,...m?{code:m}:{}}})}}function wg(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 B("invalid_best_available_response",502);let i=n,s=new Set(i),o=new Map;for(let r of e){if(!r||typeof r!="object")throw new B("invalid_best_available_response",502);let a=r;if(typeof a.label!="string"||!s.has(a.label)||o.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 B("invalid_best_available_response",502);o.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=>o.get(r))}}function Zd(n){return typeof n=="number"&&Number.isFinite(n)?n:null}async function Xd(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?Jd(await i.json()):null}catch{return null}}function Jd(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 s=i;if(typeof s.planKey!="string"||!s.planKey||typeof s.planActivationId!="string"||!s.planActivationId||!Array.isArray(s.prices))continue;let o=[],r=new Set;for(let a of s.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),o.push({categoryKey:l.categoryKey,...c?{priceTypeKey:c,priceTypeLabel:typeof l.priceTypeLabel=="string"?l.priceTypeLabel:c}:{},unitPrice:l.unitPrice}))}o.length&&t.push({planKey:s.planKey,planActivationId:s.planActivationId,name:typeof s.name=="string"&&s.name?s.name:s.planKey,prices:o,...Number.isInteger(s.datesToCome)&&s.datesToCome>=0?{datesToCome:s.datesToCome,firstDateAt:Zd(s.firstDateAt),lastDateAt:Zd(s.lastDateAt)}:{}})}return t.length?{currency:e.currency,packages:t}:null}function xg(n){if(!n||typeof n!="object"||Array.isArray(n))throw new B("invalid_checkout_response",502);let e=n,t=typeof e.redirectUrl=="string"&&!!e.redirectUrl,i=er(e.redirectUrl);if(t&&!i)throw new B("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 B("invalid_checkout_response",502);return{orderId:e.orderId,totalMinor:e.totalMinor,currency:e.currency,expiresAt:e.expiresAt,redirectUrl:i}}function ep(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:s,code:o})=>({eventKey:i,state:s,...o?{code:o}:{}})),...t?{seats:t}:{}}}var xe,Et,Pe,Ct,Un,Le,Me,le,ve,tp,ks=class{constructor(e,t){C(this,le);C(this,xe);C(this,Et);C(this,Pe);C(this,Ct);C(this,Un);C(this,Le,!1);C(this,Me,null);x(this,xe,e),x(this,Et,(t.apiBase??cg).replace(/\/$/,"")),x(this,Pe,t.access),x(this,Ct,t.fetch??globalThis.fetch.bind(globalThis)),x(this,Un,t.recoveryTimeoutMs??dg),p(this,Pe).onRenewed(i=>w(this,le,tp).call(this,i))}async descriptor(){let{body:e}=await w(this,le,ve).call(this,"GET","");return e.season}async chart(){let{body:e}=await w(this,le,ve).call(this,"GET","/chart");return e}async availability(){let{body:e}=await w(this,le,ve).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 s=e.map(a=>{let l=i?.get(a);return l&&l!=="adult"?{label:a,priceTypeKey:l}:{label:a}}),{body:o,response:r}=await w(this,le,ve).call(this,"POST","/holds",{operationId:t,labels:[...e],...s.some(a=>"priceTypeKey"in a)?{selections:s}:{}});return{operation:Kn(o.operation,{seasonId:p(this,xe),operationId:t}),response:r}}async bestAvailable(e){let{body:t,response:i}=await w(this,le,ve).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}:{}}),s=Kn(t.operation,{seasonId:p(this,xe),operationId:e.operationId},"invalid_best_available_response"),{labels:o,items:r}=wg(t.labels,t.items,e.qty);return{operation:s,labels:o,items:r,response:i}}async operation(e){let{body:t,response:i}=await w(this,le,ve).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:Kn(t.operation,{seasonId:p(this,xe),operationId:e}),response:i}}async release(e,t){let{body:i,response:s}=await w(this,le,ve).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:Kn(i.operation,{seasonId:p(this,xe),operationId:e}),response:s}}async prices(){let e;try{({body:e}=await w(this,le,ve).call(this,"GET","/prices"))}catch(t){if(t instanceof B&&t.status===404)return null;throw t}return Jd(e)}async checkout(e){let{body:t}=await w(this,le,ve).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 xg(t)}async orderStatus(e){let t=await p(this,Ct).call(this,`${p(this,Et)}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit"}),i=await t.json().catch(()=>null);if(!t.ok)throw new B(Yd(i),t.status);if(i===null)throw new B("invalid_json_response",502);return i}async renewalIntent(e){let{body:t}=await w(this,le,ve).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 B("invalid_renewal_intent_response",502);return i}async waitForTerminal(e,t,i){let s=Date.now(),o=t?{operation:Kn(t.operation,{seasonId:p(this,xe),operationId:e}),response:t.response}:await this.operation(e);for(;o.operation.state==="preparing"||o.operation.state==="commit_pending"||o.operation.state==="expire_pending"||o.operation.state==="booking_pending"||o.operation.state==="abort_pending";){if(Date.now()-s>=p(this,Un))throw new jn(e);await mg(ug(o.response,o.operation),i),o=await this.operation(e)}return o.operation}destroy(){p(this,Le)||(x(this,Le,!0),p(this,Pe).onRenewed(void 0),p(this,Pe).clear())}};xe=new WeakMap,Et=new WeakMap,Pe=new WeakMap,Ct=new WeakMap,Un=new WeakMap,Le=new WeakMap,Me=new WeakMap,le=new WeakSet,ve=async function(e,t,i,s=!0){if(p(this,Le))throw new B("season_api_destroyed",409);if(p(this,Me))throw p(this,Me);let o=await p(this,Pe).authorization();if(p(this,Le))throw new B("season_api_destroyed",409);if(p(this,Me))throw p(this,Me);if(!o)throw new ee({reason:"no_token",retryable:!1});let r=await p(this,Ct).call(this,`${p(this,Et)}/pub/seasons/${encodeURIComponent(p(this,xe))}${t}`,{method:e,headers:{Authorization:o,...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=Yd(a);if(s&&await p(this,Pe).handleFailure(r.status,l,o))return w(this,le,ve).call(this,e,t,i,!1);let c=p(this,Pe).unavailable;throw c?new ee(c):new B(l,r.status,fg(r,a))}if(a===null)throw new B("invalid_json_response",502);return{body:a,response:r}},tp=async function(e){if(p(this,Le))return;let t=`/pub/seasons/${encodeURIComponent(p(this,xe))}/session/adopt`;for(let i=0;i<2;i++){if(p(this,Le))return;try{if((await p(this,Ct).call(this,`${p(this,Et)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){x(this,Me,null);return}}catch{}}if(!p(this,Le))throw x(this,Me,new B("season_session_adopt_failed",409)),p(this,Me)};function Ss(n){if(!(n instanceof B))return qn("season.selectionFailed");let e=new Set((n.refusals??[]).map(t=>t.code));return n.code==="season_sales_not_open"?qn("season.accessSalesNotOpen"):e.has("seat_held_for_renewal")?qn("season.seatHeldForRenewal"):e.has("seat_unavailable")||n.code==="seats_unavailable"?qn("season.seatUnavailable"):n.code==="unknown"?qn("season.selectionFailed"):`Season selection unavailable (${n.code}).`}function Es(n){let e=n.edition?.trim();return e&&!n.name.includes(e)?`${n.name} ${e}`:n.name}function np(n){return n.state==="committed"||n.state==="booked"}function ip(n){return new B(`season_operation_${n.state}`,409,{refusals:Io(n.allocations)})}var Oo=class{constructor(e,t,i,s){this.transport=e;this.sink=t;this.intervalMs=i;this.onSessionEnded=s;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=o=>(t[o]??[]).join("|"),s=Object.entries(e.seats).filter(([o,r])=>this.prior[o]!==r||this.priorPartial[o]!==i(o)).map(([o,r])=>({label:o,status:r}));this.prior={...e.seats},this.priorPartial=Object.fromEntries(Object.keys(e.seats).map(o=>[o,i(o)])),s.length&&this.sink.applyStatuses(s)}catch(e){if(Li(e)){this.stop(),this.onSessionEnded?.(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Ts=class{constructor(e,t,i,s=!1){this.api=e;this.realtimePollMs=t;this.onSessionEnded=i;this.typed=s;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 B("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 B("season_hold_not_found",404);let s=await this.api.waitForTerminal(i.operationId);if(s.state!=="committed"||s.holdId!==t)throw new B("season_hold_not_found",404);if(i.typedSeats)for(let o of i.seats)this.types.set(o.label,o.priceTypeKey);return this.remember(s),this.recordSeats(t,i.seats.map(o=>o.label)),{holdId:t,expiresAt:s.expiresAt,items:i.seats.map(o=>({label:o.label,objectId:o.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:Es(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,s){if(s)throw new B("season_hold_replace_unsupported",409);let o=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let r=t.map(c=>c.label),a=await this.api.hold(r,o,this.types).catch(c=>{throw c instanceof B&&c.code==="price_type_not_offered"?this.typeRefusal=new B(c.code,c.status,{reason:"ticket_option_not_applicable"}):sp(c)}),l=await this.api.waitForTerminal(o,a);if(!np(l))throw ip(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 s=this.operationForHold(i);if(!s)throw new B("season_hold_not_found",404);let o=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let r=await this.api.release(s.operationId,o),a=await this.api.waitForTerminal(s.operationId,r);if(a.state==="partial_terminal")throw this.remember(a),new B("season_operation_partial_terminal",409);this.forget(i)}async bestAvailable(e,t,i,s){let o=this.nextBestAvailable;this.nextBestAvailable=null;let r=o?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:r,qty:t,...i?{categoryKey:i}:{},...s?{zoneId:s}:{},...o?.accessibility?.length?{accessibility:o.accessibility}:{},...o?.requireContiguous===!0?{requireContiguous:!0}:{}}).catch(d=>{throw sp(d)}),l=await this.api.waitForTerminal(r,a);if(!np(l))throw ip(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 Oo(this,t,this.realtimePollMs,this.onSessionEnded)}};function sp(n){return!(n instanceof B)||n.code!=="season_sales_not_open"?n:new B(n.code,n.status,{reason:"event_closed",buyerMessage:Ss(n)})}import{t as $}from"@seatlayer/core";var kg=["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 Wn(n){return n===1?$("season.oneDate"):$("season.dateCount").replace("{count}",String(n))}function _o(n){return n===1?$("season.priceForOneDate"):$("season.priceForAllDates").replace("{count}",String(n))}function je(n){return n.occurrences.length?n.occurrences.filter(e=>e.past!==!0&&e.cancelled!==!0).length:n.occurrenceCount}function dn(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 op(n,e,t,i,s){let o={day:"numeric",month:"short",...s?{year:"numeric"}:{}},r=dn(n,t,i,o),a=dn(e,t,i,o);return r===a?r:$("season.dateRange").replace("{from}",r).replace("{to}",a)}function Do(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 rp(n){return n.occurrences.filter(e=>e.past!==!0&&e.cancelled!==!0)}function Sg(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 s=t?rp(n.descriptor):null,o=s?s.length:e.datesToCome;if(o!==void 0){let l=s?s.find(h=>h.startsAt!=null)?.startsAt??null:e.firstDateAt??null,c=s?[...s].reverse().find(h=>h.startsAt!=null)?.startsAt??null:e.lastDateAt??null,d=l!=null&&c!=null?op(l,c,n.descriptor.timezone,n.locale,!1):"";i.append(H("span","sl-step-card-dates",[Wn(o),d].filter(Boolean).join(" \xB7 ")))}let r=Do(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 Tg(n,e,t){let i=H("div","sl-step-prices"),s=H("div","sl-step-prices-head");s.append(H("b",void 0,$("season.packagePrices").replace("{name}",e.name)),H("span",void 0,`${$("season.perSeat")}, ${_o(t)}`));let o=kg.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")),...o.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 o){let u=e.prices.find(y=>y.categoryKey===d&&(y.priceTypeKey??"adult")===m);h.append(H("td",void 0,u?n.money(u.unitPrice):"\u2014"))}l.append(h)}return i.append(s,l),i}function Eg(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,s=H("span","sl-step-day");e.startsAt!=null&&s.append(H("small",void 0,dn(e.startsAt,i,n.locale,{month:"short"}).toUpperCase()),H("b",void 0,dn(e.startsAt,i,n.locale,{day:"numeric"})));let o=H("span","sl-step-date-text");if(o.append(H("b",void 0,e.name)),e.startsAt!=null){let r=dn(e.startsAt,i,n.locale,{weekday:"short",day:"numeric",month:"short"}),a=dn(e.startsAt,i,n.locale,{hour:"2-digit",minute:"2-digit"});o.append(H("span",void 0,`${r} \xB7 ${a}`))}return t.append(s,o),(e.cancelled||e.past)&&t.append(H("span","sl-step-date-tag",e.cancelled?$("season.cancelled"):$("season.past"))),t}function ap(n){let{descriptor:e}=n,t=H("div","sl-season-step"),i=H("div","sl-step-body"),s=rp(e),o=s.length,r=H("div","sl-step-intro");r.append(lp("package")),n.titled||r.append(H("h2","sl-step-title",n.title));let a=s.find(f=>f.startsAt!=null)?.startsAt??null,l=[...s].reverse().find(f=>f.startsAt!=null)?.startsAt??null,c=[Wn(o),e.venue,a!=null&&l!=null?op(a,l,e.timezone,n.locale,!0):""].filter(Boolean).join(" \xB7 "),d=H("p","sl-step-facts");d.append(H("span",void 0,c)),n.onSale===!0&&d.append(H("span","sl-step-onsale",$("season.onSale"))),r.append(d),n.onSale===!1&&r.append(H("p","sl-step-facts sl-step-closed",$("season.accessSalesNotOpen")));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"),y=H("div","sl-step-col"),g=H("div","sl-step-col");u.append(y,g),i.append(u),y.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 R=H("div","sl-step-cards");n.loading&&R.setAttribute("aria-busy","true"),R.append(...T.map(M=>Sg(n,M,M.planActivationId===n.chosen))),f.append(R),y.append(f)}if(S){let f=Tg(n,S,o);n.expanded||(f.dataset.more="true"),g.append(f)}let k=H("ul","sl-step-dates");if((n.expanded?e.occurrences:s.slice(0,3)).forEach((f,R)=>{let M=Eg(n,f);!n.expanded&&R>0&&(M.dataset.more="true"),k.append(M)}),g.append(k),!n.expanded&&e.occurrences.length>1){let f=H("button","sl-step-all");f.type="button";let R=Wn(e.occurrences.length);f.append(H("span","sl-step-wide",$("season.showAllDates").replace("{dates}",R)),H("span","sl-step-narrow",$("season.showAllDatesPrices").replace("{dates}",R))),f.addEventListener("click",()=>n.expand()),g.append(f)}let L=H("div","sl-step-go"),U=S?Do(S.prices):null;S&&U!=null&&L.append(H("span","sl-step-go-price",[$("season.fromPrice").replace("{price}",n.money(U)),S.name,$("season.perSeat")].join(" \xB7 ")));let O=H("button","sl-step-seats",$("season.chooseSeats"));return O.type="button",O.disabled=n.loading,O.addEventListener("click",()=>n.seats()),L.append(O),t.append(i,L),t}function lp(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((s,o)=>{let r=o<e.indexOf(n)?"done":s===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(o+1)),document.createTextNode(t[s])),i.append(a)}),i}function cp(n){let e=H("span","sl-strip-pkg");n.pkg?e.append(H("b",void 0,n.pkg.name),document.createTextNode(` \xB7 ${Wn(n.dates)}`)):e.append(document.createTextNode(Wn(n.dates)));let t=n.pkg?Do(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()),[lp(n.step),e,i]}import{t as ke}from"@seatlayer/core";function dp(n,e){for(let[t,i]of Object.entries(e))n.style.setProperty(t,i)}function pp(n,e,t,i={}){let s=document.createElement("div");dp(s,i),s.className="sl-season-leave",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true");let o=document.createElement("div");o.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"),s.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),o.append(r,a,l),s.append(o);let h=null,m=()=>{h&&clearInterval(h),h=null,s.remove()},u=()=>{let y=Math.max(0,e-Date.now());if(y<=0){m(),t.lapsed();return}let g=Math.ceil(y/1e3),T=`${Math.floor(g/60)}:${String(g%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(s),d.focus({preventScroll:!0}),{remove:m}}function hp(n){let e=s=>{try{return new Intl.ListFormat(void 0,{type:"conjunction"}).format(s)}catch{return s.join(", ")}},t=[],i=new Map;for(let s of n){if(!s.row||!s.seat){t.push({head:[s.label],seats:[]});continue}let o=`${s.section??""}\0${s.row}`,r=i.get(o);r||(r={head:[s.section??"",`${ke("picker.row")} ${s.row}`].filter(Boolean),seats:[]},i.set(o,r),t.push(r)),r.seats.push(s.seat)}return t.map(({head:s,seats:o})=>[...s,...o.length===1?[`${ke("picker.seat")} ${o[0]}`]:[],...o.length>1?[`${ke("season.seats")} ${e(o)}`]:[]].join(", ")).join("; ")}function up(n,e,t,i={}){let s=document.createElement("div");dp(s,i),s.className="sl-season-leave",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true");let o=document.createElement("div");o.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"),s.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),o.append(r,a,l),s.append(o);let h=()=>{s.remove()};return c.addEventListener("click",()=>{h(),t.change()}),d.addEventListener("click",()=>{h(),t.keep()}),n.append(s),d.focus({preventScroll:!0}),{remove:h}}var Cg=new Set(["audience_not_public","sales_not_open","origin_not_allowed"]),Ag=3e4;function Pg(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 Ge,st,Yn,pn,No=class{constructor(e){this.options=e;C(this,Ge,null);C(this,st,null);C(this,Yn);C(this,pn);x(this,Yn,e.fetch??globalThis.fetch.bind(globalThis)),x(this,pn,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return p(this,Ge)}async mint(e=!1){if(e&&x(this,Ge,null),p(this,Ge)&&p(this,Ge).expiresAt-Ag>Date.now())return p(this,Ge);if(p(this,st))return p(this,st);let t=(async()=>{let i=await p(this,Yn).call(this,`${this.options.base}/pub/seasons/${encodeURIComponent(this.options.season)}/sessions`,{method:"POST",body:JSON.stringify({...p(this,pn)?{origin:p(this,pn)}:{},...this.options.planActivationId?{planActivationId:this.options.planActivationId}:{}}),credentials:"omit"}),s=await i.json().catch(()=>null);if(!i.ok){let o=s?.code??s?.error;if(i.status===403&&o&&Cg.has(o)){let r=o;throw this.options.onRefused?.({reason:r,code:o,status:i.status,retryable:r==="sales_not_open"}),new Gn(r,i.status)}throw new Error(`season_public_session_failed_${i.status}`)}if(!Pg(s,this.options.season))throw new Error("season_public_session_invalid");return x(this,Ge,s),s})();x(this,st,t);try{return await t}finally{p(this,st)===t&&x(this,st,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}}};Ge=new WeakMap,st=new WeakMap,Yn=new WeakMap,pn=new WeakMap;function mp(n){let e=new No(n);return{access:new pe({provider:({reason:i})=>e.token(i),...n.accessHooks}),loader:e}}var Mg=2500,Fo=new Map;function Hg(){return typeof location<"u"&&new URLSearchParams(location.search).has("seatlayer_checkout")}function Rg(n,e){let t=null;try{t=new URL(n)}catch{}if(!t||!/^https?:$/.test(t.protocol))return`"${n}" is not an absolute http(s) URL, so checkout ignores it and onOrderConfirmed does not run`;let i=typeof location>"u"?t.origin:location.origin;return t.origin!==i?`is on ${t.origin}, but this tab keeps the order for ${i}: onOrderConfirmed does not run there`:e==="test"?`brings the buyer back only if ${t.origin} is saved under Embed domains; otherwise onOrderConfirmed does not run`:null}function Ig(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 P,Lt,Mt,oe,G,ot,mn,rt,Ht,Rt,It,Xn,fn,gn,Jn,Z,Ot,K,W,Ke,at,lt,Se,_t,te,bn,ct,Dt,yn,dt,pt,ht,vn,ei,He,wn,Te,ti,b,$o,Cs,zo,At,jo,Go,bp,yp,Ko,xn,vp,Uo,qo,wp,xp,As,kp,Ps,Ls,hn,Sp,Wo,Ms,un,Tp,Ep,Cp,Ap,Yo,Hs,Pp,Zn,Lp,Rs,Zo,Q,we,Mp,Qn,Pt,Qo=class Qo{constructor(e){C(this,b);C(this,P);C(this,Lt);C(this,Mt);C(this,oe);C(this,G);C(this,ot);C(this,mn,null);C(this,rt,0);C(this,Ht,null);C(this,Rt,"package");C(this,It,null);C(this,Xn,!1);C(this,fn,new Map);C(this,gn,null);C(this,Jn,new AbortController);C(this,Z,null);C(this,Ot,null);C(this,K,null);C(this,W,null);C(this,Ke,null);C(this,at,null);C(this,lt,null);C(this,Se,[]);C(this,_t,new Map);C(this,te,!1);C(this,bn,!1);C(this,ct,null);C(this,Dt,null);C(this,yn,null);C(this,dt,null);C(this,pt,"handoff");C(this,ht,null);C(this,vn,!1);C(this,ei,!1);C(this,He,null);C(this,wn,null);C(this,Te,null);C(this,ti,null);C(this,xn,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");x(this,P,e),x(this,Lt,Ig(e.container)),x(this,ot,!e.buyerAccessToken&&!e.buyerAccessTokenProvider),w(this,b,Cs).call(this,null)}async render(){w(this,b,Qn).call(this),Be(),Wd(),w(this,b,yp).call(this),w(this,b,Q).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let e;if(p(this,P).package&&w(this,b,$o).call(this)&&!p(this,Te)){if(e=await Xd(p(this,P).apiBase??"https://api.seatlayer.io",p(this,P).season,p(this,P).fetch),p(this,te))return this;let t=e?.packages.find(i=>i.planKey===p(this,P).package);t&&(p(this,oe).destroy(),w(this,b,Cs).call(this,t.planActivationId))}return await w(this,b,zo).call(this,p(this,rt),e)?(w(this,b,Cp).call(this),p(this,Te)||p(this,P).initialOperationId||Hg()?await this.chooseSeats():w(this,b,At).call(this),p(this,te)?this:(w(this,b,Ap).call(this),w(this,b,jo).call(this),p(this,P).initialOperationId&&await this.restoreOperation(p(this,P).initialOperationId),this)):this}catch(e){if(p(this,te))return this;throw w(this,b,we).call(this,e)}}async choosePackage(e){if(w(this,b,Qn).call(this),(p(this,Ht)??p(this,Z)?.planActivationId)===e)return;if(!w(this,b,$o).call(this))throw new B("season_package_fixed",409);if(p(this,K))throw new B("season_hold_open",409);x(this,Ht,e);let t=++Jo(this,rt)._;p(this,W)?.destroy(),x(this,W,null),x(this,Se,[]),p(this,_t).clear(),p(this,oe).destroy(),w(this,b,Cs).call(this,e),w(this,b,At).call(this),w(this,b,Q).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{if(!await w(this,b,zo).call(this,t))return;w(this,b,At).call(this),w(this,b,jo).call(this)}catch(i){if(p(this,te)||t!==p(this,rt))return;throw w(this,b,we).call(this,i)}}async chooseSeats(){if(w(this,b,Qn).call(this),!(p(this,Rt)==="seats"&&p(this,W))){if(!p(this,Z))throw new Error("seatlayer: render SeasonPicker before using it");x(this,Rt,"seats"),p(this,It)?.remove(),x(this,It,null),await w(this,b,bp).call(this,p(this,Z))}}async holdSameSeat(e,t,i){if(w(this,b,Pt).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 s of e)p(this,G).types.set(s,i[s]||"adult");if(p(this,G).typeRefusal=null,p(this,G).queueOperation(t),p(this,W).selectObjectsWithoutConfirmation([...e]),w(this,b,Q).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await p(this,W).handleCta(!0,!1),!p(this,K))throw p(this,G).typeRefusal??new B("season_hold_not_created",409);return p(this,K)}async holdBestAvailable(e,t,i={}){if(w(this,b,Pt).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 s=p(this,W).maxTickets;if(e>s)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${s})`);if(p(this,bn))throw new B("season_best_available_in_progress",409);x(this,bn,!0);let o=null;try{if(o=p(this,G).queueBestAvailable(t,i),w(this,b,Q).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await p(this,W).bestAvailableOrThrow(e,i.categoryKey,{zoneId:i.zoneId})||!p(this,K))throw new B("season_hold_not_created",409);return p(this,K)}catch(r){throw w(this,b,we).call(this,r,t)}finally{o&&p(this,G).clearBestAvailable(o),x(this,bn,!1)}}async restoreOperation(e){w(this,b,Pt).call(this),w(this,b,Q).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await p(this,oe).waitForTerminal(e,void 0,p(this,Jn).signal);return t.state==="aborted"||t.state==="expired"?(x(this,K,null),p(this,P).onHoldChange?.(null),w(this,b,Q).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(p(this,G).remember(t),w(this,b,As).call(this,t,!1))}catch(t){throw w(this,b,we).call(this,t,e)}}async markBooked(){if(p(this,te))return!1;w(this,b,Pt).call(this);let e=p(this,K);if(!e)return!1;try{let{operation:t}=await p(this,oe).operation(e.operationId);return t.state!=="booked"?!1:(p(this,G).remember(t),w(this,b,As).call(this,t,!1),!0)}catch(t){throw w(this,b,we).call(this,t,e.operationId)}}async release(e){w(this,b,Pt).call(this);let t=p(this,K);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");p(this,G).queueRelease(e),w(this,b,Q).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{p(this,W)?.getCurrentHold()?.holdId===t.holdId?await p(this,W).release():(await p(this,G).release("",[],t.holdId),w(this,b,Ps).call(this)),w(this,b,Q).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(i){throw w(this,b,we).call(this,i,t.operationId)}}}async createRenewalIntent(e){if(w(this,b,Pt).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");w(this,b,Q).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await p(this,oe).renewalIntent(e);return w(this,b,Q).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),p(this,P).onRenewalIntent?.(t),t}catch(t){throw w(this,b,we).call(this,t)}}getDescriptor(){return p(this,Z)}getAvailability(){return p(this,Ot)}getHandoff(){return p(this,K)}getHeldOrder(){let e=p(this,K);if(!e)return null;let t=w(this,b,qo).call(this);return{operationId:e.operationId,expiresAt:e.expiresAt,currency:w(this,b,Ms).call(this),seats:t,totalMinor:w(this,b,Wo).call(this,t)}}destroy(){if(p(this,te))return;x(this,te,!0),p(this,Jn).abort(),w(this,b,Hs).call(this),p(this,W)?.destroy(),p(this,oe).destroy(),p(this,Lt).replaceChildren(),x(this,Ke,null),x(this,at,null),x(this,lt,null),x(this,Z,null),x(this,Ot,null),x(this,K,null),x(this,He,null);let e=p(this,wn);x(this,wn,null),e?.()}close(){p(this,He)?p(this,He).call(this):this.destroy()}static async open(e){Be();let t=Fo.get(e.season)??null;Fo.delete(e.season);let i=t&&t.expiresAt>Date.now()?t:null,s=!!e.buyerAccessToken||!!e.buyerAccessTokenProvider,o=Xi(me("season.popupLabel"),Re(void 0,e.theme)["--sl-bg"]),r;try{r=new Qo({...e,...i?.token&&!s?{buyerAccessToken:i.token}:{},container:o.frame})}catch(h){throw o.teardown(!1),h}x(r,Te,i),x(r,ot,!s),x(r,wn,()=>o.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,K);if(!h||h.expiresAt<=Date.now()){c();return}l=pp(o.frame,h.expiresAt,{keep:()=>{var u;w(u=r,b,Go).call(u,h),c()},release:()=>{r.release(`sra_${crypto.randomUUID()}`).catch(u=>e.onError?.(u)).finally(c)},lapsed:()=>{l=null,c()}},w(m=r,b,Rs).call(m))};x(r,He,d),x(r,ti,h=>{setTimeout(()=>{var m;a||l||(w(m=r,b,Go).call(m,h),c())},0)}),o.onScrimPress(d),o.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,te)||o.focusFirst(),r}};P=new WeakMap,Lt=new WeakMap,Mt=new WeakMap,oe=new WeakMap,G=new WeakMap,ot=new WeakMap,mn=new WeakMap,rt=new WeakMap,Ht=new WeakMap,Rt=new WeakMap,It=new WeakMap,Xn=new WeakMap,fn=new WeakMap,gn=new WeakMap,Jn=new WeakMap,Z=new WeakMap,Ot=new WeakMap,K=new WeakMap,W=new WeakMap,Ke=new WeakMap,at=new WeakMap,lt=new WeakMap,Se=new WeakMap,_t=new WeakMap,te=new WeakMap,bn=new WeakMap,ct=new WeakMap,Dt=new WeakMap,yn=new WeakMap,dt=new WeakMap,pt=new WeakMap,ht=new WeakMap,vn=new WeakMap,ei=new WeakMap,He=new WeakMap,wn=new WeakMap,Te=new WeakMap,ti=new WeakMap,b=new WeakSet,$o=function(){return p(this,ot)||!!p(this,P).buyerAccessTokenProvider&&!p(this,P).buyerAccessToken},Cs=function(e){let t=p(this,P),i={onExpired:o=>t.onAccessExpired?.(o),onUnavailable:o=>{let r=p(this,Dt)&&o.reason==="provider_failed"?p(this,Dt):o;x(this,Dt,null),x(this,yn,r.reason==="provider_failed"?null:r),t.onAccessUnavailable?.(r),w(this,b,Tp).call(this,r)}},s=t.buyerAccessTokenProvider;if(e&&!p(this,ot)&&s)x(this,ct,null),x(this,Mt,new pe({provider:o=>s({...o,planActivationId:e}),...i}));else if(p(this,ot)){let{access:o,loader:r}=mp({base:(t.apiBase??"https://api.seatlayer.io").replace(/\/$/,""),season:t.season,fetch:t.fetch,...e?{planActivationId:e}:{},onRefused:a=>{x(this,Dt,a)},accessHooks:i});x(this,Mt,o),x(this,ct,r)}else x(this,ct,null),x(this,Mt,new pe({token:t.buyerAccessToken,provider:t.buyerAccessTokenProvider,...i}));x(this,oe,new ks(t.season,{apiBase:t.apiBase,access:p(this,Mt),fetch:t.fetch,recoveryTimeoutMs:t.recoveryTimeoutMs})),x(this,G,new Ts(p(this,oe),Math.max(750,t.realtimePollMs??Mg),o=>w(this,b,Mp).call(this,o),!!t.priceTypes?.some(o=>o!=="adult")))},zo=async function(e,t){let i=p(this,oe).chart();p(this,G).primeChart(i),i.then(a=>{p(this,te)||e!==p(this,rt)||(x(this,fn,new Map((a.categories??[]).map(l=>[l.key,l.label||l.key]))),x(this,gn,a.theme??null),p(this,Rt)==="package"&&w(this,b,At).call(this))},()=>{});let[s,o,r]=await Promise.all([p(this,oe).descriptor(),p(this,oe).availability(),t!==void 0?Promise.resolve(t):p(this,oe).prices().catch(()=>null)]);return p(this,te)||e!==p(this,rt)?!1:(x(this,Z,s),x(this,Ht,s.planActivationId),x(this,Ot,o),x(this,dt,r),x(this,pt,p(this,P).checkout==="hosted"&&s.checkoutMode!=="server"&&r?"hosted":"handoff"),p(this,G).prime(s,o),!0)},At=function(){let e=p(this,Z);if(!p(this,at)||!e||p(this,te))return;x(this,Rt,"package");let t=p(this,Ht)??e.planActivationId,i=document.createElement("div");i.className="sl-picker sl-step-frame";let s=w(this,b,Rs).call(this);for(let[r,a]of Object.entries(s))i.style.setProperty(r,a);let o=p(this,He);if(o){let r=document.createElement("div");r.className="sl-head";let a=document.createElement("div");a.className="sl-logo",ui(a,[p(this,P).theme?.logoUrl,p(this,gn)?.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=Es(e),l.append(c);let d=document.createElement("button");d.type="button",d.className="sl-close on",d.setAttribute("aria-label",me("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",()=>o()),r.append(a,l,d),i.append(r)}i.append(ap({descriptor:e,prices:p(this,dt),chosen:t,loading:t!==e.planActivationId,expanded:p(this,Xn),areas:p(this,fn),emailTickets:p(this,pt)==="hosted"||p(this,P).ticketsByEmail===!0,onSale:w(this,b,kp).call(this,e),titled:!!o,title:Es(e),locale:p(this,P).locale,money:r=>w(this,b,un).call(this,r),choose:r=>{this.choosePackage(r).catch(a=>w(this,b,we).call(this,a))},expand:()=>{x(this,Xn,!0),w(this,b,At).call(this)},seats:()=>{this.chooseSeats().catch(r=>w(this,b,we).call(this,r))}})),p(this,It)?.remove(),p(this,at).append(i),x(this,It,i)},jo=function(){let e=p(this,Ot)?.freeCount??0;w(this,b,Q).call(this,{kind:"ready",message:`${e} seat${e===1?"":"s"} available for every included performance.`})},Go=function(e){let t=p(this,ct)?.session,i=p(this,G).seatsByHold.get(e.holdId),s=p(this,W)?.getCurrentHold(),o=s?.holdId===e.holdId?[...new Set((s.items??[]).map(a=>a.label))]:[],r=i??o.map(a=>({label:a,priceTypeKey:"adult"}));Fo.set(p(this,P).season,{operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,seats:r,typedSeats:p(this,G).typesInPlay(r.map(a=>a.label)),token:t?{token:t.token,expiresAt:t.expiresAt}:p(this,Te)?.token??null})},bp=async function(e){p(this,Te)&&p(this,G).prepareResume(p(this,Te));let t=new et(ps({container:p(this,at),event:e.key,apiBase:p(this,P).apiBase,transport:p(this,G),hideEventDetails:!0,...p(this,Te)?{initialHoldId:p(this,Te).holdId}:{},maxSelection:p(this,P).maxSelection,selectedObjects:p(this,P).selectedObjects,selectableObjects:p(this,P).selectableObjects,numberOfPlacesToSelect:p(this,P).numberOfPlacesToSelect,selectionValidators:p(this,P).selectionValidators,locale:p(this,P).locale,messages:p(this,P).messages,languages:p(this,P).languages,colorblindSafe:p(this,P).colorblindSafe,initialView:p(this,P).initialView,enable3D:p(this,P).enable3D,max3DSeats:p(this,P).max3DSeats,enable3DCrowd:p(this,P).enable3DCrowd,touchNavigation3D:p(this,P).touchNavigation3D,hideBadge:p(this,P).hideBadge,theme:p(this,P).theme,confirmSelection:p(this,P).confirmSelection,seatView:p(this,P).seatView,onBuyerViewChange:p(this,P).onBuyerViewChange,onAnalytics:(i,s)=>{try{p(this,P).onAnalytics?.(i,{...s,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:je(e)})}catch{}},onSelectionChange:i=>{x(this,Se,i.map(s=>s.label)),x(this,_t,new Map(i.filter(s=>!!s.categoryKey).map(s=>[s.label,s.categoryKey]))),p(this,P).onSelectionChange?.(i)},onSelectionValidityChange:p(this,P).onSelectionValidityChange,onHoldChange:i=>{if(!i){w(this,b,Ps).call(this);return}let s=p(this,G).operationForHold(i.holdId);s&&w(this,b,As).call(this,s,!0)},onCheckout:()=>{var i;p(this,K)&&(p(this,P).onContinue?.(p(this,K)),p(this,pt)==="hosted"?w(this,b,Ep).call(this,p(this,K)):(i=p(this,ti))==null||i.call(this,p(this,K)))},onHoldExpired:()=>{w(this,b,Ps).call(this),w(this,b,Q).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),p(this,P).onHoldExpired?.()},onError:i=>w(this,b,we).call(this,i)},{surface:"season",performanceCount:je(e),selectionMode:"same_seat",suppressPricing:!0,packagePricing:w(this,b,Ls).call(this)?w(this,b,xp).call(this):null,modalClose:p(this,He),subheader:w(this,b,Pp).call(this),brandLogoUrl:e.orgLogoUrl??null,brandAccent:e.orgAccent??null,nights:()=>w(this,b,Ko).call(this),seatMarks:()=>w(this,b,vp).call(this),partialWords:{title:me("season.partlyFreeTitle"),advice:me("season.partlyFreeAdvice"),legend:me("season.partlyFreeLegend")},groupSelectionSummary:()=>{let i=p(this,Se).length;return i?{seats:i,performances:je(e),performancesChosen:je(e),perPerformance:i}:null},checkoutReady:i=>p(this,K)?.holdId===i}));x(this,W,t),await t.render()},yp=function(){p(this,Lt).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection"),p(this,He)&&(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,Lt).append(e),x(this,Ke,e),x(this,at,t),x(this,lt,i)},Ko=function(){let e=p(this,Z);if(!e)return[];let t=e.timezone?{timeZone:e.timezone}:{},i=s=>{if(s==null)return me("season.dateToBeAnnounced");try{return new Intl.DateTimeFormat(p(this,P).locale,{weekday:"short",day:"numeric",month:"short",...t}).format(new Date(s))}catch{return new Date(s).toDateString()}};return e.occurrences.filter(s=>s.past!==!0&&s.cancelled!==!0).map(s=>({eventKey:s.eventKey,name:s.name,shortDate:i(s.startsAt)}))},xn=new WeakMap,vp=function(){let e=new Set(w(this,b,Ko).call(this).map(s=>s.eventKey)),t={};for(let s of p(this,xn))t[s]=null;p(this,xn).clear();let i=p(this,G).latestAvailability?.partial??{};if(e.size)for(let[s,o]of Object.entries(i)){let r=o.filter(a=>e.has(a));!r.length||r.length>=e.size||(t[s]={kind:"partial",fraction:(e.size-r.length)/e.size,data:{blockedEventKeys:r}},p(this,xn).add(s))}return t},Uo=function(e){let t=w(this,b,Ls).call(this)?.prices.find(i=>(i.priceTypeKey||"adult")===e);return v(`season.priceType.${e}`,t?.priceTypeLabel||e.charAt(0).toUpperCase()+e.slice(1))},qo=function(){let e=w(this,b,Sp).call(this);return(p(this,W)?.seatPlaces(e)??e.map(i=>({label:i}))).map(i=>{let s=p(this,_t).get(i.label)??p(this,W)?.seatCategory(i.label)??null,o=p(this,G).types.get(i.label),r=p(this,G).typed||!!o&&o!=="adult";return{label:i.label,section:i.section||null,row:i.row||null,seat:i.seat||null,categoryKey:s,area:s?p(this,fn).get(s)??s:null,priceType:o||"adult",priceTypeName:r?w(this,b,Uo).call(this,o||"adult"):null,priceMinor:s?w(this,b,hn).call(this,s,o):null}})},wp=function(e,t){return e.map(i=>{let s=i.row&&i.seat?[i.section,`${v("picker.row","Row")} ${i.row}`,`${v("picker.seat","Seat")} ${i.seat}`].filter(Boolean).join(" \xB7 "):i.label,o=[i.area,i.priceTypeName].filter(Boolean).join(" \xB7 ");return{label:s,...o?{detail:o}:{},amount:i.priceMinor==null?null:Bo(i.priceMinor,t)}})},xp=function(){let e=p(this,G).types,t=[...new Set(p(this,P).priceTypes??["adult"])],i=a=>t.filter(l=>w(this,b,hn).call(this,a,l)!=null),s=a=>w(this,b,Uo).call(this,a),o=(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=()=>_o(p(this,Z)?je(p(this,Z)):0);return{seat:(a,l)=>{let c=o(a,l),d=w(this,b,hn).call(this,l,c),h=p(this,G).typed?i(l):[];return{amountText:d==null?"":w(this,b,un).call(this,d),types:h.length>1?{options:h.map(m=>({id:m,name:s(m)})),selected:c}:null}},total:a=>{let l=0;for(let{label:c,categoryKey:d}of a){let h=w(this,b,hn).call(this,d,o(c,d));if(h==null)return null;l+=h}return{amountText:w(this,b,un).call(this,l),countText:`${Lg("picker.seatCount",a.length)} \xB7 ${r()}`}},setType:(a,l)=>{t.includes(l)&&e.set(a,l)},seatCardPrice:a=>{let l=i(a),c=w(this,b,hn).call(this,a,l.includes("adult")?"adult":l[0]);return c==null?null:{price:w(this,b,un).call(this,c),note:r()}}}},As=function(e,t){if(e.state==="booked")return x(this,K,null),p(this,G).forget(e.holdId),p(this,W)?.notifyGroupSettled("booked"),w(this,b,Q).call(this,{kind:"booked",message:`Your Season booking is complete for ${gp(je(p(this,Z)))}. No further checkout action is needed.`,operationId:e.operationId}),p(this,P).onHoldChange?.(null),null;if(e.state==="partial_terminal")return x(this,K,null),x(this,Se,[]),p(this,G).forget(e.holdId),p(this,W)?.notifyGroupSettled("lost"),w(this,b,Q).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),p(this,P).onHoldChange?.(null),null;if(e.state!=="committed")return x(this,K,null),p(this,G).forget(e.holdId),p(this,W)?.notifyGroupSettled("lost"),w(this,b,Q).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),p(this,P).onHoldChange?.(null),null;let i=ep(p(this,Z),e,p(this,G).seatsByHold.get(e.holdId)),s=p(this,K)?.holdId!==i.holdId;return x(this,K,i),p(this,P).onHoldChange?.(i),w(this,b,Q).call(this,{kind:"held",message:`Your seats are held for ${gp(je(p(this,Z)))}. Review and continue to checkout.`,operationId:e.operationId}),s&&t&&p(this,P).onHold?.(i),i},kp=function(e){return e.salesState?e.salesState==="open":p(this,ct)?.session?!0:null},Ps=function(){x(this,K,null),x(this,Se,[]),p(this,P).onHoldChange?.(null)},Ls=function(){let e=p(this,Z)?.planActivationId;return p(this,dt)?.packages.find(t=>t.planActivationId===e)??null},hn=function(e,t="adult"){let i=w(this,b,Ls).call(this)?.prices.find(s=>s.categoryKey===e&&(s.priceTypeKey||"adult")===t);return i?i.unitPrice:null},Sp=function(){return p(this,K)?.seats?.map(e=>e.label)??p(this,Se)},Wo=function(e){if(!e.length)return null;let t=0;for(let i of e){if(i.priceMinor==null)return null;t+=i.priceMinor}return t},Ms=function(){return p(this,dt)?.currency??p(this,Z)?.currency??"USD"},un=function(e,t=w(this,b,Ms).call(this)){let i=Bo(e,t),s=Number.isInteger(i);return fp(i,t,{locale:p(this,P).locale,fallback:(o,r)=>`${o} ${r}`,...s?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},Tp=function(e){let t=e.reason==="audience_not_public"?me("season.accessNotPublic"):e.reason==="sales_not_open"?me("season.accessSalesNotOpen"):e.reason==="origin_not_allowed"?me("season.accessOriginNotAllowed"):me("season.accessUnavailable");w(this,b,Q).call(this,{kind:"failed",message:t})},Ep=async function(e){if(!p(this,vn)){x(this,vn,!0);try{let t=w(this,b,Ms).call(this),i=w(this,b,qo).call(this),s=w(this,b,Wo).call(this,i);if(s==null){w(this,b,Q).call(this,{kind:"failed",message:me("season.checkoutNotPriced"),operationId:e.operationId});return}await w(this,b,Yo).call(this,{kind:"pay",provider:null,order:{holdId:e.operationId,expiresAt:e.expiresAt,currency:t,total:Bo(s,t),labels:i.map(o=>o.label),lines:w(this,b,wp).call(this,i,t)}})}finally{x(this,vn,!1)}}},Cp=function(){let e=p(this,P).returnUrl;if(p(this,ei)||!e||!p(this,Z))return;x(this,ei,!0);let t=p(this,pt)==="hosted"?Rg(e,p(this,Z).mode):"is not used: this picker takes no payment and hands the held seats to onContinue";t&&console.warn(`seatlayer: SeasonPicker returnUrl ${t}.`)},Ap=function(){if(p(this,pt)!=="hosted")return;let e=sn(p(this,P).season);e?.outcome!=="success"||!e.orderId||w(this,b,Yo).call(this,{kind:"resume",orderId:e.orderId})},Yo=async function(e){let t;try{({mountCheckout:t}=await $t())}catch(a){p(this,P).onError?.(a),w(this,b,Q).call(this,{kind:"failed",message:me("season.checkoutCouldNotBeOpened")});return}let i=p(this,W)?.root;if(p(this,te)||!i)return;w(this,b,Hs).call(this);let s=p(this,Z)?.buyer,o=p(this,P).buyerEmail||s?.email||void 0,r=p(this,P).buyerName||s?.name||void 0;x(this,ht,t({root:i,state:e,eventKey:p(this,P).season,formatMoney:(a,l)=>fp(a,l,{locale:p(this,P).locale,fallback:(c,d)=>`${c} ${d}`,...Number.isInteger(a)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:a=>p(this,oe).checkout({operationId:a.holdId,buyerEmail:a.buyerEmail,...a.buyerName?{buyerName:a.buyerName}:{},...p(this,P).returnUrl?{returnUrl:p(this,P).returnUrl}:{}}),orderStatus:a=>p(this,oe).orderStatus(a),...o||r?{buyer:{email:o,name:r}}:{},onCancel:()=>{x(this,ht,null),w(this,b,Zn).call(this)},onConfirmed:a=>{p(this,P).onOrderConfirmed?.(a),w(this,b,Q).call(this,{kind:"booked",message:me("season.orderConfirmed")})},onError:a=>p(this,P).onError?.(a)})),w(this,b,Zn).call(this)},Hs=function(){p(this,ht)?.destroy(),x(this,ht,null),w(this,b,Zn).call(this)},Pp=function(){let e=document.createElement("div");return e.className="sl-season-strip",x(this,mn,e),w(this,b,Zn).call(this),e},Zn=function(){let e=p(this,mn),t=p(this,Z);!e||!t||e.replaceChildren(...cp({step:p(this,ht)?"pay":"seats",pkg:p(this,dt)?.packages.find(i=>i.planActivationId===t.planActivationId)??null,dates:je(t),money:i=>w(this,b,un).call(this,i),change:()=>w(this,b,Lp).call(this)}))},Lp=function(){let e=p(this,K);if(!e){w(this,b,Zo).call(this);return}if(!p(this,Ke))return;let t=e.seats?.map(s=>s.label)??p(this,Se),i=p(this,W)?.seatPlaces(t)??t.map(s=>({label:s}));up(p(this,Ke),hp(i),{keep:()=>{},change:()=>{this.release(`sra_${crypto.randomUUID()}`).then(()=>w(this,b,Zo).call(this),s=>w(this,b,we).call(this,s))}},w(this,b,Rs).call(this))},Rs=function(){return Re(p(this,gn)??void 0,p(this,P).theme,void 0,p(this,Z)?.orgAccent)},Zo=function(){p(this,te)||(w(this,b,Hs).call(this),p(this,W)?.destroy(),x(this,W,null),x(this,mn,null),x(this,Se,[]),p(this,_t).clear(),w(this,b,At).call(this))},Q=function(e,t=!1){p(this,lt)&&(p(this,lt).textContent=e.message,p(this,lt).dataset.kind=e.kind),p(this,Ke)&&(p(this,Ke).dataset.busy=String(t)),p(this,P).onStatusChange?.(e)},we=function(e,t){if(p(this,te)||e instanceof B&&e.code==="season_api_destroyed")return e;let i=e instanceof ee&&e.reason==="provider_failed"&&p(this,yn)?new ee(p(this,yn)):e;return i instanceof ee?(p(this,P).onError?.(i),i):(w(this,b,Q).call(this,{kind:"failed",message:Ss(i),operationId:t}),p(this,P).onError?.(i),i)},Mp=function(e){p(this,te)||(e instanceof ee||w(this,b,Q).call(this,{kind:"failed",message:me("season.sessionEnded")}),p(this,P).onError?.(e))},Qn=function(){if(p(this,te))throw new Error("seatlayer: SeasonPicker was destroyed")},Pt=function(){if(w(this,b,Qn).call(this),!p(this,Z)||!p(this,W))throw new Error("seatlayer: render SeasonPicker before using it")};var Vo=Qo;function gp(n){return n===1?"1 date":`all ${n} dates`}function Og(n,e={}){let t=e.origin??"";if(!t)try{t=new URL(n.src,window.location.href).origin}catch{t=""}let i=!1,s=null,o=null,r=null,a="",l=null,c="",d=()=>{if(i)return;i=!0,s=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;o=u.style.overflow,u.style.overflow="hidden",document.body&&(r=document.body.style.overflow,document.body.style.overflow="hidden"),l=y=>{y.key==="Escape"&&h()},window.addEventListener("keydown",l)},h=()=>{i&&(i=!1,s===null?n.removeAttribute("style"):n.setAttribute("style",s),s=null,a&&(n.style.height=a),o!==null&&(document.documentElement.style.overflow=o,o=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 y=u.data;if(y.type==="seatlayer:height"){typeof y.px=="number"&&Number.isFinite(y.px)&&y.px>0&&(a=`${Math.round(y.px)}px`,i||(n.style.height=a));return}y.type==="seatlayer:fullscreen"&&(typeof y.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(y.background)&&(c=y.background,i&&(n.style.background=c)),y.on===!0?d():y.on===!1&&h())};return window.addEventListener("message",m),()=>{window.removeEventListener("message",m),h()}}export{j as ApiError,pe as BuyerAccessContext,ee as BuyerAccessUnavailableError,Oe as BuyerRealtimeClient,io as EmbeddedDesigner,ie as PerformanceGroupDestroyedError,Ho as PerformanceGroupPicker,sl as SEATING_CHART_CALLBACK_PROPS,tl as SEATING_CHART_HANDLE_METHODS,nl as SEATING_CHART_IDENTITY_PROPS,il as SEATING_CHART_VALUE_PROPS,B as SeasonApiError,Vo as SeasonPicker,Gn as SeasonPublicSessionRefused,jn as SeasonRecoveryTimeoutError,et as SeatPicker,to as SeatingChart,Og as attachPickerFrame,Nu as bindSeatingChartHandle,Bu as buildSeatingChartOptions,Hn as createBuyerAccessContext,Sn as createControllerSink,ro as parseTicketOfferAvailability,jf as prewarmSeatPicker,Vn as shortOperationReference,gl as ticketOfferPrices};
3504
+ `,document.head.appendChild(n)}import{t as Wn}from"@seatlayer/core";var B=class extends Error{constructor(t,i,s){super(`season_request_failed:${t}`);this.code=t;this.status=i;this.name="SeasonApiError",s?.retryAfterS!==void 0&&(this.retryAfterS=s.retryAfterS),s?.retryable!==void 0&&(this.retryable=s.retryable),s?.reason!==void 0&&(this.reason=s.reason),s?.refusals?.length&&(this.refusals=s.refusals),s?.buyerMessage&&(this.buyerMessage=s.buyerMessage)}},Gn=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}},Kn=class extends Error{constructor(t,i){super(`season_public_session_refused:${t}`);this.reason=t;this.status=i;this.name="SeasonPublicSessionRefused"}};var Sg="https://api.seatlayer.io",Tg=6e4,Eg=5e3,Cg=new Set(["seat_unavailable","seat_held_for_renewal"]);function np(n){return typeof n=="string"&&Cg.has(n)?n:void 0}function Do(n){return Array.isArray(n)?n.flatMap(e=>{let t=e??{},i=typeof t.eventKey=="string"?t.eventKey:t.eventId,s=np(t.code);return typeof i=="string"&&s?[{eventKey:i,code:s}]:[]}):[]}function Ag(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(Eg,i*1e3))}function Pg(n,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,i)=>{let s=setTimeout(t,n);e?.addEventListener("abort",()=>{clearTimeout(s),i(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function ep(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 Lg(n,e){let t=e&&typeof e=="object"?e:{},i=Do(t.handoff?.allocations??t.operation?.allocations),s=(n.headers.get("Retry-After")??"").trim(),o=s?Number(s):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}:{},...i.length?{refusals:i}:{}}}var Mg=/^shc_[a-f0-9]{40}$/,Hg=/^shh_[a-f0-9]{40}$/,Rg=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),Ig=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function _o(n){return Array.isArray(n)?n.some(_o):!n||typeof n!="object"?!1:Object.entries(n).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&Mg.test(t)||_o(t))}function Un(n,e,t="invalid_operation_response"){if(!n||typeof n!="object"||Array.isArray(n))throw new B(t,502);if(_o(n))throw new B("unsafe_operation_response",502);let i=n,s=i.allocations,o=new Set,r=Array.isArray(s)&&s.length>0&&s.every(h=>{if(!h||typeof h!="object")return!1;let m=h.eventId,u=h.state;return typeof m!="string"||!m||typeof u!="string"||!Ig.has(u)||o.has(m)?!1:(o.add(m),!0)}),a=i.bookingRef===null||typeof i.bookingRef=="string"&&i.bookingRef.length>0,l=i.state!=="booked"||typeof i.bookingRef=="string"&&r&&s.every(h=>h.state==="booked"),c=i.state!=="booking_pending"||typeof i.bookingRef=="string"&&r&&s.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"||!Hg.test(i.holdId)||i.policy!=="fixed_inclusion_same_seat"||typeof i.state!="string"||!Rg.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 B(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:s.map(h=>{let m=np(h.code);return{eventId:h.eventId,state:h.state,...m?{code:m}:{}}})}}function Og(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 B("invalid_best_available_response",502);let i=n,s=new Set(i),o=new Map;for(let r of e){if(!r||typeof r!="object")throw new B("invalid_best_available_response",502);let a=r;if(typeof a.label!="string"||!s.has(a.label)||o.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 B("invalid_best_available_response",502);o.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=>o.get(r))}}function tp(n){return typeof n=="number"&&Number.isFinite(n)?n:null}async function ip(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?sp(await i.json()):null}catch{return null}}function sp(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 s=i;if(typeof s.planKey!="string"||!s.planKey||typeof s.planActivationId!="string"||!s.planActivationId||!Array.isArray(s.prices))continue;let o=[],r=new Set;for(let a of s.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),o.push({categoryKey:l.categoryKey,...c?{priceTypeKey:c,priceTypeLabel:typeof l.priceTypeLabel=="string"?l.priceTypeLabel:c}:{},unitPrice:l.unitPrice}))}o.length&&t.push({planKey:s.planKey,planActivationId:s.planActivationId,name:typeof s.name=="string"&&s.name?s.name:s.planKey,prices:o,...Number.isInteger(s.datesToCome)&&s.datesToCome>=0?{datesToCome:s.datesToCome,firstDateAt:tp(s.firstDateAt),lastDateAt:tp(s.lastDateAt)}:{}})}return t.length?{currency:e.currency,packages:t}:null}function _g(n){if(!n||typeof n!="object"||Array.isArray(n))throw new B("invalid_checkout_response",502);let e=n,t=typeof e.redirectUrl=="string"&&!!e.redirectUrl,i=ir(e.redirectUrl);if(t&&!i)throw new B("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 B("invalid_checkout_response",502);return{orderId:e.orderId,totalMinor:e.totalMinor,currency:e.currency,expiresAt:e.expiresAt,redirectUrl:i}}function op(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:s,code:o})=>({eventKey:i,state:s,...o?{code:o}:{}})),...t?{seats:t}:{}}}var xe,Et,Le,Ct,qn,Me,He,le,ve,rp,Es=class{constructor(e,t){C(this,le);C(this,xe);C(this,Et);C(this,Le);C(this,Ct);C(this,qn);C(this,Me,!1);C(this,He,null);x(this,xe,e),x(this,Et,(t.apiBase??Sg).replace(/\/$/,"")),x(this,Le,t.access),x(this,Ct,t.fetch??globalThis.fetch.bind(globalThis)),x(this,qn,t.recoveryTimeoutMs??Tg),p(this,Le).onRenewed(i=>w(this,le,rp).call(this,i))}async descriptor(){let{body:e}=await w(this,le,ve).call(this,"GET","");return e.season}async chart(){let{body:e}=await w(this,le,ve).call(this,"GET","/chart");return e}async availability(){let{body:e}=await w(this,le,ve).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 s=e.map(a=>{let l=i?.get(a);return l&&l!=="adult"?{label:a,priceTypeKey:l}:{label:a}}),{body:o,response:r}=await w(this,le,ve).call(this,"POST","/holds",{operationId:t,labels:[...e],...s.some(a=>"priceTypeKey"in a)?{selections:s}:{}});return{operation:Un(o.operation,{seasonId:p(this,xe),operationId:t}),response:r}}async bestAvailable(e){let{body:t,response:i}=await w(this,le,ve).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}:{}}),s=Un(t.operation,{seasonId:p(this,xe),operationId:e.operationId},"invalid_best_available_response"),{labels:o,items:r}=Og(t.labels,t.items,e.qty);return{operation:s,labels:o,items:r,response:i}}async operation(e){let{body:t,response:i}=await w(this,le,ve).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:Un(t.operation,{seasonId:p(this,xe),operationId:e}),response:i}}async release(e,t){let{body:i,response:s}=await w(this,le,ve).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:Un(i.operation,{seasonId:p(this,xe),operationId:e}),response:s}}async prices(){let e;try{({body:e}=await w(this,le,ve).call(this,"GET","/prices"))}catch(t){if(t instanceof B&&t.status===404)return null;throw t}return sp(e)}async checkout(e){let{body:t}=await w(this,le,ve).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 _g(t)}async orderStatus(e){let t=await p(this,Ct).call(this,`${p(this,Et)}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit"}),i=await t.json().catch(()=>null);if(!t.ok)throw new B(ep(i),t.status);if(i===null)throw new B("invalid_json_response",502);return i}async renewalIntent(e){let{body:t}=await w(this,le,ve).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 B("invalid_renewal_intent_response",502);return i}async waitForTerminal(e,t,i){let s=Date.now(),o=t?{operation:Un(t.operation,{seasonId:p(this,xe),operationId:e}),response:t.response}:await this.operation(e);for(;o.operation.state==="preparing"||o.operation.state==="commit_pending"||o.operation.state==="expire_pending"||o.operation.state==="booking_pending"||o.operation.state==="abort_pending";){if(Date.now()-s>=p(this,qn))throw new Gn(e);await Pg(Ag(o.response,o.operation),i),o=await this.operation(e)}return o.operation}destroy(){p(this,Me)||(x(this,Me,!0),p(this,Le).onRenewed(void 0),p(this,Le).clear())}};xe=new WeakMap,Et=new WeakMap,Le=new WeakMap,Ct=new WeakMap,qn=new WeakMap,Me=new WeakMap,He=new WeakMap,le=new WeakSet,ve=async function(e,t,i,s=!0){if(p(this,Me))throw new B("season_api_destroyed",409);if(p(this,He))throw p(this,He);let o=await p(this,Le).authorization();if(p(this,Me))throw new B("season_api_destroyed",409);if(p(this,He))throw p(this,He);if(!o)throw new ee({reason:"no_token",retryable:!1});let r=await p(this,Ct).call(this,`${p(this,Et)}/pub/seasons/${encodeURIComponent(p(this,xe))}${t}`,{method:e,headers:{Authorization:o,...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=ep(a);if(s&&await p(this,Le).handleFailure(r.status,l,o))return w(this,le,ve).call(this,e,t,i,!1);let c=p(this,Le).unavailable;throw c?new ee(c):new B(l,r.status,Lg(r,a))}if(a===null)throw new B("invalid_json_response",502);return{body:a,response:r}},rp=async function(e){if(p(this,Me))return;let t=`/pub/seasons/${encodeURIComponent(p(this,xe))}/session/adopt`;for(let i=0;i<2;i++){if(p(this,Me))return;try{if((await p(this,Ct).call(this,`${p(this,Et)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){x(this,He,null);return}}catch{}}if(!p(this,Me))throw x(this,He,new B("season_session_adopt_failed",409)),p(this,He)};function Cs(n){if(!(n instanceof B))return Wn("season.selectionFailed");let e=new Set((n.refusals??[]).map(t=>t.code));return n.code==="season_sales_not_open"?Wn("season.accessSalesNotOpen"):e.has("seat_held_for_renewal")?Wn("season.seatHeldForRenewal"):e.has("seat_unavailable")||n.code==="seats_unavailable"?Wn("season.seatUnavailable"):n.code==="unknown"?Wn("season.selectionFailed"):`Season selection unavailable (${n.code}).`}function Ps(n){let e=n.edition?.trim();return e&&!n.name.includes(e)?`${n.name} ${e}`:n.name}function ap(n){return n.state==="committed"||n.state==="booked"}function lp(n){return new B(`season_operation_${n.state}`,409,{refusals:Do(n.allocations)})}var No=class{constructor(e,t,i,s){this.transport=e;this.sink=t;this.intervalMs=i;this.onSessionEnded=s;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=o=>(t[o]??[]).join("|"),s=Object.entries(e.seats).filter(([o,r])=>this.prior[o]!==r||this.priorPartial[o]!==i(o)).map(([o,r])=>({label:o,status:r}));this.prior={...e.seats},this.priorPartial=Object.fromEntries(Object.keys(e.seats).map(o=>[o,i(o)])),s.length&&this.sink.applyStatuses(s)}catch(e){if(Ri(e)){this.stop(),this.onSessionEnded?.(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},As=class{constructor(e,t,i,s=!1){this.api=e;this.realtimePollMs=t;this.onSessionEnded=i;this.typed=s;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 B("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 B("season_hold_not_found",404);let s=await this.api.waitForTerminal(i.operationId);if(s.state!=="committed"||s.holdId!==t)throw new B("season_hold_not_found",404);if(i.typedSeats)for(let o of i.seats)this.types.set(o.label,o.priceTypeKey);return this.remember(s),this.recordSeats(t,i.seats.map(o=>o.label)),{holdId:t,expiresAt:s.expiresAt,items:i.seats.map(o=>({label:o.label,objectId:o.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:Ps(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,s){if(s)throw new B("season_hold_replace_unsupported",409);let o=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let r=t.map(c=>c.label),a=await this.api.hold(r,o,this.types).catch(c=>{throw c instanceof B&&c.code==="price_type_not_offered"?this.typeRefusal=new B(c.code,c.status,{reason:"ticket_option_not_applicable"}):cp(c)}),l=await this.api.waitForTerminal(o,a);if(!ap(l))throw lp(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 s=this.operationForHold(i);if(!s)throw new B("season_hold_not_found",404);let o=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let r=await this.api.release(s.operationId,o),a=await this.api.waitForTerminal(s.operationId,r);if(a.state==="partial_terminal")throw this.remember(a),new B("season_operation_partial_terminal",409);this.forget(i)}async bestAvailable(e,t,i,s){let o=this.nextBestAvailable;this.nextBestAvailable=null;let r=o?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:r,qty:t,...i?{categoryKey:i}:{},...s?{zoneId:s}:{},...o?.accessibility?.length?{accessibility:o.accessibility}:{},...o?.requireContiguous===!0?{requireContiguous:!0}:{}}).catch(d=>{throw cp(d)}),l=await this.api.waitForTerminal(r,a);if(!ap(l))throw lp(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 No(this,t,this.realtimePollMs,this.onSessionEnded)}};function cp(n){return!(n instanceof B)||n.code!=="season_sales_not_open"?n:new B(n.code,n.status,{reason:"event_closed",buyerMessage:Cs(n)})}import{t as $}from"@seatlayer/core";var Dg=["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 Yn(n){return n===1?$("season.oneDate"):$("season.dateCount").replace("{count}",String(n))}function Bo(n){return n===1?$("season.priceForOneDate"):$("season.priceForAllDates").replace("{count}",String(n))}function je(n){return n.occurrences.length?n.occurrences.filter(e=>e.past!==!0&&e.cancelled!==!0).length:n.occurrenceCount}function pn(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 dp(n,e,t,i,s){let o={day:"numeric",month:"short",...s?{year:"numeric"}:{}},r=pn(n,t,i,o),a=pn(e,t,i,o);return r===a?r:$("season.dateRange").replace("{from}",r).replace("{to}",a)}function Fo(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 pp(n){return n.occurrences.filter(e=>e.past!==!0&&e.cancelled!==!0)}function Ng(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 s=t?pp(n.descriptor):null,o=s?s.length:e.datesToCome;if(o!==void 0){let l=s?s.find(h=>h.startsAt!=null)?.startsAt??null:e.firstDateAt??null,c=s?[...s].reverse().find(h=>h.startsAt!=null)?.startsAt??null:e.lastDateAt??null,d=l!=null&&c!=null?dp(l,c,n.descriptor.timezone,n.locale,!1):"";i.append(H("span","sl-step-card-dates",[Yn(o),d].filter(Boolean).join(" \xB7 ")))}let r=Fo(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 Bg(n,e,t){let i=H("div","sl-step-prices"),s=H("div","sl-step-prices-head");s.append(H("b",void 0,$("season.packagePrices").replace("{name}",e.name)),H("span",void 0,`${$("season.perSeat")}, ${Bo(t)}`));let o=Dg.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")),...o.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 o){let u=e.prices.find(b=>b.categoryKey===d&&(b.priceTypeKey??"adult")===m);h.append(H("td",void 0,u?n.money(u.unitPrice):"\u2014"))}l.append(h)}return i.append(s,l),i}function Fg(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,s=H("span","sl-step-day");e.startsAt!=null&&s.append(H("small",void 0,pn(e.startsAt,i,n.locale,{month:"short"}).toUpperCase()),H("b",void 0,pn(e.startsAt,i,n.locale,{day:"numeric"})));let o=H("span","sl-step-date-text");if(o.append(H("b",void 0,e.name)),e.startsAt!=null){let r=pn(e.startsAt,i,n.locale,{weekday:"short",day:"numeric",month:"short"}),a=pn(e.startsAt,i,n.locale,{hour:"2-digit",minute:"2-digit"});o.append(H("span",void 0,`${r} \xB7 ${a}`))}return t.append(s,o),(e.cancelled||e.past)&&t.append(H("span","sl-step-date-tag",e.cancelled?$("season.cancelled"):$("season.past"))),t}function hp(n){let{descriptor:e}=n,t=H("div","sl-season-step"),i=H("div","sl-step-body"),s=pp(e),o=s.length,r=H("div","sl-step-intro");r.append(up("package")),n.titled||r.append(H("h2","sl-step-title",n.title));let a=s.find(f=>f.startsAt!=null)?.startsAt??null,l=[...s].reverse().find(f=>f.startsAt!=null)?.startsAt??null,c=[Yn(o),e.venue,a!=null&&l!=null?dp(a,l,e.timezone,n.locale,!0):""].filter(Boolean).join(" \xB7 "),d=H("p","sl-step-facts");d.append(H("span",void 0,c)),n.onSale===!0&&d.append(H("span","sl-step-onsale",$("season.onSale"))),r.append(d),n.onSale===!1&&r.append(H("p","sl-step-facts sl-step-closed",$("season.accessSalesNotOpen")));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"),b=H("div","sl-step-col"),g=H("div","sl-step-col");u.append(b,g),i.append(u),b.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 R=H("div","sl-step-cards");n.loading&&R.setAttribute("aria-busy","true"),R.append(...T.map(M=>Ng(n,M,M.planActivationId===n.chosen))),f.append(R),b.append(f)}if(S){let f=Bg(n,S,o);n.expanded||(f.dataset.more="true"),g.append(f)}let k=H("ul","sl-step-dates");if((n.expanded?e.occurrences:s.slice(0,3)).forEach((f,R)=>{let M=Fg(n,f);!n.expanded&&R>0&&(M.dataset.more="true"),k.append(M)}),g.append(k),!n.expanded&&e.occurrences.length>1){let f=H("button","sl-step-all");f.type="button";let R=Yn(e.occurrences.length);f.append(H("span","sl-step-wide",$("season.showAllDates").replace("{dates}",R)),H("span","sl-step-narrow",$("season.showAllDatesPrices").replace("{dates}",R))),f.addEventListener("click",()=>n.expand()),g.append(f)}let L=H("div","sl-step-go"),U=S?Fo(S.prices):null;S&&U!=null&&L.append(H("span","sl-step-go-price",[$("season.fromPrice").replace("{price}",n.money(U)),S.name,$("season.perSeat")].join(" \xB7 ")));let O=H("button","sl-step-seats",$("season.chooseSeats"));return O.type="button",O.disabled=n.loading,O.addEventListener("click",()=>n.seats()),L.append(O),t.append(i,L),t}function up(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((s,o)=>{let r=o<e.indexOf(n)?"done":s===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(o+1)),document.createTextNode(t[s])),i.append(a)}),i}function mp(n){let e=H("span","sl-strip-pkg");n.pkg?e.append(H("b",void 0,n.pkg.name),document.createTextNode(` \xB7 ${Yn(n.dates)}`)):e.append(document.createTextNode(Yn(n.dates)));let t=n.pkg?Fo(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()),[up(n.step),e,i]}import{t as ke}from"@seatlayer/core";function fp(n,e){for(let[t,i]of Object.entries(e))n.style.setProperty(t,i)}function gp(n,e,t,i={}){let s=document.createElement("div");fp(s,i),s.className="sl-season-leave",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true");let o=document.createElement("div");o.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"),s.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),o.append(r,a,l),s.append(o);let h=null,m=()=>{h&&clearInterval(h),h=null,s.remove()},u=()=>{let b=Math.max(0,e-Date.now());if(b<=0){m(),t.lapsed();return}let g=Math.ceil(b/1e3),T=`${Math.floor(g/60)}:${String(g%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(s),d.focus({preventScroll:!0}),{remove:m}}function bp(n){let e=s=>{try{return new Intl.ListFormat(void 0,{type:"conjunction"}).format(s)}catch{return s.join(", ")}},t=[],i=new Map;for(let s of n){if(!s.row||!s.seat){t.push({head:[s.label],seats:[]});continue}let o=`${s.section??""}\0${s.row}`,r=i.get(o);r||(r={head:[s.section??"",`${ke("picker.row")} ${s.row}`].filter(Boolean),seats:[]},i.set(o,r),t.push(r)),r.seats.push(s.seat)}return t.map(({head:s,seats:o})=>[...s,...o.length===1?[`${ke("picker.seat")} ${o[0]}`]:[],...o.length>1?[`${ke("season.seats")} ${e(o)}`]:[]].join(", ")).join("; ")}function yp(n,e,t,i={}){let s=document.createElement("div");fp(s,i),s.className="sl-season-leave",s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true");let o=document.createElement("div");o.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"),s.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),o.append(r,a,l),s.append(o);let h=()=>{s.remove()};return c.addEventListener("click",()=>{h(),t.change()}),d.addEventListener("click",()=>{h(),t.keep()}),n.append(s),d.focus({preventScroll:!0}),{remove:h}}var Vg=new Set(["audience_not_public","sales_not_open","origin_not_allowed"]),$g=3e4;function zg(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 Ge,st,Zn,hn,Vo=class{constructor(e){this.options=e;C(this,Ge,null);C(this,st,null);C(this,Zn);C(this,hn);x(this,Zn,e.fetch??globalThis.fetch.bind(globalThis)),x(this,hn,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return p(this,Ge)}async mint(e=!1){if(e&&x(this,Ge,null),p(this,Ge)&&p(this,Ge).expiresAt-$g>Date.now())return p(this,Ge);if(p(this,st))return p(this,st);let t=(async()=>{let i=await p(this,Zn).call(this,`${this.options.base}/pub/seasons/${encodeURIComponent(this.options.season)}/sessions`,{method:"POST",body:JSON.stringify({...p(this,hn)?{origin:p(this,hn)}:{},...this.options.planActivationId?{planActivationId:this.options.planActivationId}:{}}),credentials:"omit"}),s=await i.json().catch(()=>null);if(!i.ok){let o=s?.code??s?.error;if(i.status===403&&o&&Vg.has(o)){let r=o;throw this.options.onRefused?.({reason:r,code:o,status:i.status,retryable:r==="sales_not_open"}),new Kn(r,i.status)}throw new Error(`season_public_session_failed_${i.status}`)}if(!zg(s,this.options.season))throw new Error("season_public_session_invalid");return x(this,Ge,s),s})();x(this,st,t);try{return await t}finally{p(this,st)===t&&x(this,st,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}}};Ge=new WeakMap,st=new WeakMap,Zn=new WeakMap,hn=new WeakMap;function vp(n){let e=new Vo(n);return{access:new pe({provider:({reason:i})=>e.token(i),...n.accessHooks}),loader:e}}var Gg=2500,zo=new Map;function Kg(){return typeof location<"u"&&new URLSearchParams(location.search).has("seatlayer_checkout")}function Ug(n,e){let t=null;try{t=new URL(n)}catch{}if(!t||!/^https?:$/.test(t.protocol))return`"${n}" is not an absolute http(s) URL, so checkout ignores it and onOrderConfirmed does not run`;let i=typeof location>"u"?t.origin:location.origin;return t.origin!==i?`is on ${t.origin}, but this tab keeps the order for ${i}: onOrderConfirmed does not run there`:e==="test"?`brings the buyer back only if ${t.origin} is saved under Embed domains; otherwise onOrderConfirmed does not run`:null}function qg(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 P,Lt,Mt,oe,G,ot,fn,rt,Ht,Rt,It,Jn,gn,bn,ei,Z,Ot,K,W,Ke,at,lt,Se,_t,te,yn,ct,Dt,vn,dt,pt,ht,wn,ti,Re,xn,Te,ni,y,Go,Ls,Ko,At,Uo,qo,kp,Sp,Wo,kn,Tp,Yo,Zo,Ep,Cp,Ms,Ap,Hs,Rs,un,Pp,Xo,Is,mn,Lp,Mp,Hp,Rp,Qo,Os,Ip,Xn,Op,_s,Jo,X,we,_p,Qn,Pt,er=class er{constructor(e){C(this,y);C(this,P);C(this,Lt);C(this,Mt);C(this,oe);C(this,G);C(this,ot);C(this,fn,null);C(this,rt,0);C(this,Ht,null);C(this,Rt,"package");C(this,It,null);C(this,Jn,!1);C(this,gn,new Map);C(this,bn,null);C(this,ei,new AbortController);C(this,Z,null);C(this,Ot,null);C(this,K,null);C(this,W,null);C(this,Ke,null);C(this,at,null);C(this,lt,null);C(this,Se,[]);C(this,_t,new Map);C(this,te,!1);C(this,yn,!1);C(this,ct,null);C(this,Dt,null);C(this,vn,null);C(this,dt,null);C(this,pt,"handoff");C(this,ht,null);C(this,wn,!1);C(this,ti,!1);C(this,Re,null);C(this,xn,null);C(this,Te,null);C(this,ni,null);C(this,kn,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");x(this,P,e),x(this,Lt,qg(e.container)),x(this,ot,!e.buyerAccessToken&&!e.buyerAccessTokenProvider),w(this,y,Ls).call(this,null)}async render(){w(this,y,Qn).call(this),Fe(),Jd(),w(this,y,Sp).call(this),w(this,y,X).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let e;if(p(this,P).package&&w(this,y,Go).call(this)&&!p(this,Te)){if(e=await ip(p(this,P).apiBase??"https://api.seatlayer.io",p(this,P).season,p(this,P).fetch),p(this,te))return this;let t=e?.packages.find(i=>i.planKey===p(this,P).package);t&&(p(this,oe).destroy(),w(this,y,Ls).call(this,t.planActivationId))}return await w(this,y,Ko).call(this,p(this,rt),e)?(w(this,y,Hp).call(this),p(this,Te)||p(this,P).initialOperationId||Kg()?await this.chooseSeats():w(this,y,At).call(this),p(this,te)?this:(w(this,y,Rp).call(this),w(this,y,Uo).call(this),p(this,P).initialOperationId&&await this.restoreOperation(p(this,P).initialOperationId),this)):this}catch(e){if(p(this,te))return this;throw w(this,y,we).call(this,e)}}async choosePackage(e){if(w(this,y,Qn).call(this),(p(this,Ht)??p(this,Z)?.planActivationId)===e)return;if(!w(this,y,Go).call(this))throw new B("season_package_fixed",409);if(p(this,K))throw new B("season_hold_open",409);x(this,Ht,e);let t=++nr(this,rt)._;p(this,W)?.destroy(),x(this,W,null),x(this,Se,[]),p(this,_t).clear(),p(this,oe).destroy(),w(this,y,Ls).call(this,e),w(this,y,At).call(this),w(this,y,X).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{if(!await w(this,y,Ko).call(this,t))return;w(this,y,At).call(this),w(this,y,Uo).call(this)}catch(i){if(p(this,te)||t!==p(this,rt))return;throw w(this,y,we).call(this,i)}}async chooseSeats(){if(w(this,y,Qn).call(this),!(p(this,Rt)==="seats"&&p(this,W))){if(!p(this,Z))throw new Error("seatlayer: render SeasonPicker before using it");x(this,Rt,"seats"),p(this,It)?.remove(),x(this,It,null),await w(this,y,kp).call(this,p(this,Z))}}async holdSameSeat(e,t,i){if(w(this,y,Pt).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 s of e)p(this,G).types.set(s,i[s]||"adult");if(p(this,G).typeRefusal=null,p(this,G).queueOperation(t),p(this,W).selectObjectsWithoutConfirmation([...e]),w(this,y,X).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await p(this,W).handleCta(!0,!1),!p(this,K))throw p(this,G).typeRefusal??new B("season_hold_not_created",409);return p(this,K)}async holdBestAvailable(e,t,i={}){if(w(this,y,Pt).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 s=p(this,W).maxTickets;if(e>s)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${s})`);if(p(this,yn))throw new B("season_best_available_in_progress",409);x(this,yn,!0);let o=null;try{if(o=p(this,G).queueBestAvailable(t,i),w(this,y,X).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await p(this,W).bestAvailableOrThrow(e,i.categoryKey,{zoneId:i.zoneId})||!p(this,K))throw new B("season_hold_not_created",409);return p(this,K)}catch(r){throw w(this,y,we).call(this,r,t)}finally{o&&p(this,G).clearBestAvailable(o),x(this,yn,!1)}}async restoreOperation(e){w(this,y,Pt).call(this),w(this,y,X).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await p(this,oe).waitForTerminal(e,void 0,p(this,ei).signal);return t.state==="aborted"||t.state==="expired"?(x(this,K,null),p(this,P).onHoldChange?.(null),w(this,y,X).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(p(this,G).remember(t),w(this,y,Ms).call(this,t,!1))}catch(t){throw w(this,y,we).call(this,t,e)}}async markBooked(){if(p(this,te))return!1;w(this,y,Pt).call(this);let e=p(this,K);if(!e)return!1;try{let{operation:t}=await p(this,oe).operation(e.operationId);return t.state!=="booked"?!1:(p(this,G).remember(t),w(this,y,Ms).call(this,t,!1),!0)}catch(t){throw w(this,y,we).call(this,t,e.operationId)}}async release(e){w(this,y,Pt).call(this);let t=p(this,K);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");p(this,G).queueRelease(e),w(this,y,X).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{p(this,W)?.getCurrentHold()?.holdId===t.holdId?await p(this,W).release():(await p(this,G).release("",[],t.holdId),w(this,y,Hs).call(this)),w(this,y,X).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(i){throw w(this,y,we).call(this,i,t.operationId)}}}async createRenewalIntent(e){if(w(this,y,Pt).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");w(this,y,X).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await p(this,oe).renewalIntent(e);return w(this,y,X).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),p(this,P).onRenewalIntent?.(t),t}catch(t){throw w(this,y,we).call(this,t)}}getDescriptor(){return p(this,Z)}getAvailability(){return p(this,Ot)}getHandoff(){return p(this,K)}getHeldOrder(){let e=p(this,K);if(!e)return null;let t=w(this,y,Zo).call(this);return{operationId:e.operationId,expiresAt:e.expiresAt,currency:w(this,y,Is).call(this),seats:t,totalMinor:w(this,y,Xo).call(this,t)}}destroy(){if(p(this,te))return;x(this,te,!0),p(this,ei).abort(),w(this,y,Os).call(this),p(this,W)?.destroy(),p(this,oe).destroy(),p(this,Lt).replaceChildren(),x(this,Ke,null),x(this,at,null),x(this,lt,null),x(this,Z,null),x(this,Ot,null),x(this,K,null),x(this,Re,null);let e=p(this,xn);x(this,xn,null),e?.()}close(){p(this,Re)?p(this,Re).call(this):this.destroy()}static async open(e){Fe();let t=zo.get(e.season)??null;zo.delete(e.season);let i=t&&t.expiresAt>Date.now()?t:null,s=!!e.buyerAccessToken||!!e.buyerAccessTokenProvider,o=ts(me("season.popupLabel"),Ie(void 0,e.theme)["--sl-bg"]),r;try{r=new er({...e,...i?.token&&!s?{buyerAccessToken:i.token}:{},container:o.frame})}catch(h){throw o.teardown(!1),h}x(r,Te,i),x(r,ot,!s),x(r,xn,()=>o.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,K);if(!h||h.expiresAt<=Date.now()){c();return}l=gp(o.frame,h.expiresAt,{keep:()=>{var u;w(u=r,y,qo).call(u,h),c()},release:()=>{r.release(`sra_${crypto.randomUUID()}`).catch(u=>e.onError?.(u)).finally(c)},lapsed:()=>{l=null,c()}},w(m=r,y,_s).call(m))};x(r,Re,d),x(r,ni,h=>{setTimeout(()=>{var m;a||l||(w(m=r,y,qo).call(m,h),c())},0)}),o.onScrimPress(d),o.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,te)||o.focusFirst(),r}};P=new WeakMap,Lt=new WeakMap,Mt=new WeakMap,oe=new WeakMap,G=new WeakMap,ot=new WeakMap,fn=new WeakMap,rt=new WeakMap,Ht=new WeakMap,Rt=new WeakMap,It=new WeakMap,Jn=new WeakMap,gn=new WeakMap,bn=new WeakMap,ei=new WeakMap,Z=new WeakMap,Ot=new WeakMap,K=new WeakMap,W=new WeakMap,Ke=new WeakMap,at=new WeakMap,lt=new WeakMap,Se=new WeakMap,_t=new WeakMap,te=new WeakMap,yn=new WeakMap,ct=new WeakMap,Dt=new WeakMap,vn=new WeakMap,dt=new WeakMap,pt=new WeakMap,ht=new WeakMap,wn=new WeakMap,ti=new WeakMap,Re=new WeakMap,xn=new WeakMap,Te=new WeakMap,ni=new WeakMap,y=new WeakSet,Go=function(){return p(this,ot)||!!p(this,P).buyerAccessTokenProvider&&!p(this,P).buyerAccessToken},Ls=function(e){let t=p(this,P),i={onExpired:o=>t.onAccessExpired?.(o),onUnavailable:o=>{let r=p(this,Dt)&&o.reason==="provider_failed"?p(this,Dt):o;x(this,Dt,null),x(this,vn,r.reason==="provider_failed"?null:r),t.onAccessUnavailable?.(r),w(this,y,Lp).call(this,r)}},s=t.buyerAccessTokenProvider;if(e&&!p(this,ot)&&s)x(this,ct,null),x(this,Mt,new pe({provider:o=>s({...o,planActivationId:e}),...i}));else if(p(this,ot)){let{access:o,loader:r}=vp({base:(t.apiBase??"https://api.seatlayer.io").replace(/\/$/,""),season:t.season,fetch:t.fetch,...e?{planActivationId:e}:{},onRefused:a=>{x(this,Dt,a)},accessHooks:i});x(this,Mt,o),x(this,ct,r)}else x(this,ct,null),x(this,Mt,new pe({token:t.buyerAccessToken,provider:t.buyerAccessTokenProvider,...i}));x(this,oe,new Es(t.season,{apiBase:t.apiBase,access:p(this,Mt),fetch:t.fetch,recoveryTimeoutMs:t.recoveryTimeoutMs})),x(this,G,new As(p(this,oe),Math.max(750,t.realtimePollMs??Gg),o=>w(this,y,_p).call(this,o),!!t.priceTypes?.some(o=>o!=="adult")))},Ko=async function(e,t){let i=p(this,oe).chart();p(this,G).primeChart(i),i.then(a=>{p(this,te)||e!==p(this,rt)||(x(this,gn,new Map((a.categories??[]).map(l=>[l.key,l.label||l.key]))),x(this,bn,a.theme??null),p(this,Rt)==="package"&&w(this,y,At).call(this))},()=>{});let[s,o,r]=await Promise.all([p(this,oe).descriptor(),p(this,oe).availability(),t!==void 0?Promise.resolve(t):p(this,oe).prices().catch(()=>null)]);return p(this,te)||e!==p(this,rt)?!1:(x(this,Z,s),x(this,Ht,s.planActivationId),x(this,Ot,o),x(this,dt,r),x(this,pt,p(this,P).checkout==="hosted"&&s.checkoutMode!=="server"&&r?"hosted":"handoff"),p(this,G).prime(s,o),!0)},At=function(){let e=p(this,Z);if(!p(this,at)||!e||p(this,te))return;x(this,Rt,"package");let t=p(this,Ht)??e.planActivationId,i=document.createElement("div");i.className="sl-picker sl-step-frame";let s=w(this,y,_s).call(this);for(let[r,a]of Object.entries(s))i.style.setProperty(r,a);let o=p(this,Re);if(o){let r=document.createElement("div");r.className="sl-head";let a=document.createElement("div");a.className="sl-logo",gi(a,[p(this,P).theme?.logoUrl,p(this,bn)?.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=Ps(e),l.append(c);let d=document.createElement("button");d.type="button",d.className="sl-close on",d.setAttribute("aria-label",me("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",()=>o()),r.append(a,l,d),i.append(r)}i.append(hp({descriptor:e,prices:p(this,dt),chosen:t,loading:t!==e.planActivationId,expanded:p(this,Jn),areas:p(this,gn),emailTickets:p(this,pt)==="hosted"||p(this,P).ticketsByEmail===!0,onSale:w(this,y,Ap).call(this,e),titled:!!o,title:Ps(e),locale:p(this,P).locale,money:r=>w(this,y,mn).call(this,r),choose:r=>{this.choosePackage(r).catch(a=>w(this,y,we).call(this,a))},expand:()=>{x(this,Jn,!0),w(this,y,At).call(this)},seats:()=>{this.chooseSeats().catch(r=>w(this,y,we).call(this,r))}})),p(this,It)?.remove(),p(this,at).append(i),x(this,It,i)},Uo=function(){let e=p(this,Ot)?.freeCount??0;w(this,y,X).call(this,{kind:"ready",message:`${e} seat${e===1?"":"s"} available for every included performance.`})},qo=function(e){let t=p(this,ct)?.session,i=p(this,G).seatsByHold.get(e.holdId),s=p(this,W)?.getCurrentHold(),o=s?.holdId===e.holdId?[...new Set((s.items??[]).map(a=>a.label))]:[],r=i??o.map(a=>({label:a,priceTypeKey:"adult"}));zo.set(p(this,P).season,{operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,seats:r,typedSeats:p(this,G).typesInPlay(r.map(a=>a.label)),token:t?{token:t.token,expiresAt:t.expiresAt}:p(this,Te)?.token??null})},kp=async function(e){p(this,Te)&&p(this,G).prepareResume(p(this,Te));let t=new et(ms({container:p(this,at),event:e.key,apiBase:p(this,P).apiBase,transport:p(this,G),hideEventDetails:!0,...p(this,Te)?{initialHoldId:p(this,Te).holdId}:{},maxSelection:p(this,P).maxSelection,selectedObjects:p(this,P).selectedObjects,selectableObjects:p(this,P).selectableObjects,numberOfPlacesToSelect:p(this,P).numberOfPlacesToSelect,selectionValidators:p(this,P).selectionValidators,locale:p(this,P).locale,messages:p(this,P).messages,languages:p(this,P).languages,colorblindSafe:p(this,P).colorblindSafe,initialView:p(this,P).initialView,enable3D:p(this,P).enable3D,max3DSeats:p(this,P).max3DSeats,enable3DCrowd:p(this,P).enable3DCrowd,touchNavigation3D:p(this,P).touchNavigation3D,hideBadge:p(this,P).hideBadge,theme:p(this,P).theme,confirmSelection:p(this,P).confirmSelection,seatView:p(this,P).seatView,onBuyerViewChange:p(this,P).onBuyerViewChange,onAnalytics:(i,s)=>{try{p(this,P).onAnalytics?.(i,{...s,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:je(e)})}catch{}},onSelectionChange:i=>{x(this,Se,i.map(s=>s.label)),x(this,_t,new Map(i.filter(s=>!!s.categoryKey).map(s=>[s.label,s.categoryKey]))),p(this,P).onSelectionChange?.(i)},onSelectionValidityChange:p(this,P).onSelectionValidityChange,onHoldChange:i=>{if(!i){w(this,y,Hs).call(this);return}let s=p(this,G).operationForHold(i.holdId);s&&w(this,y,Ms).call(this,s,!0)},onCheckout:()=>{var i;p(this,K)&&(p(this,P).onContinue?.(p(this,K)),p(this,pt)==="hosted"?w(this,y,Mp).call(this,p(this,K)):(i=p(this,ni))==null||i.call(this,p(this,K)))},onHoldExpired:()=>{w(this,y,Hs).call(this),w(this,y,X).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),p(this,P).onHoldExpired?.()},onError:i=>w(this,y,we).call(this,i)},{surface:"season",performanceCount:je(e),selectionMode:"same_seat",suppressPricing:!0,packagePricing:w(this,y,Rs).call(this)?w(this,y,Cp).call(this):null,modalClose:p(this,Re),subheader:w(this,y,Ip).call(this),brandLogoUrl:e.orgLogoUrl??null,brandAccent:e.orgAccent??null,nights:()=>w(this,y,Wo).call(this),seatMarks:()=>w(this,y,Tp).call(this),partialWords:{title:me("season.partlyFreeTitle"),advice:me("season.partlyFreeAdvice"),legend:me("season.partlyFreeLegend")},groupSelectionSummary:()=>{let i=p(this,Se).length;return i?{seats:i,performances:je(e),performancesChosen:je(e),perPerformance:i}:null},checkoutReady:i=>p(this,K)?.holdId===i}));x(this,W,t),await t.render()},Sp=function(){p(this,Lt).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection"),p(this,Re)&&(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,Lt).append(e),x(this,Ke,e),x(this,at,t),x(this,lt,i)},Wo=function(){let e=p(this,Z);if(!e)return[];let t=e.timezone?{timeZone:e.timezone}:{},i=s=>{if(s==null)return me("season.dateToBeAnnounced");try{return new Intl.DateTimeFormat(p(this,P).locale,{weekday:"short",day:"numeric",month:"short",...t}).format(new Date(s))}catch{return new Date(s).toDateString()}};return e.occurrences.filter(s=>s.past!==!0&&s.cancelled!==!0).map(s=>({eventKey:s.eventKey,name:s.name,shortDate:i(s.startsAt)}))},kn=new WeakMap,Tp=function(){let e=new Set(w(this,y,Wo).call(this).map(s=>s.eventKey)),t={};for(let s of p(this,kn))t[s]=null;p(this,kn).clear();let i=p(this,G).latestAvailability?.partial??{};if(e.size)for(let[s,o]of Object.entries(i)){let r=o.filter(a=>e.has(a));!r.length||r.length>=e.size||(t[s]={kind:"partial",fraction:(e.size-r.length)/e.size,data:{blockedEventKeys:r}},p(this,kn).add(s))}return t},Yo=function(e){let t=w(this,y,Rs).call(this)?.prices.find(i=>(i.priceTypeKey||"adult")===e);return v(`season.priceType.${e}`,t?.priceTypeLabel||e.charAt(0).toUpperCase()+e.slice(1))},Zo=function(){let e=w(this,y,Pp).call(this);return(p(this,W)?.seatPlaces(e)??e.map(i=>({label:i}))).map(i=>{let s=p(this,_t).get(i.label)??p(this,W)?.seatCategory(i.label)??null,o=p(this,G).types.get(i.label),r=p(this,G).typed||!!o&&o!=="adult";return{label:i.label,section:i.section||null,row:i.row||null,seat:i.seat||null,categoryKey:s,area:s?p(this,gn).get(s)??s:null,priceType:o||"adult",priceTypeName:r?w(this,y,Yo).call(this,o||"adult"):null,priceMinor:s?w(this,y,un).call(this,s,o):null}})},Ep=function(e,t){return e.map(i=>{let s=i.row&&i.seat?[i.section,`${v("picker.row","Row")} ${i.row}`,`${v("picker.seat","Seat")} ${i.seat}`].filter(Boolean).join(" \xB7 "):i.label,o=[i.area,i.priceTypeName].filter(Boolean).join(" \xB7 ");return{label:s,...o?{detail:o}:{},amount:i.priceMinor==null?null:$o(i.priceMinor,t)}})},Cp=function(){let e=p(this,G).types,t=[...new Set(p(this,P).priceTypes??["adult"])],i=a=>t.filter(l=>w(this,y,un).call(this,a,l)!=null),s=a=>w(this,y,Yo).call(this,a),o=(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=()=>Bo(p(this,Z)?je(p(this,Z)):0);return{seat:(a,l)=>{let c=o(a,l),d=w(this,y,un).call(this,l,c),h=p(this,G).typed?i(l):[];return{amountText:d==null?"":w(this,y,mn).call(this,d),types:h.length>1?{options:h.map(m=>({id:m,name:s(m)})),selected:c}:null}},total:a=>{let l=0;for(let{label:c,categoryKey:d}of a){let h=w(this,y,un).call(this,d,o(c,d));if(h==null)return null;l+=h}return{amountText:w(this,y,mn).call(this,l),countText:`${jg("picker.seatCount",a.length)} \xB7 ${r()}`}},setType:(a,l)=>{t.includes(l)&&e.set(a,l)},seatCardPrice:a=>{let l=i(a),c=w(this,y,un).call(this,a,l.includes("adult")?"adult":l[0]);return c==null?null:{price:w(this,y,mn).call(this,c),note:r()}}}},Ms=function(e,t){if(e.state==="booked")return x(this,K,null),p(this,G).forget(e.holdId),p(this,W)?.notifyGroupSettled("booked"),w(this,y,X).call(this,{kind:"booked",message:`Your Season booking is complete for ${xp(je(p(this,Z)))}. No further checkout action is needed.`,operationId:e.operationId}),p(this,P).onHoldChange?.(null),null;if(e.state==="partial_terminal")return x(this,K,null),x(this,Se,[]),p(this,G).forget(e.holdId),p(this,W)?.notifyGroupSettled("lost"),w(this,y,X).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),p(this,P).onHoldChange?.(null),null;if(e.state!=="committed")return x(this,K,null),p(this,G).forget(e.holdId),p(this,W)?.notifyGroupSettled("lost"),w(this,y,X).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),p(this,P).onHoldChange?.(null),null;let i=op(p(this,Z),e,p(this,G).seatsByHold.get(e.holdId)),s=p(this,K)?.holdId!==i.holdId;return x(this,K,i),p(this,P).onHoldChange?.(i),w(this,y,X).call(this,{kind:"held",message:`Your seats are held for ${xp(je(p(this,Z)))}. Review and continue to checkout.`,operationId:e.operationId}),s&&t&&p(this,P).onHold?.(i),i},Ap=function(e){return e.salesState?e.salesState==="open":p(this,ct)?.session?!0:null},Hs=function(){x(this,K,null),x(this,Se,[]),p(this,P).onHoldChange?.(null)},Rs=function(){let e=p(this,Z)?.planActivationId;return p(this,dt)?.packages.find(t=>t.planActivationId===e)??null},un=function(e,t="adult"){let i=w(this,y,Rs).call(this)?.prices.find(s=>s.categoryKey===e&&(s.priceTypeKey||"adult")===t);return i?i.unitPrice:null},Pp=function(){return p(this,K)?.seats?.map(e=>e.label)??p(this,Se)},Xo=function(e){if(!e.length)return null;let t=0;for(let i of e){if(i.priceMinor==null)return null;t+=i.priceMinor}return t},Is=function(){return p(this,dt)?.currency??p(this,Z)?.currency??"USD"},mn=function(e,t=w(this,y,Is).call(this)){let i=$o(e,t),s=Number.isInteger(i);return wp(i,t,{locale:p(this,P).locale,fallback:(o,r)=>`${o} ${r}`,...s?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},Lp=function(e){let t=e.reason==="audience_not_public"?me("season.accessNotPublic"):e.reason==="sales_not_open"?me("season.accessSalesNotOpen"):e.reason==="origin_not_allowed"?me("season.accessOriginNotAllowed"):me("season.accessUnavailable");w(this,y,X).call(this,{kind:"failed",message:t})},Mp=async function(e){if(!p(this,wn)){x(this,wn,!0);try{let t=w(this,y,Is).call(this),i=w(this,y,Zo).call(this),s=w(this,y,Xo).call(this,i);if(s==null){w(this,y,X).call(this,{kind:"failed",message:me("season.checkoutNotPriced"),operationId:e.operationId});return}await w(this,y,Qo).call(this,{kind:"pay",provider:null,order:{holdId:e.operationId,expiresAt:e.expiresAt,currency:t,total:$o(s,t),labels:i.map(o=>o.label),lines:w(this,y,Ep).call(this,i,t)}})}finally{x(this,wn,!1)}}},Hp=function(){let e=p(this,P).returnUrl;if(p(this,ti)||!e||!p(this,Z))return;x(this,ti,!0);let t=p(this,pt)==="hosted"?Ug(e,p(this,Z).mode):"is not used: this picker takes no payment and hands the held seats to onContinue";t&&console.warn(`seatlayer: SeasonPicker returnUrl ${t}.`)},Rp=function(){if(p(this,pt)!=="hosted")return;let e=on(p(this,P).season);e?.outcome!=="success"||!e.orderId||w(this,y,Qo).call(this,{kind:"resume",orderId:e.orderId})},Qo=async function(e){let t;try{({mountCheckout:t}=await zt())}catch(a){p(this,P).onError?.(a),w(this,y,X).call(this,{kind:"failed",message:me("season.checkoutCouldNotBeOpened")});return}let i=p(this,W)?.root;if(p(this,te)||!i)return;w(this,y,Os).call(this);let s=p(this,Z)?.buyer,o=p(this,P).buyerEmail||s?.email||void 0,r=p(this,P).buyerName||s?.name||void 0;x(this,ht,t({root:i,state:e,eventKey:p(this,P).season,formatMoney:(a,l)=>wp(a,l,{locale:p(this,P).locale,fallback:(c,d)=>`${c} ${d}`,...Number.isInteger(a)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:a=>p(this,oe).checkout({operationId:a.holdId,buyerEmail:a.buyerEmail,...a.buyerName?{buyerName:a.buyerName}:{},...p(this,P).returnUrl?{returnUrl:p(this,P).returnUrl}:{}}),orderStatus:a=>p(this,oe).orderStatus(a),...o||r?{buyer:{email:o,name:r}}:{},onCancel:()=>{x(this,ht,null),w(this,y,Xn).call(this)},onConfirmed:a=>{p(this,P).onOrderConfirmed?.(a),w(this,y,X).call(this,{kind:"booked",message:me("season.orderConfirmed")})},onError:a=>p(this,P).onError?.(a)})),w(this,y,Xn).call(this)},Os=function(){p(this,ht)?.destroy(),x(this,ht,null),w(this,y,Xn).call(this)},Ip=function(){let e=document.createElement("div");return e.className="sl-season-strip",x(this,fn,e),w(this,y,Xn).call(this),e},Xn=function(){let e=p(this,fn),t=p(this,Z);!e||!t||e.replaceChildren(...mp({step:p(this,ht)?"pay":"seats",pkg:p(this,dt)?.packages.find(i=>i.planActivationId===t.planActivationId)??null,dates:je(t),money:i=>w(this,y,mn).call(this,i),change:()=>w(this,y,Op).call(this)}))},Op=function(){let e=p(this,K);if(!e){w(this,y,Jo).call(this);return}if(!p(this,Ke))return;let t=e.seats?.map(s=>s.label)??p(this,Se),i=p(this,W)?.seatPlaces(t)??t.map(s=>({label:s}));yp(p(this,Ke),bp(i),{keep:()=>{},change:()=>{this.release(`sra_${crypto.randomUUID()}`).then(()=>w(this,y,Jo).call(this),s=>w(this,y,we).call(this,s))}},w(this,y,_s).call(this))},_s=function(){return Ie(p(this,bn)??void 0,p(this,P).theme,void 0,p(this,Z)?.orgAccent)},Jo=function(){p(this,te)||(w(this,y,Os).call(this),p(this,W)?.destroy(),x(this,W,null),x(this,fn,null),x(this,Se,[]),p(this,_t).clear(),w(this,y,At).call(this))},X=function(e,t=!1){p(this,lt)&&(p(this,lt).textContent=e.message,p(this,lt).dataset.kind=e.kind),p(this,Ke)&&(p(this,Ke).dataset.busy=String(t)),p(this,P).onStatusChange?.(e)},we=function(e,t){if(p(this,te)||e instanceof B&&e.code==="season_api_destroyed")return e;let i=e instanceof ee&&e.reason==="provider_failed"&&p(this,vn)?new ee(p(this,vn)):e;return i instanceof ee?(p(this,P).onError?.(i),i):(w(this,y,X).call(this,{kind:"failed",message:Cs(i),operationId:t}),p(this,P).onError?.(i),i)},_p=function(e){p(this,te)||(e instanceof ee||w(this,y,X).call(this,{kind:"failed",message:me("season.sessionEnded")}),p(this,P).onError?.(e))},Qn=function(){if(p(this,te))throw new Error("seatlayer: SeasonPicker was destroyed")},Pt=function(){if(w(this,y,Qn).call(this),!p(this,Z)||!p(this,W))throw new Error("seatlayer: render SeasonPicker before using it")};var jo=er;function xp(n){return n===1?"1 date":`all ${n} dates`}function Wg(n,e={}){let t=e.origin??"";if(!t)try{t=new URL(n.src,window.location.href).origin}catch{t=""}let i=!1,s=null,o=null,r=null,a="",l=null,c="",d=()=>{if(i)return;i=!0,s=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;o=u.style.overflow,u.style.overflow="hidden",document.body&&(r=document.body.style.overflow,document.body.style.overflow="hidden"),l=b=>{b.key==="Escape"&&h()},window.addEventListener("keydown",l)},h=()=>{i&&(i=!1,s===null?n.removeAttribute("style"):n.setAttribute("style",s),s=null,a&&(n.style.height=a),o!==null&&(document.documentElement.style.overflow=o,o=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 b=u.data;if(b.type==="seatlayer:height"){typeof b.px=="number"&&Number.isFinite(b.px)&&b.px>0&&(a=`${Math.round(b.px)}px`,i||(n.style.height=a));return}b.type==="seatlayer:fullscreen"&&(typeof b.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(b.background)&&(c=b.background,i&&(n.style.background=c)),b.on===!0?d():b.on===!1&&h())};return window.addEventListener("message",m),()=>{window.removeEventListener("message",m),h()}}export{j as ApiError,pe as BuyerAccessContext,ee as BuyerAccessUnavailableError,_e as BuyerRealtimeClient,ro as EmbeddedDesigner,ie as PerformanceGroupDestroyedError,Oo as PerformanceGroupPicker,cl as SEATING_CHART_CALLBACK_PROPS,rl as SEATING_CHART_HANDLE_METHODS,al as SEATING_CHART_IDENTITY_PROPS,ll as SEATING_CHART_VALUE_PROPS,B as SeasonApiError,jo as SeasonPicker,Kn as SeasonPublicSessionRefused,Gn as SeasonRecoveryTimeoutError,et as SeatPicker,so as SeatingChart,Wg as attachPickerFrame,Xu as bindSeatingChartHandle,Qu as buildSeatingChartOptions,Rn as createBuyerAccessContext,Tn as createControllerSink,co as parseTicketOfferAvailability,ig as prewarmSeatPicker,$n as shortOperationReference,xl as ticketOfferPrices};