@getmicdrop/venue-calendar 3.7.5 → 3.7.6

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.
Files changed (24) hide show
  1. package/dist/{CarouselView.legacy-D5woxGvc.js → CarouselView.legacy-BerW2BIf.js} +2 -2
  2. package/dist/{CarouselView.legacy-D5woxGvc.js.map → CarouselView.legacy-BerW2BIf.js.map} +1 -1
  3. package/dist/{Checkout.legacy-COqVbbvZ.js → Checkout.legacy-BUTDyZEl.js} +2 -2
  4. package/dist/{Checkout.legacy-COqVbbvZ.js.map → Checkout.legacy-BUTDyZEl.js.map} +1 -1
  5. package/dist/{CollectionView.legacy-By94GSut.js → CollectionView.legacy-CpbK7GfV.js} +2 -2
  6. package/dist/{CollectionView.legacy-By94GSut.js.map → CollectionView.legacy-CpbK7GfV.js.map} +1 -1
  7. package/dist/{FeaturedView.legacy-B8KkxEQY.js → FeaturedView.legacy-D3yl9J0Z.js} +2 -2
  8. package/dist/{FeaturedView.legacy-B8KkxEQY.js.map → FeaturedView.legacy-D3yl9J0Z.js.map} +1 -1
  9. package/dist/{GalleryView.legacy-C3dOgBD6.js → GalleryView.legacy-DMKXaHB-.js} +2 -2
  10. package/dist/{GalleryView.legacy-C3dOgBD6.js.map → GalleryView.legacy-DMKXaHB-.js.map} +1 -1
  11. package/dist/{GroupedListView.legacy-DTOqtS9B.js → GroupedListView.legacy-407NxwnE.js} +2 -2
  12. package/dist/{GroupedListView.legacy-DTOqtS9B.js.map → GroupedListView.legacy-407NxwnE.js.map} +1 -1
  13. package/dist/{SeriesPage.legacy-CQM0apyA.js → SeriesPage.legacy-BaoXX6o6.js} +2 -2
  14. package/dist/{SeriesPage.legacy-CQM0apyA.js.map → SeriesPage.legacy-BaoXX6o6.js.map} +1 -1
  15. package/dist/{Success.legacy-D3PYCfHW.js → Success.legacy-zgBL-BU6.js} +2 -2
  16. package/dist/{Success.legacy-D3PYCfHW.js.map → Success.legacy-zgBL-BU6.js.map} +1 -1
  17. package/dist/{VenueCalendar-XWZRPtLP.js → VenueCalendar-B901yBqy.js} +14 -14
  18. package/dist/{VenueCalendar-XWZRPtLP.js.map → VenueCalendar-B901yBqy.js.map} +1 -1
  19. package/dist/venue-calendar.es.js +1 -1
  20. package/dist/venue-calendar.iife.js +1 -1
  21. package/dist/venue-calendar.iife.js.map +1 -1
  22. package/dist/venue-calendar.umd.js +1 -1
  23. package/dist/venue-calendar.umd.js.map +1 -1
  24. package/package.json +1 -1
@@ -10,7 +10,7 @@
10
10
  }
11
11
  }
12
12
  })();
13
- import { H as t, J as n, K as h, L as o, M as r, N as c, Q as u, T as C, V, U as m, X as l, Y as w, Z as T, _ as k, $ as S, a0 as d, a1 as p, a2 as g, a3 as E, a4 as M, a5 as f, a6 as v, a7 as D, a8 as b, a9 as x } from "./VenueCalendar-XWZRPtLP.js";
13
+ import { H as t, J as n, K as h, L as o, M as r, N as c, Q as u, T as C, V, U as m, X as l, Y as w, Z as T, _ as k, $ as S, a0 as d, a1 as p, a2 as g, a3 as E, a4 as M, a5 as f, a6 as v, a7 as D, a8 as b, a9 as x } from "./VenueCalendar-B901yBqy.js";
14
14
  import "svelte";
15
15
  import "svelte/store";
16
16
  export {
@@ -70,7 +70,7 @@ END:VEVENT
70
70
  END:VCALENDAR`,k=new Blob([Z],{type:"text/calendar;charset=utf-8"}),E=URL.createObjectURL(k),L=document.createElement("a");L.href=E;const x=(e.event.title||"event").replace(/[^a-zA-Z0-9\s-]/g,"").replace(/\s+/g,"-");L.download=`${x}.ics`,document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(E),t.set(s,!1)}function n(){t.set(s,!1)}async function c(){const _={url:e.eventUrl};if(navigator.share)try{await navigator.share(_)}catch(u){u instanceof Error&&u.name!=="AbortError"&&v()}else v()}function v(){navigator.clipboard.writeText(e.eventUrl).then(()=>{alert(r().linkCopied||"Link copied to clipboard!")}).catch(()=>{prompt(r().copyLink||"Copy this link:",e.eventUrl)})}function h(){alert(`Apple Wallet integration requires backend signing infrastructure.
71
71
  In production, this would generate a .pkpass file and add it to your Apple Wallet.`)}function d(){alert(`Google Wallet integration requires backend signing infrastructure.
72
72
  In production, this would create a Google Wallet pass via the Google Pay API.`)}let m=t.derived(()=>(()=>{const _=[e.event.venue.name,e.event.venue.address].filter(Boolean);return`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(_.join(", "))}`})());function g(){window.location.href=e.eventUrl}var p=fV();let H;var f=t.child(p);Ut(f,{border:!0,padding:!1,class:"rounded-xl shadow-lg overflow-hidden bg-surface-secondary",children:(_,u)=>{var A=pV(),y=t.first_child(A),b=t.child(y);t.reset(y);var M=t.sibling(y,2),w=t.child(M),V=t.child(w);g2(V,{size:"sm",class:"font-semibold block leading-tight",children:(F,r1)=>{t.next();var l1=t.text();t.template_effect(()=>t.set_text(l1,e.event.title)),t.append(F,l1)},$$slots:{default:!0}});var Z=t.sibling(V,2),k=t.child(Z);Fe(k,{size:16,class:"shrink-0 icon-muted"});var E=t.sibling(k,2);g2(E,{size:"xs",color:"muted",children:(F,r1)=>{t.next();var l1=cV(),q=t.first_child(l1),J=t.sibling(q);{var A1=e1=>{var s1=t.text();t.template_effect(Q=>t.set_text(s1,`· ${Q??""}`),[()=>w2(e.event.startDateTime,e.event.timezone)]),t.append(e1,s1)};t.if(J,e1=>{e.event.displayStartTime!==!1&&e1(A1)})}t.template_effect(e1=>t.set_text(q,`${e1??""} `),[()=>tt(e.event.startDateTime,e.event.timezone)]),t.append(F,l1)},$$slots:{default:!0}}),t.reset(Z);var L=t.sibling(Z,2);g2(L,{size:"xs",color:"muted",class:"block mt-0.5",children:(F,r1)=>{t.next();var l1=t.text();t.template_effect(()=>t.set_text(l1,e.event.venue.name)),t.append(F,l1)},$$slots:{default:!0}}),t.reset(w);var x=t.sibling(w,2),z=t.child(x),I=t.child(z);t.reset(z);var C=t.sibling(z,2),T=t.child(C),S=t.sibling(T,2);t.reset(C),t.reset(x);var P=t.sibling(x,4),D=t.child(P);s2(D,{variant:"default",size:"md",class:"w-full",onclick:i,children:(F,r1)=>{var l1=vV(),q=t.first_child(l1);Fe(q,{size:16});var J=t.sibling(q),A1=t.sibling(J);{let e1=t.derived(()=>t.get(s)?"rotate-180":"");N3(A1,{size:16,get class(){return`ml-auto transition-transform ${t.get(e1)??""}`}})}t.template_effect(()=>t.set_text(J,` ${(r().addToCalendar||"Add to Calendar")??""} `)),t.append(F,l1)},$$slots:{default:!0}});var R=t.sibling(D,2);{var B=F=>{var r1=dV(),l1=t.child(r1),q=t.sibling(t.child(l1));t.reset(l1);var J=t.sibling(l1,2),A1=t.child(J);Sp(A1,{size:16,class:"shrink-0"});var e1=t.sibling(A1);t.reset(J),t.reset(r1),t.template_effect(()=>{t.set_attribute(l1,"href",t.get(l)),t.set_text(q,` ${(r().googleCalendar||"Google Calendar")??""}`),t.set_text(e1,` ${(r().appleCalendar||"Apple Calendar (.ics)")??""}`)}),t.delegated("click",l1,n),t.delegated("click",J,o),t.append(F,r1)};t.if(R,F=>{t.get(s)&&F(B)})}t.reset(P);var U=t.sibling(P,2),G=t.child(U);s2(G,{variant:"default",size:"md",class:"flex-1",onclick:c,children:(F,r1)=>{var l1=hV(),q=t.first_child(l1);H6(q,{size:16});var J=t.sibling(q);t.template_effect(()=>t.set_text(J,` ${(r().share||"Share")??""}`)),t.append(F,l1)},$$slots:{default:!0}});var c1=t.sibling(G,2);{var W=F=>{s2(F,{variant:"default",size:"md",class:"flex-1",get href(){return t.get(m)},target:"_blank",children:(r1,l1)=>{var q=gV(),J=t.first_child(q);Vf(J,{size:16});var A1=t.sibling(J);t.template_effect(()=>t.set_text(A1,` ${(r().map||"Map")??""}`)),t.append(r1,q)},$$slots:{default:!0}})};t.if(c1,F=>{e.event.venue.address&&F(W)})}t.reset(U);var d1=t.sibling(U,2),p1=t.child(d1),t1=t.child(p1);O3(t1,{size:16,class:"shrink-0"});var h1=t.sibling(t1);t.reset(p1);var N=t.sibling(p1,2);{var O=F=>{var r1=mV(),l1=t.sibling(t.first_child(r1),2),q=t.child(l1);hf(q,{size:16,class:"shrink-0"});var J=t.sibling(q);t.reset(l1),t.template_effect(()=>{t.set_attribute(l1,"href",`mailto:${e.event.venue.contactEmail??""}?subject=Help with Order ${e.orderId??""}`),t.set_text(J,` ${(r().needHelp||"Need help?")??""}`)}),t.append(F,r1)};t.if(N,F=>{e.event.venue.contactEmail&&F(O)})}t.reset(d1),t.reset(M),t.template_effect(()=>{t.set_attribute(b,"src",e.event.imageUrl),t.set_attribute(b,"alt",e.event.title),t.set_attribute(I,"alt",r().addToAppleWallet||"Add to Apple Wallet"),t.set_attribute(T,"alt",r().saveToGoogleWallet||"Save to Google Wallet"),t.set_attribute(S,"alt",r().saveToGoogleWallet||"Save to Google Wallet"),t.set_text(h1,` ${(r().backToEvent||"Back to event")??""}`)}),t.delegated("click",z,h),t.delegated("click",C,d),t.delegated("click",p1,g),t.append(_,A)},$$slots:{default:!0}}),t.reset(p),t.template_effect(()=>H=t.set_class(p,1,"actions-wrapper svelte-zqubiq",null,H,{visible:e.showContent})),t.append(a,p),t.pop()}t.delegate(["click"]);var uV=t.from_html('<button type="button"><span></span> </button>'),_V=t.from_html('<div class="toggle-bar bg-surface-primary border-default svelte-1cyfs2"><span class="toggle-label text-color-muted svelte-1cyfs2">Success</span> <!></div>'),HV=t.from_html('<div class="w-full min-h-screen bg-surface-primary text-color-primary"><!> <div class="max-w-6xl mx-auto px-4 py-6 md:px-6 md:py-8"><div class="hidden md:grid gap-8 items-start" style="grid-template-columns: 1fr 360px;"><!> <div class="sticky top-6"><!></div></div> <div class="md:hidden space-y-6"><!> <!></div></div></div>');function MV(a,e){t.push(e,!0);let r=t.state("default");const s=[{value:"default",label:"Standard",color:"bg-accent-success"},{value:"free",label:"Free",color:"bg-sky-500"},{value:"registration",label:"Registration",color:"bg-brand-primary"},{value:"donation",label:"Donation",color:"bg-accent-danger"}];let i=t.prop(e,"data",3,void 0),l=t.prop(e,"eventUrl",3,void 0),o=t.prop(e,"labels",19,()=>({}));const n=t.derived(()=>l5(o()));let c=t.derived(()=>!i());const v={default:{event:W2,orderId:"12847",lines:[{ticketId:101,ticketName:"General Admission",quantity:2,unitPrice:25,fee:2.5,subtotal:50},{ticketId:102,ticketName:"VIP Front Row",quantity:1,unitPrice:55,fee:5.5,subtotal:55}],customerEmail:"customer@example.com"},free:{event:$3,orderId:"12848",lines:[{ticketId:201,ticketName:"Free Entry",quantity:2,unitPrice:0,fee:0,subtotal:0}],customerEmail:"comedy.fan@gmail.com"},registration:{event:t5,orderId:"12849",lines:[{ticketId:301,ticketName:"Workshop Seat",quantity:1,unitPrice:75,fee:7.5,subtotal:75}],customerEmail:"learner@example.com"},donation:{event:e5,orderId:"12850",lines:[{ticketId:401,ticketName:"Donation",quantity:1,unitPrice:25,fee:0,subtotal:25},{ticketId:402,ticketName:"Standard Admission",quantity:1,unitPrice:30,fee:3,subtotal:30}],customerEmail:"generous@example.com"}};let h=t.derived(()=>t.get(c)?v[t.get(r)]:i()),d=t.derived(()=>(()=>{const L=t.get(h).lines,x=L.reduce((C,T)=>C+T.subtotal,0),z=L.reduce((C,T)=>C+T.fee*T.quantity,0),I=i5(x+z,t.get(h).event.venue.taxPercentage);return{lines:L,subtotal:x,fees:z,taxes:I,total:x+z+I,promoDiscount:0,giftCardAmount:0}})()),m=t.derived(()=>t.get(c)?typeof window>"u"?"#":`${window.location.origin}/e/${t.get(h).event.id}-${t.get(h).event.slug}`:l()||"#"),g=t.state(!1),p=t.state(!1),H=t.state(!1);function f(){if(t.get(H)){t.set(g,!0),t.set(p,!0);return}t.set(g,!1),t.set(p,!1),setTimeout(()=>{t.set(g,!0)},800),setTimeout(()=>{t.set(p,!0)},1600)}t.user_effect(()=>{t.get(c)&&(t.get(r),f())}),j1.onMount(()=>{t.set(H,window.matchMedia("(prefers-reduced-motion: reduce)").matches,!0),f()});var _=HV(),u=t.child(_);{var A=L=>{var x=_V(),z=t.sibling(t.child(x),2);t.each(z,17,()=>s,t.index,(I,C)=>{const T=t.derived(()=>t.get(r)===t.get(C).value);var S=uV(),P=t.child(S),D=t.sibling(P);t.reset(S),t.template_effect(()=>{t.set_class(S,1,`toggle-btn ${t.get(T)?"active bg-surface-secondary text-color-primary font-medium":"text-color-tertiary hover:bg-surface-secondary hover:text-color-secondary"}`,"svelte-1cyfs2"),t.set_class(P,1,`w-1.5 h-1.5 rounded-full ${t.get(C).color??""} shrink-0`,"svelte-1cyfs2"),t.set_text(D,` ${t.get(C).label??""}`)}),t.delegated("click",S,()=>{t.set(r,t.get(C).value,!0)}),t.append(I,S)}),t.reset(x),t.append(L,x)};t.if(u,L=>{t.get(c)&&L(A)})}var y=t.sibling(u,2),b=t.child(y),M=t.child(b);W6(M,{get event(){return t.get(h).event},get orderId(){return t.get(h).orderId},get orderTotals(){return t.get(d)},get customerEmail(){return t.get(h).customerEmail},get showCheckmark(){return t.get(g)},get showContent(){return t.get(p)},get labels(){return t.get(n)}});var w=t.sibling(M,2),V=t.child(w);X6(V,{get event(){return t.get(h).event},get orderId(){return t.get(h).orderId},get eventUrl(){return t.get(m)},get showContent(){return t.get(p)},get labels(){return t.get(n)}}),t.reset(w),t.reset(b);var Z=t.sibling(b,2),k=t.child(Z);W6(k,{get event(){return t.get(h).event},get orderId(){return t.get(h).orderId},get orderTotals(){return t.get(d)},get customerEmail(){return t.get(h).customerEmail},get showCheckmark(){return t.get(g)},get showContent(){return t.get(p)},get labels(){return t.get(n)}});var E=t.sibling(k,2);X6(E,{get event(){return t.get(h).event},get orderId(){return t.get(h).orderId},get eventUrl(){return t.get(m)},get showContent(){return t.get(p)},get labels(){return t.get(n)}}),t.reset(Z),t.reset(y),t.reset(_),t.append(a,_),t.pop()}t.delegate(["click"]);var VV=t.from_html('<div class="flex flex-col items-center justify-center py-24 text-center gap-4 error-container svelte-1mm1psu"><p class="svelte-1mm1psu"> </p></div>'),AV=t.from_html('<div class="flex items-center justify-center py-24 text-center loading-container svelte-1mm1psu"><p> </p></div>');function Xe(a,e){t.push(e,!0);let r=t.state(!1),s=t.state(null);typeof window<"u"&&new URLSearchParams(window.location.search).get("legacy")==="1"&&t.set(r,!0),t.user_effect(()=>{t.get(r)&&!t.get(s)&&Promise.resolve().then(()=>bx).then(_=>{t.set(s,_.default,!0)}).catch(()=>{t.set(r,!1)})});let i=t.prop(e,"data",19,()=>({})),l=t.prop(e,"browseUrl",3,"/"),o=t.prop(e,"labels",19,()=>({})),n=t.state(null),c=t.state(""),v=t.state(null),h=t.state(!0);j1.onMount(async()=>{const{id:_,slug:u,event:A,orderId:y,orderUuid:b,customerEmail:M,ticketCount:w}=i()||{};t.set(c,`${window.location.origin}/e/${_}-${u}`);let V;try{V=iV(A)}catch(L){console.warn("Success: transformApiEvent failed:",L),t.set(v,o().failedToLoadEventData||"Failed to load event data.",!0),t.set(h,!1);return}let Z=y||"",k=M||"",E=[];if(Z)try{const L=await R3(Z);if(L){k=L.customerEmail||k;const x=L.purchasedTickets||L.tickets||[],z=new Map;for(const I of x){const C=`${I.ticketTypeId||I.ticketId||0}-${I.ticketName||I.name||""}`,T=z.get(C);T?(T.quantity+=1,T.subtotal+=I.purchasePrice||I.price||0):z.set(C,{ticketId:I.ticketTypeId||I.ticketId||0,ticketName:I.ticketName||I.name||o().ticketFallbackName||"Ticket",quantity:1,unitPrice:I.purchasePrice||I.price||0,fee:0,subtotal:I.purchasePrice||I.price||0})}E=Array.from(z.values())}}catch(L){console.warn("Success: getOrder failed, using route params:",L)}E.length===0&&w>0&&(E=[{ticketId:0,ticketName:o().ticketFallbackName||"Ticket",quantity:w,unitPrice:0,fee:0,subtotal:0}]),t.set(n,{event:V,orderId:String(Z),lines:E,customerEmail:k},!0),I3(String(_)),Re("checkout-cartid"),t.set(h,!1)});var d=t.comment(),m=t.first_child(d);{var g=_=>{var u=t.comment(),A=t.first_child(u);t.component(A,()=>t.get(s),(y,b)=>{b(y,{get data(){return i()},get browseUrl(){return l()}})}),t.append(_,u)},p=_=>{var u=VV(),A=t.child(u),y=t.child(A,!0);t.reset(A),t.reset(u),t.template_effect(()=>t.set_text(y,t.get(v))),t.append(_,u)},H=_=>{var u=AV(),A=t.child(u),y=t.child(A,!0);t.reset(A),t.reset(u),t.template_effect(()=>t.set_text(y,o().loadingYourOrder||"Loading your order")),t.append(_,u)},f=_=>{MV(_,{get data(){return t.get(n)},get eventUrl(){return t.get(c)}})};t.if(m,_=>{t.get(r)&&t.get(s)?_(g):t.get(v)?_(p,1):t.get(h)||!t.get(n)?_(H,2):_(f,!1)})}t.append(a,d),t.pop()}const K0={blue:{200:"#bfdbfe",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8"},red:{500:"#ef4444",600:"#dc2626"},green:{500:"#22c55e",600:"#16a34a",emerald:"#10b981",emeraldDark:"#059669"},amber:{500:"#f59e0b"},orange:{500:"#f97316"},violet:{500:"#8b5cf6"},cyan:{400:"#22d3ee",500:"#06b6d4",600:"#0891b2"},teal:{400:"#2dd4bf",500:"#14b8a6"},sky:{400:"#45b7d1",light:"#4ecdc4"},mint:{500:"#98d8c8",600:"#96ceb4"},plum:"#dda0dd",yellow:{500:"#f7dc6f",300:"#ffeaa7"},coral:"#ff6b6b"},la={blue:"#4285f4",green:"#34a853",yellow:"#fbbc05",red:"#ea4335"};var zV=t.from_html('<div role="group"><!> <span class="qty-display svelte-12zmutv" aria-live="polite" aria-atomic="true" role="status"><span class="sr-only"> </span> </span> <!></div>'),bV=t.from_html('<span class="sales-start-badge text-xs text-secondary whitespace-nowrap svelte-12zmutv" role="status"> </span>'),yV=t.from_html('<span class="sr-only" role="alert"> </span>'),xV=t.from_html('<div class="donation-input-wrapper svelte-12zmutv"><!> <!></div>'),ZV=t.from_html('<span class="price-lg text-primary svelte-12zmutv"> </span> <span class="price-strikethrough"><span class="sr-only"> </span> </span> <span class="price-fee" aria-hidden="true"> </span> <span class="sr-only"> </span>',1),wV=t.from_html('<span class="price-lg text-primary svelte-12zmutv"> </span>'),LV=t.from_html('<span class="price-lg text-primary svelte-12zmutv"> </span> <span class="price-fee" aria-hidden="true"> </span> <span class="sr-only"> </span>',1),TV=t.from_html('<span class="badge badge-discount"> </span>'),CV=t.from_html('<span class="badge badge-unlocked"> </span>'),EV=t.from_html('<div class="flex-row-2 mb-2 flex-wrap" role="status" aria-live="polite"><!> <!></div>'),kV=t.from_html('<p class="text-sm text-secondary mb-3 svelte-12zmutv"> </p>'),SV=t.from_html("<span> </span>"),IV=t.from_html('<p class="sales-end-text text-xs svelte-12zmutv" role="status"> </p>'),DV=t.from_html('<article><div class="p-4 pb-0"><div class="flex-between-start gap-4"><div class="flex-1 min-w-0"><h3 class="font-medium text-primary svelte-12zmutv"> </h3></div> <!></div></div> <hr class="divider-line my-3 svelte-12zmutv" aria-hidden="true"/> <div class="p-4 pt-0"><div class="flex-row-2 mb-2"><!></div> <!> <!> <div class="flex-row-2 mb-2 flex-wrap" role="status"><!> <!></div> <!></div></article>');function PV(a,e){t.push(e,!0);let r=t.prop(e,"fee",3,"0.00"),s=t.prop(e,"quantity",3,0),i=t.prop(e,"soldOut",3,!1),l=t.prop(e,"status",3,null),o=t.prop(e,"salesBegin",3,null),n=t.prop(e,"salesEnd",3,null),c=t.prop(e,"remainingCapacity",3,null),v=t.prop(e,"totalCapacity",3,null);t.prop(e,"minQuantity",3,1);let h=t.prop(e,"maxQuantity",3,null),d=t.prop(e,"discountedPrice",3,null),m=t.prop(e,"isRevealed",3,!1),g=t.prop(e,"isDiscounted",3,!1),p=t.prop(e,"ticketType",3,0),H=t.prop(e,"donationAmount",3,""),f=t.prop(e,"labels",19,()=>({}));const _=t.derived(()=>p()===2),u=t.derived(()=>parseFloat(H())||0),A=t.derived(()=>t.get(_)&&H()!==""&&t.get(u)<1?f().minimumDonation||"Minimum $1.00":""),y=t.derived(()=>!t.get(_)||H()!==""&&t.get(u)>=1),b=t.derived(()=>parseFloat(e.price)||0),M=t.derived(()=>t.get(b)===0?0:parseFloat(r())||0),w=t.derived(()=>(t.get(b)+t.get(M)).toFixed(2)),V=t.derived(()=>t.get(M).toFixed(2)),Z=t.derived(()=>d()?parseFloat(d()):null),k=t.derived(()=>t.get(Z)===null||t.get(Z)===0?0:parseFloat(r())||0),E=t.derived(()=>t.get(Z)!==null?(t.get(Z)+t.get(k)).toFixed(2):null),L=t.derived(()=>v()??c()??0),x=10,z=15,I=30,C=5,T=20;function S(o1,m1){if(m1===0)return 0;const y1=I/m1*100,C1=C/m1*100;return Math.max(Math.min(o1,y1),C1)}t.derived(()=>{const o1=c()??0,m1=t.get(L);if(m1===0||l()==="scheduled"||l()==="sales_ended")return null;if(o1<=0)return{text:"Sold out",type:"sold-out"};if(t.get(b)===0)return null;const y1=o1/m1*100,C1=S(x,m1),R1=S(z,m1);return y1<=C1&&o1<=T?{text:`Only ${o1} left`,type:"scarcity",showFlame:!0}:y1<=R1?{text:"Few tickets left",type:"scarcity",showFlame:!0}:null});function P(o1){return o1?yr(o1,{year:void 0,timeZone:"UTC"}):""}function D(o1){const m1=new Date,y1=new Date(m1);return y1.setDate(y1.getDate()+1),o1.toDateString()===y1.toDateString()}function R(o1){const m1=new Date,C1=(o1.getTime()-m1.getTime())/(1e3*60*60*24);return C1>0&&C1<=7}function B(o1){if(!o1)return{text:"",preposition:""};const m1=new Date(o1),y1=new Date,C1=m1.getTime()-y1.getTime(),R1=Math.round(C1/(1e3*60)),N1=C1/(1e3*60*60),S1=f().locale||"en-US";if(R1>0&&R1<60){const q1=Math.max(1,R1);return{text:(q1===1?f().inNMinute||"in {n} minute":f().inNMinutes||"in {n} minutes").replace("{n}",String(q1)),preposition:""}}if(N1>0&&N1<24){const q1=Math.max(1,Math.round(N1));return{text:(q1===1?f().inNHour||"in {n} hour":f().inNHours||"in {n} hours").replace("{n}",String(q1)),preposition:""}}if(D(m1)){const q1=La(o1,{timeZone:"UTC"});return{text:(f().tomorrowAtTime||"tomorrow at {time}").replace("{time}",q1),preposition:""}}if(R(m1)){const q1=new Intl.DateTimeFormat(S1,{weekday:"long"}).format(m1),P1=La(o1,{timeZone:"UTC"});return{text:(f().onDayAtTime||"on {day} at {time}").replace("{day}",q1).replace("{time}",P1),preposition:""}}const O1=new Intl.DateTimeFormat(S1,{month:"short",day:"numeric"}).format(m1);return{text:(f().onDate||"on {date}").replace("{date}",O1),preposition:""}}function U(o1){const{text:m1}=B(o1);return m1}function G(o1){return B(o1)}const c1=t.derived(()=>(()=>{if(!l())return null;switch(l()){case"scheduled":return{showAsMessage:!0,message:(f().salesStart||"Sales start {salesStart}").replace("{salesStart}",U(o()))};case"on_sale":return null;case"sales_ended":return{badge:f().statusSalesEnded||"Sales ended",badgeClass:"badge-ended",label:"Ended",date:P(n())};default:return null}})());var W=DV();let d1;var p1=t.child(W),t1=t.child(p1),h1=t.child(t1),N=t.child(h1),O=t.child(N,!0);t.reset(N),t.reset(h1);var F=t.sibling(h1,2);{var r1=o1=>{var m1=zV();let y1;var C1=t.child(m1);{let P1=t.derived(()=>s()===0),k1=t.derived(()=>(f().decreaseQuantity||"Decrease quantity for {title}").replace("{title}",e.title));s2(C1,{iconbtn:!0,strokebtn:!0,onclick:()=>e.ondecrement?.(),get disabled(){return t.get(P1)},get"aria-label"(){return t.get(k1)},class:"qty-btn",children:(T1,$1)=>{M6(T1,{size:20,"aria-hidden":"true"})},$$slots:{default:!0}})}var R1=t.sibling(C1,2),N1=t.child(R1),S1=t.child(N1,!0);t.reset(N1);var O1=t.sibling(N1);t.reset(R1);var q1=t.sibling(R1,2);{let P1=t.derived(()=>h()!==null&&s()>=h()||c()!==null&&s()>=c()||!t.get(y)),k1=t.derived(()=>(f().increaseQuantity||"Increase quantity for {title}").replace("{title}",e.title));s2(q1,{iconbtn:!0,onclick:()=>e.onincrement?.(),get disabled(){return t.get(P1)},get"aria-label"(){return t.get(k1)},class:"qty-btn",children:(T1,$1)=>{f6(T1,{size:20,"aria-hidden":"true"})},$$slots:{default:!0}})}t.reset(m1),t.template_effect(P1=>{y1=t.set_class(m1,1,"flex items-center quantity-selector svelte-12zmutv",null,y1,{active:s()>0}),t.set_attribute(m1,"aria-label",P1),t.set_text(S1,f().quantity||"Quantity:"),t.set_text(O1,` ${s()??""}`)},[()=>(f().quantitySelector||"Quantity selector for {title}").replace("{title}",e.title)]),t.append(o1,m1)},l1=o1=>{var m1=bV(),y1=t.child(m1,!0);t.reset(m1),t.template_effect(()=>t.set_text(y1,t.get(c1).message)),t.append(o1,m1)};t.if(F,o1=>{!i()&&l()!=="scheduled"&&l()!=="sales_ended"?o1(r1):l()==="scheduled"&&t.get(c1)?.message&&o1(l1,1)})}t.reset(t1),t.reset(p1);var q=t.sibling(p1,4),J=t.child(q),A1=t.child(J);{var e1=o1=>{var m1=xV(),y1=t.child(m1);{let N1=t.derived(()=>f().donationAmountLabel||"Donation amount in dollars"),S1=t.derived(()=>i()||l()==="scheduled"||l()==="sales_ended"),O1=t.derived(()=>H()!==""),q1=t.derived(()=>t.get(A)?"donation-error-"+e.title?.replace(/\s+/g,"-").toLowerCase():void 0);R2(y1,{get label(){return t.get(N1)},size:"full",type:"text",inputmode:"decimal",placeholder:"0.00",get value(){return H()},oninput:P1=>e.ondonationchange?.(P1.target.value),get disabled(){return t.get(S1)},get displayErrorText(){return t.get(A)},get touched(){return t.get(O1)},get"aria-describedby"(){return t.get(q1)}})}var C1=t.sibling(y1,2);{var R1=N1=>{var S1=yV(),O1=t.child(S1,!0);t.reset(S1),t.template_effect(q1=>{t.set_attribute(S1,"id",`donation-error-${q1??""}`),t.set_text(O1,t.get(A))},[()=>e.title?.replace(/\s+/g,"-").toLowerCase()]),t.append(N1,S1)};t.if(C1,N1=>{t.get(A)&&N1(R1)})}t.reset(m1),t.append(o1,m1)},s1=o1=>{var m1=ZV(),y1=t.first_child(m1),C1=t.child(y1);t.reset(y1);var R1=t.sibling(y1,2),N1=t.child(R1),S1=t.child(N1,!0);t.reset(N1);var O1=t.sibling(N1);t.reset(R1);var q1=t.sibling(R1,2),P1=t.child(q1,!0);t.reset(q1);var k1=t.sibling(q1,2),T1=t.child(k1,!0);t.reset(k1),t.template_effect(($1,B1)=>{t.set_attribute(y1,"aria-label",`Discounted price $${t.get(E)??""}`),t.set_text(C1,`$${t.get(E)??""}`),t.set_attribute(R1,"aria-label",`Original price $${t.get(w)??""}`),t.set_text(S1,f().originalPrice||"Original price:"),t.set_text(O1,`$${t.get(w)??""}`),t.set_text(P1,$1),t.set_text(T1,B1)},[()=>(f().inclFee||"incl. ${fee} fee").replace("{fee}",t.get(V)),()=>(f().includingFee||"including ${fee} service fee").replace("{fee}",t.get(V))]),t.append(o1,m1)},Q=o1=>{var m1=wV(),y1=t.child(m1,!0);t.reset(m1),t.template_effect(()=>t.set_text(y1,f().free||"Free")),t.append(o1,m1)},j=o1=>{var m1=LV(),y1=t.first_child(m1),C1=t.child(y1);t.reset(y1);var R1=t.sibling(y1,2),N1=t.child(R1,!0);t.reset(R1);var S1=t.sibling(R1,2),O1=t.child(S1,!0);t.reset(S1),t.template_effect((q1,P1)=>{t.set_attribute(y1,"aria-label",`Price $${t.get(w)??""}`),t.set_text(C1,`$${t.get(w)??""}`),t.set_text(N1,q1),t.set_text(O1,P1)},[()=>(f().inclFee||"incl. ${fee} fee").replace("{fee}",t.get(V)),()=>(f().includingFee||"including ${fee} service fee").replace("{fee}",t.get(V))]),t.append(o1,m1)};t.if(A1,o1=>{t.get(_)?o1(e1):t.get(E)!==null?o1(s1,1):t.get(b)===0?o1(Q,2):o1(j,!1)})}t.reset(J);var V1=t.sibling(J,2);{var x1=o1=>{var m1=EV(),y1=t.child(m1);{var C1=S1=>{var O1=TV(),q1=t.child(O1,!0);t.reset(O1),t.template_effect(()=>t.set_text(q1,f().discountApplied||"Discount applied")),t.append(S1,O1)};t.if(y1,S1=>{g()&&S1(C1)})}var R1=t.sibling(y1,2);{var N1=S1=>{var O1=CV(),q1=t.child(O1,!0);t.reset(O1),t.template_effect(()=>t.set_text(q1,f().unlocked||"Unlocked")),t.append(S1,O1)};t.if(R1,S1=>{m()&&S1(N1)})}t.reset(m1),t.append(o1,m1)};t.if(V1,o1=>{(g()||m())&&o1(x1)})}var a1=t.sibling(V1,2);{var H1=o1=>{var m1=kV(),y1=t.child(m1,!0);t.reset(m1),t.template_effect(C1=>{t.set_attribute(m1,"id",`ticket-desc-${C1??""}`),t.set_text(y1,e.description)},[()=>e.title?.replace(/\s+/g,"-").toLowerCase()||"ticket"]),t.append(o1,m1)};t.if(a1,o1=>{e.description&&o1(H1)})}var g1=t.sibling(a1,2),i1=t.child(g1);{var K=o1=>{var m1=SV(),y1=t.child(m1,!0);t.reset(m1),t.template_effect(()=>{t.set_class(m1,1,`badge ${t.get(c1).badgeClass??""}`,"svelte-12zmutv"),t.set_attribute(m1,"aria-label",`${(f().statusLabel||"Status:")??""} ${t.get(c1).badge??""}`),t.set_text(y1,t.get(c1).badge)}),t.append(o1,m1)};t.if(i1,o1=>{t.get(c1)&&t.get(c1).badge&&o1(K)})}var w1=t.sibling(i1,2);{var M1=o1=>{{let m1=t.derived(()=>c()??0);ScarcityBadge(o1,{get remaining(){return t.get(m1)},get total(){return t.get(L)},context:"ticket",get labels(){return f()}})}};t.if(w1,o1=>{showScarcityBadge&&o1(M1)})}t.reset(g1);var X=t.sibling(g1,2);{var f1=o1=>{const m1=t.derived(()=>G(n()));var y1=IV(),C1=t.child(y1);t.reset(y1),t.template_effect(()=>t.set_text(C1,`${(f().salesEndPrefix||"Sales end")??""}
73
- ${t.get(m1).text??""}`)),t.append(o1,y1)};t.if(X,o1=>{n()&&l()!=="sales_ended"&&l()!=="scheduled"&&o1(f1)})}t.reset(q),t.reset(W),t.template_effect((o1,m1,y1)=>{d1=t.set_class(W,1,`ticket-block rounded-lg border transition-all ${s()>0?"shadow-sm":""}`,"svelte-12zmutv",d1,{selected:s()>0,"disabled-ticket":i()||l()==="scheduled"||l()==="sales_ended"}),t.set_attribute(W,"aria-label",`${o1??""}${(i()?f().ticketSoldOutSuffix||", sold out":"")??""}${(l()==="scheduled"?f().ticketSalesNotStartedSuffix||", sales not yet started":"")??""}${(l()==="sales_ended"?f().ticketSalesEndedSuffix||", sales ended":"")??""}`),t.set_attribute(N,"id",`ticket-title-${m1??""}`),t.set_text(O,e.title),t.set_attribute(J,"id",`ticket-price-${y1??""}`)},[()=>(f().ticketAriaLabel||"{title} ticket").replace("{title}",e.title),()=>e.title?.replace(/\s+/g,"-").toLowerCase()||"ticket",()=>e.title?.replace(/\s+/g,"-").toLowerCase()||"ticket"]),t.append(a,W),t.pop()}var RV=t.from_html('<div class="rounded-lg overflow-hidden animate-pulse bg-surface-primary border-default" role="status" aria-busy="true"><span class="sr-only svelte-1hpsukj">Loading ticket...</span> <div class="px-3 py-2.5 rounded-t-lg border-t border-l border-r border-border" aria-hidden="true"><div class="skeleton h-4 w-2/3 mb-2"></div> <div class="skeleton h-3 w-1/2"></div></div> <div class="flex items-center gap-2" aria-hidden="true"><div class="border w-6 rounded-full h-6 -ml-3 -mt-0.5 bg-card border-border"></div> <hr class="skeleton-divider w-full my-3 svelte-1hpsukj"/> <div class="border w-6 rounded-full h-6 -mr-3 -mt-0.5 bg-card border-border"></div></div> <div class="flex justify-between items-center px-3 py-2.5 rounded-b-lg -mt-0.5 border-b border-l border-r border-border" aria-hidden="true"><div class="space-y-1"><div class="h-4 rounded w-16 bg-bg-tertiary"></div> <div class="h-3 rounded w-20 bg-muted"></div></div> <div class="flex items-center gap-2"><div class="w-10 h-10 rounded-md bg-bg-tertiary"></div> <div class="w-10 h-10 rounded-md bg-muted"></div> <div class="w-10 h-10 rounded-md bg-bg-tertiary"></div></div></div></div>');function OV(a,e){t.push(e,!0);let r=t.prop(e,"labels",19,()=>({}));var s=RV();t.template_effect(()=>t.set_attribute(s,"aria-label",r().loadingTicketInfo||"Loading ticket information")),t.append(a,s),t.pop()}var NV=t.from_html('<div class="empty-state flex flex-col items-center justify-center py-12 px-6 text-center" role="status"><div class="empty-state-icon text-muted-foreground mb-4" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"></path><path d="M13 5v2"></path><path d="M13 17v2"></path><path d="M13 11v2"></path></svg></div> <h3 class="text-lg font-semibold text-text-primary mb-2"> </h3> <p class="text-sm text-text-secondary max-w-72"> </p></div>'),FV=t.from_html('<div class="section-header bg-bg-secondary px-5 py-3"><h2 class="text-text-primary text-md font-semibold"> </h2></div>'),BV=t.from_html('<div role="group"><!> <div role="list"><!></div></div>'),qV=t.from_html("<section></section>");function UV(a,e){t.push(e,!0);let r=t.prop(e,"venueFeesReady",3,!1),s=t.prop(e,"tickets",19,()=>[]),i=t.prop(e,"quantities",19,()=>({})),l=t.prop(e,"donationAmounts",19,()=>({})),o=t.prop(e,"revealHiddenTickets",3,!1),n=t.prop(e,"revealTicketIds",19,()=>[]),c=t.prop(e,"currentPromoRule",3,null),v=t.prop(e,"labels",19,()=>({}));function h(M){const w=new Date,V=M.salesBegin||M.salesStart||M.saleBegin||M.saleStart||M.onSaleStart,Z=M.salesEnd||M.saleEnd||M.onSaleEnd;return V&&new Date(V)>w?"scheduled":Z&&new Date(Z)<w?"sales_ended":"on_sale"}function d(M){return M.salesBegin||M.salesStart||M.saleBegin||M.saleStart||M.onSaleStart||null}const m=t.derived(()=>s().filter(M=>M.visibility===0||M.visibility===1||o()?!0:n()?.includes(M.ID)));function g(M){const w=[],V=[];for(const Z of M){const k=h(Z),E=Z.minQuantity??1,L=Z.remainingCapacity,x=Z.soldOut||L!=null&&E>L;k==="on_sale"&&!x?w.push(Z):V.push(Z)}return[...w,...V]}function p(M){const w={};for(const V of M){const Z=V.TicketSection?.name||v().other||"Other";w[Z]||(w[Z]=[]),w[Z].push(V)}for(const V of Object.keys(w))w[V]=g(w[V]);return w}const H=t.derived(()=>p(t.get(m))),f=t.derived(()=>v().other||"Other"),_=t.derived(()=>Object.keys(t.get(H)).filter(M=>M!==t.get(f)).length>0);var u=t.comment(),A=t.first_child(u);{var y=M=>{var w=NV(),V=t.sibling(t.child(w),2),Z=t.child(V,!0);t.reset(V);var k=t.sibling(V,2),E=t.child(k,!0);t.reset(k),t.reset(w),t.template_effect(()=>{t.set_attribute(w,"aria-label",v().noTicketsAvailable||"No tickets available"),t.set_text(Z,v().noTicketsAvailable||"No tickets available"),t.set_text(E,v().noTicketsAvailableDescription||"There are currently no tickets available for this event.")}),t.append(M,w)},b=M=>{var w=qV();t.each(w,21,()=>Object.entries(t.get(H)),t.index,(V,Z)=>{var k=t.derived(()=>t.to_array(t.get(Z),2));let E=()=>t.get(k)[0],L=()=>t.get(k)[1];var x=BV(),z=t.child(x);{var I=D=>{var R=FV(),B=t.child(R),U=t.child(B,!0);t.reset(B),t.reset(R),t.template_effect(G=>{t.set_attribute(B,"id",`section-${G??""}`),t.set_text(U,E())},[()=>E().replace(/\s+/g,"-").toLowerCase()]),t.append(D,R)};t.if(z,D=>{t.get(_)&&E()!==t.get(f)&&D(I)})}var C=t.sibling(z,2),T=t.child(C);{var S=D=>{var R=t.comment(),B=t.first_child(R);t.each(B,17,L,t.index,(U,G)=>{const c1=t.derived(()=>t.get(G).visibility>=2&&o()||n().includes(t.get(G).ID)),W=t.derived(()=>c()?.discountTicketIds||[]),d1=t.derived(()=>t.get(W).length===0||t.get(W).includes(t.get(G).ID)),p1=t.derived(()=>c()?.provideDiscount&&t.get(d1)&&(c()?.discountType==="%"||c()?.discountType==="$")),t1=t.derived(()=>(()=>{if(!t.get(p1))return null;const q=parseFloat(t.get(G).price)||0,J=parseFloat(c()?.amount||"0")||0;return c().discountType==="%"?(q*(1-J/100)).toFixed(2):c().discountType==="$"?Math.max(0,q-J).toFixed(2):null})()),h1=t.derived(()=>h(t.get(G))),N=t.derived(()=>d(t.get(G))),O=t.derived(()=>t.get(G).minQuantity??1),F=t.derived(()=>t.get(G).remainingCapacity),r1=t.derived(()=>t.get(G).soldOut||t.get(F)!==null&&t.get(F)!==void 0&&t.get(O)>t.get(F)),l1=t.derived(()=>t.get(G).type??0);t.derived(()=>t.get(l1)===2);{let q=t.derived(()=>i()[t.get(G).ID]??0),J=t.derived(()=>t.get(G).totalCapacity??t.get(G).quantity??t.get(G).remainingCapacity),A1=t.derived(()=>t.get(G).minQuantity??1),e1=t.derived(()=>t.get(G).maxQuantity??null),s1=t.derived(()=>l()[t.get(G).ID]??"");PV(U,{get labels(){return v()},get title(){return t.get(G).name},get description(){return t.get(G).description},get price(){return t.get(G).price},get discountedPrice(){return t.get(t1)},get quantity(){return t.get(q)},get soldOut(){return t.get(r1)},get status(){return t.get(h1)},get salesBegin(){return t.get(N)},get salesEnd(){return t.get(G).salesEnd},get remainingCapacity(){return t.get(G).remainingCapacity},get totalCapacity(){return t.get(J)},get minQuantity(){return t.get(A1)},get maxQuantity(){return t.get(e1)},get isRevealed(){return t.get(c1)},get isDiscounted(){return t.get(p1)},get ticketType(){return t.get(l1)},get donationAmount(){return t.get(s1)},onincrement:()=>e.handleQuantityChange(t.get(G).ID,1),ondecrement:()=>e.handleQuantityChange(t.get(G).ID,-1),ondonationchange:Q=>e.handleDonationChange?.(t.get(G).ID,Q)})}}),t.append(D,R)},P=D=>{var R=t.comment(),B=t.first_child(R);t.each(B,16,()=>Array(2),t.index,(U,G)=>{OV(U,{})}),t.append(D,R)};t.if(T,D=>{r()?D(S):D(P,!1)})}t.reset(C),t.reset(x),t.template_effect((D,R)=>{t.set_class(x,1,t.clsx(t.get(_)&&E()!==t.get(f)?"ticket-section-group border border-border rounded-lg overflow-hidden":"")),t.set_attribute(x,"aria-labelledby",D),t.set_class(C,1,`space-y-4 ${t.get(_)&&E()!==t.get(f)?"p-4":""}`),t.set_attribute(C,"aria-label",R)},[()=>t.get(_)&&E()!==t.get(f)?`section-${E().replace(/\s+/g,"-").toLowerCase()}`:void 0,()=>(v().ticketsInSection||"Tickets in {section}").replace("{section}",E())]),t.append(V,x)}),t.reset(w),t.template_effect(()=>t.set_attribute(w,"aria-label",v().availableTickets||"Available tickets")),t.append(M,w)};t.if(A,M=>{r()&&t.get(m).length===0?M(y):M(b,!1)})}t.append(a,u),t.pop()}var GV=t.from_html('<div class="flex justify-between items-center pb-4 border-b border-border" aria-hidden="true"><div><div class="h-4 rounded w-24 mb-2 bg-bg-tertiary"></div> <div class="h-3 rounded w-16 bg-bg-tertiary"></div></div> <div class="h-4 rounded w-12 bg-bg-tertiary"></div></div>'),jV=t.from_html('<div class="hidden md:block h-fit rounded-lg p-5 space-y-5 animate-pulse bg-card border border-border" role="status" aria-busy="true"><span class="sr-only svelte-19v1kvb">Loading order summary...</span> <div class="h-6 rounded w-2/3 bg-bg-tertiary" aria-hidden="true"></div> <!> <div class="space-y-3 pt-4" aria-hidden="true"><div class="flex justify-between"><div class="h-4 rounded w-20 bg-bg-tertiary"></div> <div class="h-4 rounded w-12 bg-bg-tertiary"></div></div> <div class="flex justify-between"><div class="h-4 rounded w-16 bg-bg-tertiary"></div> <div class="h-4 rounded w-12 bg-bg-tertiary"></div></div> <div class="flex justify-between"><div class="h-4 rounded w-12 bg-bg-tertiary"></div> <div class="h-4 rounded w-12 bg-bg-tertiary"></div></div></div> <div class="h-10 rounded mt-5 bg-muted" aria-hidden="true"></div></div>');function Q6(a,e){t.push(e,!0);let r=t.prop(e,"labels",19,()=>({}));var s=jV(),i=t.sibling(t.child(s),4);t.each(i,16,()=>Array(2),t.index,(l,o)=>{var n=GV();t.append(l,n)}),t.next(4),t.reset(s),t.template_effect(()=>t.set_attribute(s,"aria-label",r().loadingOrderSummary||"Loading order summary")),t.append(a,s),t.pop()}var YV=t.from_html('<div class="w-14 h-14 shrink-0 rounded-md overflow-hidden bg-bg-secondary" aria-hidden="true"><img alt="" class="w-full h-full object-contain"/></div>'),WV=t.from_html("<p> </p>"),XV=t.from_html('<div class="flex-row-2 shrink-0"><span class="price-md"> </span> <button type="button" class="btn-icon btn-icon-ghost w-7 h-7"><!></button></div>'),QV=t.from_html('<header class="flex items-center gap-3 px-4 md:px-5 py-4 border-b border-border"><button type="button" class="p-2 -ml-2 rounded-full transition-colors shrink-0 text-text-secondary hover:bg-bg-secondary"><!></button> <!> <div class="flex-1 min-w-0"><h1 class="heading-lg break-words"> </h1> <div class="body-sm text-text-secondary"><p><time> </time></p> <p> </p> <!></div></div> <!></header>');function KV(a,e){t.push(e,!0);let r=t.prop(e,"variant",3,"tickets"),s=t.prop(e,"total",3,0),i=t.prop(e,"onCancel",3,()=>{}),l=t.prop(e,"onInfoClick",3,()=>{}),o=t.prop(e,"labels",19,()=>({})),n=t.derived(()=>e.event.timeZone||"America/Los_Angeles"),c=t.derived(()=>e.event.displayEndTime===!0),v=t.derived(()=>e.event.displayDoorsTime===!0),h=t.derived(()=>r()==="checkout"),d=t.derived(()=>s()>0?`$${s().toFixed(2)}`:o().free||"Free");var m=QV(),g=t.child(m),p=t.child(g);O3(p,{size:20,"aria-hidden":"true"}),t.reset(g);var H=t.sibling(g,2);{var f=z=>{var I=YV(),C=t.child(I);t.reset(I),t.template_effect(()=>t.set_attribute(C,"src",e.event.image)),t.append(z,I)};t.if(H,z=>{e.event.image&&z(f)})}var _=t.sibling(H,2),u=t.child(_),A=t.child(u,!0);t.reset(u);var y=t.sibling(u,2),b=t.child(y),M=t.child(b),w=t.child(M,!0);t.reset(M),t.reset(b);var V=t.sibling(b,2),Z=t.child(V,!0);t.reset(V);var k=t.sibling(V,2);{var E=z=>{var I=WV(),C=t.child(I,!0);t.reset(I),t.template_effect(T=>t.set_text(C,T),[()=>(o().doorsOpen||"Doors open {time}").replace("{time}",Va(e.event.doorsOpenTime,t.get(n)))]),t.append(z,I)};t.if(k,z=>{t.get(v)&&e.event.doorsOpenTime&&z(E)})}t.reset(y),t.reset(_);var L=t.sibling(_,2);{var x=z=>{var I=XV(),C=t.child(I),T=t.child(C,!0);t.reset(C);var S=t.sibling(C,2),P=t.child(S);pf(P,{size:18,"aria-hidden":"true"}),t.reset(S),t.reset(I),t.template_effect(D=>{t.set_attribute(C,"aria-label",D),t.set_text(T,t.get(d)),t.set_attribute(S,"aria-label",o().viewOrderDetails||"View order details")},[()=>(o().ariaOrderTotal||"Order total: {total}").replace("{total}",t.get(d))]),t.delegated("click",S,function(...D){l()?.apply(this,D)}),t.append(z,I)};t.if(L,z=>{t.get(h)&&z(x)})}t.reset(m),t.template_effect((z,I)=>{t.set_attribute(g,"aria-label",t.get(h)?o().goBackToTicketSelection||"Go back to ticket selection":o().goBackToEventDetails||"Go back to event details"),t.set_text(A,e.event.name),t.set_attribute(y,"aria-label",o().ariaEventDateTime||"Event date and time"),t.set_attribute(M,"datetime",e.event.startDateTime),t.set_text(w,z),t.set_text(Z,I)},[()=>p0(e.event.startDateTime,t.get(n)),()=>t.get(c)&&e.event.endDateTime?Ma(e.event.startDateTime,e.event.endDateTime,t.get(n)):w2(e.event.startDateTime,t.get(n))]),t.delegated("click",g,function(...z){i()?.apply(this,z)}),t.append(a,m),t.pop()}t.delegate(["click"]);var JV=t.from_html('<div class="flex items-center justify-center py-12" role="status" aria-live="polite"><p class="text-text-secondary"> </p></div>'),$V=t.from_html('<div class="text-center py-8" role="alert"><p class="text-accent-danger mb-2"> </p> <button class="go-back-btn text-white mt-4 px-4 py-2 rounded-lg svelte-19g9ni4"> </button></div>'),tA=t.from_html('<div class="text-center py-12" role="alert"><p class="text-xl font-semibold text-text-primary mb-2"> </p> <p class="text-text-secondary mb-6"> </p> <button class="go-back-btn text-white px-4 py-2 rounded-lg svelte-19g9ni4"> </button></div>'),eA=t.from_html('<div class="text-center py-12" role="alert"><p class="text-xl font-semibold text-text-primary mb-2">This event has ended</p> <p class="text-text-secondary mb-6">Tickets are no longer available for this event.</p> <button class="go-back-btn px-4 py-2 rounded-lg svelte-19g9ni4" aria-label="Go back to event details">Go back</button></div>'),aA=t.from_html('<div class="hidden md:block w-80 h-[calc(100vh-40px)]"></div>'),rA=t.from_html('<div class="w-full flex md:gap-5 flex-wrap"><div class="flex-1 pb-16 md:pb-0"><div class="bg-card border-border rounded-lg md:shadow md:border py-3"><!> <div class="space-y-4 md:px-5"><!></div></div></div> <!> <div><!></div></div>'),sA=t.from_html('<h3 id="error-modal-title" class="heading-lg"><!></h3>'),iA=t.from_html('<p class="body-sm"> </p> <p class="text-text-secondary mt-2"> </p>',1),lA=t.from_html('<p class="body-sm"> </p> <p class="text-text-secondary mt-2"> </p>',1),oA=t.from_html('<div id="error-modal-description"><!></div>'),nA=t.from_html("<!> <!>",1),cA=t.from_html('<div role="group" aria-label="Error modal actions"><!></div>'),vA=t.from_html('<h3 id="availability-modal-title" class="heading-lg"> </h3>'),dA=t.from_html('<li class="text-text-secondary text-sm"><span class="font-medium"> </span> <!></li>'),hA=t.from_html('<p class="text-text-secondary mt-4"> </p>'),gA=t.from_html('<p class="text-text-secondary mt-4"> </p>'),mA=t.from_html('<div id="availability-modal-description"><p class="text-text-secondary mb-4"> </p> <ul class="space-y-2"></ul> <!></div>'),pA=t.from_html('<div role="group" aria-label="Availability modal actions"><!> <!></div>'),fA=t.from_html('<div class="px-5 md:px-10 py-12 bg-card"><!></div> <!> <!>',1);function oa(a,e){t.push(e,!0);let r=t.prop(e,"organizationId",3,""),s=t.prop(e,"venueId",3,""),i=t.prop(e,"labels",19,()=>({})),l=t.state(!1),o=t.state(null),n=t.state(null),c=t.state(t.proxy([])),v=t.state(!1),h=t.state(!0),d=t.state(null),m=t.state(!1),g=t.state(!1),p=t.state(!1),H=t.state(0),f=t.state(void 0),_=t.state(void 0),u=t.state(t.proxy({})),A=t.state(""),y=t.state(""),b=t.state(0),M=t.state(!1),w=t.state("cart_failed"),V=t.state(!1),Z=t.state(!1),k=t.state(t.proxy([])),E=t.state(0),L=t.state(0),x=t.derived(()=>t.get(A1)?0:r0(Object.entries(t.get(u)).reduce((X,[f1,o1])=>{const m1=t.get(o)?.availableTickets?.find(y1=>y1.ID==f1);return m1?X+r0(o1*m1.price):X},0))),z=t.state(0),I=0,C=t.state(0),T=t.state(!1),S=t.state(null),P=t.derived(()=>r0(t.get(x)+t.get(z)+I));function D(X,f1){t.set(u,{...t.get(u),[X]:Math.max(0,(t.get(u)[X]??0)+f1)},!0),t.get(o)&&D3({eventID:t.get(o).eventID,quantities:t.get(u),promocode:t.get(A),tickets:t.get(o).availableTickets})}function R(){if(!t.get(o)?.availableTickets)return;const f1=t.get(o).availableTickets.filter(o1=>o1.visibility===0).map(o1=>parseFloat(o1.price)||0);if(f1.length===0){t.set(E,t.set(L,0),!0);return}t.set(E,Math.min(...f1).toFixed(2),!0),t.set(L,Math.max(...f1).toFixed(2),!0)}async function B(){const X=[];for(const[f1,o1]of Object.entries(t.get(u))){if(o1<=0)continue;const m1=t.get(o)?.availableTickets?.find(y1=>y1.ID==f1);!m1||m1.price===0||X.push({amountCents:Math.round(m1.price*100)*o1,reference:`ticket-${f1}`,quantity:o1})}if(X.length===0){t.set(C,0),t.set(T,!1);return}t.get(S)&&t.get(S).abort(),t.set(S,new AbortController,!0),t.set(T,!0);try{const f1=await fetch("https://get-micdrop.com/api/v2/public/tax-preview",{method:"POST",headers:{"Content-Type":"application/json"},signal:t.get(S).signal,body:JSON.stringify({venueId:Number(t.get(o).venueID),lineItems:X})});if(!f1.ok){console.error("Tax preview failed:",f1.status),t.set(C,0),t.set(T,!1);return}const o1=await f1.json();t.set(C,(o1.taxTotal??0)/100)}catch(f1){if(f1.name==="AbortError")return;console.error("Tax preview error:",f1),t.set(C,0)}finally{t.get(S)?.signal?.aborted||t.set(T,!1)}}function U(){if(!t.get(o))return;t.set(A,S0(`checkout-promocode-${t.get(o).eventID}`)||"",!0);const X=parseFloat(S0("checkout-promo-discount")||0);t.set(y,t.get(A)?`${t.get(A)} applied.`:"",!0),t.set(b,X,!0)}async function G(){try{const X=await Z6(e.eventId),f1=[];for(const[o1,m1]of Object.entries(t.get(u))){if(m1<=0)continue;const y1=X.find(R1=>String(R1.ID)===String(o1));if(!y1)continue;const C1=y1.remainingCapacity??y1.quantity??1/0;if(C1<m1){const R1=t.get(o)?.availableTickets?.find(N1=>String(N1.ID)===String(o1));f1.push({ticketId:o1,ticketName:R1?.name||y1?.name||"Ticket",requestedQty:m1,availableQty:Math.max(0,C1)})}}return f1}catch(X){return console.error("Error checking ticket availability:",X),[]}}async function c1(){if(!t.get(o))return;t.set(v,!0),t.set(V,!1);const X=await G();if(X.length>0){t.set(v,!1),t.set(k,X,!0),t.set(Z,!0);return}await W()}async function W(){t.set(v,!0),D3({eventID:t.get(o).eventID,quantities:t.get(u),promocode:t.get(A),promoDiscountAmount:t.get(b),tickets:t.get(o).availableTickets});try{const X=await zp({eventID:t.get(o).eventID,quantities:t.get(u),promoCode:t.get(A)||void 0});if(!X||!X.success){t.set(v,!1),t.set(w,"cart_failed"),t.set(M,!0);return}t.set(z,X.serviceFee??0,!0),t.set(V,!0)}catch(X){console.error("Order initiation failed:",X),t.set(v,!1),t.set(w,"cart_failed"),t.set(M,!0);return}try{if(e.onNavigateToCheckout){e.onNavigateToCheckout(e.eventId,t.get(o)),t.set(v,!1);return}const X=new URLSearchParams;r()&&X.set("orgId",r()),s()&&X.set("venueId",s()),X.set("event_id",e.eventId),X.set("subroute","checkout");const f1=`/?${X.toString()}`;pt(f1,{noScroll:!1}),t.set(v,!1)}catch(X){console.error("Navigation failed after cart creation:",X),t.set(v,!1),t.set(w,"cart_success_network_error"),t.set(M,!0)}}function d1(){for(const f1 of t.get(k))f1.availableQty>0?t.get(u)[f1.ticketId]=f1.availableQty:delete t.get(u)[f1.ticketId];t.set(u,{...t.get(u)},!0),t.set(Z,!1),t.set(k,[],!0),Object.values(t.get(u)).reduce((f1,o1)=>f1+o1,0)>0?W():l1()}function p1(){t.set(Z,!1),t.set(k,[],!0),l1()}function t1(){t.set(M,!1),t.get(w)==="cart_failed"&&l1()}function h1(){t.set(M,!1),window.location.reload()}function N(){t.set(g,window.innerWidth<767)}let O=!1;function F(){O||(window.requestAnimationFrame(()=>{r1(),O=!1}),O=!0)}function r1(){if(t.get(g)||!t.get(_)||!t.get(f)){t.set(p,!1);return}const X=t.get(_).getBoundingClientRect();if(t.set(p,X.top<=20),t.get(p)){const f1=t.get(f).getBoundingClientRect();t.set(H,f1.left+f1.width-340-40)}}function l1(){if(t.get(o)&&I3(t.get(o).eventID),e.onNavigateBack)e.onNavigateBack();else{const X=new URLSearchParams(window.location.search);X.set("subroute","details");const f1=`/?${X.toString()}`;pt(f1,{})}}let q=t.derived(()=>t.get(o)?S0(`checkout-promo-reveal-${t.get(o).eventID}`)==="1":!1),J=t.derived(()=>{if(!t.get(o))return[];try{const X=S0(`checkout-promo-reveal-ids-${t.get(o).eventID}`);return X?JSON.parse(X):[]}catch{return[]}}),A1=t.derived(()=>t.get(o)?.availableTickets?.filter(X=>X.visibility===0)?.every(X=>X.price===0)),e1=t.derived(()=>{if(!t.get(o))return!1;const X=t.get(o).endDateTime||t.get(o).startDateTime;return X?new Date(X)<new Date:!1});function s1(X){if(X){const f1=new Date,o1=new Date(f1);return o1.setDate(f1.getDate()+7),{id:String(X),ID:String(X),eventID:String(X),title:"Test Comedy Show",name:"Test Comedy Show",description:"This is a test event for development and testing purposes.",coverImage:"https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=1200&h=800&fit=crop",startDateTime:o1.toISOString(),endDateTime:new Date(o1.getTime()+72e5).toISOString(),venueID:"test-venue-1",eventTicketingType:0,ticketType:0,availableTickets:[{ID:"ticket-1",name:"General Admission",price:25,remainingCapacity:50,visibility:0},{ID:"ticket-2",name:"VIP",price:50,remainingCapacity:10,visibility:0}]}}return null}async function Q(){if(t.get(m)){if(!e.eventId){t.set(d,i().noEventIdProvided||"No event ID provided",!0),t.set(h,!1);return}t.set(h,!0),t.set(d,null);try{try{if(t.set(n,await x6(e.eventId),!0),!t.get(m))return;t.set(o,Pt(t.get(n)),!0)}catch{if(!t.get(m))return;t.set(n,s1(e.eventId),!0),t.set(o,Pt(t.get(n)),!0),t.set(c,t.get(o).availableTickets||[],!0)}try{if(t.set(c,await Z6(e.eventId),!0),!t.get(m))return;t.get(c).length>0&&(t.get(o).availableTickets=t.get(c))}catch(f1){if(!t.get(m))return;console.error("Error fetching tickets:",f1),t.set(c,t.get(o).availableTickets||[],!0)}t.get(o).availableTickets&&t.get(o).availableTickets.forEach(f1=>t.get(u)[f1.ID]=0);const X=S3(t.get(o).eventID);if(t.set(u,X.quantities||{},!0),t.set(A,X.promocode||"",!0),t.set(b,X.promoDiscountAmount||0,!0),t.get(o).eventID&&(await xp(t.get(o).eventID),!t.get(m)))return;t.set(l,!0),R(),U(),await Vp({eventID:t.get(o).eventID})}catch(X){t.get(m)&&(console.error("Error loading event:",X),t.set(d,X.message||i().failedToLoadEvent||"Failed to load event",!0))}finally{t.get(m)&&t.set(h,!1)}}}j1.onMount(async()=>(t.set(m,!0),N(),window.addEventListener("resize",N),window.addEventListener("scroll",F),await Q(),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",F)})),j1.onDestroy(()=>{t.set(m,!1),t.get(S)&&t.get(S).abort()}),t.user_effect(()=>{t.get(m)&&e.eventId&&Q()}),t.user_effect(()=>{const X=Object.values(t.get(u)).reduce((f1,o1)=>f1+o1,0);t.get(l)&&t.get(o)&&X>0?B():X===0&&(t.set(C,0),t.set(T,!1))});var j=fA(),V1=t.first_child(j),x1=t.child(V1);{var a1=X=>{var f1=JV(),o1=t.child(f1),m1=t.child(o1,!0);t.reset(o1),t.reset(f1),t.template_effect(()=>t.set_text(m1,i().loadingEvent||"Loading event...")),t.append(X,f1)},H1=X=>{var f1=$V(),o1=t.child(f1),m1=t.child(o1);t.reset(o1);var y1=t.sibling(o1,2),C1=t.child(y1,!0);t.reset(y1),t.reset(f1),t.template_effect(()=>{t.set_text(m1,`${(i().errorPrefix||"Error:")??""}
73
+ ${t.get(m1).text??""}`)),t.append(o1,y1)};t.if(X,o1=>{n()&&l()!=="sales_ended"&&l()!=="scheduled"&&o1(f1)})}t.reset(q),t.reset(W),t.template_effect((o1,m1,y1)=>{d1=t.set_class(W,1,`ticket-block rounded-lg border transition-all ${s()>0?"shadow-sm":""}`,"svelte-12zmutv",d1,{selected:s()>0,"disabled-ticket":i()||l()==="scheduled"||l()==="sales_ended"}),t.set_attribute(W,"aria-label",`${o1??""}${(i()?f().ticketSoldOutSuffix||", sold out":"")??""}${(l()==="scheduled"?f().ticketSalesNotStartedSuffix||", sales not yet started":"")??""}${(l()==="sales_ended"?f().ticketSalesEndedSuffix||", sales ended":"")??""}`),t.set_attribute(N,"id",`ticket-title-${m1??""}`),t.set_text(O,e.title),t.set_attribute(J,"id",`ticket-price-${y1??""}`)},[()=>(f().ticketAriaLabel||"{title} ticket").replace("{title}",e.title),()=>e.title?.replace(/\s+/g,"-").toLowerCase()||"ticket",()=>e.title?.replace(/\s+/g,"-").toLowerCase()||"ticket"]),t.append(a,W),t.pop()}var RV=t.from_html('<div class="rounded-lg overflow-hidden animate-pulse bg-surface-primary border-default" role="status" aria-busy="true"><span class="sr-only svelte-1hpsukj">Loading ticket...</span> <div class="px-3 py-2.5 rounded-t-lg border-t border-l border-r border-border" aria-hidden="true"><div class="skeleton h-4 w-2/3 mb-2"></div> <div class="skeleton h-3 w-1/2"></div></div> <div class="flex items-center gap-2" aria-hidden="true"><div class="border w-6 rounded-full h-6 -ml-3 -mt-0.5 bg-card border-border"></div> <hr class="skeleton-divider w-full my-3 svelte-1hpsukj"/> <div class="border w-6 rounded-full h-6 -mr-3 -mt-0.5 bg-card border-border"></div></div> <div class="flex justify-between items-center px-3 py-2.5 rounded-b-lg -mt-0.5 border-b border-l border-r border-border" aria-hidden="true"><div class="space-y-1"><div class="h-4 rounded w-16 bg-bg-tertiary"></div> <div class="h-3 rounded w-20 bg-muted"></div></div> <div class="flex items-center gap-2"><div class="w-10 h-10 rounded-md bg-bg-tertiary"></div> <div class="w-10 h-10 rounded-md bg-muted"></div> <div class="w-10 h-10 rounded-md bg-bg-tertiary"></div></div></div></div>');function OV(a,e){t.push(e,!0);let r=t.prop(e,"labels",19,()=>({}));var s=RV();t.template_effect(()=>t.set_attribute(s,"aria-label",r().loadingTicketInfo||"Loading ticket information")),t.append(a,s),t.pop()}var NV=t.from_html('<div class="empty-state flex flex-col items-center justify-center py-12 px-6 text-center" role="status"><div class="empty-state-icon text-muted-foreground mb-4" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"></path><path d="M13 5v2"></path><path d="M13 17v2"></path><path d="M13 11v2"></path></svg></div> <h3 class="text-lg font-semibold text-text-primary mb-2"> </h3> <p class="text-sm text-text-secondary max-w-72"> </p></div>'),FV=t.from_html('<div class="section-header bg-bg-secondary px-5 py-3"><h2 class="text-text-primary text-md font-semibold"> </h2></div>'),BV=t.from_html('<div role="group"><!> <div role="list"><!></div></div>'),qV=t.from_html("<section></section>");function UV(a,e){t.push(e,!0);let r=t.prop(e,"venueFeesReady",3,!1),s=t.prop(e,"tickets",19,()=>[]),i=t.prop(e,"quantities",19,()=>({})),l=t.prop(e,"donationAmounts",19,()=>({})),o=t.prop(e,"revealHiddenTickets",3,!1),n=t.prop(e,"revealTicketIds",19,()=>[]),c=t.prop(e,"currentPromoRule",3,null),v=t.prop(e,"labels",19,()=>({}));function h(M){const w=new Date,V=M.salesBegin||M.salesStart||M.saleBegin||M.saleStart||M.onSaleStart,Z=M.salesEnd||M.saleEnd||M.onSaleEnd;return V&&new Date(V)>w?"scheduled":Z&&new Date(Z)<w?"sales_ended":"on_sale"}function d(M){return M.salesBegin||M.salesStart||M.saleBegin||M.saleStart||M.onSaleStart||null}const m=t.derived(()=>s().filter(M=>M.visibility===0||M.visibility===1||o()?!0:n()?.includes(M.ID)));function g(M){const w=[],V=[];for(const Z of M){const k=h(Z),E=Z.minQuantity??1,L=Z.remainingCapacity,x=Z.soldOut||L!=null&&E>L;k==="on_sale"&&!x?w.push(Z):V.push(Z)}return[...w,...V]}function p(M){const w={};for(const V of M){const Z=V.TicketSection?.name||v().other||"Other";w[Z]||(w[Z]=[]),w[Z].push(V)}for(const V of Object.keys(w))w[V]=g(w[V]);return w}const H=t.derived(()=>p(t.get(m))),f=t.derived(()=>v().other||"Other"),_=t.derived(()=>Object.keys(t.get(H)).filter(M=>M!==t.get(f)).length>0);var u=t.comment(),A=t.first_child(u);{var y=M=>{var w=NV(),V=t.sibling(t.child(w),2),Z=t.child(V,!0);t.reset(V);var k=t.sibling(V,2),E=t.child(k,!0);t.reset(k),t.reset(w),t.template_effect(()=>{t.set_attribute(w,"aria-label",v().noTicketsAvailable||"No tickets available"),t.set_text(Z,v().noTicketsAvailable||"No tickets available"),t.set_text(E,v().noTicketsAvailableDescription||"There are currently no tickets available for this event.")}),t.append(M,w)},b=M=>{var w=qV();t.each(w,21,()=>Object.entries(t.get(H)),t.index,(V,Z)=>{var k=t.derived(()=>t.to_array(t.get(Z),2));let E=()=>t.get(k)[0],L=()=>t.get(k)[1];var x=BV(),z=t.child(x);{var I=D=>{var R=FV(),B=t.child(R),U=t.child(B,!0);t.reset(B),t.reset(R),t.template_effect(G=>{t.set_attribute(B,"id",`section-${G??""}`),t.set_text(U,E())},[()=>E().replace(/\s+/g,"-").toLowerCase()]),t.append(D,R)};t.if(z,D=>{t.get(_)&&E()!==t.get(f)&&D(I)})}var C=t.sibling(z,2),T=t.child(C);{var S=D=>{var R=t.comment(),B=t.first_child(R);t.each(B,17,L,t.index,(U,G)=>{const c1=t.derived(()=>t.get(G).visibility>=2&&o()||n().includes(t.get(G).ID)),W=t.derived(()=>c()?.discountTicketIds||[]),d1=t.derived(()=>t.get(W).length===0||t.get(W).includes(t.get(G).ID)),p1=t.derived(()=>c()?.provideDiscount&&t.get(d1)&&(c()?.discountType==="%"||c()?.discountType==="$")),t1=t.derived(()=>(()=>{if(!t.get(p1))return null;const q=parseFloat(t.get(G).price)||0,J=parseFloat(c()?.amount||"0")||0;return c().discountType==="%"?(q*(1-J/100)).toFixed(2):c().discountType==="$"?Math.max(0,q-J).toFixed(2):null})()),h1=t.derived(()=>h(t.get(G))),N=t.derived(()=>d(t.get(G))),O=t.derived(()=>t.get(G).minQuantity??1),F=t.derived(()=>t.get(G).remainingCapacity),r1=t.derived(()=>t.get(G).soldOut||t.get(F)!==null&&t.get(F)!==void 0&&t.get(O)>t.get(F)),l1=t.derived(()=>t.get(G).type??0);t.derived(()=>t.get(l1)===2);{let q=t.derived(()=>i()[t.get(G).ID]??0),J=t.derived(()=>t.get(G).totalCapacity??t.get(G).quantity??t.get(G).remainingCapacity),A1=t.derived(()=>t.get(G).minQuantity??1),e1=t.derived(()=>t.get(G).maxQuantity??null),s1=t.derived(()=>l()[t.get(G).ID]??"");PV(U,{get labels(){return v()},get title(){return t.get(G).name},get description(){return t.get(G).description},get price(){return t.get(G).price},get discountedPrice(){return t.get(t1)},get quantity(){return t.get(q)},get soldOut(){return t.get(r1)},get status(){return t.get(h1)},get salesBegin(){return t.get(N)},get salesEnd(){return t.get(G).salesEnd},get remainingCapacity(){return t.get(G).remainingCapacity},get totalCapacity(){return t.get(J)},get minQuantity(){return t.get(A1)},get maxQuantity(){return t.get(e1)},get isRevealed(){return t.get(c1)},get isDiscounted(){return t.get(p1)},get ticketType(){return t.get(l1)},get donationAmount(){return t.get(s1)},onincrement:()=>e.handleQuantityChange(t.get(G).ID,1),ondecrement:()=>e.handleQuantityChange(t.get(G).ID,-1),ondonationchange:Q=>e.handleDonationChange?.(t.get(G).ID,Q)})}}),t.append(D,R)},P=D=>{var R=t.comment(),B=t.first_child(R);t.each(B,16,()=>Array(2),t.index,(U,G)=>{OV(U,{})}),t.append(D,R)};t.if(T,D=>{r()?D(S):D(P,!1)})}t.reset(C),t.reset(x),t.template_effect((D,R)=>{t.set_class(x,1,t.clsx(t.get(_)&&E()!==t.get(f)?"ticket-section-group border border-border rounded-lg overflow-hidden":"")),t.set_attribute(x,"aria-labelledby",D),t.set_class(C,1,`space-y-4 ${t.get(_)&&E()!==t.get(f)?"p-4":""}`),t.set_attribute(C,"aria-label",R)},[()=>t.get(_)&&E()!==t.get(f)?`section-${E().replace(/\s+/g,"-").toLowerCase()}`:void 0,()=>(v().ticketsInSection||"Tickets in {section}").replace("{section}",E())]),t.append(V,x)}),t.reset(w),t.template_effect(()=>t.set_attribute(w,"aria-label",v().availableTickets||"Available tickets")),t.append(M,w)};t.if(A,M=>{r()&&t.get(m).length===0?M(y):M(b,!1)})}t.append(a,u),t.pop()}var GV=t.from_html('<div class="flex justify-between items-center pb-4 border-b border-border" aria-hidden="true"><div><div class="h-4 rounded w-24 mb-2 bg-bg-tertiary"></div> <div class="h-3 rounded w-16 bg-bg-tertiary"></div></div> <div class="h-4 rounded w-12 bg-bg-tertiary"></div></div>'),jV=t.from_html('<div class="hidden md:block h-fit rounded-lg p-5 space-y-5 animate-pulse bg-card border border-border" role="status" aria-busy="true"><span class="sr-only svelte-19v1kvb">Loading order summary...</span> <div class="h-6 rounded w-2/3 bg-bg-tertiary" aria-hidden="true"></div> <!> <div class="space-y-3 pt-4" aria-hidden="true"><div class="flex justify-between"><div class="h-4 rounded w-20 bg-bg-tertiary"></div> <div class="h-4 rounded w-12 bg-bg-tertiary"></div></div> <div class="flex justify-between"><div class="h-4 rounded w-16 bg-bg-tertiary"></div> <div class="h-4 rounded w-12 bg-bg-tertiary"></div></div> <div class="flex justify-between"><div class="h-4 rounded w-12 bg-bg-tertiary"></div> <div class="h-4 rounded w-12 bg-bg-tertiary"></div></div></div> <div class="h-10 rounded mt-5 bg-muted" aria-hidden="true"></div></div>');function Q6(a,e){t.push(e,!0);let r=t.prop(e,"labels",19,()=>({}));var s=jV(),i=t.sibling(t.child(s),4);t.each(i,16,()=>Array(2),t.index,(l,o)=>{var n=GV();t.append(l,n)}),t.next(4),t.reset(s),t.template_effect(()=>t.set_attribute(s,"aria-label",r().loadingOrderSummary||"Loading order summary")),t.append(a,s),t.pop()}var YV=t.from_html('<div class="w-14 h-14 shrink-0 rounded-md overflow-hidden bg-bg-secondary" aria-hidden="true"><img alt="" class="w-full h-full object-contain"/></div>'),WV=t.from_html("<p> </p>"),XV=t.from_html('<div class="flex-row-2 shrink-0"><span class="price-md"> </span> <button type="button" class="btn-icon btn-icon-ghost w-7 h-7"><!></button></div>'),QV=t.from_html('<header class="flex items-center gap-3 px-4 md:px-5 py-4 border-b border-border"><button type="button" class="p-2 -ml-2 rounded-full transition-colors shrink-0 text-text-secondary hover:bg-bg-secondary"><!></button> <!> <div class="flex-1 min-w-0"><h1 class="heading-lg break-words"> </h1> <div class="body-sm text-text-secondary"><p><time> </time></p> <p> </p> <!></div></div> <!></header>');function KV(a,e){t.push(e,!0);let r=t.prop(e,"variant",3,"tickets"),s=t.prop(e,"total",3,0),i=t.prop(e,"onCancel",3,()=>{}),l=t.prop(e,"onInfoClick",3,()=>{}),o=t.prop(e,"labels",19,()=>({})),n=t.derived(()=>e.event.timeZone||"America/Los_Angeles"),c=t.derived(()=>e.event.displayEndTime===!0),v=t.derived(()=>e.event.displayDoorsTime===!0),h=t.derived(()=>r()==="checkout"),d=t.derived(()=>s()>0?`$${s().toFixed(2)}`:o().free||"Free");var m=QV(),g=t.child(m),p=t.child(g);O3(p,{size:20,"aria-hidden":"true"}),t.reset(g);var H=t.sibling(g,2);{var f=z=>{var I=YV(),C=t.child(I);t.reset(I),t.template_effect(()=>t.set_attribute(C,"src",e.event.image)),t.append(z,I)};t.if(H,z=>{e.event.image&&z(f)})}var _=t.sibling(H,2),u=t.child(_),A=t.child(u,!0);t.reset(u);var y=t.sibling(u,2),b=t.child(y),M=t.child(b),w=t.child(M,!0);t.reset(M),t.reset(b);var V=t.sibling(b,2),Z=t.child(V,!0);t.reset(V);var k=t.sibling(V,2);{var E=z=>{var I=WV(),C=t.child(I,!0);t.reset(I),t.template_effect(T=>t.set_text(C,T),[()=>(o().doorsOpen||"Doors open {time}").replace("{time}",Va(e.event.doorsOpenTime,t.get(n)))]),t.append(z,I)};t.if(k,z=>{t.get(v)&&e.event.doorsOpenTime&&z(E)})}t.reset(y),t.reset(_);var L=t.sibling(_,2);{var x=z=>{var I=XV(),C=t.child(I),T=t.child(C,!0);t.reset(C);var S=t.sibling(C,2),P=t.child(S);pf(P,{size:18,"aria-hidden":"true"}),t.reset(S),t.reset(I),t.template_effect(D=>{t.set_attribute(C,"aria-label",D),t.set_text(T,t.get(d)),t.set_attribute(S,"aria-label",o().viewOrderDetails||"View order details")},[()=>(o().ariaOrderTotal||"Order total: {total}").replace("{total}",t.get(d))]),t.delegated("click",S,function(...D){l()?.apply(this,D)}),t.append(z,I)};t.if(L,z=>{t.get(h)&&z(x)})}t.reset(m),t.template_effect((z,I)=>{t.set_attribute(g,"aria-label",t.get(h)?o().goBackToTicketSelection||"Go back to ticket selection":o().goBackToEventDetails||"Go back to event details"),t.set_text(A,e.event.name),t.set_attribute(y,"aria-label",o().ariaEventDateTime||"Event date and time"),t.set_attribute(M,"datetime",e.event.startDateTime),t.set_text(w,z),t.set_text(Z,I)},[()=>p0(e.event.startDateTime,t.get(n)),()=>t.get(c)&&e.event.endDateTime?Ma(e.event.startDateTime,e.event.endDateTime,t.get(n)):w2(e.event.startDateTime,t.get(n))]),t.delegated("click",g,function(...z){i()?.apply(this,z)}),t.append(a,m),t.pop()}t.delegate(["click"]);var JV=t.from_html('<div class="flex items-center justify-center py-12" role="status" aria-live="polite"><p class="text-text-secondary"> </p></div>'),$V=t.from_html('<div class="text-center py-8" role="alert"><p class="text-accent-danger mb-2"> </p> <button class="go-back-btn text-white mt-4 px-4 py-2 rounded-lg svelte-19g9ni4"> </button></div>'),tA=t.from_html('<div class="text-center py-12" role="alert"><p class="text-xl font-semibold text-text-primary mb-2"> </p> <p class="text-text-secondary mb-6"> </p> <button class="go-back-btn text-white px-4 py-2 rounded-lg svelte-19g9ni4"> </button></div>'),eA=t.from_html('<div class="text-center py-12" role="alert"><p class="text-xl font-semibold text-text-primary mb-2">This event has ended</p> <p class="text-text-secondary mb-6">Tickets are no longer available for this event.</p> <button class="go-back-btn px-4 py-2 rounded-lg svelte-19g9ni4" aria-label="Go back to event details">Go back</button></div>'),aA=t.from_html('<div class="hidden md:block w-80 h-[calc(100vh-40px)]"></div>'),rA=t.from_html('<div class="w-full flex md:gap-5 flex-wrap"><div class="flex-1 pb-16 md:pb-0"><div class="bg-card border-border rounded-lg md:shadow md:border py-3"><!> <div class="space-y-4 md:px-5"><!></div></div></div> <!> <div><!></div></div>'),sA=t.from_html('<h3 id="error-modal-title" class="heading-lg"><!></h3>'),iA=t.from_html('<p class="body-sm"> </p> <p class="text-text-secondary mt-2"> </p>',1),lA=t.from_html('<p class="body-sm"> </p> <p class="text-text-secondary mt-2"> </p>',1),oA=t.from_html('<div id="error-modal-description"><!></div>'),nA=t.from_html("<!> <!>",1),cA=t.from_html('<div role="group" aria-label="Error modal actions"><!></div>'),vA=t.from_html('<h3 id="availability-modal-title" class="heading-lg"> </h3>'),dA=t.from_html('<li class="text-text-secondary text-sm"><span class="font-medium"> </span> <!></li>'),hA=t.from_html('<p class="text-text-secondary mt-4"> </p>'),gA=t.from_html('<p class="text-text-secondary mt-4"> </p>'),mA=t.from_html('<div id="availability-modal-description"><p class="text-text-secondary mb-4"> </p> <ul class="space-y-2"></ul> <!></div>'),pA=t.from_html('<div role="group" aria-label="Availability modal actions"><!> <!></div>'),fA=t.from_html('<div class="px-5 md:px-10 py-12 bg-card"><!></div> <!> <!>',1);function oa(a,e){t.push(e,!0);let r=t.prop(e,"organizationId",3,""),s=t.prop(e,"venueId",3,""),i=t.prop(e,"labels",19,()=>({})),l=t.state(!1),o=t.state(null),n=t.state(null),c=t.state(t.proxy([])),v=t.state(!1),h=t.state(!0),d=t.state(null),m=t.state(!1),g=t.state(!1),p=t.state(!1),H=t.state(0),f=t.state(void 0),_=t.state(void 0),u=t.state(t.proxy({})),A=t.state(""),y=t.state(""),b=t.state(0),M=t.state(!1),w=t.state("cart_failed"),V=t.state(!1),Z=t.state(!1),k=t.state(t.proxy([])),E=t.state(0),L=t.state(0),x=t.derived(()=>t.get(A1)?0:r0(Object.entries(t.get(u)).reduce((X,[f1,o1])=>{const m1=t.get(o)?.availableTickets?.find(y1=>y1.ID==f1);return m1?X+r0(o1*m1.price):X},0))),z=t.state(0),I=0,C=t.state(0),T=t.state(!1),S=null,P=t.derived(()=>r0(t.get(x)+t.get(z)+I));function D(X,f1){t.set(u,{...t.get(u),[X]:Math.max(0,(t.get(u)[X]??0)+f1)},!0),t.get(o)&&D3({eventID:t.get(o).eventID,quantities:t.get(u),promocode:t.get(A),tickets:t.get(o).availableTickets})}function R(){if(!t.get(o)?.availableTickets)return;const f1=t.get(o).availableTickets.filter(o1=>o1.visibility===0).map(o1=>parseFloat(o1.price)||0);if(f1.length===0){t.set(E,t.set(L,0),!0);return}t.set(E,Math.min(...f1).toFixed(2),!0),t.set(L,Math.max(...f1).toFixed(2),!0)}async function B(){const X=[];for(const[f1,o1]of Object.entries(t.get(u))){if(o1<=0)continue;const m1=t.get(o)?.availableTickets?.find(y1=>y1.ID==f1);!m1||m1.price===0||X.push({amountCents:Math.round(m1.price*100)*o1,reference:`ticket-${f1}`,quantity:o1})}if(X.length===0){t.set(C,0),t.set(T,!1);return}S&&S.abort(),S=new AbortController,t.set(T,!0);try{const f1=await fetch("https://get-micdrop.com/api/v2/public/tax-preview",{method:"POST",headers:{"Content-Type":"application/json"},signal:S.signal,body:JSON.stringify({venueId:Number(t.get(o).venueID),lineItems:X})});if(!f1.ok){console.error("Tax preview failed:",f1.status),t.set(C,0),t.set(T,!1);return}const o1=await f1.json();t.set(C,(o1.taxTotal??0)/100)}catch(f1){if(f1.name==="AbortError")return;console.error("Tax preview error:",f1),t.set(C,0)}finally{S?.signal?.aborted||t.set(T,!1)}}function U(){if(!t.get(o))return;t.set(A,S0(`checkout-promocode-${t.get(o).eventID}`)||"",!0);const X=parseFloat(S0("checkout-promo-discount")||0);t.set(y,t.get(A)?`${t.get(A)} applied.`:"",!0),t.set(b,X,!0)}async function G(){try{const X=await Z6(e.eventId),f1=[];for(const[o1,m1]of Object.entries(t.get(u))){if(m1<=0)continue;const y1=X.find(R1=>String(R1.ID)===String(o1));if(!y1)continue;const C1=y1.remainingCapacity??y1.quantity??1/0;if(C1<m1){const R1=t.get(o)?.availableTickets?.find(N1=>String(N1.ID)===String(o1));f1.push({ticketId:o1,ticketName:R1?.name||y1?.name||"Ticket",requestedQty:m1,availableQty:Math.max(0,C1)})}}return f1}catch(X){return console.error("Error checking ticket availability:",X),[]}}async function c1(){if(!t.get(o))return;t.set(v,!0),t.set(V,!1);const X=await G();if(X.length>0){t.set(v,!1),t.set(k,X,!0),t.set(Z,!0);return}await W()}async function W(){t.set(v,!0),D3({eventID:t.get(o).eventID,quantities:t.get(u),promocode:t.get(A),promoDiscountAmount:t.get(b),tickets:t.get(o).availableTickets});try{const X=await zp({eventID:t.get(o).eventID,quantities:t.get(u),promoCode:t.get(A)||void 0});if(!X||!X.success){t.set(v,!1),t.set(w,"cart_failed"),t.set(M,!0);return}t.set(z,X.serviceFee??0,!0),t.set(V,!0)}catch(X){console.error("Order initiation failed:",X),t.set(v,!1),t.set(w,"cart_failed"),t.set(M,!0);return}try{if(e.onNavigateToCheckout){e.onNavigateToCheckout(e.eventId,t.get(o)),t.set(v,!1);return}const X=new URLSearchParams;r()&&X.set("orgId",r()),s()&&X.set("venueId",s()),X.set("event_id",e.eventId),X.set("subroute","checkout");const f1=`/?${X.toString()}`;pt(f1,{noScroll:!1}),t.set(v,!1)}catch(X){console.error("Navigation failed after cart creation:",X),t.set(v,!1),t.set(w,"cart_success_network_error"),t.set(M,!0)}}function d1(){for(const f1 of t.get(k))f1.availableQty>0?t.get(u)[f1.ticketId]=f1.availableQty:delete t.get(u)[f1.ticketId];t.set(u,{...t.get(u)},!0),t.set(Z,!1),t.set(k,[],!0),Object.values(t.get(u)).reduce((f1,o1)=>f1+o1,0)>0?W():l1()}function p1(){t.set(Z,!1),t.set(k,[],!0),l1()}function t1(){t.set(M,!1),t.get(w)==="cart_failed"&&l1()}function h1(){t.set(M,!1),window.location.reload()}function N(){t.set(g,window.innerWidth<767)}let O=!1;function F(){O||(window.requestAnimationFrame(()=>{r1(),O=!1}),O=!0)}function r1(){if(t.get(g)||!t.get(_)||!t.get(f)){t.set(p,!1);return}const X=t.get(_).getBoundingClientRect();if(t.set(p,X.top<=20),t.get(p)){const f1=t.get(f).getBoundingClientRect();t.set(H,f1.left+f1.width-340-40)}}function l1(){if(t.get(o)&&I3(t.get(o).eventID),e.onNavigateBack)e.onNavigateBack();else{const X=new URLSearchParams(window.location.search);X.set("subroute","details");const f1=`/?${X.toString()}`;pt(f1,{})}}let q=t.derived(()=>t.get(o)?S0(`checkout-promo-reveal-${t.get(o).eventID}`)==="1":!1),J=t.derived(()=>{if(!t.get(o))return[];try{const X=S0(`checkout-promo-reveal-ids-${t.get(o).eventID}`);return X?JSON.parse(X):[]}catch{return[]}}),A1=t.derived(()=>t.get(o)?.availableTickets?.filter(X=>X.visibility===0)?.every(X=>X.price===0)),e1=t.derived(()=>{if(!t.get(o))return!1;const X=t.get(o).endDateTime||t.get(o).startDateTime;return X?new Date(X)<new Date:!1});function s1(X){if(X){const f1=new Date,o1=new Date(f1);return o1.setDate(f1.getDate()+7),{id:String(X),ID:String(X),eventID:String(X),title:"Test Comedy Show",name:"Test Comedy Show",description:"This is a test event for development and testing purposes.",coverImage:"https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=1200&h=800&fit=crop",startDateTime:o1.toISOString(),endDateTime:new Date(o1.getTime()+72e5).toISOString(),venueID:"test-venue-1",eventTicketingType:0,ticketType:0,availableTickets:[{ID:"ticket-1",name:"General Admission",price:25,remainingCapacity:50,visibility:0},{ID:"ticket-2",name:"VIP",price:50,remainingCapacity:10,visibility:0}]}}return null}async function Q(){if(t.get(m)){if(!e.eventId){t.set(d,i().noEventIdProvided||"No event ID provided",!0),t.set(h,!1);return}t.set(h,!0),t.set(d,null);try{try{if(t.set(n,await x6(e.eventId),!0),!t.get(m))return;t.set(o,Pt(t.get(n)),!0)}catch{if(!t.get(m))return;t.set(n,s1(e.eventId),!0),t.set(o,Pt(t.get(n)),!0),t.set(c,t.get(o).availableTickets||[],!0)}try{if(t.set(c,await Z6(e.eventId),!0),!t.get(m))return;t.get(c).length>0&&(t.get(o).availableTickets=t.get(c))}catch(f1){if(!t.get(m))return;console.error("Error fetching tickets:",f1),t.set(c,t.get(o).availableTickets||[],!0)}t.get(o).availableTickets&&t.get(o).availableTickets.forEach(f1=>t.get(u)[f1.ID]=0);const X=S3(t.get(o).eventID);if(t.set(u,X.quantities||{},!0),t.set(A,X.promocode||"",!0),t.set(b,X.promoDiscountAmount||0,!0),t.get(o).eventID&&(await xp(t.get(o).eventID),!t.get(m)))return;t.set(l,!0),R(),U(),await Vp({eventID:t.get(o).eventID})}catch(X){t.get(m)&&(console.error("Error loading event:",X),t.set(d,X.message||i().failedToLoadEvent||"Failed to load event",!0))}finally{t.get(m)&&t.set(h,!1)}}}j1.onMount(async()=>(t.set(m,!0),N(),window.addEventListener("resize",N),window.addEventListener("scroll",F),await Q(),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",F)})),j1.onDestroy(()=>{t.set(m,!1),S&&S.abort()}),t.user_effect(()=>{t.get(m)&&e.eventId&&Q()}),t.user_effect(()=>{const X=Object.values(t.get(u)).reduce((f1,o1)=>f1+o1,0);t.get(l)&&t.get(o)&&X>0?B():X===0&&(t.set(C,0),t.set(T,!1))});var j=fA(),V1=t.first_child(j),x1=t.child(V1);{var a1=X=>{var f1=JV(),o1=t.child(f1),m1=t.child(o1,!0);t.reset(o1),t.reset(f1),t.template_effect(()=>t.set_text(m1,i().loadingEvent||"Loading event...")),t.append(X,f1)},H1=X=>{var f1=$V(),o1=t.child(f1),m1=t.child(o1);t.reset(o1);var y1=t.sibling(o1,2),C1=t.child(y1,!0);t.reset(y1),t.reset(f1),t.template_effect(()=>{t.set_text(m1,`${(i().errorPrefix||"Error:")??""}
74
74
  ${t.get(d)??""}`),t.set_attribute(y1,"aria-label",i().goBackToEventDetails||"Go back to event details"),t.set_text(C1,i().goBack||"Go back")}),t.delegated("click",y1,l1),t.append(X,f1)},g1=X=>{var f1=tA(),o1=t.child(f1),m1=t.child(o1,!0);t.reset(o1);var y1=t.sibling(o1,2),C1=t.child(y1,!0);t.reset(y1);var R1=t.sibling(y1,2),N1=t.child(R1,!0);t.reset(R1),t.reset(f1),t.template_effect(()=>{t.set_text(m1,i().thisEventHasEnded||"This event has ended"),t.set_text(C1,i().ticketsNoLongerAvailable||"Tickets are no longer available for this event."),t.set_attribute(R1,"aria-label",i().goBackToEventDetails||"Go back to event details"),t.set_text(N1,i().goBack||"Go back")}),t.delegated("click",R1,l1),t.append(X,f1)},i1=X=>{var f1=eA(),o1=t.sibling(t.child(f1),4);t.reset(f1),t.delegated("click",o1,l1),t.append(X,f1)},K=X=>{var f1=rA(),o1=t.child(f1),m1=t.child(o1),y1=t.child(m1);KV(y1,{get event(){return t.get(o)},get lowestPrice(){return t.get(E)},get highestPrice(){return t.get(L)},onCancel:l1,get venueFeesReady(){return t.get(l)},get labels(){return i()}});var C1=t.sibling(y1,2),R1=t.child(C1);UV(R1,{get tickets(){return t.get(o).availableTickets},get quantities(){return t.get(u)},handleQuantityChange:D,get revealHiddenTickets(){return t.get(q)},get revealTicketIds(){return t.get(J)},get venueFeesReady(){return t.get(l)},get labels(){return i()}}),t.reset(C1),t.reset(m1),t.reset(o1);var N1=t.sibling(o1,2);{var S1=B1=>{var c2=aA();t.append(B1,c2)};t.if(N1,B1=>{t.get(p)&&!t.get(g)&&B1(S1)})}var O1=t.sibling(N1,2);let q1,P1;var k1=t.child(O1);{var T1=B1=>{Q6(B1,{})},$1=B1=>{{let c2=t.derived(()=>i().checkout||"Checkout"),n1=t.derived(()=>!!t.get(y));v6(B1,{get btnText(){return t.get(c2)},get loading(){return t.get(v)},checkoutTicket:c1,get quantities(){return t.get(u)},get eventTickets(){return t.get(o).availableTickets},get promoApplied(){return t.get(n1)},get promoDiscount(){return t.get(b)},get subtotal(){return t.get(x)},get fees(){return t.get(z)},taxes:I,get total(){return t.get(P)}})}};t.if(k1,B1=>{t.get(l)?t.get(o)&&t.get(o).availableTickets?.length&&B1($1,1):B1(T1)})}t.reset(O1),t.reset(f1),t.bind_this(f1,B1=>t.set(_,B1),()=>t.get(_)),t.template_effect(()=>{q1=t.set_class(O1,1,"w-full md:w-80 flex flex-col transition-all will-change-[left] svelte-19g9ni4",null,q1,{"is-sticky":t.get(p)}),P1=t.set_style(O1,"",P1,{left:t.get(p)?`${t.get(H)}px`:"auto"})}),t.append(X,f1)};t.if(x1,X=>{t.get(h)?X(a1):t.get(d)?X(H1,1):t.get(o)&&t.get(e1)?X(g1,2):t.get(o)&&t.get(e1)?X(i1,3):t.get(o)&&X(K,4)})}t.reset(V1),t.bind_this(V1,X=>t.set(f,X),()=>t.get(f));var w1=t.sibling(V1,2);Vt(w1,{size:"sm",oncancel:t1,role:"alertdialog","aria-labelledby":"error-modal-title","aria-describedby":"error-modal-description",get open(){return t.get(M)},set open(m1){t.set(M,m1,!0)},header:m1=>{var y1=sA(),C1=t.child(y1);{var R1=S1=>{var O1=t.text();t.template_effect(()=>t.set_text(O1,i().unableToReserveTickets||"Unable to Reserve Tickets")),t.append(S1,O1)},N1=S1=>{var O1=t.text();t.template_effect(()=>t.set_text(O1,i().connectionIssue||"Connection Issue")),t.append(S1,O1)};t.if(C1,S1=>{t.get(w)==="cart_failed"?S1(R1):S1(N1,!1)})}t.reset(y1),t.append(m1,y1)},body:m1=>{var y1=oA(),C1=t.child(y1);{var R1=S1=>{var O1=iA(),q1=t.first_child(O1),P1=t.child(q1,!0);t.reset(q1);var k1=t.sibling(q1,2),T1=t.child(k1,!0);t.reset(k1),t.template_effect(()=>{t.set_text(P1,i().cartFailedMessage||"We couldn't reserve your tickets. This may be due to a network issue or the tickets may no longer be available."),t.set_text(T1,i().pleaseGoBackAndTryAgain||"Please go back and try again.")}),t.append(S1,O1)},N1=S1=>{var O1=lA(),q1=t.first_child(O1),P1=t.child(q1,!0);t.reset(q1);var k1=t.sibling(q1,2),T1=t.child(k1,!0);t.reset(k1),t.template_effect(()=>{t.set_text(P1,i().cartSuccessMessage||"Good news! Your tickets have been reserved and are being held for you."),t.set_text(T1,i().cartSuccessNetworkError||"However, we encountered a connection issue. Please refresh the page to continue to checkout.")}),t.append(S1,O1)};t.if(C1,S1=>{t.get(w)==="cart_failed"?S1(R1):S1(N1,!1)})}t.reset(y1),t.append(m1,y1)},footer:m1=>{var y1=cA(),C1=t.child(y1);{var R1=S1=>{{let O1=t.derived(()=>i().goBack||"Go back");s2(S1,{variant:"default",onclick:t1,get"aria-label"(){return t.get(O1)},children:(q1,P1)=>{t.next();var k1=t.text();t.template_effect(()=>t.set_text(k1,i().goBack||"Go back")),t.append(q1,k1)},$$slots:{default:!0}})}},N1=S1=>{var O1=nA(),q1=t.first_child(O1);{let k1=t.derived(()=>i().cancel||"Cancel");s2(q1,{variant:"alternative",onclick:t1,get"aria-label"(){return t.get(k1)},children:(T1,$1)=>{t.next();var B1=t.text();t.template_effect(()=>t.set_text(B1,i().cancel||"Cancel")),t.append(T1,B1)},$$slots:{default:!0}})}var P1=t.sibling(q1,2);{let k1=t.derived(()=>i().refreshPage||"Refresh Page");s2(P1,{variant:"default",onclick:h1,get"aria-label"(){return t.get(k1)},children:(T1,$1)=>{t.next();var B1=t.text();t.template_effect(()=>t.set_text(B1,i().refreshPage||"Refresh Page")),t.append(T1,B1)},$$slots:{default:!0}})}t.append(S1,O1)};t.if(C1,S1=>{t.get(w)==="cart_failed"?S1(R1):S1(N1,!1)})}t.reset(y1),t.append(m1,y1)},$$slots:{header:!0,body:!0,footer:!0}});var M1=t.sibling(w1,2);Vt(M1,{size:"sm",oncancel:p1,role:"alertdialog","aria-labelledby":"availability-modal-title","aria-describedby":"availability-modal-description",get open(){return t.get(Z)},set open(m1){t.set(Z,m1,!0)},header:m1=>{var y1=vA(),C1=t.child(y1,!0);t.reset(y1),t.template_effect(()=>t.set_text(C1,i().limitedAvailability||"Limited Availability")),t.append(m1,y1)},body:m1=>{var y1=mA(),C1=t.child(y1),R1=t.child(C1,!0);t.reset(C1);var N1=t.sibling(C1,2);t.each(N1,21,()=>t.get(k),t.index,(k1,T1)=>{var $1=dA(),B1=t.child($1),c2=t.child(B1);t.reset(B1);var n1=t.sibling(B1,2);{var u1=_1=>{var Y=t.text();t.template_effect(v1=>t.set_text(Y,v1),[()=>(i().onlyNAvailable||"Only {available} available (you selected {requested})").replace("{available}",String(t.get(T1).availableQty)).replace("{requested}",String(t.get(T1).requestedQty))]),t.append(_1,Y)},L1=_1=>{var Y=t.text();t.template_effect(v1=>t.set_text(Y,v1),[()=>(i().soldOutYouSelected||"Sold out (you selected {requested})").replace("{requested}",String(t.get(T1).requestedQty))]),t.append(_1,Y)};t.if(n1,_1=>{t.get(T1).availableQty>0?_1(u1):_1(L1,!1)})}t.reset($1),t.template_effect(()=>t.set_text(c2,`${t.get(T1).ticketName??""}:`)),t.append(k1,$1)}),t.reset(N1);var S1=t.sibling(N1,2);{var O1=k1=>{var T1=hA(),$1=t.child(T1,!0);t.reset(T1),t.template_effect(()=>t.set_text($1,i().partialAvailabilityContinue||"Would you like to continue with the available tickets?")),t.append(k1,T1)},q1=t.derived(()=>t.get(k).some(k1=>k1.availableQty>0)),P1=k1=>{var T1=gA(),$1=t.child(T1,!0);t.reset(T1),t.template_effect(()=>t.set_text($1,i().allTicketsSoldOut||"Unfortunately, all the tickets you selected have sold out.")),t.append(k1,T1)};t.if(S1,k1=>{t.get(q1)?k1(O1):k1(P1,!1)})}t.reset(y1),t.template_effect(()=>{t.set_text(R1,i().ticketsNoLongerAvailableMessage||"Some tickets you selected are no longer available in the requested quantities:"),t.set_attribute(N1,"aria-label",i().ticketAvailabilityChanges||"Ticket availability changes")}),t.append(m1,y1)},footer:m1=>{var y1=pA(),C1=t.child(y1);{let O1=t.derived(()=>i().goBack||"Go back");s2(C1,{variant:"alternative",onclick:p1,get"aria-label"(){return t.get(O1)},children:(q1,P1)=>{t.next();var k1=t.text();t.template_effect(()=>t.set_text(k1,i().goBack||"Go back")),t.append(q1,k1)},$$slots:{default:!0}})}var R1=t.sibling(C1,2);{var N1=O1=>{{let q1=t.derived(()=>i().continueWithAvailable||"Continue with available");s2(O1,{variant:"default",onclick:d1,get"aria-label"(){return t.get(q1)},children:(P1,k1)=>{t.next();var T1=t.text();t.template_effect(()=>t.set_text(T1,i().continueWithAvailable||"Continue with available")),t.append(P1,T1)},$$slots:{default:!0}})}},S1=t.derived(()=>t.get(k).some(O1=>O1.availableQty>0));t.if(R1,O1=>{t.get(S1)&&O1(N1)})}t.reset(y1),t.append(m1,y1)},$$slots:{header:!0,body:!0,footer:!0}}),t.append(a,j),t.pop()}t.delegate(["click"]);const oe={event:{id:123,title:"Friday Night Comedy",startDateTime:"2026-03-20T20:00:00-07:00",endDateTime:"2026-03-20T22:00:00-07:00",timezone:"America/Los_Angeles",imageUrl:"/mock/view-tickets/event-poster.webp",doorsOpenTime:"7:30 PM"},tickets:[{id:1001,ticketNumber:"TKT-A8F3K2",attendeeName:"Alex Johnson",ticketType:"General Admission",qrCodeData:"MICDROP:TKT:1001:a8f3k2m9x7"},{id:1002,ticketNumber:"TKT-B7G4L3",attendeeName:"Alex Johnson",ticketType:"General Admission",qrCodeData:"MICDROP:TKT:1002:b7g4l3n8y6"},{id:1003,ticketNumber:"TKT-C6H5M4",attendeeName:"Sam Rivera",ticketType:"VIP",qrCodeData:"MICDROP:TKT:1003:c6h5m4p9z5"}],order:{orderNumber:"#12847",orderUUID:"a8f3k2m9-x7p4-q2w5-e6r8-t1y3u0i9o7",purchaseDate:"2026-03-10T14:30:00-07:00"},venue:{name:"The Comedy Store",address:"8433 Sunset Blvd, Los Angeles, CA 90069",contactEmail:"info@thecomedystore.com",logoUrl:null}};({...oe,tickets:oe.tickets[0]},{...oe,event:{...oe.event}});const uA=G3("VC");let _A={...{baseUrl:"https://get-micdrop.com",timeout:3e4,onError:a=>uA.error("API Error:",a)}};function ne(){return`${_A.baseUrl}/api/v2/public`}function HA(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var ce={},n5,K6;function MA(){return K6||(K6=1,n5=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),n5}var c5={},ft={},J6;function Ot(){if(J6)return ft;J6=1;let a;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return ft.getSymbolSize=function(s){if(!s)throw new Error('"version" cannot be null or undefined');if(s<1||s>40)throw new Error('"version" should be in range from 1 to 40');return s*4+17},ft.getSymbolTotalCodewords=function(s){return e[s]},ft.getBCHDigit=function(r){let s=0;for(;r!==0;)s++,r>>>=1;return s},ft.setToSJISFunction=function(s){if(typeof s!="function")throw new Error('"toSJISFunc" is not a valid function.');a=s},ft.isKanjiModeEnabled=function(){return typeof a<"u"},ft.toSJIS=function(s){return a(s)},ft}var v5={},$6;function d5(){return $6||($6=1,(function(a){a.L={bit:1},a.M={bit:0},a.Q={bit:3},a.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return a.L;case"m":case"medium":return a.M;case"q":case"quartile":return a.Q;case"h":case"high":return a.H;default:throw new Error("Unknown EC Level: "+r)}}a.isValid=function(s){return s&&typeof s.bit<"u"&&s.bit>=0&&s.bit<4},a.from=function(s,i){if(a.isValid(s))return s;try{return e(s)}catch{return i}}})(v5)),v5}var h5,t9;function VA(){if(t9)return h5;t9=1;function a(){this.buffer=[],this.length=0}return a.prototype={get:function(e){const r=Math.floor(e/8);return(this.buffer[r]>>>7-e%8&1)===1},put:function(e,r){for(let s=0;s<r;s++)this.putBit((e>>>r-s-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),e&&(this.buffer[r]|=128>>>this.length%8),this.length++}},h5=a,h5}var g5,e9;function AA(){if(e9)return g5;e9=1;function a(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return a.prototype.set=function(e,r,s,i){const l=e*this.size+r;this.data[l]=s,i&&(this.reservedBit[l]=!0)},a.prototype.get=function(e,r){return this.data[e*this.size+r]},a.prototype.xor=function(e,r,s){this.data[e*this.size+r]^=s},a.prototype.isReserved=function(e,r){return this.reservedBit[e*this.size+r]},g5=a,g5}var m5={},a9;function zA(){return a9||(a9=1,(function(a){const e=Ot().getSymbolSize;a.getRowColCoords=function(s){if(s===1)return[];const i=Math.floor(s/7)+2,l=e(s),o=l===145?26:Math.ceil((l-13)/(2*i-2))*2,n=[l-7];for(let c=1;c<i-1;c++)n[c]=n[c-1]-o;return n.push(6),n.reverse()},a.getPositions=function(s){const i=[],l=a.getRowColCoords(s),o=l.length;for(let n=0;n<o;n++)for(let c=0;c<o;c++)n===0&&c===0||n===0&&c===o-1||n===o-1&&c===0||i.push([l[n],l[c]]);return i}})(m5)),m5}var p5={},r9;function bA(){if(r9)return p5;r9=1;const a=Ot().getSymbolSize,e=7;return p5.getPositions=function(s){const i=a(s);return[[0,0],[i-e,0],[0,i-e]]},p5}var f5={},s9;function yA(){return s9||(s9=1,(function(a){a.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};a.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},a.from=function(i){return a.isValid(i)?parseInt(i,10):void 0},a.getPenaltyN1=function(i){const l=i.size;let o=0,n=0,c=0,v=null,h=null;for(let d=0;d<l;d++){n=c=0,v=h=null;for(let m=0;m<l;m++){let g=i.get(d,m);g===v?n++:(n>=5&&(o+=e.N1+(n-5)),v=g,n=1),g=i.get(m,d),g===h?c++:(c>=5&&(o+=e.N1+(c-5)),h=g,c=1)}n>=5&&(o+=e.N1+(n-5)),c>=5&&(o+=e.N1+(c-5))}return o},a.getPenaltyN2=function(i){const l=i.size;let o=0;for(let n=0;n<l-1;n++)for(let c=0;c<l-1;c++){const v=i.get(n,c)+i.get(n,c+1)+i.get(n+1,c)+i.get(n+1,c+1);(v===4||v===0)&&o++}return o*e.N2},a.getPenaltyN3=function(i){const l=i.size;let o=0,n=0,c=0;for(let v=0;v<l;v++){n=c=0;for(let h=0;h<l;h++)n=n<<1&2047|i.get(v,h),h>=10&&(n===1488||n===93)&&o++,c=c<<1&2047|i.get(h,v),h>=10&&(c===1488||c===93)&&o++}return o*e.N3},a.getPenaltyN4=function(i){let l=0;const o=i.data.length;for(let c=0;c<o;c++)l+=i.data[c];return Math.abs(Math.ceil(l*100/o/5)-10)*e.N4};function r(s,i,l){switch(s){case a.Patterns.PATTERN000:return(i+l)%2===0;case a.Patterns.PATTERN001:return i%2===0;case a.Patterns.PATTERN010:return l%3===0;case a.Patterns.PATTERN011:return(i+l)%3===0;case a.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(l/3))%2===0;case a.Patterns.PATTERN101:return i*l%2+i*l%3===0;case a.Patterns.PATTERN110:return(i*l%2+i*l%3)%2===0;case a.Patterns.PATTERN111:return(i*l%3+(i+l)%2)%2===0;default:throw new Error("bad maskPattern:"+s)}}a.applyMask=function(i,l){const o=l.size;for(let n=0;n<o;n++)for(let c=0;c<o;c++)l.isReserved(c,n)||l.xor(c,n,r(i,c,n))},a.getBestMask=function(i,l){const o=Object.keys(a.Patterns).length;let n=0,c=1/0;for(let v=0;v<o;v++){l(v),a.applyMask(v,i);const h=a.getPenaltyN1(i)+a.getPenaltyN2(i)+a.getPenaltyN3(i)+a.getPenaltyN4(i);a.applyMask(v,i),h<c&&(c=h,n=v)}return n}})(f5)),f5}var na={},i9;function l9(){if(i9)return na;i9=1;const a=d5(),e=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return na.getBlocksCount=function(i,l){switch(l){case a.L:return e[(i-1)*4+0];case a.M:return e[(i-1)*4+1];case a.Q:return e[(i-1)*4+2];case a.H:return e[(i-1)*4+3];default:return}},na.getTotalCodewordsCount=function(i,l){switch(l){case a.L:return r[(i-1)*4+0];case a.M:return r[(i-1)*4+1];case a.Q:return r[(i-1)*4+2];case a.H:return r[(i-1)*4+3];default:return}},na}var u5={},Qe={},o9;function xA(){if(o9)return Qe;o9=1;const a=new Uint8Array(512),e=new Uint8Array(256);return(function(){let s=1;for(let i=0;i<255;i++)a[i]=s,e[s]=i,s<<=1,s&256&&(s^=285);for(let i=255;i<512;i++)a[i]=a[i-255]})(),Qe.log=function(s){if(s<1)throw new Error("log("+s+")");return e[s]},Qe.exp=function(s){return a[s]},Qe.mul=function(s,i){return s===0||i===0?0:a[e[s]+e[i]]},Qe}var n9;function ZA(){return n9||(n9=1,(function(a){const e=xA();a.mul=function(s,i){const l=new Uint8Array(s.length+i.length-1);for(let o=0;o<s.length;o++)for(let n=0;n<i.length;n++)l[o+n]^=e.mul(s[o],i[n]);return l},a.mod=function(s,i){let l=new Uint8Array(s);for(;l.length-i.length>=0;){const o=l[0];for(let c=0;c<i.length;c++)l[c]^=e.mul(i[c],o);let n=0;for(;n<l.length&&l[n]===0;)n++;l=l.slice(n)}return l},a.generateECPolynomial=function(s){let i=new Uint8Array([1]);for(let l=0;l<s;l++)i=a.mul(i,new Uint8Array([1,e.exp(l)]));return i}})(u5)),u5}var _5,c9;function wA(){if(c9)return _5;c9=1;const a=ZA();function e(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(s){this.degree=s,this.genPoly=a.generateECPolynomial(this.degree)},e.prototype.encode=function(s){if(!this.genPoly)throw new Error("Encoder not initialized");const i=new Uint8Array(s.length+this.degree);i.set(s);const l=a.mod(i,this.genPoly),o=this.degree-l.length;if(o>0){const n=new Uint8Array(this.degree);return n.set(l,o),n}return l},_5=e,_5}var H5={},M5={},V5={},v9;function d9(){return v9||(v9=1,V5.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),V5}var B0={},h9;function g9(){if(h9)return B0;h9=1;const a="[0-9]+",e="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const s="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
75
75
  ]))+`;B0.KANJI=new RegExp(r,"g"),B0.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),B0.BYTE=new RegExp(s,"g"),B0.NUMERIC=new RegExp(a,"g"),B0.ALPHANUMERIC=new RegExp(e,"g");const i=new RegExp("^"+r+"$"),l=new RegExp("^"+a+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return B0.testKanji=function(c){return i.test(c)},B0.testNumeric=function(c){return l.test(c)},B0.testAlphanumeric=function(c){return o.test(c)},B0}var m9;function Nt(){return m9||(m9=1,(function(a){const e=d9(),r=g9();a.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},a.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},a.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},a.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},a.MIXED={bit:-1},a.getCharCountIndicator=function(l,o){if(!l.ccBits)throw new Error("Invalid mode: "+l);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?l.ccBits[0]:o<27?l.ccBits[1]:l.ccBits[2]},a.getBestModeForData=function(l){return r.testNumeric(l)?a.NUMERIC:r.testAlphanumeric(l)?a.ALPHANUMERIC:r.testKanji(l)?a.KANJI:a.BYTE},a.toString=function(l){if(l&&l.id)return l.id;throw new Error("Invalid mode")},a.isValid=function(l){return l&&l.bit&&l.ccBits};function s(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return a.NUMERIC;case"alphanumeric":return a.ALPHANUMERIC;case"kanji":return a.KANJI;case"byte":return a.BYTE;default:throw new Error("Unknown mode: "+i)}}a.from=function(l,o){if(a.isValid(l))return l;try{return s(l)}catch{return o}}})(M5)),M5}var p9;function LA(){return p9||(p9=1,(function(a){const e=Ot(),r=l9(),s=d5(),i=Nt(),l=d9(),o=7973,n=e.getBCHDigit(o);function c(m,g,p){for(let H=1;H<=40;H++)if(g<=a.getCapacity(H,p,m))return H}function v(m,g){return i.getCharCountIndicator(m,g)+4}function h(m,g){let p=0;return m.forEach(function(H){const f=v(H.mode,g);p+=f+H.getBitsLength()}),p}function d(m,g){for(let p=1;p<=40;p++)if(h(m,p)<=a.getCapacity(p,g,i.MIXED))return p}a.from=function(g,p){return l.isValid(g)?parseInt(g,10):p},a.getCapacity=function(g,p,H){if(!l.isValid(g))throw new Error("Invalid QR Code version");typeof H>"u"&&(H=i.BYTE);const f=e.getSymbolTotalCodewords(g),_=r.getTotalCodewordsCount(g,p),u=(f-_)*8;if(H===i.MIXED)return u;const A=u-v(H,g);switch(H){case i.NUMERIC:return Math.floor(A/10*3);case i.ALPHANUMERIC:return Math.floor(A/11*2);case i.KANJI:return Math.floor(A/13);case i.BYTE:default:return Math.floor(A/8)}},a.getBestVersionForData=function(g,p){let H;const f=s.from(p,s.M);if(Array.isArray(g)){if(g.length>1)return d(g,f);if(g.length===0)return 1;H=g[0]}else H=g;return c(H.mode,H.getLength(),f)},a.getEncodedBits=function(g){if(!l.isValid(g)||g<7)throw new Error("Invalid QR Code version");let p=g<<12;for(;e.getBCHDigit(p)-n>=0;)p^=o<<e.getBCHDigit(p)-n;return g<<12|p}})(H5)),H5}var A5={},f9;function TA(){if(f9)return A5;f9=1;const a=Ot(),e=1335,r=21522,s=a.getBCHDigit(e);return A5.getEncodedBits=function(l,o){const n=l.bit<<3|o;let c=n<<10;for(;a.getBCHDigit(c)-s>=0;)c^=e<<a.getBCHDigit(c)-s;return(n<<10|c)^r},A5}var z5={},b5,u9;function CA(){if(u9)return b5;u9=1;const a=Nt();function e(r){this.mode=a.NUMERIC,this.data=r.toString()}return e.getBitsLength=function(s){return 10*Math.floor(s/3)+(s%3?s%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(s){let i,l,o;for(i=0;i+3<=this.data.length;i+=3)l=this.data.substr(i,3),o=parseInt(l,10),s.put(o,10);const n=this.data.length-i;n>0&&(l=this.data.substr(i),o=parseInt(l,10),s.put(o,n*3+1))},b5=e,b5}var y5,_9;function EA(){if(_9)return y5;_9=1;const a=Nt(),e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(s){this.mode=a.ALPHANUMERIC,this.data=s}return r.getBitsLength=function(i){return 11*Math.floor(i/2)+6*(i%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(i){let l;for(l=0;l+2<=this.data.length;l+=2){let o=e.indexOf(this.data[l])*45;o+=e.indexOf(this.data[l+1]),i.put(o,11)}this.data.length%2&&i.put(e.indexOf(this.data[l]),6)},y5=r,y5}var x5,H9;function kA(){if(H9)return x5;H9=1;const a=Nt();function e(r){this.mode=a.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return e.getBitsLength=function(s){return s*8},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(r){for(let s=0,i=this.data.length;s<i;s++)r.put(this.data[s],8)},x5=e,x5}var Z5,M9;function SA(){if(M9)return Z5;M9=1;const a=Nt(),e=Ot();function r(s){this.mode=a.KANJI,this.data=s}return r.getBitsLength=function(i){return i*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(s){let i;for(i=0;i<this.data.length;i++){let l=e.toSJIS(this.data[i]);if(l>=33088&&l<=40956)l-=33088;else if(l>=57408&&l<=60351)l-=49472;else throw new Error("Invalid SJIS character: "+this.data[i]+`
76
76
  Make sure your charset is UTF-8`);l=(l>>>8&255)*192+(l&255),s.put(l,13)}},Z5=r,Z5}var w5={exports:{}},V9;function IA(){return V9||(V9=1,(function(a){var e={single_source_shortest_paths:function(r,s,i){var l={},o={};o[s]=0;var n=e.PriorityQueue.make();n.push(s,0);for(var c,v,h,d,m,g,p,H,f;!n.empty();){c=n.pop(),v=c.value,d=c.cost,m=r[v]||{};for(h in m)m.hasOwnProperty(h)&&(g=m[h],p=d+g,H=o[h],f=typeof o[h]>"u",(f||H>p)&&(o[h]=p,n.push(h,p),l[h]=v))}if(typeof i<"u"&&typeof o[i]>"u"){var _=["Could not find a path from ",s," to ",i,"."].join("");throw new Error(_)}return l},extract_shortest_path_from_predecessor_list:function(r,s){for(var i=[],l=s;l;)i.push(l),r[l],l=r[l];return i.reverse(),i},find_path:function(r,s,i){var l=e.single_source_shortest_paths(r,s,i);return e.extract_shortest_path_from_predecessor_list(l,i)},PriorityQueue:{make:function(r){var s=e.PriorityQueue,i={},l;r=r||{};for(l in s)s.hasOwnProperty(l)&&(i[l]=s[l]);return i.queue=[],i.sorter=r.sorter||s.default_sorter,i},default_sorter:function(r,s){return r.cost-s.cost},push:function(r,s){var i={value:r,cost:s};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};a.exports=e})(w5)),w5.exports}var A9;function DA(){return A9||(A9=1,(function(a){const e=Nt(),r=CA(),s=EA(),i=kA(),l=SA(),o=g9(),n=Ot(),c=IA();function v(_){return unescape(encodeURIComponent(_)).length}function h(_,u,A){const y=[];let b;for(;(b=_.exec(A))!==null;)y.push({data:b[0],index:b.index,mode:u,length:b[0].length});return y}function d(_){const u=h(o.NUMERIC,e.NUMERIC,_),A=h(o.ALPHANUMERIC,e.ALPHANUMERIC,_);let y,b;return n.isKanjiModeEnabled()?(y=h(o.BYTE,e.BYTE,_),b=h(o.KANJI,e.KANJI,_)):(y=h(o.BYTE_KANJI,e.BYTE,_),b=[]),u.concat(A,y,b).sort(function(w,V){return w.index-V.index}).map(function(w){return{data:w.data,mode:w.mode,length:w.length}})}function m(_,u){switch(u){case e.NUMERIC:return r.getBitsLength(_);case e.ALPHANUMERIC:return s.getBitsLength(_);case e.KANJI:return l.getBitsLength(_);case e.BYTE:return i.getBitsLength(_)}}function g(_){return _.reduce(function(u,A){const y=u.length-1>=0?u[u.length-1]:null;return y&&y.mode===A.mode?(u[u.length-1].data+=A.data,u):(u.push(A),u)},[])}function p(_){const u=[];for(let A=0;A<_.length;A++){const y=_[A];switch(y.mode){case e.NUMERIC:u.push([y,{data:y.data,mode:e.ALPHANUMERIC,length:y.length},{data:y.data,mode:e.BYTE,length:y.length}]);break;case e.ALPHANUMERIC:u.push([y,{data:y.data,mode:e.BYTE,length:y.length}]);break;case e.KANJI:u.push([y,{data:y.data,mode:e.BYTE,length:v(y.data)}]);break;case e.BYTE:u.push([{data:y.data,mode:e.BYTE,length:v(y.data)}])}}return u}function H(_,u){const A={},y={start:{}};let b=["start"];for(let M=0;M<_.length;M++){const w=_[M],V=[];for(let Z=0;Z<w.length;Z++){const k=w[Z],E=""+M+Z;V.push(E),A[E]={node:k,lastCount:0},y[E]={};for(let L=0;L<b.length;L++){const x=b[L];A[x]&&A[x].node.mode===k.mode?(y[x][E]=m(A[x].lastCount+k.length,k.mode)-m(A[x].lastCount,k.mode),A[x].lastCount+=k.length):(A[x]&&(A[x].lastCount=k.length),y[x][E]=m(k.length,k.mode)+4+e.getCharCountIndicator(k.mode,u))}}b=V}for(let M=0;M<b.length;M++)y[b[M]].end=0;return{map:y,table:A}}function f(_,u){let A;const y=e.getBestModeForData(_);if(A=e.from(u,y),A!==e.BYTE&&A.bit<y.bit)throw new Error('"'+_+'" cannot be encoded with mode '+e.toString(A)+`.