PageSourceSearch

https://doby-81f58.web.app/assets/ProfilePage-Cyrdntli.js

js doby-81f58.web.app collected 2026-10-03 12:21:49 UTC 22,933 bytes, 1 lines download raw bytes

1import{r as S,t as M,s as k,j as e}from"./index-CwKD2wDE.js";import{r as g,u as H,j as z}from"./vendor-D-i5EGkW.js";import{D as G}from"./DobyMainView-HWtfLg25.js";import{S as w}from"./summary-star-CyqNW9dU.js";import"./supabase-m0LKVAH1.js";import"./i18n-B7UprdD3.js";import"./utils-BuRyS_ws.js";import"./apple-icon-By0rMb7b.js";const F="_profileBg_1dy6v_1",P="_profileLayout_1dy6v_12",O="_profileMenu_1dy6v_27",R="_profileMenuUser_1dy6v_48",q="_profileMenuList_1dy6v_57",W="_profileMenuBtn_1dy6v_85",Z="_selected_1dy6v_112",Q="_profileDetail_1dy6v_124",J="_profileDetailContent_1dy6v_139",K="_profileAvatar_1dy6v_158",X="_profileInfo_1dy6v_171",Y="_profileName_1dy6v_175",ee="_profileEmail_1dy6v_182",m={profileBg:F,profileLayout:P,profileMenu:O,profileMenuUser:R,profileMenuList:q,profileMenuBtn:W,selected:Z,profileDetail:Q,profileDetailContent:J,profileAvatar:K,profileInfo:X,profileName:Y,profileEmail:ee},te="_profileContainer_10v0c_2",se="_profileDetailInfo_10v0c_11",ae="_profileDetailInfoItem_10v0c_18",ne="_profileDetailInfoLabel_10v0c_34",oe="_profileDetailInfoValue_10v0c_42",ce="_profileNicknameInput_10v0c_49",re="_profileNicknameBtn_10v0c_71",le="_profileLanguageGroup_10v0c_94",ie="_languageOption_10v0c_100",de="_active_10v0c_115",ue="_profileDetailActions_10v0c_125",_e="_logoutButton_10v0c_134",me="_deleteButton_10v0c_135",l={profileContainer:te,profileDetailInfo:se,profileDetailInfoItem:ae,profileDetailInfoLabel:ne,profileDetailInfoValue:oe,profileNicknameInput:ce,profileNicknameBtn:re,profileLanguageGroup:le,languageOption:ie,active:de,profileDetailActions:ue,logoutButton:_e,deleteButton:me},ge=({onLogoutRequest:s,onDeleteRequest:t})=>{const{profile:a,fetchAndUpdateProfile:i}=S(),{user:o}=M(),[p,f]=g.useState(!1),[C,j]=g.useState("ko"),[N,v]=g.useState(!1),[b,I]=g.useState(""),T=[{code:"ko",name:"한국어"},{code:"en",name:"English"}];g.useEffect(()=>{i()},[]),g.useEffect(()=>{a&&j(a.language||"ko")},[a]),g.useEffect(()=>{o!=null&&o.id&&k.from("users_data").select("display_name").eq("id",o.id).single().then(({data:r,error:y})=>{if(y){console.error("사용자 데이터 가져오기 오류:",y);return}r!=null&&r.display_name&&I(r.display_name)})},[o==null?void 0:o.id]);const d=async()=>{if(!(o!=null&&o.id)||b===o.user_metadata.name)return;v(!0);const{error:r}=await k.from("users_data").update({display_name:b}).eq("id",o.id);r&&console.error("Error updating nickname:",r),v(!1)},h=async r=>{if(j(r),a){v(!0);const{error:y}=await k.from("profiles").update({language:r}).eq("id",a.id);y&&console.error("Error updating language:",y),v(!1)}},D=()=>{s()},B=()=>{t()};return e.jsxs("div",{className:l.profileContainer,children:[e.jsxs("div",{className:l.profileDetailInfo,children:[e.jsxs("div",{className:l.profileDetailInfoItem,children:[e.jsx("span",{className:l.profileDetailInfoLabel,children:"요금제"}),e.jsxs("span",{className:l.profileDetailInfoValue,children:[(a==null?void 0:a.gpt_tier)==="free"&&"FREE",(a==null?void 0:a.gpt_tier)==="light"&&"LIGHT",(a==null?void 0:a.gpt_tier)==="plus"&&"PLUS",(a==null?void 0:a.gpt_tier)==="pro"&&"PRO"]})]}),e.jsxs("div",{className:l.profileDetailInfoItem,children:[e.jsx("span",{className:l.profileDetailInfoLabel,children:"이메일"}),e.jsx("span",{className:l.profileDetailInfoValue,children:o.email||"로그인 필요"})]}),e.jsxs("div",{className:l.profileDetailInfoItem,children:[e.jsx("span",{className:l.profileDetailInfoLabel,children:"닉네임"}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",width:"100%",gap:"0.75rem"},children:[e.jsx("input",{type:"text",value:b,placeholder:o.user_metadata.name||"닉네임을 입력해주세요",onChange:r=>{I(r.target.value),f(r.target.value!==o.user_metadata.name)},className:l.profileNicknameInput}),e.jsx("button",{onClick:d,disabled:!p||N,className:l.profileNicknameBtn,children:N?"변경 중...":"변경"})]})]}),e.jsxs("div",{className:l.profileDetailInfoItem,children:[e.jsx("span",{className:l.profileDetailInfoLabel,children:"언어"}),e.jsx("div",{className:l.profileLanguageGroup,children:T.map(r=>e.jsx("button",{className:`${l.languageOption} ${C===r.code?l.active:""}`,onClick:()=>h(r.code),type:"button",children:r.name},r.code))})]})]}),e.jsxs("div",{className:l.profileDetailActions,children:[e.jsx("button",{onClick:D,className:l.logoutButton,children:"로그아웃"}),e.jsx("button",{onClick:B,className:l.deleteButton,children:"회원 탈퇴"})]})]})},xe="_counterSection_976rh_1",he="_counterHeader_976rh_7",pe="_counterHeaderTitle_976rh_14",fe="_counterHeaderTier_976rh_20",ve="_counterStorage_976rh_28",Ce="_counterStorageTitle_976rh_36",Ne="_storageInfoContainer_976rh_42",je="_storageIcon_976rh_50",be="_storageProgressContainer_976rh_55",Ie="_barWrapper_976rh_60",Te="_barBackgroun
1d_976rh_68",ye="_barForeground_976rh_76",De="_barText_976rh_82",Be="_used_976rh_89",ke="_limit_976rh_94",Se="_counterStorageInfo_976rh_98",Ae="_counterUsage_976rh_106",Le="_counterUsageTitle_976rh_114",$e="_counterUsageGrid_976rh_122",Me="_counterUsageItem_976rh_129",c={counterSection:xe,counterHeader:he,counterHeaderTitle:pe,counterHeaderTier:fe,counterStorage:ve,counterStorageTitle:Ce,storageInfoContainer:Ne,storageIcon:je,storageProgressContainer:be,barWrapper:Ie,barBackground:Te,barForeground:ye,barText:De,used:Be,limit:ke,counterStorageInfo:Se,counterUsage:Ae,counterUsageTitle:Le,counterUsageGrid:$e,counterUsageItem:Me},we="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15.9934%2015.2293C14.1406%2016.0156%2011.9297%2016.4473%2010%2016.4473C8.07031%2016.4473%205.86445%2016.0059%204.00625%2015.2293C2.14805%2014.4527%201.875%2013.7953%201.875%2013.7953V15.2875C1.875%2016.5043%202.57812%2016.9922%204.50469%2017.8012C5.98164%2018.4215%207.93672%2018.75%2010%2018.75C12.0633%2018.75%2014.0184%2018.4215%2015.4953%2017.8012C17.4219%2016.9922%2018.125%2016.5043%2018.125%2015.2875V13.7953C18.125%2013.7953%2017.8461%2014.4434%2015.9934%2015.2293ZM2.48789%206.76641C2.92656%207.15078%203.57461%207.52773%204.36289%207.85703C6.02227%208.55078%208.13047%208.96523%2010.002%208.96523C11.8734%208.96523%2013.9816%208.55078%2015.641%207.85703C16.4273%207.52773%2017.0754%207.15078%2017.5141%206.76641C17.7508%206.55898%2017.9379%206.37109%2018.0402%206.26445C18.096%206.2062%2018.127%206.12867%2018.127%206.04805V5.02617C18.0941%203.90156%2017.1617%202.90078%2015.5016%202.2082C14.0168%201.59023%2012.0641%201.25%2010%201.25C7.93594%201.25%205.9832%201.59023%204.50234%202.2082C2.8457%202.89922%201.91406%203.89766%201.87695%205.01953V6.04805C1.87676%206.12861%201.90768%206.20614%201.96328%206.26445C2.06406%206.37109%202.25078%206.55898%202.48789%206.76641Z'%20fill='%236C5CE7'/%3e%3cpath%20d='M15.9934%208.66836C14.2578%209.41406%2011.9297%209.88633%2010%209.88633C8.07031%209.88633%205.74727%209.40703%204.00664%208.66836C2.26602%207.92969%201.875%207.23438%201.875%207.23438V9.08438C1.87812%209.37813%202.08984%209.71719%202.48789%2010.066C2.92695%2010.4504%203.57461%2010.8277%204.36289%2011.1566C6.02031%2011.8508%208.12852%2012.2656%2010%2012.2656C11.8715%2012.2656%2013.9797%2011.8516%2015.6391%2011.1574C16.4254%2010.8285%2017.0734%2010.4512%2017.5121%2010.0668C17.9125%209.71523%2018.1246%209.375%2018.125%209.07969V7.23438C18.125%207.23438%2017.7293%207.92266%2015.9934%208.66836Z'%20fill='%236C5CE7'/%3e%3cpath%20d='M15.9934%2011.9682C14.1406%2012.7346%2011.9297%2013.1861%2010%2013.1861C8.07031%2013.1861%205.7082%2012.6861%204.00664%2011.9682C2.30508%2011.2502%201.875%2010.5342%201.875%2010.5342V12.3408C1.875%2012.6357%202.0875%2012.9768%202.48789%2013.3275C2.92656%2013.7119%203.57422%2014.0893%204.36289%2014.4182C6.02227%2015.1123%208.13008%2015.5264%2010.002%2015.5264C11.8738%2015.5264%2013.9816%2015.1123%2015.641%2014.4182C16.4273%2014.0889%2017.0754%2013.7119%2017.5141%2013.3275C17.9121%2012.9787%2018.1238%2012.6396%2018.127%2012.3459V10.5342C18.127%2010.5342%2017.8465%2011.2018%2015.9934%2011.9682Z'%20fill='%236C5CE7'/%3e%3c/svg%3e",Ee="_webCounter_1il77_1",Ve="_counterTitleArea_1il77_8",Ue="_counterTitleIcon_1il77_15",He="_counterTitle_1il77_8",ze="_counterValueBlock_1il77_27",Ge="_valueTitleCountArea_1il77_34",Fe="_valueTitle_1il77_34",Pe="_unlimitedText_1il77_48",Oe="_valueCountArea_1il77_54",Re="_countText_1il77_61",qe="_totalText_1il77_67",We="_valueGauge_1il77_72",Ze="_gaugeBackground_1il77_81",Qe="_gaugeForeground_1il77_89",Je="_CountInfoArea_1il77_95",Ke="_CountInfo_1il77_95",u={webCounter:Ee,counterTitleArea:Ve,counterTitleIcon:Ue,counterTitle:He,counterValueBlock:ze,valueTitleCountArea:Ge,valueTitle:Fe,unlimitedText:Pe,valueCountArea:Oe,countText:Re,totalText:qe,valueGauge:We,gaugeBackground:Ze,gaugeForeground:Qe,CountInfoArea:Je,CountInfo:Ke},Xe=({className:s})=>{const{profile:t}=S(),a=(t==null?void 0:t.plus_trial_count)??0,i=a/5*100;return e.jsxs("div",{className:`${u.webCounter} ${s||""}`,children:[e.jsxs("div",{className:u.counterTitleArea,children:[e.jsx("img",{src:w,alt:"Summary Icon",className:u.counterTitleIcon}),e.jsx("div",{className:u.counterTitle,children:"정리 요약"})]}),e.jsxs("div",{className:u.counterValueBlock,children:[e.jsxs("div",{className:u.valueTitleCountArea,children:[e.jsx("div",{className:u.valueTitle,children:"현재 사용량"}),e.jsx("div",{className:u.valueCount,children:(t==null?void 0:t.gpt_tier)==="light"?e.jsx("div",{className:u.unlimitedText,children:"무제한"}):e.jsxs("div",{className:u.valueCountArea,children:[e.jsx("div",{className:u.countText,children:a}),e.jsx("div",{className:u.totalText,children:" / 5"})]})})]}),e.jsx("div",{className:u.valueGauge,children:e.jsx("div",{className:u.gaugeBackgroun
1d,children:e.jsx("div",{className:u.gaugeForeground,style:{width:`${(t==null?void 0:t.gpt_tier)==="light"?100:i}%`,backgroundColor:(t==null?void 0:t.gpt_tier)==="light"?"#DCD8FF":"#6C5CE7"}})})}),e.jsx("div",{className:u.CountInfoArea,children:(t==null?void 0:t.gpt_tier)==="light"?e.jsx("div",{className:u.CountInfo,children:"제한 없이 정리 요약을 사용해 보세요!"}):e.jsx("div",{className:u.CountInfo,children:"베타에서는 매달 5회의 정리 요약을 이용할 수 있습니다."})})]})]})},Ye="_deepSearchCount_1acdd_1",et="_counterTitleArea_1acdd_8",tt="_counterTitleIcon_1acdd_15",st="_counterTitle_1acdd_8",at="_counterValueBlock_1acdd_27",nt="_valueTitleCountArea_1acdd_34",ot="_valueTitle_1acdd_34",ct="_unlimitedText_1acdd_48",rt="_valueCountArea_1acdd_54",lt="_countText_1acdd_61",it="_totalText_1acdd_67",dt="_valueGauge_1acdd_72",ut="_gaugeBackground_1acdd_81",_t="_gaugeForeground_1acdd_89",mt="_CountInfoArea_1acdd_95",gt="_CountInfo_1acdd_95",_={deepSearchCount:Ye,counterTitleArea:et,counterTitleIcon:tt,counterTitle:st,counterValueBlock:at,valueTitleCountArea:nt,valueTitle:ot,unlimitedText:ct,valueCountArea:rt,countText:lt,totalText:it,valueGauge:dt,gaugeBackground:ut,gaugeForeground:_t,CountInfoArea:mt,CountInfo:gt},xt=({className:s})=>{const{profile:t,fetchAndUpdateProfile:a}=S();g.useEffect(()=>{(async()=>{const f=new Date().toISOString().split("T")[0],C=localStorage.getItem("deep_search_last_reset");if(t!=null&&t.id&&C!==f)try{await k.rpc("ensure_deep_search_window",{p_user:t.id}),await a(),localStorage.setItem("deep_search_last_reset",f)}catch(j){console.error("❌ 딥서칭 quota 초기화 실패:",j)}})()},[t==null?void 0:t.id]);const i=(t==null?void 0:t.deep_search_count)??0,o=i/((t==null?void 0:t.deep_search_limit)??0)*100;return e.jsxs("div",{className:`${_.deepSearchCount} ${s||""}`,children:[e.jsxs("div",{className:_.counterTitleArea,children:[e.jsx("img",{src:w,alt:"Summary Icon",className:_.counterTitleIcon}),e.jsx("div",{className:_.counterTitle,children:"딥 서칭"})]}),e.jsxs("div",{className:_.counterValueBlock,children:[e.jsxs("div",{className:_.valueTitleCountArea,children:[e.jsx("div",{className:_.valueTitle,children:"현재 사용량"}),e.jsx("div",{className:_.valueCount,children:(t==null?void 0:t.gpt_tier)==="light"?e.jsx("div",{className:_.unlimitedText,children:"무제한"}):e.jsxs("div",{className:_.valueCountArea,children:[e.jsx("div",{className:_.countText,children:i}),e.jsxs("div",{className:_.totalText,children:[" / ",t==null?void 0:t.deep_search_limit]})]})})]}),e.jsx("div",{className:_.valueGauge,children:e.jsx("div",{className:_.gaugeBackground,children:e.jsx("div",{className:_.gaugeForeground,style:{width:`${(t==null?void 0:t.gpt_tier)==="light"?100:o}%`,backgroundColor:(t==null?void 0:t.gpt_tier)==="light"?"#DCD8FF":"#6C5CE7"}})})}),e.jsx("div",{className:_.CountInfoArea,children:(t==null?void 0:t.gpt_tier)==="light"?e.jsx("div",{className:_.CountInfo,children:"제한 없이 딥 서칭을 사용해 보세요!"}):e.jsx("div",{className:_.CountInfo,children:"베타에서는 매일 5회의 딥 서칭을 이용할 수 있습니다."})})]})]})},ht=(s,t)=>{let a=1/0,i="무제한";switch(t){case"free":a=300*1024*1024,i="300MB";break;case"light":a=1024*1024*1024,i="1GB";break;case"plus":case"premium":a=1/0,i="무제한";break}const o=s/(1024*1024),p=s>=1024*1024*1024?(s/(1024*1024*1024)).toFixed(2)+"GB":o.toFixed(2)+"MB",f=Math.min(s/a*100,100);return{usedLabel:p,limitLabel:i,percent:f}},pt=()=>{const{profile:s,refreshProfile:t}=S();g.useEffect(()=>{t()},[]);const a=(s==null?void 0:s.used_storage_bytes)??0,{usedLabel:i,limitLabel:o,percent:p}=ht(a,s==null?void 0:s.gpt_tier);return e.jsxs("div",{className:c.counterSection,children:[e.jsxs("div",{className:c.counterHeader,children:[e.jsx("div",{className:c.counterHeaderTitle,children:"나의 요금제"}),e.jsx("div",{className:c.counterHeaderTier,children:e.jsxs("span",{className:c.profileDetailInfoValue,children:[(s==null?void 0:s.gpt_tier)==="free"&&"FREE",(s==null?void 0:s.gpt_tier)==="light"&&"LIGHT",(s==null?void 0:s.gpt_tier)==="plus"&&"PLUS",(s==null?void 0:s.gpt_tier)==="pro"&&"PRO"]})})]}),e.jsxs("div",{className:c.counterStorage,children:[e.jsx("div",{className:c.counterStorageTitle,children:"저장공간"}),e.jsxs("div",{className:c.storageInfoContainer,children:[e.jsx("img",{src:we,alt:"Storage Icon",className:c.storageIcon}),e.jsx("div",{className:c.storageProgressContainer,children:e.jsxs("div",{className:c.barWrapper,children:[e.jsx("div",{className:c.barBackgroun
1d,children:e.jsx("div",{className:c.barForeground,style:{width:`${p}%`}})}),e.jsxs("div",{className:c.barText,children:[e.jsx("span",{className:c.used,children:i}),e.jsxs("span",{className:c.limit,children:["/ ",o]})]})]})})]}),e.jsx("div",{className:c.counterStorageInfo,children:"현재 베타에서 저장공간은 300MB까지 무료로 사용할 수 있습니다."})]}),e.jsxs("div",{className:c.counterUsage,children:[e.jsx("div",{className:c.counterUsageTitle,children:"상세 사용량"}),e.jsxs("div",{className:c.counterUsageGrid,children:[e.jsx(Xe,{className:c.counterUsageItem}),e.jsx(xt,{className:c.counterUsageItem})]})]})]})},ft="_subscriptionContainer_1gcgz_2",vt="_betaHeader_1gcgz_12",Ct="_betaBadge_1gcgz_37",Nt="_betaIcon_1gcgz_57",jt="_betaText_1gcgz_61",bt="_betaTitle_1gcgz_65",It="_betaDescription_1gcgz_76",Tt="_currentStatusCard_1gcgz_85",yt="_statusHeader_1gcgz_94",Dt="_statusTitle_1gcgz_101",Bt="_statusBadge_1gcgz_108",kt="_statusIcon_1gcgz_120",St="_statusDetails_1gcgz_124",At="_statusItem_1gcgz_130",Lt="_statusLabel_1gcgz_140",$t="_statusValue_1gcgz_146",Mt="_experimentInfo_1gcgz_229",wt="_experimentHeader_1gcgz_238",Et="_experimentTitle_1gcgz_245",Vt="_experimentBadge_1gcgz_252",Ut="_experimentContent_1gcgz_267",Ht="_experimentItem_1gcgz_273",zt="_experimentIcon_1gcgz_283",Gt="_experimentText_1gcgz_289",n={subscriptionContainer:ft,betaHeader:vt,betaBadge:Ct,betaIcon:Nt,betaText:jt,betaTitle:bt,betaDescription:It,currentStatusCard:Tt,statusHeader:yt,statusTitle:Dt,statusBadge:Bt,statusIcon:kt,statusDetails:St,statusItem:At,statusLabel:Lt,statusValue:$t,experimentInfo:Mt,experimentHeader:wt,experimentTitle:Et,experimentBadge:Vt,experimentContent:Ut,experimentItem:Ht,experimentIcon:zt,experimentText:Gt},Ft=()=>{const{profile:s}=S();return e.jsxs("div",{className:n.subscriptionContainer,children:[e.jsxs("div",{className:n.betaHeader,children:[e.jsxs("div",{className:n.betaBadge,children:[e.jsx("span",{className:n.betaIcon,children:"🚀"}),e.jsx("span",{className:n.betaText,children:"BETA"})]}),e.jsx("h1",{className:n.betaTitle,children:"베타에 참여해주셔서 감사합니다"}),e.jsx("p",{className:n.betaDescription,children:"여러분의 소중한 의견이 도비를 더욱 발전시킵니다."})]}),e.jsxs("div",{className:n.currentStatusCard,children:[e.jsxs("div",{className:n.statusHeader,children:[e.jsx("h2",{className:n.statusTitle,children:"현재 상태"}),e.jsxs("div",{className:n.statusBadge,children:[e.jsx("span",{className:n.statusIcon,children:"✨"}),e.jsx("span",{children:"베타 사용자"})]})]}),e.jsx("div",{className:n.statusDetails,children:e.jsxs("div",{className:n.statusItem,children:[e.jsx("span",{className:n.statusLabel,children:"계정 유형"}),e.jsx("span",{className:n.statusValue,children:(s==null?void 0:s.gpt_tier)==="free"?"Early Beta":(s==null?void 0:s.gpt_tier)==="light"?"라이트 베타":"프리미엄 베타"})]})})]}),e.jsxs("div",{className:n.experimentInfo,children:[e.jsxs("div",{className:n.experimentHeader,children:[e.jsx("h2",{className:n.experimentTitle,children:"실험 참여 안내"}),e.jsx("div",{className:n.experimentBadge,children:"실험 중"})]}),e.jsxs("div",{className:n.experimentContent,children:[e.jsxs("div",{className:n.experimentItem,children:[e.jsx("div",{className:n.experimentIcon,children:"🔬"}),e.jsxs("div",{className:n.experimentText,children:[e.jsx("h4",{children:"새로운 기능 테스트"}),e.jsx("p",{children:"아직 완성되지 않은 기능들을 미리 경험하고 피드백을 주세요"})]})]}),e.jsxs("div",{className:n.experimentItem,children:[e.jsx("div",{className:n.experimentIcon,children:"📊"}),e.jsxs("div",{className:n.experimentText,children:[e.jsx("h4",{children:"사용 패턴 분석"}),e.jsx("p",{children:"익명화된 데이터를 통해 더 나은 서비스를 만들어갑니다"})]})]}),e.jsxs("div",{className:n.experimentItem,children:[e.jsx("div",{className:n.experimentIcon,children:"🛠️"}),e.jsxs("div",{className:n.experimentText,children:[e.jsx("h4",{children:"버그 리포트"}),e.jsx("p",{children:"발견한 문제점을 알려주시면 빠르게 수정해드려요"})]})]})]})]})]})},Pt="_modalOverlay_1ba6v_1",Ot="_open_1ba6v_17",Rt="_closing_1ba6v_22",qt="_modalContainer_1ba6v_27",Wt="_modalHeader_1ba6v_48",Zt="_modalClose_1ba6v_63",Qt="_modalBody_1ba6v_84",Jt="_modalText_1ba6v_88",Kt="_modalSubtext_1ba6v_96",Xt="_modalActions_1ba6v_103",Yt="_btnCancel_1ba6v_110",es="_btnConfirm_1ba6v_111",ts="_btnDanger_1ba6v_141",x={modalOverlay:Pt,open:Ot,closing:Rt,modalContainer:qt,modalHeader:Wt,modalClose:Zt,modalBody:Qt,modalText:Jt,modalSubtext:Kt,modalActions:Xt,btnCancel:Yt,btnConfirm:es,btnDanger:ts},L=({isOpen:s,onClose:t,onConfirm:a,type:i="custom",title:o,message:p,subMessage:f,confirmText:C,cancelText:j="취소",isDanger:N=!1})=>{const[v,b]=g.useState(!1),[I,T]=g.useState(!1),h=(()=>{switch(i){case"logout":return{title:"로그아웃",message:"정말로 로그아웃하시겠어요?",subMessage:"다시 로그인하면 모든 데이터에 접근할 수 있어요.",confirmText:"로그아웃",isDanger:!1};case"delete":return{title:"회원 탈퇴",message:"정말로 회원 탈퇴를 하시겠어요?",subMessage:"탈퇴 시 모든 데이터가 삭제되며 복구할 수 없습니다.",confirmText:"탈퇴하기",isDanger:!0};default:return{title:o||"확인",message:p||"정말로 진행하시겠어요?",subMessage:f||"",confirmText:C||"확인",isDanger:N}}})(),D=o||h.title,B=p||h.message,r=f||h.subMessage,y=C||h.confirmText,E=N||h.isDanger;g.useEffect(()=>{if(s)b(!0),T(!1);else{T(!0);const U=setTimeout(()=>{b(!1)},200);return()=>clearTimeout(U)}},[s]);const A=()=>{T(!0),setTimeout(()=>{t()},200)},V=()=>{a(),A()};return v?e.jsx("div",{className:`${x.modalOverlay} ${v?x.open:""} ${I?x.closing:""}`,children:e.jsxs("div",{className:`${x.modalContainer} ${v?x.open:""} ${I?x.closing:""}`,children:[e.jsxs("div",{className:x.modalHeader,children:[e.jsx("h2",{children:D}),e.jsx("button",{className:x.modalClose,onClick:A,type:"button",children:"×"})]}),e.jsxs("div",{className:x.modalBody,children:[e.jsx("p",{className:x.modalText,children:B}),r&&e.jsx("p",{className:x.modalSubtext,children:r})]}),e.jsxs("div",{className:x.modalActions,children:[e.jsx("button",{type:"button",onClick:A,className:x.btnCancel,children:j}),e.jsx("button",{type:"button",onClick:V,className:`${x.btnConfirm} ${E?x.btnDanger:""}`,children:y})]})]})}):null},$=[{key:"info",label:"내 정보"},{key:"counter",label:"사용량"},{key:"subscription",label:"구독 설정"},{key:"feedback",label:"피드백"}],ds=()=>{const{user:s,logout:t}=M(),[a,i]=g.useState("info"),o=H(),[p]=z(),[f,C]=g.useState(!1),[j,N]=g.useState(!1);g.useEffect(()=>{const d=p.get("menu");d&&$.some(h=>h.key===d)&&i(d)},[p]);const v=()=>{C(!0)},b=()=>{N(!0)},I=async()=>{try{await t()}catch(d){console.error("로그아웃 중 오류 발생:",d)}},T=async()=>{var d;try{const{data:h}=await k.auth.getSession(),D=(d=h.session)==null?void 0:d.access_token;if(!D)throw new Error("로그인이 필요합니다. 다시 로그인 후 시도해 주세요.");const{error:B}=await k.functions.invoke("delete-user",{headers:{Authorization:`Bearer ${D}`},body:{user_id:s.id}});if(B)throw B;await t()}catch(h){console.error("회원 탈퇴 중 오류 발생:",h)}};return s?e.jsxs(G,{children:[e.jsx("div",{className:m.profileBg,children:e.jsxs("div",{className:m.profileLayout,children:[e.jsxs("aside",{className:m.profileMenu,children:[e.jsxs("div",{className:m.profileMenuUser,children:[e.jsx("div",{className:m.profileAvatar}),e.jsxs("div",{className:m.profileInfo,children:[e.jsx("h2",{className:m.profileName,children:s.user_metadata.name}),e.jsx("p",{className:m.profileEmail,children:s.email})]})]}),e.jsx("nav",{className:m.profileMenuList,children:$.map(d=>e.jsx("button",{className:`${m.profileMenuBtn} ${a===d.key?m.selected:""}`,onClick:()=>{d.key==="feedback"?o("/loveFeedBack"):d.key==="delete"?N(!0):i(d.key)},type:"button",children:d.label},d.key))})]}),e.jsxs("section",{className:m.profileDetail,children:[a==="info"&&e.jsx("div",{className:m.profileDetailContent,children:e.jsx(ge,{onLogoutRequest:v,onDeleteRequest:b})}),a==="subscription"&&e.jsx("div",{className:m.profileDetailContent,children:e.jsx(Ft,{})}),a==="counter"&&e.jsx("div",{className:m.profileDetailContent,children:e.jsx(pt,{})}),a==="feedback"&&e.jsx("div",{className:m.profileDetailContent,children:"보안 설정 페이지 준비중"})]})]})}),e.jsx(L,{isOpen:f,onClose:()=>C(!1),onConfirm:I,type:"logout"}),e.jsx(L,{isOpen:j,onClose:()=>N(!1),onConfirm:T,type:"delete"})]}):e.jsx("div",{children:"로그인이 필요합니다."})};export{ds 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.