@seatlayer/js 0.103.0 → 0.104.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/{chunk-WFAVFYCD.js → chunk-P7YM5BKA.js} +1 -1
- package/dist/index.cjs +42 -34
- package/dist/index.d.cts +27 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +41 -33
- package/dist/manager.cjs +1 -1
- package/dist/manager.js +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var wp=Object.create;var kn=Object.defineProperty;var xp=Object.getOwnPropertyDescriptor;var kp=Object.getOwnPropertyNames;var Sp=Object.getPrototypeOf,Tp=Object.prototype.hasOwnProperty;var ps=i=>{throw TypeError(i)};var $o=(i,e,t)=>()=>{if(t)throw t[0];try{return i&&(e=i(i=0)),e}catch(n){throw t=[n],n}};var hs=(i,e)=>{for(var t in e)kn(i,t,{get:e[t],enumerable:!0})},us=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of kp(e))!Tp.call(i,o)&&o!==t&&kn(i,o,{get:()=>e[o],enumerable:!(n=xp(e,o))||n.enumerable});return i};var ms=(i,e,t)=>(t=i!=null?wp(Sp(i)):{},us(e||!i||!i.__esModule?kn(t,"default",{value:i,enumerable:!0}):t,i)),Ep=i=>us(kn({},"__esModule",{value:!0}),i);var jo=(i,e,t)=>e.has(i)||ps("Cannot "+t);var m=(i,e,t)=>(jo(i,e,"read from private field"),t?t.call(i):e.get(i)),R=(i,e,t)=>e.has(i)?ps("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),S=(i,e,t,n)=>(jo(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t),x=(i,e,t)=>(jo(i,e,"access private method"),t);function Sn(i){if(typeof i!="string"||!i)return null;try{let{protocol:e,hostname:t}=new URL(i);if(e==="https:"||e==="http:"&&(t==="localhost"||t==="127.0.0.1"))return i}catch{}return null}var Go=$o(()=>{"use strict"});function ks(i){return i===void 0||i===""||i===!1||Array.isArray(i)&&!i.length}function xs(i,e,t,n){if(ks(t))return e?"required":null;let o=r=>!!n?.some(s=>s.id===r);if(i==="number")return typeof t=="number"&&Number.isFinite(t)?null:"invalid";if(i==="checkbox")return t===!0?null:"invalid";if(i==="select")return o(t)?null:"invalid";if(i==="multiselect")return Array.isArray(t)&&t.length<=50&&t.every(o)?null:"invalid";if(typeof t!="string")return"invalid";if(i==="phone")return Vp.test(t)?null:"invalid";if(t.length>500)return"too_long";if(i==="email")return Fp.test(t)?null:"invalid";if(i==="date"){let r=zp.exec(t);if(!r)return"invalid";let[s,a,l]=[Number(r[1]),Number(r[2]),Number(r[3])],c=new Date(Date.UTC(s,a-1,l));return c.getUTCFullYear()===s&&c.getUTCMonth()===a-1&&c.getUTCDate()===l?null:"invalid"}return null}function se(i,e,t){let n=document.createElement(i);return e&&(n.className=e),t!==void 0&&(n.textContent=t),n}function Tn(i,e){let t=i?.[e];return t==="optional"||t==="required"?t:"off"}function Ss(i){let{form:e,t,idPrefix:n}=i,o=(e?.questions??[]).filter(k=>k&&!k.archived).sort((k,A)=>k.position-A.position),r=ws.filter(([k])=>Tn(e,k)!=="off"),s=o.filter(k=>k.scope==="ticket"),a=o.filter(k=>k.scope!=="ticket"),l=r.length>0||s.length>0;if(!l&&!a.length)return{details:null,element:null,validate:()=>!0,payload:()=>({}),showServerErrors:()=>!1};let c=r.filter(([,k])=>k!=="phone"),d=r.every(([k])=>Tn(e,k)!=="required")&&s.every(k=>!k.required),p=[...i.tickets],u=!0,h=!1,b=new Map,g=(k,A)=>A===void 0?k:`${k}|${A}`,T=[],w=0,v=se("div","sl-hco-bf sl-hco-bf-inline"),M=se("div","sl-hco-bf"),B=se("p","sl-hco-alert is-error");B.setAttribute("role","alert"),B.hidden=!0;let X=(k,A)=>A==="required"?t("picker.bookingForm.required","This is required."):A==="too_long"?t("picker.bookingForm.tooLong","This is too long."):k==="email"?t("picker.bookingForm.invalidEmail","Enter a valid email address."):k==="phone"?t("picker.bookingForm.invalidPhone","Enter a valid phone number."):t("picker.bookingForm.invalid","Check this answer."),f=(k,A)=>{k.error.textContent=A?X(k.kind,A):"",k.error.hidden=!A;let D=k.kind==="multiselect"||k.control.closest(".sl-hco-chips")?k.control.closest("fieldset")??k.control:k.control;A?D.setAttribute("aria-invalid","true"):D.removeAttribute("aria-invalid"),k.control.closest(".sl-hco-block")?.classList.toggle("has-error",T.some(Q=>Q.ticketKey===k.ticketKey&&!Q.error.hidden))},O=(k,A)=>{let D=se("span",void 0,k);if(A)return D;let Q=se("span","sl-hco-label-row");return Q.append(D," ",se("span","sl-hco-optional",t("checkout.optional","Optional"))),Q},K=(k,A)=>{let D=`${n}-bf${w++}`,Q=g(A.key,A.ticketKey),N=b.get(Q),G=se("div","sl-hco-field"),z=A.help?se("p","sl-hco-help",A.help):null;z&&(z.id=`${D}-h`);let te=se("p","sl-hco-ferr");te.id=`${D}-e`,te.hidden=!0;let ge=re=>{re.setAttribute("aria-describedby",z?`${z.id} ${te.id}`:te.id),A.required&&re.tagName!=="FIELDSET"&&re.setAttribute("aria-required","true")},ce=A.kind==="select"&&(A.options??[]).length<=Gp,He;if(A.kind==="checkbox"||A.kind==="multiselect"||ce){let re=A.kind==="checkbox"?null:se("fieldset",ce?"sl-hco-group sl-hco-chips":"sl-hco-group"),Z=re?A.options??[]:[{id:"",label:A.label}];if(re){ce&&re.setAttribute("role","radiogroup");let pe=se("legend");pe.appendChild(O(A.label,A.required)),re.appendChild(pe),z&&re.appendChild(z),ge(re)}let ve=re?se("div","sl-hco-choices"):null,be=Z.map((pe,nt)=>{let vn=se("label",ce?"sl-hco-chip":"sl-hco-check"),me=se("input");me.type=ce?"radio":"checkbox",me.value=pe.id,ce&&(me.name=D),re?(nt===0&&(me.id=D),me.checked=ce?N===pe.id:Array.isArray(N)&&N.includes(pe.id)):(me.id=D,me.checked=N===!0,ge(me));let Ki=re?se("span",void 0,pe.label):O(A.label,A.required);return vn.append(me,Ki),(ve??G).appendChild(vn),me});re&&ve?(re.appendChild(ve),G.appendChild(re)):z&&G.appendChild(z),He={...A,control:be[0]??re??G,error:te,read:ce?()=>be.find(pe=>pe.checked)?.value??"":re?()=>be.filter(pe=>pe.checked).map(pe=>pe.value):()=>!!be[0]?.checked}}else{let re=se("label","sl-hco-label");re.appendChild(O(A.label,A.required)),re.htmlFor=D;let Z;if(A.kind==="textarea")Z=se("textarea","sl-hco-input"),Z.rows=3,Z.maxLength=500;else if(A.kind==="select"){Z=se("select","sl-hco-input"),Z.appendChild(new Option(t("picker.bookingForm.choose","Choose\u2026"),""));for(let be of A.options??[])Z.appendChild(new Option(be.label,be.id))}else Z=se("input","sl-hco-input"),Z.type=$p[A.kind]??"text",A.kind==="number"?(Z.step="any",Z.inputMode="decimal"):A.kind!=="date"&&(Z.maxLength=A.kind==="phone"?20:500),A.autocomplete&&(Z.autocomplete=A.autocomplete);Z.id=D,typeof N=="string"?Z.value=N:typeof N=="number"&&(Z.value=String(N)),ge(Z),G.append(re,...z?[z]:[],Z);let ve=Z;He={...A,control:Z,error:te,read:()=>{let be=ve.value.trim();return A.kind!=="number"?be:ve.validity?.badInput?Number.NaN:be===""?void 0:Number(be)}}}G.appendChild(te);let ni=()=>{let re=He.read();re===void 0?b.delete(Q):b.set(Q,re),f(He,null)};return G.addEventListener("input",ni),G.addEventListener("change",ni),k.appendChild(G),T.push(He),He},_=(k,A,D)=>K(k,{key:`question:${A.id}`,...D!==void 0?{ticketKey:D}:{},kind:A.type,label:A.label,required:!!A.required,help:A.helpText,options:A.options}),j=(k,A,D,Q)=>{let N=ws.find(([G])=>G===D);return K(k,{key:D,ticketKey:A.key,kind:N[1],label:t(N[2],N[3]),required:Tn(e,D)==="required",autocomplete:Q===0&&u?jp[N[1]]:"off"})},P=(k,A,D="sl-hco-link")=>{let Q=se("button",D,k);return Q.type="button",Q.addEventListener("click",A),Q},$=k=>se("h3","sl-hco-h",k),J=()=>se("section","sl-hco-sec"),W=k=>{if(!k&&p[0]){let D=i.buyer();for(let[Q,N]of c){let G=D[N];G&&b.set(g(Q,p[0].key),G)}h=!0}u=k;for(let[,D]of c)i.buyerError?.(D,null);oe(),(k?M.querySelector(".sl-hco-you .sl-hco-link"):M.querySelector(".sl-hco-block input"))?.focus()};function oe(){T=[],v.replaceChildren(),M.replaceChildren();let k=p[0],A=p.length===1&&u;if(l&&A&&k){for(let[z,te]of r)te==="phone"&&j(v,k,z,0);c.length&&v.appendChild(P(t("checkout.forSomeoneElse","Ticket for someone else?"),()=>W(!1)))}let D=l&&!A&&(!d||h||Ee||!u);if(l&&!A&&!D){let z=J(),te=P("",()=>{h=!0,oe(),M.querySelector(".sl-hco-block input")?.focus()},"sl-hco-disclosure");te.setAttribute("aria-expanded","false"),te.append(se("span","sl-hco-plus","+"),se("span",void 0,t("checkout.addNames","Add names for each ticket")),se("span","sl-hco-optional",t("checkout.optional","Optional"))),z.appendChild(te),M.appendChild(z)}if(D){let z=J();z.appendChild($(t("bookingForm.ticketHolders","Ticket holders"))),p.forEach((te,ge)=>{let ce=se("fieldset","sl-hco-block"),He=se("legend","sl-hco-legend",te.title||t("picker.bookingForm.ticket","Ticket {number}",{number:ge+1}));ce.appendChild(He);let ni=ge===0&&u&&c.length>0;if(ni){let ve=i.buyer(),be=se("p","sl-hco-you"),pe=ve.name||ve.email;be.append(se("span",void 0,pe?t("checkout.holderYou","You \xB7 {name}",{name:pe}):t("checkout.holderYouPlain","You")));let nt=P(t("checkout.change","Change"),()=>W(!1));nt.setAttribute("aria-label",t("checkout.changeHolder","Change the holder of {ticket}",{ticket:He.textContent??""})),be.appendChild(nt),ce.appendChild(be)}else ge===0&&!u&&c.length>0&&ce.appendChild(P(t("picker.bookingForm.useMyDetails","Use my details"),()=>W(!0),"sl-hco-link sl-hco-use"));let re=r.filter(([,ve])=>!(ni&&ve!=="phone")),Z=re.length>1?se("div","sl-hco-pair"):ce;for(let[ve]of re)j(Z,te,ve,ge);Z!==ce&&ce.appendChild(Z);for(let ve of s)_(ce,ve,te.key);z.appendChild(ce)}),M.appendChild(z)}let N=[...l&&A&&k?s.map(z=>({q:z,ticketKey:k.key})):[],...a.map(z=>({q:z,ticketKey:void 0}))],G=[...N.filter(({q:z})=>z.type!=="checkbox"),...N.filter(({q:z})=>z.type==="checkbox")];if(G.length){let z=J();z.appendChild($(t("checkout.questions","A few questions")));for(let{q:te,ticketKey:ge}of G)_(z,te,ge);M.appendChild(z)}M.appendChild(B)}let Ee=!1;oe();let xe=()=>{if(!p[0]||!u)return null;let A=i.buyer(),D=null;for(let[Q,N]of c){let G=xs(N,Tn(e,Q)==="required",A[N]),z=i.buyerError?.(N,G?X(N,G):null)??null;G&&!D&&(D=z)}return D},Ce=k=>(B.textContent=k?t("picker.bookingForm.fix","Some details need attention."):"",B.hidden=!k,k?.focus(),!!k),$e=(k,A)=>k.compareDocumentPosition(A)&4?-1:1;return{details:v,element:M,validate(){let k=[],A=xe();A&&k.push(A);for(let D of T){let Q=xs(D.kind,D.required,D.read(),D.options);f(D,Q),Q&&k.push(D.control)}return k.sort($e),!Ce(k[0]??null)},payload(){let k=new Map,A=[],D=p[0];if(D&&u){let N=i.buyer(),G={ticketKey:D.key};for(let[,z]of c){let te=N[z];te&&(G[z]=te)}(G.name||G.email)&&k.set(D.key,G)}for(let N of T){let G=N.read();if(!ks(G)){if(N.key.startsWith("question:"))A.push({questionId:N.key.slice(9),...N.ticketKey!==void 0?{ticketKey:N.ticketKey}:{},value:G});else if(N.ticketKey!==void 0){let z=k.get(N.ticketKey)??{ticketKey:N.ticketKey},te=N.key==="attendeeName"?"name":N.key==="attendeeEmail"?"email":"phone";z[te]=String(G),k.set(N.ticketKey,z)}}}let Q=p.map(N=>k.get(N.key)).filter(N=>!!N);return{...Q.length?{attendees:Q}:{},...A.length?{answers:A}:{}}},showServerErrors(k){let A=(Array.isArray(k)?k:[]).filter(N=>!!N&&typeof N.key=="string");if(l){let N=!1;for(let G of A)typeof G.ticketKey=="string"&&!p.some(z=>z.key===G.ticketKey)&&(p.push({key:G.ticketKey}),N=!0);Ee=A.some(G=>typeof G.ticketKey=="string"),(N||Ee)&&oe()}let D=[],Q=p[0];for(let N of A){let G=N.key==="attendeeName"?"name":N.key==="attendeeEmail"?"email":null;if(G&&u&&Q&&N.ticketKey===Q.key&&c.some(([,z])=>z===G)){let z=i.buyerError?.(G,X(G,vs.includes(N.code)?N.code:"invalid"));z&&D.push(z)}}for(let N of T){let G=A.find(te=>te.key===N.key&&(te.ticketKey??void 0)===(N.ticketKey??void 0)),z=G?vs.includes(G.code)?G.code:"invalid":null;f(N,z),z&&D.push(N.control)}return D.length?(D.sort($e),Ce(D[0])):(B.textContent=t("picker.bookingForm.fix","Some details need attention."),B.hidden=!1,!1)}}}var Fp,Vp,zp,vs,ws,$p,jp,Gp,Ts=$o(()=>{"use strict";Fp=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Vp=/^[0-9 +()-]{6,20}$/,zp=/^(\d{4})-(\d{2})-(\d{2})$/,vs=["required","invalid","too_long"],ws=[["attendeeName","name","picker.bookingForm.name","Name"],["attendeeEmail","email","picker.bookingForm.email","Email"],["attendeePhone","phone","picker.bookingForm.phone","Phone"]],$p={email:"email",phone:"tel",number:"number",date:"date"};jp={name:"name",email:"email",phone:"tel"},Gp=5});var Hs={};hs(Hs,{CHECKOUT_BUSY_MAX_RETRIES:()=>Ps,checkoutBusyDelayMs:()=>Ms,errorCopy:()=>_t,formatHoldClock:()=>Ls,isCheckoutBusy:()=>Ko,mountCheckout:()=>ih,unavailableCopy:()=>As});function Wp(i,e){try{window.sessionStorage.setItem(qp,JSON.stringify({orderId:i,...e?{eventKey:e}:{},storedAt:Date.now()}))}catch{}}function Xp(){if(typeof document>"u"||document.getElementById(Es))return;let i=document.createElement("style");i.id=Es,i.textContent=Yp,document.head.appendChild(i)}function As(i,e){let t=`${e} ${e===1?"seat is":"seats are"} held for a limited time.`;return i==="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."}:i==="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, 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 Ko(i){if(!i||typeof i!="object")return!1;let e=i;return e.status!==503||e.code==="maintenance_mode"||e.reason==="maintenance_mode"?!1:e.code==="checkout_busy"||e.code==="database_busy"?!0:e.retryable===!0}function Ms(i,e=Math.random){let t=i?.retryAfterS,n=typeof t=="number"&&Number.isFinite(t)&&t>=0?t:Qp,o=Math.floor(Math.max(0,Math.min(1,e()))*Zp);return Math.min(Jp,n*1e3+o)}function eh(i){return`${(typeof i?.notice=="string"?i.notice.trim():"")||(()=>{let n=i?.retryAfterS;if(typeof n!="number"||!Number.isFinite(n)||n<0)return"Booking is paused for a few minutes for maintenance. Please try again shortly.";let o=Math.max(1,Math.ceil(n/60));return`Booking is paused for maintenance. Please try again in about ${o} minute${o===1?"":"s"}.`})()} Nothing was charged. Your seats are still held.`}function _t(i,e){if(i==="maintenance_mode")return eh(e);switch(i){case"checkout_busy":case"database_busy":return e?.free?"We couldn\u2019t confirm your booking yet because it\u2019s very busy. Nothing was charged. Please try again.":"We couldn\u2019t start the payment yet because it\u2019s very busy. Nothing was charged. Please try again.";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. Please try again.";case"hold_not_active":case"hold_not_found":return"Your seats were released before checkout started. Nothing was charged. 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. 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. Please contact the organiser.";case"provider_refused":return"The organiser\u2019s payment provider refused to start this payment. Nothing was charged. Please contact the organiser.";case"rate_limited":return"Too many attempts. Wait a moment and try again.";case"seats_unavailable":return"Those seats were taken while you were filling this in. Nothing was charged. Please pick again.";case"booking_form_incomplete":return"The details this event asks for changed while you were choosing. Nothing was charged. Please go back and try again.";default:return"We could not start the payment. Nothing was charged. Please try again."}}function I(i,e,t){let n=document.createElement(i);return e&&(n.className=e),t!==void 0&&(n.textContent=t),n}function Ot(i,e=18,t="0 0 20 20"){let n=document.createElementNS(Cs,"svg");n.setAttribute("viewBox",t),n.setAttribute("width",String(e)),n.setAttribute("height",String(e)),n.setAttribute("fill","none"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","1.8"),n.setAttribute("stroke-linecap","round"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("aria-hidden","true"),n.setAttribute("focusable","false");for(let o of i){let r=document.createElementNS(Cs,"path");r.setAttribute("d",o),n.appendChild(r)}return n}function Ls(i){let e=Math.max(0,Math.ceil(i/1e3)),t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=String(e%60).padStart(2,"0");return t>0?`${t}:${String(n).padStart(2,"0")}:${o}`:`${n}:${o}`}function ih(i){Xp();let e=!0,t=!1,n=null,o=(C,H,U)=>{let Y=i.t?.(C,U);return Y&&Y!==C?Y:U?H.replace(/\{(\w+)\}/g,(Re,Ie)=>Ie in U?String(U[Ie]):Re):H},r=I("div","sl-hco");r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true");let s=I("div","sl-hco-card");r.appendChild(s);let a=()=>{n&&clearInterval(n),n=null},l=()=>{e=!1,a(),r.remove(),document.removeEventListener("keydown",p,!0)},c=()=>{l(),i.onCancel()},d=!0;function p(C){if(r.isConnected){if(C.key==="Tab"){let H=[...s.querySelectorAll("a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])")].filter(Re=>Re.offsetParent!==null||Re===document.activeElement),U=H[0],Y=H[H.length-1];if(!U||!Y)return;C.shiftKey&&document.activeElement===U?(C.preventDefault(),Y.focus()):!C.shiftKey&&document.activeElement===Y&&(C.preventDefault(),U.focus());return}C.key==="Escape"&&(C.stopPropagation(),C.preventDefault(),d&&c())}}document.addEventListener("keydown",p,!0);let u=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`,h=I("header","sl-hco-head"),b=I("button","sl-hco-back-icon");b.type="button",b.setAttribute("aria-label",o("checkout.back","Back to seats")),b.appendChild(Ot([...gt.back])),b.addEventListener("click",()=>{d&&c()});let g=I("div","sl-hco-htext"),T=I("h2","sl-hco-title",i.event?.name?.trim()||o("checkout.title","Checkout"));T.id=u;let w=I("p","sl-hco-sub",i.event?.detail?.trim()??"");w.hidden=!w.textContent,g.append(T,w);let v=I("span","sl-hco-timer");v.setAttribute("role","timer");let M=I("span");M.setAttribute("aria-hidden","true"),v.append(Ot([...gt.clock],14),M),v.hidden=!0,h.append(b,g,v),r.setAttribute("aria-labelledby",u);let B=I("p","sl-hco-sr");B.setAttribute("aria-live","polite");let X=(...C)=>{s.replaceChildren(h,B,...C)},f=C=>{d=C,b.hidden=!C},O=C=>{let H=I("div","sl-hco-state");H.setAttribute("role",C.alert?"alert":"status");let U=I("div",`sl-hco-state-icon is-${C.tone}`);return U.setAttribute("aria-hidden","true"),U.appendChild(C.icon),H.appendChild(U),C.title&&H.appendChild(I("h3","sl-hco-state-title",C.title)),C.text&&H.appendChild(I("p",`sl-hco-status${C.alert?" sl-hco-error":""}`,C.text)),C.note&&H.appendChild(I("p","sl-hco-state-note",C.note)),H},K=(...C)=>{let H=I("div","sl-hco-body");return H.append(...C),H},_=(...C)=>{let H=I("footer","sl-hco-foot");return H.append(...C),H},j=()=>{let C=I("span","sl-hco-spin");return C.setAttribute("aria-hidden","true"),C},P=(C,H="error")=>{if(!e)return;a(),v.hidden=!0,f(!0);let U=I("button",H==="error"?"sl-hco-back sl-hco-ghost":"sl-hco-pay",H==="expired"?o("checkout.chooseAgain","Choose seats again"):H==="taken"?o("checkout.chooseOther","Choose other seats"):o("checkout.back","Back to seats"));if(U.type="button",U.addEventListener("click",c),H==="error"){let Y=I("p","sl-hco-alert is-error sl-hco-status sl-hco-error",C);Y.setAttribute("role","alert"),X(K(...W?[W]:[],Y),_(U))}else X(K(O({tone:H==="expired"?"warn":"error",icon:Ot([...H==="expired"?gt.hour:gt.seat],24,"0 0 24 24"),title:H==="expired"?o("checkout.expiredTitle","Your seats were released"):o("checkout.takenTitle","Those seats were just taken"),text:C,alert:!1})),_(U));U.focus()},$=(C,H)=>{e&&(a(),v.hidden=!0,f(!1),X(K(O({tone:"neutral",icon:j(),...H?{title:H}:{},text:C}))))},J=async(C,H=!1)=>{$(H?o("checkout.confirmingSeats","Confirming your seats\u2026"):"Payment received. Confirming your seats\u2026");let U=Date.now()+Kp;for(;e&&Date.now()<U;){try{let Y=await i.orderStatus(C);if(!e)return;if(Y.status==="confirmed"){t=!0,f(!1),T.textContent=o("checkout.confirmedTitle","Your tickets are confirmed");let Re=I("p","sl-hco-status",`${Y.seatCount} ${Y.seatCount===1?"seat":"seats"} confirmed. Your tickets, with their door QR codes, are in your email.`),Ie=I("dl","sl-hco-receipt"),Fe=(Y.tickets??[]).map(Rt=>Rt.displayLabel||Rt.label);Fe.length&&Ie.append(I("dt",void 0,"Seats"),I("dd",void 0,Fe.join(", ")));let Xe=H||Y.totalMinor===0;Ie.append(I("dt",void 0,Xe?o("checkout.price","Price"):o("checkout.paid","Paid")),I("dd",void 0,Xe?o("checkout.free","Free"):`${Y.amountFormatted} ${Y.currency}`),I("dt",void 0,o("checkout.order","Order")),I("dd","sl-hco-ref",Y.orderId));let oi=I("button","sl-hco-back","Close");oi.type="button",oi.addEventListener("click",c);let mt=I("div","sl-hco-state");if(mt.append(Re,Ie),Y.ticketUrl){let Rt=I("a","sl-hco-tickets",o("checkout.viewTickets","View tickets & QR codes"));Rt.href=Y.ticketUrl,Rt.target="_blank",Rt.rel="noreferrer",mt.appendChild(Rt)}mt.appendChild(oi),X(K(mt)),d=!0,i.onConfirmed(Y);return}if(Y.status==="failed"||Y.status==="expired"){Y.status==="expired"?P("Your seats were released before payment completed. Nothing was charged. Please pick again.","expired"):P("The payment did not complete. If you were charged, it has been refunded automatically.");return}}catch{}await new Promise(Y=>setTimeout(Y,Up))}!e||t||P(H?"Still confirming your booking. Once it is confirmed, your tickets will arrive by email. Nothing was charged.":"Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly. You do not need to pay again.")},W=null;if(i.state.kind==="unavailable"){let C=As(i.state.reason,i.state.seatCount);T.textContent=C.title;let H=I("button","sl-hco-back sl-hco-ghost","Back to seat map");H.type="button",H.addEventListener("click",c);let U=I("p","sl-hco-label","Seats held");return X(K(U,O({tone:"neutral",icon:Ot([...gt.seat],24,"0 0 24 24"),text:C.body,note:C.detail})),_(H)),i.root.appendChild(r),H.focus(),{destroy:l}}if(i.state.kind==="resume")return i.root.appendChild(r),J(i.state.orderId),{destroy:l};let{order:oe,bookingForm:Ee}=i.state,xe=i.state.free===!0,Ce=C=>xe?o("checkout.free","Free"):i.formatMoney(C,oe.currency),$e=Ce(oe.total);W=I("section","sl-hco-sec sl-hco-order sl-hco-summary");let k=oe.lines?.length?oe.lines:oe.labels.map(C=>({label:C,detail:null,amount:null})),A=k.length===1?[k[0].label,k[0].detail].filter(Boolean).join(" \xB7 "):`${oe.tickets?.length||k.length} ${(oe.tickets?.length||k.length)===1?"seat":"seats"}`,D=I("button","sl-hco-order-toggle");D.type="button",D.setAttribute("aria-expanded","false"),D.append(I("span",void 0,A),Ot([...gt.down])),D.addEventListener("click",()=>{let C=!W.hasAttribute("data-open");W.toggleAttribute("data-open",C),D.setAttribute("aria-expanded",String(C))});let Q=I("div","sl-hco-order-full"),N=I("ul","sl-hco-lines sl-hco-seats");for(let C of k){let H=I("li","sl-hco-line sl-hco-seat"),U=I("span","sl-hco-line-text");U.appendChild(I("span","sl-hco-where",C.label)),C.detail&&U.appendChild(I("span","sl-hco-what",C.detail)),H.appendChild(U),typeof C.amount=="number"&&H.appendChild(I("span","sl-hco-price",Ce(C.amount))),N.appendChild(H)}Q.append(I("h3","sl-hco-h",o("checkout.yourOrder","Your order")),N),W.append(D,Q);let G=I("form","sl-hco-form");G.noValidate=!0;let z=C=>{let H=I("div","sl-hco-field"),U=I("label","sl-hco-label"),Y=I("span","sl-hco-label-row");Y.appendChild(I("span",void 0,C.label));let Re=I("span","sl-hco-optional",o("checkout.optional","Optional"));C.optional&&Y.append(" ",Re),U.appendChild(Y),U.htmlFor=C.id;let Ie=C.hint?I("p","sl-hco-help",C.hint):null;Ie&&(Ie.id=`${C.id}-h`);let Fe=I("input","sl-hco-input");Fe.type=C.type,Fe.id=C.id,Fe.autocomplete=C.autocomplete,Fe.placeholder=C.placeholder;let Xe=I("p","sl-hco-ferr");Xe.id=`${C.id}-e`,Xe.hidden=!0,Fe.setAttribute("aria-describedby",Ie?`${Ie.id} ${Xe.id}`:Xe.id),H.append(U,...Ie?[Ie]:[],Fe,Xe);let oi=mt=>{Xe.textContent=mt??"",Xe.hidden=!mt,mt?Fe.setAttribute("aria-invalid","true"):Fe.removeAttribute("aria-invalid")};return Fe.addEventListener("input",()=>oi(null)),{wrap:H,input:Fe,optional:Re,setError:oi}},te=z({id:`${u}-email`,label:o("checkout.email","Email"),type:"email",autocomplete:"email",placeholder:"you@example.com",hint:o("checkout.emailHint","Your tickets are sent here."),optional:!1}),ge=te.input;ge.required=!0,ge.inputMode="email";let ce=z({id:`${u}-name`,label:o("checkout.name","Name"),type:"text",autocomplete:"name",placeholder:o("checkout.namePlaceholder","Your name"),optional:!0}),He=ce.input;Ee?.attendeeName==="required"&&(ce.optional.previousSibling?.remove(),ce.optional.remove(),He.setAttribute("aria-required","true"));let re=()=>/.+@.+\..+/.test(ge.value.trim()),Z=Ss({form:Ee,tickets:oe.tickets??[],idPrefix:u,t:o,buyer:()=>({name:He.value.trim(),email:ge.value.trim()}),buyerError:(C,H)=>((C==="name"?ce:te).setError(H),C==="name"?He:ge)}),ve=I("section","sl-hco-sec");ve.append(I("h3","sl-hco-h",o("checkout.yourDetails","Your details")),te.wrap,ce.wrap,...Z.details?.childNodes.length?[Z.details]:[]);let be=I("p","sl-hco-note");be.append(`${o("checkout.privacy","The organizer and SeatLayer use your details to issue and manage your tickets.")} `);let pe=I("a",void 0,o("checkout.privacyLink","Privacy Policy"));pe.href="https://seatlayer.io/privacy/",pe.target="_blank",pe.rel="noreferrer",be.appendChild(pe);let nt=I("fieldset","sl-hco-fields");nt.append(W,ve,...Z.element?[Z.element]:[],be);let vn=K(nt),me=I("p","sl-hco-alert is-error sl-hco-status sl-hco-error");me.setAttribute("role","alert"),me.hidden=!0;let Ki=C=>{me.textContent=C,me.hidden=!1},Ui=I("p","sl-hco-alert is-warn");Ui.hidden=!0;let rs=I("div","sl-hco-total"),ss=oe.tickets?.length||oe.labels.length;rs.append(I("span",void 0,`${ss} ${ss===1?"seat":"seats"}`),I("strong",void 0,$e));let as=xe?o("checkout.confirmBooking","Confirm booking"):o("checkout.continue","Continue to payment"),Ht=I("button","sl-hco-pay",as);Ht.type="submit";let wn=I("p","sl-hco-sr");wn.setAttribute("role","status");let ls=C=>{Ht.replaceChildren(j(),C),wn.textContent=C},Vo=I("p","sl-hco-trust");xe||Vo.appendChild(Ot([...gt.lock],12,"0 0 16 16")),Vo.append(xe?o("checkout.freeTrust","Free booking. Nothing is charged."):o("checkout.trust","Secure payment on the organizer\u2019s payment page. We never see your card.")),G.append(vn,_(me,Ui,rs,Ht,wn,Vo));let cs=null,ds=()=>{let C=oe.expiresAt-Date.now(),H=Ls(C);M.textContent=H,v.setAttribute("aria-label",o("checkout.heldFor","Seats held for {time}",{time:H}));let U=C<=th;v.classList.toggle("is-warn",U),Ui.hidden=!U||!me.hidden,U&&(Ui.textContent=o("checkout.expiringSoon","Your seats are held for {time}. Finish soon to keep them.",{time:H}));let Y=C<=3e4?30:U?120:null;Y&&cs!==Y&&(cs=Y,B.textContent=Ui.textContent),C<=0&&P(o("checkout.expiredBody","The hold on {seats} ran out before payment started.",{seats:k.map(Re=>Re.label).join(", ")}),"expired")},yp=()=>{Number.isFinite(oe.expiresAt)&&(a(),v.hidden=!1,ds(),n=setInterval(ds,1e3))},xn=!1,vp=async()=>{if(!xn){xn=!0,me.hidden=!0,nt.disabled=!0,Ht.disabled=!0,ls(xe?o("checkout.confirmingBooking","Confirming your booking\u2026"):o("checkout.opening","Opening secure payment\u2026"));try{let C={holdId:oe.holdId,buyerEmail:ge.value.trim(),...He.value.trim()?{buyerName:He.value.trim()}:{},...Z.payload(),bookingFormVersion:1},H=0,U;for(;;)try{U=await i.startSession(C);break}catch(Re){if(!e)return;if(H>=Ps||!Ko(Re))throw Re;if(H+=1,ls(xe?o("checkout.busyRetryingBooking","Busy right now. Still confirming your booking\u2026"):o("checkout.busyRetryingPayment","Busy right now. Still opening secure payment\u2026")),await new Promise(Ie=>setTimeout(Ie,Ms(Re))),!e)return}if(!e)return;if(U.status==="confirmed"){J(U.orderId,!0);return}let Y=Sn(U.redirectUrl);if(Y){Wp(U.orderId,i.eventKey),a(),v.hidden=!0,X(K(O({tone:"neutral",icon:Ot([...gt.card],24,"0 0 24 24"),title:o("checkout.redirectTitle","Taking you to secure payment"),text:o("checkout.redirectBody","You\u2019ll pay {amount} on the organizer\u2019s payment page, then come back here for your tickets.",{amount:$e}),note:o("checkout.dontClose","Don\u2019t close this tab.")}))),window.location.assign(Y);return}P(_t("gateway_unavailable"))}catch(C){i.onError?.(C);let H=C;if(H?.code==="booking_form_incomplete"&&Z.element){zo(),Z.showServerErrors(H.fields);return}if(Ko(H)){zo(),Ki(xe?o("checkout.busyFailedBooking",_t("checkout_busy",{free:!0})):o("checkout.busyFailedPayment",_t("checkout_busy"))),Ht.textContent=o("checkout.tryAgain","Try again");return}if(H?.code==="hold_not_active"||H?.code==="hold_not_found"){P(_t(H.code),"expired");return}if(H?.code==="seats_unavailable"){P(o("checkout.seatsUnavailable",_t(H.code)),"taken");return}P(_t(H?.code,H))}}};G.addEventListener("submit",C=>{if(C.preventDefault(),xn)return;let H=re();te.setError(H?null:o("checkout.error.email","Enter an email like name@example.com."));let U=Z.validate();if(!H){Ki(o("bookingForm.fixErrors","Some details need attention before you continue.")),ge.focus();return}if(!U){Ki(o("bookingForm.fixErrors","Some details need attention before you continue."));return}vp()});let zo=()=>{T.textContent=i.event?.name?.trim()||o("checkout.title","Checkout"),me.hidden=!0,me.textContent="",xn=!1,nt.disabled=!1,Ht.disabled=!1,Ht.textContent=as,wn.textContent="",f(!0),X(G),yp()};return zo(),i.root.appendChild(r),(typeof window.matchMedia!="function"||window.matchMedia("(min-width: 561px)").matches)&&ge.focus(),{destroy:l}}var Kp,Up,Es,qp,Yp,Ps,Qp,Zp,Jp,Cs,gt,th,Rs=$o(()=>{"use strict";Go();Ts();Kp=9e4,Up=2e3,Es="seatlayer-checkout-style",qp="@seatlayer/pending-checkout/v1";Yp=`
|
|
1
|
+
"use strict";var Cp=Object.create;var Sn=Object.defineProperty;var Ap=Object.getOwnPropertyDescriptor;var Pp=Object.getOwnPropertyNames;var Mp=Object.getPrototypeOf,Lp=Object.prototype.hasOwnProperty;var ps=i=>{throw TypeError(i)};var jo=(i,e,t)=>()=>{if(t)throw t[0];try{return i&&(e=i(i=0)),e}catch(n){throw t=[n],n}};var hs=(i,e)=>{for(var t in e)Sn(i,t,{get:e[t],enumerable:!0})},us=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Pp(e))!Lp.call(i,o)&&o!==t&&Sn(i,o,{get:()=>e[o],enumerable:!(n=Ap(e,o))||n.enumerable});return i};var ms=(i,e,t)=>(t=i!=null?Cp(Mp(i)):{},us(e||!i||!i.__esModule?Sn(t,"default",{value:i,enumerable:!0}):t,i)),Hp=i=>us(Sn({},"__esModule",{value:!0}),i);var Ko=(i,e,t)=>e.has(i)||ps("Cannot "+t);var m=(i,e,t)=>(Ko(i,e,"read from private field"),t?t.call(i):e.get(i)),R=(i,e,t)=>e.has(i)?ps("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),S=(i,e,t,n)=>(Ko(i,e,"write to private field"),n?n.call(i,t):e.set(i,t),t),x=(i,e,t)=>(Ko(i,e,"access private method"),t);function Cn(i){if(typeof i!="string"||!i)return null;try{let{protocol:e,hostname:t}=new URL(i);if(e==="https:"||e==="http:"&&(t==="localhost"||t==="127.0.0.1"))return i}catch{}return null}var Go=jo(()=>{"use strict"});function Rs(i){return i===void 0||i===""||i===!1||Array.isArray(i)&&!i.length}function Hs(i,e,t,n){if(Rs(t))return e?"required":null;let o=r=>!!n?.some(s=>s.id===r);if(i==="number")return typeof t=="number"&&Number.isFinite(t)?null:"invalid";if(i==="checkbox")return t===!0?null:"invalid";if(i==="select")return o(t)?null:"invalid";if(i==="multiselect")return Array.isArray(t)&&t.length<=50&&t.every(o)?null:"invalid";if(typeof t!="string")return"invalid";if(i==="phone")return rh.test(t)?null:"invalid";if(t.length>500)return"too_long";if(i==="email")return oh.test(t)?null:"invalid";if(i==="date"){let r=sh.exec(t);if(!r)return"invalid";let[s,a,l]=[Number(r[1]),Number(r[2]),Number(r[3])],c=new Date(Date.UTC(s,a-1,l));return c.getUTCFullYear()===s&&c.getUTCMonth()===a-1&&c.getUTCDate()===l?null:"invalid"}return null}function se(i,e,t){let n=document.createElement(i);return e&&(n.className=e),t!==void 0&&(n.textContent=t),n}function An(i,e){let t=i?.[e];return t==="optional"||t==="required"?t:"off"}function Is(i){let{form:e,t,idPrefix:n}=i,o=(e?.questions??[]).filter(k=>k&&!k.archived).sort((k,A)=>k.position-A.position),r=Ls.filter(([k])=>An(e,k)!=="off"),s=o.filter(k=>k.scope==="ticket"),a=o.filter(k=>k.scope!=="ticket"),l=r.length>0||s.length>0;if(!l&&!a.length)return{details:null,element:null,validate:()=>!0,payload:()=>({}),showServerErrors:()=>!1};let c=r.filter(([,k])=>k!=="phone"),d=r.every(([k])=>An(e,k)!=="required")&&s.every(k=>!k.required),p=[...i.tickets],u=!0,h=!1,b=new Map,g=(k,A)=>A===void 0?k:`${k}|${A}`,T=[],w=0,v=se("div","sl-hco-bf sl-hco-bf-inline"),M=se("div","sl-hco-bf"),F=se("p","sl-hco-alert is-error");F.setAttribute("role","alert"),F.hidden=!0;let X=(k,A)=>A==="required"?t("picker.bookingForm.required","This is required."):A==="too_long"?t("picker.bookingForm.tooLong","This is too long."):k==="email"?t("picker.bookingForm.invalidEmail","Enter a valid email address."):k==="phone"?t("picker.bookingForm.invalidPhone","Enter a valid phone number."):t("picker.bookingForm.invalid","Check this answer."),f=(k,A)=>{k.error.textContent=A?X(k.kind,A):"",k.error.hidden=!A;let D=k.kind==="multiselect"||k.control.closest(".sl-hco-chips")?k.control.closest("fieldset")??k.control:k.control;A?D.setAttribute("aria-invalid","true"):D.removeAttribute("aria-invalid"),k.control.closest(".sl-hco-block")?.classList.toggle("has-error",T.some(Q=>Q.ticketKey===k.ticketKey&&!Q.error.hidden))},O=(k,A)=>{let D=se("span",void 0,k);if(A)return D;let Q=se("span","sl-hco-label-row");return Q.append(D," ",se("span","sl-hco-optional",t("checkout.optional","Optional"))),Q},G=(k,A)=>{let D=`${n}-bf${w++}`,Q=g(A.key,A.ticketKey),N=b.get(Q),K=se("div","sl-hco-field"),$=A.help?se("p","sl-hco-help",A.help):null;$&&($.id=`${D}-h`);let te=se("p","sl-hco-ferr");te.id=`${D}-e`,te.hidden=!0;let ge=re=>{re.setAttribute("aria-describedby",$?`${$.id} ${te.id}`:te.id),A.required&&re.tagName!=="FIELDSET"&&re.setAttribute("aria-required","true")},ce=A.kind==="select"&&(A.options??[]).length<=ch,He;if(A.kind==="checkbox"||A.kind==="multiselect"||ce){let re=A.kind==="checkbox"?null:se("fieldset",ce?"sl-hco-group sl-hco-chips":"sl-hco-group"),Z=re?A.options??[]:[{id:"",label:A.label}];if(re){ce&&re.setAttribute("role","radiogroup");let pe=se("legend");pe.appendChild(O(A.label,A.required)),re.appendChild(pe),$&&re.appendChild($),ge(re)}let ve=re?se("div","sl-hco-choices"):null,be=Z.map((pe,nt)=>{let wn=se("label",ce?"sl-hco-chip":"sl-hco-check"),me=se("input");me.type=ce?"radio":"checkbox",me.value=pe.id,ce&&(me.name=D),re?(nt===0&&(me.id=D),me.checked=ce?N===pe.id:Array.isArray(N)&&N.includes(pe.id)):(me.id=D,me.checked=N===!0,ge(me));let Gi=re?se("span",void 0,pe.label):O(A.label,A.required);return wn.append(me,Gi),(ve??K).appendChild(wn),me});re&&ve?(re.appendChild(ve),K.appendChild(re)):$&&K.appendChild($),He={...A,control:be[0]??re??K,error:te,read:ce?()=>be.find(pe=>pe.checked)?.value??"":re?()=>be.filter(pe=>pe.checked).map(pe=>pe.value):()=>!!be[0]?.checked}}else{let re=se("label","sl-hco-label");re.appendChild(O(A.label,A.required)),re.htmlFor=D;let Z;if(A.kind==="textarea")Z=se("textarea","sl-hco-input"),Z.rows=3,Z.maxLength=500;else if(A.kind==="select"){Z=se("select","sl-hco-input"),Z.appendChild(new Option(t("picker.bookingForm.choose","Choose\u2026"),""));for(let be of A.options??[])Z.appendChild(new Option(be.label,be.id))}else Z=se("input","sl-hco-input"),Z.type=ah[A.kind]??"text",A.kind==="number"?(Z.step="any",Z.inputMode="decimal"):A.kind!=="date"&&(Z.maxLength=A.kind==="phone"?20:500),A.autocomplete&&(Z.autocomplete=A.autocomplete);Z.id=D,typeof N=="string"?Z.value=N:typeof N=="number"&&(Z.value=String(N)),ge(Z),K.append(re,...$?[$]:[],Z);let ve=Z;He={...A,control:Z,error:te,read:()=>{let be=ve.value.trim();return A.kind!=="number"?be:ve.validity?.badInput?Number.NaN:be===""?void 0:Number(be)}}}K.appendChild(te);let ni=()=>{let re=He.read();re===void 0?b.delete(Q):b.set(Q,re),f(He,null)};return K.addEventListener("input",ni),K.addEventListener("change",ni),k.appendChild(K),T.push(He),He},_=(k,A,D)=>G(k,{key:`question:${A.id}`,...D!==void 0?{ticketKey:D}:{},kind:A.type,label:A.label,required:!!A.required,help:A.helpText,options:A.options}),j=(k,A,D,Q)=>{let N=Ls.find(([K])=>K===D);return G(k,{key:D,ticketKey:A.key,kind:N[1],label:t(N[2],N[3]),required:An(e,D)==="required",autocomplete:Q===0&&u?lh[N[1]]:"off"})},P=(k,A,D="sl-hco-link")=>{let Q=se("button",D,k);return Q.type="button",Q.addEventListener("click",A),Q},z=k=>se("h3","sl-hco-h",k),J=()=>se("section","sl-hco-sec"),W=k=>{if(!k&&p[0]){let D=i.buyer();for(let[Q,N]of c){let K=D[N];K&&b.set(g(Q,p[0].key),K)}h=!0}u=k;for(let[,D]of c)i.buyerError?.(D,null);oe(),(k?M.querySelector(".sl-hco-you .sl-hco-link"):M.querySelector(".sl-hco-block input"))?.focus()};function oe(){T=[],v.replaceChildren(),M.replaceChildren();let k=p[0],A=p.length===1&&u;if(l&&A&&k){for(let[$,te]of r)te==="phone"&&j(v,k,$,0);c.length&&v.appendChild(P(t("checkout.forSomeoneElse","Ticket for someone else?"),()=>W(!1)))}let D=l&&!A&&(!d||h||Ee||!u);if(l&&!A&&!D){let $=J(),te=P("",()=>{h=!0,oe(),M.querySelector(".sl-hco-block input")?.focus()},"sl-hco-disclosure");te.setAttribute("aria-expanded","false"),te.append(se("span","sl-hco-plus","+"),se("span",void 0,t("checkout.addNames","Add names for each ticket")),se("span","sl-hco-optional",t("checkout.optional","Optional"))),$.appendChild(te),M.appendChild($)}if(D){let $=J();$.appendChild(z(t("bookingForm.ticketHolders","Ticket holders"))),p.forEach((te,ge)=>{let ce=se("fieldset","sl-hco-block"),He=se("legend","sl-hco-legend",te.title||t("picker.bookingForm.ticket","Ticket {number}",{number:ge+1}));ce.appendChild(He);let ni=ge===0&&u&&c.length>0;if(ni){let ve=i.buyer(),be=se("p","sl-hco-you"),pe=ve.name||ve.email;be.append(se("span",void 0,pe?t("checkout.holderYou","You \xB7 {name}",{name:pe}):t("checkout.holderYouPlain","You")));let nt=P(t("checkout.change","Change"),()=>W(!1));nt.setAttribute("aria-label",t("checkout.changeHolder","Change the holder of {ticket}",{ticket:He.textContent??""})),be.appendChild(nt),ce.appendChild(be)}else ge===0&&!u&&c.length>0&&ce.appendChild(P(t("picker.bookingForm.useMyDetails","Use my details"),()=>W(!0),"sl-hco-link sl-hco-use"));let re=r.filter(([,ve])=>!(ni&&ve!=="phone")),Z=re.length>1?se("div","sl-hco-pair"):ce;for(let[ve]of re)j(Z,te,ve,ge);Z!==ce&&ce.appendChild(Z);for(let ve of s)_(ce,ve,te.key);$.appendChild(ce)}),M.appendChild($)}let N=[...l&&A&&k?s.map($=>({q:$,ticketKey:k.key})):[],...a.map($=>({q:$,ticketKey:void 0}))],K=[...N.filter(({q:$})=>$.type!=="checkbox"),...N.filter(({q:$})=>$.type==="checkbox")];if(K.length){let $=J();$.appendChild(z(t("checkout.questions","A few questions")));for(let{q:te,ticketKey:ge}of K)_($,te,ge);M.appendChild($)}M.appendChild(F)}let Ee=!1;oe();let xe=()=>{if(!p[0]||!u)return null;let A=i.buyer(),D=null;for(let[Q,N]of c){let K=Hs(N,An(e,Q)==="required",A[N]),$=i.buyerError?.(N,K?X(N,K):null)??null;K&&!D&&(D=$)}return D},Ce=k=>(F.textContent=k?t("picker.bookingForm.fix","Some details need attention."):"",F.hidden=!k,k?.focus(),!!k),ze=(k,A)=>k.compareDocumentPosition(A)&4?-1:1;return{details:v,element:M,validate(){let k=[],A=xe();A&&k.push(A);for(let D of T){let Q=Hs(D.kind,D.required,D.read(),D.options);f(D,Q),Q&&k.push(D.control)}return k.sort(ze),!Ce(k[0]??null)},payload(){let k=new Map,A=[],D=p[0];if(D&&u){let N=i.buyer(),K={ticketKey:D.key};for(let[,$]of c){let te=N[$];te&&(K[$]=te)}(K.name||K.email)&&k.set(D.key,K)}for(let N of T){let K=N.read();if(!Rs(K)){if(N.key.startsWith("question:"))A.push({questionId:N.key.slice(9),...N.ticketKey!==void 0?{ticketKey:N.ticketKey}:{},value:K});else if(N.ticketKey!==void 0){let $=k.get(N.ticketKey)??{ticketKey:N.ticketKey},te=N.key==="attendeeName"?"name":N.key==="attendeeEmail"?"email":"phone";$[te]=String(K),k.set(N.ticketKey,$)}}}let Q=p.map(N=>k.get(N.key)).filter(N=>!!N);return{...Q.length?{attendees:Q}:{},...A.length?{answers:A}:{}}},showServerErrors(k){let A=(Array.isArray(k)?k:[]).filter(N=>!!N&&typeof N.key=="string");if(l){let N=!1;for(let K of A)typeof K.ticketKey=="string"&&!p.some($=>$.key===K.ticketKey)&&(p.push({key:K.ticketKey}),N=!0);Ee=A.some(K=>typeof K.ticketKey=="string"),(N||Ee)&&oe()}let D=[],Q=p[0];for(let N of A){let K=N.key==="attendeeName"?"name":N.key==="attendeeEmail"?"email":null;if(K&&u&&Q&&N.ticketKey===Q.key&&c.some(([,$])=>$===K)){let $=i.buyerError?.(K,X(K,Ms.includes(N.code)?N.code:"invalid"));$&&D.push($)}}for(let N of T){let K=A.find(te=>te.key===N.key&&(te.ticketKey??void 0)===(N.ticketKey??void 0)),$=K?Ms.includes(K.code)?K.code:"invalid":null;f(N,$),$&&D.push(N.control)}return D.length?(D.sort(ze),Ce(D[0])):(F.textContent=t("picker.bookingForm.fix","Some details need attention."),F.hidden=!1,!1)}}}var oh,rh,sh,Ms,Ls,ah,lh,ch,Os=jo(()=>{"use strict";oh=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,rh=/^[0-9 +()-]{6,20}$/,sh=/^(\d{4})-(\d{2})-(\d{2})$/,Ms=["required","invalid","too_long"],Ls=[["attendeeName","name","picker.bookingForm.name","Name"],["attendeeEmail","email","picker.bookingForm.email","Email"],["attendeePhone","phone","picker.bookingForm.phone","Phone"]],ah={email:"email",phone:"tel",number:"number",date:"date"};lh={name:"name",email:"email",phone:"tel"},ch=5});var $s={};hs($s,{CHECKOUT_BUSY_MAX_RETRIES:()=>Bs,checkoutBusyDelayMs:()=>Fs,errorCopy:()=>_t,formatHoldClock:()=>Vs,isCheckoutBusy:()=>Uo,mountCheckout:()=>xh,unavailableCopy:()=>Ds});function uh(i,e){try{window.sessionStorage.setItem(hh,JSON.stringify({orderId:i,...e?{eventKey:e}:{},storedAt:Date.now()}))}catch{}}function fh(){if(typeof document>"u"||document.getElementById(_s))return;let i=document.createElement("style");i.id=_s,i.textContent=mh,document.head.appendChild(i)}function Ds(i,e){let t=`${e} ${e===1?"seat is":"seats are"} held for a limited time.`;return i==="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."}:i==="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, 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 Uo(i){if(!i||typeof i!="object")return!1;let e=i;return e.status!==503||e.code==="maintenance_mode"||e.reason==="maintenance_mode"?!1:e.code==="checkout_busy"||e.code==="database_busy"?!0:e.retryable===!0}function Fs(i,e=Math.random){let t=i?.retryAfterS,n=typeof t=="number"&&Number.isFinite(t)&&t>=0?t:gh,o=Math.floor(Math.max(0,Math.min(1,e()))*bh);return Math.min(yh,n*1e3+o)}function vh(i){return`${(typeof i?.notice=="string"?i.notice.trim():"")||(()=>{let n=i?.retryAfterS;if(typeof n!="number"||!Number.isFinite(n)||n<0)return"Booking is paused for a few minutes for maintenance. Please try again shortly.";let o=Math.max(1,Math.ceil(n/60));return`Booking is paused for maintenance. Please try again in about ${o} minute${o===1?"":"s"}.`})()} Nothing was charged. Your seats are still held.`}function _t(i,e){if(i==="maintenance_mode")return vh(e);switch(i){case"checkout_busy":case"database_busy":return e?.free?"We couldn\u2019t confirm your booking yet because it\u2019s very busy. Nothing was charged. Please try again.":"We couldn\u2019t start the payment yet because it\u2019s very busy. Nothing was charged. Please try again.";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. Please try again.";case"hold_not_active":case"hold_not_found":return"Your seats were released before checkout started. Nothing was charged. 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. 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. Please contact the organiser.";case"provider_refused":return"The organiser\u2019s payment provider refused to start this payment. Nothing was charged. Please contact the organiser.";case"rate_limited":return"Too many attempts. Wait a moment and try again.";case"seats_unavailable":return"Those seats were taken while you were filling this in. Nothing was charged. Please pick again.";case"booking_form_incomplete":return"The details this event asks for changed while you were choosing. Nothing was charged. Please go back and try again.";default:return"We could not start the payment. Nothing was charged. Please try again."}}function I(i,e,t){let n=document.createElement(i);return e&&(n.className=e),t!==void 0&&(n.textContent=t),n}function Ot(i,e=18,t="0 0 20 20"){let n=document.createElementNS(Ns,"svg");n.setAttribute("viewBox",t),n.setAttribute("width",String(e)),n.setAttribute("height",String(e)),n.setAttribute("fill","none"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","1.8"),n.setAttribute("stroke-linecap","round"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("aria-hidden","true"),n.setAttribute("focusable","false");for(let o of i){let r=document.createElementNS(Ns,"path");r.setAttribute("d",o),n.appendChild(r)}return n}function Vs(i){let e=Math.max(0,Math.ceil(i/1e3)),t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=String(e%60).padStart(2,"0");return t>0?`${t}:${String(n).padStart(2,"0")}:${o}`:`${n}:${o}`}function xh(i){fh();let e=!0,t=!1,n=null,o=(C,H,U)=>{let Y=i.t?.(C,U);return Y&&Y!==C?Y:U?H.replace(/\{(\w+)\}/g,(Re,Ie)=>Ie in U?String(U[Ie]):Re):H},r=I("div","sl-hco");r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true");let s=I("div","sl-hco-card");r.appendChild(s);let a=()=>{n&&clearInterval(n),n=null},l=()=>{e=!1,a(),r.remove(),document.removeEventListener("keydown",p,!0)},c=()=>{l(),i.onCancel()},d=!0;function p(C){if(r.isConnected){if(C.key==="Tab"){let H=[...s.querySelectorAll("a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])")].filter(Re=>Re.offsetParent!==null||Re===document.activeElement),U=H[0],Y=H[H.length-1];if(!U||!Y)return;C.shiftKey&&document.activeElement===U?(C.preventDefault(),Y.focus()):!C.shiftKey&&document.activeElement===Y&&(C.preventDefault(),U.focus());return}C.key==="Escape"&&(C.stopPropagation(),C.preventDefault(),d&&c())}}document.addEventListener("keydown",p,!0);let u=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`,h=I("header","sl-hco-head"),b=I("button","sl-hco-back-icon");b.type="button",b.setAttribute("aria-label",o("checkout.back","Back to seats")),b.appendChild(Ot([...gt.back])),b.addEventListener("click",()=>{d&&c()});let g=I("div","sl-hco-htext"),T=I("h2","sl-hco-title",i.event?.name?.trim()||o("checkout.title","Checkout"));T.id=u;let w=I("p","sl-hco-sub",i.event?.detail?.trim()??"");w.hidden=!w.textContent,g.append(T,w);let v=I("span","sl-hco-timer");v.setAttribute("role","timer");let M=I("span");M.setAttribute("aria-hidden","true"),v.append(Ot([...gt.clock],14),M),v.hidden=!0,h.append(b,g,v),r.setAttribute("aria-labelledby",u);let F=I("p","sl-hco-sr");F.setAttribute("aria-live","polite");let X=(...C)=>{s.replaceChildren(h,F,...C)},f=C=>{d=C,b.hidden=!C},O=C=>{let H=I("div","sl-hco-state");H.setAttribute("role",C.alert?"alert":"status");let U=I("div",`sl-hco-state-icon is-${C.tone}`);return U.setAttribute("aria-hidden","true"),U.appendChild(C.icon),H.appendChild(U),C.title&&H.appendChild(I("h3","sl-hco-state-title",C.title)),C.text&&H.appendChild(I("p",`sl-hco-status${C.alert?" sl-hco-error":""}`,C.text)),C.note&&H.appendChild(I("p","sl-hco-state-note",C.note)),H},G=(...C)=>{let H=I("div","sl-hco-body");return H.append(...C),H},_=(...C)=>{let H=I("footer","sl-hco-foot");return H.append(...C),H},j=()=>{let C=I("span","sl-hco-spin");return C.setAttribute("aria-hidden","true"),C},P=(C,H="error")=>{if(!e)return;a(),v.hidden=!0,f(!0);let U=I("button",H==="error"?"sl-hco-back sl-hco-ghost":"sl-hco-pay",H==="expired"?o("checkout.chooseAgain","Choose seats again"):H==="taken"?o("checkout.chooseOther","Choose other seats"):o("checkout.back","Back to seats"));if(U.type="button",U.addEventListener("click",c),H==="error"){let Y=I("p","sl-hco-alert is-error sl-hco-status sl-hco-error",C);Y.setAttribute("role","alert"),X(G(...W?[W]:[],Y),_(U))}else X(G(O({tone:H==="expired"?"warn":"error",icon:Ot([...H==="expired"?gt.hour:gt.seat],24,"0 0 24 24"),title:H==="expired"?o("checkout.expiredTitle","Your seats were released"):o("checkout.takenTitle","Those seats were just taken"),text:C,alert:!1})),_(U));U.focus()},z=(C,H)=>{e&&(a(),v.hidden=!0,f(!1),X(G(O({tone:"neutral",icon:j(),...H?{title:H}:{},text:C}))))},J=async(C,H=!1)=>{z(H?o("checkout.confirmingSeats","Confirming your seats\u2026"):"Payment received. Confirming your seats\u2026");let U=Date.now()+dh;for(;e&&Date.now()<U;){try{let Y=await i.orderStatus(C);if(!e)return;if(Y.status==="confirmed"){t=!0,f(!1),T.textContent=o("checkout.confirmedTitle","Your tickets are confirmed");let Re=I("p","sl-hco-status",`${Y.seatCount} ${Y.seatCount===1?"seat":"seats"} confirmed. Your tickets, with their door QR codes, are in your email.`),Ie=I("dl","sl-hco-receipt"),Fe=(Y.tickets??[]).map(Rt=>Rt.displayLabel||Rt.label);Fe.length&&Ie.append(I("dt",void 0,"Seats"),I("dd",void 0,Fe.join(", ")));let Xe=H||Y.totalMinor===0;Ie.append(I("dt",void 0,Xe?o("checkout.price","Price"):o("checkout.paid","Paid")),I("dd",void 0,Xe?o("checkout.free","Free"):`${Y.amountFormatted} ${Y.currency}`),I("dt",void 0,o("checkout.order","Order")),I("dd","sl-hco-ref",Y.orderId));let oi=I("button","sl-hco-back","Close");oi.type="button",oi.addEventListener("click",c);let mt=I("div","sl-hco-state");if(mt.append(Re,Ie),Y.ticketUrl){let Rt=I("a","sl-hco-tickets",o("checkout.viewTickets","View tickets & QR codes"));Rt.href=Y.ticketUrl,Rt.target="_blank",Rt.rel="noreferrer",mt.appendChild(Rt)}mt.appendChild(oi),X(G(mt)),d=!0,i.onConfirmed(Y);return}if(Y.status==="failed"||Y.status==="expired"){Y.status==="expired"?P("Your seats were released before payment completed. Nothing was charged. Please pick again.","expired"):P("The payment did not complete. If you were charged, it has been refunded automatically.");return}}catch{}await new Promise(Y=>setTimeout(Y,ph))}!e||t||P(H?"Still confirming your booking. Once it is confirmed, your tickets will arrive by email. Nothing was charged.":"Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly. You do not need to pay again.")},W=null;if(i.state.kind==="unavailable"){let C=Ds(i.state.reason,i.state.seatCount);T.textContent=C.title;let H=I("button","sl-hco-back sl-hco-ghost","Back to seat map");H.type="button",H.addEventListener("click",c);let U=I("p","sl-hco-label","Seats held");return X(G(U,O({tone:"neutral",icon:Ot([...gt.seat],24,"0 0 24 24"),text:C.body,note:C.detail})),_(H)),i.root.appendChild(r),H.focus(),{destroy:l}}if(i.state.kind==="resume")return i.root.appendChild(r),J(i.state.orderId),{destroy:l};let{order:oe,bookingForm:Ee}=i.state,xe=i.state.free===!0,Ce=C=>xe?o("checkout.free","Free"):i.formatMoney(C,oe.currency),ze=Ce(oe.total);W=I("section","sl-hco-sec sl-hco-order sl-hco-summary");let k=oe.lines?.length?oe.lines:oe.labels.map(C=>({label:C,detail:null,amount:null})),A=k.length===1?[k[0].label,k[0].detail].filter(Boolean).join(" \xB7 "):`${oe.tickets?.length||k.length} ${(oe.tickets?.length||k.length)===1?"seat":"seats"}`,D=I("button","sl-hco-order-toggle");D.type="button",D.setAttribute("aria-expanded","false"),D.append(I("span",void 0,A),Ot([...gt.down])),D.addEventListener("click",()=>{let C=!W.hasAttribute("data-open");W.toggleAttribute("data-open",C),D.setAttribute("aria-expanded",String(C))});let Q=I("div","sl-hco-order-full"),N=I("ul","sl-hco-lines sl-hco-seats");for(let C of k){let H=I("li","sl-hco-line sl-hco-seat"),U=I("span","sl-hco-line-text");U.appendChild(I("span","sl-hco-where",C.label)),C.detail&&U.appendChild(I("span","sl-hco-what",C.detail)),H.appendChild(U),typeof C.amount=="number"&&H.appendChild(I("span","sl-hco-price",Ce(C.amount))),N.appendChild(H)}Q.append(I("h3","sl-hco-h",o("checkout.yourOrder","Your order")),N),W.append(D,Q);let K=I("form","sl-hco-form");K.noValidate=!0;let $=C=>{let H=I("div","sl-hco-field"),U=I("label","sl-hco-label"),Y=I("span","sl-hco-label-row");Y.appendChild(I("span",void 0,C.label));let Re=I("span","sl-hco-optional",o("checkout.optional","Optional"));C.optional&&Y.append(" ",Re),U.appendChild(Y),U.htmlFor=C.id;let Ie=C.hint?I("p","sl-hco-help",C.hint):null;Ie&&(Ie.id=`${C.id}-h`);let Fe=I("input","sl-hco-input");Fe.type=C.type,Fe.id=C.id,Fe.autocomplete=C.autocomplete,Fe.placeholder=C.placeholder;let Xe=I("p","sl-hco-ferr");Xe.id=`${C.id}-e`,Xe.hidden=!0,Fe.setAttribute("aria-describedby",Ie?`${Ie.id} ${Xe.id}`:Xe.id),H.append(U,...Ie?[Ie]:[],Fe,Xe);let oi=mt=>{Xe.textContent=mt??"",Xe.hidden=!mt,mt?Fe.setAttribute("aria-invalid","true"):Fe.removeAttribute("aria-invalid")};return Fe.addEventListener("input",()=>oi(null)),{wrap:H,input:Fe,optional:Re,setError:oi}},te=$({id:`${u}-email`,label:o("checkout.email","Email"),type:"email",autocomplete:"email",placeholder:"you@example.com",hint:o("checkout.emailHint","Your tickets are sent here."),optional:!1}),ge=te.input;ge.required=!0,ge.inputMode="email";let ce=$({id:`${u}-name`,label:o("checkout.name","Name"),type:"text",autocomplete:"name",placeholder:o("checkout.namePlaceholder","Your name"),optional:!0}),He=ce.input;Ee?.attendeeName==="required"&&(ce.optional.previousSibling?.remove(),ce.optional.remove(),He.setAttribute("aria-required","true"));let re=()=>/.+@.+\..+/.test(ge.value.trim()),Z=Is({form:Ee,tickets:oe.tickets??[],idPrefix:u,t:o,buyer:()=>({name:He.value.trim(),email:ge.value.trim()}),buyerError:(C,H)=>((C==="name"?ce:te).setError(H),C==="name"?He:ge)}),ve=I("section","sl-hco-sec");ve.append(I("h3","sl-hco-h",o("checkout.yourDetails","Your details")),te.wrap,ce.wrap,...Z.details?.childNodes.length?[Z.details]:[]);let be=I("p","sl-hco-note");be.append(`${o("checkout.privacy","The organizer and SeatLayer use your details to issue and manage your tickets.")} `);let pe=I("a",void 0,o("checkout.privacyLink","Privacy Policy"));pe.href="https://seatlayer.io/privacy/",pe.target="_blank",pe.rel="noreferrer",be.appendChild(pe);let nt=I("fieldset","sl-hco-fields");nt.append(W,ve,...Z.element?[Z.element]:[],be);let wn=G(nt),me=I("p","sl-hco-alert is-error sl-hco-status sl-hco-error");me.setAttribute("role","alert"),me.hidden=!0;let Gi=C=>{me.textContent=C,me.hidden=!1},Ui=I("p","sl-hco-alert is-warn");Ui.hidden=!0;let rs=I("div","sl-hco-total"),ss=oe.tickets?.length||oe.labels.length;rs.append(I("span",void 0,`${ss} ${ss===1?"seat":"seats"}`),I("strong",void 0,ze));let as=xe?o("checkout.confirmBooking","Confirm booking"):o("checkout.continue","Continue to payment"),Ht=I("button","sl-hco-pay",as);Ht.type="submit";let xn=I("p","sl-hco-sr");xn.setAttribute("role","status");let ls=C=>{Ht.replaceChildren(j(),C),xn.textContent=C},$o=I("p","sl-hco-trust");xe||$o.appendChild(Ot([...gt.lock],12,"0 0 16 16")),$o.append(xe?o("checkout.freeTrust","Free booking. Nothing is charged."):o("checkout.trust","Secure payment on the organizer\u2019s payment page. We never see your card.")),K.append(wn,_(me,Ui,rs,Ht,xn,$o));let cs=null,ds=()=>{let C=oe.expiresAt-Date.now(),H=Vs(C);M.textContent=H,v.setAttribute("aria-label",o("checkout.heldFor","Seats held for {time}",{time:H}));let U=C<=wh;v.classList.toggle("is-warn",U),Ui.hidden=!U||!me.hidden,U&&(Ui.textContent=o("checkout.expiringSoon","Your seats are held for {time}. Finish soon to keep them.",{time:H}));let Y=C<=3e4?30:U?120:null;Y&&cs!==Y&&(cs=Y,F.textContent=Ui.textContent),C<=0&&P(o("checkout.expiredBody","The hold on {seats} ran out before payment started.",{seats:k.map(Re=>Re.label).join(", ")}),"expired")},Tp=()=>{Number.isFinite(oe.expiresAt)&&(a(),v.hidden=!1,ds(),n=setInterval(ds,1e3))},kn=!1,Ep=async()=>{if(!kn){kn=!0,me.hidden=!0,nt.disabled=!0,Ht.disabled=!0,ls(xe?o("checkout.confirmingBooking","Confirming your booking\u2026"):o("checkout.opening","Opening secure payment\u2026"));try{let C={holdId:oe.holdId,buyerEmail:ge.value.trim(),...He.value.trim()?{buyerName:He.value.trim()}:{},...Z.payload(),bookingFormVersion:1},H=0,U;for(;;)try{U=await i.startSession(C);break}catch(Re){if(!e)return;if(H>=Bs||!Uo(Re))throw Re;if(H+=1,ls(xe?o("checkout.busyRetryingBooking","Busy right now. Still confirming your booking\u2026"):o("checkout.busyRetryingPayment","Busy right now. Still opening secure payment\u2026")),await new Promise(Ie=>setTimeout(Ie,Fs(Re))),!e)return}if(!e)return;if(U.status==="confirmed"){J(U.orderId,!0);return}let Y=Cn(U.redirectUrl);if(Y){uh(U.orderId,i.eventKey),a(),v.hidden=!0,X(G(O({tone:"neutral",icon:Ot([...gt.card],24,"0 0 24 24"),title:o("checkout.redirectTitle","Taking you to secure payment"),text:o("checkout.redirectBody","You\u2019ll pay {amount} on the organizer\u2019s payment page, then come back here for your tickets.",{amount:ze}),note:o("checkout.dontClose","Don\u2019t close this tab.")}))),window.location.assign(Y);return}P(_t("gateway_unavailable"))}catch(C){i.onError?.(C);let H=C;if(H?.code==="booking_form_incomplete"&&Z.element){zo(),Z.showServerErrors(H.fields);return}if(Uo(H)){zo(),Gi(xe?o("checkout.busyFailedBooking",_t("checkout_busy",{free:!0})):o("checkout.busyFailedPayment",_t("checkout_busy"))),Ht.textContent=o("checkout.tryAgain","Try again");return}if(H?.code==="hold_not_active"||H?.code==="hold_not_found"){P(_t(H.code),"expired");return}if(H?.code==="seats_unavailable"){P(o("checkout.seatsUnavailable",_t(H.code)),"taken");return}P(_t(H?.code,H))}}};K.addEventListener("submit",C=>{if(C.preventDefault(),kn)return;let H=re();te.setError(H?null:o("checkout.error.email","Enter an email like name@example.com."));let U=Z.validate();if(!H){Gi(o("bookingForm.fixErrors","Some details need attention before you continue.")),ge.focus();return}if(!U){Gi(o("bookingForm.fixErrors","Some details need attention before you continue."));return}Ep()});let zo=()=>{T.textContent=i.event?.name?.trim()||o("checkout.title","Checkout"),me.hidden=!0,me.textContent="",kn=!1,nt.disabled=!1,Ht.disabled=!1,Ht.textContent=as,xn.textContent="",f(!0),X(K),Tp()};return zo(),i.root.appendChild(r),(typeof window.matchMedia!="function"||window.matchMedia("(min-width: 561px)").matches)&&ge.focus(),{destroy:l}}var dh,ph,_s,hh,mh,Bs,gh,bh,yh,Ns,gt,wh,zs=jo(()=>{"use strict";Go();Os();dh=9e4,ph=2e3,_s="seatlayer-checkout-style",hh="@seatlayer/pending-checkout/v1";mh=`
|
|
2
2
|
/* Three rows: a header naming the event with the hold's countdown, a body that
|
|
3
3
|
scrolls, and a footer that never does, so the total and the one primary
|
|
4
4
|
button are always on screen however long the organizer's form is. On a
|
|
@@ -182,8 +182,8 @@ textarea.sl-hco-input{min-height:76px;resize:vertical}
|
|
|
182
182
|
.sl-hco-order:not([data-open]) .sl-hco-order-full{display:none}
|
|
183
183
|
.sl-hco-order{padding-top:0}
|
|
184
184
|
}
|
|
185
|
-
`;Ps=3,Qp=1,Zp=400,Jp=3e3;Cs="http://www.w3.org/2000/svg";gt={back:["M12.5 4.5 7 10l5.5 5.5"],clock:["M10 2.8a7.2 7.2 0 1 1 0 14.4a7.2 7.2 0 1 1 0-14.4","M10 6.2V10l2.6 1.7"],down:["m5 7.5 5 5 5-5"],lock:["M4.2 8.8h7.6a1.4 1.4 0 0 1 1.4 1.4v4.4a1.4 1.4 0 0 1-1.4 1.4H4.2a1.4 1.4 0 0 1-1.4-1.4v-4.4a1.4 1.4 0 0 1 1.4-1.4z","M5.4 8.8V6.6a2.6 2.6 0 0 1 5.2 0v2.2"],hour:["M12 3a9 9 0 1 1 0 18a9 9 0 1 1 0-18","M12 7v5l3 2"],seat:["M6 11V6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v5M4 11h16v4H4zM6 15v4M18 15v4"],card:["M5 5.5h14a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2z","M3 10h18M7 15h3"],alert:["M12 3a9 9 0 1 1 0 18a9 9 0 1 1 0-18","M12 7.5v5.5M12 16.5v.1"]},th=12e4});var xf={};hs(xf,{ApiError:()=>ie,BuyerAccessContext:()=>De,BuyerAccessUnavailableError:()=>he,BuyerRealtimeClient:()=>Qe,EmbeddedDesigner:()=>mo,PerformanceGroupDestroyedError:()=>ye,PerformanceGroupPicker:()=>No,SEATING_CHART_CALLBACK_PROPS:()=>xr,SEATING_CHART_HANDLE_METHODS:()=>yr,SEATING_CHART_IDENTITY_PROPS:()=>vr,SEATING_CHART_VALUE_PROPS:()=>wr,SeasonApiError:()=>ee,SeasonPicker:()=>Fo,SeasonPublicSessionRefused:()=>pn,SeasonRecoveryTimeoutError:()=>mn,SeatPicker:()=>lt,SeatingChart:()=>uo,attachPickerFrame:()=>bp,bindSeatingChartHandle:()=>gl,buildSeatingChartOptions:()=>bl,createBuyerAccessContext:()=>gi,createControllerSink:()=>ri,parseTicketOfferAvailability:()=>go,prewarmSeatPicker:()=>Ud,shortOperationReference:()=>Ri,ticketOfferPrices:()=>Er});module.exports=Ep(xf);var ae=require("@seatlayer/core");var It="seatlayer.v1";function Cp(i){let e=typeof i.default=="string"?i.default:"free",t={};if(i.seats&&typeof i.seats=="object")for(let[n,o]of Object.entries(i.seats))typeof o=="string"&&o!==e&&(t[n]=o);return{default:e,exceptions:t}}function Ap(i,e){if(!i||i.default!==e.default)return null;let t=[];for(let[n,o]of Object.entries(e.exceptions))i.exceptions[n]!==o&&t.push({label:n,status:o});for(let n of Object.keys(i.exceptions))n in e.exceptions||t.push({label:n,status:e.default});return t}function Pp(i,e){for(let t of e)t.status===i.default?delete i.exceptions[t.label]:i.exceptions[t.label]=t.status}function fs(i){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var Qe=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.reconnectCount=0;this.opts=e,typeof e.url=="string"&&fs(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=[It];if(this.opts.mintTicket){let s;try{s=await this.opts.mintTicket()}catch(a){this.reportIfAccessError(a),this.scheduleReconnect();return}if(this.stopped)return;s?.protocols?.length?(e=[...s.protocols],e.includes(It)||e.unshift(It)):s?.ticket&&(e=[It,`tkt.${s.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let n=typeof this.opts.url=="function"?this.opts.url():this.opts.url,o=this.useQueryMarker?`${n}${n.includes("?")?"&":"?"}pv=1`:n;fs(o);let r;try{r=(this.opts.socketFactory??((a,l)=>new WebSocket(a,l)))(o,e)}catch{this.scheduleReconnect();return}this.ws=r,r.onopen=()=>{this.ws===r&&(this.attempt=0,this.v1=r.protocol===It,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 a;try{a=JSON.parse(typeof s.data=="string"?s.data:"")}catch{return}!a||typeof a!="object"||this.handleFrame(a)},r.onclose=s=>{if(this.ws===r){if(this.ws=null,this.clearTimers(),s?.code===4401){if(s.reason==="access_expired"){this.scheduleReconnect();return}if(s.reason==="idle_expired"&&this.opts.onIdleExpired){this.stopped=!0,this.opts.onIdleExpired();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 n=Array.isArray(e.hidden)?e.hidden:[],o=Array.isArray(e.closed)?e.closed:[],r=n.join("\0"),s=o.join("\0");(r!==this.hidden||s!==this.closedSections)&&(this.hidden=r,this.closedSections=s,this.opts.sink.onSections?.(n,o,{withInventory:t==="snapshot"||!!e.seats}))}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 n=Cp(e),o=Ap(this.projection,n);this.projection=n,o===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(n):this.opts.sink.resync():o.length&&this.opts.sink.applyStatuses(o);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let n=e.changes.filter(o=>typeof o?.label=="string"&&typeof o?.status=="string").map(o=>({label:o.label,status:o.status}));if(!n.length)return;this.projection&&Pp(this.projection,n),this.opts.sink.applyStatuses(n)}}}}answered(){this.resumeTimer&&(clearTimeout(this.resumeTimer),this.resumeTimer=null)}reportIfAccessError(e){let t=e?.reason;e?.name==="BuyerAccessUnavailableError"&&(this.stopped=!0,this.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),n=Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.reconnectCount+=1,this.connect()},n)}get reconnects(){return this.reconnectCount}clearPongTimer(){this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null)}clearTimers(){this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null,this.clearPongTimer(),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.resumeTimer&&clearTimeout(this.resumeTimer),this.resumeTimer=null}};function Mp(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}function ri(i,e={}){let t=n=>{let o=i.tableSelection(n);if(o)return o.physicalSeatIds;let r=i.idForLabel(n);return r?[r]:[]};return{applyStatuses(n){let o=new Set([...i.currentHold()?.labels??[],...e.ownLabels?.()??[]]),r={free:[],held:[],booked:[],not_for_sale:[]},s=[],a=[],l=new Map(i.getSelection().map(c=>[c.label,c.id]));for(let c of n){let d=t(c.label);if(!d.length)continue;let p=Mp(c.status);if(r[p].push(...d),e.flashOnLiveChange&&p!=="free"&&!o.has(c.label)&&d.some(u=>i.getStatus(u)==="free")){let u=p==="held"?"#f4b740":"#f43f5e";for(let h of d)s.push({id:h,color:u})}p!=="free"&&!o.has(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])r[c].length&&i.setStatus(r[c],c);for(let c of s)i.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(p=>t(p));c.length&&i.deselect(c);let d=n.some(p=>p.status==="blocked"&&a.includes(p.label));e.onSelectedObjectUnavailable?.(a,d?"ineligible":"taken")}e.onStatusChange?.()},...i.applyProjection?{applyProjection:n=>{i.applyProjection(n)}}:{},async resync(n){await(i.resync?i.resync(n):i.refresh())},onSections(n,o,r){r?.withInventory||(i.resync?i.resync({reason:"frame"}):i.refresh()),e.onSections?.(n,o,r)}}}var ie=class extends Error{constructor(e,t,n,o,r,s,a,l){super(t),this.name="ApiError",this.status=e,this.code=n,this.conflicts=o,this.reason=r,this.retryAfterS=s,this.notice=a,l?.fields&&(this.fields=l.fields),typeof l?.retryable=="boolean"&&(this.retryable=l.retryable),l?.hint&&(this.hint=l.hint),l?.serverMessage&&(this.serverMessage=l.serverMessage)}},gs=10,bs=1;function qi(i,e){let t=(i??"").trim();if(t){let n=Number(t);if(Number.isFinite(n)&&n>=0)return Math.ceil(n);let o=Date.parse(t);if(Number.isFinite(o))return Math.max(0,Math.ceil((o-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}function Lp(i){let e=i;return!!e&&typeof e.ticketKey=="string"&&typeof e.label=="string"&&Number.isFinite(e.unitIndex)&&Number.isFinite(e.quantity)&&(e.displayLabel===void 0||typeof e.displayLabel=="string")}var Hp={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"};function Rp(){return typeof crypto>"u"?null:typeof crypto.randomUUID=="function"?crypto.randomUUID():typeof crypto.getRandomValues!="function"?null:Array.from(crypto.getRandomValues(new Uint8Array(18)),i=>i.toString(16).padStart(2,"0")).join("")}function Ip(i,e){let t=e.map(n=>[n.label,n.tierId??null,n.quantity??null]).sort((n,o)=>n[0]<o[0]?-1:n[0]>o[0]?1:0);return JSON.stringify([i,t])}function Op(i){return i instanceof ie?i.status===408||i.status===429||i.status>=500:!0}function ys(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}var ft=class{constructor(e,t={}){this.base=e;this.viewerId=ys();this.holdAttempt=null;this.holdIdempotency=!0;this.ticketKeysByHold=new Map;this.access=t.access,this.onObjectUnavailable=t.onObjectUnavailable;let n=t.referral?.trim();this.referral=n?n.slice(0,120):void 0}rotateViewerId(){this.viewerId=ys()}async pickerIdleMinutes(){return null}get accessScoped(){return!!this.access?.configured}async request(e,t={},n={}){let o=t.method??"GET",r={},s;t.body!==void 0&&(r["Content-Type"]="application/json",s=JSON.stringify(t.body));let a=await this.access?.authorization(n.auth?"unauthorized":"initial");if(a&&(r.Authorization=a),t.idempotency){let u=this.holdAttemptKey(`${t.idempotency.binding}\0${a??""}`);t.idempotency.used(u??void 0),u&&(r["Idempotency-Key"]=u)}let l=o==="GET"||e.endsWith("/hold/resume")?new AbortController:null,c=l?setTimeout(()=>l.abort(),4e4):null,d,p;try{d=await fetch(`${this.base}${e}`,{method:o,headers:r,body:s,credentials:"omit",...l?{signal:l.signal}:{}}),p=(d.headers.get("content-type")??"").includes("application/json")?await d.json().catch(h=>{if(l?.signal.aborted)throw h;return null}):null}finally{c!==null&&clearTimeout(c)}if(!d.ok){let u=p,h=u?.code??u?.error,b=d.status===401&&h==="buyer_access_invalid"&&e.endsWith("/hold/resume");if(this.access?.configured&&!b&&(d.status===401||d.status===403||d.status===422)&&await this.access.handleFailure(d.status,h)&&!n.auth)return this.request(e,t,{...n,auth:!0});if(d.status===409){let T=h?Hp[h]:void 0,w=u?.conflicts?.map(v=>v.label)??t.labels??[];T&&this.onObjectUnavailable?.({labels:w,reason:T,code:h})}let g;if(d.status===429&&(g=qi(d.headers.get("Retry-After"),u?.retryAfterSeconds)??bs,o==="GET"&&!n.rateLimit&&g<=gs))return await new Promise(T=>setTimeout(T,g*1e3)),this.request(e,t,{...n,rateLimit:!0});throw d.status===503&&(g=qi(d.headers.get("Retry-After"),u?.retryAfterSeconds)),new ie(d.status,u?.error??`request_failed_${d.status}`,h,u?.conflicts,u?.reason,g,typeof u?.notice=="string"&&u.notice?u.notice:void 0,{...Array.isArray(u?.fields)?{fields:u.fields}:{},...typeof u?.retryable=="boolean"?{retryable:u.retryable}:{},...typeof u?.hint=="string"&&u.hint?{hint:u.hint}:{},...typeof u?.message=="string"&&u.message?{serverMessage:u.message}:{}})}return p}async requestBlob(e,t={}){let n={},o=await this.access?.authorization(t.auth?"unauthorized":"initial");o&&(n.Authorization=o);let r=await fetch(`${this.base}${e}`,{method:"GET",headers:n,credentials:"omit"});if(r.ok)return r.blob();let a=(r.headers.get("content-type")??"").includes("application/json")?await r.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(r.status===401||r.status===403||r.status===422)&&await this.access.handleFailure(r.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(r.status===429&&(c=qi(r.headers.get("Retry-After"),a?.retryAfterSeconds)??bs,!t.rateLimit&&c<=gs))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new ie(r.status,a?.error??`request_failed_${r.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 ie(404,"not_found","not_found"))}async objects(e){return{...await this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`),fetchedAt:Date.now()}}hold(e,t,n,o){let r=`/pub/events/${encodeURIComponent(e)}/hold?pricingContract=matrix-v1`,s={method:"POST",body:{selections:t,...n?{ttlMs:n}:{},...o?{replaceHoldId:o}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(l=>l.label)};return(o||!this.holdIdempotency?this.request(r,s):this.keyedHold(r,s,Ip(e,t))).then(l=>this.noteTicketKeys(l,o))}holdAttemptKey(e){if(this.holdAttempt?.binding===e)return this.holdAttempt.key;let t=Rp();return this.holdAttempt=t?{binding:e,key:t}:null,t}endHoldAttempt(e){e&&this.holdAttempt?.key===e&&(this.holdAttempt=null)}async keyedHold(e,t,n,o=!1){let r;try{let s=await this.request(e,{...t,idempotency:{binding:n,used:a=>{r=a}}});return this.endHoldAttempt(r),s}catch(s){if(Op(s))throw s;this.endHoldAttempt(r);let a=s.code;if(a==="idempotency_key_reused"&&!o)return this.keyedHold(e,t,n,!0);if(a==="invalid_idempotency_key")return this.holdIdempotency=!1,this.request(e,t);throw s}}noteTicketKeys(e,t){if(t&&this.ticketKeysByHold.delete(t),!e?.holdId)return e;let n=Array.isArray(e.ticketKeys)&&e.ticketKeys.every(r=>typeof r=="string")?[...e.ticketKeys]:null,o=Array.isArray(e.ticketKeyDetails)&&e.ticketKeyDetails.every(Lp)?e.ticketKeyDetails.map(({ticketKey:r,label:s,unitIndex:a,quantity:l,displayLabel:c})=>({ticketKey:r,label:s,unitIndex:a,quantity:l,...c?{displayLabel:c}:{}})):null;return n||o?this.ticketKeysByHold.set(e.holdId,{...n?{ticketKeys:n}:{},...o?{ticketKeyDetails:o}:{}}):this.ticketKeysByHold.delete(e.holdId),e}ticketKeysFor(e){let t=this.ticketKeysByHold.get(e);return t?{...t}:null}bestAvailable(e,t,n,o,r){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available?pricingContract=matrix-v1`,{method:"POST",body:{qty:t,...n?{categoryKey:n}:{},...o?{zoneId:o}:{},...r?{ttlMs:r}:{},...this.referral?{referral:this.referral}:{}}}).then(s=>this.noteTicketKeys(s))}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}}).then(n=>this.noteTicketKeys(n))}release(e,t,n){return this.holdAttempt=null,this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:n}}).then(o=>{let r=this.ticketKeysByHold.get(n);if(r){let s=new Set(o?.released??t);this.ticketKeysByHold.set(n,{...r.ticketKeys?{ticketKeys:r.ticketKeys.filter(a=>!s.has(a))}:{},...r.ticketKeyDetails?{ticketKeyDetails:r.ticketKeyDetails.filter(a=>!s.has(a.ticketKey))}:{}})}return o})}extend(e,t,n){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...n?{ttlMs:n}:{}}})}paymentOptions(e){return this.request(`/pub/events/${encodeURIComponent(e)}/payment-options`)}availability(e,t=!1){return this.request(`/pub/events/${encodeURIComponent(e)}/availability?pricingContract=matrix-v1${t?"&live=1":""}`)}startCheckout(e,t){return this.holdAttempt=null,this.request(`/pub/events/${encodeURIComponent(e)}/checkout`,{method:"POST",body:t})}orderStatus(e){return this.request(`/pub/orders/${encodeURIComponent(e)}/status`)}subscribeTicket(e){return this.request(`/pub/events/${encodeURIComponent(e)}/subscribe-tickets`,{method:"POST",body:{}})}subscribeUrl(e){let t=this.base.replace(/^http/,"ws"),n=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${n}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[It]}createRealtime(e,t){return this.accessScoped?null:new Qe({url:this.subscribeUrl(e),sink:t})}};var Xi=require("@seatlayer/core");var Oe=require("@seatlayer/core"),Ks=require("@seatlayer/core/core/seatConfidence");var Uo=require("@seatlayer/core"),Os=require("@seatlayer/core/core/cdnAsset");var _p=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Np=/[\s"'<>`\\]/;function Dp(i){return i.startsWith("//")?!1:i.startsWith("/")||i.startsWith("./")||i.startsWith("../")}function Bp(){try{let i=typeof location>"u"?"":location.origin;return i&&i!=="null"?i:null}catch{return null}}function si(i){if(typeof i!="string"||!i||i.length>2e6||i!==i.trim())return!1;if(i.startsWith("data:"))return _p.test(i);if(Np.test(i))return!1;let e=Bp();if(Dp(i)){if(!e)return!1;try{let t=new URL(i,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(i);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var rh=require("@seatlayer/core/core/cdnAsset");function y(i,e){let t=(0,Uo.t)(i);return t===i?e:t}function Nt(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?y("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):y("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function En(){return{rotate:y("picker.dragToRotateVenue","Drag to rotate the venue"),move:y("picker.dragToMoveVenue","Drag to move the venue"),zoomIn:y("picker.zoomIn","Zoom in"),zoomOut:y("picker.zoomOut","Zoom out"),fitView:y("picker.fitWholeVenue","Show whole venue")}}function _s(i,e){let t=e?i.toLocaleUpperCase(e):i.toLocaleUpperCase(),n=e?i.toLocaleLowerCase(e):i.toLocaleLowerCase();if(i!==t||t===n)return i;let o=[...n][0]??"";return(e?o.toLocaleUpperCase(e):o.toLocaleUpperCase())+n.slice(o.length)}function Ns(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}function q(i){return String(i??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}function Ds(i,e,t){let n=e.find(r=>si(r))??null;if(i.replaceChildren(),!n)return i.textContent=t.slice(0,1).toUpperCase(),null;let o=document.createElement("img");return o.alt="",o.referrerPolicy="no-referrer",o.src=n,i.appendChild(o),n}var ai=null;function Cn(){if(ai!==null)return ai;try{if(typeof document>"u")return ai=!1;ai=!!document.createElement("canvas").getContext("webgl2")}catch{ai=!1}return ai}function qo(i){return(0,Os.cdnAssetUrl)(i)}var Wi=null;function Yi(){return Wi||(Wi=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(qo("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")).catch(e=>{throw Wi=null,e}),Wi)}function An(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Yi().catch(()=>{})}async function Pn(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(qo("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function li(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(qo("seatlayer-checkout.mjs")):Promise.resolve().then(()=>(Rs(),Hs))}function Bs(i){return i==="unavailable_for_event"||i==="payments_off_for_event"?i:"not_configured"}function Fs(i){return i.lineItems.reduce((e,t)=>e+t.quantity,0)}function Wo(i,e){if(i.objectType!=="ga")return i.displayLabel??i.label;let t=e.find(n=>n.id===i.objectId);return i.displayLabel??t?.displayLabel??t?.label??y("picker.generalAdmission","General admission")}function nh(i,e){let t=new Map;for(let n of i){let o=n.rowLabel&&n.seatNumber?[n.sectionLabel,`${y("picker.row","Row")} ${n.rowLabel}`,`${y("picker.seat","Seat")} ${n.seatNumber}`].filter(Boolean).join(" \xB7 "):Wo(n,e),r=[n.categoryLabel,n.tierLabel].filter(Boolean).join(" \xB7 "),s=Math.max(1,Math.floor(n.quantity||1)),a=`${o}\0${r}`,l=t.get(a)??{label:o,detail:r,units:0,amount:0};l.units+=s,l.amount+=n.unitPrice*s,t.set(a,l)}return[...t.values()].map(n=>({label:n.units>1?`${n.label} \xD7${n.units}`:n.label,...n.detail?{detail:n.detail}:{},amount:n.amount}))}var Is=(i,e,t)=>(0,Uo.t)("picker.bookingForm.guestOfCount",{label:i,index:e,total:t});function oh(i,e,t=[]){let n=new Map,o=[];for(let d of i.lineItems){let p=Wo(d,t),u=Math.max(1,Math.floor(d.quantity)||1);if(d.objectType!=="ga"&&!(d.objectType==="table"&&u>1)){o.push({key:d.label,name:p,unitIndex:1,quantity:1});continue}for(let h=1;h<=u;h+=1){let b=(n.get(d.label)??0)+1;n.set(d.label,b),o.push({key:`${d.label}#${b}`,name:p,unitIndex:h,quantity:u})}}let r=e?.ticketKeyDetails??[],s=e?.ticketKeys??r.map(d=>d.ticketKey),a=(s.length===o.length?s:o.map(d=>d.key)).map(d=>{let p=o.find(h=>h.key===d),u=r.find(h=>h.ticketKey===d);return{key:d,name:u?.displayLabel??p?.name,unitIndex:u?.unitIndex??p?.unitIndex??1,quantity:u?.quantity??p?.quantity??1}}),l=new Map;for(let d of a)d.name&&d.quantity<=1&&l.set(d.name,(l.get(d.name)??0)+1);let c=new Map;return a.map(({key:d,name:p,unitIndex:u,quantity:h})=>{if(!p)return{key:d};if(h>1)return{key:d,title:Is(p,u,h)};let b=(c.get(p)??0)+1;c.set(p,b);let g=l.get(p)??1;return{key:d,title:g>1?Is(p,b,g):p}})}function Vs(i,e,t,n,o=[]){let r=new Map;for(let s of i.lineItems){let a=Wo(s,o);r.set(a,(r.get(a)??0)+1)}return{kind:"pay",provider:e,order:{holdId:i.holdId,expiresAt:i.expiresAt,currency:i.currency,total:i.total,labels:[...r].map(([s,a])=>a>1?`${s} \xD7${a}`:s),tickets:oh(i,n,o),lines:nh(i.lineItems,o)},bookingForm:t?.bookingForm??null,...t?.bookingMode==="free"?{free:!0}:{}}}function zs(i){return String(i?.code).startsWith("booking_form_")}function Mn(i,e,t){let n={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},o=new Date(i);if(e)try{return o.toLocaleString(t,{...n,timeZone:e})}catch{}return o.toLocaleString(t,n)}function Yo(i){return/early[\s-]*bird/i.test(i?.trim()??"")}function $s(i){return Yo(i)?'<svg class="sl-offer-icon sl-offer-icon-discount" viewBox="0 0 32 32" aria-hidden="true"><defs><linearGradient id="sl-offer-discount-gradient" x1="29.492" y1="0" x2="20.028" y2="36.183" gradientUnits="userSpaceOnUse"><stop stop-color="#FD6D00"/><stop offset="1" stop-color="#F8B302"/></linearGradient></defs><path d="M16 22.751a1.071 1.071 0 1 0 0-2.142 1.071 1.071 0 0 0 0 2.142ZM16 11.39a1.071 1.071 0 1 0 0-2.141 1.071 1.071 0 0 0 0 2.141Z" fill="url(#sl-offer-discount-gradient)"/><path d="M31.137.863A2.928 2.928 0 0 0 29.054 0H17.836c-.787 0-1.527.307-2.083.863L.863 15.753A2.93 2.93 0 0 0 0 17.836c0 .787.307 1.527.863 2.083l11.218 11.218A2.927 2.927 0 0 0 14.164 32c.787 0 1.527-.307 2.083-.863l14.89-14.89A2.928 2.928 0 0 0 32 14.164V2.946c0-.788-.307-1.527-.863-2.083ZM16 7.374a2.946 2.946 0 1 1 0 5.891 2.946 2.946 0 0 1 0-5.891Zm0 17.252a2.946 2.946 0 1 1 0-5.891 2.946 2.946 0 0 1 0 5.891Zm6.025-7.689H9.975a.938.938 0 0 1 0-1.875h12.05a.938.938 0 0 1 0 1.875Zm4.017-10.041a.938.938 0 1 1 0-1.875.938.938 0 0 1 0 1.875Z" fill="url(#sl-offer-discount-gradient)"/></svg>':'<svg class="sl-offer-icon sl-offer-icon-tag" viewBox="0 0 24 24" aria-hidden="true"><path d="M20.6 13.6 13.7 20.5a2 2 0 0 1-2.8 0L3.5 13.1A2 2 0 0 1 3 11.7V4h7.7a2 2 0 0 1 1.4.6l8.5 8.5a.7.7 0 0 1 0 .5Z"/><circle cx="7.5" cy="8.5" r="1"/></svg>'}function Ln(i,e){return`<span class="sl-offer-mark" role="img" aria-label="${e(i)}" title="${e(i)}">${$s(i)}</span>`}function Hn(i,e){return`<span class="sl-offer-badge">${$s(i)}<span>${e(i)}</span></span>`}function js(i,e=Date.now()){let t=i-e;if(t<=0)return null;let n=Math.max(1,Math.ceil(t/6e4)),o=Math.floor(n/1440),r=Math.floor(n%1440/60),s=n%60;return`${(o>0?[`${o}d`,...r?[`${r}h`]:[]]:[...r?[`${r}h`]:[],...s||!r?[`${s}m`]:[]]).join(" ")} left`}function Xo(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function L(i){return String(i??"").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function Qo(i){return i?(0,Oe.seatNoteRowModel)(i).map(e=>({...e,title:y(e.titleKey,e.titleFallback)})):[]}function Us(i){return Qo(i).map(e=>e.title)}function Dt(i,e={}){return Zo(Qo(i),e)}function Zo(i,e={}){if(!i.length)return"";let t=e.compact?15:17,n=i.map(o=>`<div class="sl-note sl-note-${L(o.tone)}"><span class="sl-note-i">${(0,Oe.seatTypeIconSvg)(o.icon,{size:t})}</span><span class="sl-note-t"><b>${L(o.title)}</b>`+(o.note?`<span class="sl-note-n">${L(o.note)}</span>`:"")+"</span></div>").join("");return`<div class="sl-notes${e.compact?" compact":""}">${n}</div>`}function qs(i){return Qo(i).map(e=>{let t=L(e.note?`${e.title}: ${e.note}`:e.title);return`<span class="sl-cx-mark sl-cx-mark-${L(e.tone)}" role="img" aria-label="${t}" title="${t}">${(0,Oe.seatTypeIconSvg)(e.icon,{size:13})}</span>`}).join("")}function Rn(i){let e=[];return i?.restrictedView&&e.push(y("picker.restrictedView","Restricted view")),i?.obstructedView&&e.push(y("picker.obstructedView","Obstructed view")),e}function Jo(i,e){if(!i)return"";let t=e?y("picker.viewFromThisSeat","View from this seat"):y("picker.seeItIn3d","See it in 3D"),n=e?y("picker.viewFromHere","View from here"):t;return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${n}</span></button>`}function Ws(i,e){if(!e)return"";let t=e,n=t.includes(i.id),o=n?t.length>1?y("picker.openComparison","Open comparison"):y("picker.savedForComparison","Saved for comparison"):t.length?y("picker.compareWithSaved","Compare with saved"):y("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${n&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${L(o)}</span></button>`}function Ys(i,e,t){if(!t)return"";let n=(0,Ks.seatConfidenceDisclosure)(i.confidenceEvidence),o=n.modeledTarget??n.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${L(i.displayLabel??i.label)}"><span><em>${L(e)}</em><strong>${L(n.headline)}</strong><small>${L(o)}</small></span><b>Passport</b></button>`}function fe(i){let e=i?.rowLabel,t=i?.sectionLabel;if(!e||!t)return e;for(let n of["-"," ","\xB7","/","_"]){let o=`${t}${n}`;if(e.startsWith(o)&&e.length>o.length)return e.slice(o.length)}return(0,Oe.compactRowLabel)(e,t)}function sh(i){switch(i){case"paused":return{title:y("picker.accessPausedTitle","These seats are on hold right now"),body:y("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:y("picker.accessRetry","Try again")};case"revoked":return{title:y("picker.accessRevokedTitle","This access link is no longer active"),body:y("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats."),action:y("picker.accessRefresh","Refresh")};case"idle":return{title:y("picker.idlePausedTitle","Your session expired"),body:y("picker.idlePausedBody","You were away for a while. Refresh to see which seats are free now."),action:y("picker.idleRefresh","Show latest seats")};case"no_token":case"provider_failed":return{title:y("picker.accessExpiredTitle","The seat map timed out"),body:y("picker.accessExpiredBody","Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now."),action:y("picker.accessRefresh","Refresh")};default:return{title:y("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:y("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest."),action:y("picker.accessRefresh","Refresh")}}}var ah=6;function Xs(i,e,t){let n=Xo;return[i?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${i.sectionLabel.length>ah?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${y("picker.section","Section")}</span><span class="sl-confirm-value">${n(i.sectionLabel)}</span></div>`:"",i?.rowLabel||i?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${n(t)}</span><span class="sl-confirm-value">${n(fe(i)??i?.displayLabel??e)}</span></div>`:"",i?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${y("picker.seat","Seat")}</span><span class="sl-confirm-value">${n(i?.seatNumber??i?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function Qs(i,e,t){let n=Xo,o=i?.objectType==="booth",r=i?.objectType==="table"&&!!i?.bookingMode,s=o||r||!i?.seatNumber,a=i?.sectionLabel??(s?void 0:i?.displayLabel),l=r?`${y("picker.guests","Guests")} ${i?.bookingMode==="variable"?`${i?.minOccupancy}\u2013${i?.maxOccupancy}`:i?.capacity}`:void 0,d=(s?[l,a?i?.rowLabel??i?.displayLabel:void 0]:[i?.rowLabel?`${t} ${fe(i)??""}`.trim():void 0,`${y("picker.seat","Seat")} ${i?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${n(a)}</span>`:"")+(d?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${n(d)}</span>`:"")+(a||d?"":`<span class="sl-confirm-pos">${n(e)}</span>`)}function Zs(i,e){if(!i)return"";let t=e?y("picker.viewFromThisSeat","View from this seat"):y("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-pill sl-confirm-3dpill" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function Js(i,e){if(!i||e)return"";let t=y("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-3drow" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function Gs(i){return i.buyerMessage?.trim()||(i.restriction==="companion"?y("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function In(i,e,t,n=()=>{}){let o=Xo;if(i.length>1)return`<fieldset class="sl-confirm-tiers"><legend><span>${y("picker.ticketType","Ticket type")}</span></legend>`+i.map(a=>{let l=Gs(a),c=n(a);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${o(a.id)}"${c?` data-offer-name="${o(c)}"`:""} aria-pressed="${a.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${o(a.name)}`+(c?`<span class="sl-confirm-tier-offer">${Hn(c,o)}</span>`:"")+"</span>"+(l?`<small class="sl-confirm-tier-note">${o(l)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${o(t(a))}</span></button>`}).join("")+"</fieldset>";let r=i[0],s=r?Gs(r):void 0;return s?`<p class="sl-confirm-tier-note">${o(s)}</p>`:""}function ea(i){return'<div class="sl-confirm-grid">'+i.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${L(i.categoryLabel)}</span>`+(i.priceLabel?`<span class="sl-confirm-price">${L(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+i.marker+`<span class="sl-confirm-dot" style="background:${L(i.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${L(i.categoryLabel)}</span><span class="sl-confirm-who">`+i.identity+"</span>"+(i.priceLabel?`<span class="sl-confirm-idprice">${L(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+i.commercial+i.tierChoices+i.groupDates+i.wheelchair+(i.thumb||i.see3dPill?`<div class="sl-confirm-strip">${i.thumb}<span class="sl-confirm-pills">${i.see3dPill}</span></div>`:"")+i.inspect+'<div class="sl-confirm-row">'+(i.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${L(i.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${L(i.selectLabel)}</span></button></div></div>`}function ta(i,e){let t=q,{variable:n}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(n?(0,Oe.t)("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):(0,Oe.t)("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(i.displayLabel??i.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(n?y("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,Oe.t)("picker.allPlacesBookedTogether",{count:i.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t((0,Oe.t)("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(y("picker.tableCapacity","Table capacity"))}</span><span>${t((0,Oe.t)("picker.guestsCount",{count:i.capacity}))}</span>`+(i.entrance?`<span class="muted">${t(y("picker.entrance","Entrance"))}</span><span>${t(i.entrance)}</span>`:"")+(e.suppressPricing?"":`<span class="muted">${t(y("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(n?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(y("picker.numberOfGuests","Number of guests"))}</label><div class="sl-table-stepper" role="group" aria-labelledby="sl-table-qty-label"><button type="button" data-table-step="-1" aria-label="${t(y("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${i.quantity}</output><button type="button" data-table-step="1" aria-label="${t(y("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t((0,Oe.t)("picker.chooseMinMaxGuests",{min:i.minOccupancy,max:i.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${i.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t((0,Oe.t)("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?y("picker.updateTable","Update table"):n?y("picker.selectTable","Select table"):y("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function ia(i,e){let t=sh(i),n=document.createElement("div");n.className="sl-interrupt sl-access",n.setAttribute("role","status"),n.setAttribute("aria-live","polite");let o=document.createElement("div");o.className="sl-interrupt-card";let r=document.createElement("div");r.className="sl-interrupt-title",r.textContent=t.title;let s=document.createElement("div");s.className="sl-interrupt-body",s.textContent=t.body,o.append(r,s);let a=document.createElement("div");a.className="sl-interrupt-actions";let l=document.createElement("button");l.type="button",l.className="sl-interrupt-act";let c=document.createElement("span");c.className="sl-interrupt-act-icon",c.setAttribute("aria-hidden","true"),c.textContent="\u21BB";let d=document.createElement("span");return d.textContent=t.action,l.append(c,d),l.addEventListener("click",async()=>{n.classList.add("is-reloading"),l.disabled=!0;try{await e()}catch{}finally{n.isConnected&&(n.classList.remove("is-reloading"),l.disabled=!1)}}),a.appendChild(l),o.appendChild(a),n.appendChild(o),n}function na(i,e){return`<div class="sl-a11yhead"><span class="sl-a11yhead-t">${L(i)}</span><button type="button" class="sl-a11yclose" data-a11y-close aria-label="${q(e)}"><svg viewBox="0 0 24 24" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function oa(i){return i.map(e=>{let t=`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${L(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${e.iconHtml}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${L(e.label)}</span></span>`+(e.count?`<span class="sl-a11yrow-c">${L(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>';return e.note?`<div class="sl-a11yrow-w">${t}${ci({id:`sl-info-${q(e.key.replace(/[^A-Za-z0-9]+/g,"-"))}`,label:e.note,text:L(e.note)})}</div>`:t}).join("")}function ci(i){return`<span class="sl-info"${i.wrapRef?` data-ref="${q(i.wrapRef)}"`:""}><button type="button" class="sl-info-btn" data-sl-info aria-label="${q(i.label)}" aria-describedby="${q(i.id)}" aria-expanded="false"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5"/><path d="M12 8h.01"/></svg></button><span class="sl-info-pop" role="tooltip" id="${q(i.id)}"${i.ref?` data-ref="${q(i.ref)}"`:""}>${i.text}</span></span>`}function ra(i){let e=Math.max(0,i),t=Math.floor(e/6e4),n=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${n}`}function sa(i){let e=i.performanceLabel?`<div class="sl-chip-when">${q(i.performanceLabel)}</div>`:"",t=i.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${q(i.performanceDates.summary)}</span><span class="sl-chip-date-list">${i.performanceDates.labels.map(n=>`<span class="sl-chip-date">${q(n)}</span>`).join("")}</span></div>`:"";return e+lh(i)+t}function lh(i){let{d:e,area:t,label:n,objectType:o,quantity:r=1,identity:s}=i,a=B=>String(B??"\u2014").replace(/[&<>"]/g,X=>({"&":"&","<":"<",">":">",'"':"""})[X]),l=o==="ga"?"ga":e?.objectType??o,c=s?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?y("picker.table","Table"):l==="booth"?y("picker.booth","Booth"):l==="ga"?y("picker.generalAdmission","General admission"):y("picker.row","Row")),d=s?.rowLabel??s?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??n,p=i.categoryLabel?.trim()??"",u="",h=[];l==="table"&&s?.bookingMode?(u=`${c} ${d}`,h.push([y("picker.guests","Guests"),String(r)])):l==="ga"?(u=String(t?.displayLabel??d),r>1&&h.push([y("picker.tickets","Tickets"),String(r)])):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(fe(e)??e.rowLabel)]),e.seatNumber&&h.push([y("picker.seat","Seat"),String(e.seatNumber)]));let b=!u&&!!p,g=u||p||String(d),T=!!p&&!b&&p!==g,w=i.offerName?Ln(i.offerName,a):"",v=h.map(([B,X])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(B)}</span> <b>${a(X)}</b></span>`);T&&v.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(p)}</span>${w}</span>`);let M=[g,...h.map(([B,X])=>`${B} ${X}`),T?p:"",i.offerName??""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(M)}</span><span class="sl-chip-name" aria-hidden="true">${a(g)}${T?"":w}</span>`+(v.length?`<span class="sl-chip-pos" aria-hidden="true">${v.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function er(i,e,t){return i.map(n=>`<option value="${t(n.id)}"${n.id===e?" selected":""}>${t(n.name)}</option>`).join("")}function ch(i){let e=q;return` data-key="${e(i.key)}"`+(i.heldLabels.length?` data-held="${e(encodeURIComponent(i.heldLabels.join(`
|
|
186
|
-
`)))}"`:"")+(i.seatIds.length?` data-seat="${e(i.seatIds.join(" "))}"`:"")+(i.locateId?` data-locate="${e(i.locateId)}"`:"")}function aa(i){let e=q;return`<div class="sl-chip${i.held?" sl-held":""}${i.fresh?" sl-enter":""}"`+ch(i)+">"+(i.held?i.stateHtml:`<span class="sl-chip-dot" style="background:${L(i.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${i.identityHtml}`+(i.extrasHtml?`<div class="sl-chip-sub">${i.extrasHtml}</div>`:"")+`${i.noteHtml}</div>`+(i.amountText?`<span class="amt">${e(i.amountText)}</span>`:"")+i.railHtml+"</div>"}function tr(i,e){let t=q(i),n=e?q(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${n}" aria-label="${q((0,Xi.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 On(i,e){return new Set(i.filter(t=>(e[t.key]??0)<=0).map(t=>t.key))}function _n(i,e){let t=(i.doc?.categories??[]).filter(s=>!s.notForSale),n=e?t.filter(s=>s.key===e):t;if(!n.length)return null;let o=On(n,i.categoryAvailability());return o.size<n.length||(i.currentHold()?.items??[]).some(s=>o.has(s.categoryKey))?null:Object.assign(new Error("seatlayer: that ticket type is sold out"),{status:409,code:"sold_out",reason:"sold_out"})}function la(i){return i.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${y("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,Xi.t)("picker.willFindSeatsTogether",{count:i.quantity})}</b><span>${y("picker.manualTicketsRemovedNote","Your manually selected tickets will be removed only after a new group is secured.")}</span></div><div class="sl-ba-actions"><button type="button" data-ba-cancel>${y("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${y("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="sl-ba-title-t">${y("picker.findSeatsTogether","Find seats together")}</span>`+ci({id:"sl-info-best-seats",label:y("picker.aboutBestSeats","About finding seats together"),text:y("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")})+(i.offerPremium?`<button type="button" class="sl-ba-premium${i.premium?" on":""}" data-ba-premium aria-pressed="${i.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${y("picker.bestSeatsPremium","Best seats")}</button>`:"")+`</div><div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${y("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${i.quantity}</span><button type="button" data-ba="1" aria-label="${y("picker.moreSeats","More seats")}">+</button></div>`+(i.categories.length>1?`<select class="sl-ba-cat" aria-label="${q(y("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${q(y("picker.anyTicketType","Any ticket type"))}</option>`+i.categories.map(e=>e.soldOut?`<option value="${q(e.key)}" disabled>${q(`${e.label} \xB7 ${y("picker.soldOutTitle","Sold out")}`)}</option>`:`<option value="${q(e.key)}"${i.selectedCategory===e.key?" selected":""}>${q(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(i.zones.length?`<select class="sl-ba-zone" aria-label="${y("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${y("picker.anyVenueZone","Any venue zone")}</option>`+i.zones.map(e=>`<option value="${q(e.id)}"${i.selectedZone===e.id?" selected":""}>${q(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${i.busy?" sl-busy":""}"${i.busy?" disabled":""}>`+(i.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${y("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,Xi.tCount)("picker.findBestSeatsCount",i.quantity))+"</button>"+(i.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${y("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function ca(i){return i==="setup"||i==="testable"?{heading:y("picker.salesNotOpenPill","Sales haven\u2019t opened yet"),sentence:y("picker.salesNotOpenCopy","Tickets for this event aren\u2019t on sale yet.")}:i==="paused"?{heading:y("picker.salesPausedPill","Sales are paused"),sentence:y("picker.salesPausedCopy","Ticket sales are paused for now.")}:{heading:y("picker.salesClosedPill","Sales are closed"),sentence:y("picker.salesClosedCopy","Ticket sales for this event have ended.")}}function da(i,e=!1){if(!e&&(i==="setup"||i==="testable"||i==="paused")){let t=ca(i);return{pill:t.heading,cta:t.heading,toast:t.sentence}}return{pill:y("picker.salesClosedPill","Sales are closed"),cta:y("picker.salesClosedCta","Sales closed"),toast:y("picker.salesClosedToast","Sales are closed for this event.")}}function pa(i){if(i.salesClosed&&!i.hasPicks){let e=i.whenText?`<span class="when">${q(i.whenText)}</span>`:"",t=ca(i.salesState);return`<div class="sl-closed-note" role="status"><b>${t.heading}</b><span>${t.sentence}${e}</span></div>`}return""}function ha(i){return i.hasGaAreas?i.seated?i.venue3d?y("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue, or grab standing tickets below."):y("picker.trayHintTapOrStanding","Tap a seat on the map or grab standing tickets below."):i.venue3d?y("picker.gaTrayHintChoose3dArea","Choose an area in the 3D venue to select tickets."):y("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets."):i.groupMode==="per_performance"?y("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):i.groupMode?y("picker.groupTrayHint","Choose seats once. The same seats will be held for every performance."):i.venue3d?y("picker.trayHintChoose3dOrBest","Choose a seat in the 3D venue, or let us pick the best available for you."):y("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}var Ae=require("@seatlayer/core");var hi=require("@seatlayer/core");var Bn=require("@seatlayer/core/core/color");function ot(i){if(!i)return null;let e=i.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 o=t.length<=4?[...t].map(r=>`${r}${r}`).join(""):t;return{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16)}}let n=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i.exec(e);return n?{r:Math.max(0,Math.min(255,Number(n[1]))),g:Math.max(0,Math.min(255,Number(n[2]))),b:Math.max(0,Math.min(255,Number(n[3])))}:null}function Nn(i){return(0,Bn.relativeLuminance255)([i.r,i.g,i.b])}function Ue(i,e){let t=ot(i),n=ot(e);if(!t||!n)return null;let o=Math.max(Nn(t),Nn(n)),r=Math.min(Nn(t),Nn(n));return(o+.05)/(r+.05)}function Bt(i,e="#172033",t="#eef1f8"){return(Ue(e,i)??0)>=(Ue(t,i)??0)?e:t}function dh(i){return(0,Bn.rgb255ToHex)(i.r,i.g,i.b)}function ir(i,e,t){let n=ot(i),o=ot(e);if(!n||!o)return null;let r=Math.max(0,Math.min(1,t));return dh({r:n.r*r+o.r*(1-r),g:n.g*r+o.g*(1-r),b:n.b*r+o.b*(1-r)})}var Dn="#d8a425",ph=.18;function ua(i,e){let t=ir(Dn,e,ph)??e;if((Ue(Dn,t)??0)>=4.5)return Dn;for(let n=.15;n<=1;n+=.05){let o=ir(Dn,i,1-n);if(o&&(Ue(o,t)??0)>=4.5)return o}return Bt(t)}function ma(i,e,t,n){if((Ue(i,t)??4.5)>=4.5&&(Ue(i,n)??4.5)>=4.5)return i;if(!ot(i)||!ot(e))return e;for(let o=.15;o<=1;o+=.05){let r=ir(i,e,1-o);if(r&&(Ue(r,t)??0)>=4.5&&(Ue(r,n)??0)>=4.5)return r}return e}function fa(i){return{"--sl-chrome":i?"#d6dce6":"#556278","--sl-chrome-line":i?"rgba(23,32,51,.55)":"rgba(233,238,247,.55)"}}var ga=["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text","--sl-warn-text","--sl-chrome","--sl-chrome-line"];function ba(i,e){let t=e??i["--sl-bg"],n=ot(t)?Bt(t)==="#172033":!1,o=ot(i["--sl-bg"])?Bt(i["--sl-bg"])==="#172033":!1;if(n===o)return null;let r=n?"#ffffff":"#1a2234",s=Bt(t),a=i["--sl-accent"];return{"--sl-bg":t,"--sl-surface":r,"--sl-text":s,"--sl-muted":n?"#667085":"#a5aec2","--sl-line":n?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-accent-text":ma(a,s,t,r),...fa(n),"--sl-warn-text":ua(s,r)}}var hh="#f7f8fb",ya={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 uh(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function Qi(i){if(i)return i==="auto"?uh()?"dark":"light":i}function di(i,e=i?.mode){if(i?.map)return i.map;let t=Qi(e);return t?{background:ya[t].map}:null}function Fn(i){let e;try{e=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!e)return()=>{};let t=n=>i(n.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 pi(i,e,t){let n=t?ya[t]:null,o=e?.background??n?.background??i?.background??hh,r=ot(o)?Bt(o)==="#172033":!1,s=e?.surface??n?.surface??(r?"#ffffff":"#1a2234"),a=e?.accent??i?.accent??"#f4b740",l=i?.accentInk,c=e?.accentInk??(l&&(Ue(l,a)??4.5)>=4.5?l:Bt(a,"#1a1200","#ffffff")),d=n?void 0:i?.textColor,p=e?.text??n?.text??(d&&(Ue(d,o)??4.5)>=4.5&&(Ue(d,s)??4.5)>=4.5?d:Bt(o));return{"--sl-accent":a,"--sl-accent-ink":c,"--sl-accent-text":ma(a,p,o,s),"--sl-warn-text":ua(p,s),"--sl-bg":o,"--sl-surface":s,"--sl-text":p,"--sl-muted":e?.muted??n?.muted??(r?"#667085":"#a5aec2"),"--sl-line":e?.line??n?.line??(r?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),...fa(r),"--sl-scrim-ink":r?"rgba(16,22,36,1)":"rgba(4,7,13,1)","--sl-font":e?.fontFamily??i?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}function mh(){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 va(i,e,t){let n=document.createElement("div");n.className="sl-picker",n.tabIndex=-1,n.lang=(0,hi.getLocale)(),n.dir=(0,hi.localeDirection)(),i.appendChild(n),Object.entries(pi(void 0,t)).forEach(([r,s])=>n.style.setProperty(r,s)),n.innerHTML=`
|
|
185
|
+
`;Bs=3,gh=1,bh=400,yh=3e3;Ns="http://www.w3.org/2000/svg";gt={back:["M12.5 4.5 7 10l5.5 5.5"],clock:["M10 2.8a7.2 7.2 0 1 1 0 14.4a7.2 7.2 0 1 1 0-14.4","M10 6.2V10l2.6 1.7"],down:["m5 7.5 5 5 5-5"],lock:["M4.2 8.8h7.6a1.4 1.4 0 0 1 1.4 1.4v4.4a1.4 1.4 0 0 1-1.4 1.4H4.2a1.4 1.4 0 0 1-1.4-1.4v-4.4a1.4 1.4 0 0 1 1.4-1.4z","M5.4 8.8V6.6a2.6 2.6 0 0 1 5.2 0v2.2"],hour:["M12 3a9 9 0 1 1 0 18a9 9 0 1 1 0-18","M12 7v5l3 2"],seat:["M6 11V6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v5M4 11h16v4H4zM6 15v4M18 15v4"],card:["M5 5.5h14a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2z","M3 10h18M7 15h3"],alert:["M12 3a9 9 0 1 1 0 18a9 9 0 1 1 0-18","M12 7.5v5.5M12 16.5v.1"]},wh=12e4});var _f={};hs(_f,{ApiError:()=>ie,BuyerAccessContext:()=>De,BuyerAccessUnavailableError:()=>he,BuyerRealtimeClient:()=>Ze,EmbeddedDesigner:()=>fo,PerformanceGroupDestroyedError:()=>ye,PerformanceGroupPicker:()=>Do,SEATING_CHART_CALLBACK_PROPS:()=>xr,SEATING_CHART_HANDLE_METHODS:()=>yr,SEATING_CHART_IDENTITY_PROPS:()=>vr,SEATING_CHART_VALUE_PROPS:()=>wr,SeasonApiError:()=>ee,SeasonPicker:()=>Vo,SeasonPublicSessionRefused:()=>hn,SeasonRecoveryTimeoutError:()=>fn,SeatPicker:()=>lt,SeatingChart:()=>mo,attachPickerFrame:()=>Sp,bindSeatingChartHandle:()=>kl,buildSeatingChartOptions:()=>Sl,createBuyerAccessContext:()=>gi,createControllerSink:()=>ri,parseTicketOfferAvailability:()=>bo,prewarmSeatPicker:()=>Zd,shortOperationReference:()=>Ri,ticketOfferPrices:()=>Er});module.exports=Hp(_f);var ae=require("@seatlayer/core");var Rp={host:"web",platform:"web",bundle:"",protocol:0,chromeOwner:"web"},Ip={...Rp},Tn=null,fs=null;function Op(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function _p(){let i=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:i(Op()),documentMs:Tn==null?0:i(Tn),handshakeMs:Tn==null||fs==null?0:i(fs-Tn)}}function gs(){let{host:i,platform:e,bundle:t,protocol:n,chromeOwner:o}=Ip,r=_p();return{host:i,platform:e,...t?{bundle:t}:{},...n?{protocol:n}:{},chromeOwner:o,bootMs:r.bootMs,documentMs:r.documentMs,handshakeMs:r.handshakeMs}}var bs=new Set,ys=new Map;function ot(i){return bs.has(i)?"repeat":"cold"}function En(i){let e=ot(i);return bs.add(i),e}function Be(i){return typeof i=="number"&&Number.isFinite(i)&&i>=0?Math.round(i):0}function qi(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function Np(i){if(!/^[A-Za-z0-9_-]{1,80}$/.test(i.event))return null;let e=i.performanceProfile??{};return{event:i.event,scope:i.scope,surface:i.surface,outcome:i.outcome,stage:i.stage?.slice(0,32)??"",ms:Be(i.ms),api:Be(e.loadChartAndStatuses)||Be(e.loadChart),scene:Be(e.buildScene),panel:Be(e.buildBuyerControls),paint:Be(e.firstPaint),normalize:Be(e.normalizeBuyerModel),renderer:Be(e.createRenderer),seats:Be(i.seats),floors:Be(i.floors),view:i.view??"map",load:i.load??ot(i.event),transport:i.transport??"pubapi",...gs(),availabilityMs:Be(e.loadStatuses),...typeof i.revealWaitMs=="number"?{revealWaitMs:Be(i.revealWaitMs)}:{},...typeof i.handoverMs=="number"?{handoverMs:Be(i.handoverMs)}:{},mounts:(ys.get(i.event)??0)+1,reconnects:Be(i.reconnects)}}var Dp=new Set;function Qe(i){let e=Np(i);if(e){ys.set(i.event,e.mounts);for(let t of Dp)try{t(e)}catch{}typeof fetch>"u"||qi()||fetch(`${i.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}var Bp="realtime.fallback_polling",vs=new Set;function Fp(i){let e=/^(wss?):\/\/([^/]+)(.*?)\/pub\/events\/([^/?#]+)\/subscribe(?:[?#]|$)/.exec(i);if(!e)return null;let t;try{t=decodeURIComponent(e[4])}catch{return null}return/^[A-Za-z0-9_-]{1,80}$/.test(t)?{apiBase:`${e[1]==="wss"?"https":"http"}://${e[2]}${e[3]}`,eventKey:t}:null}function ws(i){let e=Fp(i);return!e||vs.has(e.eventKey)||(vs.add(e.eventKey),typeof fetch>"u"||qi())?!1:(fetch(`${e.apiBase}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:Bp,eventKey:e.eventKey}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0)}var It="seatlayer.v1",xs="\0",ks=4401,Vp=15e3,$p=25e3,zp=1e4,Ss=5e3,jp=3,Kp=15e3,Ts=6e4;function Gp(i){let e=typeof i.default=="string"?i.default:"free",t={};if(i.seats&&typeof i.seats=="object")for(let[n,o]of Object.entries(i.seats))typeof o=="string"&&o!==e&&(t[n]=o);return{default:e,exceptions:t}}function Up(i,e){if(!i||i.default!==e.default)return null;let t=[];for(let[n,o]of Object.entries(e.exceptions))i.exceptions[n]!==o&&t.push({label:n,status:o});for(let n of Object.keys(i.exceptions))n in e.exceptions||t.push({label:n,status:e.default});return t}function qp(i,e){for(let t of e)t.status===i.default?delete i.exceptions[t.label]:i.exceptions[t.label]=t.status}function Es(i){if(/(?:^|[?&#])(?:token|access_token|bearer|authorization|ticket|tkt|bse)=/i.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL");if(/\bbse_[A-Za-z0-9._-]+/.test(i))throw new Error("seatlayer: refusing to open a socket with a credential in the URL")}var Ze=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.failedUpgrades=0;this.pollTimer=null;this.fellBack=!1;this.reconnectCount=0;this.opts=e,typeof e.url=="string"&&Es(e.url)}get polling(){return this.pollTimer!==null}get protocol(){return this.ws?this.v1?"v1":"legacy":null}get snapshotVersion(){return this.version}start(){this.stopped&&(this.stopped=!1,this.connect())}stop(){this.stopped=!0,this.clearTimers(),this.stopPolling();let e=this.ws;if(this.ws=null,e){e.onopen=null,e.onmessage=null,e.onclose=null,e.onerror=null;try{e.close()}catch{}}}restart(){this.stop(),this.projection=null,this.version=null,this.attempt=0,this.failedUpgrades=0,this.start()}async connect(){if(this.stopped)return;let e=[It];if(this.opts.mintTicket){let a;try{a=await this.opts.mintTicket()}catch(l){this.reportIfAccessError(l),this.scheduleReconnect();return}if(this.stopped)return;a?.protocols?.length?(e=[...a.protocols],e.includes(It)||e.unshift(It)):a?.ticket&&(e=[It,`tkt.${a.ticket}`])}let t=this.version!==null;t&&e.push(`sv.${this.version}`);let n=typeof this.opts.url=="function"?this.opts.url():this.opts.url,o=this.useQueryMarker?`${n}${n.includes("?")?"&":"?"}pv=1`:n;Es(o);let r;try{r=(this.opts.socketFactory??((l,c)=>new WebSocket(l,c)))(o,e)}catch{this.upgradeFailed(),this.scheduleReconnect();return}this.ws=r;let s=!1;r.onopen=()=>{this.ws===r&&(s=!0,this.attempt=0,this.failedUpgrades=0,this.stopPolling(),this.v1=r.protocol===It,this.v1||(this.useQueryMarker=!0),this.startKeepalive(r),t?this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync()},Ss):this.resumeTimer=setTimeout(()=>{this.resumeTimer=null,this.opts.sink.resync({reason:"connect"})},Ss))},r.onmessage=a=>{if(this.ws!==r)return;let l;try{l=JSON.parse(typeof a.data=="string"?a.data:"")}catch{return}!l||typeof l!="object"||this.handleFrame(l)},r.onclose=a=>{if(this.ws===r){if(this.ws=null,this.clearTimers(),!s&&a?.code!==ks&&this.upgradeFailed(),a?.code===ks){if(a.reason==="access_expired"){this.scheduleReconnect();return}if(a.reason==="idle_expired"&&this.opts.onIdleExpired){this.stopped=!0,this.stopPolling(),this.opts.onIdleExpired();return}this.stopped=!0,this.stopPolling(),this.opts.onAccessUnavailable?.({reason:"revoked",code:"access_revoked",retryable:!1});return}this.scheduleReconnect()}},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 n=Array.isArray(e.hidden)?e.hidden:[],o=Array.isArray(e.closed)?e.closed:[],r=n.join(xs),s=o.join(xs);(r!==this.hidden||s!==this.closedSections)&&(this.hidden=r,this.closedSections=s,this.opts.sink.onSections?.(n,o,{withInventory:t==="snapshot"||!!e.seats}))}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 n=Gp(e),o=Up(this.projection,n);this.projection=n,o===null?this.opts.sink.applyProjection?this.opts.sink.applyProjection(n):this.opts.sink.resync():o.length&&this.opts.sink.applyStatuses(o);return}if(t==="delta"&&Array.isArray(e.changes)){this.answered();let n=e.changes.filter(o=>typeof o?.label=="string"&&typeof o?.status=="string").map(o=>({label:o.label,status:o.status}));if(!n.length)return;this.projection&&qp(this.projection,n),this.opts.sink.applyStatuses(n)}}}}answered(){this.resumeTimer&&(clearTimeout(this.resumeTimer),this.resumeTimer=null)}reportIfAccessError(e){let t=e?.reason;e?.name==="BuyerAccessUnavailableError"&&(this.stopped=!0,this.stopPolling(),this.opts.onAccessUnavailable?.({reason:t??"invalid",code:e.code,status:e.status,retryable:t==="paused"}))}upgradeFailed(){this.failedUpgrades+=1,this.failedUpgrades>=jp&&this.startPolling()}startPolling(){if(!(this.pollTimer||this.stopped)){if(!this.fellBack){this.fellBack=!0;try{this.opts.onFallbackPolling?.()}catch{}let e=typeof this.opts.url=="function"?this.opts.url():this.opts.url;ws(e)}this.pollTimer=setInterval(()=>{if(this.stopped){this.stopPolling();return}typeof document<"u"&&document.hidden||Promise.resolve().then(()=>this.opts.poll?this.opts.poll():this.opts.sink.resync({reason:"frame"})).catch(()=>{})},Kp)}}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}startKeepalive(e){this.pingTimer=setInterval(()=>{if(this.ws===e){try{e.send(JSON.stringify({type:"ping"}))}catch{return}this.clearPongTimer(),this.pongTimer=setTimeout(()=>{this.pongTimer=null;try{e.close()}catch{}},zp)}},$p)}scheduleReconnect(){if(this.stopped||this.reconnectTimer)return;let e=Math.min(this.attempt++,5),t=Math.min(1e3*2**e,Vp),n=this.pollTimer?Ts/2+Math.random()*Ts/2:Math.random()*t;this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.reconnectCount+=1,this.connect()},n)}get reconnects(){return this.reconnectCount}clearPongTimer(){this.pongTimer&&(clearTimeout(this.pongTimer),this.pongTimer=null)}clearTimers(){this.pingTimer&&clearInterval(this.pingTimer),this.pingTimer=null,this.clearPongTimer(),this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.resumeTimer&&clearTimeout(this.resumeTimer),this.resumeTimer=null}};function Wp(i){return i==="blocked"?"not_for_sale":i==="held"||i==="booked"||i==="free"||i==="not_for_sale"?i:"free"}function ri(i,e={}){let t=n=>{let o=i.tableSelection(n);if(o)return o.physicalSeatIds;let r=i.idForLabel(n);return r?[r]:[]};return{applyStatuses(n){let o=new Set([...i.currentHold()?.labels??[],...e.ownLabels?.()??[]]),r={free:[],held:[],booked:[],not_for_sale:[]},s=[],a=[],l=new Map(i.getSelection().map(c=>[c.label,c.id]));for(let c of n){let d=t(c.label);if(!d.length)continue;let p=Wp(c.status);if(r[p].push(...d),e.flashOnLiveChange&&p!=="free"&&!o.has(c.label)&&d.some(u=>i.getStatus(u)==="free")){let u=p==="held"?"#f4b740":"#f43f5e";for(let h of d)s.push({id:h,color:u})}p!=="free"&&!o.has(c.label)&&l.has(c.label)&&a.push(c.label)}for(let c of["free","held","booked","not_for_sale"])r[c].length&&i.setStatus(r[c],c);for(let c of s)i.flashSeat(c.id,c.color);if(a.length){let c=a.flatMap(p=>t(p));c.length&&i.deselect(c);let d=n.some(p=>p.status==="blocked"&&a.includes(p.label));e.onSelectedObjectUnavailable?.(a,d?"ineligible":"taken")}e.onStatusChange?.()},...i.applyProjection?{applyProjection:n=>{i.applyProjection(n)}}:{},async resync(n){await(i.resync?i.resync(n):i.refresh())},onSections(n,o,r){r?.withInventory||(i.resync?i.resync({reason:"frame"}):i.refresh()),e.onSections?.(n,o,r)}}}var ie=class extends Error{constructor(e,t,n,o,r,s,a,l){super(t),this.name="ApiError",this.status=e,this.code=n,this.conflicts=o,this.reason=r,this.retryAfterS=s,this.notice=a,l?.fields&&(this.fields=l.fields),typeof l?.retryable=="boolean"&&(this.retryable=l.retryable),l?.hint&&(this.hint=l.hint),l?.serverMessage&&(this.serverMessage=l.serverMessage)}},Cs=10,As=1;function Wi(i,e){let t=(i??"").trim();if(t){let n=Number(t);if(Number.isFinite(n)&&n>=0)return Math.ceil(n);let o=Date.parse(t);if(Number.isFinite(o))return Math.max(0,Math.ceil((o-Date.now())/1e3))}if(typeof e=="number"&&Number.isFinite(e)&&e>=0)return Math.ceil(e)}function Yp(i){let e=i;return!!e&&typeof e.ticketKey=="string"&&typeof e.label=="string"&&Number.isFinite(e.unitIndex)&&Number.isFinite(e.quantity)&&(e.displayLabel===void 0||typeof e.displayLabel=="string")}var Xp={seat_conflict:"taken",conflict:"taken",channel_assignment_conflict:"ineligible",allocation_exhausted:"exhausted"};function Qp(){return typeof crypto>"u"?null:typeof crypto.randomUUID=="function"?crypto.randomUUID():typeof crypto.getRandomValues!="function"?null:Array.from(crypto.getRandomValues(new Uint8Array(18)),i=>i.toString(16).padStart(2,"0")).join("")}function Zp(i,e){let t=e.map(n=>[n.label,n.tierId??null,n.quantity??null]).sort((n,o)=>n[0]<o[0]?-1:n[0]>o[0]?1:0);return JSON.stringify([i,t])}function Jp(i){return i instanceof ie?i.status===408||i.status===429||i.status>=500:!0}function Ps(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`viewer_${Math.random().toString(36).slice(2)}${Date.now().toString(36)}`}var ft=class{constructor(e,t={}){this.base=e;this.viewerId=Ps();this.holdAttempt=null;this.holdIdempotency=!0;this.ticketKeysByHold=new Map;this.access=t.access,this.onObjectUnavailable=t.onObjectUnavailable;let n=t.referral?.trim();this.referral=n?n.slice(0,120):void 0}rotateViewerId(){this.viewerId=Ps()}async pickerIdleMinutes(){return null}get accessScoped(){return!!this.access?.configured}async request(e,t={},n={}){let o=t.method??"GET",r={},s;t.body!==void 0&&(r["Content-Type"]="application/json",s=JSON.stringify(t.body));let a=await this.access?.authorization(n.auth?"unauthorized":"initial");if(a&&(r.Authorization=a),t.idempotency){let u=this.holdAttemptKey(`${t.idempotency.binding}\0${a??""}`);t.idempotency.used(u??void 0),u&&(r["Idempotency-Key"]=u)}let l=o==="GET"||e.endsWith("/hold/resume")?new AbortController:null,c=l?setTimeout(()=>l.abort(),4e4):null,d,p;try{d=await fetch(`${this.base}${e}`,{method:o,headers:r,body:s,credentials:"omit",...l?{signal:l.signal}:{}}),p=(d.headers.get("content-type")??"").includes("application/json")?await d.json().catch(h=>{if(l?.signal.aborted)throw h;return null}):null}finally{c!==null&&clearTimeout(c)}if(!d.ok){let u=p,h=u?.code??u?.error,b=d.status===401&&h==="buyer_access_invalid"&&e.endsWith("/hold/resume");if(this.access?.configured&&!b&&(d.status===401||d.status===403||d.status===422)&&await this.access.handleFailure(d.status,h)&&!n.auth)return this.request(e,t,{...n,auth:!0});if(d.status===409){let T=h?Xp[h]:void 0,w=u?.conflicts?.map(v=>v.label)??t.labels??[];T&&this.onObjectUnavailable?.({labels:w,reason:T,code:h})}let g;if(d.status===429&&(g=Wi(d.headers.get("Retry-After"),u?.retryAfterSeconds)??As,o==="GET"&&!n.rateLimit&&g<=Cs))return await new Promise(T=>setTimeout(T,g*1e3)),this.request(e,t,{...n,rateLimit:!0});throw d.status===503&&(g=Wi(d.headers.get("Retry-After"),u?.retryAfterSeconds)),new ie(d.status,u?.error??`request_failed_${d.status}`,h,u?.conflicts,u?.reason,g,typeof u?.notice=="string"&&u.notice?u.notice:void 0,{...Array.isArray(u?.fields)?{fields:u.fields}:{},...typeof u?.retryable=="boolean"?{retryable:u.retryable}:{},...typeof u?.hint=="string"&&u.hint?{hint:u.hint}:{},...typeof u?.message=="string"&&u.message?{serverMessage:u.message}:{}})}return p}async requestBlob(e,t={}){let n={},o=await this.access?.authorization(t.auth?"unauthorized":"initial");o&&(n.Authorization=o);let r=await fetch(`${this.base}${e}`,{method:"GET",headers:n,credentials:"omit"});if(r.ok)return r.blob();let a=(r.headers.get("content-type")??"").includes("application/json")?await r.json().catch(()=>null):null,l=a?.code??a?.error;if(this.access?.configured&&(r.status===401||r.status===403||r.status===422)&&await this.access.handleFailure(r.status,l)&&!t.auth)return this.requestBlob(e,{...t,auth:!0});let c;if(r.status===429&&(c=Wi(r.headers.get("Retry-After"),a?.retryAfterSeconds)??As,!t.rateLimit&&c<=Cs))return await new Promise(d=>setTimeout(d,c*1e3)),this.requestBlob(e,{...t,rateLimit:!0});throw new ie(r.status,a?.error??`request_failed_${r.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 ie(404,"not_found","not_found"))}async objects(e){return{...await this.request(`/pub/events/${encodeURIComponent(e)}/objects?compact=1`),fetchedAt:Date.now()}}hold(e,t,n,o){let r=`/pub/events/${encodeURIComponent(e)}/hold?pricingContract=matrix-v1`,s={method:"POST",body:{selections:t,...n?{ttlMs:n}:{},...o?{replaceHoldId:o}:{},...this.referral?{referral:this.referral}:{}},labels:t.map(l=>l.label)};return(o||!this.holdIdempotency?this.request(r,s):this.keyedHold(r,s,Zp(e,t))).then(l=>this.noteTicketKeys(l,o))}holdAttemptKey(e){if(this.holdAttempt?.binding===e)return this.holdAttempt.key;let t=Qp();return this.holdAttempt=t?{binding:e,key:t}:null,t}endHoldAttempt(e){e&&this.holdAttempt?.key===e&&(this.holdAttempt=null)}async keyedHold(e,t,n,o=!1){let r;try{let s=await this.request(e,{...t,idempotency:{binding:n,used:a=>{r=a}}});return this.endHoldAttempt(r),s}catch(s){if(Jp(s))throw s;this.endHoldAttempt(r);let a=s.code;if(a==="idempotency_key_reused"&&!o)return this.keyedHold(e,t,n,!0);if(a==="invalid_idempotency_key")return this.holdIdempotency=!1,this.request(e,t);throw s}}noteTicketKeys(e,t){if(t&&this.ticketKeysByHold.delete(t),!e?.holdId)return e;let n=Array.isArray(e.ticketKeys)&&e.ticketKeys.every(r=>typeof r=="string")?[...e.ticketKeys]:null,o=Array.isArray(e.ticketKeyDetails)&&e.ticketKeyDetails.every(Yp)?e.ticketKeyDetails.map(({ticketKey:r,label:s,unitIndex:a,quantity:l,displayLabel:c})=>({ticketKey:r,label:s,unitIndex:a,quantity:l,...c?{displayLabel:c}:{}})):null;return n||o?this.ticketKeysByHold.set(e.holdId,{...n?{ticketKeys:n}:{},...o?{ticketKeyDetails:o}:{}}):this.ticketKeysByHold.delete(e.holdId),e}ticketKeysFor(e){let t=this.ticketKeysByHold.get(e);return t?{...t}:null}bestAvailable(e,t,n,o,r){return this.request(`/pub/events/${encodeURIComponent(e)}/best-available?pricingContract=matrix-v1`,{method:"POST",body:{qty:t,...n?{categoryKey:n}:{},...o?{zoneId:o}:{},...r?{ttlMs:r}:{},...this.referral?{referral:this.referral}:{}}}).then(s=>this.noteTicketKeys(s))}resume(e,t){return this.request(`/pub/events/${encodeURIComponent(e)}/hold/resume`,{method:"POST",body:{holdId:t}}).then(n=>this.noteTicketKeys(n))}release(e,t,n){return this.holdAttempt=null,this.request(`/pub/events/${encodeURIComponent(e)}/release`,{method:"POST",body:{labels:t,holdId:n}}).then(o=>{let r=this.ticketKeysByHold.get(n);if(r){let s=new Set(o?.released??t);this.ticketKeysByHold.set(n,{...r.ticketKeys?{ticketKeys:r.ticketKeys.filter(a=>!s.has(a))}:{},...r.ticketKeyDetails?{ticketKeyDetails:r.ticketKeyDetails.filter(a=>!s.has(a.ticketKey))}:{}})}return o})}extend(e,t,n){return this.request(`/pub/events/${encodeURIComponent(e)}/extend`,{method:"POST",body:{holdId:t,...n?{ttlMs:n}:{}}})}paymentOptions(e){return this.request(`/pub/events/${encodeURIComponent(e)}/payment-options`)}availability(e,t=!1){return this.request(`/pub/events/${encodeURIComponent(e)}/availability?pricingContract=matrix-v1${t?"&live=1":""}`)}startCheckout(e,t){return this.holdAttempt=null,this.request(`/pub/events/${encodeURIComponent(e)}/checkout`,{method:"POST",body:t})}orderStatus(e){return this.request(`/pub/orders/${encodeURIComponent(e)}/status`)}subscribeTicket(e){return this.request(`/pub/events/${encodeURIComponent(e)}/subscribe-tickets`,{method:"POST",body:{}})}subscribeUrl(e){let t=this.base.replace(/^http/,"ws"),n=new URLSearchParams({surface:"picker",viewerId:this.viewerId});return`${t}/pub/events/${encodeURIComponent(e)}/subscribe?${n}`}socketUrl(e){return this.accessScoped?"":this.subscribeUrl(e)}socketProtocols(e){return this.accessScoped?[]:[It]}createRealtime(e,t){return this.accessScoped?null:new Ze({url:this.subscribeUrl(e),sink:t})}};var Qi=require("@seatlayer/core");var Oe=require("@seatlayer/core"),ta=require("@seatlayer/core/core/seatConfidence");var qo=require("@seatlayer/core"),Ks=require("@seatlayer/core/core/cdnAsset");var eh=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,th=/[\s"'<>`\\]/;function ih(i){return i.startsWith("//")?!1:i.startsWith("/")||i.startsWith("./")||i.startsWith("../")}function nh(){try{let i=typeof location>"u"?"":location.origin;return i&&i!=="null"?i:null}catch{return null}}function si(i){if(typeof i!="string"||!i||i.length>2e6||i!==i.trim())return!1;if(i.startsWith("data:"))return eh.test(i);if(th.test(i))return!1;let e=nh();if(ih(i)){if(!e)return!1;try{let t=new URL(i,e);return t.origin===e&&!t.username&&!t.password}catch{return!1}}try{let t=new URL(i);return t.username||t.password?!1:t.protocol==="https:"||e!=null&&t.origin===e}catch{return!1}}var Th=require("@seatlayer/core/core/cdnAsset");function y(i,e){let t=(0,qo.t)(i);return t===i?e:t}function Nt(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?y("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):y("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function Pn(){return{rotate:y("picker.dragToRotateVenue","Drag to rotate the venue"),move:y("picker.dragToMoveVenue","Drag to move the venue"),zoomIn:y("picker.zoomIn","Zoom in"),zoomOut:y("picker.zoomOut","Zoom out"),fitView:y("picker.fitWholeVenue","Show whole venue")}}function Gs(i,e){let t=e?i.toLocaleUpperCase(e):i.toLocaleUpperCase(),n=e?i.toLocaleLowerCase(e):i.toLocaleLowerCase();if(i!==t||t===n)return i;let o=[...n][0]??"";return(e?o.toLocaleUpperCase(e):o.toLocaleUpperCase())+n.slice(o.length)}function Us(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}function q(i){return String(i??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}function qs(i,e,t){let n=e.find(r=>si(r))??null;if(i.replaceChildren(),!n)return i.textContent=t.slice(0,1).toUpperCase(),null;let o=document.createElement("img");return o.alt="",o.referrerPolicy="no-referrer",o.src=n,i.appendChild(o),n}var ai=null;function Mn(){if(ai!==null)return ai;try{if(typeof document>"u")return ai=!1;ai=!!document.createElement("canvas").getContext("webgl2")}catch{ai=!1}return ai}function Wo(i){return(0,Ks.cdnAssetUrl)(i)}var Yi=null;function Xi(){return Yi||(Yi=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Wo("seatlayer-view3d.mjs")):import("@seatlayer/core/view3d")).catch(e=>{throw Yi=null,e}),Yi)}function Ln(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||Xi().catch(()=>{})}async function Hn(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Wo("seatlayer-panorama.mjs")):import("@seatlayer/core")}async function li(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?import(Wo("seatlayer-checkout.mjs")):Promise.resolve().then(()=>(zs(),$s))}function Ws(i){return i==="unavailable_for_event"||i==="payments_off_for_event"?i:"not_configured"}function Ys(i){return i.lineItems.reduce((e,t)=>e+t.quantity,0)}function Yo(i,e){if(i.objectType!=="ga")return i.displayLabel??i.label;let t=e.find(n=>n.id===i.objectId);return i.displayLabel??t?.displayLabel??t?.label??y("picker.generalAdmission","General admission")}function kh(i,e){let t=new Map;for(let n of i){let o=n.rowLabel&&n.seatNumber?[n.sectionLabel,`${y("picker.row","Row")} ${n.rowLabel}`,`${y("picker.seat","Seat")} ${n.seatNumber}`].filter(Boolean).join(" \xB7 "):Yo(n,e),r=[n.categoryLabel,n.tierLabel].filter(Boolean).join(" \xB7 "),s=Math.max(1,Math.floor(n.quantity||1)),a=`${o}\0${r}`,l=t.get(a)??{label:o,detail:r,units:0,amount:0};l.units+=s,l.amount+=n.unitPrice*s,t.set(a,l)}return[...t.values()].map(n=>({label:n.units>1?`${n.label} \xD7${n.units}`:n.label,...n.detail?{detail:n.detail}:{},amount:n.amount}))}var js=(i,e,t)=>(0,qo.t)("picker.bookingForm.guestOfCount",{label:i,index:e,total:t});function Sh(i,e,t=[]){let n=new Map,o=[];for(let d of i.lineItems){let p=Yo(d,t),u=Math.max(1,Math.floor(d.quantity)||1);if(d.objectType!=="ga"&&!(d.objectType==="table"&&u>1)){o.push({key:d.label,name:p,unitIndex:1,quantity:1});continue}for(let h=1;h<=u;h+=1){let b=(n.get(d.label)??0)+1;n.set(d.label,b),o.push({key:`${d.label}#${b}`,name:p,unitIndex:h,quantity:u})}}let r=e?.ticketKeyDetails??[],s=e?.ticketKeys??r.map(d=>d.ticketKey),a=(s.length===o.length?s:o.map(d=>d.key)).map(d=>{let p=o.find(h=>h.key===d),u=r.find(h=>h.ticketKey===d);return{key:d,name:u?.displayLabel??p?.name,unitIndex:u?.unitIndex??p?.unitIndex??1,quantity:u?.quantity??p?.quantity??1}}),l=new Map;for(let d of a)d.name&&d.quantity<=1&&l.set(d.name,(l.get(d.name)??0)+1);let c=new Map;return a.map(({key:d,name:p,unitIndex:u,quantity:h})=>{if(!p)return{key:d};if(h>1)return{key:d,title:js(p,u,h)};let b=(c.get(p)??0)+1;c.set(p,b);let g=l.get(p)??1;return{key:d,title:g>1?js(p,b,g):p}})}function Xs(i,e,t,n,o=[]){let r=new Map;for(let s of i.lineItems){let a=Yo(s,o);r.set(a,(r.get(a)??0)+1)}return{kind:"pay",provider:e,order:{holdId:i.holdId,expiresAt:i.expiresAt,currency:i.currency,total:i.total,labels:[...r].map(([s,a])=>a>1?`${s} \xD7${a}`:s),tickets:Sh(i,n,o),lines:kh(i.lineItems,o)},bookingForm:t?.bookingForm??null,...t?.bookingMode==="free"?{free:!0}:{}}}function Qs(i){return String(i?.code).startsWith("booking_form_")}function Rn(i,e,t){let n={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},o=new Date(i);if(e)try{return o.toLocaleString(t,{...n,timeZone:e})}catch{}return o.toLocaleString(t,n)}function Xo(i){return/early[\s-]*bird/i.test(i?.trim()??"")}function Zs(i){return Xo(i)?'<svg class="sl-offer-icon sl-offer-icon-discount" viewBox="0 0 32 32" aria-hidden="true"><defs><linearGradient id="sl-offer-discount-gradient" x1="29.492" y1="0" x2="20.028" y2="36.183" gradientUnits="userSpaceOnUse"><stop stop-color="#FD6D00"/><stop offset="1" stop-color="#F8B302"/></linearGradient></defs><path d="M16 22.751a1.071 1.071 0 1 0 0-2.142 1.071 1.071 0 0 0 0 2.142ZM16 11.39a1.071 1.071 0 1 0 0-2.141 1.071 1.071 0 0 0 0 2.141Z" fill="url(#sl-offer-discount-gradient)"/><path d="M31.137.863A2.928 2.928 0 0 0 29.054 0H17.836c-.787 0-1.527.307-2.083.863L.863 15.753A2.93 2.93 0 0 0 0 17.836c0 .787.307 1.527.863 2.083l11.218 11.218A2.927 2.927 0 0 0 14.164 32c.787 0 1.527-.307 2.083-.863l14.89-14.89A2.928 2.928 0 0 0 32 14.164V2.946c0-.788-.307-1.527-.863-2.083ZM16 7.374a2.946 2.946 0 1 1 0 5.891 2.946 2.946 0 0 1 0-5.891Zm0 17.252a2.946 2.946 0 1 1 0-5.891 2.946 2.946 0 0 1 0 5.891Zm6.025-7.689H9.975a.938.938 0 0 1 0-1.875h12.05a.938.938 0 0 1 0 1.875Zm4.017-10.041a.938.938 0 1 1 0-1.875.938.938 0 0 1 0 1.875Z" fill="url(#sl-offer-discount-gradient)"/></svg>':'<svg class="sl-offer-icon sl-offer-icon-tag" viewBox="0 0 24 24" aria-hidden="true"><path d="M20.6 13.6 13.7 20.5a2 2 0 0 1-2.8 0L3.5 13.1A2 2 0 0 1 3 11.7V4h7.7a2 2 0 0 1 1.4.6l8.5 8.5a.7.7 0 0 1 0 .5Z"/><circle cx="7.5" cy="8.5" r="1"/></svg>'}function In(i,e){return`<span class="sl-offer-mark" role="img" aria-label="${e(i)}" title="${e(i)}">${Zs(i)}</span>`}function On(i,e){return`<span class="sl-offer-badge">${Zs(i)}<span>${e(i)}</span></span>`}function Js(i,e=Date.now()){let t=i-e;if(t<=0)return null;let n=Math.max(1,Math.ceil(t/6e4)),o=Math.floor(n/1440),r=Math.floor(n%1440/60),s=n%60;return`${(o>0?[`${o}d`,...r?[`${r}h`]:[]]:[...r?[`${r}h`]:[],...s||!r?[`${s}m`]:[]]).join(" ")} left`}function Qo(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function L(i){return String(i??"").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function Zo(i){return i?(0,Oe.seatNoteRowModel)(i).map(e=>({...e,title:y(e.titleKey,e.titleFallback)})):[]}function ia(i){return Zo(i).map(e=>e.title)}function Dt(i,e={}){return Jo(Zo(i),e)}function Jo(i,e={}){if(!i.length)return"";let t=e.compact?15:17,n=i.map(o=>`<div class="sl-note sl-note-${L(o.tone)}"><span class="sl-note-i">${(0,Oe.seatTypeIconSvg)(o.icon,{size:t})}</span><span class="sl-note-t"><b>${L(o.title)}</b>`+(o.note?`<span class="sl-note-n">${L(o.note)}</span>`:"")+"</span></div>").join("");return`<div class="sl-notes${e.compact?" compact":""}">${n}</div>`}function na(i){return Zo(i).map(e=>{let t=L(e.note?`${e.title}: ${e.note}`:e.title);return`<span class="sl-cx-mark sl-cx-mark-${L(e.tone)}" role="img" aria-label="${t}" title="${t}">${(0,Oe.seatTypeIconSvg)(e.icon,{size:13})}</span>`}).join("")}function _n(i){let e=[];return i?.restrictedView&&e.push(y("picker.restrictedView","Restricted view")),i?.obstructedView&&e.push(y("picker.obstructedView","Obstructed view")),e}function er(i,e){if(!i)return"";let t=e?y("picker.viewFromThisSeat","View from this seat"):y("picker.seeItIn3d","See it in 3D"),n=e?y("picker.viewFromHere","View from here"):t;return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${n}</span></button>`}function oa(i,e){if(!e)return"";let t=e,n=t.includes(i.id),o=n?t.length>1?y("picker.openComparison","Open comparison"):y("picker.savedForComparison","Saved for comparison"):t.length?y("picker.compareWithSaved","Compare with saved"):y("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${n&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${L(o)}</span></button>`}function ra(i,e,t){if(!t)return"";let n=(0,ta.seatConfidenceDisclosure)(i.confidenceEvidence),o=n.modeledTarget??n.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${L(i.displayLabel??i.label)}"><span><em>${L(e)}</em><strong>${L(n.headline)}</strong><small>${L(o)}</small></span><b>Passport</b></button>`}function fe(i){let e=i?.rowLabel,t=i?.sectionLabel;if(!e||!t)return e;for(let n of["-"," ","\xB7","/","_"]){let o=`${t}${n}`;if(e.startsWith(o)&&e.length>o.length)return e.slice(o.length)}return(0,Oe.compactRowLabel)(e,t)}function Eh(i){switch(i){case"paused":return{title:y("picker.accessPausedTitle","These seats are on hold right now"),body:y("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:y("picker.accessRetry","Try again")};case"revoked":return{title:y("picker.accessRevokedTitle","This access link is no longer active"),body:y("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats."),action:y("picker.accessRefresh","Refresh")};case"idle":return{title:y("picker.idlePausedTitle","Your session expired"),body:y("picker.idlePausedBody","You were away for a while. Refresh to see which seats are free now."),action:y("picker.idleRefresh","Show latest seats")};case"no_token":case"provider_failed":return{title:y("picker.accessExpiredTitle","The seat map timed out"),body:y("picker.accessExpiredBody","Any seats you\u2019re holding stay held. Refresh to see what\u2019s available now."),action:y("picker.accessRefresh","Refresh")};default:return{title:y("picker.accessInvalidTitle","We couldn\u2019t verify your access"),body:y("picker.accessInvalidBody","You can still book anything shown as available. Contact whoever sent you here for access to the rest."),action:y("picker.accessRefresh","Refresh")}}}var Ch=6;function sa(i,e,t){let n=Qo;return[i?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec${i.sectionLabel.length>Ch?" sl-confirm-sec-long":""}"><span class="sl-confirm-key">${y("picker.section","Section")}</span><span class="sl-confirm-value">${n(i.sectionLabel)}</span></div>`:"",i?.rowLabel||i?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${n(t)}</span><span class="sl-confirm-value">${n(fe(i)??i?.displayLabel??e)}</span></div>`:"",i?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${y("picker.seat","Seat")}</span><span class="sl-confirm-value">${n(i?.seatNumber??i?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function aa(i,e,t){let n=Qo,o=i?.objectType==="booth",r=i?.objectType==="table"&&!!i?.bookingMode,s=o||r||!i?.seatNumber,a=i?.sectionLabel??(s?void 0:i?.displayLabel),l=r?`${y("picker.guests","Guests")} ${i?.bookingMode==="variable"?`${i?.minOccupancy}\u2013${i?.maxOccupancy}`:i?.capacity}`:void 0,d=(s?[l,a?i?.rowLabel??i?.displayLabel:void 0]:[i?.rowLabel?`${t} ${fe(i)??""}`.trim():void 0,`${y("picker.seat","Seat")} ${i?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${n(a)}</span>`:"")+(d?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${n(d)}</span>`:"")+(a||d?"":`<span class="sl-confirm-pos">${n(e)}</span>`)}function la(i,e){if(!i)return"";let t=e?y("picker.viewFromThisSeat","View from this seat"):y("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-pill sl-confirm-3dpill" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function ca(i,e){if(!i||e)return"";let t=y("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-3drow" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function ea(i){return i.buyerMessage?.trim()||(i.restriction==="companion"?y("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function Nn(i,e,t,n=()=>{}){let o=Qo;if(i.length>1)return`<fieldset class="sl-confirm-tiers"><legend><span>${y("picker.ticketType","Ticket type")}</span></legend>`+i.map(a=>{let l=ea(a),c=n(a);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${o(a.id)}"${c?` data-offer-name="${o(c)}"`:""} aria-pressed="${a.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${o(a.name)}`+(c?`<span class="sl-confirm-tier-offer">${On(c,o)}</span>`:"")+"</span>"+(l?`<small class="sl-confirm-tier-note">${o(l)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${o(t(a))}</span></button>`}).join("")+"</fieldset>";let r=i[0],s=r?ea(r):void 0;return s?`<p class="sl-confirm-tier-note">${o(s)}</p>`:""}function da(i){return'<div class="sl-confirm-grid">'+i.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-confirm-cat-name">${L(i.categoryLabel)}</span>`+(i.priceLabel?`<span class="sl-confirm-price">${L(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+i.marker+`<span class="sl-confirm-dot" style="background:${L(i.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${L(i.categoryLabel)}</span><span class="sl-confirm-who">`+i.identity+"</span>"+(i.priceLabel?`<span class="sl-confirm-idprice">${L(i.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+i.commercial+i.tierChoices+i.groupDates+i.wheelchair+(i.thumb||i.see3dPill?`<div class="sl-confirm-strip">${i.thumb}<span class="sl-confirm-pills">${i.see3dPill}</span></div>`:"")+i.inspect+'<div class="sl-confirm-row">'+(i.see3dRow??"")+`<button type="button" class="sl-confirm-cancel">${L(i.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${L(i.selectLabel)}</span></button></div></div>`}function pa(i,e){let t=q,{variable:n}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(n?(0,Oe.t)("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):(0,Oe.t)("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(i.displayLabel??i.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(n?y("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,Oe.t)("picker.allPlacesBookedTogether",{count:i.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t((0,Oe.t)("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(y("picker.tableCapacity","Table capacity"))}</span><span>${t((0,Oe.t)("picker.guestsCount",{count:i.capacity}))}</span>`+(i.entrance?`<span class="muted">${t(y("picker.entrance","Entrance"))}</span><span>${t(i.entrance)}</span>`:"")+(e.suppressPricing?"":`<span class="muted">${t(y("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(n?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(y("picker.numberOfGuests","Number of guests"))}</label><div class="sl-table-stepper" role="group" aria-labelledby="sl-table-qty-label"><button type="button" data-table-step="-1" aria-label="${t(y("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${i.quantity}</output><button type="button" data-table-step="1" aria-label="${t(y("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t((0,Oe.t)("picker.chooseMinMaxGuests",{min:i.minOccupancy,max:i.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${i.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t((0,Oe.t)("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?y("picker.updateTable","Update table"):n?y("picker.selectTable","Select table"):y("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function ha(i,e){let t=Eh(i),n=document.createElement("div");n.className="sl-interrupt sl-access",n.setAttribute("role","status"),n.setAttribute("aria-live","polite");let o=document.createElement("div");o.className="sl-interrupt-card";let r=document.createElement("div");r.className="sl-interrupt-title",r.textContent=t.title;let s=document.createElement("div");s.className="sl-interrupt-body",s.textContent=t.body,o.append(r,s);let a=document.createElement("div");a.className="sl-interrupt-actions";let l=document.createElement("button");l.type="button",l.className="sl-interrupt-act";let c=document.createElement("span");c.className="sl-interrupt-act-icon",c.setAttribute("aria-hidden","true"),c.textContent="\u21BB";let d=document.createElement("span");return d.textContent=t.action,l.append(c,d),l.addEventListener("click",async()=>{n.classList.add("is-reloading"),l.disabled=!0;try{await e()}catch{}finally{n.isConnected&&(n.classList.remove("is-reloading"),l.disabled=!1)}}),a.appendChild(l),o.appendChild(a),n.appendChild(o),n}function ua(i,e){return`<div class="sl-a11yhead"><span class="sl-a11yhead-t">${L(i)}</span><button type="button" class="sl-a11yclose" data-a11y-close aria-label="${q(e)}"><svg viewBox="0 0 24 24" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function ma(i){return i.map(e=>{let t=`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${L(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${e.iconHtml}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${L(e.label)}</span></span>`+(e.count?`<span class="sl-a11yrow-c">${L(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>';return e.note?`<div class="sl-a11yrow-w">${t}${ci({id:`sl-info-${q(e.key.replace(/[^A-Za-z0-9]+/g,"-"))}`,label:e.note,text:L(e.note)})}</div>`:t}).join("")}function ci(i){return`<span class="sl-info"${i.wrapRef?` data-ref="${q(i.wrapRef)}"`:""}><button type="button" class="sl-info-btn" data-sl-info aria-label="${q(i.label)}" aria-describedby="${q(i.id)}" aria-expanded="false"><svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5"/><path d="M12 8h.01"/></svg></button><span class="sl-info-pop" role="tooltip" id="${q(i.id)}"${i.ref?` data-ref="${q(i.ref)}"`:""}>${i.text}</span></span>`}function fa(i){let e=Math.max(0,i),t=Math.floor(e/6e4),n=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${n}`}function ga(i){let e=i.performanceLabel?`<div class="sl-chip-when">${q(i.performanceLabel)}</div>`:"",t=i.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${q(i.performanceDates.summary)}</span><span class="sl-chip-date-list">${i.performanceDates.labels.map(n=>`<span class="sl-chip-date">${q(n)}</span>`).join("")}</span></div>`:"";return e+Ah(i)+t}function Ah(i){let{d:e,area:t,label:n,objectType:o,quantity:r=1,identity:s}=i,a=F=>String(F??"\u2014").replace(/[&<>"]/g,X=>({"&":"&","<":"<",">":">",'"':"""})[X]),l=o==="ga"?"ga":e?.objectType??o,c=s?.displayType?.trim()||e?.displayType?.trim()||t?.displayType?.trim()||(l==="table"?y("picker.table","Table"):l==="booth"?y("picker.booth","Booth"):l==="ga"?y("picker.generalAdmission","General admission"):y("picker.row","Row")),d=s?.rowLabel??s?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??n,p=i.categoryLabel?.trim()??"",u="",h=[];l==="table"&&s?.bookingMode?(u=`${c} ${d}`,h.push([y("picker.guests","Guests"),String(r)])):l==="ga"?(u=String(t?.displayLabel??d),r>1&&h.push([y("picker.tickets","Tickets"),String(r)])):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(fe(e)??e.rowLabel)]),e.seatNumber&&h.push([y("picker.seat","Seat"),String(e.seatNumber)]));let b=!u&&!!p,g=u||p||String(d),T=!!p&&!b&&p!==g,w=i.offerName?In(i.offerName,a):"",v=h.map(([F,X])=>`<span class="sl-chip-seg" data-fit-seg><span class="w">${a(F)}</span> <b>${a(X)}</b></span>`);T&&v.push(`<span class="sl-chip-seg" data-fit-seg data-fit-type><span class="w">${a(p)}</span>${w}</span>`);let M=[g,...h.map(([F,X])=>`${F} ${X}`),T?p:"",i.offerName??""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(M)}</span><span class="sl-chip-name" aria-hidden="true">${a(g)}${T?"":w}</span>`+(v.length?`<span class="sl-chip-pos" aria-hidden="true">${v.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function tr(i,e,t){return i.map(n=>`<option value="${t(n.id)}"${n.id===e?" selected":""}>${t(n.name)}</option>`).join("")}function Ph(i){let e=q;return` data-key="${e(i.key)}"`+(i.heldLabels.length?` data-held="${e(encodeURIComponent(i.heldLabels.join(`
|
|
186
|
+
`)))}"`:"")+(i.seatIds.length?` data-seat="${e(i.seatIds.join(" "))}"`:"")+(i.locateId?` data-locate="${e(i.locateId)}"`:"")}function ba(i){let e=q;return`<div class="sl-chip${i.held?" sl-held":""}${i.fresh?" sl-enter":""}"`+Ph(i)+">"+(i.held?i.stateHtml:`<span class="sl-chip-dot" style="background:${L(i.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${i.identityHtml}`+(i.extrasHtml?`<div class="sl-chip-sub">${i.extrasHtml}</div>`:"")+`${i.noteHtml}</div>`+(i.amountText?`<span class="amt">${e(i.amountText)}</span>`:"")+i.railHtml+"</div>"}function ir(i,e){let t=q(i),n=e?q(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${n}" aria-label="${q((0,Qi.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 Dn(i,e){return new Set(i.filter(t=>(e[t.key]??0)<=0).map(t=>t.key))}function Bn(i,e){let t=(i.doc?.categories??[]).filter(s=>!s.notForSale),n=e?t.filter(s=>s.key===e):t;if(!n.length)return null;let o=Dn(n,i.categoryAvailability());return o.size<n.length||(i.currentHold()?.items??[]).some(s=>o.has(s.categoryKey))?null:Object.assign(new Error("seatlayer: that ticket type is sold out"),{status:409,code:"sold_out",reason:"sold_out"})}function ya(i){return i.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${y("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,Qi.t)("picker.willFindSeatsTogether",{count:i.quantity})}</b><span>${y("picker.manualTicketsRemovedNote","Your manually selected tickets will be removed only after a new group is secured.")}</span></div><div class="sl-ba-actions"><button type="button" data-ba-cancel>${y("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${y("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="sl-ba-title-t">${y("picker.findSeatsTogether","Find seats together")}</span>`+ci({id:"sl-info-best-seats",label:y("picker.aboutBestSeats","About finding seats together"),text:y("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")})+(i.offerPremium?`<button type="button" class="sl-ba-premium${i.premium?" on":""}" data-ba-premium aria-pressed="${i.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${y("picker.bestSeatsPremium","Best seats")}</button>`:"")+`</div><div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${y("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${i.quantity}</span><button type="button" data-ba="1" aria-label="${y("picker.moreSeats","More seats")}">+</button></div>`+(i.categories.length>1?`<select class="sl-ba-cat" aria-label="${q(y("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${q(y("picker.anyTicketType","Any ticket type"))}</option>`+i.categories.map(e=>e.soldOut?`<option value="${q(e.key)}" disabled>${q(`${e.label} \xB7 ${y("picker.soldOutTitle","Sold out")}`)}</option>`:`<option value="${q(e.key)}"${i.selectedCategory===e.key?" selected":""}>${q(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(i.zones.length?`<select class="sl-ba-zone" aria-label="${y("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${y("picker.anyVenueZone","Any venue zone")}</option>`+i.zones.map(e=>`<option value="${q(e.id)}"${i.selectedZone===e.id?" selected":""}>${q(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${i.busy?" sl-busy":""}"${i.busy?" disabled":""}>`+(i.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${y("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,Qi.tCount)("picker.findBestSeatsCount",i.quantity))+"</button>"+(i.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${y("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function va(i){return i==="setup"||i==="testable"?{heading:y("picker.salesNotOpenPill","Sales haven\u2019t opened yet"),sentence:y("picker.salesNotOpenCopy","Tickets for this event aren\u2019t on sale yet.")}:i==="paused"?{heading:y("picker.salesPausedPill","Sales are paused"),sentence:y("picker.salesPausedCopy","Ticket sales are paused for now.")}:{heading:y("picker.salesClosedPill","Sales are closed"),sentence:y("picker.salesClosedCopy","Ticket sales for this event have ended.")}}function wa(i,e=!1){if(!e&&(i==="setup"||i==="testable"||i==="paused")){let t=va(i);return{pill:t.heading,cta:t.heading,toast:t.sentence}}return{pill:y("picker.salesClosedPill","Sales are closed"),cta:y("picker.salesClosedCta","Sales closed"),toast:y("picker.salesClosedToast","Sales are closed for this event.")}}function xa(i){if(i.salesClosed&&!i.hasPicks){let e=i.whenText?`<span class="when">${q(i.whenText)}</span>`:"",t=va(i.salesState);return`<div class="sl-closed-note" role="status"><b>${t.heading}</b><span>${t.sentence}${e}</span></div>`}return""}function ka(i){return i.hasGaAreas?i.seated?i.venue3d?y("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue, or grab standing tickets below."):y("picker.trayHintTapOrStanding","Tap a seat on the map or grab standing tickets below."):i.venue3d?y("picker.gaTrayHintChoose3dArea","Choose an area in the 3D venue to select tickets."):y("picker.gaTrayHintTapArea","Tap an area on the map to choose tickets."):i.groupMode==="per_performance"?y("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):i.groupMode?y("picker.groupTrayHint","Choose seats once. The same seats will be held for every performance."):i.venue3d?y("picker.trayHintChoose3dOrBest","Choose a seat in the 3D venue, or let us pick the best available for you."):y("picker.trayHintTapOrBest","Tap a seat on the map, or let us pick the best available for you.")}var Ae=require("@seatlayer/core");var hi=require("@seatlayer/core");var $n=require("@seatlayer/core/core/color");function rt(i){if(!i)return null;let e=i.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 o=t.length<=4?[...t].map(r=>`${r}${r}`).join(""):t;return{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16)}}let n=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i.exec(e);return n?{r:Math.max(0,Math.min(255,Number(n[1]))),g:Math.max(0,Math.min(255,Number(n[2]))),b:Math.max(0,Math.min(255,Number(n[3])))}:null}function Fn(i){return(0,$n.relativeLuminance255)([i.r,i.g,i.b])}function Ue(i,e){let t=rt(i),n=rt(e);if(!t||!n)return null;let o=Math.max(Fn(t),Fn(n)),r=Math.min(Fn(t),Fn(n));return(o+.05)/(r+.05)}function Bt(i,e="#172033",t="#eef1f8"){return(Ue(e,i)??0)>=(Ue(t,i)??0)?e:t}function Mh(i){return(0,$n.rgb255ToHex)(i.r,i.g,i.b)}function nr(i,e,t){let n=rt(i),o=rt(e);if(!n||!o)return null;let r=Math.max(0,Math.min(1,t));return Mh({r:n.r*r+o.r*(1-r),g:n.g*r+o.g*(1-r),b:n.b*r+o.b*(1-r)})}var Vn="#d8a425",Lh=.18;function Sa(i,e){let t=nr(Vn,e,Lh)??e;if((Ue(Vn,t)??0)>=4.5)return Vn;for(let n=.15;n<=1;n+=.05){let o=nr(Vn,i,1-n);if(o&&(Ue(o,t)??0)>=4.5)return o}return Bt(t)}function Ta(i,e,t,n){if((Ue(i,t)??4.5)>=4.5&&(Ue(i,n)??4.5)>=4.5)return i;if(!rt(i)||!rt(e))return e;for(let o=.15;o<=1;o+=.05){let r=nr(i,e,1-o);if(r&&(Ue(r,t)??0)>=4.5&&(Ue(r,n)??0)>=4.5)return r}return e}function Ea(i){return{"--sl-chrome":i?"#d6dce6":"#556278","--sl-chrome-line":i?"rgba(23,32,51,.55)":"rgba(233,238,247,.55)"}}var Ca=["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text","--sl-warn-text","--sl-chrome","--sl-chrome-line"];function Aa(i,e){let t=e??i["--sl-bg"],n=rt(t)?Bt(t)==="#172033":!1,o=rt(i["--sl-bg"])?Bt(i["--sl-bg"])==="#172033":!1;if(n===o)return null;let r=n?"#ffffff":"#1a2234",s=Bt(t),a=i["--sl-accent"];return{"--sl-bg":t,"--sl-surface":r,"--sl-text":s,"--sl-muted":n?"#667085":"#a5aec2","--sl-line":n?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-accent-text":Ta(a,s,t,r),...Ea(n),"--sl-warn-text":Sa(s,r)}}var Hh="#f7f8fb",Pa={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 Rh(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function Zi(i){if(i)return i==="auto"?Rh()?"dark":"light":i}function di(i,e=i?.mode){if(i?.map)return i.map;let t=Zi(e);return t?{background:Pa[t].map}:null}function zn(i){let e;try{e=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!e)return()=>{};let t=n=>i(n.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 pi(i,e,t){let n=t?Pa[t]:null,o=e?.background??n?.background??i?.background??Hh,r=rt(o)?Bt(o)==="#172033":!1,s=e?.surface??n?.surface??(r?"#ffffff":"#1a2234"),a=e?.accent??i?.accent??"#f4b740",l=i?.accentInk,c=e?.accentInk??(l&&(Ue(l,a)??4.5)>=4.5?l:Bt(a,"#1a1200","#ffffff")),d=n?void 0:i?.textColor,p=e?.text??n?.text??(d&&(Ue(d,o)??4.5)>=4.5&&(Ue(d,s)??4.5)>=4.5?d:Bt(o));return{"--sl-accent":a,"--sl-accent-ink":c,"--sl-accent-text":Ta(a,p,o,s),"--sl-warn-text":Sa(p,s),"--sl-bg":o,"--sl-surface":s,"--sl-text":p,"--sl-muted":e?.muted??n?.muted??(r?"#667085":"#a5aec2"),"--sl-line":e?.line??n?.line??(r?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),...Ea(r),"--sl-scrim-ink":r?"rgba(16,22,36,1)":"rgba(4,7,13,1)","--sl-font":e?.fontFamily??i?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${e?.radius??14}px`}}function Ih(){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 Ma(i,e,t){let n=document.createElement("div");n.className="sl-picker",n.tabIndex=-1,n.lang=(0,hi.getLocale)(),n.dir=(0,hi.localeDirection)(),i.appendChild(n),Object.entries(pi(void 0,t)).forEach(([r,s])=>n.style.setProperty(r,s)),n.innerHTML=`
|
|
187
187
|
<div class="sl-head">
|
|
188
188
|
<div class="sl-logo" data-ref="logo"></div>
|
|
189
189
|
<div class="sl-head-info" data-ref="headInfo">
|
|
@@ -234,7 +234,7 @@ textarea.sl-hco-input{min-height:76px;resize:vertical}
|
|
|
234
234
|
</div>
|
|
235
235
|
<div class="sl-boot" data-ref="boot">
|
|
236
236
|
<div class="sl-boot-bar" aria-hidden="true"></div>
|
|
237
|
-
${
|
|
237
|
+
${Ih()}
|
|
238
238
|
<span class="sl-boot-say" role="status" aria-live="polite" data-sl-t="picker.loadingSeatMap">${e("picker.loadingSeatMap","Loading seat map\u2026")}</span>
|
|
239
239
|
</div>
|
|
240
240
|
<div class="sl-toast" data-ref="toast" role="status" aria-live="polite"></div>
|
|
@@ -260,9 +260,9 @@ textarea.sl-hco-input{min-height:76px;resize:vertical}
|
|
|
260
260
|
<button type="button" class="sl-cta" data-ref="cta" disabled></button>
|
|
261
261
|
</div>
|
|
262
262
|
</div>
|
|
263
|
-
</div>`;let o={};return n.querySelectorAll("[data-ref]").forEach(r=>{o[r.dataset.ref]=r}),{root:n,mapHost:o.map,els:o}}function wa(i){let e=(t,n)=>{for(let o of i.querySelectorAll(`[${t}]`)){let r=o.getAttribute(t);if(!r)continue;let s=(0,hi.t)(r);s!==r&&n(o,s)}};e("data-sl-t",(t,n)=>{t.textContent=n}),e("data-sl-a",(t,n)=>{t.setAttribute("aria-label",n)}),e("data-sl-ti",(t,n)=>{t.setAttribute("title",n)})}function Vn(i,e){let t=(0,Ae.resolveLocale)(i),n=Ae.TRANSLATED_LOCALES.includes(t)?t:"en";return e&&(0,Ae.setStringOverrides)(e),{locale:n,direction:(0,Ae.localeDirection)(n),ready:(0,Ae.loadLocale)(i)}}function zn(i,e,t){i.lang=e.locale,i.dir=e.direction,e.ready.then(t)}function xa(i,e){if(!i)return null;let t=(e.languages??[]).map(o=>(0,Ae.resolveLocale)(o)).filter((o,r,s)=>s.indexOf(o)===r);if(t.length<2)return null;let n=document.createElement("select");n.className="sl-langsel",n.setAttribute("aria-label",e.label);for(let o of t){let r=document.createElement("option");r.value=o,r.textContent=Ae.LOCALE_NAMES[o]??o,r.selected=o===(0,Ae.getLocale)(),n.appendChild(r)}return n.addEventListener("change",()=>e.onChange(n.value)),i.appendChild(n),n}function ka(i,e){e.root.lang=i,e.root.dir=(0,Ae.localeDirection)(i),wa(e.root);for(let n of e.painters)try{n()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==i&&(t.value=i)}function ui(i,e,t,n=45e3){return new Promise(o=>{if(e.aborted){o({outcome:"cancelled"});return}let r=!1,s=d=>{r||(r=!0,clearTimeout(l),clearTimeout(c),e.removeEventListener("abort",a),o(d))},a=()=>s({outcome:"cancelled"}),l=setTimeout(()=>{r||t()},8e3),c=setTimeout(()=>s({outcome:"timeout"}),n);e.addEventListener("abort",a,{once:!0}),Promise.resolve().then(()=>r?void 0:i()).then(d=>{r||s({outcome:"loaded",value:d})},d=>s({outcome:"error",error:d}))})}var he=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}},fh=new Set(["buyer_access_expired"]),gh=new Set(["paused","provider_failed","channel_denied","sales_not_open"]);function bh(i,e){switch(e){case"buyer_access_invalid":return"invalid";case"buyer_access_revoked":return"revoked";case"buyer_access_origin_mismatch":return"origin_mismatch";case"buyer_access_event_mismatch":return"event_mismatch";case"buyer_access_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";case"audience_not_public":return"audience_not_public";case"sales_not_open":return"sales_not_open";case"origin_not_allowed":return"origin_not_allowed";default:break}return i===401?"invalid":null}function yh(i){return/^Bearer\s+(\S+)$/i.exec(i?.trim()??"")?.[1]??null}function jn(i){return i instanceof he?i.reason!=="paused"&&i.reason!=="channel_denied":!i||typeof i!="object"?!1:i.status===401}function vh(i,e){return i===401&&!!e&&fh.has(e)}var wh=3e4,_e,Ne,Ft,mi,Zi,yt,vt,rt,fi,Ji,en,tn,Vt,ke,nr,$n,bt,De=class{constructor(e){R(this,ke);R(this,_e,null);R(this,Ne,0);R(this,Ft,null);R(this,mi);R(this,Zi);R(this,yt,null);R(this,vt,null);R(this,rt,null);R(this,fi,null);R(this,Ji);R(this,en);R(this,tn,!1);R(this,Vt);if(S(this,mi,e.provider),S(this,Zi,e.skewMs??wh),S(this,Ji,e.onExpired),S(this,en,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;x(this,ke,nr).call(this,t)}S(this,tn,!!m(this,mi)||!!m(this,_e))}get configured(){return m(this,tn)}onRenewed(e){S(this,Vt,e)}get unavailable(){return m(this,rt)}get hasToken(){return!!m(this,_e)&&(m(this,Ne)===0||m(this,Ne)>Date.now())}get expiresAt(){return m(this,Ne)}async authorization(e="initial"){if(!this.configured)return null;if(m(this,rt))throw new he(m(this,rt));let t=Date.now();if(!m(this,_e)||m(this,Ne)>0&&m(this,Ne)-m(this,Zi)<=t){let o=!!m(this,_e)&&m(this,Ne)>0&&m(this,Ne)<=t,r=m(this,_e)?o?"expired":"expiring":e,s=await x(this,ke,$n).call(this,r);if(!s)throw new he(m(this,rt)??m(this,fi)??x(this,ke,bt).call(this,"provider_failed"));return`Bearer ${s}`}return`Bearer ${m(this,_e)}`}async handleFailure(e,t,n){var r;if(!this.configured)return!1;if(vh(e,t)){let s=yh(n)??m(this,Ft);S(this,_e,null),S(this,Ne,0);let a=await x(this,ke,$n).call(this,"unauthorized",t),l=!!a&&a!==s;return(r=m(this,Ji))==null||r.call(this,{reason:"unauthorized",code:t,refreshed:l}),a&&!l&&x(this,ke,bt).call(this,"revoked",t,e),l}let o=bh(e,t);return o&&x(this,ke,bt).call(this,o,t,e),!1}async refresh(e="manual"){return S(this,rt,null),S(this,fi,null),S(this,_e,null),S(this,Ne,0),!!await x(this,ke,$n).call(this,e)}clear(){m(this,vt)?.abort(),S(this,vt,null),S(this,_e,null),S(this,Ft,null),S(this,Ne,0),S(this,yt,null),S(this,Vt,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};_e=new WeakMap,Ne=new WeakMap,Ft=new WeakMap,mi=new WeakMap,Zi=new WeakMap,yt=new WeakMap,vt=new WeakMap,rt=new WeakMap,fi=new WeakMap,Ji=new WeakMap,en=new WeakMap,tn=new WeakMap,Vt=new WeakMap,ke=new WeakSet,nr=function(e){return!e||typeof e.token!="string"||!e.token?null:(S(this,Ft,e.token),S(this,_e,e.token),S(this,Ne,typeof e.expiresAt=="number"?e.expiresAt:0),m(this,_e))},$n=function(e,t){if(m(this,yt))return m(this,yt);let n=m(this,mi);if(!n)return x(this,ke,bt).call(this,"no_token",t),Promise.resolve(null);let o=m(this,Ft),r=new AbortController;S(this,vt,r);let s=(async()=>{try{let a=await ui(()=>Promise.resolve(n({reason:e})),r.signal,()=>{},4e4);if(r.signal.aborted||a.outcome==="cancelled")return null;if(a.outcome!=="loaded")return x(this,ke,bt).call(this,"provider_failed",t),null;let l=a.value,c=x(this,ke,nr).call(this,l);if(!c)return x(this,ke,bt).call(this,"provider_failed",t),null;if(o&&o!==c&&m(this,Vt))try{await m(this,Vt).call(this,{previousToken:o,token:c,reason:e})}catch{}return r.signal.aborted?null:c}catch{return x(this,ke,bt).call(this,"provider_failed",t),null}finally{m(this,vt)===r&&(S(this,yt,null),S(this,vt,null))}})();return S(this,yt,s),s},bt=function(e,t,n){var r;let o={reason:e,code:t,status:n,retryable:e==="paused"||e==="channel_denied"||e==="sales_not_open"};return S(this,fi,o),gh.has(e)||(S(this,rt,o),S(this,_e,null),S(this,Ne,0)),(r=m(this,en))==null||r.call(this,o),o};function gi(i,e={}){return!i.buyerAccessTokenProvider&&!i.buyerAccessToken?null:new De({provider:i.buyerAccessTokenProvider,token:i.buyerAccessToken,...e})}var xh={host:"web",platform:"web",bundle:"",protocol:0,chromeOwner:"web"},kh={...xh},Gn=null,Sa=null;function Sh(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():0}function Th(){let i=e=>Math.max(0,Math.round(e*100)/100);return{bootMs:i(Sh()),documentMs:Gn==null?0:i(Gn),handshakeMs:Gn==null||Sa==null?0:i(Sa-Gn)}}function Ta(){let{host:i,platform:e,bundle:t,protocol:n,chromeOwner:o}=kh,r=Th();return{host:i,platform:e,...t?{bundle:t}:{},...n?{protocol:n}:{},chromeOwner:o,bootMs:r.bootMs,documentMs:r.documentMs,handshakeMs:r.handshakeMs}}var Ea=new Set,Ca=new Map;function st(i){return Ea.has(i)?"repeat":"cold"}function Kn(i){let e=st(i);return Ea.add(i),e}function Be(i){return typeof i=="number"&&Number.isFinite(i)&&i>=0?Math.round(i):0}function or(){return typeof location>"u"?!1:/^(localhost|127\.0\.0\.1|\[::1\])$/i.test(location.hostname)}function Eh(i){if(!/^[A-Za-z0-9_-]{1,80}$/.test(i.event))return null;let e=i.performanceProfile??{};return{event:i.event,scope:i.scope,surface:i.surface,outcome:i.outcome,stage:i.stage?.slice(0,32)??"",ms:Be(i.ms),api:Be(e.loadChartAndStatuses)||Be(e.loadChart),scene:Be(e.buildScene),panel:Be(e.buildBuyerControls),paint:Be(e.firstPaint),normalize:Be(e.normalizeBuyerModel),renderer:Be(e.createRenderer),seats:Be(i.seats),floors:Be(i.floors),view:i.view??"map",load:i.load??st(i.event),transport:i.transport??"pubapi",...Ta(),availabilityMs:Be(e.loadStatuses),...typeof i.revealWaitMs=="number"?{revealWaitMs:Be(i.revealWaitMs)}:{},...typeof i.handoverMs=="number"?{handoverMs:Be(i.handoverMs)}:{},mounts:(Ca.get(i.event)??0)+1,reconnects:Be(i.reconnects)}}var Ch=new Set;function Ze(i){let e=Eh(i);if(e){Ca.set(i.event,e.mounts);for(let t of Ch)try{t(e)}catch{}typeof fetch>"u"||or()||fetch(`${i.apiBase.replace(/\/+$/,"")}/pub/telemetry/chart-load`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify(e),credentials:"omit",keepalive:!0}).catch(()=>{})}}function Un(i){let e={state:"none"};return{transport:new Proxy(i,{get(n,o){let r=Reflect.get(n,o,n);return typeof r!="function"?r:o!=="chart"?r.bind(n):(...s)=>{let a;try{a=r.apply(n,s)}catch(l){throw e={state:"rejected",error:l},l}return Promise.resolve(a).then(l=>(e={state:"resolved"},l),l=>{throw e={state:"rejected",error:l},l})}}}),outcome:()=>e}}function qn(i,e){if(!e||!i)return null;if(i.state==="resolved")return"chart_load:transform_failed";if(i.state!=="rejected")return null;let t=i.error;return t instanceof ie?t.status>=500&&t.status<=599?"chart_load:chart_fetch_5xx":t.status>=400&&t.status<=499?"chart_load:chart_fetch_4xx":null:typeof t=="object"&&t!==null&&t.name==="AbortError"?"chart_load:chart_fetch_timeout":"chart_load:chart_fetch_network"}var Aa=new Set;function Wn(i){return Aa.has(i.reason)||(Aa.add(i.reason),typeof fetch>"u"||or())?!1:(fetch(`${i.apiBase.replace(/\/+$/,"")}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:i.reason,eventKey:i.eventKey}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0)}function sr(i){return!!i&&typeof i=="object"&&!Array.isArray(i)}function Ah(i){return sr(i.availability)?i.availability:null}function Ph(i){let e=i.subscribeTicket;if(!sr(e))return null;let t=e.ticket,n=e.protocols;return t!==void 0&&typeof t!="string"||n!==void 0&&(!Array.isArray(n)||n.some(o=>typeof o!="string"))||t===void 0&&n===void 0?null:{...t===void 0?{}:{ticket:t},...n===void 0?{}:{protocols:n}}}var Pa=3e4,Mh=2e4;function Lh(i){if(!i||typeof i!="object"||Array.isArray(i))return!1;let e=i;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}function Hh(i){return i>=400&&i<500&&i!==408&&i!==429}var Yn=class{constructor(e,t,n){this.base=e;this.event=t;this.publicKey=n;this.value=null;this.inflight=null;this.refusal=null;this.fetchedAt=0}usable(){return this.inflight?!0:!!this.value&&this.value.expiresAt-Pa>Date.now()}refused(){return this.refusal}async load(e=!1){if(e&&(this.value=null,this.refusal=null),this.refusal)throw this.refusal;if(this.value&&this.value.expiresAt-Pa>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let n=new AbortController,o=setTimeout(()=>n.abort(),4e4);try{let r=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit",signal:n.signal}),s=await r.json().catch(()=>null);if(!r.ok){let a=r.status===429?qi(r.headers.get("Retry-After"),s?.retryAfterSeconds):void 0,l=new ie(r.status,s?.error??`request_failed_${r.status}`,s?.code??s?.error,void 0,void 0,a,void 0,{...typeof s?.hint=="string"&&s.hint?{hint:s.hint}:{},...typeof s?.message=="string"&&s.message?{serverMessage:s.message}:{}});throw Hh(r.status)&&(this.refusal=l),l}if(!Lh(s))throw new ie(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=s,this.fetchedAt=Date.now(),s}finally{clearTimeout(o)}})();this.inflight=t;try{return await t}finally{this.inflight===t&&(this.inflight=null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.load(t);return{token:n.token,expiresAt:n.expiresAt}}},rr=class extends ft{constructor(t,n,o,r,s){super(t,{...s,access:r});this.event=n;this.loader=o;this.bootstrapAccess=r;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1;this.initialAvailabilityDelivered=!1;this.initialTicketDelivered=!1}assertEvent(t){if(t!==this.event)throw new ie(404,"not_found","not_found")}async bundle(t){this.assertEvent(t);let n=this.loader.refused();if(n)throw n;try{await this.bootstrapAccess.authorization("initial")}catch(o){throw this.loader.refused()??o}return this.loader.load()}async chart(t){if(this.assertEvent(t),this.initialChartDelivered)return super.chart(t);let n=await this.bundle(t);return this.initialChartDelivered=!0,{event:n.event,doc:n.doc}}async objects(t){if(this.assertEvent(t),this.initialObjectsDelivered)return super.objects(t);let n=await this.bundle(t);return this.initialObjectsDelivered=!0,{...n.objects,fetchedAt:this.loader.fetchedAt}}async availability(t,n=!1){if(this.assertEvent(t),n||this.initialAvailabilityDelivered)return super.availability(t,n);let o=await this.bundle(t);return this.initialAvailabilityDelivered=!0,Ah(o)??super.availability(t,n)}async pickerIdleMinutes(){let t=await this.bundle(this.event),n=sr(t.realtime)?t.realtime.idleMinutes:void 0;return typeof n=="number"&&Number.isFinite(n)&&n>=0?n:null}async subscribeTicket(t){if(this.assertEvent(t),this.initialTicketDelivered)return super.subscribeTicket(t);let n=await this.bundle(t);return this.initialTicketDelivered=!0,Date.now()-this.loader.fetchedAt<Mh?Ph(n)??super.subscribeTicket(t):super.subscribeTicket(t)}},bi=new Map;function Ma(i,e,t){return`${i}
|
|
263
|
+
</div>`;let o={};return n.querySelectorAll("[data-ref]").forEach(r=>{o[r.dataset.ref]=r}),{root:n,mapHost:o.map,els:o}}function La(i){let e=(t,n)=>{for(let o of i.querySelectorAll(`[${t}]`)){let r=o.getAttribute(t);if(!r)continue;let s=(0,hi.t)(r);s!==r&&n(o,s)}};e("data-sl-t",(t,n)=>{t.textContent=n}),e("data-sl-a",(t,n)=>{t.setAttribute("aria-label",n)}),e("data-sl-ti",(t,n)=>{t.setAttribute("title",n)})}function jn(i,e){let t=(0,Ae.resolveLocale)(i),n=Ae.TRANSLATED_LOCALES.includes(t)?t:"en";return e&&(0,Ae.setStringOverrides)(e),{locale:n,direction:(0,Ae.localeDirection)(n),ready:(0,Ae.loadLocale)(i)}}function Kn(i,e,t){i.lang=e.locale,i.dir=e.direction,e.ready.then(t)}function Ha(i,e){if(!i)return null;let t=(e.languages??[]).map(o=>(0,Ae.resolveLocale)(o)).filter((o,r,s)=>s.indexOf(o)===r);if(t.length<2)return null;let n=document.createElement("select");n.className="sl-langsel",n.setAttribute("aria-label",e.label);for(let o of t){let r=document.createElement("option");r.value=o,r.textContent=Ae.LOCALE_NAMES[o]??o,r.selected=o===(0,Ae.getLocale)(),n.appendChild(r)}return n.addEventListener("change",()=>e.onChange(n.value)),i.appendChild(n),n}function Ra(i,e){e.root.lang=i,e.root.dir=(0,Ae.localeDirection)(i),La(e.root);for(let n of e.painters)try{n()}catch{}e.refreshMapCopy();let t=e.languageSelect;t&&t.value!==i&&(t.value=i)}function ui(i,e,t,n=45e3){return new Promise(o=>{if(e.aborted){o({outcome:"cancelled"});return}let r=!1,s=d=>{r||(r=!0,clearTimeout(l),clearTimeout(c),e.removeEventListener("abort",a),o(d))},a=()=>s({outcome:"cancelled"}),l=setTimeout(()=>{r||t()},8e3),c=setTimeout(()=>s({outcome:"timeout"}),n);e.addEventListener("abort",a,{once:!0}),Promise.resolve().then(()=>r?void 0:i()).then(d=>{r||s({outcome:"loaded",value:d})},d=>s({outcome:"error",error:d}))})}var he=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}},Oh=new Set(["buyer_access_expired"]),_h=new Set(["paused","provider_failed","channel_denied","sales_not_open"]);function Nh(i,e){switch(e){case"buyer_access_invalid":return"invalid";case"buyer_access_revoked":return"revoked";case"buyer_access_origin_mismatch":return"origin_mismatch";case"buyer_access_event_mismatch":return"event_mismatch";case"buyer_access_group_mismatch":return"group_mismatch";case"buyer_access_mode_mismatch":return"mode_mismatch";case"buyer_access_environment_mismatch":return"environment_mismatch";case"channel_access_denied":return"channel_denied";case"channel_paused":return"paused";case"invalid_channel_scope":return"invalid_scope";case"audience_not_public":return"audience_not_public";case"sales_not_open":return"sales_not_open";case"origin_not_allowed":return"origin_not_allowed";default:break}return i===401?"invalid":null}function Dh(i){return/^Bearer\s+(\S+)$/i.exec(i?.trim()??"")?.[1]??null}function Un(i){return i instanceof he?i.reason!=="paused"&&i.reason!=="channel_denied":!i||typeof i!="object"?!1:i.status===401}function Bh(i,e){return i===401&&!!e&&Oh.has(e)}var Fh=3e4,_e,Ne,Ft,mi,Ji,yt,vt,st,fi,en,tn,nn,Vt,ke,or,Gn,bt,De=class{constructor(e){R(this,ke);R(this,_e,null);R(this,Ne,0);R(this,Ft,null);R(this,mi);R(this,Ji);R(this,yt,null);R(this,vt,null);R(this,st,null);R(this,fi,null);R(this,en);R(this,tn);R(this,nn,!1);R(this,Vt);if(S(this,mi,e.provider),S(this,Ji,e.skewMs??Fh),S(this,en,e.onExpired),S(this,tn,e.onUnavailable),e.token){let t=typeof e.token=="string"?{token:e.token}:e.token;x(this,ke,or).call(this,t)}S(this,nn,!!m(this,mi)||!!m(this,_e))}get configured(){return m(this,nn)}onRenewed(e){S(this,Vt,e)}get unavailable(){return m(this,st)}get hasToken(){return!!m(this,_e)&&(m(this,Ne)===0||m(this,Ne)>Date.now())}get expiresAt(){return m(this,Ne)}async authorization(e="initial"){if(!this.configured)return null;if(m(this,st))throw new he(m(this,st));let t=Date.now();if(!m(this,_e)||m(this,Ne)>0&&m(this,Ne)-m(this,Ji)<=t){let o=!!m(this,_e)&&m(this,Ne)>0&&m(this,Ne)<=t,r=m(this,_e)?o?"expired":"expiring":e,s=await x(this,ke,Gn).call(this,r);if(!s)throw new he(m(this,st)??m(this,fi)??x(this,ke,bt).call(this,"provider_failed"));return`Bearer ${s}`}return`Bearer ${m(this,_e)}`}async handleFailure(e,t,n){var r;if(!this.configured)return!1;if(Bh(e,t)){let s=Dh(n)??m(this,Ft);S(this,_e,null),S(this,Ne,0);let a=await x(this,ke,Gn).call(this,"unauthorized",t),l=!!a&&a!==s;return(r=m(this,en))==null||r.call(this,{reason:"unauthorized",code:t,refreshed:l}),a&&!l&&x(this,ke,bt).call(this,"revoked",t,e),l}let o=Nh(e,t);return o&&x(this,ke,bt).call(this,o,t,e),!1}async refresh(e="manual"){return S(this,st,null),S(this,fi,null),S(this,_e,null),S(this,Ne,0),!!await x(this,ke,Gn).call(this,e)}clear(){m(this,vt)?.abort(),S(this,vt,null),S(this,_e,null),S(this,Ft,null),S(this,Ne,0),S(this,yt,null),S(this,Vt,void 0)}toJSON(){return{configured:this.configured,hasToken:this.hasToken}}toString(){return"[BuyerAccessContext redacted]"}};_e=new WeakMap,Ne=new WeakMap,Ft=new WeakMap,mi=new WeakMap,Ji=new WeakMap,yt=new WeakMap,vt=new WeakMap,st=new WeakMap,fi=new WeakMap,en=new WeakMap,tn=new WeakMap,nn=new WeakMap,Vt=new WeakMap,ke=new WeakSet,or=function(e){return!e||typeof e.token!="string"||!e.token?null:(S(this,Ft,e.token),S(this,_e,e.token),S(this,Ne,typeof e.expiresAt=="number"?e.expiresAt:0),m(this,_e))},Gn=function(e,t){if(m(this,yt))return m(this,yt);let n=m(this,mi);if(!n)return x(this,ke,bt).call(this,"no_token",t),Promise.resolve(null);let o=m(this,Ft),r=new AbortController;S(this,vt,r);let s=(async()=>{try{let a=await ui(()=>Promise.resolve(n({reason:e})),r.signal,()=>{},4e4);if(r.signal.aborted||a.outcome==="cancelled")return null;if(a.outcome!=="loaded")return x(this,ke,bt).call(this,"provider_failed",t),null;let l=a.value,c=x(this,ke,or).call(this,l);if(!c)return x(this,ke,bt).call(this,"provider_failed",t),null;if(o&&o!==c&&m(this,Vt))try{await m(this,Vt).call(this,{previousToken:o,token:c,reason:e})}catch{}return r.signal.aborted?null:c}catch{return x(this,ke,bt).call(this,"provider_failed",t),null}finally{m(this,vt)===r&&(S(this,yt,null),S(this,vt,null))}})();return S(this,yt,s),s},bt=function(e,t,n){var r;let o={reason:e,code:t,status:n,retryable:e==="paused"||e==="channel_denied"||e==="sales_not_open"};return S(this,fi,o),_h.has(e)||(S(this,st,o),S(this,_e,null),S(this,Ne,0)),(r=m(this,tn))==null||r.call(this,o),o};function gi(i,e={}){return!i.buyerAccessTokenProvider&&!i.buyerAccessToken?null:new De({provider:i.buyerAccessTokenProvider,token:i.buyerAccessToken,...e})}function qn(i){let e={state:"none"};return{transport:new Proxy(i,{get(n,o){let r=Reflect.get(n,o,n);return typeof r!="function"?r:o!=="chart"?r.bind(n):(...s)=>{let a;try{a=r.apply(n,s)}catch(l){throw e={state:"rejected",error:l},l}return Promise.resolve(a).then(l=>(e={state:"resolved"},l),l=>{throw e={state:"rejected",error:l},l})}}}),outcome:()=>e}}function Wn(i,e){if(!e||!i)return null;if(i.state==="resolved")return"chart_load:transform_failed";if(i.state!=="rejected")return null;let t=i.error;return t instanceof ie?t.status>=500&&t.status<=599?"chart_load:chart_fetch_5xx":t.status>=400&&t.status<=499?"chart_load:chart_fetch_4xx":null:typeof t=="object"&&t!==null&&t.name==="AbortError"?"chart_load:chart_fetch_timeout":"chart_load:chart_fetch_network"}var Ia=new Set;function Yn(i){return Ia.has(i.reason)||(Ia.add(i.reason),typeof fetch>"u"||qi())?!1:(fetch(`${i.apiBase.replace(/\/+$/,"")}/pub/telemetry/client-error`,{method:"POST",headers:{"Content-Type":"application/json","X-SeatLayer-Client":"1"},body:JSON.stringify({surface:"picker",errorCode:i.reason,eventKey:i.eventKey}),credentials:"omit",keepalive:!0}).catch(()=>{}),!0)}function sr(i){return!!i&&typeof i=="object"&&!Array.isArray(i)}function Vh(i){return sr(i.availability)?i.availability:null}function $h(i){let e=i.subscribeTicket;if(!sr(e))return null;let t=e.ticket,n=e.protocols;return t!==void 0&&typeof t!="string"||n!==void 0&&(!Array.isArray(n)||n.some(o=>typeof o!="string"))||t===void 0&&n===void 0?null:{...t===void 0?{}:{ticket:t},...n===void 0?{}:{protocols:n}}}var Oa=3e4,zh=2e4;function jh(i){if(!i||typeof i!="object"||Array.isArray(i))return!1;let e=i;return typeof e.token=="string"&&e.token.startsWith("bse_")&&typeof e.expiresAt=="number"&&Number.isFinite(e.expiresAt)&&e.expiresAt>Date.now()&&!!e.event&&typeof e.event=="object"&&!!e.doc&&typeof e.doc=="object"&&!!e.objects&&typeof e.objects=="object"&&!Array.isArray(e.objects)&&!!e.objects.seats&&typeof e.objects.seats=="object"}function Kh(i){return i>=400&&i<500&&i!==408&&i!==429}var Xn=class{constructor(e,t,n){this.base=e;this.event=t;this.publicKey=n;this.value=null;this.inflight=null;this.refusal=null;this.fetchedAt=0}usable(){return this.inflight?!0:!!this.value&&this.value.expiresAt-Oa>Date.now()}refused(){return this.refusal}async load(e=!1){if(e&&(this.value=null,this.refusal=null),this.refusal)throw this.refusal;if(this.value&&this.value.expiresAt-Oa>Date.now())return this.value;if(this.inflight)return this.inflight;let t=(async()=>{let n=new AbortController,o=setTimeout(()=>n.abort(),4e4);try{let r=await fetch(`${this.base}/pub/events/${encodeURIComponent(this.event)}/bootstrap`,{method:"POST",body:JSON.stringify({publicKey:this.publicKey}),credentials:"omit",signal:n.signal}),s=await r.json().catch(()=>null);if(!r.ok){let a=r.status===429?Wi(r.headers.get("Retry-After"),s?.retryAfterSeconds):void 0,l=new ie(r.status,s?.error??`request_failed_${r.status}`,s?.code??s?.error,void 0,void 0,a,void 0,{...typeof s?.hint=="string"&&s.hint?{hint:s.hint}:{},...typeof s?.message=="string"&&s.message?{serverMessage:s.message}:{}});throw Kh(r.status)&&(this.refusal=l),l}if(!jh(s))throw new ie(502,"invalid_bootstrap_response","invalid_bootstrap_response");return this.value=s,this.fetchedAt=Date.now(),s}finally{clearTimeout(o)}})();this.inflight=t;try{return await t}finally{this.inflight===t&&(this.inflight=null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.load(t);return{token:n.token,expiresAt:n.expiresAt}}},rr=class extends ft{constructor(t,n,o,r,s){super(t,{...s,access:r});this.event=n;this.loader=o;this.bootstrapAccess=r;this.initialChartDelivered=!1;this.initialObjectsDelivered=!1;this.initialAvailabilityDelivered=!1;this.initialTicketDelivered=!1}assertEvent(t){if(t!==this.event)throw new ie(404,"not_found","not_found")}async bundle(t){this.assertEvent(t);let n=this.loader.refused();if(n)throw n;try{await this.bootstrapAccess.authorization("initial")}catch(o){throw this.loader.refused()??o}return this.loader.load()}async chart(t){if(this.assertEvent(t),this.initialChartDelivered)return super.chart(t);let n=await this.bundle(t);return this.initialChartDelivered=!0,{event:n.event,doc:n.doc}}async objects(t){if(this.assertEvent(t),this.initialObjectsDelivered)return super.objects(t);let n=await this.bundle(t);return this.initialObjectsDelivered=!0,{...n.objects,fetchedAt:this.loader.fetchedAt}}async availability(t,n=!1){if(this.assertEvent(t),n||this.initialAvailabilityDelivered)return super.availability(t,n);let o=await this.bundle(t);return this.initialAvailabilityDelivered=!0,Vh(o)??super.availability(t,n)}async pickerIdleMinutes(){let t=await this.bundle(this.event),n=sr(t.realtime)?t.realtime.idleMinutes:void 0;return typeof n=="number"&&Number.isFinite(n)&&n>=0?n:null}async subscribeTicket(t){if(this.assertEvent(t),this.initialTicketDelivered)return super.subscribeTicket(t);let n=await this.bundle(t);return this.initialTicketDelivered=!0,Date.now()-this.loader.fetchedAt<zh?$h(n)??super.subscribeTicket(t):super.subscribeTicket(t)}},bi=new Map;function _a(i,e,t){return`${i}
|
|
264
264
|
${e}
|
|
265
|
-
${t}`}function
|
|
265
|
+
${t}`}function Na(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let o=_a(e,t,n);if(bi.get(o)?.usable())return;let s=new Xn(e,t,n);bi.set(o,s),s.load().catch(()=>{bi.get(o)===s&&bi.delete(o)})}function Gh(i,e,t){let n=_a(i,e,t),o=bi.get(n);return o?(bi.delete(n),o.usable()?o:null):null}function Qn(i){let e=Gh(i.base,i.event,i.publicKey)??new Xn(i.base,i.event,i.publicKey),t=new De({provider:({reason:n})=>e.token(n),...i.accessHooks});return{access:t,api:new rr(i.base,i.event,e,t,i.apiOptions??{})}}var le=require("@seatlayer/core");var we={enter:260,exit:180,spring:320,flight:500,stagger:30,crossfade:120,collapse:150,rung:200,reducedFade:120,easeEnter:"cubic-bezier(.2,.8,.2,1)",easeExit:"cubic-bezier(.4,0,1,1)",easeSpring:"cubic-bezier(.34,1.56,.64,1)"};var Uh=`.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:${we.enter}ms;--sl-dur-exit:${we.exit}ms;--sl-dur-spring:${we.spring}ms;--sl-dur-flight:${we.flight}ms;--sl-dur-stagger:${we.stagger}ms;--sl-dur-xfade:${we.crossfade}ms;--sl-dur-collapse:${we.collapse}ms;--sl-dur-rung:${we.rung}ms;--sl-ease-enter:${we.easeEnter};--sl-ease-exit:${we.easeExit};--sl-ease-spring:${we.easeSpring};--sl-mo-ox:50%;--sl-mo-oy:50%}`,qh=`@media (prefers-reduced-motion:reduce){.sl-picker,.sl-modal-scrim,.sl-mo-host{--sl-dur-enter:0ms;--sl-dur-exit:0ms;--sl-dur-spring:0ms;--sl-dur-flight:0ms;--sl-dur-stagger:0ms;--sl-dur-collapse:0ms;--sl-dur-rung:0ms;--sl-dur-xfade:${we.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:${we.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}}`,Da=Uh+`
|
|
266
266
|
/* Anchored open/close. The translate is 8px TOWARD the anchor, which is what
|
|
267
267
|
makes the card look attached to the seat rather than dropped on the map. */
|
|
268
268
|
.sl-mo-in{transform-origin:var(--sl-mo-ox) var(--sl-mo-oy);
|
|
@@ -329,7 +329,7 @@ ${t}`}function La(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
|
|
|
329
329
|
@keyframes slMoZoom{from{opacity:0;transform:scale(1.02)}to{opacity:1;transform:none}}
|
|
330
330
|
.sl-mo-rotate-in{animation:slMoSpin var(--sl-dur-spring) var(--sl-ease-spring) 1 both}
|
|
331
331
|
@keyframes slMoSpin{from{opacity:0;transform:rotate(-140deg) scale(.8)}to{opacity:1;transform:none}}
|
|
332
|
-
`+Oh;function Qn(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function ar(i,e){if(!e){i.style.removeProperty("--sl-mo-ox"),i.style.removeProperty("--sl-mo-oy");return}Zn(i,e,i.getBoundingClientRect())}function Zn(i,e,t){let n=t.width||1,o=t.height||1,r=s=>Math.max(0,Math.min(100,s));i.style.setProperty("--sl-mo-ox",`${r((e.x-t.left)/n*100).toFixed(1)}%`),i.style.setProperty("--sl-mo-oy",`${r((e.y-t.top)/o*100).toFixed(1)}%`)}function Ra(i,e,t){let n=i.getBoundingClientRect(),o=t.getBoundingClientRect();Zn(i,e,{left:n.left-o.left,top:n.top-o.top,width:n.width,height:n.height})}function Ia(i,e){i.classList.remove("sl-mo-out"),e!==void 0&&ar(i,e),i.classList.remove("sl-mo-in"),i.offsetWidth,i.classList.add("sl-mo-in")}function Oa(i){i.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(i.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function Jn(i,e,t={className:"sl-mo-out",duration:we.exit}){let n=()=>{o||(o=!0,!(typeof window>"u")&&(clearTimeout(r),i.removeEventListener("animationend",n),e?e():i.remove()))},o=!1;i.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),i.classList.add(t.className),i.addEventListener("animationend",n);let r=setTimeout(n,Qn()?0:t.duration+60)}var sg={className:"sl-mo-slide-down",duration:we.exit};function _a(i){if(Qn())return i.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=i.label??"",e.style.left=`${i.from.x}px`,e.style.top=`${i.from.y}px`,e.style.background=i.color??"var(--sl-accent,#6e7bff)",e.style.color=i.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(i.to.x-i.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(i.to.y-i.from.y)}px`),document.body.appendChild(e);let t=!1,n=()=>{t||(t=!0,window.clearTimeout(o),e.remove(),i.onArrive?.())};e.addEventListener("animationend",n);let o=window.setTimeout(n,we.flight+80);return e}var ne=i=>String(i??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e]);function xi(i,e){let t=0;for(let n of i.get(e)?.values()??[])t+=n;return t}function Na(i){let e=[];for(let[t,n]of i)for(let[o,r]of n)r>0&&e.push({areaId:t,tierId:o,qty:r});return e}function Da(i){let e=new Map;for(let t of i.keys())e.set(t,xi(i,t));return e}function vi(i,e,t,n){let o=i.get(e)??new Map;n>0?o.set(t,n):o.delete(t),o.size?i.set(e,o):i.delete(e)}function Ba(i){let e=new Map;for(let t of i)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function wt(i,e){let t=Ba(e),n=0;for(let o of i.keys())n+=Math.max(0,xi(i,o)-(t.get(o)??0));return n}function Fa(i,e,t){let n=Ba(t),o=0;for(let r of e){let s=i.gaQty.get(r.id);if(!s)continue;let a=n.get(r.id)??0;for(let[l,c]of s){let d=Math.max(0,c-a);a=Math.max(0,a-c),o+=d*i.paidPrice(r.categoryKey,l,_h(r,l),r.id)}}return o}function _h(i,e){return e?i.tiers?.find(t=>t.id===e)?.price??i.price:i.price}function Va(i){let e=[],t=new Map;for(let n of i){if(n.objectType!=="ga"||!n.objectId){e.push({...n,labels:[n.label]});continue}let o=`${n.objectId}\0${n.tierId??""}`,r=t.get(o);if(r){r.quantity=(r.quantity??0)+(n.quantity??1),r.labels.push(n.label);continue}let s={...n,quantity:n.quantity??1,labels:[n.label]};t.set(o,s),e.push(s)}return e}function za(i,e,t){let n=new Set(t);for(let o of e)o.objectType==="ga"&&o.objectId&&n.has(o.label)&&vi(i,o.objectId,o.tierId??null,0)}function dr(i,e){if(i.objectType!=="ga")return i.label;let t=e.find(n=>n.id===i.objectId);return t?.displayLabel??t?.label??i.label}function Nh(i){let e=new Map;for(let t of i){if(t.objectType!=="ga"||!t.objectId)continue;let n=`${t.objectId}\0${t.tierId??""}`;e.set(n,(e.get(n)??0)+(t.quantity??1))}return e}function pr(i){let e=i.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:i.displayType??(0,le.t)("picker.generalAdmission"),price:i.price}]}function $a(i,e){let t=i.totalTicketCount()-xi(i.gaQty,e.id);return Math.max(0,Math.min(zt(i,e),i.maxTickets-t))}function zt(i,e){return hr(i)?wi(e)?e.wheelchairPlaces?e.available:0:Math.min(e.available,e.wheelchairAvailable??0):e.available}function wi(i){if(i.bookingMode!=="whole"&&i.bookingMode!=="variable")return null;let e=Math.max(0,Math.floor(i.maxOccupancy??i.capacity)),t=i.bookingMode==="whole"?e:Math.max(1,Math.min(e,Math.floor(i.minOccupancy??1)));return{mode:i.bookingMode,min:t,max:e}}function ja(i,e){return hr(i)&&e.available>0?i.tf("picker.noWheelchairSpace","No wheelchair space"):i.tf("picker.soldOutTitle","Sold out")}function hr(i){return i.controller?.getAccessibilityFilter?.()?.includes("wheelchair")===!0}function Dh(i){return`${(0,le.t)("picker.access.wheelchair")} \xB7 ${(0,le.tCount)("picker.leftCount",i.wheelchairAvailable??0)}`}function Bh(i){let e=[];return i.wheelchairPlaces&&e.push({icon:"wheelchair",title:(0,le.t)("picker.access.wheelchair"),tone:"access",note:(0,le.tCount)("picker.leftCount",i.wheelchairAvailable??0)}),i.entrance&&e.push({icon:"entrance",title:(0,le.t)("picker.entrance"),note:i.entrance,tone:"place"}),Zo(e,{compact:!0})}function Ga(i,e){let t=wi(i),n=pr(i),o=zt({controller:{getAccessibilityFilter:()=>e.wheelchairOnly?["wheelchair"]:null}},i),r=t?t.max:Math.max(0,Math.min(o,e.room));return{area:i,...t?{bookingMode:t.mode}:{},selected:{},min:t?t.min:0,max:r,tiers:n,confirm:s=>{if(typeof s=="number"){e.hold(s,t&&n.length>1?n[0].id:null);return}if(t){let a=Object.entries(s).find(([,l])=>l>0);a&&e.hold(a[1],a[0]||null);return}e.hold(Object.values(s).reduce((a,l)=>a+l,0),null)},cancel:()=>{}}}function ur(i,e,t,n){if(Je(i,!1),i.salesClosed){i.toast(i.closedWords?.().toast??i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let o=wi(e),r=pr(e),s=i.gaQty.get(e.id),a=xi(i.gaQty,e.id)>0,l=$a(i,e);if((o?l<o.min:l<=0)&&!a){i.toast(zt(i,e)<=0||o&&zt(i,e)<o.min?ja(i,e):(0,le.t)("picker.maxTicketsForOrder",{count:i.maxTickets}),"warning");return}let c=o?[...s??[]].find(([,b])=>b>0)?.[0]??r[0].id:null;if(i.onGAPromptHook){let b={};for(let[T,w]of s??[])b[T??""]=w;if(i.onGAPromptHook({area:e,...o?{bookingMode:o.mode}:{},selected:b,min:o?o.min:0,max:o?Math.min(o.max,l):l,tiers:r,confirm:T=>{$h(i,e,r,T,l,o)},cancel:()=>Je(i)})===!0)return}let d=new Map;for(let b of r)d.set(b.id,s?.get(b.id)??0);!a&&l>0&&d.set(o?c:r[0].id,o?o.min:1);let p={area:e,tiers:r,draft:d,max:l,reopened:a,box:o,boxTier:c},u=i.root?.dataset.layout==="narrow",h=document.createElement("div");h.className=u?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",h.innerHTML=Fh(i,p,u),i.root?.appendChild(h),i.gaPromptEl=h,i.gaPromptReturnFocus=n??document.activeElement,u||jh(i,h,t,n),i.reducedMotion()&&(h.dataset.motion="reduced"),lr(i,p),Vh(i,h,p),requestAnimationFrame(()=>h.querySelector('[data-ga-step="1"]')?.focus())}function Fh(i,e,t){let{area:n,tiers:o,box:r}=e,s=o.length>1,a=n.displayLabel??n.label,l=r&&s?In(o.map(d=>({id:d.id??"",name:d.label,price:d.price})),e.boxTier??void 0,d=>i.money(i.paidPrice(n.categoryKey,d.id,d.price,n.id))):"",c=r?l+(`<div class="sl-ga-prompt-row" data-ga-tier="${ne(e.boxTier??"")}"><div class="sl-ga-prompt-label"><span>${ne(i.tf("picker.numberOfGuests","Number of guests"))}</span>`+(r.mode==="variable"?`<small data-ga-range>${ne((0,le.t)("picker.chooseMinMaxGuests",{min:r.min,max:r.max}))}</small>`:"")+"</div>"+(r.mode==="whole"?`<output data-ga-qty>${r.max}</output>`:`<div class="sl-ga-stepper" role="group" aria-label="${ne(a)}"><button type="button" data-ga-step="-1" aria-label="${ne(i.tf("picker.fewerGuests","Fewer guests"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${ne(i.tf("picker.moreGuests","More guests"))}">+</button></div>`)+"</div>"):o.map(d=>`<div class="sl-ga-prompt-row" data-ga-tier="${ne(d.id??"")}"><div class="sl-ga-prompt-label"><span>${ne(s?d.label:i.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${ne(i.money(i.paidPrice(n.categoryKey,d.id,d.price,n.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${ne(s?d.label:a)}"><button type="button" data-ga-step="-1" aria-label="${ne(i.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${ne(i.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${ne((0,le.t)("picker.gaChooseForArea",{area:a}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${ne(n.displayType??i.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${ne(a)}</h2><p class="sl-ga-prompt-sub" data-ga-sub></p><button type="button" class="sl-ga-prompt-close" data-ga-cancel aria-label="${ne((0,le.t)("common.close"))}">\xD7</button></div>`+Bh(n)+`<div class="sl-ga-prompt-body">${c}`+(o.length>1||r?`<div class="sl-ga-prompt-total"><span>${ne(i.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${ne(i.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${ne((0,le.t)("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function eo(i){let e=0;for(let t of i.draft.values())e+=t;return e}function Ka(i,e){let t=0;for(let n of e.tiers)t+=(e.draft.get(n.id)??0)*i.paidPrice(e.area.categoryKey,n.id,n.price,e.area.id);return t}function lr(i,e){let t=i.gaPromptEl;if(!t)return;let n=eo(e),o=Ka(i,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<=(e.box?e.box.min:0):n>=(e.box?Math.min(e.box.max,e.max):e.max)})});let r=t.querySelector("[data-ga-sub]");if(r){let c=e.box&&e.tiers.find(p=>p.id===e.boxTier)||e.tiers[0],d=i.money(i.paidPrice(e.area.categoryKey,c.id,c.price,e.area.id));r.textContent=e.box?(0,le.t)("picker.perGuestPrice",{price:d}):`${d} \xB7 ${(0,le.tCount)("picker.leftCount",e.area.available)}`}let s=t.querySelector("[data-ga-total]");s&&(s.textContent=i.money(o));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=e.box?"":n>=e.max&&e.max>0?hr(i)&&e.area.wheelchairPlaces?Dh(e.area):e.area.available<=e.max?(0,le.tCount)("picker.leftCount",e.area.available):(0,le.t)("picker.maxTicketsForOrder",{count:i.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");if(l){let c=(0,le.t)("picker.guestsCount",{count:n});l.textContent=e.reopened?(0,le.tCount)("picker.gaUpdate",n,{count:n}):e.box?.mode==="whole"?i.tf("picker.gaBookWholeArea","Book the whole area"):e.box?`${i.tf("picker.gaBook","Book")} \xB7 ${c} \xB7 ${i.money(o)}`:(0,le.tCount)("picker.gaAdd",n,{count:n,price:i.money(o)}),l.disabled=(e.box?n<e.box.min:n<=0)&&!e.reopened}}function Vh(i,e,t){e.querySelectorAll("[data-confirm-tier]").forEach(n=>{n.addEventListener("click",()=>{let o=t.tiers.find(a=>(a.id??"")===n.dataset.confirmTier);if(!o||!t.box)return;let r=eo(t);for(let a of t.tiers)t.draft.set(a.id,0);t.draft.set(o.id,r),t.boxTier=o.id,e.querySelectorAll("[data-confirm-tier]").forEach(a=>{a.setAttribute("aria-pressed",String(a===n))});let s=e.querySelector("[data-ga-tier]");s&&(s.dataset.gaTier=o.id??""),lr(i,t)})}),e.querySelectorAll("[data-ga-step]").forEach(n=>{n.addEventListener("click",()=>{let o=n.closest("[data-ga-tier]");if(!o)return;let r=o.dataset.gaTier?o.dataset.gaTier:null,s=Number(n.dataset.gaStep),a=t.draft.get(r)??0,l=(t.box?Math.min(t.box.max,t.max):t.max)-eo(t),c=t.box?t.box.min:0;t.draft.set(r,Math.max(c,a+(s>0?Math.min(1,l):-1))),lr(i,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(n=>n.addEventListener("click",()=>Je(i))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{i.gaQty.delete(t.area.id),Je(i),i.syncTray(),cr(i,(0,le.t)("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{zh(i,t)}),e.addEventListener("mousedown",n=>{n.target===e&&Je(i)}),e.addEventListener("keydown",n=>{if(n.key==="Escape"){n.stopPropagation(),Je(i);return}if(n.key!=="Tab")return;let o=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!o.length)return;let r=o[0],s=o[o.length-1];n.shiftKey&&document.activeElement===r?(n.preventDefault(),s.focus()):!n.shiftKey&&document.activeElement===s&&(n.preventDefault(),r.focus())})}function zh(i,e){let t=eo(e),n=Ka(i,e);for(let r of e.tiers)vi(i.gaQty,e.area.id,r.id,e.draft.get(r.id)??0);Je(i),i.syncTray();let o=e.area.displayLabel??e.area.label;t>0?cr(i,(0,le.tCount)("picker.gaAdded",t,{count:t,area:o,price:i.money(n)})):cr(i,(0,le.t)("picker.gaRemoved",{area:o}))}function $h(i,e,t,n,o,r=null){if(r){let s=typeof n=="number"?{tierId:t[0].id,wanted:n}:(()=>{let c=Object.entries(n).find(([,p])=>p>0);return{tierId:(t.find(p=>(p.id??"")===c?.[0])??t[0]).id,wanted:c?.[1]??0}})(),a=Math.floor(s.wanted),l=a<=0?0:r.mode==="whole"?r.max:Math.max(r.min,Math.min(r.max,o,a));i.gaQty.delete(e.id),vi(i.gaQty,e.id,s.tierId,l<=o?l:0)}else if(typeof n=="number")vi(i.gaQty,e.id,t[0].id,Math.max(0,Math.min(o,Math.floor(n))));else{i.gaQty.delete(e.id);let s=o;for(let a of t){let l=Math.max(0,Math.floor(n[a.id??""]??0)),c=Math.min(l,s);s-=c,vi(i.gaQty,e.id,a.id,c)}}i.syncTray()}function Je(i,e=!0){let t=i.gaPromptReturnFocus;i.gaPromptEl&&Jn(i.gaPromptEl),i.gaPromptEl=null,i.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:i.root)?.focus())}function jh(i,e,t,n){let o=i.root,r=e.querySelector(".sl-ga-pop");if(!o||!r)return;if(!t){n&&o.contains(n)&&Gh(o,r,n);return}let s=o.getBoundingClientRect(),a=t.x-s.left,l=t.y-s.top;e.style.setProperty("--sl-ga-anchor-x",`${a}px`),e.style.setProperty("--sl-ga-anchor-y",`${l}px`),requestAnimationFrame(()=>{let c=r.offsetWidth||260,d=r.offsetHeight||220,p=Math.max(8,Math.min(s.width-c-8,a-c/2)),u=l-d-14,h=u>=8?u:Math.min(s.height-d-8,l+14);r.style.left=`${p}px`,r.style.top=`${Math.max(8,h)}px`,r.dataset.side=u>=8?"above":"below",r.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(c-12,a-p))}px`)})}var yi=14;function Gh(i,e,t){requestAnimationFrame(()=>{let n=i.getBoundingClientRect(),o=t.getBoundingClientRect(),r=e.offsetWidth||288,s=e.offsetHeight||220,a=o.left-n.left-yi-8,l=n.right-o.right-yi-8,c=a>=l?"left":"right";if(Math.max(a,l)<r){let h=o.left+o.width/2-n.left,b=o.top-n.top-s-yi,g=b>=8?b:Math.min(n.height-s-8,o.bottom-n.top+yi),T=Math.max(8,Math.min(n.width-r-8,h-r/2));e.style.left=`${T}px`,e.style.top=`${Math.max(8,g)}px`,e.dataset.side=b>=8?"above":"below",e.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(r-12,h-T))}px`);return}let d=o.top+o.height/2-n.top,p=Math.max(8,Math.min(n.height-s-8,d-s/2)),u=c==="left"?o.left-n.left-yi-r:o.right-n.left+yi;e.style.left=`${u}px`,e.style.top=`${p}px`,e.dataset.side=c,e.style.setProperty("--sl-ga-arrow-y",`${Math.max(16,Math.min(s-16,d-p))}px`)})}function cr(i,e){i.srEl&&(i.srEl.textContent=e)}function Ua(i,e,t=[]){let n=[],o=Nh(t);for(let s of e){let a=i.gaQty.get(s.id);if(!a)continue;let l=pr(s);for(let c of l){let d=(a.get(c.id)??0)-(o.get(`${s.id}\0${c.id??""}`)??0);if(d<=0)continue;let p=i.paidPrice(s.categoryKey,c.id,c.price,s.id),u=wi(s);n.push(`<div class="sl-ga" data-ga="${ne(s.id)}" data-ga-row-tier="${ne(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${ne(s.displayLabel??s.label)}</div><div class="sl-ga-sub">${ne(u?[l.length>1?c.label:"",(0,le.t)("picker.perGuestPrice",{price:i.money(p)})].filter(Boolean).join(" \xB7 "):`${l.length>1?c.label:s.displayType??i.tf("picker.generalAdmission","General admission")} \xB7 ${i.money(p)} \xB7 ${(0,le.tCount)("picker.leftCount",s.available)}`)}</div></div>`+(u?`<button type="button" class="sl-table-edit" data-ga-open="${ne(s.id)}">${ne((0,le.t)("picker.guestsCountEdit",{count:d}))}</button></div>`:`<div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${ne(i.tf("picker.fewer","Fewer"))}">\u2212</button><span>${d}</span><button type="button" data-d="1" aria-label="${ne(i.tf("picker.more","More"))}">+</button></div></div>`))}}let r=e.filter(s=>xi(i.gaQty,s.id)<=0&&!t.some(a=>a.objectId===s.id));return r.length&&n.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${i.gaAreasExpanded}"><span>${ne(i.tf("picker.gaAreasHeading","Areas"))}</span><small>${r.length}</small></button>`+(i.gaAreasExpanded?`<div class="sl-ga-areas-list">${r.map(s=>`<button type="button" class="sl-ga-area-open" data-ga-open="${ne(s.id)}"${zt(i,s)<=0?" disabled":""}><span class="name">${ne(s.displayLabel??s.label)}<small>${ne(s.displayType??i.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${ne(zt(i,s)<=0?ja(i,s):`${i.money(i.paidPrice(s.categoryKey,null,s.price,s.id))} \xB7 ${wi(s)?(0,le.t)("picker.capacityGuests",{count:wi(s).max}):(0,le.tCount)("picker.leftCount",zt(i,s))}`)}</span></button>`).join("")}</div>`:"")+"</div>"),n.join("")}function qa(i,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(n=>{n.addEventListener("click",()=>{let o=n.closest(".sl-ga");if(!o?.dataset.ga)return;let r=t.find(c=>c.id===o.dataset.ga);if(!r)return;let s=o.dataset.gaRowTier?o.dataset.gaRowTier:null,a=Number(n.dataset.d),l=i.gaQty.get(r.id)?.get(s)??0;if(a>0&&$a(i,r)-xi(i.gaQty,r.id)<=0){i.toast((0,le.t)("picker.maxTicketsForOrder",{count:i.maxTickets}),"warning");return}vi(i.gaQty,r.id,s,Math.max(0,l+a)),i.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{i.gaAreasExpanded=!i.gaAreasExpanded,i.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(n=>{n.addEventListener("click",()=>{let o=t.find(r=>r.id===n.dataset.gaOpen);o&&ur(i,o,null,n)})})}var to='<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 Kh=/^[a-zA-Z0-9._-]+$/;function mr(i){let e;try{e=new URL(i,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;let t=/^\/pub\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!t)return null;try{let n=decodeURIComponent(t[1]),o=decodeURIComponent(t[2]);return!n||!Kh.test(o)?null:{eventKey:n,asset:o}}catch{return null}}function Uh(i){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(i,"https://seatlayer.invalid").pathname)}catch{return!1}}var ki=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=mr(e);if(!t)return Promise.resolve(Uh(e)||!si(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let n=this.pending.get(e);if(n)return n;let o=this.load(this.eventKey,t.asset).then(r=>{let s=URL.createObjectURL(r);return this.disposed?(URL.revokeObjectURL(s),null):(this.created.add(s),s)}).catch(r=>{throw this.pending.delete(e),r});return this.pending.set(e,o),o}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var $t=require("@seatlayer/core"),so=require("@seatlayer/core/view3d/crossfade/panorama");var Wa=`
|
|
332
|
+
`+qh;function Zn(){try{return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}}function ar(i,e){if(!e){i.style.removeProperty("--sl-mo-ox"),i.style.removeProperty("--sl-mo-oy");return}Jn(i,e,i.getBoundingClientRect())}function Jn(i,e,t){let n=t.width||1,o=t.height||1,r=s=>Math.max(0,Math.min(100,s));i.style.setProperty("--sl-mo-ox",`${r((e.x-t.left)/n*100).toFixed(1)}%`),i.style.setProperty("--sl-mo-oy",`${r((e.y-t.top)/o*100).toFixed(1)}%`)}function Ba(i,e,t){let n=i.getBoundingClientRect(),o=t.getBoundingClientRect();Jn(i,e,{left:n.left-o.left,top:n.top-o.top,width:n.width,height:n.height})}function Fa(i,e){i.classList.remove("sl-mo-out"),e!==void 0&&ar(i,e),i.classList.remove("sl-mo-in"),i.offsetWidth,i.classList.add("sl-mo-in")}function Va(i){i.classList.add("sl-mo-stagger");let e=0;for(let t of Array.from(i.children))t.style.setProperty("--sl-mo-i",String(e)),e+=1}function eo(i,e,t={className:"sl-mo-out",duration:we.exit}){let n=()=>{o||(o=!0,!(typeof window>"u")&&(clearTimeout(r),i.removeEventListener("animationend",n),e?e():i.remove()))},o=!1;i.classList.remove("sl-mo-in","sl-mo-slide-up","sl-mo-spring","sl-mo-zoom","sl-mo-rise"),i.classList.add(t.className),i.addEventListener("animationend",n);let r=setTimeout(n,Zn()?0:t.duration+60)}var Sg={className:"sl-mo-slide-down",duration:we.exit};function $a(i){if(Zn())return i.onArrive?.(),null;let e=document.createElement("div");e.className="sl-mo-fly sl-mo-host",e.setAttribute("aria-hidden","true"),e.textContent=i.label??"",e.style.left=`${i.from.x}px`,e.style.top=`${i.from.y}px`,e.style.background=i.color??"var(--sl-accent,#6e7bff)",e.style.color=i.ink??"#fff",e.style.setProperty("--sl-fly-dx",`${Math.round(i.to.x-i.from.x)}px`),e.style.setProperty("--sl-fly-dy",`${Math.round(i.to.y-i.from.y)}px`),document.body.appendChild(e);let t=!1,n=()=>{t||(t=!0,window.clearTimeout(o),e.remove(),i.onArrive?.())};e.addEventListener("animationend",n);let o=window.setTimeout(n,we.flight+80);return e}var ne=i=>String(i??"").replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e]);function xi(i,e){let t=0;for(let n of i.get(e)?.values()??[])t+=n;return t}function za(i){let e=[];for(let[t,n]of i)for(let[o,r]of n)r>0&&e.push({areaId:t,tierId:o,qty:r});return e}function ja(i){let e=new Map;for(let t of i.keys())e.set(t,xi(i,t));return e}function vi(i,e,t,n){let o=i.get(e)??new Map;n>0?o.set(t,n):o.delete(t),o.size?i.set(e,o):i.delete(e)}function Ka(i){let e=new Map;for(let t of i)t.objectType!=="ga"||!t.objectId||e.set(t.objectId,(e.get(t.objectId)??0)+(t.quantity??1));return e}function wt(i,e){let t=Ka(e),n=0;for(let o of i.keys())n+=Math.max(0,xi(i,o)-(t.get(o)??0));return n}function Ga(i,e,t){let n=Ka(t),o=0;for(let r of e){let s=i.gaQty.get(r.id);if(!s)continue;let a=n.get(r.id)??0;for(let[l,c]of s){let d=Math.max(0,c-a);a=Math.max(0,a-c),o+=d*i.paidPrice(r.categoryKey,l,Wh(r,l),r.id)}}return o}function Wh(i,e){return e?i.tiers?.find(t=>t.id===e)?.price??i.price:i.price}function Ua(i){let e=[],t=new Map;for(let n of i){if(n.objectType!=="ga"||!n.objectId){e.push({...n,labels:[n.label]});continue}let o=`${n.objectId}\0${n.tierId??""}`,r=t.get(o);if(r){r.quantity=(r.quantity??0)+(n.quantity??1),r.labels.push(n.label);continue}let s={...n,quantity:n.quantity??1,labels:[n.label]};t.set(o,s),e.push(s)}return e}function qa(i,e,t){let n=new Set(t);for(let o of e)o.objectType==="ga"&&o.objectId&&n.has(o.label)&&vi(i,o.objectId,o.tierId??null,0)}function dr(i,e){if(i.objectType!=="ga")return i.label;let t=e.find(n=>n.id===i.objectId);return t?.displayLabel??t?.label??i.label}function Yh(i){let e=new Map;for(let t of i){if(t.objectType!=="ga"||!t.objectId)continue;let n=`${t.objectId}\0${t.tierId??""}`;e.set(n,(e.get(n)??0)+(t.quantity??1))}return e}function pr(i){let e=i.tiers??[];return e.length>1?e.map(t=>({id:t.id,label:t.name||t.id,price:t.price})):[{id:null,label:i.displayType??(0,le.t)("picker.generalAdmission"),price:i.price}]}function Wa(i,e){let t=i.totalTicketCount()-xi(i.gaQty,e.id);return Math.max(0,Math.min($t(i,e),i.maxTickets-t))}function $t(i,e){return hr(i)?wi(e)?e.wheelchairPlaces?e.available:0:Math.min(e.available,e.wheelchairAvailable??0):e.available}function wi(i){if(i.bookingMode!=="whole"&&i.bookingMode!=="variable")return null;let e=Math.max(0,Math.floor(i.maxOccupancy??i.capacity)),t=i.bookingMode==="whole"?e:Math.max(1,Math.min(e,Math.floor(i.minOccupancy??1)));return{mode:i.bookingMode,min:t,max:e}}function Ya(i,e){return hr(i)&&e.available>0?i.tf("picker.noWheelchairSpace","No wheelchair space"):i.tf("picker.soldOutTitle","Sold out")}function hr(i){return i.controller?.getAccessibilityFilter?.()?.includes("wheelchair")===!0}function Xh(i){return`${(0,le.t)("picker.access.wheelchair")} \xB7 ${(0,le.tCount)("picker.leftCount",i.wheelchairAvailable??0)}`}function Qh(i){let e=[];return i.wheelchairPlaces&&e.push({icon:"wheelchair",title:(0,le.t)("picker.access.wheelchair"),tone:"access",note:(0,le.tCount)("picker.leftCount",i.wheelchairAvailable??0)}),i.entrance&&e.push({icon:"entrance",title:(0,le.t)("picker.entrance"),note:i.entrance,tone:"place"}),Jo(e,{compact:!0})}function Xa(i,e){let t=wi(i),n=pr(i),o=$t({controller:{getAccessibilityFilter:()=>e.wheelchairOnly?["wheelchair"]:null}},i),r=t?t.max:Math.max(0,Math.min(o,e.room));return{area:i,...t?{bookingMode:t.mode}:{},selected:{},min:t?t.min:0,max:r,tiers:n,confirm:s=>{if(typeof s=="number"){e.hold(s,t&&n.length>1?n[0].id:null);return}if(t){let a=Object.entries(s).find(([,l])=>l>0);a&&e.hold(a[1],a[0]||null);return}e.hold(Object.values(s).reduce((a,l)=>a+l,0),null)},cancel:()=>{}}}function ur(i,e,t,n){if(Je(i,!1),i.salesClosed){i.toast(i.closedWords?.().toast??i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let o=wi(e),r=pr(e),s=i.gaQty.get(e.id),a=xi(i.gaQty,e.id)>0,l=Wa(i,e);if((o?l<o.min:l<=0)&&!a){i.toast($t(i,e)<=0||o&&$t(i,e)<o.min?Ya(i,e):(0,le.t)("picker.maxTicketsForOrder",{count:i.maxTickets}),"warning");return}let c=o?[...s??[]].find(([,b])=>b>0)?.[0]??r[0].id:null;if(i.onGAPromptHook){let b={};for(let[T,w]of s??[])b[T??""]=w;if(i.onGAPromptHook({area:e,...o?{bookingMode:o.mode}:{},selected:b,min:o?o.min:0,max:o?Math.min(o.max,l):l,tiers:r,confirm:T=>{tu(i,e,r,T,l,o)},cancel:()=>Je(i)})===!0)return}let d=new Map;for(let b of r)d.set(b.id,s?.get(b.id)??0);!a&&l>0&&d.set(o?c:r[0].id,o?o.min:1);let p={area:e,tiers:r,draft:d,max:l,reopened:a,box:o,boxTier:c},u=i.root?.dataset.layout==="narrow",h=document.createElement("div");h.className=u?"sl-ga-scrim sl-mo-scrim":"sl-ga-pop-layer",h.innerHTML=Zh(i,p,u),i.root?.appendChild(h),i.gaPromptEl=h,i.gaPromptReturnFocus=n??document.activeElement,u||iu(i,h,t,n),i.reducedMotion()&&(h.dataset.motion="reduced"),lr(i,p),Jh(i,h,p),requestAnimationFrame(()=>h.querySelector('[data-ga-step="1"]')?.focus())}function Zh(i,e,t){let{area:n,tiers:o,box:r}=e,s=o.length>1,a=n.displayLabel??n.label,l=r&&s?Nn(o.map(d=>({id:d.id??"",name:d.label,price:d.price})),e.boxTier??void 0,d=>i.money(i.paidPrice(n.categoryKey,d.id,d.price,n.id))):"",c=r?l+(`<div class="sl-ga-prompt-row" data-ga-tier="${ne(e.boxTier??"")}"><div class="sl-ga-prompt-label"><span>${ne(i.tf("picker.numberOfGuests","Number of guests"))}</span>`+(r.mode==="variable"?`<small data-ga-range>${ne((0,le.t)("picker.chooseMinMaxGuests",{min:r.min,max:r.max}))}</small>`:"")+"</div>"+(r.mode==="whole"?`<output data-ga-qty>${r.max}</output>`:`<div class="sl-ga-stepper" role="group" aria-label="${ne(a)}"><button type="button" data-ga-step="-1" aria-label="${ne(i.tf("picker.fewerGuests","Fewer guests"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${ne(i.tf("picker.moreGuests","More guests"))}">+</button></div>`)+"</div>"):o.map(d=>`<div class="sl-ga-prompt-row" data-ga-tier="${ne(d.id??"")}"><div class="sl-ga-prompt-label"><span>${ne(s?d.label:i.tf("picker.gaChooseTickets","How many tickets?"))}</span>`+(s?`<small>${ne(i.money(i.paidPrice(n.categoryKey,d.id,d.price,n.id)))}</small>`:"")+`</div><div class="sl-ga-stepper" role="group" aria-label="${ne(s?d.label:a)}"><button type="button" data-ga-step="-1" aria-label="${ne(i.tf("picker.fewer","Fewer"))}">\u2212</button><output data-ga-qty aria-live="polite">0</output><button type="button" data-ga-step="1" aria-label="${ne(i.tf("picker.more","More"))}">+</button></div></div>`).join("");return`<section class="${t?"sl-ga-sheet":"sl-ga-pop"}" role="dialog" aria-modal="true" aria-label="${ne((0,le.t)("picker.gaChooseForArea",{area:a}))}"><div class="sl-ga-prompt-head"><div class="sl-ga-prompt-eyebrow">${ne(n.displayType??i.tf("picker.generalAdmission","General admission"))}</div><h2 class="sl-ga-prompt-title">${ne(a)}</h2><p class="sl-ga-prompt-sub" data-ga-sub></p><button type="button" class="sl-ga-prompt-close" data-ga-cancel aria-label="${ne((0,le.t)("common.close"))}">\xD7</button></div>`+Qh(n)+`<div class="sl-ga-prompt-body">${c}`+(o.length>1||r?`<div class="sl-ga-prompt-total"><span>${ne(i.tf("picker.total","Total"))}</span><b data-ga-total></b></div>`:"")+'<p class="sl-ga-prompt-hint" data-ga-hint></p></div><div class="sl-ga-prompt-actions">'+(e.reopened?`<button type="button" class="sl-ga-prompt-remove" data-ga-remove>${ne(i.tf("picker.gaRemove","Remove"))}</button>`:`<button type="button" class="sl-ga-prompt-remove" data-ga-cancel>${ne((0,le.t)("common.cancel"))}</button>`)+'<button type="button" class="sl-ga-prompt-confirm" data-ga-confirm></button></div></section>'}function to(i){let e=0;for(let t of i.draft.values())e+=t;return e}function Qa(i,e){let t=0;for(let n of e.tiers)t+=(e.draft.get(n.id)??0)*i.paidPrice(e.area.categoryKey,n.id,n.price,e.area.id);return t}function lr(i,e){let t=i.gaPromptEl;if(!t)return;let n=to(e),o=Qa(i,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<=(e.box?e.box.min:0):n>=(e.box?Math.min(e.box.max,e.max):e.max)})});let r=t.querySelector("[data-ga-sub]");if(r){let c=e.box&&e.tiers.find(p=>p.id===e.boxTier)||e.tiers[0],d=i.money(i.paidPrice(e.area.categoryKey,c.id,c.price,e.area.id));r.textContent=e.box?(0,le.t)("picker.perGuestPrice",{price:d}):`${d} \xB7 ${(0,le.tCount)("picker.leftCount",e.area.available)}`}let s=t.querySelector("[data-ga-total]");s&&(s.textContent=i.money(o));let a=t.querySelector("[data-ga-hint]");a&&(a.textContent=e.box?"":n>=e.max&&e.max>0?hr(i)&&e.area.wheelchairPlaces?Xh(e.area):e.area.available<=e.max?(0,le.tCount)("picker.leftCount",e.area.available):(0,le.t)("picker.maxTicketsForOrder",{count:i.maxTickets}):"");let l=t.querySelector("[data-ga-confirm]");if(l){let c=(0,le.t)("picker.guestsCount",{count:n});l.textContent=e.reopened?(0,le.tCount)("picker.gaUpdate",n,{count:n}):e.box?.mode==="whole"?i.tf("picker.gaBookWholeArea","Book the whole area"):e.box?`${i.tf("picker.gaBook","Book")} \xB7 ${c} \xB7 ${i.money(o)}`:(0,le.tCount)("picker.gaAdd",n,{count:n,price:i.money(o)}),l.disabled=(e.box?n<e.box.min:n<=0)&&!e.reopened}}function Jh(i,e,t){e.querySelectorAll("[data-confirm-tier]").forEach(n=>{n.addEventListener("click",()=>{let o=t.tiers.find(a=>(a.id??"")===n.dataset.confirmTier);if(!o||!t.box)return;let r=to(t);for(let a of t.tiers)t.draft.set(a.id,0);t.draft.set(o.id,r),t.boxTier=o.id,e.querySelectorAll("[data-confirm-tier]").forEach(a=>{a.setAttribute("aria-pressed",String(a===n))});let s=e.querySelector("[data-ga-tier]");s&&(s.dataset.gaTier=o.id??""),lr(i,t)})}),e.querySelectorAll("[data-ga-step]").forEach(n=>{n.addEventListener("click",()=>{let o=n.closest("[data-ga-tier]");if(!o)return;let r=o.dataset.gaTier?o.dataset.gaTier:null,s=Number(n.dataset.gaStep),a=t.draft.get(r)??0,l=(t.box?Math.min(t.box.max,t.max):t.max)-to(t),c=t.box?t.box.min:0;t.draft.set(r,Math.max(c,a+(s>0?Math.min(1,l):-1))),lr(i,t)})}),e.querySelectorAll("[data-ga-cancel]").forEach(n=>n.addEventListener("click",()=>Je(i))),e.querySelector("[data-ga-remove]")?.addEventListener("click",()=>{i.gaQty.delete(t.area.id),Je(i),i.syncTray(),cr(i,(0,le.t)("picker.gaRemoved",{area:t.area.displayLabel??t.area.label}))}),e.querySelector("[data-ga-confirm]")?.addEventListener("click",()=>{eu(i,t)}),e.addEventListener("mousedown",n=>{n.target===e&&Je(i)}),e.addEventListener("keydown",n=>{if(n.key==="Escape"){n.stopPropagation(),Je(i);return}if(n.key!=="Tab")return;let o=[...e.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!o.length)return;let r=o[0],s=o[o.length-1];n.shiftKey&&document.activeElement===r?(n.preventDefault(),s.focus()):!n.shiftKey&&document.activeElement===s&&(n.preventDefault(),r.focus())})}function eu(i,e){let t=to(e),n=Qa(i,e);for(let r of e.tiers)vi(i.gaQty,e.area.id,r.id,e.draft.get(r.id)??0);Je(i),i.syncTray();let o=e.area.displayLabel??e.area.label;t>0?cr(i,(0,le.tCount)("picker.gaAdded",t,{count:t,area:o,price:i.money(n)})):cr(i,(0,le.t)("picker.gaRemoved",{area:o}))}function tu(i,e,t,n,o,r=null){if(r){let s=typeof n=="number"?{tierId:t[0].id,wanted:n}:(()=>{let c=Object.entries(n).find(([,p])=>p>0);return{tierId:(t.find(p=>(p.id??"")===c?.[0])??t[0]).id,wanted:c?.[1]??0}})(),a=Math.floor(s.wanted),l=a<=0?0:r.mode==="whole"?r.max:Math.max(r.min,Math.min(r.max,o,a));i.gaQty.delete(e.id),vi(i.gaQty,e.id,s.tierId,l<=o?l:0)}else if(typeof n=="number")vi(i.gaQty,e.id,t[0].id,Math.max(0,Math.min(o,Math.floor(n))));else{i.gaQty.delete(e.id);let s=o;for(let a of t){let l=Math.max(0,Math.floor(n[a.id??""]??0)),c=Math.min(l,s);s-=c,vi(i.gaQty,e.id,a.id,c)}}i.syncTray()}function Je(i,e=!0){let t=i.gaPromptReturnFocus;i.gaPromptEl&&eo(i.gaPromptEl),i.gaPromptEl=null,i.gaPromptReturnFocus=null,e&&t&&requestAnimationFrame(()=>(t.isConnected?t:i.root)?.focus())}function iu(i,e,t,n){let o=i.root,r=e.querySelector(".sl-ga-pop");if(!o||!r)return;if(!t){n&&o.contains(n)&&nu(o,r,n);return}let s=o.getBoundingClientRect(),a=t.x-s.left,l=t.y-s.top;e.style.setProperty("--sl-ga-anchor-x",`${a}px`),e.style.setProperty("--sl-ga-anchor-y",`${l}px`),requestAnimationFrame(()=>{let c=r.offsetWidth||260,d=r.offsetHeight||220,p=Math.max(8,Math.min(s.width-c-8,a-c/2)),u=l-d-14,h=u>=8?u:Math.min(s.height-d-8,l+14);r.style.left=`${p}px`,r.style.top=`${Math.max(8,h)}px`,r.dataset.side=u>=8?"above":"below",r.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(c-12,a-p))}px`)})}var yi=14;function nu(i,e,t){requestAnimationFrame(()=>{let n=i.getBoundingClientRect(),o=t.getBoundingClientRect(),r=e.offsetWidth||288,s=e.offsetHeight||220,a=o.left-n.left-yi-8,l=n.right-o.right-yi-8,c=a>=l?"left":"right";if(Math.max(a,l)<r){let h=o.left+o.width/2-n.left,b=o.top-n.top-s-yi,g=b>=8?b:Math.min(n.height-s-8,o.bottom-n.top+yi),T=Math.max(8,Math.min(n.width-r-8,h-r/2));e.style.left=`${T}px`,e.style.top=`${Math.max(8,g)}px`,e.dataset.side=b>=8?"above":"below",e.style.setProperty("--sl-ga-arrow-x",`${Math.max(12,Math.min(r-12,h-T))}px`);return}let d=o.top+o.height/2-n.top,p=Math.max(8,Math.min(n.height-s-8,d-s/2)),u=c==="left"?o.left-n.left-yi-r:o.right-n.left+yi;e.style.left=`${u}px`,e.style.top=`${p}px`,e.dataset.side=c,e.style.setProperty("--sl-ga-arrow-y",`${Math.max(16,Math.min(s-16,d-p))}px`)})}function cr(i,e){i.srEl&&(i.srEl.textContent=e)}function Za(i,e,t=[]){let n=[],o=Yh(t);for(let s of e){let a=i.gaQty.get(s.id);if(!a)continue;let l=pr(s);for(let c of l){let d=(a.get(c.id)??0)-(o.get(`${s.id}\0${c.id??""}`)??0);if(d<=0)continue;let p=i.paidPrice(s.categoryKey,c.id,c.price,s.id),u=wi(s);n.push(`<div class="sl-ga" data-ga="${ne(s.id)}" data-ga-row-tier="${ne(c.id??"")}"><div class="sl-ga-info"><div class="sl-ga-name">${ne(s.displayLabel??s.label)}</div><div class="sl-ga-sub">${ne(u?[l.length>1?c.label:"",(0,le.t)("picker.perGuestPrice",{price:i.money(p)})].filter(Boolean).join(" \xB7 "):`${l.length>1?c.label:s.displayType??i.tf("picker.generalAdmission","General admission")} \xB7 ${i.money(p)} \xB7 ${(0,le.tCount)("picker.leftCount",s.available)}`)}</div></div>`+(u?`<button type="button" class="sl-table-edit" data-ga-open="${ne(s.id)}">${ne((0,le.t)("picker.guestsCountEdit",{count:d}))}</button></div>`:`<div class="sl-ga-qty"><button type="button" data-d="-1" aria-label="${ne(i.tf("picker.fewer","Fewer"))}">\u2212</button><span>${d}</span><button type="button" data-d="1" aria-label="${ne(i.tf("picker.more","More"))}">+</button></div></div>`))}}let r=e.filter(s=>xi(i.gaQty,s.id)<=0&&!t.some(a=>a.objectId===s.id));return r.length&&n.push(`<div class="sl-ga-areas" data-ga-areas><button type="button" class="sl-ga-areas-toggle" data-ga-areas-toggle aria-expanded="${i.gaAreasExpanded}"><span>${ne(i.tf("picker.gaAreasHeading","Areas"))}</span><small>${r.length}</small></button>`+(i.gaAreasExpanded?`<div class="sl-ga-areas-list">${r.map(s=>`<button type="button" class="sl-ga-area-open" data-ga-open="${ne(s.id)}"${$t(i,s)<=0?" disabled":""}><span class="name">${ne(s.displayLabel??s.label)}<small>${ne(s.displayType??i.tf("picker.generalAdmission","General admission"))}</small></span><span class="meta">${ne($t(i,s)<=0?Ya(i,s):`${i.money(i.paidPrice(s.categoryKey,null,s.price,s.id))} \xB7 ${wi(s)?(0,le.t)("picker.capacityGuests",{count:wi(s).max}):(0,le.tCount)("picker.leftCount",$t(i,s))}`)}</span></button>`).join("")}</div>`:"")+"</div>"),n.join("")}function Ja(i,e,t){e.querySelectorAll(".sl-ga .sl-ga-qty button").forEach(n=>{n.addEventListener("click",()=>{let o=n.closest(".sl-ga");if(!o?.dataset.ga)return;let r=t.find(c=>c.id===o.dataset.ga);if(!r)return;let s=o.dataset.gaRowTier?o.dataset.gaRowTier:null,a=Number(n.dataset.d),l=i.gaQty.get(r.id)?.get(s)??0;if(a>0&&Wa(i,r)-xi(i.gaQty,r.id)<=0){i.toast((0,le.t)("picker.maxTicketsForOrder",{count:i.maxTickets}),"warning");return}vi(i.gaQty,r.id,s,Math.max(0,l+a)),i.syncTray()})}),e.querySelector("[data-ga-areas-toggle]")?.addEventListener("click",()=>{i.gaAreasExpanded=!i.gaAreasExpanded,i.syncTray()}),e.querySelectorAll("[data-ga-open]").forEach(n=>{n.addEventListener("click",()=>{let o=t.find(r=>r.id===n.dataset.gaOpen);o&&ur(i,o,null,n)})})}var io='<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 ou=/^[a-zA-Z0-9._-]+$/;function mr(i){let e;try{e=new URL(i,"https://seatlayer.invalid")}catch{return null}if(e.search||e.hash)return null;let t=/^\/pub\/events\/([^/]+)\/assets\/([^/]+)$/.exec(e.pathname);if(!t)return null;try{let n=decodeURIComponent(t[1]),o=decodeURIComponent(t[2]);return!n||!ou.test(o)?null:{eventKey:n,asset:o}}catch{return null}}function ru(i){try{return/^\/pub\/events\/[^/]+\/assets(?:\/|$)/.test(new URL(i,"https://seatlayer.invalid").pathname)}catch{return!1}}var ki=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=mr(e);if(!t)return Promise.resolve(ru(e)||!si(e)?null:e);if(t.eventKey!==this.eventKey||!this.load||this.disposed)return Promise.resolve(null);let n=this.pending.get(e);if(n)return n;let o=this.load(this.eventKey,t.asset).then(r=>{let s=URL.createObjectURL(r);return this.disposed?(URL.revokeObjectURL(s),null):(this.created.add(s),s)}).catch(r=>{throw this.pending.delete(e),r});return this.pending.set(e,o),o}dispose(){if(!this.disposed){this.disposed=!0;for(let e of this.created)URL.revokeObjectURL(e);this.created.clear(),this.pending.clear()}}};var zt=require("@seatlayer/core"),ao=require("@seatlayer/core/view3d/crossfade/panorama");var el=`
|
|
333
333
|
/* confirm card: a candidate is not in the tray until Select. Map gestures and
|
|
334
334
|
floating chrome pause while the card owns focus, keeping the camera stable. */
|
|
335
335
|
.sl-picker[data-confirming="true"] .sl-map-host>:not(.sl-confirm){pointer-events:none}
|
|
@@ -717,7 +717,7 @@ ${t}`}function La(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
|
|
|
717
717
|
color:var(--sl-text);font-weight:700;font-size:12px;display:flex;align-items:center;justify-content:center;gap:7px}
|
|
718
718
|
.sl-confirm-view:hover{border-color:var(--sl-muted)}
|
|
719
719
|
.sl-confirm-view svg{width:14px;height:14px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
|
|
720
|
-
`;var
|
|
720
|
+
`;var tl=`
|
|
721
721
|
/* Test mode is environment context, not an action. The chip flows in the
|
|
722
722
|
top-left anchor region: the old rotated corner ribbon sat at a negative
|
|
723
723
|
offset and was clipped by the widget root's rounded overflow:hidden (its
|
|
@@ -978,7 +978,7 @@ ${t}`}function La(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
|
|
|
978
978
|
.sl-pg-switch:hover{border-style:solid;color:var(--sl-text);border-color:var(--sl-accent)}
|
|
979
979
|
@media(prefers-reduced-motion:reduce){.sl-tip{animation:none!important}.sl-tip,.sl-tip-switch,.sl-pg-switch{transition:none!important}}
|
|
980
980
|
@media(max-width:639px){.sl-confirm-group-dates{width:min(340px,calc(100% - 20px))}.sl-confirm-date{min-height:32px}}
|
|
981
|
-
`;var
|
|
981
|
+
`;var il=`
|
|
982
982
|
/* \u2500\u2500 Selects \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
983
983
|
/* One chevron for every select the panel owns: same glyph, same weight, same
|
|
984
984
|
inset from the edge. The platform's own arrow is a different size, colour
|
|
@@ -1078,7 +1078,7 @@ ${t}`}function La(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
|
|
|
1078
1078
|
.sl-ba-qty button:active:not(:disabled),.sl-ga-qty button:active:not(:disabled),
|
|
1079
1079
|
.sl-picker .sl-ba-go:active:not(:disabled){transform:none}
|
|
1080
1080
|
}
|
|
1081
|
-
`;var
|
|
1081
|
+
`;var nl=`
|
|
1082
1082
|
/* 3D venue overlay \u2014 mounts over the (paused) Konva stage inside the map host.
|
|
1083
1083
|
Carries its own gradient so it paints instantly before the scene builds, and
|
|
1084
1084
|
cross-fades on enter/exit via a compositor-only opacity transition. Sits below
|
|
@@ -1463,7 +1463,7 @@ ${t}`}function La(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
|
|
|
1463
1463
|
.sl-view3d-passport-shell{padding:max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom))}
|
|
1464
1464
|
.sl-view3d-passport{width:100%;max-height:100%;padding:14px 14px max(24px,calc(14px + env(safe-area-inset-bottom)));border-radius:15px}
|
|
1465
1465
|
}
|
|
1466
|
-
`;var
|
|
1466
|
+
`;var ol=`
|
|
1467
1467
|
.sl-notes{display:flex;flex-direction:column;gap:0;margin:0}
|
|
1468
1468
|
/* No radius, no border, no inset: a band is the card's full width or it is a
|
|
1469
1469
|
plate again. The hairline lives on the JOIN, so the first band sits flush
|
|
@@ -1498,7 +1498,7 @@ ${t}`}function La(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
|
|
|
1498
1498
|
.sl-notes.compact .sl-note{padding:7px 12px 7px 15px}
|
|
1499
1499
|
.sl-notes.compact .sl-note-t b{font-size:11.5px;font-weight:750}
|
|
1500
1500
|
.sl-notes.compact .sl-note-n{font-size:10.5px}
|
|
1501
|
-
`;var
|
|
1501
|
+
`;var rl=`
|
|
1502
1502
|
/* The head is a bare 19.5px strip: the pill's upper half and nothing else. It
|
|
1503
1503
|
used to reserve 26px (6px of ground above a 20px pill) and the sheet drew a
|
|
1504
1504
|
border above that, so the chrome between the map and the cart was 33px of
|
|
@@ -1617,7 +1617,7 @@ ${t}`}function La(i){let{base:e,event:t,publicKey:n}=i;if(!e||!t||!n)return;let
|
|
|
1617
1617
|
above the line. The map now reaches the line, so the column keeps the same
|
|
1618
1618
|
clearance from the pill's top rather than dropping onto the hairline. */
|
|
1619
1619
|
.sl-picker[data-layout="narrow"] .sl-anchor[data-region="bottom-right"]{bottom:32px}
|
|
1620
|
-
`;var
|
|
1620
|
+
`;var sl=`
|
|
1621
1621
|
/* THE PHONE SHOWS THE DESKTOP CARD (owner call 2026-09-06: "cards should be
|
|
1622
1622
|
the same design as desktop"). What used to be here was a second rendering of
|
|
1623
1623
|
the cart \u2014 a bordered .sl-tlist box of 44px hairline-divided .sl-tline rows,
|
|
@@ -1825,13 +1825,13 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
1825
1825
|
.sl-picker .sl-fitpill.sl-fit-p2,.sl-picker .sl-fitpill.sl-fit-p3{font-size:11.5px}
|
|
1826
1826
|
.sl-picker .sl-fitpill.sl-fit-p3{white-space:normal;text-align:center;
|
|
1827
1827
|
padding-top:6px;padding-bottom:6px;line-height:1.2}
|
|
1828
|
-
`;function fr(i){return i?[...i.children].filter(e=>e instanceof HTMLElement&&e.offsetWidth>0&&e.offsetHeight>0):[]}function
|
|
1828
|
+
`;function fr(i){return i?[...i.children].filter(e=>e instanceof HTMLElement&&e.offsetWidth>0&&e.offsetHeight>0):[]}function al(i){return i.length?i.reduce((e,t)=>e+t.offsetWidth,0)+8*(i.length-1):0}function su({mapWidth:i,leftWidth:e,centerWidth:t,rightWidth:n}){if(i<=0)return!0;let o=n>0?n+8:0;if(o>i*.38)return!1;if(t<=0)return!0;let r=i/2,s=r-12-(e>0?Math.min(e,i*.38)+8:0),a=r-12-(o>0?o+8:0);return t/2<=Math.min(s,a)}function ll(i,e,t){if(!i)return;if(i.dataset.layout==="narrow"){delete i.dataset.topbar;return}let n=fr(t["top-right"]),o={mapWidth:e.clientWidth,leftWidth:al(fr(t["top-left"])),centerWidth:Math.max(0,...fr(t["top-center"]).filter(s=>s.classList.contains("sl-rungs")).map(s=>s.offsetWidth)),rightWidth:al(n)};!su(o)?i.dataset.topbar="stacked":delete i.dataset.topbar,e.style.setProperty("--sl-topright-w",`${Math.ceil(o.rightWidth+8)}px`)}var cl=`
|
|
1829
1829
|
.sl-picker[data-layout="wide"][data-topbar="stacked"] .sl-anchor[data-region="top-right"]{flex-wrap:nowrap;max-width:none}
|
|
1830
1830
|
.sl-picker[data-layout="wide"][data-topbar="stacked"] .sl-anchor[data-region="top-left"]{
|
|
1831
1831
|
max-width:calc(100% - 32px - var(--sl-topright-w,160px))}
|
|
1832
1832
|
.sl-picker[data-layout="wide"][data-topbar="stacked"] .sl-anchor[data-region="top-center"]{
|
|
1833
1833
|
top:64px;max-width:calc(100% - 24px)}
|
|
1834
|
-
`;var
|
|
1834
|
+
`;var dl="seatlayer-picker-style",au=`
|
|
1835
1835
|
.sl-picker{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-height:420px;overflow:hidden;
|
|
1836
1836
|
background:var(--sl-bg);color:var(--sl-text);font-family:var(--sl-font);border-radius:var(--sl-radius);
|
|
1837
1837
|
/* iOS INFLATES FIXED-PX TYPE IN A HOST LAYOUT IT DECIDES IS TOO NARROW, and
|
|
@@ -2938,8 +2938,12 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
2938
2938
|
/* One control size on phones \u2014 match the 36px round rhythm the rest of the
|
|
2939
2939
|
zoom column uses, but keep width for the language name to be readable. */
|
|
2940
2940
|
.sl-picker[data-layout="narrow"] .sl-langsel{height:36px;max-width:112px;font-size:11.5px}
|
|
2941
|
-
.sl-picker[data-layout="narrow"] .sl-
|
|
2942
|
-
.sl-picker[data-layout="narrow"] .sl-
|
|
2941
|
+
.sl-picker[data-layout="narrow"] .sl-level{justify-content:center;min-width:44px;min-height:44px;padding:0 8px}
|
|
2942
|
+
.sl-picker[data-layout="narrow"] .sl-level-name{display:none}
|
|
2943
|
+
.sl-picker[data-layout="narrow"] .sl-level[data-level=""] .sl-level-short{display:inline}
|
|
2944
|
+
/* Rule 6: at the whole-venue view the mini-map would only repeat the map. */
|
|
2945
|
+
.sl-picker:not([data-layout="narrow"])[data-minimap-idle] .sl-minimap{visibility:hidden;opacity:0}
|
|
2946
|
+
.sl-minimap{transition:opacity .2s ease,visibility .2s}
|
|
2943
2947
|
|
|
2944
2948
|
/* toast + boot states (toast flows in the bottom-center region) */
|
|
2945
2949
|
/* A toast is a SENTENCE, not a chip. It used to be a nowrap line with
|
|
@@ -3251,20 +3255,24 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
3251
3255
|
.sl-picker[data-layout="narrow"] .sl-projection button{min-width:38px;min-height:28px;padding:4px 8px;font-size:9.5px}
|
|
3252
3256
|
|
|
3253
3257
|
|
|
3254
|
-
/*
|
|
3255
|
-
.
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
+
/* The level stack (board: Buyer map levels, rule 1): lift buttons above the
|
|
3259
|
+
zoom column, top level first, All levels last. Code + name on a wide map,
|
|
3260
|
+
code only on a phone. The pressed level is the accent. */
|
|
3261
|
+
.sl-floors{display:none;flex-direction:column;align-items:stretch;gap:2px;padding:4px;border-radius:14px;
|
|
3262
|
+
background:color-mix(in srgb,var(--sl-surface) 94%,transparent);border:1px solid var(--sl-line);
|
|
3258
3263
|
box-shadow:var(--sl-shadow);backdrop-filter:blur(8px)}
|
|
3259
3264
|
.sl-floors.on{display:flex}
|
|
3260
|
-
.sl-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
.sl-
|
|
3265
|
+
.sl-level{all:unset;box-sizing:border-box;display:flex;align-items:center;gap:7px;min-height:32px;max-width:168px;
|
|
3266
|
+
padding:5px 10px;border-radius:10px;color:var(--sl-text-2,var(--sl-text));font:600 12px/1.1 inherit;cursor:pointer;
|
|
3267
|
+
transition:background-color .15s ease,color .15s ease}
|
|
3268
|
+
.sl-level:hover{background:color-mix(in srgb,var(--sl-text) 8%,transparent);color:var(--sl-text)}
|
|
3269
|
+
.sl-level:focus-visible{outline:2px solid var(--sl-accent);outline-offset:1px}
|
|
3270
|
+
.sl-level-code{flex:none;min-width:12px;text-align:center;color:var(--sl-text);font-weight:800}
|
|
3271
|
+
.sl-level-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
3272
|
+
.sl-level-short{display:none}
|
|
3273
|
+
.sl-level[aria-pressed="true"]{background:var(--sl-accent);color:var(--sl-accent-ink,#111)}
|
|
3274
|
+
.sl-level[aria-pressed="true"] .sl-level-code{color:inherit}
|
|
3275
|
+
.sl-level[data-level=""]{justify-content:center;margin-top:2px}
|
|
3268
3276
|
|
|
3269
3277
|
/* tapped-section summary card \u2014 docks INSIDE the top-center anchor region on
|
|
3270
3278
|
wide (flows below the rung pills, never over them, never floating over the
|
|
@@ -3529,7 +3537,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
3529
3537
|
Paint twelve pixels of the frame ground below its box to cover that seam;
|
|
3530
3538
|
this does not enlarge the picker or move its checkout controls. */
|
|
3531
3539
|
@media(max-width:640px){.sl-modal-scrim{padding:0}.sl-modal-frame{width:100%;height:100%;border-radius:0;box-shadow:0 12px 0 var(--sl-bg)}}
|
|
3532
|
-
`;function Si(){if(document.getElementById(ol))return;let i=document.createElement("style");i.id=ol,i.textContent=Wh+Ja+Za+Wa+el+Xa+Qa+nl+Ya+Ha,document.head.appendChild(i)}async function io(i,e){let t=i.overlay.productionElements;if(!t?.some(o=>o.contentImageUrl))return i;let n=await Promise.all(t.map(async o=>{if(!o.contentImageUrl)return o;try{let r=await e(o.contentImageUrl);if(!r){let{contentImageUrl:s,...a}=o;return a}return{...o,runtimeContentImageUrl:r}}catch{let{contentImageUrl:r,...s}=o;return s}}));return{...i,overlay:{...i.overlay,productionElements:n}}}async function no(i,e){if(i)try{let t=await e(i);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}var xt=require("@seatlayer/core/view/panoramaDelivery");function oo(i){let{root:e,source:t,caption:n,real:o,closeLabel:r,dragHint:s,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:d,onClose:p}=i,u=i.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 b=k=>h.querySelector(k)?.remove();u.title===!1?b(".sl-view-title"):h.querySelector(".sl-view-title").textContent=a,u.caption===!1?b(".sl-view-cap"):h.querySelector(".sl-view-cap").textContent=n,h.querySelector(".sl-view-x").setAttribute("aria-label",r),u.badge===!1?b(".sl-view-badge"):h.querySelector(".sl-view-badge").textContent=o?l:c,h.querySelector(".sl-view-hint").textContent=s,e.appendChild(h);let g=h.querySelector(".sl-view-pano"),T=(0,xt.planPanoramaDelivery)(t,(0,xt.browserPanoramaConstraints)()),w=new AbortController;g.style.backgroundImage=`url(${JSON.stringify(T.initialUrl)})`;let v=()=>{};T.upgradeUrl&&(v=(0,xt.schedulePanoramaUpgrade)(()=>{d(T.upgradeUrl).then(k=>!k||w.signal.aborted?null:(0,xt.loadPanoramaImage)(k,w.signal).then(()=>k)).then(k=>{!k||!h.isConnected||w.signal.aborted||(g.style.backgroundImage=`url(${JSON.stringify(k)})`)}).catch(()=>{})}));let M=70,B=35,X=1,f=g.clientHeight||1,O=g.clientWidth||1,K=-(f*(180/M)*2/2-O/2),_=0,j=()=>{let k=g.clientHeight||1,A=k*(180/M)*X,D=Math.max(0,A-k),Q=Math.min(D/2,B/180*A);_=Math.min(Q,Math.max(-Q,_)),g.style.backgroundSize=`auto ${A}px`,g.style.backgroundPosition=`${K}px ${_-D/2}px`};j();let P=!1,$=0,J=0,W=k=>{P=!0,$=k.clientX,J=k.clientY,g.classList.add("drag"),g.setPointerCapture?.(k.pointerId)},oe=k=>{P&&(K+=k.clientX-$,_+=k.clientY-J,$=k.clientX,J=k.clientY,j())},Ee=k=>{P=!1,g.classList.remove("drag"),g.releasePointerCapture?.(k.pointerId)},xe=k=>{k.preventDefault(),X=Math.min(2.4,Math.max(1,X+(k.deltaY<0?.12:-.12))),j()};g.addEventListener("pointerdown",W),g.addEventListener("pointermove",oe),g.addEventListener("pointerup",Ee),g.addEventListener("pointercancel",Ee),g.addEventListener("wheel",xe,{passive:!1});let Ce=h.querySelector(".sl-view-x");Ce.addEventListener("click",p);let $e=k=>{k.key==="Escape"&&(k.stopPropagation(),p())};return h.addEventListener("keydown",$e),Ce.focus(),{element:h,dispose(){v(),w.abort(),g.removeEventListener("pointerdown",W),g.removeEventListener("pointermove",oe),g.removeEventListener("pointerup",Ee),g.removeEventListener("pointercancel",Ee),g.removeEventListener("wheel",xe),h.removeEventListener("keydown",$e),Ce.removeEventListener("click",p)}}}function Yh(i,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=i.find(r=>r.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let n=i.filter(r=>r.rowId===t.rowId),o=n.findIndex(r=>r.id===e);return{targetSeatId:e,previousSeatId:o>0?n[o-1].id:null,nextSeatId:o>=0&&o+1<n.length?n[o+1].id:null}}var rl=6e4,ro=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.focusedSectionId_=null;this.navigationMode_="auto";this.overlay=null;this.handle=null;this.generation=0;this.seatViewGeneration=0;this.seatViewElement=null;this.seatViewDispose=null;this.navigationPinned_=!1;this.options=e}get buyerView(){return this.buyerView_}get targetSeatId(){return this.targetSeatId_}get focusedSectionId(){return this.focusedSectionId_}get seatPosition(){return Yh(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_==="auto"?"orbit":this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!Cn()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),n=this.options.host(),o=this.options.doc();if(!t||!n||!o)throw new Error("seat_view_unavailable");let r=++this.seatViewGeneration,s,a,l=!1;if(t.viewUrl){let b=t.viewMeta?.previewUrl,g=!!b&&b!==t.viewUrl,T=g?await this.options.resolveAsset(b):null,w=g?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(r!==this.seatViewGeneration||!w||g&&!T)return;s={url:w,...T?{previewUrl:T}:{},...g?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}},a=(0,so.seatViewDisclosure)(s),l=(0,so.isAuthoredSeatView)(s)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:b}=await Pn();if(r!==this.seatViewGeneration)return;let g=o.floors?.find(v=>v.objects.some(M=>M.type==="row"&&M.id===t.rowId)),T=t.focalPoint??g?.focalPoint??o.focalPoint,w=b(t,T,[...this.options.seats()]);s={url:w.url,generated:!0},a=(0,$t.t)("picker.illustrationCaption",{m:w.distanceM})}if(r!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(n,o),Si();let c=this.options.chrome??{},d=Nt(),p=(0,$t.t)("picker.viewFromSeat",{label:t.displayLabel||t.label}),u=l?(0,$t.t)("picker.real360"):(0,$t.t)("picker.preview"),h=oo({root:n,source:s,caption:a,real:l,closeLabel:y("picker.close","Close"),dragHint:d,viewFromSeatLabel:p,real360Label:(0,$t.t)("picker.real360"),previewLabel:(0,$t.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:!!s.generated,dragHint:d})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let n=t.floors.findIndex(o=>o.id===e);return n>=0&&this.handle.focusFloor(n)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}applyNavigationMode(e){this.navigationMode_==="auto"&&!this.navigationPinned_||e.setNavigationMode(this.navigationMode_)}setNavigationMode(e){return e!=="auto"&&(this.navigationPinned_=!0),this.navigationMode_=e,this.buyerView_!=="venue3d"||!this.handle?!1:(this.applyNavigationMode(this.handle),this.options.onViewChange(this.buyerView_,this.targetSeatId_),!0)}destroy(){this.generation+=1,this.closeSeatView(!0,!1);try{this.handle?.dispose()}catch{}this.handle=null,this.overlay?.remove(),this.overlay=null,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null}max3DSeats(){let e=this.options.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?rl/2:rl}async enter3D(e){let t=this.options.host(),n=this.options.doc();if(!t||!n||this.overlay)throw new Error("venue_3d_unavailable");Si(),this.prepareHostTheme(t,n);let o=document.createElement("div");o.className="sl-view3d",o.setAttribute("role","group"),o.setAttribute("aria-label",y("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(o.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let r=document.createElement("div");r.className="sl-view3d-loading",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.textContent=y("picker.loading3d","Building the 3D venue\u2026"),o.appendChild(r),t.appendChild(o),this.overlay=o;let s=++this.generation;if(this.reducedMotion()?o.style.opacity="1":requestAnimationFrame(()=>{o.style.opacity="1"}),await this.nextPaint(),!(s!==this.generation||this.overlay!==o))try{let[a,l]=await Promise.all([Yi(),this.options.loadEventConfiguration()]),c=l?await io(l,this.options.resolveAsset):null,d=await no(n.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(s!==this.generation||this.overlay!==o)return;let p={doc:n,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};r.textContent=y("picker.building3d","Building venue geometry\u2026");let u=await a.prepareVenue3D(p);if(s!==this.generation||this.overlay!==o)return;let h=this.options.chrome??{},b=a.mountVenue3D(o,{...p,prepared:u},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:Nt(),navLabels:En(),...h.view3dCaption===!1||h.view3dSeatStepper===!1||h.view3dControlDock===!1?{chrome:{caption:h.view3dCaption!==!1,seatStepper:h.view3dSeatStepper!==!1,controlDock:h.view3dControlDock!==!1}}:{},seatViewActionLabel:g=>this.findSeat(g)?.viewUrl?y("picker.openAuthored360","Open venue 360\xB0"):y("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:g=>this.toggleSeat(g),onSeatInspect:g=>this.toggleSeat(g),onViewTargetChange:g=>{this.targetSeatId_=g,g&&(this.focusedSectionId_=this.findSeat(g)?.sectionId??null),this.options.onViewChange("venue3d",g)},onSectionFocusChange:g=>{this.focusedSectionId_=g,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:g=>this.seatViewFor3D(g)}:{}});if(s!==this.generation||this.overlay!==o){b.dispose();return}this.handle=b,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,this.applyNavigationMode(b),requestAnimationFrame(()=>r.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await b.flyToSeat(e)}catch(a){if(s!==this.generation)return;throw this.options.onError?.(a),this.remove3DOverlay(!1),a}}exit3D(){this.buyerView_==="map"&&!this.overlay||(this.generation+=1,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null,this.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let n=this.handle,o=this.overlay;if(this.options.restoreMap(),t&&n&&o){o.style.pointerEvents="none";let r=()=>{this.buyerView_!=="map"||this.overlay!==o||(o.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(o.style.opacity="0",r()):(requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(r,280));return}if(this.handle=null,this.overlay=null,!o){try{n?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{n?.dispose()}catch{}o.remove(),this.options.restoreMap();return}o.style.pointerEvents="none",requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(()=>{try{n?.dispose()}catch{}o.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,n=this.handle;if(!t||!n)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),n.resize(),this.applyNavigationMode(n),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await n.flyToSeat(e.flyToSeatId):e.resetView&&n.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(o=>o.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let n=t.viewMeta?.previewUrl,o=!!n&&n!==t.viewUrl,r=o?await this.options.resolveAsset(n):null,s=o?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!s||o&&!r)throw new Error("seat_view_unavailable");return{url:s,...r?{previewUrl:r}:{},...o?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:y("picker.chartDerivedModel","Chart-derived model")}}closeSeatView(e=!0,t=!1){e&&(this.seatViewGeneration+=1);let n=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!n){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){n.remove();return}n.classList.add("is-leaving"),setTimeout(()=>n.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(n=>n.objects)??e.objects).some(n=>n.type==="shape"&&(n.role==="stage"||!!n.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let n=t.theme;e.style.setProperty("--sl-bg",n?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",n?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",n?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",n?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};function jt(i,e,t,n){let o=e?i?.[e]:void 0;return o===void 0?n:typeof o=="number"?o:t&&o.tiers?.[t]!==void 0?o.tiers[t]:o.base??n}function ao(i){if(!i)return null;let e=i.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function Xh(i){return ao(i.foot?.querySelector(".sl-total"))??ao(i.tray)??ao(i.sheetHead)}function br(i,e,t,n,o){let r=i,s=r.map;if(!s||!e){o?.();return}let a=s.getBoundingClientRect(),l={x:a.left+e.x,y:a.top+e.y},c=t.displayLabel??t.label,d=n?.find(u=>u.key===t.categoryKey)?.color,p=()=>{let u=Xh(r);if(!u){o?.();return}_a({from:l,to:{x:u.left+u.width/2,y:u.top+u.height/2},label:c,color:d,onArrive:o})};r.sheetHead&&ao(r.sheetHead)?requestAnimationFrame(p):p()}var gr=60,Qh=650;function sl(i,e){if(!e.length||i.focusSeats?.(e.map(o=>o.id)))return;let t=e.find(o=>o.sectionId)?.sectionId;if(!t)return;let n=e.filter(o=>o.sectionId===t);i.focus(t,{x:n.reduce((o,r)=>o+r.x,0)/n.length,y:n.reduce((o,r)=>o+r.y,0)/n.length})}function al(i,e){let t=!Qn();sl({focusSeats:n=>i.focusSeats?.(n,{animate:t})===!0,focus:(n,o)=>i.focusSection(n,o)},(e?.items??[]).filter(n=>n.objectType!=="ga").slice(0,10).map(n=>i.seatByLabel(n.label)).filter(n=>!!n))}function ll(i,e){if(!e.length)return;let t=i.reducedMotion===!0;t||e.forEach((s,a)=>{i.schedule(()=>i.pop(s.id),a*gr)});let n=t?0:e.length*gr,o=e.find(s=>s.sectionId)?.sectionId;if(i.schedule(()=>sl(i,e),n),t)return;let r=n+(i.focusSeats||o?Qh:0);e.forEach((s,a)=>{i.schedule(()=>br(i.regions,i.screenPoint(s),s,i.categories),r+a*gr)})}function Zh(i,e,t){for(let n of i)if(e>=n.x&&t>=n.y&&e<=n.x+n.w&&t<=n.y+n.h)return!0;return!1}var lo=class{constructor(){this.rects=[];this.host=null;this.pointers=new Set;this.touches=new Set;this.mouseDown=!1;this.onPointerDown=e=>{this.inside(e.clientX,e.clientY)&&(this.pointers.add(e.pointerId),this.swallow(e))};this.onPointerFollow=e=>{this.pointers.has(e.pointerId)&&this.swallow(e)};this.onPointerEnd=e=>{this.pointers.delete(e.pointerId)&&this.swallow(e)};this.onTouchStart=e=>{let t=this.changed(e);if(!t.length)return;let n=!0;for(let o of t)this.inside(o.clientX,o.clientY)?this.touches.add(o.identifier):n=!1;n&&this.swallow(e)};this.onTouchFollow=e=>{let t=this.changed(e);t.length&&t.every(n=>this.touches.has(n.identifier))&&this.swallow(e)};this.onTouchEnd=e=>{let t=this.changed(e);if(!t.length)return;let n=t.every(o=>this.touches.has(o.identifier));for(let o of t)this.touches.delete(o.identifier);n&&this.swallow(e)};this.onMouseDown=e=>{this.inside(e.clientX,e.clientY)&&(this.mouseDown=!0,this.swallow(e))};this.onMouseFollow=e=>{this.mouseDown&&this.swallow(e)};this.onMouseUp=e=>{this.mouseDown&&(this.mouseDown=!1,this.swallow(e))};this.onClick=e=>{this.inside(e.clientX,e.clientY)&&this.swallow(e)}}set(e){this.rects=e.map(t=>({x:t.x,y:t.y,w:t.w,h:t.h})),this.rects.length||(this.pointers.clear(),this.touches.clear(),this.mouseDown=!1)}get(){return this.rects}attach(e){if(this.host===e)return;this.detach(),this.host=e;let t={capture:!0,passive:!1};e.addEventListener("pointerdown",this.onPointerDown,t),e.addEventListener("pointermove",this.onPointerFollow,t),e.addEventListener("pointerup",this.onPointerEnd,t),e.addEventListener("pointercancel",this.onPointerEnd,t),e.addEventListener("touchstart",this.onTouchStart,t),e.addEventListener("touchmove",this.onTouchFollow,t),e.addEventListener("touchend",this.onTouchEnd,t),e.addEventListener("touchcancel",this.onTouchEnd,t),e.addEventListener("mousedown",this.onMouseDown,t),e.addEventListener("mousemove",this.onMouseFollow,t),e.addEventListener("mouseup",this.onMouseUp,t),e.addEventListener("click",this.onClick,t),e.addEventListener("dblclick",this.onClick,t)}detach(){let e=this.host;if(!e)return;let t={capture:!0};e.removeEventListener("pointerdown",this.onPointerDown,t),e.removeEventListener("pointermove",this.onPointerFollow,t),e.removeEventListener("pointerup",this.onPointerEnd,t),e.removeEventListener("pointercancel",this.onPointerEnd,t),e.removeEventListener("touchstart",this.onTouchStart,t),e.removeEventListener("touchmove",this.onTouchFollow,t),e.removeEventListener("touchend",this.onTouchEnd,t),e.removeEventListener("touchcancel",this.onTouchEnd,t),e.removeEventListener("mousedown",this.onMouseDown,t),e.removeEventListener("mousemove",this.onMouseFollow,t),e.removeEventListener("mouseup",this.onMouseUp,t),e.removeEventListener("click",this.onClick,t),e.removeEventListener("dblclick",this.onClick,t),this.host=null,this.pointers.clear(),this.touches.clear(),this.mouseDown=!1}inside(e,t){if(!this.rects.length||!this.host)return!1;let n=this.host.getBoundingClientRect();return Zh(this.rects,e-n.left,t-n.top)}swallow(e){e.stopImmediatePropagation(),e.stopPropagation(),e.cancelable&&e.preventDefault()}changed(e){let t=e.changedTouches;return t?Array.from(t):[]}},cl=.48,Jh=8;function eu(i,e,t,n=cl){let o=Math.max(0,t.top),r=e.height-Math.max(0,t.bottom);if(!(r>o))return 0;let s=Number.isFinite(n)?Math.min(1,Math.max(0,n)):cl,a=o+(r-o)*s-i;return Math.abs(a)<=Jh?0:Math.round(a)}function dl(i,e,t={}){let n=i.gestureCount();if(t.gestures!==void 0&&t.gestures!==n)return{dy:0,gestures:n};let o=i.seatPoint(e);if(!o)return{dy:0,gestures:n};let r=eu(o.y,{height:i.mapHeight()},i.insets(),t.fraction);return r?{dy:i.panScreenBy({x:0,y:r},t.animate!==!1)?r:0,gestures:n}:{dy:0,gestures:n}}var nn=class i{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let n=t!==void 0&&"mapTheme"in t;e===this.mode&&!n||(n&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return di(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??i.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=Fn(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};var hl=require("@seatlayer/core"),ul=require("@seatlayer/core/core/seatConfidence");var pl=require("@seatlayer/core");function Ti(i){let e=i.viewMeta?.previewUrl??i.viewUrl;return e&&(mr(e)||si(e))?e:null}function po(i){if(!i)return!1;let e=i.floors?.length?i.floors.map(t=>t.objects??[]):[i.objects??[]];for(let t of e)for(let n of t)if(n.type==="shape"&&(n.role==="stage"||n.stageKind))return!0;return!1}var tu=512,co=new Map;function ho(i,e){if(!e)return null;let t=`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`,n=co.get(t);if(n!==void 0)return n;let o=null;try{o=(0,pl.generateSeatThumb)(i,e).distanceM??null}catch{o=null}return co.size>=tu&&co.clear(),co.set(t,o),o}function on(i){return i.getFocusedSection()!==null||i.seatsRevealed()}function iu(i){let e=i.atVenueFit?.(),t=i.canZoomIn?.();return{...typeof e=="boolean"?{atVenueFit:e}:{},...typeof t=="boolean"?{canZoomIn:t}:{}}}function nu(i,e){return{accessibilityFilter:i.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function ou(i,e,t,n){for(let o of e){if(o.count<=0)continue;let r=i.accessibilitySpread?.([o.key]);for(let s of r?.sections??[]){let a=t.get(s.id)??n.get(s.id);if(!a||s.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[o.key]=s.free}}}function ml(i,e,t){let n=i.doc,o=n?.theme??{},r=i.categoryAvailability(),s=i.getGAAreas(),a=i.getFloors(),l=i.getExpandedSeats(),c=i.getAccessNeeds(),d=nu(c,l),p=e.seatPosition,u=p.targetSeatId?i.seatDetails(p.targetSeatId):null,h=new Map(l.map(v=>[v.id,v])),b=po(n),g=n?.floors?.flatMap(v=>v.objects)??n?.objects??[],T=new Map,w=new Map;for(let v of g){if(v.type!=="section")continue;let M={id:v.id,label:v.label,...v.displayLabel?{displayLabel:v.displayLabel}:{},...v.zone?{zoneId:v.zone}:{}};T.set(v.id,M);let B=v.logicalSectionId??v.id;w.has(B)||w.set(B,M)}return ou(i,c,T,w),{event:{key:t.event,name:t.eventInfo?.name??n?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:(0,hl.getLocale)()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...o.accent?{accent:o.accent}:{},...o.accentInk?{accentInk:o.accentInk}:{},...o.background?{background:o.background}:{},...o.textColor?{textColor:o.textColor}:{},...o.brandName?{brandName:o.brandName}:{},...o.logoUrl?{logoUrl:o.logoUrl}:{},attributionRequired:!o.hideBadge},features:{ga:s.length>0,tiers:!!n?.categories.some(v=>v.tiers?.length),floors:a.length>1,zones:!!n?.zones?.length,sections:T.size>0,bestAvailable:!0,...d,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(n?.categories??[]).filter(v=>!v.notForSale).map(v=>({key:v.key,label:v.label,color:v.color,price:jt(t.hostPrices_,v.key,null,v.price??v.tiers?.[0]?.price??0),available:r[v.key]??0,...Object.prototype.hasOwnProperty.call(r,v.key)?{free:r[v.key]}:{},tiers:(v.tiers??[]).map(M=>({id:M.id,name:M.name,price:jt(t.hostPrices_,v.key,M.id,M.price),...M.currency?{currency:M.currency}:{}}))})),zones:(n?.zones??[]).map(v=>({id:v.id,label:v.label,...v.color?{color:v.color}:{}})),sections:[...T.values()],gaAreas:s,bestAvailableZones:i.getBestAvailableZones()},map:{floors:a,activeFloorId:i.getActiveFloorId()||a[0]?.id||null,floorMode:i.isFloorOverview()?"all":"single",floorLabelStyle:i.getRenderer()?.getFloorLabelStyle?.()??"number",rung:i.getRung(),canZoomOut:on(i)||t.focusedSection_!==null,...iu(i),focusedSectionId:i.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:i.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:i.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:i.getSelection().map(v=>{let M=t.hostPrices_?{...v,price:jt(t.hostPrices_,v.categoryKey,v.tierId,v.price)}:v,B=h.get(M.id);if(!B)return M;let X=i.worldToScreen({x:B.x,y:B.y}),f=Ti(B),O=b?ho(B,B.focalPoint??n?.focalPoint):null;return{...M,screenPoint:{x:X.x,y:X.y},...f?{seatViewThumb:{reference:f,kind:"real"}}:{},...O!=null?{sightlineMetres:O}:{},...B.confidenceEvidence?{seatViewConfidence:(0,ul.seatConfidenceDisclosure)(B.confidenceEvidence)}:{}}}),validity:i.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var ru="https://api.seatlayer.io",fl=10;function su(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}var uo=class{constructor(e){this.renderErrorEmitted=!1;this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=null;this.localeGeneration=0;this.languageSelect=null;this.rendered=!1;this.mode_=null;this.eventInfo=null;this.categoryFilter_=null;this.accessibilityFilter_=null;this.hideLimitedView_=!1;this.focusedSection_=null;this.lastReportedViewRung_=null;this.lastReportedCanZoomOut_=!1;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.blockedRegions=null;this.realtime=null;this.holdingLabels=new Set;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.container)throw new Error("seatmap: `container` is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");this.opts=e,this.maxSelection_=e.maxSelection??fl,this.colorblindSafe_=e.colorblindSafe??!1,this.hostPrices_=e.pricing?.prices;let t=!!(e.buyerAccessTokenProvider||e.buyerAccessToken||e.publicKey);this.accessState_={configured:t,status:t?"ready":"public"},this.publicKey=e.publicKey;let n={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},o=(e.apiBase??ru).replace(/\/+$/,"");this.apiBase=o;let r=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Xn({base:o,event:e.event,publicKey:e.publicKey,accessHooks:n,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=r?.access??gi(e,n);let s=r?.api??new ft(o,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=s,this.chartFetch=Un(s),this.controller=new ae.PickerController({transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxSelection_,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.hostPriceRanges(),onSelectionChange:a=>{this.immersive?.pushLiveState(),this.opts.onSelectionChange?.(a)},onSelectionValidityChange:a=>this.opts.onSelectionValidityChange?.(a),onSelectionValid:a=>this.opts.onSelectionValid?.(a),onSelectionInvalid:a=>this.opts.onSelectionInvalid?.(a),onDeselect:a=>{this.controller.currentHold()?.labels.includes(a.label)&&this.controller.releaseLabels([a.label])},retapKeepsSelection:!0,onSeatRetap:a=>this.opts.onSeatRetap?.(a),onSelectionLimit:a=>this.opts.onSelectionLimit?.(a),onHold:a=>this.opts.onHold?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldRestored:a=>this.opts.onHoldRestored?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:a=>{let l=this.controller.getGAAreas().find(c=>c.id===a);l&&(this.opts.onGAClick?.(l),this.opts.onGAPrompt?.(Ga(l,{room:(this.opts.maxSelection??fl)-this.controller.getSelection().length,wheelchairOnly:this.controller.getAccessibilityFilter()?.includes("wheelchair")===!0,hold:(c,d)=>{this.holdGA(l.id,c,d?{tierId:d}:{})}})))},onError:a=>{this.renderErrorEmitted=!0,this.opts.onError?.(a)},onDeckTap:a=>{this.opts.onDeckTap?.(a),this.notifyMapStateChange()},onHint:a=>this.opts.onHint?.(a),onSectionFocus:a=>{this.focusedSection_=a,this.opts.onSectionFocus?.(a),this.notifyMapStateChange()},onViewChange:()=>this.handleViewChange(),onStatusChange:()=>{this.immersive?.pushLiveState(),this.opts.onStatusChange?.()},onSalesClosed:()=>{this.eventInfo&&(this.eventInfo.salesClosed=!0),this.opts.onSalesClosed?.()},flashOnLiveChange:!0,onSeatHover:a=>{this.opts.onSeatHover?.(a),this.opts.seatTooltip!==!1&&this.updateTooltip(a)},colorblindSafe:e.colorblindSafe,mapTheme:e.mapTheme??nn.groundFor(e.theme?.mode)??null}),this.hostSurface=new nn({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 ki(e.event,(a,l)=>s.asset(a,l)),this.immersive=new ro({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_=on(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=on(this.controller);e===this.lastReportedViewRung_&&t===this.lastReportedCanZoomOut_||(this.lastReportedViewRung_=e,this.lastReportedCanZoomOut_=t,this.opts.onMapStateChange?.())}notifyMapStateChange(){this.lastReportedViewRung_=this.controller.getRung(),this.lastReportedCanZoomOut_=on(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=Vn(this.opts.locale,this.opts.messages),n=this.localeGeneration+=1,o=(0,ae.getLocale)();this.mount=su(this.opts.container);let r=document.createElement("div");r.style.width="100%",r.style.height="100%",r.style.position="relative",this.mount.appendChild(r),this.hostEl=r,this.blockedRegions?.attach(r),zn(r,t,a=>{a!==o&&this.applyActiveLocale(a,n)}),this.applyInteractionState(),this.renderErrorEmitted=!1;let s=await this.controller.render(r);if(!s){let a=qn(this.chartFetch?.outcome(),this.renderErrorEmitted);return a&&Wn({apiBase:this.apiBase,eventKey:this.opts.event,reason:a}),Ze({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:st(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(r),this}if(this.eventLocale=s.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(r),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=s.mode==="test"?"test":"live",this.eventInfo={name:s.eventName,venue:s.venue??null,startsAt:s.startsAt??null,timezone:s.timezone??null,currency:s.currency??this.opts.currency??"USD",posterUrl:s.posterUrl??null,salesClosed:s.salesClosed},this.opts.seatTooltip!==!1){let 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);',r.appendChild(a),this.tipEl=a,this.onTipMove=l=>{let c=r.getBoundingClientRect();this.tipPos={x:l.clientX-c.left,y:l.clientY-c.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},r.addEventListener("mousemove",this.onTipMove)}if(s.mode==="test"&&this.opts.showTestModeIndicator!==!1){r.style.overflow="hidden";let a=document.createElement("div");a.dataset.slI18n="testMode",a.textContent=(0,ae.t)("picker.testMode"),a.setAttribute("aria-label",(0,ae.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;",r.appendChild(a)}return this.buildBadge(r),Ze({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:s.performanceProfile,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:Kn(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,ae.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 n=document.createElement("span");n.setAttribute("aria-hidden","true"),n.style.cssText="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee",n.innerHTML=to;let o=document.createElement("span");o.textContent=(0,ae.t)("picker.poweredBy"),t.append(n,o),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,n=this.tipEl.offsetHeight,o=this.tipPos.x+14,r=this.tipPos.y-n-12;o+t>e-8&&(o=this.tipPos.x-t-14),r<8&&(r=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,o)}px`,this.tipEl.style.top=`${Math.max(8,r)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=(0,ae.formatMoney)(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),n=document.createElement("div");n.style.cssText="font-weight:700;font-size:13px",n.textContent=e.label;let o=document.createElement("div");o.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let r=document.createElement("span");r.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",r.style.background=e.categoryColor;let s=document.createElement("span");s.textContent=e.categoryLabel;let a=document.createElement("span");if(a.style.cssText="margin-left:auto;font-weight:700;color:#fff",a.textContent=t,o.append(r,s,a),this.tipEl.replaceChildren(n,o),e.status!=="free"){let l=document.createElement("div");l.style.cssText="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700",l.textContent=e.status==="held"?(0,ae.t)("map.statusHeld"):(0,ae.t)("map.statusTaken"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(o=>(0,ae.resolveLocale)(o)).filter((o,r,s)=>s.indexOf(o)===r);if(t.length<2)return;let n=document.createElement("select");n.setAttribute("aria-label",(0,ae.t)("picker.preferredTicketType")),n.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let o of t){let r=document.createElement("option");r.value=o,r.textContent=ae.LOCALE_NAMES[o]??o,r.selected=o===(0,ae.getLocale)(),n.appendChild(r)}n.addEventListener("change",()=>{this.setLocale(n.value)}),e.appendChild(n),this.languageSelect=n}async setLocale(e){let t=(0,ae.getLocale)(),n=this.localeGeneration+=1,o=await(0,ae.loadLocale)(e);return this.opts.messages&&(0,ae.setStringOverrides)(this.opts.messages),o===t||this.applyActiveLocale(o,n),o}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let n=this.hostEl;if(n){n.lang=e,n.dir=(0,ae.localeDirection)(e);for(let o of n.querySelectorAll("[data-sl-i18n]"))if(o.dataset.slI18n==="testMode")o.textContent=(0,ae.t)("picker.testMode"),o.setAttribute("aria-label",(0,ae.t)("picker.testMode"));else if(o.dataset.slI18n==="badge"){o.setAttribute("aria-label",(0,ae.t)("picker.poweredBy"));let r=o.querySelector("span:last-child");r&&(r.textContent=(0,ae.t)("picker.poweredBy"))}this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return ml(this.controller,this.immersive,{event:this.opts.event,currency:this.opts.currency,mode_:this.mode_,eventInfo:this.eventInfo,eventLocale:this.eventLocale,focusedSection_:this.focusedSection_,colorblindSafe_:this.colorblindSafe_,categoryFilter_:this.categoryFilter_,accessibilityFilter_:this.accessibilityFilter_,hideLimitedView_:this.hideLimitedView_,maxSelection_:this.maxSelection_,accessState_:this.accessState_,hostPrices_:this.hostPrices_})}getHostPrices(){return this.hostPrices_}getCategoryAvailability(){return this.controller.categoryAvailability()}getBestAvailableZones(){return this.controller.getBestAvailableZones()}getActiveFloorId(){return this.controller.getActiveFloorId()||null}getRung(){return this.controller.getRung()}getFocusedSection(){return this.controller.getFocusedSection()}focusSection(e){if(this.immersive.buyerView==="venue3d"&&this.immersive.focusSection(e)){this.notifyMapStateChange();return}this.controller.focusSection(e),this.notifyMapStateChange()}overview(){if(this.immersive.focusOverview()){this.notifyMapStateChange();return}this.controller.overview(),this.notifyMapStateChange()}setRung(e){this.controller.setRung(e),this.notifyMapStateChange()}setCategoryFilter(e,t=!1){this.categoryFilter_=e?[...e]:null,this.controller.setCategoryFilter(e),t&&this.controller.focusCategoryFilter(e),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.notifyMapStateChange(),e?.length&&this.focusAccessibilityFilter()}focusAccessibilityFilter(){this.controller.focusAccessibilityFilter?.(),this.notifyMapStateChange()}focusNextAccessibleSection(e){let t=this.controller.focusNextAccessibleSection?.(e)??null;return t&&this.notifyMapStateChange(),t}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let n=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(n?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:n?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(n=>n.label));try{let n=await this.controller.hold(void 0,e.ttlMs);return n?{holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items}:null}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,n={}){try{return await this.holdGAOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async holdGAOrThrow(e,t,n={}){let o=await this.controller.holdGA(e,t,n);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}async bestAvailable(e,t,n={}){try{return await this.bestAvailableOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async bestAvailableOrThrow(e,t,n={}){let o=_n(this.controller,t);if(o)throw o;let r=await this.controller.bestAvailable(e,t,n);return al(this.controller,r),r?{holdId:r.holdId,expiresAt:r.expiresAt,labels:r.labels,seats:r.seats,items:r.items,...n.zoneId?{zoneId:n.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,n){try{return await this.replaceTableQuantityOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async replaceTableQuantityOrThrow(e,t,n){let o=await this.controller.replaceTableQuantity(e,t,n);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.immersive.buyerView==="venue3d"&&e!=="all"&&this.immersive.focusFloor(e)){this.notifyMapStateChange();return}if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}e==="all"?this.controller.setFloorOverview(!0):this.controller.setFloor(e),this.notifyMapStateChange()}setFloorLabelStyle(e){this.controller.getRenderer()?.setFloorLabelStyle?.(e),this.notifyMapStateChange()}setSectionFocusDim(e){this.controller.setSectionFocusDim(e)}setSelectionFocus(e){this.controller.setSelectionFocus(e)}setBlockedRegions(e){if(!this.blockedRegions){if(!e.length)return;this.blockedRegions=new lo,this.hostEl&&this.blockedRegions.attach(this.hostEl)}this.blockedRegions.set(e)}getBlockedRegions(){return this.blockedRegions?.get()??[]}frameSeat(e,t={}){let n=this.controller.getRenderer();return dl({seatPoint:o=>{let r=this.controller.getExpandedSeats().find(s=>s.id===o);return r?this.controller.worldToScreen({x:r.x,y:r.y}):null},mapHeight:()=>this.hostEl?.clientHeight??0,insets:()=>this.controller.getViewportInsets(),gestureCount:()=>n?.getCameraGestureCount?.()??0,panScreenBy:(o,r)=>n?.panScreenBy?(n.panScreenBy(o,{animate:r}),!0):!1},e,t)}setPricing(e){let t=e?.prices&&Object.keys(e.prices).length?e.prices:void 0;JSON.stringify(t??null)!==JSON.stringify(this.hostPrices_??null)&&(this.hostPrices_=t,this.controller.getRenderer()?.setCategoryPriceRanges?.(this.hostPriceRanges()),this.notifyMapStateChange())}hostPriceRanges(){let e=this.hostPrices_;if(e)return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(t=>{let n=t.tiers?.length?t.tiers.map(o=>jt(e,t.key,o.id,o.price)):t.price==null?[]:[jt(e,t.key,null,t.price)];return n.length?[[t.key,{min:Math.min(...n),max:Math.max(...n)}]]:[]}))}setColorblindSafe(e){this.colorblindSafe_=e,this.controller.setColorblindSafe(e),this.notifyMapStateChange()}setViewMode(e){this.controller.setViewMode(e),this.notifyMapStateChange()}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.immersive.zoomIn()||(this.controller.zoomIn(),this.notifyMapStateChange())}zoomOut(){this.immersive.zoomOut()||(this.controller.zoomOut(),this.notifyMapStateChange())}zoomToFit(){this.immersive.focusOverview()||(this.controller.zoomToFit(),this.notifyMapStateChange())}setThemeMode(e,t){this.hostSurface.setThemeMode(e,t)}getThemeMode(){return this.hostSurface.themeMode()}setViewportInsets(e){this.hostSurface.setViewportInsets(e)}getViewportInsets(){return this.hostSurface.viewportInsets()}setBuyerView(e,t){return this.immersive.setBuyerView(e,t)}getBuyerView(){return this.immersive.buyerView}openSeatView(e){return this.immersive.openSeatView(e)}setVenue3DNavigationMode(e){if(!this.immersive.setNavigationMode(e))throw new Error("venue_3d_not_active")}setInteractionEnabled(e){this.interactionEnabled_=e,this.applyInteractionState()}applyInteractionState(){let e=this.hostEl;e&&(e.style.pointerEvents=this.interactionEnabled_?"":"none",e.toggleAttribute("inert",!this.interactionEnabled_),this.interactionEnabled_?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true"))}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new Qe({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:ri(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';let n=document.createElement("div");n.textContent="The seat map didn\u2019t load.",t.appendChild(n);let o=document.createElement("button");o.type="button",o.textContent="Try again",o.style.cssText="appearance:none;border:1px solid #c9cede;background:#fff;color:#10162a;border-radius:8px;padding:8px 16px;font:600 13px/1 inherit;cursor:pointer;",o.addEventListener("click",()=>{this.destroy(),this.render().catch(r=>this.opts.onError?.(r))}),t.appendChild(o),e.appendChild(t)}destroy(){this.blockedRegions?.detach(),this.hostSurface.dispose(),this.immersive.destroy(),this.buyerAssetUrls.dispose(),this.realtime?.stop(),this.realtime=null,this.access?.clear(),this.hostEl&&this.onTipMove&&this.hostEl.removeEventListener("mousemove",this.onTipMove),this.tipEl=null,this.onTipMove=null,this.languageSelect=null,this.controller.destroy(),this.hostEl&&this.hostEl.parentNode&&this.hostEl.parentNode.removeChild(this.hostEl),this.hostEl=null,this.mount=null,this.rendered=!1,this.mode_=null,this.eventInfo=null,this.focusedSection_=null}};var yr=["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"],au={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 gl(i){let e={};for(let t of yr)e[t]=(...n)=>{let o=i();return o?o[t](...n):au[t]()};return e}var vr=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],wr=[...vr,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],xr=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function bl(i,e,t){let n={container:i};for(let o of wr)n[o]=e[o];for(let o of xr)n[o]=t[o];return n}var lu=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),cu=2e4,du=0,pu=180*1e3,hu=900*1e3,uu=.8,mu=30*1e3,fu=1e5,gu=4,bu=50;function kr(i){if(typeof i!="string")return i;let e=document.querySelector(i);if(!e)throw new Error(`EmbeddedDesigner container not found: ${i}`);return e}function yu(i){let e=(i??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var vu={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."}},mo=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"||!lu.has(t.type))return;let n={type:t.type,chartId:typeof t.chartId=="string"?t.chartId:void 0,workspaceId:typeof t.workspaceId=="string"?t.workspaceId:void 0,expiresAt:typeof t.expiresAt=="number"?t.expiresAt:void 0,code:typeof t.code=="string"?t.code:void 0,message:typeof t.message=="string"?t.message:void 0,meta:t.meta,fatal:typeof t.fatal=="boolean"?t.fatal:void 0,action:typeof t.action=="string"?t.action:void 0},o=this.identityEstablished||n.type==="seatlayer.designer.ready"||n.type==="seatlayer.designer.saved"||n.type==="seatlayer.designer.published"||n.type==="seatlayer.designer.close",r=this.options.expectedChartId!==void 0&&n.chartId!==this.options.expectedChartId&&(o||n.chartId!==void 0),s=this.options.expectedWorkspaceId!==void 0&&n.workspaceId!==this.options.expectedWorkspaceId&&(o||n.workspaceId!==void 0);if(r||s){this.showError("mismatch");return}switch(n.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=n.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(n.expiresAt),this.options.onReady?.(n);break;case"seatlayer.designer.saved":this.options.onSaved?.(n);break;case"seatlayer.designer.published":this.options.onPublished?.(n);break;case"seatlayer.designer.close":this.options.onClose?.(n);break;case"seatlayer.designer.error":{let a=yu(n.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof n.fatal=="boolean"?n.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(n);break}}};this.options=e}mount(){this.destroy();let e=new URL(this.options.designerUrl,window.location.href);if(e.protocol!=="https:"&&e.hostname!=="localhost"&&e.hostname!=="127.0.0.1")throw new Error("EmbeddedDesigner requires an HTTPS designerUrl outside local development.");this.designerOrigin=e.origin;let t=document.createElement("iframe");t.title=this.options.title??"Venue chart Designer",t.allow=this.options.allow??"fullscreen; clipboard-write",t.referrerPolicy=this.options.referrerPolicy??"origin",t.src=e.toString(),t.style.setProperty("width","100%","important"),t.style.setProperty("height",typeof this.options.height=="number"?`${this.options.height}px`:"100%","important"),t.style.border="0",Object.assign(t.style,this.options.style),this.options.className&&(t.className=this.options.className);let n=kr(this.options.container);if(this.containerEl=n,window.addEventListener("message",this.handleMessage),n.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(n),this.renderOverlay(n,"loading");let o=this.options.loadingTimeoutMs??cu;o>0&&Number.isFinite(o)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},o))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let n=()=>e.getBoundingClientRect().height,o=t.style.getPropertyValue("height"),r=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let s=n();t.style.setProperty("height",`${fu}px`,"important");let a=n();return o?t.style.setProperty("height",o,r):t.style.removeProperty("height"),!(a-s>gu)&&s>=bu?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??du;if(this.fillMode==="container"&&this.containerEl){let o=getComputedStyle(this.containerEl),r=["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"].reduce((a,l)=>a+(parseFloat(o[l])||0),0),s=Math.max(e,Math.floor(this.containerEl.getBoundingClientRect().height-r));this.setFrameHeight(`${s}px`);return}let t=this.frame.getBoundingClientRect().top,n=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${n}px`)}syncContainerObserver(){let e=this.fillMode==="container"&&!!this.containerEl&&typeof ResizeObserver<"u";e&&!this.resizeObs?(this.resizeObs=new ResizeObserver(()=>this.scheduleFill()),this.resizeObs.observe(this.containerEl)):!e&&this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null)}startFill(){this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill(),!this.fillListening&&(this.fillListening=!0,window.addEventListener("resize",this.scheduleReprobe),window.addEventListener("orientationchange",this.scheduleReprobe),window.addEventListener("scroll",this.scheduleFill,{passive:!0}))}stopFill(){this.fillRaf!==null&&(cancelAnimationFrame(this.fillRaf),this.fillRaf=null),this.reprobeRaf!==null&&(cancelAnimationFrame(this.reprobeRaf),this.reprobeRaf=null),this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null),this.fillListening&&(this.fillListening=!1,window.removeEventListener("resize",this.scheduleReprobe),window.removeEventListener("orientationchange",this.scheduleReprobe),window.removeEventListener("scroll",this.scheduleFill))}pinFullscreen(){if(this.pinned||!this.frame)return;this.pinned=!0,this.frameStyleBeforeFs=this.frame.getAttribute("style");let e={position:"fixed",top:"0",right:"0",bottom:"0",left:"0",width:"100vw",height:"100vh",margin:"0",border:"0","z-index":"2147483000",background:"#101625"};for(let[n,o]of Object.entries(e))this.frame.style.setProperty(n,o,"important");let t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=n=>{n.key==="Escape"&&this.unpinFullscreen()},window.addEventListener("keydown",this.fsKeyHandler)}unpinFullscreen(){this.pinned&&(this.pinned=!1,this.frame&&(this.frameStyleBeforeFs===null?this.frame.removeAttribute("style"):this.frame.setAttribute("style",this.frameStyleBeforeFs),this.fillEnabled()?this.applyFill():this.autoResizeEnabled()&&this.lastAutoHeight?this.setFrameHeight(this.lastAutoHeight):typeof this.options.height=="number"&&this.setFrameHeight(`${this.options.height}px`)),this.frameStyleBeforeFs=null,this.docOverflowBeforeFs!==null&&(document.documentElement.style.overflow=this.docOverflowBeforeFs,this.docOverflowBeforeFs=null),this.bodyOverflowBeforeFs!==null&&document.body&&(document.body.style.overflow=this.bodyOverflowBeforeFs,this.bodyOverflowBeforeFs=null),this.fsKeyHandler&&(window.removeEventListener("keydown",this.fsKeyHandler),this.fsKeyHandler=null))}clearTimeoutTimer(){this.timeoutTimer!==null&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)}autoRenewEnabled(){return!!this.options.onRequestRelaunch&&this.options.autoRenewSession!==!1}clearRenewTimer(){this.renewTimer!==null&&(clearTimeout(this.renewTimer),this.renewTimer=null)}scheduleRenewal(e){if(this.clearRenewTimer(),!this.autoRenewEnabled()||typeof e!="number"||!Number.isFinite(e))return;let t=e-Date.now();if(t<=0)return;let n=t<hu?t*uu:t-pu,o=Math.max(mu,n);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},o)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{kr(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=kr(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,n){this.removeOverlay();let o=document.createElement("div");o.setAttribute("data-seatlayer-designer-overlay",t),o.setAttribute("role",t==="error"?"alert":"status"),o.setAttribute("aria-live","polite"),Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:t==="loading"?"#f7f8fb":"#101625",color:t==="loading"?"#0c1220":"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:t==="error"?"auto":"hidden"}),t==="loading"?this.buildSkeleton(o):this.buildErrorCard(o,n??"load"),e.append(o),this.overlay=o}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
|
|
3540
|
+
`;function Si(){if(document.getElementById(dl))return;let i=document.createElement("style");i.id=dl,i.textContent=au+rl+ol+el+sl+il+nl+cl+tl+Da,document.head.appendChild(i)}async function no(i,e){let t=i.overlay.productionElements;if(!t?.some(o=>o.contentImageUrl))return i;let n=await Promise.all(t.map(async o=>{if(!o.contentImageUrl)return o;try{let r=await e(o.contentImageUrl);if(!r){let{contentImageUrl:s,...a}=o;return a}return{...o,runtimeContentImageUrl:r}}catch{let{contentImageUrl:r,...s}=o;return s}}));return{...i,overlay:{...i.overlay,productionElements:n}}}async function oo(i,e){if(i)try{let t=await e(i);return t?await(await fetch(t)).arrayBuffer():void 0}catch{return}}var xt=require("@seatlayer/core/view/panoramaDelivery");function ro(i){let{root:e,source:t,caption:n,real:o,closeLabel:r,dragHint:s,viewFromSeatLabel:a,real360Label:l,previewLabel:c,resolveAsset:d,onClose:p}=i,u=i.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 b=k=>h.querySelector(k)?.remove();u.title===!1?b(".sl-view-title"):h.querySelector(".sl-view-title").textContent=a,u.caption===!1?b(".sl-view-cap"):h.querySelector(".sl-view-cap").textContent=n,h.querySelector(".sl-view-x").setAttribute("aria-label",r),u.badge===!1?b(".sl-view-badge"):h.querySelector(".sl-view-badge").textContent=o?l:c,h.querySelector(".sl-view-hint").textContent=s,e.appendChild(h);let g=h.querySelector(".sl-view-pano"),T=(0,xt.planPanoramaDelivery)(t,(0,xt.browserPanoramaConstraints)()),w=new AbortController;g.style.backgroundImage=`url(${JSON.stringify(T.initialUrl)})`;let v=()=>{};T.upgradeUrl&&(v=(0,xt.schedulePanoramaUpgrade)(()=>{d(T.upgradeUrl).then(k=>!k||w.signal.aborted?null:(0,xt.loadPanoramaImage)(k,w.signal).then(()=>k)).then(k=>{!k||!h.isConnected||w.signal.aborted||(g.style.backgroundImage=`url(${JSON.stringify(k)})`)}).catch(()=>{})}));let M=70,F=35,X=1,f=g.clientHeight||1,O=g.clientWidth||1,G=-(f*(180/M)*2/2-O/2),_=0,j=()=>{let k=g.clientHeight||1,A=k*(180/M)*X,D=Math.max(0,A-k),Q=Math.min(D/2,F/180*A);_=Math.min(Q,Math.max(-Q,_)),g.style.backgroundSize=`auto ${A}px`,g.style.backgroundPosition=`${G}px ${_-D/2}px`};j();let P=!1,z=0,J=0,W=k=>{P=!0,z=k.clientX,J=k.clientY,g.classList.add("drag"),g.setPointerCapture?.(k.pointerId)},oe=k=>{P&&(G+=k.clientX-z,_+=k.clientY-J,z=k.clientX,J=k.clientY,j())},Ee=k=>{P=!1,g.classList.remove("drag"),g.releasePointerCapture?.(k.pointerId)},xe=k=>{k.preventDefault(),X=Math.min(2.4,Math.max(1,X+(k.deltaY<0?.12:-.12))),j()};g.addEventListener("pointerdown",W),g.addEventListener("pointermove",oe),g.addEventListener("pointerup",Ee),g.addEventListener("pointercancel",Ee),g.addEventListener("wheel",xe,{passive:!1});let Ce=h.querySelector(".sl-view-x");Ce.addEventListener("click",p);let ze=k=>{k.key==="Escape"&&(k.stopPropagation(),p())};return h.addEventListener("keydown",ze),Ce.focus(),{element:h,dispose(){v(),w.abort(),g.removeEventListener("pointerdown",W),g.removeEventListener("pointermove",oe),g.removeEventListener("pointerup",Ee),g.removeEventListener("pointercancel",Ee),g.removeEventListener("wheel",xe),h.removeEventListener("keydown",ze),Ce.removeEventListener("click",p)}}}function lu(i,e){if(!e)return{targetSeatId:null,previousSeatId:null,nextSeatId:null};let t=i.find(r=>r.id===e);if(!t?.rowId)return{targetSeatId:e,previousSeatId:null,nextSeatId:null};let n=i.filter(r=>r.rowId===t.rowId),o=n.findIndex(r=>r.id===e);return{targetSeatId:e,previousSeatId:o>0?n[o-1].id:null,nextSeatId:o>=0&&o+1<n.length?n[o+1].id:null}}var pl=6e4,so=class{constructor(e){this.buyerView_="map";this.targetSeatId_=null;this.focusedSectionId_=null;this.navigationMode_="auto";this.overlay=null;this.handle=null;this.generation=0;this.seatViewGeneration=0;this.seatViewElement=null;this.seatViewDispose=null;this.navigationPinned_=!1;this.options=e}get buyerView(){return this.buyerView_}get targetSeatId(){return this.targetSeatId_}get focusedSectionId(){return this.focusedSectionId_}get seatPosition(){return lu(this.options.seats(),this.targetSeatId_)}get navigationMode(){return this.navigationMode_==="auto"?"orbit":this.navigationMode_}canOffer3D(){return this.options.enable3D?this.handle&&this.overlay?!0:!this.options.doc()||!Mn()?!1:this.options.seats().length<=this.max3DSeats():!1}canOfferSeatView(){return this.options.enableSeatView?this.options.seats().some(e=>!!e.viewUrl)?!0:this.hasStage():!1}async setBuyerView(e,t={}){if(e==="map"){this.exit3D();return}if(!this.canOffer3D())throw new Error("venue_3d_unavailable");if(this.buyerView_==="venue3d"&&this.handle){t.flyToSeatId?(this.targetSeatId_=t.flyToSeatId,this.focusedSectionId_=this.findSeat(t.flyToSeatId)?.sectionId??null,this.options.onViewChange(this.buyerView_,this.targetSeatId_),await this.handle.flyToSeat(t.flyToSeatId)):t.resetView&&this.handle.focusOverview();return}if(this.handle&&this.overlay){await this.restore3D(t);return}await this.enter3D(t.flyToSeatId)}async openSeatView(e){if(!this.canOfferSeatView())throw new Error("seat_view_unavailable");let t=this.findSeat(e),n=this.options.host(),o=this.options.doc();if(!t||!n||!o)throw new Error("seat_view_unavailable");let r=++this.seatViewGeneration,s,a,l=!1;if(t.viewUrl){let b=t.viewMeta?.previewUrl,g=!!b&&b!==t.viewUrl,T=g?await this.options.resolveAsset(b):null,w=g?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(r!==this.seatViewGeneration||!w||g&&!T)return;s={url:w,...T?{previewUrl:T}:{},...g?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}},a=(0,ao.seatViewDisclosure)(s),l=(0,ao.isAuthoredSeatView)(s)}else{if(!this.hasStage())throw new Error("seat_view_unavailable");let{generateSeatPanorama:b}=await Hn();if(r!==this.seatViewGeneration)return;let g=o.floors?.find(v=>v.objects.some(M=>M.type==="row"&&M.id===t.rowId)),T=t.focalPoint??g?.focalPoint??o.focalPoint,w=b(t,T,[...this.options.seats()]);s={url:w.url,generated:!0},a=(0,zt.t)("picker.illustrationCaption",{m:w.distanceM})}if(r!==this.seatViewGeneration)return;this.closeSeatView(!1),this.prepareHostTheme(n,o),Si();let c=this.options.chrome??{},d=Nt(),p=(0,zt.t)("picker.viewFromSeat",{label:t.displayLabel||t.label}),u=l?(0,zt.t)("picker.real360"):(0,zt.t)("picker.preview"),h=ro({root:n,source:s,caption:a,real:l,closeLabel:y("picker.close","Close"),dragHint:d,viewFromSeatLabel:p,real360Label:(0,zt.t)("picker.real360"),previewLabel:(0,zt.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:!!s.generated,dragHint:d})}pushLiveState(){this.handle&&(this.handle.setAvailability(this.options.seats().map(e=>({seatId:e.id,state:this.seatState(e)}))),this.handle.setSelection(this.options.selection().map(e=>e.id)))}focusOverview(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.focusOverview(),!0)}focusSection(e){return this.buyerView_==="venue3d"?this.handle?.focusSection(e)??!1:!1}focusFloor(e){let t=this.options.doc();if(this.buyerView_!=="venue3d"||!this.handle||!t?.floors?.length)return!1;let n=t.floors.findIndex(o=>o.id===e);return n>=0&&this.handle.focusFloor(n)}zoomIn(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomIn(),!0)}zoomOut(){return this.buyerView_!=="venue3d"||!this.handle?!1:(this.handle.zoomOut(),!0)}applyNavigationMode(e){this.navigationMode_==="auto"&&!this.navigationPinned_||e.setNavigationMode(this.navigationMode_)}setNavigationMode(e){return e!=="auto"&&(this.navigationPinned_=!0),this.navigationMode_=e,this.buyerView_!=="venue3d"||!this.handle?!1:(this.applyNavigationMode(this.handle),this.options.onViewChange(this.buyerView_,this.targetSeatId_),!0)}destroy(){this.generation+=1,this.closeSeatView(!0,!1);try{this.handle?.dispose()}catch{}this.handle=null,this.overlay?.remove(),this.overlay=null,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null}max3DSeats(){let e=this.options.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?pl/2:pl}async enter3D(e){let t=this.options.host(),n=this.options.doc();if(!t||!n||this.overlay)throw new Error("venue_3d_unavailable");Si(),this.prepareHostTheme(t,n);let o=document.createElement("div");o.className="sl-view3d",o.setAttribute("role","group"),o.setAttribute("aria-label",y("picker.interactive3dVenueView","Interactive 3D venue view")),Object.assign(o.style,{position:"absolute",inset:"0",zIndex:"4",opacity:"0",touchAction:"none",transition:this.reducedMotion()?"none":"opacity 260ms cubic-bezier(.2,.8,.2,1)",background:"radial-gradient(120% 120% at 50% 0%,#191f28 0%,#0d1014 70%)"});let r=document.createElement("div");r.className="sl-view3d-loading",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),r.textContent=y("picker.loading3d","Building the 3D venue\u2026"),o.appendChild(r),t.appendChild(o),this.overlay=o;let s=++this.generation;if(this.reducedMotion()?o.style.opacity="1":requestAnimationFrame(()=>{o.style.opacity="1"}),await this.nextPaint(),!(s!==this.generation||this.overlay!==o))try{let[a,l]=await Promise.all([Xi(),this.options.loadEventConfiguration()]),c=l?await no(l,this.options.resolveAsset):null,d=await oo(n.theme?.venue3d?.shellAssetUrl,this.options.resolveAsset);if(s!==this.generation||this.overlay!==o)return;let p={doc:n,seats:[...this.options.seats()],...c?{eventConfigurationId:c.id,eventConfiguration:c}:{},...d?{registeredShellGlb:d}:{}};r.textContent=y("picker.building3d","Building venue geometry\u2026");let u=await a.prepareVenue3D(p);if(s!==this.generation||this.overlay!==o)return;let h=this.options.chrome??{},b=a.mountVenue3D(o,{...p,prepared:u},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:Nt(),navLabels:Pn(),...h.view3dCaption===!1||h.view3dSeatStepper===!1||h.view3dControlDock===!1?{chrome:{caption:h.view3dCaption!==!1,seatStepper:h.view3dSeatStepper!==!1,controlDock:h.view3dControlDock!==!1}}:{},seatViewActionLabel:g=>this.findSeat(g)?.viewUrl?y("picker.openAuthored360","Open venue 360\xB0"):y("picker.lookAroundLive3d","Look around in live 3D"),onSeatPick:g=>this.toggleSeat(g),onSeatInspect:g=>this.toggleSeat(g),onViewTargetChange:g=>{this.targetSeatId_=g,g&&(this.focusedSectionId_=this.findSeat(g)?.sectionId??null),this.options.onViewChange("venue3d",g)},onSectionFocusChange:g=>{this.focusedSectionId_=g,this.options.onViewChange("venue3d",this.targetSeatId_)},...this.options.enableSeatView?{getSeatView:g=>this.seatViewFor3D(g)}:{}});if(s!==this.generation||this.overlay!==o){b.dispose();return}this.handle=b,this.buyerView_="venue3d",this.targetSeatId_=e??null,this.focusedSectionId_=e?this.findSeat(e)?.sectionId??null:null,this.applyNavigationMode(b),requestAnimationFrame(()=>r.remove()),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e&&await b.flyToSeat(e)}catch(a){if(s!==this.generation)return;throw this.options.onError?.(a),this.remove3DOverlay(!1),a}}exit3D(){this.buyerView_==="map"&&!this.overlay||(this.generation+=1,this.buyerView_="map",this.targetSeatId_=null,this.focusedSectionId_=null,this.remove3DOverlay(!0,!!this.handle),this.options.onViewChange("map",null))}remove3DOverlay(e,t=!1){let n=this.handle,o=this.overlay;if(this.options.restoreMap(),t&&n&&o){o.style.pointerEvents="none";let r=()=>{this.buyerView_!=="map"||this.overlay!==o||(o.style.visibility="hidden",this.options.restoreMap())};!e||this.reducedMotion()?(o.style.opacity="0",r()):(requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(r,280));return}if(this.handle=null,this.overlay=null,!o){try{n?.dispose()}catch{}this.options.restoreMap();return}if(!e||this.reducedMotion()){try{n?.dispose()}catch{}o.remove(),this.options.restoreMap();return}o.style.pointerEvents="none",requestAnimationFrame(()=>{o.style.opacity="0"}),setTimeout(()=>{try{n?.dispose()}catch{}o.remove(),this.options.restoreMap()},280)}async restore3D(e){let t=this.overlay,n=this.handle;if(!t||!n)throw new Error("venue_3d_unavailable");this.buyerView_="venue3d",this.targetSeatId_=e.flyToSeatId??null,this.focusedSectionId_=e.flyToSeatId?this.findSeat(e.flyToSeatId)?.sectionId??null:null,t.style.visibility="visible",t.style.pointerEvents="auto",this.reducedMotion()?t.style.opacity="1":requestAnimationFrame(()=>{t.style.opacity="1"}),n.resize(),this.applyNavigationMode(n),this.pushLiveState(),this.options.onViewChange("venue3d",this.targetSeatId_),e.flyToSeatId?await n.flyToSeat(e.flyToSeatId):e.resetView&&n.focusOverview()}nextPaint(){return this.reducedMotion()||typeof requestAnimationFrame!="function"?Promise.resolve():new Promise(e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))})}toggleSeat(e){if(!this.findSeat(e))return;this.options.selection().some(o=>o.id===e)?this.options.deselect(e):this.options.status(e)==="free"&&this.options.select(e),this.pushLiveState()}seatState(e){switch(this.options.status(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:return"available"}}async seatViewFor3D(e){let t=this.findSeat(e);if(!t)throw new Error("seat_view_unavailable");if(t.viewUrl){let n=t.viewMeta?.previewUrl,o=!!n&&n!==t.viewUrl,r=o?await this.options.resolveAsset(n):null,s=o?t.viewUrl:await this.options.resolveAsset(t.viewUrl);if(!s||o&&!r)throw new Error("seat_view_unavailable");return{url:s,...r?{previewUrl:r}:{},...o?{resolveUrl:this.options.resolveAsset}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:y("picker.chartDerivedModel","Chart-derived model")}}closeSeatView(e=!0,t=!1){e&&(this.seatViewGeneration+=1);let n=this.seatViewElement;if(this.seatViewDispose?.(),this.seatViewDispose=null,this.seatViewElement=null,!!n){if(this.options.onSeatViewChange?.(null),!t||this.reducedMotion()){n.remove();return}n.classList.add("is-leaving"),setTimeout(()=>n.remove(),190)}}findSeat(e){return this.options.seats().find(t=>t.id===e||t.label===e)}hasStage(){let e=this.options.doc();return e?(e.floors?.flatMap(n=>n.objects)??e.objects).some(n=>n.type==="shape"&&(n.role==="stage"||!!n.stageKind)):!1}prepareHostTheme(e,t){getComputedStyle(e).position==="static"&&(e.style.position="relative");let n=t.theme;e.style.setProperty("--sl-bg",n?.background??"#f6f7fb"),e.style.setProperty("--sl-surface","#ffffff"),e.style.setProperty("--sl-text",n?.textColor??"#10162a"),e.style.setProperty("--sl-muted","#697386"),e.style.setProperty("--sl-line","#d9deea"),e.style.setProperty("--sl-accent",n?.accent??"#ef4056"),e.style.setProperty("--sl-accent-ink",n?.accentInk??"#ffffff")}reducedMotion(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1}};function jt(i,e,t,n){let o=e?i?.[e]:void 0;return o===void 0?n:typeof o=="number"?o:t&&o.tiers?.[t]!==void 0?o.tiers[t]:o.base??n}function lo(i){if(!i)return null;let e=i.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function cu(i){return lo(i.foot?.querySelector(".sl-total"))??lo(i.tray)??lo(i.sheetHead)}function br(i,e,t,n,o){let r=i,s=r.map;if(!s||!e){o?.();return}let a=s.getBoundingClientRect(),l={x:a.left+e.x,y:a.top+e.y},c=t.displayLabel??t.label,d=n?.find(u=>u.key===t.categoryKey)?.color,p=()=>{let u=cu(r);if(!u){o?.();return}$a({from:l,to:{x:u.left+u.width/2,y:u.top+u.height/2},label:c,color:d,onArrive:o})};r.sheetHead&&lo(r.sheetHead)?requestAnimationFrame(p):p()}var gr=60,du=650;function hl(i,e){if(!e.length||i.focusSeats?.(e.map(o=>o.id)))return;let t=e.find(o=>o.sectionId)?.sectionId;if(!t)return;let n=e.filter(o=>o.sectionId===t);i.focus(t,{x:n.reduce((o,r)=>o+r.x,0)/n.length,y:n.reduce((o,r)=>o+r.y,0)/n.length})}function ul(i,e){let t=!Zn();hl({focusSeats:n=>i.focusSeats?.(n,{animate:t})===!0,focus:(n,o)=>i.focusSection(n,o)},(e?.items??[]).filter(n=>n.objectType!=="ga").slice(0,10).map(n=>i.seatByLabel(n.label)).filter(n=>!!n))}function ml(i,e){if(!e.length)return;let t=i.reducedMotion===!0;t||e.forEach((s,a)=>{i.schedule(()=>i.pop(s.id),a*gr)});let n=t?0:e.length*gr,o=e.find(s=>s.sectionId)?.sectionId;if(i.schedule(()=>hl(i,e),n),t)return;let r=n+(i.focusSeats||o?du:0);e.forEach((s,a)=>{i.schedule(()=>br(i.regions,i.screenPoint(s),s,i.categories),r+a*gr)})}function pu(i,e,t){for(let n of i)if(e>=n.x&&t>=n.y&&e<=n.x+n.w&&t<=n.y+n.h)return!0;return!1}var co=class{constructor(){this.rects=[];this.host=null;this.pointers=new Set;this.touches=new Set;this.mouseDown=!1;this.onPointerDown=e=>{this.inside(e.clientX,e.clientY)&&(this.pointers.add(e.pointerId),this.swallow(e))};this.onPointerFollow=e=>{this.pointers.has(e.pointerId)&&this.swallow(e)};this.onPointerEnd=e=>{this.pointers.delete(e.pointerId)&&this.swallow(e)};this.onTouchStart=e=>{let t=this.changed(e);if(!t.length)return;let n=!0;for(let o of t)this.inside(o.clientX,o.clientY)?this.touches.add(o.identifier):n=!1;n&&this.swallow(e)};this.onTouchFollow=e=>{let t=this.changed(e);t.length&&t.every(n=>this.touches.has(n.identifier))&&this.swallow(e)};this.onTouchEnd=e=>{let t=this.changed(e);if(!t.length)return;let n=t.every(o=>this.touches.has(o.identifier));for(let o of t)this.touches.delete(o.identifier);n&&this.swallow(e)};this.onMouseDown=e=>{this.inside(e.clientX,e.clientY)&&(this.mouseDown=!0,this.swallow(e))};this.onMouseFollow=e=>{this.mouseDown&&this.swallow(e)};this.onMouseUp=e=>{this.mouseDown&&(this.mouseDown=!1,this.swallow(e))};this.onClick=e=>{this.inside(e.clientX,e.clientY)&&this.swallow(e)}}set(e){this.rects=e.map(t=>({x:t.x,y:t.y,w:t.w,h:t.h})),this.rects.length||(this.pointers.clear(),this.touches.clear(),this.mouseDown=!1)}get(){return this.rects}attach(e){if(this.host===e)return;this.detach(),this.host=e;let t={capture:!0,passive:!1};e.addEventListener("pointerdown",this.onPointerDown,t),e.addEventListener("pointermove",this.onPointerFollow,t),e.addEventListener("pointerup",this.onPointerEnd,t),e.addEventListener("pointercancel",this.onPointerEnd,t),e.addEventListener("touchstart",this.onTouchStart,t),e.addEventListener("touchmove",this.onTouchFollow,t),e.addEventListener("touchend",this.onTouchEnd,t),e.addEventListener("touchcancel",this.onTouchEnd,t),e.addEventListener("mousedown",this.onMouseDown,t),e.addEventListener("mousemove",this.onMouseFollow,t),e.addEventListener("mouseup",this.onMouseUp,t),e.addEventListener("click",this.onClick,t),e.addEventListener("dblclick",this.onClick,t)}detach(){let e=this.host;if(!e)return;let t={capture:!0};e.removeEventListener("pointerdown",this.onPointerDown,t),e.removeEventListener("pointermove",this.onPointerFollow,t),e.removeEventListener("pointerup",this.onPointerEnd,t),e.removeEventListener("pointercancel",this.onPointerEnd,t),e.removeEventListener("touchstart",this.onTouchStart,t),e.removeEventListener("touchmove",this.onTouchFollow,t),e.removeEventListener("touchend",this.onTouchEnd,t),e.removeEventListener("touchcancel",this.onTouchEnd,t),e.removeEventListener("mousedown",this.onMouseDown,t),e.removeEventListener("mousemove",this.onMouseFollow,t),e.removeEventListener("mouseup",this.onMouseUp,t),e.removeEventListener("click",this.onClick,t),e.removeEventListener("dblclick",this.onClick,t),this.host=null,this.pointers.clear(),this.touches.clear(),this.mouseDown=!1}inside(e,t){if(!this.rects.length||!this.host)return!1;let n=this.host.getBoundingClientRect();return pu(this.rects,e-n.left,t-n.top)}swallow(e){e.stopImmediatePropagation(),e.stopPropagation(),e.cancelable&&e.preventDefault()}changed(e){let t=e.changedTouches;return t?Array.from(t):[]}},fl=.48,hu=8;function uu(i,e,t,n=fl){let o=Math.max(0,t.top),r=e.height-Math.max(0,t.bottom);if(!(r>o))return 0;let s=Number.isFinite(n)?Math.min(1,Math.max(0,n)):fl,a=o+(r-o)*s-i;return Math.abs(a)<=hu?0:Math.round(a)}function gl(i,e,t={}){let n=i.gestureCount();if(t.gestures!==void 0&&t.gestures!==n)return{dy:0,gestures:n};let o=i.seatPoint(e);if(!o)return{dy:0,gestures:n};let r=uu(o.y,{height:i.mapHeight()},i.insets(),t.fraction);return r?{dy:i.panScreenBy({x:0,y:r},t.animate!==!1)?r:0,gestures:n}:{dy:0,gestures:n}}var on=class i{constructor(e,t=null){this.seams=e;this.watch=null;this.mode=t,this.watchMode()}themeMode(){return this.mode}setThemeMode(e,t){let n=t!==void 0&&"mapTheme"in t;e===this.mode&&!n||(n&&this.seams.setHostMapTheme(t.mapTheme??void 0),this.mode=e,this.watchMode(),this.applyThemeMode())}static groundFor(e){return di(null,e)}applyThemeMode(){let e=this.seams.mapTheme()??i.groundFor(this.mode);this.seams.applyMapTheme(e??null)&&this.seams.changed()}watchMode(){this.watch?.(),this.watch=null,this.mode==="auto"&&(this.watch=zn(()=>this.applyThemeMode()))}setViewportInsets(e){this.seams.applyViewportInsets(e),this.seams.changed()}viewportInsets(){return this.seams.readViewportInsets()}dispose(){this.watch?.(),this.watch=null}};var yl=require("@seatlayer/core"),vl=require("@seatlayer/core/core/seatConfidence");var bl=require("@seatlayer/core");function Ti(i){let e=i.viewMeta?.previewUrl??i.viewUrl;return e&&(mr(e)||si(e))?e:null}function ho(i){if(!i)return!1;let e=i.floors?.length?i.floors.map(t=>t.objects??[]):[i.objects??[]];for(let t of e)for(let n of t)if(n.type==="shape"&&(n.role==="stage"||n.stageKind))return!0;return!1}var mu=512,po=new Map;function uo(i,e){if(!e)return null;let t=`${i.id}|${Math.round(e.x)},${Math.round(e.y)}`,n=po.get(t);if(n!==void 0)return n;let o=null;try{o=(0,bl.generateSeatThumb)(i,e).distanceM??null}catch{o=null}return po.size>=mu&&po.clear(),po.set(t,o),o}function rn(i){return i.getFocusedSection()!==null||i.seatsRevealed()}function fu(i){let e=i.atVenueFit?.(),t=i.canZoomIn?.();return{...typeof e=="boolean"?{atVenueFit:e}:{},...typeof t=="boolean"?{canZoomIn:t}:{}}}function gu(i,e){return{accessibilityFilter:i.length>0,limitedViewFilter:e.some(t=>t.commercial?.restrictedView||t.commercial?.obstructedView)}}function bu(i,e,t,n){for(let o of e){if(o.count<=0)continue;let r=i.accessibilitySpread?.([o.key]);for(let s of r?.sections??[]){let a=t.get(s.id)??n.get(s.id);if(!a||s.free<=0)continue;let l=a.accessibleFree??(a.accessibleFree={});l[o.key]=s.free}}}function wl(i,e,t){let n=i.doc,o=n?.theme??{},r=i.categoryAvailability(),s=i.getGAAreas(),a=i.getFloors(),l=i.getExpandedSeats(),c=i.getAccessNeeds(),d=gu(c,l),p=e.seatPosition,u=p.targetSeatId?i.seatDetails(p.targetSeatId):null,h=new Map(l.map(v=>[v.id,v])),b=ho(n),g=n?.floors?.flatMap(v=>v.objects)??n?.objects??[],T=new Map,w=new Map;for(let v of g){if(v.type!=="section")continue;let M={id:v.id,label:v.label,...v.displayLabel?{displayLabel:v.displayLabel}:{},...v.zone?{zoneId:v.zone}:{}};T.set(v.id,M);let F=v.logicalSectionId??v.id;w.has(F)||w.set(F,M)}return bu(i,c,T,w),{event:{key:t.event,name:t.eventInfo?.name??n?.name??t.event,venue:t.eventInfo?.venue??null,startsAt:t.eventInfo?.startsAt??null,timezone:t.eventInfo?.timezone??null,currency:t.eventInfo?.currency??t.currency??"USD",locale:(0,yl.getLocale)()||t.eventLocale,posterUrl:t.eventInfo?.posterUrl??null,mode:t.mode_??"live",salesClosed:t.eventInfo?.salesClosed??!1},branding:{...o.accent?{accent:o.accent}:{},...o.accentInk?{accentInk:o.accentInk}:{},...o.background?{background:o.background}:{},...o.textColor?{textColor:o.textColor}:{},...o.brandName?{brandName:o.brandName}:{},...o.logoUrl?{logoUrl:o.logoUrl}:{},attributionRequired:!o.hideBadge},features:{ga:s.length>0,tiers:!!n?.categories.some(v=>v.tiers?.length),floors:a.length>1,zones:!!n?.zones?.length,sections:T.size>0,bestAvailable:!0,...d,venue3d:e.canOffer3D(),seatView:e.canOfferSeatView()},catalog:{categories:(n?.categories??[]).filter(v=>!v.notForSale).map(v=>({key:v.key,label:v.label,color:v.color,price:jt(t.hostPrices_,v.key,null,v.price??v.tiers?.[0]?.price??0),available:r[v.key]??0,...Object.prototype.hasOwnProperty.call(r,v.key)?{free:r[v.key]}:{},tiers:(v.tiers??[]).map(M=>({id:M.id,name:M.name,price:jt(t.hostPrices_,v.key,M.id,M.price),...M.currency?{currency:M.currency}:{}}))})),zones:(n?.zones??[]).map(v=>({id:v.id,label:v.label,...v.color?{color:v.color}:{}})),sections:[...T.values()],gaAreas:s,bestAvailableZones:i.getBestAvailableZones()},map:{floors:a,activeFloorId:i.getActiveFloorId()||a[0]?.id||null,floorMode:i.isFloorOverview()?"all":"single",floorLabelStyle:i.getRenderer()?.getFloorLabelStyle?.()??"number",rung:i.getRung(),canZoomOut:rn(i)||t.focusedSection_!==null,...fu(i),focusedSectionId:i.getFocusedSection(),focusedSection:t.focusedSection_,viewMode:i.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:i.getViewportInsets(),categoryFilter:t.categoryFilter_?[...t.categoryFilter_]:null,accessibilityFilter:t.accessibilityFilter_?[...t.accessibilityFilter_]:null,hideLimitedView:t.hideLimitedView_,accessNeeds:c},selection:{seats:i.getSelection().map(v=>{let M=t.hostPrices_?{...v,price:jt(t.hostPrices_,v.categoryKey,v.tierId,v.price)}:v,F=h.get(M.id);if(!F)return M;let X=i.worldToScreen({x:F.x,y:F.y}),f=Ti(F),O=b?uo(F,F.focalPoint??n?.focalPoint):null;return{...M,screenPoint:{x:X.x,y:X.y},...f?{seatViewThumb:{reference:f,kind:"real"}}:{},...O!=null?{sightlineMetres:O}:{},...F.confidenceEvidence?{seatViewConfidence:(0,vl.seatConfidenceDisclosure)(F.confidenceEvidence)}:{}}}),validity:i.getSelectionValidity(),maxSelection:t.maxSelection_},access:{...t.accessState_}}}var yu="https://api.seatlayer.io",xl=10;function vu(i){if(typeof i=="string"){let e=document.querySelector(i);if(!e)throw new Error(`seatmap: container "${i}" not found`);return e}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}var mo=class{constructor(e){this.renderErrorEmitted=!1;this.mount=null;this.hostEl=null;this.interactionEnabled_=!0;this.eventLocale=null;this.localeGeneration=0;this.languageSelect=null;this.rendered=!1;this.mode_=null;this.eventInfo=null;this.categoryFilter_=null;this.accessibilityFilter_=null;this.hideLimitedView_=!1;this.focusedSection_=null;this.lastReportedViewRung_=null;this.lastReportedCanZoomOut_=!1;this.tipEl=null;this.tipPos={x:0,y:0};this.onTipMove=null;this.blockedRegions=null;this.realtime=null;this.holdingLabels=new Set;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.container)throw new Error("seatmap: `container` is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");this.opts=e,this.maxSelection_=e.maxSelection??xl,this.colorblindSafe_=e.colorblindSafe??!1,this.hostPrices_=e.pricing?.prices;let t=!!(e.buyerAccessTokenProvider||e.buyerAccessToken||e.publicKey);this.accessState_={configured:t,status:t?"ready":"public"},this.publicKey=e.publicKey;let n={onExpired:a=>{this.accessState_={configured:!0,status:a.refreshed?"ready":"expired"},this.opts.onAccessExpired?.(a),this.notifyMapStateChange()},onUnavailable:a=>{this.accessState_={configured:!0,status:"unavailable",reason:a.reason},this.opts.onAccessUnavailable?.(a),this.notifyMapStateChange()}},o=(e.apiBase??yu).replace(/\/+$/,"");this.apiBase=o;let r=e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Qn({base:o,event:e.event,publicKey:e.publicKey,accessHooks:n,apiOptions:{onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=r?.access??gi(e,n);let s=r?.api??new ft(o,{access:this.access??void 0,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)});this.api=s,this.chartFetch=qn(s),this.controller=new ae.PickerController({transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxSelection_,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.hostPriceRanges(),onSelectionChange:a=>{this.immersive?.pushLiveState(),this.opts.onSelectionChange?.(a)},onSelectionValidityChange:a=>this.opts.onSelectionValidityChange?.(a),onSelectionValid:a=>this.opts.onSelectionValid?.(a),onSelectionInvalid:a=>this.opts.onSelectionInvalid?.(a),onDeselect:a=>{this.controller.currentHold()?.labels.includes(a.label)&&this.controller.releaseLabels([a.label])},retapKeepsSelection:!0,onSeatRetap:a=>this.opts.onSeatRetap?.(a),onSelectionLimit:a=>this.opts.onSelectionLimit?.(a),onHold:a=>this.opts.onHold?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldRestored:a=>this.opts.onHoldRestored?.({holdId:a.holdId,expiresAt:a.expiresAt,seats:a.seats,items:a.items}),onHoldExpired:()=>this.opts.onHoldExpired?.(),onGAClick:a=>{let l=this.controller.getGAAreas().find(c=>c.id===a);l&&(this.opts.onGAClick?.(l),this.opts.onGAPrompt?.(Xa(l,{room:(this.opts.maxSelection??xl)-this.controller.getSelection().length,wheelchairOnly:this.controller.getAccessibilityFilter()?.includes("wheelchair")===!0,hold:(c,d)=>{this.holdGA(l.id,c,d?{tierId:d}:{})}})))},onError:a=>{this.renderErrorEmitted=!0,this.opts.onError?.(a)},onDeckTap:a=>{this.opts.onDeckTap?.(a),this.notifyMapStateChange()},onHint:a=>this.opts.onHint?.(a),onSectionFocus:a=>{this.focusedSection_=a,this.opts.onSectionFocus?.(a),this.notifyMapStateChange()},onViewChange:()=>this.handleViewChange(),onStatusChange:()=>{this.immersive?.pushLiveState(),this.opts.onStatusChange?.()},onSalesClosed:()=>{this.eventInfo&&(this.eventInfo.salesClosed=!0),this.opts.onSalesClosed?.()},flashOnLiveChange:!0,onSeatHover:a=>{this.opts.onSeatHover?.(a),this.opts.seatTooltip!==!1&&this.updateTooltip(a)},colorblindSafe:e.colorblindSafe,mapTheme:e.mapTheme??on.groundFor(e.theme?.mode)??null}),this.hostSurface=new on({mapTheme:()=>this.opts.mapTheme,setHostMapTheme:a=>{this.opts.mapTheme=a},applyMapTheme:a=>this.controller.setMapTheme(a),applyViewportInsets:a=>this.controller.setViewportInsets(a),readViewportInsets:()=>this.controller.getViewportInsets(),changed:()=>this.notifyMapStateChange()},e.theme?.mode??null),this.buyerAssetUrls=new ki(e.event,(a,l)=>s.asset(a,l)),this.immersive=new so({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_=rn(this.controller)}handleViewChange(){this.opts.onViewChange?.();let e=this.controller.getRung(),t=rn(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_=rn(this.controller),this.opts.onMapStateChange?.()}async render(){if(this.rendered)return this;let e=performance.now();this.rendered=!0;let t=jn(this.opts.locale,this.opts.messages),n=this.localeGeneration+=1,o=(0,ae.getLocale)();this.mount=vu(this.opts.container);let r=document.createElement("div");r.style.width="100%",r.style.height="100%",r.style.position="relative",this.mount.appendChild(r),this.hostEl=r,this.blockedRegions?.attach(r),Kn(r,t,a=>{a!==o&&this.applyActiveLocale(a,n)}),this.applyInteractionState(),this.renderErrorEmitted=!1;let s=await this.controller.render(r);if(!s){let a=Wn(this.chartFetch?.outcome(),this.renderErrorEmitted);return a&&Yn({apiBase:this.apiBase,eventKey:this.opts.event,reason:a}),Qe({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"failure",stage:"load_chart",ms:performance.now()-e,load:ot(this.opts.event),transport:"pubapi"}),this.rendered=!1,this.opts.errorDisplay!=="none"&&this.showLoadFailure(r),this}if(this.eventLocale=s.locale??null,!this.opts.locale&&this.eventLocale&&this.setLocale(this.eventLocale),this.buildLanguageSwitcher(r),this.controller.setViewMode(this.opts.initialView??"flat"),this.opts.floorLabelStyle&&this.setFloorLabelStyle(this.opts.floorLabelStyle),this.startRealtime(),this.mode_=s.mode==="test"?"test":"live",this.eventInfo={name:s.eventName,venue:s.venue??null,startsAt:s.startsAt??null,timezone:s.timezone??null,currency:s.currency??this.opts.currency??"USD",posterUrl:s.posterUrl??null,salesClosed:s.salesClosed},this.opts.seatTooltip!==!1){let 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);',r.appendChild(a),this.tipEl=a,this.onTipMove=l=>{let c=r.getBoundingClientRect();this.tipPos={x:l.clientX-c.left,y:l.clientY-c.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()},r.addEventListener("mousemove",this.onTipMove)}if(s.mode==="test"&&this.opts.showTestModeIndicator!==!1){r.style.overflow="hidden";let a=document.createElement("div");a.dataset.slI18n="testMode",a.textContent=(0,ae.t)("picker.testMode"),a.setAttribute("aria-label",(0,ae.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;",r.appendChild(a)}return this.buildBadge(r),Qe({apiBase:this.apiBase,event:this.opts.event,scope:"event",surface:"seating_chart",outcome:"success",ms:performance.now()-e,performanceProfile:s.performanceProfile,seats:this.controller.getExpandedSeats().length,floors:this.controller.getFloors().length,view:"map",load:En(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,ae.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 n=document.createElement("span");n.setAttribute("aria-hidden","true"),n.style.cssText="width:16px;height:16px;border-radius:4px;flex:none;display:flex;align-items:center;justify-content:center;background:#0c1220;color:#fcf7ee",n.innerHTML=io;let o=document.createElement("span");o.textContent=(0,ae.t)("picker.poweredBy"),t.append(n,o),e.appendChild(t)}placeTooltip(){if(!this.tipEl||!this.hostEl)return;let e=this.hostEl.clientWidth,t=this.tipEl.offsetWidth,n=this.tipEl.offsetHeight,o=this.tipPos.x+14,r=this.tipPos.y-n-12;o+t>e-8&&(o=this.tipPos.x-t-14),r<8&&(r=this.tipPos.y+18),this.tipEl.style.left=`${Math.max(8,o)}px`,this.tipEl.style.top=`${Math.max(8,r)}px`}updateTooltip(e){if(!this.tipEl)return;if(!e){this.tipEl.style.display="none";return}let t=(0,ae.formatMoney)(e.price,e.currency,{...Number.isInteger(e.price)?{minimumFractionDigits:0,maximumFractionDigits:0}:{},locale:this.opts.locale,fallback:(l,c)=>`${l} ${c}`}),n=document.createElement("div");n.style.cssText="font-weight:700;font-size:13px",n.textContent=e.label;let o=document.createElement("div");o.style.cssText="display:flex;align-items:center;gap:6px;margin-top:4px;color:#c7cddc";let r=document.createElement("span");r.style.cssText="width:9px;height:9px;border-radius:50%;flex:none",r.style.background=e.categoryColor;let s=document.createElement("span");s.textContent=e.categoryLabel;let a=document.createElement("span");if(a.style.cssText="margin-left:auto;font-weight:700;color:#fff",a.textContent=t,o.append(r,s,a),this.tipEl.replaceChildren(n,o),e.status!=="free"){let l=document.createElement("div");l.style.cssText="margin-top:5px;font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#fca5a5;font-weight:700",l.textContent=e.status==="held"?(0,ae.t)("map.statusHeld"):(0,ae.t)("map.statusTaken"),this.tipEl.appendChild(l)}this.tipEl.style.display="block",this.placeTooltip()}buildLanguageSwitcher(e){let t=(this.opts.languages??[]).map(o=>(0,ae.resolveLocale)(o)).filter((o,r,s)=>s.indexOf(o)===r);if(t.length<2)return;let n=document.createElement("select");n.setAttribute("aria-label",(0,ae.t)("picker.preferredTicketType")),n.style.cssText='position:absolute;bottom:10px;left:12px;z-index:5;appearance:none;padding:5px 9px;border-radius:999px;border:0;cursor:pointer;background:rgba(255,255,255,.92);color:#4a5163;font:600 11px/1 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(0,0,0,.12);';for(let o of t){let r=document.createElement("option");r.value=o,r.textContent=ae.LOCALE_NAMES[o]??o,r.selected=o===(0,ae.getLocale)(),n.appendChild(r)}n.addEventListener("change",()=>{this.setLocale(n.value)}),e.appendChild(n),this.languageSelect=n}async setLocale(e){let t=(0,ae.getLocale)(),n=this.localeGeneration+=1,o=await(0,ae.loadLocale)(e);return this.opts.messages&&(0,ae.setStringOverrides)(this.opts.messages),o===t||this.applyActiveLocale(o,n),o}applyActiveLocale(e,t){if(t!==this.localeGeneration)return;let n=this.hostEl;if(n){n.lang=e,n.dir=(0,ae.localeDirection)(e);for(let o of n.querySelectorAll("[data-sl-i18n]"))if(o.dataset.slI18n==="testMode")o.textContent=(0,ae.t)("picker.testMode"),o.setAttribute("aria-label",(0,ae.t)("picker.testMode"));else if(o.dataset.slI18n==="badge"){o.setAttribute("aria-label",(0,ae.t)("picker.poweredBy"));let r=o.querySelector("span:last-child");r&&(r.textContent=(0,ae.t)("picker.poweredBy"))}this.languageSelect&&this.languageSelect.value!==e&&(this.languageSelect.value=e),this.controller.refreshMapCopy()}}getMode(){return this.mode_}getPickerState(){return wl(this.controller,this.immersive,{event:this.opts.event,currency:this.opts.currency,mode_:this.mode_,eventInfo:this.eventInfo,eventLocale:this.eventLocale,focusedSection_:this.focusedSection_,colorblindSafe_:this.colorblindSafe_,categoryFilter_:this.categoryFilter_,accessibilityFilter_:this.accessibilityFilter_,hideLimitedView_:this.hideLimitedView_,maxSelection_:this.maxSelection_,accessState_:this.accessState_,hostPrices_:this.hostPrices_})}getHostPrices(){return this.hostPrices_}getCategoryAvailability(){return this.controller.categoryAvailability()}getBestAvailableZones(){return this.controller.getBestAvailableZones()}getActiveFloorId(){return this.controller.getActiveFloorId()||null}getRung(){return this.controller.getRung()}getFocusedSection(){return this.controller.getFocusedSection()}focusSection(e){if(this.immersive.buyerView==="venue3d"&&this.immersive.focusSection(e)){this.notifyMapStateChange();return}this.controller.focusSection(e),this.notifyMapStateChange()}overview(){if(this.immersive.focusOverview()){this.notifyMapStateChange();return}this.controller.overview(),this.notifyMapStateChange()}setRung(e){this.controller.setRung(e),this.notifyMapStateChange()}setCategoryFilter(e,t=!1){this.categoryFilter_=e?[...e]:null,this.controller.setCategoryFilter(e),t&&this.controller.focusCategoryFilter(e),this.notifyMapStateChange()}setAccessibilityFilter(e){this.accessibilityFilter_=e?[...e]:null,this.controller.setAccessibilityFilter(e),this.notifyMapStateChange(),e?.length&&this.focusAccessibilityFilter()}focusAccessibilityFilter(){this.controller.focusAccessibilityFilter?.(),this.notifyMapStateChange()}focusNextAccessibleSection(e){let t=this.controller.focusNextAccessibleSection?.(e)??null;return t&&this.notifyMapStateChange(),t}setCommercialLimitedFilter(e){this.hideLimitedView_=e,this.controller.setCommercialLimitedFilter(e),this.notifyMapStateChange()}getSelection(){return this.controller.getSelection()}selectObjects(e){let t=this.controller.select(e);return this.immersive.pushLiveState(),t}deselectObjects(e){this.controller.deselect(e),this.immersive.pushLiveState()}clearSelection(){this.controller.clearSelection(),this.immersive.pushLiveState()}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxSelection_=e,this.controller.setMaxSelection(e),this.notifyMapStateChange()}getSelectionValidity(){return this.controller.getSelectionValidity()}async hold(e={}){try{return await this.holdOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async holdOrThrow(e={}){let t=this.controller.getSelectionValidity();if(t&&!t.isValid){let n=t.violations.includes("numberOfPlacesToSelect");throw Object.assign(new Error(n?`seatmap: select exactly ${t.required} places before holding`:"seatmap: adjust the ticket selection before holding"),{code:n?"selection_count_mismatch":"selection_invalid",selection:t})}this.holdingLabels=new Set(this.controller.getSelection().map(n=>n.label));try{let n=await this.controller.hold(void 0,e.ttlMs);return n?{holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items}:null}finally{this.holdingLabels.clear()}}async resumeHold(e){try{return await this.resumeHoldOrThrow(e)}catch(t){return this.opts.onError?.(t),null}}async resumeHoldOrThrow(e){let t=await this.controller.resumeHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}async extendHold(e){try{let t=await this.controller.extendHold(e);return t?{holdId:t.holdId,expiresAt:t.expiresAt,seats:t.seats,items:t.items}:null}catch(t){return this.opts.onError?.(t),null}}getCurrentHold(){let e=this.controller.currentHold();return e?{holdId:e.holdId,expiresAt:e.expiresAt,seats:e.seats,items:e.items}:null}getGAAreas(){return this.controller.getGAAreas()}async holdGA(e,t,n={}){try{return await this.holdGAOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async holdGAOrThrow(e,t,n={}){let o=await this.controller.holdGA(e,t,n);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}async bestAvailable(e,t,n={}){try{return await this.bestAvailableOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async bestAvailableOrThrow(e,t,n={}){let o=Bn(this.controller,t);if(o)throw o;let r=await this.controller.bestAvailable(e,t,n);return ul(this.controller,r),r?{holdId:r.holdId,expiresAt:r.expiresAt,labels:r.labels,seats:r.seats,items:r.items,...n.zoneId?{zoneId:n.zoneId}:{}}:null}setSeatTier(e,t){this.controller.setSeatTier(e,t)}setTableQuantity(e,t){return this.controller.setTableQuantity(e,t)}async replaceTableQuantity(e,t,n){try{return await this.replaceTableQuantityOrThrow(e,t,n)}catch(o){return this.opts.onError?.(o),null}}async replaceTableQuantityOrThrow(e,t,n){let o=await this.controller.replaceTableQuantity(e,t,n);return o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}getFloors(){return this.controller.getFloors()}setFloor(e){if(this.immersive.buyerView==="venue3d"&&e!=="all"&&this.immersive.focusFloor(e)){this.notifyMapStateChange();return}if(this.controller.getFloors().length<=1){console.warn("seatmap: setFloor() ignored \u2014 this chart has a single floor");return}e==="all"?this.controller.setFloorOverview(!0):this.controller.setFloor(e),this.notifyMapStateChange()}setFloorLabelStyle(e){this.controller.getRenderer()?.setFloorLabelStyle?.(e),this.notifyMapStateChange()}setSectionFocusDim(e){this.controller.setSectionFocusDim(e)}setSelectionFocus(e){this.controller.setSelectionFocus(e)}setBlockedRegions(e){if(!this.blockedRegions){if(!e.length)return;this.blockedRegions=new co,this.hostEl&&this.blockedRegions.attach(this.hostEl)}this.blockedRegions.set(e)}getBlockedRegions(){return this.blockedRegions?.get()??[]}frameSeat(e,t={}){let n=this.controller.getRenderer();return gl({seatPoint:o=>{let r=this.controller.getExpandedSeats().find(s=>s.id===o);return r?this.controller.worldToScreen({x:r.x,y:r.y}):null},mapHeight:()=>this.hostEl?.clientHeight??0,insets:()=>this.controller.getViewportInsets(),gestureCount:()=>n?.getCameraGestureCount?.()??0,panScreenBy:(o,r)=>n?.panScreenBy?(n.panScreenBy(o,{animate:r}),!0):!1},e,t)}setPricing(e){let t=e?.prices&&Object.keys(e.prices).length?e.prices:void 0;JSON.stringify(t??null)!==JSON.stringify(this.hostPrices_??null)&&(this.hostPrices_=t,this.controller.getRenderer()?.setCategoryPriceRanges?.(this.hostPriceRanges()),this.notifyMapStateChange())}hostPriceRanges(){let e=this.hostPrices_;if(e)return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(t=>{let n=t.tiers?.length?t.tiers.map(o=>jt(e,t.key,o.id,o.price)):t.price==null?[]:[jt(e,t.key,null,t.price)];return n.length?[[t.key,{min:Math.min(...n),max:Math.max(...n)}]]:[]}))}setColorblindSafe(e){this.colorblindSafe_=e,this.controller.setColorblindSafe(e),this.notifyMapStateChange()}setViewMode(e){this.controller.setViewMode(e),this.notifyMapStateChange()}getViewMode(){return this.controller.getViewMode()}zoomIn(){this.immersive.zoomIn()||(this.controller.zoomIn(),this.notifyMapStateChange())}zoomOut(){this.immersive.zoomOut()||(this.controller.zoomOut(),this.notifyMapStateChange())}zoomToFit(){this.immersive.focusOverview()||(this.controller.zoomToFit(),this.notifyMapStateChange())}setThemeMode(e,t){this.hostSurface.setThemeMode(e,t)}getThemeMode(){return this.hostSurface.themeMode()}setViewportInsets(e){this.hostSurface.setViewportInsets(e)}getViewportInsets(){return this.hostSurface.viewportInsets()}setBuyerView(e,t){return this.immersive.setBuyerView(e,t)}getBuyerView(){return this.immersive.buyerView}openSeatView(e){return this.immersive.openSeatView(e)}setVenue3DNavigationMode(e){if(!this.immersive.setNavigationMode(e))throw new Error("venue_3d_not_active")}setInteractionEnabled(e){this.interactionEnabled_=e,this.applyInteractionState()}applyInteractionState(){let e=this.hostEl;e&&(e.style.pointerEvents=this.interactionEnabled_?"":"none",e.toggleAttribute("inert",!this.interactionEnabled_),this.interactionEnabled_?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true"))}async release(){await this.controller.release()}async releaseLabels(e){return this.controller.releaseLabels(e)}startRealtime(){!this.access?.configured||this.realtime||(this.realtime=new Ze({url:this.api.subscribeUrl(this.opts.event),mintTicket:()=>this.api.subscribeTicket(this.opts.event),onAccessUnavailable:e=>this.opts.onAccessUnavailable?.(e),sink:ri(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.immersive.pushLiveState(),this.opts.onStatusChange?.()},onSelectedObjectUnavailable:(e,t)=>this.opts.onSelectedObjectUnavailable?.({labels:e,reason:t})})}),this.realtime.start())}async refreshAvailability(){let e=await this.controller.refreshAvailability();return this.immersive.pushLiveState(),this.opts.onStatusChange?.(),e.lost.length&&this.opts.onSelectedObjectUnavailable?.({labels:e.lost,reason:"taken"}),this.notifyMapStateChange(),e}async refreshAccess(){if(!this.access?.configured)return!1;let e=await this.access.refresh("manual");return e&&(this.accessState_={configured:!0,status:"ready"},await this.controller.refresh(),this.realtime?.restart(),this.realtime||this.startRealtime()),this.notifyMapStateChange(),e}showLoadFailure(e){let t=document.createElement("div");t.setAttribute("role","status"),t.style.cssText='display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;height:100%;min-height:180px;box-sizing:border-box;padding:24px;text-align:center;font:500 14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#3b4256;';let n=document.createElement("div");n.textContent="The seat map didn\u2019t load.",t.appendChild(n);let o=document.createElement("button");o.type="button",o.textContent="Try again",o.style.cssText="appearance:none;border:1px solid #c9cede;background:#fff;color:#10162a;border-radius:8px;padding:8px 16px;font:600 13px/1 inherit;cursor:pointer;",o.addEventListener("click",()=>{this.destroy(),this.render().catch(r=>this.opts.onError?.(r))}),t.appendChild(o),e.appendChild(t)}destroy(){this.blockedRegions?.detach(),this.hostSurface.dispose(),this.immersive.destroy(),this.buyerAssetUrls.dispose(),this.realtime?.stop(),this.realtime=null,this.access?.clear(),this.hostEl&&this.onTipMove&&this.hostEl.removeEventListener("mousemove",this.onTipMove),this.tipEl=null,this.onTipMove=null,this.languageSelect=null,this.controller.destroy(),this.hostEl&&this.hostEl.parentNode&&this.hostEl.parentNode.removeChild(this.hostEl),this.hostEl=null,this.mount=null,this.rendered=!1,this.mode_=null,this.eventInfo=null,this.focusedSection_=null}};var yr=["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"],wu={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 kl(i){let e={};for(let t of yr)e[t]=(...n)=>{let o=i();return o?o[t](...n):wu[t]()};return e}var vr=["event","apiBase","maxSelection","numberOfPlacesToSelect","selectionValidators","publicKey","locale","currency","colorblindSafe","initialView","errorDisplay"],wr=[...vr,"selectedObjects","selectableObjects","messages","seatTooltip","buyerAccessTokenProvider","buyerAccessToken"],xr=["onSelectionChange","onSelectionValidityChange","onSelectionValid","onSelectionInvalid","onSelectionLimit","onHold","onHoldRestored","onHoldExpired","onGAClick","onGAPrompt","onError","onDeckTap","onHint","onSeatHover","onAccessExpired","onAccessUnavailable","onSelectedObjectUnavailable"];function Sl(i,e,t){let n={container:i};for(let o of wr)n[o]=e[o];for(let o of xr)n[o]=t[o];return n}var xu=new Set(["seatlayer.designer.ready","seatlayer.designer.saved","seatlayer.designer.published","seatlayer.designer.close","seatlayer.designer.error"]),ku=2e4,Su=0,Tu=180*1e3,Eu=900*1e3,Cu=.8,Au=30*1e3,Pu=1e5,Mu=4,Lu=50;function kr(i){if(typeof i!="string")return i;let e=document.querySelector(i);if(!e)throw new Error(`EmbeddedDesigner container not found: ${i}`);return e}function Hu(i){let e=(i??"").toLowerCase();return e.includes("expire")||e.includes("revoke")||e==="401"?"expired":e.includes("mismatch")?"mismatch":e.includes("timeout")?"timeout":"load"}var Ru={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."}},fo=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"||!xu.has(t.type))return;let n={type:t.type,chartId:typeof t.chartId=="string"?t.chartId:void 0,workspaceId:typeof t.workspaceId=="string"?t.workspaceId:void 0,expiresAt:typeof t.expiresAt=="number"?t.expiresAt:void 0,code:typeof t.code=="string"?t.code:void 0,message:typeof t.message=="string"?t.message:void 0,meta:t.meta,fatal:typeof t.fatal=="boolean"?t.fatal:void 0,action:typeof t.action=="string"?t.action:void 0},o=this.identityEstablished||n.type==="seatlayer.designer.ready"||n.type==="seatlayer.designer.saved"||n.type==="seatlayer.designer.published"||n.type==="seatlayer.designer.close",r=this.options.expectedChartId!==void 0&&n.chartId!==this.options.expectedChartId&&(o||n.chartId!==void 0),s=this.options.expectedWorkspaceId!==void 0&&n.workspaceId!==this.options.expectedWorkspaceId&&(o||n.workspaceId!==void 0);if(r||s){this.showError("mismatch");return}switch(n.type){case"seatlayer.designer.ready":this.identityEstablished=!0,this.sessionExpiresAt=n.expiresAt,this.phase="ready",this.clearTimeoutTimer(),this.removeOverlay(),this.autoRecoverUsed=!1,this.scheduleRenewal(n.expiresAt),this.options.onReady?.(n);break;case"seatlayer.designer.saved":this.options.onSaved?.(n);break;case"seatlayer.designer.published":this.options.onPublished?.(n);break;case"seatlayer.designer.close":this.options.onClose?.(n);break;case"seatlayer.designer.error":{let a=Hu(n.code);if(a==="expired"&&this.autoRenewEnabled()&&!this.autoRecoverUsed){this.autoRecoverUsed=!0,this.clearRenewTimer(),this.options.onRequestRelaunch();return}(typeof n.fatal=="boolean"?n.fatal:a!=="load"||this.phase!=="ready")&&this.showError(a),this.options.onError?.(n);break}}};this.options=e}mount(){this.destroy();let e=new URL(this.options.designerUrl,window.location.href);if(e.protocol!=="https:"&&e.hostname!=="localhost"&&e.hostname!=="127.0.0.1")throw new Error("EmbeddedDesigner requires an HTTPS designerUrl outside local development.");this.designerOrigin=e.origin;let t=document.createElement("iframe");t.title=this.options.title??"Venue chart Designer",t.allow=this.options.allow??"fullscreen; clipboard-write",t.referrerPolicy=this.options.referrerPolicy??"origin",t.src=e.toString(),t.style.setProperty("width","100%","important"),t.style.setProperty("height",typeof this.options.height=="number"?`${this.options.height}px`:"100%","important"),t.style.border="0",Object.assign(t.style,this.options.style),this.options.className&&(t.className=this.options.className);let n=kr(this.options.container);if(this.containerEl=n,window.addEventListener("message",this.handleMessage),n.append(t),this.frame=t,this.fillEnabled()&&this.startFill(),this.phase="loading",this.loadingStateEnabled()){this.ensureContainerPositioned(n),this.renderOverlay(n,"loading");let o=this.options.loadingTimeoutMs??ku;o>0&&Number.isFinite(o)&&(this.timeoutTimer=setTimeout(()=>{this.phase==="loading"&&this.showError("timeout")},o))}return t}setDesignerUrl(e){return this.options={...this.options,designerUrl:e},this.mount()}getIframe(){return this.frame}setSizing(e,t){this.options={...this.options,height:e,minHeight:t},this.frame&&(this.stopFill(),this.lastAutoHeight="",this.fillEnabled()?(this.pinned||this.setFrameHeight("100%"),this.startFill()):this.pinned||this.setFrameHeight(`${e}px`))}setRelaunchPolicy(e,t){this.options={...this.options,onRequestRelaunch:e,autoRenewSession:t},this.clearRenewTimer(),this.phase==="ready"&&this.scheduleRenewal(this.sessionExpiresAt)}destroy(){window.removeEventListener("message",this.handleMessage),this.stopFill(),this.unpinFullscreen(),this.clearTimeoutTimer(),this.clearRenewTimer(),this.removeOverlay(),this.restoreContainerStyle(),this.frame?.remove(),this.frame=null,this.containerEl=null,this.fillMode=null,this.designerOrigin="",this.phase="loading",this.identityEstablished=!1,this.sessionExpiresAt=void 0,this.lastAutoHeight=""}loadingStateEnabled(){return this.options.showLoadingState!==!1}autoResizeEnabled(){return this.options.autoResize!==!1}fillEnabled(){return typeof this.options.height!="number"}setFrameHeight(e){this.frame?.style.setProperty("height",e,"important")}detectFillMode(){let e=this.containerEl,t=this.frame;if(this.pinned||!e||!t)return this.fillMode??"viewport";let n=()=>e.getBoundingClientRect().height,o=t.style.getPropertyValue("height"),r=t.style.getPropertyPriority("height");t.style.setProperty("height","0px","important");let s=n();t.style.setProperty("height",`${Pu}px`,"important");let a=n();return o?t.style.setProperty("height",o,r):t.style.removeProperty("height"),!(a-s>Mu)&&s>=Lu?"container":"viewport"}applyFill(){if(!this.frame||this.pinned)return;let e=this.options.minHeight??Su;if(this.fillMode==="container"&&this.containerEl){let o=getComputedStyle(this.containerEl),r=["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"].reduce((a,l)=>a+(parseFloat(o[l])||0),0),s=Math.max(e,Math.floor(this.containerEl.getBoundingClientRect().height-r));this.setFrameHeight(`${s}px`);return}let t=this.frame.getBoundingClientRect().top,n=Math.max(e,Math.round(window.innerHeight-t));this.setFrameHeight(`${n}px`)}syncContainerObserver(){let e=this.fillMode==="container"&&!!this.containerEl&&typeof ResizeObserver<"u";e&&!this.resizeObs?(this.resizeObs=new ResizeObserver(()=>this.scheduleFill()),this.resizeObs.observe(this.containerEl)):!e&&this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null)}startFill(){this.fillMode=this.detectFillMode(),this.syncContainerObserver(),this.applyFill(),!this.fillListening&&(this.fillListening=!0,window.addEventListener("resize",this.scheduleReprobe),window.addEventListener("orientationchange",this.scheduleReprobe),window.addEventListener("scroll",this.scheduleFill,{passive:!0}))}stopFill(){this.fillRaf!==null&&(cancelAnimationFrame(this.fillRaf),this.fillRaf=null),this.reprobeRaf!==null&&(cancelAnimationFrame(this.reprobeRaf),this.reprobeRaf=null),this.resizeObs&&(this.resizeObs.disconnect(),this.resizeObs=null),this.fillListening&&(this.fillListening=!1,window.removeEventListener("resize",this.scheduleReprobe),window.removeEventListener("orientationchange",this.scheduleReprobe),window.removeEventListener("scroll",this.scheduleFill))}pinFullscreen(){if(this.pinned||!this.frame)return;this.pinned=!0,this.frameStyleBeforeFs=this.frame.getAttribute("style");let e={position:"fixed",top:"0",right:"0",bottom:"0",left:"0",width:"100vw",height:"100vh",margin:"0",border:"0","z-index":"2147483000",background:"#101625"};for(let[n,o]of Object.entries(e))this.frame.style.setProperty(n,o,"important");let t=document.documentElement;this.docOverflowBeforeFs=t.style.overflow,t.style.overflow="hidden",document.body&&(this.bodyOverflowBeforeFs=document.body.style.overflow,document.body.style.overflow="hidden"),this.fsKeyHandler=n=>{n.key==="Escape"&&this.unpinFullscreen()},window.addEventListener("keydown",this.fsKeyHandler)}unpinFullscreen(){this.pinned&&(this.pinned=!1,this.frame&&(this.frameStyleBeforeFs===null?this.frame.removeAttribute("style"):this.frame.setAttribute("style",this.frameStyleBeforeFs),this.fillEnabled()?this.applyFill():this.autoResizeEnabled()&&this.lastAutoHeight?this.setFrameHeight(this.lastAutoHeight):typeof this.options.height=="number"&&this.setFrameHeight(`${this.options.height}px`)),this.frameStyleBeforeFs=null,this.docOverflowBeforeFs!==null&&(document.documentElement.style.overflow=this.docOverflowBeforeFs,this.docOverflowBeforeFs=null),this.bodyOverflowBeforeFs!==null&&document.body&&(document.body.style.overflow=this.bodyOverflowBeforeFs,this.bodyOverflowBeforeFs=null),this.fsKeyHandler&&(window.removeEventListener("keydown",this.fsKeyHandler),this.fsKeyHandler=null))}clearTimeoutTimer(){this.timeoutTimer!==null&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)}autoRenewEnabled(){return!!this.options.onRequestRelaunch&&this.options.autoRenewSession!==!1}clearRenewTimer(){this.renewTimer!==null&&(clearTimeout(this.renewTimer),this.renewTimer=null)}scheduleRenewal(e){if(this.clearRenewTimer(),!this.autoRenewEnabled()||typeof e!="number"||!Number.isFinite(e))return;let t=e-Date.now();if(t<=0)return;let n=t<Eu?t*Cu:t-Tu,o=Math.max(Au,n);this.renewTimer=setTimeout(()=>{this.renewTimer=null,this.autoRenewEnabled()&&this.options.onRequestRelaunch()},o)}ensureContainerPositioned(e){getComputedStyle(e).position==="static"&&(this.restoreContainerPosition=e.style.position,e.style.position="relative")}restoreContainerStyle(){if(this.restoreContainerPosition!==null){try{kr(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=kr(this.options.container)}catch{return}this.renderOverlay(t,"error",e)}handleTryAgain(){if(this.options.onRequestRelaunch){this.options.onRequestRelaunch();return}this.mount()}renderOverlay(e,t,n){this.removeOverlay();let o=document.createElement("div");o.setAttribute("data-seatlayer-designer-overlay",t),o.setAttribute("role",t==="error"?"alert":"status"),o.setAttribute("aria-live","polite"),Object.assign(o.style,{position:"absolute",inset:"0",display:"flex",alignItems:"center",justifyContent:"center",background:t==="loading"?"#f7f8fb":"#101625",color:t==="loading"?"#0c1220":"#e6ebf5",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',zIndex:"2",overflow:t==="error"?"auto":"hidden"}),t==="loading"?this.buildSkeleton(o):this.buildErrorCard(o,n??"load"),e.append(o),this.overlay=o}buildSkeleton(e){let t=document.createElement("style");t.textContent=`
|
|
3533
3541
|
[data-seatlayer-designer-overlay="loading"]{container-type:inline-size}
|
|
3534
3542
|
.sl-designer-skeleton{position:absolute;inset:0;display:flex;flex-direction:column;pointer-events:none}
|
|
3535
3543
|
.sl-designer-skeleton *{box-sizing:border-box}
|
|
@@ -3551,8 +3559,8 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
3551
3559
|
<div class="sl-designer-skeleton-rail" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></div>
|
|
3552
3560
|
<div class="sl-designer-skeleton-canvas"><div class="sl-designer-skeleton-caption"><span class="sl-designer-skeleton-spinner" aria-hidden="true"></span><span>Loading designer\u2026<small>Preparing your floor plan</small></span></div></div>
|
|
3553
3561
|
<div class="sl-designer-skeleton-inspector" aria-hidden="true"><div class="sl-designer-skeleton-bar"></div></div>
|
|
3554
|
-
</div>`,e.append(n)}buildErrorCard(e,t){let n=vu[t],o=document.createElement("div");Object.assign(o.style,{maxWidth:"420px",margin:"auto 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});let r=document.createElement("h2");r.textContent=n.title,Object.assign(r.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let s=document.createElement("p");s.textContent=n.body,Object.assign(s.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),o.append(r,s,a),e.append(o)}};function Ei(i,e){let t=document.createElement("div");t.className="sl-loading-state";let n=document.createElement("div");if(n.setAttribute("role",e.busy?"status":"alert"),n.setAttribute("aria-atomic","true"),e.busy){let s=document.createElement("div");s.className="sl-boot-spin",s.setAttribute("aria-hidden","true"),t.append(s)}let o=document.createElement("div");if(o.className="sl-boot-title",o.textContent=e.title,n.append(o),e.description){let s=document.createElement("p");s.className="sl-loading-description",s.textContent=e.description,n.append(s)}t.append(n);let r=null;return e.actionLabel&&(r=document.createElement("button"),r.type="button",r.className="sl-boot-retry",r.textContent=e.actionLabel,t.append(r)),i.replaceChildren(t),r}function wu(i){let{viewportWidth:e,viewportHeight:t,offsetTop:n,offsetLeft:o,clientWidth:r,clientHeight:s,innerHeight:a,largeViewportHeight:l}=i;if(![e,t,n,o].every(Number.isFinite)||e<=0||t<=0)return null;let c=Number.isFinite(r)&&r>0?r:e,d=Number.isFinite(s)&&s>0?s:t,p=n;return Number.isFinite(l)&&a>l+1&&d<l-1&&(p=Math.max(p,l-d)),{width:Math.min(e,c),height:Math.min(t,d),top:p,left:o}}function yl(i){let e=window.visualViewport;if(!e)return()=>{};let t=document.createElement("div");t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",visibility:"hidden",pointerEvents:"none",width:"0",height:"100lvh",overflow:"hidden"}),document.body.appendChild(t);let n=()=>{let c=wu({viewportWidth:e.width,viewportHeight:e.height,offsetTop:e.offsetTop,offsetLeft:e.offsetLeft,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight,innerHeight:window.innerHeight,largeViewportHeight:t.getBoundingClientRect().height});c&&Object.assign(i.style,{right:"auto",bottom:"auto",top:`${c.top}px`,left:`${c.left}px`,width:`${c.width}px`,height:`${c.height}px`})},o=0,r=0,s=0,a=()=>{o&&window.cancelAnimationFrame(o),r&&window.cancelAnimationFrame(r),s&&window.clearTimeout(s),o=window.requestAnimationFrame(()=>{o=0,r=window.requestAnimationFrame(()=>{r=0,n()})}),s=window.setTimeout(()=>{s=0,n()},250)},l=()=>{n(),a()};return l(),e.addEventListener("resize",l),e.addEventListener("scroll",l),window.addEventListener("resize",l),window.addEventListener("orientationchange",l),window.addEventListener("pageshow",l),()=>{o&&window.cancelAnimationFrame(o),r&&window.cancelAnimationFrame(r),s&&window.clearTimeout(s),e.removeEventListener("resize",l),e.removeEventListener("scroll",l),window.removeEventListener("resize",l),window.removeEventListener("orientationchange",l),window.removeEventListener("pageshow",l),t.remove()}}function vl(i,e){let t=new Set(["chart","objects","resume","availability"]),n=new Map;return new Proxy(Object.create(i),{get(o,r){let s=i,a=Reflect.get(s,r,s);return typeof a!="function"?a:(n.has(r)||n.set(r,t.has(String(r))?async(...l)=>{let c=await ui(()=>a.apply(s,l),e,()=>{});if(c.outcome==="loaded")return c.value;if(c.outcome==="error")throw c.error;let d=new Error(c.outcome==="timeout"?"request_timeout":"request_cancelled");throw d.name=c.outcome==="timeout"?"TimeoutError":"AbortError",d}:a.bind(s)),n.get(r))}})}var F=require("@seatlayer/core"),Ro=require("@seatlayer/core/view3d/crossfade/panorama");function wl(i){return!!i&&i.clientWidth>0&&i.scrollWidth>i.clientWidth+1}function xu(i){return i.some(e=>wl(e))}var fo="data-fit-gone",ku=12;function Sr(i,e,t=wl){if(!i)return 0;for(let n of e)i.classList.remove(n.cls);if(i.querySelectorAll(`[${fo}]`).forEach(n=>{n.removeAttribute(fo),n.hidden=!1}),i.dataset.fit="0",i.clientWidth<=0||!t(i))return 0;for(let n=0;n<e.length;n+=1){let o=e[n];n>0&&i.classList.remove(e[n-1].cls),i.classList.add(o.cls),i.dataset.fit=String(n+1);let r=o.give?o.give(i):!0;if(!t(i))return n+1;if(o.repeat&&o.give){for(let s=1;r&&s<ku;s+=1)if(r=o.give(i),!t(i))return n+1}}return e.length}function Su(i,e="[data-fit-seg]"){let t=[...i.querySelectorAll(e)].filter(n=>!n.hidden);return t.length<2?!1:xl(t[t.length-1])}function Tu(i,e){let t=i.querySelector(e);return t&&!t.hidden?xl(t):!1}function xl(i){let e=i.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(fo,""),e.hidden=!0),i.setAttribute(fo,""),i.hidden=!0,!0}function Eu(i){if(!i)return!1;let e=(i.getAttribute("aria-label")||i.textContent||"").trim();return e?(i.setAttribute("aria-label",e),i.setAttribute("title",e),!0):!1}function kl(i){if(!i)return 0;let e=i.querySelector(".sl-confirm-cancel"),t=i.querySelector(".sl-confirm-add-t");return Sr(i,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>Eu(e)}],()=>xu([e,t]))}function Sl(i){return Sr(i,[{cls:"sl-fit-notype",give:e=>Tu(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>Su(e),repeat:!0}])}function Tl(i){return i?(i.classList.add("sl-fitpill"),Sr(i,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Cu=["on-sale","low","sold-out","presale","closed"];function rn(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function Tr(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function El(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i,t=e.count,n=e.index;if(typeof n!="number"||!Number.isInteger(n)||n<1||typeof t!="number"||!Number.isInteger(t)||t<n)return;let o=e.remaining;if(o!=null&&(typeof o!="number"||!Number.isInteger(o)||o<0))return;let r={index:n,count:t,remaining:o??null};if(e.pricingMode!==void 0){if(e.pricingMode!=="matrix")return;r.pricingMode="matrix"}if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;r.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;r.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;r.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let s of["startsAt","endsAt"]){if(e[s]===void 0)continue;let a=Tr(e[s]);if(a===void 0)return;r[s]=a}return r}function Au(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],n=new Set;for(let s of e.channels){if(!s||typeof s!="object"||Array.isArray(s))return;let a=s,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||n.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],d=new Set;for(let p of a.priceOverrides){if(!p||typeof p!="object"||Array.isArray(p))return;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"",b=u.tierId===null?null:typeof u.tierId=="string"&&u.tierId.trim()?u.tierId.trim():void 0,g=rn(u.price);if(!h||b===void 0||g===void 0||g===null)return;let T=`${h}\0${b??""}`;if(d.has(T))return;d.add(T),c.push({categoryKey:h,tierId:b,price:g})}n.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let o=[],r=new Set;for(let s of e.objects){if(!s||typeof s!="object"||Array.isArray(s))return;let a=s,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||r.has(l)||!n.has(c))return;r.add(l),o.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:o}}function go(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i,t=Cu.find(p=>p===e.state);if(!t)return null;let n=rn(e.fromPrice),o=rn(e.previousPrice);if(n===void 0||o===void 0)return null;let r=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(r===void 0)return null;let s=El(e.release);if(s===void 0)return null;let a=e.upcoming===void 0?null:El(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let p=[];for(let u of e.prices){if(!u||typeof u!="object"||Array.isArray(u))return null;let h=u,b=typeof h.categoryKey=="string"?h.categoryKey.trim():"";if(!b)return null;let g=rn(h.price),T=rn(h.previousPrice);if(g==null||T===void 0)return null;let w={categoryKey:b,price:g,previousPrice:T};if(h.tierId!==void 0){if(h.tierId!==null&&(typeof h.tierId!="string"||!h.tierId.trim()))return null;w.tierId=h.tierId===null?null:h.tierId.trim()}if(h.offerId!==void 0){if(typeof h.offerId!="string"||!h.offerId.trim())return null;w.offerId=h.offerId.trim()}if(h.offerName!==void 0){if(typeof h.offerName!="string"||!h.offerName.trim())return null;w.offerName=h.offerName.trim()}if(h.remaining!==void 0){if(h.remaining!==null&&(typeof h.remaining!="number"||!Number.isInteger(h.remaining)||h.remaining<0))return null;w.remaining=h.remaining==null?null:h.remaining}for(let v of["startsAt","endsAt"]){if(h[v]===void 0)continue;let M=Tr(h[v]);if(M===void 0)return null;w[v]=M}p.push(w)}l=p}let c=Au(e.channelPricing);if(c===void 0)return null;let d=Tr(e.nextPriceChangeAt);return d===void 0?null:{state:t,fromPrice:n,previousPrice:o,currency:r,release:s,upcoming:a,prices:l,channelPricing:c,...e.nextPriceChangeAt!==void 0?{nextPriceChangeAt:d}:{}}}function Cl(i){return i?.changed!==!1}function Al(i,e){if(!i)return null;let t=null,n=o=>{o!=null&&o>e&&(t===null||o<t)&&(t=o)};for(let o of[i.release,i.upcoming])n(o?.startsAt),n(o?.endsAt);for(let o of i.prices)n(o.startsAt),n(o.endsAt);return n(i.nextPriceChangeAt),t}function Er(i){let e={};for(let t of i?.prices??[])if(t.tierId==null)e[t.categoryKey]=t.price;else{let n=e[t.categoryKey],o=typeof n=="number"?{base:n}:n??{};e[t.categoryKey]={...o,tiers:{...o.tiers,[t.tierId]:t.price}}}return e}function Pl(i,e){let t={...i};for(let[n,o]of Object.entries(Er(e))){let r=t[n];t[n]=typeof o=="number"?o:{...typeof r=="number"?{base:r}:r,...o,tiers:{...typeof r=="object"?r.tiers:{},...o.tiers}}}return t}var Ll=require("@seatlayer/core");var Ml="maintenance_mode";function Pu(i){if(!i||typeof i!="object")return!1;let e=i;return e.reason===Ml||e.code===Ml}function Mu(i){return typeof i!="number"||!Number.isFinite(i)||i<0?null:Math.max(1,Math.ceil(i/60))}function Cr(i){if(!Pu(i))return null;if(typeof i.notice=="string"&&i.notice.trim())return i.notice.trim();let e=Mu(i.retryAfterS);if(e===null)return y("picker.maintenancePausedShortly","Booking is paused for a few minutes for maintenance. Please try again shortly.");let t=(0,Ll.tCount)("picker.maintenancePaused",e);return t==="picker.maintenancePaused"?`Booking is paused for maintenance. Please try again in about ${e} minute${e===1?"":"s"}.`:t}function Hl(i){return i.focusedSection!==null?i.deeperThanSectionFrame===!1?"venue":"section":i.atVenueFit!==void 0?i.atVenueFit?"none":"venue":i.seatsRevealed?"venue":"none"}var Rl=["pointerdown","pointermove","keydown","wheel","touchstart"],bo=class{constructor(e){this.opts=e;this.timer=null;this.root=null;this.doc=null;this.disposed=!1;this.onInput=()=>this.touch();this.onVisibility=()=>{this.doc&&!this.doc.hidden&&this.check()};this.lastInput=this.now()}get enabled(){return this.opts.minutes>0}now(){return this.opts.now?this.opts.now():Date.now()}attach(e,t=e.ownerDocument){if(!(this.disposed||!this.enabled)){this.root=e,this.doc=t;for(let n of Rl)e.addEventListener(n,this.onInput,{capture:!0,passive:!0});t.addEventListener("visibilitychange",this.onVisibility),this.touch()}}touch(){this.lastInput=this.now(),this.arm(this.opts.minutes*6e4)}recentlyActive(){return!this.enabled||this.now()-this.lastInput<this.opts.minutes*6e4}resume(){this.disposed||this.touch()}dispose(){if(this.disposed=!0,this.clear(),this.root)for(let e of Rl)this.root.removeEventListener(e,this.onInput,{capture:!0});this.doc?.removeEventListener("visibilitychange",this.onVisibility),this.root=null,this.doc=null}arm(e){if(this.disposed||!this.enabled)return;this.clear();let t=this.opts.setTimeout??((n,o)=>setTimeout(n,o));this.timer=t(()=>{this.timer=null,this.check()},Math.max(0,e))}clear(){if(this.timer===null)return;(this.opts.clearTimeout??(t=>clearTimeout(t)))(this.timer),this.timer=null}check(){if(this.disposed||!this.enabled)return;let e=this.lastInput+this.opts.minutes*6e4-this.now();if(e>0){this.arm(e);return}if(this.opts.blocked()){this.arm(6e4);return}this.clear(),this.opts.onIdle()}};async function Il(i,e){let t=await i.pubApi?.pickerIdleMinutes().catch(()=>null)??null;if(i.destroyed||i.idleClock)return;let n=new bo({minutes:t??30,blocked:()=>!!i.hold,onIdle:()=>Ol(i)});n.enabled&&(i.idleClock=n,n.attach(e))}function Ol(i){i.destroyed||!i.root||i.holdExpiredEl||(i.realtime?.stop(),i.realtime=null,i.showAccessPanel({reason:"idle",retryable:!0}))}async function _l(i){if(i.destroyed)return!1;if(i.pubApi?.rotateViewerId(),i.access?.configured){let e=await i.refreshAccess();return e&&i.idleClock?.resume(),e}return i.dismissAccessPanel(),await i.controller.refresh(),i.realtime?i.realtime.restart():i.startRealtime(),i.idleClock?.resume(),!0}function Nl(i){if(!i.destroyed){if(i.hold||i.idleClock?.recentlyActive()){i.pubApi?.rotateViewerId(),i.realtime?.restart();return}Ol(i)}}function Dl(i,e,t=[],n=8){let o=e.reduce((s,a)=>!a||a.width<=0||a.height<=0?s:Math.max(s,a.bottom-i.top+n),0),r=t.reduce((s,a)=>!a||a.width<=0||a.height<=0?s:Math.max(s,i.bottom-a.top+n),o>0?n:0);return{top:Math.max(0,Math.ceil(o)),right:0,bottom:Math.max(0,Math.ceil(r)),left:0}}function Bl(i){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:i.tf("picker.allLevels","All levels")},...i.floors.map(s=>({id:s.id,name:s.name}))],n=document.createElement("span");n.className="sl-floor-label",n.textContent=`${i.tf("picker.levels","Level")}:`,e.appendChild(n);let o=document.createElement("select");o.className="sl-floor-select",o.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level"));for(let s of t){let a=document.createElement("option");a.value=s.id,a.textContent=s.name,o.appendChild(a)}let r=i.tf("picker.floorHelp","All levels shows the complete venue. Choose one level to inspect and select its seats.");return o.title=r,o.addEventListener("change",()=>i.onChoose(o.value)),e.appendChild(o),e}function Fl(i,e,t){if(!i)return;let n=t?"":e,o=i.querySelector(".sl-floor-select");o&&(o.value=n)}var yo=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}render(e){this.el?.remove(),this.el=null}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,n=this.host.map();if(!e||!t||!n)return 0;let o=this.host.activeFloorObjects().find(v=>v.type==="section"&&v.id===t.id)?.outline;if(!o||o.length<3)return 0;let r=o.map(v=>this.host.controller.worldToScreen(v)),s=r.map(v=>v.x),a=r.map(v=>v.y),l=Math.min(...s),c=Math.min(...a),d=Math.max(...s)-l,p=Math.max(...a)-c;if(d<=0||p<=0)return 0;let u=n.getBoundingClientRect(),h=e.getBoundingClientRect(),b=h.left-u.left,g=h.top-u.top,T=Math.max(0,Math.min(b+h.width,l+d)-Math.max(b,l)),w=Math.max(0,Math.min(g+h.height,c+p)-Math.max(g,c));return T*w/(d*p)}};var Ai=require("@seatlayer/core"),hc=require("@seatlayer/core/core/color");var kt=require("@seatlayer/core");function Ar(i,e,t){try{return new Intl.DateTimeFormat(e,{...t,...i.timezone?{timeZone:i.timezone}:{}}).format(new Date(i.startsAt))}catch{return new Date(i.startsAt).toLocaleString(e)}}var vo=(i,e)=>Ar(i,e,{dateStyle:"medium"}),wo=(i,e)=>Ar(i,e,{timeStyle:"short"}),Ci=(i,e)=>Ar(i,e,{weekday:"short",day:"numeric",month:"short"});function Vl(i,e,t,n){return!i.length||i.length>=e?null:{summary:n,labels:i.map(o=>`${vo(o,t)} \xB7 ${wo(o,t)}`)}}function Lu(i,e){let t=new Set(e);return i.map(n=>({...n,free:!t.has(n.eventKey)}))}function zl(i,e){let t=[...i];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Hu(i,e,t="",n=!1){if(!i.length)return"";let o=i.map(r=>{let s=r.free?e.free:e.blocked,a=n&&r.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${L(r.eventKey)}" aria-label="${L(`${r.shortDate}: ${s}`)}" checked>`:"";return`<li class="sl-night${r.free?" ok":" no"}" aria-label="${L(`${r.shortDate}: ${s}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${L(r.shortDate)}</span><span class="st">${L(s)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${L(e.title)}</div><ul class="sl-nightstrip">${o}</ul><p class="sl-tip-nights-note">${L(e.notAvailableOn)}</p>`+t+"</div>"}function Ru(i){return i.selectPartialLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${L(i.selectPartialLabel)}</button>`:i.switchLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${L(i.switchLabel)}</button>`:i.switchLabel||i.selectPartialLabel?"":`<p class="sl-tip-advice">${L(i.advice)}</p>`}function Iu(i){return Number(i.available)+Number(i.selected)+Number(i.partial)+Number(i.unavailable)}function $l(i,e,t){if(Iu(i)<2)return"";let n=(r,s,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${r}"${a}></i>${L(s)}</li>`,o=[];return i.available&&o.push(n("sl-pg-sw-free",e.available,` style="background:${L(t)}"`)),i.selected&&o.push(n("sl-pg-sw-sel",e.selected)),i.partial&&o.push(n("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${L(t)}"`)),i.unavailable&&o.push(n("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${L(e.title)}">${o.join("")}</ul>`}function jl(i,e){if(!i.length)return"";let t=i.map(n=>{let o=n.labels.length?n.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${n.labels.length?"":" empty"}${n.active?" active":""}" role="button" tabindex="0"${n.active?' aria-current="true"':""} data-event-key="${L(n.eventKey)}"><span class="n">${L(n.name)}</span><span class="s">${L(o)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${L(e.title)}"><div class="sl-pg-nights-title">${L(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function Pr(i,e){if(i?.kind!=="partial"||!e?.length)return null;let t=i.data?.blockedEventKeys??[],n=Lu(e,t);return{states:n,missing:n.filter(o=>!o.free).map(o=>o.shortDate)}}function Gl(i,e){return i?Hu(i.states,{title:y("picker.group.partlyAvailableTitle","Free on some nights only"),free:y("picker.group.nightFree","Free"),blocked:y("picker.group.nightBlocked","Not available"),notAvailableOn:(0,kt.t)("picker.group.notAvailableOn",{dates:zl(i.missing,e.locale)})},Ru({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:y("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function Ou(i,e,t,n){if(!i.length)return"";let o=new Set(e),r=new Set(t),s=i.map(a=>{let l=o.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${L(a.eventKey)}" aria-label="${L(`${a.shortDate}: ${l?n.available:n.unavailable}`)}"${l&&r.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${L(a.shortDate)}</span><span class="sl-confirm-date-state">${L(l?n.available:n.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${L(n.title)}</legend><p class="sl-confirm-dates-copy">${L(n.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${L(n.selectAll)}</span></label><ul>${s}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function Kl(i,e,t,n){let o=e.availableEventKeys(t);return Ou(i,o,e.includedEventKeys(),{title:n("picker.group.confirmDatesTitle","Choose performance dates"),copy:o.length===i.length?n("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(i.length)):n("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(o.length)).replace("{total}",String(i.length)),selectAll:n("picker.group.confirmSelectAll","Select all available dates"),available:n("picker.group.nightFree","Available"),unavailable:n("picker.group.nightBlocked","Unavailable")})}function Ul(i){return[...i.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function ql(i,e,t,n){let o=[...i.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!o.length)return;let r=i.querySelector(".sl-confirm-add"),s=i.querySelector("[data-pg-confirm-all]"),a=()=>{let l=o.filter(p=>!p.disabled),c=Ul(i).length;s&&(s.checked=c===l.length,s.indeterminate=c>0&&c<l.length);let d=i.querySelector("[data-pg-confirm-summary]");d&&(d.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),r.disabled=c===0,r.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),n()};o.forEach(l=>l.addEventListener("change",a)),s?.addEventListener("change",()=>{o.filter(l=>!l.disabled).forEach(l=>{l.checked=s.checked}),a()}),a()}async function Wl(i,e,t){if(!i||!t||!i.querySelector("[data-pg-confirm-event-key]"))return!0;let n=Ul(i);if(!n.length)return!1;let o=i.querySelector(".sl-confirm-add");return o?.setAttribute("aria-busy","true"),o&&(o.disabled=!0),await t.apply(e,n)?!0:(o?.removeAttribute("aria-busy"),o?.isConnected&&(o.disabled=!1),!1)}function Yl(i,e,t){return i?(0,kt.t)("picker.group.seatPartlyAvailable",{label:e,free:i.states.length-i.missing.length,total:i.states.length,dates:zl(i.missing,t)}):""}function Xl(i,e){let t=i.map((n,o)=>{let r=n.state==="done"?e.done:n.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${L(n.id)}" data-state="${L(n.state)}"${n.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${n.state==="done"?"\u2713":String(o+1)}</span><span class="l">${L(n.label)}</span><span class="sl-pg-sr">${L(r)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${L(e.label)}">${t}</ol>`}function Mr(i,e){return`<ul class="sl-pg-cards">${i.map(n=>`<li class="sl-pg-card" data-event-key="${L(n.eventKey)}"><span class="n">${L(n.name)}</span><time datetime="${L(n.iso)}"><span class="d">${L(n.date)}</span><span class="t">${L(n.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${L(e)}</p>`}function Ql(i){let e=i.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${L(t.eventKey)}"><span class="n">${L(t.name)}</span><span class="s">${L(t.labels.length?t.labels.join(", "):i.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${L(i.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(i.note?`<p class="sl-pg-pane-note">${L(i.note)}</p>`:"")+(i.total?`<div class="sl-pg-pane-total"><span>${L(i.total.label)}</span><b>${L(i.total.amount)}</b></div>`:"")+(i.holdStatus?`<p class="sl-pg-hold-status" role="status">${L(i.holdStatus)}</p>`:"")}function Zl(i){let e=Math.max(0,i);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function Jl(i,e){if(!i||i.seats<=0)return"";if(e==="same_seat"){let t=i.perPerformance??i.seats;return i.totalPerformances&&i.performances<i.totalPerformances?(0,kt.tCount)("picker.group.performancesChosenOf",t,{chosen:i.performances,total:i.totalPerformances}):(0,kt.tCount)("picker.group.seatsEveryPerformance",t)}return i.perPerformance!=null&&i.performancesChosen===i.performances?(0,kt.tCount)("picker.group.seatsPerPerformance",i.seats,{per:i.perPerformance}):(0,kt.tCount)("picker.group.performancesChosenOf",i.seats,{chosen:i.performancesChosen,total:i.performances})}function ec(i,e){i.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let n=()=>e(t.dataset.eventKey);t.addEventListener("click",n),t.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),n())})})}var tc=require("@seatlayer/core");function St(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function _u(i,e){let t=i.objectType==="table"&&!!i.bookingMode,n=i.objectType==="booth",o=t||n||!i.seatNumber,r=o?i.rowLabel??i.displayLabel??i.label:i.seatNumber,s=t?`${y("picker.guests","Guests")} ${i.bookingMode==="variable"?`${i.minOccupancy}\u2013${i.maxOccupancy}`:i.capacity}`:!n&&i.rowLabel?`${e} ${fe(i)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${o?" name":""}">${St(r)}</span>`+(s?`<span class="sl-tip-row">${St(s)}</span>`:"")+"</div>"+(i.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${y("picker.section","Section")}</span><span class="sl-tip-secname">${St(i.sectionLabel)}</span></div>`:"")+"</div>"}function ic(i,e){let t=i.status==="not_for_sale",n=i.mark?.kind==="partial",o=i.status==="free"||n?"":`<span class="sl-tip-tag">${t?y("picker.notAvailable","Not available"):i.status==="held"?(0,tc.t)("map.statusHeld"):y("picker.sold","Sold")}</span>`,r=t?"":e.price,s=r?`<span class="sl-tip-amt">${St(r)}</span>`:"",a=!r&&e.priceNote?`<div class="sl-tip-note">${St(e.priceNote)}</div>`:"",l=Dt(i,{compact:!0}),c=e.reason?`<div class="sl-tip-reason">${St(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+_u(i,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${St(i.categoryColor)}"></span><span class="sl-tip-name">${St(i.categoryLabel)}</span>`+o+s+"</div>"+a+c+l+(e.extra??"")}function nc(i,e,t,n){let o=i.x+14,r=i.y-n.height-12,s=i.y+18,a=r;o+n.width>e-8&&(o=i.x-n.width-14),r<8&&s+n.height<=t-8&&(a=s);let l=Math.max(8,t-n.height-8);return{left:Math.max(8,Math.min(o,Math.max(8,e-n.width-8))),top:Math.max(8,Math.min(a,l))}}function oc(i,e,t,n=22){let o=Math.max(8,Math.min(i.x-t.width/2,Math.max(8,e.width-t.width-8))),r=i.y-n-t.height,s=i.y+n;return r>=8?{left:o,top:r,placement:"above"}:s+t.height<=e.height-8?{left:o,top:s,placement:"below"}:{left:o,top:Math.max(8,Math.min(r<8?s:r,Math.max(8,e.height-t.height-8))),placement:r<8?"below":"above"}}var Lr=14,Nu=12,Du=12,Bu=8;function rc(i,e,t,n=Nu){let o=e.height-Lr-t.height,r=Du,s=o-n;if(s<=r)return{placement:"sheet",nudgeY:0};let a=(r+s)/2-i;return Math.abs(a)<=Bu?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function sc(i,e,t,n,o=0){let r=t.width/2+12,s=Math.max(r,Math.min(e.width-r,i.x)),a=i.y+o+t.height+24<=e.height,l=i.y-o<t.height+24&&a?"below":"above",c=l==="above"?i.y-o:i.y+o,d=n&&l==="above"?Math.max(t.height+24,c):c;return{left:s,top:Math.max(8,Math.min(e.height-8,d)),placement:l}}function ac(i,e,t){let n=i.querySelector("[data-pg-select-partial]"),o=[...i.querySelectorAll("[data-pg-event-key]")],r=()=>o.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),s=()=>{if(!n)return;let a=r().length;n.disabled=a===0,n.textContent=e?.(a)??n.textContent};o.forEach(a=>{a.addEventListener("change",s);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,s())})}),n?.addEventListener("click",()=>{let a=r();a.length&&t?.(a)})}function Gt(i){let e=i?.displayType?.trim()||i?.rowType?.trim();return e||(i?.objectType==="table"?y("picker.table","Table"):i?.objectType==="booth"?y("picker.booth","Booth"):y("picker.row","Row"))}var Fu="sl-confirm-scrim",Vu="--sl-scrim-mask";function zu(i){let e=Math.round(i.x),t=Math.round(i.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function lc(i,e,t,n){let o=i??document.createElement("div");return i||(o.className=Fu),o.style.setProperty(Vu,zu(n)),t.parentNode===e?o.nextSibling!==t&&e.insertBefore(o,t):o.parentNode!==e&&e.appendChild(o),o}function Hr(i){return i?.remove(),null}var cc={passport:!1,compare:!1},$u=360,ju=160,Gu=700,dc=450,Ku=8;function pc(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function Uu(i){return(0,hc.contrastRatio)("#ffffff",i)>=3?"#ffffff":"#0b0f19"}var xo=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let n=Ti(e)?e.viewUrl??"":"",o=po(t);if(!n&&!o)return"";let r=n?null:ho(e,e.focalPoint??t.focalPoint);if(!n&&r==null)return"";let s="";if(!n)return s;let a=q((0,Ai.t)("picker.viewFromSeat",{label:e.label})),l=q(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>`+s}show(e,t="add"){let n=this.host;this.mode=t;let o=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,n.root()?.setAttribute("data-confirming","true"),n.els().side?.toggleAttribute("inert",!0),Object.values(n.regions()).forEach(P=>P.toggleAttribute("inert",!0)),n.controller.setSelectionFocus(e.id),o&&o!==e.id&&n.controller.deselect([o]),n.hideTooltip();let r=n.controller.seatDetails(e.id),s=n.controller.doc?.categories.find(P=>P.key===e.categoryKey),a=r?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),l=a!=null?n.paidPrice(e.categoryKey,r?.tierId??s?.tiers?.[0]?.id??null,a,e.label):void 0,c=Xs(r,e.displayLabel??e.label,Gt(r)),d=r?.tiers??s?.tiers??[],p=r?.tierId??d[0]?.id,u=n.suppressPricing()?"":In(d,p,P=>n.money(n.paidPrice(e.categoryKey,P.id,P.price,e.label)),P=>n.offerName(e.categoryKey,P.id)),h=n.buyerView()==="venue3d",b=n.performanceGroup()?.confirmDateSelection??void 0,g=b?n.performanceGroup()?.nights?.()??[]:[],T=b?Kl(g,b,e.id,(P,$)=>n.tf(P,$)):"";this.shownAt=performance.now();let w=document.createElement("div");w.className="sl-confirm sl-mo-in",t==="remove"&&w.classList.add("sl-confirm-removing"),T&&w.classList.add("sl-confirm-group-dates"),w.setAttribute("role","dialog"),w.setAttribute("aria-label",(0,Ai.t)("picker.confirmSeatLabel",{label:e.label}));let v=n.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??s?.color??"#6e7bff";w.style.setProperty("--sl-cat",v),w.style.setProperty("--sl-cat-ink",Uu(v));let M=String(r?.categoryLabel??s?.label??e.categoryKey),B=n.controller.categoryAvailability()[e.categoryKey],X=typeof B=="number"&&B>0?(0,Ai.tCount)("picker.leftCount",B):"",f=n.suppressPricing()?`${r?.displayLabel??e.displayLabel??e.label}`:`${r?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?n.tf("picker.priceNotSupplied","Price not supplied"):n.money(l)}`,O=cc.passport?Ys(e,f,h):"",K=cc.compare?Ws(e,h?n.view3dCompareSeatIds():null):"";w.innerHTML=ea({identityFields:c,identity:Qs(r,e.displayLabel??e.label,Gt(r)),marker:qs({...r?.wheelchairSpaceType?{wheelchairSpaceType:r.wheelchairSpaceType}:{}}),see3dPill:Zs(n.canOffer3d(),h),categoryColor:v,categoryLabel:M,priceLabel:!n.suppressPricing()&&l!=null?n.money(l):"",categoryLeftLabel:X,tierChoices:u,groupDates:T,wheelchair:"",commercial:Dt({...e.accessibility?.length?{accessibility:e.accessibility}:{},...r?.wheelchairSpaceType?{wheelchairSpaceType:r.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{},...r?.aisle?{aisle:!0}:{},...r?.boothType?{boothType:r.boothType}:{},...r?.entrance?{entrance:r.entrance}:{}}),thumb:n.seatViewEnabled()&&n.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:h?`<div class="sl-confirm-inspect-row">${O}${K}${Jo(n.canOffer3d(),h)}</div>`:Jo(n.canOffer3d(),h),see3dRow:Js(n.canOffer3d(),h),cancelLabel:(0,Ai.t)("common.cancel"),selectLabel:t==="remove"?n.tf("picker.removeSeat","Remove seat"):n.addSeatLabel(r?.objectType)}),t==="remove"&&w.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),n.els().map.appendChild(w),this.el=w;let _=w.querySelector(".sl-confirm-thumb"),j=_?.closest(".sl-confirm-thumbwrap")??null;if(_&&j){let P=!1,$=()=>{if(P||!j.isConnected)return;P=!0;let W=()=>{j.remove(),this.el===w&&n.reanchor()};if(n.reducedMotion()||typeof requestAnimationFrame!="function"){W();return}j.style.height=`${j.offsetHeight}px`,j.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{j.style.height="0px",j.style.opacity="0"}),setTimeout(W,ju)};_.addEventListener("error",$),_.addEventListener("load",()=>{_.naturalWidth||$()});let J=e.viewMeta?.previewUrl??e.viewUrl;J?n.resolveAssetUrl(J).then(W=>{if(!(!w.isConnected||this.el!==w)){if(!W){$();return}_.src=W}}).catch(W=>{$(),n.onError(W)}):$()}n.reanchor(),this.liftSeatClearOfSheet(e),w.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{n.openSeatView(e)}),w.querySelector(".sl-confirm-confidence")?.addEventListener("click",P=>{n.openSeatConfidencePassport(e,P.currentTarget instanceof HTMLElement?P.currentTarget:null)}),w.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>n.saveView3dComparisonSeat(e)),w.querySelectorAll("[data-confirm-tier]").forEach(P=>{P.addEventListener("click",()=>{let $=P.dataset.confirmTier,J=d.find(oe=>oe.id===$);if(!J)return;n.controller.setSeatTier(e.id,J.id),w.querySelectorAll("[data-confirm-tier]").forEach(oe=>{oe.setAttribute("aria-pressed",String(oe===P))});let W=w.querySelector(".sl-confirm-price");W&&(W.textContent=n.money(n.paidPrice(e.categoryKey,J.id,J.price,e.label))),n.reanchor()})}),w.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(P=>{P.addEventListener("pointerdown",An,{once:!0}),P.addEventListener("click",()=>{n.buyerView()==="venue3d"?(n.dismiss(),n.view3dHandle()?.flyToSeat(e.id)):(n.rememberView3dReturnSeat(e),n.dismiss(),n.enter3d(e.id))})}),ql(w,b,(P,$)=>n.tf(P,$),()=>n.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(),n.liftToastOverConfirm(),n.fitTranslatedRows(),n.inviteCommit(w,P)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,n=t.root();if(!this.el||n?.dataset.layout!=="narrow"||n?.dataset.view3d==="on")return;let o=t.els().map;if(!o)return;let r=t.controller.worldToScreen({x:e.x,y:e.y}),s=t.controller.getRenderer(),a=s?.getCameraGestureCount?.()??0,{nudgeY:l}=rc(r.y,{height:o.clientHeight},{height:this.el.offsetHeight||230}),c=this.lift&&this.lift.gestures===a?this.lift.dy:0;if(!l){this.lift=c?{dy:c,gestures:a}:null;return}let d=!t.reducedMotion();s?.panScreenBy?.({x:0,y:l},{animate:d}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=d?this.now()+Gu:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),n=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=lc(this.scrim,n,this.el,t),Ra(this.el,t,n),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=Hr(this.scrim);let o=n.clientWidth,r=n.clientHeight,s=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,d=sc(t,{width:o,height:r},{width:s,height:a},l,c);this.el.dataset.placement=d.placement,this.el.style.left=`${d.left}px`,this.el.style.top=`${d.top}px`,Zn(this.el,t,{left:d.left,top:d.top,width:s,height:a})}ghostActivation(){return pc()?performance.now()-this.shownAt<dc:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,n=new Map,o=s=>{if(this.el!==e){this.disarmOutsideTap();return}let a=s.target,l=s;if(s.type!=="pointerdown"){let d=n.get(l.pointerId);n.delete(l.pointerId),d&&s.type==="pointerup"&&n.size===0&&Math.hypot(l.clientX-d.x,l.clientY-d.y)<=Ku&&this.cancel();return}if(!(!a||e.contains(a)||t.els().tray?.contains(a))){if(a instanceof Element&&a.closest(".sl-view3d")){if(n.set(l.pointerId,{x:l.clientX,y:l.clientY}),n.size>1)for(let d of n.keys())n.set(d,{x:Number.NaN,y:Number.NaN});return}this.cancel()}};this.outsideTap=o;let r=t.root();setTimeout(()=>{this.outsideTap===o&&((r??document).addEventListener("pointerdown",o,!0),(r??document).addEventListener("pointerup",o,!0),(r??document).addEventListener("pointercancel",o,!0))},pc()?dc:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null;for(let t of["pointerdown","pointerup","pointercancel"])(this.host.root()??document).removeEventListener(t,e,!0),document.removeEventListener(t,e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=Hr(this.scrim),this.settleLift(),this.el&&Jn(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null),e.syncTray()}async commit(){let e=this.host,t=this.seat;if(!t)return;let o=this.el?.querySelector(".sl-confirm-add")??null;if(o?.classList.contains("is-adding")||!await Wl(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let r=()=>{let l=e.root()?.dataset.layout==="narrow"?this.lift:null;l&&(this.lift=null),e.dismiss();let c=e.controller.worldToScreen(t);br(e.els(),c,t,e.controller.doc?.categories,()=>{e.cartLanded?.(),l&&(this.lift=l,this.settleLift())})};if(!o||e.reducedMotion()){r();return}o.classList.remove("sl-confirm-add-invite"),o.classList.add("is-adding"),o.setAttribute("aria-disabled","true");let s=o.querySelector(".sl-confirm-add-t");s&&(s.textContent=e.tf("picker.added","Added")),e.scheduleMotion(r,$u)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"&&e.controller.deselect([t.id]),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}removeCommitted(){let e=this.host,t=this.seat;if(!t)return;let n=e.releaseHeldSeat(t);n||e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0})}};function uc(i,e,t){if(!e||t||i.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let n=()=>e.classList.remove("sl-confirm-add-invite");i.addEventListener("pointerdown",n,{once:!0}),i.addEventListener("keydown",n,{once:!0}),e.addEventListener("focus",n,{once:!0})}function mc(i,e){return i&&i!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}var fc=require("@seatlayer/core"),Pi=require("@seatlayer/core/picker/minimapGeometry");function qu(i){let e={inactive:0,available:1,selected:2},t=new Map;for(let o of i){let r=t.get(o.id);(!r||e[o.state]>e[r])&&t.set(o.id,o.state)}let n={selected:0,available:0,inactive:0};for(let o of t.values())n[o]+=1;return n}function Wu(i,e){return i.x<=e.x&&i.y<=e.y&&i.x+i.width>=e.x+e.width&&i.y+i.height>=e.y+e.height}function gc(i,e){let t=new Rr(i);return t.build(e),t}var Rr=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}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 n=document.createElement("button");n.type="button",n.className="sl-minimap-toggle",n.setAttribute("aria-label",y("picker.openVenueMap","Open venue overview map")),n.setAttribute("aria-expanded","false"),n.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(n),this.miniToggle=n;let o=document.createElement("div");o.className="sl-minimap",o.setAttribute("role","group");let r=document.createElement("div");r.className="sl-minimap-bar";let s=document.createElement("span");s.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",y("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",y("picker.closeVenueMap","Close venue overview map")),l.textContent="\xD7",r.append(s,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",y("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),o.append(r,c),e.appendChild(o),this.miniWrap=o,this.miniLabel=s,this.miniCanvas=c;let d=document.createElement("canvas");this.miniBase=d,n.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,n=this.host.controller.getViewport()?.bounds;if(!e||!t||!n||!(n.width>0&&n.height>0))return;let o=196,r=146,s=6,a=n.width/Math.max(1,n.height),l=o,c=Math.round(o/a);c>r&&(c=r,l=Math.round(r*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,Pi.createMinimapTransform)(n,e.width,e.height,d,s)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?y("picker.allFloors","All floors"):e.find(d=>d.id===this.host.controller.getActiveFloorId())?.name??y("picker.venueOverview","Venue overview"),n=this.host.controller.getMinimapSnapshot().sections,r=n.find(d=>d.active)?.label??this.host.focusedSectionLabel(),s=r?`${t} \xB7 ${r}`:t;this.miniLabel.textContent=s;let{selected:a,available:l,inactive:c}=qu(n);this.miniWrap.setAttribute("aria-label",n.length?`${s}. ${a} selected, ${l} available, ${c} inactive sections.`:s),this.miniCanvas?.setAttribute("aria-label",n.length?`${s}. ${a} selected, ${l} available, ${c} inactive sections. ${y("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${s}. ${y("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 n=e.getContext("2d");if(!n)return;n.clearRect(0,0,e.width,e.height);let o=p=>p*t.scale+t.offX,r=p=>p*t.scale+t.offY,s=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;n.beginPath(),p.outline.forEach((h,b)=>b===0?n.moveTo(o(h.x),r(h.y)):n.lineTo(o(h.x),r(h.y))),n.closePath();let u=p.paint;if(n.globalAlpha=p.state==="inactive"?.5:.92,u?n.fillStyle=u.fill:(n.globalAlpha=p.state==="inactive"?.18:p.state==="selected"?.72:.34,n.fillStyle=p.state==="inactive"?a:p.state==="selected"?l:c),n.fill(),n.globalAlpha=.82,n.lineWidth=Math.max(1,t.dpr),n.strokeStyle=u?.stroke||s,n.stroke(),p.owned){n.globalAlpha=1,n.lineWidth=Math.max(2,t.dpr*1.5),n.strokeStyle=l,n.stroke();let h=p.outline.reduce((b,g)=>({x:b.x+g.x,y:b.y+g.y}),{x:0,y:0});n.beginPath(),n.arc(o(h.x/p.outline.length),r(h.y/p.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),n.fillStyle=l,n.fill(),n.beginPath(),p.outline.forEach((b,g)=>g===0?n.moveTo(o(b.x),r(b.y)):n.lineTo(o(b.x),r(b.y))),n.closePath()}p.active&&(n.globalAlpha=1,n.lineJoin="round",n.lineWidth=Math.max(4,t.dpr*3.5),n.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",n.stroke(),n.lineWidth=Math.max(2,t.dpr*1.75),n.strokeStyle=l,n.stroke())}if(n.globalAlpha=1,!d.sections.length){let p=Math.max(1,t.dpr),u=new Map,h=b=>{let g=u.get(b);if(g)return g;let T=this.host.tint?.(b)||c;return u.set(b,T),T};for(let b of d.seats)n.globalAlpha=b.state==="inactive"?.22:.78,n.fillStyle=b.state==="inactive"?a:b.state==="selected"?l:h(b.categoryKey),n.beginPath(),n.arc(o(b.x),r(b.y),p,0,Math.PI*2),n.fill();n.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,n=this.miniTf;if(!e||!t||!n)return;let o=e.getContext("2d");if(!o)return;o.clearRect(0,0,e.width,e.height),o.drawImage(t,0,0);let r=this.host.controller.getViewport();if(!r||Wu(r.visible,r.bounds))return;let s=(0,Pi.minimapViewportPlan)(r.visible,n,e.width,e.height,Math.max(2,n.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";o.save(),o.globalAlpha=.1,o.fillStyle=a,o.fillRect(s.raw.x,s.raw.y,s.raw.width,s.raw.height),o.globalAlpha=.9,o.lineJoin="round",o.lineWidth=Math.max(4,n.dpr*3.25),o.strokeStyle=l,o.strokeRect(s.raw.x,s.raw.y,s.raw.width,s.raw.height),o.globalAlpha=1,o.lineWidth=Math.max(2,n.dpr*1.75),o.strokeStyle=a,o.strokeRect(s.raw.x,s.raw.y,s.raw.width,s.raw.height),s.clipped&&Object.values(s.clippedEdges).some(Boolean)&&(o.setLineDash([Math.max(3,n.dpr*3),Math.max(2,n.dpr*2)]),o.strokeRect(s.clipped.x,s.clipped.y,s.clipped.width,s.clipped.height)),o.restore()}minimapWorldPoint(e){let t=this.miniCanvas,n=this.miniTf;if(!t||!n)return null;let o=t.getBoundingClientRect(),r=(e.clientX-o.left)*(t.width/Math.max(1,o.width)),s=(e.clientY-o.top)*(t.height/Math.max(1,o.height));return{...(0,Pi.minimapPointToWorld)({x:r,y:s},n),px:r,py:s}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),n=this.host.controller.getViewport()?.visible;!t||!n||!(t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(n.x+n.width/2),offsetY:t.y-(n.y+n.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 n=this.minimapWorldPoint(e);n&&(!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:n.x-t.offsetX,y:n.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 n=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,o=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!n&&!o||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+n,y:t.y+t.height/2+o}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let n of this.host.controller.getMinimapSnapshot().sections)if(!(n.state==="inactive"||n.outline.length<3)&&(0,fc.pointInPolygon)(t,n.outline)){this.host.controller.focusSection(n.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var ko=require("@seatlayer/core");var Yu=12;function bc(i,e){let t=e.floors(),n=new Set(t.map(f=>f.label.trim().toLocaleLowerCase())),o=e.zones().filter(f=>f.seatCount>0&&!n.has(f.label.trim().toLocaleLowerCase())),r=e.sections().filter(f=>f.seatCount>0&&!n.has(f.label.trim().toLocaleLowerCase())),s=o.length>1?[]:r,a=t.length>1,l=o.length>1,c=s.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>',b=document.createElement("span");u.innerHTML=h,u.appendChild(b);let g=()=>{for(let f of d.querySelectorAll(":scope > div")){let O=f.querySelector('[aria-pressed="true"]');!O||f.scrollWidth<=f.clientWidth||O.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(p)return p;for(let f of d.querySelectorAll(":scope > div")){let O=f.querySelector('button[aria-pressed="true"]'),K=O?.textContent?.trim();if(K&&O?.dataset.floor!=="")return K}return a&&(l||c)?y("picker.levelsAndAreas","Levels & areas"):a?y("picker.levels","Levels"):y("picker.areas","Areas")},w=f=>{d.classList.toggle("is-open",f),u.setAttribute("aria-expanded",String(f)),f&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(g),b.textContent=T()};u.addEventListener("click",()=>w(!d.classList.contains("is-open"))),d.addEventListener("keydown",f=>{f.key!=="Escape"||!d.classList.contains("is-open")||(f.preventDefault(),f.stopPropagation(),w(!1),u.focus())});let v=document.createElement("button");v.type="button",v.className="sl-view3d-nav-close",v.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let M=y("picker.closeVenueNavigation","Close venue navigation");v.setAttribute("aria-label",M),v.title=M,v.addEventListener("click",()=>{w(!1),u.focus()}),w(!1),d.appendChild(u);let B=f=>{},X=f=>{};if(a){let f=document.createElement("div");f.setAttribute("role","group"),f.setAttribute("aria-label",y("picker.levels","Levels"));let O=[];X=j=>{O.forEach(P=>{P.setAttribute("aria-pressed",String((P.dataset.floor===""?null:Number(P.dataset.floor))===j))})};let K=j=>{e.focusFloor(j)&&(X(j),B(j))},_=(j,P)=>{let $=document.createElement("button");$.type="button",$.textContent=j,$.dataset.floor=P===null?"":String(P),$.setAttribute("aria-pressed",String(P===null)),$.addEventListener("click",()=>{K(P),w(!1)}),O.push($),f.appendChild($)};_(y("picker.allLevels","All levels"),null);for(let j of t)_(j.label||(0,ko.t)("picker.levelNumber",{number:j.index+1}),j.index);d.appendChild(f)}if(l||c){let f=document.createElement("div");f.setAttribute("role","group"),f.setAttribute("aria-label",y("picker.areas","Areas"));let O=l?o.map(_=>({id:_.id,label:_.label||_.id,go:()=>{e.focusZone(_.id)}})):s.map(_=>({id:_.id,label:_.label||_.id,floorIndex:_.floorIndex,go:()=>{e.focusSection(_.id),Number.isFinite(_.floorIndex)&&X(_.floorIndex)}})),K=_=>{let j=l||_===null?O:O.filter(P=>P.floorIndex===void 0||P.floorIndex===_);if(f.replaceChildren(),!j.length){f.remove();return}if(f.isConnected||d.insertBefore(f,v.isConnected?v:null),!l&&j.length>Yu){let P=document.createElement("select");P.setAttribute("aria-label",y("picker.jumpToSection","Jump to section"));let $=document.createElement("option");$.value="",$.textContent=y("picker.jumpToSection","Jump to section"),P.appendChild($);for(let J of j){let W=document.createElement("option");W.value=J.id,W.textContent=J.label,P.appendChild(W)}P.addEventListener("change",()=>{j.find(J=>J.id===P.value)?.go()}),f.appendChild(P);return}for(let P of j){let $=document.createElement("button");$.type="button",$.textContent=P.label,$.dataset.area=P.id,$.addEventListener("click",()=>{p=P.label,P.go(),w(!1)}),f.appendChild($)}};B=K,K(null)}return d.appendChild(v),i.appendChild(d),d}var So=class{constructor(e){this.host=e;this.chip=null}sync(){let e=this.host.overlay();if(!e||this.host.savedSeatIds().length===0){this.chip?.remove(),this.chip=null;return}let t=this.chip;if(!t){t=document.createElement("div"),t.className="sl-view3d-compare-saved",t.setAttribute("role","group"),t.setAttribute("aria-label",y("picker.savedSeatComparison","Saved seat comparison"));let r=document.createElement("button");r.type="button",r.className="main",r.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(y("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let s=document.createElement("button");s.type="button",s.className="clear",s.textContent="\xD7",s.setAttribute("aria-label",y("picker.clearSavedSeatComparison","Clear saved seat comparison")),s.addEventListener("click",()=>this.host.clearComparison()),t.append(r,s),e.appendChild(t),this.chip=t}let n=this.host.savedSeatIds().length,o=t.querySelector(".main");o&&(o.textContent=n>1?(0,ko.t)("picker.compareCount",{count:n}):y("picker.oneSeatSaved","1 seat saved"),o.setAttribute("aria-label",n>1?(0,ko.t)("picker.openComparisonOfSeats",{count:n}):y("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function yc(i){return!i?.querySelector('[data-ref="zfs"]')}var vc="sl:sheet-hint";function wc(i){let e=i.boot;if(!e?.isConnected)return;if(i.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),i.map?.appendChild(t),setTimeout(()=>t.remove(),450),i.rail?.classList.add("is-in"),i.root?.classList.add("is-arriving"),setTimeout(()=>{i.rail?.classList.remove("is-in"),i.root?.classList.remove("is-arriving"),Xu(i.root)},700)}function Xu(i){if(!i||i.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(vc))return;window.sessionStorage.setItem(vc,"1")}catch{}let e=i.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function xc(i,e){i.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let n of e())if(n.open()){t.preventDefault(),t.stopPropagation(),n.close();return}}})}function To(i){let e=i.committedSelection(),t=i.controller.getGAAreas(),n=i.hold?.items??[],o=new Set(n.map(u=>u.label)),r=Fa(i,t,n),s=wt(i.gaQty,n),a=n.reduce((u,h)=>u+i.paidPrice(h.categoryKey,h.tierId,h.unitPrice,h.label)*(h.quantity??1),0),l=n.reduce((u,h)=>u+(h.quantity??1),0),c=e.filter(u=>!o.has(u.label)),d=c.reduce((u,h)=>u+i.paidPrice(h.categoryKey,h.tierId??null,h.price,h.label)*(h.quantity??1),0)+r+a,p=c.reduce((u,h)=>u+(h.quantity??1),0)+s+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:n,heldLabels:o,heldCount:l,total:d,count:p}}function Eo(i,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:i.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function Co(i,e){let t=e.tiers?.length?e.tiers.map(n=>i.paidPrice(e.key,n.id??null,n.price)):e.price==null?[]:[i.paidPrice(e.key,null,e.price)];if(e.key)for(let n of i.pricesByChannel.values())for(let o of n)o.categoryKey===e.key&&t.push(o.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var sn="seatlayer_";function Qu(){let i=globalThis;return i.document?.modelContext??i.navigator?.modelContext??null}function Ve(i,e){return e?{ok:!1,reason:i,message:e}:{ok:!1,reason:i}}function Zu(i){return Array.isArray(i)?i.filter(e=>typeof e=="string"&&!!e):[]}function Ju(i,e){let t=i.event();if(!t)return Ve("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits();return{ok:!0,event:t,selection:{max:n.max,...n.required!=null?{required:n.required}:{}},categories:i.categories(),zones:i.zones(),hasPremiumSeats:i.hasPremiumSeats(),holdsAllowed:e}}function kc(i,e){let t=o=>!!o&&o.toLowerCase()===e.toLowerCase(),n=i.find(o=>t(o.key??o.id))??i.find(o=>t(o.label));return n?.key??n?.id??null}function Sc(i,e){let t=e.map(n=>i.describeSeat(n.id));return{seatIds:e.map(n=>n.id),labels:e.map(n=>n.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((n,o)=>t[o]?.seat||n.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((n,o)=>n+o.price,0)}}function em(i,e,t){let n=new Map;for(let r of e){let s=n.get(r.rowKey);s?s.push(r):n.set(r.rowKey,[r])}let o=[];for(let r of n.values()){let s=[...r].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=s.length;l++)if(l===s.length||s[l].index!==s[l-1].index+1||s[l].categoryKey!==s[l-1].categoryKey){for(let d=a;d+t<=l;d+=t)o.push(Sc(i,s.slice(d,d+t)));a=l}}return o}function tm(i,e,t){let n=new Map;for(let r of e){let s=n.get(r.sectionKey);s?s.push(r):n.set(r.sectionKey,[r])}let o=[];for(let r of n.values()){if(r.length<t)continue;let s=[...r].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);o.push(Sc(i,s.slice(0,t)))}return o}function im(i,e){if(!i.event())return Ve("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits(),o=Math.floor(Number(e.count));if(!Number.isInteger(o)||o<1||o>n.max)return Ve("bad_count",`count must be a whole number between 1 and ${n.max}.`);let r=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,s=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?kc(i.categories(),l):null;if(l&&!d)return Ve("no_match",`No ticket type called "${l}".`);if(d&&i.categories().find(g=>g.key===d)?.available===0)return Ve("sold_out",`"${l}" is sold out.`);let p=c?kc(i.zones(),c):null;if(c&&!p)return Ve("no_match",`No zone called "${c}".`);let u=i.seats().filter(g=>g.available);if(!u.length)return Ve("sold_out");let h=u.filter(g=>(!d||g.categoryKey===d)&&(!p||g.zoneId===p)&&(a==null||g.price<=a));if(!h.length)return Ve("no_match");let b=s?em(i,h,o):tm(i,h,o);return b.length?(b.sort((g,T)=>T.unitPrice!==g.unitPrice?T.unitPrice-g.unitPrice:g.row.localeCompare(T.row)||g.labels[0].localeCompare(T.labels[0])),{ok:!0,groups:b.slice(0,r),searched:{count:o,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...p?{zone:p}:{},together:s}}}):Ve(s?"not_enough_together":"no_match")}function Tc(i){return{ok:!0,...i.selection()}}function nm(i,e){let t=i.event();if(!t)return Ve("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return Ve("event_closed","Sales are closed for this event.");let n=Zu(e.seat_ids);return n.length?(i.clearSelection(),i.selectObjects(n),Tc(i)):Ve("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function om(i,e){let t=async o=>{try{return await o()}catch(r){return Ve("error",r instanceof Error?r.message:String(r))}},n=[{name:`${sn}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(()=>Ju(i,e))},{name:`${sn}find_seats`,title:"Find available seats",description:"Search the seat map for groups of available seats. Read-only: it never selects, holds or reserves anything. Returns candidate groups with their seat ids, prices and location.",inputSchema:{type:"object",properties:{count:{type:"integer",minimum:1,description:"How many seats are needed."},max_price:{type:"number",description:"Highest acceptable price per seat."},category:{type:"string",description:"Ticket type key or label to restrict the search to."},zone:{type:"string",description:"Zone id or label to restrict the search to."},together:{type:"boolean",description:"Require the seats to be side by side in one row (default true)."},limit:{type:"integer",minimum:1,maximum:20,description:"How many candidate groups to return (default 5)."}},required:["count"],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:o=>t(()=>im(i,o))},{name:`${sn}select_seats`,title:"Select seats on the map",description:"Replace the current selection with the given seats, exactly as tapping them would. The buyer sees the seats light up and the basket update. No reservation is made.",inputSchema:{type:"object",properties:{seat_ids:{type:"array",items:{type:"string"},description:"Seat ids or labels, e.g. from find_seats."}},required:["seat_ids"],additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:o=>t(()=>nm(i,o))},{name:`${sn}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(()=>Tc(i))}];return e&&n.push({name:`${sn}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>i.hold())}),n}async function Ec(i,e={}){let t=Qu();if(!t||typeof t.registerTool!="function")return null;let n=new AbortController,o=om(i,!!e.holds),r=[],s=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of o)await t.registerTool(a,{signal:n.signal,...s?{exposedTo:s}:{}}),r.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return r.length?{names:r,dispose:()=>{if(n.abort(),typeof t.unregisterTool=="function")for(let a of r)try{t.unregisterTool(a)}catch{}}}:null}async function Cc(i){let e=i.opts.webMcp;if(!e||i.destroyed)return;let t=typeof e=="object"&&!!e.holds,n=typeof e=="object"?e.exposedTo:void 0;try{i.webMcp=await Ec(Or(i,t),{holds:t,exposedTo:n}),i.destroyed&&Ir(i)}catch(o){console.warn("seatmap: WebMCP registration failed",o)}}function Ir(i){i.webMcp?.dispose(),i.webMcp=null}function Or(i,e){let t=(n,o)=>{if(Number.isInteger(n.logicalSeatIndex))return n.logicalSeatIndex;let r=n.id.lastIndexOf(":"),s=r<0?NaN:Number(n.id.slice(r+1));return Number.isFinite(s)?s:o};return{event:()=>{let n=i.renderInfo;return n?{name:n.eventName??"",venue:n.venue??null,startsAt:n.startsAt??null,timezone:n.timezone??null,currency:i.currency,salesClosed:i.salesClosed}:null},selectionLimits:()=>({max:i.maxTickets,required:i.exactTickets}),categories:()=>{let n=i.controller.categoryAvailability();return(i.controller.doc?.categories??[]).filter(o=>!o.notForSale).map(o=>{let r=Co(i,o),s=Eo(i,o);return{key:o.key,label:o.label??o.key,...s===void 0?{}:{price:s},...r&&r.min!==r.max?{priceRange:r}:{},available:n[o.key]??0}})},zones:()=>i.controller.getBestAvailableZones(),hasPremiumSeats:()=>i.controller.hasPremiumSeats(),seats:()=>{let n=i.controller.getActiveFloorId(),o=[];return i.allSeats().forEach((r,s)=>{if(r.floorId&&n&&r.floorId!==n)return;let a=i.controller.getStatus(r.id)??"free",l=i.controller.doc?.categories.find(d=>d.key===r.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;o.push({id:r.id,label:r.label,rowKey:r.logicalRowId??r.rowId,sectionKey:r.sectionId??r.rowId,index:t(r,s),categoryKey:r.categoryKey,price:i.paidPrice(r.categoryKey,l?.tiers?.[0]?.id??null,c,r.label),...r.zoneId?{zoneId:r.zoneId}:{},available:a==="free"&&!l?.notForSale})}),o},describeSeat:n=>{let o=i.controller.seatDetails(n);return o?{section:o.sectionLabel??"",row:fe(o)??"",seat:o.seatNumber??o.label,category:o.categoryLabel??o.categoryKey}:null},selection:()=>{let{freshSeats:n,total:o,count:r}=To(i);return{seats:n.map(s=>({id:s.id,label:s.label,section:s.sectionLabel??"",row:fe(s)??"",seat:s.seatNumber??s.label,category:s.categoryKey,price:i.paidPrice(s.categoryKey,s.tierId??null,s.price,s.label)})),count:r,total:o,currency:i.currency,hold:i.hold?{id:i.hold.holdId,expiresAt:i.hold.expiresAt}:null,validity:i.getSelectionValidity()}},clearSelection:()=>i.clearSelection(),selectObjects:n=>{i.selectObjects(n)},hold:()=>e?rm(i):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function rm(i){if(i.salesClosed)return{ok:!1,reason:"event_closed"};if(!i.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=i.controller.getSelectionValidity(i.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await i.handleCta(),i.hold?{ok:!0,hold:{id:i.hold.holdId,expiresAt:i.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function Ac(i,e){if(e.objectType!=="seat"&&e.objectType!=="booth")return null;let t=i.seatByLabel(e.label),n=t?i.toSeat(t).tiers:void 0;return n&&n.length>1?n:null}async function Pc(i,e,t,n){let o=i.currentHold(),r=o?.items??[],s=r.find(c=>c.label===e);if(!o||!s||s.tierId===t)return null;let a=r.map(c=>({label:c.label,tierId:c.label===e?t:c.tierId,...c.quantity!=null?{quantity:c.quantity}:{}})),l=await i.api.hold(i.key,a,n,o.holdId);return i.setHold({holdId:l.holdId,labels:a.map(c=>c.label),expiresAt:l.expiresAt,items:l.items}),i.currentHold()}function _r(i){return{renderingTimeMillis:i.ms,performanceProfile:i.performanceProfile,seatCount:i.seatCount,objectCount:i.objectCount,sectionCount:i.sectionCount,view:i.view,eventKey:i.eventKey,chartName:i.chartName,floorCount:i.floorCount,transport:i.transport,load:i.load,metricScope:i.metricScope,operationalTelemetryReporter:"sdk"}}function Mc(i,e){Ze({apiBase:i.apiBase,event:i.eventKey,scope:i.metricScope,surface:i.surface,outcome:"success",ms:i.ms,performanceProfile:i.performanceProfile,seats:i.seatCount,floors:i.floorCount,view:i.view,load:i.load,transport:i.transport,revealWaitMs:i.revealWaitMs,handoverMs:i.handoverMs}),e("chart_rendered",_r(i))}var Lc=require("@seatlayer/core/core/seatConfidence");function Pe(i){return String(i??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Hc(i){let e=(0,Lc.seatConfidenceDisclosure)(i.seat.confidenceEvidence),t=i.seat.confidenceEvidence,n=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${Pe(c)}</li>`).join("")}</ul>`:"",o=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${Pe(e.modeledTarget)}</dd></div>`:"",r=t?`<div><dt>Evidence ID</dt><dd>${Pe(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${Pe(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${Pe(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${Pe(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${Pe(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",s=Rn(i.seat.commercial).join(" \xB7 ")||i.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${Pe(s)}</dd></div>`+(i.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${Pe(i.seat.commercial.note)}</dd></div>`:""),l=i.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${Pe(i.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${Pe(e.headline)}</strong><span>${Pe(e.coverage)} \xB7 ${Pe(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${Pe(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${Pe(e.reality)}</dd></div><div><dt>Source</dt><dd>${Pe(e.provenance)}</dd></div>`+a+o+r+`</dl>${n}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function Rc(i){return i?i.closest("[data-report]")?"report":i.closest("[data-close]")||i.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function Ao(i,e,t){let n=i?.querySelector("[data-report]"),o=i?.querySelector("[data-report-status]");n&&(n.disabled=e!=="failed",n.textContent=e==="received"?"Report received":"Report this view"),o&&(o.setAttribute("role",e==="failed"?"alert":"status"),o.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function Nr(i,e,t=null){let n=i.view3dEl;if(!n)return;an(i,!1);let o=e.confidenceEvidence,r=i.controller.seatDetails(e.id),s=document.createElement("div");s.className="sl-view3d-passport-shell",s.innerHTML=Hc({seat:e,title:r?.displayLabel??e.displayLabel??e.label,restrictionFallback:i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof i.api.reportViewEvidence=="function"});let a=[...new Set([...n.children,...[...i.els.map.children].filter(u=>u!==n)])].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");n.appendChild(s),n.classList.add("has-passport"),i.view3dPassportEl=s;let c=s.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(),an(i);return}if(u.key!=="Tab")return;let h=d();if(!h.length)return;let b=h[0],g=h[h.length-1];u.shiftKey&&document.activeElement===b?(u.preventDefault(),g.focus()):!u.shiftKey&&document.activeElement===g&&(u.preventDefault(),b.focus())};window.addEventListener("keydown",p,!0),i.view3dPassportCleanup=()=>{window.removeEventListener("keydown",p,!0);for(let g of l)g.element.inert=g.inert,g.ariaHidden===null?g.element.removeAttribute("aria-hidden"):g.element.setAttribute("aria-hidden",g.ariaHidden);let u=t?.isConnected?t:i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareEl?.querySelector("[data-passport-seat]")??null,h=u?.closest(".sl-confirm,.sl-view3d-compare");h?.isConnected&&(h.inert=!1,h.removeAttribute("aria-hidden")),s.remove(),n.classList.remove("has-passport"),i.view3dPassportEl===s&&(i.view3dPassportEl=null);let b=u??i.view3dCompareEl?.querySelector("[data-passport-seat]")??i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareChip.mainButton();(t?.isConnected?t:b)?.focus()},s.addEventListener("click",u=>{let h=Rc(u.target instanceof HTMLElement?u.target:null);h==="close"&&an(i),h==="report"&&sm(i,e)}),requestAnimationFrame(()=>d()[0]?.focus()),i.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:o?.evidenceId??null,eventConfigurationId:o?.eventConfigurationId??null,modelLevel:o?.modelLevel??"unverified",realityLevel:o?.realityLevel??"none"})}async function sm(i,e){if(i.api.reportViewEvidence){Ao(i.view3dPassportEl,"sending");try{let t=await i.api.reportViewEvidence(i.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});i.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),Ao(i.view3dPassportEl,"received",t.report.id)}catch{Ao(i.view3dPassportEl,"failed")}}}function an(i,e=!0){let t=i.view3dPassportCleanup;if(i.view3dPassportCleanup=null,!t){i.view3dPassportEl?.remove(),i.view3dPassportEl=null,i.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function Ic(i){let e=i.view3dEl;if(!e||i.view3dCompareSeatIds.length<2)return;Kt(i,!1);let t=i.view3dCompareSeatIds.map(h=>i.view3dComparisonSnapshot(h)).filter(h=>!!h);if(t.length<2){i.clearView3dComparison();return}let n=h=>L(h),o=t.some(h=>!!h.price),r=document.createElement("div");r.className="sl-view3d-compare-shell";let s=t.map((h,b)=>`<article><span>Seat ${b===0?"A":"B"}</span><strong>${n(h.label)}</strong><small>Section ${n(h.section)} \xB7 Row ${n(h.row)}</small><dl>`+(o?`<div><dt>Current price</dt><dd>${n(h.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${n(h.category)}</dd></div><div><dt>Availability</dt><dd>${n(h.availability)}</dd></div><div><dt>View source</dt><dd>${n(h.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${n(h.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${n(h.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${n(h.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${n(h.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${n(h.seat.id)}">Passport</button><button type="button" data-view-seat="${n(h.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${n(h.seat.id)}"${h.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");r.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${o?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${s}</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(r),e.classList.add("has-comparison"),i.view3dCompareEl=r;let d=r.querySelector(".sl-view3d-compare"),p=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=h=>{if(h.key==="Escape"){h.preventDefault(),Kt(i);return}if(h.key!=="Tab")return;let b=p();if(!b.length)return;let g=b[0],T=b[b.length-1];h.shiftKey&&document.activeElement===g?(h.preventDefault(),T.focus()):!h.shiftKey&&document.activeElement===T&&(h.preventDefault(),g.focus())};window.addEventListener("keydown",u),i.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);r.remove(),e.classList.remove("has-comparison"),i.view3dCompareEl===r&&(i.view3dCompareEl=null),a?.isConnected?a.focus():i.view3dCompareChip.mainButton()?.focus()},r.querySelector("[data-close]")?.addEventListener("click",()=>Kt(i)),r.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{let b=h.dataset.passportSeat,g=b?i.allSeats().find(T=>T.id===b):void 0;g&&Nr(i,g,h)})),r.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{let b=h.dataset.viewSeat;Kt(i,!1),b&&i.view3dHandle?.flyToSeat(b)})),r.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{let b=h.dataset.selectSeat;b&&am(i,b)})),requestAnimationFrame(()=>p()[0]?.focus()),i.emit3dAnalytics("3d_comparison_opened",{seatIds:i.view3dCompareSeatIds.slice()})}function Kt(i,e=!0){let t=i.view3dCompareCleanup;if(i.view3dCompareCleanup=null,!t){i.view3dCompareEl?.remove(),i.view3dCompareEl=null,i.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function am(i,e){if(i.salesClosed){i.toast(i.closedWords?.().toast??i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=i.allSeats().find(o=>o.id===e);if(!t)return;if(Kt(i,!1),!i.controller.select([e]).length){i.syncSelectionTo3d(),i.toast(i.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}i.syncSelectionTo3d(),i.showConfirm(t),i.emit3dAnalytics("3d_comparison_selected",{seatId:e})}var Nc=require("@seatlayer/core/view3d/crossfade/panorama");var Dr=require("@seatlayer/core");var lm=900,cm=450;function dm(i){switch(i){case"seat":return y("picker.stopYourSeat","Your seat");case"row":return y("picker.stopYourRow","Your row");case"section":return y("picker.stopYourSection","Your section");default:return y("picker.stopWholeVenue","Whole venue")}}function Oc(i,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let n=y("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",n),t.title=n,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let o=document.createElement("div");o.className="sl-view3d-stop",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),i.append(t,o);let r=null,s=null;return{onStopChange(a){if(r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null),!a){o.classList.remove("is-shown"),o.textContent="",s=setTimeout(()=>{s=null,i.classList.remove("is-seat-view")},cm);return}i.classList.add("is-seat-view"),o.textContent=dm(a),o.classList.add("is-shown"),r=setTimeout(()=>{r=null,o.classList.remove("is-shown")},lm)},dispose(){r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null),t.remove(),o.remove(),i.classList.remove("is-seat-view")}}}var pm=44,hm=92;function _c(i,e,t,n={}){let o=i?.sectionLabel,r=fe(i),s=um(i,e),a=[o,r?(0,Dr.t)("picker.rowLabel",{label:r}):null,s?(0,Dr.t)("picker.seatLabel",{label:s}):null].filter(Boolean).join(" \xB7 "),l=n.maxChars??(n.narrow?pm:hm);for(let c of[t,n.shortTail??t,null]){let d=[a,c].filter(Boolean).join(" \xB7 ");if(d.length<=l||c==null)return d}return a}function um(i,e){if(i?.seatNumber)return i.seatNumber;let t=i?.displayLabel??e,n=o=>{!o||!t.startsWith(o)||t.length<=o.length||(t=t.slice(o.length).replace(/^[\s·\-\/_]+/,""))};return n(i?.sectionLabel),n(fe(i)),t}var Dc=require("@seatlayer/core/core/seatConfidence");var mm=220;function fm(i,e,t){let n=null,o=null,r=null;return(s,a)=>{i()?.presentSeatHover?.(s,a,e),r=a,s!==o&&(o=s,n&&(clearTimeout(n),n=null),!(!s||!t)&&(n=setTimeout(()=>{if(n=null,o!==s)return;let c=t()?.(s)??null;c&&o===s&&i()?.presentSeatHover?.(s,r,e,c)},mm)))}}function Bc(i){return i.buyerView}function Fc(i,e,t){if(e==="map"){i.exit3d();return}let n=t?.flyToSeatId;if(i.buyerView==="venue3d"){n?(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:n}),i.view3dHandle?.flyToSeat(n)):t?.resetView&&i.view3dHandle?.focusOverview();return}i.enter3d(n)}function Vc(i,e){switch(i.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return i.priceBandKeys!=null&&!i.priceBandKeys.has(e.categoryKey)||i.controller.accessibilityFilterDims?.(e)||i.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function zc(i){if(!i.view3dHandle)return;let e=i.allSeats().map(t=>({seatId:t.id,state:i.seatState3dFor(t)}));i.view3dHandle.setAvailability(e)}function $c(i){i.view3dHandle&&i.view3dHandle.setSelection(i.controller.getSelection().map(e=>e.id))}async function jc(i,e){let t=i.allSeats().find(n=>n.id===e);if(!t)return null;if(t.viewUrl)try{let n=t.viewMeta?.previewUrl,o=!!n&&n!==t.viewUrl,r=o?await i.buyerAssetUrls.resolve(n):null,s=o?t.viewUrl:await i.buyerAssetUrls.resolve(t.viewUrl);return!s||o&&!r?null:{url:s,...r?{previewUrl:r}:{},...o?{resolveUrl:a=>i.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(n){return i.opts.onError?.(n),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:i.tf("picker.chartDerivedModel","Chart-derived model")}}function Gc(i,e){if(i.salesClosed){i.toast(i.closedWords?.().toast??i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),i.syncSelectionTo3d();return}let t=i.allSeats().find(a=>a.id===e);if(!t)return;let n=i.controller.tableSelection(e);if(i.committedSelection().some(a=>n?a.label===n.label:a.id===e)){i.controller.deselect([e]),i.dismissConfirm(),i.syncSelectionTo3d();return}let r=i.controller.getStatus(t.id);if(r==="held"||r==="booked"||r==="not_for_sale"){i.syncSelectionTo3d();return}if(!i.controller.select([e]).length){i.syncSelectionTo3d(),i.dismissConfirm();return}if(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),i.flashPickedSeat(e),n){i.showTableDialog(n,!1),i.syncSelectionTo3d();return}i.opts.confirmSelection!==!1?i.showConfirm(t):i.syncTray(),i.syncSelectionTo3d()}function Kc(i,e){let t=i.allSeats().find(n=>n.id===e);return _c(i.controller.seatDetails(e),t?.displayLabel??t?.label??e,i.tf("picker.viewFromYourSeat","view from your seat"),{narrow:i.root?.dataset.layout==="narrow",shortTail:i.tf("picker.fromYourSeat","from your seat")})}function Uc(i,e){if(i.buyerView!=="venue3d")return;let t=i.view3dCompareSeatIds;t.includes(e.id)||(i.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),i.confirmSeat?.id===e.id&&(i.controller.deselect([e.id]),i.dismissConfirm(),i.syncSelectionTo3d(),i.syncTray()),i.view3dCompareChip.sync(),i.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:i.view3dCompareSeatIds.length}),i.view3dCompareSeatIds.length>1?i.openView3dComparison():i.toast(i.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function qc(i){i.closeView3dComparison(!1),i.view3dCompareSeatIds=[],i.view3dCompareChip.remove(),i.emit3dAnalytics("3d_comparison_cleared")}function Wc(i,e){let t=i.allSeats().find(b=>b.id===e);if(!t)return null;let n=i.controller.seatDetails(t.id),o=i.controller.doc?.categories.find(b=>b.key===t.categoryKey),r=n?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),s=r!=null?i.paidPrice(t.categoryKey,n?.tierId??o?.tiers?.[0]?.id??null,r,t.label):void 0,a=i.controller.getStatus(t.id),l=a==="held"?i.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?i.tf("picker.sold","Sold"):a==="not_for_sale"?i.tf("picker.notForSale","Not for sale"):i.tf("picker.available","Available"),c=t.viewUrl?(0,Nc.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}:{}}):i.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=Rn(t.commercial).join(" \xB7 ")||i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),p=Us({...t.accessibility?.length?{accessibility:t.accessibility}:{},...n?.wheelchairSpaceType?{wheelchairSpaceType:n.wheelchairSpaceType}:{}}),u=p.length?`${p.join(" \xB7 ")} \xB7 metadata, not access certification`:i.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),h=(0,Dc.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:n?.displayLabel??t.displayLabel??t.label,section:n?.sectionLabel??t.sectionId??"\u2014",row:fe(n)??n?.rowLabel??"\u2014",category:n?.categoryLabel??o?.label??t.categoryKey,price:i.suppressPricing||s==null?"":i.money(s),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:u,confidence:h}}async function Yc(i,e){if(i.view3dEl||!i.canOffer3d()||!i.els.map)return;let t=i.controller.doc;if(!t)return;i.buyerView="venue3d",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),i.root?.setAttribute("data-view3d","on"),i.dismissConfirm(),i.syncProjection(),i.syncTray();let n=document.createElement("div");n.className="sl-view3d sl-mo-zoom",n.setAttribute("role","group"),n.setAttribute("aria-label",i.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let o=document.createElement("button");o.type="button",o.className="sl-view3d-back",o.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${i.tf("picker.backToMap","Back to map")}</span>`;let r=o.querySelector("span"),s=c=>{i.view3dTargetSeatId=c;let d=!!c;n.classList.toggle("is-seat-focused",d),i.root&&(i.root.dataset.view3dSeat=d?"on":"off");let p=d?i.tf("picker.backToVenue","Back to venue"):i.tf("picker.backToMap","Back to map");r&&(r.textContent=p),o.setAttribute("aria-label",p)};if(o.addEventListener("click",()=>{if(i.view3dTargetSeatId&&i.view3dHandle){i.view3dHandle.focusOverview();return}i.exit3d()}),i.regions["top-left"]?.prepend(o),i.view3dBack=o,i.publish3dTopInset(),yc(i.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let d=i.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",d),c.title=d,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||i.fsFallback||i.framedFs)),c.addEventListener("click",()=>i.toggleFullscreen()),n.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=i.tf("picker.loading3d","Building the 3D venue\u2026"),n.appendChild(a),i.els.map.appendChild(n),i.view3dEl=n,i.view3dCompareChip.sync(),requestAnimationFrame(()=>{n.style.opacity="1"});let l=++i.view3dGen;try{let c=i.allSeats(),[d,p]=await Promise.all([Yi(),i.controller.loadEventConfiguration()]),u=p?await io(p,v=>i.buyerAssetUrls.resolve(v)):null,h=t.theme?.venue3d?.shellAssetUrl,b=await no(h,v=>i.buyerAssetUrls.resolve(v));if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let g={doc:t,seats:c,...u?{eventConfigurationId:u.id,eventConfiguration:u}:{},...b?{registeredShellGlb:b}:{}};a.textContent=i.tf("picker.building3d","Building venue geometry\u2026");let T=await d.prepareVenue3D(g);if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let w=d.mountVenue3D(n,{...g,prepared:T},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:Nt(),navLabels:En(),seatViewActionLabel:v=>i.allSeats().find(M=>M.id===v)?.viewUrl?i.tf("picker.openAuthored360","Open venue 360\xB0"):i.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:v=>i.seatViewCaption(v),onSeatViewStopChange:v=>i.view3dSeatViewChrome?.onStopChange(v),onSeatPick:v=>i.onView3dSeatPick(v),onSeatInspect:v=>i.onView3dSeatPick(v),onSeatHover:fm(()=>i.controller.getRenderer(),n,()=>{let v=w.captureSeatView;return v?M=>v.call(w,M):void 0}),onSectionFocusChange:v=>{let M=n.querySelector('select[data-locator="section"]'),B=v??"";!M||M.value===B||(M.value=B,M.dispatchEvent(new Event("change")))},onViewTargetChange:v=>{n.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!v),s(v),i.opts.onBuyerViewChange?.({view:"venue3d",...v?{seatId:v}:{}})},...i.seatViewEnabled()?{getSeatView:v=>new Promise((M,B)=>{let X=()=>{i.seatViewFor3d(v).then(O=>{O?M(O):B(new Error("seat_view_unavailable"))})},f=globalThis.requestIdleCallback;typeof f=="function"?f(X,{timeout:1500}):setTimeout(X,50)})}:{},onAnalytics:(v,M)=>i.emit3dAnalytics(v,M)});i.view3dHandle=w,i.view3dSeatViewChrome=Oc(n,{handle:()=>i.view3dHandle}),requestAnimationFrame(()=>a.remove()),i.pushAvailabilityTo3d(),i.syncSelectionTo3d(),i.view3dNav=bc(i.regions["bottom-left"]??n,w),e&&w.flyToSeat(e)}catch(c){if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;i.opts.onError?.(c),i.toast(i.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),i.exit3d()}}function Xc(i){let e=i.regions["top-left"];if(!i.root||!e)return;let t=()=>{!i.root||i.root.dataset.view3d!=="on"||i.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function Qc(i){if(i.buyerView!=="venue3d"&&!i.view3dEl)return;i.view3dGen++,i.buyerView="map",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"map"}),i.root?.removeAttribute("data-view3d"),i.closeSeatConfidencePassport(!1),i.closeView3dComparison(!1),i.view3dCompareChip.remove(),i.view3dSeatViewChrome?.dispose(),i.view3dSeatViewChrome=null,i.view3dBack?.remove(),i.view3dBack=null,i.view3dNav?.remove(),i.view3dNav=null,i.root?.removeAttribute("data-view3d-seat"),i.root?.style.removeProperty("--sl-3d-top-inset");try{i.view3dHandle?.dispose()}catch{}i.view3dHandle=null;let e=i.view3dEl;i.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),i.syncProjection(),i.syncTray();let t=i.view3dReturnSeat;i.view3dReturnSeat=null,t&&i.committedSelection().some(n=>n.id===t.id)&&i.opts.confirmSelection!==!1&&i.showConfirm(t)}var Jc=require("@seatlayer/core");var ln=require("@seatlayer/core");function Zc(i){return Array.isArray(i)?i.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function Po(i,e,t=!1){let n=i.violations[0];return n==="numberOfPlacesToSelect"?i.remaining>0?(0,ln.t)("picker.selectExactMore",{count:i.remaining}):(0,ln.t)("picker.selectExactCount",{count:i.required}):n==="minimumSelectedPlaces"?(0,ln.t)("picker.selectMinimumMore",{count:i.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):n==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,ln.t)("picker.orphanHint")}var Br=6e4,ed=5*6e4,bm=String(Math.round(ed/6e4));function td(i){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(i.regions["bottom-center"]??i.els.map).appendChild(e),i.extendEl=e,i.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),i.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),i.els.extendBtn.textContent=id(i),i.els.extendDismiss.setAttribute("aria-label",i.tf("picker.close","Close")),i.els.extendBtn.addEventListener("click",()=>{i.handleExtend()}),i.els.extendDismiss.addEventListener("click",()=>{i.extendDismissed=!0,i.setExtendPrompt(!1,0)})}function id(i){return i.tf("picker.addMinutes","+{count} min").replace("{count}",bm)}function nd(i){let e=i.hold?.items??[],t=new Set(e.map(o=>o.label));return i.committedSelection().filter(o=>!t.has(o.label)).reduce((o,r)=>o+(r.quantity??1),0)+wt(i.gaQty,i.hold?.items??[])}function od(i){return(i.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function rd(i){let e=new Set((i.hold?.items??[]).map(n=>n.label)),t=i.committedSelection().filter(n=>!e.has(n.label)).reduce((n,o)=>n+(o.quantity??1),0);return i.heldTicketCount()+t+wt(i.gaQty,i.hold?.items??[])}function sd(i){let e=new Set((i.hold?.items??[]).map(o=>o.label)),t=i.committedSelection().filter(o=>e.has(o.label)).reduce((o,r)=>o+(r.quantity??1),0),n=Math.max(0,i.maxTickets-i.heldTicketCount()-wt(i.gaQty,i.hold?.items??[]));i.controller.setMaxSelection(t+n)}function ad(i,e=i.lastTrayCount,t=i.pendingSelectionCount()){let n=i.els.cta;if(!n)return;if(delete n.dataset.act,i.salesClosed){n.disabled=!0,n.textContent=i.closedWords?.().cta??i.tf("picker.salesClosedCta","Sales closed");return}if(i.ctaPhase==="holding"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(i.ctaPhase==="checkout"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let o=!i.hold&&i.performanceGroup?.selectionMode==="per_performance"?i.performanceGroup.submissionState?.():null;if(o&&!o.ready){n.disabled=!0,n.textContent=i.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(o.complete)).replace("{total}",String(o.total));return}let r=i.controller.getSelectionValidity(e);if(r&&!r.isValid){n.disabled=!0,n.textContent=Po(r,(s,a)=>i.tf(s,a),!0);return}if(!e&&i.root?.dataset.layout==="narrow"&&!i.performanceGroup&&!i.hold&&!i.bestAvailableSoldOut){n.disabled=!1,n.dataset.act="find",n.textContent=i.tf("picker.findBestSeats","Find best seats");return}n.disabled=e===0,n.textContent=i.hold?t?(0,Jc.t)("picker.secureMoreAndCheckout",{count:t}):i.tf("picker.continueToCheckout","Continue to checkout"):e?i.performanceGroup?i.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(i.performanceGroup.performanceCount)):i.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):i.tf("picker.selectSeats","Select seats")}function ld(i,e){i.ctaPhase=e,i.syncCta()}async function cd(i,e,t){i.setCtaPhase("checkout");try{await i.checkoutHandoff(e,t)}finally{i.ctaPhase==="checkout"&&!i.bookedShown&&i.setCtaPhase("idle")}}function dd(i){return`@seatlayer/hold/v1/${encodeURIComponent(i.apiBase)}/${encodeURIComponent(i.opts.event)}`}function pd(i){if(i.opts.initialHoldId)return i.opts.initialHoldId;if(i.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(i.holdStorageKey())}catch{return null}}function hd(i,e){if(!(i.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(i.holdStorageKey(),e.holdId)}catch{}}function ud(i){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(i.holdStorageKey())}catch{}}async function md(i,e,t=!1){try{let n=await i.controller.resumeHold(e);if(!n||i.destroyed)return null;let o={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items};return i.hold=o,i.handedOff=!0,i.bookedShown=!1,i.ctaPhase="idle",i.startHoldTimer(o.expiresAt),i.rememberHold(o),i.syncTray(),i.emitHoldChange(),i.opts.onHoldRestored?.(o,o.seats??[],i.buildHandoff(o)),o}catch(n){let o=n?.status;if(o===404||o===409)i.forgetHold();else if(o===401&&n?.code==="buyer_access_invalid")i.forgetHold(),i.toast(i.tf("picker.savedSeatsNotRestored","Your earlier seats could not be restored. Please choose again."),"warning");else if(i.opts.onError?.(n),t)throw n;return null}}async function fd(i){let e=i.rememberedHoldId();e&&await i.resumeHoldFromServer(e,!0)}function gd(i,e){i.stopHoldTimer(),i.holdExpiresAt=e,i.extendDismissed=!1,i.extendUsed=!1,i.hold&&i.rememberHold(i.hold);let t=i.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${i.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let n=t.querySelector('[data-ref="holdTime"]'),o=()=>{let r=Math.max(0,i.holdExpiresAt-Date.now());n&&(n.textContent=ra(r)),t.classList.add("on"),t.classList.toggle("is-expiring",r>0&&r<=Br),i.setExtendPrompt(r>0&&r<=Br,r),(r<=0||!i.controller.currentHold())&&i.stopHoldTimer()};i.holdTimer=setInterval(o,500),o()}function bd(i){i.holdTimer&&clearInterval(i.holdTimer),i.holdTimer=null,i.els.hold?.classList.remove("on","is-expiring"),i.setExtendPrompt(!1,0)}function yd(i,e,t){if(!i.extendEl)return;let n=e&&t>0&&i.root?.dataset.layout!=="narrow"&&!i.extendDismissed&&!i.extendUsed&&!!i.controller.currentHold()&&!i.bookedShown;i.extendEl.classList.toggle("on",n)}function vd(i){if(!i.holdTimer)return;let e=Math.max(0,i.holdExpiresAt-Date.now());i.setExtendPrompt(e>0&&e<=Br,e)}async function wd(i){let e=i.els.extendBtn,t=i.controller.currentHold();if(!(!t||!i.api.extend||i.extendUsed)){e.disabled=!0,e.textContent=i.tf("picker.addingEllipsis","Adding\u2026");try{let n=await i.api.extend(i.controller.key,t.holdId,ed);if(i.controller.currentHold()?.holdId!==t.holdId)return;i.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:n.expiresAt,items:t.items});let o=i.controller.currentHold();if(!o)return;i.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},i.holdExpiresAt=o.expiresAt,i.extendUsed=!0,i.extendEl?.classList.remove("on"),i.rememberHold(i.hold),i.emitHoldChange(),i.toast(i.tf("picker.moreTimeAdded","More time added. Your seats are still held."),"success")}catch(n){if(n?.reason==="extend_limit"){i.extendUsed=!0,i.setExtendPrompt(!1,0);return}i.opts.onError?.(n),i.toast(i.tf("picker.couldNotAddMoreTime","Couldn't add more time. Please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=id(i)}}}var Vr=require("@seatlayer/core");function xd(i){return i?.previousPrice!=null&&i.previousPrice>i.price?i.previousPrice:null}function kd(i){return vm(i)+(i.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!i.collapsed}">${i.esc(i.moreLabel)}</button>`:"")+wm(i.status)}function vm(i){let{esc:e,money:t}=i;return i.categories.map(n=>{let o=i.priceOf(n),r=i.rangeOf(n),s=i.offerOf(n.key),a=xd(s),l=i.activeKey===n.key;return`<div class="sl-price-row${i.bandKeys!=null&&!i.bandKeys.has(n.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(n.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(i.titleFor(n,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(i.colorOf(n))}"></span><span class="sl-price-label"><span class="sl-price-name">${e(n.label)}</span>`+(s?.offerName?Ln(s.offerName,e):"")+"</span>"+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(r!=null?`<span class="sl-price-amt">${r.min===r.max?e(t(r.min)):`${e(t(r.min))}\u2013${e(t(r.max))}`}</span>`:o!=null?`<span class="sl-price-amt">${e(t(o))}</span>`:"")+"</div>"}).join("")}function wm(i){let e=t=>t.replace(/[&<>"']/g,n=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[n]);return`<div class="sl-status-key" aria-label="${e(i.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(i.unavailable)}</span></div>`}function Fr(i){let e=Math.abs(i.scrollLeft),t=e>2,n=e+i.clientWidth<i.scrollWidth-2;return i.dataset.fadeStart=String(t),i.dataset.fadeEnd=String(n),{start:t,end:n}}function Sd(i){let{esc:e,money:t}=i;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${i.allActive}" title="${e(i.allWord)}"><span class="sl-rc-t">${e(i.allWord)}</span></button>`+i.categories.map(o=>{let r=i.rangeOf(o),s=i.priceOf(o),a=r?r.min===r.max?t(r.min):`${t(r.min)}+`:s!=null?t(s):null,l=Object.prototype.hasOwnProperty.call(i.left,o.key)&&i.left[o.key]<=0,c=xd(i.offerOf(o.key)),d=a?`${o.label}: ${a}${l?` (${i.soldOutWord})`:""}`:o.label;return`<button type="button" class="sl-rc" data-cat="${e(o.key)}" aria-pressed="${i.activeKey===o.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(i.colorOf(o))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??o.label)}</span></button>`}).join("")}function Td(i,e){let t=i.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let n=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(n.length<=5)return n.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let o=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),r=Math.ceil(o.length/4),s=[];for(let a=0;a<o.length;a+=r){let l=o.slice(a,a+r),c=Math.min(...l.map(p=>p.range.min)),d=Math.max(...l.map(p=>p.range.max));s.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 s}function Ed(i){if(i.els.pricesSec?.querySelectorAll(".sl-price-select").forEach(o=>o.remove()),i.priceSelect=null,i.suppressPricing||!i.els.prices||!i.els.pricesSec)return;let e=Td((i.controller.doc?.categories??[]).filter(o=>!o.notForSale),i.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",i.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let n=document.createElement("option");n.value="all",n.textContent=i.tf("picker.allPrices","All prices"),t.appendChild(n);for(let o of e){let r=document.createElement("option");r.value=o.id,r.textContent=o.label,t.appendChild(r)}i.els.pricesSec.appendChild(t),i.priceSelect=t,t.addEventListener("change",()=>{i.applyPriceBand(e.find(o=>o.id===t.value)?.keys??null)})}function Cd(i,e){if(i.focusedCatKey=null,i.priceBandKeys=e?new Set(e):null,i.priceSelect){let t=e?i.priceSelect.value:"all";i.priceSelect.value!==t&&(i.priceSelect.value=t)}i.controller.setCategoryFilter(e),i.controller.focusCategoryFilter(e),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}function Ad(i){return{colorOf:e=>i.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>i.catPriceRange(e),priceOf:e=>i.catPrice(e),offerOf:e=>i.offerPrice(e),money:e=>i.money(e),esc:q}}function Pd(i,e,t,n=i.legendDeps()){let o=i.els.railScroll,r=e.length>1;if(i.els.rail?.classList.toggle("has",r),!o)return;o.innerHTML=r?Sd({...n,categories:e,left:t,activeKey:i.focusedCatKey,soldOutWord:i.tf("picker.soldOut","Sold out"),allWord:i.tf("picker.allPrices","All prices"),allActive:!i.focusedCatKey&&!i.priceBandKeys}):"";let s=e.map(a=>a.key).join("|");i.lastRailSignature!==s&&(i.lastRailSignature=s,o.scrollLeft=0),o.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){i.applyPriceBand(null);return}i.focusCategory(a.dataset.cat??"")})}),i.railEdgesBound||(i.railEdgesBound=!0,o.addEventListener("scroll",()=>Fr(o),{passive:!0})),requestAnimationFrame(()=>Fr(o))}function Md(i){let e=i.controller.doc;if(!e||!i.els.prices)return;let t=i.controller.categoryAvailability(),n=e.categories.filter(p=>!p.notForSale);i.syncSoldout(n,t);let o=i.legendDeps(),r=i.suppressPricing,s=r?{...o,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:o;r&&(i.els.pricesSec?.querySelector("span")?.replaceChildren(i.tf("picker.seatCategories","Seat categories")),i.els.pricesInfo?.remove()),i.syncPriceRail(n,t,s);let a=5,l=n.length-a,c=l>1&&!i.pricesExpanded,d=c?n.slice(0,a):n;i.els.prices.classList.toggle("sl-expanded",l>1&&i.pricesExpanded),i.els.prices.innerHTML=kd({...s,categories:d,left:t,collapsed:c,activeKey:i.focusedCatKey,bandKeys:i.priceBandKeys,titleFor:(p,u)=>u?i.tf("picker.showAllSeats","Show all seats"):(0,Vr.t)("picker.showLabelSeatsOnMap",{label:p.label}),moreLabel:l>1?c?r?i.tf("picker.showAllCategories","Show all categories"):(0,Vr.t)("picker.showAllTicketTypes",{count:n.length}):i.tf("picker.showFewer","Show fewer"):null,status:{legend:i.tf("picker.seatStatusLegend","Seat status legend"),unavailable:i.tf("picker.notAvailable","Not available")}}),i.els.prices.querySelectorAll(".sl-price-row").forEach(p=>{p.addEventListener("mouseenter",()=>i.controller.getRenderer()?.setCategoryHighlight?.(p.dataset.cat??null)),p.addEventListener("mouseleave",()=>i.controller.getRenderer()?.setCategoryHighlight?.(null));let u=()=>i.focusCategory(p.dataset.cat??"");p.addEventListener("click",u),p.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),u())})}),i.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{i.pricesExpanded=!i.pricesExpanded,i.syncPrices()})}function Ld(i,e){if(!e)return;let t=i.focusedCatKey===e?null:e;i.focusedCatKey=t,i.priceBandKeys=t?new Set([t]):null;let n=i.els.pricesSec?.querySelector(".sl-price-select");n&&(n.value="all"),i.controller.setCategoryFilter(t?[t]:null),i.controller.focusCategoryFilter(t?[t]:null),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}var Mi=require("@seatlayer/core");function je(i,e,t){let n=(0,Mi.t)(i,t);return n&&n!==i?n:t?e.replace(/\{(\w+)\}/g,(o,r)=>r in t?String(t[r]):o):e}function km(i){let e=(0,Mi.tCount)("picker.seatCount",i);return e.includes("picker.seatCount")?`${i} ${i===1?"seat":"seats"}`:e}function Sm(i){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(i)}catch{}return i.join(", ")}function Tm(i){if(i.length<2)return!1;let e=[...i].sort((t,n)=>t-n);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function Em(i){let e=i.filter(o=>o.objectType==="ga"),t=i.filter(o=>o.objectType!=="ga"),n=[];if(t.length){let o=km(t.length),r=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],s=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(r.length===1&&s.length===1&&a.length===t.length){let l=t.length===1?je("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:r[0],row:s[0],seat:String(t[0].seatNumber??"")}):Tm(a)?je("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:r[0],row:s[0],from:Math.min(...a),to:Math.max(...a)}):"";n.push(l?je("picker.releasedPair","{first} \xB7 {second}",{first:o,second:l}):je("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:r[0]}))}else r.length===1?n.push(je("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:r[0]})):r.length>1?n.push(je("picker.releasedInSections","{seats} in Sections {sections}",{seats:o,sections:Sm(r)})):n.push(o)}for(let o of e)n.push(je("picker.releasedGa","{quantity} \xD7 {area}",{quantity:o.quantity??1,area:o.label}));return n.length?n.reduce((o,r)=>je("picker.releasedPair","{first} \xB7 {second}",{first:o,second:r})):""}function Hd(i){if(!i)return[];let e=new Map((i.seats??[]).map(o=>[o.label,o])),t=i.items??[];return(t.length?t.map(o=>({label:o.label,objectType:o.objectType,quantity:o.quantity})):[...e.keys()].map(o=>({label:o}))).map(o=>{let r=e.get(o.label);return{label:o.label,...o.objectType?{objectType:o.objectType}:{},...o.quantity==null?{}:{quantity:o.quantity},...r?.sectionLabel?{sectionLabel:r.sectionLabel}:{},...r?.rowLabel?{rowLabel:fe(r)??r.rowLabel}:{},...r?.seatNumber?{seatNumber:r.seatNumber}:{}}})}function Rd(i,e){if(!i.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let n=i.seatByLabel(t.label);!n||i.statusOf(n.id)!=="free"||i.flash(n.id,i.accent)}}function Id(i,e){if(!e.recoverable.length||!i.isConnected)return;let t=i.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(s=>(0,Mi.t)("picker.seatJustTakenByAnother",{label:s})).join(" "):t.remove());let n=i.querySelector(".sl-interrupt-actions"),o=n?.querySelector(".sl-interrupt-act");if(!n||!o)return;o.classList.add("sl-interrupt-act-secondary");let r=document.createElement("button");r.type="button",r.className="sl-interrupt-act sl-hold-expired-recover",r.textContent=(0,Mi.tCount)("picker.holdLapsedSelectAgain",e.recoverable.length),r.addEventListener("click",()=>e.onRecover([...e.recoverable])),n.insertBefore(r,o),i.classList.add("has-recovery"),r.focus()}function Od(i,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let n=document.createElement("div");n.className="sl-interrupt-card sl-mo-in";let o=document.createElement("div");o.className="sl-interrupt-title",o.id="sl-hold-expired-title";let r=document.createElement("span");r.className="sl-interrupt-glyph",r.setAttribute("aria-hidden","true"),r.textContent="\u23F1";let s=document.createElement("span");s.textContent=je("picker.holdExpiredTitle","Your seats were released"),o.append(r,s);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=je("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),n.append(o,a);let l=Em(e);if(l){let u=document.createElement("div");u.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",u.textContent=l,n.appendChild(u)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=je("picker.holdExpiredPickAgain","Pick your seats again to continue. They may already be taken."),n.appendChild(c),t.setAttribute("aria-labelledby",o.id),t.setAttribute("aria-describedby",a.id);let d=document.createElement("div");d.className="sl-interrupt-actions";let p=document.createElement("button");return p.type="button",p.className="sl-interrupt-act sl-hold-expired-restart",p.textContent=je("picker.holdExpiredRestart","Choose seats again"),p.addEventListener("click",()=>i.restart()),d.appendChild(p),n.appendChild(d),t.appendChild(n),t.addEventListener("pointerdown",u=>{u.target===t&&i.restart()}),t}var at=require("@seatlayer/core");var _d={wheelchair:"Wheelchair space",companion:"Companion seat","semi-ambulatory":"Limited mobility","designated-aisle":"Aisle / transfer","step-free":"Step-free",hearing:"Assistive listening",cart:"Live captions","sign-language":"Sign language","low-vision":"Low vision","sensory-friendly":"Sensory-friendly","plus-size":"Plus-size","lift-armrest":"Lift-up armrest"},Cm='<svg viewBox="0 0 20 20" width="17" height="17" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="10" cy="10" r="7.5" /><path d="M10 2.5a7.5 7.5 0 0 1 0 15Z" fill="currentColor" stroke="none" /></svg>',Am='<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>',Pm=8,Mm=8,Lm=88;function Hm(i){let e=i.gap??Pm,t=i.margin??Mm,n=i.min??Lm,o=Math.max(i.boundsTop,0);return Math.max(Math.round(i.buttonTop-o-e-t),n)}var Mo=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let o=this.offered().length>0?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",o),this.button.innerHTML=Am,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=na(o,t.tf("picker.close","Close"))+oa(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",r=>r.stopPropagation()),this.button.addEventListener("click",r=>{r.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",r=>{r.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",r=>r.stopPropagation()),this.menu.addEventListener("click",r=>r.stopPropagation()),this.menu.addEventListener("focusin",r=>{let s=r.target;s&&typeof s.scrollIntoView=="function"&&s.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=r=>{r.key==="Escape"&&this.open(!1)},this.reflow=()=>{this.menu.hidden||this.fit()},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),window.addEventListener("resize",this.reflow),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let 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:n,count:o})=>[n,o])),t=!1;for(let n of this.menu.querySelectorAll("[data-a11y-row]")){let o=n.dataset.a11yRow??"";if(!o.startsWith("a11y:"))continue;let r=o.slice(5),s=e.get(r);if(s===void 0)continue;let a=this.countNode(n),l=s==null?"":this.countText(s);a&&(a.textContent=l);let c=s===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(r,l))),n.disabled=c,c?n.setAttribute("aria-disabled","true"):n.removeAttribute("aria-disabled"),c&&this.active.delete(r)&&(this.paint(n,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let n=t.dataset.a11yRow??"";n.startsWith("a11y:")&&this.paint(t,this.active.has(n.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${Hm({boundsTop:this.boundsTop(),buttonTop:this.button.getBoundingClientRect().top})}px`)}boundsTop(){let e=this.root.closest(".sl-map")??this.root.closest(".sl-picker");return e instanceof HTMLElement?e.getBoundingClientRect().top:0}open(e){if(e===!this.menu.hidden)return;if(this.button.setAttribute("aria-expanded",String(e)),!e){this.menu.hidden=!0,this.menu.classList.remove("sl-mo-in","sl-mo-stagger");return}this.menu.hidden=!1,this.fit(),this.menu.scrollTop=0;let t=this.button.getBoundingClientRect();ar(this.menu,{x:t.left+t.width/2,y:t.top}),Oa(this.menu),Ia(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:(0,at.seatTypeIconSvg)("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:Cm,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:n,count:o})=>({key:n,count:o}));let t=this.deps.present;return t?at.ACCESSIBILITY_TYPES.filter(({key:n})=>t.has(n)).map(({key:n})=>({key:n,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(at.ACCESSIBILITY_TYPES.map(n=>[n.key,n]));return this.offered().flatMap(({key:n,count:o})=>{let r=t.get(n);return r?[{key:`a11y:${n}`,iconHtml:(0,at.seatTypeIconSvg)(n,{size:17}),label:this.deps.tf(`picker.accessShort.${n}`,_d[n]??r.label),...n==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...o==null?{}:{count:this.countText(o),disabled:o===0},on:this.active.has(n)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),n=!t?.classList.contains("open");for(let o of this.menu.querySelectorAll(".sl-info.open"))o.classList.remove("open"),o.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",n),e.setAttribute("aria-expanded",String(n))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let r=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(r),this.paint(e,r);return}if(t==="limited"){let r=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(r),r&&this.deps.focusSeatsForFilter(),this.paint(e,r);return}let n=t.slice(5),o=!this.active.has(n);o?this.active.add(n):this.active.delete(n),this.paint(e,o),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let n=(e.dataset.a11yRow??"").slice(5),o=e.parentElement;o?.classList.contains("sl-a11yrow-w")||(o=document.createElement("div"),o.className="sl-a11yrow-w",e.replaceWith(o),o.appendChild(e));let r=document.createElement("button");r.type="button",r.className="sl-a11yrow-c sl-a11yjump",r.dataset.a11yJump=n,r.textContent=t.textContent,r.disabled=e.disabled,r.setAttribute("aria-label",this.jumpLabel(n,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(n,r.textContent??""));let s=o.querySelector(".sl-info");s?s.after(r):e.after(r),o.dataset.a11yTapThrough||(o.dataset.a11yTapThrough="true",o.addEventListener("click",a=>{a.target===o&&!e.disabled&&e.click()})),r.addEventListener("click",a=>{a.stopPropagation(),this.active.has(n)||(this.active.add(n),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(n);l&&r.setAttribute("aria-label",this.jumpLabel(n,r.textContent??"",l.label))})}}countText(e){return e>0?(0,at.t)("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=_d[e]??at.ACCESSIBILITY_TYPES.find(n=>n.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,n){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...n?[`${this.deps.tf("picker.section","Section")} ${n}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};var Nd=require("@seatlayer/core"),Rm=250;function Dd(i,e=Rm){let t=null,n=()=>{t===null&&(t=setTimeout(()=>{t=null,i()},e))},o=(0,Nd.attachVisibilityCatchUp)(n),r=typeof window<"u"&&typeof window.addEventListener=="function";return r&&window.addEventListener("focus",n),()=>{t!==null&&(clearTimeout(t),t=null),o(),r&&window.removeEventListener("focus",n)}}var Ut=require("@seatlayer/core");var Lo=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,Ut.holdRecoveryShape)(e),n=e.lapsedLabels.length,o=n-e.recoverable.length,r=t==="all"?(0,Ut.tCount)("picker.holdLapsedStillFree",n):t==="partial"?(0,Ut.tCount)("picker.holdLapsedSomeTaken",o):(0,Ut.tCount)("picker.holdLapsedAllTaken",n);this.note={message:r,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(r,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>${q(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${q(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,Ut.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 Bd=Symbol("seatlayer.performance-group-picker");function Ho(i,e){return Object.defineProperty(i,Bd,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),i}function Fd(i){return i[Bd]??null}var Vd="@seatlayer/pending-checkout/v1";function Im(i){return typeof i=="string"&&i.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(i)}function Li(i){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let n=null;try{let o=window.sessionStorage.getItem(Vd);if(o){let r=null;try{r=JSON.parse(o)}catch{}if(r&&Im(r.orderId)){let s=Date.now()-Number(r.storedAt);if(s>=0&&s<=144e5){if(r.eventKey&&r.eventKey!==i)return null;n=r.orderId}}}window.sessionStorage.removeItem(Vd)}catch{}e.delete("seatlayer_checkout");try{let o=e.toString();history.replaceState(history.state,"",`${location.pathname}${o?`?${o}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:n}}function zd(i){if(!i.framed)return null;let e=i.ancestorOrigins?.length?i.ancestorOrigins[0]:null;for(let t of[e,i.referrer])if(t)try{return new URL(t).origin}catch{}return null}var $d="https://api.seatlayer.io",Om=10,_m=250,jd=6e4,Gd=4,Nm=10,Dm=40,Bm=220,zr=["mini","peek","open"],Kd="seatmap.a11y.cb";function Fm(){try{if(typeof window>"u")return null;let i=window.localStorage.getItem(Kd);return i==null?null:i==="1"}catch{return null}}function Vm(i){try{window.localStorage.setItem(Kd,i?"1":"0")}catch{}}var lt=class i{constructor(e){this.renderErrorEmitted=!1;this.realtime=null;this.accessEl=null;this.idleClock=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.viewportResizeHandler=null;this.holdTimer=null;this.loadAbort=null;this.transportAbort=new AbortController;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerCountdownTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.currencyResolved=!1;this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedWaiters=[];this.seatsRevealedReport=null;this.renderResolvedAt=null;this.revealWaitMs=null;this.handoverMs=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.bestAvailableConfirm=!1;this.baSoldOutSig="";this.bestAvailableSoldOut=!1;this.salesClosed=!1;this.salesState=null;this.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 So({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(e,t)=>this.toast(e,t)});this.view3dCompareEl=null;this.view3dCompareCleanup=null;this.view3dSeatViewChrome=null;this.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.arenaViewportInsets={top:0,right:0,bottom:0,left:0};this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.fullscreenAffordanceSize={rootWidth:-1,rootHeight:-1,viewportWidth:-1,viewportHeight:-1};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.sectionCardCache=null;this.lastTrayCount=0;this.langSel=null;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yMenu=null;this.detachAttention=null;this.lapse=new Lo({toast:(e,t,n)=>this.toast(e,t,n),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalCleanup=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.fitScheduled=!1;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=Fd(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??$d).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},n=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Xn({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:n?.access??gi(e,t),this.pubApi=e.transport?null:n?.api??new ft(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=vl(e.transport??this.pubApi,this.transportAbort.signal),this.chartFetch=Un(this.api),this.buyerAssetUrls=new ki(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 a custom `transport` owns its backend, so the picker is staying on onCheckout for this mount.'),this.checkoutMode=e.checkout==="hosted"&&this.pubApi?"hosted":"handoff";let o=e.numberOfPlacesToSelect;if(o!=null&&(!Number.isInteger(o)||o<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=o??null;let r=Zc(e.selectionValidators);if(this.exactTickets!=null&&r>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let s=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(Om,r)));if(this.exactTickets!=null&&s<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&s<r)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??s,this.cbSafe=Fm()??!!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 Ti(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=zd({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let n=t<640?1.2:.62;return Math.max(420,Math.round(t*n))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-Gd&&t.width>=window.innerWidth-Gd}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let n=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=n,e.tabIndex=n?-1:0,e.setAttribute("aria-hidden",String(n))}fullscreenMeasurementChanged(e,t){let n=typeof window>"u"?0:window.innerWidth,o=typeof window>"u"?0:window.innerHeight,r=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||n!==this.fullscreenAffordanceSize.viewportWidth||o!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:n,viewportHeight:o},r}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.root?.setAttribute("data-fs",String(e)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let n=this.els.zfs?.querySelector(".sl-zfs-lbl");n&&(n.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){Si();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement("div");n.className="sl-modal-scrim";let o=document.createElement("div");o.className="sl-modal-frame",o.style.setProperty("--sl-bg",pi(void 0,e.theme)["--sl-bg"]),o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",y("picker.seatSelection","Seat selection")),o.tabIndex=-1,n.appendChild(o),document.body.appendChild(n);let r=document.body.style.overflow;document.body.style.overflow="hidden";let s=yl(n),a;try{a=new i({...e,container:o})}catch(g){throw s(),n.remove(),document.body.style.overflow=r,g}a.prevFocus=t,a.modalCleanup=()=>{a.modalCleanup=null,s(),document.body.style.overflow=r,a.escHandler&&document.removeEventListener("keydown",a.escHandler),n.remove();let g=a.prevFocus;a.prevFocus=null,g?.isConnected&&g.focus({preventScroll:!0})};let l=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),c=()=>{let g=[...o.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(T=>T.isConnected&&!T.closest('[hidden], [aria-hidden="true"], [inert]'));return g[g.length-1]??o},d=(g,T)=>{let w=g;for(;w;){let v=window.getComputedStyle(w);if(w.hidden||w.getAttribute("aria-hidden")==="true"||w.hasAttribute("inert")||v.display==="none"||v.visibility==="hidden"||v.visibility==="collapse")return!0;if(w===T)return!1;w=w.parentElement}return!0},p=g=>[...g.querySelectorAll(l)].filter(T=>T.tabIndex>=0&&!T.matches(":disabled")&&!d(T,g)),u=(g,T)=>{let w=p(g),v=T?w[w.length-1]:w[0];v?v.focus({preventScroll:!0}):(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus({preventScroll:!0}))},h=!1,b=()=>{if(h)return;h=!0,a.modalCleanup?.();let g=()=>{a.destroy(),e.onClose?.()};a.hold&&!a.handedOff&&e.holdOnClose!=="keep"?a.release().finally(g):g()};a.closeModal=b,n.addEventListener("mousedown",g=>{g.target===n&&b()}),a.escHandler=g=>{if(g.key==="Tab"){if(g.defaultPrevented)return;let T=c(),w=p(T),v=w[0],M=w[w.length-1],B=document.activeElement;!v||!M?(g.preventDefault(),u(T,g.shiftKey)):B===T||!B||!T.contains(B)?(g.preventDefault(),(g.shiftKey?M:v).focus({preventScroll:!0})):g.shiftKey&&B===v?(g.preventDefault(),M.focus({preventScroll:!0})):!g.shiftKey&&B===M&&(g.preventDefault(),v.focus({preventScroll:!0}));return}g.key==="Escape"&&(a.tableDialog?(g.preventDefault(),a.cancelTableDialog()):a.confirmSeat?(g.preventDefault(),a.cancelConfirm()):a.bestAvailableConfirm?(g.preventDefault(),a.bestAvailableConfirm=!1,a.syncTray()):(g.preventDefault(),b()))},document.addEventListener("keydown",a.escHandler);try{let g=a.render();a.els.close?.classList.add("on"),a.els.close?.addEventListener("click",b),await g}catch(g){throw a.destroy(),g}return a.destroyed||u(c(),!1),a}static prewarm(e){try{if(!e||typeof e!="object"||typeof e.event!="string"||!e.event||typeof e.publicKey!="string"||!e.publicKey)return;La({base:(e.apiBase??$d).replace(/\/+$/,""),event:e.event,publicKey:e.publicKey})}catch{}}wireController(e){return new F.PickerController({sectionPreview:!0,transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.mapPriceRanges(),flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:di(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,this.drainSeatsRevealedWaiters(),this.revealWaitMs===null&&this.renderResolvedAt!==null&&(this.revealWaitMs=performance.now()-this.renderResolvedAt),e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let n=this.controller.getGAAreas().find(o=>o.id===t);n&&(this.collapseSheet(),ur(this,n,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),Cl(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,n=this.holdConflicted;this.holdExpiredUnits=Hd(this.hold),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(()=>{if(t||n){this.toast((0,F.t)("picker.holdExpired",void 0)||"Your hold expired. Seats released. Pick again.","warning");return}this.showHoldExpired()}),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.closedWords().toast,"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.closedWords().toast,"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){if(this.opts.confirmSelection===!1||this.salesClosed){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}this.showConfirm(t,"remove");return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast((0,F.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),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>{this.renderErrorEmitted=!0,this.opts.onError?.(t)}})}async render(){if(this.rendered)return this;let e=performance.now(),t={},n=h=>Math.round((performance.now()-h)*100)/100;this.rendered=!0,Si();let o=performance.now(),r=Vn(this.opts.locale,this.opts.messages),s=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=Ns(this.opts.container),{root:c,els:d,mapHost:p}=va(l,(h,b)=>this.tf(h,b),this.opts.theme);this.root=c,this.els=d,this.mapHost=p,zn(c,r,h=>{t.loadLocale=n(o),this.destroyed||this.applyActiveLocale(h,s)}),xc(c,()=>[{open:()=>!!this.holdExpiredEl,close:()=>this.restartAfterHoldExpiry()},{open:()=>this.tipPinned,close:()=>this.unpinTooltip()},{open:()=>!!this.tableDialog,close:()=>this.cancelTableDialog()},{open:()=>!!this.confirmSeat,close:()=>this.cancelConfirm()},{open:()=>this.bestAvailableConfirm,close:()=>{this.bestAvailableConfirm=!1,this.syncTray()}}]),this.syncFullscreenButtons(),this.wireBuyerShell(c);let u=document.createElement("div");return u.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(u),t.mountBuyerShell=n(a),t.skeletonPaint=n(e),this.loadAndFinishChart(u,t,n,e,c)}async loadAndFinishChart(e,t,n,o,r){this.startRealtime(),this.startIdleClock(r);let s=await this.loadChart(e,t,n);if(!s)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=n(o);let a=performance.now();if(this.salesClosed=!!s.salesClosed||!!this.opts.readOnly,this.salesState=s.salesState??null,r.dataset.eventMode=s.mode==="test"?"test":"live",!this.opts.locale&&s.locale&&this.setLocale(s.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),s.mode==="test"){let v=document.createElement("div");v.className="sl-testbadge",v.textContent=_s((0,F.t)("picker.testMode"),(0,F.getLocale)()),v.setAttribute("aria-label",(0,F.t)("picker.testMode")),v.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"),this.regions["top-left"].appendChild(v)}let l=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(r),this.watchThemeMode(),this.currency=s.currency??this.opts.currency??"USD",this.currencyResolved=!0,this.eventTimezone=s.timezone??null,Ds(this.els.logo,[this.opts.theme?.logoUrl,l?.logoUrl,s.posterUrl],this.opts.theme?.brandName??l?.brandName??s.eventName??"?"),this.els.name.textContent=s.eventName??"";let c=s.startsAt?Mn(s.startsAt,s.timezone??null,this.opts.locale):"";this.eventWhenText=c||null,this.els.meta.textContent=[s.venue,c].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(l);let d=!!this.controller.doc&&this.controller.getExpandedSeats().some(v=>v.commercial?.restrictedView||v.commercial?.obstructedView);this.buildAccessibilityMenu(d),this.buildLanguageSwitcher(this.els.zoom??this.regions["bottom-right"]),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),r.appendChild(this.srEl),this.buildArenaChrome(),this.buildMinimap(),this.buildPriceFilter(),this.buildExtendPrompt(),this.buildBookedOverlay(),this.buildSoldoutOverlay(),this.buildPanelToggle(),this.opts.panelCollapsed&&this.setPanelCollapsed(!0),this.dockLayoutChrome(),t.buildBuyerControls=n(a);let p=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=n(p),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncOffer(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let u=this.controller.doc,h=Kn(this.opts.event),b=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),g=b??"event",T={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:g,surface:b==="season"?"season_picker":b==="performance_group"?"performance_group_picker":"seat_picker",ms:n(o),performanceProfile:t,seatCount:this.allSeats().length,objectCount:u?.objects.length??0,sectionCount:u?.objects.filter(v=>v.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:u?.name,view:this.buyerView,load:h,transport:this.opts.transport?"custom":"pubapi",revealWaitMs:this.revealWaitMs??this.sinceRenderResolved(),handoverMs:this.handoverMs??void 0};Mc(T,(v,M)=>this.emitAnalytics(v,M));let w=s.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",_r({...T,performanceProfile:{...T.performanceProfile,...w}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=s,await this.registerAgentTools(),this}registerAgentTools(){return Cc(this)}webMcpHost(e){return Or(this,e)}wireBuyerShell(e){this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler)),this.detachAttention=Dd(()=>{this.destroyed||this.controller.refreshAvailability()}),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit?.addEventListener("click",()=>this.controller.overview()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let o=this.els.sheetToggle;this.syncSheetAffordance();let r=0,s=!1,a=!1,l=!1;o?.addEventListener("click",c=>{c.stopPropagation(),!s&&this.cycleSheet()}),t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard")){a=!1;return}l=!!c.target.closest?.(".sl-sheet-toggle"),a=!0,s=!1,r=c.clientY,(l&&o?o:t).setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!a||s)return;let d=c.clientY-r;d<-18?(this.stepSheet(1),s=!0):d>18&&(this.stepSheet(-1),s=!0)}),t.addEventListener("pointerup",c=>{a&&!s&&!l&&Math.abs(c.clientY-r)<6&&this.cycleSheet(),a=!1,(l&&o?o:t).releasePointerCapture?.(c.pointerId),l=!1})}this.els.foot?.addEventListener("click",o=>{this.root?.dataset.layout==="narrow"&&(o.target.closest?.('.sl-chip,button,a,input,select,label,[role="button"]')||this.cycleSheet())});let n=()=>{if(this.root?.dataset.layout!=="narrow")return;let o=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!o)),this.els.pricesSec?.setAttribute("aria-expanded",String(!o)),!o&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",o=>{o.target.closest("select,button")||n()}),this.els.pricesSec?.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||o.target.closest("select,button")||(o.preventDefault(),n())}),e.addEventListener("click",o=>{let r=o.target.closest("[data-sl-info]");if(!r||!e.contains(r))return;o.stopPropagation();let s=r.closest(".sl-info"),a=!s?.classList.contains("open");this.closeInfoPops(s),s?.classList.toggle("open",a),r.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",o=>{o.target.closest(".sl-info")||this.closeInfoPops()}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("pointerdown",o=>{this.handleMapPointerDown(o)},!0),this.els.map.addEventListener("mousemove",o=>{if(this.tipPinned)return;let r=this.els.map.getBoundingClientRect();this.tipPos={x:o.clientX-r.left,y:o.clientY-r.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.els.cta.dataset.act==="find"?this.openBestSeatsForm():this.handleCta()})}sheetState(){let e=this.root?.dataset.sheet;return e==="mini"||e==="open"?e:"peek"}sheetHasCards(){return this.root?.getAttribute("data-has-selection")==="true"}setSheetState(e){let t=this.root;if(!t)return;let n=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),n==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),n=this.els.sheetToggle;n?.setAttribute("aria-expanded",String(e==="open")),n?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=zr.indexOf(this.sheetState()),n=Math.min(zr.length-1,Math.max(0,t+e));this.setSheetState(zr[n])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let n=e.clientWidth;if(n<=0)return;let o=e.clientHeight,r=n!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:n,height:o};let s=this.fullscreenMeasurementChanged(n,o);this.reportFramedHeight();let a=n<640?"narrow":"wide",l=o<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.setNarrowLayout?.(a==="narrow"),queueMicrotask(()=>this.syncFitClearance()),this.controller.getRenderer()?.setSectionFocusDim?.(a!=="narrow"),a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),(s||c)&&this.syncFullscreenAffordance(),this.syncArenaViewportInsets(),r&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),this.els.map&&this.ro.observe(this.els.map),this.viewportResizeHandler=()=>{this.fullscreenMeasurementChanged(e.clientWidth,e.clientHeight)&&this.syncFullscreenAffordance()},window.addEventListener("resize",this.viewportResizeHandler),t(),requestAnimationFrame(t)}async loadChart(e,t,n){let o=performance.now();this.seatsRevealed=!1,this.seatsRevealedWaiters=[],this.seatsRevealedReport=null,this.renderResolvedAt=null,this.revealWaitMs=null,this.handoverMs=null,this.loadAbort=new AbortController;let r=await ui(async()=>{this.renderErrorEmitted=!1;let l=await this.controller.render(e);return this.renderResolvedAt=performance.now(),this.seatsRevealed&&(this.revealWaitMs=0),this.viewportLoading()&&this.drainSeatsRevealedWaiters(),l},this.loadAbort.signal,()=>{let l=this.els.boot.querySelector(".sl-boot-say");l&&(l.classList.add("is-visible"),l.textContent=this.tf("picker.loadingTakingLonger","The seat map is taking longer to load. Please wait\u2026"))});if(this.loadAbort=null,r.outcome==="cancelled"||this.destroyed)return null;let s=r.outcome==="loaded"?r.value:null,a=r.outcome==="loaded"&&!s&&!this.opts.transport?qn(this.chartFetch?.outcome(),this.renderErrorEmitted):null;if(s||this.controller.destroy(),t.loadChartAndStatuses=n(o),this.destroyed)return null;if(!s){a&&Wn({apiBase:this.apiBase,eventKey:this.opts.event,reason:a}),Ze({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:r.outcome==="timeout"?"load_timeout":r.outcome==="error"?"render_error":"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:st(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let l=this.opts.transport?void 0:this.chartFetch?.outcome();if(l?.state==="rejected"&&l.error?.status===404){let c=l.error;c.serverMessage&&console.warn(`[SeatLayer] ${c.serverMessage}`),this.opts.onError?.(c),Ei(this.els.boot,{title:this.tf("picker.eventUnavailableTitle","This event isn\u2019t available"),description:this.tf("picker.eventUnavailable","Tickets can\u2019t be booked here right now.")});for(let d of[this.els.side,this.els.rail])d&&(d.setAttribute("inert",""),d.style.display="none");return null}return Ei(this.els.boot,{title:this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load"),description:this.tf("picker.checkConnection","Check your connection and try again."),actionLabel:this.tf("picker.accessRetry","Try again")}),this.els.boot.querySelector("button").addEventListener("click",()=>{if(this.destroyed||!this.root)return;this.controller=this.wireController(this.opts),Ei(this.els.boot,{title:this.tf("picker.loadingSeatMap","Loading seat map\u2026"),busy:!0});let c=performance.now();this.loadAndFinishChart(e,{},n,c,this.root)},{once:!0}),null}return Object.assign(t,s.performanceProfile),s}sinceRenderResolved(){return this.renderResolvedAt===null?void 0:performance.now()-this.renderResolvedAt}whenSeatsRevealed(e){if(!this.destroyed){if(this.seatsRevealed||this.viewportLoading()&&this.renderResolvedAt!==null){e();return}this.seatsRevealedWaiters.push(()=>{this.destroyed||e()})}}viewportLoading(){return this.opts.loadingReveal==="viewport"}drainSeatsRevealedWaiters(){let e=this.seatsRevealedWaiters;this.seatsRevealedWaiters=[];for(let t of e)try{t()}catch{}}async restoreHoldForFirstPaint(e){let t=[this.els.side,this.els.rail].filter(Boolean),n=t.map(o=>o.hasAttribute("inert"));t.forEach(o=>o.setAttribute("inert",""));try{for(;!this.destroyed;){let o=performance.now();try{return await this.restoreRememberedHold(),!this.destroyed}catch{if(this.destroyed)return!1;Ze({apiBase:this.apiBase,event:this.opts.event,reconnects:this.realtime?.reconnects??0,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"restore_hold",ms:performance.now()-o,performanceProfile:e,view:"map",load:st(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let s=Ei(this.els.boot,{title:this.tf("picker.restoreUnavailableTitle","Unable to check saved seats"),description:this.tf("picker.restoreUnavailable","Try again to check whether your saved seats are still held."),actionLabel:this.tf("picker.accessRetry","Try again")}),a=this.transportAbort.signal;if(await new Promise(l=>{let c=()=>{s.removeEventListener("click",c),a.removeEventListener("abort",c),l()};s.addEventListener("click",c,{once:!0}),a.addEventListener("abort",c,{once:!0}),a.aborted&&c()}),this.destroyed||a.aborted)return!1;Ei(this.els.boot,{title:this.tf("picker.restoringSeats","Checking your saved seats\u2026"),busy:!0})}}return!1}finally{t.forEach((o,r)=>{n[r]||o.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=Li(this.opts.event);e?.outcome!=="success"||!e.orderId||this.openCheckoutPanel({kind:"resume",orderId:e.orderId})}buildPanelToggle(){if(!this.regions["top-right"])return;let e=document.createElement("button");e.type="button",e.className="sl-side-toggle",e.addEventListener("click",()=>this.setPanelCollapsed(!this.sideCollapsed)),this.sideToggleEl=e,this.regions["top-right"].appendChild(e),this.syncPanelToggle()}syncPanelToggle(){let e=this.sideToggleEl;if(!e)return;let t=this.sideCollapsed;e.setAttribute("aria-expanded",String(!t)),e.setAttribute("aria-label",t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=t?`<svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span>${this.tf("picker.tickets","Tickets")}</span>`:'<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>'}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){let e=this.root?.dataset.layout!=="narrow";this.root?.setAttribute("data-side-collapsed",String(this.sideCollapsed)),this.els.side?.toggleAttribute("inert",this.sideCollapsed&&e),this.syncPanelToggle()}buildAccessibilityMenu(e){let t=this.els.zoom??this.regions["bottom-right"]??this.els.map;t&&(this.a11yMenu=new Mo(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(n,o)=>this.tf(n,o),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:n=>this.setColorblindSafe(n),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:n=>{this.limitedViewFilter=n,this.controller.setCommercialLimitedFilter(n),this.pushAvailabilityTo3d()},applyAccessibilityFilter:n=>this.applyAccessibilityFilter(n),focusSeatsForFilter:()=>this.whenSeatsRevealed(()=>this.focusSeatsForFilter()),stepToAccessibleSection:n=>this.controller.focusNextAccessibleSection?.([n])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast((0,F.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,n=this.els.headInfo?.parentElement;t&&n&&t.parentElement!==n&&(t.classList.add("sl-fs-pill"),n.insertBefore(t,this.els.hold??null));let o=this.extendEl;if(o){let s=e?this.regions["bottom-center"]??this.els.map:n;s&&o.parentElement!==s&&(o.dataset.dock=e?"map":"head",s===n?s.insertBefore(o,this.els.close??null):s.appendChild(o))}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(){td(this)}buildBookedOverlay(){let e=document.createElement("div");e.className="sl-booked",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<div class="sl-booked-badge"><svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5"/></svg></div><div class="sl-booked-title">${this.tf("picker.allSetTitle","You're all set")}</div><div class="sl-booked-sub" data-ref="bookedSub"></div><ul class="sl-booked-list" data-ref="bookedList"></ul><button type="button" class="sl-booked-back" data-ref="bookedBack"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${q(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}closedWords(){return da(this.salesState,!!this.opts.readOnly)}tf(e,t){return y(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),n=document.createElement("div");n.className="sl-soldout-eyebrow",n.textContent=t;let o=document.createElement("div");o.className="sl-soldout-title",o.textContent=this.tf("picker.soldOutTitle","Sold out");let r=document.createElement("p");r.className="sl-soldout-copy",r.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(n,o,r),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let n=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,t,n),r=[...On(e,t)].join("|");r!==this.baSoldOutSig&&(this.baSoldOutSig=r,this.syncTray()),o!==this.soldOut&&(this.soldOut=o,this.soldoutEl?.classList.toggle("on",o))}isSoldOut(e,t,n){return!n&&e.length>0&&e.every(o=>(t[o.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.closedWords().pill}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.closedWords().toast),this.syncCta(),this.syncTray()}badgeHidden(e){return!!e?.hideBadge}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let n=document.createElement("a");n.className="sl-powered",n.href="https://seatlayer.io/?ref=picker",n.target="_blank",n.rel="noopener noreferrer",n.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let o=document.createElement("span");o.className="sl-powered-mark",o.setAttribute("aria-hidden","true"),o.innerHTML=to;let r=document.createElement("span");r.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),n.append(o,r),t.appendChild(n)}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let n=document.createElement("div");n.className="sl-anchor",n.dataset.region=t,this.els.map.appendChild(n),this.regions[t]=n}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let n=setTimeout(()=>{this.motionTimers.delete(n),this.destroyed||e()},t);this.motionTimers.add(n)}animateOnce(e,t,n=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),n))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),n=(e.items??[]).filter(o=>o.objectType!=="ga").slice(0,10).map(o=>this.controller.seatByLabel(o.label)).filter(o=>!!o);ll({regions:this.els,categories:this.controller.doc?.categories,pop:o=>this.controller.flashSeat(o,this.cssVar("--sl-accent")||"#f4b740"),focus:(o,r)=>this.controller.focusSection(o,r),focusSeats:o=>this.controller.focusSeats?.(o,{animate:!t})===!0,reducedMotion:t,screenPoint:o=>this.controller.worldToScreen(o),schedule:(o,r)=>this.scheduleMotion(o,r)},n)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(n=>n.id!==e&&n.id!==t)}pendingSelectionCount(){return nd(this)}heldTicketCount(){return od(this)}totalTicketCount(){return rd(this)}updateSelectionCapacity(){sd(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){ad(this,e,t)}setCtaPhase(e){ld(this,e)}runCheckoutHandoff(e,t){return cd(this,e,t)}holdStorageKey(){return dd(this)}rememberedHoldId(){return pd(this)}rememberHold(e){hd(this,e)}forgetHold(){ud(this)}resumeHoldFromServer(e,t=!1){return md(this,e,t)}restoreRememberedHold(){return fd(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let n=this.controller.getActiveFloorId();return(t.find(o=>o.id===n)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=gc({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label,tint:e=>this.controller.getRenderer?.()?.categoryDisplayColor?.(e)||void 0},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return Eo(this,e)}catPriceRange(e){return Co(this,e)}buildPriceFilter(){Ed(this)}applyPriceBand(e){Cd(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(n=>n.type==="section")||(e.floors??[]).some(n=>n.objects.some(o=>o.type==="section"));if(this.canOffer3d()){let n=document.createElement("div");n.className="sl-projection",n.setAttribute("role","group"),n.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),n.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>`,n.querySelectorAll("button").forEach(o=>{if(o.dataset.view==="venue3d")for(let r of["pointerenter","focus","pointerdown"])o.addEventListener(r,An,{once:!0});o.addEventListener("click",()=>{this.setBuyerView(o.dataset.view)})}),this.regions["top-right"].appendChild(n),this.projectionEl=n,this.syncProjection()}if(t){let n=[...e.objects,...(e.floors??[]).flatMap(p=>p.objects)],o=new Set((e.zones??[]).map(p=>p.id)),a=e.floorOverview==="combined"&&(e.floors?.length??0)>1&&o.size===0||n.some(p=>p.type==="section"&&typeof p.zone=="string"&&o.has(p.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",(0,F.t)("picker.zoomLevel"));let c={zones:(0,F.t)("picker.rungLabel.zones"),sections:(0,F.t)("picker.rungLabel.sections"),seats:(0,F.t)("picker.rungLabel.seats")},d={zones:(0,F.t)("picker.rungTip.zones"),sections:(0,F.t)("picker.rungTip.sections"),seats:(0,F.t)("picker.rungTip.seats")};l.innerHTML=a.map(p=>`<button type="button" data-rung="${p}" title="${d[p]}" aria-pressed="false">${c[p]}</button>`).join(""),l.querySelectorAll("button").forEach(p=>{p.addEventListener("click",()=>{let u=p.dataset.rung;this.controller.setRung(u),u==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let n=Bl({floors:this.controller.getFloors(),tf:(o,r)=>this.tf(o,r),onChoose:o=>{o===""?this.controller.setFloorOverview(!0):this.controller.setFloor(o),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});this.regions["top-left"].appendChild(n),this.floorsEl=n,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map;e&&il(this.root,e,this.regions);let t=e?Dl(e.getBoundingClientRect(),[this.floorsEl,this.rungsEl,this.projectionEl].map(n=>n?.isConnected?n.getBoundingClientRect():null),[]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(n=>t[n]===this.arenaViewportInsets[n])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t),this.syncFitClearance())}syncFitClearance(){let e=this.els.map,t=this.els.zoom,n=this.root?.dataset.layout==="narrow",o=0;if(n&&e&&t?.isConnected){let r=e.getBoundingClientRect(),s=t.getBoundingClientRect();s.height>0&&(o=Math.max(0,r.bottom-s.top+8))}this.controller.setFitClearance?.(o)}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(n=>{let o=n.dataset.rung===e;n.classList.toggle("on",o),n.setAttribute("aria-pressed",String(o))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,n=this.els?.zin;if(!e||!this.root)return;let o=this.controller.getRenderer?.(),r=this.controller.canZoomIn?.()===!1||o?.seatsPickable?.()===!0,s=Hl({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.disabled!==s||!!t&&t.disabled!==s||!!n&&n.disabled!==r||e.hidden||!!n?.hidden||!!t?.hidden;e.disabled=s,e.hidden=!1,n&&(n.disabled=r,n.hidden=!1),t&&(t.disabled=s,t.hidden=!1),a&&this.a11yMenu?.refit()}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?this.tf("picker.priceHint3d","Colours in the venue are ticket types. Choose one below to show just those seats."):this.tf("picker.priceHint","Colours on the map are ticket types. Tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!Cn()?!1:this.allSeats().length<=this.max3dSeats()}max3dSeats(){let e=this.opts.max3DSeats;if(typeof e=="number"&&e>0)return e;let t=globalThis.navigator;return(t?.hardwareConcurrency??8)<=4||(t?.deviceMemory??8)<=4||(globalThis.matchMedia?.("(pointer: coarse)").matches??!1)?jd/2:jd}syncFloors(){Fl(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new yo({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(o=>o.type==="section"&&!this.controller.isSectionClosed(o.id)&&this.controller.getSectionSeatCount(o.id)>0);if(t.length<2)return null;let n=t.findIndex(o=>o.id===e);return n<0?null:{previous:t[(n-1+t.length)%t.length],next:t[(n+1)%t.length]}}markedSeatAnnouncement(e){let t=Pr(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return Yl(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 n=this.controller.doc?.categories.find(h=>h.key===e.categoryKey),o=this.controller.getStatus(e.id)??"free",r=o==="free"?this.tf("picker.statusAvailable","available"):o==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),s=n?this.catPriceRange(n):void 0,a=!this.suppressPricing&&s?s.min===s.max?this.money(s.min):`${this.money(s.min)}\u2013${this.money(s.max)}`:void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=Gt(c),p=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,u=l?`${d} ${p}, ${l.bookingMode==="variable"?(0,F.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,F.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${p}`:c?.objectType==="table"?`${d} ${p}, ${(0,F.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,F.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${u}, ${n?.label??e.categoryKey}${a?`, ${a}`:""}, ${r}`}showTableDialog(e,t,n){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=n??document.activeElement;let o=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),r=e.bookingMode==="variable",s=document.createElement("div");s.className="sl-table-scrim",s.innerHTML=ta(e,{variable:r,held:t,typeWord:Gt(e),categoryLabel:o?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(s),this.tableDialogEl=s,this.renderTableDialogState(),s.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()})}),s.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),s.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),s.addEventListener("mousedown",a=>{a.target===s&&this.cancelTableDialog()}),s.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...s.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(()=>s.querySelector(r?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let n=t.querySelector("output[data-table-qty]");n&&(n.value=String(e.quantity));let o=t.querySelector("input[data-table-qty]");o&&(o.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let r=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),s=t.querySelector("[data-table-total]");s&&(s.textContent=this.money(r*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let n=this.tableDialogEl?.querySelector(".sl-table-confirm");if(n&&(n.disabled=!0,n.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let o=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!o){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},this.startHoldTimer(o.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,F.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(o){this.opts.onError?.(o),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){n&&(n.disabled=!1,n.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new xo({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,n,o)=>this.paidPrice(e,t,n,o),offerName:(e,t)=>this.offerPrice(e,t)?.offerName,suppressPricing:()=>this.suppressPricing,reducedMotion:()=>this.reducedMotion(),scheduleMotion:(e,t)=>this.scheduleMotion(e,t),canOffer3d:()=>this.canOffer3d(),buyerView:()=>this.buyerView,view3dHandle:()=>this.view3dHandle,view3dCompareSeatIds:()=>this.view3dCompareSeatIds,rememberView3dReturnSeat:e=>{this.view3dReturnSeat=e},enter3d:e=>{this.enter3d(e)},performanceGroup:()=>this.performanceGroup,seatViewEnabled:()=>this.seatViewEnabled(),openSeatView:e=>{this.openSeatView(e)},openSeatConfidencePassport:(e,t)=>this.openSeatConfidencePassport(e,t),saveView3dComparisonSeat:e=>this.saveView3dComparisonSeat(e),resolveAssetUrl:e=>this.buyerAssetUrls.resolve(e),onError:e=>this.opts.onError?.(e),liftToastOverConfirm:()=>this.liftToastOverConfirm(),fitTranslatedRows:()=>this.fitTranslatedRows(),syncTray:()=>this.syncTray(),syncSelectionTo3d:()=>this.syncSelectionTo3d(),collapseSectionCard:()=>this.collapseSectionCard(),applyPanelCollapsed:()=>this.applyPanelCollapsed(),dismiss:()=>this.dismissConfirm(),releaseHeldSeat:e=>this.controller.currentHold()?.labels.includes(e.label)?this.removeHeldLabels([e.label]):null,reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e),cartLanded:()=>this.cartLanded()})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}cartLanded(){this.animateOnce(this.els.count,"sl-value-pop",380),this.animateOnce(this.els.total,"sl-value-pop",380)}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){uc(e,t,this.reducedMotion())}addSeatLabel(e){return mc(e,(t,n)=>this.tf(t,n))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,n=this.controller.doc,o=this.controller.getActiveFloorId(),r=e.focalPoint??n?.floors?.find(p=>p.id===o)?.focalPoint??n?.focalPoint??{x:0,y:0},s,a,l=!1;if(e.viewUrl){let p,u=null;try{let b=e.viewMeta?.previewUrl;b&&b!==e.viewUrl?(u=await this.buyerAssetUrls.resolve(b),p=e.viewUrl):p=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(b){t===this.seatViewGen&&this.opts.onError?.(b);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}:{}};s=h,a=(0,Ro.seatViewDisclosure)(h),l=(0,Ro.isAuthoredSeatView)(h)}else{let p;try{let{generateSeatPanorama:u}=await Pn();p=u(e,r,this.allSeats())}catch(u){t===this.seatViewGen&&this.opts.onError?.(u);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;s={url:p.url,generated:!0},a=(0,F.t)("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=(0,F.t)("picker.viewFromSeat",{label:e.label}),d=oo({root:this.root,source:s,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:Nt(),viewFromSeatLabel:c,real360Label:(0,F.t)("picker.real360"),previewLabel:(0,F.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 n=Number.isInteger(e);return(0,F.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(o,r)=>`${o} ${r}`,...n?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),n=Al(e,t);if(n==null)return;let o=6*36e5,r=Math.min(Math.max(n-t+1e3,1e3),o);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},r)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<_m}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let n=go(t);if(!n)return;this.offerAvailability=n,this.applyChannelPricing(n.channelPricing),this.scheduleOfferBoundary(n);let o=Pl(this.hostPricing?.prices,n),r=Object.keys(o).length>0||this.hostPricing?.formatter?{prices:o,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(r),this.syncMapPriceRanges(),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(n)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e,t){if(!e)return null;let n=this.offerAvailability?.prices.filter(o=>o.categoryKey===e)??[];return t!==void 0?n.find(o=>(o.tierId??null)===t)??n.find(o=>o.tierId==null)??null:n[0]??null}mapPriceRanges(){if(this.api.availability&&!this.offerAvailability)return null;let e=this.offerAvailability?.prices.some(n=>n.tierId!==void 0)??!1,t=Object.keys(this.opts.pricing?.prices??{}).length>0;if(!(!e&&!t))return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(n=>{let o=this.catPriceRange(n);return o?[[n.key,o]]:[]}))}syncMapPriceRanges(){this.controller.getRenderer()?.setCategoryPriceRanges?.(this.mapPriceRanges())}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerCountdownTimer=null,e.classList.remove("sl-offer-compact","sl-offer-early-bird"),!this.currencyResolved){e.classList.remove("has"),e.replaceChildren();return}if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,n=t?.release??null,o=!n&&t?.upcoming?.pricingMode!=="matrix"?t?.upcoming??null:null;if(!t||t.state==="closed"||t.state==="sold-out"||!n&&!o){e.classList.remove("has"),e.replaceChildren();return}let r=n??o,s=r.pricingMode==="matrix",a=document.createElement("div");a.className="sl-offer-main";let l=document.createElement("div");l.className="sl-offer-copy";let c=document.createElement("span");c.className="sl-offer-kicker",c.textContent=n?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let d=document.createElement("strong");d.className="sl-offer-name";let p=r.name||(n?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));Yo(p)&&e.classList.add("sl-offer-early-bird"),d.innerHTML=Hn(p,q);let u=document.createElement("span");u.className="sl-offer-line";let h=[];if(!s&&n&&t.fromPrice!=null&&h.push(this.money(t.fromPrice/100)),!s&&n&&r.remaining!=null&&h.push((0,F.t)("picker.offerRemainingAvailable",{count:r.remaining})),n&&r.endsAt!=null){let v=!this.opts.locale||/^en(?:-|$)/i.test(this.opts.locale)?js(r.endsAt):null;if(h.push(v??(0,F.t)("picker.offerUntil",{time:Mn(r.endsAt,this.eventTimezone,this.opts.locale)})),v){let M=Math.max(1e3,r.endsAt-Date.now()),B=M%6e4||6e4;this.offerCountdownTimer=setTimeout(()=>{this.offerCountdownTimer=null,Date.now()>=r.endsAt?this.refreshOfferAvailability(!1):this.syncOffer()},Math.min(B+25,M+25))}}if(o?.startsAt!=null&&h.push((0,F.t)("picker.offerStarts",{time:Mn(o.startsAt,this.eventTimezone,this.opts.locale)})),u.textContent=h.join(" \xB7 "),s||l.append(c),l.append(d,u),s){e.classList.add("sl-offer-compact"),a.append(l),e.replaceChildren(a),e.classList.add("has");return}let b=document.createElement("details");b.className="sl-offer-info";let g=document.createElement("summary");g.setAttribute("aria-label",(0,F.t)("picker.howOfferWorks",{name:d.textContent??""})),g.textContent="i";let T=document.createElement("div");T.className="sl-offer-detail",T.textContent=n?this.tf("picker.offerDetailActive","This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over."):this.tf("picker.offerDetailUpcoming","Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts."),b.append(g,T),a.append(l,b),e.replaceChildren(a),e.classList.add("has")}paidPrice(e,t,n,o){let r=o?this.channelByObject.get(o):void 0;if(r&&e){let a=this.pricesByChannel.get(r)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let s=e?this.opts.pricing?.prices?.[e]:void 0;return s===void 0?n:typeof s=="number"?s:t&&s.tiers?.[t]!==void 0?s.tiers[t]:s.base??n}legendDeps(){return Ad(this)}syncPriceRail(e,t,n=this.legendDeps()){Pd(this,e,t,n)}syncPrices(){this.currencyResolved&&Md(this)}focusCategory(e){Ld(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(n=>!e.has(n.label)&&(this.controller.getStatus(n.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(n=>n.id)),this.toast((0,F.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:n,heldLabels:o,total:r,count:s}=To(this),a=[],l=new Set;if(!this.salesClosed){let f=this.performanceGroup?.nightSummary?.()??[];f.length&&a.push(jl(f,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let O=this.performanceGroup?.selectionModeSwitch;O&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${q(O.label)}</button>`)}let c={salesClosed:this.salesClosed,salesState:this.salesState,hasPicks:e.length>0||n.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(f=>f.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(pa(c)),this.els.trayHint&&(this.els.trayHint.textContent=ha(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed);let d=!e.length&&!n.length&&!wt(this.gaQty,this.hold?.items??[]);if(!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||this.bestAvailableBusy||this.bestAvailableConfirm)){let f=(this.controller.doc?.categories??[]).filter(_=>!_.notForSale),O=this.controller.getBestAvailableZones();this.baZone&&!O.some(_=>_.id===this.baZone)&&(this.baZone="");let K=On(f,this.controller.categoryAvailability());this.baSoldOutSig=[...K].join("|"),this.bestAvailableSoldOut=f.length>0&&K.size===f.length,K.has(this.baCat)&&(this.baCat=""),(!this.bestAvailableSoldOut||this.bestAvailableBusy||this.bestAvailableConfirm)&&a.push(la({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:f.map(_=>K.has(_.key)?{..._,soldOut:!0}:_),zones:O,selectedCategory:this.baCat,selectedZone:this.baZone}))}let p=(f,O,K,_=1,j,P,$,J)=>sa({categoryLabel:$,offerName:J,d:f?this.controller.seatDetails(f):null,area:K==="ga"?t.find(W=>W.id===j):void 0,label:O,objectType:K,quantity:_,identity:P,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),u=q,h=[];for(let f of Va(n)){let O=f.objectType==="ga"?`held:ga:${f.objectId}:${f.tierId??""}`:`held:${f.label}`;l.add(O);let K=this.controller.doc?.categories.find($e=>$e.key===f.categoryKey),_=this.performanceGroup||this.suppressPricing?null:Ac(this.controller,f),j=f.tierId&&!_?K?.tiers?.find($e=>$e.id===f.tierId)?.name:void 0,P=this.offerPrice(f.categoryKey,f.tierId??null)?.offerName,$=f.objectType!=="ga"?this.controller.seatByLabel(f.label):null,J=f.objectType==="table"?this.controller.tableSelection(f.label):null,W=$?this.controller.seatDetails($.id):null,oe=this.seatViewEnabled()&&!!$&&f.objectType!=="table"&&!!this.deliverableViewReference($),Ee=u(this.tf("picker.heldForYou","Held for you")),xe=(J?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(f.label))}">${u((0,F.t)("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+(_?`<select class="tier" data-held-tier="${u(f.label)}" aria-label="${u((0,F.t)("picker.ticketTierFor",{label:f.label}))}">${er(_,f.tierId??void 0,u)}</select>`:""),Ce=this.paidPrice(f.categoryKey,f.tierId,f.unitPrice,f.label)*(f.quantity??1);h.push({key:O,fresh:!this.lastTrayKeys.has(O),held:!0,seatIds:[],heldLabels:f.labels,removeAria:(0,F.t)("picker.removeHeldTicketLabel",{label:dr(f,t)}),locateId:$?.id??null,section:W?.sectionLabel??"",rowLabel:W&&fe(W)||"",seatLabel:W?.seatNumber??f.label,categoryLabel:`${K?.label??f.categoryKey}${j?` \xB7 ${j}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??K?.color??"",identityHtml:p($?.id??null,f.label,f.objectType,f.quantity??1,f.objectId,J??void 0,`${K?.label??f.categoryKey}${j?` \xB7 ${j}`:""}`,P),stateHtml:`<span class="sl-ticket-state held" aria-label="${Ee}" title="${Ee}"><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:xe,amount:Ce,amountText:this.suppressPricing?"":this.money(Ce),noteHtml:Dt($??void 0),railHtml:this.performanceGroup?"":tr((0,F.t)("picker.removeHeldTicketLabel",{label:dr(f,t)}),oe?f.label:null)})}let b=this.seatViewEnabled();for(let f of e.filter(O=>!o.has(O.label))){let O=`seat:${f.id}`;l.add(O);let K=this.controller.doc?.categories.find(Ce=>Ce.key===f.categoryKey),_=f.tiers&&f.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${u(f.id)}" aria-label="${u((0,F.t)("picker.ticketTierFor",{label:f.label}))}">`+er(f.tiers,f.tierId,u)+"</select>":"",j=f.tiers?.find(Ce=>Ce.id===f.tierId)??f.tiers?.[0],P=this.offerPrice(f.categoryKey,j?.id??null)?.offerName,$=j?.buyerMessage?.trim()||(j?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),J=this.controller.seatDetails(f.id),W=u(this.tf("picker.selected","Selected")),oe=(0,F.t)("picker.removeSeatLabel",{label:f.label}),Ee=(f.objectType==="table"&&f.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(f.label))}">${u((0,F.t)("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+_,xe=this.paidPrice(f.categoryKey,f.tierId??null,f.price,f.label)*(f.quantity??1);h.push({key:O,fresh:!this.lastTrayKeys.has(O),held:!1,seatIds:[f.id],heldLabels:[],locateId:f.id,section:J?.sectionLabel??"",rowLabel:J&&fe(J)||"",seatLabel:J?.seatNumber??f.label,categoryLabel:K?.label??f.categoryKey,identityHtml:p(f.id,f.label,f.objectType,f.quantity??1,f.objectId,f,K?.label??f.categoryKey,P),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??K?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${W}" title="${W}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:Ee,amount:xe,amountText:this.suppressPricing?"":this.money(xe),removeAria:oe,noteHtml:Dt(f)+($?`<small class="sl-tier-note">${u($)}</small>`:""),railHtml:tr(oe,b&&f.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(f.label)??{})?f.label:null)})}h.length&&a.push(h.map(aa).join("")),t.length&&a.push(Ua(this,t,n)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let g=this.performanceGroup?.selectNight;g&&ec(this.els.tray,f=>g(f)),this.els.tray.querySelectorAll("[data-ba]").forEach(f=>{f.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(f.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",f=>{this.baCat=f.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",f=>{this.baZone=f.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(f=>{f.addEventListener("click",()=>{let O=f.closest(".sl-chip");if(O.dataset.held){this.removeHeldLabels(decodeURIComponent(O.dataset.held).split(`
|
|
3555
|
-
`),O);return}let K=O.dataset.seat.split(" "),_=()=>{this.controller.deselect(K)};if(this.reducedMotion()){_();return}O.classList.remove("sl-enter"),O.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(_,we.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(f=>{f.addEventListener("click",O=>{O.stopPropagation();let K=decodeURIComponent(f.dataset.tableEdit??""),_=this.controller.tableSelection(K);if(!_)return;let j=n.find(P=>P.label===K&&P.objectType==="table");this.showTableDialog({..._,quantity:j?.quantity??_.quantity},!!j,f)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(f=>{f.addEventListener("change",()=>f.dataset.heldTier?void this.changeHeldTier(f,f.dataset.heldTier):this.controller.setSeatTier(f.dataset.tier,f.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(f=>{f.addEventListener("click",()=>{let O=this.controller.seatByLabel(f.dataset.viewLabel);O&&this.openSeatView(O)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(f=>{let O=()=>this.controller.flashSeat(f.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");f.addEventListener("mouseenter",O),f.addEventListener("focusin",O),f.addEventListener("click",K=>{K.target.closest?.('button,a,select,[role="button"],input')||!this.controller.focusSeats?.([f.dataset.locate],{animate:!this.reducedMotion()})||O()})}),qa(this,this.els.tray,t),this.controller.setGASelection(Da(this.gaQty)),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(f=>{f.disabled=!0});let T=this.pendingSelectionCount(),w=this.lastTrayCount,v=this.lastTrayTotal,M=Jl(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");this.els.count.textContent=M||(s?(0,F.tCount)("picker.ticketsCount",s):this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=s&&!this.suppressPricing?this.money(r):"",this.root?.setAttribute("data-has-selection",String(s>0)),this.sheetState()==="mini"&&s===0?this.setSheetState("mini"):s>w&&this.root?.dataset.layout==="narrow"?this.setSheetState("mini"):this.syncSheetAffordance(),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy)),this.els.seatSummary&&(this.els.seatSummary.textContent=M||(s?(0,F.tCount)("picker.seatsSelectedCount",s):"")),this.syncCta(s,T);let X=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";s!==w&&!X&&this.animateOnce(this.els.count,"sl-value-pop",380),r!==v&&!X&&this.animateOnce(this.els.total,"sl-value-pop",380),w===0&&s>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.lastTrayCount=s,this.lastTrayTotal=r,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(s,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(){kl(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(Sl),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(Tl)}emitSelectionValidity(e,t){let n=this.controller.getSelectionValidity(e);n&&(n.seats=t,this.opts.onSelectionValidityChange?.(n),n.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(n),this.lastSelectionValidity=n.isValid)}async removeHeldLabels(e,t){let n=e.filter(s=>s&&!this.releasingLabels.has(s));if(!n.length)return!1;let o=n[0];n.forEach(s=>this.releasingLabels.add(s)),t?.setAttribute("aria-busy","true");let r=t?.querySelector(".rm");r&&(r.disabled=!0);try{let s=this.handedOff;if(!await this.controller.releaseLabels(n))return this.toast((0,F.t)("picker.couldNotRemoveLabel",{label:o}),"error"),!1;za(this.gaQty,this.hold?.items??[],n);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&s,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{n.forEach(s=>this.releasingLabels.delete(s)),t?.removeAttribute("aria-busy"),r?.isConnected&&(r.disabled=!1)}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(Po(e,(n,o)=>this.tf(n,o)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast((0,F.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(n=>!(this.hold.items??[]).some(o=>o.label===n.label))){let n=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,n);return}this.holdingLabels=new Set(t.map(n=>n.label)),this.setCtaPhase("holding");try{let n=null,o=Na(this.gaQty),r=this.committedSelection();if(r.length){let s=await this.controller.hold(void 0,this.opts.holdTtlMs);n=s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items}:null}for(let{areaId:s,tierId:a,qty:l}of o){let c=await this.controller.holdGA(s,l,{tierId:a,ttlMs:this.opts.holdTtlMs});n=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:n}if(!n){this.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=n,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(n.expiresAt),this.flashHeldSeats(n),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(n,n.seats??r)}catch(n){this.opts.onError?.(n);let o=Cr(n);if(o){this.toast(o,"warning"),this.setCtaPhase("idle");return}let r=n,s=(r.conflicts??[]).map(l=>l.label).filter(Boolean).slice(0,3);r.reason==="event_closed"&&this.setSalesClosed(!0);let a=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,F.t)("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):(0,F.t)("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(a),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){gd(this,e)}stopHoldTimer(){bd(this)}setExtendPrompt(e,t){yd(this,e,t)}refreshExtendPrompt(){vd(this)}handleExtend(){return wd(this)}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((o,r)=>o+r.quantity,0),n=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=n?.seats?`<span class="sl-booked-seats">${(0,F.tCount)("picker.group.ticketsConfirmedAcross",n.seats,{performances:n.performances})}</span>`:`<span class="sl-booked-seats">${(0,F.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(o=>{let s=[o.sectionLabel,o.rowLabel&&`${this.tf("picker.row","Row")} ${o.rowLabel}`,o.seatNumber&&`${this.tf("picker.seat","Seat")} ${o.seatNumber}`].filter(Boolean).join(" \xB7 ")||o.displayLabel||o.label,a=o.quantity>1?` <span class="sl-booked-qty">\xD7${o.quantity}</span>`:"";return`<li>${q(s)}${a}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0),this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.resetAfterBooking(),this.root?.focus({preventScroll:!0})}resetAfterBooking(){this.bookedShown=!1,this.hold=null,this.handedOff=!1,this.holdConflicted=!1,this.holdingLabels.clear(),this.gaQty.clear(),this.stopHoldTimer(),this.forgetHold(),this.clearSelection(),this.setCtaPhase("idle"),this.setSheetOpen(!1),this.syncTray(),this.syncCta(),this.emitHoldChange()}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let n=this.buildHandoff(e),o=null;try{o=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(a){this.opts.onError?.(a)}if(this.destroyed)return;let r=o?.bookingMode==="free",s=o?.providers?.[0]??null;if(!s&&!r){let a=Bs(o?.reason),l=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:a,handoff:n}),this.opts.onCheckout?.(e,t,n),l||this.openCheckoutPanel({kind:"unavailable",reason:a,seatCount:Fs(n)});return}await this.openCheckoutPanel(Vs(n,s,o,this.pubApi.ticketKeysFor(e.holdId),this.controller.getGAAreas()))}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await li())}catch(n){this.opts.onError?.(n),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held. Please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,eventKey:this.opts.event,event:{name:this.els.name?.textContent||null,detail:this.els.meta?.textContent||null},formatMoney:n=>this.money(n),t:F.t,startSession:n=>this.pubApi.startCheckout(this.opts.event,{...n,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:n=>this.pubApi.orderStatus(n),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:n=>{this.opts.onOrderConfirmed?.(n),this.controller.refresh()},onError:n=>{zs(n)&&(this.paymentOptions=null),n?.code==="seats_unavailable"&&this.controller.refresh(),this.opts.onError?.(n)}}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let n=(e.items??[]).map(s=>{let a=this.controller.lineItemDisplay(s),l=s.objectType==="seat"||s.objectType==="booth"?this.controller.seatByLabel(s.label):null,c=l?this.controller.seatDetails(l.id):null,d=c?fe(c):void 0,p=this.controller.doc?.categories.find(h=>h.key===s.categoryKey),u=s.tierId?p?.tiers?.find(h=>h.id===s.tierId)?.name:void 0;return{label:s.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},...c?.sectionLabel?{sectionLabel:c.sectionLabel}:{},...d?{rowLabel:d}:{},...c?.seatNumber?{seatNumber:c.seatNumber}:{},...p?.label?{categoryLabel:p.label}:{},...u?{tierLabel:u}:{},objectId:s.objectId,objectType:s.objectType,categoryKey:s.categoryKey,tierId:s.tierId,unitPrice:this.paidPrice(s.categoryKey,s.tierId,s.unitPrice,s.label),currency:s.currency??this.currency,quantity:s.quantity??1}}),o=n[0]?.currency??this.currency,r=n.reduce((s,a)=>s+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:o,lineItems:n,total:r}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",n){let o=this.els.toast;if(!o)return;o.replaceChildren();let r=document.createElement("span");if(r.textContent=e,o.appendChild(r),o.classList.toggle("has-action",!!n),n){let s=document.createElement("button");s.type="button",s.className="sl-toast-action",s.textContent=n.label,s.addEventListener("click",n.onClick,{once:!0}),o.appendChild(s)}o.dataset.tone=t,o.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{o.classList.remove("on","sl-mo-rise"),o.classList.remove("has-action"),o.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),n=this.confirmEl;if(!t||!n?.isConnected){e.style.removeProperty("bottom");return}let o=this.els.map.clientHeight;if(o<=0)return;let r=n.getBoundingClientRect(),s=r.height||n.offsetHeight||Bm,a=r.height?r.top-this.els.map.getBoundingClientRect().top:o-Lr-s,l=Math.round(o-a+Nm);if(l+Dm>o){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){this.handoverMs===null&&this.renderResolvedAt!==null&&(this.handoverMs=performance.now()-this.renderResolvedAt),wc({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},n=this.tipPinned?oc(this.tipPos,e,t):null,o=n??nc(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${o.left}px`,this.tipEl.style.top=`${o.top}px`,n?this.tipEl.dataset.placement=n.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let n=this.performanceGroup,o=Pr(e.mark,n?.nights?.()),r=o?.states.filter(s=>s.free).length??0;return Gl(o,{locale:this.opts.locale,switchLabel:n?.selectionModeSwitch?.label??null,selectPartialLabel:n?.partialSeatSelection?.label(r)??null,pinned:t})}unpinTooltip(){this.tipPinned&&(this.tipPinned=!1,this.tipEl?.classList.remove("sl-tip-pinned"),this.tipEl&&(this.tipEl.style.display="none"))}handleMapPointerDown(e){if(this.tipEl?.contains(e.target))return;this.lastMapPoint={x:e.clientX,y:e.clientY},this.lastPointerType=e.pointerType||"mouse";let t=this.els.map.getBoundingClientRect();this.tipPos={x:e.clientX-t.left,y:e.clientY-t.top},this.unpinTooltip()}closeInfoPops(e){this.root?.querySelectorAll(".sl-info.open").forEach(t=>{t!==e&&(t.classList.remove("open"),t.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false"))})}updateTooltip(e){if(!this.tipEl)return;if(this.confirmSeat){this.tipEl.style.display="none";return}if(this.tipPinned&&e?.interaction!=="press")return;if(!e){this.tipPinned||(this.tipEl.style.display="none",this.tipMarkedHoverLabel=null);return}let t=e.mark?.kind==="partial"&&this.tipMarkedHoverLabel===e.label;if(e.interaction!=="press"&&this.lastPointerType==="mouse"&&!e.mark&&!this.tipPinned){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}if(e.unavailable&&e.status==="free"&&e.interaction==="press"){this.toast(this.tf("picker.turnOffAccessibilityFilter","Turn off the wheelchair filter to pick this seat"),"neutral"),this.tipEl.style.display="none";return}if(e.unavailable&&!e.mark){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}let n=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t);this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let o=this.nightStripFor(e,n);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=ic(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:Gt(e),extra:o+(n?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${q(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=n,this.tipEl.classList.toggle("sl-tip-pinned",n),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),ac(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,r=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,r)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let n={};for(let[o,r]of Object.entries(e())){let s=this.controller.idForLabel(o);s&&(n[s]=r)}Object.keys(n).length&&t.setSeatMarks(n)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),n=this.controller.getSelection().filter(o=>t.has(o.id)||t.has(o.label));if(n.length===t.size)return n;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=Qi(this.themeMode),n=pi(this.controller.doc?.theme,this.opts.theme,t);for(let[o,r]of Object.entries(n))e.style.setProperty(o,r);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=Fn(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(di(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:Qi(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Qi(this.themeMode),n=pi(this.controller.doc?.theme,this.opts.theme,t),o=di(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,r=ba(n,o);for(let s of ga)r?e.style.setProperty(s,r[s]):e.style.removeProperty(s)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),n=JSON.stringify(e??null);t!==n&&(this.opts.pricing=e,!(this.destroyed||!this.els.prices||!this.currencyResolved)&&(this.syncMapPriceRanges(),this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=xa(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=(0,F.getLocale)(),n=this.localeGeneration+=1,o=await(0,F.loadLocale)(e);return this.opts.messages&&(0,F.setStringOverrides)(this.opts.messages),o===t||this.applyActiveLocale(o,n),o}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(ka(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(),Vm(e))}setViewMode(e){this.controller.setViewMode(this.normalizeInitialView(e)),this.syncProjection(),this.dismissConfirm()}getViewMode(){return this.controller.getViewMode()}normalizeInitialView(e){return e==="perspective"?(this.perspectiveWarned||(this.perspectiveWarned=!0,console.warn("[seatlayer] initialView:'perspective' (2.5D) is deprecated for the buyer picker and was coerced to 'flat'. Use the Map | 3D control for the immersive view.")),"flat"):e??"flat"}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,t??{})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}getBuyerView(){return Bc(this)}setBuyerView(e,t){Fc(this,e,t)}seatState3dFor(e){return Vc(this,e)}pushAvailabilityTo3d(){zc(this)}syncSelectionTo3d(){$c(this)}seatViewFor3d(e){return jc(this,e)}onView3dSeatPick(e){Gc(this,e)}seatViewCaption(e){return Kc(this,e)}saveView3dComparisonSeat(e){Uc(this,e)}clearView3dComparison(){qc(this)}view3dComparisonSnapshot(e){return Wc(this,e)}enter3d(e){return Yc(this,e)}publish3dTopInset(){Xc(this)}exit3d(){Qc(this)}openSeatConfidencePassport(e,t=null){Nr(this,e,t)}closeSeatConfidencePassport(e=!0){an(this,e)}openView3dComparison(){Ic(this)}closeView3dComparison(e=!0){Kt(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async changeHeldTier(e,t){e.disabled=!0;try{let n=await Pc(this.controller,t,e.value,this.opts.holdTtlMs);n&&(this.hold={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items},this.startHoldTimer(n.expiresAt),this.emitHoldChange())}catch(n){this.opts.onError?.(n),this.toast(this.tf("picker.ticketTypeNotChanged","That ticket type is not available for this seat. Your hold is unchanged."),"error")}finally{this.syncTray()}}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,n={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,n)}catch(o){this.opts.onError?.(o);let r=Cr(o);if(r)return this.toast(r,"warning"),null;let s=o?.reason,a=s==="not_enough_together"?(0,F.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(a,"error"),null}}async bestAvailableOrThrow(e,t,n={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");let o=_n(this.controller,t);if(o)throw o;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,{...n,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(),n.preferPremium&&s.seats.length&&!s.seats.every(a=>a.commercial?.premium)&&this.toast((0,F.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(),n=!0;if(t)n=await this.controller.release();else if(e){let o=[...new Set([...(e.items??[]).map(r=>r.label),...(e.seats??[]).map(r=>r.label)])];if(o.length)try{await this.api.release(this.opts.event,o,e.holdId)}catch(r){this.opts.onError?.(r),n=!1}}if(!n){this.toast(this.tf("picker.couldNotReleaseTickets","Couldn't release your tickets. Your hold is unchanged."),"error");return}this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.syncTray(),this.emitHoldChange()}startRealtime(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new Qe({url:()=>this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},onIdleExpired:()=>Nl(this.idlePauseHost),sink:ri(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,n)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:n}),this.syncTray(),this.toast(n==="ineligible"?this.tf("picker.seatNoLongerYours","Some seats are no longer available to you. They have been removed from your order."):this.tf("picker.seatTaken","Someone else took a seat you had picked. It has been removed from your order."),"warning")}})}),this.realtime.start()}async refreshAccess(){return!this.access?.configured||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}clearDecisionSurfaces(){this.dismissConfirm(),this.dismissTableDialog(!1),Je(this,!1)}showAccessPanel(e){if(this.loadAbort&&e.reason==="provider_failed"||this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=ia(e.reason,e.reason==="idle"?()=>this.resumeFromIdle():()=>this.recoverAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}async recoverAccess(){return await this.refreshAccess()?!0:(this.opts.onAccessUnavailable||typeof window>"u"||window.location.reload(),!1)}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}get idlePauseHost(){return this}startIdleClock(e){return Il(this.idlePauseHost,e)}resumeFromIdle(){return _l(this.idlePauseHost)}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=Od({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let n=t.filter(s=>s.objectType!=="ga"),o=[],r=[];for(let s of n){let a=this.controller.seatByLabel(s.label);(a&&this.controller.getStatus(a.id)==="free"?o:r).push(s.label)}Id(e,{recoverable:o,taken:r,onRecover:s=>this.recoverAfterHoldExpiry(s)})}).catch(()=>{})}recoverAfterHoldExpiry(e){this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.select(e),this.syncTray(),this.handleCta()}dismissHoldExpired(){this.holdExpiredEl?.remove(),this.holdExpiredEl=null}restartAfterHoldExpiry(){let e=this.holdExpiredUnits;this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.overview(),this.syncTray(),this.syncCta(),this.root?.focus({preventScroll:!0});let t=this.holdExpiredFresh;this.holdExpiredFresh=!1,(t?Promise.resolve():this.refreshAvailability()).then(()=>{this.destroyed||Rd({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:n=>this.controller.seatByLabel(n),statusOf:n=>this.controller.getStatus(n),flash:(n,o)=>this.controller.flashSeat(n,o)},e)}).catch(()=>{})}destroy(){this.transportAbort.abort(),this.loadAbort?.abort(),this.loadAbort=null,this.destroyed=!0,Ir(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.idleClock?.dispose(),this.idleClock=null,this.dismissAccessPanel(),this.dismissHoldExpired(),this.access?.clear(),this.hold&&!this.handedOff&&this.opts.holdOnClose!=="keep"&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),Je(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerCountdownTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.viewportResizeHandler&&window.removeEventListener("resize",this.viewportResizeHandler),this.viewportResizeHandler=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalCleanup?.(),this.closeModal=null}};function Ud(i){lt.prewarm(i)}var At=require("@seatlayer/core");var qd="seatlayer-performance-group-picker-style";function Wd(){if(document.getElementById(qd))return;let i=document.createElement("style");i.id=qd,i.textContent=`
|
|
3562
|
+
</div>`,e.append(n)}buildErrorCard(e,t){let n=Ru[t],o=document.createElement("div");Object.assign(o.style,{maxWidth:"420px",margin:"auto 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});let r=document.createElement("h2");r.textContent=n.title,Object.assign(r.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let s=document.createElement("p");s.textContent=n.body,Object.assign(s.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),o.append(r,s,a),e.append(o)}};function Ei(i,e){let t=document.createElement("div");t.className="sl-loading-state";let n=document.createElement("div");if(n.setAttribute("role",e.busy?"status":"alert"),n.setAttribute("aria-atomic","true"),e.busy){let s=document.createElement("div");s.className="sl-boot-spin",s.setAttribute("aria-hidden","true"),t.append(s)}let o=document.createElement("div");if(o.className="sl-boot-title",o.textContent=e.title,n.append(o),e.description){let s=document.createElement("p");s.className="sl-loading-description",s.textContent=e.description,n.append(s)}t.append(n);let r=null;return e.actionLabel&&(r=document.createElement("button"),r.type="button",r.className="sl-boot-retry",r.textContent=e.actionLabel,t.append(r)),i.replaceChildren(t),r}function Iu(i){let{viewportWidth:e,viewportHeight:t,offsetTop:n,offsetLeft:o,clientWidth:r,clientHeight:s,innerHeight:a,largeViewportHeight:l}=i;if(![e,t,n,o].every(Number.isFinite)||e<=0||t<=0)return null;let c=Number.isFinite(r)&&r>0?r:e,d=Number.isFinite(s)&&s>0?s:t,p=n;return Number.isFinite(l)&&a>l+1&&d<l-1&&(p=Math.max(p,l-d)),{width:Math.min(e,c),height:Math.min(t,d),top:p,left:o}}function Tl(i){let e=window.visualViewport;if(!e)return()=>{};let t=document.createElement("div");t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",visibility:"hidden",pointerEvents:"none",width:"0",height:"100lvh",overflow:"hidden"}),document.body.appendChild(t);let n=()=>{let c=Iu({viewportWidth:e.width,viewportHeight:e.height,offsetTop:e.offsetTop,offsetLeft:e.offsetLeft,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight,innerHeight:window.innerHeight,largeViewportHeight:t.getBoundingClientRect().height});c&&Object.assign(i.style,{right:"auto",bottom:"auto",top:`${c.top}px`,left:`${c.left}px`,width:`${c.width}px`,height:`${c.height}px`})},o=0,r=0,s=0,a=()=>{o&&window.cancelAnimationFrame(o),r&&window.cancelAnimationFrame(r),s&&window.clearTimeout(s),o=window.requestAnimationFrame(()=>{o=0,r=window.requestAnimationFrame(()=>{r=0,n()})}),s=window.setTimeout(()=>{s=0,n()},250)},l=()=>{n(),a()};return l(),e.addEventListener("resize",l),e.addEventListener("scroll",l),window.addEventListener("resize",l),window.addEventListener("orientationchange",l),window.addEventListener("pageshow",l),()=>{o&&window.cancelAnimationFrame(o),r&&window.cancelAnimationFrame(r),s&&window.clearTimeout(s),e.removeEventListener("resize",l),e.removeEventListener("scroll",l),window.removeEventListener("resize",l),window.removeEventListener("orientationchange",l),window.removeEventListener("pageshow",l),t.remove()}}function El(i,e){let t=new Set(["chart","objects","resume","availability"]),n=new Map;return new Proxy(Object.create(i),{get(o,r){let s=i,a=Reflect.get(s,r,s);return typeof a!="function"?a:(n.has(r)||n.set(r,t.has(String(r))?async(...l)=>{let c=await ui(()=>a.apply(s,l),e,()=>{});if(c.outcome==="loaded")return c.value;if(c.outcome==="error")throw c.error;let d=new Error(c.outcome==="timeout"?"request_timeout":"request_cancelled");throw d.name=c.outcome==="timeout"?"TimeoutError":"AbortError",d}:a.bind(s)),n.get(r))}})}var B=require("@seatlayer/core"),Io=require("@seatlayer/core/view3d/crossfade/panorama");function Cl(i){return!!i&&i.clientWidth>0&&i.scrollWidth>i.clientWidth+1}function Ou(i){return i.some(e=>Cl(e))}var go="data-fit-gone",_u=12;function Sr(i,e,t=Cl){if(!i)return 0;for(let n of e)i.classList.remove(n.cls);if(i.querySelectorAll(`[${go}]`).forEach(n=>{n.removeAttribute(go),n.hidden=!1}),i.dataset.fit="0",i.clientWidth<=0||!t(i))return 0;for(let n=0;n<e.length;n+=1){let o=e[n];n>0&&i.classList.remove(e[n-1].cls),i.classList.add(o.cls),i.dataset.fit=String(n+1);let r=o.give?o.give(i):!0;if(!t(i))return n+1;if(o.repeat&&o.give){for(let s=1;r&&s<_u;s+=1)if(r=o.give(i),!t(i))return n+1}}return e.length}function Nu(i,e="[data-fit-seg]"){let t=[...i.querySelectorAll(e)].filter(n=>!n.hidden);return t.length<2?!1:Al(t[t.length-1])}function Du(i,e){let t=i.querySelector(e);return t&&!t.hidden?Al(t):!1}function Al(i){let e=i.previousElementSibling;return e instanceof HTMLElement&&e.tagName==="I"&&(e.setAttribute(go,""),e.hidden=!0),i.setAttribute(go,""),i.hidden=!0,!0}function Bu(i){if(!i)return!1;let e=(i.getAttribute("aria-label")||i.textContent||"").trim();return e?(i.setAttribute("aria-label",e),i.setAttribute("title",e),!0):!1}function Pl(i){if(!i)return 0;let e=i.querySelector(".sl-confirm-cancel"),t=i.querySelector(".sl-confirm-add-t");return Sr(i,[{cls:"sl-fit-track"},{cls:"sl-fit-type"},{cls:"sl-fit-icon",give:()=>Bu(e)}],()=>Ou([e,t]))}function Ml(i){return Sr(i,[{cls:"sl-fit-notype",give:e=>Du(e,"[data-fit-type]")},{cls:"sl-fit-short",give:e=>Nu(e),repeat:!0}])}function Ll(i){return i?(i.classList.add("sl-fitpill"),Sr(i,[{cls:"sl-fit-p1"},{cls:"sl-fit-p2"},{cls:"sl-fit-p3"}])):0}var Fu=["on-sale","low","sold-out","presale","closed"];function sn(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function Tr(i){return i==null?null:typeof i=="number"&&Number.isFinite(i)&&i>=0?i:void 0}function Hl(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i,t=e.count,n=e.index;if(typeof n!="number"||!Number.isInteger(n)||n<1||typeof t!="number"||!Number.isInteger(t)||t<n)return;let o=e.remaining;if(o!=null&&(typeof o!="number"||!Number.isInteger(o)||o<0))return;let r={index:n,count:t,remaining:o??null};if(e.pricingMode!==void 0){if(e.pricingMode!=="matrix")return;r.pricingMode="matrix"}if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;r.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;r.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;r.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let s of["startsAt","endsAt"]){if(e[s]===void 0)continue;let a=Tr(e[s]);if(a===void 0)return;r[s]=a}return r}function Vu(i){if(i==null)return null;if(typeof i!="object"||Array.isArray(i))return;let e=i;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],n=new Set;for(let s of e.channels){if(!s||typeof s!="object"||Array.isArray(s))return;let a=s,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||n.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],d=new Set;for(let p of a.priceOverrides){if(!p||typeof p!="object"||Array.isArray(p))return;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"",b=u.tierId===null?null:typeof u.tierId=="string"&&u.tierId.trim()?u.tierId.trim():void 0,g=sn(u.price);if(!h||b===void 0||g===void 0||g===null)return;let T=`${h}\0${b??""}`;if(d.has(T))return;d.add(T),c.push({categoryKey:h,tierId:b,price:g})}n.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let o=[],r=new Set;for(let s of e.objects){if(!s||typeof s!="object"||Array.isArray(s))return;let a=s,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||r.has(l)||!n.has(c))return;r.add(l),o.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:o}}function bo(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i,t=Fu.find(p=>p===e.state);if(!t)return null;let n=sn(e.fromPrice),o=sn(e.previousPrice);if(n===void 0||o===void 0)return null;let r=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(r===void 0)return null;let s=Hl(e.release);if(s===void 0)return null;let a=e.upcoming===void 0?null:Hl(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let p=[];for(let u of e.prices){if(!u||typeof u!="object"||Array.isArray(u))return null;let h=u,b=typeof h.categoryKey=="string"?h.categoryKey.trim():"";if(!b)return null;let g=sn(h.price),T=sn(h.previousPrice);if(g==null||T===void 0)return null;let w={categoryKey:b,price:g,previousPrice:T};if(h.tierId!==void 0){if(h.tierId!==null&&(typeof h.tierId!="string"||!h.tierId.trim()))return null;w.tierId=h.tierId===null?null:h.tierId.trim()}if(h.offerId!==void 0){if(typeof h.offerId!="string"||!h.offerId.trim())return null;w.offerId=h.offerId.trim()}if(h.offerName!==void 0){if(typeof h.offerName!="string"||!h.offerName.trim())return null;w.offerName=h.offerName.trim()}if(h.remaining!==void 0){if(h.remaining!==null&&(typeof h.remaining!="number"||!Number.isInteger(h.remaining)||h.remaining<0))return null;w.remaining=h.remaining==null?null:h.remaining}for(let v of["startsAt","endsAt"]){if(h[v]===void 0)continue;let M=Tr(h[v]);if(M===void 0)return null;w[v]=M}p.push(w)}l=p}let c=Vu(e.channelPricing);if(c===void 0)return null;let d=Tr(e.nextPriceChangeAt);return d===void 0?null:{state:t,fromPrice:n,previousPrice:o,currency:r,release:s,upcoming:a,prices:l,channelPricing:c,...e.nextPriceChangeAt!==void 0?{nextPriceChangeAt:d}:{}}}function Rl(i){return i?.changed!==!1}function Il(i,e){if(!i)return null;let t=null,n=o=>{o!=null&&o>e&&(t===null||o<t)&&(t=o)};for(let o of[i.release,i.upcoming])n(o?.startsAt),n(o?.endsAt);for(let o of i.prices)n(o.startsAt),n(o.endsAt);return n(i.nextPriceChangeAt),t}function Er(i){let e={};for(let t of i?.prices??[])if(t.tierId==null)e[t.categoryKey]=t.price;else{let n=e[t.categoryKey],o=typeof n=="number"?{base:n}:n??{};e[t.categoryKey]={...o,tiers:{...o.tiers,[t.tierId]:t.price}}}return e}function Ol(i,e){let t={...i};for(let[n,o]of Object.entries(Er(e))){let r=t[n];t[n]=typeof o=="number"?o:{...typeof r=="number"?{base:r}:r,...o,tiers:{...typeof r=="object"?r.tiers:{},...o.tiers}}}return t}var Nl=require("@seatlayer/core");var _l="maintenance_mode";function $u(i){if(!i||typeof i!="object")return!1;let e=i;return e.reason===_l||e.code===_l}function zu(i){return typeof i!="number"||!Number.isFinite(i)||i<0?null:Math.max(1,Math.ceil(i/60))}function Cr(i){if(!$u(i))return null;if(typeof i.notice=="string"&&i.notice.trim())return i.notice.trim();let e=zu(i.retryAfterS);if(e===null)return y("picker.maintenancePausedShortly","Booking is paused for a few minutes for maintenance. Please try again shortly.");let t=(0,Nl.tCount)("picker.maintenancePaused",e);return t==="picker.maintenancePaused"?`Booking is paused for maintenance. Please try again in about ${e} minute${e===1?"":"s"}.`:t}function Dl(i){return i.focusedSection!==null?i.deeperThanSectionFrame===!1?"venue":"section":i.atVenueFit!==void 0?i.atVenueFit?"none":"venue":i.seatsRevealed?"venue":"none"}var Bl=["pointerdown","pointermove","keydown","wheel","touchstart"],yo=class{constructor(e){this.opts=e;this.timer=null;this.root=null;this.doc=null;this.disposed=!1;this.onInput=()=>this.touch();this.onVisibility=()=>{this.doc&&!this.doc.hidden&&this.check()};this.lastInput=this.now()}get enabled(){return this.opts.minutes>0}now(){return this.opts.now?this.opts.now():Date.now()}attach(e,t=e.ownerDocument){if(!(this.disposed||!this.enabled)){this.root=e,this.doc=t;for(let n of Bl)e.addEventListener(n,this.onInput,{capture:!0,passive:!0});t.addEventListener("visibilitychange",this.onVisibility),this.touch()}}touch(){this.lastInput=this.now(),this.arm(this.opts.minutes*6e4)}recentlyActive(){return!this.enabled||this.now()-this.lastInput<this.opts.minutes*6e4}resume(){this.disposed||this.touch()}dispose(){if(this.disposed=!0,this.clear(),this.root)for(let e of Bl)this.root.removeEventListener(e,this.onInput,{capture:!0});this.doc?.removeEventListener("visibilitychange",this.onVisibility),this.root=null,this.doc=null}arm(e){if(this.disposed||!this.enabled)return;this.clear();let t=this.opts.setTimeout??((n,o)=>setTimeout(n,o));this.timer=t(()=>{this.timer=null,this.check()},Math.max(0,e))}clear(){if(this.timer===null)return;(this.opts.clearTimeout??(t=>clearTimeout(t)))(this.timer),this.timer=null}check(){if(this.disposed||!this.enabled)return;let e=this.lastInput+this.opts.minutes*6e4-this.now();if(e>0){this.arm(e);return}if(this.opts.blocked()){this.arm(6e4);return}this.clear(),this.opts.onIdle()}};async function Fl(i,e){let t=await i.pubApi?.pickerIdleMinutes().catch(()=>null)??null;if(i.destroyed||i.idleClock)return;let n=new yo({minutes:t??30,blocked:()=>!!i.hold,onIdle:()=>Vl(i)});n.enabled&&(i.idleClock=n,n.attach(e))}function Vl(i){i.destroyed||!i.root||i.holdExpiredEl||(i.realtime?.stop(),i.realtime=null,i.showAccessPanel({reason:"idle",retryable:!0}))}async function $l(i){if(i.destroyed)return!1;if(i.pubApi?.rotateViewerId(),i.access?.configured){let e=await i.refreshAccess();return e&&i.idleClock?.resume(),e}return i.dismissAccessPanel(),await i.controller.refresh(),i.realtime?i.realtime.restart():i.startRealtime(),i.idleClock?.resume(),!0}function zl(i){if(!i.destroyed){if(i.hold||i.idleClock?.recentlyActive()){i.pubApi?.rotateViewerId(),i.realtime?.restart();return}Vl(i)}}function jl(i,e,t=[],n=8,o=[]){let r=e.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,c.bottom-i.top+n),0),s=t.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,i.bottom-c.top+n),r>0?n:0),a=o.reduce((l,c)=>!c||c.width<=0||c.height<=0?l:Math.max(l,i.right-c.left+n),0);return{top:Math.max(0,Math.ceil(r)),right:Math.max(0,Math.ceil(a)),bottom:Math.max(0,Math.ceil(s)),left:0}}function Kl(i){let e=document.createElement("div");e.className="sl-floors sl-levels on",e.setAttribute("role","group"),e.setAttribute("aria-label",i.tf("picker.chooseLevel","Choose level")),e.title=i.tf("picker.floorHelp","All levels shows the complete venue. Choose one level to inspect and select its seats.");let t=i.tf("picker.allLevels","All levels"),n=[...i.floors.map((o,r)=>({id:o.id,name:o.name,code:ju(r)})).reverse(),{id:"",name:t,code:""}];for(let o of n){let r=document.createElement("button");if(r.type="button",r.className="sl-level",r.dataset.level=o.id,r.setAttribute("aria-pressed","false"),r.title=o.name,o.code){let a=document.createElement("b");a.className="sl-level-code",a.textContent=o.code,r.appendChild(a),r.setAttribute("aria-label",`${o.name} (${o.code})`)}let s=document.createElement("span");if(s.className="sl-level-name",s.textContent=o.name,r.appendChild(s),!o.code){let a=document.createElement("span");a.className="sl-level-short",a.setAttribute("aria-hidden","true"),a.textContent=i.tf("picker.allLevelsShort","All"),r.appendChild(a)}r.addEventListener("click",()=>i.onChoose(o.id)),e.appendChild(r)}return e.addEventListener("keydown",o=>{if(o.key!=="ArrowUp"&&o.key!=="ArrowDown")return;let r=[...e.querySelectorAll(".sl-level")],s=r.indexOf(document.activeElement);s<0||(o.preventDefault(),r[Math.max(0,Math.min(r.length-1,s+(o.key==="ArrowUp"?-1:1)))].focus())}),e}function ju(i){return i===0?"G":String(i)}function Gl(i,e,t){if(!i)return;let n=t?"":e;for(let o of i.querySelectorAll(".sl-level"))o.setAttribute("aria-pressed",String(o.dataset.level===n))}var vo=class{constructor(e){this.el=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.remove(),this.el=null,this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}render(e){this.el?.remove(),this.el=null}collapse(){!this.el||this.collapsed||!this.current||(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,n=this.host.map();if(!e||!t||!n)return 0;let o=this.host.activeFloorObjects().find(v=>v.type==="section"&&v.id===t.id)?.outline;if(!o||o.length<3)return 0;let r=o.map(v=>this.host.controller.worldToScreen(v)),s=r.map(v=>v.x),a=r.map(v=>v.y),l=Math.min(...s),c=Math.min(...a),d=Math.max(...s)-l,p=Math.max(...a)-c;if(d<=0||p<=0)return 0;let u=n.getBoundingClientRect(),h=e.getBoundingClientRect(),b=h.left-u.left,g=h.top-u.top,T=Math.max(0,Math.min(b+h.width,l+d)-Math.max(b,l)),w=Math.max(0,Math.min(g+h.height,c+p)-Math.max(g,c));return T*w/(d*p)}};var Ai=require("@seatlayer/core"),yc=require("@seatlayer/core/core/color");var kt=require("@seatlayer/core");function Ar(i,e,t){try{return new Intl.DateTimeFormat(e,{...t,...i.timezone?{timeZone:i.timezone}:{}}).format(new Date(i.startsAt))}catch{return new Date(i.startsAt).toLocaleString(e)}}var wo=(i,e)=>Ar(i,e,{dateStyle:"medium"}),xo=(i,e)=>Ar(i,e,{timeStyle:"short"}),Ci=(i,e)=>Ar(i,e,{weekday:"short",day:"numeric",month:"short"});function Ul(i,e,t,n){return!i.length||i.length>=e?null:{summary:n,labels:i.map(o=>`${wo(o,t)} \xB7 ${xo(o,t)}`)}}function Ku(i,e){let t=new Set(e);return i.map(n=>({...n,free:!t.has(n.eventKey)}))}function ql(i,e){let t=[...i];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Gu(i,e,t="",n=!1){if(!i.length)return"";let o=i.map(r=>{let s=r.free?e.free:e.blocked,a=n&&r.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${L(r.eventKey)}" aria-label="${L(`${r.shortDate}: ${s}`)}" checked>`:"";return`<li class="sl-night${r.free?" ok":" no"}" aria-label="${L(`${r.shortDate}: ${s}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${L(r.shortDate)}</span><span class="st">${L(s)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${L(e.title)}</div><ul class="sl-nightstrip">${o}</ul><p class="sl-tip-nights-note">${L(e.notAvailableOn)}</p>`+t+"</div>"}function Uu(i){return i.selectPartialLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${L(i.selectPartialLabel)}</button>`:i.switchLabel&&i.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${L(i.switchLabel)}</button>`:i.switchLabel||i.selectPartialLabel?"":`<p class="sl-tip-advice">${L(i.advice)}</p>`}function qu(i){return Number(i.available)+Number(i.selected)+Number(i.partial)+Number(i.unavailable)}function Wl(i,e,t){if(qu(i)<2)return"";let n=(r,s,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${r}"${a}></i>${L(s)}</li>`,o=[];return i.available&&o.push(n("sl-pg-sw-free",e.available,` style="background:${L(t)}"`)),i.selected&&o.push(n("sl-pg-sw-sel",e.selected)),i.partial&&o.push(n("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${L(t)}"`)),i.unavailable&&o.push(n("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${L(e.title)}">${o.join("")}</ul>`}function Yl(i,e){if(!i.length)return"";let t=i.map(n=>{let o=n.labels.length?n.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${n.labels.length?"":" empty"}${n.active?" active":""}" role="button" tabindex="0"${n.active?' aria-current="true"':""} data-event-key="${L(n.eventKey)}"><span class="n">${L(n.name)}</span><span class="s">${L(o)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${L(e.title)}"><div class="sl-pg-nights-title">${L(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function Pr(i,e){if(i?.kind!=="partial"||!e?.length)return null;let t=i.data?.blockedEventKeys??[],n=Ku(e,t);return{states:n,missing:n.filter(o=>!o.free).map(o=>o.shortDate)}}function Xl(i,e){return i?Gu(i.states,{title:y("picker.group.partlyAvailableTitle","Free on some nights only"),free:y("picker.group.nightFree","Free"),blocked:y("picker.group.nightBlocked","Not available"),notAvailableOn:(0,kt.t)("picker.group.notAvailableOn",{dates:ql(i.missing,e.locale)})},Uu({switchLabel:e.switchLabel??null,selectPartialLabel:e.selectPartialLabel??null,pinned:e.pinned,advice:y("picker.group.pickSeatFreeEveryNight","Pick a seat that is free every night.")}),!!e.selectPartialLabel&&!!e.pinned):""}function Wu(i,e,t,n){if(!i.length)return"";let o=new Set(e),r=new Set(t),s=i.map(a=>{let l=o.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${L(a.eventKey)}" aria-label="${L(`${a.shortDate}: ${l?n.available:n.unavailable}`)}"${l&&r.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${L(a.shortDate)}</span><span class="sl-confirm-date-state">${L(l?n.available:n.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${L(n.title)}</legend><p class="sl-confirm-dates-copy">${L(n.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${L(n.selectAll)}</span></label><ul>${s}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function Ql(i,e,t,n){let o=e.availableEventKeys(t);return Wu(i,o,e.includedEventKeys(),{title:n("picker.group.confirmDatesTitle","Choose performance dates"),copy:o.length===i.length?n("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(i.length)):n("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(o.length)).replace("{total}",String(i.length)),selectAll:n("picker.group.confirmSelectAll","Select all available dates"),available:n("picker.group.nightFree","Available"),unavailable:n("picker.group.nightBlocked","Unavailable")})}function Zl(i){return[...i.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function Jl(i,e,t,n){let o=[...i.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!o.length)return;let r=i.querySelector(".sl-confirm-add"),s=i.querySelector("[data-pg-confirm-all]"),a=()=>{let l=o.filter(p=>!p.disabled),c=Zl(i).length;s&&(s.checked=c===l.length,s.indeterminate=c>0&&c<l.length);let d=i.querySelector("[data-pg-confirm-summary]");d&&(d.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),r.disabled=c===0,r.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),n()};o.forEach(l=>l.addEventListener("change",a)),s?.addEventListener("change",()=>{o.filter(l=>!l.disabled).forEach(l=>{l.checked=s.checked}),a()}),a()}async function ec(i,e,t){if(!i||!t||!i.querySelector("[data-pg-confirm-event-key]"))return!0;let n=Zl(i);if(!n.length)return!1;let o=i.querySelector(".sl-confirm-add");return o?.setAttribute("aria-busy","true"),o&&(o.disabled=!0),await t.apply(e,n)?!0:(o?.removeAttribute("aria-busy"),o?.isConnected&&(o.disabled=!1),!1)}function tc(i,e,t){return i?(0,kt.t)("picker.group.seatPartlyAvailable",{label:e,free:i.states.length-i.missing.length,total:i.states.length,dates:ql(i.missing,t)}):""}function ic(i,e){let t=i.map((n,o)=>{let r=n.state==="done"?e.done:n.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${L(n.id)}" data-state="${L(n.state)}"${n.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${n.state==="done"?"\u2713":String(o+1)}</span><span class="l">${L(n.label)}</span><span class="sl-pg-sr">${L(r)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${L(e.label)}">${t}</ol>`}function Mr(i,e){return`<ul class="sl-pg-cards">${i.map(n=>`<li class="sl-pg-card" data-event-key="${L(n.eventKey)}"><span class="n">${L(n.name)}</span><time datetime="${L(n.iso)}"><span class="d">${L(n.date)}</span><span class="t">${L(n.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${L(e)}</p>`}function nc(i){let e=i.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${L(t.eventKey)}"><span class="n">${L(t.name)}</span><span class="s">${L(t.labels.length?t.labels.join(", "):i.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${L(i.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(i.note?`<p class="sl-pg-pane-note">${L(i.note)}</p>`:"")+(i.total?`<div class="sl-pg-pane-total"><span>${L(i.total.label)}</span><b>${L(i.total.amount)}</b></div>`:"")+(i.holdStatus?`<p class="sl-pg-hold-status" role="status">${L(i.holdStatus)}</p>`:"")}function oc(i){let e=Math.max(0,i);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function rc(i,e){if(!i||i.seats<=0)return"";if(e==="same_seat"){let t=i.perPerformance??i.seats;return i.totalPerformances&&i.performances<i.totalPerformances?(0,kt.tCount)("picker.group.performancesChosenOf",t,{chosen:i.performances,total:i.totalPerformances}):(0,kt.tCount)("picker.group.seatsEveryPerformance",t)}return i.perPerformance!=null&&i.performancesChosen===i.performances?(0,kt.tCount)("picker.group.seatsPerPerformance",i.seats,{per:i.perPerformance}):(0,kt.tCount)("picker.group.performancesChosenOf",i.seats,{chosen:i.performancesChosen,total:i.performances})}function sc(i,e){i.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let n=()=>e(t.dataset.eventKey);t.addEventListener("click",n),t.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||(o.preventDefault(),n())})})}var ac=require("@seatlayer/core");function St(i){return String(i??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function Yu(i,e){let t=i.objectType==="table"&&!!i.bookingMode,n=i.objectType==="booth",o=t||n||!i.seatNumber,r=o?i.rowLabel??i.displayLabel??i.label:i.seatNumber,s=t?`${y("picker.guests","Guests")} ${i.bookingMode==="variable"?`${i.minOccupancy}\u2013${i.maxOccupancy}`:i.capacity}`:!n&&i.rowLabel?`${e} ${fe(i)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${o?" name":""}">${St(r)}</span>`+(s?`<span class="sl-tip-row">${St(s)}</span>`:"")+"</div>"+(i.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${y("picker.section","Section")}</span><span class="sl-tip-secname">${St(i.sectionLabel)}</span></div>`:"")+"</div>"}function lc(i,e){let t=i.status==="not_for_sale",n=i.mark?.kind==="partial",o=i.status==="free"||n?"":`<span class="sl-tip-tag">${t?y("picker.notAvailable","Not available"):i.status==="held"?(0,ac.t)("map.statusHeld"):y("picker.sold","Sold")}</span>`,r=t?"":e.price,s=r?`<span class="sl-tip-amt">${St(r)}</span>`:"",a=!r&&e.priceNote?`<div class="sl-tip-note">${St(e.priceNote)}</div>`:"",l=Dt(i,{compact:!0}),c=e.reason?`<div class="sl-tip-reason">${St(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Yu(i,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${St(i.categoryColor)}"></span><span class="sl-tip-name">${St(i.categoryLabel)}</span>`+o+s+"</div>"+a+c+l+(e.extra??"")}function cc(i,e,t,n){let o=i.x+14,r=i.y-n.height-12,s=i.y+18,a=r;o+n.width>e-8&&(o=i.x-n.width-14),r<8&&s+n.height<=t-8&&(a=s);let l=Math.max(8,t-n.height-8);return{left:Math.max(8,Math.min(o,Math.max(8,e-n.width-8))),top:Math.max(8,Math.min(a,l))}}function dc(i,e,t,n=22){let o=Math.max(8,Math.min(i.x-t.width/2,Math.max(8,e.width-t.width-8))),r=i.y-n-t.height,s=i.y+n;return r>=8?{left:o,top:r,placement:"above"}:s+t.height<=e.height-8?{left:o,top:s,placement:"below"}:{left:o,top:Math.max(8,Math.min(r<8?s:r,Math.max(8,e.height-t.height-8))),placement:r<8?"below":"above"}}var Lr=14,Xu=12,Qu=12,Zu=8;function pc(i,e,t,n=Xu){let o=e.height-Lr-t.height,r=Qu,s=o-n;if(s<=r)return{placement:"sheet",nudgeY:0};let a=(r+s)/2-i;return Math.abs(a)<=Zu?{placement:"sheet",nudgeY:0}:{placement:"sheet",nudgeY:Math.round(a)}}function hc(i,e,t,n,o=0){let r=t.width/2+12,s=Math.max(r,Math.min(e.width-r,i.x)),a=i.y+o+t.height+24<=e.height,l=i.y-o<t.height+24&&a?"below":"above",c=l==="above"?i.y-o:i.y+o,d=n&&l==="above"?Math.max(t.height+24,c):c;return{left:s,top:Math.max(8,Math.min(e.height-8,d)),placement:l}}function uc(i,e,t){let n=i.querySelector("[data-pg-select-partial]"),o=[...i.querySelectorAll("[data-pg-event-key]")],r=()=>o.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),s=()=>{if(!n)return;let a=r().length;n.disabled=a===0,n.textContent=e?.(a)??n.textContent};o.forEach(a=>{a.addEventListener("change",s);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,s())})}),n?.addEventListener("click",()=>{let a=r();a.length&&t?.(a)})}function Kt(i){let e=i?.displayType?.trim()||i?.rowType?.trim();return e||(i?.objectType==="table"?y("picker.table","Table"):i?.objectType==="booth"?y("picker.booth","Booth"):y("picker.row","Row"))}var Ju="sl-confirm-scrim",em="--sl-scrim-mask";function tm(i){let e=Math.round(i.x),t=Math.round(i.y);return`radial-gradient(circle at ${e}px ${t}px, transparent 0 56px, #000 88px)`}function mc(i,e,t,n){let o=i??document.createElement("div");return i||(o.className=Ju),o.style.setProperty(em,tm(n)),t.parentNode===e?o.nextSibling!==t&&e.insertBefore(o,t):o.parentNode!==e&&e.appendChild(o),o}function Hr(i){return i?.remove(),null}var fc={passport:!1,compare:!1},im=360,nm=160,om=700,gc=450,rm=8;function bc(){try{return globalThis.matchMedia?.("(pointer: coarse)").matches??!1}catch{return!1}}function sm(i){return(0,yc.contrastRatio)("#ffffff",i)>=3?"#ffffff":"#0b0f19"}var ko=class{constructor(e){this.el=null;this.seat=null;this.outsideTap=null;this.scrim=null;this.shownAt=0;this.lift=null;this.framing=null;this.mode="add";this.host=e}get element(){return this.el}set element(e){this.el=e}get candidate(){return this.seat}set candidate(e){this.seat=e}thumbHtml(e){let t=this.host.controller.doc;if(!t)return"";let n=Ti(e)?e.viewUrl??"":"",o=ho(t);if(!n&&!o)return"";let r=n?null:uo(e,e.focalPoint??t.focalPoint);if(!n&&r==null)return"";let s="";if(!n)return s;let a=q((0,Ai.t)("picker.viewFromSeat",{label:e.label})),l=q(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>`+s}show(e,t="add"){let n=this.host;this.mode=t;let o=this.seat?.id;this.el?.remove(),this.el=null,this.seat=e,n.root()?.setAttribute("data-confirming","true"),n.els().side?.toggleAttribute("inert",!0),Object.values(n.regions()).forEach(P=>P.toggleAttribute("inert",!0)),n.controller.setSelectionFocus(e.id),o&&o!==e.id&&n.controller.deselect([o]),n.hideTooltip();let r=n.controller.seatDetails(e.id),s=n.controller.doc?.categories.find(P=>P.key===e.categoryKey),a=r?.price??(s?.tiers?.length?s.tiers[0].price:s?.price),l=a!=null?n.paidPrice(e.categoryKey,r?.tierId??s?.tiers?.[0]?.id??null,a,e.label):void 0,c=sa(r,e.displayLabel??e.label,Kt(r)),d=r?.tiers??s?.tiers??[],p=r?.tierId??d[0]?.id,u=n.suppressPricing()?"":Nn(d,p,P=>n.money(n.paidPrice(e.categoryKey,P.id,P.price,e.label)),P=>n.offerName(e.categoryKey,P.id)),h=n.buyerView()==="venue3d",b=n.performanceGroup()?.confirmDateSelection??void 0,g=b?n.performanceGroup()?.nights?.()??[]:[],T=b?Ql(g,b,e.id,(P,z)=>n.tf(P,z)):"";this.shownAt=performance.now();let w=document.createElement("div");w.className="sl-confirm sl-mo-in",t==="remove"&&w.classList.add("sl-confirm-removing"),T&&w.classList.add("sl-confirm-group-dates"),w.setAttribute("role","dialog"),w.setAttribute("aria-label",(0,Ai.t)("picker.confirmSeatLabel",{label:e.label}));let v=n.controller.getRenderer?.()?.categoryDisplayColor?.(e.categoryKey)??s?.color??"#6e7bff";w.style.setProperty("--sl-cat",v),w.style.setProperty("--sl-cat-ink",sm(v));let M=String(r?.categoryLabel??s?.label??e.categoryKey),F=n.controller.categoryAvailability()[e.categoryKey],X=typeof F=="number"&&F>0?(0,Ai.tCount)("picker.leftCount",F):"",f=n.suppressPricing()?`${r?.displayLabel??e.displayLabel??e.label}`:`${r?.displayLabel??e.displayLabel??e.label} \xB7 ${l==null?n.tf("picker.priceNotSupplied","Price not supplied"):n.money(l)}`,O=fc.passport?ra(e,f,h):"",G=fc.compare?oa(e,h?n.view3dCompareSeatIds():null):"";w.innerHTML=da({identityFields:c,identity:aa(r,e.displayLabel??e.label,Kt(r)),marker:na({...r?.wheelchairSpaceType?{wheelchairSpaceType:r.wheelchairSpaceType}:{}}),see3dPill:la(n.canOffer3d(),h),categoryColor:v,categoryLabel:M,priceLabel:!n.suppressPricing()&&l!=null?n.money(l):"",categoryLeftLabel:X,tierChoices:u,groupDates:T,wheelchair:"",commercial:Dt({...e.accessibility?.length?{accessibility:e.accessibility}:{},...r?.wheelchairSpaceType?{wheelchairSpaceType:r.wheelchairSpaceType}:{},...e.commercial?{commercial:e.commercial}:{},...r?.aisle?{aisle:!0}:{},...r?.boothType?{boothType:r.boothType}:{},...r?.entrance?{entrance:r.entrance}:{}}),thumb:n.seatViewEnabled()&&n.buyerView()!=="venue3d"?this.thumbHtml(e):"",inspect:h?`<div class="sl-confirm-inspect-row">${O}${G}${er(n.canOffer3d(),h)}</div>`:er(n.canOffer3d(),h),see3dRow:ca(n.canOffer3d(),h),cancelLabel:(0,Ai.t)("common.cancel"),selectLabel:t==="remove"?n.tf("picker.removeSeat","Remove seat"):n.addSeatLabel(r?.objectType)}),t==="remove"&&w.querySelector(".sl-confirm-add svg path")?.setAttribute("d","M6 6l12 12M18 6L6 18"),n.els().map.appendChild(w),this.el=w;let _=w.querySelector(".sl-confirm-thumb"),j=_?.closest(".sl-confirm-thumbwrap")??null;if(_&&j){let P=!1,z=()=>{if(P||!j.isConnected)return;P=!0;let W=()=>{j.remove(),this.el===w&&n.reanchor()};if(n.reducedMotion()||typeof requestAnimationFrame!="function"){W();return}j.style.height=`${j.offsetHeight}px`,j.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{j.style.height="0px",j.style.opacity="0"}),setTimeout(W,nm)};_.addEventListener("error",z),_.addEventListener("load",()=>{_.naturalWidth||z()});let J=e.viewMeta?.previewUrl??e.viewUrl;J?n.resolveAssetUrl(J).then(W=>{if(!(!w.isConnected||this.el!==w)){if(!W){z();return}_.src=W}}).catch(W=>{z(),n.onError(W)}):z()}n.reanchor(),this.liftSeatClearOfSheet(e),w.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{n.openSeatView(e)}),w.querySelector(".sl-confirm-confidence")?.addEventListener("click",P=>{n.openSeatConfidencePassport(e,P.currentTarget instanceof HTMLElement?P.currentTarget:null)}),w.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>n.saveView3dComparisonSeat(e)),w.querySelectorAll("[data-confirm-tier]").forEach(P=>{P.addEventListener("click",()=>{let z=P.dataset.confirmTier,J=d.find(oe=>oe.id===z);if(!J)return;n.controller.setSeatTier(e.id,J.id),w.querySelectorAll("[data-confirm-tier]").forEach(oe=>{oe.setAttribute("aria-pressed",String(oe===P))});let W=w.querySelector(".sl-confirm-price");W&&(W.textContent=n.money(n.paidPrice(e.categoryKey,J.id,J.price,e.label))),n.reanchor()})}),w.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill,.sl-confirm-3drow").forEach(P=>{P.addEventListener("pointerdown",Ln,{once:!0}),P.addEventListener("click",()=>{n.buyerView()==="venue3d"?(n.dismiss(),n.view3dHandle()?.flyToSeat(e.id)):(n.rememberView3dReturnSeat(e),n.dismiss(),n.enter3d(e.id))})}),Jl(w,b,(P,z)=>n.tf(P,z),()=>n.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(),n.liftToastOverConfirm(),n.fitTranslatedRows(),n.inviteCommit(w,P)})}liftSeatClearOfSheet(e){let t=this.host.controller.getRenderer();this.framing={gestures:t?.getCameraGestureCount?.()??0,quietUntil:0},this.frameSeatForSheet(e)}frameSeatForSheet(e){let t=this.host,n=t.root();if(!this.el||n?.dataset.layout!=="narrow"||n?.dataset.view3d==="on")return;let o=t.els().map;if(!o)return;let r=t.controller.worldToScreen({x:e.x,y:e.y}),s=t.controller.getRenderer(),a=s?.getCameraGestureCount?.()??0,{nudgeY:l}=pc(r.y,{height:o.clientHeight},{height:this.el.offsetHeight||230}),c=this.lift&&this.lift.gestures===a?this.lift.dy:0;if(!l){this.lift=c?{dy:c,gestures:a}:null;return}let d=!t.reducedMotion();s?.panScreenBy?.({x:0,y:l},{animate:d}),this.lift={dy:c+l,gestures:a},this.framing&&(this.framing.gestures=a,this.framing.quietUntil=d?this.now()+om:0)}reframeSeatForSheet(){let e=this.framing,t=this.seat;!e||!t||e.quietUntil&&this.now()<e.quietUntil||(this.host.controller.getRenderer()?.getCameraGestureCount?.()??e.gestures)!==e.gestures||this.frameSeatForSheet(t)}now(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}settleLift(){let e=this.lift;if(this.lift=null,this.framing=null,!e)return;let t=this.host.controller.getRenderer();(t?.getCameraGestureCount?.()??e.gestures)===e.gestures&&t?.panScreenBy?.({x:0,y:-e.dy},{animate:!this.host.reducedMotion()})}reanchor(){let e=this.host;if(!this.el||!this.seat||e.root()?.dataset.view3d==="on")return;let t=e.controller.worldToScreen({x:this.seat.x,y:this.seat.y}),n=e.els().map;if(e.root()?.dataset.layout==="narrow"){this.el.removeAttribute("data-placement"),this.el.style.removeProperty("bottom"),this.scrim=mc(this.scrim,n,this.el,t),Ba(this.el,t,n),e.liftToastOverConfirm(),this.reframeSeatForSheet();return}this.scrim=Hr(this.scrim);let o=n.clientWidth,r=n.clientHeight,s=this.el.offsetWidth||276,a=this.el.offsetHeight||230,l=this.el.classList.contains("sl-confirm-group-dates"),c=e.controller.seatScreenRadius()*1.5,d=hc(t,{width:o,height:r},{width:s,height:a},l,c);this.el.dataset.placement=d.placement,this.el.style.left=`${d.left}px`,this.el.style.top=`${d.top}px`,Jn(this.el,t,{left:d.left,top:d.top,width:s,height:a})}ghostActivation(){return bc()?performance.now()-this.shownAt<gc:!1}armOutsideTap(e){this.disarmOutsideTap();let t=this.host,n=new Map,o=s=>{if(this.el!==e){this.disarmOutsideTap();return}let a=s.target,l=s;if(s.type!=="pointerdown"){let d=n.get(l.pointerId);n.delete(l.pointerId),d&&s.type==="pointerup"&&n.size===0&&Math.hypot(l.clientX-d.x,l.clientY-d.y)<=rm&&this.cancel();return}if(!(!a||e.contains(a)||t.els().tray?.contains(a))){if(a instanceof Element&&a.closest(".sl-view3d")){if(n.set(l.pointerId,{x:l.clientX,y:l.clientY}),n.size>1)for(let d of n.keys())n.set(d,{x:Number.NaN,y:Number.NaN});return}this.cancel()}};this.outsideTap=o;let r=t.root();setTimeout(()=>{this.outsideTap===o&&((r??document).addEventListener("pointerdown",o,!0),(r??document).addEventListener("pointerup",o,!0),(r??document).addEventListener("pointercancel",o,!0))},bc()?gc:0)}disarmOutsideTap(){if(!this.outsideTap)return;let e=this.outsideTap;this.outsideTap=null;for(let t of["pointerdown","pointerup","pointercancel"])(this.host.root()??document).removeEventListener(t,e,!0),document.removeEventListener(t,e,!0)}dismiss(){let e=this.host;this.disarmOutsideTap(),this.scrim=Hr(this.scrim),this.settleLift(),this.el&&eo(this.el),this.el=null,this.seat=null,e.liftToastOverConfirm(),e.root()?.removeAttribute("data-confirming"),Object.values(e.regions()).forEach(t=>t.toggleAttribute("inert",!1)),e.applyPanelCollapsed(),e.controller.setSelectionFocus(null),e.syncTray()}async commit(){let e=this.host,t=this.seat;if(!t)return;let o=this.el?.querySelector(".sl-confirm-add")??null;if(o?.classList.contains("is-adding")||!await ec(this.el,t.id,e.performanceGroup()?.confirmDateSelection??void 0))return;e.collapseSectionCard(),this.seat=null,e.syncTray(),e.syncSelectionTo3d();let r=()=>{let l=e.root()?.dataset.layout==="narrow"?this.lift:null;l&&(this.lift=null),e.dismiss();let c=e.controller.worldToScreen(t);br(e.els(),c,t,e.controller.doc?.categories,()=>{e.cartLanded?.(),l&&(this.lift=l,this.settleLift())})};if(!o||e.reducedMotion()){r();return}o.classList.remove("sl-confirm-add-invite"),o.classList.add("is-adding"),o.setAttribute("aria-disabled","true");let s=o.querySelector(".sl-confirm-add-t");s&&(s.textContent=e.tf("picker.added","Added")),e.scheduleMotion(r,im)}cancel(){let e=this.host,t=this.seat;t&&(this.mode!=="remove"&&e.controller.deselect([t.id]),this.seat&&e.dismiss(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0}))}removeCommitted(){let e=this.host,t=this.seat;if(!t)return;let n=e.releaseHeldSeat(t);n||e.controller.deselect([t.id]),e.dismiss(),e.syncTray(),e.syncSelectionTo3d(),e.root()?.focus({preventScroll:!0})}};function vc(i,e,t){if(!e||t||i.classList.contains("sl-confirm-removing"))return;e.classList.add("sl-confirm-add-invite");let n=()=>e.classList.remove("sl-confirm-add-invite");i.addEventListener("pointerdown",n,{once:!0}),i.addEventListener("keydown",n,{once:!0}),e.addEventListener("focus",n,{once:!0})}function wc(i,e){return i&&i!=="seat"?e("picker.select","Select"):e("picker.addSeat","Add seat")}var xc=require("@seatlayer/core"),Pi=require("@seatlayer/core/picker/minimapGeometry");function am(i){let e={inactive:0,available:1,selected:2},t=new Map;for(let o of i){let r=t.get(o.id);(!r||e[o.state]>e[r])&&t.set(o.id,o.state)}let n={selected:0,available:0,inactive:0};for(let o of t.values())n[o]+=1;return n}function lm(i,e){return i.x<=e.x&&i.y<=e.y&&i.x+i.width>=e.x+e.width&&i.y+i.height>=e.y+e.height}function kc(i,e){let t=new Rr(i);return t.build(e),t}var Rr=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}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 n=document.createElement("button");n.type="button",n.className="sl-minimap-toggle",n.setAttribute("aria-label",y("picker.openVenueMap","Open venue overview map")),n.setAttribute("aria-expanded","false"),n.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(n),this.miniToggle=n;let o=document.createElement("div");o.className="sl-minimap",o.setAttribute("role","group");let r=document.createElement("div");r.className="sl-minimap-bar";let s=document.createElement("span");s.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",y("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",y("picker.closeVenueMap","Close venue overview map")),l.textContent="\xD7",r.append(s,a,l);let c=document.createElement("canvas");c.tabIndex=0,c.setAttribute("role","application"),c.setAttribute("aria-label",y("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),o.append(r,c),e.appendChild(o),this.miniWrap=o,this.miniLabel=s,this.miniCanvas=c;let d=document.createElement("canvas");this.miniBase=d,n.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,n=this.host.controller.getViewport()?.bounds;if(!e||!t||!n||!(n.width>0&&n.height>0))return;let o=196,r=146,s=6,a=n.width/Math.max(1,n.height),l=o,c=Math.round(o/a);c>r&&(c=r,l=Math.round(r*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,Pi.createMinimapTransform)(n,e.width,e.height,d,s)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?y("picker.allFloors","All floors"):e.find(d=>d.id===this.host.controller.getActiveFloorId())?.name??y("picker.venueOverview","Venue overview"),n=this.host.controller.getMinimapSnapshot().sections,r=n.find(d=>d.active)?.label??this.host.focusedSectionLabel(),s=r?`${t} \xB7 ${r}`:t;this.miniLabel.textContent=s;let{selected:a,available:l,inactive:c}=am(n);this.miniWrap.setAttribute("aria-label",n.length?`${s}. ${a} selected, ${l} available, ${c} inactive sections.`:s),this.miniCanvas?.setAttribute("aria-label",n.length?`${s}. ${a} selected, ${l} available, ${c} inactive sections. ${y("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${s}. ${y("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 n=e.getContext("2d");if(!n)return;n.clearRect(0,0,e.width,e.height);let o=p=>p*t.scale+t.offX,r=p=>p*t.scale+t.offY,s=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;n.beginPath(),p.outline.forEach((h,b)=>b===0?n.moveTo(o(h.x),r(h.y)):n.lineTo(o(h.x),r(h.y))),n.closePath();let u=p.paint;if(n.globalAlpha=p.state==="inactive"?.5:.92,u?n.fillStyle=u.fill:(n.globalAlpha=p.state==="inactive"?.18:p.state==="selected"?.72:.34,n.fillStyle=p.state==="inactive"?a:p.state==="selected"?l:c),n.fill(),n.globalAlpha=.82,n.lineWidth=Math.max(1,t.dpr),n.strokeStyle=u?.stroke||s,n.stroke(),p.owned){n.globalAlpha=1,n.lineWidth=Math.max(2,t.dpr*1.5),n.strokeStyle=l,n.stroke();let h=p.outline.reduce((b,g)=>({x:b.x+g.x,y:b.y+g.y}),{x:0,y:0});n.beginPath(),n.arc(o(h.x/p.outline.length),r(h.y/p.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),n.fillStyle=l,n.fill(),n.beginPath(),p.outline.forEach((b,g)=>g===0?n.moveTo(o(b.x),r(b.y)):n.lineTo(o(b.x),r(b.y))),n.closePath()}p.active&&(n.globalAlpha=1,n.lineJoin="round",n.lineWidth=Math.max(4,t.dpr*3.5),n.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",n.stroke(),n.lineWidth=Math.max(2,t.dpr*1.75),n.strokeStyle=l,n.stroke())}if(n.globalAlpha=1,!d.sections.length){let p=Math.max(1,t.dpr),u=new Map,h=b=>{let g=u.get(b);if(g)return g;let T=this.host.tint?.(b)||c;return u.set(b,T),T};for(let b of d.seats)n.globalAlpha=b.state==="inactive"?.22:.78,n.fillStyle=b.state==="inactive"?a:b.state==="selected"?l:h(b.categoryKey),n.beginPath(),n.arc(o(b.x),r(b.y),p,0,Math.PI*2),n.fill();n.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,n=this.miniTf;if(!e||!t||!n)return;let o=e.getContext("2d");if(!o)return;o.clearRect(0,0,e.width,e.height),o.drawImage(t,0,0);let r=this.host.controller.getViewport();if(!r)return;let s=lm(r.visible,r.bounds);if(this.host.root()?.toggleAttribute("data-minimap-idle",s),s)return;let a=(0,Pi.minimapViewportPlan)(r.visible,n,e.width,e.height,Math.max(2,n.dpr*2)),l=this.host.cssVar("--sl-text")||"#12151c",c=this.host.cssVar("--sl-surface")||"#fff";o.save(),o.globalAlpha=.1,o.fillStyle=l,o.fillRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),o.globalAlpha=.9,o.lineJoin="round",o.lineWidth=Math.max(4,n.dpr*3.25),o.strokeStyle=c,o.strokeRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),o.globalAlpha=1,o.lineWidth=Math.max(2,n.dpr*1.75),o.strokeStyle=l,o.strokeRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),a.clipped&&Object.values(a.clippedEdges).some(Boolean)&&(o.setLineDash([Math.max(3,n.dpr*3),Math.max(2,n.dpr*2)]),o.strokeRect(a.clipped.x,a.clipped.y,a.clipped.width,a.clipped.height)),o.restore()}minimapWorldPoint(e){let t=this.miniCanvas,n=this.miniTf;if(!t||!n)return null;let o=t.getBoundingClientRect(),r=(e.clientX-o.left)*(t.width/Math.max(1,o.width)),s=(e.clientY-o.top)*(t.height/Math.max(1,o.height));return{...(0,Pi.minimapPointToWorld)({x:r,y:s},n),px:r,py:s}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),n=this.host.controller.getViewport()?.visible;!t||!n||!(t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(n.x+n.width/2),offsetY:t.y-(n.y+n.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 n=this.minimapWorldPoint(e);n&&(!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:n.x-t.offsetX,y:n.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 n=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,o=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!n&&!o||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+n,y:t.y+t.height/2+o}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let n of this.host.controller.getMinimapSnapshot().sections)if(!(n.state==="inactive"||n.outline.length<3)&&(0,xc.pointInPolygon)(t,n.outline)){this.host.controller.focusSection(n.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var So=require("@seatlayer/core");var cm=12;function Sc(i,e){let t=e.floors(),n=new Set(t.map(f=>f.label.trim().toLocaleLowerCase())),o=e.zones().filter(f=>f.seatCount>0&&!n.has(f.label.trim().toLocaleLowerCase())),r=e.sections().filter(f=>f.seatCount>0&&!n.has(f.label.trim().toLocaleLowerCase())),s=o.length>1?[]:r,a=t.length>1,l=o.length>1,c=s.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>',b=document.createElement("span");u.innerHTML=h,u.appendChild(b);let g=()=>{for(let f of d.querySelectorAll(":scope > div")){let O=f.querySelector('[aria-pressed="true"]');!O||f.scrollWidth<=f.clientWidth||O.scrollIntoView({block:"nearest",inline:"nearest"})}},T=()=>{if(p)return p;for(let f of d.querySelectorAll(":scope > div")){let O=f.querySelector('button[aria-pressed="true"]'),G=O?.textContent?.trim();if(G&&O?.dataset.floor!=="")return G}return a&&(l||c)?y("picker.levelsAndAreas","Levels & areas"):a?y("picker.levels","Levels"):y("picker.areas","Areas")},w=f=>{d.classList.toggle("is-open",f),u.setAttribute("aria-expanded",String(f)),f&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(g),b.textContent=T()};u.addEventListener("click",()=>w(!d.classList.contains("is-open"))),d.addEventListener("keydown",f=>{f.key!=="Escape"||!d.classList.contains("is-open")||(f.preventDefault(),f.stopPropagation(),w(!1),u.focus())});let v=document.createElement("button");v.type="button",v.className="sl-view3d-nav-close",v.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let M=y("picker.closeVenueNavigation","Close venue navigation");v.setAttribute("aria-label",M),v.title=M,v.addEventListener("click",()=>{w(!1),u.focus()}),w(!1),d.appendChild(u);let F=f=>{},X=f=>{};if(a){let f=document.createElement("div");f.setAttribute("role","group"),f.setAttribute("aria-label",y("picker.levels","Levels"));let O=[];X=j=>{O.forEach(P=>{P.setAttribute("aria-pressed",String((P.dataset.floor===""?null:Number(P.dataset.floor))===j))})};let G=j=>{e.focusFloor(j)&&(X(j),F(j))},_=(j,P)=>{let z=document.createElement("button");z.type="button",z.textContent=j,z.dataset.floor=P===null?"":String(P),z.setAttribute("aria-pressed",String(P===null)),z.addEventListener("click",()=>{G(P),w(!1)}),O.push(z),f.appendChild(z)};_(y("picker.allLevels","All levels"),null);for(let j of t)_(j.label||(0,So.t)("picker.levelNumber",{number:j.index+1}),j.index);d.appendChild(f)}if(l||c){let f=document.createElement("div");f.setAttribute("role","group"),f.setAttribute("aria-label",y("picker.areas","Areas"));let O=l?o.map(_=>({id:_.id,label:_.label||_.id,go:()=>{e.focusZone(_.id)}})):s.map(_=>({id:_.id,label:_.label||_.id,floorIndex:_.floorIndex,go:()=>{e.focusSection(_.id),Number.isFinite(_.floorIndex)&&X(_.floorIndex)}})),G=_=>{let j=l||_===null?O:O.filter(P=>P.floorIndex===void 0||P.floorIndex===_);if(f.replaceChildren(),!j.length){f.remove();return}if(f.isConnected||d.insertBefore(f,v.isConnected?v:null),!l&&j.length>cm){let P=document.createElement("select");P.setAttribute("aria-label",y("picker.jumpToSection","Jump to section"));let z=document.createElement("option");z.value="",z.textContent=y("picker.jumpToSection","Jump to section"),P.appendChild(z);for(let J of j){let W=document.createElement("option");W.value=J.id,W.textContent=J.label,P.appendChild(W)}P.addEventListener("change",()=>{j.find(J=>J.id===P.value)?.go()}),f.appendChild(P);return}for(let P of j){let z=document.createElement("button");z.type="button",z.textContent=P.label,z.dataset.area=P.id,z.addEventListener("click",()=>{p=P.label,P.go(),w(!1)}),f.appendChild(z)}};F=G,G(null)}return d.appendChild(v),i.appendChild(d),d}var To=class{constructor(e){this.host=e;this.chip=null}sync(){let e=this.host.overlay();if(!e||this.host.savedSeatIds().length===0){this.chip?.remove(),this.chip=null;return}let t=this.chip;if(!t){t=document.createElement("div"),t.className="sl-view3d-compare-saved",t.setAttribute("role","group"),t.setAttribute("aria-label",y("picker.savedSeatComparison","Saved seat comparison"));let r=document.createElement("button");r.type="button",r.className="main",r.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(y("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let s=document.createElement("button");s.type="button",s.className="clear",s.textContent="\xD7",s.setAttribute("aria-label",y("picker.clearSavedSeatComparison","Clear saved seat comparison")),s.addEventListener("click",()=>this.host.clearComparison()),t.append(r,s),e.appendChild(t),this.chip=t}let n=this.host.savedSeatIds().length,o=t.querySelector(".main");o&&(o.textContent=n>1?(0,So.t)("picker.compareCount",{count:n}):y("picker.oneSeatSaved","1 seat saved"),o.setAttribute("aria-label",n>1?(0,So.t)("picker.openComparisonOfSeats",{count:n}):y("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function Tc(i){return!i?.querySelector('[data-ref="zfs"]')}var Ec="sl:sheet-hint";function Cc(i){let e=i.boot;if(!e?.isConnected)return;if(i.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),i.map?.appendChild(t),setTimeout(()=>t.remove(),450),i.rail?.classList.add("is-in"),i.root?.classList.add("is-arriving"),setTimeout(()=>{i.rail?.classList.remove("is-in"),i.root?.classList.remove("is-arriving"),dm(i.root)},700)}function dm(i){if(!i||i.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(Ec))return;window.sessionStorage.setItem(Ec,"1")}catch{}let e=i.querySelector(".sl-sheet-toggle");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function Ac(i,e){i.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let n of e())if(n.open()){t.preventDefault(),t.stopPropagation(),n.close();return}}})}function Eo(i){let e=i.committedSelection(),t=i.controller.getGAAreas(),n=i.hold?.items??[],o=new Set(n.map(u=>u.label)),r=Ga(i,t,n),s=wt(i.gaQty,n),a=n.reduce((u,h)=>u+i.paidPrice(h.categoryKey,h.tierId,h.unitPrice,h.label)*(h.quantity??1),0),l=n.reduce((u,h)=>u+(h.quantity??1),0),c=e.filter(u=>!o.has(u.label)),d=c.reduce((u,h)=>u+i.paidPrice(h.categoryKey,h.tierId??null,h.price,h.label)*(h.quantity??1),0)+r+a,p=c.reduce((u,h)=>u+(h.quantity??1),0)+s+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:n,heldLabels:o,heldCount:l,total:d,count:p}}function Co(i,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:i.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function Ao(i,e){let t=e.tiers?.length?e.tiers.map(n=>i.paidPrice(e.key,n.id??null,n.price)):e.price==null?[]:[i.paidPrice(e.key,null,e.price)];if(e.key)for(let n of i.pricesByChannel.values())for(let o of n)o.categoryKey===e.key&&t.push(o.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var an="seatlayer_";function pm(){let i=globalThis;return i.document?.modelContext??i.navigator?.modelContext??null}function Ve(i,e){return e?{ok:!1,reason:i,message:e}:{ok:!1,reason:i}}function hm(i){return Array.isArray(i)?i.filter(e=>typeof e=="string"&&!!e):[]}function um(i,e){let t=i.event();if(!t)return Ve("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits();return{ok:!0,event:t,selection:{max:n.max,...n.required!=null?{required:n.required}:{}},categories:i.categories(),zones:i.zones(),hasPremiumSeats:i.hasPremiumSeats(),holdsAllowed:e}}function Pc(i,e){let t=o=>!!o&&o.toLowerCase()===e.toLowerCase(),n=i.find(o=>t(o.key??o.id))??i.find(o=>t(o.label));return n?.key??n?.id??null}function Mc(i,e){let t=e.map(n=>i.describeSeat(n.id));return{seatIds:e.map(n=>n.id),labels:e.map(n=>n.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((n,o)=>t[o]?.seat||n.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((n,o)=>n+o.price,0)}}function mm(i,e,t){let n=new Map;for(let r of e){let s=n.get(r.rowKey);s?s.push(r):n.set(r.rowKey,[r])}let o=[];for(let r of n.values()){let s=[...r].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=s.length;l++)if(l===s.length||s[l].index!==s[l-1].index+1||s[l].categoryKey!==s[l-1].categoryKey){for(let d=a;d+t<=l;d+=t)o.push(Mc(i,s.slice(d,d+t)));a=l}}return o}function fm(i,e,t){let n=new Map;for(let r of e){let s=n.get(r.sectionKey);s?s.push(r):n.set(r.sectionKey,[r])}let o=[];for(let r of n.values()){if(r.length<t)continue;let s=[...r].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);o.push(Mc(i,s.slice(0,t)))}return o}function gm(i,e){if(!i.event())return Ve("not_loaded","The seat map has not finished loading.");let n=i.selectionLimits(),o=Math.floor(Number(e.count));if(!Number.isInteger(o)||o<1||o>n.max)return Ve("bad_count",`count must be a whole number between 1 and ${n.max}.`);let r=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,s=e.together===void 0?!0:!!e.together,a=typeof e.max_price=="number"&&Number.isFinite(e.max_price)?e.max_price:null,l=typeof e.category=="string"&&e.category?e.category:null,c=typeof e.zone=="string"&&e.zone?e.zone:null,d=l?Pc(i.categories(),l):null;if(l&&!d)return Ve("no_match",`No ticket type called "${l}".`);if(d&&i.categories().find(g=>g.key===d)?.available===0)return Ve("sold_out",`"${l}" is sold out.`);let p=c?Pc(i.zones(),c):null;if(c&&!p)return Ve("no_match",`No zone called "${c}".`);let u=i.seats().filter(g=>g.available);if(!u.length)return Ve("sold_out");let h=u.filter(g=>(!d||g.categoryKey===d)&&(!p||g.zoneId===p)&&(a==null||g.price<=a));if(!h.length)return Ve("no_match");let b=s?mm(i,h,o):fm(i,h,o);return b.length?(b.sort((g,T)=>T.unitPrice!==g.unitPrice?T.unitPrice-g.unitPrice:g.row.localeCompare(T.row)||g.labels[0].localeCompare(T.labels[0])),{ok:!0,groups:b.slice(0,r),searched:{count:o,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...p?{zone:p}:{},together:s}}}):Ve(s?"not_enough_together":"no_match")}function Lc(i){return{ok:!0,...i.selection()}}function bm(i,e){let t=i.event();if(!t)return Ve("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return Ve("event_closed","Sales are closed for this event.");let n=hm(e.seat_ids);return n.length?(i.clearSelection(),i.selectObjects(n),Lc(i)):Ve("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function ym(i,e){let t=async o=>{try{return await o()}catch(r){return Ve("error",r instanceof Error?r.message:String(r))}},n=[{name:`${an}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(()=>um(i,e))},{name:`${an}find_seats`,title:"Find available seats",description:"Search the seat map for groups of available seats. Read-only: it never selects, holds or reserves anything. Returns candidate groups with their seat ids, prices and location.",inputSchema:{type:"object",properties:{count:{type:"integer",minimum:1,description:"How many seats are needed."},max_price:{type:"number",description:"Highest acceptable price per seat."},category:{type:"string",description:"Ticket type key or label to restrict the search to."},zone:{type:"string",description:"Zone id or label to restrict the search to."},together:{type:"boolean",description:"Require the seats to be side by side in one row (default true)."},limit:{type:"integer",minimum:1,maximum:20,description:"How many candidate groups to return (default 5)."}},required:["count"],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:o=>t(()=>gm(i,o))},{name:`${an}select_seats`,title:"Select seats on the map",description:"Replace the current selection with the given seats, exactly as tapping them would. The buyer sees the seats light up and the basket update. No reservation is made.",inputSchema:{type:"object",properties:{seat_ids:{type:"array",items:{type:"string"},description:"Seat ids or labels, e.g. from find_seats."}},required:["seat_ids"],additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:o=>t(()=>bm(i,o))},{name:`${an}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(()=>Lc(i))}];return e&&n.push({name:`${an}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>i.hold())}),n}async function Hc(i,e={}){let t=pm();if(!t||typeof t.registerTool!="function")return null;let n=new AbortController,o=ym(i,!!e.holds),r=[],s=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of o)await t.registerTool(a,{signal:n.signal,...s?{exposedTo:s}:{}}),r.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return r.length?{names:r,dispose:()=>{if(n.abort(),typeof t.unregisterTool=="function")for(let a of r)try{t.unregisterTool(a)}catch{}}}:null}async function Rc(i){let e=i.opts.webMcp;if(!e||i.destroyed)return;let t=typeof e=="object"&&!!e.holds,n=typeof e=="object"?e.exposedTo:void 0;try{i.webMcp=await Hc(Or(i,t),{holds:t,exposedTo:n}),i.destroyed&&Ir(i)}catch(o){console.warn("seatmap: WebMCP registration failed",o)}}function Ir(i){i.webMcp?.dispose(),i.webMcp=null}function Or(i,e){let t=(n,o)=>{if(Number.isInteger(n.logicalSeatIndex))return n.logicalSeatIndex;let r=n.id.lastIndexOf(":"),s=r<0?NaN:Number(n.id.slice(r+1));return Number.isFinite(s)?s:o};return{event:()=>{let n=i.renderInfo;return n?{name:n.eventName??"",venue:n.venue??null,startsAt:n.startsAt??null,timezone:n.timezone??null,currency:i.currency,salesClosed:i.salesClosed}:null},selectionLimits:()=>({max:i.maxTickets,required:i.exactTickets}),categories:()=>{let n=i.controller.categoryAvailability();return(i.controller.doc?.categories??[]).filter(o=>!o.notForSale).map(o=>{let r=Ao(i,o),s=Co(i,o);return{key:o.key,label:o.label??o.key,...s===void 0?{}:{price:s},...r&&r.min!==r.max?{priceRange:r}:{},available:n[o.key]??0}})},zones:()=>i.controller.getBestAvailableZones(),hasPremiumSeats:()=>i.controller.hasPremiumSeats(),seats:()=>{let n=i.controller.getActiveFloorId(),o=[];return i.allSeats().forEach((r,s)=>{if(r.floorId&&n&&r.floorId!==n)return;let a=i.controller.getStatus(r.id)??"free",l=i.controller.doc?.categories.find(d=>d.key===r.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;o.push({id:r.id,label:r.label,rowKey:r.logicalRowId??r.rowId,sectionKey:r.sectionId??r.rowId,index:t(r,s),categoryKey:r.categoryKey,price:i.paidPrice(r.categoryKey,l?.tiers?.[0]?.id??null,c,r.label),...r.zoneId?{zoneId:r.zoneId}:{},available:a==="free"&&!l?.notForSale})}),o},describeSeat:n=>{let o=i.controller.seatDetails(n);return o?{section:o.sectionLabel??"",row:fe(o)??"",seat:o.seatNumber??o.label,category:o.categoryLabel??o.categoryKey}:null},selection:()=>{let{freshSeats:n,total:o,count:r}=Eo(i);return{seats:n.map(s=>({id:s.id,label:s.label,section:s.sectionLabel??"",row:fe(s)??"",seat:s.seatNumber??s.label,category:s.categoryKey,price:i.paidPrice(s.categoryKey,s.tierId??null,s.price,s.label)})),count:r,total:o,currency:i.currency,hold:i.hold?{id:i.hold.holdId,expiresAt:i.hold.expiresAt}:null,validity:i.getSelectionValidity()}},clearSelection:()=>i.clearSelection(),selectObjects:n=>{i.selectObjects(n)},hold:()=>e?vm(i):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function vm(i){if(i.salesClosed)return{ok:!1,reason:"event_closed"};if(!i.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=i.controller.getSelectionValidity(i.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await i.handleCta(),i.hold?{ok:!0,hold:{id:i.hold.holdId,expiresAt:i.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function Ic(i,e){if(e.objectType!=="seat"&&e.objectType!=="booth")return null;let t=i.seatByLabel(e.label),n=t?i.toSeat(t).tiers:void 0;return n&&n.length>1?n:null}async function Oc(i,e,t,n){let o=i.currentHold(),r=o?.items??[],s=r.find(c=>c.label===e);if(!o||!s||s.tierId===t)return null;let a=r.map(c=>({label:c.label,tierId:c.label===e?t:c.tierId,...c.quantity!=null?{quantity:c.quantity}:{}})),l=await i.api.hold(i.key,a,n,o.holdId);return i.setHold({holdId:l.holdId,labels:a.map(c=>c.label),expiresAt:l.expiresAt,items:l.items}),i.currentHold()}function _r(i){return{renderingTimeMillis:i.ms,performanceProfile:i.performanceProfile,seatCount:i.seatCount,objectCount:i.objectCount,sectionCount:i.sectionCount,view:i.view,eventKey:i.eventKey,chartName:i.chartName,floorCount:i.floorCount,transport:i.transport,load:i.load,metricScope:i.metricScope,operationalTelemetryReporter:"sdk"}}function _c(i,e){Qe({apiBase:i.apiBase,event:i.eventKey,scope:i.metricScope,surface:i.surface,outcome:"success",ms:i.ms,performanceProfile:i.performanceProfile,seats:i.seatCount,floors:i.floorCount,view:i.view,load:i.load,transport:i.transport,revealWaitMs:i.revealWaitMs,handoverMs:i.handoverMs}),e("chart_rendered",_r(i))}var Nc=require("@seatlayer/core/core/seatConfidence");function Pe(i){return String(i??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Dc(i){let e=(0,Nc.seatConfidenceDisclosure)(i.seat.confidenceEvidence),t=i.seat.confidenceEvidence,n=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${Pe(c)}</li>`).join("")}</ul>`:"",o=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${Pe(e.modeledTarget)}</dd></div>`:"",r=t?`<div><dt>Evidence ID</dt><dd>${Pe(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${Pe(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${Pe(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${Pe(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${Pe(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",s=_n(i.seat.commercial).join(" \xB7 ")||i.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${Pe(s)}</dd></div>`+(i.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${Pe(i.seat.commercial.note)}</dd></div>`:""),l=i.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${Pe(i.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${Pe(e.headline)}</strong><span>${Pe(e.coverage)} \xB7 ${Pe(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${Pe(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${Pe(e.reality)}</dd></div><div><dt>Source</dt><dd>${Pe(e.provenance)}</dd></div>`+a+o+r+`</dl>${n}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function Bc(i){return i?i.closest("[data-report]")?"report":i.closest("[data-close]")||i.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function Po(i,e,t){let n=i?.querySelector("[data-report]"),o=i?.querySelector("[data-report-status]");n&&(n.disabled=e!=="failed",n.textContent=e==="received"?"Report received":"Report this view"),o&&(o.setAttribute("role",e==="failed"?"alert":"status"),o.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function Nr(i,e,t=null){let n=i.view3dEl;if(!n)return;ln(i,!1);let o=e.confidenceEvidence,r=i.controller.seatDetails(e.id),s=document.createElement("div");s.className="sl-view3d-passport-shell",s.innerHTML=Dc({seat:e,title:r?.displayLabel??e.displayLabel??e.label,restrictionFallback:i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof i.api.reportViewEvidence=="function"});let a=[...new Set([...n.children,...[...i.els.map.children].filter(u=>u!==n)])].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");n.appendChild(s),n.classList.add("has-passport"),i.view3dPassportEl=s;let c=s.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(),ln(i);return}if(u.key!=="Tab")return;let h=d();if(!h.length)return;let b=h[0],g=h[h.length-1];u.shiftKey&&document.activeElement===b?(u.preventDefault(),g.focus()):!u.shiftKey&&document.activeElement===g&&(u.preventDefault(),b.focus())};window.addEventListener("keydown",p,!0),i.view3dPassportCleanup=()=>{window.removeEventListener("keydown",p,!0);for(let g of l)g.element.inert=g.inert,g.ariaHidden===null?g.element.removeAttribute("aria-hidden"):g.element.setAttribute("aria-hidden",g.ariaHidden);let u=t?.isConnected?t:i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareEl?.querySelector("[data-passport-seat]")??null,h=u?.closest(".sl-confirm,.sl-view3d-compare");h?.isConnected&&(h.inert=!1,h.removeAttribute("aria-hidden")),s.remove(),n.classList.remove("has-passport"),i.view3dPassportEl===s&&(i.view3dPassportEl=null);let b=u??i.view3dCompareEl?.querySelector("[data-passport-seat]")??i.confirmEl?.querySelector(".sl-confirm-confidence")??i.view3dCompareChip.mainButton();(t?.isConnected?t:b)?.focus()},s.addEventListener("click",u=>{let h=Bc(u.target instanceof HTMLElement?u.target:null);h==="close"&&ln(i),h==="report"&&wm(i,e)}),requestAnimationFrame(()=>d()[0]?.focus()),i.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:o?.evidenceId??null,eventConfigurationId:o?.eventConfigurationId??null,modelLevel:o?.modelLevel??"unverified",realityLevel:o?.realityLevel??"none"})}async function wm(i,e){if(i.api.reportViewEvidence){Po(i.view3dPassportEl,"sending");try{let t=await i.api.reportViewEvidence(i.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});i.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),Po(i.view3dPassportEl,"received",t.report.id)}catch{Po(i.view3dPassportEl,"failed")}}}function ln(i,e=!0){let t=i.view3dPassportCleanup;if(i.view3dPassportCleanup=null,!t){i.view3dPassportEl?.remove(),i.view3dPassportEl=null,i.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function Fc(i){let e=i.view3dEl;if(!e||i.view3dCompareSeatIds.length<2)return;Gt(i,!1);let t=i.view3dCompareSeatIds.map(h=>i.view3dComparisonSnapshot(h)).filter(h=>!!h);if(t.length<2){i.clearView3dComparison();return}let n=h=>L(h),o=t.some(h=>!!h.price),r=document.createElement("div");r.className="sl-view3d-compare-shell";let s=t.map((h,b)=>`<article><span>Seat ${b===0?"A":"B"}</span><strong>${n(h.label)}</strong><small>Section ${n(h.section)} \xB7 Row ${n(h.row)}</small><dl>`+(o?`<div><dt>Current price</dt><dd>${n(h.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${n(h.category)}</dd></div><div><dt>Availability</dt><dd>${n(h.availability)}</dd></div><div><dt>View source</dt><dd>${n(h.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${n(h.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${n(h.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${n(h.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${n(h.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${n(h.seat.id)}">Passport</button><button type="button" data-view-seat="${n(h.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${n(h.seat.id)}"${h.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");r.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${o?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${s}</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(r),e.classList.add("has-comparison"),i.view3dCompareEl=r;let d=r.querySelector(".sl-view3d-compare"),p=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=h=>{if(h.key==="Escape"){h.preventDefault(),Gt(i);return}if(h.key!=="Tab")return;let b=p();if(!b.length)return;let g=b[0],T=b[b.length-1];h.shiftKey&&document.activeElement===g?(h.preventDefault(),T.focus()):!h.shiftKey&&document.activeElement===T&&(h.preventDefault(),g.focus())};window.addEventListener("keydown",u),i.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);r.remove(),e.classList.remove("has-comparison"),i.view3dCompareEl===r&&(i.view3dCompareEl=null),a?.isConnected?a.focus():i.view3dCompareChip.mainButton()?.focus()},r.querySelector("[data-close]")?.addEventListener("click",()=>Gt(i)),r.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{let b=h.dataset.passportSeat,g=b?i.allSeats().find(T=>T.id===b):void 0;g&&Nr(i,g,h)})),r.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{let b=h.dataset.viewSeat;Gt(i,!1),b&&i.view3dHandle?.flyToSeat(b)})),r.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{let b=h.dataset.selectSeat;b&&xm(i,b)})),requestAnimationFrame(()=>p()[0]?.focus()),i.emit3dAnalytics("3d_comparison_opened",{seatIds:i.view3dCompareSeatIds.slice()})}function Gt(i,e=!0){let t=i.view3dCompareCleanup;if(i.view3dCompareCleanup=null,!t){i.view3dCompareEl?.remove(),i.view3dCompareEl=null,i.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||i.root?.focus({preventScroll:!0})}function xm(i,e){if(i.salesClosed){i.toast(i.closedWords?.().toast??i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=i.allSeats().find(o=>o.id===e);if(!t)return;if(Gt(i,!1),!i.controller.select([e]).length){i.syncSelectionTo3d(),i.toast(i.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}i.syncSelectionTo3d(),i.showConfirm(t),i.emit3dAnalytics("3d_comparison_selected",{seatId:e})}var zc=require("@seatlayer/core/view3d/crossfade/panorama");var Dr=require("@seatlayer/core");var km=900,Sm=450;function Tm(i){switch(i){case"seat":return y("picker.stopYourSeat","Your seat");case"row":return y("picker.stopYourRow","Your row");case"section":return y("picker.stopYourSection","Your section");default:return y("picker.stopWholeVenue","Whole venue")}}function Vc(i,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let n=y("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",n),t.title=n,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let o=document.createElement("div");o.className="sl-view3d-stop",o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),i.append(t,o);let r=null,s=null;return{onStopChange(a){if(r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null),!a){o.classList.remove("is-shown"),o.textContent="",s=setTimeout(()=>{s=null,i.classList.remove("is-seat-view")},Sm);return}i.classList.add("is-seat-view"),o.textContent=Tm(a),o.classList.add("is-shown"),r=setTimeout(()=>{r=null,o.classList.remove("is-shown")},km)},dispose(){r&&(clearTimeout(r),r=null),s&&(clearTimeout(s),s=null),t.remove(),o.remove(),i.classList.remove("is-seat-view")}}}var Em=44,Cm=92;function $c(i,e,t,n={}){let o=i?.sectionLabel,r=fe(i),s=Am(i,e),a=[o,r?(0,Dr.t)("picker.rowLabel",{label:r}):null,s?(0,Dr.t)("picker.seatLabel",{label:s}):null].filter(Boolean).join(" \xB7 "),l=n.maxChars??(n.narrow?Em:Cm);for(let c of[t,n.shortTail??t,null]){let d=[a,c].filter(Boolean).join(" \xB7 ");if(d.length<=l||c==null)return d}return a}function Am(i,e){if(i?.seatNumber)return i.seatNumber;let t=i?.displayLabel??e,n=o=>{!o||!t.startsWith(o)||t.length<=o.length||(t=t.slice(o.length).replace(/^[\s·\-\/_]+/,""))};return n(i?.sectionLabel),n(fe(i)),t}var jc=require("@seatlayer/core/core/seatConfidence");var Pm=220;function Mm(i,e,t){let n=null,o=null,r=null;return(s,a)=>{i()?.presentSeatHover?.(s,a,e),r=a,s!==o&&(o=s,n&&(clearTimeout(n),n=null),!(!s||!t)&&(n=setTimeout(()=>{if(n=null,o!==s)return;let c=t()?.(s)??null;c&&o===s&&i()?.presentSeatHover?.(s,r,e,c)},Pm)))}}function Kc(i){return i.buyerView}function Gc(i,e,t){if(e==="map"){i.exit3d();return}let n=t?.flyToSeatId;if(i.buyerView==="venue3d"){n?(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:n}),i.view3dHandle?.flyToSeat(n)):t?.resetView&&i.view3dHandle?.focusOverview();return}i.enter3d(n)}function Uc(i,e){switch(i.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return i.priceBandKeys!=null&&!i.priceBandKeys.has(e.categoryKey)||i.controller.accessibilityFilterDims?.(e)||i.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}function qc(i){if(!i.view3dHandle)return;let e=i.allSeats().map(t=>({seatId:t.id,state:i.seatState3dFor(t)}));i.view3dHandle.setAvailability(e)}function Wc(i){i.view3dHandle&&i.view3dHandle.setSelection(i.controller.getSelection().map(e=>e.id))}async function Yc(i,e){let t=i.allSeats().find(n=>n.id===e);if(!t)return null;if(t.viewUrl)try{let n=t.viewMeta?.previewUrl,o=!!n&&n!==t.viewUrl,r=o?await i.buyerAssetUrls.resolve(n):null,s=o?t.viewUrl:await i.buyerAssetUrls.resolve(t.viewUrl);return!s||o&&!r?null:{url:s,...r?{previewUrl:r}:{},...o?{resolveUrl:a=>i.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(n){return i.opts.onError?.(n),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:i.tf("picker.chartDerivedModel","Chart-derived model")}}function Xc(i,e){if(i.salesClosed){i.toast(i.closedWords?.().toast??i.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),i.syncSelectionTo3d();return}let t=i.allSeats().find(a=>a.id===e);if(!t)return;let n=i.controller.tableSelection(e);if(i.committedSelection().some(a=>n?a.label===n.label:a.id===e)){i.controller.deselect([e]),i.dismissConfirm(),i.syncSelectionTo3d();return}let r=i.controller.getStatus(t.id);if(r==="held"||r==="booked"||r==="not_for_sale"){i.syncSelectionTo3d();return}if(!i.controller.select([e]).length){i.syncSelectionTo3d(),i.dismissConfirm();return}if(i.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),i.flashPickedSeat(e),n){i.showTableDialog(n,!1),i.syncSelectionTo3d();return}i.opts.confirmSelection!==!1?i.showConfirm(t):i.syncTray(),i.syncSelectionTo3d()}function Qc(i,e){let t=i.allSeats().find(n=>n.id===e);return $c(i.controller.seatDetails(e),t?.displayLabel??t?.label??e,i.tf("picker.viewFromYourSeat","view from your seat"),{narrow:i.root?.dataset.layout==="narrow",shortTail:i.tf("picker.fromYourSeat","from your seat")})}function Zc(i,e){if(i.buyerView!=="venue3d")return;let t=i.view3dCompareSeatIds;t.includes(e.id)||(i.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),i.confirmSeat?.id===e.id&&(i.controller.deselect([e.id]),i.dismissConfirm(),i.syncSelectionTo3d(),i.syncTray()),i.view3dCompareChip.sync(),i.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:i.view3dCompareSeatIds.length}),i.view3dCompareSeatIds.length>1?i.openView3dComparison():i.toast(i.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}function Jc(i){i.closeView3dComparison(!1),i.view3dCompareSeatIds=[],i.view3dCompareChip.remove(),i.emit3dAnalytics("3d_comparison_cleared")}function ed(i,e){let t=i.allSeats().find(b=>b.id===e);if(!t)return null;let n=i.controller.seatDetails(t.id),o=i.controller.doc?.categories.find(b=>b.key===t.categoryKey),r=n?.price??(o?.tiers?.length?o.tiers[0].price:o?.price),s=r!=null?i.paidPrice(t.categoryKey,n?.tierId??o?.tiers?.[0]?.id??null,r,t.label):void 0,a=i.controller.getStatus(t.id),l=a==="held"?i.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?i.tf("picker.sold","Sold"):a==="not_for_sale"?i.tf("picker.notForSale","Not for sale"):i.tf("picker.available","Available"),c=t.viewUrl?(0,zc.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}:{}}):i.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=_n(t.commercial).join(" \xB7 ")||i.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),p=ia({...t.accessibility?.length?{accessibility:t.accessibility}:{},...n?.wheelchairSpaceType?{wheelchairSpaceType:n.wheelchairSpaceType}:{}}),u=p.length?`${p.join(" \xB7 ")} \xB7 metadata, not access certification`:i.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),h=(0,jc.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:n?.displayLabel??t.displayLabel??t.label,section:n?.sectionLabel??t.sectionId??"\u2014",row:fe(n)??n?.rowLabel??"\u2014",category:n?.categoryLabel??o?.label??t.categoryKey,price:i.suppressPricing||s==null?"":i.money(s),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:u,confidence:h}}async function td(i,e){if(i.view3dEl||!i.canOffer3d()||!i.els.map)return;let t=i.controller.doc;if(!t)return;i.buyerView="venue3d",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),i.root?.setAttribute("data-view3d","on"),i.dismissConfirm(),i.syncProjection(),i.syncTray();let n=document.createElement("div");n.className="sl-view3d sl-mo-zoom",n.setAttribute("role","group"),n.setAttribute("aria-label",i.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let o=document.createElement("button");o.type="button",o.className="sl-view3d-back",o.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${i.tf("picker.backToMap","Back to map")}</span>`;let r=o.querySelector("span"),s=c=>{i.view3dTargetSeatId=c;let d=!!c;n.classList.toggle("is-seat-focused",d),i.root&&(i.root.dataset.view3dSeat=d?"on":"off");let p=d?i.tf("picker.backToVenue","Back to venue"):i.tf("picker.backToMap","Back to map");r&&(r.textContent=p),o.setAttribute("aria-label",p)};if(o.addEventListener("click",()=>{if(i.view3dTargetSeatId&&i.view3dHandle){i.view3dHandle.focusOverview();return}i.exit3d()}),i.regions["top-left"]?.prepend(o),i.view3dBack=o,i.publish3dTopInset(),Tc(i.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6";let d=i.tf("picker.fullScreen","Full screen");c.setAttribute("aria-label",d),c.title=d,c.setAttribute("aria-pressed",String(!!document.fullscreenElement||i.fsFallback||i.framedFs)),c.addEventListener("click",()=>i.toggleFullscreen()),n.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=i.tf("picker.loading3d","Building the 3D venue\u2026"),n.appendChild(a),i.els.map.appendChild(n),i.view3dEl=n,i.view3dCompareChip.sync(),requestAnimationFrame(()=>{n.style.opacity="1"});let l=++i.view3dGen;try{let c=i.allSeats(),[d,p]=await Promise.all([Xi(),i.controller.loadEventConfiguration()]),u=p?await no(p,v=>i.buyerAssetUrls.resolve(v)):null,h=t.theme?.venue3d?.shellAssetUrl,b=await oo(h,v=>i.buyerAssetUrls.resolve(v));if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let g={doc:t,seats:c,...u?{eventConfigurationId:u.id,eventConfiguration:u}:{},...b?{registeredShellGlb:b}:{}};a.textContent=i.tf("picker.building3d","Building venue geometry\u2026");let T=await d.prepareVenue3D(g);if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;let w=d.mountVenue3D(n,{...g,prepared:T},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:Nt(),navLabels:Pn(),seatViewActionLabel:v=>i.allSeats().find(M=>M.id===v)?.viewUrl?i.tf("picker.openAuthored360","Open venue 360\xB0"):i.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:v=>i.seatViewCaption(v),onSeatViewStopChange:v=>i.view3dSeatViewChrome?.onStopChange(v),onSeatPick:v=>i.onView3dSeatPick(v),onSeatInspect:v=>i.onView3dSeatPick(v),onSeatHover:Mm(()=>i.controller.getRenderer(),n,()=>{let v=w.captureSeatView;return v?M=>v.call(w,M):void 0}),onSectionFocusChange:v=>{let M=n.querySelector('select[data-locator="section"]'),F=v??"";!M||M.value===F||(M.value=F,M.dispatchEvent(new Event("change")))},onViewTargetChange:v=>{n.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!v),s(v),i.opts.onBuyerViewChange?.({view:"venue3d",...v?{seatId:v}:{}})},...i.seatViewEnabled()?{getSeatView:v=>new Promise((M,F)=>{let X=()=>{i.seatViewFor3d(v).then(O=>{O?M(O):F(new Error("seat_view_unavailable"))})},f=globalThis.requestIdleCallback;typeof f=="function"?f(X,{timeout:1500}):setTimeout(X,50)})}:{},onAnalytics:(v,M)=>i.emit3dAnalytics(v,M)});i.view3dHandle=w,i.view3dSeatViewChrome=Vc(n,{handle:()=>i.view3dHandle}),requestAnimationFrame(()=>a.remove()),i.pushAvailabilityTo3d(),i.syncSelectionTo3d(),i.view3dNav=Sc(i.regions["bottom-left"]??n,w),e&&w.flyToSeat(e)}catch(c){if(l!==i.view3dGen||i.buyerView!=="venue3d"||i.view3dEl!==n)return;i.opts.onError?.(c),i.toast(i.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),i.exit3d()}}function id(i){let e=i.regions["top-left"];if(!i.root||!e)return;let t=()=>{!i.root||i.root.dataset.view3d!=="on"||i.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}function nd(i){if(i.buyerView!=="venue3d"&&!i.view3dEl)return;i.view3dGen++,i.buyerView="map",i.view3dTargetSeatId=null,i.opts.onBuyerViewChange?.({view:"map"}),i.root?.removeAttribute("data-view3d"),i.closeSeatConfidencePassport(!1),i.closeView3dComparison(!1),i.view3dCompareChip.remove(),i.view3dSeatViewChrome?.dispose(),i.view3dSeatViewChrome=null,i.view3dBack?.remove(),i.view3dBack=null,i.view3dNav?.remove(),i.view3dNav=null,i.root?.removeAttribute("data-view3d-seat"),i.root?.style.removeProperty("--sl-3d-top-inset");try{i.view3dHandle?.dispose()}catch{}i.view3dHandle=null;let e=i.view3dEl;i.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),i.syncProjection(),i.syncTray();let t=i.view3dReturnSeat;i.view3dReturnSeat=null,t&&i.committedSelection().some(n=>n.id===t.id)&&i.opts.confirmSelection!==!1&&i.showConfirm(t)}var rd=require("@seatlayer/core");var cn=require("@seatlayer/core");function od(i){return Array.isArray(i)?i.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function Mo(i,e,t=!1){let n=i.violations[0];return n==="numberOfPlacesToSelect"?i.remaining>0?(0,cn.t)("picker.selectExactMore",{count:i.remaining}):(0,cn.t)("picker.selectExactCount",{count:i.required}):n==="minimumSelectedPlaces"?(0,cn.t)("picker.selectMinimumMore",{count:i.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):n==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,cn.t)("picker.orphanHint")}var Br=6e4,sd=5*6e4,Hm=String(Math.round(sd/6e4));function ad(i){let e=document.createElement("div");e.className="sl-extend",e.dataset.dock="map",e.setAttribute("role","status"),e.innerHTML='<button type="button" class="sl-extend-btn" data-ref="extendBtn"></button><button type="button" class="sl-extend-x" data-ref="extendDismiss" aria-label=""><svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true" focusable="false"><path d="M3.5 3.5 12.5 12.5M12.5 3.5 3.5 12.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg></button>',(i.regions["bottom-center"]??i.els.map).appendChild(e),i.extendEl=e,i.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),i.els.extendDismiss=e.querySelector('[data-ref="extendDismiss"]'),i.els.extendBtn.textContent=ld(i),i.els.extendDismiss.setAttribute("aria-label",i.tf("picker.close","Close")),i.els.extendBtn.addEventListener("click",()=>{i.handleExtend()}),i.els.extendDismiss.addEventListener("click",()=>{i.extendDismissed=!0,i.setExtendPrompt(!1,0)})}function ld(i){return i.tf("picker.addMinutes","+{count} min").replace("{count}",Hm)}function cd(i){let e=i.hold?.items??[],t=new Set(e.map(o=>o.label));return i.committedSelection().filter(o=>!t.has(o.label)).reduce((o,r)=>o+(r.quantity??1),0)+wt(i.gaQty,i.hold?.items??[])}function dd(i){return(i.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}function pd(i){let e=new Set((i.hold?.items??[]).map(n=>n.label)),t=i.committedSelection().filter(n=>!e.has(n.label)).reduce((n,o)=>n+(o.quantity??1),0);return i.heldTicketCount()+t+wt(i.gaQty,i.hold?.items??[])}function hd(i){let e=new Set((i.hold?.items??[]).map(o=>o.label)),t=i.committedSelection().filter(o=>e.has(o.label)).reduce((o,r)=>o+(r.quantity??1),0),n=Math.max(0,i.maxTickets-i.heldTicketCount()-wt(i.gaQty,i.hold?.items??[]));i.controller.setMaxSelection(t+n)}function ud(i,e=i.lastTrayCount,t=i.pendingSelectionCount()){let n=i.els.cta;if(!n)return;if(delete n.dataset.act,i.salesClosed){n.disabled=!0,n.textContent=i.closedWords?.().cta??i.tf("picker.salesClosedCta","Sales closed");return}if(i.ctaPhase==="holding"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(i.ctaPhase==="checkout"){n.disabled=!0,n.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${i.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let o=!i.hold&&i.performanceGroup?.selectionMode==="per_performance"?i.performanceGroup.submissionState?.():null;if(o&&!o.ready){n.disabled=!0,n.textContent=i.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(o.complete)).replace("{total}",String(o.total));return}let r=i.controller.getSelectionValidity(e);if(r&&!r.isValid){n.disabled=!0,n.textContent=Mo(r,(s,a)=>i.tf(s,a),!0);return}if(!e&&i.root?.dataset.layout==="narrow"&&!i.performanceGroup&&!i.hold&&!i.bestAvailableSoldOut){n.disabled=!1,n.dataset.act="find",n.textContent=i.tf("picker.findBestSeats","Find best seats");return}n.disabled=e===0,n.textContent=i.hold?t?(0,rd.t)("picker.secureMoreAndCheckout",{count:t}):i.tf("picker.continueToCheckout","Continue to checkout"):e?i.performanceGroup?i.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(i.performanceGroup.performanceCount)):i.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):i.tf("picker.selectSeats","Select seats")}function md(i,e){i.ctaPhase=e,i.syncCta()}async function fd(i,e,t){i.setCtaPhase("checkout");try{await i.checkoutHandoff(e,t)}finally{i.ctaPhase==="checkout"&&!i.bookedShown&&i.setCtaPhase("idle")}}function gd(i){return`@seatlayer/hold/v1/${encodeURIComponent(i.apiBase)}/${encodeURIComponent(i.opts.event)}`}function bd(i){if(i.opts.initialHoldId)return i.opts.initialHoldId;if(i.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(i.holdStorageKey())}catch{return null}}function yd(i,e){if(!(i.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(i.holdStorageKey(),e.holdId)}catch{}}function vd(i){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(i.holdStorageKey())}catch{}}async function wd(i,e,t=!1){try{let n=await i.controller.resumeHold(e);if(!n||i.destroyed)return null;let o={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items};return i.hold=o,i.handedOff=!0,i.bookedShown=!1,i.ctaPhase="idle",i.startHoldTimer(o.expiresAt),i.rememberHold(o),i.syncTray(),i.emitHoldChange(),i.opts.onHoldRestored?.(o,o.seats??[],i.buildHandoff(o)),o}catch(n){let o=n?.status;if(o===404||o===409)i.forgetHold();else if(o===401&&n?.code==="buyer_access_invalid")i.forgetHold(),i.toast(i.tf("picker.savedSeatsNotRestored","Your earlier seats could not be restored. Please choose again."),"warning");else if(i.opts.onError?.(n),t)throw n;return null}}async function xd(i){let e=i.rememberedHoldId();e&&await i.resumeHoldFromServer(e,!0)}function kd(i,e){i.stopHoldTimer(),i.holdExpiresAt=e,i.extendDismissed=!1,i.extendUsed=!1,i.hold&&i.rememberHold(i.hold);let t=i.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${i.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let n=t.querySelector('[data-ref="holdTime"]'),o=()=>{let r=Math.max(0,i.holdExpiresAt-Date.now());n&&(n.textContent=fa(r)),t.classList.add("on"),t.classList.toggle("is-expiring",r>0&&r<=Br),i.setExtendPrompt(r>0&&r<=Br,r),(r<=0||!i.controller.currentHold())&&i.stopHoldTimer()};i.holdTimer=setInterval(o,500),o()}function Sd(i){i.holdTimer&&clearInterval(i.holdTimer),i.holdTimer=null,i.els.hold?.classList.remove("on","is-expiring"),i.setExtendPrompt(!1,0)}function Td(i,e,t){if(!i.extendEl)return;let n=e&&t>0&&i.root?.dataset.layout!=="narrow"&&!i.extendDismissed&&!i.extendUsed&&!!i.controller.currentHold()&&!i.bookedShown;i.extendEl.classList.toggle("on",n)}function Ed(i){if(!i.holdTimer)return;let e=Math.max(0,i.holdExpiresAt-Date.now());i.setExtendPrompt(e>0&&e<=Br,e)}async function Cd(i){let e=i.els.extendBtn,t=i.controller.currentHold();if(!(!t||!i.api.extend||i.extendUsed)){e.disabled=!0,e.textContent=i.tf("picker.addingEllipsis","Adding\u2026");try{let n=await i.api.extend(i.controller.key,t.holdId,sd);if(i.controller.currentHold()?.holdId!==t.holdId)return;i.controller.setHold({holdId:t.holdId,labels:t.labels,expiresAt:n.expiresAt,items:t.items});let o=i.controller.currentHold();if(!o)return;i.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},i.holdExpiresAt=o.expiresAt,i.extendUsed=!0,i.extendEl?.classList.remove("on"),i.rememberHold(i.hold),i.emitHoldChange(),i.toast(i.tf("picker.moreTimeAdded","More time added. Your seats are still held."),"success")}catch(n){if(n?.reason==="extend_limit"){i.extendUsed=!0,i.setExtendPrompt(!1,0);return}i.opts.onError?.(n),i.toast(i.tf("picker.couldNotAddMoreTime","Couldn't add more time. Please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=ld(i)}}}var Vr=require("@seatlayer/core");function Ad(i){return i?.previousPrice!=null&&i.previousPrice>i.price?i.previousPrice:null}function Pd(i){return Im(i)+(i.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!i.collapsed}">${i.esc(i.moreLabel)}</button>`:"")+Om(i.status)}function Im(i){let{esc:e,money:t}=i;return i.categories.map(n=>{let o=i.priceOf(n),r=i.rangeOf(n),s=i.offerOf(n.key),a=Ad(s),l=i.activeKey===n.key;return`<div class="sl-price-row${i.bandKeys!=null&&!i.bandKeys.has(n.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(n.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(i.titleFor(n,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(i.colorOf(n))}"></span><span class="sl-price-label"><span class="sl-price-name">${e(n.label)}</span>`+(s?.offerName?In(s.offerName,e):"")+"</span>"+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(r!=null?`<span class="sl-price-amt">${r.min===r.max?e(t(r.min)):`${e(t(r.min))}\u2013${e(t(r.max))}`}</span>`:o!=null?`<span class="sl-price-amt">${e(t(o))}</span>`:"")+"</div>"}).join("")}function Om(i){let e=t=>t.replace(/[&<>"']/g,n=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[n]);return`<div class="sl-status-key" aria-label="${e(i.legend)}"><span class="sl-status-item"><i class="sl-status-icon unavailable" aria-hidden="true"></i>${e(i.unavailable)}</span></div>`}function Fr(i){let e=Math.abs(i.scrollLeft),t=e>2,n=e+i.clientWidth<i.scrollWidth-2;return i.dataset.fadeStart=String(t),i.dataset.fadeEnd=String(n),{start:t,end:n}}function Md(i){let{esc:e,money:t}=i;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${i.allActive}" title="${e(i.allWord)}"><span class="sl-rc-t">${e(i.allWord)}</span></button>`+i.categories.map(o=>{let r=i.rangeOf(o),s=i.priceOf(o),a=r?r.min===r.max?t(r.min):`${t(r.min)}+`:s!=null?t(s):null,l=Object.prototype.hasOwnProperty.call(i.left,o.key)&&i.left[o.key]<=0,c=Ad(i.offerOf(o.key)),d=a?`${o.label}: ${a}${l?` (${i.soldOutWord})`:""}`:o.label;return`<button type="button" class="sl-rc" data-cat="${e(o.key)}" aria-pressed="${i.activeKey===o.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(i.colorOf(o))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??o.label)}</span></button>`}).join("")}function Ld(i,e){let t=i.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let n=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(n.length<=5)return n.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let o=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),r=Math.ceil(o.length/4),s=[];for(let a=0;a<o.length;a+=r){let l=o.slice(a,a+r),c=Math.min(...l.map(p=>p.range.min)),d=Math.max(...l.map(p=>p.range.max));s.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 s}function Hd(i){if(i.els.pricesSec?.querySelectorAll(".sl-price-select").forEach(o=>o.remove()),i.priceSelect=null,i.suppressPricing||!i.els.prices||!i.els.pricesSec)return;let e=Ld((i.controller.doc?.categories??[]).filter(o=>!o.notForSale),i.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",i.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let n=document.createElement("option");n.value="all",n.textContent=i.tf("picker.allPrices","All prices"),t.appendChild(n);for(let o of e){let r=document.createElement("option");r.value=o.id,r.textContent=o.label,t.appendChild(r)}i.els.pricesSec.appendChild(t),i.priceSelect=t,t.addEventListener("change",()=>{i.applyPriceBand(e.find(o=>o.id===t.value)?.keys??null)})}function Rd(i,e){if(i.focusedCatKey=null,i.priceBandKeys=e?new Set(e):null,i.priceSelect){let t=e?i.priceSelect.value:"all";i.priceSelect.value!==t&&(i.priceSelect.value=t)}i.controller.setCategoryFilter(e),i.controller.focusCategoryFilter(e),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}function Id(i){return{colorOf:e=>i.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>i.catPriceRange(e),priceOf:e=>i.catPrice(e),offerOf:e=>i.offerPrice(e),money:e=>i.money(e),esc:q}}function Od(i,e,t,n=i.legendDeps()){let o=i.els.railScroll,r=e.length>1;if(i.els.rail?.classList.toggle("has",r),!o)return;o.innerHTML=r?Md({...n,categories:e,left:t,activeKey:i.focusedCatKey,soldOutWord:i.tf("picker.soldOut","Sold out"),allWord:i.tf("picker.allPrices","All prices"),allActive:!i.focusedCatKey&&!i.priceBandKeys}):"";let s=e.map(a=>a.key).join("|");i.lastRailSignature!==s&&(i.lastRailSignature=s,o.scrollLeft=0),o.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){i.applyPriceBand(null);return}i.focusCategory(a.dataset.cat??"")})}),i.railEdgesBound||(i.railEdgesBound=!0,o.addEventListener("scroll",()=>Fr(o),{passive:!0})),requestAnimationFrame(()=>Fr(o))}function _d(i){let e=i.controller.doc;if(!e||!i.els.prices)return;let t=i.controller.categoryAvailability(),n=e.categories.filter(p=>!p.notForSale);i.syncSoldout(n,t);let o=i.legendDeps(),r=i.suppressPricing,s=r?{...o,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:o;r&&(i.els.pricesSec?.querySelector("span")?.replaceChildren(i.tf("picker.seatCategories","Seat categories")),i.els.pricesInfo?.remove()),i.syncPriceRail(n,t,s);let a=5,l=n.length-a,c=l>1&&!i.pricesExpanded,d=c?n.slice(0,a):n;i.els.prices.classList.toggle("sl-expanded",l>1&&i.pricesExpanded),i.els.prices.innerHTML=Pd({...s,categories:d,left:t,collapsed:c,activeKey:i.focusedCatKey,bandKeys:i.priceBandKeys,titleFor:(p,u)=>u?i.tf("picker.showAllSeats","Show all seats"):(0,Vr.t)("picker.showLabelSeatsOnMap",{label:p.label}),moreLabel:l>1?c?r?i.tf("picker.showAllCategories","Show all categories"):(0,Vr.t)("picker.showAllTicketTypes",{count:n.length}):i.tf("picker.showFewer","Show fewer"):null,status:{legend:i.tf("picker.seatStatusLegend","Seat status legend"),unavailable:i.tf("picker.notAvailable","Not available")}}),i.els.prices.querySelectorAll(".sl-price-row").forEach(p=>{p.addEventListener("mouseenter",()=>i.controller.getRenderer()?.setCategoryHighlight?.(p.dataset.cat??null)),p.addEventListener("mouseleave",()=>i.controller.getRenderer()?.setCategoryHighlight?.(null));let u=()=>i.focusCategory(p.dataset.cat??"");p.addEventListener("click",u),p.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),u())})}),i.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{i.pricesExpanded=!i.pricesExpanded,i.syncPrices()})}function Nd(i,e){if(!e)return;let t=i.focusedCatKey===e?null:e;i.focusedCatKey=t,i.priceBandKeys=t?new Set([t]):null;let n=i.els.pricesSec?.querySelector(".sl-price-select");n&&(n.value="all"),i.controller.setCategoryFilter(t?[t]:null),i.controller.focusCategoryFilter(t?[t]:null),i.pushAvailabilityTo3d(),i.syncFloors(),i.syncRung(),i.minimap?.refreshMinimap(),i.syncPrices(),i.lastSection&&i.showSectionCard(i.lastSection)}var Mi=require("@seatlayer/core");function je(i,e,t){let n=(0,Mi.t)(i,t);return n&&n!==i?n:t?e.replace(/\{(\w+)\}/g,(o,r)=>r in t?String(t[r]):o):e}function Nm(i){let e=(0,Mi.tCount)("picker.seatCount",i);return e.includes("picker.seatCount")?`${i} ${i===1?"seat":"seats"}`:e}function Dm(i){try{let e=Intl.ListFormat;if(e)return new e(void 0,{style:"long",type:"conjunction"}).format(i)}catch{}return i.join(", ")}function Bm(i){if(i.length<2)return!1;let e=[...i].sort((t,n)=>t-n);return new Set(e).size!==e.length?!1:e[e.length-1]-e[0]===e.length-1}function Fm(i){let e=i.filter(o=>o.objectType==="ga"),t=i.filter(o=>o.objectType!=="ga"),n=[];if(t.length){let o=Nm(t.length),r=[...new Set(t.map(l=>l.sectionLabel).filter(Boolean))],s=[...new Set(t.map(l=>l.rowLabel).filter(Boolean))],a=t.map(l=>Number(l.seatNumber)).filter(l=>Number.isFinite(l));if(r.length===1&&s.length===1&&a.length===t.length){let l=t.length===1?je("picker.releasedSeatPlace","Section {section}, Row {row}, Seat {seat}",{section:r[0],row:s[0],seat:String(t[0].seatNumber??"")}):Bm(a)?je("picker.releasedSeatRange","Section {section}, Row {row}, Seats {from}\u2013{to}",{section:r[0],row:s[0],from:Math.min(...a),to:Math.max(...a)}):"";n.push(l?je("picker.releasedPair","{first} \xB7 {second}",{first:o,second:l}):je("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:r[0]}))}else r.length===1?n.push(je("picker.releasedInSection","{seats} in Section {section}",{seats:o,section:r[0]})):r.length>1?n.push(je("picker.releasedInSections","{seats} in Sections {sections}",{seats:o,sections:Dm(r)})):n.push(o)}for(let o of e)n.push(je("picker.releasedGa","{quantity} \xD7 {area}",{quantity:o.quantity??1,area:o.label}));return n.length?n.reduce((o,r)=>je("picker.releasedPair","{first} \xB7 {second}",{first:o,second:r})):""}function Dd(i){if(!i)return[];let e=new Map((i.seats??[]).map(o=>[o.label,o])),t=i.items??[];return(t.length?t.map(o=>({label:o.label,objectType:o.objectType,quantity:o.quantity})):[...e.keys()].map(o=>({label:o}))).map(o=>{let r=e.get(o.label);return{label:o.label,...o.objectType?{objectType:o.objectType}:{},...o.quantity==null?{}:{quantity:o.quantity},...r?.sectionLabel?{sectionLabel:r.sectionLabel}:{},...r?.rowLabel?{rowLabel:fe(r)??r.rowLabel}:{},...r?.seatNumber?{seatNumber:r.seatNumber}:{}}})}function Bd(i,e){if(!i.reducedMotion)for(let t of e.slice(0,10)){if(t.objectType==="ga")continue;let n=i.seatByLabel(t.label);!n||i.statusOf(n.id)!=="free"||i.flash(n.id,i.accent)}}function Fd(i,e){if(!e.recoverable.length||!i.isConnected)return;let t=i.querySelector(".sl-hold-expired-next");t&&(e.taken.length?t.textContent=e.taken.slice(0,3).map(s=>(0,Mi.t)("picker.seatJustTakenByAnother",{label:s})).join(" "):t.remove());let n=i.querySelector(".sl-interrupt-actions"),o=n?.querySelector(".sl-interrupt-act");if(!n||!o)return;o.classList.add("sl-interrupt-act-secondary");let r=document.createElement("button");r.type="button",r.className="sl-interrupt-act sl-hold-expired-recover",r.textContent=(0,Mi.tCount)("picker.holdLapsedSelectAgain",e.recoverable.length),r.addEventListener("click",()=>e.onRecover([...e.recoverable])),n.insertBefore(r,o),i.classList.add("has-recovery"),r.focus()}function Vd(i,e=[]){let t=document.createElement("div");t.className="sl-interrupt sl-hold-expired sl-mo-scrim",t.setAttribute("role","alertdialog"),t.setAttribute("aria-modal","true");let n=document.createElement("div");n.className="sl-interrupt-card sl-mo-in";let o=document.createElement("div");o.className="sl-interrupt-title",o.id="sl-hold-expired-title";let r=document.createElement("span");r.className="sl-interrupt-glyph",r.setAttribute("aria-hidden","true"),r.textContent="\u23F1";let s=document.createElement("span");s.textContent=je("picker.holdExpiredTitle","Your seats were released"),o.append(r,s);let a=document.createElement("div");a.className="sl-interrupt-body",a.id="sl-hold-expired-body",a.textContent=je("picker.holdExpiredBody","Your hold time ran out and the seats went back on sale."),n.append(o,a);let l=Fm(e);if(l){let u=document.createElement("div");u.className="sl-interrupt-body sl-interrupt-fact sl-hold-expired-seats",u.textContent=l,n.appendChild(u)}let c=document.createElement("div");c.className="sl-interrupt-body sl-hold-expired-next",c.textContent=je("picker.holdExpiredPickAgain","Pick your seats again to continue. They may already be taken."),n.appendChild(c),t.setAttribute("aria-labelledby",o.id),t.setAttribute("aria-describedby",a.id);let d=document.createElement("div");d.className="sl-interrupt-actions";let p=document.createElement("button");return p.type="button",p.className="sl-interrupt-act sl-hold-expired-restart",p.textContent=je("picker.holdExpiredRestart","Choose seats again"),p.addEventListener("click",()=>i.restart()),d.appendChild(p),n.appendChild(d),t.appendChild(n),t.addEventListener("pointerdown",u=>{u.target===t&&i.restart()}),t}var at=require("@seatlayer/core");var $d={wheelchair:"Wheelchair space",companion:"Companion seat","semi-ambulatory":"Limited mobility","designated-aisle":"Aisle / transfer","step-free":"Step-free",hearing:"Assistive listening",cart:"Live captions","sign-language":"Sign language","low-vision":"Low vision","sensory-friendly":"Sensory-friendly","plus-size":"Plus-size","lift-armrest":"Lift-up armrest"},Vm='<svg viewBox="0 0 20 20" width="17" height="17" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="10" cy="10" r="7.5" /><path d="M10 2.5a7.5 7.5 0 0 1 0 15Z" fill="currentColor" stroke="none" /></svg>',$m='<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>',zm=8,jm=8,Km=88;function Gm(i){let e=i.gap??zm,t=i.margin??jm,n=i.min??Km,o=Math.max(i.boundsTop,0);return Math.max(Math.round(i.buttonTop-o-e-t),n)}var Lo=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let o=this.offered().length>0?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options");this.button.setAttribute("aria-label",o),this.button.innerHTML=$m,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=ua(o,t.tf("picker.close","Close"))+ma(this.rows()),this.root.append(this.menu,this.button),e.prepend(this.root),this.button.addEventListener("pointerdown",r=>r.stopPropagation()),this.button.addEventListener("click",r=>{r.stopPropagation(),this.open(this.menu.hidden)}),this.menu.querySelector("[data-a11y-close]")?.addEventListener("click",r=>{r.stopPropagation(),this.open(!1),this.button.focus({preventScroll:!0})}),this.menu.addEventListener("pointerdown",r=>r.stopPropagation()),this.menu.addEventListener("click",r=>r.stopPropagation()),this.menu.addEventListener("focusin",r=>{let s=r.target;s&&typeof s.scrollIntoView=="function"&&s.scrollIntoView({block:"nearest"})}),this.dismiss=()=>this.open(!1),this.escape=r=>{r.key==="Escape"&&this.open(!1)},this.reflow=()=>{this.menu.hidden||this.fit()},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),window.addEventListener("resize",this.reflow),this.promoteCounts(),this.wire(),this.active.size){this.applyFilter({focus:!1});let 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:n,count:o})=>[n,o])),t=!1;for(let n of this.menu.querySelectorAll("[data-a11y-row]")){let o=n.dataset.a11yRow??"";if(!o.startsWith("a11y:"))continue;let r=o.slice(5),s=e.get(r);if(s===void 0)continue;let a=this.countNode(n),l=s==null?"":this.countText(s);a&&(a.textContent=l);let c=s===0;a instanceof HTMLButtonElement&&(a.disabled=c,a.setAttribute("aria-label",this.jumpLabel(r,l))),n.disabled=c,c?n.setAttribute("aria-disabled","true"):n.removeAttribute("aria-disabled"),c&&this.active.delete(r)&&(this.paint(n,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let n=t.dataset.a11yRow??"";n.startsWith("a11y:")&&this.paint(t,this.active.has(n.slice(5)))}}refit(){this.menu.hidden||this.fit()}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),window.removeEventListener("resize",this.reflow),this.root.remove()}fit(){this.menu.style.setProperty("--sl-a11ymenu-max",`${Gm({boundsTop:this.boundsTop(),buttonTop:this.button.getBoundingClientRect().top})}px`)}boundsTop(){let e=this.root.closest(".sl-map")??this.root.closest(".sl-picker");return e instanceof HTMLElement?e.getBoundingClientRect().top:0}open(e){if(e===!this.menu.hidden)return;if(this.button.setAttribute("aria-expanded",String(e)),!e){this.menu.hidden=!0,this.menu.classList.remove("sl-mo-in","sl-mo-stagger");return}this.menu.hidden=!1,this.fit(),this.menu.scrollTop=0;let t=this.button.getBoundingClientRect();ar(this.menu,{x:t.left+t.width/2,y:t.top}),Va(this.menu),Fa(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",iconHtml:(0,at.seatTypeIconSvg)("restrictedView",{size:17}),label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",iconHtml:Vm,className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:n,count:o})=>({key:n,count:o}));let t=this.deps.present;return t?at.ACCESSIBILITY_TYPES.filter(({key:n})=>t.has(n)).map(({key:n})=>({key:n,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(at.ACCESSIBILITY_TYPES.map(n=>[n.key,n]));return this.offered().flatMap(({key:n,count:o})=>{let r=t.get(n);return r?[{key:`a11y:${n}`,iconHtml:(0,at.seatTypeIconSvg)(n,{size:17}),label:this.deps.tf(`picker.accessShort.${n}`,$d[n]??r.label),...n==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...o==null?{}:{count:this.countText(o),disabled:o===0},on:this.active.has(n)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-sl-info]"))e.addEventListener("click",()=>{let t=e.closest(".sl-info"),n=!t?.classList.contains("open");for(let o of this.menu.querySelectorAll(".sl-info.open"))o.classList.remove("open"),o.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false");t?.classList.toggle("open",n),e.setAttribute("aria-expanded",String(n))});for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let r=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(r),this.paint(e,r);return}if(t==="limited"){let r=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(r),r&&this.deps.focusSeatsForFilter(),this.paint(e,r);return}let n=t.slice(5),o=!this.active.has(n);o?this.active.add(n):this.active.delete(n),this.paint(e,o),this.applyFilter()})}promoteCounts(){if(this.deps.stepToAccessibleSection)for(let e of this.menu.querySelectorAll('[data-a11y-row^="a11y:"]')){let t=e.querySelector(".sl-a11yrow-c");if(!t)continue;let n=(e.dataset.a11yRow??"").slice(5),o=e.parentElement;o?.classList.contains("sl-a11yrow-w")||(o=document.createElement("div"),o.className="sl-a11yrow-w",e.replaceWith(o),o.appendChild(e));let r=document.createElement("button");r.type="button",r.className="sl-a11yrow-c sl-a11yjump",r.dataset.a11yJump=n,r.textContent=t.textContent,r.disabled=e.disabled,r.setAttribute("aria-label",this.jumpLabel(n,t.textContent??"")),t.remove(),e.setAttribute("aria-label",this.rowLabel(n,r.textContent??""));let s=o.querySelector(".sl-info");s?s.after(r):e.after(r),o.dataset.a11yTapThrough||(o.dataset.a11yTapThrough="true",o.addEventListener("click",a=>{a.target===o&&!e.disabled&&e.click()})),r.addEventListener("click",a=>{a.stopPropagation(),this.active.has(n)||(this.active.add(n),this.paint(e,!0),this.applyFilter({focus:!1}));let l=this.deps.stepToAccessibleSection?.(n);l&&r.setAttribute("aria-label",this.jumpLabel(n,r.textContent??"",l.label))})}}countText(e){return e>0?(0,at.t)("picker.accessFreeCount",{count:e}):"0"}countNode(e){return e.querySelector(".sl-a11yrow-c")??e.parentElement?.querySelector(".sl-a11yrow-c")??null}typeLabel(e){let t=$d[e]??at.ACCESSIBILITY_TYPES.find(n=>n.key===e)?.label??e;return this.deps.tf(`picker.accessShort.${e}`,t)}jumpLabel(e,t,n){return[this.deps.tf("picker.jumpToSection","Jump to section"),this.typeLabel(e),t,...n?[`${this.deps.tf("picker.section","Section")} ${n}`]:[]].filter(Boolean).join(" \xB7 ")}rowLabel(e,t){return[this.typeLabel(e),t].filter(Boolean).join(" \xB7 ")}paint(e,t){e.classList.toggle("on",t),e.setAttribute("aria-checked",String(t)),e.setAttribute("aria-pressed",String(t))}applyFilter(e={}){let t=this.active.size?[...this.active]:null;this.deps.applyAccessibilityFilter(t),this.remember(t),t&&e.focus!==!1&&this.deps.focusSeatsForFilter()}key(){let e=this.deps.chart?.();return`seatmap.a11y.filter.${this.deps.event}${e?`.${e}`:""}`}stored(){try{let e=window.sessionStorage.getItem(this.key()),t=e?JSON.parse(e):null;return Array.isArray(t)?t:[]}catch{return[]}}remember(e){try{e&&e.length?window.sessionStorage.setItem(this.key(),JSON.stringify(e)):window.sessionStorage.removeItem(this.key())}catch{}}};var zd=require("@seatlayer/core"),Um=250;function jd(i,e=Um){let t=null,n=()=>{t===null&&(t=setTimeout(()=>{t=null,i()},e))},o=(0,zd.attachVisibilityCatchUp)(n),r=typeof window<"u"&&typeof window.addEventListener=="function";return r&&window.addEventListener("focus",n),()=>{t!==null&&(clearTimeout(t),t=null),o(),r&&window.removeEventListener("focus",n)}}var Ut=require("@seatlayer/core");var Ho=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,Ut.holdRecoveryShape)(e),n=e.lapsedLabels.length,o=n-e.recoverable.length,r=t==="all"?(0,Ut.tCount)("picker.holdLapsedStillFree",n):t==="partial"?(0,Ut.tCount)("picker.holdLapsedSomeTaken",o):(0,Ut.tCount)("picker.holdLapsedAllTaken",n);this.note={message:r,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(r,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>${q(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${q(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,Ut.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 Kd=Symbol("seatlayer.performance-group-picker");function Ro(i,e){return Object.defineProperty(i,Kd,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),i}function Gd(i){return i[Kd]??null}var Ud="@seatlayer/pending-checkout/v1";function qm(i){return typeof i=="string"&&i.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(i)}function Li(i){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let n=null;try{let o=window.sessionStorage.getItem(Ud);if(o){let r=null;try{r=JSON.parse(o)}catch{}if(r&&qm(r.orderId)){let s=Date.now()-Number(r.storedAt);if(s>=0&&s<=144e5){if(r.eventKey&&r.eventKey!==i)return null;n=r.orderId}}}window.sessionStorage.removeItem(Ud)}catch{}e.delete("seatlayer_checkout");try{let o=e.toString();history.replaceState(history.state,"",`${location.pathname}${o?`?${o}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:n}}function qd(i){if(!i.framed)return null;let e=i.ancestorOrigins?.length?i.ancestorOrigins[0]:null;for(let t of[e,i.referrer])if(t)try{return new URL(t).origin}catch{}return null}var Wd="https://api.seatlayer.io",Wm=10,Ym=250,Yd=6e4,Xd=4,Xm=10,Qm=40,Zm=220,$r=["mini","peek","open"],Qd="seatmap.a11y.cb";function Jm(){try{if(typeof window>"u")return null;let i=window.localStorage.getItem(Qd);return i==null?null:i==="1"}catch{return null}}function ef(i){try{window.localStorage.setItem(Qd,i?"1":"0")}catch{}}var lt=class i{constructor(e){this.renderErrorEmitted=!1;this.realtime=null;this.accessEl=null;this.idleClock=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.viewportResizeHandler=null;this.holdTimer=null;this.loadAbort=null;this.transportAbort=new AbortController;this.toastTimer=null;this.offerReadInFlight=null;this.offerReadSettledAt=0;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerCountdownTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.currencyResolved=!1;this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.extendDismissed=!1;this.extendUsed=!1;this.bookedEl=null;this.holdExpiredEl=null;this.holdExpiredFresh=!1;this.holdExpiredUnits=[];this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedWaiters=[];this.seatsRevealedReport=null;this.renderResolvedAt=null;this.revealWaitMs=null;this.handoverMs=null;this.confirmCardCache=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.bestAvailableConfirm=!1;this.baSoldOutSig="";this.bestAvailableSoldOut=!1;this.salesClosed=!1;this.salesState=null;this.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 To({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(e,t)=>this.toast(e,t)});this.view3dCompareEl=null;this.view3dCompareCleanup=null;this.view3dSeatViewChrome=null;this.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.arenaViewportInsets={top:0,right:0,bottom:0,left:0};this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.fullscreenAffordanceSize={rootWidth:-1,rootHeight:-1,viewportWidth:-1,viewportHeight:-1};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.sectionCardCache=null;this.lastTrayCount=0;this.langSel=null;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yMenu=null;this.detachAttention=null;this.lapse=new Ho({toast:(e,t,n)=>this.toast(e,t,n),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalCleanup=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.fitScheduled=!1;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=Gd(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??Wd).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},n=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?Qn({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:n?.access??gi(e,t),this.pubApi=e.transport?null:n?.api??new ft(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=El(e.transport??this.pubApi,this.transportAbort.signal),this.chartFetch=qn(this.api),this.buyerAssetUrls=new ki(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 a custom `transport` owns its backend, so the picker is staying on onCheckout for this mount.'),this.checkoutMode=e.checkout==="hosted"&&this.pubApi?"hosted":"handoff";let o=e.numberOfPlacesToSelect;if(o!=null&&(!Number.isInteger(o)||o<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=o??null;let r=od(e.selectionValidators);if(this.exactTickets!=null&&r>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let s=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(Wm,r)));if(this.exactTickets!=null&&s<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&s<r)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??s,this.cbSafe=Jm()??!!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 Ti(e)}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=qd({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let n=t<640?1.2:.62;return Math.max(420,Math.round(t*n))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}fillsViewport(){let e=this.root;if(!e||typeof window>"u")return!1;let t=e.getBoundingClientRect();return t.height>=window.innerHeight-Xd&&t.width>=window.innerWidth-Xd}syncFullscreenAffordance(){let e=this.els.zfs;if(!e)return;let n=!(!!document.fullscreenElement||this.fsFallback||this.framedFs)&&this.root?.dataset.layout==="narrow"&&this.fillsViewport();e.hidden=n,e.tabIndex=n?-1:0,e.setAttribute("aria-hidden",String(n))}fullscreenMeasurementChanged(e,t){let n=typeof window>"u"?0:window.innerWidth,o=typeof window>"u"?0:window.innerHeight,r=e!==this.fullscreenAffordanceSize.rootWidth||t!==this.fullscreenAffordanceSize.rootHeight||n!==this.fullscreenAffordanceSize.viewportWidth||o!==this.fullscreenAffordanceSize.viewportHeight;return this.fullscreenAffordanceSize={rootWidth:e,rootHeight:t,viewportWidth:n,viewportHeight:o},r}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.root?.setAttribute("data-fs",String(e)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let n=this.els.zfs?.querySelector(".sl-zfs-lbl");n&&(n.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e)),this.syncFullscreenAffordance()}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e,background:this.cssVar("--sl-bg")||void 0}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){Si();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,n=document.createElement("div");n.className="sl-modal-scrim";let o=document.createElement("div");o.className="sl-modal-frame",o.style.setProperty("--sl-bg",pi(void 0,e.theme)["--sl-bg"]),o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label",y("picker.seatSelection","Seat selection")),o.tabIndex=-1,n.appendChild(o),document.body.appendChild(n);let r=document.body.style.overflow;document.body.style.overflow="hidden";let s=Tl(n),a;try{a=new i({...e,container:o})}catch(g){throw s(),n.remove(),document.body.style.overflow=r,g}a.prevFocus=t,a.modalCleanup=()=>{a.modalCleanup=null,s(),document.body.style.overflow=r,a.escHandler&&document.removeEventListener("keydown",a.escHandler),n.remove();let g=a.prevFocus;a.prevFocus=null,g?.isConnected&&g.focus({preventScroll:!0})};let l=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),c=()=>{let g=[...o.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(T=>T.isConnected&&!T.closest('[hidden], [aria-hidden="true"], [inert]'));return g[g.length-1]??o},d=(g,T)=>{let w=g;for(;w;){let v=window.getComputedStyle(w);if(w.hidden||w.getAttribute("aria-hidden")==="true"||w.hasAttribute("inert")||v.display==="none"||v.visibility==="hidden"||v.visibility==="collapse")return!0;if(w===T)return!1;w=w.parentElement}return!0},p=g=>[...g.querySelectorAll(l)].filter(T=>T.tabIndex>=0&&!T.matches(":disabled")&&!d(T,g)),u=(g,T)=>{let w=p(g),v=T?w[w.length-1]:w[0];v?v.focus({preventScroll:!0}):(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus({preventScroll:!0}))},h=!1,b=()=>{if(h)return;h=!0,a.modalCleanup?.();let g=()=>{a.destroy(),e.onClose?.()};a.hold&&!a.handedOff&&e.holdOnClose!=="keep"?a.release().finally(g):g()};a.closeModal=b,n.addEventListener("mousedown",g=>{g.target===n&&b()}),a.escHandler=g=>{if(g.key==="Tab"){if(g.defaultPrevented)return;let T=c(),w=p(T),v=w[0],M=w[w.length-1],F=document.activeElement;!v||!M?(g.preventDefault(),u(T,g.shiftKey)):F===T||!F||!T.contains(F)?(g.preventDefault(),(g.shiftKey?M:v).focus({preventScroll:!0})):g.shiftKey&&F===v?(g.preventDefault(),M.focus({preventScroll:!0})):!g.shiftKey&&F===M&&(g.preventDefault(),v.focus({preventScroll:!0}));return}g.key==="Escape"&&(a.tableDialog?(g.preventDefault(),a.cancelTableDialog()):a.confirmSeat?(g.preventDefault(),a.cancelConfirm()):a.bestAvailableConfirm?(g.preventDefault(),a.bestAvailableConfirm=!1,a.syncTray()):(g.preventDefault(),b()))},document.addEventListener("keydown",a.escHandler);try{let g=a.render();a.els.close?.classList.add("on"),a.els.close?.addEventListener("click",b),await g}catch(g){throw a.destroy(),g}return a.destroyed||u(c(),!1),a}static prewarm(e){try{if(!e||typeof e!="object"||typeof e.event!="string"||!e.event||typeof e.publicKey!="string"||!e.publicKey)return;Na({base:(e.apiBase??Wd).replace(/\/+$/,""),event:e.event,publicKey:e.publicKey})}catch{}}wireController(e){return new B.PickerController({sectionPreview:!0,transport:this.chartFetch.transport,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,categoryPriceRanges:()=>this.mapPriceRanges(),flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:di(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,this.drainSeatsRevealedWaiters(),this.revealWaitMs===null&&this.renderResolvedAt!==null&&(this.revealWaitMs=performance.now()-this.renderResolvedAt),e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let n=this.controller.getGAAreas().find(o=>o.id===t);n&&(this.collapseSheet(),ur(this,n,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:(t=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),Rl(t)&&this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()}),onHoldExpired:()=>{let t=this.handedOff,n=this.holdConflicted;this.holdExpiredUnits=Dd(this.hold),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(()=>{if(t||n){this.toast((0,B.t)("picker.holdExpired",void 0)||"Your hold expired. Seats released. Pick again.","warning");return}this.showHoldExpired()}),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.closedWords().toast,"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.closedWords().toast,"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){if(this.opts.confirmSelection===!1||this.salesClosed){this.removeHeldLabels([t.label]);return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}this.showConfirm(t,"remove");return}if(this.confirmSeat?.id===t.id){this.dismissConfirm();return}if(this.tableDialog?.physicalSeatIds.includes(t.id)){this.dismissTableDialog();return}this.opts.confirmSelection===!1||this.salesClosed||this.controller.tableSelection(t.id)||(this.controller.select([t.id]),this.showConfirm(t,"remove"))},onSelectionLimit:()=>{this.toast((0,B.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),hostCardOpen:()=>this.tipPinned||!!this.confirmSeat,onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>{this.renderErrorEmitted=!0,this.opts.onError?.(t)}})}async render(){if(this.rendered)return this;let e=performance.now(),t={},n=h=>Math.round((performance.now()-h)*100)/100;this.rendered=!0,Si();let o=performance.now(),r=jn(this.opts.locale,this.opts.messages),s=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=Us(this.opts.container),{root:c,els:d,mapHost:p}=Ma(l,(h,b)=>this.tf(h,b),this.opts.theme);this.root=c,this.els=d,this.mapHost=p,Kn(c,r,h=>{t.loadLocale=n(o),this.destroyed||this.applyActiveLocale(h,s)}),Ac(c,()=>[{open:()=>!!this.holdExpiredEl,close:()=>this.restartAfterHoldExpiry()},{open:()=>this.tipPinned,close:()=>this.unpinTooltip()},{open:()=>!!this.tableDialog,close:()=>this.cancelTableDialog()},{open:()=>!!this.confirmSeat,close:()=>this.cancelConfirm()},{open:()=>this.bestAvailableConfirm,close:()=>{this.bestAvailableConfirm=!1,this.syncTray()}}]),this.syncFullscreenButtons(),this.wireBuyerShell(c);let u=document.createElement("div");return u.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(u),t.mountBuyerShell=n(a),t.skeletonPaint=n(e),this.loadAndFinishChart(u,t,n,e,c)}async loadAndFinishChart(e,t,n,o,r){this.startRealtime(),this.startIdleClock(r);let s=await this.loadChart(e,t,n);if(!s)return this.realtime?.stop(),this.realtime=null,this;t.shellsPaint=n(o);let a=performance.now();if(this.salesClosed=!!s.salesClosed||!!this.opts.readOnly,this.salesState=s.salesState??null,r.dataset.eventMode=s.mode==="test"?"test":"live",!this.opts.locale&&s.locale&&this.setLocale(s.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),s.mode==="test"){let v=document.createElement("div");v.className="sl-testbadge",v.textContent=Gs((0,B.t)("picker.testMode"),(0,B.getLocale)()),v.setAttribute("aria-label",(0,B.t)("picker.testMode")),v.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"),this.regions["top-left"].appendChild(v)}let l=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(r),this.watchThemeMode(),this.currency=s.currency??this.opts.currency??"USD",this.currencyResolved=!0,this.eventTimezone=s.timezone??null,qs(this.els.logo,[this.opts.theme?.logoUrl,l?.logoUrl,s.posterUrl],this.opts.theme?.brandName??l?.brandName??s.eventName??"?"),this.els.name.textContent=s.eventName??"";let c=s.startsAt?Rn(s.startsAt,s.timezone??null,this.opts.locale):"";this.eventWhenText=c||null,this.els.meta.textContent=[s.venue,c].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(l);let d=!!this.controller.doc&&this.controller.getExpandedSeats().some(v=>v.commercial?.restrictedView||v.commercial?.obstructedView);this.buildAccessibilityMenu(d),this.buildLanguageSwitcher(this.els.zoom??this.regions["bottom-right"]),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),r.appendChild(this.srEl),this.buildArenaChrome(),this.buildMinimap(),this.buildPriceFilter(),this.buildExtendPrompt(),this.buildBookedOverlay(),this.buildSoldoutOverlay(),this.buildPanelToggle(),this.opts.panelCollapsed&&this.setPanelCollapsed(!0),this.dockLayoutChrome(),t.buildBuyerControls=n(a);let p=performance.now();if(!await this.restoreHoldForFirstPaint(t))return this;if(t.restoreHold=n(p),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncOffer(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let u=this.controller.doc,h=En(this.opts.event),b=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),g=b??"event",T={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:g,surface:b==="season"?"season_picker":b==="performance_group"?"performance_group_picker":"seat_picker",ms:n(o),performanceProfile:t,seatCount:this.allSeats().length,objectCount:u?.objects.length??0,sectionCount:u?.objects.filter(v=>v.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:u?.name,view:this.buyerView,load:h,transport:this.opts.transport?"custom":"pubapi",revealWaitMs:this.revealWaitMs??this.sinceRenderResolved(),handoverMs:this.handoverMs??void 0};_c(T,(v,M)=>this.emitAnalytics(v,M));let w=s.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",_r({...T,performanceProfile:{...T.performanceProfile,...w}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=s,await this.registerAgentTools(),this}registerAgentTools(){return Rc(this)}webMcpHost(e){return Or(this,e)}wireBuyerShell(e){this.refreshOfferAvailability(!1),this.api.availability&&(this.offerVisibilityHandler=()=>{!document.hidden&&!this.destroyed&&this.refreshOfferAvailability(!1)},document.addEventListener("visibilitychange",this.offerVisibilityHandler)),this.detachAttention=jd(()=>{this.destroyed||this.controller.refreshAvailability()}),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit?.addEventListener("click",()=>this.controller.overview()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let o=this.els.sheetToggle;this.syncSheetAffordance();let r=0,s=!1,a=!1,l=!1;o?.addEventListener("click",c=>{c.stopPropagation(),!s&&this.cycleSheet()}),t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard")){a=!1;return}l=!!c.target.closest?.(".sl-sheet-toggle"),a=!0,s=!1,r=c.clientY,(l&&o?o:t).setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!a||s)return;let d=c.clientY-r;d<-18?(this.stepSheet(1),s=!0):d>18&&(this.stepSheet(-1),s=!0)}),t.addEventListener("pointerup",c=>{a&&!s&&!l&&Math.abs(c.clientY-r)<6&&this.cycleSheet(),a=!1,(l&&o?o:t).releasePointerCapture?.(c.pointerId),l=!1})}this.els.foot?.addEventListener("click",o=>{this.root?.dataset.layout==="narrow"&&(o.target.closest?.('.sl-chip,button,a,input,select,label,[role="button"]')||this.cycleSheet())});let n=()=>{if(this.root?.dataset.layout!=="narrow")return;let o=this.root.getAttribute("data-prices-open")==="true";this.root.setAttribute("data-prices-open",String(!o)),this.els.pricesSec?.setAttribute("aria-expanded",String(!o)),!o&&this.root.dataset.sheet!=="open"&&this.setSheetOpen(!0)};this.els.pricesSec?.addEventListener("click",o=>{o.target.closest("select,button")||n()}),this.els.pricesSec?.addEventListener("keydown",o=>{o.key!=="Enter"&&o.key!==" "||o.target.closest("select,button")||(o.preventDefault(),n())}),e.addEventListener("click",o=>{let r=o.target.closest("[data-sl-info]");if(!r||!e.contains(r))return;o.stopPropagation();let s=r.closest(".sl-info"),a=!s?.classList.contains("open");this.closeInfoPops(s),s?.classList.toggle("open",a),r.setAttribute("aria-expanded",String(a))}),e.addEventListener("pointerdown",o=>{o.target.closest(".sl-info")||this.closeInfoPops()}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("pointerdown",o=>{this.handleMapPointerDown(o)},!0),this.els.map.addEventListener("mousemove",o=>{if(this.tipPinned)return;let r=this.els.map.getBoundingClientRect();this.tipPos={x:o.clientX-r.left,y:o.clientY-r.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.els.cta.dataset.act==="find"?this.openBestSeatsForm():this.handleCta()})}sheetState(){let e=this.root?.dataset.sheet;return e==="mini"||e==="open"?e:"peek"}sheetHasCards(){return this.root?.getAttribute("data-has-selection")==="true"}setSheetState(e){let t=this.root;if(!t)return;let n=t.dataset.sheet;t.dataset.sheet=e==="mini"&&!this.sheetHasCards()?"peek":e,this.syncSheetAffordance(),n==="mini"&&t.dataset.sheet!=="mini"&&this.scheduleFit()}syncSheetAffordance(){let e=this.sheetState(),t=e==="open"||e==="peek"&&this.sheetHasCards(),n=this.els.sheetToggle;n?.setAttribute("aria-expanded",String(e==="open")),n?.setAttribute("aria-label",t?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))}cycleSheet(){let e=this.sheetState();e==="open"||e==="mini"?this.setSheetState("peek"):this.setSheetState(this.sheetHasCards()?"mini":"open")}stepSheet(e){let t=$r.indexOf(this.sheetState()),n=Math.min($r.length-1,Math.max(0,t+e));this.setSheetState($r[n])}setSheetOpen(e){this.setSheetState(e?"open":"peek")}openBestSeatsForm(){this.setSheetOpen(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||this.setSheetState("peek")}observeLayout(e){let t=()=>{let n=e.clientWidth;if(n<=0)return;let o=e.clientHeight,r=n!==this.pickerLayoutSize.width||o!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:n,height:o};let s=this.fullscreenMeasurementChanged(n,o);this.reportFramedHeight();let a=n<640?"narrow":"wide",l=o<560?"compact":"comfortable",c=e.dataset.layout!==a||e.dataset.density!==l;c&&(e.dataset.layout=a,e.dataset.density=l,this.controller.setNarrowLayout?.(a==="narrow"),queueMicrotask(()=>this.syncFitClearance()),this.controller.getRenderer()?.setSectionFocusDim?.(a!=="narrow"),a==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray(),this.syncMapStepBack(),this.refreshExtendPrompt()),(s||c)&&this.syncFullscreenAffordance(),this.syncArenaViewportInsets(),r&&(this.minimap?.refreshMinimap(),this.scheduleFit())};this.ro=new ResizeObserver(t),this.ro.observe(e),this.els.map&&this.ro.observe(this.els.map),this.viewportResizeHandler=()=>{this.fullscreenMeasurementChanged(e.clientWidth,e.clientHeight)&&this.syncFullscreenAffordance()},window.addEventListener("resize",this.viewportResizeHandler),t(),requestAnimationFrame(t)}async loadChart(e,t,n){let o=performance.now();this.seatsRevealed=!1,this.seatsRevealedWaiters=[],this.seatsRevealedReport=null,this.renderResolvedAt=null,this.revealWaitMs=null,this.handoverMs=null,this.loadAbort=new AbortController;let r=await ui(async()=>{this.renderErrorEmitted=!1;let l=await this.controller.render(e);return this.renderResolvedAt=performance.now(),this.seatsRevealed&&(this.revealWaitMs=0),this.viewportLoading()&&this.drainSeatsRevealedWaiters(),l},this.loadAbort.signal,()=>{let l=this.els.boot.querySelector(".sl-boot-say");l&&(l.classList.add("is-visible"),l.textContent=this.tf("picker.loadingTakingLonger","The seat map is taking longer to load. Please wait\u2026"))});if(this.loadAbort=null,r.outcome==="cancelled"||this.destroyed)return null;let s=r.outcome==="loaded"?r.value:null,a=r.outcome==="loaded"&&!s&&!this.opts.transport?Wn(this.chartFetch?.outcome(),this.renderErrorEmitted):null;if(s||this.controller.destroy(),t.loadChartAndStatuses=n(o),this.destroyed)return null;if(!s){a&&Yn({apiBase:this.apiBase,eventKey:this.opts.event,reason:a}),Qe({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:r.outcome==="timeout"?"load_timeout":r.outcome==="error"?"render_error":"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:ot(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let l=this.opts.transport?void 0:this.chartFetch?.outcome();if(l?.state==="rejected"&&l.error?.status===404){let c=l.error;c.serverMessage&&console.warn(`[SeatLayer] ${c.serverMessage}`),this.opts.onError?.(c),Ei(this.els.boot,{title:this.tf("picker.eventUnavailableTitle","This event isn\u2019t available"),description:this.tf("picker.eventUnavailable","Tickets can\u2019t be booked here right now.")});for(let d of[this.els.side,this.els.rail])d&&(d.setAttribute("inert",""),d.style.display="none");return null}return Ei(this.els.boot,{title:this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load"),description:this.tf("picker.checkConnection","Check your connection and try again."),actionLabel:this.tf("picker.accessRetry","Try again")}),this.els.boot.querySelector("button").addEventListener("click",()=>{if(this.destroyed||!this.root)return;this.controller=this.wireController(this.opts),Ei(this.els.boot,{title:this.tf("picker.loadingSeatMap","Loading seat map\u2026"),busy:!0});let c=performance.now();this.loadAndFinishChart(e,{},n,c,this.root)},{once:!0}),null}return Object.assign(t,s.performanceProfile),s}sinceRenderResolved(){return this.renderResolvedAt===null?void 0:performance.now()-this.renderResolvedAt}whenSeatsRevealed(e){if(!this.destroyed){if(this.seatsRevealed||this.viewportLoading()&&this.renderResolvedAt!==null){e();return}this.seatsRevealedWaiters.push(()=>{this.destroyed||e()})}}viewportLoading(){return this.opts.loadingReveal==="viewport"}drainSeatsRevealedWaiters(){let e=this.seatsRevealedWaiters;this.seatsRevealedWaiters=[];for(let t of e)try{t()}catch{}}async restoreHoldForFirstPaint(e){let t=[this.els.side,this.els.rail].filter(Boolean),n=t.map(o=>o.hasAttribute("inert"));t.forEach(o=>o.setAttribute("inert",""));try{for(;!this.destroyed;){let o=performance.now();try{return await this.restoreRememberedHold(),!this.destroyed}catch{if(this.destroyed)return!1;Qe({apiBase:this.apiBase,event:this.opts.event,reconnects:this.realtime?.reconnects??0,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"restore_hold",ms:performance.now()-o,performanceProfile:e,view:"map",load:ot(this.opts.event),transport:this.opts.transport?"custom":"pubapi"});let s=Ei(this.els.boot,{title:this.tf("picker.restoreUnavailableTitle","Unable to check saved seats"),description:this.tf("picker.restoreUnavailable","Try again to check whether your saved seats are still held."),actionLabel:this.tf("picker.accessRetry","Try again")}),a=this.transportAbort.signal;if(await new Promise(l=>{let c=()=>{s.removeEventListener("click",c),a.removeEventListener("abort",c),l()};s.addEventListener("click",c,{once:!0}),a.addEventListener("abort",c,{once:!0}),a.aborted&&c()}),this.destroyed||a.aborted)return!1;Ei(this.els.boot,{title:this.tf("picker.restoringSeats","Checking your saved seats\u2026"),busy:!0})}}return!1}finally{t.forEach((o,r)=>{n[r]||o.removeAttribute("inert")})}}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=Li(this.opts.event);e?.outcome!=="success"||!e.orderId||this.openCheckoutPanel({kind:"resume",orderId:e.orderId})}buildPanelToggle(){if(!this.regions["top-right"])return;let e=document.createElement("button");e.type="button",e.className="sl-side-toggle",e.addEventListener("click",()=>this.setPanelCollapsed(!this.sideCollapsed)),this.sideToggleEl=e,this.regions["top-right"].appendChild(e),this.syncPanelToggle()}syncPanelToggle(){let e=this.sideToggleEl;if(!e)return;let t=this.sideCollapsed;e.setAttribute("aria-expanded",String(!t)),e.setAttribute("aria-label",t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=t?`<svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span>${this.tf("picker.tickets","Tickets")}</span>`:'<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>'}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){let e=this.root?.dataset.layout!=="narrow";this.root?.setAttribute("data-side-collapsed",String(this.sideCollapsed)),this.els.side?.toggleAttribute("inert",this.sideCollapsed&&e),this.syncPanelToggle()}buildAccessibilityMenu(e){let t=this.els.zoom??this.regions["bottom-right"]??this.els.map;t&&(this.a11yMenu=new Lo(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(n,o)=>this.tf(n,o),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:n=>this.setColorblindSafe(n),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:n=>{this.limitedViewFilter=n,this.controller.setCommercialLimitedFilter(n),this.pushAvailabilityTo3d()},applyAccessibilityFilter:n=>this.applyAccessibilityFilter(n),focusSeatsForFilter:()=>this.whenSeatsRevealed(()=>this.focusSeatsForFilter()),stepToAccessibleSection:n=>this.controller.focusNextAccessibleSection?.([n])??null}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){if(this.controller.focusAccessibilityFilter?.()){this.explainAccessibilitySpread();return}this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}explainAccessibilitySpread(){let e=this.controller.accessibilitySpread?.();!e?.wholeVenue||e.sections.length<2||this.toast((0,B.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,n=this.els.headInfo?.parentElement;t&&n&&t.parentElement!==n&&(t.classList.add("sl-fs-pill"),n.insertBefore(t,this.els.hold??null));let o=this.extendEl;if(o){let s=e?this.regions["bottom-center"]??this.els.map:n;s&&o.parentElement!==s&&(o.dataset.dock=e?"map":"head",s===n?s.insertBefore(o,this.els.close??null):s.appendChild(o))}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(){ad(this)}buildBookedOverlay(){let e=document.createElement("div");e.className="sl-booked",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<div class="sl-booked-badge"><svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5"/></svg></div><div class="sl-booked-title">${this.tf("picker.allSetTitle","You're all set")}</div><div class="sl-booked-sub" data-ref="bookedSub"></div><ul class="sl-booked-list" data-ref="bookedList"></ul><button type="button" class="sl-booked-back" data-ref="bookedBack"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${q(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}closedWords(){return wa(this.salesState,!!this.opts.readOnly)}tf(e,t){return y(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),n=document.createElement("div");n.className="sl-soldout-eyebrow",n.textContent=t;let o=document.createElement("div");o.className="sl-soldout-title",o.textContent=this.tf("picker.soldOutTitle","Sold out");let r=document.createElement("p");r.className="sl-soldout-copy",r.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(n,o,r),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let n=this.controller.getGAAreas().length>0,o=this.isSoldOut(e,t,n),r=[...Dn(e,t)].join("|");r!==this.baSoldOutSig&&(this.baSoldOutSig=r,this.syncTray()),o!==this.soldOut&&(this.soldOut=o,this.soldoutEl?.classList.toggle("on",o))}isSoldOut(e,t,n){return!n&&e.length>0&&e.every(o=>(t[o.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.closedWords().pill}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.closedWords().toast),this.syncCta(),this.syncTray()}badgeHidden(e){return!!e?.hideBadge}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let n=document.createElement("a");n.className="sl-powered",n.href="https://seatlayer.io/?ref=picker",n.target="_blank",n.rel="noopener noreferrer",n.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let o=document.createElement("span");o.className="sl-powered-mark",o.setAttribute("aria-hidden","true"),o.innerHTML=io;let r=document.createElement("span");r.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),n.append(o,r),t.appendChild(n)}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let n=document.createElement("div");n.className="sl-anchor",n.dataset.region=t,this.els.map.appendChild(n),this.regions[t]=n}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let n=setTimeout(()=>{this.motionTimers.delete(n),this.destroyed||e()},t);this.motionTimers.add(n)}animateOnce(e,t,n=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),n))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){let t=this.reducedMotion(),n=(e.items??[]).filter(o=>o.objectType!=="ga").slice(0,10).map(o=>this.controller.seatByLabel(o.label)).filter(o=>!!o);ml({regions:this.els,categories:this.controller.doc?.categories,pop:o=>this.controller.flashSeat(o,this.cssVar("--sl-accent")||"#f4b740"),focus:(o,r)=>this.controller.focusSection(o,r),focusSeats:o=>this.controller.focusSeats?.(o,{animate:!t})===!0,reducedMotion:t,screenPoint:o=>this.controller.worldToScreen(o),schedule:(o,r)=>this.scheduleMotion(o,r)},n)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(n=>n.id!==e&&n.id!==t)}pendingSelectionCount(){return cd(this)}heldTicketCount(){return dd(this)}totalTicketCount(){return pd(this)}updateSelectionCapacity(){hd(this)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){ud(this,e,t)}setCtaPhase(e){md(this,e)}runCheckoutHandoff(e,t){return fd(this,e,t)}holdStorageKey(){return gd(this)}rememberedHoldId(){return bd(this)}rememberHold(e){yd(this,e)}forgetHold(){vd(this)}resumeHoldFromServer(e,t=!1){return wd(this,e,t)}restoreRememberedHold(){return xd(this)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let n=this.controller.getActiveFloorId();return(t.find(o=>o.id===n)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=kc({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label,tint:e=>this.controller.getRenderer?.()?.categoryDisplayColor?.(e)||void 0},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return Co(this,e)}catPriceRange(e){return Ao(this,e)}buildPriceFilter(){Hd(this)}applyPriceBand(e){Rd(this,e)}buildArenaChrome(){let e=this.controller.doc;if(this.rungsEl=null,this.projectionEl=null,this.floorsEl=null,!e||!this.els.map){this.syncArenaViewportInsets();return}let t=e.objects.some(n=>n.type==="section")||(e.floors??[]).some(n=>n.objects.some(o=>o.type==="section"));if(this.canOffer3d()){let n=document.createElement("div");n.className="sl-projection",n.setAttribute("role","group"),n.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),n.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>`,n.querySelectorAll("button").forEach(o=>{if(o.dataset.view==="venue3d")for(let r of["pointerenter","focus","pointerdown"])o.addEventListener(r,Ln,{once:!0});o.addEventListener("click",()=>{this.setBuyerView(o.dataset.view)})}),this.regions["top-right"].appendChild(n),this.projectionEl=n,this.syncProjection()}if(t){let n=[...e.objects,...(e.floors??[]).flatMap(p=>p.objects)],o=new Set((e.zones??[]).map(p=>p.id)),a=(0,B.effectiveFloorOverview)(e)==="combined"&&(e.floors?.length??0)>1&&o.size===0||n.some(p=>p.type==="section"&&typeof p.zone=="string"&&o.has(p.zone))?["zones","sections","seats"]:["sections","seats"],l=document.createElement("div");l.className="sl-rungs on sl-mo-indicator",l.setAttribute("role","group"),l.setAttribute("aria-label",(0,B.t)("picker.zoomLevel"));let c={zones:(0,B.t)("picker.rungLabel.zones"),sections:(0,B.t)("picker.rungLabel.sections"),seats:(0,B.t)("picker.rungLabel.seats")},d={zones:(0,B.t)("picker.rungTip.zones"),sections:(0,B.t)("picker.rungTip.sections"),seats:(0,B.t)("picker.rungTip.seats")};l.innerHTML=a.map(p=>`<button type="button" data-rung="${p}" title="${d[p]}" aria-pressed="false">${c[p]}</button>`).join(""),l.querySelectorAll("button").forEach(p=>{p.addEventListener("click",()=>{let u=p.dataset.rung;this.controller.setRung(u),u==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(l),this.rungsEl=l,this.syncRung()}if(this.controller.isMultiFloor()){let n=Kl({floors:this.controller.getFloors(),tf:(o,r)=>this.tf(o,r),onChoose:o=>{o===""?this.controller.setFloorOverview(!0):this.controller.setFloor(o),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});(this.regions["bottom-right"]??this.regions["top-left"]).prepend(n),this.floorsEl=n,this.syncFloors()}this.syncArenaViewportInsets()}syncArenaViewportInsets(){let e=this.els.map;e&&ll(this.root,e,this.regions);let t=e?jl(e.getBoundingClientRect(),[this.rungsEl,this.projectionEl].map(n=>n?.isConnected?n.getBoundingClientRect():null),[],8,this.root?.dataset.layout==="narrow"||!this.floorsEl?.isConnected?[]:[this.floorsEl.getBoundingClientRect()]):{top:0,right:0,bottom:0,left:0};Object.keys(t).every(n=>t[n]===this.arenaViewportInsets[n])||(this.arenaViewportInsets=t,this.controller.setViewportInsets(t),this.syncFitClearance())}syncFitClearance(){let e=this.els.map,t=this.els.zoom,n=this.root?.dataset.layout==="narrow",o=0;if(n&&e&&t?.isConnected){let r=e.getBoundingClientRect(),s=t.getBoundingClientRect();s.height>0&&(o=Math.max(0,r.bottom-s.top+8))}this.controller.setFitClearance?.(o)}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.syncMapStepBack(),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(n=>{let o=n.dataset.rung===e;n.classList.toggle("on",o),n.setAttribute("aria-pressed",String(o))})}syncMapStepBack(){let e=this.els?.zout,t=this.els?.zfit,n=this.els?.zin;if(!e||!this.root)return;let o=this.controller.getRenderer?.(),r=this.controller.canZoomIn?.()===!1||o?.seatsPickable?.()===!0,s=Dl({focusedSection:this.controller.getFocusedSection?.()??null,seatsRevealed:this.controller.seatsRevealed?.()??!0,atVenueFit:this.controller.atVenueFit?.()})==="none",a=e.disabled!==s||!!t&&t.disabled!==s||!!n&&n.disabled!==r||e.hidden||!!n?.hidden||!!t?.hidden;e.disabled=s,e.hidden=!1,n&&(n.disabled=r,n.hidden=!1),t&&(t.disabled=s,t.hidden=!1),a&&this.a11yMenu?.refit()}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?this.tf("picker.priceHint3d","Colours in the venue are ticket types. Choose one below to show just those seats."):this.tf("picker.priceHint","Colours on the map are ticket types. Tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!Mn()?!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)?Yd/2:Yd}syncFloors(){Gl(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new vo({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(o=>o.type==="section"&&!this.controller.isSectionClosed(o.id)&&this.controller.getSectionSeatCount(o.id)>0);if(t.length<2)return null;let n=t.findIndex(o=>o.id===e);return n<0?null:{previous:t[(n-1+t.length)%t.length],next:t[(n+1)%t.length]}}markedSeatAnnouncement(e){let t=Pr(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return tc(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 n=this.controller.doc?.categories.find(h=>h.key===e.categoryKey),o=this.controller.getStatus(e.id)??"free",r=o==="free"?this.tf("picker.statusAvailable","available"):o==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),s=n?this.catPriceRange(n):void 0,a=!this.suppressPricing&&s?s.min===s.max?this.money(s.min):`${this.money(s.min)}\u2013${this.money(s.max)}`:void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=Kt(c),p=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,u=l?`${d} ${p}, ${l.bookingMode==="variable"?(0,B.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,B.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${p}`:c?.objectType==="table"?`${d} ${p}, ${(0,B.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,B.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${u}, ${n?.label??e.categoryKey}${a?`, ${a}`:""}, ${r}`}showTableDialog(e,t,n){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=n??document.activeElement;let o=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),r=e.bookingMode==="variable",s=document.createElement("div");s.className="sl-table-scrim",s.innerHTML=pa(e,{variable:r,held:t,typeWord:Kt(e),categoryLabel:o?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(s),this.tableDialogEl=s,this.renderTableDialogState(),s.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()})}),s.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),s.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),s.addEventListener("mousedown",a=>{a.target===s&&this.cancelTableDialog()}),s.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...s.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(()=>s.querySelector(r?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let n=t.querySelector("output[data-table-qty]");n&&(n.value=String(e.quantity));let o=t.querySelector("input[data-table-qty]");o&&(o.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let r=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),s=t.querySelector("[data-table-total]");s&&(s.textContent=this.money(r*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let n=this.tableDialogEl?.querySelector(".sl-table-confirm");if(n&&(n.disabled=!0,n.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let o=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!o){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items},this.startHoldTimer(o.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,B.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(o){this.opts.onError?.(o),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),n&&(n.disabled=!1,n.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){n&&(n.disabled=!1,n.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}get confirmCard(){return this.confirmCardCache||(this.confirmCardCache=new ko({controller:this.controller,root:()=>this.root,els:()=>this.els,regions:()=>this.regions,hideTooltip:()=>{this.tipEl&&(this.tipEl.style.display="none")},tf:(e,t)=>this.tf(e,t),money:e=>this.money(e),paidPrice:(e,t,n,o)=>this.paidPrice(e,t,n,o),offerName:(e,t)=>this.offerPrice(e,t)?.offerName,suppressPricing:()=>this.suppressPricing,reducedMotion:()=>this.reducedMotion(),scheduleMotion:(e,t)=>this.scheduleMotion(e,t),canOffer3d:()=>this.canOffer3d(),buyerView:()=>this.buyerView,view3dHandle:()=>this.view3dHandle,view3dCompareSeatIds:()=>this.view3dCompareSeatIds,rememberView3dReturnSeat:e=>{this.view3dReturnSeat=e},enter3d:e=>{this.enter3d(e)},performanceGroup:()=>this.performanceGroup,seatViewEnabled:()=>this.seatViewEnabled(),openSeatView:e=>{this.openSeatView(e)},openSeatConfidencePassport:(e,t)=>this.openSeatConfidencePassport(e,t),saveView3dComparisonSeat:e=>this.saveView3dComparisonSeat(e),resolveAssetUrl:e=>this.buyerAssetUrls.resolve(e),onError:e=>this.opts.onError?.(e),liftToastOverConfirm:()=>this.liftToastOverConfirm(),fitTranslatedRows:()=>this.fitTranslatedRows(),syncTray:()=>this.syncTray(),syncSelectionTo3d:()=>this.syncSelectionTo3d(),collapseSectionCard:()=>this.collapseSectionCard(),applyPanelCollapsed:()=>this.applyPanelCollapsed(),dismiss:()=>this.dismissConfirm(),releaseHeldSeat:e=>this.controller.currentHold()?.labels.includes(e.label)?this.removeHeldLabels([e.label]):null,reanchor:()=>this.reanchorConfirm(),inviteCommit:(e,t)=>this.inviteCommit(e,t),addSeatLabel:e=>this.addSeatLabel(e),cartLanded:()=>this.cartLanded()})),this.confirmCardCache}showConfirm(e,t="add"){this.confirmCard.show(e,t)}reanchorConfirm(){this.confirmCard.reanchor()}dismissConfirm(){this.confirmCard.dismiss()}cartLanded(){this.animateOnce(this.els.count,"sl-value-pop",380),this.animateOnce(this.els.total,"sl-value-pop",380)}async commitConfirm(){await this.confirmCard.commit()}cancelConfirm(){this.confirmCard.cancel()}closeConfirm(){this.dismissConfirm()}inviteCommit(e,t){vc(e,t,this.reducedMotion())}addSeatLabel(e){return wc(e,(t,n)=>this.tf(t,n))}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,n=this.controller.doc,o=this.controller.getActiveFloorId(),r=e.focalPoint??n?.floors?.find(p=>p.id===o)?.focalPoint??n?.focalPoint??{x:0,y:0},s,a,l=!1;if(e.viewUrl){let p,u=null;try{let b=e.viewMeta?.previewUrl;b&&b!==e.viewUrl?(u=await this.buyerAssetUrls.resolve(b),p=e.viewUrl):p=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(b){t===this.seatViewGen&&this.opts.onError?.(b);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}:{}};s=h,a=(0,Io.seatViewDisclosure)(h),l=(0,Io.isAuthoredSeatView)(h)}else{let p;try{let{generateSeatPanorama:u}=await Hn();p=u(e,r,this.allSeats())}catch(u){t===this.seatViewGen&&this.opts.onError?.(u);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;s={url:p.url,generated:!0},a=(0,B.t)("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=(0,B.t)("picker.viewFromSeat",{label:e.label}),d=ro({root:this.root,source:s,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:Nt(),viewFromSeatLabel:c,real360Label:(0,B.t)("picker.real360"),previewLabel:(0,B.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 n=Number.isInteger(e);return(0,B.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(o,r)=>`${o} ${r}`,...n?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),n=Il(e,t);if(n==null)return;let o=6*36e5,r=Math.min(Math.max(n-t+1e3,1e3),o);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},r)}offerReadIsCurrent(){return!!this.offerReadInFlight||Date.now()-this.offerReadSettledAt<Ym}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||this.offerReadIsCurrent()||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}refreshOfferAvailability(e){if(!this.api.availability||this.destroyed)return Promise.resolve();if(this.offerReadInFlight)return this.offerReadInFlight;if(this.offerReadIsCurrent())return Promise.resolve();let t=this.readOfferAvailability(e).finally(()=>{this.offerReadInFlight===t&&(this.offerReadInFlight=null)});return this.offerReadInFlight=t,t}async readOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;this.offerReadSettledAt=Date.now();let n=bo(t);if(!n)return;this.offerAvailability=n,this.applyChannelPricing(n.channelPricing),this.scheduleOfferBoundary(n);let o=Ol(this.hostPricing?.prices,n),r=Object.keys(o).length>0||this.hostPricing?.formatter?{prices:o,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(r),this.syncMapPriceRanges(),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(n)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e,t){if(!e)return null;let n=this.offerAvailability?.prices.filter(o=>o.categoryKey===e)??[];return t!==void 0?n.find(o=>(o.tierId??null)===t)??n.find(o=>o.tierId==null)??null:n[0]??null}mapPriceRanges(){if(this.api.availability&&!this.offerAvailability)return null;let e=this.offerAvailability?.prices.some(n=>n.tierId!==void 0)??!1,t=Object.keys(this.opts.pricing?.prices??{}).length>0;if(!(!e&&!t))return Object.fromEntries((this.controller.doc?.categories??[]).flatMap(n=>{let o=this.catPriceRange(n);return o?[[n.key,o]]:[]}))}syncMapPriceRanges(){this.controller.getRenderer()?.setCategoryPriceRanges?.(this.mapPriceRanges())}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerCountdownTimer=null,e.classList.remove("sl-offer-compact","sl-offer-early-bird"),!this.currencyResolved){e.classList.remove("has"),e.replaceChildren();return}if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,n=t?.release??null,o=!n&&t?.upcoming?.pricingMode!=="matrix"?t?.upcoming??null:null;if(!t||t.state==="closed"||t.state==="sold-out"||!n&&!o){e.classList.remove("has"),e.replaceChildren();return}let r=n??o,s=r.pricingMode==="matrix",a=document.createElement("div");a.className="sl-offer-main";let l=document.createElement("div");l.className="sl-offer-copy";let c=document.createElement("span");c.className="sl-offer-kicker",c.textContent=n?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let d=document.createElement("strong");d.className="sl-offer-name";let p=r.name||(n?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));Xo(p)&&e.classList.add("sl-offer-early-bird"),d.innerHTML=On(p,q);let u=document.createElement("span");u.className="sl-offer-line";let h=[];if(!s&&n&&t.fromPrice!=null&&h.push(this.money(t.fromPrice/100)),!s&&n&&r.remaining!=null&&h.push((0,B.t)("picker.offerRemainingAvailable",{count:r.remaining})),n&&r.endsAt!=null){let v=!this.opts.locale||/^en(?:-|$)/i.test(this.opts.locale)?Js(r.endsAt):null;if(h.push(v??(0,B.t)("picker.offerUntil",{time:Rn(r.endsAt,this.eventTimezone,this.opts.locale)})),v){let M=Math.max(1e3,r.endsAt-Date.now()),F=M%6e4||6e4;this.offerCountdownTimer=setTimeout(()=>{this.offerCountdownTimer=null,Date.now()>=r.endsAt?this.refreshOfferAvailability(!1):this.syncOffer()},Math.min(F+25,M+25))}}if(o?.startsAt!=null&&h.push((0,B.t)("picker.offerStarts",{time:Rn(o.startsAt,this.eventTimezone,this.opts.locale)})),u.textContent=h.join(" \xB7 "),s||l.append(c),l.append(d,u),s){e.classList.add("sl-offer-compact"),a.append(l),e.replaceChildren(a),e.classList.add("has");return}let b=document.createElement("details");b.className="sl-offer-info";let g=document.createElement("summary");g.setAttribute("aria-label",(0,B.t)("picker.howOfferWorks",{name:d.textContent??""})),g.textContent="i";let T=document.createElement("div");T.className="sl-offer-detail",T.textContent=n?this.tf("picker.offerDetailActive","This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over."):this.tf("picker.offerDetailUpcoming","Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts."),b.append(g,T),a.append(l,b),e.replaceChildren(a),e.classList.add("has")}paidPrice(e,t,n,o){let r=o?this.channelByObject.get(o):void 0;if(r&&e){let a=this.pricesByChannel.get(r)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let s=e?this.opts.pricing?.prices?.[e]:void 0;return s===void 0?n:typeof s=="number"?s:t&&s.tiers?.[t]!==void 0?s.tiers[t]:s.base??n}legendDeps(){return Id(this)}syncPriceRail(e,t,n=this.legendDeps()){Od(this,e,t,n)}syncPrices(){this.currencyResolved&&_d(this)}focusCategory(e){Nd(this,e)}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(n=>!e.has(n.label)&&(this.controller.getStatus(n.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(n=>n.id)),this.toast((0,B.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:n,heldLabels:o,total:r,count:s}=Eo(this),a=[],l=new Set;if(!this.salesClosed){let f=this.performanceGroup?.nightSummary?.()??[];f.length&&a.push(Yl(f,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let O=this.performanceGroup?.selectionModeSwitch;O&&a.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${q(O.label)}</button>`)}let c={salesClosed:this.salesClosed,salesState:this.salesState,hasPicks:e.length>0||n.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(f=>f.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0};a.push(xa(c)),this.els.trayHint&&(this.els.trayHint.textContent=ka(c)),this.els.seatsInfo&&(this.els.seatsInfo.hidden=this.salesClosed);let d=!e.length&&!n.length&&!wt(this.gaQty,this.hold?.items??[]);if(!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||this.bestAvailableBusy||this.bestAvailableConfirm)){let f=(this.controller.doc?.categories??[]).filter(_=>!_.notForSale),O=this.controller.getBestAvailableZones();this.baZone&&!O.some(_=>_.id===this.baZone)&&(this.baZone="");let G=Dn(f,this.controller.categoryAvailability());this.baSoldOutSig=[...G].join("|"),this.bestAvailableSoldOut=f.length>0&&G.size===f.length,G.has(this.baCat)&&(this.baCat=""),(!this.bestAvailableSoldOut||this.bestAvailableBusy||this.bestAvailableConfirm)&&a.push(ya({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:!1,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:f.map(_=>G.has(_.key)?{..._,soldOut:!0}:_),zones:O,selectedCategory:this.baCat,selectedZone:this.baZone}))}let p=(f,O,G,_=1,j,P,z,J)=>ga({categoryLabel:z,offerName:J,d:f?this.controller.seatDetails(f):null,area:G==="ga"?t.find(W=>W.id===j):void 0,label:O,objectType:G,quantity:_,identity:P,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),u=q,h=[];for(let f of Ua(n)){let O=f.objectType==="ga"?`held:ga:${f.objectId}:${f.tierId??""}`:`held:${f.label}`;l.add(O);let G=this.controller.doc?.categories.find(ze=>ze.key===f.categoryKey),_=this.performanceGroup||this.suppressPricing?null:Ic(this.controller,f),j=f.tierId&&!_?G?.tiers?.find(ze=>ze.id===f.tierId)?.name:void 0,P=this.offerPrice(f.categoryKey,f.tierId??null)?.offerName,z=f.objectType!=="ga"?this.controller.seatByLabel(f.label):null,J=f.objectType==="table"?this.controller.tableSelection(f.label):null,W=z?this.controller.seatDetails(z.id):null,oe=this.seatViewEnabled()&&!!z&&f.objectType!=="table"&&!!this.deliverableViewReference(z),Ee=u(this.tf("picker.heldForYou","Held for you")),xe=(J?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(f.label))}">${u((0,B.t)("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+(_?`<select class="tier" data-held-tier="${u(f.label)}" aria-label="${u((0,B.t)("picker.ticketTierFor",{label:f.label}))}">${tr(_,f.tierId??void 0,u)}</select>`:""),Ce=this.paidPrice(f.categoryKey,f.tierId,f.unitPrice,f.label)*(f.quantity??1);h.push({key:O,fresh:!this.lastTrayKeys.has(O),held:!0,seatIds:[],heldLabels:f.labels,removeAria:(0,B.t)("picker.removeHeldTicketLabel",{label:dr(f,t)}),locateId:z?.id??null,section:W?.sectionLabel??"",rowLabel:W&&fe(W)||"",seatLabel:W?.seatNumber??f.label,categoryLabel:`${G?.label??f.categoryKey}${j?` \xB7 ${j}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??G?.color??"",identityHtml:p(z?.id??null,f.label,f.objectType,f.quantity??1,f.objectId,J??void 0,`${G?.label??f.categoryKey}${j?` \xB7 ${j}`:""}`,P),stateHtml:`<span class="sl-ticket-state held" aria-label="${Ee}" title="${Ee}"><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:xe,amount:Ce,amountText:this.suppressPricing?"":this.money(Ce),noteHtml:Dt(z??void 0),railHtml:this.performanceGroup?"":ir((0,B.t)("picker.removeHeldTicketLabel",{label:dr(f,t)}),oe?f.label:null)})}let b=this.seatViewEnabled();for(let f of e.filter(O=>!o.has(O.label))){let O=`seat:${f.id}`;l.add(O);let G=this.controller.doc?.categories.find(Ce=>Ce.key===f.categoryKey),_=f.tiers&&f.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${u(f.id)}" aria-label="${u((0,B.t)("picker.ticketTierFor",{label:f.label}))}">`+tr(f.tiers,f.tierId,u)+"</select>":"",j=f.tiers?.find(Ce=>Ce.id===f.tierId)??f.tiers?.[0],P=this.offerPrice(f.categoryKey,j?.id??null)?.offerName,z=j?.buyerMessage?.trim()||(j?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),J=this.controller.seatDetails(f.id),W=u(this.tf("picker.selected","Selected")),oe=(0,B.t)("picker.removeSeatLabel",{label:f.label}),Ee=(f.objectType==="table"&&f.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(f.label))}">${u((0,B.t)("picker.guestsCountEdit",{count:f.quantity??1}))}</button>`:"")+_,xe=this.paidPrice(f.categoryKey,f.tierId??null,f.price,f.label)*(f.quantity??1);h.push({key:O,fresh:!this.lastTrayKeys.has(O),held:!1,seatIds:[f.id],heldLabels:[],locateId:f.id,section:J?.sectionLabel??"",rowLabel:J&&fe(J)||"",seatLabel:J?.seatNumber??f.label,categoryLabel:G?.label??f.categoryKey,identityHtml:p(f.id,f.label,f.objectType,f.quantity??1,f.objectId,f,G?.label??f.categoryKey,P),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(f.categoryKey)??G?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${W}" title="${W}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:Ee,amount:xe,amountText:this.suppressPricing?"":this.money(xe),removeAria:oe,noteHtml:Dt(f)+(z?`<small class="sl-tier-note">${u(z)}</small>`:""),railHtml:ir(oe,b&&f.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(f.label)??{})?f.label:null)})}h.length&&a.push(h.map(ba).join("")),t.length&&a.push(Za(this,t,n)),this.els.tray.innerHTML=a.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=l,this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let g=this.performanceGroup?.selectNight;g&&sc(this.els.tray,f=>g(f)),this.els.tray.querySelectorAll("[data-ba]").forEach(f=>{f.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(f.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",f=>{this.baCat=f.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",f=>{this.baZone=f.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(f=>{f.addEventListener("click",()=>{let O=f.closest(".sl-chip");if(O.dataset.held){this.removeHeldLabels(decodeURIComponent(O.dataset.held).split(`
|
|
3563
|
+
`),O);return}let G=O.dataset.seat.split(" "),_=()=>{this.controller.deselect(G)};if(this.reducedMotion()){_();return}O.classList.remove("sl-enter"),O.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(_,we.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(f=>{f.addEventListener("click",O=>{O.stopPropagation();let G=decodeURIComponent(f.dataset.tableEdit??""),_=this.controller.tableSelection(G);if(!_)return;let j=n.find(P=>P.label===G&&P.objectType==="table");this.showTableDialog({..._,quantity:j?.quantity??_.quantity},!!j,f)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(f=>{f.addEventListener("change",()=>f.dataset.heldTier?void this.changeHeldTier(f,f.dataset.heldTier):this.controller.setSeatTier(f.dataset.tier,f.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(f=>{f.addEventListener("click",()=>{let O=this.controller.seatByLabel(f.dataset.viewLabel);O&&this.openSeatView(O)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(f=>{let O=()=>this.controller.flashSeat(f.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");f.addEventListener("mouseenter",O),f.addEventListener("focusin",O),f.addEventListener("click",G=>{G.target.closest?.('button,a,select,[role="button"],input')||!this.controller.focusSeats?.([f.dataset.locate],{animate:!this.reducedMotion()})||O()})}),Ja(this,this.els.tray,t),this.controller.setGASelection(ja(this.gaQty)),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(f=>{f.disabled=!0});let T=this.pendingSelectionCount(),w=this.lastTrayCount,v=this.lastTrayTotal,M=rc(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");this.els.count.textContent=M||(s?(0,B.tCount)("picker.ticketsCount",s):this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=s&&!this.suppressPricing?this.money(r):"",this.root?.setAttribute("data-has-selection",String(s>0)),this.sheetState()==="mini"&&s===0?this.setSheetState("mini"):s>w&&this.root?.dataset.layout==="narrow"?this.setSheetState("mini"):this.syncSheetAffordance(),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy)),this.els.seatSummary&&(this.els.seatSummary.textContent=M||(s?(0,B.tCount)("picker.seatsSelectedCount",s):"")),this.syncCta(s,T);let X=this.root?.dataset.layout==="narrow"&&this.root?.dataset.confirming==="true";s!==w&&!X&&this.animateOnce(this.els.count,"sl-value-pop",380),r!==v&&!X&&this.animateOnce(this.els.total,"sl-value-pop",380),w===0&&s>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.lastTrayCount=s,this.lastTrayTotal=r,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(s,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(){Pl(this.confirmEl?.querySelector(".sl-confirm-row")),this.els.tray?.querySelectorAll(".sl-chip-pos").forEach(Ml),this.els.tray?.querySelectorAll(".sl-ba-go").forEach(Ll)}emitSelectionValidity(e,t){let n=this.controller.getSelectionValidity(e);n&&(n.seats=t,this.opts.onSelectionValidityChange?.(n),n.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(n),this.lastSelectionValidity=n.isValid)}async removeHeldLabels(e,t){let n=e.filter(s=>s&&!this.releasingLabels.has(s));if(!n.length)return!1;let o=n[0];n.forEach(s=>this.releasingLabels.add(s)),t?.setAttribute("aria-busy","true");let r=t?.querySelector(".rm");r&&(r.disabled=!0);try{let s=this.handedOff;if(!await this.controller.releaseLabels(n))return this.toast((0,B.t)("picker.couldNotRemoveLabel",{label:o}),"error"),!1;qa(this.gaQty,this.hold?.items??[],n);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&s,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),!0}finally{n.forEach(s=>this.releasingLabels.delete(s)),t?.removeAttribute("aria-busy"),r?.isConnected&&(r.disabled=!1)}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(Mo(e,(n,o)=>this.tf(n,o)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast((0,B.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(n=>!(this.hold.items??[]).some(o=>o.label===n.label))){let n=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,n);return}this.holdingLabels=new Set(t.map(n=>n.label)),this.setCtaPhase("holding");try{let n=null,o=za(this.gaQty),r=this.committedSelection();if(r.length){let s=await this.controller.hold(void 0,this.opts.holdTtlMs);n=s?{holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items}:null}for(let{areaId:s,tierId:a,qty:l}of o){let c=await this.controller.holdGA(s,l,{tierId:a,ttlMs:this.opts.holdTtlMs});n=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:n}if(!n){this.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=n,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(n.expiresAt),this.flashHeldSeats(n),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(n,n.seats??r)}catch(n){this.opts.onError?.(n);let o=Cr(n);if(o){this.toast(o,"warning"),this.setCtaPhase("idle");return}let r=n,s=(r.conflicts??[]).map(l=>l.label).filter(Boolean).slice(0,3);r.reason==="event_closed"&&this.setSalesClosed(!0);let a=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,B.t)("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):(0,B.t)("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(a),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){kd(this,e)}stopHoldTimer(){Sd(this)}setExtendPrompt(e,t){Td(this,e,t)}refreshExtendPrompt(){Ed(this)}handleExtend(){return Cd(this)}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((o,r)=>o+r.quantity,0),n=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=n?.seats?`<span class="sl-booked-seats">${(0,B.tCount)("picker.group.ticketsConfirmedAcross",n.seats,{performances:n.performances})}</span>`:`<span class="sl-booked-seats">${(0,B.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(o=>{let s=[o.sectionLabel,o.rowLabel&&`${this.tf("picker.row","Row")} ${o.rowLabel}`,o.seatNumber&&`${this.tf("picker.seat","Seat")} ${o.seatNumber}`].filter(Boolean).join(" \xB7 ")||o.displayLabel||o.label,a=o.quantity>1?` <span class="sl-booked-qty">\xD7${o.quantity}</span>`:"";return`<li>${q(s)}${a}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0),this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.resetAfterBooking(),this.root?.focus({preventScroll:!0})}resetAfterBooking(){this.bookedShown=!1,this.hold=null,this.handedOff=!1,this.holdConflicted=!1,this.holdingLabels.clear(),this.gaQty.clear(),this.stopHoldTimer(),this.forgetHold(),this.clearSelection(),this.setCtaPhase("idle"),this.setSheetOpen(!1),this.syncTray(),this.syncCta(),this.emitHoldChange()}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let n=this.buildHandoff(e),o=null;try{o=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(a){this.opts.onError?.(a)}if(this.destroyed)return;let r=o?.bookingMode==="free",s=o?.providers?.[0]??null;if(!s&&!r){let a=Ws(o?.reason),l=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:a,handoff:n}),this.opts.onCheckout?.(e,t,n),l||this.openCheckoutPanel({kind:"unavailable",reason:a,seatCount:Ys(n)});return}await this.openCheckoutPanel(Xs(n,s,o,this.pubApi.ticketKeysFor(e.holdId),this.controller.getGAAreas()))}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await li())}catch(n){this.opts.onError?.(n),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held. Please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,eventKey:this.opts.event,event:{name:this.els.name?.textContent||null,detail:this.els.meta?.textContent||null},formatMoney:n=>this.money(n),t:B.t,startSession:n=>this.pubApi.startCheckout(this.opts.event,{...n,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:n=>this.pubApi.orderStatus(n),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:n=>{this.opts.onOrderConfirmed?.(n),this.controller.refresh()},onError:n=>{Qs(n)&&(this.paymentOptions=null),n?.code==="seats_unavailable"&&this.controller.refresh(),this.opts.onError?.(n)}}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let n=(e.items??[]).map(s=>{let a=this.controller.lineItemDisplay(s),l=s.objectType==="seat"||s.objectType==="booth"?this.controller.seatByLabel(s.label):null,c=l?this.controller.seatDetails(l.id):null,d=c?fe(c):void 0,p=this.controller.doc?.categories.find(h=>h.key===s.categoryKey),u=s.tierId?p?.tiers?.find(h=>h.id===s.tierId)?.name:void 0;return{label:s.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},...c?.sectionLabel?{sectionLabel:c.sectionLabel}:{},...d?{rowLabel:d}:{},...c?.seatNumber?{seatNumber:c.seatNumber}:{},...p?.label?{categoryLabel:p.label}:{},...u?{tierLabel:u}:{},objectId:s.objectId,objectType:s.objectType,categoryKey:s.categoryKey,tierId:s.tierId,unitPrice:this.paidPrice(s.categoryKey,s.tierId,s.unitPrice,s.label),currency:s.currency??this.currency,quantity:s.quantity??1}}),o=n[0]?.currency??this.currency,r=n.reduce((s,a)=>s+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:o,lineItems:n,total:r}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",n){let o=this.els.toast;if(!o)return;o.replaceChildren();let r=document.createElement("span");if(r.textContent=e,o.appendChild(r),o.classList.toggle("has-action",!!n),n){let s=document.createElement("button");s.type="button",s.className="sl-toast-action",s.textContent=n.label,s.addEventListener("click",n.onClick,{once:!0}),o.appendChild(s)}o.dataset.tone=t,o.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{o.classList.remove("on","sl-mo-rise"),o.classList.remove("has-action"),o.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),n=this.confirmEl;if(!t||!n?.isConnected){e.style.removeProperty("bottom");return}let o=this.els.map.clientHeight;if(o<=0)return;let r=n.getBoundingClientRect(),s=r.height||n.offsetHeight||Zm,a=r.height?r.top-this.els.map.getBoundingClientRect().top:o-Lr-s,l=Math.round(o-a+Xm);if(l+Qm>o){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){this.handoverMs===null&&this.renderResolvedAt!==null&&(this.handoverMs=performance.now()-this.renderResolvedAt),Cc({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},n=this.tipPinned?dc(this.tipPos,e,t):null,o=n??cc(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${o.left}px`,this.tipEl.style.top=`${o.top}px`,n?this.tipEl.dataset.placement=n.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let n=this.performanceGroup,o=Pr(e.mark,n?.nights?.()),r=o?.states.filter(s=>s.free).length??0;return Xl(o,{locale:this.opts.locale,switchLabel:n?.selectionModeSwitch?.label??null,selectPartialLabel:n?.partialSeatSelection?.label(r)??null,pinned:t})}unpinTooltip(){this.tipPinned&&(this.tipPinned=!1,this.tipEl?.classList.remove("sl-tip-pinned"),this.tipEl&&(this.tipEl.style.display="none"))}handleMapPointerDown(e){if(this.tipEl?.contains(e.target))return;this.lastMapPoint={x:e.clientX,y:e.clientY},this.lastPointerType=e.pointerType||"mouse";let t=this.els.map.getBoundingClientRect();this.tipPos={x:e.clientX-t.left,y:e.clientY-t.top},this.unpinTooltip()}closeInfoPops(e){this.root?.querySelectorAll(".sl-info.open").forEach(t=>{t!==e&&(t.classList.remove("open"),t.querySelector("[data-sl-info]")?.setAttribute("aria-expanded","false"))})}updateTooltip(e){if(!this.tipEl)return;if(this.confirmSeat){this.tipEl.style.display="none";return}if(this.tipPinned&&e?.interaction!=="press")return;if(!e){this.tipPinned||(this.tipEl.style.display="none",this.tipMarkedHoverLabel=null);return}let t=e.mark?.kind==="partial"&&this.tipMarkedHoverLabel===e.label;if(e.interaction!=="press"&&this.lastPointerType==="mouse"&&!e.mark&&!this.tipPinned){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}if(e.unavailable&&e.status==="free"&&e.interaction==="press"){this.toast(this.tf("picker.turnOffAccessibilityFilter","Turn off the wheelchair filter to pick this seat"),"neutral"),this.tipEl.style.display="none";return}if(e.unavailable&&!e.mark){this.tipEl.style.display="none",this.tipMarkedHoverLabel=null;return}let n=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t);this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let o=this.nightStripFor(e,n);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=lc(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:Kt(e),extra:o+(n?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${q(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=n,this.tipEl.classList.toggle("sl-tip-pinned",n),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),uc(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,r=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,r)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let n={};for(let[o,r]of Object.entries(e())){let s=this.controller.idForLabel(o);s&&(n[s]=r)}Object.keys(n).length&&t.setSeatMarks(n)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),n=this.controller.getSelection().filter(o=>t.has(o.id)||t.has(o.label));if(n.length===t.size)return n;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=Zi(this.themeMode),n=pi(this.controller.doc?.theme,this.opts.theme,t);for(let[o,r]of Object.entries(n))e.style.setProperty(o,r);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=zn(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(di(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:Zi(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Zi(this.themeMode),n=pi(this.controller.doc?.theme,this.opts.theme,t),o=di(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,r=Aa(n,o);for(let s of Ca)r?e.style.setProperty(s,r[s]):e.style.removeProperty(s)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),n=JSON.stringify(e??null);t!==n&&(this.opts.pricing=e,!(this.destroyed||!this.els.prices||!this.currencyResolved)&&(this.syncMapPriceRanges(),this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=Ha(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=(0,B.getLocale)(),n=this.localeGeneration+=1,o=await(0,B.loadLocale)(e);return this.opts.messages&&(0,B.setStringOverrides)(this.opts.messages),o===t||this.applyActiveLocale(o,n),o}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&(Ra(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(),ef(e))}setViewMode(e){this.controller.setViewMode(this.normalizeInitialView(e)),this.syncProjection(),this.dismissConfirm()}getViewMode(){return this.controller.getViewMode()}normalizeInitialView(e){return e==="perspective"?(this.perspectiveWarned||(this.perspectiveWarned=!0,console.warn("[seatlayer] initialView:'perspective' (2.5D) is deprecated for the buyer picker and was coerced to 'flat'. Use the Map | 3D control for the immersive view.")),"flat"):e??"flat"}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,t??{})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}getBuyerView(){return Kc(this)}setBuyerView(e,t){Gc(this,e,t)}seatState3dFor(e){return Uc(this,e)}pushAvailabilityTo3d(){qc(this)}syncSelectionTo3d(){Wc(this)}seatViewFor3d(e){return Yc(this,e)}onView3dSeatPick(e){Xc(this,e)}seatViewCaption(e){return Qc(this,e)}saveView3dComparisonSeat(e){Zc(this,e)}clearView3dComparison(){Jc(this)}view3dComparisonSnapshot(e){return ed(this,e)}enter3d(e){return td(this,e)}publish3dTopInset(){id(this)}exit3d(){nd(this)}openSeatConfidencePassport(e,t=null){Nr(this,e,t)}closeSeatConfidencePassport(e=!0){ln(this,e)}openView3dComparison(){Fc(this)}closeView3dComparison(e=!0){Gt(this,e)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e)}async changeHeldTier(e,t){e.disabled=!0;try{let n=await Oc(this.controller,t,e.value,this.opts.holdTtlMs);n&&(this.hold={holdId:n.holdId,expiresAt:n.expiresAt,seats:n.seats,items:n.items},this.startHoldTimer(n.expiresAt),this.emitHoldChange())}catch(n){this.opts.onError?.(n),this.toast(this.tf("picker.ticketTypeNotChanged","That ticket type is not available for this seat. Your hold is unchanged."),"error")}finally{this.syncTray()}}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,n={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,n)}catch(o){this.opts.onError?.(o);let r=Cr(o);if(r)return this.toast(r,"warning"),null;let s=o?.reason,a=s==="not_enough_together"?(0,B.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(a,"error"),null}}async bestAvailableOrThrow(e,t,n={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");let o=Bn(this.controller,t);if(o)throw o;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,{...n,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(),n.preferPremium&&s.seats.length&&!s.seats.every(a=>a.commercial?.premium)&&this.toast((0,B.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(),n=!0;if(t)n=await this.controller.release();else if(e){let o=[...new Set([...(e.items??[]).map(r=>r.label),...(e.seats??[]).map(r=>r.label)])];if(o.length)try{await this.api.release(this.opts.event,o,e.holdId)}catch(r){this.opts.onError?.(r),n=!1}}if(!n){this.toast(this.tf("picker.couldNotReleaseTickets","Couldn't release your tickets. Your hold is unchanged."),"error");return}this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.syncTray(),this.emitHoldChange()}startRealtime(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new Ze({url:()=>this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},onIdleExpired:()=>zl(this.idlePauseHost),sink:ri(this.controller,{flashOnLiveChange:!0,ownLabels:()=>this.holdingLabels,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,n)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:n}),this.syncTray(),this.toast(n==="ineligible"?this.tf("picker.seatNoLongerYours","Some seats are no longer available to you. They have been removed from your order."):this.tf("picker.seatTaken","Someone else took a seat you had picked. It has been removed from your order."),"warning")}})}),this.realtime.start()}async refreshAccess(){return!this.access?.configured||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}clearDecisionSurfaces(){this.dismissConfirm(),this.dismissTableDialog(!1),Je(this,!1)}showAccessPanel(e){if(this.loadAbort&&e.reason==="provider_failed"||this.destroyed||!this.root)return;this.dismissAccessPanel(),this.clearDecisionSurfaces();let t=ha(e.reason,e.reason==="idle"?()=>this.resumeFromIdle():()=>this.recoverAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}async recoverAccess(){return await this.refreshAccess()?!0:(this.opts.onAccessUnavailable||typeof window>"u"||window.location.reload(),!1)}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}get idlePauseHost(){return this}startIdleClock(e){return Fl(this.idlePauseHost,e)}resumeFromIdle(){return $l(this.idlePauseHost)}showHoldExpired(){if(this.destroyed||!this.root||this.holdExpiredEl)return;this.clearDecisionSurfaces();let e=Vd({restart:()=>this.restartAfterHoldExpiry()},this.holdExpiredUnits);this.root.appendChild(e),this.holdExpiredEl=e,requestAnimationFrame(()=>e.querySelector(".sl-interrupt-act")?.focus());let t=this.holdExpiredUnits;this.holdExpiredFresh=!1,this.refreshAvailability().then(()=>{if(this.destroyed||this.holdExpiredEl!==e)return;this.holdExpiredFresh=!0;let n=t.filter(s=>s.objectType!=="ga"),o=[],r=[];for(let s of n){let a=this.controller.seatByLabel(s.label);(a&&this.controller.getStatus(a.id)==="free"?o:r).push(s.label)}Fd(e,{recoverable:o,taken:r,onRecover:s=>this.recoverAfterHoldExpiry(s)})}).catch(()=>{})}recoverAfterHoldExpiry(e){this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.select(e),this.syncTray(),this.handleCta()}dismissHoldExpired(){this.holdExpiredEl?.remove(),this.holdExpiredEl=null}restartAfterHoldExpiry(){let e=this.holdExpiredUnits;this.holdExpiredUnits=[],this.dismissHoldExpired(),this.lapse.clear(),this.clearSelection(),this.controller.overview(),this.syncTray(),this.syncCta(),this.root?.focus({preventScroll:!0});let t=this.holdExpiredFresh;this.holdExpiredFresh=!1,(t?Promise.resolve():this.refreshAvailability()).then(()=>{this.destroyed||Bd({reducedMotion:this.reducedMotion(),accent:this.cssVar("--sl-accent")||"#f4b740",seatByLabel:n=>this.controller.seatByLabel(n),statusOf:n=>this.controller.getStatus(n),flash:(n,o)=>this.controller.flashSeat(n,o)},e)}).catch(()=>{})}destroy(){this.transportAbort.abort(),this.loadAbort?.abort(),this.loadAbort=null,this.destroyed=!0,Ir(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.idleClock?.dispose(),this.idleClock=null,this.dismissAccessPanel(),this.dismissHoldExpired(),this.access?.clear(),this.hold&&!this.handedOff&&this.opts.holdOnClose!=="keep"&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),Je(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerCountdownTimer&&clearTimeout(this.offerCountdownTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerCountdownTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.viewportResizeHandler&&window.removeEventListener("resize",this.viewportResizeHandler),this.viewportResizeHandler=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalCleanup?.(),this.closeModal=null}};function Zd(i){lt.prewarm(i)}var At=require("@seatlayer/core");var Jd="seatlayer-performance-group-picker-style";function ep(){if(document.getElementById(Jd))return;let i=document.createElement("style");i.id=Jd,i.textContent=`
|
|
3556
3564
|
.sl-pg-root{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;min-width:0;max-width:100%;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
|
|
3557
3565
|
.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)}
|
|
3558
3566
|
.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}
|
|
@@ -3612,7 +3620,7 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
3612
3620
|
@media(min-width:900px){.sl-pg-legend-list{justify-content:flex-start}}
|
|
3613
3621
|
.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}
|
|
3614
3622
|
@media(max-width:640px){.sl-pg-head{padding:13px 14px}.sl-pg-head h2{font-size:18px}.sl-pg-inner{min-height:590px}}
|
|
3615
|
-
`,document.head.appendChild(i)}var zm="https://api.seatlayer.io",$m=6e4,jm=2e3,Gm=1e3,Km=36e5,Um=5e3,qm=5e3,Wm=15e3,Ym=12e4,Xm=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),ye=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function Qm(i){return new Promise(e=>setTimeout(e,i))}function $r(i){let e=Number(i.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(Um,e*1e3)):1e3}function Hi(i,e){return`/pub/performance-groups/${encodeURIComponent(i)}/operations/${encodeURIComponent(e)}`}function Ri(i){return i.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var jr=class{constructor(e,t,n){this.api=e;this.sink=t;this.intervalMs=n;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),o=[...new Set([...this.prior.keys(),...t.keys()])].filter(r=>this.prior.get(r)!==t.get(r)).map(r=>({label:r,status:t.get(r)??"blocked"}));this.prior=t,o.length&&this.sink.applyStatuses(o),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof ye){this.stop();return}if(jn(e)){this.stop(),this.api.sessionEnded(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Io=class{constructor(e,t){this.descriptorCache=null;this.chartRequest=null;this.objectsCache=null;this.objectsEtag=null;this.activePerformanceKey=null;this.includedEventKeys=new Set;this.reuseObjectsCacheOnce=!1;this.selectionsByEvent=new Map;this.allocationsByHold=new Map;this.pendingOperationId=null;this.operationByHold=new Map;this.knownRevision=null;this.destroyed=!1;this.aborter=new AbortController;this.adoptFailure=null;this.settleTimer=null;this.settleOperationId=null;this.settleStartedAt=0;this.settleState=null;this.settleVisibility=null;this.lastRecovery={kind:"idle"};if(!e)throw new Error("seatlayer: `performanceGroup` key is required");this.groupKey=e,this.base=(t.apiBase??zm).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??$m,this.realtimePollMs=Math.max(500,t.realtimePollMs??jm),this.selectionMode=t.selectionMode??"same_seat",this.partySize=t.partySize??null,this.onOperationState=t.onOperationState,this.onRecoveryState=t.onRecoveryState,this.onAvailability=t.onAvailability,this.onSessionEnded=t.onSessionEnded,this.access.onRenewed(o=>this.adoptSession(o));let n=this.readOperationRecord();n&&this.storedIsUndecided(n)&&(this.pendingOperationId=n.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}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(o=>{throw this.chartRequest=null,o});let[t,n]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:n,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new ie(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",n=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let s=await this.authorized(n,this.objectsCache&&this.objectsEtag?{headers:{"If-None-Match":this.objectsEtag}}:{});if(s.status===304)this.objectsCache||(this.objectsEtag=null);else{if(!s.ok)return this.throwResponse(s);this.objectsCache=await this.responseJson(s),this.objectsEtag=s.headers.get("ETag")}}if(!this.objectsCache)throw new ie(502,"group_projection_unavailable","group_projection_unavailable");if(this.selectionMode==="same_seat"&&!t){let s=this.objectsCache;return this.noteAvailability(s,s.salesClosed,s),s}let o=this.objectsCache;if(this.selectionMode==="same_seat"){let s=o.performances.filter(p=>this.includedEventKeys.has(p.eventKey));if(!s.length)throw new ie(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(s[0]?.seats??{}),l=Object.fromEntries(a.map(p=>[p,s.every(u=>u.seats[p]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(p=>{let u=s.filter(h=>h.seats[p]!=="free").map(h=>h.eventKey);return u.length>0&&u.length<s.length?[[p,u]]:[]})),d={seats:l,partial:c,hidden:[...new Set(s.flatMap(p=>p.hidden??[]))],closed:[...new Set(s.flatMap(p=>p.closed??[]))],revision:o.revision,state:o.state,salesClosed:s.some(p=>p.salesClosed)};return this.noteAvailability(o,d.salesClosed,d),d}let r=o.performances.find(s=>s.eventKey===this.activePerformanceKey);if(!r)throw new ie(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(o,o.salesClosed||o.performances.some(s=>s.salesClosed),r),r}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new ie(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=null,this.objectsEtag=null,this.selectionsByEvent.clear(),this.activePerformanceKey=this.descriptorCache?.performances[0]?.eventKey??this.activePerformanceKey)}setActivePerformance(e){if(this.descriptorCache&&!this.descriptorCache.performances.some(t=>t.eventKey===e))throw new ie(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(n=>n.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(n=>!t.has(n)))throw new ie(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(n=>({...n})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(n=>({...n}))}))}async hold(e,t,n,o){if(this.assertUsable(),o)throw new ie(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let r=t.map(c=>c.label),s={labels:r};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(s.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new ie(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 ie(409,"group_selection_incomplete","group_selection_incomplete");s={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,...s,...n?{ttlMs:n}:{}})})}catch(c){if(c instanceof ye)throw c;if(c instanceof he)throw this.failOperation(a),c;return this.recover(a,r,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,r,Date.now()+this.recoveryTimeoutMs,$r(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,r,Date.now()+this.recoveryTimeoutMs,$r(l))}}try{return await this.throwResponse(l,r)}catch(c){throw this.failOperation(a),c}}async release(e,t,n){this.assertUsable();let o=this.operationForHold(n),r=await this.json(`${Hi(this.groupKey,o)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(n),this.allocationsByHold.delete(n),this.clearOperationRecord(),r}async resume(e,t){this.assertUsable();let n=this.operationForHold(t),o=await this.json(Hi(this.groupKey,n));return this.complete(o.operation)}async extend(e,t,n=12e4){this.assertUsable();let o=this.operationForHold(t),r=Math.max(Gm,Math.min(Km,Math.round(n))),s=await this.json(`${Hi(this.groupKey,o)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:r})}),a=this.complete(s.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}async paymentOptions(){let e=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/payment-options`);return e.status===409?null:e.ok?this.responseJson(e):this.throwResponse(e)}async checkout(e){return this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/checkout`,{method:"POST",body:JSON.stringify(e)})}async orderStatus(e){let t=await this.fetcher(`${this.base}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit",signal:this.aborter.signal});return t.ok?t.json():this.throwResponse(t)}bestAvailable(){return Promise.reject(new ie(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new jr(this,t,this.realtimePollMs)}sessionEnded(e){this.destroyed||this.onSessionEnded?.(e)}operationIdForHold(e){return this.operationByHold.get(e)??this.readMapping(e)}rememberOperation(e,t){!e||!t||(this.operationByHold.set(e,t),this.writeMapping(e,t))}async restoreOperation(){let e=this.readOperationRecord();if(!e)return null;if(!this.storedIsUndecided(e)&&e.state!=="committed"&&e.state!=="booked")return this.clearOperationRecord(),null;this.pendingOperationId=e.operationId,this.emitRecovery({kind:"pending",operationId:e.operationId,phase:e.state==="undecided"?"unknown":e.state,longRunning:!1,reference:Ri(e.operationId)});let t;try{t=await this.authorized(Hi(this.groupKey,e.operationId))}catch(r){return r instanceof ye||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let n=await this.responseJson(t);this.emit(n.operation);let o=n.operation.state;return o==="committed"||o==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(n.operation)):o==="aborted"||o==="expired"?(this.failOperation(e.operationId),null):this.recover(e.operationId,[],Date.now()+this.recoveryTimeoutMs)}async retryRecovery(){this.assertUsable();let e=this.pendingOperationId??this.readOperationRecord()?.operationId??null;return e?(this.pendingOperationId=e,this.recover(e,[],Date.now()+this.recoveryTimeoutMs)):null}watchSettlement(e){if(this.destroyed)return;let t=this.operationIdForHold(e);!t||t===this.settleOperationId||(this.stopSettlementWatch(),this.settleOperationId=t,this.settleStartedAt=Date.now(),this.settleState="committed",typeof document<"u"&&(this.settleVisibility=()=>{document.hidden||!this.settleOperationId||this.pollSettlement()},document.addEventListener("visibilitychange",this.settleVisibility)),this.scheduleSettlementPoll())}stopSettlementWatch(){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null,this.settleOperationId=null,this.settleState=null,this.settleVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",this.settleVisibility),this.settleVisibility=null}scheduleSettlementPoll(){if(this.destroyed||!this.settleOperationId)return;if(this.settleTimer&&clearTimeout(this.settleTimer),typeof document<"u"&&document.hidden){this.settleTimer=null;return}let t=Date.now()-this.settleStartedAt>=Ym?Wm:qm;this.settleTimer=setTimeout(()=>{this.pollSettlement()},t)}settled(e){return e==="booked"||e==="expired"||e==="aborted"}async pollSettlement(){let e=this.settleOperationId;if(this.destroyed||!e)return;if(typeof document<"u"&&document.hidden){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null;return}let t;try{let o=await this.authorized(Hi(this.groupKey,e));if(!o.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(o)).operation}catch(o){return o instanceof ye?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let n=t.state!==this.settleState;if(this.settleState=t.state,n&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}n&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||Xm.has(e.state)}writeOperationRecord(e){try{window.sessionStorage.setItem(this.operationRecordKey(),JSON.stringify(e))}catch{}}clearOperationRecord(){try{window.sessionStorage.removeItem(this.operationRecordKey())}catch{}}beginOperation(e){this.pendingOperationId=e;let t=this.readOperationRecord();this.writeOperationRecord({operationId:e,groupKey:this.groupKey,state:"undecided",createdAt:t?.operationId===e?t.createdAt:Date.now()})}noteOperationState(e,t){let n=this.readOperationRecord();!n||n.operationId!==e||this.writeOperationRecord({...n,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let o=0;o<2;o++){if(this.destroyed)return;try{if((await this.fetcher(`${this.base}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit",signal:this.aborter.signal})).ok){this.adoptFailure=null;return}}catch{}}if(this.destroyed)return;this.adoptFailure=new ie(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let n=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:n,reference:n?Ri(n):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,n,o=100){let r=o,s=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=n;){if(this.destroyed)throw new ye;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=s,reference:Ri(e)}),await Qm(r),this.destroyed)throw new ye;let l;try{l=await this.authorized(Hi(this.groupKey,e))}catch(p){if(p instanceof ye)throw p;if(p instanceof he)throw this.recoveryFailed(e,"request_failed"),p;r=Math.min(2e3,Math.max(100,r*2));continue}if(l.status===404){r=Math.min(1e3,Math.max(100,r*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 ie(409,"conflict","conflict",t.map(p=>({label:p,status:"held"})));r=$r(l)}throw this.recoveryFailed(e,"deadline"),new ie(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:Ri(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,n){if(this.destroyed||!this.onAvailability)return;let o=e.state??this.descriptorCache?.state??"active",r=e.revision??null,s=!!r&&!!this.knownRevision&&r!==this.knownRevision;r&&!this.knownRevision&&(this.knownRevision=r);let a=n?.partial??{},l=Object.values(n?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(n?.seats??{}).filter(c=>n.seats[c]!=="free"&&!(c in a)).length,state:o,salesClosed:!!t||o!=="active",revision:r,revisionChanged:s})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new ie(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let n=t.find(o=>o.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:n??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new ie(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 ye;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},n=!1){if(this.destroyed)throw new ye;if(this.adoptFailure)throw this.adoptFailure;let o={...t.headers};t.body!==void 0&&(o["Content-Type"]="application/json");let r=await this.access.authorization(n?"unauthorized":"initial");if(this.destroyed)throw new ye;if(this.adoptFailure)throw this.adoptFailure;if(!r)throw new Error("performance_group_buyer_access_required");o.Authorization=r;let s=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:o,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!n&&(s.status===401||s.status===403||s.status===422)){let a=await s.clone().json().catch(()=>null);if(await this.access.handleFailure(s.status,a?.code??a?.error,r))return this.authorized(e,t,!0)}return s}async json(e,t={}){let n=await this.authorized(e,t);return n.ok?this.responseJson(n):this.throwResponse(n)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let o=await e.json().catch(()=>null)??{},r=o.code??o.error??`request_failed_${e.status}`;throw e.status===409&&!o.conflicts?.length&&t.length&&(o.conflicts=t.map(s=>({label:s,status:"held"}))),new ie(e.status,o.error??r,r,o.conflicts)}};var Yd=require("@seatlayer/core");var Ii,qt,Tt,Oi,cn,Et,Xd,Oo,_o=class{constructor(e){this.options=e;R(this,Et);R(this,Ii,null);R(this,qt,!1);R(this,Tt,null);R(this,Oi,!1);R(this,cn,!1)}get mode(){return m(this,qt)?"hosted":"handoff"}async prepare(){try{S(this,Ii,await this.options.api.paymentOptions()),S(this,qt,!!m(this,Ii))}catch(e){S(this,qt,!1),this.options.onError?.(e)}}async open(e,t){if(!m(this,qt)||m(this,Oi))return;if(t.selectionMode!=="same_seat"){this.options.announce(y("picker.group.hostedPerPerformance","Seats chosen night by night can\u2019t be paid for on this page yet. Choose one seat for every date instead."));return}let n=m(this,Ii),o=t.seatLabels.length;if(n.bookingMode==="paid"&&!n.providers.length){await x(this,Et,Oo).call(this,e,t.descriptor,{kind:"unavailable",reason:n.reason==="unavailable_for_run"?"unavailable_for_event":"not_configured",seatCount:o});return}S(this,Oi,!0);try{let{total:r,currency:s,lines:a}=x(this,Et,Xd).call(this,t.holdId,t.descriptor);await x(this,Et,Oo).call(this,e,t.descriptor,{kind:"pay",provider:null,free:n.bookingMode==="free",order:{holdId:t.operationId,expiresAt:t.expiresAt,currency:s,total:r,labels:[...t.seatLabels],lines:a}})}finally{S(this,Oi,!1)}}resume(e,t,n){let o=Li(t);o?.outcome!=="success"||!o.orderId||x(this,Et,Oo).call(this,e,n,{kind:"resume",orderId:o.orderId})}destroy(){S(this,cn,!0),m(this,Tt)?.destroy(),S(this,Tt,null)}};Ii=new WeakMap,qt=new WeakMap,Tt=new WeakMap,Oi=new WeakMap,cn=new WeakMap,Et=new WeakSet,Xd=function(e,t){let n=this.options.api.allocationsForHold(e),o=n.flatMap(a=>a.items)[0]?.currency??t.currency,r=0,s=n.map(a=>{let l=a.items.reduce((d,p)=>d+Math.round(p.unitPrice*100)*(p.quantity??1),0);r+=l;let c=t.performances.find(d=>d.eventKey===a.eventKey);return{label:a.items.map(d=>d.label).join(", "),detail:c?Ci(c,this.options.locale):null,amount:l/100}});return{total:r/100,currency:o,lines:s}},Oo=async function(e,t,n){let o;try{({mountCheckout:o}=await li())}catch(s){this.options.onError?.(s),this.options.announce(y("picker.group.checkoutCouldNotOpen","Checkout could not be opened. Your seats are still held. Please try again."));return}if(m(this,cn)||!e)return;m(this,Tt)?.destroy();let r=this.options.api;S(this,Tt,o({root:e,state:n,eventKey:r.groupKey,event:{name:t.name,detail:y("picker.group.checkoutDates","{count} dates, one seat each").replace("{count}",String(t.performanceCount))},formatMoney:(s,a)=>(0,Yd.formatMoney)(s,a,{locale:this.options.locale,fallback:(l,c)=>`${l} ${c}`,...Number.isInteger(s)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:async s=>{let a=await r.checkout({operationId:s.holdId,buyerEmail:s.buyerEmail,...s.buyerName?{buyerName:s.buyerName}:{},...this.options.returnUrl?{returnUrl:this.options.returnUrl}:{}});return{orderId:a.orderId,totalMinor:a.totalMinor??0,currency:a.currency??t.currency,expiresAt:a.expiresAt??0,...a.redirectUrl?{redirectUrl:a.redirectUrl}:{},...a.status==="confirmed"?{status:"confirmed"}:{}}},orderStatus:s=>r.orderStatus(s),onCancel:()=>{S(this,Tt,null)},onConfirmed:s=>this.options.onConfirmed?.(s),onError:s=>this.options.onError?.(s)}))};var Zm={audience_not_public:"audience_not_public",sales_not_open:"sales_not_open",invalid_origin:"origin_not_allowed"},Jm=3e4;function ef(i,e){if(!i||typeof i!="object"||Array.isArray(i))return!1;let t=i;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.performanceGroupKey===e}var Gr=class extends Error{constructor(t,n){super(`performance_group_public_session_refused:${t}`);this.reason=t;this.status=n;this.name="PerformanceGroupPublicSessionRefused"}},ct,Ct,dn,_i,Kr=class{constructor(e){this.options=e;R(this,ct,null);R(this,Ct,null);R(this,dn);R(this,_i);S(this,dn,e.fetch??globalThis.fetch.bind(globalThis)),S(this,_i,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return m(this,ct)}async mint(e=!1){if(e&&S(this,ct,null),m(this,ct)&&m(this,ct).expiresAt-Jm>Date.now())return m(this,ct);if(m(this,Ct))return m(this,Ct);let t=(async()=>{let n=await m(this,dn).call(this,`${this.options.base}/pub/performance-groups/${encodeURIComponent(this.options.performanceGroup)}/sessions`,{method:"POST",body:JSON.stringify(m(this,_i)?{origin:m(this,_i)}:{}),credentials:"omit"}),o=await n.json().catch(()=>null);if(!n.ok){let r=o?.code??o?.error,s=n.status===403&&r?Zm[r]:void 0;throw s?(this.options.onRefused?.({reason:s,code:r,status:n.status,retryable:s==="sales_not_open"}),new Gr(s,n.status)):new Error(`performance_group_public_session_failed_${n.status}`)}if(!ef(o,this.options.performanceGroup))throw new Error("performance_group_public_session_invalid");return S(this,ct,o),o})();S(this,Ct,t);try{return await t}finally{m(this,Ct)===t&&S(this,Ct,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.mint(t);return{token:n.token,expiresAt:n.expiresAt}}};ct=new WeakMap,Ct=new WeakMap,dn=new WeakMap,_i=new WeakMap;function Qd(i){let e=new Kr(i);return{access:new De({provider:({reason:n})=>e.token(n),...i.accessHooks}),loader:e}}var Zd="https://api.seatlayer.io";function Jd(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var No=class{constructor(e){this.descriptorValue=null;this.picker=null;this.root=null;this.innerHost=null;this.tabsHost=null;this.prevButton=null;this.nextButton=null;this.heldSummary=null;this.live=null;this.statusHost=null;this.statusCopy=null;this.statusAction=null;this.rendered=!1;this.destroyed=!1;this.continued=!1;this.switchingPerformance=!1;this.operationPending=!1;this.recovery={kind:"idle"};this.availability=null;this.activePerformanceKey=null;this.selectionsByEvent=new Map;this.validByEvent=new Map;this.refreshingComposition=!1;this.activeHandoff=null;this.selectionModeValue="same_seat";this.progressHost=null;this.legendHost=null;this.paneHost=null;this.datesSummaryHost=null;this.datesCardsHost=null;this.resettingFlexibleSelection=!1;this.selectingPartialSeat=!1;this.partialSeatDates=new Map;this.markedLabels=new Set;this.holdTicker=null;this.switchingMode=!1;this.booked=!1;this.refusal=null;if(!e||typeof e!="object")throw new Error("seatlayer: options object is required");if(!e.performanceGroup)throw new Error("seatlayer: `performanceGroup` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!!e.initialHoldId!=!!e.initialOperationId)throw new Error("seatlayer: `initialHoldId` and `initialOperationId` must be supplied together");if((e.selectionMode==="per_performance"||e.allowSelectionModeSwitch)&&(!Number.isSafeInteger(e.numberOfPlacesToSelect)||(e.numberOfPlacesToSelect??0)<1))throw new Error("seatlayer: `numberOfPlacesToSelect` is required for per-performance selection");this.selectionModeValue=e.selectionMode??"same_seat",this.options=e,this.panelId=`sl-pg-panel-${e.performanceGroup}`;let t=n=>{this.refusal=this.refusal&&n.reason==="provider_failed"?this.refusal:n,e.onAccessUnavailable?.(this.refusal)};this.access=e.buyerAccessToken||e.buyerAccessTokenProvider?new De({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:t}):Qd({base:(e.apiBase??Zd).replace(/\/$/,""),performanceGroup:e.performanceGroup,onRefused:n=>{this.refusal=n},accessHooks:{onExpired:e.onAccessExpired,onUnavailable:t}}).access,this.api=new Io(e.performanceGroup,{apiBase:e.apiBase,access:this.access,selectionMode:e.selectionMode,partySize:e.selectionMode==="per_performance"?e.numberOfPlacesToSelect:void 0,onOperationState:n=>this.operationChanged(n),onRecoveryState:n=>this.recoveryChanged(n),onAvailability:n=>this.availabilityChanged(n),onSessionEnded:n=>this.sessionEnded(n)}),e.initialHoldId&&e.initialOperationId&&this.api.rememberOperation(e.initialHoldId,e.initialOperationId),this.hosted=e.checkout==="hosted"?new _o({api:this.api,locale:e.locale,returnUrl:e.returnUrl,announce:n=>this.showStatus("checkout",n),onConfirmed:n=>e.onOrderConfirmed?.(n),onError:e.onError}):null}get checkoutMode(){return this.hosted?.mode??"handoff"}get mode(){return this.selectionModeValue}get selectionMode(){return this.selectionModeValue}get descriptor(){return this.descriptorValue}get currentHold(){return this.activeHandoff}async render(){if(this.rendered)return this;let e=performance.now();if(this.rendered=!0,Wd(),await(0,At.loadLocale)(this.options.locale),this.options.messages&&(0,At.setStringOverrides)(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(n){throw Ze({apiBase:this.options.apiBase??Zd,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:st(this.options.performanceGroup),transport:"pubapi"}),n instanceof he&&this.refusal?new he(this.refusal):n}return await this.hosted?.prepare(),this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(Jd(this.options.container),t),this.announce(this.copy("picker.group.checkingAvailability")),await this.mountPicker(t),this.destroyed?this:(await this.restoreOperation(),this.destroyed||this.hosted?.resume(this.picker?.root??null,t.key,t),this))}buildChrome(e,t){e.replaceChildren();let n=document.createElement("div");n.className="sl-pg-root",n.dataset.performanceGroup=t.key,n.dataset.selectionMode=this.mode;let o=document.createElement("div");o.className="sl-pg-progress";let r=document.createElement("section");r.className="sl-pg-head",r.setAttribute("aria-labelledby",`sl-pg-title-${t.key}`);let s=document.createElement("h2");s.id=`sl-pg-title-${t.key}`,s.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=Mr(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.hidden=a.hidden=c.hidden=this.options.header===!1,r.append(s,a,l,c,u);let h=document.createElement("div");h.className="sl-pg-legend";let b=document.createElement("div");b.className="sl-pg-pane",b.setAttribute("role","group"),b.setAttribute("aria-label",this.copy("picker.group.yourSelection")),b.hidden=!0;let g=this.mode==="per_performance"?this.performanceTabs(t):null,T=document.createElement("div");T.className="sl-pg-inner",T.id=this.panelId,T.setAttribute("aria-busy","false"),T.dataset.locked="false",this.mode==="per_performance"&&(T.setAttribute("role","tabpanel"),T.tabIndex=-1);let w=document.createElement("div");w.className="sl-pg-status",w.setAttribute("role","status"),w.setAttribute("aria-live","polite"),w.hidden=!0;let v=document.createElement("p"),M=document.createElement("button");M.type="button",M.hidden=!0,M.textContent=this.copy("picker.group.retry"),M.addEventListener("click",()=>{this.retryRecovery()}),w.append(v,M),T.appendChild(w);let B=document.createElement("div");B.className="sl-pg-live",B.setAttribute("role","status"),B.setAttribute("aria-live","polite"),n.append(o,r),g&&n.append(g),n.append(h,T,b,B),e.appendChild(n),this.root=n,this.progressHost=o,this.legendHost=h,this.paneHost=b,this.datesSummaryHost=d,this.datesCardsHost=p,this.innerHost=T,this.heldSummary=u,this.live=B,this.statusHost=w,this.statusCopy=v,this.statusAction=M,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new lt(Ho({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(n,o)=>{try{this.options.onAnalytics?.(n,{...o,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:n=>this.selectionChanged(n),onSelectionValidityChange:n=>this.selectionValidityChanged(n),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(n,o)=>this.holdChanged(n,o),onCheckout:(n,o)=>this.checkout(n,o),onHoldExpired:()=>{this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()},onError:this.options.onError},{performanceCount:e.performanceCount,selectionMode:this.mode,submissionState:()=>this.submissionState(),suppressPricing:!0,nights:()=>this.nights(),seatMarks:()=>this.seatMarks(),nightSummary:()=>this.nightSummary(),groupSelectionSummary:()=>this.groupSelectionSummary(),activePerformanceLabel:()=>this.activePerformanceLabel(),selectedPerformanceDates:()=>this.mode==="same_seat"&&e.inclusionMode==="flexible_dates"?Vl(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:n=>{this.switchPerformance(n)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),activate:(n,o)=>{this.selectPartialSeat(n,o)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:n=>this.partialSeatDates.get(n)??this.nights().map(o=>o.eventKey),label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),apply:(n,o)=>this.applySeatDates(n,o,!0)}:null}));this.picker=t,await t.render(),!this.destroyed&&this.updateTabs()}performanceCards(e){return e.performances.map(t=>({eventKey:t.eventKey,name:t.name,iso:new Date(t.startsAt).toISOString(),date:vo(t,this.options.locale),time:wo(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:Ci(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,n=!!t?.salesClosed||!!t&&t.state!=="active",o=this.mode==="same_seat"&&!n?t?.partial??{}:{},r={};for(let s of this.markedLabels)r[s]=null;if(this.markedLabels.clear(),e>0)for(let[s,a]of Object.entries(o))!a.length||a.length>=e||(r[s]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(s));return r}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!e)return null;let t=Ci(e,this.options.locale),n=e.name?.trim();return n&&n!==t?`${n} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:Ci(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 r=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:r*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:r?e.length:0,perPerformance:r}}let t=e.map(r=>this.selectionsByEvent.get(r.eventKey)?.length??0),n=t.filter(r=>r>0),o=n.length===t.length&&n.every(r=>r===n[0]);return{seats:t.reduce((r,s)=>r+s,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:n.length,perPerformance:o&&n.length?n[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=Xl(t,{label:this.copy("picker.group.progressLabel"),done:this.copy("picker.group.stepDone"),current:this.copy("picker.group.stepCurrent"),upcoming:this.copy("picker.group.notStarted")})}syncLegend(){if(!this.legendHost)return;let e=this.availability,t=!!e?.salesClosed||e&&e.state!=="active";if(!e||t){this.legendHost.replaceChildren();return}this.legendHost.innerHTML=$l({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let n=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(r=>r.label)??[],o=this.heldTotal();e.hidden=!1,e.innerHTML=Ql({title:this.copy("picker.group.yourSelection"),rows:t.map(r=>({eventKey:r.eventKey,name:`${vo(r,this.options.locale)} ${wo(r,this.options.locale)}`,labels:n})),empty:this.copy("picker.group.noSeatsChosenYet"),note:o?null:this.copy("picker.group.pricesPerPerformance"),total:o?{label:this.copy("picker.group.total"),amount:o}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:Zl(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let o=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!o.length)return null;let r=o.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),s=o[0]?.currency??t.currency;try{return(0,At.formatMoney)(r,s,void 0,this.options.locale)}catch{return`${s} ${r.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(n=>t.has(n.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),n=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=n&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(n?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=Mr(this.performanceCards({...e,performances:t}),this.copy(n&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":n?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,n){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let o=this.api.includedPerformanceKeys();if(o.length===t.length&&o.every(r=>t.includes(r)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(n?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(r){return o.length&&(this.api.setIncludedEventKeys(o),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(r),!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(Jd(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 ye)return;this.options.onError?.(t)}finally{this.switchingMode=!1}}}async release(){await this.picker?.release()}close(){this.destroy()}destroy(){if(this.destroyed)return;this.destroyed=!0,this.api.destroy(),this.hosted?.destroy(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.picker;this.root?.setAttribute("hidden","");let t=()=>{e?.destroy(),this.access.clear(),this.root?.remove(),this.root=null,this.picker=null,this.innerHost=null,this.tabsHost=null,this.statusHost=null,this.statusCopy=null,this.statusAction=null,this.live=null};e?.getCurrentHold()&&!this.continued?e.release().catch(()=>{}).finally(t):t()}copy(e,t){let n=this.options.messages?.[e];return n!==void 0?t?n.replace(/\{(\w+)\}/g,(o,r)=>String(t[r]??`{${r}}`)):n:(0,At.t)(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let n=document.createElement("button");n.type="button",n.className="sl-pg-step",n.dataset.step="previous",n.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),n.textContent="\u2039",n.addEventListener("click",()=>{this.stepPerformance(-1)});let o=document.createElement("button");o.type="button",o.className="sl-pg-step",o.dataset.step="next",o.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),o.textContent="\u203A",o.addEventListener("click",()=>{this.stepPerformance(1)});let r=document.createElement("div");return r.className="sl-pg-tabs",r.setAttribute("role","tablist"),r.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((s,a)=>{let l=document.createElement("button");l.type="button",l.className="sl-pg-tab",l.id=`sl-pg-tab-${e.key}-${s.eventKey}`,l.dataset.eventKey=s.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=s.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(s.eventKey)}),l.addEventListener("keydown",u=>this.tabKeydown(u)),r.appendChild(l)}),t.append(n,r,o),this.tabsHost=r,this.prevButton=n,this.nextButton=o,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),n=t.findIndex(a=>a===e.target);if(n<0)return;let o=getComputedStyle(this.tabsHost??document.body).direction==="rtl",r=-1;switch(e.key){case"ArrowRight":r=n+(o?-1:1);break;case"ArrowLeft":r=n+(o?1:-1);break;case"ArrowDown":r=n+1;break;case"ArrowUp":r=n-1;break;case"Home":r=0;break;case"End":r=t.length-1;break;default:return}if(r<0||r>=t.length)return;e.preventDefault();let s=t[r];s.focus({preventScroll:!0}),s.disabled||this.switchPerformance(s.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),n=t.findIndex(r=>r.dataset.eventKey===this.activePerformanceKey),o=t[n+e];!o||o.disabled||(o.focus({preventScroll:!0}),this.switchPerformance(o.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let o=!this.holdBlocked();return{complete:e.length,total:e.length,ready:o}}let t=this.options.numberOfPlacesToSelect,n=e.filter(o=>this.selectionsByEvent.get(o.eventKey)?.length===t&&this.validByEvent.get(o.eventKey)!==!1).length;return{complete:n,total:e.length,ready:n===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(n=>n.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(n=>this.options.onError?.(n)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(n=>({...n}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(n=>({label:n.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,n=(this.selectionsByEvent.get(e)??[]).map(r=>r.label),o=this.copy("picker.group.chosenOfTotal",{chosen:n.length,total:t});return n.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:o}:n.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:n.join(", ")}),badge:o}:n.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:o}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-n.length}),badge:o}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(o=>{let r=o.dataset.eventKey,s=this.tabState(r),a=r===this.activePerformanceKey;o.dataset.state=s.key,o.disabled=t,o.setAttribute("aria-selected",String(a)),o.tabIndex=a?0:-1;let l=o.querySelector(".sl-pg-tab-state");l&&(l.textContent=s.label);let c=o.querySelector(".sl-pg-tab-badge");c&&(c.textContent=s.badge);let d=o.querySelector(".sl-pg-tab-name")?.textContent??r;o.setAttribute("aria-label",`${d}: ${s.badge} \xB7 ${s.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",o.id)});let n=e.findIndex(o=>o.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||n<=0),this.nextButton&&(this.nextButton.disabled=t||n<0||n>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(n=>n.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let n=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(n),n.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(n);let o=this.descriptorValue?.performances.find(r=>r.eventKey===e);o&&this.announce(this.copy("picker.group.performanceOpened",{performance:o.name}))}catch(n){this.options.onError?.(n)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,n={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!n.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...n.reference?{reference:n.reference}:{}})}sessionEnded(e){this.destroyed||(this.showStatus("session_ended",this.copy("picker.accessExpiredTitle")),this.options.onError?.(e))}clearStatus(){this.statusHost&&(this.statusHost.hidden=!0),this.statusAction&&(this.statusAction.hidden=!0),this.options.onStatusChange?.({kind:"idle",message:""})}operationChanged(e){if(this.destroyed)return;let t=e.state==="preparing"||e.state==="commit_pending"||e.state==="abort_pending"||e.state==="expire_pending";if(this.operationPending=t,this.setInteractionLocked(t||this.recovery.kind!=="idle"),this.updateTabs(),t){this.showStatus("pending",this.copy(e.state==="commit_pending"?"picker.group.commitPending":e.state==="abort_pending"||e.state==="expire_pending"?"picker.group.abortPending":"picker.group.securing"));return}if(e.state==="booked"){this.bookingSettled();return}if(e.state==="expired"||e.state==="aborted"){this.activeHandoff&&this.holdLost();return}if(e.state==="committed"){this.clearStatus(),this.announce(this.copy("picker.group.secured")),queueMicrotask(()=>this.innerHost?.querySelector('[data-ref="cta"]')?.focus({preventScroll:!0}));return}e.decision==="abort"&&this.recovery.kind==="idle"&&(this.clearStatus(),this.announce(this.copy("picker.group.notSecured")))}bookingSettled(){if(this.booked)return;this.booked=!0,this.root&&(this.root.dataset.booking="booked"),this.clearStatus(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.activeHandoff?{...this.activeHandoff,bookingState:"booked"}:null;e&&(this.activeHandoff=e),this.syncProgress(),this.syncPane(),this.updateTabs(),this.picker?.notifyGroupSettled("booked"),this.announce(this.copy("picker.group.bookedAll",{count:this.descriptorValue?.performanceCount??0})),e&&this.options.onBooked?.(e)}holdLost(){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.picker?.notifyGroupSettled("lost"),this.announce(this.copy("picker.group.notSecured")),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()}recoveryChanged(e){if(!this.destroyed){if(this.recovery=e,this.setInteractionLocked(this.operationPending||e.kind!=="idle"),this.updateTabs(),this.refreshComposition(),e.kind==="idle"){this.operationPending||this.clearStatus();return}if(e.kind==="pending"){this.showStatus("pending",e.longRunning?this.copy("picker.group.longRunning",{reference:e.reference}):this.copy("picker.group.outcomeUnknown"),{reference:e.reference});return}this.showStatus("recovery_failed",this.copy("picker.group.longRunning",{reference:e.reference}),{retry:e.retryable,reference:e.reference}),this.setInteractionLocked(!1)}}async retryRecovery(){if(!(this.destroyed||this.recovery.kind!=="failed"||!this.recovery.retryable))try{await this.api.retryRecovery()}catch(e){if(e instanceof ye)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 ye)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 ye)return;this.options.onError?.(t)}}handoff(e,t){let n=this.descriptorValue,o=this.api.operationIdForHold(e.holdId);if(!n||!o)throw new Error("seatlayer: Performance Group hold identity is unavailable");let r=this.api.allocationsForHold(e.holdId);return{operationId:o,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:n,selectionMode:this.mode,performanceKeys:r.map(s=>s.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(s=>s.label),...this.mode==="per_performance"?{allocations:r.map(s=>({eventKey:s.eventKey,seatLabels:s.items.map(a=>a.label)}))}:{}}}renderHeldAllocations(e){if(!(!this.heldSummary||this.mode!=="per_performance")){this.heldSummary.replaceChildren();for(let t of e){let n=this.descriptorValue?.performances.find(s=>s.eventKey===t.eventKey),o=document.createElement("p"),r=document.createElement("strong");r.textContent=n?.name??t.eventKey,o.append(r,document.createTextNode(t.items.map(s=>s.label).join(", "))),this.heldSummary.appendChild(o)}this.heldSummary.hidden=e.length===0}}resetPerPerformanceSelection(){this.mode==="per_performance"&&(this.selectionsByEvent.clear(),this.validByEvent.clear(),this.heldSummary?.replaceChildren(),this.heldSummary&&(this.heldSummary.hidden=!0),this.updateTabs(),this.picker?.refreshPerformanceGroupComposition())}holdChanged(e,t){if(!e){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null);return}let n=this.handoff(e,t),o=this.activeHandoff?.holdId!==n.holdId;this.activeHandoff=n,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),o&&this.options.onHold?.(n),this.options.onHoldChange?.(n)}checkout(e,t){let n=this.handoff(e,t);this.continued=!0,this.activeHandoff=n,this.options.onCheckout?.(n),this.hosted?.mode==="hosted"&&this.descriptorValue&&this.hosted.open(this.picker?.root??null,{...n,descriptor:this.descriptorValue})}};var Gi=require("@seatlayer/core");var ep="seatlayer-season-picker-style";function tp(){if(document.getElementById(ep))return;let i=document.createElement("style");i.id=ep,i.textContent=`
|
|
3623
|
+
`,document.head.appendChild(i)}var tf="https://api.seatlayer.io",nf=6e4,of=2e3,rf=1e3,sf=36e5,af=5e3,lf=5e3,cf=15e3,df=12e4,pf=new Set(["preparing","commit_pending","abort_pending","expire_pending"]),ye=class extends Error{constructor(){super("performance_group_destroyed"),this.name="PerformanceGroupDestroyedError"}};function hf(i){return new Promise(e=>setTimeout(e,i))}function zr(i){let e=Number(i.headers.get("Retry-After")??"1");return Number.isFinite(e)?Math.max(50,Math.min(af,e*1e3)):1e3}function Hi(i,e){return`/pub/performance-groups/${encodeURIComponent(i)}/operations/${encodeURIComponent(e)}`}function Ri(i){return i.replace(/^pghop_/,"").replace(/-/g,"").slice(-8).toUpperCase()}var jr=class{constructor(e,t,n){this.api=e;this.sink=t;this.intervalMs=n;this.stopped=!0;this.timer=null;this.prior=new Map}start(){this.stopped&&(this.stopped=!1,this.tick())}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){try{let e=await this.api.objects(this.api.groupKey);if(this.stopped)return;let t=new Map(Object.entries(e.seats)),o=[...new Set([...this.prior.keys(),...t.keys()])].filter(r=>this.prior.get(r)!==t.get(r)).map(r=>({label:r,status:t.get(r)??"blocked"}));this.prior=t,o.length&&this.sink.applyStatuses(o),this.sink.onSections?.(e.hidden??[],e.closed??[])}catch(e){if(e instanceof ye){this.stop();return}if(Un(e)){this.stop(),this.api.sessionEnded(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Oo=class{constructor(e,t){this.descriptorCache=null;this.chartRequest=null;this.objectsCache=null;this.objectsEtag=null;this.activePerformanceKey=null;this.includedEventKeys=new Set;this.reuseObjectsCacheOnce=!1;this.selectionsByEvent=new Map;this.allocationsByHold=new Map;this.pendingOperationId=null;this.operationByHold=new Map;this.knownRevision=null;this.destroyed=!1;this.aborter=new AbortController;this.adoptFailure=null;this.settleTimer=null;this.settleOperationId=null;this.settleStartedAt=0;this.settleState=null;this.settleVisibility=null;this.lastRecovery={kind:"idle"};if(!e)throw new Error("seatlayer: `performanceGroup` key is required");this.groupKey=e,this.base=(t.apiBase??tf).replace(/\/+$/,""),this.access=t.access,this.fetcher=t.fetch??globalThis.fetch.bind(globalThis),this.recoveryTimeoutMs=t.recoveryTimeoutMs??nf,this.realtimePollMs=Math.max(500,t.realtimePollMs??of),this.selectionMode=t.selectionMode??"same_seat",this.partySize=t.partySize??null,this.onOperationState=t.onOperationState,this.onRecoveryState=t.onRecoveryState,this.onAvailability=t.onAvailability,this.onSessionEnded=t.onSessionEnded,this.access.onRenewed(o=>this.adoptSession(o));let n=this.readOperationRecord();n&&this.storedIsUndecided(n)&&(this.pendingOperationId=n.operationId)}get pendingOperation(){return this.pendingOperationId}get holdBlocked(){return!!this.adoptFailure||!!this.pendingOperationId&&this.lastRecovery.kind!=="idle"}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(o=>{throw this.chartRequest=null,o});let[t,n]=await Promise.all([this.descriptorCache?Promise.resolve(this.descriptorCache):this.descriptor(),this.chartRequest]);return{doc:n,event:{key:t.key,name:t.name,salesClosed:t.state!=="active",venue:t.venue,startsAt:t.performances[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}asset(e,t){return/^[a-zA-Z0-9._-]+$/.test(t)?this.blob(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/assets/${encodeURIComponent(t)}`):Promise.reject(new ie(404,"not_found","not_found"))}async objects(e){let t=this.descriptorCache?.inclusionMode==="flexible_dates",n=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/objects`+(this.selectionMode==="per_performance"||t?"?view=per-performance":"");if(this.reuseObjectsCacheOnce&&this.objectsCache)this.reuseObjectsCacheOnce=!1;else{let s=await this.authorized(n,this.objectsCache&&this.objectsEtag?{headers:{"If-None-Match":this.objectsEtag}}:{});if(s.status===304)this.objectsCache||(this.objectsEtag=null);else{if(!s.ok)return this.throwResponse(s);this.objectsCache=await this.responseJson(s),this.objectsEtag=s.headers.get("ETag")}}if(!this.objectsCache)throw new ie(502,"group_projection_unavailable","group_projection_unavailable");if(this.selectionMode==="same_seat"&&!t){let s=this.objectsCache;return this.noteAvailability(s,s.salesClosed,s),s}let o=this.objectsCache;if(this.selectionMode==="same_seat"){let s=o.performances.filter(p=>this.includedEventKeys.has(p.eventKey));if(!s.length)throw new ie(409,"group_selection_incomplete","group_selection_incomplete");let a=Object.keys(s[0]?.seats??{}),l=Object.fromEntries(a.map(p=>[p,s.every(u=>u.seats[p]==="free")?"free":"blocked"])),c=Object.fromEntries(a.flatMap(p=>{let u=s.filter(h=>h.seats[p]!=="free").map(h=>h.eventKey);return u.length>0&&u.length<s.length?[[p,u]]:[]})),d={seats:l,partial:c,hidden:[...new Set(s.flatMap(p=>p.hidden??[]))],closed:[...new Set(s.flatMap(p=>p.closed??[]))],revision:o.revision,state:o.state,salesClosed:s.some(p=>p.salesClosed)};return this.noteAvailability(o,d.salesClosed,d),d}let r=o.performances.find(s=>s.eventKey===this.activePerformanceKey);if(!r)throw new ie(409,"group_performance_unavailable","group_performance_unavailable");return this.noteAvailability(o,o.salesClosed||o.performances.some(s=>s.salesClosed),r),r}setSelectionMode(e,t){if(this.pendingOperationId||this.holdBlocked)throw new ie(409,"group_operation_pending","group_operation_pending");e!==this.selectionMode&&(this.selectionMode=e,t!=null&&(this.partySize=t),this.objectsCache=null,this.objectsEtag=null,this.selectionsByEvent.clear(),this.activePerformanceKey=this.descriptorCache?.performances[0]?.eventKey??this.activePerformanceKey)}setActivePerformance(e){if(this.descriptorCache&&!this.descriptorCache.performances.some(t=>t.eventKey===e))throw new ie(404,"group_performance_not_found","group_performance_not_found");this.activePerformanceKey=e}setIncludedEventKeys(e){let t=new Set(this.descriptorCache?.performances.map(n=>n.eventKey)??[]);if(!e.length||new Set(e).size!==e.length||e.some(n=>!t.has(n)))throw new ie(422,"invalid_event_keys","invalid_event_keys");this.includedEventKeys=new Set(e),this.reuseObjectsCacheOnce=!!this.objectsCache}includedPerformanceKeys(){return(this.descriptorCache?.performances??[]).map(e=>e.eventKey).filter(e=>this.includedEventKeys.has(e))}setPerformanceSelections(e,t){this.selectionsByEvent.set(e,t.map(n=>({...n})))}allocationsForHold(e){return(this.allocationsByHold.get(e)??[]).map(t=>({eventKey:t.eventKey,items:t.items.map(n=>({...n}))}))}async hold(e,t,n,o){if(this.assertUsable(),o)throw new ie(409,"group_hold_replace_unsupported","group_hold_replace_unsupported");let r=t.map(c=>c.label),s={labels:r};if(this.descriptorCache?.inclusionMode==="flexible_dates"&&(s.eventKeys=this.includedPerformanceKeys()),this.selectionMode==="per_performance"){if(!this.activePerformanceKey||!this.descriptorCache||!this.partySize)throw new ie(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 ie(409,"group_selection_incomplete","group_selection_incomplete");s={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,...s,...n?{ttlMs:n}:{}})})}catch(c){if(c instanceof ye)throw c;if(c instanceof he)throw this.failOperation(a),c;return this.recover(a,r,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,r,Date.now()+this.recoveryTimeoutMs,zr(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,r,Date.now()+this.recoveryTimeoutMs,zr(l))}}try{return await this.throwResponse(l,r)}catch(c){throw this.failOperation(a),c}}async release(e,t,n){this.assertUsable();let o=this.operationForHold(n),r=await this.json(`${Hi(this.groupKey,o)}/release`,{method:"POST",body:"{}"});return this.operationByHold.delete(n),this.allocationsByHold.delete(n),this.clearOperationRecord(),r}async resume(e,t){this.assertUsable();let n=this.operationForHold(t),o=await this.json(Hi(this.groupKey,n));return this.complete(o.operation)}async extend(e,t,n=12e4){this.assertUsable();let o=this.operationForHold(t),r=Math.max(rf,Math.min(sf,Math.round(n))),s=await this.json(`${Hi(this.groupKey,o)}/extend`,{method:"POST",body:JSON.stringify({ttlMs:r})}),a=this.complete(s.operation);return{holdId:a.holdId,expiresAt:a.expiresAt}}async paymentOptions(){let e=await this.authorized(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/payment-options`);return e.status===409?null:e.ok?this.responseJson(e):this.throwResponse(e)}async checkout(e){return this.json(`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/checkout`,{method:"POST",body:JSON.stringify(e)})}async orderStatus(e){let t=await this.fetcher(`${this.base}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit",signal:this.aborter.signal});return t.ok?t.json():this.throwResponse(t)}bestAvailable(){return Promise.reject(new ie(400,"group_best_available_unsupported","group_best_available_unsupported"))}socketUrl(){return""}createRealtime(e,t){return new jr(this,t,this.realtimePollMs)}sessionEnded(e){this.destroyed||this.onSessionEnded?.(e)}operationIdForHold(e){return this.operationByHold.get(e)??this.readMapping(e)}rememberOperation(e,t){!e||!t||(this.operationByHold.set(e,t),this.writeMapping(e,t))}async restoreOperation(){let e=this.readOperationRecord();if(!e)return null;if(!this.storedIsUndecided(e)&&e.state!=="committed"&&e.state!=="booked")return this.clearOperationRecord(),null;this.pendingOperationId=e.operationId,this.emitRecovery({kind:"pending",operationId:e.operationId,phase:e.state==="undecided"?"unknown":e.state,longRunning:!1,reference:Ri(e.operationId)});let t;try{t=await this.authorized(Hi(this.groupKey,e.operationId))}catch(r){return r instanceof ye||this.recoveryFailed(e.operationId,"request_failed"),null}if(t.status===404)return this.failOperation(e.operationId),null;if(!t.ok)return this.recoveryFailed(e.operationId,"request_failed"),null;let n=await this.responseJson(t);this.emit(n.operation);let o=n.operation.state;return o==="committed"||o==="booked"?(this.emitRecovery({kind:"idle"}),this.complete(n.operation)):o==="aborted"||o==="expired"?(this.failOperation(e.operationId),null):this.recover(e.operationId,[],Date.now()+this.recoveryTimeoutMs)}async retryRecovery(){this.assertUsable();let e=this.pendingOperationId??this.readOperationRecord()?.operationId??null;return e?(this.pendingOperationId=e,this.recover(e,[],Date.now()+this.recoveryTimeoutMs)):null}watchSettlement(e){if(this.destroyed)return;let t=this.operationIdForHold(e);!t||t===this.settleOperationId||(this.stopSettlementWatch(),this.settleOperationId=t,this.settleStartedAt=Date.now(),this.settleState="committed",typeof document<"u"&&(this.settleVisibility=()=>{document.hidden||!this.settleOperationId||this.pollSettlement()},document.addEventListener("visibilitychange",this.settleVisibility)),this.scheduleSettlementPoll())}stopSettlementWatch(){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null,this.settleOperationId=null,this.settleState=null,this.settleVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",this.settleVisibility),this.settleVisibility=null}scheduleSettlementPoll(){if(this.destroyed||!this.settleOperationId)return;if(this.settleTimer&&clearTimeout(this.settleTimer),typeof document<"u"&&document.hidden){this.settleTimer=null;return}let t=Date.now()-this.settleStartedAt>=df?cf:lf;this.settleTimer=setTimeout(()=>{this.pollSettlement()},t)}settled(e){return e==="booked"||e==="expired"||e==="aborted"}async pollSettlement(){let e=this.settleOperationId;if(this.destroyed||!e)return;if(typeof document<"u"&&document.hidden){this.settleTimer&&clearTimeout(this.settleTimer),this.settleTimer=null;return}let t;try{let o=await this.authorized(Hi(this.groupKey,e));if(!o.ok)return this.scheduleSettlementPoll();t=(await this.responseJson(o)).operation}catch(o){return o instanceof ye?this.stopSettlementWatch():this.scheduleSettlementPoll()}if(this.destroyed||this.settleOperationId!==e)return;let n=t.state!==this.settleState;if(this.settleState=t.state,n&&this.noteOperationState(e,t.state),this.settled(t.state)){this.stopSettlementWatch(),t.state!=="booked"&&this.clearOperationRecord(),this.emit(t);return}n&&this.emit(t),this.scheduleSettlementPoll()}destroy(){if(!this.destroyed){this.destroyed=!0,this.stopSettlementWatch(),this.access.onRenewed(void 0);try{this.aborter.abort()}catch{}}}operationRecordKey(){return`@seatlayer/performance-group-operation/v1/${encodeURIComponent(this.base)}/${encodeURIComponent(this.groupKey)}`}readOperationRecord(){try{let e=window.sessionStorage.getItem(this.operationRecordKey());if(!e)return null;let t=JSON.parse(e);return!t?.operationId||t.groupKey!==this.groupKey?null:t}catch{return null}}storedIsUndecided(e){return e.state==="undecided"||pf.has(e.state)}writeOperationRecord(e){try{window.sessionStorage.setItem(this.operationRecordKey(),JSON.stringify(e))}catch{}}clearOperationRecord(){try{window.sessionStorage.removeItem(this.operationRecordKey())}catch{}}beginOperation(e){this.pendingOperationId=e;let t=this.readOperationRecord();this.writeOperationRecord({operationId:e,groupKey:this.groupKey,state:"undecided",createdAt:t?.operationId===e?t.createdAt:Date.now()})}noteOperationState(e,t){let n=this.readOperationRecord();!n||n.operationId!==e||this.writeOperationRecord({...n,state:t})}failOperation(e){this.pendingOperationId=null,this.clearOperationRecord(),this.emitRecovery({kind:"idle"}),this.onOperationState?.({operationId:e,state:"aborted",decision:"abort"})}async adoptSession(e){if(this.destroyed)return;let t=`/pub/performance-groups/${encodeURIComponent(this.groupKey)}/session/adopt`;for(let o=0;o<2;o++){if(this.destroyed)return;try{if((await this.fetcher(`${this.base}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit",signal:this.aborter.signal})).ok){this.adoptFailure=null;return}}catch{}}if(this.destroyed)return;this.adoptFailure=new ie(409,"performance_group_session_adopt_failed","performance_group_session_adopt_failed");let n=this.pendingOperationId??"";throw this.emitRecovery({kind:"failed",operationId:n,reference:n?Ri(n):"",reason:"session_adopt_failed",retryable:!1}),this.adoptFailure}async recover(e,t,n,o=100){let r=o,s=Date.now()+Math.min(8e3,Math.max(500,this.recoveryTimeoutMs/2)),a="unknown";for(;Date.now()<=n;){if(this.destroyed)throw new ye;if(this.emitRecovery({kind:"pending",operationId:e,phase:a,longRunning:Date.now()>=s,reference:Ri(e)}),await hf(r),this.destroyed)throw new ye;let l;try{l=await this.authorized(Hi(this.groupKey,e))}catch(p){if(p instanceof ye)throw p;if(p instanceof he)throw this.recoveryFailed(e,"request_failed"),p;r=Math.min(2e3,Math.max(100,r*2));continue}if(l.status===404){r=Math.min(1e3,Math.max(100,r*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 ie(409,"conflict","conflict",t.map(p=>({label:p,status:"held"})));r=zr(l)}throw this.recoveryFailed(e,"deadline"),new ie(504,"performance_group_outcome_unknown","performance_group_outcome_unknown")}recoveryFailed(e,t){this.emitRecovery({kind:"failed",operationId:e,reference:Ri(e),reason:t,retryable:!0})}emitRecovery(e){if(this.destroyed)return;let t=this.lastRecovery.kind===e.kind&&JSON.stringify(this.lastRecovery)===JSON.stringify(e);this.lastRecovery=e,t||this.onRecoveryState?.(e)}noteAvailability(e,t,n){if(this.destroyed||!this.onAvailability)return;let o=e.state??this.descriptorCache?.state??"active",r=e.revision??null,s=!!r&&!!this.knownRevision&&r!==this.knownRevision;r&&!this.knownRevision&&(this.knownRevision=r);let a=n?.partial??{},l=Object.values(n?.seats??{});this.onAvailability({partial:a,freeCount:l.filter(c=>c==="free").length,blockedCount:Object.keys(n?.seats??{}).filter(c=>n.seats[c]!=="free"&&!(c in a)).length,state:o,salesClosed:!!t||o!=="active",revision:r,revisionChanged:s})}acceptRevision(e){this.knownRevision=e}complete(e){if(!e.hold||e.hold.expiresAt==null)throw new ie(409,"group_hold_not_active","group_hold_not_active");this.pendingOperationId=null,this.noteOperationState(e.operationId,e.state),this.operationByHold.set(e.hold.id,e.operationId),this.writeMapping(e.hold.id,e.operationId);let t=e.hold.allocations??[];this.allocationsByHold.set(e.hold.id,t);let n=t.find(o=>o.eventKey===this.activePerformanceKey)?.items;return{holdId:e.hold.id,expiresAt:e.hold.expiresAt,items:n??e.hold.items??[]}}emit(e){this.destroyed||this.onOperationState?.({operationId:e.operationId,state:e.state,decision:e.decision})}operationForHold(e){let t=this.operationIdForHold(e);if(!t)throw new ie(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 ye;if(this.adoptFailure)throw this.adoptFailure}async authorized(e,t={},n=!1){if(this.destroyed)throw new ye;if(this.adoptFailure)throw this.adoptFailure;let o={...t.headers};t.body!==void 0&&(o["Content-Type"]="application/json");let r=await this.access.authorization(n?"unauthorized":"initial");if(this.destroyed)throw new ye;if(this.adoptFailure)throw this.adoptFailure;if(!r)throw new Error("performance_group_buyer_access_required");o.Authorization=r;let s=await this.fetcher(`${this.base}${e}`,{method:t.method??"GET",headers:o,body:t.body,credentials:"omit",signal:this.aborter.signal});if(!n&&(s.status===401||s.status===403||s.status===422)){let a=await s.clone().json().catch(()=>null);if(await this.access.handleFailure(s.status,a?.code??a?.error,r))return this.authorized(e,t,!0)}return s}async json(e,t={}){let n=await this.authorized(e,t);return n.ok?this.responseJson(n):this.throwResponse(n)}async blob(e){let t=await this.authorized(e);return t.ok?t.blob():this.throwResponse(t)}async responseJson(e){return e.json()}async throwResponse(e,t=[]){let o=await e.json().catch(()=>null)??{},r=o.code??o.error??`request_failed_${e.status}`;throw e.status===409&&!o.conflicts?.length&&t.length&&(o.conflicts=t.map(s=>({label:s,status:"held"}))),new ie(e.status,o.error??r,r,o.conflicts)}};var tp=require("@seatlayer/core");var Ii,qt,Tt,Oi,dn,Et,ip,_o,No=class{constructor(e){this.options=e;R(this,Et);R(this,Ii,null);R(this,qt,!1);R(this,Tt,null);R(this,Oi,!1);R(this,dn,!1)}get mode(){return m(this,qt)?"hosted":"handoff"}async prepare(){try{S(this,Ii,await this.options.api.paymentOptions()),S(this,qt,!!m(this,Ii))}catch(e){S(this,qt,!1),this.options.onError?.(e)}}async open(e,t){if(!m(this,qt)||m(this,Oi))return;if(t.selectionMode!=="same_seat"){this.options.announce(y("picker.group.hostedPerPerformance","Seats chosen night by night can\u2019t be paid for on this page yet. Choose one seat for every date instead."));return}let n=m(this,Ii),o=t.seatLabels.length;if(n.bookingMode==="paid"&&!n.providers.length){await x(this,Et,_o).call(this,e,t.descriptor,{kind:"unavailable",reason:n.reason==="unavailable_for_run"?"unavailable_for_event":"not_configured",seatCount:o});return}S(this,Oi,!0);try{let{total:r,currency:s,lines:a}=x(this,Et,ip).call(this,t.holdId,t.descriptor);await x(this,Et,_o).call(this,e,t.descriptor,{kind:"pay",provider:null,free:n.bookingMode==="free",order:{holdId:t.operationId,expiresAt:t.expiresAt,currency:s,total:r,labels:[...t.seatLabels],lines:a}})}finally{S(this,Oi,!1)}}resume(e,t,n){let o=Li(t);o?.outcome!=="success"||!o.orderId||x(this,Et,_o).call(this,e,n,{kind:"resume",orderId:o.orderId})}destroy(){S(this,dn,!0),m(this,Tt)?.destroy(),S(this,Tt,null)}};Ii=new WeakMap,qt=new WeakMap,Tt=new WeakMap,Oi=new WeakMap,dn=new WeakMap,Et=new WeakSet,ip=function(e,t){let n=this.options.api.allocationsForHold(e),o=n.flatMap(a=>a.items)[0]?.currency??t.currency,r=0,s=n.map(a=>{let l=a.items.reduce((d,p)=>d+Math.round(p.unitPrice*100)*(p.quantity??1),0);r+=l;let c=t.performances.find(d=>d.eventKey===a.eventKey);return{label:a.items.map(d=>d.label).join(", "),detail:c?Ci(c,this.options.locale):null,amount:l/100}});return{total:r/100,currency:o,lines:s}},_o=async function(e,t,n){let o;try{({mountCheckout:o}=await li())}catch(s){this.options.onError?.(s),this.options.announce(y("picker.group.checkoutCouldNotOpen","Checkout could not be opened. Your seats are still held. Please try again."));return}if(m(this,dn)||!e)return;m(this,Tt)?.destroy();let r=this.options.api;S(this,Tt,o({root:e,state:n,eventKey:r.groupKey,event:{name:t.name,detail:y("picker.group.checkoutDates","{count} dates, one seat each").replace("{count}",String(t.performanceCount))},formatMoney:(s,a)=>(0,tp.formatMoney)(s,a,{locale:this.options.locale,fallback:(l,c)=>`${l} ${c}`,...Number.isInteger(s)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:async s=>{let a=await r.checkout({operationId:s.holdId,buyerEmail:s.buyerEmail,...s.buyerName?{buyerName:s.buyerName}:{},...this.options.returnUrl?{returnUrl:this.options.returnUrl}:{}});return{orderId:a.orderId,totalMinor:a.totalMinor??0,currency:a.currency??t.currency,expiresAt:a.expiresAt??0,...a.redirectUrl?{redirectUrl:a.redirectUrl}:{},...a.status==="confirmed"?{status:"confirmed"}:{}}},orderStatus:s=>r.orderStatus(s),onCancel:()=>{S(this,Tt,null)},onConfirmed:s=>this.options.onConfirmed?.(s),onError:s=>this.options.onError?.(s)}))};var uf={audience_not_public:"audience_not_public",sales_not_open:"sales_not_open",invalid_origin:"origin_not_allowed"},mf=3e4;function ff(i,e){if(!i||typeof i!="object"||Array.isArray(i))return!1;let t=i;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.performanceGroupKey===e}var Kr=class extends Error{constructor(t,n){super(`performance_group_public_session_refused:${t}`);this.reason=t;this.status=n;this.name="PerformanceGroupPublicSessionRefused"}},ct,Ct,pn,_i,Gr=class{constructor(e){this.options=e;R(this,ct,null);R(this,Ct,null);R(this,pn);R(this,_i);S(this,pn,e.fetch??globalThis.fetch.bind(globalThis)),S(this,_i,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return m(this,ct)}async mint(e=!1){if(e&&S(this,ct,null),m(this,ct)&&m(this,ct).expiresAt-mf>Date.now())return m(this,ct);if(m(this,Ct))return m(this,Ct);let t=(async()=>{let n=await m(this,pn).call(this,`${this.options.base}/pub/performance-groups/${encodeURIComponent(this.options.performanceGroup)}/sessions`,{method:"POST",body:JSON.stringify(m(this,_i)?{origin:m(this,_i)}:{}),credentials:"omit"}),o=await n.json().catch(()=>null);if(!n.ok){let r=o?.code??o?.error,s=n.status===403&&r?uf[r]:void 0;throw s?(this.options.onRefused?.({reason:s,code:r,status:n.status,retryable:s==="sales_not_open"}),new Kr(s,n.status)):new Error(`performance_group_public_session_failed_${n.status}`)}if(!ff(o,this.options.performanceGroup))throw new Error("performance_group_public_session_invalid");return S(this,ct,o),o})();S(this,Ct,t);try{return await t}finally{m(this,Ct)===t&&S(this,Ct,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.mint(t);return{token:n.token,expiresAt:n.expiresAt}}};ct=new WeakMap,Ct=new WeakMap,pn=new WeakMap,_i=new WeakMap;function np(i){let e=new Gr(i);return{access:new De({provider:({reason:n})=>e.token(n),...i.accessHooks}),loader:e}}var op="https://api.seatlayer.io";function rp(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Performance Group picker container was not found");return e}var Do=class{constructor(e){this.descriptorValue=null;this.picker=null;this.root=null;this.innerHost=null;this.tabsHost=null;this.prevButton=null;this.nextButton=null;this.heldSummary=null;this.live=null;this.statusHost=null;this.statusCopy=null;this.statusAction=null;this.rendered=!1;this.destroyed=!1;this.continued=!1;this.switchingPerformance=!1;this.operationPending=!1;this.recovery={kind:"idle"};this.availability=null;this.activePerformanceKey=null;this.selectionsByEvent=new Map;this.validByEvent=new Map;this.refreshingComposition=!1;this.activeHandoff=null;this.selectionModeValue="same_seat";this.progressHost=null;this.legendHost=null;this.paneHost=null;this.datesSummaryHost=null;this.datesCardsHost=null;this.resettingFlexibleSelection=!1;this.selectingPartialSeat=!1;this.partialSeatDates=new Map;this.markedLabels=new Set;this.holdTicker=null;this.switchingMode=!1;this.booked=!1;this.refusal=null;if(!e||typeof e!="object")throw new Error("seatlayer: options object is required");if(!e.performanceGroup)throw new Error("seatlayer: `performanceGroup` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if(!!e.initialHoldId!=!!e.initialOperationId)throw new Error("seatlayer: `initialHoldId` and `initialOperationId` must be supplied together");if((e.selectionMode==="per_performance"||e.allowSelectionModeSwitch)&&(!Number.isSafeInteger(e.numberOfPlacesToSelect)||(e.numberOfPlacesToSelect??0)<1))throw new Error("seatlayer: `numberOfPlacesToSelect` is required for per-performance selection");this.selectionModeValue=e.selectionMode??"same_seat",this.options=e,this.panelId=`sl-pg-panel-${e.performanceGroup}`;let t=n=>{this.refusal=this.refusal&&n.reason==="provider_failed"?this.refusal:n,e.onAccessUnavailable?.(this.refusal)};this.access=e.buyerAccessToken||e.buyerAccessTokenProvider?new De({provider:e.buyerAccessTokenProvider,token:e.buyerAccessToken,onExpired:e.onAccessExpired,onUnavailable:t}):np({base:(e.apiBase??op).replace(/\/$/,""),performanceGroup:e.performanceGroup,onRefused:n=>{this.refusal=n},accessHooks:{onExpired:e.onAccessExpired,onUnavailable:t}}).access,this.api=new Oo(e.performanceGroup,{apiBase:e.apiBase,access:this.access,selectionMode:e.selectionMode,partySize:e.selectionMode==="per_performance"?e.numberOfPlacesToSelect:void 0,onOperationState:n=>this.operationChanged(n),onRecoveryState:n=>this.recoveryChanged(n),onAvailability:n=>this.availabilityChanged(n),onSessionEnded:n=>this.sessionEnded(n)}),e.initialHoldId&&e.initialOperationId&&this.api.rememberOperation(e.initialHoldId,e.initialOperationId),this.hosted=e.checkout==="hosted"?new No({api:this.api,locale:e.locale,returnUrl:e.returnUrl,announce:n=>this.showStatus("checkout",n),onConfirmed:n=>e.onOrderConfirmed?.(n),onError:e.onError}):null}get checkoutMode(){return this.hosted?.mode??"handoff"}get mode(){return this.selectionModeValue}get selectionMode(){return this.selectionModeValue}get descriptor(){return this.descriptorValue}get currentHold(){return this.activeHandoff}async render(){if(this.rendered)return this;let e=performance.now();if(this.rendered=!0,ep(),await(0,At.loadLocale)(this.options.locale),this.options.messages&&(0,At.setStringOverrides)(this.options.messages),this.destroyed)return this;let t;try{t=await this.api.descriptor()}catch(n){throw Qe({apiBase:this.options.apiBase??op,event:this.options.performanceGroup,scope:"performance_group",surface:"performance_group_picker",outcome:"failure",stage:"group_descriptor",ms:performance.now()-e,load:ot(this.options.performanceGroup),transport:"pubapi"}),n instanceof he&&this.refusal?new he(this.refusal):n}return await this.hosted?.prepare(),this.destroyed?this:(this.descriptorValue=t,this.activePerformanceKey=t.performances[0]?.eventKey??null,this.buildChrome(rp(this.options.container),t),this.announce(this.copy("picker.group.checkingAvailability")),await this.mountPicker(t),this.destroyed?this:(await this.restoreOperation(),this.destroyed||this.hosted?.resume(this.picker?.root??null,t.key,t),this))}buildChrome(e,t){e.replaceChildren();let n=document.createElement("div");n.className="sl-pg-root",n.dataset.performanceGroup=t.key,n.dataset.selectionMode=this.mode;let o=document.createElement("div");o.className="sl-pg-progress";let r=document.createElement("section");r.className="sl-pg-head",r.setAttribute("aria-labelledby",`sl-pg-title-${t.key}`);let s=document.createElement("h2");s.id=`sl-pg-title-${t.key}`,s.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=Mr(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.hidden=a.hidden=c.hidden=this.options.header===!1,r.append(s,a,l,c,u);let h=document.createElement("div");h.className="sl-pg-legend";let b=document.createElement("div");b.className="sl-pg-pane",b.setAttribute("role","group"),b.setAttribute("aria-label",this.copy("picker.group.yourSelection")),b.hidden=!0;let g=this.mode==="per_performance"?this.performanceTabs(t):null,T=document.createElement("div");T.className="sl-pg-inner",T.id=this.panelId,T.setAttribute("aria-busy","false"),T.dataset.locked="false",this.mode==="per_performance"&&(T.setAttribute("role","tabpanel"),T.tabIndex=-1);let w=document.createElement("div");w.className="sl-pg-status",w.setAttribute("role","status"),w.setAttribute("aria-live","polite"),w.hidden=!0;let v=document.createElement("p"),M=document.createElement("button");M.type="button",M.hidden=!0,M.textContent=this.copy("picker.group.retry"),M.addEventListener("click",()=>{this.retryRecovery()}),w.append(v,M),T.appendChild(w);let F=document.createElement("div");F.className="sl-pg-live",F.setAttribute("role","status"),F.setAttribute("aria-live","polite"),n.append(o,r),g&&n.append(g),n.append(h,T,b,F),e.appendChild(n),this.root=n,this.progressHost=o,this.legendHost=h,this.paneHost=b,this.datesSummaryHost=d,this.datesCardsHost=p,this.innerHost=T,this.heldSummary=u,this.live=F,this.statusHost=w,this.statusCopy=v,this.statusAction=M,this.syncProgress(),this.syncLegend(),this.syncPane()}async mountPicker(e){let t=new lt(Ro({container:this.innerHost,event:e.key,apiBase:this.options.apiBase,transport:this.api,hideEventDetails:!0,maxSelection:this.options.maxSelection,selectedObjects:this.options.selectedObjects,selectableObjects:this.options.selectableObjects,numberOfPlacesToSelect:this.options.numberOfPlacesToSelect,selectionValidators:this.options.selectionValidators,locale:this.options.locale,messages:this.options.messages,languages:this.options.languages,colorblindSafe:this.options.colorblindSafe,initialView:this.options.initialView,enable3D:this.options.enable3D,max3DSeats:this.options.max3DSeats,onBuyerViewChange:this.options.onBuyerViewChange,onAnalytics:(n,o)=>{try{this.options.onAnalytics?.(n,{...o,metricScope:"performance_group",performanceGroupKey:e.key,performanceCount:e.performanceCount,selectionMode:this.mode})}catch{}},hideBadge:this.options.hideBadge,theme:this.options.theme,holdTtlMs:this.options.holdTtlMs,initialHoldId:this.options.initialHoldId,restoreHold:this.options.restoreHold,confirmSelection:this.options.confirmSelection,seatView:this.options.seatView,onSelectionChange:n=>this.selectionChanged(n),onSelectionValidityChange:n=>this.selectionValidityChanged(n),onSelectionValid:this.options.onSelectionValid,onSelectionInvalid:this.options.onSelectionInvalid,onSelectionLimit:this.options.onSelectionLimit,onHoldChange:(n,o)=>this.holdChanged(n,o),onCheckout:(n,o)=>this.checkout(n,o),onHoldExpired:()=>{this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()},onError:this.options.onError},{performanceCount:e.performanceCount,selectionMode:this.mode,submissionState:()=>this.submissionState(),suppressPricing:!0,nights:()=>this.nights(),seatMarks:()=>this.seatMarks(),nightSummary:()=>this.nightSummary(),groupSelectionSummary:()=>this.groupSelectionSummary(),activePerformanceLabel:()=>this.activePerformanceLabel(),selectedPerformanceDates:()=>this.mode==="same_seat"&&e.inclusionMode==="flexible_dates"?Ul(this.includedPerformances(),e.performanceCount,this.options.locale,this.copy("picker.group.flexibleSelectedNote",{count:this.includedPerformances().length})):null,selectNight:n=>{this.switchPerformance(n)},selectionModeSwitch:this.options.allowSelectionModeSwitch&&this.mode==="same_seat"?{label:this.copy("picker.group.chooseNightByNight"),activate:()=>{this.switchSelectionMode("per_performance")}}:null,partialSeatSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),activate:(n,o)=>{this.selectPartialSeat(n,o)}}:null,confirmDateSelection:e.inclusionMode==="flexible_dates"&&this.mode==="same_seat"?{includedEventKeys:()=>this.api.includedPerformanceKeys(),availableEventKeys:n=>this.partialSeatDates.get(n)??this.nights().map(o=>o.eventKey),label:n=>this.copy("picker.group.selectAvailableDates",{count:n}),apply:(n,o)=>this.applySeatDates(n,o,!0)}:null}));this.picker=t,await t.render(),!this.destroyed&&this.updateTabs()}performanceCards(e){return e.performances.map(t=>({eventKey:t.eventKey,name:t.name,iso:new Date(t.startsAt).toISOString(),date:wo(t,this.options.locale),time:xo(t,this.options.locale)}))}nights(){return(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:e.name,shortDate:Ci(e,this.options.locale)}))}seatMarks(){let e=this.descriptorValue?.performanceCount??0,t=this.availability,n=!!t?.salesClosed||!!t&&t.state!=="active",o=this.mode==="same_seat"&&!n?t?.partial??{}:{},r={};for(let s of this.markedLabels)r[s]=null;if(this.markedLabels.clear(),e>0)for(let[s,a]of Object.entries(o))!a.length||a.length>=e||(r[s]={kind:"partial",fraction:(e-a.length)/e,data:{blockedEventKeys:[...a]}},this.markedLabels.add(s));return r}activePerformanceLabel(){if(this.mode!=="per_performance")return null;let e=this.descriptorValue?.performances.find(o=>o.eventKey===this.activePerformanceKey);if(!e)return null;let t=Ci(e,this.options.locale),n=e.name?.trim();return n&&n!==t?`${n} \xB7 ${t}`:t}nightSummary(){return this.mode!=="per_performance"?[]:(this.descriptorValue?.performances??[]).map(e=>({eventKey:e.eventKey,name:Ci(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 r=this.activeHandoff?.seatLabels.length??this.picker?.getSelection().length??0;return{seats:r*e.length,performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:r?e.length:0,perPerformance:r}}let t=e.map(r=>this.selectionsByEvent.get(r.eventKey)?.length??0),n=t.filter(r=>r>0),o=n.length===t.length&&n.every(r=>r===n[0]);return{seats:t.reduce((r,s)=>r+s,0),performances:e.length,totalPerformances:this.descriptorValue?.performanceCount??e.length,performancesChosen:n.length,perPerformance:o&&n.length?n[0]:null}}syncProgress(){if(!this.progressHost)return;let e=!!this.activeHandoff,t=[{id:"performances",label:this.copy("picker.group.stepPerformances"),state:"done"},{id:"seats",label:this.copy("picker.group.stepSeats"),state:e?"done":"current"},{id:"review",label:this.copy("picker.group.stepReview"),state:this.booked?"done":e?"current":"upcoming"}];this.progressHost.innerHTML=ic(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=Wl({available:e.freeCount>0,selected:(this.picker?.getSelection().length??0)>0,partial:Object.keys(e.partial).length>0,unavailable:e.blockedCount>0},{title:this.copy("picker.group.legendTitle"),available:this.copy("picker.group.legendAvailable"),selected:this.copy("picker.group.legendSelected"),partial:this.copy("picker.group.legendNotEveryDate"),unavailable:this.copy("picker.group.legendUnavailable")},this.categoryColor())}categoryColor(){return this.picker?.categoryLegendColor()??"#2563eb"}syncPane(){let e=this.paneHost;if(!e)return;let t=this.includedPerformances();if(this.mode!=="same_seat"||!t.length){e.hidden=!0,e.replaceChildren();return}let n=this.activeHandoff?.seatLabels??this.picker?.getSelection().map(r=>r.label)??[],o=this.heldTotal();e.hidden=!1,e.innerHTML=nc({title:this.copy("picker.group.yourSelection"),rows:t.map(r=>({eventKey:r.eventKey,name:`${wo(r,this.options.locale)} ${xo(r,this.options.locale)}`,labels:n})),empty:this.copy("picker.group.noSeatsChosenYet"),note:o?null:this.copy("picker.group.pricesPerPerformance"),total:o?{label:this.copy("picker.group.total"),amount:o}:null,holdStatus:this.booked?this.copy("picker.group.bookedAll",{count:t.length}):this.activeHandoff?this.copy("picker.group.heldTogether",{count:t.length,time:oc(this.activeHandoff.expiresAt-Date.now())}):null})}heldTotal(){let e=this.activeHandoff,t=this.descriptorValue;if(!e||!t)return null;let o=this.api.allocationsForHold(e.holdId).flatMap(a=>a.items);if(!o.length)return null;let r=o.reduce((a,l)=>a+l.unitPrice*(l.quantity??1),0),s=o[0]?.currency??t.currency;try{return(0,At.formatMoney)(r,s,void 0,this.options.locale)}catch{return`${s} ${r.toFixed(2)}`}}includedPerformances(){let e=this.descriptorValue?.performances??[];if(this.descriptorValue?.inclusionMode!=="flexible_dates")return e;let t=new Set(this.api.includedPerformanceKeys());return e.filter(n=>t.has(n.eventKey))}syncIncludedDates(){let e=this.descriptorValue;if(!e||!this.datesSummaryHost||!this.datesCardsHost)return;let t=this.includedPerformances(),n=e.inclusionMode==="flexible_dates";this.datesSummaryHost.textContent=n&&t.length<e.performanceCount?this.copy("picker.group.flexibleDatesSelected",{selected:t.length,total:e.performanceCount}):this.copy(n?"picker.group.flexibleDatesInView":"picker.group.allDates",{count:e.performanceCount}),this.datesCardsHost.innerHTML=Mr(this.performanceCards({...e,performances:t}),this.copy(n&&t.length<e.performanceCount?"picker.group.flexibleSelectedNote":n?"picker.group.flexibleDatesNote":"picker.group.includedNote",{count:t.length}))}async selectPartialSeat(e,t){if(!(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)){if((this.picker?.getSelection().length??0)>0){this.announce(this.copy("picker.group.clearBeforePartial"));return}this.partialSeatDates.set(e,[...t]),await this.applySeatDates(e,t,!1)}}async applySeatDates(e,t,n){if(this.destroyed||this.holdBlocked()||this.activeHandoff||!t.length)return!1;let o=this.api.includedPerformanceKeys();if(o.length===t.length&&o.every(r=>t.includes(r)))return!0;this.selectingPartialSeat=!0;try{if(this.api.setIncludedEventKeys(t),this.syncIncludedDates(),await this.picker?.refreshAvailability(),!(n?this.picker?.selectObjectsWithoutConfirmation([e])??[]:this.picker?.selectObjects([e])??[]).length)throw new Error("performance_group_partial_seat_unavailable");return this.announce(this.copy("picker.group.selectedAvailableDates",{count:t.length})),this.syncPane(),this.syncLegend(),!0}catch(r){return o.length&&(this.api.setIncludedEventKeys(o),this.syncIncludedDates(),await this.picker?.refreshAvailability().catch(()=>{})),this.options.onError?.(r),!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(rp(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 ye)return;this.options.onError?.(t)}finally{this.switchingMode=!1}}}async release(){await this.picker?.release()}close(){this.destroy()}destroy(){if(this.destroyed)return;this.destroyed=!0,this.api.destroy(),this.hosted?.destroy(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.picker;this.root?.setAttribute("hidden","");let t=()=>{e?.destroy(),this.access.clear(),this.root?.remove(),this.root=null,this.picker=null,this.innerHost=null,this.tabsHost=null,this.statusHost=null,this.statusCopy=null,this.statusAction=null,this.live=null};e?.getCurrentHold()&&!this.continued?e.release().catch(()=>{}).finally(t):t()}copy(e,t){let n=this.options.messages?.[e];return n!==void 0?t?n.replace(/\{(\w+)\}/g,(o,r)=>String(t[r]??`{${r}}`)):n:(0,At.t)(e,t)}performanceTabs(e){let t=document.createElement("div");t.className="sl-pg-tabsbar";let n=document.createElement("button");n.type="button",n.className="sl-pg-step",n.dataset.step="previous",n.setAttribute("aria-label",this.copy("picker.group.previousPerformance")),n.textContent="\u2039",n.addEventListener("click",()=>{this.stepPerformance(-1)});let o=document.createElement("button");o.type="button",o.className="sl-pg-step",o.dataset.step="next",o.setAttribute("aria-label",this.copy("picker.group.nextPerformance")),o.textContent="\u203A",o.addEventListener("click",()=>{this.stepPerformance(1)});let r=document.createElement("div");return r.className="sl-pg-tabs",r.setAttribute("role","tablist"),r.setAttribute("aria-label",this.copy("picker.group.performances")),e.performances.forEach((s,a)=>{let l=document.createElement("button");l.type="button",l.className="sl-pg-tab",l.id=`sl-pg-tab-${e.key}-${s.eventKey}`,l.dataset.eventKey=s.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=s.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(s.eventKey)}),l.addEventListener("keydown",u=>this.tabKeydown(u)),r.appendChild(l)}),t.append(n,r,o),this.tabsHost=r,this.prevButton=n,this.nextButton=o,t}tabButtons(){return[...this.tabsHost?.querySelectorAll(".sl-pg-tab")??[]]}tabKeydown(e){let t=this.tabButtons(),n=t.findIndex(a=>a===e.target);if(n<0)return;let o=getComputedStyle(this.tabsHost??document.body).direction==="rtl",r=-1;switch(e.key){case"ArrowRight":r=n+(o?-1:1);break;case"ArrowLeft":r=n+(o?1:-1);break;case"ArrowDown":r=n+1;break;case"ArrowUp":r=n-1;break;case"Home":r=0;break;case"End":r=t.length-1;break;default:return}if(r<0||r>=t.length)return;e.preventDefault();let s=t[r];s.focus({preventScroll:!0}),s.disabled||this.switchPerformance(s.dataset.eventKey)}stepPerformance(e){let t=this.tabButtons(),n=t.findIndex(r=>r.dataset.eventKey===this.activePerformanceKey),o=t[n+e];!o||o.disabled||(o.focus({preventScroll:!0}),this.switchPerformance(o.dataset.eventKey))}submissionState(){let e=this.descriptorValue?.performances??[];if(this.mode!=="per_performance"){let o=!this.holdBlocked();return{complete:e.length,total:e.length,ready:o}}let t=this.options.numberOfPlacesToSelect,n=e.filter(o=>this.selectionsByEvent.get(o.eventKey)?.length===t&&this.validByEvent.get(o.eventKey)!==!1).length;return{complete:n,total:e.length,ready:n===e.length&&!this.holdBlocked()}}holdBlocked(){return this.operationPending||this.recovery.kind!=="idle"||!!this.availability?.salesClosed}selectionChanged(e){if(this.mode!=="per_performance"){this.options.onSelectionChange?.(e),this.syncPane(),this.syncLegend(),!e.length&&!this.activeHandoff&&!this.resettingFlexibleSelection&&!this.selectingPartialSeat&&this.descriptorValue?.inclusionMode==="flexible_dates"&&this.api.includedPerformanceKeys().length<this.descriptorValue.performanceCount&&(this.resettingFlexibleSelection=!0,this.api.setIncludedEventKeys(this.descriptorValue.performances.map(n=>n.eventKey)),this.syncIncludedDates(),this.picker?.refreshAvailability().catch(n=>this.options.onError?.(n)).finally(()=>{this.resettingFlexibleSelection=!1}));return}if(this.refreshingComposition||this.switchingPerformance||!this.activePerformanceKey)return;let t=e.map(n=>({...n}));this.selectionsByEvent.set(this.activePerformanceKey,t),this.api.setPerformanceSelections(this.activePerformanceKey,t.map(n=>({label:n.label}))),t.length!==this.options.numberOfPlacesToSelect?this.validByEvent.set(this.activePerformanceKey,!1):this.validByEvent.has(this.activePerformanceKey)||this.validByEvent.set(this.activePerformanceKey,!0),this.updateTabs(),this.options.onSelectionChange?.(e),this.refreshComposition(),this.syncLegend()}selectionValidityChanged(e){if(this.mode==="per_performance"&&!this.switchingPerformance&&this.activePerformanceKey){let t=this.validByEvent.get(this.activePerformanceKey);this.validByEvent.set(this.activePerformanceKey,e.isValid),this.updateTabs(),!this.refreshingComposition&&t!==e.isValid&&this.refreshComposition()}this.options.onSelectionValidityChange?.(e)}refreshComposition(){if(this.refreshingComposition||!this.picker)return;let e=this.submissionState();this.refreshingComposition=!0;try{this.picker.refreshPerformanceGroupComposition();let t=this.submissionState();(e.complete!==t.complete||e.ready!==t.ready)&&this.picker.refreshPerformanceGroupComposition()}finally{this.refreshingComposition=!1}}tabState(e){let t=this.options.numberOfPlacesToSelect??1,n=(this.selectionsByEvent.get(e)??[]).map(r=>r.label),o=this.copy("picker.group.chosenOfTotal",{chosen:n.length,total:t});return n.length===0?{key:"not-started",label:this.copy("picker.group.stillNeedsSeat"),badge:o}:n.length===t&&this.validByEvent.get(e)!==!1?{key:"complete",label:this.copy("picker.group.completeWithSeats",{seats:n.join(", ")}),badge:o}:n.length===t?{key:"needs-attention",label:this.copy("picker.group.needsAttention"),badge:o}:{key:"in-progress",label:this.copy("picker.group.needsMoreSeats",{count:t-n.length}),badge:o}}updateTabs(){let e=this.tabButtons(),t=this.switchingPerformance||this.operationPending||this.recovery.kind!=="idle"||!!this.activeHandoff;e.forEach(o=>{let r=o.dataset.eventKey,s=this.tabState(r),a=r===this.activePerformanceKey;o.dataset.state=s.key,o.disabled=t,o.setAttribute("aria-selected",String(a)),o.tabIndex=a?0:-1;let l=o.querySelector(".sl-pg-tab-state");l&&(l.textContent=s.label);let c=o.querySelector(".sl-pg-tab-badge");c&&(c.textContent=s.badge);let d=o.querySelector(".sl-pg-tab-name")?.textContent??r;o.setAttribute("aria-label",`${d}: ${s.badge} \xB7 ${s.label}`),a&&this.innerHost?.setAttribute("aria-labelledby",o.id)});let n=e.findIndex(o=>o.dataset.eventKey===this.activePerformanceKey);this.prevButton&&(this.prevButton.disabled=t||n<=0),this.nextButton&&(this.nextButton.disabled=t||n<0||n>=e.length-1)}async switchPerformance(e){if(this.mode!=="per_performance"||this.switchingPerformance||this.holdBlocked()||this.activeHandoff||e===this.activePerformanceKey||!this.picker)return;this.activePerformanceKey&&this.selectionChanged(this.picker.getSelection());let t=this.selectionsByEvent.get(e)?.map(n=>n.label)??[];this.switchingPerformance=!0,this.activePerformanceKey=e,this.updateTabs(),this.setInteractionLocked(!0);try{this.picker.clearSelection(),this.api.setActivePerformance(e),await this.picker.refreshAvailability();let n=this.picker.selectObjects(t);this.switchingPerformance=!1,this.selectionChanged(n),n.length!==t.length&&this.validByEvent.set(e,!1),this.options.onSelectionChange?.(n);let o=this.descriptorValue?.performances.find(r=>r.eventKey===e);o&&this.announce(this.copy("picker.group.performanceOpened",{performance:o.name}))}catch(n){this.options.onError?.(n)}finally{this.switchingPerformance=!1,!this.operationPending&&this.recovery.kind==="idle"&&this.setInteractionLocked(!1),this.updateTabs(),this.picker.refreshPerformanceGroupComposition()}}setInteractionLocked(e){let t=this.innerHost;t&&(t.dataset.locked=String(e),t.setAttribute("aria-busy",String(e)),t.setAttribute("aria-disabled",String(e)))}announce(e){this.live&&(this.live.textContent=e)}showStatus(e,t,n={}){this.statusHost&&this.statusCopy&&this.statusAction&&(this.statusCopy.textContent=t,this.statusHost.hidden=!t,this.statusAction.hidden=!n.retry),this.announce(t),this.options.onStatusChange?.({kind:e,message:t,...n.reference?{reference:n.reference}:{}})}sessionEnded(e){this.destroyed||(this.showStatus("session_ended",this.copy("picker.accessExpiredTitle")),this.options.onError?.(e))}clearStatus(){this.statusHost&&(this.statusHost.hidden=!0),this.statusAction&&(this.statusAction.hidden=!0),this.options.onStatusChange?.({kind:"idle",message:""})}operationChanged(e){if(this.destroyed)return;let t=e.state==="preparing"||e.state==="commit_pending"||e.state==="abort_pending"||e.state==="expire_pending";if(this.operationPending=t,this.setInteractionLocked(t||this.recovery.kind!=="idle"),this.updateTabs(),t){this.showStatus("pending",this.copy(e.state==="commit_pending"?"picker.group.commitPending":e.state==="abort_pending"||e.state==="expire_pending"?"picker.group.abortPending":"picker.group.securing"));return}if(e.state==="booked"){this.bookingSettled();return}if(e.state==="expired"||e.state==="aborted"){this.activeHandoff&&this.holdLost();return}if(e.state==="committed"){this.clearStatus(),this.announce(this.copy("picker.group.secured")),queueMicrotask(()=>this.innerHost?.querySelector('[data-ref="cta"]')?.focus({preventScroll:!0}));return}e.decision==="abort"&&this.recovery.kind==="idle"&&(this.clearStatus(),this.announce(this.copy("picker.group.notSecured")))}bookingSettled(){if(this.booked)return;this.booked=!0,this.root&&(this.root.dataset.booking="booked"),this.clearStatus(),this.holdTicker&&clearInterval(this.holdTicker),this.holdTicker=null;let e=this.activeHandoff?{...this.activeHandoff,bookingState:"booked"}:null;e&&(this.activeHandoff=e),this.syncProgress(),this.syncPane(),this.updateTabs(),this.picker?.notifyGroupSettled("booked"),this.announce(this.copy("picker.group.bookedAll",{count:this.descriptorValue?.performanceCount??0})),e&&this.options.onBooked?.(e)}holdLost(){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.picker?.notifyGroupSettled("lost"),this.announce(this.copy("picker.group.notSecured")),this.options.onHoldChange?.(null),this.options.onHoldExpired?.()}recoveryChanged(e){if(!this.destroyed){if(this.recovery=e,this.setInteractionLocked(this.operationPending||e.kind!=="idle"),this.updateTabs(),this.refreshComposition(),e.kind==="idle"){this.operationPending||this.clearStatus();return}if(e.kind==="pending"){this.showStatus("pending",e.longRunning?this.copy("picker.group.longRunning",{reference:e.reference}):this.copy("picker.group.outcomeUnknown"),{reference:e.reference});return}this.showStatus("recovery_failed",this.copy("picker.group.longRunning",{reference:e.reference}),{retry:e.retryable,reference:e.reference}),this.setInteractionLocked(!1)}}async retryRecovery(){if(!(this.destroyed||this.recovery.kind!=="failed"||!this.recovery.retryable))try{await this.api.retryRecovery()}catch(e){if(e instanceof ye)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 ye)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 ye)return;this.options.onError?.(t)}}handoff(e,t){let n=this.descriptorValue,o=this.api.operationIdForHold(e.holdId);if(!n||!o)throw new Error("seatlayer: Performance Group hold identity is unavailable");let r=this.api.allocationsForHold(e.holdId);return{operationId:o,holdId:e.holdId,expiresAt:e.expiresAt,performanceGroup:n,selectionMode:this.mode,performanceKeys:r.map(s=>s.eventKey),bookingState:this.booked?"booked":"held",seatLabels:t.map(s=>s.label),...this.mode==="per_performance"?{allocations:r.map(s=>({eventKey:s.eventKey,seatLabels:s.items.map(a=>a.label)}))}:{}}}renderHeldAllocations(e){if(!(!this.heldSummary||this.mode!=="per_performance")){this.heldSummary.replaceChildren();for(let t of e){let n=this.descriptorValue?.performances.find(s=>s.eventKey===t.eventKey),o=document.createElement("p"),r=document.createElement("strong");r.textContent=n?.name??t.eventKey,o.append(r,document.createTextNode(t.items.map(s=>s.label).join(", "))),this.heldSummary.appendChild(o)}this.heldSummary.hidden=e.length===0}}resetPerPerformanceSelection(){this.mode==="per_performance"&&(this.selectionsByEvent.clear(),this.validByEvent.clear(),this.heldSummary?.replaceChildren(),this.heldSummary&&(this.heldSummary.hidden=!0),this.updateTabs(),this.picker?.refreshPerformanceGroupComposition())}holdChanged(e,t){if(!e){this.activeHandoff=null,this.api.stopSettlementWatch(),this.resetPerPerformanceSelection(),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),this.options.onHoldChange?.(null);return}let n=this.handoff(e,t),o=this.activeHandoff?.holdId!==n.holdId;this.activeHandoff=n,this.renderHeldAllocations(this.api.allocationsForHold(e.holdId)),this.updateTabs(),this.api.watchSettlement(e.holdId),this.syncProgress(),this.syncPane(),this.syncHoldTicker(),o&&this.options.onHold?.(n),this.options.onHoldChange?.(n)}checkout(e,t){let n=this.handoff(e,t);this.continued=!0,this.activeHandoff=n,this.options.onCheckout?.(n),this.hosted?.mode==="hosted"&&this.descriptorValue&&this.hosted.open(this.picker?.root??null,{...n,descriptor:this.descriptorValue})}};var Ki=require("@seatlayer/core");var sp="seatlayer-season-picker-style";function ap(){if(document.getElementById(sp))return;let i=document.createElement("style");i.id=sp,i.textContent=`
|
|
3616
3624
|
.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)}
|
|
3617
3625
|
.sl-season-root *{box-sizing:border-box}.sl-season-root button,.sl-season-root summary{font:inherit}
|
|
3618
3626
|
.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}
|
|
@@ -3628,4 +3636,4 @@ button.sl-a11yrow-c[disabled]{opacity:.58;cursor:default;text-decoration-color:t
|
|
|
3628
3636
|
.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}
|
|
3629
3637
|
@media(max-width:820px){.sl-season-stage{grid-template-columns:1fr}.sl-season-summary-card{position:static;order:-1}.sl-season-map{height:590px;min-height:590px}}
|
|
3630
3638
|
@media(max-width:560px){.sl-season-root{gap:9px}.sl-season-hero{grid-template-columns:1fr;padding:15px;border-radius:14px}.sl-season-offer{min-width:0}.sl-season-progress{grid-template-columns:1fr}.sl-season-progress li+li{border-inline-start:0;border-top:1px solid var(--sl-line,#dde3ea)}.sl-season-progress li[data-state=upcoming]{display:none}.sl-season-date-list{grid-template-columns:1fr}.sl-season-map{height:560px;min-height:560px}.sl-season-summary-card{padding:13px}.sl-season-benefits{display:grid;grid-template-columns:1fr}}
|
|
3631
|
-
`,document.head.appendChild(i)}var tf=new Set(["audience_not_public","sales_not_open","origin_not_allowed"]),nf=3e4;function of(i,e){if(!i||typeof i!="object"||Array.isArray(i))return!1;let t=i;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.seasonKey===e&&Array.isArray(t.planActivationIds)&&t.planActivationIds.every(n=>typeof n=="string"&&!!n)}var pn=class extends Error{constructor(t,n){super(`season_public_session_refused:${t}`);this.reason=t;this.status=n;this.name="SeasonPublicSessionRefused"}},dt,Pt,hn,Ni,Ur=class{constructor(e){this.options=e;R(this,dt,null);R(this,Pt,null);R(this,hn);R(this,Ni);S(this,hn,e.fetch??globalThis.fetch.bind(globalThis)),S(this,Ni,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return m(this,dt)}async mint(e=!1){if(e&&S(this,dt,null),m(this,dt)&&m(this,dt).expiresAt-nf>Date.now())return m(this,dt);if(m(this,Pt))return m(this,Pt);let t=(async()=>{let n=await m(this,hn).call(this,`${this.options.base}/pub/seasons/${encodeURIComponent(this.options.season)}/sessions`,{method:"POST",body:JSON.stringify(m(this,Ni)?{origin:m(this,Ni)}:{}),credentials:"omit"}),o=await n.json().catch(()=>null);if(!n.ok){let r=o?.code??o?.error;if(n.status===403&&r&&tf.has(r)){let s=r;throw this.options.onRefused?.({reason:s,code:r,status:n.status,retryable:s==="sales_not_open"}),new pn(s,n.status)}throw new Error(`season_public_session_failed_${n.status}`)}if(!of(o,this.options.season))throw new Error("season_public_session_invalid");return S(this,dt,o),o})();S(this,Pt,t);try{return await t}finally{m(this,Pt)===t&&S(this,Pt,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.mint(t);return{token:n.token,expiresAt:n.expiresAt}}};dt=new WeakMap,Pt=new WeakMap,hn=new WeakMap,Ni=new WeakMap;function ip(i){let e=new Ur(i);return{access:new De({provider:({reason:n})=>e.token(n),...i.accessHooks}),loader:e}}Go();var rf="https://api.seatlayer.io",sf=6e4,af=5e3,ee=class extends Error{constructor(t,n,o){super(`season_request_failed:${t}`);this.code=t;this.status=n;this.name="SeasonApiError",o?.retryAfterS!==void 0&&(this.retryAfterS=o.retryAfterS),o?.retryable!==void 0&&(this.retryable=o.retryable),o?.reason!==void 0&&(this.reason=o.reason)}},mn=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function lf(i,e){let t=Number(i.headers.get("Retry-After")),n=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(af,n*1e3))}function cf(i,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,n)=>{let o=setTimeout(t,i);e?.addEventListener("abort",()=>{clearTimeout(o),n(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function np(i){if(!i||typeof i!="object")return"unknown";let e=i;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}function df(i,e){let t=e&&typeof e=="object"?e:{},n=(i.headers.get("Retry-After")??"").trim(),o=n?Number(n):Number.NaN;return{...Number.isFinite(o)&&o>=0?{retryAfterS:Math.ceil(o)}:{},...typeof t.retryable=="boolean"?{retryable:t.retryable}:{},...typeof t.reason=="string"?{reason:t.reason}:{}}}var pf=/^shc_[a-f0-9]{40}$/,hf=/^shh_[a-f0-9]{40}$/,uf=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),mf=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function qr(i){return Array.isArray(i)?i.some(qr):!i||typeof i!="object"?!1:Object.entries(i).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&pf.test(t)||qr(t))}function un(i,e,t="invalid_operation_response"){if(!i||typeof i!="object"||Array.isArray(i))throw new ee(t,502);if(qr(i))throw new ee("unsafe_operation_response",502);let n=i,o=n.allocations,r=new Set,s=Array.isArray(o)&&o.length>0&&o.every(p=>{if(!p||typeof p!="object")return!1;let u=p.eventId,h=p.state;return typeof u!="string"||!u||typeof h!="string"||!mf.has(h)||r.has(u)?!1:(r.add(u),!0)}),a=n.bookingRef===null||typeof n.bookingRef=="string"&&n.bookingRef.length>0,l=n.state!=="booked"||typeof n.bookingRef=="string"&&s&&o.every(p=>p.state==="booked"),c=n.state!=="booking_pending"||typeof n.bookingRef=="string"&&s&&o.some(p=>p.state!=="booked"),d=n.state!=="committed"||n.bookingRef===null;if(n.operationId!==e.operationId||n.seasonId!==e.seasonId||n.kind!=="HOLD"||typeof n.holdId!="string"||!hf.test(n.holdId)||n.policy!=="fixed_inclusion_same_seat"||typeof n.state!="string"||!uf.has(n.state)||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)||n.expiresAt<0||!a||typeof n.location!="string"||!n.location||typeof n.retryAfterSeconds!="number"||!Number.isFinite(n.retryAfterSeconds)||n.retryAfterSeconds<0||!s||!l||!c||!d||n.pricingAuthority!==void 0&&n.pricingAuthority!=="host"||n.authoritativeAmountIncluded!==void 0&&n.authoritativeAmountIncluded!==!1)throw new ee(t,502);return{operationId:n.operationId,seasonId:n.seasonId,kind:n.kind,holdId:n.holdId,expiresAt:n.expiresAt,policy:n.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:n.state,bookingRef:n.bookingRef,location:n.location,retryAfterSeconds:n.retryAfterSeconds,allocations:o.map(p=>({eventId:p.eventId,state:p.state}))}}function ff(i,e,t){if(!Array.isArray(i)||i.length!==t||i.some(s=>typeof s!="string"||!s)||new Set(i).size!==i.length||!Array.isArray(e)||e.length!==i.length)throw new ee("invalid_best_available_response",502);let n=i,o=new Set(n),r=new Map;for(let s of e){if(!s||typeof s!="object")throw new ee("invalid_best_available_response",502);let a=s;if(typeof a.label!="string"||!o.has(a.label)||r.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 ee("invalid_best_available_response",502);r.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:n,items:n.map(s=>r.get(s))}}function gf(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i;if(typeof e.currency!="string"||!e.currency||!Array.isArray(e.packages))return null;let t=[];for(let n of e.packages){if(!n||typeof n!="object")continue;let o=n;if(typeof o.planKey!="string"||!o.planKey||!Array.isArray(o.prices))continue;let r=[],s=new Set;for(let a of o.prices){if(!a||typeof a!="object")continue;let l=a;typeof l.categoryKey!="string"||!l.categoryKey||s.has(l.categoryKey)||typeof l.unitPrice!="number"||!Number.isInteger(l.unitPrice)||l.unitPrice<0||(s.add(l.categoryKey),r.push({categoryKey:l.categoryKey,unitPrice:l.unitPrice}))}r.length&&t.push({planKey:o.planKey,name:typeof o.name=="string"&&o.name?o.name:o.planKey,prices:r})}return t.length?{currency:e.currency,packages:t}:null}function bf(i){if(!i||typeof i!="object"||Array.isArray(i))throw new ee("invalid_checkout_response",502);let e=i,t=typeof e.redirectUrl=="string"&&!!e.redirectUrl,n=Sn(e.redirectUrl);if(t&&!n)throw new ee("gateway_unavailable",502);if(typeof e.orderId!="string"||!e.orderId||typeof e.currency!="string"||!e.currency||typeof e.totalMinor!="number"||!Number.isFinite(e.totalMinor)||typeof e.expiresAt!="number"||!Number.isFinite(e.expiresAt)||!n)throw new ee("invalid_checkout_response",502);return{orderId:e.orderId,totalMinor:e.totalMinor,currency:e.currency,expiresAt:e.expiresAt,redirectUrl:n}}function op(i,e){return{seasonKey:i.key,planActivationId:i.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:t,state:n})=>({eventKey:t,state:n}))}}var qe,Wt,et,Yt,fn,tt,it,Me,Ge,rp,Do=class{constructor(e,t){R(this,Me);R(this,qe);R(this,Wt);R(this,et);R(this,Yt);R(this,fn);R(this,tt,!1);R(this,it,null);S(this,qe,e),S(this,Wt,(t.apiBase??rf).replace(/\/$/,"")),S(this,et,t.access),S(this,Yt,t.fetch??globalThis.fetch.bind(globalThis)),S(this,fn,t.recoveryTimeoutMs??sf),m(this,et).onRenewed(n=>x(this,Me,rp).call(this,n))}async descriptor(){let{body:e}=await x(this,Me,Ge).call(this,"GET","");return e.season}async chart(){let{body:e}=await x(this,Me,Ge).call(this,"GET","/chart");return e}async availability(){let{body:e}=await x(this,Me,Ge).call(this,"GET","/availability"),t=Object.values(e.seats??{});return{...e,freeCount:t.filter(n=>n==="free").length,blockedCount:t.filter(n=>n!=="free").length}}async hold(e,t){let{body:n,response:o}=await x(this,Me,Ge).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:un(n.operation,{seasonId:m(this,qe),operationId:t}),response:o}}async bestAvailable(e){let{body:t,response:n}=await x(this,Me,Ge).call(this,"POST","/best-available",{operationId:e.operationId,qty:e.qty,...e.categoryKey?{categoryKey:e.categoryKey}:{},...e.zoneId?{zoneId:e.zoneId}:{},...e.accessibility?.length?{accessibility:[...e.accessibility]}:{},...e.requireContiguous===!0?{requireContiguous:!0}:{}}),o=un(t.operation,{seasonId:m(this,qe),operationId:e.operationId},"invalid_best_available_response"),{labels:r,items:s}=ff(t.labels,t.items,e.qty);return{operation:o,labels:r,items:s,response:n}}async operation(e){let{body:t,response:n}=await x(this,Me,Ge).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:un(t.operation,{seasonId:m(this,qe),operationId:e}),response:n}}async release(e,t){let{body:n,response:o}=await x(this,Me,Ge).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:un(n.operation,{seasonId:m(this,qe),operationId:e}),response:o}}async prices(){let e;try{({body:e}=await x(this,Me,Ge).call(this,"GET","/prices"))}catch(t){if(t instanceof ee&&t.status===404)return null;throw t}return gf(e)}async checkout(e){let{body:t}=await x(this,Me,Ge).call(this,"POST","/checkout",{operationId:e.operationId,buyerEmail:e.buyerEmail,...e.buyerName?{buyerName:e.buyerName}:{},...e.provider?{provider:e.provider}:{},...e.returnUrl?{returnUrl:e.returnUrl}:{}});return bf(t)}async orderStatus(e){let t=await m(this,Yt).call(this,`${m(this,Wt)}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit"}),n=await t.json().catch(()=>null);if(!t.ok)throw new ee(np(n),t.status);if(n===null)throw new ee("invalid_json_response",502);return n}async renewalIntent(e){let{body:t}=await x(this,Me,Ge).call(this,"POST","/renewal-intents",{offerId:e}),n=t.intent;if(!n||n.offerId!==e||n.state!=="intent_received"||!n.intentId||!Number.isFinite(n.receivedAt))throw new ee("invalid_renewal_intent_response",502);return n}async waitForTerminal(e,t,n){let o=Date.now(),r=t?{operation:un(t.operation,{seasonId:m(this,qe),operationId:e}),response:t.response}:await this.operation(e);for(;r.operation.state==="preparing"||r.operation.state==="commit_pending"||r.operation.state==="expire_pending"||r.operation.state==="booking_pending"||r.operation.state==="abort_pending";){if(Date.now()-o>=m(this,fn))throw new mn(e);await cf(lf(r.response,r.operation),n),r=await this.operation(e)}return r.operation}destroy(){m(this,tt)||(S(this,tt,!0),m(this,et).onRenewed(void 0),m(this,et).clear())}};qe=new WeakMap,Wt=new WeakMap,et=new WeakMap,Yt=new WeakMap,fn=new WeakMap,tt=new WeakMap,it=new WeakMap,Me=new WeakSet,Ge=async function(e,t,n,o=!0){if(m(this,tt))throw new ee("season_api_destroyed",409);if(m(this,it))throw m(this,it);let r=await m(this,et).authorization();if(m(this,tt))throw new ee("season_api_destroyed",409);if(m(this,it))throw m(this,it);if(!r)throw new he({reason:"no_token",retryable:!1});let s=await m(this,Yt).call(this,`${m(this,Wt)}/pub/seasons/${encodeURIComponent(m(this,qe))}${t}`,{method:e,headers:{Authorization:r,...n===void 0?{}:{"Content-Type":"application/json"}},body:n===void 0?void 0:JSON.stringify(n)}),a=await s.json().catch(()=>null);if(!s.ok){let l=np(a);if(o&&await m(this,et).handleFailure(s.status,l,r))return x(this,Me,Ge).call(this,e,t,n,!1);let c=m(this,et).unavailable;throw c?new he(c):new ee(l,s.status,df(s,a))}if(a===null)throw new ee("invalid_json_response",502);return{body:a,response:s}},rp=async function(e){if(m(this,tt))return;let t=`/pub/seasons/${encodeURIComponent(m(this,qe))}/session/adopt`;for(let n=0;n<2;n++){if(m(this,tt))return;try{if((await m(this,Yt).call(this,`${m(this,Wt)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){S(this,it,null);return}}catch{}}if(!m(this,tt))throw S(this,it,new ee("season_session_adopt_failed",409)),m(this,it)};var yf=2500;function vf(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}function wf(i,e,t){if(i.startsAt==null)return{date:"Date to be announced",time:null};try{let n=new Date(i.startsAt),o=e?{timeZone:e}:{};return{date:new Intl.DateTimeFormat(t,{dateStyle:"medium",...o}).format(n),time:new Intl.DateTimeFormat(t,{timeStyle:"short",...o}).format(n)}}catch{return{date:"Date to be announced",time:null}}}function sp(i){return i.state==="committed"||i.state==="booked"}var Wr=class{constructor(e,t,n,o){this.transport=e;this.sink=t;this.intervalMs=n;this.onSessionEnded=o;this.timer=null;this.stopped=!0;this.prior={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=Object.entries(e.seats).filter(([n,o])=>this.prior[n]!==o).map(([n,o])=>({label:n,status:o}));this.prior={...e.seats},t.length&&this.sink.applyStatuses(t)}catch(e){if(jn(e)){this.stop(),this.onSessionEnded?.(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Yr=class{constructor(e,t,n){this.api=e;this.realtimePollMs=t;this.onSessionEnded=n;this.descriptorValue=null;this.availabilityValue=null;this.categoryLabels=new Map;this.reuseAvailabilityOnce=!1;this.nextOperationId=null;this.nextBestAvailable=null;this.nextReleaseActionId=null;this.operationByHold=new Map}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 ee("season_best_available_in_progress",409);let n={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=n,n}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}async chart(e){let[t,n]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.api.chart()]);this.descriptorValue=t;for(let o of n.categories??[])typeof o?.key=="string"&&typeof o.label=="string"&&this.categoryLabels.set(o.key,o.label);return{doc:n,event:{key:t.key,name:t.name,venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,n,o){if(o)throw new ee("season_hold_replace_unsupported",409);let r=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let s=await this.api.hold(t.map(l=>l.label),r),a=await this.api.waitForTerminal(r,s);if(!sp(a))throw new ee(`season_operation_${a.state}`,409);return this.remember(a),{holdId:a.holdId,expiresAt:a.expiresAt,items:t.map(l=>({label:l.label,objectId:l.label,objectType:"seat",categoryKey:"",tierId:l.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...l.quantity==null?{}:{quantity:l.quantity}}))}}async release(e,t,n){let o=this.operationForHold(n);if(!o)throw new ee("season_hold_not_found",404);let r=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let s=await this.api.release(o.operationId,r),a=await this.api.waitForTerminal(o.operationId,s);if(a.state==="partial_terminal")throw this.remember(a),new ee("season_operation_partial_terminal",409);this.forget(n)}async bestAvailable(e,t,n,o){let r=this.nextBestAvailable;this.nextBestAvailable=null;let s=r?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:s,qty:t,...n?{categoryKey:n}:{},...o?{zoneId:o}:{},...r?.accessibility?.length?{accessibility:r.accessibility}:{},...r?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(s,a);if(!sp(l))throw new ee(`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??n??"",tierId:p?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...p?.quantity==null?{}:{quantity:p.quantity}}})}}categoryLabel(e){return this.categoryLabels.get(e)??e}socketUrl(){return""}createRealtime(e,t){return new Wr(this,t,this.realtimePollMs,this.onSessionEnded)}},V,Zt,Bi,ze,Se,bn,Te,ht,ue,Le,We,Fi,Mt,ut,Jt,Ke,yn,Ye,Vi,zi,ei,$i,Lt,ti,ii,ji,E,ap,lp,Xr,Qr,Zr,Jr,Bo,Xt,cp,dp,pt,gn,pp,hp,es,ts,up,mp,fp,is,ns,de,Qt,gp,os,Di,Fo=class{constructor(e){R(this,E);R(this,V);R(this,Zt);R(this,Bi);R(this,ze);R(this,Se);R(this,bn,new AbortController);R(this,Te,null);R(this,ht,null);R(this,ue,null);R(this,Le,null);R(this,We,null);R(this,Fi,null);R(this,Mt,null);R(this,ut,null);R(this,Jt,null);R(this,Ke,[]);R(this,yn,new Map);R(this,Ye,!1);R(this,Vi,!1);R(this,zi);R(this,ei,null);R(this,$i,null);R(this,Lt,null);R(this,ti,"handoff");R(this,ii,null);R(this,ji,!1);if(!e?.season)throw new Error("seatlayer: `season` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if("event"in e||"performanceGroup"in e)throw new Error("seatlayer: SeasonPicker is not SeatPicker or PerformanceGroupPicker");S(this,V,e),S(this,Zt,vf(e.container));let t={onExpired:o=>e.onAccessExpired?.(o),onUnavailable:o=>{let r=m(this,ei)&&o.reason==="provider_failed"?m(this,ei):o;S(this,ei,null),S(this,$i,r.reason==="provider_failed"?null:r),e.onAccessUnavailable?.(r),x(this,E,up).call(this,r)}};if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider){let{access:o,loader:r}=ip({base:(e.apiBase??"https://api.seatlayer.io").replace(/\/$/,""),season:e.season,fetch:e.fetch,onRefused:s=>{S(this,ei,s)},accessHooks:t});S(this,Bi,o),S(this,zi,r)}else S(this,zi,null),S(this,Bi,new De({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,...t}));S(this,ze,new Do(e.season,{apiBase:e.apiBase,access:m(this,Bi),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs})),S(this,Se,new Yr(m(this,ze),Math.max(750,e.realtimePollMs??yf),o=>x(this,E,gp).call(this,o)))}async render(){x(this,E,os).call(this),tp(),x(this,E,lp).call(this),x(this,E,de).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let[e,t,n]=await Promise.all([m(this,ze).descriptor(),m(this,ze).availability(),m(this,ze).prices().catch(()=>null)]);return m(this,Ye)?this:(S(this,Te,e),S(this,ht,t),S(this,Lt,n),S(this,ti,m(this,V).checkout==="hosted"&&e.checkoutMode!=="server"&&n?"hosted":"handoff"),m(this,Se).prime(e,t),x(this,E,Xr).call(this),await x(this,E,ap).call(this,e),m(this,Ye)?this:(n&&x(this,E,Xr).call(this),x(this,E,fp).call(this),x(this,E,de).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included performance.`}),m(this,V).initialOperationId&&await this.restoreOperation(m(this,V).initialOperationId),this))}catch(e){if(m(this,Ye))return this;throw x(this,E,Qt).call(this,e)}}async holdSameSeat(e,t){if(x(this,E,Di).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,Se).queueOperation(t),m(this,Le).selectObjectsWithoutConfirmation([...e]),x(this,E,de).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await m(this,Le).handleCta(),!m(this,ue))throw new ee("season_hold_not_created",409);return m(this,ue)}async holdBestAvailable(e,t,n={}){if(x(this,E,Di).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: positive Best Available quantity is required");let o=m(this,Le).maxTickets;if(e>o)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${o})`);if(m(this,Vi))throw new ee("season_best_available_in_progress",409);S(this,Vi,!0);let r=null;try{if(r=m(this,Se).queueBestAvailable(t,n),x(this,E,de).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,n.categoryKey,{zoneId:n.zoneId})||!m(this,ue))throw new ee("season_hold_not_created",409);return m(this,ue)}catch(s){throw x(this,E,Qt).call(this,s,t)}finally{r&&m(this,Se).clearBestAvailable(r),S(this,Vi,!1)}}async restoreOperation(e){x(this,E,Di).call(this),x(this,E,de).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await m(this,ze).waitForTerminal(e,void 0,m(this,bn).signal);return t.state==="aborted"||t.state==="expired"?(S(this,ue,null),m(this,V).onHoldChange?.(null),x(this,E,de).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(m(this,Se).remember(t),x(this,E,Jr).call(this,t,!1))}catch(t){throw x(this,E,Qt).call(this,t,e)}}async release(e){x(this,E,Di).call(this);let t=m(this,ue);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");m(this,Se).queueRelease(e),x(this,E,de).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,Se).release("",[],t.holdId),x(this,E,Bo).call(this)),x(this,E,de).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(n){throw x(this,E,Qt).call(this,n,t.operationId)}}}async createRenewalIntent(e){if(x(this,E,Di).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");x(this,E,de).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await m(this,ze).renewalIntent(e);return x(this,E,de).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),m(this,V).onRenewalIntent?.(t),t}catch(t){throw x(this,E,Qt).call(this,t)}}getDescriptor(){return m(this,Te)}getAvailability(){return m(this,ht)}getHandoff(){return m(this,ue)}destroy(){m(this,Ye)||(S(this,Ye,!0),m(this,bn).abort(),x(this,E,ns).call(this),m(this,Le)?.destroy(),m(this,ze).destroy(),m(this,Zt).replaceChildren(),S(this,We,null),S(this,Fi,null),S(this,Mt,null),S(this,ut,null),S(this,Jt,null),S(this,Te,null),S(this,ht,null),S(this,ue,null))}};V=new WeakMap,Zt=new WeakMap,Bi=new WeakMap,ze=new WeakMap,Se=new WeakMap,bn=new WeakMap,Te=new WeakMap,ht=new WeakMap,ue=new WeakMap,Le=new WeakMap,We=new WeakMap,Fi=new WeakMap,Mt=new WeakMap,ut=new WeakMap,Jt=new WeakMap,Ke=new WeakMap,yn=new WeakMap,Ye=new WeakMap,Vi=new WeakMap,zi=new WeakMap,ei=new WeakMap,$i=new WeakMap,Lt=new WeakMap,ti=new WeakMap,ii=new WeakMap,ji=new WeakMap,E=new WeakSet,ap=async function(e){let t=new lt(Ho({container:m(this,Fi),event:e.key,apiBase:m(this,V).apiBase,transport:m(this,Se),hideEventDetails:!0,maxSelection:m(this,V).maxSelection,selectedObjects:m(this,V).selectedObjects,selectableObjects:m(this,V).selectableObjects,numberOfPlacesToSelect:m(this,V).numberOfPlacesToSelect,selectionValidators:m(this,V).selectionValidators,locale:m(this,V).locale,messages:m(this,V).messages,languages:m(this,V).languages,colorblindSafe:m(this,V).colorblindSafe,initialView:m(this,V).initialView,enable3D:m(this,V).enable3D,max3DSeats:m(this,V).max3DSeats,hideBadge:m(this,V).hideBadge,theme:m(this,V).theme,confirmSelection:m(this,V).confirmSelection,seatView:m(this,V).seatView,onBuyerViewChange:m(this,V).onBuyerViewChange,onAnalytics:(n,o)=>{try{m(this,V).onAnalytics?.(n,{...o,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:e.occurrenceCount})}catch{}},onSelectionChange:n=>{S(this,Ke,n.map(o=>o.label)),S(this,yn,new Map(n.filter(o=>!!o.categoryKey).map(o=>[o.label,o.categoryKey]))),x(this,E,Xt).call(this),m(this,V).onSelectionChange?.(n)},onSelectionValidityChange:m(this,V).onSelectionValidityChange,onHoldChange:n=>{if(!n){x(this,E,Bo).call(this);return}let o=m(this,Se).operationForHold(n.holdId);o&&x(this,E,Jr).call(this,o,!0)},onCheckout:()=>{m(this,ue)&&(x(this,E,pt).call(this,"checkout"),m(this,V).onContinue?.(m(this,ue)),m(this,ti)==="hosted"&&x(this,E,mp).call(this,m(this,ue)))},onHoldExpired:()=>{x(this,E,Bo).call(this),x(this,E,de).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),m(this,V).onHoldExpired?.()},onError:n=>x(this,E,Qt).call(this,n)},{surface:"season",performanceCount:e.occurrenceCount,selectionMode:"same_seat",suppressPricing:!0,groupSelectionSummary:()=>{let n=m(this,Ke).length;return n?{seats:n,performances:e.occurrenceCount,performancesChosen:e.occurrenceCount,perPerformance:n}:null}}));S(this,Le,t),await t.render()},lp=function(){m(this,Zt).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",m(this,V).header===!1&&(t.style.display="none");let n=document.createElement("ol");n.className="sl-season-progress",n.setAttribute("aria-label","Season checkout progress");for(let[g,T]of["Choose seats","Review package","Checkout"].entries()){let w=document.createElement("li");w.dataset.state=g===0?"current":"upcoming";let v=document.createElement("span");v.textContent=String(g+1),w.append(v,T),n.append(w)}let o=document.createElement("div");o.className="sl-season-stage";let r=document.createElement("div");r.className="sl-season-map";let s=document.createElement("aside");s.className="sl-season-summary-card",s.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.",s.append(a,l,c,u,h),o.append(r,s);let b=document.createElement("p");b.className="sl-season-status",b.setAttribute("role","status"),b.setAttribute("aria-live","polite"),e.append(t,n,o,b),m(this,Zt).append(e),S(this,We,e),S(this,Fi,r),S(this,Mt,b),S(this,ut,l),S(this,Jt,u)},Xr=function(){let e=m(this,Te),t=m(this,V).offer,n=m(this,We).querySelector(".sl-season-hero");n.replaceChildren();let o=document.createElement("div");o.className="sl-season-copy";let r=document.createElement("p");r.className="sl-season-eyebrow",r.textContent=t?.eyebrow??"Season ticket";let s=document.createElement("h2");s.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 h of[`${e.occurrenceCount} performances`,e.venue,t?.renewalLabel??"Same-seat package"].filter(Boolean)){let b=document.createElement("span");b.className="sl-season-fact",b.textContent=h,l.append(b)}o.append(r,s,a,l),n.append(o);let c=document.createElement("div");c.className="sl-season-offer";let d=document.createElement("span");d.className="sl-season-offer-label";let p=x(this,E,gn).call(this);if(p){d.textContent=y("season.packagePriceLabel","Package price"),c.append(d,x(this,E,hp).call(this,p,e.occurrenceCount));let h=document.createElement("span");h.className="sl-season-price-note",h.textContent=y("season.packagePricePerSeat","Per seat, for the whole package."),c.append(h),n.append(c),x(this,E,Qr).call(this,n,t),x(this,E,Zr).call(this,n,e),x(this,E,Xt).call(this);return}d.textContent=t?.priceLabel?"Season package":"Package price";let u=document.createElement(t?.priceLabel?"strong":"span");if(u.className=t?.priceLabel?"sl-season-price":"sl-season-price-note",u.textContent=t?.priceLabel??"Confirmed by your ticketing platform at checkout",c.append(d,u),t?.compareAtPriceLabel){let h=document.createElement("span");h.className="sl-season-was",h.textContent=t.compareAtPriceLabel,c.append(h)}if(t?.savingsLabel){let h=document.createElement("span");h.className="sl-season-saving",h.textContent=t.savingsLabel,c.append(h)}if(t?.priceNote){let h=document.createElement("span");h.className="sl-season-price-note",h.textContent=t.priceNote,c.append(h)}n.append(c),x(this,E,Qr).call(this,n,t),x(this,E,Zr).call(this,n,e),x(this,E,Xt).call(this)},Qr=function(e,t){if(!t?.benefits?.length)return;let n=document.createElement("ul");n.className="sl-season-benefits";for(let o of t.benefits.slice(0,6)){let r=document.createElement("li");r.textContent=o,n.append(r)}e.append(n)},Zr=function(e,t){let n=document.createElement("details");n.className="sl-season-dates";let o=document.createElement("summary");o.textContent=`All ${t.occurrenceCount} performances included`;let r=document.createElement("ol");r.className="sl-season-date-list";for(let s of t.occurrences){let a=document.createElement("li");a.className="sl-season-date";let l=document.createElement("b");l.textContent=s.name;let c=wf(s,t.timezone,m(this,V).locale),d=document.createElement("time");s.startsAt!=null&&(d.dateTime=new Date(s.startsAt).toISOString()),d.textContent=c.time?`${c.date} \xB7 ${c.time}`:c.date,a.append(l,d),r.append(a)}n.append(o,r),e.append(n)},Jr=function(e,t){if(e.state==="booked")return S(this,ue,null),m(this,Se).forget(e.holdId),m(this,Le)?.notifyGroupSettled("booked"),x(this,E,pt).call(this,"complete"),x(this,E,de).call(this,{kind:"booked",message:`Your Season booking is complete for all ${m(this,Te).occurrenceCount} performances. No further checkout action is needed.`,operationId:e.operationId}),m(this,V).onHoldChange?.(null),null;if(e.state==="partial_terminal")return S(this,ue,null),S(this,Ke,[]),m(this,Se).forget(e.holdId),m(this,Le)?.notifyGroupSettled("lost"),x(this,E,Xt).call(this),x(this,E,pt).call(this,"review"),x(this,E,de).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),m(this,V).onHoldChange?.(null),null;if(e.state!=="committed")return S(this,ue,null),m(this,Se).forget(e.holdId),m(this,Le)?.notifyGroupSettled("lost"),x(this,E,de).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),m(this,V).onHoldChange?.(null),null;let n=op(m(this,Te),e),o=m(this,ue)?.holdId!==n.holdId;return S(this,ue,n),x(this,E,Xt).call(this),x(this,E,pt).call(this,"review"),m(this,V).onHoldChange?.(n),x(this,E,de).call(this,{kind:"held",message:`Your seats are held for all ${m(this,Te).occurrenceCount} performances. Review and continue to checkout.`,operationId:e.operationId}),o&&t&&m(this,V).onHold?.(n),n},Bo=function(){S(this,ue,null),S(this,Ke,[]),x(this,E,Xt).call(this),x(this,E,pt).call(this,"choose"),m(this,V).onHoldChange?.(null)},Xt=function(){if(!m(this,ut))return;let e=m(this,Ke).length;if(!e)m(this,ut).textContent="Choose a seat on the map. Unavailable seats are already booked on at least one included performance.";else{m(this,ut).replaceChildren();let t=document.createElement("strong");t.textContent=m(this,Ke).join(", "),m(this,ut).append(t,` \xB7 ${e} Season seat${e===1?"":"s"} across all ${m(this,Te)?.occurrenceCount??0} performances`)}m(this,Jt)&&m(this,ht)&&(m(this,Jt).textContent=`${m(this,ht).freeCount} seat${m(this,ht).freeCount===1?"":"s"} currently available for the complete Season`),x(this,E,cp).call(this),x(this,E,dp).call(this)},cp=function(){let e=m(this,We)?.querySelector(".sl-season-summary-card");if(!e)return;e.querySelector(".sl-season-package-total")?.remove();let t=x(this,E,es).call(this);if(t==null)return;let n=m(this,Lt)?.currency??m(this,Te)?.currency??"USD",o=m(this,Te)?.occurrenceCount??0,r=document.createElement("p");r.className="sl-season-package-total";let s=document.createElement("span");s.textContent=y("season.packageTotal","Package total");let a=document.createElement("strong");a.textContent=x(this,E,ts).call(this,t,n);let l=document.createElement("span");l.className="sl-season-package-total-scope",l.textContent=y("season.priceForAllDates","for all {count} dates").replace("{count}",String(o)),r.append(s,a,l);let c=e.querySelector(".sl-season-checkout-note");c?e.insertBefore(r,c):e.append(r)},dp=function(){let e=m(this,We)?.querySelector(".sl-season-checkout-note");if(e){if(m(this,ti)==="hosted"){e.textContent=y("season.hostedCheckoutNote","You pay for the whole package here. Your tickets for every performance arrive by email.");return}if(x(this,E,gn).call(this)){e.textContent=y("season.serverCheckoutPricedNote","Payment and admission passes are completed in the checkout on this page.");return}e.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits."}},pt=function(e){let t=e==="choose"?0:e==="review"?1:e==="checkout"?2:3;m(this,We)?.querySelectorAll(".sl-season-progress li").forEach((n,o)=>{n.dataset.state=o<t?"done":o===t?"current":"upcoming";let r=n.querySelector("span");r&&(r.textContent=o<t?"\u2713":String(o+1))})},gn=function(){let e=m(this,Lt)?.packages;if(!e?.length)return null;let t=m(this,Te)?.planActivationId,n=e.find(s=>s.planKey===t);if(n)return n;let o=m(this,zi)?.session?.planActivationIds;return(o?.length?e.filter(s=>o.includes(s.planKey)):[])[0]??e[0]},pp=function(e){let t=x(this,E,gn).call(this)?.prices.find(n=>n.categoryKey===e);return t?t.unitPrice:null},hp=function(e,t){let n=document.createElement("ul");n.className="sl-season-price-lines";let o=m(this,Lt)?.currency??m(this,Te)?.currency??"USD";for(let r of e.prices){let s=document.createElement("li"),a=document.createElement("span");a.className="sl-season-price-category",a.textContent=m(this,Se).categoryLabel(r.categoryKey);let l=document.createElement("strong");l.className="sl-season-price",l.textContent=x(this,E,ts).call(this,r.unitPrice,o);let c=document.createElement("span");c.className="sl-season-price-scope",c.textContent=y("season.priceForAllDates","for all {count} dates").replace("{count}",String(t)),s.append(a,l,c),n.append(s)}return n},es=function(){if(!m(this,Ke).length||!x(this,E,gn).call(this))return null;let e=0;for(let t of m(this,Ke)){let n=m(this,yn).get(t),o=n?x(this,E,pp).call(this,n):null;if(o==null)return null;e+=o}return e},ts=function(e,t){let n=(0,Gi.fromMinorUnits)(e,t),o=Number.isInteger(n);return(0,Gi.formatMoney)(n,t,{locale:m(this,V).locale,fallback:(r,s)=>`${r} ${s}`,...o?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},up=function(e){let t=e.reason==="audience_not_public"?y("season.accessNotPublic","This season isn't open for online booking yet."):e.reason==="sales_not_open"?y("season.accessSalesNotOpen","Season tickets aren't on sale right now. Check back when sales open."):e.reason==="origin_not_allowed"?y("season.accessOriginNotAllowed","This season can't be booked from this page."):y("season.accessUnavailable","Season tickets can't be loaded right now. Please try again later.");x(this,E,de).call(this,{kind:"failed",message:t})},mp=async function(e){if(!m(this,ji)){S(this,ji,!0);try{let t=m(this,Lt)?.currency??m(this,Te)?.currency??"USD",n=x(this,E,es).call(this);if(n==null){x(this,E,de).call(this,{kind:"failed",message:y("season.checkoutNotPriced","We can\u2019t price this package here. Your seats are still held \u2014 please continue in the checkout on this page."),operationId:e.operationId});return}await x(this,E,is).call(this,{kind:"pay",provider:null,order:{holdId:e.operationId,expiresAt:e.expiresAt,currency:t,total:(0,Gi.fromMinorUnits)(n,t),labels:[...m(this,Ke)]}})}finally{S(this,ji,!1)}}},fp=function(){if(m(this,ti)!=="hosted")return;let e=Li(m(this,V).season);e?.outcome!=="success"||!e.orderId||(x(this,E,pt).call(this,"checkout"),x(this,E,is).call(this,{kind:"resume",orderId:e.orderId}))},is=async function(e){let t;try{({mountCheckout:t}=await li())}catch(o){m(this,V).onError?.(o),x(this,E,de).call(this,{kind:"failed",message:y("season.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held. Please try again.")});return}let n=m(this,Le)?.root;m(this,Ye)||!n||(x(this,E,ns).call(this),S(this,ii,t({root:n,state:e,eventKey:m(this,V).season,formatMoney:(o,r)=>(0,Gi.formatMoney)(o,r,{locale:m(this,V).locale,fallback:(s,a)=>`${s} ${a}`,...Number.isInteger(o)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:o=>m(this,ze).checkout({operationId:o.holdId,buyerEmail:o.buyerEmail,...o.buyerName?{buyerName:o.buyerName}:{},...m(this,V).returnUrl?{returnUrl:m(this,V).returnUrl}:{}}),orderStatus:o=>m(this,ze).orderStatus(o),onCancel:()=>{S(this,ii,null),m(this,ue)&&x(this,E,pt).call(this,"review")},onConfirmed:o=>{m(this,V).onOrderConfirmed?.(o),x(this,E,pt).call(this,"complete"),x(this,E,de).call(this,{kind:"booked",message:y("season.orderConfirmed","Your season tickets are confirmed for every included performance.")})},onError:o=>m(this,V).onError?.(o)})))},ns=function(){m(this,ii)?.destroy(),S(this,ii,null)},de=function(e,t=!1){m(this,Mt)&&(m(this,Mt).textContent=e.message,m(this,Mt).dataset.kind=e.kind),m(this,We)&&(m(this,We).dataset.busy=String(t)),m(this,V).onStatusChange?.(e)},Qt=function(e,t){let n=e instanceof he&&e.reason==="provider_failed"&&m(this,$i)?new he(m(this,$i)):e;if(n instanceof he)return m(this,V).onError?.(n),n;let o=n instanceof ee?`Season selection unavailable (${n.code}).`:"Season selection could not be completed.";return x(this,E,de).call(this,{kind:"failed",message:o,operationId:t}),m(this,V).onError?.(n),n},gp=function(e){m(this,Ye)||(e instanceof he||x(this,E,de).call(this,{kind:"failed",message:y("season.sessionEnded","The seat map stopped updating. Reload the page to see which seats are free now.")}),m(this,V).onError?.(e))},os=function(){if(m(this,Ye))throw new Error("seatlayer: SeasonPicker was destroyed")},Di=function(){if(x(this,E,os).call(this),!m(this,Te)||!m(this,Le))throw new Error("seatlayer: render SeasonPicker before using it")};function bp(i,e={}){let t=e.origin??"";if(!t)try{t=new URL(i.src,window.location.href).origin}catch{t=""}let n=!1,o=null,r=null,s=null,a="",l=null,c="",d=()=>{if(n)return;n=!0,o=i.getAttribute("style"),Object.assign(i.style,{position:"fixed",inset:"0",margin:"0",border:"0",zIndex:"2147483000",background:c||"transparent"}),i.style.width="100vw",i.style.height="100vh",i.style.width="100dvw",i.style.height="100dvh";let h=document.documentElement;r=h.style.overflow,h.style.overflow="hidden",document.body&&(s=document.body.style.overflow,document.body.style.overflow="hidden"),l=b=>{b.key==="Escape"&&p()},window.addEventListener("keydown",l)},p=()=>{n&&(n=!1,o===null?i.removeAttribute("style"):i.setAttribute("style",o),o=null,a&&(i.style.height=a),r!==null&&(document.documentElement.style.overflow=r,r=null),s!==null&&document.body&&(document.body.style.overflow=s,s=null),l&&(window.removeEventListener("keydown",l),l=null))},u=h=>{if(h.source!==i.contentWindow||t&&h.origin!==t||!h.data||typeof h.data!="object")return;let b=h.data;if(b.type==="seatlayer:height"){typeof b.px=="number"&&Number.isFinite(b.px)&&b.px>0&&(a=`${Math.round(b.px)}px`,n||(i.style.height=a));return}b.type==="seatlayer:fullscreen"&&(typeof b.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(b.background)&&(c=b.background,n&&(i.style.background=c)),b.on===!0?d():b.on===!1&&p())};return window.addEventListener("message",u),()=>{window.removeEventListener("message",u),p()}}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,SeasonPublicSessionRefused,SeasonRecoveryTimeoutError,SeatPicker,SeatingChart,attachPickerFrame,bindSeatingChartHandle,buildSeatingChartOptions,createBuyerAccessContext,createControllerSink,parseTicketOfferAvailability,prewarmSeatPicker,shortOperationReference,ticketOfferPrices});
|
|
3639
|
+
`,document.head.appendChild(i)}var gf=new Set(["audience_not_public","sales_not_open","origin_not_allowed"]),bf=3e4;function yf(i,e){if(!i||typeof i!="object"||Array.isArray(i))return!1;let t=i;return typeof t.token=="string"&&t.token.length>0&&typeof t.expiresAt=="number"&&Number.isFinite(t.expiresAt)&&t.expiresAt>Date.now()&&t.seasonKey===e&&Array.isArray(t.planActivationIds)&&t.planActivationIds.every(n=>typeof n=="string"&&!!n)}var hn=class extends Error{constructor(t,n){super(`season_public_session_refused:${t}`);this.reason=t;this.status=n;this.name="SeasonPublicSessionRefused"}},dt,Pt,un,Ni,Ur=class{constructor(e){this.options=e;R(this,dt,null);R(this,Pt,null);R(this,un);R(this,Ni);S(this,un,e.fetch??globalThis.fetch.bind(globalThis)),S(this,Ni,e.origin??(typeof location>"u"?void 0:location.origin))}get session(){return m(this,dt)}async mint(e=!1){if(e&&S(this,dt,null),m(this,dt)&&m(this,dt).expiresAt-bf>Date.now())return m(this,dt);if(m(this,Pt))return m(this,Pt);let t=(async()=>{let n=await m(this,un).call(this,`${this.options.base}/pub/seasons/${encodeURIComponent(this.options.season)}/sessions`,{method:"POST",body:JSON.stringify(m(this,Ni)?{origin:m(this,Ni)}:{}),credentials:"omit"}),o=await n.json().catch(()=>null);if(!n.ok){let r=o?.code??o?.error;if(n.status===403&&r&&gf.has(r)){let s=r;throw this.options.onRefused?.({reason:s,code:r,status:n.status,retryable:s==="sales_not_open"}),new hn(s,n.status)}throw new Error(`season_public_session_failed_${n.status}`)}if(!yf(o,this.options.season))throw new Error("season_public_session_invalid");return S(this,dt,o),o})();S(this,Pt,t);try{return await t}finally{m(this,Pt)===t&&S(this,Pt,null)}}async token(e){let t=e==="expiring"||e==="expired"||e==="unauthorized"||e==="manual",n=await this.mint(t);return{token:n.token,expiresAt:n.expiresAt}}};dt=new WeakMap,Pt=new WeakMap,un=new WeakMap,Ni=new WeakMap;function lp(i){let e=new Ur(i);return{access:new De({provider:({reason:n})=>e.token(n),...i.accessHooks}),loader:e}}Go();var vf="https://api.seatlayer.io",wf=6e4,xf=5e3,ee=class extends Error{constructor(t,n,o){super(`season_request_failed:${t}`);this.code=t;this.status=n;this.name="SeasonApiError",o?.retryAfterS!==void 0&&(this.retryAfterS=o.retryAfterS),o?.retryable!==void 0&&(this.retryable=o.retryable),o?.reason!==void 0&&(this.reason=o.reason)}},fn=class extends Error{constructor(t){super(`season_operation_timeout:${t}`);this.operationId=t;this.name="SeasonRecoveryTimeoutError"}};function kf(i,e){let t=Number(i.headers.get("Retry-After")),n=Number.isFinite(t)&&t>=0?t:e.retryAfterSeconds;return Math.max(0,Math.min(xf,n*1e3))}function Sf(i,e){return e?.aborted?Promise.reject(e.reason??new DOMException("Aborted","AbortError")):new Promise((t,n)=>{let o=setTimeout(t,i);e?.addEventListener("abort",()=>{clearTimeout(o),n(e.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function cp(i){if(!i||typeof i!="object")return"unknown";let e=i;return typeof e.code=="string"?e.code:typeof e.error=="string"?e.error:"unknown"}function Tf(i,e){let t=e&&typeof e=="object"?e:{},n=(i.headers.get("Retry-After")??"").trim(),o=n?Number(n):Number.NaN;return{...Number.isFinite(o)&&o>=0?{retryAfterS:Math.ceil(o)}:{},...typeof t.retryable=="boolean"?{retryable:t.retryable}:{},...typeof t.reason=="string"?{reason:t.reason}:{}}}var Ef=/^shc_[a-f0-9]{40}$/,Cf=/^shh_[a-f0-9]{40}$/,Af=new Set(["preparing","commit_pending","committed","expire_pending","booking_pending","abort_pending","aborted","partial_terminal","expired","booked"]),Pf=new Set(["pending","prepared","refused","applied","expired","booked","aborted"]);function qr(i){return Array.isArray(i)?i.some(qr):!i||typeof i!="object"?!1:Object.entries(i).some(([e,t])=>e==="childHoldId"||e==="child_hold_id"||e==="holdId"&&typeof t=="string"&&Ef.test(t)||qr(t))}function mn(i,e,t="invalid_operation_response"){if(!i||typeof i!="object"||Array.isArray(i))throw new ee(t,502);if(qr(i))throw new ee("unsafe_operation_response",502);let n=i,o=n.allocations,r=new Set,s=Array.isArray(o)&&o.length>0&&o.every(p=>{if(!p||typeof p!="object")return!1;let u=p.eventId,h=p.state;return typeof u!="string"||!u||typeof h!="string"||!Pf.has(h)||r.has(u)?!1:(r.add(u),!0)}),a=n.bookingRef===null||typeof n.bookingRef=="string"&&n.bookingRef.length>0,l=n.state!=="booked"||typeof n.bookingRef=="string"&&s&&o.every(p=>p.state==="booked"),c=n.state!=="booking_pending"||typeof n.bookingRef=="string"&&s&&o.some(p=>p.state!=="booked"),d=n.state!=="committed"||n.bookingRef===null;if(n.operationId!==e.operationId||n.seasonId!==e.seasonId||n.kind!=="HOLD"||typeof n.holdId!="string"||!Cf.test(n.holdId)||n.policy!=="fixed_inclusion_same_seat"||typeof n.state!="string"||!Af.has(n.state)||typeof n.expiresAt!="number"||!Number.isFinite(n.expiresAt)||n.expiresAt<0||!a||typeof n.location!="string"||!n.location||typeof n.retryAfterSeconds!="number"||!Number.isFinite(n.retryAfterSeconds)||n.retryAfterSeconds<0||!s||!l||!c||!d||n.pricingAuthority!==void 0&&n.pricingAuthority!=="host"||n.authoritativeAmountIncluded!==void 0&&n.authoritativeAmountIncluded!==!1)throw new ee(t,502);return{operationId:n.operationId,seasonId:n.seasonId,kind:n.kind,holdId:n.holdId,expiresAt:n.expiresAt,policy:n.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:n.state,bookingRef:n.bookingRef,location:n.location,retryAfterSeconds:n.retryAfterSeconds,allocations:o.map(p=>({eventId:p.eventId,state:p.state}))}}function Mf(i,e,t){if(!Array.isArray(i)||i.length!==t||i.some(s=>typeof s!="string"||!s)||new Set(i).size!==i.length||!Array.isArray(e)||e.length!==i.length)throw new ee("invalid_best_available_response",502);let n=i,o=new Set(n),r=new Map;for(let s of e){if(!s||typeof s!="object")throw new ee("invalid_best_available_response",502);let a=s;if(typeof a.label!="string"||!o.has(a.label)||r.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 ee("invalid_best_available_response",502);r.set(a.label,{label:a.label,objectId:a.objectId,objectType:"seat",categoryKey:a.categoryKey,tierId:a.tierId,...a.quantity===void 0?{}:{quantity:a.quantity}})}return{labels:n,items:n.map(s=>r.get(s))}}function Lf(i){if(!i||typeof i!="object"||Array.isArray(i))return null;let e=i;if(typeof e.currency!="string"||!e.currency||!Array.isArray(e.packages))return null;let t=[];for(let n of e.packages){if(!n||typeof n!="object")continue;let o=n;if(typeof o.planKey!="string"||!o.planKey||!Array.isArray(o.prices))continue;let r=[],s=new Set;for(let a of o.prices){if(!a||typeof a!="object")continue;let l=a;typeof l.categoryKey!="string"||!l.categoryKey||s.has(l.categoryKey)||typeof l.unitPrice!="number"||!Number.isInteger(l.unitPrice)||l.unitPrice<0||(s.add(l.categoryKey),r.push({categoryKey:l.categoryKey,unitPrice:l.unitPrice}))}r.length&&t.push({planKey:o.planKey,name:typeof o.name=="string"&&o.name?o.name:o.planKey,prices:r})}return t.length?{currency:e.currency,packages:t}:null}function Hf(i){if(!i||typeof i!="object"||Array.isArray(i))throw new ee("invalid_checkout_response",502);let e=i,t=typeof e.redirectUrl=="string"&&!!e.redirectUrl,n=Cn(e.redirectUrl);if(t&&!n)throw new ee("gateway_unavailable",502);if(typeof e.orderId!="string"||!e.orderId||typeof e.currency!="string"||!e.currency||typeof e.totalMinor!="number"||!Number.isFinite(e.totalMinor)||typeof e.expiresAt!="number"||!Number.isFinite(e.expiresAt)||!n)throw new ee("invalid_checkout_response",502);return{orderId:e.orderId,totalMinor:e.totalMinor,currency:e.currency,expiresAt:e.expiresAt,redirectUrl:n}}function dp(i,e){return{seasonKey:i.key,planActivationId:i.planActivationId,operationId:e.operationId,holdId:e.holdId,expiresAt:e.expiresAt,policy:e.policy,pricingAuthority:"host",authoritativeAmountIncluded:!1,state:e.state,allocations:e.allocations.map(({eventId:t,state:n})=>({eventKey:t,state:n}))}}var qe,Wt,et,Yt,gn,tt,it,Me,Ke,pp,Bo=class{constructor(e,t){R(this,Me);R(this,qe);R(this,Wt);R(this,et);R(this,Yt);R(this,gn);R(this,tt,!1);R(this,it,null);S(this,qe,e),S(this,Wt,(t.apiBase??vf).replace(/\/$/,"")),S(this,et,t.access),S(this,Yt,t.fetch??globalThis.fetch.bind(globalThis)),S(this,gn,t.recoveryTimeoutMs??wf),m(this,et).onRenewed(n=>x(this,Me,pp).call(this,n))}async descriptor(){let{body:e}=await x(this,Me,Ke).call(this,"GET","");return e.season}async chart(){let{body:e}=await x(this,Me,Ke).call(this,"GET","/chart");return e}async availability(){let{body:e}=await x(this,Me,Ke).call(this,"GET","/availability"),t=Object.values(e.seats??{});return{...e,freeCount:t.filter(n=>n==="free").length,blockedCount:t.filter(n=>n!=="free").length}}async hold(e,t){let{body:n,response:o}=await x(this,Me,Ke).call(this,"POST","/holds",{operationId:t,labels:[...e]});return{operation:mn(n.operation,{seasonId:m(this,qe),operationId:t}),response:o}}async bestAvailable(e){let{body:t,response:n}=await x(this,Me,Ke).call(this,"POST","/best-available",{operationId:e.operationId,qty:e.qty,...e.categoryKey?{categoryKey:e.categoryKey}:{},...e.zoneId?{zoneId:e.zoneId}:{},...e.accessibility?.length?{accessibility:[...e.accessibility]}:{},...e.requireContiguous===!0?{requireContiguous:!0}:{}}),o=mn(t.operation,{seasonId:m(this,qe),operationId:e.operationId},"invalid_best_available_response"),{labels:r,items:s}=Mf(t.labels,t.items,e.qty);return{operation:o,labels:r,items:s,response:n}}async operation(e){let{body:t,response:n}=await x(this,Me,Ke).call(this,"GET",`/operations/${encodeURIComponent(e)}`);return{operation:mn(t.operation,{seasonId:m(this,qe),operationId:e}),response:n}}async release(e,t){let{body:n,response:o}=await x(this,Me,Ke).call(this,"POST",`/holds/${encodeURIComponent(e)}/release`,{releaseActionId:t});return{operation:mn(n.operation,{seasonId:m(this,qe),operationId:e}),response:o}}async prices(){let e;try{({body:e}=await x(this,Me,Ke).call(this,"GET","/prices"))}catch(t){if(t instanceof ee&&t.status===404)return null;throw t}return Lf(e)}async checkout(e){let{body:t}=await x(this,Me,Ke).call(this,"POST","/checkout",{operationId:e.operationId,buyerEmail:e.buyerEmail,...e.buyerName?{buyerName:e.buyerName}:{},...e.provider?{provider:e.provider}:{},...e.returnUrl?{returnUrl:e.returnUrl}:{}});return Hf(t)}async orderStatus(e){let t=await m(this,Yt).call(this,`${m(this,Wt)}/pub/orders/${encodeURIComponent(e)}/status`,{method:"GET",credentials:"omit"}),n=await t.json().catch(()=>null);if(!t.ok)throw new ee(cp(n),t.status);if(n===null)throw new ee("invalid_json_response",502);return n}async renewalIntent(e){let{body:t}=await x(this,Me,Ke).call(this,"POST","/renewal-intents",{offerId:e}),n=t.intent;if(!n||n.offerId!==e||n.state!=="intent_received"||!n.intentId||!Number.isFinite(n.receivedAt))throw new ee("invalid_renewal_intent_response",502);return n}async waitForTerminal(e,t,n){let o=Date.now(),r=t?{operation:mn(t.operation,{seasonId:m(this,qe),operationId:e}),response:t.response}:await this.operation(e);for(;r.operation.state==="preparing"||r.operation.state==="commit_pending"||r.operation.state==="expire_pending"||r.operation.state==="booking_pending"||r.operation.state==="abort_pending";){if(Date.now()-o>=m(this,gn))throw new fn(e);await Sf(kf(r.response,r.operation),n),r=await this.operation(e)}return r.operation}destroy(){m(this,tt)||(S(this,tt,!0),m(this,et).onRenewed(void 0),m(this,et).clear())}};qe=new WeakMap,Wt=new WeakMap,et=new WeakMap,Yt=new WeakMap,gn=new WeakMap,tt=new WeakMap,it=new WeakMap,Me=new WeakSet,Ke=async function(e,t,n,o=!0){if(m(this,tt))throw new ee("season_api_destroyed",409);if(m(this,it))throw m(this,it);let r=await m(this,et).authorization();if(m(this,tt))throw new ee("season_api_destroyed",409);if(m(this,it))throw m(this,it);if(!r)throw new he({reason:"no_token",retryable:!1});let s=await m(this,Yt).call(this,`${m(this,Wt)}/pub/seasons/${encodeURIComponent(m(this,qe))}${t}`,{method:e,headers:{Authorization:r,...n===void 0?{}:{"Content-Type":"application/json"}},body:n===void 0?void 0:JSON.stringify(n)}),a=await s.json().catch(()=>null);if(!s.ok){let l=cp(a);if(o&&await m(this,et).handleFailure(s.status,l,r))return x(this,Me,Ke).call(this,e,t,n,!1);let c=m(this,et).unavailable;throw c?new he(c):new ee(l,s.status,Tf(s,a))}if(a===null)throw new ee("invalid_json_response",502);return{body:a,response:s}},pp=async function(e){if(m(this,tt))return;let t=`/pub/seasons/${encodeURIComponent(m(this,qe))}/session/adopt`;for(let n=0;n<2;n++){if(m(this,tt))return;try{if((await m(this,Yt).call(this,`${m(this,Wt)}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.token}`},body:JSON.stringify({previousToken:e.previousToken}),credentials:"omit"})).ok){S(this,it,null);return}}catch{}}if(!m(this,tt))throw S(this,it,new ee("season_session_adopt_failed",409)),m(this,it)};var Rf=2500;function If(i){let e=typeof i=="string"?document.querySelector(i):i;if(!e)throw new Error("seatlayer: Season picker container was not found");return e}function Of(i,e,t){if(i.startsAt==null)return{date:"Date to be announced",time:null};try{let n=new Date(i.startsAt),o=e?{timeZone:e}:{};return{date:new Intl.DateTimeFormat(t,{dateStyle:"medium",...o}).format(n),time:new Intl.DateTimeFormat(t,{timeStyle:"short",...o}).format(n)}}catch{return{date:"Date to be announced",time:null}}}function hp(i){return i.state==="committed"||i.state==="booked"}var Wr=class{constructor(e,t,n,o){this.transport=e;this.sink=t;this.intervalMs=n;this.onSessionEnded=o;this.timer=null;this.stopped=!0;this.prior={}}start(){this.stopped&&(this.stopped=!1,this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}stop(){this.stopped=!0,this.timer&&clearTimeout(this.timer),this.timer=null}async tick(){if(!this.stopped)try{let e=await this.transport.objects(""),t=Object.entries(e.seats).filter(([n,o])=>this.prior[n]!==o).map(([n,o])=>({label:n,status:o}));this.prior={...e.seats},t.length&&this.sink.applyStatuses(t)}catch(e){if(Un(e)){this.stop(),this.onSessionEnded?.(e);return}this.stopped||await this.sink.resync()}finally{this.stopped||(this.timer=setTimeout(()=>{this.tick()},this.intervalMs))}}},Yr=class{constructor(e,t,n){this.api=e;this.realtimePollMs=t;this.onSessionEnded=n;this.descriptorValue=null;this.availabilityValue=null;this.categoryLabels=new Map;this.reuseAvailabilityOnce=!1;this.nextOperationId=null;this.nextBestAvailable=null;this.nextReleaseActionId=null;this.operationByHold=new Map}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 ee("season_best_available_in_progress",409);let n={operationId:e,...t.accessibility?.length?{accessibility:[...t.accessibility]}:{},...t.requireContiguous===!0?{requireContiguous:!0}:{}};return this.nextBestAvailable=n,n}clearBestAvailable(e){this.nextBestAvailable===e&&(this.nextBestAvailable=null)}queueRelease(e){this.nextReleaseActionId=e}operationForHold(e){return this.operationByHold.get(e)??null}remember(e){this.operationByHold.set(e.holdId,e)}forget(e){this.operationByHold.delete(e)}async chart(e){let[t,n]=await Promise.all([this.descriptorValue?Promise.resolve(this.descriptorValue):this.api.descriptor(),this.api.chart()]);this.descriptorValue=t;for(let o of n.categories??[])typeof o?.key=="string"&&typeof o.label=="string"&&this.categoryLabels.set(o.key,o.label);return{doc:n,event:{key:t.key,name:t.name,venue:t.venue,startsAt:t.occurrences[0]?.startsAt??null,timezone:t.timezone,currency:t.currency,mode:t.mode,inventoryModelVersion:2}}}async objects(e){let t;return this.reuseAvailabilityOnce&&this.availabilityValue?(this.reuseAvailabilityOnce=!1,t=this.availabilityValue):(t=await this.api.availability(),this.availabilityValue=t),{seats:{...t.seats}}}async hold(e,t,n,o){if(o)throw new ee("season_hold_replace_unsupported",409);let r=this.nextOperationId??`sop_${crypto.randomUUID()}`;this.nextOperationId=null;let s=await this.api.hold(t.map(l=>l.label),r),a=await this.api.waitForTerminal(r,s);if(!hp(a))throw new ee(`season_operation_${a.state}`,409);return this.remember(a),{holdId:a.holdId,expiresAt:a.expiresAt,items:t.map(l=>({label:l.label,objectId:l.label,objectType:"seat",categoryKey:"",tierId:l.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...l.quantity==null?{}:{quantity:l.quantity}}))}}async release(e,t,n){let o=this.operationForHold(n);if(!o)throw new ee("season_hold_not_found",404);let r=this.nextReleaseActionId??`sra_${crypto.randomUUID()}`;this.nextReleaseActionId=null;let s=await this.api.release(o.operationId,r),a=await this.api.waitForTerminal(o.operationId,s);if(a.state==="partial_terminal")throw this.remember(a),new ee("season_operation_partial_terminal",409);this.forget(n)}async bestAvailable(e,t,n,o){let r=this.nextBestAvailable;this.nextBestAvailable=null;let s=r?.operationId??`sop_${crypto.randomUUID()}`,a=await this.api.bestAvailable({operationId:s,qty:t,...n?{categoryKey:n}:{},...o?{zoneId:o}:{},...r?.accessibility?.length?{accessibility:r.accessibility}:{},...r?.requireContiguous===!0?{requireContiguous:!0}:{}}),l=await this.api.waitForTerminal(s,a);if(!hp(l))throw new ee(`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??n??"",tierId:p?.tierId??null,unitPrice:0,currency:this.descriptorValue?.currency??"USD",...p?.quantity==null?{}:{quantity:p.quantity}}})}}categoryLabel(e){return this.categoryLabels.get(e)??e}socketUrl(){return""}createRealtime(e,t){return new Wr(this,t,this.realtimePollMs,this.onSessionEnded)}},V,Zt,Bi,$e,Se,yn,Te,ht,ue,Le,We,Fi,Mt,ut,Jt,Ge,vn,Ye,Vi,$i,ei,zi,Lt,ti,ii,ji,E,up,mp,Xr,Qr,Zr,Jr,Fo,Xt,fp,gp,pt,bn,bp,yp,es,ts,vp,wp,xp,is,ns,de,Qt,kp,os,Di,Vo=class{constructor(e){R(this,E);R(this,V);R(this,Zt);R(this,Bi);R(this,$e);R(this,Se);R(this,yn,new AbortController);R(this,Te,null);R(this,ht,null);R(this,ue,null);R(this,Le,null);R(this,We,null);R(this,Fi,null);R(this,Mt,null);R(this,ut,null);R(this,Jt,null);R(this,Ge,[]);R(this,vn,new Map);R(this,Ye,!1);R(this,Vi,!1);R(this,$i);R(this,ei,null);R(this,zi,null);R(this,Lt,null);R(this,ti,"handoff");R(this,ii,null);R(this,ji,!1);if(!e?.season)throw new Error("seatlayer: `season` key is required");if(!e.container)throw new Error("seatlayer: `container` is required");if("event"in e||"performanceGroup"in e)throw new Error("seatlayer: SeasonPicker is not SeatPicker or PerformanceGroupPicker");S(this,V,e),S(this,Zt,If(e.container));let t={onExpired:o=>e.onAccessExpired?.(o),onUnavailable:o=>{let r=m(this,ei)&&o.reason==="provider_failed"?m(this,ei):o;S(this,ei,null),S(this,zi,r.reason==="provider_failed"?null:r),e.onAccessUnavailable?.(r),x(this,E,vp).call(this,r)}};if(!e.buyerAccessToken&&!e.buyerAccessTokenProvider){let{access:o,loader:r}=lp({base:(e.apiBase??"https://api.seatlayer.io").replace(/\/$/,""),season:e.season,fetch:e.fetch,onRefused:s=>{S(this,ei,s)},accessHooks:t});S(this,Bi,o),S(this,$i,r)}else S(this,$i,null),S(this,Bi,new De({token:e.buyerAccessToken,provider:e.buyerAccessTokenProvider,...t}));S(this,$e,new Bo(e.season,{apiBase:e.apiBase,access:m(this,Bi),fetch:e.fetch,recoveryTimeoutMs:e.recoveryTimeoutMs})),S(this,Se,new Yr(m(this,$e),Math.max(750,e.realtimePollMs??Rf),o=>x(this,E,kp).call(this,o)))}async render(){x(this,E,os).call(this),ap(),x(this,E,mp).call(this),x(this,E,de).call(this,{kind:"loading",message:"Loading Season seats available for every performance."},!0);try{let[e,t,n]=await Promise.all([m(this,$e).descriptor(),m(this,$e).availability(),m(this,$e).prices().catch(()=>null)]);return m(this,Ye)?this:(S(this,Te,e),S(this,ht,t),S(this,Lt,n),S(this,ti,m(this,V).checkout==="hosted"&&e.checkoutMode!=="server"&&n?"hosted":"handoff"),m(this,Se).prime(e,t),x(this,E,Xr).call(this),await x(this,E,up).call(this,e),m(this,Ye)?this:(n&&x(this,E,Xr).call(this),x(this,E,xp).call(this),x(this,E,de).call(this,{kind:"ready",message:`${t.freeCount} seat${t.freeCount===1?"":"s"} available for every included performance.`}),m(this,V).initialOperationId&&await this.restoreOperation(m(this,V).initialOperationId),this))}catch(e){if(m(this,Ye))return this;throw x(this,E,Qt).call(this,e)}}async holdSameSeat(e,t){if(x(this,E,Di).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,Se).queueOperation(t),m(this,Le).selectObjectsWithoutConfirmation([...e]),x(this,E,de).call(this,{kind:"pending",message:"Holding the same seats for every performance.",operationId:t},!0),await m(this,Le).handleCta(),!m(this,ue))throw new ee("season_hold_not_created",409);return m(this,ue)}async holdBestAvailable(e,t,n={}){if(x(this,E,Di).call(this),!t.startsWith("sop_"))throw new Error("seatlayer: caller-stable Season operation id is required");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: positive Best Available quantity is required");let o=m(this,Le).maxTickets;if(e>o)throw new Error(`seatlayer: Best Available quantity cannot exceed the configured maximum (${o})`);if(m(this,Vi))throw new ee("season_best_available_in_progress",409);S(this,Vi,!0);let r=null;try{if(r=m(this,Se).queueBestAvailable(t,n),x(this,E,de).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,n.categoryKey,{zoneId:n.zoneId})||!m(this,ue))throw new ee("season_hold_not_created",409);return m(this,ue)}catch(s){throw x(this,E,Qt).call(this,s,t)}finally{r&&m(this,Se).clearBestAvailable(r),S(this,Vi,!1)}}async restoreOperation(e){x(this,E,Di).call(this),x(this,E,de).call(this,{kind:"pending",message:"Restoring your Season selection.",operationId:e},!0);try{let t=await m(this,$e).waitForTerminal(e,void 0,m(this,yn).signal);return t.state==="aborted"||t.state==="expired"?(S(this,ue,null),m(this,V).onHoldChange?.(null),x(this,E,de).call(this,{kind:"released",message:"The previous Season selection is no longer held.",operationId:e}),null):(m(this,Se).remember(t),x(this,E,Jr).call(this,t,!1))}catch(t){throw x(this,E,Qt).call(this,t,e)}}async release(e){x(this,E,Di).call(this);let t=m(this,ue);if(t){if(!e)throw new Error("seatlayer: caller-stable release action id is required");m(this,Se).queueRelease(e),x(this,E,de).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,Se).release("",[],t.holdId),x(this,E,Fo).call(this)),x(this,E,de).call(this,{kind:"released",message:"The Season seats were released.",operationId:t.operationId})}catch(n){throw x(this,E,Qt).call(this,n,t.operationId)}}}async createRenewalIntent(e){if(x(this,E,Di).call(this),!e.startsWith("sro_"))throw new Error("seatlayer: Season renewal offer id is required");x(this,E,de).call(this,{kind:"pending",message:"Recording renewal intent. No purchase is made in the browser."},!0);try{let t=await m(this,$e).renewalIntent(e);return x(this,E,de).call(this,{kind:"renewal_intent",message:"Renewal intent recorded. Your ticketing platform will confirm price, payment, and renewal."}),m(this,V).onRenewalIntent?.(t),t}catch(t){throw x(this,E,Qt).call(this,t)}}getDescriptor(){return m(this,Te)}getAvailability(){return m(this,ht)}getHandoff(){return m(this,ue)}destroy(){m(this,Ye)||(S(this,Ye,!0),m(this,yn).abort(),x(this,E,ns).call(this),m(this,Le)?.destroy(),m(this,$e).destroy(),m(this,Zt).replaceChildren(),S(this,We,null),S(this,Fi,null),S(this,Mt,null),S(this,ut,null),S(this,Jt,null),S(this,Te,null),S(this,ht,null),S(this,ue,null))}};V=new WeakMap,Zt=new WeakMap,Bi=new WeakMap,$e=new WeakMap,Se=new WeakMap,yn=new WeakMap,Te=new WeakMap,ht=new WeakMap,ue=new WeakMap,Le=new WeakMap,We=new WeakMap,Fi=new WeakMap,Mt=new WeakMap,ut=new WeakMap,Jt=new WeakMap,Ge=new WeakMap,vn=new WeakMap,Ye=new WeakMap,Vi=new WeakMap,$i=new WeakMap,ei=new WeakMap,zi=new WeakMap,Lt=new WeakMap,ti=new WeakMap,ii=new WeakMap,ji=new WeakMap,E=new WeakSet,up=async function(e){let t=new lt(Ro({container:m(this,Fi),event:e.key,apiBase:m(this,V).apiBase,transport:m(this,Se),hideEventDetails:!0,maxSelection:m(this,V).maxSelection,selectedObjects:m(this,V).selectedObjects,selectableObjects:m(this,V).selectableObjects,numberOfPlacesToSelect:m(this,V).numberOfPlacesToSelect,selectionValidators:m(this,V).selectionValidators,locale:m(this,V).locale,messages:m(this,V).messages,languages:m(this,V).languages,colorblindSafe:m(this,V).colorblindSafe,initialView:m(this,V).initialView,enable3D:m(this,V).enable3D,max3DSeats:m(this,V).max3DSeats,hideBadge:m(this,V).hideBadge,theme:m(this,V).theme,confirmSelection:m(this,V).confirmSelection,seatView:m(this,V).seatView,onBuyerViewChange:m(this,V).onBuyerViewChange,onAnalytics:(n,o)=>{try{m(this,V).onAnalytics?.(n,{...o,metricScope:"season",seasonKey:e.key,planActivationId:e.planActivationId,performanceCount:e.occurrenceCount})}catch{}},onSelectionChange:n=>{S(this,Ge,n.map(o=>o.label)),S(this,vn,new Map(n.filter(o=>!!o.categoryKey).map(o=>[o.label,o.categoryKey]))),x(this,E,Xt).call(this),m(this,V).onSelectionChange?.(n)},onSelectionValidityChange:m(this,V).onSelectionValidityChange,onHoldChange:n=>{if(!n){x(this,E,Fo).call(this);return}let o=m(this,Se).operationForHold(n.holdId);o&&x(this,E,Jr).call(this,o,!0)},onCheckout:()=>{m(this,ue)&&(x(this,E,pt).call(this,"checkout"),m(this,V).onContinue?.(m(this,ue)),m(this,ti)==="hosted"&&x(this,E,wp).call(this,m(this,ue)))},onHoldExpired:()=>{x(this,E,Fo).call(this),x(this,E,de).call(this,{kind:"released",message:"The Season hold expired. Choose seats again."}),m(this,V).onHoldExpired?.()},onError:n=>x(this,E,Qt).call(this,n)},{surface:"season",performanceCount:e.occurrenceCount,selectionMode:"same_seat",suppressPricing:!0,groupSelectionSummary:()=>{let n=m(this,Ge).length;return n?{seats:n,performances:e.occurrenceCount,performancesChosen:e.occurrenceCount,perPerformance:n}:null}}));S(this,Le,t),await t.render()},mp=function(){m(this,Zt).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",m(this,V).header===!1&&(t.style.display="none");let n=document.createElement("ol");n.className="sl-season-progress",n.setAttribute("aria-label","Season checkout progress");for(let[g,T]of["Choose seats","Review package","Checkout"].entries()){let w=document.createElement("li");w.dataset.state=g===0?"current":"upcoming";let v=document.createElement("span");v.textContent=String(g+1),w.append(v,T),n.append(w)}let o=document.createElement("div");o.className="sl-season-stage";let r=document.createElement("div");r.className="sl-season-map";let s=document.createElement("aside");s.className="sl-season-summary-card",s.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.",s.append(a,l,c,u,h),o.append(r,s);let b=document.createElement("p");b.className="sl-season-status",b.setAttribute("role","status"),b.setAttribute("aria-live","polite"),e.append(t,n,o,b),m(this,Zt).append(e),S(this,We,e),S(this,Fi,r),S(this,Mt,b),S(this,ut,l),S(this,Jt,u)},Xr=function(){let e=m(this,Te),t=m(this,V).offer,n=m(this,We).querySelector(".sl-season-hero");n.replaceChildren();let o=document.createElement("div");o.className="sl-season-copy";let r=document.createElement("p");r.className="sl-season-eyebrow",r.textContent=t?.eyebrow??"Season ticket";let s=document.createElement("h2");s.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 h of[`${e.occurrenceCount} performances`,e.venue,t?.renewalLabel??"Same-seat package"].filter(Boolean)){let b=document.createElement("span");b.className="sl-season-fact",b.textContent=h,l.append(b)}o.append(r,s,a,l),n.append(o);let c=document.createElement("div");c.className="sl-season-offer";let d=document.createElement("span");d.className="sl-season-offer-label";let p=x(this,E,bn).call(this);if(p){d.textContent=y("season.packagePriceLabel","Package price"),c.append(d,x(this,E,yp).call(this,p,e.occurrenceCount));let h=document.createElement("span");h.className="sl-season-price-note",h.textContent=y("season.packagePricePerSeat","Per seat, for the whole package."),c.append(h),n.append(c),x(this,E,Qr).call(this,n,t),x(this,E,Zr).call(this,n,e),x(this,E,Xt).call(this);return}d.textContent=t?.priceLabel?"Season package":"Package price";let u=document.createElement(t?.priceLabel?"strong":"span");if(u.className=t?.priceLabel?"sl-season-price":"sl-season-price-note",u.textContent=t?.priceLabel??"Confirmed by your ticketing platform at checkout",c.append(d,u),t?.compareAtPriceLabel){let h=document.createElement("span");h.className="sl-season-was",h.textContent=t.compareAtPriceLabel,c.append(h)}if(t?.savingsLabel){let h=document.createElement("span");h.className="sl-season-saving",h.textContent=t.savingsLabel,c.append(h)}if(t?.priceNote){let h=document.createElement("span");h.className="sl-season-price-note",h.textContent=t.priceNote,c.append(h)}n.append(c),x(this,E,Qr).call(this,n,t),x(this,E,Zr).call(this,n,e),x(this,E,Xt).call(this)},Qr=function(e,t){if(!t?.benefits?.length)return;let n=document.createElement("ul");n.className="sl-season-benefits";for(let o of t.benefits.slice(0,6)){let r=document.createElement("li");r.textContent=o,n.append(r)}e.append(n)},Zr=function(e,t){let n=document.createElement("details");n.className="sl-season-dates";let o=document.createElement("summary");o.textContent=`All ${t.occurrenceCount} performances included`;let r=document.createElement("ol");r.className="sl-season-date-list";for(let s of t.occurrences){let a=document.createElement("li");a.className="sl-season-date";let l=document.createElement("b");l.textContent=s.name;let c=Of(s,t.timezone,m(this,V).locale),d=document.createElement("time");s.startsAt!=null&&(d.dateTime=new Date(s.startsAt).toISOString()),d.textContent=c.time?`${c.date} \xB7 ${c.time}`:c.date,a.append(l,d),r.append(a)}n.append(o,r),e.append(n)},Jr=function(e,t){if(e.state==="booked")return S(this,ue,null),m(this,Se).forget(e.holdId),m(this,Le)?.notifyGroupSettled("booked"),x(this,E,pt).call(this,"complete"),x(this,E,de).call(this,{kind:"booked",message:`Your Season booking is complete for all ${m(this,Te).occurrenceCount} performances. No further checkout action is needed.`,operationId:e.operationId}),m(this,V).onHoldChange?.(null),null;if(e.state==="partial_terminal")return S(this,ue,null),S(this,Ge,[]),m(this,Se).forget(e.holdId),m(this,Le)?.notifyGroupSettled("lost"),x(this,E,Xt).call(this),x(this,E,pt).call(this,"review"),x(this,E,de).call(this,{kind:"partial_terminal",message:"This Season selection needs organizer review. Do not try another selection.",operationId:e.operationId}),m(this,V).onHoldChange?.(null),null;if(e.state!=="committed")return S(this,ue,null),m(this,Se).forget(e.holdId),m(this,Le)?.notifyGroupSettled("lost"),x(this,E,de).call(this,{kind:"failed",message:"The Season selection could not be completed.",operationId:e.operationId}),m(this,V).onHoldChange?.(null),null;let n=dp(m(this,Te),e),o=m(this,ue)?.holdId!==n.holdId;return S(this,ue,n),x(this,E,Xt).call(this),x(this,E,pt).call(this,"review"),m(this,V).onHoldChange?.(n),x(this,E,de).call(this,{kind:"held",message:`Your seats are held for all ${m(this,Te).occurrenceCount} performances. Review and continue to checkout.`,operationId:e.operationId}),o&&t&&m(this,V).onHold?.(n),n},Fo=function(){S(this,ue,null),S(this,Ge,[]),x(this,E,Xt).call(this),x(this,E,pt).call(this,"choose"),m(this,V).onHoldChange?.(null)},Xt=function(){if(!m(this,ut))return;let e=m(this,Ge).length;if(!e)m(this,ut).textContent="Choose a seat on the map. Unavailable seats are already booked on at least one included performance.";else{m(this,ut).replaceChildren();let t=document.createElement("strong");t.textContent=m(this,Ge).join(", "),m(this,ut).append(t,` \xB7 ${e} Season seat${e===1?"":"s"} across all ${m(this,Te)?.occurrenceCount??0} performances`)}m(this,Jt)&&m(this,ht)&&(m(this,Jt).textContent=`${m(this,ht).freeCount} seat${m(this,ht).freeCount===1?"":"s"} currently available for the complete Season`),x(this,E,fp).call(this),x(this,E,gp).call(this)},fp=function(){let e=m(this,We)?.querySelector(".sl-season-summary-card");if(!e)return;e.querySelector(".sl-season-package-total")?.remove();let t=x(this,E,es).call(this);if(t==null)return;let n=m(this,Lt)?.currency??m(this,Te)?.currency??"USD",o=m(this,Te)?.occurrenceCount??0,r=document.createElement("p");r.className="sl-season-package-total";let s=document.createElement("span");s.textContent=y("season.packageTotal","Package total");let a=document.createElement("strong");a.textContent=x(this,E,ts).call(this,t,n);let l=document.createElement("span");l.className="sl-season-package-total-scope",l.textContent=y("season.priceForAllDates","for all {count} dates").replace("{count}",String(o)),r.append(s,a,l);let c=e.querySelector(".sl-season-checkout-note");c?e.insertBefore(r,c):e.append(r)},gp=function(){let e=m(this,We)?.querySelector(".sl-season-checkout-note");if(e){if(m(this,ti)==="hosted"){e.textContent=y("season.hostedCheckoutNote","You pay for the whole package here. Your tickets for every performance arrive by email.");return}if(x(this,E,bn).call(this)){e.textContent=y("season.serverCheckoutPricedNote","Payment and admission passes are completed in the checkout on this page.");return}e.textContent="Your ticketing platform confirms package price, payment, admission passes, and member benefits."}},pt=function(e){let t=e==="choose"?0:e==="review"?1:e==="checkout"?2:3;m(this,We)?.querySelectorAll(".sl-season-progress li").forEach((n,o)=>{n.dataset.state=o<t?"done":o===t?"current":"upcoming";let r=n.querySelector("span");r&&(r.textContent=o<t?"\u2713":String(o+1))})},bn=function(){let e=m(this,Lt)?.packages;if(!e?.length)return null;let t=m(this,Te)?.planActivationId,n=e.find(s=>s.planKey===t);if(n)return n;let o=m(this,$i)?.session?.planActivationIds;return(o?.length?e.filter(s=>o.includes(s.planKey)):[])[0]??e[0]},bp=function(e){let t=x(this,E,bn).call(this)?.prices.find(n=>n.categoryKey===e);return t?t.unitPrice:null},yp=function(e,t){let n=document.createElement("ul");n.className="sl-season-price-lines";let o=m(this,Lt)?.currency??m(this,Te)?.currency??"USD";for(let r of e.prices){let s=document.createElement("li"),a=document.createElement("span");a.className="sl-season-price-category",a.textContent=m(this,Se).categoryLabel(r.categoryKey);let l=document.createElement("strong");l.className="sl-season-price",l.textContent=x(this,E,ts).call(this,r.unitPrice,o);let c=document.createElement("span");c.className="sl-season-price-scope",c.textContent=y("season.priceForAllDates","for all {count} dates").replace("{count}",String(t)),s.append(a,l,c),n.append(s)}return n},es=function(){if(!m(this,Ge).length||!x(this,E,bn).call(this))return null;let e=0;for(let t of m(this,Ge)){let n=m(this,vn).get(t),o=n?x(this,E,bp).call(this,n):null;if(o==null)return null;e+=o}return e},ts=function(e,t){let n=(0,Ki.fromMinorUnits)(e,t),o=Number.isInteger(n);return(0,Ki.formatMoney)(n,t,{locale:m(this,V).locale,fallback:(r,s)=>`${r} ${s}`,...o?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})},vp=function(e){let t=e.reason==="audience_not_public"?y("season.accessNotPublic","This season isn't open for online booking yet."):e.reason==="sales_not_open"?y("season.accessSalesNotOpen","Season tickets aren't on sale right now. Check back when sales open."):e.reason==="origin_not_allowed"?y("season.accessOriginNotAllowed","This season can't be booked from this page."):y("season.accessUnavailable","Season tickets can't be loaded right now. Please try again later.");x(this,E,de).call(this,{kind:"failed",message:t})},wp=async function(e){if(!m(this,ji)){S(this,ji,!0);try{let t=m(this,Lt)?.currency??m(this,Te)?.currency??"USD",n=x(this,E,es).call(this);if(n==null){x(this,E,de).call(this,{kind:"failed",message:y("season.checkoutNotPriced","We can\u2019t price this package here. Your seats are still held \u2014 please continue in the checkout on this page."),operationId:e.operationId});return}await x(this,E,is).call(this,{kind:"pay",provider:null,order:{holdId:e.operationId,expiresAt:e.expiresAt,currency:t,total:(0,Ki.fromMinorUnits)(n,t),labels:[...m(this,Ge)]}})}finally{S(this,ji,!1)}}},xp=function(){if(m(this,ti)!=="hosted")return;let e=Li(m(this,V).season);e?.outcome!=="success"||!e.orderId||(x(this,E,pt).call(this,"checkout"),x(this,E,is).call(this,{kind:"resume",orderId:e.orderId}))},is=async function(e){let t;try{({mountCheckout:t}=await li())}catch(o){m(this,V).onError?.(o),x(this,E,de).call(this,{kind:"failed",message:y("season.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held. Please try again.")});return}let n=m(this,Le)?.root;m(this,Ye)||!n||(x(this,E,ns).call(this),S(this,ii,t({root:n,state:e,eventKey:m(this,V).season,formatMoney:(o,r)=>(0,Ki.formatMoney)(o,r,{locale:m(this,V).locale,fallback:(s,a)=>`${s} ${a}`,...Number.isInteger(o)?{minimumFractionDigits:0,maximumFractionDigits:0}:{}}),startSession:o=>m(this,$e).checkout({operationId:o.holdId,buyerEmail:o.buyerEmail,...o.buyerName?{buyerName:o.buyerName}:{},...m(this,V).returnUrl?{returnUrl:m(this,V).returnUrl}:{}}),orderStatus:o=>m(this,$e).orderStatus(o),onCancel:()=>{S(this,ii,null),m(this,ue)&&x(this,E,pt).call(this,"review")},onConfirmed:o=>{m(this,V).onOrderConfirmed?.(o),x(this,E,pt).call(this,"complete"),x(this,E,de).call(this,{kind:"booked",message:y("season.orderConfirmed","Your season tickets are confirmed for every included performance.")})},onError:o=>m(this,V).onError?.(o)})))},ns=function(){m(this,ii)?.destroy(),S(this,ii,null)},de=function(e,t=!1){m(this,Mt)&&(m(this,Mt).textContent=e.message,m(this,Mt).dataset.kind=e.kind),m(this,We)&&(m(this,We).dataset.busy=String(t)),m(this,V).onStatusChange?.(e)},Qt=function(e,t){let n=e instanceof he&&e.reason==="provider_failed"&&m(this,zi)?new he(m(this,zi)):e;if(n instanceof he)return m(this,V).onError?.(n),n;let o=n instanceof ee?`Season selection unavailable (${n.code}).`:"Season selection could not be completed.";return x(this,E,de).call(this,{kind:"failed",message:o,operationId:t}),m(this,V).onError?.(n),n},kp=function(e){m(this,Ye)||(e instanceof he||x(this,E,de).call(this,{kind:"failed",message:y("season.sessionEnded","The seat map stopped updating. Reload the page to see which seats are free now.")}),m(this,V).onError?.(e))},os=function(){if(m(this,Ye))throw new Error("seatlayer: SeasonPicker was destroyed")},Di=function(){if(x(this,E,os).call(this),!m(this,Te)||!m(this,Le))throw new Error("seatlayer: render SeasonPicker before using it")};function Sp(i,e={}){let t=e.origin??"";if(!t)try{t=new URL(i.src,window.location.href).origin}catch{t=""}let n=!1,o=null,r=null,s=null,a="",l=null,c="",d=()=>{if(n)return;n=!0,o=i.getAttribute("style"),Object.assign(i.style,{position:"fixed",inset:"0",margin:"0",border:"0",zIndex:"2147483000",background:c||"transparent"}),i.style.width="100vw",i.style.height="100vh",i.style.width="100dvw",i.style.height="100dvh";let h=document.documentElement;r=h.style.overflow,h.style.overflow="hidden",document.body&&(s=document.body.style.overflow,document.body.style.overflow="hidden"),l=b=>{b.key==="Escape"&&p()},window.addEventListener("keydown",l)},p=()=>{n&&(n=!1,o===null?i.removeAttribute("style"):i.setAttribute("style",o),o=null,a&&(i.style.height=a),r!==null&&(document.documentElement.style.overflow=r,r=null),s!==null&&document.body&&(document.body.style.overflow=s,s=null),l&&(window.removeEventListener("keydown",l),l=null))},u=h=>{if(h.source!==i.contentWindow||t&&h.origin!==t||!h.data||typeof h.data!="object")return;let b=h.data;if(b.type==="seatlayer:height"){typeof b.px=="number"&&Number.isFinite(b.px)&&b.px>0&&(a=`${Math.round(b.px)}px`,n||(i.style.height=a));return}b.type==="seatlayer:fullscreen"&&(typeof b.background=="string"&&/^[#a-zA-Z0-9(),.%\s-]{1,64}$/.test(b.background)&&(c=b.background,n&&(i.style.background=c)),b.on===!0?d():b.on===!1&&p())};return window.addEventListener("message",u),()=>{window.removeEventListener("message",u),p()}}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,SeasonPublicSessionRefused,SeasonRecoveryTimeoutError,SeatPicker,SeatingChart,attachPickerFrame,bindSeatingChartHandle,buildSeatingChartOptions,createBuyerAccessContext,createControllerSink,parseTicketOfferAvailability,prewarmSeatPicker,shortOperationReference,ticketOfferPrices});
|