@seatlayer/js 0.77.2 → 0.78.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var ba=Object.create;var ci=Object.defineProperty;var va=Object.getOwnPropertyDescriptor;var ya=Object.getOwnPropertyNames;var wa=Object.getPrototypeOf,xa=Object.prototype.hasOwnProperty;var rr=n=>{throw TypeError(n)};var ka=(n,e,t)=>()=>{if(t)throw t[0];try{return n&&(e=n(n=0)),e}catch(i){throw t=[i],i}};var sr=(n,e)=>{for(var t in e)ci(n,t,{get:e[t],enumerable:!0})},or=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ya(e))!xa.call(n,r)&&r!==t&&ci(n,r,{get:()=>e[r],enumerable:!(i=va(e,r))||i.enumerable});return n};var ar=(n,e,t)=>(t=n!=null?ba(wa(n)):{},or(e||!n||!n.__esModule?ci(t,"default",{value:n,enumerable:!0}):t,n)),Sa=n=>or(ci({},"__esModule",{value:!0}),n);var ln=(n,e,t)=>e.has(n)||rr("Cannot "+t);var f=(n,e,t)=>(ln(n,e,"read from private field"),t?t.call(n):e.get(n)),D=(n,e,t)=>e.has(n)?rr("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),A=(n,e,t,i)=>(ln(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),P=(n,e,t)=>(ln(n,e,"access private method"),t);var zr={};sr(zr,{errorCopy:()=>yn,mountCheckout:()=>al,unavailableCopy:()=>Vr});function nl(n,e){try{window.sessionStorage.setItem(il,JSON.stringify({orderId:n,...e?{eventKey:e}:{},storedAt:Date.now()}))}catch{}}function sl(){if(typeof document>"u"||document.getElementById(Fr))return;let n=document.createElement("style");n.id=Fr,n.textContent=rl,document.head.appendChild(n)}function Vr(n,e){let t=`${e} ${e===1?"seat is":"seats are"} held for a limited time.`;return n==="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."}:n==="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 yn(n){switch(n){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 ol(){let n=window.Razorpay;return n?Promise.resolve(n):new Promise((e,t)=>{let i=document.querySelector(`script[src="${$r}"]`),r=i??document.createElement("script"),s=()=>{let o=window.Razorpay;o?e(o):t(new Error("razorpay_unavailable"))};r.addEventListener("load",s,{once:!0}),r.addEventListener("error",()=>t(new Error("razorpay_script_failed")),{once:!0}),!i&&(r.src=$r,r.async=!0,document.head.appendChild(r))})}function $(n,e,t){let i=document.createElement(n);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function al(n){sl();let e=!0,t=!1,i=$("div","sl-hco");i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true");let r=$("div","sl-hco-card");i.appendChild(r);let s=()=>{e=!1,i.remove(),document.removeEventListener("keydown",a,!0)},o=()=>{s(),n.onCancel()};function a(F){F.key!=="Escape"||!i.isConnected||(F.stopPropagation(),F.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=(...F)=>{r.replaceChildren(l,...F)},p=F=>{if(!e)return;let K=$("p","sl-hco-status sl-hco-error",F);K.setAttribute("role","alert");let R=$("button","sl-hco-back","Back to seats");R.type="button",R.addEventListener("click",o),d(K,R)},u=F=>{if(!e)return;let K=$("p","sl-hco-status",F);K.setAttribute("role","status"),d(K)},h=async F=>{u("Payment received \u2014 confirming your seats\u2026");let K=Date.now()+9e4;for(;e&&Date.now()<K;){try{let R=await n.orderStatus(F);if(!e)return;if(R.status==="confirmed"){t=!0,l.textContent="Your tickets are confirmed";let ot=$("p","sl-hco-status",`${R.seatCount} ${R.seatCount===1?"seat":"seats"} confirmed. Your tickets \u2014 with their door QR codes \u2014 are in your email.`),Ue=$("dl","sl-hco-receipt"),Nt=(R.tickets??[]).map(at=>at.label);Nt.length&&Ue.append($("dt",void 0,"Seats"),$("dd",void 0,Nt.join(", "))),Ue.append($("dt",void 0,"Paid"),$("dd",void 0,`${R.amountFormatted} ${R.currency}`),$("dt",void 0,"Order"),$("dd","sl-hco-ref",R.orderId));let li=$("button","sl-hco-back","Close");if(li.type="button",li.addEventListener("click",o),R.ticketUrl){let at=$("a","sl-hco-tickets","View tickets & QR codes");at.href=R.ticketUrl,at.target="_blank",at.rel="noreferrer",d(ot,Ue,at,li)}else d(ot,Ue,li);n.onConfirmed(R);return}if(R.status==="failed"||R.status==="expired"){p(R.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(R=>setTimeout(R,2e3))}!e||t||p("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(n.state.kind==="unavailable"){let F=Vr(n.state.reason,n.state.seatCount);l.textContent=F.title;let K=$("p","sl-hco-label","Seats held"),R=$("button","sl-hco-back","Back to seat map");return R.type="button",R.addEventListener("click",o),r.replaceChildren(K,l,$("p","sl-hco-status",F.body),$("p","sl-hco-note",F.detail),R),n.root.appendChild(i),R.focus(),{destroy:s}}if(n.state.kind==="resume")return n.root.appendChild(i),h(n.state.orderId),{destroy:s};let{order:g,provider:m}=n.state,y=$("div","sl-hco-summary"),S=$("div","sl-hco-seats");for(let F of g.labels)S.appendChild($("span","sl-hco-seat",F));let w=n.formatMoney(g.total,g.currency),T=$("div","sl-hco-total");T.append($("span",void 0,"Total"),$("strong",void 0,w)),y.append(S,T);let b=$("form","sl-hco-form"),E=$("label","sl-hco-label","Email \u2014 your tickets go here"),x=$("input","sl-hco-input");x.type="email",x.required=!0,x.autocomplete="email",x.placeholder="you@example.com",x.id=`${c}-email`,E.htmlFor=x.id;let L=$("label","sl-hco-label","Name (optional)"),I=$("input","sl-hco-input");I.type="text",I.autocomplete="name",I.placeholder="Your name",I.id=`${c}-name`,L.htmlFor=I.id;let C=$("button","sl-hco-pay",`Pay ${w}`);C.type="submit",C.disabled=!0;let O=$("button","sl-hco-back","Back to seats");O.type="button",O.addEventListener("click",o);let N=new Date(g.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),z=$("p","sl-hco-note",`Your seats are held until ${N}. Payment is handled by ${m==="razorpay"?"Razorpay":"Stripe"} \u2014 we never see your card details.`),Q=$("p","sl-hco-note");Q.append("The event organizer and SeatLayer use your email to issue and manage your tickets. ");let J=$("a",void 0,"Privacy Policy");J.href="https://seatlayer.io/privacy/",J.target="_blank",J.rel="noreferrer",Q.appendChild(J);let U=()=>/.+@.+\..+/.test(x.value.trim());x.addEventListener("input",()=>{C.disabled=!U()});let st=async()=>{u("Opening secure payment\u2026");try{let F=await n.startSession({holdId:g.holdId,buyerEmail:x.value.trim(),...I.value.trim()?{buyerName:I.value.trim()}:{}});if(!e)return;if(F.redirectUrl){nl(F.orderId,n.eventKey),u("Taking you to secure payment\u2026"),window.location.assign(F.redirectUrl);return}if(F.clientPayload){let K=F.clientPayload,R=await ol();if(!e)return;u("Waiting for payment\u2026"),new R({key:K.key,order_id:K.orderId,amount:K.amount,currency:K.currency,name:K.name,prefill:K.prefill,handler:()=>{h(F.orderId)},modal:{ondismiss:()=>{e&&Dt()}}}).open();return}p(yn("gateway_unavailable"))}catch(F){n.onError?.(F),p(yn(F?.code))}};b.addEventListener("submit",F=>{F.preventDefault(),U()&&st()}),b.append(E,x,L,I,Q,C,O,z);let Dt=()=>{l.textContent="Checkout",d(y,b),C.disabled=!U()};return Dt(),n.root.appendChild(i),x.focus(),{destroy:s}}var $r,Fr,il,rl,jr=ka(()=>{"use strict";$r="https://checkout.razorpay.com/v1/checkout.js",Fr="seatlayer-checkout-style",il="@seatlayer/pending-checkout/v1";rl=`
1
+ "use strict";var wa=Object.create;var ci=Object.defineProperty;var xa=Object.getOwnPropertyDescriptor;var ka=Object.getOwnPropertyNames;var Sa=Object.getPrototypeOf,Ta=Object.prototype.hasOwnProperty;var nr=n=>{throw TypeError(n)};var Ca=(n,e,t)=>()=>{if(t)throw t[0];try{return n&&(e=n(n=0)),e}catch(i){throw t=[i],i}};var rr=(n,e)=>{for(var t in e)ci(n,t,{get:e[t],enumerable:!0})},sr=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ka(e))!Ta.call(n,r)&&r!==t&&ci(n,r,{get:()=>e[r],enumerable:!(i=xa(e,r))||i.enumerable});return n};var or=(n,e,t)=>(t=n!=null?wa(Sa(n)):{},sr(e||!n||!n.__esModule?ci(t,"default",{value:n,enumerable:!0}):t,n)),Ea=n=>sr(ci({},"__esModule",{value:!0}),n);var ln=(n,e,t)=>e.has(n)||nr("Cannot "+t);var m=(n,e,t)=>(ln(n,e,"read from private field"),t?t.call(n):e.get(n)),N=(n,e,t)=>e.has(n)?nr("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),E=(n,e,t,i)=>(ln(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),A=(n,e,t)=>(ln(n,e,"access private method"),t);var Fr={};rr(Fr,{errorCopy:()=>vn,mountCheckout:()=>dl,unavailableCopy:()=>$r});function ol(n,e){try{window.sessionStorage.setItem(sl,JSON.stringify({orderId:n,...e?{eventKey:e}:{},storedAt:Date.now()}))}catch{}}function ll(){if(typeof document>"u"||document.getElementById(Br))return;let n=document.createElement("style");n.id=Br,n.textContent=al,document.head.appendChild(n)}function $r(n,e){let t=`${e} ${e===1?"seat is":"seats are"} held for a limited time.`;return n==="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."}:n==="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 vn(n){switch(n){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 cl(){let n=window.Razorpay;return n?Promise.resolve(n):new Promise((e,t)=>{let i=document.querySelector(`script[src="${Nr}"]`),r=i??document.createElement("script"),s=()=>{let o=window.Razorpay;o?e(o):t(new Error("razorpay_unavailable"))};r.addEventListener("load",s,{once:!0}),r.addEventListener("error",()=>t(new Error("razorpay_script_failed")),{once:!0}),!i&&(r.src=Nr,r.async=!0,document.head.appendChild(r))})}function $(n,e,t){let i=document.createElement(n);return e&&(i.className=e),t!==void 0&&(i.textContent=t),i}function dl(n){ll();let e=!0,t=!1,i=$("div","sl-hco");i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true");let r=$("div","sl-hco-card");i.appendChild(r);let s=()=>{e=!1,i.remove(),document.removeEventListener("keydown",a,!0)},o=()=>{s(),n.onCancel()};function a(V){V.key!=="Escape"||!i.isConnected||(V.stopPropagation(),V.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=(...V)=>{r.replaceChildren(l,...V)},p=V=>{if(!e)return;let K=$("p","sl-hco-status sl-hco-error",V);K.setAttribute("role","alert");let R=$("button","sl-hco-back","Back to seats");R.type="button",R.addEventListener("click",o),d(K,R)},u=V=>{if(!e)return;let K=$("p","sl-hco-status",V);K.setAttribute("role","status"),d(K)},h=async V=>{u("Payment received \u2014 confirming your seats\u2026");let K=Date.now()+9e4;for(;e&&Date.now()<K;){try{let R=await n.orderStatus(V);if(!e)return;if(R.status==="confirmed"){t=!0,l.textContent="Your tickets are confirmed";let st=$("p","sl-hco-status",`${R.seatCount} ${R.seatCount===1?"seat":"seats"} confirmed. Your tickets \u2014 with their door QR codes \u2014 are in your email.`),qe=$("dl","sl-hco-receipt"),Nt=(R.tickets??[]).map(ot=>ot.label);Nt.length&&qe.append($("dt",void 0,"Seats"),$("dd",void 0,Nt.join(", "))),qe.append($("dt",void 0,"Paid"),$("dd",void 0,`${R.amountFormatted} ${R.currency}`),$("dt",void 0,"Order"),$("dd","sl-hco-ref",R.orderId));let li=$("button","sl-hco-back","Close");if(li.type="button",li.addEventListener("click",o),R.ticketUrl){let ot=$("a","sl-hco-tickets","View tickets & QR codes");ot.href=R.ticketUrl,ot.target="_blank",ot.rel="noreferrer",d(st,qe,ot,li)}else d(st,qe,li);n.onConfirmed(R);return}if(R.status==="failed"||R.status==="expired"){p(R.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(R=>setTimeout(R,2e3))}!e||t||p("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(n.state.kind==="unavailable"){let V=$r(n.state.reason,n.state.seatCount);l.textContent=V.title;let K=$("p","sl-hco-label","Seats held"),R=$("button","sl-hco-back","Back to seat map");return R.type="button",R.addEventListener("click",o),r.replaceChildren(K,l,$("p","sl-hco-status",V.body),$("p","sl-hco-note",V.detail),R),n.root.appendChild(i),R.focus(),{destroy:s}}if(n.state.kind==="resume")return n.root.appendChild(i),h(n.state.orderId),{destroy:s};let{order:g,provider:f}=n.state,x=$("div","sl-hco-summary"),w=$("div","sl-hco-seats");for(let V of g.labels)w.appendChild($("span","sl-hco-seat",V));let y=n.formatMoney(g.total,g.currency),C=$("div","sl-hco-total");C.append($("span",void 0,"Total"),$("strong",void 0,y)),x.append(w,C);let b=$("form","sl-hco-form"),H=$("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`,H.htmlFor=S.id;let O=$("label","sl-hco-label","Name (optional)"),P=$("input","sl-hco-input");P.type="text",P.autocomplete="name",P.placeholder="Your name",P.id=`${c}-name`,O.htmlFor=P.id;let T=$("button","sl-hco-pay",`Pay ${y}`);T.type="submit",T.disabled=!0;let I=$("button","sl-hco-back","Back to seats");I.type="button",I.addEventListener("click",o);let _=new Date(g.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),F=$("p","sl-hco-note",`Your seats are held until ${_}. Payment is handled by ${f==="razorpay"?"Razorpay":"Stripe"} \u2014 we never see your card details.`),Q=$("p","sl-hco-note");Q.append("The event organizer and SeatLayer use your email to issue and manage your tickets. ");let J=$("a",void 0,"Privacy Policy");J.href="https://seatlayer.io/privacy/",J.target="_blank",J.rel="noreferrer",Q.appendChild(J);let U=()=>/.+@.+\..+/.test(S.value.trim());S.addEventListener("input",()=>{T.disabled=!U()});let rt=async()=>{u("Opening secure payment\u2026");try{let V=await n.startSession({holdId:g.holdId,buyerEmail:S.value.trim(),...P.value.trim()?{buyerName:P.value.trim()}:{}});if(!e)return;if(V.redirectUrl){ol(V.orderId,n.eventKey),u("Taking you to secure payment\u2026"),window.location.assign(V.redirectUrl);return}if(V.clientPayload){let K=V.clientPayload,R=await cl();if(!e)return;u("Waiting for payment\u2026"),new R({key:K.key,order_id:K.orderId,amount:K.amount,currency:K.currency,name:K.name,prefill:K.prefill,handler:()=>{h(V.orderId)},modal:{ondismiss:()=>{e&&Dt()}}}).open();return}p(vn("gateway_unavailable"))}catch(V){n.onError?.(V),p(vn(V?.code))}};b.addEventListener("submit",V=>{V.preventDefault(),U()&&rt()}),b.append(H,S,O,P,Q,T,I,F);let Dt=()=>{l.textContent="Checkout",d(x,b),T.disabled=!U()};return Dt(),n.root.appendChild(i),S.focus(),{destroy:s}}var Nr,Br,sl,al,Vr=Ca(()=>{"use strict";Nr="https://checkout.razorpay.com/v1/checkout.js",Br="seatlayer-checkout-style",sl="@seatlayer/pending-checkout/v1";al=`
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 ud={};sr(ud,{ApiError:()=>j,BuyerAccessContext:()=>fe,BuyerAccessUnavailableError:()=>pe,BuyerRealtimeClient:()=>ve,EmbeddedDesigner:()=>Bi,PerformanceGroupDestroyedError:()=>W,PerformanceGroupPicker:()=>rn,SEATING_CHART_CALLBACK_PROPS:()=>En,SEATING_CHART_HANDLE_METHODS:()=>Sn,SEATING_CHART_IDENTITY_PROPS:()=>Tn,SEATING_CHART_VALUE_PROPS:()=>Cn,SeasonApiError:()=>q,SeasonPicker:()=>an,SeasonRecoveryTimeoutError:()=>ri,SeatPicker:()=>ze,SeatingChart:()=>Ni,attachPickerFrame:()=>ga,bindSeatingChartHandle:()=>cs,buildSeatingChartOptions:()=>ds,createBuyerAccessContext:()=>gt,createControllerSink:()=>lt,parseTicketOfferAvailability:()=>Fi,shortOperationReference:()=>Pt,ticketOfferPrices:()=>Vi});module.exports=Sa(ud);var V=require("@seatlayer/core");var Ke="seatlayer.v1";function Ta(n){let e=typeof n.default=="string"?n.default:"free",t={};if(n.seats&&typeof n.seats=="object")for(let[i,r]of Object.entries(n.seats))typeof r=="string"&&r!==e&&(t[i]=r);return{default:e,exceptions:t}}function Ca(n,e){if(!n||n.default!==e.default)return null;let t=[];for(let[i,r]of Object.entries(e.exceptions))n.exceptions[i]!==r&&t.push({label:i,status:r});for(let i of Object.keys(n.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function Ea(n,e){for(let t of e)t.status===n.default?delete n.exceptions[t.label]:n.exceptions[t.label]=t.status}function lr(n){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var ve=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=[Ke];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(Ke)||e.unshift(Ke)):s?.ticket&&(e=[Ke,`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 r;try{r=(this.opts.socketFactory??((o,a)=>new WebSocket(o,a)))(i,e)}catch{this.scheduleReconnect();return}this.ws=r,r.onopen=()=>{this.ws===r&&(this.attempt=0,this.v1=r.protocol===Ke,this.v1||(this.useQueryMarker=!0),this.startKeepalive(r),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},5e3):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},5e3))},r.onmessage=s=>{if(this.ws!==r)return;let o;try{o=JSON.parse(typeof s.data=="string"?s.data:"")}catch{return}!o||typeof o!="object"||this.handleFrame(o)},r.onclose=s=>{if(this.ws===r){if(this.ws=null,this.clearTimers(),s?.code===4401){if(s.reason==="access_expired"){this.scheduleReconnect();return}this.stopped=!0,this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},r.onerror=()=>{try{r.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:[],r=Array.isArray(e.closed)?e.closed:[],s=i.join("\0"),o=r.join("\0");(s!==this.hidden||o!==this.closedSections)&&(this.hidden=s,this.closedSections=o,this.opts.sink.onSections?.(i,r))}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=Ta(e),r=Ca(this.projection,i);this.projection=i,r===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():r.length&&this.opts.sink.applyStatuses(r);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(r=>typeof r?.label=="string"&&typeof r?.status=="string").map(r=>({label:r.label,status:r.status}));if(!i.length)return;this.projection&&Ea(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 Aa(n){return n==="blocked"?"not_for_sale":n==="held"||n==="booked"||n==="free"||n==="not_for_sale"?n:"free"}function lt(n,e={}){let t=i=>{let r=n.tableSelection(i);if(r)return r.physicalSeatIds;let s=n.idForLabel(i);return s?[s]:[]};return{applyStatuses(i){let r=n.currentHold()?.labels??[],s={free:[],held:[],booked:[],not_for_sale:[]},o=[],a=[],l=new Map(n.getSelection().map(c=>[c.label,c.id]));for(let c of i){let d=t(c.label);if(!d.length)continue;let p=Aa(c.status);if(s[p].push(...d),e.flashOnLiveChange&&p!=="free"&&!r.includes(c.label)&&d.some(u=>n.getStatus(u)==="free")){let u=p==="held"?"#f4b740":"#f43f5e";for(let h of d)o.push({id:h,color:u})}p!=="free"&&!r.includes(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])s[c].length&&n.setStatus(s[c],c);for(let c of o)n.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(p=>t(p));c.length&&n.deselect(c);let d=i.some(p=>p.status==="blocked"&&a.includes(p.label));e.onSelectedObjectUnavailable?.(a,d?"ineligible":"taken")}e.onStatusChange?.()},async resync(){await n.refresh()},onSections(i,r){n.refresh(),e.onSections?.(i,r)}}}var j=class extends Error{constructor(e,t,i,r,s,o){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=r,this.reason=s,this.retryAfterS=o}},cr=10,dr=1;function di(n,e){let t=(n??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let r=Date.parse(t);if(Number.isFinite(r))return Math.max(0,Math.ceil((r-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var Pa={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},De=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 r=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:r,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 p=d,u=p?.code??p?.error;if(this.access?.configured&&(l.status===401||l.status===403||l.status===422)&&await this.access.handleFailure(l.status,u)&&!i.auth)return this.request(e,t,{...i,auth:!0});if(l.status===409){let g=u?Pa[u]:void 0,m=p?.conflicts?.map(y=>y.label)??t.labels??[];g&&this.onObjectUnavailable?.({labels:m,reason:g,code:u})}let h;if(l.status===429&&(h=di(l.headers.get("Retry-After"),p?.retryAfterSeconds)??dr,r==="GET"&&!i.rateLimit&&h<=cr))return await new Promise(g=>setTimeout(g,h*1e3)),this.request(e,t,{...i,rateLimit:!0});throw new j(l.status,p?.error??`request_failed_${l.status}`,u,p?.conflicts,p?.reason,h)}return d}async requestBlob(e,t={}){let i={},r=await this.access?.authorization(t.auth?"unauthorized":"initial");r&&(i.Authorization=r);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=di(s.headers.get("Retry-After"),a?.retryAfterSeconds)??dr,!t.rateLimit&&c<=cr))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new j(s.status,a?.error??`request_failed_${s.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new j(404,"not_found","not_found"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,i,r){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...r?{replaceHoldId:r}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(s=>s.label)})}bestAvailable(e,t,i,r,s){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...r?{zoneId:r}:{},...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?[]:[Ke]}createRealtime(e,t){return this.accessScoped?null:new ve({url:this.subscribeUrl(e),sink:t})}};var ie=require("@seatlayer/core");var pt=require("@seatlayer/core");var hi=require("@seatlayer/core/core/color");function Ae(n){if(!n)return null;let e=n.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 r=t.length<=4?[...t].map(s=>`${s}${s}`).join(""):t;return{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.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 pi(n){return(0,hi.relativeLuminance255)([n.r,n.g,n.b])}function Ee(n,e){let t=Ae(n),i=Ae(e);if(!t||!i)return null;let r=Math.max(pi(t),pi(i)),s=Math.min(pi(t),pi(i));return(r+.05)/(s+.05)}function ct(n,e="#172033",t="#eef1f8"){return(Ee(e,n)??0)>=(Ee(t,n)??0)?e:t}function La(n){return(0,hi.rgb255ToHex)(n.r,n.g,n.b)}function Ma(n,e,t){let i=Ae(n),r=Ae(e);if(!i||!r)return null;let s=Math.max(0,Math.min(1,t));return La({r:i.r*s+r.r*(1-s),g:i.g*s+r.g*(1-s),b:i.b*s+r.b*(1-s)})}function pr(n,e,t,i){if((Ee(n,t)??4.5)>=4.5&&(Ee(n,i)??4.5)>=4.5)return n;if(!Ae(n)||!Ae(e))return e;for(let r=.15;r<=1;r+=.05){let s=Ma(n,e,1-r);if(s&&(Ee(s,t)??0)>=4.5&&(Ee(s,i)??0)>=4.5)return s}return e}function hr(n,e){let t=e??n["--sl-bg"],i=Ae(t)?ct(t)==="#172033":!1,r=Ae(n["--sl-bg"])?ct(n["--sl-bg"])==="#172033":!1;if(i===r)return null;let s=i?"#ffffff":"#1a2234",o=ct(t),a=n["--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":pr(a,o,t,s)}}var ur={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 Ha(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function Bt(n){if(n)return n==="auto"?Ha()?"dark":"light":n}function dt(n,e=n?.mode){if(n?.map)return n.map;let t=Bt(e);return t?{background:ur[t].map}:null}function ui(n){let e;try{e=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!e)return()=>{};let t=i=>n(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 $t(n,e,t){let i=t?ur[t]:null,r=e?.background??i?.background??n?.background??"#0f1522",s=Ae(r)?ct(r)==="#172033":!1,o=e?.surface??i?.surface??(s?"#ffffff":"#1a2234"),a=e?.accent??n?.accent??"#f4b740",l=n?.accentInk,c=e?.accentInk??(l&&(Ee(l,a)??4.5)>=4.5?l:ct(a,"#1a1200","#ffffff")),d=i?void 0:n?.textColor,p=e?.text??i?.text??(d&&(Ee(d,r)??4.5)>=4.5&&(Ee(d,o)??4.5)>=4.5?d:ct(r));return{"--sl-accent":a,"--sl-accent-ink":c,"--sl-accent-text":pr(a,p,r,o),"--sl-bg":r,"--sl-surface":o,"--sl-text":p,"--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??n?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}function Ra(){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 mr(n,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,i.lang=(0,pt.getLocale)(),i.dir=(0,pt.localeDirection)(),n.appendChild(i),Object.entries($t(void 0,t)).forEach(([s,o])=>i.style.setProperty(s,o)),i.innerHTML=`
41
+ `});var wd={};rr(wd,{ApiError:()=>j,BuyerAccessContext:()=>me,BuyerAccessUnavailableError:()=>de,BuyerRealtimeClient:()=>be,EmbeddedDesigner:()=>Bi,PerformanceGroupDestroyedError:()=>W,PerformanceGroupPicker:()=>rn,SEATING_CHART_CALLBACK_PROPS:()=>Cn,SEATING_CHART_HANDLE_METHODS:()=>kn,SEATING_CHART_IDENTITY_PROPS:()=>Sn,SEATING_CHART_VALUE_PROPS:()=>Tn,SeasonApiError:()=>q,SeasonPicker:()=>an,SeasonRecoveryTimeoutError:()=>ri,SeatPicker:()=>Ve,SeatingChart:()=>Ni,attachPickerFrame:()=>ya,bindSeatingChartHandle:()=>as,buildSeatingChartOptions:()=>ls,createBuyerAccessContext:()=>ft,createControllerSink:()=>at,parseTicketOfferAvailability:()=>Fi,shortOperationReference:()=>Pt,ticketOfferPrices:()=>Vi});module.exports=Ea(wd);var z=require("@seatlayer/core");var Ue="seatlayer.v1";function Aa(n){let e=typeof n.default=="string"?n.default:"free",t={};if(n.seats&&typeof n.seats=="object")for(let[i,r]of Object.entries(n.seats))typeof r=="string"&&r!==e&&(t[i]=r);return{default:e,exceptions:t}}function Pa(n,e){if(!n||n.default!==e.default)return null;let t=[];for(let[i,r]of Object.entries(e.exceptions))n.exceptions[i]!==r&&t.push({label:i,status:r});for(let i of Object.keys(n.exceptions))i in e.exceptions||t.push({label:i,status:e.default});return t}function Ma(n,e){for(let t of e)t.status===n.default?delete n.exceptions[t.label]:n.exceptions[t.label]=t.status}function ar(n){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(n))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var be=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,ar(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=[Ue];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(Ue)||e.unshift(Ue)):s?.ticket&&(e=[Ue,`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;ar(i);let r;try{r=(this.opts.socketFactory??((o,a)=>new WebSocket(o,a)))(i,e)}catch{this.scheduleReconnect();return}this.ws=r,r.onopen=()=>{this.ws===r&&(this.attempt=0,this.v1=r.protocol===Ue,this.v1||(this.useQueryMarker=!0),this.startKeepalive(r),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},5e3):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},5e3))},r.onmessage=s=>{if(this.ws!==r)return;let o;try{o=JSON.parse(typeof s.data=="string"?s.data:"")}catch{return}!o||typeof o!="object"||this.handleFrame(o)},r.onclose=s=>{if(this.ws===r){if(this.ws=null,this.clearTimers(),s?.code===4401){if(s.reason==="access_expired"){this.scheduleReconnect();return}this.stopped=!0,this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},r.onerror=()=>{try{r.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:[],r=Array.isArray(e.closed)?e.closed:[],s=i.join("\0"),o=r.join("\0");(s!==this.hidden||o!==this.closedSections)&&(this.hidden=s,this.closedSections=o,this.opts.sink.onSections?.(i,r))}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=Aa(e),r=Pa(this.projection,i);this.projection=i,r===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(i):this.opts.sink.resync():r.length&&this.opts.sink.applyStatuses(r);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let i=e.changes.filter(r=>typeof r?.label=="string"&&typeof r?.status=="string").map(r=>({label:r.label,status:r.status}));if(!i.length)return;this.projection&&Ma(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 La(n){return n==="blocked"?"not_for_sale":n==="held"||n==="booked"||n==="free"||n==="not_for_sale"?n:"free"}function at(n,e={}){let t=i=>{let r=n.tableSelection(i);if(r)return r.physicalSeatIds;let s=n.idForLabel(i);return s?[s]:[]};return{applyStatuses(i){let r=new Set([...n.currentHold()?.labels??[],...e.ownLabels?.()??[]]),s={free:[],held:[],booked:[],not_for_sale:[]},o=[],a=[],l=new Map(n.getSelection().map(c=>[c.label,c.id]));for(let c of i){let d=t(c.label);if(!d.length)continue;let p=La(c.status);if(s[p].push(...d),e.flashOnLiveChange&&p!=="free"&&!r.has(c.label)&&d.some(u=>n.getStatus(u)==="free")){let u=p==="held"?"#f4b740":"#f43f5e";for(let h of d)o.push({id:h,color:u})}p!=="free"&&!r.has(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])s[c].length&&n.setStatus(s[c],c);for(let c of o)n.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(p=>t(p));c.length&&n.deselect(c);let d=i.some(p=>p.status==="blocked"&&a.includes(p.label));e.onSelectedObjectUnavailable?.(a,d?"ineligible":"taken")}e.onStatusChange?.()},...n.applyProjection?{applyProjection:i=>{n.applyProjection(i)}}:{},async resync(i){await(n.resync?n.resync(i):n.refresh())},onSections(i,r){n.resync?n.resync({reason:"frame"}):n.refresh(),e.onSections?.(i,r)}}}var j=class extends Error{constructor(e,t,i,r,s,o){super(t),this.name="ApiError",this.status=e,this.code=i,this.conflicts=r,this.reason=s,this.retryAfterS=o}},lr=10,cr=1;function di(n,e){let t=(n??"").trim();if(t){let i=Number(t);if(Number.isFinite(i)&&i>=0)return Math.ceil(i);let r=Date.parse(t);if(Number.isFinite(r))return Math.max(0,Math.ceil((r-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}var Ha={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"},De=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 r=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:r,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 p=d,u=p?.code??p?.error;if(this.access?.configured&&(l.status===401||l.status===403||l.status===422)&&await this.access.handleFailure(l.status,u)&&!i.auth)return this.request(e,t,{...i,auth:!0});if(l.status===409){let g=u?Ha[u]:void 0,f=p?.conflicts?.map(x=>x.label)??t.labels??[];g&&this.onObjectUnavailable?.({labels:f,reason:g,code:u})}let h;if(l.status===429&&(h=di(l.headers.get("Retry-After"),p?.retryAfterSeconds)??cr,r==="GET"&&!i.rateLimit&&h<=lr))return await new Promise(g=>setTimeout(g,h*1e3)),this.request(e,t,{...i,rateLimit:!0});throw new j(l.status,p?.error??`request_failed_${l.status}`,u,p?.conflicts,p?.reason,h)}return d}async requestBlob(e,t={}){let i={},r=await this.access?.authorization(t.auth?"unauthorized":"initial");r&&(i.Authorization=r);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=di(s.headers.get("Retry-After"),a?.retryAfterSeconds)??cr,!t.rateLimit&&c<=lr))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new j(s.status,a?.error??`request_failed_${s.status}`,l,void 0,void 0,c)}chart(e){return this.request(`/pub/events/${encodeURIComponent(e)}/chart`)}eventConfiguration(e){return this.request(`/pub/events/${encodeURIComponent(e)}/event-configuration`)}reportViewEvidence(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/view-evidence-reports`,{method:"POST",body:{seatId:t.seatId,...t.evidenceId?{evidenceId:t.evidenceId}:{},...t.message?{message:t.message}:{}}})}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.requestBlob(`/pub/events/${encodeURIComponent(e)}/assets/${encodeURIComponent(t)}`):Promise.reject(new j(404,"not_found","not_found"))}objects(e){return this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`)}hold(e,t,i,r){return this.request(`/pub/events/${encodeURIComponent(e)}/hold`,{method:"POST",body:{selections:t,...i?{ttlMs:i}:{},...r?{replaceHoldId:r}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(s=>s.label)})}bestAvailable(e,t,i,r,s){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available`,{method:"POST",body:{qty:t,...i?{categoryKey:i}:{},...r?{zoneId:r}:{},...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?[]:[Ue]}createRealtime(e,t){return this.accessScoped?null:new be({url:this.subscribeUrl(e),sink:t})}};var ie=require("@seatlayer/core");var dt=require("@seatlayer/core");var hi=require("@seatlayer/core/core/color");function Ae(n){if(!n)return null;let e=n.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 r=t.length<=4?[...t].map(s=>`${s}${s}`).join(""):t;return{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.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 pi(n){return(0,hi.relativeLuminance255)([n.r,n.g,n.b])}function Ee(n,e){let t=Ae(n),i=Ae(e);if(!t||!i)return null;let r=Math.max(pi(t),pi(i)),s=Math.min(pi(t),pi(i));return(r+.05)/(s+.05)}function lt(n,e="#172033",t="#eef1f8"){return(Ee(e,n)??0)>=(Ee(t,n)??0)?e:t}function Ra(n){return(0,hi.rgb255ToHex)(n.r,n.g,n.b)}function Ia(n,e,t){let i=Ae(n),r=Ae(e);if(!i||!r)return null;let s=Math.max(0,Math.min(1,t));return Ra({r:i.r*s+r.r*(1-s),g:i.g*s+r.g*(1-s),b:i.b*s+r.b*(1-s)})}function dr(n,e,t,i){if((Ee(n,t)??4.5)>=4.5&&(Ee(n,i)??4.5)>=4.5)return n;if(!Ae(n)||!Ae(e))return e;for(let r=.15;r<=1;r+=.05){let s=Ia(n,e,1-r);if(s&&(Ee(s,t)??0)>=4.5&&(Ee(s,i)??0)>=4.5)return s}return e}function pr(n,e){let t=e??n["--sl-bg"],i=Ae(t)?lt(t)==="#172033":!1,r=Ae(n["--sl-bg"])?lt(n["--sl-bg"])==="#172033":!1;if(i===r)return null;let s=i?"#ffffff":"#1a2234",o=lt(t),a=n["--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":dr(a,o,t,s)}}var hr={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 Oa(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function Bt(n){if(n)return n==="auto"?Oa()?"dark":"light":n}function ct(n,e=n?.mode){if(n?.map)return n.map;let t=Bt(e);return t?{background:hr[t].map}:null}function ui(n){let e;try{e=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!e)return()=>{};let t=i=>n(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 $t(n,e,t){let i=t?hr[t]:null,r=e?.background??i?.background??n?.background??"#0f1522",s=Ae(r)?lt(r)==="#172033":!1,o=e?.surface??i?.surface??(s?"#ffffff":"#1a2234"),a=e?.accent??n?.accent??"#f4b740",l=n?.accentInk,c=e?.accentInk??(l&&(Ee(l,a)??4.5)>=4.5?l:lt(a,"#1a1200","#ffffff")),d=i?void 0:n?.textColor,p=e?.text??i?.text??(d&&(Ee(d,r)??4.5)>=4.5&&(Ee(d,o)??4.5)>=4.5?d:lt(r));return{"--sl-accent":a,"--sl-accent-ink":c,"--sl-accent-text":dr(a,p,r,o),"--sl-bg":r,"--sl-surface":o,"--sl-text":p,"--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??n?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}function _a(){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 ur(n,e,t){let i=document.createElement("div");i.className="sl-picker",i.tabIndex=-1,i.lang=(0,dt.getLocale)(),i.dir=(0,dt.localeDirection)(),n.appendChild(i),Object.entries($t(void 0,t)).forEach(([s,o])=>i.style.setProperty(s,o)),i.innerHTML=`
42
42
  <div class="sl-head">
43
43
  <div class="sl-logo" data-ref="logo"></div>
44
44
  <div class="sl-head-info" data-ref="headInfo">
@@ -73,7 +73,7 @@
73
73
  </div>
74
74
  <div class="sl-boot" data-ref="boot">
75
75
  <div class="sl-boot-bar" aria-hidden="true"></div>
76
- ${Ra()}
76
+ ${_a()}
77
77
  <span class="sl-boot-say" role="status" aria-live="polite" data-sl-t="picker.loadingSeatMap">${e("picker.loadingSeatMap","Loading seat map\u2026")}</span>
78
78
  </div>
79
79
  <div class="sl-toast" data-ref="toast" role="status" aria-live="polite"></div>
@@ -116,7 +116,7 @@
116
116
  <button type="button" class="sl-cta" data-ref="cta" disabled></button>
117
117
  </div>
118
118
  </div>
119
- </div>`;let r={};return i.querySelectorAll("[data-ref]").forEach(s=>{r[s.dataset.ref]=s}),{root:i,mapHost:r.map,els:r}}function fr(n){let e=(t,i)=>{for(let r of n.querySelectorAll(`[${t}]`)){let s=r.getAttribute(t);if(!s)continue;let o=(0,pt.t)(s);o!==s&&i(r,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)})}function mi(n,e){let t=(0,ie.resolveLocale)(n),i=ie.TRANSLATED_LOCALES.includes(t)?t:"en";return e&&(0,ie.setStringOverrides)(e),{locale:i,direction:(0,ie.localeDirection)(i),ready:(0,ie.loadLocale)(n)}}function fi(n,e,t){n.lang=e.locale,n.dir=e.direction,e.ready.then(t)}function gr(n,e){if(!n)return null;let t=(e.languages??[]).map(r=>(0,ie.resolveLocale)(r)).filter((r,s,o)=>o.indexOf(r)===s);if(t.length<2)return null;let i=document.createElement("select");i.className="sl-langsel",i.setAttribute("aria-label",e.label);for(let r of t){let s=document.createElement("option");s.value=r,s.textContent=ie.LOCALE_NAMES[r]??r,s.selected=r===(0,ie.getLocale)(),i.appendChild(s)}return i.addEventListener("change",()=>e.onChange(i.value)),n.appendChild(i),i}function br(n,e){e.root.lang=n,e.root.dir=(0,ie.localeDirection)(n),fr(e.root);for(let i of e.painters)try{i()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==n&&(t.value=n)}var pe=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}},Ia=new Set(["buyer_access_expired"]),Oa=new Set(["paused","provider_failed","channel_denied"]);function _a(n,e){switch(e){case"buyer_access_invalid":return"invalid";case"buyer_access_revoked":return"revoked";case"buyer_access_origin_mismatch":return"origin_mismatch";case"buyer_access_event_mismatch":return"event_mismatch";case"buyer_access_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";default:break}return n===401?"invalid":null}function Da(n,e){return n===401&&!!e&&Ia.has(e)}var Na=3e4,se,oe,ut,mt,Ft,Ne,Pe,ft,Vt,zt,jt,We,ae,cn,gi,ht,fe=class{constructor(e){D(this,ae);D(this,se,null);D(this,oe,0);D(this,ut,null);D(this,mt);D(this,Ft);D(this,Ne,null);D(this,Pe,null);D(this,ft,null);D(this,Vt);D(this,zt);D(this,jt,!1);D(this,We);if(A(this,mt,e.provider),A(this,Ft,e.skewMs??Na),A(this,Vt,e.onExpired),A(this,zt,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;P(this,ae,cn).call(this,t)}A(this,jt,!!f(this,mt)||!!f(this,se))}get configured(){return f(this,jt)}onRenewed(e){A(this,We,e)}get unavailable(){return f(this,Pe)}get hasToken(){return!!f(this,se)&&(f(this,oe)===0||f(this,oe)>Date.now())}get expiresAt(){return f(this,oe)}async authorization(e="initial"){if(!this.configured)return null;if(f(this,Pe))throw new pe(f(this,Pe));let t=Date.now();if(!f(this,se)||f(this,oe)>0&&f(this,oe)-f(this,Ft)<=t){let r=!!f(this,se)&&f(this,oe)>0&&f(this,oe)<=t,s=f(this,se)?r?"expired":"expiring":e,o=await P(this,ae,gi).call(this,s);if(!o)throw new pe(f(this,Pe)??f(this,ft)??P(this,ae,ht).call(this,"provider_failed"));return`Bearer ${o}`}return`Bearer ${f(this,se)}`}async handleFailure(e,t){var r;if(!this.configured)return!1;if(Da(e,t)){A(this,se,null),A(this,oe,0);let s=await P(this,ae,gi).call(this,"unauthorized",t);return(r=f(this,Vt))==null||r.call(this,{reason:"unauthorized",code:t,refreshed:!!s}),!!s}let i=_a(e,t);return i&&P(this,ae,ht).call(this,i,t,e),!1}async refresh(e="manual"){return A(this,Pe,null),A(this,ft,null),A(this,se,null),A(this,oe,0),!!await P(this,ae,gi).call(this,e)}clear(){A(this,se,null),A(this,ut,null),A(this,oe,0),A(this,Ne,null),A(this,We,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};se=new WeakMap,oe=new WeakMap,ut=new WeakMap,mt=new WeakMap,Ft=new WeakMap,Ne=new WeakMap,Pe=new WeakMap,ft=new WeakMap,Vt=new WeakMap,zt=new WeakMap,jt=new WeakMap,We=new WeakMap,ae=new WeakSet,cn=function(e){return!e||typeof e.token!="string"||!e.token?null:(A(this,ut,e.token),A(this,se,e.token),A(this,oe,typeof e.expiresAt=="number"?e.expiresAt:0),f(this,se))},gi=function(e,t){if(f(this,Ne))return f(this,Ne);let i=f(this,mt);if(!i)return P(this,ae,ht).call(this,"no_token",t),Promise.resolve(null);let r=f(this,ut),s=(async()=>{try{let o=await i({reason:e}),a=P(this,ae,cn).call(this,o);if(!a)return P(this,ae,ht).call(this,"provider_failed",t),null;if(r&&r!==a&&f(this,We))try{await f(this,We).call(this,{previousToken:r,token:a,reason:e})}catch{}return a}catch{return P(this,ae,ht).call(this,"provider_failed",t),null}finally{A(this,Ne,null)}})();return A(this,Ne,s),s},ht=function(e,t,i){var s;let r={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"};return A(this,ft,r),Oa.has(e)||(A(this,Pe,r),A(this,se,null),A(this,oe,0)),(s=f(this,zt))==null||s.call(this,r),r};function gt(n,e={}){return!n.buyerAccessTokenProvider&&!n.buyerAccessToken?null:new fe({provider:n.buyerAccessTokenProvider,token:n.buyerAccessToken,...e})}var Ba=3e4;function $a(n){if(!n||typeof n!="object"||Array.isArray(n))return!1;let e=n;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}var dn=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-Ba>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"}),r=await i.json().catch(()=>null);if(!i.ok){let s=i.status===429?di(i.headers.get("Retry-After"),r?.retryAfterSeconds):void 0;throw new j(i.status,r?.error??`request_failed_${i.status}`,r?.code??r?.error,void 0,void 0,s)}if(!$a(r))throw new j(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=r,r})();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}}},pn=class extends De{constructor(t,i,r,s,o){super(t,{...o,access:s});this.event=i;this.loader=r;this.bootstrapAccess=s;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1}assertEvent(t){if(t!==this.event)throw new j(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 bi(n){let e=new dn(n.base,n.event,n.publicKey),t=new fe({provider:({reason:i})=>e.token(i),...n.accessHooks});return{access:t,api:new pn(n.base,n.event,e,t,n.apiOptions??{})}}var Z=require("@seatlayer/core");var X={enter:260,exit:180,spring:320,flight:500,stagger:30,crossfade:120,collapse:150,rung:200,reducedFade:120,easeEnter:"cubic-bezier(.2,.8,.2,1)",easeExit:"cubic-bezier(.4,0,1,1)",easeSpring:"cubic-bezier(.34,1.56,.64,1)"};var Fa=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${X.enter}ms;--sl-dur-exit:${X.exit}ms;--sl-dur-spring:${X.spring}ms;--sl-dur-flight:${X.flight}ms;--sl-dur-stagger:${X.stagger}ms;--sl-dur-xfade:${X.crossfade}ms;--sl-dur-collapse:${X.collapse}ms;--sl-dur-rung:${X.rung}ms;--sl-ease-enter:${X.easeEnter};--sl-ease-exit:${X.easeExit};--sl-ease-spring:${X.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,Va=`@media (prefers-reduced-motion:reduce){.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:0ms;--sl-dur-exit:0ms;--sl-dur-spring:0ms;--sl-dur-flight:0ms;--sl-dur-stagger:0ms;--sl-dur-collapse:0ms;--sl-dur-rung:0ms;--sl-dur-xfade:${X.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:${X.reducedFade}ms;animation-delay:0ms}.sl-mo-hint,.sl-mo-rotate-in,.sl-mo-fly,.sl-mo-collapse{animation:none}.sl-confirm-add-invite,.sl-confirm-add-invite::after{animation:none}.sl-mo-indicator{transition:none}}`,vr=Fa+`
119
+ </div>`;let r={};return i.querySelectorAll("[data-ref]").forEach(s=>{r[s.dataset.ref]=s}),{root:i,mapHost:r.map,els:r}}function mr(n){let e=(t,i)=>{for(let r of n.querySelectorAll(`[${t}]`)){let s=r.getAttribute(t);if(!s)continue;let o=(0,dt.t)(s);o!==s&&i(r,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)})}function mi(n,e){let t=(0,ie.resolveLocale)(n),i=ie.TRANSLATED_LOCALES.includes(t)?t:"en";return e&&(0,ie.setStringOverrides)(e),{locale:i,direction:(0,ie.localeDirection)(i),ready:(0,ie.loadLocale)(n)}}function fi(n,e,t){n.lang=e.locale,n.dir=e.direction,e.ready.then(t)}function fr(n,e){if(!n)return null;let t=(e.languages??[]).map(r=>(0,ie.resolveLocale)(r)).filter((r,s,o)=>o.indexOf(r)===s);if(t.length<2)return null;let i=document.createElement("select");i.className="sl-langsel",i.setAttribute("aria-label",e.label);for(let r of t){let s=document.createElement("option");s.value=r,s.textContent=ie.LOCALE_NAMES[r]??r,s.selected=r===(0,ie.getLocale)(),i.appendChild(s)}return i.addEventListener("change",()=>e.onChange(i.value)),n.appendChild(i),i}function gr(n,e){e.root.lang=n,e.root.dir=(0,ie.localeDirection)(n),mr(e.root);for(let i of e.painters)try{i()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==n&&(t.value=n)}var de=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}},Da=new Set(["buyer_access_expired"]),Na=new Set(["paused","provider_failed","channel_denied"]);function Ba(n,e){switch(e){case"buyer_access_invalid":return"invalid";case"buyer_access_revoked":return"revoked";case"buyer_access_origin_mismatch":return"origin_mismatch";case"buyer_access_event_mismatch":return"event_mismatch";case"buyer_access_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";default:break}return n===401?"invalid":null}function $a(n,e){return n===401&&!!e&&Da.has(e)}var Fa=3e4,se,oe,ht,ut,Ft,Ne,Pe,mt,Vt,zt,jt,Ke,ae,cn,gi,pt,me=class{constructor(e){N(this,ae);N(this,se,null);N(this,oe,0);N(this,ht,null);N(this,ut);N(this,Ft);N(this,Ne,null);N(this,Pe,null);N(this,mt,null);N(this,Vt);N(this,zt);N(this,jt,!1);N(this,Ke);if(E(this,ut,e.provider),E(this,Ft,e.skewMs??Fa),E(this,Vt,e.onExpired),E(this,zt,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;A(this,ae,cn).call(this,t)}E(this,jt,!!m(this,ut)||!!m(this,se))}get configured(){return m(this,jt)}onRenewed(e){E(this,Ke,e)}get unavailable(){return m(this,Pe)}get hasToken(){return!!m(this,se)&&(m(this,oe)===0||m(this,oe)>Date.now())}get expiresAt(){return m(this,oe)}async authorization(e="initial"){if(!this.configured)return null;if(m(this,Pe))throw new de(m(this,Pe));let t=Date.now();if(!m(this,se)||m(this,oe)>0&&m(this,oe)-m(this,Ft)<=t){let r=!!m(this,se)&&m(this,oe)>0&&m(this,oe)<=t,s=m(this,se)?r?"expired":"expiring":e,o=await A(this,ae,gi).call(this,s);if(!o)throw new de(m(this,Pe)??m(this,mt)??A(this,ae,pt).call(this,"provider_failed"));return`Bearer ${o}`}return`Bearer ${m(this,se)}`}async handleFailure(e,t){var r;if(!this.configured)return!1;if($a(e,t)){E(this,se,null),E(this,oe,0);let s=await A(this,ae,gi).call(this,"unauthorized",t);return(r=m(this,Vt))==null||r.call(this,{reason:"unauthorized",code:t,refreshed:!!s}),!!s}let i=Ba(e,t);return i&&A(this,ae,pt).call(this,i,t,e),!1}async refresh(e="manual"){return E(this,Pe,null),E(this,mt,null),E(this,se,null),E(this,oe,0),!!await A(this,ae,gi).call(this,e)}clear(){E(this,se,null),E(this,ht,null),E(this,oe,0),E(this,Ne,null),E(this,Ke,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};se=new WeakMap,oe=new WeakMap,ht=new WeakMap,ut=new WeakMap,Ft=new WeakMap,Ne=new WeakMap,Pe=new WeakMap,mt=new WeakMap,Vt=new WeakMap,zt=new WeakMap,jt=new WeakMap,Ke=new WeakMap,ae=new WeakSet,cn=function(e){return!e||typeof e.token!="string"||!e.token?null:(E(this,ht,e.token),E(this,se,e.token),E(this,oe,typeof e.expiresAt=="number"?e.expiresAt:0),m(this,se))},gi=function(e,t){if(m(this,Ne))return m(this,Ne);let i=m(this,ut);if(!i)return A(this,ae,pt).call(this,"no_token",t),Promise.resolve(null);let r=m(this,ht),s=(async()=>{try{let o=await i({reason:e}),a=A(this,ae,cn).call(this,o);if(!a)return A(this,ae,pt).call(this,"provider_failed",t),null;if(r&&r!==a&&m(this,Ke))try{await m(this,Ke).call(this,{previousToken:r,token:a,reason:e})}catch{}return a}catch{return A(this,ae,pt).call(this,"provider_failed",t),null}finally{E(this,Ne,null)}})();return E(this,Ne,s),s},pt=function(e,t,i){var s;let r={reason:e,code:t,status:i,retryable:e==="paused"||e==="channel_denied"};return E(this,mt,r),Na.has(e)||(E(this,Pe,r),E(this,se,null),E(this,oe,0)),(s=m(this,zt))==null||s.call(this,r),r};function ft(n,e={}){return!n.buyerAccessTokenProvider&&!n.buyerAccessToken?null:new me({provider:n.buyerAccessTokenProvider,token:n.buyerAccessToken,...e})}var Va=3e4;function za(n){if(!n||typeof n!="object"||Array.isArray(n))return!1;let e=n;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}var dn=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-Va>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"}),r=await i.json().catch(()=>null);if(!i.ok){let s=i.status===429?di(i.headers.get("Retry-After"),r?.retryAfterSeconds):void 0;throw new j(i.status,r?.error??`request_failed_${i.status}`,r?.code??r?.error,void 0,void 0,s)}if(!za(r))throw new j(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=r,r})();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}}},pn=class extends De{constructor(t,i,r,s,o){super(t,{...o,access:s});this.event=i;this.loader=r;this.bootstrapAccess=s;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1}assertEvent(t){if(t!==this.event)throw new j(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 bi(n){let e=new dn(n.base,n.event,n.publicKey),t=new me({provider:({reason:i})=>e.token(i),...n.accessHooks});return{access:t,api:new pn(n.base,n.event,e,t,n.apiOptions??{})}}var Z=require("@seatlayer/core");var X={enter:260,exit:180,spring:320,flight:500,stagger:30,crossfade:120,collapse:150,rung:200,reducedFade:120,easeEnter:"cubic-bezier(.2,.8,.2,1)",easeExit:"cubic-bezier(.4,0,1,1)",easeSpring:"cubic-bezier(.34,1.56,.64,1)"};var ja=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${X.enter}ms;--sl-dur-exit:${X.exit}ms;--sl-dur-spring:${X.spring}ms;--sl-dur-flight:${X.flight}ms;--sl-dur-stagger:${X.stagger}ms;--sl-dur-xfade:${X.crossfade}ms;--sl-dur-collapse:${X.collapse}ms;--sl-dur-rung:${X.rung}ms;--sl-ease-enter:${X.easeEnter};--sl-ease-exit:${X.easeExit};--sl-ease-spring:${X.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,Ga=`@media (prefers-reduced-motion:reduce){.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:0ms;--sl-dur-exit:0ms;--sl-dur-spring:0ms;--sl-dur-flight:0ms;--sl-dur-stagger:0ms;--sl-dur-collapse:0ms;--sl-dur-rung:0ms;--sl-dur-xfade:${X.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:${X.reducedFade}ms;animation-delay:0ms}.sl-mo-hint,.sl-mo-rotate-in,.sl-mo-fly,.sl-mo-collapse{animation:none}.sl-confirm-add-invite,.sl-confirm-add-invite::after{animation:none}.sl-mo-indicator{transition:none}}`,br=ja+`
120
120
  /* Anchored open/close. The translate is 8px TOWARD the anchor, which is what
121
121
  makes the card look attached to the seat rather than dropped on the map. */
122
122
  .sl-mo-in{transform-origin:var(--sl-mo-ox) var(--sl-mo-oy);
@@ -183,7 +183,7 @@
183
183
  @keyframes slMoZoom{from{opacity:0;transform:scale(1.02)}to{opacity:1;transform:none}}
184
184
  .sl-mo-rotate-in{animation:slMoSpin var(--sl-dur-spring) var(--sl-ease-spring) 1 both}
185
185
  @keyframes slMoSpin{from{opacity:0;transform:rotate(-140deg) scale(.8)}to{opacity:1;transform:none}}
186
- `+Va;function vi(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function hn(n,e){if(!e){n.style.removeProperty("--sl-mo-ox"),n.style.removeProperty("--sl-mo-oy");return}yi(n,e,n.getBoundingClientRect())}function yi(n,e,t){let i=t.width||1,r=t.height||1,s=o=>Math.max(0,Math.min(100,o));n.style.setProperty("--sl-mo-ox",`${s((e.x-t.left)/i*100).toFixed(1)}%`),n.style.setProperty("--sl-mo-oy",`${s((e.y-t.top)/r*100).toFixed(1)}%`)}function yr(n,e,t){let i=n.getBoundingClientRect(),r=t.getBoundingClientRect();yi(n,e,{left:i.left-r.left,top:i.top-r.top,width:i.width,height:i.height})}function wi(n,e){n.classList.remove("sl-mo-out"),e!==void 0&&hn(n,e),n.classList.remove("sl-mo-in"),n.offsetWidth,n.classList.add("sl-mo-in")}function wr(n){n.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(n.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function Be(n,e,t={className:"sl-mo-out",duration:X.exit}){let i=()=>{r||(r=!0,!(typeof window>"u")&&(clearTimeout(s),n.removeEventListener("animationend",i),e?e():n.remove()))},r=!1;n.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),n.classList.add(t.className),n.addEventListener("animationend",i);let s=setTimeout(i,vi()?0:t.duration+60)}var xr={className:"sl-mo-slide-down",duration:X.exit};function un(n,e){n.textContent!==e&&(n.textContent=e,n.classList.remove("sl-mo-xfade"),n.offsetWidth,n.classList.add("sl-mo-xfade"))}function kr(n){if(vi())return n.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=n.label??"",e.style.left=`${n.from.x}px`,e.style.top=`${n.from.y}px`,e.style.background=n.color??"var(--sl-accent,#6e7bff)",e.style.color=n.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(n.to.x-n.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(n.to.y-n.from.y)}px`),document.body.appendChild(e);let t=!1,i=()=>{t||(t=!0,window.clearTimeout(r),e.remove(),n.onArrive?.())};e.addEventListener("animationend",i);let r=window.setTimeout(i,X.flight+80);return e}var G=n=>String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function bt(n,e){let t=0;for(let i of n.get(e)?.values()??[])t+=i;return t}function Sr(n){let e=[];for(let[t,i]of n)for(let[r,s]of i)s>0&&e.push({areaId:t,tierId:r,qty:s});return e}function Tr(n){let e=new Map;for(let t of n.keys())e.set(t,bt(n,t));return e}function Gt(n,e,t,i){let r=n.get(e)??new Map;i>0?r.set(t,i):r.delete(t),r.size?n.set(e,r):n.delete(e)}function Cr(n){let e=new Map;for(let t of n)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function Ye(n,e){let t=Cr(e),i=0;for(let r of n.keys())i+=Math.max(0,bt(n,r)-(t.get(r)??0));return i}function Er(n,e,t){let i=Cr(t),r=0;for(let s of e){let o=n.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),r+=d*n.paidPrice(s.categoryKey,l,za(s,l),s.id)}}return r}function za(n,e){return e?n.tiers?.find(t=>t.id===e)?.price??n.price:n.price}function Ar(n){let e=[],t=new Map;for(let i of n){if(i.objectType!=="ga"||!i.objectId){e.push({...i,labels:[i.label]});continue}let r=`${i.objectId}\0${i.tierId??""}`,s=t.get(r);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(r,o),e.push(o)}return e}function Pr(n,e,t){let i=new Set(t);for(let r of e)r.objectType==="ga"&&r.objectId&&i.has(r.label)&&Gt(n,r.objectId,r.tierId??null,0)}function fn(n,e){if(n.objectType!=="ga")return n.label;let t=e.find(i=>i.id===n.objectId);return t?.displayLabel??t?.label??n.label}function ja(n){let e=new Map;for(let t of n){if(t.objectType!=="ga"||!t.objectId)continue;let i=`${t.objectId}\0${t.tierId??""}`;e.set(i,(e.get(i)??0)+(t.quantity??1))}return e}function xi(n){let e=n.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:n.displayType??(0,Z.t)("picker.generalAdmission"),price:n.price}]}function Lr(n,e){let t=n.totalTicketCount()-bt(n.gaQty,e.id);return Math.max(0,Math.min(e.available,n.maxTickets-t))}function gn(n,e,t,i){if(Le(n,!1),n.salesClosed){n.toast(n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let r=xi(e),s=n.gaQty.get(e.id),o=bt(n.gaQty,e.id)>0,a=Lr(n,e);if(a<=0&&!o){n.toast(e.available>0?(0,Z.t)("picker.maxTicketsForOrder",{count:n.maxTickets}):n.tf("picker.soldOutTitle","Sold out"),"warning");return}if(n.onGAPromptHook){let u={};for(let[g,m]of s??[])u[g??""]=m;if(n.onGAPromptHook({area:e,selected:u,min:0,max:a,tiers:r,confirm:g=>{Ka(n,e,r,g,a)},cancel:()=>Le(n)})===!0)return}let l=new Map;for(let u of r)l.set(u.id,s?.get(u.id)??0);!o&&a>0&&l.set(r[0].id,1);let c={area:e,tiers:r,draft:l,max:a,reopened:o},d=n.root?.dataset.layout==="narrow",p=document.createElement("div");p.className=d?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",p.innerHTML=Ga(n,c,d),n.root?.appendChild(p),n.gaPromptEl=p,n.gaPromptReturnFocus=i??document.activeElement,d||Wa(n,p,t),n.reducedMotion()&&(p.dataset.motion="reduced"),Hr(n,c),qa(n,p,c),requestAnimationFrame(()=>p.querySelector('[data-ga-step="1"]')?.focus())}function Ga(n,e,t){let{area:i,tiers:r}=e,s=r.length>1,o=i.displayLabel??i.label,a=r.map(l=>`<div class="sl-ga-prompt-row" data-ga-tier="${G(l.id??"")}"><div class="sl-ga-prompt-label"><span>${G(s?l.label:n.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${G(n.money(n.paidPrice(i.categoryKey,l.id,l.price,i.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${G(s?l.label:o)}"><button type="button" data-ga-step="-1" aria-label="${G(n.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${G(n.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${G((0,Z.t)("picker.gaChooseForArea",{area:o}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${G(i.displayType??n.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${G(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="${G((0,Z.t)("common.close"))}">\xD7</button></div><div class="sl-ga-prompt-body">${a}`+(r.length>1?`<div class="sl-ga-prompt-total"><span>${G(n.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${G(n.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${G((0,Z.t)("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function bn(n){let e=0;for(let t of n.draft.values())e+=t;return e}function Mr(n,e){let t=0;for(let i of e.tiers)t+=(e.draft.get(i.id)??0)*n.paidPrice(e.area.categoryKey,i.id,i.price,e.area.id);return t}function Hr(n,e){let t=n.gaPromptEl;if(!t)return;let i=bn(e),r=Mr(n,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let d=c.dataset.gaTier?c.dataset.gaTier:null,p=e.draft.get(d)??0,u=c.querySelector("[data-ga-qty]");u&&(u.value=String(p)),c.querySelectorAll("[data-ga-step]").forEach(h=>{h.disabled=Number(h.dataset.gaStep)<0?p<=0:i>=e.max})});let s=t.querySelector("[data-ga-sub]");s&&(s.textContent=`${n.money(n.paidPrice(e.area.categoryKey,e.tiers[0].id,e.tiers[0].price,e.area.id))} \xB7 ${(0,Z.tCount)("picker.leftCount",e.area.available)}`);let o=t.querySelector("[data-ga-total]");o&&(o.textContent=n.money(r));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=i>=e.max&&e.max>0?e.area.available<=e.max?(0,Z.tCount)("picker.leftCount",e.area.available):(0,Z.t)("picker.maxTicketsForOrder",{count:n.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");l&&(l.textContent=e.reopened?(0,Z.tCount)("picker.gaUpdate",i,{count:i}):(0,Z.tCount)("picker.gaAdd",i,{count:i,price:n.money(r)}),l.disabled=i<=0&&!e.reopened)}function qa(n,e,t){e.querySelectorAll("[data-ga-step]").forEach(i=>{i.addEventListener("click",()=>{let r=i.closest("[data-ga-tier]");if(!r)return;let s=r.dataset.gaTier?r.dataset.gaTier:null,o=Number(i.dataset.gaStep),a=t.draft.get(s)??0,l=t.max-bn(t);t.draft.set(s,Math.max(0,a+(o>0?Math.min(1,l):-1))),Hr(n,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(i=>i.addEventListener("click",()=>Le(n))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{n.gaQty.delete(t.area.id),Le(n),n.syncTray(),mn(n,(0,Z.t)("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{Ua(n,t)}),e.addEventListener("mousedown",i=>{i.target===e&&Le(n)}),e.addEventListener("keydown",i=>{if(i.key==="Escape"){i.stopPropagation(),Le(n);return}if(i.key!=="Tab")return;let r=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!r.length)return;let s=r[0],o=r[r.length-1];i.shiftKey&&document.activeElement===s?(i.preventDefault(),o.focus()):!i.shiftKey&&document.activeElement===o&&(i.preventDefault(),s.focus())})}function Ua(n,e){let t=bn(e),i=Mr(n,e);for(let s of e.tiers)Gt(n.gaQty,e.area.id,s.id,e.draft.get(s.id)??0);Le(n),n.syncTray();let r=e.area.displayLabel??e.area.label;t>0?mn(n,(0,Z.tCount)("picker.gaAdded",t,{count:t,area:r,price:n.money(i)})):mn(n,(0,Z.t)("picker.gaRemoved",{area:r}))}function Ka(n,e,t,i,r){if(typeof i=="number")Gt(n.gaQty,e.id,t[0].id,Math.max(0,Math.min(r,Math.floor(i))));else{n.gaQty.delete(e.id);let s=r;for(let o of t){let a=Math.max(0,Math.floor(i[o.id??""]??0)),l=Math.min(a,s);s-=l,Gt(n.gaQty,e.id,o.id,l)}}n.syncTray()}function Le(n,e=!0){let t=n.gaPromptReturnFocus;n.gaPromptEl&&Be(n.gaPromptEl),n.gaPromptEl=null,n.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:n.root)?.focus())}function Wa(n,e,t){let i=n.root,r=e.querySelector(".sl-ga-pop");if(!i||!r||!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=r.offsetWidth||260,c=r.offsetHeight||220,d=Math.max(8,Math.min(s.width-l-8,o-l/2)),p=a-c-14,u=p>=8?p:Math.min(s.height-c-8,a+14);r.style.left=`${d}px`,r.style.top=`${Math.max(8,u)}px`,r.dataset.side=p>=8?"above":"below",r.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(l-12,o-d))}px`)})}function mn(n,e){n.srEl&&(n.srEl.textContent=e)}function Rr(n,e,t=[]){let i=[],r=ja(t);for(let o of e){let a=n.gaQty.get(o.id);if(!a)continue;let l=xi(o);for(let c of l){let d=(a.get(c.id)??0)-(r.get(`${o.id}\0${c.id??""}`)??0);if(d<=0)continue;let p=n.paidPrice(o.categoryKey,c.id,c.price,o.id);i.push(`<div class="sl-ga" data-ga="${G(o.id)}" data-ga-row-tier="${G(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${G(o.displayLabel??o.label)}</div><div class="sl-ga-sub">${G(l.length>1?c.label:o.displayType??n.tf("picker.generalAdmission","General admission"))} \xB7 ${G(n.money(p))} \xB7 ${G((0,Z.tCount)("picker.leftCount",o.available))}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${G(n.tf("picker.fewer","Fewer"))}">\u2212</button><span>${d}</span><button type="button" data-d="1" aria-label="${G(n.tf("picker.more","More"))}">+</button></div></div>`)}}let s=e.filter(o=>bt(n.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="${n.gaAreasExpanded}"><span>${G(n.tf("picker.gaAreasHeading","Areas"))}</span><small>${s.length}</small></button>`+(n.gaAreasExpanded?`<div class="sl-ga-areas-list">${s.map(o=>`<button type="button" class="sl-ga-area-open" data-ga-open="${G(o.id)}"${o.available<=0?" disabled":""}><span class="name">${G(o.displayLabel??o.label)}<small>${G(o.displayType??n.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${G(n.money(n.paidPrice(o.categoryKey,null,o.price,o.id)))} \xB7 ${G(o.available>0?(0,Z.tCount)("picker.leftCount",o.available):n.tf("picker.soldOutTitle","Sold out"))}</span></button>`).join("")}</div>`:"")+"</div>"),i.join("")}function Ir(n,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(i=>{i.addEventListener("click",()=>{let r=i.closest(".sl-ga");if(!r?.dataset.ga)return;let s=t.find(c=>c.id===r.dataset.ga);if(!s)return;let o=r.dataset.gaRowTier?r.dataset.gaRowTier:null,a=Number(i.dataset.d),l=n.gaQty.get(s.id)?.get(o)??0;if(a>0&&Lr(n,s)-bt(n.gaQty,s.id)<=0){n.toast((0,Z.t)("picker.maxTicketsForOrder",{count:n.maxTickets}),"warning");return}Gt(n.gaQty,s.id,o,Math.max(0,l+a)),n.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{n.gaAreasExpanded=!n.gaAreasExpanded,n.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(i=>{i.addEventListener("click",()=>{let r=t.find(s=>s.id===i.dataset.gaOpen);r&&gn(n,r,null,i)})})}var ki='<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 Ya=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Qa=/[\s"'<>`\\]/;function Xa(n){return n.startsWith("//")?!1:n.startsWith("/")||n.startsWith("./")||n.startsWith("../")}function Za(){try{let n=typeof location>"u"?"":location.origin;return n&&n!=="null"?n:null}catch{return null}}function vt(n){if(typeof n!="string"||!n||n.length>2e6||n!==n.trim())return!1;if(n.startsWith("data:"))return Ya.test(n);if(Qa.test(n))return!1;let e=Za();if(Xa(n)){if(!e)return!1;try{let t=new URL(n,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(n);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var Ja=/^[a-zA-Z0-9._-]+$/;function vn(n){let e;try{e=new URL(n,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;let t=/^\/pub\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!t)return null;try{let i=decodeURIComponent(t[1]),r=decodeURIComponent(t[2]);return!i||!Ja.test(r)?null:{eventKey:i,asset:r}}catch{return null}}function el(n){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(n,"https://seatlayer.invalid").pathname)}catch{return!1}}var yt=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=vn(e);if(!t)return Promise.resolve(el(e)||!vt(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let i=this.pending.get(e);if(i)return i;let r=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,r),r}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var Qe=require("@seatlayer/core"),Hi=require("@seatlayer/core/view3d/crossfade/panorama");var Or=`
186
+ `+Ga;function vi(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function hn(n,e){if(!e){n.style.removeProperty("--sl-mo-ox"),n.style.removeProperty("--sl-mo-oy");return}yi(n,e,n.getBoundingClientRect())}function yi(n,e,t){let i=t.width||1,r=t.height||1,s=o=>Math.max(0,Math.min(100,o));n.style.setProperty("--sl-mo-ox",`${s((e.x-t.left)/i*100).toFixed(1)}%`),n.style.setProperty("--sl-mo-oy",`${s((e.y-t.top)/r*100).toFixed(1)}%`)}function vr(n,e,t){let i=n.getBoundingClientRect(),r=t.getBoundingClientRect();yi(n,e,{left:i.left-r.left,top:i.top-r.top,width:i.width,height:i.height})}function wi(n,e){n.classList.remove("sl-mo-out"),e!==void 0&&hn(n,e),n.classList.remove("sl-mo-in"),n.offsetWidth,n.classList.add("sl-mo-in")}function yr(n){n.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(n.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function gt(n,e,t={className:"sl-mo-out",duration:X.exit}){let i=()=>{r||(r=!0,!(typeof window>"u")&&(clearTimeout(s),n.removeEventListener("animationend",i),e?e():n.remove()))},r=!1;n.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),n.classList.add(t.className),n.addEventListener("animationend",i);let s=setTimeout(i,vi()?0:t.duration+60)}var _d={className:"sl-mo-slide-down",duration:X.exit};function wr(n){if(vi())return n.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=n.label??"",e.style.left=`${n.from.x}px`,e.style.top=`${n.from.y}px`,e.style.background=n.color??"var(--sl-accent,#6e7bff)",e.style.color=n.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(n.to.x-n.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(n.to.y-n.from.y)}px`),document.body.appendChild(e);let t=!1,i=()=>{t||(t=!0,window.clearTimeout(r),e.remove(),n.onArrive?.())};e.addEventListener("animationend",i);let r=window.setTimeout(i,X.flight+80);return e}var G=n=>String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e]);function bt(n,e){let t=0;for(let i of n.get(e)?.values()??[])t+=i;return t}function xr(n){let e=[];for(let[t,i]of n)for(let[r,s]of i)s>0&&e.push({areaId:t,tierId:r,qty:s});return e}function kr(n){let e=new Map;for(let t of n.keys())e.set(t,bt(n,t));return e}function Gt(n,e,t,i){let r=n.get(e)??new Map;i>0?r.set(t,i):r.delete(t),r.size?n.set(e,r):n.delete(e)}function Sr(n){let e=new Map;for(let t of n)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function We(n,e){let t=Sr(e),i=0;for(let r of n.keys())i+=Math.max(0,bt(n,r)-(t.get(r)??0));return i}function Tr(n,e,t){let i=Sr(t),r=0;for(let s of e){let o=n.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),r+=d*n.paidPrice(s.categoryKey,l,qa(s,l),s.id)}}return r}function qa(n,e){return e?n.tiers?.find(t=>t.id===e)?.price??n.price:n.price}function Cr(n){let e=[],t=new Map;for(let i of n){if(i.objectType!=="ga"||!i.objectId){e.push({...i,labels:[i.label]});continue}let r=`${i.objectId}\0${i.tierId??""}`,s=t.get(r);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(r,o),e.push(o)}return e}function Er(n,e,t){let i=new Set(t);for(let r of e)r.objectType==="ga"&&r.objectId&&i.has(r.label)&&Gt(n,r.objectId,r.tierId??null,0)}function mn(n,e){if(n.objectType!=="ga")return n.label;let t=e.find(i=>i.id===n.objectId);return t?.displayLabel??t?.label??n.label}function Ua(n){let e=new Map;for(let t of n){if(t.objectType!=="ga"||!t.objectId)continue;let i=`${t.objectId}\0${t.tierId??""}`;e.set(i,(e.get(i)??0)+(t.quantity??1))}return e}function xi(n){let e=n.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:n.displayType??(0,Z.t)("picker.generalAdmission"),price:n.price}]}function Ar(n,e){let t=n.totalTicketCount()-bt(n.gaQty,e.id);return Math.max(0,Math.min(e.available,n.maxTickets-t))}function fn(n,e,t,i){if(Me(n,!1),n.salesClosed){n.toast(n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let r=xi(e),s=n.gaQty.get(e.id),o=bt(n.gaQty,e.id)>0,a=Ar(n,e);if(a<=0&&!o){n.toast(e.available>0?(0,Z.t)("picker.maxTicketsForOrder",{count:n.maxTickets}):n.tf("picker.soldOutTitle","Sold out"),"warning");return}if(n.onGAPromptHook){let u={};for(let[g,f]of s??[])u[g??""]=f;if(n.onGAPromptHook({area:e,selected:u,min:0,max:a,tiers:r,confirm:g=>{Qa(n,e,r,g,a)},cancel:()=>Me(n)})===!0)return}let l=new Map;for(let u of r)l.set(u.id,s?.get(u.id)??0);!o&&a>0&&l.set(r[0].id,1);let c={area:e,tiers:r,draft:l,max:a,reopened:o},d=n.root?.dataset.layout==="narrow",p=document.createElement("div");p.className=d?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",p.innerHTML=Ka(n,c,d),n.root?.appendChild(p),n.gaPromptEl=p,n.gaPromptReturnFocus=i??document.activeElement,d||Xa(n,p,t),n.reducedMotion()&&(p.dataset.motion="reduced"),Mr(n,c),Wa(n,p,c),requestAnimationFrame(()=>p.querySelector('[data-ga-step="1"]')?.focus())}function Ka(n,e,t){let{area:i,tiers:r}=e,s=r.length>1,o=i.displayLabel??i.label,a=r.map(l=>`<div class="sl-ga-prompt-row" data-ga-tier="${G(l.id??"")}"><div class="sl-ga-prompt-label"><span>${G(s?l.label:n.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${G(n.money(n.paidPrice(i.categoryKey,l.id,l.price,i.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${G(s?l.label:o)}"><button type="button" data-ga-step="-1" aria-label="${G(n.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${G(n.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${G((0,Z.t)("picker.gaChooseForArea",{area:o}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${G(i.displayType??n.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${G(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="${G((0,Z.t)("common.close"))}">\xD7</button></div><div class="sl-ga-prompt-body">${a}`+(r.length>1?`<div class="sl-ga-prompt-total"><span>${G(n.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${G(n.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${G((0,Z.t)("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function gn(n){let e=0;for(let t of n.draft.values())e+=t;return e}function Pr(n,e){let t=0;for(let i of e.tiers)t+=(e.draft.get(i.id)??0)*n.paidPrice(e.area.categoryKey,i.id,i.price,e.area.id);return t}function Mr(n,e){let t=n.gaPromptEl;if(!t)return;let i=gn(e),r=Pr(n,e);t.querySelectorAll("[data-ga-tier]").forEach(c=>{let d=c.dataset.gaTier?c.dataset.gaTier:null,p=e.draft.get(d)??0,u=c.querySelector("[data-ga-qty]");u&&(u.value=String(p)),c.querySelectorAll("[data-ga-step]").forEach(h=>{h.disabled=Number(h.dataset.gaStep)<0?p<=0:i>=e.max})});let s=t.querySelector("[data-ga-sub]");s&&(s.textContent=`${n.money(n.paidPrice(e.area.categoryKey,e.tiers[0].id,e.tiers[0].price,e.area.id))} \xB7 ${(0,Z.tCount)("picker.leftCount",e.area.available)}`);let o=t.querySelector("[data-ga-total]");o&&(o.textContent=n.money(r));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=i>=e.max&&e.max>0?e.area.available<=e.max?(0,Z.tCount)("picker.leftCount",e.area.available):(0,Z.t)("picker.maxTicketsForOrder",{count:n.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");l&&(l.textContent=e.reopened?(0,Z.tCount)("picker.gaUpdate",i,{count:i}):(0,Z.tCount)("picker.gaAdd",i,{count:i,price:n.money(r)}),l.disabled=i<=0&&!e.reopened)}function Wa(n,e,t){e.querySelectorAll("[data-ga-step]").forEach(i=>{i.addEventListener("click",()=>{let r=i.closest("[data-ga-tier]");if(!r)return;let s=r.dataset.gaTier?r.dataset.gaTier:null,o=Number(i.dataset.gaStep),a=t.draft.get(s)??0,l=t.max-gn(t);t.draft.set(s,Math.max(0,a+(o>0?Math.min(1,l):-1))),Mr(n,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(i=>i.addEventListener("click",()=>Me(n))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{n.gaQty.delete(t.area.id),Me(n),n.syncTray(),un(n,(0,Z.t)("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{Ya(n,t)}),e.addEventListener("mousedown",i=>{i.target===e&&Me(n)}),e.addEventListener("keydown",i=>{if(i.key==="Escape"){i.stopPropagation(),Me(n);return}if(i.key!=="Tab")return;let r=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!r.length)return;let s=r[0],o=r[r.length-1];i.shiftKey&&document.activeElement===s?(i.preventDefault(),o.focus()):!i.shiftKey&&document.activeElement===o&&(i.preventDefault(),s.focus())})}function Ya(n,e){let t=gn(e),i=Pr(n,e);for(let s of e.tiers)Gt(n.gaQty,e.area.id,s.id,e.draft.get(s.id)??0);Me(n),n.syncTray();let r=e.area.displayLabel??e.area.label;t>0?un(n,(0,Z.tCount)("picker.gaAdded",t,{count:t,area:r,price:n.money(i)})):un(n,(0,Z.t)("picker.gaRemoved",{area:r}))}function Qa(n,e,t,i,r){if(typeof i=="number")Gt(n.gaQty,e.id,t[0].id,Math.max(0,Math.min(r,Math.floor(i))));else{n.gaQty.delete(e.id);let s=r;for(let o of t){let a=Math.max(0,Math.floor(i[o.id??""]??0)),l=Math.min(a,s);s-=l,Gt(n.gaQty,e.id,o.id,l)}}n.syncTray()}function Me(n,e=!0){let t=n.gaPromptReturnFocus;n.gaPromptEl&&gt(n.gaPromptEl),n.gaPromptEl=null,n.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:n.root)?.focus())}function Xa(n,e,t){let i=n.root,r=e.querySelector(".sl-ga-pop");if(!i||!r||!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=r.offsetWidth||260,c=r.offsetHeight||220,d=Math.max(8,Math.min(s.width-l-8,o-l/2)),p=a-c-14,u=p>=8?p:Math.min(s.height-c-8,a+14);r.style.left=`${d}px`,r.style.top=`${Math.max(8,u)}px`,r.dataset.side=p>=8?"above":"below",r.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(l-12,o-d))}px`)})}function un(n,e){n.srEl&&(n.srEl.textContent=e)}function Lr(n,e,t=[]){let i=[],r=Ua(t);for(let o of e){let a=n.gaQty.get(o.id);if(!a)continue;let l=xi(o);for(let c of l){let d=(a.get(c.id)??0)-(r.get(`${o.id}\0${c.id??""}`)??0);if(d<=0)continue;let p=n.paidPrice(o.categoryKey,c.id,c.price,o.id);i.push(`<div class="sl-ga" data-ga="${G(o.id)}" data-ga-row-tier="${G(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${G(o.displayLabel??o.label)}</div><div class="sl-ga-sub">${G(l.length>1?c.label:o.displayType??n.tf("picker.generalAdmission","General admission"))} \xB7 ${G(n.money(p))} \xB7 ${G((0,Z.tCount)("picker.leftCount",o.available))}</div></div><div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${G(n.tf("picker.fewer","Fewer"))}">\u2212</button><span>${d}</span><button type="button" data-d="1" aria-label="${G(n.tf("picker.more","More"))}">+</button></div></div>`)}}let s=e.filter(o=>bt(n.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="${n.gaAreasExpanded}"><span>${G(n.tf("picker.gaAreasHeading","Areas"))}</span><small>${s.length}</small></button>`+(n.gaAreasExpanded?`<div class="sl-ga-areas-list">${s.map(o=>`<button type="button" class="sl-ga-area-open" data-ga-open="${G(o.id)}"${o.available<=0?" disabled":""}><span class="name">${G(o.displayLabel??o.label)}<small>${G(o.displayType??n.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${G(n.money(n.paidPrice(o.categoryKey,null,o.price,o.id)))} \xB7 ${G(o.available>0?(0,Z.tCount)("picker.leftCount",o.available):n.tf("picker.soldOutTitle","Sold out"))}</span></button>`).join("")}</div>`:"")+"</div>"),i.join("")}function Hr(n,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(i=>{i.addEventListener("click",()=>{let r=i.closest(".sl-ga");if(!r?.dataset.ga)return;let s=t.find(c=>c.id===r.dataset.ga);if(!s)return;let o=r.dataset.gaRowTier?r.dataset.gaRowTier:null,a=Number(i.dataset.d),l=n.gaQty.get(s.id)?.get(o)??0;if(a>0&&Ar(n,s)-bt(n.gaQty,s.id)<=0){n.toast((0,Z.t)("picker.maxTicketsForOrder",{count:n.maxTickets}),"warning");return}Gt(n.gaQty,s.id,o,Math.max(0,l+a)),n.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{n.gaAreasExpanded=!n.gaAreasExpanded,n.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(i=>{i.addEventListener("click",()=>{let r=t.find(s=>s.id===i.dataset.gaOpen);r&&fn(n,r,null,i)})})}var ki='<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 Za=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Ja=/[\s"'<>`\\]/;function el(n){return n.startsWith("//")?!1:n.startsWith("/")||n.startsWith("./")||n.startsWith("../")}function tl(){try{let n=typeof location>"u"?"":location.origin;return n&&n!=="null"?n:null}catch{return null}}function vt(n){if(typeof n!="string"||!n||n.length>2e6||n!==n.trim())return!1;if(n.startsWith("data:"))return Za.test(n);if(Ja.test(n))return!1;let e=tl();if(el(n)){if(!e)return!1;try{let t=new URL(n,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(n);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var il=/^[a-zA-Z0-9._-]+$/;function bn(n){let e;try{e=new URL(n,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;let t=/^\/pub\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!t)return null;try{let i=decodeURIComponent(t[1]),r=decodeURIComponent(t[2]);return!i||!il.test(r)?null:{eventKey:i,asset:r}}catch{return null}}function nl(n){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(n,"https://seatlayer.invalid").pathname)}catch{return!1}}var yt=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=bn(e);if(!t)return Promise.resolve(nl(e)||!vt(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let i=this.pending.get(e);if(i)return i;let r=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,r),r}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var Ye=require("@seatlayer/core"),Hi=require("@seatlayer/core/view3d/crossfade/panorama");var Rr=`
187
187
  /* confirm card: a candidate is not in the tray until Select. Map gestures and
188
188
  floating chrome pause while the card owns focus, keeping the camera stable. */
189
189
  .sl-picker[data-confirming="true"] .sl-map-host>:not(.sl-confirm){pointer-events:none}
@@ -307,6 +307,19 @@
307
307
  .sl-confirm-add-t{min-width:0}
308
308
  .sl-confirm-add::before{content:'';position:absolute;inset:0;z-index:0;transform:scaleX(0);transform-origin:left center;
309
309
  background:color-mix(in srgb,var(--sl-accent-ink) 20%,transparent)}
310
+ /* THE SAME CARD, ASKING THE OPPOSITE QUESTION. A second tap on a seat already
311
+ in the cart raises this card in its remove state, so the primary button has
312
+ to read as destructive without turning the card into a different object \u2014
313
+ the identity, the band, the price and the thumbnail are unchanged.
314
+
315
+ The red is DARKENED against the token: --sl-danger on white measures ~3.6:1,
316
+ and this is 13px bold, which is below the large-text threshold that ratio
317
+ would satisfy. Mixing 12% black takes it past 4.5:1 while still reading as
318
+ the same danger hue everywhere else in the widget uses it. The sweep overlay
319
+ is re-tinted to match, because it is defined against the accent ink. */
320
+ .sl-confirm-removing .sl-confirm-add{
321
+ background:color-mix(in srgb,var(--sl-danger) 88%,#000)!important;color:#fff!important}
322
+ .sl-confirm-removing .sl-confirm-add::before{background:color-mix(in srgb,#fff 20%,transparent)}
310
323
  .sl-confirm-add.is-adding{pointer-events:none}
311
324
  .sl-confirm-add.is-adding::before{animation:slAddSweep 360ms var(--slm-mo-out) both}
312
325
  .sl-confirm-add.is-adding svg{stroke-dasharray:24;animation:slAddCheck 360ms var(--slm-mo-out) both}
@@ -372,21 +385,46 @@
372
385
  .sl-confirm-row.sl-fit-icon .sl-confirm-cancel{flex:0 0 44px;width:44px;padding:9px 0;font-size:0;
373
386
  display:flex;align-items:center;justify-content:center;overflow:hidden}
374
387
  .sl-confirm-row.sl-fit-icon .sl-confirm-cancel::before{content:'\u2715';font-size:15px;line-height:1;font-weight:700}
375
- .sl-picker[data-layout="narrow"] .sl-confirm{left:50%!important;top:auto!important;bottom:14px;width:min(310px,calc(100% - 24px));
388
+ .sl-picker[data-layout="narrow"] .sl-confirm{left:50%!important;top:auto!important;bottom:14px!important;width:min(310px,calc(100% - 24px));
376
389
  transform:translateX(-50%);animation:slConfirmMobileIn .24s cubic-bezier(.2,.8,.2,1) both}
377
- /* THE CARD MUST NEVER COVER THE SEAT IT IS ASKING ABOUT, AND MUST NOT ABANDON
378
- IT EITHER. The phone card rests on the bottom edge, so a tap low on the map
379
- put a 213px card straight over the seat at y=700 \u2014 the buyer was asked to
380
- confirm a seat the confirmation had just hidden. Pinning it to the top of
390
+ /* THE CARD MUST NEVER COVER THE SEAT IT IS ASKING ABOUT, AND MUST NOT MOVE
391
+ AROUND EITHER. The phone card rests on the bottom edge, so a tap low on the
392
+ map put a 213px card straight over the seat at y=700 \u2014 the buyer was asked
393
+ to confirm a seat the confirmation had just hidden. Pinning it to the top of
381
394
  the map instead only traded that for a card at the opposite end of the
382
- screen from the seat it describes.
383
-
384
- So in this state the card HUGS the seat: reanchorConfirm writes an inline
385
- bottom offset that puts the card's lower edge a gap above the seat's screen
386
- point, clamped so the card's top never rises past the map's inset. No rule
387
- is needed here for the geometry \u2014 the attribute is the state, the widget
388
- owns the number, and that is the property this card already sits on, so
389
- nothing has to change which edge owns it. See narrowConfirmPlacement. */
395
+ screen from the seat. Letting it HUG the seat fixed both and cost the card
396
+ its resting place: the same tap landed the card at 502px on a top-row seat
397
+ and 383px on a bottom-row one.
398
+
399
+ So the card is ALWAYS this sheet \u2014 the !important on bottom is the point,
400
+ not a workaround: nothing may write an inline offset over it any more \u2014 and
401
+ the MAP moves instead, once, when the card is shown. See
402
+ narrowConfirmPlacement and ConfirmCard.liftSeatClearOfSheet. */
403
+ /* AND THE MAP GOES BEHIND GLASS WHILE IT ASKS. The phone card sits over a map
404
+ that is still fully legible, so the moment of decision competed with every
405
+ other seat on screen. The scrim blurs and darkens the map with a radial
406
+ mask cutting the tapped seat back out \u2014 a spotlight, not a curtain, because
407
+ the buyer is being asked about a seat they must still be able to see.
408
+
409
+ It NEVER takes a pointer event: the card's outside-tap listener reads a
410
+ press over the map underneath, and a scrim that swallowed it would have
411
+ sealed the buyer in. The mask centre is re-cut on every pan and zoom, so it
412
+ is inline (as one custom property, spent on both spellings here). Wide
413
+ layouts never mount it. */
414
+ .sl-picker[data-layout="narrow"] .sl-confirm-scrim{position:absolute;inset:0;z-index:9;pointer-events:none;
415
+ background:rgba(0,0,0,.38);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);
416
+ -webkit-mask-image:var(--sl-scrim-mask);mask-image:var(--sl-scrim-mask);
417
+ animation:slConfirmScrimIn .2s ease-out both}
418
+ @keyframes slConfirmScrimIn{from{opacity:0}to{opacity:1}}
419
+ /* Reduced TRANSPARENCY is a legibility setting, not a taste: drop the blur and
420
+ keep the dark fill, so the map still recedes without being smeared. */
421
+ @media (prefers-reduced-transparency: reduce){
422
+ .sl-picker[data-layout="narrow"] .sl-confirm-scrim{-webkit-backdrop-filter:none;backdrop-filter:none;
423
+ background:rgba(0,0,0,.5)}
424
+ }
425
+ @media (prefers-reduced-motion: reduce){
426
+ .sl-picker[data-layout="narrow"] .sl-confirm-scrim{animation:none}
427
+ }
390
428
  /* THE PHONE CONFIRMATION MUST BE CHECKABLE (owner review 2026-09-01). Packing
391
429
  category, section, row and seat into one sentence made every fact compete
392
430
  for the same ellipsis \u2014 exactly when the buyer is verifying the tap. Normal
@@ -523,7 +561,7 @@
523
561
  color:var(--sl-text);font-weight:700;font-size:12px;display:flex;align-items:center;justify-content:center;gap:7px}
524
562
  .sl-confirm-view:hover{border-color:var(--sl-muted)}
525
563
  .sl-confirm-view svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
526
- `;var _r=`
564
+ `;var Ir=`
527
565
  /* Test mode is environment context, not an action. The chip flows in the
528
566
  top-left anchor region: the old rotated corner ribbon sat at a negative
529
567
  offset and was clipped by the widget root's rounded overflow:hidden (its
@@ -755,7 +793,7 @@
755
793
  .sl-pg-switch:hover{border-style:solid;color:var(--sl-text);border-color:var(--sl-accent)}
756
794
  @media(prefers-reduced-motion:reduce){.sl-tip{animation:none!important}.sl-tip,.sl-tip-switch,.sl-pg-switch{transition:none!important}}
757
795
  @media(max-width:639px){.sl-confirm-group-dates{width:min(340px,calc(100% - 20px))}.sl-confirm-date{min-height:32px}}
758
- `;var Dr=`
796
+ `;var Or=`
759
797
  /* 3D venue overlay \u2014 mounts over the (paused) Konva stage inside the map host.
760
798
  Carries its own gradient so it paints instantly before the scene builds, and
761
799
  cross-fades on enter/exit via a compositor-only opacity transition. Sits below
@@ -1100,7 +1138,7 @@
1100
1138
  .sl-view3d-passport-shell{padding:max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom))}
1101
1139
  .sl-view3d-passport{width:100%;max-height:100%;padding:14px 14px max(24px,calc(14px + env(safe-area-inset-bottom)));border-radius:15px}
1102
1140
  }
1103
- `;var Nr=`
1141
+ `;var _r=`
1104
1142
  /* THE PHONE TICKET LIST (owner 2026-08-27: "on mobile the cards take lots of
1105
1143
  space, lots of white space on each card"). The desktop card spends ~72px per
1106
1144
  ticket on SECTION/ROW/SEAT eyebrows, a category line and a 34px icon rail \u2014
@@ -1351,7 +1389,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
1351
1389
  .sl-picker .sl-fitpill.sl-fit-p2,.sl-picker .sl-fitpill.sl-fit-p3{font-size:11.5px}
1352
1390
  .sl-picker .sl-fitpill.sl-fit-p3{white-space:normal;text-align:center;
1353
1391
  padding-top:6px;padding-bottom:6px;line-height:1.2}
1354
- `;var Br="seatlayer-picker-style",tl=`
1392
+ `;var Dr="seatlayer-picker-style",rl=`
1355
1393
  .sl-picker{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:420px;overflow:hidden;
1356
1394
  background:var(--sl-bg);color:var(--sl-text);font-family:var(--sl-font);border-radius:var(--sl-radius);
1357
1395
  --sl-r-sm:calc(var(--sl-radius) * .55);
@@ -2134,6 +2172,12 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
2134
2172
  padding:0 13px;gap:6px;border-radius:999px;font-size:11px;font-weight:800;
2135
2173
  background:var(--sl-surface);border:1px solid var(--sl-line);color:var(--sl-text);transition:border-color .15s}
2136
2174
  .sl-fs-pill.sl-fs-pill:hover{border-color:var(--sl-muted)}
2175
+ /* A pill the widget has taken off the map (the picker already fills the phone's
2176
+ viewport, so full screen has nothing to give) must actually go. The rule
2177
+ above is written at doubled specificity to survive host resets, which also
2178
+ beats the UA [hidden] rule \u2014 so the retraction has to be written at least
2179
+ as loudly as the thing it retracts. */
2180
+ [hidden].sl-fs-pill.sl-fs-pill{display:none}
2137
2181
  .sl-fs-pill svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
2138
2182
  .sl-fs-pill .sl-zfs-lbl{display:inline;letter-spacing:.02em;white-space:nowrap}
2139
2183
  /* In the header, icons carry it (owner call): square Full screen glyph. The
@@ -2521,32 +2565,6 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
2521
2565
  .sl-seccard.mini.on{display:inline-flex;align-items:center;gap:7px}
2522
2566
  .sl-seccard.mini .sl-seccard-name{font-size:12px;flex:none;max-width:120px}
2523
2567
  .sl-seccard.mini .sl-seccard-left{font-size:11px}
2524
- /* narrow: the LOCATOR \u2014 pinned to the map's own bottom edge.
2525
- It used to dock into the sheet head, which put it on the same edge as the
2526
- cart; the fix for that collision was to delete it once the cart filled, which
2527
- took the answer away from the buyer most likely to want it. On the map it
2528
- competes with nothing and never has to be suppressed. */
2529
- .sl-seccard.strip{position:absolute;left:50%;transform:translateX(-50%);bottom:12px;z-index:6;
2530
- width:auto;max-width:calc(100% - 24px);padding:6px 8px 6px 12px;border-radius:999px;
2531
- border:1px solid var(--sl-line);background:var(--sl-surface);color:var(--sl-text);
2532
- box-shadow:0 12px 30px -12px rgba(0,0,0,.55);cursor:default}
2533
- .sl-seccard.strip.on{display:flex;align-items:center;gap:7px;font-size:12.5px}
2534
- .sl-seccard.strip .sl-seccard-name{font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1 1 auto;min-width:0}
2535
- /* The name is the answer ("where am I"); the count is the detail. A plain
2536
- "flex:0 1" on the count was not enough - the two shrank in PROPORTION, so at 360px the
2537
- name sat on its floor while the count still held 55px of a row that had none
2538
- to spare. A dominant shrink factor makes the count collapse first, and the
2539
- measured fit pass below then swaps or drops it before it can clip. */
2540
- .sl-seccard.strip .sl-seccard-left{flex:0 200 auto;min-width:0;white-space:nowrap;overflow:hidden}
2541
- /* The count is measured after it mounts and swapped for a short form, or
2542
- dropped, before it is allowed to clip \u2014 so it never needs an ellipsis, and
2543
- must never be laid out (or announced) while hidden. */
2544
- .sl-seccard.strip .sl-seccard-left[hidden]{display:none}
2545
- /* The confirm card is bottom-anchored on narrow and owns this edge while it is
2546
- open; 3D has no 2D section context to report. */
2547
- .sl-picker[data-layout="narrow"][data-confirming="true"] .sl-seccard.strip,
2548
- .sl-picker[data-view3d="on"] .sl-seccard.strip{display:none}
2549
- .sl-seccard.strip .sl-seccard-price{margin-left:auto}
2550
2568
  .sl-seccard-head{display:flex;align-items:center;gap:8px}
2551
2569
  .sl-seccard-dot{width:10px;height:10px;border-radius:50%;flex:none}
2552
2570
  .sl-seccard-name{font-weight:800;font-size:14px;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@@ -2567,48 +2585,8 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
2567
2585
  .sl-seccard-nav button{width:28px;height:28px;border:1px solid var(--sl-line);border-radius:999px;color:var(--sl-text);
2568
2586
  background:color-mix(in srgb,var(--sl-surface) 88%,var(--sl-bg));font-size:14px;font-weight:850;line-height:1}
2569
2587
  .sl-seccard-nav button:hover,.sl-seccard-nav button:focus-visible{border-color:var(--sl-accent);color:var(--sl-accent-text)}
2570
- .sl-seccard.mini .sl-seccard-nav,.sl-seccard.strip .sl-seccard-nav{margin-left:2px}
2588
+ .sl-seccard.mini .sl-seccard-nav{margin-left:2px}
2571
2589
  .sl-seccard.mini .sl-seccard-nav button{width:24px;height:24px;font-size:12px}
2572
- /* Phone strip: every control is a finger target (\u226540px box, 44px row) and the
2573
- exit is a labelled "\u2039 Venue" chip \u2014 one tap in, one tap out. */
2574
- .sl-seccard.strip{padding:4px 4px 4px 12px;min-height:44px}
2575
- /* ...and on a phone it is a DOCK BAR, not a floating pill. The pill's rounded
2576
- ends and centred max-width spent ~40px of a 390px row on nothing, so the
2577
- name truncated to "Grand C\u2026" while the pill itself sat on top of the map's
2578
- own corner controls \u2014 a second rounded edge showing through behind it. A bar
2579
- that owns the bottom edge outright spends every pixel on the answer, and the
2580
- corner controls lift above it rather than fighting it. */
2581
- .sl-picker[data-layout="narrow"] .sl-seccard.strip{
2582
- left:0;right:0;bottom:0;transform:none;width:auto;max-width:none;
2583
- border-radius:0;border-width:1px 0 0 0;min-height:52px;
2584
- padding:0 8px 0 14px;padding-bottom:var(--sl-safe-b);
2585
- /* Opaque: seats scrolling under a translucent dock read as a rendering bug. */
2586
- background:var(--sl-surface);box-shadow:0 -10px 26px -20px rgba(0,0,0,.7)}
2587
- /* Total height of the dock, including the home-indicator inset it absorbs. */
2588
- .sl-picker[data-layout="narrow"]{--sl-locator-h:calc(52px + var(--sl-safe-b))}
2589
- /* Every absolutely-positioned bottom control on the map moves as one \u2014 the
2590
- regions are the only lever that reaches all of them, which is what they are
2591
- for. Skipped while the confirm card or 3D has taken the strip away. */
2592
- .sl-picker[data-layout="narrow"][data-locator="true"]:not([data-confirming="true"]):not([data-view3d="on"])
2593
- .sl-anchor[data-region="bottom-left"],
2594
- .sl-picker[data-layout="narrow"][data-locator="true"]:not([data-confirming="true"]):not([data-view3d="on"])
2595
- .sl-anchor[data-region="bottom-right"]{bottom:calc(12px + var(--sl-locator-h))}
2596
- .sl-picker[data-layout="narrow"][data-locator="true"]:not([data-confirming="true"]):not([data-view3d="on"])
2597
- .sl-anchor[data-region="bottom-center"]{bottom:calc(14px + var(--sl-locator-h))}
2598
- .sl-seccard.strip .sl-seccard-nav{gap:2px}
2599
- .sl-seccard.strip .sl-seccard-nav button{width:34px;height:36px;font-size:15px}
2600
- /* The accent ink is computed to clear 4.5:1 against the SURFACE (see
2601
- readableAccentText). Tinting the chip's ground 12% toward the accent moved it
2602
- off that guarantee and measured 4.2:1 on a light map theme. The ground is the
2603
- plain surface again and the accent identity lives in the ink and the border,
2604
- which is where a chip's identity belongs anyway. */
2605
- .sl-seccard-back{width:auto;height:36px;padding:0 10px 0 6px;flex:none;margin-left:2px;border-radius:999px;
2606
- display:inline-flex;align-items:center;gap:2px;font-size:12.5px;font-weight:800;color:var(--sl-accent-text);
2607
- background:var(--sl-surface);border:1px solid color-mix(in srgb,var(--sl-accent) 55%,var(--sl-line))}
2608
- .sl-seccard-back:active{transform:scale(.96)}
2609
- .sl-seccard-back-chev{font-size:18px;line-height:1;margin-top:-2px}
2610
-
2611
-
2612
2590
  /* commercial seat flags \u2014 limited-view caution + premium tag. Amber tone,
2613
2591
  deliberately distinct from the red taken/held state; shown on the confirm
2614
2592
  card, echoed as a small \u25D0 marker on cart chips and the hover tip. */
@@ -2774,15 +2752,6 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
2774
2752
  .sl-picker[data-theme="light"] .sl-rc[aria-pressed="true"] .sl-rc-dot{
2775
2753
  box-shadow:0 0 0 1.5px var(--sl-accent-ink)}
2776
2754
 
2777
- /* The phone's dock bar sits ON the map. Against a dark canvas its own surface
2778
- is the contrast, and a downward shadow is all it needs. Against a WHITE map
2779
- a white bar with a hairline top border has nothing separating it from the
2780
- venue behind it \u2014 the strip stops reading as a plate and starts reading as
2781
- the bottom of the page. It gets a real shadow and a visible line. */
2782
- .sl-picker[data-theme="light"][data-layout="narrow"] .sl-seccard.strip{
2783
- box-shadow:0 6px 20px -12px rgba(0,0,0,.35),0 -6px 20px -12px rgba(0,0,0,.35);
2784
- border-top-color:color-mix(in srgb,var(--sl-text) 12%,transparent)}
2785
-
2786
2755
  /* modal host */
2787
2756
  .sl-modal-scrim{position:fixed;inset:0;z-index:2147483000;background:rgba(5,7,12,.66);display:flex;align-items:center;justify-content:center;padding:18px}
2788
2757
  .sl-modal-frame{width:min(1200px,100%);height:min(820px,100%);border-radius:16px;overflow:hidden;box-shadow:0 40px 120px -30px rgba(0,0,0,.8)}
@@ -2792,7 +2761,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
2792
2761
  corners, and it is the frame. */
2793
2762
  .sl-modal-frame > .sl-picker{border-radius:0}
2794
2763
  @media(max-width:640px){.sl-modal-scrim{padding:0}.sl-modal-frame{width:100%;height:100%;border-radius:0}}
2795
- `;function wt(){if(document.getElementById(Br))return;let n=document.createElement("style");n.id=Br,n.textContent=tl+Or+Nr+Dr+_r+vr,document.head.appendChild(n)}var Gr=require("@seatlayer/core"),qr=require("@seatlayer/core/core/cdnAsset");var ll=require("@seatlayer/core/core/cdnAsset");function v(n,e){let t=(0,Gr.t)(n);return t===n?e:t}function kt(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?v("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):v("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function Ur(n,e){let t=e?n.toLocaleUpperCase(e):n.toLocaleUpperCase(),i=e?n.toLocaleLowerCase(e):n.toLocaleLowerCase();if(n!==t||t===i)return n;let r=[...i][0]??"";return(e?r.toLocaleUpperCase(e):r.toLocaleUpperCase())+i.slice(r.length)}function Kr(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}function _(n){return String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function Wr(n,e,t){let i=e.find(s=>vt(s))??null;if(n.replaceChildren(),!i)return n.textContent=t.slice(0,1).toUpperCase(),null;let r=document.createElement("img");return r.alt="",r.referrerPolicy="no-referrer",r.src=i,n.appendChild(r),i}var xt=null;function Si(){if(xt!==null)return xt;try{if(typeof document>"u")return xt=!1;xt=!!document.createElement("canvas").getContext("webgl2")}catch{xt=!1}return xt}function wn(n){return(0,qr.cdnAssetUrl)(n)}var qt=null;function Ut(){return qt||(qt=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(wn("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")).catch(e=>{throw qt=null,e}),qt)}function Ti(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Ut().catch(()=>{})}async function Ci(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(wn("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function Yr(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(wn("seatlayer-checkout.mjs")):Promise.resolve().then(()=>(jr(),zr))}function Qr(n){return n==="unavailable_for_event"||n==="payments_off_for_event"?n:"not_configured"}function Ei(n,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},r=new Date(n);if(e)try{return r.toLocaleString(t,{...i,timeZone:e})}catch{}return r.toLocaleString(t,i)}async function Ai(n,e){let t=n.overlay.productionElements;if(!t?.some(r=>r.contentImageUrl))return n;let i=await Promise.all(t.map(async r=>{if(!r.contentImageUrl)return r;try{let s=await e(r.contentImageUrl);if(!s){let{contentImageUrl:o,...a}=r;return a}return{...r,runtimeContentImageUrl:s}}catch{let{contentImageUrl:s,...o}=r;return o}}));return{...n,overlay:{...n.overlay,productionElements:i}}}async function Pi(n,e){if(n)try{let t=await e(n);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}var $e=require("@seatlayer/core/view/panoramaDelivery");function Li(n){let{root:e,source:t,caption:i,real:r,closeLabel:s,dragHint:o,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:d,onClose:p}=n,u=n.chrome??{},h=document.createElement("div");h.className="sl-view sl-mo-zoom",h.setAttribute("role","dialog"),h.setAttribute("aria-label",a),h.innerHTML='<div class="sl-view-head"><span class="sl-view-title"></span><span class="sl-view-cap"></span><button type="button" class="sl-view-x"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div><div class="sl-view-pano"><span class="sl-view-badge"></span><span class="sl-view-hint"></span></div>';let g=R=>h.querySelector(R)?.remove();u.title===!1?g(".sl-view-title"):h.querySelector(".sl-view-title").textContent=a,u.caption===!1?g(".sl-view-cap"):h.querySelector(".sl-view-cap").textContent=i,h.querySelector(".sl-view-x").setAttribute("aria-label",s),u.badge===!1?g(".sl-view-badge"):h.querySelector(".sl-view-badge").textContent=r?l:c,h.querySelector(".sl-view-hint").textContent=o,e.appendChild(h);let m=h.querySelector(".sl-view-pano"),y=(0,$e.planPanoramaDelivery)(t,(0,$e.browserPanoramaConstraints)()),S=new AbortController;m.style.backgroundImage=`url(${JSON.stringify(y.initialUrl)})`;let w=()=>{};y.upgradeUrl&&(w=(0,$e.schedulePanoramaUpgrade)(()=>{d(y.upgradeUrl).then(R=>!R||S.signal.aborted?null:(0,$e.loadPanoramaImage)(R,S.signal).then(()=>R)).then(R=>{!R||!h.isConnected||S.signal.aborted||(m.style.backgroundImage=`url(${JSON.stringify(R)})`)}).catch(()=>{})}));let T=70,b=35,E=1,x=m.clientHeight||1,L=m.clientWidth||1,I=-(x*(180/T)*2/2-L/2),C=0,O=()=>{let R=m.clientHeight||1,ot=R*(180/T)*E,Ue=Math.max(0,ot-R),Nt=Math.min(Ue/2,b/180*ot);C=Math.min(Nt,Math.max(-Nt,C)),m.style.backgroundSize=`auto ${ot}px`,m.style.backgroundPosition=`${I}px ${C-Ue/2}px`};O();let N=!1,z=0,Q=0,J=R=>{N=!0,z=R.clientX,Q=R.clientY,m.classList.add("drag"),m.setPointerCapture?.(R.pointerId)},U=R=>{N&&(I+=R.clientX-z,C+=R.clientY-Q,z=R.clientX,Q=R.clientY,O())},st=R=>{N=!1,m.classList.remove("drag"),m.releasePointerCapture?.(R.pointerId)},Dt=R=>{R.preventDefault(),E=Math.min(2.4,Math.max(1,E+(R.deltaY<0?.12:-.12))),O()};m.addEventListener("pointerdown",J),m.addEventListener("pointermove",U),m.addEventListener("pointerup",st),m.addEventListener("pointercancel",st),m.addEventListener("wheel",Dt,{passive:!1});let F=h.querySelector(".sl-view-x");F.addEventListener("click",p);let K=R=>{R.key==="Escape"&&(R.stopPropagation(),p())};return h.addEventListener("keydown",K),F.focus(),{element:h,dispose(){w(),S.abort(),m.removeEventListener("pointerdown",J),m.removeEventListener("pointermove",U),m.removeEventListener("pointerup",st),m.removeEventListener("pointercancel",st),m.removeEventListener("wheel",Dt),h.removeEventListener("keydown",K),F.removeEventListener("click",p)}}}function cl(n,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=n.find(s=>s.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let i=n.filter(s=>s.rowId===t.rowId),r=i.findIndex(s=>s.id===e);return{targetSeatId:e,previousSeatId:r>0?i[r-1].id:null,nextSeatId:r>=0&&r+1<i.length?i[r+1].id:null}}var Xr=6e4,Mi=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.focusedSectionId_=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 focusedSectionId(){return this.focusedSectionId_}get seatPosition(){return cl(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!Si()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),i=this.options.host(),r=this.options.doc();if(!t||!i||!r)throw new Error("seat_view_unavailable");let s=++this.seatViewGeneration,o,a,l=!1;if(t.viewUrl){let g=t.viewMeta?.previewUrl,m=!!g&&g!==t.viewUrl,y=m?await this.options.resolveAsset(g):null,S=m?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(s!==this.seatViewGeneration||!S||m&&!y)return;o={url:S,...y?{previewUrl:y}:{},...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,Hi.seatViewDisclosure)(o),l=(0,Hi.isAuthoredSeatView)(o)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:g}=await Ci();if(s!==this.seatViewGeneration)return;let m=r.floors?.find(w=>w.objects.some(T=>T.type==="row"&&T.id===t.rowId)),y=t.focalPoint??m?.focalPoint??r.focalPoint,S=g(t,y,[...this.options.seats()]);o={url:S.url,generated:!0},a=(0,Qe.t)("picker.illustrationCaption",{m:S.distanceM})}if(s!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(i,r),wt();let c=this.options.chrome??{},d=kt(),p=(0,Qe.t)("picker.viewFromSeat",{label:t.displayLabel||t.label}),u=l?(0,Qe.t)("picker.real360"):(0,Qe.t)("picker.preview"),h=Li({root:i,source:o,caption:a,real:l,closeLabel:v("picker.close","Close"),dragHint:d,viewFromSeatLabel:p,real360Label:(0,Qe.t)("picker.real360"),previewLabel:(0,Qe.t)("picker.preview"),chrome:{title:c.seatViewTitle,caption:c.seatViewCaption,badge:c.seatViewBadge},resolveAsset:this.options.resolveAsset,onClose:()=>this.closeSeatView(!0,!0)});this.seatViewElement=h.element,this.seatViewDispose=h.dispose,this.options.onSeatViewChange?.({seatId:t.id,title:p,caption:a,badge:u,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(r=>r.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,this.focusedSectionId_=null}max3DSeats(){let e=this.options.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?Xr/2:Xr}async enter3D(e){let t=this.options.host(),i=this.options.doc();if(!t||!i||this.overlay)throw new Error("venue_3d_unavailable");wt(),this.prepareHostTheme(t,i);let r=document.createElement("div");r.className="sl-view3d",r.setAttribute("role","group"),r.setAttribute("aria-label",v("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(r.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=v("picker.loading3d","Building the 3D venue\u2026"),r.appendChild(s),t.appendChild(r),this.overlay=r;let o=++this.generation;if(this.reducedMotion()?r.style.opacity="1":requestAnimationFrame(()=>{r.style.opacity="1"}),await this.nextPaint(),!(o!==this.generation||this.overlay!==r))try{let[a,l]=await Promise.all([Ut(),this.options.loadEventConfiguration()]),c=l?await Ai(l,this.options.resolveAsset):null,d=await Pi(i.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(o!==this.generation||this.overlay!==r)return;let p={doc:i,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};s.textContent=v("picker.building3d","Building venue geometry\u2026");let u=await a.prepareVenue3D(p);if(o!==this.generation||this.overlay!==r)return;let h=this.options.chrome??{},g=a.mountVenue3D(r,{...p,prepared:u},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:kt(),...h.view3dCaption===!1||h.view3dSeatStepper===!1||h.view3dControlDock===!1?{chrome:{caption:h.view3dCaption!==!1,seatStepper:h.view3dSeatStepper!==!1,controlDock:h.view3dControlDock!==!1}}:{},seatViewActionLabel:m=>this.findSeat(m)?.viewUrl?v("picker.openAuthored360","Open venue 360\xB0"):v("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:m=>this.toggleSeat(m),onSeatInspect:m=>this.toggleSeat(m),onViewTargetChange:m=>{this.targetSeatId_=m,m&&(this.focusedSectionId_=this.findSeat(m)?.sectionId??null),this.options.onViewChange("venue3d",m)},onSectionFocusChange:m=>{this.focusedSectionId_=m,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:m=>this.seatViewFor3D(m)}:{}});if(o!==this.generation||this.overlay!==r){g.dispose();return}this.handle=g,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,g.setNavigationMode(this.navigationMode_),requestAnimationFrame(()=>s.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await g.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.focusedSectionId_=null,this.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let i=this.handle,r=this.overlay;if(this.options.restoreMap(),t&&i&&r){r.style.pointerEvents="none";let s=()=>{this.buyerView_!=="map"||this.overlay!==r||(r.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(r.style.opacity="0",s()):(requestAnimationFrame(()=>{r.style.opacity="0"}),setTimeout(s,280));return}if(this.handle=null,this.overlay=null,!r){try{i?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{i?.dispose()}catch{}r.remove(),this.options.restoreMap();return}r.style.pointerEvents="none",requestAnimationFrame(()=>{r.style.opacity="0"}),setTimeout(()=>{try{i?.dispose()}catch{}r.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,i=this.handle;if(!t||!i)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),i.resize(),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(r=>r.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,r=!!i&&i!==t.viewUrl,s=r?await this.options.resolveAsset(i):null,o=r?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!o||r&&!s)throw new Error("seat_view_unavailable");return{url:o,...s?{previewUrl:s}:{},...r?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:v("picker.chartDerivedModel","Chart-derived model")}}closeSeatView(e=!0,t=!1){e&&(this.seatViewGeneration+=1);let i=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!i){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){i.remove();return}i.classList.add("is-leaving"),setTimeout(()=>i.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(i=>i.objects)??e.objects).some(i=>i.type==="shape"&&(i.role==="stage"||!!i.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let i=t.theme;e.style.setProperty("--sl-bg",i?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",i?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",i?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",i?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};var dl={host:"web",platform:"web",bundle:"",protocol:0,chromeOwner:"web"},pl={...dl},Ri=null,Zr=null;function hl(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function ul(){let n=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:n(hl()),documentMs:Ri==null?0:n(Ri),handshakeMs:Ri==null||Zr==null?0:n(Zr-Ri)}}function Jr(){let{host:n,platform:e,bundle:t,protocol:i,chromeOwner:r}=pl,s=ul();return{host:n,platform:e,...t?{bundle:t}:{},...i?{protocol:i}:{},chromeOwner:r,bootMs:s.bootMs,documentMs:s.documentMs,handshakeMs:s.handshakeMs}}var es=new Set;function Fe(n){return es.has(n)?"repeat":"cold"}function Ii(n){let e=Fe(n);return es.add(n),e}function he(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0?Math.round(n):0}function ml(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function fl(n){if(!/^[A-Za-z0-9_-]{1,80}$/.test(n.event))return null;let e=n.performanceProfile??{};return{event:n.event,scope:n.scope,surface:n.surface,outcome:n.outcome,stage:n.stage?.slice(0,32)??"",ms:he(n.ms),api:he(e.loadChartAndStatuses)||he(e.loadChart),scene:he(e.buildScene),panel:he(e.buildBuyerControls),paint:he(e.firstPaint),normalize:he(e.normalizeBuyerModel),renderer:he(e.createRenderer),seats:he(n.seats),floors:he(n.floors),view:n.view??"map",load:n.load??Fe(n.event),transport:n.transport??"pubapi",chartBytes:he(n.chartDelivery?.bytes),chartCache:n.chartDelivery?.cache??"",...Jr(),availabilityMs:he(e.loadStatuses)}}var gl=new Set;function Me(n){let e=fl(n);if(e){for(let t of gl)try{t(e)}catch{}typeof fetch>"u"||ml()||fetch(`${n.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}function Kt(n){if(!n)return null;let e=n.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function bl(n){return Kt(n.peek?.querySelector(".sl-peek-sum"))??Kt(n.foot?.querySelector(".sl-total"))??Kt(n.tray)??Kt(n.sheetHead)}function kn(n,e,t,i){let r=n,s=r.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(p=>p.key===t.categoryKey)?.color,d=()=>{let p=bl(r);p&&kr({from:a,to:{x:p.left+p.width/2,y:p.top+p.height/2},label:l,color:c})};Kt(r.peek)?requestAnimationFrame(d):d()}var xn=60,vl=650;function ts(n,e){if(!e.length||n.focusSeats?.(e.map(r=>r.id)))return;let t=e.find(r=>r.sectionId)?.sectionId;if(!t)return;let i=e.filter(r=>r.sectionId===t);n.focus(t,{x:i.reduce((r,s)=>r+s.x,0)/i.length,y:i.reduce((r,s)=>r+s.y,0)/i.length})}function is(n,e){let t=!vi();ts({focusSeats:i=>n.focusSeats?.(i,{animate:t})===!0,focus:(i,r)=>n.focusSection(i,r)},(e?.items??[]).filter(i=>i.objectType!=="ga").slice(0,10).map(i=>n.seatByLabel(i.label)).filter(i=>!!i))}function ns(n,e){if(!e.length)return;let t=n.reducedMotion===!0;t||e.forEach((o,a)=>{n.schedule(()=>n.pop(o.id),a*xn)});let i=t?0:e.length*xn,r=e.find(o=>o.sectionId)?.sectionId;if(n.schedule(()=>ts(n,e),i),t)return;let s=i+(n.focusSeats||r?vl:0);e.forEach((o,a)=>{n.schedule(()=>kn(n.regions,n.screenPoint(o),o,n.categories),s+a*xn)})}var Wt=class n{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let i=t!==void 0&&"mapTheme"in t;e===this.mode&&!i||(i&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return dt(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??n.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=ui(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};var ss=require("@seatlayer/core"),os=require("@seatlayer/core/core/seatConfidence");var rs=require("@seatlayer/core");function St(n){let e=n.viewMeta?.previewUrl??n.viewUrl;return e&&(vn(e)||vt(e))?e:null}function _i(n){if(!n)return!1;let e=n.floors?.length?n.floors.map(t=>t.objects??[]):[n.objects??[]];for(let t of e)for(let i of t)if(i.type==="shape"&&(i.role==="stage"||i.stageKind))return!0;return!1}var yl=512,Oi=new Map;function Di(n,e){if(!e)return null;let t=`${n.id}|${Math.round(e.x)},${Math.round(e.y)}`,i=Oi.get(t);if(i!==void 0)return i;let r=null;try{r=(0,rs.generateSeatThumb)(n,e).distanceM??null}catch{r=null}return Oi.size>=yl&&Oi.clear(),Oi.set(t,r),r}function Yt(n){return n.getFocusedSection()!==null||n.seatsRevealed()}function wl(n,e){return{accessibilityFilter:n.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function xl(n,e,t,i){for(let r of e){if(r.count<=0)continue;let s=n.accessibilitySpread?.([r.key]);for(let o of s?.sections??[]){let a=t.get(o.id)??i.get(o.id);if(!a||o.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[r.key]=o.free}}}function as(n,e,t){let i=n.doc,r=i?.theme??{},s=n.categoryAvailability(),o=n.getGAAreas(),a=n.getFloors(),l=n.getExpandedSeats(),c=n.getAccessNeeds(),d=wl(c,l),p=e.seatPosition,u=p.targetSeatId?n.seatDetails(p.targetSeatId):null,h=new Map(l.map(w=>[w.id,w])),g=_i(i),m=i?.floors?.flatMap(w=>w.objects)??i?.objects??[],y=new Map,S=new Map;for(let w of m){if(w.type!=="section")continue;let T={id:w.id,label:w.label,...w.displayLabel?{displayLabel:w.displayLabel}:{},...w.zone?{zoneId:w.zone}:{}};y.set(w.id,T);let b=w.logicalSectionId??w.id;S.has(b)||S.set(b,T)}return xl(n,c,y,S),{event:{key:t.event,name:t.eventInfo?.name??i?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:(0,ss.getLocale)()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...r.accent?{accent:r.accent}:{},...r.accentInk?{accentInk:r.accentInk}:{},...r.background?{background:r.background}:{},...r.textColor?{textColor:r.textColor}:{},...r.brandName?{brandName:r.brandName}:{},...r.logoUrl?{logoUrl:r.logoUrl}:{},attributionRequired:!r.hideBadge},features:{ga:o.length>0,tiers:!!i?.categories.some(w=>w.tiers?.length),floors:a.length>1,zones:!!i?.zones?.length,sections:y.size>0,bestAvailable:!0,...d,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(i?.categories??[]).filter(w=>!w.notForSale).map(w=>({key:w.key,label:w.label,color:w.color,price:w.price??w.tiers?.[0]?.price??0,available:s[w.key]??0,...Object.prototype.hasOwnProperty.call(s,w.key)?{free:s[w.key]}:{},tiers:(w.tiers??[]).map(T=>({id:T.id,name:T.name,price:T.price,...T.currency?{currency:T.currency}:{}}))})),zones:(i?.zones??[]).map(w=>({id:w.id,label:w.label,...w.color?{color:w.color}:{}})),sections:[...y.values()],gaAreas:o,bestAvailableZones:n.getBestAvailableZones()},map:{floors:a,activeFloorId:n.getActiveFloorId()||a[0]?.id||null,floorMode:n.isFloorOverview()?"all":"single",floorLabelStyle:n.getRenderer()?.getFloorLabelStyle?.()??"number",rung:n.getRung(),canZoomOut:Yt(n)||t.focusedSection_!==null,focusedSectionId:n.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:n.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:p.targetSeatId,view3dTargetSeat:u,view3dPreviousSeatId:p.previousSeatId,view3dNextSeatId:p.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:n.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:n.getSelection().map(w=>{let T=h.get(w.id);if(!T)return w;let b=n.worldToScreen({x:T.x,y:T.y}),E=St(T),x=g?Di(T,T.focalPoint??i?.focalPoint):null;return{...w,screenPoint:{x:b.x,y:b.y},...E?{seatViewThumb:{reference:E,kind:"real"}}:{},...x!=null?{sightlineMetres:x}:{},...T.confidenceEvidence?{seatViewConfidence:(0,os.seatConfidenceDisclosure)(T.confidenceEvidence)}:{}}}),validity:n.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var kl="https://api.seatlayer.io",ls=10;function Sl(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}var Ni=class{constructor(e){this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=null;this.localeGeneration=0;this.languageSelect=null;this.rendered=!1;this.mode_=null;this.eventInfo=null;this.categoryFilter_=null;this.accessibilityFilter_=null;this.hideLimitedView_=!1;this.focusedSection_=null;this.lastReportedViewRung_=null;this.lastReportedCanZoomOut_=!1;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.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??ls,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()}},r=(e.apiBase??kl).replace(/\/+$/,"");this.apiBase=r;let s=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?bi({base:r,event:e.event,publicKey:e.publicKey,accessHooks:i,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=s?.access??gt(e,i);let o=s?.api??new De(r,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=o,this.controller=new V.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),onDeselect:a=>{this.controller.currentHold()?.labels.includes(a.label)&&this.controller.releaseLabels([a.label])},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??ls)-this.controller.getSelection().length)),tiers:xi(l),confirm:c=>{let d=typeof c=="number"?c:Object.values(c).reduce((p,u)=>p+u,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??Wt.groundFor(e.theme?.mode)??null}),this.hostSurface=new Wt({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 yt(e.event,(a,l)=>o.asset(a,l)),this.immersive=new Mi({host:()=>this.hostEl,doc:()=>this.controller.doc,seats:()=>this.controller.getExpandedSeats(),selection:()=>this.controller.getSelection(),status:a=>this.controller.getStatus(a),select:a=>this.controller.select([a]),deselect:a=>this.controller.deselect([a]),loadEventConfiguration:()=>this.controller.loadEventConfiguration(),resolveAsset:a=>this.buyerAssetUrls.resolve(a),enable3D:e.enable3D!==!1,enableSeatView:e.enableSeatView!==!1,max3DSeats:e.max3DSeats,...e.chrome?{chrome:e.chrome}:{},restoreMap:()=>this.controller.refitCurrentView(),onViewChange:(a,l)=>{this.opts.onBuyerViewChange?.({view:a,...l?{seatId:l}:{}}),this.notifyMapStateChange()},onSeatViewChange:a=>this.opts.onSeatViewChange?.(a),onError:a=>this.opts.onError?.(a)}),this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=Yt(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=Yt(this.controller);e===this.lastReportedViewRung_&&t===this.lastReportedCanZoomOut_||(this.lastReportedViewRung_=e,this.lastReportedCanZoomOut_=t,this.opts.onMapStateChange?.())}notifyMapStateChange(){this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=Yt(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=mi(this.opts.locale,this.opts.messages),i=this.localeGeneration+=1,r=(0,V.getLocale)();this.mount=Sl(this.opts.container);let s=document.createElement("div");s.style.width="100%",s.style.height="100%",s.style.position="relative",this.mount.appendChild(s),this.hostEl=s,fi(s,t,a=>{a!==r&&this.applyActiveLocale(a,i)}),this.applyInteractionState();let o=await this.controller.render(s);if(!o)return Me({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:Fe(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(s),this;if(this.eventLocale=o.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(s),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=o.mode==="test"?"test":"live",this.eventInfo={name:o.eventName,venue:o.venue??null,startsAt:o.startsAt??null,timezone:o.timezone??null,currency:o.currency??this.opts.currency??"USD",posterUrl:o.posterUrl??null,salesClosed:o.salesClosed},this.opts.seatTooltip!==!1){let a=document.createElement("div");a.setAttribute("role","tooltip"),a.style.cssText='position:absolute;z-index:7;pointer-events:none;display:none;max-width:240px;background:#10162a;color:#fff;border-radius:10px;padding:9px 12px;font:500 12px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 10px 30px -10px rgba(0,0,0,.5);',s.appendChild(a),this.tipEl=a,this.onTipMove=l=>{let c=s.getBoundingClientRect();this.tipPos={x:l.clientX-c.left,y:l.clientY-c.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},s.addEventListener("mousemove",this.onTipMove)}if(o.mode==="test"&&this.opts.showTestModeIndicator!==!1){s.style.overflow="hidden";let a=document.createElement("div");a.dataset.slI18n="testMode",a.textContent=(0,V.t)("picker.testMode"),a.setAttribute("aria-label",(0,V.t)("picker.testMode")),a.style.cssText="position:absolute;top:18px;right:-34px;z-index:6;transform:rotate(45deg);width:140px;text-align:center;padding:4px 0;background:#f4b740;color:#1a1200;font:800 10.5px/1.4 -apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:.12em;box-shadow:0 2px 8px rgba(0,0,0,.25);pointer-events:none;",s.appendChild(a)}return this.opts.showAttribution!==!1&&this.buildBadge(s),Me({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:o.performanceProfile,chartDelivery:o.chartDelivery,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:Ii(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,V.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=ki;let r=document.createElement("span");r.textContent=(0,V.t)("picker.poweredBy"),t.append(i,r),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,r=this.tipPos.x+14,s=this.tipPos.y-i-12;r+t>e-8&&(r=this.tipPos.x-t-14),s<8&&(s=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,r)}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,V.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 r=document.createElement("div");r.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,r.append(s,o,a),this.tipEl.replaceChildren(i,r),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,V.t)("map.statusHeld"):(0,V.t)("map.statusTaken"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(r=>(0,V.resolveLocale)(r)).filter((r,s,o)=>o.indexOf(r)===s);if(t.length<2)return;let i=document.createElement("select");i.setAttribute("aria-label",(0,V.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 r of t){let s=document.createElement("option");s.value=r,s.textContent=V.LOCALE_NAMES[r]??r,s.selected=r===(0,V.getLocale)(),i.appendChild(s)}i.addEventListener("change",()=>{this.setLocale(i.value)}),e.appendChild(i),this.languageSelect=i}async setLocale(e){let t=(0,V.getLocale)(),i=this.localeGeneration+=1,r=await(0,V.loadLocale)(e);return this.opts.messages&&(0,V.setStringOverrides)(this.opts.messages),r===t||this.applyActiveLocale(r,i),r}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let i=this.hostEl;if(i){i.lang=e,i.dir=(0,V.localeDirection)(e);for(let r of i.querySelectorAll("[data-sl-i18n]"))if(r.dataset.slI18n==="testMode")r.textContent=(0,V.t)("picker.testMode"),r.setAttribute("aria-label",(0,V.t)("picker.testMode"));else if(r.dataset.slI18n==="badge"){r.setAttribute("aria-label",(0,V.t)("picker.poweredBy"));let s=r.querySelector("span:last-child");s&&(s.textContent=(0,V.t)("picker.poweredBy"))}this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return as(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(),e?.length&&this.focusAccessibilityFilter()}focusAccessibilityFilter(){this.controller.focusAccessibilityFilter?.(),this.notifyMapStateChange()}focusNextAccessibleSection(e){let t=this.controller.focusNextAccessibleSection?.(e)??null;return t&&this.notifyMapStateChange(),t}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let r=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(r?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:r?"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(r){return this.opts.onError?.(r),null}}async holdGAOrThrow(e,t,i={}){let r=await this.controller.holdGA(e,t,i);return r?{holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(r){return this.opts.onError?.(r),null}}async bestAvailableOrThrow(e,t,i={}){let r=await this.controller.bestAvailable(e,t,i);return is(this.controller,r),r?{holdId:r.holdId,expiresAt:r.expiresAt,labels:r.labels,seats:r.seats,items:r.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(r){return this.opts.onError?.(r),null}}async replaceTableQuantityOrThrow(e,t,i){let r=await this.controller.replaceTableQuantity(e,t,i);return r?{holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.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 ve({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:lt(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 r=document.createElement("button");r.type="button",r.textContent="Try again",r.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;",r.addEventListener("click",()=>{this.destroy(),this.render().catch(s=>this.opts.onError?.(s))}),t.appendChild(r),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.languageSelect=null,this.controller.destroy(),this.hostEl&&this.hostEl.parentNode&&this.hostEl.parentNode.removeChild(this.hostEl),this.hostEl=null,this.mount=null,this.rendered=!1,this.mode_=null,this.eventInfo=null,this.focusedSection_=null}};var Sn=["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"],Tl={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 cs(n){let e={};for(let t of Sn)e[t]=(...i)=>{let r=n();return r?r[t](...i):Tl[t]()};return e}var Tn=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Cn=[...Tn,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],En=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function ds(n,e,t){let i={container:n};for(let r of Cn)i[r]=e[r];for(let r of En)i[r]=t[r];return i}var Cl=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),El=2e4,Al=480,Pl=180*1e3,Ll=900*1e3,Ml=.8,Hl=30*1e3,Rl=1e5,Il=4,Ol=50;function An(n){if(typeof n!="string")return n;let e=document.querySelector(n);if(!e)throw new Error(`EmbeddedDesigner container not found: ${n}`);return e}function _l(n){let e=(n??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var Dl={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."}},Bi=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"||!Cl.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},r=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&&(r||i.chartId!==void 0),o=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(r||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=_l(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=An(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 r=this.options.loadingTimeoutMs??El;r>0&&Number.isFinite(r)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},r))}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,r=t.style.getPropertyValue("height"),s=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let o=i();t.style.setProperty("height",`${Rl}px`,"important");let a=i();return r?t.style.setProperty("height",r,s):t.style.removeProperty("height"),!(a-o>Il)&&o>=Ol?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??Al;if(this.fillMode==="container"&&this.containerEl){let r=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));this.setFrameHeight(`${r}px`);return}let t=this.frame.getBoundingClientRect().top,i=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${i}px`)}syncContainerObserver(){let e=this.fillMode==="container"&&!!this.containerEl&&typeof ResizeObserver<"u";e&&!this.resizeObs?(this.resizeObs=new ResizeObserver(()=>this.scheduleFill()),this.resizeObs.observe(this.containerEl)):!e&&this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null)}startFill(){this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill(),!this.fillListening&&(this.fillListening=!0,window.addEventListener("resize",this.scheduleReprobe),window.addEventListener("orientationchange",this.scheduleReprobe),window.addEventListener("scroll",this.scheduleFill,{passive:!0}))}stopFill(){this.fillRaf!==null&&(cancelAnimationFrame(this.fillRaf),this.fillRaf=null),this.reprobeRaf!==null&&(cancelAnimationFrame(this.reprobeRaf),this.reprobeRaf=null),this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null),this.fillListening&&(this.fillListening=!1,window.removeEventListener("resize",this.scheduleReprobe),window.removeEventListener("orientationchange",this.scheduleReprobe),window.removeEventListener("scroll",this.scheduleFill))}pinFullscreen(){if(this.pinned||!this.frame)return;this.pinned=!0,this.frameStyleBeforeFs=this.frame.getAttribute("style");let e={position:"fixed",top:"0",right:"0",bottom:"0",left:"0",width:"100vw",height:"100vh",margin:"0",border:"0","z-index":"2147483000",background:"#101625"};for(let[i,r]of Object.entries(e))this.frame.style.setProperty(i,r,"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<Ll?t*Ml:t-Pl,r=Math.max(Hl,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},r)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{An(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=An(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 r=document.createElement("div");r.setAttribute("data-seatlayer-designer-overlay",t),r.setAttribute("role",t==="error"?"alert":"status"),r.setAttribute("aria-live","polite"),Object.assign(r.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(r):this.buildErrorCard(r,i??"load"),e.append(r),this.overlay=r}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
2764
+ `;function wt(){if(document.getElementById(Dr))return;let n=document.createElement("style");n.id=Dr,n.textContent=rl+Rr+_r+Or+Ir+br,document.head.appendChild(n)}var zr=require("@seatlayer/core"),jr=require("@seatlayer/core/core/cdnAsset");var pl=require("@seatlayer/core/core/cdnAsset");function v(n,e){let t=(0,zr.t)(n);return t===n?e:t}function kt(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?v("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):v("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function Gr(n,e){let t=e?n.toLocaleUpperCase(e):n.toLocaleUpperCase(),i=e?n.toLocaleLowerCase(e):n.toLocaleLowerCase();if(n!==t||t===i)return n;let r=[...i][0]??"";return(e?r.toLocaleUpperCase(e):r.toLocaleUpperCase())+i.slice(r.length)}function qr(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}function D(n){return String(n??"").replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function Ur(n,e,t){let i=e.find(s=>vt(s))??null;if(n.replaceChildren(),!i)return n.textContent=t.slice(0,1).toUpperCase(),null;let r=document.createElement("img");return r.alt="",r.referrerPolicy="no-referrer",r.src=i,n.appendChild(r),i}var xt=null;function Si(){if(xt!==null)return xt;try{if(typeof document>"u")return xt=!1;xt=!!document.createElement("canvas").getContext("webgl2")}catch{xt=!1}return xt}function yn(n){return(0,jr.cdnAssetUrl)(n)}var qt=null;function Ut(){return qt||(qt=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(yn("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")).catch(e=>{throw qt=null,e}),qt)}function Ti(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Ut().catch(()=>{})}async function Ci(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(yn("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function Kr(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(yn("seatlayer-checkout.mjs")):Promise.resolve().then(()=>(Vr(),Fr))}function Wr(n){return n==="unavailable_for_event"||n==="payments_off_for_event"?n:"not_configured"}function Ei(n,e,t){let i={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},r=new Date(n);if(e)try{return r.toLocaleString(t,{...i,timeZone:e})}catch{}return r.toLocaleString(t,i)}async function Ai(n,e){let t=n.overlay.productionElements;if(!t?.some(r=>r.contentImageUrl))return n;let i=await Promise.all(t.map(async r=>{if(!r.contentImageUrl)return r;try{let s=await e(r.contentImageUrl);if(!s){let{contentImageUrl:o,...a}=r;return a}return{...r,runtimeContentImageUrl:s}}catch{let{contentImageUrl:s,...o}=r;return o}}));return{...n,overlay:{...n.overlay,productionElements:i}}}async function Pi(n,e){if(n)try{let t=await e(n);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}var Be=require("@seatlayer/core/view/panoramaDelivery");function Mi(n){let{root:e,source:t,caption:i,real:r,closeLabel:s,dragHint:o,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:d,onClose:p}=n,u=n.chrome??{},h=document.createElement("div");h.className="sl-view sl-mo-zoom",h.setAttribute("role","dialog"),h.setAttribute("aria-label",a),h.innerHTML='<div class="sl-view-head"><span class="sl-view-title"></span><span class="sl-view-cap"></span><button type="button" class="sl-view-x"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div><div class="sl-view-pano"><span class="sl-view-badge"></span><span class="sl-view-hint"></span></div>';let g=R=>h.querySelector(R)?.remove();u.title===!1?g(".sl-view-title"):h.querySelector(".sl-view-title").textContent=a,u.caption===!1?g(".sl-view-cap"):h.querySelector(".sl-view-cap").textContent=i,h.querySelector(".sl-view-x").setAttribute("aria-label",s),u.badge===!1?g(".sl-view-badge"):h.querySelector(".sl-view-badge").textContent=r?l:c,h.querySelector(".sl-view-hint").textContent=o,e.appendChild(h);let f=h.querySelector(".sl-view-pano"),x=(0,Be.planPanoramaDelivery)(t,(0,Be.browserPanoramaConstraints)()),w=new AbortController;f.style.backgroundImage=`url(${JSON.stringify(x.initialUrl)})`;let y=()=>{};x.upgradeUrl&&(y=(0,Be.schedulePanoramaUpgrade)(()=>{d(x.upgradeUrl).then(R=>!R||w.signal.aborted?null:(0,Be.loadPanoramaImage)(R,w.signal).then(()=>R)).then(R=>{!R||!h.isConnected||w.signal.aborted||(f.style.backgroundImage=`url(${JSON.stringify(R)})`)}).catch(()=>{})}));let C=70,b=35,H=1,S=f.clientHeight||1,O=f.clientWidth||1,P=-(S*(180/C)*2/2-O/2),T=0,I=()=>{let R=f.clientHeight||1,st=R*(180/C)*H,qe=Math.max(0,st-R),Nt=Math.min(qe/2,b/180*st);T=Math.min(Nt,Math.max(-Nt,T)),f.style.backgroundSize=`auto ${st}px`,f.style.backgroundPosition=`${P}px ${T-qe/2}px`};I();let _=!1,F=0,Q=0,J=R=>{_=!0,F=R.clientX,Q=R.clientY,f.classList.add("drag"),f.setPointerCapture?.(R.pointerId)},U=R=>{_&&(P+=R.clientX-F,T+=R.clientY-Q,F=R.clientX,Q=R.clientY,I())},rt=R=>{_=!1,f.classList.remove("drag"),f.releasePointerCapture?.(R.pointerId)},Dt=R=>{R.preventDefault(),H=Math.min(2.4,Math.max(1,H+(R.deltaY<0?.12:-.12))),I()};f.addEventListener("pointerdown",J),f.addEventListener("pointermove",U),f.addEventListener("pointerup",rt),f.addEventListener("pointercancel",rt),f.addEventListener("wheel",Dt,{passive:!1});let V=h.querySelector(".sl-view-x");V.addEventListener("click",p);let K=R=>{R.key==="Escape"&&(R.stopPropagation(),p())};return h.addEventListener("keydown",K),V.focus(),{element:h,dispose(){y(),w.abort(),f.removeEventListener("pointerdown",J),f.removeEventListener("pointermove",U),f.removeEventListener("pointerup",rt),f.removeEventListener("pointercancel",rt),f.removeEventListener("wheel",Dt),h.removeEventListener("keydown",K),V.removeEventListener("click",p)}}}function hl(n,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=n.find(s=>s.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let i=n.filter(s=>s.rowId===t.rowId),r=i.findIndex(s=>s.id===e);return{targetSeatId:e,previousSeatId:r>0?i[r-1].id:null,nextSeatId:r>=0&&r+1<i.length?i[r+1].id:null}}var Yr=6e4,Li=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.focusedSectionId_=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 focusedSectionId(){return this.focusedSectionId_}get seatPosition(){return hl(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!Si()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),i=this.options.host(),r=this.options.doc();if(!t||!i||!r)throw new Error("seat_view_unavailable");let s=++this.seatViewGeneration,o,a,l=!1;if(t.viewUrl){let g=t.viewMeta?.previewUrl,f=!!g&&g!==t.viewUrl,x=f?await this.options.resolveAsset(g):null,w=f?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(s!==this.seatViewGeneration||!w||f&&!x)return;o={url:w,...x?{previewUrl:x}:{},...f?{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,Hi.seatViewDisclosure)(o),l=(0,Hi.isAuthoredSeatView)(o)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:g}=await Ci();if(s!==this.seatViewGeneration)return;let f=r.floors?.find(y=>y.objects.some(C=>C.type==="row"&&C.id===t.rowId)),x=t.focalPoint??f?.focalPoint??r.focalPoint,w=g(t,x,[...this.options.seats()]);o={url:w.url,generated:!0},a=(0,Ye.t)("picker.illustrationCaption",{m:w.distanceM})}if(s!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(i,r),wt();let c=this.options.chrome??{},d=kt(),p=(0,Ye.t)("picker.viewFromSeat",{label:t.displayLabel||t.label}),u=l?(0,Ye.t)("picker.real360"):(0,Ye.t)("picker.preview"),h=Mi({root:i,source:o,caption:a,real:l,closeLabel:v("picker.close","Close"),dragHint:d,viewFromSeatLabel:p,real360Label:(0,Ye.t)("picker.real360"),previewLabel:(0,Ye.t)("picker.preview"),chrome:{title:c.seatViewTitle,caption:c.seatViewCaption,badge:c.seatViewBadge},resolveAsset:this.options.resolveAsset,onClose:()=>this.closeSeatView(!0,!0)});this.seatViewElement=h.element,this.seatViewDispose=h.dispose,this.options.onSeatViewChange?.({seatId:t.id,title:p,caption:a,badge:u,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(r=>r.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,this.focusedSectionId_=null}max3DSeats(){let e=this.options.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?Yr/2:Yr}async enter3D(e){let t=this.options.host(),i=this.options.doc();if(!t||!i||this.overlay)throw new Error("venue_3d_unavailable");wt(),this.prepareHostTheme(t,i);let r=document.createElement("div");r.className="sl-view3d",r.setAttribute("role","group"),r.setAttribute("aria-label",v("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(r.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=v("picker.loading3d","Building the 3D venue\u2026"),r.appendChild(s),t.appendChild(r),this.overlay=r;let o=++this.generation;if(this.reducedMotion()?r.style.opacity="1":requestAnimationFrame(()=>{r.style.opacity="1"}),await this.nextPaint(),!(o!==this.generation||this.overlay!==r))try{let[a,l]=await Promise.all([Ut(),this.options.loadEventConfiguration()]),c=l?await Ai(l,this.options.resolveAsset):null,d=await Pi(i.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(o!==this.generation||this.overlay!==r)return;let p={doc:i,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};s.textContent=v("picker.building3d","Building venue geometry\u2026");let u=await a.prepareVenue3D(p);if(o!==this.generation||this.overlay!==r)return;let h=this.options.chrome??{},g=a.mountVenue3D(r,{...p,prepared:u},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:kt(),...h.view3dCaption===!1||h.view3dSeatStepper===!1||h.view3dControlDock===!1?{chrome:{caption:h.view3dCaption!==!1,seatStepper:h.view3dSeatStepper!==!1,controlDock:h.view3dControlDock!==!1}}:{},seatViewActionLabel:f=>this.findSeat(f)?.viewUrl?v("picker.openAuthored360","Open venue 360\xB0"):v("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:f=>this.toggleSeat(f),onSeatInspect:f=>this.toggleSeat(f),onViewTargetChange:f=>{this.targetSeatId_=f,f&&(this.focusedSectionId_=this.findSeat(f)?.sectionId??null),this.options.onViewChange("venue3d",f)},onSectionFocusChange:f=>{this.focusedSectionId_=f,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:f=>this.seatViewFor3D(f)}:{}});if(o!==this.generation||this.overlay!==r){g.dispose();return}this.handle=g,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,g.setNavigationMode(this.navigationMode_),requestAnimationFrame(()=>s.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await g.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.focusedSectionId_=null,this.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let i=this.handle,r=this.overlay;if(this.options.restoreMap(),t&&i&&r){r.style.pointerEvents="none";let s=()=>{this.buyerView_!=="map"||this.overlay!==r||(r.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(r.style.opacity="0",s()):(requestAnimationFrame(()=>{r.style.opacity="0"}),setTimeout(s,280));return}if(this.handle=null,this.overlay=null,!r){try{i?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{i?.dispose()}catch{}r.remove(),this.options.restoreMap();return}r.style.pointerEvents="none",requestAnimationFrame(()=>{r.style.opacity="0"}),setTimeout(()=>{try{i?.dispose()}catch{}r.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,i=this.handle;if(!t||!i)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),i.resize(),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(r=>r.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,r=!!i&&i!==t.viewUrl,s=r?await this.options.resolveAsset(i):null,o=r?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!o||r&&!s)throw new Error("seat_view_unavailable");return{url:o,...s?{previewUrl:s}:{},...r?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:v("picker.chartDerivedModel","Chart-derived model")}}closeSeatView(e=!0,t=!1){e&&(this.seatViewGeneration+=1);let i=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!i){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){i.remove();return}i.classList.add("is-leaving"),setTimeout(()=>i.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(i=>i.objects)??e.objects).some(i=>i.type==="shape"&&(i.role==="stage"||!!i.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let i=t.theme;e.style.setProperty("--sl-bg",i?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",i?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",i?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",i?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};var ul={host:"web",platform:"web",bundle:"",protocol:0,chromeOwner:"web"},ml={...ul},Ri=null,Qr=null;function fl(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function gl(){let n=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:n(fl()),documentMs:Ri==null?0:n(Ri),handshakeMs:Ri==null||Qr==null?0:n(Qr-Ri)}}function Xr(){let{host:n,platform:e,bundle:t,protocol:i,chromeOwner:r}=ml,s=gl();return{host:n,platform:e,...t?{bundle:t}:{},...i?{protocol:i}:{},chromeOwner:r,bootMs:s.bootMs,documentMs:s.documentMs,handshakeMs:s.handshakeMs}}var Zr=new Set;function $e(n){return Zr.has(n)?"repeat":"cold"}function Ii(n){let e=$e(n);return Zr.add(n),e}function pe(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0?Math.round(n):0}function bl(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function vl(n){if(!/^[A-Za-z0-9_-]{1,80}$/.test(n.event))return null;let e=n.performanceProfile??{};return{event:n.event,scope:n.scope,surface:n.surface,outcome:n.outcome,stage:n.stage?.slice(0,32)??"",ms:pe(n.ms),api:pe(e.loadChartAndStatuses)||pe(e.loadChart),scene:pe(e.buildScene),panel:pe(e.buildBuyerControls),paint:pe(e.firstPaint),normalize:pe(e.normalizeBuyerModel),renderer:pe(e.createRenderer),seats:pe(n.seats),floors:pe(n.floors),view:n.view??"map",load:n.load??$e(n.event),transport:n.transport??"pubapi",chartBytes:pe(n.chartDelivery?.bytes),chartCache:n.chartDelivery?.cache??"",...Xr(),availabilityMs:pe(e.loadStatuses)}}var yl=new Set;function Le(n){let e=vl(n);if(e){for(let t of yl)try{t(e)}catch{}typeof fetch>"u"||bl()||fetch(`${n.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}function Kt(n){if(!n)return null;let e=n.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function wl(n){return Kt(n.peek?.querySelector(".sl-peek-sum"))??Kt(n.foot?.querySelector(".sl-total"))??Kt(n.tray)??Kt(n.sheetHead)}function xn(n,e,t,i){let r=n,s=r.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(p=>p.key===t.categoryKey)?.color,d=()=>{let p=wl(r);p&&wr({from:a,to:{x:p.left+p.width/2,y:p.top+p.height/2},label:l,color:c})};Kt(r.peek)?requestAnimationFrame(d):d()}var wn=60,xl=650;function Jr(n,e){if(!e.length||n.focusSeats?.(e.map(r=>r.id)))return;let t=e.find(r=>r.sectionId)?.sectionId;if(!t)return;let i=e.filter(r=>r.sectionId===t);n.focus(t,{x:i.reduce((r,s)=>r+s.x,0)/i.length,y:i.reduce((r,s)=>r+s.y,0)/i.length})}function es(n,e){let t=!vi();Jr({focusSeats:i=>n.focusSeats?.(i,{animate:t})===!0,focus:(i,r)=>n.focusSection(i,r)},(e?.items??[]).filter(i=>i.objectType!=="ga").slice(0,10).map(i=>n.seatByLabel(i.label)).filter(i=>!!i))}function ts(n,e){if(!e.length)return;let t=n.reducedMotion===!0;t||e.forEach((o,a)=>{n.schedule(()=>n.pop(o.id),a*wn)});let i=t?0:e.length*wn,r=e.find(o=>o.sectionId)?.sectionId;if(n.schedule(()=>Jr(n,e),i),t)return;let s=i+(n.focusSeats||r?xl:0);e.forEach((o,a)=>{n.schedule(()=>xn(n.regions,n.screenPoint(o),o,n.categories),s+a*wn)})}var Wt=class n{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let i=t!==void 0&&"mapTheme"in t;e===this.mode&&!i||(i&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return ct(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??n.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=ui(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};var ns=require("@seatlayer/core"),rs=require("@seatlayer/core/core/seatConfidence");var is=require("@seatlayer/core");function St(n){let e=n.viewMeta?.previewUrl??n.viewUrl;return e&&(bn(e)||vt(e))?e:null}function _i(n){if(!n)return!1;let e=n.floors?.length?n.floors.map(t=>t.objects??[]):[n.objects??[]];for(let t of e)for(let i of t)if(i.type==="shape"&&(i.role==="stage"||i.stageKind))return!0;return!1}var kl=512,Oi=new Map;function Di(n,e){if(!e)return null;let t=`${n.id}|${Math.round(e.x)},${Math.round(e.y)}`,i=Oi.get(t);if(i!==void 0)return i;let r=null;try{r=(0,is.generateSeatThumb)(n,e).distanceM??null}catch{r=null}return Oi.size>=kl&&Oi.clear(),Oi.set(t,r),r}function Yt(n){return n.getFocusedSection()!==null||n.seatsRevealed()}function Sl(n,e){return{accessibilityFilter:n.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function Tl(n,e,t,i){for(let r of e){if(r.count<=0)continue;let s=n.accessibilitySpread?.([r.key]);for(let o of s?.sections??[]){let a=t.get(o.id)??i.get(o.id);if(!a||o.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[r.key]=o.free}}}function ss(n,e,t){let i=n.doc,r=i?.theme??{},s=n.categoryAvailability(),o=n.getGAAreas(),a=n.getFloors(),l=n.getExpandedSeats(),c=n.getAccessNeeds(),d=Sl(c,l),p=e.seatPosition,u=p.targetSeatId?n.seatDetails(p.targetSeatId):null,h=new Map(l.map(y=>[y.id,y])),g=_i(i),f=i?.floors?.flatMap(y=>y.objects)??i?.objects??[],x=new Map,w=new Map;for(let y of f){if(y.type!=="section")continue;let C={id:y.id,label:y.label,...y.displayLabel?{displayLabel:y.displayLabel}:{},...y.zone?{zoneId:y.zone}:{}};x.set(y.id,C);let b=y.logicalSectionId??y.id;w.has(b)||w.set(b,C)}return Tl(n,c,x,w),{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,ns.getLocale)()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...r.accent?{accent:r.accent}:{},...r.accentInk?{accentInk:r.accentInk}:{},...r.background?{background:r.background}:{},...r.textColor?{textColor:r.textColor}:{},...r.brandName?{brandName:r.brandName}:{},...r.logoUrl?{logoUrl:r.logoUrl}:{},attributionRequired:!r.hideBadge},features:{ga:o.length>0,tiers:!!i?.categories.some(y=>y.tiers?.length),floors:a.length>1,zones:!!i?.zones?.length,sections:x.size>0,bestAvailable:!0,...d,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(i?.categories??[]).filter(y=>!y.notForSale).map(y=>({key:y.key,label:y.label,color:y.color,price:y.price??y.tiers?.[0]?.price??0,available:s[y.key]??0,...Object.prototype.hasOwnProperty.call(s,y.key)?{free:s[y.key]}:{},tiers:(y.tiers??[]).map(C=>({id:C.id,name:C.name,price:C.price,...C.currency?{currency:C.currency}:{}}))})),zones:(i?.zones??[]).map(y=>({id:y.id,label:y.label,...y.color?{color:y.color}:{}})),sections:[...x.values()],gaAreas:o,bestAvailableZones:n.getBestAvailableZones()},map:{floors:a,activeFloorId:n.getActiveFloorId()||a[0]?.id||null,floorMode:n.isFloorOverview()?"all":"single",floorLabelStyle:n.getRenderer()?.getFloorLabelStyle?.()??"number",rung:n.getRung(),canZoomOut:Yt(n)||t.focusedSection_!==null,focusedSectionId:n.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:n.getViewMode(),buyerView:e.buyerView,view3dTargetSeatId:p.targetSeatId,view3dTargetSeat:u,view3dPreviousSeatId:p.previousSeatId,view3dNextSeatId:p.nextSeatId,view3dFocusedSectionId:e.focusedSectionId,view3dNavigationMode:e.navigationMode,colorblindSafe:t.colorblindSafe_,viewportInsets:n.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:n.getSelection().map(y=>{let C=h.get(y.id);if(!C)return y;let b=n.worldToScreen({x:C.x,y:C.y}),H=St(C),S=g?Di(C,C.focalPoint??i?.focalPoint):null;return{...y,screenPoint:{x:b.x,y:b.y},...H?{seatViewThumb:{reference:H,kind:"real"}}:{},...S!=null?{sightlineMetres:S}:{},...C.confidenceEvidence?{seatViewConfidence:(0,rs.seatConfidenceDisclosure)(C.confidenceEvidence)}:{}}}),validity:n.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var Cl="https://api.seatlayer.io",os=10;function El(n){if(typeof n=="string"){let e=document.querySelector(n);if(!e)throw new Error(`seatmap: container "${n}" not found`);return e}if(!(n instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return n}var Ni=class{constructor(e){this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=null;this.localeGeneration=0;this.languageSelect=null;this.rendered=!1;this.mode_=null;this.eventInfo=null;this.categoryFilter_=null;this.accessibilityFilter_=null;this.hideLimitedView_=!1;this.focusedSection_=null;this.lastReportedViewRung_=null;this.lastReportedCanZoomOut_=!1;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.realtime=null;this.holdingLabels=new Set;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.container)throw new Error("seatmap: `container` is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");this.opts=e,this.maxSelection_=e.maxSelection??os,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()}},r=(e.apiBase??Cl).replace(/\/+$/,"");this.apiBase=r;let s=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?bi({base:r,event:e.event,publicKey:e.publicKey,accessHooks:i,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=s?.access??ft(e,i);let o=s?.api??new De(r,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=o,this.controller=new z.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),onDeselect:a=>{this.controller.currentHold()?.labels.includes(a.label)&&this.controller.releaseLabels([a.label])},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??os)-this.controller.getSelection().length)),tiers:xi(l),confirm:c=>{let d=typeof c=="number"?c:Object.values(c).reduce((p,u)=>p+u,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??Wt.groundFor(e.theme?.mode)??null}),this.hostSurface=new Wt({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 yt(e.event,(a,l)=>o.asset(a,l)),this.immersive=new Li({host:()=>this.hostEl,doc:()=>this.controller.doc,seats:()=>this.controller.getExpandedSeats(),selection:()=>this.controller.getSelection(),status:a=>this.controller.getStatus(a),select:a=>this.controller.select([a]),deselect:a=>this.controller.deselect([a]),loadEventConfiguration:()=>this.controller.loadEventConfiguration(),resolveAsset:a=>this.buyerAssetUrls.resolve(a),enable3D:e.enable3D!==!1,enableSeatView:e.enableSeatView!==!1,max3DSeats:e.max3DSeats,...e.chrome?{chrome:e.chrome}:{},restoreMap:()=>this.controller.refitCurrentView(),onViewChange:(a,l)=>{this.opts.onBuyerViewChange?.({view:a,...l?{seatId:l}:{}}),this.notifyMapStateChange()},onSeatViewChange:a=>this.opts.onSeatViewChange?.(a),onError:a=>this.opts.onError?.(a)}),this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=Yt(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=Yt(this.controller);e===this.lastReportedViewRung_&&t===this.lastReportedCanZoomOut_||(this.lastReportedViewRung_=e,this.lastReportedCanZoomOut_=t,this.opts.onMapStateChange?.())}notifyMapStateChange(){this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=Yt(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=mi(this.opts.locale,this.opts.messages),i=this.localeGeneration+=1,r=(0,z.getLocale)();this.mount=El(this.opts.container);let s=document.createElement("div");s.style.width="100%",s.style.height="100%",s.style.position="relative",this.mount.appendChild(s),this.hostEl=s,fi(s,t,a=>{a!==r&&this.applyActiveLocale(a,i)}),this.applyInteractionState();let o=await this.controller.render(s);if(!o)return Le({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:$e(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(s),this;if(this.eventLocale=o.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(s),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=o.mode==="test"?"test":"live",this.eventInfo={name:o.eventName,venue:o.venue??null,startsAt:o.startsAt??null,timezone:o.timezone??null,currency:o.currency??this.opts.currency??"USD",posterUrl:o.posterUrl??null,salesClosed:o.salesClosed},this.opts.seatTooltip!==!1){let a=document.createElement("div");a.setAttribute("role","tooltip"),a.style.cssText='position:absolute;z-index:7;pointer-events:none;display:none;max-width:240px;background:#10162a;color:#fff;border-radius:10px;padding:9px 12px;font:500 12px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 10px 30px -10px rgba(0,0,0,.5);',s.appendChild(a),this.tipEl=a,this.onTipMove=l=>{let c=s.getBoundingClientRect();this.tipPos={x:l.clientX-c.left,y:l.clientY-c.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},s.addEventListener("mousemove",this.onTipMove)}if(o.mode==="test"&&this.opts.showTestModeIndicator!==!1){s.style.overflow="hidden";let a=document.createElement("div");a.dataset.slI18n="testMode",a.textContent=(0,z.t)("picker.testMode"),a.setAttribute("aria-label",(0,z.t)("picker.testMode")),a.style.cssText="position:absolute;top:18px;right:-34px;z-index:6;transform:rotate(45deg);width:140px;text-align:center;padding:4px 0;background:#f4b740;color:#1a1200;font:800 10.5px/1.4 -apple-system,BlinkMacSystemFont,sans-serif;letter-spacing:.12em;box-shadow:0 2px 8px rgba(0,0,0,.25);pointer-events:none;",s.appendChild(a)}return this.opts.showAttribution!==!1&&this.buildBadge(s),Le({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:o.performanceProfile,chartDelivery:o.chartDelivery,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:Ii(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,z.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=ki;let r=document.createElement("span");r.textContent=(0,z.t)("picker.poweredBy"),t.append(i,r),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,i=this.tipEl.offsetHeight,r=this.tipPos.x+14,s=this.tipPos.y-i-12;r+t>e-8&&(r=this.tipPos.x-t-14),s<8&&(s=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,r)}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,z.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 r=document.createElement("div");r.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,r.append(s,o,a),this.tipEl.replaceChildren(i,r),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,z.t)("map.statusHeld"):(0,z.t)("map.statusTaken"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(r=>(0,z.resolveLocale)(r)).filter((r,s,o)=>o.indexOf(r)===s);if(t.length<2)return;let i=document.createElement("select");i.setAttribute("aria-label",(0,z.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 r of t){let s=document.createElement("option");s.value=r,s.textContent=z.LOCALE_NAMES[r]??r,s.selected=r===(0,z.getLocale)(),i.appendChild(s)}i.addEventListener("change",()=>{this.setLocale(i.value)}),e.appendChild(i),this.languageSelect=i}async setLocale(e){let t=(0,z.getLocale)(),i=this.localeGeneration+=1,r=await(0,z.loadLocale)(e);return this.opts.messages&&(0,z.setStringOverrides)(this.opts.messages),r===t||this.applyActiveLocale(r,i),r}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let i=this.hostEl;if(i){i.lang=e,i.dir=(0,z.localeDirection)(e);for(let r of i.querySelectorAll("[data-sl-i18n]"))if(r.dataset.slI18n==="testMode")r.textContent=(0,z.t)("picker.testMode"),r.setAttribute("aria-label",(0,z.t)("picker.testMode"));else if(r.dataset.slI18n==="badge"){r.setAttribute("aria-label",(0,z.t)("picker.poweredBy"));let s=r.querySelector("span:last-child");s&&(s.textContent=(0,z.t)("picker.poweredBy"))}this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return ss(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(),e?.length&&this.focusAccessibilityFilter()}focusAccessibilityFilter(){this.controller.focusAccessibilityFilter?.(),this.notifyMapStateChange()}focusNextAccessibleSection(e){let t=this.controller.focusNextAccessibleSection?.(e)??null;return t&&this.notifyMapStateChange(),t}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let i=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(i?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:i?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(i=>i.label));try{let i=await this.controller.hold(void 0,e.ttlMs);return i?{holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items}:null}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,i={}){try{return await this.holdGAOrThrow(e,t,i)}catch(r){return this.opts.onError?.(r),null}}async holdGAOrThrow(e,t,i={}){let r=await this.controller.holdGA(e,t,i);return r?{holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items}:null}async bestAvailable(e,t,i={}){try{return await this.bestAvailableOrThrow(e,t,i)}catch(r){return this.opts.onError?.(r),null}}async bestAvailableOrThrow(e,t,i={}){let r=await this.controller.bestAvailable(e,t,i);return es(this.controller,r),r?{holdId:r.holdId,expiresAt:r.expiresAt,labels:r.labels,seats:r.seats,items:r.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(r){return this.opts.onError?.(r),null}}async replaceTableQuantityOrThrow(e,t,i){let r=await this.controller.replaceTableQuantity(e,t,i);return r?{holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.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 be({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:at(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';let i=document.createElement("div");i.textContent="The seat map didn\u2019t load.",t.appendChild(i);let r=document.createElement("button");r.type="button",r.textContent="Try again",r.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;",r.addEventListener("click",()=>{this.destroy(),this.render().catch(s=>this.opts.onError?.(s))}),t.appendChild(r),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.languageSelect=null,this.controller.destroy(),this.hostEl&&this.hostEl.parentNode&&this.hostEl.parentNode.removeChild(this.hostEl),this.hostEl=null,this.mount=null,this.rendered=!1,this.mode_=null,this.eventInfo=null,this.focusedSection_=null}};var kn=["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"],Al={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 as(n){let e={};for(let t of kn)e[t]=(...i)=>{let r=n();return r?r[t](...i):Al[t]()};return e}var Sn=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],Tn=[...Sn,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],Cn=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function ls(n,e,t){let i={container:n};for(let r of Tn)i[r]=e[r];for(let r of Cn)i[r]=t[r];return i}var Pl=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),Ml=2e4,Ll=480,Hl=180*1e3,Rl=900*1e3,Il=.8,Ol=30*1e3,_l=1e5,Dl=4,Nl=50;function En(n){if(typeof n!="string")return n;let e=document.querySelector(n);if(!e)throw new Error(`EmbeddedDesigner container not found: ${n}`);return e}function Bl(n){let e=(n??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var $l={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."}},Bi=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"||!Pl.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},r=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&&(r||i.chartId!==void 0),o=this.options.expectedWorkspaceId!==void 0&&i.workspaceId!==this.options.expectedWorkspaceId&&(r||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=Bl(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=En(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 r=this.options.loadingTimeoutMs??Ml;r>0&&Number.isFinite(r)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},r))}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,r=t.style.getPropertyValue("height"),s=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let o=i();t.style.setProperty("height",`${_l}px`,"important");let a=i();return r?t.style.setProperty("height",r,s):t.style.removeProperty("height"),!(a-o>Dl)&&o>=Nl?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??Ll;if(this.fillMode==="container"&&this.containerEl){let r=Math.max(e,Math.round(this.containerEl.getBoundingClientRect().height));this.setFrameHeight(`${r}px`);return}let t=this.frame.getBoundingClientRect().top,i=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${i}px`)}syncContainerObserver(){let e=this.fillMode==="container"&&!!this.containerEl&&typeof ResizeObserver<"u";e&&!this.resizeObs?(this.resizeObs=new ResizeObserver(()=>this.scheduleFill()),this.resizeObs.observe(this.containerEl)):!e&&this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null)}startFill(){this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill(),!this.fillListening&&(this.fillListening=!0,window.addEventListener("resize",this.scheduleReprobe),window.addEventListener("orientationchange",this.scheduleReprobe),window.addEventListener("scroll",this.scheduleFill,{passive:!0}))}stopFill(){this.fillRaf!==null&&(cancelAnimationFrame(this.fillRaf),this.fillRaf=null),this.reprobeRaf!==null&&(cancelAnimationFrame(this.reprobeRaf),this.reprobeRaf=null),this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null),this.fillListening&&(this.fillListening=!1,window.removeEventListener("resize",this.scheduleReprobe),window.removeEventListener("orientationchange",this.scheduleReprobe),window.removeEventListener("scroll",this.scheduleFill))}pinFullscreen(){if(this.pinned||!this.frame)return;this.pinned=!0,this.frameStyleBeforeFs=this.frame.getAttribute("style");let e={position:"fixed",top:"0",right:"0",bottom:"0",left:"0",width:"100vw",height:"100vh",margin:"0",border:"0","z-index":"2147483000",background:"#101625"};for(let[i,r]of Object.entries(e))this.frame.style.setProperty(i,r,"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<Rl?t*Il:t-Hl,r=Math.max(Ol,i);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},r)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{En(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=En(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 r=document.createElement("div");r.setAttribute("data-seatlayer-designer-overlay",t),r.setAttribute("role",t==="error"?"alert":"status"),r.setAttribute("aria-live","polite"),Object.assign(r.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(r):this.buildErrorCard(r,i??"load"),e.append(r),this.overlay=r}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
2796
2765
  @media (prefers-reduced-motion: no-preference) {
2797
2766
  @keyframes seatlayer-designer-shimmer {
2798
2767
  0% { background-position: -320px 0; }
@@ -2802,9 +2771,9 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
2802
2771
  animation: seatlayer-designer-shimmer 1.25s ease-in-out infinite;
2803
2772
  background-size: 640px 100%;
2804
2773
  }
2805
- }`,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%)",r=document.createElement("div");Object.assign(r.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};r.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%"})),r.append(o),e.append(r);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=Dl[t],r=document.createElement("div");Object.assign(r.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()),r.append(s,o,a),e.append(r)}};var M=require("@seatlayer/core"),ii=require("@seatlayer/core/view3d/crossfade/panorama"),na=require("@seatlayer/core/core/seatConfidence");function ps(n){return n?.previousPrice!=null&&n.previousPrice>n.price?n.previousPrice:null}function hs(n){return Nl(n)+(n.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!n.collapsed}">${n.esc(n.moreLabel)}</button>`:"")+Bl(n.status)}function Nl(n){let{esc:e,money:t}=n;return n.categories.map(i=>{let r=n.priceOf(i),s=n.rangeOf(i),o=n.offerOf(i.key),a=ps(o),l=n.activeKey===i.key;return`<div class="sl-price-row${n.bandKeys!=null&&!n.bandKeys.has(i.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(i.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(n.titleFor(i,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(n.colorOf(i))}"></span><span class="sl-price-label">${e(i.label)}`+(o?.offerName?`<small class="sl-price-offer">${e(o.offerName)}</small>`:"")+`</span><span class="sl-price-left">${e(n.leftCount(n.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>`:r!=null?`<span class="sl-price-amt">${e(t(r))}</span>`:"")+"</div>"}).join("")}function Bl(n){let e=t=>t.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i]);return`<div class="sl-status-key" aria-label="${e(n.legend)}"><span class="sl-status-item"><i class="sl-status-icon 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(n.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(n.sold)}</span></div>`}function Pn(n){let e=Math.abs(n.scrollLeft),t=e>2,i=e+n.clientWidth<n.scrollWidth-2;return n.dataset.fadeStart=String(t),n.dataset.fadeEnd=String(i),{start:t,end:i}}function us(n){let{esc:e,money:t}=n;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${n.allActive}" title="${e(n.allWord)}"><span class="sl-rc-t">${e(n.allWord)}</span></button>`+n.categories.map(r=>{let s=n.rangeOf(r),o=n.priceOf(r),a=s?s.min===s.max?t(s.min):`${t(s.min)}+`:o!=null?t(o):null,l=Object.prototype.hasOwnProperty.call(n.left,r.key)&&n.left[r.key]<=0,c=ps(n.offerOf(r.key)),d=a?`${r.label} \u2014 ${a}${l?` (${n.soldOutWord})`:""}`:r.label;return`<button type="button" class="sl-rc" data-cat="${e(r.key)}" aria-pressed="${n.activeKey===r.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(n.colorOf(r))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??r.label)}</span></button>`}).join("")}function ms(n,e){let t=n.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let i=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(i.length<=5)return i.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let r=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),s=Math.ceil(r.length/4),o=[];for(let a=0;a<r.length;a+=s){let l=r.slice(a,a+s),c=Math.min(...l.map(p=>p.range.min)),d=Math.max(...l.map(p=>p.range.max));o.push({id:`b${a}`,label:c===d?e.money(c):`${e.money(c)}\u2013${e.money(d)}`,keys:l.map(p=>p.key),min:c,max:d})}return o}function fs(n){return!!n&&n.clientWidth>0&&n.scrollWidth>n.clientWidth+1}function $l(n){return n.some(e=>fs(e))}var $i="data-fit-gone",Fl=12;function Ln(n,e,t=fs){if(!n)return 0;for(let i of e)n.classList.remove(i.cls);if(n.querySelectorAll(`[${$i}]`).forEach(i=>{i.removeAttribute($i),i.hidden=!1}),n.dataset.fit="0",n.clientWidth<=0||!t(n))return 0;for(let i=0;i<e.length;i+=1){let r=e[i];i>0&&n.classList.remove(e[i-1].cls),n.classList.add(r.cls),n.dataset.fit=String(i+1);let s=r.give?r.give(n):!0;if(!t(n))return i+1;if(r.repeat&&r.give){for(let o=1;s&&o<Fl;o+=1)if(s=r.give(n),!t(n))return i+1}}return e.length}function Vl(n,e="[data-fit-seg]"){let t=[...n.querySelectorAll(e)].filter(i=>!i.hidden);return t.length<2?!1:gs(t[t.length-1])}function zl(n,e){let t=n.querySelector(e);return t&&!t.hidden?gs(t):!1}function gs(n){let e=n.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute($i,""),e.hidden=!0),n.setAttribute($i,""),n.hidden=!0,!0}function jl(n){if(!n)return!1;let e=(n.getAttribute("aria-label")||n.textContent||"").trim();return e?(n.setAttribute("aria-label",e),n.setAttribute("title",e),!0):!1}function bs(n){if(!n)return 0;let e=n.querySelector(".sl-confirm-cancel"),t=n.querySelector(".sl-confirm-add-t");return Ln(n,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>jl(e)}],()=>$l([e,t]))}function vs(n){return Ln(n,[{cls:"sl-fit-notype",give:e=>zl(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>Vl(e),repeat:!0}])}function Mn(n){return n?(n.classList.add("sl-fitpill"),Ln(n,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Gl=["on-sale","low","sold-out","presale","closed"];function Qt(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function ws(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function ys(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n,t=e.count,i=e.index;if(typeof i!="number"||!Number.isInteger(i)||i<1||typeof t!="number"||!Number.isInteger(t)||t<i)return;let r=e.remaining;if(r!=null&&(typeof r!="number"||!Number.isInteger(r)||r<0))return;let s={index:i,count:t,remaining:r??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=ws(e[o]);if(a===void 0)return;s[o]=a}return s}function ql(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],i=new Set;for(let 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 p of a.priceOverrides){if(!p||typeof p!="object"||Array.isArray(p))return;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"",g=u.tierId===null?null:typeof u.tierId=="string"&&u.tierId.trim()?u.tierId.trim():void 0,m=Qt(u.price);if(!h||g===void 0||m===void 0||m===null)return;let y=`${h}\0${g??""}`;if(d.has(y))return;d.add(y),c.push({categoryKey:h,tierId:g,price:m})}i.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let r=[],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),r.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:r}}function Fi(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=Gl.find(d=>d===e.state);if(!t)return null;let i=Qt(e.fromPrice),r=Qt(e.previousPrice);if(i===void 0||r===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=ys(e.release);if(o===void 0)return null;let a=e.upcoming===void 0?null:ys(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 p of e.prices){if(!p||typeof p!="object"||Array.isArray(p))return null;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!h)return null;let g=Qt(u.price),m=Qt(u.previousPrice);if(g==null||m===void 0)return null;let y={categoryKey:h,price:g,previousPrice:m};if(u.offerId!==void 0){if(typeof u.offerId!="string"||!u.offerId.trim())return null;y.offerId=u.offerId.trim()}if(u.offerName!==void 0){if(typeof u.offerName!="string"||!u.offerName.trim())return null;y.offerName=u.offerName.trim()}if(u.remaining!==void 0){if(u.remaining!==null&&(typeof u.remaining!="number"||!Number.isInteger(u.remaining)||u.remaining<0))return null;y.remaining=u.remaining==null?null:u.remaining}for(let S of["startsAt","endsAt"]){if(u[S]===void 0)continue;let w=ws(u[S]);if(w===void 0)return null;y[S]=w}d.push(y)}l=d}let c=ql(e.channelPricing);return c===void 0?null:{state:t,fromPrice:i,previousPrice:r,currency:s,release:o,upcoming:a,prices:l,channelPricing:c}}function xs(n){return n?.changed!==!1}function ks(n,e){if(!n)return null;let t=null,i=r=>{r!=null&&r>e&&(t===null||r<t)&&(t=r)};for(let r of[n.release,n.upcoming])i(r?.startsAt),i(r?.endsAt);for(let r of n.prices)i(r.startsAt),i(r.endsAt);return t}function Vi(n){let e={};for(let t of n?.prices??[])e[t.categoryKey]=t.price;return e}var ye=require("@seatlayer/core"),Ts=require("@seatlayer/core/core/seatConfidence");function Hn(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function k(n){return String(n??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function He(n){return n?.restrictedView?v("picker.restrictedView","Restricted view"):n?.obstructedView?v("picker.obstructedView","Obstructed view"):""}function Cs(n){if(!n)return"";let e=[];n.premium&&e.push(`<div class="sl-cx-premium"><span class="sl-cx-star" aria-hidden="true">\u2605</span>${v("picker.premiumSeat","Premium seat")}</div>`);let t=He(n);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>${n.note?`<span class="sl-cx-note">${k(n.note)}</span>`:""}</span></div>`):n.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">${k(n.note)}</span></span></div>`),e.length?`<div class="sl-cx">${e.join("")}</div>`:""}function Rn(n){if(!n)return"";let e=[];if(n.premium){let i=k(v("picker.premiumSeat","Premium seat"));e.push(`<span class="sl-cx-mark sl-cx-mark-premium" role="img" aria-label="${i}" title="${i}">\u2605</span>`)}let t=He(n);if(t){let i=k(n.note?`${t}: ${n.note}`:t);e.push(`<span class="sl-cx-mark sl-cx-mark-limited" role="img" aria-label="${i}" title="${i}">\u25D0</span>`)}else if(n.note){let i=k(n.note);e.push(`<span class="sl-cx-mark sl-cx-mark-info" role="img" aria-label="${i}" title="${i}">\u2139</span>`)}return e.join("")}function In(n){if(!n)return"";let e=[];n.premium&&e.push(`<span class="sl-chip-cx-tag premium"><span aria-hidden="true">\u2605</span>${v("picker.premiumSeat","Premium seat")}</span>`);let t=He(n);return t&&e.push(`<span class="sl-chip-cx-tag limited"><span aria-hidden="true">\u25D0</span>${k(t)}</span>`),!e.length&&!n.note?"":'<div class="sl-chip-cx">'+(e.length?`<div class="sl-chip-cx-tags">${e.join("")}</div>`:"")+(n.note?`<div class="sl-chip-cx-note">${k(n.note)}</div>`:"")+"</div>"}function Tt(n){return n==="no-seat"?v("picker.emptyWheelchairSpace","Empty wheelchair space"):n==="seat-present"?v("picker.accessiblePhysicalSeat","Accessible physical seat"):""}function Es(n){let e=Tt(n);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 Xt(n){let e=Tt(n);return e?`<span class="sl-cx-mark" role="img" aria-label="${e}" title="${e}">\u267F</span>`:""}function On(n,e){if(!n)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("picker.seeItIn3d","See it in 3D"),i=e?v("picker.viewFromHere","View from here"):t;return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${i}</span></button>`}function As(n){if(!n)return"";let e=n.previous.label||n.previous.id,t=n.next.label||n.next.id;return`<span class="sl-seccard-nav" aria-label="${v("picker.browseSections","Browse sections")}"><button type="button" data-section-nav="${_(n.previous.id)}" aria-label="${v("picker.previousSection","Previous section")}: ${_(e)}" title="${_(e)}">\u2190</button><button type="button" data-section-nav="${_(n.next.id)}" aria-label="${v("picker.nextSection","Next section")}: ${_(t)}" title="${_(t)}">\u2192</button></span>`}function Ps(n,e){if(!e)return"";let t=e,i=t.includes(n.id),r=i?t.length>1?v("picker.openComparison","Open comparison"):v("picker.savedForComparison","Saved for comparison"):t.length?v("picker.compareWithSaved","Compare with saved"):v("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${i&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${k(r)}</span></button>`}function Ls(n,e,t){if(!t)return"";let i=(0,Ts.seatConfidenceDisclosure)(n.confidenceEvidence),r=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${k(n.displayLabel??n.label)}"><span><em>${k(e)}</em><strong>${k(i.headline)}</strong><small>${k(r)}</small></span><b>Passport</b></button>`}function ee(n){let e=n?.rowLabel,t=n?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let r=`${t}${i}`;if(e.startsWith(r)&&e.length>r.length)return e.slice(r.length)}return(0,ye.compactRowLabel)(e,t)}function Ul(n){switch(n){case"paused":return{title:v("picker.accessPausedTitle","These seats are on hold right now"),body:v("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:v("picker.accessRetry","Try again")};case"revoked":return{title:v("picker.accessRevokedTitle","This access link is no longer active"),body:v("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats.")};case"no_token":case"provider_failed":return{title:v("picker.accessExpiredTitle","Your seat session has expired"),body:v("picker.accessExpiredBody","Reload the seat map to continue. Seats already in your cart stay held until the timer ends."),action:v("picker.accessRetry","Reload seat map")};default:return{title:v("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:v("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest.")}}}var Kl=6;function Ms(n,e,t){let i=Hn;return[n?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${n.sectionLabel.length>Kl?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${v("picker.section","Section")}</span><span class="sl-confirm-value">${i(n.sectionLabel)}</span></div>`:"",n?.rowLabel||n?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${i(t)}</span><span class="sl-confirm-value">${i(ee(n)??n?.displayLabel??e)}</span></div>`:"",n?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${v("picker.seat","Seat")}</span><span class="sl-confirm-value">${i(n?.seatNumber??n?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function Hs(n,e,t){let i=Hn,r=n?.objectType==="booth",s=n?.objectType==="table"&&!!n?.bookingMode,o=r||s||!n?.seatNumber,a=n?.sectionLabel??(o?void 0:n?.displayLabel),l=s?`${v("picker.guests","Guests")} ${n?.bookingMode==="variable"?`${n?.minOccupancy}\u2013${n?.maxOccupancy}`:n?.capacity}`:void 0,d=(o?[l,a?n?.rowLabel??n?.displayLabel:void 0]:[n?.rowLabel?`${t} ${ee(n)??""}`.trim():void 0,`${v("picker.seat","Seat")} ${n?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${i(a)}</span>`:"")+(d?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${i(d)}</span>`:"")+(a||d?"":`<span class="sl-confirm-pos">${i(e)}</span>`)}function Rs(n,e){if(!n)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-pill sl-confirm-3dpill" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function Is(n,e){if(!n||e)return"";let t=v("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-3drow" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function Ss(n){return n.buyerMessage?.trim()||(n.restriction==="companion"?v("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function Os(n,e,t){let i=Hn;if(n.length>1)return`<fieldset class="sl-confirm-tiers"><legend>${v("picker.ticketType","Ticket type")}</legend>`+n.map(o=>{let a=Ss(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 r=n[0],s=r?Ss(r):void 0;return s?`<p class="sl-confirm-tier-note">${i(s)}</p>`:""}function _n(n){return`<span class="sl-seccard-dot" style="background:${k(n.color)}"></span><span class="sl-seccard-name">${k(n.label)}</span><span class="sl-seccard-left" data-full="${k(n.leftLabel)}" data-short="${k(n.leftShortLabel??n.leftLabel)}">${k(n.leftLabel)}</span>`+n.nav+n.close}function _s(n){return`<div class="sl-seccard-head"><span class="sl-seccard-dot" style="background:${k(n.color)}"></span><span class="sl-seccard-name">${k(n.label)}</span>`+(n.showPrice?`<span class="sl-seccard-price">${k(n.priceLabel)}</span>`:"")+n.close+`</div><div class="sl-seccard-zone">${n.zoneLabel?`${k(n.zoneLabel)} \xB7 `:""}<span class="sl-seccard-left">${k(n.leftLabel)}</span></div>`+(n.entrance?`<div class="sl-seccard-entrance">${k(n.entrance)}</div>`:"")+(n.mix?`<div class="sl-seccard-mix">${n.mix}</div>`:"")+`<div class="sl-seccard-foot"><button type="button" class="sl-seccard-overview">\u2190 ${k(n.overviewLabel)}</button>`+n.nav+`<span class="sl-seccard-hint">${k(n.hint)}</span></div>`}function Ds(n){return`<span class="sl-seccard-mix-item${n.dim?" sl-dim":""}"><span class="sl-seccard-mix-dot" style="background:${k(n.color)}"></span>${k(n.label)} <span class="sl-seccard-mix-price">${k(n.rangeLabel)}</span></span>`}function Ns(n){return'<div class="sl-confirm-grid">'+n.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${k(n.categoryLabel)}</span>`+(n.priceLabel?`<span class="sl-confirm-price">${k(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+n.marker+`<span class="sl-confirm-dot" style="background:${k(n.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${k(n.categoryLabel)}</span><span class="sl-confirm-who">`+n.identity+"</span>"+(n.priceLabel?`<span class="sl-confirm-idprice">${k(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+n.tierChoices+n.groupDates+n.wheelchair+n.commercial+(n.thumb||n.see3dPill?`<div class="sl-confirm-strip">${n.thumb}<span class="sl-confirm-pills">${n.see3dPill}</span></div>`:"")+n.inspect+'<div class="sl-confirm-row">'+(n.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${k(n.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${k(n.selectLabel)}</span></button></div></div>`}function Bs(n,e){let t=_,{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,ye.t)("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):(0,ye.t)("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(n.displayLabel??n.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(i?v("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,ye.t)("picker.allPlacesBookedTogether",{count:n.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t((0,ye.t)("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(v("picker.tableCapacity","Table capacity"))}</span><span>${t((0,ye.t)("picker.guestsCount",{count:n.capacity}))}</span>`+(e.suppressPricing?"":`<span class="muted">${t(v("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(i?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(v("picker.numberOfGuests","Number of guests"))}</label><div class="sl-table-stepper" role="group" aria-labelledby="sl-table-qty-label"><button type="button" data-table-step="-1" aria-label="${t(v("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${n.quantity}</output><button type="button" data-table-step="1" aria-label="${t(v("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t((0,ye.t)("picker.chooseMinMaxGuests",{min:n.minOccupancy,max:n.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${n.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t((0,ye.t)("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?v("picker.updateTable","Update table"):i?v("picker.selectTable","Select table"):v("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function $s(n,e){let t=Ul(n),i=document.createElement("div");i.className="sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let r=document.createElement("div");r.className="sl-access-card";let s=document.createElement("span");s.className="sl-access-icon",s.setAttribute("aria-hidden","true"),s.textContent="\u21BB";let o=document.createElement("div");o.className="sl-access-copy";let a=document.createElement("div");a.className="sl-access-title",a.textContent=t.title;let l=document.createElement("div");if(l.className="sl-access-body",l.textContent=t.body,o.append(a,l),t.action){let c=document.createElement("button");c.type="button",c.className="sl-access-act";let d=document.createElement("span");d.className="sl-access-act-icon",d.setAttribute("aria-hidden","true"),d.textContent="\u21BB";let p=document.createElement("span");p.textContent=t.action,c.append(d,p),c.addEventListener("click",async()=>{i.classList.add("is-reloading"),c.disabled=!0;try{await e()}catch{}finally{i.isConnected&&(i.classList.remove("is-reloading"),c.disabled=!1)}}),o.appendChild(c)}return r.append(s,o),i.appendChild(r),i}function Fs(n){return n.map(e=>`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${k(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${k(e.icon)}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${k(e.label)}</span>`+(e.note?`<span class="sl-a11yrow-n">${k(e.note)}</span>`:"")+"</span>"+(e.count?`<span class="sl-a11yrow-c">${k(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>').join("")}function Vs(n){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",n.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:n.tf("picker.allFloors","All floors")},...n.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",()=>n.onChoose(s.id)),e.appendChild(o)}let i=document.createElement("button");i.type="button",i.className="sl-floor-info",i.textContent="i";let r=n.tf("picker.floorHelp","All floors shows the complete venue. Choose one level to inspect and select its seats.");return i.setAttribute("aria-label",r),i.title=r,e.appendChild(i),e}function zs(n,e,t){if(!n)return;let i=t?"":e;n.querySelectorAll("button[data-floor]").forEach(r=>{r.setAttribute("aria-pressed",String(r.dataset.floor===i))})}var ce=require("@seatlayer/core");var zi=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")?Be(this.el,void 0,xr):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 r=i.querySelector(".sl-seccard-dot");r&&(r.style.background=e.color);let s=i.querySelector(".sl-seccard-name");s&&un(s,e.label);let o=i.querySelector(".sl-seccard-left");o&&(o.dataset.full=t.leftLabel,o.dataset.short=t.leftShortLabel,un(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,ce.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 r=t.dataset.sectionNav;r&&this.host.controller.focusSection(r)})})}render(e){let t=this.host.map();if(!t)return;let i=this.el?.classList.contains("strip")===!0&&this.el.isConnected,r=e.categories.length?e.categories.map(y=>{let S=this.host.controller.doc?.categories.find(w=>w.key===y.key);return S?this.host.catPriceRange(S):{min:y.priceMin,max:y.priceMax}}).filter(y=>y!=null):[{min:e.priceMin,max:e.priceMax}],s=Math.min(...r.map(y=>y.min)),o=Math.max(...r.map(y=>y.max)),a=s===o?this.host.money(s):`${this.host.money(s)}\u2013${this.host.money(o)}`,l=(0,ce.tCount)("picker.seatsLeftInSection",e.seatsLeft),c=(0,ce.t)("picker.seatsLeftShort",{count:e.seatsLeft}),d=`<button type="button" class="sl-seccard-x" aria-label="${(0,ce.t)("picker.closeSectionSummary")}">\u2715</button>`,p=`<button type="button" class="sl-seccard-x sl-seccard-back" aria-label="${(0,ce.t)("picker.closeSectionSummary")}"><span class="sl-seccard-back-chev" aria-hidden="true">\u2039</span>${_((0,ce.t)("picker.overview"))}</button>`,u=As(this.host.sectionNeighbours(e.id)),h=this.host.root()?.dataset.layout==="narrow",g={label:e.label,color:e.color,leftLabel:l,leftShortLabel:c,nav:u,close:d};if(h&&i&&this.el){this.updateDockInPlace(e,{leftLabel:l,leftShortLabel:c,nav:u});return}this.el?.remove();let m=document.createElement("div");if(h){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,ce.t)("picker.sectionSummaryAria",{label:e.label})}, ${l}`),m.innerHTML=_n({...g,close:p}),i)for(let y of m.querySelectorAll(".sl-seccard-name,.sl-seccard-left"))y.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,ce.t)("picker.sectionSummaryAria",{label:e.label})),m.innerHTML=_n(g),this.wireNavigation(m),m.addEventListener("click",y=>{y.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,ce.t)("picker.sectionSummaryAria",{label:e.label}));let y=this.host.priceBandKeys(),S=this.host.suppressPricing(),w=e.categories.map(T=>{let b=this.host.controller.doc?.categories.find(x=>x.key===T.key),E=b?this.host.catPriceRange(b):{min:T.priceMin,max:T.priceMax};return Ds({label:T.label,color:T.color,dim:y!=null&&!y.has(T.key),rangeLabel:S?"":E&&E.min!==E.max?`${this.host.money(E.min)}\u2013${this.host.money(E.max)}`:this.host.money(E?.min??T.price)})}).join("");m.innerHTML=_s({...g,priceLabel:a,showPrice:!S&&e.categories.length>0,zoneLabel:e.zoneLabel,entrance:e.entrance?`${(0,ce.t)("picker.entrance")} ${e.entrance}`:void 0,mix:w,overviewLabel:(0,ce.t)("picker.overview"),hint:(0,ce.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,h&&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"),r=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,p=m=>{let y=Number.parseFloat(m??"");return Number.isFinite(y)?y:0},u=[...e.children].filter(m=>m instanceof HTMLElement&&!m.hidden),h=p(d?.columnGap)||p(d?.gap);return u.reduce((m,y)=>m+Math.max(y.scrollWidth,y.getBoundingClientRect().width),0)+h*Math.max(0,u.length-1)+p(d?.paddingLeft)+p(d?.paddingRight)<=c+1},o=()=>t.hidden||!r(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()&&!r(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 r=this.host.activeFloorObjects().find(w=>w.type==="section"&&w.id===t.id)?.outline;if(!r||r.length<3)return 0;let s=r.map(w=>this.host.controller.worldToScreen(w)),o=s.map(w=>w.x),a=s.map(w=>w.y),l=Math.min(...o),c=Math.min(...a),d=Math.max(...o)-l,p=Math.max(...a)-c;if(d<=0||p<=0)return 0;let u=i.getBoundingClientRect(),h=e.getBoundingClientRect(),g=h.left-u.left,m=h.top-u.top,y=Math.max(0,Math.min(g+h.width,l+d)-Math.max(g,l)),S=Math.max(0,Math.min(m+h.height,c+p)-Math.max(m,c));return y*S/(d*p)}};var Ze=require("@seatlayer/core"),ho=require("@seatlayer/core/core/color");var Ve=require("@seatlayer/core");function Dn(n,e,t){try{return new Intl.DateTimeFormat(e,{...t,...n.timezone?{timeZone:n.timezone}:{}}).format(new Date(n.startsAt))}catch{return new Date(n.startsAt).toLocaleString(e)}}var ji=(n,e)=>Dn(n,e,{dateStyle:"medium"}),Gi=(n,e)=>Dn(n,e,{timeStyle:"short"}),qi=(n,e)=>Dn(n,e,{weekday:"short",day:"numeric",month:"short"});function js(n,e,t,i){return!n.length||n.length>=e?null:{summary:i,labels:n.map(r=>`${ji(r,t)} \xB7 ${Gi(r,t)}`)}}function Wl(n,e){let t=new Set(e);return n.map(i=>({...i,free:!t.has(i.eventKey)}))}function Gs(n,e){let t=[...n];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Yl(n,e,t="",i=!1){if(!n.length)return"";let r=n.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="${k(s.eventKey)}" aria-label="${k(`${s.shortDate}: ${o}`)}" checked>`:"";return`<li class="sl-night${s.free?" ok":" no"}" aria-label="${k(`${s.shortDate}: ${o}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${k(s.shortDate)}</span><span class="st">${k(o)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${k(e.title)}</div><ul class="sl-nightstrip">${r}</ul><p class="sl-tip-nights-note">${k(e.notAvailableOn)}</p>`+t+"</div>"}function Ql(n){return n.selectPartialLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${k(n.selectPartialLabel)}</button>`:n.switchLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${k(n.switchLabel)}</button>`:n.switchLabel||n.selectPartialLabel?"":`<p class="sl-tip-advice">${k(n.advice)}</p>`}function Xl(n){return Number(n.available)+Number(n.selected)+Number(n.partial)+Number(n.unavailable)}function qs(n,e,t){if(Xl(n)<2)return"";let i=(s,o,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${k(o)}</li>`,r=[];return n.available&&r.push(i("sl-pg-sw-free",e.available,` style="background:${k(t)}"`)),n.selected&&r.push(i("sl-pg-sw-sel",e.selected)),n.partial&&r.push(i("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${k(t)}"`)),n.unavailable&&r.push(i("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${k(e.title)}">${r.join("")}</ul>`}function Us(n,e){if(!n.length)return"";let t=n.map(i=>{let r=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="${k(i.eventKey)}"><span class="n">${k(i.name)}</span><span class="s">${k(r)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${k(e.title)}"><div class="sl-pg-nights-title">${k(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function Nn(n,e){if(n?.kind!=="partial"||!e?.length)return null;let t=n.data?.blockedEventKeys??[],i=Wl(e,t);return{states:i,missing:i.filter(r=>!r.free).map(r=>r.shortDate)}}function Ks(n,e){return n?Yl(n.states,{title:v("picker.group.partlyAvailableTitle","Free on some nights only"),free:v("picker.group.nightFree","Free"),blocked:v("picker.group.nightBlocked","Not available"),notAvailableOn:(0,Ve.t)("picker.group.notAvailableOn",{dates:Gs(n.missing,e.locale)})},Ql({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:v("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function Zl(n,e,t,i){if(!n.length)return"";let r=new Set(e),s=new Set(t),o=n.map(a=>{let l=r.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${k(a.eventKey)}" aria-label="${k(`${a.shortDate}: ${l?i.available:i.unavailable}`)}"${l&&s.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${k(a.shortDate)}</span><span class="sl-confirm-date-state">${k(l?i.available:i.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${k(i.title)}</legend><p class="sl-confirm-dates-copy">${k(i.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${k(i.selectAll)}</span></label><ul>${o}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function Ws(n,e,t,i){let r=e.availableEventKeys(t);return Zl(n,r,e.includedEventKeys(),{title:i("picker.group.confirmDatesTitle","Choose performance dates"),copy:r.length===n.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(n.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(r.length)).replace("{total}",String(n.length)),selectAll:i("picker.group.confirmSelectAll","Select all available dates"),available:i("picker.group.nightFree","Available"),unavailable:i("picker.group.nightBlocked","Unavailable")})}function Ys(n){return[...n.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function Qs(n,e,t,i){let r=[...n.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!r.length)return;let s=n.querySelector(".sl-confirm-add"),o=n.querySelector("[data-pg-confirm-all]"),a=()=>{let l=r.filter(p=>!p.disabled),c=Ys(n).length;o&&(o.checked=c===l.length,o.indeterminate=c>0&&c<l.length);let d=n.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()};r.forEach(l=>l.addEventListener("change",a)),o?.addEventListener("change",()=>{r.filter(l=>!l.disabled).forEach(l=>{l.checked=o.checked}),a()}),a()}async function Xs(n,e,t){if(!n||!t||!n.querySelector("[data-pg-confirm-event-key]"))return!0;let i=Ys(n);if(!i.length)return!1;let r=n.querySelector(".sl-confirm-add");return r?.setAttribute("aria-busy","true"),r&&(r.disabled=!0),await t.apply(e,i)?!0:(r?.removeAttribute("aria-busy"),r?.isConnected&&(r.disabled=!1),!1)}function Zs(n,e,t){return n?(0,Ve.t)("picker.group.seatPartlyAvailable",{label:e,free:n.states.length-n.missing.length,total:n.states.length,dates:Gs(n.missing,t)}):""}function Js(n,e){let t=n.map((i,r)=>{let s=i.state==="done"?e.done:i.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${k(i.id)}" data-state="${k(i.state)}"${i.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${i.state==="done"?"\u2713":String(r+1)}</span><span class="l">${k(i.label)}</span><span class="sl-pg-sr">${k(s)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${k(e.label)}">${t}</ol>`}function Bn(n,e){return`<ul class="sl-pg-cards">${n.map(i=>`<li class="sl-pg-card" data-event-key="${k(i.eventKey)}"><span class="n">${k(i.name)}</span><time datetime="${k(i.iso)}"><span class="d">${k(i.date)}</span><span class="t">${k(i.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${k(e)}</p>`}function eo(n){let e=n.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${k(t.eventKey)}"><span class="n">${k(t.name)}</span><span class="s">${k(t.labels.length?t.labels.join(", "):n.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${k(n.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(n.note?`<p class="sl-pg-pane-note">${k(n.note)}</p>`:"")+(n.total?`<div class="sl-pg-pane-total"><span>${k(n.total.label)}</span><b>${k(n.total.amount)}</b></div>`:"")+(n.holdStatus?`<p class="sl-pg-hold-status" role="status">${k(n.holdStatus)}</p>`:"")}function to(n){let e=Math.max(0,n);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function io(n,e){if(!n||n.seats<=0)return"";if(e==="same_seat"){let t=n.perPerformance??n.seats;return n.totalPerformances&&n.performances<n.totalPerformances?(0,Ve.tCount)("picker.group.performancesChosenOf",t,{chosen:n.performances,total:n.totalPerformances}):(0,Ve.tCount)("picker.group.seatsEveryPerformance",t)}return n.perPerformance!=null&&n.performancesChosen===n.performances?(0,Ve.tCount)("picker.group.seatsPerPerformance",n.seats,{per:n.perPerformance}):(0,Ve.tCount)("picker.group.performancesChosenOf",n.seats,{chosen:n.performancesChosen,total:n.performances})}function no(n,e){n.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let i=()=>e(t.dataset.eventKey);t.addEventListener("click",i),t.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),i())})})}var ro=require("@seatlayer/core");function we(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function Jl(n,e){let t=n.objectType==="table"&&!!n.bookingMode,i=n.objectType==="booth",r=t||i||!n.seatNumber,s=r?n.rowLabel??n.displayLabel??n.label:n.seatNumber,o=t?`${v("picker.guests","Guests")} ${n.bookingMode==="variable"?`${n.minOccupancy}\u2013${n.maxOccupancy}`:n.capacity}`:!i&&n.rowLabel?`${e} ${ee(n)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${r?" name":""}">${we(s)}</span>`+(o?`<span class="sl-tip-row">${we(o)}</span>`:"")+"</div>"+(n.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${v("picker.section","Section")}</span><span class="sl-tip-secname">${we(n.sectionLabel)}</span></div>`:"")+"</div>"}function so(n,e){let t=n.status==="not_for_sale",i=n.mark?.kind==="partial",r=n.status==="free"||i?"":`<span class="sl-tip-tag">${t?v("picker.notAvailable","Not available"):n.status==="held"?(0,ro.t)("map.statusHeld"):v("picker.sold","Sold")}</span>`,s=t?"":e.price,o=s?`<span class="sl-tip-amt">${we(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${we(e.priceNote)}</div>`:"",l=He(n.commercial),c=l?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u25D0</span>${we(l)}</div>`:"",d=Tt(n.wheelchairSpaceType),p=d?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u267F</span>${we(d)}</div>`:"",u=e.reason?`<div class="sl-tip-reason">${we(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Jl(n,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${we(n.categoryColor)}"></span><span class="sl-tip-name">${we(n.categoryLabel)}</span>`+r+o+"</div>"+a+u+p+c+(e.extra??"")}function oo(n,e,t,i){let r=n.x+14,s=n.y-i.height-12,o=n.y+18,a=s;r+i.width>e-8&&(r=n.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(r,Math.max(8,e-i.width-8))),top:Math.max(8,Math.min(a,l))}}function ao(n,e,t,i=22){let r=Math.max(8,Math.min(n.x-t.width/2,Math.max(8,e.width-t.width-8))),s=n.y-i-t.height,o=n.y+i;return s>=8?{left:r,top:s,placement:"above"}:o+t.height<=e.height-8?{left:r,top:o,placement:"below"}:{left:r,top:Math.max(8,Math.min(s<8?o:s,Math.max(8,e.height-t.height-8))),placement:s<8?"below":"above"}}var $n=14,ec=12,tc=12,ic=18;function lo(n,e,t,i=ec){let r=$n;if(!(n>=e.height-r-t.height-ic))return{placement:"sheet",bottom:r};let o=e.height-n+i,a=e.height-tc-t.height;return{placement:"above",bottom:Math.max(0,Math.min(o,a))}}function co(n,e,t,i){let r=t.width/2+12,s=Math.max(r,Math.min(e.width-r,n.x)),o=n.y+t.height+24<=e.height,a=n.y<t.height+24&&o?"below":"above",l=i&&a==="above"?Math.max(t.height+24,n.y):n.y;return{left:s,top:Math.max(8,Math.min(e.height-8,l)),placement:a}}function po(n,e,t){let i=n.querySelector("[data-pg-select-partial]"),r=[...n.querySelectorAll("[data-pg-event-key]")],s=()=>r.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};r.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 Xe(n){let e=n?.displayType?.trim()||n?.rowType?.trim();return e||(n?.objectType==="table"?v("picker.table","Table"):n?.objectType==="booth"?v("picker.booth","Booth"):v("picker.row","Row"))}var nc=360,rc=160;function sc(n){return(0,ho.contrastRatio)("#ffffff",n)>=3?"#ffffff":"#0b0f19"}var Ui=class{constructor(e){this.el=null;this.seat=null;this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let i=St(e)?e.viewUrl??"":"",r=_i(t);if(!i&&!r)return"";let s=i?null:Di(e,e.focalPoint??t.focalPoint);if(!i&&s==null)return"";let o=r&&s!=null?`<div class="sl-confirm-sight">${_((0,Ze.t)("picker.sightline",{m:s}))}</div>`:"";if(!i)return o;let a=_((0,Ze.t)("picker.viewFromSeat",{label:e.label})),l=_(this.host.tf("picker.viewFromHere","View from here"));return`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`+o}show(e){let t=this.host,i=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,t.root()?.setAttribute("data-confirming","true"),t.els().side?.toggleAttribute("inert",!0),Object.values(t.regions()).forEach(L=>L.toggleAttribute("inert",!0)),t.controller.setSelectionFocus(e.id),i&&i!==e.id&&t.controller.deselect([i]),t.hideTooltip();let r=t.controller.seatDetails(e.id),s=t.controller.doc?.categories.find(L=>L.key===e.categoryKey),o=r?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),a=o!=null?t.paidPrice(e.categoryKey,r?.tierId??s?.tiers?.[0]?.id??null,o,e.label):void 0,l=Ms(r,e.displayLabel??e.label,Xe(r)),c=r?.tiers??s?.tiers??[],d=r?.tierId??c[0]?.id,p=t.suppressPricing()?"":Os(c,d,L=>t.money(t.paidPrice(e.categoryKey,L.id,L.price,e.label))),u=t.buyerView()==="venue3d",h=t.performanceGroup()?.confirmDateSelection??void 0,g=h?t.performanceGroup()?.nights?.()??[]:[],m=h?Ws(g,h,e.id,(L,I)=>t.tf(L,I)):"",y=document.createElement("div");y.className="sl-confirm sl-mo-in",m&&y.classList.add("sl-confirm-group-dates"),y.setAttribute("role","dialog"),y.setAttribute("aria-label",(0,Ze.t)("picker.confirmSeatLabel",{label:e.label}));let S=s?.color??"#6e7bff";y.style.setProperty("--sl-cat",S),y.style.setProperty("--sl-cat-ink",sc(S));let w=String(r?.categoryLabel??s?.label??e.categoryKey),T=t.controller.categoryAvailability()[e.categoryKey],b=typeof T=="number"&&T>0?(0,Ze.tCount)("picker.leftCount",T):"";y.innerHTML=Ns({identityFields:l,identity:Hs(r,e.displayLabel??e.label,Xe(r)),marker:Xt(r?.wheelchairSpaceType),see3dPill:Rs(t.canOffer3d(),u),categoryColor:s?.color??"#6e7bff",categoryLabel:w,priceLabel:!t.suppressPricing()&&a!=null?t.money(a):"",categoryLeftLabel:b,tierChoices:p,groupDates:m,wheelchair:Es(r?.wheelchairSpaceType),commercial:Cs(e.commercial),thumb:t.seatViewEnabled()&&t.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:u?`<div class="sl-confirm-inspect-row">${Ls(e,t.suppressPricing()?`${r?.displayLabel??e.displayLabel??e.label}`:`${r?.displayLabel??e.displayLabel??e.label} \xB7 ${a==null?t.tf("picker.priceNotSupplied","Price not supplied"):t.money(a)}`,u)}${Ps(e,u?t.view3dCompareSeatIds():null)}${On(t.canOffer3d(),u)}</div>`:On(t.canOffer3d(),u),see3dRow:Is(t.canOffer3d(),u),cancelLabel:(0,Ze.t)("common.cancel"),selectLabel:t.addSeatLabel(r?.objectType)}),t.els().map.appendChild(y),this.el=y;let E=y.querySelector(".sl-confirm-thumb"),x=E?.closest(".sl-confirm-thumbwrap")??null;if(E&&x){let L=!1,I=()=>{if(L||!x.isConnected)return;L=!0;let O=()=>{x.remove(),this.el===y&&t.reanchor()};if(t.reducedMotion()||typeof requestAnimationFrame!="function"){O();return}x.style.height=`${x.offsetHeight}px`,x.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{x.style.height="0px",x.style.opacity="0"}),setTimeout(O,rc)};E.addEventListener("error",I),E.addEventListener("load",()=>{E.naturalWidth||I()});let C=e.viewMeta?.previewUrl??e.viewUrl;C?t.resolveAssetUrl(C).then(O=>{if(!(!y.isConnected||this.el!==y)){if(!O){I();return}E.src=O}}).catch(O=>{I(),t.onError(O)}):I()}t.reanchor(),y.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{t.openSeatView(e)}),y.querySelector(".sl-confirm-confidence")?.addEventListener("click",L=>{t.openSeatConfidencePassport(e,L.currentTarget instanceof HTMLElement?L.currentTarget:null)}),y.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>t.saveView3dComparisonSeat(e)),y.querySelectorAll("[data-confirm-tier]").forEach(L=>{L.addEventListener("click",()=>{let I=L.dataset.confirmTier,C=c.find(N=>N.id===I);if(!C)return;t.controller.setSeatTier(e.id,C.id),y.querySelectorAll("[data-confirm-tier]").forEach(N=>{N.setAttribute("aria-pressed",String(N===L))});let O=y.querySelector(".sl-confirm-price");O&&(O.textContent=t.money(t.paidPrice(e.categoryKey,C.id,C.price,e.label))),t.reanchor()})}),y.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(L=>{L.addEventListener("pointerdown",Ti,{once:!0}),L.addEventListener("click",()=>{t.buyerView()==="venue3d"?(t.dismiss(),t.view3dHandle()?.flyToSeat(e.id)):(t.rememberView3dReturnSeat(e),t.dismiss(),t.enter3d(e.id))})}),Qs(y,h,(L,I)=>t.tf(L,I),()=>t.reanchor()),y.querySelector(".sl-confirm-add").addEventListener("click",()=>{this.commit()}),y.querySelector(".sl-confirm-cancel").addEventListener("click",()=>this.cancel()),requestAnimationFrame(()=>{let L=y.querySelector(".sl-confirm-add");L?.focus(),t.liftToastOverConfirm(),t.fitTranslatedRows(),t.inviteCommit(y,L)})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),i=e.els().map;if(e.root()?.dataset.layout==="narrow"){let d=lo(t.y,{height:i.clientHeight},{height:this.el.offsetHeight||230});d.placement==="above"?(this.el.dataset.placement="above",this.el.style.bottom=`${d.bottom}px`):(this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom")),yr(this.el,t,i),e.liftToastOverConfirm();return}let r=i.clientWidth,s=i.clientHeight,o=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=co(t,{width:r,height:s},{width:o,height:a},l);this.el.dataset.placement=c.placement,this.el.style.left=`${c.left}px`,this.el.style.top=`${c.top}px`,yi(this.el,t,{left:c.left,top:c.top,width:o,height:a})}dismiss(){let e=this.host;this.el&&Be(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null)}async commit(){let e=this.host,t=this.seat;if(!t)return;let r=this.el?.querySelector(".sl-confirm-add")??null;if(r?.classList.contains("is-adding")||!await Xs(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let s=()=>{e.dismiss(),kn(e.els(),e.controller.worldToScreen(t),t,e.controller.doc?.categories)};if(!r||e.reducedMotion()){s();return}r.classList.remove("sl-confirm-add-invite"),r.classList.add("is-adding"),r.setAttribute("aria-disabled","true");let o=r.querySelector(".sl-confirm-add-t");o&&(o.textContent=e.tf("picker.added","Added")),e.scheduleMotion(s,nc)}cancel(){let e=this.host,t=this.seat;t&&(e.controller.deselect([t.id]),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}};function uo(n,e,t){if(!e||t)return;e.classList.add("sl-confirm-add-invite");let i=()=>e.classList.remove("sl-confirm-add-invite");n.addEventListener("pointerdown",i,{once:!0}),n.addEventListener("keydown",i,{once:!0}),e.addEventListener("focus",i,{once:!0})}function mo(n,e){return n&&n!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}var fo=require("@seatlayer/core"),Ct=require("@seatlayer/core/picker/minimapGeometry");function go(n,e){let t=new Fn(n);return t.build(e),t}var Fn=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}dispose(){this.miniToggle?.remove(),this.miniWrap?.remove(),this.miniToggle=null,this.miniWrap=null,this.miniCanvas=null,this.miniBase=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.host.root()?.removeAttribute("data-minimap-open")}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",v("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 r=document.createElement("div");r.className="sl-minimap",r.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",v("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",v("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",v("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),r.append(s,c),e.appendChild(r),this.miniWrap=r,this.miniLabel=o,this.miniCanvas=c;let d=document.createElement("canvas");this.miniBase=d,i.addEventListener("click",()=>{let p=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=p,this.setMinimapOpen(!p)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",p=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(p)}),c.addEventListener("pointerdown",p=>this.minimapPointerDown(p)),c.addEventListener("pointermove",p=>this.minimapPointerMove(p)),c.addEventListener("pointerup",p=>this.minimapPointerUp(p)),c.addEventListener("pointercancel",p=>this.minimapPointerUp(p)),c.addEventListener("keydown",p=>this.minimapKeydown(p)),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 r=196,s=146,o=6,a=i.width/Math.max(1,i.height),l=r,c=Math.round(r/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()?v("picker.allFloors","All floors"):e.find(d=>d.id===this.host.controller.getActiveFloorId())?.name??v("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. ${v("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${o}. ${v("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 r=p=>p*t.scale+t.offX,s=p=>p*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 p of d.sections){if(p.outline.length<3)continue;i.beginPath(),p.outline.forEach((h,g)=>g===0?i.moveTo(r(h.x),s(h.y)):i.lineTo(r(h.x),s(h.y))),i.closePath();let u=p.paint;if(i.globalAlpha=p.state==="inactive"?.5:.92,u?i.fillStyle=u.fill:(i.globalAlpha=p.state==="inactive"?.18:p.state==="selected"?.72:.34,i.fillStyle=p.state==="inactive"?a:p.state==="selected"?l:c),i.fill(),i.globalAlpha=.82,i.lineWidth=Math.max(1,t.dpr),i.strokeStyle=u?.stroke||o,i.stroke(),p.owned){i.globalAlpha=1,i.lineWidth=Math.max(2,t.dpr*1.5),i.strokeStyle=l,i.stroke();let h=p.outline.reduce((g,m)=>({x:g.x+m.x,y:g.y+m.y}),{x:0,y:0});i.beginPath(),i.arc(r(h.x/p.outline.length),s(h.y/p.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),i.fillStyle=l,i.fill(),i.beginPath(),p.outline.forEach((g,m)=>m===0?i.moveTo(r(g.x),s(g.y)):i.lineTo(r(g.x),s(g.y))),i.closePath()}p.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 p=Math.max(1,t.dpr),u=this.host.controller.getRenderer?.(),h=new Map,g=m=>{let y=h.get(m);if(y)return y;let S=u?.categoryDisplayColor?.(m)||c;return h.set(m,S),S};for(let m of d.seats)i.globalAlpha=m.state==="inactive"?.22:.78,i.fillStyle=m.state==="inactive"?a:m.state==="selected"?l:g(m.categoryKey),i.beginPath(),i.arc(r(m.x),s(m.y),p,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 r=e.getContext("2d");if(!r)return;r.clearRect(0,0,e.width,e.height),r.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";r.save(),r.globalAlpha=.1,r.fillStyle=a,r.fillRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),r.globalAlpha=.9,r.lineJoin="round",r.lineWidth=Math.max(4,i.dpr*3.25),r.strokeStyle=l,r.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),r.globalAlpha=1,r.lineWidth=Math.max(2,i.dpr*1.75),r.strokeStyle=a,r.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),o.clipped&&Object.values(o.clippedEdges).some(Boolean)&&(r.setLineDash([Math.max(3,i.dpr*3),Math.max(2,i.dpr*2)]),r.strokeRect(o.clipped.x,o.clipped.y,o.clipped.width,o.clipped.height)),r.restore()}minimapWorldPoint(e){let t=this.miniCanvas,i=this.miniTf;if(!t||!i)return null;let r=t.getBoundingClientRect(),s=(e.clientX-r.left)*(t.width/Math.max(1,r.width)),o=(e.clientY-r.top)*(t.height/Math.max(1,r.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,r=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!i&&!r||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+i,y:t.y+t.height/2+r}),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,fo.pointInPolygon)(t,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var Ki=require("@seatlayer/core");var oc=12;function bo(n,e){let t=e.floors(),i=new Set(t.map(x=>x.label.trim().toLocaleLowerCase())),r=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=r.length>1?[]:s,a=t.length>1,l=r.length>1,c=o.length>1;if(!a&&!l&&!c)return null;let d=document.createElement("div");d.className="sl-view3d-nav";let p=null,u=document.createElement("button");u.type="button",u.className="sl-view3d-nav-toggle",u.setAttribute("aria-expanded","false");let h='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>',g=document.createElement("span");u.innerHTML=h,u.appendChild(g);let m=()=>{for(let x of d.querySelectorAll(":scope > div")){let L=x.querySelector('[aria-pressed="true"]');!L||x.scrollWidth<=x.clientWidth||L.scrollIntoView({block:"nearest",inline:"nearest"})}},y=()=>{if(p)return p;for(let x of d.querySelectorAll(":scope > div")){let L=x.querySelector('button[aria-pressed="true"]'),I=L?.textContent?.trim();if(I&&L?.dataset.floor!=="")return I}return a&&(l||c)?v("picker.levelsAndAreas","Levels & areas"):a?v("picker.levels","Levels"):v("picker.areas","Areas")},S=x=>{d.classList.toggle("is-open",x),u.setAttribute("aria-expanded",String(x)),x&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(m),g.textContent=y()};u.addEventListener("click",()=>S(!d.classList.contains("is-open"))),d.addEventListener("keydown",x=>{x.key!=="Escape"||!d.classList.contains("is-open")||(x.preventDefault(),x.stopPropagation(),S(!1),u.focus())});let w=document.createElement("button");w.type="button",w.className="sl-view3d-nav-close",w.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let T=v("picker.closeVenueNavigation","Close venue navigation");w.setAttribute("aria-label",T),w.title=T,w.addEventListener("click",()=>{S(!1),u.focus()}),S(!1),d.appendChild(u);let b=x=>{},E=x=>{};if(a){let x=document.createElement("div");x.setAttribute("role","group"),x.setAttribute("aria-label",v("picker.levels","Levels"));let L=[];E=O=>{L.forEach(N=>{N.setAttribute("aria-pressed",String((N.dataset.floor===""?null:Number(N.dataset.floor))===O))})};let I=O=>{e.focusFloor(O)&&(E(O),b(O))},C=(O,N)=>{let z=document.createElement("button");z.type="button",z.textContent=O,z.dataset.floor=N===null?"":String(N),z.setAttribute("aria-pressed",String(N===null)),z.addEventListener("click",()=>{I(N),S(!1)}),L.push(z),x.appendChild(z)};C(v("picker.allLevels","All levels"),null);for(let O of t)C(O.label||(0,Ki.t)("picker.levelNumber",{number:O.index+1}),O.index);d.appendChild(x)}if(l||c){let x=document.createElement("div");x.setAttribute("role","group"),x.setAttribute("aria-label",v("picker.areas","Areas"));let L=l?r.map(C=>({id:C.id,label:C.label||C.id,go:()=>{e.focusZone(C.id)}})):o.map(C=>({id:C.id,label:C.label||C.id,floorIndex:C.floorIndex,go:()=>{e.focusSection(C.id),Number.isFinite(C.floorIndex)&&E(C.floorIndex)}})),I=C=>{let O=l||C===null?L:L.filter(N=>N.floorIndex===void 0||N.floorIndex===C);if(x.replaceChildren(),!O.length){x.remove();return}if(x.isConnected||d.insertBefore(x,w.isConnected?w:null),!l&&O.length>oc){let N=document.createElement("select");N.setAttribute("aria-label",v("picker.jumpToSection","Jump to section"));let z=document.createElement("option");z.value="",z.textContent=v("picker.jumpToSection","Jump to section"),N.appendChild(z);for(let Q of O){let J=document.createElement("option");J.value=Q.id,J.textContent=Q.label,N.appendChild(J)}N.addEventListener("change",()=>{O.find(Q=>Q.id===N.value)?.go()}),x.appendChild(N);return}for(let N of O){let z=document.createElement("button");z.type="button",z.textContent=N.label,z.dataset.area=N.id,z.addEventListener("click",()=>{p=N.label,N.go(),S(!1)}),x.appendChild(z)}};b=I,I(null)}return d.appendChild(w),n.appendChild(d),d}var Wi=class{constructor(e){this.host=e;this.chip=null}sync(){let e=this.host.overlay();if(!e||this.host.savedSeatIds().length===0){this.chip?.remove(),this.chip=null;return}let t=this.chip;if(!t){t=document.createElement("div"),t.className="sl-view3d-compare-saved",t.setAttribute("role","group"),t.setAttribute("aria-label",v("picker.savedSeatComparison","Saved seat comparison"));let s=document.createElement("button");s.type="button",s.className="main",s.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(v("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",v("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,r=t.querySelector(".main");r&&(r.textContent=i>1?(0,Ki.t)("picker.compareCount",{count:i}):v("picker.oneSeatSaved","1 seat saved"),r.setAttribute("aria-label",i>1?(0,Ki.t)("picker.openComparisonOfSeats",{count:i}):v("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function vo(n){return!n?.querySelector('[data-ref="zfs"]')}var Vn=require("@seatlayer/core");var ac=900,lc=450;function cc(n){switch(n){case"seat":return v("picker.stopYourSeat","Your seat");case"row":return v("picker.stopYourRow","Your row");case"section":return v("picker.stopYourSection","Your section");default:return v("picker.stopWholeVenue","Whole venue")}}function yo(n,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let i=v("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",i),t.title=i,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let r=document.createElement("div");r.className="sl-view3d-stop",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),n.append(t,r);let s=null,o=null;return{onStopChange(a){if(s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),!a){r.classList.remove("is-shown"),r.textContent="",o=setTimeout(()=>{o=null,n.classList.remove("is-seat-view")},lc);return}n.classList.add("is-seat-view"),r.textContent=cc(a),r.classList.add("is-shown"),s=setTimeout(()=>{s=null,r.classList.remove("is-shown")},ac)},dispose(){s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),t.remove(),r.remove(),n.classList.remove("is-seat-view")}}}var dc=44,pc=92;function wo(n,e,t,i={}){let r=n?.sectionLabel,s=ee(n),o=hc(n,e),a=[r,s?(0,Vn.t)("picker.rowLabel",{label:s}):null,o?(0,Vn.t)("picker.seatLabel",{label:o}):null].filter(Boolean).join(" \xB7 "),l=i.maxChars??(i.narrow?dc:pc);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 hc(n,e){if(n?.seatNumber)return n.seatNumber;let t=n?.displayLabel??e,i=r=>{!r||!t.startsWith(r)||t.length<=r.length||(t=t.slice(r.length).replace(/^[\s·\-\/_]+/,""))};return i(n?.sectionLabel),i(ee(n)),t}var xo="sl:sheet-hint";function ko(n){let e=n.boot;if(!e?.isConnected)return;if(n.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),n.map?.appendChild(t),setTimeout(()=>t.remove(),650),n.rail?.classList.add("is-in"),n.root?.classList.add("is-arriving"),setTimeout(()=>{n.rail?.classList.remove("is-in"),n.root?.classList.remove("is-arriving"),uc(n.root)},900)}function uc(n){if(!n||n.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(xo))return;window.sessionStorage.setItem(xo,"1")}catch{}let e=n.querySelector(".sl-sheet-grab");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function So(n,e){n.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let i of e())if(i.open()){t.preventDefault(),t.stopPropagation(),i.close();return}}})}function Yi(n){let e=n.committedSelection(),t=n.controller.getGAAreas(),i=n.hold?.items??[],r=new Set(i.map(u=>u.label)),s=Er(n,t,i),o=Ye(n.gaQty,i),a=i.reduce((u,h)=>u+n.paidPrice(h.categoryKey,h.tierId,h.unitPrice,h.label)*(h.quantity??1),0),l=i.reduce((u,h)=>u+(h.quantity??1),0),c=e.filter(u=>!r.has(u.label)),d=c.reduce((u,h)=>u+n.paidPrice(h.categoryKey,h.tierId??null,h.price,h.label)*(h.quantity??1),0)+s+a,p=c.reduce((u,h)=>u+(h.quantity??1),0)+o+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:i,heldLabels:r,heldCount:l,total:d,count:p}}function Qi(n,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:n.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function Xi(n,e){let t=e.tiers?.length?e.tiers.map(i=>n.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[n.paidPrice(e.key,null,e.price)];if(e.key)for(let i of n.pricesByChannel.values())for(let r of i)r.categoryKey===e.key&&t.push(r.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var Zt="seatlayer_";function mc(){let n=globalThis;return n.document?.modelContext??n.navigator?.modelContext??null}function ue(n,e){return e?{ok:!1,reason:n,message:e}:{ok:!1,reason:n}}function fc(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&!!e):[]}function gc(n,e){let t=n.event();if(!t)return ue("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits();return{ok:!0,event:t,selection:{max:i.max,...i.required!=null?{required:i.required}:{}},categories:n.categories(),zones:n.zones(),hasPremiumSeats:n.hasPremiumSeats(),holdsAllowed:e}}function To(n,e){let t=r=>!!r&&r.toLowerCase()===e.toLowerCase(),i=n.find(r=>t(r.key??r.id))??n.find(r=>t(r.label));return i?.key??i?.id??null}function Co(n,e){let t=e.map(i=>n.describeSeat(i.id));return{seatIds:e.map(i=>i.id),labels:e.map(i=>i.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((i,r)=>t[r]?.seat||i.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((i,r)=>i+r.price,0)}}function bc(n,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 r=[];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)r.push(Co(n,o.slice(d,d+t)));a=l}}return r}function vc(n,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 r=[];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);r.push(Co(n,o.slice(0,t)))}return r}function yc(n,e){if(!n.event())return ue("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits(),r=Math.floor(Number(e.count));if(!Number.isInteger(r)||r<1||r>i.max)return ue("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?To(n.categories(),l):null;if(l&&!d)return ue("no_match",`No ticket type called "${l}".`);let p=c?To(n.zones(),c):null;if(c&&!p)return ue("no_match",`No zone called "${c}".`);let u=n.seats().filter(m=>m.available);if(!u.length)return ue("sold_out");let h=u.filter(m=>(!d||m.categoryKey===d)&&(!p||m.zoneId===p)&&(a==null||m.price<=a));if(!h.length)return ue("no_match");let g=o?bc(n,h,r):vc(n,h,r);return g.length?(g.sort((m,y)=>y.unitPrice!==m.unitPrice?y.unitPrice-m.unitPrice:m.row.localeCompare(y.row)||m.labels[0].localeCompare(y.labels[0])),{ok:!0,groups:g.slice(0,s),searched:{count:r,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...p?{zone:p}:{},together:o}}}):ue(o?"not_enough_together":"no_match")}function Eo(n){return{ok:!0,...n.selection()}}function wc(n,e){let t=n.event();if(!t)return ue("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return ue("event_closed","Sales are closed for this event.");let i=fc(e.seat_ids);return i.length?(n.clearSelection(),n.selectObjects(i),Eo(n)):ue("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function xc(n,e){let t=async r=>{try{return await r()}catch(s){return ue("error",s instanceof Error?s.message:String(s))}},i=[{name:`${Zt}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(()=>gc(n,e))},{name:`${Zt}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:r=>t(()=>yc(n,r))},{name:`${Zt}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:r=>t(()=>wc(n,r))},{name:`${Zt}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(()=>Eo(n))}];return e&&i.push({name:`${Zt}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>n.hold())}),i}async function Ao(n,e={}){let t=mc();if(!t||typeof t.registerTool!="function")return null;let i=new AbortController,r=xc(n,!!e.holds),s=[],o=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of r)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 Po(n){let e=n.opts.webMcp;if(!e||n.destroyed)return;let t=typeof e=="object"&&!!e.holds,i=typeof e=="object"?e.exposedTo:void 0;try{n.webMcp=await Ao(jn(n,t),{holds:t,exposedTo:i}),n.destroyed&&zn(n)}catch(r){console.warn("seatmap: WebMCP registration failed",r)}}function zn(n){n.webMcp?.dispose(),n.webMcp=null}function jn(n,e){let t=(i,r)=>{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:r};return{event:()=>{let i=n.renderInfo;return i?{name:i.eventName??"",venue:i.venue??null,startsAt:i.startsAt??null,timezone:i.timezone??null,currency:n.currency,salesClosed:n.salesClosed}:null},selectionLimits:()=>({max:n.maxTickets,required:n.exactTickets}),categories:()=>{let i=n.controller.categoryAvailability();return(n.controller.doc?.categories??[]).filter(r=>!r.notForSale).map(r=>{let s=Xi(n,r),o=Qi(n,r);return{key:r.key,label:r.label??r.key,...o===void 0?{}:{price:o},...s&&s.min!==s.max?{priceRange:s}:{},available:i[r.key]??0}})},zones:()=>n.controller.getBestAvailableZones(),hasPremiumSeats:()=>n.controller.hasPremiumSeats(),seats:()=>{let i=n.controller.getActiveFloorId(),r=[];return n.allSeats().forEach((s,o)=>{if(s.floorId&&i&&s.floorId!==i)return;let a=n.controller.getStatus(s.id)??"free",l=n.controller.doc?.categories.find(d=>d.key===s.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;r.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:n.paidPrice(s.categoryKey,l?.tiers?.[0]?.id??null,c,s.label),...s.zoneId?{zoneId:s.zoneId}:{},available:a==="free"&&!l?.notForSale})}),r},describeSeat:i=>{let r=n.controller.seatDetails(i);return r?{section:r.sectionLabel??"",row:ee(r)??"",seat:r.seatNumber??r.label,category:r.categoryLabel??r.categoryKey}:null},selection:()=>{let{freshSeats:i,total:r,count:s}=Yi(n);return{seats:i.map(o=>({id:o.id,label:o.label,section:o.sectionLabel??"",row:ee(o)??"",seat:o.seatNumber??o.label,category:o.categoryKey,price:n.paidPrice(o.categoryKey,o.tierId??null,o.price,o.label)})),count:s,total:r,currency:n.currency,hold:n.hold?{id:n.hold.holdId,expiresAt:n.hold.expiresAt}:null,validity:n.getSelectionValidity()}},clearSelection:()=>n.clearSelection(),selectObjects:i=>{n.selectObjects(i)},hold:()=>e?kc(n):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function kc(n){if(n.salesClosed)return{ok:!1,reason:"event_closed"};if(!n.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=n.controller.getSelectionValidity(n.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await n.handleCta(),n.hold?{ok:!0,hold:{id:n.hold.holdId,expiresAt:n.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function Gn(n){return{renderingTimeMillis:n.ms,performanceProfile:n.performanceProfile,seatCount:n.seatCount,objectCount:n.objectCount,sectionCount:n.sectionCount,view:n.view,eventKey:n.eventKey,chartName:n.chartName,floorCount:n.floorCount,transport:n.transport,load:n.load,metricScope:n.metricScope,operationalTelemetryReporter:"sdk"}}function Lo(n,e){Me({apiBase:n.apiBase,event:n.eventKey,scope:n.metricScope,surface:n.surface,outcome:"success",ms:n.ms,performanceProfile:n.performanceProfile,chartDelivery:n.chartDelivery,seats:n.seatCount,floors:n.floorCount,view:n.view,load:n.load,transport:n.transport}),e("chart_rendered",Gn(n))}var Mo=require("@seatlayer/core/core/seatConfidence");function ne(n){return String(n??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Ho(n){let e=(0,Mo.seatConfidenceDisclosure)(n.seat.confidenceEvidence),t=n.seat.confidenceEvidence,i=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${ne(c)}</li>`).join("")}</ul>`:"",r=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${ne(e.modeledTarget)}</dd></div>`:"",s=t?`<div><dt>Evidence ID</dt><dd>${ne(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${ne(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${ne(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${ne(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${ne(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",o=He(n.seat.commercial)||n.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${ne(o)}</dd></div>`+(n.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${ne(n.seat.commercial.note)}</dd></div>`:""),l=n.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${ne(n.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${ne(e.headline)}</strong><span>${ne(e.coverage)} \xB7 ${ne(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${ne(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${ne(e.reality)}</dd></div><div><dt>Source</dt><dd>${ne(e.provenance)}</dd></div>`+a+r+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 Ro(n){return n?n.closest("[data-report]")?"report":n.closest("[data-close]")||n.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function Zi(n,e,t){let i=n?.querySelector("[data-report]"),r=n?.querySelector("[data-report-status]");i&&(i.disabled=e!=="failed",i.textContent=e==="received"?"Report received":"Report this view"),r&&(r.setAttribute("role",e==="failed"?"alert":"status"),r.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function qn(n,e,t=null){let i=n.view3dEl;if(!i)return;Jt(n,!1);let r=e.confidenceEvidence,s=n.controller.seatDetails(e.id),o=document.createElement("div");o.className="sl-view3d-passport-shell",o.innerHTML=Ho({seat:e,title:s?.displayLabel??e.displayLabel??e.label,restrictionFallback:n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof n.api.reportViewEvidence=="function"});let a=[...new Set([...i.children,...[...n.els.map.children].filter(u=>u!==i)])].filter(u=>u instanceof HTMLElement),l=a.map(u=>({element:u,inert:u.inert,ariaHidden:u.getAttribute("aria-hidden")}));for(let u of a)u.inert=!0,u.setAttribute("aria-hidden","true");i.appendChild(o),i.classList.add("has-passport"),n.view3dPassportEl=o;let c=o.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],p=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),Jt(n);return}if(u.key!=="Tab")return;let h=d();if(!h.length)return;let g=h[0],m=h[h.length-1];u.shiftKey&&document.activeElement===g?(u.preventDefault(),m.focus()):!u.shiftKey&&document.activeElement===m&&(u.preventDefault(),g.focus())};window.addEventListener("keydown",p,!0),n.view3dPassportCleanup=()=>{window.removeEventListener("keydown",p,!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 u=t?.isConnected?t:n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareEl?.querySelector("[data-passport-seat]")??null,h=u?.closest(".sl-confirm,.sl-view3d-compare");h?.isConnected&&(h.inert=!1,h.removeAttribute("aria-hidden")),o.remove(),i.classList.remove("has-passport"),n.view3dPassportEl===o&&(n.view3dPassportEl=null);let g=u??n.view3dCompareEl?.querySelector("[data-passport-seat]")??n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareChip.mainButton();(t?.isConnected?t:g)?.focus()},o.addEventListener("click",u=>{let h=Ro(u.target instanceof HTMLElement?u.target:null);h==="close"&&Jt(n),h==="report"&&Sc(n,e)}),requestAnimationFrame(()=>d()[0]?.focus()),n.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:r?.evidenceId??null,eventConfigurationId:r?.eventConfigurationId??null,modelLevel:r?.modelLevel??"unverified",realityLevel:r?.realityLevel??"none"})}async function Sc(n,e){if(n.api.reportViewEvidence){Zi(n.view3dPassportEl,"sending");try{let t=await n.api.reportViewEvidence(n.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});n.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),Zi(n.view3dPassportEl,"received",t.report.id)}catch{Zi(n.view3dPassportEl,"failed")}}}function Jt(n,e=!0){let t=n.view3dPassportCleanup;if(n.view3dPassportCleanup=null,!t){n.view3dPassportEl?.remove(),n.view3dPassportEl=null,n.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function Io(n){let e=n.view3dEl;if(!e||n.view3dCompareSeatIds.length<2)return;Je(n,!1);let t=n.view3dCompareSeatIds.map(h=>n.view3dComparisonSnapshot(h)).filter(h=>!!h);if(t.length<2){n.clearView3dComparison();return}let i=h=>k(h),r=t.some(h=>!!h.price),s=document.createElement("div");s.className="sl-view3d-compare-shell";let o=t.map((h,g)=>`<article><span>Seat ${g===0?"A":"B"}</span><strong>${i(h.label)}</strong><small>Section ${i(h.section)} \xB7 Row ${i(h.row)}</small><dl>`+(r?`<div><dt>Current price</dt><dd>${i(h.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${i(h.category)}</dd></div><div><dt>Availability</dt><dd>${i(h.availability)}</dd></div><div><dt>View source</dt><dd>${i(h.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${i(h.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${i(h.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${i(h.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${i(h.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${i(h.seat.id)}">Passport</button><button type="button" data-view-seat="${i(h.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${i(h.seat.id)}"${h.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");s.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${r?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${o}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(h=>h instanceof HTMLElement),c=l.map(h=>({element:h,inert:h.inert,ariaHidden:h.getAttribute("aria-hidden")}));for(let h of l)h.inert=!0,h.setAttribute("aria-hidden","true");e.appendChild(s),e.classList.add("has-comparison"),n.view3dCompareEl=s;let d=s.querySelector(".sl-view3d-compare"),p=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=h=>{if(h.key==="Escape"){h.preventDefault(),Je(n);return}if(h.key!=="Tab")return;let g=p();if(!g.length)return;let m=g[0],y=g[g.length-1];h.shiftKey&&document.activeElement===m?(h.preventDefault(),y.focus()):!h.shiftKey&&document.activeElement===y&&(h.preventDefault(),m.focus())};window.addEventListener("keydown",u),n.view3dCompareCleanup=()=>{window.removeEventListener("keydown",u);for(let h of c)h.element.inert=h.inert,h.ariaHidden===null?h.element.removeAttribute("aria-hidden"):h.element.setAttribute("aria-hidden",h.ariaHidden);s.remove(),e.classList.remove("has-comparison"),n.view3dCompareEl===s&&(n.view3dCompareEl=null),a?.isConnected?a.focus():n.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>Je(n)),s.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.passportSeat,m=g?n.allSeats().find(y=>y.id===g):void 0;m&&qn(n,m,h)})),s.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.viewSeat;Je(n,!1),g&&n.view3dHandle?.flyToSeat(g)})),s.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.selectSeat;g&&Tc(n,g)})),requestAnimationFrame(()=>p()[0]?.focus()),n.emit3dAnalytics("3d_comparison_opened",{seatIds:n.view3dCompareSeatIds.slice()})}function Je(n,e=!0){let t=n.view3dCompareCleanup;if(n.view3dCompareCleanup=null,!t){n.view3dCompareEl?.remove(),n.view3dCompareEl=null,n.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function Tc(n,e){if(n.salesClosed){n.toast(n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=n.allSeats().find(r=>r.id===e);if(!t)return;if(Je(n,!1),!n.controller.select([e]).length){n.syncSelectionTo3d(),n.toast(n.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}n.syncSelectionTo3d(),n.showConfirm(t),n.emit3dAnalytics("3d_comparison_selected",{seatId:e})}function Oo(n,e){n.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.")},r=document.createElement("div");r.className="sl-view3d-unavailable",r.dataset.state=e.visualState,r.setAttribute("role","status"),r.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,r.append(a,l,c),l.addEventListener("click",()=>Un(n)),n.appendChild(r),wi(r,e.anchor??null)}function Un(n){let e=n?.querySelector(".sl-view3d-unavailable:not([data-leaving])");e&&(e.dataset.leaving="true",Be(e))}var ei=require("@seatlayer/core");function _o(n){return Array.isArray(n)?n.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function Kn(n,e,t=!1){let i=n.violations[0];return i==="numberOfPlacesToSelect"?n.remaining>0?(0,ei.t)("picker.selectExactMore",{count:n.remaining}):(0,ei.t)("picker.selectExactCount",{count:n.required}):i==="minimumSelectedPlaces"?(0,ei.t)("picker.selectMinimumMore",{count:n.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):i==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,ei.t)("picker.orphanHint")}var ge=require("@seatlayer/core");function ti(n){let e=Math.max(0,n),t=Math.floor(e/6e4),i=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${i}`}function Do(n){let e=n.performanceLabel?`<div class="sl-chip-when">${_(n.performanceLabel)}</div>`:"",t=n.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${_(n.performanceDates.summary)}</span><span class="sl-chip-date-list">${n.performanceDates.labels.map(i=>`<span class="sl-chip-date">${_(i)}</span>`).join("")}</span></div>`:"";return e+Cc(n)+t}function Cc(n){let{d:e,area:t,label:i,objectType:r,quantity:s=1,identity:o}=n,a=T=>String(T??"\u2014").replace(/[&<>"]/g,b=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[b]),l=r==="ga"?"ga":e?.objectType??r,c=o?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?v("picker.table","Table"):l==="booth"?v("picker.booth","Booth"):l==="ga"?v("picker.generalAdmission","General admission"):v("picker.row","Row")),d=o?.rowLabel??o?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??i,p=n.categoryLabel?.trim()??"",u="",h=[];l==="table"&&o?.bookingMode?(u=`${c} ${d}`,h.push([v("picker.guests","Guests"),String(s)])):l==="ga"?(u=String(t?.displayLabel??d),s>1&&h.push([v("picker.tickets","Tickets"),String(s)])):l==="booth"?(u=e?.sectionLabel??`${c} ${d}`,e?.sectionLabel&&h.push([c,String(d)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?u=String(d):(u=e.sectionLabel??"",e.rowLabel&&h.push([c,String(ee(e)??e.rowLabel)]),e.seatNumber&&h.push([v("picker.seat","Seat"),String(e.seatNumber)]));let g=!u&&!!p,m=u||p||String(d),y=!!p&&!g&&p!==m,S=h.map(([T,b])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(T)}</span> <b>${a(b)}</b></span>`);y&&S.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(p)}</span></span>`);let w=[m,...h.map(([T,b])=>`${T} ${b}`),y?p:""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(w)}</span><span class="sl-chip-name" aria-hidden="true">${a(m)}</span>`+(S.length?`<span class="sl-chip-pos" aria-hidden="true">${S.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function Wn(n,e){let t=_(n),i=e?_(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${i}" aria-label="${_((0,ge.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>`:"")+`<button type="button" class="rm" aria-label="${t}"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function No(n){return n.salesClosed||n.hasHold||n.ctaPhase!=="idle"||n.formOpen||n.room<=0?null:Math.max(1,Math.min(n.wanted,n.room))}function Bo({count:n,total:e,pendingCount:t,ctaPhase:i,hasHold:r,salesClosed:s,suppressPricing:o=!1,fromPrice:a,addMore:l,offerFind:c=!1,holdTime:d,money:p}){if(n&&i==="holding")return`<span>${v("picker.securingSeats","Securing your seats\u2026")}</span>`;if(n&&i==="checkout")return o?`<span>${v("picker.seatsSecuredOpeningCheckout","Seats secured. Opening checkout\u2026")}</span>`:`<span>${(0,ge.t)("picker.peekSecured",{count:n,total:p(e)})}</span>`;if(n)return`<span class="sl-peek-sum">${(0,ge.tCount)("picker.ticketsCount",n)}</span>`+(l&&!o?`<button type="button" class="go ghost sl-sheet-go sl-sheet-best" data-act="best" aria-label="${v("picker.findTogetherInstead","Find seats together instead")}"><span aria-hidden="true">\u2726</span>${v("picker.seatsTogether","Seats together")}</button>`:"")+`<button type="button" class="go sl-sheet-go" data-act="checkout">${r&&t?v("picker.secureMore","Secure more"):v("picker.continue","Continue")}`+(o?"":`<span class="sl-peek-total">${p(e)}</span>`)+(r&&d?`<span class="sl-peek-time" aria-hidden="true">${d}</span>`:"")+"</button>";if(s)return`<span>${v("picker.salesClosedPill","Sales are closed")}</span>`;let u=!o&&a!=null?p(a):null;return`<span class="sl-peek-sum">${u!=null?(0,ge.t)("picker.peekFromPrice",{price:u}).replace(u,`<b class="sl-peek-price">${u}</b>`):v("picker.pickYourSeats","Pick your seats")}</span>`+(c?`<button type="button" class="go sl-sheet-go sl-sheet-find" data-act="find"><span class="sl-peek-spark" aria-hidden="true">\u2726</span>${v("picker.findSeats","Find seats")}</button>`:"")}function Yn(n,e=Date.now()){return(0,ge.t)("picker.holdReassurance",{time:ti(n-e)})}function $o(n){return n.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${v("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,ge.t)("picker.willFindSeatsTogether",{count:n.quantity})}</b><span>${v("picker.manualTicketsRemovedNote","Your manually selected tickets will be removed only after a new group is secured.")}</span></div><div class="sl-ba-actions"><button type="button" data-ba-cancel>${v("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${v("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${v("picker.findClosestSeatsTogether","Find the closest seats together")}</div><div class="sl-ba-copy">${v("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")}</div>`+(n.offerPremium?`<button type="button" class="sl-ba-premium${n.premium?" on":""}" data-ba-premium aria-pressed="${n.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${v("picker.bestSeatsPremium","Best seats")}</button>`:"")+`<div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${v("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${n.quantity}</span><button type="button" data-ba="1" aria-label="${v("picker.moreSeats","More seats")}">+</button></div>`+(n.categories.length>1?`<select class="sl-ba-cat" aria-label="${_(v("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${_(v("picker.anyTicketType","Any ticket type"))}</option>`+n.categories.map(e=>`<option value="${_(e.key)}"${n.selectedCategory===e.key?" selected":""}>${_(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(n.zones.length?`<select class="sl-ba-zone" aria-label="${v("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${v("picker.anyVenueZone","Any venue zone")}</option>`+n.zones.map(e=>`<option value="${_(e.id)}"${n.selectedZone===e.id?" selected":""}>${_(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${n.busy?" sl-busy":""}"${n.busy?" disabled":""}>`+(n.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${v("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,ge.tCount)("picker.findBestSeatsCount",n.quantity))+"</button>"+(n.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${v("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function Fo(n){if(n.salesClosed&&!n.hasPicks){let e=n.whenText?`<span class="when">${_(n.whenText)}</span>`:"";return`<div class="sl-closed-note" role="status"><b>${v("picker.salesClosedPill","Sales are closed")}</b><span>${v("picker.salesClosedCopy","Ticket sales for this event have ended.")}${e}</span></div>`}return n.hasPicks?"":n.hasGaAreas?`<div class="sl-tray-hint">${n.seated?n.venue3d?v("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue \u2014 or grab standing tickets below."):v("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below."):n.venue3d?v("picker.gaTrayHintChoose3dArea","Choose an area in the 3D venue to select tickets."):v("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets.")}</div>`:`<div class="sl-tray-hint">${n.groupMode==="per_performance"?v("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):n.groupMode?v("picker.groupTrayHint","Choose seats once \u2014 the same seats will be held for every performance."):n.venue3d?v("picker.trayHintChoose3dOrBest","Choose a seat in the 3D venue, or let us pick the best available for you."):v("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}</div>`}function Vo(n){return{title:(0,ge.t)("picker.securedCount",{count:n.secured}),copy:n.pendingCount?(0,ge.t)("picker.moreSelectedCount",{count:n.pendingCount}):Yn(n.expiresAt),change:n.releasing?v("picker.releasingEllipsis","Releasing\u2026"):v("picker.change","Change")}}var Et=require("@seatlayer/core");var Qn=4,Ec=6;function Ac(n){let e=n.trim();return/^[0-9]{1,4}$/.test(e)?Number(e):null}function zo(n){return[n.held?"h":"s",n.section,n.rowLabel,n.categoryLabel,n.amountText].join(" ")}function Pc(n){if(n.length===1)return n[0];let e=n.map(Ac);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=n.slice(0,3).join(", ");return n.length>3?`${t} +${n.length-3}`:t}function Lc(n){let e=[];for(let t of n){let i=e[e.length-1];!!i&&t.groupable&&i.members[0].groupable&&zo(i.members[0])===zo(t)?i.members.push(t):e.push({members:[t],seatsLabel:""})}for(let t of e)t.seatsLabel=Pc(t.members.map(i=>i.seatLabel));return e}function Go(n,e,t,i){let r=_;return` data-key="${r(n)}"`+(t.length?` data-held="${r(encodeURIComponent(t.join(`
2806
- `)))}"`:"")+(e.length?` data-seat="${r(e.join(" "))}"`:"")+(i?` data-locate="${r(i)}"`:"")}function qo(n){let e=_;return`<div class="sl-chip${n.held?" sl-held":""}${n.fresh?" sl-enter":""}"`+Go(n.key,n.seatIds,n.heldLabels,n.locateId)+">"+(n.held?n.stateHtml:`<span class="sl-chip-dot" style="background:${k(n.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${n.identityHtml}`+(n.extrasHtml?`<div class="sl-chip-sub">${n.extrasHtml}</div>`:"")+`${n.noteHtml}</div>`+(n.amountText?`<span class="amt">${e(n.amountText)}</span>`:"")+n.railHtml+"</div>"}function jo(n,e,t,i,r){let s=_,o=e?.members.length??1,a=o>1,l=e?e.seatsLabel:n.seatLabel,c=e?e.members.reduce((u,h)=>u+h.amount,0):n.amount,d=e?e.members.flatMap(u=>u.seatIds):n.seatIds,p=e?e.members.flatMap(u=>u.heldLabels):n.heldLabels;return`<div class="sl-chip sl-tline${n.held?" sl-held":""}${n.fresh?" sl-enter":""}${e?"":" sl-tsub"}"${i?' data-overflow="true"':""}`+(e?` data-run="${t}"`:` data-run-of="${t}"`)+Go(n.key,d,p,n.locateId)+">"+(a?`<button type="button" class="sl-trun-toggle" aria-expanded="false" aria-label="${s((0,Et.tCount)("picker.seatsSelectedCount",o))}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg></button>`:n.held?n.stateHtml:`<span class="sl-tline-dot" style="background:${k(n.categoryColor)}" aria-hidden="true"></span>`)+`<span class="sl-sr">${s(n.categoryLabel)}</span><span class="sl-tline-id"><b>${s(n.section||n.seatLabel)}</b>`+(n.rowLabel?`<i>\xB7</i><span>${s(n.rowLabel)}</span>`:"")+(n.section&&l?`<i>\xB7</i><span>${s(l)}</span>`:"")+"</span>"+n.extrasHtml+(r.suppressPricing||!n.amountText?"":(a?`<span class="sl-tline-mult">${o}\xD7</span>`:"")+`<span class="amt">${s(r.money(c))}</span>`)+(n.railHtml?`<button type="button" class="rm" aria-label="${s(a?(0,Et.t)("picker.removeSeatLabel",{label:[n.section,n.rowLabel,l].filter(Boolean).join(" \xB7 ")}):n.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 Uo(n,e){if(!n.length)return"";let t=Lc(n),i=[v("picker.section","Section"),v("picker.row","Row"),v("picker.seat","Seat")].join(" \xB7 "),r=t.length>=Ec,s=t.map((a,l)=>{let c=r&&l>=Qn;return jo(a.members[0],a,l,c,e)+(a.members.length>1?a.members.map(d=>jo(d,null,l,c,e)).join(""):"")}).join(""),o=r?`<button type="button" class="sl-tmore" data-tmore aria-expanded="false" data-more="${_((0,Et.t)("picker.moreCount",{count:t.length-Qn}))}" data-less="${_(v("picker.showLess","Show less"))}"><span>${_((0,Et.t)("picker.moreCount",{count:t.length-Qn}))}</span><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg></button>`:"";return`<div class="sl-tlist"${r?' data-collapsed="true"':""}><div class="sl-tlist-head sl-sr">${_(i)}</div>${s}${o}</div>`}function Ko(n){n.dataset.denseWired!=="true"&&(n.dataset.denseWired="true",n.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 r=t.closest(".sl-trun-toggle");if(!r)return;e.stopPropagation();let s=r.closest(".sl-tline"),o=s?.dataset.run;if(!s||o===void 0)return;let a=r.getAttribute("aria-expanded")!=="true";r.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 et=require("@seatlayer/core");var Mc='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="13" cy="4.4" r="1.9"/><path d="M11 8.2v5.1h5.1"/><path d="M16.6 13.3l1.9 6.3"/><path d="M15.4 14.9a5.6 5.6 0 1 1-5.9-3.4"/></svg>',Hc='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="8.4"/><circle cx="8.6" cy="10.2" r="1.15"/><circle cx="12" cy="8.2" r="1.15"/><circle cx="15.4" cy="10.2" r="1.15"/><path d="M12 20.4a2.6 2.6 0 0 1 0-5.2 2.2 2.2 0 0 0 0-4.4"/></svg>',Ji=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let i=this.offered().length>0;this.button.setAttribute("aria-label",i?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options")),this.button.innerHTML=i?Mc:Hc,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let r of this.stored())this.offeredFree().has(r)&&this.active.add(r);if(this.menu.innerHTML=Fs(this.rows()),this.root.append(this.menu,this.button),e.appendChild(this.root),this.button.addEventListener("click",r=>{r.stopPropagation(),this.open(this.menu.hidden)}),this.menu.addEventListener("pointerdown",r=>r.stopPropagation()),this.menu.addEventListener("click",r=>r.stopPropagation()),this.dismiss=()=>this.open(!1),this.escape=r=>{r.key==="Escape"&&this.open(!1)},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let r=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(r):r()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:i,count:r})=>[i,r])),t=!1;for(let i of this.menu.querySelectorAll("[data-a11y-row]")){let r=i.dataset.a11yRow??"";if(!r.startsWith("a11y:"))continue;let s=r.slice(5),o=e.get(s);if(o===void 0)continue;let a=this.countNode(i),l=o==null?"":o>0?(0,et.t)("picker.accessFreeCount",{count:o}):this.deps.tf("picker.accessNoneLeft","None left");a&&(a.textContent=l);let c=o===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(s,l))),i.disabled=c,c?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),c&&this.active.delete(s)&&(this.paint(i,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let i=t.dataset.a11yRow??"";i.startsWith("a11y:")&&this.paint(t,this.active.has(i.slice(5)))}}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();hn(this.menu,{x:t.left+t.width/2,y:t.top}),wr(this.menu),wi(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:r})=>({key:i,count:r}));let t=this.deps.present;return t?et.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(et.ACCESSIBILITY_TYPES.map(i=>[i.key,i]));return this.offered().flatMap(({key:i,count:r})=>{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")}:{},...r==null?{}:{count:r>0?(0,et.t)("picker.accessFreeCount",{count:r}):this.deps.tf("picker.accessNoneLeft","None left"),disabled:r===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),r=!this.active.has(i);r?this.active.add(i):this.active.delete(i),this.paint(e,r),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let i=(e.dataset.a11yRow??"").slice(5),r=document.createElement("div");r.className="sl-a11yrow-w",e.replaceWith(r);let s=document.createElement("button");s.type="button",s.className="sl-a11yrow-c sl-a11yjump",s.dataset.a11yJump=i,s.textContent=t.textContent,s.disabled=e.disabled,s.setAttribute("aria-label",this.jumpLabel(i,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(i,s.textContent??"")),r.append(e,s),s.addEventListener("click",o=>{o.stopPropagation(),this.active.has(i)||(this.active.add(i),this.paint(e,!0),this.applyFilter({focus:!1}));let a=this.deps.stepToAccessibleSection?.(i);a&&s.setAttribute("aria-label",this.jumpLabel(i,s.textContent??"",a.label))})}}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){return et.ACCESSIBILITY_TYPES.find(t=>t.key===e)?.label??e}jumpLabel(e,t,i){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...i?[`${this.deps.tf("picker.section","Section")} ${i}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};var Wo=require("@seatlayer/core"),Rc=250;function Yo(n,e=Rc){let t=null,i=()=>{t===null&&(t=setTimeout(()=>{t=null,n()},e))},r=(0,Wo.attachVisibilityCatchUp)(i),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",i),()=>{t!==null&&(clearTimeout(t),t=null),r(),s&&window.removeEventListener("focus",i)}}var tt=require("@seatlayer/core");var en=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,tt.holdRecoveryShape)(e),i=e.lapsedLabels.length,r=i-e.recoverable.length,s=t==="all"?(0,tt.tCount)("picker.holdLapsedStillFree",i):t==="partial"?(0,tt.tCount)("picker.holdLapsedSomeTaken",r):(0,tt.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>${_(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${_(this.note.message)}</span>${e}</div>`}wire(e){e?.querySelector("[data-lapse-again]")?.addEventListener("click",()=>this.recover())}clear(){this.note&&(this.note=null,this.deps.syncTray())}actionLabel(){return(0,tt.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 Qo=Symbol("seatlayer.performance-group-picker");function tn(n,e){return Object.defineProperty(n,Qo,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),n}function Xo(n){return n[Qo]??null}var Zo="@seatlayer/pending-checkout/v1";function Ic(n){return typeof n=="string"&&n.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(n)}function Jo(n){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let i=null;try{let r=window.sessionStorage.getItem(Zo);if(r){let s=null;try{s=JSON.parse(r)}catch{}if(s&&Ic(s.orderId)){let o=Date.now()-Number(s.storedAt);if(o>=0&&o<=144e5){if(s.eventKey&&s.eventKey!==n)return null;i=s.orderId}}}window.sessionStorage.removeItem(Zo)}catch{}e.delete("seatlayer_checkout");try{let r=e.toString();history.replaceState(history.state,"",`${location.pathname}${r?`?${r}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:i}}function ea(n){if(!n.framed)return null;let e=n.ancestorOrigins?.length?n.ancestorOrigins[0]:null;for(let t of[e,n.referrer])if(t)try{return new URL(t).origin}catch{}return null}var Oc="https://api.seatlayer.io",_c=10,ta=6e4,ia=6e4,Dc=10,Nc=40,Bc=220,ra="seatmap.a11y.cb";function $c(){try{if(typeof window>"u")return null;let n=window.localStorage.getItem(ra);return n==null?null:n==="1"}catch{return null}}function Fc(n){try{window.localStorage.setItem(ra,n?"1":"0")}catch{}}var ze=class n{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.holdConflicted=!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.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedReport=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.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 Wi({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.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=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 en({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.fitScheduled=!1;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=Xo(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??Oc).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},i=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?bi({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:i?.access??gt(e,t),this.pubApi=e.transport?null:i?.api??new De(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 yt(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 r=e.numberOfPlacesToSelect;if(r!=null&&(!Number.isInteger(r)||r<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=r??null;let s=_o(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(_c,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=$c()??!!e.colorblindSafe,this.controller=this.wireController(e)}get confirmEl(){return this.confirmCard.element}set confirmEl(e){this.confirmCard.element=e}get confirmSeat(){return this.confirmCard.candidate}set confirmSeat(e){this.confirmCard.candidate=e}get lastSection(){return this.sectionCard.summary}set lastSection(e){this.sectionCard.adopt(e)}deliverableViewReference(e){return St(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=ea({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){wt();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let r=document.createElement("div");r.className="sl-modal-frame",r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"),r.setAttribute("aria-label",v("picker.seatSelection","Seat selection")),r.tabIndex=-1,i.appendChild(r),document.body.appendChild(i);let s=document.body.style.overflow;document.body.style.overflow="hidden";let o=new n({...e,container:r});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 g=[...r.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(m=>m.isConnected&&!m.closest('[hidden], [aria-hidden="true"], [inert]'));return g[g.length-1]??r},c=(g,m)=>{let y=g;for(;y;){let S=window.getComputedStyle(y);if(y.hidden||y.getAttribute("aria-hidden")==="true"||y.hasAttribute("inert")||S.display==="none"||S.visibility==="hidden"||S.visibility==="collapse")return!0;if(y===m)return!1;y=y.parentElement}return!0},d=g=>[...g.querySelectorAll(a)].filter(m=>m.tabIndex>=0&&!m.matches(":disabled")&&!c(m,g)),p=(g,m)=>{let y=d(g),S=m?y[y.length-1]:y[0];S?S.focus({preventScroll:!0}):(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus({preventScroll:!0}))},u=!1,h=()=>{if(u)return;u=!0,document.body.style.overflow=s,o.escHandler&&document.removeEventListener("keydown",o.escHandler),i.remove(),o.modalScrim=null;let g=o.prevFocus;o.prevFocus=null,g?.isConnected&&g.focus({preventScroll:!0});let m=()=>{o.destroy(),e.onClose?.()};o.hold&&!o.handedOff?o.release().finally(m):m()};return o.closeModal=h,i.addEventListener("mousedown",g=>{g.target===i&&h()}),o.escHandler=g=>{if(g.key==="Tab"){if(g.defaultPrevented)return;let m=l(),y=d(m),S=y[0],w=y[y.length-1],T=document.activeElement;!S||!w?(g.preventDefault(),p(m,g.shiftKey)):T===m||!T||!m.contains(T)?(g.preventDefault(),(g.shiftKey?w:S).focus({preventScroll:!0})):g.shiftKey&&T===S?(g.preventDefault(),w.focus({preventScroll:!0})):!g.shiftKey&&T===w&&(g.preventDefault(),S.focus({preventScroll:!0}));return}g.key==="Escape"&&(o.tableDialog?(g.preventDefault(),o.cancelTableDialog()):o.confirmSeat?(g.preventDefault(),o.cancelConfirm()):o.bestAvailableConfirm?(g.preventDefault(),o.bestAvailableConfirm=!1,o.syncTray()):(g.preventDefault(),h()))},document.addEventListener("keydown",o.escHandler),await o.render(),o.els.close?.classList.add("on"),o.els.close?.addEventListener("click",h),p(l(),!1),o}wireController(e){return new M.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:dt(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let i=this.controller.getGAAreas().find(r=>r.id===t);i&&(this.collapseSheet(),gn(this,i,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),xs(t)&&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.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.lapse.deferExpiryToast(()=>this.toast((0,M.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=>{if(this.controller.currentHold()?.labels.includes(t.label)){this.removeHeldLabels([t.label]);return}this.confirmSeat?.id===t.id&&this.dismissConfirm(),this.tableDialog?.physicalSeatIds.includes(t.id)&&this.dismissTableDialog()},onSelectionLimit:()=>{this.toast((0,M.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=C=>Math.round((performance.now()-C)*100)/100;this.rendered=!0,wt();let r=performance.now(),s=mi(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=Kr(this.opts.container),{root:c,els:d,mapHost:p}=mr(l,(C,O)=>this.tf(C,O),this.opts.theme);this.root=c,this.els=d,this.mapHost=p,fi(c,s,C=>{t.loadLocale=i(r),this.destroyed||this.applyActiveLocale(C,o)}),So(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 u=document.createElement("div");u.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(u),t.mountBuyerShell=i(a),t.skeletonPaint=i(e);let h=await this.loadChart(u,t,i);if(!h)return this;t.shellsPaint=i(e);let g=performance.now();if(this.startRealtime(),this.salesClosed=!!h.salesClosed||!!this.opts.readOnly,c.dataset.eventMode=h.mode==="test"?"test":"live",!this.opts.locale&&h.locale&&this.setLocale(h.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),h.mode==="test"){let C=document.createElement("div");C.className="sl-testbadge",C.textContent=Ur((0,M.t)("picker.testMode"),(0,M.getLocale)()),C.setAttribute("aria-label",(0,M.t)("picker.testMode")),C.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"),this.regions["top-left"].appendChild(C)}let m=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(c),this.watchThemeMode(),this.currency=h.currency??this.opts.currency??"USD",this.eventTimezone=h.timezone??null,Wr(this.els.logo,[this.opts.theme?.logoUrl,m?.logoUrl,h.posterUrl],this.opts.theme?.brandName??m?.brandName??h.eventName??"?"),this.els.name.textContent=h.eventName??"";let y=h.startsAt?Ei(h.startsAt,h.timezone??null,this.opts.locale):"";this.eventWhenText=y||null,this.els.meta.textContent=[h.venue,y].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(m);let S=!!this.controller.doc&&this.controller.getExpandedSeats().some(C=>C.commercial?.restrictedView||C.commercial?.obstructedView);this.buildAccessibilityMenu(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(g);let w=performance.now();if(await this.restoreRememberedHold(),t.restoreHold=i(w),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let T=this.controller.doc,b=Ii(this.opts.event),E=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),x=E??"event",L={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:x,surface:E==="season"?"season_picker":E==="performance_group"?"performance_group_picker":"seat_picker",ms:i(e),performanceProfile:t,chartDelivery:h.chartDelivery,seatCount:this.allSeats().length,objectCount:T?.objects.length??0,sectionCount:T?.objects.filter(C=>C.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:T?.name,view:this.buyerView,load:b,transport:this.opts.transport?"custom":"pubapi"};Lo(L,(C,O)=>this.emitAnalytics(C,O));let I=h.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",Gn({...L,performanceProfile:{...L.performanceProfile,...I}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=h,await this.registerAgentTools(),this}registerAgentTools(){return Po(this)}webMcpHost(e){return jn(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=Yo(()=>{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 r=this.els.sheetToggle,s=c=>{e.dataset.sheet=c?"open":"peek",r?.setAttribute("aria-expanded",String(c)),r?.setAttribute("aria-label",c?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))};s(e.dataset.sheet==="open"),r?.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"||d.dataset.act==="find"?(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")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),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 r=this.root.getAttribute("data-prices-open")==="true";if(this.root.setAttribute("data-prices-open",String(!r)),this.els.pricesSec?.setAttribute("aria-expanded",String(!r)),!r&&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",r=>{r.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||r.target.closest("select,button")||(r.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",r=>{this.handleMapPointerDown(r)},!0),this.els.map.addEventListener("mousemove",r=>{if(this.tipPinned)return;let s=this.els.map.getBoundingClientRect();this.tipPos={x:r.clientX-s.left,y:r.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 r=e.clientHeight,s=i!==this.pickerLayoutSize.width||r!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:r},this.reportFramedHeight();let o=i<640?"narrow":"wide",a=r<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.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray()),s&&(this.minimap?.refreshMinimap(),this.fitSectionStripCount(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),t(),requestAnimationFrame(t)}async loadChart(e,t,i){let r=performance.now(),s=await this.controller.render(e);return t.loadChartAndStatuses=i(r),this.destroyed?null:s?(Object.assign(t,s.performanceProfile),s):(Me({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:Fe(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 n({...a,container:o}).render()}),null)}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=Jo(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 Ji(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(i,r)=>this.tf(i,r),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:i=>this.setColorblindSafe(i),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:i=>{this.limitedViewFilter=i,this.controller.setCommercialLimitedFilter(i),this.pushAvailabilityTo3d()},applyAccessibilityFilter:i=>this.applyAccessibilityFilter(i),focusSeatsForFilter:()=>this.focusSeatsForFilter(),stepToAccessibleSection:i=>this.controller.focusNextAccessibleSection?.([i])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast((0,M.t)("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,i=this.els.headInfo?.parentElement;t&&i&&t.parentElement!==i&&(t.classList.add("sl-fs-pill"),i.insertBefore(t,this.els.hold??null));let r=this.els.pricesSec;r&&(e?(r.setAttribute("role","button"),r.tabIndex=0,r.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(r.removeAttribute("role"),r.removeAttribute("aria-expanded"),r.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><ul class="sl-booked-list" data-ref="bookedList"></ul><button type="button" class="sl-booked-back" data-ref="bookedBack"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${_(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}tf(e,t){return v(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),i=document.createElement("div");i.className="sl-soldout-eyebrow",i.textContent=t;let r=document.createElement("div");r.className="sl-soldout-title",r.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,r,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,r=this.isSoldOut(e,t,i);r!==this.soldOut&&(this.soldOut=r,this.soldoutEl?.classList.toggle("on",r))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(r=>(t[r.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 r=document.createElement("span");r.className="sl-powered-mark",r.setAttribute("aria-hidden","true"),r.innerHTML=ki;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),i.append(r,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){let t=this.reducedMotion(),i=(e.items??[]).filter(r=>r.objectType!=="ga").slice(0,10).map(r=>this.controller.seatByLabel(r.label)).filter(r=>!!r);ns({regions:this.els,categories:this.controller.doc?.categories,pop:r=>this.controller.flashSeat(r,this.cssVar("--sl-accent")||"#f4b740"),focus:(r,s)=>this.controller.focusSection(r,s),focusSeats:r=>this.controller.focusSeats?.(r,{animate:!t})===!0,reducedMotion:t,screenPoint:r=>this.controller.worldToScreen(r),schedule:(r,s)=>this.scheduleMotion(r,s)},i)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(i=>i.id!==e&&i.id!==t)}pendingSelectionCount(){let e=this.hold?.items??[],t=new Set(e.map(r=>r.label));return this.committedSelection().filter(r=>!t.has(r.label)).reduce((r,s)=>r+(s.quantity??1),0)+Ye(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,r)=>i+(r.quantity??1),0);return this.heldTicketCount()+t+Ye(this.gaQty,this.hold?.items??[])}updateSelectionCapacity(){let e=new Set((this.hold?.items??[]).map(r=>r.label)),t=this.committedSelection().filter(r=>e.has(r.label)).reduce((r,s)=>r+(s.quantity??1),0),i=Math.max(0,this.maxTickets-this.heldTicketCount()-Ye(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 r=!this.hold&&this.performanceGroup?.selectionMode==="per_performance"?this.performanceGroup.submissionState?.():null;if(r&&!r.ready){i.disabled=!0,i.textContent=this.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(r.complete)).replace("{total}",String(r.total));return}let s=this.controller.getSelectionValidity(e);if(s&&!s.isValid){i.disabled=!0,i.textContent=Kn(s,(o,a)=>this.tf(o,a),!0);return}i.disabled=e===0,i.textContent=this.hold?t?(0,M.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())}async runCheckoutHandoff(e,t){this.setCtaPhase("checkout");try{await this.checkoutHandoff(e,t)}finally{this.ctaPhase==="checkout"&&!this.bookedShown&&this.setCtaPhase("idle")}}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 r={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return this.hold=r,this.handedOff=!0,this.bookedShown=!1,this.ctaPhase="idle",this.startHoldTimer(r.expiresAt),this.rememberHold(r),this.syncTray(),this.emitHoldChange(),this.opts.onHoldRestored?.(r,r.seats??[],this.buildHandoff(r)),t&&this.toast(this.tf("picker.heldTicketsRestored","Your held tickets have been restored."),"success"),r}catch(i){let r=i?.status;return r===404||r===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(r=>r.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=go({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return Qi(this,e)}catPriceRange(e){return Xi(this,e)}buildPriceFilter(){if(this.suppressPricing||!this.els.prices||!this.els.pricesSec)return;let e=ms(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 r of e){let s=document.createElement("option");s.value=r.id,s.textContent=r.label,t.appendChild(s)}this.els.pricesSec.appendChild(t),this.priceSelect=t,t.addEventListener("change",()=>{this.applyPriceBand(e.find(r=>r.id===t.value)?.keys??null)})}applyPriceBand(e){if(this.focusedCatKey=null,this.priceBandKeys=e?new Set(e):null,this.priceSelect){let t=e?this.priceSelect.value:"all";this.priceSelect.value!==t&&(this.priceSelect.value=t)}this.controller.setCategoryFilter(e),this.controller.focusCategoryFilter(e),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(r=>r.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(r=>{if(r.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])r.addEventListener(s,Ti,{once:!0});r.addEventListener("click",()=>{this.setBuyerView(r.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)],r=new Set((e.zones??[]).map(d=>d.id)),o=i.some(d=>d.type==="section"&&typeof d.zone=="string"&&r.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,M.t)("picker.zoomLevel"));let l={zones:(0,M.t)("picker.rungLabel.zones"),sections:(0,M.t)("picker.rungLabel.sections"),seats:(0,M.t)("picker.rungLabel.seats")},c={zones:(0,M.t)("picker.rungTip.zones"),sections:(0,M.t)("picker.rungTip.sections"),seats:(0,M.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 p=d.dataset.rung;this.controller.setRung(p),p==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(a),this.rungsEl=a,this.syncRung()}if(this.controller.isMultiFloor()){let i=Vs({floors:this.controller.getFloors(),tf:(r,s)=>this.tf(r,s),onChoose:r=>{r===""?this.controller.setFloorOverview(!0):this.controller.setFloor(r),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 r=i.dataset.rung===e;i.classList.toggle("on",r),i.setAttribute("aria-pressed",String(r))})}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||!Si()?!1:this.allSeats().length<=this.max3dSeats()}max3dSeats(){let e=this.opts.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?ia/2:ia}syncFloors(){zs(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new zi({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}fitSectionStripCount(){this.sectionCard.fitStripCount()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(r=>r.type==="section"&&!this.controller.isSectionClosed(r.id)&&this.controller.getSectionSeatCount(r.id)>0);if(t.length<2)return null;let i=t.findIndex(r=>r.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}markedSeatAnnouncement(e){let t=Nn(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return Zs(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(h=>h.key===e.categoryKey),r=this.controller.getStatus(e.id)??"free",s=r==="free"?this.tf("picker.statusAvailable","available"):r==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),o=i?this.catPriceRange(i):void 0,a=!this.suppressPricing&&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=Xe(c),p=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,u=l?`${d} ${p}, ${l.bookingMode==="variable"?(0,M.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,M.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${p}`:c?.objectType==="table"?`${d} ${p}, ${(0,M.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,M.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${u}, ${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 r=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=Bs(e,{variable:s,held:t,typeWord:Xe(e),categoryLabel:r?.label??e.categoryKey,suppressPricing:this.suppressPricing,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 r=t.querySelector("input[data-table-qty]");r&&(r.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 r=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!r){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},this.startHoldTimer(r.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,M.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(r){this.opts.onError?.(r),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){i&&(i.disabled=!1,i.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new Ui({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,i,r)=>this.paidPrice(e,t,i,r),suppressPricing:()=>this.suppressPricing,reducedMotion:()=>this.reducedMotion(),scheduleMotion:(e,t)=>this.scheduleMotion(e,t),canOffer3d:()=>this.canOffer3d(),buyerView:()=>this.buyerView,view3dHandle:()=>this.view3dHandle,view3dCompareSeatIds:()=>this.view3dCompareSeatIds,rememberView3dReturnSeat:e=>{this.view3dReturnSeat=e},enter3d:e=>{this.enter3d(e)},performanceGroup:()=>this.performanceGroup,seatViewEnabled:()=>this.seatViewEnabled(),openSeatView:e=>{this.openSeatView(e)},openSeatConfidencePassport:(e,t)=>this.openSeatConfidencePassport(e,t),saveView3dComparisonSeat:e=>this.saveView3dComparisonSeat(e),resolveAssetUrl:e=>this.buyerAssetUrls.resolve(e),onError:e=>this.opts.onError?.(e),liftToastOverConfirm:()=>this.liftToastOverConfirm(),fitTranslatedRows:()=>this.fitTranslatedRows(),syncTray:()=>this.syncTray(),syncSelectionTo3d:()=>this.syncSelectionTo3d(),collapseSectionCard:()=>this.collapseSectionCard(),applyPanelCollapsed:()=>this.applyPanelCollapsed(),dismiss:()=>this.dismissConfirm(),reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e)})),this.confirmCardCache}showConfirm(e){this.confirmCard.show(e)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){uo(e,t,this.reducedMotion())}addSeatLabel(e){return mo(e,(t,i)=>this.tf(t,i))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,i=this.controller.doc,r=this.controller.getActiveFloorId(),s=e.focalPoint??i?.floors?.find(p=>p.id===r)?.focalPoint??i?.focalPoint??{x:0,y:0},o,a,l=!1;if(e.viewUrl){let p,u=null;try{let g=e.viewMeta?.previewUrl;g&&g!==e.viewUrl?(u=await this.buyerAssetUrls.resolve(g),p=e.viewUrl):p=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(g){t===this.seatViewGen&&this.opts.onError?.(g);return}if(t!==this.seatViewGen||!p||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!u||!this.root||!this.seatViewEnabled())return;let h={url:p,...u?{previewUrl:u}:{},...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=h,a=(0,ii.seatViewDisclosure)(h),l=(0,ii.isAuthoredSeatView)(h)}else{let p;try{let{generateSeatPanorama:u}=await Ci();p=u(e,s,this.allSeats())}catch(u){t===this.seatViewGen&&this.opts.onError?.(u);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;o={url:p.url,generated:!0},a=(0,M.t)("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=(0,M.t)("picker.viewFromSeat",{label:e.label}),d=Li({root:this.root,source:o,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:kt(),viewFromSeatLabel:c,real360Label:(0,M.t)("picker.real360"),previewLabel:(0,M.t)("picker.preview"),resolveAsset:p=>this.buyerAssetUrls.resolve(p),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,M.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(r,s)=>`${r} ${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=ks(e,t);if(i==null)return;let r=6*36e5,s=Math.min(Math.max(i-t+1e3,1e3),r);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 r=Vi(i),s={...this.hostPricing?.prices??{},...r},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;if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,i=t?.release??null,r=i?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!r){e.classList.remove("has"),e.replaceChildren();return}let s=i??r,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 p=[];i&&t.fromPrice!=null&&p.push(this.money(t.fromPrice/100)),i&&s.remaining!=null&&p.push((0,M.t)("picker.offerRemainingAvailable",{count:s.remaining})),i&&s.endsAt!=null&&p.push((0,M.t)("picker.offerUntil",{time:Ei(s.endsAt,this.eventTimezone,this.opts.locale)})),r?.startsAt!=null&&p.push((0,M.t)("picker.offerStarts",{time:Ei(r.startsAt,this.eventTimezone,this.opts.locale)})),d.textContent=p.join(" \xB7 "),a.append(l,c,d);let u=document.createElement("details");u.className="sl-offer-info";let h=document.createElement("summary");h.setAttribute("aria-label",(0,M.t)("picker.howOfferWorks",{name:c.textContent??""})),h.textContent="i";let g=document.createElement("div");g.className="sl-offer-detail",g.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."),u.append(h,g),o.append(a,u),e.replaceChildren(o),e.classList.add("has")}paidPrice(e,t,i,r){let s=r?this.channelByObject.get(r):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:_}}syncPriceRail(e,t,i=this.legendDeps()){let r=this.els.railScroll,s=e.length>1;if(this.els.rail?.classList.toggle("has",s),!r)return;r.innerHTML=s?us({...i,categories:e,left:t,activeKey:this.focusedCatKey,soldOutWord:this.tf("picker.soldOut","Sold out"),allWord:this.tf("picker.allPrices","All prices"),allActive:!this.focusedCatKey&&!this.priceBandKeys}):"";let o=e.map(a=>a.key).join("|");this.lastRailSignature!==o&&(this.lastRailSignature=o,r.scrollLeft=0),r.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){this.applyPriceBand(null);return}this.focusCategory(a.dataset.cat??"")})}),this.railEdgesBound||(this.railEdgesBound=!0,r.addEventListener("scroll",()=>Pn(r),{passive:!0})),requestAnimationFrame(()=>Pn(r))}syncPrices(){let e=this.controller.doc;if(!e||!this.els.prices)return;let t=this.controller.categoryAvailability(),i=e.categories.filter(p=>!p.notForSale);this.narrateAvailability(i,t),this.syncSoldout(i,t);let r=this.legendDeps(),s=this.suppressPricing,o=s?{...r,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:r;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=hs({...o,categories:d,left:t,collapsed:c,activeKey:this.focusedCatKey,bandKeys:this.priceBandKeys,leftCount:p=>(0,M.tCount)("picker.leftCount",p),titleFor:(p,u)=>u?this.tf("picker.showAllSeats","Show all seats"):(0,M.t)("picker.showLabelSeatsOnMap",{label:p.label}),moreLabel:l>1?c?s?this.tf("picker.showAllCategories","Show all categories"):(0,M.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(p=>{p.addEventListener("mouseenter",()=>this.controller.getRenderer()?.setCategoryHighlight?.(p.dataset.cat??null)),p.addEventListener("mouseleave",()=>this.controller.getRenderer()?.setCategoryHighlight?.(null));let u=()=>this.focusCategory(p.dataset.cat??"");p.addEventListener("click",u),p.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),u())})}),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,r=this.lastCatAvail;this.lastCatAvail={...t};let s=this.controller.getActiveFloorId();if(s!==this.lastAvailFloorId&&(this.lastAvailFloorId=s,this.availQuietUntil=performance.now()+2e3),!(!i||!r||performance.now()<this.availQuietUntil))for(let o of e){let a=r[o.key],l=t[o.key]??0;if(a===void 0||l>=a)continue;let c=a-l;i.textContent=(0,M.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,M.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:i,heldLabels:r,heldCount:s,total:o,count:a}=Yi(this),l=[],c=new Set;if(!this.salesClosed){let b=this.performanceGroup?.nightSummary?.()??[];b.length&&l.push(Us(b,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let E=this.performanceGroup?.selectionModeSwitch;E&&l.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${_(E.label)}</button>`)}l.push(Fo({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(b=>b.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0}));let d=!e.length&&!i.length&&!Ye(this.gaQty,this.hold?.items??[]);if((d||this.root?.dataset.layout==="narrow")&&(this.baReopen=!1),!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm)){let b=(this.controller.doc?.categories??[]).filter(x=>!x.notForSale),E=this.controller.getBestAvailableZones();this.baZone&&!E.some(x=>x.id===this.baZone)&&(this.baZone=""),l.push($o({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:this.baReopen,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:b,zones:E,selectedCategory:this.baCat,selectedZone:this.baZone}))}let p=(b,E,x,L=1,I,C,O)=>Do({categoryLabel:O,d:b?this.controller.seatDetails(b):null,area:x==="ga"?t.find(N=>N.id===I):void 0,label:E,objectType:x,quantity:L,identity:C,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),u=_,h=[];for(let b of Ar(i)){let E=b.objectType==="ga"?`held:ga:${b.objectId}:${b.tierId??""}`:`held:${b.label}`;c.add(E);let x=this.controller.doc?.categories.find(U=>U.key===b.categoryKey),L=b.tierId?x?.tiers?.find(U=>U.id===b.tierId)?.name:void 0,I=b.objectType!=="ga"?this.controller.seatByLabel(b.label):null,C=b.objectType==="table"?this.controller.tableSelection(b.label):null,O=I?this.controller.seatDetails(I.id):null,N=this.seatViewEnabled()&&!!I&&b.objectType!=="table"&&!!this.deliverableViewReference(I),z=u(this.tf("picker.heldForYou","Held for you")),Q=(C?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(b.label))}">${u((0,M.t)("picker.guestsCountEdit",{count:b.quantity??1}))}</button>`:"")+Xt(I?.wheelchairSpaceType)+Rn(I?.commercial),J=this.paidPrice(b.categoryKey,b.tierId,b.unitPrice,b.label)*(b.quantity??1);h.push({key:E,fresh:!this.lastTrayKeys.has(E),held:!0,seatIds:[],heldLabels:b.labels,removeAria:(0,M.t)("picker.removeHeldTicketLabel",{label:fn(b,t)}),locateId:I?.id??null,section:O?.sectionLabel??"",rowLabel:O&&ee(O)||"",seatLabel:O?.seatNumber??b.label,categoryLabel:`${x?.label??b.categoryKey}${L?` \xB7 ${L}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(b.categoryKey)??x?.color??"",identityHtml:p(I?.id??null,b.label,b.objectType,b.quantity??1,b.objectId,C??void 0,`${x?.label??b.categoryKey}${L?` \xB7 ${L}`:""}`),stateHtml:`<span class="sl-ticket-state held" aria-label="${z}" title="${z}"><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:Q,amount:J,amountText:this.suppressPricing?"":this.money(J),noteHtml:In(I?.commercial),railHtml:this.performanceGroup?"":Wn((0,M.t)("picker.removeHeldTicketLabel",{label:fn(b,t)}),N?b.label:null),groupable:!Q&&!!O?.sectionLabel&&!this.performanceGroup})}let g=this.seatViewEnabled();for(let b of e.filter(E=>!r.has(E.label))){let E=`seat:${b.id}`;c.add(E);let x=this.controller.doc?.categories.find(U=>U.key===b.categoryKey),L=b.tiers&&b.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${u(b.id)}" aria-label="${u((0,M.t)("picker.ticketTierFor",{label:b.label}))}">`+b.tiers.map(U=>`<option value="${u(U.id)}"${U.id===b.tierId?" selected":""}>${u(U.name)} \xB7 ${u(this.money(this.paidPrice(b.categoryKey,U.id,U.price,b.label)))}</option>`).join("")+"</select>":"",I=b.tiers?.find(U=>U.id===b.tierId)??b.tiers?.[0],C=I?.buyerMessage?.trim()||(I?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),O=this.controller.seatDetails(b.id),N=u(this.tf("picker.selected","Selected")),z=(0,M.t)("picker.removeSeatLabel",{label:b.label}),Q=(b.objectType==="table"&&b.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(b.label))}">${u((0,M.t)("picker.guestsCountEdit",{count:b.quantity??1}))}</button>`:"")+Xt(b.wheelchairSpaceType)+Rn(b.commercial)+L,J=this.paidPrice(b.categoryKey,b.tierId??null,b.price,b.label)*(b.quantity??1);h.push({key:E,fresh:!this.lastTrayKeys.has(E),held:!1,seatIds:[b.id],heldLabels:[],locateId:b.id,section:O?.sectionLabel??"",rowLabel:O&&ee(O)||"",seatLabel:O?.seatNumber??b.label,categoryLabel:x?.label??b.categoryKey,identityHtml:p(b.id,b.label,b.objectType,b.quantity??1,b.objectId,b,x?.label??b.categoryKey),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(b.categoryKey)??x?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${N}" title="${N}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:Q,amount:J,amountText:this.suppressPricing?"":this.money(J),removeAria:z,noteHtml:In(b.commercial)+(C?`<small class="sl-tier-note">${u(C)}</small>`:""),railHtml:Wn(z,g&&b.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(b.label)??{})?b.label:null),groupable:!Q&&!C&&!!O?.sectionLabel&&!this.performanceGroup})}h.length&&l.push(this.root?.dataset.layout==="narrow"?Uo(h,{money:b=>this.money(b),suppressPricing:this.suppressPricing}):h.map(qo).join("")),t.length&&l.push(Rr(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>${u(this.tf("picker.findTogetherInstead","Find seats together instead"))}</button>`),this.els.tray.innerHTML=l.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=c,Ko(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&&no(this.els.tray,b=>m(b)),this.els.tray.querySelectorAll("[data-ba]").forEach(b=>{b.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(b.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",b=>{this.baCat=b.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",b=>{this.baZone=b.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(b=>{b.addEventListener("click",()=>{let E=b.closest(".sl-chip");if(E.dataset.held){this.removeHeldLabels(decodeURIComponent(E.dataset.held).split(`
2807
- `),E);return}let x=E.dataset.seat.split(" "),L=this.controller.getSelection().find(C=>C.id===x[0])?.label??this.tf("picker.seat","Seat"),I=()=>{this.controller.deselect(x),this.toast((0,M.t)("picker.labelRemoved",{label:L}),"neutral",{label:this.tf("picker.undo","Undo"),onClick:()=>{let C=this.controller.select(x);this.toast(C.length?(0,M.t)("picker.labelRestored",{label:L}):(0,M.t)("picker.labelNoLongerAvailable",{label:L}),C.length?"success":"warning")}})};if(this.reducedMotion()){I();return}E.classList.remove("sl-enter"),E.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(I,X.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(b=>{b.addEventListener("click",E=>{E.stopPropagation();let x=decodeURIComponent(b.dataset.tableEdit??""),L=this.controller.tableSelection(x);if(!L)return;let I=i.find(C=>C.label===x&&C.objectType==="table");this.showTableDialog({...L,quantity:I?.quantity??L.quantity},!!I,b)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(b=>{b.addEventListener("change",()=>this.controller.setSeatTier(b.dataset.tier,b.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(b=>{b.addEventListener("click",()=>{let E=this.controller.seatByLabel(b.dataset.viewLabel);E&&this.openSeatView(E)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(b=>{let E=()=>this.controller.flashSeat(b.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");b.addEventListener("mouseenter",E),b.addEventListener("focusin",E)}),Ir(this,this.els.tray,t),this.controller.setGASelection(Tr(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(b=>{b.disabled=!0});let y=this.pendingSelectionCount(),S=this.lastTrayCount,w=this.lastTrayTotal,T=io(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");if(this.els.count.textContent=T||(a?(0,M.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=T||(a?(0,M.tCount)("picker.seatsSelectedCount",a):"")),this.syncCta(a,y),this.hold){this.holdCopyPending=y>0;let b=Vo({secured:s||this.hold.seats?.length||0,pendingCount:y,expiresAt:this.holdExpiresAt,releasing:this.releasingHold});this.els.holdTitle&&(this.els.holdTitle.textContent=b.title),this.els.holdCopy&&(this.els.holdCopy.textContent=b.copy);let E=this.els.holdChange;E&&(E.disabled=this.releasingHold,E.textContent=b.change)}a!==S&&this.animateOnce(this.els.count,"sl-value-pop",380),o!==w&&this.animateOnce(this.els.total,"sl-value-pop",380),S===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,y,a>S),this.lastTrayCount=a,this.lastTrayTotal=o,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(a,e),this.scheduleFit()}scheduleFit(){if(this.fitScheduled||this.destroyed)return;this.fitScheduled=!0;let e=()=>{this.fitScheduled=!1,this.destroyed||this.fitTranslatedRows()};typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}fitTranslatedRows(){bs(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(vs),this.els.tray?.querySelectorAll(".sl-ba-go,.sl-ba-reopen").forEach(Mn),this.els.peek?.querySelectorAll(".sl-sheet-go").forEach(Mn)}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,r=!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=Bo({count:e,total:t,pendingCount:i,ctaPhase:this.ctaPhase,hasHold:!!this.hold,salesClosed:this.salesClosed,suppressPricing:this.suppressPricing,fromPrice:s.length?Math.min(...s):null,addMore:this.root?.dataset.layout==="narrow"?null:No({salesClosed:this.salesClosed,hasHold:!!this.hold,ctaPhase:this.ctaPhase,formOpen:this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm,room:this.maxTickets-this.totalTicketCount(),wanted:this.baQty}),offerFind:!this.performanceGroup&&!this.salesClosed&&!this.hold,holdTime:this.hold&&this.holdTimer?ti(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"))),r&&this.animateOnce(this.els.peek.querySelector(".sl-peek-sum")??void 0,"sl-peek-bump",240),this.scheduleFit()}async removeHeldLabels(e,t){let i=e.filter(o=>o&&!this.releasingLabels.has(o));if(!i.length)return!1;let r=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,M.t)("picker.couldNotRemoveLabel",{label:r}),"error"),!1;Pr(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,M.t)("picker.labelRemovedFromHold",{label:r}),"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(Kn(e,(i,r)=>this.tf(i,r)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast((0,M.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(i=>!(this.hold.items??[]).some(r=>r.label===i.label))){let i=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,i);return}this.holdingLabels=new Set(t.map(i=>i.label)),this.setCtaPhase("holding");try{let i=null,r=Sr(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 r){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.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=i,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(i.expiresAt),this.flashHeldSeats(i),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(i,i.seats??s)}catch(i){this.opts.onError?.(i);let r=i,s=(r.conflicts??[]).map(a=>a.label).filter(Boolean).slice(0,3);r.reason==="event_closed"&&this.setSalesClosed(!0);let o=r.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):r.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):r.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s.length?s.length===1?(0,M.t)("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):(0,M.t)("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(o),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 r=()=>{let s=Math.max(0,this.holdExpiresAt-Date.now());i&&(i.textContent=ti(s));let o=this.els.peek?.querySelector(".sl-peek-time");o&&(o.textContent=ti(s)),!this.holdCopyPending&&this.els.holdCopy&&this.root?.dataset.layout!=="narrow"&&(this.els.holdCopy.textContent=Yn(this.holdExpiresAt)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=ta),this.setExtendPrompt(s>0&&s<=ta,s),(s<=0||!this.controller.currentHold())&&this.stopHoldTimer()};this.holdTimer=setInterval(r,500),r()}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),r=Math.floor(i/60),s=String(i%60).padStart(2,"0");this.els.extendTxt.innerHTML=(0,M.t)("picker.seatsHeldForNeedMoreTime",{time:`${r}:${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.holdConflicted||this.showBooked())}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((r,s)=>r+s.quantity,0),i=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=i?.seats?`<span class="sl-booked-seats">${(0,M.tCount)("picker.group.ticketsConfirmedAcross",i.seats,{performances:i.performances})}</span>`:`<span class="sl-booked-seats">${(0,M.tCount)("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.els.bookedList&&(this.els.bookedList.innerHTML=e.lineItems.map(r=>{let o=[r.sectionLabel,r.rowLabel&&`${this.tf("picker.row","Row")} ${r.rowLabel}`,r.seatNumber&&`${this.tf("picker.seat","Seat")} ${r.seatNumber}`].filter(Boolean).join(" \xB7 ")||r.displayLabel||r.label,a=r.quantity>1?` <span class="sl-booked-qty">\xD7${r.quantity}</span>`:"";return`<li>${_(o)}${a}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0),this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.root?.focus({preventScroll:!0})}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let i=this.buildHandoff(e),r=null;try{r=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(o){this.opts.onError?.(o)}if(this.destroyed)return;let s=r?.providers?.[0];if(!s){let o=Qr(r?.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 Yr())}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}}),r=i[0]?.currency??this.currency,s=i.reduce((o,a)=>o+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:r,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 r=this.els.toast;if(!r)return;r.replaceChildren();let s=document.createElement("span");if(s.textContent=e,r.appendChild(s),r.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}),r.appendChild(o)}r.dataset.tone=t,r.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{r.classList.remove("on","sl-mo-rise"),r.classList.remove("has-action"),r.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),i=this.confirmEl;if(!t||!i?.isConnected){e.style.removeProperty("bottom");return}let r=this.els.map.clientHeight;if(r<=0)return;let s=i.getBoundingClientRect(),o=s.height||i.offsetHeight||Bc,a=s.height?s.top-this.els.map.getBoundingClientRect().top:r-$n-o,l=Math.round(r-a+Dc);if(l+Nc>r){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){ko({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?ao(this.tipPos,e,t):null,r=i??oo(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${r.left}px`,this.tipEl.style.top=`${r.top}px`,i?this.tipEl.dataset.placement=i.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let i=this.performanceGroup,r=Nn(e.mark,i?.nights?.()),s=r?.states.filter(o=>o.free).length??0;return Ks(r,{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),r=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,r);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=so(e,{price:this.suppressPricing?"":this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label)),priceNote:this.suppressPricing?this.performanceGroup?.surface==="season"?this.tf("picker.season.includedInPackage","Included in the Season package"):this.tf("picker.group.pricesPerPerformance","Prices shown per performance"):"",rowTypeWord:Xe(e),reason:i,extra:s+(r?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${_(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=r,this.tipEl.classList.toggle("sl-tip-pinned",r),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()}),po(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[r,s]of Object.entries(e())){let o=this.controller.idForLabel(r);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(r=>t.has(r.id)||t.has(r.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=Bt(this.themeMode),i=$t(this.controller.doc?.theme,this.opts.theme,t);for(let[r,s]of Object.entries(i))e.style.setProperty(r,s);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=ui(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(dt(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:Bt(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Bt(this.themeMode),i=$t(this.controller.doc?.theme,this.opts.theme,t),r=dt(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,s=hr(i,r);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=gr(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=(0,M.getLocale)(),i=this.localeGeneration+=1,r=await(0,M.loadLocale)(e);return this.opts.messages&&(0,M.setStringOverrides)(this.opts.messages),r===t||this.applyActiveLocale(r,i),r}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(br(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}),this.scheduleFit())}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),this.minimap?.refreshMinimap(),Fc(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.controller.accessibilityFilterDims?.(e)||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,r=!!i&&i!==t.viewUrl,s=r?await this.buyerAssetUrls.resolve(i):null,o=r?t.viewUrl:await this.buyerAssetUrls.resolve(t.viewUrl);return!o||r&&!s?null:{url:o,...s?{previewUrl:s}:{},...r?{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 wo(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 r=this.view3dEl;if(!r)return;let s=this.controller.seatDetails(e.id),o=s?.displayLabel??e.displayLabel??e.label,a=ee(s);Oo(r,{status:i,visualState:t,location:[s?.sectionLabel,a?(0,M.t)("picker.rowLabel",{label:a}):null,o].filter(Boolean).join(" \xB7 ")||o,tf:(l,c)=>this.tf(l,c)}),this.announceSeat(e)}dismissUnavailable3dSeat(){Un(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(h=>h.id===e);if(!t)return null;let i=this.controller.seatDetails(t.id),r=this.controller.doc?.categories.find(h=>h.key===t.categoryKey),s=i?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),o=s!=null?this.paidPrice(t.categoryKey,i?.tierId??r?.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,ii.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=He(t.commercial)||this.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),p=i?.wheelchairSpaceType?`${Tt(i.wheelchairSpaceType)} \xB7 metadata, not access certification`:this.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),u=(0,na.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:ee(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??r?.label??t.categoryKey,price:this.suppressPricing||o==null?"":this.money(o),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:p,confidence:u}}openSeatConfidencePassport(e,t=null){qn(this,e,t)}closeSeatConfidencePassport(e=!0){Jt(this,e)}openView3dComparison(){Io(this)}closeView3dComparison(e=!0){Je(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 r=document.createElement("button");r.type="button",r.className="sl-view3d-back",r.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=r.querySelector("span"),o=c=>{this.view3dTargetSeatId=c;let d=!!c;i.classList.toggle("is-seat-focused",d),this.root&&(this.root.dataset.view3dSeat=d?"on":"off");let p=d?this.tf("picker.backToVenue","Back to venue"):this.tf("picker.backToMap","Back to map");s&&(s.textContent=p),r.setAttribute("aria-label",p)};if(r.addEventListener("click",()=>{if(this.view3dTargetSeatId&&this.view3dHandle){this.view3dHandle.focusOverview();return}this.exit3d()}),this.regions["top-left"]?.prepend(r),this.view3dBack=r,this.publish3dTopInset(),vo(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,p]=await Promise.all([Ut(),this.controller.loadEventConfiguration()]),u=p?await Ai(p,w=>this.buyerAssetUrls.resolve(w)):null,h=t.theme?.venue3d?.shellAssetUrl,g=await Pi(h,w=>this.buyerAssetUrls.resolve(w));if(l!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let m={doc:t,seats:c,...u?{eventConfigurationId:u.id,eventConfiguration:u}:{},...g?{registeredShellGlb:g}:{}};a.textContent=this.tf("picker.building3d","Building venue geometry\u2026");let y=await d.prepareVenue3D(m);if(l!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let S=d.mountVenue3D(i,{...m,prepared:y},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:kt(),seatViewActionLabel:w=>this.allSeats().find(T=>T.id===w)?.viewUrl?this.tf("picker.openAuthored360","Open venue 360\xB0"):this.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:w=>this.seatViewCaption(w),onSeatViewStopChange:w=>this.view3dSeatViewChrome?.onStopChange(w),onSeatPick:w=>this.onView3dSeatPick(w),onSeatInspect:w=>this.onView3dSeatPick(w),onSectionFocusChange:w=>{let T=i.querySelector('select[data-locator="section"]'),b=w??"";!T||T.value===b||(T.value=b,T.dispatchEvent(new Event("change")))},onViewTargetChange:w=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!w),o(w),this.opts.onBuyerViewChange?.({view:"venue3d",...w?{seatId:w}:{}})},...this.seatViewEnabled()?{getSeatView:w=>new Promise((T,b)=>{let E=()=>{this.seatViewFor3d(w).then(L=>{L?T(L):b(new Error("seat_view_unavailable"))})},x=globalThis.requestIdleCallback;typeof x=="function"?x(E,{timeout:1500}):setTimeout(E,50)})}:{},onAnalytics:(w,T)=>this.emit3dAnalytics(w,T)});this.view3dHandle=S,this.view3dSeatViewChrome=yo(i,{handle:()=>this.view3dHandle}),requestAnimationFrame(()=>a.remove()),this.pushAvailabilityTo3d(),this.syncSelectionTo3d(),this.view3dNav=bo(this.regions["bottom-left"]??i,S),e&&S.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()}}publish3dTopInset(){let e=this.regions["top-left"];if(!this.root||!e)return;let t=()=>{!this.root||this.root.dataset.view3d!=="on"||this.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}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,this.view3dBack?.remove(),this.view3dBack=null,this.view3dNav?.remove(),this.view3dNav=null,this.root?.removeAttribute("data-view3d-seat"),this.root?.style.removeProperty("--sl-3d-top-inset");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)));try{return await this.bestAvailableOrThrow(e,t,i)}catch(r){this.opts.onError?.(r);let s=r?.reason,o=s==="not_enough_together"?(0,M.t)("picker.couldNotFindSeatsTogether",{count:e}):s==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):s==="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(o,"error"),null}}async bestAvailableOrThrow(e,t,i={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let r=this.els.tray?.querySelector(".sl-ba-go");r&&(r.disabled=!0,r.classList.add("sl-busy"),r.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,M.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),i=!0;if(t)i=await this.controller.release();else if(e){let r=[...new Set([...(e.items??[]).map(s=>s.label),...(e.seats??[]).map(s=>s.label)])];if(r.length)try{await this.api.release(this.opts.event,r,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 ve({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:lt(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=$s(e.reason,()=>this.refreshAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}destroy(){this.destroyed=!0,zn(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),Le(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 je=require("@seatlayer/core");var sa="seatlayer-performance-group-picker-style";function oa(){if(document.getElementById(sa))return;let n=document.createElement("style");n.id=sa,n.textContent=`
2774
+ }`,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%)",r=document.createElement("div");Object.assign(r.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};r.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%"})),r.append(o),e.append(r);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=$l[t],r=document.createElement("div");Object.assign(r.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()),r.append(s,o,a),e.append(r)}};var M=require("@seatlayer/core"),ii=require("@seatlayer/core/view3d/crossfade/panorama"),oa=require("@seatlayer/core/core/seatConfidence");function cs(n){return n?.previousPrice!=null&&n.previousPrice>n.price?n.previousPrice:null}function ds(n){return Fl(n)+(n.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!n.collapsed}">${n.esc(n.moreLabel)}</button>`:"")+Vl(n.status)}function Fl(n){let{esc:e,money:t}=n;return n.categories.map(i=>{let r=n.priceOf(i),s=n.rangeOf(i),o=n.offerOf(i.key),a=cs(o),l=n.activeKey===i.key;return`<div class="sl-price-row${n.bandKeys!=null&&!n.bandKeys.has(i.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(i.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(n.titleFor(i,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(n.colorOf(i))}"></span><span class="sl-price-label">${e(i.label)}`+(o?.offerName?`<small class="sl-price-offer">${e(o.offerName)}</small>`:"")+`</span><span class="sl-price-left">${e(n.leftCount(n.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>`:r!=null?`<span class="sl-price-amt">${e(t(r))}</span>`:"")+"</div>"}).join("")}function Vl(n){let e=t=>t.replace(/[&<>"']/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[i]);return`<div class="sl-status-key" aria-label="${e(n.legend)}"><span class="sl-status-item"><i class="sl-status-icon 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(n.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(n.sold)}</span></div>`}function An(n){let e=Math.abs(n.scrollLeft),t=e>2,i=e+n.clientWidth<n.scrollWidth-2;return n.dataset.fadeStart=String(t),n.dataset.fadeEnd=String(i),{start:t,end:i}}function ps(n){let{esc:e,money:t}=n;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${n.allActive}" title="${e(n.allWord)}"><span class="sl-rc-t">${e(n.allWord)}</span></button>`+n.categories.map(r=>{let s=n.rangeOf(r),o=n.priceOf(r),a=s?s.min===s.max?t(s.min):`${t(s.min)}+`:o!=null?t(o):null,l=Object.prototype.hasOwnProperty.call(n.left,r.key)&&n.left[r.key]<=0,c=cs(n.offerOf(r.key)),d=a?`${r.label} \u2014 ${a}${l?` (${n.soldOutWord})`:""}`:r.label;return`<button type="button" class="sl-rc" data-cat="${e(r.key)}" aria-pressed="${n.activeKey===r.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(n.colorOf(r))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??r.label)}</span></button>`}).join("")}function hs(n,e){let t=n.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let i=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(i.length<=5)return i.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let r=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),s=Math.ceil(r.length/4),o=[];for(let a=0;a<r.length;a+=s){let l=r.slice(a,a+s),c=Math.min(...l.map(p=>p.range.min)),d=Math.max(...l.map(p=>p.range.max));o.push({id:`b${a}`,label:c===d?e.money(c):`${e.money(c)}\u2013${e.money(d)}`,keys:l.map(p=>p.key),min:c,max:d})}return o}function us(n){return!!n&&n.clientWidth>0&&n.scrollWidth>n.clientWidth+1}function zl(n){return n.some(e=>us(e))}var $i="data-fit-gone",jl=12;function Pn(n,e,t=us){if(!n)return 0;for(let i of e)n.classList.remove(i.cls);if(n.querySelectorAll(`[${$i}]`).forEach(i=>{i.removeAttribute($i),i.hidden=!1}),n.dataset.fit="0",n.clientWidth<=0||!t(n))return 0;for(let i=0;i<e.length;i+=1){let r=e[i];i>0&&n.classList.remove(e[i-1].cls),n.classList.add(r.cls),n.dataset.fit=String(i+1);let s=r.give?r.give(n):!0;if(!t(n))return i+1;if(r.repeat&&r.give){for(let o=1;s&&o<jl;o+=1)if(s=r.give(n),!t(n))return i+1}}return e.length}function Gl(n,e="[data-fit-seg]"){let t=[...n.querySelectorAll(e)].filter(i=>!i.hidden);return t.length<2?!1:ms(t[t.length-1])}function ql(n,e){let t=n.querySelector(e);return t&&!t.hidden?ms(t):!1}function ms(n){let e=n.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute($i,""),e.hidden=!0),n.setAttribute($i,""),n.hidden=!0,!0}function Ul(n){if(!n)return!1;let e=(n.getAttribute("aria-label")||n.textContent||"").trim();return e?(n.setAttribute("aria-label",e),n.setAttribute("title",e),!0):!1}function fs(n){if(!n)return 0;let e=n.querySelector(".sl-confirm-cancel"),t=n.querySelector(".sl-confirm-add-t");return Pn(n,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>Ul(e)}],()=>zl([e,t]))}function gs(n){return Pn(n,[{cls:"sl-fit-notype",give:e=>ql(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>Gl(e),repeat:!0}])}function Mn(n){return n?(n.classList.add("sl-fitpill"),Pn(n,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Kl=["on-sale","low","sold-out","presale","closed"];function Qt(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function vs(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function bs(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n,t=e.count,i=e.index;if(typeof i!="number"||!Number.isInteger(i)||i<1||typeof t!="number"||!Number.isInteger(t)||t<i)return;let r=e.remaining;if(r!=null&&(typeof r!="number"||!Number.isInteger(r)||r<0))return;let s={index:i,count:t,remaining:r??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=vs(e[o]);if(a===void 0)return;s[o]=a}return s}function Wl(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],i=new Set;for(let 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 p of a.priceOverrides){if(!p||typeof p!="object"||Array.isArray(p))return;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"",g=u.tierId===null?null:typeof u.tierId=="string"&&u.tierId.trim()?u.tierId.trim():void 0,f=Qt(u.price);if(!h||g===void 0||f===void 0||f===null)return;let x=`${h}\0${g??""}`;if(d.has(x))return;d.add(x),c.push({categoryKey:h,tierId:g,price:f})}i.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let r=[],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),r.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:r}}function Fi(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=Kl.find(d=>d===e.state);if(!t)return null;let i=Qt(e.fromPrice),r=Qt(e.previousPrice);if(i===void 0||r===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=bs(e.release);if(o===void 0)return null;let a=e.upcoming===void 0?null:bs(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 p of e.prices){if(!p||typeof p!="object"||Array.isArray(p))return null;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!h)return null;let g=Qt(u.price),f=Qt(u.previousPrice);if(g==null||f===void 0)return null;let x={categoryKey:h,price:g,previousPrice:f};if(u.offerId!==void 0){if(typeof u.offerId!="string"||!u.offerId.trim())return null;x.offerId=u.offerId.trim()}if(u.offerName!==void 0){if(typeof u.offerName!="string"||!u.offerName.trim())return null;x.offerName=u.offerName.trim()}if(u.remaining!==void 0){if(u.remaining!==null&&(typeof u.remaining!="number"||!Number.isInteger(u.remaining)||u.remaining<0))return null;x.remaining=u.remaining==null?null:u.remaining}for(let w of["startsAt","endsAt"]){if(u[w]===void 0)continue;let y=vs(u[w]);if(y===void 0)return null;x[w]=y}d.push(x)}l=d}let c=Wl(e.channelPricing);return c===void 0?null:{state:t,fromPrice:i,previousPrice:r,currency:s,release:o,upcoming:a,prices:l,channelPricing:c}}function ys(n){return n?.changed!==!1}function ws(n,e){if(!n)return null;let t=null,i=r=>{r!=null&&r>e&&(t===null||r<t)&&(t=r)};for(let r of[n.release,n.upcoming])i(r?.startsAt),i(r?.endsAt);for(let r of n.prices)i(r.startsAt),i(r.endsAt);return t}function Vi(n){let e={};for(let t of n?.prices??[])e[t.categoryKey]=t.price;return e}var ve=require("@seatlayer/core"),ks=require("@seatlayer/core/core/seatConfidence");function Ln(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function k(n){return String(n??"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function He(n){return n?.restrictedView?v("picker.restrictedView","Restricted view"):n?.obstructedView?v("picker.obstructedView","Obstructed view"):""}function Ss(n){if(!n)return"";let e=[];n.premium&&e.push(`<div class="sl-cx-premium"><span class="sl-cx-star" aria-hidden="true">\u2605</span>${v("picker.premiumSeat","Premium seat")}</div>`);let t=He(n);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>${n.note?`<span class="sl-cx-note">${k(n.note)}</span>`:""}</span></div>`):n.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">${k(n.note)}</span></span></div>`),e.length?`<div class="sl-cx">${e.join("")}</div>`:""}function Hn(n){if(!n)return"";let e=[];if(n.premium){let i=k(v("picker.premiumSeat","Premium seat"));e.push(`<span class="sl-cx-mark sl-cx-mark-premium" role="img" aria-label="${i}" title="${i}">\u2605</span>`)}let t=He(n);if(t){let i=k(n.note?`${t}: ${n.note}`:t);e.push(`<span class="sl-cx-mark sl-cx-mark-limited" role="img" aria-label="${i}" title="${i}">\u25D0</span>`)}else if(n.note){let i=k(n.note);e.push(`<span class="sl-cx-mark sl-cx-mark-info" role="img" aria-label="${i}" title="${i}">\u2139</span>`)}return e.join("")}function Rn(n){if(!n)return"";let e=[];n.premium&&e.push(`<span class="sl-chip-cx-tag premium"><span aria-hidden="true">\u2605</span>${v("picker.premiumSeat","Premium seat")}</span>`);let t=He(n);return t&&e.push(`<span class="sl-chip-cx-tag limited"><span aria-hidden="true">\u25D0</span>${k(t)}</span>`),!e.length&&!n.note?"":'<div class="sl-chip-cx">'+(e.length?`<div class="sl-chip-cx-tags">${e.join("")}</div>`:"")+(n.note?`<div class="sl-chip-cx-note">${k(n.note)}</div>`:"")+"</div>"}function Tt(n){return n==="no-seat"?v("picker.emptyWheelchairSpace","Empty wheelchair space"):n==="seat-present"?v("picker.accessiblePhysicalSeat","Accessible physical seat"):""}function Ts(n){let e=Tt(n);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 Xt(n){let e=Tt(n);return e?`<span class="sl-cx-mark" role="img" aria-label="${e}" title="${e}">\u267F</span>`:""}function In(n,e){if(!n)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("picker.seeItIn3d","See it in 3D"),i=e?v("picker.viewFromHere","View from here"):t;return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${i}</span></button>`}function Cs(n){if(!n)return"";let e=n.previous.label||n.previous.id,t=n.next.label||n.next.id;return`<span class="sl-seccard-nav" aria-label="${v("picker.browseSections","Browse sections")}"><button type="button" data-section-nav="${D(n.previous.id)}" aria-label="${v("picker.previousSection","Previous section")}: ${D(e)}" title="${D(e)}">\u2190</button><button type="button" data-section-nav="${D(n.next.id)}" aria-label="${v("picker.nextSection","Next section")}: ${D(t)}" title="${D(t)}">\u2192</button></span>`}function Es(n,e){if(!e)return"";let t=e,i=t.includes(n.id),r=i?t.length>1?v("picker.openComparison","Open comparison"):v("picker.savedForComparison","Saved for comparison"):t.length?v("picker.compareWithSaved","Compare with saved"):v("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${i&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${k(r)}</span></button>`}function As(n,e,t){if(!t)return"";let i=(0,ks.seatConfidenceDisclosure)(n.confidenceEvidence),r=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${k(n.displayLabel??n.label)}"><span><em>${k(e)}</em><strong>${k(i.headline)}</strong><small>${k(r)}</small></span><b>Passport</b></button>`}function ee(n){let e=n?.rowLabel,t=n?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let r=`${t}${i}`;if(e.startsWith(r)&&e.length>r.length)return e.slice(r.length)}return(0,ve.compactRowLabel)(e,t)}function Yl(n){switch(n){case"paused":return{title:v("picker.accessPausedTitle","These seats are on hold right now"),body:v("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:v("picker.accessRetry","Try again")};case"revoked":return{title:v("picker.accessRevokedTitle","This access link is no longer active"),body:v("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats.")};case"no_token":case"provider_failed":return{title:v("picker.accessExpiredTitle","Your seat session has expired"),body:v("picker.accessExpiredBody","Reload the seat map to continue. Seats already in your cart stay held until the timer ends."),action:v("picker.accessRetry","Reload seat map")};default:return{title:v("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:v("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest.")}}}var Ql=6;function Ps(n,e,t){let i=Ln;return[n?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${n.sectionLabel.length>Ql?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${v("picker.section","Section")}</span><span class="sl-confirm-value">${i(n.sectionLabel)}</span></div>`:"",n?.rowLabel||n?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${i(t)}</span><span class="sl-confirm-value">${i(ee(n)??n?.displayLabel??e)}</span></div>`:"",n?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${v("picker.seat","Seat")}</span><span class="sl-confirm-value">${i(n?.seatNumber??n?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function Ms(n,e,t){let i=Ln,r=n?.objectType==="booth",s=n?.objectType==="table"&&!!n?.bookingMode,o=r||s||!n?.seatNumber,a=n?.sectionLabel??(o?void 0:n?.displayLabel),l=s?`${v("picker.guests","Guests")} ${n?.bookingMode==="variable"?`${n?.minOccupancy}\u2013${n?.maxOccupancy}`:n?.capacity}`:void 0,d=(o?[l,a?n?.rowLabel??n?.displayLabel:void 0]:[n?.rowLabel?`${t} ${ee(n)??""}`.trim():void 0,`${v("picker.seat","Seat")} ${n?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${i(a)}</span>`:"")+(d?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${i(d)}</span>`:"")+(a||d?"":`<span class="sl-confirm-pos">${i(e)}</span>`)}function Ls(n,e){if(!n)return"";let t=e?v("picker.viewFromThisSeat","View from this seat"):v("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-pill sl-confirm-3dpill" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function Hs(n,e){if(!n||e)return"";let t=v("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-3drow" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function xs(n){return n.buyerMessage?.trim()||(n.restriction==="companion"?v("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function Rs(n,e,t){let i=Ln;if(n.length>1)return`<fieldset class="sl-confirm-tiers"><legend>${v("picker.ticketType","Ticket type")}</legend>`+n.map(o=>{let a=xs(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 r=n[0],s=r?xs(r):void 0;return s?`<p class="sl-confirm-tier-note">${i(s)}</p>`:""}function Is(n){return`<span class="sl-seccard-dot" style="background:${k(n.color)}"></span><span class="sl-seccard-name">${k(n.label)}</span><span class="sl-seccard-left" data-full="${k(n.leftLabel)}" data-short="${k(n.leftShortLabel??n.leftLabel)}">${k(n.leftLabel)}</span>`+n.nav+n.close}function Os(n){return`<div class="sl-seccard-head"><span class="sl-seccard-dot" style="background:${k(n.color)}"></span><span class="sl-seccard-name">${k(n.label)}</span>`+(n.showPrice?`<span class="sl-seccard-price">${k(n.priceLabel)}</span>`:"")+n.close+`</div><div class="sl-seccard-zone">${n.zoneLabel?`${k(n.zoneLabel)} \xB7 `:""}<span class="sl-seccard-left">${k(n.leftLabel)}</span></div>`+(n.entrance?`<div class="sl-seccard-entrance">${k(n.entrance)}</div>`:"")+(n.mix?`<div class="sl-seccard-mix">${n.mix}</div>`:"")+`<div class="sl-seccard-foot"><button type="button" class="sl-seccard-overview">\u2190 ${k(n.overviewLabel)}</button>`+n.nav+`<span class="sl-seccard-hint">${k(n.hint)}</span></div>`}function _s(n){return`<span class="sl-seccard-mix-item${n.dim?" sl-dim":""}"><span class="sl-seccard-mix-dot" style="background:${k(n.color)}"></span>${k(n.label)} <span class="sl-seccard-mix-price">${k(n.rangeLabel)}</span></span>`}function Ds(n){return'<div class="sl-confirm-grid">'+n.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${k(n.categoryLabel)}</span>`+(n.priceLabel?`<span class="sl-confirm-price">${k(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+n.marker+`<span class="sl-confirm-dot" style="background:${k(n.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${k(n.categoryLabel)}</span><span class="sl-confirm-who">`+n.identity+"</span>"+(n.priceLabel?`<span class="sl-confirm-idprice">${k(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+n.tierChoices+n.groupDates+n.wheelchair+n.commercial+(n.thumb||n.see3dPill?`<div class="sl-confirm-strip">${n.thumb}<span class="sl-confirm-pills">${n.see3dPill}</span></div>`:"")+n.inspect+'<div class="sl-confirm-row">'+(n.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${k(n.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${k(n.selectLabel)}</span></button></div></div>`}function Ns(n,e){let t=D,{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,ve.t)("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):(0,ve.t)("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(n.displayLabel??n.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(i?v("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,ve.t)("picker.allPlacesBookedTogether",{count:n.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t((0,ve.t)("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(v("picker.tableCapacity","Table capacity"))}</span><span>${t((0,ve.t)("picker.guestsCount",{count:n.capacity}))}</span>`+(e.suppressPricing?"":`<span class="muted">${t(v("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(i?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(v("picker.numberOfGuests","Number of guests"))}</label><div class="sl-table-stepper" role="group" aria-labelledby="sl-table-qty-label"><button type="button" data-table-step="-1" aria-label="${t(v("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${n.quantity}</output><button type="button" data-table-step="1" aria-label="${t(v("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t((0,ve.t)("picker.chooseMinMaxGuests",{min:n.minOccupancy,max:n.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${n.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t((0,ve.t)("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?v("picker.updateTable","Update table"):i?v("picker.selectTable","Select table"):v("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function Bs(n,e){let t=Yl(n),i=document.createElement("div");i.className="sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let r=document.createElement("div");r.className="sl-access-card";let s=document.createElement("span");s.className="sl-access-icon",s.setAttribute("aria-hidden","true"),s.textContent="\u21BB";let o=document.createElement("div");o.className="sl-access-copy";let a=document.createElement("div");a.className="sl-access-title",a.textContent=t.title;let l=document.createElement("div");if(l.className="sl-access-body",l.textContent=t.body,o.append(a,l),t.action){let c=document.createElement("button");c.type="button",c.className="sl-access-act";let d=document.createElement("span");d.className="sl-access-act-icon",d.setAttribute("aria-hidden","true"),d.textContent="\u21BB";let p=document.createElement("span");p.textContent=t.action,c.append(d,p),c.addEventListener("click",async()=>{i.classList.add("is-reloading"),c.disabled=!0;try{await e()}catch{}finally{i.isConnected&&(i.classList.remove("is-reloading"),c.disabled=!1)}}),o.appendChild(c)}return r.append(s,o),i.appendChild(r),i}function $s(n){return n.map(e=>`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${k(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${k(e.icon)}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${k(e.label)}</span>`+(e.note?`<span class="sl-a11yrow-n">${k(e.note)}</span>`:"")+"</span>"+(e.count?`<span class="sl-a11yrow-c">${k(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>').join("")}function Fs(n){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",n.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:n.tf("picker.allFloors","All floors")},...n.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",()=>n.onChoose(s.id)),e.appendChild(o)}let i=document.createElement("button");i.type="button",i.className="sl-floor-info",i.textContent="i";let r=n.tf("picker.floorHelp","All floors shows the complete venue. Choose one level to inspect and select its seats.");return i.setAttribute("aria-label",r),i.title=r,e.appendChild(i),e}function Vs(n,e,t){if(!n)return;let i=t?"":e;n.querySelectorAll("button[data-floor]").forEach(r=>{r.setAttribute("aria-pressed",String(r.dataset.floor===i))})}var ye=require("@seatlayer/core");var zi=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}wireNavigation(e){e.querySelectorAll("[data-section-nav]").forEach(t=>{t.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation();let r=t.dataset.sectionNav;r&&this.host.controller.focusSection(r)})})}render(e){let t=this.host.map();if(!t)return;if(this.host.root()?.dataset.layout==="narrow"){this.el?.remove(),this.el=null;return}let i=e.categories.length?e.categories.map(h=>{let g=this.host.controller.doc?.categories.find(f=>f.key===h.key);return g?this.host.catPriceRange(g):{min:h.priceMin,max:h.priceMax}}).filter(h=>h!=null):[{min:e.priceMin,max:e.priceMax}],r=Math.min(...i.map(h=>h.min)),s=Math.max(...i.map(h=>h.max)),o=r===s?this.host.money(r):`${this.host.money(r)}\u2013${this.host.money(s)}`,a=(0,ye.tCount)("picker.seatsLeftInSection",e.seatsLeft),l=(0,ye.t)("picker.seatsLeftShort",{count:e.seatsLeft}),c=`<button type="button" class="sl-seccard-x" aria-label="${(0,ye.t)("picker.closeSectionSummary")}">\u2715</button>`,d=Cs(this.host.sectionNeighbours(e.id)),p={label:e.label,color:e.color,leftLabel:a,leftShortLabel:l,nav:d,close:c};this.el?.remove();let u=document.createElement("div");if(this.collapsed)u.className="sl-seccard mini on",u.setAttribute("role","button"),u.setAttribute("aria-label",(0,ye.t)("picker.sectionSummaryAria",{label:e.label})),u.innerHTML=Is(p),this.wireNavigation(u),u.addEventListener("click",h=>{h.target.closest(".sl-seccard-x")||(this.collapsed=!1,this.shownAt=Date.now(),this.render(e))}),u.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),(this.host.region("top-center")??t).appendChild(u);else{u.className="sl-seccard on",u.setAttribute("role","dialog"),u.setAttribute("aria-label",(0,ye.t)("picker.sectionSummaryAria",{label:e.label}));let h=this.host.priceBandKeys(),g=this.host.suppressPricing(),f=e.categories.map(x=>{let w=this.host.controller.doc?.categories.find(C=>C.key===x.key),y=w?this.host.catPriceRange(w):{min:x.priceMin,max:x.priceMax};return _s({label:x.label,color:x.color,dim:h!=null&&!h.has(x.key),rangeLabel:g?"":y&&y.min!==y.max?`${this.host.money(y.min)}\u2013${this.host.money(y.max)}`:this.host.money(y?.min??x.price)})}).join("");u.innerHTML=Os({...p,priceLabel:o,showPrice:!g&&e.categories.length>0,zoneLabel:e.zoneLabel,entrance:e.entrance?`${(0,ye.t)("picker.entrance")} ${e.entrance}`:void 0,mix:f,overviewLabel:(0,ye.t)("picker.overview"),hint:(0,ye.t)("picker.tapSeatHint")}),this.wireNavigation(u),u.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),u.querySelector(".sl-seccard-overview").addEventListener("click",()=>this.host.controller.overview()),(this.host.region("top-center")??t).appendChild(u)}this.el=u}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,i=this.host.map();if(!e||!t||!i)return 0;let r=this.host.activeFloorObjects().find(y=>y.type==="section"&&y.id===t.id)?.outline;if(!r||r.length<3)return 0;let s=r.map(y=>this.host.controller.worldToScreen(y)),o=s.map(y=>y.x),a=s.map(y=>y.y),l=Math.min(...o),c=Math.min(...a),d=Math.max(...o)-l,p=Math.max(...a)-c;if(d<=0||p<=0)return 0;let u=i.getBoundingClientRect(),h=e.getBoundingClientRect(),g=h.left-u.left,f=h.top-u.top,x=Math.max(0,Math.min(g+h.width,l+d)-Math.max(g,l)),w=Math.max(0,Math.min(f+h.height,c+p)-Math.max(f,c));return x*w/(d*p)}};var Xe=require("@seatlayer/core"),mo=require("@seatlayer/core/core/color");var Fe=require("@seatlayer/core");function On(n,e,t){try{return new Intl.DateTimeFormat(e,{...t,...n.timezone?{timeZone:n.timezone}:{}}).format(new Date(n.startsAt))}catch{return new Date(n.startsAt).toLocaleString(e)}}var ji=(n,e)=>On(n,e,{dateStyle:"medium"}),Gi=(n,e)=>On(n,e,{timeStyle:"short"}),qi=(n,e)=>On(n,e,{weekday:"short",day:"numeric",month:"short"});function zs(n,e,t,i){return!n.length||n.length>=e?null:{summary:i,labels:n.map(r=>`${ji(r,t)} \xB7 ${Gi(r,t)}`)}}function Xl(n,e){let t=new Set(e);return n.map(i=>({...i,free:!t.has(i.eventKey)}))}function js(n,e){let t=[...n];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Zl(n,e,t="",i=!1){if(!n.length)return"";let r=n.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="${k(s.eventKey)}" aria-label="${k(`${s.shortDate}: ${o}`)}" checked>`:"";return`<li class="sl-night${s.free?" ok":" no"}" aria-label="${k(`${s.shortDate}: ${o}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${k(s.shortDate)}</span><span class="st">${k(o)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${k(e.title)}</div><ul class="sl-nightstrip">${r}</ul><p class="sl-tip-nights-note">${k(e.notAvailableOn)}</p>`+t+"</div>"}function Jl(n){return n.selectPartialLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${k(n.selectPartialLabel)}</button>`:n.switchLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${k(n.switchLabel)}</button>`:n.switchLabel||n.selectPartialLabel?"":`<p class="sl-tip-advice">${k(n.advice)}</p>`}function ec(n){return Number(n.available)+Number(n.selected)+Number(n.partial)+Number(n.unavailable)}function Gs(n,e,t){if(ec(n)<2)return"";let i=(s,o,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${k(o)}</li>`,r=[];return n.available&&r.push(i("sl-pg-sw-free",e.available,` style="background:${k(t)}"`)),n.selected&&r.push(i("sl-pg-sw-sel",e.selected)),n.partial&&r.push(i("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${k(t)}"`)),n.unavailable&&r.push(i("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${k(e.title)}">${r.join("")}</ul>`}function qs(n,e){if(!n.length)return"";let t=n.map(i=>{let r=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="${k(i.eventKey)}"><span class="n">${k(i.name)}</span><span class="s">${k(r)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${k(e.title)}"><div class="sl-pg-nights-title">${k(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function _n(n,e){if(n?.kind!=="partial"||!e?.length)return null;let t=n.data?.blockedEventKeys??[],i=Xl(e,t);return{states:i,missing:i.filter(r=>!r.free).map(r=>r.shortDate)}}function Us(n,e){return n?Zl(n.states,{title:v("picker.group.partlyAvailableTitle","Free on some nights only"),free:v("picker.group.nightFree","Free"),blocked:v("picker.group.nightBlocked","Not available"),notAvailableOn:(0,Fe.t)("picker.group.notAvailableOn",{dates:js(n.missing,e.locale)})},Jl({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:v("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function tc(n,e,t,i){if(!n.length)return"";let r=new Set(e),s=new Set(t),o=n.map(a=>{let l=r.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${k(a.eventKey)}" aria-label="${k(`${a.shortDate}: ${l?i.available:i.unavailable}`)}"${l&&s.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${k(a.shortDate)}</span><span class="sl-confirm-date-state">${k(l?i.available:i.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${k(i.title)}</legend><p class="sl-confirm-dates-copy">${k(i.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${k(i.selectAll)}</span></label><ul>${o}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function Ks(n,e,t,i){let r=e.availableEventKeys(t);return tc(n,r,e.includedEventKeys(),{title:i("picker.group.confirmDatesTitle","Choose performance dates"),copy:r.length===n.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(n.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(r.length)).replace("{total}",String(n.length)),selectAll:i("picker.group.confirmSelectAll","Select all available dates"),available:i("picker.group.nightFree","Available"),unavailable:i("picker.group.nightBlocked","Unavailable")})}function Ws(n){return[...n.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function Ys(n,e,t,i){let r=[...n.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!r.length)return;let s=n.querySelector(".sl-confirm-add"),o=n.querySelector("[data-pg-confirm-all]"),a=()=>{let l=r.filter(p=>!p.disabled),c=Ws(n).length;o&&(o.checked=c===l.length,o.indeterminate=c>0&&c<l.length);let d=n.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()};r.forEach(l=>l.addEventListener("change",a)),o?.addEventListener("change",()=>{r.filter(l=>!l.disabled).forEach(l=>{l.checked=o.checked}),a()}),a()}async function Qs(n,e,t){if(!n||!t||!n.querySelector("[data-pg-confirm-event-key]"))return!0;let i=Ws(n);if(!i.length)return!1;let r=n.querySelector(".sl-confirm-add");return r?.setAttribute("aria-busy","true"),r&&(r.disabled=!0),await t.apply(e,i)?!0:(r?.removeAttribute("aria-busy"),r?.isConnected&&(r.disabled=!1),!1)}function Xs(n,e,t){return n?(0,Fe.t)("picker.group.seatPartlyAvailable",{label:e,free:n.states.length-n.missing.length,total:n.states.length,dates:js(n.missing,t)}):""}function Zs(n,e){let t=n.map((i,r)=>{let s=i.state==="done"?e.done:i.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${k(i.id)}" data-state="${k(i.state)}"${i.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${i.state==="done"?"\u2713":String(r+1)}</span><span class="l">${k(i.label)}</span><span class="sl-pg-sr">${k(s)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${k(e.label)}">${t}</ol>`}function Dn(n,e){return`<ul class="sl-pg-cards">${n.map(i=>`<li class="sl-pg-card" data-event-key="${k(i.eventKey)}"><span class="n">${k(i.name)}</span><time datetime="${k(i.iso)}"><span class="d">${k(i.date)}</span><span class="t">${k(i.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${k(e)}</p>`}function Js(n){let e=n.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${k(t.eventKey)}"><span class="n">${k(t.name)}</span><span class="s">${k(t.labels.length?t.labels.join(", "):n.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${k(n.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(n.note?`<p class="sl-pg-pane-note">${k(n.note)}</p>`:"")+(n.total?`<div class="sl-pg-pane-total"><span>${k(n.total.label)}</span><b>${k(n.total.amount)}</b></div>`:"")+(n.holdStatus?`<p class="sl-pg-hold-status" role="status">${k(n.holdStatus)}</p>`:"")}function eo(n){let e=Math.max(0,n);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function to(n,e){if(!n||n.seats<=0)return"";if(e==="same_seat"){let t=n.perPerformance??n.seats;return n.totalPerformances&&n.performances<n.totalPerformances?(0,Fe.tCount)("picker.group.performancesChosenOf",t,{chosen:n.performances,total:n.totalPerformances}):(0,Fe.tCount)("picker.group.seatsEveryPerformance",t)}return n.perPerformance!=null&&n.performancesChosen===n.performances?(0,Fe.tCount)("picker.group.seatsPerPerformance",n.seats,{per:n.perPerformance}):(0,Fe.tCount)("picker.group.performancesChosenOf",n.seats,{chosen:n.performancesChosen,total:n.performances})}function io(n,e){n.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let i=()=>e(t.dataset.eventKey);t.addEventListener("click",i),t.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),i())})})}var no=require("@seatlayer/core");function we(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e])}function ic(n,e){let t=n.objectType==="table"&&!!n.bookingMode,i=n.objectType==="booth",r=t||i||!n.seatNumber,s=r?n.rowLabel??n.displayLabel??n.label:n.seatNumber,o=t?`${v("picker.guests","Guests")} ${n.bookingMode==="variable"?`${n.minOccupancy}\u2013${n.maxOccupancy}`:n.capacity}`:!i&&n.rowLabel?`${e} ${ee(n)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${r?" name":""}">${we(s)}</span>`+(o?`<span class="sl-tip-row">${we(o)}</span>`:"")+"</div>"+(n.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${v("picker.section","Section")}</span><span class="sl-tip-secname">${we(n.sectionLabel)}</span></div>`:"")+"</div>"}function ro(n,e){let t=n.status==="not_for_sale",i=n.mark?.kind==="partial",r=n.status==="free"||i?"":`<span class="sl-tip-tag">${t?v("picker.notAvailable","Not available"):n.status==="held"?(0,no.t)("map.statusHeld"):v("picker.sold","Sold")}</span>`,s=t?"":e.price,o=s?`<span class="sl-tip-amt">${we(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${we(e.priceNote)}</div>`:"",l=He(n.commercial),c=l?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u25D0</span>${we(l)}</div>`:"",d=Tt(n.wheelchairSpaceType),p=d?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u267F</span>${we(d)}</div>`:"",u=e.reason?`<div class="sl-tip-reason">${we(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+ic(n,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${we(n.categoryColor)}"></span><span class="sl-tip-name">${we(n.categoryLabel)}</span>`+r+o+"</div>"+a+u+p+c+(e.extra??"")}function so(n,e,t,i){let r=n.x+14,s=n.y-i.height-12,o=n.y+18,a=s;r+i.width>e-8&&(r=n.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(r,Math.max(8,e-i.width-8))),top:Math.max(8,Math.min(a,l))}}function oo(n,e,t,i=22){let r=Math.max(8,Math.min(n.x-t.width/2,Math.max(8,e.width-t.width-8))),s=n.y-i-t.height,o=n.y+i;return s>=8?{left:r,top:s,placement:"above"}:o+t.height<=e.height-8?{left:r,top:o,placement:"below"}:{left:r,top:Math.max(8,Math.min(s<8?o:s,Math.max(8,e.height-t.height-8))),placement:s<8?"below":"above"}}var Nn=14,nc=12,rc=12,sc=18;function ao(n,e,t,i=nc){let r=e.height-Nn-t.height;if(!(n>=r-sc))return{placement:"sheet",nudgeY:0};let o=rc,a=r-i;return a<=o?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round((o+a)/2-n)}}function lo(n,e,t,i){let r=t.width/2+12,s=Math.max(r,Math.min(e.width-r,n.x)),o=n.y+t.height+24<=e.height,a=n.y<t.height+24&&o?"below":"above",l=i&&a==="above"?Math.max(t.height+24,n.y):n.y;return{left:s,top:Math.max(8,Math.min(e.height-8,l)),placement:a}}function co(n,e,t){let i=n.querySelector("[data-pg-select-partial]"),r=[...n.querySelectorAll("[data-pg-event-key]")],s=()=>r.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};r.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 Qe(n){let e=n?.displayType?.trim()||n?.rowType?.trim();return e||(n?.objectType==="table"?v("picker.table","Table"):n?.objectType==="booth"?v("picker.booth","Booth"):v("picker.row","Row"))}var oc="sl-confirm-scrim",ac="--sl-scrim-mask";function lc(n){let e=Math.round(n.x),t=Math.round(n.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function po(n,e,t,i){let r=n??document.createElement("div");return n||(r.className=oc),r.style.setProperty(ac,lc(i)),t.parentNode===e?r.nextSibling!==t&&e.insertBefore(r,t):r.parentNode!==e&&e.appendChild(r),r}function Bn(n){return n?.remove(),null}var cc=360,dc=160,ho=450;function uo(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function pc(n){return(0,mo.contrastRatio)("#ffffff",n)>=3?"#ffffff":"#0b0f19"}var Ui=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.mode="add";this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let i=St(e)?e.viewUrl??"":"",r=_i(t);if(!i&&!r)return"";let s=i?null:Di(e,e.focalPoint??t.focalPoint);if(!i&&s==null)return"";let o=r&&s!=null?`<div class="sl-confirm-sight">${D((0,Xe.t)("picker.sightline",{m:s}))}</div>`:"";if(!i)return o;let a=D((0,Xe.t)("picker.viewFromSeat",{label:e.label})),l=D(this.host.tf("picker.viewFromHere","View from here"));return`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`+o}show(e,t="add"){let i=this.host;this.mode=t;let r=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,i.root()?.setAttribute("data-confirming","true"),i.els().side?.toggleAttribute("inert",!0),Object.values(i.regions()).forEach(P=>P.toggleAttribute("inert",!0)),i.controller.setSelectionFocus(e.id),r&&r!==e.id&&i.controller.deselect([r]),i.hideTooltip();let s=i.controller.seatDetails(e.id),o=i.controller.doc?.categories.find(P=>P.key===e.categoryKey),a=s?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),l=a!=null?i.paidPrice(e.categoryKey,s?.tierId??o?.tiers?.[0]?.id??null,a,e.label):void 0,c=Ps(s,e.displayLabel??e.label,Qe(s)),d=s?.tiers??o?.tiers??[],p=s?.tierId??d[0]?.id,u=i.suppressPricing()?"":Rs(d,p,P=>i.money(i.paidPrice(e.categoryKey,P.id,P.price,e.label))),h=i.buyerView()==="venue3d",g=i.performanceGroup()?.confirmDateSelection??void 0,f=g?i.performanceGroup()?.nights?.()??[]:[],x=g?Ks(f,g,e.id,(P,T)=>i.tf(P,T)):"";this.shownAt=performance.now();let w=document.createElement("div");w.className="sl-confirm sl-mo-in",t==="remove"&&w.classList.add("sl-confirm-removing"),x&&w.classList.add("sl-confirm-group-dates"),w.setAttribute("role","dialog"),w.setAttribute("aria-label",(0,Xe.t)("picker.confirmSeatLabel",{label:e.label}));let y=o?.color??"#6e7bff";w.style.setProperty("--sl-cat",y),w.style.setProperty("--sl-cat-ink",pc(y));let C=String(s?.categoryLabel??o?.label??e.categoryKey),b=i.controller.categoryAvailability()[e.categoryKey],H=typeof b=="number"&&b>0?(0,Xe.tCount)("picker.leftCount",b):"";w.innerHTML=Ds({identityFields:c,identity:Ms(s,e.displayLabel??e.label,Qe(s)),marker:Xt(s?.wheelchairSpaceType),see3dPill:Ls(i.canOffer3d(),h),categoryColor:o?.color??"#6e7bff",categoryLabel:C,priceLabel:!i.suppressPricing()&&l!=null?i.money(l):"",categoryLeftLabel:H,tierChoices:u,groupDates:x,wheelchair:Ts(s?.wheelchairSpaceType),commercial:Ss(e.commercial),thumb:i.seatViewEnabled()&&i.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:h?`<div class="sl-confirm-inspect-row">${As(e,i.suppressPricing()?`${s?.displayLabel??e.displayLabel??e.label}`:`${s?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?i.tf("picker.priceNotSupplied","Price not supplied"):i.money(l)}`,h)}${Es(e,h?i.view3dCompareSeatIds():null)}${In(i.canOffer3d(),h)}</div>`:In(i.canOffer3d(),h),see3dRow:Hs(i.canOffer3d(),h),cancelLabel:(0,Xe.t)("common.cancel"),selectLabel:t==="remove"?i.tf("picker.removeSeat","Remove seat"):i.addSeatLabel(s?.objectType)}),t==="remove"&&w.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),i.els().map.appendChild(w),this.el=w;let S=w.querySelector(".sl-confirm-thumb"),O=S?.closest(".sl-confirm-thumbwrap")??null;if(S&&O){let P=!1,T=()=>{if(P||!O.isConnected)return;P=!0;let _=()=>{O.remove(),this.el===w&&i.reanchor()};if(i.reducedMotion()||typeof requestAnimationFrame!="function"){_();return}O.style.height=`${O.offsetHeight}px`,O.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{O.style.height="0px",O.style.opacity="0"}),setTimeout(_,dc)};S.addEventListener("error",T),S.addEventListener("load",()=>{S.naturalWidth||T()});let I=e.viewMeta?.previewUrl??e.viewUrl;I?i.resolveAssetUrl(I).then(_=>{if(!(!w.isConnected||this.el!==w)){if(!_){T();return}S.src=_}}).catch(_=>{T(),i.onError(_)}):T()}i.reanchor(),this.liftSeatClearOfSheet(e),w.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{i.openSeatView(e)}),w.querySelector(".sl-confirm-confidence")?.addEventListener("click",P=>{i.openSeatConfidencePassport(e,P.currentTarget instanceof HTMLElement?P.currentTarget:null)}),w.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>i.saveView3dComparisonSeat(e)),w.querySelectorAll("[data-confirm-tier]").forEach(P=>{P.addEventListener("click",()=>{let T=P.dataset.confirmTier,I=d.find(F=>F.id===T);if(!I)return;i.controller.setSeatTier(e.id,I.id),w.querySelectorAll("[data-confirm-tier]").forEach(F=>{F.setAttribute("aria-pressed",String(F===P))});let _=w.querySelector(".sl-confirm-price");_&&(_.textContent=i.money(i.paidPrice(e.categoryKey,I.id,I.price,e.label))),i.reanchor()})}),w.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(P=>{P.addEventListener("pointerdown",Ti,{once:!0}),P.addEventListener("click",()=>{i.buyerView()==="venue3d"?(i.dismiss(),i.view3dHandle()?.flyToSeat(e.id)):(i.rememberView3dReturnSeat(e),i.dismiss(),i.enter3d(e.id))})}),Ys(w,g,(P,T)=>i.tf(P,T),()=>i.reanchor()),w.querySelector(".sl-confirm-add").addEventListener("click",()=>{if(!this.ghostActivation()){if(this.mode==="remove"){this.removeCommitted();return}this.commit()}}),w.querySelector(".sl-confirm-cancel").addEventListener("click",()=>{this.ghostActivation()||this.cancel()}),this.armOutsideTap(w),requestAnimationFrame(()=>{let P=w.querySelector(".sl-confirm-add");P?.focus(),i.liftToastOverConfirm(),i.fitTranslatedRows(),i.inviteCommit(w,P)})}liftSeatClearOfSheet(e){let t=this.host,i=t.root();if(!this.el||i?.dataset.layout!=="narrow"||i?.dataset.view3d==="on")return;let r=t.els().map;if(!r)return;let s=t.controller.worldToScreen({x:e.x,y:e.y}),o=t.controller.getRenderer(),a=o?.getCameraGestureCount?.()??0,{nudgeY:l}=ao(s.y,{height:r.clientHeight},{height:this.el.offsetHeight||230}),c=this.lift&&this.lift.gestures===a?this.lift.dy:0;if(!l){this.lift=c?{dy:c,gestures:a}:null;return}o?.panScreenBy?.({x:0,y:l},{animate:!t.reducedMotion()}),this.lift={dy:c+l,gestures:a}}settleLift(){let e=this.lift;if(this.lift=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),i=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=po(this.scrim,i,this.el,t),vr(this.el,t,i),e.liftToastOverConfirm();return}this.scrim=Bn(this.scrim);let r=i.clientWidth,s=i.clientHeight,o=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=lo(t,{width:r,height:s},{width:o,height:a},l);this.el.dataset.placement=c.placement,this.el.style.left=`${c.left}px`,this.el.style.top=`${c.top}px`,yi(this.el,t,{left:c.left,top:c.top,width:o,height:a})}ghostActivation(){return uo()?performance.now()-this.shownAt<ho:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,i=s=>{if(this.el!==e){this.disarmOutsideTap();return}let o=s.target;!o||e.contains(o)||t.els().tray?.contains(o)||this.cancel()};this.outsideTap=i;let r=t.root();setTimeout(()=>{this.outsideTap===i&&(r??document).addEventListener("pointerdown",i,!0)},uo()?ho:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null,(this.host.root()??document).removeEventListener("pointerdown",e,!0),document.removeEventListener("pointerdown",e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=Bn(this.scrim),this.settleLift(),this.el&&gt(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null)}async commit(){let e=this.host,t=this.seat;if(!t)return;let r=this.el?.querySelector(".sl-confirm-add")??null;if(r?.classList.contains("is-adding")||!await Qs(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let s=()=>{e.dismiss(),xn(e.els(),e.controller.worldToScreen(t),t,e.controller.doc?.categories)};if(!r||e.reducedMotion()){s();return}r.classList.remove("sl-confirm-add-invite"),r.classList.add("is-adding"),r.setAttribute("aria-disabled","true");let o=r.querySelector(".sl-confirm-add-t");o&&(o.textContent=e.tf("picker.added","Added")),e.scheduleMotion(s,cc)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"&&e.controller.deselect([t.id]),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}removeCommitted(){let e=this.host,t=this.seat;t&&(e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}};function fo(n,e,t){if(!e||t)return;e.classList.add("sl-confirm-add-invite");let i=()=>e.classList.remove("sl-confirm-add-invite");n.addEventListener("pointerdown",i,{once:!0}),n.addEventListener("keydown",i,{once:!0}),e.addEventListener("focus",i,{once:!0})}function go(n,e){return n&&n!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}var bo=require("@seatlayer/core"),Ct=require("@seatlayer/core/picker/minimapGeometry");function vo(n,e){let t=new $n(n);return t.build(e),t}var $n=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}dispose(){this.miniToggle?.remove(),this.miniWrap?.remove(),this.miniToggle=null,this.miniWrap=null,this.miniCanvas=null,this.miniBase=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.host.root()?.removeAttribute("data-minimap-open")}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",v("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 r=document.createElement("div");r.className="sl-minimap",r.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",v("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",v("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",v("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),r.append(s,c),e.appendChild(r),this.miniWrap=r,this.miniLabel=o,this.miniCanvas=c;let d=document.createElement("canvas");this.miniBase=d,i.addEventListener("click",()=>{let p=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=p,this.setMinimapOpen(!p)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",p=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(p)}),c.addEventListener("pointerdown",p=>this.minimapPointerDown(p)),c.addEventListener("pointermove",p=>this.minimapPointerMove(p)),c.addEventListener("pointerup",p=>this.minimapPointerUp(p)),c.addEventListener("pointercancel",p=>this.minimapPointerUp(p)),c.addEventListener("keydown",p=>this.minimapKeydown(p)),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 r=196,s=146,o=6,a=i.width/Math.max(1,i.height),l=r,c=Math.round(r/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()?v("picker.allFloors","All floors"):e.find(d=>d.id===this.host.controller.getActiveFloorId())?.name??v("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. ${v("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${o}. ${v("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 r=p=>p*t.scale+t.offX,s=p=>p*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 p of d.sections){if(p.outline.length<3)continue;i.beginPath(),p.outline.forEach((h,g)=>g===0?i.moveTo(r(h.x),s(h.y)):i.lineTo(r(h.x),s(h.y))),i.closePath();let u=p.paint;if(i.globalAlpha=p.state==="inactive"?.5:.92,u?i.fillStyle=u.fill:(i.globalAlpha=p.state==="inactive"?.18:p.state==="selected"?.72:.34,i.fillStyle=p.state==="inactive"?a:p.state==="selected"?l:c),i.fill(),i.globalAlpha=.82,i.lineWidth=Math.max(1,t.dpr),i.strokeStyle=u?.stroke||o,i.stroke(),p.owned){i.globalAlpha=1,i.lineWidth=Math.max(2,t.dpr*1.5),i.strokeStyle=l,i.stroke();let h=p.outline.reduce((g,f)=>({x:g.x+f.x,y:g.y+f.y}),{x:0,y:0});i.beginPath(),i.arc(r(h.x/p.outline.length),s(h.y/p.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),i.fillStyle=l,i.fill(),i.beginPath(),p.outline.forEach((g,f)=>f===0?i.moveTo(r(g.x),s(g.y)):i.lineTo(r(g.x),s(g.y))),i.closePath()}p.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 p=Math.max(1,t.dpr),u=this.host.controller.getRenderer?.(),h=new Map,g=f=>{let x=h.get(f);if(x)return x;let w=u?.categoryDisplayColor?.(f)||c;return h.set(f,w),w};for(let f of d.seats)i.globalAlpha=f.state==="inactive"?.22:.78,i.fillStyle=f.state==="inactive"?a:f.state==="selected"?l:g(f.categoryKey),i.beginPath(),i.arc(r(f.x),s(f.y),p,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 r=e.getContext("2d");if(!r)return;r.clearRect(0,0,e.width,e.height),r.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";r.save(),r.globalAlpha=.1,r.fillStyle=a,r.fillRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),r.globalAlpha=.9,r.lineJoin="round",r.lineWidth=Math.max(4,i.dpr*3.25),r.strokeStyle=l,r.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),r.globalAlpha=1,r.lineWidth=Math.max(2,i.dpr*1.75),r.strokeStyle=a,r.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),o.clipped&&Object.values(o.clippedEdges).some(Boolean)&&(r.setLineDash([Math.max(3,i.dpr*3),Math.max(2,i.dpr*2)]),r.strokeRect(o.clipped.x,o.clipped.y,o.clipped.width,o.clipped.height)),r.restore()}minimapWorldPoint(e){let t=this.miniCanvas,i=this.miniTf;if(!t||!i)return null;let r=t.getBoundingClientRect(),s=(e.clientX-r.left)*(t.width/Math.max(1,r.width)),o=(e.clientY-r.top)*(t.height/Math.max(1,r.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,r=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!i&&!r||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+i,y:t.y+t.height/2+r}),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,bo.pointInPolygon)(t,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var Ki=require("@seatlayer/core");var hc=12;function yo(n,e){let t=e.floors(),i=new Set(t.map(S=>S.label.trim().toLocaleLowerCase())),r=e.zones().filter(S=>S.seatCount>0&&!i.has(S.label.trim().toLocaleLowerCase())),s=e.sections().filter(S=>S.seatCount>0&&!i.has(S.label.trim().toLocaleLowerCase())),o=r.length>1?[]:s,a=t.length>1,l=r.length>1,c=o.length>1;if(!a&&!l&&!c)return null;let d=document.createElement("div");d.className="sl-view3d-nav";let p=null,u=document.createElement("button");u.type="button",u.className="sl-view3d-nav-toggle",u.setAttribute("aria-expanded","false");let h='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>',g=document.createElement("span");u.innerHTML=h,u.appendChild(g);let f=()=>{for(let S of d.querySelectorAll(":scope > div")){let O=S.querySelector('[aria-pressed="true"]');!O||S.scrollWidth<=S.clientWidth||O.scrollIntoView({block:"nearest",inline:"nearest"})}},x=()=>{if(p)return p;for(let S of d.querySelectorAll(":scope > div")){let O=S.querySelector('button[aria-pressed="true"]'),P=O?.textContent?.trim();if(P&&O?.dataset.floor!=="")return P}return a&&(l||c)?v("picker.levelsAndAreas","Levels & areas"):a?v("picker.levels","Levels"):v("picker.areas","Areas")},w=S=>{d.classList.toggle("is-open",S),u.setAttribute("aria-expanded",String(S)),S&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(f),g.textContent=x()};u.addEventListener("click",()=>w(!d.classList.contains("is-open"))),d.addEventListener("keydown",S=>{S.key!=="Escape"||!d.classList.contains("is-open")||(S.preventDefault(),S.stopPropagation(),w(!1),u.focus())});let y=document.createElement("button");y.type="button",y.className="sl-view3d-nav-close",y.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let C=v("picker.closeVenueNavigation","Close venue navigation");y.setAttribute("aria-label",C),y.title=C,y.addEventListener("click",()=>{w(!1),u.focus()}),w(!1),d.appendChild(u);let b=S=>{},H=S=>{};if(a){let S=document.createElement("div");S.setAttribute("role","group"),S.setAttribute("aria-label",v("picker.levels","Levels"));let O=[];H=I=>{O.forEach(_=>{_.setAttribute("aria-pressed",String((_.dataset.floor===""?null:Number(_.dataset.floor))===I))})};let P=I=>{e.focusFloor(I)&&(H(I),b(I))},T=(I,_)=>{let F=document.createElement("button");F.type="button",F.textContent=I,F.dataset.floor=_===null?"":String(_),F.setAttribute("aria-pressed",String(_===null)),F.addEventListener("click",()=>{P(_),w(!1)}),O.push(F),S.appendChild(F)};T(v("picker.allLevels","All levels"),null);for(let I of t)T(I.label||(0,Ki.t)("picker.levelNumber",{number:I.index+1}),I.index);d.appendChild(S)}if(l||c){let S=document.createElement("div");S.setAttribute("role","group"),S.setAttribute("aria-label",v("picker.areas","Areas"));let O=l?r.map(T=>({id:T.id,label:T.label||T.id,go:()=>{e.focusZone(T.id)}})):o.map(T=>({id:T.id,label:T.label||T.id,floorIndex:T.floorIndex,go:()=>{e.focusSection(T.id),Number.isFinite(T.floorIndex)&&H(T.floorIndex)}})),P=T=>{let I=l||T===null?O:O.filter(_=>_.floorIndex===void 0||_.floorIndex===T);if(S.replaceChildren(),!I.length){S.remove();return}if(S.isConnected||d.insertBefore(S,y.isConnected?y:null),!l&&I.length>hc){let _=document.createElement("select");_.setAttribute("aria-label",v("picker.jumpToSection","Jump to section"));let F=document.createElement("option");F.value="",F.textContent=v("picker.jumpToSection","Jump to section"),_.appendChild(F);for(let Q of I){let J=document.createElement("option");J.value=Q.id,J.textContent=Q.label,_.appendChild(J)}_.addEventListener("change",()=>{I.find(Q=>Q.id===_.value)?.go()}),S.appendChild(_);return}for(let _ of I){let F=document.createElement("button");F.type="button",F.textContent=_.label,F.dataset.area=_.id,F.addEventListener("click",()=>{p=_.label,_.go(),w(!1)}),S.appendChild(F)}};b=P,P(null)}return d.appendChild(y),n.appendChild(d),d}var Wi=class{constructor(e){this.host=e;this.chip=null}sync(){let e=this.host.overlay();if(!e||this.host.savedSeatIds().length===0){this.chip?.remove(),this.chip=null;return}let t=this.chip;if(!t){t=document.createElement("div"),t.className="sl-view3d-compare-saved",t.setAttribute("role","group"),t.setAttribute("aria-label",v("picker.savedSeatComparison","Saved seat comparison"));let s=document.createElement("button");s.type="button",s.className="main",s.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(v("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",v("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,r=t.querySelector(".main");r&&(r.textContent=i>1?(0,Ki.t)("picker.compareCount",{count:i}):v("picker.oneSeatSaved","1 seat saved"),r.setAttribute("aria-label",i>1?(0,Ki.t)("picker.openComparisonOfSeats",{count:i}):v("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function wo(n){return!n?.querySelector('[data-ref="zfs"]')}var Fn=require("@seatlayer/core");var uc=900,mc=450;function fc(n){switch(n){case"seat":return v("picker.stopYourSeat","Your seat");case"row":return v("picker.stopYourRow","Your row");case"section":return v("picker.stopYourSection","Your section");default:return v("picker.stopWholeVenue","Whole venue")}}function xo(n,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let i=v("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",i),t.title=i,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let r=document.createElement("div");r.className="sl-view3d-stop",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),n.append(t,r);let s=null,o=null;return{onStopChange(a){if(s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),!a){r.classList.remove("is-shown"),r.textContent="",o=setTimeout(()=>{o=null,n.classList.remove("is-seat-view")},mc);return}n.classList.add("is-seat-view"),r.textContent=fc(a),r.classList.add("is-shown"),s=setTimeout(()=>{s=null,r.classList.remove("is-shown")},uc)},dispose(){s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),t.remove(),r.remove(),n.classList.remove("is-seat-view")}}}var gc=44,bc=92;function ko(n,e,t,i={}){let r=n?.sectionLabel,s=ee(n),o=vc(n,e),a=[r,s?(0,Fn.t)("picker.rowLabel",{label:s}):null,o?(0,Fn.t)("picker.seatLabel",{label:o}):null].filter(Boolean).join(" \xB7 "),l=i.maxChars??(i.narrow?gc:bc);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 vc(n,e){if(n?.seatNumber)return n.seatNumber;let t=n?.displayLabel??e,i=r=>{!r||!t.startsWith(r)||t.length<=r.length||(t=t.slice(r.length).replace(/^[\s·\-\/_]+/,""))};return i(n?.sectionLabel),i(ee(n)),t}var So="sl:sheet-hint";function To(n){let e=n.boot;if(!e?.isConnected)return;if(n.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),n.map?.appendChild(t),setTimeout(()=>t.remove(),650),n.rail?.classList.add("is-in"),n.root?.classList.add("is-arriving"),setTimeout(()=>{n.rail?.classList.remove("is-in"),n.root?.classList.remove("is-arriving"),yc(n.root)},900)}function yc(n){if(!n||n.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(So))return;window.sessionStorage.setItem(So,"1")}catch{}let e=n.querySelector(".sl-sheet-grab");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function Co(n,e){n.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let i of e())if(i.open()){t.preventDefault(),t.stopPropagation(),i.close();return}}})}function Yi(n){let e=n.committedSelection(),t=n.controller.getGAAreas(),i=n.hold?.items??[],r=new Set(i.map(u=>u.label)),s=Tr(n,t,i),o=We(n.gaQty,i),a=i.reduce((u,h)=>u+n.paidPrice(h.categoryKey,h.tierId,h.unitPrice,h.label)*(h.quantity??1),0),l=i.reduce((u,h)=>u+(h.quantity??1),0),c=e.filter(u=>!r.has(u.label)),d=c.reduce((u,h)=>u+n.paidPrice(h.categoryKey,h.tierId??null,h.price,h.label)*(h.quantity??1),0)+s+a,p=c.reduce((u,h)=>u+(h.quantity??1),0)+o+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:i,heldLabels:r,heldCount:l,total:d,count:p}}function Qi(n,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:n.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function Xi(n,e){let t=e.tiers?.length?e.tiers.map(i=>n.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[n.paidPrice(e.key,null,e.price)];if(e.key)for(let i of n.pricesByChannel.values())for(let r of i)r.categoryKey===e.key&&t.push(r.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var Zt="seatlayer_";function wc(){let n=globalThis;return n.document?.modelContext??n.navigator?.modelContext??null}function he(n,e){return e?{ok:!1,reason:n,message:e}:{ok:!1,reason:n}}function xc(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&!!e):[]}function kc(n,e){let t=n.event();if(!t)return he("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits();return{ok:!0,event:t,selection:{max:i.max,...i.required!=null?{required:i.required}:{}},categories:n.categories(),zones:n.zones(),hasPremiumSeats:n.hasPremiumSeats(),holdsAllowed:e}}function Eo(n,e){let t=r=>!!r&&r.toLowerCase()===e.toLowerCase(),i=n.find(r=>t(r.key??r.id))??n.find(r=>t(r.label));return i?.key??i?.id??null}function Ao(n,e){let t=e.map(i=>n.describeSeat(i.id));return{seatIds:e.map(i=>i.id),labels:e.map(i=>i.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((i,r)=>t[r]?.seat||i.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((i,r)=>i+r.price,0)}}function Sc(n,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 r=[];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)r.push(Ao(n,o.slice(d,d+t)));a=l}}return r}function Tc(n,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 r=[];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);r.push(Ao(n,o.slice(0,t)))}return r}function Cc(n,e){if(!n.event())return he("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits(),r=Math.floor(Number(e.count));if(!Number.isInteger(r)||r<1||r>i.max)return he("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?Eo(n.categories(),l):null;if(l&&!d)return he("no_match",`No ticket type called "${l}".`);let p=c?Eo(n.zones(),c):null;if(c&&!p)return he("no_match",`No zone called "${c}".`);let u=n.seats().filter(f=>f.available);if(!u.length)return he("sold_out");let h=u.filter(f=>(!d||f.categoryKey===d)&&(!p||f.zoneId===p)&&(a==null||f.price<=a));if(!h.length)return he("no_match");let g=o?Sc(n,h,r):Tc(n,h,r);return g.length?(g.sort((f,x)=>x.unitPrice!==f.unitPrice?x.unitPrice-f.unitPrice:f.row.localeCompare(x.row)||f.labels[0].localeCompare(x.labels[0])),{ok:!0,groups:g.slice(0,s),searched:{count:r,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...p?{zone:p}:{},together:o}}}):he(o?"not_enough_together":"no_match")}function Po(n){return{ok:!0,...n.selection()}}function Ec(n,e){let t=n.event();if(!t)return he("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return he("event_closed","Sales are closed for this event.");let i=xc(e.seat_ids);return i.length?(n.clearSelection(),n.selectObjects(i),Po(n)):he("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function Ac(n,e){let t=async r=>{try{return await r()}catch(s){return he("error",s instanceof Error?s.message:String(s))}},i=[{name:`${Zt}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(()=>kc(n,e))},{name:`${Zt}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:r=>t(()=>Cc(n,r))},{name:`${Zt}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:r=>t(()=>Ec(n,r))},{name:`${Zt}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(()=>Po(n))}];return e&&i.push({name:`${Zt}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>n.hold())}),i}async function Mo(n,e={}){let t=wc();if(!t||typeof t.registerTool!="function")return null;let i=new AbortController,r=Ac(n,!!e.holds),s=[],o=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of r)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 Lo(n){let e=n.opts.webMcp;if(!e||n.destroyed)return;let t=typeof e=="object"&&!!e.holds,i=typeof e=="object"?e.exposedTo:void 0;try{n.webMcp=await Mo(zn(n,t),{holds:t,exposedTo:i}),n.destroyed&&Vn(n)}catch(r){console.warn("seatmap: WebMCP registration failed",r)}}function Vn(n){n.webMcp?.dispose(),n.webMcp=null}function zn(n,e){let t=(i,r)=>{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:r};return{event:()=>{let i=n.renderInfo;return i?{name:i.eventName??"",venue:i.venue??null,startsAt:i.startsAt??null,timezone:i.timezone??null,currency:n.currency,salesClosed:n.salesClosed}:null},selectionLimits:()=>({max:n.maxTickets,required:n.exactTickets}),categories:()=>{let i=n.controller.categoryAvailability();return(n.controller.doc?.categories??[]).filter(r=>!r.notForSale).map(r=>{let s=Xi(n,r),o=Qi(n,r);return{key:r.key,label:r.label??r.key,...o===void 0?{}:{price:o},...s&&s.min!==s.max?{priceRange:s}:{},available:i[r.key]??0}})},zones:()=>n.controller.getBestAvailableZones(),hasPremiumSeats:()=>n.controller.hasPremiumSeats(),seats:()=>{let i=n.controller.getActiveFloorId(),r=[];return n.allSeats().forEach((s,o)=>{if(s.floorId&&i&&s.floorId!==i)return;let a=n.controller.getStatus(s.id)??"free",l=n.controller.doc?.categories.find(d=>d.key===s.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;r.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:n.paidPrice(s.categoryKey,l?.tiers?.[0]?.id??null,c,s.label),...s.zoneId?{zoneId:s.zoneId}:{},available:a==="free"&&!l?.notForSale})}),r},describeSeat:i=>{let r=n.controller.seatDetails(i);return r?{section:r.sectionLabel??"",row:ee(r)??"",seat:r.seatNumber??r.label,category:r.categoryLabel??r.categoryKey}:null},selection:()=>{let{freshSeats:i,total:r,count:s}=Yi(n);return{seats:i.map(o=>({id:o.id,label:o.label,section:o.sectionLabel??"",row:ee(o)??"",seat:o.seatNumber??o.label,category:o.categoryKey,price:n.paidPrice(o.categoryKey,o.tierId??null,o.price,o.label)})),count:s,total:r,currency:n.currency,hold:n.hold?{id:n.hold.holdId,expiresAt:n.hold.expiresAt}:null,validity:n.getSelectionValidity()}},clearSelection:()=>n.clearSelection(),selectObjects:i=>{n.selectObjects(i)},hold:()=>e?Pc(n):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function Pc(n){if(n.salesClosed)return{ok:!1,reason:"event_closed"};if(!n.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=n.controller.getSelectionValidity(n.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await n.handleCta(),n.hold?{ok:!0,hold:{id:n.hold.holdId,expiresAt:n.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function jn(n){return{renderingTimeMillis:n.ms,performanceProfile:n.performanceProfile,seatCount:n.seatCount,objectCount:n.objectCount,sectionCount:n.sectionCount,view:n.view,eventKey:n.eventKey,chartName:n.chartName,floorCount:n.floorCount,transport:n.transport,load:n.load,metricScope:n.metricScope,operationalTelemetryReporter:"sdk"}}function Ho(n,e){Le({apiBase:n.apiBase,event:n.eventKey,scope:n.metricScope,surface:n.surface,outcome:"success",ms:n.ms,performanceProfile:n.performanceProfile,chartDelivery:n.chartDelivery,seats:n.seatCount,floors:n.floorCount,view:n.view,load:n.load,transport:n.transport}),e("chart_rendered",jn(n))}var Ro=require("@seatlayer/core/core/seatConfidence");function ne(n){return String(n??"").replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Io(n){let e=(0,Ro.seatConfidenceDisclosure)(n.seat.confidenceEvidence),t=n.seat.confidenceEvidence,i=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${ne(c)}</li>`).join("")}</ul>`:"",r=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${ne(e.modeledTarget)}</dd></div>`:"",s=t?`<div><dt>Evidence ID</dt><dd>${ne(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${ne(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${ne(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${ne(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${ne(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",o=He(n.seat.commercial)||n.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${ne(o)}</dd></div>`+(n.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${ne(n.seat.commercial.note)}</dd></div>`:""),l=n.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${ne(n.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${ne(e.headline)}</strong><span>${ne(e.coverage)} \xB7 ${ne(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${ne(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${ne(e.reality)}</dd></div><div><dt>Source</dt><dd>${ne(e.provenance)}</dd></div>`+a+r+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 Oo(n){return n?n.closest("[data-report]")?"report":n.closest("[data-close]")||n.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function Zi(n,e,t){let i=n?.querySelector("[data-report]"),r=n?.querySelector("[data-report-status]");i&&(i.disabled=e!=="failed",i.textContent=e==="received"?"Report received":"Report this view"),r&&(r.setAttribute("role",e==="failed"?"alert":"status"),r.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function Gn(n,e,t=null){let i=n.view3dEl;if(!i)return;Jt(n,!1);let r=e.confidenceEvidence,s=n.controller.seatDetails(e.id),o=document.createElement("div");o.className="sl-view3d-passport-shell",o.innerHTML=Io({seat:e,title:s?.displayLabel??e.displayLabel??e.label,restrictionFallback:n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof n.api.reportViewEvidence=="function"});let a=[...new Set([...i.children,...[...n.els.map.children].filter(u=>u!==i)])].filter(u=>u instanceof HTMLElement),l=a.map(u=>({element:u,inert:u.inert,ariaHidden:u.getAttribute("aria-hidden")}));for(let u of a)u.inert=!0,u.setAttribute("aria-hidden","true");i.appendChild(o),i.classList.add("has-passport"),n.view3dPassportEl=o;let c=o.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],p=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),Jt(n);return}if(u.key!=="Tab")return;let h=d();if(!h.length)return;let g=h[0],f=h[h.length-1];u.shiftKey&&document.activeElement===g?(u.preventDefault(),f.focus()):!u.shiftKey&&document.activeElement===f&&(u.preventDefault(),g.focus())};window.addEventListener("keydown",p,!0),n.view3dPassportCleanup=()=>{window.removeEventListener("keydown",p,!0);for(let f of l)f.element.inert=f.inert,f.ariaHidden===null?f.element.removeAttribute("aria-hidden"):f.element.setAttribute("aria-hidden",f.ariaHidden);let u=t?.isConnected?t:n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareEl?.querySelector("[data-passport-seat]")??null,h=u?.closest(".sl-confirm,.sl-view3d-compare");h?.isConnected&&(h.inert=!1,h.removeAttribute("aria-hidden")),o.remove(),i.classList.remove("has-passport"),n.view3dPassportEl===o&&(n.view3dPassportEl=null);let g=u??n.view3dCompareEl?.querySelector("[data-passport-seat]")??n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareChip.mainButton();(t?.isConnected?t:g)?.focus()},o.addEventListener("click",u=>{let h=Oo(u.target instanceof HTMLElement?u.target:null);h==="close"&&Jt(n),h==="report"&&Mc(n,e)}),requestAnimationFrame(()=>d()[0]?.focus()),n.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:r?.evidenceId??null,eventConfigurationId:r?.eventConfigurationId??null,modelLevel:r?.modelLevel??"unverified",realityLevel:r?.realityLevel??"none"})}async function Mc(n,e){if(n.api.reportViewEvidence){Zi(n.view3dPassportEl,"sending");try{let t=await n.api.reportViewEvidence(n.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});n.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),Zi(n.view3dPassportEl,"received",t.report.id)}catch{Zi(n.view3dPassportEl,"failed")}}}function Jt(n,e=!0){let t=n.view3dPassportCleanup;if(n.view3dPassportCleanup=null,!t){n.view3dPassportEl?.remove(),n.view3dPassportEl=null,n.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function _o(n){let e=n.view3dEl;if(!e||n.view3dCompareSeatIds.length<2)return;Ze(n,!1);let t=n.view3dCompareSeatIds.map(h=>n.view3dComparisonSnapshot(h)).filter(h=>!!h);if(t.length<2){n.clearView3dComparison();return}let i=h=>k(h),r=t.some(h=>!!h.price),s=document.createElement("div");s.className="sl-view3d-compare-shell";let o=t.map((h,g)=>`<article><span>Seat ${g===0?"A":"B"}</span><strong>${i(h.label)}</strong><small>Section ${i(h.section)} \xB7 Row ${i(h.row)}</small><dl>`+(r?`<div><dt>Current price</dt><dd>${i(h.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${i(h.category)}</dd></div><div><dt>Availability</dt><dd>${i(h.availability)}</dd></div><div><dt>View source</dt><dd>${i(h.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${i(h.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${i(h.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${i(h.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${i(h.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${i(h.seat.id)}">Passport</button><button type="button" data-view-seat="${i(h.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${i(h.seat.id)}"${h.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");s.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${r?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${o}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(h=>h instanceof HTMLElement),c=l.map(h=>({element:h,inert:h.inert,ariaHidden:h.getAttribute("aria-hidden")}));for(let h of l)h.inert=!0,h.setAttribute("aria-hidden","true");e.appendChild(s),e.classList.add("has-comparison"),n.view3dCompareEl=s;let d=s.querySelector(".sl-view3d-compare"),p=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=h=>{if(h.key==="Escape"){h.preventDefault(),Ze(n);return}if(h.key!=="Tab")return;let g=p();if(!g.length)return;let f=g[0],x=g[g.length-1];h.shiftKey&&document.activeElement===f?(h.preventDefault(),x.focus()):!h.shiftKey&&document.activeElement===x&&(h.preventDefault(),f.focus())};window.addEventListener("keydown",u),n.view3dCompareCleanup=()=>{window.removeEventListener("keydown",u);for(let h of c)h.element.inert=h.inert,h.ariaHidden===null?h.element.removeAttribute("aria-hidden"):h.element.setAttribute("aria-hidden",h.ariaHidden);s.remove(),e.classList.remove("has-comparison"),n.view3dCompareEl===s&&(n.view3dCompareEl=null),a?.isConnected?a.focus():n.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>Ze(n)),s.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.passportSeat,f=g?n.allSeats().find(x=>x.id===g):void 0;f&&Gn(n,f,h)})),s.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.viewSeat;Ze(n,!1),g&&n.view3dHandle?.flyToSeat(g)})),s.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.selectSeat;g&&Lc(n,g)})),requestAnimationFrame(()=>p()[0]?.focus()),n.emit3dAnalytics("3d_comparison_opened",{seatIds:n.view3dCompareSeatIds.slice()})}function Ze(n,e=!0){let t=n.view3dCompareCleanup;if(n.view3dCompareCleanup=null,!t){n.view3dCompareEl?.remove(),n.view3dCompareEl=null,n.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function Lc(n,e){if(n.salesClosed){n.toast(n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=n.allSeats().find(r=>r.id===e);if(!t)return;if(Ze(n,!1),!n.controller.select([e]).length){n.syncSelectionTo3d(),n.toast(n.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}n.syncSelectionTo3d(),n.showConfirm(t),n.emit3dAnalytics("3d_comparison_selected",{seatId:e})}function Do(n,e){n.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.")},r=document.createElement("div");r.className="sl-view3d-unavailable",r.dataset.state=e.visualState,r.setAttribute("role","status"),r.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,r.append(a,l,c),l.addEventListener("click",()=>qn(n)),n.appendChild(r),wi(r,e.anchor??null)}function qn(n){let e=n?.querySelector(".sl-view3d-unavailable:not([data-leaving])");e&&(e.dataset.leaving="true",gt(e))}var ei=require("@seatlayer/core");function No(n){return Array.isArray(n)?n.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function Un(n,e,t=!1){let i=n.violations[0];return i==="numberOfPlacesToSelect"?n.remaining>0?(0,ei.t)("picker.selectExactMore",{count:n.remaining}):(0,ei.t)("picker.selectExactCount",{count:n.required}):i==="minimumSelectedPlaces"?(0,ei.t)("picker.selectMinimumMore",{count:n.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):i==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,ei.t)("picker.orphanHint")}var fe=require("@seatlayer/core");function ti(n){let e=Math.max(0,n),t=Math.floor(e/6e4),i=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${i}`}function Bo(n){let e=n.performanceLabel?`<div class="sl-chip-when">${D(n.performanceLabel)}</div>`:"",t=n.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${D(n.performanceDates.summary)}</span><span class="sl-chip-date-list">${n.performanceDates.labels.map(i=>`<span class="sl-chip-date">${D(i)}</span>`).join("")}</span></div>`:"";return e+Hc(n)+t}function Hc(n){let{d:e,area:t,label:i,objectType:r,quantity:s=1,identity:o}=n,a=C=>String(C??"\u2014").replace(/[&<>"]/g,b=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[b]),l=r==="ga"?"ga":e?.objectType??r,c=o?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?v("picker.table","Table"):l==="booth"?v("picker.booth","Booth"):l==="ga"?v("picker.generalAdmission","General admission"):v("picker.row","Row")),d=o?.rowLabel??o?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??i,p=n.categoryLabel?.trim()??"",u="",h=[];l==="table"&&o?.bookingMode?(u=`${c} ${d}`,h.push([v("picker.guests","Guests"),String(s)])):l==="ga"?(u=String(t?.displayLabel??d),s>1&&h.push([v("picker.tickets","Tickets"),String(s)])):l==="booth"?(u=e?.sectionLabel??`${c} ${d}`,e?.sectionLabel&&h.push([c,String(d)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?u=String(d):(u=e.sectionLabel??"",e.rowLabel&&h.push([c,String(ee(e)??e.rowLabel)]),e.seatNumber&&h.push([v("picker.seat","Seat"),String(e.seatNumber)]));let g=!u&&!!p,f=u||p||String(d),x=!!p&&!g&&p!==f,w=h.map(([C,b])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(C)}</span> <b>${a(b)}</b></span>`);x&&w.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(p)}</span></span>`);let y=[f,...h.map(([C,b])=>`${C} ${b}`),x?p:""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(y)}</span><span class="sl-chip-name" aria-hidden="true">${a(f)}</span>`+(w.length?`<span class="sl-chip-pos" aria-hidden="true">${w.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function Kn(n,e){let t=D(n),i=e?D(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${i}" aria-label="${D((0,fe.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>`:"")+`<button type="button" class="rm" aria-label="${t}"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function $o(n){return n.salesClosed||n.hasHold||n.ctaPhase!=="idle"||n.formOpen||n.room<=0?null:Math.max(1,Math.min(n.wanted,n.room))}function Fo({count:n,total:e,pendingCount:t,ctaPhase:i,hasHold:r,salesClosed:s,suppressPricing:o=!1,fromPrice:a,addMore:l,offerFind:c=!1,holdTime:d,money:p}){if(n&&i==="holding")return`<span>${v("picker.securingSeats","Securing your seats\u2026")}</span>`;if(n&&i==="checkout")return o?`<span>${v("picker.seatsSecuredOpeningCheckout","Seats secured. Opening checkout\u2026")}</span>`:`<span>${(0,fe.t)("picker.peekSecured",{count:n,total:p(e)})}</span>`;if(n)return`<span class="sl-peek-sum">${(0,fe.tCount)("picker.ticketsCount",n)}</span>`+(l&&!o?`<button type="button" class="go ghost sl-sheet-go sl-sheet-best" data-act="best" aria-label="${v("picker.findTogetherInstead","Find seats together instead")}"><span aria-hidden="true">\u2726</span>${v("picker.seatsTogether","Seats together")}</button>`:"")+`<button type="button" class="go sl-sheet-go" data-act="checkout">${r&&t?v("picker.secureMore","Secure more"):v("picker.continue","Continue")}`+(o?"":`<span class="sl-peek-total">${p(e)}</span>`)+(r&&d?`<span class="sl-peek-time" aria-hidden="true">${d}</span>`:"")+"</button>";if(s)return`<span>${v("picker.salesClosedPill","Sales are closed")}</span>`;let u=!o&&a!=null?p(a):null;return`<span class="sl-peek-sum">${u!=null?(0,fe.t)("picker.peekFromPrice",{price:u}).replace(u,`<b class="sl-peek-price">${u}</b>`):v("picker.pickYourSeats","Pick your seats")}</span>`+(c?`<button type="button" class="go sl-sheet-go sl-sheet-find" data-act="find"><span class="sl-peek-spark" aria-hidden="true">\u2726</span>${v("picker.findSeats","Find seats")}</button>`:"")}function Wn(n,e=Date.now()){return(0,fe.t)("picker.holdReassurance",{time:ti(n-e)})}function Vo(n){return n.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${v("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,fe.t)("picker.willFindSeatsTogether",{count:n.quantity})}</b><span>${v("picker.manualTicketsRemovedNote","Your manually selected tickets will be removed only after a new group is secured.")}</span></div><div class="sl-ba-actions"><button type="button" data-ba-cancel>${v("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${v("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${v("picker.findClosestSeatsTogether","Find the closest seats together")}</div><div class="sl-ba-copy">${v("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")}</div>`+(n.offerPremium?`<button type="button" class="sl-ba-premium${n.premium?" on":""}" data-ba-premium aria-pressed="${n.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${v("picker.bestSeatsPremium","Best seats")}</button>`:"")+`<div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${v("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${n.quantity}</span><button type="button" data-ba="1" aria-label="${v("picker.moreSeats","More seats")}">+</button></div>`+(n.categories.length>1?`<select class="sl-ba-cat" aria-label="${D(v("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${D(v("picker.anyTicketType","Any ticket type"))}</option>`+n.categories.map(e=>`<option value="${D(e.key)}"${n.selectedCategory===e.key?" selected":""}>${D(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(n.zones.length?`<select class="sl-ba-zone" aria-label="${v("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${v("picker.anyVenueZone","Any venue zone")}</option>`+n.zones.map(e=>`<option value="${D(e.id)}"${n.selectedZone===e.id?" selected":""}>${D(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${n.busy?" sl-busy":""}"${n.busy?" disabled":""}>`+(n.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${v("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,fe.tCount)("picker.findBestSeatsCount",n.quantity))+"</button>"+(n.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${v("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function zo(n){if(n.salesClosed&&!n.hasPicks){let e=n.whenText?`<span class="when">${D(n.whenText)}</span>`:"";return`<div class="sl-closed-note" role="status"><b>${v("picker.salesClosedPill","Sales are closed")}</b><span>${v("picker.salesClosedCopy","Ticket sales for this event have ended.")}${e}</span></div>`}return n.hasPicks?"":n.hasGaAreas?`<div class="sl-tray-hint">${n.seated?n.venue3d?v("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue \u2014 or grab standing tickets below."):v("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below."):n.venue3d?v("picker.gaTrayHintChoose3dArea","Choose an area in the 3D venue to select tickets."):v("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets.")}</div>`:`<div class="sl-tray-hint">${n.groupMode==="per_performance"?v("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):n.groupMode?v("picker.groupTrayHint","Choose seats once \u2014 the same seats will be held for every performance."):n.venue3d?v("picker.trayHintChoose3dOrBest","Choose a seat in the 3D venue, or let us pick the best available for you."):v("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}</div>`}function jo(n){return{title:(0,fe.t)("picker.securedCount",{count:n.secured}),copy:n.pendingCount?(0,fe.t)("picker.moreSelectedCount",{count:n.pendingCount}):Wn(n.expiresAt),change:n.releasing?v("picker.releasingEllipsis","Releasing\u2026"):v("picker.change","Change")}}var Et=require("@seatlayer/core");var Yn=4,Rc=6;function Ic(n){let e=n.trim();return/^[0-9]{1,4}$/.test(e)?Number(e):null}function Go(n){return[n.held?"h":"s",n.section,n.rowLabel,n.categoryLabel,n.amountText].join(" ")}function Oc(n){if(n.length===1)return n[0];let e=n.map(Ic);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=n.slice(0,3).join(", ");return n.length>3?`${t} +${n.length-3}`:t}function _c(n){let e=[];for(let t of n){let i=e[e.length-1];!!i&&t.groupable&&i.members[0].groupable&&Go(i.members[0])===Go(t)?i.members.push(t):e.push({members:[t],seatsLabel:""})}for(let t of e)t.seatsLabel=Oc(t.members.map(i=>i.seatLabel));return e}function Uo(n,e,t,i){let r=D;return` data-key="${r(n)}"`+(t.length?` data-held="${r(encodeURIComponent(t.join(`
2775
+ `)))}"`:"")+(e.length?` data-seat="${r(e.join(" "))}"`:"")+(i?` data-locate="${r(i)}"`:"")}function Ko(n){let e=D;return`<div class="sl-chip${n.held?" sl-held":""}${n.fresh?" sl-enter":""}"`+Uo(n.key,n.seatIds,n.heldLabels,n.locateId)+">"+(n.held?n.stateHtml:`<span class="sl-chip-dot" style="background:${k(n.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${n.identityHtml}`+(n.extrasHtml?`<div class="sl-chip-sub">${n.extrasHtml}</div>`:"")+`${n.noteHtml}</div>`+(n.amountText?`<span class="amt">${e(n.amountText)}</span>`:"")+n.railHtml+"</div>"}function qo(n,e,t,i,r){let s=D,o=e?.members.length??1,a=o>1,l=e?e.seatsLabel:n.seatLabel,c=e?e.members.reduce((u,h)=>u+h.amount,0):n.amount,d=e?e.members.flatMap(u=>u.seatIds):n.seatIds,p=e?e.members.flatMap(u=>u.heldLabels):n.heldLabels;return`<div class="sl-chip sl-tline${n.held?" sl-held":""}${n.fresh?" sl-enter":""}${e?"":" sl-tsub"}"${i?' data-overflow="true"':""}`+(e?` data-run="${t}"`:` data-run-of="${t}"`)+Uo(n.key,d,p,n.locateId)+">"+(a?`<button type="button" class="sl-trun-toggle" aria-expanded="false" aria-label="${s((0,Et.tCount)("picker.seatsSelectedCount",o))}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg></button>`:n.held?n.stateHtml:`<span class="sl-tline-dot" style="background:${k(n.categoryColor)}" aria-hidden="true"></span>`)+`<span class="sl-sr">${s(n.categoryLabel)}</span><span class="sl-tline-id"><b>${s(n.section||n.seatLabel)}</b>`+(n.rowLabel?`<i>\xB7</i><span>${s(n.rowLabel)}</span>`:"")+(n.section&&l?`<i>\xB7</i><span>${s(l)}</span>`:"")+"</span>"+n.extrasHtml+(r.suppressPricing||!n.amountText?"":(a?`<span class="sl-tline-mult">${o}\xD7</span>`:"")+`<span class="amt">${s(r.money(c))}</span>`)+(n.railHtml?`<button type="button" class="rm" aria-label="${s(a?(0,Et.t)("picker.removeSeatLabel",{label:[n.section,n.rowLabel,l].filter(Boolean).join(" \xB7 ")}):n.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 Wo(n,e){if(!n.length)return"";let t=_c(n),i=[v("picker.section","Section"),v("picker.row","Row"),v("picker.seat","Seat")].join(" \xB7 "),r=t.length>=Rc,s=t.map((a,l)=>{let c=r&&l>=Yn;return qo(a.members[0],a,l,c,e)+(a.members.length>1?a.members.map(d=>qo(d,null,l,c,e)).join(""):"")}).join(""),o=r?`<button type="button" class="sl-tmore" data-tmore aria-expanded="false" data-more="${D((0,Et.t)("picker.moreCount",{count:t.length-Yn}))}" data-less="${D(v("picker.showLess","Show less"))}"><span>${D((0,Et.t)("picker.moreCount",{count:t.length-Yn}))}</span><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg></button>`:"";return`<div class="sl-tlist"${r?' data-collapsed="true"':""}><div class="sl-tlist-head sl-sr">${D(i)}</div>${s}${o}</div>`}function Yo(n){n.dataset.denseWired!=="true"&&(n.dataset.denseWired="true",n.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 r=t.closest(".sl-trun-toggle");if(!r)return;e.stopPropagation();let s=r.closest(".sl-tline"),o=s?.dataset.run;if(!s||o===void 0)return;let a=r.getAttribute("aria-expanded")!=="true";r.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 Je=require("@seatlayer/core");var Dc='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="13" cy="4.4" r="1.9"/><path d="M11 8.2v5.1h5.1"/><path d="M16.6 13.3l1.9 6.3"/><path d="M15.4 14.9a5.6 5.6 0 1 1-5.9-3.4"/></svg>',Nc='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="8.4"/><circle cx="8.6" cy="10.2" r="1.15"/><circle cx="12" cy="8.2" r="1.15"/><circle cx="15.4" cy="10.2" r="1.15"/><path d="M12 20.4a2.6 2.6 0 0 1 0-5.2 2.2 2.2 0 0 0 0-4.4"/></svg>',Ji=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let i=this.offered().length>0;this.button.setAttribute("aria-label",i?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options")),this.button.innerHTML=i?Dc:Nc,this.menu=document.createElement("div"),this.menu.className="sl-a11ymenu",this.menu.hidden=!0;for(let r of this.stored())this.offeredFree().has(r)&&this.active.add(r);if(this.menu.innerHTML=$s(this.rows()),this.root.append(this.menu,this.button),e.appendChild(this.root),this.button.addEventListener("click",r=>{r.stopPropagation(),this.open(this.menu.hidden)}),this.menu.addEventListener("pointerdown",r=>r.stopPropagation()),this.menu.addEventListener("click",r=>r.stopPropagation()),this.dismiss=()=>this.open(!1),this.escape=r=>{r.key==="Escape"&&this.open(!1)},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let r=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(r):r()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:i,count:r})=>[i,r])),t=!1;for(let i of this.menu.querySelectorAll("[data-a11y-row]")){let r=i.dataset.a11yRow??"";if(!r.startsWith("a11y:"))continue;let s=r.slice(5),o=e.get(s);if(o===void 0)continue;let a=this.countNode(i),l=o==null?"":o>0?(0,Je.t)("picker.accessFreeCount",{count:o}):this.deps.tf("picker.accessNoneLeft","None left");a&&(a.textContent=l);let c=o===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(s,l))),i.disabled=c,c?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),c&&this.active.delete(s)&&(this.paint(i,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let i=t.dataset.a11yRow??"";i.startsWith("a11y:")&&this.paint(t,this.active.has(i.slice(5)))}}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();hn(this.menu,{x:t.left+t.width/2,y:t.top}),yr(this.menu),wi(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:r})=>({key:i,count:r}));let t=this.deps.present;return t?Je.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(Je.ACCESSIBILITY_TYPES.map(i=>[i.key,i]));return this.offered().flatMap(({key:i,count:r})=>{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")}:{},...r==null?{}:{count:r>0?(0,Je.t)("picker.accessFreeCount",{count:r}):this.deps.tf("picker.accessNoneLeft","None left"),disabled:r===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),r=!this.active.has(i);r?this.active.add(i):this.active.delete(i),this.paint(e,r),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let i=(e.dataset.a11yRow??"").slice(5),r=document.createElement("div");r.className="sl-a11yrow-w",e.replaceWith(r);let s=document.createElement("button");s.type="button",s.className="sl-a11yrow-c sl-a11yjump",s.dataset.a11yJump=i,s.textContent=t.textContent,s.disabled=e.disabled,s.setAttribute("aria-label",this.jumpLabel(i,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(i,s.textContent??"")),r.append(e,s),s.addEventListener("click",o=>{o.stopPropagation(),this.active.has(i)||(this.active.add(i),this.paint(e,!0),this.applyFilter({focus:!1}));let a=this.deps.stepToAccessibleSection?.(i);a&&s.setAttribute("aria-label",this.jumpLabel(i,s.textContent??"",a.label))})}}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){return Je.ACCESSIBILITY_TYPES.find(t=>t.key===e)?.label??e}jumpLabel(e,t,i){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...i?[`${this.deps.tf("picker.section","Section")} ${i}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};var Qo=require("@seatlayer/core"),Bc=250;function Xo(n,e=Bc){let t=null,i=()=>{t===null&&(t=setTimeout(()=>{t=null,n()},e))},r=(0,Qo.attachVisibilityCatchUp)(i),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",i),()=>{t!==null&&(clearTimeout(t),t=null),r(),s&&window.removeEventListener("focus",i)}}var et=require("@seatlayer/core");var en=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,et.holdRecoveryShape)(e),i=e.lapsedLabels.length,r=i-e.recoverable.length,s=t==="all"?(0,et.tCount)("picker.holdLapsedStillFree",i):t==="partial"?(0,et.tCount)("picker.holdLapsedSomeTaken",r):(0,et.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>${D(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${D(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,et.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 Zo=Symbol("seatlayer.performance-group-picker");function tn(n,e){return Object.defineProperty(n,Zo,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),n}function Jo(n){return n[Zo]??null}var ea="@seatlayer/pending-checkout/v1";function $c(n){return typeof n=="string"&&n.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(n)}function ta(n){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let i=null;try{let r=window.sessionStorage.getItem(ea);if(r){let s=null;try{s=JSON.parse(r)}catch{}if(s&&$c(s.orderId)){let o=Date.now()-Number(s.storedAt);if(o>=0&&o<=144e5){if(s.eventKey&&s.eventKey!==n)return null;i=s.orderId}}}window.sessionStorage.removeItem(ea)}catch{}e.delete("seatlayer_checkout");try{let r=e.toString();history.replaceState(history.state,"",`${location.pathname}${r?`?${r}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:i}}function ia(n){if(!n.framed)return null;let e=n.ancestorOrigins?.length?n.ancestorOrigins[0]:null;for(let t of[e,n.referrer])if(t)try{return new URL(t).origin}catch{}return null}var Fc="https://api.seatlayer.io",Vc=10,zc=250,na=6e4,ra=6e4,sa=4,jc=10,Gc=40,qc=220,aa="seatmap.a11y.cb";function Uc(){try{if(typeof window>"u")return null;let n=window.localStorage.getItem(aa);return n==null?null:n==="1"}catch{return null}}function Kc(n){try{window.localStorage.setItem(aa,n?"1":"0")}catch{}}var Ve=class n{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.offerReadInFlight=null;this.offerReadSettledAt=0;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.holdConflicted=!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.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedReport=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.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 Wi({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.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=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 en({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.fitScheduled=!1;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=Jo(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??Fc).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},i=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?bi({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:i?.access??ft(e,t),this.pubApi=e.transport?null:i?.api??new De(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 yt(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 r=e.numberOfPlacesToSelect;if(r!=null&&(!Number.isInteger(r)||r<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=r??null;let s=No(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(Vc,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=Uc()??!!e.colorblindSafe,this.controller=this.wireController(e)}get confirmEl(){return this.confirmCard.element}set confirmEl(e){this.confirmCard.element=e}get confirmSeat(){return this.confirmCard.candidate}set confirmSeat(e){this.confirmCard.candidate=e}get lastSection(){return this.sectionCard.summary}set lastSection(e){this.sectionCard.adopt(e)}deliverableViewReference(e){return St(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=ia({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let i=t<640?1.2:.62;return Math.max(420,Math.round(t*i))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-sa&&t.width>=window.innerWidth-sa}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let i=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=i,e.tabIndex=i?-1:0,e.setAttribute("aria-hidden",String(i))}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)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e}),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){wt();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let r=document.createElement("div");r.className="sl-modal-frame",r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"),r.setAttribute("aria-label",v("picker.seatSelection","Seat selection")),r.tabIndex=-1,i.appendChild(r),document.body.appendChild(i);let s=document.body.style.overflow;document.body.style.overflow="hidden";let o=new n({...e,container:r});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 g=[...r.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(f=>f.isConnected&&!f.closest('[hidden], [aria-hidden="true"], [inert]'));return g[g.length-1]??r},c=(g,f)=>{let x=g;for(;x;){let w=window.getComputedStyle(x);if(x.hidden||x.getAttribute("aria-hidden")==="true"||x.hasAttribute("inert")||w.display==="none"||w.visibility==="hidden"||w.visibility==="collapse")return!0;if(x===f)return!1;x=x.parentElement}return!0},d=g=>[...g.querySelectorAll(a)].filter(f=>f.tabIndex>=0&&!f.matches(":disabled")&&!c(f,g)),p=(g,f)=>{let x=d(g),w=f?x[x.length-1]:x[0];w?w.focus({preventScroll:!0}):(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus({preventScroll:!0}))},u=!1,h=()=>{if(u)return;u=!0,document.body.style.overflow=s,o.escHandler&&document.removeEventListener("keydown",o.escHandler),i.remove(),o.modalScrim=null;let g=o.prevFocus;o.prevFocus=null,g?.isConnected&&g.focus({preventScroll:!0});let f=()=>{o.destroy(),e.onClose?.()};o.hold&&!o.handedOff?o.release().finally(f):f()};return o.closeModal=h,i.addEventListener("mousedown",g=>{g.target===i&&h()}),o.escHandler=g=>{if(g.key==="Tab"){if(g.defaultPrevented)return;let f=l(),x=d(f),w=x[0],y=x[x.length-1],C=document.activeElement;!w||!y?(g.preventDefault(),p(f,g.shiftKey)):C===f||!C||!f.contains(C)?(g.preventDefault(),(g.shiftKey?y:w).focus({preventScroll:!0})):g.shiftKey&&C===w?(g.preventDefault(),y.focus({preventScroll:!0})):!g.shiftKey&&C===y&&(g.preventDefault(),w.focus({preventScroll:!0}));return}g.key==="Escape"&&(o.tableDialog?(g.preventDefault(),o.cancelTableDialog()):o.confirmSeat?(g.preventDefault(),o.cancelConfirm()):o.bestAvailableConfirm?(g.preventDefault(),o.bestAvailableConfirm=!1,o.syncTray()):(g.preventDefault(),h()))},document.addEventListener("keydown",o.escHandler),await o.render(),o.els.close?.classList.add("on"),o.els.close?.addEventListener("click",h),p(l(),!1),o}wireController(e){return new M.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:ct(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let i=this.controller.getGAAreas().find(r=>r.id===t);i&&(this.collapseSheet(),fn(this,i,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),ys(t)&&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.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.lapse.deferExpiryToast(()=>this.toast((0,M.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=>{if(this.controller.currentHold()?.labels.includes(t.label)){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast((0,M.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=T=>Math.round((performance.now()-T)*100)/100;this.rendered=!0,wt();let r=performance.now(),s=mi(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=qr(this.opts.container),{root:c,els:d,mapHost:p}=ur(l,(T,I)=>this.tf(T,I),this.opts.theme);this.root=c,this.els=d,this.mapHost=p,fi(c,s,T=>{t.loadLocale=i(r),this.destroyed||this.applyActiveLocale(T,o)}),Co(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 u=document.createElement("div");u.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(u),t.mountBuyerShell=i(a),t.skeletonPaint=i(e),this.startRealtime();let h=await this.loadChart(u,t,i);if(!h)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=i(e);let g=performance.now();if(this.salesClosed=!!h.salesClosed||!!this.opts.readOnly,c.dataset.eventMode=h.mode==="test"?"test":"live",!this.opts.locale&&h.locale&&this.setLocale(h.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),h.mode==="test"){let T=document.createElement("div");T.className="sl-testbadge",T.textContent=Gr((0,M.t)("picker.testMode"),(0,M.getLocale)()),T.setAttribute("aria-label",(0,M.t)("picker.testMode")),T.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"),this.regions["top-left"].appendChild(T)}let f=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(c),this.watchThemeMode(),this.currency=h.currency??this.opts.currency??"USD",this.eventTimezone=h.timezone??null,Ur(this.els.logo,[this.opts.theme?.logoUrl,f?.logoUrl,h.posterUrl],this.opts.theme?.brandName??f?.brandName??h.eventName??"?"),this.els.name.textContent=h.eventName??"";let x=h.startsAt?Ei(h.startsAt,h.timezone??null,this.opts.locale):"";this.eventWhenText=x||null,this.els.meta.textContent=[h.venue,x].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(f);let w=!!this.controller.doc&&this.controller.getExpandedSeats().some(T=>T.commercial?.restrictedView||T.commercial?.obstructedView);this.buildAccessibilityMenu(w),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(g);let y=performance.now();if(await this.restoreRememberedHold(),t.restoreHold=i(y),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let C=this.controller.doc,b=Ii(this.opts.event),H=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),S=H??"event",O={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:S,surface:H==="season"?"season_picker":H==="performance_group"?"performance_group_picker":"seat_picker",ms:i(e),performanceProfile:t,chartDelivery:h.chartDelivery,seatCount:this.allSeats().length,objectCount:C?.objects.length??0,sectionCount:C?.objects.filter(T=>T.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:C?.name,view:this.buyerView,load:b,transport:this.opts.transport?"custom":"pubapi"};Ho(O,(T,I)=>this.emitAnalytics(T,I));let P=h.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",jn({...O,performanceProfile:{...O.performanceProfile,...P}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=h,await this.registerAgentTools(),this}registerAgentTools(){return Lo(this)}webMcpHost(e){return zn(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=Xo(()=>{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 r=this.els.sheetToggle,s=c=>{e.dataset.sheet=c?"open":"peek",r?.setAttribute("aria-expanded",String(c)),r?.setAttribute("aria-label",c?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))};s(e.dataset.sheet==="open"),r?.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"||d.dataset.act==="find"?(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")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),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 r=this.root.getAttribute("data-prices-open")==="true";if(this.root.setAttribute("data-prices-open",String(!r)),this.els.pricesSec?.setAttribute("aria-expanded",String(!r)),!r&&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",r=>{r.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||r.target.closest("select,button")||(r.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",r=>{this.handleMapPointerDown(r)},!0),this.els.map.addEventListener("mousemove",r=>{if(this.tipPinned)return;let s=this.els.map.getBoundingClientRect();this.tipPos={x:r.clientX-s.left,y:r.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 r=e.clientHeight,s=i!==this.pickerLayoutSize.width||r!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:r},this.reportFramedHeight();let o=i<640?"narrow":"wide",a=r<560?"compact":"comfortable";(e.dataset.layout!==o||e.dataset.density!==a)&&(e.dataset.layout=o,e.dataset.density=a,this.controller.getRenderer()?.setSectionFocusDim?.(o!=="narrow"),o==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray()),this.syncFullscreenAffordance(),s&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),t(),requestAnimationFrame(t)}async loadChart(e,t,i){let r=performance.now(),s=await this.controller.render(e);return t.loadChartAndStatuses=i(r),this.destroyed?null:s?(Object.assign(t,s.performanceProfile),s):(Le({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:$e(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 n({...a,container:o}).render()}),null)}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=ta(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 Ji(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(i,r)=>this.tf(i,r),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:i=>this.setColorblindSafe(i),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:i=>{this.limitedViewFilter=i,this.controller.setCommercialLimitedFilter(i),this.pushAvailabilityTo3d()},applyAccessibilityFilter:i=>this.applyAccessibilityFilter(i),focusSeatsForFilter:()=>this.focusSeatsForFilter(),stepToAccessibleSection:i=>this.controller.focusNextAccessibleSection?.([i])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast((0,M.t)("picker.accessSpreadHint",{count:e.spaces,sections:e.sections.length}),"neutral")}applyAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}setAccessibilityFilter(e){this.applyAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),e?.length&&this.focusSeatsForFilter()}focusAccessibilityFilter(){this.focusSeatsForFilter()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,i=this.els.headInfo?.parentElement;t&&i&&t.parentElement!==i&&(t.classList.add("sl-fs-pill"),i.insertBefore(t,this.els.hold??null));let r=this.els.pricesSec;r&&(e?(r.setAttribute("role","button"),r.tabIndex=0,r.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(r.removeAttribute("role"),r.removeAttribute("aria-expanded"),r.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><ul class="sl-booked-list" data-ref="bookedList"></ul><button type="button" class="sl-booked-back" data-ref="bookedBack"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${D(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}tf(e,t){return v(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),i=document.createElement("div");i.className="sl-soldout-eyebrow",i.textContent=t;let r=document.createElement("div");r.className="sl-soldout-title",r.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,r,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,r=this.isSoldOut(e,t,i);r!==this.soldOut&&(this.soldOut=r,this.soldoutEl?.classList.toggle("on",r))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(r=>(t[r.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 r=document.createElement("span");r.className="sl-powered-mark",r.setAttribute("aria-hidden","true"),r.innerHTML=ki;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),i.append(r,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){let t=this.reducedMotion(),i=(e.items??[]).filter(r=>r.objectType!=="ga").slice(0,10).map(r=>this.controller.seatByLabel(r.label)).filter(r=>!!r);ts({regions:this.els,categories:this.controller.doc?.categories,pop:r=>this.controller.flashSeat(r,this.cssVar("--sl-accent")||"#f4b740"),focus:(r,s)=>this.controller.focusSection(r,s),focusSeats:r=>this.controller.focusSeats?.(r,{animate:!t})===!0,reducedMotion:t,screenPoint:r=>this.controller.worldToScreen(r),schedule:(r,s)=>this.scheduleMotion(r,s)},i)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(i=>i.id!==e&&i.id!==t)}pendingSelectionCount(){let e=this.hold?.items??[],t=new Set(e.map(r=>r.label));return this.committedSelection().filter(r=>!t.has(r.label)).reduce((r,s)=>r+(s.quantity??1),0)+We(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,r)=>i+(r.quantity??1),0);return this.heldTicketCount()+t+We(this.gaQty,this.hold?.items??[])}updateSelectionCapacity(){let e=new Set((this.hold?.items??[]).map(r=>r.label)),t=this.committedSelection().filter(r=>e.has(r.label)).reduce((r,s)=>r+(s.quantity??1),0),i=Math.max(0,this.maxTickets-this.heldTicketCount()-We(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 r=!this.hold&&this.performanceGroup?.selectionMode==="per_performance"?this.performanceGroup.submissionState?.():null;if(r&&!r.ready){i.disabled=!0,i.textContent=this.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(r.complete)).replace("{total}",String(r.total));return}let s=this.controller.getSelectionValidity(e);if(s&&!s.isValid){i.disabled=!0,i.textContent=Un(s,(o,a)=>this.tf(o,a),!0);return}i.disabled=e===0,i.textContent=this.hold?t?(0,M.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())}async runCheckoutHandoff(e,t){this.setCtaPhase("checkout");try{await this.checkoutHandoff(e,t)}finally{this.ctaPhase==="checkout"&&!this.bookedShown&&this.setCtaPhase("idle")}}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 r={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return this.hold=r,this.handedOff=!0,this.bookedShown=!1,this.ctaPhase="idle",this.startHoldTimer(r.expiresAt),this.rememberHold(r),this.syncTray(),this.emitHoldChange(),this.opts.onHoldRestored?.(r,r.seats??[],this.buildHandoff(r)),t&&this.toast(this.tf("picker.heldTicketsRestored","Your held tickets have been restored."),"success"),r}catch(i){let r=i?.status;return r===404||r===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(r=>r.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=vo({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return Qi(this,e)}catPriceRange(e){return Xi(this,e)}buildPriceFilter(){if(this.suppressPricing||!this.els.prices||!this.els.pricesSec)return;let e=hs(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 r of e){let s=document.createElement("option");s.value=r.id,s.textContent=r.label,t.appendChild(s)}this.els.pricesSec.appendChild(t),this.priceSelect=t,t.addEventListener("change",()=>{this.applyPriceBand(e.find(r=>r.id===t.value)?.keys??null)})}applyPriceBand(e){if(this.focusedCatKey=null,this.priceBandKeys=e?new Set(e):null,this.priceSelect){let t=e?this.priceSelect.value:"all";this.priceSelect.value!==t&&(this.priceSelect.value=t)}this.controller.setCategoryFilter(e),this.controller.focusCategoryFilter(e),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(r=>r.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(r=>{if(r.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])r.addEventListener(s,Ti,{once:!0});r.addEventListener("click",()=>{this.setBuyerView(r.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)],r=new Set((e.zones??[]).map(d=>d.id)),o=i.some(d=>d.type==="section"&&typeof d.zone=="string"&&r.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,M.t)("picker.zoomLevel"));let l={zones:(0,M.t)("picker.rungLabel.zones"),sections:(0,M.t)("picker.rungLabel.sections"),seats:(0,M.t)("picker.rungLabel.seats")},c={zones:(0,M.t)("picker.rungTip.zones"),sections:(0,M.t)("picker.rungTip.sections"),seats:(0,M.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 p=d.dataset.rung;this.controller.setRung(p),p==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(a),this.rungsEl=a,this.syncRung()}if(this.controller.isMultiFloor()){let i=Fs({floors:this.controller.getFloors(),tf:(r,s)=>this.tf(r,s),onChoose:r=>{r===""?this.controller.setFloorOverview(!0):this.controller.setFloor(r),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 r=i.dataset.rung===e;i.classList.toggle("on",r),i.setAttribute("aria-pressed",String(r))})}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||!Si()?!1:this.allSeats().length<=this.max3dSeats()}max3dSeats(){let e=this.opts.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?ra/2:ra}syncFloors(){Vs(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new zi({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(r=>r.type==="section"&&!this.controller.isSectionClosed(r.id)&&this.controller.getSectionSeatCount(r.id)>0);if(t.length<2)return null;let i=t.findIndex(r=>r.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}markedSeatAnnouncement(e){let t=_n(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return Xs(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(h=>h.key===e.categoryKey),r=this.controller.getStatus(e.id)??"free",s=r==="free"?this.tf("picker.statusAvailable","available"):r==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),o=i?this.catPriceRange(i):void 0,a=!this.suppressPricing&&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=Qe(c),p=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,u=l?`${d} ${p}, ${l.bookingMode==="variable"?(0,M.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,M.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${p}`:c?.objectType==="table"?`${d} ${p}, ${(0,M.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,M.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${u}, ${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 r=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=Ns(e,{variable:s,held:t,typeWord:Qe(e),categoryLabel:r?.label??e.categoryKey,suppressPricing:this.suppressPricing,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 r=t.querySelector("input[data-table-qty]");r&&(r.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 r=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!r){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},this.startHoldTimer(r.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,M.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(r){this.opts.onError?.(r),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){i&&(i.disabled=!1,i.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new Ui({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,i,r)=>this.paidPrice(e,t,i,r),suppressPricing:()=>this.suppressPricing,reducedMotion:()=>this.reducedMotion(),scheduleMotion:(e,t)=>this.scheduleMotion(e,t),canOffer3d:()=>this.canOffer3d(),buyerView:()=>this.buyerView,view3dHandle:()=>this.view3dHandle,view3dCompareSeatIds:()=>this.view3dCompareSeatIds,rememberView3dReturnSeat:e=>{this.view3dReturnSeat=e},enter3d:e=>{this.enter3d(e)},performanceGroup:()=>this.performanceGroup,seatViewEnabled:()=>this.seatViewEnabled(),openSeatView:e=>{this.openSeatView(e)},openSeatConfidencePassport:(e,t)=>this.openSeatConfidencePassport(e,t),saveView3dComparisonSeat:e=>this.saveView3dComparisonSeat(e),resolveAssetUrl:e=>this.buyerAssetUrls.resolve(e),onError:e=>this.opts.onError?.(e),liftToastOverConfirm:()=>this.liftToastOverConfirm(),fitTranslatedRows:()=>this.fitTranslatedRows(),syncTray:()=>this.syncTray(),syncSelectionTo3d:()=>this.syncSelectionTo3d(),collapseSectionCard:()=>this.collapseSectionCard(),applyPanelCollapsed:()=>this.applyPanelCollapsed(),dismiss:()=>this.dismissConfirm(),reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e)})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){fo(e,t,this.reducedMotion())}addSeatLabel(e){return go(e,(t,i)=>this.tf(t,i))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,i=this.controller.doc,r=this.controller.getActiveFloorId(),s=e.focalPoint??i?.floors?.find(p=>p.id===r)?.focalPoint??i?.focalPoint??{x:0,y:0},o,a,l=!1;if(e.viewUrl){let p,u=null;try{let g=e.viewMeta?.previewUrl;g&&g!==e.viewUrl?(u=await this.buyerAssetUrls.resolve(g),p=e.viewUrl):p=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(g){t===this.seatViewGen&&this.opts.onError?.(g);return}if(t!==this.seatViewGen||!p||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!u||!this.root||!this.seatViewEnabled())return;let h={url:p,...u?{previewUrl:u}:{},...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=h,a=(0,ii.seatViewDisclosure)(h),l=(0,ii.isAuthoredSeatView)(h)}else{let p;try{let{generateSeatPanorama:u}=await Ci();p=u(e,s,this.allSeats())}catch(u){t===this.seatViewGen&&this.opts.onError?.(u);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;o={url:p.url,generated:!0},a=(0,M.t)("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=(0,M.t)("picker.viewFromSeat",{label:e.label}),d=Mi({root:this.root,source:o,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:kt(),viewFromSeatLabel:c,real360Label:(0,M.t)("picker.real360"),previewLabel:(0,M.t)("picker.preview"),resolveAsset:p=>this.buyerAssetUrls.resolve(p),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,M.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(r,s)=>`${r} ${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=ws(e,t);if(i==null)return;let r=6*36e5,s=Math.min(Math.max(i-t+1e3,1e3),r);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},s)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<zc}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let i=Fi(t);if(!i)return;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i);let r=Vi(i),s={...this.hostPricing?.prices??{},...r},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;if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,i=t?.release??null,r=i?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!r){e.classList.remove("has"),e.replaceChildren();return}let s=i??r,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 p=[];i&&t.fromPrice!=null&&p.push(this.money(t.fromPrice/100)),i&&s.remaining!=null&&p.push((0,M.t)("picker.offerRemainingAvailable",{count:s.remaining})),i&&s.endsAt!=null&&p.push((0,M.t)("picker.offerUntil",{time:Ei(s.endsAt,this.eventTimezone,this.opts.locale)})),r?.startsAt!=null&&p.push((0,M.t)("picker.offerStarts",{time:Ei(r.startsAt,this.eventTimezone,this.opts.locale)})),d.textContent=p.join(" \xB7 "),a.append(l,c,d);let u=document.createElement("details");u.className="sl-offer-info";let h=document.createElement("summary");h.setAttribute("aria-label",(0,M.t)("picker.howOfferWorks",{name:c.textContent??""})),h.textContent="i";let g=document.createElement("div");g.className="sl-offer-detail",g.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."),u.append(h,g),o.append(a,u),e.replaceChildren(o),e.classList.add("has")}paidPrice(e,t,i,r){let s=r?this.channelByObject.get(r):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:D}}syncPriceRail(e,t,i=this.legendDeps()){let r=this.els.railScroll,s=e.length>1;if(this.els.rail?.classList.toggle("has",s),!r)return;r.innerHTML=s?ps({...i,categories:e,left:t,activeKey:this.focusedCatKey,soldOutWord:this.tf("picker.soldOut","Sold out"),allWord:this.tf("picker.allPrices","All prices"),allActive:!this.focusedCatKey&&!this.priceBandKeys}):"";let o=e.map(a=>a.key).join("|");this.lastRailSignature!==o&&(this.lastRailSignature=o,r.scrollLeft=0),r.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){this.applyPriceBand(null);return}this.focusCategory(a.dataset.cat??"")})}),this.railEdgesBound||(this.railEdgesBound=!0,r.addEventListener("scroll",()=>An(r),{passive:!0})),requestAnimationFrame(()=>An(r))}syncPrices(){let e=this.controller.doc;if(!e||!this.els.prices)return;let t=this.controller.categoryAvailability(),i=e.categories.filter(p=>!p.notForSale);this.narrateAvailability(i,t),this.syncSoldout(i,t);let r=this.legendDeps(),s=this.suppressPricing,o=s?{...r,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:r;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=ds({...o,categories:d,left:t,collapsed:c,activeKey:this.focusedCatKey,bandKeys:this.priceBandKeys,leftCount:p=>(0,M.tCount)("picker.leftCount",p),titleFor:(p,u)=>u?this.tf("picker.showAllSeats","Show all seats"):(0,M.t)("picker.showLabelSeatsOnMap",{label:p.label}),moreLabel:l>1?c?s?this.tf("picker.showAllCategories","Show all categories"):(0,M.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(p=>{p.addEventListener("mouseenter",()=>this.controller.getRenderer()?.setCategoryHighlight?.(p.dataset.cat??null)),p.addEventListener("mouseleave",()=>this.controller.getRenderer()?.setCategoryHighlight?.(null));let u=()=>this.focusCategory(p.dataset.cat??"");p.addEventListener("click",u),p.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),u())})}),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,r=this.lastCatAvail;this.lastCatAvail={...t};let s=this.controller.getActiveFloorId();if(s!==this.lastAvailFloorId&&(this.lastAvailFloorId=s,this.availQuietUntil=performance.now()+2e3),!(!i||!r||performance.now()<this.availQuietUntil))for(let o of e){let a=r[o.key],l=t[o.key]??0;if(a===void 0||l>=a)continue;let c=a-l;i.textContent=(0,M.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,M.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:i,heldLabels:r,heldCount:s,total:o,count:a}=Yi(this),l=[],c=new Set;if(!this.salesClosed){let b=this.performanceGroup?.nightSummary?.()??[];b.length&&l.push(qs(b,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let H=this.performanceGroup?.selectionModeSwitch;H&&l.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${D(H.label)}</button>`)}l.push(zo({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(b=>b.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0}));let d=!e.length&&!i.length&&!We(this.gaQty,this.hold?.items??[]);if((d||this.root?.dataset.layout==="narrow")&&(this.baReopen=!1),!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm)){let b=(this.controller.doc?.categories??[]).filter(S=>!S.notForSale),H=this.controller.getBestAvailableZones();this.baZone&&!H.some(S=>S.id===this.baZone)&&(this.baZone=""),l.push(Vo({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:this.baReopen,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:b,zones:H,selectedCategory:this.baCat,selectedZone:this.baZone}))}let p=(b,H,S,O=1,P,T,I)=>Bo({categoryLabel:I,d:b?this.controller.seatDetails(b):null,area:S==="ga"?t.find(_=>_.id===P):void 0,label:H,objectType:S,quantity:O,identity:T,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),u=D,h=[];for(let b of Cr(i)){let H=b.objectType==="ga"?`held:ga:${b.objectId}:${b.tierId??""}`:`held:${b.label}`;c.add(H);let S=this.controller.doc?.categories.find(U=>U.key===b.categoryKey),O=b.tierId?S?.tiers?.find(U=>U.id===b.tierId)?.name:void 0,P=b.objectType!=="ga"?this.controller.seatByLabel(b.label):null,T=b.objectType==="table"?this.controller.tableSelection(b.label):null,I=P?this.controller.seatDetails(P.id):null,_=this.seatViewEnabled()&&!!P&&b.objectType!=="table"&&!!this.deliverableViewReference(P),F=u(this.tf("picker.heldForYou","Held for you")),Q=(T?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(b.label))}">${u((0,M.t)("picker.guestsCountEdit",{count:b.quantity??1}))}</button>`:"")+Xt(P?.wheelchairSpaceType)+Hn(P?.commercial),J=this.paidPrice(b.categoryKey,b.tierId,b.unitPrice,b.label)*(b.quantity??1);h.push({key:H,fresh:!this.lastTrayKeys.has(H),held:!0,seatIds:[],heldLabels:b.labels,removeAria:(0,M.t)("picker.removeHeldTicketLabel",{label:mn(b,t)}),locateId:P?.id??null,section:I?.sectionLabel??"",rowLabel:I&&ee(I)||"",seatLabel:I?.seatNumber??b.label,categoryLabel:`${S?.label??b.categoryKey}${O?` \xB7 ${O}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(b.categoryKey)??S?.color??"",identityHtml:p(P?.id??null,b.label,b.objectType,b.quantity??1,b.objectId,T??void 0,`${S?.label??b.categoryKey}${O?` \xB7 ${O}`:""}`),stateHtml:`<span class="sl-ticket-state held" aria-label="${F}" title="${F}"><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:Q,amount:J,amountText:this.suppressPricing?"":this.money(J),noteHtml:Rn(P?.commercial),railHtml:this.performanceGroup?"":Kn((0,M.t)("picker.removeHeldTicketLabel",{label:mn(b,t)}),_?b.label:null),groupable:!Q&&!!I?.sectionLabel&&!this.performanceGroup})}let g=this.seatViewEnabled();for(let b of e.filter(H=>!r.has(H.label))){let H=`seat:${b.id}`;c.add(H);let S=this.controller.doc?.categories.find(U=>U.key===b.categoryKey),O=b.tiers&&b.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${u(b.id)}" aria-label="${u((0,M.t)("picker.ticketTierFor",{label:b.label}))}">`+b.tiers.map(U=>`<option value="${u(U.id)}"${U.id===b.tierId?" selected":""}>${u(U.name)} \xB7 ${u(this.money(this.paidPrice(b.categoryKey,U.id,U.price,b.label)))}</option>`).join("")+"</select>":"",P=b.tiers?.find(U=>U.id===b.tierId)??b.tiers?.[0],T=P?.buyerMessage?.trim()||(P?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),I=this.controller.seatDetails(b.id),_=u(this.tf("picker.selected","Selected")),F=(0,M.t)("picker.removeSeatLabel",{label:b.label}),Q=(b.objectType==="table"&&b.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(b.label))}">${u((0,M.t)("picker.guestsCountEdit",{count:b.quantity??1}))}</button>`:"")+Xt(b.wheelchairSpaceType)+Hn(b.commercial)+O,J=this.paidPrice(b.categoryKey,b.tierId??null,b.price,b.label)*(b.quantity??1);h.push({key:H,fresh:!this.lastTrayKeys.has(H),held:!1,seatIds:[b.id],heldLabels:[],locateId:b.id,section:I?.sectionLabel??"",rowLabel:I&&ee(I)||"",seatLabel:I?.seatNumber??b.label,categoryLabel:S?.label??b.categoryKey,identityHtml:p(b.id,b.label,b.objectType,b.quantity??1,b.objectId,b,S?.label??b.categoryKey),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(b.categoryKey)??S?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${_}" title="${_}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:Q,amount:J,amountText:this.suppressPricing?"":this.money(J),removeAria:F,noteHtml:Rn(b.commercial)+(T?`<small class="sl-tier-note">${u(T)}</small>`:""),railHtml:Kn(F,g&&b.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(b.label)??{})?b.label:null),groupable:!Q&&!T&&!!I?.sectionLabel&&!this.performanceGroup})}h.length&&l.push(this.root?.dataset.layout==="narrow"?Wo(h,{money:b=>this.money(b),suppressPricing:this.suppressPricing}):h.map(Ko).join("")),t.length&&l.push(Lr(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>${u(this.tf("picker.findTogetherInstead","Find seats together instead"))}</button>`),this.els.tray.innerHTML=l.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=c,Yo(this.els.tray),this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let f=this.performanceGroup?.selectNight;f&&io(this.els.tray,b=>f(b)),this.els.tray.querySelectorAll("[data-ba]").forEach(b=>{b.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(b.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",b=>{this.baCat=b.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",b=>{this.baZone=b.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(b=>{b.addEventListener("click",()=>{let H=b.closest(".sl-chip");if(H.dataset.held){this.removeHeldLabels(decodeURIComponent(H.dataset.held).split(`
2776
+ `),H);return}let S=H.dataset.seat.split(" "),O=this.controller.getSelection().find(T=>T.id===S[0])?.label??this.tf("picker.seat","Seat"),P=()=>{this.controller.deselect(S),this.toast((0,M.t)("picker.labelRemoved",{label:O}),"neutral",{label:this.tf("picker.undo","Undo"),onClick:()=>{let T=this.controller.select(S);this.toast(T.length?(0,M.t)("picker.labelRestored",{label:O}):(0,M.t)("picker.labelNoLongerAvailable",{label:O}),T.length?"success":"warning")}})};if(this.reducedMotion()){P();return}H.classList.remove("sl-enter"),H.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(P,X.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(b=>{b.addEventListener("click",H=>{H.stopPropagation();let S=decodeURIComponent(b.dataset.tableEdit??""),O=this.controller.tableSelection(S);if(!O)return;let P=i.find(T=>T.label===S&&T.objectType==="table");this.showTableDialog({...O,quantity:P?.quantity??O.quantity},!!P,b)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(b=>{b.addEventListener("change",()=>this.controller.setSeatTier(b.dataset.tier,b.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(b=>{b.addEventListener("click",()=>{let H=this.controller.seatByLabel(b.dataset.viewLabel);H&&this.openSeatView(H)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(b=>{let H=()=>this.controller.flashSeat(b.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");b.addEventListener("mouseenter",H),b.addEventListener("focusin",H)}),Hr(this,this.els.tray,t),this.controller.setGASelection(kr(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(b=>{b.disabled=!0});let x=this.pendingSelectionCount(),w=this.lastTrayCount,y=this.lastTrayTotal,C=to(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");if(this.els.count.textContent=C||(a?(0,M.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=C||(a?(0,M.tCount)("picker.seatsSelectedCount",a):"")),this.syncCta(a,x),this.hold){this.holdCopyPending=x>0;let b=jo({secured:s||this.hold.seats?.length||0,pendingCount:x,expiresAt:this.holdExpiresAt,releasing:this.releasingHold});this.els.holdTitle&&(this.els.holdTitle.textContent=b.title),this.els.holdCopy&&(this.els.holdCopy.textContent=b.copy);let H=this.els.holdChange;H&&(H.disabled=this.releasingHold,H.textContent=b.change)}a!==w&&this.animateOnce(this.els.count,"sl-value-pop",380),o!==y&&this.animateOnce(this.els.total,"sl-value-pop",380),w===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,x,a>w),this.lastTrayCount=a,this.lastTrayTotal=o,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(a,e),this.scheduleFit()}scheduleFit(){if(this.fitScheduled||this.destroyed)return;this.fitScheduled=!0;let e=()=>{this.fitScheduled=!1,this.destroyed||this.fitTranslatedRows()};typeof requestAnimationFrame=="function"?requestAnimationFrame(e):e()}fitTranslatedRows(){fs(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(gs),this.els.tray?.querySelectorAll(".sl-ba-go,.sl-ba-reopen").forEach(Mn),this.els.peek?.querySelectorAll(".sl-sheet-go").forEach(Mn)}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,r=!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=Fo({count:e,total:t,pendingCount:i,ctaPhase:this.ctaPhase,hasHold:!!this.hold,salesClosed:this.salesClosed,suppressPricing:this.suppressPricing,fromPrice:s.length?Math.min(...s):null,addMore:this.root?.dataset.layout==="narrow"?null:$o({salesClosed:this.salesClosed,hasHold:!!this.hold,ctaPhase:this.ctaPhase,formOpen:this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm,room:this.maxTickets-this.totalTicketCount(),wanted:this.baQty}),offerFind:!this.performanceGroup&&!this.salesClosed&&!this.hold,holdTime:this.hold&&this.holdTimer?ti(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"))),r&&this.animateOnce(this.els.peek.querySelector(".sl-peek-sum")??void 0,"sl-peek-bump",240),this.scheduleFit()}async removeHeldLabels(e,t){let i=e.filter(o=>o&&!this.releasingLabels.has(o));if(!i.length)return!1;let r=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,M.t)("picker.couldNotRemoveLabel",{label:r}),"error"),!1;Er(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,M.t)("picker.labelRemovedFromHold",{label:r}),"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(Un(e,(i,r)=>this.tf(i,r)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast((0,M.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(i=>!(this.hold.items??[]).some(r=>r.label===i.label))){let i=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,i);return}this.holdingLabels=new Set(t.map(i=>i.label)),this.setCtaPhase("holding");try{let i=null,r=xr(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 r){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.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=i,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(i.expiresAt),this.flashHeldSeats(i),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(i,i.seats??s)}catch(i){this.opts.onError?.(i);let r=i,s=(r.conflicts??[]).map(a=>a.label).filter(Boolean).slice(0,3);r.reason==="event_closed"&&this.setSalesClosed(!0);let o=r.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):r.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):r.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s.length?s.length===1?(0,M.t)("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):(0,M.t)("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(o),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 r=()=>{let s=Math.max(0,this.holdExpiresAt-Date.now());i&&(i.textContent=ti(s));let o=this.els.peek?.querySelector(".sl-peek-time");o&&(o.textContent=ti(s)),!this.holdCopyPending&&this.els.holdCopy&&this.root?.dataset.layout!=="narrow"&&(this.els.holdCopy.textContent=Wn(this.holdExpiresAt)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=na),this.setExtendPrompt(s>0&&s<=na,s),(s<=0||!this.controller.currentHold())&&this.stopHoldTimer()};this.holdTimer=setInterval(r,500),r()}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),r=Math.floor(i/60),s=String(i%60).padStart(2,"0");this.els.extendTxt.innerHTML=(0,M.t)("picker.seatsHeldForNeedMoreTime",{time:`${r}:${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.holdConflicted||this.showBooked())}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((r,s)=>r+s.quantity,0),i=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=i?.seats?`<span class="sl-booked-seats">${(0,M.tCount)("picker.group.ticketsConfirmedAcross",i.seats,{performances:i.performances})}</span>`:`<span class="sl-booked-seats">${(0,M.tCount)("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.els.bookedList&&(this.els.bookedList.innerHTML=e.lineItems.map(r=>{let o=[r.sectionLabel,r.rowLabel&&`${this.tf("picker.row","Row")} ${r.rowLabel}`,r.seatNumber&&`${this.tf("picker.seat","Seat")} ${r.seatNumber}`].filter(Boolean).join(" \xB7 ")||r.displayLabel||r.label,a=r.quantity>1?` <span class="sl-booked-qty">\xD7${r.quantity}</span>`:"";return`<li>${D(o)}${a}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0),this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.root?.focus({preventScroll:!0})}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let i=this.buildHandoff(e),r=null;try{r=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(o){this.opts.onError?.(o)}if(this.destroyed)return;let s=r?.providers?.[0];if(!s){let o=Wr(r?.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 Kr())}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}}),r=i[0]?.currency??this.currency,s=i.reduce((o,a)=>o+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:r,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 r=this.els.toast;if(!r)return;r.replaceChildren();let s=document.createElement("span");if(s.textContent=e,r.appendChild(s),r.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}),r.appendChild(o)}r.dataset.tone=t,r.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{r.classList.remove("on","sl-mo-rise"),r.classList.remove("has-action"),r.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),i=this.confirmEl;if(!t||!i?.isConnected){e.style.removeProperty("bottom");return}let r=this.els.map.clientHeight;if(r<=0)return;let s=i.getBoundingClientRect(),o=s.height||i.offsetHeight||qc,a=s.height?s.top-this.els.map.getBoundingClientRect().top:r-Nn-o,l=Math.round(r-a+jc);if(l+Gc>r){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){To({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?oo(this.tipPos,e,t):null,r=i??so(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${r.left}px`,this.tipEl.style.top=`${r.top}px`,i?this.tipEl.dataset.placement=i.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let i=this.performanceGroup,r=_n(e.mark,i?.nights?.()),s=r?.states.filter(o=>o.free).length??0;return Us(r,{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),r=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,r);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.performanceGroup?.surface==="season"?this.tf("picker.season.includedInPackage","Included in the Season package"):this.tf("picker.group.pricesPerPerformance","Prices shown per performance"):"",rowTypeWord:Qe(e),reason:i,extra:s+(r?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${D(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=r,this.tipEl.classList.toggle("sl-tip-pinned",r),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()}),co(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[r,s]of Object.entries(e())){let o=this.controller.idForLabel(r);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(r=>t.has(r.id)||t.has(r.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=Bt(this.themeMode),i=$t(this.controller.doc?.theme,this.opts.theme,t);for(let[r,s]of Object.entries(i))e.style.setProperty(r,s);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=ui(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(ct(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:Bt(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Bt(this.themeMode),i=$t(this.controller.doc?.theme,this.opts.theme,t),r=ct(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,s=pr(i,r);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=fr(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=(0,M.getLocale)(),i=this.localeGeneration+=1,r=await(0,M.loadLocale)(e);return this.opts.messages&&(0,M.setStringOverrides)(this.opts.messages),r===t||this.applyActiveLocale(r,i),r}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(gr(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}),this.scheduleFit())}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),this.minimap?.refreshMinimap(),Kc(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.controller.accessibilityFilterDims?.(e)||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,r=!!i&&i!==t.viewUrl,s=r?await this.buyerAssetUrls.resolve(i):null,o=r?t.viewUrl:await this.buyerAssetUrls.resolve(t.viewUrl);return!o||r&&!s?null:{url:o,...s?{previewUrl:s}:{},...r?{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 ko(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 r=this.view3dEl;if(!r)return;let s=this.controller.seatDetails(e.id),o=s?.displayLabel??e.displayLabel??e.label,a=ee(s);Do(r,{status:i,visualState:t,location:[s?.sectionLabel,a?(0,M.t)("picker.rowLabel",{label:a}):null,o].filter(Boolean).join(" \xB7 ")||o,tf:(l,c)=>this.tf(l,c)}),this.announceSeat(e)}dismissUnavailable3dSeat(){qn(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(h=>h.id===e);if(!t)return null;let i=this.controller.seatDetails(t.id),r=this.controller.doc?.categories.find(h=>h.key===t.categoryKey),s=i?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),o=s!=null?this.paidPrice(t.categoryKey,i?.tierId??r?.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,ii.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=He(t.commercial)||this.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),p=i?.wheelchairSpaceType?`${Tt(i.wheelchairSpaceType)} \xB7 metadata, not access certification`:this.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),u=(0,oa.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:ee(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??r?.label??t.categoryKey,price:this.suppressPricing||o==null?"":this.money(o),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:p,confidence:u}}openSeatConfidencePassport(e,t=null){Gn(this,e,t)}closeSeatConfidencePassport(e=!0){Jt(this,e)}openView3dComparison(){_o(this)}closeView3dComparison(e=!0){Ze(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 r=document.createElement("button");r.type="button",r.className="sl-view3d-back",r.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=r.querySelector("span"),o=c=>{this.view3dTargetSeatId=c;let d=!!c;i.classList.toggle("is-seat-focused",d),this.root&&(this.root.dataset.view3dSeat=d?"on":"off");let p=d?this.tf("picker.backToVenue","Back to venue"):this.tf("picker.backToMap","Back to map");s&&(s.textContent=p),r.setAttribute("aria-label",p)};if(r.addEventListener("click",()=>{if(this.view3dTargetSeatId&&this.view3dHandle){this.view3dHandle.focusOverview();return}this.exit3d()}),this.regions["top-left"]?.prepend(r),this.view3dBack=r,this.publish3dTopInset(),wo(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,p]=await Promise.all([Ut(),this.controller.loadEventConfiguration()]),u=p?await Ai(p,y=>this.buyerAssetUrls.resolve(y)):null,h=t.theme?.venue3d?.shellAssetUrl,g=await Pi(h,y=>this.buyerAssetUrls.resolve(y));if(l!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let f={doc:t,seats:c,...u?{eventConfigurationId:u.id,eventConfiguration:u}:{},...g?{registeredShellGlb:g}:{}};a.textContent=this.tf("picker.building3d","Building venue geometry\u2026");let x=await d.prepareVenue3D(f);if(l!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let w=d.mountVenue3D(i,{...f,prepared:x},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:kt(),seatViewActionLabel:y=>this.allSeats().find(C=>C.id===y)?.viewUrl?this.tf("picker.openAuthored360","Open venue 360\xB0"):this.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:y=>this.seatViewCaption(y),onSeatViewStopChange:y=>this.view3dSeatViewChrome?.onStopChange(y),onSeatPick:y=>this.onView3dSeatPick(y),onSeatInspect:y=>this.onView3dSeatPick(y),onSectionFocusChange:y=>{let C=i.querySelector('select[data-locator="section"]'),b=y??"";!C||C.value===b||(C.value=b,C.dispatchEvent(new Event("change")))},onViewTargetChange:y=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!y),o(y),this.opts.onBuyerViewChange?.({view:"venue3d",...y?{seatId:y}:{}})},...this.seatViewEnabled()?{getSeatView:y=>new Promise((C,b)=>{let H=()=>{this.seatViewFor3d(y).then(O=>{O?C(O):b(new Error("seat_view_unavailable"))})},S=globalThis.requestIdleCallback;typeof S=="function"?S(H,{timeout:1500}):setTimeout(H,50)})}:{},onAnalytics:(y,C)=>this.emit3dAnalytics(y,C)});this.view3dHandle=w,this.view3dSeatViewChrome=xo(i,{handle:()=>this.view3dHandle}),requestAnimationFrame(()=>a.remove()),this.pushAvailabilityTo3d(),this.syncSelectionTo3d(),this.view3dNav=yo(this.regions["bottom-left"]??i,w),e&&w.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()}}publish3dTopInset(){let e=this.regions["top-left"];if(!this.root||!e)return;let t=()=>{!this.root||this.root.dataset.view3d!=="on"||this.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}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,this.view3dBack?.remove(),this.view3dBack=null,this.view3dNav?.remove(),this.view3dNav=null,this.root?.removeAttribute("data-view3d-seat"),this.root?.style.removeProperty("--sl-3d-top-inset");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)));try{return await this.bestAvailableOrThrow(e,t,i)}catch(r){this.opts.onError?.(r);let s=r?.reason,o=s==="not_enough_together"?(0,M.t)("picker.couldNotFindSeatsTogether",{count:e}):s==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):s==="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(o,"error"),null}}async bestAvailableOrThrow(e,t,i={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let r=this.els.tray?.querySelector(".sl-ba-go");r&&(r.disabled=!0,r.classList.add("sl-busy"),r.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,M.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),i=!0;if(t)i=await this.controller.release();else if(e){let r=[...new Set([...(e.items??[]).map(s=>s.label),...(e.seats??[]).map(s=>s.label)])];if(r.length)try{await this.api.release(this.opts.event,r,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 be({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:at(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,i)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:i}),this.syncTray(),this.toast(i==="ineligible"?this.tf("picker.seatNoLongerYours","Some seats are no longer available to you. They have been removed from your order."):this.tf("picker.seatTaken","Someone else took a seat you had picked. It has been removed from your order."),"warning")}})}),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=Bs(e.reason,()=>this.refreshAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}destroy(){this.destroyed=!0,Vn(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),Me(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 ze=require("@seatlayer/core");var la="seatlayer-performance-group-picker-style";function ca(){if(document.getElementById(la))return;let n=document.createElement("style");n.id=la,n.textContent=`
2808
2777
  .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)}
2809
2778
  .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)}
2810
2779
  .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}
@@ -2864,7 +2833,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
2864
2833
  @media(min-width:900px){.sl-pg-legend-list{justify-content:flex-start}}
2865
2834
  .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}
2866
2835
  @media(max-width:640px){.sl-pg-head{padding:13px 14px}.sl-pg-head h2{font-size:18px}.sl-pg-inner{min-height:590px}}
2867
- `,document.head.appendChild(n)}var Vc="https://api.seatlayer.io",zc=6e4,jc=2e3,Gc=1e3,qc=36e5,Uc=5e3,Kc=5e3,Wc=15e3,Yc=12e4,Qc=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),W=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function Xc(n){return new Promise(e=>setTimeout(e,n))}function Xn(n){let e=Number(n.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(Uc,e*1e3)):1e3}function At(n,e){return`/pub/performance-groups/${encodeURIComponent(n)}/operations/${encodeURIComponent(e)}`}function Pt(n){return n.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var Zn=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)),r=[...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,r.length&&this.sink.applyStatuses(r),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof W){this.stop();return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},nn=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??Vc).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??zc,this.realtimePollMs=Math.max(500,t.realtimePollMs??jc),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(r=>this.adoptSession(r));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(r=>{throw this.chartRequest=null,r});let[t,i]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:i,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new j(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",i=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let 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 j(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 r=this.objectsCache;if(this.selectionMode==="same_seat"){let o=r.performances.filter(p=>this.includedEventKeys.has(p.eventKey));if(!o.length)throw new j(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(o[0]?.seats??{}),l=Object.fromEntries(a.map(p=>[p,o.every(u=>u.seats[p]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(p=>{let u=o.filter(h=>h.seats[p]!=="free").map(h=>h.eventKey);return u.length>0&&u.length<o.length?[[p,u]]:[]})),d={seats:l,partial:c,hidden:[...new Set(o.flatMap(p=>p.hidden??[]))],closed:[...new Set(o.flatMap(p=>p.closed??[]))],revision:r.revision,state:r.state,salesClosed:o.some(p=>p.salesClosed)};return this.noteAvailability(r,d.salesClosed,d),d}let s=r.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!s)throw new j(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(r,r.salesClosed||r.performances.some(o=>o.salesClosed),s),s}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new j(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=null,this.selectionsByEvent.clear(),this.activePerformanceKey=this.descriptorCache?.performances[0]?.eventKey??this.activePerformanceKey)}setActivePerformance(e){if(this.descriptorCache&&!this.descriptorCache.performances.some(t=>t.eventKey===e))throw new j(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(i=>i.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(i=>!t.has(i)))throw new j(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(i=>({...i})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(i=>({...i}))}))}async hold(e,t,i,r){if(this.assertUsable(),r)throw new j(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 j(409,"group_selection_incomplete","group_selection_incomplete");this.setPerformanceSelections(this.activePerformanceKey,t);let c=this.descriptorCache.performances.filter(d=>this.includedEventKeys.has(d.eventKey)).map(d=>({eventKey:d.eventKey,selections:this.selectionsByEvent.get(d.eventKey)??[]}));if(c.some(d=>d.selections.length!==this.partySize))throw new j(409,"group_selection_incomplete","group_selection_incomplete");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 W)throw c;if(c instanceof pe)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,Xn(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,Xn(l))}}try{return await this.throwResponse(l,s)}catch(c){throw this.failOperation(a),c}}async release(e,t,i){this.assertUsable();let r=this.operationForHold(i),s=await this.json(`${At(this.groupKey,r)}/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),r=await this.json(At(this.groupKey,i));return this.complete(r.operation)}async extend(e,t,i=12e4){this.assertUsable();let r=this.operationForHold(t),s=Math.max(Gc,Math.min(qc,Math.round(i))),o=await this.json(`${At(this.groupKey,r)}/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 j(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new Zn(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:Pt(e.operationId)});let t;try{t=await this.authorized(At(this.groupKey,e.operationId))}catch(s){return s instanceof W||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 r=i.operation.state;return r==="committed"||r==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(i.operation)):r==="aborted"||r==="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>=Yc?Wc:Kc;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 r=await this.authorized(At(this.groupKey,e));if(!r.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(r)).operation}catch(r){return r instanceof W?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"||Qc.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 r=0;r<2;r++){if(this.destroyed)return;try{if((await this.fetcher(`${this.base}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit",signal:this.aborter.signal})).ok){this.adoptFailure=null;return}}catch{}}if(this.destroyed)return;this.adoptFailure=new j(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let i=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:i,reference:i?Pt(i):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,i,r=100){let s=r,o=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=i;){if(this.destroyed)throw new W;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=o,reference:Pt(e)}),await Xc(s),this.destroyed)throw new W;let l;try{l=await this.authorized(At(this.groupKey,e))}catch(p){if(p instanceof W)throw p;if(p instanceof pe)throw this.recoveryFailed(e,"request_failed"),p;s=Math.min(2e3,Math.max(100,s*2));continue}if(l.status===404){s=Math.min(1e3,Math.max(100,s*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let d=(await this.responseJson(l)).operation;if(a=d.state,this.noteOperationState(e,d.state),this.emit(d),d.state==="committed"||d.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(d);if(d.state==="aborted"||d.state==="expired")throw this.failOperation(e),new j(409,"conflict","conflict",t.map(p=>({label:p,status:"held"})));s=Xn(l)}throw this.recoveryFailed(e,"deadline"),new j(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:Pt(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 r=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:r,salesClosed:!!t||r!=="active",revision:s,revisionChanged:o})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new j(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let i=t.find(r=>r.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:i??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new j(404,"group_hold_not_found","group_hold_not_found");return t}mappingKey(e){return`@seatlayer/performance-group-hold/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}/${encodeURIComponent(e)}`}readMapping(e){try{return window.sessionStorage.getItem(this.mappingKey(e))}catch{return null}}writeMapping(e,t){try{window.sessionStorage.setItem(this.mappingKey(e),t)}catch{}}assertUsable(){if(this.destroyed)throw new W;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},i=!1){if(this.destroyed)throw new W;if(this.adoptFailure)throw this.adoptFailure;let r={...t.headers};t.body!==void 0&&(r["Content-Type"]="application/json");let s=await this.access.authorization(i?"unauthorized":"initial");if(this.destroyed)throw new W;if(this.adoptFailure)throw this.adoptFailure;if(!s)throw new Error("performance_group_buyer_access_required");r.Authorization=s;let o=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:r,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 r=await e.json().catch(()=>null)??{},s=r.code??r.error??`request_failed_${e.status}`;throw e.status===409&&!r.conflicts?.length&&t.length&&(r.conflicts=t.map(o=>({label:o,status:"held"}))),new j(e.status,r.error??s,s,r.conflicts)}};var Zc="https://api.seatlayer.io";function aa(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var rn=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 fe({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable}),this.api=new nn(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,oa(),await(0,je.loadLocale)(this.options.locale),this.options.messages&&(0,je.setStringOverrides)(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(i){throw Me({apiBase:this.options.apiBase??Zc,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:Fe(this.options.performanceGroup),transport:"pubapi"}),i}return this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(aa(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 r=document.createElement("div");r.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 p=document.createElement("div");p.innerHTML=Bn(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(d,p);let u=document.createElement("div");u.className="sl-pg-held-summary",u.hidden=!0,s.append(o,a,l,c,u);let h=document.createElement("div");h.className="sl-pg-legend";let g=document.createElement("div");g.className="sl-pg-pane",g.setAttribute("role","group"),g.setAttribute("aria-label",this.copy("picker.group.yourSelection")),g.hidden=!0;let m=this.mode==="per_performance"?this.performanceTabs(t):null,y=document.createElement("div");y.className="sl-pg-inner",y.id=this.panelId,y.setAttribute("aria-busy","false"),y.dataset.locked="false",this.mode==="per_performance"&&(y.setAttribute("role","tabpanel"),y.tabIndex=-1);let S=document.createElement("div");S.className="sl-pg-status",S.setAttribute("role","status"),S.setAttribute("aria-live","polite"),S.hidden=!0;let w=document.createElement("p"),T=document.createElement("button");T.type="button",T.hidden=!0,T.textContent=this.copy("picker.group.retry"),T.addEventListener("click",()=>{this.retryRecovery()}),S.append(w,T),y.appendChild(S);let b=document.createElement("div");b.className="sl-pg-live",b.setAttribute("role","status"),b.setAttribute("aria-live","polite"),i.append(r,s),m&&i.append(m),i.append(h,y,g,b),e.appendChild(i),this.root=i,this.progressHost=r,this.legendHost=h,this.paneHost=g,this.datesSummaryHost=d,this.datesCardsHost=p,this.innerHost=y,this.heldSummary=u,this.live=b,this.statusHost=S,this.statusCopy=w,this.statusAction=T,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new ze(tn({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(i,r)=>{try{this.options.onAnalytics?.(i,{...r,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,r)=>this.holdChanged(i,r),onCheckout:(i,r)=>this.checkout(i,r),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"?js(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,r)=>{this.selectPartialSeat(i,r)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:i=>this.partialSeatDates.get(i)??this.nights().map(r=>r.eventKey),label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),apply:(i,r)=>this.applySeatDates(i,r,!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:ji(t,this.options.locale),time:Gi(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:qi(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,i=!!t?.salesClosed||!!t&&t.state!=="active",r=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(r))!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(r=>r.eventKey===this.activePerformanceKey);if(!e)return null;let t=qi(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:qi(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),r=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:r&&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=Js(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=qs({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)??[],r=this.heldTotal();e.hidden=!1,e.innerHTML=eo({title:this.copy("picker.group.yourSelection"),rows:t.map(s=>({eventKey:s.eventKey,name:`${ji(s,this.options.locale)} ${Gi(s,this.options.locale)}`,labels:i})),empty:this.copy("picker.group.noSeatsChosenYet"),note:r?null:this.copy("picker.group.pricesPerPerformance"),total:r?{label:this.copy("picker.group.total"),amount:r}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:to(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let r=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!r.length)return null;let s=r.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),o=r[0]?.currency??t.currency;try{return(0,je.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=Bn(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 r=this.api.includedPerformanceKeys();if(r.length===t.length&&r.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 r.length&&(this.api.setIncludedEventKeys(r),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(aa(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 W)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,(r,s)=>String(t[s]??`{${s}}`)):i:(0,je.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 r=document.createElement("button");r.type="button",r.className="sl-pg-step",r.dataset.step="next",r.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),r.textContent="\u203A",r.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 p=document.createElement("span");p.className="sl-pg-tab-badge",p.textContent=this.copy("picker.group.chosenOfTotal",{chosen:0,total:this.options.numberOfPlacesToSelect??1}),l.append(c,p,d),l.addEventListener("click",()=>{this.switchPerformance(o.eventKey)}),l.addEventListener("keydown",u=>this.tabKeydown(u)),s.appendChild(l)}),t.append(i,s,r),this.tabsHost=s,this.prevButton=i,this.nextButton=r,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 r=getComputedStyle(this.tabsHost??document.body).direction==="rtl",s=-1;switch(e.key){case"ArrowRight":s=i+(r?-1:1);break;case"ArrowLeft":s=i+(r?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),r=t[i+e];!r||r.disabled||(r.focus({preventScroll:!0}),this.switchPerformance(r.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let r=!this.holdBlocked();return{complete:e.length,total:e.length,ready:r}}let t=this.options.numberOfPlacesToSelect,i=e.filter(r=>this.selectionsByEvent.get(r.eventKey)?.length===t&&this.validByEvent.get(r.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),r=this.copy("picker.group.chosenOfTotal",{chosen:i.length,total:t});return i.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:r}:i.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:i.join(", ")}),badge:r}:i.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:r}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-i.length}),badge:r}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(r=>{let s=r.dataset.eventKey,o=this.tabState(s),a=s===this.activePerformanceKey;r.dataset.state=o.key,r.disabled=t,r.setAttribute("aria-selected",String(a)),r.tabIndex=a?0:-1;let l=r.querySelector(".sl-pg-tab-state");l&&(l.textContent=o.label);let c=r.querySelector(".sl-pg-tab-badge");c&&(c.textContent=o.badge);let d=r.querySelector(".sl-pg-tab-name")?.textContent??s;r.setAttribute("aria-label",`${d}: ${o.badge} \xB7 ${o.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",r.id)});let i=e.findIndex(r=>r.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 r=this.descriptorValue?.performances.find(s=>s.eventKey===e);r&&this.announce(this.copy("picker.group.performanceOpened",{performance:r.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 W)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 W)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 W)return;this.options.onError?.(t)}}handoff(e,t){let i=this.descriptorValue,r=this.api.operationIdForHold(e.holdId);if(!i||!r)throw new Error("seatlayer: Performance Group hold identity is unavailable");let s=this.api.allocationsForHold(e.holdId);return{operationId:r,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),r=document.createElement("p"),s=document.createElement("strong");s.textContent=i?.name??t.eventKey,r.append(s,document.createTextNode(t.items.map(o=>o.label).join(", "))),this.heldSummary.appendChild(r)}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),r=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(),r&&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 la="seatlayer-season-picker-style";function ca(){if(document.getElementById(la))return;let n=document.createElement("style");n.id=la,n.textContent=`
2836
+ `,document.head.appendChild(n)}var Wc="https://api.seatlayer.io",Yc=6e4,Qc=2e3,Xc=1e3,Zc=36e5,Jc=5e3,ed=5e3,td=15e3,id=12e4,nd=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),W=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function rd(n){return new Promise(e=>setTimeout(e,n))}function Qn(n){let e=Number(n.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(Jc,e*1e3)):1e3}function At(n,e){return`/pub/performance-groups/${encodeURIComponent(n)}/operations/${encodeURIComponent(e)}`}function Pt(n){return n.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var Xn=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)),r=[...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,r.length&&this.sink.applyStatuses(r),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof W){this.stop();return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},nn=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??Wc).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??Yc,this.realtimePollMs=Math.max(500,t.realtimePollMs??Qc),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(r=>this.adoptSession(r));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(r=>{throw this.chartRequest=null,r});let[t,i]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:i,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new j(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",i=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let 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 j(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 r=this.objectsCache;if(this.selectionMode==="same_seat"){let o=r.performances.filter(p=>this.includedEventKeys.has(p.eventKey));if(!o.length)throw new j(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(o[0]?.seats??{}),l=Object.fromEntries(a.map(p=>[p,o.every(u=>u.seats[p]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(p=>{let u=o.filter(h=>h.seats[p]!=="free").map(h=>h.eventKey);return u.length>0&&u.length<o.length?[[p,u]]:[]})),d={seats:l,partial:c,hidden:[...new Set(o.flatMap(p=>p.hidden??[]))],closed:[...new Set(o.flatMap(p=>p.closed??[]))],revision:r.revision,state:r.state,salesClosed:o.some(p=>p.salesClosed)};return this.noteAvailability(r,d.salesClosed,d),d}let s=r.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!s)throw new j(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(r,r.salesClosed||r.performances.some(o=>o.salesClosed),s),s}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new j(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=null,this.selectionsByEvent.clear(),this.activePerformanceKey=this.descriptorCache?.performances[0]?.eventKey??this.activePerformanceKey)}setActivePerformance(e){if(this.descriptorCache&&!this.descriptorCache.performances.some(t=>t.eventKey===e))throw new j(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(i=>i.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(i=>!t.has(i)))throw new j(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(i=>({...i})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(i=>({...i}))}))}async hold(e,t,i,r){if(this.assertUsable(),r)throw new j(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 j(409,"group_selection_incomplete","group_selection_incomplete");this.setPerformanceSelections(this.activePerformanceKey,t);let c=this.descriptorCache.performances.filter(d=>this.includedEventKeys.has(d.eventKey)).map(d=>({eventKey:d.eventKey,selections:this.selectionsByEvent.get(d.eventKey)??[]}));if(c.some(d=>d.selections.length!==this.partySize))throw new j(409,"group_selection_incomplete","group_selection_incomplete");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 W)throw c;if(c instanceof de)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,Qn(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,Qn(l))}}try{return await this.throwResponse(l,s)}catch(c){throw this.failOperation(a),c}}async release(e,t,i){this.assertUsable();let r=this.operationForHold(i),s=await this.json(`${At(this.groupKey,r)}/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),r=await this.json(At(this.groupKey,i));return this.complete(r.operation)}async extend(e,t,i=12e4){this.assertUsable();let r=this.operationForHold(t),s=Math.max(Xc,Math.min(Zc,Math.round(i))),o=await this.json(`${At(this.groupKey,r)}/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 j(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new Xn(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:Pt(e.operationId)});let t;try{t=await this.authorized(At(this.groupKey,e.operationId))}catch(s){return s instanceof W||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 r=i.operation.state;return r==="committed"||r==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(i.operation)):r==="aborted"||r==="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>=id?td:ed;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 r=await this.authorized(At(this.groupKey,e));if(!r.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(r)).operation}catch(r){return r instanceof W?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"||nd.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 r=0;r<2;r++){if(this.destroyed)return;try{if((await this.fetcher(`${this.base}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit",signal:this.aborter.signal})).ok){this.adoptFailure=null;return}}catch{}}if(this.destroyed)return;this.adoptFailure=new j(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let i=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:i,reference:i?Pt(i):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,i,r=100){let s=r,o=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=i;){if(this.destroyed)throw new W;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=o,reference:Pt(e)}),await rd(s),this.destroyed)throw new W;let l;try{l=await this.authorized(At(this.groupKey,e))}catch(p){if(p instanceof W)throw p;if(p instanceof de)throw this.recoveryFailed(e,"request_failed"),p;s=Math.min(2e3,Math.max(100,s*2));continue}if(l.status===404){s=Math.min(1e3,Math.max(100,s*2));continue}if(!l.ok){this.recoveryFailed(e,"request_failed");try{return await this.throwResponse(l,t)}finally{this.pendingOperationId=null,this.clearOperationRecord()}}let d=(await this.responseJson(l)).operation;if(a=d.state,this.noteOperationState(e,d.state),this.emit(d),d.state==="committed"||d.state==="booked")return this.emitRecovery({kind:"idle"}),this.complete(d);if(d.state==="aborted"||d.state==="expired")throw this.failOperation(e),new j(409,"conflict","conflict",t.map(p=>({label:p,status:"held"})));s=Qn(l)}throw this.recoveryFailed(e,"deadline"),new j(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:Pt(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 r=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:r,salesClosed:!!t||r!=="active",revision:s,revisionChanged:o})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new j(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let i=t.find(r=>r.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:i??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new j(404,"group_hold_not_found","group_hold_not_found");return t}mappingKey(e){return`@seatlayer/performance-group-hold/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}/${encodeURIComponent(e)}`}readMapping(e){try{return window.sessionStorage.getItem(this.mappingKey(e))}catch{return null}}writeMapping(e,t){try{window.sessionStorage.setItem(this.mappingKey(e),t)}catch{}}assertUsable(){if(this.destroyed)throw new W;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},i=!1){if(this.destroyed)throw new W;if(this.adoptFailure)throw this.adoptFailure;let r={...t.headers};t.body!==void 0&&(r["Content-Type"]="application/json");let s=await this.access.authorization(i?"unauthorized":"initial");if(this.destroyed)throw new W;if(this.adoptFailure)throw this.adoptFailure;if(!s)throw new Error("performance_group_buyer_access_required");r.Authorization=s;let o=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:r,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 r=await e.json().catch(()=>null)??{},s=r.code??r.error??`request_failed_${e.status}`;throw e.status===409&&!r.conflicts?.length&&t.length&&(r.conflicts=t.map(o=>({label:o,status:"held"}))),new j(e.status,r.error??s,s,r.conflicts)}};var sd="https://api.seatlayer.io";function da(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var rn=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 me({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable}),this.api=new nn(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,ca(),await(0,ze.loadLocale)(this.options.locale),this.options.messages&&(0,ze.setStringOverrides)(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(i){throw Le({apiBase:this.options.apiBase??sd,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:$e(this.options.performanceGroup),transport:"pubapi"}),i}return this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(da(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 r=document.createElement("div");r.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 p=document.createElement("div");p.innerHTML=Dn(this.performanceCards(t),this.copy(t.inclusionMode==="flexible_dates"?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.performanceCount})),c.append(d,p);let u=document.createElement("div");u.className="sl-pg-held-summary",u.hidden=!0,s.append(o,a,l,c,u);let h=document.createElement("div");h.className="sl-pg-legend";let g=document.createElement("div");g.className="sl-pg-pane",g.setAttribute("role","group"),g.setAttribute("aria-label",this.copy("picker.group.yourSelection")),g.hidden=!0;let f=this.mode==="per_performance"?this.performanceTabs(t):null,x=document.createElement("div");x.className="sl-pg-inner",x.id=this.panelId,x.setAttribute("aria-busy","false"),x.dataset.locked="false",this.mode==="per_performance"&&(x.setAttribute("role","tabpanel"),x.tabIndex=-1);let w=document.createElement("div");w.className="sl-pg-status",w.setAttribute("role","status"),w.setAttribute("aria-live","polite"),w.hidden=!0;let y=document.createElement("p"),C=document.createElement("button");C.type="button",C.hidden=!0,C.textContent=this.copy("picker.group.retry"),C.addEventListener("click",()=>{this.retryRecovery()}),w.append(y,C),x.appendChild(w);let b=document.createElement("div");b.className="sl-pg-live",b.setAttribute("role","status"),b.setAttribute("aria-live","polite"),i.append(r,s),f&&i.append(f),i.append(h,x,g,b),e.appendChild(i),this.root=i,this.progressHost=r,this.legendHost=h,this.paneHost=g,this.datesSummaryHost=d,this.datesCardsHost=p,this.innerHost=x,this.heldSummary=u,this.live=b,this.statusHost=w,this.statusCopy=y,this.statusAction=C,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new Ve(tn({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(i,r)=>{try{this.options.onAnalytics?.(i,{...r,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,r)=>this.holdChanged(i,r),onCheckout:(i,r)=>this.checkout(i,r),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"?zs(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,r)=>{this.selectPartialSeat(i,r)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:i=>this.partialSeatDates.get(i)??this.nights().map(r=>r.eventKey),label:i=>this.copy("picker.group.selectAvailableDates",{count:i}),apply:(i,r)=>this.applySeatDates(i,r,!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:ji(t,this.options.locale),time:Gi(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:qi(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,i=!!t?.salesClosed||!!t&&t.state!=="active",r=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(r))!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(r=>r.eventKey===this.activePerformanceKey);if(!e)return null;let t=qi(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:qi(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),r=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:r&&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=Zs(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=Gs({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)??[],r=this.heldTotal();e.hidden=!1,e.innerHTML=Js({title:this.copy("picker.group.yourSelection"),rows:t.map(s=>({eventKey:s.eventKey,name:`${ji(s,this.options.locale)} ${Gi(s,this.options.locale)}`,labels:i})),empty:this.copy("picker.group.noSeatsChosenYet"),note:r?null:this.copy("picker.group.pricesPerPerformance"),total:r?{label:this.copy("picker.group.total"),amount:r}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:eo(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let r=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!r.length)return null;let s=r.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),o=r[0]?.currency??t.currency;try{return(0,ze.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=Dn(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 r=this.api.includedPerformanceKeys();if(r.length===t.length&&r.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 r.length&&(this.api.setIncludedEventKeys(r),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(da(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 W)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,(r,s)=>String(t[s]??`{${s}}`)):i:(0,ze.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 r=document.createElement("button");r.type="button",r.className="sl-pg-step",r.dataset.step="next",r.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),r.textContent="\u203A",r.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 p=document.createElement("span");p.className="sl-pg-tab-badge",p.textContent=this.copy("picker.group.chosenOfTotal",{chosen:0,total:this.options.numberOfPlacesToSelect??1}),l.append(c,p,d),l.addEventListener("click",()=>{this.switchPerformance(o.eventKey)}),l.addEventListener("keydown",u=>this.tabKeydown(u)),s.appendChild(l)}),t.append(i,s,r),this.tabsHost=s,this.prevButton=i,this.nextButton=r,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 r=getComputedStyle(this.tabsHost??document.body).direction==="rtl",s=-1;switch(e.key){case"ArrowRight":s=i+(r?-1:1);break;case"ArrowLeft":s=i+(r?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),r=t[i+e];!r||r.disabled||(r.focus({preventScroll:!0}),this.switchPerformance(r.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let r=!this.holdBlocked();return{complete:e.length,total:e.length,ready:r}}let t=this.options.numberOfPlacesToSelect,i=e.filter(r=>this.selectionsByEvent.get(r.eventKey)?.length===t&&this.validByEvent.get(r.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),r=this.copy("picker.group.chosenOfTotal",{chosen:i.length,total:t});return i.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:r}:i.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:i.join(", ")}),badge:r}:i.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:r}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-i.length}),badge:r}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(r=>{let s=r.dataset.eventKey,o=this.tabState(s),a=s===this.activePerformanceKey;r.dataset.state=o.key,r.disabled=t,r.setAttribute("aria-selected",String(a)),r.tabIndex=a?0:-1;let l=r.querySelector(".sl-pg-tab-state");l&&(l.textContent=o.label);let c=r.querySelector(".sl-pg-tab-badge");c&&(c.textContent=o.badge);let d=r.querySelector(".sl-pg-tab-name")?.textContent??s;r.setAttribute("aria-label",`${d}: ${o.badge} \xB7 ${o.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",r.id)});let i=e.findIndex(r=>r.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 r=this.descriptorValue?.performances.find(s=>s.eventKey===e);r&&this.announce(this.copy("picker.group.performanceOpened",{performance:r.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 W)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 W)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 W)return;this.options.onError?.(t)}}handoff(e,t){let i=this.descriptorValue,r=this.api.operationIdForHold(e.holdId);if(!i||!r)throw new Error("seatlayer: Performance Group hold identity is unavailable");let s=this.api.allocationsForHold(e.holdId);return{operationId:r,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),r=document.createElement("p"),s=document.createElement("strong");s.textContent=i?.name??t.eventKey,r.append(s,document.createTextNode(t.items.map(o=>o.label).join(", "))),this.heldSummary.appendChild(r)}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),r=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(),r&&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 pa="seatlayer-season-picker-style";function ha(){if(document.getElementById(pa))return;let n=document.createElement("style");n.id=pa,n.textContent=`
2868
2837
  .sl-season-root{--sl-season-accent:var(--sl-accent,#7357d8);box-sizing:border-box;display:grid;gap:12px;min-width:0;max-width:100%;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
2869
2838
  .sl-season-root *{box-sizing:border-box}.sl-season-root button,.sl-season-root summary{font:inherit}
2870
2839
  .sl-season-hero{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:18px;padding:20px;border:1px solid var(--sl-line,#dde3ea);border-radius:18px;background:linear-gradient(135deg,color-mix(in srgb,var(--sl-season-accent) 10%,var(--sl-surface,#fff)),var(--sl-surface,#fff) 58%);box-shadow:0 10px 30px #18202b0a}
@@ -2878,4 +2847,4 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default}
2878
2847
  .sl-season-status{min-height:20px;margin:0;padding:0 4px;color:var(--sl-muted,#627081);font-size:13px}.sl-season-status[data-kind=ready]{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sl-season-status[data-kind=failed],.sl-season-status[data-kind=partial_terminal]{position:static;width:auto;height:auto;margin:0;padding:10px 12px;overflow:visible;clip:auto;border-radius:10px;background:#fff1f0;color:var(--sl-danger,#b42318);font-weight:700}.sl-season-root[data-busy=true] .sl-season-map{opacity:.82;pointer-events:none}
2879
2848
  @media(max-width:820px){.sl-season-stage{grid-template-columns:1fr}.sl-season-summary-card{position:static;order:-1}.sl-season-map{min-height:590px}}
2880
2849
  @media(max-width:560px){.sl-season-root{gap:9px}.sl-season-hero{grid-template-columns:1fr;padding:15px;border-radius:14px}.sl-season-offer{min-width:0}.sl-season-progress{grid-template-columns:1fr}.sl-season-progress li+li{border-inline-start:0;border-top:1px solid var(--sl-line,#dde3ea)}.sl-season-progress li[data-state=upcoming]{display:none}.sl-season-date-list{grid-template-columns:1fr}.sl-season-map{min-height:560px}.sl-season-summary-card{padding:13px}.sl-season-benefits{display:grid;grid-template-columns:1fr}}
2881
- `,document.head.appendChild(n)}var Jc="https://api.seatlayer.io",ed=6e4,td=5e3,q=class extends Error{constructor(t,i){super(`season_request_failed:${t}`);this.code=t;this.status=i;this.name="SeasonApiError"}},ri=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function id(n,e){let t=Number(n.headers.get("Retry-After")),i=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(td,i*1e3))}function nd(n,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,i)=>{let r=setTimeout(t,n);e?.addEventListener("abort",()=>{clearTimeout(r),i(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function rd(n){if(!n||typeof n!="object")return"unknown";let e=n;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}var sd=/^shc_[a-f0-9]{40}$/,od=/^shh_[a-f0-9]{40}$/,ad=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),ld=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function Jn(n){return Array.isArray(n)?n.some(Jn):!n||typeof n!="object"?!1:Object.entries(n).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&sd.test(t)||Jn(t))}function ni(n,e,t="invalid_operation_response"){if(!n||typeof n!="object"||Array.isArray(n))throw new q(t,502);if(Jn(n))throw new q("unsafe_operation_response",502);let i=n,r=i.allocations,s=new Set,o=Array.isArray(r)&&r.length>0&&r.every(p=>{if(!p||typeof p!="object")return!1;let u=p.eventId,h=p.state;return typeof u!="string"||!u||typeof h!="string"||!ld.has(h)||s.has(u)?!1:(s.add(u),!0)}),a=i.bookingRef===null||typeof i.bookingRef=="string"&&i.bookingRef.length>0,l=i.state!=="booked"||typeof i.bookingRef=="string"&&o&&r.every(p=>p.state==="booked"),c=i.state!=="booking_pending"||typeof i.bookingRef=="string"&&o&&r.some(p=>p.state!=="booked"),d=i.state!=="committed"||i.bookingRef===null;if(i.operationId!==e.operationId||i.seasonId!==e.seasonId||i.kind!=="HOLD"||typeof i.holdId!="string"||!od.test(i.holdId)||i.policy!=="fixed_inclusion_same_seat"||typeof i.state!="string"||!ad.has(i.state)||typeof i.expiresAt!="number"||!Number.isFinite(i.expiresAt)||i.expiresAt<0||!a||typeof i.location!="string"||!i.location||typeof i.retryAfterSeconds!="number"||!Number.isFinite(i.retryAfterSeconds)||i.retryAfterSeconds<0||!o||!l||!c||!d||i.pricingAuthority!==void 0&&i.pricingAuthority!=="host"||i.authoritativeAmountIncluded!==void 0&&i.authoritativeAmountIncluded!==!1)throw new q(t,502);return{operationId:i.operationId,seasonId:i.seasonId,kind:i.kind,holdId:i.holdId,expiresAt:i.expiresAt,policy:i.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:i.state,bookingRef:i.bookingRef,location:i.location,retryAfterSeconds:i.retryAfterSeconds,allocations:r.map(p=>({eventId:p.eventId,state:p.state}))}}function cd(n,e,t){if(!Array.isArray(n)||n.length!==t||n.some(o=>typeof o!="string"||!o)||new Set(n).size!==n.length||!Array.isArray(e)||e.length!==n.length)throw new q("invalid_best_available_response",502);let i=n,r=new Set(i),s=new Map;for(let o of e){if(!o||typeof o!="object")throw new q("invalid_best_available_response",502);let a=o;if(typeof a.label!="string"||!r.has(a.label)||s.has(a.label)||typeof a.objectId!="string"||!a.objectId||a.objectType!=="seat"||typeof a.categoryKey!="string"||!a.categoryKey||a.tierId!==null&&(typeof a.tierId!="string"||!a.tierId)||a.quantity!==void 0&&a.quantity!==1)throw new q("invalid_best_available_response",502);s.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:i,items:i.map(o=>s.get(o))}}function da(n,e){return{seasonKey:n.key,planActivationId:n.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:t,state:i})=>({eventKey:t,state:i}))}}var be,Lt,ke,Mt,si,Se,Te,de,xe,pa,sn=class{constructor(e,t){D(this,de);D(this,be);D(this,Lt);D(this,ke);D(this,Mt);D(this,si);D(this,Se,!1);D(this,Te,null);A(this,be,e),A(this,Lt,(t.apiBase??Jc).replace(/\/$/,"")),A(this,ke,t.access),A(this,Mt,t.fetch??globalThis.fetch.bind(globalThis)),A(this,si,t.recoveryTimeoutMs??ed),f(this,ke).onRenewed(i=>P(this,de,pa).call(this,i))}async descriptor(){let{body:e}=await P(this,de,xe).call(this,"GET","");return e.season}async chart(){let{body:e}=await P(this,de,xe).call(this,"GET","/chart");return e}async availability(){let{body:e}=await P(this,de,xe).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:r}=await P(this,de,xe).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:ni(i.operation,{seasonId:f(this,be),operationId:t}),response:r}}async bestAvailable(e){let{body:t,response:i}=await P(this,de,xe).call(this,"POST","/best-available",{operationId:e.operationId,qty:e.qty,...e.categoryKey?{categoryKey:e.categoryKey}:{},...e.zoneId?{zoneId:e.zoneId}:{},...e.accessibility?.length?{accessibility:[...e.accessibility]}:{},...e.requireContiguous===!0?{requireContiguous:!0}:{}}),r=ni(t.operation,{seasonId:f(this,be),operationId:e.operationId},"invalid_best_available_response"),{labels:s,items:o}=cd(t.labels,t.items,e.qty);return{operation:r,labels:s,items:o,response:i}}async operation(e){let{body:t,response:i}=await P(this,de,xe).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:ni(t.operation,{seasonId:f(this,be),operationId:e}),response:i}}async release(e,t){let{body:i,response:r}=await P(this,de,xe).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:ni(i.operation,{seasonId:f(this,be),operationId:e}),response:r}}async renewalIntent(e){let{body:t}=await P(this,de,xe).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 q("invalid_renewal_intent_response",502);return i}async waitForTerminal(e,t,i){let r=Date.now(),s=t?{operation:ni(t.operation,{seasonId:f(this,be),operationId:e}),response:t.response}:await this.operation(e);for(;s.operation.state==="preparing"||s.operation.state==="commit_pending"||s.operation.state==="expire_pending"||s.operation.state==="booking_pending"||s.operation.state==="abort_pending";){if(Date.now()-r>=f(this,si))throw new ri(e);await nd(id(s.response,s.operation),i),s=await this.operation(e)}return s.operation}destroy(){f(this,Se)||(A(this,Se,!0),f(this,ke).onRenewed(void 0),f(this,ke).clear())}};be=new WeakMap,Lt=new WeakMap,ke=new WeakMap,Mt=new WeakMap,si=new WeakMap,Se=new WeakMap,Te=new WeakMap,de=new WeakSet,xe=async function(e,t,i,r=!0){if(f(this,Se))throw new q("season_api_destroyed",409);if(f(this,Te))throw f(this,Te);let s=await f(this,ke).authorization();if(f(this,Se))throw new q("season_api_destroyed",409);if(f(this,Te))throw f(this,Te);if(!s)throw new pe({reason:"no_token",retryable:!1});let o=await f(this,Mt).call(this,`${f(this,Lt)}/pub/seasons/${encodeURIComponent(f(this,be))}${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=rd(a);if(r&&await f(this,ke).handleFailure(o.status,l))return P(this,de,xe).call(this,e,t,i,!1);let c=f(this,ke).unavailable;throw c?new pe(c):new q(l,o.status)}if(a===null)throw new q("invalid_json_response",502);return{body:a,response:o}},pa=async function(e){if(f(this,Se))return;let t=`/pub/seasons/${encodeURIComponent(f(this,be))}/session/adopt`;for(let i=0;i<2;i++){if(f(this,Se))return;try{if((await f(this,Mt).call(this,`${f(this,Lt)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){A(this,Te,null);return}}catch{}}if(!f(this,Se))throw A(this,Te,new q("season_session_adopt_failed",409)),f(this,Te)};var dd=2500;function pd(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}function hd(n,e,t){if(n.startsAt==null)return{date:"Date to be announced",time:null};try{let i=new Date(n.startsAt),r=e?{timeZone:e}:{};return{date:new Intl.DateTimeFormat(t,{dateStyle:"medium",...r}).format(i),time:new Intl.DateTimeFormat(t,{timeStyle:"short",...r}).format(i)}}catch{return{date:"Date to be announced",time:null}}}function ha(n){return n.state==="committed"||n.state==="booked"}var er=class{constructor(e,t,i){this.transport=e;this.sink=t;this.intervalMs=i;this.timer=null;this.stopped=!0;this.prior={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=Object.entries(e.seats).filter(([i,r])=>this.prior[i]!==r).map(([i,r])=>({label:i,status:r}));this.prior={...e.seats},t.length&&this.sink.applyStatuses(t)}catch{this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},tr=class{constructor(e,t){this.api=e;this.realtimePollMs=t;this.descriptorValue=null;this.availabilityValue=null;this.reuseAvailabilityOnce=!1;this.nextOperationId=null;this.nextBestAvailable=null;this.nextReleaseActionId=null;this.operationByHold=new Map}prime(e,t){this.descriptorValue=e,this.availabilityValue=t,this.reuseAvailabilityOnce=!0}queueOperation(e){this.nextOperationId=e}queueBestAvailable(e,t){if(this.nextBestAvailable)throw new q("season_best_available_in_progress",409);let i={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=i,i}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}async chart(e){let[t,i]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.api.chart()]);return this.descriptorValue=t,{doc:i,event:{key:t.key,name:t.name,venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,i,r){if(r)throw new q("season_hold_replace_unsupported",409);let s=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let o=await this.api.hold(t.map(l=>l.label),s),a=await this.api.waitForTerminal(s,o);if(!ha(a))throw new q(`season_operation_${a.state}`,409);return this.remember(a),{holdId:a.holdId,expiresAt:a.expiresAt,items:t.map(l=>({label:l.label,objectId:l.label,objectType:"seat",categoryKey:"",tierId:l.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...l.quantity==null?{}:{quantity:l.quantity}}))}}async release(e,t,i){let r=this.operationForHold(i);if(!r)throw new q("season_hold_not_found",404);let s=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let o=await this.api.release(r.operationId,s),a=await this.api.waitForTerminal(r.operationId,o);if(a.state==="partial_terminal")throw this.remember(a),new q("season_operation_partial_terminal",409);this.forget(i)}async bestAvailable(e,t,i,r){let s=this.nextBestAvailable;this.nextBestAvailable=null;let o=s?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:o,qty:t,...i?{categoryKey:i}:{},...r?{zoneId:r}:{},...s?.accessibility?.length?{accessibility:s.accessibility}:{},...s?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(o,a);if(!ha(l))throw new q(`season_operation_${l.state}`,409);this.remember(l);let c=new Map(a.items.map(d=>[d.label,d]));return{holdId:l.holdId,expiresAt:l.expiresAt,labels:[...a.labels],items:a.labels.map(d=>{let p=c.get(d);return{label:d,objectId:p?.objectId??d,objectType:"seat",categoryKey:p?.categoryKey??i??"",tierId:p?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...p?.quantity==null?{}:{quantity:p.quantity}}})}}socketUrl(){return""}createRealtime(e,t){return new er(this,t,this.realtimePollMs)}},B,nt,oi,Ce,re,ai,me,Re,Y,le,Ie,Ot,Ge,Oe,rt,_e,qe,_t,H,ua,ma,fa,ir,on,Ht,Rt,te,it,nr,It,an=class{constructor(e){D(this,H);D(this,B);D(this,nt);D(this,oi);D(this,Ce);D(this,re);D(this,ai,new AbortController);D(this,me,null);D(this,Re,null);D(this,Y,null);D(this,le,null);D(this,Ie,null);D(this,Ot,null);D(this,Ge,null);D(this,Oe,null);D(this,rt,null);D(this,_e,[]);D(this,qe,!1);D(this,_t,!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");A(this,B,e),A(this,nt,pd(e.container)),A(this,oi,new fe({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable})),A(this,Ce,new sn(e.season,{apiBase:e.apiBase,access:f(this,oi),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs})),A(this,re,new tr(f(this,Ce),Math.max(750,e.realtimePollMs??dd)))}async render(){P(this,H,nr).call(this),ca(),P(this,H,ma).call(this),P(this,H,te).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let[e,t]=await Promise.all([f(this,Ce).descriptor(),f(this,Ce).availability()]);return f(this,qe)?this:(A(this,me,e),A(this,Re,t),f(this,re).prime(e,t),P(this,H,fa).call(this),await P(this,H,ua).call(this,e),P(this,H,te).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included performance.`}),f(this,B).initialOperationId&&await this.restoreOperation(f(this,B).initialOperationId),this)}catch(e){if(f(this,qe))return this;throw P(this,H,it).call(this,e),e}}async holdSameSeat(e,t){if(P(this,H,It).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!e.length)throw new Error("seatlayer: select at least one seat");if(f(this,re).queueOperation(t),f(this,le).selectObjectsWithoutConfirmation([...e]),P(this,H,te).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await f(this,le).handleCta(),!f(this,Y))throw new q("season_hold_not_created",409);return f(this,Y)}async holdBestAvailable(e,t,i={}){if(P(this,H,It).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: positive Best Available quantity is required");let r=f(this,le).maxTickets;if(e>r)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${r})`);if(f(this,_t))throw new q("season_best_available_in_progress",409);A(this,_t,!0);let s=null;try{if(s=f(this,re).queueBestAvailable(t,i),P(this,H,te).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await f(this,le).bestAvailableOrThrow(e,i.categoryKey,{zoneId:i.zoneId})||!f(this,Y))throw new q("season_hold_not_created",409);return f(this,Y)}catch(o){throw P(this,H,it).call(this,o,t),o}finally{s&&f(this,re).clearBestAvailable(s),A(this,_t,!1)}}async restoreOperation(e){P(this,H,It).call(this),P(this,H,te).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await f(this,Ce).waitForTerminal(e,void 0,f(this,ai).signal);return t.state==="aborted"||t.state==="expired"?(A(this,Y,null),f(this,B).onHoldChange?.(null),P(this,H,te).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(f(this,re).remember(t),P(this,H,ir).call(this,t,!1))}catch(t){throw P(this,H,it).call(this,t,e),t}}async release(e){P(this,H,It).call(this);let t=f(this,Y);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");f(this,re).queueRelease(e),P(this,H,te).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{f(this,le)?.getCurrentHold()?.holdId===t.holdId?await f(this,le).release():(await f(this,re).release("",[],t.holdId),P(this,H,on).call(this)),P(this,H,te).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(i){throw P(this,H,it).call(this,i,t.operationId),i}}}async createRenewalIntent(e){if(P(this,H,It).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");P(this,H,te).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await f(this,Ce).renewalIntent(e);return P(this,H,te).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),f(this,B).onRenewalIntent?.(t),t}catch(t){throw P(this,H,it).call(this,t),t}}getDescriptor(){return f(this,me)}getAvailability(){return f(this,Re)}getHandoff(){return f(this,Y)}destroy(){f(this,qe)||(A(this,qe,!0),f(this,ai).abort(),f(this,le)?.destroy(),f(this,Ce).destroy(),f(this,nt).replaceChildren(),A(this,Ie,null),A(this,Ot,null),A(this,Ge,null),A(this,Oe,null),A(this,rt,null),A(this,me,null),A(this,Re,null),A(this,Y,null))}};B=new WeakMap,nt=new WeakMap,oi=new WeakMap,Ce=new WeakMap,re=new WeakMap,ai=new WeakMap,me=new WeakMap,Re=new WeakMap,Y=new WeakMap,le=new WeakMap,Ie=new WeakMap,Ot=new WeakMap,Ge=new WeakMap,Oe=new WeakMap,rt=new WeakMap,_e=new WeakMap,qe=new WeakMap,_t=new WeakMap,H=new WeakSet,ua=async function(e){let t=new ze(tn({container:f(this,Ot),event:e.key,apiBase:f(this,B).apiBase,transport:f(this,re),hideEventDetails:!0,maxSelection:f(this,B).maxSelection,selectedObjects:f(this,B).selectedObjects,selectableObjects:f(this,B).selectableObjects,numberOfPlacesToSelect:f(this,B).numberOfPlacesToSelect,selectionValidators:f(this,B).selectionValidators,locale:f(this,B).locale,messages:f(this,B).messages,languages:f(this,B).languages,colorblindSafe:f(this,B).colorblindSafe,initialView:f(this,B).initialView,enable3D:f(this,B).enable3D,max3DSeats:f(this,B).max3DSeats,hideBadge:f(this,B).hideBadge,theme:f(this,B).theme,confirmSelection:f(this,B).confirmSelection,seatView:f(this,B).seatView,onBuyerViewChange:f(this,B).onBuyerViewChange,onAnalytics:(i,r)=>{try{f(this,B).onAnalytics?.(i,{...r,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:e.occurrenceCount})}catch{}},onSelectionChange:i=>{A(this,_e,i.map(r=>r.label)),P(this,H,Ht).call(this),f(this,B).onSelectionChange?.(i)},onSelectionValidityChange:f(this,B).onSelectionValidityChange,onHoldChange:i=>{if(!i){P(this,H,on).call(this);return}let r=f(this,re).operationForHold(i.holdId);r&&P(this,H,ir).call(this,r,!0)},onCheckout:()=>{f(this,Y)&&(P(this,H,Rt).call(this,"checkout"),f(this,B).onContinue?.(f(this,Y)))},onHoldExpired:()=>{P(this,H,on).call(this),P(this,H,te).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),f(this,B).onHoldExpired?.()},onError:i=>P(this,H,it).call(this,i)},{surface:"season",performanceCount:e.occurrenceCount,selectionMode:"same_seat",suppressPricing:!0,groupSelectionSummary:()=>{let i=f(this,_e).length;return i?{seats:i,performances:e.occurrenceCount,performancesChosen:e.occurrenceCount,perPerformance:i}:null}}));A(this,le,t),await t.render()},ma=function(){f(this,nt).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection");let t=document.createElement("header");t.className="sl-season-hero";let i=document.createElement("ol");i.className="sl-season-progress",i.setAttribute("aria-label","Season checkout progress");for(let[m,y]of["Choose seats","Review package","Checkout"].entries()){let S=document.createElement("li");S.dataset.state=m===0?"current":"upcoming";let w=document.createElement("span");w.textContent=String(m+1),S.append(w,y),i.append(S)}let r=document.createElement("div");r.className="sl-season-stage";let s=document.createElement("div");s.className="sl-season-map";let o=document.createElement("aside");o.className="sl-season-summary-card",o.setAttribute("aria-label","Your Season selection");let a=document.createElement("h3");a.textContent="Your Season seats";let l=document.createElement("p");l.className="sl-season-selection",l.textContent="Choose a seat on the map.";let c=document.createElement("p");c.className="sl-season-rule";let d=document.createElement("i");d.textContent="1\xD7";let p=document.createElement("span");p.textContent="Each seat you choose is reserved for every included performance.",c.append(d,p);let u=document.createElement("p");u.className="sl-season-availability";let h=document.createElement("p");h.className="sl-season-checkout-note",h.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits.",o.append(a,l,c,u,h),r.append(s,o);let g=document.createElement("p");g.className="sl-season-status",g.setAttribute("role","status"),g.setAttribute("aria-live","polite"),e.append(t,i,r,g),f(this,nt).append(e),A(this,Ie,e),A(this,Ot,s),A(this,Ge,g),A(this,Oe,l),A(this,rt,u)},fa=function(){let e=f(this,me),t=f(this,B).offer,i=f(this,Ie).querySelector(".sl-season-hero");i.replaceChildren();let r=document.createElement("div");r.className="sl-season-copy";let s=document.createElement("p");s.className="sl-season-eyebrow",s.textContent=t?.eyebrow??"Season ticket";let o=document.createElement("h2");o.textContent=e.edition?`${e.name} \xB7 ${e.edition}`:e.name;let a=document.createElement("p");a.className="sl-season-promise",a.textContent=`Choose once and keep the same seat for all ${e.occurrenceCount} included performances.`;let l=document.createElement("div");l.className="sl-season-facts";for(let m of[`${e.occurrenceCount} performances`,e.venue,t?.renewalLabel??"Same-seat package"].filter(Boolean)){let y=document.createElement("span");y.className="sl-season-fact",y.textContent=m,l.append(y)}r.append(s,o,a,l),i.append(r);let c=document.createElement("div");c.className="sl-season-offer";let d=document.createElement("span");d.className="sl-season-offer-label",d.textContent=t?.priceLabel?"Season package":"Package price";let p=document.createElement(t?.priceLabel?"strong":"span");if(p.className=t?.priceLabel?"sl-season-price":"sl-season-price-note",p.textContent=t?.priceLabel??"Confirmed by your ticketing platform at checkout",c.append(d,p),t?.compareAtPriceLabel){let m=document.createElement("span");m.className="sl-season-was",m.textContent=t.compareAtPriceLabel,c.append(m)}if(t?.savingsLabel){let m=document.createElement("span");m.className="sl-season-saving",m.textContent=t.savingsLabel,c.append(m)}if(t?.priceNote){let m=document.createElement("span");m.className="sl-season-price-note",m.textContent=t.priceNote,c.append(m)}if(i.append(c),t?.benefits?.length){let m=document.createElement("ul");m.className="sl-season-benefits";for(let y of t.benefits.slice(0,6)){let S=document.createElement("li");S.textContent=y,m.append(S)}i.append(m)}let u=document.createElement("details");u.className="sl-season-dates";let h=document.createElement("summary");h.textContent=`All ${e.occurrenceCount} performances included`;let g=document.createElement("ol");g.className="sl-season-date-list";for(let m of e.occurrences){let y=document.createElement("li");y.className="sl-season-date";let S=document.createElement("b");S.textContent=m.name;let w=hd(m,e.timezone,f(this,B).locale),T=document.createElement("time");m.startsAt!=null&&(T.dateTime=new Date(m.startsAt).toISOString()),T.textContent=w.time?`${w.date} \xB7 ${w.time}`:w.date,y.append(S,T),g.append(y)}u.append(h,g),i.append(u),P(this,H,Ht).call(this)},ir=function(e,t){if(e.state==="booked")return A(this,Y,null),f(this,re).forget(e.holdId),f(this,le)?.notifyGroupSettled("booked"),P(this,H,Rt).call(this,"complete"),P(this,H,te).call(this,{kind:"booked",message:`Your Season booking is complete for all ${f(this,me).occurrenceCount} performances. No further checkout action is needed.`,operationId:e.operationId}),f(this,B).onHoldChange?.(null),null;if(e.state==="partial_terminal")return A(this,Y,null),A(this,_e,[]),f(this,re).forget(e.holdId),f(this,le)?.notifyGroupSettled("lost"),P(this,H,Ht).call(this),P(this,H,Rt).call(this,"review"),P(this,H,te).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),f(this,B).onHoldChange?.(null),null;if(e.state!=="committed")return A(this,Y,null),f(this,re).forget(e.holdId),f(this,le)?.notifyGroupSettled("lost"),P(this,H,te).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),f(this,B).onHoldChange?.(null),null;let i=da(f(this,me),e),r=f(this,Y)?.holdId!==i.holdId;return A(this,Y,i),P(this,H,Ht).call(this),P(this,H,Rt).call(this,"review"),f(this,B).onHoldChange?.(i),P(this,H,te).call(this,{kind:"held",message:`Your seats are held for all ${f(this,me).occurrenceCount} performances. Review and continue to checkout.`,operationId:e.operationId}),r&&t&&f(this,B).onHold?.(i),i},on=function(){A(this,Y,null),A(this,_e,[]),P(this,H,Ht).call(this),P(this,H,Rt).call(this,"choose"),f(this,B).onHoldChange?.(null)},Ht=function(){if(!f(this,Oe))return;let e=f(this,_e).length;if(!e)f(this,Oe).textContent="Choose a seat on the map. Unavailable seats are already booked on at least one included performance.";else{f(this,Oe).replaceChildren();let t=document.createElement("strong");t.textContent=f(this,_e).join(", "),f(this,Oe).append(t,` \xB7 ${e} Season seat${e===1?"":"s"} across all ${f(this,me)?.occurrenceCount??0} performances`)}f(this,rt)&&f(this,Re)&&(f(this,rt).textContent=`${f(this,Re).freeCount} seat${f(this,Re).freeCount===1?"":"s"} currently available for the complete Season`)},Rt=function(e){let t=e==="choose"?0:e==="review"?1:e==="checkout"?2:3;f(this,Ie)?.querySelectorAll(".sl-season-progress li").forEach((i,r)=>{i.dataset.state=r<t?"done":r===t?"current":"upcoming";let s=i.querySelector("span");s&&(s.textContent=r<t?"\u2713":String(r+1))})},te=function(e,t=!1){f(this,Ge)&&(f(this,Ge).textContent=e.message,f(this,Ge).dataset.kind=e.kind),f(this,Ie)&&(f(this,Ie).dataset.busy=String(t)),f(this,B).onStatusChange?.(e)},it=function(e,t){let i=e instanceof q?`Season selection unavailable (${e.code}).`:"Season selection could not be completed.";P(this,H,te).call(this,{kind:"failed",message:i,operationId:t}),f(this,B).onError?.(e)},nr=function(){if(f(this,qe))throw new Error("seatlayer: SeasonPicker was destroyed")},It=function(){if(P(this,H,nr).call(this),!f(this,me)||!f(this,le))throw new Error("seatlayer: render SeasonPicker before using it")};function ga(n,e={}){let t=e.origin??"";if(!t)try{t=new URL(n.src,window.location.href).origin}catch{t=""}let i=!1,r=null,s=null,o=null,a="",l=null,c=()=>{if(i)return;i=!0,r=n.getAttribute("style"),Object.assign(n.style,{position:"fixed",inset:"0",width:"100vw",height:"100vh",margin:"0",border:"0",zIndex:"2147483000",background:"#101625"});let u=document.documentElement;s=u.style.overflow,u.style.overflow="hidden",document.body&&(o=document.body.style.overflow,document.body.style.overflow="hidden"),l=h=>{h.key==="Escape"&&d()},window.addEventListener("keydown",l)},d=()=>{i&&(i=!1,r===null?n.removeAttribute("style"):n.setAttribute("style",r),r=null,a&&(n.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))},p=u=>{if(u.source!==n.contentWindow||t&&u.origin!==t||!u.data||typeof u.data!="object")return;let h=u.data;if(h.type==="seatlayer:height"){typeof h.px=="number"&&Number.isFinite(h.px)&&h.px>0&&(a=`${Math.round(h.px)}px`,i||(n.style.height=a));return}h.type==="seatlayer:fullscreen"&&(h.on===!0?c():h.on===!1&&d())};return window.addEventListener("message",p),()=>{window.removeEventListener("message",p),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});
2850
+ `,document.head.appendChild(n)}var od="https://api.seatlayer.io",ad=6e4,ld=5e3,q=class extends Error{constructor(t,i){super(`season_request_failed:${t}`);this.code=t;this.status=i;this.name="SeasonApiError"}},ri=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function cd(n,e){let t=Number(n.headers.get("Retry-After")),i=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(ld,i*1e3))}function dd(n,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,i)=>{let r=setTimeout(t,n);e?.addEventListener("abort",()=>{clearTimeout(r),i(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function pd(n){if(!n||typeof n!="object")return"unknown";let e=n;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}var hd=/^shc_[a-f0-9]{40}$/,ud=/^shh_[a-f0-9]{40}$/,md=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),fd=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function Zn(n){return Array.isArray(n)?n.some(Zn):!n||typeof n!="object"?!1:Object.entries(n).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&hd.test(t)||Zn(t))}function ni(n,e,t="invalid_operation_response"){if(!n||typeof n!="object"||Array.isArray(n))throw new q(t,502);if(Zn(n))throw new q("unsafe_operation_response",502);let i=n,r=i.allocations,s=new Set,o=Array.isArray(r)&&r.length>0&&r.every(p=>{if(!p||typeof p!="object")return!1;let u=p.eventId,h=p.state;return typeof u!="string"||!u||typeof h!="string"||!fd.has(h)||s.has(u)?!1:(s.add(u),!0)}),a=i.bookingRef===null||typeof i.bookingRef=="string"&&i.bookingRef.length>0,l=i.state!=="booked"||typeof i.bookingRef=="string"&&o&&r.every(p=>p.state==="booked"),c=i.state!=="booking_pending"||typeof i.bookingRef=="string"&&o&&r.some(p=>p.state!=="booked"),d=i.state!=="committed"||i.bookingRef===null;if(i.operationId!==e.operationId||i.seasonId!==e.seasonId||i.kind!=="HOLD"||typeof i.holdId!="string"||!ud.test(i.holdId)||i.policy!=="fixed_inclusion_same_seat"||typeof i.state!="string"||!md.has(i.state)||typeof i.expiresAt!="number"||!Number.isFinite(i.expiresAt)||i.expiresAt<0||!a||typeof i.location!="string"||!i.location||typeof i.retryAfterSeconds!="number"||!Number.isFinite(i.retryAfterSeconds)||i.retryAfterSeconds<0||!o||!l||!c||!d||i.pricingAuthority!==void 0&&i.pricingAuthority!=="host"||i.authoritativeAmountIncluded!==void 0&&i.authoritativeAmountIncluded!==!1)throw new q(t,502);return{operationId:i.operationId,seasonId:i.seasonId,kind:i.kind,holdId:i.holdId,expiresAt:i.expiresAt,policy:i.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:i.state,bookingRef:i.bookingRef,location:i.location,retryAfterSeconds:i.retryAfterSeconds,allocations:r.map(p=>({eventId:p.eventId,state:p.state}))}}function gd(n,e,t){if(!Array.isArray(n)||n.length!==t||n.some(o=>typeof o!="string"||!o)||new Set(n).size!==n.length||!Array.isArray(e)||e.length!==n.length)throw new q("invalid_best_available_response",502);let i=n,r=new Set(i),s=new Map;for(let o of e){if(!o||typeof o!="object")throw new q("invalid_best_available_response",502);let a=o;if(typeof a.label!="string"||!r.has(a.label)||s.has(a.label)||typeof a.objectId!="string"||!a.objectId||a.objectType!=="seat"||typeof a.categoryKey!="string"||!a.categoryKey||a.tierId!==null&&(typeof a.tierId!="string"||!a.tierId)||a.quantity!==void 0&&a.quantity!==1)throw new q("invalid_best_available_response",502);s.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:i,items:i.map(o=>s.get(o))}}function ua(n,e){return{seasonKey:n.key,planActivationId:n.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:t,state:i})=>({eventKey:t,state:i}))}}var ge,Mt,ke,Lt,si,Se,Te,ce,xe,ma,sn=class{constructor(e,t){N(this,ce);N(this,ge);N(this,Mt);N(this,ke);N(this,Lt);N(this,si);N(this,Se,!1);N(this,Te,null);E(this,ge,e),E(this,Mt,(t.apiBase??od).replace(/\/$/,"")),E(this,ke,t.access),E(this,Lt,t.fetch??globalThis.fetch.bind(globalThis)),E(this,si,t.recoveryTimeoutMs??ad),m(this,ke).onRenewed(i=>A(this,ce,ma).call(this,i))}async descriptor(){let{body:e}=await A(this,ce,xe).call(this,"GET","");return e.season}async chart(){let{body:e}=await A(this,ce,xe).call(this,"GET","/chart");return e}async availability(){let{body:e}=await A(this,ce,xe).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:r}=await A(this,ce,xe).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:ni(i.operation,{seasonId:m(this,ge),operationId:t}),response:r}}async bestAvailable(e){let{body:t,response:i}=await A(this,ce,xe).call(this,"POST","/best-available",{operationId:e.operationId,qty:e.qty,...e.categoryKey?{categoryKey:e.categoryKey}:{},...e.zoneId?{zoneId:e.zoneId}:{},...e.accessibility?.length?{accessibility:[...e.accessibility]}:{},...e.requireContiguous===!0?{requireContiguous:!0}:{}}),r=ni(t.operation,{seasonId:m(this,ge),operationId:e.operationId},"invalid_best_available_response"),{labels:s,items:o}=gd(t.labels,t.items,e.qty);return{operation:r,labels:s,items:o,response:i}}async operation(e){let{body:t,response:i}=await A(this,ce,xe).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:ni(t.operation,{seasonId:m(this,ge),operationId:e}),response:i}}async release(e,t){let{body:i,response:r}=await A(this,ce,xe).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:ni(i.operation,{seasonId:m(this,ge),operationId:e}),response:r}}async renewalIntent(e){let{body:t}=await A(this,ce,xe).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 q("invalid_renewal_intent_response",502);return i}async waitForTerminal(e,t,i){let r=Date.now(),s=t?{operation:ni(t.operation,{seasonId:m(this,ge),operationId:e}),response:t.response}:await this.operation(e);for(;s.operation.state==="preparing"||s.operation.state==="commit_pending"||s.operation.state==="expire_pending"||s.operation.state==="booking_pending"||s.operation.state==="abort_pending";){if(Date.now()-r>=m(this,si))throw new ri(e);await dd(cd(s.response,s.operation),i),s=await this.operation(e)}return s.operation}destroy(){m(this,Se)||(E(this,Se,!0),m(this,ke).onRenewed(void 0),m(this,ke).clear())}};ge=new WeakMap,Mt=new WeakMap,ke=new WeakMap,Lt=new WeakMap,si=new WeakMap,Se=new WeakMap,Te=new WeakMap,ce=new WeakSet,xe=async function(e,t,i,r=!0){if(m(this,Se))throw new q("season_api_destroyed",409);if(m(this,Te))throw m(this,Te);let s=await m(this,ke).authorization();if(m(this,Se))throw new q("season_api_destroyed",409);if(m(this,Te))throw m(this,Te);if(!s)throw new de({reason:"no_token",retryable:!1});let o=await m(this,Lt).call(this,`${m(this,Mt)}/pub/seasons/${encodeURIComponent(m(this,ge))}${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=pd(a);if(r&&await m(this,ke).handleFailure(o.status,l))return A(this,ce,xe).call(this,e,t,i,!1);let c=m(this,ke).unavailable;throw c?new de(c):new q(l,o.status)}if(a===null)throw new q("invalid_json_response",502);return{body:a,response:o}},ma=async function(e){if(m(this,Se))return;let t=`/pub/seasons/${encodeURIComponent(m(this,ge))}/session/adopt`;for(let i=0;i<2;i++){if(m(this,Se))return;try{if((await m(this,Lt).call(this,`${m(this,Mt)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){E(this,Te,null);return}}catch{}}if(!m(this,Se))throw E(this,Te,new q("season_session_adopt_failed",409)),m(this,Te)};var bd=2500;function vd(n){let e=typeof n=="string"?document.querySelector(n):n;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}function yd(n,e,t){if(n.startsAt==null)return{date:"Date to be announced",time:null};try{let i=new Date(n.startsAt),r=e?{timeZone:e}:{};return{date:new Intl.DateTimeFormat(t,{dateStyle:"medium",...r}).format(i),time:new Intl.DateTimeFormat(t,{timeStyle:"short",...r}).format(i)}}catch{return{date:"Date to be announced",time:null}}}function fa(n){return n.state==="committed"||n.state==="booked"}var Jn=class{constructor(e,t,i){this.transport=e;this.sink=t;this.intervalMs=i;this.timer=null;this.stopped=!0;this.prior={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=Object.entries(e.seats).filter(([i,r])=>this.prior[i]!==r).map(([i,r])=>({label:i,status:r}));this.prior={...e.seats},t.length&&this.sink.applyStatuses(t)}catch{this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},er=class{constructor(e,t){this.api=e;this.realtimePollMs=t;this.descriptorValue=null;this.availabilityValue=null;this.reuseAvailabilityOnce=!1;this.nextOperationId=null;this.nextBestAvailable=null;this.nextReleaseActionId=null;this.operationByHold=new Map}prime(e,t){this.descriptorValue=e,this.availabilityValue=t,this.reuseAvailabilityOnce=!0}queueOperation(e){this.nextOperationId=e}queueBestAvailable(e,t){if(this.nextBestAvailable)throw new q("season_best_available_in_progress",409);let i={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=i,i}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}async chart(e){let[t,i]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.api.chart()]);return this.descriptorValue=t,{doc:i,event:{key:t.key,name:t.name,venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,i,r){if(r)throw new q("season_hold_replace_unsupported",409);let s=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let o=await this.api.hold(t.map(l=>l.label),s),a=await this.api.waitForTerminal(s,o);if(!fa(a))throw new q(`season_operation_${a.state}`,409);return this.remember(a),{holdId:a.holdId,expiresAt:a.expiresAt,items:t.map(l=>({label:l.label,objectId:l.label,objectType:"seat",categoryKey:"",tierId:l.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...l.quantity==null?{}:{quantity:l.quantity}}))}}async release(e,t,i){let r=this.operationForHold(i);if(!r)throw new q("season_hold_not_found",404);let s=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let o=await this.api.release(r.operationId,s),a=await this.api.waitForTerminal(r.operationId,o);if(a.state==="partial_terminal")throw this.remember(a),new q("season_operation_partial_terminal",409);this.forget(i)}async bestAvailable(e,t,i,r){let s=this.nextBestAvailable;this.nextBestAvailable=null;let o=s?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:o,qty:t,...i?{categoryKey:i}:{},...r?{zoneId:r}:{},...s?.accessibility?.length?{accessibility:s.accessibility}:{},...s?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(o,a);if(!fa(l))throw new q(`season_operation_${l.state}`,409);this.remember(l);let c=new Map(a.items.map(d=>[d.label,d]));return{holdId:l.holdId,expiresAt:l.expiresAt,labels:[...a.labels],items:a.labels.map(d=>{let p=c.get(d);return{label:d,objectId:p?.objectId??d,objectType:"seat",categoryKey:p?.categoryKey??i??"",tierId:p?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...p?.quantity==null?{}:{quantity:p.quantity}}})}}socketUrl(){return""}createRealtime(e,t){return new Jn(this,t,this.realtimePollMs)}},B,it,oi,Ce,re,ai,ue,Re,Y,le,Ie,Ot,je,Oe,nt,_e,Ge,_t,L,ga,ba,va,tr,on,Ht,Rt,te,tt,ir,It,an=class{constructor(e){N(this,L);N(this,B);N(this,it);N(this,oi);N(this,Ce);N(this,re);N(this,ai,new AbortController);N(this,ue,null);N(this,Re,null);N(this,Y,null);N(this,le,null);N(this,Ie,null);N(this,Ot,null);N(this,je,null);N(this,Oe,null);N(this,nt,null);N(this,_e,[]);N(this,Ge,!1);N(this,_t,!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");E(this,B,e),E(this,it,vd(e.container)),E(this,oi,new me({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,onExpired:e.onAccessExpired,onUnavailable:e.onAccessUnavailable})),E(this,Ce,new sn(e.season,{apiBase:e.apiBase,access:m(this,oi),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs})),E(this,re,new er(m(this,Ce),Math.max(750,e.realtimePollMs??bd)))}async render(){A(this,L,ir).call(this),ha(),A(this,L,ba).call(this),A(this,L,te).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let[e,t]=await Promise.all([m(this,Ce).descriptor(),m(this,Ce).availability()]);return m(this,Ge)?this:(E(this,ue,e),E(this,Re,t),m(this,re).prime(e,t),A(this,L,va).call(this),await A(this,L,ga).call(this,e),A(this,L,te).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included performance.`}),m(this,B).initialOperationId&&await this.restoreOperation(m(this,B).initialOperationId),this)}catch(e){if(m(this,Ge))return this;throw A(this,L,tt).call(this,e),e}}async holdSameSeat(e,t){if(A(this,L,It).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!e.length)throw new Error("seatlayer: select at least one seat");if(m(this,re).queueOperation(t),m(this,le).selectObjectsWithoutConfirmation([...e]),A(this,L,te).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await m(this,le).handleCta(),!m(this,Y))throw new q("season_hold_not_created",409);return m(this,Y)}async holdBestAvailable(e,t,i={}){if(A(this,L,It).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: positive Best Available quantity is required");let r=m(this,le).maxTickets;if(e>r)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${r})`);if(m(this,_t))throw new q("season_best_available_in_progress",409);E(this,_t,!0);let s=null;try{if(s=m(this,re).queueBestAvailable(t,i),A(this,L,te).call(this,{kind:"pending",message:`Finding ${e} Season seat${e===1?"":"s"} available for every performance.`,operationId:t},!0),!await m(this,le).bestAvailableOrThrow(e,i.categoryKey,{zoneId:i.zoneId})||!m(this,Y))throw new q("season_hold_not_created",409);return m(this,Y)}catch(o){throw A(this,L,tt).call(this,o,t),o}finally{s&&m(this,re).clearBestAvailable(s),E(this,_t,!1)}}async restoreOperation(e){A(this,L,It).call(this),A(this,L,te).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await m(this,Ce).waitForTerminal(e,void 0,m(this,ai).signal);return t.state==="aborted"||t.state==="expired"?(E(this,Y,null),m(this,B).onHoldChange?.(null),A(this,L,te).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(m(this,re).remember(t),A(this,L,tr).call(this,t,!1))}catch(t){throw A(this,L,tt).call(this,t,e),t}}async release(e){A(this,L,It).call(this);let t=m(this,Y);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");m(this,re).queueRelease(e),A(this,L,te).call(this,{kind:"pending",message:"Releasing the Season seats.",operationId:t.operationId},!0);try{m(this,le)?.getCurrentHold()?.holdId===t.holdId?await m(this,le).release():(await m(this,re).release("",[],t.holdId),A(this,L,on).call(this)),A(this,L,te).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(i){throw A(this,L,tt).call(this,i,t.operationId),i}}}async createRenewalIntent(e){if(A(this,L,It).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");A(this,L,te).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await m(this,Ce).renewalIntent(e);return A(this,L,te).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),m(this,B).onRenewalIntent?.(t),t}catch(t){throw A(this,L,tt).call(this,t),t}}getDescriptor(){return m(this,ue)}getAvailability(){return m(this,Re)}getHandoff(){return m(this,Y)}destroy(){m(this,Ge)||(E(this,Ge,!0),m(this,ai).abort(),m(this,le)?.destroy(),m(this,Ce).destroy(),m(this,it).replaceChildren(),E(this,Ie,null),E(this,Ot,null),E(this,je,null),E(this,Oe,null),E(this,nt,null),E(this,ue,null),E(this,Re,null),E(this,Y,null))}};B=new WeakMap,it=new WeakMap,oi=new WeakMap,Ce=new WeakMap,re=new WeakMap,ai=new WeakMap,ue=new WeakMap,Re=new WeakMap,Y=new WeakMap,le=new WeakMap,Ie=new WeakMap,Ot=new WeakMap,je=new WeakMap,Oe=new WeakMap,nt=new WeakMap,_e=new WeakMap,Ge=new WeakMap,_t=new WeakMap,L=new WeakSet,ga=async function(e){let t=new Ve(tn({container:m(this,Ot),event:e.key,apiBase:m(this,B).apiBase,transport:m(this,re),hideEventDetails:!0,maxSelection:m(this,B).maxSelection,selectedObjects:m(this,B).selectedObjects,selectableObjects:m(this,B).selectableObjects,numberOfPlacesToSelect:m(this,B).numberOfPlacesToSelect,selectionValidators:m(this,B).selectionValidators,locale:m(this,B).locale,messages:m(this,B).messages,languages:m(this,B).languages,colorblindSafe:m(this,B).colorblindSafe,initialView:m(this,B).initialView,enable3D:m(this,B).enable3D,max3DSeats:m(this,B).max3DSeats,hideBadge:m(this,B).hideBadge,theme:m(this,B).theme,confirmSelection:m(this,B).confirmSelection,seatView:m(this,B).seatView,onBuyerViewChange:m(this,B).onBuyerViewChange,onAnalytics:(i,r)=>{try{m(this,B).onAnalytics?.(i,{...r,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:e.occurrenceCount})}catch{}},onSelectionChange:i=>{E(this,_e,i.map(r=>r.label)),A(this,L,Ht).call(this),m(this,B).onSelectionChange?.(i)},onSelectionValidityChange:m(this,B).onSelectionValidityChange,onHoldChange:i=>{if(!i){A(this,L,on).call(this);return}let r=m(this,re).operationForHold(i.holdId);r&&A(this,L,tr).call(this,r,!0)},onCheckout:()=>{m(this,Y)&&(A(this,L,Rt).call(this,"checkout"),m(this,B).onContinue?.(m(this,Y)))},onHoldExpired:()=>{A(this,L,on).call(this),A(this,L,te).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),m(this,B).onHoldExpired?.()},onError:i=>A(this,L,tt).call(this,i)},{surface:"season",performanceCount:e.occurrenceCount,selectionMode:"same_seat",suppressPricing:!0,groupSelectionSummary:()=>{let i=m(this,_e).length;return i?{seats:i,performances:e.occurrenceCount,performancesChosen:e.occurrenceCount,perPerformance:i}:null}}));E(this,le,t),await t.render()},ba=function(){m(this,it).replaceChildren();let e=document.createElement("section");e.className="sl-season-root",e.setAttribute("aria-label","Season ticket selection");let t=document.createElement("header");t.className="sl-season-hero";let i=document.createElement("ol");i.className="sl-season-progress",i.setAttribute("aria-label","Season checkout progress");for(let[f,x]of["Choose seats","Review package","Checkout"].entries()){let w=document.createElement("li");w.dataset.state=f===0?"current":"upcoming";let y=document.createElement("span");y.textContent=String(f+1),w.append(y,x),i.append(w)}let r=document.createElement("div");r.className="sl-season-stage";let s=document.createElement("div");s.className="sl-season-map";let o=document.createElement("aside");o.className="sl-season-summary-card",o.setAttribute("aria-label","Your Season selection");let a=document.createElement("h3");a.textContent="Your Season seats";let l=document.createElement("p");l.className="sl-season-selection",l.textContent="Choose a seat on the map.";let c=document.createElement("p");c.className="sl-season-rule";let d=document.createElement("i");d.textContent="1\xD7";let p=document.createElement("span");p.textContent="Each seat you choose is reserved for every included performance.",c.append(d,p);let u=document.createElement("p");u.className="sl-season-availability";let h=document.createElement("p");h.className="sl-season-checkout-note",h.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits.",o.append(a,l,c,u,h),r.append(s,o);let g=document.createElement("p");g.className="sl-season-status",g.setAttribute("role","status"),g.setAttribute("aria-live","polite"),e.append(t,i,r,g),m(this,it).append(e),E(this,Ie,e),E(this,Ot,s),E(this,je,g),E(this,Oe,l),E(this,nt,u)},va=function(){let e=m(this,ue),t=m(this,B).offer,i=m(this,Ie).querySelector(".sl-season-hero");i.replaceChildren();let r=document.createElement("div");r.className="sl-season-copy";let s=document.createElement("p");s.className="sl-season-eyebrow",s.textContent=t?.eyebrow??"Season ticket";let o=document.createElement("h2");o.textContent=e.edition?`${e.name} \xB7 ${e.edition}`:e.name;let a=document.createElement("p");a.className="sl-season-promise",a.textContent=`Choose once and keep the same seat for all ${e.occurrenceCount} included performances.`;let l=document.createElement("div");l.className="sl-season-facts";for(let f of[`${e.occurrenceCount} performances`,e.venue,t?.renewalLabel??"Same-seat package"].filter(Boolean)){let x=document.createElement("span");x.className="sl-season-fact",x.textContent=f,l.append(x)}r.append(s,o,a,l),i.append(r);let c=document.createElement("div");c.className="sl-season-offer";let d=document.createElement("span");d.className="sl-season-offer-label",d.textContent=t?.priceLabel?"Season package":"Package price";let p=document.createElement(t?.priceLabel?"strong":"span");if(p.className=t?.priceLabel?"sl-season-price":"sl-season-price-note",p.textContent=t?.priceLabel??"Confirmed by your ticketing platform at checkout",c.append(d,p),t?.compareAtPriceLabel){let f=document.createElement("span");f.className="sl-season-was",f.textContent=t.compareAtPriceLabel,c.append(f)}if(t?.savingsLabel){let f=document.createElement("span");f.className="sl-season-saving",f.textContent=t.savingsLabel,c.append(f)}if(t?.priceNote){let f=document.createElement("span");f.className="sl-season-price-note",f.textContent=t.priceNote,c.append(f)}if(i.append(c),t?.benefits?.length){let f=document.createElement("ul");f.className="sl-season-benefits";for(let x of t.benefits.slice(0,6)){let w=document.createElement("li");w.textContent=x,f.append(w)}i.append(f)}let u=document.createElement("details");u.className="sl-season-dates";let h=document.createElement("summary");h.textContent=`All ${e.occurrenceCount} performances included`;let g=document.createElement("ol");g.className="sl-season-date-list";for(let f of e.occurrences){let x=document.createElement("li");x.className="sl-season-date";let w=document.createElement("b");w.textContent=f.name;let y=yd(f,e.timezone,m(this,B).locale),C=document.createElement("time");f.startsAt!=null&&(C.dateTime=new Date(f.startsAt).toISOString()),C.textContent=y.time?`${y.date} \xB7 ${y.time}`:y.date,x.append(w,C),g.append(x)}u.append(h,g),i.append(u),A(this,L,Ht).call(this)},tr=function(e,t){if(e.state==="booked")return E(this,Y,null),m(this,re).forget(e.holdId),m(this,le)?.notifyGroupSettled("booked"),A(this,L,Rt).call(this,"complete"),A(this,L,te).call(this,{kind:"booked",message:`Your Season booking is complete for all ${m(this,ue).occurrenceCount} performances. No further checkout action is needed.`,operationId:e.operationId}),m(this,B).onHoldChange?.(null),null;if(e.state==="partial_terminal")return E(this,Y,null),E(this,_e,[]),m(this,re).forget(e.holdId),m(this,le)?.notifyGroupSettled("lost"),A(this,L,Ht).call(this),A(this,L,Rt).call(this,"review"),A(this,L,te).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),m(this,B).onHoldChange?.(null),null;if(e.state!=="committed")return E(this,Y,null),m(this,re).forget(e.holdId),m(this,le)?.notifyGroupSettled("lost"),A(this,L,te).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),m(this,B).onHoldChange?.(null),null;let i=ua(m(this,ue),e),r=m(this,Y)?.holdId!==i.holdId;return E(this,Y,i),A(this,L,Ht).call(this),A(this,L,Rt).call(this,"review"),m(this,B).onHoldChange?.(i),A(this,L,te).call(this,{kind:"held",message:`Your seats are held for all ${m(this,ue).occurrenceCount} performances. Review and continue to checkout.`,operationId:e.operationId}),r&&t&&m(this,B).onHold?.(i),i},on=function(){E(this,Y,null),E(this,_e,[]),A(this,L,Ht).call(this),A(this,L,Rt).call(this,"choose"),m(this,B).onHoldChange?.(null)},Ht=function(){if(!m(this,Oe))return;let e=m(this,_e).length;if(!e)m(this,Oe).textContent="Choose a seat on the map. Unavailable seats are already booked on at least one included performance.";else{m(this,Oe).replaceChildren();let t=document.createElement("strong");t.textContent=m(this,_e).join(", "),m(this,Oe).append(t,` \xB7 ${e} Season seat${e===1?"":"s"} across all ${m(this,ue)?.occurrenceCount??0} performances`)}m(this,nt)&&m(this,Re)&&(m(this,nt).textContent=`${m(this,Re).freeCount} seat${m(this,Re).freeCount===1?"":"s"} currently available for the complete Season`)},Rt=function(e){let t=e==="choose"?0:e==="review"?1:e==="checkout"?2:3;m(this,Ie)?.querySelectorAll(".sl-season-progress li").forEach((i,r)=>{i.dataset.state=r<t?"done":r===t?"current":"upcoming";let s=i.querySelector("span");s&&(s.textContent=r<t?"\u2713":String(r+1))})},te=function(e,t=!1){m(this,je)&&(m(this,je).textContent=e.message,m(this,je).dataset.kind=e.kind),m(this,Ie)&&(m(this,Ie).dataset.busy=String(t)),m(this,B).onStatusChange?.(e)},tt=function(e,t){let i=e instanceof q?`Season selection unavailable (${e.code}).`:"Season selection could not be completed.";A(this,L,te).call(this,{kind:"failed",message:i,operationId:t}),m(this,B).onError?.(e)},ir=function(){if(m(this,Ge))throw new Error("seatlayer: SeasonPicker was destroyed")},It=function(){if(A(this,L,ir).call(this),!m(this,ue)||!m(this,le))throw new Error("seatlayer: render SeasonPicker before using it")};function ya(n,e={}){let t=e.origin??"";if(!t)try{t=new URL(n.src,window.location.href).origin}catch{t=""}let i=!1,r=null,s=null,o=null,a="",l=null,c=()=>{if(i)return;i=!0,r=n.getAttribute("style"),Object.assign(n.style,{position:"fixed",inset:"0",width:"100vw",height:"100vh",margin:"0",border:"0",zIndex:"2147483000",background:"#101625"});let u=document.documentElement;s=u.style.overflow,u.style.overflow="hidden",document.body&&(o=document.body.style.overflow,document.body.style.overflow="hidden"),l=h=>{h.key==="Escape"&&d()},window.addEventListener("keydown",l)},d=()=>{i&&(i=!1,r===null?n.removeAttribute("style"):n.setAttribute("style",r),r=null,a&&(n.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))},p=u=>{if(u.source!==n.contentWindow||t&&u.origin!==t||!u.data||typeof u.data!="object")return;let h=u.data;if(h.type==="seatlayer:height"){typeof h.px=="number"&&Number.isFinite(h.px)&&h.px>0&&(a=`${Math.round(h.px)}px`,i||(n.style.height=a));return}h.type==="seatlayer:fullscreen"&&(h.on===!0?c():h.on===!1&&d())};return window.addEventListener("message",p),()=>{window.removeEventListener("message",p),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});