1import{c as Y,g as s,y as n,h as c,r as j,j as e,L as r,e as Z,u as V,i as W,w as X,s as _,E as ee,k as te,G as ae,l as re,n as se,o as ne,H as ce}from"./index-CFv9XKiB.js";import{u as M}from"./useServerFn-DJOSWF3u.js";import{u as q}from"./useQuery-DQfTiywB.js";import{g as B}from"./challenge.functions-C55TVuIs.js";import{T as oe}from"./trophy-wAIDwG-J.js";import{A as de}from"./arrow-right-DCPYGvaV.js";import{D as le,a as ie,b as me,c as L,d as O}from"./dropdown-menu-Be6ya9Jw.js";const ue=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],he=Y("menu",ue),fe="/__l5e/assets-v1/de55318f-2681-41c7-9299-143a01a8e6c6/excel-logo.png",Q={url:fe},Oe=s({method:"POST"}).middleware([n]).handler(c("ee6f6bceb5b80a8ed1ee7f453795927efa8bee0fe3bbd5578c3f83c13e6b2ca6")),Ae=s({method:"POST"}).middleware([n]).handler(c("b5230ff1ffa905dd3a098ac9ff86d01e85506d33f4d124cad1dd3d461c3aa6d0"));s({method:"POST"}).middleware([n]).handler(c("8ac1fb99912a0986ad634f591df01742736289338ab4463a68d33cb561e870a0"));const Ee=s({method:"POST"}).middleware([n]).handler(c("31114acf639184e56f99832be719a648cae4601c0ee60119c23fb0515c24d128")),Me=s({method:"POST"}).middleware([n]).handler(c("14e44718bfbe4b49a36c662d58a61c6b9a58632063348e1cfdda809d257785ff")),qe=s({method:"POST"}).middleware([n]).handler(c("05b6d40509acc471e4b77294d8072b93c3d0cd8b80a63235f40ee2ed0c99f1ff"));s({method:"POST"}).middleware([n]).handler(c("fbb85a40a193d9c5670461b9de5eeb0d456763a984c122ef70f93cfc1bf238dc"));const Ie=s({method:"POST"}).middleware([n]).handler(c("a5b58565305b45965d1644816ac01edba95399b923203532fc61b037e0a3211d")),$e=s({method:"POST"}).middleware([n]).handler(c("ebd76c2f82072d4e3880e31ad2f9f5d07bd4e41ca2e11836b5285bd0d15a334e")),Re=s({method:"POST"}).middleware([n]).handler(c("117d1f02c5cd376293aa91283b17baa2f068deb768521bd9e221e8c5fd830dc0")),De=s({method:"POST"}).middleware([n]).handler(c("957b1af76b34fedcdf83599f3dec04825b01613ecc7aecca067913662637f404")),Fe=s({method:"POST"}).middleware([n]).handler(c("d611c744c9f78ae323a0ce247b6f9637e421012a2ec735da86e5edcd2f5928a3"));s({method:"POST"}).middleware([n]).handler(c("7350373a49b88a4c7a935d7a459d8e24b7dd154e74c62726ef929cc6eae97718"));const Ue=s({method:"POST"}).middleware([n]).handler(c("30ca2e0abcc83587f8cf35d9275ccb03bf9a5ff2ceadf0c9464681db81932760")),Le=s({method:"POST"}).middleware([n]).handler(c("1625792261ec4cda4d7508dfa8956d5061f3ad24cc2f20a92b5f3ac3321e71f4")),Qe=s({method:"GET"}).middleware([n]).handler(c("18144e3cadf3be6a26baa27789afda1a8930ebaa5854b7a021a3e6fc305cdf60")),Be=s({method:"POST"}).middleware([n]).handler(c("c5c79ecd652019722f4071850a8b85d71981ec20e122a624c1b6eb4ef235a3f2")),Ge=s({method:"POST"}).middleware([n]).handler(c("e3d93a6b664ef324f7ec3b3cedf542da866efea83a1f14ed28a10558c4d27959")),xe=s({method:"GET"}).middleware([n]).handler(c("b74d7eb503a04603268a7ccdbcc0f40733194f4be705db1d0cdd419139070b09")),Ke=s({method:"POST"}).middleware([n]).handler(c("5a346c73229f221dae635983998e6470a326b9095fe75a6875a999ba95925557")),ze=s({method:"POST"}).middleware([n]).handler(c("f3e49e7b271631c0e71d30c04485df55d64fe49f7cef5953127cb24f06835490")),He=s({method:"POST"}).middleware([n]).handler(c("996c4ceaf1b05e936655022d6d67f17dfed30ce5fa72422b9c4ec0c817676905"));s({method:"POST"}).middleware([n]).handler(c("2999f5c59d240a5ffe0c66354d6f819b6e0c97c99326240305cbd2c85317a929"));const Je=s({method:"POST"}).middleware([n]).handler(c("44fa3ad1075164b8f3b93aa4c14df39989682eaaf551ab80e6c3693474f5eca4")),Ye=s({method:"POST"}).middleware([n]).handler(c("1a7e615ce65d64845d680e94ae079ed1e9854dba16172ff36bea1995aeea6e39"));function pe(a){const t=Math.max(0,Math.floor(a/1e3));return{days:Math.floor(t/86400),hours:Math.floor(t%86400/3600),minutes:Math.floor(t%3600/60),seconds:t%60}}function I(){const a=M(B),t=q({queryKey:["challenge-state"],queryFn:()=>a(),staleTime:6e4}),o=t.data?.contest?.status??null;return{status:o,loaded:!!t.data,open:t.data?.open??!1,closedReason:t.data?.closedReason??null,showInNav:o==="open"||o==="judging"}}function $(){const{status:a}=I(),t=M(B),o=q({queryKey:["challenge-state"],queryFn:()=>t(),staleTime:6e4}),[i,y]=j.useState(null);j.useEffect(()=>{y(Date.now());const v=setInterval(()=>y(Date.now()),1e3);return()=>clearInterval(v)},[]);const d=o.data?.contest?.starts_at??null,b=o.data?.contest?.ends_at??null;if(a!=="open"||i===null||!d&&!b)return null;const g=d?new Date(d).getTime():null,m=b?new Date(b).getTime():null;let w="during",h=m;return g&&i<g?(w="before",h=g):m&&i>=m&&(w="after",h=m),{phase:w,startsAt:g,endsAt:m,parts:pe(h?h-i:0)}}
1const be="America/New_York";function A(a,t=!1){return a?new Date(a).toLocaleString("en-US",{timeZone:be,month:"long",day:"numeric",year:"numeric",...t?{hour:"numeric",minute:"2-digit",timeZoneName:"short"}:{}}):""}function T({value:a,label:t}){return e.jsxs("div",{className:"rounded-lg border border-red-600/30 bg-background/60 px-3 py-2 sm:px-4 sm:py-3 text-center min-w-[64px] sm:min-w-[76px]",children:[e.jsx("div",{className:"font-display text-2xl sm:text-3xl leading-none tabular-nums",children:String(a).padStart(2,"0")}),e.jsx("div",{className:"mt-1 text-[9px] sm:text-[10px] uppercase tracking-[0.2em] text-muted-foreground",children:t})]})}function Ze({className:a=""}){const t=$();if(!t)return null;if(t.phase==="after")return e.jsx("div",{className:`text-center ${a}`,children:e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Entries are closed."," ",e.jsx(r,{to:"/challenge/gallery",className:"underline hover:text-foreground",children:"See the entries"})]})});const o=t.phase==="before"?"Entries open in":"Entries close in";return e.jsxs("div",{className:`flex flex-col items-center gap-3 ${a}`,children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.3em] text-red-400",children:o}),e.jsxs("div",{className:"flex items-center justify-center gap-2 sm:gap-3",children:[e.jsx(T,{value:t.parts.days,label:"Days"}),e.jsx(T,{value:t.parts.hours,label:"Hours"}),e.jsx(T,{value:t.parts.minutes,label:"Min"}),e.jsx(T,{value:t.parts.seconds,label:"Sec"})]}),e.jsxs("div",{className:"text-xs text-muted-foreground text-center",children:["Entries open ",A(t.startsAt)," · close ",A(t.endsAt,!0)]})]})}function ge(){const a=$();return!a||a.phase==="after"?null:a.phase==="before"?e.jsxs("span",{className:"tabular-nums",children:["Entries open ",A(a.startsAt)," â in ",a.parts.days,"d ",a.parts.hours,"h"," ",String(a.parts.minutes).padStart(2,"0"),"m"]}):e.jsxs("span",{className:"tabular-nums",children:["Entries close in ",a.parts.days,"d ",a.parts.hours,"h"," ",String(a.parts.minutes).padStart(2,"0"),"m ",String(a.parts.seconds).padStart(2,"0"),"s"]})}const E="excel_challenge_attribution";function Ve(a){if(typeof window>"u")return{};let t={};try{t=JSON.parse(sessionStorage.getItem(E)??"{}")}catch{t={}}const o=new URLSearchParams(window.location.search),i={utm_source:o.get("utm_source")??t.utm_source??null,utm_medium:o.get("utm_medium")??t.utm_medium??null,utm_campaign:o.get("utm_campaign")??t.utm_campaign??null,utm_content:o.get("utm_content")??t.utm_content??null,utm_term:o.get("utm_term")??t.utm_term??null,referrer:t.referrer??(document.referrer||null),entry_source:a??t.entry_source??null};try{sessionStorage.setItem(E,JSON.stringify(i))}catch{}return i}function je(){if(typeof window>"u")return{};try{return JSON.parse(sessionStorage.getItem(E)??"{}")}catch{return{}}}function ye(a,t={},o){Z({name:a,params:{content_category:"excel_concept_challenge",...je(),...t},user:o})}function we(){const{showInNav:a}=I(),t=$();return!a||!t||t.phase==="after"?null:e.jsx("div",{className:"border-b border-red-600/30 bg-red-600/10",children:e.jsxs("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 py-2 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-[11px] sm:text-xs",children:[e.jsx(oe,{className:"h-3.5 w-3.5 shrink-0 text-red-500"}),e.jsx("span",{className:"hidden sm:inline font-medium",children:"The Excel Concept Challenge â"}),e.jsx("span",{className:"truncate text-muted-foreground",children:e.jsx(ge,{})})]}),e.jsxs(r,{to:"/challenge",onClick:()=>ye("challenge_start_click",{placement:"announcement_bar"}),className:"inline-flex shrink-0 items-center gap-1.5 rounded-md bg-red-600 px-3 py-1.5 text-[11px] sm:text-xs font-semibold text-white hover:bg-red-700",children:["Enter the Challenge ",e.jsx(de,{className:"h-3.5 w-3.5"})]})]})})}function We({children:a,focus:t=!1}){const o=M(xe),i=V(),y=W(),[d,b]=j.useState(null),[g,m]=j.useState(!1),w=X({select:l=>l.location.pathname}),h=/^\/studio\/[^/]+$/.test(w),{showInNav:v}=I();j.useEffect(()=>{let l=!0;const F=k=>{const p=k?.user;if(!p||p.is_anonymous===!0){b(null);return}const U=(p.email??"").toLowerCase(),H=(p.user_metadata?.display_name||p.user_metadata?.full_name||U).split(/[\s@.]+/).filter(
1Boolean).slice(0,2).map(J=>J[0]?.toUpperCase()??"").join("")||"U";b({email:U,initials:H})};_.auth.getSession().then(({data:k})=>{l&&F(k.session)});const{data:z}=_.auth.onAuthStateChange((k,p)=>{l&&F(p)});return()=>{l=!1,z.subscription.unsubscribe()}},[]);const f=q({queryKey:["public-quota-status"],queryFn:async()=>{const{data:l}=await _.auth.getSession();if(!l.session?.access_token)return{projectCount:0};try{return await o()}catch{return{projectCount:0}}},staleTime:3e4,refetchOnWindowFocus:"always",retry:!1}),x=f.data?.projectCount??0,N=!!d&&f.data&&f.data.isAnon===!1&&typeof f.data.remaining=="number",S=N?Math.max(f.data.remaining,0):0,C=N?Math.max(f.data.bonusRemaining??0,0):0,P=!!d&&f.data?.isStaff===!0,R=N&&S<=2;async function D(){await y.cancelQueries(),y.clear(),await _.auth.signOut(),i({to:"/",replace:!0})}const{openBanner:G,showBanner:K}=ee();j.useEffect(()=>{const l=document.documentElement;return h?l.setAttribute("data-public-project-controls",""):l.removeAttribute("data-public-project-controls"),()=>l.removeAttribute("data-public-project-controls")},[h]);const u=()=>m(!1);return e.jsxs("div",{"data-public":!0,className:`flex flex-col bg-background text-foreground ${t?"h-dvh overflow-hidden":"min-h-screen"}`,children:[e.jsxs("header",{className:"border-b border-border/60 backdrop-blur sticky top-0 z-30 bg-background/80",children:[e.jsx(we,{}),e.jsxs("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 h-16 grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3",children:[e.jsxs(r,{to:"/",className:"flex min-w-0 items-center gap-2 sm:gap-3",children:[e.jsx("img",{src:Q.url,alt:"Excel Sportswear",className:"h-8 sm:h-10 w-auto shrink-0"}),e.jsxs("div",{className:"leading-tight min-w-0",children:[e.jsx("div",{className:"font-display text-base sm:text-lg tracking-wider truncate",children:"Concept Studio AI"}),e.jsx("div",{className:"hidden sm:block text-[10px] uppercase tracking-[0.2em] text-muted-foreground -mt-1",children:"By Excel Sportswear"})]})]}),e.jsxs("nav",{className:"hidden sm:flex items-center gap-6 text-sm",children:[e.jsx(r,{to:"/studio-chat",className:`rounded-md px-3 py-1.5 font-medium transition-colors ${d?"bg-primary text-primary-foreground hover:bg-primary/90":"border border-border text-foreground hover:bg-secondary"}`,children:d?"New Concept":"Start Creating"}),v&&e.jsx(r,{to:"/challenge",className:"text-red-500 hover:text-red-400 font-medium",children:"Challenge"}),e.jsx(r,{to:"/pricing",className:"text-muted-foreground hover:text-foreground",children:"Pricing"}),e.jsx(r,{to:"/faq",className:"text-muted-foreground hover:text-foreground",children:"FAQ"}),e.jsxs(r,{to:"/my-concepts",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1.5",children:[e.jsx("span",{children:"My Concepts"}),x>0&&e.jsx("span",{className:"inline-flex items-center justify-center min-w-[1.25rem] h-5 px-1.5 rounded-full bg-primary text-primary-foreground text-[11px] font-semibold",children:x})]}),(N||P)&&e.jsx("span",{title:"Gifted credits are used first. Monthly credits refresh on the 1st.",className:`hidden md:inline-flex items-center rounded-full border px-2.5 h-6 text-[11px] font-medium ${R?"border-amber-500/40 bg-amber-500/10 text-amber-500":"border-border bg-secondary/60 text-muted-foreground"}`,children:P?"Unlimited staff access":`${S} concept${S===1?"":"s"} left${C>0?` (${C} gifted)`:""}`}),d?e.jsxs(le,{children:[e.jsx(ie,{className:"inline-flex items-center justify-center h-8 w-8 rounded-full bg-primary text-primary-foreground text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring",children:d.initials}),e.jsxs(me,{align:"end",className:"w-56",children:[e.jsx("div",{className:"px-2 py-1.5 text-xs text-muted-foreground truncate",children:d.email}),e.jsx(L,{}),e.jsx(O,{asChild:!0,children:e.jsx(r,{to:"/my-concepts",children:"My Concepts"})}),e.jsx(O,{asChild:!0,children:e.jsx(r,{to:"/account",children:"Account"})}),e.jsx(L,{}),e.jsx(O,{onSelect:()=>{D()},children:"Sign out"})]})]}):e.jsx(r,{to:"/login",className:"rounded-md border border-border px-3 py-1.5 hover:bg-secondary",children:"Sign in"})]}),e.jsxs("div",{className:"flex sm:hidden items-center gap-2",children:[x>0&&e.jsx(r,{to:"/my-concepts",className:"inline-flex items-center justify-center min-w-[1.5rem] h-6 px-1.5 rounded-full bg-primary text-primary-foreground text-[11px] font-semibold","aria-label":`My concepts (${x})`,children:x}),e.jsxs(te,{open:g,onOpenChange:m,children:[e.jsx(ae,{className:"inline-flex h-9 w-9 items-center justify-center rounded-md border border-border hover:bg-secondary","aria-label":"Open menu",children:e.jsx(he,{className:"h-5 w-5"})}),e.jsxs(re,{side:"right",className:"w-72 p-0",children:[e.jsx(se,{className:"border-b border-border/60 px-5 py-4",children:e.jsx(ne,{className:"font-display tracking-wider",children:"Concept Studio AI"})}),e.jsxs("nav",{className:"flex flex-col p-2 text-sm",children:[e.jsx(r,{to:"/studio-chat",onClick:u,className:`rounded-md px-3 py-3 font-medium transition-colors ${d?"bg-primary text-primary-foreground hover:bg-primary/90":"hover:bg-secondary"}`,children:d?"New Concept":"Start Creating"}),v&&e.jsx(r,{to:"/challenge",onClick:u,className:"rounded-md px-3 py-3 font-medium text-red-500 hover:bg-secondary",children:"Concept Challenge"}),e.jsx(r,{to:"/pricing",onClick:u,className:"rounded-md px-3 py-3 hover:bg-secondary",children:"Pricing"}),e.jsx(r,{to:"/faq",onClick:u,className:"rounded-md px-3 py-3 hover:bg-secondary",children:"FAQ"}),e.jsxs(r,{to:"/my-concepts",onClick:u,className:"flex items-center justify-between rounded-md px-3 py-3 hover:bg-secondary",children:[e.jsx("span",{children:"My Concepts"}),x>0&&e.jsx("span",{className:"inline-flex items-center justify-center min-w-[1.25rem] h-5 px-1.5 rounded-full bg-primary text-primary-foreground text-[11px] font-semibold",children:x})]}),(N||P)&&e.jsx("div",{className:`px-3 pb-2 text-[11px] ${R?"text-amber-500":"text-muted-foreground"}`,children:P?"Unlimited staff access":`${S} concept${S===1?"":"s"} left${C>0?` (${C} gifted)`:""}`}),e.jsx("div",{className:"my-2 h-px bg-border/60"}),d?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground truncate",children:d.email}),e.jsx(r,{to:"/account",onClick:u,className:"rounded-md px-3 py-3 hover:bg-secondary",children:"Account"}),e.jsx("button",{onClick:()=>{u(),D()},className:"rounded-md px-3 py-3 text-left hover:bg-secondary",children:"Sign out"})]}):e.jsx(r,{to:"/login",onClick:u,className:"rounded-md px-3 py-3 hover:bg-secondary",children:"Sign in"})]})]})]})]})]})]}),e.jsx("main",{"data-public-scroll":!0,className:t?"flex-1 min-h-0 overflow-y-auto":"flex-1",children:a}),!t&&e.jsx("footer",{className:"border-t border-border/60 mt-24",children:e.jsxs("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 py-10 space-y-6 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-6",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("img",{src:Q.url,alt:"Excel Sportswear",className:"h-10 sm:h-12 w-auto"}),e.jsxs("div",{children:["© ",new Date().getFullYear()," Excel Sportswear · Custom apparel since 1982."]})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-6 gap-y-2",children:[e.jsx("a",{href:"https://www.excelsportswear.com",target:"_blank",rel:"noopener noreferrer",className:"hover:text-foreground",children:"ExcelSportswear.com"}),e.jsx(r,{to:"/studio-chat",children:"Start a concept"}),v&&e.jsx(r,{to:"/challenge",children:"Concept Challenge"}),e.jsx(r,{to:"/challenge/gallery",children:"Challenge gallery"}),e.jsx(r,{to:"/pricing",children:"Pricing"}),e.jsx(r,{to:"/custom-construction-shirts",children:"Construction shirts"}),e.jsx(r,{to:"/faq",children:"FAQ"}),e.jsx(r,{to:"/consult",children:"Contact"}),d?e.jsx(r,{to:"/account",children:"Account"}):e.jsx(r,{to:"/login",children:"Sign in"}),e.jsx(r,{to:"/staff",className:"opacity-60 hover:opacity-100",children:"Excel staff sign in"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-5 gap-y-2 text-xs pt-4 border-t border-border/40",children:[e.jsx(r,{to:"/legal/terms",className:"hover:text-foreground",children:"Terms of Service"}),e.jsx(r,{to:"/legal/privacy",className:"hover:text-foreground",children:"Privacy Policy"}),e.jsx(r,{to:"/legal/ai-usage",className:"hover:text-foreground",children:"AI Usage Policy"}),e.jsx(r,{to:"/legal/ip",className:"hover:text-foreground",children:"Intellectual Property"})]})]})}),!t&&!K&&e.jsx("button",{onClick:G,className:"public-floating-control fixed left-4 z-50 flex h-9 w-9 items-center justify-center rounded-full border border-border bg-background/90 backdrop-blur shadow-lg hover:bg-muted transition-colors","aria-label":"Open cookie preferences",title:"Cookie preferences",children:e.jsx(ce,{className:"h-4 w-4 text-muted-foreground"})})]})}export{Ze as C,We as P,Me as a,qe as b,Ae as c,Ke as d,Ie as e,He as f,xe as g,Ve as h,Ee as i,Re as j,De as k,Qe as l,Fe as m,Ue as n,je as o,Je as p,Be as q,ze as r,Oe as s,ye as t,I as u,Ge as v,Le as w,$e as x,Ye as y};
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.