@seatlayer/js 0.71.4 → 0.71.5
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.cjs +40 -14
- package/dist/index.d.cts +58 -32
- package/dist/index.d.ts +58 -32
- package/dist/index.js +39 -13
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var To=Object.create;var Ut=Object.defineProperty;var Co=Object.getOwnPropertyDescriptor;var Eo=Object.getOwnPropertyNames;var Po=Object.getPrototypeOf,Ao=Object.prototype.hasOwnProperty;var Er=r=>{throw TypeError(r)};var Mo=(r,e,t)=>()=>{if(t)throw t[0];try{return r&&(e=r(r=0)),e}catch(i){throw t=[i],i}};var Pr=(r,e)=>{for(var t in e)Ut(r,t,{get:e[t],enumerable:!0})},Ar=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Eo(e))!Ao.call(r,n)&&n!==t&&Ut(r,n,{get:()=>e[n],enumerable:!(i=Co(e,n))||i.enumerable});return r};var Mr=(r,e,t)=>(t=r!=null?To(Po(r)):{},Ar(e||!r||!r.__esModule?Ut(t,"default",{value:r,enumerable:!0}):t,r)),Lo=r=>Ar(Ut({},"__esModule",{value:!0}),r);var _i=(r,e,t)=>e.has(r)||Er("Cannot "+t);var k=(r,e,t)=>(_i(r,e,"read from private field"),t?t.call(r):e.get(r)),D=(r,e,t)=>e.has(r)?Er("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),M=(r,e,t,i)=>(_i(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),H=(r,e,t)=>(_i(r,e,"access private method"),t);var nn={};Pr(nn,{errorCopy:()=>Ui,mountCheckout:()=>da,unavailableCopy:()=>rn});function oa(r,e){try{window.sessionStorage.setItem(sa,JSON.stringify({orderId:r,...e?{eventKey:e}:{},storedAt:Date.now()}))}catch{}}function la(){if(typeof document>"u"||document.getElementById(tn))return;let r=document.createElement("style");r.id=tn,r.textContent=aa,document.head.appendChild(r)}function rn(r,e){let t=`${e} ${e===1?"seat is":"seats are"} held for a limited time.`;return r==="payments_off_for_event"?{title:"This event isn\u2019t sold online",body:`${t} The organiser isn\u2019t taking payment for this event here.`,detail:"Nothing has been charged. Check where you found this event for how to get tickets."}:r==="unavailable_for_event"?{title:"This event isn\u2019t taking payment yet",body:`${t} Online payment is not switched on for this event.`,detail:"Nothing has been charged. If you were sent here to pay, let the organiser know \u2014 only they can turn payment on for this event."}:{title:"Finish in the ticketing checkout",body:`${t} Payment for this event is taken elsewhere.`,detail:"Nothing has been charged. Continue in the checkout on this page to pay for your seats."}}function Ui(r){switch(r){case"gateway_not_connected":case"payments_not_enabled_for_event":return"This event is not taking online payments. Contact the organiser to buy these seats.";case"provider_mismatch":return"This event\u2019s payment setup changed while you were choosing. Nothing was charged \u2014 please try again.";case"hold_not_active":case"hold_not_found":return"Your seats were released before checkout started. Nothing was charged \u2014 please pick again.";case"checkout_already_started":return"A payment for these seats is already in progress. Finish that one, or wait for it to time out before starting again.";case"event_closed":return"Sales for this event have closed.";case"insufficient_hosted_credits":return"Ticket sales are temporarily paused while the organiser updates their SeatLayer balance. Nothing was charged \u2014 please try again later or contact the organiser.";case"gateway_currency_mismatch":case"unsupported_currency":case"mixed_currency_hold":case"price_unusable":return"These seats cannot be checked out right now because of a pricing configuration problem. Nothing was charged \u2014 please contact the organiser.";case"rate_limited":return"Too many attempts. Wait a moment and try again.";default:return"We could not start the payment. Nothing was charged \u2014 please try again."}}function ca(){let r=window.Razorpay;return r?Promise.resolve(r):new Promise((e,t)=>{let i=document.querySelector(`script[src="${en}"]`),n=i??document.createElement("script"),s=()=>{let o=window.Razorpay;o?e(o):t(new Error("razorpay_unavailable"))};n.addEventListener("load",s,{once:!0}),n.addEventListener("error",()=>t(new Error("razorpay_script_failed")),{once:!0}),!i&&(n.src=en,n.async=!0,document.head.appendChild(n))})}function _(r,e,t){let i=document.createElement(r);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function da(r){la();let e=!0,t=!1,i=_("div","sl-hco");i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true");let n=_("div","sl-hco-card");i.appendChild(n);let s=()=>{e=!1,i.remove(),document.removeEventListener("keydown",a,!0)},o=()=>{s(),r.onCancel()};function a(B){B.key!=="Escape"||!i.isConnected||(B.stopPropagation(),B.preventDefault(),o())}document.addEventListener("keydown",a,!0);let l=_("h2","sl-hco-title","Checkout"),c=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`;l.id=c,i.setAttribute("aria-labelledby",c);let d=(...B)=>{n.replaceChildren(l,...B)},h=B=>{if(!e)return;let j=_("p","sl-hco-status sl-hco-error",B);j.setAttribute("role","alert");let P=_("button","sl-hco-back","Back to seats");P.type="button",P.addEventListener("click",o),d(j,P)},p=B=>{if(!e)return;let j=_("p","sl-hco-status",B);j.setAttribute("role","status"),d(j)},u=async B=>{p("Payment received \u2014 confirming your seats\u2026");let j=Date.now()+9e4;for(;e&&Date.now()<j;){try{let P=await r.orderStatus(B);if(!e)return;if(P.status==="confirmed"){t=!0,l.textContent="Your tickets are confirmed";let We=_("p","sl-hco-status",`${P.seatCount} ${P.seatCount===1?"seat":"seats"} confirmed. Your tickets \u2014 with their door QR codes \u2014 are in your email.`),Be=_("dl","sl-hco-receipt"),yt=(P.tickets??[]).map(Ye=>Ye.label);yt.length&&Be.append(_("dt",void 0,"Seats"),_("dd",void 0,yt.join(", "))),Be.append(_("dt",void 0,"Paid"),_("dd",void 0,`${P.amountFormatted} ${P.currency}`),_("dt",void 0,"Order"),_("dd","sl-hco-ref",P.orderId));let Kt=_("button","sl-hco-back","Close");if(Kt.type="button",Kt.addEventListener("click",o),P.ticketUrl){let Ye=_("a","sl-hco-tickets","View tickets & QR codes");Ye.href=P.ticketUrl,Ye.target="_blank",Ye.rel="noreferrer",d(We,Be,Ye,Kt)}else d(We,Be,Kt);r.onConfirmed(P);return}if(P.status==="failed"||P.status==="expired"){h(P.status==="expired"?"Your seats were released before payment completed. Nothing was charged \u2014 please pick again.":"The payment did not complete. If you were charged, it has been refunded automatically.");return}}catch{}await new Promise(P=>setTimeout(P,2e3))}!e||t||h("Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly \u2014 you do not need to pay again.")};if(r.state.kind==="unavailable"){let B=rn(r.state.reason,r.state.seatCount);l.textContent=B.title;let j=_("p","sl-hco-label","Seats held"),P=_("button","sl-hco-back","Back to seat map");return P.type="button",P.addEventListener("click",o),n.replaceChildren(j,l,_("p","sl-hco-status",B.body),_("p","sl-hco-note",B.detail),P),r.root.appendChild(i),P.focus(),{destroy:s}}if(r.state.kind==="resume")return r.root.appendChild(i),u(r.state.orderId),{destroy:s};let{order:b,provider:m}=r.state,v=_("div","sl-hco-summary"),x=_("div","sl-hco-seats");for(let B of b.labels)x.appendChild(_("span","sl-hco-seat",B));let T=r.formatMoney(b.total,b.currency),A=_("div","sl-hco-total");A.append(_("span",void 0,"Total"),_("strong",void 0,T)),v.append(x,A);let f=_("form","sl-hco-form"),y=_("label","sl-hco-label","Email \u2014 your tickets go here"),S=_("input","sl-hco-input");S.type="email",S.required=!0,S.autocomplete="email",S.placeholder="you@example.com",S.id=`${c}-email`,y.htmlFor=S.id;let L=_("label","sl-hco-label","Name (optional)"),E=_("input","sl-hco-input");E.type="text",E.autocomplete="name",E.placeholder="Your name",E.id=`${c}-name`,L.htmlFor=E.id;let O=_("button","sl-hco-pay",`Pay ${T}`);O.type="submit",O.disabled=!0;let V=_("button","sl-hco-back","Back to seats");V.type="button",V.addEventListener("click",o);let he=new Date(b.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),le=_("p","sl-hco-note",`Your seats are held until ${he}. Payment is handled by ${m==="razorpay"?"Razorpay":"Stripe"} \u2014 we never see your card details.`),re=_("p","sl-hco-note");re.append("The event organizer and SeatLayer use your email to issue and manage your tickets. ");let ne=_("a",void 0,"Privacy Policy");ne.href="https://seatlayer.io/privacy/",ne.target="_blank",ne.rel="noreferrer",re.appendChild(ne);let F=()=>/.+@.+\..+/.test(S.value.trim());S.addEventListener("input",()=>{O.disabled=!F()});let qe=async()=>{p("Opening secure payment\u2026");try{let B=await r.startSession({holdId:b.holdId,buyerEmail:S.value.trim(),...E.value.trim()?{buyerName:E.value.trim()}:{}});if(!e)return;if(B.redirectUrl){oa(B.orderId,r.eventKey),p("Taking you to secure payment\u2026"),window.location.assign(B.redirectUrl);return}if(B.clientPayload){let j=B.clientPayload,P=await ca();if(!e)return;p("Waiting for payment\u2026"),new P({key:j.key,order_id:j.orderId,amount:j.amount,currency:j.currency,name:j.name,prefill:j.prefill,handler:()=>{u(B.orderId)},modal:{ondismiss:()=>{e&&vt()}}}).open();return}h(Ui("gateway_unavailable"))}catch(B){r.onError?.(B),h(Ui(B?.code))}};f.addEventListener("submit",B=>{B.preventDefault(),F()&&qe()}),f.append(y,S,L,E,re,O,V,le);let vt=()=>{l.textContent="Checkout",d(v,f),O.disabled=!F()};return vt(),r.root.appendChild(i),S.focus(),{destroy:s}}var en,tn,sa,aa,sn=Mo(()=>{"use strict";en="https://checkout.razorpay.com/v1/checkout.js",tn="seatlayer-checkout-style",sa="@seatlayer/pending-checkout/v1";aa=`
|
|
2
2
|
/* The card is centred, but max-height:100% lets a long form reach the bottom
|
|
3
3
|
edge \u2014 and on the hosted buyer page that edge is the phone's edge, with the
|
|
4
4
|
Pay button last in the scroll. Reserve the home-indicator gutter here too.
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
.sl-hco-tickets{display:block;width:100%;margin-top:14px;padding:12px;font:inherit;font-size:15px;
|
|
39
39
|
font-weight:650;text-align:center;text-decoration:none;color:var(--sl-accent-ink);
|
|
40
40
|
background:var(--sl-accent);border-radius:calc(var(--sl-radius) * .55)}
|
|
41
|
-
`});var jl={};Tr(jl,{ApiError:()=>z,BuyerAccessContext:()=>ce,BuyerAccessUnavailableError:()=>oe,BuyerRealtimeClient:()=>ue,EmbeddedDesigner:()=>hi,PerformanceGroupDestroyedError:()=>G,PerformanceGroupPicker:()=>Ai,SEATING_CHART_CALLBACK_PROPS:()=>Qi,SEATING_CHART_HANDLE_METHODS:()=>qi,SEATING_CHART_IDENTITY_PROPS:()=>Wi,SEATING_CHART_VALUE_PROPS:()=>Yi,SeasonApiError:()=>pe,SeasonPicker:()=>Hi,SeasonRecoveryTimeoutError:()=>Dt,SeatPicker:()=>pt,SeatingChart:()=>pi,attachPickerFrame:()=>yo,bindSeatingChartHandle:()=>yn,buildSeatingChartOptions:()=>xn,createBuyerAccessContext:()=>et,createControllerSink:()=>Ye,parseTicketOfferAvailability:()=>ui,shortOperationReference:()=>ut,ticketOfferPrices:()=>mi});module.exports=Eo(jl);var $=require("@seatlayer/core");var $e="seatlayer.v1";function Po(r){let e=typeof r.default=="string"?r.default:"free",t={};if(r.seats&&typeof r.seats=="object")for(let[i,n]of Object.entries(r.seats))typeof n=="string"&&n!==e&&(t[i]=n);return{default:e,exceptions:t}}function Ao(r,e){if(!r||r.default!==e.default)return null;let t=[];for(let[i,n]of Object.entries(e.exceptions))r.exceptions[i]!==n&&t.push({label:i,status:n});for(let i of Object.keys(r.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function Mo(r,e){for(let t of e)t.status===r.default?delete r.exceptions[t.label]:r.exceptions[t.label]=t.status}function Pr(r){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(r))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(r))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var ue=class{constructor(e){this.ws=null;this.stopped=!0;this.attempt=0;this.reconnectTimer=null;this.pingTimer=null;this.pongTimer=null;this.resumeTimer=null;this.projection=null;this.version=null;this.v1=!1;this.useQueryMarker=!1;this.hidden=null;this.closedSections=null;this.opts=e,Pr(e.url)}get protocol(){return this.ws?this.v1?"v1":"legacy":null}get snapshotVersion(){return this.version}start(){this.stopped&&(this.stopped=!1,this.connect())}stop(){this.stopped=!0,this.clearTimers();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.start()}async connect(){if(this.stopped)return;let e=[$e];if(this.opts.mintTicket){let s;try{s=await this.opts.mintTicket()}catch(o){this.reportIfAccessError(o),this.scheduleReconnect();return}if(this.stopped)return;s?.protocols?.length?(e=[...s.protocols],e.includes($e)||e.unshift($e)):s?.ticket&&(e=[$e,`tkt.${s.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let i=this.useQueryMarker?`${this.opts.url}${this.opts.url.includes("?")?"&":"?"}pv=1`:this.opts.url;Pr(i);let n;try{n=(this.opts.socketFactory??((o,a)=>new WebSocket(o,a)))(i,e)}catch{this.scheduleReconnect();return}this.ws=n,n.onopen=()=>{this.ws===n&&(this.attempt=0,this.v1=n.protocol===$e,this.v1||(this.useQueryMarker=!0),this.startKeepalive(n),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},5e3):this.opts.sink.resync())},n.onmessage=s=>{if(this.ws!==n)return;let o;try{o=JSON.parse(typeof s.data=="string"?s.data:"")}catch{return}!o||typeof o!="object"||this.handleFrame(o)},n.onclose=s=>{if(this.ws===n){if(this.ws=null,this.clearTimers(),s?.code===4401){this.stopped=!0,this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},n.onerror=()=>{try{n.close()}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(Array.isArray(e.hidden)||Array.isArray(e.closed)){let i=Array.isArray(e.hidden)?e.hidden:[],n=Array.isArray(e.closed)?e.closed:[],s=i.join("\0"),o=n.join("\0");(s!==this.hidden||o!==this.closedSections)&&(this.hidden=s,this.closedSections=o,this.opts.sink.onSections?.(i,n))}if(t!=="hidden"){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=Po(e),n=Ao(this.projection,i);this.projection=i,n===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():n.length&&this.opts.sink.applyStatuses(n);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(n=>typeof n?.label=="string"&&typeof n?.status=="string").map(n=>({label:n.label,status:n.status}));if(!i.length)return;this.projection&&Mo(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.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}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{}},1e4)}},25e3)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,15e3),i=Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}clearPongTimer(){this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null)}clearTimers(){this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null,this.clearPongTimer(),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.resumeTimer&&clearTimeout(this.resumeTimer),this.resumeTimer=null}};function Lo(r){return r==="blocked"?"not_for_sale":r==="held"||r==="booked"||r==="free"||r==="not_for_sale"?r:"free"}function Ye(r,e={}){let t=i=>{let n=r.tableSelection(i);if(n)return n.physicalSeatIds;let s=r.idForLabel(i);return s?[s]:[]};return{applyStatuses(i){let n=r.currentHold()?.labels??[],s={free:[],held:[],booked:[],not_for_sale:[]},o=[],a=[],l=new Map(r.getSelection().map(c=>[c.label,c.id]));for(let c of i){let d=t(c.label);if(!d.length)continue;let h=Lo(c.status);if(s[h].push(...d),e.flashOnLiveChange&&h!=="free"&&!n.includes(c.label)&&d.some(p=>r.getStatus(p)==="free")){let p=h==="held"?"#f4b740":"#f43f5e";for(let u of d)o.push({id:u,color:p})}h!=="free"&&!n.includes(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])s[c].length&&r.setStatus(s[c],c);for(let c of o)r.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(h=>t(h));c.length&&r.deselect(c);let d=i.some(h=>h.status==="blocked"&&a.includes(h.label));e.onSelectedObjectUnavailable?.(a,d?"ineligible":"taken")}e.onStatusChange?.()},async resync(){await r.refresh()},onSections(i,n){r.refresh(),e.onSections?.(i,n)}}}var z=class extends Error{constructor(e,t,i,n,s,o){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=n,this.reason=s,this.retryAfterS=o}},Ar=10,Mr=1;function Kt(r,e){let t=(r??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let n=Date.parse(t);if(Number.isFinite(n))return Math.max(0,Math.ceil((n-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var Ho={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},Te=class{constructor(e,t={}){this.base=e;this.viewerId=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;this.access=t.access,this.onObjectUnavailable=t.onObjectUnavailable;let i=t.referral?.trim();this.referral=i?i.slice(0,120):void 0}get accessScoped(){return!!this.access?.configured}async request(e,t={},i={}){let n=t.method??"GET",s={},o;t.body!==void 0&&(s["Content-Type"]="application/json",o=JSON.stringify(t.body));let a=await this.access?.authorization(i.auth?"unauthorized":"initial");a&&(s.Authorization=a);let l=await fetch(`${this.base}${e}`,{method:n,headers:s,body:o,credentials:"omit"}),d=(l.headers.get("content-type")??"").includes("application/json")?await l.json().catch(()=>null):null;if(!l.ok){let h=d,p=h?.code??h?.error;if(this.access?.configured&&(l.status===401||l.status===403||l.status===422)&&await this.access.handleFailure(l.status,p)&&!i.auth)return this.request(e,t,{...i,auth:!0});if(l.status===409){let b=p?Ho[p]:void 0,m=h?.conflicts?.map(v=>v.label)??t.labels??[];b&&this.onObjectUnavailable?.({labels:m,reason:b,code:p})}let u;if(l.status===429&&(u=Kt(l.headers.get("Retry-After"),h?.retryAfterSeconds)??Mr,n==="GET"&&!i.rateLimit&&u<=Ar))return await new Promise(b=>setTimeout(b,u*1e3)),this.request(e,t,{...i,rateLimit:!0});throw new z(l.status,h?.error??`request_failed_${l.status}`,p,h?.conflicts,h?.reason,u)}return d}async requestBlob(e,t={}){let i={},n=await this.access?.authorization(t.auth?"unauthorized":"initial");n&&(i.Authorization=n);let s=await fetch(`${this.base}${e}`,{method:"GET",headers:i,credentials:"omit"});if(s.ok)return s.blob();let a=(s.headers.get("content-type")??"").includes("application/json")?await s.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(s.status===401||s.status===403||s.status===422)&&await this.access.handleFailure(s.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(s.status===429&&(c=Kt(s.headers.get("Retry-After"),a?.retryAfterSeconds)??Mr,!t.rateLimit&&c<=Ar))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new z(s.status,a?.error??`request_failed_${s.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new z(404,"not_found","not_found"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,i,n){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...n?{replaceHoldId:n}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(s=>s.label)})}bestAvailable(e,t,i,n,s){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...n?{zoneId:n}:{},...s?{ttlMs:s}:{},...this.referral?{referral:this.referral}:{}}})}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}})}release(e,t,i){return this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:i}})}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${t?"?live=1":""}`)}startCheckout(e,t){return 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}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[$e]}createRealtime(e,t){return this.accessScoped?null:new ue({url:this.subscribeUrl(e),sink:t})}};var oe=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}},Ro=new Set(["buyer_access_expired"]),Oo=new Set(["paused","provider_failed","channel_denied"]);function Io(r,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";default:break}return r===401?"invalid":null}function _o(r,e){return r===401&&!!e&&Ro.has(e)}var Do=3e4,X,Z,Xe,Ze,vt,Ce,be,Je,yt,xt,wt,ze,J,Oi,Ut,Qe,ce=class{constructor(e){D(this,J);D(this,X,null);D(this,Z,0);D(this,Xe,null);D(this,Ze);D(this,vt);D(this,Ce,null);D(this,be,null);D(this,Je,null);D(this,yt);D(this,xt);D(this,wt,!1);D(this,ze);if(L(this,Ze,e.provider),L(this,vt,e.skewMs??Do),L(this,yt,e.onExpired),L(this,xt,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;H(this,J,Oi).call(this,t)}L(this,wt,!!k(this,Ze)||!!k(this,X))}get configured(){return k(this,wt)}onRenewed(e){L(this,ze,e)}get unavailable(){return k(this,be)}get hasToken(){return!!k(this,X)&&(k(this,Z)===0||k(this,Z)>Date.now())}get expiresAt(){return k(this,Z)}async authorization(e="initial"){if(!this.configured)return null;if(k(this,be))throw new oe(k(this,be));let t=Date.now();if(!k(this,X)||k(this,Z)>0&&k(this,Z)-k(this,vt)<=t){let n=!!k(this,X)&&k(this,Z)>0&&k(this,Z)<=t,s=k(this,X)?n?"expired":"expiring":e,o=await H(this,J,Ut).call(this,s);if(!o)throw new oe(k(this,be)??k(this,Je)??H(this,J,Qe).call(this,"provider_failed"));return`Bearer ${o}`}return`Bearer ${k(this,X)}`}async handleFailure(e,t){var n;if(!this.configured)return!1;if(_o(e,t)){L(this,X,null),L(this,Z,0);let s=await H(this,J,Ut).call(this,"unauthorized",t);return(n=k(this,yt))==null||n.call(this,{reason:"unauthorized",code:t,refreshed:!!s}),!!s}let i=Io(e,t);return i&&H(this,J,Qe).call(this,i,t,e),!1}async refresh(e="manual"){return L(this,be,null),L(this,Je,null),L(this,X,null),L(this,Z,0),!!await H(this,J,Ut).call(this,e)}clear(){L(this,X,null),L(this,Xe,null),L(this,Z,0),L(this,Ce,null),L(this,ze,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};X=new WeakMap,Z=new WeakMap,Xe=new WeakMap,Ze=new WeakMap,vt=new WeakMap,Ce=new WeakMap,be=new WeakMap,Je=new WeakMap,yt=new WeakMap,xt=new WeakMap,wt=new WeakMap,ze=new WeakMap,J=new WeakSet,Oi=function(e){return!e||typeof e.token!="string"||!e.token?null:(L(this,Xe,e.token),L(this,X,e.token),L(this,Z,typeof e.expiresAt=="number"?e.expiresAt:0),k(this,X))},Ut=function(e,t){if(k(this,Ce))return k(this,Ce);let i=k(this,Ze);if(!i)return H(this,J,Qe).call(this,"no_token",t),Promise.resolve(null);let n=k(this,Xe),s=(async()=>{try{let o=await i({reason:e}),a=H(this,J,Oi).call(this,o);if(!a)return H(this,J,Qe).call(this,"provider_failed",t),null;if(n&&n!==a&&k(this,ze))try{await k(this,ze).call(this,{previousToken:n,token:a,reason:e})}catch{}return a}catch{return H(this,J,Qe).call(this,"provider_failed",t),null}finally{L(this,Ce,null)}})();return L(this,Ce,s),s},Qe=function(e,t,i){var s;let n={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"};return L(this,Je,n),Oo.has(e)||(L(this,be,n),L(this,X,null),L(this,Z,0)),(s=k(this,xt))==null||s.call(this,n),n};function et(r,e={}){return!r.buyerAccessTokenProvider&&!r.buyerAccessToken?null:new ce({provider:r.buyerAccessTokenProvider,token:r.buyerAccessToken,...e})}var Bo=3e4;function $o(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;let e=r;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"}var Ii=class{constructor(e,t,i){this.base=e;this.event=t;this.publicKey=i;this.value=null;this.inflight=null}async load(e=!1){if(e&&(this.value=null),this.value&&this.value.expiresAt-Bo>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let i=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit"}),n=await i.json().catch(()=>null);if(!i.ok){let s=i.status===429?Kt(i.headers.get("Retry-After"),n?.retryAfterSeconds):void 0;throw new z(i.status,n?.error??`request_failed_${i.status}`,n?.code??n?.error,void 0,void 0,s)}if(!$o(n))throw new z(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=n,n})();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}}},_i=class extends Te{constructor(t,i,n,s,o){super(t,{...o,access:s});this.event=i;this.loader=n;this.bootstrapAccess=s;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1}assertEvent(t){if(t!==this.event)throw new z(404,"not_found","not_found")}async bundle(t){return this.assertEvent(t),await this.bootstrapAccess.authorization("initial"),this.loader.load()}async chart(t){if(this.assertEvent(t),this.initialChartDelivered)return super.chart(t);let i=await this.bundle(t);return this.initialChartDelivered=!0,{event:i.event,doc:i.doc,chartDelivery:i.chartDelivery}}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}};function qt(r){let e=new Ii(r.base,r.event,r.publicKey),t=new ce({provider:({reason:i})=>e.token(i),...r.accessHooks});return{access:t,api:new _i(r.base,r.event,e,t,r.apiOptions??{})}}var K=require("@seatlayer/core");var U={enter:260,exit:180,spring:320,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 zo=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${U.enter}ms;--sl-dur-exit:${U.exit}ms;--sl-dur-spring:${U.spring}ms;--sl-dur-stagger:${U.stagger}ms;--sl-dur-xfade:${U.crossfade}ms;--sl-dur-collapse:${U.collapse}ms;--sl-dur-rung:${U.rung}ms;--sl-ease-enter:${U.easeEnter};--sl-ease-exit:${U.easeExit};--sl-ease-spring:${U.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,Vo=`@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-stagger:0ms;--sl-dur-collapse:0ms;--sl-dur-rung:0ms;--sl-dur-xfade:${U.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:${U.reducedFade}ms;animation-delay:0ms}.sl-mo-hint,.sl-mo-rotate-in,.sl-mo-fly,.sl-mo-collapse{animation:none}.sl-mo-indicator{transition:none}}`,Lr=zo+`
|
|
41
|
+
`});var Wl={};Pr(Wl,{ApiError:()=>N,BuyerAccessContext:()=>ce,BuyerAccessUnavailableError:()=>oe,BuyerRealtimeClient:()=>ue,EmbeddedDesigner:()=>mi,PerformanceGroupDestroyedError:()=>G,PerformanceGroupPicker:()=>Hi,SEATING_CHART_CALLBACK_PROPS:()=>Ji,SEATING_CHART_HANDLE_METHODS:()=>Qi,SEATING_CHART_IDENTITY_PROPS:()=>Xi,SEATING_CHART_VALUE_PROPS:()=>Zi,SeasonApiError:()=>pe,SeasonPicker:()=>Ii,SeasonRecoveryTimeoutError:()=>$t,SeatPicker:()=>ut,SeatingChart:()=>ui,attachPickerFrame:()=>So,bindSeatingChartHandle:()=>kn,buildSeatingChartOptions:()=>Sn,createBuyerAccessContext:()=>tt,createControllerSink:()=>Qe,parseTicketOfferAvailability:()=>fi,shortOperationReference:()=>ft,ticketOfferPrices:()=>gi});module.exports=Lo(Wl);var $=require("@seatlayer/core");var $e="seatlayer.v1";function Ho(r){let e=typeof r.default=="string"?r.default:"free",t={};if(r.seats&&typeof r.seats=="object")for(let[i,n]of Object.entries(r.seats))typeof n=="string"&&n!==e&&(t[i]=n);return{default:e,exceptions:t}}function Ro(r,e){if(!r||r.default!==e.default)return null;let t=[];for(let[i,n]of Object.entries(e.exceptions))r.exceptions[i]!==n&&t.push({label:i,status:n});for(let i of Object.keys(r.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function Oo(r,e){for(let t of e)t.status===r.default?delete r.exceptions[t.label]:r.exceptions[t.label]=t.status}function Lr(r){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(r))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(r))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var ue=class{constructor(e){this.ws=null;this.stopped=!0;this.attempt=0;this.reconnectTimer=null;this.pingTimer=null;this.pongTimer=null;this.resumeTimer=null;this.projection=null;this.version=null;this.v1=!1;this.useQueryMarker=!1;this.hidden=null;this.closedSections=null;this.opts=e,Lr(e.url)}get protocol(){return this.ws?this.v1?"v1":"legacy":null}get snapshotVersion(){return this.version}start(){this.stopped&&(this.stopped=!1,this.connect())}stop(){this.stopped=!0,this.clearTimers();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.start()}async connect(){if(this.stopped)return;let e=[$e];if(this.opts.mintTicket){let s;try{s=await this.opts.mintTicket()}catch(o){this.reportIfAccessError(o),this.scheduleReconnect();return}if(this.stopped)return;s?.protocols?.length?(e=[...s.protocols],e.includes($e)||e.unshift($e)):s?.ticket&&(e=[$e,`tkt.${s.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let i=this.useQueryMarker?`${this.opts.url}${this.opts.url.includes("?")?"&":"?"}pv=1`:this.opts.url;Lr(i);let n;try{n=(this.opts.socketFactory??((o,a)=>new WebSocket(o,a)))(i,e)}catch{this.scheduleReconnect();return}this.ws=n,n.onopen=()=>{this.ws===n&&(this.attempt=0,this.v1=n.protocol===$e,this.v1||(this.useQueryMarker=!0),this.startKeepalive(n),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},5e3):this.opts.sink.resync())},n.onmessage=s=>{if(this.ws!==n)return;let o;try{o=JSON.parse(typeof s.data=="string"?s.data:"")}catch{return}!o||typeof o!="object"||this.handleFrame(o)},n.onclose=s=>{if(this.ws===n){if(this.ws=null,this.clearTimers(),s?.code===4401){this.stopped=!0,this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},n.onerror=()=>{try{n.close()}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(Array.isArray(e.hidden)||Array.isArray(e.closed)){let i=Array.isArray(e.hidden)?e.hidden:[],n=Array.isArray(e.closed)?e.closed:[],s=i.join("\0"),o=n.join("\0");(s!==this.hidden||o!==this.closedSections)&&(this.hidden=s,this.closedSections=o,this.opts.sink.onSections?.(i,n))}if(t!=="hidden"){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=Ho(e),n=Ro(this.projection,i);this.projection=i,n===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():n.length&&this.opts.sink.applyStatuses(n);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(n=>typeof n?.label=="string"&&typeof n?.status=="string").map(n=>({label:n.label,status:n.status}));if(!i.length)return;this.projection&&Oo(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.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}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{}},1e4)}},25e3)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,15e3),i=Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},i)}clearPongTimer(){this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null)}clearTimers(){this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null,this.clearPongTimer(),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.resumeTimer&&clearTimeout(this.resumeTimer),this.resumeTimer=null}};function Io(r){return r==="blocked"?"not_for_sale":r==="held"||r==="booked"||r==="free"||r==="not_for_sale"?r:"free"}function Qe(r,e={}){let t=i=>{let n=r.tableSelection(i);if(n)return n.physicalSeatIds;let s=r.idForLabel(i);return s?[s]:[]};return{applyStatuses(i){let n=r.currentHold()?.labels??[],s={free:[],held:[],booked:[],not_for_sale:[]},o=[],a=[],l=new Map(r.getSelection().map(c=>[c.label,c.id]));for(let c of i){let d=t(c.label);if(!d.length)continue;let h=Io(c.status);if(s[h].push(...d),e.flashOnLiveChange&&h!=="free"&&!n.includes(c.label)&&d.some(p=>r.getStatus(p)==="free")){let p=h==="held"?"#f4b740":"#f43f5e";for(let u of d)o.push({id:u,color:p})}h!=="free"&&!n.includes(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])s[c].length&&r.setStatus(s[c],c);for(let c of o)r.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(h=>t(h));c.length&&r.deselect(c);let d=i.some(h=>h.status==="blocked"&&a.includes(h.label));e.onSelectedObjectUnavailable?.(a,d?"ineligible":"taken")}e.onStatusChange?.()},async resync(){await r.refresh()},onSections(i,n){r.refresh(),e.onSections?.(i,n)}}}var N=class extends Error{constructor(e,t,i,n,s,o){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=n,this.reason=s,this.retryAfterS=o}},Hr=10,Rr=1;function qt(r,e){let t=(r??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let n=Date.parse(t);if(Number.isFinite(n))return Math.max(0,Math.ceil((n-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var _o={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},Te=class{constructor(e,t={}){this.base=e;this.viewerId=typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`;this.access=t.access,this.onObjectUnavailable=t.onObjectUnavailable;let i=t.referral?.trim();this.referral=i?i.slice(0,120):void 0}get accessScoped(){return!!this.access?.configured}async request(e,t={},i={}){let n=t.method??"GET",s={},o;t.body!==void 0&&(s["Content-Type"]="application/json",o=JSON.stringify(t.body));let a=await this.access?.authorization(i.auth?"unauthorized":"initial");a&&(s.Authorization=a);let l=await fetch(`${this.base}${e}`,{method:n,headers:s,body:o,credentials:"omit"}),d=(l.headers.get("content-type")??"").includes("application/json")?await l.json().catch(()=>null):null;if(!l.ok){let h=d,p=h?.code??h?.error;if(this.access?.configured&&(l.status===401||l.status===403||l.status===422)&&await this.access.handleFailure(l.status,p)&&!i.auth)return this.request(e,t,{...i,auth:!0});if(l.status===409){let b=p?_o[p]:void 0,m=h?.conflicts?.map(v=>v.label)??t.labels??[];b&&this.onObjectUnavailable?.({labels:m,reason:b,code:p})}let u;if(l.status===429&&(u=qt(l.headers.get("Retry-After"),h?.retryAfterSeconds)??Rr,n==="GET"&&!i.rateLimit&&u<=Hr))return await new Promise(b=>setTimeout(b,u*1e3)),this.request(e,t,{...i,rateLimit:!0});throw new N(l.status,h?.error??`request_failed_${l.status}`,p,h?.conflicts,h?.reason,u)}return d}async requestBlob(e,t={}){let i={},n=await this.access?.authorization(t.auth?"unauthorized":"initial");n&&(i.Authorization=n);let s=await fetch(`${this.base}${e}`,{method:"GET",headers:i,credentials:"omit"});if(s.ok)return s.blob();let a=(s.headers.get("content-type")??"").includes("application/json")?await s.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(s.status===401||s.status===403||s.status===422)&&await this.access.handleFailure(s.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(s.status===429&&(c=qt(s.headers.get("Retry-After"),a?.retryAfterSeconds)??Rr,!t.rateLimit&&c<=Hr))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new N(s.status,a?.error??`request_failed_${s.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new N(404,"not_found","not_found"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,i,n){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...n?{replaceHoldId:n}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(s=>s.label)})}bestAvailable(e,t,i,n,s){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...n?{zoneId:n}:{},...s?{ttlMs:s}:{},...this.referral?{referral:this.referral}:{}}})}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}})}release(e,t,i){return this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:i}})}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${t?"?live=1":""}`)}startCheckout(e,t){return 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}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[$e]}createRealtime(e,t){return this.accessScoped?null:new ue({url:this.subscribeUrl(e),sink:t})}};var oe=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}},Do=new Set(["buyer_access_expired"]),Bo=new Set(["paused","provider_failed","channel_denied"]);function $o(r,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";default:break}return r===401?"invalid":null}function No(r,e){return r===401&&!!e&&Do.has(e)}var zo=3e4,X,Z,Ze,Je,xt,Ce,be,et,wt,kt,St,Ne,J,Di,Wt,Xe,ce=class{constructor(e){D(this,J);D(this,X,null);D(this,Z,0);D(this,Ze,null);D(this,Je);D(this,xt);D(this,Ce,null);D(this,be,null);D(this,et,null);D(this,wt);D(this,kt);D(this,St,!1);D(this,Ne);if(M(this,Je,e.provider),M(this,xt,e.skewMs??zo),M(this,wt,e.onExpired),M(this,kt,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;H(this,J,Di).call(this,t)}M(this,St,!!k(this,Je)||!!k(this,X))}get configured(){return k(this,St)}onRenewed(e){M(this,Ne,e)}get unavailable(){return k(this,be)}get hasToken(){return!!k(this,X)&&(k(this,Z)===0||k(this,Z)>Date.now())}get expiresAt(){return k(this,Z)}async authorization(e="initial"){if(!this.configured)return null;if(k(this,be))throw new oe(k(this,be));let t=Date.now();if(!k(this,X)||k(this,Z)>0&&k(this,Z)-k(this,xt)<=t){let n=!!k(this,X)&&k(this,Z)>0&&k(this,Z)<=t,s=k(this,X)?n?"expired":"expiring":e,o=await H(this,J,Wt).call(this,s);if(!o)throw new oe(k(this,be)??k(this,et)??H(this,J,Xe).call(this,"provider_failed"));return`Bearer ${o}`}return`Bearer ${k(this,X)}`}async handleFailure(e,t){var n;if(!this.configured)return!1;if(No(e,t)){M(this,X,null),M(this,Z,0);let s=await H(this,J,Wt).call(this,"unauthorized",t);return(n=k(this,wt))==null||n.call(this,{reason:"unauthorized",code:t,refreshed:!!s}),!!s}let i=$o(e,t);return i&&H(this,J,Xe).call(this,i,t,e),!1}async refresh(e="manual"){return M(this,be,null),M(this,et,null),M(this,X,null),M(this,Z,0),!!await H(this,J,Wt).call(this,e)}clear(){M(this,X,null),M(this,Ze,null),M(this,Z,0),M(this,Ce,null),M(this,Ne,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};X=new WeakMap,Z=new WeakMap,Ze=new WeakMap,Je=new WeakMap,xt=new WeakMap,Ce=new WeakMap,be=new WeakMap,et=new WeakMap,wt=new WeakMap,kt=new WeakMap,St=new WeakMap,Ne=new WeakMap,J=new WeakSet,Di=function(e){return!e||typeof e.token!="string"||!e.token?null:(M(this,Ze,e.token),M(this,X,e.token),M(this,Z,typeof e.expiresAt=="number"?e.expiresAt:0),k(this,X))},Wt=function(e,t){if(k(this,Ce))return k(this,Ce);let i=k(this,Je);if(!i)return H(this,J,Xe).call(this,"no_token",t),Promise.resolve(null);let n=k(this,Ze),s=(async()=>{try{let o=await i({reason:e}),a=H(this,J,Di).call(this,o);if(!a)return H(this,J,Xe).call(this,"provider_failed",t),null;if(n&&n!==a&&k(this,Ne))try{await k(this,Ne).call(this,{previousToken:n,token:a,reason:e})}catch{}return a}catch{return H(this,J,Xe).call(this,"provider_failed",t),null}finally{M(this,Ce,null)}})();return M(this,Ce,s),s},Xe=function(e,t,i){var s;let n={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"};return M(this,et,n),Bo.has(e)||(M(this,be,n),M(this,X,null),M(this,Z,0)),(s=k(this,kt))==null||s.call(this,n),n};function tt(r,e={}){return!r.buyerAccessTokenProvider&&!r.buyerAccessToken?null:new ce({provider:r.buyerAccessTokenProvider,token:r.buyerAccessToken,...e})}var Vo=3e4;function Fo(r){if(!r||typeof r!="object"||Array.isArray(r))return!1;let e=r;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"}var Bi=class{constructor(e,t,i){this.base=e;this.event=t;this.publicKey=i;this.value=null;this.inflight=null}async load(e=!1){if(e&&(this.value=null),this.value&&this.value.expiresAt-Vo>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let i=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit"}),n=await i.json().catch(()=>null);if(!i.ok){let s=i.status===429?qt(i.headers.get("Retry-After"),n?.retryAfterSeconds):void 0;throw new N(i.status,n?.error??`request_failed_${i.status}`,n?.code??n?.error,void 0,void 0,s)}if(!Fo(n))throw new N(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=n,n})();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}}},$i=class extends Te{constructor(t,i,n,s,o){super(t,{...o,access:s});this.event=i;this.loader=n;this.bootstrapAccess=s;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1}assertEvent(t){if(t!==this.event)throw new N(404,"not_found","not_found")}async bundle(t){return this.assertEvent(t),await this.bootstrapAccess.authorization("initial"),this.loader.load()}async chart(t){if(this.assertEvent(t),this.initialChartDelivered)return super.chart(t);let i=await this.bundle(t);return this.initialChartDelivered=!0,{event:i.event,doc:i.doc,chartDelivery:i.chartDelivery}}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}};function Yt(r){let e=new Bi(r.base,r.event,r.publicKey),t=new ce({provider:({reason:i})=>e.token(i),...r.accessHooks});return{access:t,api:new $i(r.base,r.event,e,t,r.apiOptions??{})}}var K=require("@seatlayer/core");var U={enter:260,exit:180,spring:320,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 jo=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${U.enter}ms;--sl-dur-exit:${U.exit}ms;--sl-dur-spring:${U.spring}ms;--sl-dur-stagger:${U.stagger}ms;--sl-dur-xfade:${U.crossfade}ms;--sl-dur-collapse:${U.collapse}ms;--sl-dur-rung:${U.rung}ms;--sl-ease-enter:${U.easeEnter};--sl-ease-exit:${U.easeExit};--sl-ease-spring:${U.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,Go=`@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-stagger:0ms;--sl-dur-collapse:0ms;--sl-dur-rung:0ms;--sl-dur-xfade:${U.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:${U.reducedFade}ms;animation-delay:0ms}.sl-mo-hint,.sl-mo-rotate-in,.sl-mo-fly,.sl-mo-collapse{animation:none}.sl-mo-indicator{transition:none}}`,Or=jo+`
|
|
42
42
|
/* Anchored open/close. The translate is 8px TOWARD the anchor, which is what
|
|
43
43
|
makes the card look attached to the seat rather than dropped on the map. */
|
|
44
44
|
.sl-mo-in{transform-origin:var(--sl-mo-ox) var(--sl-mo-oy);
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
@keyframes slMoZoom{from{opacity:0;transform:scale(1.02)}to{opacity:1;transform:none}}
|
|
106
106
|
.sl-mo-rotate-in{animation:slMoSpin var(--sl-dur-spring) var(--sl-ease-spring) 1 both}
|
|
107
107
|
@keyframes slMoSpin{from{opacity:0;transform:rotate(-140deg) scale(.8)}to{opacity:1;transform:none}}
|
|
108
|
-
`+Vo;function Hr(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function Di(r,e){if(!e){r.style.removeProperty("--sl-mo-ox"),r.style.removeProperty("--sl-mo-oy");return}Wt(r,e,r.getBoundingClientRect())}function Wt(r,e,t){let i=t.width||1,n=t.height||1,s=o=>Math.max(0,Math.min(100,o));r.style.setProperty("--sl-mo-ox",`${s((e.x-t.left)/i*100).toFixed(1)}%`),r.style.setProperty("--sl-mo-oy",`${s((e.y-t.top)/n*100).toFixed(1)}%`)}function Rr(r,e,t){let i=r.getBoundingClientRect(),n=t.getBoundingClientRect();Wt(r,e,{left:i.left-n.left,top:i.top-n.top,width:i.width,height:i.height})}function Yt(r,e){r.classList.remove("sl-mo-out"),e!==void 0&&Di(r,e),r.classList.remove("sl-mo-in"),r.offsetWidth,r.classList.add("sl-mo-in")}function Or(r){r.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(r.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function Ee(r,e,t={className:"sl-mo-out",duration:U.exit}){let i=()=>{n||(n=!0,window.clearTimeout(s),r.removeEventListener("animationend",i),e?e():r.remove())},n=!1;r.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),r.classList.add(t.className),r.addEventListener("animationend",i);let s=window.setTimeout(i,Hr()?0:t.duration+60)}var Ir={className:"sl-mo-slide-down",duration:U.exit};function Bi(r,e){r.textContent!==e&&(r.textContent=e,r.classList.remove("sl-mo-xfade"),r.offsetWidth,r.classList.add("sl-mo-xfade"))}function _r(r){if(Hr())return r.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=r.label??"",e.style.left=`${r.from.x}px`,e.style.top=`${r.from.y}px`,e.style.background=r.color??"var(--sl-accent,#6e7bff)",e.style.color=r.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(r.to.x-r.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(r.to.y-r.from.y)}px`),document.body.appendChild(e);let t=!1,i=()=>{t||(t=!0,window.clearTimeout(n),e.remove(),r.onArrive?.())};e.addEventListener("animationend",i);let n=window.setTimeout(i,U.spring+80);return e}var F=r=>String(r??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e]);function tt(r,e){let t=0;for(let i of r.get(e)?.values()??[])t+=i;return t}function Dr(r){let e=[];for(let[t,i]of r)for(let[n,s]of i)s>0&&e.push({areaId:t,tierId:n,qty:s});return e}function Br(r){let e=new Map;for(let t of r.keys())e.set(t,tt(r,t));return e}function kt(r,e,t,i){let n=r.get(e)??new Map;i>0?n.set(t,i):n.delete(t),n.size?r.set(e,n):r.delete(e)}function $r(r){let e=new Map;for(let t of r)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function Ve(r,e){let t=$r(e),i=0;for(let n of r.keys())i+=Math.max(0,tt(r,n)-(t.get(n)??0));return i}function zr(r,e,t){let i=$r(t),n=0;for(let s of e){let o=r.gaQty.get(s.id);if(!o)continue;let a=i.get(s.id)??0;for(let[l,c]of o){let d=Math.max(0,c-a);a=Math.max(0,a-c),n+=d*r.paidPrice(s.categoryKey,l,Fo(s,l),s.id)}}return n}function Fo(r,e){return e?r.tiers?.find(t=>t.id===e)?.price??r.price:r.price}function Vr(r){let e=[],t=new Map;for(let i of r){if(i.objectType!=="ga"||!i.objectId){e.push({...i,labels:[i.label]});continue}let n=`${i.objectId}\0${i.tierId??""}`,s=t.get(n);if(s){s.quantity=(s.quantity??0)+(i.quantity??1),s.labels.push(i.label);continue}let o={...i,quantity:i.quantity??1,labels:[i.label]};t.set(n,o),e.push(o)}return e}function Fr(r,e,t){let i=new Set(t);for(let n of e)n.objectType==="ga"&&n.objectId&&i.has(n.label)&&kt(r,n.objectId,n.tierId??null,0)}function zi(r,e){if(r.objectType!=="ga")return r.label;let t=e.find(i=>i.id===r.objectId);return t?.displayLabel??t?.label??r.label}function No(r){let e=new Map;for(let t of r){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 Qt(r){let e=r.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:r.displayType??(0,K.t)("picker.generalAdmission"),price:r.price}]}function Nr(r,e){let t=r.totalTicketCount()-tt(r.gaQty,e.id);return Math.max(0,Math.min(e.available,r.maxTickets-t))}function Vi(r,e,t,i){if(ve(r,!1),r.salesClosed){r.toast(r.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let n=Qt(e),s=r.gaQty.get(e.id),o=tt(r.gaQty,e.id)>0,a=Nr(r,e);if(a<=0&&!o){r.toast(e.available>0?(0,K.t)("picker.maxTicketsForOrder",{count:r.maxTickets}):r.tf("picker.soldOutTitle","Sold out"),"warning");return}if(r.onGAPromptHook){let p={};for(let[b,m]of s??[])p[b??""]=m;if(r.onGAPromptHook({area:e,selected:p,min:0,max:a,tiers:n,confirm:b=>{Uo(r,e,n,b,a)},cancel:()=>ve(r)})===!0)return}let l=new Map;for(let p of n)l.set(p.id,s?.get(p.id)??0);!o&&a>0&&l.set(n[0].id,1);let c={area:e,tiers:n,draft:l,max:a,reopened:o},d=r.root?.dataset.layout==="narrow",h=document.createElement("div");h.className=d?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",h.innerHTML=jo(r,c,d),r.root?.appendChild(h),r.gaPromptEl=h,r.gaPromptReturnFocus=i??document.activeElement,d||qo(r,h,t),r.reducedMotion()&&(h.dataset.motion="reduced"),Gr(r,c),Go(r,h,c),requestAnimationFrame(()=>h.querySelector('[data-ga-step="1"]')?.focus())}function jo(r,e,t){let{area:i,tiers:n}=e,s=n.length>1,o=i.displayLabel??i.label,a=n.map(l=>`<div class="sl-ga-prompt-row" data-ga-tier="${F(l.id??"")}"><div class="sl-ga-prompt-label"><span>${F(s?l.label:r.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${F(r.money(r.paidPrice(i.categoryKey,l.id,l.price,i.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${F(s?l.label:o)}"><button type="button" data-ga-step="-1" aria-label="${F(r.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${F(r.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="${F((0,K.t)("picker.gaChooseForArea",{area:o}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${F(i.displayType??r.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${F(o)}</h2><p class="sl-ga-prompt-sub" data-ga-sub></p><button type="button" class="sl-ga-prompt-close" data-ga-cancel aria-label="${F((0,K.t)("common.close"))}">\xD7</button></div><div class="sl-ga-prompt-body">${a}`+(n.length>1?`<div class="sl-ga-prompt-total"><span>${F(r.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>${F(r.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${F((0,K.t)("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function Fi(r){let e=0;for(let t of r.draft.values())e+=t;return e}function jr(r,e){let t=0;for(let i of e.tiers)t+=(e.draft.get(i.id)??0)*r.paidPrice(e.area.categoryKey,i.id,i.price,e.area.id);return t}function Gr(r,e){let t=r.gaPromptEl;if(!t)return;let i=Fi(e),n=jr(r,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let d=c.dataset.gaTier?c.dataset.gaTier:null,h=e.draft.get(d)??0,p=c.querySelector("[data-ga-qty]");p&&(p.value=String(h)),c.querySelectorAll("[data-ga-step]").forEach(u=>{u.disabled=Number(u.dataset.gaStep)<0?h<=0:i>=e.max})});let s=t.querySelector("[data-ga-sub]");s&&(s.textContent=`${r.money(r.paidPrice(e.area.categoryKey,e.tiers[0].id,e.tiers[0].price,e.area.id))} \xB7 ${(0,K.tCount)("picker.leftCount",e.area.available)}`);let o=t.querySelector("[data-ga-total]");o&&(o.textContent=r.money(n));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=i>=e.max&&e.max>0?e.area.available<=e.max?(0,K.tCount)("picker.leftCount",e.area.available):(0,K.t)("picker.maxTicketsForOrder",{count:r.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");l&&(l.textContent=e.reopened?(0,K.tCount)("picker.gaUpdate",i,{count:i}):(0,K.tCount)("picker.gaAdd",i,{count:i,price:r.money(n)}),l.disabled=i<=0&&!e.reopened)}function Go(r,e,t){e.querySelectorAll("[data-ga-step]").forEach(i=>{i.addEventListener("click",()=>{let n=i.closest("[data-ga-tier]");if(!n)return;let s=n.dataset.gaTier?n.dataset.gaTier:null,o=Number(i.dataset.gaStep),a=t.draft.get(s)??0,l=t.max-Fi(t);t.draft.set(s,Math.max(0,a+(o>0?Math.min(1,l):-1))),Gr(r,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(i=>i.addEventListener("click",()=>ve(r))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{r.gaQty.delete(t.area.id),ve(r),r.syncTray(),$i(r,(0,K.t)("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{Ko(r,t)}),e.addEventListener("mousedown",i=>{i.target===e&&ve(r)}),e.addEventListener("keydown",i=>{if(i.key==="Escape"){i.stopPropagation(),ve(r);return}if(i.key!=="Tab")return;let n=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!n.length)return;let s=n[0],o=n[n.length-1];i.shiftKey&&document.activeElement===s?(i.preventDefault(),o.focus()):!i.shiftKey&&document.activeElement===o&&(i.preventDefault(),s.focus())})}function Ko(r,e){let t=Fi(e),i=jr(r,e);for(let s of e.tiers)kt(r.gaQty,e.area.id,s.id,e.draft.get(s.id)??0);ve(r),r.syncTray();let n=e.area.displayLabel??e.area.label;t>0?$i(r,(0,K.tCount)("picker.gaAdded",t,{count:t,area:n,price:r.money(i)})):$i(r,(0,K.t)("picker.gaRemoved",{area:n}))}function Uo(r,e,t,i,n){if(typeof i=="number")kt(r.gaQty,e.id,t[0].id,Math.max(0,Math.min(n,Math.floor(i))));else{r.gaQty.delete(e.id);let s=n;for(let o of t){let a=Math.max(0,Math.floor(i[o.id??""]??0)),l=Math.min(a,s);s-=l,kt(r.gaQty,e.id,o.id,l)}}r.syncTray()}function ve(r,e=!0){let t=r.gaPromptReturnFocus;r.gaPromptEl&&Ee(r.gaPromptEl),r.gaPromptEl=null,r.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:r.root)?.focus())}function qo(r,e,t){let i=r.root,n=e.querySelector(".sl-ga-pop");if(!i||!n||!t)return;let s=i.getBoundingClientRect(),o=t.x-s.left,a=t.y-s.top;e.style.setProperty("--sl-ga-anchor-x",`${o}px`),e.style.setProperty("--sl-ga-anchor-y",`${a}px`),requestAnimationFrame(()=>{let l=n.offsetWidth||260,c=n.offsetHeight||220,d=Math.max(8,Math.min(s.width-l-8,o-l/2)),h=a-c-14,p=h>=8?h:Math.min(s.height-c-8,a+14);n.style.left=`${d}px`,n.style.top=`${Math.max(8,p)}px`,n.dataset.side=h>=8?"above":"below",n.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(l-12,o-d))}px`)})}function $i(r,e){r.srEl&&(r.srEl.textContent=e)}function Kr(r,e,t=[]){let i=[],n=No(t);for(let o of e){let a=r.gaQty.get(o.id);if(!a)continue;let l=Qt(o);for(let c of l){let d=(a.get(c.id)??0)-(n.get(`${o.id}\0${c.id??""}`)??0);if(d<=0)continue;let h=r.paidPrice(o.categoryKey,c.id,c.price,o.id);i.push(`<div class="sl-ga" data-ga="${F(o.id)}" data-ga-row-tier="${F(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${F(o.displayLabel??o.label)}</div><div class="sl-ga-sub">${F(l.length>1?c.label:o.displayType??r.tf("picker.generalAdmission","General admission"))} \xB7 ${F(r.money(h))} \xB7 ${F((0,K.tCount)("picker.leftCount",o.available))}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${F(r.tf("picker.fewer","Fewer"))}">\u2212</button><span>${d}</span><button type="button" data-d="1" aria-label="${F(r.tf("picker.more","More"))}">+</button></div></div>`)}}let s=e.filter(o=>tt(r.gaQty,o.id)<=0&&!t.some(a=>a.objectId===o.id));return s.length&&i.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${r.gaAreasExpanded}"><span>${F(r.tf("picker.gaAreasHeading","Areas"))}</span><small>${s.length}</small></button>`+(r.gaAreasExpanded?`<div class="sl-ga-areas-list">${s.map(o=>`<button type="button" class="sl-ga-area-open" data-ga-open="${F(o.id)}"${o.available<=0?" disabled":""}><span class="name">${F(o.displayLabel??o.label)}<small>${F(o.displayType??r.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${F(r.money(r.paidPrice(o.categoryKey,null,o.price,o.id)))} \xB7 ${F(o.available>0?(0,K.tCount)("picker.leftCount",o.available):r.tf("picker.soldOutTitle","Sold out"))}</span></button>`).join("")}</div>`:"")+"</div>"),i.join("")}function Ur(r,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(i=>{i.addEventListener("click",()=>{let n=i.closest(".sl-ga");if(!n?.dataset.ga)return;let s=t.find(c=>c.id===n.dataset.ga);if(!s)return;let o=n.dataset.gaRowTier?n.dataset.gaRowTier:null,a=Number(i.dataset.d),l=r.gaQty.get(s.id)?.get(o)??0;if(a>0&&Nr(r,s)-tt(r.gaQty,s.id)<=0){r.toast((0,K.t)("picker.maxTicketsForOrder",{count:r.maxTickets}),"warning");return}kt(r.gaQty,s.id,o,Math.max(0,l+a)),r.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{r.gaAreasExpanded=!r.gaAreasExpanded,r.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(i=>{i.addEventListener("click",()=>{let n=t.find(s=>s.id===i.dataset.gaOpen);n&&Vi(r,n,null,i)})})}var Xt='<svg viewBox="0 0 64 56" width="12" height="11" fill="none" aria-hidden="true" focusable="false" style="display:block"><path d="M4 13 Q16 6 29 7 L28.5 17 Q17 16.5 7 22 Z" fill="#f4b740"/><path d="M4 13 Q16 6 29 7 L28.5 17 Q17 16.5 7 22 Z" fill="#f4b740" transform="translate(64 0) scale(-1 1)"/><path d="M8 28 Q18 22 28.6 23 L28.2 32 Q18 28.5 10 36 Z" fill="#fcf7ee"/><path d="M8 28 Q18 22 28.6 23 L28.2 32 Q18 28.5 10 36 Z" fill="#fcf7ee" transform="translate(64 0) scale(-1 1)"/><path d="M11 41 Q19 35 28.2 36 L27.8 45 Q19.5 42 13.5 49 Z" fill="#fcf7ee"/><path d="M11 41 Q19 35 28.2 36 L27.8 45 Q19.5 42 13.5 49 Z" fill="#fcf7ee" transform="translate(64 0) scale(-1 1)"/></svg>';var Wo=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Yo=/[\s"'<>`\\]/;function Qo(r){return r.startsWith("//")?!1:r.startsWith("/")||r.startsWith("./")||r.startsWith("../")}function Xo(){try{let r=typeof location>"u"?"":location.origin;return r&&r!=="null"?r:null}catch{return null}}function it(r){if(typeof r!="string"||!r||r.length>2e6||r!==r.trim())return!1;if(r.startsWith("data:"))return Wo.test(r);if(Yo.test(r))return!1;let e=Xo();if(Qo(r)){if(!e)return!1;try{let t=new URL(r,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(r);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var Zo=/^[a-zA-Z0-9._-]+$/;function Ni(r){let e;try{e=new URL(r,"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]),n=decodeURIComponent(t[2]);return!i||!Zo.test(n)?null:{eventKey:i,asset:n}}catch{return null}}function Jo(r){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(r,"https://seatlayer.invalid").pathname)}catch{return!1}}var rt=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=Ni(e);if(!t)return Promise.resolve(Jo(e)||!it(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 n=this.load(this.eventKey,t.asset).then(s=>{let o=URL.createObjectURL(s);return this.disposed?(URL.revokeObjectURL(o),null):(this.created.add(o),o)}).catch(s=>{throw this.pending.delete(e),s});return this.pending.set(e,n),n}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var Fe=require("@seatlayer/core"),si=require("@seatlayer/core/view3d/crossfade/panorama");var qr=`
|
|
108
|
+
`+Go;function Ir(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function Ni(r,e){if(!e){r.style.removeProperty("--sl-mo-ox"),r.style.removeProperty("--sl-mo-oy");return}Qt(r,e,r.getBoundingClientRect())}function Qt(r,e,t){let i=t.width||1,n=t.height||1,s=o=>Math.max(0,Math.min(100,o));r.style.setProperty("--sl-mo-ox",`${s((e.x-t.left)/i*100).toFixed(1)}%`),r.style.setProperty("--sl-mo-oy",`${s((e.y-t.top)/n*100).toFixed(1)}%`)}function _r(r,e,t){let i=r.getBoundingClientRect(),n=t.getBoundingClientRect();Qt(r,e,{left:i.left-n.left,top:i.top-n.top,width:i.width,height:i.height})}function Xt(r,e){r.classList.remove("sl-mo-out"),e!==void 0&&Ni(r,e),r.classList.remove("sl-mo-in"),r.offsetWidth,r.classList.add("sl-mo-in")}function Dr(r){r.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(r.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function Ee(r,e,t={className:"sl-mo-out",duration:U.exit}){let i=()=>{n||(n=!0,window.clearTimeout(s),r.removeEventListener("animationend",i),e?e():r.remove())},n=!1;r.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),r.classList.add(t.className),r.addEventListener("animationend",i);let s=window.setTimeout(i,Ir()?0:t.duration+60)}var Br={className:"sl-mo-slide-down",duration:U.exit};function zi(r,e){r.textContent!==e&&(r.textContent=e,r.classList.remove("sl-mo-xfade"),r.offsetWidth,r.classList.add("sl-mo-xfade"))}function $r(r){if(Ir())return r.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=r.label??"",e.style.left=`${r.from.x}px`,e.style.top=`${r.from.y}px`,e.style.background=r.color??"var(--sl-accent,#6e7bff)",e.style.color=r.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(r.to.x-r.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(r.to.y-r.from.y)}px`),document.body.appendChild(e);let t=!1,i=()=>{t||(t=!0,window.clearTimeout(n),e.remove(),r.onArrive?.())};e.addEventListener("animationend",i);let n=window.setTimeout(i,U.spring+80);return e}var z=r=>String(r??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e]);function it(r,e){let t=0;for(let i of r.get(e)?.values()??[])t+=i;return t}function Nr(r){let e=[];for(let[t,i]of r)for(let[n,s]of i)s>0&&e.push({areaId:t,tierId:n,qty:s});return e}function zr(r){let e=new Map;for(let t of r.keys())e.set(t,it(r,t));return e}function Tt(r,e,t,i){let n=r.get(e)??new Map;i>0?n.set(t,i):n.delete(t),n.size?r.set(e,n):r.delete(e)}function Vr(r){let e=new Map;for(let t of r)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function ze(r,e){let t=Vr(e),i=0;for(let n of r.keys())i+=Math.max(0,it(r,n)-(t.get(n)??0));return i}function Fr(r,e,t){let i=Vr(t),n=0;for(let s of e){let o=r.gaQty.get(s.id);if(!o)continue;let a=i.get(s.id)??0;for(let[l,c]of o){let d=Math.max(0,c-a);a=Math.max(0,a-c),n+=d*r.paidPrice(s.categoryKey,l,Ko(s,l),s.id)}}return n}function Ko(r,e){return e?r.tiers?.find(t=>t.id===e)?.price??r.price:r.price}function jr(r){let e=[],t=new Map;for(let i of r){if(i.objectType!=="ga"||!i.objectId){e.push({...i,labels:[i.label]});continue}let n=`${i.objectId}\0${i.tierId??""}`,s=t.get(n);if(s){s.quantity=(s.quantity??0)+(i.quantity??1),s.labels.push(i.label);continue}let o={...i,quantity:i.quantity??1,labels:[i.label]};t.set(n,o),e.push(o)}return e}function Gr(r,e,t){let i=new Set(t);for(let n of e)n.objectType==="ga"&&n.objectId&&i.has(n.label)&&Tt(r,n.objectId,n.tierId??null,0)}function Fi(r,e){if(r.objectType!=="ga")return r.label;let t=e.find(i=>i.id===r.objectId);return t?.displayLabel??t?.label??r.label}function Uo(r){let e=new Map;for(let t of r){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 Zt(r){let e=r.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:r.displayType??(0,K.t)("picker.generalAdmission"),price:r.price}]}function Kr(r,e){let t=r.totalTicketCount()-it(r.gaQty,e.id);return Math.max(0,Math.min(e.available,r.maxTickets-t))}function ji(r,e,t,i){if(ve(r,!1),r.salesClosed){r.toast(r.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let n=Zt(e),s=r.gaQty.get(e.id),o=it(r.gaQty,e.id)>0,a=Kr(r,e);if(a<=0&&!o){r.toast(e.available>0?(0,K.t)("picker.maxTicketsForOrder",{count:r.maxTickets}):r.tf("picker.soldOutTitle","Sold out"),"warning");return}if(r.onGAPromptHook){let p={};for(let[b,m]of s??[])p[b??""]=m;if(r.onGAPromptHook({area:e,selected:p,min:0,max:a,tiers:n,confirm:b=>{Qo(r,e,n,b,a)},cancel:()=>ve(r)})===!0)return}let l=new Map;for(let p of n)l.set(p.id,s?.get(p.id)??0);!o&&a>0&&l.set(n[0].id,1);let c={area:e,tiers:n,draft:l,max:a,reopened:o},d=r.root?.dataset.layout==="narrow",h=document.createElement("div");h.className=d?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",h.innerHTML=qo(r,c,d),r.root?.appendChild(h),r.gaPromptEl=h,r.gaPromptReturnFocus=i??document.activeElement,d||Xo(r,h,t),r.reducedMotion()&&(h.dataset.motion="reduced"),qr(r,c),Wo(r,h,c),requestAnimationFrame(()=>h.querySelector('[data-ga-step="1"]')?.focus())}function qo(r,e,t){let{area:i,tiers:n}=e,s=n.length>1,o=i.displayLabel??i.label,a=n.map(l=>`<div class="sl-ga-prompt-row" data-ga-tier="${z(l.id??"")}"><div class="sl-ga-prompt-label"><span>${z(s?l.label:r.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${z(r.money(r.paidPrice(i.categoryKey,l.id,l.price,i.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${z(s?l.label:o)}"><button type="button" data-ga-step="-1" aria-label="${z(r.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(r.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((0,K.t)("picker.gaChooseForArea",{area:o}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${z(i.displayType??r.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${z(o)}</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((0,K.t)("common.close"))}">\xD7</button></div><div class="sl-ga-prompt-body">${a}`+(n.length>1?`<div class="sl-ga-prompt-total"><span>${z(r.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(r.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${z((0,K.t)("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function Gi(r){let e=0;for(let t of r.draft.values())e+=t;return e}function Ur(r,e){let t=0;for(let i of e.tiers)t+=(e.draft.get(i.id)??0)*r.paidPrice(e.area.categoryKey,i.id,i.price,e.area.id);return t}function qr(r,e){let t=r.gaPromptEl;if(!t)return;let i=Gi(e),n=Ur(r,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let d=c.dataset.gaTier?c.dataset.gaTier:null,h=e.draft.get(d)??0,p=c.querySelector("[data-ga-qty]");p&&(p.value=String(h)),c.querySelectorAll("[data-ga-step]").forEach(u=>{u.disabled=Number(u.dataset.gaStep)<0?h<=0:i>=e.max})});let s=t.querySelector("[data-ga-sub]");s&&(s.textContent=`${r.money(r.paidPrice(e.area.categoryKey,e.tiers[0].id,e.tiers[0].price,e.area.id))} \xB7 ${(0,K.tCount)("picker.leftCount",e.area.available)}`);let o=t.querySelector("[data-ga-total]");o&&(o.textContent=r.money(n));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=i>=e.max&&e.max>0?e.area.available<=e.max?(0,K.tCount)("picker.leftCount",e.area.available):(0,K.t)("picker.maxTicketsForOrder",{count:r.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");l&&(l.textContent=e.reopened?(0,K.tCount)("picker.gaUpdate",i,{count:i}):(0,K.tCount)("picker.gaAdd",i,{count:i,price:r.money(n)}),l.disabled=i<=0&&!e.reopened)}function Wo(r,e,t){e.querySelectorAll("[data-ga-step]").forEach(i=>{i.addEventListener("click",()=>{let n=i.closest("[data-ga-tier]");if(!n)return;let s=n.dataset.gaTier?n.dataset.gaTier:null,o=Number(i.dataset.gaStep),a=t.draft.get(s)??0,l=t.max-Gi(t);t.draft.set(s,Math.max(0,a+(o>0?Math.min(1,l):-1))),qr(r,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(i=>i.addEventListener("click",()=>ve(r))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{r.gaQty.delete(t.area.id),ve(r),r.syncTray(),Vi(r,(0,K.t)("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{Yo(r,t)}),e.addEventListener("mousedown",i=>{i.target===e&&ve(r)}),e.addEventListener("keydown",i=>{if(i.key==="Escape"){i.stopPropagation(),ve(r);return}if(i.key!=="Tab")return;let n=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!n.length)return;let s=n[0],o=n[n.length-1];i.shiftKey&&document.activeElement===s?(i.preventDefault(),o.focus()):!i.shiftKey&&document.activeElement===o&&(i.preventDefault(),s.focus())})}function Yo(r,e){let t=Gi(e),i=Ur(r,e);for(let s of e.tiers)Tt(r.gaQty,e.area.id,s.id,e.draft.get(s.id)??0);ve(r),r.syncTray();let n=e.area.displayLabel??e.area.label;t>0?Vi(r,(0,K.tCount)("picker.gaAdded",t,{count:t,area:n,price:r.money(i)})):Vi(r,(0,K.t)("picker.gaRemoved",{area:n}))}function Qo(r,e,t,i,n){if(typeof i=="number")Tt(r.gaQty,e.id,t[0].id,Math.max(0,Math.min(n,Math.floor(i))));else{r.gaQty.delete(e.id);let s=n;for(let o of t){let a=Math.max(0,Math.floor(i[o.id??""]??0)),l=Math.min(a,s);s-=l,Tt(r.gaQty,e.id,o.id,l)}}r.syncTray()}function ve(r,e=!0){let t=r.gaPromptReturnFocus;r.gaPromptEl&&Ee(r.gaPromptEl),r.gaPromptEl=null,r.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:r.root)?.focus())}function Xo(r,e,t){let i=r.root,n=e.querySelector(".sl-ga-pop");if(!i||!n||!t)return;let s=i.getBoundingClientRect(),o=t.x-s.left,a=t.y-s.top;e.style.setProperty("--sl-ga-anchor-x",`${o}px`),e.style.setProperty("--sl-ga-anchor-y",`${a}px`),requestAnimationFrame(()=>{let l=n.offsetWidth||260,c=n.offsetHeight||220,d=Math.max(8,Math.min(s.width-l-8,o-l/2)),h=a-c-14,p=h>=8?h:Math.min(s.height-c-8,a+14);n.style.left=`${d}px`,n.style.top=`${Math.max(8,p)}px`,n.dataset.side=h>=8?"above":"below",n.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(l-12,o-d))}px`)})}function Vi(r,e){r.srEl&&(r.srEl.textContent=e)}function Wr(r,e,t=[]){let i=[],n=Uo(t);for(let o of e){let a=r.gaQty.get(o.id);if(!a)continue;let l=Zt(o);for(let c of l){let d=(a.get(c.id)??0)-(n.get(`${o.id}\0${c.id??""}`)??0);if(d<=0)continue;let h=r.paidPrice(o.categoryKey,c.id,c.price,o.id);i.push(`<div class="sl-ga" data-ga="${z(o.id)}" data-ga-row-tier="${z(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${z(o.displayLabel??o.label)}</div><div class="sl-ga-sub">${z(l.length>1?c.label:o.displayType??r.tf("picker.generalAdmission","General admission"))} \xB7 ${z(r.money(h))} \xB7 ${z((0,K.tCount)("picker.leftCount",o.available))}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${z(r.tf("picker.fewer","Fewer"))}">\u2212</button><span>${d}</span><button type="button" data-d="1" aria-label="${z(r.tf("picker.more","More"))}">+</button></div></div>`)}}let s=e.filter(o=>it(r.gaQty,o.id)<=0&&!t.some(a=>a.objectId===o.id));return s.length&&i.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${r.gaAreasExpanded}"><span>${z(r.tf("picker.gaAreasHeading","Areas"))}</span><small>${s.length}</small></button>`+(r.gaAreasExpanded?`<div class="sl-ga-areas-list">${s.map(o=>`<button type="button" class="sl-ga-area-open" data-ga-open="${z(o.id)}"${o.available<=0?" disabled":""}><span class="name">${z(o.displayLabel??o.label)}<small>${z(o.displayType??r.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${z(r.money(r.paidPrice(o.categoryKey,null,o.price,o.id)))} \xB7 ${z(o.available>0?(0,K.tCount)("picker.leftCount",o.available):r.tf("picker.soldOutTitle","Sold out"))}</span></button>`).join("")}</div>`:"")+"</div>"),i.join("")}function Yr(r,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(i=>{i.addEventListener("click",()=>{let n=i.closest(".sl-ga");if(!n?.dataset.ga)return;let s=t.find(c=>c.id===n.dataset.ga);if(!s)return;let o=n.dataset.gaRowTier?n.dataset.gaRowTier:null,a=Number(i.dataset.d),l=r.gaQty.get(s.id)?.get(o)??0;if(a>0&&Kr(r,s)-it(r.gaQty,s.id)<=0){r.toast((0,K.t)("picker.maxTicketsForOrder",{count:r.maxTickets}),"warning");return}Tt(r.gaQty,s.id,o,Math.max(0,l+a)),r.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{r.gaAreasExpanded=!r.gaAreasExpanded,r.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(i=>{i.addEventListener("click",()=>{let n=t.find(s=>s.id===i.dataset.gaOpen);n&&ji(r,n,null,i)})})}var Jt='<svg viewBox="0 0 64 56" width="12" height="11" fill="none" aria-hidden="true" focusable="false" style="display:block"><path d="M4 13 Q16 6 29 7 L28.5 17 Q17 16.5 7 22 Z" fill="#f4b740"/><path d="M4 13 Q16 6 29 7 L28.5 17 Q17 16.5 7 22 Z" fill="#f4b740" transform="translate(64 0) scale(-1 1)"/><path d="M8 28 Q18 22 28.6 23 L28.2 32 Q18 28.5 10 36 Z" fill="#fcf7ee"/><path d="M8 28 Q18 22 28.6 23 L28.2 32 Q18 28.5 10 36 Z" fill="#fcf7ee" transform="translate(64 0) scale(-1 1)"/><path d="M11 41 Q19 35 28.2 36 L27.8 45 Q19.5 42 13.5 49 Z" fill="#fcf7ee"/><path d="M11 41 Q19 35 28.2 36 L27.8 45 Q19.5 42 13.5 49 Z" fill="#fcf7ee" transform="translate(64 0) scale(-1 1)"/></svg>';var Zo=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Jo=/[\s"'<>`\\]/;function ea(r){return r.startsWith("//")?!1:r.startsWith("/")||r.startsWith("./")||r.startsWith("../")}function ta(){try{let r=typeof location>"u"?"":location.origin;return r&&r!=="null"?r:null}catch{return null}}function rt(r){if(typeof r!="string"||!r||r.length>2e6||r!==r.trim())return!1;if(r.startsWith("data:"))return Zo.test(r);if(Jo.test(r))return!1;let e=ta();if(ea(r)){if(!e)return!1;try{let t=new URL(r,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(r);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var ia=/^[a-zA-Z0-9._-]+$/;function Ki(r){let e;try{e=new URL(r,"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]),n=decodeURIComponent(t[2]);return!i||!ia.test(n)?null:{eventKey:i,asset:n}}catch{return null}}function ra(r){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(r,"https://seatlayer.invalid").pathname)}catch{return!1}}var nt=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=Ki(e);if(!t)return Promise.resolve(ra(e)||!rt(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 n=this.load(this.eventKey,t.asset).then(s=>{let o=URL.createObjectURL(s);return this.disposed?(URL.revokeObjectURL(o),null):(this.created.add(o),o)}).catch(s=>{throw this.pending.delete(e),s});return this.pending.set(e,n),n}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var Ve=require("@seatlayer/core"),ai=require("@seatlayer/core/view3d/crossfade/panorama");var Qr=`
|
|
109
109
|
/* TEST MODE is environment context, not an action. A small squared chip that
|
|
110
110
|
flows FIRST in the top-left anchor region: the old rotated corner ribbon sat
|
|
111
111
|
at a negative offset and was clipped by the widget root's rounded
|
|
@@ -312,7 +312,7 @@
|
|
|
312
312
|
.sl-pg-switch:hover{border-style:solid;color:var(--sl-text);border-color:var(--sl-accent)}
|
|
313
313
|
@media(prefers-reduced-motion:reduce){.sl-tip{animation:none!important}.sl-tip,.sl-tip-switch,.sl-pg-switch{transition:none!important}}
|
|
314
314
|
@media(max-width:639px){.sl-confirm-group-dates{width:min(340px,calc(100% - 20px))}.sl-confirm-date{min-height:32px}}
|
|
315
|
-
`;var
|
|
315
|
+
`;var Xr=`
|
|
316
316
|
/* 3D venue overlay \u2014 mounts over the (paused) Konva stage inside the map host.
|
|
317
317
|
Carries its own gradient so it paints instantly before the scene builds, and
|
|
318
318
|
cross-fades on enter/exit via a compositor-only opacity transition. Sits below
|
|
@@ -564,7 +564,7 @@
|
|
|
564
564
|
.sl-view3d-passport-shell{padding:max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom))}
|
|
565
565
|
.sl-view3d-passport{width:100%;max-height:100%;padding:14px 14px max(24px,calc(14px + env(safe-area-inset-bottom)));border-radius:15px}
|
|
566
566
|
}
|
|
567
|
-
`;var
|
|
567
|
+
`;var Zr=`
|
|
568
568
|
/* THE PHONE TICKET LIST (owner 2026-08-27: "on mobile the cards take lots of
|
|
569
569
|
space, lots of white space on each card"). The desktop card spends ~72px per
|
|
570
570
|
ticket on SECTION/ROW/SEAT eyebrows, a category line and a 34px icon rail \u2014
|
|
@@ -693,7 +693,33 @@
|
|
|
693
693
|
.sl-picker[data-layout="narrow"] .sl-ba-qty button::after{content:'';position:absolute;inset:-7px}
|
|
694
694
|
.sl-picker[data-layout="narrow"] .sl-ba-go{grid-column:2;width:auto;min-height:36px;padding:0 10px;font-size:12.5px;box-shadow:none}
|
|
695
695
|
.sl-picker[data-layout="narrow"] .sl-ba-go:not(.sl-busy)::before{content:'\u2726';font-size:13px;line-height:1}
|
|
696
|
-
|
|
696
|
+
|
|
697
|
+
/* \u2500\u2500\u2500 THE LAPSED-HOLD LINE, and the \u267F menu's free counts \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
698
|
+
Both belong to the base sheet by subject, and neither can live there: it is
|
|
699
|
+
at exactly the 1,500-line vendored-source cap. This block is concatenated
|
|
700
|
+
immediately after it (see ensureStyle), which is the position the rules
|
|
701
|
+
would have had anyway, and neither family is targeted by any other rule in
|
|
702
|
+
the sheet \u2014 .sl-lapse-note and .sl-a11yrow-c are new class names, and
|
|
703
|
+
.sl-a11yrow[disabled] is strictly more specific than the .sl-a11yrow
|
|
704
|
+
base it dims. So order cannot decide a winner here either way. */
|
|
705
|
+
|
|
706
|
+
/* A toast is gone in four seconds; the offer to take the seats back has to
|
|
707
|
+
outlive it, so the same sentence is repeated as a line the tray keeps. */
|
|
708
|
+
.sl-lapse-note{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:11px 13px;
|
|
709
|
+
border-radius:13px;background:color-mix(in srgb,var(--sl-warn,#b45309) 10%,var(--sl-surface));
|
|
710
|
+
border:1px solid color-mix(in srgb,var(--sl-warn,#b45309) 30%,transparent)}
|
|
711
|
+
.sl-lapse-note span{flex:1;min-width:140px;font-size:11.5px;font-weight:650;line-height:1.45;color:var(--sl-text)}
|
|
712
|
+
.sl-lapse-note button{flex:none;min-height:32px;padding:0 12px;border:0;border-radius:9px;cursor:pointer;
|
|
713
|
+
font:inherit;font-size:12px;font-weight:800;color:var(--sl-on-accent,#fff);background:var(--sl-accent)}
|
|
714
|
+
.sl-lapse-note button:focus-visible{outline:2px solid var(--sl-accent);outline-offset:2px}
|
|
715
|
+
|
|
716
|
+
/* "4 free" / "None left" \u2014 tabular so a column of counts does not jitter as
|
|
717
|
+
other buyers take seats out from under the returning one. */
|
|
718
|
+
.sl-a11yrow-c{flex:none;font-size:10.5px;font-weight:800;color:var(--sl-muted);font-variant-numeric:tabular-nums}
|
|
719
|
+
/* Sold out, not absent. Dimmed and unswitchable, but still read aloud. */
|
|
720
|
+
.sl-a11yrow[disabled]{opacity:.58;cursor:default}
|
|
721
|
+
.sl-a11yrow[disabled]:hover{background:transparent}
|
|
722
|
+
`;var Jr="seatlayer-picker-style",na=`
|
|
697
723
|
.sl-picker{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:420px;overflow:hidden;
|
|
698
724
|
background:var(--sl-bg);color:var(--sl-text);font-family:var(--sl-font);border-radius:var(--sl-radius);
|
|
699
725
|
--sl-r-sm:calc(var(--sl-radius) * .55);
|
|
@@ -2144,7 +2170,7 @@
|
|
|
2144
2170
|
corners, and it is the frame. */
|
|
2145
2171
|
.sl-modal-frame > .sl-picker{border-radius:0}
|
|
2146
2172
|
@media(max-width:640px){.sl-modal-scrim{padding:0}.sl-modal-frame{width:100%;height:100%;border-radius:0}}
|
|
2147
|
-
`;function nt(){if(document.getElementById(Qr))return;let r=document.createElement("style");r.id=Qr,r.textContent=ea+Yr+Wr+qr+Lr,document.head.appendChild(r)}var rn=require("@seatlayer/core"),nn=require("@seatlayer/core/core/cdnAsset");var aa=require("@seatlayer/core/core/cdnAsset");function g(r,e){let t=(0,rn.t)(r);return t===r?e:t}function sn(r){if(typeof r=="string"){let e=document.querySelector(r);if(!e)throw new Error(`seatmap: container "${r}" not found`);return e}if(!(r instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return r}function O(r){return String(r??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}function on(r,e,t){let i=e.find(s=>it(s))??null;if(r.replaceChildren(),!i)return r.textContent=t.slice(0,1).toUpperCase(),null;let n=document.createElement("img");return n.alt="",n.referrerPolicy="no-referrer",n.src=i,r.appendChild(n),i}var st=null;function Zt(){if(st!==null)return st;try{if(typeof document>"u")return st=!1;st=!!document.createElement("canvas").getContext("webgl2")}catch{st=!1}return st}function Gi(r){return(0,nn.cdnAssetUrl)(r)}var St=null;function Tt(){return St||(St=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Gi("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")).catch(e=>{throw St=null,e}),St)}function Ki(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Tt().catch(()=>{})}async function Jt(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Gi("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function an(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Gi("seatlayer-checkout.mjs")):Promise.resolve().then(()=>(tn(),en))}function ln(r){return r==="unavailable_for_event"||r==="payments_off_for_event"?r:"not_configured"}function ei(r,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},n=new Date(r);if(e)try{return n.toLocaleString(t,{...i,timeZone:e})}catch{}return n.toLocaleString(t,i)}async function ti(r,e){let t=r.overlay.productionElements;if(!t?.some(n=>n.contentImageUrl))return r;let i=await Promise.all(t.map(async n=>{if(!n.contentImageUrl)return n;try{let s=await e(n.contentImageUrl);if(!s){let{contentImageUrl:o,...a}=n;return a}return{...n,runtimeContentImageUrl:s}}catch{let{contentImageUrl:s,...o}=n;return o}}));return{...r,overlay:{...r.overlay,productionElements:i}}}async function ii(r,e){if(r)try{let t=await e(r);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}var Pe=require("@seatlayer/core/view/panoramaDelivery");function ri(r){let{root:e,source:t,caption:i,real:n,closeLabel:s,dragHint:o,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:d,onClose:h}=r,p=r.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=P=>u.querySelector(P)?.remove();p.title===!1?b(".sl-view-title"):u.querySelector(".sl-view-title").textContent=a,p.caption===!1?b(".sl-view-cap"):u.querySelector(".sl-view-cap").textContent=i,u.querySelector(".sl-view-x").setAttribute("aria-label",s),p.badge===!1?b(".sl-view-badge"):u.querySelector(".sl-view-badge").textContent=n?l:c,u.querySelector(".sl-view-hint").textContent=o,e.appendChild(u);let m=u.querySelector(".sl-view-pano"),v=(0,Pe.planPanoramaDelivery)(t,(0,Pe.browserPanoramaConstraints)()),x=new AbortController;m.style.backgroundImage=`url(${JSON.stringify(v.initialUrl)})`;let S=()=>{};v.upgradeUrl&&(S=(0,Pe.schedulePanoramaUpgrade)(()=>{d(v.upgradeUrl).then(P=>!P||x.signal.aborted?null:(0,Pe.loadPanoramaImage)(P,x.signal).then(()=>P)).then(P=>{!P||!u.isConnected||x.signal.aborted||(m.style.backgroundImage=`url(${JSON.stringify(P)})`)}).catch(()=>{})}));let A=70,f=35,y=1,T=m.clientHeight||1,M=m.clientWidth||1,R=-(T*(180/A)*2/2-M/2),E=0,V=()=>{let P=m.clientHeight||1,qe=P*(180/A)*y,Be=Math.max(0,qe-P),bt=Math.min(Be/2,f/180*qe);E=Math.min(bt,Math.max(-bt,E)),m.style.backgroundSize=`auto ${qe}px`,m.style.backgroundPosition=`${R}px ${E-Be/2}px`};V();let he=!1,le=0,re=0,ne=P=>{he=!0,le=P.clientX,re=P.clientY,m.classList.add("drag"),m.setPointerCapture?.(P.pointerId)},N=P=>{he&&(R+=P.clientX-le,E+=P.clientY-re,le=P.clientX,re=P.clientY,V())},Ue=P=>{he=!1,m.classList.remove("drag"),m.releasePointerCapture?.(P.pointerId)},gt=P=>{P.preventDefault(),y=Math.min(2.4,Math.max(1,y+(P.deltaY<0?.12:-.12))),V()};m.addEventListener("pointerdown",ne),m.addEventListener("pointermove",N),m.addEventListener("pointerup",Ue),m.addEventListener("pointercancel",Ue),m.addEventListener("wheel",gt,{passive:!1});let B=u.querySelector(".sl-view-x");B.addEventListener("click",h);let j=P=>{P.key==="Escape"&&(P.stopPropagation(),h())};return u.addEventListener("keydown",j),B.focus(),{element:u,dispose(){S(),x.abort(),m.removeEventListener("pointerdown",ne),m.removeEventListener("pointermove",N),m.removeEventListener("pointerup",Ue),m.removeEventListener("pointercancel",Ue),m.removeEventListener("wheel",gt),u.removeEventListener("keydown",j),B.removeEventListener("click",h)}}}var cn=6e4,ni=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.navigationMode_="orbit";this.overlay=null;this.handle=null;this.generation=0;this.seatViewGeneration=0;this.seatViewElement=null;this.seatViewDispose=null;this.options=e}get buyerView(){return this.buyerView_}get targetSeatId(){return this.targetSeatId_}get navigationMode(){return this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!Zt()?!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.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(),n=this.options.doc();if(!t||!i||!n)throw new Error("seat_view_unavailable");let s=++this.seatViewGeneration,o,a,l=!1;if(t.viewUrl){let b=t.viewMeta?.previewUrl,m=!!b&&b!==t.viewUrl,v=m?await this.options.resolveAsset(b):null,x=m?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(s!==this.seatViewGeneration||!x||m&&!v)return;o={url:x,...v?{previewUrl:v}:{},...m?{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=(0,si.seatViewDisclosure)(o),l=(0,si.isAuthoredSeatView)(o)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:b}=await Jt();if(s!==this.seatViewGeneration)return;let m=n.floors?.find(S=>S.objects.some(A=>A.type==="row"&&A.id===t.rowId)),v=t.focalPoint??m?.focalPoint??n.focalPoint,x=b(t,v,[...this.options.seats()]);o={url:x.url,generated:!0},a=(0,Fe.t)("picker.illustrationCaption",{m:x.distanceM})}if(s!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(i,n),nt();let c=this.options.chrome??{},d=g("picker.dragToLookAround","Drag to look around \xB7 pinch or scroll to zoom"),h=(0,Fe.t)("picker.viewFromSeat",{label:t.displayLabel||t.label}),p=l?(0,Fe.t)("picker.real360"):(0,Fe.t)("picker.preview"),u=ri({root:i,source:o,caption:a,real:l,closeLabel:g("picker.close","Close"),dragHint:d,viewFromSeatLabel:h,real360Label:(0,Fe.t)("picker.real360"),previewLabel:(0,Fe.t)("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:p,real:l,generated:!!o.generated,dragHint:d})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let i=t.floors.findIndex(n=>n.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)}setNavigationMode(e){return this.navigationMode_=e,this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.setNavigationMode(e),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}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)?cn/2:cn}async enter3D(e){let t=this.options.host(),i=this.options.doc();if(!t||!i||this.overlay)throw new Error("venue_3d_unavailable");nt(),this.prepareHostTheme(t,i);let n=document.createElement("div");n.className="sl-view3d",n.setAttribute("role","group"),n.setAttribute("aria-label",g("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(n.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let s=document.createElement("div");s.className="sl-view3d-loading",s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),s.textContent=g("picker.loading3d","Building the 3D venue\u2026"),n.appendChild(s),t.appendChild(n),this.overlay=n;let o=++this.generation;if(this.reducedMotion()?n.style.opacity="1":requestAnimationFrame(()=>{n.style.opacity="1"}),await this.nextPaint(),!(o!==this.generation||this.overlay!==n))try{let[a,l]=await Promise.all([Tt(),this.options.loadEventConfiguration()]),c=l?await ti(l,this.options.resolveAsset):null,d=await ii(i.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(o!==this.generation||this.overlay!==n)return;let h={doc:i,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};s.textContent=g("picker.building3d","Building venue geometry\u2026");let p=await a.prepareVenue3D(h);if(o!==this.generation||this.overlay!==n)return;let u=this.options.chrome??{},b=a.mountVenue3D(n,{...h,prepared:p},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,...u.view3dCaption===!1||u.view3dSeatStepper===!1||u.view3dControlDock===!1?{chrome:{caption:u.view3dCaption!==!1,seatStepper:u.view3dSeatStepper!==!1,controlDock:u.view3dControlDock!==!1}}:{},seatViewActionLabel:m=>this.findSeat(m)?.viewUrl?g("picker.openAuthored360","Open venue 360\xB0"):g("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:m=>this.toggleSeat(m),onSeatInspect:m=>this.toggleSeat(m),onViewTargetChange:m=>{this.targetSeatId_=m,this.options.onViewChange("venue3d",m)},...this.options.enableSeatView?{getSeatView:m=>this.seatViewFor3D(m)}:{}});if(o!==this.generation||this.overlay!==n){b.dispose();return}this.handle=b,this.buyerView_="venue3d",this.targetSeatId_=e??null,b.setNavigationMode(this.navigationMode_),requestAnimationFrame(()=>s.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await b.flyToSeat(e)}catch(a){if(o!==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.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let i=this.handle,n=this.overlay;if(this.options.restoreMap(),t&&i&&n){n.style.pointerEvents="none";let s=()=>{this.buyerView_!=="map"||this.overlay!==n||(n.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(n.style.opacity="0",s()):(requestAnimationFrame(()=>{n.style.opacity="0"}),setTimeout(s,280));return}if(this.handle=null,this.overlay=null,!n){try{i?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{i?.dispose()}catch{}n.remove(),this.options.restoreMap();return}n.style.pointerEvents="none",requestAnimationFrame(()=>{n.style.opacity="0"}),setTimeout(()=>{try{i?.dispose()}catch{}n.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,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),i.resize(),i.setNavigationMode(this.navigationMode_),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(n=>n.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,n=!!i&&i!==t.viewUrl,s=n?await this.options.resolveAsset(i):null,o=n?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!o||n&&!s)throw new Error("seat_view_unavailable");return{url:o,...s?{previewUrl:s}:{},...n?{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:g("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}};var la={host:"web",platform:"web",bundle:"",protocol:0,chromeOwner:"web"},ca={...la},oi=null,dn=null;function da(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function pa(){let r=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:r(da()),documentMs:oi==null?0:r(oi),handshakeMs:oi==null||dn==null?0:r(dn-oi)}}function pn(){let{host:r,platform:e,bundle:t,protocol:i,chromeOwner:n}=ca,s=pa();return{host:r,platform:e,...t?{bundle:t}:{},...i?{protocol:i}:{},chromeOwner:n,bootMs:s.bootMs,documentMs:s.documentMs,handshakeMs:s.handshakeMs}}var hn=new Set;function Ae(r){return hn.has(r)?"repeat":"cold"}function ai(r){let e=Ae(r);return hn.add(r),e}function q(r){return typeof r=="number"&&Number.isFinite(r)&&r>=0?Math.round(r):0}function ha(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function ua(r){if(!/^[A-Za-z0-9_-]{1,80}$/.test(r.event))return null;let e=r.performanceProfile??{};return{event:r.event,scope:r.scope,surface:r.surface,outcome:r.outcome,stage:r.stage?.slice(0,32)??"",ms:q(r.ms),api:q(e.loadChartAndStatuses)||q(e.loadChart),scene:q(e.buildScene),panel:q(e.buildBuyerControls),paint:q(e.firstPaint),normalize:q(e.normalizeBuyerModel),renderer:q(e.createRenderer),seats:q(r.seats),floors:q(r.floors),view:r.view??"map",load:r.load??Ae(r.event),transport:r.transport??"pubapi",chartBytes:q(r.chartDelivery?.bytes),chartCache:r.chartDelivery?.cache??"",server:q(r.chartDelivery?.serverMs),r2Head:q(r.chartDelivery?.r2HeadMs),cacheLookup:q(r.chartDelivery?.cacheLookupMs),r2Get:q(r.chartDelivery?.r2GetMs),transform:q(r.chartDelivery?.transformMs),...pn(),availabilityMs:q(e.loadStatuses)}}var ma=new Set;function ye(r){let e=ua(r);if(e){for(let t of ma)try{t(e)}catch{}typeof fetch>"u"||ha()||fetch(`${r.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 ci=require("@seatlayer/core/core/color");function we(r){if(!r)return null;let e=r.trim().toLowerCase();if(e==="white")return{r:255,g:255,b:255};if(e==="black")return{r:0,g:0,b:0};let t=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(e)?.[1];if(t){let n=t.length<=4?[...t].map(s=>`${s}${s}`).join(""):t;return{r:Number.parseInt(n.slice(0,2),16),g:Number.parseInt(n.slice(2,4),16),b:Number.parseInt(n.slice(4,6),16)}}let i=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i.exec(e);return i?{r:Math.max(0,Math.min(255,Number(i[1]))),g:Math.max(0,Math.min(255,Number(i[2]))),b:Math.max(0,Math.min(255,Number(i[3])))}:null}function li(r){return(0,ci.relativeLuminance255)([r.r,r.g,r.b])}function xe(r,e){let t=we(r),i=we(e);if(!t||!i)return null;let n=Math.max(li(t),li(i)),s=Math.min(li(t),li(i));return(n+.05)/(s+.05)}function Me(r,e="#172033",t="#eef1f8"){return(xe(e,r)??0)>=(xe(t,r)??0)?e:t}function fa(r){return(0,ci.rgb255ToHex)(r.r,r.g,r.b)}function Ui(r,e,t){let i=we(r),n=we(e);if(!i||!n)return null;let s=Math.max(0,Math.min(1,t));return fa({r:i.r*s+n.r*(1-s),g:i.g*s+n.g*(1-s),b:i.b*s+n.b*(1-s)})}function un(r,e,t,i){if((xe(r,t)??4.5)>=4.5&&(xe(r,i)??4.5)>=4.5)return r;if(!we(r)||!we(e))return e;for(let n=.15;n<=1;n+=.05){let s=Ui(r,e,1-n);if(s&&(xe(s,t)??0)>=4.5&&(xe(s,i)??0)>=4.5)return s}return e}function mn(r,e){let t=e??r["--sl-bg"],i=we(t)?Me(t)==="#172033":!1,n=we(r["--sl-bg"])?Me(r["--sl-bg"])==="#172033":!1;if(i===n)return null;let s=i?"#ffffff":"#1a2234",o=Me(t),a=r["--sl-accent"];return{"--sl-bg":t,"--sl-surface":s,"--sl-text":o,"--sl-muted":i?"#667085":"#a5aec2","--sl-line":i?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-accent-text":un(a,o,t,s)}}var fn={light:{background:"#ffffff",surface:"#f6f7fb",text:"#172033",muted:"#667085",line:"rgba(23,32,51,.16)",map:"#e9edf4"},dark:{background:"#0f1522",surface:"#1a2234",text:"#eef1f8",muted:"#a5aec2",line:"rgba(165,174,194,.24)",map:"#0f1522"}};function ga(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function Ct(r){if(r)return r==="auto"?ga()?"dark":"light":r}function ot(r,e=r?.mode){if(r?.map)return r.map;let t=Ct(e);return t?{background:fn[t].map}:null}function di(r){let e;try{e=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!e)return()=>{};let t=i=>r(i.matches);return typeof e.addEventListener=="function"?e.addEventListener("change",t):e.addListener?.(t),()=>{typeof e.removeEventListener=="function"?e.removeEventListener("change",t):e.removeListener?.(t)}}function Et(r,e,t){let i=t?fn[t]:null,n=e?.background??i?.background??r?.background??"#0f1522",s=we(n)?Me(n)==="#172033":!1,o=e?.surface??i?.surface??(s?"#ffffff":"#1a2234"),a=e?.accent??r?.accent??"#f4b740",l=r?.accentInk,c=e?.accentInk??(l&&(xe(l,a)??4.5)>=4.5?l:Me(a,"#1a1200","#ffffff")),d=i?void 0:r?.textColor,h=e?.text??i?.text??(d&&(xe(d,n)??4.5)>=4.5&&(xe(d,o)??4.5)>=4.5?d:Me(n));return{"--sl-accent":a,"--sl-accent-ink":c,"--sl-accent-text":un(a,h,n,o),"--sl-bg":n,"--sl-surface":o,"--sl-text":h,"--sl-muted":e?.muted??i?.muted??(s?"#667085":"#a5aec2"),"--sl-line":e?.line??i?.line??(s?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),"--sl-font":e?.fontFamily??r?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}var Pt=class r{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 ot(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??r.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=di(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};var gn=require("@seatlayer/core");function bn(r,e,t){let i=r.doc,n=i?.theme??{},s=r.categoryAvailability(),o=r.getGAAreas(),a=r.getFloors(),l=i?.floors?.flatMap(d=>d.objects)??i?.objects??[],c=new Map;for(let d of l)d.type==="section"&&c.set(d.id,{id:d.id,label:d.label,...d.displayLabel?{displayLabel:d.displayLabel}:{},...d.zone?{zoneId:d.zone}:{}});return{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:(0,gn.getLocale)()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...n.accent?{accent:n.accent}:{},...n.accentInk?{accentInk:n.accentInk}:{},...n.background?{background:n.background}:{},...n.textColor?{textColor:n.textColor}:{},...n.brandName?{brandName:n.brandName}:{},...n.logoUrl?{logoUrl:n.logoUrl}:{},attributionRequired:!n.hideBadge},features:{ga:o.length>0,tiers:!!i?.categories.some(d=>d.tiers?.length),floors:a.length>1,zones:!!i?.zones?.length,sections:c.size>0,bestAvailable:!0,accessibilityFilter:!0,limitedViewFilter:!0,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(i?.categories??[]).filter(d=>!d.notForSale).map(d=>({key:d.key,label:d.label,color:d.color,price:d.price??d.tiers?.[0]?.price??0,available:s[d.key]??0,tiers:(d.tiers??[]).map(h=>({id:h.id,name:h.name,price:h.price,...h.currency?{currency:h.currency}:{}}))})),zones:(i?.zones??[]).map(d=>({id:d.id,label:d.label,...d.color?{color:d.color}:{}})),sections:[...c.values()],gaAreas:o,bestAvailableZones:r.getBestAvailableZones()},map:{floors:a,activeFloorId:r.getActiveFloorId()||a[0]?.id||null,floorMode:r.isFloorOverview()?"all":"single",floorLabelStyle:r.getRenderer()?.getFloorLabelStyle?.()??"number",rung:r.getRung(),focusedSectionId:r.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:r.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:e.targetSeatId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:r.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_},selection:{seats:r.getSelection(),validity:r.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var ba="https://api.seatlayer.io",vn=10;function va(r){if(typeof r=="string"){let e=document.querySelector(r);if(!e)throw new Error(`seatmap: container "${r}" not found`);return e}if(!(r instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return r}var pi=class{constructor(e){this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=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.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.realtime=null;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??vn,this.colorblindSafe_=e.colorblindSafe??!1;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()}},n=(e.apiBase??ba).replace(/\/+$/,"");this.apiBase=n;let s=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?qt({base:n,event:e.event,publicKey:e.publicKey,accessHooks:i,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=s?.access??et(e,i);let o=s?.api??new Te(n,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=o,this.controller=new $.PickerController({transport:o,eventKey:e.event,maxSelection:this.maxSelection_,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,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),onSelectionLimit:a=>this.opts.onSelectionLimit?.(a),onHold:a=>this.opts.onHold?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldRestored:a=>this.opts.onHoldRestored?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:a=>{let l=this.controller.getGAAreas().find(c=>c.id===a);l&&(this.opts.onGAClick?.(l),this.opts.onGAPrompt?.({area:l,selected:{},min:0,max:Math.max(0,Math.min(l.available,(this.opts.maxSelection??vn)-this.controller.getSelection().length)),tiers:Qt(l),confirm:c=>{let d=typeof c=="number"?c:Object.values(c).reduce((h,p)=>h+p,0);this.holdGA(l.id,d)},cancel:()=>{}}))},onError:a=>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??Pt.groundFor(e.theme?.mode)??null}),this.hostSurface=new Pt({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 rt(e.event,(a,l)=>o.asset(a,l)),this.immersive=new ni({host:()=>this.hostEl,doc:()=>this.controller.doc,seats:()=>this.controller.getExpandedSeats(),selection:()=>this.controller.getSelection(),status:a=>this.controller.getStatus(a),select:a=>this.controller.select([a]),deselect:a=>this.controller.deselect([a]),loadEventConfiguration:()=>this.controller.loadEventConfiguration(),resolveAsset:a=>this.buyerAssetUrls.resolve(a),enable3D:e.enable3D!==!1,enableSeatView:e.enableSeatView!==!1,max3DSeats:e.max3DSeats,...e.chrome?{chrome:e.chrome}:{},restoreMap:()=>this.controller.refitCurrentView(),onViewChange:(a,l)=>{this.opts.onBuyerViewChange?.({view:a,...l?{seatId:l}:{}}),this.notifyMapStateChange()},onSeatViewChange:a=>this.opts.onSeatViewChange?.(a),onError:a=>this.opts.onError?.(a)}),this.lastReportedViewRung_=this.controller.getRung()}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung();e!==this.lastReportedViewRung_&&(this.lastReportedViewRung_=e,this.opts.onMapStateChange?.())}notifyMapStateChange(){this.lastReportedViewRung_=this.controller.getRung(),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0,await(0,$.loadLocale)(this.opts.locale),this.opts.messages&&(0,$.setStringOverrides)(this.opts.messages),this.mount=va(this.opts.container);let t=document.createElement("div");t.lang=(0,$.getLocale)(),t.dir=(0,$.localeDirection)(),t.style.width="100%",t.style.height="100%",t.style.position="relative",this.mount.appendChild(t),this.hostEl=t,this.applyInteractionState();let i=await this.controller.render(t);if(!i)return ye({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:Ae(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(t),this;if(this.eventLocale=i.locale??null,!this.opts.locale&&this.eventLocale&&await this.setLocale(this.eventLocale),this.buildLanguageSwitcher(t),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=i.mode==="test"?"test":"live",this.eventInfo={name:i.eventName,venue:i.venue??null,startsAt:i.startsAt??null,timezone:i.timezone??null,currency:i.currency??this.opts.currency??"USD",posterUrl:i.posterUrl??null,salesClosed:i.salesClosed},this.opts.seatTooltip!==!1){let n=document.createElement("div");n.setAttribute("role","tooltip"),n.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);',t.appendChild(n),this.tipEl=n,this.onTipMove=s=>{let o=t.getBoundingClientRect();this.tipPos={x:s.clientX-o.left,y:s.clientY-o.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},t.addEventListener("mousemove",this.onTipMove)}if(i.mode==="test"&&this.opts.showTestModeIndicator!==!1){t.style.overflow="hidden";let n=document.createElement("div");n.dataset.slI18n="testMode",n.textContent=(0,$.t)("picker.testMode"),n.setAttribute("aria-label",(0,$.t)("picker.testMode")),n.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;",t.appendChild(n)}return this.opts.showAttribution!==!1&&this.buildBadge(t),ye({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:i.performanceProfile,chartDelivery:i.chartDelivery,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:ai(this.opts.event),transport:"pubapi"}),this}buildBadge(e){if(this.controller.doc?.theme?.hideBadge)return;let t=document.createElement("a");t.dataset.slI18n="badge",t.href="https://seatlayer.io",t.target="_blank",t.rel="noopener noreferrer",t.setAttribute("aria-label",(0,$.t)("picker.poweredBy")),t.style.cssText='position:absolute;bottom:10px;right:12px;z-index:5;display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;background:rgba(255,255,255,.92);color:#4a5163;text-decoration:none;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:.02em;box-shadow:0 2px 8px rgba(0,0,0,.12);';let i=document.createElement("span");i.setAttribute("aria-hidden","true"),i.style.cssText="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee",i.innerHTML=Xt;let n=document.createElement("span");n.textContent=(0,$.t)("picker.poweredBy"),t.append(i,n),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,n=this.tipPos.x+14,s=this.tipPos.y-i-12;n+t>e-8&&(n=this.tipPos.x-t-14),s<8&&(s=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,n)}px`,this.tipEl.style.top=`${Math.max(8,s)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=(0,$.formatMoney)(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 n=document.createElement("div");n.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let s=document.createElement("span");s.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",s.style.background=e.categoryColor;let o=document.createElement("span");o.textContent=e.categoryLabel;let a=document.createElement("span");if(a.style.cssText="margin-left:auto;font-weight:700;color:#fff",a.textContent=t,n.append(s,o,a),this.tipEl.replaceChildren(i,n),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=e.status==="held"?(0,$.t)("map.statusHeld"):(0,$.t)("map.statusTaken"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(n=>(0,$.resolveLocale)(n)).filter((n,s,o)=>o.indexOf(n)===s);if(t.length<2)return;let i=document.createElement("select");i.setAttribute("aria-label",(0,$.t)("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 n of t){let s=document.createElement("option");s.value=n,s.textContent=$.LOCALE_NAMES[n]??n,s.selected=n===(0,$.getLocale)(),i.appendChild(s)}i.addEventListener("change",()=>{this.setLocale(i.value)}),e.appendChild(i)}async setLocale(e){let t=(0,$.getLocale)(),i=await(0,$.loadLocale)(e);if(this.opts.messages&&(0,$.setStringOverrides)(this.opts.messages),i===t)return i;if(this.hostEl){this.hostEl.lang=i,this.hostEl.dir=(0,$.localeDirection)();for(let n of this.hostEl.querySelectorAll("[data-sl-i18n]"))if(n.dataset.slI18n==="testMode")n.textContent=(0,$.t)("picker.testMode"),n.setAttribute("aria-label",(0,$.t)("picker.testMode"));else if(n.dataset.slI18n==="badge"){n.setAttribute("aria-label",(0,$.t)("picker.poweredBy"));let s=n.querySelector("span:last-child");s&&(s.textContent=(0,$.t)("picker.poweredBy"))}}return this.controller.refreshMapCopy(),i}getMode(){return this.mode_}getPickerState(){return bn(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_})}getCategoryAvailability(){return this.controller.categoryAvailability()}getBestAvailableZones(){return this.controller.getBestAvailableZones()}getActiveFloorId(){return this.controller.getActiveFloorId()||null}getRung(){return this.controller.getRung()}getFocusedSection(){return this.controller.getFocusedSection()}focusSection(e){if(this.immersive.buyerView==="venue3d"&&this.immersive.focusSection(e)){this.notifyMapStateChange();return}this.controller.focusSection(e),this.notifyMapStateChange()}overview(){if(this.immersive.focusOverview()){this.notifyMapStateChange();return}this.controller.overview(),this.notifyMapStateChange()}setRung(e){this.controller.setRung(e),this.notifyMapStateChange()}setCategoryFilter(e,t=!1){this.categoryFilter_=e?[...e]:null,this.controller.setCategoryFilter(e),t&&this.controller.focusCategoryFilter(e),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.notifyMapStateChange()}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let n=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(n?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:n?"selection_count_mismatch":"selection_invalid",selection:t})}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}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,i={}){try{return await this.holdGAOrThrow(e,t,i)}catch(n){return this.opts.onError?.(n),null}}async holdGAOrThrow(e,t,i={}){let n=await this.controller.holdGA(e,t,i);return n?{holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(n){return this.opts.onError?.(n),null}}async bestAvailableOrThrow(e,t,i={}){let n=await this.controller.bestAvailable(e,t,i);return n?{holdId:n.holdId,expiresAt:n.expiresAt,labels:n.labels,seats:n.seats,items:n.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(n){return this.opts.onError?.(n),null}}async replaceTableQuantityOrThrow(e,t,i){let n=await this.controller.replaceTableQuantity(e,t,i);return n?{holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.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()}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 ue({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:Ye(this.controller,{flashOnLiveChange:!0,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){await this.controller.refresh(),this.immersive.pushLiveState(),this.opts.onStatusChange?.()}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="The seat map didn\u2019t load.",t.appendChild(i);let n=document.createElement("button");n.type="button",n.textContent="Try again",n.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;",n.addEventListener("click",()=>{this.destroy(),this.render().catch(s=>this.opts.onError?.(s))}),t.appendChild(n),e.appendChild(t)}destroy(){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.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 qi=["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"],ya={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 yn(r){let e={};for(let t of qi)e[t]=(...i)=>{let n=r();return n?n[t](...i):ya[t]()};return e}var Wi=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Yi=[...Wi,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],Qi=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function xn(r,e,t){let i={container:r};for(let n of Yi)i[n]=e[n];for(let n of Qi)i[n]=t[n];return i}var xa=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),wa=2e4,ka=480,Sa=180*1e3,Ta=900*1e3,Ca=.8,Ea=30*1e3,Pa=1e5,Aa=4,Ma=50;function Xi(r){if(typeof r!="string")return r;let e=document.querySelector(r);if(!e)throw new Error(`EmbeddedDesigner container not found: ${r}`);return e}function La(r){let e=(r??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var Ha={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."}},hi=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"||!xa.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},n=this.identityEstablished||i.type==="seatlayer.designer.ready"||i.type==="seatlayer.designer.saved"||i.type==="seatlayer.designer.published"||i.type==="seatlayer.designer.close",s=this.options.expectedChartId!==void 0&&i.chartId!==this.options.expectedChartId&&(n||i.chartId!==void 0),o=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(n||i.workspaceId!==void 0);if(s||o){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=La(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=Xi(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 n=this.options.loadingTimeoutMs??wa;n>0&&Number.isFinite(n)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},n))}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,n=t.style.getPropertyValue("height"),s=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let o=i();t.style.setProperty("height",`${Pa}px`,"important");let a=i();return n?t.style.setProperty("height",n,s):t.style.removeProperty("height"),!(a-o>Aa)&&o>=Ma?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??ka;if(this.fillMode==="container"&&this.containerEl){let n=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));this.setFrameHeight(`${n}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,n]of Object.entries(e))this.frame.style.setProperty(i,n,"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<Ta?t*Ca:t-Sa,n=Math.max(Ea,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},n)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{Xi(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=Xi(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 n=document.createElement("div");n.setAttribute("data-seatlayer-designer-overlay",t),n.setAttribute("role",t==="error"?"alert":"status"),n.setAttribute("aria-live","polite"),Object.assign(n.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:"#101625",color:"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:"hidden"}),t==="loading"?this.buildSkeleton(n):this.buildErrorCard(n,i??"load"),e.append(n),this.overlay=n}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
|
|
2173
|
+
`;function st(){if(document.getElementById(Jr))return;let r=document.createElement("style");r.id=Jr,r.textContent=na+Zr+Xr+Qr+Or,document.head.appendChild(r)}var on=require("@seatlayer/core"),an=require("@seatlayer/core/core/cdnAsset");var pa=require("@seatlayer/core/core/cdnAsset");function g(r,e){let t=(0,on.t)(r);return t===r?e:t}function ln(r){if(typeof r=="string"){let e=document.querySelector(r);if(!e)throw new Error(`seatmap: container "${r}" not found`);return e}if(!(r instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return r}function R(r){return String(r??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}function cn(r,e,t){let i=e.find(s=>rt(s))??null;if(r.replaceChildren(),!i)return r.textContent=t.slice(0,1).toUpperCase(),null;let n=document.createElement("img");return n.alt="",n.referrerPolicy="no-referrer",n.src=i,r.appendChild(n),i}var ot=null;function ei(){if(ot!==null)return ot;try{if(typeof document>"u")return ot=!1;ot=!!document.createElement("canvas").getContext("webgl2")}catch{ot=!1}return ot}function qi(r){return(0,an.cdnAssetUrl)(r)}var Ct=null;function Et(){return Ct||(Ct=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(qi("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")).catch(e=>{throw Ct=null,e}),Ct)}function Wi(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Et().catch(()=>{})}async function ti(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(qi("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function dn(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(qi("seatlayer-checkout.mjs")):Promise.resolve().then(()=>(sn(),nn))}function pn(r){return r==="unavailable_for_event"||r==="payments_off_for_event"?r:"not_configured"}function ii(r,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},n=new Date(r);if(e)try{return n.toLocaleString(t,{...i,timeZone:e})}catch{}return n.toLocaleString(t,i)}async function ri(r,e){let t=r.overlay.productionElements;if(!t?.some(n=>n.contentImageUrl))return r;let i=await Promise.all(t.map(async n=>{if(!n.contentImageUrl)return n;try{let s=await e(n.contentImageUrl);if(!s){let{contentImageUrl:o,...a}=n;return a}return{...n,runtimeContentImageUrl:s}}catch{let{contentImageUrl:s,...o}=n;return o}}));return{...r,overlay:{...r.overlay,productionElements:i}}}async function ni(r,e){if(r)try{let t=await e(r);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}var Pe=require("@seatlayer/core/view/panoramaDelivery");function si(r){let{root:e,source:t,caption:i,real:n,closeLabel:s,dragHint:o,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:d,onClose:h}=r,p=r.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=P=>u.querySelector(P)?.remove();p.title===!1?b(".sl-view-title"):u.querySelector(".sl-view-title").textContent=a,p.caption===!1?b(".sl-view-cap"):u.querySelector(".sl-view-cap").textContent=i,u.querySelector(".sl-view-x").setAttribute("aria-label",s),p.badge===!1?b(".sl-view-badge"):u.querySelector(".sl-view-badge").textContent=n?l:c,u.querySelector(".sl-view-hint").textContent=o,e.appendChild(u);let m=u.querySelector(".sl-view-pano"),v=(0,Pe.planPanoramaDelivery)(t,(0,Pe.browserPanoramaConstraints)()),x=new AbortController;m.style.backgroundImage=`url(${JSON.stringify(v.initialUrl)})`;let T=()=>{};v.upgradeUrl&&(T=(0,Pe.schedulePanoramaUpgrade)(()=>{d(v.upgradeUrl).then(P=>!P||x.signal.aborted?null:(0,Pe.loadPanoramaImage)(P,x.signal).then(()=>P)).then(P=>{!P||!u.isConnected||x.signal.aborted||(m.style.backgroundImage=`url(${JSON.stringify(P)})`)}).catch(()=>{})}));let A=70,f=35,y=1,S=m.clientHeight||1,L=m.clientWidth||1,E=-(S*(180/A)*2/2-L/2),O=0,V=()=>{let P=m.clientHeight||1,We=P*(180/A)*y,Be=Math.max(0,We-P),yt=Math.min(Be/2,f/180*We);O=Math.min(yt,Math.max(-yt,O)),m.style.backgroundSize=`auto ${We}px`,m.style.backgroundPosition=`${E}px ${O-Be/2}px`};V();let he=!1,le=0,re=0,ne=P=>{he=!0,le=P.clientX,re=P.clientY,m.classList.add("drag"),m.setPointerCapture?.(P.pointerId)},F=P=>{he&&(E+=P.clientX-le,O+=P.clientY-re,le=P.clientX,re=P.clientY,V())},qe=P=>{he=!1,m.classList.remove("drag"),m.releasePointerCapture?.(P.pointerId)},vt=P=>{P.preventDefault(),y=Math.min(2.4,Math.max(1,y+(P.deltaY<0?.12:-.12))),V()};m.addEventListener("pointerdown",ne),m.addEventListener("pointermove",F),m.addEventListener("pointerup",qe),m.addEventListener("pointercancel",qe),m.addEventListener("wheel",vt,{passive:!1});let B=u.querySelector(".sl-view-x");B.addEventListener("click",h);let j=P=>{P.key==="Escape"&&(P.stopPropagation(),h())};return u.addEventListener("keydown",j),B.focus(),{element:u,dispose(){T(),x.abort(),m.removeEventListener("pointerdown",ne),m.removeEventListener("pointermove",F),m.removeEventListener("pointerup",qe),m.removeEventListener("pointercancel",qe),m.removeEventListener("wheel",vt),u.removeEventListener("keydown",j),B.removeEventListener("click",h)}}}var hn=6e4,oi=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.navigationMode_="orbit";this.overlay=null;this.handle=null;this.generation=0;this.seatViewGeneration=0;this.seatViewElement=null;this.seatViewDispose=null;this.options=e}get buyerView(){return this.buyerView_}get targetSeatId(){return this.targetSeatId_}get navigationMode(){return this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!ei()?!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.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(),n=this.options.doc();if(!t||!i||!n)throw new Error("seat_view_unavailable");let s=++this.seatViewGeneration,o,a,l=!1;if(t.viewUrl){let b=t.viewMeta?.previewUrl,m=!!b&&b!==t.viewUrl,v=m?await this.options.resolveAsset(b):null,x=m?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(s!==this.seatViewGeneration||!x||m&&!v)return;o={url:x,...v?{previewUrl:v}:{},...m?{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=(0,ai.seatViewDisclosure)(o),l=(0,ai.isAuthoredSeatView)(o)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:b}=await ti();if(s!==this.seatViewGeneration)return;let m=n.floors?.find(T=>T.objects.some(A=>A.type==="row"&&A.id===t.rowId)),v=t.focalPoint??m?.focalPoint??n.focalPoint,x=b(t,v,[...this.options.seats()]);o={url:x.url,generated:!0},a=(0,Ve.t)("picker.illustrationCaption",{m:x.distanceM})}if(s!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(i,n),st();let c=this.options.chrome??{},d=g("picker.dragToLookAround","Drag to look around \xB7 pinch or scroll to zoom"),h=(0,Ve.t)("picker.viewFromSeat",{label:t.displayLabel||t.label}),p=l?(0,Ve.t)("picker.real360"):(0,Ve.t)("picker.preview"),u=si({root:i,source:o,caption:a,real:l,closeLabel:g("picker.close","Close"),dragHint:d,viewFromSeatLabel:h,real360Label:(0,Ve.t)("picker.real360"),previewLabel:(0,Ve.t)("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:p,real:l,generated:!!o.generated,dragHint:d})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let i=t.floors.findIndex(n=>n.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)}setNavigationMode(e){return this.navigationMode_=e,this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.setNavigationMode(e),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}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)?hn/2:hn}async enter3D(e){let t=this.options.host(),i=this.options.doc();if(!t||!i||this.overlay)throw new Error("venue_3d_unavailable");st(),this.prepareHostTheme(t,i);let n=document.createElement("div");n.className="sl-view3d",n.setAttribute("role","group"),n.setAttribute("aria-label",g("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(n.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let s=document.createElement("div");s.className="sl-view3d-loading",s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),s.textContent=g("picker.loading3d","Building the 3D venue\u2026"),n.appendChild(s),t.appendChild(n),this.overlay=n;let o=++this.generation;if(this.reducedMotion()?n.style.opacity="1":requestAnimationFrame(()=>{n.style.opacity="1"}),await this.nextPaint(),!(o!==this.generation||this.overlay!==n))try{let[a,l]=await Promise.all([Et(),this.options.loadEventConfiguration()]),c=l?await ri(l,this.options.resolveAsset):null,d=await ni(i.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(o!==this.generation||this.overlay!==n)return;let h={doc:i,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};s.textContent=g("picker.building3d","Building venue geometry\u2026");let p=await a.prepareVenue3D(h);if(o!==this.generation||this.overlay!==n)return;let u=this.options.chrome??{},b=a.mountVenue3D(n,{...h,prepared:p},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,...u.view3dCaption===!1||u.view3dSeatStepper===!1||u.view3dControlDock===!1?{chrome:{caption:u.view3dCaption!==!1,seatStepper:u.view3dSeatStepper!==!1,controlDock:u.view3dControlDock!==!1}}:{},seatViewActionLabel:m=>this.findSeat(m)?.viewUrl?g("picker.openAuthored360","Open venue 360\xB0"):g("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:m=>this.toggleSeat(m),onSeatInspect:m=>this.toggleSeat(m),onViewTargetChange:m=>{this.targetSeatId_=m,this.options.onViewChange("venue3d",m)},...this.options.enableSeatView?{getSeatView:m=>this.seatViewFor3D(m)}:{}});if(o!==this.generation||this.overlay!==n){b.dispose();return}this.handle=b,this.buyerView_="venue3d",this.targetSeatId_=e??null,b.setNavigationMode(this.navigationMode_),requestAnimationFrame(()=>s.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await b.flyToSeat(e)}catch(a){if(o!==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.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let i=this.handle,n=this.overlay;if(this.options.restoreMap(),t&&i&&n){n.style.pointerEvents="none";let s=()=>{this.buyerView_!=="map"||this.overlay!==n||(n.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(n.style.opacity="0",s()):(requestAnimationFrame(()=>{n.style.opacity="0"}),setTimeout(s,280));return}if(this.handle=null,this.overlay=null,!n){try{i?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{i?.dispose()}catch{}n.remove(),this.options.restoreMap();return}n.style.pointerEvents="none",requestAnimationFrame(()=>{n.style.opacity="0"}),setTimeout(()=>{try{i?.dispose()}catch{}n.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,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),i.resize(),i.setNavigationMode(this.navigationMode_),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(n=>n.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,n=!!i&&i!==t.viewUrl,s=n?await this.options.resolveAsset(i):null,o=n?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!o||n&&!s)throw new Error("seat_view_unavailable");return{url:o,...s?{previewUrl:s}:{},...n?{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:g("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}};var ha={host:"web",platform:"web",bundle:"",protocol:0,chromeOwner:"web"},ua={...ha},li=null,un=null;function ma(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function fa(){let r=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:r(ma()),documentMs:li==null?0:r(li),handshakeMs:li==null||un==null?0:r(un-li)}}function mn(){let{host:r,platform:e,bundle:t,protocol:i,chromeOwner:n}=ua,s=fa();return{host:r,platform:e,...t?{bundle:t}:{},...i?{protocol:i}:{},chromeOwner:n,bootMs:s.bootMs,documentMs:s.documentMs,handshakeMs:s.handshakeMs}}var fn=new Set;function Ae(r){return fn.has(r)?"repeat":"cold"}function ci(r){let e=Ae(r);return fn.add(r),e}function q(r){return typeof r=="number"&&Number.isFinite(r)&&r>=0?Math.round(r):0}function ga(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function ba(r){if(!/^[A-Za-z0-9_-]{1,80}$/.test(r.event))return null;let e=r.performanceProfile??{};return{event:r.event,scope:r.scope,surface:r.surface,outcome:r.outcome,stage:r.stage?.slice(0,32)??"",ms:q(r.ms),api:q(e.loadChartAndStatuses)||q(e.loadChart),scene:q(e.buildScene),panel:q(e.buildBuyerControls),paint:q(e.firstPaint),normalize:q(e.normalizeBuyerModel),renderer:q(e.createRenderer),seats:q(r.seats),floors:q(r.floors),view:r.view??"map",load:r.load??Ae(r.event),transport:r.transport??"pubapi",chartBytes:q(r.chartDelivery?.bytes),chartCache:r.chartDelivery?.cache??"",server:q(r.chartDelivery?.serverMs),r2Head:q(r.chartDelivery?.r2HeadMs),cacheLookup:q(r.chartDelivery?.cacheLookupMs),r2Get:q(r.chartDelivery?.r2GetMs),transform:q(r.chartDelivery?.transformMs),...mn(),availabilityMs:q(e.loadStatuses)}}var va=new Set;function ye(r){let e=ba(r);if(e){for(let t of va)try{t(e)}catch{}typeof fetch>"u"||ga()||fetch(`${r.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 pi=require("@seatlayer/core/core/color");function we(r){if(!r)return null;let e=r.trim().toLowerCase();if(e==="white")return{r:255,g:255,b:255};if(e==="black")return{r:0,g:0,b:0};let t=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(e)?.[1];if(t){let n=t.length<=4?[...t].map(s=>`${s}${s}`).join(""):t;return{r:Number.parseInt(n.slice(0,2),16),g:Number.parseInt(n.slice(2,4),16),b:Number.parseInt(n.slice(4,6),16)}}let i=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i.exec(e);return i?{r:Math.max(0,Math.min(255,Number(i[1]))),g:Math.max(0,Math.min(255,Number(i[2]))),b:Math.max(0,Math.min(255,Number(i[3])))}:null}function di(r){return(0,pi.relativeLuminance255)([r.r,r.g,r.b])}function xe(r,e){let t=we(r),i=we(e);if(!t||!i)return null;let n=Math.max(di(t),di(i)),s=Math.min(di(t),di(i));return(n+.05)/(s+.05)}function Me(r,e="#172033",t="#eef1f8"){return(xe(e,r)??0)>=(xe(t,r)??0)?e:t}function ya(r){return(0,pi.rgb255ToHex)(r.r,r.g,r.b)}function Yi(r,e,t){let i=we(r),n=we(e);if(!i||!n)return null;let s=Math.max(0,Math.min(1,t));return ya({r:i.r*s+n.r*(1-s),g:i.g*s+n.g*(1-s),b:i.b*s+n.b*(1-s)})}function gn(r,e,t,i){if((xe(r,t)??4.5)>=4.5&&(xe(r,i)??4.5)>=4.5)return r;if(!we(r)||!we(e))return e;for(let n=.15;n<=1;n+=.05){let s=Yi(r,e,1-n);if(s&&(xe(s,t)??0)>=4.5&&(xe(s,i)??0)>=4.5)return s}return e}function bn(r,e){let t=e??r["--sl-bg"],i=we(t)?Me(t)==="#172033":!1,n=we(r["--sl-bg"])?Me(r["--sl-bg"])==="#172033":!1;if(i===n)return null;let s=i?"#ffffff":"#1a2234",o=Me(t),a=r["--sl-accent"];return{"--sl-bg":t,"--sl-surface":s,"--sl-text":o,"--sl-muted":i?"#667085":"#a5aec2","--sl-line":i?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-accent-text":gn(a,o,t,s)}}var vn={light:{background:"#ffffff",surface:"#f6f7fb",text:"#172033",muted:"#667085",line:"rgba(23,32,51,.16)",map:"#e9edf4"},dark:{background:"#0f1522",surface:"#1a2234",text:"#eef1f8",muted:"#a5aec2",line:"rgba(165,174,194,.24)",map:"#0f1522"}};function xa(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function Pt(r){if(r)return r==="auto"?xa()?"dark":"light":r}function at(r,e=r?.mode){if(r?.map)return r.map;let t=Pt(e);return t?{background:vn[t].map}:null}function hi(r){let e;try{e=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!e)return()=>{};let t=i=>r(i.matches);return typeof e.addEventListener=="function"?e.addEventListener("change",t):e.addListener?.(t),()=>{typeof e.removeEventListener=="function"?e.removeEventListener("change",t):e.removeListener?.(t)}}function At(r,e,t){let i=t?vn[t]:null,n=e?.background??i?.background??r?.background??"#0f1522",s=we(n)?Me(n)==="#172033":!1,o=e?.surface??i?.surface??(s?"#ffffff":"#1a2234"),a=e?.accent??r?.accent??"#f4b740",l=r?.accentInk,c=e?.accentInk??(l&&(xe(l,a)??4.5)>=4.5?l:Me(a,"#1a1200","#ffffff")),d=i?void 0:r?.textColor,h=e?.text??i?.text??(d&&(xe(d,n)??4.5)>=4.5&&(xe(d,o)??4.5)>=4.5?d:Me(n));return{"--sl-accent":a,"--sl-accent-ink":c,"--sl-accent-text":gn(a,h,n,o),"--sl-bg":n,"--sl-surface":o,"--sl-text":h,"--sl-muted":e?.muted??i?.muted??(s?"#667085":"#a5aec2"),"--sl-line":e?.line??i?.line??(s?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),"--sl-font":e?.fontFamily??r?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}var Mt=class r{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 at(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??r.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=hi(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};var yn=require("@seatlayer/core");function xn(r,e,t){let i=r.doc,n=i?.theme??{},s=r.categoryAvailability(),o=r.getGAAreas(),a=r.getFloors(),l=i?.floors?.flatMap(d=>d.objects)??i?.objects??[],c=new Map;for(let d of l)d.type==="section"&&c.set(d.id,{id:d.id,label:d.label,...d.displayLabel?{displayLabel:d.displayLabel}:{},...d.zone?{zoneId:d.zone}:{}});return{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:(0,yn.getLocale)()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...n.accent?{accent:n.accent}:{},...n.accentInk?{accentInk:n.accentInk}:{},...n.background?{background:n.background}:{},...n.textColor?{textColor:n.textColor}:{},...n.brandName?{brandName:n.brandName}:{},...n.logoUrl?{logoUrl:n.logoUrl}:{},attributionRequired:!n.hideBadge},features:{ga:o.length>0,tiers:!!i?.categories.some(d=>d.tiers?.length),floors:a.length>1,zones:!!i?.zones?.length,sections:c.size>0,bestAvailable:!0,accessibilityFilter:!0,limitedViewFilter:!0,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(i?.categories??[]).filter(d=>!d.notForSale).map(d=>({key:d.key,label:d.label,color:d.color,price:d.price??d.tiers?.[0]?.price??0,available:s[d.key]??0,tiers:(d.tiers??[]).map(h=>({id:h.id,name:h.name,price:h.price,...h.currency?{currency:h.currency}:{}}))})),zones:(i?.zones??[]).map(d=>({id:d.id,label:d.label,...d.color?{color:d.color}:{}})),sections:[...c.values()],gaAreas:o,bestAvailableZones:r.getBestAvailableZones()},map:{floors:a,activeFloorId:r.getActiveFloorId()||a[0]?.id||null,floorMode:r.isFloorOverview()?"all":"single",floorLabelStyle:r.getRenderer()?.getFloorLabelStyle?.()??"number",rung:r.getRung(),focusedSectionId:r.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:r.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:e.targetSeatId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:r.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:r.getAccessNeeds()},selection:{seats:r.getSelection(),validity:r.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var wa="https://api.seatlayer.io",wn=10;function ka(r){if(typeof r=="string"){let e=document.querySelector(r);if(!e)throw new Error(`seatmap: container "${r}" not found`);return e}if(!(r instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return r}var ui=class{constructor(e){this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=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.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.realtime=null;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??wn,this.colorblindSafe_=e.colorblindSafe??!1;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()}},n=(e.apiBase??wa).replace(/\/+$/,"");this.apiBase=n;let s=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Yt({base:n,event:e.event,publicKey:e.publicKey,accessHooks:i,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=s?.access??tt(e,i);let o=s?.api??new Te(n,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=o,this.controller=new $.PickerController({transport:o,eventKey:e.event,maxSelection:this.maxSelection_,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,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),onSelectionLimit:a=>this.opts.onSelectionLimit?.(a),onHold:a=>this.opts.onHold?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldRestored:a=>this.opts.onHoldRestored?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:a=>{let l=this.controller.getGAAreas().find(c=>c.id===a);l&&(this.opts.onGAClick?.(l),this.opts.onGAPrompt?.({area:l,selected:{},min:0,max:Math.max(0,Math.min(l.available,(this.opts.maxSelection??wn)-this.controller.getSelection().length)),tiers:Zt(l),confirm:c=>{let d=typeof c=="number"?c:Object.values(c).reduce((h,p)=>h+p,0);this.holdGA(l.id,d)},cancel:()=>{}}))},onError:a=>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??Mt.groundFor(e.theme?.mode)??null}),this.hostSurface=new Mt({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 nt(e.event,(a,l)=>o.asset(a,l)),this.immersive=new oi({host:()=>this.hostEl,doc:()=>this.controller.doc,seats:()=>this.controller.getExpandedSeats(),selection:()=>this.controller.getSelection(),status:a=>this.controller.getStatus(a),select:a=>this.controller.select([a]),deselect:a=>this.controller.deselect([a]),loadEventConfiguration:()=>this.controller.loadEventConfiguration(),resolveAsset:a=>this.buyerAssetUrls.resolve(a),enable3D:e.enable3D!==!1,enableSeatView:e.enableSeatView!==!1,max3DSeats:e.max3DSeats,...e.chrome?{chrome:e.chrome}:{},restoreMap:()=>this.controller.refitCurrentView(),onViewChange:(a,l)=>{this.opts.onBuyerViewChange?.({view:a,...l?{seatId:l}:{}}),this.notifyMapStateChange()},onSeatViewChange:a=>this.opts.onSeatViewChange?.(a),onError:a=>this.opts.onError?.(a)}),this.lastReportedViewRung_=this.controller.getRung()}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung();e!==this.lastReportedViewRung_&&(this.lastReportedViewRung_=e,this.opts.onMapStateChange?.())}notifyMapStateChange(){this.lastReportedViewRung_=this.controller.getRung(),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0,await(0,$.loadLocale)(this.opts.locale),this.opts.messages&&(0,$.setStringOverrides)(this.opts.messages),this.mount=ka(this.opts.container);let t=document.createElement("div");t.lang=(0,$.getLocale)(),t.dir=(0,$.localeDirection)(),t.style.width="100%",t.style.height="100%",t.style.position="relative",this.mount.appendChild(t),this.hostEl=t,this.applyInteractionState();let i=await this.controller.render(t);if(!i)return ye({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:Ae(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(t),this;if(this.eventLocale=i.locale??null,!this.opts.locale&&this.eventLocale&&await this.setLocale(this.eventLocale),this.buildLanguageSwitcher(t),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=i.mode==="test"?"test":"live",this.eventInfo={name:i.eventName,venue:i.venue??null,startsAt:i.startsAt??null,timezone:i.timezone??null,currency:i.currency??this.opts.currency??"USD",posterUrl:i.posterUrl??null,salesClosed:i.salesClosed},this.opts.seatTooltip!==!1){let n=document.createElement("div");n.setAttribute("role","tooltip"),n.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);',t.appendChild(n),this.tipEl=n,this.onTipMove=s=>{let o=t.getBoundingClientRect();this.tipPos={x:s.clientX-o.left,y:s.clientY-o.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},t.addEventListener("mousemove",this.onTipMove)}if(i.mode==="test"&&this.opts.showTestModeIndicator!==!1){t.style.overflow="hidden";let n=document.createElement("div");n.dataset.slI18n="testMode",n.textContent=(0,$.t)("picker.testMode"),n.setAttribute("aria-label",(0,$.t)("picker.testMode")),n.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;",t.appendChild(n)}return this.opts.showAttribution!==!1&&this.buildBadge(t),ye({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:i.performanceProfile,chartDelivery:i.chartDelivery,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:ci(this.opts.event),transport:"pubapi"}),this}buildBadge(e){if(this.controller.doc?.theme?.hideBadge)return;let t=document.createElement("a");t.dataset.slI18n="badge",t.href="https://seatlayer.io",t.target="_blank",t.rel="noopener noreferrer",t.setAttribute("aria-label",(0,$.t)("picker.poweredBy")),t.style.cssText='position:absolute;bottom:10px;right:12px;z-index:5;display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;background:rgba(255,255,255,.92);color:#4a5163;text-decoration:none;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:.02em;box-shadow:0 2px 8px rgba(0,0,0,.12);';let i=document.createElement("span");i.setAttribute("aria-hidden","true"),i.style.cssText="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee",i.innerHTML=Jt;let n=document.createElement("span");n.textContent=(0,$.t)("picker.poweredBy"),t.append(i,n),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,n=this.tipPos.x+14,s=this.tipPos.y-i-12;n+t>e-8&&(n=this.tipPos.x-t-14),s<8&&(s=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,n)}px`,this.tipEl.style.top=`${Math.max(8,s)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=(0,$.formatMoney)(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 n=document.createElement("div");n.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let s=document.createElement("span");s.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",s.style.background=e.categoryColor;let o=document.createElement("span");o.textContent=e.categoryLabel;let a=document.createElement("span");if(a.style.cssText="margin-left:auto;font-weight:700;color:#fff",a.textContent=t,n.append(s,o,a),this.tipEl.replaceChildren(i,n),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=e.status==="held"?(0,$.t)("map.statusHeld"):(0,$.t)("map.statusTaken"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(n=>(0,$.resolveLocale)(n)).filter((n,s,o)=>o.indexOf(n)===s);if(t.length<2)return;let i=document.createElement("select");i.setAttribute("aria-label",(0,$.t)("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 n of t){let s=document.createElement("option");s.value=n,s.textContent=$.LOCALE_NAMES[n]??n,s.selected=n===(0,$.getLocale)(),i.appendChild(s)}i.addEventListener("change",()=>{this.setLocale(i.value)}),e.appendChild(i)}async setLocale(e){let t=(0,$.getLocale)(),i=await(0,$.loadLocale)(e);if(this.opts.messages&&(0,$.setStringOverrides)(this.opts.messages),i===t)return i;if(this.hostEl){this.hostEl.lang=i,this.hostEl.dir=(0,$.localeDirection)();for(let n of this.hostEl.querySelectorAll("[data-sl-i18n]"))if(n.dataset.slI18n==="testMode")n.textContent=(0,$.t)("picker.testMode"),n.setAttribute("aria-label",(0,$.t)("picker.testMode"));else if(n.dataset.slI18n==="badge"){n.setAttribute("aria-label",(0,$.t)("picker.poweredBy"));let s=n.querySelector("span:last-child");s&&(s.textContent=(0,$.t)("picker.poweredBy"))}}return this.controller.refreshMapCopy(),i}getMode(){return this.mode_}getPickerState(){return xn(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_})}getCategoryAvailability(){return this.controller.categoryAvailability()}getBestAvailableZones(){return this.controller.getBestAvailableZones()}getActiveFloorId(){return this.controller.getActiveFloorId()||null}getRung(){return this.controller.getRung()}getFocusedSection(){return this.controller.getFocusedSection()}focusSection(e){if(this.immersive.buyerView==="venue3d"&&this.immersive.focusSection(e)){this.notifyMapStateChange();return}this.controller.focusSection(e),this.notifyMapStateChange()}overview(){if(this.immersive.focusOverview()){this.notifyMapStateChange();return}this.controller.overview(),this.notifyMapStateChange()}setRung(e){this.controller.setRung(e),this.notifyMapStateChange()}setCategoryFilter(e,t=!1){this.categoryFilter_=e?[...e]:null,this.controller.setCategoryFilter(e),t&&this.controller.focusCategoryFilter(e),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.notifyMapStateChange()}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let n=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(n?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:n?"selection_count_mismatch":"selection_invalid",selection:t})}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}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,i={}){try{return await this.holdGAOrThrow(e,t,i)}catch(n){return this.opts.onError?.(n),null}}async holdGAOrThrow(e,t,i={}){let n=await this.controller.holdGA(e,t,i);return n?{holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(n){return this.opts.onError?.(n),null}}async bestAvailableOrThrow(e,t,i={}){let n=await this.controller.bestAvailable(e,t,i);return n?{holdId:n.holdId,expiresAt:n.expiresAt,labels:n.labels,seats:n.seats,items:n.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(n){return this.opts.onError?.(n),null}}async replaceTableQuantityOrThrow(e,t,i){let n=await this.controller.replaceTableQuantity(e,t,i);return n?{holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.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()}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 ue({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:Qe(this.controller,{flashOnLiveChange:!0,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="The seat map didn\u2019t load.",t.appendChild(i);let n=document.createElement("button");n.type="button",n.textContent="Try again",n.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;",n.addEventListener("click",()=>{this.destroy(),this.render().catch(s=>this.opts.onError?.(s))}),t.appendChild(n),e.appendChild(t)}destroy(){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.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 Qi=["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"],Sa={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 kn(r){let e={};for(let t of Qi)e[t]=(...i)=>{let n=r();return n?n[t](...i):Sa[t]()};return e}var Xi=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Zi=[...Xi,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],Ji=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function Sn(r,e,t){let i={container:r};for(let n of Zi)i[n]=e[n];for(let n of Ji)i[n]=t[n];return i}var Ta=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),Ca=2e4,Ea=480,Pa=180*1e3,Aa=900*1e3,Ma=.8,La=30*1e3,Ha=1e5,Ra=4,Oa=50;function er(r){if(typeof r!="string")return r;let e=document.querySelector(r);if(!e)throw new Error(`EmbeddedDesigner container not found: ${r}`);return e}function Ia(r){let e=(r??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var _a={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."}},mi=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"||!Ta.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},n=this.identityEstablished||i.type==="seatlayer.designer.ready"||i.type==="seatlayer.designer.saved"||i.type==="seatlayer.designer.published"||i.type==="seatlayer.designer.close",s=this.options.expectedChartId!==void 0&&i.chartId!==this.options.expectedChartId&&(n||i.chartId!==void 0),o=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(n||i.workspaceId!==void 0);if(s||o){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=Ia(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=er(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 n=this.options.loadingTimeoutMs??Ca;n>0&&Number.isFinite(n)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},n))}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,n=t.style.getPropertyValue("height"),s=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let o=i();t.style.setProperty("height",`${Ha}px`,"important");let a=i();return n?t.style.setProperty("height",n,s):t.style.removeProperty("height"),!(a-o>Ra)&&o>=Oa?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??Ea;if(this.fillMode==="container"&&this.containerEl){let n=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));this.setFrameHeight(`${n}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,n]of Object.entries(e))this.frame.style.setProperty(i,n,"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<Aa?t*Ma:t-Pa,n=Math.max(La,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},n)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{er(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=er(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 n=document.createElement("div");n.setAttribute("data-seatlayer-designer-overlay",t),n.setAttribute("role",t==="error"?"alert":"status"),n.setAttribute("aria-live","polite"),Object.assign(n.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:"#101625",color:"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:"hidden"}),t==="loading"?this.buildSkeleton(n):this.buildErrorCard(n,i??"load"),e.append(n),this.overlay=n}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
|
|
2148
2174
|
@media (prefers-reduced-motion: no-preference) {
|
|
2149
2175
|
@keyframes seatlayer-designer-shimmer {
|
|
2150
2176
|
0% { background-position: -320px 0; }
|
|
@@ -2154,7 +2180,7 @@
|
|
|
2154
2180
|
animation: seatlayer-designer-shimmer 1.25s ease-in-out infinite;
|
|
2155
2181
|
background-size: 640px 100%;
|
|
2156
2182
|
}
|
|
2157
|
-
}`,e.append(t);let i="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",n=document.createElement("div");Object.assign(n.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});let s=c=>{let d=document.createElement("div");return d.className="sl-shimmer",Object.assign(d.style,{background:i,borderRadius:"8px"}),Object.assign(d.style,c),d};n.append(s({height:"40px",width:"100%",flex:"0 0 auto"}));let o=document.createElement("div");Object.assign(o.style,{display:"flex",gap:"14px",flex:"1 1 auto",minHeight:"0"}),o.append(s({width:"220px",height:"100%",flex:"0 0 auto"})),o.append(s({flex:"1 1 auto",height:"100%"})),n.append(o),e.append(n);let a=document.createElement("div");Object.assign(a.style,{position:"relative",zIndex:"1",display:"flex",alignItems:"center",gap:"10px",padding:"10px 16px",borderRadius:"999px",background:"rgba(16, 22, 37, 0.72)",fontSize:"13px",fontWeight:"500",letterSpacing:"0.01em"});let l=document.createElement("span");l.className="sl-shimmer",Object.assign(l.style,{width:"9px",height:"9px",borderRadius:"50%",background:i,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let i=Ha[t],n=document.createElement("div");Object.assign(n.style,{maxWidth:"420px",margin:"0 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});let s=document.createElement("h2");s.textContent=i.title,Object.assign(s.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let o=document.createElement("p");o.textContent=i.body,Object.assign(o.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()),n.append(s,o,a),e.append(n)}};var C=require("@seatlayer/core"),_t=require("@seatlayer/core/view3d/crossfade/panorama"),co=require("@seatlayer/core/core/seatConfidence");function wn(r){return r?.previousPrice!=null&&r.previousPrice>r.price?r.previousPrice:null}function kn(r){return Ra(r)+(r.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!r.collapsed}">${r.esc(r.moreLabel)}</button>`:"")+Oa(r.status)}function Ra(r){let{esc:e,money:t}=r;return r.categories.map(i=>{let n=r.priceOf(i),s=r.rangeOf(i),o=r.offerOf(i.key),a=wn(o),l=r.activeKey===i.key;return`<div class="sl-price-row${r.bandKeys!=null&&!r.bandKeys.has(i.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(i.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(r.titleFor(i,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(r.colorOf(i))}"></span><span class="sl-price-label">${e(i.label)}`+(o?.offerName?`<small class="sl-price-offer">${e(o.offerName)}</small>`:"")+`</span><span class="sl-price-left">${e(r.leftCount(r.left[i.key]??0))}</span>`+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(s!=null?`<span class="sl-price-amt">${s.min===s.max?e(t(s.min)):`${e(t(s.min))}\u2013${e(t(s.max))}`}</span>`:n!=null?`<span class="sl-price-amt">${e(t(n))}</span>`:"")+"</div>"}).join("")}function Oa(r){let e=t=>t.replace(/[&<>"']/g,i=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[i]);return`<div class="sl-status-key" aria-label="${e(r.legend)}"><span class="sl-status-item"><i class="sl-status-icon held" aria-hidden="true"><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></i>${e(r.held)}</span><span class="sl-status-item"><i class="sl-status-icon sold" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M7 17L17 7"/></svg></i>${e(r.sold)}</span></div>`}function Zi(r){let e=Math.abs(r.scrollLeft),t=e>2,i=e+r.clientWidth<r.scrollWidth-2;return r.dataset.fadeStart=String(t),r.dataset.fadeEnd=String(i),{start:t,end:i}}function Sn(r){let{esc:e,money:t}=r;return r.categories.map(i=>{let n=r.rangeOf(i),s=r.priceOf(i),o=n?n.min===n.max?t(n.min):`${t(n.min)}+`:s!=null?t(s):null,a=Object.prototype.hasOwnProperty.call(r.left,i.key)&&r.left[i.key]<=0,l=wn(r.offerOf(i.key)),c=o?`${i.label} \u2014 ${o}${a?` (${r.soldOutWord})`:""}`:i.label;return`<button type="button" class="sl-rc" data-cat="${e(i.key)}" aria-pressed="${r.activeKey===i.key}" aria-label="${e(c)}" title="${e(c)}"${a?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(r.colorOf(i))}"></i>`+(l!=null?`<span class="sl-rc-was">${e(t(l))}</span>`:"")+`<span class="sl-rc-t">${e(o??i.label)}</span></button>`}).join("")}function Tn(r,e){let t=r.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 n=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),s=Math.ceil(n.length/4),o=[];for(let a=0;a<n.length;a+=s){let l=n.slice(a,a+s),c=Math.min(...l.map(h=>h.range.min)),d=Math.max(...l.map(h=>h.range.max));o.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 o}var Ia=["on-sale","low","sold-out","presale","closed"];function At(r){return r==null?null:typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}function En(r){return r==null?null:typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}function Cn(r){if(r==null)return null;if(typeof r!="object"||Array.isArray(r))return;let e=r,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 n=e.remaining;if(n!=null&&(typeof n!="number"||!Number.isInteger(n)||n<0))return;let s={index:i,count:t,remaining:n??null};if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;s.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;s.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;s.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let o of["startsAt","endsAt"]){if(e[o]===void 0)continue;let a=En(e[o]);if(a===void 0)return;s[o]=a}return s}function _a(r){if(r==null)return null;if(typeof r!="object"||Array.isArray(r))return;let e=r;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],i=new Set;for(let o of e.channels){if(!o||typeof o!="object"||Array.isArray(o))return;let a=o,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 p=h,u=typeof p.categoryKey=="string"?p.categoryKey.trim():"",b=p.tierId===null?null:typeof p.tierId=="string"&&p.tierId.trim()?p.tierId.trim():void 0,m=At(p.price);if(!u||b===void 0||m===void 0||m===null)return;let v=`${u}\0${b??""}`;if(d.has(v))return;d.add(v),c.push({categoryKey:u,tierId:b,price:m})}i.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let n=[],s=new Set;for(let o of e.objects){if(!o||typeof o!="object"||Array.isArray(o))return;let a=o,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||s.has(l)||!i.has(c))return;s.add(l),n.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:n}}function ui(r){if(!r||typeof r!="object"||Array.isArray(r))return null;let e=r,t=Ia.find(d=>d===e.state);if(!t)return null;let i=At(e.fromPrice),n=At(e.previousPrice);if(i===void 0||n===void 0)return null;let s=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(s===void 0)return null;let o=Cn(e.release);if(o===void 0)return null;let a=e.upcoming===void 0?null:Cn(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let d=[];for(let h of e.prices){if(!h||typeof h!="object"||Array.isArray(h))return null;let p=h,u=typeof p.categoryKey=="string"?p.categoryKey.trim():"";if(!u)return null;let b=At(p.price),m=At(p.previousPrice);if(b==null||m===void 0)return null;let v={categoryKey:u,price:b,previousPrice:m};if(p.offerId!==void 0){if(typeof p.offerId!="string"||!p.offerId.trim())return null;v.offerId=p.offerId.trim()}if(p.offerName!==void 0){if(typeof p.offerName!="string"||!p.offerName.trim())return null;v.offerName=p.offerName.trim()}if(p.remaining!==void 0){if(p.remaining!==null&&(typeof p.remaining!="number"||!Number.isInteger(p.remaining)||p.remaining<0))return null;v.remaining=p.remaining==null?null:p.remaining}for(let x of["startsAt","endsAt"]){if(p[x]===void 0)continue;let S=En(p[x]);if(S===void 0)return null;v[x]=S}d.push(v)}l=d}let c=_a(e.channelPricing);return c===void 0?null:{state:t,fromPrice:i,previousPrice:n,currency:s,release:o,upcoming:a,prices:l,channelPricing:c}}function Pn(r,e){if(!r)return null;let t=null,i=n=>{n!=null&&n>e&&(t===null||n<t)&&(t=n)};for(let n of[r.release,r.upcoming])i(n?.startsAt),i(n?.endsAt);for(let n of r.prices)i(n.startsAt),i(n.endsAt);return t}function mi(r){let e={};for(let t of r?.prices??[])e[t.categoryKey]=t.price;return e}var at=require("@seatlayer/core");function Da(){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 An(r,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,i.lang=(0,at.getLocale)(),i.dir=(0,at.localeDirection)(),r.appendChild(i),Object.entries(Et(void 0,t)).forEach(([s,o])=>i.style.setProperty(s,o)),i.innerHTML=`
|
|
2183
|
+
}`,e.append(t);let i="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",n=document.createElement("div");Object.assign(n.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});let s=c=>{let d=document.createElement("div");return d.className="sl-shimmer",Object.assign(d.style,{background:i,borderRadius:"8px"}),Object.assign(d.style,c),d};n.append(s({height:"40px",width:"100%",flex:"0 0 auto"}));let o=document.createElement("div");Object.assign(o.style,{display:"flex",gap:"14px",flex:"1 1 auto",minHeight:"0"}),o.append(s({width:"220px",height:"100%",flex:"0 0 auto"})),o.append(s({flex:"1 1 auto",height:"100%"})),n.append(o),e.append(n);let a=document.createElement("div");Object.assign(a.style,{position:"relative",zIndex:"1",display:"flex",alignItems:"center",gap:"10px",padding:"10px 16px",borderRadius:"999px",background:"rgba(16, 22, 37, 0.72)",fontSize:"13px",fontWeight:"500",letterSpacing:"0.01em"});let l=document.createElement("span");l.className="sl-shimmer",Object.assign(l.style,{width:"9px",height:"9px",borderRadius:"50%",background:i,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let i=_a[t],n=document.createElement("div");Object.assign(n.style,{maxWidth:"420px",margin:"0 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});let s=document.createElement("h2");s.textContent=i.title,Object.assign(s.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let o=document.createElement("p");o.textContent=i.body,Object.assign(o.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()),n.append(s,o,a),e.append(n)}};var C=require("@seatlayer/core"),Bt=require("@seatlayer/core/view3d/crossfade/panorama"),mo=require("@seatlayer/core/core/seatConfidence");function Tn(r){return r?.previousPrice!=null&&r.previousPrice>r.price?r.previousPrice:null}function Cn(r){return Da(r)+(r.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!r.collapsed}">${r.esc(r.moreLabel)}</button>`:"")+Ba(r.status)}function Da(r){let{esc:e,money:t}=r;return r.categories.map(i=>{let n=r.priceOf(i),s=r.rangeOf(i),o=r.offerOf(i.key),a=Tn(o),l=r.activeKey===i.key;return`<div class="sl-price-row${r.bandKeys!=null&&!r.bandKeys.has(i.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(i.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(r.titleFor(i,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(r.colorOf(i))}"></span><span class="sl-price-label">${e(i.label)}`+(o?.offerName?`<small class="sl-price-offer">${e(o.offerName)}</small>`:"")+`</span><span class="sl-price-left">${e(r.leftCount(r.left[i.key]??0))}</span>`+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(s!=null?`<span class="sl-price-amt">${s.min===s.max?e(t(s.min)):`${e(t(s.min))}\u2013${e(t(s.max))}`}</span>`:n!=null?`<span class="sl-price-amt">${e(t(n))}</span>`:"")+"</div>"}).join("")}function Ba(r){let e=t=>t.replace(/[&<>"']/g,i=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[i]);return`<div class="sl-status-key" aria-label="${e(r.legend)}"><span class="sl-status-item"><i class="sl-status-icon held" aria-hidden="true"><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></i>${e(r.held)}</span><span class="sl-status-item"><i class="sl-status-icon sold" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M7 17L17 7"/></svg></i>${e(r.sold)}</span></div>`}function tr(r){let e=Math.abs(r.scrollLeft),t=e>2,i=e+r.clientWidth<r.scrollWidth-2;return r.dataset.fadeStart=String(t),r.dataset.fadeEnd=String(i),{start:t,end:i}}function En(r){let{esc:e,money:t}=r;return r.categories.map(i=>{let n=r.rangeOf(i),s=r.priceOf(i),o=n?n.min===n.max?t(n.min):`${t(n.min)}+`:s!=null?t(s):null,a=Object.prototype.hasOwnProperty.call(r.left,i.key)&&r.left[i.key]<=0,l=Tn(r.offerOf(i.key)),c=o?`${i.label} \u2014 ${o}${a?` (${r.soldOutWord})`:""}`:i.label;return`<button type="button" class="sl-rc" data-cat="${e(i.key)}" aria-pressed="${r.activeKey===i.key}" aria-label="${e(c)}" title="${e(c)}"${a?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(r.colorOf(i))}"></i>`+(l!=null?`<span class="sl-rc-was">${e(t(l))}</span>`:"")+`<span class="sl-rc-t">${e(o??i.label)}</span></button>`}).join("")}function Pn(r,e){let t=r.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 n=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),s=Math.ceil(n.length/4),o=[];for(let a=0;a<n.length;a+=s){let l=n.slice(a,a+s),c=Math.min(...l.map(h=>h.range.min)),d=Math.max(...l.map(h=>h.range.max));o.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 o}var $a=["on-sale","low","sold-out","presale","closed"];function Lt(r){return r==null?null:typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}function Mn(r){return r==null?null:typeof r=="number"&&Number.isFinite(r)&&r>=0?r:void 0}function An(r){if(r==null)return null;if(typeof r!="object"||Array.isArray(r))return;let e=r,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 n=e.remaining;if(n!=null&&(typeof n!="number"||!Number.isInteger(n)||n<0))return;let s={index:i,count:t,remaining:n??null};if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;s.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;s.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;s.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let o of["startsAt","endsAt"]){if(e[o]===void 0)continue;let a=Mn(e[o]);if(a===void 0)return;s[o]=a}return s}function Na(r){if(r==null)return null;if(typeof r!="object"||Array.isArray(r))return;let e=r;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],i=new Set;for(let o of e.channels){if(!o||typeof o!="object"||Array.isArray(o))return;let a=o,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 p=h,u=typeof p.categoryKey=="string"?p.categoryKey.trim():"",b=p.tierId===null?null:typeof p.tierId=="string"&&p.tierId.trim()?p.tierId.trim():void 0,m=Lt(p.price);if(!u||b===void 0||m===void 0||m===null)return;let v=`${u}\0${b??""}`;if(d.has(v))return;d.add(v),c.push({categoryKey:u,tierId:b,price:m})}i.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let n=[],s=new Set;for(let o of e.objects){if(!o||typeof o!="object"||Array.isArray(o))return;let a=o,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||s.has(l)||!i.has(c))return;s.add(l),n.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:n}}function fi(r){if(!r||typeof r!="object"||Array.isArray(r))return null;let e=r,t=$a.find(d=>d===e.state);if(!t)return null;let i=Lt(e.fromPrice),n=Lt(e.previousPrice);if(i===void 0||n===void 0)return null;let s=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(s===void 0)return null;let o=An(e.release);if(o===void 0)return null;let a=e.upcoming===void 0?null:An(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let d=[];for(let h of e.prices){if(!h||typeof h!="object"||Array.isArray(h))return null;let p=h,u=typeof p.categoryKey=="string"?p.categoryKey.trim():"";if(!u)return null;let b=Lt(p.price),m=Lt(p.previousPrice);if(b==null||m===void 0)return null;let v={categoryKey:u,price:b,previousPrice:m};if(p.offerId!==void 0){if(typeof p.offerId!="string"||!p.offerId.trim())return null;v.offerId=p.offerId.trim()}if(p.offerName!==void 0){if(typeof p.offerName!="string"||!p.offerName.trim())return null;v.offerName=p.offerName.trim()}if(p.remaining!==void 0){if(p.remaining!==null&&(typeof p.remaining!="number"||!Number.isInteger(p.remaining)||p.remaining<0))return null;v.remaining=p.remaining==null?null:p.remaining}for(let x of["startsAt","endsAt"]){if(p[x]===void 0)continue;let T=Mn(p[x]);if(T===void 0)return null;v[x]=T}d.push(v)}l=d}let c=Na(e.channelPricing);return c===void 0?null:{state:t,fromPrice:i,previousPrice:n,currency:s,release:o,upcoming:a,prices:l,channelPricing:c}}function Ln(r,e){if(!r)return null;let t=null,i=n=>{n!=null&&n>e&&(t===null||n<t)&&(t=n)};for(let n of[r.release,r.upcoming])i(n?.startsAt),i(n?.endsAt);for(let n of r.prices)i(n.startsAt),i(n.endsAt);return t}function gi(r){let e={};for(let t of r?.prices??[])e[t.categoryKey]=t.price;return e}var lt=require("@seatlayer/core");function za(){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 Hn(r,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,i.lang=(0,lt.getLocale)(),i.dir=(0,lt.localeDirection)(),r.appendChild(i),Object.entries(At(void 0,t)).forEach(([s,o])=>i.style.setProperty(s,o)),i.innerHTML=`
|
|
2158
2184
|
<div class="sl-head">
|
|
2159
2185
|
<div class="sl-logo" data-ref="logo"></div>
|
|
2160
2186
|
<div class="sl-head-info" data-ref="headInfo">
|
|
@@ -2189,7 +2215,7 @@
|
|
|
2189
2215
|
</div>
|
|
2190
2216
|
<div class="sl-boot" data-ref="boot">
|
|
2191
2217
|
<div class="sl-boot-bar" aria-hidden="true"></div>
|
|
2192
|
-
${
|
|
2218
|
+
${za()}
|
|
2193
2219
|
<span class="sl-boot-say" role="status" aria-live="polite" data-sl-t="picker.loadingSeatMap">${e("picker.loadingSeatMap","Loading seat map\u2026")}</span>
|
|
2194
2220
|
</div>
|
|
2195
2221
|
<div class="sl-toast" data-ref="toast" role="status" aria-live="polite"></div>
|
|
@@ -2232,9 +2258,9 @@
|
|
|
2232
2258
|
<button type="button" class="sl-cta" data-ref="cta" disabled></button>
|
|
2233
2259
|
</div>
|
|
2234
2260
|
</div>
|
|
2235
|
-
</div>`;let n={};return i.querySelectorAll("[data-ref]").forEach(s=>{n[s.dataset.ref]=s}),{root:i,mapHost:n.map,els:n}}function Mn(r){let e=(t,i)=>{for(let n of r.querySelectorAll(`[${t}]`)){let s=n.getAttribute(t);if(!s)continue;let o=(0,at.t)(s);o!==s&&i(n,o)}};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)})}var Y=require("@seatlayer/core");function Ln(r,e){let t=(0,Y.resolveLocale)(r),i=Y.TRANSLATED_LOCALES.includes(t)?t:"en";return e&&(0,Y.setStringOverrides)(e),{locale:i,direction:(0,Y.localeDirection)(i),ready:(0,Y.loadLocale)(r)}}function Hn(r,e,t){r.lang=e.locale,r.dir=e.direction,e.ready.then(t)}function Rn(r,e){if(!r)return null;let t=(e.languages??[]).map(n=>(0,Y.resolveLocale)(n)).filter((n,s,o)=>o.indexOf(n)===s);if(t.length<2)return null;let i=document.createElement("select");i.className="sl-langsel",i.setAttribute("aria-label",e.label);for(let n of t){let s=document.createElement("option");s.value=n,s.textContent=Y.LOCALE_NAMES[n]??n,s.selected=n===(0,Y.getLocale)(),i.appendChild(s)}return i.addEventListener("change",()=>e.onChange(i.value)),r.appendChild(i),i}function On(r,e){e.root.lang=r,e.root.dir=(0,Y.localeDirection)(r),Mn(e.root);for(let i of e.painters)try{i()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==r&&(t.value=r)}var me=require("@seatlayer/core"),_n=require("@seatlayer/core/core/seatConfidence");function Ji(r){return String(r??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function w(r){return String(r??"").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function Le(r){return r?.restrictedView?g("picker.restrictedView","Restricted view"):r?.obstructedView?g("picker.obstructedView","Obstructed view"):""}function Dn(r){if(!r)return"";let e=[];r.premium&&e.push(`<div class="sl-cx-premium"><span class="sl-cx-star" aria-hidden="true">\u2605</span>${g("picker.premiumSeat","Premium seat")}</div>`);let t=Le(r);return t?e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u25D0</span><span class="sl-cx-txt"><b>${t}</b>${r.note?`<span class="sl-cx-note">${w(r.note)}</span>`:""}</span></div>`):r.note&&e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u2139</span><span class="sl-cx-txt"><span class="sl-cx-note">${w(r.note)}</span></span></div>`),e.length?`<div class="sl-cx">${e.join("")}</div>`:""}function er(r){let e=Le(r);if(!e)return"";let t=w(r?.note?r.note:e);return`<span class="sl-cx-mark" role="img" aria-label="${t}" title="${t}">\u25D0</span>`}function lt(r){return r==="no-seat"?g("picker.emptyWheelchairSpace","Empty wheelchair space"):r==="seat-present"?g("picker.accessiblePhysicalSeat","Accessible physical seat"):""}function Bn(r){let e=lt(r);return e?`<div class="sl-cx"><div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u267F</span><span class="sl-cx-txt"><b>${e}</b></span></div></div>`:""}function fi(r){let e=lt(r);return e?`<span class="sl-cx-mark" role="img" aria-label="${e}" title="${e}">\u267F</span>`:""}function tr(r,e){if(!r)return"";let t=e?g("picker.viewFromThisSeat","View from this seat"):g("picker.seeItIn3d","See it in 3D");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>${t}</span></button>`}function $n(r){if(!r)return"";let e=r.previous.label||r.previous.id,t=r.next.label||r.next.id;return`<span class="sl-seccard-nav" aria-label="${g("picker.browseSections","Browse sections")}"><button type="button" data-section-nav="${O(r.previous.id)}" aria-label="${g("picker.previousSection","Previous section")}: ${O(e)}" title="${O(e)}">\u2190</button><button type="button" data-section-nav="${O(r.next.id)}" aria-label="${g("picker.nextSection","Next section")}: ${O(t)}" title="${O(t)}">\u2192</button></span>`}function zn(r,e){if(!e)return"";let t=e,i=t.includes(r.id),n=i?t.length>1?g("picker.openComparison","Open comparison"):g("picker.savedForComparison","Saved for comparison"):t.length?g("picker.compareWithSaved","Compare with saved"):g("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>${w(n)}</span></button>`}function Vn(r,e,t){if(!t)return"";let i=(0,_n.seatConfidenceDisclosure)(r.confidenceEvidence),n=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${w(r.displayLabel??r.label)}"><span><em>${w(e)}</em><strong>${w(i.headline)}</strong><small>${w(n)}</small></span><b>Passport</b></button>`}function W(r){let e=r?.rowLabel,t=r?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let n=`${t}${i}`;if(e.startsWith(n)&&e.length>n.length)return e.slice(n.length)}return(0,me.compactRowLabel)(e,t)}function Ba(r){switch(r){case"paused":return{title:g("picker.accessPausedTitle","These seats are on hold right now"),body:g("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:g("picker.accessRetry","Try again")};case"revoked":return{title:g("picker.accessRevokedTitle","This access link is no longer active"),body:g("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats.")};case"no_token":case"provider_failed":return{title:g("picker.accessExpiredTitle","Your access session has ended"),body:g("picker.accessExpiredBody","Sign in again, or reload the page, to keep browsing these seats. Anything you are already holding stays yours."),action:g("picker.accessRetry","Try again")};default:return{title:g("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:g("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest.")}}}function Fn(r,e,t){let i=Ji;return[r?.sectionLabel?`<div class="sl-confirm-field"><span class="sl-confirm-key">${g("picker.section","Section")}</span><span class="sl-confirm-value">${i(r.sectionLabel)}</span></div>`:"",r?.rowLabel||r?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${i(t)}</span><span class="sl-confirm-value">${i(W(r)??r?.displayLabel??e)}</span></div>`:"",r?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${g("picker.seat","Seat")}</span><span class="sl-confirm-value">${i(r?.seatNumber??r?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function Nn(r,e,t){let i=Ji,n=r?.objectType==="booth",s=r?.objectType==="table"&&!!r?.bookingMode,o=n||s||!r?.seatNumber,a=r?.sectionLabel??(o?void 0:r?.displayLabel),l=s?`${g("picker.guests","Guests")} ${r?.bookingMode==="variable"?`${r?.minOccupancy}\u2013${r?.maxOccupancy}`:r?.capacity}`:void 0,d=(o?[l,a?r?.rowLabel??r?.displayLabel:void 0]:[r?.rowLabel?`${t} ${W(r)??""}`.trim():void 0,`${g("picker.seat","Seat")} ${r?.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 jn(r,e){if(!r)return"";let t=e?g("picker.viewFromThisSeat","View from this seat"):g("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 In(r){return r.buyerMessage?.trim()||(r.restriction==="companion"?g("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function Gn(r,e,t){let i=Ji;if(r.length>1)return`<fieldset class="sl-confirm-tiers"><legend>${g("picker.ticketType","Ticket type")}</legend>`+r.map(o=>{let a=In(o);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${i(o.id)}" aria-pressed="${o.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${i(o.name)}</span>`+(a?`<small class="sl-confirm-tier-note">${i(a)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${i(t(o))}</span></button>`}).join("")+"</fieldset>";let n=r[0],s=n?In(n):void 0;return s?`<p class="sl-confirm-tier-note">${i(s)}</p>`:""}function ir(r){return`<span class="sl-seccard-dot" style="background:${w(r.color)}"></span><span class="sl-seccard-name">${w(r.label)}</span><span class="sl-seccard-left" data-full="${w(r.leftLabel)}" data-short="${w(r.leftShortLabel??r.leftLabel)}">${w(r.leftLabel)}</span>`+r.nav+r.close}function Kn(r){return`<div class="sl-seccard-head"><span class="sl-seccard-dot" style="background:${w(r.color)}"></span><span class="sl-seccard-name">${w(r.label)}</span>`+(r.showPrice?`<span class="sl-seccard-price">${w(r.priceLabel)}</span>`:"")+r.close+`</div><div class="sl-seccard-zone">${r.zoneLabel?`${w(r.zoneLabel)} \xB7 `:""}<span class="sl-seccard-left">${w(r.leftLabel)}</span></div>`+(r.entrance?`<div class="sl-seccard-entrance">${w(r.entrance)}</div>`:"")+(r.mix?`<div class="sl-seccard-mix">${r.mix}</div>`:"")+`<div class="sl-seccard-foot"><button type="button" class="sl-seccard-overview">\u2190 ${w(r.overviewLabel)}</button>`+r.nav+`<span class="sl-seccard-hint">${w(r.hint)}</span></div>`}function Un(r){return`<span class="sl-seccard-mix-item${r.dim?" sl-dim":""}"><span class="sl-seccard-mix-dot" style="background:${w(r.color)}"></span>${w(r.label)} <span class="sl-seccard-mix-price">${w(r.rangeLabel)}</span></span>`}function qn(r){return'<div class="sl-confirm-grid">'+r.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-dot" style="background:${w(r.categoryColor)}"></span><span class="sl-confirm-cat-name">${w(r.categoryLabel)}</span>`+(r.priceLabel?`<span class="sl-confirm-price">${w(r.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+r.marker+`<span class="sl-confirm-dot" style="background:${w(r.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${w(r.categoryLabel)}</span><span class="sl-confirm-who">`+r.identity+"</span>"+(r.priceLabel?`<span class="sl-confirm-idprice">${w(r.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+r.tierChoices+r.groupDates+r.wheelchair+r.commercial+(r.thumb||r.see3dPill?`<div class="sl-confirm-strip">${r.thumb}<span class="sl-confirm-pills">${r.see3dPill}</span></div>`:"")+r.inspect+`<div class="sl-confirm-row"><button type="button" class="sl-confirm-cancel">${w(r.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>${w(r.selectLabel)}</button></div></div>`}function Wn(r,e){let t=O,{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?(0,me.t)("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):(0,me.t)("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(r.displayLabel??r.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(i?g("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,me.t)("picker.allPlacesBookedTogether",{count:r.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span><b data-table-unit>${t((0,me.t)("picker.perGuestPrice",{price:e.unitPrice}))}</b><span class="muted">${t(g("picker.tableCapacity","Table capacity"))}</span><span>${t((0,me.t)("picker.guestsCount",{count:r.capacity}))}</span><span class="muted">${t(g("picker.total","Total"))}</span><b data-table-total></b></div>`+(i?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(g("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(g("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${r.quantity}</output><button type="button" data-table-step="1" aria-label="${t(g("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t((0,me.t)("picker.chooseMinMaxGuests",{min:r.minOccupancy,max:r.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${r.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t((0,me.t)("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?g("picker.updateTable","Update table"):i?g("picker.selectTable","Select table"):g("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function Yn(r,e){let t=Ba(r),i=document.createElement("div");i.className="sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let n=document.createElement("div"),s=document.createElement("div");s.className="sl-access-title",s.textContent=t.title;let o=document.createElement("div");if(o.className="sl-access-body",o.textContent=t.body,n.append(s,o),t.action){let a=document.createElement("button");a.type="button",a.className="sl-access-act",a.textContent=t.action,a.addEventListener("click",e),n.appendChild(a)}return i.appendChild(n),i}function Qn(r){return r.map(e=>`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${w(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"><span class="sl-a11yrow-i" aria-hidden="true">${w(e.icon)}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${w(e.label)}</span>`+(e.note?`<span class="sl-a11yrow-n">${w(e.note)}</span>`:"")+'</span><span class="sl-a11yrow-s" aria-hidden="true"></span></button>').join("")}function Xn(r){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",r.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:r.tf("picker.allFloors","All floors")},...r.floors.map(s=>({id:s.id,name:s.name}))];for(let s of t){let o=document.createElement("button");o.type="button",o.dataset.floor=s.id,o.textContent=s.name,o.setAttribute("aria-pressed","false"),o.addEventListener("click",()=>r.onChoose(s.id)),e.appendChild(o)}let i=document.createElement("button");i.type="button",i.className="sl-floor-info",i.textContent="i";let n=r.tf("picker.floorHelp","All floors shows the complete venue. Choose one level to inspect and select its seats.");return i.setAttribute("aria-label",n),i.title=n,e.appendChild(i),e}function Zn(r,e,t){if(!r)return;let i=t?"":e;r.querySelectorAll("button[data-floor]").forEach(n=>{n.setAttribute("aria-pressed",String(n.dataset.floor===i))})}var ee=require("@seatlayer/core");var gi=class{constructor(e){this.el=null;this.stripObserver=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?.classList.contains("strip")?Ee(this.el,void 0,Ir):this.el?.remove(),this.el=null,this.syncLocatorDock(),this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}updateDockInPlace(e,t){let i=this.el;if(!i)return;let n=i.querySelector(".sl-seccard-dot");n&&(n.style.background=e.color);let s=i.querySelector(".sl-seccard-name");s&&Bi(s,e.label);let o=i.querySelector(".sl-seccard-left");o&&(o.dataset.full=t.leftLabel,o.dataset.short=t.leftShortLabel,Bi(o,t.leftLabel));let a=i.querySelector(".sl-seccard-nav");t.nav?(a?a.outerHTML=t.nav:i.querySelector(".sl-seccard-x")?.insertAdjacentHTML("beforebegin",t.nav),this.wireNavigation(i)):a&&a.remove(),i.setAttribute("aria-label",`${(0,ee.t)("picker.sectionSummaryAria",{label:e.label})}, ${t.leftLabel}`),this.fitStripCount()}wireNavigation(e){e.querySelectorAll("[data-section-nav]").forEach(t=>{t.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation();let n=t.dataset.sectionNav;n&&this.host.controller.focusSection(n)})})}render(e){let t=this.host.map();if(!t)return;let i=this.el?.classList.contains("strip")===!0&&this.el.isConnected,n=e.categories.length?e.categories.map(v=>{let x=this.host.controller.doc?.categories.find(S=>S.key===v.key);return x?this.host.catPriceRange(x):{min:v.priceMin,max:v.priceMax}}).filter(v=>v!=null):[{min:e.priceMin,max:e.priceMax}],s=Math.min(...n.map(v=>v.min)),o=Math.max(...n.map(v=>v.max)),a=s===o?this.host.money(s):`${this.host.money(s)}\u2013${this.host.money(o)}`,l=(0,ee.tCount)("picker.seatsLeftInSection",e.seatsLeft),c=(0,ee.t)("picker.seatsLeftShort",{count:e.seatsLeft}),d=`<button type="button" class="sl-seccard-x" aria-label="${(0,ee.t)("picker.closeSectionSummary")}">\u2715</button>`,h=`<button type="button" class="sl-seccard-x sl-seccard-back" aria-label="${(0,ee.t)("picker.closeSectionSummary")}"><span class="sl-seccard-back-chev" aria-hidden="true">\u2039</span>${O((0,ee.t)("picker.overview"))}</button>`,p=$n(this.host.sectionNeighbours(e.id)),u=this.host.root()?.dataset.layout==="narrow",b={label:e.label,color:e.color,leftLabel:l,leftShortLabel:c,nav:p,close:d};if(u&&i&&this.el){this.updateDockInPlace(e,{leftLabel:l,leftShortLabel:c,nav:p});return}this.el?.remove();let m=document.createElement("div");if(u){if(m.className=i?"sl-seccard strip on":"sl-seccard strip on sl-mo-slide-up",m.setAttribute("role","group"),m.setAttribute("aria-label",`${(0,ee.t)("picker.sectionSummaryAria",{label:e.label})}, ${l}`),m.innerHTML=ir({...b,close:h}),i)for(let v of m.querySelectorAll(".sl-seccard-name,.sl-seccard-left"))v.classList.add("sl-mo-xfade");this.wireNavigation(m),m.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),t.appendChild(m),this.fitStripCount()}else if(this.collapsed)m.className="sl-seccard mini on",m.setAttribute("role","button"),m.setAttribute("aria-label",(0,ee.t)("picker.sectionSummaryAria",{label:e.label})),m.innerHTML=ir(b),this.wireNavigation(m),m.addEventListener("click",v=>{v.target.closest(".sl-seccard-x")||(this.collapsed=!1,this.shownAt=Date.now(),this.render(e))}),m.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),(this.host.region("top-center")??t).appendChild(m);else{m.className="sl-seccard on",m.setAttribute("role","dialog"),m.setAttribute("aria-label",(0,ee.t)("picker.sectionSummaryAria",{label:e.label}));let v=this.host.priceBandKeys(),x=e.categories.map(S=>{let A=this.host.controller.doc?.categories.find(y=>y.key===S.key),f=A?this.host.catPriceRange(A):{min:S.priceMin,max:S.priceMax};return Un({label:S.label,color:S.color,dim:v!=null&&!v.has(S.key),rangeLabel:f&&f.min!==f.max?`${this.host.money(f.min)}\u2013${this.host.money(f.max)}`:this.host.money(f?.min??S.price)})}).join("");m.innerHTML=Kn({...b,priceLabel:a,showPrice:e.categories.length>0,zoneLabel:e.zoneLabel,entrance:e.entrance?`${(0,ee.t)("picker.entrance")} ${e.entrance}`:void 0,mix:x,overviewLabel:(0,ee.t)("picker.overview"),hint:(0,ee.t)("picker.tapSeatHint")}),this.wireNavigation(m),m.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),m.querySelector(".sl-seccard-overview").addEventListener("click",()=>this.host.controller.overview()),(this.host.region("top-center")??t).appendChild(m)}this.el=m,u&&this.watchStrip(m),this.syncLocatorDock()}syncLocatorDock(){let e=this.host.root();e&&(this.el?.classList.contains("strip")?e.dataset.locator="true":delete e.dataset.locator)}fitStripCount(){let e=this.el;if(!e||!e.classList.contains("strip"))return;let t=e.querySelector(".sl-seccard-left");if(!t)return;let i=e.querySelector(".sl-seccard-name"),n=c=>c!=null&&c.clientWidth>0&&c.scrollWidth>c.clientWidth+1,s=()=>{let c=e.clientWidth;if(c<=0)return!0;let d=typeof getComputedStyle=="function"?getComputedStyle(e):null,h=m=>{let v=Number.parseFloat(m??"");return Number.isFinite(v)?v:0},p=[...e.children].filter(m=>m instanceof HTMLElement&&!m.hidden),u=h(d?.columnGap)||h(d?.gap);return p.reduce((m,v)=>m+Math.max(v.scrollWidth,v.getBoundingClientRect().width),0)+u*Math.max(0,p.length-1)+h(d?.paddingLeft)+h(d?.paddingRight)<=c+1},o=()=>t.hidden||!n(t)&&s(),a=c=>{if(t.hidden=c==="hidden",c==="hidden")return;let d=t.dataset.full??"";t.textContent=c==="full"?d:t.dataset.short??d},l=["full","short","hidden"];for(let c of l)if(a(c),o()&&!n(i))return;for(let c of l)if(a(c),o())return;a("hidden")}watchStrip(e){this.stripObserver?.disconnect(),this.stripObserver=null,typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.el===e&&this.fitStripCount()}),typeof ResizeObserver=="function"&&(this.stripObserver=new ResizeObserver(()=>{this.el===e&&this.fitStripCount()}),this.stripObserver.observe(e))}collapse(){!this.el||this.collapsed||!this.current||this.host.root()?.dataset.layout!=="narrow"&&(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)&&this.host.root()?.dataset.layout!=="narrow"){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 n=this.host.activeFloorObjects().find(S=>S.type==="section"&&S.id===t.id)?.outline;if(!n||n.length<3)return 0;let s=n.map(S=>this.host.controller.worldToScreen(S)),o=s.map(S=>S.x),a=s.map(S=>S.y),l=Math.min(...o),c=Math.min(...a),d=Math.max(...o)-l,h=Math.max(...a)-c;if(d<=0||h<=0)return 0;let p=i.getBoundingClientRect(),u=e.getBoundingClientRect(),b=u.left-p.left,m=u.top-p.top,v=Math.max(0,Math.min(b+u.width,l+d)-Math.max(b,l)),x=Math.max(0,Math.min(m+u.height,c+h)-Math.max(m,c));return v*x/(d*h)}};var Jn=require("@seatlayer/core"),ct=require("@seatlayer/core/picker/minimapGeometry");function es(r,e){let t=new rr(r);return t.build(e),t}var rr=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}build(e){if(!this.host.controller.getViewport())return;let i=document.createElement("button");i.type="button",i.className="sl-minimap-toggle",i.setAttribute("aria-label",g("picker.openVenueMap","Open venue overview map")),i.setAttribute("aria-expanded","false"),i.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 6l5-2 8 3 5-2v13l-5 2-8-3-5 2zM8 4v13M16 7v13"/></svg>',e.appendChild(i),this.miniToggle=i;let n=document.createElement("div");n.className="sl-minimap",n.setAttribute("role","group");let s=document.createElement("div");s.className="sl-minimap-bar";let o=document.createElement("span");o.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",g("picker.minimapStateKey","Focused, selected, available, and inactive sections")),a.innerHTML='<i class="focused" title="Focused"></i><i class="selected" title="Selected"></i><i title="Available"></i><i class="inactive" title="Inactive"></i>';let l=document.createElement("button");l.type="button",l.className="sl-minimap-close",l.setAttribute("aria-label",g("picker.closeVenueMap","Close venue overview map")),l.textContent="\xD7",s.append(o,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",g("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),n.append(s,c),e.appendChild(n),this.miniWrap=n,this.miniLabel=o,this.miniCanvas=c;let d=document.createElement("canvas");this.miniBase=d,i.addEventListener("click",()=>{let h=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=h,this.setMinimapOpen(!h)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",h=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(h)}),c.addEventListener("pointerdown",h=>this.minimapPointerDown(h)),c.addEventListener("pointermove",h=>this.minimapPointerMove(h)),c.addEventListener("pointerup",h=>this.minimapPointerUp(h)),c.addEventListener("pointercancel",h=>this.minimapPointerUp(h)),c.addEventListener("keydown",h=>this.minimapKeydown(h)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setAutoOpen(e){if(this.miniWrap){if(!e){this.userClosed=!1,this.host.root()?.dataset.minimapOpen==="true"&&this.setMinimapOpen(!1,!1);return}this.userClosed||this.host.root()?.dataset.minimapOpen==="true"||this.setMinimapOpen(!0,!1)}}setMinimapOpen(e,t=!0){this.host.root()?.setAttribute("data-minimap-open",String(e)),this.miniToggle?.setAttribute("aria-expanded",String(e)),t&&(e?this.miniCanvas?.focus():this.miniToggle?.focus())}layoutMinimap(){let e=this.miniCanvas,t=this.miniBase,i=this.host.controller.getViewport()?.bounds;if(!e||!t||!i||!(i.width>0&&i.height>0))return;let n=196,s=146,o=6,a=i.width/Math.max(1,i.height),l=n,c=Math.round(n/a);c>s&&(c=s,l=Math.round(s*a)),l=Math.max(64,l),c=Math.max(48,c);let d=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*d),e.height=Math.round(c*d),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=(0,ct.createMinimapTransform)(i,e.width,e.height,d,o)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?g("picker.allFloors","All floors"):e.find(d=>d.id===this.host.controller.getActiveFloorId())?.name??g("picker.venueOverview","Venue overview"),i=this.host.controller.getMinimapSnapshot().sections,s=i.find(d=>d.active)?.label??this.host.focusedSectionLabel(),o=s?`${t} \xB7 ${s}`:t;this.miniLabel.textContent=o;let a=i.filter(d=>d.state==="selected").length,l=i.filter(d=>d.state==="available").length,c=i.filter(d=>d.state==="inactive").length;this.miniWrap.setAttribute("aria-label",i.length?`${o}. ${a} selected, ${l} available, ${c} inactive sections.`:o),this.miniCanvas?.setAttribute("aria-label",i.length?`${o}. ${a} selected, ${l} available, ${c} inactive sections. ${g("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${o}. ${g("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click elsewhere, or use arrow keys to pan.")}`)}refreshMinimap(){this.miniBase&&(this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect())}drawMinimapStatic(){let e=this.miniBase,t=this.miniTf;if(!e||!t)return;let i=e.getContext("2d");if(!i)return;i.clearRect(0,0,e.width,e.height);let n=h=>h*t.scale+t.offX,s=h=>h*t.scale+t.offY,o=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",a=this.host.cssVar("--sl-muted")||"#8b93a7",l=this.host.cssVar("--sl-accent")||"#6e7bff",c=this.host.cssVar("--sl-success")||"#22a06b",d=this.host.controller.getMinimapSnapshot();for(let h of d.sections){if(h.outline.length<3)continue;i.beginPath(),h.outline.forEach((u,b)=>b===0?i.moveTo(n(u.x),s(u.y)):i.lineTo(n(u.x),s(u.y))),i.closePath();let p=h.paint;if(i.globalAlpha=h.state==="inactive"?.5:.92,p?i.fillStyle=p.fill:(i.globalAlpha=h.state==="inactive"?.18:h.state==="selected"?.72:.34,i.fillStyle=h.state==="inactive"?a:h.state==="selected"?l:c),i.fill(),i.globalAlpha=.82,i.lineWidth=Math.max(1,t.dpr),i.strokeStyle=p?.stroke||o,i.stroke(),h.owned){i.globalAlpha=1,i.lineWidth=Math.max(2,t.dpr*1.5),i.strokeStyle=l,i.stroke();let u=h.outline.reduce((b,m)=>({x:b.x+m.x,y:b.y+m.y}),{x:0,y:0});i.beginPath(),i.arc(n(u.x/h.outline.length),s(u.y/h.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),i.fillStyle=l,i.fill(),i.beginPath(),h.outline.forEach((b,m)=>m===0?i.moveTo(n(b.x),s(b.y)):i.lineTo(n(b.x),s(b.y))),i.closePath()}h.active&&(i.globalAlpha=1,i.lineJoin="round",i.lineWidth=Math.max(4,t.dpr*3.5),i.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",i.stroke(),i.lineWidth=Math.max(2,t.dpr*1.75),i.strokeStyle=l,i.stroke())}if(i.globalAlpha=1,!d.sections.length){let h=Math.max(1,t.dpr);for(let p of d.seats)i.globalAlpha=p.state==="inactive"?.22:.78,i.fillStyle=p.state==="inactive"?a:p.state==="selected"?l:c,i.beginPath(),i.arc(n(p.x),s(p.y),h,0,Math.PI*2),i.fill();i.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,i=this.miniTf;if(!e||!t||!i)return;let n=e.getContext("2d");if(!n)return;n.clearRect(0,0,e.width,e.height),n.drawImage(t,0,0);let s=this.host.controller.getViewport();if(!s)return;let o=(0,ct.minimapViewportPlan)(s.visible,i,e.width,e.height,Math.max(2,i.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";n.save(),n.globalAlpha=.1,n.fillStyle=a,n.fillRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),n.globalAlpha=.9,n.lineJoin="round",n.lineWidth=Math.max(4,i.dpr*3.25),n.strokeStyle=l,n.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),n.globalAlpha=1,n.lineWidth=Math.max(2,i.dpr*1.75),n.strokeStyle=a,n.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),o.clipped&&Object.values(o.clippedEdges).some(Boolean)&&(n.setLineDash([Math.max(3,i.dpr*3),Math.max(2,i.dpr*2)]),n.strokeRect(o.clipped.x,o.clipped.y,o.clipped.width,o.clipped.height)),n.restore()}minimapWorldPoint(e){let t=this.miniCanvas,i=this.miniTf;if(!t||!i)return null;let n=t.getBoundingClientRect(),s=(e.clientX-n.left)*(t.width/Math.max(1,n.width)),o=(e.clientY-n.top)*(t.height/Math.max(1,n.height));return{...(0,ct.minimapPointToWorld)({x:s,y:o},i),px:s,py:o}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),i=this.host.controller.getViewport()?.visible;!t||!i||!(t.x>=i.x&&t.x<=i.x+i.width&&t.y>=i.y&&t.y<=i.y+i.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(i.x+i.width/2),offsetY:t.y-(i.y+i.height/2),startX:e.clientX,startY:e.clientY,moved:!1},this.miniCanvas?.setPointerCapture(e.pointerId),this.miniCanvas?.classList.add("sl-dragging"),e.preventDefault())}minimapPointerMove(e){let t=this.miniDrag;if(!t||t.pointerId!==e.pointerId)return;let i=this.minimapWorldPoint(e);i&&(!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>2&&(t.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:i.x-t.offsetX,y:i.y-t.offsetY}),e.preventDefault())}minimapPointerUp(e){let t=this.miniDrag;!t||t.pointerId!==e.pointerId||(this.miniSuppressClick=t.moved,this.miniDrag=null,this.miniCanvas?.classList.remove("sl-dragging"),this.miniCanvas?.hasPointerCapture(e.pointerId)&&this.miniCanvas.releasePointerCapture(e.pointerId))}minimapKeydown(e){let t=this.host.controller.getViewport()?.visible;if(!t)return;if(e.key==="Home"){this.host.controller.overview(),e.preventDefault();return}let i=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,n=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!i&&!n||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+i,y:t.y+t.height/2+n}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let i of this.host.controller.getMinimapSnapshot().sections)if(!(i.state==="inactive"||i.outline.length<3)&&(0,Jn.pointInPolygon)(t,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var bi=require("@seatlayer/core");var $a=12;function ts(r,e){let t=e.floors(),i=new Set(t.map(x=>x.label.trim().toLocaleLowerCase())),n=e.zones().filter(x=>x.seatCount>0&&!i.has(x.label.trim().toLocaleLowerCase())),s=e.sections().filter(x=>x.seatCount>0&&!i.has(x.label.trim().toLocaleLowerCase())),o=n.length>1?[]:s,a=t.length>1,l=n.length>1,c=o.length>1;if(!a&&!l&&!c)return;let d=document.createElement("div");d.className="sl-view3d-nav";let h=document.createElement("button");h.type="button",h.className="sl-view3d-nav-toggle",h.setAttribute("aria-expanded","false");let p='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>',u=document.createElement("span");h.innerHTML=p,h.appendChild(u);let b=x=>{d.classList.toggle("is-open",x),h.setAttribute("aria-expanded",String(x)),u.textContent=x?g("picker.closeVenueNav","Close"):a&&(l||c)?g("picker.levelsAndAreas","Levels & areas"):a?g("picker.levels","Levels"):g("picker.areas","Areas")};h.addEventListener("click",()=>b(!d.classList.contains("is-open"))),d.addEventListener("keydown",x=>{x.key!=="Escape"||!d.classList.contains("is-open")||(x.preventDefault(),x.stopPropagation(),b(!1),h.focus())}),b(!1),d.appendChild(h);let m=x=>{},v=x=>{};if(a){let x=document.createElement("div");x.setAttribute("role","group"),x.setAttribute("aria-label",g("picker.levels","Levels"));let S=[];v=y=>{S.forEach(T=>{T.setAttribute("aria-pressed",String((T.dataset.floor===""?null:Number(T.dataset.floor))===y))})};let A=y=>{e.focusFloor(y)&&(v(y),m(y))},f=(y,T)=>{let M=document.createElement("button");M.type="button",M.textContent=y,M.dataset.floor=T===null?"":String(T),M.setAttribute("aria-pressed",String(T===null)),M.addEventListener("click",()=>{A(T),b(!1)}),S.push(M),x.appendChild(M)};f(g("picker.allLevels","All levels"),null);for(let y of t)f(y.label||(0,bi.t)("picker.levelNumber",{number:y.index+1}),y.index);d.appendChild(x)}if(l||c){let x=document.createElement("div");x.setAttribute("role","group"),x.setAttribute("aria-label",g("picker.areas","Areas"));let S=l?n.map(f=>({id:f.id,label:f.label||f.id,go:()=>{e.focusZone(f.id)}})):o.map(f=>({id:f.id,label:f.label||f.id,floorIndex:f.floorIndex,go:()=>{e.focusSection(f.id),Number.isFinite(f.floorIndex)&&v(f.floorIndex)}})),A=f=>{let y=l||f===null?S:S.filter(T=>T.floorIndex===void 0||T.floorIndex===f);if(x.replaceChildren(),!y.length){x.remove();return}if(x.isConnected||d.appendChild(x),!l&&y.length>$a){let T=document.createElement("select");T.setAttribute("aria-label",g("picker.jumpToSection","Jump to section"));let M=document.createElement("option");M.value="",M.textContent=g("picker.jumpToSection","Jump to section"),T.appendChild(M);for(let R of y){let E=document.createElement("option");E.value=R.id,E.textContent=R.label,T.appendChild(E)}T.addEventListener("change",()=>{y.find(R=>R.id===T.value)?.go()}),x.appendChild(T);return}for(let T of y){let M=document.createElement("button");M.type="button",M.textContent=T.label,M.addEventListener("click",()=>{T.go(),b(!1)}),x.appendChild(M)}};m=A,A(null)}r.appendChild(d)}var vi=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",g("picker.savedSeatComparison","Saved seat comparison"));let s=document.createElement("button");s.type="button",s.className="main",s.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(g("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let o=document.createElement("button");o.type="button",o.className="clear",o.textContent="\xD7",o.setAttribute("aria-label",g("picker.clearSavedSeatComparison","Clear saved seat comparison")),o.addEventListener("click",()=>this.host.clearComparison()),t.append(s,o),e.appendChild(t),this.chip=t}let i=this.host.savedSeatIds().length,n=t.querySelector(".main");n&&(n.textContent=i>1?(0,bi.t)("picker.compareCount",{count:i}):g("picker.oneSeatSaved","1 seat saved"),n.setAttribute("aria-label",i>1?(0,bi.t)("picker.openComparisonOfSeats",{count:i}):g("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function is(r){return!r?.querySelector('[data-ref="zfs"]')}var nr=require("@seatlayer/core");var za=900,Va=450;function Fa(r){switch(r){case"seat":return g("picker.stopYourSeat","Your seat");case"row":return g("picker.stopYourRow","Your row");case"section":return g("picker.stopYourSection","Your section");default:return g("picker.stopWholeVenue","Whole venue")}}function rs(r,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let i=g("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",i),t.title=i,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let n=document.createElement("div");n.className="sl-view3d-stop",n.setAttribute("role","status"),n.setAttribute("aria-live","polite"),r.append(t,n);let s=null,o=null;return{onStopChange(a){if(s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),!a){n.classList.remove("is-shown"),n.textContent="",o=setTimeout(()=>{o=null,r.classList.remove("is-seat-view")},Va);return}r.classList.add("is-seat-view"),n.textContent=Fa(a),n.classList.add("is-shown"),s=setTimeout(()=>{s=null,n.classList.remove("is-shown")},za)},dispose(){s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),t.remove(),n.remove(),r.classList.remove("is-seat-view")}}}var Na=44,ja=92;function ns(r,e,t,i={}){let n=r?.sectionLabel,s=W(r),o=Ga(r,e),a=[n,s?(0,nr.t)("picker.rowLabel",{label:s}):null,o?(0,nr.t)("picker.seatLabel",{label:o}):null].filter(Boolean).join(" \xB7 "),l=i.maxChars??(i.narrow?Na:ja);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 Ga(r,e){if(r?.seatNumber)return r.seatNumber;let t=r?.displayLabel??e,i=n=>{!n||!t.startsWith(n)||t.length<=n.length||(t=t.slice(n.length).replace(/^[\s·\-\/_]+/,""))};return i(r?.sectionLabel),i(W(r)),t}var ss="sl:sheet-hint";function os(r){let e=r.boot;if(!e?.isConnected)return;if(r.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"),r.map?.appendChild(t),setTimeout(()=>t.remove(),650),r.rail?.classList.add("is-in"),r.root?.classList.add("is-arriving"),setTimeout(()=>{r.rail?.classList.remove("is-in"),r.root?.classList.remove("is-arriving"),Ka(r.root)},900)}function Ka(r){if(!r||r.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(ss))return;window.sessionStorage.setItem(ss,"1")}catch{}let e=r.querySelector(".sl-sheet-grab");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function as(r,e){r.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let i of e())if(i.open()){t.preventDefault(),t.stopPropagation(),i.close();return}}})}function yi(r){let e=r.committedSelection(),t=r.controller.getGAAreas(),i=r.hold?.items??[],n=new Set(i.map(p=>p.label)),s=zr(r,t,i),o=Ve(r.gaQty,i),a=i.reduce((p,u)=>p+r.paidPrice(u.categoryKey,u.tierId,u.unitPrice,u.label)*(u.quantity??1),0),l=i.reduce((p,u)=>p+(u.quantity??1),0),c=e.filter(p=>!n.has(p.label)),d=c.reduce((p,u)=>p+r.paidPrice(u.categoryKey,u.tierId??null,u.price,u.label)*(u.quantity??1),0)+s+a,h=c.reduce((p,u)=>p+(u.quantity??1),0)+o+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:i,heldLabels:n,heldCount:l,total:d,count:h}}function xi(r,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:r.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function wi(r,e){let t=e.tiers?.length?e.tiers.map(i=>r.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[r.paidPrice(e.key,null,e.price)];if(e.key)for(let i of r.pricesByChannel.values())for(let n of i)n.categoryKey===e.key&&t.push(n.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var Mt="seatlayer_";function Ua(){let r=globalThis;return r.document?.modelContext??r.navigator?.modelContext??null}function ae(r,e){return e?{ok:!1,reason:r,message:e}:{ok:!1,reason:r}}function qa(r){return Array.isArray(r)?r.filter(e=>typeof e=="string"&&!!e):[]}function Wa(r,e){let t=r.event();if(!t)return ae("not_loaded","The seat map has not finished loading.");let i=r.selectionLimits();return{ok:!0,event:t,selection:{max:i.max,...i.required!=null?{required:i.required}:{}},categories:r.categories(),zones:r.zones(),hasPremiumSeats:r.hasPremiumSeats(),holdsAllowed:e}}function ls(r,e){let t=n=>!!n&&n.toLowerCase()===e.toLowerCase(),i=r.find(n=>t(n.key??n.id))??r.find(n=>t(n.label));return i?.key??i?.id??null}function cs(r,e){let t=e.map(i=>r.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,n)=>t[n]?.seat||i.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((i,n)=>i+n.price,0)}}function Ya(r,e,t){let i=new Map;for(let s of e){let o=i.get(s.rowKey);o?o.push(s):i.set(s.rowKey,[s])}let n=[];for(let s of i.values()){let o=[...s].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=o.length;l++)if(l===o.length||o[l].index!==o[l-1].index+1||o[l].categoryKey!==o[l-1].categoryKey){for(let d=a;d+t<=l;d+=t)n.push(cs(r,o.slice(d,d+t)));a=l}}return n}function Qa(r,e,t){let i=new Map;for(let s of e){let o=i.get(s.sectionKey);o?o.push(s):i.set(s.sectionKey,[s])}let n=[];for(let s of i.values()){if(s.length<t)continue;let o=[...s].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);n.push(cs(r,o.slice(0,t)))}return n}function Xa(r,e){if(!r.event())return ae("not_loaded","The seat map has not finished loading.");let i=r.selectionLimits(),n=Math.floor(Number(e.count));if(!Number.isInteger(n)||n<1||n>i.max)return ae("bad_count",`count must be a whole number between 1 and ${i.max}.`);let s=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,o=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?ls(r.categories(),l):null;if(l&&!d)return ae("no_match",`No ticket type called "${l}".`);let h=c?ls(r.zones(),c):null;if(c&&!h)return ae("no_match",`No zone called "${c}".`);let p=r.seats().filter(m=>m.available);if(!p.length)return ae("sold_out");let u=p.filter(m=>(!d||m.categoryKey===d)&&(!h||m.zoneId===h)&&(a==null||m.price<=a));if(!u.length)return ae("no_match");let b=o?Ya(r,u,n):Qa(r,u,n);return b.length?(b.sort((m,v)=>v.unitPrice!==m.unitPrice?v.unitPrice-m.unitPrice:m.row.localeCompare(v.row)||m.labels[0].localeCompare(v.labels[0])),{ok:!0,groups:b.slice(0,s),searched:{count:n,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...h?{zone:h}:{},together:o}}}):ae(o?"not_enough_together":"no_match")}function ds(r){return{ok:!0,...r.selection()}}function Za(r,e){let t=r.event();if(!t)return ae("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return ae("event_closed","Sales are closed for this event.");let i=qa(e.seat_ids);return i.length?(r.clearSelection(),r.selectObjects(i),ds(r)):ae("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function Ja(r,e){let t=async n=>{try{return await n()}catch(s){return ae("error",s instanceof Error?s.message:String(s))}},i=[{name:`${Mt}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(()=>Wa(r,e))},{name:`${Mt}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:n=>t(()=>Xa(r,n))},{name:`${Mt}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:n=>t(()=>Za(r,n))},{name:`${Mt}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(()=>ds(r))}];return e&&i.push({name:`${Mt}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(()=>r.hold())}),i}async function ps(r,e={}){let t=Ua();if(!t||typeof t.registerTool!="function")return null;let i=new AbortController,n=Ja(r,!!e.holds),s=[],o=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of n)await t.registerTool(a,{signal:i.signal,...o?{exposedTo:o}:{}}),s.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return s.length?{names:s,dispose:()=>{if(i.abort(),typeof t.unregisterTool=="function")for(let a of s)try{t.unregisterTool(a)}catch{}}}:null}async function hs(r){let e=r.opts.webMcp;if(!e||r.destroyed)return;let t=typeof e=="object"&&!!e.holds,i=typeof e=="object"?e.exposedTo:void 0;try{r.webMcp=await ps(or(r,t),{holds:t,exposedTo:i}),r.destroyed&&sr(r)}catch(n){console.warn("seatmap: WebMCP registration failed",n)}}function sr(r){r.webMcp?.dispose(),r.webMcp=null}function or(r,e){let t=(i,n)=>{if(Number.isInteger(i.logicalSeatIndex))return i.logicalSeatIndex;let s=i.id.lastIndexOf(":"),o=s<0?NaN:Number(i.id.slice(s+1));return Number.isFinite(o)?o:n};return{event:()=>{let i=r.renderInfo;return i?{name:i.eventName??"",venue:i.venue??null,startsAt:i.startsAt??null,timezone:i.timezone??null,currency:r.currency,salesClosed:r.salesClosed}:null},selectionLimits:()=>({max:r.maxTickets,required:r.exactTickets}),categories:()=>{let i=r.controller.categoryAvailability();return(r.controller.doc?.categories??[]).filter(n=>!n.notForSale).map(n=>{let s=wi(r,n),o=xi(r,n);return{key:n.key,label:n.label??n.key,...o===void 0?{}:{price:o},...s&&s.min!==s.max?{priceRange:s}:{},available:i[n.key]??0}})},zones:()=>r.controller.getBestAvailableZones(),hasPremiumSeats:()=>r.controller.hasPremiumSeats(),seats:()=>{let i=r.controller.getActiveFloorId(),n=[];return r.allSeats().forEach((s,o)=>{if(s.floorId&&i&&s.floorId!==i)return;let a=r.controller.getStatus(s.id)??"free",l=r.controller.doc?.categories.find(d=>d.key===s.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;n.push({id:s.id,label:s.label,rowKey:s.logicalRowId??s.rowId,sectionKey:s.sectionId??s.rowId,index:t(s,o),categoryKey:s.categoryKey,price:r.paidPrice(s.categoryKey,l?.tiers?.[0]?.id??null,c,s.label),...s.zoneId?{zoneId:s.zoneId}:{},available:a==="free"&&!l?.notForSale})}),n},describeSeat:i=>{let n=r.controller.seatDetails(i);return n?{section:n.sectionLabel??"",row:W(n)??"",seat:n.seatNumber??n.label,category:n.categoryLabel??n.categoryKey}:null},selection:()=>{let{freshSeats:i,total:n,count:s}=yi(r);return{seats:i.map(o=>({id:o.id,label:o.label,section:o.sectionLabel??"",row:W(o)??"",seat:o.seatNumber??o.label,category:o.categoryKey,price:r.paidPrice(o.categoryKey,o.tierId??null,o.price,o.label)})),count:s,total:n,currency:r.currency,hold:r.hold?{id:r.hold.holdId,expiresAt:r.hold.expiresAt}:null,validity:r.getSelectionValidity()}},clearSelection:()=>r.clearSelection(),selectObjects:i=>{r.selectObjects(i)},hold:()=>e?el(r):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function el(r){if(r.salesClosed)return{ok:!1,reason:"event_closed"};if(!r.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=r.controller.getSelectionValidity(r.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await r.handleCta(),r.hold?{ok:!0,hold:{id:r.hold.holdId,expiresAt:r.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function Lt(r){if(!r)return null;let e=r.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function tl(r){return Lt(r.peek?.querySelector(".sl-peek-sum"))??Lt(r.foot?.querySelector(".sl-total"))??Lt(r.tray)??Lt(r.sheetHead)}function lr(r,e,t,i){let n=r,s=n.map;if(!s||!e)return;let o=s.getBoundingClientRect(),a={x:o.left+e.x,y:o.top+e.y},l=t.displayLabel??t.label,c=i?.find(h=>h.key===t.categoryKey)?.color,d=()=>{let h=tl(n);h&&_r({from:a,to:{x:h.left+h.width/2,y:h.top+h.height/2},label:l,color:c})};Lt(n.peek)?requestAnimationFrame(d):d()}var ar=60,il=650;function us(r,e){if(!e.length)return;e.forEach((s,o)=>{r.schedule(()=>r.pop(s.id),o*ar)});let t=e.length*ar,i=e.find(s=>s.sectionId)?.sectionId;if(i){let s=e.filter(a=>a.sectionId===i),o={x:s.reduce((a,l)=>a+l.x,0)/s.length,y:s.reduce((a,l)=>a+l.y,0)/s.length};r.schedule(()=>r.focus(i,o),t)}let n=t+(i?il:0);e.forEach((s,o)=>{r.schedule(()=>lr(r.regions,r.screenPoint(s),s,r.categories),n+o*ar)})}function cr(r){return{renderingTimeMillis:r.ms,performanceProfile:r.performanceProfile,seatCount:r.seatCount,objectCount:r.objectCount,sectionCount:r.sectionCount,view:r.view,eventKey:r.eventKey,chartName:r.chartName,floorCount:r.floorCount,transport:r.transport,load:r.load,metricScope:r.metricScope,operationalTelemetryReporter:"sdk"}}function ms(r,e){ye({apiBase:r.apiBase,event:r.eventKey,scope:r.metricScope,surface:r.performanceGroup?"performance_group_picker":"seat_picker",outcome:"success",ms:r.ms,performanceProfile:r.performanceProfile,chartDelivery:r.chartDelivery,seats:r.seatCount,floors:r.floorCount,view:r.view,load:r.load,transport:r.transport}),e("chart_rendered",cr(r))}var fs=require("@seatlayer/core/core/seatConfidence");function Q(r){return String(r??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function gs(r){let e=(0,fs.seatConfidenceDisclosure)(r.seat.confidenceEvidence),t=r.seat.confidenceEvidence,i=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${Q(c)}</li>`).join("")}</ul>`:"",n=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${Q(e.modeledTarget)}</dd></div>`:"",s=t?`<div><dt>Evidence ID</dt><dd>${Q(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${Q(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${Q(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${Q(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${Q(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",o=Le(r.seat.commercial)||r.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${Q(o)}</dd></div>`+(r.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${Q(r.seat.commercial.note)}</dd></div>`:""),l=r.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">${Q(r.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${Q(e.headline)}</strong><span>${Q(e.coverage)} \xB7 ${Q(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${Q(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${Q(e.reality)}</dd></div><div><dt>Source</dt><dd>${Q(e.provenance)}</dd></div>`+a+n+s+`</dl>${i}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function bs(r){return r?r.closest("[data-report]")?"report":r.closest("[data-close]")||r.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function ki(r,e,t){let i=r?.querySelector("[data-report]"),n=r?.querySelector("[data-report-status]");i&&(i.disabled=e!=="failed",i.textContent=e==="received"?"Report received":"Report this view"),n&&(n.setAttribute("role",e==="failed"?"alert":"status"),n.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function dr(r,e,t=null){let i=r.view3dEl;if(!i)return;Ht(r,!1);let n=e.confidenceEvidence,s=r.controller.seatDetails(e.id),o=document.createElement("div");o.className="sl-view3d-passport-shell",o.innerHTML=gs({seat:e,title:s?.displayLabel??e.displayLabel??e.label,restrictionFallback:r.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof r.api.reportViewEvidence=="function"});let a=[...new Set([...i.children,...[...r.els.map.children].filter(p=>p!==i)])].filter(p=>p instanceof HTMLElement),l=a.map(p=>({element:p,inert:p.inert,ariaHidden:p.getAttribute("aria-hidden")}));for(let p of a)p.inert=!0,p.setAttribute("aria-hidden","true");i.appendChild(o),i.classList.add("has-passport"),r.view3dPassportEl=o;let c=o.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],h=p=>{if(p.key==="Escape"){p.preventDefault(),p.stopPropagation(),p.stopImmediatePropagation(),Ht(r);return}if(p.key!=="Tab")return;let u=d();if(!u.length)return;let b=u[0],m=u[u.length-1];p.shiftKey&&document.activeElement===b?(p.preventDefault(),m.focus()):!p.shiftKey&&document.activeElement===m&&(p.preventDefault(),b.focus())};window.addEventListener("keydown",h,!0),r.view3dPassportCleanup=()=>{window.removeEventListener("keydown",h,!0);for(let m of l)m.element.inert=m.inert,m.ariaHidden===null?m.element.removeAttribute("aria-hidden"):m.element.setAttribute("aria-hidden",m.ariaHidden);let p=t?.isConnected?t:r.confirmEl?.querySelector(".sl-confirm-confidence")??r.view3dCompareEl?.querySelector("[data-passport-seat]")??null,u=p?.closest(".sl-confirm,.sl-view3d-compare");u?.isConnected&&(u.inert=!1,u.removeAttribute("aria-hidden")),o.remove(),i.classList.remove("has-passport"),r.view3dPassportEl===o&&(r.view3dPassportEl=null);let b=p??r.view3dCompareEl?.querySelector("[data-passport-seat]")??r.confirmEl?.querySelector(".sl-confirm-confidence")??r.view3dCompareChip.mainButton();(t?.isConnected?t:b)?.focus()},o.addEventListener("click",p=>{let u=bs(p.target instanceof HTMLElement?p.target:null);u==="close"&&Ht(r),u==="report"&&rl(r,e)}),requestAnimationFrame(()=>d()[0]?.focus()),r.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:n?.evidenceId??null,eventConfigurationId:n?.eventConfigurationId??null,modelLevel:n?.modelLevel??"unverified",realityLevel:n?.realityLevel??"none"})}async function rl(r,e){if(r.api.reportViewEvidence){ki(r.view3dPassportEl,"sending");try{let t=await r.api.reportViewEvidence(r.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});r.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),ki(r.view3dPassportEl,"received",t.report.id)}catch{ki(r.view3dPassportEl,"failed")}}}function Ht(r,e=!0){let t=r.view3dPassportCleanup;if(r.view3dPassportCleanup=null,!t){r.view3dPassportEl?.remove(),r.view3dPassportEl=null,r.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||r.root?.focus({preventScroll:!0})}function vs(r){let e=r.view3dEl;if(!e||r.view3dCompareSeatIds.length<2)return;Ne(r,!1);let t=r.view3dCompareSeatIds.map(p=>r.view3dComparisonSnapshot(p)).filter(p=>!!p);if(t.length<2){r.clearView3dComparison();return}let i=p=>w(p),n=document.createElement("div");n.className="sl-view3d-compare-shell";let s=t.map((p,u)=>`<article><span>Seat ${u===0?"A":"B"}</span><strong>${i(p.label)}</strong><small>Section ${i(p.section)} \xB7 Row ${i(p.row)}</small><dl><div><dt>Current price</dt><dd>${i(p.price)}</dd></div><div><dt>Ticket type</dt><dd>${i(p.category)}</dd></div><div><dt>Availability</dt><dd>${i(p.availability)}</dd></div><div><dt>View source</dt><dd>${i(p.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${i(p.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${i(p.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${i(p.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${i(p.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${i(p.seat.id)}">Passport</button><button type="button" data-view-seat="${i(p.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${i(p.seat.id)}"${p.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");n.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">Current price and availability come from this picker. Modeled views are chart-derived unless organizer media is labeled; SeatLayer does not invent why a seat has its price.</p><div class="sl-view3d-compare-grid">${s}</div></section>`;let o=document.activeElement instanceof HTMLElement?document.activeElement:null,a=[...e.children].filter(p=>p instanceof HTMLElement),l=a.map(p=>({element:p,inert:p.inert,ariaHidden:p.getAttribute("aria-hidden")}));for(let p of a)p.inert=!0,p.setAttribute("aria-hidden","true");e.appendChild(n),e.classList.add("has-comparison"),r.view3dCompareEl=n;let c=n.querySelector(".sl-view3d-compare"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],h=p=>{if(p.key==="Escape"){p.preventDefault(),Ne(r);return}if(p.key!=="Tab")return;let u=d();if(!u.length)return;let b=u[0],m=u[u.length-1];p.shiftKey&&document.activeElement===b?(p.preventDefault(),m.focus()):!p.shiftKey&&document.activeElement===m&&(p.preventDefault(),b.focus())};window.addEventListener("keydown",h),r.view3dCompareCleanup=()=>{window.removeEventListener("keydown",h);for(let p of l)p.element.inert=p.inert,p.ariaHidden===null?p.element.removeAttribute("aria-hidden"):p.element.setAttribute("aria-hidden",p.ariaHidden);n.remove(),e.classList.remove("has-comparison"),r.view3dCompareEl===n&&(r.view3dCompareEl=null),o?.isConnected?o.focus():r.view3dCompareChip.mainButton()?.focus()},n.querySelector("[data-close]")?.addEventListener("click",()=>Ne(r)),n.querySelectorAll("[data-passport-seat]").forEach(p=>p.addEventListener("click",()=>{let u=p.dataset.passportSeat,b=u?r.allSeats().find(m=>m.id===u):void 0;b&&dr(r,b,p)})),n.querySelectorAll("[data-view-seat]").forEach(p=>p.addEventListener("click",()=>{let u=p.dataset.viewSeat;Ne(r,!1),u&&r.view3dHandle?.flyToSeat(u)})),n.querySelectorAll("[data-select-seat]").forEach(p=>p.addEventListener("click",()=>{let u=p.dataset.selectSeat;u&&nl(r,u)})),requestAnimationFrame(()=>d()[0]?.focus()),r.emit3dAnalytics("3d_comparison_opened",{seatIds:r.view3dCompareSeatIds.slice()})}function Ne(r,e=!0){let t=r.view3dCompareCleanup;if(r.view3dCompareCleanup=null,!t){r.view3dCompareEl?.remove(),r.view3dCompareEl=null,r.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||r.root?.focus({preventScroll:!0})}function nl(r,e){if(r.salesClosed){r.toast(r.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=r.allSeats().find(n=>n.id===e);if(!t)return;if(Ne(r,!1),!r.controller.select([e]).length){r.syncSelectionTo3d(),r.toast(r.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}r.syncSelectionTo3d(),r.showConfirm(t),r.emit3dAnalytics("3d_comparison_selected",{seatId:e})}function ys(r,e){r.querySelector(".sl-view3d-unavailable")?.remove();let{tf:t}=e,i=e.status==="held"?{title:t("picker.temporarilyHeld","Temporarily held"),message:t("picker.heldSeatExplanation","Another buyer is holding this seat. It may become available again.")}:e.status==="booked"?{title:t("picker.sold","Sold"),message:t("picker.soldSeatExplanation","This seat has already been booked.")}:{title:t("picker.notForSale","Not for sale"),message:t("picker.notForSaleExplanation","This seat is not included in the current sale.")},n=document.createElement("div");n.className="sl-view3d-unavailable",n.dataset.state=e.visualState,n.setAttribute("role","status"),n.setAttribute("aria-live","polite");let s=document.createElement("span");s.className="sl-view3d-unavailable-eyebrow",s.textContent=e.location;let o=document.createElement("strong");o.textContent=i.title;let a=document.createElement("div");a.className="sl-view3d-unavailable-copy",a.append(s,o);let l=document.createElement("button");l.type="button",l.setAttribute("aria-label",t("picker.closeSeatStatus","Close seat status")),l.textContent="\xD7";let c=document.createElement("p");c.textContent=i.message,n.append(a,l,c),l.addEventListener("click",()=>pr(r)),r.appendChild(n),Yt(n,e.anchor??null)}function pr(r){let e=r?.querySelector(".sl-view3d-unavailable:not([data-leaving])");e&&(e.dataset.leaving="true",Ee(e))}var Rt=require("@seatlayer/core");function xs(r){return Array.isArray(r)?r.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function hr(r,e,t=!1){let i=r.violations[0];return i==="numberOfPlacesToSelect"?r.remaining>0?(0,Rt.t)("picker.selectExactMore",{count:r.remaining}):(0,Rt.t)("picker.selectExactCount",{count:r.required}):i==="minimumSelectedPlaces"?(0,Rt.t)("picker.selectMinimumMore",{count:r.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):i==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,Rt.t)("picker.orphanHint")}var de=require("@seatlayer/core");function Ot(r){let e=Math.max(0,r),t=Math.floor(e/6e4),i=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${i}`}function ws(r){let e=r.performanceLabel?`<div class="sl-chip-when">${O(r.performanceLabel)}</div>`:"",t=r.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${O(r.performanceDates.summary)}</span><span class="sl-chip-date-list">${r.performanceDates.labels.map(i=>`<span class="sl-chip-date">${O(i)}</span>`).join("")}</span></div>`:"";return e+sl(r)+t}function sl({d:r,area:e,label:t,objectType:i,quantity:n=1,identity:s}){let o=d=>String(d??"\u2014").replace(/[&<>"]/g,h=>({"&":"&","<":"<",">":">",'"':"""})[h]),a=i==="ga"?"ga":r?.objectType??i,l=s?.displayType?.trim()||r?.displayType?.trim()||e?.displayType?.trim()||(a==="table"?g("picker.table","Table"):a==="booth"?g("picker.booth","Booth"):a==="ga"?g("picker.generalAdmission","General admission"):g("picker.row","Row")),c=s?.rowLabel??s?.displayLabel??r?.rowLabel??r?.displayLabel??e?.displayLabel??e?.label??t;return a==="table"&&s?.bookingMode?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(c)}</span></span><span class="fld mid"><span class="sl-chip-eb">${g("picker.guests","Guests")}</span><span class="val">${n}</span></span></div>`:a==="ga"?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(c)}</span></span>`+(n>1?`<span class="fld mid"><span class="sl-chip-eb">${g("picker.tickets","Tickets")}</span><span class="val">${n}</span></span>`:"")+"</div>":a==="booth"?'<div class="sl-chip-id">'+(r?.sectionLabel?`<span class="fld sec"><span class="sl-chip-eb">${g("picker.section","Section")}</span><span class="val">${o(r.sectionLabel)}</span></span>`:"")+`<span class="fld mid"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(c)}</span></span></div>`:!r?.sectionLabel&&!r?.rowLabel&&!r?.seatNumber?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${g("picker.seat","Seat")}</span><span class="val">${o(c)}</span></span></div>`:'<div class="sl-chip-id">'+(r.sectionLabel?`<span class="fld sec"><span class="sl-chip-eb">${g("picker.section","Section")}</span><span class="val">${o(r.sectionLabel)}</span></span>`:"")+(r.rowLabel?`<span class="fld mid"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(W(r))}</span></span>`:"")+(r.seatNumber?`<span class="fld mid"><span class="sl-chip-eb">${g("picker.seat","Seat")}</span><span class="val">${o(r.seatNumber)}</span></span>`:"")+"</div>"}function ur(r,e){let t=O(r),i=e?O(e):"";return`<div class="sl-chip-rail"><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>`+(e?`<button type="button" class="view" data-view-label="${i}" aria-label="${O((0,de.t)("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>`:"")+"</div>"}function ks(r){return r.salesClosed||r.hasHold||r.ctaPhase!=="idle"||r.formOpen||r.room<=0?null:Math.max(1,Math.min(r.wanted,r.room))}function Ss({count:r,total:e,pendingCount:t,ctaPhase:i,hasHold:n,salesClosed:s,fromPrice:o,addMore:a,holdTime:l,money:c}){return r&&i==="holding"?`<span>${g("picker.securingSeats","Securing your seats\u2026")}</span>`:r&&i==="checkout"?`<span>${(0,de.t)("picker.peekSecured",{count:r,total:c(e)})}</span>`:r?`<span class="sl-peek-sum">${(0,de.tCount)("picker.ticketsCount",r)}</span>`+(a?`<button type="button" class="go ghost sl-sheet-go sl-sheet-best" data-act="best" aria-label="${g("picker.findTogetherInstead","Find seats together instead")}">\u2726</button>`:"")+`<button type="button" class="go sl-sheet-go" data-act="checkout">${n&&t?g("picker.secureMore","Secure more"):g("picker.continue","Continue")}<span class="sl-peek-total">${c(e)}</span>`+(n&&l?`<span class="sl-peek-time" aria-hidden="true">${l}</span>`:"")+"</button>":s?`<span>${g("picker.salesClosedPill","Sales are closed")}</span>`:o!=null?`<span>${(0,de.t)("picker.peekFromPrice",{price:c(o)})}</span>`:`<span>${g("picker.pickYourSeats","Pick your seats")}</span>`}function mr(r,e=Date.now()){return(0,de.t)("picker.holdReassurance",{time:Ot(r-e)})}function Ts(r){return r.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${g("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,de.t)("picker.willFindSeatsTogether",{count:r.quantity})}</b><span>${g("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>${g("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${g("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${g("picker.findBestSeatsTogether","Find the best seats together")}</div><div class="sl-ba-copy"><span class="wide">${g("picker.willChooseClosestGroup","We\u2019ll choose the closest available group for you.")}</span><span class="narrow">${g("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")}</span></div>`+(r.offerPremium?`<button type="button" class="sl-ba-premium${r.premium?" on":""}" data-ba-premium aria-pressed="${r.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${g("picker.bestSeatsPremium","Best seats")}</button>`:"")+(r.categories.length>1?`<select aria-label="${O(g("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${O(g("picker.anyTicketType","Any ticket type"))}</option>`+r.categories.map(e=>`<option value="${O(e.key)}"${r.selectedCategory===e.key?" selected":""}>${O(e.label)}</option>`).join("")+"</select>":'<span aria-hidden="true"></span>')+(r.zones.length?`<select aria-label="${g("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${g("picker.anyVenueZone","Any venue zone")}</option>`+r.zones.map(e=>`<option value="${O(e.id)}"${r.selectedZone===e.id?" selected":""}>${O(e.label)}</option>`).join("")+"</select>":"")+`<div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${g("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${r.quantity}</span><button type="button" data-ba="1" aria-label="${g("picker.moreSeats","More seats")}">+</button></div><button type="button" class="sl-ba-go${r.busy?" sl-busy":""}"${r.busy?" disabled":""}>`+(r.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${g("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,de.tCount)("picker.findBestSeatsCount",r.quantity))+"</button>"+(r.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${g("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function Cs(r){if(r.salesClosed&&!r.hasPicks){let e=r.whenText?`<span class="when">${O(r.whenText)}</span>`:"";return`<div class="sl-closed-note" role="status"><b>${g("picker.salesClosedPill","Sales are closed")}</b><span>${g("picker.salesClosedCopy","Ticket sales for this event have ended.")}${e}</span></div>`}return r.hasPicks?"":r.hasGaAreas?`<div class="sl-tray-hint">${r.seated?r.venue3d?g("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue \u2014 or grab standing tickets below."):g("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below."):r.venue3d?g("picker.gaTrayHintChoose3dArea","Choose an area in the 3D venue to select tickets."):g("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets.")}</div>`:`<div class="sl-tray-hint">${r.groupMode==="per_performance"?g("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):r.groupMode?g("picker.groupTrayHint","Choose seats once \u2014 the same seats will be held for every performance."):r.venue3d?g("picker.trayHintChoose3dOrBest","Choose a seat in the 3D venue, or let us pick the best available for you."):g("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}</div>`}function Es(r){return{title:(0,de.t)("picker.securedCount",{count:r.secured}),copy:r.pendingCount?(0,de.t)("picker.moreSelectedCount",{count:r.pendingCount}):mr(r.expiresAt),change:r.releasing?g("picker.releasingEllipsis","Releasing\u2026"):g("picker.change","Change")}}var It=require("@seatlayer/core");var fr=4,ol=6;function al(r){let e=r.trim();return/^[0-9]{1,4}$/.test(e)?Number(e):null}function Ps(r){return[r.held?"h":"s",r.section,r.rowLabel,r.categoryLabel,r.amountText].join(" ")}function ll(r){if(r.length===1)return r[0];let e=r.map(al);if(e.every(i=>i!==null)){let i=[...e].sort((o,a)=>o-a);if(i.every((o,a)=>a===0||o===i[a-1]+1))return`${i[0]}\u2013${i[i.length-1]}`;let s=i.slice(0,3).join(", ");return i.length>3?`${s} +${i.length-3}`:s}let t=r.slice(0,3).join(", ");return r.length>3?`${t} +${r.length-3}`:t}function cl(r){let e=[];for(let t of r){let i=e[e.length-1];!!i&&t.groupable&&i.members[0].groupable&&Ps(i.members[0])===Ps(t)?i.members.push(t):e.push({members:[t],seatsLabel:""})}for(let t of e)t.seatsLabel=ll(t.members.map(i=>i.seatLabel));return e}function Ms(r,e,t,i){let n=O;return` data-key="${n(r)}"`+(t.length?` data-held="${n(encodeURIComponent(t.join(`
|
|
2236
|
-
`)))}"`:"")+(e.length?` data-seat="${n(e.join(" "))}"`:"")+(i?` data-locate="${n(i)}"`:"")}function Ls(r){let e=O;return`<div class="sl-chip${r.held?" sl-held":""}${r.fresh?" sl-enter":""}"`+Ms(r.key,r.seatIds,r.heldLabels,r.locateId)+`><div class="sl-chip-main">${r.identityHtml}<div class="sl-chip-sub">${r.stateHtml}<span class="cat">${e(r.categoryLabel)}</span>${r.extrasHtml}`+(r.amountText?`<span class="amt">${e(r.amountText)}</span>`:"")+`</div>${r.noteHtml}</div>${r.railHtml}</div>`}function As(r,e,t,i,n){let s=O,o=e?.members.length??1,a=o>1,l=e?e.seatsLabel:r.seatLabel,c=e?e.members.reduce((p,u)=>p+u.amount,0):r.amount,d=e?e.members.flatMap(p=>p.seatIds):r.seatIds,h=e?e.members.flatMap(p=>p.heldLabels):r.heldLabels;return`<div class="sl-chip sl-tline${r.held?" sl-held":""}${r.fresh?" sl-enter":""}${e?"":" sl-tsub"}"${i?' data-overflow="true"':""}`+(e?` data-run="${t}"`:` data-run-of="${t}"`)+Ms(r.key,d,h,r.locateId)+">"+(a?`<button type="button" class="sl-trun-toggle" aria-expanded="false" aria-label="${s((0,It.tCount)("picker.seatsSelectedCount",o))}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg></button>`:r.held?r.stateHtml:`<span class="sl-tline-dot" style="background:${w(r.categoryColor)}" aria-hidden="true"></span>`)+`<span class="sl-sr">${s(r.categoryLabel)}</span><span class="sl-tline-id"><b>${s(r.section||r.seatLabel)}</b>`+(r.rowLabel?`<i>\xB7</i><span>${s(r.rowLabel)}</span>`:"")+(r.section&&l?`<i>\xB7</i><span>${s(l)}</span>`:"")+"</span>"+r.extrasHtml+(n.suppressPricing||!r.amountText?"":(a?`<span class="sl-tline-mult">${o}\xD7</span>`:"")+`<span class="amt">${s(n.money(c))}</span>`)+(r.railHtml?`<button type="button" class="rm" aria-label="${s(r.removeAria)}"><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 Hs(r,e){if(!r.length)return"";let t=cl(r),i=[g("picker.section","Section"),g("picker.row","Row"),g("picker.seat","Seat")].join(" \xB7 "),n=t.length>=ol,s=t.map((a,l)=>{let c=n&&l>=fr;return As(a.members[0],a,l,c,e)+(a.members.length>1?a.members.map(d=>As(d,null,l,c,e)).join(""):"")}).join(""),o=n?`<button type="button" class="sl-tmore" data-tmore aria-expanded="false" data-more="${O((0,It.t)("picker.moreCount",{count:t.length-fr}))}" data-less="${O(g("picker.showLess","Show less"))}"><span>${O((0,It.t)("picker.moreCount",{count:t.length-fr}))}</span><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg></button>`:"";return`<div class="sl-tlist"${n?' data-collapsed="true"':""}><div class="sl-tlist-head sl-sr">${O(i)}</div>${s}${o}</div>`}function Rs(r){r.dataset.denseWired!=="true"&&(r.dataset.denseWired="true",r.addEventListener("click",e=>{let t=e.target,i=t.closest("[data-tmore]");if(i){let l=i.closest(".sl-tlist"),c=l?.getAttribute("data-collapsed")==="true";l?.setAttribute("data-collapsed",c?"false":"true"),i.setAttribute("aria-expanded",c?"true":"false");let d=i.querySelector("span");d&&(d.textContent=(c?i.dataset.less:i.dataset.more)??d.textContent);return}let n=t.closest(".sl-trun-toggle");if(!n)return;e.stopPropagation();let s=n.closest(".sl-tline"),o=s?.dataset.run;if(!s||o===void 0)return;let a=n.getAttribute("aria-expanded")!=="true";n.setAttribute("aria-expanded",a?"true":"false"),s.setAttribute("data-open",a?"true":"false"),s.parentElement?.querySelectorAll(`.sl-tsub[data-run-of="${o}"]`).forEach(l=>l.setAttribute("data-open",a?"true":"false"))}))}var Os=require("@seatlayer/core");var Si=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"),this.button.setAttribute("aria-label",t.tf("picker.accessibilityOptions","Accessibility and colour options")),this.button.innerHTML='<span aria-hidden="true">\u267F</span>',this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let i of this.stored())t.present.has(i)&&this.active.add(i);this.menu.innerHTML=Qn(this.rows()),this.root.append(this.menu,this.button),e.appendChild(this.root),this.button.addEventListener("click",i=>{i.stopPropagation(),this.open(this.menu.hidden)}),this.menu.addEventListener("pointerdown",i=>i.stopPropagation()),this.menu.addEventListener("click",i=>i.stopPropagation()),this.dismiss=()=>this.open(!1),this.escape=i=>{i.key==="Escape"&&this.open(!1)},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),this.wire(),this.active.size&&this.applyFilter()}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}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)))}}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),this.root.remove()}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;let t=this.button.getBoundingClientRect();Di(this.menu,{x:t.left+t.width/2,y:t.top}),Or(this.menu),Yt(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",icon:"\u25D0",label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",icon:"\u25D0",className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}filterRows(){return Os.ACCESSIBILITY_TYPES.filter(({key:e})=>this.deps.present.has(e)).map(({key:e,label:t,icon:i})=>({key:`a11y:${e}`,icon:i,label:t,...e==="wheelchair"&&this.deps.present.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},on:this.active.has(e)}))}wire(){for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let s=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(s),this.paint(e,s);return}if(t==="limited"){let s=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(s),s&&this.deps.focusSeatsForFilter(),this.paint(e,s);return}let i=t.slice(5),n=!this.active.has(i);n?this.active.add(i):this.active.delete(i),this.paint(e,n),this.applyFilter()})}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(){let e=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(e),this.remember(e),e&&this.deps.focusSeatsForFilter()}key(){return`seatmap.a11y.filter.${this.deps.event}`}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{}}};var Is=Symbol("seatlayer.performance-group-picker");function _s(r,e){return Object.defineProperty(r,Is,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),r}function Ds(r){return r[Is]??null}var He=require("@seatlayer/core");function gr(r,e,t){try{return new Intl.DateTimeFormat(e,{...t,...r.timezone?{timeZone:r.timezone}:{}}).format(new Date(r.startsAt))}catch{return new Date(r.startsAt).toLocaleString(e)}}var Ti=(r,e)=>gr(r,e,{dateStyle:"medium"}),Ci=(r,e)=>gr(r,e,{timeStyle:"short"}),Ei=(r,e)=>gr(r,e,{weekday:"short",day:"numeric",month:"short"});function Bs(r,e,t,i){return!r.length||r.length>=e?null:{summary:i,labels:r.map(n=>`${Ti(n,t)} \xB7 ${Ci(n,t)}`)}}function dl(r,e){let t=new Set(e);return r.map(i=>({...i,free:!t.has(i.eventKey)}))}function $s(r,e){let t=[...r];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function pl(r,e,t="",i=!1){if(!r.length)return"";let n=r.map(s=>{let o=s.free?e.free:e.blocked,a=i&&s.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${w(s.eventKey)}" aria-label="${w(`${s.shortDate}: ${o}`)}" checked>`:"";return`<li class="sl-night${s.free?" ok":" no"}" aria-label="${w(`${s.shortDate}: ${o}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${w(s.shortDate)}</span><span class="st">${w(o)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${w(e.title)}</div><ul class="sl-nightstrip">${n}</ul><p class="sl-tip-nights-note">${w(e.notAvailableOn)}</p>`+t+"</div>"}function hl(r){return r.selectPartialLabel&&r.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${w(r.selectPartialLabel)}</button>`:r.switchLabel&&r.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${w(r.switchLabel)}</button>`:r.switchLabel||r.selectPartialLabel?"":`<p class="sl-tip-advice">${w(r.advice)}</p>`}function ul(r){return Number(r.available)+Number(r.selected)+Number(r.partial)+Number(r.unavailable)}function zs(r,e,t){if(ul(r)<2)return"";let i=(s,o,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${w(o)}</li>`,n=[];return r.available&&n.push(i("sl-pg-sw-free",e.available,` style="background:${w(t)}"`)),r.selected&&n.push(i("sl-pg-sw-sel",e.selected)),r.partial&&n.push(i("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${w(t)}"`)),r.unavailable&&n.push(i("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${w(e.title)}">${n.join("")}</ul>`}function Vs(r,e){if(!r.length)return"";let t=r.map(i=>{let n=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="${w(i.eventKey)}"><span class="n">${w(i.name)}</span><span class="s">${w(n)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${w(e.title)}"><div class="sl-pg-nights-title">${w(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function br(r,e){if(r?.kind!=="partial"||!e?.length)return null;let t=r.data?.blockedEventKeys??[],i=dl(e,t);return{states:i,missing:i.filter(n=>!n.free).map(n=>n.shortDate)}}function Fs(r,e){return r?pl(r.states,{title:g("picker.group.partlyAvailableTitle","Free on some nights only"),free:g("picker.group.nightFree","Free"),blocked:g("picker.group.nightBlocked","Not available"),notAvailableOn:(0,He.t)("picker.group.notAvailableOn",{dates:$s(r.missing,e.locale)})},hl({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:g("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function ml(r,e,t,i){if(!r.length)return"";let n=new Set(e),s=new Set(t),o=r.map(a=>{let l=n.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${w(a.eventKey)}" aria-label="${w(`${a.shortDate}: ${l?i.available:i.unavailable}`)}"${l&&s.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${w(a.shortDate)}</span><span class="sl-confirm-date-state">${w(l?i.available:i.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${w(i.title)}</legend><p class="sl-confirm-dates-copy">${w(i.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${w(i.selectAll)}</span></label><ul>${o}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function Ns(r,e,t,i){let n=e.availableEventKeys(t);return ml(r,n,e.includedEventKeys(),{title:i("picker.group.confirmDatesTitle","Choose performance dates"),copy:n.length===r.length?i("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(r.length)):i("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(n.length)).replace("{total}",String(r.length)),selectAll:i("picker.group.confirmSelectAll","Select all available dates"),available:i("picker.group.nightFree","Available"),unavailable:i("picker.group.nightBlocked","Unavailable")})}function js(r){return[...r.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function Gs(r,e,t,i){let n=[...r.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!n.length)return;let s=r.querySelector(".sl-confirm-add"),o=r.querySelector("[data-pg-confirm-all]"),a=()=>{let l=n.filter(h=>!h.disabled),c=js(r).length;o&&(o.checked=c===l.length,o.indeterminate=c>0&&c<l.length);let d=r.querySelector("[data-pg-confirm-summary]");d&&(d.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),s.disabled=c===0,s.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),i()};n.forEach(l=>l.addEventListener("change",a)),o?.addEventListener("change",()=>{n.filter(l=>!l.disabled).forEach(l=>{l.checked=o.checked}),a()}),a()}async function Ks(r,e,t){if(!r||!t||!r.querySelector("[data-pg-confirm-event-key]"))return!0;let i=js(r);if(!i.length)return!1;let n=r.querySelector(".sl-confirm-add");return n?.setAttribute("aria-busy","true"),n&&(n.disabled=!0),await t.apply(e,i)?!0:(n?.removeAttribute("aria-busy"),n?.isConnected&&(n.disabled=!1),!1)}function Us(r,e,t){return r?(0,He.t)("picker.group.seatPartlyAvailable",{label:e,free:r.states.length-r.missing.length,total:r.states.length,dates:$s(r.missing,t)}):""}function qs(r,e){let t=r.map((i,n)=>{let s=i.state==="done"?e.done:i.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${w(i.id)}" data-state="${w(i.state)}"${i.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${i.state==="done"?"\u2713":String(n+1)}</span><span class="l">${w(i.label)}</span><span class="sl-pg-sr">${w(s)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${w(e.label)}">${t}</ol>`}function vr(r,e){return`<ul class="sl-pg-cards">${r.map(i=>`<li class="sl-pg-card" data-event-key="${w(i.eventKey)}"><span class="n">${w(i.name)}</span><time datetime="${w(i.iso)}"><span class="d">${w(i.date)}</span><span class="t">${w(i.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${w(e)}</p>`}function Ws(r){let e=r.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${w(t.eventKey)}"><span class="n">${w(t.name)}</span><span class="s">${w(t.labels.length?t.labels.join(", "):r.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${w(r.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(r.note?`<p class="sl-pg-pane-note">${w(r.note)}</p>`:"")+(r.total?`<div class="sl-pg-pane-total"><span>${w(r.total.label)}</span><b>${w(r.total.amount)}</b></div>`:"")+(r.holdStatus?`<p class="sl-pg-hold-status" role="status">${w(r.holdStatus)}</p>`:"")}function Ys(r){let e=Math.max(0,r);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function Qs(r,e){if(!r||r.seats<=0)return"";if(e==="same_seat"){let t=r.perPerformance??r.seats;return r.totalPerformances&&r.performances<r.totalPerformances?(0,He.tCount)("picker.group.performancesChosenOf",t,{chosen:r.performances,total:r.totalPerformances}):(0,He.tCount)("picker.group.seatsEveryPerformance",t)}return r.perPerformance!=null&&r.performancesChosen===r.performances?(0,He.tCount)("picker.group.seatsPerPerformance",r.seats,{per:r.perPerformance}):(0,He.tCount)("picker.group.performancesChosenOf",r.seats,{chosen:r.performancesChosen,total:r.performances})}function Xs(r,e){r.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let i=()=>e(t.dataset.eventKey);t.addEventListener("click",i),t.addEventListener("keydown",n=>{n.key!=="Enter"&&n.key!==" "||(n.preventDefault(),i())})})}var Zs=require("@seatlayer/core");function fe(r){return String(r??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function fl(r,e){let t=r.objectType==="table"&&!!r.bookingMode,i=r.objectType==="booth",n=t||i||!r.seatNumber,s=n?r.rowLabel??r.displayLabel??r.label:r.seatNumber,o=t?`${g("picker.guests","Guests")} ${r.bookingMode==="variable"?`${r.minOccupancy}\u2013${r.maxOccupancy}`:r.capacity}`:!i&&r.rowLabel?`${e} ${W(r)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${n?" name":""}">${fe(s)}</span>`+(o?`<span class="sl-tip-row">${fe(o)}</span>`:"")+"</div>"+(r.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${g("picker.section","Section")}</span><span class="sl-tip-secname">${fe(r.sectionLabel)}</span></div>`:"")+"</div>"}function Js(r,e){let t=r.status==="not_for_sale",i=r.mark?.kind==="partial",n=r.status==="free"||i?"":`<span class="sl-tip-tag">${t?g("picker.notAvailable","Not available"):r.status==="held"?(0,Zs.t)("map.statusHeld"):g("picker.sold","Sold")}</span>`,s=t?"":e.price,o=s?`<span class="sl-tip-amt">${fe(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${fe(e.priceNote)}</div>`:"",l=Le(r.commercial),c=l?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u25D0</span>${fe(l)}</div>`:"",d=lt(r.wheelchairSpaceType),h=d?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u267F</span>${fe(d)}</div>`:"",p=e.reason?`<div class="sl-tip-reason">${fe(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+fl(r,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${fe(r.categoryColor)}"></span><span class="sl-tip-name">${fe(r.categoryLabel)}</span>`+n+o+"</div>"+a+p+h+c+(e.extra??"")}function eo(r,e,t,i){let n=r.x+14,s=r.y-i.height-12,o=r.y+18,a=s;n+i.width>e-8&&(n=r.x-i.width-14),s<8&&o+i.height<=t-8&&(a=o);let l=Math.max(8,t-i.height-8);return{left:Math.max(8,Math.min(n,Math.max(8,e-i.width-8))),top:Math.max(8,Math.min(a,l))}}function to(r,e,t,i=22){let n=Math.max(8,Math.min(r.x-t.width/2,Math.max(8,e.width-t.width-8))),s=r.y-i-t.height,o=r.y+i;return s>=8?{left:n,top:s,placement:"above"}:o+t.height<=e.height-8?{left:n,top:o,placement:"below"}:{left:n,top:Math.max(8,Math.min(s<8?o:s,Math.max(8,e.height-t.height-8))),placement:s<8?"below":"above"}}function io(r,e,t,i){let n=t.width/2+12,s=Math.max(n,Math.min(e.width-n,r.x)),o=r.y+t.height+24<=e.height,a=r.y<t.height+24&&o?"below":"above",l=i&&a==="above"?Math.max(t.height+24,r.y):r.y;return{left:s,top:Math.max(8,Math.min(e.height-8,l)),placement:a}}function ro(r,e,t){let i=r.querySelector("[data-pg-select-partial]"),n=[...r.querySelectorAll("[data-pg-event-key]")],s=()=>n.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),o=()=>{if(!i)return;let a=s().length;i.disabled=a===0,i.textContent=e?.(a)??i.textContent};n.forEach(a=>{a.addEventListener("change",o);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,o())})}),i?.addEventListener("click",()=>{let a=s();a.length&&t?.(a)})}function dt(r){let e=r?.displayType?.trim()||r?.rowType?.trim();return e||(r?.objectType==="table"?g("picker.table","Table"):r?.objectType==="booth"?g("picker.booth","Booth"):g("picker.row","Row"))}var no="@seatlayer/pending-checkout/v1";function gl(r){return typeof r=="string"&&r.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(r)}function so(r){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 n=window.sessionStorage.getItem(no);if(n){let s=null;try{s=JSON.parse(n)}catch{}if(s&&gl(s.orderId)){let o=Date.now()-Number(s.storedAt);if(o>=0&&o<=144e5){if(s.eventKey&&s.eventKey!==r)return null;i=s.orderId}}}window.sessionStorage.removeItem(no)}catch{}e.delete("seatlayer_checkout");try{let n=e.toString();history.replaceState(history.state,"",`${location.pathname}${n?`?${n}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:i}}function oo(r){if(!r.framed)return null;let e=r.ancestorOrigins?.length?r.ancestorOrigins[0]:null;for(let t of[e,r.referrer])if(t)try{return new URL(t).origin}catch{}return null}var bl="https://api.seatlayer.io",vl=10,ao=6e4,lo=6e4,yl=160,po="seatmap.a11y.cb";function xl(){try{if(typeof window>"u")return null;let r=window.localStorage.getItem(po);return r==null?null:r==="1"}catch{return null}}function wl(r){try{window.localStorage.setItem(po,r?"1":"0")}catch{}}var pt=class r{constructor(e){this.realtime=null;this.accessEl=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.holdTimer=null;this.toastTimer=null;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.bookedEl=null;this.gaQty=new Map;this.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.confirmEl=null;this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedReport=null;this.confirmSeat=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.baReopen=!1;this.bestAvailableConfirm=!1;this.releasingHold=!1;this.salesClosed=!1;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.projectionEl=null;this.buyerView="map";this.view3dEl=null;this.view3dHandle=null;this.view3dGen=0;this.view3dReturnSeat=null;this.view3dTargetSeatId=null;this.view3dCompareSeatIds=[];this.view3dCompareChip=new vi({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.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.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.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.holdCopyPending=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalScrim=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.lastCatAvail=null;this.lastAvailFloorId="";this.availQuietUntil=0;this.liveTimer=null;this.perspectiveWarned=!1;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=Ds(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??bl).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?qt({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??et(e,t),this.pubApi=e.transport?null:i?.api??new Te(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=e.transport??this.pubApi,this.buyerAssetUrls=new rt(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 n=e.numberOfPlacesToSelect;if(n!=null&&(!Number.isInteger(n)||n<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=n??null;let s=xs(e.selectionValidators);if(this.exactTickets!=null&&s>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let o=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(vl,s)));if(this.exactTickets!=null&&o<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&o<s)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??o,this.cbSafe=xl()??!!e.colorblindSafe,this.controller=this.wireController(e)}get lastSection(){return this.sectionCard.summary}set lastSection(e){this.sectionCard.adopt(e)}chartHasStage(){let e=this.controller.doc;if(!e)return!1;let t=e.floors?.length?e.floors.map(i=>i.objects??[]):[e.objects??[]];for(let i of t)for(let n of i)if(n.type==="shape"&&(n.role==="stage"||n.stageKind))return!0;return!1}confirmThumbHtml(e){let t=this.controller.doc;if(!t)return"";let i=this.deliverableViewReference(e)?e.viewUrl??"":"",n=this.chartHasStage();if(!i&&!n)return"";let s=null;if(!i)try{s=(0,C.generateSeatThumb)(e,e.focalPoint??t.focalPoint).distanceM??null}catch{return""}let o=n&&s!=null?`<div class="sl-confirm-sight">${O((0,C.t)("picker.sightline",{m:s}))}</div>`:"",a=O((0,C.t)("picker.viewFromSeat",{label:e.label})),l=O(this.tf("picker.viewFromHere","View from here"));return(i?`<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>`:`<button type="button" class="sl-confirm-view sl-confirm-viewbtn" aria-label="${a}"><span aria-hidden="true">\u{1F52D}</span><span>${l}</span></button>`)+o}deliverableViewReference(e){let t=e.viewMeta?.previewUrl??e.viewUrl;return t&&(Ni(t)||it(t))?t:null}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=oo({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()}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),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))}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e}),e&&!this.fsEscHandler?(this.fsEscHandler=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){nt();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let n=document.createElement("div");n.className="sl-modal-frame",n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.setAttribute("aria-label",g("picker.seatSelection","Seat selection")),n.tabIndex=-1,i.appendChild(n),document.body.appendChild(i);let s=document.body.style.overflow;document.body.style.overflow="hidden";let o=new r({...e,container:n});o.modalScrim=i,o.prevFocus=t;let a=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),l=()=>{let b=[...n.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(m=>m.isConnected&&!m.closest('[hidden], [aria-hidden="true"], [inert]'));return b[b.length-1]??n},c=(b,m)=>{let v=b;for(;v;){let x=window.getComputedStyle(v);if(v.hidden||v.getAttribute("aria-hidden")==="true"||v.hasAttribute("inert")||x.display==="none"||x.visibility==="hidden"||x.visibility==="collapse")return!0;if(v===m)return!1;v=v.parentElement}return!0},d=b=>[...b.querySelectorAll(a)].filter(m=>m.tabIndex>=0&&!m.matches(":disabled")&&!c(m,b)),h=(b,m)=>{let v=d(b),x=m?v[v.length-1]:v[0];x?x.focus({preventScroll:!0}):(b.hasAttribute("tabindex")||(b.tabIndex=-1),b.focus({preventScroll:!0}))},p=!1,u=()=>{if(p)return;p=!0,document.body.style.overflow=s,o.escHandler&&document.removeEventListener("keydown",o.escHandler),i.remove(),o.modalScrim=null;let b=o.prevFocus;o.prevFocus=null,b?.isConnected&&b.focus({preventScroll:!0});let m=()=>{o.destroy(),e.onClose?.()};o.hold&&!o.handedOff?o.release().finally(m):m()};return o.closeModal=u,i.addEventListener("mousedown",b=>{b.target===i&&u()}),o.escHandler=b=>{if(b.key==="Tab"){if(b.defaultPrevented)return;let m=l(),v=d(m),x=v[0],S=v[v.length-1],A=document.activeElement;!x||!S?(b.preventDefault(),h(m,b.shiftKey)):A===m||!A||!m.contains(A)?(b.preventDefault(),(b.shiftKey?S:x).focus({preventScroll:!0})):b.shiftKey&&A===x?(b.preventDefault(),S.focus({preventScroll:!0})):!b.shiftKey&&A===S&&(b.preventDefault(),x.focus({preventScroll:!0}));return}b.key==="Escape"&&(o.tableDialog?(b.preventDefault(),o.cancelTableDialog()):o.confirmSeat?(b.preventDefault(),o.cancelConfirm()):o.bestAvailableConfirm?(b.preventDefault(),o.bestAvailableConfirm=!1,o.syncTray()):(b.preventDefault(),u()))},document.addEventListener("keydown",o.escHandler),await o.render(),o.els.close?.classList.add("on"),o.els.close?.addEventListener("click",u),h(l(),!1),o}wireController(e){return new C.PickerController({transport:this.api,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:ot(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let i=this.controller.getGAAreas().find(n=>n.id===t);i&&(this.collapseSheet(),Vi(this,i,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:()=>{this.syncSeatMarks(),this.syncPrices(),this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onHoldExpired:()=>{this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.toast((0,C.t)("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning"),this.syncTray(),this.emitHoldChange(),this.opts.onHoldExpired?.()},confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"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.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{this.confirmSeat?.id===t.id&&this.dismissConfirm(),this.tableDialog?.physicalSeatIds.includes(t.id)&&this.dismissTableDialog()},onSelectionLimit:()=>{this.toast((0,C.t)("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>this.opts.onError?.(t)})}async render(){if(this.rendered)return this;let e=performance.now(),t={},i=E=>Math.round((performance.now()-E)*100)/100;this.rendered=!0,nt();let n=performance.now(),s=Ln(this.opts.locale,this.opts.messages),o=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=sn(this.opts.container),{root:c,els:d,mapHost:h}=An(l,(E,V)=>this.tf(E,V),this.opts.theme);this.root=c,this.els=d,this.mapHost=h,Hn(c,s,E=>{t.loadLocale=i(n),this.destroyed||this.applyActiveLocale(E,o)}),as(c,()=>[{open:()=>this.tipPinned,close:()=>this.unpinTooltip()},{open:()=>!!this.tableDialog,close:()=>this.cancelTableDialog()},{open:()=>!!this.confirmSeat,close:()=>this.cancelConfirm()},{open:()=>this.bestAvailableConfirm,close:()=>{this.bestAvailableConfirm=!1,this.syncTray()}}]),this.syncFullscreenButtons(),this.wireBuyerShell(c);let p=document.createElement("div");p.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(p),t.mountBuyerShell=i(a),t.skeletonPaint=i(e);let u=await this.loadChart(p,t,i);if(!u)return this;t.shellsPaint=i(e),this.dismissSkeleton();let b=performance.now();if(this.startRealtime(),this.salesClosed=!!u.salesClosed||!!this.opts.readOnly,c.dataset.eventMode=u.mode==="test"?"test":"live",!this.opts.locale&&u.locale&&this.setLocale(u.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),u.mode==="test"){let E=document.createElement("div");E.className="sl-testbadge",E.textContent=(0,C.t)("picker.testMode"),E.setAttribute("aria-label",(0,C.t)("picker.testMode")),this.regions["top-left"].appendChild(E)}let m=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(c),this.watchThemeMode(),this.currency=u.currency??this.opts.currency??"USD",this.eventTimezone=u.timezone??null,on(this.els.logo,[this.opts.theme?.logoUrl,m?.logoUrl,u.posterUrl],this.opts.theme?.brandName??m?.brandName??u.eventName??"?"),this.els.name.textContent=u.eventName??"";let v=u.startsAt?ei(u.startsAt,u.timezone??null,this.opts.locale):"";this.eventWhenText=v||null,this.els.meta.textContent=[u.venue,v].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(m);let x=new Set,S=!1;if(this.controller.doc)for(let E of this.controller.getExpandedSeats()){for(let V of E.accessibility??[])x.add(V);E.accessible&&!E.accessibility?.length&&x.add("wheelchair"),(E.commercial?.restrictedView||E.commercial?.obstructedView)&&(S=!0)}this.buildAccessibilityMenu(x,S),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"),c.appendChild(this.srEl),this.buildArenaChrome(),this.buildMinimap(),this.buildPriceFilter(),this.buildExtendPrompt(),this.buildBookedOverlay(),this.buildSoldoutOverlay(),this.buildPanelToggle(),this.opts.panelCollapsed&&this.setPanelCollapsed(!0),this.dockLayoutChrome(),t.buildBuyerControls=i(b);let A=performance.now();this.restoreRememberedHold().then(()=>{t.restoreHold=i(A)}),this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let f=this.controller.doc,y=ai(this.opts.event),T=this.performanceGroup?"performance_group":"event",M={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:T,performanceGroup:!!this.performanceGroup,ms:i(e),performanceProfile:t,chartDelivery:u.chartDelivery,seatCount:this.allSeats().length,objectCount:f?.objects.length??0,sectionCount:f?.objects.filter(E=>E.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:f?.name,view:this.buyerView,load:y,transport:this.opts.transport?"custom":"pubapi"};ms(M,(E,V)=>this.emitAnalytics(E,V));let R=u.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",cr({...M,performanceProfile:{...M.performanceProfile,...R}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=u,await this.registerAgentTools(),this}registerAgentTools(){return hs(this)}webMcpHost(e){return or(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.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit.addEventListener("click",()=>this.controller.zoomToFit()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let n=this.els.sheetToggle,s=c=>{e.dataset.sheet=c?"open":"peek",n?.setAttribute("aria-expanded",String(c)),n?.setAttribute("aria-label",c?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))};s(e.dataset.sheet==="open"),n?.addEventListener("click",c=>{c.stopPropagation(),s(e.dataset.sheet!=="open")}),this.els.peek?.addEventListener("click",c=>{let d=c.target.closest(".sl-sheet-go");d&&(c.stopPropagation(),d.dataset.act==="checkout"?this.handleCta():d.dataset.act==="best"?(this.baReopen=!0,this.baQty=Math.max(1,Math.min(this.baQty,this.maxTickets-this.totalTicketCount())),this.syncTray(),s(!0),this.els.tray?.querySelector(".sl-ba-go")?.focus()):s(!0))});let o=0,a=!1,l=!1;t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard,.sl-sheet-toggle,.sl-sheet-go")){l=!1;return}l=!0,a=!1,o=c.clientY,t.setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!l||a)return;let d=c.clientY-o;d<-18?(s(!0),a=!0):d>18&&(s(!1),a=!0)}),t.addEventListener("pointerup",c=>{l&&!a&&Math.abs(c.clientY-o)<6&&s(e.dataset.sheet!=="open"),l=!1,t.releasePointerCapture?.(c.pointerId)})}let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let n=this.root.getAttribute("data-prices-open")==="true";if(this.root.setAttribute("data-prices-open",String(!n)),this.els.pricesSec?.setAttribute("aria-expanded",String(!n)),!n&&this.root.dataset.sheet!=="open"){this.root.dataset.sheet="open";let s=this.els.sheetToggle;s?.setAttribute("aria-expanded","true"),s?.setAttribute("aria-label","Collapse ticket panel")}};this.els.pricesSec?.addEventListener("click",n=>{n.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",n=>{n.key!=="Enter"&&n.key!==" "||n.target.closest("select,button")||(n.preventDefault(),i())}),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",n=>{this.handleMapPointerDown(n)},!0),this.els.map.addEventListener("mousemove",n=>{if(this.tipPinned)return;let s=this.els.map.getBoundingClientRect();this.tipPos={x:n.clientX-s.left,y:n.clientY-s.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.handleCta()}),this.els.holdChange?.addEventListener("click",()=>{this.handleChangeSeats()})}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||(e.dataset.sheet="peek",this.els.sheetToggle?.setAttribute("aria-expanded","false"),this.els.sheetToggle?.setAttribute("aria-label",this.tf("picker.openTicketPanel","Open ticket panel")))}observeLayout(e){let t=()=>{let i=e.clientWidth;if(i<=0)return;let n=e.clientHeight,s=i!==this.pickerLayoutSize.width||n!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:n},this.reportFramedHeight();let o=i<640?"narrow":"wide",a=n<560?"compact":"comfortable";(e.dataset.layout!==o||e.dataset.density!==a)&&(e.dataset.layout=o,e.dataset.density=a,o==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.lastTrayKeys.size&&this.syncTray()),s&&(this.minimap?.refreshMinimap(),this.fitSectionStripCount())};this.ro=new ResizeObserver(t),this.ro.observe(e),t(),requestAnimationFrame(t)}async loadChart(e,t,i){let n=performance.now(),s=await this.controller.render(e);return t.loadChartAndStatuses=i(n),this.destroyed?null:s?(Object.assign(t,s.performanceProfile),s):(ye({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?"performance_group":"event",surface:this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:Ae(this.opts.event),transport:this.opts.transport?"custom":"pubapi"}),this.els.boot.innerHTML=`<div class="sl-boot-title">${this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load")}</div><div>${this.tf("picker.checkConnection","Check your connection and try again.")}</div><button type="button" class="sl-boot-retry">${this.tf("picker.accessRetry","Try again")}</button>`,this.els.boot.querySelector("button").addEventListener("click",()=>{let o=this.opts.container,a=this.opts;this.destroy(),new r({...a,container:o}).render()}),null)}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=so(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,t){let i=this.regions["bottom-left"]??this.els.map;i&&(this.a11yMenu=new Si(i,{event:String(this.opts.event),present:e,hasLimitedView:t,tf:(n,s)=>this.tf(n,s),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:n=>this.setColorblindSafe(n),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:n=>{this.limitedViewFilter=n,this.controller.setCommercialLimitedFilter(n),this.pushAvailabilityTo3d()},applyAccessibilityFilter:n=>{this.controller.setAccessibilityFilter(n),this.syncPrices(),this.minimap?.refreshMinimap()},focusSeatsForFilter:()=>this.focusSeatsForFilter()}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}setAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e)}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 n=this.els.pricesSec;n&&(e?(n.setAttribute("role","button"),n.tabIndex=0,n.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(n.removeAttribute("role"),n.removeAttribute("aria-expanded"),n.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){let e=document.createElement("div");e.className="sl-extend",e.setAttribute("role","status"),e.innerHTML='<span class="sl-extend-txt" data-ref="extendTxt"></span><button type="button" class="sl-extend-btn" data-ref="extendBtn"></button>',(this.regions["bottom-center"]??this.els.map).appendChild(e),this.extendEl=e,this.els.extendTxt=e.querySelector('[data-ref="extendTxt"]'),this.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),this.els.extendBtn.textContent=this.tf("picker.addTime","Add time"),this.els.extendBtn.addEventListener("click",()=>{this.handleExtend()})}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>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]')}get onGAPromptHook(){return this.opts.onGAPrompt}tf(e,t){return g(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 n=document.createElement("div");n.className="sl-soldout-title",n.textContent=this.tf("picker.soldOutTitle","Sold out");let s=document.createElement("p");s.className="sl-soldout-copy",s.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(i,n,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,n=this.isSoldOut(e,t,i);n!==this.soldOut&&(this.soldOut=n,this.soldoutEl?.classList.toggle("on",n))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(n=>(t[n.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();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.tf("picker.salesClosedPill","Sales are closed")}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.tf("picker.salesClosedToast","Sales are closed for this event.")),this.syncCta(),this.syncTray()}badgeHidden(e){return!!(this.opts.hideBadge||e?.hideBadge)}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let i=document.createElement("a");i.className="sl-powered",i.href="https://seatlayer.io/?ref=picker",i.target="_blank",i.rel="noopener noreferrer",i.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let n=document.createElement("span");n.className="sl-powered-mark",n.setAttribute("aria-hidden","true"),n.innerHTML=Xt;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),i.append(n,s),t.appendChild(i)}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){if(this.reducedMotion())return;let t=(e.items??[]).filter(i=>i.objectType!=="ga").slice(0,10).map(i=>this.controller.seatByLabel(i.label)).filter(i=>!!i);us({regions:this.els,categories:this.controller.doc?.categories,pop:i=>this.controller.flashSeat(i,this.cssVar("--sl-accent")||"#f4b740"),focus:(i,n)=>this.controller.focusSection(i,n),screenPoint:i=>this.controller.worldToScreen(i),schedule:(i,n)=>this.scheduleMotion(i,n)},t)}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(){let e=this.hold?.items??[],t=new Set(e.map(n=>n.label));return this.committedSelection().filter(n=>!t.has(n.label)).reduce((n,s)=>n+(s.quantity??1),0)+Ve(this.gaQty,this.hold?.items??[])}heldTicketCount(){return(this.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}totalTicketCount(){let e=new Set((this.hold?.items??[]).map(i=>i.label)),t=this.committedSelection().filter(i=>!e.has(i.label)).reduce((i,n)=>i+(n.quantity??1),0);return this.heldTicketCount()+t+Ve(this.gaQty,this.hold?.items??[])}updateSelectionCapacity(){let e=new Set((this.hold?.items??[]).map(n=>n.label)),t=this.committedSelection().filter(n=>e.has(n.label)).reduce((n,s)=>n+(s.quantity??1),0),i=Math.max(0,this.maxTickets-this.heldTicketCount()-Ve(this.gaQty,this.hold?.items??[]));this.controller.setMaxSelection(t+i)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){let i=this.els.cta;if(!i)return;if(this.salesClosed){i.disabled=!0,i.textContent=this.tf("picker.salesClosedCta","Sales closed");return}if(this.confirmSeat||this.tableDialog&&!this.tableDialogHeld){i.disabled=!0,i.textContent=this.tableDialog?this.tf("picker.confirmYourTable","Confirm your table"):this.tf("picker.confirmOrCancelSeat","Confirm or cancel this seat");return}if(this.ctaPhase==="holding"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(this.ctaPhase==="checkout"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let n=!this.hold&&this.performanceGroup?.selectionMode==="per_performance"?this.performanceGroup.submissionState?.():null;if(n&&!n.ready){i.disabled=!0,i.textContent=this.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(n.complete)).replace("{total}",String(n.total));return}let s=this.controller.getSelectionValidity(e);if(s&&!s.isValid){i.disabled=!0,i.textContent=hr(s,(o,a)=>this.tf(o,a),!0);return}i.disabled=e===0,i.textContent=this.hold?t?(0,C.t)("picker.secureMoreAndCheckout",{count:t}):this.tf("picker.continueToCheckout","Continue to checkout"):e?this.performanceGroup?this.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(this.performanceGroup.performanceCount)):this.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):this.tf("picker.selectSeats","Select seats")}setCtaPhase(e){this.ctaPhase=e,this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount()),e==="checkout"&&this.scheduleMotion(()=>{this.ctaPhase==="checkout"&&(this.ctaPhase="idle",this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount()))},1100)}holdStorageKey(){return`@seatlayer/hold/v1/${encodeURIComponent(this.apiBase)}/${encodeURIComponent(this.opts.event)}`}rememberedHoldId(){if(this.opts.initialHoldId)return this.opts.initialHoldId;if(this.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(this.holdStorageKey())}catch{return null}}rememberHold(e){if(!(this.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(this.holdStorageKey(),e.holdId)}catch{}}forgetHold(){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(this.holdStorageKey())}catch{}}async resumeHoldFromServer(e,t){try{let i=await this.controller.resumeHold(e);if(!i||this.destroyed)return null;let n={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return this.hold=n,this.handedOff=!0,this.bookedShown=!1,this.ctaPhase="idle",this.startHoldTimer(n.expiresAt),this.rememberHold(n),this.syncTray(),this.emitHoldChange(),this.opts.onHoldRestored?.(n,n.seats??[],this.buildHandoff(n)),t&&this.toast(this.tf("picker.heldTicketsRestored","Your held tickets have been restored."),"success"),n}catch(i){let n=i?.status;return n===404||n===409?this.forgetHold():this.opts.onError?.(i),null}}async restoreRememberedHold(){let e=this.rememberedHoldId();e&&await this.resumeHoldFromServer(e,!0)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let i=this.controller.getActiveFloorId();return(t.find(n=>n.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){this.els.map&&(this.minimap=es({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label},this.regions["bottom-left"]??this.els.map))}catPrice(e){return xi(this,e)}catPriceRange(e){return wi(this,e)}buildPriceFilter(){if(this.suppressPricing||!this.els.prices||!this.els.pricesSec)return;let e=Tn(this.controller.doc?.categories??[],this.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",this.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let i=document.createElement("option");i.value="all",i.textContent=this.tf("picker.allPrices","All prices"),t.appendChild(i);for(let n of e){let s=document.createElement("option");s.value=n.id,s.textContent=n.label,t.appendChild(s)}this.els.pricesSec.appendChild(t),t.addEventListener("change",()=>{let s=e.find(o=>o.id===t.value)?.keys??null;this.focusedCatKey=null,this.priceBandKeys=s?new Set(s):null,this.controller.setCategoryFilter(s),this.controller.focusCategoryFilter(s),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)})}buildArenaChrome(){let e=this.controller.doc;if(!e||!this.els.map)return;let t=e.objects.some(i=>i.type==="section")||(e.floors??[]).some(i=>i.objects.some(n=>n.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.innerHTML=`<button type="button" data-view="map" aria-pressed="true" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,i.querySelectorAll("button").forEach(n=>{if(n.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])n.addEventListener(s,Ki,{once:!0});n.addEventListener("click",()=>{this.setBuyerView(n.dataset.view)})}),this.regions["top-right"].appendChild(i),this.projectionEl=i,this.syncProjection()}if(t){let i=[...e.objects,...(e.floors??[]).flatMap(d=>d.objects)],n=new Set((e.zones??[]).map(d=>d.id)),o=i.some(d=>d.type==="section"&&typeof d.zone=="string"&&n.has(d.zone))?["zones","sections","seats"]:["sections","seats"],a=document.createElement("div");a.className="sl-rungs on sl-mo-indicator",a.setAttribute("role","group"),a.setAttribute("aria-label",(0,C.t)("picker.zoomLevel"));let l={zones:(0,C.t)("picker.rungLabel.zones"),sections:(0,C.t)("picker.rungLabel.sections"),seats:(0,C.t)("picker.rungLabel.seats")},c={zones:(0,C.t)("picker.rungTip.zones"),sections:(0,C.t)("picker.rungTip.sections"),seats:(0,C.t)("picker.rungTip.seats")};a.innerHTML=o.map(d=>`<button type="button" data-rung="${d}" title="${c[d]}" aria-pressed="false">${l[d]}</button>`).join(""),a.querySelectorAll("button").forEach(d=>{d.addEventListener("click",()=>{let h=d.dataset.rung;this.controller.setRung(h),h==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(a),this.rungsEl=a,this.syncRung()}if(this.controller.isMultiFloor()){let i=Xn({floors:this.controller.getFloors(),tf:(n,s)=>this.tf(n,s),onChoose:n=>{n===""?this.controller.setFloorOverview(!0):this.controller.setFloor(n),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});this.regions["left-rail"].appendChild(i),this.floorsEl=i,this.syncFloors()}}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(i=>{let n=i.dataset.rung===e;i.classList.toggle("on",n),i.setAttribute("aria-pressed",String(n))})}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?this.tf("picker.priceHint3d","Colours in the venue are ticket types \u2014 choose one below to show just those seats."):this.tf("picker.priceHint","Colours on the map are ticket types \u2014 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||!Zt()?!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)?lo/2:lo}syncFloors(){Zn(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new gi({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),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()}fitSectionStripCount(){this.sectionCard.fitStripCount()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(n=>n.type==="section"&&!this.controller.isSectionClosed(n.id)&&this.controller.getSectionSeatCount(n.id)>0);if(t.length<2)return null;let i=t.findIndex(n=>n.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}markedSeatAnnouncement(e){let t=br(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return Us(t,e.displayLabel??e.label,this.opts.locale)}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),n=this.controller.getStatus(e.id)??"free",s=n==="free"?this.tf("picker.statusAvailable","available"):n==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),o=i?this.catPriceRange(i):void 0,a=o?o.min===o.max?this.money(o.min):`${this.money(o.min)}\u2013${this.money(o.max)}`:void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=dt(c),h=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,p=l?`${d} ${h}, ${l.bookingMode==="variable"?(0,C.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,C.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${h}`:c?.objectType==="table"?`${d} ${h}, ${(0,C.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,C.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${p}, ${i?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let n=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),s=e.bookingMode==="variable",o=document.createElement("div");o.className="sl-table-scrim",o.innerHTML=Wn(e,{variable:s,held:t,typeWord:dt(e),categoryLabel:n?.label??e.categoryKey,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(o),this.tableDialogEl=o,this.renderTableDialogState(),o.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()})}),o.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),o.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),o.addEventListener("mousedown",a=>{a.target===o&&this.cancelTableDialog()}),o.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...o.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(()=>o.querySelector(s?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let i=t.querySelector("output[data-table-qty]");i&&(i.value=String(e.quantity));let n=t.querySelector("input[data-table-qty]");n&&(n.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let s=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),o=t.querySelector("[data-table-total]");o&&(o.textContent=this.money(s*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let i=this.tableDialogEl?.querySelector(".sl-table-confirm");if(i&&(i.disabled=!0,i.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let n=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!n){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:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items},this.startHoldTimer(n.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,C.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(n){this.opts.onError?.(n),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())}showConfirm(e){let t=this.confirmSeat?.id;this.confirmEl?.remove(),this.confirmEl=null,this.confirmSeat=e,this.root?.setAttribute("data-confirming","true"),this.els.side?.toggleAttribute("inert",!0),Object.values(this.regions).forEach(y=>y.toggleAttribute("inert",!0)),this.controller.setSelectionFocus(e.id),t&&t!==e.id&&this.controller.deselect([t]),this.tipEl&&(this.tipEl.style.display="none");let i=this.controller.seatDetails(e.id),n=this.controller.doc?.categories.find(y=>y.key===e.categoryKey),s=i?.price??(n?.tiers?.length?n.tiers[0].price:n?.price),o=s!=null?this.paidPrice(e.categoryKey,i?.tierId??n?.tiers?.[0]?.id??null,s,e.label):void 0,a=Fn(i,e.displayLabel??e.label,dt(i)),l=i?.tiers??n?.tiers??[],c=i?.tierId??l[0]?.id,d=Gn(l,c,y=>this.money(this.paidPrice(e.categoryKey,y.id,y.price,e.label))),h=this.buyerView==="venue3d",p=this.performanceGroup?.confirmDateSelection??void 0,u=p?this.performanceGroup?.nights?.()??[]:[],b=p?Ns(u,p,e.id,(y,T)=>this.tf(y,T)):"",m=document.createElement("div");m.className="sl-confirm sl-mo-in",b&&m.classList.add("sl-confirm-group-dates"),m.setAttribute("role","dialog"),m.setAttribute("aria-label",(0,C.t)("picker.confirmSeatLabel",{label:e.label}));let v=n?.color??"#6e7bff",x=Ui(v,this.cssVar("--sl-surface")||"#1a2234",.76)??v;m.style.setProperty("--sl-cat",v),m.style.setProperty("--sl-cat-ink",Me(x,"#172033","#ffffff"));let S=String(i?.categoryLabel??n?.label??e.categoryKey);m.innerHTML=qn({identityFields:a,identity:Nn(i,e.displayLabel??e.label,dt(i)),marker:fi(i?.wheelchairSpaceType),see3dPill:jn(this.canOffer3d(),h),categoryColor:n?.color??"#6e7bff",categoryLabel:S,priceLabel:o!=null?this.money(o):"",tierChoices:d,groupDates:b,wheelchair:Bn(i?.wheelchairSpaceType),commercial:Dn(e.commercial),thumb:this.seatViewEnabled()&&this.buyerView!=="venue3d"?this.confirmThumbHtml(e):"",inspect:h?`${Vn(e,`${i?.displayLabel??e.displayLabel??e.label} \xB7 ${o==null?this.tf("picker.priceNotSupplied","Price not supplied"):this.money(o)}`,h)}<div class="sl-confirm-inspect-row">${zn(e,h?this.view3dCompareSeatIds:null)}${tr(this.canOffer3d(),h)}</div>`:tr(this.canOffer3d(),h),cancelLabel:(0,C.t)("common.cancel"),selectLabel:this.tf("picker.select","Select")}),this.els.map.appendChild(m),this.confirmEl=m;let A=m.querySelector(".sl-confirm-thumb"),f=A?.closest(".sl-confirm-thumbwrap")??null;if(A&&f){let y=!1,T=()=>{if(y||!f.isConnected)return;y=!0;let R=()=>{f.remove(),this.confirmEl===m&&this.reanchorConfirm()};if(this.reducedMotion()||typeof requestAnimationFrame!="function"){R();return}f.style.height=`${f.offsetHeight}px`,f.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{f.style.height="0px",f.style.opacity="0"}),setTimeout(R,yl)};A.addEventListener("error",T),A.addEventListener("load",()=>{A.naturalWidth||T()});let M=e.viewMeta?.previewUrl??e.viewUrl;M?this.buyerAssetUrls.resolve(M).then(R=>{if(!(!m.isConnected||this.confirmEl!==m)){if(!R){T();return}A.src=R}}).catch(R=>{T(),this.opts.onError?.(R)}):T()}this.reanchorConfirm(),m.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{this.openSeatView(e)}),m.querySelector(".sl-confirm-confidence")?.addEventListener("click",y=>{this.openSeatConfidencePassport(e,y.currentTarget instanceof HTMLElement?y.currentTarget:null)}),m.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>this.saveView3dComparisonSeat(e)),m.querySelectorAll("[data-confirm-tier]").forEach(y=>{y.addEventListener("click",()=>{let T=y.dataset.confirmTier,M=l.find(E=>E.id===T);if(!M)return;this.controller.setSeatTier(e.id,M.id),m.querySelectorAll("[data-confirm-tier]").forEach(E=>{E.setAttribute("aria-pressed",String(E===y))});let R=m.querySelector(".sl-confirm-price");R&&(R.textContent=this.money(this.paidPrice(e.categoryKey,M.id,M.price,e.label))),this.reanchorConfirm()})}),m.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill").forEach(y=>{y.addEventListener("pointerdown",Ki,{once:!0}),y.addEventListener("click",()=>{this.buyerView==="venue3d"?(this.dismissConfirm(),this.view3dHandle?.flyToSeat(e.id)):(this.view3dReturnSeat=e,this.dismissConfirm(),this.enter3d(e.id))})}),Gs(m,p,(y,T)=>this.tf(y,T),()=>this.reanchorConfirm()),m.querySelector(".sl-confirm-add").addEventListener("click",()=>{this.commitConfirm()}),m.querySelector(".sl-confirm-cancel").addEventListener("click",()=>this.cancelConfirm()),requestAnimationFrame(()=>m.querySelector(".sl-confirm-add")?.focus())}reanchorConfirm(){if(!this.confirmEl||!this.confirmSeat||this.root?.dataset.view3d==="on")return;let e=this.controller.worldToScreen({x:this.confirmSeat.x,y:this.confirmSeat.y});if(this.root?.dataset.layout==="narrow"){Rr(this.confirmEl,e,this.els.map);return}let t=this.els.map.clientWidth,i=this.els.map.clientHeight,n=this.confirmEl.offsetWidth||276,s=this.confirmEl.offsetHeight||230,o=this.confirmEl.classList.contains("sl-confirm-group-dates"),a=io(e,{width:t,height:i},{width:n,height:s},o);this.confirmEl.dataset.placement=a.placement,this.confirmEl.style.left=`${a.left}px`,this.confirmEl.style.top=`${a.top}px`,Wt(this.confirmEl,e,{left:a.left,top:a.top,width:n,height:s})}dismissConfirm(){this.confirmEl&&Ee(this.confirmEl),this.confirmEl=null,this.confirmSeat=null,this.root?.removeAttribute("data-confirming"),Object.values(this.regions).forEach(e=>e.toggleAttribute("inert",!1)),this.applyPanelCollapsed(),this.controller.setSelectionFocus(null)}async commitConfirm(){let e=this.confirmSeat;e&&await Ks(this.confirmEl,e.id,this.performanceGroup?.confirmDateSelection??void 0)&&(this.confirmSeat&&this.dismissConfirm(),this.collapseSectionCard(),lr(this.els,this.controller.worldToScreen(e),e,this.controller.doc?.categories),this.syncTray(),this.syncSelectionTo3d())}cancelConfirm(){let e=this.confirmSeat;e&&(this.controller.deselect([e.id]),this.confirmSeat&&this.dismissConfirm(),this.syncSelectionTo3d(),this.root?.focus({preventScroll:!0}))}closeConfirm(){this.dismissConfirm()}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,n=this.controller.getActiveFloorId(),s=e.focalPoint??i?.floors?.find(h=>h.id===n)?.focalPoint??i?.focalPoint??{x:0,y:0},o,a,l=!1;if(e.viewUrl){let h,p=null;try{let b=e.viewMeta?.previewUrl;b&&b!==e.viewUrl?(p=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&&!p||!this.root||!this.seatViewEnabled())return;let u={url:h,...p?{previewUrl:p}:{},...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}:{}};o=u,a=(0,_t.seatViewDisclosure)(u),l=(0,_t.isAuthoredSeatView)(u)}else{let h;try{let{generateSeatPanorama:p}=await Jt();h=p(e,s,this.allSeats())}catch(p){t===this.seatViewGen&&this.opts.onError?.(p);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;o={url:h.url,generated:!0},a=(0,C.t)("picker.illustrationCaption",{m:h.distanceM})}this.closeSeatView(!1);let c=(0,C.t)("picker.viewFromSeat",{label:e.label}),d=ri({root:this.root,source:o,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:this.tf("picker.dragToLookAround","Drag to look around \xB7 scroll to zoom"),viewFromSeatLabel:c,real360Label:(0,C.t)("picker.real360"),previewLabel:(0,C.t)("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}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let i=Number.isInteger(e);return(0,C.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(n,s)=>`${n} ${s}`,...i?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),i=Pn(e,t);if(i==null)return;let n=6*36e5,s=Math.min(Math.max(i-t+1e3,1e3),n);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},s)}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}async refreshOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;let i=ui(t);if(!i)return;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i);let n=mi(i),s={...this.hostPricing?.prices??{},...n},o=Object.keys(s).length>0||this.hostPricing?.formatter?{prices:s,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(o),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){return e?this.offerAvailability?.prices.find(t=>t.categoryKey===e)??null:null}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;let t=this.offerAvailability,i=t?.release??null,n=i?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!n){e.classList.remove("has"),e.replaceChildren();return}let s=i??n,o=document.createElement("div");o.className="sl-offer-main";let a=document.createElement("div");a.className="sl-offer-copy";let l=document.createElement("span");l.className="sl-offer-kicker",l.textContent=i?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let c=document.createElement("strong");c.className="sl-offer-name",c.textContent=s.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let d=document.createElement("span");d.className="sl-offer-line";let h=[];i&&t.fromPrice!=null&&h.push(this.money(t.fromPrice/100)),i&&s.remaining!=null&&h.push((0,C.t)("picker.offerRemainingAvailable",{count:s.remaining})),i&&s.endsAt!=null&&h.push((0,C.t)("picker.offerUntil",{time:ei(s.endsAt,this.eventTimezone,this.opts.locale)})),n?.startsAt!=null&&h.push((0,C.t)("picker.offerStarts",{time:ei(n.startsAt,this.eventTimezone,this.opts.locale)})),d.textContent=h.join(" \xB7 "),a.append(l,c,d);let p=document.createElement("details");p.className="sl-offer-info";let u=document.createElement("summary");u.setAttribute("aria-label",(0,C.t)("picker.howOfferWorks",{name:c.textContent??""})),u.textContent="i";let b=document.createElement("div");b.className="sl-offer-detail",b.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."),p.append(u,b),o.append(a,p),e.replaceChildren(o),e.classList.add("has")}paidPrice(e,t,i,n){let s=n?this.channelByObject.get(n):void 0;if(s&&e){let a=this.pricesByChannel.get(s)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let o=e?this.opts.pricing?.prices?.[e]:void 0;return o===void 0?i:typeof o=="number"?o:t&&o.tiers?.[t]!==void 0?o.tiers[t]:o.base??i}legendDeps(){return{colorOf:e=>this.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>this.catPriceRange(e),priceOf:e=>this.catPrice(e),offerOf:e=>this.offerPrice(e),money:e=>this.money(e),esc:O}}syncPriceRail(e,t,i=this.legendDeps()){let n=this.els.railScroll,s=e.length>1;this.els.rail?.classList.toggle("has",s),n&&(n.innerHTML=s?Sn({...i,categories:e,left:t,activeKey:this.focusedCatKey,soldOutWord:this.tf("picker.soldOut","Sold out")}):"",n.querySelectorAll(".sl-rc").forEach(o=>{o.addEventListener("click",()=>this.focusCategory(o.dataset.cat??""))}),this.railEdgesBound||(this.railEdgesBound=!0,n.addEventListener("scroll",()=>Zi(n),{passive:!0})),requestAnimationFrame(()=>Zi(n)))}syncPrices(){let e=this.controller.doc;if(!e||!this.els.prices)return;let t=this.controller.categoryAvailability(),i=e.categories.filter(h=>!h.notForSale);this.narrateAvailability(i,t),this.syncSoldout(i,t);let n=this.legendDeps(),s=this.suppressPricing,o=s?{...n,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:n;s&&(this.els.pricesSec?.querySelector("span")?.replaceChildren(this.tf("picker.seatCategories","Seat categories")),this.els.pricesHint?.remove()),this.syncPriceRail(i,t,o);let a=5,l=i.length-a,c=l>1&&!this.pricesExpanded,d=c?i.slice(0,a):i;this.els.prices.classList.toggle("sl-expanded",l>1&&this.pricesExpanded),this.els.prices.innerHTML=kn({...o,categories:d,left:t,collapsed:c,activeKey:this.focusedCatKey,bandKeys:this.priceBandKeys,leftCount:h=>(0,C.tCount)("picker.leftCount",h),titleFor:(h,p)=>p?this.tf("picker.showAllSeats","Show all seats"):(0,C.t)("picker.showLabelSeatsOnMap",{label:h.label}),moreLabel:l>1?c?s?this.tf("picker.showAllCategories","Show all categories"):(0,C.t)("picker.showAllTicketTypes",{count:i.length}):this.tf("picker.showFewer","Show fewer"):null,status:{legend:this.tf("picker.seatStatusLegend","Seat status legend"),held:this.tf("picker.temporarilyHeld","Temporarily held"),sold:this.tf("picker.sold","Sold")}}),this.els.prices.querySelectorAll(".sl-price-row").forEach(h=>{h.addEventListener("mouseenter",()=>this.controller.getRenderer()?.setCategoryHighlight?.(h.dataset.cat??null)),h.addEventListener("mouseleave",()=>this.controller.getRenderer()?.setCategoryHighlight?.(null));let p=()=>this.focusCategory(h.dataset.cat??"");h.addEventListener("click",p),h.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),p())})}),this.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{this.pricesExpanded=!this.pricesExpanded,this.syncPrices()})}focusCategory(e){if(!e)return;let t=this.focusedCatKey===e?null:e;this.focusedCatKey=t,this.priceBandKeys=t?new Set([t]):null;let i=this.els.pricesSec?.querySelector(".sl-price-select");i&&(i.value="all"),this.controller.setCategoryFilter(t?[t]:null),this.controller.focusCategoryFilter(t?[t]:null),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)}narrateAvailability(e,t){let i=this.els.liveText,n=this.lastCatAvail;this.lastCatAvail={...t};let s=this.controller.getActiveFloorId();if(s!==this.lastAvailFloorId&&(this.lastAvailFloorId=s,this.availQuietUntil=performance.now()+2e3),!(!i||!n||performance.now()<this.availQuietUntil))for(let o of e){let a=n[o.key],l=t[o.key]??0;if(a===void 0||l>=a)continue;let c=a-l;i.textContent=(0,C.tCount)("picker.seatsJustTakenInCategory",c,{label:o.label,left:l}),this.els.live?.classList.remove("on"),this.els.live?.offsetWidth,this.els.live?.classList.add("on"),this.liveTimer&&clearTimeout(this.liveTimer),this.liveTimer=setTimeout(()=>this.els.live?.classList.remove("on"),8e3);return}}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(i=>!e.has(i.label)&&(this.controller.getStatus(i.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(i=>i.id)),this.toast((0,C.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:i,heldLabels:n,heldCount:s,total:o,count:a}=yi(this),l=[],c=new Set;if(!this.salesClosed){let f=this.performanceGroup?.nightSummary?.()??[];f.length&&l.push(Vs(f,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let y=this.performanceGroup?.selectionModeSwitch;y&&l.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${O(y.label)}</button>`)}l.push(Cs({salesClosed:this.salesClosed,hasPicks:e.length>0||i.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(f=>f.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0}));let d=!e.length&&!i.length&&!Ve(this.gaQty,this.hold?.items??[]);if(d&&(this.baReopen=!1),!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm)){let f=(this.controller.doc?.categories??[]).filter(T=>!T.notForSale),y=this.controller.getBestAvailableZones();this.baZone&&!y.some(T=>T.id===this.baZone)&&(this.baZone=""),l.push(Ts({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:this.baReopen,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:f,zones:y,selectedCategory:this.baCat,selectedZone:this.baZone}))}let h=(f,y,T,M=1,R,E)=>ws({d:f?this.controller.seatDetails(f):null,area:T==="ga"?t.find(V=>V.id===R):void 0,label:y,objectType:T,quantity:M,identity:E,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),p=O,u=[];for(let f of Vr(i)){let y=f.objectType==="ga"?`held:ga:${f.objectId}:${f.tierId??""}`:`held:${f.label}`;c.add(y);let T=this.controller.doc?.categories.find(N=>N.key===f.categoryKey),M=f.tierId?T?.tiers?.find(N=>N.id===f.tierId)?.name:void 0,R=f.objectType!=="ga"?this.controller.seatByLabel(f.label):null,E=f.objectType==="table"?this.controller.tableSelection(f.label):null,V=R?this.controller.seatDetails(R.id):null,he=this.seatViewEnabled()&&!!R&&f.objectType!=="table",le=p(this.tf("picker.heldForYou","Held for you")),re=(E?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${p(encodeURIComponent(f.label))}">${p((0,C.t)("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+fi(R?.wheelchairSpaceType)+er(R?.commercial),ne=this.paidPrice(f.categoryKey,f.tierId,f.unitPrice,f.label)*(f.quantity??1);u.push({key:y,fresh:!this.lastTrayKeys.has(y),held:!0,seatIds:[],heldLabels:f.labels,removeAria:(0,C.t)("picker.removeHeldTicketLabel",{label:zi(f,t)}),locateId:R?.id??null,section:V?.sectionLabel??"",rowLabel:V&&W(V)||"",seatLabel:V?.seatNumber??f.label,categoryLabel:`${T?.label??f.categoryKey}${M?` \xB7 ${M}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??T?.color??"",identityHtml:h(R?.id??null,f.label,f.objectType,f.quantity??1,f.objectId,E??void 0),stateHtml:`<span class="sl-ticket-state held" aria-label="${le}" title="${le}"><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:re,amount:ne,amountText:this.suppressPricing?"":this.money(ne),noteHtml:"",railHtml:this.performanceGroup?"":ur((0,C.t)("picker.removeHeldTicketLabel",{label:zi(f,t)}),he?f.label:null),groupable:!re&&!!V?.sectionLabel&&!this.performanceGroup})}let b=this.seatViewEnabled();for(let f of e.filter(y=>!n.has(y.label))){let y=`seat:${f.id}`;c.add(y);let T=this.controller.doc?.categories.find(N=>N.key===f.categoryKey),M=f.tiers&&f.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${p(f.id)}" aria-label="${p((0,C.t)("picker.ticketTierFor",{label:f.label}))}">`+f.tiers.map(N=>`<option value="${p(N.id)}"${N.id===f.tierId?" selected":""}>${p(N.name)} \xB7 ${p(this.money(this.paidPrice(f.categoryKey,N.id,N.price,f.label)))}</option>`).join("")+"</select>":"",R=f.tiers?.find(N=>N.id===f.tierId)??f.tiers?.[0],E=R?.buyerMessage?.trim()||(R?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),V=this.controller.seatDetails(f.id),he=p(this.tf("picker.selected","Selected")),le=(0,C.t)("picker.removeSeatLabel",{label:f.label}),re=(f.objectType==="table"&&f.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${p(encodeURIComponent(f.label))}">${p((0,C.t)("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+fi(f.wheelchairSpaceType)+er(f.commercial)+M,ne=this.paidPrice(f.categoryKey,f.tierId??null,f.price,f.label)*(f.quantity??1);u.push({key:y,fresh:!this.lastTrayKeys.has(y),held:!1,seatIds:[f.id],heldLabels:[],locateId:f.id,section:V?.sectionLabel??"",rowLabel:V&&W(V)||"",seatLabel:V?.seatNumber??f.label,categoryLabel:T?.label??f.categoryKey,identityHtml:h(f.id,f.label,f.objectType,f.quantity??1,f.objectId,f),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??T?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${he}" title="${he}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:re,amount:ne,amountText:this.suppressPricing?"":this.money(ne),removeAria:le,noteHtml:E?`<small class="sl-tier-note">${p(E)}</small>`:"",railHtml:ur(le,b&&f.objectType!=="table"?f.label:null),groupable:!re&&!E&&!!V?.sectionLabel&&!this.performanceGroup})}u.length&&l.push(this.root?.dataset.layout==="narrow"?Hs(u,{money:f=>this.money(f),suppressPricing:this.suppressPricing}):u.map(Ls).join("")),t.length&&l.push(Kr(this,t,i)),!this.performanceGroup&&!this.salesClosed&&!this.hold&&!d&&!this.baReopen&&!this.bestAvailableBusy&&!this.bestAvailableConfirm&&l.push(`<button type="button" class="sl-ba-reopen" data-ba-reopen><span aria-hidden="true">\u2726</span>${p(this.tf("picker.findTogetherInstead","Find seats together instead"))}</button>`),this.els.tray.innerHTML=l.join(""),this.lastTrayKeys=c,Rs(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let m=this.performanceGroup?.selectNight;m&&Xs(this.els.tray,f=>m(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.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-reopen]")?.addEventListener("click",()=>{this.baReopen=!0,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-close]")?.addEventListener("click",()=>{this.baReopen=!1,this.syncTray(),this.els.tray.querySelector("[data-ba-reopen]")?.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 y=f.closest(".sl-chip");if(y.dataset.held){this.removeHeldLabels(decodeURIComponent(y.dataset.held).split(`
|
|
2237
|
-
`),y);return}let T=y.dataset.seat.split(" "),M=this.controller.getSelection().find(E=>E.id===T[0])?.label??this.tf("picker.seat","Seat"),R=()=>{this.controller.deselect(T),this.toast((0,C.t)("picker.labelRemoved",{label:M}),"neutral",{label:this.tf("picker.undo","Undo"),onClick:()=>{let E=this.controller.select(T);this.toast(E.length?(0,C.t)("picker.labelRestored",{label:M}):(0,C.t)("picker.labelNoLongerAvailable",{label:M}),E.length?"success":"warning")}})};if(this.reducedMotion()){R();return}y.classList.remove("sl-enter"),y.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(R,U.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(f=>{f.addEventListener("click",y=>{y.stopPropagation();let T=decodeURIComponent(f.dataset.tableEdit??""),M=this.controller.tableSelection(T);if(!M)return;let R=i.find(E=>E.label===T&&E.objectType==="table");this.showTableDialog({...M,quantity:R?.quantity??M.quantity},!!R,f)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(f=>{f.addEventListener("change",()=>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 y=this.controller.seatByLabel(f.dataset.viewLabel);y&&this.openSeatView(y)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(f=>{let y=()=>this.controller.flashSeat(f.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");f.addEventListener("mouseenter",y),f.addEventListener("focusin",y)}),Ur(this,this.els.tray,t),this.controller.setGASelection(Br(this.gaQty)),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(f=>{f.disabled=!0});let v=this.pendingSelectionCount(),x=this.lastTrayCount,S=this.lastTrayTotal,A=Qs(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");if(this.els.count.textContent=A||(a?(0,C.tCount)("picker.ticketsCount",a):this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=a&&!this.suppressPricing?this.money(o):"",this.root?.setAttribute("data-has-selection",String(a>0)),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy||this.baReopen)),this.els.foot?.classList.toggle("empty",a===0),this.els.seatSummary&&(this.els.seatSummary.textContent=A||(a?(0,C.tCount)("picker.seatsSelectedCount",a):"")),this.syncCta(a,v),this.hold){this.holdCopyPending=v>0;let f=Es({secured:s||this.hold.seats?.length||0,pendingCount:v,expiresAt:this.holdExpiresAt,releasing:this.releasingHold});this.els.holdTitle&&(this.els.holdTitle.textContent=f.title),this.els.holdCopy&&(this.els.holdCopy.textContent=f.copy);let y=this.els.holdChange;y&&(y.disabled=this.releasingHold,y.textContent=f.change)}a!==x&&this.animateOnce(this.els.count,"sl-value-pop",380),o!==S&&this.animateOnce(this.els.total,"sl-value-pop",380),x===0&&a>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.renderPeek(a,o,v,a>x),this.lastTrayCount=a,this.lastTrayTotal=o,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(a,e)}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)}renderPeek(e,t,i,n=!1){if(!this.els.peek)return;let s=(this.controller.doc?.categories??[]).map(o=>this.catPrice(o)).filter(o=>o!=null);this.els.peek.innerHTML=Ss({count:e,total:t,pendingCount:i,ctaPhase:this.ctaPhase,hasHold:!!this.hold,salesClosed:this.salesClosed,fromPrice:s.length?Math.min(...s):null,addMore:ks({salesClosed:this.salesClosed,hasHold:!!this.hold,ctaPhase:this.ctaPhase,formOpen:this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm,room:this.maxTickets-this.totalTicketCount(),wanted:this.baQty}),holdTime:this.hold&&this.holdTimer?Ot(Math.max(0,this.holdExpiresAt-Date.now())):null,money:o=>this.money(o)}),this.root&&(this.root.dataset.peekClock=String(!!this.els.peek.querySelector(".sl-peek-time"))),n&&this.animateOnce(this.els.peek.querySelector(".sl-peek-sum")??void 0,"sl-peek-bump",240)}async removeHeldLabels(e,t){let i=e.filter(o=>o&&!this.releasingLabels.has(o));if(!i.length)return!1;let n=i[0];i.forEach(o=>this.releasingLabels.add(o)),t?.setAttribute("aria-busy","true");let s=t?.querySelector(".rm");s&&(s.disabled=!0);try{let o=this.handedOff;if(!await this.controller.releaseLabels(i))return this.toast((0,C.t)("picker.couldNotRemoveLabel",{label:n}),"error"),!1;Fr(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&&o,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),this.toast((0,C.t)("picker.labelRemovedFromHold",{label:n}),"success"),!0}finally{i.forEach(o=>this.releasingLabels.delete(o)),t?.removeAttribute("aria-busy"),s?.isConnected&&(s.disabled=!1)}}async handleChangeSeats(){if(!this.hold||this.releasingHold)return;this.releasingHold=!0;let e=this.els.holdChange;e&&(e.disabled=!0,e.textContent=this.tf("picker.releasingEllipsis","Releasing\u2026"));try{await this.release(),this.hold||this.toast(this.tf("picker.heldTicketsReleased","Held tickets released. Choose your new seats."),"success")}finally{this.releasingHold=!1,e?.isConnected&&(e.disabled=!1,e.textContent=this.tf("picker.change","Change"))}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(hr(e,(i,n)=>this.tf(i,n)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast((0,C.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(i=>!(this.hold.items??[]).some(n=>n.label===i.label))){let i=this.hold.seats??t;this.handedOff=!0,this.setCtaPhase("checkout"),this.checkoutHandoff(this.hold,i);return}this.holdingLabels=new Set(t.map(i=>i.label)),this.setCtaPhase("holding");try{let i=null,n=Dr(this.gaQty),s=this.committedSelection();if(s.length){let o=await this.controller.hold(void 0,this.opts.holdTtlMs);i=o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}for(let{areaId:o,tierId:a,qty:l}of n){let c=await this.controller.holdGA(o,l,{tierId:a,ttlMs:this.opts.holdTtlMs});i=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:i}if(!i){this.toast(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again."),"error"),this.setCtaPhase("idle"),this.syncTray();return}this.hold=i,this.handedOff=!this.performanceGroup,this.startHoldTimer(i.expiresAt),this.flashHeldSeats(i),this.setCtaPhase(this.performanceGroup?"idle":"checkout"),this.emitHoldChange(),this.performanceGroup||this.checkoutHandoff(i,i.seats??s)}catch(i){this.opts.onError?.(i);let n=i,s=(n.conflicts??[]).map(a=>a.label).filter(Boolean).slice(0,3);n.reason==="event_closed"&&this.setSalesClosed(!0);let o=n.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):n.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):n.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s.length?s.length===1?(0,C.t)("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):(0,C.t)("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.toast(o,"error"),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){this.stopHoldTimer(),this.holdExpiresAt=e,this.hold&&this.rememberHold(this.hold);let t=this.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${this.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let i=t.querySelector('[data-ref="holdTime"]');this.els.holdNote?.classList.add("on");let n=()=>{let s=Math.max(0,this.holdExpiresAt-Date.now());i&&(i.textContent=Ot(s));let o=this.els.peek?.querySelector(".sl-peek-time");o&&(o.textContent=Ot(s)),!this.holdCopyPending&&this.els.holdCopy&&this.root?.dataset.layout!=="narrow"&&(this.els.holdCopy.textContent=mr(this.holdExpiresAt)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=ao),this.setExtendPrompt(s>0&&s<=ao,s),s<=0&&this.stopHoldTimer()};n(),this.holdTimer=setInterval(n,500)}stopHoldTimer(){this.holdTimer&&clearInterval(this.holdTimer),this.holdTimer=null,this.els.hold?.classList.remove("on","is-expiring"),this.els.holdNote?.classList.remove("on"),this.root&&delete this.root.dataset.peekClock,this.setExtendPrompt(!1,0)}setExtendPrompt(e,t){if(this.extendEl)if(e&&this.controller.currentHold()&&!this.bookedShown){let i=Math.ceil(t/1e3),n=Math.floor(i/60),s=String(i%60).padStart(2,"0");this.els.extendTxt.innerHTML=(0,C.t)("picker.seatsHeldForNeedMoreTime",{time:`${n}:${s}`}),this.extendEl.classList.add("on")}else this.extendEl.classList.remove("on")}async handleExtend(){let e=this.els.extendBtn;e.disabled=!0;let t=e.textContent;e.textContent=this.tf("picker.addingEllipsis","Adding\u2026");try{let i=await this.controller.extendHold(this.opts.holdTtlMs);i?(this.hold={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items},this.holdExpiresAt=i.expiresAt,this.extendEl?.classList.remove("on"),this.rememberHold(this.hold),this.emitHoldChange(),this.toast(this.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")):this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=t}}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&this.showBooked()}showBooked(){if(this.bookedShown||!this.hold)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((n,s)=>n+s.quantity,0),i=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=i?.seats?`<span class="sl-booked-seats">${(0,C.tCount)("picker.group.ticketsConfirmedAcross",i.seats,{performances:i.performances})}</span>`:`<span class="sl-booked-seats">${(0,C.tCount)("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.bookedEl?.classList.add("on"),this.opts.onBooked?.(e)}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()}checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){this.startHostedCheckout(e,t);return}this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let i=this.buildHandoff(e),n=null;try{n=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(o){this.opts.onError?.(o)}if(this.destroyed)return;let s=n?.providers?.[0];if(!s){let o=ln(n?.reason),a=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:o,handoff:i}),this.opts.onCheckout?.(e,t,i),a||this.openCheckoutPanel({kind:"unavailable",reason:o,seatCount:i.lineItems.reduce((l,c)=>l+c.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:s,order:{holdId:i.holdId,expiresAt:i.expiresAt,currency:i.currency,total:i.total,labels:i.lineItems.map(o=>o.displayLabel??o.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await an())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 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,formatMoney:i=>this.money(i),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=>this.opts.onError?.(i)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let i=(e.items??[]).map(o=>{let a=this.controller.lineItemDisplay(o);return{label:o.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},objectId:o.objectId,objectType:o.objectType,categoryKey:o.categoryKey,tierId:o.tierId,unitPrice:this.paidPrice(o.categoryKey,o.tierId,o.unitPrice,o.label),currency:o.currency??this.currency,quantity:o.quantity??1}}),n=i[0]?.currency??this.currency,s=i.reduce((o,a)=>o+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:n,lineItems:i,total:s}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",i){let n=this.els.toast;if(!n)return;n.replaceChildren();let s=document.createElement("span");if(s.textContent=e,n.appendChild(s),n.classList.toggle("has-action",!!i),i){let o=document.createElement("button");o.type="button",o.className="sl-toast-action",o.textContent=i.label,o.addEventListener("click",i.onClick,{once:!0}),n.appendChild(o)}n.dataset.tone=t,n.classList.add("on","sl-mo-rise"),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{n.classList.remove("on","sl-mo-rise"),n.classList.remove("has-action"),n.dataset.tone="neutral"},4200)}dismissSkeleton(){os({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?to(this.tipPos,e,t):null,n=i??eo(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${n.left}px`,this.tipEl.style.top=`${n.top}px`,i?this.tipEl.dataset.placement=i.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let i=this.performanceGroup,n=br(e.mark,i?.nights?.()),s=n?.states.filter(o=>o.free).length??0;return Fs(n,{locale:this.opts.locale,switchLabel:i?.selectionModeSwitch?.label??null,selectPartialLabel:i?.partialSeatSelection?.label(s)??null,pinned:t})}unavailableReason(e){return!e.unavailable||e.mark?.kind==="partial"?"":e.status==="held"?this.tf("picker.heldByOther","Held by another buyer \u2014 may become available"):e.status==="not_for_sale"?this.tf("picker.notForSaleExplanation","This seat is not included in the current sale."):e.status==="free"?"":this.tf("picker.soldSeatExplanation","This seat has already been booked.")}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()}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.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}let i=this.unavailableReason(e),n=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t)||!!i&&e.interaction==="press";this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let s=this.nightStripFor(e,n);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=Js(e,{price:this.suppressPricing?"":this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label)),priceNote:this.suppressPricing?this.tf("picker.group.pricesPerPerformance","Prices shown per performance"):"",rowTypeWord:dt(e),reason:i,extra:s+(n?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${O(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=n,this.tipEl.classList.toggle("sl-tip-pinned",n),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),ro(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,o=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,o)}),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[n,s]of Object.entries(e())){let o=this.controller.idForLabel(n);o&&(i[o]=s)}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(n=>t.has(n.id)||t.has(n.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,!1)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=Ct(this.themeMode),i=Et(this.controller.doc?.theme,this.opts.theme,t);for(let[n,s]of Object.entries(i))e.style.setProperty(n,s);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=di(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(ot(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:Ct(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Ct(this.themeMode),i=Et(this.controller.doc?.theme,this.opts.theme,t),n=ot(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,s=mn(i,n);for(let o of["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text"])s?e.style.setProperty(o,s[o]):e.style.removeProperty(o)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),i=JSON.stringify(e??null);t!==i&&(this.opts.pricing=e,!(this.destroyed||!this.els.prices)&&(this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=Rn(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=(0,C.getLocale)(),i=this.localeGeneration+=1,n=await(0,C.loadLocale)(e);return this.opts.messages&&(0,C.setStringOverrides)(this.opts.messages),n===t||this.applyActiveLocale(n,i),n}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&On(e,{root:this.root,painters:[()=>this.syncTray(),()=>this.syncPrices(),()=>this.syncOffer(),()=>this.syncRung(),()=>this.syncFloors(),()=>this.syncPanelToggle(),()=>this.syncFullscreenButtons()],refreshMapCopy:()=>this.controller.refreshMapCopy(),languageSelect:this.langSel})}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(),wl(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"}getBuyerView(){return this.buyerView}setBuyerView(e,t){if(e==="map"){this.exit3d();return}let i=t?.flyToSeatId;if(this.buyerView==="venue3d"){i?(this.opts.onBuyerViewChange?.({view:"venue3d",seatId:i}),this.view3dHandle?.flyToSeat(i)):t?.resetView&&this.view3dHandle?.focusOverview();return}this.enter3d(i)}seatState3dFor(e){switch(this.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return this.priceBandKeys!=null&&!this.priceBandKeys.has(e.categoryKey)||this.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}pushAvailabilityTo3d(){if(!this.view3dHandle)return;let e=this.allSeats().map(t=>({seatId:t.id,state:this.seatState3dFor(t)}));this.view3dHandle.setAvailability(e)}syncSelectionTo3d(){this.view3dHandle&&this.view3dHandle.setSelection(this.controller.getSelection().map(e=>e.id))}async seatViewFor3d(e){let t=this.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,n=!!i&&i!==t.viewUrl,s=n?await this.buyerAssetUrls.resolve(i):null,o=n?t.viewUrl:await this.buyerAssetUrls.resolve(t.viewUrl);return!o||n&&!s?null:{url:o,...s?{previewUrl:s}:{},...n?{resolveUrl:a=>this.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 this.opts.onError?.(i),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:this.tf("picker.chartDerivedModel","Chart-derived model")}}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,{...t,surface:"buyer"})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}onView3dSeatPick(e){if(this.salesClosed){this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),this.syncSelectionTo3d();return}let t=this.allSeats().find(a=>a.id===e);if(!t)return;let i=this.controller.tableSelection(e);if(this.committedSelection().some(a=>i?a.label===i.label:a.id===e)){this.controller.deselect([e]),this.dismissConfirm(),this.syncSelectionTo3d();return}let s=this.controller.getStatus(t.id);if(s==="held"||s==="booked"||s==="not_for_sale"){this.showUnavailable3dSeat(t,this.seatState3dFor(t),s),this.syncSelectionTo3d();return}if(this.dismissUnavailable3dSeat(),!this.controller.select([e]).length){this.syncSelectionTo3d(),this.dismissConfirm();return}if(this.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),this.flashPickedSeat(e),i){this.showTableDialog(i,!1),this.syncSelectionTo3d();return}this.opts.confirmSelection!==!1?this.showConfirm(t):this.syncTray(),this.syncSelectionTo3d()}seatViewCaption(e){let t=this.allSeats().find(i=>i.id===e);return ns(this.controller.seatDetails(e),t?.displayLabel??t?.label??e,this.tf("picker.viewFromYourSeat","view from your seat"),{narrow:this.root?.dataset.layout==="narrow",shortTail:this.tf("picker.fromYourSeat","from your seat")})}showUnavailable3dSeat(e,t,i){let n=this.view3dEl;if(!n)return;let s=this.controller.seatDetails(e.id),o=s?.displayLabel??e.displayLabel??e.label,a=W(s);ys(n,{status:i,visualState:t,location:[s?.sectionLabel,a?(0,C.t)("picker.rowLabel",{label:a}):null,o].filter(Boolean).join(" \xB7 ")||o,tf:(l,c)=>this.tf(l,c)}),this.announceSeat(e)}dismissUnavailable3dSeat(){pr(this.view3dEl)}saveView3dComparisonSeat(e){if(this.buyerView!=="venue3d")return;let t=this.view3dCompareSeatIds;t.includes(e.id)||(this.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),this.confirmSeat?.id===e.id&&(this.controller.deselect([e.id]),this.dismissConfirm(),this.syncSelectionTo3d(),this.syncTray()),this.view3dCompareChip.sync(),this.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:this.view3dCompareSeatIds.length}),this.view3dCompareSeatIds.length>1?this.openView3dComparison():this.toast(this.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}clearView3dComparison(){this.closeView3dComparison(!1),this.view3dCompareSeatIds=[],this.view3dCompareChip.remove(),this.emit3dAnalytics("3d_comparison_cleared")}view3dComparisonSnapshot(e){let t=this.allSeats().find(u=>u.id===e);if(!t)return null;let i=this.controller.seatDetails(t.id),n=this.controller.doc?.categories.find(u=>u.key===t.categoryKey),s=i?.price??(n?.tiers?.length?n.tiers[0].price:n?.price),o=s!=null?this.paidPrice(t.categoryKey,i?.tierId??n?.tiers?.[0]?.id??null,s,t.label):void 0,a=this.controller.getStatus(t.id),l=a==="held"?this.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?this.tf("picker.sold","Sold"):a==="not_for_sale"?this.tf("picker.notForSale","Not for sale"):this.tf("picker.available","Available"),c=t.viewUrl?(0,_t.seatViewDisclosure)({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):this.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=Le(t.commercial)||this.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),h=i?.wheelchairSpaceType?`${lt(i.wheelchairSpaceType)} \xB7 metadata, not access certification`:this.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),p=(0,co.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:W(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??n?.label??t.categoryKey,price:o==null?this.tf("picker.priceNotSupplied","Not supplied"):this.money(o),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:h,confidence:p}}openSeatConfidencePassport(e,t=null){dr(this,e,t)}closeSeatConfidencePassport(e=!0){Ht(this,e)}openView3dComparison(){vs(this)}closeView3dComparison(e=!0){Ne(this,e)}async enter3d(e){if(this.view3dEl||!this.canOffer3d()||!this.els.map)return;let t=this.controller.doc;if(!t)return;this.buyerView="venue3d",this.view3dTargetSeatId=null,this.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),this.root?.setAttribute("data-view3d","on"),this.dismissConfirm(),this.syncProjection(),this.syncTray();let i=document.createElement("div");i.className="sl-view3d sl-mo-zoom",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let n=document.createElement("button");n.type="button",n.className="sl-view3d-back",n.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${this.tf("picker.backToMap","Back to map")}</span>`;let s=n.querySelector("span"),o=c=>{this.view3dTargetSeatId=c;let d=!!c;i.classList.toggle("is-seat-focused",d);let h=d?this.tf("picker.backToVenue","Back to venue"):this.tf("picker.backToMap","Back to map");s&&(s.textContent=h),n.setAttribute("aria-label",h)};if(n.addEventListener("click",()=>{if(this.view3dTargetSeatId&&this.view3dHandle){this.view3dHandle.focusOverview();return}this.exit3d()}),i.appendChild(n),is(this.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6",c.setAttribute("aria-label",this.tf("picker.fullScreen","Full screen")),c.setAttribute("aria-pressed",String(!!document.fullscreenElement||this.fsFallback||this.framedFs)),c.addEventListener("click",()=>this.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=this.tf("picker.loading3d","Building the 3D venue\u2026"),i.appendChild(a),this.els.map.appendChild(i),this.view3dEl=i,this.view3dCompareChip.sync(),requestAnimationFrame(()=>{i.style.opacity="1"});let l=++this.view3dGen;try{let c=this.allSeats(),[d,h]=await Promise.all([Tt(),this.controller.loadEventConfiguration()]),p=h?await ti(h,S=>this.buyerAssetUrls.resolve(S)):null,u=t.theme?.venue3d?.shellAssetUrl,b=await ii(u,S=>this.buyerAssetUrls.resolve(S));if(l!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let m={doc:t,seats:c,...p?{eventConfigurationId:p.id,eventConfiguration:p}:{},...b?{registeredShellGlb:b}:{}};a.textContent=this.tf("picker.building3d","Building venue geometry\u2026");let v=await d.prepareVenue3D(m);if(l!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let x=d.mountVenue3D(i,{...m,prepared:v},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,seatViewActionLabel:S=>this.allSeats().find(A=>A.id===S)?.viewUrl?this.tf("picker.openAuthored360","Open venue 360\xB0"):this.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:S=>this.seatViewCaption(S),onSeatViewStopChange:S=>this.view3dSeatViewChrome?.onStopChange(S),onSeatPick:S=>this.onView3dSeatPick(S),onSeatInspect:S=>this.onView3dSeatPick(S),onSectionFocusChange:S=>{let A=i.querySelector('select[data-locator="section"]'),f=S??"";!A||A.value===f||(A.value=f,A.dispatchEvent(new Event("change")))},onViewTargetChange:S=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!S),o(S),this.opts.onBuyerViewChange?.({view:"venue3d",...S?{seatId:S}:{}})},...this.seatViewEnabled()?{getSeatView:S=>new Promise((A,f)=>{let y=()=>{this.seatViewFor3d(S).then(M=>{M?A(M):f(new Error("seat_view_unavailable"))})},T=globalThis.requestIdleCallback;typeof T=="function"?T(y,{timeout:1500}):setTimeout(y,50)})}:{},onAnalytics:(S,A)=>this.emit3dAnalytics(S,A)});this.view3dHandle=x,this.view3dSeatViewChrome=rs(i,{handle:()=>this.view3dHandle}),requestAnimationFrame(()=>a.remove()),this.pushAvailabilityTo3d(),this.syncSelectionTo3d(),ts(i,x),e&&x.flyToSeat(e)}catch(c){if(l!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;this.opts.onError?.(c),this.toast(this.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),this.exit3d()}}exit3d(){if(this.buyerView!=="venue3d"&&!this.view3dEl)return;this.view3dGen++,this.buyerView="map",this.view3dTargetSeatId=null,this.opts.onBuyerViewChange?.({view:"map"}),this.root?.removeAttribute("data-view3d"),this.closeSeatConfidencePassport(!1),this.closeView3dComparison(!1),this.view3dCompareChip.remove(),this.view3dSeatViewChrome?.dispose(),this.view3dSeatViewChrome=null;try{this.view3dHandle?.dispose()}catch{}this.view3dHandle=null;let e=this.view3dEl;this.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),this.syncProjection(),this.syncTray();let t=this.view3dReturnSeat;this.view3dReturnSeat=null,t&&this.committedSelection().some(i=>i.id===t.id)&&this.opts.confirmSelection!==!1&&this.showConfirm(t)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e,!1)}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))),this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let n=this.els.tray?.querySelector(".sl-ba-go");n&&(n.disabled=!0,n.classList.add("sl-busy"),n.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let s=await this.controller.bestAvailable(e,t,{...i,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),i.preferPremium&&s.seats.length&&!s.seats.every(o=>o.commercial?.premium)&&this.toast((0,C.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}catch(s){this.opts.onError?.(s);let o=s?.reason,a=o==="not_enough_together"?(0,C.t)("picker.couldNotFindSeatsTogether",{count:e}):o==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):o==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):o==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):o==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):this.tf("picker.seatsNoLongerAvailableTryAnother","Those seats are no longer available. Try another quantity or ticket type.");return this.toast(a,"error"),null}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 n=[...new Set([...(e.items??[]).map(s=>s.label),...(e.seats??[]).map(s=>s.label)])];if(n.length)try{await this.api.release(this.opts.event,n,e.holdId)}catch(s){this.opts.onError?.(s),i=!1}}if(!i){this.toast(this.tf("picker.couldNotReleaseTickets","Couldn't release your tickets. Your hold is unchanged."),"error");return}this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.syncTray(),this.emitHoldChange()}startRealtime(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new ue({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:Ye(this.controller,{flashOnLiveChange:!0,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")}})}),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)}showAccessPanel(e){if(this.destroyed||!this.root)return;this.dismissAccessPanel();let t=Yn(e.reason,()=>{this.refreshAccess()});(this.regions?.["bottom-center"]??this.root).appendChild(t),this.accessEl=t}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}destroy(){this.destroyed=!0,sr(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.dismissAccessPanel(),this.access?.clear(),this.hold&&!this.handedOff&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),ve(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.toastTimer&&clearTimeout(this.toastTimer),this.liveTimer&&clearTimeout(this.liveTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalScrim&&(this.modalScrim.remove(),this.modalScrim=null,this.prevFocus?.isConnected&&this.prevFocus.focus({preventScroll:!0}),this.prevFocus=null)}};var Re=require("@seatlayer/core");var ho="seatlayer-performance-group-picker-style";function uo(){if(document.getElementById(ho))return;let r=document.createElement("style");r.id=ho,r.textContent=`
|
|
2261
|
+
</div>`;let n={};return i.querySelectorAll("[data-ref]").forEach(s=>{n[s.dataset.ref]=s}),{root:i,mapHost:n.map,els:n}}function Rn(r){let e=(t,i)=>{for(let n of r.querySelectorAll(`[${t}]`)){let s=n.getAttribute(t);if(!s)continue;let o=(0,lt.t)(s);o!==s&&i(n,o)}};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)})}var Y=require("@seatlayer/core");function On(r,e){let t=(0,Y.resolveLocale)(r),i=Y.TRANSLATED_LOCALES.includes(t)?t:"en";return e&&(0,Y.setStringOverrides)(e),{locale:i,direction:(0,Y.localeDirection)(i),ready:(0,Y.loadLocale)(r)}}function In(r,e,t){r.lang=e.locale,r.dir=e.direction,e.ready.then(t)}function _n(r,e){if(!r)return null;let t=(e.languages??[]).map(n=>(0,Y.resolveLocale)(n)).filter((n,s,o)=>o.indexOf(n)===s);if(t.length<2)return null;let i=document.createElement("select");i.className="sl-langsel",i.setAttribute("aria-label",e.label);for(let n of t){let s=document.createElement("option");s.value=n,s.textContent=Y.LOCALE_NAMES[n]??n,s.selected=n===(0,Y.getLocale)(),i.appendChild(s)}return i.addEventListener("change",()=>e.onChange(i.value)),r.appendChild(i),i}function Dn(r,e){e.root.lang=r,e.root.dir=(0,Y.localeDirection)(r),Rn(e.root);for(let i of e.painters)try{i()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==r&&(t.value=r)}var me=require("@seatlayer/core"),$n=require("@seatlayer/core/core/seatConfidence");function ir(r){return String(r??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function w(r){return String(r??"").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function Le(r){return r?.restrictedView?g("picker.restrictedView","Restricted view"):r?.obstructedView?g("picker.obstructedView","Obstructed view"):""}function Nn(r){if(!r)return"";let e=[];r.premium&&e.push(`<div class="sl-cx-premium"><span class="sl-cx-star" aria-hidden="true">\u2605</span>${g("picker.premiumSeat","Premium seat")}</div>`);let t=Le(r);return t?e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u25D0</span><span class="sl-cx-txt"><b>${t}</b>${r.note?`<span class="sl-cx-note">${w(r.note)}</span>`:""}</span></div>`):r.note&&e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u2139</span><span class="sl-cx-txt"><span class="sl-cx-note">${w(r.note)}</span></span></div>`),e.length?`<div class="sl-cx">${e.join("")}</div>`:""}function rr(r){let e=Le(r);if(!e)return"";let t=w(r?.note?r.note:e);return`<span class="sl-cx-mark" role="img" aria-label="${t}" title="${t}">\u25D0</span>`}function ct(r){return r==="no-seat"?g("picker.emptyWheelchairSpace","Empty wheelchair space"):r==="seat-present"?g("picker.accessiblePhysicalSeat","Accessible physical seat"):""}function zn(r){let e=ct(r);return e?`<div class="sl-cx"><div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u267F</span><span class="sl-cx-txt"><b>${e}</b></span></div></div>`:""}function bi(r){let e=ct(r);return e?`<span class="sl-cx-mark" role="img" aria-label="${e}" title="${e}">\u267F</span>`:""}function nr(r,e){if(!r)return"";let t=e?g("picker.viewFromThisSeat","View from this seat"):g("picker.seeItIn3d","See it in 3D");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>${t}</span></button>`}function Vn(r){if(!r)return"";let e=r.previous.label||r.previous.id,t=r.next.label||r.next.id;return`<span class="sl-seccard-nav" aria-label="${g("picker.browseSections","Browse sections")}"><button type="button" data-section-nav="${R(r.previous.id)}" aria-label="${g("picker.previousSection","Previous section")}: ${R(e)}" title="${R(e)}">\u2190</button><button type="button" data-section-nav="${R(r.next.id)}" aria-label="${g("picker.nextSection","Next section")}: ${R(t)}" title="${R(t)}">\u2192</button></span>`}function Fn(r,e){if(!e)return"";let t=e,i=t.includes(r.id),n=i?t.length>1?g("picker.openComparison","Open comparison"):g("picker.savedForComparison","Saved for comparison"):t.length?g("picker.compareWithSaved","Compare with saved"):g("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>${w(n)}</span></button>`}function jn(r,e,t){if(!t)return"";let i=(0,$n.seatConfidenceDisclosure)(r.confidenceEvidence),n=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${w(r.displayLabel??r.label)}"><span><em>${w(e)}</em><strong>${w(i.headline)}</strong><small>${w(n)}</small></span><b>Passport</b></button>`}function W(r){let e=r?.rowLabel,t=r?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let n=`${t}${i}`;if(e.startsWith(n)&&e.length>n.length)return e.slice(n.length)}return(0,me.compactRowLabel)(e,t)}function Va(r){switch(r){case"paused":return{title:g("picker.accessPausedTitle","These seats are on hold right now"),body:g("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:g("picker.accessRetry","Try again")};case"revoked":return{title:g("picker.accessRevokedTitle","This access link is no longer active"),body:g("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats.")};case"no_token":case"provider_failed":return{title:g("picker.accessExpiredTitle","Your access session has ended"),body:g("picker.accessExpiredBody","Sign in again, or reload the page, to keep browsing these seats. Anything you are already holding stays yours."),action:g("picker.accessRetry","Try again")};default:return{title:g("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:g("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest.")}}}function Gn(r,e,t){let i=ir;return[r?.sectionLabel?`<div class="sl-confirm-field"><span class="sl-confirm-key">${g("picker.section","Section")}</span><span class="sl-confirm-value">${i(r.sectionLabel)}</span></div>`:"",r?.rowLabel||r?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${i(t)}</span><span class="sl-confirm-value">${i(W(r)??r?.displayLabel??e)}</span></div>`:"",r?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${g("picker.seat","Seat")}</span><span class="sl-confirm-value">${i(r?.seatNumber??r?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function Kn(r,e,t){let i=ir,n=r?.objectType==="booth",s=r?.objectType==="table"&&!!r?.bookingMode,o=n||s||!r?.seatNumber,a=r?.sectionLabel??(o?void 0:r?.displayLabel),l=s?`${g("picker.guests","Guests")} ${r?.bookingMode==="variable"?`${r?.minOccupancy}\u2013${r?.maxOccupancy}`:r?.capacity}`:void 0,d=(o?[l,a?r?.rowLabel??r?.displayLabel:void 0]:[r?.rowLabel?`${t} ${W(r)??""}`.trim():void 0,`${g("picker.seat","Seat")} ${r?.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 Un(r,e){if(!r)return"";let t=e?g("picker.viewFromThisSeat","View from this seat"):g("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 Bn(r){return r.buyerMessage?.trim()||(r.restriction==="companion"?g("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function qn(r,e,t){let i=ir;if(r.length>1)return`<fieldset class="sl-confirm-tiers"><legend>${g("picker.ticketType","Ticket type")}</legend>`+r.map(o=>{let a=Bn(o);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${i(o.id)}" aria-pressed="${o.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${i(o.name)}</span>`+(a?`<small class="sl-confirm-tier-note">${i(a)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${i(t(o))}</span></button>`}).join("")+"</fieldset>";let n=r[0],s=n?Bn(n):void 0;return s?`<p class="sl-confirm-tier-note">${i(s)}</p>`:""}function sr(r){return`<span class="sl-seccard-dot" style="background:${w(r.color)}"></span><span class="sl-seccard-name">${w(r.label)}</span><span class="sl-seccard-left" data-full="${w(r.leftLabel)}" data-short="${w(r.leftShortLabel??r.leftLabel)}">${w(r.leftLabel)}</span>`+r.nav+r.close}function Wn(r){return`<div class="sl-seccard-head"><span class="sl-seccard-dot" style="background:${w(r.color)}"></span><span class="sl-seccard-name">${w(r.label)}</span>`+(r.showPrice?`<span class="sl-seccard-price">${w(r.priceLabel)}</span>`:"")+r.close+`</div><div class="sl-seccard-zone">${r.zoneLabel?`${w(r.zoneLabel)} \xB7 `:""}<span class="sl-seccard-left">${w(r.leftLabel)}</span></div>`+(r.entrance?`<div class="sl-seccard-entrance">${w(r.entrance)}</div>`:"")+(r.mix?`<div class="sl-seccard-mix">${r.mix}</div>`:"")+`<div class="sl-seccard-foot"><button type="button" class="sl-seccard-overview">\u2190 ${w(r.overviewLabel)}</button>`+r.nav+`<span class="sl-seccard-hint">${w(r.hint)}</span></div>`}function Yn(r){return`<span class="sl-seccard-mix-item${r.dim?" sl-dim":""}"><span class="sl-seccard-mix-dot" style="background:${w(r.color)}"></span>${w(r.label)} <span class="sl-seccard-mix-price">${w(r.rangeLabel)}</span></span>`}function Qn(r){return'<div class="sl-confirm-grid">'+r.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-dot" style="background:${w(r.categoryColor)}"></span><span class="sl-confirm-cat-name">${w(r.categoryLabel)}</span>`+(r.priceLabel?`<span class="sl-confirm-price">${w(r.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+r.marker+`<span class="sl-confirm-dot" style="background:${w(r.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${w(r.categoryLabel)}</span><span class="sl-confirm-who">`+r.identity+"</span>"+(r.priceLabel?`<span class="sl-confirm-idprice">${w(r.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+r.tierChoices+r.groupDates+r.wheelchair+r.commercial+(r.thumb||r.see3dPill?`<div class="sl-confirm-strip">${r.thumb}<span class="sl-confirm-pills">${r.see3dPill}</span></div>`:"")+r.inspect+`<div class="sl-confirm-row"><button type="button" class="sl-confirm-cancel">${w(r.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>${w(r.selectLabel)}</button></div></div>`}function Xn(r,e){let t=R,{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?(0,me.t)("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):(0,me.t)("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(r.displayLabel??r.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(i?g("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,me.t)("picker.allPlacesBookedTogether",{count:r.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span><b data-table-unit>${t((0,me.t)("picker.perGuestPrice",{price:e.unitPrice}))}</b><span class="muted">${t(g("picker.tableCapacity","Table capacity"))}</span><span>${t((0,me.t)("picker.guestsCount",{count:r.capacity}))}</span><span class="muted">${t(g("picker.total","Total"))}</span><b data-table-total></b></div>`+(i?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(g("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(g("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${r.quantity}</output><button type="button" data-table-step="1" aria-label="${t(g("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t((0,me.t)("picker.chooseMinMaxGuests",{min:r.minOccupancy,max:r.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${r.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t((0,me.t)("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?g("picker.updateTable","Update table"):i?g("picker.selectTable","Select table"):g("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function Zn(r,e){let t=Va(r),i=document.createElement("div");i.className="sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let n=document.createElement("div"),s=document.createElement("div");s.className="sl-access-title",s.textContent=t.title;let o=document.createElement("div");if(o.className="sl-access-body",o.textContent=t.body,n.append(s,o),t.action){let a=document.createElement("button");a.type="button",a.className="sl-access-act",a.textContent=t.action,a.addEventListener("click",e),n.appendChild(a)}return i.appendChild(n),i}function Jn(r){return r.map(e=>`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${w(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${w(e.icon)}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${w(e.label)}</span>`+(e.note?`<span class="sl-a11yrow-n">${w(e.note)}</span>`:"")+"</span>"+(e.count?`<span class="sl-a11yrow-c">${w(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>').join("")}function es(r){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",r.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:r.tf("picker.allFloors","All floors")},...r.floors.map(s=>({id:s.id,name:s.name}))];for(let s of t){let o=document.createElement("button");o.type="button",o.dataset.floor=s.id,o.textContent=s.name,o.setAttribute("aria-pressed","false"),o.addEventListener("click",()=>r.onChoose(s.id)),e.appendChild(o)}let i=document.createElement("button");i.type="button",i.className="sl-floor-info",i.textContent="i";let n=r.tf("picker.floorHelp","All floors shows the complete venue. Choose one level to inspect and select its seats.");return i.setAttribute("aria-label",n),i.title=n,e.appendChild(i),e}function ts(r,e,t){if(!r)return;let i=t?"":e;r.querySelectorAll("button[data-floor]").forEach(n=>{n.setAttribute("aria-pressed",String(n.dataset.floor===i))})}var ee=require("@seatlayer/core");var vi=class{constructor(e){this.el=null;this.stripObserver=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?.classList.contains("strip")?Ee(this.el,void 0,Br):this.el?.remove(),this.el=null,this.syncLocatorDock(),this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}updateDockInPlace(e,t){let i=this.el;if(!i)return;let n=i.querySelector(".sl-seccard-dot");n&&(n.style.background=e.color);let s=i.querySelector(".sl-seccard-name");s&&zi(s,e.label);let o=i.querySelector(".sl-seccard-left");o&&(o.dataset.full=t.leftLabel,o.dataset.short=t.leftShortLabel,zi(o,t.leftLabel));let a=i.querySelector(".sl-seccard-nav");t.nav?(a?a.outerHTML=t.nav:i.querySelector(".sl-seccard-x")?.insertAdjacentHTML("beforebegin",t.nav),this.wireNavigation(i)):a&&a.remove(),i.setAttribute("aria-label",`${(0,ee.t)("picker.sectionSummaryAria",{label:e.label})}, ${t.leftLabel}`),this.fitStripCount()}wireNavigation(e){e.querySelectorAll("[data-section-nav]").forEach(t=>{t.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation();let n=t.dataset.sectionNav;n&&this.host.controller.focusSection(n)})})}render(e){let t=this.host.map();if(!t)return;let i=this.el?.classList.contains("strip")===!0&&this.el.isConnected,n=e.categories.length?e.categories.map(v=>{let x=this.host.controller.doc?.categories.find(T=>T.key===v.key);return x?this.host.catPriceRange(x):{min:v.priceMin,max:v.priceMax}}).filter(v=>v!=null):[{min:e.priceMin,max:e.priceMax}],s=Math.min(...n.map(v=>v.min)),o=Math.max(...n.map(v=>v.max)),a=s===o?this.host.money(s):`${this.host.money(s)}\u2013${this.host.money(o)}`,l=(0,ee.tCount)("picker.seatsLeftInSection",e.seatsLeft),c=(0,ee.t)("picker.seatsLeftShort",{count:e.seatsLeft}),d=`<button type="button" class="sl-seccard-x" aria-label="${(0,ee.t)("picker.closeSectionSummary")}">\u2715</button>`,h=`<button type="button" class="sl-seccard-x sl-seccard-back" aria-label="${(0,ee.t)("picker.closeSectionSummary")}"><span class="sl-seccard-back-chev" aria-hidden="true">\u2039</span>${R((0,ee.t)("picker.overview"))}</button>`,p=Vn(this.host.sectionNeighbours(e.id)),u=this.host.root()?.dataset.layout==="narrow",b={label:e.label,color:e.color,leftLabel:l,leftShortLabel:c,nav:p,close:d};if(u&&i&&this.el){this.updateDockInPlace(e,{leftLabel:l,leftShortLabel:c,nav:p});return}this.el?.remove();let m=document.createElement("div");if(u){if(m.className=i?"sl-seccard strip on":"sl-seccard strip on sl-mo-slide-up",m.setAttribute("role","group"),m.setAttribute("aria-label",`${(0,ee.t)("picker.sectionSummaryAria",{label:e.label})}, ${l}`),m.innerHTML=sr({...b,close:h}),i)for(let v of m.querySelectorAll(".sl-seccard-name,.sl-seccard-left"))v.classList.add("sl-mo-xfade");this.wireNavigation(m),m.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),t.appendChild(m),this.fitStripCount()}else if(this.collapsed)m.className="sl-seccard mini on",m.setAttribute("role","button"),m.setAttribute("aria-label",(0,ee.t)("picker.sectionSummaryAria",{label:e.label})),m.innerHTML=sr(b),this.wireNavigation(m),m.addEventListener("click",v=>{v.target.closest(".sl-seccard-x")||(this.collapsed=!1,this.shownAt=Date.now(),this.render(e))}),m.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),(this.host.region("top-center")??t).appendChild(m);else{m.className="sl-seccard on",m.setAttribute("role","dialog"),m.setAttribute("aria-label",(0,ee.t)("picker.sectionSummaryAria",{label:e.label}));let v=this.host.priceBandKeys(),x=e.categories.map(T=>{let A=this.host.controller.doc?.categories.find(y=>y.key===T.key),f=A?this.host.catPriceRange(A):{min:T.priceMin,max:T.priceMax};return Yn({label:T.label,color:T.color,dim:v!=null&&!v.has(T.key),rangeLabel:f&&f.min!==f.max?`${this.host.money(f.min)}\u2013${this.host.money(f.max)}`:this.host.money(f?.min??T.price)})}).join("");m.innerHTML=Wn({...b,priceLabel:a,showPrice:e.categories.length>0,zoneLabel:e.zoneLabel,entrance:e.entrance?`${(0,ee.t)("picker.entrance")} ${e.entrance}`:void 0,mix:x,overviewLabel:(0,ee.t)("picker.overview"),hint:(0,ee.t)("picker.tapSeatHint")}),this.wireNavigation(m),m.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),m.querySelector(".sl-seccard-overview").addEventListener("click",()=>this.host.controller.overview()),(this.host.region("top-center")??t).appendChild(m)}this.el=m,u&&this.watchStrip(m),this.syncLocatorDock()}syncLocatorDock(){let e=this.host.root();e&&(this.el?.classList.contains("strip")?e.dataset.locator="true":delete e.dataset.locator)}fitStripCount(){let e=this.el;if(!e||!e.classList.contains("strip"))return;let t=e.querySelector(".sl-seccard-left");if(!t)return;let i=e.querySelector(".sl-seccard-name"),n=c=>c!=null&&c.clientWidth>0&&c.scrollWidth>c.clientWidth+1,s=()=>{let c=e.clientWidth;if(c<=0)return!0;let d=typeof getComputedStyle=="function"?getComputedStyle(e):null,h=m=>{let v=Number.parseFloat(m??"");return Number.isFinite(v)?v:0},p=[...e.children].filter(m=>m instanceof HTMLElement&&!m.hidden),u=h(d?.columnGap)||h(d?.gap);return p.reduce((m,v)=>m+Math.max(v.scrollWidth,v.getBoundingClientRect().width),0)+u*Math.max(0,p.length-1)+h(d?.paddingLeft)+h(d?.paddingRight)<=c+1},o=()=>t.hidden||!n(t)&&s(),a=c=>{if(t.hidden=c==="hidden",c==="hidden")return;let d=t.dataset.full??"";t.textContent=c==="full"?d:t.dataset.short??d},l=["full","short","hidden"];for(let c of l)if(a(c),o()&&!n(i))return;for(let c of l)if(a(c),o())return;a("hidden")}watchStrip(e){this.stripObserver?.disconnect(),this.stripObserver=null,typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.el===e&&this.fitStripCount()}),typeof ResizeObserver=="function"&&(this.stripObserver=new ResizeObserver(()=>{this.el===e&&this.fitStripCount()}),this.stripObserver.observe(e))}collapse(){!this.el||this.collapsed||!this.current||this.host.root()?.dataset.layout!=="narrow"&&(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)&&this.host.root()?.dataset.layout!=="narrow"){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 n=this.host.activeFloorObjects().find(T=>T.type==="section"&&T.id===t.id)?.outline;if(!n||n.length<3)return 0;let s=n.map(T=>this.host.controller.worldToScreen(T)),o=s.map(T=>T.x),a=s.map(T=>T.y),l=Math.min(...o),c=Math.min(...a),d=Math.max(...o)-l,h=Math.max(...a)-c;if(d<=0||h<=0)return 0;let p=i.getBoundingClientRect(),u=e.getBoundingClientRect(),b=u.left-p.left,m=u.top-p.top,v=Math.max(0,Math.min(b+u.width,l+d)-Math.max(b,l)),x=Math.max(0,Math.min(m+u.height,c+h)-Math.max(m,c));return v*x/(d*h)}};var is=require("@seatlayer/core"),dt=require("@seatlayer/core/picker/minimapGeometry");function rs(r,e){let t=new or(r);return t.build(e),t}var or=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}build(e){if(!this.host.controller.getViewport())return;let i=document.createElement("button");i.type="button",i.className="sl-minimap-toggle",i.setAttribute("aria-label",g("picker.openVenueMap","Open venue overview map")),i.setAttribute("aria-expanded","false"),i.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 6l5-2 8 3 5-2v13l-5 2-8-3-5 2zM8 4v13M16 7v13"/></svg>',e.appendChild(i),this.miniToggle=i;let n=document.createElement("div");n.className="sl-minimap",n.setAttribute("role","group");let s=document.createElement("div");s.className="sl-minimap-bar";let o=document.createElement("span");o.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",g("picker.minimapStateKey","Focused, selected, available, and inactive sections")),a.innerHTML='<i class="focused" title="Focused"></i><i class="selected" title="Selected"></i><i title="Available"></i><i class="inactive" title="Inactive"></i>';let l=document.createElement("button");l.type="button",l.className="sl-minimap-close",l.setAttribute("aria-label",g("picker.closeVenueMap","Close venue overview map")),l.textContent="\xD7",s.append(o,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",g("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),n.append(s,c),e.appendChild(n),this.miniWrap=n,this.miniLabel=o,this.miniCanvas=c;let d=document.createElement("canvas");this.miniBase=d,i.addEventListener("click",()=>{let h=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=h,this.setMinimapOpen(!h)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",h=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(h)}),c.addEventListener("pointerdown",h=>this.minimapPointerDown(h)),c.addEventListener("pointermove",h=>this.minimapPointerMove(h)),c.addEventListener("pointerup",h=>this.minimapPointerUp(h)),c.addEventListener("pointercancel",h=>this.minimapPointerUp(h)),c.addEventListener("keydown",h=>this.minimapKeydown(h)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setAutoOpen(e){if(this.miniWrap){if(!e){this.userClosed=!1,this.host.root()?.dataset.minimapOpen==="true"&&this.setMinimapOpen(!1,!1);return}this.userClosed||this.host.root()?.dataset.minimapOpen==="true"||this.setMinimapOpen(!0,!1)}}setMinimapOpen(e,t=!0){this.host.root()?.setAttribute("data-minimap-open",String(e)),this.miniToggle?.setAttribute("aria-expanded",String(e)),t&&(e?this.miniCanvas?.focus():this.miniToggle?.focus())}layoutMinimap(){let e=this.miniCanvas,t=this.miniBase,i=this.host.controller.getViewport()?.bounds;if(!e||!t||!i||!(i.width>0&&i.height>0))return;let n=196,s=146,o=6,a=i.width/Math.max(1,i.height),l=n,c=Math.round(n/a);c>s&&(c=s,l=Math.round(s*a)),l=Math.max(64,l),c=Math.max(48,c);let d=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*d),e.height=Math.round(c*d),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=(0,dt.createMinimapTransform)(i,e.width,e.height,d,o)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?g("picker.allFloors","All floors"):e.find(d=>d.id===this.host.controller.getActiveFloorId())?.name??g("picker.venueOverview","Venue overview"),i=this.host.controller.getMinimapSnapshot().sections,s=i.find(d=>d.active)?.label??this.host.focusedSectionLabel(),o=s?`${t} \xB7 ${s}`:t;this.miniLabel.textContent=o;let a=i.filter(d=>d.state==="selected").length,l=i.filter(d=>d.state==="available").length,c=i.filter(d=>d.state==="inactive").length;this.miniWrap.setAttribute("aria-label",i.length?`${o}. ${a} selected, ${l} available, ${c} inactive sections.`:o),this.miniCanvas?.setAttribute("aria-label",i.length?`${o}. ${a} selected, ${l} available, ${c} inactive sections. ${g("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${o}. ${g("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click elsewhere, or use arrow keys to pan.")}`)}refreshMinimap(){this.miniBase&&(this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect())}drawMinimapStatic(){let e=this.miniBase,t=this.miniTf;if(!e||!t)return;let i=e.getContext("2d");if(!i)return;i.clearRect(0,0,e.width,e.height);let n=h=>h*t.scale+t.offX,s=h=>h*t.scale+t.offY,o=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",a=this.host.cssVar("--sl-muted")||"#8b93a7",l=this.host.cssVar("--sl-accent")||"#6e7bff",c=this.host.cssVar("--sl-success")||"#22a06b",d=this.host.controller.getMinimapSnapshot();for(let h of d.sections){if(h.outline.length<3)continue;i.beginPath(),h.outline.forEach((u,b)=>b===0?i.moveTo(n(u.x),s(u.y)):i.lineTo(n(u.x),s(u.y))),i.closePath();let p=h.paint;if(i.globalAlpha=h.state==="inactive"?.5:.92,p?i.fillStyle=p.fill:(i.globalAlpha=h.state==="inactive"?.18:h.state==="selected"?.72:.34,i.fillStyle=h.state==="inactive"?a:h.state==="selected"?l:c),i.fill(),i.globalAlpha=.82,i.lineWidth=Math.max(1,t.dpr),i.strokeStyle=p?.stroke||o,i.stroke(),h.owned){i.globalAlpha=1,i.lineWidth=Math.max(2,t.dpr*1.5),i.strokeStyle=l,i.stroke();let u=h.outline.reduce((b,m)=>({x:b.x+m.x,y:b.y+m.y}),{x:0,y:0});i.beginPath(),i.arc(n(u.x/h.outline.length),s(u.y/h.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),i.fillStyle=l,i.fill(),i.beginPath(),h.outline.forEach((b,m)=>m===0?i.moveTo(n(b.x),s(b.y)):i.lineTo(n(b.x),s(b.y))),i.closePath()}h.active&&(i.globalAlpha=1,i.lineJoin="round",i.lineWidth=Math.max(4,t.dpr*3.5),i.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",i.stroke(),i.lineWidth=Math.max(2,t.dpr*1.75),i.strokeStyle=l,i.stroke())}if(i.globalAlpha=1,!d.sections.length){let h=Math.max(1,t.dpr);for(let p of d.seats)i.globalAlpha=p.state==="inactive"?.22:.78,i.fillStyle=p.state==="inactive"?a:p.state==="selected"?l:c,i.beginPath(),i.arc(n(p.x),s(p.y),h,0,Math.PI*2),i.fill();i.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,i=this.miniTf;if(!e||!t||!i)return;let n=e.getContext("2d");if(!n)return;n.clearRect(0,0,e.width,e.height),n.drawImage(t,0,0);let s=this.host.controller.getViewport();if(!s)return;let o=(0,dt.minimapViewportPlan)(s.visible,i,e.width,e.height,Math.max(2,i.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";n.save(),n.globalAlpha=.1,n.fillStyle=a,n.fillRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),n.globalAlpha=.9,n.lineJoin="round",n.lineWidth=Math.max(4,i.dpr*3.25),n.strokeStyle=l,n.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),n.globalAlpha=1,n.lineWidth=Math.max(2,i.dpr*1.75),n.strokeStyle=a,n.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),o.clipped&&Object.values(o.clippedEdges).some(Boolean)&&(n.setLineDash([Math.max(3,i.dpr*3),Math.max(2,i.dpr*2)]),n.strokeRect(o.clipped.x,o.clipped.y,o.clipped.width,o.clipped.height)),n.restore()}minimapWorldPoint(e){let t=this.miniCanvas,i=this.miniTf;if(!t||!i)return null;let n=t.getBoundingClientRect(),s=(e.clientX-n.left)*(t.width/Math.max(1,n.width)),o=(e.clientY-n.top)*(t.height/Math.max(1,n.height));return{...(0,dt.minimapPointToWorld)({x:s,y:o},i),px:s,py:o}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),i=this.host.controller.getViewport()?.visible;!t||!i||!(t.x>=i.x&&t.x<=i.x+i.width&&t.y>=i.y&&t.y<=i.y+i.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(i.x+i.width/2),offsetY:t.y-(i.y+i.height/2),startX:e.clientX,startY:e.clientY,moved:!1},this.miniCanvas?.setPointerCapture(e.pointerId),this.miniCanvas?.classList.add("sl-dragging"),e.preventDefault())}minimapPointerMove(e){let t=this.miniDrag;if(!t||t.pointerId!==e.pointerId)return;let i=this.minimapWorldPoint(e);i&&(!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>2&&(t.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:i.x-t.offsetX,y:i.y-t.offsetY}),e.preventDefault())}minimapPointerUp(e){let t=this.miniDrag;!t||t.pointerId!==e.pointerId||(this.miniSuppressClick=t.moved,this.miniDrag=null,this.miniCanvas?.classList.remove("sl-dragging"),this.miniCanvas?.hasPointerCapture(e.pointerId)&&this.miniCanvas.releasePointerCapture(e.pointerId))}minimapKeydown(e){let t=this.host.controller.getViewport()?.visible;if(!t)return;if(e.key==="Home"){this.host.controller.overview(),e.preventDefault();return}let i=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,n=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!i&&!n||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+i,y:t.y+t.height/2+n}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let i of this.host.controller.getMinimapSnapshot().sections)if(!(i.state==="inactive"||i.outline.length<3)&&(0,is.pointInPolygon)(t,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var yi=require("@seatlayer/core");var Fa=12;function ns(r,e){let t=e.floors(),i=new Set(t.map(x=>x.label.trim().toLocaleLowerCase())),n=e.zones().filter(x=>x.seatCount>0&&!i.has(x.label.trim().toLocaleLowerCase())),s=e.sections().filter(x=>x.seatCount>0&&!i.has(x.label.trim().toLocaleLowerCase())),o=n.length>1?[]:s,a=t.length>1,l=n.length>1,c=o.length>1;if(!a&&!l&&!c)return;let d=document.createElement("div");d.className="sl-view3d-nav";let h=document.createElement("button");h.type="button",h.className="sl-view3d-nav-toggle",h.setAttribute("aria-expanded","false");let p='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>',u=document.createElement("span");h.innerHTML=p,h.appendChild(u);let b=x=>{d.classList.toggle("is-open",x),h.setAttribute("aria-expanded",String(x)),u.textContent=x?g("picker.closeVenueNav","Close"):a&&(l||c)?g("picker.levelsAndAreas","Levels & areas"):a?g("picker.levels","Levels"):g("picker.areas","Areas")};h.addEventListener("click",()=>b(!d.classList.contains("is-open"))),d.addEventListener("keydown",x=>{x.key!=="Escape"||!d.classList.contains("is-open")||(x.preventDefault(),x.stopPropagation(),b(!1),h.focus())}),b(!1),d.appendChild(h);let m=x=>{},v=x=>{};if(a){let x=document.createElement("div");x.setAttribute("role","group"),x.setAttribute("aria-label",g("picker.levels","Levels"));let T=[];v=y=>{T.forEach(S=>{S.setAttribute("aria-pressed",String((S.dataset.floor===""?null:Number(S.dataset.floor))===y))})};let A=y=>{e.focusFloor(y)&&(v(y),m(y))},f=(y,S)=>{let L=document.createElement("button");L.type="button",L.textContent=y,L.dataset.floor=S===null?"":String(S),L.setAttribute("aria-pressed",String(S===null)),L.addEventListener("click",()=>{A(S),b(!1)}),T.push(L),x.appendChild(L)};f(g("picker.allLevels","All levels"),null);for(let y of t)f(y.label||(0,yi.t)("picker.levelNumber",{number:y.index+1}),y.index);d.appendChild(x)}if(l||c){let x=document.createElement("div");x.setAttribute("role","group"),x.setAttribute("aria-label",g("picker.areas","Areas"));let T=l?n.map(f=>({id:f.id,label:f.label||f.id,go:()=>{e.focusZone(f.id)}})):o.map(f=>({id:f.id,label:f.label||f.id,floorIndex:f.floorIndex,go:()=>{e.focusSection(f.id),Number.isFinite(f.floorIndex)&&v(f.floorIndex)}})),A=f=>{let y=l||f===null?T:T.filter(S=>S.floorIndex===void 0||S.floorIndex===f);if(x.replaceChildren(),!y.length){x.remove();return}if(x.isConnected||d.appendChild(x),!l&&y.length>Fa){let S=document.createElement("select");S.setAttribute("aria-label",g("picker.jumpToSection","Jump to section"));let L=document.createElement("option");L.value="",L.textContent=g("picker.jumpToSection","Jump to section"),S.appendChild(L);for(let E of y){let O=document.createElement("option");O.value=E.id,O.textContent=E.label,S.appendChild(O)}S.addEventListener("change",()=>{y.find(E=>E.id===S.value)?.go()}),x.appendChild(S);return}for(let S of y){let L=document.createElement("button");L.type="button",L.textContent=S.label,L.addEventListener("click",()=>{S.go(),b(!1)}),x.appendChild(L)}};m=A,A(null)}r.appendChild(d)}var xi=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",g("picker.savedSeatComparison","Saved seat comparison"));let s=document.createElement("button");s.type="button",s.className="main",s.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(g("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let o=document.createElement("button");o.type="button",o.className="clear",o.textContent="\xD7",o.setAttribute("aria-label",g("picker.clearSavedSeatComparison","Clear saved seat comparison")),o.addEventListener("click",()=>this.host.clearComparison()),t.append(s,o),e.appendChild(t),this.chip=t}let i=this.host.savedSeatIds().length,n=t.querySelector(".main");n&&(n.textContent=i>1?(0,yi.t)("picker.compareCount",{count:i}):g("picker.oneSeatSaved","1 seat saved"),n.setAttribute("aria-label",i>1?(0,yi.t)("picker.openComparisonOfSeats",{count:i}):g("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function ss(r){return!r?.querySelector('[data-ref="zfs"]')}var ar=require("@seatlayer/core");var ja=900,Ga=450;function Ka(r){switch(r){case"seat":return g("picker.stopYourSeat","Your seat");case"row":return g("picker.stopYourRow","Your row");case"section":return g("picker.stopYourSection","Your section");default:return g("picker.stopWholeVenue","Whole venue")}}function os(r,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let i=g("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",i),t.title=i,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let n=document.createElement("div");n.className="sl-view3d-stop",n.setAttribute("role","status"),n.setAttribute("aria-live","polite"),r.append(t,n);let s=null,o=null;return{onStopChange(a){if(s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),!a){n.classList.remove("is-shown"),n.textContent="",o=setTimeout(()=>{o=null,r.classList.remove("is-seat-view")},Ga);return}r.classList.add("is-seat-view"),n.textContent=Ka(a),n.classList.add("is-shown"),s=setTimeout(()=>{s=null,n.classList.remove("is-shown")},ja)},dispose(){s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),t.remove(),n.remove(),r.classList.remove("is-seat-view")}}}var Ua=44,qa=92;function as(r,e,t,i={}){let n=r?.sectionLabel,s=W(r),o=Wa(r,e),a=[n,s?(0,ar.t)("picker.rowLabel",{label:s}):null,o?(0,ar.t)("picker.seatLabel",{label:o}):null].filter(Boolean).join(" \xB7 "),l=i.maxChars??(i.narrow?Ua:qa);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 Wa(r,e){if(r?.seatNumber)return r.seatNumber;let t=r?.displayLabel??e,i=n=>{!n||!t.startsWith(n)||t.length<=n.length||(t=t.slice(n.length).replace(/^[\s·\-\/_]+/,""))};return i(r?.sectionLabel),i(W(r)),t}var ls="sl:sheet-hint";function cs(r){let e=r.boot;if(!e?.isConnected)return;if(r.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"),r.map?.appendChild(t),setTimeout(()=>t.remove(),650),r.rail?.classList.add("is-in"),r.root?.classList.add("is-arriving"),setTimeout(()=>{r.rail?.classList.remove("is-in"),r.root?.classList.remove("is-arriving"),Ya(r.root)},900)}function Ya(r){if(!r||r.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(ls))return;window.sessionStorage.setItem(ls,"1")}catch{}let e=r.querySelector(".sl-sheet-grab");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function ds(r,e){r.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let i of e())if(i.open()){t.preventDefault(),t.stopPropagation(),i.close();return}}})}function wi(r){let e=r.committedSelection(),t=r.controller.getGAAreas(),i=r.hold?.items??[],n=new Set(i.map(p=>p.label)),s=Fr(r,t,i),o=ze(r.gaQty,i),a=i.reduce((p,u)=>p+r.paidPrice(u.categoryKey,u.tierId,u.unitPrice,u.label)*(u.quantity??1),0),l=i.reduce((p,u)=>p+(u.quantity??1),0),c=e.filter(p=>!n.has(p.label)),d=c.reduce((p,u)=>p+r.paidPrice(u.categoryKey,u.tierId??null,u.price,u.label)*(u.quantity??1),0)+s+a,h=c.reduce((p,u)=>p+(u.quantity??1),0)+o+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:i,heldLabels:n,heldCount:l,total:d,count:h}}function ki(r,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:r.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function Si(r,e){let t=e.tiers?.length?e.tiers.map(i=>r.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[r.paidPrice(e.key,null,e.price)];if(e.key)for(let i of r.pricesByChannel.values())for(let n of i)n.categoryKey===e.key&&t.push(n.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var Ht="seatlayer_";function Qa(){let r=globalThis;return r.document?.modelContext??r.navigator?.modelContext??null}function ae(r,e){return e?{ok:!1,reason:r,message:e}:{ok:!1,reason:r}}function Xa(r){return Array.isArray(r)?r.filter(e=>typeof e=="string"&&!!e):[]}function Za(r,e){let t=r.event();if(!t)return ae("not_loaded","The seat map has not finished loading.");let i=r.selectionLimits();return{ok:!0,event:t,selection:{max:i.max,...i.required!=null?{required:i.required}:{}},categories:r.categories(),zones:r.zones(),hasPremiumSeats:r.hasPremiumSeats(),holdsAllowed:e}}function ps(r,e){let t=n=>!!n&&n.toLowerCase()===e.toLowerCase(),i=r.find(n=>t(n.key??n.id))??r.find(n=>t(n.label));return i?.key??i?.id??null}function hs(r,e){let t=e.map(i=>r.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,n)=>t[n]?.seat||i.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((i,n)=>i+n.price,0)}}function Ja(r,e,t){let i=new Map;for(let s of e){let o=i.get(s.rowKey);o?o.push(s):i.set(s.rowKey,[s])}let n=[];for(let s of i.values()){let o=[...s].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=o.length;l++)if(l===o.length||o[l].index!==o[l-1].index+1||o[l].categoryKey!==o[l-1].categoryKey){for(let d=a;d+t<=l;d+=t)n.push(hs(r,o.slice(d,d+t)));a=l}}return n}function el(r,e,t){let i=new Map;for(let s of e){let o=i.get(s.sectionKey);o?o.push(s):i.set(s.sectionKey,[s])}let n=[];for(let s of i.values()){if(s.length<t)continue;let o=[...s].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);n.push(hs(r,o.slice(0,t)))}return n}function tl(r,e){if(!r.event())return ae("not_loaded","The seat map has not finished loading.");let i=r.selectionLimits(),n=Math.floor(Number(e.count));if(!Number.isInteger(n)||n<1||n>i.max)return ae("bad_count",`count must be a whole number between 1 and ${i.max}.`);let s=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,o=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?ps(r.categories(),l):null;if(l&&!d)return ae("no_match",`No ticket type called "${l}".`);let h=c?ps(r.zones(),c):null;if(c&&!h)return ae("no_match",`No zone called "${c}".`);let p=r.seats().filter(m=>m.available);if(!p.length)return ae("sold_out");let u=p.filter(m=>(!d||m.categoryKey===d)&&(!h||m.zoneId===h)&&(a==null||m.price<=a));if(!u.length)return ae("no_match");let b=o?Ja(r,u,n):el(r,u,n);return b.length?(b.sort((m,v)=>v.unitPrice!==m.unitPrice?v.unitPrice-m.unitPrice:m.row.localeCompare(v.row)||m.labels[0].localeCompare(v.labels[0])),{ok:!0,groups:b.slice(0,s),searched:{count:n,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...h?{zone:h}:{},together:o}}}):ae(o?"not_enough_together":"no_match")}function us(r){return{ok:!0,...r.selection()}}function il(r,e){let t=r.event();if(!t)return ae("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return ae("event_closed","Sales are closed for this event.");let i=Xa(e.seat_ids);return i.length?(r.clearSelection(),r.selectObjects(i),us(r)):ae("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function rl(r,e){let t=async n=>{try{return await n()}catch(s){return ae("error",s instanceof Error?s.message:String(s))}},i=[{name:`${Ht}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(()=>Za(r,e))},{name:`${Ht}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:n=>t(()=>tl(r,n))},{name:`${Ht}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:n=>t(()=>il(r,n))},{name:`${Ht}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(()=>us(r))}];return e&&i.push({name:`${Ht}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(()=>r.hold())}),i}async function ms(r,e={}){let t=Qa();if(!t||typeof t.registerTool!="function")return null;let i=new AbortController,n=rl(r,!!e.holds),s=[],o=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of n)await t.registerTool(a,{signal:i.signal,...o?{exposedTo:o}:{}}),s.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return s.length?{names:s,dispose:()=>{if(i.abort(),typeof t.unregisterTool=="function")for(let a of s)try{t.unregisterTool(a)}catch{}}}:null}async function fs(r){let e=r.opts.webMcp;if(!e||r.destroyed)return;let t=typeof e=="object"&&!!e.holds,i=typeof e=="object"?e.exposedTo:void 0;try{r.webMcp=await ms(cr(r,t),{holds:t,exposedTo:i}),r.destroyed&&lr(r)}catch(n){console.warn("seatmap: WebMCP registration failed",n)}}function lr(r){r.webMcp?.dispose(),r.webMcp=null}function cr(r,e){let t=(i,n)=>{if(Number.isInteger(i.logicalSeatIndex))return i.logicalSeatIndex;let s=i.id.lastIndexOf(":"),o=s<0?NaN:Number(i.id.slice(s+1));return Number.isFinite(o)?o:n};return{event:()=>{let i=r.renderInfo;return i?{name:i.eventName??"",venue:i.venue??null,startsAt:i.startsAt??null,timezone:i.timezone??null,currency:r.currency,salesClosed:r.salesClosed}:null},selectionLimits:()=>({max:r.maxTickets,required:r.exactTickets}),categories:()=>{let i=r.controller.categoryAvailability();return(r.controller.doc?.categories??[]).filter(n=>!n.notForSale).map(n=>{let s=Si(r,n),o=ki(r,n);return{key:n.key,label:n.label??n.key,...o===void 0?{}:{price:o},...s&&s.min!==s.max?{priceRange:s}:{},available:i[n.key]??0}})},zones:()=>r.controller.getBestAvailableZones(),hasPremiumSeats:()=>r.controller.hasPremiumSeats(),seats:()=>{let i=r.controller.getActiveFloorId(),n=[];return r.allSeats().forEach((s,o)=>{if(s.floorId&&i&&s.floorId!==i)return;let a=r.controller.getStatus(s.id)??"free",l=r.controller.doc?.categories.find(d=>d.key===s.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;n.push({id:s.id,label:s.label,rowKey:s.logicalRowId??s.rowId,sectionKey:s.sectionId??s.rowId,index:t(s,o),categoryKey:s.categoryKey,price:r.paidPrice(s.categoryKey,l?.tiers?.[0]?.id??null,c,s.label),...s.zoneId?{zoneId:s.zoneId}:{},available:a==="free"&&!l?.notForSale})}),n},describeSeat:i=>{let n=r.controller.seatDetails(i);return n?{section:n.sectionLabel??"",row:W(n)??"",seat:n.seatNumber??n.label,category:n.categoryLabel??n.categoryKey}:null},selection:()=>{let{freshSeats:i,total:n,count:s}=wi(r);return{seats:i.map(o=>({id:o.id,label:o.label,section:o.sectionLabel??"",row:W(o)??"",seat:o.seatNumber??o.label,category:o.categoryKey,price:r.paidPrice(o.categoryKey,o.tierId??null,o.price,o.label)})),count:s,total:n,currency:r.currency,hold:r.hold?{id:r.hold.holdId,expiresAt:r.hold.expiresAt}:null,validity:r.getSelectionValidity()}},clearSelection:()=>r.clearSelection(),selectObjects:i=>{r.selectObjects(i)},hold:()=>e?nl(r):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function nl(r){if(r.salesClosed)return{ok:!1,reason:"event_closed"};if(!r.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=r.controller.getSelectionValidity(r.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await r.handleCta(),r.hold?{ok:!0,hold:{id:r.hold.holdId,expiresAt:r.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function Rt(r){if(!r)return null;let e=r.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function sl(r){return Rt(r.peek?.querySelector(".sl-peek-sum"))??Rt(r.foot?.querySelector(".sl-total"))??Rt(r.tray)??Rt(r.sheetHead)}function pr(r,e,t,i){let n=r,s=n.map;if(!s||!e)return;let o=s.getBoundingClientRect(),a={x:o.left+e.x,y:o.top+e.y},l=t.displayLabel??t.label,c=i?.find(h=>h.key===t.categoryKey)?.color,d=()=>{let h=sl(n);h&&$r({from:a,to:{x:h.left+h.width/2,y:h.top+h.height/2},label:l,color:c})};Rt(n.peek)?requestAnimationFrame(d):d()}var dr=60,ol=650;function gs(r,e){if(!e.length)return;e.forEach((s,o)=>{r.schedule(()=>r.pop(s.id),o*dr)});let t=e.length*dr,i=e.find(s=>s.sectionId)?.sectionId;if(i){let s=e.filter(a=>a.sectionId===i),o={x:s.reduce((a,l)=>a+l.x,0)/s.length,y:s.reduce((a,l)=>a+l.y,0)/s.length};r.schedule(()=>r.focus(i,o),t)}let n=t+(i?ol:0);e.forEach((s,o)=>{r.schedule(()=>pr(r.regions,r.screenPoint(s),s,r.categories),n+o*dr)})}function hr(r){return{renderingTimeMillis:r.ms,performanceProfile:r.performanceProfile,seatCount:r.seatCount,objectCount:r.objectCount,sectionCount:r.sectionCount,view:r.view,eventKey:r.eventKey,chartName:r.chartName,floorCount:r.floorCount,transport:r.transport,load:r.load,metricScope:r.metricScope,operationalTelemetryReporter:"sdk"}}function bs(r,e){ye({apiBase:r.apiBase,event:r.eventKey,scope:r.metricScope,surface:r.performanceGroup?"performance_group_picker":"seat_picker",outcome:"success",ms:r.ms,performanceProfile:r.performanceProfile,chartDelivery:r.chartDelivery,seats:r.seatCount,floors:r.floorCount,view:r.view,load:r.load,transport:r.transport}),e("chart_rendered",hr(r))}var vs=require("@seatlayer/core/core/seatConfidence");function Q(r){return String(r??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function ys(r){let e=(0,vs.seatConfidenceDisclosure)(r.seat.confidenceEvidence),t=r.seat.confidenceEvidence,i=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${Q(c)}</li>`).join("")}</ul>`:"",n=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${Q(e.modeledTarget)}</dd></div>`:"",s=t?`<div><dt>Evidence ID</dt><dd>${Q(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${Q(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${Q(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${Q(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${Q(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",o=Le(r.seat.commercial)||r.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${Q(o)}</dd></div>`+(r.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${Q(r.seat.commercial.note)}</dd></div>`:""),l=r.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">${Q(r.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${Q(e.headline)}</strong><span>${Q(e.coverage)} \xB7 ${Q(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${Q(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${Q(e.reality)}</dd></div><div><dt>Source</dt><dd>${Q(e.provenance)}</dd></div>`+a+n+s+`</dl>${i}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function xs(r){return r?r.closest("[data-report]")?"report":r.closest("[data-close]")||r.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function Ti(r,e,t){let i=r?.querySelector("[data-report]"),n=r?.querySelector("[data-report-status]");i&&(i.disabled=e!=="failed",i.textContent=e==="received"?"Report received":"Report this view"),n&&(n.setAttribute("role",e==="failed"?"alert":"status"),n.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function ur(r,e,t=null){let i=r.view3dEl;if(!i)return;Ot(r,!1);let n=e.confidenceEvidence,s=r.controller.seatDetails(e.id),o=document.createElement("div");o.className="sl-view3d-passport-shell",o.innerHTML=ys({seat:e,title:s?.displayLabel??e.displayLabel??e.label,restrictionFallback:r.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof r.api.reportViewEvidence=="function"});let a=[...new Set([...i.children,...[...r.els.map.children].filter(p=>p!==i)])].filter(p=>p instanceof HTMLElement),l=a.map(p=>({element:p,inert:p.inert,ariaHidden:p.getAttribute("aria-hidden")}));for(let p of a)p.inert=!0,p.setAttribute("aria-hidden","true");i.appendChild(o),i.classList.add("has-passport"),r.view3dPassportEl=o;let c=o.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],h=p=>{if(p.key==="Escape"){p.preventDefault(),p.stopPropagation(),p.stopImmediatePropagation(),Ot(r);return}if(p.key!=="Tab")return;let u=d();if(!u.length)return;let b=u[0],m=u[u.length-1];p.shiftKey&&document.activeElement===b?(p.preventDefault(),m.focus()):!p.shiftKey&&document.activeElement===m&&(p.preventDefault(),b.focus())};window.addEventListener("keydown",h,!0),r.view3dPassportCleanup=()=>{window.removeEventListener("keydown",h,!0);for(let m of l)m.element.inert=m.inert,m.ariaHidden===null?m.element.removeAttribute("aria-hidden"):m.element.setAttribute("aria-hidden",m.ariaHidden);let p=t?.isConnected?t:r.confirmEl?.querySelector(".sl-confirm-confidence")??r.view3dCompareEl?.querySelector("[data-passport-seat]")??null,u=p?.closest(".sl-confirm,.sl-view3d-compare");u?.isConnected&&(u.inert=!1,u.removeAttribute("aria-hidden")),o.remove(),i.classList.remove("has-passport"),r.view3dPassportEl===o&&(r.view3dPassportEl=null);let b=p??r.view3dCompareEl?.querySelector("[data-passport-seat]")??r.confirmEl?.querySelector(".sl-confirm-confidence")??r.view3dCompareChip.mainButton();(t?.isConnected?t:b)?.focus()},o.addEventListener("click",p=>{let u=xs(p.target instanceof HTMLElement?p.target:null);u==="close"&&Ot(r),u==="report"&&al(r,e)}),requestAnimationFrame(()=>d()[0]?.focus()),r.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:n?.evidenceId??null,eventConfigurationId:n?.eventConfigurationId??null,modelLevel:n?.modelLevel??"unverified",realityLevel:n?.realityLevel??"none"})}async function al(r,e){if(r.api.reportViewEvidence){Ti(r.view3dPassportEl,"sending");try{let t=await r.api.reportViewEvidence(r.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});r.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),Ti(r.view3dPassportEl,"received",t.report.id)}catch{Ti(r.view3dPassportEl,"failed")}}}function Ot(r,e=!0){let t=r.view3dPassportCleanup;if(r.view3dPassportCleanup=null,!t){r.view3dPassportEl?.remove(),r.view3dPassportEl=null,r.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||r.root?.focus({preventScroll:!0})}function ws(r){let e=r.view3dEl;if(!e||r.view3dCompareSeatIds.length<2)return;Fe(r,!1);let t=r.view3dCompareSeatIds.map(p=>r.view3dComparisonSnapshot(p)).filter(p=>!!p);if(t.length<2){r.clearView3dComparison();return}let i=p=>w(p),n=document.createElement("div");n.className="sl-view3d-compare-shell";let s=t.map((p,u)=>`<article><span>Seat ${u===0?"A":"B"}</span><strong>${i(p.label)}</strong><small>Section ${i(p.section)} \xB7 Row ${i(p.row)}</small><dl><div><dt>Current price</dt><dd>${i(p.price)}</dd></div><div><dt>Ticket type</dt><dd>${i(p.category)}</dd></div><div><dt>Availability</dt><dd>${i(p.availability)}</dd></div><div><dt>View source</dt><dd>${i(p.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${i(p.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${i(p.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${i(p.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${i(p.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${i(p.seat.id)}">Passport</button><button type="button" data-view-seat="${i(p.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${i(p.seat.id)}"${p.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");n.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">Current price and availability come from this picker. Modeled views are chart-derived unless organizer media is labeled; SeatLayer does not invent why a seat has its price.</p><div class="sl-view3d-compare-grid">${s}</div></section>`;let o=document.activeElement instanceof HTMLElement?document.activeElement:null,a=[...e.children].filter(p=>p instanceof HTMLElement),l=a.map(p=>({element:p,inert:p.inert,ariaHidden:p.getAttribute("aria-hidden")}));for(let p of a)p.inert=!0,p.setAttribute("aria-hidden","true");e.appendChild(n),e.classList.add("has-comparison"),r.view3dCompareEl=n;let c=n.querySelector(".sl-view3d-compare"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],h=p=>{if(p.key==="Escape"){p.preventDefault(),Fe(r);return}if(p.key!=="Tab")return;let u=d();if(!u.length)return;let b=u[0],m=u[u.length-1];p.shiftKey&&document.activeElement===b?(p.preventDefault(),m.focus()):!p.shiftKey&&document.activeElement===m&&(p.preventDefault(),b.focus())};window.addEventListener("keydown",h),r.view3dCompareCleanup=()=>{window.removeEventListener("keydown",h);for(let p of l)p.element.inert=p.inert,p.ariaHidden===null?p.element.removeAttribute("aria-hidden"):p.element.setAttribute("aria-hidden",p.ariaHidden);n.remove(),e.classList.remove("has-comparison"),r.view3dCompareEl===n&&(r.view3dCompareEl=null),o?.isConnected?o.focus():r.view3dCompareChip.mainButton()?.focus()},n.querySelector("[data-close]")?.addEventListener("click",()=>Fe(r)),n.querySelectorAll("[data-passport-seat]").forEach(p=>p.addEventListener("click",()=>{let u=p.dataset.passportSeat,b=u?r.allSeats().find(m=>m.id===u):void 0;b&&ur(r,b,p)})),n.querySelectorAll("[data-view-seat]").forEach(p=>p.addEventListener("click",()=>{let u=p.dataset.viewSeat;Fe(r,!1),u&&r.view3dHandle?.flyToSeat(u)})),n.querySelectorAll("[data-select-seat]").forEach(p=>p.addEventListener("click",()=>{let u=p.dataset.selectSeat;u&&ll(r,u)})),requestAnimationFrame(()=>d()[0]?.focus()),r.emit3dAnalytics("3d_comparison_opened",{seatIds:r.view3dCompareSeatIds.slice()})}function Fe(r,e=!0){let t=r.view3dCompareCleanup;if(r.view3dCompareCleanup=null,!t){r.view3dCompareEl?.remove(),r.view3dCompareEl=null,r.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||r.root?.focus({preventScroll:!0})}function ll(r,e){if(r.salesClosed){r.toast(r.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=r.allSeats().find(n=>n.id===e);if(!t)return;if(Fe(r,!1),!r.controller.select([e]).length){r.syncSelectionTo3d(),r.toast(r.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}r.syncSelectionTo3d(),r.showConfirm(t),r.emit3dAnalytics("3d_comparison_selected",{seatId:e})}function ks(r,e){r.querySelector(".sl-view3d-unavailable")?.remove();let{tf:t}=e,i=e.status==="held"?{title:t("picker.temporarilyHeld","Temporarily held"),message:t("picker.heldSeatExplanation","Another buyer is holding this seat. It may become available again.")}:e.status==="booked"?{title:t("picker.sold","Sold"),message:t("picker.soldSeatExplanation","This seat has already been booked.")}:{title:t("picker.notForSale","Not for sale"),message:t("picker.notForSaleExplanation","This seat is not included in the current sale.")},n=document.createElement("div");n.className="sl-view3d-unavailable",n.dataset.state=e.visualState,n.setAttribute("role","status"),n.setAttribute("aria-live","polite");let s=document.createElement("span");s.className="sl-view3d-unavailable-eyebrow",s.textContent=e.location;let o=document.createElement("strong");o.textContent=i.title;let a=document.createElement("div");a.className="sl-view3d-unavailable-copy",a.append(s,o);let l=document.createElement("button");l.type="button",l.setAttribute("aria-label",t("picker.closeSeatStatus","Close seat status")),l.textContent="\xD7";let c=document.createElement("p");c.textContent=i.message,n.append(a,l,c),l.addEventListener("click",()=>mr(r)),r.appendChild(n),Xt(n,e.anchor??null)}function mr(r){let e=r?.querySelector(".sl-view3d-unavailable:not([data-leaving])");e&&(e.dataset.leaving="true",Ee(e))}var It=require("@seatlayer/core");function Ss(r){return Array.isArray(r)?r.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function fr(r,e,t=!1){let i=r.violations[0];return i==="numberOfPlacesToSelect"?r.remaining>0?(0,It.t)("picker.selectExactMore",{count:r.remaining}):(0,It.t)("picker.selectExactCount",{count:r.required}):i==="minimumSelectedPlaces"?(0,It.t)("picker.selectMinimumMore",{count:r.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):i==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,It.t)("picker.orphanHint")}var de=require("@seatlayer/core");function _t(r){let e=Math.max(0,r),t=Math.floor(e/6e4),i=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${i}`}function Ts(r){let e=r.performanceLabel?`<div class="sl-chip-when">${R(r.performanceLabel)}</div>`:"",t=r.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${R(r.performanceDates.summary)}</span><span class="sl-chip-date-list">${r.performanceDates.labels.map(i=>`<span class="sl-chip-date">${R(i)}</span>`).join("")}</span></div>`:"";return e+cl(r)+t}function cl({d:r,area:e,label:t,objectType:i,quantity:n=1,identity:s}){let o=d=>String(d??"\u2014").replace(/[&<>"]/g,h=>({"&":"&","<":"<",">":">",'"':"""})[h]),a=i==="ga"?"ga":r?.objectType??i,l=s?.displayType?.trim()||r?.displayType?.trim()||e?.displayType?.trim()||(a==="table"?g("picker.table","Table"):a==="booth"?g("picker.booth","Booth"):a==="ga"?g("picker.generalAdmission","General admission"):g("picker.row","Row")),c=s?.rowLabel??s?.displayLabel??r?.rowLabel??r?.displayLabel??e?.displayLabel??e?.label??t;return a==="table"&&s?.bookingMode?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(c)}</span></span><span class="fld mid"><span class="sl-chip-eb">${g("picker.guests","Guests")}</span><span class="val">${n}</span></span></div>`:a==="ga"?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(c)}</span></span>`+(n>1?`<span class="fld mid"><span class="sl-chip-eb">${g("picker.tickets","Tickets")}</span><span class="val">${n}</span></span>`:"")+"</div>":a==="booth"?'<div class="sl-chip-id">'+(r?.sectionLabel?`<span class="fld sec"><span class="sl-chip-eb">${g("picker.section","Section")}</span><span class="val">${o(r.sectionLabel)}</span></span>`:"")+`<span class="fld mid"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(c)}</span></span></div>`:!r?.sectionLabel&&!r?.rowLabel&&!r?.seatNumber?`<div class="sl-chip-id"><span class="fld sec"><span class="sl-chip-eb">${g("picker.seat","Seat")}</span><span class="val">${o(c)}</span></span></div>`:'<div class="sl-chip-id">'+(r.sectionLabel?`<span class="fld sec"><span class="sl-chip-eb">${g("picker.section","Section")}</span><span class="val">${o(r.sectionLabel)}</span></span>`:"")+(r.rowLabel?`<span class="fld mid"><span class="sl-chip-eb">${o(l)}</span><span class="val">${o(W(r))}</span></span>`:"")+(r.seatNumber?`<span class="fld mid"><span class="sl-chip-eb">${g("picker.seat","Seat")}</span><span class="val">${o(r.seatNumber)}</span></span>`:"")+"</div>"}function gr(r,e){let t=R(r),i=e?R(e):"";return`<div class="sl-chip-rail"><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>`+(e?`<button type="button" class="view" data-view-label="${i}" aria-label="${R((0,de.t)("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>`:"")+"</div>"}function Cs(r){return r.salesClosed||r.hasHold||r.ctaPhase!=="idle"||r.formOpen||r.room<=0?null:Math.max(1,Math.min(r.wanted,r.room))}function Es({count:r,total:e,pendingCount:t,ctaPhase:i,hasHold:n,salesClosed:s,fromPrice:o,addMore:a,holdTime:l,money:c}){return r&&i==="holding"?`<span>${g("picker.securingSeats","Securing your seats\u2026")}</span>`:r&&i==="checkout"?`<span>${(0,de.t)("picker.peekSecured",{count:r,total:c(e)})}</span>`:r?`<span class="sl-peek-sum">${(0,de.tCount)("picker.ticketsCount",r)}</span>`+(a?`<button type="button" class="go ghost sl-sheet-go sl-sheet-best" data-act="best" aria-label="${g("picker.findTogetherInstead","Find seats together instead")}">\u2726</button>`:"")+`<button type="button" class="go sl-sheet-go" data-act="checkout">${n&&t?g("picker.secureMore","Secure more"):g("picker.continue","Continue")}<span class="sl-peek-total">${c(e)}</span>`+(n&&l?`<span class="sl-peek-time" aria-hidden="true">${l}</span>`:"")+"</button>":s?`<span>${g("picker.salesClosedPill","Sales are closed")}</span>`:o!=null?`<span>${(0,de.t)("picker.peekFromPrice",{price:c(o)})}</span>`:`<span>${g("picker.pickYourSeats","Pick your seats")}</span>`}function br(r,e=Date.now()){return(0,de.t)("picker.holdReassurance",{time:_t(r-e)})}function Ps(r){return r.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${g("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,de.t)("picker.willFindSeatsTogether",{count:r.quantity})}</b><span>${g("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>${g("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${g("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${g("picker.findBestSeatsTogether","Find the best seats together")}</div><div class="sl-ba-copy"><span class="wide">${g("picker.willChooseClosestGroup","We\u2019ll choose the closest available group for you.")}</span><span class="narrow">${g("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")}</span></div>`+(r.offerPremium?`<button type="button" class="sl-ba-premium${r.premium?" on":""}" data-ba-premium aria-pressed="${r.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${g("picker.bestSeatsPremium","Best seats")}</button>`:"")+(r.categories.length>1?`<select aria-label="${R(g("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${R(g("picker.anyTicketType","Any ticket type"))}</option>`+r.categories.map(e=>`<option value="${R(e.key)}"${r.selectedCategory===e.key?" selected":""}>${R(e.label)}</option>`).join("")+"</select>":'<span aria-hidden="true"></span>')+(r.zones.length?`<select aria-label="${g("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${g("picker.anyVenueZone","Any venue zone")}</option>`+r.zones.map(e=>`<option value="${R(e.id)}"${r.selectedZone===e.id?" selected":""}>${R(e.label)}</option>`).join("")+"</select>":"")+`<div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${g("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${r.quantity}</span><button type="button" data-ba="1" aria-label="${g("picker.moreSeats","More seats")}">+</button></div><button type="button" class="sl-ba-go${r.busy?" sl-busy":""}"${r.busy?" disabled":""}>`+(r.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${g("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,de.tCount)("picker.findBestSeatsCount",r.quantity))+"</button>"+(r.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${g("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function As(r){if(r.salesClosed&&!r.hasPicks){let e=r.whenText?`<span class="when">${R(r.whenText)}</span>`:"";return`<div class="sl-closed-note" role="status"><b>${g("picker.salesClosedPill","Sales are closed")}</b><span>${g("picker.salesClosedCopy","Ticket sales for this event have ended.")}${e}</span></div>`}return r.hasPicks?"":r.hasGaAreas?`<div class="sl-tray-hint">${r.seated?r.venue3d?g("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue \u2014 or grab standing tickets below."):g("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below."):r.venue3d?g("picker.gaTrayHintChoose3dArea","Choose an area in the 3D venue to select tickets."):g("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets.")}</div>`:`<div class="sl-tray-hint">${r.groupMode==="per_performance"?g("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):r.groupMode?g("picker.groupTrayHint","Choose seats once \u2014 the same seats will be held for every performance."):r.venue3d?g("picker.trayHintChoose3dOrBest","Choose a seat in the 3D venue, or let us pick the best available for you."):g("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}</div>`}function Ms(r){return{title:(0,de.t)("picker.securedCount",{count:r.secured}),copy:r.pendingCount?(0,de.t)("picker.moreSelectedCount",{count:r.pendingCount}):br(r.expiresAt),change:r.releasing?g("picker.releasingEllipsis","Releasing\u2026"):g("picker.change","Change")}}var Dt=require("@seatlayer/core");var vr=4,dl=6;function pl(r){let e=r.trim();return/^[0-9]{1,4}$/.test(e)?Number(e):null}function Ls(r){return[r.held?"h":"s",r.section,r.rowLabel,r.categoryLabel,r.amountText].join(" ")}function hl(r){if(r.length===1)return r[0];let e=r.map(pl);if(e.every(i=>i!==null)){let i=[...e].sort((o,a)=>o-a);if(i.every((o,a)=>a===0||o===i[a-1]+1))return`${i[0]}\u2013${i[i.length-1]}`;let s=i.slice(0,3).join(", ");return i.length>3?`${s} +${i.length-3}`:s}let t=r.slice(0,3).join(", ");return r.length>3?`${t} +${r.length-3}`:t}function ul(r){let e=[];for(let t of r){let i=e[e.length-1];!!i&&t.groupable&&i.members[0].groupable&&Ls(i.members[0])===Ls(t)?i.members.push(t):e.push({members:[t],seatsLabel:""})}for(let t of e)t.seatsLabel=hl(t.members.map(i=>i.seatLabel));return e}function Rs(r,e,t,i){let n=R;return` data-key="${n(r)}"`+(t.length?` data-held="${n(encodeURIComponent(t.join(`
|
|
2262
|
+
`)))}"`:"")+(e.length?` data-seat="${n(e.join(" "))}"`:"")+(i?` data-locate="${n(i)}"`:"")}function Os(r){let e=R;return`<div class="sl-chip${r.held?" sl-held":""}${r.fresh?" sl-enter":""}"`+Rs(r.key,r.seatIds,r.heldLabels,r.locateId)+`><div class="sl-chip-main">${r.identityHtml}<div class="sl-chip-sub">${r.stateHtml}<span class="cat">${e(r.categoryLabel)}</span>${r.extrasHtml}`+(r.amountText?`<span class="amt">${e(r.amountText)}</span>`:"")+`</div>${r.noteHtml}</div>${r.railHtml}</div>`}function Hs(r,e,t,i,n){let s=R,o=e?.members.length??1,a=o>1,l=e?e.seatsLabel:r.seatLabel,c=e?e.members.reduce((p,u)=>p+u.amount,0):r.amount,d=e?e.members.flatMap(p=>p.seatIds):r.seatIds,h=e?e.members.flatMap(p=>p.heldLabels):r.heldLabels;return`<div class="sl-chip sl-tline${r.held?" sl-held":""}${r.fresh?" sl-enter":""}${e?"":" sl-tsub"}"${i?' data-overflow="true"':""}`+(e?` data-run="${t}"`:` data-run-of="${t}"`)+Rs(r.key,d,h,r.locateId)+">"+(a?`<button type="button" class="sl-trun-toggle" aria-expanded="false" aria-label="${s((0,Dt.tCount)("picker.seatsSelectedCount",o))}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg></button>`:r.held?r.stateHtml:`<span class="sl-tline-dot" style="background:${w(r.categoryColor)}" aria-hidden="true"></span>`)+`<span class="sl-sr">${s(r.categoryLabel)}</span><span class="sl-tline-id"><b>${s(r.section||r.seatLabel)}</b>`+(r.rowLabel?`<i>\xB7</i><span>${s(r.rowLabel)}</span>`:"")+(r.section&&l?`<i>\xB7</i><span>${s(l)}</span>`:"")+"</span>"+r.extrasHtml+(n.suppressPricing||!r.amountText?"":(a?`<span class="sl-tline-mult">${o}\xD7</span>`:"")+`<span class="amt">${s(n.money(c))}</span>`)+(r.railHtml?`<button type="button" class="rm" aria-label="${s(r.removeAria)}"><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 Is(r,e){if(!r.length)return"";let t=ul(r),i=[g("picker.section","Section"),g("picker.row","Row"),g("picker.seat","Seat")].join(" \xB7 "),n=t.length>=dl,s=t.map((a,l)=>{let c=n&&l>=vr;return Hs(a.members[0],a,l,c,e)+(a.members.length>1?a.members.map(d=>Hs(d,null,l,c,e)).join(""):"")}).join(""),o=n?`<button type="button" class="sl-tmore" data-tmore aria-expanded="false" data-more="${R((0,Dt.t)("picker.moreCount",{count:t.length-vr}))}" data-less="${R(g("picker.showLess","Show less"))}"><span>${R((0,Dt.t)("picker.moreCount",{count:t.length-vr}))}</span><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg></button>`:"";return`<div class="sl-tlist"${n?' data-collapsed="true"':""}><div class="sl-tlist-head sl-sr">${R(i)}</div>${s}${o}</div>`}function _s(r){r.dataset.denseWired!=="true"&&(r.dataset.denseWired="true",r.addEventListener("click",e=>{let t=e.target,i=t.closest("[data-tmore]");if(i){let l=i.closest(".sl-tlist"),c=l?.getAttribute("data-collapsed")==="true";l?.setAttribute("data-collapsed",c?"false":"true"),i.setAttribute("aria-expanded",c?"true":"false");let d=i.querySelector("span");d&&(d.textContent=(c?i.dataset.less:i.dataset.more)??d.textContent);return}let n=t.closest(".sl-trun-toggle");if(!n)return;e.stopPropagation();let s=n.closest(".sl-tline"),o=s?.dataset.run;if(!s||o===void 0)return;let a=n.getAttribute("aria-expanded")!=="true";n.setAttribute("aria-expanded",a?"true":"false"),s.setAttribute("data-open",a?"true":"false"),s.parentElement?.querySelectorAll(`.sl-tsub[data-run-of="${o}"]`).forEach(l=>l.setAttribute("data-open",a?"true":"false"))}))}var pt=require("@seatlayer/core");var Ci=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"),this.button.setAttribute("aria-label",t.tf("picker.accessibilityOptions","Accessibility and colour options")),this.button.innerHTML='<span aria-hidden="true">\u267F</span>',this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let i of this.stored())this.offeredFree().has(i)&&this.active.add(i);this.menu.innerHTML=Jn(this.rows()),this.root.append(this.menu,this.button),e.appendChild(this.root),this.button.addEventListener("click",i=>{i.stopPropagation(),this.open(this.menu.hidden)}),this.menu.addEventListener("pointerdown",i=>i.stopPropagation()),this.menu.addEventListener("click",i=>i.stopPropagation()),this.dismiss=()=>this.open(!1),this.escape=i=>{i.key==="Escape"&&this.open(!1)},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),this.wire(),this.active.size&&this.applyFilter()}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:i,count:n})=>[i,n])),t=!1;for(let i of this.menu.querySelectorAll("[data-a11y-row]")){let n=i.dataset.a11yRow??"";if(!n.startsWith("a11y:"))continue;let s=n.slice(5),o=e.get(s);if(o===void 0)continue;let a=i.querySelector(".sl-a11yrow-c");a&&(a.textContent=o==null?"":o>0?(0,pt.t)("picker.accessFreeCount",{count:o}):this.deps.tf("picker.accessNoneLeft","None left"));let l=o===0;i.disabled=l,l?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),l&&this.active.delete(s)&&(this.paint(i,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let i=t.dataset.a11yRow??"";i.startsWith("a11y:")&&this.paint(t,this.active.has(i.slice(5)))}}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),this.root.remove()}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;let t=this.button.getBoundingClientRect();Ni(this.menu,{x:t.left+t.width/2,y:t.top}),Dr(this.menu),Xt(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",icon:"\u25D0",label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",icon:"\u25D0",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:n})=>({key:i,count:n}));let t=this.deps.present;return t?pt.ACCESSIBILITY_TYPES.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(pt.ACCESSIBILITY_TYPES.map(i=>[i.key,i]));return this.offered().flatMap(({key:i,count:n})=>{let s=t.get(i);return s?[{key:`a11y:${i}`,icon:s.icon,label:s.label,...i==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...n==null?{}:{count:n>0?(0,pt.t)("picker.accessFreeCount",{count:n}):this.deps.tf("picker.accessNoneLeft","None left"),disabled:n===0},on:this.active.has(i)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let s=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(s),this.paint(e,s);return}if(t==="limited"){let s=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(s),s&&this.deps.focusSeatsForFilter(),this.paint(e,s);return}let i=t.slice(5),n=!this.active.has(i);n?this.active.add(i):this.active.delete(i),this.paint(e,n),this.applyFilter()})}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(){let e=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(e),this.remember(e),e&&this.deps.focusSeatsForFilter()}key(){return`seatmap.a11y.filter.${this.deps.event}`}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{}}};var Ds=require("@seatlayer/core"),ml=250;function Bs(r,e=ml){let t=null,i=()=>{t===null&&(t=setTimeout(()=>{t=null,r()},e))},n=(0,Ds.attachVisibilityCatchUp)(i),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",i),()=>{t!==null&&(clearTimeout(t),t=null),n(),s&&window.removeEventListener("focus",i)}}var je=require("@seatlayer/core");var Ei=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=(0,je.holdRecoveryShape)(e),i=e.lapsedLabels.length,n=i-e.recoverable.length,s=t==="all"?(0,je.tCount)("picker.holdLapsedStillFree",i):t==="partial"?(0,je.tCount)("picker.holdLapsedSomeTaken",n):(0,je.tCount)("picker.holdLapsedAllTaken",i);this.note={message:s,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(s,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${R(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${R(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(0,je.tCount)("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 $s=Symbol("seatlayer.performance-group-picker");function Ns(r,e){return Object.defineProperty(r,$s,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),r}function zs(r){return r[$s]??null}var He=require("@seatlayer/core");function yr(r,e,t){try{return new Intl.DateTimeFormat(e,{...t,...r.timezone?{timeZone:r.timezone}:{}}).format(new Date(r.startsAt))}catch{return new Date(r.startsAt).toLocaleString(e)}}var Pi=(r,e)=>yr(r,e,{dateStyle:"medium"}),Ai=(r,e)=>yr(r,e,{timeStyle:"short"}),Mi=(r,e)=>yr(r,e,{weekday:"short",day:"numeric",month:"short"});function Vs(r,e,t,i){return!r.length||r.length>=e?null:{summary:i,labels:r.map(n=>`${Pi(n,t)} \xB7 ${Ai(n,t)}`)}}function fl(r,e){let t=new Set(e);return r.map(i=>({...i,free:!t.has(i.eventKey)}))}function Fs(r,e){let t=[...r];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function gl(r,e,t="",i=!1){if(!r.length)return"";let n=r.map(s=>{let o=s.free?e.free:e.blocked,a=i&&s.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${w(s.eventKey)}" aria-label="${w(`${s.shortDate}: ${o}`)}" checked>`:"";return`<li class="sl-night${s.free?" ok":" no"}" aria-label="${w(`${s.shortDate}: ${o}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${w(s.shortDate)}</span><span class="st">${w(o)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${w(e.title)}</div><ul class="sl-nightstrip">${n}</ul><p class="sl-tip-nights-note">${w(e.notAvailableOn)}</p>`+t+"</div>"}function bl(r){return r.selectPartialLabel&&r.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${w(r.selectPartialLabel)}</button>`:r.switchLabel&&r.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${w(r.switchLabel)}</button>`:r.switchLabel||r.selectPartialLabel?"":`<p class="sl-tip-advice">${w(r.advice)}</p>`}function vl(r){return Number(r.available)+Number(r.selected)+Number(r.partial)+Number(r.unavailable)}function js(r,e,t){if(vl(r)<2)return"";let i=(s,o,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${w(o)}</li>`,n=[];return r.available&&n.push(i("sl-pg-sw-free",e.available,` style="background:${w(t)}"`)),r.selected&&n.push(i("sl-pg-sw-sel",e.selected)),r.partial&&n.push(i("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${w(t)}"`)),r.unavailable&&n.push(i("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${w(e.title)}">${n.join("")}</ul>`}function Gs(r,e){if(!r.length)return"";let t=r.map(i=>{let n=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="${w(i.eventKey)}"><span class="n">${w(i.name)}</span><span class="s">${w(n)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${w(e.title)}"><div class="sl-pg-nights-title">${w(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function xr(r,e){if(r?.kind!=="partial"||!e?.length)return null;let t=r.data?.blockedEventKeys??[],i=fl(e,t);return{states:i,missing:i.filter(n=>!n.free).map(n=>n.shortDate)}}function Ks(r,e){return r?gl(r.states,{title:g("picker.group.partlyAvailableTitle","Free on some nights only"),free:g("picker.group.nightFree","Free"),blocked:g("picker.group.nightBlocked","Not available"),notAvailableOn:(0,He.t)("picker.group.notAvailableOn",{dates:Fs(r.missing,e.locale)})},bl({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:g("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function yl(r,e,t,i){if(!r.length)return"";let n=new Set(e),s=new Set(t),o=r.map(a=>{let l=n.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${w(a.eventKey)}" aria-label="${w(`${a.shortDate}: ${l?i.available:i.unavailable}`)}"${l&&s.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${w(a.shortDate)}</span><span class="sl-confirm-date-state">${w(l?i.available:i.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${w(i.title)}</legend><p class="sl-confirm-dates-copy">${w(i.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${w(i.selectAll)}</span></label><ul>${o}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function Us(r,e,t,i){let n=e.availableEventKeys(t);return yl(r,n,e.includedEventKeys(),{title:i("picker.group.confirmDatesTitle","Choose performance dates"),copy:n.length===r.length?i("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(r.length)):i("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(n.length)).replace("{total}",String(r.length)),selectAll:i("picker.group.confirmSelectAll","Select all available dates"),available:i("picker.group.nightFree","Available"),unavailable:i("picker.group.nightBlocked","Unavailable")})}function qs(r){return[...r.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function Ws(r,e,t,i){let n=[...r.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!n.length)return;let s=r.querySelector(".sl-confirm-add"),o=r.querySelector("[data-pg-confirm-all]"),a=()=>{let l=n.filter(h=>!h.disabled),c=qs(r).length;o&&(o.checked=c===l.length,o.indeterminate=c>0&&c<l.length);let d=r.querySelector("[data-pg-confirm-summary]");d&&(d.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),s.disabled=c===0,s.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),i()};n.forEach(l=>l.addEventListener("change",a)),o?.addEventListener("change",()=>{n.filter(l=>!l.disabled).forEach(l=>{l.checked=o.checked}),a()}),a()}async function Ys(r,e,t){if(!r||!t||!r.querySelector("[data-pg-confirm-event-key]"))return!0;let i=qs(r);if(!i.length)return!1;let n=r.querySelector(".sl-confirm-add");return n?.setAttribute("aria-busy","true"),n&&(n.disabled=!0),await t.apply(e,i)?!0:(n?.removeAttribute("aria-busy"),n?.isConnected&&(n.disabled=!1),!1)}function Qs(r,e,t){return r?(0,He.t)("picker.group.seatPartlyAvailable",{label:e,free:r.states.length-r.missing.length,total:r.states.length,dates:Fs(r.missing,t)}):""}function Xs(r,e){let t=r.map((i,n)=>{let s=i.state==="done"?e.done:i.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${w(i.id)}" data-state="${w(i.state)}"${i.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${i.state==="done"?"\u2713":String(n+1)}</span><span class="l">${w(i.label)}</span><span class="sl-pg-sr">${w(s)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${w(e.label)}">${t}</ol>`}function wr(r,e){return`<ul class="sl-pg-cards">${r.map(i=>`<li class="sl-pg-card" data-event-key="${w(i.eventKey)}"><span class="n">${w(i.name)}</span><time datetime="${w(i.iso)}"><span class="d">${w(i.date)}</span><span class="t">${w(i.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${w(e)}</p>`}function Zs(r){let e=r.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${w(t.eventKey)}"><span class="n">${w(t.name)}</span><span class="s">${w(t.labels.length?t.labels.join(", "):r.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${w(r.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(r.note?`<p class="sl-pg-pane-note">${w(r.note)}</p>`:"")+(r.total?`<div class="sl-pg-pane-total"><span>${w(r.total.label)}</span><b>${w(r.total.amount)}</b></div>`:"")+(r.holdStatus?`<p class="sl-pg-hold-status" role="status">${w(r.holdStatus)}</p>`:"")}function Js(r){let e=Math.max(0,r);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function eo(r,e){if(!r||r.seats<=0)return"";if(e==="same_seat"){let t=r.perPerformance??r.seats;return r.totalPerformances&&r.performances<r.totalPerformances?(0,He.tCount)("picker.group.performancesChosenOf",t,{chosen:r.performances,total:r.totalPerformances}):(0,He.tCount)("picker.group.seatsEveryPerformance",t)}return r.perPerformance!=null&&r.performancesChosen===r.performances?(0,He.tCount)("picker.group.seatsPerPerformance",r.seats,{per:r.perPerformance}):(0,He.tCount)("picker.group.performancesChosenOf",r.seats,{chosen:r.performancesChosen,total:r.performances})}function to(r,e){r.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let i=()=>e(t.dataset.eventKey);t.addEventListener("click",i),t.addEventListener("keydown",n=>{n.key!=="Enter"&&n.key!==" "||(n.preventDefault(),i())})})}var io=require("@seatlayer/core");function fe(r){return String(r??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function xl(r,e){let t=r.objectType==="table"&&!!r.bookingMode,i=r.objectType==="booth",n=t||i||!r.seatNumber,s=n?r.rowLabel??r.displayLabel??r.label:r.seatNumber,o=t?`${g("picker.guests","Guests")} ${r.bookingMode==="variable"?`${r.minOccupancy}\u2013${r.maxOccupancy}`:r.capacity}`:!i&&r.rowLabel?`${e} ${W(r)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${n?" name":""}">${fe(s)}</span>`+(o?`<span class="sl-tip-row">${fe(o)}</span>`:"")+"</div>"+(r.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${g("picker.section","Section")}</span><span class="sl-tip-secname">${fe(r.sectionLabel)}</span></div>`:"")+"</div>"}function ro(r,e){let t=r.status==="not_for_sale",i=r.mark?.kind==="partial",n=r.status==="free"||i?"":`<span class="sl-tip-tag">${t?g("picker.notAvailable","Not available"):r.status==="held"?(0,io.t)("map.statusHeld"):g("picker.sold","Sold")}</span>`,s=t?"":e.price,o=s?`<span class="sl-tip-amt">${fe(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${fe(e.priceNote)}</div>`:"",l=Le(r.commercial),c=l?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u25D0</span>${fe(l)}</div>`:"",d=ct(r.wheelchairSpaceType),h=d?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u267F</span>${fe(d)}</div>`:"",p=e.reason?`<div class="sl-tip-reason">${fe(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+xl(r,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${fe(r.categoryColor)}"></span><span class="sl-tip-name">${fe(r.categoryLabel)}</span>`+n+o+"</div>"+a+p+h+c+(e.extra??"")}function no(r,e,t,i){let n=r.x+14,s=r.y-i.height-12,o=r.y+18,a=s;n+i.width>e-8&&(n=r.x-i.width-14),s<8&&o+i.height<=t-8&&(a=o);let l=Math.max(8,t-i.height-8);return{left:Math.max(8,Math.min(n,Math.max(8,e-i.width-8))),top:Math.max(8,Math.min(a,l))}}function so(r,e,t,i=22){let n=Math.max(8,Math.min(r.x-t.width/2,Math.max(8,e.width-t.width-8))),s=r.y-i-t.height,o=r.y+i;return s>=8?{left:n,top:s,placement:"above"}:o+t.height<=e.height-8?{left:n,top:o,placement:"below"}:{left:n,top:Math.max(8,Math.min(s<8?o:s,Math.max(8,e.height-t.height-8))),placement:s<8?"below":"above"}}function oo(r,e,t,i){let n=t.width/2+12,s=Math.max(n,Math.min(e.width-n,r.x)),o=r.y+t.height+24<=e.height,a=r.y<t.height+24&&o?"below":"above",l=i&&a==="above"?Math.max(t.height+24,r.y):r.y;return{left:s,top:Math.max(8,Math.min(e.height-8,l)),placement:a}}function ao(r,e,t){let i=r.querySelector("[data-pg-select-partial]"),n=[...r.querySelectorAll("[data-pg-event-key]")],s=()=>n.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),o=()=>{if(!i)return;let a=s().length;i.disabled=a===0,i.textContent=e?.(a)??i.textContent};n.forEach(a=>{a.addEventListener("change",o);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,o())})}),i?.addEventListener("click",()=>{let a=s();a.length&&t?.(a)})}function ht(r){let e=r?.displayType?.trim()||r?.rowType?.trim();return e||(r?.objectType==="table"?g("picker.table","Table"):r?.objectType==="booth"?g("picker.booth","Booth"):g("picker.row","Row"))}var lo="@seatlayer/pending-checkout/v1";function wl(r){return typeof r=="string"&&r.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(r)}function co(r){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 n=window.sessionStorage.getItem(lo);if(n){let s=null;try{s=JSON.parse(n)}catch{}if(s&&wl(s.orderId)){let o=Date.now()-Number(s.storedAt);if(o>=0&&o<=144e5){if(s.eventKey&&s.eventKey!==r)return null;i=s.orderId}}}window.sessionStorage.removeItem(lo)}catch{}e.delete("seatlayer_checkout");try{let n=e.toString();history.replaceState(history.state,"",`${location.pathname}${n?`?${n}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:i}}function po(r){if(!r.framed)return null;let e=r.ancestorOrigins?.length?r.ancestorOrigins[0]:null;for(let t of[e,r.referrer])if(t)try{return new URL(t).origin}catch{}return null}var kl="https://api.seatlayer.io",Sl=10,ho=6e4,uo=6e4,Tl=160,fo="seatmap.a11y.cb";function Cl(){try{if(typeof window>"u")return null;let r=window.localStorage.getItem(fo);return r==null?null:r==="1"}catch{return null}}function El(r){try{window.localStorage.setItem(fo,r?"1":"0")}catch{}}var ut=class r{constructor(e){this.realtime=null;this.accessEl=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.holdTimer=null;this.toastTimer=null;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.bookedEl=null;this.gaQty=new Map;this.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.confirmEl=null;this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedReport=null;this.confirmSeat=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.baReopen=!1;this.bestAvailableConfirm=!1;this.releasingHold=!1;this.salesClosed=!1;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.projectionEl=null;this.buyerView="map";this.view3dEl=null;this.view3dHandle=null;this.view3dGen=0;this.view3dReturnSeat=null;this.view3dTargetSeatId=null;this.view3dCompareSeatIds=[];this.view3dCompareChip=new xi({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.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.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 Ei({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.holdCopyPending=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalScrim=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.lastCatAvail=null;this.lastAvailFloorId="";this.availQuietUntil=0;this.liveTimer=null;this.perspectiveWarned=!1;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=zs(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??kl).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?Yt({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??tt(e,t),this.pubApi=e.transport?null:i?.api??new Te(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=e.transport??this.pubApi,this.buyerAssetUrls=new nt(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 n=e.numberOfPlacesToSelect;if(n!=null&&(!Number.isInteger(n)||n<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=n??null;let s=Ss(e.selectionValidators);if(this.exactTickets!=null&&s>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let o=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(Sl,s)));if(this.exactTickets!=null&&o<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&o<s)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??o,this.cbSafe=Cl()??!!e.colorblindSafe,this.controller=this.wireController(e)}get lastSection(){return this.sectionCard.summary}set lastSection(e){this.sectionCard.adopt(e)}chartHasStage(){let e=this.controller.doc;if(!e)return!1;let t=e.floors?.length?e.floors.map(i=>i.objects??[]):[e.objects??[]];for(let i of t)for(let n of i)if(n.type==="shape"&&(n.role==="stage"||n.stageKind))return!0;return!1}confirmThumbHtml(e){let t=this.controller.doc;if(!t)return"";let i=this.deliverableViewReference(e)?e.viewUrl??"":"",n=this.chartHasStage();if(!i&&!n)return"";let s=null;if(!i)try{s=(0,C.generateSeatThumb)(e,e.focalPoint??t.focalPoint).distanceM??null}catch{return""}let o=n&&s!=null?`<div class="sl-confirm-sight">${R((0,C.t)("picker.sightline",{m:s}))}</div>`:"",a=R((0,C.t)("picker.viewFromSeat",{label:e.label})),l=R(this.tf("picker.viewFromHere","View from here"));return(i?`<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>`:`<button type="button" class="sl-confirm-view sl-confirm-viewbtn" aria-label="${a}"><span aria-hidden="true">\u{1F52D}</span><span>${l}</span></button>`)+o}deliverableViewReference(e){let t=e.viewMeta?.previewUrl??e.viewUrl;return t&&(Ki(t)||rt(t))?t:null}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=po({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()}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),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))}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e}),e&&!this.fsEscHandler?(this.fsEscHandler=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){st();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let n=document.createElement("div");n.className="sl-modal-frame",n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.setAttribute("aria-label",g("picker.seatSelection","Seat selection")),n.tabIndex=-1,i.appendChild(n),document.body.appendChild(i);let s=document.body.style.overflow;document.body.style.overflow="hidden";let o=new r({...e,container:n});o.modalScrim=i,o.prevFocus=t;let a=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),l=()=>{let b=[...n.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(m=>m.isConnected&&!m.closest('[hidden], [aria-hidden="true"], [inert]'));return b[b.length-1]??n},c=(b,m)=>{let v=b;for(;v;){let x=window.getComputedStyle(v);if(v.hidden||v.getAttribute("aria-hidden")==="true"||v.hasAttribute("inert")||x.display==="none"||x.visibility==="hidden"||x.visibility==="collapse")return!0;if(v===m)return!1;v=v.parentElement}return!0},d=b=>[...b.querySelectorAll(a)].filter(m=>m.tabIndex>=0&&!m.matches(":disabled")&&!c(m,b)),h=(b,m)=>{let v=d(b),x=m?v[v.length-1]:v[0];x?x.focus({preventScroll:!0}):(b.hasAttribute("tabindex")||(b.tabIndex=-1),b.focus({preventScroll:!0}))},p=!1,u=()=>{if(p)return;p=!0,document.body.style.overflow=s,o.escHandler&&document.removeEventListener("keydown",o.escHandler),i.remove(),o.modalScrim=null;let b=o.prevFocus;o.prevFocus=null,b?.isConnected&&b.focus({preventScroll:!0});let m=()=>{o.destroy(),e.onClose?.()};o.hold&&!o.handedOff?o.release().finally(m):m()};return o.closeModal=u,i.addEventListener("mousedown",b=>{b.target===i&&u()}),o.escHandler=b=>{if(b.key==="Tab"){if(b.defaultPrevented)return;let m=l(),v=d(m),x=v[0],T=v[v.length-1],A=document.activeElement;!x||!T?(b.preventDefault(),h(m,b.shiftKey)):A===m||!A||!m.contains(A)?(b.preventDefault(),(b.shiftKey?T:x).focus({preventScroll:!0})):b.shiftKey&&A===x?(b.preventDefault(),T.focus({preventScroll:!0})):!b.shiftKey&&A===T&&(b.preventDefault(),x.focus({preventScroll:!0}));return}b.key==="Escape"&&(o.tableDialog?(b.preventDefault(),o.cancelTableDialog()):o.confirmSeat?(b.preventDefault(),o.cancelConfirm()):o.bestAvailableConfirm?(b.preventDefault(),o.bestAvailableConfirm=!1,o.syncTray()):(b.preventDefault(),u()))},document.addEventListener("keydown",o.escHandler),await o.render(),o.els.close?.classList.add("on"),o.els.close?.addEventListener("click",u),h(l(),!1),o}wireController(e){return new C.PickerController({transport:this.api,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:at(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let i=this.controller.getGAAreas().find(n=>n.id===t);i&&(this.collapseSheet(),ji(this,i,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:()=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onHoldExpired:()=>{this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.lapse.deferExpiryToast(()=>this.toast((0,C.t)("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning")),this.syncTray(),this.emitHoldChange(),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.tf("picker.salesClosedToast","Sales are closed for this event."),"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.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{this.confirmSeat?.id===t.id&&this.dismissConfirm(),this.tableDialog?.physicalSeatIds.includes(t.id)&&this.dismissTableDialog()},onSelectionLimit:()=>{this.toast((0,C.t)("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>this.opts.onError?.(t)})}async render(){if(this.rendered)return this;let e=performance.now(),t={},i=E=>Math.round((performance.now()-E)*100)/100;this.rendered=!0,st();let n=performance.now(),s=On(this.opts.locale,this.opts.messages),o=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=ln(this.opts.container),{root:c,els:d,mapHost:h}=Hn(l,(E,O)=>this.tf(E,O),this.opts.theme);this.root=c,this.els=d,this.mapHost=h,In(c,s,E=>{t.loadLocale=i(n),this.destroyed||this.applyActiveLocale(E,o)}),ds(c,()=>[{open:()=>this.tipPinned,close:()=>this.unpinTooltip()},{open:()=>!!this.tableDialog,close:()=>this.cancelTableDialog()},{open:()=>!!this.confirmSeat,close:()=>this.cancelConfirm()},{open:()=>this.bestAvailableConfirm,close:()=>{this.bestAvailableConfirm=!1,this.syncTray()}}]),this.syncFullscreenButtons(),this.wireBuyerShell(c);let p=document.createElement("div");p.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(p),t.mountBuyerShell=i(a),t.skeletonPaint=i(e);let u=await this.loadChart(p,t,i);if(!u)return this;t.shellsPaint=i(e),this.dismissSkeleton();let b=performance.now();if(this.startRealtime(),this.salesClosed=!!u.salesClosed||!!this.opts.readOnly,c.dataset.eventMode=u.mode==="test"?"test":"live",!this.opts.locale&&u.locale&&this.setLocale(u.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),u.mode==="test"){let E=document.createElement("div");E.className="sl-testbadge",E.textContent=(0,C.t)("picker.testMode"),E.setAttribute("aria-label",(0,C.t)("picker.testMode")),this.regions["top-left"].appendChild(E)}let m=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(c),this.watchThemeMode(),this.currency=u.currency??this.opts.currency??"USD",this.eventTimezone=u.timezone??null,cn(this.els.logo,[this.opts.theme?.logoUrl,m?.logoUrl,u.posterUrl],this.opts.theme?.brandName??m?.brandName??u.eventName??"?"),this.els.name.textContent=u.eventName??"";let v=u.startsAt?ii(u.startsAt,u.timezone??null,this.opts.locale):"";this.eventWhenText=v||null,this.els.meta.textContent=[u.venue,v].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(m);let x=!!this.controller.doc&&this.controller.getExpandedSeats().some(E=>E.commercial?.restrictedView||E.commercial?.obstructedView);this.buildAccessibilityMenu(x),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"),c.appendChild(this.srEl),this.buildArenaChrome(),this.buildMinimap(),this.buildPriceFilter(),this.buildExtendPrompt(),this.buildBookedOverlay(),this.buildSoldoutOverlay(),this.buildPanelToggle(),this.opts.panelCollapsed&&this.setPanelCollapsed(!0),this.dockLayoutChrome(),t.buildBuyerControls=i(b);let T=performance.now();this.restoreRememberedHold().then(()=>{t.restoreHold=i(T)}),this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let A=this.controller.doc,f=ci(this.opts.event),y=this.performanceGroup?"performance_group":"event",S={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:y,performanceGroup:!!this.performanceGroup,ms:i(e),performanceProfile:t,chartDelivery:u.chartDelivery,seatCount:this.allSeats().length,objectCount:A?.objects.length??0,sectionCount:A?.objects.filter(E=>E.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:A?.name,view:this.buyerView,load:f,transport:this.opts.transport?"custom":"pubapi"};bs(S,(E,O)=>this.emitAnalytics(E,O));let L=u.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",hr({...S,performanceProfile:{...S.performanceProfile,...L}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=u,await this.registerAgentTools(),this}registerAgentTools(){return fs(this)}webMcpHost(e){return cr(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=Bs(()=>{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.zoomToFit()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let n=this.els.sheetToggle,s=c=>{e.dataset.sheet=c?"open":"peek",n?.setAttribute("aria-expanded",String(c)),n?.setAttribute("aria-label",c?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))};s(e.dataset.sheet==="open"),n?.addEventListener("click",c=>{c.stopPropagation(),s(e.dataset.sheet!=="open")}),this.els.peek?.addEventListener("click",c=>{let d=c.target.closest(".sl-sheet-go");d&&(c.stopPropagation(),d.dataset.act==="checkout"?this.handleCta():d.dataset.act==="best"?(this.baReopen=!0,this.baQty=Math.max(1,Math.min(this.baQty,this.maxTickets-this.totalTicketCount())),this.syncTray(),s(!0),this.els.tray?.querySelector(".sl-ba-go")?.focus()):s(!0))});let o=0,a=!1,l=!1;t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard,.sl-sheet-toggle,.sl-sheet-go")){l=!1;return}l=!0,a=!1,o=c.clientY,t.setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!l||a)return;let d=c.clientY-o;d<-18?(s(!0),a=!0):d>18&&(s(!1),a=!0)}),t.addEventListener("pointerup",c=>{l&&!a&&Math.abs(c.clientY-o)<6&&s(e.dataset.sheet!=="open"),l=!1,t.releasePointerCapture?.(c.pointerId)})}let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let n=this.root.getAttribute("data-prices-open")==="true";if(this.root.setAttribute("data-prices-open",String(!n)),this.els.pricesSec?.setAttribute("aria-expanded",String(!n)),!n&&this.root.dataset.sheet!=="open"){this.root.dataset.sheet="open";let s=this.els.sheetToggle;s?.setAttribute("aria-expanded","true"),s?.setAttribute("aria-label","Collapse ticket panel")}};this.els.pricesSec?.addEventListener("click",n=>{n.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",n=>{n.key!=="Enter"&&n.key!==" "||n.target.closest("select,button")||(n.preventDefault(),i())}),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",n=>{this.handleMapPointerDown(n)},!0),this.els.map.addEventListener("mousemove",n=>{if(this.tipPinned)return;let s=this.els.map.getBoundingClientRect();this.tipPos={x:n.clientX-s.left,y:n.clientY-s.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.handleCta()}),this.els.holdChange?.addEventListener("click",()=>{this.handleChangeSeats()})}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||(e.dataset.sheet="peek",this.els.sheetToggle?.setAttribute("aria-expanded","false"),this.els.sheetToggle?.setAttribute("aria-label",this.tf("picker.openTicketPanel","Open ticket panel")))}observeLayout(e){let t=()=>{let i=e.clientWidth;if(i<=0)return;let n=e.clientHeight,s=i!==this.pickerLayoutSize.width||n!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:n},this.reportFramedHeight();let o=i<640?"narrow":"wide",a=n<560?"compact":"comfortable";(e.dataset.layout!==o||e.dataset.density!==a)&&(e.dataset.layout=o,e.dataset.density=a,o==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.lastTrayKeys.size&&this.syncTray()),s&&(this.minimap?.refreshMinimap(),this.fitSectionStripCount())};this.ro=new ResizeObserver(t),this.ro.observe(e),t(),requestAnimationFrame(t)}async loadChart(e,t,i){let n=performance.now(),s=await this.controller.render(e);return t.loadChartAndStatuses=i(n),this.destroyed?null:s?(Object.assign(t,s.performanceProfile),s):(ye({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?"performance_group":"event",surface:this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:Ae(this.opts.event),transport:this.opts.transport?"custom":"pubapi"}),this.els.boot.innerHTML=`<div class="sl-boot-title">${this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load")}</div><div>${this.tf("picker.checkConnection","Check your connection and try again.")}</div><button type="button" class="sl-boot-retry">${this.tf("picker.accessRetry","Try again")}</button>`,this.els.boot.querySelector("button").addEventListener("click",()=>{let o=this.opts.container,a=this.opts;this.destroy(),new r({...a,container:o}).render()}),null)}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=co(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.regions["bottom-left"]??this.els.map;t&&(this.a11yMenu=new Ci(t,{event:String(this.opts.event),needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(i,n)=>this.tf(i,n),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.controller.setAccessibilityFilter(i),this.syncPrices(),this.minimap?.refreshMinimap()},focusSeatsForFilter:()=>this.focusSeatsForFilter()}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}setAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e)}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 n=this.els.pricesSec;n&&(e?(n.setAttribute("role","button"),n.tabIndex=0,n.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(n.removeAttribute("role"),n.removeAttribute("aria-expanded"),n.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){let e=document.createElement("div");e.className="sl-extend",e.setAttribute("role","status"),e.innerHTML='<span class="sl-extend-txt" data-ref="extendTxt"></span><button type="button" class="sl-extend-btn" data-ref="extendBtn"></button>',(this.regions["bottom-center"]??this.els.map).appendChild(e),this.extendEl=e,this.els.extendTxt=e.querySelector('[data-ref="extendTxt"]'),this.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),this.els.extendBtn.textContent=this.tf("picker.addTime","Add time"),this.els.extendBtn.addEventListener("click",()=>{this.handleExtend()})}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>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]')}get onGAPromptHook(){return this.opts.onGAPrompt}tf(e,t){return g(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 n=document.createElement("div");n.className="sl-soldout-title",n.textContent=this.tf("picker.soldOutTitle","Sold out");let s=document.createElement("p");s.className="sl-soldout-copy",s.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(i,n,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,n=this.isSoldOut(e,t,i);n!==this.soldOut&&(this.soldOut=n,this.soldoutEl?.classList.toggle("on",n))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(n=>(t[n.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();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.tf("picker.salesClosedPill","Sales are closed")}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.tf("picker.salesClosedToast","Sales are closed for this event.")),this.syncCta(),this.syncTray()}badgeHidden(e){return!!(this.opts.hideBadge||e?.hideBadge)}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let i=document.createElement("a");i.className="sl-powered",i.href="https://seatlayer.io/?ref=picker",i.target="_blank",i.rel="noopener noreferrer",i.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let n=document.createElement("span");n.className="sl-powered-mark",n.setAttribute("aria-hidden","true"),n.innerHTML=Jt;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),i.append(n,s),t.appendChild(i)}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){if(this.reducedMotion())return;let t=(e.items??[]).filter(i=>i.objectType!=="ga").slice(0,10).map(i=>this.controller.seatByLabel(i.label)).filter(i=>!!i);gs({regions:this.els,categories:this.controller.doc?.categories,pop:i=>this.controller.flashSeat(i,this.cssVar("--sl-accent")||"#f4b740"),focus:(i,n)=>this.controller.focusSection(i,n),screenPoint:i=>this.controller.worldToScreen(i),schedule:(i,n)=>this.scheduleMotion(i,n)},t)}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(){let e=this.hold?.items??[],t=new Set(e.map(n=>n.label));return this.committedSelection().filter(n=>!t.has(n.label)).reduce((n,s)=>n+(s.quantity??1),0)+ze(this.gaQty,this.hold?.items??[])}heldTicketCount(){return(this.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}totalTicketCount(){let e=new Set((this.hold?.items??[]).map(i=>i.label)),t=this.committedSelection().filter(i=>!e.has(i.label)).reduce((i,n)=>i+(n.quantity??1),0);return this.heldTicketCount()+t+ze(this.gaQty,this.hold?.items??[])}updateSelectionCapacity(){let e=new Set((this.hold?.items??[]).map(n=>n.label)),t=this.committedSelection().filter(n=>e.has(n.label)).reduce((n,s)=>n+(s.quantity??1),0),i=Math.max(0,this.maxTickets-this.heldTicketCount()-ze(this.gaQty,this.hold?.items??[]));this.controller.setMaxSelection(t+i)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){let i=this.els.cta;if(!i)return;if(this.salesClosed){i.disabled=!0,i.textContent=this.tf("picker.salesClosedCta","Sales closed");return}if(this.confirmSeat||this.tableDialog&&!this.tableDialogHeld){i.disabled=!0,i.textContent=this.tableDialog?this.tf("picker.confirmYourTable","Confirm your table"):this.tf("picker.confirmOrCancelSeat","Confirm or cancel this seat");return}if(this.ctaPhase==="holding"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(this.ctaPhase==="checkout"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let n=!this.hold&&this.performanceGroup?.selectionMode==="per_performance"?this.performanceGroup.submissionState?.():null;if(n&&!n.ready){i.disabled=!0,i.textContent=this.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(n.complete)).replace("{total}",String(n.total));return}let s=this.controller.getSelectionValidity(e);if(s&&!s.isValid){i.disabled=!0,i.textContent=fr(s,(o,a)=>this.tf(o,a),!0);return}i.disabled=e===0,i.textContent=this.hold?t?(0,C.t)("picker.secureMoreAndCheckout",{count:t}):this.tf("picker.continueToCheckout","Continue to checkout"):e?this.performanceGroup?this.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(this.performanceGroup.performanceCount)):this.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):this.tf("picker.selectSeats","Select seats")}setCtaPhase(e){this.ctaPhase=e,this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount()),e==="checkout"&&this.scheduleMotion(()=>{this.ctaPhase==="checkout"&&(this.ctaPhase="idle",this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount()))},1100)}holdStorageKey(){return`@seatlayer/hold/v1/${encodeURIComponent(this.apiBase)}/${encodeURIComponent(this.opts.event)}`}rememberedHoldId(){if(this.opts.initialHoldId)return this.opts.initialHoldId;if(this.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(this.holdStorageKey())}catch{return null}}rememberHold(e){if(!(this.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(this.holdStorageKey(),e.holdId)}catch{}}forgetHold(){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(this.holdStorageKey())}catch{}}async resumeHoldFromServer(e,t){try{let i=await this.controller.resumeHold(e);if(!i||this.destroyed)return null;let n={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return this.hold=n,this.handedOff=!0,this.bookedShown=!1,this.ctaPhase="idle",this.startHoldTimer(n.expiresAt),this.rememberHold(n),this.syncTray(),this.emitHoldChange(),this.opts.onHoldRestored?.(n,n.seats??[],this.buildHandoff(n)),t&&this.toast(this.tf("picker.heldTicketsRestored","Your held tickets have been restored."),"success"),n}catch(i){let n=i?.status;return n===404||n===409?this.forgetHold():this.opts.onError?.(i),null}}async restoreRememberedHold(){let e=this.rememberedHoldId();e&&await this.resumeHoldFromServer(e,!0)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let i=this.controller.getActiveFloorId();return(t.find(n=>n.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){this.els.map&&(this.minimap=rs({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label},this.regions["bottom-left"]??this.els.map))}catPrice(e){return ki(this,e)}catPriceRange(e){return Si(this,e)}buildPriceFilter(){if(this.suppressPricing||!this.els.prices||!this.els.pricesSec)return;let e=Pn(this.controller.doc?.categories??[],this.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",this.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let i=document.createElement("option");i.value="all",i.textContent=this.tf("picker.allPrices","All prices"),t.appendChild(i);for(let n of e){let s=document.createElement("option");s.value=n.id,s.textContent=n.label,t.appendChild(s)}this.els.pricesSec.appendChild(t),t.addEventListener("change",()=>{let s=e.find(o=>o.id===t.value)?.keys??null;this.focusedCatKey=null,this.priceBandKeys=s?new Set(s):null,this.controller.setCategoryFilter(s),this.controller.focusCategoryFilter(s),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)})}buildArenaChrome(){let e=this.controller.doc;if(!e||!this.els.map)return;let t=e.objects.some(i=>i.type==="section")||(e.floors??[]).some(i=>i.objects.some(n=>n.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.innerHTML=`<button type="button" data-view="map" aria-pressed="true" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,i.querySelectorAll("button").forEach(n=>{if(n.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])n.addEventListener(s,Wi,{once:!0});n.addEventListener("click",()=>{this.setBuyerView(n.dataset.view)})}),this.regions["top-right"].appendChild(i),this.projectionEl=i,this.syncProjection()}if(t){let i=[...e.objects,...(e.floors??[]).flatMap(d=>d.objects)],n=new Set((e.zones??[]).map(d=>d.id)),o=i.some(d=>d.type==="section"&&typeof d.zone=="string"&&n.has(d.zone))?["zones","sections","seats"]:["sections","seats"],a=document.createElement("div");a.className="sl-rungs on sl-mo-indicator",a.setAttribute("role","group"),a.setAttribute("aria-label",(0,C.t)("picker.zoomLevel"));let l={zones:(0,C.t)("picker.rungLabel.zones"),sections:(0,C.t)("picker.rungLabel.sections"),seats:(0,C.t)("picker.rungLabel.seats")},c={zones:(0,C.t)("picker.rungTip.zones"),sections:(0,C.t)("picker.rungTip.sections"),seats:(0,C.t)("picker.rungTip.seats")};a.innerHTML=o.map(d=>`<button type="button" data-rung="${d}" title="${c[d]}" aria-pressed="false">${l[d]}</button>`).join(""),a.querySelectorAll("button").forEach(d=>{d.addEventListener("click",()=>{let h=d.dataset.rung;this.controller.setRung(h),h==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(a),this.rungsEl=a,this.syncRung()}if(this.controller.isMultiFloor()){let i=es({floors:this.controller.getFloors(),tf:(n,s)=>this.tf(n,s),onChoose:n=>{n===""?this.controller.setFloorOverview(!0):this.controller.setFloor(n),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});this.regions["left-rail"].appendChild(i),this.floorsEl=i,this.syncFloors()}}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(i=>{let n=i.dataset.rung===e;i.classList.toggle("on",n),i.setAttribute("aria-pressed",String(n))})}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?this.tf("picker.priceHint3d","Colours in the venue are ticket types \u2014 choose one below to show just those seats."):this.tf("picker.priceHint","Colours on the map are ticket types \u2014 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||!ei()?!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)?uo/2:uo}syncFloors(){ts(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new vi({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),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()}fitSectionStripCount(){this.sectionCard.fitStripCount()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(n=>n.type==="section"&&!this.controller.isSectionClosed(n.id)&&this.controller.getSectionSeatCount(n.id)>0);if(t.length<2)return null;let i=t.findIndex(n=>n.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}markedSeatAnnouncement(e){let t=xr(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return Qs(t,e.displayLabel??e.label,this.opts.locale)}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),n=this.controller.getStatus(e.id)??"free",s=n==="free"?this.tf("picker.statusAvailable","available"):n==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),o=i?this.catPriceRange(i):void 0,a=o?o.min===o.max?this.money(o.min):`${this.money(o.min)}\u2013${this.money(o.max)}`:void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=ht(c),h=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,p=l?`${d} ${h}, ${l.bookingMode==="variable"?(0,C.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,C.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${h}`:c?.objectType==="table"?`${d} ${h}, ${(0,C.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,C.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${p}, ${i?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let n=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),s=e.bookingMode==="variable",o=document.createElement("div");o.className="sl-table-scrim",o.innerHTML=Xn(e,{variable:s,held:t,typeWord:ht(e),categoryLabel:n?.label??e.categoryKey,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(o),this.tableDialogEl=o,this.renderTableDialogState(),o.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()})}),o.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),o.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),o.addEventListener("mousedown",a=>{a.target===o&&this.cancelTableDialog()}),o.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...o.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(()=>o.querySelector(s?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let i=t.querySelector("output[data-table-qty]");i&&(i.value=String(e.quantity));let n=t.querySelector("input[data-table-qty]");n&&(n.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let s=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),o=t.querySelector("[data-table-total]");o&&(o.textContent=this.money(s*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let i=this.tableDialogEl?.querySelector(".sl-table-confirm");if(i&&(i.disabled=!0,i.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let n=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!n){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:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items},this.startHoldTimer(n.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,C.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(n){this.opts.onError?.(n),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())}showConfirm(e){let t=this.confirmSeat?.id;this.confirmEl?.remove(),this.confirmEl=null,this.confirmSeat=e,this.root?.setAttribute("data-confirming","true"),this.els.side?.toggleAttribute("inert",!0),Object.values(this.regions).forEach(y=>y.toggleAttribute("inert",!0)),this.controller.setSelectionFocus(e.id),t&&t!==e.id&&this.controller.deselect([t]),this.tipEl&&(this.tipEl.style.display="none");let i=this.controller.seatDetails(e.id),n=this.controller.doc?.categories.find(y=>y.key===e.categoryKey),s=i?.price??(n?.tiers?.length?n.tiers[0].price:n?.price),o=s!=null?this.paidPrice(e.categoryKey,i?.tierId??n?.tiers?.[0]?.id??null,s,e.label):void 0,a=Gn(i,e.displayLabel??e.label,ht(i)),l=i?.tiers??n?.tiers??[],c=i?.tierId??l[0]?.id,d=qn(l,c,y=>this.money(this.paidPrice(e.categoryKey,y.id,y.price,e.label))),h=this.buyerView==="venue3d",p=this.performanceGroup?.confirmDateSelection??void 0,u=p?this.performanceGroup?.nights?.()??[]:[],b=p?Us(u,p,e.id,(y,S)=>this.tf(y,S)):"",m=document.createElement("div");m.className="sl-confirm sl-mo-in",b&&m.classList.add("sl-confirm-group-dates"),m.setAttribute("role","dialog"),m.setAttribute("aria-label",(0,C.t)("picker.confirmSeatLabel",{label:e.label}));let v=n?.color??"#6e7bff",x=Yi(v,this.cssVar("--sl-surface")||"#1a2234",.76)??v;m.style.setProperty("--sl-cat",v),m.style.setProperty("--sl-cat-ink",Me(x,"#172033","#ffffff"));let T=String(i?.categoryLabel??n?.label??e.categoryKey);m.innerHTML=Qn({identityFields:a,identity:Kn(i,e.displayLabel??e.label,ht(i)),marker:bi(i?.wheelchairSpaceType),see3dPill:Un(this.canOffer3d(),h),categoryColor:n?.color??"#6e7bff",categoryLabel:T,priceLabel:o!=null?this.money(o):"",tierChoices:d,groupDates:b,wheelchair:zn(i?.wheelchairSpaceType),commercial:Nn(e.commercial),thumb:this.seatViewEnabled()&&this.buyerView!=="venue3d"?this.confirmThumbHtml(e):"",inspect:h?`${jn(e,`${i?.displayLabel??e.displayLabel??e.label} \xB7 ${o==null?this.tf("picker.priceNotSupplied","Price not supplied"):this.money(o)}`,h)}<div class="sl-confirm-inspect-row">${Fn(e,h?this.view3dCompareSeatIds:null)}${nr(this.canOffer3d(),h)}</div>`:nr(this.canOffer3d(),h),cancelLabel:(0,C.t)("common.cancel"),selectLabel:this.tf("picker.select","Select")}),this.els.map.appendChild(m),this.confirmEl=m;let A=m.querySelector(".sl-confirm-thumb"),f=A?.closest(".sl-confirm-thumbwrap")??null;if(A&&f){let y=!1,S=()=>{if(y||!f.isConnected)return;y=!0;let E=()=>{f.remove(),this.confirmEl===m&&this.reanchorConfirm()};if(this.reducedMotion()||typeof requestAnimationFrame!="function"){E();return}f.style.height=`${f.offsetHeight}px`,f.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{f.style.height="0px",f.style.opacity="0"}),setTimeout(E,Tl)};A.addEventListener("error",S),A.addEventListener("load",()=>{A.naturalWidth||S()});let L=e.viewMeta?.previewUrl??e.viewUrl;L?this.buyerAssetUrls.resolve(L).then(E=>{if(!(!m.isConnected||this.confirmEl!==m)){if(!E){S();return}A.src=E}}).catch(E=>{S(),this.opts.onError?.(E)}):S()}this.reanchorConfirm(),m.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{this.openSeatView(e)}),m.querySelector(".sl-confirm-confidence")?.addEventListener("click",y=>{this.openSeatConfidencePassport(e,y.currentTarget instanceof HTMLElement?y.currentTarget:null)}),m.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>this.saveView3dComparisonSeat(e)),m.querySelectorAll("[data-confirm-tier]").forEach(y=>{y.addEventListener("click",()=>{let S=y.dataset.confirmTier,L=l.find(O=>O.id===S);if(!L)return;this.controller.setSeatTier(e.id,L.id),m.querySelectorAll("[data-confirm-tier]").forEach(O=>{O.setAttribute("aria-pressed",String(O===y))});let E=m.querySelector(".sl-confirm-price");E&&(E.textContent=this.money(this.paidPrice(e.categoryKey,L.id,L.price,e.label))),this.reanchorConfirm()})}),m.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill").forEach(y=>{y.addEventListener("pointerdown",Wi,{once:!0}),y.addEventListener("click",()=>{this.buyerView==="venue3d"?(this.dismissConfirm(),this.view3dHandle?.flyToSeat(e.id)):(this.view3dReturnSeat=e,this.dismissConfirm(),this.enter3d(e.id))})}),Ws(m,p,(y,S)=>this.tf(y,S),()=>this.reanchorConfirm()),m.querySelector(".sl-confirm-add").addEventListener("click",()=>{this.commitConfirm()}),m.querySelector(".sl-confirm-cancel").addEventListener("click",()=>this.cancelConfirm()),requestAnimationFrame(()=>m.querySelector(".sl-confirm-add")?.focus())}reanchorConfirm(){if(!this.confirmEl||!this.confirmSeat||this.root?.dataset.view3d==="on")return;let e=this.controller.worldToScreen({x:this.confirmSeat.x,y:this.confirmSeat.y});if(this.root?.dataset.layout==="narrow"){_r(this.confirmEl,e,this.els.map);return}let t=this.els.map.clientWidth,i=this.els.map.clientHeight,n=this.confirmEl.offsetWidth||276,s=this.confirmEl.offsetHeight||230,o=this.confirmEl.classList.contains("sl-confirm-group-dates"),a=oo(e,{width:t,height:i},{width:n,height:s},o);this.confirmEl.dataset.placement=a.placement,this.confirmEl.style.left=`${a.left}px`,this.confirmEl.style.top=`${a.top}px`,Qt(this.confirmEl,e,{left:a.left,top:a.top,width:n,height:s})}dismissConfirm(){this.confirmEl&&Ee(this.confirmEl),this.confirmEl=null,this.confirmSeat=null,this.root?.removeAttribute("data-confirming"),Object.values(this.regions).forEach(e=>e.toggleAttribute("inert",!1)),this.applyPanelCollapsed(),this.controller.setSelectionFocus(null)}async commitConfirm(){let e=this.confirmSeat;e&&await Ys(this.confirmEl,e.id,this.performanceGroup?.confirmDateSelection??void 0)&&(this.confirmSeat&&this.dismissConfirm(),this.collapseSectionCard(),pr(this.els,this.controller.worldToScreen(e),e,this.controller.doc?.categories),this.syncTray(),this.syncSelectionTo3d())}cancelConfirm(){let e=this.confirmSeat;e&&(this.controller.deselect([e.id]),this.confirmSeat&&this.dismissConfirm(),this.syncSelectionTo3d(),this.root?.focus({preventScroll:!0}))}closeConfirm(){this.dismissConfirm()}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,n=this.controller.getActiveFloorId(),s=e.focalPoint??i?.floors?.find(h=>h.id===n)?.focalPoint??i?.focalPoint??{x:0,y:0},o,a,l=!1;if(e.viewUrl){let h,p=null;try{let b=e.viewMeta?.previewUrl;b&&b!==e.viewUrl?(p=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&&!p||!this.root||!this.seatViewEnabled())return;let u={url:h,...p?{previewUrl:p}:{},...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}:{}};o=u,a=(0,Bt.seatViewDisclosure)(u),l=(0,Bt.isAuthoredSeatView)(u)}else{let h;try{let{generateSeatPanorama:p}=await ti();h=p(e,s,this.allSeats())}catch(p){t===this.seatViewGen&&this.opts.onError?.(p);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;o={url:h.url,generated:!0},a=(0,C.t)("picker.illustrationCaption",{m:h.distanceM})}this.closeSeatView(!1);let c=(0,C.t)("picker.viewFromSeat",{label:e.label}),d=si({root:this.root,source:o,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:this.tf("picker.dragToLookAround","Drag to look around \xB7 scroll to zoom"),viewFromSeatLabel:c,real360Label:(0,C.t)("picker.real360"),previewLabel:(0,C.t)("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}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let i=Number.isInteger(e);return(0,C.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(n,s)=>`${n} ${s}`,...i?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),i=Ln(e,t);if(i==null)return;let n=6*36e5,s=Math.min(Math.max(i-t+1e3,1e3),n);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},s)}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}async refreshOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;let i=fi(t);if(!i)return;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i);let n=gi(i),s={...this.hostPricing?.prices??{},...n},o=Object.keys(s).length>0||this.hostPricing?.formatter?{prices:s,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(o),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){return e?this.offerAvailability?.prices.find(t=>t.categoryKey===e)??null:null}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;let t=this.offerAvailability,i=t?.release??null,n=i?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!n){e.classList.remove("has"),e.replaceChildren();return}let s=i??n,o=document.createElement("div");o.className="sl-offer-main";let a=document.createElement("div");a.className="sl-offer-copy";let l=document.createElement("span");l.className="sl-offer-kicker",l.textContent=i?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let c=document.createElement("strong");c.className="sl-offer-name",c.textContent=s.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let d=document.createElement("span");d.className="sl-offer-line";let h=[];i&&t.fromPrice!=null&&h.push(this.money(t.fromPrice/100)),i&&s.remaining!=null&&h.push((0,C.t)("picker.offerRemainingAvailable",{count:s.remaining})),i&&s.endsAt!=null&&h.push((0,C.t)("picker.offerUntil",{time:ii(s.endsAt,this.eventTimezone,this.opts.locale)})),n?.startsAt!=null&&h.push((0,C.t)("picker.offerStarts",{time:ii(n.startsAt,this.eventTimezone,this.opts.locale)})),d.textContent=h.join(" \xB7 "),a.append(l,c,d);let p=document.createElement("details");p.className="sl-offer-info";let u=document.createElement("summary");u.setAttribute("aria-label",(0,C.t)("picker.howOfferWorks",{name:c.textContent??""})),u.textContent="i";let b=document.createElement("div");b.className="sl-offer-detail",b.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."),p.append(u,b),o.append(a,p),e.replaceChildren(o),e.classList.add("has")}paidPrice(e,t,i,n){let s=n?this.channelByObject.get(n):void 0;if(s&&e){let a=this.pricesByChannel.get(s)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let o=e?this.opts.pricing?.prices?.[e]:void 0;return o===void 0?i:typeof o=="number"?o:t&&o.tiers?.[t]!==void 0?o.tiers[t]:o.base??i}legendDeps(){return{colorOf:e=>this.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>this.catPriceRange(e),priceOf:e=>this.catPrice(e),offerOf:e=>this.offerPrice(e),money:e=>this.money(e),esc:R}}syncPriceRail(e,t,i=this.legendDeps()){let n=this.els.railScroll,s=e.length>1;this.els.rail?.classList.toggle("has",s),n&&(n.innerHTML=s?En({...i,categories:e,left:t,activeKey:this.focusedCatKey,soldOutWord:this.tf("picker.soldOut","Sold out")}):"",n.querySelectorAll(".sl-rc").forEach(o=>{o.addEventListener("click",()=>this.focusCategory(o.dataset.cat??""))}),this.railEdgesBound||(this.railEdgesBound=!0,n.addEventListener("scroll",()=>tr(n),{passive:!0})),requestAnimationFrame(()=>tr(n)))}syncPrices(){let e=this.controller.doc;if(!e||!this.els.prices)return;let t=this.controller.categoryAvailability(),i=e.categories.filter(h=>!h.notForSale);this.narrateAvailability(i,t),this.syncSoldout(i,t);let n=this.legendDeps(),s=this.suppressPricing,o=s?{...n,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:n;s&&(this.els.pricesSec?.querySelector("span")?.replaceChildren(this.tf("picker.seatCategories","Seat categories")),this.els.pricesHint?.remove()),this.syncPriceRail(i,t,o);let a=5,l=i.length-a,c=l>1&&!this.pricesExpanded,d=c?i.slice(0,a):i;this.els.prices.classList.toggle("sl-expanded",l>1&&this.pricesExpanded),this.els.prices.innerHTML=Cn({...o,categories:d,left:t,collapsed:c,activeKey:this.focusedCatKey,bandKeys:this.priceBandKeys,leftCount:h=>(0,C.tCount)("picker.leftCount",h),titleFor:(h,p)=>p?this.tf("picker.showAllSeats","Show all seats"):(0,C.t)("picker.showLabelSeatsOnMap",{label:h.label}),moreLabel:l>1?c?s?this.tf("picker.showAllCategories","Show all categories"):(0,C.t)("picker.showAllTicketTypes",{count:i.length}):this.tf("picker.showFewer","Show fewer"):null,status:{legend:this.tf("picker.seatStatusLegend","Seat status legend"),held:this.tf("picker.temporarilyHeld","Temporarily held"),sold:this.tf("picker.sold","Sold")}}),this.els.prices.querySelectorAll(".sl-price-row").forEach(h=>{h.addEventListener("mouseenter",()=>this.controller.getRenderer()?.setCategoryHighlight?.(h.dataset.cat??null)),h.addEventListener("mouseleave",()=>this.controller.getRenderer()?.setCategoryHighlight?.(null));let p=()=>this.focusCategory(h.dataset.cat??"");h.addEventListener("click",p),h.addEventListener("keydown",u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),p())})}),this.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{this.pricesExpanded=!this.pricesExpanded,this.syncPrices()})}focusCategory(e){if(!e)return;let t=this.focusedCatKey===e?null:e;this.focusedCatKey=t,this.priceBandKeys=t?new Set([t]):null;let i=this.els.pricesSec?.querySelector(".sl-price-select");i&&(i.value="all"),this.controller.setCategoryFilter(t?[t]:null),this.controller.focusCategoryFilter(t?[t]:null),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)}narrateAvailability(e,t){let i=this.els.liveText,n=this.lastCatAvail;this.lastCatAvail={...t};let s=this.controller.getActiveFloorId();if(s!==this.lastAvailFloorId&&(this.lastAvailFloorId=s,this.availQuietUntil=performance.now()+2e3),!(!i||!n||performance.now()<this.availQuietUntil))for(let o of e){let a=n[o.key],l=t[o.key]??0;if(a===void 0||l>=a)continue;let c=a-l;i.textContent=(0,C.tCount)("picker.seatsJustTakenInCategory",c,{label:o.label,left:l}),this.els.live?.classList.remove("on"),this.els.live?.offsetWidth,this.els.live?.classList.add("on"),this.liveTimer&&clearTimeout(this.liveTimer),this.liveTimer=setTimeout(()=>this.els.live?.classList.remove("on"),8e3);return}}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(i=>!e.has(i.label)&&(this.controller.getStatus(i.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(i=>i.id)),this.toast((0,C.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:i,heldLabels:n,heldCount:s,total:o,count:a}=wi(this),l=[],c=new Set;if(!this.salesClosed){let f=this.performanceGroup?.nightSummary?.()??[];f.length&&l.push(Gs(f,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let y=this.performanceGroup?.selectionModeSwitch;y&&l.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${R(y.label)}</button>`)}l.push(As({salesClosed:this.salesClosed,hasPicks:e.length>0||i.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(f=>f.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0}));let d=!e.length&&!i.length&&!ze(this.gaQty,this.hold?.items??[]);if(d&&(this.baReopen=!1),!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm)){let f=(this.controller.doc?.categories??[]).filter(S=>!S.notForSale),y=this.controller.getBestAvailableZones();this.baZone&&!y.some(S=>S.id===this.baZone)&&(this.baZone=""),l.push(Ps({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:this.baReopen,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:f,zones:y,selectedCategory:this.baCat,selectedZone:this.baZone}))}let h=(f,y,S,L=1,E,O)=>Ts({d:f?this.controller.seatDetails(f):null,area:S==="ga"?t.find(V=>V.id===E):void 0,label:y,objectType:S,quantity:L,identity:O,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),p=R,u=[];for(let f of jr(i)){let y=f.objectType==="ga"?`held:ga:${f.objectId}:${f.tierId??""}`:`held:${f.label}`;c.add(y);let S=this.controller.doc?.categories.find(F=>F.key===f.categoryKey),L=f.tierId?S?.tiers?.find(F=>F.id===f.tierId)?.name:void 0,E=f.objectType!=="ga"?this.controller.seatByLabel(f.label):null,O=f.objectType==="table"?this.controller.tableSelection(f.label):null,V=E?this.controller.seatDetails(E.id):null,he=this.seatViewEnabled()&&!!E&&f.objectType!=="table",le=p(this.tf("picker.heldForYou","Held for you")),re=(O?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${p(encodeURIComponent(f.label))}">${p((0,C.t)("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+bi(E?.wheelchairSpaceType)+rr(E?.commercial),ne=this.paidPrice(f.categoryKey,f.tierId,f.unitPrice,f.label)*(f.quantity??1);u.push({key:y,fresh:!this.lastTrayKeys.has(y),held:!0,seatIds:[],heldLabels:f.labels,removeAria:(0,C.t)("picker.removeHeldTicketLabel",{label:Fi(f,t)}),locateId:E?.id??null,section:V?.sectionLabel??"",rowLabel:V&&W(V)||"",seatLabel:V?.seatNumber??f.label,categoryLabel:`${S?.label??f.categoryKey}${L?` \xB7 ${L}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??S?.color??"",identityHtml:h(E?.id??null,f.label,f.objectType,f.quantity??1,f.objectId,O??void 0),stateHtml:`<span class="sl-ticket-state held" aria-label="${le}" title="${le}"><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:re,amount:ne,amountText:this.suppressPricing?"":this.money(ne),noteHtml:"",railHtml:this.performanceGroup?"":gr((0,C.t)("picker.removeHeldTicketLabel",{label:Fi(f,t)}),he?f.label:null),groupable:!re&&!!V?.sectionLabel&&!this.performanceGroup})}let b=this.seatViewEnabled();for(let f of e.filter(y=>!n.has(y.label))){let y=`seat:${f.id}`;c.add(y);let S=this.controller.doc?.categories.find(F=>F.key===f.categoryKey),L=f.tiers&&f.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${p(f.id)}" aria-label="${p((0,C.t)("picker.ticketTierFor",{label:f.label}))}">`+f.tiers.map(F=>`<option value="${p(F.id)}"${F.id===f.tierId?" selected":""}>${p(F.name)} \xB7 ${p(this.money(this.paidPrice(f.categoryKey,F.id,F.price,f.label)))}</option>`).join("")+"</select>":"",E=f.tiers?.find(F=>F.id===f.tierId)??f.tiers?.[0],O=E?.buyerMessage?.trim()||(E?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),V=this.controller.seatDetails(f.id),he=p(this.tf("picker.selected","Selected")),le=(0,C.t)("picker.removeSeatLabel",{label:f.label}),re=(f.objectType==="table"&&f.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${p(encodeURIComponent(f.label))}">${p((0,C.t)("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+bi(f.wheelchairSpaceType)+rr(f.commercial)+L,ne=this.paidPrice(f.categoryKey,f.tierId??null,f.price,f.label)*(f.quantity??1);u.push({key:y,fresh:!this.lastTrayKeys.has(y),held:!1,seatIds:[f.id],heldLabels:[],locateId:f.id,section:V?.sectionLabel??"",rowLabel:V&&W(V)||"",seatLabel:V?.seatNumber??f.label,categoryLabel:S?.label??f.categoryKey,identityHtml:h(f.id,f.label,f.objectType,f.quantity??1,f.objectId,f),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??S?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${he}" title="${he}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:re,amount:ne,amountText:this.suppressPricing?"":this.money(ne),removeAria:le,noteHtml:O?`<small class="sl-tier-note">${p(O)}</small>`:"",railHtml:gr(le,b&&f.objectType!=="table"?f.label:null),groupable:!re&&!O&&!!V?.sectionLabel&&!this.performanceGroup})}u.length&&l.push(this.root?.dataset.layout==="narrow"?Is(u,{money:f=>this.money(f),suppressPricing:this.suppressPricing}):u.map(Os).join("")),t.length&&l.push(Wr(this,t,i)),!this.performanceGroup&&!this.salesClosed&&!this.hold&&!d&&!this.baReopen&&!this.bestAvailableBusy&&!this.bestAvailableConfirm&&l.push(`<button type="button" class="sl-ba-reopen" data-ba-reopen><span aria-hidden="true">\u2726</span>${p(this.tf("picker.findTogetherInstead","Find seats together instead"))}</button>`),this.els.tray.innerHTML=l.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=c,_s(this.els.tray),this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let m=this.performanceGroup?.selectNight;m&&to(this.els.tray,f=>m(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.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-reopen]")?.addEventListener("click",()=>{this.baReopen=!0,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-close]")?.addEventListener("click",()=>{this.baReopen=!1,this.syncTray(),this.els.tray.querySelector("[data-ba-reopen]")?.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 y=f.closest(".sl-chip");if(y.dataset.held){this.removeHeldLabels(decodeURIComponent(y.dataset.held).split(`
|
|
2263
|
+
`),y);return}let S=y.dataset.seat.split(" "),L=this.controller.getSelection().find(O=>O.id===S[0])?.label??this.tf("picker.seat","Seat"),E=()=>{this.controller.deselect(S),this.toast((0,C.t)("picker.labelRemoved",{label:L}),"neutral",{label:this.tf("picker.undo","Undo"),onClick:()=>{let O=this.controller.select(S);this.toast(O.length?(0,C.t)("picker.labelRestored",{label:L}):(0,C.t)("picker.labelNoLongerAvailable",{label:L}),O.length?"success":"warning")}})};if(this.reducedMotion()){E();return}y.classList.remove("sl-enter"),y.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(E,U.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(f=>{f.addEventListener("click",y=>{y.stopPropagation();let S=decodeURIComponent(f.dataset.tableEdit??""),L=this.controller.tableSelection(S);if(!L)return;let E=i.find(O=>O.label===S&&O.objectType==="table");this.showTableDialog({...L,quantity:E?.quantity??L.quantity},!!E,f)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(f=>{f.addEventListener("change",()=>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 y=this.controller.seatByLabel(f.dataset.viewLabel);y&&this.openSeatView(y)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(f=>{let y=()=>this.controller.flashSeat(f.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");f.addEventListener("mouseenter",y),f.addEventListener("focusin",y)}),Yr(this,this.els.tray,t),this.controller.setGASelection(zr(this.gaQty)),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(f=>{f.disabled=!0});let v=this.pendingSelectionCount(),x=this.lastTrayCount,T=this.lastTrayTotal,A=eo(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");if(this.els.count.textContent=A||(a?(0,C.tCount)("picker.ticketsCount",a):this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=a&&!this.suppressPricing?this.money(o):"",this.root?.setAttribute("data-has-selection",String(a>0)),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy||this.baReopen)),this.els.foot?.classList.toggle("empty",a===0),this.els.seatSummary&&(this.els.seatSummary.textContent=A||(a?(0,C.tCount)("picker.seatsSelectedCount",a):"")),this.syncCta(a,v),this.hold){this.holdCopyPending=v>0;let f=Ms({secured:s||this.hold.seats?.length||0,pendingCount:v,expiresAt:this.holdExpiresAt,releasing:this.releasingHold});this.els.holdTitle&&(this.els.holdTitle.textContent=f.title),this.els.holdCopy&&(this.els.holdCopy.textContent=f.copy);let y=this.els.holdChange;y&&(y.disabled=this.releasingHold,y.textContent=f.change)}a!==x&&this.animateOnce(this.els.count,"sl-value-pop",380),o!==T&&this.animateOnce(this.els.total,"sl-value-pop",380),x===0&&a>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.renderPeek(a,o,v,a>x),this.lastTrayCount=a,this.lastTrayTotal=o,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(a,e)}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)}renderPeek(e,t,i,n=!1){if(!this.els.peek)return;let s=(this.controller.doc?.categories??[]).map(o=>this.catPrice(o)).filter(o=>o!=null);this.els.peek.innerHTML=Es({count:e,total:t,pendingCount:i,ctaPhase:this.ctaPhase,hasHold:!!this.hold,salesClosed:this.salesClosed,fromPrice:s.length?Math.min(...s):null,addMore:Cs({salesClosed:this.salesClosed,hasHold:!!this.hold,ctaPhase:this.ctaPhase,formOpen:this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm,room:this.maxTickets-this.totalTicketCount(),wanted:this.baQty}),holdTime:this.hold&&this.holdTimer?_t(Math.max(0,this.holdExpiresAt-Date.now())):null,money:o=>this.money(o)}),this.root&&(this.root.dataset.peekClock=String(!!this.els.peek.querySelector(".sl-peek-time"))),n&&this.animateOnce(this.els.peek.querySelector(".sl-peek-sum")??void 0,"sl-peek-bump",240)}async removeHeldLabels(e,t){let i=e.filter(o=>o&&!this.releasingLabels.has(o));if(!i.length)return!1;let n=i[0];i.forEach(o=>this.releasingLabels.add(o)),t?.setAttribute("aria-busy","true");let s=t?.querySelector(".rm");s&&(s.disabled=!0);try{let o=this.handedOff;if(!await this.controller.releaseLabels(i))return this.toast((0,C.t)("picker.couldNotRemoveLabel",{label:n}),"error"),!1;Gr(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&&o,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),this.toast((0,C.t)("picker.labelRemovedFromHold",{label:n}),"success"),!0}finally{i.forEach(o=>this.releasingLabels.delete(o)),t?.removeAttribute("aria-busy"),s?.isConnected&&(s.disabled=!1)}}async handleChangeSeats(){if(!this.hold||this.releasingHold)return;this.releasingHold=!0;let e=this.els.holdChange;e&&(e.disabled=!0,e.textContent=this.tf("picker.releasingEllipsis","Releasing\u2026"));try{await this.release(),this.hold||this.toast(this.tf("picker.heldTicketsReleased","Held tickets released. Choose your new seats."),"success")}finally{this.releasingHold=!1,e?.isConnected&&(e.disabled=!1,e.textContent=this.tf("picker.change","Change"))}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(fr(e,(i,n)=>this.tf(i,n)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast((0,C.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(i=>!(this.hold.items??[]).some(n=>n.label===i.label))){let i=this.hold.seats??t;this.handedOff=!0,this.setCtaPhase("checkout"),this.checkoutHandoff(this.hold,i);return}this.holdingLabels=new Set(t.map(i=>i.label)),this.setCtaPhase("holding");try{let i=null,n=Nr(this.gaQty),s=this.committedSelection();if(s.length){let o=await this.controller.hold(void 0,this.opts.holdTtlMs);i=o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}for(let{areaId:o,tierId:a,qty:l}of n){let c=await this.controller.holdGA(o,l,{tierId:a,ttlMs:this.opts.holdTtlMs});i=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:i}if(!i){this.toast(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again."),"error"),this.setCtaPhase("idle"),this.syncTray();return}this.hold=i,this.handedOff=!this.performanceGroup,this.startHoldTimer(i.expiresAt),this.flashHeldSeats(i),this.setCtaPhase(this.performanceGroup?"idle":"checkout"),this.emitHoldChange(),this.performanceGroup||this.checkoutHandoff(i,i.seats??s)}catch(i){this.opts.onError?.(i);let n=i,s=(n.conflicts??[]).map(a=>a.label).filter(Boolean).slice(0,3);n.reason==="event_closed"&&this.setSalesClosed(!0);let o=n.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):n.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):n.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s.length?s.length===1?(0,C.t)("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):(0,C.t)("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.toast(o,"error"),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){this.stopHoldTimer(),this.holdExpiresAt=e,this.hold&&this.rememberHold(this.hold);let t=this.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${this.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let i=t.querySelector('[data-ref="holdTime"]');this.els.holdNote?.classList.add("on");let n=()=>{let s=Math.max(0,this.holdExpiresAt-Date.now());i&&(i.textContent=_t(s));let o=this.els.peek?.querySelector(".sl-peek-time");o&&(o.textContent=_t(s)),!this.holdCopyPending&&this.els.holdCopy&&this.root?.dataset.layout!=="narrow"&&(this.els.holdCopy.textContent=br(this.holdExpiresAt)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=ho),this.setExtendPrompt(s>0&&s<=ho,s),(s<=0||!this.controller.currentHold())&&this.stopHoldTimer()};this.holdTimer=setInterval(n,500),n()}stopHoldTimer(){this.holdTimer&&clearInterval(this.holdTimer),this.holdTimer=null,this.els.hold?.classList.remove("on","is-expiring"),this.els.holdNote?.classList.remove("on"),this.root&&delete this.root.dataset.peekClock,this.setExtendPrompt(!1,0)}setExtendPrompt(e,t){if(this.extendEl)if(e&&this.controller.currentHold()&&!this.bookedShown){let i=Math.ceil(t/1e3),n=Math.floor(i/60),s=String(i%60).padStart(2,"0");this.els.extendTxt.innerHTML=(0,C.t)("picker.seatsHeldForNeedMoreTime",{time:`${n}:${s}`}),this.extendEl.classList.add("on")}else this.extendEl.classList.remove("on")}async handleExtend(){let e=this.els.extendBtn;e.disabled=!0;let t=e.textContent;e.textContent=this.tf("picker.addingEllipsis","Adding\u2026");try{let i=await this.controller.extendHold(this.opts.holdTtlMs);i?(this.hold={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items},this.holdExpiresAt=i.expiresAt,this.extendEl?.classList.remove("on"),this.rememberHold(this.hold),this.emitHoldChange(),this.toast(this.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")):this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=t}}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&this.showBooked()}showBooked(){if(this.bookedShown||!this.hold)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((n,s)=>n+s.quantity,0),i=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=i?.seats?`<span class="sl-booked-seats">${(0,C.tCount)("picker.group.ticketsConfirmedAcross",i.seats,{performances:i.performances})}</span>`:`<span class="sl-booked-seats">${(0,C.tCount)("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.bookedEl?.classList.add("on"),this.opts.onBooked?.(e)}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()}checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){this.startHostedCheckout(e,t);return}this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let i=this.buildHandoff(e),n=null;try{n=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(o){this.opts.onError?.(o)}if(this.destroyed)return;let s=n?.providers?.[0];if(!s){let o=pn(n?.reason),a=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:o,handoff:i}),this.opts.onCheckout?.(e,t,i),a||this.openCheckoutPanel({kind:"unavailable",reason:o,seatCount:i.lineItems.reduce((l,c)=>l+c.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:s,order:{holdId:i.holdId,expiresAt:i.expiresAt,currency:i.currency,total:i.total,labels:i.lineItems.map(o=>o.displayLabel??o.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await dn())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 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,formatMoney:i=>this.money(i),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=>this.opts.onError?.(i)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let i=(e.items??[]).map(o=>{let a=this.controller.lineItemDisplay(o);return{label:o.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},objectId:o.objectId,objectType:o.objectType,categoryKey:o.categoryKey,tierId:o.tierId,unitPrice:this.paidPrice(o.categoryKey,o.tierId,o.unitPrice,o.label),currency:o.currency??this.currency,quantity:o.quantity??1}}),n=i[0]?.currency??this.currency,s=i.reduce((o,a)=>o+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:n,lineItems:i,total:s}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",i){let n=this.els.toast;if(!n)return;n.replaceChildren();let s=document.createElement("span");if(s.textContent=e,n.appendChild(s),n.classList.toggle("has-action",!!i),i){let o=document.createElement("button");o.type="button",o.className="sl-toast-action",o.textContent=i.label,o.addEventListener("click",i.onClick,{once:!0}),n.appendChild(o)}n.dataset.tone=t,n.classList.add("on","sl-mo-rise"),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{n.classList.remove("on","sl-mo-rise"),n.classList.remove("has-action"),n.dataset.tone="neutral"},4200)}dismissSkeleton(){cs({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?so(this.tipPos,e,t):null,n=i??no(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${n.left}px`,this.tipEl.style.top=`${n.top}px`,i?this.tipEl.dataset.placement=i.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let i=this.performanceGroup,n=xr(e.mark,i?.nights?.()),s=n?.states.filter(o=>o.free).length??0;return Ks(n,{locale:this.opts.locale,switchLabel:i?.selectionModeSwitch?.label??null,selectPartialLabel:i?.partialSeatSelection?.label(s)??null,pinned:t})}unavailableReason(e){return!e.unavailable||e.mark?.kind==="partial"?"":e.status==="held"?this.tf("picker.heldByOther","Held by another buyer \u2014 may become available"):e.status==="not_for_sale"?this.tf("picker.notForSaleExplanation","This seat is not included in the current sale."):e.status==="free"?"":this.tf("picker.soldSeatExplanation","This seat has already been booked.")}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()}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.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}let i=this.unavailableReason(e),n=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t)||!!i&&e.interaction==="press";this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let s=this.nightStripFor(e,n);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=ro(e,{price:this.suppressPricing?"":this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label)),priceNote:this.suppressPricing?this.tf("picker.group.pricesPerPerformance","Prices shown per performance"):"",rowTypeWord:ht(e),reason:i,extra:s+(n?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${R(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=n,this.tipEl.classList.toggle("sl-tip-pinned",n),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),ao(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,o=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,o)}),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[n,s]of Object.entries(e())){let o=this.controller.idForLabel(n);o&&(i[o]=s)}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(n=>t.has(n.id)||t.has(n.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,!1)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=Pt(this.themeMode),i=At(this.controller.doc?.theme,this.opts.theme,t);for(let[n,s]of Object.entries(i))e.style.setProperty(n,s);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=hi(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(at(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:Pt(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Pt(this.themeMode),i=At(this.controller.doc?.theme,this.opts.theme,t),n=at(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,s=bn(i,n);for(let o of["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text"])s?e.style.setProperty(o,s[o]):e.style.removeProperty(o)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),i=JSON.stringify(e??null);t!==i&&(this.opts.pricing=e,!(this.destroyed||!this.els.prices)&&(this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=_n(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=(0,C.getLocale)(),i=this.localeGeneration+=1,n=await(0,C.loadLocale)(e);return this.opts.messages&&(0,C.setStringOverrides)(this.opts.messages),n===t||this.applyActiveLocale(n,i),n}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&Dn(e,{root:this.root,painters:[()=>this.syncTray(),()=>this.syncPrices(),()=>this.syncOffer(),()=>this.syncRung(),()=>this.syncFloors(),()=>this.syncPanelToggle(),()=>this.syncFullscreenButtons()],refreshMapCopy:()=>this.controller.refreshMapCopy(),languageSelect:this.langSel})}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(),El(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"}getBuyerView(){return this.buyerView}setBuyerView(e,t){if(e==="map"){this.exit3d();return}let i=t?.flyToSeatId;if(this.buyerView==="venue3d"){i?(this.opts.onBuyerViewChange?.({view:"venue3d",seatId:i}),this.view3dHandle?.flyToSeat(i)):t?.resetView&&this.view3dHandle?.focusOverview();return}this.enter3d(i)}seatState3dFor(e){switch(this.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return this.priceBandKeys!=null&&!this.priceBandKeys.has(e.categoryKey)||this.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}pushAvailabilityTo3d(){if(!this.view3dHandle)return;let e=this.allSeats().map(t=>({seatId:t.id,state:this.seatState3dFor(t)}));this.view3dHandle.setAvailability(e)}syncSelectionTo3d(){this.view3dHandle&&this.view3dHandle.setSelection(this.controller.getSelection().map(e=>e.id))}async seatViewFor3d(e){let t=this.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,n=!!i&&i!==t.viewUrl,s=n?await this.buyerAssetUrls.resolve(i):null,o=n?t.viewUrl:await this.buyerAssetUrls.resolve(t.viewUrl);return!o||n&&!s?null:{url:o,...s?{previewUrl:s}:{},...n?{resolveUrl:a=>this.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 this.opts.onError?.(i),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:this.tf("picker.chartDerivedModel","Chart-derived model")}}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,{...t,surface:"buyer"})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}onView3dSeatPick(e){if(this.salesClosed){this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),this.syncSelectionTo3d();return}let t=this.allSeats().find(a=>a.id===e);if(!t)return;let i=this.controller.tableSelection(e);if(this.committedSelection().some(a=>i?a.label===i.label:a.id===e)){this.controller.deselect([e]),this.dismissConfirm(),this.syncSelectionTo3d();return}let s=this.controller.getStatus(t.id);if(s==="held"||s==="booked"||s==="not_for_sale"){this.showUnavailable3dSeat(t,this.seatState3dFor(t),s),this.syncSelectionTo3d();return}if(this.dismissUnavailable3dSeat(),!this.controller.select([e]).length){this.syncSelectionTo3d(),this.dismissConfirm();return}if(this.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),this.flashPickedSeat(e),i){this.showTableDialog(i,!1),this.syncSelectionTo3d();return}this.opts.confirmSelection!==!1?this.showConfirm(t):this.syncTray(),this.syncSelectionTo3d()}seatViewCaption(e){let t=this.allSeats().find(i=>i.id===e);return as(this.controller.seatDetails(e),t?.displayLabel??t?.label??e,this.tf("picker.viewFromYourSeat","view from your seat"),{narrow:this.root?.dataset.layout==="narrow",shortTail:this.tf("picker.fromYourSeat","from your seat")})}showUnavailable3dSeat(e,t,i){let n=this.view3dEl;if(!n)return;let s=this.controller.seatDetails(e.id),o=s?.displayLabel??e.displayLabel??e.label,a=W(s);ks(n,{status:i,visualState:t,location:[s?.sectionLabel,a?(0,C.t)("picker.rowLabel",{label:a}):null,o].filter(Boolean).join(" \xB7 ")||o,tf:(l,c)=>this.tf(l,c)}),this.announceSeat(e)}dismissUnavailable3dSeat(){mr(this.view3dEl)}saveView3dComparisonSeat(e){if(this.buyerView!=="venue3d")return;let t=this.view3dCompareSeatIds;t.includes(e.id)||(this.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),this.confirmSeat?.id===e.id&&(this.controller.deselect([e.id]),this.dismissConfirm(),this.syncSelectionTo3d(),this.syncTray()),this.view3dCompareChip.sync(),this.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:this.view3dCompareSeatIds.length}),this.view3dCompareSeatIds.length>1?this.openView3dComparison():this.toast(this.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}clearView3dComparison(){this.closeView3dComparison(!1),this.view3dCompareSeatIds=[],this.view3dCompareChip.remove(),this.emit3dAnalytics("3d_comparison_cleared")}view3dComparisonSnapshot(e){let t=this.allSeats().find(u=>u.id===e);if(!t)return null;let i=this.controller.seatDetails(t.id),n=this.controller.doc?.categories.find(u=>u.key===t.categoryKey),s=i?.price??(n?.tiers?.length?n.tiers[0].price:n?.price),o=s!=null?this.paidPrice(t.categoryKey,i?.tierId??n?.tiers?.[0]?.id??null,s,t.label):void 0,a=this.controller.getStatus(t.id),l=a==="held"?this.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?this.tf("picker.sold","Sold"):a==="not_for_sale"?this.tf("picker.notForSale","Not for sale"):this.tf("picker.available","Available"),c=t.viewUrl?(0,Bt.seatViewDisclosure)({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):this.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=Le(t.commercial)||this.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),h=i?.wheelchairSpaceType?`${ct(i.wheelchairSpaceType)} \xB7 metadata, not access certification`:this.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),p=(0,mo.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:W(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??n?.label??t.categoryKey,price:o==null?this.tf("picker.priceNotSupplied","Not supplied"):this.money(o),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:h,confidence:p}}openSeatConfidencePassport(e,t=null){ur(this,e,t)}closeSeatConfidencePassport(e=!0){Ot(this,e)}openView3dComparison(){ws(this)}closeView3dComparison(e=!0){Fe(this,e)}async enter3d(e){if(this.view3dEl||!this.canOffer3d()||!this.els.map)return;let t=this.controller.doc;if(!t)return;this.buyerView="venue3d",this.view3dTargetSeatId=null,this.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),this.root?.setAttribute("data-view3d","on"),this.dismissConfirm(),this.syncProjection(),this.syncTray();let i=document.createElement("div");i.className="sl-view3d sl-mo-zoom",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let n=document.createElement("button");n.type="button",n.className="sl-view3d-back",n.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${this.tf("picker.backToMap","Back to map")}</span>`;let s=n.querySelector("span"),o=c=>{this.view3dTargetSeatId=c;let d=!!c;i.classList.toggle("is-seat-focused",d);let h=d?this.tf("picker.backToVenue","Back to venue"):this.tf("picker.backToMap","Back to map");s&&(s.textContent=h),n.setAttribute("aria-label",h)};if(n.addEventListener("click",()=>{if(this.view3dTargetSeatId&&this.view3dHandle){this.view3dHandle.focusOverview();return}this.exit3d()}),i.appendChild(n),ss(this.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6",c.setAttribute("aria-label",this.tf("picker.fullScreen","Full screen")),c.setAttribute("aria-pressed",String(!!document.fullscreenElement||this.fsFallback||this.framedFs)),c.addEventListener("click",()=>this.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=this.tf("picker.loading3d","Building the 3D venue\u2026"),i.appendChild(a),this.els.map.appendChild(i),this.view3dEl=i,this.view3dCompareChip.sync(),requestAnimationFrame(()=>{i.style.opacity="1"});let l=++this.view3dGen;try{let c=this.allSeats(),[d,h]=await Promise.all([Et(),this.controller.loadEventConfiguration()]),p=h?await ri(h,T=>this.buyerAssetUrls.resolve(T)):null,u=t.theme?.venue3d?.shellAssetUrl,b=await ni(u,T=>this.buyerAssetUrls.resolve(T));if(l!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let m={doc:t,seats:c,...p?{eventConfigurationId:p.id,eventConfiguration:p}:{},...b?{registeredShellGlb:b}:{}};a.textContent=this.tf("picker.building3d","Building venue geometry\u2026");let v=await d.prepareVenue3D(m);if(l!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let x=d.mountVenue3D(i,{...m,prepared:v},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,seatViewActionLabel:T=>this.allSeats().find(A=>A.id===T)?.viewUrl?this.tf("picker.openAuthored360","Open venue 360\xB0"):this.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:T=>this.seatViewCaption(T),onSeatViewStopChange:T=>this.view3dSeatViewChrome?.onStopChange(T),onSeatPick:T=>this.onView3dSeatPick(T),onSeatInspect:T=>this.onView3dSeatPick(T),onSectionFocusChange:T=>{let A=i.querySelector('select[data-locator="section"]'),f=T??"";!A||A.value===f||(A.value=f,A.dispatchEvent(new Event("change")))},onViewTargetChange:T=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!T),o(T),this.opts.onBuyerViewChange?.({view:"venue3d",...T?{seatId:T}:{}})},...this.seatViewEnabled()?{getSeatView:T=>new Promise((A,f)=>{let y=()=>{this.seatViewFor3d(T).then(L=>{L?A(L):f(new Error("seat_view_unavailable"))})},S=globalThis.requestIdleCallback;typeof S=="function"?S(y,{timeout:1500}):setTimeout(y,50)})}:{},onAnalytics:(T,A)=>this.emit3dAnalytics(T,A)});this.view3dHandle=x,this.view3dSeatViewChrome=os(i,{handle:()=>this.view3dHandle}),requestAnimationFrame(()=>a.remove()),this.pushAvailabilityTo3d(),this.syncSelectionTo3d(),ns(i,x),e&&x.flyToSeat(e)}catch(c){if(l!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;this.opts.onError?.(c),this.toast(this.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),this.exit3d()}}exit3d(){if(this.buyerView!=="venue3d"&&!this.view3dEl)return;this.view3dGen++,this.buyerView="map",this.view3dTargetSeatId=null,this.opts.onBuyerViewChange?.({view:"map"}),this.root?.removeAttribute("data-view3d"),this.closeSeatConfidencePassport(!1),this.closeView3dComparison(!1),this.view3dCompareChip.remove(),this.view3dSeatViewChrome?.dispose(),this.view3dSeatViewChrome=null;try{this.view3dHandle?.dispose()}catch{}this.view3dHandle=null;let e=this.view3dEl;this.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),this.syncProjection(),this.syncTray();let t=this.view3dReturnSeat;this.view3dReturnSeat=null,t&&this.committedSelection().some(i=>i.id===t.id)&&this.opts.confirmSelection!==!1&&this.showConfirm(t)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e,!1)}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))),this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let n=this.els.tray?.querySelector(".sl-ba-go");n&&(n.disabled=!0,n.classList.add("sl-busy"),n.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let s=await this.controller.bestAvailable(e,t,{...i,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),i.preferPremium&&s.seats.length&&!s.seats.every(o=>o.commercial?.premium)&&this.toast((0,C.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}catch(s){this.opts.onError?.(s);let o=s?.reason,a=o==="not_enough_together"?(0,C.t)("picker.couldNotFindSeatsTogether",{count:e}):o==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):o==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):o==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):o==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):this.tf("picker.seatsNoLongerAvailableTryAnother","Those seats are no longer available. Try another quantity or ticket type.");return this.toast(a,"error"),null}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 n=[...new Set([...(e.items??[]).map(s=>s.label),...(e.seats??[]).map(s=>s.label)])];if(n.length)try{await this.api.release(this.opts.event,n,e.holdId)}catch(s){this.opts.onError?.(s),i=!1}}if(!i){this.toast(this.tf("picker.couldNotReleaseTickets","Couldn't release your tickets. Your hold is unchanged."),"error");return}this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.syncTray(),this.emitHoldChange()}startRealtime(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new ue({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:Qe(this.controller,{flashOnLiveChange:!0,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")}})}),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)}showAccessPanel(e){if(this.destroyed||!this.root)return;this.dismissAccessPanel();let t=Zn(e.reason,()=>{this.refreshAccess()});(this.regions?.["bottom-center"]??this.root).appendChild(t),this.accessEl=t}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}destroy(){this.destroyed=!0,lr(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.dismissAccessPanel(),this.access?.clear(),this.hold&&!this.handedOff&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),ve(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.liveTimer&&clearTimeout(this.liveTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalScrim&&(this.modalScrim.remove(),this.modalScrim=null,this.prevFocus?.isConnected&&this.prevFocus.focus({preventScroll:!0}),this.prevFocus=null)}};var Re=require("@seatlayer/core");var go="seatlayer-performance-group-picker-style";function bo(){if(document.getElementById(go))return;let r=document.createElement("style");r.id=go,r.textContent=`
|
|
2238
2264
|
.sl-pg-root{display:grid;gap:12px;min-width:0;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
|
|
2239
2265
|
.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)}
|
|
2240
2266
|
.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}
|
|
@@ -2294,7 +2320,7 @@
|
|
|
2294
2320
|
@media(min-width:900px){.sl-pg-legend-list{justify-content:flex-start}}
|
|
2295
2321
|
.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}
|
|
2296
2322
|
@media(max-width:640px){.sl-pg-head{padding:13px 14px}.sl-pg-head h2{font-size:18px}.sl-pg-inner{min-height:590px}}
|
|
2297
|
-
`,document.head.appendChild(r)}var kl="https://api.seatlayer.io",Sl=6e4,Tl=2e3,Cl=1e3,El=36e5,Pl=5e3,Al=5e3,Ml=15e3,Ll=12e4,Hl=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),G=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function Rl(r){return new Promise(e=>setTimeout(e,r))}function yr(r){let e=Number(r.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(Pl,e*1e3)):1e3}function ht(r,e){return`/pub/performance-groups/${encodeURIComponent(r)}/operations/${encodeURIComponent(e)}`}function ut(r){return r.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var xr=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)),n=[...new Set([...this.prior.keys(),...t.keys()])].filter(s=>this.prior.get(s)!==t.get(s)).map(s=>({label:s,status:t.get(s)??"blocked"}));this.prior=t,n.length&&this.sink.applyStatuses(n),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof G){this.stop();return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Pi=class{constructor(e,t){this.descriptorCache=null;this.chartRequest=null;this.objectsCache=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"};if(!e)throw new Error("seatlayer: `performanceGroup` key is required");this.groupKey=e,this.base=(t.apiBase??kl).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??Sl,this.realtimePollMs=Math.max(500,t.realtimePollMs??Tl),this.selectionMode=t.selectionMode??"same_seat",this.partySize=t.partySize??null,this.onOperationState=t.onOperationState,this.onRecoveryState=t.onRecoveryState,this.onAvailability=t.onAvailability,this.access.onRenewed(n=>this.adoptSession(n));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"}async descriptor(){let e=await this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/descriptor`);return this.descriptorCache=e.performanceGroup,this.includedEventKeys.size||(this.includedEventKeys=new Set(e.performanceGroup.performances.map(t=>t.eventKey))),e.performanceGroup.revision&&(this.knownRevision=e.performanceGroup.revision),this.activePerformanceKey??=e.performanceGroup.performances[0]?.eventKey??null,e.performanceGroup}async chart(e){this.chartRequest??=this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/chart`).catch(n=>{throw this.chartRequest=null,n});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 z(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 o=await this.authorized(i,this.objectsCache?.revision?{headers:{"If-None-Match":`"${this.objectsCache.revision}"`}}:{});if(o.status!==304){if(!o.ok)return this.throwResponse(o);this.objectsCache=await this.responseJson(o)}}if(!this.objectsCache)throw new z(502,"group_projection_unavailable","group_projection_unavailable");if(this.selectionMode==="same_seat"&&!t){let o=this.objectsCache;return this.noteAvailability(o,o.salesClosed,o),o}let n=this.objectsCache;if(this.selectionMode==="same_seat"){let o=n.performances.filter(h=>this.includedEventKeys.has(h.eventKey));if(!o.length)throw new z(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(o[0]?.seats??{}),l=Object.fromEntries(a.map(h=>[h,o.every(p=>p.seats[h]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(h=>{let p=o.filter(u=>u.seats[h]!=="free").map(u=>u.eventKey);return p.length>0&&p.length<o.length?[[h,p]]:[]})),d={seats:l,partial:c,hidden:[...new Set(o.flatMap(h=>h.hidden??[]))],closed:[...new Set(o.flatMap(h=>h.closed??[]))],revision:n.revision,state:n.state,salesClosed:o.some(h=>h.salesClosed)};return this.noteAvailability(n,d.salesClosed,d),d}let s=n.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!s)throw new z(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(n,n.salesClosed||n.performances.some(o=>o.salesClosed),s),s}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new z(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=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 z(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 z(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,n){if(this.assertUsable(),n)throw new z(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let s=t.map(c=>c.label),o={labels:s};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(o.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new z(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 z(409,"group_selection_incomplete","group_selection_incomplete");o={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,...o,...i?{ttlMs:i}:{}})})}catch(c){if(c instanceof G)throw c;if(c instanceof oe)throw this.failOperation(a),c;return this.recover(a,s,Date.now()+this.recoveryTimeoutMs)}if(l.status===201||l.status===202||l.status===504){let c=await this.responseJson(l);return this.emit(c.operation),l.status===201?this.complete(c.operation):this.recover(a,s,Date.now()+this.recoveryTimeoutMs,yr(l))}if(l.status===503){let c=await l.clone().json().catch(()=>null);if((c?.code??c?.error)==="performance_group_abort_pending"){let d=c?.operation?.operationId??a;return this.beginOperation(d),c?.operation&&this.emit(c.operation),this.recover(d,s,Date.now()+this.recoveryTimeoutMs,yr(l))}}try{return await this.throwResponse(l,s)}catch(c){throw this.failOperation(a),c}}async release(e,t,i){this.assertUsable();let n=this.operationForHold(i),s=await this.json(`${ht(this.groupKey,n)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(i),this.allocationsByHold.delete(i),this.clearOperationRecord(),s}async resume(e,t){this.assertUsable();let i=this.operationForHold(t),n=await this.json(ht(this.groupKey,i));return this.complete(n.operation)}async extend(e,t,i=12e4){this.assertUsable();let n=this.operationForHold(t),s=Math.max(Cl,Math.min(El,Math.round(i))),o=await this.json(`${ht(this.groupKey,n)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:s})}),a=this.complete(o.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}bestAvailable(){return Promise.reject(new z(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new xr(this,t,this.realtimePollMs)}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:ut(e.operationId)});let t;try{t=await this.authorized(ht(this.groupKey,e.operationId))}catch(s){return s instanceof G||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 n=i.operation.state;return n==="committed"||n==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(i.operation)):n==="aborted"||n==="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>=Ll?Ml:Al;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 n=await this.authorized(ht(this.groupKey,e));if(!n.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(n)).operation}catch(n){return n instanceof G?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"||Hl.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 n=0;n<2;n++){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 z(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let i=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:i,reference:i?ut(i):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,i,n=100){let s=n,o=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=i;){if(this.destroyed)throw new G;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=o,reference:ut(e)}),await Rl(s),this.destroyed)throw new G;let l;try{l=await this.authorized(ht(this.groupKey,e))}catch(h){if(h instanceof G)throw h;if(h instanceof oe)throw this.recoveryFailed(e,"request_failed"),h;s=Math.min(2e3,Math.max(100,s*2));continue}if(l.status===404){s=Math.min(1e3,Math.max(100,s*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let d=(await this.responseJson(l)).operation;if(a=d.state,this.noteOperationState(e,d.state),this.emit(d),d.state==="committed"||d.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(d);if(d.state==="aborted"||d.state==="expired")throw this.failOperation(e),new z(409,"conflict","conflict",t.map(h=>({label:h,status:"held"})));s=yr(l)}throw this.recoveryFailed(e,"deadline"),new z(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:ut(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 n=e.state??this.descriptorCache?.state??"active",s=e.revision??null,o=!!s&&!!this.knownRevision&&s!==this.knownRevision;s&&!this.knownRevision&&(this.knownRevision=s);let a=i?.partial??{},l=Object.values(i?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(i?.seats??{}).filter(c=>i.seats[c]!=="free"&&!(c in a)).length,state:n,salesClosed:!!t||n!=="active",revision:s,revisionChanged:o})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new z(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(n=>n.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 z(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 G;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},i=!1){if(this.destroyed)throw new G;if(this.adoptFailure)throw this.adoptFailure;let n={...t.headers};t.body!==void 0&&(n["Content-Type"]="application/json");let s=await this.access.authorization(i?"unauthorized":"initial");if(this.destroyed)throw new G;if(this.adoptFailure)throw this.adoptFailure;if(!s)throw new Error("performance_group_buyer_access_required");n.Authorization=s;let o=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:n,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!i&&(o.status===401||o.status===403||o.status===422)){let a=await o.clone().json().catch(()=>null);if(await this.access.handleFailure(o.status,a?.code??a?.error))return this.authorized(e,t,!0)}return o}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 n=await e.json().catch(()=>null)??{},s=n.code??n.error??`request_failed_${e.status}`;throw e.status===409&&!n.conflicts?.length&&t.length&&(n.conflicts=t.map(o=>({label:o,status:"held"}))),new z(e.status,n.error??s,s,n.conflicts)}};var Ol="https://api.seatlayer.io";function mo(r){let e=typeof r=="string"?document.querySelector(r):r;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var Ai=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;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.buyerAccessToken&&!e.buyerAccessTokenProvider)throw new Error("seatlayer: Performance Group buyer access 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}`,this.access=new ce({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable}),this.api=new Pi(e.performanceGroup,{apiBase:e.apiBase,access:this.access,selectionMode:e.selectionMode,partySize:e.selectionMode==="per_performance"?e.numberOfPlacesToSelect:void 0,onOperationState:t=>this.operationChanged(t),onRecoveryState:t=>this.recoveryChanged(t),onAvailability:t=>this.availabilityChanged(t)}),e.initialHoldId&&e.initialOperationId&&this.api.rememberOperation(e.initialHoldId,e.initialOperationId)}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,uo(),await(0,Re.loadLocale)(this.options.locale),this.options.messages&&(0,Re.setStringOverrides)(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(i){throw ye({apiBase:this.options.apiBase??Ol,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:Ae(this.options.performanceGroup),transport:"pubapi"}),i}return this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(mo(this.options.container),t),this.announce(this.copy("picker.group.checkingAvailability")),await this.mountPicker(t),this.destroyed?this:(await this.restoreOperation(),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 n=document.createElement("div");n.className="sl-pg-progress";let s=document.createElement("section");s.className="sl-pg-head",s.setAttribute("aria-labelledby",`sl-pg-title-${t.key}`);let o=document.createElement("h2");o.id=`sl-pg-title-${t.key}`,o.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=vr(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(d,h);let p=document.createElement("div");p.className="sl-pg-held-summary",p.hidden=!0,s.append(o,a,l,c,p);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 m=this.mode==="per_performance"?this.performanceTabs(t):null,v=document.createElement("div");v.className="sl-pg-inner",v.id=this.panelId,v.setAttribute("aria-busy","false"),v.dataset.locked="false",this.mode==="per_performance"&&(v.setAttribute("role","tabpanel"),v.tabIndex=-1);let x=document.createElement("div");x.className="sl-pg-status",x.setAttribute("role","status"),x.setAttribute("aria-live","polite"),x.hidden=!0;let S=document.createElement("p"),A=document.createElement("button");A.type="button",A.hidden=!0,A.textContent=this.copy("picker.group.retry"),A.addEventListener("click",()=>{this.retryRecovery()}),x.append(S,A),v.appendChild(x);let f=document.createElement("div");f.className="sl-pg-live",f.setAttribute("role","status"),f.setAttribute("aria-live","polite"),i.append(n,s),m&&i.append(m),i.append(u,v,b,f),e.appendChild(i),this.root=i,this.progressHost=n,this.legendHost=u,this.paneHost=b,this.datesSummaryHost=d,this.datesCardsHost=h,this.innerHost=v,this.heldSummary=p,this.live=f,this.statusHost=x,this.statusCopy=S,this.statusAction=A,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new pt(_s({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(i,n)=>{try{this.options.onAnalytics?.(i,{...n,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,n)=>this.holdChanged(i,n),onCheckout:(i,n)=>this.checkout(i,n),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"?Bs(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,n)=>{this.selectPartialSeat(i,n)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:i=>this.partialSeatDates.get(i)??this.nights().map(n=>n.eventKey),label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),apply:(i,n)=>this.applySeatDates(i,n,!0)}:null}));this.picker=t,await t.render(),!this.destroyed&&this.updateTabs()}performanceCards(e){return e.performances.map(t=>({eventKey:t.eventKey,name:t.name,iso:new Date(t.startsAt).toISOString(),date:Ti(t,this.options.locale),time:Ci(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:Ei(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,i=!!t?.salesClosed||!!t&&t.state!=="active",n=this.mode==="same_seat"&&!i?t?.partial??{}:{},s={};for(let o of this.markedLabels)s[o]=null;if(this.markedLabels.clear(),e>0)for(let[o,a]of Object.entries(n))!a.length||a.length>=e||(s[o]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(o));return s}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(n=>n.eventKey===this.activePerformanceKey);if(!e)return null;let t=Ei(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:Ei(e,this.options.locale),labels:(this.selectionsByEvent.get(e.eventKey)??[]).map(t=>t.label),active:e.eventKey===this.activePerformanceKey}))}groupSelectionSummary(){let e=this.includedPerformances();if(!e.length)return null;if(this.mode==="same_seat"){let s=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:s*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:s?e.length:0,perPerformance:s}}let t=e.map(s=>this.selectionsByEvent.get(s.eventKey)?.length??0),i=t.filter(s=>s>0),n=i.length===t.length&&i.every(s=>s===i[0]);return{seats:t.reduce((s,o)=>s+o,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:i.length,perPerformance:n&&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=qs(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=zs({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let i=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(s=>s.label)??[],n=this.heldTotal();e.hidden=!1,e.innerHTML=Ws({title:this.copy("picker.group.yourSelection"),rows:t.map(s=>({eventKey:s.eventKey,name:`${Ti(s,this.options.locale)} ${Ci(s,this.options.locale)}`,labels:i})),empty:this.copy("picker.group.noSeatsChosenYet"),note:n?null:this.copy("picker.group.pricesPerPerformance"),total:n?{label:this.copy("picker.group.total"),amount:n}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Ys(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let n=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!n.length)return null;let s=n.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),o=n[0]?.currency??t.currency;try{return(0,Re.formatMoney)(s,o,void 0,this.options.locale)}catch{return`${o} ${s.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(i=>t.has(i.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),i=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=i&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(i?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=vr(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 n=this.api.includedPerformanceKeys();if(n.length===t.length&&n.every(s=>t.includes(s)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(i?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(s){return n.length&&(this.api.setIncludedEventKeys(n),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(s),!1}finally{this.selectingPartialSeat=!1}}syncHoldTicker(){this.booked||(this.activeHandoff&&!this.holdTicker?this.holdTicker=setInterval(()=>this.syncPane(),1e3):!this.activeHandoff&&this.holdTicker&&(clearInterval(this.holdTicker),this.holdTicker=null))}async switchSelectionMode(e){if(!(this.destroyed||this.switchingMode||e===this.mode)&&!(this.activeHandoff||this.holdBlocked())){this.switchingMode=!0;try{this.api.setSelectionMode(e,this.options.numberOfPlacesToSelect),this.selectionModeValue=e,this.picker?.destroy(),this.picker=null,this.selectionsByEvent.clear(),this.validByEvent.clear(),this.markedLabels.clear(),this.availability=null;let t=this.descriptorValue;if(this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(mo(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 G)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.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,(n,s)=>String(t[s]??`{${s}}`)):i:(0,Re.t)(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 n=document.createElement("button");n.type="button",n.className="sl-pg-step",n.dataset.step="next",n.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),n.textContent="\u203A",n.addEventListener("click",()=>{this.stepPerformance(1)});let s=document.createElement("div");return s.className="sl-pg-tabs",s.setAttribute("role","tablist"),s.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((o,a)=>{let l=document.createElement("button");l.type="button",l.className="sl-pg-tab",l.id=`sl-pg-tab-${e.key}-${o.eventKey}`,l.dataset.eventKey=o.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=o.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(o.eventKey)}),l.addEventListener("keydown",p=>this.tabKeydown(p)),s.appendChild(l)}),t.append(i,s,n),this.tabsHost=s,this.prevButton=i,this.nextButton=n,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 n=getComputedStyle(this.tabsHost??document.body).direction==="rtl",s=-1;switch(e.key){case"ArrowRight":s=i+(n?-1:1);break;case"ArrowLeft":s=i+(n?1:-1);break;case"ArrowDown":s=i+1;break;case"ArrowUp":s=i-1;break;case"Home":s=0;break;case"End":s=t.length-1;break;default:return}if(s<0||s>=t.length)return;e.preventDefault();let o=t[s];o.focus({preventScroll:!0}),o.disabled||this.switchPerformance(o.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),i=t.findIndex(s=>s.dataset.eventKey===this.activePerformanceKey),n=t[i+e];!n||n.disabled||(n.focus({preventScroll:!0}),this.switchPerformance(n.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let n=!this.holdBlocked();return{complete:e.length,total:e.length,ready:n}}let t=this.options.numberOfPlacesToSelect,i=e.filter(n=>this.selectionsByEvent.get(n.eventKey)?.length===t&&this.validByEvent.get(n.eventKey)!==!1).length;return{complete:i,total:e.length,ready:i===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(i=>i.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(i=>this.options.onError?.(i)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(i=>({...i}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(i=>({label:i.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,i=(this.selectionsByEvent.get(e)??[]).map(s=>s.label),n=this.copy("picker.group.chosenOfTotal",{chosen:i.length,total:t});return i.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:n}:i.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:i.join(", ")}),badge:n}:i.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:n}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-i.length}),badge:n}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(n=>{let s=n.dataset.eventKey,o=this.tabState(s),a=s===this.activePerformanceKey;n.dataset.state=o.key,n.disabled=t,n.setAttribute("aria-selected",String(a)),n.tabIndex=a?0:-1;let l=n.querySelector(".sl-pg-tab-state");l&&(l.textContent=o.label);let c=n.querySelector(".sl-pg-tab-badge");c&&(c.textContent=o.badge);let d=n.querySelector(".sl-pg-tab-name")?.textContent??s;n.setAttribute("aria-label",`${d}: ${o.badge} \xB7 ${o.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",n.id)});let i=e.findIndex(n=>n.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 n=this.descriptorValue?.performances.find(s=>s.eventKey===e);n&&this.announce(this.copy("picker.group.performanceOpened",{performance:n.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}:{}})}clearStatus(){this.statusHost&&(this.statusHost.hidden=!0),this.statusAction&&(this.statusAction.hidden=!0),this.options.onStatusChange?.({kind:"idle",message:""})}operationChanged(e){if(this.destroyed)return;let t=e.state==="preparing"||e.state==="commit_pending"||e.state==="abort_pending"||e.state==="expire_pending";if(this.operationPending=t,this.setInteractionLocked(t||this.recovery.kind!=="idle"),this.updateTabs(),t){this.showStatus("pending",this.copy(e.state==="commit_pending"?"picker.group.commitPending":e.state==="abort_pending"||e.state==="expire_pending"?"picker.group.abortPending":"picker.group.securing"));return}if(e.state==="booked"){this.bookingSettled();return}if(e.state==="expired"||e.state==="aborted"){this.activeHandoff&&this.holdLost();return}if(e.state==="committed"){this.clearStatus(),this.announce(this.copy("picker.group.secured")),queueMicrotask(()=>this.innerHost?.querySelector('[data-ref="cta"]')?.focus({preventScroll:!0}));return}e.decision==="abort"&&this.recovery.kind==="idle"&&(this.clearStatus(),this.announce(this.copy("picker.group.notSecured")))}bookingSettled(){if(this.booked)return;this.booked=!0,this.root&&(this.root.dataset.booking="booked"),this.clearStatus(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.activeHandoff?{...this.activeHandoff,bookingState:"booked"}:null;e&&(this.activeHandoff=e),this.syncProgress(),this.syncPane(),this.updateTabs(),this.picker?.notifyGroupSettled("booked"),this.announce(this.copy("picker.group.bookedAll",{count:this.descriptorValue?.performanceCount??0})),e&&this.options.onBooked?.(e)}holdLost(){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.picker?.notifyGroupSettled("lost"),this.announce(this.copy("picker.group.notSecured")),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()}recoveryChanged(e){if(!this.destroyed){if(this.recovery=e,this.setInteractionLocked(this.operationPending||e.kind!=="idle"),this.updateTabs(),this.refreshComposition(),e.kind==="idle"){this.operationPending||this.clearStatus();return}if(e.kind==="pending"){this.showStatus("pending",e.longRunning?this.copy("picker.group.longRunning",{reference:e.reference}):this.copy("picker.group.outcomeUnknown"),{reference:e.reference});return}this.showStatus("recovery_failed",this.copy("picker.group.longRunning",{reference:e.reference}),{retry:e.retryable,reference:e.reference}),this.setInteractionLocked(!1)}}async retryRecovery(){if(!(this.destroyed||this.recovery.kind!=="failed"||!this.recovery.retryable))try{await this.api.retryRecovery()}catch(e){if(e instanceof G)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 G)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 G)return;this.options.onError?.(t)}}handoff(e,t){let i=this.descriptorValue,n=this.api.operationIdForHold(e.holdId);if(!i||!n)throw new Error("seatlayer: Performance Group hold identity is unavailable");let s=this.api.allocationsForHold(e.holdId);return{operationId:n,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:i,selectionMode:this.mode,performanceKeys:s.map(o=>o.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(o=>o.label),...this.mode==="per_performance"?{allocations:s.map(o=>({eventKey:o.eventKey,seatLabels:o.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(o=>o.eventKey===t.eventKey),n=document.createElement("p"),s=document.createElement("strong");s.textContent=i?.name??t.eventKey,n.append(s,document.createTextNode(t.items.map(o=>o.label).join(", "))),this.heldSummary.appendChild(n)}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),n=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(),n&&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)}};var Il="https://api.seatlayer.io",_l=6e4,Dl=5e3,pe=class extends Error{constructor(t,i){super(`season_request_failed:${t}`);this.code=t;this.status=i;this.name="SeasonApiError"}},Dt=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function Bl(r,e){let t=Number(r.headers.get("Retry-After")),i=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(Dl,i*1e3))}function $l(r,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,i)=>{let n=setTimeout(t,r);e?.addEventListener("abort",()=>{clearTimeout(n),i(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function zl(r){if(!r||typeof r!="object")return"unknown";let e=r;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}function wr(r){if(!r||typeof r!="object")throw new pe("invalid_operation_response",502);let e=r,t=JSON.stringify(e);if(!e.operationId||!e.holdId||!Array.isArray(e.allocations)||t.includes("shc_")||t.includes("childHoldId")||t.includes("child_hold_id"))throw new pe("unsafe_operation_response",502);return e}function fo(r,e){return{seasonKey:r.key,planActivationId:r.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,state:e.state,allocations:e.allocations.map(({eventId:t,state:i})=>({eventKey:t,state:i}))}}var Bt,$t,Ie,zt,Vt,ge,Oe,Mi=class{constructor(e,t){D(this,ge);D(this,Bt);D(this,$t);D(this,Ie);D(this,zt);D(this,Vt);L(this,Bt,e),L(this,$t,(t.apiBase??Il).replace(/\/$/,"")),L(this,Ie,t.access),L(this,zt,t.fetch??globalThis.fetch.bind(globalThis)),L(this,Vt,t.recoveryTimeoutMs??_l)}async descriptor(){let{body:e}=await H(this,ge,Oe).call(this,"GET","");return e.season}async availability(){let{body:e}=await H(this,ge,Oe).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){let{body:i,response:n}=await H(this,ge,Oe).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:wr(i.operation),response:n}}async operation(e){let{body:t,response:i}=await H(this,ge,Oe).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:wr(t.operation),response:i}}async release(e,t){let{body:i,response:n}=await H(this,ge,Oe).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:wr(i.operation),response:n}}async renewalIntent(e){let{body:t}=await H(this,ge,Oe).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 pe("invalid_renewal_intent_response",502);return i}async waitForTerminal(e,t,i){let n=Date.now(),s=t??await this.operation(e);for(;s.operation.state==="preparing"||s.operation.state==="commit_pending"||s.operation.state==="abort_pending";){if(Date.now()-n>=k(this,Vt))throw new Dt(e);await $l(Bl(s.response,s.operation),i),s=await this.operation(e)}return s.operation}destroy(){k(this,Ie).clear()}};Bt=new WeakMap,$t=new WeakMap,Ie=new WeakMap,zt=new WeakMap,Vt=new WeakMap,ge=new WeakSet,Oe=async function(e,t,i,n=!0){let s=await k(this,Ie).authorization();if(!s)throw new oe({reason:"no_token",retryable:!1});let o=await k(this,zt).call(this,`${k(this,$t)}/pub/seasons/${encodeURIComponent(k(this,Bt))}${t}`,{method:e,headers:{Authorization:s,...i===void 0?{}:{"Content-Type":"application/json"}},body:i===void 0?void 0:JSON.stringify(i)}),a=await o.json().catch(()=>null);if(!o.ok){let l=zl(a);if(n&&await k(this,Ie).handleFailure(o.status,l))return H(this,ge,Oe).call(this,e,t,i,!1);let c=k(this,Ie).unavailable;throw c?new oe(c):new pe(l,o.status)}if(a===null)throw new pe("invalid_json_response",502);return{body:a,response:o}};var go="seatlayer-season-picker-style";function Vl(){if(document.getElementById(go))return;let r=document.createElement("style");r.id=go,r.textContent=`
|
|
2323
|
+
`,document.head.appendChild(r)}var Pl="https://api.seatlayer.io",Al=6e4,Ml=2e3,Ll=1e3,Hl=36e5,Rl=5e3,Ol=5e3,Il=15e3,_l=12e4,Dl=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),G=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function Bl(r){return new Promise(e=>setTimeout(e,r))}function kr(r){let e=Number(r.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(Rl,e*1e3)):1e3}function mt(r,e){return`/pub/performance-groups/${encodeURIComponent(r)}/operations/${encodeURIComponent(e)}`}function ft(r){return r.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var Sr=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)),n=[...new Set([...this.prior.keys(),...t.keys()])].filter(s=>this.prior.get(s)!==t.get(s)).map(s=>({label:s,status:t.get(s)??"blocked"}));this.prior=t,n.length&&this.sink.applyStatuses(n),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof G){this.stop();return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Li=class{constructor(e,t){this.descriptorCache=null;this.chartRequest=null;this.objectsCache=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"};if(!e)throw new Error("seatlayer: `performanceGroup` key is required");this.groupKey=e,this.base=(t.apiBase??Pl).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??Al,this.realtimePollMs=Math.max(500,t.realtimePollMs??Ml),this.selectionMode=t.selectionMode??"same_seat",this.partySize=t.partySize??null,this.onOperationState=t.onOperationState,this.onRecoveryState=t.onRecoveryState,this.onAvailability=t.onAvailability,this.access.onRenewed(n=>this.adoptSession(n));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"}async descriptor(){let e=await this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/descriptor`);return this.descriptorCache=e.performanceGroup,this.includedEventKeys.size||(this.includedEventKeys=new Set(e.performanceGroup.performances.map(t=>t.eventKey))),e.performanceGroup.revision&&(this.knownRevision=e.performanceGroup.revision),this.activePerformanceKey??=e.performanceGroup.performances[0]?.eventKey??null,e.performanceGroup}async chart(e){this.chartRequest??=this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/chart`).catch(n=>{throw this.chartRequest=null,n});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 N(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 o=await this.authorized(i,this.objectsCache?.revision?{headers:{"If-None-Match":`"${this.objectsCache.revision}"`}}:{});if(o.status!==304){if(!o.ok)return this.throwResponse(o);this.objectsCache=await this.responseJson(o)}}if(!this.objectsCache)throw new N(502,"group_projection_unavailable","group_projection_unavailable");if(this.selectionMode==="same_seat"&&!t){let o=this.objectsCache;return this.noteAvailability(o,o.salesClosed,o),o}let n=this.objectsCache;if(this.selectionMode==="same_seat"){let o=n.performances.filter(h=>this.includedEventKeys.has(h.eventKey));if(!o.length)throw new N(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(o[0]?.seats??{}),l=Object.fromEntries(a.map(h=>[h,o.every(p=>p.seats[h]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(h=>{let p=o.filter(u=>u.seats[h]!=="free").map(u=>u.eventKey);return p.length>0&&p.length<o.length?[[h,p]]:[]})),d={seats:l,partial:c,hidden:[...new Set(o.flatMap(h=>h.hidden??[]))],closed:[...new Set(o.flatMap(h=>h.closed??[]))],revision:n.revision,state:n.state,salesClosed:o.some(h=>h.salesClosed)};return this.noteAvailability(n,d.salesClosed,d),d}let s=n.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!s)throw new N(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(n,n.salesClosed||n.performances.some(o=>o.salesClosed),s),s}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new N(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=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 N(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 N(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,n){if(this.assertUsable(),n)throw new N(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let s=t.map(c=>c.label),o={labels:s};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(o.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new N(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 N(409,"group_selection_incomplete","group_selection_incomplete");o={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,...o,...i?{ttlMs:i}:{}})})}catch(c){if(c instanceof G)throw c;if(c instanceof oe)throw this.failOperation(a),c;return this.recover(a,s,Date.now()+this.recoveryTimeoutMs)}if(l.status===201||l.status===202||l.status===504){let c=await this.responseJson(l);return this.emit(c.operation),l.status===201?this.complete(c.operation):this.recover(a,s,Date.now()+this.recoveryTimeoutMs,kr(l))}if(l.status===503){let c=await l.clone().json().catch(()=>null);if((c?.code??c?.error)==="performance_group_abort_pending"){let d=c?.operation?.operationId??a;return this.beginOperation(d),c?.operation&&this.emit(c.operation),this.recover(d,s,Date.now()+this.recoveryTimeoutMs,kr(l))}}try{return await this.throwResponse(l,s)}catch(c){throw this.failOperation(a),c}}async release(e,t,i){this.assertUsable();let n=this.operationForHold(i),s=await this.json(`${mt(this.groupKey,n)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(i),this.allocationsByHold.delete(i),this.clearOperationRecord(),s}async resume(e,t){this.assertUsable();let i=this.operationForHold(t),n=await this.json(mt(this.groupKey,i));return this.complete(n.operation)}async extend(e,t,i=12e4){this.assertUsable();let n=this.operationForHold(t),s=Math.max(Ll,Math.min(Hl,Math.round(i))),o=await this.json(`${mt(this.groupKey,n)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:s})}),a=this.complete(o.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}bestAvailable(){return Promise.reject(new N(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new Sr(this,t,this.realtimePollMs)}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:ft(e.operationId)});let t;try{t=await this.authorized(mt(this.groupKey,e.operationId))}catch(s){return s instanceof G||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 n=i.operation.state;return n==="committed"||n==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(i.operation)):n==="aborted"||n==="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>=_l?Il:Ol;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 n=await this.authorized(mt(this.groupKey,e));if(!n.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(n)).operation}catch(n){return n instanceof G?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"||Dl.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 n=0;n<2;n++){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 N(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let i=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:i,reference:i?ft(i):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,i,n=100){let s=n,o=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=i;){if(this.destroyed)throw new G;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=o,reference:ft(e)}),await Bl(s),this.destroyed)throw new G;let l;try{l=await this.authorized(mt(this.groupKey,e))}catch(h){if(h instanceof G)throw h;if(h instanceof oe)throw this.recoveryFailed(e,"request_failed"),h;s=Math.min(2e3,Math.max(100,s*2));continue}if(l.status===404){s=Math.min(1e3,Math.max(100,s*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let d=(await this.responseJson(l)).operation;if(a=d.state,this.noteOperationState(e,d.state),this.emit(d),d.state==="committed"||d.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(d);if(d.state==="aborted"||d.state==="expired")throw this.failOperation(e),new N(409,"conflict","conflict",t.map(h=>({label:h,status:"held"})));s=kr(l)}throw this.recoveryFailed(e,"deadline"),new N(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:ft(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 n=e.state??this.descriptorCache?.state??"active",s=e.revision??null,o=!!s&&!!this.knownRevision&&s!==this.knownRevision;s&&!this.knownRevision&&(this.knownRevision=s);let a=i?.partial??{},l=Object.values(i?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(i?.seats??{}).filter(c=>i.seats[c]!=="free"&&!(c in a)).length,state:n,salesClosed:!!t||n!=="active",revision:s,revisionChanged:o})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new N(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(n=>n.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 N(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 G;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},i=!1){if(this.destroyed)throw new G;if(this.adoptFailure)throw this.adoptFailure;let n={...t.headers};t.body!==void 0&&(n["Content-Type"]="application/json");let s=await this.access.authorization(i?"unauthorized":"initial");if(this.destroyed)throw new G;if(this.adoptFailure)throw this.adoptFailure;if(!s)throw new Error("performance_group_buyer_access_required");n.Authorization=s;let o=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:n,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!i&&(o.status===401||o.status===403||o.status===422)){let a=await o.clone().json().catch(()=>null);if(await this.access.handleFailure(o.status,a?.code??a?.error))return this.authorized(e,t,!0)}return o}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 n=await e.json().catch(()=>null)??{},s=n.code??n.error??`request_failed_${e.status}`;throw e.status===409&&!n.conflicts?.length&&t.length&&(n.conflicts=t.map(o=>({label:o,status:"held"}))),new N(e.status,n.error??s,s,n.conflicts)}};var $l="https://api.seatlayer.io";function vo(r){let e=typeof r=="string"?document.querySelector(r):r;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var Hi=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;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.buyerAccessToken&&!e.buyerAccessTokenProvider)throw new Error("seatlayer: Performance Group buyer access 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}`,this.access=new ce({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable}),this.api=new Li(e.performanceGroup,{apiBase:e.apiBase,access:this.access,selectionMode:e.selectionMode,partySize:e.selectionMode==="per_performance"?e.numberOfPlacesToSelect:void 0,onOperationState:t=>this.operationChanged(t),onRecoveryState:t=>this.recoveryChanged(t),onAvailability:t=>this.availabilityChanged(t)}),e.initialHoldId&&e.initialOperationId&&this.api.rememberOperation(e.initialHoldId,e.initialOperationId)}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,bo(),await(0,Re.loadLocale)(this.options.locale),this.options.messages&&(0,Re.setStringOverrides)(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(i){throw ye({apiBase:this.options.apiBase??$l,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:Ae(this.options.performanceGroup),transport:"pubapi"}),i}return this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(vo(this.options.container),t),this.announce(this.copy("picker.group.checkingAvailability")),await this.mountPicker(t),this.destroyed?this:(await this.restoreOperation(),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 n=document.createElement("div");n.className="sl-pg-progress";let s=document.createElement("section");s.className="sl-pg-head",s.setAttribute("aria-labelledby",`sl-pg-title-${t.key}`);let o=document.createElement("h2");o.id=`sl-pg-title-${t.key}`,o.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=wr(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(d,h);let p=document.createElement("div");p.className="sl-pg-held-summary",p.hidden=!0,s.append(o,a,l,c,p);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 m=this.mode==="per_performance"?this.performanceTabs(t):null,v=document.createElement("div");v.className="sl-pg-inner",v.id=this.panelId,v.setAttribute("aria-busy","false"),v.dataset.locked="false",this.mode==="per_performance"&&(v.setAttribute("role","tabpanel"),v.tabIndex=-1);let x=document.createElement("div");x.className="sl-pg-status",x.setAttribute("role","status"),x.setAttribute("aria-live","polite"),x.hidden=!0;let T=document.createElement("p"),A=document.createElement("button");A.type="button",A.hidden=!0,A.textContent=this.copy("picker.group.retry"),A.addEventListener("click",()=>{this.retryRecovery()}),x.append(T,A),v.appendChild(x);let f=document.createElement("div");f.className="sl-pg-live",f.setAttribute("role","status"),f.setAttribute("aria-live","polite"),i.append(n,s),m&&i.append(m),i.append(u,v,b,f),e.appendChild(i),this.root=i,this.progressHost=n,this.legendHost=u,this.paneHost=b,this.datesSummaryHost=d,this.datesCardsHost=h,this.innerHost=v,this.heldSummary=p,this.live=f,this.statusHost=x,this.statusCopy=T,this.statusAction=A,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new ut(Ns({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(i,n)=>{try{this.options.onAnalytics?.(i,{...n,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,n)=>this.holdChanged(i,n),onCheckout:(i,n)=>this.checkout(i,n),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"?Vs(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,n)=>{this.selectPartialSeat(i,n)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:i=>this.partialSeatDates.get(i)??this.nights().map(n=>n.eventKey),label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),apply:(i,n)=>this.applySeatDates(i,n,!0)}:null}));this.picker=t,await t.render(),!this.destroyed&&this.updateTabs()}performanceCards(e){return e.performances.map(t=>({eventKey:t.eventKey,name:t.name,iso:new Date(t.startsAt).toISOString(),date:Pi(t,this.options.locale),time:Ai(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:Mi(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,i=!!t?.salesClosed||!!t&&t.state!=="active",n=this.mode==="same_seat"&&!i?t?.partial??{}:{},s={};for(let o of this.markedLabels)s[o]=null;if(this.markedLabels.clear(),e>0)for(let[o,a]of Object.entries(n))!a.length||a.length>=e||(s[o]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(o));return s}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(n=>n.eventKey===this.activePerformanceKey);if(!e)return null;let t=Mi(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:Mi(e,this.options.locale),labels:(this.selectionsByEvent.get(e.eventKey)??[]).map(t=>t.label),active:e.eventKey===this.activePerformanceKey}))}groupSelectionSummary(){let e=this.includedPerformances();if(!e.length)return null;if(this.mode==="same_seat"){let s=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:s*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:s?e.length:0,perPerformance:s}}let t=e.map(s=>this.selectionsByEvent.get(s.eventKey)?.length??0),i=t.filter(s=>s>0),n=i.length===t.length&&i.every(s=>s===i[0]);return{seats:t.reduce((s,o)=>s+o,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:i.length,perPerformance:n&&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=Xs(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=js({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let i=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(s=>s.label)??[],n=this.heldTotal();e.hidden=!1,e.innerHTML=Zs({title:this.copy("picker.group.yourSelection"),rows:t.map(s=>({eventKey:s.eventKey,name:`${Pi(s,this.options.locale)} ${Ai(s,this.options.locale)}`,labels:i})),empty:this.copy("picker.group.noSeatsChosenYet"),note:n?null:this.copy("picker.group.pricesPerPerformance"),total:n?{label:this.copy("picker.group.total"),amount:n}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Js(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let n=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!n.length)return null;let s=n.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),o=n[0]?.currency??t.currency;try{return(0,Re.formatMoney)(s,o,void 0,this.options.locale)}catch{return`${o} ${s.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(i=>t.has(i.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),i=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=i&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(i?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=wr(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 n=this.api.includedPerformanceKeys();if(n.length===t.length&&n.every(s=>t.includes(s)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(i?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(s){return n.length&&(this.api.setIncludedEventKeys(n),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(s),!1}finally{this.selectingPartialSeat=!1}}syncHoldTicker(){this.booked||(this.activeHandoff&&!this.holdTicker?this.holdTicker=setInterval(()=>this.syncPane(),1e3):!this.activeHandoff&&this.holdTicker&&(clearInterval(this.holdTicker),this.holdTicker=null))}async switchSelectionMode(e){if(!(this.destroyed||this.switchingMode||e===this.mode)&&!(this.activeHandoff||this.holdBlocked())){this.switchingMode=!0;try{this.api.setSelectionMode(e,this.options.numberOfPlacesToSelect),this.selectionModeValue=e,this.picker?.destroy(),this.picker=null,this.selectionsByEvent.clear(),this.validByEvent.clear(),this.markedLabels.clear(),this.availability=null;let t=this.descriptorValue;if(this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(vo(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 G)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.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,(n,s)=>String(t[s]??`{${s}}`)):i:(0,Re.t)(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 n=document.createElement("button");n.type="button",n.className="sl-pg-step",n.dataset.step="next",n.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),n.textContent="\u203A",n.addEventListener("click",()=>{this.stepPerformance(1)});let s=document.createElement("div");return s.className="sl-pg-tabs",s.setAttribute("role","tablist"),s.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((o,a)=>{let l=document.createElement("button");l.type="button",l.className="sl-pg-tab",l.id=`sl-pg-tab-${e.key}-${o.eventKey}`,l.dataset.eventKey=o.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=o.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(o.eventKey)}),l.addEventListener("keydown",p=>this.tabKeydown(p)),s.appendChild(l)}),t.append(i,s,n),this.tabsHost=s,this.prevButton=i,this.nextButton=n,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 n=getComputedStyle(this.tabsHost??document.body).direction==="rtl",s=-1;switch(e.key){case"ArrowRight":s=i+(n?-1:1);break;case"ArrowLeft":s=i+(n?1:-1);break;case"ArrowDown":s=i+1;break;case"ArrowUp":s=i-1;break;case"Home":s=0;break;case"End":s=t.length-1;break;default:return}if(s<0||s>=t.length)return;e.preventDefault();let o=t[s];o.focus({preventScroll:!0}),o.disabled||this.switchPerformance(o.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),i=t.findIndex(s=>s.dataset.eventKey===this.activePerformanceKey),n=t[i+e];!n||n.disabled||(n.focus({preventScroll:!0}),this.switchPerformance(n.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let n=!this.holdBlocked();return{complete:e.length,total:e.length,ready:n}}let t=this.options.numberOfPlacesToSelect,i=e.filter(n=>this.selectionsByEvent.get(n.eventKey)?.length===t&&this.validByEvent.get(n.eventKey)!==!1).length;return{complete:i,total:e.length,ready:i===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(i=>i.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(i=>this.options.onError?.(i)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(i=>({...i}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(i=>({label:i.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,i=(this.selectionsByEvent.get(e)??[]).map(s=>s.label),n=this.copy("picker.group.chosenOfTotal",{chosen:i.length,total:t});return i.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:n}:i.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:i.join(", ")}),badge:n}:i.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:n}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-i.length}),badge:n}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(n=>{let s=n.dataset.eventKey,o=this.tabState(s),a=s===this.activePerformanceKey;n.dataset.state=o.key,n.disabled=t,n.setAttribute("aria-selected",String(a)),n.tabIndex=a?0:-1;let l=n.querySelector(".sl-pg-tab-state");l&&(l.textContent=o.label);let c=n.querySelector(".sl-pg-tab-badge");c&&(c.textContent=o.badge);let d=n.querySelector(".sl-pg-tab-name")?.textContent??s;n.setAttribute("aria-label",`${d}: ${o.badge} \xB7 ${o.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",n.id)});let i=e.findIndex(n=>n.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 n=this.descriptorValue?.performances.find(s=>s.eventKey===e);n&&this.announce(this.copy("picker.group.performanceOpened",{performance:n.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}:{}})}clearStatus(){this.statusHost&&(this.statusHost.hidden=!0),this.statusAction&&(this.statusAction.hidden=!0),this.options.onStatusChange?.({kind:"idle",message:""})}operationChanged(e){if(this.destroyed)return;let t=e.state==="preparing"||e.state==="commit_pending"||e.state==="abort_pending"||e.state==="expire_pending";if(this.operationPending=t,this.setInteractionLocked(t||this.recovery.kind!=="idle"),this.updateTabs(),t){this.showStatus("pending",this.copy(e.state==="commit_pending"?"picker.group.commitPending":e.state==="abort_pending"||e.state==="expire_pending"?"picker.group.abortPending":"picker.group.securing"));return}if(e.state==="booked"){this.bookingSettled();return}if(e.state==="expired"||e.state==="aborted"){this.activeHandoff&&this.holdLost();return}if(e.state==="committed"){this.clearStatus(),this.announce(this.copy("picker.group.secured")),queueMicrotask(()=>this.innerHost?.querySelector('[data-ref="cta"]')?.focus({preventScroll:!0}));return}e.decision==="abort"&&this.recovery.kind==="idle"&&(this.clearStatus(),this.announce(this.copy("picker.group.notSecured")))}bookingSettled(){if(this.booked)return;this.booked=!0,this.root&&(this.root.dataset.booking="booked"),this.clearStatus(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.activeHandoff?{...this.activeHandoff,bookingState:"booked"}:null;e&&(this.activeHandoff=e),this.syncProgress(),this.syncPane(),this.updateTabs(),this.picker?.notifyGroupSettled("booked"),this.announce(this.copy("picker.group.bookedAll",{count:this.descriptorValue?.performanceCount??0})),e&&this.options.onBooked?.(e)}holdLost(){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.picker?.notifyGroupSettled("lost"),this.announce(this.copy("picker.group.notSecured")),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()}recoveryChanged(e){if(!this.destroyed){if(this.recovery=e,this.setInteractionLocked(this.operationPending||e.kind!=="idle"),this.updateTabs(),this.refreshComposition(),e.kind==="idle"){this.operationPending||this.clearStatus();return}if(e.kind==="pending"){this.showStatus("pending",e.longRunning?this.copy("picker.group.longRunning",{reference:e.reference}):this.copy("picker.group.outcomeUnknown"),{reference:e.reference});return}this.showStatus("recovery_failed",this.copy("picker.group.longRunning",{reference:e.reference}),{retry:e.retryable,reference:e.reference}),this.setInteractionLocked(!1)}}async retryRecovery(){if(!(this.destroyed||this.recovery.kind!=="failed"||!this.recovery.retryable))try{await this.api.retryRecovery()}catch(e){if(e instanceof G)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 G)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 G)return;this.options.onError?.(t)}}handoff(e,t){let i=this.descriptorValue,n=this.api.operationIdForHold(e.holdId);if(!i||!n)throw new Error("seatlayer: Performance Group hold identity is unavailable");let s=this.api.allocationsForHold(e.holdId);return{operationId:n,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:i,selectionMode:this.mode,performanceKeys:s.map(o=>o.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(o=>o.label),...this.mode==="per_performance"?{allocations:s.map(o=>({eventKey:o.eventKey,seatLabels:o.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(o=>o.eventKey===t.eventKey),n=document.createElement("p"),s=document.createElement("strong");s.textContent=i?.name??t.eventKey,n.append(s,document.createTextNode(t.items.map(o=>o.label).join(", "))),this.heldSummary.appendChild(n)}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),n=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(),n&&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)}};var Nl="https://api.seatlayer.io",zl=6e4,Vl=5e3,pe=class extends Error{constructor(t,i){super(`season_request_failed:${t}`);this.code=t;this.status=i;this.name="SeasonApiError"}},$t=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function Fl(r,e){let t=Number(r.headers.get("Retry-After")),i=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(Vl,i*1e3))}function jl(r,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,i)=>{let n=setTimeout(t,r);e?.addEventListener("abort",()=>{clearTimeout(n),i(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function Gl(r){if(!r||typeof r!="object")return"unknown";let e=r;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}function Tr(r){if(!r||typeof r!="object")throw new pe("invalid_operation_response",502);let e=r,t=JSON.stringify(e);if(!e.operationId||!e.holdId||!Array.isArray(e.allocations)||t.includes("shc_")||t.includes("childHoldId")||t.includes("child_hold_id"))throw new pe("unsafe_operation_response",502);return e}function yo(r,e){return{seasonKey:r.key,planActivationId:r.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,state:e.state,allocations:e.allocations.map(({eventId:t,state:i})=>({eventKey:t,state:i}))}}var Nt,zt,Ie,Vt,Ft,ge,Oe,Ri=class{constructor(e,t){D(this,ge);D(this,Nt);D(this,zt);D(this,Ie);D(this,Vt);D(this,Ft);M(this,Nt,e),M(this,zt,(t.apiBase??Nl).replace(/\/$/,"")),M(this,Ie,t.access),M(this,Vt,t.fetch??globalThis.fetch.bind(globalThis)),M(this,Ft,t.recoveryTimeoutMs??zl)}async descriptor(){let{body:e}=await H(this,ge,Oe).call(this,"GET","");return e.season}async availability(){let{body:e}=await H(this,ge,Oe).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){let{body:i,response:n}=await H(this,ge,Oe).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:Tr(i.operation),response:n}}async operation(e){let{body:t,response:i}=await H(this,ge,Oe).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:Tr(t.operation),response:i}}async release(e,t){let{body:i,response:n}=await H(this,ge,Oe).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:Tr(i.operation),response:n}}async renewalIntent(e){let{body:t}=await H(this,ge,Oe).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 pe("invalid_renewal_intent_response",502);return i}async waitForTerminal(e,t,i){let n=Date.now(),s=t??await this.operation(e);for(;s.operation.state==="preparing"||s.operation.state==="commit_pending"||s.operation.state==="abort_pending";){if(Date.now()-n>=k(this,Ft))throw new $t(e);await jl(Fl(s.response,s.operation),i),s=await this.operation(e)}return s.operation}destroy(){k(this,Ie).clear()}};Nt=new WeakMap,zt=new WeakMap,Ie=new WeakMap,Vt=new WeakMap,Ft=new WeakMap,ge=new WeakSet,Oe=async function(e,t,i,n=!0){let s=await k(this,Ie).authorization();if(!s)throw new oe({reason:"no_token",retryable:!1});let o=await k(this,Vt).call(this,`${k(this,zt)}/pub/seasons/${encodeURIComponent(k(this,Nt))}${t}`,{method:e,headers:{Authorization:s,...i===void 0?{}:{"Content-Type":"application/json"}},body:i===void 0?void 0:JSON.stringify(i)}),a=await o.json().catch(()=>null);if(!o.ok){let l=Gl(a);if(n&&await k(this,Ie).handleFailure(o.status,l))return H(this,ge,Oe).call(this,e,t,i,!1);let c=k(this,Ie).unavailable;throw c?new oe(c):new pe(l,o.status)}if(a===null)throw new pe("invalid_json_response",502);return{body:a,response:o}};var xo="seatlayer-season-picker-style";function Kl(){if(document.getElementById(xo))return;let r=document.createElement("style");r.id=xo,r.textContent=`
|
|
2298
2324
|
.sl-season-root{box-sizing:border-box;display:grid;gap:12px;min-width:0;max-width:100%;overflow-wrap:anywhere;color:#18202b;font-family:Inter,system-ui,sans-serif}
|
|
2299
2325
|
.sl-season-card{box-sizing:border-box;display:grid;gap:8px;min-width:0;padding:16px;border:1px solid #dde3ea;border-radius:14px;background:#fff}
|
|
2300
2326
|
.sl-season-card h2{margin:0;font:700 20px/1.25 inherit}.sl-season-card p{margin:0;color:#627081;font-size:14px}
|
|
@@ -2303,4 +2329,4 @@
|
|
|
2303
2329
|
.sl-season-status[data-kind=ready]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
|
|
2304
2330
|
.sl-season-root[data-busy=true]{cursor:progress}.sl-season-root[data-busy=true] .sl-season-card{opacity:.88}
|
|
2305
2331
|
@media(max-width:360px){.sl-season-card{padding:12px}.sl-season-card h2{font-size:18px}}
|
|
2306
|
-
`,document.head.appendChild(r)}function
|
|
2332
|
+
`,document.head.appendChild(r)}function Ul(r){let e=typeof r=="string"?document.querySelector(r):r;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}function ql(r,e){if(r.startsAt===null)return r.name;try{let t=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short",...e?{timeZone:e}:{}}).format(new Date(r.startsAt));return`${r.name} \u2014 ${t}`}catch{return r.name}}var ie,Ge,Gt,se,Ke,ke,Ue,Se,_e,De,bt,I,wo,ko,Oi,te,gt,Cr,jt,Ii=class{constructor(e){D(this,I);D(this,ie);D(this,Ge);D(this,Gt);D(this,se);D(this,Ke,new AbortController);D(this,ke,null);D(this,Ue,null);D(this,Se,null);D(this,_e,null);D(this,De,null);D(this,bt,!1);if(!e?.season)throw new Error("seatlayer: `season` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider)throw new Error("seatlayer: Season buyer access is required");if("event"in e||"performanceGroup"in e)throw new Error("seatlayer: SeasonPicker is not SeatPicker or PerformanceGroupPicker");M(this,ie,e),M(this,Ge,Ul(e.container)),M(this,Gt,new ce({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable})),M(this,se,new Ri(e.season,{apiBase:e.apiBase,access:k(this,Gt),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs}))}async render(){H(this,I,Cr).call(this),Kl(),H(this,I,wo).call(this),H(this,I,te).call(this,{kind:"loading",message:"Loading Season availability."},!0);try{let[e,t]=await Promise.all([k(this,se).descriptor(),k(this,se).availability()]);return M(this,ke,e),M(this,Ue,t),H(this,I,ko).call(this),H(this,I,te).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included occurrence.`}),k(this,ie).initialOperationId&&await this.restoreOperation(k(this,ie).initialOperationId),this}catch(e){throw H(this,I,gt).call(this,e),e}}async holdSameSeat(e,t){if(H(this,I,jt).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");H(this,I,te).call(this,{kind:"pending",message:"Confirming this selection across every occurrence.",operationId:t},!0);try{let i=await k(this,se).hold(e,t),n=await k(this,se).waitForTerminal(t,i,k(this,Ke).signal);return H(this,I,Oi).call(this,n)}catch(i){throw H(this,I,gt).call(this,i,t),i}}async restoreOperation(e){H(this,I,jt).call(this),H(this,I,te).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await k(this,se).waitForTerminal(e,void 0,k(this,Ke).signal);return t.state==="aborted"||t.state==="expired"?(M(this,Se,null),k(this,ie).onHoldChange?.(null),H(this,I,te).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):H(this,I,Oi).call(this,t)}catch(t){throw H(this,I,gt).call(this,t,e),t}}async release(e){H(this,I,jt).call(this);let t=k(this,Se)?.operationId;if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");H(this,I,te).call(this,{kind:"pending",message:"Releasing the Season selection.",operationId:t},!0);try{let i=await k(this,se).release(t,e),n=await k(this,se).waitForTerminal(t,i,k(this,Ke).signal);if(n.state==="partial_terminal"){H(this,I,Oi).call(this,n);return}M(this,Se,null),k(this,ie).onHoldChange?.(null),H(this,I,te).call(this,{kind:"released",message:"The Season selection was released.",operationId:t})}catch(i){throw H(this,I,gt).call(this,i,t),i}}}async createRenewalIntent(e){if(H(this,I,jt).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");H(this,I,te).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await k(this,se).renewalIntent(e);return H(this,I,te).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and the final renewal."}),k(this,ie).onRenewalIntent?.(t),t}catch(t){throw H(this,I,gt).call(this,t),t}}getDescriptor(){return k(this,ke)}getAvailability(){return k(this,Ue)}getHandoff(){return k(this,Se)}destroy(){k(this,bt)||(M(this,bt,!0),k(this,Ke).abort(),k(this,se).destroy(),k(this,Ge).replaceChildren(),M(this,_e,null),M(this,De,null),M(this,ke,null),M(this,Ue,null),M(this,Se,null))}};ie=new WeakMap,Ge=new WeakMap,Gt=new WeakMap,se=new WeakMap,Ke=new WeakMap,ke=new WeakMap,Ue=new WeakMap,Se=new WeakMap,_e=new WeakMap,De=new WeakMap,bt=new WeakMap,I=new WeakSet,wo=function(){k(this,Ge).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection");let t=document.createElement("div");t.className="sl-season-card";let i=document.createElement("h2");i.textContent="Season";let n=document.createElement("p");n.className="sl-season-summary",n.textContent="Every included occurrence is part of this selection.";let s=document.createElement("p");s.className="sl-season-status",s.setAttribute("role","status"),s.setAttribute("aria-live","polite"),t.append(i,n),e.append(t,s),k(this,Ge).append(e),M(this,_e,e),M(this,De,s)},ko=function(){let e=k(this,ke),t=k(this,Ue),i=k(this,_e).querySelector(".sl-season-card");i.replaceChildren();let n=document.createElement("h2");n.textContent=e.name;let s=document.createElement("p");s.className="sl-season-summary",s.textContent=`One fixed plan includes all ${e.occurrenceCount} occurrences.`;let o=document.createElement("details"),a=document.createElement("summary");a.textContent=`All ${e.occurrenceCount} occurrences included`;let l=document.createElement("ol");l.className="sl-season-list";for(let d of e.occurrences){let h=document.createElement("li");h.textContent=ql(d,e.timezone),l.append(h)}o.append(a,l);let c=document.createElement("p");c.className="sl-season-availability",c.textContent=`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every occurrence`,i.append(n,s,o,c)},Oi=function(e){let t=yo(k(this,ke),e);return M(this,Se,t),k(this,ie).onHoldChange?.(t),e.state==="committed"||e.state==="booked"?(H(this,I,te).call(this,{kind:"held",message:"Your seats are held for every included occurrence.",operationId:e.operationId}),k(this,ie).onHold?.(t),k(this,ie).onContinue?.(t)):e.state==="partial_terminal"?H(this,I,te).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}):H(this,I,te).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),t},te=function(e,t=!1){k(this,De)&&(k(this,De).textContent=e.message,k(this,De).dataset.kind=e.kind),k(this,_e)&&(k(this,_e).dataset.busy=String(t)),k(this,ie).onStatusChange?.(e)},gt=function(e,t){let i=e instanceof pe?`Season selection unavailable (${e.code}).`:"Season selection could not be completed.";H(this,I,te).call(this,{kind:"failed",message:i,operationId:t}),k(this,ie).onError?.(e)},Cr=function(){if(k(this,bt))throw new Error("seatlayer: SeasonPicker was destroyed")},jt=function(){if(H(this,I,Cr).call(this),!k(this,ke))throw new Error("seatlayer: render SeasonPicker before using it")};function So(r,e={}){let t=e.origin??"";if(!t)try{t=new URL(r.src,window.location.href).origin}catch{t=""}let i=!1,n=null,s=null,o=null,a="",l=null,c=()=>{if(i)return;i=!0,n=r.getAttribute("style"),Object.assign(r.style,{position:"fixed",inset:"0",width:"100vw",height:"100vh",margin:"0",border:"0",zIndex:"2147483000",background:"#101625"});let p=document.documentElement;s=p.style.overflow,p.style.overflow="hidden",document.body&&(o=document.body.style.overflow,document.body.style.overflow="hidden"),l=u=>{u.key==="Escape"&&d()},window.addEventListener("keydown",l)},d=()=>{i&&(i=!1,n===null?r.removeAttribute("style"):r.setAttribute("style",n),n=null,a&&(r.style.height=a),s!==null&&(document.documentElement.style.overflow=s,s=null),o!==null&&document.body&&(document.body.style.overflow=o,o=null),l&&(window.removeEventListener("keydown",l),l=null))},h=p=>{if(p.source!==r.contentWindow||t&&p.origin!==t||!p.data||typeof p.data!="object")return;let u=p.data;if(u.type==="seatlayer:height"){typeof u.px=="number"&&Number.isFinite(u.px)&&u.px>0&&(a=`${Math.round(u.px)}px`,i||(r.style.height=a));return}u.type==="seatlayer:fullscreen"&&(u.on===!0?c():u.on===!1&&d())};return window.addEventListener("message",h),()=>{window.removeEventListener("message",h),d()}}0&&(module.exports={ApiError,BuyerAccessContext,BuyerAccessUnavailableError,BuyerRealtimeClient,EmbeddedDesigner,PerformanceGroupDestroyedError,PerformanceGroupPicker,SEATING_CHART_CALLBACK_PROPS,SEATING_CHART_HANDLE_METHODS,SEATING_CHART_IDENTITY_PROPS,SEATING_CHART_VALUE_PROPS,SeasonApiError,SeasonPicker,SeasonRecoveryTimeoutError,SeatPicker,SeatingChart,attachPickerFrame,bindSeatingChartHandle,buildSeatingChartOptions,createBuyerAccessContext,createControllerSink,parseTicketOfferAvailability,shortOperationReference,ticketOfferPrices});
|