1import{c as $,j as e,S as q,C as S,a as oe,B as h,r as n,u as W,b as G,d as z,e as B,f as Y,s as R,g as F,X as se,H as _,h as ie,i as ne,E as le,k as ce,l as de,m as me,W as he,F as ue,n as xe,o as pe,p as ge,D as fe,q as ye,t as ve,v as be,w as je,x as we}from"./index-DO0ZNUzu.js";import{m as te,C as V,a as X,b as K,c as Q,d as Ne,e as Ce}from"./empowerment-young-queen-B07SGd_8.js";import{C as A}from"./camera-CQT33gaU.js";import{T as ae}from"./textarea-CcV1k9Cd.js";import{j as ke,m as Se}from"./validation-pKqCo0XP.js";import{P as Pe}from"./pen-line-DxoMXFq6.js";import{R as Ee}from"./rotate-ccw-BQUF485p.js";import{C as Ie}from"./check-Cyw8qn0D.js";import{U as De}from"./upload-5tqj8CNI.js";import{S as Z}from"./smile-DAGHp0Pv.js";import{M as Re,F as Me,S as Te,C as ze,a as _e,b as T,P as Ae}from"./Profile-BCJl3PsH.js";import{F as We}from"./filter-b1rxWdXb.js";import{C as Fe}from"./circle-DEg_pb6A.js";import{A as Ue}from"./AffirmationMirror-CAHZtQYV.js";import"./avatar-k1omA2Fi.js";import"./separator-CTR_znUr.js";import"./switch-t8rwWEdY.js";import"./progress-JqVFM1gN.js";import"./calendar-Dodd1r6N.js";import"./format-Cn6ElKJ8.js";import"./en-US-CXXYYhpC.js";import"./bell-Dc_RYjMz.js";import"./loader-circle-CZ_geqae.js";import"./user-Dd_SXVXr.js";import"./settings-cLgs3mni.js";import"./mail-rAjwM4rG.js";import"./usePremiumAccess-BYPsv9Ay.js";import"./house-CUUNLlcb.js";import"./square-BBuUZiRV.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const He=$("Coffee",[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]]);/** 7 * @license lucide-react v0.462.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const Le=$("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** 12 * @license lucide-react v0.462.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const Be=$("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),Ye="/assets/glow-up-girls-CwkO4CRw.png",ee=({onOpenMirror:c})=>e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"text-center space-y-2 px-4",children:[e.jsxs("h2",{className:"text-xl sm:text-2xl font-bold bg-gradient-primary bg-clip-text text-transparent flex items-center justify-center gap-2",children:[e.jsx(q,{className:"h-5 w-5 text-primary"}),"Your Affirmation Mirror"]}),e.jsx("p",{className:"text-sm sm:text-base text-muted-foreground",children:"Look into the mirror and speak love over yourself"})]}),e.jsx(S,{className:"border-2 border-dashed border-primary/30 bg-gradient-card overflow-hidden",children:e.jsxs(oe,{className:"p-0",children:[e.jsxs("div",{className:"relative h-48 sm:h-64 w-full overflow-hidden",children:[e.jsx("img",{src:te,alt:"Girl smiling into mirror with affirmation notes",className:"w-full h-full object-cover",loading:"lazy"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background via-background/40 to-transparent"}),e.jsxs("div",{className:"absolute bottom-4 left-4 right-4 text-left",children:[e.jsx("p",{className:"text-foreground font-semibold text-lg sm:text-xl drop-shadow-sm",children:"Confidence starts with what you say to yourself."}),e.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Record a quick affirmation, play it back, and claim your power."})]})]}),e.jsxs("div",{className:"p-6 sm:p-8 text-center space-y-4",children:[e.jsx("div",{className:"inline-flex p-4 rounded-full bg-primary/10",children:e.jsx(A,{className:"h-8 w-8 text-primary"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"Speak Your Power"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-sm mx-auto",children:"Your mirror moment is a daily confidence boost. Take 30 seconds to see HER and celebrate HER."})]}),e.jsxs(h,{variant:"wellness",size:"lg",className:"gap-2 shadow-lg",onClick:c,children:[e.jsx(q,{className:"h-5 w-5"}),"Open Affirmation Mirror"]})]})]})})]}),qe=()=>{const[c,u]=n.useState(""),[y,d]=n.useState(0),[v,p]=n.useState(!1),{user:b}=W(),l=G(),m=["What are three things you love about yourself today?","Describe a moment this week when you felt truly confident. What made you feel that way?","What would you tell your younger self about self-worth and confidence?","How have you grown as a person in the past month?","What dreams are calling to your heart right now?","Write about a time when you overcame something challenging. How did it make you stronger?"],x=async()=>{var g;if(!(!b||!c.trim())){p(!0);try{const N=ke.safeParse({content:c});if(!N.success){const f=((g=N.error.errors[0])==null?void 0:g.message)||"Invalid journal entry";Y.error(f),p(!1);return}const{error:C}=await R.from("journal_entries").insert({user_id:b.id,content:N.data.content,prompt:m[y]});if(C)throw C;u(""),Y.success("Journal entry saved successfully!")}catch(N){console.error("Error saving journal entry:",N),Y.error("Failed to save journal entry. Please try again.")}finally{p(!1)}}},k=()=>{const g=(y+1)%m.length;d(g)};
16return e.jsxs("div",{className:"space-y-4 sm:space-y-6 relative",style:{backgroundImage:"linear-gradient(rgba(252, 231, 243, 0.95), rgba(251, 207, 232, 0.9)), url('https://images.unsplash.com/photo-1520637836862-4d197d17c80a?w=1200&h=800&fit=crop&crop=center')",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"},children:[e.jsxs("div",{className:"text-center space-y-2 px-4 py-6",children:[e.jsx("h2",{className:"text-xl sm:text-2xl font-bold bg-gradient-primary bg-clip-text text-transparent",children:"Confident Journaling"}),e.jsx("p",{className:"text-sm sm:text-base text-muted-foreground",children:"A safe space for reflection, growth, and self-discovery"})]}),e.jsx(S,{className:"p-4 sm:p-6 bg-gradient-card shadow-soft border-0",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(z,{className:"h-5 w-5 text-accent-gold"}),e.jsx("h3",{className:"text-sm sm:text-base font-semibold text-card-foreground",children:"Today's Reflection Prompt"})]}),e.jsx(h,{variant:"outline",size:"sm",onClick:k,className:"w-full sm:w-auto transition-gentle hover:bg-primary/5 min-h-[44px]",children:"New Prompt"})]}),e.jsx("div",{className:"p-3 sm:p-4 bg-gradient-wellness/10 rounded-lg border border-primary/20",children:e.jsxs("p",{className:"text-sm sm:text-base text-card-foreground font-medium italic leading-relaxed",children:['"',m[y],'"']})}),e.jsx(ae,{placeholder:"Start writing your thoughts here... Remember, this is your safe space to be honest and kind to yourself.",value:c,onChange:g=>u(g.target.value),className:"min-h-[160px] sm:min-h-[200px] resize-none border-border/50 focus:border-primary/50 transition-gentle text-sm sm:text-base"}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[e.jsxs("p",{className:"text-xs sm:text-sm text-muted-foreground text-center sm:text-left",children:[c.length," characters written"]}),e.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[e.jsx(h,{variant:"outline",onClick:()=>u(""),className:"flex-1 sm:flex-none min-h-[44px]",children:"Clear"}),e.jsxs(h,{variant:"wellness",onClick:x,disabled:!c.trim()||v,className:"flex-1 sm:flex-none transition-gentle min-h-[44px]",children:[e.jsx(Pe,{className:"h-4 w-4 mr-2"}),v?"Saving...":"Save Entry"]})]})]})]})}),e.jsx(S,{className:"p-4 sm:p-6 bg-gradient-card shadow-soft border-0",children:e.jsxs("div",{className:"space-y-3 text-center sm:text-left",children:[e.jsx("h3",{className:"text-sm sm:text-base font-semibold text-card-foreground",children:"Your Journaling Journey"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Browse and search your past journal entries with powerful filters"}),e.jsxs(h,{variant:"outline",onClick:()=>l("/journal-history"),className:"w-full sm:w-auto min-h-[44px]",children:[e.jsx(B,{className:"h-4 w-4 mr-2"}),"View Journal History"]})]})}),e.jsx(S,{className:"p-4 sm:p-6 bg-gradient-card shadow-soft border-0 border-l-4 border-l-primary",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"h-5 w-5 text-primary"}),e.jsx("h3",{className:"text-sm sm:text-base font-semibold text-card-foreground",children:"HERPower E-book Notes"})]}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Take notes while working through the HERPower Teens or Women's E-books. Keep all your insights, reflections, and action items organized in one place."}),e.jsxs(h,{variant:"wellness",onClick:()=>l("/ebook-notes"),className:"w-full sm:w-auto min-h-[44px]",children:[e.jsx(B,{className:"h-4 w-4 mr-2"}),"Open E-book Notes"]})]})})]})},$e=({isOpen:c,onClose:u,onCapture:y})=>{const d=n.useRef(null),v=n.useRef(null),[p,b]=n.useState(null),[l,m]=n.useState("environment"),[x,k]=n.useState([]),[g,N]=n.useState(null),[C,f]=n.useState(!1),[t,a]=n.useState(null),{toast:r}=F();n.useEffect(()=>(c?P():(w(),a(null)),()=>{w()}),[c]);const P=async j=>
16{try{p&&p.getTracks().forEach(i=>i.stop());const E=j?{deviceId:{exact:j},width:{ideal:1280},height:{ideal:720}}:{facingMode:l,width:{ideal:1280},height:{ideal:720}},D=await navigator.mediaDevices.getUserMedia({video:E,audio:!1});b(D);const o=D.getVideoTracks()[0].getSettings();N(o.deviceId||null);try{const i=await navigator.mediaDevices.enumerateDevices();k(i.filter(I=>I.kind==="videoinput"))}catch(i){console.warn("enumerateDevices failed",i)}d.current&&(d.current.srcObject=D,await d.current.play())}catch(E){console.error("Camera access error:",E),r({title:"Camera Error",description:"Unable to access camera. Please check permissions.",variant:"destructive"})}},w=()=>{p&&(p.getTracks().forEach(j=>j.stop()),b(null))},M=async()=>{try{console.log("Toggle camera clicked");const j=x.length?x:(await navigator.mediaDevices.enumerateDevices()).filter(o=>o.kind==="videoinput");if(j.length<2){r({title:"Single Camera Detected",description:"This device has only one camera available."});return}const D=((g?j.findIndex(o=>o.deviceId===g):0)+1)%j.length,s=j[D].deviceId;await P(s),m(o=>o==="user"?"environment":"user")}catch(j){console.error("Camera toggle error:",j),r({title:"Camera Switch Error",description:"Unable to switch camera. Please check permissions.",variant:"destructive"})}},U=()=>{if(!d.current||!v.current)return;console.log("Take photo clicked"),f(!0);const j=d.current,E=v.current,D=E.getContext("2d");if(D){E.width=j.videoWidth,E.height=j.videoHeight,D.drawImage(j,0,0,E.width,E.height);const s=E.toDataURL("image/jpeg",.8);a(s)}setTimeout(()=>f(!1),200)},H=()=>{t&&(y(t),u(),r({title:"Photo Captured!",description:"Your photo has been added to the mood board."}))},L=()=>{a(null)};return c?e.jsx("div",{className:"fixed inset-0 bg-black/90 z-50 flex items-center justify-center p-4 overflow-y-auto",children:e.jsx(S,{className:"w-full max-w-2xl bg-black border-0 overflow-hidden",children:e.jsxs("div",{className:"relative",children:[e.jsx(h,{variant:"ghost",size:"sm",onClick:u,className:"absolute top-4 right-4 z-10 text-white hover:bg-white/20 rounded-full h-10 w-10 p-0",children:e.jsx(se,{className:"h-5 w-5"})}),e.jsxs("div",{className:"relative aspect-[4/3] bg-black",children:[t?e.jsx("img",{src:t,alt:"Captured",className:"w-full h-full object-cover"}):e.jsx("video",{ref:d,autoPlay:!0,playsInline:!0,muted:!0,className:"w-full h-full object-cover"}),e.jsx("canvas",{ref:v,className:"hidden"}),C&&e.jsx("div",{className:"absolute inset-0 bg-white opacity-50 animate-ping"})]}),e.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-6 bg-gradient-to-t from-black/80 to-transparent z-10 pointer-events-auto",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(h,{variant:"ghost",size:"lg",onClick:M,disabled:!!t,className:"text-white hover:bg-white/20 rounded-full h-12 w-12 p-0",children:e.jsx(Ee,{className:"h-6 w-6"})}),t?e.jsxs("div",{className:"flex gap-4",children:[e.jsx(h,{variant:"ghost",size:"lg",onClick:L,className:"text-white hover:bg-white/20 rounded-full h-12 px-6",children:"Retake"}),e.jsxs(h,{variant:"default",size:"lg",onClick:H,className:"bg-primary hover:bg-primary/90 rounded-full h-12 px-6",children:[e.jsx(Ie,{className:"h-5 w-5 mr-2"}),"Use Photo"]})]}):e.jsx(h,{variant:"default",size:"lg",onClick:U,className:"bg-white text-black hover:bg-white/90 rounded-full h-16 w-16 p-0",children:e.jsx(A,{className:"h-8 w-8"})}),e.jsx("div",{className:"w-12"})]})})]})})}):null},Ge=()=>{const[c,u]=n.useState(null),[y,d]=n.useState(null),[v,p]=n.useState([]),[b,l]=n.useState([]),[m,x]=n.useState(""),[k,g]=n.useState(!1),[N,C]=n.useState(!1),f=n.useRef(null),{toast:t}=F(),a=s=>{const o=s.target.files;o&&Array.from(o).forEach(i=>{if(i.type.startsWith("image/")){const I=new FileReader;I.onload=O=>{var J;(J=O.target)!=null&&J.result&&l(re=>[...re,O.target.result])},I.readAsDataURL(i)}})},r=s=>{l(o=>o.filter((i,I)=>I!==s))},P=()=>{var s;(s=f.current)==null||s.click()},w=async()=>{var s,o;try{if((o=(s=V)==null?void 0:s.isNativePlatform)!=null&&o.call(s)){const i=await X.getPhoto({quality:90,allowEditing:!0,resultType:K.DataUrl,source:Q.Camera});i.dataUrl&&(l(I=>[...I,i.dataUrl]),t({title:"Photo Added!",description:"Your photo has been added to the mood board."}));return}C(!0)}catch(i){console.error("Camera error:",i),t({title:"Camera Error",description:"Opening c
16amera interface.",variant:"destructive"}),C(!0)}},M=s=>{l(o=>[...o,s]),C(!1)},U=async()=>{var o;if(!c||!y){t({title:"Missing Information",description:"Please select both a mood and weather before saving.",variant:"destructive"});return}const s=Se.safeParse({notes:m||null});if(!s.success){const i=((o=s.error.errors[0])==null?void 0:o.message)||"Invalid notes content";t({title:"Validation Error",description:i,variant:"destructive"});return}g(!0);try{const{data:{user:i}}=await R.auth.getUser();if(!i){t({title:"Authentication Required",description:"Please sign in to save your check-in.",variant:"destructive"});return}const{error:I}=await R.from("mood_checkins").insert([{user_id:i.id,selected_mood:c,selected_weather:y,selected_colors:v,uploaded_images:b,notes:s.data.notes}]);if(I)throw I;t({title:"Check-in Saved!",description:"Your mood board check-in has been saved successfully."}),u(null),d(null),p([]),l([]),x("")}catch(i){console.error("Error saving check-in:",i),t({title:"Save Failed",description:"Unable to save your check-in. Please try again.",variant:"destructive"})}finally{g(!1)}},H=s=>{p(o=>o.includes(s)?o.filter(i=>i!==s):[...o,s])},L=async()=>{var s,o;try{if((o=(s=V)==null?void 0:s.isNativePlatform)!=null&&o.call(s)){const i=await X.getPhoto({quality:90,allowEditing:!0,resultType:K.DataUrl,source:Q.Photos});i.dataUrl&&(l(I=>[...I,i.dataUrl]),t({title:"Photo Added!",description:"Your photo has been added from gallery."}))}else P()}catch(i){console.error("Gallery error:",i),t({title:"Gallery Error",description:"Unable to access photo gallery. Using file picker instead.",variant:"destructive"}),P()}},j=[{id:"amazing",icon:Z,label:"Amazing",color:"text-accent-gold"},{id:"good",icon:Z,label:"Good",color:"text-primary"},{id:"okay",icon:Re,label:"Okay",color:"text-muted-foreground"},{id:"low",icon:Me,label:"Low",color:"text-secondary-foreground"}],E=[{id:"sunny",icon:Te,label:"Sunny",color:"text-accent-gold"},{id:"cloudy",icon:ze,label:"Cloudy",color:"text-muted-foreground"},{id:"rainy",icon:_e,label:"Rainy",color:"text-primary"}],D=[{hex:"#D8B4FE",mood:"Calm & Creative",description:"Peaceful, imaginative"},{hex:"#F9A8D4",mood:"Love & Joy",description:"Compassionate, happy"},{hex:"#FEF3C7",mood:"Optimistic & Energetic",description:"Bright, motivated"},{hex:"#BBF7D0",mood:"Balanced & Growing",description:"Harmonious, fresh"},{hex:"#BFDBFE",mood:"Clear & Trusting",description:"Serene, confident"},{hex:"#DDD6FE",mood:"Intuitive & Dreamy",description:"Spiritual, reflective"}];return e.jsxs("div",{className:"min-h-screen pb-safe-area-inset-bottom",children:[e.jsxs("div",{className:"space-y-4 sm:space-y-6 px-4 max-w-4xl mx-auto overflow-y-auto h-full",children:[e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("h2",{className:"text-xl sm:text-2xl font-bold bg-gradient-primary bg-clip-text text-transparent",children:"Mood Board Check-In"}),e.jsx("p",{className:"text-sm sm:text-base text-muted-foreground",children:"Express how you're feeling today through colors, moods, and visuals"})]}),e.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[e.jsx(S,{className:"p-4 sm:p-6 bg-gradient-card shadow-soft border-0",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm sm:text-base font-semibold text-card-foreground",children:"How are you feeling today?"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:j.map(s=>{const o=s.icon,i=c===s.id;return e.jsxs(h,{variant:i?"wellness":"outline",onClick:()=>u(s.id),className:"flex flex-col items-center gap-2 h-auto py-4 sm:py-5 transition-gentle min-h-[60px] text-xs sm:text-sm",children:[e.jsx(o,{className:`h-5 w-5 sm:h-6 sm:w-6 ${i?"text-white":s.color}`}),e.jsx("span",{children:s.label})]},s.id)})})]})}),e.jsx(S,{className:"p-4 sm:p-6 bg-gradient-card shadow-soft border-0",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm sm:text-base font-semibold text-card-foreground",children:"What's your inner weather like?"}),e.jsx("div",{className:"grid grid-cols-3 gap-2 sm:gap-3",children:E.map(s=>{const o=s.icon,i=y===s.id;return e.jsxs(h,{variant:i?"wellness":"outline",onClick:()=>
16d(s.id),className:"flex flex-col items-center gap-2 h-auto py-4 sm:py-5 transition-gentle min-h-[60px] text-xs sm:text-sm",children:[e.jsx(o,{className:`h-5 w-5 sm:h-6 sm:w-6 ${i?"text-white":s.color}`}),e.jsx("span",{children:s.label})]},s.id)})})]})}),e.jsx(S,{className:"p-4 sm:p-6 bg-gradient-card shadow-soft border-0",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm sm:text-base font-semibold text-card-foreground",children:"Pick hearts that speak to you"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Each heart color represents different emotions and feelings"}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-4",children:D.map((s,o)=>{const i=v.includes(s.hex);return e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{onClick:()=>H(s.hex),className:`w-full flex items-center justify-center p-4 rounded-2xl border-2 min-h-[80px] ${i?"border-primary shadow-glow scale-105 bg-gradient-to-br from-primary/10 to-primary/5":"border-border/30 shadow-soft bg-gradient-to-br from-card/50 to-muted/20"} hover:scale-105 transition-gentle group`,children:e.jsx(_,{className:`w-10 h-10 sm:w-12 sm:h-12 ${i?"animate-pulse drop-shadow-lg":""} transition-all duration-300`,style:{color:s.hex,fill:s.hex,stroke:s.hex},fill:s.hex})}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs font-medium text-card-foreground",children:s.mood}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:s.description})]})]},o)})})]})}),e.jsx(S,{className:"p-4 sm:p-6 bg-gradient-card shadow-soft border-0",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm sm:text-base font-semibold text-card-foreground",children:"Add a visual memory"}),e.jsx("input",{ref:f,type:"file",accept:"image/*",capture:"environment",multiple:!0,onChange:a,className:"hidden"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs(h,{onClick:w,variant:"outline",className:"flex flex-col items-center gap-2 h-auto py-6 transition-gentle min-h-[70px] text-sm touch-manipulation hover:bg-primary/5",children:[e.jsx(A,{className:"h-6 w-6 sm:h-7 sm:w-7 text-primary"}),e.jsx("span",{className:"font-medium",children:"Take Photo"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Camera"})]}),e.jsxs(h,{onClick:L,variant:"outline",className:"flex flex-col items-center gap-2 h-auto py-6 transition-gentle min-h-[70px] text-sm touch-manipulation hover:bg-primary/5",children:[e.jsx(De,{className:"h-6 w-6 sm:h-7 sm:w-7 text-primary"}),e.jsx("span",{className:"font-medium",children:"From Gallery"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Photos"})]})]}),e.jsxs("div",{className:"border-2 border-dashed border-border/50 rounded-lg p-4 sm:p-6 text-center",children:[e.jsx(A,{className:"h-8 w-8 mx-auto text-muted-foreground mb-2"}),e.jsx("p",{className:"text-muted-foreground text-xs sm:text-sm",children:"Capture photos with your camera or select from your gallery"})]})]}),b.length>0&&e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3 mt-4",children:b.map((s,o)=>e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"p-2 bg-gradient-card rounded-xl shadow-soft border border-border/20",children:e.jsx("img",{src:s,alt:`Mood visual ${o+1}`,className:"w-full h-32 object-cover rounded-lg"})}),e.jsx("button",{onClick:()=>r(o),className:"absolute top-1 right-1 bg-black/50 text-white rounded-full p-1 opacity-0 group-hover:opacity-100 transition-all",children:e.jsx(se,{className:"h-3 w-3"})})]},o))})]})}),e.jsx(S,{className:"p-6 bg-gradient-card shadow-soft border-0",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"font-semibold text-card-foreground",children:"Add your thoughts (optional)"}),e.jsx(ae,{placeholder:"How are you feeling today? What's on your mind? (Max 2000 characters)",value:m,onChange:s=>x(s.target.value),className:"min-h-[120px] resize-none border-border/50 focus:border-primary/50 transition-gentle",maxLength:2e3}),e.jsxs("div",{className:"flex justify-between items-center text-sm text-muted-foreground",children:[e.jsx("span",{children:"Share your thoughts safely and privately"}),e.jsxs("span",{children:[m.length,"/2000 characters"]})]})]})})]}),e.jsx("div",{className:"flex justify-center pt-4 pb-8",children:e.jsx(h,{variant:"wellness",className:"w-full sm:w-auto px-8 sm:px-12 min-h-[52px] text-base font-medium",onClick:U,disabled:k,children:k?"S
16aving...":"Save Today's Check-In"})}),e.jsx("div",{className:"h-24 sm:h-8"})]}),e.jsx($e,{isOpen:N,onClose:()=>C(!1),onCapture:M})]})},Oe="/assets/mindfulness-peaceful-power-CaWBFWzq.jpg",Je="/assets/mother-daughter-bond-DGXhywXe.jpg",Ve="/assets/mirror-reflection-self-love-i1VJuxwm.webp",Xe="/assets/sisters-united-community-CVo-Vh3_.jpg",Ke="/assets/sisterhood-circle-community-DBJp4qFr.jpg",Qe="/assets/self-acceptance-self-love-L47kPDR1.jpg",Ze={"550e8400-e29b-41d4-a716-446655440008":Oe,"550e8400-e29b-41d4-a716-446655440006":Je,"550e8400-e29b-41d4-a716-446655440011":Ve,"550e8400-e29b-41d4-a716-446655440015":te,"550e8400-e29b-41d4-a716-446655440003":Xe,"550e8400-e29b-41d4-a716-446655440009":Ke,"550e8400-e29b-41d4-a716-446655440012":Ne,"550e8400-e29b-41d4-a716-446655440013":Qe,"550e8400-e29b-41d4-a716-446655440002":Ce},es=()=>{const[c,u]=n.useState([]),[y,d]=n.useState("all"),[v,p]=n.useState(!0),[b,l]=n.useState(new Set),{user:m}=W(),{toast:x}=F();n.useEffect(()=>{k()},[]);const k=async()=>{try{const{data:t,error:a}=await R.from("inspiration_gallery").select("*").eq("is_active",!0).order("created_at",{ascending:!1});if(a)throw a;u(t||[])}catch(t){console.error("Error fetching inspiration images:",t)}finally{p(!1)}},g=t=>{if(!m){x({title:"Authentication Required",description:"Please sign in to save inspiration.",variant:"destructive"});return}l(a=>{const r=new Set(a);return r.has(t)?(r.delete(t),x({title:"Removed from favorites",description:"Image removed from your inspiration collection."})):(r.add(t),x({title:"Added to favorites! â¤ï¸",description:"Saved to your inspiration collection."})),r})},N=async t=>{const a=`"${t.title}" - ${t.description} | HERPower Inspiration Gallery â¨`,r=window.location.origin;try{navigator.share?(await navigator.share({title:t.title,text:a,url:r}),x({title:"Shared successfully! â¨",description:"Thanks for spreading inspiration!"})):(await navigator.clipboard.writeText(a+` 17`+r),x({title:"Copied to clipboard! ð",description:"Share this inspiration with others!"}))}catch(P){console.error("Error sharing:",P);try{await navigator.clipboard.writeText(a+` 18`+r),x({title:"Copied to clipboard! ð",description:"Share this inspiration with others!"})}catch{x({title:"Share Error",description:"Unable to share at this time.",variant:"destructive"})}}},C=["all",...Array.from(new Set(c.map(t=>t.category)))],f=y==="all"?c:c.filter(t=>t.category===y);return v?e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"Loading inspiration..."})]})}):e.jsxs("div",{className:"space-y-6 relative",style:{backgroundImage:"linear-gradient(rgba(252, 231, 243, 0.95), rgba(251, 207, 232, 0.9)), url('https://images.unsplash.com/photo-1488426862026-3ee34a7d66df?w=1200&h=800&fit=crop&crop=center')",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"},children:[e.jsxs("div",{className:"text-center space-y-4 px-4 py-6",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-4",children:[e.jsx(z,{className:"h-6 w-6 text-accent-gold"}),e.jsx("h2",{className:"text-xl sm:text-2xl font-bold bg-gradient-primary bg-clip-text text-transparent",children:"Inspiration Gallery"})]}),e.jsx("p",{className:"text-sm sm:text-base text-muted-foreground max-w-2xl mx-auto",children:"Be inspired by the strength, beauty, and power of women from all walks of life. Let their stories fuel your own journey of self-love and empowerment."})]}),e.jsx("div",{className:"flex flex-wrap justify-center gap-2 px-4",children:C.map(t=>e.jsxs(h,{variant:y===t?"default":"outline",size:"sm",onClick:()=>d(t),className:"capitalize",children:[e.jsx(We,{className:"h-3 w-3 mr-1"}),t]},t))}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6 px-4",children:f.map(t=>e.jsxs(S,{className:"overflow-hidden bg-gradient-card shadow-soft border-0 group hover:shadow-elegant transition-all duration-300",children:[e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:Ze[t.id]||t.image_url,alt:t.title,className:"w-full h-48 sm:h-56 object-cover group-hover:scale-105 transition-transform duration-300",loading:"lazy"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-trans
18parent to-transparent"}),e.jsx("div",{className:"absolute top-3 right-3",children:e.jsx(ie,{variant:"secondary",className:"bg-white/90 text-card-foreground backdrop-blur-sm",children:t.category})})]}),e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsx("h3",{className:"font-semibold text-card-foreground group-hover:text-primary transition-colors",children:t.title}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:t.description}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[e.jsxs(h,{variant:"ghost",size:"sm",onClick:()=>g(t.id),className:`transition-gentle ${b.has(t.id)?"text-primary hover:text-primary":"text-muted-foreground hover:text-primary"}`,children:[e.jsx(_,{className:`h-4 w-4 mr-1 ${b.has(t.id)?"fill-current":""}`}),"Inspire me"]}),e.jsxs(h,{variant:"ghost",size:"sm",onClick:()=>N(t),className:"text-muted-foreground hover:text-primary transition-gentle",children:[e.jsx(Be,{className:"h-4 w-4 mr-1"}),"Share"]})]})]})]},t.id))}),f.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(z,{className:"h-16 w-16 text-muted-foreground/50 mx-auto mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"No inspiration images found for this category."})]})]})},ss=({onShowAffirmationMirror:c})=>{const[u,y]=n.useState([]),[d,v]=n.useState(new Set),[p,b]=n.useState(!1),{user:l}=W(),{toast:m}=F();G(),n.useEffect(()=>{l&&(x(),k())},[l]);const x=async()=>{try{const{data:a,error:r}=await R.from("challenges").select("*").eq("is_active",!0).order("difficulty",{ascending:!0});if(r)throw r;y(a||[])}catch(a){console.error("Error fetching challenges:",a)}},k=async()=>{try{if(!l)return;const a=new Date;a.setHours(0,0,0,0);const{data:r,error:P}=await R.from("user_challenge_completions").select("challenge_id").eq("user_id",l.id).gte("completed_at",a.toISOString());if(P)throw P;const w=new Set((r==null?void 0:r.map(M=>M.challenge_id))||[]);v(w)}catch(a){console.error("Error fetching completed challenges:",a)}},g=async a=>{if(!l){m({title:"Authentication Required",description:"Please sign in to complete challenges.",variant:"destructive"});return}const r=u.find(w=>w.id===a);if((r==null?void 0:r.action)==="affirmation-mirror"&&c&&c(),d.has(a)){m({title:"Already Completed",description:"You've already completed this challenge today!",variant:"destructive"});return}b(!0);try{const{error:w}=await R.from("user_challenge_completions").insert([{user_id:l.id,challenge_id:a,points_earned:(r==null?void 0:r.points)||0}]);if(w)throw w;await R.rpc("update_user_points",{user_uuid:l.id,points_to_add:(r==null?void 0:r.points)||0}),m({title:"Challenge Completed!",description:`Great job! You earned ${r==null?void 0:r.points} points.`}),v(M=>new Set([...M,a]))}catch(w){console.error("Error completing challenge:",w),m({title:"Error",description:"Failed to complete challenge. Please try again.",variant:"destructive"})}finally{b(!1)}},N=a=>{switch(a){case"Easy":return"bg-gradient-gold";case"Medium":return"bg-gradient-primary";case"Hard":return"bg-gradient-wellness";default:return"bg-gradient-gold"}},C=a=>({Heart:_,Eye:le,Coffee:He,Sparkles:z,Star:q})[a]||_,f=d.size,t=u.filter(a=>d.has(a.id)).reduce((a,r)=>a+r.points,0);return e.jsxs("div",{className:"space-y-6 relative",style:{backgroundImage:"linear-gradient(rgba(252, 231, 243, 0.95), rgba(251, 207, 232, 0.9)), url('https://images.unsplash.com/photo-1544367567-0f2fcb009e0b?w=1200&h=800&fit=crop&crop=center')",backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"},children:[e.jsxs("div",{className:"text-center space-y-2 px-4 py-6",children:[e.jsx("h2",{className:"text-xl sm:text-2xl font-bold bg-gradient-primary bg-clip-text text-transparent",children:"Daily Self-Love Challenges"}),e.jsx("p",{className:"text-sm sm:text-base text-muted-foreground",children:"Small acts of self-love that make a big difference"})]}),e.jsx(S,{className:"p-6 bg-gradient-card shadow-soft border-0",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("h3",{className:"font-semibold text-card-foreground",children:"Today's Progress"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-2xl font-bold text-primary",children:[f,"/",u.length]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Completed"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-2xl font-bold text-accent-gold",children:t}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Points Earned"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-2xl font-bold text-secondary-foreground",children:[u.length>0?Math.round(f/u.length*100):0,"%"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Complete"})]})]})]})}),e.jsx("div",{className:"space-y-4",children:u.map(a=>{const r=d.has(a.id),P=C(a.icon);return e.jsx(S,{className:`p-6 transition-gentle cursor-pointer hover:shadow-soft ${r?"bg-gradient-wellness/10 border-primary/30":"bg-gradient-card border-0"}`,onClick:()=>g(a.id),children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"flex-shrink-0",children:r?e.jsx(ne,{className:"h-6 w-6 text-primary"}):e.jsx(Fe,{className:"h-6 w-6 text-muted-foreground"})}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(P,{className:"h-5 w-5 text-primary"}),e.jsx("h3",{className:`font-semibold ${r?"line-through text-muted-foreground":"text-card-foreground"}`,children:a.title})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`px-2 py-1 text-xs font-medium rounded-full ${N(a.difficulty)} text-white`,children:a.difficulty}),e.jsxs("span",{className:"text-sm font-medium text-accent-gold",children:["+",a.points,"pts"]})]})]}),e.jsx("p",{className:`text-sm ${r?"line-through text-muted-foreground":"text-muted-foreground"}`,children:a.description}),!r&&e.jsx(h,{variant:"outline",size:"sm",onClick:w=>{w.stopPropagation(),g(a.id)},disabled:p,className:"transition-gentle hover:bg-primary/5",children:a.action==="affirmation-mirror"?"Open Mirror":"Mark Complete"})]})]})},a.id)})}),u.length>0&&f===u.length&&e.jsx(S,{className:"p-6 bg-gradient-wellness/10 border-primary/30 text-center",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx(z,{className:"h-8 w-8 mx-auto text-accent-gold"}),e.jsx("h3",{className:"font-semibold text-card-foreground",children:"Amazing Work Today! â¨"}),e.jsx("p",{className:"text-muted-foreground",children:"You've completed all your self-love challenges. You're building such beautiful habits!"}),e.jsx(h,{variant:"gold",className:"mt-3",children:"Share Your Success"})]})})]})},Rs=()=>{const[c,u]=n.useState("feed"),[y,d]=n.useState(!1),[v,p]=n.useState(!1),b=G(),{user:l,loading:m}=W(),{hasCompletedOnboarding:x,startOnboarding:k}=ce();de("Your Dashboard | HERPower","Check in, reflect, and celebrate your progress in your HERPower dashboard."),n.useEffect(()=>{!m&&!l&&b("/auth")},[m,l,b]),n.useEffect(()=>{if(!m&&l&&!localStorage.getItem("hasSeenWelcomeDialog")&&!x){const t=setTimeout(()=>{p(!0)},1e3);return()=>clearTimeout(t)}},[m,l,x]);const g=()=>{localStorage.setItem("hasSeenWelcomeDialog","true"),p(!1),setTimeout(()=>{k()},300)},N=()=>{localStorage.setItem("hasSeenWelcomeDialog","true"),p(!1)};n.useEffect(()=>{const f=localStorage.getItem("hasSeenWelcomeDialog");if(!m&&l&&!x&&f&&!v){const t=setTimeout(()=>{k()},1500);return()=>clearTimeout(t)}},[m,l,x,k,v]);const C=()=>{switch(c){case"feed":return e.jsx(ee,{onOpenMirror:()=>d(!0)});case"journal":return e.jsx(qe,{});case"mood":return e.jsx(Ge,{});case"inspiration":return e.jsx(es,{});case"challenges":return e.jsx(ss,{onShowAffirmationMirror:()=>d(!0)});case"profile":return e.jsx(Ae,{});default:return e.jsx(ee,{onOpenMirror:()=>d(!0)})}};return m||!l?e.jsxs("div",{className:"min-h-screen bg-background","aria-busy":"true","aria-live":"polite",children:[e.jsx("span",{className:"sr-only",children:"Loading your dashboard"}),e.jsx("div",{className:"w-full px-4 sm:px-6 md:px-8 py-2 flex justify-center",children:e.jsx(T,{className:"h-14 sm:h-16 lg:h-20 w-40 rounded-2xl"})}),e.jsxs("div",{className:"border-b border-border/50 px-4 sm:px-6 py-2.5 flex items-center justify-between",children:[e.jsx(T,{className:"h-5 w-40 rounded-full"}),e.jsx(T,{className:"h-10 w-24 rounded-full"})]}),e.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 py-6 space-y-6",children:[e.jsx(T,{className:"h-40 w-full rounded-3xl"}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[0,1,2,3].map(f=>e.jsx(T,{className:"h-24 w-full rounded-2xl"},f))}),e.jsx(T,{className:"h-56 w-full rounded-3xl"}),e.jsx(T,{className:"h-40 w-full rounded-3xl"})]})]}):e.jsxs("div",{className:"min-h-screen bg-background flex flex-col",children:[e.jsx("header",{className:"w-full px-4 sm:px-6 md:px-8 py-2 flex justify-center",children:e.jsx("img",{src:me,alt:"HERPower logo",className:"h-14 sm:h-16 lg:h-20 w-auto drop-shadow-md"})}),!y&&e.jsx(he,{activeTab:c,onTabChange:u,onShowAffirmationMirror:()=>d(!0)}),e.jsx("main",{id:"wellness-content",className:"relative z-0 flex-1 w-full pb-24 lg:pb-8",children:e.jsx("div",{className:"w-full px-4 sm:px-6 md:px-8 lg:px-12 xl:px-16 pb-12 lg:pb-16 xl:pb-20 pt-4 lg:pt-6",children:e.jsxs("div",{className:"max-w-4xl lg:max-w-5xl xl:max-w-6xl 2xl:max-w-7xl mx-auto w-full space-y-6",children:[c==="feed"&&e.jsxs("div",{className:"relative overflow-hidden rounded-3xl shadow-soft",children:[e.jsx("img",{src:Ye,alt:"Four smiling teenage girls taking a selfie together",className:"w-full h-40 sm:h-52 lg:h-64 object-cover object-top",loading:"lazy",width:1280,height:720}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/50 via-black/10 to-transparent"}),e.jsxs("div",{className:"absolute bottom-3 left-4 sm:bottom-4 sm:left-6 text-left",children:[e.jsx("p",{className:"text-white text-lg sm:text-2xl lg:text-3xl font-bold drop-shadow-md",children:"Your daily glow-up starts here â¨"}),e.jsx("p",{className:"text-white/90 text-xs sm:text-sm lg:text-base drop-shadow",children:"Check in, reflect, and celebrate HER â one day at a time."})]})]}),C()]})})}),e.jsx(ue,{}),e.jsx(xe,{}),e.jsx(pe,{}),e.jsx(ge,{}),y&&e.jsx(Ue,{onClose:()=>d(!1)}),e.jsx(fe,{open:v,onOpenChange:p,children:e.jsxs(ye,{className:"sm:max-w-md bg-gradient-card border-primary/20",children:[e.jsxs(ve,{children:[e.jsx("div",{className:"flex items-center justify-center mb-4",children:e.jsx("div",{className:"h-16 w-16 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx(Le,{className:"h-8 w-8 text-primary animate-pulse"})})}),e.jsx(be,{className:"text-center text-2xl",children:"Welcome to HERPower! ð"}),e.jsxs(je,{className:"text-center text-base space-y-3 pt-2",children:[e.jsx("p",{className:"text-foreground
18/90",children:"We're so glad you're here! Let us show you around with a quick guided tour."}),e.jsx("p",{className:"text-muted-foreground",children:"You'll discover all the amazing features designed to support your wellness journey, from daily affirmations to mood tracking and more."})]})]}),e.jsxs(we,{className:"flex-col sm:flex-row gap-2 sm:gap-3",children:[e.jsx(h,{variant:"outline",onClick:N,className:"w-full sm:w-auto",children:"Skip for Now"}),e.jsxs(h,{variant:"wellness",onClick:g,className:"w-full sm:w-auto",children:[e.jsx(z,{className:"h-4 w-4 mr-2"}),"Start Tour"]})]})]})})]})};export{Rs as default};
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.