@seatlayer/js 0.75.1 → 0.75.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +7 -7
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2682,7 +2682,7 @@
|
|
|
2682
2682
|
background-size: 640px 100%;
|
|
2683
2683
|
}
|
|
2684
2684
|
}`,e.append(t);let i="linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.10) 37%, rgba(255,255,255,0.04) 63%)",r=document.createElement("div");Object.assign(r.style,{position:"absolute",inset:"0",display:"flex",flexDirection:"column",padding:"16px",gap:"14px",opacity:"0.9"});let s=c=>{let d=document.createElement("div");return d.className="sl-shimmer",Object.assign(d.style,{background:i,borderRadius:"8px"}),Object.assign(d.style,c),d};r.append(s({height:"40px",width:"100%",flex:"0 0 auto"}));let o=document.createElement("div");Object.assign(o.style,{display:"flex",gap:"14px",flex:"1 1 auto",minHeight:"0"}),o.append(s({width:"220px",height:"100%",flex:"0 0 auto"})),o.append(s({flex:"1 1 auto",height:"100%"})),r.append(o),e.append(r);let a=document.createElement("div");Object.assign(a.style,{position:"relative",zIndex:"1",display:"flex",alignItems:"center",gap:"10px",padding:"10px 16px",borderRadius:"999px",background:"rgba(16, 22, 37, 0.72)",fontSize:"13px",fontWeight:"500",letterSpacing:"0.01em"});let l=document.createElement("span");l.className="sl-shimmer",Object.assign(l.style,{width:"9px",height:"9px",borderRadius:"50%",background:i,flex:"0 0 auto"}),a.append(l),a.append(document.createTextNode("Loading designer\u2026")),e.append(a)}buildErrorCard(e,t){let i=dl[t],r=document.createElement("div");Object.assign(r.style,{maxWidth:"420px",margin:"0 24px",padding:"28px",textAlign:"center",background:"rgba(255, 255, 255, 0.03)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",boxShadow:"0 12px 40px rgba(0, 0, 0, 0.35)"});let s=document.createElement("h2");s.textContent=i.title,Object.assign(s.style,{margin:"0 0 8px",fontSize:"17px",fontWeight:"600",color:"#f4f7ff"});let o=document.createElement("p");o.textContent=i.body,Object.assign(o.style,{margin:"0 0 20px",fontSize:"13.5px",lineHeight:"1.5",color:"#aab4c8"});let a=document.createElement("button");a.type="button",a.textContent="Try again",Object.assign(a.style,{appearance:"none",cursor:"pointer",border:"0",borderRadius:"10px",padding:"10px 22px",fontSize:"14px",fontWeight:"600",color:"#101625",background:"#7aa2ff"}),a.addEventListener("click",()=>this.handleTryAgain()),r.append(s,o,a),e.append(r)}};var C=require("@seatlayer/core"),Jt=require("@seatlayer/core/view3d/crossfade/panorama"),_o=require("@seatlayer/core/core/seatConfidence");function Xr(n){return n?.previousPrice!=null&&n.previousPrice>n.price?n.previousPrice:null}function Zr(n){return pl(n)+(n.moreLabel?`<button type="button" class="sl-price-more" aria-expanded="${!n.collapsed}">${n.esc(n.moreLabel)}</button>`:"")+hl(n.status)}function pl(n){let{esc:e,money:t}=n;return n.categories.map(i=>{let r=n.priceOf(i),s=n.rangeOf(i),o=n.offerOf(i.key),a=Xr(o),l=n.activeKey===i.key;return`<div class="sl-price-row${n.bandKeys!=null&&!n.bandKeys.has(i.key)?" sl-dim":""}${l?" sl-active":""}" data-cat="${e(i.key)}" role="button" tabindex="0" aria-pressed="${l}" title="${e(n.titleFor(i,l))}"><span class="sl-dot" style="--sl-cat-dot:${e(n.colorOf(i))}"></span><span class="sl-price-label">${e(i.label)}`+(o?.offerName?`<small class="sl-price-offer">${e(o.offerName)}</small>`:"")+`</span><span class="sl-price-left">${e(n.leftCount(n.left[i.key]??0))}</span>`+(a!=null?`<span class="sl-price-was">${e(t(a))}</span>`:"")+(s!=null?`<span class="sl-price-amt">${s.min===s.max?e(t(s.min)):`${e(t(s.min))}\u2013${e(t(s.max))}`}</span>`:r!=null?`<span class="sl-price-amt">${e(t(r))}</span>`:"")+"</div>"}).join("")}function hl(n){let e=t=>t.replace(/[&<>"']/g,i=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[i]);return`<div class="sl-status-key" aria-label="${e(n.legend)}"><span class="sl-status-item"><i class="sl-status-icon held" aria-hidden="true"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></i>${e(n.held)}</span><span class="sl-status-item"><i class="sl-status-icon sold" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M7 17L17 7"/></svg></i>${e(n.sold)}</span></div>`}function vn(n){let e=Math.abs(n.scrollLeft),t=e>2,i=e+n.clientWidth<n.scrollWidth-2;return n.dataset.fadeStart=String(t),n.dataset.fadeEnd=String(i),{start:t,end:i}}function Jr(n){let{esc:e,money:t}=n;return`<button type="button" class="sl-rc sl-rc-all" data-rail-all aria-pressed="${n.allActive}" title="${e(n.allWord)}"><span class="sl-rc-t">${e(n.allWord)}</span></button>`+n.categories.map(r=>{let s=n.rangeOf(r),o=n.priceOf(r),a=s?s.min===s.max?t(s.min):`${t(s.min)}+`:o!=null?t(o):null,l=Object.prototype.hasOwnProperty.call(n.left,r.key)&&n.left[r.key]<=0,c=Xr(n.offerOf(r.key)),d=a?`${r.label} \u2014 ${a}${l?` (${n.soldOutWord})`:""}`:r.label;return`<button type="button" class="sl-rc" data-cat="${e(r.key)}" aria-pressed="${n.activeKey===r.key}" aria-label="${e(d)}" title="${e(d)}"${l?" disabled":""}><i class="sl-rc-dot" style="--sl-cat-dot:${e(n.colorOf(r))}"></i>`+(c!=null?`<span class="sl-rc-was">${e(t(c))}</span>`:"")+`<span class="sl-rc-t">${e(a??r.label)}</span></button>`}).join("")}function es(n,e){let t=n.map(a=>({key:a.key,range:e.rangeOf(a)})).filter(a=>a.range!=null);if(!t.length)return[];let i=[...new Map(t.map(a=>[`${a.range.min}:${a.range.max}`,a.range])).values()].sort((a,l)=>a.min-l.min||a.max-l.max);if(i.length<=5)return i.map(a=>({id:`p${a.min}-${a.max}`,label:a.min===a.max?e.money(a.min):`${e.money(a.min)}\u2013${e.money(a.max)}`,keys:t.filter(l=>l.range.min===a.min&&l.range.max===a.max).map(l=>l.key),min:a.min,max:a.max}));let r=[...t].sort((a,l)=>a.range.min-l.range.min||a.range.max-l.range.max),s=Math.ceil(r.length/4),o=[];for(let a=0;a<r.length;a+=s){let l=r.slice(a,a+s),c=Math.min(...l.map(p=>p.range.min)),d=Math.max(...l.map(p=>p.range.max));o.push({id:`b${a}`,label:c===d?e.money(c):`${e.money(c)}\u2013${e.money(d)}`,keys:l.map(p=>p.key),min:c,max:d})}return o}var ul=["on-sale","low","sold-out","presale","closed"];function Ut(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function is(n){return n==null?null:typeof n=="number"&&Number.isFinite(n)&&n>=0?n:void 0}function ts(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n,t=e.count,i=e.index;if(typeof i!="number"||!Number.isInteger(i)||i<1||typeof t!="number"||!Number.isInteger(t)||t<i)return;let r=e.remaining;if(r!=null&&(typeof r!="number"||!Number.isInteger(r)||r<0))return;let s={index:i,count:t,remaining:r??null};if(e.id!==void 0){if(typeof e.id!="string"||!e.id.trim())return;s.id=e.id.trim()}if(e.name!==void 0){if(typeof e.name!="string"||!e.name.trim())return;s.name=e.name.trim()}if(e.categoryKey!==void 0){if(e.categoryKey!==null&&(typeof e.categoryKey!="string"||!e.categoryKey.trim()))return;s.categoryKey=e.categoryKey==null?null:e.categoryKey.trim()}for(let o of["startsAt","endsAt"]){if(e[o]===void 0)continue;let a=is(e[o]);if(a===void 0)return;s[o]=a}return s}function ml(n){if(n==null)return null;if(typeof n!="object"||Array.isArray(n))return;let e=n;if(!Number.isInteger(e.assignmentVersion)||e.assignmentVersion<0||!Array.isArray(e.channels)||!Array.isArray(e.objects))return;let t=[],i=new Set;for(let o of e.channels){if(!o||typeof o!="object"||Array.isArray(o))return;let a=o,l=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||i.has(l)||!Number.isInteger(a.pricingVersion)||a.pricingVersion<0||!Array.isArray(a.priceOverrides))return;let c=[],d=new Set;for(let p of a.priceOverrides){if(!p||typeof p!="object"||Array.isArray(p))return;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"",g=u.tierId===null?null:typeof u.tierId=="string"&&u.tierId.trim()?u.tierId.trim():void 0,m=Ut(u.price);if(!h||g===void 0||m===void 0||m===null)return;let v=`${h}\0${g??""}`;if(d.has(v))return;d.add(v),c.push({categoryKey:h,tierId:g,price:m})}i.add(l),t.push({channelId:l,pricingVersion:a.pricingVersion,priceOverrides:c})}let r=[],s=new Set;for(let o of e.objects){if(!o||typeof o!="object"||Array.isArray(o))return;let a=o,l=typeof a.label=="string"?a.label.trim():"",c=typeof a.channelId=="string"?a.channelId.trim():"";if(!l||s.has(l)||!i.has(c))return;s.add(l),r.push({label:l,channelId:c})}return{assignmentVersion:e.assignmentVersion,channels:t,objects:r}}function Hi(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let e=n,t=ul.find(d=>d===e.state);if(!t)return null;let i=Ut(e.fromPrice),r=Ut(e.previousPrice);if(i===void 0||r===void 0)return null;let s=e.currency==null?null:typeof e.currency=="string"&&e.currency.trim()?e.currency.trim():void 0;if(s===void 0)return null;let o=ts(e.release);if(o===void 0)return null;let a=e.upcoming===void 0?null:ts(e.upcoming);if(a===void 0)return null;let l=[];if(e.prices!=null){if(!Array.isArray(e.prices))return null;let d=[];for(let p of e.prices){if(!p||typeof p!="object"||Array.isArray(p))return null;let u=p,h=typeof u.categoryKey=="string"?u.categoryKey.trim():"";if(!h)return null;let g=Ut(u.price),m=Ut(u.previousPrice);if(g==null||m===void 0)return null;let v={categoryKey:h,price:g,previousPrice:m};if(u.offerId!==void 0){if(typeof u.offerId!="string"||!u.offerId.trim())return null;v.offerId=u.offerId.trim()}if(u.offerName!==void 0){if(typeof u.offerName!="string"||!u.offerName.trim())return null;v.offerName=u.offerName.trim()}if(u.remaining!==void 0){if(u.remaining!==null&&(typeof u.remaining!="number"||!Number.isInteger(u.remaining)||u.remaining<0))return null;v.remaining=u.remaining==null?null:u.remaining}for(let k of["startsAt","endsAt"]){if(u[k]===void 0)continue;let S=is(u[k]);if(S===void 0)return null;v[k]=S}d.push(v)}l=d}let c=ml(e.channelPricing);return c===void 0?null:{state:t,fromPrice:i,previousPrice:r,currency:s,release:o,upcoming:a,prices:l,channelPricing:c}}function ns(n,e){if(!n)return null;let t=null,i=r=>{r!=null&&r>e&&(t===null||r<t)&&(t=r)};for(let r of[n.release,n.upcoming])i(r?.startsAt),i(r?.endsAt);for(let r of n.prices)i(r.startsAt),i(r.endsAt);return t}function Ii(n){let e={};for(let t of n?.prices??[])e[t.categoryKey]=t.price;return e}var ye=require("@seatlayer/core"),ss=require("@seatlayer/core/core/seatConfidence");function yn(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function w(n){return String(n??"").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function He(n){return n?.restrictedView?y("picker.restrictedView","Restricted view"):n?.obstructedView?y("picker.obstructedView","Obstructed view"):""}function os(n){if(!n)return"";let e=[];n.premium&&e.push(`<div class="sl-cx-premium"><span class="sl-cx-star" aria-hidden="true">\u2605</span>${y("picker.premiumSeat","Premium seat")}</div>`);let t=He(n);return t?e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u25D0</span><span class="sl-cx-txt"><b>${t}</b>${n.note?`<span class="sl-cx-note">${w(n.note)}</span>`:""}</span></div>`):n.note&&e.push(`<div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u2139</span><span class="sl-cx-txt"><span class="sl-cx-note">${w(n.note)}</span></span></div>`),e.length?`<div class="sl-cx">${e.join("")}</div>`:""}function xn(n){if(!n)return"";let e=[];if(n.premium){let i=w(y("picker.premiumSeat","Premium seat"));e.push(`<span class="sl-cx-mark sl-cx-mark-premium" role="img" aria-label="${i}" title="${i}">\u2605</span>`)}let t=He(n);if(t){let i=w(n.note?`${t}: ${n.note}`:t);e.push(`<span class="sl-cx-mark sl-cx-mark-limited" role="img" aria-label="${i}" title="${i}">\u25D0</span>`)}else if(n.note){let i=w(n.note);e.push(`<span class="sl-cx-mark sl-cx-mark-info" role="img" aria-label="${i}" title="${i}">\u2139</span>`)}return e.join("")}function wn(n){if(!n)return"";let e=[];n.premium&&e.push(`<span class="sl-chip-cx-tag premium"><span aria-hidden="true">\u2605</span>${y("picker.premiumSeat","Premium seat")}</span>`);let t=He(n);return t&&e.push(`<span class="sl-chip-cx-tag limited"><span aria-hidden="true">\u25D0</span>${w(t)}</span>`),!e.length&&!n.note?"":'<div class="sl-chip-cx">'+(e.length?`<div class="sl-chip-cx-tags">${e.join("")}</div>`:"")+(n.note?`<div class="sl-chip-cx-note">${w(n.note)}</div>`:"")+"</div>"}function xt(n){return n==="no-seat"?y("picker.emptyWheelchairSpace","Empty wheelchair space"):n==="seat-present"?y("picker.accessiblePhysicalSeat","Accessible physical seat"):""}function as(n){let e=xt(n);return e?`<div class="sl-cx"><div class="sl-cx-warn"><span class="sl-cx-glyph" aria-hidden="true">\u267F</span><span class="sl-cx-txt"><b>${e}</b></span></div></div>`:""}function Ri(n){let e=xt(n);return e?`<span class="sl-cx-mark" role="img" aria-label="${e}" title="${e}">\u267F</span>`:""}function kn(n,e){if(!n)return"";let t=e?y("picker.viewFromThisSeat","View from this seat"):y("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-3d" aria-label="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span>${t}</span></button>`}function ls(n){if(!n)return"";let e=n.previous.label||n.previous.id,t=n.next.label||n.next.id;return`<span class="sl-seccard-nav" aria-label="${y("picker.browseSections","Browse sections")}"><button type="button" data-section-nav="${_(n.previous.id)}" aria-label="${y("picker.previousSection","Previous section")}: ${_(e)}" title="${_(e)}">\u2190</button><button type="button" data-section-nav="${_(n.next.id)}" aria-label="${y("picker.nextSection","Next section")}: ${_(t)}" title="${_(t)}">\u2192</button></span>`}function cs(n,e){if(!e)return"";let t=e,i=t.includes(n.id),r=i?t.length>1?y("picker.openComparison","Open comparison"):y("picker.savedForComparison","Saved for comparison"):t.length?y("picker.compareWithSaved","Compare with saved"):y("picker.saveToCompare","Save to compare");return`<button type="button" class="sl-confirm-compare"${i&&t.length===1?" disabled":""}><span aria-hidden="true">\u21C4</span><span>${w(r)}</span></button>`}function ds(n,e,t){if(!t)return"";let i=(0,ss.seatConfidenceDisclosure)(n.confidenceEvidence),r=i.modeledTarget??i.reality;return`<button type="button" class="sl-confirm-confidence" aria-label="Open seat confidence passport for ${w(n.displayLabel??n.label)}"><span><em>${w(e)}</em><strong>${w(i.headline)}</strong><small>${w(r)}</small></span><b>Passport</b></button>`}function te(n){let e=n?.rowLabel,t=n?.sectionLabel;if(!e||!t)return e;for(let i of["-"," ","\xB7","/","_"]){let r=`${t}${i}`;if(e.startsWith(r)&&e.length>r.length)return e.slice(r.length)}return(0,ye.compactRowLabel)(e,t)}function fl(n){switch(n){case"paused":return{title:y("picker.accessPausedTitle","These seats are on hold right now"),body:y("picker.accessPausedBody","The organizer has paused this selection. Try again in a few minutes."),action:y("picker.accessRetry","Try again")};case"revoked":return{title:y("picker.accessRevokedTitle","This access link is no longer active"),body:y("picker.accessRevokedBody","Ask whoever sent you here for a new link to keep booking these seats.")};case"no_token":case"provider_failed":return{title:y("picker.accessExpiredTitle","Your seat session has expired"),body:y("picker.accessExpiredBody","Reload the seat map to continue. Seats already in your cart stay held until the timer ends."),action:y("picker.accessRetry","Reload seat map")};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.")}}}function ps(n,e,t){let i=yn;return[n?.sectionLabel?`<div class="sl-confirm-field sl-confirm-sec"><span class="sl-confirm-key">${y("picker.section","Section")}</span><span class="sl-confirm-value">${i(n.sectionLabel)}</span></div>`:"",n?.rowLabel||n?.objectType==="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${i(t)}</span><span class="sl-confirm-value">${i(te(n)??n?.displayLabel??e)}</span></div>`:"",n?.objectType!=="booth"?`<div class="sl-confirm-field"><span class="sl-confirm-key">${y("picker.seat","Seat")}</span><span class="sl-confirm-value">${i(n?.seatNumber??n?.displayLabel??e)}</span></div>`:""].filter(Boolean).join("")}function hs(n,e,t){let i=yn,r=n?.objectType==="booth",s=n?.objectType==="table"&&!!n?.bookingMode,o=r||s||!n?.seatNumber,a=n?.sectionLabel??(o?void 0:n?.displayLabel),l=s?`${y("picker.guests","Guests")} ${n?.bookingMode==="variable"?`${n?.minOccupancy}\u2013${n?.maxOccupancy}`:n?.capacity}`:void 0,d=(o?[l,a?n?.rowLabel??n?.displayLabel:void 0]:[n?.rowLabel?`${t} ${te(n)??""}`.trim():void 0,`${y("picker.seat","Seat")} ${n?.seatNumber??e}`]).filter(Boolean).join(" \xB7 ");return(a?`<span class="sl-confirm-place">${i(a)}</span>`:"")+(d?`<span class="sl-confirm-pos">${a?" \xB7 ":""}${i(d)}</span>`:"")+(a||d?"":`<span class="sl-confirm-pos">${i(e)}</span>`)}function us(n,e){if(!n)return"";let t=e?y("picker.viewFromThisSeat","View from this seat"):y("picker.seeItIn3d","See it in 3D");return`<button type="button" class="sl-confirm-pill sl-confirm-3dpill" aria-label="${t}" title="${t}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2l9 5v10l-9 5-9-5V7z"/><path d="M12 12l9-5M12 12v10M12 12L3 7"/></svg><span aria-hidden="true">3D</span></button>`}function rs(n){return n.buyerMessage?.trim()||(n.restriction==="companion"?y("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):void 0)}function ms(n,e,t){let i=yn;if(n.length>1)return`<fieldset class="sl-confirm-tiers"><legend>${y("picker.ticketType","Ticket type")}</legend>`+n.map(o=>{let a=rs(o);return`<button type="button" class="sl-confirm-tier" data-confirm-tier="${i(o.id)}" aria-pressed="${o.id===e}"><span class="sl-confirm-tier-copy"><span class="sl-confirm-tier-name">${i(o.name)}</span>`+(a?`<small class="sl-confirm-tier-note">${i(a)}</small>`:"")+`</span><span class="sl-confirm-tier-price">${i(t(o))}</span></button>`}).join("")+"</fieldset>";let r=n[0],s=r?rs(r):void 0;return s?`<p class="sl-confirm-tier-note">${i(s)}</p>`:""}function Sn(n){return`<span class="sl-seccard-dot" style="background:${w(n.color)}"></span><span class="sl-seccard-name">${w(n.label)}</span><span class="sl-seccard-left" data-full="${w(n.leftLabel)}" data-short="${w(n.leftShortLabel??n.leftLabel)}">${w(n.leftLabel)}</span>`+n.nav+n.close}function fs(n){return`<div class="sl-seccard-head"><span class="sl-seccard-dot" style="background:${w(n.color)}"></span><span class="sl-seccard-name">${w(n.label)}</span>`+(n.showPrice?`<span class="sl-seccard-price">${w(n.priceLabel)}</span>`:"")+n.close+`</div><div class="sl-seccard-zone">${n.zoneLabel?`${w(n.zoneLabel)} \xB7 `:""}<span class="sl-seccard-left">${w(n.leftLabel)}</span></div>`+(n.entrance?`<div class="sl-seccard-entrance">${w(n.entrance)}</div>`:"")+(n.mix?`<div class="sl-seccard-mix">${n.mix}</div>`:"")+`<div class="sl-seccard-foot"><button type="button" class="sl-seccard-overview">\u2190 ${w(n.overviewLabel)}</button>`+n.nav+`<span class="sl-seccard-hint">${w(n.hint)}</span></div>`}function gs(n){return`<span class="sl-seccard-mix-item${n.dim?" sl-dim":""}"><span class="sl-seccard-mix-dot" style="background:${w(n.color)}"></span>${w(n.label)} <span class="sl-seccard-mix-price">${w(n.rangeLabel)}</span></span>`}function bs(n){return'<div class="sl-confirm-grid">'+n.identityFields+`</div><div class="sl-confirm-cat"><span class="sl-dot" style="background:${w(n.categoryColor)}"></span><span class="sl-confirm-cat-name">${w(n.categoryLabel)}</span>`+(n.categoryLeftLabel?`<span class="sl-confirm-left">${w(n.categoryLeftLabel)}</span>`:"")+(n.priceLabel?`<span class="sl-confirm-price">${w(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-id">'+n.marker+`<span class="sl-confirm-dot" style="background:${w(n.categoryColor)}" aria-hidden="true"></span><span class="sl-sr">${w(n.categoryLabel)}</span><span class="sl-confirm-who">`+n.identity+"</span>"+(n.priceLabel?`<span class="sl-confirm-idprice">${w(n.priceLabel)}</span>`:"")+'</div><div class="sl-confirm-body">'+n.tierChoices+n.groupDates+n.wheelchair+n.commercial+(n.thumb||n.see3dPill?`<div class="sl-confirm-strip">${n.thumb}<span class="sl-confirm-pills">${n.see3dPill}</span></div>`:"")+n.inspect+`<div class="sl-confirm-row"><button type="button" class="sl-confirm-cancel">${w(n.cancelLabel)}</button><button type="button" class="sl-confirm-add"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4 4L19 7"/></svg><span class="sl-confirm-add-t">${w(n.selectLabel)}</span></button></div></div>`}function vs(n,e){let t=_,{variable:i}=e;return`<section class="sl-table-dialog" role="dialog" aria-modal="true" aria-labelledby="sl-table-title" aria-describedby="sl-table-copy"><div class="sl-table-head"><div class="sl-table-eyebrow">${t(i?(0,ye.t)("picker.flexiblePartyTypeWord",{typeWord:e.typeWord}):(0,ye.t)("picker.wholeTypeWord",{typeWord:e.typeWord}))}</div><h2 class="sl-table-title" id="sl-table-title">${t(n.displayLabel??n.label)}</h2><p class="sl-table-copy" id="sl-table-copy">${t(i?y("picker.chooseGuestsCopy","Choose how many guests will sit together. This table is held exclusively for your party."):(0,ye.t)("picker.allPlacesBookedTogether",{count:n.capacity}))}</p></div><div class="sl-table-body"><div class="sl-table-summary"><span>${t(e.categoryLabel)}</span>`+(e.suppressPricing?"":`<b data-table-unit>${t((0,ye.t)("picker.perGuestPrice",{price:e.unitPrice}))}</b>`)+`<span class="muted">${t(y("picker.tableCapacity","Table capacity"))}</span><span>${t((0,ye.t)("picker.guestsCount",{count:n.capacity}))}</span>`+(e.suppressPricing?"":`<span class="muted">${t(y("picker.total","Total"))}</span><b data-table-total></b>`)+"</div>"+(i?`<label class="sl-table-qtylabel" id="sl-table-qty-label">${t(y("picker.numberOfGuests","Number of guests"))}</label><div class="sl-table-stepper" role="group" aria-labelledby="sl-table-qty-label"><button type="button" data-table-step="-1" aria-label="${t(y("picker.fewerGuests","Fewer guests"))}">\u2212</button><output aria-live="polite" data-table-qty>${n.quantity}</output><button type="button" data-table-step="1" aria-label="${t(y("picker.moreGuests","More guests"))}">+</button></div><div class="sl-table-range">${t((0,ye.t)("picker.chooseMinMaxGuests",{min:n.minOccupancy,max:n.maxOccupancy}))}</div>`:`<input type="hidden" data-table-qty value="${n.capacity}">`)+`<div class="sl-table-actions"><button type="button" class="sl-table-cancel">${t((0,ye.t)("common.cancel"))}</button><button type="button" class="sl-table-confirm">${t(e.held?y("picker.updateTable","Update table"):i?y("picker.selectTable","Select table"):y("picker.selectWholeTable","Select whole table"))}</button></div></div></section>`}function ys(n,e){let t=fl(n),i=document.createElement("div");i.className="sl-access",i.setAttribute("role","status"),i.setAttribute("aria-live","polite");let r=document.createElement("div");r.className="sl-access-card";let s=document.createElement("span");s.className="sl-access-icon",s.setAttribute("aria-hidden","true"),s.textContent="\u21BB";let o=document.createElement("div");o.className="sl-access-copy";let a=document.createElement("div");a.className="sl-access-title",a.textContent=t.title;let l=document.createElement("div");if(l.className="sl-access-body",l.textContent=t.body,o.append(a,l),t.action){let c=document.createElement("button");c.type="button",c.className="sl-access-act";let d=document.createElement("span");d.className="sl-access-act-icon",d.setAttribute("aria-hidden","true"),d.textContent="\u21BB";let p=document.createElement("span");p.textContent=t.action,c.append(d,p),c.addEventListener("click",async()=>{i.classList.add("is-reloading"),c.disabled=!0;try{await e()}catch{}finally{i.isConnected&&(i.classList.remove("is-reloading"),c.disabled=!1)}}),o.appendChild(c)}return r.append(s,o),i.appendChild(r),i}function xs(n){return n.map(e=>`<button type="button" role="switch" class="sl-a11yrow${e.className?` ${e.className}`:""}${e.on?" on":""}" data-a11y-row="${w(e.key)}" aria-checked="${e.on}" aria-pressed="${e.on}"`+(e.disabled?' disabled aria-disabled="true"':"")+`><span class="sl-a11yrow-i" aria-hidden="true">${w(e.icon)}</span><span class="sl-a11yrow-t"><span class="sl-a11yrow-l">${w(e.label)}</span>`+(e.note?`<span class="sl-a11yrow-n">${w(e.note)}</span>`:"")+"</span>"+(e.count?`<span class="sl-a11yrow-c">${w(e.count)}</span>`:"")+'<span class="sl-a11yrow-s" aria-hidden="true"></span></button>').join("")}function ws(n){let e=document.createElement("div");e.className="sl-floors on",e.setAttribute("role","group"),e.setAttribute("aria-label",n.tf("picker.chooseLevel","Choose level"));let t=[{id:"",name:n.tf("picker.allFloors","All floors")},...n.floors.map(s=>({id:s.id,name:s.name}))];for(let s of t){let o=document.createElement("button");o.type="button",o.dataset.floor=s.id,o.textContent=s.name,o.setAttribute("aria-pressed","false"),o.addEventListener("click",()=>n.onChoose(s.id)),e.appendChild(o)}let i=document.createElement("button");i.type="button",i.className="sl-floor-info",i.textContent="i";let r=n.tf("picker.floorHelp","All floors shows the complete venue. Choose one level to inspect and select its seats.");return i.setAttribute("aria-label",r),i.title=r,e.appendChild(i),e}function ks(n,e,t){if(!n)return;let i=t?"":e;n.querySelectorAll("button[data-floor]").forEach(r=>{r.setAttribute("aria-pressed",String(r.dataset.floor===i))})}var de=require("@seatlayer/core");var Oi=class{constructor(e){this.el=null;this.stripObserver=null;this.current=null;this.collapsed=!1;this.shownAt=0;this.host=e}get summary(){return this.current}adopt(e){this.current=e}get element(){return this.el}show(e){if(e&&e.id!==this.current?.id&&this.host.collapseSheet(),this.current=e,!e){this.el?.classList.contains("strip")?Ne(this.el,void 0,hr):this.el?.remove(),this.el=null,this.syncLocatorDock(),this.host.refreshMinimap();return}this.collapsed=this.host.controller.getRung()==="seats",this.shownAt=Date.now(),this.render(e),this.host.refreshMinimap()}updateDockInPlace(e,t){let i=this.el;if(!i)return;let r=i.querySelector(".sl-seccard-dot");r&&(r.style.background=e.color);let s=i.querySelector(".sl-seccard-name");s&&rn(s,e.label);let o=i.querySelector(".sl-seccard-left");o&&(o.dataset.full=t.leftLabel,o.dataset.short=t.leftShortLabel,rn(o,t.leftLabel));let a=i.querySelector(".sl-seccard-nav");t.nav?(a?a.outerHTML=t.nav:i.querySelector(".sl-seccard-x")?.insertAdjacentHTML("beforebegin",t.nav),this.wireNavigation(i)):a&&a.remove(),i.setAttribute("aria-label",`${(0,de.t)("picker.sectionSummaryAria",{label:e.label})}, ${t.leftLabel}`),this.fitStripCount()}wireNavigation(e){e.querySelectorAll("[data-section-nav]").forEach(t=>{t.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation();let r=t.dataset.sectionNav;r&&this.host.controller.focusSection(r)})})}render(e){let t=this.host.map();if(!t)return;let i=this.el?.classList.contains("strip")===!0&&this.el.isConnected,r=e.categories.length?e.categories.map(v=>{let k=this.host.controller.doc?.categories.find(S=>S.key===v.key);return k?this.host.catPriceRange(k):{min:v.priceMin,max:v.priceMax}}).filter(v=>v!=null):[{min:e.priceMin,max:e.priceMax}],s=Math.min(...r.map(v=>v.min)),o=Math.max(...r.map(v=>v.max)),a=s===o?this.host.money(s):`${this.host.money(s)}\u2013${this.host.money(o)}`,l=(0,de.tCount)("picker.seatsLeftInSection",e.seatsLeft),c=(0,de.t)("picker.seatsLeftShort",{count:e.seatsLeft}),d=`<button type="button" class="sl-seccard-x" aria-label="${(0,de.t)("picker.closeSectionSummary")}">\u2715</button>`,p=`<button type="button" class="sl-seccard-x sl-seccard-back" aria-label="${(0,de.t)("picker.closeSectionSummary")}"><span class="sl-seccard-back-chev" aria-hidden="true">\u2039</span>${_((0,de.t)("picker.overview"))}</button>`,u=ls(this.host.sectionNeighbours(e.id)),h=this.host.root()?.dataset.layout==="narrow",g={label:e.label,color:e.color,leftLabel:l,leftShortLabel:c,nav:u,close:d};if(h&&i&&this.el){this.updateDockInPlace(e,{leftLabel:l,leftShortLabel:c,nav:u});return}this.el?.remove();let m=document.createElement("div");if(h){if(m.className=i?"sl-seccard strip on":"sl-seccard strip on sl-mo-slide-up",m.setAttribute("role","group"),m.setAttribute("aria-label",`${(0,de.t)("picker.sectionSummaryAria",{label:e.label})}, ${l}`),m.innerHTML=Sn({...g,close:p}),i)for(let v of m.querySelectorAll(".sl-seccard-name,.sl-seccard-left"))v.classList.add("sl-mo-xfade");this.wireNavigation(m),m.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),t.appendChild(m),this.fitStripCount()}else if(this.collapsed)m.className="sl-seccard mini on",m.setAttribute("role","button"),m.setAttribute("aria-label",(0,de.t)("picker.sectionSummaryAria",{label:e.label})),m.innerHTML=Sn(g),this.wireNavigation(m),m.addEventListener("click",v=>{v.target.closest(".sl-seccard-x")||(this.collapsed=!1,this.shownAt=Date.now(),this.render(e))}),m.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),(this.host.region("top-center")??t).appendChild(m);else{m.className="sl-seccard on",m.setAttribute("role","dialog"),m.setAttribute("aria-label",(0,de.t)("picker.sectionSummaryAria",{label:e.label}));let v=this.host.priceBandKeys(),k=this.host.suppressPricing(),S=e.categories.map(L=>{let b=this.host.controller.doc?.categories.find(x=>x.key===L.key),E=b?this.host.catPriceRange(b):{min:L.priceMin,max:L.priceMax};return gs({label:L.label,color:L.color,dim:v!=null&&!v.has(L.key),rangeLabel:k?"":E&&E.min!==E.max?`${this.host.money(E.min)}\u2013${this.host.money(E.max)}`:this.host.money(E?.min??L.price)})}).join("");m.innerHTML=fs({...g,priceLabel:a,showPrice:!k&&e.categories.length>0,zoneLabel:e.zoneLabel,entrance:e.entrance?`${(0,de.t)("picker.entrance")} ${e.entrance}`:void 0,mix:S,overviewLabel:(0,de.t)("picker.overview"),hint:(0,de.t)("picker.tapSeatHint")}),this.wireNavigation(m),m.querySelector(".sl-seccard-x").addEventListener("click",()=>this.host.controller.overview()),m.querySelector(".sl-seccard-overview").addEventListener("click",()=>this.host.controller.overview()),(this.host.region("top-center")??t).appendChild(m)}this.el=m,h&&this.watchStrip(m),this.syncLocatorDock()}syncLocatorDock(){let e=this.host.root();e&&(this.el?.classList.contains("strip")?e.dataset.locator="true":delete e.dataset.locator)}fitStripCount(){let e=this.el;if(!e||!e.classList.contains("strip"))return;let t=e.querySelector(".sl-seccard-left");if(!t)return;let i=e.querySelector(".sl-seccard-name"),r=c=>c!=null&&c.clientWidth>0&&c.scrollWidth>c.clientWidth+1,s=()=>{let c=e.clientWidth;if(c<=0)return!0;let d=typeof getComputedStyle=="function"?getComputedStyle(e):null,p=m=>{let v=Number.parseFloat(m??"");return Number.isFinite(v)?v:0},u=[...e.children].filter(m=>m instanceof HTMLElement&&!m.hidden),h=p(d?.columnGap)||p(d?.gap);return u.reduce((m,v)=>m+Math.max(v.scrollWidth,v.getBoundingClientRect().width),0)+h*Math.max(0,u.length-1)+p(d?.paddingLeft)+p(d?.paddingRight)<=c+1},o=()=>t.hidden||!r(t)&&s(),a=c=>{if(t.hidden=c==="hidden",c==="hidden")return;let d=t.dataset.full??"";t.textContent=c==="full"?d:t.dataset.short??d},l=["full","short","hidden"];for(let c of l)if(a(c),o()&&!r(i))return;for(let c of l)if(a(c),o())return;a("hidden")}watchStrip(e){this.stripObserver?.disconnect(),this.stripObserver=null,typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.el===e&&this.fitStripCount()}),typeof ResizeObserver=="function"&&(this.stripObserver=new ResizeObserver(()=>{this.el===e&&this.fitStripCount()}),this.stripObserver.observe(e))}collapse(){!this.el||this.collapsed||!this.current||this.host.root()?.dataset.layout!=="narrow"&&(this.collapsed=!0,this.render(this.current))}onView(){if(!(!this.el||this.collapsed||!this.current)&&this.host.root()?.dataset.layout!=="narrow"){if(this.host.controller.getRung()==="seats"){this.collapse();return}if(Date.now()-this.shownAt<1400){this.coverage()>.25&&this.collapse();return}this.collapse()}}coverage(){let e=this.el,t=this.current,i=this.host.map();if(!e||!t||!i)return 0;let r=this.host.activeFloorObjects().find(S=>S.type==="section"&&S.id===t.id)?.outline;if(!r||r.length<3)return 0;let s=r.map(S=>this.host.controller.worldToScreen(S)),o=s.map(S=>S.x),a=s.map(S=>S.y),l=Math.min(...o),c=Math.min(...a),d=Math.max(...o)-l,p=Math.max(...a)-c;if(d<=0||p<=0)return 0;let u=i.getBoundingClientRect(),h=e.getBoundingClientRect(),g=h.left-u.left,m=h.top-u.top,v=Math.max(0,Math.min(g+h.width,l+d)-Math.max(g,l)),k=Math.max(0,Math.min(m+h.height,c+p)-Math.max(m,c));return v*k/(d*p)}};var Ss=require("@seatlayer/core"),wt=require("@seatlayer/core/picker/minimapGeometry");function Ts(n,e){let t=new Tn(n);return t.build(e),t}var Tn=class{constructor(e){this.host=e;this.miniCanvas=null;this.miniBase=null;this.miniWrap=null;this.miniToggle=null;this.miniLabel=null;this.miniTf=null;this.miniDrag=null;this.miniSuppressClick=!1;this.userClosed=!1}dispose(){this.miniToggle?.remove(),this.miniWrap?.remove(),this.miniToggle=null,this.miniWrap=null,this.miniCanvas=null,this.miniBase=null,this.miniLabel=null,this.miniTf=null,this.miniDrag=null,this.host.root()?.removeAttribute("data-minimap-open")}build(e){if(!this.host.controller.getViewport())return;let i=document.createElement("button");i.type="button",i.className="sl-minimap-toggle",i.setAttribute("aria-label",y("picker.openVenueMap","Open venue overview map")),i.setAttribute("aria-expanded","false"),i.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M3 6l5-2 8 3 5-2v13l-5 2-8-3-5 2zM8 4v13M16 7v13"/></svg>',e.appendChild(i),this.miniToggle=i;let r=document.createElement("div");r.className="sl-minimap",r.setAttribute("role","group");let s=document.createElement("div");s.className="sl-minimap-bar";let o=document.createElement("span");o.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",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",s.append(o,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.")),r.append(s,c),e.appendChild(r),this.miniWrap=r,this.miniLabel=o,this.miniCanvas=c;let d=document.createElement("canvas");this.miniBase=d,i.addEventListener("click",()=>{let p=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=p,this.setMinimapOpen(!p)}),l.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),c.addEventListener("click",p=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(p)}),c.addEventListener("pointerdown",p=>this.minimapPointerDown(p)),c.addEventListener("pointermove",p=>this.minimapPointerMove(p)),c.addEventListener("pointerup",p=>this.minimapPointerUp(p)),c.addEventListener("pointercancel",p=>this.minimapPointerUp(p)),c.addEventListener("keydown",p=>this.minimapKeydown(p)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setAutoOpen(e){if(this.miniWrap){if(!e){this.userClosed=!1,this.host.root()?.dataset.minimapOpen==="true"&&this.setMinimapOpen(!1,!1);return}this.userClosed||this.host.root()?.dataset.minimapOpen==="true"||this.setMinimapOpen(!0,!1)}}setMinimapOpen(e,t=!0){this.host.root()?.setAttribute("data-minimap-open",String(e)),this.miniToggle?.setAttribute("aria-expanded",String(e)),t&&(e?this.miniCanvas?.focus():this.miniToggle?.focus())}layoutMinimap(){let e=this.miniCanvas,t=this.miniBase,i=this.host.controller.getViewport()?.bounds;if(!e||!t||!i||!(i.width>0&&i.height>0))return;let r=196,s=146,o=6,a=i.width/Math.max(1,i.height),l=r,c=Math.round(r/a);c>s&&(c=s,l=Math.round(s*a)),l=Math.max(64,l),c=Math.max(48,c);let d=Math.min(2,window.devicePixelRatio||1);e.width=Math.round(l*d),e.height=Math.round(c*d),e.style.width=`${l}px`,e.style.height=`${c}px`,t.width=e.width,t.height=e.height,this.miniTf=(0,wt.createMinimapTransform)(i,e.width,e.height,d,o)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let e=this.host.controller.getFloors(),t=this.host.controller.isFloorOverview()?y("picker.allFloors","All floors"):e.find(d=>d.id===this.host.controller.getActiveFloorId())?.name??y("picker.venueOverview","Venue overview"),i=this.host.controller.getMinimapSnapshot().sections,s=i.find(d=>d.active)?.label??this.host.focusedSectionLabel(),o=s?`${t} \xB7 ${s}`:t;this.miniLabel.textContent=o;let a=i.filter(d=>d.state==="selected").length,l=i.filter(d=>d.state==="available").length,c=i.filter(d=>d.state==="inactive").length;this.miniWrap.setAttribute("aria-label",i.length?`${o}. ${a} selected, ${l} available, ${c} inactive sections.`:o),this.miniCanvas?.setAttribute("aria-label",i.length?`${o}. ${a} selected, ${l} available, ${c} inactive sections. ${y("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${o}. ${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 i=e.getContext("2d");if(!i)return;i.clearRect(0,0,e.width,e.height);let r=p=>p*t.scale+t.offX,s=p=>p*t.scale+t.offY,o=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",a=this.host.cssVar("--sl-muted")||"#8b93a7",l=this.host.cssVar("--sl-accent")||"#6e7bff",c=this.host.cssVar("--sl-success")||"#22a06b",d=this.host.controller.getMinimapSnapshot();for(let p of d.sections){if(p.outline.length<3)continue;i.beginPath(),p.outline.forEach((h,g)=>g===0?i.moveTo(r(h.x),s(h.y)):i.lineTo(r(h.x),s(h.y))),i.closePath();let u=p.paint;if(i.globalAlpha=p.state==="inactive"?.5:.92,u?i.fillStyle=u.fill:(i.globalAlpha=p.state==="inactive"?.18:p.state==="selected"?.72:.34,i.fillStyle=p.state==="inactive"?a:p.state==="selected"?l:c),i.fill(),i.globalAlpha=.82,i.lineWidth=Math.max(1,t.dpr),i.strokeStyle=u?.stroke||o,i.stroke(),p.owned){i.globalAlpha=1,i.lineWidth=Math.max(2,t.dpr*1.5),i.strokeStyle=l,i.stroke();let h=p.outline.reduce((g,m)=>({x:g.x+m.x,y:g.y+m.y}),{x:0,y:0});i.beginPath(),i.arc(r(h.x/p.outline.length),s(h.y/p.outline.length),Math.max(1.5,t.dpr*1.6),0,Math.PI*2),i.fillStyle=l,i.fill(),i.beginPath(),p.outline.forEach((g,m)=>m===0?i.moveTo(r(g.x),s(g.y)):i.lineTo(r(g.x),s(g.y))),i.closePath()}p.active&&(i.globalAlpha=1,i.lineJoin="round",i.lineWidth=Math.max(4,t.dpr*3.5),i.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",i.stroke(),i.lineWidth=Math.max(2,t.dpr*1.75),i.strokeStyle=l,i.stroke())}if(i.globalAlpha=1,!d.sections.length){let p=Math.max(1,t.dpr),u=this.host.controller.getRenderer?.(),h=new Map,g=m=>{let v=h.get(m);if(v)return v;let k=u?.categoryDisplayColor?.(m)||c;return h.set(m,k),k};for(let m of d.seats)i.globalAlpha=m.state==="inactive"?.22:.78,i.fillStyle=m.state==="inactive"?a:m.state==="selected"?l:g(m.categoryKey),i.beginPath(),i.arc(r(m.x),s(m.y),p,0,Math.PI*2),i.fill();i.globalAlpha=1}}drawMinimapRect(){let e=this.miniCanvas,t=this.miniBase,i=this.miniTf;if(!e||!t||!i)return;let r=e.getContext("2d");if(!r)return;r.clearRect(0,0,e.width,e.height),r.drawImage(t,0,0);let s=this.host.controller.getViewport();if(!s)return;let o=(0,wt.minimapViewportPlan)(s.visible,i,e.width,e.height,Math.max(2,i.dpr*2)),a=this.host.cssVar("--sl-text")||"#12151c",l=this.host.cssVar("--sl-surface")||"#fff";r.save(),r.globalAlpha=.1,r.fillStyle=a,r.fillRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),r.globalAlpha=.9,r.lineJoin="round",r.lineWidth=Math.max(4,i.dpr*3.25),r.strokeStyle=l,r.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),r.globalAlpha=1,r.lineWidth=Math.max(2,i.dpr*1.75),r.strokeStyle=a,r.strokeRect(o.raw.x,o.raw.y,o.raw.width,o.raw.height),o.clipped&&Object.values(o.clippedEdges).some(Boolean)&&(r.setLineDash([Math.max(3,i.dpr*3),Math.max(2,i.dpr*2)]),r.strokeRect(o.clipped.x,o.clipped.y,o.clipped.width,o.clipped.height)),r.restore()}minimapWorldPoint(e){let t=this.miniCanvas,i=this.miniTf;if(!t||!i)return null;let r=t.getBoundingClientRect(),s=(e.clientX-r.left)*(t.width/Math.max(1,r.width)),o=(e.clientY-r.top)*(t.height/Math.max(1,r.height));return{...(0,wt.minimapPointToWorld)({x:s,y:o},i),px:s,py:o}}minimapPointerDown(e){let t=this.minimapWorldPoint(e),i=this.host.controller.getViewport()?.visible;!t||!i||!(t.x>=i.x&&t.x<=i.x+i.width&&t.y>=i.y&&t.y<=i.y+i.height)||(this.miniDrag={pointerId:e.pointerId,offsetX:t.x-(i.x+i.width/2),offsetY:t.y-(i.y+i.height/2),startX:e.clientX,startY:e.clientY,moved:!1},this.miniCanvas?.setPointerCapture(e.pointerId),this.miniCanvas?.classList.add("sl-dragging"),e.preventDefault())}minimapPointerMove(e){let t=this.miniDrag;if(!t||t.pointerId!==e.pointerId)return;let i=this.minimapWorldPoint(e);i&&(!t.moved&&Math.hypot(e.clientX-t.startX,e.clientY-t.startY)>2&&(t.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:i.x-t.offsetX,y:i.y-t.offsetY}),e.preventDefault())}minimapPointerUp(e){let t=this.miniDrag;!t||t.pointerId!==e.pointerId||(this.miniSuppressClick=t.moved,this.miniDrag=null,this.miniCanvas?.classList.remove("sl-dragging"),this.miniCanvas?.hasPointerCapture(e.pointerId)&&this.miniCanvas.releasePointerCapture(e.pointerId))}minimapKeydown(e){let t=this.host.controller.getViewport()?.visible;if(!t)return;if(e.key==="Home"){this.host.controller.overview(),e.preventDefault();return}let i=e.key==="ArrowLeft"?-t.width*.2:e.key==="ArrowRight"?t.width*.2:0,r=e.key==="ArrowUp"?-t.height*.2:e.key==="ArrowDown"?t.height*.2:0;!i&&!r||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:t.x+t.width/2+i,y:t.y+t.height/2+r}),e.preventDefault())}minimapJump(e){let t=this.minimapWorldPoint(e);if(t){for(let i of this.host.controller.getMinimapSnapshot().sections)if(!(i.state==="inactive"||i.outline.length<3)&&(0,Ss.pointInPolygon)(t,i.outline)){this.host.controller.focusSection(i.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(t)}}};var _i=require("@seatlayer/core");var gl=12;function Cs(n,e){let t=e.floors(),i=new Set(t.map(x=>x.label.trim().toLocaleLowerCase())),r=e.zones().filter(x=>x.seatCount>0&&!i.has(x.label.trim().toLocaleLowerCase())),s=e.sections().filter(x=>x.seatCount>0&&!i.has(x.label.trim().toLocaleLowerCase())),o=r.length>1?[]:s,a=t.length>1,l=r.length>1,c=o.length>1;if(!a&&!l&&!c)return null;let d=document.createElement("div");d.className="sl-view3d-nav";let p=null,u=document.createElement("button");u.type="button",u.className="sl-view3d-nav-toggle",u.setAttribute("aria-expanded","false");let h='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M15.5 8.5l-2 5-5 2 2-5z"/></svg>',g=document.createElement("span");u.innerHTML=h,u.appendChild(g);let m=()=>{for(let x of d.querySelectorAll(":scope > div")){let I=x.querySelector('[aria-pressed="true"]');!I||x.scrollWidth<=x.clientWidth||I.scrollIntoView({block:"nearest",inline:"nearest"})}},v=()=>{if(p)return p;for(let x of d.querySelectorAll(":scope > div")){let I=x.querySelector('button[aria-pressed="true"]'),R=I?.textContent?.trim();if(R&&I?.dataset.floor!=="")return R}return a&&(l||c)?y("picker.levelsAndAreas","Levels & areas"):a?y("picker.levels","Levels"):y("picker.areas","Areas")},k=x=>{d.classList.toggle("is-open",x),u.setAttribute("aria-expanded",String(x)),x&&typeof requestAnimationFrame=="function"&&requestAnimationFrame(m),g.textContent=v()};u.addEventListener("click",()=>k(!d.classList.contains("is-open"))),d.addEventListener("keydown",x=>{x.key!=="Escape"||!d.classList.contains("is-open")||(x.preventDefault(),x.stopPropagation(),k(!1),u.focus())});let S=document.createElement("button");S.type="button",S.className="sl-view3d-nav-close",S.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M18 6L6 18M6 6l12 12"/></svg>';let L=y("picker.closeVenueNavigation","Close venue navigation");S.setAttribute("aria-label",L),S.title=L,S.addEventListener("click",()=>{k(!1),u.focus()}),k(!1),d.appendChild(u);let b=x=>{},E=x=>{};if(a){let x=document.createElement("div");x.setAttribute("role","group"),x.setAttribute("aria-label",y("picker.levels","Levels"));let I=[];E=O=>{I.forEach(N=>{N.setAttribute("aria-pressed",String((N.dataset.floor===""?null:Number(N.dataset.floor))===O))})};let R=O=>{e.focusFloor(O)&&(E(O),b(O))},T=(O,N)=>{let V=document.createElement("button");V.type="button",V.textContent=O,V.dataset.floor=N===null?"":String(N),V.setAttribute("aria-pressed",String(N===null)),V.addEventListener("click",()=>{R(N),k(!1)}),I.push(V),x.appendChild(V)};T(y("picker.allLevels","All levels"),null);for(let O of t)T(O.label||(0,_i.t)("picker.levelNumber",{number:O.index+1}),O.index);d.appendChild(x)}if(l||c){let x=document.createElement("div");x.setAttribute("role","group"),x.setAttribute("aria-label",y("picker.areas","Areas"));let I=l?r.map(T=>({id:T.id,label:T.label||T.id,go:()=>{e.focusZone(T.id)}})):o.map(T=>({id:T.id,label:T.label||T.id,floorIndex:T.floorIndex,go:()=>{e.focusSection(T.id),Number.isFinite(T.floorIndex)&&E(T.floorIndex)}})),R=T=>{let O=l||T===null?I:I.filter(N=>N.floorIndex===void 0||N.floorIndex===T);if(x.replaceChildren(),!O.length){x.remove();return}if(x.isConnected||d.insertBefore(x,S.isConnected?S:null),!l&&O.length>gl){let N=document.createElement("select");N.setAttribute("aria-label",y("picker.jumpToSection","Jump to section"));let V=document.createElement("option");V.value="",V.textContent=y("picker.jumpToSection","Jump to section"),N.appendChild(V);for(let Q of O){let J=document.createElement("option");J.value=Q.id,J.textContent=Q.label,N.appendChild(J)}N.addEventListener("change",()=>{O.find(Q=>Q.id===N.value)?.go()}),x.appendChild(N);return}for(let N of O){let V=document.createElement("button");V.type="button",V.textContent=N.label,V.dataset.area=N.id,V.addEventListener("click",()=>{p=N.label,N.go(),k(!1)}),x.appendChild(V)}};b=R,R(null)}return d.appendChild(S),n.appendChild(d),d}var Di=class{constructor(e){this.host=e;this.chip=null}sync(){let e=this.host.overlay();if(!e||this.host.savedSeatIds().length===0){this.chip?.remove(),this.chip=null;return}let t=this.chip;if(!t){t=document.createElement("div"),t.className="sl-view3d-compare-saved",t.setAttribute("role","group"),t.setAttribute("aria-label",y("picker.savedSeatComparison","Saved seat comparison"));let s=document.createElement("button");s.type="button",s.className="main",s.addEventListener("click",()=>{this.host.savedSeatIds().length>1?this.host.openComparison():this.host.toast(y("picker.chooseAnotherToCompare","Choose another seat to compare."),"neutral")});let o=document.createElement("button");o.type="button",o.className="clear",o.textContent="\xD7",o.setAttribute("aria-label",y("picker.clearSavedSeatComparison","Clear saved seat comparison")),o.addEventListener("click",()=>this.host.clearComparison()),t.append(s,o),e.appendChild(t),this.chip=t}let i=this.host.savedSeatIds().length,r=t.querySelector(".main");r&&(r.textContent=i>1?(0,_i.t)("picker.compareCount",{count:i}):y("picker.oneSeatSaved","1 seat saved"),r.setAttribute("aria-label",i>1?(0,_i.t)("picker.openComparisonOfSeats",{count:i}):y("picker.oneSeatSavedChooseAnother","One seat saved; choose another to compare")))}remove(){this.chip?.remove(),this.chip=null}mainButton(){return this.chip?.querySelector(".main")??null}};function Es(n){return!n?.querySelector('[data-ref="zfs"]')}var Cn=require("@seatlayer/core");var bl=900,vl=450;function yl(n){switch(n){case"seat":return y("picker.stopYourSeat","Your seat");case"row":return y("picker.stopYourRow","Your row");case"section":return y("picker.stopYourSection","Your section");default:return y("picker.stopWholeVenue","Whole venue")}}function As(n,e){let t=document.createElement("button");t.type="button",t.className="sl-view3d-recentre sl-mo-rotate-in",t.textContent="\u25CE";let i=y("picker.recentreOnStage","Recentre on the stage");t.setAttribute("aria-label",i),t.title=i,t.addEventListener("click",()=>{e.handle()?.recentreSeatView()});let r=document.createElement("div");r.className="sl-view3d-stop",r.setAttribute("role","status"),r.setAttribute("aria-live","polite"),n.append(t,r);let s=null,o=null;return{onStopChange(a){if(s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),!a){r.classList.remove("is-shown"),r.textContent="",o=setTimeout(()=>{o=null,n.classList.remove("is-seat-view")},vl);return}n.classList.add("is-seat-view"),r.textContent=yl(a),r.classList.add("is-shown"),s=setTimeout(()=>{s=null,r.classList.remove("is-shown")},bl)},dispose(){s&&(clearTimeout(s),s=null),o&&(clearTimeout(o),o=null),t.remove(),r.remove(),n.classList.remove("is-seat-view")}}}var xl=44,wl=92;function Ps(n,e,t,i={}){let r=n?.sectionLabel,s=te(n),o=kl(n,e),a=[r,s?(0,Cn.t)("picker.rowLabel",{label:s}):null,o?(0,Cn.t)("picker.seatLabel",{label:o}):null].filter(Boolean).join(" \xB7 "),l=i.maxChars??(i.narrow?xl:wl);for(let c of[t,i.shortTail??t,null]){let d=[a,c].filter(Boolean).join(" \xB7 ");if(d.length<=l||c==null)return d}return a}function kl(n,e){if(n?.seatNumber)return n.seatNumber;let t=n?.displayLabel??e,i=r=>{!r||!t.startsWith(r)||t.length<=r.length||(t=t.slice(r.length).replace(/^[\s·\-\/_]+/,""))};return i(n?.sectionLabel),i(te(n)),t}var Ls="sl:sheet-hint";function Ms(n){let e=n.boot;if(!e?.isConnected)return;if(n.reducedMotion){e.remove();return}e.classList.add("is-going"),setTimeout(()=>e.remove(),200);let t=document.createElement("div");t.className="sl-shells-in",t.setAttribute("aria-hidden","true"),n.map?.appendChild(t),setTimeout(()=>t.remove(),650),n.rail?.classList.add("is-in"),n.root?.classList.add("is-arriving"),setTimeout(()=>{n.rail?.classList.remove("is-in"),n.root?.classList.remove("is-arriving"),Sl(n.root)},900)}function Sl(n){if(!n||n.dataset.layout!=="narrow")return;try{if(window.sessionStorage.getItem(Ls))return;window.sessionStorage.setItem(Ls,"1")}catch{}let e=n.querySelector(".sl-sheet-grab");e&&(e.classList.add("sl-mo-hint"),e.addEventListener("animationend",()=>e.classList.remove("sl-mo-hint"),{once:!0}))}function Hs(n,e){n.addEventListener("keydown",t=>{if(t.key==="Escape"){for(let i of e())if(i.open()){t.preventDefault(),t.stopPropagation(),i.close();return}}})}function Bi(n){let e=n.committedSelection(),t=n.controller.getGAAreas(),i=n.hold?.items??[],r=new Set(i.map(u=>u.label)),s=br(n,t,i),o=Ye(n.gaQty,i),a=i.reduce((u,h)=>u+n.paidPrice(h.categoryKey,h.tierId,h.unitPrice,h.label)*(h.quantity??1),0),l=i.reduce((u,h)=>u+(h.quantity??1),0),c=e.filter(u=>!r.has(u.label)),d=c.reduce((u,h)=>u+n.paidPrice(h.categoryKey,h.tierId??null,h.price,h.label)*(h.quantity??1),0)+s+a,p=c.reduce((u,h)=>u+(h.quantity??1),0)+o+l;return{seats:e,freshSeats:c,gaAreas:t,heldItems:i,heldLabels:r,heldCount:l,total:d,count:p}}function Ni(n,e){let t=e.tiers?.length?e.tiers[0].price:e.price;return t===void 0||!e.key?t:n.paidPrice(e.key,e.tiers?.[0]?.id??null,t)}function $i(n,e){let t=e.tiers?.length?e.tiers.map(i=>n.paidPrice(e.key,i.id??null,i.price)):e.price==null?[]:[n.paidPrice(e.key,null,e.price)];if(e.key)for(let i of n.pricesByChannel.values())for(let r of i)r.categoryKey===e.key&&t.push(r.price);return t.length?{min:Math.min(...t),max:Math.max(...t)}:void 0}var Wt="seatlayer_";function Tl(){let n=globalThis;return n.document?.modelContext??n.navigator?.modelContext??null}function ue(n,e){return e?{ok:!1,reason:n,message:e}:{ok:!1,reason:n}}function Cl(n){return Array.isArray(n)?n.filter(e=>typeof e=="string"&&!!e):[]}function El(n,e){let t=n.event();if(!t)return ue("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits();return{ok:!0,event:t,selection:{max:i.max,...i.required!=null?{required:i.required}:{}},categories:n.categories(),zones:n.zones(),hasPremiumSeats:n.hasPremiumSeats(),holdsAllowed:e}}function Is(n,e){let t=r=>!!r&&r.toLowerCase()===e.toLowerCase(),i=n.find(r=>t(r.key??r.id))??n.find(r=>t(r.label));return i?.key??i?.id??null}function Rs(n,e){let t=e.map(i=>n.describeSeat(i.id));return{seatIds:e.map(i=>i.id),labels:e.map(i=>i.label),section:t[0]?.section??"",row:t[0]?.row??"",seats:e.map((i,r)=>t[r]?.seat||i.label),category:t[0]?.category??e[0].categoryKey,unitPrice:e[0].price,total:e.reduce((i,r)=>i+r.price,0)}}function Al(n,e,t){let i=new Map;for(let s of e){let o=i.get(s.rowKey);o?o.push(s):i.set(s.rowKey,[s])}let r=[];for(let s of i.values()){let o=[...s].sort((l,c)=>l.index-c.index),a=0;for(let l=1;l<=o.length;l++)if(l===o.length||o[l].index!==o[l-1].index+1||o[l].categoryKey!==o[l-1].categoryKey){for(let d=a;d+t<=l;d+=t)r.push(Rs(n,o.slice(d,d+t)));a=l}}return r}function Pl(n,e,t){let i=new Map;for(let s of e){let o=i.get(s.sectionKey);o?o.push(s):i.set(s.sectionKey,[s])}let r=[];for(let s of i.values()){if(s.length<t)continue;let o=[...s].sort((a,l)=>a.price!==l.price?l.price-a.price:a.rowKey.localeCompare(l.rowKey)||a.index-l.index);r.push(Rs(n,o.slice(0,t)))}return r}function Ll(n,e){if(!n.event())return ue("not_loaded","The seat map has not finished loading.");let i=n.selectionLimits(),r=Math.floor(Number(e.count));if(!Number.isInteger(r)||r<1||r>i.max)return ue("bad_count",`count must be a whole number between 1 and ${i.max}.`);let s=Number.isInteger(Number(e.limit))?Math.max(1,Math.min(20,Number(e.limit))):5,o=e.together===void 0?!0:!!e.together,a=typeof e.max_price=="number"&&Number.isFinite(e.max_price)?e.max_price:null,l=typeof e.category=="string"&&e.category?e.category:null,c=typeof e.zone=="string"&&e.zone?e.zone:null,d=l?Is(n.categories(),l):null;if(l&&!d)return ue("no_match",`No ticket type called "${l}".`);let p=c?Is(n.zones(),c):null;if(c&&!p)return ue("no_match",`No zone called "${c}".`);let u=n.seats().filter(m=>m.available);if(!u.length)return ue("sold_out");let h=u.filter(m=>(!d||m.categoryKey===d)&&(!p||m.zoneId===p)&&(a==null||m.price<=a));if(!h.length)return ue("no_match");let g=o?Al(n,h,r):Pl(n,h,r);return g.length?(g.sort((m,v)=>v.unitPrice!==m.unitPrice?v.unitPrice-m.unitPrice:m.row.localeCompare(v.row)||m.labels[0].localeCompare(v.labels[0])),{ok:!0,groups:g.slice(0,s),searched:{count:r,filters:{...a!=null?{max_price:a}:{},...d?{category:d}:{},...p?{zone:p}:{},together:o}}}):ue(o?"not_enough_together":"no_match")}function Os(n){return{ok:!0,...n.selection()}}function Ml(n,e){let t=n.event();if(!t)return ue("not_loaded","The seat map has not finished loading.");if(t.salesClosed)return ue("event_closed","Sales are closed for this event.");let i=Cl(e.seat_ids);return i.length?(n.clearSelection(),n.selectObjects(i),Os(n)):ue("nothing_requested","Pass one or more seat ids or labels in seat_ids.")}function Hl(n,e){let t=async r=>{try{return await r()}catch(s){return ue("error",s instanceof Error?s.message:String(s))}},i=[{name:`${Wt}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(()=>El(n,e))},{name:`${Wt}find_seats`,title:"Find available seats",description:"Search the seat map for groups of available seats. Read-only: it never selects, holds or reserves anything. Returns candidate groups with their seat ids, prices and location.",inputSchema:{type:"object",properties:{count:{type:"integer",minimum:1,description:"How many seats are needed."},max_price:{type:"number",description:"Highest acceptable price per seat."},category:{type:"string",description:"Ticket type key or label to restrict the search to."},zone:{type:"string",description:"Zone id or label to restrict the search to."},together:{type:"boolean",description:"Require the seats to be side by side in one row (default true)."},limit:{type:"integer",minimum:1,maximum:20,description:"How many candidate groups to return (default 5)."}},required:["count"],additionalProperties:!1},annotations:{readOnlyHint:!0,untrustedContentHint:!0},execute:r=>t(()=>Ll(n,r))},{name:`${Wt}select_seats`,title:"Select seats on the map",description:"Replace the current selection with the given seats, exactly as tapping them would. The buyer sees the seats light up and the basket update. No reservation is made.",inputSchema:{type:"object",properties:{seat_ids:{type:"array",items:{type:"string"},description:"Seat ids or labels, e.g. from find_seats."}},required:["seat_ids"],additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:r=>t(()=>Ml(n,r))},{name:`${Wt}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(()=>Os(n))}];return e&&i.push({name:`${Wt}hold_selection`,title:"Reserve the selected seats",description:"Reserve the currently selected seats for this buyer for a limited time, exactly as pressing the checkout button would. Confirm with the buyer before calling this.",inputSchema:{type:"object",properties:{},additionalProperties:!1},annotations:{readOnlyHint:!1,untrustedContentHint:!0},execute:()=>t(()=>n.hold())}),i}async function _s(n,e={}){let t=Tl();if(!t||typeof t.registerTool!="function")return null;let i=new AbortController,r=Hl(n,!!e.holds),s=[],o=e.exposedTo?.length?[...new Set(e.exposedTo)]:void 0;try{for(let a of r)await t.registerTool(a,{signal:i.signal,...o?{exposedTo:o}:{}}),s.push(a.name)}catch(a){console.warn("seatmap: WebMCP tools could not be registered",a)}return s.length?{names:s,dispose:()=>{if(i.abort(),typeof t.unregisterTool=="function")for(let a of s)try{t.unregisterTool(a)}catch{}}}:null}async function Ds(n){let e=n.opts.webMcp;if(!e||n.destroyed)return;let t=typeof e=="object"&&!!e.holds,i=typeof e=="object"?e.exposedTo:void 0;try{n.webMcp=await _s(An(n,t),{holds:t,exposedTo:i}),n.destroyed&&En(n)}catch(r){console.warn("seatmap: WebMCP registration failed",r)}}function En(n){n.webMcp?.dispose(),n.webMcp=null}function An(n,e){let t=(i,r)=>{if(Number.isInteger(i.logicalSeatIndex))return i.logicalSeatIndex;let s=i.id.lastIndexOf(":"),o=s<0?NaN:Number(i.id.slice(s+1));return Number.isFinite(o)?o:r};return{event:()=>{let i=n.renderInfo;return i?{name:i.eventName??"",venue:i.venue??null,startsAt:i.startsAt??null,timezone:i.timezone??null,currency:n.currency,salesClosed:n.salesClosed}:null},selectionLimits:()=>({max:n.maxTickets,required:n.exactTickets}),categories:()=>{let i=n.controller.categoryAvailability();return(n.controller.doc?.categories??[]).filter(r=>!r.notForSale).map(r=>{let s=$i(n,r),o=Ni(n,r);return{key:r.key,label:r.label??r.key,...o===void 0?{}:{price:o},...s&&s.min!==s.max?{priceRange:s}:{},available:i[r.key]??0}})},zones:()=>n.controller.getBestAvailableZones(),hasPremiumSeats:()=>n.controller.hasPremiumSeats(),seats:()=>{let i=n.controller.getActiveFloorId(),r=[];return n.allSeats().forEach((s,o)=>{if(s.floorId&&i&&s.floorId!==i)return;let a=n.controller.getStatus(s.id)??"free",l=n.controller.doc?.categories.find(d=>d.key===s.categoryKey),c=l?.tiers?.length?l.tiers[0].price:l?.price??0;r.push({id:s.id,label:s.label,rowKey:s.logicalRowId??s.rowId,sectionKey:s.sectionId??s.rowId,index:t(s,o),categoryKey:s.categoryKey,price:n.paidPrice(s.categoryKey,l?.tiers?.[0]?.id??null,c,s.label),...s.zoneId?{zoneId:s.zoneId}:{},available:a==="free"&&!l?.notForSale})}),r},describeSeat:i=>{let r=n.controller.seatDetails(i);return r?{section:r.sectionLabel??"",row:te(r)??"",seat:r.seatNumber??r.label,category:r.categoryLabel??r.categoryKey}:null},selection:()=>{let{freshSeats:i,total:r,count:s}=Bi(n);return{seats:i.map(o=>({id:o.id,label:o.label,section:o.sectionLabel??"",row:te(o)??"",seat:o.seatNumber??o.label,category:o.categoryKey,price:n.paidPrice(o.categoryKey,o.tierId??null,o.price,o.label)})),count:s,total:r,currency:n.currency,hold:n.hold?{id:n.hold.holdId,expiresAt:n.hold.expiresAt}:null,validity:n.getSelectionValidity()}},clearSelection:()=>n.clearSelection(),selectObjects:i=>{n.selectObjects(i)},hold:()=>e?Il(n):Promise.resolve({ok:!1,reason:"not_allowed"})}}async function Il(n){if(n.salesClosed)return{ok:!1,reason:"event_closed"};if(!n.totalTicketCount())return{ok:!1,reason:"nothing_selected"};let e=n.controller.getSelectionValidity(n.totalTicketCount());return e&&!e.isValid?{ok:!1,reason:"invalid_selection"}:(await n.handleCta(),n.hold?{ok:!0,hold:{id:n.hold.holdId,expiresAt:n.hold.expiresAt}}:{ok:!1,reason:"hold_failed"})}function Yt(n){if(!n)return null;let e=n.getBoundingClientRect();return e.width>0&&e.height>0?e:null}function Rl(n){return Yt(n.peek?.querySelector(".sl-peek-sum"))??Yt(n.foot?.querySelector(".sl-total"))??Yt(n.tray)??Yt(n.sheetHead)}function Ln(n,e,t,i){let r=n,s=r.map;if(!s||!e)return;let o=s.getBoundingClientRect(),a={x:o.left+e.x,y:o.top+e.y},l=t.displayLabel??t.label,c=i?.find(p=>p.key===t.categoryKey)?.color,d=()=>{let p=Rl(r);p&&ur({from:a,to:{x:p.left+p.width/2,y:p.top+p.height/2},label:l,color:c})};Yt(r.peek)?requestAnimationFrame(d):d()}var Pn=60,Ol=650;function Bs(n,e){if(!e.length)return;e.forEach((s,o)=>{n.schedule(()=>n.pop(s.id),o*Pn)});let t=e.length*Pn,i=e.find(s=>s.sectionId)?.sectionId;if(i){let s=e.filter(a=>a.sectionId===i),o={x:s.reduce((a,l)=>a+l.x,0)/s.length,y:s.reduce((a,l)=>a+l.y,0)/s.length};n.schedule(()=>n.focus(i,o),t)}let r=t+(i?Ol:0);e.forEach((s,o)=>{n.schedule(()=>Ln(n.regions,n.screenPoint(s),s,n.categories),r+o*Pn)})}function Mn(n){return{renderingTimeMillis:n.ms,performanceProfile:n.performanceProfile,seatCount:n.seatCount,objectCount:n.objectCount,sectionCount:n.sectionCount,view:n.view,eventKey:n.eventKey,chartName:n.chartName,floorCount:n.floorCount,transport:n.transport,load:n.load,metricScope:n.metricScope,operationalTelemetryReporter:"sdk"}}function Ns(n,e){Me({apiBase:n.apiBase,event:n.eventKey,scope:n.metricScope,surface:n.surface,outcome:"success",ms:n.ms,performanceProfile:n.performanceProfile,chartDelivery:n.chartDelivery,seats:n.seatCount,floors:n.floorCount,view:n.view,load:n.load,transport:n.transport}),e("chart_rendered",Mn(n))}var $s=require("@seatlayer/core/core/seatConfidence");function re(n){return String(n??"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function zs(n){let e=(0,$s.seatConfidenceDisclosure)(n.seat.confidenceEvidence),t=n.seat.confidenceEvidence,i=e.limitations.length?`<h4>Known limits</h4><ul>${e.limitations.map(c=>`<li>${re(c)}</li>`).join("")}</ul>`:"",r=e.modeledTarget?`<div><dt>Modeled target</dt><dd>${re(e.modeledTarget)}</dd></div>`:"",s=t?`<div><dt>Evidence ID</dt><dd>${re(t.evidenceId)}</dd></div><div><dt>Model version</dt><dd>${re(t.modelVersion)}</dd></div><div><dt>Event configuration</dt><dd>${re(t.eventConfigurationId??"Not configuration-specific")}</dd></div><div><dt>Approval</dt><dd>${re(t.approvedByRole??"No external approval supplied")}</dd></div>`+(t.validUntil?`<div><dt>Valid until</dt><dd>${re(t.validUntil.slice(0,10))}</dd></div>`:""):"<div><dt>Evidence ID</dt><dd>None supplied</dd></div>",o=He(n.seat.commercial)||n.restrictionFallback,a=`<div><dt>View restriction</dt><dd>${re(o)}</dd></div>`+(n.seat.commercial?.note?`<div><dt>Organizer note</dt><dd>${re(n.seat.commercial.note)}</dd></div>`:""),l=n.canReport?'<button type="button" data-report>Report this view</button><p data-report-status role="status" aria-live="polite"></p>':"";return`<div class="sl-view3d-passport-scrim" aria-hidden="true"></div><section class="sl-view3d-passport" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-passport-title"><header><div><span>Seat confidence passport</span><strong id="sl-view3d-passport-title">${re(n.title)}</strong></div><button type="button" data-close aria-label="Close seat confidence passport">\xD7</button></header><div class="sl-view3d-passport-summary"><strong>${re(e.headline)}</strong><span>${re(e.coverage)} \xB7 ${re(e.freshness)}</span></div><dl><div><dt>Model status</dt><dd>${re(e.model)}</dd></div><div><dt>Reality evidence</dt><dd>${re(e.reality)}</dd></div><div><dt>Source</dt><dd>${re(e.provenance)}</dd></div>`+a+r+s+`</dl>${i}<p class="sl-view3d-passport-note">This passport describes supplied evidence and known limits. It does not guarantee that every temporary obstruction or real-world condition is knowable before the event build.</p>`+l+"</section>"}function Fs(n){return n?n.closest("[data-report]")?"report":n.closest("[data-close]")||n.classList.contains("sl-view3d-passport-scrim")?"close":null:null}function zi(n,e,t){let i=n?.querySelector("[data-report]"),r=n?.querySelector("[data-report-status]");i&&(i.disabled=e!=="failed",i.textContent=e==="received"?"Report received":"Report this view"),r&&(r.setAttribute("role",e==="failed"?"alert":"status"),r.textContent=e==="sending"?"Sending report\u2026":e==="received"?`Report received. Reference ${t??""}.`:"The report could not be sent. Please try again.")}function Hn(n,e,t=null){let i=n.view3dEl;if(!i)return;Qt(n,!1);let r=e.confidenceEvidence,s=n.controller.seatDetails(e.id),o=document.createElement("div");o.className="sl-view3d-passport-shell",o.innerHTML=zs({seat:e,title:s?.displayLabel??e.displayLabel??e.label,restrictionFallback:n.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),canReport:typeof n.api.reportViewEvidence=="function"});let a=[...new Set([...i.children,...[...n.els.map.children].filter(u=>u!==i)])].filter(u=>u instanceof HTMLElement),l=a.map(u=>({element:u,inert:u.inert,ariaHidden:u.getAttribute("aria-hidden")}));for(let u of a)u.inert=!0,u.setAttribute("aria-hidden","true");i.appendChild(o),i.classList.add("has-passport"),n.view3dPassportEl=o;let c=o.querySelector(".sl-view3d-passport"),d=()=>[...c.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],p=u=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),Qt(n);return}if(u.key!=="Tab")return;let h=d();if(!h.length)return;let g=h[0],m=h[h.length-1];u.shiftKey&&document.activeElement===g?(u.preventDefault(),m.focus()):!u.shiftKey&&document.activeElement===m&&(u.preventDefault(),g.focus())};window.addEventListener("keydown",p,!0),n.view3dPassportCleanup=()=>{window.removeEventListener("keydown",p,!0);for(let m of l)m.element.inert=m.inert,m.ariaHidden===null?m.element.removeAttribute("aria-hidden"):m.element.setAttribute("aria-hidden",m.ariaHidden);let u=t?.isConnected?t:n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareEl?.querySelector("[data-passport-seat]")??null,h=u?.closest(".sl-confirm,.sl-view3d-compare");h?.isConnected&&(h.inert=!1,h.removeAttribute("aria-hidden")),o.remove(),i.classList.remove("has-passport"),n.view3dPassportEl===o&&(n.view3dPassportEl=null);let g=u??n.view3dCompareEl?.querySelector("[data-passport-seat]")??n.confirmEl?.querySelector(".sl-confirm-confidence")??n.view3dCompareChip.mainButton();(t?.isConnected?t:g)?.focus()},o.addEventListener("click",u=>{let h=Fs(u.target instanceof HTMLElement?u.target:null);h==="close"&&Qt(n),h==="report"&&_l(n,e)}),requestAnimationFrame(()=>d()[0]?.focus()),n.emit3dAnalytics("3d_confidence_passport_opened",{seatId:e.id,evidenceId:r?.evidenceId??null,eventConfigurationId:r?.eventConfigurationId??null,modelLevel:r?.modelLevel??"unverified",realityLevel:r?.realityLevel??"none"})}async function _l(n,e){if(n.api.reportViewEvidence){zi(n.view3dPassportEl,"sending");try{let t=await n.api.reportViewEvidence(n.opts.event,{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId});n.emit3dAnalytics("3d_confidence_view_reported",{seatId:e.id,evidenceId:e.confidenceEvidence?.evidenceId??null}),zi(n.view3dPassportEl,"received",t.report.id)}catch{zi(n.view3dPassportEl,"failed")}}}function Qt(n,e=!0){let t=n.view3dPassportCleanup;if(n.view3dPassportCleanup=null,!t){n.view3dPassportEl?.remove(),n.view3dPassportEl=null,n.view3dEl?.classList.remove("has-passport");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function Vs(n){let e=n.view3dEl;if(!e||n.view3dCompareSeatIds.length<2)return;Xe(n,!1);let t=n.view3dCompareSeatIds.map(h=>n.view3dComparisonSnapshot(h)).filter(h=>!!h);if(t.length<2){n.clearView3dComparison();return}let i=h=>w(h),r=t.some(h=>!!h.price),s=document.createElement("div");s.className="sl-view3d-compare-shell";let o=t.map((h,g)=>`<article><span>Seat ${g===0?"A":"B"}</span><strong>${i(h.label)}</strong><small>Section ${i(h.section)} \xB7 Row ${i(h.row)}</small><dl>`+(r?`<div><dt>Current price</dt><dd>${i(h.price)}</dd></div>`:"")+`<div><dt>Ticket type</dt><dd>${i(h.category)}</dd></div><div><dt>Availability</dt><dd>${i(h.availability)}</dd></div><div><dt>View source</dt><dd>${i(h.viewSource)}</dd></div><div><dt>View restriction</dt><dd>${i(h.limited)}</dd></div><div><dt>Seat confidence</dt><dd>${i(h.confidence.headline)}</dd></div><div><dt>Reality check</dt><dd>${i(h.confidence.reality)}</dd></div><div><dt>Accessibility</dt><dd>${i(h.accessibility)}</dd></div></dl><div class="sl-view3d-compare-actions"><button type="button" data-passport-seat="${i(h.seat.id)}">Passport</button><button type="button" data-view-seat="${i(h.seat.id)}">View seat</button><button type="button" class="select" data-select-seat="${i(h.seat.id)}"${h.selectable?"":" disabled"}>Select seat</button></div></article>`).join("");s.innerHTML=`<div class="sl-view3d-compare-scrim" aria-hidden="true"></div><section class="sl-view3d-compare" role="dialog" aria-modal="true" aria-labelledby="sl-view3d-compare-title"><header><div><span>Seat inspection</span><strong id="sl-view3d-compare-title">Compare disclosed attributes</strong></div><button type="button" data-close aria-label="Close seat comparison">\xD7</button></header><p class="sl-view3d-compare-note">${r?"Current price and availability":"Availability"} comes from this picker. Modeled views are chart-derived unless organizer media is labeled.</p><div class="sl-view3d-compare-grid">${o}</div></section>`;let a=document.activeElement instanceof HTMLElement?document.activeElement:null,l=[...e.children].filter(h=>h instanceof HTMLElement),c=l.map(h=>({element:h,inert:h.inert,ariaHidden:h.getAttribute("aria-hidden")}));for(let h of l)h.inert=!0,h.setAttribute("aria-hidden","true");e.appendChild(s),e.classList.add("has-comparison"),n.view3dCompareEl=s;let d=s.querySelector(".sl-view3d-compare"),p=()=>[...d.querySelectorAll('button:not(:disabled),[href],[tabindex]:not([tabindex="-1"])')],u=h=>{if(h.key==="Escape"){h.preventDefault(),Xe(n);return}if(h.key!=="Tab")return;let g=p();if(!g.length)return;let m=g[0],v=g[g.length-1];h.shiftKey&&document.activeElement===m?(h.preventDefault(),v.focus()):!h.shiftKey&&document.activeElement===v&&(h.preventDefault(),m.focus())};window.addEventListener("keydown",u),n.view3dCompareCleanup=()=>{window.removeEventListener("keydown",u);for(let h of c)h.element.inert=h.inert,h.ariaHidden===null?h.element.removeAttribute("aria-hidden"):h.element.setAttribute("aria-hidden",h.ariaHidden);s.remove(),e.classList.remove("has-comparison"),n.view3dCompareEl===s&&(n.view3dCompareEl=null),a?.isConnected?a.focus():n.view3dCompareChip.mainButton()?.focus()},s.querySelector("[data-close]")?.addEventListener("click",()=>Xe(n)),s.querySelectorAll("[data-passport-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.passportSeat,m=g?n.allSeats().find(v=>v.id===g):void 0;m&&Hn(n,m,h)})),s.querySelectorAll("[data-view-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.viewSeat;Xe(n,!1),g&&n.view3dHandle?.flyToSeat(g)})),s.querySelectorAll("[data-select-seat]").forEach(h=>h.addEventListener("click",()=>{let g=h.dataset.selectSeat;g&&Dl(n,g)})),requestAnimationFrame(()=>p()[0]?.focus()),n.emit3dAnalytics("3d_comparison_opened",{seatIds:n.view3dCompareSeatIds.slice()})}function Xe(n,e=!0){let t=n.view3dCompareCleanup;if(n.view3dCompareCleanup=null,!t){n.view3dCompareEl?.remove(),n.view3dCompareEl=null,n.view3dEl?.classList.remove("has-comparison");return}e||(document.activeElement instanceof HTMLElement?document.activeElement:null)?.blur(),t(),e||n.root?.focus({preventScroll:!0})}function Dl(n,e){if(n.salesClosed){n.toast(n.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}let t=n.allSeats().find(r=>r.id===e);if(!t)return;if(Xe(n,!1),!n.controller.select([e]).length){n.syncSelectionTo3d(),n.toast(n.tf("picker.seatNoLongerAvailable","That seat is no longer available."),"warning");return}n.syncSelectionTo3d(),n.showConfirm(t),n.emit3dAnalytics("3d_comparison_selected",{seatId:e})}function js(n,e){n.querySelector(".sl-view3d-unavailable")?.remove();let{tf:t}=e,i=e.status==="held"?{title:t("picker.temporarilyHeld","Temporarily held"),message:t("picker.heldSeatExplanation","Another buyer is holding this seat. It may become available again.")}:e.status==="booked"?{title:t("picker.sold","Sold"),message:t("picker.soldSeatExplanation","This seat has already been booked.")}:{title:t("picker.notForSale","Not for sale"),message:t("picker.notForSaleExplanation","This seat is not included in the current sale.")},r=document.createElement("div");r.className="sl-view3d-unavailable",r.dataset.state=e.visualState,r.setAttribute("role","status"),r.setAttribute("aria-live","polite");let s=document.createElement("span");s.className="sl-view3d-unavailable-eyebrow",s.textContent=e.location;let o=document.createElement("strong");o.textContent=i.title;let a=document.createElement("div");a.className="sl-view3d-unavailable-copy",a.append(s,o);let l=document.createElement("button");l.type="button",l.setAttribute("aria-label",t("picker.closeSeatStatus","Close seat status")),l.textContent="\xD7";let c=document.createElement("p");c.textContent=i.message,r.append(a,l,c),l.addEventListener("click",()=>In(n)),n.appendChild(r),gi(r,e.anchor??null)}function In(n){let e=n?.querySelector(".sl-view3d-unavailable:not([data-leaving])");e&&(e.dataset.leaving="true",Ne(e))}var Xt=require("@seatlayer/core");function Gs(n){return Array.isArray(n)?n.reduce((e,t)=>t.type==="minimumSelectedPlaces"?Math.max(e,t.minimum):e,0):0}function Rn(n,e,t=!1){let i=n.violations[0];return i==="numberOfPlacesToSelect"?n.remaining>0?(0,Xt.t)("picker.selectExactMore",{count:n.remaining}):(0,Xt.t)("picker.selectExactCount",{count:n.required}):i==="minimumSelectedPlaces"?(0,Xt.t)("picker.selectMinimumMore",{count:n.remaining}):t?e("picker.adjustSeatSelection","Adjust seat selection"):i==="consecutiveSeats"?e("picker.selectSeatsTogether","Choose seats together in the same row and ticket category."):(0,Xt.t)("picker.orphanHint")}var ge=require("@seatlayer/core");function Zt(n){let e=Math.max(0,n),t=Math.floor(e/6e4),i=String(Math.floor(e%6e4/1e3)).padStart(2,"0");return`${t}:${i}`}function qs(n){let e=n.performanceLabel?`<div class="sl-chip-when">${_(n.performanceLabel)}</div>`:"",t=n.performanceDates?.labels.length?`<div class="sl-chip-dates"><span class="sl-chip-dates-summary">${_(n.performanceDates.summary)}</span><span class="sl-chip-date-list">${n.performanceDates.labels.map(i=>`<span class="sl-chip-date">${_(i)}</span>`).join("")}</span></div>`:"";return e+Bl(n)+t}function Bl(n){let{d:e,area:t,label:i,objectType:r,quantity:s=1,identity:o}=n,a=L=>String(L??"\u2014").replace(/[&<>"]/g,b=>({"&":"&","<":"<",">":">",'"':"""})[b]),l=r==="ga"?"ga":e?.objectType??r,c=o?.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=o?.rowLabel??o?.displayLabel??e?.rowLabel??e?.displayLabel??t?.label??i,p=n.categoryLabel?.trim()??"",u="",h=[];l==="table"&&o?.bookingMode?(u=`${c} ${d}`,h.push([y("picker.guests","Guests"),String(s)])):l==="ga"?(u=String(t?.displayLabel??d),s>1&&h.push([y("picker.tickets","Tickets"),String(s)])):l==="booth"?(u=e?.sectionLabel??`${c} ${d}`,e?.sectionLabel&&h.push([c,String(d)])):!e?.sectionLabel&&!e?.rowLabel&&!e?.seatNumber?u=String(d):(u=e.sectionLabel??"",e.rowLabel&&h.push([c,String(te(e)??e.rowLabel)]),e.seatNumber&&h.push([y("picker.seat","Seat"),String(e.seatNumber)]));let g=!u&&!!p,m=u||p||String(d),v=!!p&&!g&&p!==m,k=h.map(([L,b])=>`<span class="w">${a(L)}</span> <b>${a(b)}</b>`);v&&k.push(`<span class="w">${a(p)}</span>`);let S=[m,...h.map(([L,b])=>`${L} ${b}`),v?p:""].filter(Boolean).join(" \xB7 ");return`<div class="sl-chip-id"><span class="sl-sr">${a(S)}</span><span class="sl-chip-name" aria-hidden="true">${a(m)}</span>`+(k.length?`<span class="sl-chip-pos" aria-hidden="true">${k.join("<i>\xB7</i>")}</span>`:"")+"</div>"}function On(n,e){let t=_(n),i=e?_(e):"";return'<div class="sl-chip-rail">'+(e?`<button type="button" class="view" data-view-label="${i}" aria-label="${_((0,ge.t)("picker.viewFromSeat",{label:e}))}"><svg viewBox="0 0 24 24"><path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"/><circle cx="12" cy="12" r="3"/></svg></button>`:"")+`<button type="button" class="rm" aria-label="${t}"><svg viewBox="0 0 24 24"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button></div>`}function Ks(n){return n.salesClosed||n.hasHold||n.ctaPhase!=="idle"||n.formOpen||n.room<=0?null:Math.max(1,Math.min(n.wanted,n.room))}function Us({count:n,total:e,pendingCount:t,ctaPhase:i,hasHold:r,salesClosed:s,suppressPricing:o=!1,fromPrice:a,addMore:l,offerFind:c=!1,holdTime:d,money:p}){return n&&i==="holding"?`<span>${y("picker.securingSeats","Securing your seats\u2026")}</span>`:n&&i==="checkout"?o?`<span>${y("picker.seatsSecuredOpeningCheckout","Seats secured. Opening checkout\u2026")}</span>`:`<span>${(0,ge.t)("picker.peekSecured",{count:n,total:p(e)})}</span>`:n?`<span class="sl-peek-sum">${(0,ge.tCount)("picker.ticketsCount",n)}</span>`+(l&&!o?`<button type="button" class="go ghost sl-sheet-go sl-sheet-best" data-act="best" aria-label="${y("picker.findTogetherInstead","Find seats together instead")}"><span aria-hidden="true">\u2726</span>${y("picker.seatsTogether","Seats together")}</button>`:"")+`<button type="button" class="go sl-sheet-go" data-act="checkout">${r&&t?y("picker.secureMore","Secure more"):y("picker.continue","Continue")}`+(o?"":`<span class="sl-peek-total">${p(e)}</span>`)+(r&&d?`<span class="sl-peek-time" aria-hidden="true">${d}</span>`:"")+"</button>":s?`<span>${y("picker.salesClosedPill","Sales are closed")}</span>`:`<span class="sl-peek-sum">${!o&&a!=null?(0,ge.t)("picker.peekFromPrice",{price:p(a)}):y("picker.pickYourSeats","Pick your seats")}</span>`+(c?`<button type="button" class="go sl-sheet-go sl-sheet-find" data-act="find"><span class="sl-peek-spark" aria-hidden="true">\u2726</span>${y("picker.findSeats","Find seats")}</button>`:"")}function _n(n,e=Date.now()){return(0,ge.t)("picker.holdReassurance",{time:Zt(n-e)})}function Ws(n){return n.confirming?`<div class="sl-ba" role="alert"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${y("picker.replaceCurrentChoices","Replace your current choices?")}</div><div class="sl-ba-replace"><b>${(0,ge.t)("picker.willFindSeatsTogether",{count:n.quantity})}</b><span>${y("picker.manualTicketsRemovedNote","Your manually selected tickets will be removed only after a new group is secured.")}</span></div><div class="sl-ba-actions"><button type="button" data-ba-cancel>${y("picker.keepMine","Keep mine")}</button><button type="button" class="replace" data-ba-replace>${y("picker.findNewSeats","Find new seats")}</button></div></div>`:`<div class="sl-ba"><div class="sl-ba-title"><span class="spark" aria-hidden="true">\u2726</span>${y("picker.findClosestSeatsTogether","Find the closest seats together")}</div><div class="sl-ba-copy">${y("picker.closestGroupChosenInstantly","Closest available group, chosen instantly.")}</div>`+(n.offerPremium?`<button type="button" class="sl-ba-premium${n.premium?" on":""}" data-ba-premium aria-pressed="${n.premium?"true":"false"}"><span class="star" aria-hidden="true">\u2605</span>${y("picker.bestSeatsPremium","Best seats")}</button>`:"")+`<div class="sl-ba-qty"><button type="button" data-ba="-1" aria-label="${y("picker.fewerSeats","Fewer seats")}">\u2212</button><span>${n.quantity}</span><button type="button" data-ba="1" aria-label="${y("picker.moreSeats","More seats")}">+</button></div>`+(n.categories.length>1?`<select class="sl-ba-cat" aria-label="${_(y("picker.preferredTicketType","Preferred ticket type"))}" data-ba-cat><option value="">${_(y("picker.anyTicketType","Any ticket type"))}</option>`+n.categories.map(e=>`<option value="${_(e.key)}"${n.selectedCategory===e.key?" selected":""}>${_(e.label)}</option>`).join("")+"</select>":'<span class="sl-ba-cat" aria-hidden="true"></span>')+(n.zones.length?`<select class="sl-ba-zone" aria-label="${y("picker.preferredVenueZone","Preferred venue zone")}" data-ba-zone><option value="">${y("picker.anyVenueZone","Any venue zone")}</option>`+n.zones.map(e=>`<option value="${_(e.id)}"${n.selectedZone===e.id?" selected":""}>${_(e.label)}</option>`).join("")+"</select>":"")+`<button type="button" class="sl-ba-go${n.busy?" sl-busy":""}"${n.busy?" disabled":""}>`+(n.busy?`<span class="sl-ba-spin" aria-hidden="true"></span>${y("picker.findingBestSeats","Finding the best seats\u2026")}`:(0,ge.tCount)("picker.findBestSeatsCount",n.quantity))+"</button>"+(n.reopened?`<button type="button" class="sl-ba-back" data-ba-close>${y("picker.keepMyPicks","Keep my picks")}</button>`:"")+"</div>"}function Ys(n){if(n.salesClosed&&!n.hasPicks){let e=n.whenText?`<span class="when">${_(n.whenText)}</span>`:"";return`<div class="sl-closed-note" role="status"><b>${y("picker.salesClosedPill","Sales are closed")}</b><span>${y("picker.salesClosedCopy","Ticket sales for this event have ended.")}${e}</span></div>`}return n.hasPicks?"":n.hasGaAreas?`<div class="sl-tray-hint">${n.seated?n.venue3d?y("picker.trayHintChoose3dOrStanding","Choose a seat in the 3D venue \u2014 or grab standing tickets below."):y("picker.trayHintTapOrStanding","Tap a seat on the map \u2014 or grab standing tickets below."):n.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.")}</div>`:`<div class="sl-tray-hint">${n.groupMode==="per_performance"?y("picker.groupPerPerformanceTrayHint","Choose seats for this performance, then complete every date above."):n.groupMode?y("picker.groupTrayHint","Choose seats once \u2014 the same seats will be held for every performance."):n.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.")}</div>`}function Qs(n){return{title:(0,ge.t)("picker.securedCount",{count:n.secured}),copy:n.pendingCount?(0,ge.t)("picker.moreSelectedCount",{count:n.pendingCount}):_n(n.expiresAt),change:n.releasing?y("picker.releasingEllipsis","Releasing\u2026"):y("picker.change","Change")}}var kt=require("@seatlayer/core");var Dn=4,Nl=6;function $l(n){let e=n.trim();return/^[0-9]{1,4}$/.test(e)?Number(e):null}function Xs(n){return[n.held?"h":"s",n.section,n.rowLabel,n.categoryLabel,n.amountText].join(" ")}function zl(n){if(n.length===1)return n[0];let e=n.map($l);if(e.every(i=>i!==null)){let i=[...e].sort((o,a)=>o-a);if(i.every((o,a)=>a===0||o===i[a-1]+1))return`${i[0]}\u2013${i[i.length-1]}`;let s=i.slice(0,3).join(", ");return i.length>3?`${s} +${i.length-3}`:s}let t=n.slice(0,3).join(", ");return n.length>3?`${t} +${n.length-3}`:t}function Fl(n){let e=[];for(let t of n){let i=e[e.length-1];!!i&&t.groupable&&i.members[0].groupable&&Xs(i.members[0])===Xs(t)?i.members.push(t):e.push({members:[t],seatsLabel:""})}for(let t of e)t.seatsLabel=zl(t.members.map(i=>i.seatLabel));return e}function Js(n,e,t,i){let r=_;return` data-key="${r(n)}"`+(t.length?` data-held="${r(encodeURIComponent(t.join(`
|
|
2685
|
-
`)))}"`:"")+(e.length?` data-seat="${r(e.join(" "))}"`:"")+(i?` data-locate="${r(i)}"`:"")}function eo(n){let e=_;return`<div class="sl-chip${n.held?" sl-held":""}${n.fresh?" sl-enter":""}"`+Js(n.key,n.seatIds,n.heldLabels,n.locateId)+">"+(n.held?n.stateHtml:`<span class="sl-chip-dot" style="background:${w(n.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${n.identityHtml}`+(n.extrasHtml?`<div class="sl-chip-sub">${n.extrasHtml}</div>`:"")+`${n.noteHtml}</div>`+(n.amountText?`<span class="amt">${e(n.amountText)}</span>`:"")+n.railHtml+"</div>"}function Zs(n,e,t,i,r){let s=_,o=e?.members.length??1,a=o>1,l=e?e.seatsLabel:n.seatLabel,c=e?e.members.reduce((u,h)=>u+h.amount,0):n.amount,d=e?e.members.flatMap(u=>u.seatIds):n.seatIds,p=e?e.members.flatMap(u=>u.heldLabels):n.heldLabels;return`<div class="sl-chip sl-tline${n.held?" sl-held":""}${n.fresh?" sl-enter":""}${e?"":" sl-tsub"}"${i?' data-overflow="true"':""}`+(e?` data-run="${t}"`:` data-run-of="${t}"`)+Js(n.key,d,p,n.locateId)+">"+(a?`<button type="button" class="sl-trun-toggle" aria-expanded="false" aria-label="${s((0,kt.tCount)("picker.seatsSelectedCount",o))}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg></button>`:n.held?n.stateHtml:`<span class="sl-tline-dot" style="background:${w(n.categoryColor)}" aria-hidden="true"></span>`)+`<span class="sl-sr">${s(n.categoryLabel)}</span><span class="sl-tline-id"><b>${s(n.section||n.seatLabel)}</b>`+(n.rowLabel?`<i>\xB7</i><span>${s(n.rowLabel)}</span>`:"")+(n.section&&l?`<i>\xB7</i><span>${s(l)}</span>`:"")+"</span>"+n.extrasHtml+(r.suppressPricing||!n.amountText?"":(a?`<span class="sl-tline-mult">${o}\xD7</span>`:"")+`<span class="amt">${s(r.money(c))}</span>`)+(n.railHtml?`<button type="button" class="rm" aria-label="${s(a?(0,kt.t)("picker.removeSeatLabel",{label:[n.section,n.rowLabel,l].filter(Boolean).join(" \xB7 ")}):n.removeAria)}"><svg viewBox="0 0 24 24" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button>`:"")+"</div>"}function to(n,e){if(!n.length)return"";let t=Fl(n),i=[y("picker.section","Section"),y("picker.row","Row"),y("picker.seat","Seat")].join(" \xB7 "),r=t.length>=Nl,s=t.map((a,l)=>{let c=r&&l>=Dn;return Zs(a.members[0],a,l,c,e)+(a.members.length>1?a.members.map(d=>Zs(d,null,l,c,e)).join(""):"")}).join(""),o=r?`<button type="button" class="sl-tmore" data-tmore aria-expanded="false" data-more="${_((0,kt.t)("picker.moreCount",{count:t.length-Dn}))}" data-less="${_(y("picker.showLess","Show less"))}"><span>${_((0,kt.t)("picker.moreCount",{count:t.length-Dn}))}</span><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg></button>`:"";return`<div class="sl-tlist"${r?' data-collapsed="true"':""}><div class="sl-tlist-head sl-sr">${_(i)}</div>${s}${o}</div>`}function io(n){n.dataset.denseWired!=="true"&&(n.dataset.denseWired="true",n.addEventListener("click",e=>{let t=e.target,i=t.closest("[data-tmore]");if(i){let l=i.closest(".sl-tlist"),c=l?.getAttribute("data-collapsed")==="true";l?.setAttribute("data-collapsed",c?"false":"true"),i.setAttribute("aria-expanded",c?"true":"false");let d=i.querySelector("span");d&&(d.textContent=(c?i.dataset.less:i.dataset.more)??d.textContent);return}let r=t.closest(".sl-trun-toggle");if(!r)return;e.stopPropagation();let s=r.closest(".sl-tline"),o=s?.dataset.run;if(!s||o===void 0)return;let a=r.getAttribute("aria-expanded")!=="true";r.setAttribute("aria-expanded",a?"true":"false"),s.setAttribute("data-open",a?"true":"false"),s.parentElement?.querySelectorAll(`.sl-tsub[data-run-of="${o}"]`).forEach(l=>l.setAttribute("data-open",a?"true":"false"))}))}var St=require("@seatlayer/core");var Vl='<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>',jl='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="8.4"/><circle cx="8.6" cy="10.2" r="1.15"/><circle cx="12" cy="8.2" r="1.15"/><circle cx="15.4" cy="10.2" r="1.15"/><path d="M12 20.4a2.6 2.6 0 0 1 0-5.2 2.2 2.2 0 0 0 0-4.4"/></svg>',Fi=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let i=this.offered().length>0;this.button.setAttribute("aria-label",i?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options")),this.button.innerHTML=i?Vl:jl,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=xs(this.rows()),this.root.append(this.menu,this.button),e.appendChild(this.root),this.button.addEventListener("click",r=>{r.stopPropagation(),this.open(this.menu.hidden)}),this.menu.addEventListener("pointerdown",r=>r.stopPropagation()),this.menu.addEventListener("click",r=>r.stopPropagation()),this.dismiss=()=>this.open(!1),this.escape=r=>{r.key==="Escape"&&this.open(!1)},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),this.wire(),this.active.size){this.applyFilter({focus:!1});let r=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(r):r()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:i,count:r})=>[i,r])),t=!1;for(let i of this.menu.querySelectorAll("[data-a11y-row]")){let r=i.dataset.a11yRow??"";if(!r.startsWith("a11y:"))continue;let s=r.slice(5),o=e.get(s);if(o===void 0)continue;let a=i.querySelector(".sl-a11yrow-c");a&&(a.textContent=o==null?"":o>0?(0,St.t)("picker.accessFreeCount",{count:o}):this.deps.tf("picker.accessNoneLeft","None left"));let l=o===0;i.disabled=l,l?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),l&&this.active.delete(s)&&(this.paint(i,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let i=t.dataset.a11yRow??"";i.startsWith("a11y:")&&this.paint(t,this.active.has(i.slice(5)))}}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),this.root.remove()}open(e){if(e===!this.menu.hidden)return;if(this.button.setAttribute("aria-expanded",String(e)),!e){this.menu.hidden=!0,this.menu.classList.remove("sl-mo-in","sl-mo-stagger");return}this.menu.hidden=!1;let t=this.button.getBoundingClientRect();nn(this.menu,{x:t.left+t.width/2,y:t.top}),pr(this.menu),gi(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",icon:"\u25D0",label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",icon:"\u25D0",className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:i,count:r})=>({key:i,count:r}));let t=this.deps.present;return t?St.ACCESSIBILITY_TYPES.filter(({key:i})=>t.has(i)).map(({key:i})=>({key:i,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(St.ACCESSIBILITY_TYPES.map(i=>[i.key,i]));return this.offered().flatMap(({key:i,count:r})=>{let s=t.get(i);return s?[{key:`a11y:${i}`,icon:s.icon,label:s.label,...i==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...r==null?{}:{count:r>0?(0,St.t)("picker.accessFreeCount",{count:r}):this.deps.tf("picker.accessNoneLeft","None left"),disabled:r===0},on:this.active.has(i)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let s=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(s),this.paint(e,s);return}if(t==="limited"){let s=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(s),s&&this.deps.focusSeatsForFilter(),this.paint(e,s);return}let i=t.slice(5),r=!this.active.has(i);r?this.active.add(i):this.active.delete(i),this.paint(e,r),this.applyFilter()})}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 no=require("@seatlayer/core"),Gl=250;function ro(n,e=Gl){let t=null,i=()=>{t===null&&(t=setTimeout(()=>{t=null,n()},e))},r=(0,no.attachVisibilityCatchUp)(i),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",i),()=>{t!==null&&(clearTimeout(t),t=null),r(),s&&window.removeEventListener("focus",i)}}var Ze=require("@seatlayer/core");var Vi=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,Ze.holdRecoveryShape)(e),i=e.lapsedLabels.length,r=i-e.recoverable.length,s=t==="all"?(0,Ze.tCount)("picker.holdLapsedStillFree",i):t==="partial"?(0,Ze.tCount)("picker.holdLapsedSomeTaken",r):(0,Ze.tCount)("picker.holdLapsedAllTaken",i);this.note={message:s,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(s,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${_(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${_(this.note.message)}</span>${e}</div>`}wire(e){e?.querySelector("[data-lapse-again]")?.addEventListener("click",()=>this.recover())}clear(){this.note&&(this.note=null,this.deps.syncTray())}actionLabel(){return(0,Ze.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 so=Symbol("seatlayer.performance-group-picker");function ji(n,e){return Object.defineProperty(n,so,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),n}function oo(n){return n[so]??null}var Fe=require("@seatlayer/core");function Bn(n,e,t){try{return new Intl.DateTimeFormat(e,{...t,...n.timezone?{timeZone:n.timezone}:{}}).format(new Date(n.startsAt))}catch{return new Date(n.startsAt).toLocaleString(e)}}var Gi=(n,e)=>Bn(n,e,{dateStyle:"medium"}),qi=(n,e)=>Bn(n,e,{timeStyle:"short"}),Ki=(n,e)=>Bn(n,e,{weekday:"short",day:"numeric",month:"short"});function ao(n,e,t,i){return!n.length||n.length>=e?null:{summary:i,labels:n.map(r=>`${Gi(r,t)} \xB7 ${qi(r,t)}`)}}function ql(n,e){let t=new Set(e);return n.map(i=>({...i,free:!t.has(i.eventKey)}))}function lo(n,e){let t=[...n];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Kl(n,e,t="",i=!1){if(!n.length)return"";let r=n.map(s=>{let o=s.free?e.free:e.blocked,a=i&&s.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${w(s.eventKey)}" aria-label="${w(`${s.shortDate}: ${o}`)}" checked>`:"";return`<li class="sl-night${s.free?" ok":" no"}" aria-label="${w(`${s.shortDate}: ${o}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${w(s.shortDate)}</span><span class="st">${w(o)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${w(e.title)}</div><ul class="sl-nightstrip">${r}</ul><p class="sl-tip-nights-note">${w(e.notAvailableOn)}</p>`+t+"</div>"}function Ul(n){return n.selectPartialLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${w(n.selectPartialLabel)}</button>`:n.switchLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${w(n.switchLabel)}</button>`:n.switchLabel||n.selectPartialLabel?"":`<p class="sl-tip-advice">${w(n.advice)}</p>`}function Wl(n){return Number(n.available)+Number(n.selected)+Number(n.partial)+Number(n.unavailable)}function co(n,e,t){if(Wl(n)<2)return"";let i=(s,o,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${w(o)}</li>`,r=[];return n.available&&r.push(i("sl-pg-sw-free",e.available,` style="background:${w(t)}"`)),n.selected&&r.push(i("sl-pg-sw-sel",e.selected)),n.partial&&r.push(i("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${w(t)}"`)),n.unavailable&&r.push(i("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${w(e.title)}">${r.join("")}</ul>`}function po(n,e){if(!n.length)return"";let t=n.map(i=>{let r=i.labels.length?i.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${i.labels.length?"":" empty"}${i.active?" active":""}" role="button" tabindex="0"${i.active?' aria-current="true"':""} data-event-key="${w(i.eventKey)}"><span class="n">${w(i.name)}</span><span class="s">${w(r)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${w(e.title)}"><div class="sl-pg-nights-title">${w(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function Nn(n,e){if(n?.kind!=="partial"||!e?.length)return null;let t=n.data?.blockedEventKeys??[],i=ql(e,t);return{states:i,missing:i.filter(r=>!r.free).map(r=>r.shortDate)}}function ho(n,e){return n?Kl(n.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,Fe.t)("picker.group.notAvailableOn",{dates:lo(n.missing,e.locale)})},Ul({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 Yl(n,e,t,i){if(!n.length)return"";let r=new Set(e),s=new Set(t),o=n.map(a=>{let l=r.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${w(a.eventKey)}" aria-label="${w(`${a.shortDate}: ${l?i.available:i.unavailable}`)}"${l&&s.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${w(a.shortDate)}</span><span class="sl-confirm-date-state">${w(l?i.available:i.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${w(i.title)}</legend><p class="sl-confirm-dates-copy">${w(i.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${w(i.selectAll)}</span></label><ul>${o}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function uo(n,e,t,i){let r=e.availableEventKeys(t);return Yl(n,r,e.includedEventKeys(),{title:i("picker.group.confirmDatesTitle","Choose performance dates"),copy:r.length===n.length?i("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(n.length)):i("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(r.length)).replace("{total}",String(n.length)),selectAll:i("picker.group.confirmSelectAll","Select all available dates"),available:i("picker.group.nightFree","Available"),unavailable:i("picker.group.nightBlocked","Unavailable")})}function mo(n){return[...n.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function fo(n,e,t,i){let r=[...n.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!r.length)return;let s=n.querySelector(".sl-confirm-add"),o=n.querySelector("[data-pg-confirm-all]"),a=()=>{let l=r.filter(p=>!p.disabled),c=mo(n).length;o&&(o.checked=c===l.length,o.indeterminate=c>0&&c<l.length);let d=n.querySelector("[data-pg-confirm-summary]");d&&(d.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),s.disabled=c===0,s.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),i()};r.forEach(l=>l.addEventListener("change",a)),o?.addEventListener("change",()=>{r.filter(l=>!l.disabled).forEach(l=>{l.checked=o.checked}),a()}),a()}async function go(n,e,t){if(!n||!t||!n.querySelector("[data-pg-confirm-event-key]"))return!0;let i=mo(n);if(!i.length)return!1;let r=n.querySelector(".sl-confirm-add");return r?.setAttribute("aria-busy","true"),r&&(r.disabled=!0),await t.apply(e,i)?!0:(r?.removeAttribute("aria-busy"),r?.isConnected&&(r.disabled=!1),!1)}function bo(n,e,t){return n?(0,Fe.t)("picker.group.seatPartlyAvailable",{label:e,free:n.states.length-n.missing.length,total:n.states.length,dates:lo(n.missing,t)}):""}function vo(n,e){let t=n.map((i,r)=>{let s=i.state==="done"?e.done:i.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${w(i.id)}" data-state="${w(i.state)}"${i.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${i.state==="done"?"\u2713":String(r+1)}</span><span class="l">${w(i.label)}</span><span class="sl-pg-sr">${w(s)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${w(e.label)}">${t}</ol>`}function $n(n,e){return`<ul class="sl-pg-cards">${n.map(i=>`<li class="sl-pg-card" data-event-key="${w(i.eventKey)}"><span class="n">${w(i.name)}</span><time datetime="${w(i.iso)}"><span class="d">${w(i.date)}</span><span class="t">${w(i.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${w(e)}</p>`}function yo(n){let e=n.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${w(t.eventKey)}"><span class="n">${w(t.name)}</span><span class="s">${w(t.labels.length?t.labels.join(", "):n.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${w(n.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(n.note?`<p class="sl-pg-pane-note">${w(n.note)}</p>`:"")+(n.total?`<div class="sl-pg-pane-total"><span>${w(n.total.label)}</span><b>${w(n.total.amount)}</b></div>`:"")+(n.holdStatus?`<p class="sl-pg-hold-status" role="status">${w(n.holdStatus)}</p>`:"")}function xo(n){let e=Math.max(0,n);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function wo(n,e){if(!n||n.seats<=0)return"";if(e==="same_seat"){let t=n.perPerformance??n.seats;return n.totalPerformances&&n.performances<n.totalPerformances?(0,Fe.tCount)("picker.group.performancesChosenOf",t,{chosen:n.performances,total:n.totalPerformances}):(0,Fe.tCount)("picker.group.seatsEveryPerformance",t)}return n.perPerformance!=null&&n.performancesChosen===n.performances?(0,Fe.tCount)("picker.group.seatsPerPerformance",n.seats,{per:n.perPerformance}):(0,Fe.tCount)("picker.group.performancesChosenOf",n.seats,{chosen:n.performancesChosen,total:n.performances})}function ko(n,e){n.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let i=()=>e(t.dataset.eventKey);t.addEventListener("click",i),t.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),i())})})}var So=require("@seatlayer/core");function xe(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function Ql(n,e){let t=n.objectType==="table"&&!!n.bookingMode,i=n.objectType==="booth",r=t||i||!n.seatNumber,s=r?n.rowLabel??n.displayLabel??n.label:n.seatNumber,o=t?`${y("picker.guests","Guests")} ${n.bookingMode==="variable"?`${n.minOccupancy}\u2013${n.maxOccupancy}`:n.capacity}`:!i&&n.rowLabel?`${e} ${te(n)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${r?" name":""}">${xe(s)}</span>`+(o?`<span class="sl-tip-row">${xe(o)}</span>`:"")+"</div>"+(n.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${y("picker.section","Section")}</span><span class="sl-tip-secname">${xe(n.sectionLabel)}</span></div>`:"")+"</div>"}function To(n,e){let t=n.status==="not_for_sale",i=n.mark?.kind==="partial",r=n.status==="free"||i?"":`<span class="sl-tip-tag">${t?y("picker.notAvailable","Not available"):n.status==="held"?(0,So.t)("map.statusHeld"):y("picker.sold","Sold")}</span>`,s=t?"":e.price,o=s?`<span class="sl-tip-amt">${xe(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${xe(e.priceNote)}</div>`:"",l=He(n.commercial),c=l?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u25D0</span>${xe(l)}</div>`:"",d=xt(n.wheelchairSpaceType),p=d?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u267F</span>${xe(d)}</div>`:"",u=e.reason?`<div class="sl-tip-reason">${xe(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Ql(n,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${xe(n.categoryColor)}"></span><span class="sl-tip-name">${xe(n.categoryLabel)}</span>`+r+o+"</div>"+a+u+p+c+(e.extra??"")}function Co(n,e,t,i){let r=n.x+14,s=n.y-i.height-12,o=n.y+18,a=s;r+i.width>e-8&&(r=n.x-i.width-14),s<8&&o+i.height<=t-8&&(a=o);let l=Math.max(8,t-i.height-8);return{left:Math.max(8,Math.min(r,Math.max(8,e-i.width-8))),top:Math.max(8,Math.min(a,l))}}function Eo(n,e,t,i=22){let r=Math.max(8,Math.min(n.x-t.width/2,Math.max(8,e.width-t.width-8))),s=n.y-i-t.height,o=n.y+i;return s>=8?{left:r,top:s,placement:"above"}:o+t.height<=e.height-8?{left:r,top:o,placement:"below"}:{left:r,top:Math.max(8,Math.min(s<8?o:s,Math.max(8,e.height-t.height-8))),placement:s<8?"below":"above"}}var zn=14,Xl=12,Zl=12,Jl=18;function Ao(n,e,t,i=Xl){let r=zn;if(!(n>=e.height-r-t.height-Jl))return{placement:"sheet",bottom:r};let o=e.height-n+i,a=e.height-Zl-t.height;return{placement:"above",bottom:Math.max(0,Math.min(o,a))}}function Po(n,e,t,i){let r=t.width/2+12,s=Math.max(r,Math.min(e.width-r,n.x)),o=n.y+t.height+24<=e.height,a=n.y<t.height+24&&o?"below":"above",l=i&&a==="above"?Math.max(t.height+24,n.y):n.y;return{left:s,top:Math.max(8,Math.min(e.height-8,l)),placement:a}}function Lo(n,e,t){let i=n.querySelector("[data-pg-select-partial]"),r=[...n.querySelectorAll("[data-pg-event-key]")],s=()=>r.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),o=()=>{if(!i)return;let a=s().length;i.disabled=a===0,i.textContent=e?.(a)??i.textContent};r.forEach(a=>{a.addEventListener("change",o);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,o())})}),i?.addEventListener("click",()=>{let a=s();a.length&&t?.(a)})}function Tt(n){let e=n?.displayType?.trim()||n?.rowType?.trim();return e||(n?.objectType==="table"?y("picker.table","Table"):n?.objectType==="booth"?y("picker.booth","Booth"):y("picker.row","Row"))}var Mo="@seatlayer/pending-checkout/v1";function ec(n){return typeof n=="string"&&n.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(n)}function Ho(n){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let i=null;try{let r=window.sessionStorage.getItem(Mo);if(r){let s=null;try{s=JSON.parse(r)}catch{}if(s&&ec(s.orderId)){let o=Date.now()-Number(s.storedAt);if(o>=0&&o<=144e5){if(s.eventKey&&s.eventKey!==n)return null;i=s.orderId}}}window.sessionStorage.removeItem(Mo)}catch{}e.delete("seatlayer_checkout");try{let r=e.toString();history.replaceState(history.state,"",`${location.pathname}${r?`?${r}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:i}}function Io(n){if(!n.framed)return null;let e=n.ancestorOrigins?.length?n.ancestorOrigins[0]:null;for(let t of[e,n.referrer])if(t)try{return new URL(t).origin}catch{}return null}var tc="https://api.seatlayer.io",ic=10,Ro=6e4,Oo=6e4,nc=360,rc=10,sc=40,oc=220,ac=160,Do="seatmap.a11y.cb";function lc(){try{if(typeof window>"u")return null;let n=window.localStorage.getItem(Do);return n==null?null:n==="1"}catch{return null}}function cc(n){try{window.localStorage.setItem(Do,n?"1":"0")}catch{}}var Ve=class n{constructor(e){this.realtime=null;this.accessEl=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.holdTimer=null;this.toastTimer=null;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.bookedEl=null;this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.confirmEl=null;this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedReport=null;this.confirmSeat=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.baReopen=!1;this.bestAvailableConfirm=!1;this.releasingHold=!1;this.salesClosed=!1;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.projectionEl=null;this.buyerView="map";this.view3dEl=null;this.view3dHandle=null;this.view3dGen=0;this.view3dReturnSeat=null;this.view3dTargetSeatId=null;this.view3dCompareSeatIds=[];this.view3dCompareChip=new Di({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(e,t)=>this.toast(e,t)});this.view3dCompareEl=null;this.view3dCompareCleanup=null;this.view3dSeatViewChrome=null;this.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.sectionCardCache=null;this.lastTrayCount=0;this.langSel=null;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yMenu=null;this.detachAttention=null;this.lapse=new Vi({toast:(e,t,i)=>this.toast(e,t,i),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.holdCopyPending=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalScrim=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.lastCatAvail=null;this.lastAvailFloorId="";this.availQuietUntil=0;this.liveTimer=null;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=oo(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??tc).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},i=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?mi({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:i?.access??ut(e,t),this.pubApi=e.transport?null:i?.api??new De(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=e.transport??this.pubApi,this.buyerAssetUrls=new gt(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 a custom `transport` owns its backend, so the picker is staying on onCheckout for this mount.'),this.checkoutMode=e.checkout==="hosted"&&this.pubApi?"hosted":"handoff";let r=e.numberOfPlacesToSelect;if(r!=null&&(!Number.isInteger(r)||r<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=r??null;let s=Gs(e.selectionValidators);if(this.exactTickets!=null&&s>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let o=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(ic,s)));if(this.exactTickets!=null&&o<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&o<s)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??o,this.cbSafe=lc()??!!e.colorblindSafe,this.controller=this.wireController(e)}get lastSection(){return this.sectionCard.summary}set lastSection(e){this.sectionCard.adopt(e)}chartHasStage(){let e=this.controller.doc;if(!e)return!1;let t=e.floors?.length?e.floors.map(i=>i.objects??[]):[e.objects??[]];for(let i of t)for(let r of i)if(r.type==="shape"&&(r.role==="stage"||r.stageKind))return!0;return!1}confirmThumbHtml(e){let t=this.controller.doc;if(!t)return"";let i=this.deliverableViewReference(e)?e.viewUrl??"":"",r=this.chartHasStage();if(!i&&!r)return"";let s=null;if(!i)try{s=(0,C.generateSeatThumb)(e,e.focalPoint??t.focalPoint).distanceM??null}catch{return""}let o=r&&s!=null?`<div class="sl-confirm-sight">${_((0,C.t)("picker.sightline",{m:s}))}</div>`:"",a=_((0,C.t)("picker.viewFromSeat",{label:e.label})),l=_(this.tf("picker.viewFromHere","View from here"));return(i?`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`:`<button type="button" class="sl-confirm-view sl-confirm-viewbtn" aria-label="${a}"><span aria-hidden="true">\u{1F52D}</span><span>${l}</span></button>`)+o}deliverableViewReference(e){let t=e.viewMeta?.previewUrl??e.viewUrl;return t&&(cn(t)||ft(t))?t:null}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=Io({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let i=t<640?1.2:.62;return Math.max(420,Math.round(t*i))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let i=this.els.zfs?.querySelector(".sl-zfs-lbl");i&&(i.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e))}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){bt();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let r=document.createElement("div");r.className="sl-modal-frame",r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"),r.setAttribute("aria-label",y("picker.seatSelection","Seat selection")),r.tabIndex=-1,i.appendChild(r),document.body.appendChild(i);let s=document.body.style.overflow;document.body.style.overflow="hidden";let o=new n({...e,container:r});o.modalScrim=i,o.prevFocus=t;let a=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),l=()=>{let g=[...r.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(m=>m.isConnected&&!m.closest('[hidden], [aria-hidden="true"], [inert]'));return g[g.length-1]??r},c=(g,m)=>{let v=g;for(;v;){let k=window.getComputedStyle(v);if(v.hidden||v.getAttribute("aria-hidden")==="true"||v.hasAttribute("inert")||k.display==="none"||k.visibility==="hidden"||k.visibility==="collapse")return!0;if(v===m)return!1;v=v.parentElement}return!0},d=g=>[...g.querySelectorAll(a)].filter(m=>m.tabIndex>=0&&!m.matches(":disabled")&&!c(m,g)),p=(g,m)=>{let v=d(g),k=m?v[v.length-1]:v[0];k?k.focus({preventScroll:!0}):(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus({preventScroll:!0}))},u=!1,h=()=>{if(u)return;u=!0,document.body.style.overflow=s,o.escHandler&&document.removeEventListener("keydown",o.escHandler),i.remove(),o.modalScrim=null;let g=o.prevFocus;o.prevFocus=null,g?.isConnected&&g.focus({preventScroll:!0});let m=()=>{o.destroy(),e.onClose?.()};o.hold&&!o.handedOff?o.release().finally(m):m()};return o.closeModal=h,i.addEventListener("mousedown",g=>{g.target===i&&h()}),o.escHandler=g=>{if(g.key==="Tab"){if(g.defaultPrevented)return;let m=l(),v=d(m),k=v[0],S=v[v.length-1],L=document.activeElement;!k||!S?(g.preventDefault(),p(m,g.shiftKey)):L===m||!L||!m.contains(L)?(g.preventDefault(),(g.shiftKey?S:k).focus({preventScroll:!0})):g.shiftKey&&L===k?(g.preventDefault(),S.focus({preventScroll:!0})):!g.shiftKey&&L===S&&(g.preventDefault(),k.focus({preventScroll:!0}));return}g.key==="Escape"&&(o.tableDialog?(g.preventDefault(),o.cancelTableDialog()):o.confirmSeat?(g.preventDefault(),o.cancelConfirm()):o.bestAvailableConfirm?(g.preventDefault(),o.bestAvailableConfirm=!1,o.syncTray()):(g.preventDefault(),h()))},document.addEventListener("keydown",o.escHandler),await o.render(),o.els.close?.classList.add("on"),o.els.close?.addEventListener("click",h),p(l(),!1),o}wireController(e){return new C.PickerController({transport:this.api,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:at(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let i=this.controller.getGAAreas().find(r=>r.id===t);i&&(this.collapseSheet(),an(this,i,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:()=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onHoldExpired:()=>{this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.lapse.deferExpiryToast(()=>this.toast((0,C.t)("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning")),this.syncTray(),this.emitHoldChange(),this.opts.onHoldExpired?.()},onAvailabilityRefresh:t=>this.lapse.handle(t),confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){this.removeHeldLabels([t.label]);return}this.confirmSeat?.id===t.id&&this.dismissConfirm(),this.tableDialog?.physicalSeatIds.includes(t.id)&&this.dismissTableDialog()},onSelectionLimit:()=>{this.toast((0,C.t)("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>this.opts.onError?.(t)})}async render(){if(this.rendered)return this;let e=performance.now(),t={},i=T=>Math.round((performance.now()-T)*100)/100;this.rendered=!0,bt();let r=performance.now(),s=pi(this.opts.locale,this.opts.messages),o=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=Nr(this.opts.container),{root:c,els:d,mapHost:p}=rr(l,(T,O)=>this.tf(T,O),this.opts.theme);this.root=c,this.els=d,this.mapHost=p,hi(c,s,T=>{t.loadLocale=i(r),this.destroyed||this.applyActiveLocale(T,o)}),Hs(c,()=>[{open:()=>this.tipPinned,close:()=>this.unpinTooltip()},{open:()=>!!this.tableDialog,close:()=>this.cancelTableDialog()},{open:()=>!!this.confirmSeat,close:()=>this.cancelConfirm()},{open:()=>this.bestAvailableConfirm,close:()=>{this.bestAvailableConfirm=!1,this.syncTray()}}]),this.syncFullscreenButtons(),this.wireBuyerShell(c);let u=document.createElement("div");u.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(u),t.mountBuyerShell=i(a),t.skeletonPaint=i(e);let h=await this.loadChart(u,t,i);if(!h)return this;t.shellsPaint=i(e);let g=performance.now();if(this.startRealtime(),this.salesClosed=!!h.salesClosed||!!this.opts.readOnly,c.dataset.eventMode=h.mode==="test"?"test":"live",!this.opts.locale&&h.locale&&this.setLocale(h.locale),this.controller.setViewMode(this.normalizeInitialView(this.opts.initialView)),this.buildRegions(),this.regions["bottom-right"].appendChild(this.els.zoom),this.regions["bottom-center"].appendChild(this.els.toast),h.mode==="test"){let T=document.createElement("div");T.className="sl-testbadge",T.textContent=Br((0,C.t)("picker.testMode"),(0,C.getLocale)()),T.setAttribute("aria-label",(0,C.t)("picker.testMode")),T.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"),this.regions["top-left"].appendChild(T)}let m=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(c),this.watchThemeMode(),this.currency=h.currency??this.opts.currency??"USD",this.eventTimezone=h.timezone??null,$r(this.els.logo,[this.opts.theme?.logoUrl,m?.logoUrl,h.posterUrl],this.opts.theme?.brandName??m?.brandName??h.eventName??"?"),this.els.name.textContent=h.eventName??"";let v=h.startsAt?wi(h.startsAt,h.timezone??null,this.opts.locale):"";this.eventWhenText=v||null,this.els.meta.textContent=[h.venue,v].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(m);let k=!!this.controller.doc&&this.controller.getExpandedSeats().some(T=>T.commercial?.restrictedView||T.commercial?.obstructedView);this.buildAccessibilityMenu(k),this.buildLanguageSwitcher(this.els.zoom??this.regions["bottom-right"]),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),c.appendChild(this.srEl),this.buildArenaChrome(),this.buildMinimap(),this.buildPriceFilter(),this.buildExtendPrompt(),this.buildBookedOverlay(),this.buildSoldoutOverlay(),this.buildPanelToggle(),this.opts.panelCollapsed&&this.setPanelCollapsed(!0),this.dockLayoutChrome(),t.buildBuyerControls=i(g);let S=performance.now();if(await this.restoreRememberedHold(),t.restoreHold=i(S),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let L=this.controller.doc,b=Pi(this.opts.event),E=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),x=E??"event",I={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:x,surface:E==="season"?"season_picker":E==="performance_group"?"performance_group_picker":"seat_picker",ms:i(e),performanceProfile:t,chartDelivery:h.chartDelivery,seatCount:this.allSeats().length,objectCount:L?.objects.length??0,sectionCount:L?.objects.filter(T=>T.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:L?.name,view:this.buyerView,load:b,transport:this.opts.transport?"custom":"pubapi"};Ns(I,(T,O)=>this.emitAnalytics(T,O));let R=h.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",Mn({...I,performanceProfile:{...I.performanceProfile,...R}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=h,await this.registerAgentTools(),this}registerAgentTools(){return Ds(this)}webMcpHost(e){return An(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=ro(()=>{this.destroyed||this.controller.refreshAvailability()}),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit.addEventListener("click",()=>this.controller.zoomToFit()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let r=this.els.sheetToggle,s=c=>{e.dataset.sheet=c?"open":"peek",r?.setAttribute("aria-expanded",String(c)),r?.setAttribute("aria-label",c?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))};s(e.dataset.sheet==="open"),r?.addEventListener("click",c=>{c.stopPropagation(),s(e.dataset.sheet!=="open")}),this.els.peek?.addEventListener("click",c=>{let d=c.target.closest(".sl-sheet-go");d&&(c.stopPropagation(),d.dataset.act==="checkout"?this.handleCta():d.dataset.act==="best"||d.dataset.act==="find"?(d.dataset.act==="best"&&(this.baReopen=!0,this.baQty=Math.max(1,Math.min(this.baQty,this.maxTickets-this.totalTicketCount())),this.syncTray()),s(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()):s(!0))});let o=0,a=!1,l=!1;t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard,.sl-sheet-toggle,.sl-sheet-go")){l=!1;return}l=!0,a=!1,o=c.clientY,t.setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!l||a)return;let d=c.clientY-o;d<-18?(s(!0),a=!0):d>18&&(s(!1),a=!0)}),t.addEventListener("pointerup",c=>{l&&!a&&Math.abs(c.clientY-o)<6&&s(e.dataset.sheet!=="open"),l=!1,t.releasePointerCapture?.(c.pointerId)})}let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let r=this.root.getAttribute("data-prices-open")==="true";if(this.root.setAttribute("data-prices-open",String(!r)),this.els.pricesSec?.setAttribute("aria-expanded",String(!r)),!r&&this.root.dataset.sheet!=="open"){this.root.dataset.sheet="open";let s=this.els.sheetToggle;s?.setAttribute("aria-expanded","true"),s?.setAttribute("aria-label","Collapse ticket panel")}};this.els.pricesSec?.addEventListener("click",r=>{r.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||r.target.closest("select,button")||(r.preventDefault(),i())}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("pointerdown",r=>{this.handleMapPointerDown(r)},!0),this.els.map.addEventListener("mousemove",r=>{if(this.tipPinned)return;let s=this.els.map.getBoundingClientRect();this.tipPos={x:r.clientX-s.left,y:r.clientY-s.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.handleCta()}),this.els.holdChange?.addEventListener("click",()=>{this.handleChangeSeats()})}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||(e.dataset.sheet="peek",this.els.sheetToggle?.setAttribute("aria-expanded","false"),this.els.sheetToggle?.setAttribute("aria-label",this.tf("picker.openTicketPanel","Open ticket panel")))}observeLayout(e){let t=()=>{let i=e.clientWidth;if(i<=0)return;let r=e.clientHeight,s=i!==this.pickerLayoutSize.width||r!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:r},this.reportFramedHeight();let o=i<640?"narrow":"wide",a=r<560?"compact":"comfortable";(e.dataset.layout!==o||e.dataset.density!==a)&&(e.dataset.layout=o,e.dataset.density=a,o==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray()),s&&(this.minimap?.refreshMinimap(),this.fitSectionStripCount())};this.ro=new ResizeObserver(t),this.ro.observe(e),t(),requestAnimationFrame(t)}async loadChart(e,t,i){let r=performance.now(),s=await this.controller.render(e);return t.loadChartAndStatuses=i(r),this.destroyed?null:s?(Object.assign(t,s.performanceProfile),s):(Me({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:ze(this.opts.event),transport:this.opts.transport?"custom":"pubapi"}),this.els.boot.innerHTML=`<div class="sl-boot-title">${this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load")}</div><div>${this.tf("picker.checkConnection","Check your connection and try again.")}</div><button type="button" class="sl-boot-retry">${this.tf("picker.accessRetry","Try again")}</button>`,this.els.boot.querySelector("button").addEventListener("click",()=>{let o=this.opts.container,a=this.opts;this.destroy(),new n({...a,container:o}).render()}),null)}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=Ho(this.opts.event);e?.outcome!=="success"||!e.orderId||this.openCheckoutPanel({kind:"resume",orderId:e.orderId})}buildPanelToggle(){if(!this.regions["top-right"])return;let e=document.createElement("button");e.type="button",e.className="sl-side-toggle",e.addEventListener("click",()=>this.setPanelCollapsed(!this.sideCollapsed)),this.sideToggleEl=e,this.regions["top-right"].appendChild(e),this.syncPanelToggle()}syncPanelToggle(){let e=this.sideToggleEl;if(!e)return;let t=this.sideCollapsed;e.setAttribute("aria-expanded",String(!t)),e.setAttribute("aria-label",t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=t?`<svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span>${this.tf("picker.tickets","Tickets")}</span>`:'<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>'}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){let e=this.root?.dataset.layout!=="narrow";this.root?.setAttribute("data-side-collapsed",String(this.sideCollapsed)),this.els.side?.toggleAttribute("inert",this.sideCollapsed&&e),this.syncPanelToggle()}buildAccessibilityMenu(e){let t=this.regions["bottom-left"]??this.els.map;t&&(this.a11yMenu=new Fi(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(i,r)=>this.tf(i,r),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:i=>this.setColorblindSafe(i),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:i=>{this.limitedViewFilter=i,this.controller.setCommercialLimitedFilter(i),this.pushAvailabilityTo3d()},applyAccessibilityFilter:i=>{this.controller.setAccessibilityFilter(i),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},focusSeatsForFilter:()=>this.focusSeatsForFilter()}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){this.controller.focusAccessibilityFilter?.()||this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}setAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),this.pushAvailabilityTo3d()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,i=this.els.headInfo?.parentElement;t&&i&&t.parentElement!==i&&(t.classList.add("sl-fs-pill"),i.insertBefore(t,this.els.hold??null));let r=this.els.pricesSec;r&&(e?(r.setAttribute("role","button"),r.tabIndex=0,r.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(r.removeAttribute("role"),r.removeAttribute("aria-expanded"),r.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){let e=document.createElement("div");e.className="sl-extend",e.setAttribute("role","status"),e.innerHTML='<span class="sl-extend-txt" data-ref="extendTxt"></span><button type="button" class="sl-extend-btn" data-ref="extendBtn"></button>',(this.regions["bottom-center"]??this.els.map).appendChild(e),this.extendEl=e,this.els.extendTxt=e.querySelector('[data-ref="extendTxt"]'),this.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),this.els.extendBtn.textContent=this.tf("picker.addTime","Add time"),this.els.extendBtn.addEventListener("click",()=>{this.handleExtend()})}buildBookedOverlay(){let e=document.createElement("div");e.className="sl-booked",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<div class="sl-booked-badge"><svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5"/></svg></div><div class="sl-booked-title">${this.tf("picker.allSetTitle","You're all set")}</div><div class="sl-booked-sub" data-ref="bookedSub"></div><ul class="sl-booked-list" data-ref="bookedList"></ul><button type="button" class="sl-booked-back" data-ref="bookedBack"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${_(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}tf(e,t){return y(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),i=document.createElement("div");i.className="sl-soldout-eyebrow",i.textContent=t;let r=document.createElement("div");r.className="sl-soldout-title",r.textContent=this.tf("picker.soldOutTitle","Sold out");let s=document.createElement("p");s.className="sl-soldout-copy",s.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(i,r,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,r=this.isSoldOut(e,t,i);r!==this.soldOut&&(this.soldOut=r,this.soldoutEl?.classList.toggle("on",r))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(r=>(t[r.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.tf("picker.salesClosedPill","Sales are closed")}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.tf("picker.salesClosedToast","Sales are closed for this event.")),this.syncCta(),this.syncTray()}badgeHidden(e){return!!(this.opts.hideBadge||e?.hideBadge)}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let i=document.createElement("a");i.className="sl-powered",i.href="https://seatlayer.io/?ref=picker",i.target="_blank",i.rel="noopener noreferrer",i.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let r=document.createElement("span");r.className="sl-powered-mark",r.setAttribute("aria-hidden","true"),r.innerHTML=vi;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),i.append(r,s),t.appendChild(i)}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let i=document.createElement("div");i.className="sl-anchor",i.dataset.region=t,this.els.map.appendChild(i),this.regions[t]=i}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let i=setTimeout(()=>{this.motionTimers.delete(i),this.destroyed||e()},t);this.motionTimers.add(i)}animateOnce(e,t,i=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),i))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){if(this.reducedMotion())return;let t=(e.items??[]).filter(i=>i.objectType!=="ga").slice(0,10).map(i=>this.controller.seatByLabel(i.label)).filter(i=>!!i);Bs({regions:this.els,categories:this.controller.doc?.categories,pop:i=>this.controller.flashSeat(i,this.cssVar("--sl-accent")||"#f4b740"),focus:(i,r)=>this.controller.focusSection(i,r),screenPoint:i=>this.controller.worldToScreen(i),schedule:(i,r)=>this.scheduleMotion(i,r)},t)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(i=>i.id!==e&&i.id!==t)}pendingSelectionCount(){let e=this.hold?.items??[],t=new Set(e.map(r=>r.label));return this.committedSelection().filter(r=>!t.has(r.label)).reduce((r,s)=>r+(s.quantity??1),0)+Ye(this.gaQty,this.hold?.items??[])}heldTicketCount(){return(this.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}totalTicketCount(){let e=new Set((this.hold?.items??[]).map(i=>i.label)),t=this.committedSelection().filter(i=>!e.has(i.label)).reduce((i,r)=>i+(r.quantity??1),0);return this.heldTicketCount()+t+Ye(this.gaQty,this.hold?.items??[])}updateSelectionCapacity(){let e=new Set((this.hold?.items??[]).map(r=>r.label)),t=this.committedSelection().filter(r=>e.has(r.label)).reduce((r,s)=>r+(s.quantity??1),0),i=Math.max(0,this.maxTickets-this.heldTicketCount()-Ye(this.gaQty,this.hold?.items??[]));this.controller.setMaxSelection(t+i)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){let i=this.els.cta;if(!i)return;if(this.salesClosed){i.disabled=!0,i.textContent=this.tf("picker.salesClosedCta","Sales closed");return}if(this.confirmSeat||this.tableDialog&&!this.tableDialogHeld){i.disabled=!0,i.textContent=this.tableDialog?this.tf("picker.confirmYourTable","Confirm your table"):this.tf("picker.confirmOrCancelSeat","Confirm or cancel this seat");return}if(this.ctaPhase==="holding"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(this.ctaPhase==="checkout"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let r=!this.hold&&this.performanceGroup?.selectionMode==="per_performance"?this.performanceGroup.submissionState?.():null;if(r&&!r.ready){i.disabled=!0,i.textContent=this.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(r.complete)).replace("{total}",String(r.total));return}let s=this.controller.getSelectionValidity(e);if(s&&!s.isValid){i.disabled=!0,i.textContent=Rn(s,(o,a)=>this.tf(o,a),!0);return}i.disabled=e===0,i.textContent=this.hold?t?(0,C.t)("picker.secureMoreAndCheckout",{count:t}):this.tf("picker.continueToCheckout","Continue to checkout"):e?this.performanceGroup?this.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(this.performanceGroup.performanceCount)):this.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):this.tf("picker.selectSeats","Select seats")}setCtaPhase(e){this.ctaPhase=e,this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount())}async runCheckoutHandoff(e,t){this.setCtaPhase("checkout");try{await this.checkoutHandoff(e,t)}finally{this.ctaPhase==="checkout"&&!this.bookedShown&&this.setCtaPhase("idle")}}holdStorageKey(){return`@seatlayer/hold/v1/${encodeURIComponent(this.apiBase)}/${encodeURIComponent(this.opts.event)}`}rememberedHoldId(){if(this.opts.initialHoldId)return this.opts.initialHoldId;if(this.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(this.holdStorageKey())}catch{return null}}rememberHold(e){if(!(this.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(this.holdStorageKey(),e.holdId)}catch{}}forgetHold(){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(this.holdStorageKey())}catch{}}async resumeHoldFromServer(e,t){try{let i=await this.controller.resumeHold(e);if(!i||this.destroyed)return null;let r={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return this.hold=r,this.handedOff=!0,this.bookedShown=!1,this.ctaPhase="idle",this.startHoldTimer(r.expiresAt),this.rememberHold(r),this.syncTray(),this.emitHoldChange(),this.opts.onHoldRestored?.(r,r.seats??[],this.buildHandoff(r)),t&&this.toast(this.tf("picker.heldTicketsRestored","Your held tickets have been restored."),"success"),r}catch(i){let r=i?.status;return r===404||r===409?this.forgetHold():this.opts.onError?.(i),null}}async restoreRememberedHold(){let e=this.rememberedHoldId();e&&await this.resumeHoldFromServer(e,!0)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let i=this.controller.getActiveFloorId();return(t.find(r=>r.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=Ts({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return Ni(this,e)}catPriceRange(e){return $i(this,e)}buildPriceFilter(){if(this.suppressPricing||!this.els.prices||!this.els.pricesSec)return;let e=es(this.controller.doc?.categories??[],this.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",this.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let i=document.createElement("option");i.value="all",i.textContent=this.tf("picker.allPrices","All prices"),t.appendChild(i);for(let r of e){let s=document.createElement("option");s.value=r.id,s.textContent=r.label,t.appendChild(s)}this.els.pricesSec.appendChild(t),this.priceSelect=t,t.addEventListener("change",()=>{this.applyPriceBand(e.find(r=>r.id===t.value)?.keys??null)})}applyPriceBand(e){if(this.focusedCatKey=null,this.priceBandKeys=e?new Set(e):null,this.priceSelect){let t=e?this.priceSelect.value:"all";this.priceSelect.value!==t&&(this.priceSelect.value=t)}this.controller.setCategoryFilter(e),this.controller.focusCategoryFilter(e),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)}buildArenaChrome(){let e=this.controller.doc;if(!e||!this.els.map)return;let t=e.objects.some(i=>i.type==="section")||(e.floors??[]).some(i=>i.objects.some(r=>r.type==="section"));if(this.canOffer3d()){let i=document.createElement("div");i.className="sl-projection",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),i.innerHTML=`<button type="button" data-view="map" aria-pressed="true" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,i.querySelectorAll("button").forEach(r=>{if(r.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])r.addEventListener(s,hn,{once:!0});r.addEventListener("click",()=>{this.setBuyerView(r.dataset.view)})}),this.regions["top-right"].appendChild(i),this.projectionEl=i,this.syncProjection()}if(t){let i=[...e.objects,...(e.floors??[]).flatMap(d=>d.objects)],r=new Set((e.zones??[]).map(d=>d.id)),o=i.some(d=>d.type==="section"&&typeof d.zone=="string"&&r.has(d.zone))?["zones","sections","seats"]:["sections","seats"],a=document.createElement("div");a.className="sl-rungs on sl-mo-indicator",a.setAttribute("role","group"),a.setAttribute("aria-label",(0,C.t)("picker.zoomLevel"));let l={zones:(0,C.t)("picker.rungLabel.zones"),sections:(0,C.t)("picker.rungLabel.sections"),seats:(0,C.t)("picker.rungLabel.seats")},c={zones:(0,C.t)("picker.rungTip.zones"),sections:(0,C.t)("picker.rungTip.sections"),seats:(0,C.t)("picker.rungTip.seats")};a.innerHTML=o.map(d=>`<button type="button" data-rung="${d}" title="${c[d]}" aria-pressed="false">${l[d]}</button>`).join(""),a.querySelectorAll("button").forEach(d=>{d.addEventListener("click",()=>{let p=d.dataset.rung;this.controller.setRung(p),p==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(a),this.rungsEl=a,this.syncRung()}if(this.controller.isMultiFloor()){let i=ws({floors:this.controller.getFloors(),tf:(r,s)=>this.tf(r,s),onChoose:r=>{r===""?this.controller.setFloorOverview(!0):this.controller.setFloor(r),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});this.regions["left-rail"].appendChild(i),this.floorsEl=i,this.syncFloors()}}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(i=>{let r=i.dataset.rung===e;i.classList.toggle("on",r),i.setAttribute("aria-pressed",String(r))})}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?this.tf("picker.priceHint3d","Colours in the venue are ticket types \u2014 choose one below to show just those seats."):this.tf("picker.priceHint","Colours on the map are ticket types \u2014 tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!yi()?!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)?Oo/2:Oo}syncFloors(){ks(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new Oi({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}fitSectionStripCount(){this.sectionCard.fitStripCount()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(r=>r.type==="section"&&!this.controller.isSectionClosed(r.id)&&this.controller.getSectionSeatCount(r.id)>0);if(t.length<2)return null;let i=t.findIndex(r=>r.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}markedSeatAnnouncement(e){let t=Nn(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return bo(t,e.displayLabel??e.label,this.opts.locale)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.markedSeatAnnouncement(e);if(t){this.srEl.textContent=t;return}let i=this.controller.doc?.categories.find(h=>h.key===e.categoryKey),r=this.controller.getStatus(e.id)??"free",s=r==="free"?this.tf("picker.statusAvailable","available"):r==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),o=i?this.catPriceRange(i):void 0,a=!this.suppressPricing&&o?o.min===o.max?this.money(o.min):`${this.money(o.min)}\u2013${this.money(o.max)}`:void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=Tt(c),p=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,u=l?`${d} ${p}, ${l.bookingMode==="variable"?(0,C.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,C.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${p}`:c?.objectType==="table"?`${d} ${p}, ${(0,C.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,C.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${u}, ${i?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let r=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),s=e.bookingMode==="variable",o=document.createElement("div");o.className="sl-table-scrim",o.innerHTML=vs(e,{variable:s,held:t,typeWord:Tt(e),categoryLabel:r?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(o),this.tableDialogEl=o,this.renderTableDialogState(),o.querySelectorAll("[data-table-step]").forEach(a=>{a.addEventListener("click",()=>{if(!this.tableDialog)return;let l=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(a.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:l},this.renderTableDialogState()})}),o.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),o.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),o.addEventListener("mousedown",a=>{a.target===o&&this.cancelTableDialog()}),o.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...o.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],d=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),d.focus()):!a.shiftKey&&document.activeElement===d&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>o.querySelector(s?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let i=t.querySelector("output[data-table-qty]");i&&(i.value=String(e.quantity));let r=t.querySelector("input[data-table-qty]");r&&(r.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let s=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),o=t.querySelector("[data-table-total]");o&&(o.textContent=this.money(s*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let i=this.tableDialogEl?.querySelector(".sl-table-confirm");if(i&&(i.disabled=!0,i.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let r=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!r){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},this.startHoldTimer(r.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,C.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(r){this.opts.onError?.(r),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){i&&(i.disabled=!1,i.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}showConfirm(e){let t=this.confirmSeat?.id;this.confirmEl?.remove(),this.confirmEl=null,this.confirmSeat=e,this.root?.setAttribute("data-confirming","true"),this.els.side?.toggleAttribute("inert",!0),Object.values(this.regions).forEach(x=>x.toggleAttribute("inert",!0)),this.controller.setSelectionFocus(e.id),t&&t!==e.id&&this.controller.deselect([t]),this.tipEl&&(this.tipEl.style.display="none");let i=this.controller.seatDetails(e.id),r=this.controller.doc?.categories.find(x=>x.key===e.categoryKey),s=i?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),o=s!=null?this.paidPrice(e.categoryKey,i?.tierId??r?.tiers?.[0]?.id??null,s,e.label):void 0,a=ps(i,e.displayLabel??e.label,Tt(i)),l=i?.tiers??r?.tiers??[],c=i?.tierId??l[0]?.id,d=this.suppressPricing?"":ms(l,c,x=>this.money(this.paidPrice(e.categoryKey,x.id,x.price,e.label))),p=this.buyerView==="venue3d",u=this.performanceGroup?.confirmDateSelection??void 0,h=u?this.performanceGroup?.nights?.()??[]:[],g=u?uo(h,u,e.id,(x,I)=>this.tf(x,I)):"",m=document.createElement("div");m.className="sl-confirm sl-mo-in",g&&m.classList.add("sl-confirm-group-dates"),m.setAttribute("role","dialog"),m.setAttribute("aria-label",(0,C.t)("picker.confirmSeatLabel",{label:e.label}));let v=r?.color??"#6e7bff";m.style.setProperty("--sl-cat",v);let k=String(i?.categoryLabel??r?.label??e.categoryKey),S=this.controller.categoryAvailability()[e.categoryKey],L=typeof S=="number"&&S>0?(0,C.tCount)("picker.leftCount",S):"";m.innerHTML=bs({identityFields:a,identity:hs(i,e.displayLabel??e.label,Tt(i)),marker:Ri(i?.wheelchairSpaceType),see3dPill:us(this.canOffer3d(),p),categoryColor:r?.color??"#6e7bff",categoryLabel:k,priceLabel:!this.suppressPricing&&o!=null?this.money(o):"",categoryLeftLabel:L,tierChoices:d,groupDates:g,wheelchair:as(i?.wheelchairSpaceType),commercial:os(e.commercial),thumb:this.seatViewEnabled()&&this.buyerView!=="venue3d"?this.confirmThumbHtml(e):"",inspect:p?`${ds(e,this.suppressPricing?`${i?.displayLabel??e.displayLabel??e.label}`:`${i?.displayLabel??e.displayLabel??e.label} \xB7 ${o==null?this.tf("picker.priceNotSupplied","Price not supplied"):this.money(o)}`,p)}<div class="sl-confirm-inspect-row">${cs(e,p?this.view3dCompareSeatIds:null)}${kn(this.canOffer3d(),p)}</div>`:kn(this.canOffer3d(),p),cancelLabel:(0,C.t)("common.cancel"),selectLabel:this.addSeatLabel(i?.objectType)}),this.els.map.appendChild(m),this.confirmEl=m;let b=m.querySelector(".sl-confirm-thumb"),E=b?.closest(".sl-confirm-thumbwrap")??null;if(b&&E){let x=!1,I=()=>{if(x||!E.isConnected)return;x=!0;let T=()=>{E.remove(),this.confirmEl===m&&this.reanchorConfirm()};if(this.reducedMotion()||typeof requestAnimationFrame!="function"){T();return}E.style.height=`${E.offsetHeight}px`,E.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{E.style.height="0px",E.style.opacity="0"}),setTimeout(T,ac)};b.addEventListener("error",I),b.addEventListener("load",()=>{b.naturalWidth||I()});let R=e.viewMeta?.previewUrl??e.viewUrl;R?this.buyerAssetUrls.resolve(R).then(T=>{if(!(!m.isConnected||this.confirmEl!==m)){if(!T){I();return}b.src=T}}).catch(T=>{I(),this.opts.onError?.(T)}):I()}this.reanchorConfirm(),m.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{this.openSeatView(e)}),m.querySelector(".sl-confirm-confidence")?.addEventListener("click",x=>{this.openSeatConfidencePassport(e,x.currentTarget instanceof HTMLElement?x.currentTarget:null)}),m.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>this.saveView3dComparisonSeat(e)),m.querySelectorAll("[data-confirm-tier]").forEach(x=>{x.addEventListener("click",()=>{let I=x.dataset.confirmTier,R=l.find(O=>O.id===I);if(!R)return;this.controller.setSeatTier(e.id,R.id),m.querySelectorAll("[data-confirm-tier]").forEach(O=>{O.setAttribute("aria-pressed",String(O===x))});let T=m.querySelector(".sl-confirm-price");T&&(T.textContent=this.money(this.paidPrice(e.categoryKey,R.id,R.price,e.label))),this.reanchorConfirm()})}),m.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill").forEach(x=>{x.addEventListener("pointerdown",hn,{once:!0}),x.addEventListener("click",()=>{this.buyerView==="venue3d"?(this.dismissConfirm(),this.view3dHandle?.flyToSeat(e.id)):(this.view3dReturnSeat=e,this.dismissConfirm(),this.enter3d(e.id))})}),fo(m,u,(x,I)=>this.tf(x,I),()=>this.reanchorConfirm()),m.querySelector(".sl-confirm-add").addEventListener("click",()=>{this.commitConfirm()}),m.querySelector(".sl-confirm-cancel").addEventListener("click",()=>this.cancelConfirm()),requestAnimationFrame(()=>{let x=m.querySelector(".sl-confirm-add");x?.focus(),this.liftToastOverConfirm(),this.inviteCommit(m,x)})}inviteCommit(e,t){if(!t||this.reducedMotion())return;t.classList.add("sl-confirm-add-invite");let i=()=>t.classList.remove("sl-confirm-add-invite");e.addEventListener("pointerdown",i,{once:!0}),e.addEventListener("keydown",i,{once:!0}),t.addEventListener("focus",i,{once:!0})}addSeatLabel(e){return e&&e!=="seat"?this.tf("picker.select","Select"):this.tf("picker.addSeat","Add seat")}reanchorConfirm(){if(!this.confirmEl||!this.confirmSeat||this.root?.dataset.view3d==="on")return;let e=this.controller.worldToScreen({x:this.confirmSeat.x,y:this.confirmSeat.y});if(this.root?.dataset.layout==="narrow"){let l=Ao(e.y,{height:this.els.map.clientHeight},{height:this.confirmEl.offsetHeight||230});l.placement==="above"?(this.confirmEl.dataset.placement="above",this.confirmEl.style.bottom=`${l.bottom}px`):(this.confirmEl.removeAttribute("data-placement"),this.confirmEl.style.removeProperty("bottom")),dr(this.confirmEl,e,this.els.map),this.liftToastOverConfirm();return}let t=this.els.map.clientWidth,i=this.els.map.clientHeight,r=this.confirmEl.offsetWidth||276,s=this.confirmEl.offsetHeight||230,o=this.confirmEl.classList.contains("sl-confirm-group-dates"),a=Po(e,{width:t,height:i},{width:r,height:s},o);this.confirmEl.dataset.placement=a.placement,this.confirmEl.style.left=`${a.left}px`,this.confirmEl.style.top=`${a.top}px`,fi(this.confirmEl,e,{left:a.left,top:a.top,width:r,height:s})}dismissConfirm(){this.confirmEl&&Ne(this.confirmEl),this.confirmEl=null,this.confirmSeat=null,this.liftToastOverConfirm(),this.root?.removeAttribute("data-confirming"),Object.values(this.regions).forEach(e=>e.toggleAttribute("inert",!1)),this.applyPanelCollapsed(),this.controller.setSelectionFocus(null)}async commitConfirm(){let e=this.confirmSeat;if(!e)return;let i=this.confirmEl?.querySelector(".sl-confirm-add")??null;if(i?.classList.contains("is-adding")||!await go(this.confirmEl,e.id,this.performanceGroup?.confirmDateSelection??void 0))return;this.collapseSectionCard(),this.confirmSeat=null,this.syncTray(),this.syncSelectionTo3d();let r=()=>{this.dismissConfirm(),Ln(this.els,this.controller.worldToScreen(e),e,this.controller.doc?.categories)};if(!i||this.reducedMotion()){r();return}i.classList.remove("sl-confirm-add-invite"),i.classList.add("is-adding"),i.setAttribute("aria-disabled","true");let s=i.querySelector(".sl-confirm-add-t");s&&(s.textContent=this.tf("picker.added","Added")),this.scheduleMotion(r,nc)}cancelConfirm(){let e=this.confirmSeat;e&&(this.controller.deselect([e.id]),this.confirmSeat&&this.dismissConfirm(),this.syncSelectionTo3d(),this.root?.focus({preventScroll:!0}))}closeConfirm(){this.dismissConfirm()}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,i=this.controller.doc,r=this.controller.getActiveFloorId(),s=e.focalPoint??i?.floors?.find(p=>p.id===r)?.focalPoint??i?.focalPoint??{x:0,y:0},o,a,l=!1;if(e.viewUrl){let p,u=null;try{let g=e.viewMeta?.previewUrl;g&&g!==e.viewUrl?(u=await this.buyerAssetUrls.resolve(g),p=e.viewUrl):p=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(g){t===this.seatViewGen&&this.opts.onError?.(g);return}if(t!==this.seatViewGen||!p||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!u||!this.root||!this.seatViewEnabled())return;let h={url:p,...u?{previewUrl:u}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};o=h,a=(0,Jt.seatViewDisclosure)(h),l=(0,Jt.isAuthoredSeatView)(h)}else{let p;try{let{generateSeatPanorama:u}=await xi();p=u(e,s,this.allSeats())}catch(u){t===this.seatViewGen&&this.opts.onError?.(u);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;o={url:p.url,generated:!0},a=(0,C.t)("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=(0,C.t)("picker.viewFromSeat",{label:e.label}),d=Ti({root:this.root,source:o,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:yt(),viewFromSeatLabel:c,real360Label:(0,C.t)("picker.real360"),previewLabel:(0,C.t)("picker.preview"),resolveAsset:p=>this.buyerAssetUrls.resolve(p),onClose:()=>this.closeSeatView()});this.viewEl=d.element,this.viewCleanup=()=>d.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let i=Number.isInteger(e);return(0,C.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(r,s)=>`${r} ${s}`,...i?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),i=ns(e,t);if(i==null)return;let r=6*36e5,s=Math.min(Math.max(i-t+1e3,1e3),r);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},s)}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}async refreshOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;let i=Hi(t);if(!i)return;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i);let r=Ii(i),s={...this.hostPricing?.prices??{},...r},o=Object.keys(s).length>0||this.hostPricing?.formatter?{prices:s,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(o),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(i)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e){return e?this.offerAvailability?.prices.find(t=>t.categoryKey===e)??null:null}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,i=t?.release??null,r=i?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!r){e.classList.remove("has"),e.replaceChildren();return}let s=i??r,o=document.createElement("div");o.className="sl-offer-main";let a=document.createElement("div");a.className="sl-offer-copy";let l=document.createElement("span");l.className="sl-offer-kicker",l.textContent=i?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let c=document.createElement("strong");c.className="sl-offer-name",c.textContent=s.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let d=document.createElement("span");d.className="sl-offer-line";let p=[];i&&t.fromPrice!=null&&p.push(this.money(t.fromPrice/100)),i&&s.remaining!=null&&p.push((0,C.t)("picker.offerRemainingAvailable",{count:s.remaining})),i&&s.endsAt!=null&&p.push((0,C.t)("picker.offerUntil",{time:wi(s.endsAt,this.eventTimezone,this.opts.locale)})),r?.startsAt!=null&&p.push((0,C.t)("picker.offerStarts",{time:wi(r.startsAt,this.eventTimezone,this.opts.locale)})),d.textContent=p.join(" \xB7 "),a.append(l,c,d);let u=document.createElement("details");u.className="sl-offer-info";let h=document.createElement("summary");h.setAttribute("aria-label",(0,C.t)("picker.howOfferWorks",{name:c.textContent??""})),h.textContent="i";let g=document.createElement("div");g.className="sl-offer-detail",g.textContent=i?this.tf("picker.offerDetailActive","This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over."):this.tf("picker.offerDetailUpcoming","Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts."),u.append(h,g),o.append(a,u),e.replaceChildren(o),e.classList.add("has")}paidPrice(e,t,i,r){let s=r?this.channelByObject.get(r):void 0;if(s&&e){let a=this.pricesByChannel.get(s)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let o=e?this.opts.pricing?.prices?.[e]:void 0;return o===void 0?i:typeof o=="number"?o:t&&o.tiers?.[t]!==void 0?o.tiers[t]:o.base??i}legendDeps(){return{colorOf:e=>this.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>this.catPriceRange(e),priceOf:e=>this.catPrice(e),offerOf:e=>this.offerPrice(e),money:e=>this.money(e),esc:_}}syncPriceRail(e,t,i=this.legendDeps()){let r=this.els.railScroll,s=e.length>1;if(this.els.rail?.classList.toggle("has",s),!r)return;r.innerHTML=s?Jr({...i,categories:e,left:t,activeKey:this.focusedCatKey,soldOutWord:this.tf("picker.soldOut","Sold out"),allWord:this.tf("picker.allPrices","All prices"),allActive:!this.focusedCatKey&&!this.priceBandKeys}):"";let o=e.map(a=>a.key).join("|");this.lastRailSignature!==o&&(this.lastRailSignature=o,r.scrollLeft=0),r.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){this.applyPriceBand(null);return}this.focusCategory(a.dataset.cat??"")})}),this.railEdgesBound||(this.railEdgesBound=!0,r.addEventListener("scroll",()=>vn(r),{passive:!0})),requestAnimationFrame(()=>vn(r))}syncPrices(){let e=this.controller.doc;if(!e||!this.els.prices)return;let t=this.controller.categoryAvailability(),i=e.categories.filter(p=>!p.notForSale);this.narrateAvailability(i,t),this.syncSoldout(i,t);let r=this.legendDeps(),s=this.suppressPricing,o=s?{...r,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:r;s&&(this.els.pricesSec?.querySelector("span")?.replaceChildren(this.tf("picker.seatCategories","Seat categories")),this.els.pricesHint?.remove()),this.syncPriceRail(i,t,o);let a=5,l=i.length-a,c=l>1&&!this.pricesExpanded,d=c?i.slice(0,a):i;this.els.prices.classList.toggle("sl-expanded",l>1&&this.pricesExpanded),this.els.prices.innerHTML=Zr({...o,categories:d,left:t,collapsed:c,activeKey:this.focusedCatKey,bandKeys:this.priceBandKeys,leftCount:p=>(0,C.tCount)("picker.leftCount",p),titleFor:(p,u)=>u?this.tf("picker.showAllSeats","Show all seats"):(0,C.t)("picker.showLabelSeatsOnMap",{label:p.label}),moreLabel:l>1?c?s?this.tf("picker.showAllCategories","Show all categories"):(0,C.t)("picker.showAllTicketTypes",{count:i.length}):this.tf("picker.showFewer","Show fewer"):null,status:{legend:this.tf("picker.seatStatusLegend","Seat status legend"),held:this.tf("picker.temporarilyHeld","Temporarily held"),sold:this.tf("picker.sold","Sold")}}),this.els.prices.querySelectorAll(".sl-price-row").forEach(p=>{p.addEventListener("mouseenter",()=>this.controller.getRenderer()?.setCategoryHighlight?.(p.dataset.cat??null)),p.addEventListener("mouseleave",()=>this.controller.getRenderer()?.setCategoryHighlight?.(null));let u=()=>this.focusCategory(p.dataset.cat??"");p.addEventListener("click",u),p.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),u())})}),this.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{this.pricesExpanded=!this.pricesExpanded,this.syncPrices()})}focusCategory(e){if(!e)return;let t=this.focusedCatKey===e?null:e;this.focusedCatKey=t,this.priceBandKeys=t?new Set([t]):null;let i=this.els.pricesSec?.querySelector(".sl-price-select");i&&(i.value="all"),this.controller.setCategoryFilter(t?[t]:null),this.controller.focusCategoryFilter(t?[t]:null),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)}narrateAvailability(e,t){let i=this.els.liveText,r=this.lastCatAvail;this.lastCatAvail={...t};let s=this.controller.getActiveFloorId();if(s!==this.lastAvailFloorId&&(this.lastAvailFloorId=s,this.availQuietUntil=performance.now()+2e3),!(!i||!r||performance.now()<this.availQuietUntil))for(let o of e){let a=r[o.key],l=t[o.key]??0;if(a===void 0||l>=a)continue;let c=a-l;i.textContent=(0,C.tCount)("picker.seatsJustTakenInCategory",c,{label:o.label,left:l}),this.els.live?.classList.remove("on"),this.els.live?.offsetWidth,this.els.live?.classList.add("on"),this.liveTimer&&clearTimeout(this.liveTimer),this.liveTimer=setTimeout(()=>this.els.live?.classList.remove("on"),8e3);return}}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(i=>!e.has(i.label)&&(this.controller.getStatus(i.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(i=>i.id)),this.toast((0,C.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:i,heldLabels:r,heldCount:s,total:o,count:a}=Bi(this),l=[],c=new Set;if(!this.salesClosed){let b=this.performanceGroup?.nightSummary?.()??[];b.length&&l.push(po(b,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let E=this.performanceGroup?.selectionModeSwitch;E&&l.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${_(E.label)}</button>`)}l.push(Ys({salesClosed:this.salesClosed,hasPicks:e.length>0||i.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(b=>b.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0}));let d=!e.length&&!i.length&&!Ye(this.gaQty,this.hold?.items??[]);if((d||this.root?.dataset.layout==="narrow")&&(this.baReopen=!1),!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm)){let b=(this.controller.doc?.categories??[]).filter(x=>!x.notForSale),E=this.controller.getBestAvailableZones();this.baZone&&!E.some(x=>x.id===this.baZone)&&(this.baZone=""),l.push(Ws({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:this.baReopen,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:b,zones:E,selectedCategory:this.baCat,selectedZone:this.baZone}))}let p=(b,E,x,I=1,R,T,O)=>qs({categoryLabel:O,d:b?this.controller.seatDetails(b):null,area:x==="ga"?t.find(N=>N.id===R):void 0,label:E,objectType:x,quantity:I,identity:T,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),u=_,h=[];for(let b of vr(i)){let E=b.objectType==="ga"?`held:ga:${b.objectId}:${b.tierId??""}`:`held:${b.label}`;c.add(E);let x=this.controller.doc?.categories.find(K=>K.key===b.categoryKey),I=b.tierId?x?.tiers?.find(K=>K.id===b.tierId)?.name:void 0,R=b.objectType!=="ga"?this.controller.seatByLabel(b.label):null,T=b.objectType==="table"?this.controller.tableSelection(b.label):null,O=R?this.controller.seatDetails(R.id):null,N=this.seatViewEnabled()&&!!R&&b.objectType!=="table",V=u(this.tf("picker.heldForYou","Held for you")),Q=(T?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(b.label))}">${u((0,C.t)("picker.guestsCountEdit",{count:b.quantity??1}))}</button>`:"")+Ri(R?.wheelchairSpaceType)+xn(R?.commercial),J=this.paidPrice(b.categoryKey,b.tierId,b.unitPrice,b.label)*(b.quantity??1);h.push({key:E,fresh:!this.lastTrayKeys.has(E),held:!0,seatIds:[],heldLabels:b.labels,removeAria:(0,C.t)("picker.removeHeldTicketLabel",{label:on(b,t)}),locateId:R?.id??null,section:O?.sectionLabel??"",rowLabel:O&&te(O)||"",seatLabel:O?.seatNumber??b.label,categoryLabel:`${x?.label??b.categoryKey}${I?` \xB7 ${I}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(b.categoryKey)??x?.color??"",identityHtml:p(R?.id??null,b.label,b.objectType,b.quantity??1,b.objectId,T??void 0,`${x?.label??b.categoryKey}${I?` \xB7 ${I}`:""}`),stateHtml:`<span class="sl-ticket-state held" aria-label="${V}" title="${V}"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></span>`,extrasHtml:Q,amount:J,amountText:this.suppressPricing?"":this.money(J),noteHtml:wn(R?.commercial),railHtml:this.performanceGroup?"":On((0,C.t)("picker.removeHeldTicketLabel",{label:on(b,t)}),N?b.label:null),groupable:!Q&&!!O?.sectionLabel&&!this.performanceGroup})}let g=this.seatViewEnabled();for(let b of e.filter(E=>!r.has(E.label))){let E=`seat:${b.id}`;c.add(E);let x=this.controller.doc?.categories.find(K=>K.key===b.categoryKey),I=b.tiers&&b.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${u(b.id)}" aria-label="${u((0,C.t)("picker.ticketTierFor",{label:b.label}))}">`+b.tiers.map(K=>`<option value="${u(K.id)}"${K.id===b.tierId?" selected":""}>${u(K.name)} \xB7 ${u(this.money(this.paidPrice(b.categoryKey,K.id,K.price,b.label)))}</option>`).join("")+"</select>":"",R=b.tiers?.find(K=>K.id===b.tierId)??b.tiers?.[0],T=R?.buyerMessage?.trim()||(R?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),O=this.controller.seatDetails(b.id),N=u(this.tf("picker.selected","Selected")),V=(0,C.t)("picker.removeSeatLabel",{label:b.label}),Q=(b.objectType==="table"&&b.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(b.label))}">${u((0,C.t)("picker.guestsCountEdit",{count:b.quantity??1}))}</button>`:"")+Ri(b.wheelchairSpaceType)+xn(b.commercial)+I,J=this.paidPrice(b.categoryKey,b.tierId??null,b.price,b.label)*(b.quantity??1);h.push({key:E,fresh:!this.lastTrayKeys.has(E),held:!1,seatIds:[b.id],heldLabels:[],locateId:b.id,section:O?.sectionLabel??"",rowLabel:O&&te(O)||"",seatLabel:O?.seatNumber??b.label,categoryLabel:x?.label??b.categoryKey,identityHtml:p(b.id,b.label,b.objectType,b.quantity??1,b.objectId,b,x?.label??b.categoryKey),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(b.categoryKey)??x?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${N}" title="${N}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:Q,amount:J,amountText:this.suppressPricing?"":this.money(J),removeAria:V,noteHtml:wn(b.commercial)+(T?`<small class="sl-tier-note">${u(T)}</small>`:""),railHtml:On(V,g&&b.objectType!=="table"?b.label:null),groupable:!Q&&!T&&!!O?.sectionLabel&&!this.performanceGroup})}h.length&&l.push(this.root?.dataset.layout==="narrow"?to(h,{money:b=>this.money(b),suppressPricing:this.suppressPricing}):h.map(eo).join("")),t.length&&l.push(Sr(this,t,i)),!this.performanceGroup&&!this.salesClosed&&!this.hold&&!d&&!this.baReopen&&!this.bestAvailableBusy&&!this.bestAvailableConfirm&&l.push(`<button type="button" class="sl-ba-reopen" data-ba-reopen><span aria-hidden="true">\u2726</span>${u(this.tf("picker.findTogetherInstead","Find seats together instead"))}</button>`),this.els.tray.innerHTML=l.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=c,io(this.els.tray),this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let m=this.performanceGroup?.selectNight;m&&ko(this.els.tray,b=>m(b)),this.els.tray.querySelectorAll("[data-ba]").forEach(b=>{b.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(b.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",b=>{this.baCat=b.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",b=>{this.baZone=b.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-reopen]")?.addEventListener("click",()=>{this.baReopen=!0,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-close]")?.addEventListener("click",()=>{this.baReopen=!1,this.syncTray(),this.els.tray.querySelector("[data-ba-reopen]")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(b=>{b.addEventListener("click",()=>{let E=b.closest(".sl-chip");if(E.dataset.held){this.removeHeldLabels(decodeURIComponent(E.dataset.held).split(`
|
|
2685
|
+
`)))}"`:"")+(e.length?` data-seat="${r(e.join(" "))}"`:"")+(i?` data-locate="${r(i)}"`:"")}function eo(n){let e=_;return`<div class="sl-chip${n.held?" sl-held":""}${n.fresh?" sl-enter":""}"`+Js(n.key,n.seatIds,n.heldLabels,n.locateId)+">"+(n.held?n.stateHtml:`<span class="sl-chip-dot" style="background:${w(n.categoryColor)}" aria-hidden="true"></span>`)+`<div class="sl-chip-main">${n.identityHtml}`+(n.extrasHtml?`<div class="sl-chip-sub">${n.extrasHtml}</div>`:"")+`${n.noteHtml}</div>`+(n.amountText?`<span class="amt">${e(n.amountText)}</span>`:"")+n.railHtml+"</div>"}function Zs(n,e,t,i,r){let s=_,o=e?.members.length??1,a=o>1,l=e?e.seatsLabel:n.seatLabel,c=e?e.members.reduce((u,h)=>u+h.amount,0):n.amount,d=e?e.members.flatMap(u=>u.seatIds):n.seatIds,p=e?e.members.flatMap(u=>u.heldLabels):n.heldLabels;return`<div class="sl-chip sl-tline${n.held?" sl-held":""}${n.fresh?" sl-enter":""}${e?"":" sl-tsub"}"${i?' data-overflow="true"':""}`+(e?` data-run="${t}"`:` data-run-of="${t}"`)+Js(n.key,d,p,n.locateId)+">"+(a?`<button type="button" class="sl-trun-toggle" aria-expanded="false" aria-label="${s((0,kt.tCount)("picker.seatsSelectedCount",o))}"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg></button>`:n.held?n.stateHtml:`<span class="sl-tline-dot" style="background:${w(n.categoryColor)}" aria-hidden="true"></span>`)+`<span class="sl-sr">${s(n.categoryLabel)}</span><span class="sl-tline-id"><b>${s(n.section||n.seatLabel)}</b>`+(n.rowLabel?`<i>\xB7</i><span>${s(n.rowLabel)}</span>`:"")+(n.section&&l?`<i>\xB7</i><span>${s(l)}</span>`:"")+"</span>"+n.extrasHtml+(r.suppressPricing||!n.amountText?"":(a?`<span class="sl-tline-mult">${o}\xD7</span>`:"")+`<span class="amt">${s(r.money(c))}</span>`)+(n.railHtml?`<button type="button" class="rm" aria-label="${s(a?(0,kt.t)("picker.removeSeatLabel",{label:[n.section,n.rowLabel,l].filter(Boolean).join(" \xB7 ")}):n.removeAria)}"><svg viewBox="0 0 24 24" aria-hidden="true"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg></button>`:"")+"</div>"}function to(n,e){if(!n.length)return"";let t=Fl(n),i=[y("picker.section","Section"),y("picker.row","Row"),y("picker.seat","Seat")].join(" \xB7 "),r=t.length>=Nl,s=t.map((a,l)=>{let c=r&&l>=Dn;return Zs(a.members[0],a,l,c,e)+(a.members.length>1?a.members.map(d=>Zs(d,null,l,c,e)).join(""):"")}).join(""),o=r?`<button type="button" class="sl-tmore" data-tmore aria-expanded="false" data-more="${_((0,kt.t)("picker.moreCount",{count:t.length-Dn}))}" data-less="${_(y("picker.showLess","Show less"))}"><span>${_((0,kt.t)("picker.moreCount",{count:t.length-Dn}))}</span><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg></button>`:"";return`<div class="sl-tlist"${r?' data-collapsed="true"':""}><div class="sl-tlist-head sl-sr">${_(i)}</div>${s}${o}</div>`}function io(n){n.dataset.denseWired!=="true"&&(n.dataset.denseWired="true",n.addEventListener("click",e=>{let t=e.target,i=t.closest("[data-tmore]");if(i){let l=i.closest(".sl-tlist"),c=l?.getAttribute("data-collapsed")==="true";l?.setAttribute("data-collapsed",c?"false":"true"),i.setAttribute("aria-expanded",c?"true":"false");let d=i.querySelector("span");d&&(d.textContent=(c?i.dataset.less:i.dataset.more)??d.textContent);return}let r=t.closest(".sl-trun-toggle");if(!r)return;e.stopPropagation();let s=r.closest(".sl-tline"),o=s?.dataset.run;if(!s||o===void 0)return;let a=r.getAttribute("aria-expanded")!=="true";r.setAttribute("aria-expanded",a?"true":"false"),s.setAttribute("data-open",a?"true":"false"),s.parentElement?.querySelectorAll(`.sl-tsub[data-run-of="${o}"]`).forEach(l=>l.setAttribute("data-open",a?"true":"false"))}))}var St=require("@seatlayer/core");var Vl='<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>',jl='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="8.4"/><circle cx="8.6" cy="10.2" r="1.15"/><circle cx="12" cy="8.2" r="1.15"/><circle cx="15.4" cy="10.2" r="1.15"/><path d="M12 20.4a2.6 2.6 0 0 1 0-5.2 2.2 2.2 0 0 0 0-4.4"/></svg>',Fi=class{constructor(e,t){this.active=new Set;this.deps=t,this.root=document.createElement("div"),this.root.className="sl-a11y",this.button=document.createElement("button"),this.button.type="button",this.button.className="sl-a11ybtn",this.button.setAttribute("aria-haspopup","true"),this.button.setAttribute("aria-expanded","false");let i=this.offered().length>0;this.button.setAttribute("aria-label",i?t.tf("picker.accessibilityOptions","Accessibility and colour options"):t.tf("picker.displayOptions","Display options")),this.button.innerHTML=i?Vl:jl,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=xs(this.rows()),this.root.append(this.menu,this.button),e.appendChild(this.root),this.button.addEventListener("click",r=>{r.stopPropagation(),this.open(this.menu.hidden)}),this.menu.addEventListener("pointerdown",r=>r.stopPropagation()),this.menu.addEventListener("click",r=>r.stopPropagation()),this.dismiss=()=>this.open(!1),this.escape=r=>{r.key==="Escape"&&this.open(!1)},document.addEventListener("pointerdown",this.dismiss),document.addEventListener("keydown",this.escape),this.wire(),this.active.size){this.applyFilter({focus:!1});let r=()=>this.deps.focusSeatsForFilter();typeof requestAnimationFrame=="function"?requestAnimationFrame(r):r()}}colorblindRow(){return this.menu.querySelector(".sl-cbbtn")}syncCounts(){let e=new Map(this.offered().map(({key:i,count:r})=>[i,r])),t=!1;for(let i of this.menu.querySelectorAll("[data-a11y-row]")){let r=i.dataset.a11yRow??"";if(!r.startsWith("a11y:"))continue;let s=r.slice(5),o=e.get(s);if(o===void 0)continue;let a=i.querySelector(".sl-a11yrow-c");a&&(a.textContent=o==null?"":o>0?(0,St.t)("picker.accessFreeCount",{count:o}):this.deps.tf("picker.accessNoneLeft","None left"));let l=o===0;i.disabled=l,l?i.setAttribute("aria-disabled","true"):i.removeAttribute("aria-disabled"),l&&this.active.delete(s)&&(this.paint(i,!1),t=!0)}t&&this.applyFilter()}syncAccessibilityFilter(e){this.active.clear();for(let t of e??[])this.active.add(t);this.remember(e&&e.length?e:null);for(let t of this.menu.querySelectorAll("[data-a11y-row]")){let i=t.dataset.a11yRow??"";i.startsWith("a11y:")&&this.paint(t,this.active.has(i.slice(5)))}}destroy(){document.removeEventListener("pointerdown",this.dismiss),document.removeEventListener("keydown",this.escape),this.root.remove()}open(e){if(e===!this.menu.hidden)return;if(this.button.setAttribute("aria-expanded",String(e)),!e){this.menu.hidden=!0,this.menu.classList.remove("sl-mo-in","sl-mo-stagger");return}this.menu.hidden=!1;let t=this.button.getBoundingClientRect();nn(this.menu,{x:t.left+t.width/2,y:t.top}),pr(this.menu),gi(this.menu)}rows(){return[...this.filterRows(),...this.deps.hasLimitedView?[{key:"limited",icon:"\u25D0",label:this.deps.tf("picker.hideLimitedView","Hide limited-view seats"),on:this.deps.isLimitedViewHidden()}]:[],{key:"colorblind",icon:"\u25D0",className:"sl-cbbtn",label:this.deps.tf("picker.colorblindColors","Colourblind-friendly colours"),on:this.deps.isColorblindSafe()}]}offered(){let e=this.deps.needs?.();if(e)return e.map(({key:i,count:r})=>({key:i,count:r}));let t=this.deps.present;return t?St.ACCESSIBILITY_TYPES.filter(({key:i})=>t.has(i)).map(({key:i})=>({key:i,count:null})):[]}offeredKeys(){return new Set(this.offered().map(({key:e})=>e))}offeredFree(){return new Set(this.offered().filter(({count:e})=>e!==0).map(({key:e})=>e))}filterRows(){let e=this.offeredKeys(),t=new Map(St.ACCESSIBILITY_TYPES.map(i=>[i.key,i]));return this.offered().flatMap(({key:i,count:r})=>{let s=t.get(i);return s?[{key:`a11y:${i}`,icon:s.icon,label:s.label,...i==="wheelchair"&&e.has("companion")?{note:this.deps.tf("picker.companionSeatsNote","Companion places beside them stay selectable")}:{},...r==null?{}:{count:r>0?(0,St.t)("picker.accessFreeCount",{count:r}):this.deps.tf("picker.accessNoneLeft","None left"),disabled:r===0},on:this.active.has(i)}]:[]})}wire(){for(let e of this.menu.querySelectorAll("[data-a11y-row]"))e.addEventListener("click",()=>{let t=e.dataset.a11yRow??"";if(t==="colorblind"){let s=!this.deps.isColorblindSafe();this.deps.setColorblindSafe(s),this.paint(e,s);return}if(t==="limited"){let s=!this.deps.isLimitedViewHidden();this.deps.setLimitedViewHidden(s),s&&this.deps.focusSeatsForFilter(),this.paint(e,s);return}let i=t.slice(5),r=!this.active.has(i);r?this.active.add(i):this.active.delete(i),this.paint(e,r),this.applyFilter()})}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 no=require("@seatlayer/core"),Gl=250;function ro(n,e=Gl){let t=null,i=()=>{t===null&&(t=setTimeout(()=>{t=null,n()},e))},r=(0,no.attachVisibilityCatchUp)(i),s=typeof window<"u"&&typeof window.addEventListener=="function";return s&&window.addEventListener("focus",i),()=>{t!==null&&(clearTimeout(t),t=null),r(),s&&window.removeEventListener("focus",i)}}var Ze=require("@seatlayer/core");var Vi=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,Ze.holdRecoveryShape)(e),i=e.lapsedLabels.length,r=i-e.recoverable.length,s=t==="all"?(0,Ze.tCount)("picker.holdLapsedStillFree",i):t==="partial"?(0,Ze.tCount)("picker.holdLapsedSomeTaken",r):(0,Ze.tCount)("picker.holdLapsedAllTaken",i);this.note={message:s,recoverable:t==="none"?[]:[...e.recoverable]},this.deps.toast(s,t==="none"?"error":"warning",t==="none"?void 0:{label:this.actionLabel(),onClick:()=>this.recover()}),this.deps.syncTray()}noteHtml(){if(!this.note)return"";let e=this.note.recoverable.length?`<button type="button" data-lapse-again>${_(this.actionLabel())}</button>`:"";return`<div class="sl-lapse-note" role="status"><span>${_(this.note.message)}</span>${e}</div>`}wire(e){e?.querySelector("[data-lapse-again]")?.addEventListener("click",()=>this.recover())}clear(){this.note&&(this.note=null,this.deps.syncTray())}actionLabel(){return(0,Ze.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 so=Symbol("seatlayer.performance-group-picker");function ji(n,e){return Object.defineProperty(n,so,{configurable:!1,enumerable:!1,value:Object.freeze({...e})}),n}function oo(n){return n[so]??null}var Fe=require("@seatlayer/core");function Bn(n,e,t){try{return new Intl.DateTimeFormat(e,{...t,...n.timezone?{timeZone:n.timezone}:{}}).format(new Date(n.startsAt))}catch{return new Date(n.startsAt).toLocaleString(e)}}var Gi=(n,e)=>Bn(n,e,{dateStyle:"medium"}),qi=(n,e)=>Bn(n,e,{timeStyle:"short"}),Ki=(n,e)=>Bn(n,e,{weekday:"short",day:"numeric",month:"short"});function ao(n,e,t,i){return!n.length||n.length>=e?null:{summary:i,labels:n.map(r=>`${Gi(r,t)} \xB7 ${qi(r,t)}`)}}function ql(n,e){let t=new Set(e);return n.map(i=>({...i,free:!t.has(i.eventKey)}))}function lo(n,e){let t=[...n];if(t.length<=1)return t[0]??"";try{return new Intl.ListFormat(e,{style:"long",type:"conjunction"}).format(t)}catch{return t.join(", ")}}function Kl(n,e,t="",i=!1){if(!n.length)return"";let r=n.map(s=>{let o=s.free?e.free:e.blocked,a=i&&s.free?`<input class="sl-night-choice" type="checkbox" data-pg-event-key="${w(s.eventKey)}" aria-label="${w(`${s.shortDate}: ${o}`)}" checked>`:"";return`<li class="sl-night${s.free?" ok":" no"}" aria-label="${w(`${s.shortDate}: ${o}`)}">`+a+`<i class="sl-night-dot" aria-hidden="true"></i><span class="d">${w(s.shortDate)}</span><span class="st">${w(o)}</span></li>`}).join("");return`<div class="sl-tip-nights"><div class="sl-tip-nights-title">${w(e.title)}</div><ul class="sl-nightstrip">${r}</ul><p class="sl-tip-nights-note">${w(e.notAvailableOn)}</p>`+t+"</div>"}function Ul(n){return n.selectPartialLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-select-partial>${w(n.selectPartialLabel)}</button>`:n.switchLabel&&n.pinned?`<button type="button" class="sl-tip-switch" data-pg-switch-mode>${w(n.switchLabel)}</button>`:n.switchLabel||n.selectPartialLabel?"":`<p class="sl-tip-advice">${w(n.advice)}</p>`}function Wl(n){return Number(n.available)+Number(n.selected)+Number(n.partial)+Number(n.unavailable)}function co(n,e,t){if(Wl(n)<2)return"";let i=(s,o,a="")=>`<li class="sl-pg-legend-item"><i class="sl-pg-sw ${s}"${a}></i>${w(o)}</li>`,r=[];return n.available&&r.push(i("sl-pg-sw-free",e.available,` style="background:${w(t)}"`)),n.selected&&r.push(i("sl-pg-sw-sel",e.selected)),n.partial&&r.push(i("sl-pg-sw-split",e.partial,` style="--sl-pg-sw-cat:${w(t)}"`)),n.unavailable&&r.push(i("sl-pg-sw-off",e.unavailable)),`<ul class="sl-pg-legend-list" aria-label="${w(e.title)}">${r.join("")}</ul>`}function po(n,e){if(!n.length)return"";let t=n.map(i=>{let r=i.labels.length?i.labels.join(", "):e.empty;return`<li class="sl-pg-night-row${i.labels.length?"":" empty"}${i.active?" active":""}" role="button" tabindex="0"${i.active?' aria-current="true"':""} data-event-key="${w(i.eventKey)}"><span class="n">${w(i.name)}</span><span class="s">${w(r)}</span></li>`}).join("");return`<div class="sl-pg-nights" role="group" aria-label="${w(e.title)}"><div class="sl-pg-nights-title">${w(e.title)}</div><ul class="sl-pg-nights-list">${t}</ul></div>`}function Nn(n,e){if(n?.kind!=="partial"||!e?.length)return null;let t=n.data?.blockedEventKeys??[],i=ql(e,t);return{states:i,missing:i.filter(r=>!r.free).map(r=>r.shortDate)}}function ho(n,e){return n?Kl(n.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,Fe.t)("picker.group.notAvailableOn",{dates:lo(n.missing,e.locale)})},Ul({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 Yl(n,e,t,i){if(!n.length)return"";let r=new Set(e),s=new Set(t),o=n.map(a=>{let l=r.has(a.eventKey);return`<li class="sl-confirm-date${l?"":" blocked"}"><label><input type="checkbox" data-pg-confirm-event-key="${w(a.eventKey)}" aria-label="${w(`${a.shortDate}: ${l?i.available:i.unavailable}`)}"${l&&s.has(a.eventKey)?" checked":""}${l?"":" disabled"}><span class="sl-confirm-date-label">${w(a.shortDate)}</span><span class="sl-confirm-date-state">${w(l?i.available:i.unavailable)}</span></label></li>`}).join("");return`<fieldset class="sl-confirm-dates" data-pg-confirm-dates><legend>${w(i.title)}</legend><p class="sl-confirm-dates-copy">${w(i.copy)}</p><label class="sl-confirm-date-all"><input type="checkbox" data-pg-confirm-all><span>${w(i.selectAll)}</span></label><ul>${o}</ul><p class="sl-confirm-dates-summary" data-pg-confirm-summary aria-live="polite"></p></fieldset>`}function uo(n,e,t,i){let r=e.availableEventKeys(t);return Yl(n,r,e.includedEventKeys(),{title:i("picker.group.confirmDatesTitle","Choose performance dates"),copy:r.length===n.length?i("picker.group.confirmAllDatesCopy","This seat is available for all {count} dates. Keep all selected, or remove dates you do not want.").replace("{count}",String(n.length)):i("picker.group.confirmPartialDatesCopy","This seat is available for {available} of {total} dates. Choose one date or keep every available date.").replace("{available}",String(r.length)).replace("{total}",String(n.length)),selectAll:i("picker.group.confirmSelectAll","Select all available dates"),available:i("picker.group.nightFree","Available"),unavailable:i("picker.group.nightBlocked","Unavailable")})}function mo(n){return[...n.querySelectorAll("[data-pg-confirm-event-key]")].filter(e=>e.checked&&!e.disabled).map(e=>e.dataset.pgConfirmEventKey).filter(Boolean)}function fo(n,e,t,i){let r=[...n.querySelectorAll("[data-pg-confirm-event-key]")];if(!e||!r.length)return;let s=n.querySelector(".sl-confirm-add"),o=n.querySelector("[data-pg-confirm-all]"),a=()=>{let l=r.filter(p=>!p.disabled),c=mo(n).length;o&&(o.checked=c===l.length,o.indeterminate=c>0&&c<l.length);let d=n.querySelector("[data-pg-confirm-summary]");d&&(d.textContent=c===l.length?t("picker.group.confirmAllSelected","All {count} available dates are selected.").replace("{count}",String(c)):t("picker.group.confirmSelectedOfAvailable","{selected} of {available} available dates selected.").replace("{selected}",String(c)).replace("{available}",String(l.length))),s.disabled=c===0,s.textContent=c?e.label(c):t("picker.group.confirmChooseOne","Choose at least 1 date"),i()};r.forEach(l=>l.addEventListener("change",a)),o?.addEventListener("change",()=>{r.filter(l=>!l.disabled).forEach(l=>{l.checked=o.checked}),a()}),a()}async function go(n,e,t){if(!n||!t||!n.querySelector("[data-pg-confirm-event-key]"))return!0;let i=mo(n);if(!i.length)return!1;let r=n.querySelector(".sl-confirm-add");return r?.setAttribute("aria-busy","true"),r&&(r.disabled=!0),await t.apply(e,i)?!0:(r?.removeAttribute("aria-busy"),r?.isConnected&&(r.disabled=!1),!1)}function bo(n,e,t){return n?(0,Fe.t)("picker.group.seatPartlyAvailable",{label:e,free:n.states.length-n.missing.length,total:n.states.length,dates:lo(n.missing,t)}):""}function vo(n,e){let t=n.map((i,r)=>{let s=i.state==="done"?e.done:i.state==="current"?e.current:e.upcoming;return`<li class="sl-pg-step-item" data-step="${w(i.id)}" data-state="${w(i.state)}"${i.state==="current"?' aria-current="step"':""}><span class="i" aria-hidden="true">${i.state==="done"?"\u2713":String(r+1)}</span><span class="l">${w(i.label)}</span><span class="sl-pg-sr">${w(s)}</span></li>`}).join("");return`<ol class="sl-pg-steps" aria-label="${w(e.label)}">${t}</ol>`}function $n(n,e){return`<ul class="sl-pg-cards">${n.map(i=>`<li class="sl-pg-card" data-event-key="${w(i.eventKey)}"><span class="n">${w(i.name)}</span><time datetime="${w(i.iso)}"><span class="d">${w(i.date)}</span><span class="t">${w(i.time)}</span></time></li>`).join("")}</ul><p class="sl-pg-included">${w(e)}</p>`}function yo(n){let e=n.rows.map(t=>`<li class="sl-pg-pane-row${t.labels.length?"":" empty"}" data-event-key="${w(t.eventKey)}"><span class="n">${w(t.name)}</span><span class="s">${w(t.labels.length?t.labels.join(", "):n.empty)}</span></li>`).join("");return`<div class="sl-pg-pane-title">${w(n.title)}</div><ul class="sl-pg-pane-list">${e}</ul>`+(n.note?`<p class="sl-pg-pane-note">${w(n.note)}</p>`:"")+(n.total?`<div class="sl-pg-pane-total"><span>${w(n.total.label)}</span><b>${w(n.total.amount)}</b></div>`:"")+(n.holdStatus?`<p class="sl-pg-hold-status" role="status">${w(n.holdStatus)}</p>`:"")}function xo(n){let e=Math.max(0,n);return`${Math.floor(e/6e4)}:${String(Math.floor(e/1e3)%60).padStart(2,"0")}`}function wo(n,e){if(!n||n.seats<=0)return"";if(e==="same_seat"){let t=n.perPerformance??n.seats;return n.totalPerformances&&n.performances<n.totalPerformances?(0,Fe.tCount)("picker.group.performancesChosenOf",t,{chosen:n.performances,total:n.totalPerformances}):(0,Fe.tCount)("picker.group.seatsEveryPerformance",t)}return n.perPerformance!=null&&n.performancesChosen===n.performances?(0,Fe.tCount)("picker.group.seatsPerPerformance",n.seats,{per:n.perPerformance}):(0,Fe.tCount)("picker.group.performancesChosenOf",n.seats,{chosen:n.performancesChosen,total:n.performances})}function ko(n,e){n.querySelectorAll(".sl-pg-night-row[data-event-key]").forEach(t=>{let i=()=>e(t.dataset.eventKey);t.addEventListener("click",i),t.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),i())})})}var So=require("@seatlayer/core");function xe(n){return String(n??"\u2014").replace(/[&<>"]/g,e=>({"&":"&","<":"<",">":">",'"':"""})[e])}function Ql(n,e){let t=n.objectType==="table"&&!!n.bookingMode,i=n.objectType==="booth",r=t||i||!n.seatNumber,s=r?n.rowLabel??n.displayLabel??n.label:n.seatNumber,o=t?`${y("picker.guests","Guests")} ${n.bookingMode==="variable"?`${n.minOccupancy}\u2013${n.maxOccupancy}`:n.capacity}`:!i&&n.rowLabel?`${e} ${te(n)??""}`.trim():"";return`<div class="sl-tip-head"><div class="sl-tip-id"><span class="sl-tip-seat${r?" name":""}">${xe(s)}</span>`+(o?`<span class="sl-tip-row">${xe(o)}</span>`:"")+"</div>"+(n.sectionLabel?`<div class="sl-tip-sec"><span class="sl-tip-eyebrow">${y("picker.section","Section")}</span><span class="sl-tip-secname">${xe(n.sectionLabel)}</span></div>`:"")+"</div>"}function To(n,e){let t=n.status==="not_for_sale",i=n.mark?.kind==="partial",r=n.status==="free"||i?"":`<span class="sl-tip-tag">${t?y("picker.notAvailable","Not available"):n.status==="held"?(0,So.t)("map.statusHeld"):y("picker.sold","Sold")}</span>`,s=t?"":e.price,o=s?`<span class="sl-tip-amt">${xe(s)}</span>`:"",a=!s&&e.priceNote?`<div class="sl-tip-note">${xe(e.priceNote)}</div>`:"",l=He(n.commercial),c=l?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u25D0</span>${xe(l)}</div>`:"",d=xt(n.wheelchairSpaceType),p=d?`<div class="sl-tip-cx"><span class="g" aria-hidden="true">\u267F</span>${xe(d)}</div>`:"",u=e.reason?`<div class="sl-tip-reason">${xe(e.reason)}</div>`:"";return'<i class="sl-tip-rail" aria-hidden="true"></i>'+Ql(n,e.rowTypeWord)+`<div class="sl-tip-cat"><span class="sl-tip-dot" style="background:${xe(n.categoryColor)}"></span><span class="sl-tip-name">${xe(n.categoryLabel)}</span>`+r+o+"</div>"+a+u+p+c+(e.extra??"")}function Co(n,e,t,i){let r=n.x+14,s=n.y-i.height-12,o=n.y+18,a=s;r+i.width>e-8&&(r=n.x-i.width-14),s<8&&o+i.height<=t-8&&(a=o);let l=Math.max(8,t-i.height-8);return{left:Math.max(8,Math.min(r,Math.max(8,e-i.width-8))),top:Math.max(8,Math.min(a,l))}}function Eo(n,e,t,i=22){let r=Math.max(8,Math.min(n.x-t.width/2,Math.max(8,e.width-t.width-8))),s=n.y-i-t.height,o=n.y+i;return s>=8?{left:r,top:s,placement:"above"}:o+t.height<=e.height-8?{left:r,top:o,placement:"below"}:{left:r,top:Math.max(8,Math.min(s<8?o:s,Math.max(8,e.height-t.height-8))),placement:s<8?"below":"above"}}var zn=14,Xl=12,Zl=12,Jl=18;function Ao(n,e,t,i=Xl){let r=zn;if(!(n>=e.height-r-t.height-Jl))return{placement:"sheet",bottom:r};let o=e.height-n+i,a=e.height-Zl-t.height;return{placement:"above",bottom:Math.max(0,Math.min(o,a))}}function Po(n,e,t,i){let r=t.width/2+12,s=Math.max(r,Math.min(e.width-r,n.x)),o=n.y+t.height+24<=e.height,a=n.y<t.height+24&&o?"below":"above",l=i&&a==="above"?Math.max(t.height+24,n.y):n.y;return{left:s,top:Math.max(8,Math.min(e.height-8,l)),placement:a}}function Lo(n,e,t){let i=n.querySelector("[data-pg-select-partial]"),r=[...n.querySelectorAll("[data-pg-event-key]")],s=()=>r.filter(a=>a.checked).map(a=>a.dataset.pgEventKey).filter(Boolean),o=()=>{if(!i)return;let a=s().length;i.disabled=a===0,i.textContent=e?.(a)??i.textContent};r.forEach(a=>{a.addEventListener("change",o);let l=a.closest(".sl-night");l?.classList.add("selectable"),l?.addEventListener("click",c=>{c.target!==a&&(a.checked=!a.checked,o())})}),i?.addEventListener("click",()=>{let a=s();a.length&&t?.(a)})}function Tt(n){let e=n?.displayType?.trim()||n?.rowType?.trim();return e||(n?.objectType==="table"?y("picker.table","Table"):n?.objectType==="booth"?y("picker.booth","Booth"):y("picker.row","Row"))}var Mo="@seatlayer/pending-checkout/v1";function ec(n){return typeof n=="string"&&n.length<=160&&/^ord_[A-Za-z0-9_-]+$/.test(n)}function Ho(n){if(typeof location>"u")return null;let e=new URLSearchParams(location.search),t=e.get("seatlayer_checkout");if(t!=="success"&&t!=="cancelled")return null;let i=null;try{let r=window.sessionStorage.getItem(Mo);if(r){let s=null;try{s=JSON.parse(r)}catch{}if(s&&ec(s.orderId)){let o=Date.now()-Number(s.storedAt);if(o>=0&&o<=144e5){if(s.eventKey&&s.eventKey!==n)return null;i=s.orderId}}}window.sessionStorage.removeItem(Mo)}catch{}e.delete("seatlayer_checkout");try{let r=e.toString();history.replaceState(history.state,"",`${location.pathname}${r?`?${r}`:""}${location.hash}`)}catch{}return{outcome:t,orderId:i}}function Io(n){if(!n.framed)return null;let e=n.ancestorOrigins?.length?n.ancestorOrigins[0]:null;for(let t of[e,n.referrer])if(t)try{return new URL(t).origin}catch{}return null}var tc="https://api.seatlayer.io",ic=10,Ro=6e4,Oo=6e4,nc=360,rc=10,sc=40,oc=220,ac=160,Do="seatmap.a11y.cb";function lc(){try{if(typeof window>"u")return null;let n=window.localStorage.getItem(Do);return n==null?null:n==="1"}catch{return null}}function cc(n){try{window.localStorage.setItem(Do,n?"1":"0")}catch{}}var Ve=class n{constructor(e){this.realtime=null;this.accessEl=null;this.lastSelectionValidity=null;this.root=null;this.mapHost=null;this.rendered=!1;this.destroyed=!1;this.renderInfo=null;this.webMcp=null;this.localeGeneration=0;this.els={};this.regions={};this.ro=null;this.holdTimer=null;this.toastTimer=null;this.offerRefreshTimer=null;this.offerBoundaryTimer=null;this.offerVisibilityHandler=null;this.motionTimers=new Set;this.currency="USD";this.eventTimezone=null;this.eventWhenText=null;this.offerAvailability=null;this.channelByObject=new Map;this.pricesByChannel=new Map;this.hold=null;this.holdExpiresAt=0;this.handedOff=!1;this.bookedShown=!1;this.holdConflicted=!1;this.paymentOptions=null;this.checkoutPanel=null;this.extendEl=null;this.bookedEl=null;this.gaQty=new Map;this.gaPromptEl=null;this.gaPromptReturnFocus=null;this.gaAreasExpanded=!1;this.lastMapPoint=null;this.tipEl=null;this.tipPos={x:0,y:0};this.tipPinned=!1;this.tipMarkedHoverLabel=null;this.lastPointerType="mouse";this.confirmEl=null;this.themeMode=null;this.colorSchemeStop=null;this.seatsRevealed=!1;this.seatsRevealedReport=null;this.confirmSeat=null;this.suppressConfirmationSeatId=null;this.tableDialogEl=null;this.tableDialog=null;this.tableDialogHeld=!1;this.tableDialogReturnFocus=null;this.srEl=null;this.baQty=2;this.baCat="";this.baZone="";this.baPremium=!1;this.baReopen=!1;this.bestAvailableConfirm=!1;this.releasingHold=!1;this.salesClosed=!1;this.soldOut=!1;this.soldoutEl=null;this.cbSafe=!1;this.rungsEl=null;this.projectionEl=null;this.buyerView="map";this.view3dEl=null;this.view3dHandle=null;this.view3dGen=0;this.view3dReturnSeat=null;this.view3dTargetSeatId=null;this.view3dCompareSeatIds=[];this.view3dCompareChip=new Di({overlay:()=>this.view3dEl,savedSeatIds:()=>this.view3dCompareSeatIds,openComparison:()=>this.openView3dComparison(),clearComparison:()=>this.clearView3dComparison(),toast:(e,t)=>this.toast(e,t)});this.view3dCompareEl=null;this.view3dCompareCleanup=null;this.view3dSeatViewChrome=null;this.view3dPassportEl=null;this.view3dPassportCleanup=null;this.floorsEl=null;this.viewEl=null;this.viewCleanup=null;this.seatViewGen=0;this.allSeatsCache=null;this.view3dBack=null;this.view3dNav=null;this.lastRailSignature="";this.priceSelect=null;this.minimap=null;this.pickerLayoutSize={width:0,height:0};this.priceBandKeys=null;this.focusedCatKey=null;this.limitedViewFilter=!1;this.pricesExpanded=!1;this.sectionCardCache=null;this.lastTrayCount=0;this.langSel=null;this.lastTrayTotal=0;this.lastTrayKeys=new Set;this.bestAvailableBusy=!1;this.releasingLabels=new Set;this.holdingLabels=new Set;this.ctaPhase="idle";this.a11yMenu=null;this.detachAttention=null;this.lapse=new Vi({toast:(e,t,i)=>this.toast(e,t,i),reselect:e=>{this.controller.select(e),this.handleCta()},syncTray:()=>this.syncTray()});this.railEdgesBound=!1;this.fsFallback=!1;this.fsChangeHandler=null;this.fsEscHandler=null;this.eventDetailsHidden=!1;this.holdCopyPending=!1;this.sideCollapsed=!1;this.sideToggleEl=null;this.framedFs=!1;this.lastPostedHeight=0;this.cbEl=null;this.modalScrim=null;this.prevFocus=null;this.escHandler=null;this.closeModal=null;this.lastCatAvail=null;this.lastAvailFloorId="";this.availQuietUntil=0;this.liveTimer=null;this.perspectiveWarned=!1;if(!e||typeof e!="object")throw new Error("seatmap: options object is required");if(!e.event||typeof e.event!="string")throw new Error("seatmap: `event` key is required");if(!e.container)throw new Error("seatmap: `container` is required (or use SeatPicker.open())");this.performanceGroup=oo(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??tc).replace(/\/+$/,"");let t={onExpired:a=>{this.opts.onAccessExpired?.(a),a.refreshed||this.showAccessPanel({reason:"no_token",retryable:!1})},onUnavailable:a=>{this.opts.onAccessUnavailable?.(a),this.showAccessPanel(a)}},i=!e.transport&&e.publicKey&&!e.buyerAccessTokenProvider&&!e.buyerAccessToken?mi({base:this.apiBase,event:e.event,publicKey:e.publicKey,accessHooks:t,apiOptions:{referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}}):null;this.access=e.transport?null:i?.access??ut(e,t),this.pubApi=e.transport?null:i?.api??new De(this.apiBase,{access:this.access??void 0,referral:e.referral,onObjectUnavailable:a=>this.opts.onSelectedObjectUnavailable?.(a)}),this.api=e.transport??this.pubApi,this.buyerAssetUrls=new gt(e.event,this.api.asset?(a,l)=>this.api.asset(a,l):void 0),e.checkout==="hosted"&&!this.pubApi&&console.warn('seatlayer: checkout: "hosted" needs the widget\'s own transport \u2014 a custom `transport` owns its backend, so the picker is staying on onCheckout for this mount.'),this.checkoutMode=e.checkout==="hosted"&&this.pubApi?"hosted":"handoff";let r=e.numberOfPlacesToSelect;if(r!=null&&(!Number.isInteger(r)||r<1))throw new Error("seatmap: `numberOfPlacesToSelect` must be a positive integer");this.exactTickets=r??null;let s=Gs(e.selectionValidators);if(this.exactTickets!=null&&s>this.exactTickets)throw new Error("seatmap: `minimumSelectedPlaces.minimum` cannot exceed `numberOfPlacesToSelect`");let o=Math.max(1,Math.floor(e.maxSelection??this.exactTickets??Math.max(ic,s)));if(this.exactTickets!=null&&o<this.exactTickets)throw new Error("seatmap: `maxSelection` cannot be lower than `numberOfPlacesToSelect`");if(e.maxSelection!=null&&o<s)throw new Error("seatmap: `maxSelection` cannot be lower than `minimumSelectedPlaces.minimum`");this.maxTickets=this.exactTickets??o,this.cbSafe=lc()??!!e.colorblindSafe,this.controller=this.wireController(e)}get lastSection(){return this.sectionCard.summary}set lastSection(e){this.sectionCard.adopt(e)}chartHasStage(){let e=this.controller.doc;if(!e)return!1;let t=e.floors?.length?e.floors.map(i=>i.objects??[]):[e.objects??[]];for(let i of t)for(let r of i)if(r.type==="shape"&&(r.role==="stage"||r.stageKind))return!0;return!1}confirmThumbHtml(e){let t=this.controller.doc;if(!t)return"";let i=this.deliverableViewReference(e)?e.viewUrl??"":"",r=this.chartHasStage();if(!i&&!r)return"";let s=null;if(!i)try{s=(0,C.generateSeatThumb)(e,e.focalPoint??t.focalPoint).distanceM??null}catch{return""}let o=r&&s!=null?`<div class="sl-confirm-sight">${_((0,C.t)("picker.sightline",{m:s}))}</div>`:"";if(!i)return o;let a=_((0,C.t)("picker.viewFromSeat",{label:e.label})),l=_(this.tf("picker.viewFromHere","View from here"));return`<button type="button" class="sl-confirm-view sl-confirm-thumbwrap" aria-label="${a}"><img class="sl-confirm-thumb" alt="" /><span class="sl-confirm-thumb-badge">\u{1F52D} ${l}</span></button>`+o}deliverableViewReference(e){let t=e.viewMeta?.previewUrl??e.viewUrl;return t&&(cn(t)||ft(t))?t:null}isFramed(){return typeof window<"u"&&window.parent!==window}postToHost(e){if(!this.isFramed())return;let t=Io({framed:!0,ancestorOrigins:window.location.ancestorOrigins,referrer:document.referrer});if(t)try{window.parent.postMessage(e,t)}catch{}}measureFramedHeight(){let e=this.root;if(!e)return 0;let t=e.clientWidth||(typeof window<"u"?window.innerWidth:0)||0;if(t<=0)return 0;let i=t<640?1.2:.62;return Math.max(420,Math.round(t*i))}reportFramedHeight(){if(!this.isFramed())return;let e=this.measureFramedHeight();e<=0||e===this.lastPostedHeight||(this.lastPostedHeight=e,this.postToHost({type:"seatlayer:height",px:e}))}toggleFullscreen(){let e=this.root;if(!e)return;!!document.fullscreenElement||this.fsFallback||this.framedFs?document.fullscreenElement?document.exitFullscreen().catch(()=>{}):this.framedFs?this.setFramedFs(!1):this.setFsFallback(!1):e.requestFullscreen?e.requestFullscreen().catch(()=>this.enterFsFallback()):this.enterFsFallback()}syncFullscreenButtons(){let e=!!document.fullscreenElement||this.fsFallback||this.framedFs,t=this.eventDetailsHidden&&!e;this.root?.setAttribute("data-event-details-hidden",String(t)),this.els.zfs?.setAttribute("aria-pressed",String(e)),this.els.zfs?.setAttribute("title",e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen"));let i=this.els.zfs?.querySelector(".sl-zfs-lbl");i&&(i.textContent=e?this.tf("picker.exitFullScreen","Exit full screen"):this.tf("picker.fullScreen","Full screen")),this.view3dEl?.querySelector(".sl-view3d-fs")?.setAttribute("aria-pressed",String(e))}enterFsFallback(){this.isFramed()?this.setFramedFs(!0):this.setFsFallback(!0)}setFramedFs(e){this.framedFs!==e&&(this.framedFs=e,this.syncFullscreenButtons(),this.postToHost({type:"seatlayer:fullscreen",on:e}),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFramedFs(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}setFsFallback(e){this.fsFallback!==e&&(this.fsFallback=e,this.root?.classList.toggle("sl-fs",e),this.syncFullscreenButtons(),e&&!this.fsEscHandler?(this.fsEscHandler=t=>{t.key==="Escape"&&!document.fullscreenElement&&this.setFsFallback(!1)},window.addEventListener("keydown",this.fsEscHandler)):!e&&this.fsEscHandler&&(window.removeEventListener("keydown",this.fsEscHandler),this.fsEscHandler=null),requestAnimationFrame(()=>this.controller.refitCurrentView()))}close(){this.closeModal?this.closeModal():this.destroy()}static async open(e){bt();let t=document.activeElement instanceof HTMLElement?document.activeElement:null,i=document.createElement("div");i.className="sl-modal-scrim";let r=document.createElement("div");r.className="sl-modal-frame",r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"),r.setAttribute("aria-label",y("picker.seatSelection","Seat selection")),r.tabIndex=-1,i.appendChild(r),document.body.appendChild(i);let s=document.body.style.overflow;document.body.style.overflow="hidden";let o=new n({...e,container:r});o.modalScrim=i,o.prevFocus=t;let a=["a[href]","area[href]","button","input","select","textarea","iframe","object","embed","summary","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"[tabindex]"].join(","),l=()=>{let g=[...r.querySelectorAll('[role="dialog"][aria-modal="true"]')].filter(m=>m.isConnected&&!m.closest('[hidden], [aria-hidden="true"], [inert]'));return g[g.length-1]??r},c=(g,m)=>{let v=g;for(;v;){let k=window.getComputedStyle(v);if(v.hidden||v.getAttribute("aria-hidden")==="true"||v.hasAttribute("inert")||k.display==="none"||k.visibility==="hidden"||k.visibility==="collapse")return!0;if(v===m)return!1;v=v.parentElement}return!0},d=g=>[...g.querySelectorAll(a)].filter(m=>m.tabIndex>=0&&!m.matches(":disabled")&&!c(m,g)),p=(g,m)=>{let v=d(g),k=m?v[v.length-1]:v[0];k?k.focus({preventScroll:!0}):(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus({preventScroll:!0}))},u=!1,h=()=>{if(u)return;u=!0,document.body.style.overflow=s,o.escHandler&&document.removeEventListener("keydown",o.escHandler),i.remove(),o.modalScrim=null;let g=o.prevFocus;o.prevFocus=null,g?.isConnected&&g.focus({preventScroll:!0});let m=()=>{o.destroy(),e.onClose?.()};o.hold&&!o.handedOff?o.release().finally(m):m()};return o.closeModal=h,i.addEventListener("mousedown",g=>{g.target===i&&h()}),o.escHandler=g=>{if(g.key==="Tab"){if(g.defaultPrevented)return;let m=l(),v=d(m),k=v[0],S=v[v.length-1],L=document.activeElement;!k||!S?(g.preventDefault(),p(m,g.shiftKey)):L===m||!L||!m.contains(L)?(g.preventDefault(),(g.shiftKey?S:k).focus({preventScroll:!0})):g.shiftKey&&L===k?(g.preventDefault(),S.focus({preventScroll:!0})):!g.shiftKey&&L===S&&(g.preventDefault(),k.focus({preventScroll:!0}));return}g.key==="Escape"&&(o.tableDialog?(g.preventDefault(),o.cancelTableDialog()):o.confirmSeat?(g.preventDefault(),o.cancelConfirm()):o.bestAvailableConfirm?(g.preventDefault(),o.bestAvailableConfirm=!1,o.syncTray()):(g.preventDefault(),h()))},document.addEventListener("keydown",o.escHandler),await o.render(),o.els.close?.classList.add("on"),o.els.close?.addEventListener("click",h),p(l(),!1),o}wireController(e){return new C.PickerController({transport:this.api,eventKey:e.event,maxSelection:this.maxTickets,selectedObjects:e.selectedObjects,selectableObjects:e.selectableObjects,numberOfPlacesToSelect:e.numberOfPlacesToSelect,selectionValidators:e.selectionValidators,currency:e.currency,flashOnLiveChange:!0,colorblindSafe:this.cbSafe,...e.loadingReveal?{loadingReveal:e.loadingReveal}:{},mapTheme:at(e.theme),onSeatsRevealed:()=>{this.seatsRevealed=!0,e.onSeatsRevealed?.(),this.seatsRevealedReport?.()},onGAClick:t=>{let i=this.controller.getGAAreas().find(r=>r.id===t);i&&(this.collapseSheet(),an(this,i,this.lastMapPoint))},onSelectionChange:()=>{this.syncTray(),this.minimap?.refreshMinimap(),this.committedSelection().length&&this.collapseSectionCard(),this.syncSelectionTo3d()},onStatusChange:()=>{this.syncSeatMarks(),this.syncPrices(),this.a11yMenu?.syncCounts(),this.scheduleOfferRefresh(!0),this.evictTakenSelections(),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onHoldExpired:()=>{this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.holdConflicted=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.lapse.deferExpiryToast(()=>this.toast((0,C.t)("picker.holdExpired",void 0)||"Your hold expired \u2014 seats released. Pick again.","warning")),this.syncTray(),this.emitHoldChange(),this.opts.onHoldExpired?.()},onAvailabilityRefresh:t=>this.lapse.handle(t),confirmSelection:this.opts.confirmSelection,onSelect:t=>{if(this.salesClosed){this.controller.deselect([t.id]),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.controller.tableSelection(t.id)||(this.collapseSheet(),this.flashPickedSeat(t.id),this.opts.confirmSelection&&this.suppressConfirmationSeatId!==t.id&&this.showConfirm(t))},onTableSelectionRequest:t=>{if(this.salesClosed){this.controller.deselect(t.physicalSeatIds),this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning");return}this.showTableDialog(t,!1)},onDeselect:t=>{if(this.controller.currentHold()?.labels.includes(t.label)){this.removeHeldLabels([t.label]);return}this.confirmSeat?.id===t.id&&this.dismissConfirm(),this.tableDialog?.physicalSeatIds.includes(t.id)&&this.dismissTableDialog()},onSelectionLimit:()=>{this.toast((0,C.t)("picker.maxTicketsForOrder",{count:this.maxTickets}),"warning"),this.opts.onSelectionLimit?.(this.maxTickets)},onViewChange:()=>{this.reanchorConfirm(),this.syncRung(),this.syncProjection(),this.minimap?.drawMinimapRect(),this.sectionCardOnView()},onSectionFocus:t=>this.showSectionCard(t),onDeckTap:()=>{this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()},onFocusSeat:t=>this.announceSeat(t),onSeatHover:t=>this.updateTooltip(t),onHint:t=>{t&&this.toast(t)},onSalesClosed:()=>this.setSalesClosed(!0),onError:t=>this.opts.onError?.(t)})}async render(){if(this.rendered)return this;let e=performance.now(),t={},i=T=>Math.round((performance.now()-T)*100)/100;this.rendered=!0,bt();let r=performance.now(),s=pi(this.opts.locale,this.opts.messages),o=this.localeGeneration+=1;this.checkoutMode==="hosted"&&(this.paymentOptions=this.pubApi.paymentOptions(this.opts.event));let a=performance.now(),l=Nr(this.opts.container),{root:c,els:d,mapHost:p}=rr(l,(T,O)=>this.tf(T,O),this.opts.theme);this.root=c,this.els=d,this.mapHost=p,hi(c,s,T=>{t.loadLocale=i(r),this.destroyed||this.applyActiveLocale(T,o)}),Hs(c,()=>[{open:()=>this.tipPinned,close:()=>this.unpinTooltip()},{open:()=>!!this.tableDialog,close:()=>this.cancelTableDialog()},{open:()=>!!this.confirmSeat,close:()=>this.cancelConfirm()},{open:()=>this.bestAvailableConfirm,close:()=>{this.bestAvailableConfirm=!1,this.syncTray()}}]),this.syncFullscreenButtons(),this.wireBuyerShell(c);let u=document.createElement("div");u.style.cssText="position:absolute;inset:0",this.mapHost.appendChild(u),t.mountBuyerShell=i(a),t.skeletonPaint=i(e);let h=await this.loadChart(u,t,i);if(!h)return this;t.shellsPaint=i(e);let g=performance.now();if(this.startRealtime(),this.salesClosed=!!h.salesClosed||!!this.opts.readOnly,c.dataset.eventMode=h.mode==="test"?"test":"live",!this.opts.locale&&h.locale&&this.setLocale(h.locale),this.controller.setViewMode(this.normalizeInitialView(this.opts.initialView)),this.buildRegions(),this.regions["bottom-right"].appendChild(this.els.zoom),this.regions["bottom-center"].appendChild(this.els.toast),h.mode==="test"){let T=document.createElement("div");T.className="sl-testbadge",T.textContent=Br((0,C.t)("picker.testMode"),(0,C.getLocale)()),T.setAttribute("aria-label",(0,C.t)("picker.testMode")),T.title=this.tf("picker.testModeExplained","Bookings here are not real and no card is charged"),this.regions["top-left"].appendChild(T)}let m=this.controller.doc?.theme;this.themeMode=this.opts.theme?.mode??null,this.applyThemeTokens(c),this.watchThemeMode(),this.currency=h.currency??this.opts.currency??"USD",this.eventTimezone=h.timezone??null,$r(this.els.logo,[this.opts.theme?.logoUrl,m?.logoUrl,h.posterUrl],this.opts.theme?.brandName??m?.brandName??h.eventName??"?"),this.els.name.textContent=h.eventName??"";let v=h.startsAt?wi(h.startsAt,h.timezone??null,this.opts.locale):"";this.eventWhenText=v||null,this.els.meta.textContent=[h.venue,v].filter(Boolean).join(" \xB7 "),this.syncProjection(),this.buildBadge(m);let k=!!this.controller.doc&&this.controller.getExpandedSeats().some(T=>T.commercial?.restrictedView||T.commercial?.obstructedView);this.buildAccessibilityMenu(k),this.buildLanguageSwitcher(this.els.zoom??this.regions["bottom-right"]),this.srEl=document.createElement("div"),this.srEl.className="sl-sr",this.srEl.setAttribute("aria-live","polite"),c.appendChild(this.srEl),this.buildArenaChrome(),this.buildMinimap(),this.buildPriceFilter(),this.buildExtendPrompt(),this.buildBookedOverlay(),this.buildSoldoutOverlay(),this.buildPanelToggle(),this.opts.panelCollapsed&&this.setPanelCollapsed(!0),this.dockLayoutChrome(),t.buildBuyerControls=i(g);let S=performance.now();if(await this.restoreRememberedHold(),t.restoreHold=i(S),this.destroyed)return this;this.dismissSkeleton(),this.salesClosed&&this.applySalesClosed(),this.syncPrices(),this.syncTray(),this.resumeHostedOrder();let L=this.controller.doc,b=Pi(this.opts.event),E=this.performanceGroup?.surface??(this.performanceGroup?"performance_group":null),x=E??"event",I={apiBase:this.apiBase,eventKey:this.opts.event,metricScope:x,surface:E==="season"?"season_picker":E==="performance_group"?"performance_group_picker":"seat_picker",ms:i(e),performanceProfile:t,chartDelivery:h.chartDelivery,seatCount:this.allSeats().length,objectCount:L?.objects.length??0,sectionCount:L?.objects.filter(T=>T.type==="section").length??0,floorCount:this.controller.getFloors().length,chartName:L?.name,view:this.buyerView,load:b,transport:this.opts.transport?"custom":"pubapi"};Ns(I,(T,O)=>this.emitAnalytics(T,O));let R=h.performanceProfile;return this.seatsRevealedReport=()=>this.emitAnalytics("chart_seats_revealed",Mn({...I,performanceProfile:{...I.performanceProfile,...R}})),this.seatsRevealed&&this.seatsRevealedReport(),this.renderInfo=h,await this.registerAgentTools(),this}registerAgentTools(){return Ds(this)}webMcpHost(e){return An(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=ro(()=>{this.destroyed||this.controller.refreshAvailability()}),this.observeLayout(e),this.els.zin.addEventListener("click",()=>this.controller.zoomIn()),this.els.zout.addEventListener("click",()=>this.controller.zoomOut()),this.els.zfit.addEventListener("click",()=>this.controller.zoomToFit()),this.els.zfs.addEventListener("click",()=>this.toggleFullscreen()),this.fsChangeHandler=()=>{document.fullscreenElement||this.setFsFallback(!1),this.syncFullscreenButtons(),requestAnimationFrame(()=>this.controller.refitCurrentView())},document.addEventListener("fullscreenchange",this.fsChangeHandler);let t=this.els.sheetHead;if(t){let r=this.els.sheetToggle,s=c=>{e.dataset.sheet=c?"open":"peek",r?.setAttribute("aria-expanded",String(c)),r?.setAttribute("aria-label",c?this.tf("picker.collapseTicketPanel","Collapse ticket panel"):this.tf("picker.openTicketPanel","Open ticket panel"))};s(e.dataset.sheet==="open"),r?.addEventListener("click",c=>{c.stopPropagation(),s(e.dataset.sheet!=="open")}),this.els.peek?.addEventListener("click",c=>{let d=c.target.closest(".sl-sheet-go");d&&(c.stopPropagation(),d.dataset.act==="checkout"?this.handleCta():d.dataset.act==="best"||d.dataset.act==="find"?(d.dataset.act==="best"&&(this.baReopen=!0,this.baQty=Math.max(1,Math.min(this.baQty,this.maxTickets-this.totalTicketCount())),this.syncTray()),s(!0),this.els.tray?.querySelector(".sl-ba")?.scrollIntoView({block:"nearest",behavior:this.reducedMotion()?"auto":"smooth"}),this.els.tray?.querySelector(".sl-ba-go")?.focus()):s(!0))});let o=0,a=!1,l=!1;t.addEventListener("pointerdown",c=>{if(c.target.closest?.(".sl-seccard,.sl-sheet-toggle,.sl-sheet-go")){l=!1;return}l=!0,a=!1,o=c.clientY,t.setPointerCapture?.(c.pointerId)}),t.addEventListener("pointermove",c=>{if(!l||a)return;let d=c.clientY-o;d<-18?(s(!0),a=!0):d>18&&(s(!1),a=!0)}),t.addEventListener("pointerup",c=>{l&&!a&&Math.abs(c.clientY-o)<6&&s(e.dataset.sheet!=="open"),l=!1,t.releasePointerCapture?.(c.pointerId)})}let i=()=>{if(this.root?.dataset.layout!=="narrow")return;let r=this.root.getAttribute("data-prices-open")==="true";if(this.root.setAttribute("data-prices-open",String(!r)),this.els.pricesSec?.setAttribute("aria-expanded",String(!r)),!r&&this.root.dataset.sheet!=="open"){this.root.dataset.sheet="open";let s=this.els.sheetToggle;s?.setAttribute("aria-expanded","true"),s?.setAttribute("aria-label","Collapse ticket panel")}};this.els.pricesSec?.addEventListener("click",r=>{r.target.closest("select,button")||i()}),this.els.pricesSec?.addEventListener("keydown",r=>{r.key!=="Enter"&&r.key!==" "||r.target.closest("select,button")||(r.preventDefault(),i())}),this.tipEl=document.createElement("div"),this.tipEl.setAttribute("role","tooltip"),this.tipEl.className="sl-tip",this.els.map.appendChild(this.tipEl),this.els.map.addEventListener("pointerdown",r=>{this.handleMapPointerDown(r)},!0),this.els.map.addEventListener("mousemove",r=>{if(this.tipPinned)return;let s=this.els.map.getBoundingClientRect();this.tipPos={x:r.clientX-s.left,y:r.clientY-s.top},this.tipEl&&this.tipEl.style.display!=="none"&&this.placeTooltip()}),this.els.cta.addEventListener("click",()=>{this.handleCta()}),this.els.holdChange?.addEventListener("click",()=>{this.handleChangeSeats()})}collapseSheet(){let e=this.root;!e||e.dataset.layout!=="narrow"||e.dataset.sheet!=="open"||(e.dataset.sheet="peek",this.els.sheetToggle?.setAttribute("aria-expanded","false"),this.els.sheetToggle?.setAttribute("aria-label",this.tf("picker.openTicketPanel","Open ticket panel")))}observeLayout(e){let t=()=>{let i=e.clientWidth;if(i<=0)return;let r=e.clientHeight,s=i!==this.pickerLayoutSize.width||r!==this.pickerLayoutSize.height;this.pickerLayoutSize={width:i,height:r},this.reportFramedHeight();let o=i<640?"narrow":"wide",a=r<560?"compact":"comfortable";(e.dataset.layout!==o||e.dataset.density!==a)&&(e.dataset.layout=o,e.dataset.density=a,o==="narrow"&&!e.dataset.sheet&&(e.dataset.sheet="peek"),this.dockLayoutChrome(),this.syncMinimapForLayout(),this.lastTrayKeys.size&&this.syncTray()),s&&(this.minimap?.refreshMinimap(),this.fitSectionStripCount())};this.ro=new ResizeObserver(t),this.ro.observe(e),t(),requestAnimationFrame(t)}async loadChart(e,t,i){let r=performance.now(),s=await this.controller.render(e);return t.loadChartAndStatuses=i(r),this.destroyed?null:s?(Object.assign(t,s.performanceProfile),s):(Me({apiBase:this.apiBase,event:this.opts.event,scope:this.performanceGroup?.surface??(this.performanceGroup?"performance_group":"event"),surface:this.performanceGroup?.surface==="season"?"season_picker":this.performanceGroup?"performance_group_picker":"seat_picker",outcome:"failure",stage:"load_chart",ms:t.loadChartAndStatuses,performanceProfile:t,view:"map",load:ze(this.opts.event),transport:this.opts.transport?"custom":"pubapi"}),this.els.boot.innerHTML=`<div class="sl-boot-title">${this.tf("picker.mapDidNotLoad","The seat map didn\u2019t load")}</div><div>${this.tf("picker.checkConnection","Check your connection and try again.")}</div><button type="button" class="sl-boot-retry">${this.tf("picker.accessRetry","Try again")}</button>`,this.els.boot.querySelector("button").addEventListener("click",()=>{let o=this.opts.container,a=this.opts;this.destroy(),new n({...a,container:o}).render()}),null)}resumeHostedOrder(){if(this.checkoutMode!=="hosted")return;let e=Ho(this.opts.event);e?.outcome!=="success"||!e.orderId||this.openCheckoutPanel({kind:"resume",orderId:e.orderId})}buildPanelToggle(){if(!this.regions["top-right"])return;let e=document.createElement("button");e.type="button",e.className="sl-side-toggle",e.addEventListener("click",()=>this.setPanelCollapsed(!this.sideCollapsed)),this.sideToggleEl=e,this.regions["top-right"].appendChild(e),this.syncPanelToggle()}syncPanelToggle(){let e=this.sideToggleEl;if(!e)return;let t=this.sideCollapsed;e.setAttribute("aria-expanded",String(!t)),e.setAttribute("aria-label",t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel")),e.title=t?this.tf("picker.showTicketPanel","Show the ticket panel"):this.tf("picker.hideTicketPanel","Hide the ticket panel"),e.innerHTML=t?`<svg viewBox="0 0 24 24"><path d="M15 6l-6 6 6 6"/></svg><span>${this.tf("picker.tickets","Tickets")}</span>`:'<svg viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></svg>'}setPanelCollapsed(e){this.destroyed||(this.sideCollapsed=e,this.applyPanelCollapsed(),this.scheduleMotion(()=>this.controller.refitCurrentView(),340))}applyPanelCollapsed(){let e=this.root?.dataset.layout!=="narrow";this.root?.setAttribute("data-side-collapsed",String(this.sideCollapsed)),this.els.side?.toggleAttribute("inert",this.sideCollapsed&&e),this.syncPanelToggle()}buildAccessibilityMenu(e){let t=this.regions["bottom-left"]??this.els.map;t&&(this.a11yMenu=new Fi(t,{event:String(this.opts.event),chart:()=>this.controller.doc?.name??null,needs:()=>this.controller.getAccessNeeds(),hasLimitedView:e,tf:(i,r)=>this.tf(i,r),isColorblindSafe:()=>this.cbSafe,setColorblindSafe:i=>this.setColorblindSafe(i),isLimitedViewHidden:()=>this.limitedViewFilter,setLimitedViewHidden:i=>{this.limitedViewFilter=i,this.controller.setCommercialLimitedFilter(i),this.pushAvailabilityTo3d()},applyAccessibilityFilter:i=>{this.controller.setAccessibilityFilter(i),this.syncPrices(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},focusSeatsForFilter:()=>this.focusSeatsForFilter()}),this.cbEl=this.a11yMenu.colorblindRow())}focusSeatsForFilter(){this.controller.focusAccessibilityFilter?.()||this.rungsEl&&this.controller.getRung()!=="seats"&&(this.controller.setRung("seats"),this.collapseSectionCard(),this.syncRung())}setAccessibilityFilter(e){this.controller.setAccessibilityFilter(e),this.a11yMenu?.syncAccessibilityFilter(e),this.pushAvailabilityTo3d()}dockLayoutChrome(){let e=this.root?.dataset.layout==="narrow";this.applyPanelCollapsed();let t=this.els.zfs,i=this.els.headInfo?.parentElement;t&&i&&t.parentElement!==i&&(t.classList.add("sl-fs-pill"),i.insertBefore(t,this.els.hold??null));let r=this.els.pricesSec;r&&(e?(r.setAttribute("role","button"),r.tabIndex=0,r.setAttribute("aria-expanded",String(this.root?.getAttribute("data-prices-open")==="true"))):(r.removeAttribute("role"),r.removeAttribute("aria-expanded"),r.tabIndex=-1)),this.lastSection&&this.renderSectionCard(this.lastSection)}buildExtendPrompt(){let e=document.createElement("div");e.className="sl-extend",e.setAttribute("role","status"),e.innerHTML='<span class="sl-extend-txt" data-ref="extendTxt"></span><button type="button" class="sl-extend-btn" data-ref="extendBtn"></button>',(this.regions["bottom-center"]??this.els.map).appendChild(e),this.extendEl=e,this.els.extendTxt=e.querySelector('[data-ref="extendTxt"]'),this.els.extendBtn=e.querySelector('[data-ref="extendBtn"]'),this.els.extendBtn.textContent=this.tf("picker.addTime","Add time"),this.els.extendBtn.addEventListener("click",()=>{this.handleExtend()})}buildBookedOverlay(){let e=document.createElement("div");e.className="sl-booked",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<div class="sl-booked-badge"><svg viewBox="0 0 24 24"><path d="M20 6L9 17l-5-5"/></svg></div><div class="sl-booked-title">${this.tf("picker.allSetTitle","You're all set")}</div><div class="sl-booked-sub" data-ref="bookedSub"></div><ul class="sl-booked-list" data-ref="bookedList"></ul><button type="button" class="sl-booked-back" data-ref="bookedBack"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${_(this.tf("picker.backToMap","Back to map"))}</span></button>`,this.root.appendChild(e),this.bookedEl=e,this.els.bookedSub=e.querySelector('[data-ref="bookedSub"]'),this.els.bookedList=e.querySelector('[data-ref="bookedList"]'),e.querySelector('[data-ref="bookedBack"]')?.addEventListener("click",()=>this.dismissBooked())}get onGAPromptHook(){return this.opts.onGAPrompt}tf(e,t){return y(e,t)}buildSoldoutOverlay(){if(!this.els.map)return;let e=document.createElement("div");e.className="sl-soldout",e.setAttribute("role","status");let t=(this.controller.doc?.theme?.brandName??this.opts.theme?.brandName??this.els.name?.textContent??this.tf("picker.soldOutEyebrow","This event")).toUpperCase(),i=document.createElement("div");i.className="sl-soldout-eyebrow",i.textContent=t;let r=document.createElement("div");r.className="sl-soldout-title",r.textContent=this.tf("picker.soldOutTitle","Sold out");let s=document.createElement("p");s.className="sl-soldout-copy",s.textContent=this.tf("picker.soldOutCopy","No reserved seats are currently available for this event."),e.append(i,r,s),this.els.map.appendChild(e),this.soldoutEl=e}syncSoldout(e,t){let i=this.controller.getGAAreas().length>0,r=this.isSoldOut(e,t,i);r!==this.soldOut&&(this.soldOut=r,this.soldoutEl?.classList.toggle("on",r))}isSoldOut(e,t,i){return!i&&e.length>0&&e.every(r=>(t[r.key]??0)===0)}setSalesClosed(e){let t=e||!!this.opts.readOnly;this.salesClosed!==t&&(this.salesClosed=t,this.applySalesClosed())}applySalesClosed(){this.salesClosed&&this.tableDialog&&!this.tableDialogHeld&&this.cancelTableDialog();let e=this.els.closedPill;if(e){e.classList.toggle("on",this.salesClosed);let t=this.els.closedPillText??e;t.textContent=this.tf("picker.salesClosedPill","Sales are closed")}this.root?.setAttribute("data-sales-closed",String(this.salesClosed)),this.salesClosed&&this.srEl&&(this.srEl.textContent=this.tf("picker.salesClosedToast","Sales are closed for this event.")),this.syncCta(),this.syncTray()}badgeHidden(e){return!!(this.opts.hideBadge||e?.hideBadge)}buildBadge(e){if(this.badgeHidden(e))return;let t=this.els.foot;if(!t)return;let i=document.createElement("a");i.className="sl-powered",i.href="https://seatlayer.io/?ref=picker",i.target="_blank",i.rel="noopener noreferrer",i.setAttribute("aria-label",this.tf("picker.poweredBy","Powered by SeatLayer"));let r=document.createElement("span");r.className="sl-powered-mark",r.setAttribute("aria-hidden","true"),r.innerHTML=vi;let s=document.createElement("span");s.textContent=this.tf("picker.poweredBy","Powered by SeatLayer"),i.append(r,s),t.appendChild(i)}buildRegions(){if(!this.els.map)return;let e=["top-left","top-center","top-right","left-rail","bottom-left","bottom-center","bottom-right"];for(let t of e){let i=document.createElement("div");i.className="sl-anchor",i.dataset.region=t,this.els.map.appendChild(i),this.regions[t]=i}}cssVar(e){return this.root?getComputedStyle(this.root).getPropertyValue(e).trim():""}reducedMotion(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}scheduleMotion(e,t){let i=setTimeout(()=>{this.motionTimers.delete(i),this.destroyed||e()},t);this.motionTimers.add(i)}animateOnce(e,t,i=600){!e||this.reducedMotion()||(e.classList.remove(t),e.offsetWidth,e.classList.add(t),this.scheduleMotion(()=>e.classList.remove(t),i))}flashPickedSeat(e){this.reducedMotion()||this.controller.flashSeat(e,this.cssVar("--sl-accent")||"#f4b740")}flashHeldSeats(e){if(this.reducedMotion())return;let t=(e.items??[]).filter(i=>i.objectType!=="ga").slice(0,10).map(i=>this.controller.seatByLabel(i.label)).filter(i=>!!i);Bs({regions:this.els,categories:this.controller.doc?.categories,pop:i=>this.controller.flashSeat(i,this.cssVar("--sl-accent")||"#f4b740"),focus:(i,r)=>this.controller.focusSection(i,r),screenPoint:i=>this.controller.worldToScreen(i),schedule:(i,r)=>this.scheduleMotion(i,r)},t)}committedSelection(){let e=this.confirmSeat?.id,t=this.tableDialog&&!this.tableDialogHeld?this.tableDialog.id:null;return this.controller.getSelection().filter(i=>i.id!==e&&i.id!==t)}pendingSelectionCount(){let e=this.hold?.items??[],t=new Set(e.map(r=>r.label));return this.committedSelection().filter(r=>!t.has(r.label)).reduce((r,s)=>r+(s.quantity??1),0)+Ye(this.gaQty,this.hold?.items??[])}heldTicketCount(){return(this.hold?.items??[]).reduce((e,t)=>e+(t.quantity??1),0)}totalTicketCount(){let e=new Set((this.hold?.items??[]).map(i=>i.label)),t=this.committedSelection().filter(i=>!e.has(i.label)).reduce((i,r)=>i+(r.quantity??1),0);return this.heldTicketCount()+t+Ye(this.gaQty,this.hold?.items??[])}updateSelectionCapacity(){let e=new Set((this.hold?.items??[]).map(r=>r.label)),t=this.committedSelection().filter(r=>e.has(r.label)).reduce((r,s)=>r+(s.quantity??1),0),i=Math.max(0,this.maxTickets-this.heldTicketCount()-Ye(this.gaQty,this.hold?.items??[]));this.controller.setMaxSelection(t+i)}syncCta(e=this.lastTrayCount,t=this.pendingSelectionCount()){let i=this.els.cta;if(!i)return;if(this.salesClosed){i.disabled=!0,i.textContent=this.tf("picker.salesClosedCta","Sales closed");return}if(this.confirmSeat||this.tableDialog&&!this.tableDialogHeld){i.disabled=!0,i.textContent=this.tableDialog?this.tf("picker.confirmYourTable","Confirm your table"):this.tf("picker.confirmOrCancelSeat","Confirm or cancel this seat");return}if(this.ctaPhase==="holding"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.securingSeats","Securing your seats\u2026")}`;return}if(this.ctaPhase==="checkout"){i.disabled=!0,i.innerHTML=`<span class="sl-cta-spin" aria-hidden="true"></span>${this.tf("picker.openingCheckout","Opening secure checkout\u2026")}`;return}let r=!this.hold&&this.performanceGroup?.selectionMode==="per_performance"?this.performanceGroup.submissionState?.():null;if(r&&!r.ready){i.disabled=!0,i.textContent=this.tf("picker.completeAllPerformances","Complete all performances ({complete}/{total})").replace("{complete}",String(r.complete)).replace("{total}",String(r.total));return}let s=this.controller.getSelectionValidity(e);if(s&&!s.isValid){i.disabled=!0,i.textContent=Rn(s,(o,a)=>this.tf(o,a),!0);return}i.disabled=e===0,i.textContent=this.hold?t?(0,C.t)("picker.secureMoreAndCheckout",{count:t}):this.tf("picker.continueToCheckout","Continue to checkout"):e?this.performanceGroup?this.tf("picker.holdSeatsForAllPerformances","Hold seats for all {count} performances").replace("{count}",String(this.performanceGroup.performanceCount)):this.tf("picker.holdSeatsAndCheckout","Hold seats & checkout"):this.tf("picker.selectSeats","Select seats")}setCtaPhase(e){this.ctaPhase=e,this.syncCta(),this.renderPeek(this.lastTrayCount,this.lastTrayTotal,this.pendingSelectionCount())}async runCheckoutHandoff(e,t){this.setCtaPhase("checkout");try{await this.checkoutHandoff(e,t)}finally{this.ctaPhase==="checkout"&&!this.bookedShown&&this.setCtaPhase("idle")}}holdStorageKey(){return`@seatlayer/hold/v1/${encodeURIComponent(this.apiBase)}/${encodeURIComponent(this.opts.event)}`}rememberedHoldId(){if(this.opts.initialHoldId)return this.opts.initialHoldId;if(this.opts.restoreHold===!1||typeof window>"u")return null;try{return window.sessionStorage.getItem(this.holdStorageKey())}catch{return null}}rememberHold(e){if(!(this.opts.restoreHold===!1||typeof window>"u"))try{window.sessionStorage.setItem(this.holdStorageKey(),e.holdId)}catch{}}forgetHold(){if(!(typeof window>"u"))try{window.sessionStorage.removeItem(this.holdStorageKey())}catch{}}async resumeHoldFromServer(e,t){try{let i=await this.controller.resumeHold(e);if(!i||this.destroyed)return null;let r={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items};return this.hold=r,this.handedOff=!0,this.bookedShown=!1,this.ctaPhase="idle",this.startHoldTimer(r.expiresAt),this.rememberHold(r),this.syncTray(),this.emitHoldChange(),this.opts.onHoldRestored?.(r,r.seats??[],this.buildHandoff(r)),t&&this.toast(this.tf("picker.heldTicketsRestored","Your held tickets have been restored."),"success"),r}catch(i){let r=i?.status;return r===404||r===409?this.forgetHold():this.opts.onError?.(i),null}}async restoreRememberedHold(){let e=this.rememberedHoldId();e&&await this.resumeHoldFromServer(e,!0)}activeFloorObjects(){let e=this.controller.doc;if(!e)return[];let t=e.floors;if(t?.length){let i=this.controller.getActiveFloorId();return(t.find(r=>r.id===i)??t[0]).objects??[]}return e.objects??[]}buildMinimap(){!this.els.map||this.root?.dataset.layout==="narrow"||(this.minimap=Ts({controller:this.controller,root:()=>this.root,cssVar:e=>this.cssVar(e),focusedSectionLabel:()=>this.lastSection?.label},this.regions["bottom-left"]??this.els.map))}syncMinimapForLayout(){let e=this.root?.dataset.layout==="narrow";if(e&&this.minimap){this.minimap.dispose(),this.minimap=null;return}!e&&!this.minimap&&this.buildMinimap()}catPrice(e){return Ni(this,e)}catPriceRange(e){return $i(this,e)}buildPriceFilter(){if(this.suppressPricing||!this.els.prices||!this.els.pricesSec)return;let e=es(this.controller.doc?.categories??[],this.legendDeps());if(e.length<2)return;let t=document.createElement("select");t.className="sl-price-select",t.setAttribute("aria-label",this.tf("picker.filterAndFocusByPrice","Filter and focus seats by price"));let i=document.createElement("option");i.value="all",i.textContent=this.tf("picker.allPrices","All prices"),t.appendChild(i);for(let r of e){let s=document.createElement("option");s.value=r.id,s.textContent=r.label,t.appendChild(s)}this.els.pricesSec.appendChild(t),this.priceSelect=t,t.addEventListener("change",()=>{this.applyPriceBand(e.find(r=>r.id===t.value)?.keys??null)})}applyPriceBand(e){if(this.focusedCatKey=null,this.priceBandKeys=e?new Set(e):null,this.priceSelect){let t=e?this.priceSelect.value:"all";this.priceSelect.value!==t&&(this.priceSelect.value=t)}this.controller.setCategoryFilter(e),this.controller.focusCategoryFilter(e),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)}buildArenaChrome(){let e=this.controller.doc;if(!e||!this.els.map)return;let t=e.objects.some(i=>i.type==="section")||(e.floors??[]).some(i=>i.objects.some(r=>r.type==="section"));if(this.canOffer3d()){let i=document.createElement("div");i.className="sl-projection",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.venueView","Venue view")),i.innerHTML=`<button type="button" data-view="map" aria-pressed="true" title="${this.tf("picker.flat2dMap","Flat 2D map")}">${this.tf("picker.map","Map")}</button><button type="button" data-view="venue3d" aria-pressed="false" title="${this.tf("picker.interactive3dVenueView","Interactive 3D venue view")}">3D</button>`,i.querySelectorAll("button").forEach(r=>{if(r.dataset.view==="venue3d")for(let s of["pointerenter","focus","pointerdown"])r.addEventListener(s,hn,{once:!0});r.addEventListener("click",()=>{this.setBuyerView(r.dataset.view)})}),this.regions["top-right"].appendChild(i),this.projectionEl=i,this.syncProjection()}if(t){let i=[...e.objects,...(e.floors??[]).flatMap(d=>d.objects)],r=new Set((e.zones??[]).map(d=>d.id)),o=i.some(d=>d.type==="section"&&typeof d.zone=="string"&&r.has(d.zone))?["zones","sections","seats"]:["sections","seats"],a=document.createElement("div");a.className="sl-rungs on sl-mo-indicator",a.setAttribute("role","group"),a.setAttribute("aria-label",(0,C.t)("picker.zoomLevel"));let l={zones:(0,C.t)("picker.rungLabel.zones"),sections:(0,C.t)("picker.rungLabel.sections"),seats:(0,C.t)("picker.rungLabel.seats")},c={zones:(0,C.t)("picker.rungTip.zones"),sections:(0,C.t)("picker.rungTip.sections"),seats:(0,C.t)("picker.rungTip.seats")};a.innerHTML=o.map(d=>`<button type="button" data-rung="${d}" title="${c[d]}" aria-pressed="false">${l[d]}</button>`).join(""),a.querySelectorAll("button").forEach(d=>{d.addEventListener("click",()=>{let p=d.dataset.rung;this.controller.setRung(p),p==="seats"&&this.collapseSectionCard()})}),this.regions["top-center"].appendChild(a),this.rungsEl=a,this.syncRung()}if(this.controller.isMultiFloor()){let i=ws({floors:this.controller.getFloors(),tf:(r,s)=>this.tf(r,s),onChoose:r=>{r===""?this.controller.setFloorOverview(!0):this.controller.setFloor(r),this.showSectionCard(null),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap()}});this.regions["left-rail"].appendChild(i),this.floorsEl=i,this.syncFloors()}}syncRung(){let e=this.controller.getRung(),t=this.controller.seatsRevealed?.()??(e==="seats"||!!this.controller.getFocusedSection?.());this.root&&(this.root.dataset.zoomed=String(t)),this.minimap?.setAutoOpen(!1),this.rungsEl&&this.rungsEl.querySelectorAll("button").forEach(i=>{let r=i.dataset.rung===e;i.classList.toggle("on",r),i.setAttribute("aria-pressed",String(r))})}syncProjection(){this.els.pricesHint&&(this.els.pricesHint.textContent=this.buyerView==="venue3d"?this.tf("picker.priceHint3d","Colours in the venue are ticket types \u2014 choose one below to show just those seats."):this.tf("picker.priceHint","Colours on the map are ticket types \u2014 tap one below to show just those seats.")),this.projectionEl&&this.projectionEl.querySelectorAll("button").forEach(e=>{let t=e.dataset.view===this.buyerView;e.classList.toggle("on",t),e.setAttribute("aria-pressed",String(t))})}canOffer3d(){return this.opts.enable3D===!1||!this.controller.doc||!yi()?!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)?Oo/2:Oo}syncFloors(){ks(this.floorsEl,this.controller.getActiveFloorId(),this.controller.isFloorOverview())}get sectionCard(){return this.sectionCardCache||(this.sectionCardCache=new Oi({controller:this.controller,map:()=>this.els.map,root:()=>this.root,collapseSheet:()=>this.collapseSheet(),region:e=>this.regions[e],refreshMinimap:()=>this.minimap?.refreshMinimap(),activeFloorObjects:()=>this.activeFloorObjects(),sectionNeighbours:e=>this.sectionNeighbours(e),catPriceRange:e=>this.catPriceRange(e),money:e=>this.money(e),suppressPricing:()=>this.suppressPricing,priceBandKeys:()=>this.priceBandKeys})),this.sectionCardCache}showSectionCard(e){this.sectionCard.show(e)}renderSectionCard(e){this.sectionCard.render(e)}collapseSectionCard(){this.sectionCard.collapse()}sectionCardOnView(){this.sectionCard.onView()}fitSectionStripCount(){this.sectionCard.fitStripCount()}sectionNeighbours(e){let t=this.activeFloorObjects().filter(r=>r.type==="section"&&!this.controller.isSectionClosed(r.id)&&this.controller.getSectionSeatCount(r.id)>0);if(t.length<2)return null;let i=t.findIndex(r=>r.id===e);return i<0?null:{previous:t[(i-1+t.length)%t.length],next:t[(i+1)%t.length]}}markedSeatAnnouncement(e){let t=Nn(this.controller.getRenderer()?.getSeatMark?.(e.id),this.performanceGroup?.nights?.());return bo(t,e.displayLabel??e.label,this.opts.locale)}announceSeat(e){if(!this.srEl)return;if(!e){this.srEl.textContent="";return}let t=this.markedSeatAnnouncement(e);if(t){this.srEl.textContent=t;return}let i=this.controller.doc?.categories.find(h=>h.key===e.categoryKey),r=this.controller.getStatus(e.id)??"free",s=r==="free"?this.tf("picker.statusAvailable","available"):r==="held"?this.tf("picker.statusOnHold","on hold"):this.tf("picker.statusTaken2","taken"),o=i?this.catPriceRange(i):void 0,a=!this.suppressPricing&&o?o.min===o.max?this.money(o.min):`${this.money(o.min)}\u2013${this.money(o.max)}`:void 0,l=this.controller.tableSelection(e.id),c=l??this.controller.seatDetails(e.id),d=Tt(c),p=c?.rowLabel??c?.displayLabel??e.displayLabel??e.label,u=l?`${d} ${p}, ${l.bookingMode==="variable"?(0,C.t)("picker.minToMaxGuests",{min:l.minOccupancy,max:l.maxOccupancy}):(0,C.t)("picker.capacityGuests",{count:l.capacity})}`:c?.objectType==="booth"?`${d} ${p}`:c?.objectType==="table"?`${d} ${p}, ${(0,C.t)("picker.seatNumberLower",{label:c.seatNumber??e.label})}`:(0,C.t)("picker.seatLabel",{label:c?.displayLabel??e.displayLabel??e.label});this.srEl.textContent=`${u}, ${i?.label??e.categoryKey}${a?`, ${a}`:""}, ${s}`}showTableDialog(e,t,i){this.dismissTableDialog(!1),this.tableDialog={...e},this.tableDialogHeld=t,this.tableDialogReturnFocus=i??document.activeElement;let r=this.controller.doc?.categories.find(a=>a.key===e.categoryKey),s=e.bookingMode==="variable",o=document.createElement("div");o.className="sl-table-scrim",o.innerHTML=vs(e,{variable:s,held:t,typeWord:Tt(e),categoryLabel:r?.label??e.categoryKey,suppressPricing:this.suppressPricing,unitPrice:this.money(this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label))}),this.root.appendChild(o),this.tableDialogEl=o,this.renderTableDialogState(),o.querySelectorAll("[data-table-step]").forEach(a=>{a.addEventListener("click",()=>{if(!this.tableDialog)return;let l=Math.max(this.tableDialog.minOccupancy,Math.min(this.tableDialog.maxOccupancy,this.tableDialog.quantity+Number(a.dataset.tableStep)));this.tableDialog={...this.tableDialog,quantity:l},this.renderTableDialogState()})}),o.querySelector(".sl-table-cancel").addEventListener("click",()=>this.cancelTableDialog()),o.querySelector(".sl-table-confirm").addEventListener("click",()=>{this.confirmTableDialog()}),o.addEventListener("mousedown",a=>{a.target===o&&this.cancelTableDialog()}),o.addEventListener("keydown",a=>{if(a.key!=="Tab")return;let l=[...o.querySelectorAll('button:not(:disabled),[tabindex]:not([tabindex="-1"])')];if(!l.length)return;let c=l[0],d=l[l.length-1];a.shiftKey&&document.activeElement===c?(a.preventDefault(),d.focus()):!a.shiftKey&&document.activeElement===d&&(a.preventDefault(),c.focus())}),requestAnimationFrame(()=>o.querySelector(s?'[data-table-step="-1"]':".sl-table-confirm")?.focus())}renderTableDialogState(){let e=this.tableDialog,t=this.tableDialogEl;if(!e||!t)return;let i=t.querySelector("output[data-table-qty]");i&&(i.value=String(e.quantity));let r=t.querySelector("input[data-table-qty]");r&&(r.value=String(e.quantity)),t.querySelectorAll("[data-table-step]").forEach(a=>{let l=Number(a.dataset.tableStep);a.disabled=l<0?e.quantity<=e.minOccupancy:e.quantity>=e.maxOccupancy});let s=this.paidPrice(e.categoryKey,e.tierId??null,e.price,e.label),o=t.querySelector("[data-table-total]");o&&(o.textContent=this.money(s*e.quantity))}async confirmTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;if(!e)return;let i=this.tableDialogEl?.querySelector(".sl-table-confirm");if(i&&(i.disabled=!0,i.textContent=t?this.tf("picker.updatingEllipsis","Updating\u2026"):this.tf("picker.selectingEllipsis","Selecting\u2026")),t){try{let r=await this.controller.replaceTableQuantity(e.label,e.quantity,this.opts.holdTtlMs);if(!r){this.toast(this.tf("picker.guestCountCouldNotBeSecured","That guest count could not be secured. Your current table hold is unchanged."),"warning"),this.renderTableDialogState(),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"));return}this.hold={holdId:r.holdId,expiresAt:r.expiresAt,seats:r.seats,items:r.items},this.startHoldTimer(r.expiresAt),this.dismissTableDialog(),this.syncTray(),this.emitHoldChange(),this.toast((0,C.t)("picker.tableUpdatedForGuests",{label:e.label,count:e.quantity}),"success")}catch(r){this.opts.onError?.(r),this.toast(this.tf("picker.guestCountNoLongerAvailable","That guest count is no longer available. Your current hold is unchanged."),"error"),i&&(i.disabled=!1,i.textContent=this.tf("picker.updateTable","Update table"))}return}if(!this.controller.setTableQuantity(e.label,e.quantity)){i&&(i.disabled=!1,i.textContent=e.bookingMode==="variable"?this.tf("picker.selectTable","Select table"):this.tf("picker.selectWholeTable","Select whole table"));return}this.dismissTableDialog(),this.collapseSectionCard(),this.syncTray()}cancelTableDialog(){let e=this.tableDialog,t=this.tableDialogHeld;this.dismissTableDialog(),e&&!t&&this.controller.deselect(e.physicalSeatIds)}dismissTableDialog(e=!0){let t=this.tableDialogReturnFocus;this.tableDialogEl?.remove(),this.tableDialogEl=null,this.tableDialog=null,this.tableDialogHeld=!1,this.tableDialogReturnFocus=null,e&&requestAnimationFrame(()=>(t?.isConnected?t:this.root)?.focus())}showConfirm(e){let t=this.confirmSeat?.id;this.confirmEl?.remove(),this.confirmEl=null,this.confirmSeat=e,this.root?.setAttribute("data-confirming","true"),this.els.side?.toggleAttribute("inert",!0),Object.values(this.regions).forEach(x=>x.toggleAttribute("inert",!0)),this.controller.setSelectionFocus(e.id),t&&t!==e.id&&this.controller.deselect([t]),this.tipEl&&(this.tipEl.style.display="none");let i=this.controller.seatDetails(e.id),r=this.controller.doc?.categories.find(x=>x.key===e.categoryKey),s=i?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),o=s!=null?this.paidPrice(e.categoryKey,i?.tierId??r?.tiers?.[0]?.id??null,s,e.label):void 0,a=ps(i,e.displayLabel??e.label,Tt(i)),l=i?.tiers??r?.tiers??[],c=i?.tierId??l[0]?.id,d=this.suppressPricing?"":ms(l,c,x=>this.money(this.paidPrice(e.categoryKey,x.id,x.price,e.label))),p=this.buyerView==="venue3d",u=this.performanceGroup?.confirmDateSelection??void 0,h=u?this.performanceGroup?.nights?.()??[]:[],g=u?uo(h,u,e.id,(x,I)=>this.tf(x,I)):"",m=document.createElement("div");m.className="sl-confirm sl-mo-in",g&&m.classList.add("sl-confirm-group-dates"),m.setAttribute("role","dialog"),m.setAttribute("aria-label",(0,C.t)("picker.confirmSeatLabel",{label:e.label}));let v=r?.color??"#6e7bff";m.style.setProperty("--sl-cat",v);let k=String(i?.categoryLabel??r?.label??e.categoryKey),S=this.controller.categoryAvailability()[e.categoryKey],L=typeof S=="number"&&S>0?(0,C.tCount)("picker.leftCount",S):"";m.innerHTML=bs({identityFields:a,identity:hs(i,e.displayLabel??e.label,Tt(i)),marker:Ri(i?.wheelchairSpaceType),see3dPill:us(this.canOffer3d(),p),categoryColor:r?.color??"#6e7bff",categoryLabel:k,priceLabel:!this.suppressPricing&&o!=null?this.money(o):"",categoryLeftLabel:L,tierChoices:d,groupDates:g,wheelchair:as(i?.wheelchairSpaceType),commercial:os(e.commercial),thumb:this.seatViewEnabled()&&this.buyerView!=="venue3d"?this.confirmThumbHtml(e):"",inspect:p?`${ds(e,this.suppressPricing?`${i?.displayLabel??e.displayLabel??e.label}`:`${i?.displayLabel??e.displayLabel??e.label} \xB7 ${o==null?this.tf("picker.priceNotSupplied","Price not supplied"):this.money(o)}`,p)}<div class="sl-confirm-inspect-row">${cs(e,p?this.view3dCompareSeatIds:null)}${kn(this.canOffer3d(),p)}</div>`:kn(this.canOffer3d(),p),cancelLabel:(0,C.t)("common.cancel"),selectLabel:this.addSeatLabel(i?.objectType)}),this.els.map.appendChild(m),this.confirmEl=m;let b=m.querySelector(".sl-confirm-thumb"),E=b?.closest(".sl-confirm-thumbwrap")??null;if(b&&E){let x=!1,I=()=>{if(x||!E.isConnected)return;x=!0;let T=()=>{E.remove(),this.confirmEl===m&&this.reanchorConfirm()};if(this.reducedMotion()||typeof requestAnimationFrame!="function"){T();return}E.style.height=`${E.offsetHeight}px`,E.classList.add("sl-confirm-thumb-out"),requestAnimationFrame(()=>{E.style.height="0px",E.style.opacity="0"}),setTimeout(T,ac)};b.addEventListener("error",I),b.addEventListener("load",()=>{b.naturalWidth||I()});let R=e.viewMeta?.previewUrl??e.viewUrl;R?this.buyerAssetUrls.resolve(R).then(T=>{if(!(!m.isConnected||this.confirmEl!==m)){if(!T){I();return}b.src=T}}).catch(T=>{I(),this.opts.onError?.(T)}):I()}this.reanchorConfirm(),m.querySelector(".sl-confirm-view")?.addEventListener("click",()=>{this.openSeatView(e)}),m.querySelector(".sl-confirm-confidence")?.addEventListener("click",x=>{this.openSeatConfidencePassport(e,x.currentTarget instanceof HTMLElement?x.currentTarget:null)}),m.querySelector(".sl-confirm-compare")?.addEventListener("click",()=>this.saveView3dComparisonSeat(e)),m.querySelectorAll("[data-confirm-tier]").forEach(x=>{x.addEventListener("click",()=>{let I=x.dataset.confirmTier,R=l.find(O=>O.id===I);if(!R)return;this.controller.setSeatTier(e.id,R.id),m.querySelectorAll("[data-confirm-tier]").forEach(O=>{O.setAttribute("aria-pressed",String(O===x))});let T=m.querySelector(".sl-confirm-price");T&&(T.textContent=this.money(this.paidPrice(e.categoryKey,R.id,R.price,e.label))),this.reanchorConfirm()})}),m.querySelectorAll(".sl-confirm-3d,.sl-confirm-3dpill").forEach(x=>{x.addEventListener("pointerdown",hn,{once:!0}),x.addEventListener("click",()=>{this.buyerView==="venue3d"?(this.dismissConfirm(),this.view3dHandle?.flyToSeat(e.id)):(this.view3dReturnSeat=e,this.dismissConfirm(),this.enter3d(e.id))})}),fo(m,u,(x,I)=>this.tf(x,I),()=>this.reanchorConfirm()),m.querySelector(".sl-confirm-add").addEventListener("click",()=>{this.commitConfirm()}),m.querySelector(".sl-confirm-cancel").addEventListener("click",()=>this.cancelConfirm()),requestAnimationFrame(()=>{let x=m.querySelector(".sl-confirm-add");x?.focus(),this.liftToastOverConfirm(),this.inviteCommit(m,x)})}inviteCommit(e,t){if(!t||this.reducedMotion())return;t.classList.add("sl-confirm-add-invite");let i=()=>t.classList.remove("sl-confirm-add-invite");e.addEventListener("pointerdown",i,{once:!0}),e.addEventListener("keydown",i,{once:!0}),t.addEventListener("focus",i,{once:!0})}addSeatLabel(e){return e&&e!=="seat"?this.tf("picker.select","Select"):this.tf("picker.addSeat","Add seat")}reanchorConfirm(){if(!this.confirmEl||!this.confirmSeat||this.root?.dataset.view3d==="on")return;let e=this.controller.worldToScreen({x:this.confirmSeat.x,y:this.confirmSeat.y});if(this.root?.dataset.layout==="narrow"){let l=Ao(e.y,{height:this.els.map.clientHeight},{height:this.confirmEl.offsetHeight||230});l.placement==="above"?(this.confirmEl.dataset.placement="above",this.confirmEl.style.bottom=`${l.bottom}px`):(this.confirmEl.removeAttribute("data-placement"),this.confirmEl.style.removeProperty("bottom")),dr(this.confirmEl,e,this.els.map),this.liftToastOverConfirm();return}let t=this.els.map.clientWidth,i=this.els.map.clientHeight,r=this.confirmEl.offsetWidth||276,s=this.confirmEl.offsetHeight||230,o=this.confirmEl.classList.contains("sl-confirm-group-dates"),a=Po(e,{width:t,height:i},{width:r,height:s},o);this.confirmEl.dataset.placement=a.placement,this.confirmEl.style.left=`${a.left}px`,this.confirmEl.style.top=`${a.top}px`,fi(this.confirmEl,e,{left:a.left,top:a.top,width:r,height:s})}dismissConfirm(){this.confirmEl&&Ne(this.confirmEl),this.confirmEl=null,this.confirmSeat=null,this.liftToastOverConfirm(),this.root?.removeAttribute("data-confirming"),Object.values(this.regions).forEach(e=>e.toggleAttribute("inert",!1)),this.applyPanelCollapsed(),this.controller.setSelectionFocus(null)}async commitConfirm(){let e=this.confirmSeat;if(!e)return;let i=this.confirmEl?.querySelector(".sl-confirm-add")??null;if(i?.classList.contains("is-adding")||!await go(this.confirmEl,e.id,this.performanceGroup?.confirmDateSelection??void 0))return;this.collapseSectionCard(),this.confirmSeat=null,this.syncTray(),this.syncSelectionTo3d();let r=()=>{this.dismissConfirm(),Ln(this.els,this.controller.worldToScreen(e),e,this.controller.doc?.categories)};if(!i||this.reducedMotion()){r();return}i.classList.remove("sl-confirm-add-invite"),i.classList.add("is-adding"),i.setAttribute("aria-disabled","true");let s=i.querySelector(".sl-confirm-add-t");s&&(s.textContent=this.tf("picker.added","Added")),this.scheduleMotion(r,nc)}cancelConfirm(){let e=this.confirmSeat;e&&(this.controller.deselect([e.id]),this.confirmSeat&&this.dismissConfirm(),this.syncSelectionTo3d(),this.root?.focus({preventScroll:!0}))}closeConfirm(){this.dismissConfirm()}seatViewEnabled(){return this.opts.seatView!==!1}allSeats(){return this.allSeatsCache||(this.allSeatsCache=[...this.controller.getExpandedSeats()]),this.allSeatsCache}async openSeatView(e){if(!this.root||!this.seatViewEnabled())return;let t=++this.seatViewGen,i=this.controller.doc,r=this.controller.getActiveFloorId(),s=e.focalPoint??i?.floors?.find(p=>p.id===r)?.focalPoint??i?.focalPoint??{x:0,y:0},o,a,l=!1;if(e.viewUrl){let p,u=null;try{let g=e.viewMeta?.previewUrl;g&&g!==e.viewUrl?(u=await this.buyerAssetUrls.resolve(g),p=e.viewUrl):p=await this.buyerAssetUrls.resolve(e.viewUrl)}catch(g){t===this.seatViewGen&&this.opts.onError?.(g);return}if(t!==this.seatViewGen||!p||e.viewMeta?.previewUrl&&e.viewMeta.previewUrl!==e.viewUrl&&!u||!this.root||!this.seatViewEnabled())return;let h={url:p,...u?{previewUrl:u}:{},...e.viewMeta?.sourceWidth!==void 0?{sourceWidth:e.viewMeta.sourceWidth}:{},...e.viewMeta?.sourceHeight!==void 0?{sourceHeight:e.viewMeta.sourceHeight}:{},...e.viewMeta?.previewWidth!==void 0?{previewWidth:e.viewMeta.previewWidth}:{},...e.viewMeta?.previewHeight!==void 0?{previewHeight:e.viewMeta.previewHeight}:{},...e.viewMeta?.variants?.length?{variants:e.viewMeta.variants}:{},...e.viewMeta?.coverage?{coverage:e.viewMeta.coverage}:{},...e.viewMeta?.capturedAt?{capturedAt:e.viewMeta.capturedAt}:{},...e.viewMeta?.sourceLabel?{sourceLabel:e.viewMeta.sourceLabel}:{}};o=h,a=(0,Jt.seatViewDisclosure)(h),l=(0,Jt.isAuthoredSeatView)(h)}else{let p;try{let{generateSeatPanorama:u}=await xi();p=u(e,s,this.allSeats())}catch(u){t===this.seatViewGen&&this.opts.onError?.(u);return}if(t!==this.seatViewGen||!this.root||!this.seatViewEnabled())return;o={url:p.url,generated:!0},a=(0,C.t)("picker.illustrationCaption",{m:p.distanceM})}this.closeSeatView(!1);let c=(0,C.t)("picker.viewFromSeat",{label:e.label}),d=Ti({root:this.root,source:o,caption:a,real:l,closeLabel:this.tf("picker.close","Close"),dragHint:yt(),viewFromSeatLabel:c,real360Label:(0,C.t)("picker.real360"),previewLabel:(0,C.t)("picker.preview"),resolveAsset:p=>this.buyerAssetUrls.resolve(p),onClose:()=>this.closeSeatView()});this.viewEl=d.element,this.viewCleanup=()=>d.dispose()}closeSeatView(e=!0){e&&(this.seatViewGen+=1),this.viewCleanup?.(),this.viewCleanup=null,this.viewEl?.remove(),this.viewEl=null}money(e){let t=this.opts.pricing?.formatter;if(t)return t(e,this.currency);let i=Number.isInteger(e);return(0,C.formatMoney)(e,this.currency,{locale:this.opts.locale,fallback:(r,s)=>`${r} ${s}`,...i?{minimumFractionDigits:0,maximumFractionDigits:0}:{}})}scheduleOfferBoundary(e){if(this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerBoundaryTimer=null,!this.api.availability||this.destroyed)return;let t=Date.now(),i=ns(e,t);if(i==null)return;let r=6*36e5,s=Math.min(Math.max(i-t+1e3,1e3),r);this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},s)}scheduleOfferRefresh(e){!this.api.availability||this.destroyed||(this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerRefreshTimer=setTimeout(()=>{this.offerRefreshTimer=null,this.refreshOfferAvailability(e)},e?180:0))}async refreshOfferAvailability(e){if(!(!this.api.availability||this.destroyed))try{let t=await this.api.availability(this.opts.event,e);if(this.destroyed)return;let i=Hi(t);if(!i)return;this.offerAvailability=i,this.applyChannelPricing(i.channelPricing),this.scheduleOfferBoundary(i);let r=Ii(i),s={...this.hostPricing?.prices??{},...r},o=Object.keys(s).length>0||this.hostPricing?.formatter?{prices:s,...this.hostPricing?.formatter?{formatter:this.hostPricing.formatter}:{}}:void 0;this.setPricing(o),this.syncOffer(),this.opts.onOfferAvailabilityChange?.(i)}catch{!this.destroyed&&!this.offerBoundaryTimer&&!document.hidden&&(this.offerBoundaryTimer=setTimeout(()=>{this.offerBoundaryTimer=null,!document.hidden&&this.refreshOfferAvailability(!1)},3e4))}}offerPrice(e){return e?this.offerAvailability?.prices.find(t=>t.categoryKey===e)??null:null}applyChannelPricing(e){this.channelByObject.clear(),this.pricesByChannel.clear();for(let t of e?.channels??[])this.pricesByChannel.set(t.channelId,t.priceOverrides);for(let t of e?.objects??[])this.pricesByChannel.has(t.channelId)&&this.channelByObject.set(t.label,t.channelId)}syncOffer(){let e=this.els.offer;if(!e)return;if(this.suppressPricing){e.classList.remove("has"),e.replaceChildren();return}let t=this.offerAvailability,i=t?.release??null,r=i?null:t?.upcoming??null;if(!t||t.state==="closed"||t.state==="sold-out"||!i&&!r){e.classList.remove("has"),e.replaceChildren();return}let s=i??r,o=document.createElement("div");o.className="sl-offer-main";let a=document.createElement("div");a.className="sl-offer-copy";let l=document.createElement("span");l.className="sl-offer-kicker",l.textContent=i?this.tf("picker.currentTicketOffer","Current ticket offer"):this.tf("picker.upcomingTicketOffer","Upcoming ticket offer");let c=document.createElement("strong");c.className="sl-offer-name",c.textContent=s.name||(i?this.tf("picker.currentOffer","Current offer"):this.tf("picker.scheduledOffer","Scheduled offer"));let d=document.createElement("span");d.className="sl-offer-line";let p=[];i&&t.fromPrice!=null&&p.push(this.money(t.fromPrice/100)),i&&s.remaining!=null&&p.push((0,C.t)("picker.offerRemainingAvailable",{count:s.remaining})),i&&s.endsAt!=null&&p.push((0,C.t)("picker.offerUntil",{time:wi(s.endsAt,this.eventTimezone,this.opts.locale)})),r?.startsAt!=null&&p.push((0,C.t)("picker.offerStarts",{time:wi(r.startsAt,this.eventTimezone,this.opts.locale)})),d.textContent=p.join(" \xB7 "),a.append(l,c,d);let u=document.createElement("details");u.className="sl-offer-info";let h=document.createElement("summary");h.setAttribute("aria-label",(0,C.t)("picker.howOfferWorks",{name:c.textContent??""})),h.textContent="i";let g=document.createElement("div");g.className="sl-offer-detail",g.textContent=i?this.tf("picker.offerDetailActive","This price applies automatically to eligible seats. Tickets in active carts temporarily reduce the available quantity; released or expired holds return it. When the offer ends, the next matching offer or normal ticket price takes over."):this.tf("picker.offerDetailUpcoming","Tickets are available at their normal price now. This scheduled offer will apply automatically to eligible seats when it starts."),u.append(h,g),o.append(a,u),e.replaceChildren(o),e.classList.add("has")}paidPrice(e,t,i,r){let s=r?this.channelByObject.get(r):void 0;if(s&&e){let a=this.pricesByChannel.get(s)?.find(l=>l.categoryKey===e&&l.tierId===(t??null));if(a)return a.price}let o=e?this.opts.pricing?.prices?.[e]:void 0;return o===void 0?i:typeof o=="number"?o:t&&o.tiers?.[t]!==void 0?o.tiers[t]:o.base??i}legendDeps(){return{colorOf:e=>this.controller.getRenderer()?.categoryDisplayColor?.(e.key)??e.color,rangeOf:e=>this.catPriceRange(e),priceOf:e=>this.catPrice(e),offerOf:e=>this.offerPrice(e),money:e=>this.money(e),esc:_}}syncPriceRail(e,t,i=this.legendDeps()){let r=this.els.railScroll,s=e.length>1;if(this.els.rail?.classList.toggle("has",s),!r)return;r.innerHTML=s?Jr({...i,categories:e,left:t,activeKey:this.focusedCatKey,soldOutWord:this.tf("picker.soldOut","Sold out"),allWord:this.tf("picker.allPrices","All prices"),allActive:!this.focusedCatKey&&!this.priceBandKeys}):"";let o=e.map(a=>a.key).join("|");this.lastRailSignature!==o&&(this.lastRailSignature=o,r.scrollLeft=0),r.querySelectorAll(".sl-rc").forEach(a=>{a.addEventListener("click",()=>{if(a.hasAttribute("data-rail-all")){this.applyPriceBand(null);return}this.focusCategory(a.dataset.cat??"")})}),this.railEdgesBound||(this.railEdgesBound=!0,r.addEventListener("scroll",()=>vn(r),{passive:!0})),requestAnimationFrame(()=>vn(r))}syncPrices(){let e=this.controller.doc;if(!e||!this.els.prices)return;let t=this.controller.categoryAvailability(),i=e.categories.filter(p=>!p.notForSale);this.narrateAvailability(i,t),this.syncSoldout(i,t);let r=this.legendDeps(),s=this.suppressPricing,o=s?{...r,priceOf:()=>{},rangeOf:()=>{},offerOf:()=>null}:r;s&&(this.els.pricesSec?.querySelector("span")?.replaceChildren(this.tf("picker.seatCategories","Seat categories")),this.els.pricesHint?.remove()),this.syncPriceRail(i,t,o);let a=5,l=i.length-a,c=l>1&&!this.pricesExpanded,d=c?i.slice(0,a):i;this.els.prices.classList.toggle("sl-expanded",l>1&&this.pricesExpanded),this.els.prices.innerHTML=Zr({...o,categories:d,left:t,collapsed:c,activeKey:this.focusedCatKey,bandKeys:this.priceBandKeys,leftCount:p=>(0,C.tCount)("picker.leftCount",p),titleFor:(p,u)=>u?this.tf("picker.showAllSeats","Show all seats"):(0,C.t)("picker.showLabelSeatsOnMap",{label:p.label}),moreLabel:l>1?c?s?this.tf("picker.showAllCategories","Show all categories"):(0,C.t)("picker.showAllTicketTypes",{count:i.length}):this.tf("picker.showFewer","Show fewer"):null,status:{legend:this.tf("picker.seatStatusLegend","Seat status legend"),held:this.tf("picker.temporarilyHeld","Temporarily held"),sold:this.tf("picker.sold","Sold")}}),this.els.prices.querySelectorAll(".sl-price-row").forEach(p=>{p.addEventListener("mouseenter",()=>this.controller.getRenderer()?.setCategoryHighlight?.(p.dataset.cat??null)),p.addEventListener("mouseleave",()=>this.controller.getRenderer()?.setCategoryHighlight?.(null));let u=()=>this.focusCategory(p.dataset.cat??"");p.addEventListener("click",u),p.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),u())})}),this.els.prices.querySelector(".sl-price-more")?.addEventListener("click",()=>{this.pricesExpanded=!this.pricesExpanded,this.syncPrices()})}focusCategory(e){if(!e)return;let t=this.focusedCatKey===e?null:e;this.focusedCatKey=t,this.priceBandKeys=t?new Set([t]):null;let i=this.els.pricesSec?.querySelector(".sl-price-select");i&&(i.value="all"),this.controller.setCategoryFilter(t?[t]:null),this.controller.focusCategoryFilter(t?[t]:null),this.pushAvailabilityTo3d(),this.syncFloors(),this.syncRung(),this.minimap?.refreshMinimap(),this.syncPrices(),this.lastSection&&this.showSectionCard(this.lastSection)}narrateAvailability(e,t){let i=this.els.liveText,r=this.lastCatAvail;this.lastCatAvail={...t};let s=this.controller.getActiveFloorId();if(s!==this.lastAvailFloorId&&(this.lastAvailFloorId=s,this.availQuietUntil=performance.now()+2e3),!(!i||!r||performance.now()<this.availQuietUntil))for(let o of e){let a=r[o.key],l=t[o.key]??0;if(a===void 0||l>=a)continue;let c=a-l;i.textContent=(0,C.tCount)("picker.seatsJustTakenInCategory",c,{label:o.label,left:l}),this.els.live?.classList.remove("on"),this.els.live?.offsetWidth,this.els.live?.classList.add("on"),this.liveTimer&&clearTimeout(this.liveTimer),this.liveTimer=setTimeout(()=>this.els.live?.classList.remove("on"),8e3);return}}evictTakenSelections(){let e=new Set([...this.controller.currentHold()?.labels??[],...this.holdingLabels]),t=this.controller.getSelection().filter(i=>!e.has(i.label)&&(this.controller.getStatus(i.id)??"free")!=="free");t.length&&(this.controller.deselect(t.map(i=>i.id)),this.toast((0,C.t)("picker.seatJustTakenByAnother",{label:t[0].label}),"error"))}syncTray(){if(!this.els.tray)return;this.updateSelectionCapacity();let{seats:e,gaAreas:t,heldItems:i,heldLabels:r,heldCount:s,total:o,count:a}=Bi(this),l=[],c=new Set;if(!this.salesClosed){let b=this.performanceGroup?.nightSummary?.()??[];b.length&&l.push(po(b,{title:this.tf("picker.group.yourSeatsByNight","Your seats by night"),empty:this.tf("picker.group.noSeatsChosenYet","No seats yet")}));let E=this.performanceGroup?.selectionModeSwitch;E&&l.push(`<button type="button" class="sl-pg-switch" data-pg-switch-mode>${_(E.label)}</button>`)}l.push(Ys({salesClosed:this.salesClosed,hasPicks:e.length>0||i.length>0,hasGaAreas:t.length>0,groupMode:this.performanceGroup?this.performanceGroup.selectionMode??"same_seat":null,seated:!!this.controller.doc?.objects?.some(b=>b.type!=="gaArea"),venue3d:this.buyerView==="venue3d",whenText:this.eventWhenText?String(this.eventWhenText):void 0}));let d=!e.length&&!i.length&&!Ye(this.gaQty,this.hold?.items??[]);if((d||this.root?.dataset.layout==="narrow")&&(this.baReopen=!1),!this.performanceGroup&&!this.salesClosed&&!this.hold&&(d||this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm)){let b=(this.controller.doc?.categories??[]).filter(x=>!x.notForSale),E=this.controller.getBestAvailableZones();this.baZone&&!E.some(x=>x.id===this.baZone)&&(this.baZone=""),l.push(Ws({confirming:this.bestAvailableConfirm,busy:this.bestAvailableBusy,reopened:this.baReopen,quantity:this.baQty,premium:this.baPremium,offerPremium:this.controller.hasPremiumSeats(),categories:b,zones:E,selectedCategory:this.baCat,selectedZone:this.baZone}))}let p=(b,E,x,I=1,R,T,O)=>qs({categoryLabel:O,d:b?this.controller.seatDetails(b):null,area:x==="ga"?t.find(N=>N.id===R):void 0,label:E,objectType:x,quantity:I,identity:T,performanceLabel:this.performanceGroup?.activePerformanceLabel?.(),performanceDates:this.performanceGroup?.selectedPerformanceDates?.()}),u=_,h=[];for(let b of vr(i)){let E=b.objectType==="ga"?`held:ga:${b.objectId}:${b.tierId??""}`:`held:${b.label}`;c.add(E);let x=this.controller.doc?.categories.find(K=>K.key===b.categoryKey),I=b.tierId?x?.tiers?.find(K=>K.id===b.tierId)?.name:void 0,R=b.objectType!=="ga"?this.controller.seatByLabel(b.label):null,T=b.objectType==="table"?this.controller.tableSelection(b.label):null,O=R?this.controller.seatDetails(R.id):null,N=this.seatViewEnabled()&&!!R&&b.objectType!=="table"&&!!this.deliverableViewReference(R),V=u(this.tf("picker.heldForYou","Held for you")),Q=(T?.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(b.label))}">${u((0,C.t)("picker.guestsCountEdit",{count:b.quantity??1}))}</button>`:"")+Ri(R?.wheelchairSpaceType)+xn(R?.commercial),J=this.paidPrice(b.categoryKey,b.tierId,b.unitPrice,b.label)*(b.quantity??1);h.push({key:E,fresh:!this.lastTrayKeys.has(E),held:!0,seatIds:[],heldLabels:b.labels,removeAria:(0,C.t)("picker.removeHeldTicketLabel",{label:on(b,t)}),locateId:R?.id??null,section:O?.sectionLabel??"",rowLabel:O&&te(O)||"",seatLabel:O?.seatNumber??b.label,categoryLabel:`${x?.label??b.categoryKey}${I?` \xB7 ${I}`:""}`,categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(b.categoryKey)??x?.color??"",identityHtml:p(R?.id??null,b.label,b.objectType,b.quantity??1,b.objectId,T??void 0,`${x?.label??b.categoryKey}${I?` \xB7 ${I}`:""}`),stateHtml:`<span class="sl-ticket-state held" aria-label="${V}" title="${V}"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></span>`,extrasHtml:Q,amount:J,amountText:this.suppressPricing?"":this.money(J),noteHtml:wn(R?.commercial),railHtml:this.performanceGroup?"":On((0,C.t)("picker.removeHeldTicketLabel",{label:on(b,t)}),N?b.label:null),groupable:!Q&&!!O?.sectionLabel&&!this.performanceGroup})}let g=this.seatViewEnabled();for(let b of e.filter(E=>!r.has(E.label))){let E=`seat:${b.id}`;c.add(E);let x=this.controller.doc?.categories.find(K=>K.key===b.categoryKey),I=b.tiers&&b.tiers.length&&!this.suppressPricing?`<select class="tier" data-tier="${u(b.id)}" aria-label="${u((0,C.t)("picker.ticketTierFor",{label:b.label}))}">`+b.tiers.map(K=>`<option value="${u(K.id)}"${K.id===b.tierId?" selected":""}>${u(K.name)} \xB7 ${u(this.money(this.paidPrice(b.categoryKey,K.id,K.price,b.label)))}</option>`).join("")+"</select>":"",R=b.tiers?.find(K=>K.id===b.tierId)??b.tiers?.[0],T=R?.buyerMessage?.trim()||(R?.restriction==="companion"?this.tf("picker.companionRequiresWheelchair","Requires the adjacent wheelchair place"):""),O=this.controller.seatDetails(b.id),N=u(this.tf("picker.selected","Selected")),V=(0,C.t)("picker.removeSeatLabel",{label:b.label}),Q=(b.objectType==="table"&&b.bookingMode==="variable"?`<button type="button" class="sl-table-edit" data-table-edit="${u(encodeURIComponent(b.label))}">${u((0,C.t)("picker.guestsCountEdit",{count:b.quantity??1}))}</button>`:"")+Ri(b.wheelchairSpaceType)+xn(b.commercial)+I,J=this.paidPrice(b.categoryKey,b.tierId??null,b.price,b.label)*(b.quantity??1);h.push({key:E,fresh:!this.lastTrayKeys.has(E),held:!1,seatIds:[b.id],heldLabels:[],locateId:b.id,section:O?.sectionLabel??"",rowLabel:O&&te(O)||"",seatLabel:O?.seatNumber??b.label,categoryLabel:x?.label??b.categoryKey,identityHtml:p(b.id,b.label,b.objectType,b.quantity??1,b.objectId,b,x?.label??b.categoryKey),categoryColor:this.controller.getRenderer?.()?.categoryDisplayColor?.(b.categoryKey)??x?.color??"",stateHtml:`<span class="sl-ticket-state" aria-label="${N}" title="${N}"><svg viewBox="0 0 24 24"><path d="M5 12l4 4L19 6"/></svg></span>`,extrasHtml:Q,amount:J,amountText:this.suppressPricing?"":this.money(J),removeAria:V,noteHtml:wn(b.commercial)+(T?`<small class="sl-tier-note">${u(T)}</small>`:""),railHtml:On(V,g&&b.objectType!=="table"&&this.deliverableViewReference(this.controller.seatByLabel(b.label)??{})?b.label:null),groupable:!Q&&!T&&!!O?.sectionLabel&&!this.performanceGroup})}h.length&&l.push(this.root?.dataset.layout==="narrow"?to(h,{money:b=>this.money(b),suppressPricing:this.suppressPricing}):h.map(eo).join("")),t.length&&l.push(Sr(this,t,i)),!this.performanceGroup&&!this.salesClosed&&!this.hold&&!d&&!this.baReopen&&!this.bestAvailableBusy&&!this.bestAvailableConfirm&&l.push(`<button type="button" class="sl-ba-reopen" data-ba-reopen><span aria-hidden="true">\u2726</span>${u(this.tf("picker.findTogetherInstead","Find seats together instead"))}</button>`),this.els.tray.innerHTML=l.join("")+(this.salesClosed?"":this.lapse.noteHtml()),this.lastTrayKeys=c,io(this.els.tray),this.lapse.wire(this.els.tray),this.els.tray.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>this.performanceGroup?.selectionModeSwitch?.activate());let m=this.performanceGroup?.selectNight;m&&ko(this.els.tray,b=>m(b)),this.els.tray.querySelectorAll("[data-ba]").forEach(b=>{b.addEventListener("click",()=>{this.baQty=Math.max(1,Math.min(this.maxTickets,this.baQty+Number(b.dataset.ba))),this.syncTray()})}),this.els.tray.querySelector("[data-ba-cat]")?.addEventListener("change",b=>{this.baCat=b.target.value}),this.els.tray.querySelector("[data-ba-zone]")?.addEventListener("change",b=>{this.baZone=b.target.value}),this.els.tray.querySelector("[data-ba-premium]")?.addEventListener("click",()=>{this.baPremium=!this.baPremium,this.syncTray()}),this.els.tray.querySelector(".sl-ba-go")?.addEventListener("click",()=>{if(this.pendingSelectionCount()>0){this.bestAvailableConfirm=!0,this.syncTray(),this.els.tray.querySelector("[data-ba-replace]")?.focus();return}this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelector("[data-ba-cancel]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-reopen]")?.addEventListener("click",()=>{this.baReopen=!0,this.syncTray(),this.els.tray.querySelector(".sl-ba-go")?.focus()}),this.els.tray.querySelector("[data-ba-close]")?.addEventListener("click",()=>{this.baReopen=!1,this.syncTray(),this.els.tray.querySelector("[data-ba-reopen]")?.focus()}),this.els.tray.querySelector("[data-ba-replace]")?.addEventListener("click",()=>{this.bestAvailableConfirm=!1,this.bestAvailable(this.baQty,this.baCat||void 0,{preferPremium:this.baPremium,zoneId:this.baZone||void 0})}),this.els.tray.querySelectorAll(".sl-chip .rm").forEach(b=>{b.addEventListener("click",()=>{let E=b.closest(".sl-chip");if(E.dataset.held){this.removeHeldLabels(decodeURIComponent(E.dataset.held).split(`
|
|
2686
2686
|
`),E);return}let x=E.dataset.seat.split(" "),I=this.controller.getSelection().find(T=>T.id===x[0])?.label??this.tf("picker.seat","Seat"),R=()=>{this.controller.deselect(x),this.toast((0,C.t)("picker.labelRemoved",{label:I}),"neutral",{label:this.tf("picker.undo","Undo"),onClick:()=>{let T=this.controller.select(x);this.toast(T.length?(0,C.t)("picker.labelRestored",{label:I}):(0,C.t)("picker.labelNoLongerAvailable",{label:I}),T.length?"success":"warning")}})};if(this.reducedMotion()){R();return}E.classList.remove("sl-enter"),E.classList.add("sl-leave","sl-mo-collapse"),this.scheduleMotion(R,X.collapse)})}),this.els.tray.querySelectorAll("[data-table-edit]").forEach(b=>{b.addEventListener("click",E=>{E.stopPropagation();let x=decodeURIComponent(b.dataset.tableEdit??""),I=this.controller.tableSelection(x);if(!I)return;let R=i.find(T=>T.label===x&&T.objectType==="table");this.showTableDialog({...I,quantity:R?.quantity??I.quantity},!!R,b)})}),this.els.tray.querySelectorAll(".sl-chip .tier").forEach(b=>{b.addEventListener("change",()=>this.controller.setSeatTier(b.dataset.tier,b.value||null))}),this.els.tray.querySelectorAll(".sl-chip .view[data-view-label]").forEach(b=>{b.addEventListener("click",()=>{let E=this.controller.seatByLabel(b.dataset.viewLabel);E&&this.openSeatView(E)})}),this.els.tray.querySelectorAll(".sl-chip[data-locate]").forEach(b=>{let E=()=>this.controller.flashSeat(b.dataset.locate,this.cssVar("--sl-accent")||"#f4b740");b.addEventListener("mouseenter",E),b.addEventListener("focusin",E)}),Tr(this,this.els.tray,t),this.controller.setGASelection(fr(this.gaQty)),this.salesClosed&&this.els.tray.querySelectorAll(".sl-ba-go,[data-ba],[data-ba-cat],[data-ba-zone],[data-ba-replace],.sl-ga button").forEach(b=>{b.disabled=!0});let v=this.pendingSelectionCount(),k=this.lastTrayCount,S=this.lastTrayTotal,L=wo(this.performanceGroup?.groupSelectionSummary?.(),this.performanceGroup?.selectionMode??"same_seat");if(this.els.count.textContent=L||(a?(0,C.tCount)("picker.ticketsCount",a):this.tf("picker.noSeatsSelected","No seats selected")),this.els.total.textContent=a&&!this.suppressPricing?this.money(o):"",this.root?.setAttribute("data-has-selection",String(a>0)),this.root?.setAttribute("data-ba-active",String(this.bestAvailableConfirm||this.bestAvailableBusy||this.baReopen)),this.els.foot?.classList.toggle("empty",a===0),this.els.seatSummary&&(this.els.seatSummary.textContent=L||(a?(0,C.tCount)("picker.seatsSelectedCount",a):"")),this.syncCta(a,v),this.hold){this.holdCopyPending=v>0;let b=Qs({secured:s||this.hold.seats?.length||0,pendingCount:v,expiresAt:this.holdExpiresAt,releasing:this.releasingHold});this.els.holdTitle&&(this.els.holdTitle.textContent=b.title),this.els.holdCopy&&(this.els.holdCopy.textContent=b.copy);let E=this.els.holdChange;E&&(E.disabled=this.releasingHold,E.textContent=b.change)}a!==k&&this.animateOnce(this.els.count,"sl-value-pop",380),o!==S&&this.animateOnce(this.els.total,"sl-value-pop",380),k===0&&a>0&&(this.animateOnce(this.els.cta,"sl-ready",520),this.sideCollapsed&&this.root?.dataset.layout!=="narrow"&&this.setPanelCollapsed(!1)),this.renderPeek(a,o,v,a>k),this.lastTrayCount=a,this.lastTrayTotal=o,this.opts.onSelectionChange?.(e),this.emitSelectionValidity(a,e)}emitSelectionValidity(e,t){let i=this.controller.getSelectionValidity(e);i&&(i.seats=t,this.opts.onSelectionValidityChange?.(i),i.isValid?this.lastSelectionValidity!==!0&&this.opts.onSelectionValid?.(t):this.lastSelectionValidity!==!1&&this.opts.onSelectionInvalid?.(i),this.lastSelectionValidity=i.isValid)}renderPeek(e,t,i,r=!1){if(!this.els.peek)return;let s=(this.controller.doc?.categories??[]).map(o=>this.catPrice(o)).filter(o=>o!=null);this.els.peek.innerHTML=Us({count:e,total:t,pendingCount:i,ctaPhase:this.ctaPhase,hasHold:!!this.hold,salesClosed:this.salesClosed,suppressPricing:this.suppressPricing,fromPrice:s.length?Math.min(...s):null,addMore:this.root?.dataset.layout==="narrow"?null:Ks({salesClosed:this.salesClosed,hasHold:!!this.hold,ctaPhase:this.ctaPhase,formOpen:this.baReopen||this.bestAvailableBusy||this.bestAvailableConfirm,room:this.maxTickets-this.totalTicketCount(),wanted:this.baQty}),offerFind:!this.performanceGroup&&!this.salesClosed&&!this.hold,holdTime:this.hold&&this.holdTimer?Zt(Math.max(0,this.holdExpiresAt-Date.now())):null,money:o=>this.money(o)}),this.root&&(this.root.dataset.peekClock=String(!!this.els.peek.querySelector(".sl-peek-time"))),r&&this.animateOnce(this.els.peek.querySelector(".sl-peek-sum")??void 0,"sl-peek-bump",240)}async removeHeldLabels(e,t){let i=e.filter(o=>o&&!this.releasingLabels.has(o));if(!i.length)return!1;let r=i[0];i.forEach(o=>this.releasingLabels.add(o)),t?.setAttribute("aria-busy","true");let s=t?.querySelector(".rm");s&&(s.disabled=!0);try{let o=this.handedOff;if(!await this.controller.releaseLabels(i))return this.toast((0,C.t)("picker.couldNotRemoveLabel",{label:r}),"error"),!1;yr(this.gaQty,this.hold?.items??[],i);let l=this.controller.currentHold();return this.hold=l?{holdId:l.holdId,expiresAt:l.expiresAt,seats:l.seats,items:l.items}:null,this.handedOff=!!this.hold&&o,this.bookedShown=!1,this.ctaPhase="idle",this.hold?this.startHoldTimer(this.hold.expiresAt):(this.stopHoldTimer(),this.forgetHold()),this.syncTray(),this.emitHoldChange(),this.toast((0,C.t)("picker.labelRemovedFromHold",{label:r}),"success"),!0}finally{i.forEach(o=>this.releasingLabels.delete(o)),t?.removeAttribute("aria-busy"),s?.isConnected&&(s.disabled=!1)}}async handleChangeSeats(){if(!this.hold||this.releasingHold)return;this.releasingHold=!0;let e=this.els.holdChange;e&&(e.disabled=!0,e.textContent=this.tf("picker.releasingEllipsis","Releasing\u2026"));try{await this.release(),this.hold||this.toast(this.tf("picker.heldTicketsReleased","Held tickets released. Choose your new seats."),"success")}finally{this.releasingHold=!1,e?.isConnected&&(e.disabled=!1,e.textContent=this.tf("picker.change","Change"))}}async handleCta(){if(this.salesClosed)return;let e=this.controller.getSelectionValidity(this.totalTicketCount());if(e&&!e.isValid){this.toast(Rn(e,(i,r)=>this.tf(i,r)),"warning");return}if(this.totalTicketCount()>this.maxTickets){this.toast((0,C.t)("picker.removeTicketsUntilOrFewer",{count:this.maxTickets}),"warning");return}let t=this.committedSelection();if(this.hold&&!t.some(i=>!(this.hold.items??[]).some(r=>r.label===i.label))){let i=this.hold.seats??t;this.handedOff=!0,this.holdConflicted=!1,await this.runCheckoutHandoff(this.hold,i);return}this.holdingLabels=new Set(t.map(i=>i.label)),this.setCtaPhase("holding");try{let i=null,r=mr(this.gaQty),s=this.committedSelection();if(s.length){let o=await this.controller.hold(void 0,this.opts.holdTtlMs);i=o?{holdId:o.holdId,expiresAt:o.expiresAt,seats:o.seats,items:o.items}:null}for(let{areaId:o,tierId:a,qty:l}of r){let c=await this.controller.holdGA(o,l,{tierId:a,ttlMs:this.opts.holdTtlMs});i=c?{holdId:c.holdId,expiresAt:c.expiresAt,seats:c.seats,items:c.items}:i}if(!i){this.raiseHoldConflict(this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.")),this.setCtaPhase("idle"),this.syncTray();return}this.hold=i,this.holdConflicted=!1,this.handedOff=!this.performanceGroup,this.startHoldTimer(i.expiresAt),this.flashHeldSeats(i),this.emitHoldChange(),this.performanceGroup?this.setCtaPhase("idle"):await this.runCheckoutHandoff(i,i.seats??s)}catch(i){this.opts.onError?.(i);let r=i,s=(r.conflicts??[]).map(a=>a.label).filter(Boolean).slice(0,3);r.reason==="event_closed"&&this.setSalesClosed(!0);let o=r.reason==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):r.reason==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):r.reason==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s.length?s.length===1?(0,C.t)("picker.labelsNoLongerAvailable.one",{labels:s.join(", ")}):(0,C.t)("picker.labelsNoLongerAvailable.other",{labels:s.join(", ")}):this.tf("picker.seatsJustTaken","One or more seats were just taken. Please pick again.");this.raiseHoldConflict(o),this.setCtaPhase("idle")}finally{this.holdingLabels.clear(),this.ctaPhase==="holding"&&(this.ctaPhase="idle"),this.syncTray()}}startHoldTimer(e){this.stopHoldTimer(),this.holdExpiresAt=e,this.hold&&this.rememberHold(this.hold);let t=this.els.hold;t.innerHTML=`<span class="sl-hold-dot" aria-hidden="true"></span><span>${this.tf("picker.held","Held")}</span><span class="sl-hold-time" data-ref="holdTime"></span>`;let i=t.querySelector('[data-ref="holdTime"]');this.els.holdNote?.classList.add("on");let r=()=>{let s=Math.max(0,this.holdExpiresAt-Date.now());i&&(i.textContent=Zt(s));let o=this.els.peek?.querySelector(".sl-peek-time");o&&(o.textContent=Zt(s)),!this.holdCopyPending&&this.els.holdCopy&&this.root?.dataset.layout!=="narrow"&&(this.els.holdCopy.textContent=_n(this.holdExpiresAt)),t.classList.add("on"),t.classList.toggle("is-expiring",s>0&&s<=Ro),this.setExtendPrompt(s>0&&s<=Ro,s),(s<=0||!this.controller.currentHold())&&this.stopHoldTimer()};this.holdTimer=setInterval(r,500),r()}stopHoldTimer(){this.holdTimer&&clearInterval(this.holdTimer),this.holdTimer=null,this.els.hold?.classList.remove("on","is-expiring"),this.els.holdNote?.classList.remove("on"),this.root&&delete this.root.dataset.peekClock,this.setExtendPrompt(!1,0)}setExtendPrompt(e,t){if(this.extendEl)if(e&&this.controller.currentHold()&&!this.bookedShown){let i=Math.ceil(t/1e3),r=Math.floor(i/60),s=String(i%60).padStart(2,"0");this.els.extendTxt.innerHTML=(0,C.t)("picker.seatsHeldForNeedMoreTime",{time:`${r}:${s}`}),this.extendEl.classList.add("on")}else this.extendEl.classList.remove("on")}async handleExtend(){let e=this.els.extendBtn;e.disabled=!0;let t=e.textContent;e.textContent=this.tf("picker.addingEllipsis","Adding\u2026");try{let i=await this.controller.extendHold(this.opts.holdTtlMs);i?(this.hold={holdId:i.holdId,expiresAt:i.expiresAt,seats:i.seats,items:i.items},this.holdExpiresAt=i.expiresAt,this.extendEl?.classList.remove("on"),this.rememberHold(this.hold),this.emitHoldChange(),this.toast(this.tf("picker.moreTimeAdded","More time added \u2014 your seats are still held."),"success")):this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.couldNotAddMoreTime","Couldn't add more time \u2014 please head to checkout now."),"warning")}finally{e.disabled=!1,e.textContent=t}}detectBooked(){this.bookedShown||!this.handedOff||!this.hold||this.controller.currentHold()===null&&(this.holdConflicted||this.showBooked())}raiseHoldConflict(e){this.holdConflicted=!0,this.bookedShown&&(this.bookedShown=!1,this.bookedEl?.classList.remove("on")),this.toast(e,"error")}showBooked(){if(this.bookedShown||!this.hold||this.holdConflicted)return;this.bookedShown=!0;let e=this.buildHandoff(this.hold);this.stopHoldTimer(),this.forgetHold();let t=e.lineItems.reduce((r,s)=>r+s.quantity,0),i=this.performanceGroup?.groupSelectionSummary?.();this.els.bookedSub&&(this.els.bookedSub.innerHTML=i?.seats?`<span class="sl-booked-seats">${(0,C.tCount)("picker.group.ticketsConfirmedAcross",i.seats,{performances:i.performances})}</span>`:`<span class="sl-booked-seats">${(0,C.tCount)("picker.ticketsCount",t)}</span> ${this.tf("picker.confirmedAndOnWay","confirmed. A confirmation is on its way.")}`),this.els.bookedList&&(this.els.bookedList.innerHTML=e.lineItems.map(r=>{let o=[r.sectionLabel,r.rowLabel&&`${this.tf("picker.row","Row")} ${r.rowLabel}`,r.seatNumber&&`${this.tf("picker.seat","Seat")} ${r.seatNumber}`].filter(Boolean).join(" \xB7 ")||r.displayLabel||r.label,a=r.quantity>1?` <span class="sl-booked-qty">\xD7${r.quantity}</span>`:"";return`<li>${_(o)}${a}</li>`}).join(""),this.els.bookedList.hidden=e.lineItems.length===0),this.bookedEl?.classList.add("on"),requestAnimationFrame(()=>this.bookedEl?.querySelector(".sl-booked-back")?.focus()),this.opts.onBooked?.(e)}dismissBooked(){this.bookedEl?.classList.remove("on"),this.root?.focus({preventScroll:!0})}notifyGroupSettled(e){e==="booked"?this.showBooked():this.dismissConfirm(),this.hold=null,this.handedOff=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.forgetHold(),this.syncTray(),this.syncCta()}async checkoutHandoff(e,t){if(this.checkoutMode==="hosted"){await this.startHostedCheckout(e,t);return}await this.opts.onCheckout?.(e,t,this.buildHandoff(e))}async startHostedCheckout(e,t){let i=this.buildHandoff(e),r=null;try{r=await(this.paymentOptions??=this.pubApi.paymentOptions(this.opts.event))}catch(o){this.opts.onError?.(o)}if(this.destroyed)return;let s=r?.providers?.[0];if(!s){let o=Fr(r?.reason),a=!!this.opts.onCheckoutUnavailable||!!this.opts.onCheckout;this.opts.onCheckoutUnavailable?.({reason:o,handoff:i}),this.opts.onCheckout?.(e,t,i),a||this.openCheckoutPanel({kind:"unavailable",reason:o,seatCount:i.lineItems.reduce((l,c)=>l+c.quantity,0)});return}await this.openCheckoutPanel({kind:"pay",provider:s,order:{holdId:i.holdId,expiresAt:i.expiresAt,currency:i.currency,total:i.total,labels:i.lineItems.map(o=>o.displayLabel??o.label)}})}async openCheckoutPanel(e){let t;try{({mountCheckout:t}=await zr())}catch(i){this.opts.onError?.(i),this.toast(this.tf("picker.checkoutCouldNotBeOpened","Checkout could not be opened. Your seats are still held \u2014 please try again."),"error"),this.setCtaPhase("idle");return}this.destroyed||!this.root||(this.closeCheckoutPanel(),this.checkoutPanel=t({root:this.root,state:e,eventKey:this.opts.event,formatMoney:i=>this.money(i),startSession:i=>this.pubApi.startCheckout(this.opts.event,{...i,...this.opts.returnUrl?{returnUrl:this.opts.returnUrl}:{}}),orderStatus:i=>this.pubApi.orderStatus(i),onCancel:()=>{this.checkoutPanel=null,this.hold||this.setCtaPhase("idle")},onConfirmed:i=>{this.opts.onOrderConfirmed?.(i),this.controller.refresh()},onError:i=>this.opts.onError?.(i)}))}closeCheckoutPanel(){this.checkoutPanel?.destroy(),this.checkoutPanel=null}buildHandoff(e){let i=(e.items??[]).map(o=>{let a=this.controller.lineItemDisplay(o);return{label:o.label,...a.displayLabel?{displayLabel:a.displayLabel}:{},...a.displayType?{displayType:a.displayType}:{},objectId:o.objectId,objectType:o.objectType,categoryKey:o.categoryKey,tierId:o.tierId,unitPrice:this.paidPrice(o.categoryKey,o.tierId,o.unitPrice,o.label),currency:o.currency??this.currency,quantity:o.quantity??1}}),r=i[0]?.currency??this.currency,s=i.reduce((o,a)=>o+a.unitPrice*a.quantity,0);return{holdId:e.holdId,expiresAt:e.expiresAt,currency:r,lineItems:i,total:s}}emitHoldChange(){let e=this.hold;this.scheduleOfferRefresh(!0),this.opts.onHoldChange?.(e,e?.seats??[],e?this.buildHandoff(e):null)}toast(e,t="neutral",i){let r=this.els.toast;if(!r)return;r.replaceChildren();let s=document.createElement("span");if(s.textContent=e,r.appendChild(s),r.classList.toggle("has-action",!!i),i){let o=document.createElement("button");o.type="button",o.className="sl-toast-action",o.textContent=i.label,o.addEventListener("click",i.onClick,{once:!0}),r.appendChild(o)}r.dataset.tone=t,r.classList.add("on","sl-mo-rise"),this.liftToastOverConfirmSoon(),this.toastTimer&&clearTimeout(this.toastTimer),this.toastTimer=setTimeout(()=>{r.classList.remove("on","sl-mo-rise"),r.classList.remove("has-action"),r.dataset.tone="neutral",this.liftToastOverConfirm()},4200)}liftToastOverConfirm(){let e=this.regions["bottom-center"];if(!e)return;let t=this.els.toast?.classList.contains("on")||this.extendEl?.classList.contains("on"),i=this.confirmEl;if(!t||!i?.isConnected){e.style.removeProperty("bottom");return}let r=this.els.map.clientHeight;if(r<=0)return;let s=i.getBoundingClientRect(),o=s.height||i.offsetHeight||oc,a=s.height?s.top-this.els.map.getBoundingClientRect().top:r-zn-o,l=Math.round(r-a+rc);if(l+sc>r){e.style.removeProperty("bottom");return}e.style.bottom=`${l}px`}liftToastOverConfirmSoon(){this.liftToastOverConfirm(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(()=>{this.destroyed||this.liftToastOverConfirm()})}dismissSkeleton(){Ms({boot:this.els.boot,map:this.els.map,rail:this.els.rail,root:this.root,reducedMotion:this.reducedMotion()})}placeTooltip(){if(!this.tipEl)return;let e={width:this.els.map.clientWidth,height:this.els.map.clientHeight},t={width:this.tipEl.offsetWidth,height:this.tipEl.offsetHeight},i=this.tipPinned?Eo(this.tipPos,e,t):null,r=i??Co(this.tipPos,e.width,e.height,t);this.tipEl.style.left=`${r.left}px`,this.tipEl.style.top=`${r.top}px`,i?this.tipEl.dataset.placement=i.placement:delete this.tipEl.dataset.placement}nightStripFor(e,t){let i=this.performanceGroup,r=Nn(e.mark,i?.nights?.()),s=r?.states.filter(o=>o.free).length??0;return ho(r,{locale:this.opts.locale,switchLabel:i?.selectionModeSwitch?.label??null,selectPartialLabel:i?.partialSeatSelection?.label(s)??null,pinned:t})}unavailableReason(e){return!e.unavailable||e.mark?.kind==="partial"?"":e.status==="held"?this.tf("picker.heldByOther","Held by another buyer \u2014 may become available"):e.status==="not_for_sale"?this.tf("picker.notForSaleExplanation","This seat is not included in the current sale."):e.status==="free"?"":this.tf("picker.soldSeatExplanation","This seat has already been booked.")}unpinTooltip(){this.tipPinned&&(this.tipPinned=!1,this.tipEl?.classList.remove("sl-tip-pinned"),this.tipEl&&(this.tipEl.style.display="none"))}handleMapPointerDown(e){if(this.tipEl?.contains(e.target))return;this.lastMapPoint={x:e.clientX,y:e.clientY},this.lastPointerType=e.pointerType||"mouse";let t=this.els.map.getBoundingClientRect();this.tipPos={x:e.clientX-t.left,y:e.clientY-t.top},this.unpinTooltip()}updateTooltip(e){if(!this.tipEl)return;if(this.confirmSeat){this.tipEl.style.display="none";return}if(this.tipPinned&&e?.interaction!=="press")return;if(!e){this.tipPinned||(this.tipEl.style.display="none",this.tipMarkedHoverLabel=null);return}let t=e.mark?.kind==="partial"&&this.tipMarkedHoverLabel===e.label;if(e.unavailable&&e.status==="free"&&e.interaction==="press"){this.toast(this.tf("picker.turnOffAccessibilityFilter","Turn off the wheelchair filter to pick this seat"),"neutral"),this.tipEl.style.display="none";return}let i=this.unavailableReason(e),r=e.mark?.kind==="partial"&&(e.interaction==="press"||this.lastPointerType!=="mouse"||t)||!!i&&e.interaction==="press";this.tipMarkedHoverLabel=e.mark?.kind==="partial"?e.label:null;let s=this.nightStripFor(e,r);this.tipEl.style.setProperty("--sl-cat",e.categoryColor),this.tipEl.innerHTML=To(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:Tt(e),reason:i,extra:s+(r?`<button type="button" class="sl-tip-close" data-pg-tip-close aria-label="${_(this.tf("picker.group.closeSeatDetails","Close seat details"))}">\xD7</button>`:"")}),this.tipPinned=r,this.tipEl.classList.toggle("sl-tip-pinned",r),this.tipEl.querySelector("[data-pg-tip-close]")?.addEventListener("click",()=>this.unpinTooltip()),this.tipEl.querySelector("[data-pg-switch-mode]")?.addEventListener("click",()=>{this.unpinTooltip(),this.performanceGroup?.selectionModeSwitch?.activate()}),Lo(this.tipEl,this.performanceGroup?.partialSeatSelection?.label,o=>{this.unpinTooltip(),this.performanceGroup?.partialSeatSelection?.activate(e.id,o)}),this.tipEl.style.display="block",this.placeTooltip()}syncSeatMarks(){let e=this.performanceGroup?.seatMarks,t=this.controller.getRenderer();if(!e||!t?.setSeatMarks)return;let i={};for(let[r,s]of Object.entries(e())){let o=this.controller.idForLabel(r);o&&(i[o]=s)}Object.keys(i).length&&t.setSeatMarks(i)}getSelection(){return this.committedSelection()}selectObjects(e){return this.controller.select(e)}selectObjectsWithoutConfirmation(e){let t=new Set(e),i=this.controller.getSelection().filter(r=>t.has(r.id)||t.has(r.label));if(i.length===t.size)return i;this.suppressConfirmationSeatId=e[0]??null;try{return this.controller.select(e)}finally{this.suppressConfirmationSeatId=null}}deselectObjects(e){this.controller.deselect(e)}clearSelection(){this.dismissConfirm(),this.dismissTableDialog(),this.controller.clearSelection()}categoryLegendColor(){let e=(this.controller.doc?.categories??[]).find(t=>!t.notForSale);return(e?this.controller.getRenderer()?.categoryDisplayColor?.(e.key):null)||e?.color||"#2563eb"}async refreshAvailability(){await this.controller.refresh(),this.syncSeatMarks(),this.syncTray()}refreshPerformanceGroupComposition(){this.syncTray()}async adoptRestoredHold(e){!e||this.hold||await this.resumeHoldFromServer(e,!1)}selectCategories(e){return this.controller.selectCategories(e)}deselectCategories(e){this.controller.deselectCategories(e)}setSelectableObjects(e){this.controller.setSelectableObjects(e)}setMaxSelection(e){this.maxTickets=Math.max(this.exactTickets??1,Math.floor(e)),this.controller.setMaxSelection(this.maxTickets),this.updateSelectionCapacity(),this.syncTray()}getSelectionValidity(){let e=this.controller.getSelectionValidity(this.totalTicketCount());return e&&(e.seats=this.committedSelection()),e}setMapTheme(e){this.destroyed||(this.opts.theme={...this.opts.theme??{},map:e??void 0},this.controller.setMapTheme(e),this.applyMapChromeTokens(),this.minimap?.refreshMinimap())}applyThemeTokens(e){let t=Dt(this.themeMode),i=Bt(this.controller.doc?.theme,this.opts.theme,t);for(let[r,s]of Object.entries(i))e.style.setProperty(r,s);t?e.dataset.theme=t:delete e.dataset.theme,this.applyMapChromeTokens()}watchThemeMode(){this.colorSchemeStop?.(),this.colorSchemeStop=null,this.themeMode==="auto"&&(this.colorSchemeStop=di(()=>{this.destroyed||this.repaintForThemeMode()}))}repaintForThemeMode(){this.root&&(this.applyThemeTokens(this.root),this.controller.setMapTheme(at(this.opts.theme,this.themeMode)),this.applyMapChromeTokens(),this.minimap?.refreshMinimap(),this.syncPrices())}setThemeMode(e){this.destroyed||e===this.themeMode||(this.themeMode=e,this.opts.theme={...this.opts.theme??{},...e?{mode:e}:{mode:void 0}},this.watchThemeMode(),this.repaintForThemeMode(),this.emitAnalytics("theme_mode_changed",{mode:e,resolved:Dt(e)??null}))}getThemeMode(){return this.themeMode}applyMapChromeTokens(){let e=this.els.map?.parentElement;if(!e||!this.root)return;let t=Dt(this.themeMode),i=Bt(this.controller.doc?.theme,this.opts.theme,t),r=at(this.opts.theme,this.themeMode)?.background??this.controller.doc?.theme?.background??void 0,s=ir(i,r);for(let o of["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text"])s?e.style.setProperty(o,s[o]):e.style.removeProperty(o)}setEventDetailsHidden(e){this.eventDetailsHidden=e,this.syncFullscreenButtons()}setPricing(e){let t=JSON.stringify(this.opts.pricing??null),i=JSON.stringify(e??null);t!==i&&(this.opts.pricing=e,!(this.destroyed||!this.els.prices)&&(this.els.pricesSec?.querySelector(".sl-price-select")?.remove(),this.buildPriceFilter(),this.syncPrices(),this.syncTray(),this.lastSection&&this.showSectionCard(this.lastSection)))}buildLanguageSwitcher(e){this.langSel=or(e,{languages:this.opts.languages,label:this.tf("picker.preferredTicketType","Language"),onChange:t=>{this.setLocale(t)}})}async setLocale(e){let t=(0,C.getLocale)(),i=this.localeGeneration+=1,r=await(0,C.loadLocale)(e);return this.opts.messages&&(0,C.setStringOverrides)(this.opts.messages),r===t||this.applyActiveLocale(r,i),r}applyActiveLocale(e,t){t===this.localeGeneration&&this.root&&ar(e,{root:this.root,painters:[()=>this.syncTray(),()=>this.syncPrices(),()=>this.syncOffer(),()=>this.syncRung(),()=>this.syncFloors(),()=>this.syncPanelToggle(),()=>this.syncFullscreenButtons()],refreshMapCopy:()=>this.controller.refreshMapCopy(),languageSelect:this.langSel})}isColorblindSafe(){return this.cbSafe}setColorblindSafe(e){e!==this.cbSafe&&(this.cbSafe=e,this.cbEl?.setAttribute("aria-pressed",String(e)),this.controller.setColorblindSafe(e),this.syncPrices(),this.minimap?.refreshMinimap(),cc(e))}setViewMode(e){this.controller.setViewMode(this.normalizeInitialView(e)),this.syncProjection(),this.dismissConfirm()}getViewMode(){return this.controller.getViewMode()}normalizeInitialView(e){return e==="perspective"?(this.perspectiveWarned||(this.perspectiveWarned=!0,console.warn("[seatlayer] initialView:'perspective' (2.5D) is deprecated for the buyer picker and was coerced to 'flat'. Use the Map | 3D control for the immersive view.")),"flat"):e??"flat"}getBuyerView(){return this.buyerView}setBuyerView(e,t){if(e==="map"){this.exit3d();return}let i=t?.flyToSeatId;if(this.buyerView==="venue3d"){i?(this.opts.onBuyerViewChange?.({view:"venue3d",seatId:i}),this.view3dHandle?.flyToSeat(i)):t?.resetView&&this.view3dHandle?.focusOverview();return}this.enter3d(i)}seatState3dFor(e){switch(this.controller.getStatus(e.id)){case"held":return"held";case"booked":return"sold";case"not_for_sale":return"dimmed";default:break}return this.priceBandKeys!=null&&!this.priceBandKeys.has(e.categoryKey)||this.controller.accessibilityFilterDims?.(e)||this.limitedViewFilter&&(e.commercial?.restrictedView||e.commercial?.obstructedView)?"dimmed":"available"}pushAvailabilityTo3d(){if(!this.view3dHandle)return;let e=this.allSeats().map(t=>({seatId:t.id,state:this.seatState3dFor(t)}));this.view3dHandle.setAvailability(e)}syncSelectionTo3d(){this.view3dHandle&&this.view3dHandle.setSelection(this.controller.getSelection().map(e=>e.id))}async seatViewFor3d(e){let t=this.allSeats().find(i=>i.id===e);if(!t)return null;if(t.viewUrl)try{let i=t.viewMeta?.previewUrl,r=!!i&&i!==t.viewUrl,s=r?await this.buyerAssetUrls.resolve(i):null,o=r?t.viewUrl:await this.buyerAssetUrls.resolve(t.viewUrl);return!o||r&&!s?null:{url:o,...s?{previewUrl:s}:{},...r?{resolveUrl:a=>this.buyerAssetUrls.resolve(a)}:{},...t.viewMeta?.sourceWidth!==void 0?{sourceWidth:t.viewMeta.sourceWidth}:{},...t.viewMeta?.sourceHeight!==void 0?{sourceHeight:t.viewMeta.sourceHeight}:{},...t.viewMeta?.previewWidth!==void 0?{previewWidth:t.viewMeta.previewWidth}:{},...t.viewMeta?.previewHeight!==void 0?{previewHeight:t.viewMeta.previewHeight}:{},...t.viewMeta?.variants?.length?{variants:t.viewMeta.variants}:{},...t.viewMeta?.initialBearingDeg!==void 0?{initialBearingDeg:t.viewMeta.initialBearingDeg}:{},...t.viewMeta?.initialPitchDeg!==void 0?{initialPitchDeg:t.viewMeta.initialPitchDeg}:{},...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}}catch(i){return this.opts.onError?.(i),null}return{url:"",generated:!0,mediaKind:"model",coverage:"exact-seat",sourceLabel:this.tf("picker.chartDerivedModel","Chart-derived model")}}emitAnalytics(e,t){try{this.opts.onAnalytics?.(e,{...t,surface:"buyer"})}catch{}}emit3dAnalytics(e,t){this.emitAnalytics(e,t)}onView3dSeatPick(e){if(this.salesClosed){this.toast(this.tf("picker.salesClosedToast","Sales are closed for this event."),"warning"),this.syncSelectionTo3d();return}let t=this.allSeats().find(a=>a.id===e);if(!t)return;let i=this.controller.tableSelection(e);if(this.committedSelection().some(a=>i?a.label===i.label:a.id===e)){this.controller.deselect([e]),this.dismissConfirm(),this.syncSelectionTo3d();return}let s=this.controller.getStatus(t.id);if(s==="held"||s==="booked"||s==="not_for_sale"){this.showUnavailable3dSeat(t,this.seatState3dFor(t),s),this.syncSelectionTo3d();return}if(this.dismissUnavailable3dSeat(),!this.controller.select([e]).length){this.syncSelectionTo3d(),this.dismissConfirm();return}if(this.opts.onBuyerViewChange?.({view:"venue3d",seatId:e}),this.flashPickedSeat(e),i){this.showTableDialog(i,!1),this.syncSelectionTo3d();return}this.opts.confirmSelection!==!1?this.showConfirm(t):this.syncTray(),this.syncSelectionTo3d()}seatViewCaption(e){let t=this.allSeats().find(i=>i.id===e);return Ps(this.controller.seatDetails(e),t?.displayLabel??t?.label??e,this.tf("picker.viewFromYourSeat","view from your seat"),{narrow:this.root?.dataset.layout==="narrow",shortTail:this.tf("picker.fromYourSeat","from your seat")})}showUnavailable3dSeat(e,t,i){let r=this.view3dEl;if(!r)return;let s=this.controller.seatDetails(e.id),o=s?.displayLabel??e.displayLabel??e.label,a=te(s);js(r,{status:i,visualState:t,location:[s?.sectionLabel,a?(0,C.t)("picker.rowLabel",{label:a}):null,o].filter(Boolean).join(" \xB7 ")||o,tf:(l,c)=>this.tf(l,c)}),this.announceSeat(e)}dismissUnavailable3dSeat(){In(this.view3dEl)}saveView3dComparisonSeat(e){if(this.buyerView!=="venue3d")return;let t=this.view3dCompareSeatIds;t.includes(e.id)||(this.view3dCompareSeatIds=t.length===0?[e.id]:[t[0],e.id]),this.confirmSeat?.id===e.id&&(this.controller.deselect([e.id]),this.dismissConfirm(),this.syncSelectionTo3d(),this.syncTray()),this.view3dCompareChip.sync(),this.emit3dAnalytics("3d_comparison_saved",{seatId:e.id,count:this.view3dCompareSeatIds.length}),this.view3dCompareSeatIds.length>1?this.openView3dComparison():this.toast(this.tf("picker.chooseAnotherToCompare","Seat saved. Choose another seat to compare."),"success")}clearView3dComparison(){this.closeView3dComparison(!1),this.view3dCompareSeatIds=[],this.view3dCompareChip.remove(),this.emit3dAnalytics("3d_comparison_cleared")}view3dComparisonSnapshot(e){let t=this.allSeats().find(h=>h.id===e);if(!t)return null;let i=this.controller.seatDetails(t.id),r=this.controller.doc?.categories.find(h=>h.key===t.categoryKey),s=i?.price??(r?.tiers?.length?r.tiers[0].price:r?.price),o=s!=null?this.paidPrice(t.categoryKey,i?.tierId??r?.tiers?.[0]?.id??null,s,t.label):void 0,a=this.controller.getStatus(t.id),l=a==="held"?this.tf("picker.temporarilyHeld","Temporarily held"):a==="booked"?this.tf("picker.sold","Sold"):a==="not_for_sale"?this.tf("picker.notForSale","Not for sale"):this.tf("picker.available","Available"),c=t.viewUrl?(0,Jt.seatViewDisclosure)({url:t.viewUrl,...t.viewMeta?.coverage?{coverage:t.viewMeta.coverage}:{},...t.viewMeta?.capturedAt?{capturedAt:t.viewMeta.capturedAt}:{},...t.viewMeta?.sourceLabel?{sourceLabel:t.viewMeta.sourceLabel}:{}}):this.tf("picker.chartDerivedSeatEye","Live 3D \xB7 chart-derived seat-eye \xB7 not surveyed"),d=He(t.commercial)||this.tf("picker.noAuthoredRestriction","No organizer-authored restriction"),p=i?.wheelchairSpaceType?`${xt(i.wheelchairSpaceType)} \xB7 metadata, not access certification`:this.tf("picker.noAccessibilityMetadata","No accessibility metadata supplied"),u=(0,_o.seatConfidenceDisclosure)(t.confidenceEvidence);return{seat:t,label:i?.displayLabel??t.displayLabel??t.label,section:i?.sectionLabel??t.sectionId??"\u2014",row:te(i)??i?.rowLabel??"\u2014",category:i?.categoryLabel??r?.label??t.categoryKey,price:this.suppressPricing||o==null?"":this.money(o),availability:l,selectable:a==null||a==="free",viewSource:c,limited:d,accessibility:p,confidence:u}}openSeatConfidencePassport(e,t=null){Hn(this,e,t)}closeSeatConfidencePassport(e=!0){Qt(this,e)}openView3dComparison(){Vs(this)}closeView3dComparison(e=!0){Xe(this,e)}async enter3d(e){if(this.view3dEl||!this.canOffer3d()||!this.els.map)return;let t=this.controller.doc;if(!t)return;this.buyerView="venue3d",this.view3dTargetSeatId=null,this.opts.onBuyerViewChange?.({view:"venue3d",...e?{seatId:e}:{}}),this.root?.setAttribute("data-view3d","on"),this.dismissConfirm(),this.syncProjection(),this.syncTray();let i=document.createElement("div");i.className="sl-view3d sl-mo-zoom",i.setAttribute("role","group"),i.setAttribute("aria-label",this.tf("picker.interactive3dVenueView","Interactive 3D venue view"));let r=document.createElement("button");r.type="button",r.className="sl-view3d-back",r.innerHTML=`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg><span>${this.tf("picker.backToMap","Back to map")}</span>`;let s=r.querySelector("span"),o=c=>{this.view3dTargetSeatId=c;let d=!!c;i.classList.toggle("is-seat-focused",d),this.root&&(this.root.dataset.view3dSeat=d?"on":"off");let p=d?this.tf("picker.backToVenue","Back to venue"):this.tf("picker.backToMap","Back to map");s&&(s.textContent=p),r.setAttribute("aria-label",p)};if(r.addEventListener("click",()=>{if(this.view3dTargetSeatId&&this.view3dHandle){this.view3dHandle.focusOverview();return}this.exit3d()}),this.regions["top-left"]?.prepend(r),this.view3dBack=r,this.publish3dTopInset(),Es(this.root)){let c=document.createElement("button");c.type="button",c.className="sl-view3d-fs",c.textContent="\u26F6",c.setAttribute("aria-label",this.tf("picker.fullScreen","Full screen")),c.setAttribute("aria-pressed",String(!!document.fullscreenElement||this.fsFallback||this.framedFs)),c.addEventListener("click",()=>this.toggleFullscreen()),i.appendChild(c)}let a=document.createElement("div");a.className="sl-view3d-loading",a.setAttribute("role","status"),a.setAttribute("aria-live","polite"),a.textContent=this.tf("picker.loading3d","Building the 3D venue\u2026"),i.appendChild(a),this.els.map.appendChild(i),this.view3dEl=i,this.view3dCompareChip.sync(),requestAnimationFrame(()=>{i.style.opacity="1"});let l=++this.view3dGen;try{let c=this.allSeats(),[d,p]=await Promise.all([Gt(),this.controller.loadEventConfiguration()]),u=p?await ki(p,S=>this.buyerAssetUrls.resolve(S)):null,h=t.theme?.venue3d?.shellAssetUrl,g=await Si(h,S=>this.buyerAssetUrls.resolve(S));if(l!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let m={doc:t,seats:c,...u?{eventConfigurationId:u.id,eventConfiguration:u}:{},...g?{registeredShellGlb:g}:{}};a.textContent=this.tf("picker.building3d","Building venue geometry\u2026");let v=await d.prepareVenue3D(m);if(l!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;let k=d.mountVenue3D(i,{...m,prepared:v},{portraitOverviewCrop:!0,arriveAtSeatEye:!0,lookAroundHint:yt(),seatViewActionLabel:S=>this.allSeats().find(L=>L.id===S)?.viewUrl?this.tf("picker.openAuthored360","Open venue 360\xB0"):this.tf("picker.lookAroundLive3d","Look around in live 3D"),seatViewCaption:S=>this.seatViewCaption(S),onSeatViewStopChange:S=>this.view3dSeatViewChrome?.onStopChange(S),onSeatPick:S=>this.onView3dSeatPick(S),onSeatInspect:S=>this.onView3dSeatPick(S),onSectionFocusChange:S=>{let L=i.querySelector('select[data-locator="section"]'),b=S??"";!L||L.value===b||(L.value=b,L.dispatchEvent(new Event("change")))},onViewTargetChange:S=>{i.querySelector(".sl-view3d-nav")?.classList.toggle("is-seat-focused",!!S),o(S),this.opts.onBuyerViewChange?.({view:"venue3d",...S?{seatId:S}:{}})},...this.seatViewEnabled()?{getSeatView:S=>new Promise((L,b)=>{let E=()=>{this.seatViewFor3d(S).then(I=>{I?L(I):b(new Error("seat_view_unavailable"))})},x=globalThis.requestIdleCallback;typeof x=="function"?x(E,{timeout:1500}):setTimeout(E,50)})}:{},onAnalytics:(S,L)=>this.emit3dAnalytics(S,L)});this.view3dHandle=k,this.view3dSeatViewChrome=As(i,{handle:()=>this.view3dHandle}),requestAnimationFrame(()=>a.remove()),this.pushAvailabilityTo3d(),this.syncSelectionTo3d(),this.view3dNav=Cs(this.regions["bottom-left"]??i,k),e&&k.flyToSeat(e)}catch(c){if(l!==this.view3dGen||this.buyerView!=="venue3d"||this.view3dEl!==i)return;this.opts.onError?.(c),this.toast(this.tf("picker.unavailable3d","3D could not start. The seat map is still available."),"warning"),this.exit3d()}}publish3dTopInset(){let e=this.regions["top-left"];if(!this.root||!e)return;let t=()=>{!this.root||this.root.dataset.view3d!=="on"||this.root.style.setProperty("--sl-3d-top-inset",`${Math.max(44,Math.ceil(e.offsetHeight))}px`)};t(),typeof requestAnimationFrame=="function"&&requestAnimationFrame(t)}exit3d(){if(this.buyerView!=="venue3d"&&!this.view3dEl)return;this.view3dGen++,this.buyerView="map",this.view3dTargetSeatId=null,this.opts.onBuyerViewChange?.({view:"map"}),this.root?.removeAttribute("data-view3d"),this.closeSeatConfidencePassport(!1),this.closeView3dComparison(!1),this.view3dCompareChip.remove(),this.view3dSeatViewChrome?.dispose(),this.view3dSeatViewChrome=null,this.view3dBack?.remove(),this.view3dBack=null,this.view3dNav?.remove(),this.view3dNav=null,this.root?.removeAttribute("data-view3d-seat"),this.root?.style.removeProperty("--sl-3d-top-inset");try{this.view3dHandle?.dispose()}catch{}this.view3dHandle=null;let e=this.view3dEl;this.view3dEl=null,e&&(e.style.opacity="0",setTimeout(()=>e.remove(),320)),this.syncProjection(),this.syncTray();let t=this.view3dReturnSeat;this.view3dReturnSeat=null,t&&this.committedSelection().some(i=>i.id===t.id)&&this.opts.confirmSelection!==!1&&this.showConfirm(t)}getCurrentHold(){return this.hold}async resumeHold(e){return this.resumeHoldFromServer(e,!1)}async removeHeldTicket(e){return this.removeHeldLabels([e])}async bestAvailable(e,t,i={}){if(this.salesClosed||this.bestAvailableBusy)return null;e=Math.max(1,Math.min(this.maxTickets,Math.floor(e)));try{return await this.bestAvailableOrThrow(e,t,i)}catch(r){this.opts.onError?.(r);let s=r?.reason,o=s==="not_enough_together"?(0,C.t)("picker.couldNotFindSeatsTogether",{count:e}):s==="companion_pair_required"?this.tf("picker.companionPairRequired","Select the adjacent wheelchair place with each companion ticket."):s==="ticket_option_not_applicable"?this.tf("picker.ticketOptionNotApplicable","That ticket choice is not available for the selected seat."):s==="sold_out"?this.tf("picker.ticketTypeSoldOut","That ticket type is sold out. Try another ticket type."):s==="event_closed"?this.tf("picker.seatSalesClosedForEvent","Seat sales have closed for this event."):this.tf("picker.seatsNoLongerAvailableTryAnother","Those seats are no longer available. Try another quantity or ticket type.");return this.toast(o,"error"),null}}async bestAvailableOrThrow(e,t,i={}){if(this.salesClosed)throw new Error("seatlayer: seat sales are closed");if(this.bestAvailableBusy)throw new Error("seatlayer: Best Available is already in progress");if(!Number.isInteger(e)||e<1)throw new Error("seatlayer: Best Available quantity must be a positive integer");this.confirmSeat&&this.cancelConfirm(),this.bestAvailableConfirm=!1,this.bestAvailableBusy=!0;let r=this.els.tray?.querySelector(".sl-ba-go");r&&(r.disabled=!0,r.classList.add("sl-busy"),r.innerHTML=`<span class="sl-ba-spin" aria-hidden="true"></span>${this.tf("picker.findingEllipsis","Finding\u2026")}`);try{let s=await this.controller.bestAvailable(e,t,{...i,ttlMs:this.opts.holdTtlMs});return s?(this.hold={holdId:s.holdId,expiresAt:s.expiresAt,seats:s.seats,items:s.items},this.handedOff=!1,this.bookedShown=!1,this.gaQty.clear(),this.startHoldTimer(s.expiresAt),this.flashHeldSeats(this.hold),this.syncTray(),this.emitHoldChange(),i.preferPremium&&s.seats.length&&!s.seats.every(o=>o.commercial?.premium)&&this.toast((0,C.t)("picker.premiumFallbackNote",{count:e}),"neutral"),this.hold):null}finally{this.bestAvailableBusy=!1,this.syncTray()}}async release(){let e=this.hold,t=this.controller.currentHold(),i=!0;if(t)i=await this.controller.release();else if(e){let r=[...new Set([...(e.items??[]).map(s=>s.label),...(e.seats??[]).map(s=>s.label)])];if(r.length)try{await this.api.release(this.opts.event,r,e.holdId)}catch(s){this.opts.onError?.(s),i=!1}}if(!i){this.toast(this.tf("picker.couldNotReleaseTickets","Couldn't release your tickets. Your hold is unchanged."),"error");return}this.hold=null,this.forgetHold(),this.handedOff=!1,this.bookedShown=!1,this.ctaPhase="idle",this.stopHoldTimer(),this.gaQty.clear(),this.syncTray(),this.emitHoldChange()}startRealtime(){if(!this.access?.configured||!this.pubApi||this.realtime)return;let e=this.opts.event;this.realtime=new ve({url:this.pubApi.subscribeUrl(e),mintTicket:()=>this.pubApi.subscribeTicket(e),onAccessUnavailable:t=>{this.opts.onAccessUnavailable?.(t),this.showAccessPanel(t)},sink:st(this.controller,{flashOnLiveChange:!0,onStatusChange:()=>{this.syncPrices(),this.scheduleOfferRefresh(!0),this.detectBooked(),this.minimap?.refreshMinimap(),this.pushAvailabilityTo3d()},onSelectedObjectUnavailable:(t,i)=>{this.opts.onSelectedObjectUnavailable?.({labels:t,reason:i}),this.syncTray(),this.toast(i==="ineligible"?this.tf("picker.seatNoLongerYours","Some seats are no longer available to you. They have been removed from your order."):this.tf("picker.seatTaken","Someone else took a seat you had picked. It has been removed from your order."),"warning")}})}),this.realtime.start()}async refreshAccess(){return!this.access?.configured||!await this.access.refresh("manual")?!1:(this.dismissAccessPanel(),await this.controller.refresh(),this.realtime?this.realtime.restart():this.startRealtime(),!0)}showAccessPanel(e){if(this.destroyed||!this.root)return;this.dismissAccessPanel();let t=ys(e.reason,()=>this.refreshAccess());(this.root.querySelector(".sl-body")??this.root).appendChild(t),this.accessEl=t}dismissAccessPanel(){this.accessEl?.remove(),this.accessEl=null}destroy(){this.destroyed=!0,En(this),this.colorSchemeStop?.(),this.colorSchemeStop=null,this.realtime?.stop(),this.realtime=null,this.dismissAccessPanel(),this.access?.clear(),this.hold&&!this.handedOff&&this.controller.release(),this.closeConfirm(),this.dismissTableDialog(!1),Le(this,!1),this.closeSeatView(),this.closeCheckoutPanel(),this.exit3d(),this.buyerAssetUrls.dispose(),this.stopHoldTimer(),this.detachAttention?.(),this.toastTimer&&clearTimeout(this.toastTimer),this.liveTimer&&clearTimeout(this.liveTimer),this.offerRefreshTimer&&clearTimeout(this.offerRefreshTimer),this.offerBoundaryTimer&&clearTimeout(this.offerBoundaryTimer),this.offerRefreshTimer=null,this.offerBoundaryTimer=null,this.offerVisibilityHandler&&(document.removeEventListener("visibilitychange",this.offerVisibilityHandler),this.offerVisibilityHandler=null);for(let e of this.motionTimers)clearTimeout(e);this.motionTimers.clear(),this.ro?.disconnect(),this.ro=null,this.framedFs&&this.setFramedFs(!1),this.escHandler&&document.removeEventListener("keydown",this.escHandler),this.fsChangeHandler&&document.removeEventListener("fullscreenchange",this.fsChangeHandler),this.fsEscHandler&&window.removeEventListener("keydown",this.fsEscHandler),this.controller.destroy(),this.projectionEl=null,this.root?.remove(),this.root=null,this.modalScrim&&(this.modalScrim.remove(),this.modalScrim=null,this.prevFocus?.isConnected&&this.prevFocus.focus({preventScroll:!0}),this.prevFocus=null)}};var je=require("@seatlayer/core");var Bo="seatlayer-performance-group-picker-style";function No(){if(document.getElementById(Bo))return;let n=document.createElement("style");n.id=Bo,n.textContent=`
|
|
2687
2687
|
.sl-pg-root{display:grid;gap:12px;min-width:0;color:var(--sl-text,#18202b);font-family:var(--sl-font,Inter,system-ui,sans-serif)}
|
|
2688
2688
|
.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)}
|