1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4542],{19487:(e,t,s)=>{"use strict";s.r(t),s.d(t,{__N_SSP:()=>e9,default:()=>e7});var n=s(6029),a=s(71541),i=s(55729),l=s(81278),r=s(30198),c=s(42262),o=s(84804),d=s(84687),u=s(36367),x=s(17898),m=s(67497),p=s(41071),h=s(63242),g=s(90033),v=s(50212),f=s(55259),b=s(37196),y=s(4094),j=s(42355),k=s(99213),N=s(85417),w=s(28345),A=s(1668),C=s(30642),I=s(38793),L=s(97227),S=s(40347),z=s(34581),M=s(58578),E=s(7194),G=s(84668),T=s(55323),F=s(21600),_=s(46113),P=s(19565),O=s(66940);let H=(0,O.A)("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);var D=s(62108),U=s(14615),Q=s(39477),R=s(11083);let W=(0,O.A)("list-plus",[["path",{d:"M16 5H3",key:"m91uny"}],["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 19H3",key:"zzsher"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]]);var V=s(96581),q=s(27693),B=s(37938);let K="font-subhead-book text-[16px] leading-5 text-text-primary",Y="mb-4 flex h-9 items-center gap-2",J="inline-flex size-8 shrink-0 items-center justify-center rounded-lg text-text-secondary transition-colors hover:bg-background-inverse/[0.08] hover:text-text-primary",Z=[{value:"az",label:"AâZ"},{value:"za",label:"ZâA"},{value:"capacity",label:"Capacity"},{value:"guests",label:"Guests"},{value:"sold",label:"Tickets sold"},{value:"revenue",label:"Revenue"}],X=(e,t,s)=>{var n,a;if("capacity"===e)return null!=(n=t.maxGuestCount)?n:1/0;if("sold"===e||"revenue"===e){let n=null==s?void 0:s.lists.find(e=>e.guestListId===t.id);return null!=(a="sold"===e?null==n?void 0:n.sold:null==n?void 0:n.revenueCents)?a:0}return t.stats.used},$="inline-flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-full bg-background-inverse/[0.06] px-3.5 font-medium text-[12.5px] text-text-primary transition-colors hover:bg-background-inverse/[0.1]",ee=e=>{let{eventId:t,eventSlug:s,qrDomain:a,guestLists:l,inviteLinks:r,guestsHref:c,canCreate:o,onCreate:d,onEdit:u,refetchInviteLinks:m,mode:p="manage",startCollapsed:h=!1,isPastEvent:g=!1,capacityWarningListIds:f,onIncreaseCapacity:y,onInvite:j,ticketTypes:k=[],salesSummary:N}=e,[w,A]=(0,i.useState)(!1),[C,L]=(0,i.useState)(!1),[S,M]=(0,i.useState)(""),[G,T]=(0,i.useState)("capacity"),[F,O]=(0,i.useState)(!1),{copyGuestListLink:ee,getCopyableLinks:et,linkPickerModal:es}=(0,B.n)({eventId:t,inviteLinks:r,refetch:m});if(0===l.length)return!o||g?null:(0,n.jsxs)("section",{children:[(0,n.jsx)("div",{className:Y,children:(0,n.jsx)("h2",{className:K,children:"Guest lists"})}),(0,n.jsxs)("div",{className:"flex flex-col items-start gap-3 rounded-2xl bg-background-inverse/[0.035] p-4 sm:flex-row sm:items-center",children:[(0,n.jsx)("p",{className:"min-w-0 flex-1 font-subhead-book text-[14px] leading-6 text-text-secondary",children:"No guest lists yet. Add one for VIPs, promoters or door entry."}),(0,n.jsxs)("button",{type:"button",onClick:d,className:"inline-flex h-9 shrink-0 items-center gap-1.5 rounded-full bg-text-primary px-4 font-medium text-[13px] text-background-primary transition-transform hover:scale-[1.02] active:scale-95",children:[(0,n.jsx)(_.A,{className:"size-3.5",strokeWidth:2.2}),"New list"]})]})]});let en=h&&!w,ea=l.length>4&&!en,ei=C?S.trim().toLowerCase():"",el=((e,t,s)=>[...e].sort((e,n)=>{if("ACTIVE"===e.guestListStatus!=("ACTIVE"===n.guestListStatus))return"ACTIVE"===e.guestListStatus?-1:1;if("az"===t||"za"===t){let s=e.displayName.localeCompare(n.displayName);return"az"===t?s:-s}return X(t,n,s)-X(t,e,s)||e.displayName.localeCompare(n.displayName)}))(l,G,N),er=ei?el.filter(e=>e.displayName.toLowerCase().includes(ei)):el,ec=4*!en,eo=ei?0:Math.max(0,er.length-ec),ed=w||ei?er:er.slice(0,ec),eu=()=>{L(e=>!e),M("")};return(0,n.jsxs)("section",{children:[(0,n.jsxs)("div",{className:Y,children:[(0,n.jsx)("h2",{className:K,children:"Guest lists"}),(0,n.jsx)("span",{className:"font-subhead-book text-[16px] tabular-nums leading-5 text-text-tertiary",children:l.length}),(0,n.jsxs)("div",{className:"ml-auto flex items-center gap-0.5",children:[j&&!g&&(0,n.jsxs)("button",{type:"button",onClick:j,className:"mr-1.5 inline-flex h-8 items-center gap-1.5 rounded-full bg-text-primary px-3.5 font-medium text-[13px] text-background-primary transition-transform hover:scale-[1.02] active:scale-95",children:[(0,n.jsx)(z.A,{className:"size-3.5",strokeWidth:2.2}),"Invite"]}),o&&!g&&(0,n.jsx)("button",{type:"button",onClick:d,"aria-label":"New list",className:J,children:(0,n.jsx)(_.A,{className:"size-4",strokeWidth:2.2})}),ea&&(0,n.jsx)("button",{type:"button",onClick:eu,"aria-label":"Search lists","aria-pressed":C,className:(0,v.A)(J,C&&"bg-background-inverse/[0.08] text-text-primary"),children:(0,n.jsx)(P.A,{className:"size-4"})}),ea&&(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("button",{type:"button",onClick:()=>O(e=>!e),"aria-label":"Sort lists","aria-expanded":F,className:(0,v.A)(J,F&&"bg-background-inverse/[0.08] text-text-primary"),children:(0,n.jsx)(H,{className:"size-4"})}),F&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",tabIndex:-1,"aria-hidden":!0,onClick:()=>O(!1),className:"fixed inset-0 z-30 cursor-default"}),(0,n.jsx)("div",{className:"absolute right-0 top-9 z-40 w-40 overflow-hidden rounded-xl bg-background-secondary py-1 shadow-[0_18px_50px_rgba(0,0,0,0.28)]",children:Z.filter(e=>N||"sold"!==e.value&&"revenue"!==e.value).map(e=>(0,n.jsx)("button",{type:"button",onClick:()=>{T(e.value),O(!1)},className:(0,v.A)("flex h-9 w-full items-center px-3 text-left text-[13px] transition-colors hover:bg-background-inverse/[0.06]",e.value===G?"font-semi text-text-primary":"text-text-secondary"),children:e.label},e.value))})]})]})]})]}),C&&(0,n.jsx)("input",{autoFocus:!0,value:S,onChange:e=>M(e.target.value),onKeyDown:e=>
1{"Escape"===e.key&&eu()},placeholder:"Search lists","aria-label":"Search lists",className:"mb-2 h-10 w-full rounded-full border-0 bg-background-inverse/[0.06] px-4 text-[14px] text-text-primary outline-none placeholder:text-text-tertiary"}),0===ed.length&&ei&&(0,n.jsxs)("p",{className:"py-3 font-subhead-book text-[13px] text-text-tertiary",children:["No lists match â",S.trim(),"â"]}),ed.map((e,t)=>{let i="qr_first"===e.layout,{approvedGuests:l,pendingGuests:r,checkedInGuests:o,used:d}=e.stats,m=e.maxGuestCount,h=null!==m&&d>=m,g=null!=m?m:Math.max(d,1),j="checkin"===p,w=Math.max(l,o,1),A=j?Math.min(100,o/w*100):Math.min(100,l/g*100),C=j?0:Math.min(100-A,r/g*100),L="ACTIVE"===e.guestListStatus,S=!!c&&d>0;return(0,n.jsxs)("div",{className:(0,v.A)("py-4",0===t&&"pt-0"),children:[(0,n.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,n.jsx)("span",{className:(0,v.A)("min-w-0 truncate font-medium text-[16px] leading-6 tracking-[-0.01em]",L?"flex-1 text-text-primary":"text-text-secondary"),children:e.displayName}),!L&&(0,n.jsx)("span",{className:"mr-auto shrink-0 rounded-full bg-background-inverse/[0.07] px-2 py-0.5 text-[11px] text-text-tertiary",children:"Off"}),i?(0,n.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1.5 whitespace-nowrap text-[14px] tabular-nums text-text-tertiary",children:[(0,n.jsx)(b.A,{className:"size-3.5 text-interactive-blue"}),o,null!==m?" of ".concat(m):""," scanned"]}):j?(0,n.jsxs)("span",{className:"shrink-0 whitespace-nowrap text-[14px] tabular-nums text-text-secondary",children:[o,(0,n.jsxs)("span",{className:"text-text-tertiary",children:[" of ",l," in"]})]}):(0,n.jsxs)("span",{className:"shrink-0 whitespace-nowrap text-[14px] tabular-nums text-text-secondary",children:[l,r>0&&(0,n.jsxs)("span",{className:"text-status-warning",children:["+",r]}),null!==m&&(0,n.jsxs)("span",{className:"text-text-tertiary",children:[" / ",m]}),h&&(0,n.jsx)("span",{className:"text-text-tertiary",children:" full"})]})]}),k.length>0&&(0,n.jsx)("div",{className:"mt-0.5 truncate text-[13px] text-text-tertiary",children:(0,E.Fmz)(e.eventTicketTypeId,k,e.ticketPriceOverrideCents)}),N&&(()=>{let t=N.lists.find(t=>t.guestListId===e.id);return t?(0,n.jsxs)("p",{className:"mt-1 text-[13px] tabular-nums text-text-secondary",children:[t.sold," sold \xb7 ",(0,E.WBs)(t.revenueCents,N.currency)]}):null})(),(0,n.jsxs)("div",{className:"mt-3 flex h-0.5 overflow-hidden rounded-full bg-background-inverse/10",children:[A>0&&(0,n.jsx)("span",{className:"h-full bg-status-success",style:{width:"".concat(A,"%")}}),C>0&&(0,n.jsx)("span",{className:"h-full bg-status-warning",style:{width:"".concat(C,"%")}})]}),(L||S)&&(0,n.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[L&&(i?(0,n.jsxs)("button",{type:"button",onClick:()=>(e=>{let t=et(e.id)[0],n=window.location.origin,i=t?(0,q.Wu)((0,E.dst)(n,t.code),n):"";if(!i)return void u(e.id);(0,q.$H)({eventSlug:s,qrUsername:i,qrDomain:a})})(e),className:$,children:[(0,n.jsx)(I.A,{className:"size-3.5"}),"Download QR"]}):(0,n.jsxs)("button",{type:"button",onClick:()=>void ee(e),className:(0,v.A)($,h&&"text-text-secondary"),children:[(0,n.jsx)(D.A,{className:"size-3.5"}),"Copy link"]})),L&&(0,n.jsxs)("button",{type:"button",onClick:()=>u(e.id),className:$,children:[(0,n.jsx)(V.A,{className:"size-3.5"}),"Edit"]}),L&&y&&(null==f?void 0:f.has(e.id))&&(0,n.jsxs)("button",{type:"button",onClick:()=>y(e.id),className:(0,v.A)($,"bg-status-warning/15 text-status-warning hover:bg-status-warning/25"),children:[(0,n.jsx)(U.A,{className:"size-3.5"}),"Increase capacity"]}),S&&(0,n.jsxs)(x.N,{href:"".concat(c,"?guestListId=").concat(encodeURIComponent(e.id)),shallow:!0,className:(0,v.A)("inline-flex shrink-0 items-center gap-1 whitespace-nowrap font-medium text-[13px] text-text-secondary transition-colors hover:text-text-primary",L&&"ml-auto"),children:[L?"Manage guests":"View guests",(0,n.jsx)(Q.A,{className:"size-3.5"})]})]})]},e.id)}),eo>0&&!w&&(0,n.jsxs)("button",{type:"button",onClick:()=>A(!0),className:"mt-2 inline-flex items-center gap-1 font-medium text-[15px] text-text-tertiary transition-colors hover:text-text-primary",children:[h?"Show ".concat(eo," lists"):"See ".concat(eo," more"),(0,n.jsx)(R.A,{className:"size-4"})]}),o&&!h&&!g&&(0,n.jsxs)("button",{type:"button",onClick:d,className:"mt-5 flex h-12 w-full items-center justify-center gap-2 rounded-full bg-background-inverse/[0.06] font-medium text-[14px] text-text-primary transition-colors hover:bg-background-inverse/[0.1]",children:[(0,n.jsx)(W,{className:"size-4",strokeWidth:2.2}),"New list"]}),es]})},et=e=>{let{summary:t,promoter:s=!1}=e,a=t.lists.reduce((e,t)=>
1({sold:e.sold+t.sold,checkedIn:e.checkedIn+t.checkedIn,revenueCents:e.revenueCents+t.revenueCents,linkOpened:e.linkOpened+t.linkOpened}),{sold:0,checkedIn:0,revenueCents:0,linkOpened:0});return(0,n.jsxs)("section",{children:[(0,n.jsx)("div",{className:Y,children:(0,n.jsx)("h2",{className:K,children:s?"Your sales":"Sales by list"})}),s&&(0,n.jsxs)("div",{className:"mb-4 grid grid-cols-3 gap-2 rounded-2xl bg-background-inverse/[0.05] p-4",children:[[{label:"Tickets sold",value:a.sold},{label:"Checked in",value:a.checkedIn},{label:"After refunds",value:(0,E.WBs)(a.revenueCents,t.currency)}].map(e=>(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"break-words font-medium text-lg tabular-nums text-text-primary",children:e.value}),(0,n.jsx)("p",{className:"text-xs text-text-secondary",children:e.label})]},e.label)),(0,n.jsxs)("p",{className:"col-span-3 mt-2 text-sm text-text-secondary",children:["Link opened ",a.linkOpened," times"]})]}),(!s||t.lists.length>1)&&(0,n.jsx)("div",{className:"overflow-x-auto",children:(0,n.jsxs)("table",{className:"w-full text-left text-[13px] tabular-nums",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"text-text-secondary",children:[(0,n.jsx)("th",{scope:"col",className:"py-3 pr-3 font-book",children:"List"}),(0,n.jsx)("th",{scope:"col",className:"px-2 py-3 text-right font-book",children:"Sold"}),(0,n.jsx)("th",{scope:"col",className:"px-2 py-3 text-right font-book",children:"Checked in"}),(0,n.jsx)("th",{scope:"col",className:"py-3 pl-2 text-right font-book",children:"After refunds"})]})}),(0,n.jsx)("tbody",{children:t.lists.map(e=>{var s;return(0,n.jsxs)("tr",{className:"border-t border-background-inverse/[0.08] text-text-primary",children:[(0,n.jsx)("th",{scope:"row",className:"py-3 pr-3 font-medium",children:e.name}),(0,n.jsx)("td",{className:"px-2 py-3 text-right",children:e.sold}),(0,n.jsx)("td",{className:"px-2 py-3 text-right",children:e.checkedIn}),(0,n.jsx)("td",{className:"whitespace-nowrap py-3 pl-2 text-right",children:(0,E.WBs)(e.revenueCents,t.currency)})]},null!=(s=e.guestListId)?s:"public")})})]})})]})};var es=s(76054);let en=e=>{let{summary:t,editHref:s,mode:a="sales"}=e;if(0===t.tiers.length)return null;let i="sales"===a,l="door"===a?"in":"used";return(0,n.jsxs)("section",{children:[(0,n.jsxs)("div",{className:Y,children:[(0,n.jsx)("h2",{className:(0,v.A)(K,"flex-1"),children:"Tickets"}),"door"===a?(0,n.jsxs)("span",{className:"text-[14px] tabular-nums text-text-secondary",children:[t.checkedIn,(0,n.jsxs)("span",{className:"text-text-tertiary",children:[" of ",t.sold," tickets in"]})]}):(0,n.jsxs)("span",{className:"text-[14px] tabular-nums text-text-secondary",children:[(0,E.WBs)(t.revenueCents,t.currency),(0,n.jsx)("span",{className:"text-text-tertiary",children:" after refunds"})]}),s&&(0,n.jsxs)(x.N,{href:s,className:"ml-3 inline-flex h-8 shrink-0 items-center gap-1.5 rounded-full bg-background-inverse/[0.06] px-3.5 font-medium text-[12.5px] text-text-primary transition-colors hover:bg-background-inverse/[0.1]",children:[(0,n.jsx)(A.A,{className:"size-3.5"}),"Edit"]})]}),(0,n.jsx)("div",{className:"flex flex-col",children:t.tiers.map((e,t)=>{let s=(e=>e.isActive?e.isSoldOut?"Sold out":e.salesEnded?"Sales ended":e.salesNotStarted?"Not on sale yet":e.isHidden?"Hidden":null:"Off")(e),a=i?e.quota:e.sold,r=a?Math.min(100,(i?e.sold:e.checkedIn)/a*100):0,c=i&&a?Math.min(100-r,e.held/a*100):0,o=!e.isActive||e.salesEnded;return(0,n.jsxs)("div",{className:(0,v.A)("py-4",0===t&&"pt-0"),children:[(0,n.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,n.jsx)("span",{className:(0,v.A)("min-w-0 truncate font-medium text-[16px] leading-6 tracking-[-0.01em]",o?"text-text-secondary":"text-text-primary"),children:e.name}),(0,n.jsx)("span",{className:"shrink-0 text-[14px] tabular-nums text-text-tertiary",children:e.priceCents>0?(0,E.Wls)(e.priceCents,e.currency):"Free"}),s&&i&&(0,n.jsx)("span",{className:(0,v.A)("shrink-0 rounded-full px-2 py-0.5 text-[11px]",e.isSoldOut?"bg-status-success/10 text-status-success":"bg-background-inverse/[0.07] text-text-tertiary"),children:s}),i?(0,n.jsxs)("span",{className:"ml-auto shrink-0 whitespace-nowrap text-[14px] tabular-nums text-text-secondary",children:[e.sold,e.held>0&&(0,n.jsxs)("span",{className:"text-status-warning",children:["+",e.held]}),null!==e.quota?(0,n.jsxs)("span",{className:"text-text-tertiary",children:[" / ",e.quota]}):(0,n.jsx)("span",{className:"text-text-tertiary",children:" sold"})]}):(0,n.jsxs)("span",{className:"ml-auto shrink-0 whitespace-nowrap text-[14px] tabular-nums text-text-secondary",children:[e.checkedIn,(0,n.jsx)("span",{className:"text-text-tertiary",children:" / ".concat(e.sold," ").concat(l)})]})]}),a?(0,n.jsxs)("div",{className:"mt-3 flex h-0.5 overflow-hidden rounded-full bg-background-inverse/10",children:[r>0&&(0,n.jsx)("span",{className:"h-full bg-status-success",style:{width:"".concat(r,"%")}}),c>0&&(0,n.jsx)("span",{className:"h-full bg-status-warning",style:{width:"".concat(c,"%")}})]}):null]},e.id)})}),(0,n.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-4 gap-y-1 text-[13px] text-text-tertiary",children:[i&&t.held>0&&(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:"size-1.5 rounded-full bg-status-warning"}),t.held," held in checkout"]}),i&&t.checkedIn>0&&(0,n.jsxs)("span",{children:[t.checkedIn," checked in"]}),"past"===a&&(0,n.jsx)("span",{children:"".concat(t.checkedIn," used \xb7 ").concat(Math.max(0,t.sold-t.checkedIn)," unused")})]})]})};var ea=s(75253),ei=s(55214),el=s(19216),er=s(53662),ec=s(49598),eo=s(49279),ed=s(53133);let eu=e=>{var t,s;let{inviteLink:a,activeLinkMenuId:l,setActiveLinkMenuId:r,getLinkTitle:c,onCopyLink:o,onShareLink:d,onOpenQrCode:u,onViewLinkGuests:x,onEditLink:m,onDeactivateLink:p,showApprovalBadge:h=!0}=e,g=null==(t=a.guestList)?void 0:t.id,f=l===a.id,b=null!=(s=c(a.description))?s:"Invite Link",y=new Date(a.expiresAt),j=y.getTime()<=Date.now(),k=!!(a.maxUses&&a.usageCount>=a.maxUses),N=a.maxUses?"".concat(a.usageCount,"/").concat(a.maxUses," used"):"".concat(a.usageCount," used"),w=(0,E.cbT)(y),A="rounded-full bg-background-inverse/[0.045] px-2 py-0.5",C="rounded-full bg-status-error/10 px-2 py-0.5 text-status-error",[I,L]=(0,i.useState)(!1),[S,z]=(0,i.useState)(!1),M=(0,i.useRef)(null);(0,i.useEffect)(()=>()=>
1{M.current&&clearTimeout(M.current)},[]);let G=()=>{o(a),L(!0),z(!0),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{z(!1),M.current=null},1400)},T=()=>{M.current&&(clearTimeout(M.current),M.current=null),z(!1)};return(0,n.jsxs)("div",{role:"button",tabIndex:0,"aria-label":"Copy ".concat(b),onClick:G,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),G())},onPointerLeave:T,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||T()},className:(0,v.A)("group relative cursor-pointer rounded-2xl bg-background-surface p-3.5 transition-colors hover:bg-background-inverse/[0.055] focus:outline-none focus-visible:ring-2 focus-visible:ring-interactive-primary/50",f&&"z-20"),children:[(0,n.jsx)("div",{className:(0,v.A)("pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-2xl bg-solid-black/60 opacity-0 backdrop-blur-[1px] transition-opacity duration-200 ease-out group-hover:opacity-100 group-focus-visible:opacity-100",S&&"opacity-100"),onTransitionEnd:e=>{e.currentTarget===e.target&&"opacity"===e.propertyName&&!S&&I&&L(!1)},children:(0,n.jsxs)("span",{className:(0,v.A)("inline-flex min-w-[5.25rem] items-center justify-center gap-1.5 rounded-full bg-transparent px-3 py-1.5 font-medium text-xs text-solid-white transition-all duration-200 ease-out",I?"scale-105 opacity-100":"scale-95 opacity-95 group-hover:scale-100 group-focus-visible:scale-100"),children:[I?(0,n.jsx)(eo.A,{className:"size-3.5 scale-110 transition-transform duration-200 ease-out"}):(0,n.jsx)(D.A,{className:"size-3.5 transition-transform duration-200 ease-out"}),I?"copied":"Copy"]})}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,n.jsx)("p",{className:"min-w-0 flex-1 truncate font-medium text-sm text-text-primary",children:b}),(0,n.jsx)("pre",{className:"m-0 max-w-24 shrink-0 truncate font-mono text-[11px] text-text-secondary",children:a.code})]}),(0,n.jsxs)("div",{className:"-my-1 -mr-1.5 flex shrink-0 items-center",children:[(0,n.jsx)("span",{className:"inline-flex h-8 items-center justify-center rounded-full px-2 text-text-primary transition-colors hover:bg-background-inverse/15",children:(0,n.jsx)(D.A,{className:"size-4"})}),g&&(0,n.jsx)("div",{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),className:"relative z-20 cursor-default",children:(0,n.jsx)(ed._,{inviteLink:a,isMenuOpen:f,triggerClassName:"inline-flex size-8 items-center justify-center rounded-full text-text-primary transition-colors hover:bg-background-inverse/15",onToggleMenu:()=>r(e=>e===a.id?null:a.id),onCopyLink:()=>{G(),r(null)},onShareLink:()=>{d(a),r(null)},onOpenQrCode:()=>{u(a),r(null)},onViewGuests:()=>{x(a),r(null)},onEditLink:()=>m(g,a.id),onDeactivateLink:()=>p(g,a.id)})})]})]}),(0,n.jsxs)("div",{className:"mt-1.5 flex flex-wrap gap-1.5 text-[11px] text-text-secondary",children:[h&&(0,n.jsx)("span",{className:A,children:a.skipWaitlist?"Skips approval":"Requires approval"}),(0,n.jsx)("span",{className:k?C:A,children:N}),w&&(0,n.jsx)("span",{className:j?C:A,children:w})]})]})},ex=e=>(null==e?void 0:e.trim())||void 0,em=e=>(0,E.dst)(window.location.origin,e.code),ep=[{action:"manualInvite",title:"Email",body:"Send invites to names and emails you type in.",Icon:ei.A},{action:"csvUpload",title:"Upload a CSV",body:"Invite a whole spreadsheet of names and emails.",Icon:el.A},{action:"existingUserInvite",title:"Find on Meet",body:"Search people who already use Meet.",Icon:P.A}],eh=e=>{let{icon:t,title:s,body:a,onClick:i}=e;return(0,n.jsxs)("button",{type:"button",onClick:i,className:"flex w-full items-center gap-3 rounded-2xl bg-background-inverse/[0.05] px-4 py-3.5 text-left transition-colors hover:bg-background-inverse/[0.09]",children:[(0,n.jsx)("span",{className:"grid size-10 shrink-0 place-items-center rounded-full bg-background-inverse/[0.08] text-text-primary",children:t}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block truncate font-medium text-[15px] text-text-primary",children:s}),a&&(0,n.jsx)("span",{className:"mt-0.5 block text-[13px] leading-5 text-text-secondary",children:a})]}),(0,n.jsx)(f.A,{className:"size-4 shrink-0 text-text-tertiary"})]})},eg=e=>{var t,s,a;let{event:l,guestLists:r,qrDomain:c,onInvitesChanged:o}=e,d=r.length>1,[x,m]=(0,i.useState)(d?"pick":"method"),[p,h]=(0,i.useState)(d?null:null!=(s=null==(t=r[0])?void 0:t.id)?s:null),[v,f]=(0,i.useState)(""),[b,y]=(0,i.useState)(null),[j,k]=(0,i.useState)(null),[N,w]=(0,i.useState)(null),{data:A,refetch:C}=g.FH.eventInviteLinks.list.useQuery({eventId:l.id,page:1,limit:100},{enabled:"link"===x}),I=(0,E.ZjQ)({ticketingEnabled:l.ticketing_enabled}).showApprovalControls,L=null!=(a=r.find(e=>e.id===p))?a:null,S=(0,i.useMemo)(()=>{var e;return(null!=(e=null==A?void 0:A.inviteLinks)?e:[]).filter(e=>{var t;return e.isActive&&(null==(t=e.guestList)?void 0:t.id)===p})},[null==A?void 0:A.inviteLinks,p]),z=v.trim().toLowerCase(),G=z?r.filter(e=>e.displayName.toLowerCase().includes(z)):r,T=(e,t,s)=>k({id:"".concat(e,"-").concat(null!=s?s:t,"-").concat(Date.now()),type:e,guestListId:t,inviteLinkId:s}),F=e=>{navigator.clipboard.writeText(em(e)),M.Ay.success("Invite link copied")},P=async e=>{let t=em(e);
1if("function"==typeof navigator.share)try{await navigator.share({url:t});return}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return}await navigator.clipboard.writeText(t),M.Ay.success("Copied link to clipboard")},O=e=>{var t;let s=window.location.origin,n=em(e),a=(0,q.Wu)(n,s);if(!a)return void M.Ay.error("Unable to generate QR code for this link");w({label:null!=(t=ex(e.description))?t:"Invite Link",linkUrl:n,qrUsername:a})};return(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[L&&"pick"!==x&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[("link"===x||"method"===x&&d)&&(0,n.jsx)("button",{type:"button",onClick:()=>{"link"===x?m("method"):"method"===x&&d&&m("pick")},"aria-label":"Back",className:"-ml-1 grid size-8 place-items-center rounded-full text-text-secondary transition-colors hover:bg-background-inverse/[0.06] hover:text-text-primary",children:(0,n.jsx)(er.A,{className:"size-5"})}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"text-[12px] text-text-tertiary",children:"Inviting to"}),(0,n.jsx)("p",{className:"truncate font-medium text-[15px] text-text-primary",children:L.displayName})]})]}),"pick"===x&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-[14px] text-text-secondary",children:"Which guest list are you inviting people to?"}),r.length>6&&(0,n.jsx)("input",{autoFocus:!0,value:v,onChange:e=>f(e.target.value),placeholder:"Search lists","aria-label":"Search lists",className:"h-11 w-full rounded-full border-0 bg-background-inverse/[0.06] px-4 text-sm text-text-primary outline-none placeholder:text-text-tertiary"}),(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[G.map(e=>{let t=(0,E.FsK)(e.stats.used,e.maxGuestCount);return(0,n.jsx)(eh,{icon:(0,n.jsx)("span",{className:"font-medium text-[13px]",children:e.displayName.slice(0,1).toUpperCase()}),title:e.displayName,body:t.label,onClick:()=>{h(e.id),m("method")}},e.id)}),0===G.length&&(0,n.jsxs)("p",{className:"py-4 text-center text-[13px] text-text-tertiary",children:["No lists match â",v.trim(),"â"]})]})]}),"method"===x&&L&&(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[ep.map(e=>{let{action:t,title:s,body:a,Icon:i}=e;return(0,n.jsx)(eh,{icon:(0,n.jsx)(i,{className:"size-[18px]"}),title:s,body:a,onClick:()=>T(t,L.id)},t)}),(0,n.jsx)(eh,{icon:(0,n.jsx)(ec.A,{className:"size-[18px]"}),title:"Share a link",body:"Copy the list's link, or make a new one with its own limit.",onClick:()=>m("link")})]}),"link"===x&&L&&(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[0===S.length?(0,n.jsx)("p",{className:"text-[13px] text-text-secondary",children:"This list has no active links yet."}):(0,n.jsx)("div",{className:"flex flex-col gap-2",children:S.map(e=>(0,n.jsx)(eu,{inviteLink:e,activeLinkMenuId:b,setActiveLinkMenuId:y,getLinkTitle:ex,onCopyLink:F,onShareLink:e=>void P(e),onOpenQrCode:O,onViewLinkGuests:e=>{l.slug&&(window.location.href="".concat((0,u.yM)(l.slug,"guests"),"?invite_code=").concat(encodeURIComponent(e.code)))},onEditLink:(e,t)=>T("editLink",e,t),onDeactivateLink:(e,t)=>T("deactivateLink",e,t),showApprovalBadge:I},e.id))}),(0,n.jsxs)("button",{type:"button",onClick:()=>T("createLink",L.id),className:"inline-flex h-11 items-center justify-center gap-2 rounded-full bg-background-inverse/[0.08] px-5 font-medium text-sm text-text-primary transition-colors hover:bg-background-inverse/[0.12]",children:[(0,n.jsx)(_.A,{className:"size-4"}),"New link"]})]}),(0,n.jsx)(es.m,{event:l,mode:"controller",externalAction:j,onInvitesSent:()=>{C(),null==o||o()},onInviteLinkDialogClose:()=>{k(null),C()}}),(0,n.jsx)(q.kK,{selectedLink:N,onClose:()=>w(null),eventTitle:l.title,eventSlug:l.slug,qrDomain:c})]})};var ev=s(4781);let ef="group flex items-center justify-center gap-2.5 rounded-2xl bg-background-surface p-3.5 transition-colors hover:bg-background-inverse/[0.08]",eb="size-5 text-text-secondary transition-colors group-hover:text-text-primary",ey=e=>{let{guestListId:t,includeLink:s=!1,onSelect:a}=e;return(0,n.jsxs)(n.Fragment,{children:[s&&(0,n.jsxs)("button",{type:"button",title:"Create a shareable link for this list",onClick:()=>a("createLink",t),className:ef,children:[(0,n.jsx)(ec.A,{className:eb}),(0,n.jsx)("span",{className:"font-medium text-sm text-text-primary",children:"New link"})]}),(0,n.jsxs)("button",{type:"button",title:"Send individual email invites",onClick:()=>a("manualInvite",t),className:ef,children:[(0,n.jsx)(ei.A,{className:eb}),(0,n.jsx)("span",{className:"font-medium text-sm text-text-primary",children:"By email"})]}),(0,n.jsxs)("button",{type:"button",title:"Add multiple guests at once",onClick:()=>a("csvUpload",t),className:ef,children:[(0,n.jsx)(el.A,{className:eb}),(0,n.jsx)("span",{className:"font-medium text-sm text-text-primary",children:"Upload CSV"})]}),(0,n.jsxs)("button",{type:"button",title:"Invite someone who already has a Meet account",onClick:()=>a("existingUserInvite",t),className:ef,children:[(0,n.jsx)(ev.A,{className:eb}),(0,n.jsx)("span",{className:"font-medium text-sm text-text-primary",children:"On Meet"})]})]})};var ej=s(28884),ek=s(1985);let eN=e=>{var t;let{list:s,links:a,activeLinkMenuId:i,setActiveLinkMenuId:l,moreLinksExpanded:r,onToggleMoreLinks:c,getLinkTitle:o,onCopyLink:d,onShareLink:u,onOpenQrCode:x,onViewLinkGuests:m,onEditLink:p,onDeactivateLink:h,onCreateLink:g,onStartQuickLink:f,showApprovalBadge:y=!0,renderLinkRow:j,addDirectlySlot:k,manageListSlot:N}=e,w=(0,E.Gbb)(a),A=w[0],C=w.slice(1);return(0,n.jsxs)("div",{className:"mt-4 flex flex-col gap-4",children:[A?(0,n.jsxs)("div",{className:(0,v.A)("relative rounded-2xl bg-background-surface p-4",i===A.id&&"z-20"),children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,n.jsx)("p",{className:"min-w-0 truncate font-medium text-sm text-text-primary",children:null!=(t=o(A.description))?t:"Invite link"}),(0,n.jsx)(ed._,{inviteLink:A,isMenuOpen:i===A.id,triggerClassName:"-mr-1.5 -mt-1.5 inline-flex size-8 shrink-0 items-center justify-center rounded-full text-text-primary transition-colors hover:bg-background-inverse/15",onToggleMenu:()=>l(e=>e===A.id?null:A.id),onCopyLink:()=>{d(A),l(null)},onShareLink:()=>{u(A),l(null)},onOpenQrCode:()=>{x(A),l(null)},onViewGuests:()=>{m(A),l(null)},onEditLink:()=>p(s.id,A.id),onDeactivateLink:()=>h(s.id,A.id)})]}),(0,n.jsxs)("div",{className:"mt-1.5 flex flex-wrap gap-1.5 text-[11px] text-text-secondary",children:[y&&(0,n.jsx)("span",{className:"rounded-full bg-background-inverse/[0.045] px-2 py-0.5",children:A.skipWaitlist?"Skips approval":"Requires approval"}),(0,n.jsx)("span",{className:"rounded-full bg-background-inverse/[0.045] px-2 py-0.5",children:A.maxUses?"".concat(A.usageCount,"/").concat(A.maxUses," used"):"".concat(A.usageCount," used")})]}),(0,n.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>d(A),className:"inline-flex h-9 flex-1 items-center justify-center gap-2 rounded-full bg-interactive-primary px-3.5 font-medium text-xs text-text-on-primary transition-colors hover:bg-interactive-primary-hover hover:text-text-on-primary-hover",children:[(0,n.jsx)(D.A,{className:"size-3.5"}),"Copy link"]}),(0,n.jsxs)("button",{type:"button",onClick:()=>u(A),className:"inline-flex h-9 items-center justify-center gap-2 rounded-full bg-background-inverse/10 px-3.5 font-medium text-xs text-text-primary transition-colors hover:bg-background-inverse/15",children:[(0,n.jsx)(ej.A,{className:"size-3.5"}),"Share"]}),(0,n.jsxs)("button",{type:"button",onClick:()=>x(A),className:"inline-flex h-9 items-center justify-center gap-2 rounded-full bg-background-inverse/10 px-3.5 font-medium text-xs text-text-primary transition-colors hover:bg-background-inverse/15",children:[(0,n.jsx)(b.A,{className:"size-3.5"}),"QR"]})]})]}):(0,n.jsxs)("button",{type:"button",onClick:()=>g(s.id),className:"inline-flex h-11 items-center justify-center gap-2 rounded-full bg-interactive-primary px-5 font-medium text-sm text-text-on-primary transition-colors hover:bg-interactive-primary-hover hover:text-text-on-primary-hover",children:[(0,n.jsx)(ec.A,{className:"size-4"}),"Create invite link"]}),C.length>0&&(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[r&&(0,n.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:C.map(e=>j(e))}),(0,n.jsxs)("button",{type:"button",onClick:c,className:"inline-flex items-center gap-1.5 self-start font-medium text-xs text-text-secondary transition-colors hover:text-text-primary",children:[r?"Show fewer":"".concat(C.length," more link").concat(1===C.length?"":"s"),(0,n.jsx)(R.A,{className:(0,v.A)("size-3.5 transition-transform",r&&"rotate-180")}
1)]})]}),A&&(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>f(s.id),className:"inline-flex h-9 items-center justify-center gap-2 rounded-full bg-background-inverse/10 px-3.5 font-medium text-xs text-text-primary transition-colors hover:bg-background-inverse/15",children:[(0,n.jsx)(ec.A,{className:"size-3.5"}),"Quick link"]}),(0,n.jsxs)("button",{type:"button",onClick:()=>g(s.id),className:"inline-flex h-9 items-center justify-center gap-2 rounded-full bg-background-inverse/10 px-3.5 font-medium text-xs text-text-primary transition-colors hover:bg-background-inverse/15",children:[(0,n.jsx)(ek.A,{className:"size-3.5"}),"Custom link"]})]}),k,N]})},ew={neutral:"text-text-tertiary",warning:"text-status-warning",full:"text-status-error"},eA="font-inter-semibold text-[11px] uppercase tracking-[0.22px] text-text-secondary",eC=e=>(null==e?void 0:e.trim())||void 0,eI=e=>(0,E.dst)(window.location.origin,e.code),eL=e=>{var t,s,a,l,r;let{event:c,guestLists:o,initialListId:d,qrDomain:x,bare:m=!1,onInvitesChanged:p}=e,[h,b]=(0,i.useState)(null!=(s=d&&o.some(e=>e.id===d)?d:null==(t=o[0])?void 0:t.id)?s:null),[y,j]=(0,i.useState)(!1),[k,N]=(0,i.useState)(null),[w,A]=(0,i.useState)(!1),[C,I]=(0,i.useState)(null),[L,z]=(0,i.useState)(null),[G,T]=(0,i.useState)(null),[F,_]=(0,i.useState)(""),[P,O]=(0,i.useState)("1"),{data:H,refetch:D}=g.FH.eventInviteLinks.list.useQuery({eventId:c.id,page:1,limit:100},{enabled:o.length>0}),U=g.FH.eventInviteLinks.createQuick.useMutation(),Q=(0,E.ZjQ)({ticketingEnabled:c.ticketing_enabled}).showApprovalControls,W=(0,i.useMemo)(()=>{var e,t;let s=new Map;for(let n of null!=(e=null==H?void 0:H.inviteLinks)?e:[]){let e=null==(t=n.guestList)?void 0:t.id;if(!e)continue;let a=s.get(e);a?a.push(n):s.set(e,[n])}return s},[null==H?void 0:H.inviteLinks]),V=null!=(l=null!=(a=o.find(e=>e.id===h))?a:o[0])?l:null;if(!V)return null;let B=(e,t)=>{t&&I({id:"".concat(e,"-").concat(t,"-").concat(Date.now()),type:e,guestListId:t})},K=(e,t,s)=>{I({id:"".concat(e,"-").concat(s,"-").concat(Date.now()),type:e,guestListId:t,inviteLinkId:s})},Y=e=>{navigator.clipboard.writeText(eI(e)),M.Ay.success("Invite link copied")},J=async e=>{let t=eI(e);if("undefined"!=typeof navigator&&"function"==typeof navigator.share)try{await navigator.share({url:t});return}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return}try{await navigator.clipboard.writeText(t),M.Ay.success("Copied link to clipboard")}catch(e){M.Ay.error("Unable to share link")}},Z=e=>{var t;let s=window.location.origin,n=eI(e),a=(0,q.Wu)(n,s);if(!a)return void M.Ay.error("Unable to generate QR code for this link");z({label:null!=(t=eC(e.description))?t:"Invite Link",linkUrl:n,qrUsername:a})},X=e=>{c.slug&&(window.location.href="".concat((0,u.yM)(c.slug,"guests"),"?invite_code=").concat(encodeURIComponent(e.code)))},$=async()=>{if(!G||U.isPending)return;let e=Number.parseInt(P,10);try{let t=await U.mutateAsync({eventId:c.id,guestListId:G,description:F.trim()||void 0,maxUses:Math.max(Number.isNaN(e)?1:e,1)});await D(),null==p||p(),T(null);let s=(0,E.dst)(window.location.origin,t.code);if("undefined"!=typeof navigator&&"function"==typeof navigator.share)try{await navigator.share({url:s});return}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return}await navigator.clipboard.writeText(s),M.Ay.success("Quick link created \xb7 copied to clipboard")}catch(e){(0,g.JA)(e,"Failed to create quick link")}},ee=c.slug?(0,u.yM)(c.slug,"guests"):"#",et=o.length>1,en=(0,E.FsK)(V.stats.used,V.maxGuestCount);return(0,n.jsxs)("div",{className:(0,v.A)(m?"flex flex-col":"rounded-[24px] bg-background-inverse/[0.035] p-5 sm:p-6"),children:[m?et&&(0,n.jsx)("p",{className:eA,children:"Invite to"}):(0,n.jsx)("p",{className:eA,children:"Invite guests"}),et&&(0,n.jsxs)("div",{className:"relative mt-2",children:[(0,n.jsxs)("button",{type:"button",onClick:()=>j(e=>!e),className:"flex w-full items-center gap-3 rounded-2xl bg-background-surface p-3 text-left transition-colors hover:bg-background-inverse/[0.05]",children:[(0,n.jsx)("span",{className:"grid size-9 shrink-0 place-items-center rounded-full bg-background-inverse/[0.06] text-text-secondary",children:(0,n.jsx)(S.A,{className:"size-4"})}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block truncate font-medium text-sm text-text-primary",children:V.displayName}),(0,n.jsx)("span",{className:(0,v.A)("block text-xs",ew[en.tone],"neutral"!==en.tone&&"font-medium"),children:en.label})]}),(0,n.jsx)(R.A,{className:(0,v.A)("size-4 shrink-0 text-text-secondary transition-transform",y&&"rotate-180")}
1)]}),y&&(0,n.jsx)("div",{className:"absolute inset-x-0 top-full z-30 mt-2 overflow-hidden rounded-2xl bg-background-surface p-1.5 shadow-[0_18px_48px_rgba(0,0,0,0.22)]",children:o.map(e=>{let t=(0,E.FsK)(e.stats.used,e.maxGuestCount),s=e.id===V.id;return(0,n.jsxs)("button",{type:"button",onClick:()=>{b(e.id),j(!1),A(!1)},className:(0,v.A)("flex w-full items-center gap-3 rounded-xl px-2.5 py-2 text-left transition-colors hover:bg-background-inverse/[0.055]",s&&"bg-background-inverse/[0.055]"),children:[(0,n.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-full bg-background-inverse/[0.06] text-text-secondary",children:(0,n.jsx)(S.A,{className:"size-4"})}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block truncate font-medium text-sm text-text-primary",children:e.displayName}),(0,n.jsx)("span",{className:(0,v.A)("block text-xs",ew[t.tone],"neutral"!==t.tone&&"font-medium"),children:t.label})]})]},e.id)})})]}),G?(0,n.jsxs)("div",{className:"mt-4 flex flex-col gap-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:eA,children:"Quick link"}),(0,n.jsx)("p",{className:"mt-1 text-sm leading-5 text-text-secondary",children:Q?"A fast link that skips approval. Set how many guests can use it, or just create & share as-is.":"A fast link. Set how many guests can use it, or just create & share as-is."})]}),(0,n.jsx)("input",{value:F,onChange:e=>_(e.target.value),onFocus:e=>e.currentTarget.select(),autoFocus:!0,placeholder:"Link name","aria-label":"Quick link name",className:"h-11 w-full rounded-xl border-0 bg-background-surface px-3.5 text-sm text-text-primary placeholder:text-text-tertiary focus:outline-none focus:ring-1 focus:ring-background-inverse/20"}),(0,n.jsxs)("label",{className:"block",children:[(0,n.jsx)("span",{className:"mb-1.5 block font-medium text-xs text-text-secondary",children:"Capacity"}),(0,n.jsx)("input",{value:P,onChange:e=>O(e.target.value.replace(/[^0-9]/g,"").slice(0,4)),onFocus:e=>e.currentTarget.select(),inputMode:"numeric",pattern:"[0-9]*","aria-label":"Quick link capacity",className:"h-11 w-full rounded-xl border-0 bg-background-surface px-3.5 text-sm text-text-primary placeholder:text-text-tertiary focus:outline-none focus:ring-1 focus:ring-background-inverse/20"}),(0,n.jsx)("span",{className:"mt-1.5 block text-xs text-text-tertiary",children:"How many guests can join from this link."})]}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("button",{type:"button",onClick:()=>T(null),className:"inline-flex h-11 items-center justify-center rounded-full bg-background-inverse/10 px-5 font-medium text-sm text-text-primary transition-colors hover:bg-background-inverse/15",children:"Cancel"}),(0,n.jsxs)("button",{type:"button",onClick:()=>void $(),disabled:U.isPending,className:"inline-flex h-11 flex-1 items-center justify-center gap-2 rounded-full bg-interactive-primary px-5 font-medium text-sm text-text-on-primary transition-colors hover:bg-interactive-primary-hover hover:text-text-on-primary-hover disabled:cursor-not-allowed disabled:opacity-50",children:[(0,n.jsx)(ec.A,{className:"size-4"}),U.isPending?"Creatingâ¦":"Create & share"]})]})]}):(0,n.jsx)(eN,{list:V,links:null!=(r=W.get(V.id))?r:[],activeLinkMenuId:k,setActiveLinkMenuId:N,moreLinksExpanded:w,onToggleMoreLinks:()=>A(e=>!e),getLinkTitle:eC,onCopyLink:Y,onShareLink:e=>void J(e),onOpenQrCode:Z,onViewLinkGuests:X,onEditLink:(e,t)=>K("editLink",e,t),onDeactivateLink:(e,t)=>K("deactivateLink",e,t),onCreateLink:e=>B("createLink",e),onStartQuickLink:e=>{let t=o.find(t=>t.id===e);_(t?"".concat(t.displayName," - Quick Link"):"Quick Link"),O("1"),T(e)},showApprovalBadge:Q,renderLinkRow:e=>(0,n.jsx)(eu,{inviteLink:e,activeLinkMenuId:k,setActiveLinkMenuId:N,getLinkTitle:eC,onCopyLink:Y,onShareLink:e=>void J(e),onOpenQrCode:Z,onViewLinkGuests:X,onEditLink:(e,t)=>K("editLink",e,t),onDeactivateLink:(e,t)=>K("deactivateLink",e,t),showApprovalBadge:Q},e.id),addDirectlySlot:(0,n.jsxs)("div",{className:"pt-4",children:[(0,n.jsx)("p",{className:eA,children:"Or add directly"}),(0,n.jsx)("div",{className:"mt-2 grid grid-cols-3 gap-2",children:(0,n.jsx)(ey,{guestListId:V.id,onSelect:(e,t)=>
1B(e,t)})})]}),manageListSlot:(0,n.jsxs)("a",{href:"".concat(ee,"?guestListId=").concat(encodeURIComponent(V.id)),className:"inline-flex items-center gap-1 self-start font-medium text-xs text-text-secondary transition-colors hover:text-text-primary",children:["Manage list",(0,n.jsx)(f.A,{className:"size-3.5"})]})}),(0,n.jsx)(es.m,{event:c,mode:"controller",externalAction:C,onInvitesSent:()=>{D(),null==p||p()},onInviteLinkDialogClose:()=>I(null)}),(0,n.jsx)(q.kK,{selectedLink:L,onClose:()=>z(null),eventTitle:c.title,eventSlug:c.slug,qrDomain:x})]})},eS="inline-flex h-11 items-center justify-center gap-2 rounded-full bg-interactive-primary px-5 font-medium text-sm text-text-on-primary transition-colors hover:bg-interactive-primary-hover hover:text-text-on-primary-hover disabled:opacity-60",ez=e=>{let{slug:t,isPrivate:s,origin:a,ticketSales:i,salesByList:l,ticketsEditHref:r,onOpenSales:c,isOpeningSales:o,guestLists:d,guestsHref:u,onAddGuestList:m,eventPageShortcuts:p}=e,h=(null==i?void 0:i.salesEnabled)===!0,g=d.length>0,b=a?(0,E.Zn6)(a,t):"",y=async()=>{try{await navigator.clipboard.writeText(b),M.Ay.success("Ticket link copied")}catch(e){M.Ay.error("Could not copy the link")}};return(0,n.jsxs)("div",{className:"mx-auto flex max-w-5xl flex-col gap-12",children:[(0,n.jsxs)("section",{className:"flex flex-col items-start gap-4 pt-2",children:[(0,n.jsx)("span",{className:"grid size-12 place-items-center rounded-2xl bg-status-success/15 text-status-success",children:(0,n.jsx)(eo.A,{className:"size-6",strokeWidth:2.2})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"font-role-headline text-[30px] leading-[1.05] text-text-primary sm:text-[36px]",children:"You're ready to sell"}),(0,n.jsx)("p",{className:"mt-2 max-w-xl font-subhead-book text-[15px] leading-6 text-text-secondary",children:s?g?"Only people with a link can buy. Share a guest list link to start selling.":"Only people with a link can buy. Add a guest list to get a link to share.":h?"Sales are open. Share the link to start selling.":"Tickets are set up. Open sales when you're ready to share the link."})]}),!s&&h&&b?(0,n.jsx)("div",{className:"w-full max-w-xl truncate rounded-2xl bg-background-inverse/[0.05] px-4 py-3 font-mono text-[13px] text-text-secondary",children:b}):null,(0,n.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[!h&&c?(0,n.jsxs)("button",{type:"button",onClick:c,disabled:o,className:eS,children:[(0,n.jsx)(k.A,{className:"size-4"}),o?"Openingâ¦":"Open sales"]}):null,h&&!s&&b?(0,n.jsxs)("button",{type:"button",onClick:()=>void y(),className:eS,children:[(0,n.jsx)(D.A,{className:"size-4"}),"Copy ticket link"]}):null,s&&!g&&m?(0,n.jsxs)("button",{type:"button",onClick:m,className:eS,children:[(0,n.jsx)(_.A,{className:"size-4"}),"Add a guest list"]}):null]})]}),i?(0,n.jsx)(en,{summary:i,editHref:r}):null,l,(0,n.jsxs)("section",{children:[(0,n.jsxs)("div",{className:Y,children:[(0,n.jsx)("h2",{className:(0,v.A)(K,"flex-1"),children:"Guest lists"}),(0,n.jsx)("span",{className:"rounded-full bg-background-inverse/[0.07] px-2.5 py-0.5 text-[12px] text-text-tertiary",children:"Optional"})]}),g?(0,n.jsx)("div",{className:"flex flex-col",children:d.map(e=>(0,n.jsxs)(x.N,{href:"".concat(u,"?guestListId=").concat(e.id),shallow:!0,className:"flex items-center gap-3 border-b border-background-inverse/[0.08] py-4 last:border-b-0",children:[(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block truncate font-medium text-[16px] text-text-primary",children:e.displayName}
1),e.ticketLabel?(0,n.jsx)("span",{className:"block truncate text-[13px] text-text-tertiary",children:e.ticketLabel}):null,e.salesLabel&&(0,n.jsx)("span",{className:"block text-[13px] text-text-secondary",children:e.salesLabel})]}),(0,n.jsx)(f.A,{className:"size-4 shrink-0 text-text-tertiary"})]},e.id))}):(0,n.jsx)("p",{className:"font-subhead-book text-[14px] leading-6 text-text-secondary",children:"Give free entry or a better price to VIPs, promoters or friends."}),m&&!(s&&!g)?(0,n.jsxs)("button",{type:"button",onClick:m,className:(0,v.A)("inline-flex h-11 items-center justify-center gap-2 rounded-full bg-background-inverse/[0.055] px-5 font-medium text-sm text-text-primary transition-colors hover:bg-background-inverse/[0.085]","mt-4"),children:[(0,n.jsx)(_.A,{className:"size-4"}),"Add a guest list"]}):null]}),p]})},eM="rounded-[24px] bg-background-inverse/[0.035]",eE=e=>{var t;return null!=(t=e.display_name)?t:e.username},eG=e=>{let{value:t,label:s,href:a}=e,i=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"block font-semi text-[30px] leading-none text-text-primary sm:text-[34px]",children:t}),(0,n.jsxs)("span",{className:"mt-1.5 inline-flex items-center gap-1 font-subhead-book text-[13px] text-text-secondary",children:[s,a&&(0,n.jsx)(f.A,{className:"size-3",strokeWidth:2.2})]})]});return a?(0,n.jsx)(x.N,{href:a,shallow:!0,className:"group min-w-0 flex-1 text-left transition-transform hover:-translate-y-0.5",children:i}):(0,n.jsx)("div",{className:"min-w-0 flex-1 text-left",children:i})},eT=e=>{let{checkedIn:t,target:s,percentage:a,href:i,className:l,recentCheckins:r=[]}=e;if(s<=0)return null;let c=r.slice(0,5),o=r.length>c.length,d=(e=>{let t=Date.now()-36e5;return e.filter(e=>!!e.checked_in_at&&new Date(e.checked_in_at).getTime()>=t)})(r).length>1,u=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,n.jsx)(b.A,{className:"size-5 shrink-0 text-text-secondary",strokeWidth:1.9}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("div",{className:"font-semi text-[16px] leading-tight text-text-primary",children:"Check-in progress"}),(0,n.jsxs)("div",{className:"mt-0.5 font-subhead-book text-[13px] text-text-secondary",children:[t," of ",s," guests checked in"]})]})]}),(0,n.jsxs)("span",{className:"flex shrink-0 items-center gap-1 font-semi text-[15px] text-text-primary",children:[a,"%",(0,n.jsx)(f.A,{className:"size-4"})]})]}),(c.length>0||d)&&(0,n.jsxs)("div",{className:"mt-4 flex items-center justify-between gap-3",children:[(0,n.jsxs)("div",{className:"flex min-w-0 items-center",children:[c.map((e,t)=>{var s,a;let i=eE(e.user),l=(0,E.cG1)({user:e.user,fallback:E.AAV.avatar.default,variant:"sm"});return(0,n.jsx)("img",{src:l,alt:i,className:(0,v.A)("h-avatar-half w-avatar-half rounded-full bg-background-inverse/[0.06] object-cover",t>0&&"-ml-2")},"".concat(e.user.id,"-").concat(null!=(a=null==(s=e.checked_in_at)?void 0:s.toString())?a:t))}),o&&(0,n.jsx)("span",{className:"-ml-2 inline-flex h-avatar-half w-avatar-half items-center justify-center rounded-full bg-solid-white/[0.04] text-text-secondary",children:(0,n.jsx)(f.A,{className:"size-3.5",strokeWidth:2.4})})]}),d&&(0,n.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1.5 rounded-full bg-status-success/10 px-2.5 py-1 font-semi text-[11px] uppercase tracking-[0.12em] text-status-success",children:[(0,n.jsx)("span",{className:"size-1.5 rounded-full bg-status-success shadow-[0_0_0_4px_rgba(18,167,32,0.16)] motion-safe:animate-pulse"}),"Live"]})]}),(0,n.jsx)("div",{className:"mt-4 h-2 overflow-hidden rounded-full bg-background-inverse/10",children:(0,n.jsx)("div",{className:"h-full rounded-full bg-interactive-secondary transition-[width] duration-700",style:{width:"".concat(a,"%")}})})]}),m=(0,v.A)("block rounded-2xl bg-background-inverse/[0.035] p-4",i&&"transition-colors hover:bg-background-inverse/[0.055]",l);return i?(0,n.jsx)(x.N,{href:i,shallow:!0,className:m,children:u}):(0,n.jsx)("section",{className:m,children:u})},eF=e=>{let{attendees:t,total:s,href:a}=e;if(0===t.length)return null;let i=t.slice(0,11),l=Math.max(0,s-i.length),r=(0,n.jsxs)("div",{className:"grid grid-cols-6 gap-1.5",children:[i.map(e=>(0,n.jsx)("img",{src:(0,E.cG1)({user:e.user,fallback:E.AAV.avatar.default,variant:"md"}),alt:"",className:"aspect-square w-full rounded-[10px] object-cover"},e.id)),l>0&&(0,n.jsxs)("span",{className:"grid aspect-square w-full place-items-center rounded-[10px] bg-solid-white/[0.06] font-semi text-[13px] tabular-nums tracking-tight text-text-primary",children:["+",l]})]});return a?(0,n.jsx)(x.N,{href:a,shallow:!0,className:"block",children:r}):r},e_=e=>{var t,s,n,a,i,l;let r=(null!=(t=null==e?void 0:e.other)?t:0)+(null!=(s=null==e?void 0:e.preferNotToSay)?s:0),c=(null!=(n=null==e?void 0:e.female)?n:0)+(null!=(a=null==e?void 0:e.male)?a:0)+r;return c<=0?null:[{label:"female",value:null!=(i=null==e?void 0:e.female)?i:0},{label:"male",value:null!=(l=null==e?void 0:e.male)?l:0},{label:"other",value:r}].map(e=>({...e,percent:Math.round(e.value/c*100)})).filter(e=>e.percent>0).map(e=>"".concat(e.percent,"% ").concat(e.label)).join(" \xb7 ")},eP="inline-flex h-11 items-center justify-center whitespace-nowrap rounded-full px-5 font-medium text-[15px] tracking-[-0.01em] transition-[transform,background-color] hover:scale-[1.02] active:scale-95",eO="flex min-h-[168px] flex-col justify-between rounded-[24px] px-6 pb-5 pt-6 transition-transform",eH=e=>{let{tile:t,onAccent:s}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:(0,v.A)("font-subhead-book text-[16px] leading-5",s?"text-solid-black":"text-text-primary"),children:t.label}),(0,n.jsx)("span",{className:(0,v.A)("block text-[40px] tabular-nums leading-[1.2] tracking-[-0.03em]",s?"text-solid-black":"text-text-primary"),children:t.value})]})},eD=e=>{let{tiles:t,wide:s,attentionItems:a=[]}=e,i=["bg-background-inverse/[0.09]","bg-text-warm/[0.2]"];return(0,n.jsxs)("section",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[t.map((e,t)=>{let s=(0,v.A)(eO,i[t]);return e.href?(0,n.jsx)(x.N,{href:e.href,shallow:!0,className:(0,v.A)(s,"hover:-translate-y-0.5"),children:(0,n.jsx)(eH,{tile:e})},e.label):(0,n.jsx)("div",{className:s,children:(0,n.jsx)(eH,{tile:e})},e.label)}),(0,n.jsxs)("div",{className:(0,v.A)(eO,"col-span-2 bg-interactive-secondary"),children:[(0,n.jsx)("span",{className:"font-subhead-book text-[16px] leading-5 text-solid-black",children:s.label}),(0,n.jsxs)("div",{className:"flex items-end gap-2",children:[(0,n.jsx)("span",{className:"min-w-0 flex-1 text-[40px] tabular-nums leading-[1.2] tracking-[-0.03em] text-solid-black",children:s.value}),s.action&&(s.action.href?(0,n.jsx)(x.N,{href:s.action.href,shallow:!0,className:(0,v.A)(eP,"shrink-0 bg-solid-black text-solid-white"),children:s.action.label}):(0,n.jsx)("button",{type:"button",onClick:s.action.onClick,className:(0,v.A)(eP,"shrink-0 bg-solid-black text-solid-white"),children:s.action.label}))]})]}),a.map(e=>(0,n.jsxs)("article",{className:"col-span-2 flex min-h-[168px] flex-col justify-between gap-6 rounded-[24px] bg-background-inverse/[0.05] px-6 pb-5 pt-6",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)("span",{className:"font-medium text-[16px] leading-5 text-text-primary",children:e.title}),(0,n.jsx)("p",{className:"font-subhead-book text-[14px] leading-5 text-text-secondary",children:e.body})]}),e.actions&&(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:e.actions})]},e.key))]})},eU=(0,v.A)(eP,"bg-text-primary text-background-primary"),eQ=(0,v.A)(eP,"bg-background-inverse/[0.08] text-text-primary hover:bg-background-inverse/[0.12]"),eR=["rounded-full","rounded-full","rounded-none","rounded-full","rounded-full","rounded-none","rounded-[16px]","rounded-full"],eW=e=>{let{title:t,note:s,groups:a}=e;return a.every(e=>0===e.attendees.length)?null:(0,n.jsxs)("section",{children:[(0,n.jsxs)("div",{className:Y,children:[(0,n.jsx)("h2",{className:K,children:t}),s&&(0,n.jsx)("span",{className:"ml-auto font-subhead-book text-[13px] text-text-tertiary",children:s})]}),(0,n.jsx)("div",{className:"flex items-start justify-between gap-4 px-2",children:a.map((e,t)=>{let s=e.attendees.slice(0,4),a=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"grid aspect-square w-full max-w-[176px] grid-cols-2 grid-rows-2",children:[s.map((e,s)=>(0,n.jsx)("img",{src:(0,E.cG1)({user:e.user,fallback:E.AAV.avatar.default,variant:"md"}),alt:"",className:(0,v.A)("size-full object-cover",eR[4*t+s])},e.id)),Array.from({length:4-s.length},(e,a)=>(0,n.jsx)("span",{className:(0,v.A)("size-full bg-background-inverse/[0.06]",eR[4*t+s.length+a])},"empty-".concat(a)))]}),(0,n.jsxs)("div",{className:"font-subhead-book text-[14px] leading-5",children:[(0,n.jsx)("p",{className:"font-medium text-text-primary",children:e.label}),(0,n.jsx)("p",{className:"tabular-nums text-text-tertiary",children:e.count})]})]});return e.href?(0,n.jsx)(x.N,{href:e.href,shallow:!0,className:"flex min-w-0 flex-1 flex-col gap-6 transition-opacity hover:opacity-90",children:a},e.label):(0,n.jsx)("div",{className:"flex min-w-0 flex-1 flex-col gap-6",children:a},e.label)})})]})},eV="animate-pulse bg-background-inverse/[0.07]",eq=()=>(0,n.jsxs)("div",{className:"flex flex-col gap-16 pt-2 lg:grid lg:grid-cols-[minmax(0,1.55fr)_minmax(360px,1fr)] lg:gap-x-12 lg:gap-y-10","aria-busy":"true","aria-label":"Loading overview",children:[(0,n.jsxs)("div",{className:"flex min-w-0 flex-col gap-16",children:[(0,n.jsx)("div",{className:"flex flex-col gap-10",children:(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[(0,n.jsx)("div",{className:(0,v.A)(eV,"h-[168px] rounded-[24px]")}),(0,n.jsx)("div",{className:(0,v.A)(eV,"h-[168px] rounded-[24px]")}),(0,n.jsx)("div",{className:(0,v.A)(eV,"col-span-2 h-[168px] rounded-[24px]")})]})}),(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)("div",{className:(0,v.A)(eV,"mb-6 mt-2.5 h-4 w-28 rounded-full")}),[0,1,2].map(e=>(0,n.jsxs)("div",{className:"py-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("div",{className:(0,v.A)(eV,"h-4 w-40 rounded-full")}),(0,n.jsx)("div",{className:(0,v.A)(eV,"h-3.5 w-12 rounded-full")})]}),(0,n.jsx)("div",{className:(0,v.A)(eV,"mt-4 h-0.5 w-full rounded-full")}),(0,n.jsxs)("div",{className:"mt-3 flex gap-2",children:[(0,n.jsx)("div",{className:(0,v.A)(eV,"h-8 w-24 rounded-full")}),(0,n.jsx)("div",{className:(0,v.A)(eV,"h-8 w-16 rounded-full")})]})]},e))]})]}),(0,n.jsx)("div",{className:(0,v.A)(eV,"hidden h-[232px] rounded-[24px] lg:block")})]}),eB=e=>{let{event:t,attending:s,pendingApproval:a,capacity:i,spotsRemaining:l,overbooked:r,attendees:c,genderDistribution:o,statItems:d,facesLabel:m}=e,p=t.slug,h="guestList"===t.guestManagementScope,g=p?(0,u.yM)(p,"guests"):null,f=!0===t.canManageGuests||!0===t.canViewOwnGuests,b=e_(o);return(0,n.jsxs)("section",{className:(0,v.A)(eM,"p-5 sm:p-6"),children:[(0,n.jsx)("div",{className:"flex gap-5 sm:gap-8",children:d?d.map(e=>(0,n.jsx)(eG,{value:e.value,label:e.label,href:e.href},e.label)):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eG,{value:s,label:h?"Joined":"Attending",href:f&&g?"".concat(g,"?attending=1"):void 0}),(0,n.jsx)(eG,{value:a,label:"Waitlist",href:f&&g?"".concat(g,"?waitlistStatus=").concat(G.EventWaitlistStatus.PENDING):void 0}),(r>0||null!==i&&"number"==typeof l)&&(0,n.jsx)(eG,{value:r>0?r:null!=l?l:0,label:r>0?"Overbooked":"RSVPs left"})]})}),b&&(0,n.jsx)(x.N,{href:f&&g?g:"#",shallow:!0,className:"mt-4 block font-subhead-book text-[12.5px] text-text-tertiary transition-colors hover:text-text-secondary",children:b}),m&&(0,n.jsx)("p",{className:(0,v.A)(K,"mt-5"),children:m}),(0,n.jsx)("div",{className:m?"mt-2.5":"mt-5",children:(0,n.jsx)(eF,{attendees:c,total:s+a,href:f?g:null})})]})},eK=e=>{let{event:t}=e,s=t.slug;if(!s||!1===t.is_active)return null;let a=[{label:"Check-in",href:(0,u.yM)(s,"checkin"),Icon:b.A,show:!0===t.canUseHostCheckIn}].filter(e=>e.show);return 0===a.length?null:(0,n.jsx)("section",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:a.map(e=>{let{label:t,href:s,Icon:a}=e;return(0,n.jsxs)(x.N,{href:s,shallow:!0,className:(0,v.A)(eM,"group flex min-h-[116px] flex-col justify-between p-4 text-left transition-all hover:-translate-y-0.5 hover:bg-background-inverse/[0.055]"),children:[(0,n.jsx)("span",{className:"grid size-10 place-items-center rounded-full bg-interactive-secondary/15 text-text-secondary",children:(0,n.jsx)(a,{className:"size-5",strokeWidth:1.9})}),(0,n.jsx)("span",{className:"font-semi text-[15px] text-text-primary",children:t})]},s)})})},eY=()=>(0,n.jsxs)("section",{className:(0,v.A)(eM,"flex items-start gap-3 p-5"),children:[(0,n.jsx)("span",{className:"grid size-10 shrink-0 place-items-center rounded-full bg-status-error/15 text-status-error",children:(0,n.jsx)(y.A,{className:"size-5",strokeWidth:2})}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("h2",{className:"font-semi text-lg text-text-primary",children:"Event canceled"}),(0,n.jsx)("p",{className:"mt-1 text-sm leading-5 text-text-secondary",children:"This event is no longer active. Hosts can review the canceled event, but active management actions are hidden."})]})]}),eJ=e=>{let{event:t,eventHasExpired:s,pendingApproval:a}=e;if(s||a<=0||!t.slug)return null;let i=(0,u.yM)(t.slug,"guests");return(0,n.jsx)("section",{className:"rounded-[24px] bg-status-warning/[0.07] p-4 sm:p-5",children:(0,n.jsxs)("div",{className:"flex items-center gap-4",children:[(0,n.jsx)("span",{className:"grid size-11 shrink-0 place-items-center rounded-full bg-status-warning/15 text-status-warning",children:(0,n.jsx)(j.A,{className:"size-5",strokeWidth:2})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"font-semi text-[16px] text-text-primary",children:[a," guest",1===a?"":"s"," waiting for approval"]}),(0,n.jsx)("div",{className:"mt-0.5 font-subhead-book text-[13px] text-text-secondary",children:"Review them before the door gets busy."})]}),(0,n.jsx)(x.N,{href:"".concat(i,"?waitlistStatus=").concat(G.EventWaitlistStatus.PENDING),shallow:!0,className:"shrink-0 rounded-full bg-solid-white px-5 py-3 font-semi text-sm text-solid-black transition-transform hover:scale-[1.02] hover:bg-solid-white/90 active:scale-95",children:"Review"})]})})},eZ=e=>{let{event:t,hidePublicLink:s=!1}=e,a=(0,E.TBl)(t.localDateTime,t.date,t.end_date),i=t.slug?"/event/".concat(t.slug,"?preview=1"):"/",l=t.slug?(0,u.yM)(t.slug,"settings"):null,r=!!(t.canEditEvent&&l),c=!s;return(0,n.jsx)("section",{className:(0,v.A)(eM,"p-5 sm:p-6"),children:(0,n.jsxs)("div",{className:"flex gap-5",children:[t.banner_url?(0,n.jsx)("img",{src:t.banner_url,alt:"",className:"size-[118px] shrink-0 rounded-2xl object-cover sm:size-[136px]"}):(0,n.jsx)("div",{className:"grid size-[118px] shrink-0 place-items-center rounded-2xl bg-interactive-secondary/20 text-text-secondary sm:size-[136px]",children:(0,n.jsx)(k.A,{className:"size-10"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("h2",{className:"font-role-headline text-[24px] leading-[1.05] text-text-primary sm:text-[28px]",children:t.title}),(0,n.jsxs)("div",{className:"mt-4 flex items-center gap-2 font-subhead-book text-[14px] text-text-secondary",children:[(0,n.jsx)(N.A,{className:"size-4 text-text-secondary",strokeWidth:1.9}),(0,n.jsx)("span",{className:"truncate",children:a.date})]}),a.time&&(0,n.jsxs)("div",{className:"mt-2 flex items-center gap-2 font-subhead-book text-[14px] text-text-secondary",children:[(0,n.jsx)(w.A,{className:"size-4 text-text-secondary",strokeWidth:1.9}),(0,n.jsx)("span",{className:"truncate",children:a.time})]}),(r||c)&&(0,n.jsxs)("div",{className:"mt-5 flex flex-wrap gap-2",children:[t.canEditEvent&&l&&(0,n.jsxs)(x.N,{href:l,shallow:!0,className:"inline-flex items-center gap-2 rounded-full bg-solid-white/10 px-4 py-2.5 font-semi text-sm text-text-primary transition-colors hover:bg-solid-white/15",children:[(0,n.jsx)(A.A,{className:"size-4"}),"Edit"]}),c&&(0,n.jsxs)(x.N,{href:i,className:"inline-flex items-center gap-2 rounded-full bg-background-inverse/[0.06] px-4 py-2.5 font-semi text-sm text-text-secondary transition-colors hover:text-text-prim
1ary",children:[(0,n.jsx)(C.A,{className:"size-4"}),"Event page"]})]})]})]})})},eX=e=>{let{guestList:t,inviteLinks:s,eventSlug:a,qrDomain:i}=e,{tenantId:l}=(0,T.BP)(),r=window.location.origin,c=s.find(e=>{var s;return e.isActive&&(null==(s=e.guestList)?void 0:s.id)===t.id}),o=c?(0,q.Wu)((0,E.dst)(r,c.code),r):"";if(!o)return null;let d=(0,E.Ae1)({username:o,referer:"event_page_web",domain:i,tenantId:l});return(0,n.jsxs)("section",{className:(0,v.A)(eM,"p-5 sm:p-6"),children:[(0,n.jsx)("h2",{className:K,children:"Walk-ups"}),(0,n.jsxs)("div",{className:"mt-4 flex flex-col items-center gap-3",children:[(0,n.jsx)(p.o,{size:150,qrImageUrl:d,alt:"QR code for ".concat(t.displayName),className:"size-[150px]",isSuperwhite:!1}),(0,n.jsxs)("p",{className:"font-subhead-book text-[13px] text-text-secondary",children:[t.displayName," \xb7 ",t.stats.checkedInGuests," scanned"]}),(0,n.jsxs)("button",{type:"button",onClick:()=>(0,q.$H)({eventSlug:a,qrUsername:o,qrDomain:i}),className:"inline-flex items-center gap-2 rounded-full bg-solid-white/10 px-4 py-2 font-semi text-[13px] text-text-primary transition-colors hover:bg-solid-white/15",children:[(0,n.jsx)(I.A,{className:"size-4"}),"Download QR"]})]})]})},e$=e=>{let{recentCheckins:t}=e;return 0===t.length?null:(0,n.jsxs)("section",{children:[(0,n.jsxs)("div",{className:Y,children:[(0,n.jsx)("h2",{className:K,children:"Live activity"}),(0,n.jsx)("span",{className:"size-2 rounded-full bg-status-success shadow-[0_0_0_4px_rgba(18,167,32,0.16)]"})]}),(0,n.jsx)("div",{className:"flex flex-col",children:t.slice(0,7).map((e,t)=>{var s,a;return(0,n.jsxs)("div",{className:(0,v.A)("flex items-center gap-3 py-3",0===t&&"pt-0"),children:[(0,n.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-status-success"}),(0,n.jsxs)("span",{className:"min-w-0 flex-1 truncate font-subhead-book text-[14px] text-text-secondary",children:[(0,n.jsx)("span",{className:"font-semi text-text-primary",children:eE(e.user)})," checked in"]}),(0,n.jsx)("span",{className:"shrink-0 font-subhead-book text-[12px] text-text-tertiary",children:(e=>e.checkedInLocalDateTime?(0,E.m5d)(e.checkedInLocalDateTime).timeShort:"Checked in")(e)})]},"".concat(e.user.id,"-").concat(null!=(a=null==(s=e.checked_in_at)?void 0:s.toString())?a:t))})})]})},e0=e=>{var t,s,a,i,l,r,c,o,d,u,m;let{filterStats:p,genderDistribution:h,guestsHref:g}=e,b=[{label:"Going",value:null!=(t=null==p?void 0:p.attending)?t:0,className:"bg-status-success"},{label:"Pending",value:null!=(s=null==p?void 0:p.waitlist.pending)?s:0,className:"bg-status-warning"},{label:"Invited",value:null!=(a=null==p?void 0:p.rsvp.invited)?a:0,className:"bg-interactive-blue"}].filter(e=>e.value>0),y=b.reduce((e,t)=>e+t.value,0),j=(null!=(i=null==h?void 0:h.other)?i:0)+(null!=(l=null==h?void 0:h.preferNotToSay)?l:0),k=(null!=(r=null==h?void 0:h.male)?r:0)+(null!=(c=null==h?void 0:h.female)?c:0)+j,N=[{label:"Female",value:null!=(o=null==h?void 0:h.female)?o:0,className:"bg-interactive-blue"},{label:"Male",value:null!=(d=null==h?void 0:h.male)?d:0,className:"bg-interactive-secondary"},{label:"Other",value:j,className:"bg-solid-white/35"}].filter(e=>e.value>0),w=[{label:"Female",value:null!=(u=null==h?void 0:h.female)?u:0,href:g?"".concat(g,"?gender=FEMALE"):null},{label:"Male",value:null!=(m=null==h?void 0:h.male)?m:0,href:g?"".concat(g,"?gender=MALE"):null},{label:"Other",value:j,href:null}].filter(e=>e.value>0);return(0,n.jsxs)("section",{className:(0,v.A)(eM,"p-5 sm:p-6"),children:[(0,n.jsx)("h2",{className:(0,v.A)(K,"mb-4"),children:"Insights"}),(0,n.jsx)("div",{className:"font-subhead-book text-[13px] text-text-secondary",children:"RSVP mix"}),(0,n.jsx)("div",{className:"mt-3 flex h-3 overflow-hidden rounded-full bg-solid-white/10",children:y>0?b.map(e=>(0,n.jsx)("div",{className:e.className,style:{width:"".concat(Math.max(4,e.value/y*100),"%")}},e.label)):(0,n.jsx)("div",{className:"size-full bg-solid-white/10"})}),(0,n.jsx)("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-2",children:b.map(e=>(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5 font-subhead-book text-[12px] text-text-secondary",children:[(0,n.jsx)("span",{className:(0,v.A)("size-2 roun
1ded-sm",e.className)}),e.label,(0,n.jsx)("span",{className:"font-semi text-text-primary",children:e.value})]},e.label))}),k>10&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"my-5 h-px bg-solid-white/10"}),(0,n.jsx)("div",{className:"mb-3 font-subhead-book text-[13px] text-text-secondary",children:"Gender distribution"}),(0,n.jsx)("div",{className:"flex flex-wrap gap-x-6 gap-y-3",children:w.map(e=>{let t,s=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("span",{className:"flex items-baseline gap-1",children:[(0,n.jsx)("span",{className:"font-semi text-xl leading-none text-text-primary",children:e.value}),(0,n.jsx)("span",{className:"font-subhead-book text-[11px] text-text-tertiary",children:(t=e.value,"".concat(Math.round(t/k*100),"%"))})]}),(0,n.jsxs)("span",{className:"mt-2 inline-flex items-center gap-0.5 font-subhead-book text-[12px] text-text-secondary",children:[e.label,e.href&&(0,n.jsx)(f.A,{className:"size-3",strokeWidth:2.2})]})]});return e.href?(0,n.jsx)(x.N,{href:e.href,shallow:!0,className:"min-w-[88px] flex-1 transition-colors hover:text-text-primary",children:s},e.label):(0,n.jsx)("div",{className:"min-w-[88px] flex-1",children:s},e.label)})}),(0,n.jsx)("div",{className:"mt-3 flex h-2 overflow-hidden rounded-full bg-solid-white/10",children:N.map(e=>(0,n.jsx)("span",{className:e.className,style:{width:"".concat(Math.max(4,e.value/k*100),"%")}},e.label))})]})]})},e1=e=>{let{event:t}=e,s=[t.creator,...t.coHosts];return(0,n.jsxs)("section",{className:(0,v.A)(eM,"p-5 sm:p-6"),children:[(0,n.jsx)("h2",{className:(0,v.A)(K,"mb-4"),children:"Hosted by"}),(0,n.jsx)("div",{className:"flex flex-col gap-4",children:s.map((e,t)=>{var s;let a=eE(e),i=null==(s=e.userItems.find(e=>"LOCATION"===e.type))?void 0:s.content;return(0,n.jsxs)(x.N,{href:"/".concat(e.username),className:"flex items-center gap-3",children:[e.avatar_url?(0,n.jsx)("img",{src:e.avatar_url,alt:"",className:"size-11 rounded-full object-cover"}):(0,n.jsx)("span",{className:"grid size-11 place-items-center rounded-full bg-interactive-secondary/20 font-semi text-text-primary",children:a.trim().split(/\s+/).slice(0,2).map(e=>{var t;return null==(t=e[0])?void 0:t.toUpperCase()}).join("")||"G"}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block truncate font-semi text-[15px] text-text-primary",children:a}),(0,n.jsx)("span",{className:"block truncate font-subhead-book text-[12px] text-text-secondary",children:null!=i?i:"@".concat(e.username)})]}),(0,n.jsx)("span",{className:"shrink-0 font-subhead-book text-[11px] text-text-tertiary",children:0===t?"Creator":"Co-host"})]},e.id)})}),(t.venue_name||t.address)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"my-5 h-px bg-solid-white/10"}),(0,n.jsx)("h2",{className:(0,v.A)(K,"mb-3"),children:"Where"}),(0,n.jsxs)("div",{className:"flex items-start gap-3",children:[(0,n.jsx)(L.A,{className:"mt-0.5 size-5 shrink-0 text-text-secondary",strokeWidth:1.9}),(0,n.jsxs)("div",{className:"min-w-0",children:[t.venue_name&&(0,n.jsx)("div",{className:"font-semi text-[15px] text-text-primary",children:t.venue_name}),t.address&&(0,n.jsx)("div",{className:"mt-1 font-subhead-book text-[13px] leading-relaxed text-text-secondary",children:t.address})]})]})]})]})},e5=e=>{var t,s;let{guestList:a,managedListCount:i}=e,l=i>1,r=Math.max(0,i-1);return(0,n.jsxs)("section",{className:"rounded-[24px] bg-interactive-secondary/[0.08] p-4 sm:p-5",children:[(0,n.jsx)("div",{className:"font-subhead-book text-[13px] text-text-secondary",children:"Managing"}),(0,n.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1.5",children:[(0,n.jsx)("span",{className:"font-role-headline text-[24px] leading-tight text-text-primary",children:null!=(t=null==a?void 0:a.displayName)?t:"Your guest list"}),l&&(0,n.jsxs)("span",{className:"rounded-full bg-interactive-secondary/15 px-2.5 py-1 font-semi text-[12px] text-text-secondary",children:["+",r," more ",1===r?"list":"lists"]})]}),(0,n.jsx)("div",{className:"mt-2 font-subhead-book text-[13px] text-text-secondary",children:l?"You manage ".concat(i," guest lists for this event â the numbers below are for ").concat(null!=(s=null==a?void 0:a.displayName)?s:"this list","."):"You can manage guests and links for this guest list."})]})},e2=e=>{let{editHref:t,publicHref:s}=e;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"mb-3 flex items-center gap-4",children:[(0,n.jsx)("span",{className:K,children:"Your event page"}),(0,n.jsx)("span",{className:"h-px flex-1 bg-background-inverse/10"})]}),(0,n.jsxs)("section",{className:"grid gap-3 pb-1 sm:grid-cols-2",children:[(0,n.jsxs)(x.N,{href:t,shallow:!0,className:"flex min-h-[118px] items-center gap-4 roun
1ded-[24px] bg-background-inverse/[0.035] p-4 transition-colors hover:bg-background-inverse/[0.055]",children:[(0,n.jsx)("span",{className:"grid size-12 shrink-0 place-items-center rounded-2xl bg-interactive-secondary/15 text-text-secondary",children:(0,n.jsx)(A.A,{className:"size-6"})}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block font-semi text-[17px] text-text-primary",children:"Finish event page"}),(0,n.jsx)("span",{className:"mt-1 block font-subhead-book text-[13px] leading-5 text-text-secondary",children:"Review the title, location, time, description, and RSVP fields before guests see it."})]}),(0,n.jsx)(f.A,{className:"size-4 shrink-0 text-text-tertiary"})]}),(0,n.jsxs)(x.N,{href:s,className:"flex min-h-[118px] items-center gap-4 rounded-[24px] bg-background-inverse/[0.035] p-4 transition-colors hover:bg-background-inverse/[0.055]",children:[(0,n.jsx)("span",{className:"grid size-12 shrink-0 place-items-center rounded-2xl bg-background-inverse/[0.06] text-text-secondary",children:(0,n.jsx)(C.A,{className:"size-6"})}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block font-semi text-[17px] text-text-primary",children:"Preview event page"}),(0,n.jsx)("span",{className:"mt-1 block font-subhead-book text-[13px] leading-5 text-text-secondary",children:"Check the page as guests will see it before you share the first link."})]}),(0,n.jsx)(f.A,{className:"size-4 shrink-0 text-text-tertiary"})]})]})]})},e4=e=>{let{event:t,state:s,guestLists:a,guestListCreationContent:i,secondaryActionsHidden:l=!1}=e,r=t.slug,c=r?(0,u.yM)(r,"guests"):"#",o=r?(0,u.yM)(r,"settings"):"#",d=r?"/event/".concat(r,"?preview=1"):"#",m="noGuestLists"===s,p=a.slice(0,2),h=!!i;return(0,n.jsxs)("div",{className:"mx-auto flex max-w-5xl flex-col gap-4",children:[!h&&(0,n.jsxs)("section",{className:(0,v.A)(eM,"px-5 py-9 text-center sm:px-8 sm:py-12"),children:[(0,n.jsx)("span",{className:"mx-auto grid size-14 place-items-center rounded-2xl bg-interactive-secondary/15 text-text-secondary",children:(0,n.jsx)(S.A,{className:"size-7",strokeWidth:1.8})}),(0,n.jsxs)("h2",{className:"mx-auto mt-5 max-w-xl font-role-headline text-[30px] leading-[1.05] text-text-primary sm:text-[36px]",children:["Get ",t.title," ready"]}),(0,n.jsx)("p",{className:"mx-auto mt-3 max-w-xl font-subhead-book text-[15px] leading-6 text-text-secondary",children:m?"Create a guest list before sharing this event. It keeps invite links, QR entry, and managers organized.":"Your guest lists are set up. Open Guests to share links, show QR entry, or customize each list."}),(0,n.jsxs)("div",{className:"mt-7 flex flex-col items-center justify-center gap-2 sm:flex-row",children:[(0,n.jsxs)(x.N,{href:c,shallow:!0,className:"inline-flex h-11 items-center justify-center gap-2 rounded-full bg-interactive-primary px-5 font-medium text-sm text-text-on-primary transition-colors hover:bg-interactive-primary-hover hover:text-text-on-primary-hover",children:[m?"Create first guest list":"Open Guests",(0,n.jsx)(f.A,{className:"size-4"})]}),(0,n.jsxs)(x.N,{href:o,shallow:!0,className:"inline-flex h-11 items-center justify-center gap-2 rounded-full bg-background-inverse/[0.055] px-5 font-medium text-sm text-text-primary transition-colors hover:bg-background-inverse/[0.085]",children:[(0,n.jsx)(A.A,{className:"size-4"}),"Edit event"]})]})]}),h&&i,!h&&p.length>0&&(0,n.jsx)("section",{className:"grid gap-3 sm:grid-cols-2",children:p.map(e=>(0,n.jsxs)(x.N,{href:"".concat(c,"?guestListId=").concat(e.id),shallow:!0,className:"flex min-h-[108px] items-center gap-4 roun
1ded-[24px] bg-background-inverse/[0.035] p-4 text-left transition-colors hover:bg-background-inverse/[0.055]",children:[(0,n.jsx)("span",{className:"grid size-12 shrink-0 place-items-center rounded-2xl bg-background-inverse/[0.06] text-text-secondary",children:"qr_first"===e.layout?(0,n.jsx)(b.A,{className:"size-6"}):(0,n.jsx)(S.A,{className:"size-6"})}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"block truncate font-semi text-[17px] text-text-primary",children:e.displayName}),(0,n.jsx)("span",{className:"mt-1 line-clamp-2 block font-subhead-book text-[13px] leading-5 text-text-secondary",children:"qr_first"===e.layout?"Show the QR-first entry flow.":"Create a share link for this list."})]}),(0,n.jsx)(f.A,{className:"size-4 shrink-0 text-text-tertiary"})]},e.id))}),(0,n.jsx)("div",{"aria-hidden":l,className:(0,v.A)("grid transition-all duration-300 ease-out",l?"pointer-events-none grid-rows-[0fr] opacity-0":"grid-rows-[1fr] opacity-100"),children:(0,n.jsx)("div",{className:"min-h-0 overflow-hidden",children:(0,n.jsx)("div",{className:(0,v.A)("origin-top transition-transform duration-300 ease-[cubic-bezier(0.34,1.5,0.6,1)]",l?"scale-[0.98]":"scale-100"),children:(0,n.jsx)(e2,{editHref:o,publicHref:d})})})})]})},e3=e=>{var t,s,a,r,c,o,d,p,b,y,j,k,N,w,A,C,I,L,S,_,P,O,H,D,U,Q,R,W,V,q,B,K;let{event:Y}=e,J=(0,l.useRouter)(),Z=g.FH.useUtils(),X=!1!==Y.is_active,$="guestList"===Y.guestManagementScope,ei=$?Y.guestListId:void 0,el=!0===Y.canManageGuests||!0===Y.canViewOwnGuests,[er,ec]=(0,i.useState)(""),[eo,ed]=(0,i.useState)(!1),[eu,ex]=(0,i.useState)(!1),[em,ep]=(0,i.useState)(null),[eh,ev]=(0,i.useState)(!1),[ef,eb]=(0,i.useState)(!1),[ey,ej]=(0,i.useState)("single"),[ek,eN]=(0,i.useState)(null),[ew,eA]=(0,i.useState)(""),[eC,eI]=(0,i.useState)(null),[eS,eE]=(0,i.useState)([]),[eG,eF]=(0,i.useState)(null),[eP,eO]=(0,i.useState)(""),eH=(0,h.d)(ew,300,""),{data:eR}=g.FH.events.summaryStats.useQuery({eventId:Y.id,...ei?{guestListId:ei}:void 0},{enabled:X}),{data:eV,isLoading:e3}=g.FH.events.filterStats.useQuery({eventId:Y.id,...ei?{guestListId:ei}:void 0},{enabled:X}),e6=!0===Y.ticketing_enabled&&(null!=(a=null==(t=Y.ticket_types)?void 0:t.length)?a:0)>0,{data:e8}=g.FH.events.ticketSalesSummary.useQuery({eventId:Y.id},{enabled:X&&e6&&!$&&!0===Y.canManageGuests}),{data:e9}=g.FH.events.guestListSalesSummary.useQuery({eventId:Y.id},{enabled:X&&e6&&(!0===Y.canManageGuests||$)}),e7=e9?(0,n.jsx)(et,{summary:e9,promoter:$}):null,te=g.FH.events.setTicketSalesEnabled.useMutation({onSuccess:async()=>{M.Ay.success("Sales are open"),await Promise.all([Z.events.ticketSalesSummary.invalidate({eventId:Y.id}),Z.events.get.invalidate()])},onError:e=>(0,g.JA)(e,"Could not open sales")}),tt=!0===Y.canConfigureTicketing?()=>te.mutate({eventId:Y.id,enabled:!0}):void 0,ts=(null!=(r=null==eV?void 0:eV.rsvp.going)?r:0)+(null!=(c=null==eV?void 0:eV.rsvp.maybe)?c:0)+(null!=(o=null==eV?void 0:eV.rsvp.cantGo)?o:0)+(null!=(d=null==eV?void 0:eV.rsvp.invited)?d:0),{data:tn}=g.FH.events.genderDistribution.useQuery({eventId:Y.id,...ei?{guestListId:ei}:void 0},{enabled:X&&el&&ts>10}),{data:ta}=g.FH.eventAttendees.getGuestList.useQuery({eventId:Y.id,attending:!0,page:1,limit:14,...ei?{guestListId:ei}:void 0},{enabled:X&&el}),ti="checkingIn"===Y.managePreviewState?"checkingIn":"pastEvent"===Y.managePreviewState?"past":"buildingGuestLists"===Y.managePreviewState?"building":!0===Y.eventHasEnded?"past":!0===Y.canUseHostCheckIn&&(null!=(p=null==eR?void 0:eR.checkedIn)?p:0)>0?"checkingIn":"building",tl={eventId:Y.id,page:1,limit:4,...ei?{guestListId:ei}:void 0},tr=X&&el&&!$&&void 0!==eR,tc="building"!==ti,{data:to}=g.FH.eventAttendees.getGuestList.useQuery({...tl,attending:!0,checkedIn:!0},{enabled:tr&&tc&&eR.checkedIn>0}),{data:td}=g.FH.eventAttendees.getGuestList.useQuery({...tl,attending:!0,checkedIn:!1},{enabled:tr&&tc&&eR.attending>eR.checkedIn}),{data:tu}=g.FH.eventAttendees.getGuestList.useQuery({...tl,waitlistStatus:G.EventWaitlistStatus.PENDING},{enabled:tr&&"building"===ti&&eR.pendingApproval>0}),{data:tx}=g.FH.eventAttendees.getRecentCheckins.useQuery({eventId:Y.id,page:1,limit:7},{enabled:X&&!$&&!0===Y.canViewHostCheckInResults}),{data:tm,isLoading:tp}=g.FH.eventGuestLists.list.useQuery({eventId:Y.id},{enabled:X&&(!0===Y.canInviteUsers||!0===Y.canManageOwnInviteLinks)}),{data:th,isLoading:tg,refetch:tv}=g.FH.eventInviteLinks.list.useQuery({eventId:Y.id,page:1,limit:100},{enabled:X&&!$&&(!0===Y.canInviteUsers||!0===Y.canManageOwnInviteLinks)}),{data:tf,isLoading:tb}=g.FH.eventAttendees.getEmailInviteStats.useQuery({eventId:Y.id},{enabled:X&&!$&&(!0===Y.canManageGuests||!0===Y.canInviteUsers)}),{data:ty,isFetching:tj}=g.FH.eventGuestLists.searchEligibleUsers.useQuery({eventId:Y.id,guestListId:null!=eC?eC:void 0,query:eH,limit:20,page:1},{enabled:X&&!!eC&&eH.length>=2}),tk=g.FH.eventGuestLists.create.useMutation(),tN=g.FH.eventInviteLinks.create.useMutation(),tw=g.FH.eventGuestLists.addManager.useMutation(),tA=g.FH.eventGuestLists.inviteManagerByLink.useMutation(),tC=g.FH.eventGuestLists.update.useMutation({onSuccess:()=>
1{Z.eventGuestLists.list.invalidate({eventId:Y.id}),Z.events.summaryStats.invalidate({eventId:Y.id}),Z.events.filterStats.invalidate({eventId:Y.id}),eF(null),M.Ay.success("Guest list capacity updated")},onError:e=>{(0,g.JA)(e,"Failed to update guest list capacity")}}),tI=g.FH.events.update.useMutation({onSuccess:()=>{Z.events.get.invalidate({id:Y.id}),Z.events.summaryStats.invalidate({eventId:Y.id}),Z.events.filterStats.invalidate({eventId:Y.id}),eF(null),M.Ay.success("Event capacity updated")},onError:e=>{(0,g.JA)(e,"Failed to update event capacity")}});(0,i.useEffect)(()=>{ec(window.location.origin)},[]),(0,i.useEffect)(()=>{eO(eG?eG.nextCapacity.toString():"")},[eG]);let tL=new URL((0,T.BP)().requestOrigin).hostname,tS=(0,E.Y8J)({ticketingEnabled:Y.ticketing_enabled,ticketTypes:Y.ticket_types}),tz=null!=(b=null==eR?void 0:eR.attending)?b:0,tM=null!=(y=null==eR?void 0:eR.checkedIn)?y:0,tE=null!=(j=null==eR?void 0:eR.pendingApproval)?j:0,tG=!0===Y.eventHasEnded,tT=null!=(k=null==eR?void 0:eR.overbookedCount)?k:0,tF=null!=(N=null==eR?void 0:eR.spotsRemaining)?N:null,t_=null!=(w=null==eR?void 0:eR.capacity)?w:null,tP=null!=(A=null==ta?void 0:ta.attendees)?A:[],tO=(0,i.useMemo)(()=>{var e;return null!=(e=null==tm?void 0:tm.guestLists)?e:[]},[null==tm?void 0:tm.guestLists]),tH=!0===Y.canInviteUsers&&(null==(s=Y.eventSeries)?void 0:s.canApplyFutureScope)===!0,tD=tH?ey:"single",tU=(null!=(C=null==tf?void 0:tf.waiting)?C:0)+(null!=(I=null==tf?void 0:tf.needsAttention)?I:0)+(null!=(L=null==tf?void 0:tf.expired)?L:0),tQ=null!=(S=null==th?void 0:th.inviteLinks.filter(e=>e.isActive).length)?S:0,tR="brandNew"===Y.managePreviewState?"noGuestLists":$||void 0===tm||void 0===th||void 0===tf||void 0===eV?null:(0,E.pfS)({guestListCount:tO.filter(e=>"ACTIVE"===e.guestListStatus).length,inviteLinkCount:tQ,emailInviteCount:tU,attendeeCount:ts}),tW="brandNew"!==Y.managePreviewState&&!$&&null===tR&&(tp||tg||tb||e3),tV=(0,i.useMemo)(()=>{var e;return null!=(e=tO.find(e=>e.id===Y.guestListId))?e:null},[tO,Y.guestListId]),tq={event:Y,attending:tz,pendingApproval:tE,checkedIn:tM,capacity:t_,spotsRemaining:tF,overbooked:tT,attendees:tP,genderDistribution:tn},tB=Y.slug?(0,u.yM)(Y.slug,"guests"):null,tK=(0,E.dc8)(Y)&&!tG&&null!==tB,tY=(0,i.useMemo)(()=>{if(!tK||!tB)return null;let e=(0,E.k4S)({id:Y.id,title:Y.title,capacity:t_,spotsRemaining:tF,pendingApproval:tE,overbooked:tT});return e?{...e,reviewHref:e.pendingApprovalCount>0?"".concat(tB,"?waitlistStatus=").concat(G.EventWaitlistStatus.PENDING):void 0}:null},[tK,t_,Y.id,Y.title,tB,tT,tE,tF]),tJ=(0,i.useMemo)(()=>tK&&tB?(0,E.XwJ)(tO).map(e=>({...e,reviewHref:e.pendingApprovalCount>0?"".concat(tB,"?guestListId=").concat(encodeURIComponent(e.id),"&waitlistStatus=").concat(G.EventWaitlistStatus.PENDING):void 0})):[],[tK,tO,tB]),tZ=tO.length>1&&tO.some(e=>(0,E.TlE)(e.stats)),tX=(e=>{let{attending:t,checkedIn:s}=e,n=Math.max(t,s),a=n>0?Math.min(1,s/n):0;return{target:n,percentage:Math.round(100*a)}})({attending:tz,checkedIn:tM}),t$=!Y.canUseHostCheckIn&&Y.canViewHostCheckInResults&&Y.slug?(0,n.jsx)(eT,{checkedIn:tM,target:tX.target,percentage:tX.percentage,href:"".concat((0,u.yM)(Y.slug,"guests"),"?checkedInOnly=1"),recentCheckins:null!=(_=null==tx?void 0:tx.users)?_:[],className:(0,v.A)(eM,"p-5 sm:p-6")}):null,t0=null!=(P=tO.find(e=>"qr_first"===e.layout))?P:null,t1=Math.max(0,tz-tM),t5=Math.max(0,tX.target-tM),t2=e_(tn),t4=(null!=(O=null==eV?void 0:eV.rsvp.invited)?O:0)+tU,t3=tO.filter(e=>"ACTIVE"===e.guestListStatus).length,t6={label:"Waitlist",value:tE,action:tE>0&&tB?{label:"Review now",href:"".concat(tB,"?waitlistStatus=").concat(G.EventWaitlistStatus.PENDING)}:void 0},t8=e8&&0===tE?{label:"Tickets sold",value:null!==e8.quota?"".concat(e8.sold," / ").concat(e8.quota):e8.sold}:t6,t9="past"===ti?{tiles:[{label:"Came",value:tM,href:tB?"".concat(tB,"?checkedInOnly=1"):void 0},{label:"No-shows",value:t1}],wide:{label:"Turnout",value:"".concat(tX.percentage,"%")}}:"checkingIn"===ti?{tiles:[{label:"Guests in",value:tM,href:tB?"".concat(tB,"?checkedInOnly=1"):void 0},{label:"Guests to come",value:t5}],wide:tE>0?t6:{label:"Through the door",value:"".concat(tX.percentage,"%"),action:!0===Y.canUseHostCheckIn&&Y.slug?{label:"Open scanner",href:(0,u.yM)(Y.slug,"checkin")}:void 0}}:{tiles:[{label:"Going",value:tz,href:el&&tB?"".concat(tB,"?attending=1"):void 0},tT>0?{label:"Overbooked",value:tT}:null!==t_&&"number"==typeof tF?{label:"RSVPs left",value:tF}:t4>0?{label:"Invited",value:t4,href:el&&tB?"".concat(tB,"?attendeeStatus=").concat(G.EventAttendeeStatus.INVITED):void 0}:{label:"Guest lists",value:t3}],wide:t8},t7=[];if("past"!==ti){for(let e of("building"===ti&&e8&&!e8.salesEnabled&&t7.push({key:"ticket-sales-closed",kind:"alert",title:"Sales are closed",body:"Guests can't buy yet.",actions:tt&&(0,n.jsx)("button",{type:"button",onClick:tt,disabled:te.isPending,className:(0,v.A)(eU,"disabled:opacity-60"),children:te.isPending?"Openingâ¦":"Open sales"})}),tY?[tY]:[]))t7.push({key:"capacity-".concat(e.type,"-").concat(e.id),kind:"alert",title:e.title,body:e.body,actions:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",onClick:()=>eF(e),className:eU,children:"Increase capacity"}),e.reviewHref&&(0,n.jsx)(x.N,{href:e.reviewHref,shallow:!0,className:eQ,children:"Review pending"})]})});"checkingIn"===ti&&Y.slug&&t7.push({key:"check-in",kind:"shortcut",title:"Checking guests in",body:"Scan tickets at the door, or find someone by name when they arrive without a link.",actions:(0,n.jsxs)(n.Fragment,{children:[!0===Y.canUseHostCheckIn&&(0,n.jsx)(x.N,{href:(0,u.yM)(Y.slug,"checkin"),shallow:!0,className:eU,children:"Open scanner"}),tB&&(0,n.jsx)(x.N,{href:tB,shallow:!0,className:eQ,children:"Search a name"})]})})}let se=[...t7].sort((e,t)=>
1e.kind===t.kind?0:"alert"===e.kind?-1:1),st=el&&tB?"".concat(tB,"?attending=1"):void 0,ss=el&&tB?"".concat(tB,"?waitlistStatus=").concat(G.EventWaitlistStatus.PENDING):void 0,sn=el&&tB?"".concat(tB,"?checkedInOnly=1"):void 0,sa=null!=(H=null==to?void 0:to.attendees)?H:[],si=null!=(D=null==td?void 0:td.attendees)?D:[],sl="past"===ti?(0,n.jsx)(eW,{title:"Who came",note:t2,groups:[{label:"Came",count:tM,attendees:sa,href:sn},{label:"No-shows",count:t1,attendees:si}]}):"checkingIn"===ti?(0,n.jsx)(eW,{title:"Who's here",note:t2,groups:[{label:"Arrived",count:tM,attendees:sa,href:sn},{label:"Still to come",count:t5,attendees:si}]}):(0,n.jsx)(eW,{title:"Who's coming",note:t2,groups:[{label:"Going",count:tz,attendees:tP,href:st},{label:"Waitlist",count:tE,attendees:null!=(U=null==tu?void 0:tu.attendees)?U:[],href:ss}]}),sr="checkingIn"===ti&&t0?(0,n.jsx)(eX,{guestList:t0,inviteLinks:null!=(Q=null==th?void 0:th.inviteLinks)?Q:[],eventSlug:Y.slug,qrDomain:tL}):null,sc=void 0!==tm?(0,n.jsx)(ee,{eventId:Y.id,eventSlug:Y.slug,qrDomain:tL,guestLists:tO,salesSummary:e9,inviteLinks:null!=(R=null==th?void 0:th.inviteLinks)?R:[],guestsHref:tB,canCreate:!0===Y.canInviteUsers,onCreate:()=>ep({id:"createGuestList-".concat(Date.now()),type:"createGuestList"}),onEdit:e=>ep({id:"editGuestList-".concat(e,"-").concat(Date.now()),type:"editGuestList",guestListId:e}),refetchInviteLinks:tv,mode:"building"===ti?"manage":"checkin",isPastEvent:"past"===ti,capacityWarningListIds:"past"===ti?void 0:new Set(tJ.map(e=>e.id)),onInvite:(0,E.M24)(Y)&&tO.some(e=>"ACTIVE"===e.guestListStatus)?()=>ex(!0):void 0,onIncreaseCapacity:e=>{let t=tJ.find(t=>t.id===e);t&&eF(t)},ticketTypes:e6&&null!=(W=Y.ticket_types)?W:[]}):null,so=(0,n.jsx)(es.m,{event:Y,mode:"controller",externalAction:em,onInviteLinkDialogClose:()=>ep(null)}),sd=(0,i.useCallback)(async(e,t)=>{var s,n,a,i;ev(!0),ej(t),eE([]);let l=await tk.mutateAsync((0,F.Q)({eventId:Y.id,name:e.name,layout:e.layout,maxGuestCount:e.maxGuestCount,maxTicketsPerGuest:e.maxTicketsPerGuest,guestListClosesAt:null,eventTicketTypeId:e.eventTicketTypeId,ticketPriceOverrideCents:e.ticketPriceOverrideCents,createDefaultLink:!e.createsGuestLink},tH?t:"single")),r=l.guestList;eI(r.id);let c=null,o=null;if(e.createsGuestLink){let t=e.linkPresetKey?E.Vaz.find(t=>t.key===e.linkPresetKey):void 0;try{let i=await tN.mutateAsync({eventId:Y.id,guestListId:r.id,description:e.automaticCheckIn?"".concat(r.displayName," QR"):null!=(s=null==t?void 0:t.label)?s:"".concat(r.displayName," link"),maxUses:null!=(n=null==t?void 0:t.maxUses)?n:void 0,skipWaitlist:null==(a=null==t?void 0:t.skipWaitlist)||a,automaticCheckIn:e.automaticCheckIn});c={id:i.id,code:i.code,shortlink:i.shortlink,automaticCheckIn:i.automaticCheckIn,skipWaitlist:i.skipWaitlist}}catch(e){o="Guest List created, but the sharing link was not created. Add a link from Guests.",(0,g.JA)(e,"Guest List created, but link creation failed")}}await Promise.all([Z.eventGuestLists.list.invalidate({eventId:Y.id}),Z.eventInviteLinks.list.invalidate({eventId:Y.id}),Z.eventInviteLinks.stats.invalidate({eventId:Y.id}),Z.events.summaryStats.invalidate({eventId:Y.id}),Z.events.filterStats.invalidate({eventId:Y.id}),Z.events.guestListSalesSummary.invalidate({eventId:Y.id})]);let d=null!=(i=(e=>{if(!e||"object"!=typeof e||!("skippedOccurrences"in e))return;let t=e.skippedOccurrences;return Array.isArray(t)?t:void 0})(l))?i:[];return eE(d),{guestList:{id:r.id,displayName:r.displayName,layout:r.layout},inviteLink:c,linkErrorMessage:o,skippedOccurrences:d}},[tk,tN,tH,Y.id,Z.eventGuestLists.list,Z.eventInviteLinks.list,Z.eventInviteLinks.stats,Z.events.filterStats,Z.events.guestListSalesSummary,Z.events.summaryStats]),su=(0,i.useCallback)(async e=>tH?(ej("single"),new Promise((t,s)=>{eN({input:e,resolve:t,reject:s})})):sd(e,"single"),[tH,sd]),sx=(0,i.useCallback)(()=>{eN(null),null==ek||ek.reject(new ea.rK)},[ek]),sm=(0,i.useCallback)(()=>{ek&&(eN(null),sd(ek.input,ey).then(ek.resolve,ek.reject))},[sd,ey,ek]),sp=(0,i.useCallback)(async e=>{let{guestListId:t,userIds:s}=e;await Promise.all(s.map(e=>tw.mutateAsync((0,F.Q)({guestListId:t,userId:e}
1,tD)))),await Z.eventGuestLists.list.invalidate({eventId:Y.id})},[tw,Y.id,tD,Z.eventGuestLists.list]),sh=(0,i.useCallback)(async e=>{var t,s;let n=await tA.mutateAsync((0,F.Q)({guestListId:e},tD));return await Z.eventGuestLists.list.invalidate({eventId:Y.id}),null!=(s=null==(t=n.guestList.claimInviteLink)?void 0:t.shortlink)?s:null},[Y.id,tD,tA,Z.eventGuestLists.list]),sg=(0,i.useCallback)(e=>{Y.slug&&J.push("".concat((0,u.yM)(Y.slug,"guests"),"?guestListId=").concat(encodeURIComponent(e.guestList.id)),void 0,{scroll:!1}),ev(!1),eb(!1),eA(""),eI(null)},[Y.slug,J]),sv=$&&(0,E.M24)(Y)&&tO.length>0,sf=()=>{Z.events.summaryStats.invalidate(),Z.events.genderDistribution.invalidate(),Z.events.filterStats.invalidate(),Z.eventGuestLists.list.invalidate()},sb=sv?tO.length>1?(0,n.jsxs)("button",{type:"button",onClick:()=>ed(!0),className:"inline-flex h-12 items-center justify-center gap-2 self-start rounded-full bg-interactive-primary px-5 font-semi text-sm text-text-on-primary transition-colors hover:bg-interactive-primary-hover hover:text-text-on-primary-hover",children:[(0,n.jsx)(z.A,{className:"size-4",strokeWidth:2}),"Invite guests"]}):(0,n.jsx)(eL,{event:Y,guestLists:tO,initialListId:Y.guestListId,qrDomain:tL,onInvitesChanged:sf}):null,sy=sv&&tO.length>1?(0,n.jsx)(m.aF,{isOpen:eo,onClose:()=>ed(!1),header:"Invite guests",isCentered:!0,mobilePresentation:"fullScreen",panelClassName:"sm:!max-w-2xl",children:(0,n.jsx)(eL,{event:Y,guestLists:tO,initialListId:Y.guestListId,qrDomain:tL,bare:!0,onInvitesChanged:sf})}
1):null,sj=tC.isPending||tI.isPending,sk=(e=>{let t=e.trim();if(!/^\d+$/.test(t))return null;let s=Number.parseInt(t,10);return s>=1?s:null})(eP),sN=eG&&null!==sk?sk<=eG.currentCapacity?"Enter a capacity higher than ".concat(eG.currentCapacity,"."):null:eG?"Enter a whole number.":null,sw=null!==eG&&null!==sk&&null===sN,sA=(0,i.useCallback)(()=>{if(eG&&null!==sk&&!(sk<=eG.currentCapacity)){if("event"===eG.type)return void tI.mutate({eventId:Y.id,capacity:sk});tC.mutate({guestListId:eG.id,maxGuestCount:sk})}},[eG,Y.id,sk,tI,tC]),sC=(0,n.jsx)(m.aF,{isOpen:null!==eG,onClose:()=>{sj||eF(null)},header:eG?"Increase ".concat("event"===eG.type?"event":eG.label," capacity"):"Increase capacity",subtitle:eG?"Current capacity: ".concat(eG.currentCapacity):void 0,isCentered:!0,mobilePresentation:"fullScreen",panelClassName:"sm:max-w-md",footer:eG?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m.jL,{title:"Cancel",variant:"secondary",onClick:()=>eF(null),disabled:sj}),(0,n.jsx)(m.jL,{title:sj?"Updating...":sk?"Increase to ".concat(sk):"Increase capacity",onClick:sA,disabled:sj||!sw,className:"!bg-solid-white !text-solid-black hover:!bg-solid-white/90 disabled:!bg-background-inverse/10 disabled:!text-text-secondary disabled:!opacity-60 disabled:hover:!bg-background-inverse/10"})]}):null,children:eG&&(0,n.jsxs)("div",{className:"space-y-5",children:[(0,n.jsxs)("label",{className:"block",children:[(0,n.jsx)("span",{className:"font-semi text-sm text-text-primary",children:"New capacity"}),(0,n.jsx)("input",{type:"number",inputMode:"numeric",min:eG.currentCapacity+1,value:eP,onChange:e=>eO(e.target.value),className:"mt-2 h-12 w-full rounded-2xl border-0 bg-solid-white/[0.06] px-4 font-semi text-base text-text-primary outline-none transition-colors placeholder:text-text-tertiary",autoFocus:!0})]}),(0,n.jsx)("div",{className:"min-h-5 text-sm leading-5 text-text-secondary",children:sN?(0,n.jsx)("span",{className:"text-status-error",children:sN}):sk?(0,n.jsxs)(n.Fragment,{children:["Adds ",sk-eG.currentCapacity," spots."]}):null})]})});if($)return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex flex-col gap-4 lg:hidden",children:[(0,n.jsx)(e5,{guestList:tV,managedListCount:tO.length}),(0,n.jsx)(eZ,{event:Y,hidePublicLink:!0}),(0,n.jsx)(eB,{...tq}),e7,sb,(0,n.jsx)(eK,{event:Y}),(0,n.jsx)(eJ,{event:Y,eventHasExpired:tG,pendingApproval:tE}),tZ&&(0,n.jsx)(e0,{filterStats:eV,genderDistribution:tn,guestsHref:tB}),t$,(0,n.jsx)(e1,{event:Y})]}),(0,n.jsxs)("div",{className:"hidden gap-4 lg:grid lg:grid-cols-[minmax(0,1.55fr)_minmax(360px,1fr)]",children:[(0,n.jsxs)("aside",{className:"order-2 flex flex-col gap-4",children:[(0,n.jsx)(eZ,{event:Y,hidePublicLink:!0}),(0,n.jsx)(e1,{event:Y})]}),(0,n.jsxs)("main",{className:"order-1 flex min-w-0 flex-col gap-4",children:[(0,n.jsx)(e5,{guestList:tV,managedListCount:tO.length}),(0,n.jsx)(eB,{...tq}),e7,sb,(0,n.jsx)(eK,{event:Y}),(0,n.jsx)(eJ,{event:Y,eventHasExpired:tG,pendingApproval:tE}),tZ&&(0,n.jsx)(e0,{filterStats:eV,genderDistribution:tn,guestsHref:tB}),t$]})]}),sy]});if(X&&e6&&!0===Y.canManageGuests&&!eh&&("noGuestLists"===tR||"guestListsReady"===tR)&&Y.slug){let e=(0,u.yM)(Y.slug,"settings");return(0,n.jsx)(ez,{slug:Y.slug,isPrivate:!0===Y.is_private,origin:er,ticketSales:e8,salesByList:e7,ticketsEditHref:!0===Y.canConfigureTicketing?"".concat(e,"#event-settings-tickets"):void 0,onOpenSales:tt,isOpeningSales:te.isPending,guestLists:tO.filter(e=>"ACTIVE"===e.guestListStatus).map(e=>{var t;return{id:e.id,displayName:e.displayName,ticketLabel:(0,E.Fmz)(e.eventTicketTypeId,null!=(t=Y.ticket_types)?t:[],e.ticketPriceOverrideCents),salesLabel:(()=>{let t=null==e9?void 0:e9.lists.find(t=>t.guestListId===e.id);return t&&e9?"".concat(t.sold," sold \xb7 ").concat((0,E.WBs)(t.revenueCents,e9.currency)):null})()}}),guestsHref:(0,u.yM)(Y.slug,"guests"),onAddGuestList:!0===Y.canInviteUsers?()=>ev(!0):void 0,eventPageShortcuts:(0,n.jsx)(e2,{editHref:e,publicHref:"/event/".concat(Y.slug,"?preview=1")})})}if(("noGuestLists"===tR||eh)&&!0===Y.canInviteUsers)return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e4,{event:Y,state:"noGuestLists",guestLists:tO,secondaryActionsHidden:ef,guestListCreationContent:(0,n.jsxs)(n.Fragment,{children:[e6&&!ef?(0,n.jsxs)("button",{type:"button",onClick:()=>ev(!1),className:"inline-flex items-center gap-1 self-start font-medium text-sm text-text-secondary transition-colors hover:text-text-primary",children:[(0,n.jsx)(f.A,{className:"size-4 rotate-180"}),"Back to tickets"]}):null,(0,n.jsx)(ea.kN,{mode:"embedded",eventTitle:Y.title,eventSlug:Y.slug,eventStartDate:Y.date,eventCapacity:Y.capacity,eventTicketTypes:tS,qrDomain:tL,managerSearchQuery:ew,managerSearchResults:null!=(q=null==ty?void 0:ty.users)?q:[],isManagerSearchPending:tj,onManagerSearchQueryChange:eA,onCreate:su,onAddManagers:sp,onInviteManagerByLink:sh,onActiveChange:eb,onDone:sg,seriesSkippedOccurrences:eS})]})}),tH?(0,n.jsx)(m.aF,{isOpen:null!==ek,onClose:sx,header:"Create guest list",subt
1itle:"Choose where this guest list should be created.",isCentered:!0,mobilePresentation:"bottomSheet",panelClassName:"sm:max-w-[560px]",footer:(0,n.jsxs)("div",{className:"flex w-full gap-2",children:[(0,n.jsx)(m.jL,{variant:"secondary",title:"Back",onClick:sx}),(0,n.jsx)(m.jL,{title:"Create guest list",onClick:sm})]}),children:(0,n.jsx)(F.H,{value:ey,onChange:ej,futureOccurrenceCount:null==(V=Y.eventSeries)?void 0:V.futureOccurrenceCount,label:"Create on"})}):null]});if(tW)return(0,n.jsx)(eq,{});if(!X)return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex flex-col gap-4 lg:hidden",children:[(0,n.jsx)(eY,{}),(0,n.jsx)(eZ,{event:Y}),(0,n.jsx)(e1,{event:Y})]}),(0,n.jsxs)("div",{className:"hidden gap-4 lg:grid lg:grid-cols-[minmax(0,1.55fr)_minmax(360px,1fr)]",children:[(0,n.jsxs)("aside",{className:"order-2 flex flex-col gap-4",children:[(0,n.jsx)(eZ,{event:Y}),(0,n.jsx)(e1,{event:Y})]}),(0,n.jsx)("main",{className:"order-1 flex min-w-0 flex-col gap-4",children:(0,n.jsx)(eY,{})})]})]});if("noGuestLists"===tR||"guestListsReady"===tR)return(0,n.jsx)(e4,{event:Y,state:tR,guestLists:tO});let sI=e8?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(en,{summary:e8,mode:"checkingIn"===ti?"door":"past"===ti?"past":"sales",editHref:!0===Y.canConfigureTicketing&&Y.slug?"".concat((0,u.yM)(Y.slug,"settings"),"#event-settings-tickets"):void 0}),e7]}):null,sL=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eD,{tiles:t9.tiles,wide:t9.wide,attentionItems:se}),sI,sc]});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex flex-col gap-16 pt-2 lg:hidden",children:[(0,n.jsx)(eD,{tiles:t9.tiles,wide:t9.wide,attentionItems:se}),sI,sc,sl,sr,"building"===ti&&t$,"past"!==ti&&(0,n.jsx)(e$,{recentCheckins:null!=(B=null==tx?void 0:tx.users)?B:[]}),"building"===ti&&(0,n.jsx)(eK,{event:Y})]}),(0,n.jsxs)("div",{className:"hidden gap-x-12 gap-y-10 pt-2 lg:grid lg:grid-cols-[minmax(0,1.55fr)_minmax(360px,1fr)]",children:[(0,n.jsxs)("aside",{className:"order-2 flex flex-col gap-16",children:[sr,sl,"past"!==ti&&(0,n.jsx)(e$,{recentCheckins:null!=(K=null==tx?void 0:tx.users)?K:[]}),"building"===ti&&t$]}),(0,n.jsxs)("main",{className:"order-1 flex min-w-0 flex-col gap-16",children:[sL,"building"===ti&&(0,n.jsx)(eK,{event:Y})]})]}),sC,so,(0,n.jsx)(m.aF,{isOpen:eu,onClose:()=>ex(!1),header:"Invite guests",isCentered:!0,mobilePresentation:"fullScreen",panelClassName:"sm:!max-w-lg",children:eu&&(0,n.jsx)(eg,{event:Y,guestLists:tO.filter(e=>"ACTIVE"===e.guestListStatus).sort((e,t)=>{var s,n;return(null!=(s=t.maxGuestCount)?s:1/0)-(null!=(n=e.maxGuestCount)?n:1/0)||e.displayName.localeCompare(t.displayName)}),qrDomain:tL,onInvitesChanged:()=>{Z.eventGuestLists.list.invalidate({eventId:Y.id}),Z.events.summaryStats.invalidate({eventId:Y.id}),Z.events.filterStats.invalidate({eventId:Y.id})}})})]})};var e6=s(38520);let e8=["overview","guests","blasts","checkin","settings"];var e9=!0;let e7=(0,a.X3)(function(e){var t;let{event:s,initialTab:a,requestOrigin:x,ogImageUrl:m,tenantDomain:p}=e,h=(0,l.useRouter)(),g=null!=(t=(e=>{let[t,s]=Array.isArray(e)?e:e?[e]:[];return s?null:t?e8.includes(t)?t:null:"overview"})(h.query.tab))?t:a,v=(0,u.$H)(s).includes(g)?g:a,f=((e,t)=>{let s=(0,E.NkW)(e.description);return"guests"===t?{title:"Guests | ".concat(e.title),description:s||"Manage guests for ".concat(e.title)}:"blasts"===t?{title:"Blasts | ".concat(e.title),description:"Send announcements to guests of ".concat(e.title)}:"checkin"===t?{title:"Check-in | ".concat(e.title),description:"Check in guests for ".concat(e.title)}:"settings"===t?{title:"Settings | ".concat(e.title),description:"Edit ".concat(e.title)}:{title:"Manage | ".concat(e.title),description:"Manage ".concat(e.title)}})(s,v),b=(0,E.Nbw)((0,u.yM)(s.slug,v),{fallbackOrigin:x});return(0,i.useEffect)(()=>{g!==v&&s.slug&&h.replace((0,u.yM)(s.slug,v),void 0,{shallow:!0,scroll:!1})},[v,s.slug,g,h]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(e6.t,{title:f.title,description:f.description,url:b,type:"website",image:m}),"overview"===v&&(0,n.jsx)(u.U_,{event:s,activeTab:"overview",contentClassName:"max-w-screen-xl",children:(0,n.jsx)(e3,{event:s})}),"guests"===v&&(0,n.jsx)(u.U_,{event:s,activeTab:"guests",children:(0,n.jsx)(d.b,{event:s})}),"blasts"===v&&(0,n.jsx)(o.V,{event:s}),"checkin"===v&&(0,n.jsx)(r.R,{event:s,tenantDomain:p}),"settings"===v&&(0,n.jsx)(u.U_,{event:s,activeTab:"settings",children:(0,n.jsx)(c.m,{initialEvent:s,embedded:!0})})]})})},28345:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(66940).A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]])},55424:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/event/[slug]/manage/[[...tab]]",function(){return s(19487)}])},84804:(e,t,s)=>{"use strict";s.d(t,{V:()=>g});var n=s(6029),a=s(90033),i=s(50212),l=s(24044),r=s(4094),c=s(39105);let o=(0,s(66940).A)("circle-minus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);var d=s(40347),u=s(84311),x=s(7194),m=s(11790),p=s(36367);let h=e=>{let{status:t}=e;switch(t){case"SENT":return(0,n.jsx)(l.A,{className:"size-3.5"});case"PARTIAL":case"FAILED":return(0,n.jsx)(r.A,{className:"size-3.5"});case"QUEUED":case"PROCESSING":return(0,n.jsx)(c.A,{className:"size-3.5"});case"SKIPPED":return(0,n.jsx)(o,{className:"size-3.5"})}},g=e=>{var t;let{event:s}=e,{data:l}=a.FH.eventBlasts.listHistory.useQuery({eventId:s.id,limit:10}),r=null!=(t=null==l?void 0:l.items)?t:[];return(0,n.jsx)(p.U_,{event:s,activeTab:"blasts",children:(0,n.jsxs)("div",{className:"w-full max-w-[880px]",children:[(0,n.jsx)(m.R,{event:s,presentation:"inline"}),r.length>0?(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:(0,i.A)("font-inter-semibold text-[11px] uppercase tracking-[0.22px] text-text-secondary","mb-3"),children:"Recent blasts"}),(0,n.jsx)("div",{className:"flex flex-col gap-3",children:r.map(e=>(0,n.jsx)(v,{blast:e},e.id))})]}):(0,n.jsxs)("div",{className:"flex flex-col items-center gap-3 rounded-3xl bg-background-inverse/5 px-6 py-12 text-center ring-1 ring-inset ring-background-inverse/5",children:[(0,n.jsx)("p",{className:"font-subhead text-lg text-text-primary",children:"No blasts yet"}),(0,n.jsx)("p",{className:"max-w-sm font-role-body text-sm text-text-secondary",children:"Reach every guest at once with an announcement. Your sent blasts will show up here."})]})]})})},v=e=>{let{blast:t}=e,s=(e=>{if(!e||"object"!=typeof e)return null;let t=e.totalRecipients;return"number"==typeof t?t:null})(t.audience),a=t.audienceLabel,l=t.subject||t.bodyPreview||"Blast";return(0,n.jsxs)("div",{className:"rounded-[18px] bg-background-inverse/[0.055] p-4 backdrop-blur-xl",children:[(0,n.jsx)("p",{className:"truncate font-medium text-base text-text-primary",children:l}),(0,n.jsx)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:t.deliveryStatuses.map(e=>{let t=(e=>{let t=(0,x.gcm)(e.channel);if(0===e.total)return"".concat(t," no recipients");switch(e.status){case"SENT":return"".concat(t," ").concat(e.sent," sent").concat(e.skipped>0?" \xb7 ".concat(e.skipped," skipped"):"");case"PARTIAL":return"".concat(t," ").concat(e.sent," sent \xb7 ").concat(e.failed," failed");case"FAILED":return"".concat(t," ").concat(e.failed," failed");case"QUEUED":return"".concat(t," ").concat(e.pending," queued");case"PROCESSING":return"".concat(t," ").concat(e.total," ").concat(e.failed>0?"retrying":"sending");case"SKIPPED":return"".concat(t," ").concat(e.skipped," skipped")}})(e);return(0,n.jsxs)("span",{className:(0,i.A)("inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 font-role-body text-xs",(e=>{switch(e){case"SENT":return"bg-status-success/10 text-status-success";case"PARTIAL":case"QUEUED":case"PROCESSING":return"bg-status-warning/10 text-status-warning";case"FAILED":return"bg-status-error/10 text-status-error";case"SKIPPED":return"bg-background-inverse/10 text-text-secondary"}})(e.status)),title:t,children:[(0,n.jsx)(h,{status:e.status}),t]},e.channel)})}),t.bodyPreview&&t.bodyPreview!==l&&(0,n.jsx)("p",{className:"mt-2 line-clamp-2 font-role-body text-sm leading-relaxed text-text-secondary",children:t.bodyPreview}),(0,n.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-1 font-role-body text-xs text-text-tertiary",children:[(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,n.jsx)(d.A,{className:"size-3.5"}),a,null!==s?" (".concat(s,")"):""]}),(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,n.jsx)(u.A,{className:"size-3.5"}),t.senderName]}),(0,n.jsx)("span",{children:(0,x.m5d)(t.createdAtLocalDateTime).monthDay})]})]})}},85417:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(66940).A)("calendar-days",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]])}},e=>{e.O(0,[9860,8665,8439,9504,4570,8809,3761,7654,6367,1790,714,2262,4687,198,636,6593,8792],()=>e(e.s=55424)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.