1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,5050,e=>{"use strict";var t=e.i(43476);e.s(["Card",0,function({className:e="",...a}){return(0,t.jsx)("div",{className:`bg-white border border-[var(--ss-sand-border-3)] rounded-[20px] shadow-[0_4px_20px_rgba(47,62,68,0.07)] ${e}`,...a})}])},63686,e=>{"use strict";let t=["#e8500f","#12607e","#4f7c0e","#de331e","#b2622d","#0e4d64"];e.s(["colorForName",0,function(e){let a=0;for(let s of e)a=(a+s.charCodeAt(0))%t.length;return t[a]}])},94321,e=>{"use strict";var t=e.i(43476);let a="w-full border-[1.5px] border-[var(--ss-sand-border)] rounded-xl px-4 py-3 text-base text-[var(--ss-ink)] bg-[var(--ss-cream-panel)] placeholder:text-[#a89d89] transition-[border-color,box-shadow] focus:outline-none focus:border-indigo-400 focus:bg-white focus:shadow-[0_0_0_3px_rgba(247,135,26,0.16)]";e.s(["Field",0,function({className:e="",...s}){return(0,t.jsx)("input",{className:`${a} ${e}`,...s})},"FieldTextarea",0,function({className:e="",...s}){return(0,t.jsx)("textarea",{className:`${a} resize-y ${e}`,...s})}])},91016,e=>{"use strict";let t=["gmail.com","googlemail.com","yahoo.com","ymail.com","rocketmail.com","hotmail.com","outlook.com","live.com","msn.com","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me","mail.com","gmx.com","zoho.com","yandex.com","fastmail.com","comcast.net","verizon.net","att.net","sbcglobal.net","bellsouth.net","cox.net","charter.net","earthlink.net","optonline.net","frontier.com","yahoo.co.uk","hotmail.co.uk","outlook.co.uk","live.co.uk","icloud.co.uk","btinternet.com","sky.com","virginmedia.com","talktalk.net","ntlworld.com"],a={con:"com",cpm:"com",cim:"com",ocm:"com",cmo:"com",comm:"com",cok:"com",xom:"com",vom:"com","co.m":"com",cvom:"com",comn:"com",ner:"net",nte:"net",nett:"net",ogr:"org",rog:"org",orgg:"org",edi:"edu",eud:"edu"};e.s(["suggestEmailCorrection",0,function(e){let s=e.trim(),l=s.lastIndexOf("@");if(l<=0||l===s.length-1)return null;let n=s.slice(0,l),r=s.slice(l+1).toLowerCase();if(!r.includes(".")||t.includes(r))return null;let i=r.lastIndexOf("."),o=r.slice(i+1);if(a[o])return`${n}@${r.slice(0,i+1)}${a[o]}`;if(r.length>5){let e=null,a=1/0;for(let s of t){let t=function(e,t){let a=Array.from({length:t.length+1},(e,t)=>t),s=Array(t.length+1);for(let l=1;l<=e.length;l++){s[0]=l;for(let n=1;n<=t.length;n++)s[n]=Math.min(a[n]+1,s[n-1]+1,a[n-1]+ +(e[l-1]!==t[n-1]));for(let e=0;e<=t.length;e++)a[e]=s[e]}return a[t.length]}(r,s);t<a&&(a=t,e=s)}let s=r.length>=9?2:1;if(e&&a>0&&a<=s)return`${n}@${e}`}return null}])},57957,e=>{"use strict";var t=e.i(43476),a=e.i(87571),s=e.i(91016);e.s(["EmailTypoHint",0,function({value:e,onAccept:l,className:n=""}){let r=(0,a.useTranslations)("emailTypo"),i=(0,s.suggestEmailCorrection)(e);return i?(0,t.jsxs)("p",{className:`mt-1 text-xs text-[#c2410c] ${n}`,children:[r("didYouMean")," ",(0,t.jsx)("button",{type:"button",onClick:()=>l(i),className:"font-bold underline hover:no-underline",children:i.slice(i.lastIndexOf("@"))}),"?"]}):null}])},89890,e=>{"use strict";var t=e.i(43476);let a={default:"bg-[#fff2eb] text-[#c2410c] border-[#ffd9c2]",success:"bg-[#f0fae1] text-[var(--ss-green-deep)] border-[#ccdbb2]",info:"bg-[#e6f0f4] text-[var(--ss-blue-deep)] border-[#c2dbe4]"};e.s(["Badge",0,function({variant:e="default",className:s="",...l}){return(0,t.jsx)("span",{className:`inline-flex items-center gap-1.5 font-bold text-[13px] tracking-[0.04em] px-4 py-2 rounded-full border ${a[e]} ${s}`,...l})}])},80750,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(3303),l=e.i(76677);let n="ca-pub-5071033318500228",r={top:{desktop:{slot:"4463228800",width:728,height:90},mobile:{slot:"7770957960",width:320,height:50}},bottom:{desktop:{slot:"1643524150",width:728,height:90},mobile:{slot:"1348010684",width:320,height:100}},footer:{desktop:{slot:"6566647968",width:728,height:90},mobile:{slot:"2651453684",width:320,height:100}}},i="(min-width: 768px)",o="(min-width: 352px)";function c({className:e,unit:r}){let i=(0,a.useRef)(!1);function o(){if(!i.current)try{let e=window.adsbygoogle=window.adsbygoogle||[];(0,l.limitAds)()&&(e.requestNonPersonalizedAds=1),e.push({}),i.current=!0}catch{}}return(0,t.jsxs)("div",{className:e,children:[(0,t.jsx)(s.default,{async:!0,src:`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${n}`,crossOrigin:"anonymous",strategy:"afterInteractive",onLoad:o,onReady:o}),(0,t.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,t.jsx)("ins",{className:"adsbygoogle",style:{display:"inline-block",width:r.width,height:r.height},"data-ad-client":n,"data-ad-slot":r.slot})})]})}e.s(["SeasonalAdSlot",0,function({className:e,position:s}){let[l,n]=(0,a.useState)(!1),[d,m]=(0,a.useState)(null);if((0,a.useEffect)(()=>{let e;n(!window.Capacitor?.isNativePlatform?.()&&(e=new Date().getMonth())>=9&&e<=11);let t=()=>m(window.matchMedia(i).matches?"desktop":window.matchMedia(o).matches?"mobile":null);t();let a=[window.matchMedia(i),window.matchMedia(o)];
1return a.forEach(e=>e.addEventListener("change",t)),()=>a.forEach(e=>e.removeEventListener("change",t))},[]),!l||!d)return null;let u=r[s][d];return u?(0,t.jsx)(c,{className:e,unit:u},d):null}])},68623,27203,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(87571),l=e.i(94321),n=e.i(63686),r=e.i(91016),i=e.i(57957);function o(){return Math.random().toString(36).slice(2)}function c(e){return e.filter(e=>e.name.trim()&&e.email.trim())}function d(e){let t=new Map;for(let a of e){let e=a.name.trim().toLowerCase();t.set(e,(t.get(e)??0)+1)}return[...t.entries()].filter(([,e])=>e>1).map(([e])=>e)}let m=/^[^@\s]+@[^@\s]+\.[^@\s]+$/;e.s(["default",0,function({participants:e,onParticipantsChange:u,excludes:x,onExcludesChange:h}){let p=(0,s.useTranslations)("participantsEditor"),[f,b]=(0,a.useState)(!1),[g,j]=(0,a.useState)(""),[v,w]=(0,a.useState)([]);function N(t,a,s){u(e.map(e=>e.id===t?{...e,[a]:s}:e))}let y=c(e),k=d(y);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("label",{className:"block text-sm font-bold text-[#5c554e]",children:[p("participants")," ",(0,t.jsx)("span",{className:"text-[#a89d89] font-normal",children:p("namesUnique")})]}),(0,t.jsx)("button",{type:"button",onClick:()=>b(e=>!e),className:"text-xs text-indigo-600 hover:underline font-bold",children:f?p("hideBulkImport"):`ð ${p("pasteOrImport")}`})]}),f&&(0,t.jsxs)("div",{className:"mb-4 bg-[var(--ss-cream-panel)] border border-[var(--ss-sand-border)] rounded-xl p-4 space-y-4",children:[(0,t.jsxs)("div",{className:"text-xs text-[#6b6459] space-y-2",children:[(0,t.jsx)("p",{className:"font-bold text-[#5c554e]",children:p("howToFormat")}),(0,t.jsx)("p",{children:p("formatDescription")}),(0,t.jsxs)("ol",{className:"list-decimal list-inside space-y-0.5 pl-1",children:[(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:p("fieldName")})," â ",p("fieldNameDesc")]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:p("fieldEmail")})," â ",p("fieldEmailDesc")]}),(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:p("fieldExcludes")})," ",(0,t.jsx)("span",{className:"text-[#a89d89]",children:p("optional")})," â ",p("fieldExcludesDesc")," ",(0,t.jsx)("code",{className:"bg-white px-1 rounded border border-[var(--ss-sand-border)]",children:";"})]})]}),(0,t.jsxs)("div",{className:"bg-white border border-[var(--ss-sand-border)] rounded-lg p-3 font-mono text-[11px] leading-relaxed overflow-x-auto",children:["Alice Smith,[email protected],Bob Jones",(0,t.jsx)("br",{}),"Bob Jones,[email protected],Alice Smith",(0,t.jsx)("br",{}),"Carol White,[email protected],",(0,t.jsx)("br",{}),"David Lee,[email protected],Carol White;Bob Jones"]}),(0,t.jsx)("p",{children:p("exampleExplanation")}),(0,t.jsxs)("p",{children:[p("importReplacesPre")," ",(0,t.jsx)("strong",{children:p("importReplacesBold")}),p("importReplacesPost")," ",(0,t.jsx)("a",{href:"/secret-santa-sample.csv",download:!0,className:"text-indigo-600 hover:underline font-bold",children:p("downloadExample")})]})]}),(0,t.jsx)("textarea",{value:g,onChange:e=>j(e.target.value),rows:6,placeholder:"Alice Smith,[email protected],Bob Jones\nBob Jones,[email protected],Alice Smith",className:"w-full border-[1.5px] border-[var(--ss-sand-border)] rounded-xl px-3 py-2 text-sm font-mono bg-white focus:outline-none focus:border-indigo-400 focus:shadow-[0_0_0_3px_rgba(247,135,26,0.16)]"}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("label",{className:"text-xs text-[#6b6459] border-[1.5px] border-[var(--ss-sand-border)] bg-white rounded-full px-3 py-1.5 cursor-pointer hover:border-[#cbbb9d] font-semibold",children:[p("chooseCsvFile"),(0,t.jsx)("input",{type:"file",accept:".csv,text/csv",onChange:function(e){let t=e.target.files?.[0];if(!t)return;let a=new FileReader;a.onload=()=>j(String(a.result??"")),a.readAsText(t),e.target.value=""},className:"hidden"})]}),(0,t.jsx)("button",{type:"button",onClick:function(){let e,t,a,{rows:s,warnings:l}=(e=[],t=g.split(/\r\n|\r|\n/).map(e=>e.trim()).filter(e=>e.length>0),a=[],t.forEach((t,s)=>{let l=t.includes(" ")?" ":",",n=(function(e,t){let a=[],s="",l=!1;for(let n=0;n<e.length;n++){let r=e[n];l?'"'===r?'"'===e[n+1]?(s+='"',n++):l=!1:s+=r:'"'===r?l=!0:r===t?(a.push(s),s=""):s+=r}return a.push(s),a})(t,l).map(e=>e.trim());if(0===s&&n[0]?.toLowerCase()==="name"&&n[1]?.toLowerCase()==="email")return;let[r,i,o]=n;if(!r||!i)return void e.push(p("warnMissingField",{line:s+1}));
1if(!m.test(i))return void e.push(p("warnInvalidEmail",{line:s+1,email:i}));let c=(o??"").split(";").map(e=>e.trim()).filter(Boolean);a.push({name:r,email:i,excludeNames:c})}),{rows:a,warnings:e}),n=new Map;for(let e of s){let t=e.name.toLowerCase();n.set(t,(n.get(t)??0)+1)}let r=new Set([...n.entries()].filter(([,e])=>e>1).map(([e])=>e));if(r.size>0&&l.push(p("warnDuplicateNames",{names:[...r].join(", ")})),s.length<2)return void w([...l,p("warnNeedTwo")]);let i=s.map(e=>({id:o(),name:e.name,email:e.email})),c=new Map(i.map(e=>[e.name.trim().toLowerCase(),e.id])),d={};s.forEach((e,t)=>{let a=e.excludeNames.map(e=>c.get(e.trim().toLowerCase())).filter(e=>!!e);if(e.excludeNames.length&&a.length!==e.excludeNames.length){let t=e.excludeNames.filter(e=>!c.has(e.trim().toLowerCase()));l.push(p("warnCouldNotMatch",{name:e.name,missing:t.join(", ")}))}a.length&&(d[i[t].id]=a)}),u(i),h(d),w(l),0===l.length&&(b(!1),j(""))},disabled:!g.trim(),className:"text-sm bg-indigo-600 text-white px-4 py-1.5 rounded-full font-bold hover:bg-indigo-700 transition-colors disabled:opacity-40",children:p("importParticipants")})]}),v.length>0&&(0,t.jsx)("div",{className:"bg-[#fff2eb] border border-[#ffd9c2] text-[#c2410c] text-xs rounded-lg p-3 space-y-1",children:v.map((e,a)=>(0,t.jsx)("p",{children:e},a))})]}),(0,t.jsx)("div",{className:"space-y-2",children:e.map(a=>{let s=a.name.trim()&&k.includes(a.name.trim().toLowerCase()),o=a.name.trim().charAt(0).toUpperCase()||"?",c=(0,r.suggestEmailCorrection)(a.email);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex gap-2 items-center bg-[var(--ss-cream-panel)] border-2 border-[var(--ss-sand-border-2)] rounded-xl pl-3 pr-2 py-2",children:[(0,t.jsx)("span",{className:"size-8 rounded-full flex items-center justify-center text-white font-extrabold text-sm shrink-0",style:{background:(0,n.colorForName)(a.name||a.id)},children:o}),(0,t.jsx)(l.Field,{value:a.name,onChange:e=>N(a.id,"name",e.target.value),placeholder:p("name"),autoComplete:"off",className:`flex-1 !py-2 !bg-white ${s?"!border-red-300 !bg-red-50":""}`}),(0,t.jsx)(l.Field,{type:"email",value:a.email,onChange:e=>N(a.id,"email",e.target.value),placeholder:p("email"),autoComplete:"off",className:`flex-1 !py-2 !bg-white ${c?"!border-[#ffd9c2] !bg-[#fff8f3]":""}`}),e.length>2&&(0,t.jsx)("button",{type:"button",onClick:()=>(function(t){u(e.filter(e=>e.id!==t));let a={};for(let[e,s]of Object.entries(x))e!==t&&(a[e]=s.filter(e=>e!==t));h(a)})(a.id),className:"text-[#b0a693] hover:text-red-500 text-xl font-bold leading-none px-1",children:"Ã"})]}),(0,t.jsx)(i.EmailTypoHint,{value:a.email,onAccept:e=>N(a.id,"email",e),className:"ml-11"})]},a.id)})}),(0,t.jsxs)("button",{type:"button",onClick:function(){u([...e,{id:o(),name:"",email:""}])},className:"mt-2 text-sm text-indigo-600 hover:underline font-bold",children:["+ ",p("addParticipant")]}),k.length>0&&(0,t.jsx)("p",{className:"mt-2 text-xs text-red-600 font-semibold",children:p("duplicateWarning",{name:k[0]})}),y.length<3&&(0,t.jsx)("p",{className:"mt-2 text-xs text-[#a89d89]",children:p("exclusionsUnlockHint")})]}),y.length>=3&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("label",{className:"block text-sm font-bold text-[#5c554e] mb-1",children:[p("exclusions")," ",(0,t.jsx)("span",{className:"text-[#a89d89] font-normal",children:p("optional")})]}),(0,t.jsx)("p",{className:"text-xs text-[#8a8072] mb-3",children:p("exclusionsDescription")}),(0,t.jsx)("div",{className:"space-y-3",children:y.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-xs font-semibold text-[#6b6459] mb-1.5",children:p("shouldNotGiveTo",{name:e.name})}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:y.filter(t=>t.id!==e.id).map(a=>{let s=(x[e.id]??[]).includes(a.id);return(0,t.jsx)("button",{type:"button",onClick:()=>{var t,s;let l;return t=e.id,s=a.id,l=x[t]??[],void h({...x,[t]:l.includes(s)?l.filter(e=>e!==s):[...l,s]})},className:`text-xs font-semibold px-3 py-1 rounded-full border transition-colors ${s?"bg-[#fff2eb] border-[#ffd9c2] text-[#c2410c]":"bg-[var(--ss-cream-panel)] border-[var(--ss-sand-border)] text-[#6b6459] hover:border-[#cbbb9d]"}`,children:a.name},a.id)})})]},e.id))})]})]})},"getDuplicateNames",0,d,"getValidParticipants",0,c,"newParticipantId",0,o],68623);var u=e.i(32899);async function x(){if((0,u.isNativeApp)())try{let{Haptics:t,NotificationType:a}=await e.A(75268);await t.notification({type:a.Success})}catch{}}e.s(["hapticSuccess",0,x],27203)},67564,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(18566),l=e.i(26732),n=e.i(22016),r=e.i(87571),i=e.i(68623),o=e.i(22635),c=e.i(76525),d=e.i(5050),m=e.i(89890),u=e.i(94321),x=e.i(57957),h=e.i(68145),p=e.i(27203);function f(){return[{id:(0,i.newParticipantId)(),name:"",email:""},{id:(0,i.newParticipantId)(),name:"",email:""},{id:(0,i.newParticipantId)(),name:"",email:""}]}function b({drawParam:e,blankParam:g,initialGroupName:j,initialParticipants:v}){let w=(0,r.useTranslations)("secretSanta"),N=(0,s.useRouter)(),{status:y}=(0,l.useSession)(),k=!!v?.length,[C,S]=(0,a.useState)("setup"),[P,E]=(0,a.useState)(j??""),[A,T]=(0,a.useState)(""),[I,D]=(0,a.useState)(""),[$,B]=(0,a.useState)(""),[M,L]=(0,a.useState)(""),[_,F]=(0,a.useState)("1"),[R,O]=(0,a.useState)(v?.length?v:f()),[G,U]=(0,a.useState)({}),[W,z]=(0,a.useState)(!1),[J,H]=(0,a.useState)(""),[K,Y]=(0,a.useState)(null),[q,V]=(0,a.useState)(!1),[Q,X]=(0,a.useState)(!1),[Z,ee]=(0,a.useState)(null),[et,ea]=(0,a.useState)(""),[es,el]=(0,a.useState)(!1),[en,er]=(0,a.useState)(""),[ei,eo]=(0,a.useState)(!1);(0,a.useEffect)(()=>{g?(E(""),O(f()),U({})):v?.length&&(E(j??""),O(v),U({}))},[g,j,v]);let[ec,ed]=(0,a.useState)(!1);(0,a.useEffect)(()=>{e&&(async()=>{let t=await fetch(`/api/secret-santa/draw/${e}`);if(!t.ok)return;let a=await t.json();if(ed(!0),E(a.groupName??""),T(a.senderName??""),D(a.senderEmail??""),B(a.note??""),L(a.budget??""),F(String(Math.min(5,Math.max(1,a.presentsPerPerson||1)))),Array.isArray(a.participants)&&a.participants.length>=2){let e=a.participants.map(e=>({id:(0,i.newParticipantId)(),name:e.name,email:e.email}));O(e);let t=new Map(e.map(e=>[e.email,e.id])),s={};
1a.participants.forEach((a,l)=>{let n=(a.excludes??[]).map(e=>t.get(e)).filter(e=>!!e);n.length&&(s[e[l].id]=n)}),U(s)}})()},[e]);let[em,eu]=(0,a.useState)([]);(0,a.useEffect)(()=>{if("authenticated"!==y)return void eu([]);let e=!1;return fetch("/api/user/groups").then(e=>e.ok?e.json():[]).then(t=>{!e&&Array.isArray(t)&&eu(t.filter(e=>e.isAdmin).map(e=>({groupId:e.groupId,groupName:e.groupName})))}).catch(()=>{}),()=>{e=!0}},[y]);let ex=(0,a.useMemo)(()=>{let e=P.trim().toLowerCase();return e?em.find(t=>t.groupName.trim().toLowerCase()===e)??null:null},[P,em]),eh=(0,i.getValidParticipants)(R),ep=(0,i.getDuplicateNames)(eh),ef=Math.max(1,parseInt(_,10)||1);async function eb(){if(eh.length<2)return void H(w("needTwoParticipants"));if(ep.length>0)return void H(w("duplicateNamesError",{names:ep.join(", ")}));z(!0),H("");let e=eh.map(e=>({name:e.name,email:e.email,key:e.id,excludes:G[e.id]??[]})),t=await fetch("/api/secret-santa/draw",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({groupName:P,senderName:A,senderEmail:I,note:$,budget:M,presentsPerPerson:ef,participants:e})}),a=await t.json();if(t.ok){if(Y(a.drawId??null),V(!!a.owned),X(!!a.senderHasAccount),ee(a.manageKey??null),(0,p.hapticSuccess)(),!a.owned&&a.drawId)try{localStorage.setItem(o.PENDING_DRAW_STORAGE_KEY,a.drawId)}catch{}S("done")}else H(a.error??w("somethingWentWrong")),z(!1)}async function eg(){if(!K)return;el(!0),er(""),eo(!1);let e=await fetch("/api/secret-santa/claim",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({drawId:K,email:I,password:et,firstName:A})}),t=await e.json();if(!e.ok){er(t.error??w("couldNotSaveDraw")),eo(!!t.needLogin),el(!1);return}try{localStorage.removeItem(o.PENDING_DRAW_STORAGE_KEY)}catch{}let a=await (0,l.signIn)("credentials",{email:I,password:et,redirect:!1});a?.error?N.push(`/login?callbackUrl=${encodeURIComponent(`/secret-santa/draws?claimDraw=${K}`)}`):N.push("/secret-santa/draws")}return"done"===C?(0,t.jsxs)("div",{className:"max-w-xl mx-auto px-4 py-12 text-center",children:[(0,t.jsxs)(m.Badge,{variant:"success",className:"mb-5",children:["â ",w("emailsSent")]}),(0,t.jsx)(h.GiftMark,{className:"size-14 mx-auto my-3",bowColor:"#4f7c0e"}),(0,t.jsx)("p",{className:"text-lg text-[#5c554e] mb-8",children:w("emailsSentBody",{groupName:P,plural:ef>1?"s":""})}),q?(0,t.jsxs)(d.Card,{className:"p-6 text-center",children:[(0,t.jsx)("p",{className:"text-[#5c554e] mb-4",children:w("savedToAccount")}),(0,t.jsx)(c.Button,{href:"/secret-santa/draws",children:w("viewSavedDraws")})]}):Q?(0,t.jsxs)(d.Card,{className:"p-6 text-left bg-[#fff2eb] border-[#ffd9c2]",children:[(0,t.jsx)("h2",{className:"cap text-xl mb-1",children:w("saveDrawSignInTitle")}),(0,t.jsx)("p",{className:"text-sm text-[#6b6459] mb-4",children:w("saveDrawSignInBody",{email:I,groupName:P})}),(0,t.jsx)(c.Button,{href:`/login?callbackUrl=${encodeURIComponent(`/secret-santa/draws?claimDraw=${K}`)}`,className:"w-full",children:w("saveDrawSignInButton")})]}):(0,t.jsxs)(d.Card,{className:"p-6 text-left bg-[#fff2eb] border-[#ffd9c2]",children:[(0,t.jsx)("h2",{className:"cap text-xl mb-1",children:w("saveDrawTitle")}),(0,t.jsx)("p",{className:"text-sm text-[#6b6459] mb-4",children:w("saveDrawBody",{groupName:P})}),en&&(0,t.jsxs)("div",{className:"bg-white border border-[#ffd9c2] text-[#c2410c] text-sm px-4 py-3 rounded-xl mb-3",children:[en,ei&&(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)(n.default,{href:`/login?callbackUrl=${encodeURIComponent(`/secret-santa/draws?claimDraw=${K}`)}`,className:"underline font-bold",children:w("signIn")})]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-bold text-[#5c554e] mb-1",children:w("email")}),(0,t.jsx)(u.Field,{value:I,readOnly:!0,className:"text-[#8a8072] bg-white"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-bold text-[#5c554e] mb-1",children:w("choosePassword")}),(0,t.jsx)(u.Field,{type:"password",value:et,minLength:8,onChange:e=>ea(e.target.value),placeholder:w("atLeast8Chars")})]}),(0,t.jsx)(c.Button,{onClick:eg,disabled:es||et.length<8,className:"w-full",children:es?w("saving"):w("saveDrawButton")})]}),Z&&(0,t.jsxs)("p",{className:"text-xs text-[#8a8072] mt-4 pt-4 border-t border-[#ffd9c2]",children:[w("manageLinkEmailed")," ",(0,t.jsx)(n.default,{href:`/secret-santa/manage/${Z}`,className:"text-indigo-600 underline hover:no-underline font-semibold",children:w("manageLinkCta")})]})]}),(0,t.jsx)("div",{className:"text-center mt-6",children:(0,t.jsx)("button",{onClick:function(){S("setup"),E(""),T(""),D(""),B(""),L(""),F("1"),O(f()),U({}),Y(null),V(!1),X(!1),ee(null),ea(""),er(""),eo(!1)},className:"text-sm text-indigo-600 hover:underline font-semibold",children:w("startAnotherDraw")})})]}):(0,t.jsxs)("div",{className:"max-w-2xl mx-auto px-4 py-10",children:[(0,t.jsxs)("h1",{className:"text-4xl sm:text-5xl mb-2",children:[w("pageTitleAccent")&&(0,t.jsx)("span",{className:"text-[#0e5470]",children:w("pageTitleAccent")}),w("pageTitleAccent")&&" ",(0,t.jsx)("span",{className:"text-[#e8500f]",children:w("pageTitleRest")})]}),(0,t.jsxs)("p",{className:"text-lg text-[#6b6459] mb-8",children:[w("pageSubtitle"),k&&(0,t.jsxs)(t.Fragment,{children:[" ",w("prefilledPre")," ",(0,t.jsx)("strong",{children:j}),w("prefilledMid")," ",(0,t.jsx)(n.default,{href:"/secret-santa?blank=1",className:"text-indigo-600 underline hover:no-underline",children:w("startBlankDraw")}),"."]})]}),ec&&(0,t.jsx)("div",{className:"bg-[#fff2eb] border border-[#ffd9c2] text-[#c2410c] text-sm px-4 py-3 rounded-xl mb-6",children:w("prefilledFromDrawWarning")}),(0,t.jsxs)(d.Card,{className:"p-6 space-y-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-bold text-[#5c554e] mb-1",children:w("groupName")}),(0,t.jsx)(u.Field,{value:P,onChange:e=>E(e.target.value),placeholder:w("groupNamePlaceholder")}),ex&&(0,t.jsxs)("div",{className:"mt-2 bg-[#fff2eb] border border-[#ffd9c2] text-[#c2410c] text-sm px-4 py-3 rounded-xl",children:[w("adminGroupMatchWarning",{groupName:ex.groupName})," ",(0,t.jsx)(n.default,{href:`/dashboard/${ex.groupId}/secret-santa`,className:"font-bold underline hover:no-underline",children:w("adminGroupMatchLink")})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-bold text-[#5c554e] mb-1",children:w("yourName")}),(0,t.jsx)(u.Field,{name:"senderName",autoComplete:"name",value:A,onChange:e=>T(e.target.value),placeholder:w("organizerName")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-bold text-[#5c554e] mb-1",children:w("yourEmail")}),(0,t.jsx)(u.Field,{type:"email",name:"senderEmail",autoComplete:"email",value:I,onChange:e=>D(e.target.value),placeholder:"[email protected]"}),(0,t.jsx)(x.EmailTypoHint,{value:I,onAccept:D})]})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-bold text-[#5c554e] mb-1",children:w("budget")}),(0,t.jsx)(u.Field,{value:M,onChange:e=>L(e.target.value),placeholder:w("budgetPlaceholder")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-bold text-[#5c554e] mb-1",children:w("presentsPerPerson")}
1),(0,t.jsx)("select",{value:_,onChange:e=>F(e.target.value),className:"w-full border-[1.5px] border-[var(--ss-sand-border)] rounded-xl px-4 py-3 text-base text-[var(--ss-ink)] bg-[var(--ss-cream-panel)] focus:outline-none focus:border-indigo-400 focus:bg-white focus:shadow-[0_0_0_3px_rgba(247,135,26,0.16)]",children:[1,2,3,4,5].map(e=>(0,t.jsx)("option",{value:e,children:e},e))}),(0,t.jsx)("p",{className:"text-xs text-[#a89d89] mt-1",children:w("needsAtLeast",{count:ef+1})})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"block text-sm font-bold text-[#5c554e] mb-1",children:w("noteToParticipants")}),(0,t.jsx)(u.FieldTextarea,{value:$,onChange:e=>B(e.target.value),rows:4,placeholder:w("notePlaceholder")})]}),(0,t.jsx)(i.default,{participants:R,onParticipantsChange:O,excludes:G,onExcludesChange:U}),J&&(0,t.jsx)("div",{className:"bg-[#fff2eb] border border-[#ffd9c2] text-[#c2410c] text-sm px-4 py-3 rounded-xl",children:J}),(0,t.jsxs)(c.Button,{onClick:eb,disabled:W||!P||!A||!I||eh.length<2||ep.length>0,className:"w-full text-lg py-4",children:["ð"," ",W?w("drawingNames"):ef>1?w("drawButtonMultiple",{count:eh.length,gifts:ef}):w("drawButtonSingle",{count:eh.length})]})]})]})}function g({initialGroupName:e,initialParticipants:a}){let l=(0,s.useSearchParams)();return(0,t.jsx)(b,{drawParam:l.get("draw"),blankParam:l.get("blank"),initialGroupName:e,initialParticipants:a})}e.s(["default",0,function({initialGroupName:e,initialParticipants:s}){return(0,t.jsx)(a.Suspense,{fallback:(0,t.jsx)(b,{drawParam:null,blankParam:null,initialGroupName:e,initialParticipants:s}),children:(0,t.jsx)(g,{initialGroupName:e,initialParticipants:s})})}])},75268,e=>{e.v(t=>Promise.all(["static/chunks/0ml4-4_tju8hc.js"].map(t=>e.l(t))).then(()=>t(12252)))}]);
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.