@seatlayer/js 0.109.1 → 0.110.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{b as V,c as be,d as ls,f as $e,g as He}from"./chunk-HHV7F37Y.js";import{m as H}from"./chunk-T57HSGPG.js";import"./chunk-UBFNMA7U.js";import"./chunk-OSZ7DOEH.js";function st(e){let t=new Map,o=new Map;for(let a of e){let n=t.get(a.sectionId)??{id:a.sectionId,label:a.sectionLabel,words:nt(a.sectionLabel),labels:[]};n.labels.push(a.label),t.set(a.sectionId,n);let i=o.get(a.rowKey)??{key:a.rowKey,row:a.row,sectionId:a.sectionId,sectionLabel:a.sectionLabel,labels:[]};i.labels.push(a.label),o.set(a.rowKey,i)}return{seats:e,sections:[...t.values()],rows:[...o.values()]}}var os={free:"free",available:"free",held:"held",hold:"held",sold:"booked",booked:"booked",blocked:"blocked"};function rs(e,t){let o=/[a-z0-9]+/g,a=0;for(let n=0;n<t;n+=1){let i=o.exec(e);if(!i)break;a=i.index+i[0].length}return e.slice(a).replace(/^[^a-z0-9]+/,"")}var Se=e=>e.toLowerCase().replace(/[^a-z0-9]/g,""),nt=e=>e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean),is=/^(?:row\s*)?([a-z]{1,3}|\d{1,3})\s*[-\s]?\s*(\d{1,4})(?:\s*(?:-|to)\s*(?:[a-z]{1,3}\s*-?\s*)?(\d{1,4}))?$/,ds=/^(?:row\s*)([a-z]{1,3}|\d{1,3})$|^([a-z]{1,2})$/;function Ue(e,t,o){let a=t.trim().toLowerCase(),n={seats:[],rows:[],sections:[],state:null};if(!a)return n;let i=os[a];if(i)return n.state={status:i,labels:e.seats.filter(r=>o(r.label)===i).map(r=>r.label)},n;let x=nt(a),h=null;for(let r of e.sections){let c=0;for(;c<x.length&&c<r.words.length&&r.words[c].startsWith(x[c]);)c+=1;if(c===x.length)n.sections.push(r);else if(c===r.words.length&&c>0&&x.slice(0,c).every((b,S)=>b===r.words[S])){let b=rs(a,c);h=h&&h.rest===b?h:{ids:new Set,rest:b},h.ids.add(r.id)}}let w=h?h.rest:a,d=r=>!h||h.ids.has(r),u=is.exec(w);if(u){let[,r,c,b]=u,S=Number(c),R=b?Number(b):S;n.seats=e.seats.filter(I=>d(I.sectionId)&&Se(I.row)===r&&Number(I.number)>=Math.min(S,R)&&Number(I.number)<=Math.max(S,R))}let T=ds.exec(w),k=T?.[1]??T?.[2];if(k&&(n.rows=e.rows.filter(r=>d(r.sectionId)&&Se(r.row)===k)),!n.seats.length&&!n.rows.length&&!n.sections.length&&Se(a).length>=2){let r=Se(a);n.seats=e.seats.filter(c=>Se(c.label).includes(r)||Se(`${c.sectionLabel}${c.row}${c.number}`).includes(r))}return n}function at(e,t,o){let a=e.lastIndexOf("-"),n=a>0?e.slice(0,a):e,i=a>0?e.slice(a+1):"";return{row:o?.trim()||(n.toLowerCase().startsWith(`${t.toLowerCase()} `)?n.slice(t.length+1):n),number:i}}var cs={seat:'<path d="M7 11V6.5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2V11"/><path d="M5 11h14v4H5z"/><path d="M7 15v4.5M17 15v4.5"/>',row:'<circle cx="5" cy="12" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="19" cy="12" r="2"/>',section:'<path d="M12 3.5l8.5 4.5L12 12.5 3.5 8z"/><path d="M3.5 12L12 16.5 20.5 12"/><path d="M3.5 16L12 20.5 20.5 16"/>',ticket:'<path d="M3.5 7.5h17v3a2 2 0 0 0 0 4v3h-17v-3a2 2 0 0 0 0-4z"/>',search:'<circle cx="11" cy="11" r="6.5"/><path d="M16 16l4.5 4.5"/>',user:'<circle cx="12" cy="8" r="4"/><path d="M4 20c1.5-4 4.5-6 8-6s6.5 2 8 6"/>',bookmark:'<path d="M6.5 3.5h11v17l-5.5-4-5.5 4z"/>',map:'<path d="M3.5 6.5l5-2 7 2.5 5-2v13l-5 2-7-2.5-5 2z"/><path d="M8.5 4.5v13M15.5 7v13"/>',cursor:'<path d="M5 3.5l13 7-5.6 1.6L10 18z"/>',alert:'<path d="M12 3.8l9.3 16.2H2.7z"/><path d="M12 10v4.5M12 17.3v.2"/>',ban:'<circle cx="12" cy="12" r="8.5"/><path d="M6 18L18 6"/>',x:'<path d="M6.5 6.5l11 11M17.5 6.5l-11 11"/>',star:'<path d="M12 3.8l2.5 5.2 5.7.8-4.1 4 1 5.6L12 16.8l-5.1 2.6 1-5.6-4.1-4 5.7-.8z"/>'},ve=(e,t,o=15)=>`<svg width="${o}" height="${o}" viewBox="0 0 24 24" fill="none" stroke="${t}" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${cs[e]}</svg>`,qe=(e,t,o)=>`<span class="plate" style="background:color-mix(in srgb,${t} 15%,transparent)">${ve(e,t,o)}</span>`,ee=e=>String(e??"").replace(/[&<>"']/g,t=>`&#${t.charCodeAt(0)};`),We={free:"Free",held:"In a cart",booked:"Sold",blocked:"Blocked"},lt={free:"#22a06b",held:"#d99a0b",booked:"#8a94a6",blocked:"#d64545"},ms={refunded:"Refunded",cancelled:"Cancelled",pending:"Pending",partially_refunded:"Part refunded"},ps=e=>{let t=Math.round((Date.now()-e)/6e4);return t<1?"just now":t<60?`${t} min ago`:t<1440?`${Math.round(t/60)} h ago`:"earlier"},us=e=>V(e,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});function gs(e){let t=[...new Set(e)],o=(n,i)=>n.localeCompare(i,void 0,{numeric:!0});if(t.length<2||!(t.every(n=>/^[A-Z]{1,2}$/i.test(n))||t.every(n=>/^\d+$/.test(n))))return"";let a=t.sort(o);return`This chart has rows ${a[0]} to ${a[a.length-1]}. `}var Le=8,ot=`
1
+ import{b as V,c as be,d as ls,f as $e,g as He}from"./chunk-JS5WH7YG.js";import{m as H}from"./chunk-3IZZM7EV.js";import"./chunk-3FEGZ5HA.js";import"./chunk-7I563G2N.js";function st(e){let t=new Map,o=new Map;for(let a of e){let n=t.get(a.sectionId)??{id:a.sectionId,label:a.sectionLabel,words:nt(a.sectionLabel),labels:[]};n.labels.push(a.label),t.set(a.sectionId,n);let i=o.get(a.rowKey)??{key:a.rowKey,row:a.row,sectionId:a.sectionId,sectionLabel:a.sectionLabel,labels:[]};i.labels.push(a.label),o.set(a.rowKey,i)}return{seats:e,sections:[...t.values()],rows:[...o.values()]}}var os={free:"free",available:"free",held:"held",hold:"held",sold:"booked",booked:"booked",blocked:"blocked"};function rs(e,t){let o=/[a-z0-9]+/g,a=0;for(let n=0;n<t;n+=1){let i=o.exec(e);if(!i)break;a=i.index+i[0].length}return e.slice(a).replace(/^[^a-z0-9]+/,"")}var Se=e=>e.toLowerCase().replace(/[^a-z0-9]/g,""),nt=e=>e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean),is=/^(?:row\s*)?([a-z]{1,3}|\d{1,3})\s*[-\s]?\s*(\d{1,4})(?:\s*(?:-|to)\s*(?:[a-z]{1,3}\s*-?\s*)?(\d{1,4}))?$/,ds=/^(?:row\s*)([a-z]{1,3}|\d{1,3})$|^([a-z]{1,2})$/;function Ue(e,t,o){let a=t.trim().toLowerCase(),n={seats:[],rows:[],sections:[],state:null};if(!a)return n;let i=os[a];if(i)return n.state={status:i,labels:e.seats.filter(r=>o(r.label)===i).map(r=>r.label)},n;let x=nt(a),h=null;for(let r of e.sections){let c=0;for(;c<x.length&&c<r.words.length&&r.words[c].startsWith(x[c]);)c+=1;if(c===x.length)n.sections.push(r);else if(c===r.words.length&&c>0&&x.slice(0,c).every((b,S)=>b===r.words[S])){let b=rs(a,c);h=h&&h.rest===b?h:{ids:new Set,rest:b},h.ids.add(r.id)}}let w=h?h.rest:a,d=r=>!h||h.ids.has(r),u=is.exec(w);if(u){let[,r,c,b]=u,S=Number(c),R=b?Number(b):S;n.seats=e.seats.filter(I=>d(I.sectionId)&&Se(I.row)===r&&Number(I.number)>=Math.min(S,R)&&Number(I.number)<=Math.max(S,R))}let T=ds.exec(w),k=T?.[1]??T?.[2];if(k&&(n.rows=e.rows.filter(r=>d(r.sectionId)&&Se(r.row)===k)),!n.seats.length&&!n.rows.length&&!n.sections.length&&Se(a).length>=2){let r=Se(a);n.seats=e.seats.filter(c=>Se(c.label).includes(r)||Se(`${c.sectionLabel}${c.row}${c.number}`).includes(r))}return n}function at(e,t,o){let a=e.lastIndexOf("-"),n=a>0?e.slice(0,a):e,i=a>0?e.slice(a+1):"";return{row:o?.trim()||(n.toLowerCase().startsWith(`${t.toLowerCase()} `)?n.slice(t.length+1):n),number:i}}var cs={seat:'<path d="M7 11V6.5a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2V11"/><path d="M5 11h14v4H5z"/><path d="M7 15v4.5M17 15v4.5"/>',row:'<circle cx="5" cy="12" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="19" cy="12" r="2"/>',section:'<path d="M12 3.5l8.5 4.5L12 12.5 3.5 8z"/><path d="M3.5 12L12 16.5 20.5 12"/><path d="M3.5 16L12 20.5 20.5 16"/>',ticket:'<path d="M3.5 7.5h17v3a2 2 0 0 0 0 4v3h-17v-3a2 2 0 0 0 0-4z"/>',search:'<circle cx="11" cy="11" r="6.5"/><path d="M16 16l4.5 4.5"/>',user:'<circle cx="12" cy="8" r="4"/><path d="M4 20c1.5-4 4.5-6 8-6s6.5 2 8 6"/>',bookmark:'<path d="M6.5 3.5h11v17l-5.5-4-5.5 4z"/>',map:'<path d="M3.5 6.5l5-2 7 2.5 5-2v13l-5 2-7-2.5-5 2z"/><path d="M8.5 4.5v13M15.5 7v13"/>',cursor:'<path d="M5 3.5l13 7-5.6 1.6L10 18z"/>',alert:'<path d="M12 3.8l9.3 16.2H2.7z"/><path d="M12 10v4.5M12 17.3v.2"/>',ban:'<circle cx="12" cy="12" r="8.5"/><path d="M6 18L18 6"/>',x:'<path d="M6.5 6.5l11 11M17.5 6.5l-11 11"/>',star:'<path d="M12 3.8l2.5 5.2 5.7.8-4.1 4 1 5.6L12 16.8l-5.1 2.6 1-5.6-4.1-4 5.7-.8z"/>'},ve=(e,t,o=15)=>`<svg width="${o}" height="${o}" viewBox="0 0 24 24" fill="none" stroke="${t}" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${cs[e]}</svg>`,qe=(e,t,o)=>`<span class="plate" style="background:color-mix(in srgb,${t} 15%,transparent)">${ve(e,t,o)}</span>`,ee=e=>String(e??"").replace(/[&<>"']/g,t=>`&#${t.charCodeAt(0)};`),We={free:"Free",held:"In a cart",booked:"Sold",blocked:"Blocked"},lt={free:"#22a06b",held:"#d99a0b",booked:"#8a94a6",blocked:"#d64545"},ms={refunded:"Refunded",cancelled:"Cancelled",pending:"Pending",partially_refunded:"Part refunded"},ps=e=>{let t=Math.round((Date.now()-e)/6e4);return t<1?"just now":t<60?`${t} min ago`:t<1440?`${Math.round(t/60)} h ago`:"earlier"},us=e=>V(e,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"});function gs(e){let t=[...new Set(e)],o=(n,i)=>n.localeCompare(i,void 0,{numeric:!0});if(t.length<2||!(t.every(n=>/^[A-Z]{1,2}$/i.test(n))||t.every(n=>/^\d+$/.test(n))))return"";let a=t.sort(o);return`This chart has rows ${a[0]} to ${a[a.length-1]}. `}var Le=8,ot=`
2
2
  .slm-search-scrim{position:absolute;inset:0;z-index:40;display:flex;justify-content:center;align-items:flex-start;padding-top:72px;background:rgba(12,18,32,.32)}
3
3
  .slm-search{--sw:var(--slm-surface);--sc:color-mix(in srgb,var(--slm-text) 4%,var(--slm-surface));width:min(620px,calc(100% - 32px));max-height:calc(100% - 110px);display:flex;flex-direction:column;border-radius:16px;background:var(--sw);color:var(--slm-text);border:1px solid var(--slm-line);box-shadow:0 30px 80px rgba(0,0,0,.28);overflow:hidden}
4
4
  .slm-search-field{display:flex;align-items:center;gap:9px;margin:12px 14px;padding:0 10px;height:38px;border-radius:10px;border:1px solid var(--slm-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--slm-accent) 30%,transparent)}
@@ -346,7 +346,7 @@ import{b as V,c as be,d as ls,f as $e,g as He}from"./chunk-HHV7F37Y.js";import{m
346
346
  .slm .slm-trendcard button{display:inline-flex;margin-top:10px;height:26px;align-items:center;padding:0 9px;border-radius:8px;border:1px solid var(--slm-accent);background:color-mix(in srgb,var(--slm-accent) 14%,var(--slm-surface));font-size:12px;font-weight:600;color:var(--slm-text)}
347
347
  .slm.compact .slm-arrival-why{display:none}
348
348
  .slm.compact .slm-arrival{top:56px}.slm.compact .slm-arrival-note{top:100px}
349
- `;var j={free:"#1f9d6b",sold:"#9ca3af",held:"#f4b740",ring:"#d99a0b",reserved:"#c026d3",blocked:"#d64545",typeA:"#2f9d46",typeB:"#5b7bff",typeC:"#e8456b",typeD:"#bc800b",pub:"#c9d0dc",box:"#e8782a",member:"#7c5cff"};function ae(e,t=""){let o="";for(let a=0;a<6;a++)for(let n=0;n<12;n++){let i=22+n*18.5,x=24+a*17+Math.pow(n-5.5,2)*.22,h=e(a,n);h&&(o+=`<circle cx="${i.toFixed(1)}" cy="${x.toFixed(1)}" r="6" fill="${h.fill}"${h.fill==="#ffffff"?' stroke="#9ca3af" stroke-width="1"':""}/>`,h.ring&&(o+=`<circle cx="${i.toFixed(1)}" cy="${x.toFixed(1)}" r="8.4" fill="none" stroke="${h.ring}" stroke-width="1.6"/>`),h.cross&&(o+=`<path d="M${(i-3).toFixed(1)} ${(x-3).toFixed(1)}l6 6" stroke="${j.blocked}" stroke-width="1.6" stroke-linecap="round"/>`))}return`<svg viewBox="0 0 250 130" aria-hidden="true"><rect width="250" height="130" class="slm-ex-ground"/>${o}${t}</svg>`}var ue=(e,t)=>(e*7+t*3)%5===0,me=(e,t)=>(e===2||e===3)&&t>=3&&t<=8&&!ue(e,t),Bt=(e,t)=>({fill:ue(e,t)?j.sold:j.free});function Nt(e){let t=(o,a,n)=>`<path d="M${o} 104 q34 -64 68 0 z" fill="${a}"${n?' opacity=".55"':""}/>`+(n?`<path d="M${o+14} 100l20 -30M${o+26} 102l20 -30M${o+38} 102l14 -20" stroke="#64748b" stroke-width="1.4"/>`:"");return'<svg viewBox="0 0 250 130" aria-hidden="true"><rect width="250" height="130" class="slm-ex-ground"/><rect x="85" y="14" width="80" height="14" rx="4" fill="#64748b" opacity=".45"/>'+t(12,j.free,!1)+t(91,e?j.sold:j.free,e)+t(170,j.free,!1)+"</svg>"}function qt(e){let t="";for(let a=0;a<8;a++){let n=a/8*Math.PI*2,i=e?j.free:a===1||a===2?j.sold:j.free;t+=`<circle cx="${(125+Math.cos(n)*44).toFixed(1)}" cy="${(65+Math.sin(n)*44).toFixed(1)}" r="8" fill="${i}"/>`}let o=e?`<circle cx="125" cy="65" r="56" fill="none" stroke="${j.ring}" stroke-width="2" stroke-dasharray="5 4"/>`:"";return`<svg viewBox="0 0 250 130" aria-hidden="true"><rect width="250" height="130" class="slm-ex-ground"/><circle cx="125" cy="65" r="28" fill="#94a3b8" opacity=".35"/>${t}${o}</svg>`}function nn(e){let t=e?"Tap":"Click",o=(a,n)=>a===3&&n===6;return{watch:{title:"How Watch works",glyph:"eye",hue:"#3b82f6",before:ae(Bt),after:ae((a,n)=>({fill:ue(a,n)||o(a,n)?j.sold:j.free,ring:o(a,n)?j.ring:void 0}),'<rect x="150" y="6" width="92" height="30" rx="7" fill="#0f172a" opacity=".85"/><text x="158" y="19" fill="#fff" font-size="9" font-weight="700">Sold \xB7 Stalls C D-7</text><text x="158" y="30" fill="#cbd5e1" font-size="8">Booking #9845</text>'),name:"Answer any question about a seat",purpose:`${t} a seat, or search it, to see its status, booking and buyer, and its history.`,steps:[e?"Tap the search icon and type a seat, booking or buyer.":"Press \u2318K and type a seat, booking or buyer.","Read the seat card and its history.","Open the order if it needs changing."],not:"changing seats; pick a task first."},reserve:{title:"How Reserve works",glyph:"bookmark",hue:"#c026d3",before:ae((a,n)=>({fill:ue(a,n)?j.sold:j.free,ring:me(a,n)?j.ring:void 0})),after:ae((a,n)=>({fill:ue(a,n)?j.sold:me(a,n)?"#ffffff":j.free,ring:me(a,n)?j.reserved:void 0})),name:"Keep seats aside under a name",purpose:"Reserved seats leave sale for guests, press or comps, and come back when you release them or their time runs out.",steps:["Pick free seats.","Name it and choose when it goes back on sale.","Press Reserve. Release any time from On this event."],not:"seats that should never be sold; Block them."},block:{title:"How Block works",glyph:"ban",hue:"#d64545",before:ae((a,n)=>({fill:ue(a,n)?j.sold:j.free,ring:me(a,n)?j.ring:void 0})),after:ae((a,n)=>({fill:ue(a,n)?j.sold:me(a,n)?"#ffffff":j.free,cross:me(a,n)})),name:"Take seats off sale",purpose:"Buyers cannot pick blocked seats. Give a reason so the team knows why.",steps:["Pick seats (sold seats and seats in a cart are skipped).","Add a reason and, if you like, when they go back on sale.","Press Block."],not:"keeping seats for named guests; Reserve them."},types:{title:"How Ticket types works",glyph:"tag",hue:"#8b5cf6",before:ae((a,n)=>({fill:j.typeA,ring:me(a,n)?j.ring:void 0})),after:ae((a,n)=>({fill:me(a,n)?j.typeB:j.typeA})),name:"Move seats to another ticket type",purpose:"For this event only. The chart keeps its design, and sold seats keep what the buyer paid.",steps:["Pick seats on the map.",'Choose the ticket type under "Move them to".',"Press Move. Undo from the footer."],not:"changing the price of a ticket type; that is Pricing and availability."},sections:{title:"How Sections works",glyph:"layers",hue:"#0ea5a5",before:Nt(!1),after:Nt(!0),name:"Open, close or hide whole sections",purpose:"For this event: now, at a set time, or when the rest of the venue sells.",steps:["Pick a section in the list.","Choose Open, Close or Hide, now or at a time.","It saves at once. Buyers with seats in their cart can still finish."],not:"single seats; Block them."},tables:{title:"How Tables works",glyph:"table",hue:"#65a30d",before:qt(!1),after:qt(!0),name:"Sell a table whole, or chair by chair",purpose:"For this event. A whole table goes to one buyer; chairs already sold keep their buyer.",steps:["Pick tables in the list or on the map.","Switch Per chair or Whole table.","Save."],not:"moving chairs or changing the room; that is the chart designer."},channels:{title:"How Channels works",glyph:"route",hue:"#ea7a1e",before:ae((a,n)=>({fill:j.pub,ring:me(a,n)?j.ring:void 0})),after:ae((a,n)=>({fill:me(a,n)?j.box:j.pub})),name:"Give seats to a sales channel",purpose:"Box office, a partner or members sell these seats; public sale stops seeing them.",steps:["Choose the channel.","Pick seats on the map.","Review the counts and save."],not:"changing prices; channels can have their own in Pricing."},search:{title:"How search works",glyph:"search",hue:"#4c6fff",before:ae(Bt),after:ae((a,n)=>({fill:ue(a,n)?j.sold:j.free,ring:o(a,n)?j.ring:void 0}),'<rect x="40" y="4" width="170" height="16" rx="8" fill="#0f172a" opacity=".85"/><text x="52" y="15.5" fill="#fff" font-size="8.5">\u2315 D-7</text>'),name:"Find a seat, row, section, booking or buyer",purpose:e?"Tap the search icon anywhere in the room. Results show status and price; bookings show their buyer.":"Press \u2318K anywhere in the room. Results show status and price; bookings show their buyer.",steps:["Type what you know: G-5, \u201CStalls C\u201D, #9845, a name or an email.",e?"Tap a result to show it; in a seat task it selects it.":"\u21B5 shows it; in a seat task it selects it; \u21E7\u21B5 adds it.","Open order goes to the booking."],not:"changing seats; that is a task."}}}var an=[{key:"status",label:"Status",hint:"What a buyer can buy right now",paint:(e,t)=>({fill:ue(e,t)?j.sold:(e+t)%9===0?j.held:j.free})},{key:"type",label:"Ticket type",hint:"Which ticket type each seat sells as",paint:e=>({fill:[j.typeD,j.typeD,j.typeC,j.typeA,j.typeA,j.typeB][e]})},{key:"price",label:"Price",hint:"What each seat costs, darker costs more",paint:e=>({fill:["#1f43a8","#3a62d2","#5f88ee","#5f88ee","#8db0fa","#bfd3ff"][e]})},{key:"channel",label:"Channel",hint:"Who can sell each seat",paint:(e,t)=>({fill:t<3?j.box:e===0?j.member:j.pub})}],ln='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg>',on='<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg>';function rn(e,t){e.root.querySelector(".slm-ex-scrim")?.remove();let o=e.touch&&e.root.clientWidth<820,a=document.activeElement,n=document.createElement("div");n.className=`slm-ex-scrim${o?" sheet":""}`;let i,x,h,w,d=!1;if(t==="colours")i="How colours work",x="palette",h="#8b5cf6",d=!0,w=`<p class="slm-ex-lead">The map can colour seats four ways. Pick the one that answers your question; nothing about the seats changes.</p><div class="slm-ex-modes">${an.map(r=>`<div class="slm-ex-card">${ae(r.paint)}<b>${H(r.label)}</b><span>${H(r.hint)}.</span></div>`).join("")}</div><ol class="slm-ex-steps3"><li><span>Open <b>Colour by</b> at the top-left of the map.</span></li><li><span>Choose a mode. The legend counts free seats of each colour, live.</span></li><li><span>${e.touch?"Tap a legend item to light up those seats.":"Click a legend item to light those seats up; \u21E7 click selects them."}</span></li></ol>`;else{let r=nn(e.touch)[t];i=r.title,x=r.glyph,h=r.hue,w=`<div class="slm-ex-card"><div class="slm-ex-pics"><div>${r.before}</div><i>${on}</i><div>${r.after}</div></div><b>${H(r.name)}</b><p>${H(r.purpose)}</p><ol>${r.steps.map(c=>`<li>${H(c)}</li>`).join("")}</ol><p class="slm-ex-not"><b>Not for:</b> ${H(r.not)}</p></div>`}let u=t==="search"?e.touch?"Try search now":"Try \u2318K now":t==="colours"?"Try it on this map":"Try it here";n.innerHTML=`<div class="slm-ex${d?" wide":""}" role="dialog" aria-modal="true" aria-labelledby="slm-ex-title">`+(o?'<span class="slm-ex-grab" aria-hidden="true"></span>':"")+`<div class="slm-ex-head">${e.plate(x,h,34)}<b id="slm-ex-title">${H(i)}</b><button type="button" class="slm-ex-x" data-ex-close aria-label="Close">${ln}</button></div><div class="slm-ex-body">${w}</div><div class="slm-ex-foot">${e.guideUrl?`<a href="${H(e.guideUrl)}" target="_blank" rel="noopener">Full guide in docs \u2197</a>`:""}<span></span><button type="button" class="slm-btn ghost s" data-ex-try>${H(u)}</button><button type="button" class="slm-btn s" data-ex-close>Got it</button></div></div>`;let T=()=>{n.remove(),document.removeEventListener("keydown",k,!0),a?.focus?.({preventScroll:!0})},k=r=>{if(r.key==="Escape"){r.stopPropagation(),T();return}if(r.key!=="Tab")return;let c=[...n.querySelectorAll("button, a[href]")],b=c[0],S=c[c.length-1];r.shiftKey&&document.activeElement===b?(r.preventDefault(),S.focus()):!r.shiftKey&&document.activeElement===S&&(r.preventDefault(),b.focus())};return n.addEventListener("click",r=>{let c=r.target;if(c===n||c.closest("[data-ex-close]")){T();return}c.closest("[data-ex-try]")&&(T(),e.tryIt(t))}),document.addEventListener("keydown",k,!0),e.root.append(n),n.querySelector("[data-ex-close].slm-btn")?.focus({preventScroll:!0}),{close:T}}var Dt=`
349
+ `;var j={free:"#1f9d6b",sold:"#9ca3af",held:"#f4b740",ring:"#d99a0b",reserved:"#c026d3",blocked:"#d64545",typeA:"#2f9d46",typeB:"#5b7bff",typeC:"#e8456b",typeD:"#bc800b",pub:"#c9d0dc",box:"#e8782a",member:"#7c5cff"};function ae(e,t=""){let o="";for(let a=0;a<6;a++)for(let n=0;n<12;n++){let i=22+n*18.5,x=24+a*17+Math.pow(n-5.5,2)*.22,h=e(a,n);h&&(o+=`<circle cx="${i.toFixed(1)}" cy="${x.toFixed(1)}" r="6" fill="${h.fill}"${h.fill==="#ffffff"?' stroke="#9ca3af" stroke-width="1"':""}/>`,h.ring&&(o+=`<circle cx="${i.toFixed(1)}" cy="${x.toFixed(1)}" r="8.4" fill="none" stroke="${h.ring}" stroke-width="1.6"/>`),h.cross&&(o+=`<path d="M${(i-3).toFixed(1)} ${(x-3).toFixed(1)}l6 6" stroke="${j.blocked}" stroke-width="1.6" stroke-linecap="round"/>`))}return`<svg viewBox="0 0 250 130" aria-hidden="true"><rect width="250" height="130" class="slm-ex-ground"/>${o}${t}</svg>`}var ue=(e,t)=>(e*7+t*3)%5===0,me=(e,t)=>(e===2||e===3)&&t>=3&&t<=8&&!ue(e,t),Bt=(e,t)=>({fill:ue(e,t)?j.sold:j.free});function Nt(e){let t=(o,a,n)=>`<path d="M${o} 104 q34 -64 68 0 z" fill="${a}"${n?' opacity=".55"':""}/>`+(n?`<path d="M${o+14} 100l20 -30M${o+26} 102l20 -30M${o+38} 102l14 -20" stroke="#64748b" stroke-width="1.4"/>`:"");return'<svg viewBox="0 0 250 130" aria-hidden="true"><rect width="250" height="130" class="slm-ex-ground"/><rect x="85" y="14" width="80" height="14" rx="4" fill="#64748b" opacity=".45"/>'+t(12,j.free,!1)+t(91,e?j.sold:j.free,e)+t(170,j.free,!1)+"</svg>"}function qt(e){let t="";for(let a=0;a<8;a++){let n=a/8*Math.PI*2,i=e?j.free:a===1||a===2?j.sold:j.free;t+=`<circle cx="${(125+Math.cos(n)*44).toFixed(1)}" cy="${(65+Math.sin(n)*44).toFixed(1)}" r="8" fill="${i}"/>`}let o=e?`<circle cx="125" cy="65" r="56" fill="none" stroke="${j.ring}" stroke-width="2" stroke-dasharray="5 4"/>`:"";return`<svg viewBox="0 0 250 130" aria-hidden="true"><rect width="250" height="130" class="slm-ex-ground"/><circle cx="125" cy="65" r="28" fill="#94a3b8" opacity=".35"/>${t}${o}</svg>`}function nn(e){let t=e?"Tap":"Click",o=(a,n)=>a===3&&n===6;return{watch:{title:"How Watch works",glyph:"eye",hue:"#3b82f6",before:ae(Bt),after:ae((a,n)=>({fill:ue(a,n)||o(a,n)?j.sold:j.free,ring:o(a,n)?j.ring:void 0}),'<rect x="150" y="6" width="92" height="30" rx="7" fill="#0f172a" opacity=".85"/><text x="158" y="19" fill="#fff" font-size="9" font-weight="700">Sold \xB7 Stalls C D-7</text><text x="158" y="30" fill="#cbd5e1" font-size="8">Booking #9845</text>'),name:"Answer any question about a seat",purpose:`${t} a seat, or search it, to see its status, booking and buyer, and its history.`,steps:[e?"Tap the search icon and type a seat, booking or buyer.":"Press \u2318K and type a seat, booking or buyer.","Read the seat card and its history.","Open the order if it needs changing."],not:"changing seats; pick a task first."},reserve:{title:"How Reserve works",glyph:"bookmark",hue:"#c026d3",before:ae((a,n)=>({fill:ue(a,n)?j.sold:j.free,ring:me(a,n)?j.ring:void 0})),after:ae((a,n)=>({fill:ue(a,n)?j.sold:me(a,n)?"#ffffff":j.free,ring:me(a,n)?j.reserved:void 0})),name:"Keep seats aside under a name",purpose:"Reserved seats leave sale for guests, press or comps, and come back when you release them or their time runs out.",steps:["Pick free seats.","Name it and choose when it goes back on sale.","Press Reserve. Release any time from On this event."],not:"seats that should never be sold; Block them."},block:{title:"How Block works",glyph:"ban",hue:"#d64545",before:ae((a,n)=>({fill:ue(a,n)?j.sold:j.free,ring:me(a,n)?j.ring:void 0})),after:ae((a,n)=>({fill:ue(a,n)?j.sold:me(a,n)?"#ffffff":j.free,cross:me(a,n)})),name:"Take seats off sale",purpose:"Buyers cannot pick blocked seats. Give a reason so the team knows why.",steps:["Pick seats (sold seats and seats in a cart are skipped).","Add a reason and, if you like, when they go back on sale.","Press Block."],not:"keeping seats for named guests; Reserve them."},types:{title:"How Ticket types works",glyph:"tag",hue:"#8b5cf6",before:ae((a,n)=>({fill:j.typeA,ring:me(a,n)?j.ring:void 0})),after:ae((a,n)=>({fill:me(a,n)?j.typeB:j.typeA})),name:"Move seats to another ticket type",purpose:"For this event only. The chart keeps its design, and sold seats keep what the buyer paid.",steps:["Pick seats on the map.",'Choose the ticket type under "Move them to".',"Press Move. Undo from the footer."],not:"changing the price of a ticket type; that is Pricing and availability."},sections:{title:"How Sections works",glyph:"layers",hue:"#0ea5a5",before:Nt(!1),after:Nt(!0),name:"Open, close or hide whole sections",purpose:"For this event: now, at a set time, or when the rest of the venue sells.",steps:["Pick a section in the list.","Choose Open, Close or Hide, now or at a time.","It saves at once. Buyers with seats in their cart can still finish."],not:"single seats; Block them."},tables:{title:"How Tables works",glyph:"table",hue:"#65a30d",before:qt(!1),after:qt(!0),name:"Sell a table whole, or chair by chair",purpose:"For this event. A whole table goes to one buyer; chairs already sold keep their buyer.",steps:["Pick tables in the list or on the map.","Switch Per chair or Whole table.","Save."],not:"moving chairs or changing the room; that is the chart designer."},channels:{title:"How Channels works",glyph:"route",hue:"#ea7a1e",before:ae((a,n)=>({fill:j.pub,ring:me(a,n)?j.ring:void 0})),after:ae((a,n)=>({fill:me(a,n)?j.box:j.pub})),name:"Give seats to a sales channel",purpose:"Box office, a partner or members sell these seats; public sale stops seeing them.",steps:["Choose the channel.","Pick seats on the map.","Review the counts and save."],not:"changing prices; channels can have their own in Pricing."},search:{title:"How search works",glyph:"search",hue:"#4c6fff",before:ae(Bt),after:ae((a,n)=>({fill:ue(a,n)?j.sold:j.free,ring:o(a,n)?j.ring:void 0}),'<rect x="40" y="4" width="170" height="16" rx="8" fill="#0f172a" opacity=".85"/><text x="52" y="15.5" fill="#fff" font-size="8.5">\u2315 D-7</text>'),name:"Find a seat, row, section, booking or buyer",purpose:e?"Tap the search icon anywhere in the room. Results show status and price; bookings show their buyer.":"Press \u2318K anywhere in the room. Results show status and price; bookings show their buyer.",steps:["Type what you know: G-5, \u201CStalls C\u201D, #9845, a name or an email.",e?"Tap a result to show it; in a seat task it selects it.":"\u21B5 shows it; in a seat task it selects it; \u21E7\u21B5 adds it.","Open order goes to the booking."],not:"changing seats; that is a task."}}}var an=[{key:"status",label:"Status",hint:"What a buyer can buy right now",paint:(e,t)=>({fill:ue(e,t)?j.sold:(e+t)%9===0?j.held:j.free})},{key:"type",label:"Ticket type",hint:"Which ticket type each seat sells as",paint:e=>({fill:[j.typeD,j.typeD,j.typeC,j.typeA,j.typeA,j.typeB][e]})},{key:"price",label:"Price",hint:"What each seat costs, darker costs more",paint:e=>({fill:["#1f43a8","#3a62d2","#5f88ee","#5f88ee","#8db0fa","#bfd3ff"][e]})},{key:"channel",label:"Channel",hint:"Who can sell each seat",paint:(e,t)=>({fill:t<3?j.box:e===0?j.member:j.pub})}],ln='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg>',on='<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 6l6 6-6 6"/></svg>';function rn(e,t){e.root.querySelector(".slm-ex-scrim")?.remove();let o=e.touch&&e.root.clientWidth<820,a=document.activeElement,n=document.createElement("div");n.className=`slm-ex-scrim${o?" sheet":""}`;let i,x,h,w,d=!1;if(t==="colours")i="How colours work",x="palette",h="#8b5cf6",d=!0,w=`<p class="slm-ex-lead">The map can colour seats four ways. Pick the one that answers your question; nothing about the seats changes.</p><div class="slm-ex-modes">${an.map(r=>`<div class="slm-ex-card">${ae(r.paint)}<b>${H(r.label)}</b><span>${H(r.hint)}.</span></div>`).join("")}</div><ol class="slm-ex-steps3"><li><span>Open <b>Colour by</b> at the top-left of the map.</span></li><li><span>Choose a mode. The legend counts free seats of each colour, live.</span></li><li><span>${e.touch?"Tap a legend item to light up those seats and go to them.":"Click a legend item to light those seats up and go to them; \u21E7 click selects them."}</span></li></ol>`;else{let r=nn(e.touch)[t];i=r.title,x=r.glyph,h=r.hue,w=`<div class="slm-ex-card"><div class="slm-ex-pics"><div>${r.before}</div><i>${on}</i><div>${r.after}</div></div><b>${H(r.name)}</b><p>${H(r.purpose)}</p><ol>${r.steps.map(c=>`<li>${H(c)}</li>`).join("")}</ol><p class="slm-ex-not"><b>Not for:</b> ${H(r.not)}</p></div>`}let u=t==="search"?e.touch?"Try search now":"Try \u2318K now":t==="colours"?"Try it on this map":"Try it here";n.innerHTML=`<div class="slm-ex${d?" wide":""}" role="dialog" aria-modal="true" aria-labelledby="slm-ex-title">`+(o?'<span class="slm-ex-grab" aria-hidden="true"></span>':"")+`<div class="slm-ex-head">${e.plate(x,h,34)}<b id="slm-ex-title">${H(i)}</b><button type="button" class="slm-ex-x" data-ex-close aria-label="Close">${ln}</button></div><div class="slm-ex-body">${w}</div><div class="slm-ex-foot">${e.guideUrl?`<a href="${H(e.guideUrl)}" target="_blank" rel="noopener">Full guide in docs \u2197</a>`:""}<span></span><button type="button" class="slm-btn ghost s" data-ex-try>${H(u)}</button><button type="button" class="slm-btn s" data-ex-close>Got it</button></div></div>`;let T=()=>{n.remove(),document.removeEventListener("keydown",k,!0),a?.focus?.({preventScroll:!0})},k=r=>{if(r.key==="Escape"){r.stopPropagation(),T();return}if(r.key!=="Tab")return;let c=[...n.querySelectorAll("button, a[href]")],b=c[0],S=c[c.length-1];r.shiftKey&&document.activeElement===b?(r.preventDefault(),S.focus()):!r.shiftKey&&document.activeElement===S&&(r.preventDefault(),b.focus())};return n.addEventListener("click",r=>{let c=r.target;if(c===n||c.closest("[data-ex-close]")){T();return}c.closest("[data-ex-try]")&&(T(),e.tryIt(t))}),document.addEventListener("keydown",k,!0),e.root.append(n),n.querySelector("[data-ex-close].slm-btn")?.focus({preventScroll:!0}),{close:T}}var Dt=`
350
350
  .slm-ex-scrim{position:absolute;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box;background:color-mix(in srgb,var(--slm-bg) 62%,transparent);animation:slm-ex-fade var(--slm-mo-base) var(--slm-mo-out)}
351
351
  @keyframes slm-ex-fade{from{opacity:0}to{opacity:1}}
352
352
  .slm-ex{width:620px;max-width:100%;max-height:100%;display:flex;flex-direction:column;border-radius:18px;border:1px solid var(--slm-line);background:var(--slm-surface);box-shadow:0 30px 80px rgba(0,0,0,.28);overflow:hidden;animation:slm-alert-in var(--slm-mo-base) var(--slm-mo-out)}
@@ -453,10 +453,6 @@ import{b as V,c as be,d as ls,f as $e,g as He}from"./chunk-HHV7F37Y.js";import{m
453
453
  <div class="slm-ch-seatlist grid" data-ch-seatlist>${m}</div>`,foot:E?A:`${A}<button type="button" class="slm-btn ghost" data-ch-clear-all ${o.size?"":"disabled"}>Clear</button>`}}function Ut(e,t){if(e.seatListSection&&t.some(n=>n.id===e.seatListSection))return e.seatListSection;let o=e.host.selectionLabels()[0],a=o?e.host.sectionOfLabel(o)?.id:null;return a&&t.some(n=>n.id===a)?a:t[0]?.id??null}var Xt=`
454
454
  .slm-ch-seatlist{max-height:44vh;overflow:auto;overscroll-behavior:contain;border:1px solid var(--slm-line);
455
455
  border-radius:10px;background:var(--slm-surface);margin-top:10px}
456
- .slm-ch-seatgroup{padding:8px 10px;border-bottom:1px solid var(--slm-line);display:flex;align-items:center;
457
- justify-content:space-between;gap:8px;font-size:11px;font-weight:800;color:var(--slm-muted);position:sticky;top:0;
458
- background:var(--slm-surface)}
459
- .slm-ch-seatgroup button{color:var(--slm-accent);font-weight:800;font-size:11px;min-height:32px}
460
456
  .slm-ch-seatitem{display:flex;width:100%;min-height:40px;align-items:center;gap:9px;padding:8px 10px;border-bottom:1px solid var(--slm-line);
461
457
  text-align:left;font-size:12.5px;line-height:1.3;color:var(--slm-text)}
462
458
  .slm-ch-seatitem:hover:not(:disabled){background:var(--slm-tint)}
@@ -1,4 +1,4 @@
1
- import"./chunk-OSZ7DOEH.js";var a=e=>e,f=e=>e;function k(e,s){a=e,f=s}var p="seatlayer-sales-style",m=`.sl-picker[data-sales-view] .sl-map-host canvas{filter:grayscale(1);opacity:.42}
1
+ import"./chunk-7I563G2N.js";var a=e=>e,f=e=>e;function k(e,s){a=e,f=s}var p="seatlayer-sales-style",m=`.sl-picker[data-sales-view] .sl-map-host canvas{filter:grayscale(1);opacity:.42}
2
2
  .sl-picker[data-sales-view] .sl-prices,.sl-picker[data-sales-view] .sl-rail-scroll{filter:grayscale(1);opacity:.6}
3
3
  .sl-picker[data-sales-view] .sl-soldout{display:none}
4
4
  .sl-sales-banner{position:absolute;top:62px;left:50%;transform:translateX(-50%);z-index:8;box-sizing:border-box;width:min(420px,calc(100% - 32px));display:flex;gap:12px;align-items:flex-start;padding:14px 16px;border-radius:14px;background:var(--sl-surface);border:1px solid var(--sl-line);color:var(--sl-text);box-shadow:0 10px 30px rgba(15,23,42,.12)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seatlayer/js",
3
- "version": "0.109.1",
3
+ "version": "0.110.0",
4
4
  "description": "SeatLayer's official JavaScript seating chart and seat map SDK — live availability, seat selection, temporary holds, and a typed API for any web ticketing app.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": {
@@ -68,7 +68,7 @@
68
68
  "typescript"
69
69
  ],
70
70
  "dependencies": {
71
- "@seatlayer/core": "0.109.1"
71
+ "@seatlayer/core": "0.110.0"
72
72
  },
73
73
  "devDependencies": {
74
74
  "tsup": "^8.5.1",
@@ -1 +0,0 @@
1
- import{P as a,Q as b,R as c}from"./chunk-CNLSM36T.js";import"./chunk-T57HSGPG.js";import"./chunk-UBFNMA7U.js";import"./chunk-OSZ7DOEH.js";export{b as CHANNELS_CSS,c as ChannelsMode,a as bucketRowsHtml};
@@ -1 +0,0 @@
1
- var f=a=>{throw TypeError(a)};var d=(a,b,c)=>b.has(a)||f("Cannot "+c);var g=(a,b,c)=>(d(a,b,"read from private field"),c?c.call(a):b.get(a)),h=(a,b,c)=>b.has(a)?f("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(a):b.set(a,c),i=(a,b,c,e)=>(d(a,b,"write to private field"),e?e.call(a,c):b.set(a,c),c),j=(a,b,c)=>(d(a,b,"access private method"),c);export{g as a,h as b,i as c,j as d};
@@ -1 +0,0 @@
1
- import{t as L}from"@seatlayer/core";import{cdnAssetUrl as Y,importCdnAsset as v}from"@seatlayer/core/core/cdnAsset";var A=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,S=/[\s"'<>`\\]/;function T(i){return i.startsWith("//")?!1:i.startsWith("/")||i.startsWith("./")||i.startsWith("../")}function E(){try{let i=typeof location>"u"?"":location.origin;return i&&i!=="null"?i:null}catch{return null}}function x(i){if(typeof i!="string"||!i||i.length>2e6||i!==i.trim())return!1;if(i.startsWith("data:"))return A.test(i);if(S.test(i))return!1;let t=E();if(T(i)){if(!t)return!1;try{let n=new URL(i,t);return n.origin===t&&!n.username&&!n.password}catch{return!1}}try{let n=new URL(i);return n.username||n.password?!1:n.protocol==="https:"||t!=null&&n.origin===t}catch{return!1}}import{SEATLAYER_MODULE_URL as le}from"@seatlayer/core/core/cdnAsset";function h(i,t){let n=L(i);return n===i?t:n}function B(){return globalThis.matchMedia?.("(pointer: coarse)").matches??!1?h("picker.dragToLookTouch","Drag to look \xB7 pinch to zoom \xB7 tap \u2715 to close"):h("picker.dragToLookMouse","Drag to look \xB7 pinch or scroll to zoom \xB7 Esc to close")}function X(){return{rotate:h("picker.dragToRotateVenue","Drag to rotate the venue"),move:h("picker.dragToMoveVenue","Drag to move the venue"),zoomIn:h("picker.zoomIn","Zoom in"),zoomOut:h("picker.zoomOut","Zoom out"),fitView:h("picker.fitWholeVenue","Show whole venue")}}function G(i,t){let n=t?i.toLocaleUpperCase(t):i.toLocaleUpperCase(),e=t?i.toLocaleLowerCase(t):i.toLocaleLowerCase();if(i!==n||n===e)return i;let o=[...e][0]??"";return(t?o.toLocaleUpperCase(t):o.toLocaleUpperCase())+e.slice(o.length)}function j(i){if(typeof i=="string"){let t=document.querySelector(i);if(!t)throw new Error(`seatmap: container "${i}" not found`);return t}if(!(i instanceof HTMLElement))throw new Error("seatmap: container must be a CSS selector or an HTMLElement");return i}function q(i){return String(i??"").replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}function K(i,t,n){let e=t.find(s=>x(s))??null;if(i.replaceChildren(),!e)return i.textContent=n.slice(0,1).toUpperCase(),null;let o=document.createElement("img");return o.alt="",o.referrerPolicy="no-referrer",o.src=e,i.appendChild(o),e}var y=null;function Z(){if(y!==null)return y;try{if(typeof document>"u")return y=!1;y=!!document.createElement("canvas").getContext("webgl2")}catch{y=!1}return y}var b=null;function _(){return b||(b=(typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?v("seatlayer-view3d.mjs"):import("@seatlayer/core/view3d")).catch(t=>{throw b=null,t}),b)}function z(){(typeof navigator>"u"?void 0:navigator.connection)?.saveData||_().catch(()=>{})}async function J(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?v("seatlayer-panorama.mjs"):import("@seatlayer/core")}async function Q(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?v("seatlayer-checkout.mjs"):import("./hostedCheckout-XSQ7ISQC.js")}async function ee(){return typeof __SEATLAYER_CDN__<"u"&&__SEATLAYER_CDN__?v("seatlayer-sales.mjs"):import("./pickerSalesClose-AVOFKQPC.js")}function te(i){return i==="unavailable_for_event"||i==="payments_off_for_event"?i:"not_configured"}function ne(i){return i.lineItems.reduce((t,n)=>t+n.quantity,0)}function M(i,t){if(i.objectType!=="ga")return i.displayLabel??i.label;let n=t.find(e=>e.id===i.objectId);return i.displayLabel??n?.displayLabel??n?.label??h("picker.generalAdmission","General admission")}function P(i,t){let n=new Map;for(let e of i){let o=e.rowLabel&&e.seatNumber?[e.sectionLabel,`${h("picker.row","Row")} ${e.rowLabel}`,`${h("picker.seat","Seat")} ${e.seatNumber}`].filter(Boolean).join(" \xB7 "):M(e,t),s=[e.categoryLabel,e.tierLabel].filter(Boolean).join(" \xB7 "),u=Math.max(1,Math.floor(e.quantity||1)),a=`${o}\0${s}`,c=n.get(a)??{label:o,detail:s,units:0,amount:0};c.units+=u,c.amount+=e.unitPrice*u,n.set(a,c)}return[...n.values()].map(e=>({label:e.units>1?`${e.label} \xD7${e.units}`:e.label,...e.detail?{detail:e.detail}:{},amount:e.amount}))}var C=(i,t,n)=>L("picker.bookingForm.guestOfCount",{label:i,index:t,total:n});function R(i,t,n=[]){let e=new Map,o=[];for(let l of i.lineItems){let r=M(l,n),f=Math.max(1,Math.floor(l.quantity)||1);if(l.objectType!=="ga"&&!(l.objectType==="table"&&f>1)){o.push({key:l.label,name:r,unitIndex:1,quantity:1});continue}for(let d=1;d<=f;d+=1){let m=(e.get(l.label)??0)+1;e.set(l.label,m),o.push({key:`${l.label}#${m}`,name:r,unitIndex:d,quantity:f})}}let s=t?.ticketKeyDetails??[],u=t?.ticketKeys??s.map(l=>l.ticketKey),a=(u.length===o.length?u:o.map(l=>l.key)).map(l=>{let r=o.find(d=>d.key===l),f=s.find(d=>d.ticketKey===l);return{key:l,name:f?.displayLabel??r?.name,unitIndex:f?.unitIndex??r?.unitIndex??1,quantity:f?.quantity??r?.quantity??1}}),c=new Map;for(let l of a)l.name&&l.quantity<=1&&c.set(l.name,(c.get(l.name)??0)+1);let p=new Map;return a.map(({key:l,name:r,unitIndex:f,quantity:d})=>{if(!r)return{key:l};if(d>1)return{key:l,title:C(r,f,d)};let m=(p.get(r)??0)+1;p.set(r,m);let g=c.get(r)??1;return{key:l,title:g>1?C(r,m,g):r}})}function ie(i,t,n,e,o=[]){let s=new Map;for(let u of i.lineItems){let a=M(u,o);s.set(a,(s.get(a)??0)+1)}return{kind:"pay",provider:t,order:{holdId:i.holdId,expiresAt:i.expiresAt,currency:i.currency,total:i.total,labels:[...s].map(([u,a])=>a>1?`${u} \xD7${a}`:u),tickets:R(i,e,o),lines:P(i.lineItems,o)},bookingForm:n?.bookingForm??null,...n?.bookingMode==="free"?{free:!0}:{}}}function oe(i){return String(i?.code).startsWith("booking_form_")}function re(i,t,n){let e={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"},o=new Date(i);if(t)try{return o.toLocaleString(n,{...e,timeZone:t})}catch{}return o.toLocaleString(n,e)}function ce(i){return i.focusedSection!==null?i.deeperThanSectionFrame===!1?"venue":"section":i.atVenueFit!==void 0?i.atVenueFit?"none":"venue":i.seatsRevealed?"venue":"none"}import{pointInPolygon as I}from"@seatlayer/core";import{createMinimapTransform as D,minimapPointToWorld as H,minimapViewportPlan as O}from"@seatlayer/core/picker/minimapGeometry";function V(i){let t={inactive:0,available:1,selected:2},n=new Map;for(let o of i){let s=n.get(o.id);(!s||t[o.state]>t[s])&&n.set(o.id,o.state)}let e={selected:0,available:0,inactive:0};for(let o of n.values())e[o]+=1;return e}function N(i,t){return i.x<=t.x&&i.y<=t.y&&i.x+i.width>=t.x+t.width&&i.y+i.height>=t.y+t.height}function he(i,t){let n=new w(i);return n.build(t),n}var w=class{constructor(t){this.host=t;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(t){if(!this.host.controller.getViewport())return;let e=document.createElement("button");e.type="button",e.className="sl-minimap-toggle",e.setAttribute("aria-label",h("picker.openVenueMap","Open venue overview map")),e.setAttribute("aria-expanded","false"),e.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>',t.appendChild(e),this.miniToggle=e;let o=document.createElement("div");o.className="sl-minimap",o.setAttribute("role","group");let s=document.createElement("div");s.className="sl-minimap-bar";let u=document.createElement("span");u.className="sl-minimap-label";let a=document.createElement("span");a.className="sl-minimap-key",a.setAttribute("aria-label",h("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 c=document.createElement("button");c.type="button",c.className="sl-minimap-close",c.setAttribute("aria-label",h("picker.closeVenueMap","Close venue overview map")),c.textContent="\xD7",s.append(u,a,c);let p=document.createElement("canvas");p.tabIndex=0,p.setAttribute("role","application"),p.setAttribute("aria-label",h("picker.venueMapInstructions","Venue overview map. Drag the viewport, click a section, or use arrow keys to pan.")),o.append(s,p),t.appendChild(o),this.miniWrap=o,this.miniLabel=u,this.miniCanvas=p;let l=document.createElement("canvas");this.miniBase=l,e.addEventListener("click",()=>{let r=this.host.root()?.dataset.minimapOpen==="true";this.userClosed=r,this.setMinimapOpen(!r)}),c.addEventListener("click",()=>{this.userClosed=!0,this.setMinimapOpen(!1)}),p.addEventListener("click",r=>{if(this.miniSuppressClick){this.miniSuppressClick=!1;return}this.minimapJump(r)}),p.addEventListener("pointerdown",r=>this.minimapPointerDown(r)),p.addEventListener("pointermove",r=>this.minimapPointerMove(r)),p.addEventListener("pointerup",r=>this.minimapPointerUp(r)),p.addEventListener("pointercancel",r=>this.minimapPointerUp(r)),p.addEventListener("keydown",r=>this.minimapKeydown(r)),this.layoutMinimap(),this.syncMinimapLabel(),this.drawMinimapStatic(),this.drawMinimapRect()}setAutoOpen(t){if(this.miniWrap){if(!t){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(t,n=!0){this.host.root()?.setAttribute("data-minimap-open",String(t)),this.miniToggle?.setAttribute("aria-expanded",String(t)),n&&(t?this.miniCanvas?.focus():this.miniToggle?.focus())}layoutMinimap(){let t=this.miniCanvas,n=this.miniBase,e=this.host.controller.getViewport()?.bounds;if(!t||!n||!e||!(e.width>0&&e.height>0))return;let o=196,s=146,u=6,a=e.width/Math.max(1,e.height),c=o,p=Math.round(o/a);p>s&&(p=s,c=Math.round(s*a)),c=Math.max(64,c),p=Math.max(48,p);let l=Math.min(2,window.devicePixelRatio||1);t.width=Math.round(c*l),t.height=Math.round(p*l),t.style.width=`${c}px`,t.style.height=`${p}px`,n.width=t.width,n.height=t.height,this.miniTf=D(e,t.width,t.height,l,u)}syncMinimapLabel(){if(!this.miniLabel||!this.miniWrap)return;let t=this.host.controller.getFloors(),n=this.host.controller.isFloorOverview()?h("picker.allFloors","All floors"):t.find(l=>l.id===this.host.controller.getActiveFloorId())?.name??h("picker.venueOverview","Venue overview"),e=this.host.controller.getMinimapSnapshot().sections,s=e.find(l=>l.active)?.label??this.host.focusedSectionLabel(),u=s?`${n} \xB7 ${s}`:n;this.miniLabel.textContent=u;let{selected:a,available:c,inactive:p}=V(e);this.miniWrap.setAttribute("aria-label",e.length?`${u}. ${a} selected, ${c} available, ${p} inactive sections.`:u),this.miniCanvas?.setAttribute("aria-label",e.length?`${u}. ${a} selected, ${c} available, ${p} inactive sections. ${h("picker.venueMapInstructions","The outlined region is the visible map area. Drag it, click a section, or use arrow keys to pan.")}`:`${u}. ${h("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 t=this.miniBase,n=this.miniTf;if(!t||!n)return;let e=t.getContext("2d");if(!e)return;e.clearRect(0,0,t.width,t.height);let o=r=>r*n.scale+n.offX,s=r=>r*n.scale+n.offY,u=this.host.cssVar("--sl-line")||"rgba(139,147,167,.5)",a=this.host.cssVar("--sl-muted")||"#8b93a7",c=this.host.cssVar("--sl-accent")||"#6e7bff",p=this.host.cssVar("--sl-success")||"#22a06b",l=this.host.controller.getMinimapSnapshot();for(let r of l.sections){if(r.outline.length<3)continue;e.beginPath(),r.outline.forEach((d,m)=>m===0?e.moveTo(o(d.x),s(d.y)):e.lineTo(o(d.x),s(d.y))),e.closePath();let f=r.paint;if(e.globalAlpha=r.state==="inactive"?.5:.92,f?e.fillStyle=f.fill:(e.globalAlpha=r.state==="inactive"?.18:r.state==="selected"?.72:.34,e.fillStyle=r.state==="inactive"?a:r.state==="selected"?c:p),e.fill(),e.globalAlpha=.82,e.lineWidth=Math.max(1,n.dpr),e.strokeStyle=f?.stroke||u,e.stroke(),r.owned){e.globalAlpha=1,e.lineWidth=Math.max(2,n.dpr*1.5),e.strokeStyle=c,e.stroke();let d=r.outline.reduce((m,g)=>({x:m.x+g.x,y:m.y+g.y}),{x:0,y:0});e.beginPath(),e.arc(o(d.x/r.outline.length),s(d.y/r.outline.length),Math.max(1.5,n.dpr*1.6),0,Math.PI*2),e.fillStyle=c,e.fill(),e.beginPath(),r.outline.forEach((m,g)=>g===0?e.moveTo(o(m.x),s(m.y)):e.lineTo(o(m.x),s(m.y))),e.closePath()}r.active&&(e.globalAlpha=1,e.lineJoin="round",e.lineWidth=Math.max(4,n.dpr*3.5),e.strokeStyle=this.host.cssVar("--sl-surface")||"#fff",e.stroke(),e.lineWidth=Math.max(2,n.dpr*1.75),e.strokeStyle=c,e.stroke())}if(e.globalAlpha=1,!l.sections.length){let r=Math.max(1,n.dpr),f=new Map,d=m=>{let g=f.get(m);if(g)return g;let k=this.host.tint?.(m)||p;return f.set(m,k),k};for(let m of l.seats)e.globalAlpha=m.state==="inactive"?.22:.78,e.fillStyle=m.state==="inactive"?a:m.state==="selected"?c:d(m.categoryKey),e.beginPath(),e.arc(o(m.x),s(m.y),r,0,Math.PI*2),e.fill();e.globalAlpha=1}}drawMinimapRect(){let t=this.miniCanvas,n=this.miniBase,e=this.miniTf;if(!t||!n||!e)return;let o=t.getContext("2d");if(!o)return;o.clearRect(0,0,t.width,t.height),o.drawImage(n,0,0);let s=this.host.controller.getViewport();if(!s)return;let u=N(s.visible,s.bounds);if(this.host.root()?.toggleAttribute("data-minimap-idle",u),u)return;let a=O(s.visible,e,t.width,t.height,Math.max(2,e.dpr*2)),c=this.host.cssVar("--sl-text")||"#12151c",p=this.host.cssVar("--sl-surface")||"#fff";o.save(),o.globalAlpha=.1,o.fillStyle=c,o.fillRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),o.globalAlpha=.9,o.lineJoin="round",o.lineWidth=Math.max(4,e.dpr*3.25),o.strokeStyle=p,o.strokeRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),o.globalAlpha=1,o.lineWidth=Math.max(2,e.dpr*1.75),o.strokeStyle=c,o.strokeRect(a.raw.x,a.raw.y,a.raw.width,a.raw.height),a.clipped&&Object.values(a.clippedEdges).some(Boolean)&&(o.setLineDash([Math.max(3,e.dpr*3),Math.max(2,e.dpr*2)]),o.strokeRect(a.clipped.x,a.clipped.y,a.clipped.width,a.clipped.height)),o.restore()}minimapWorldPoint(t){let n=this.miniCanvas,e=this.miniTf;if(!n||!e)return null;let o=n.getBoundingClientRect(),s=(t.clientX-o.left)*(n.width/Math.max(1,o.width)),u=(t.clientY-o.top)*(n.height/Math.max(1,o.height));return{...H({x:s,y:u},e),px:s,py:u}}minimapPointerDown(t){let n=this.minimapWorldPoint(t),e=this.host.controller.getViewport()?.visible;!n||!e||!(n.x>=e.x&&n.x<=e.x+e.width&&n.y>=e.y&&n.y<=e.y+e.height)||(this.miniDrag={pointerId:t.pointerId,offsetX:n.x-(e.x+e.width/2),offsetY:n.y-(e.y+e.height/2),startX:t.clientX,startY:t.clientY,moved:!1},this.miniCanvas?.setPointerCapture(t.pointerId),this.miniCanvas?.classList.add("sl-dragging"),t.preventDefault())}minimapPointerMove(t){let n=this.miniDrag;if(!n||n.pointerId!==t.pointerId)return;let e=this.minimapWorldPoint(t);e&&(!n.moved&&Math.hypot(t.clientX-n.startX,t.clientY-n.startY)>2&&(n.moved=!0,this.host.controller.clearSectionFocus()),this.host.controller.panToWorld({x:e.x-n.offsetX,y:e.y-n.offsetY}),t.preventDefault())}minimapPointerUp(t){let n=this.miniDrag;!n||n.pointerId!==t.pointerId||(this.miniSuppressClick=n.moved,this.miniDrag=null,this.miniCanvas?.classList.remove("sl-dragging"),this.miniCanvas?.hasPointerCapture(t.pointerId)&&this.miniCanvas.releasePointerCapture(t.pointerId))}minimapKeydown(t){let n=this.host.controller.getViewport()?.visible;if(!n)return;if(t.key==="Home"){this.host.controller.overview(),t.preventDefault();return}let e=t.key==="ArrowLeft"?-n.width*.2:t.key==="ArrowRight"?n.width*.2:0,o=t.key==="ArrowUp"?-n.height*.2:t.key==="ArrowDown"?n.height*.2:0;!e&&!o||(this.host.controller.clearSectionFocus(),this.host.controller.panToWorld({x:n.x+n.width/2+e,y:n.y+n.height/2+o}),t.preventDefault())}minimapJump(t){let n=this.minimapWorldPoint(t);if(n){for(let e of this.host.controller.getMinimapSnapshot().sections)if(!(e.state==="inactive"||e.outline.length<3)&&I(n,e.outline)){this.host.controller.focusSection(e.id);return}this.host.controller.clearSectionFocus(),this.host.controller.panToWorld(n)}}};export{x as a,h as b,B as c,X as d,G as e,j as f,q as g,K as h,Z as i,_ as j,z as k,J as l,Q as m,ee as n,te as o,ne as p,ie as q,oe as r,re as s,ce as t,he as u};
@@ -1 +0,0 @@
1
- import{relativeLuminance255 as C,rgb255ToHex as v}from"@seatlayer/core/core/color";function a(e){if(!e)return null;let n=e.trim().toLowerCase();if(n==="white")return{r:255,g:255,b:255};if(n==="black")return{r:0,g:0,b:0};let t=/^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(n)?.[1];if(t){let s=t.length<=4?[...t].map(o=>`${o}${o}`).join(""):t;return{r:Number.parseInt(s.slice(0,2),16),g:Number.parseInt(s.slice(2,4),16),b:Number.parseInt(s.slice(4,6),16)}}let r=/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:\s*[,/]\s*[\d.]+%?)?\s*\)$/i.exec(n);return r?{r:Math.max(0,Math.min(255,Number(r[1]))),g:Math.max(0,Math.min(255,Number(r[2]))),b:Math.max(0,Math.min(255,Number(r[3])))}:null}function d(e){return C([e.r,e.g,e.b])}function i(e,n){let t=a(e),r=a(n);if(!t||!r)return null;let s=Math.max(d(t),d(r)),o=Math.min(d(t),d(r));return(s+.05)/(o+.05)}function l(e,n="#172033",t="#eef1f8"){return(i(n,e)??0)>=(i(t,e)??0)?n:t}function y(e){return v(e.r,e.g,e.b)}function p(e,n,t){let r=a(e),s=a(n);if(!r||!s)return null;let o=Math.max(0,Math.min(1,t));return y({r:r.r*o+s.r*(1-o),g:r.g*o+s.g*(1-o),b:r.b*o+s.b*(1-o)})}var m="#d8a425",E=.18;function h(e,n){let t=p(m,n,E)??n;if((i(m,t)??0)>=4.5)return m;for(let r=.15;r<=1;r+=.05){let s=p(m,e,1-r);if(s&&(i(s,t)??0)>=4.5)return s}return l(t)}function x(e,n,t,r){if((i(e,t)??4.5)>=4.5&&(i(e,r)??4.5)>=4.5)return e;if(!a(e)||!a(n))return n;for(let s=.15;s<=1;s+=.05){let o=p(e,n,1-s);if(o&&(i(o,t)??0)>=4.5&&(i(o,r)??0)>=4.5)return o}return n}function M(e){return{"--sl-chrome":e?"#d6dce6":"#556278","--sl-chrome-line":e?"rgba(23,32,51,.55)":"rgba(233,238,247,.55)"}}var _=["--sl-bg","--sl-surface","--sl-text","--sl-muted","--sl-line","--sl-accent-text","--sl-warn-text","--sl-chrome","--sl-chrome-line"];function w(e,n){let t=n??e["--sl-bg"],r=a(t)?l(t)==="#172033":!1,s=a(e["--sl-bg"])?l(e["--sl-bg"])==="#172033":!1;if(r===s)return null;let o=r?"#ffffff":"#1a2234",c=l(t),u=e["--sl-accent"];return{"--sl-bg":t,"--sl-surface":o,"--sl-text":c,"--sl-muted":r?"#667085":"#a5aec2","--sl-line":r?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)","--sl-accent-text":x(u,c,t,o),...M(r),"--sl-warn-text":h(c,o)}}var R="#f7f8fb",k={light:{background:"#ffffff",surface:"#f6f7fb",text:"#172033",muted:"#667085",line:"rgba(23,32,51,.16)",map:"#e9edf4"},dark:{background:"#0f1522",surface:"#1a2234",text:"#eef1f8",muted:"#a5aec2",line:"rgba(165,174,194,.24)",map:"#0f1522"}};function I(){try{return window.matchMedia?.("(prefers-color-scheme: dark)").matches===!0}catch{return!1}}function L(e){if(e)return e==="auto"?I()?"dark":"light":e}function P(e,n=e?.mode){if(e?.map)return e.map;let t=L(n);return t?{background:k[t].map}:null}function S(e){let n;try{n=window.matchMedia?.("(prefers-color-scheme: dark)")}catch{return()=>{}}if(!n)return()=>{};let t=r=>e(r.matches);return typeof n.addEventListener=="function"?n.addEventListener("change",t):n.addListener?.(t),()=>{typeof n.removeEventListener=="function"?n.removeEventListener("change",t):n.removeListener?.(t)}}function A(e,n,t){let r=t?k[t]:null,s=n?.background??r?.background??e?.background??R,o=a(s)?l(s)==="#172033":!1,c=n?.surface??r?.surface??(o?"#ffffff":"#1a2234"),u=n?.accent??e?.accent??"#f4b740",g=e?.accentInk,T=n?.accentInk??(g&&(i(g,u)??4.5)>=4.5?g:l(u,"#1a1200","#ffffff")),f=r?void 0:e?.textColor,b=n?.text??r?.text??(f&&(i(f,s)??4.5)>=4.5&&(i(f,c)??4.5)>=4.5?f:l(s));return{"--sl-accent":u,"--sl-accent-ink":T,"--sl-accent-text":x(u,b,s,c),"--sl-warn-text":h(b,c),"--sl-bg":s,"--sl-surface":c,"--sl-text":b,"--sl-muted":n?.muted??r?.muted??(o?"#667085":"#a5aec2"),"--sl-line":n?.line??r?.line??(o?"rgba(23,32,51,.16)":"rgba(165,174,194,.24)"),...M(o),"--sl-scrim-ink":o?"rgba(16,22,36,1)":"rgba(4,7,13,1)","--sl-font":n?.fontFamily??e?.fontFamily??"-apple-system,BlinkMacSystemFont,'Segoe UI',Inter,sans-serif","--sl-radius":`${n?.radius??14}px`}}export{_ as a,w as b,k as c,L as d,P as e,S as f,A as g};
@@ -1,185 +0,0 @@
1
- import{a as Ne}from"./chunk-ICMSBXRJ.js";import"./chunk-OSZ7DOEH.js";var Re=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Ue=/^[0-9 +()-]{6,20}$/,Ye=/^(\d{4})-(\d{2})-(\d{2})$/,He=["required","invalid","too_long"],Be=[["attendeeName","name","picker.bookingForm.name","Name"],["attendeeEmail","email","picker.bookingForm.email","Email"],["attendeePhone","phone","picker.bookingForm.phone","Phone"]],Qe={email:"email",phone:"tel",number:"number",date:"date"};function Ie(n){return n===void 0||n===""||n===!1||Array.isArray(n)&&!n.length}function ze(n,u,s,g){if(Ie(s))return u?"required":null;let a=v=>!!g?.some(P=>P.id===v);if(n==="number")return typeof s=="number"&&Number.isFinite(s)?null:"invalid";if(n==="checkbox")return s===!0?null:"invalid";if(n==="select")return a(s)?null:"invalid";if(n==="multiselect")return Array.isArray(s)&&s.length<=50&&s.every(a)?null:"invalid";if(typeof s!="string")return"invalid";if(n==="phone")return Ue.test(s)?null:"invalid";if(s.length>500)return"too_long";if(n==="email")return Re.test(s)?null:"invalid";if(n==="date"){let v=Ye.exec(s);if(!v)return"invalid";let[P,D,z]=[Number(v[1]),Number(v[2]),Number(v[3])],M=new Date(Date.UTC(P,D-1,z));return M.getUTCFullYear()===P&&M.getUTCMonth()===D-1&&M.getUTCDate()===z?null:"invalid"}return null}function y(n,u,s){let g=document.createElement(n);return u&&(g.className=u),s!==void 0&&(g.textContent=s),g}function Ce(n,u){let s=n?.[u];return s==="optional"||s==="required"?s:"off"}var Ve={name:"name",email:"email",phone:"tel"},je=5;function Pe(n){let{form:u,t:s,idPrefix:g}=n,a=(u?.questions??[]).filter(t=>t&&!t.archived).sort((t,o)=>t.position-o.position),v=Be.filter(([t])=>Ce(u,t)!=="off"),P=a.filter(t=>t.scope==="ticket"),D=a.filter(t=>t.scope!=="ticket"),z=v.length>0||P.length>0;if(!z&&!D.length)return{details:null,element:null,validate:()=>!0,payload:()=>({}),showServerErrors:()=>!1};let M=v.filter(([,t])=>t!=="phone"),ie=v.every(([t])=>Ce(u,t)!=="required")&&P.every(t=>!t.required),I=[...n.tickets],S=!0,se=!1,R=new Map,he=(t,o)=>o===void 0?t:`${t}|${o}`,q=[],pe=0,L=y("div","sl-hco-bf sl-hco-bf-inline"),O=y("div","sl-hco-bf"),U=y("p","sl-hco-alert is-error");U.setAttribute("role","alert"),U.hidden=!0;let Y=(t,o)=>o==="required"?s("picker.bookingForm.required","This is required."):o==="too_long"?s("picker.bookingForm.tooLong","This is too long."):t==="email"?s("picker.bookingForm.invalidEmail","Enter a valid email address."):t==="phone"?s("picker.bookingForm.invalidPhone","Enter a valid phone number."):s("picker.bookingForm.invalid","Check this answer."),G=(t,o)=>{t.error.textContent=o?Y(t.kind,o):"",t.error.hidden=!o;let c=t.kind==="multiselect"||t.control.closest(".sl-hco-chips")?t.control.closest("fieldset")??t.control:t.control;o?c.setAttribute("aria-invalid","true"):c.removeAttribute("aria-invalid"),t.control.closest(".sl-hco-block")?.classList.toggle("has-error",q.some(b=>b.ticketKey===t.ticketKey&&!b.error.hidden))},J=(t,o)=>{let c=y("span",void 0,t);if(o)return c;let b=y("span","sl-hco-label-row");return b.append(c," ",y("span","sl-hco-optional",s("checkout.optional","Optional"))),b},V=(t,o)=>{let c=`${g}-bf${pe++}`,b=he(o.key,o.ticketKey),l=R.get(b),h=y("div","sl-hco-field"),d=o.help?y("p","sl-hco-help",o.help):null;d&&(d.id=`${c}-h`);let k=y("p","sl-hco-ferr");k.id=`${c}-e`,k.hidden=!0;let T=x=>{x.setAttribute("aria-describedby",d?`${d.id} ${k.id}`:k.id),o.required&&x.tagName!=="FIELDSET"&&x.setAttribute("aria-required","true")},w=o.kind==="select"&&(o.options??[]).length<=je,N;if(o.kind==="checkbox"||o.kind==="multiselect"||w){let x=o.kind==="checkbox"?null:y("fieldset",w?"sl-hco-group sl-hco-chips":"sl-hco-group"),m=x?o.options??[]:[{id:"",label:o.label}];if(x){w&&x.setAttribute("role","radiogroup");let C=y("legend");C.appendChild(J(o.label,o.required)),x.appendChild(C),d&&x.appendChild(d),T(x)}let F=x?y("div","sl-hco-choices"):null,A=m.map((C,W)=>{let ye=y("label",w?"sl-hco-chip":"sl-hco-check"),E=y("input");E.type=w?"radio":"checkbox",E.value=C.id,w&&(E.name=c),x?(W===0&&(E.id=c),E.checked=w?l===C.id:Array.isArray(l)&&l.includes(C.id)):(E.id=c,E.checked=l===!0,T(E));let be=x?y("span",void 0,C.label):J(o.label,o.required);return ye.append(E,be),(F??h).appendChild(ye),E});x&&F?(x.appendChild(F),h.appendChild(x)):d&&h.appendChild(d),N={...o,control:A[0]??x??h,error:k,read:w?()=>A.find(C=>C.checked)?.value??"":x?()=>A.filter(C=>C.checked).map(C=>C.value):()=>!!A[0]?.checked}}else{let x=y("label","sl-hco-label");x.appendChild(J(o.label,o.required)),x.htmlFor=c;let m;if(o.kind==="textarea")m=y("textarea","sl-hco-input"),m.rows=3,m.maxLength=500;else if(o.kind==="select"){m=y("select","sl-hco-input"),m.appendChild(new Option(s("picker.bookingForm.choose","Choose\u2026"),""));for(let A of o.options??[])m.appendChild(new Option(A.label,A.id))}else m=y("input","sl-hco-input"),m.type=Qe[o.kind]??"text",o.kind==="number"?(m.step="any",m.inputMode="decimal"):o.kind!=="date"&&(m.maxLength=o.kind==="phone"?20:500),o.autocomplete&&(m.autocomplete=o.autocomplete);m.id=c,typeof l=="string"?m.value=l:typeof l=="number"&&(m.value=String(l)),T(m),h.append(x,...d?[d]:[],m);let F=m;N={...o,control:m,error:k,read:()=>{let A=F.value.trim();return o.kind!=="number"?A:F.validity?.badInput?Number.NaN:A===""?void 0:Number(A)}}}h.appendChild(k);let ce=()=>{let x=N.read();x===void 0?R.delete(b):R.set(b,x),G(N,null)};return h.addEventListener("input",ce),h.addEventListener("change",ce),t.appendChild(h),q.push(N),N},te=(t,o,c)=>V(t,{key:`question:${o.id}`,...c!==void 0?{ticketKey:c}:{},kind:o.type,label:o.label,required:!!o.required,help:o.helpText,options:o.options}),ge=(t,o,c,b)=>{let l=Be.find(([h])=>h===c);return V(t,{key:c,ticketKey:o.key,kind:l[1],label:s(l[2],l[3]),required:Ce(u,c)==="required",autocomplete:b===0&&S?Ve[l[1]]:"off"})},K=(t,o,c="sl-hco-link")=>{let b=y("button",c,t);return b.type="button",b.addEventListener("click",o),b},xe=t=>y("h3","sl-hco-h",t),ae=()=>y("section","sl-hco-sec"),Q=t=>{if(!t&&I[0]){let c=n.buyer();for(let[b,l]of M){let h=c[l];h&&R.set(he(b,I[0].key),h)}se=!0}S=t;for(let[,c]of M)n.buyerError?.(c,null);_(),(t?O.querySelector(".sl-hco-you .sl-hco-link"):O.querySelector(".sl-hco-block input"))?.focus()};function _(){q=[],L.replaceChildren(),O.replaceChildren();let t=I[0],o=I.length===1&&S;if(z&&o&&t){for(let[d,k]of v)k==="phone"&&ge(L,t,d,0);M.length&&L.appendChild(K(s("checkout.forSomeoneElse","Ticket for someone else?"),()=>Q(!1)))}let c=z&&!o&&(!ie||se||le||!S);if(z&&!o&&!c){let d=ae(),k=K("",()=>{se=!0,_(),O.querySelector(".sl-hco-block input")?.focus()},"sl-hco-disclosure");k.setAttribute("aria-expanded","false"),k.append(y("span","sl-hco-plus","+"),y("span",void 0,s("checkout.addNames","Add names for each ticket")),y("span","sl-hco-optional",s("checkout.optional","Optional"))),d.appendChild(k),O.appendChild(d)}if(c){let d=ae();d.appendChild(xe(s("bookingForm.ticketHolders","Ticket holders"))),I.forEach((k,T)=>{let w=y("fieldset","sl-hco-block"),N=y("legend","sl-hco-legend",k.title||s("picker.bookingForm.ticket","Ticket {number}",{number:T+1}));w.appendChild(N);let ce=T===0&&S&&M.length>0;if(ce){let F=n.buyer(),A=y("p","sl-hco-you"),C=F.name||F.email;A.append(y("span",void 0,C?s("checkout.holderYou","You \xB7 {name}",{name:C}):s("checkout.holderYouPlain","You")));let W=K(s("checkout.change","Change"),()=>Q(!1));W.setAttribute("aria-label",s("checkout.changeHolder","Change the holder of {ticket}",{ticket:N.textContent??""})),A.appendChild(W),w.appendChild(A)}else T===0&&!S&&M.length>0&&w.appendChild(K(s("picker.bookingForm.useMyDetails","Use my details"),()=>Q(!0),"sl-hco-link sl-hco-use"));let x=v.filter(([,F])=>!(ce&&F!=="phone")),m=x.length>1?y("div","sl-hco-pair"):w;for(let[F]of x)ge(m,k,F,T);m!==w&&w.appendChild(m);for(let F of P)te(w,F,k.key);d.appendChild(w)}),O.appendChild(d)}let l=[...z&&o&&t?P.map(d=>({q:d,ticketKey:t.key})):[],...D.map(d=>({q:d,ticketKey:void 0}))],h=[...l.filter(({q:d})=>d.type!=="checkbox"),...l.filter(({q:d})=>d.type==="checkbox")];if(h.length){let d=ae();d.appendChild(xe(s("checkout.questions","A few questions")));for(let{q:k,ticketKey:T}of h)te(d,k,T);O.appendChild(d)}O.appendChild(U)}let le=!1;_();let X=()=>{if(!I[0]||!S)return null;let o=n.buyer(),c=null;for(let[b,l]of M){let h=ze(l,Ce(u,b)==="required",o[l]),d=n.buyerError?.(l,h?Y(l,h):null)??null;h&&!c&&(c=d)}return c},fe=t=>(U.textContent=t?s("picker.bookingForm.fix","Some details need attention."):"",U.hidden=!t,t?.focus(),!!t),me=(t,o)=>t.compareDocumentPosition(o)&4?-1:1;return{details:L,element:O,validate(){let t=[],o=X();o&&t.push(o);for(let c of q){let b=ze(c.kind,c.required,c.read(),c.options);G(c,b),b&&t.push(c.control)}return t.sort(me),!fe(t[0]??null)},payload(){let t=new Map,o=[],c=I[0];if(c&&S){let l=n.buyer(),h={ticketKey:c.key};for(let[,d]of M){let k=l[d];k&&(h[d]=k)}(h.name||h.email)&&t.set(c.key,h)}for(let l of q){let h=l.read();if(!Ie(h)){if(l.key.startsWith("question:"))o.push({questionId:l.key.slice(9),...l.ticketKey!==void 0?{ticketKey:l.ticketKey}:{},value:h});else if(l.ticketKey!==void 0){let d=t.get(l.ticketKey)??{ticketKey:l.ticketKey},k=l.key==="attendeeName"?"name":l.key==="attendeeEmail"?"email":"phone";d[k]=String(h),t.set(l.ticketKey,d)}}}let b=I.map(l=>t.get(l.key)).filter(l=>!!l);return{...b.length?{attendees:b}:{},...o.length?{answers:o}:{}}},showServerErrors(t){let o=(Array.isArray(t)?t:[]).filter(l=>!!l&&typeof l.key=="string");if(z){let l=!1;for(let h of o)typeof h.ticketKey=="string"&&!I.some(d=>d.key===h.ticketKey)&&(I.push({key:h.ticketKey}),l=!0);le=o.some(h=>typeof h.ticketKey=="string"),(l||le)&&_()}let c=[],b=I[0];for(let l of o){let h=l.key==="attendeeName"?"name":l.key==="attendeeEmail"?"email":null;if(h&&S&&b&&l.ticketKey===b.key&&M.some(([,d])=>d===h)){let d=n.buyerError?.(h,Y(h,He.includes(l.code)?l.code:"invalid"));d&&c.push(d)}}for(let l of q){let h=o.find(k=>k.key===l.key&&(k.ticketKey??void 0)===(l.ticketKey??void 0)),d=h?He.includes(h.code)?h.code:"invalid":null;G(l,d),d&&c.push(l.control)}return c.length?(c.sort(me),fe(c[0])):(U.textContent=s("picker.bookingForm.fix","Some details need attention."),U.hidden=!1,!1)}}}var Xe=9e4,We=2e3,Oe="seatlayer-checkout-style",Ge="@seatlayer/pending-checkout/v1";function Je(n,u){try{window.sessionStorage.setItem(Ge,JSON.stringify({orderId:n,...u?{eventKey:u}:{},storedAt:Date.now()}))}catch{}}var Ze=`
2
- /* Three rows: a header naming the event with the hold's countdown, a body that
3
- scrolls, and a footer that never does, so the total and the one primary
4
- button are always on screen however long the organizer's form is. On a
5
- phone-width widget the card is a bottom sheet.
6
- --sl-safe-b is declared on .sl-picker, which this overlay lives inside, so it
7
- inherits; it resolves to 0px in any host that is not inset. */
8
- .sl-hco{position:absolute;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;
9
- padding:16px 16px calc(16px + var(--sl-safe-b,0px));
10
- background:color-mix(in srgb, var(--sl-bg) 70%, transparent);backdrop-filter:blur(3px)}
11
- .sl-hco-card{display:flex;flex-direction:column;width:100%;max-width:440px;max-height:100%;overflow:hidden;
12
- background:var(--sl-surface);color:var(--sl-text);border:1px solid var(--sl-line);
13
- border-radius:var(--sl-radius);box-shadow:0 18px 48px rgba(0,0,0,.28)}
14
- .sl-hco-head{flex:none;display:flex;align-items:center;gap:10px;padding:12px 14px 10px 10px;border-bottom:1px solid var(--sl-line)}
15
- .sl-hco-back-icon{flex:none;display:grid;place-items:center;width:36px;height:36px;padding:0;color:var(--sl-muted);
16
- background:none;border:0;border-radius:calc(var(--sl-radius) * .5);cursor:pointer}
17
- .sl-hco-back-icon:hover{background:color-mix(in srgb, var(--sl-text) 6%, transparent);color:var(--sl-text)}
18
- .sl-hco-back-icon:focus-visible{outline:2px solid transparent;box-shadow:0 0 0 1px var(--sl-accent),0 0 0 4px color-mix(in srgb, var(--sl-accent) 24%, transparent)}
19
- .sl-hco-htext{flex:1;min-width:0;padding-left:4px}
20
- .sl-hco-title{margin:0;font-size:16px;font-weight:650;line-height:22px;letter-spacing:-.01em;
21
- overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
22
- .sl-hco-sub{margin:1px 0 0;font-size:12.5px;line-height:17px;color:var(--sl-muted);
23
- overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
24
- .sl-hco-timer{flex:none;display:inline-flex;align-items:center;gap:5px;padding:4px 9px;font-size:12.5px;font-weight:650;
25
- font-variant-numeric:tabular-nums;color:var(--sl-muted);background:color-mix(in srgb, var(--sl-text) 6%, transparent);border-radius:999px}
26
- .sl-hco-timer.is-warn{color:var(--sl-warn-text, #985a08);background:color-mix(in srgb, var(--sl-warn, #c97a0c) 16%, transparent)}
27
- .sl-hco-sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
28
- .sl-hco-form{flex:1 1 auto;display:flex;flex-direction:column;min-height:0}
29
- .sl-hco-body{flex:1 1 auto;min-height:0;padding:0 16px 16px;overflow-y:auto;overscroll-behavior:contain}
30
- .sl-hco-fields{min-width:0;margin:0;padding:0;border:0}
31
- .sl-hco-sec{padding-top:14px}
32
- .sl-hco-body .sl-hco-sec{margin-top:14px;border-top:1px solid var(--sl-line)}
33
- .sl-hco-body .sl-hco-sec:first-child,.sl-hco-fields>.sl-hco-sec:first-child{margin-top:0;border-top:0}
34
- .sl-hco-h{margin:0 0 10px;padding:0;font-size:14px;font-weight:650;line-height:20px}
35
- .sl-hco-lines{margin:0;padding:0;list-style:none}
36
- .sl-hco-line{display:flex;justify-content:space-between;gap:12px;padding:7px 0;font-size:14px;line-height:20px}
37
- .sl-hco-line+.sl-hco-line{border-top:1px dashed var(--sl-line)}
38
- .sl-hco-line-text{display:flex;flex-direction:column;min-width:0}
39
- .sl-hco-where{font-weight:600;overflow-wrap:anywhere}
40
- .sl-hco-what{font-size:12.5px;line-height:18px;color:var(--sl-muted)}
41
- .sl-hco-price{flex:none;font-weight:600;font-variant-numeric:tabular-nums}
42
- .sl-hco-order-toggle{display:none}
43
- .sl-hco-field{display:flex;flex-direction:column;min-width:0;margin:0 0 12px}
44
- .sl-hco-label{display:block;margin:0 0 4px;font-size:13px;font-weight:600;line-height:20px}
45
- .sl-hco-label-row{display:flex;justify-content:space-between;gap:8px;width:100%}
46
- .sl-hco-optional{margin-left:auto;font-weight:450;color:var(--sl-muted)}
47
- .sl-hco-help{margin:-2px 0 6px;font-size:12.5px;line-height:18px;color:var(--sl-muted)}
48
- /* ONE FIELD LANGUAGE, shared with the picker panel (pickerStylesFields.ts):
49
- rest is a hairline and a 1px inner shade, so the field reads sunk into the
50
- card; hover steps the edge toward the ink; ANY focus (the buyer is typing)
51
- is the accent edge plus a soft 3px accent halo, never a hard outline; an
52
- invalid field is the same language in --sl-danger. The transparent outline
53
- is what forced-colors mode paints, where box-shadow is dropped. */
54
- .sl-hco-input{box-sizing:border-box;width:100%;min-height:44px;padding:10px 13px;font:inherit;font-size:15px;line-height:22px;color:var(--sl-text);
55
- background-color:var(--sl-bg);border:1px solid var(--sl-line);border-radius:calc(var(--sl-radius) * .55);
56
- box-shadow:inset 0 1px 2px rgb(0 0 0 / .08);
57
- transition:border-color .14s cubic-bezier(.2,0,0,1),box-shadow .14s cubic-bezier(.2,0,0,1),background-color .14s cubic-bezier(.2,0,0,1)}
58
- .sl-hco-input::placeholder{color:var(--sl-muted);opacity:.8}
59
- .sl-hco-input:hover:not(:focus):not(:disabled){border-color:color-mix(in srgb, var(--sl-text) 28%, var(--sl-line));
60
- background-color:color-mix(in srgb, var(--sl-text) 2%, var(--sl-bg))}
61
- .sl-hco-input:focus{outline:2px solid transparent;outline-offset:2px;border-color:var(--sl-accent);
62
- box-shadow:inset 0 1px 2px rgb(0 0 0 / .08),0 0 0 3px color-mix(in srgb, var(--sl-accent) 24%, transparent)}
63
- .sl-hco-input[aria-invalid="true"]{border-color:var(--sl-danger, #c0392b);
64
- background-color:color-mix(in srgb, var(--sl-danger, #c0392b) 5%, var(--sl-bg))}
65
- .sl-hco-input[aria-invalid="true"]:hover:not(:focus):not(:disabled){border-color:color-mix(in srgb, var(--sl-danger, #c0392b) 80%, var(--sl-text));
66
- background-color:color-mix(in srgb, var(--sl-danger, #c0392b) 5%, var(--sl-bg))}
67
- .sl-hco-input[aria-invalid="true"]:focus{border-color:var(--sl-danger, #c0392b);
68
- box-shadow:inset 0 1px 2px rgb(0 0 0 / .08),0 0 0 3px color-mix(in srgb, var(--sl-danger, #c0392b) 22%, transparent)}
69
- .sl-hco-input:disabled{color:var(--sl-muted);cursor:not-allowed;box-shadow:none;
70
- background-color:color-mix(in srgb, var(--sl-line) 30%, var(--sl-surface))}
71
- select.sl-hco-input{appearance:none;-webkit-appearance:none;padding-right:38px;cursor:pointer;
72
- background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b93a1' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
73
- background-repeat:no-repeat;background-position:right 14px center;background-size:10px 6px}
74
- select.sl-hco-input:disabled{cursor:not-allowed}
75
- textarea.sl-hco-input{min-height:76px;resize:vertical}
76
- .sl-hco-ferr{margin:6px 0 0;font-size:12.5px;font-weight:550;line-height:18px;color:var(--sl-danger, #c0392b)}
77
- .sl-hco-link{padding:2px 0;font:inherit;font-size:13px;font-weight:600;color:var(--sl-muted);background:none;border:0;
78
- text-decoration:underline;text-underline-offset:2px;cursor:pointer;align-self:flex-start}
79
- .sl-hco-link:hover{color:var(--sl-text)}
80
- .sl-hco-link:focus-visible{outline:2px solid transparent;border-radius:4px;
81
- box-shadow:0 0 0 3px color-mix(in srgb, var(--sl-accent) 24%, transparent)}
82
- .sl-hco-disclosure:hover{color:var(--sl-text);border-color:color-mix(in srgb, var(--sl-text) 28%, var(--sl-line))}
83
- .sl-hco-disclosure:focus-visible{outline:2px solid transparent;border-style:solid;border-color:var(--sl-accent);
84
- box-shadow:0 0 0 3px color-mix(in srgb, var(--sl-accent) 24%, transparent)}
85
- .sl-hco-bf-inline{display:flex;flex-direction:column}
86
- .sl-hco-bf-inline>.sl-hco-link{margin:-4px 0 4px}
87
- .sl-hco-block{counter-increment:sl-hco-ticket;min-width:0;margin:0 0 10px;padding:10px 12px 0;border:1px solid var(--sl-line);
88
- border-radius:calc(var(--sl-radius) * .75)}
89
- .sl-hco-sec:has(.sl-hco-block){counter-reset:sl-hco-ticket}
90
- .sl-hco-block.has-error{border-color:var(--sl-danger, #c0392b)}
91
- .sl-hco-legend{float:left;width:100%;display:flex;align-items:center;gap:10px;margin:0 0 10px;padding:0;font-size:14px;font-weight:650}
92
- .sl-hco-legend::before{content:counter(sl-hco-ticket);flex:none;display:grid;place-items:center;width:24px;height:24px;font-size:12px;
93
- font-weight:700;color:var(--sl-muted);background:color-mix(in srgb, var(--sl-text) 6%, transparent);border-radius:50%}
94
- .sl-hco-legend+*{clear:left}
95
- .sl-hco-you{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-2px 0 10px;font-size:13.5px;line-height:20px;
96
- color:var(--sl-muted)}
97
- .sl-hco-use{display:block;margin:-4px 0 8px}
98
- .sl-hco-pair{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}
99
- .sl-hco-disclosure{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;padding:10px 12px;font:inherit;font-size:13.5px;
100
- font-weight:600;color:var(--sl-muted);text-align:left;background:none;border:1px dashed var(--sl-line);
101
- border-radius:calc(var(--sl-radius) * .75);cursor:pointer;
102
- transition:border-color .14s cubic-bezier(.2,0,0,1),color .14s cubic-bezier(.2,0,0,1),box-shadow .14s cubic-bezier(.2,0,0,1)}
103
- .sl-hco-plus{font-size:16px;line-height:1}
104
- .sl-hco-group{min-width:0;margin:0 0 12px;padding:0;border:0}
105
- .sl-hco-group legend{width:100%;margin:0 0 5px;padding:0;font-size:13px;font-weight:600}
106
- .sl-hco-group[aria-invalid="true"] legend{color:var(--sl-danger, #c0392b)}
107
- .sl-hco-choices{display:flex;flex-direction:column}
108
- .sl-hco-chips .sl-hco-choices{flex-direction:row;flex-wrap:wrap;gap:6px}
109
- .sl-hco-chip{position:relative;display:inline-flex;align-items:center;min-height:36px;padding:7px 13px;font-size:14px;
110
- border:1px solid var(--sl-line);border-radius:999px;background:var(--sl-bg);cursor:pointer;
111
- transition:border-color .14s cubic-bezier(.2,0,0,1),background-color .14s cubic-bezier(.2,0,0,1),box-shadow .14s cubic-bezier(.2,0,0,1)}
112
- .sl-hco-chip:hover:not(:has(input:checked)){border-color:color-mix(in srgb, var(--sl-text) 28%, var(--sl-line))}
113
- .sl-hco-chip input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
114
- .sl-hco-chip:has(input:checked){color:var(--sl-accent-ink);background:var(--sl-accent);border-color:var(--sl-accent);font-weight:600}
115
- .sl-hco-chip:has(input:focus-visible){outline:2px solid transparent;border-color:var(--sl-accent);
116
- box-shadow:0 0 0 3px color-mix(in srgb, var(--sl-accent) 24%, transparent)}
117
- .sl-hco-chips[aria-invalid="true"] .sl-hco-chip{border-color:var(--sl-danger, #c0392b)}
118
- .sl-hco-check{display:flex;gap:8px;align-items:flex-start;margin:8px 0 0;font-size:14px;line-height:1.4;cursor:pointer}
119
- .sl-hco-check input{flex:none;width:18px;height:18px;margin:1px 0 0;accent-color:var(--sl-accent)}
120
- .sl-hco-check input:focus-visible{outline:2px solid transparent;box-shadow:0 0 0 1px var(--sl-accent),0 0 0 4px color-mix(in srgb, var(--sl-accent) 24%, transparent);border-radius:4px}
121
- .sl-hco-check .sl-hco-label-row{justify-content:flex-start}
122
- .sl-hco-note{margin:16px 0 0;font-size:11.5px;line-height:1.5;color:var(--sl-muted)}
123
- .sl-hco-note a{color:inherit;text-decoration:underline;text-underline-offset:2px}
124
- .sl-hco-foot{position:relative;z-index:1;flex:none;padding:12px 16px 14px;background:var(--sl-surface);border-top:1px solid var(--sl-line)}
125
- .sl-hco-alert{margin:0 0 10px;padding:9px 12px;font-size:13px;line-height:19px;border-radius:calc(var(--sl-radius) * .55)}
126
- .sl-hco-alert b{display:block;font-weight:650}
127
- .sl-hco-alert.is-error{color:var(--sl-danger, #c0392b);background:color-mix(in srgb, var(--sl-danger, #c0392b) 10%, transparent)}
128
- .sl-hco-alert.is-warn{color:var(--sl-warn-text, #985a08);background:color-mix(in srgb, var(--sl-warn, #c97a0c) 16%, transparent)}
129
- .sl-hco-body>.sl-hco-alert{margin:14px 0 0}
130
- .sl-hco-total{display:flex;justify-content:space-between;align-items:baseline;margin:0 0 10px;font-size:13px;color:var(--sl-muted)}
131
- .sl-hco-total strong{font-size:18px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--sl-text)}
132
- .sl-hco-pay{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:48px;padding:12px;font:inherit;font-size:15.5px;
133
- font-weight:650;color:var(--sl-accent-ink);background:var(--sl-accent);border:0;border-radius:calc(var(--sl-radius) * .6);cursor:pointer}
134
- .sl-hco-pay{transition:filter .14s cubic-bezier(.2,0,0,1),box-shadow .14s cubic-bezier(.2,0,0,1),transform .09s cubic-bezier(.2,0,0,1)}
135
- .sl-hco-pay:not([disabled]):hover{filter:brightness(1.06)}
136
- .sl-hco-pay:not([disabled]):active{transform:translateY(1px)}
137
- /* The button is filled with the accent, so the ring stands off it on the
138
- card's own surface \u2014 the same ring the picker's CTA wears. */
139
- .sl-hco-pay:focus-visible{outline:2px solid transparent;outline-offset:2px;
140
- box-shadow:0 0 0 2px var(--sl-surface),0 0 0 4px var(--sl-accent),0 0 0 7px color-mix(in srgb, var(--sl-accent) 18%, transparent)}
141
- .sl-hco-pay[disabled]{opacity:.8;cursor:progress}
142
- .sl-hco-trust{margin:9px 0 0;font-size:12px;line-height:17px;color:var(--sl-muted);text-align:center}
143
- .sl-hco-trust svg{display:inline-block;margin:0 5px -1px 0}
144
- .sl-hco-spin{display:inline-block;width:16px;height:16px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;
145
- animation:sl-hco-spin .8s linear infinite}
146
- @keyframes sl-hco-spin{to{transform:rotate(360deg)}}
147
- @media (prefers-reduced-motion:reduce){.sl-hco-spin{animation-duration:2.4s}
148
- .sl-hco-input,.sl-hco-chip,.sl-hco-disclosure,.sl-hco-pay{transition:none}
149
- .sl-hco-pay:not([disabled]):active{transform:none}}
150
- .sl-hco-back{width:100%;min-height:44px;margin-top:8px;padding:10px;font:inherit;font-size:14px;font-weight:600;color:var(--sl-muted);
151
- background:none;border:0;cursor:pointer}
152
- .sl-hco-ghost{margin:0;color:var(--sl-text);border:1px solid var(--sl-line);border-radius:calc(var(--sl-radius) * .6)}
153
- .sl-hco-state{padding:28px 8px 12px;text-align:center}
154
- .sl-hco-state-icon{display:grid;place-items:center;width:52px;height:52px;margin:0 auto 14px;border-radius:50%;color:var(--sl-muted);
155
- background:color-mix(in srgb, var(--sl-text) 6%, transparent)}
156
- .sl-hco-state-icon.is-warn{color:var(--sl-warn-text, #985a08);background:color-mix(in srgb, var(--sl-warn, #c97a0c) 16%, transparent)}
157
- .sl-hco-state-icon.is-error{color:var(--sl-danger, #c0392b);background:color-mix(in srgb, var(--sl-danger, #c0392b) 10%, transparent)}
158
- .sl-hco-state-icon .sl-hco-spin{width:22px;height:22px}
159
- .sl-hco-state-title{margin:0 0 6px;font-size:18px;font-weight:650;line-height:24px}
160
- .sl-hco-status{max-width:340px;margin:0 auto 6px;font-size:14px;line-height:1.55}
161
- .sl-hco-state-note{margin:10px 0 0;font-size:12.5px;color:var(--sl-muted)}
162
- .sl-hco-error{color:var(--sl-danger, #c0392b)}
163
- .sl-hco-receipt{display:grid;grid-template-columns:auto 1fr;gap:4px 14px;margin:14px 0 0;font-size:13px;text-align:left}
164
- .sl-hco-receipt dt{color:var(--sl-muted)}
165
- .sl-hco-receipt dd{margin:0;text-align:right}
166
- .sl-hco-ref{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;word-break:break-all}
167
- .sl-hco-tickets{display:block;width:100%;margin-top:14px;padding:12px;font:inherit;font-size:15px;
168
- font-weight:650;text-align:center;text-decoration:none;color:var(--sl-accent-ink);
169
- background:var(--sl-accent);border-radius:calc(var(--sl-radius) * .55)}
170
- /* Phones: a bottom sheet, the order folded to one line so the form and its
171
- button fit the first screen. */
172
- @media (max-width:560px){
173
- .sl-hco{align-items:flex-end;padding:0}
174
- .sl-hco-card{max-width:none;max-height:92%;border-radius:calc(var(--sl-radius) * 1.2) calc(var(--sl-radius) * 1.2) 0 0;border-bottom:0}
175
- .sl-hco-foot{padding-bottom:calc(14px + var(--sl-safe-b,0px))}
176
- .sl-hco-input{min-height:44px;font-size:16px}
177
- .sl-hco-pair{grid-template-columns:1fr}
178
- .sl-hco-order-toggle{display:flex;align-items:center;gap:10px;width:100%;margin:14px 0 0;padding:10px 12px;font:inherit;font-size:14px;
179
- font-weight:600;color:var(--sl-text);text-align:left;background:color-mix(in srgb, var(--sl-text) 5%, transparent);border:0;
180
- border-radius:calc(var(--sl-radius) * .6);cursor:pointer}
181
- .sl-hco-order-toggle span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
182
- .sl-hco-order:not([data-open]) .sl-hco-order-full{display:none}
183
- .sl-hco-order{padding-top:0}
184
- }
185
- `;function et(){if(typeof document>"u"||document.getElementById(Oe))return;let n=document.createElement("style");n.id=Oe,n.textContent=Ze,document.head.appendChild(n)}function tt(n,u){let s=`${u} ${u===1?"seat is":"seats are"} held for a limited time.`;return n==="payments_off_for_event"?{title:"This event isn\u2019t sold online",body:`${s} The organiser isn\u2019t taking payment for this event here.`,detail:"Nothing has been charged. Check where you found this event for how to get tickets."}:n==="unavailable_for_event"?{title:"This event isn\u2019t taking payment yet",body:`${s} Online payment is not switched on for this event.`,detail:"Nothing has been charged. If you were sent here to pay, let the organiser know, only they can turn payment on for this event."}:{title:"Finish in the ticketing checkout",body:`${s} Payment for this event is taken elsewhere.`,detail:"Nothing has been charged. Continue in the checkout on this page to pay for your seats."}}var ot=3,nt=1,rt=400,it=3e3;function Ke(n){if(!n||typeof n!="object")return!1;let u=n;return u.status!==503||u.code==="maintenance_mode"||u.reason==="maintenance_mode"?!1:u.code==="checkout_busy"||u.code==="database_busy"?!0:u.retryable===!0}function st(n,u=Math.random){let s=n?.retryAfterS,g=typeof s=="number"&&Number.isFinite(s)&&s>=0?s:nt,a=Math.floor(Math.max(0,Math.min(1,u()))*rt);return Math.min(it,g*1e3+a)}function at(n){return`${(typeof n?.notice=="string"?n.notice.trim():"")||(()=>{let g=n?.retryAfterS;if(typeof g!="number"||!Number.isFinite(g)||g<0)return"Booking is paused for a few minutes for maintenance. Please try again shortly.";let a=Math.max(1,Math.ceil(g/60));return`Booking is paused for maintenance. Please try again in about ${a} minute${a===1?"":"s"}.`})()} Nothing was charged. Your seats are still held.`}function ue(n,u){if(n==="maintenance_mode")return at(u);switch(n){case"checkout_busy":case"database_busy":return u?.free?"We couldn\u2019t confirm your booking yet because it\u2019s very busy. Nothing was charged. Please try again.":"We couldn\u2019t start the payment yet because it\u2019s very busy. Nothing was charged. Please try again.";case"gateway_not_connected":case"payments_not_enabled_for_event":return"This event is not taking online payments. Contact the organiser to buy these seats.";case"provider_mismatch":return"This event\u2019s payment setup changed while you were choosing. Nothing was charged. Please try again.";case"hold_not_active":case"hold_not_found":return"Your seats were released before checkout started. Nothing was charged. Please pick again.";case"checkout_already_started":return"A payment for these seats is already in progress. Finish that one, or wait for it to time out before starting again.";case"event_closed":return"Sales for this event have closed.";case"insufficient_hosted_credits":return"Ticket sales are temporarily paused while the organiser updates their SeatLayer balance. Nothing was charged. Please try again later or contact the organiser.";case"gateway_currency_mismatch":case"unsupported_currency":case"mixed_currency_hold":case"price_unusable":return"These seats cannot be checked out right now because of a pricing configuration problem. Nothing was charged. Please contact the organiser.";case"provider_refused":return"The organiser\u2019s payment provider refused to start this payment. Nothing was charged. Please contact the organiser.";case"rate_limited":return"Too many attempts. Wait a moment and try again.";case"seats_unavailable":return"Those seats were taken while you were filling this in. Nothing was charged. Please pick again.";case"booking_form_incomplete":return"The details this event asks for changed while you were choosing. Nothing was charged. Please go back and try again.";default:return"We could not start the payment. Nothing was charged. Please try again."}}function i(n,u,s){let g=document.createElement(n);return u&&(g.className=u),s!==void 0&&(g.textContent=s),g}var $e="http://www.w3.org/2000/svg";function re(n,u=18,s="0 0 20 20"){let g=document.createElementNS($e,"svg");g.setAttribute("viewBox",s),g.setAttribute("width",String(u)),g.setAttribute("height",String(u)),g.setAttribute("fill","none"),g.setAttribute("stroke","currentColor"),g.setAttribute("stroke-width","1.8"),g.setAttribute("stroke-linecap","round"),g.setAttribute("stroke-linejoin","round"),g.setAttribute("aria-hidden","true"),g.setAttribute("focusable","false");for(let a of n){let v=document.createElementNS($e,"path");v.setAttribute("d",a),g.appendChild(v)}return g}var ee={back:["M12.5 4.5 7 10l5.5 5.5"],clock:["M10 2.8a7.2 7.2 0 1 1 0 14.4a7.2 7.2 0 1 1 0-14.4","M10 6.2V10l2.6 1.7"],down:["m5 7.5 5 5 5-5"],lock:["M4.2 8.8h7.6a1.4 1.4 0 0 1 1.4 1.4v4.4a1.4 1.4 0 0 1-1.4 1.4H4.2a1.4 1.4 0 0 1-1.4-1.4v-4.4a1.4 1.4 0 0 1 1.4-1.4z","M5.4 8.8V6.6a2.6 2.6 0 0 1 5.2 0v2.2"],hour:["M12 3a9 9 0 1 1 0 18a9 9 0 1 1 0-18","M12 7v5l3 2"],seat:["M6 11V6a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v5M4 11h16v4H4zM6 15v4M18 15v4"],card:["M5 5.5h14a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-9a2 2 0 0 1 2-2z","M3 10h18M7 15h3"],alert:["M12 3a9 9 0 1 1 0 18a9 9 0 1 1 0-18","M12 7.5v5.5M12 16.5v.1"]},lt=12e4;function ct(n){let u=Math.max(0,Math.ceil(n/1e3)),s=Math.floor(u/3600),g=Math.floor(u%3600/60),a=String(u%60).padStart(2,"0");return s>0?`${s}:${String(g).padStart(2,"0")}:${a}`:`${g}:${a}`}function pt(n){et();let u=!0,s=!1,g=null,a=(e,r,p)=>{let f=n.t?.(e,p);return f&&f!==e?f:p?r.replace(/\{(\w+)\}/g,(H,B)=>B in p?String(p[B]):H):r},v=i("div","sl-hco");v.setAttribute("role","dialog"),v.setAttribute("aria-modal","true");let P=i("div","sl-hco-card");v.appendChild(P);let D=()=>{g&&clearInterval(g),g=null},z=()=>{u=!1,D(),v.remove(),document.removeEventListener("keydown",I,!0)},M=()=>{z(),n.onCancel()},ie=!0;function I(e){if(v.isConnected){if(e.key==="Tab"){let r=[...P.querySelectorAll("a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])")].filter(H=>H.offsetParent!==null||H===document.activeElement),p=r[0],f=r[r.length-1];if(!p||!f)return;e.shiftKey&&document.activeElement===p?(e.preventDefault(),f.focus()):!e.shiftKey&&document.activeElement===f&&(e.preventDefault(),p.focus());return}e.key==="Escape"&&(e.stopPropagation(),e.preventDefault(),ie&&M())}}document.addEventListener("keydown",I,!0);let S=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`,se=i("header","sl-hco-head"),R=i("button","sl-hco-back-icon");R.type="button",R.setAttribute("aria-label",a("checkout.back","Back to seats")),R.appendChild(re([...ee.back])),R.addEventListener("click",()=>{ie&&M()});let he=i("div","sl-hco-htext"),q=i("h2","sl-hco-title",n.event?.name?.trim()||a("checkout.title","Checkout"));q.id=S;let pe=i("p","sl-hco-sub",n.event?.detail?.trim()??"");pe.hidden=!pe.textContent,he.append(q,pe);let L=i("span","sl-hco-timer");L.setAttribute("role","timer");let O=i("span");O.setAttribute("aria-hidden","true"),L.append(re([...ee.clock],14),O),L.hidden=!0,se.append(R,he,L),v.setAttribute("aria-labelledby",S);let U=i("p","sl-hco-sr");U.setAttribute("aria-live","polite");let Y=(...e)=>{P.replaceChildren(se,U,...e)},G=e=>{ie=e,R.hidden=!e},J=e=>{let r=i("div","sl-hco-state");r.setAttribute("role",e.alert?"alert":"status");let p=i("div",`sl-hco-state-icon is-${e.tone}`);return p.setAttribute("aria-hidden","true"),p.appendChild(e.icon),r.appendChild(p),e.title&&r.appendChild(i("h3","sl-hco-state-title",e.title)),e.text&&r.appendChild(i("p",`sl-hco-status${e.alert?" sl-hco-error":""}`,e.text)),e.note&&r.appendChild(i("p","sl-hco-state-note",e.note)),r},V=(...e)=>{let r=i("div","sl-hco-body");return r.append(...e),r},te=(...e)=>{let r=i("footer","sl-hco-foot");return r.append(...e),r},ge=()=>{let e=i("span","sl-hco-spin");return e.setAttribute("aria-hidden","true"),e},K=(e,r="error")=>{if(!u)return;D(),L.hidden=!0,G(!0);let p=i("button",r==="error"?"sl-hco-back sl-hco-ghost":"sl-hco-pay",r==="expired"?a("checkout.chooseAgain","Choose seats again"):r==="taken"?a("checkout.chooseOther","Choose other seats"):a("checkout.back","Back to seats"));if(p.type="button",p.addEventListener("click",M),r==="error"){let f=i("p","sl-hco-alert is-error sl-hco-status sl-hco-error",e);f.setAttribute("role","alert"),Y(V(...Q?[Q]:[],f),te(p))}else Y(V(J({tone:r==="expired"?"warn":"error",icon:re([...r==="expired"?ee.hour:ee.seat],24,"0 0 24 24"),title:r==="expired"?a("checkout.expiredTitle","Your seats were released"):a("checkout.takenTitle","Those seats were just taken"),text:e,alert:!1})),te(p));p.focus()},xe=(e,r)=>{u&&(D(),L.hidden=!0,G(!1),Y(V(J({tone:"neutral",icon:ge(),...r?{title:r}:{},text:e}))))},ae=async(e,r=!1)=>{xe(r?a("checkout.confirmingSeats","Confirming your seats\u2026"):"Payment received. Confirming your seats\u2026");let p=Date.now()+Xe;for(;u&&Date.now()<p;){try{let f=await n.orderStatus(e);if(!u)return;if(f.status==="confirmed"){s=!0,G(!1),q.textContent=a("checkout.confirmedTitle","Your tickets are confirmed");let H=i("p","sl-hco-status",`${f.seatCount} ${f.seatCount===1?"seat":"seats"} confirmed. Your tickets, with their door QR codes, are in your email.`),B=i("dl","sl-hco-receipt"),$=(f.tickets??[]).map(ne=>ne.displayLabel||ne.label);$.length&&B.append(i("dt",void 0,"Seats"),i("dd",void 0,$.join(", ")));let j=r||f.totalMinor===0;B.append(i("dt",void 0,j?a("checkout.price","Price"):a("checkout.paid","Paid")),i("dd",void 0,j?a("checkout.free","Free"):`${f.amountFormatted} ${f.currency}`),i("dt",void 0,a("checkout.order","Order")),i("dd","sl-hco-ref",f.orderId));let de=i("button","sl-hco-back","Close");de.type="button",de.addEventListener("click",M);let Z=i("div","sl-hco-state");if(Z.append(H,B),f.ticketUrl){let ne=i("a","sl-hco-tickets",a("checkout.viewTickets","View tickets & QR codes"));ne.href=f.ticketUrl,ne.target="_blank",ne.rel="noreferrer",Z.appendChild(ne)}Z.appendChild(de),Y(V(Z)),ie=!0,n.onConfirmed(f);return}if(f.status==="failed"||f.status==="expired"){f.status==="expired"?K("Your seats were released before payment completed. Nothing was charged. Please pick again.","expired"):K("The payment did not complete. If you were charged, it has been refunded automatically.");return}}catch{}await new Promise(f=>setTimeout(f,We))}!u||s||K(r?"Still confirming your booking. Once it is confirmed, your tickets will arrive by email. Nothing was charged.":"Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly. You do not need to pay again.")},Q=null;if(n.state.kind==="unavailable"){let e=tt(n.state.reason,n.state.seatCount);q.textContent=e.title;let r=i("button","sl-hco-back sl-hco-ghost","Back to seat map");r.type="button",r.addEventListener("click",M);let p=i("p","sl-hco-label","Seats held");return Y(V(p,J({tone:"neutral",icon:re([...ee.seat],24,"0 0 24 24"),text:e.body,note:e.detail})),te(r)),n.root.appendChild(v),r.focus(),{destroy:z}}if(n.state.kind==="resume")return n.root.appendChild(v),ae(n.state.orderId),{destroy:z};let{order:_,bookingForm:le}=n.state,X=n.state.free===!0,fe=e=>X?a("checkout.free","Free"):n.formatMoney(e,_.currency),me=fe(_.total);Q=i("section","sl-hco-sec sl-hco-order sl-hco-summary");let t=_.lines?.length?_.lines:_.labels.map(e=>({label:e,detail:null,amount:null})),o=t.length===1?[t[0].label,t[0].detail].filter(Boolean).join(" \xB7 "):`${_.tickets?.length||t.length} ${(_.tickets?.length||t.length)===1?"seat":"seats"}`,c=i("button","sl-hco-order-toggle");c.type="button",c.setAttribute("aria-expanded","false"),c.append(i("span",void 0,o),re([...ee.down])),c.addEventListener("click",()=>{let e=!Q.hasAttribute("data-open");Q.toggleAttribute("data-open",e),c.setAttribute("aria-expanded",String(e))});let b=i("div","sl-hco-order-full"),l=i("ul","sl-hco-lines sl-hco-seats");for(let e of t){let r=i("li","sl-hco-line sl-hco-seat"),p=i("span","sl-hco-line-text");p.appendChild(i("span","sl-hco-where",e.label)),e.detail&&p.appendChild(i("span","sl-hco-what",e.detail)),r.appendChild(p),typeof e.amount=="number"&&r.appendChild(i("span","sl-hco-price",fe(e.amount))),l.appendChild(r)}b.append(i("h3","sl-hco-h",a("checkout.yourOrder","Your order")),l),Q.append(c,b);let h=i("form","sl-hco-form");h.noValidate=!0;let d=e=>{let r=i("div","sl-hco-field"),p=i("label","sl-hco-label"),f=i("span","sl-hco-label-row");f.appendChild(i("span",void 0,e.label));let H=i("span","sl-hco-optional",a("checkout.optional","Optional"));e.optional&&f.append(" ",H),p.appendChild(f),p.htmlFor=e.id;let B=e.hint?i("p","sl-hco-help",e.hint):null;B&&(B.id=`${e.id}-h`);let $=i("input","sl-hco-input");$.type=e.type,$.id=e.id,$.autocomplete=e.autocomplete,$.placeholder=e.placeholder;let j=i("p","sl-hco-ferr");j.id=`${e.id}-e`,j.hidden=!0,$.setAttribute("aria-describedby",B?`${B.id} ${j.id}`:j.id),r.append(p,...B?[B]:[],$,j);let de=Z=>{j.textContent=Z??"",j.hidden=!Z,Z?$.setAttribute("aria-invalid","true"):$.removeAttribute("aria-invalid")};return $.addEventListener("input",()=>de(null)),{wrap:r,input:$,optional:H,setError:de}},k=d({id:`${S}-email`,label:a("checkout.email","Email"),type:"email",autocomplete:"email",placeholder:"you@example.com",hint:a("checkout.emailHint","Your tickets are sent here."),optional:!1}),T=k.input;T.required=!0,T.inputMode="email";let w=d({id:`${S}-name`,label:a("checkout.name","Name"),type:"text",autocomplete:"name",placeholder:a("checkout.namePlaceholder","Your name"),optional:!0}),N=w.input;le?.attendeeName==="required"&&(w.optional.previousSibling?.remove(),w.optional.remove(),N.setAttribute("aria-required","true"));let x=()=>/.+@.+\..+/.test(T.value.trim()),m=Pe({form:le,tickets:_.tickets??[],idPrefix:S,t:a,buyer:()=>({name:N.value.trim(),email:T.value.trim()}),buyerError:(e,r)=>((e==="name"?w:k).setError(r),e==="name"?N:T)}),F=i("section","sl-hco-sec");F.append(i("h3","sl-hco-h",a("checkout.yourDetails","Your details")),k.wrap,w.wrap,...m.details?.childNodes.length?[m.details]:[]);let A=i("p","sl-hco-note");A.append(`${a("checkout.privacy","The organizer and SeatLayer use your details to issue and manage your tickets.")} `);let C=i("a",void 0,a("checkout.privacyLink","Privacy Policy"));C.href="https://seatlayer.io/privacy/",C.target="_blank",C.rel="noreferrer",A.appendChild(C);let W=i("fieldset","sl-hco-fields");W.append(Q,F,...m.element?[m.element]:[],A);let ye=V(W),E=i("p","sl-hco-alert is-error sl-hco-status sl-hco-error");E.setAttribute("role","alert"),E.hidden=!0;let be=e=>{E.textContent=e,E.hidden=!1},ke=i("p","sl-hco-alert is-warn");ke.hidden=!0;let Ae=i("div","sl-hco-total"),Me=_.tickets?.length||_.labels.length;Ae.append(i("span",void 0,`${Me} ${Me===1?"seat":"seats"}`),i("strong",void 0,me));let _e=X?a("checkout.confirmBooking","Confirm booking"):a("checkout.continue","Continue to payment"),oe=i("button","sl-hco-pay",_e);oe.type="submit";let ve=i("p","sl-hco-sr");ve.setAttribute("role","status");let Fe=e=>{oe.replaceChildren(ge(),e),ve.textContent=e},Ee=i("p","sl-hco-trust");X||Ee.appendChild(re([...ee.lock],12,"0 0 16 16")),Ee.append(X?a("checkout.freeTrust","Free booking. Nothing is charged."):a("checkout.trust","Secure payment on the organizer\u2019s payment page. We never see your card.")),h.append(ye,te(E,ke,Ae,oe,ve,Ee));let Se=null,Le=()=>{let e=_.expiresAt-Date.now(),r=ct(e);O.textContent=r,L.setAttribute("aria-label",a("checkout.heldFor","Seats held for {time}",{time:r}));let p=e<=lt;L.classList.toggle("is-warn",p),ke.hidden=!p||!E.hidden,p&&(ke.textContent=a("checkout.expiringSoon","Your seats are held for {time}. Finish soon to keep them.",{time:r}));let f=e<=3e4?30:p?120:null;f&&Se!==f&&(Se=f,U.textContent=ke.textContent),e<=0&&K(a("checkout.expiredBody","The hold on {seats} ran out before payment started.",{seats:t.map(H=>H.label).join(", ")}),"expired")},qe=()=>{Number.isFinite(_.expiresAt)&&(D(),L.hidden=!1,Le(),g=setInterval(Le,1e3))},we=!1,De=async()=>{if(!we){we=!0,E.hidden=!0,W.disabled=!0,oe.disabled=!0,Fe(X?a("checkout.confirmingBooking","Confirming your booking\u2026"):a("checkout.opening","Opening secure payment\u2026"));try{let e={holdId:_.holdId,buyerEmail:T.value.trim(),...N.value.trim()?{buyerName:N.value.trim()}:{},...m.payload(),bookingFormVersion:1},r=0,p;for(;;)try{p=await n.startSession(e);break}catch(H){if(!u)return;if(r>=ot||!Ke(H))throw H;if(r+=1,Fe(X?a("checkout.busyRetryingBooking","Busy right now. Still confirming your booking\u2026"):a("checkout.busyRetryingPayment","Busy right now. Still opening secure payment\u2026")),await new Promise(B=>setTimeout(B,st(H))),!u)return}if(!u)return;if(p.status==="confirmed"){ae(p.orderId,!0);return}let f=Ne(p.redirectUrl);if(f){Je(p.orderId,n.eventKey),D(),L.hidden=!0,Y(V(J({tone:"neutral",icon:re([...ee.card],24,"0 0 24 24"),title:a("checkout.redirectTitle","Taking you to secure payment"),text:a("checkout.redirectBody","You\u2019ll pay {amount} on the organizer\u2019s payment page, then come back here for your tickets.",{amount:me}),note:a("checkout.dontClose","Don\u2019t close this tab.")}))),window.location.assign(f);return}K(ue("gateway_unavailable"))}catch(e){n.onError?.(e);let r=e;if(r?.code==="booking_form_incomplete"&&m.element){Te(),m.showServerErrors(r.fields);return}if(Ke(r)){Te(),be(X?a("checkout.busyFailedBooking",ue("checkout_busy",{free:!0})):a("checkout.busyFailedPayment",ue("checkout_busy"))),oe.textContent=a("checkout.tryAgain","Try again");return}if(r?.code==="hold_not_active"||r?.code==="hold_not_found"){K(ue(r.code),"expired");return}if(r?.code==="seats_unavailable"){K(a("checkout.seatsUnavailable",ue(r.code)),"taken");return}K(ue(r?.code,r))}}};h.addEventListener("submit",e=>{if(e.preventDefault(),we)return;let r=x();k.setError(r?null:a("checkout.error.email","Enter an email like name@example.com."));let p=m.validate();if(!r){be(a("bookingForm.fixErrors","Some details need attention before you continue.")),T.focus();return}if(!p){be(a("bookingForm.fixErrors","Some details need attention before you continue."));return}De()});let Te=()=>{q.textContent=n.event?.name?.trim()||a("checkout.title","Checkout"),E.hidden=!0,E.textContent="",we=!1,W.disabled=!1,oe.disabled=!1,oe.textContent=_e,ve.textContent="",G(!0),Y(h),qe()};return Te(),n.root.appendChild(v),(typeof window.matchMedia!="function"||window.matchMedia("(min-width: 561px)").matches)&&T.focus(),{destroy:z}}export{ot as CHECKOUT_BUSY_MAX_RETRIES,st as checkoutBusyDelayMs,ue as errorCopy,ct as formatHoldClock,Ke as isCheckoutBusy,pt as mountCheckout,tt as unavailableCopy};