@weppy/roblox-mcp 2.17.15 → 2.17.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dashboard/dist/assets/{AiPromptExamples-Cwfw0ZqC.js → AiPromptExamples-BT5RrshJ.js} +1 -1
  3. package/dashboard/dist/assets/{AssetsPage-Cd1Ir_6o.js → AssetsPage-B91Jd91K.js} +1 -1
  4. package/dashboard/dist/assets/{ChangelogPage-BPP9_53U.js → ChangelogPage-D8QDjq9V.js} +1 -1
  5. package/dashboard/dist/assets/{ConfirmModal-CdZW4-sk.js → ConfirmModal-D2yw01tT.js} +1 -1
  6. package/dashboard/dist/assets/{ConnectionPage-j6oGLSEC.js → ConnectionPage-DuE65ANO.js} +1 -1
  7. package/dashboard/dist/assets/{ControlsPage-CkU_Xz6W.js → ControlsPage-Cl2JDzO5.js} +1 -1
  8. package/dashboard/dist/assets/{GameChangeDetail-BVanxiU-.js → GameChangeDetail-B-rutxUx.js} +1 -1
  9. package/dashboard/dist/assets/{InfoLabel-DuNAxesz.js → InfoLabel-DfinjjFO.js} +1 -1
  10. package/dashboard/dist/assets/{OverviewPage-DaR6Zf4N.js → OverviewPage-D_R1KBze.js} +1 -1
  11. package/dashboard/dist/assets/{PageHeader-C8RSD2wK.js → PageHeader-QiUV3oJs.js} +1 -1
  12. package/dashboard/dist/assets/{PlaceSelectOptions-B-hh23M4.js → PlaceSelectOptions-BArB7wnB.js} +1 -1
  13. package/dashboard/dist/assets/{PlaytestAiPromptExamples-CVThXrz5.js → PlaytestAiPromptExamples-BymEsVMx.js} +1 -1
  14. package/dashboard/dist/assets/{PlaytestPage-BoKMpsGY.js → PlaytestPage-xSVycgy8.js} +1 -1
  15. package/dashboard/dist/assets/{SettingsPage-Cgnm6p8V.js → SettingsPage-f3RT7b9T.js} +1 -1
  16. package/dashboard/dist/assets/SyncPage-CMHX43na.js +1 -0
  17. package/dashboard/dist/assets/SyncPage-DswNmXeG.css +1 -0
  18. package/dashboard/dist/assets/{Tabs-Br8Zgvmi.js → Tabs-Cnh4bdIv.js} +1 -1
  19. package/dashboard/dist/assets/{TierPromoPanel-BYdwzdxN.js → TierPromoPanel-DWTUB0jD.js} +1 -1
  20. package/dashboard/dist/assets/{ToolsPage-DC8hKMbq.js → ToolsPage-BWDGROg9.js} +1 -1
  21. package/dashboard/dist/assets/{TooltipText-DudXe1Qy.js → TooltipText-x86NSn8t.js} +1 -1
  22. package/dashboard/dist/assets/{UiStudioPage-DZUmNIp2.js → UiStudioPage-DruAP3cs.js} +1 -1
  23. package/dashboard/dist/assets/{WhatsNewPage-EVjYD3ti.js → WhatsNewPage-DdlnBlsD.js} +1 -1
  24. package/dashboard/dist/assets/{bot-Cud9Il_O.js → bot-SjZv9JDp.js} +1 -1
  25. package/dashboard/dist/assets/{check-CsYm1hvL.js → check-BTcudP1t.js} +1 -1
  26. package/dashboard/dist/assets/{copy-yeY7HS26.js → copy-BV32y84n.js} +1 -1
  27. package/dashboard/dist/assets/{index-CbTOKOZ5.js → index-B1SnAt0o.js} +11 -11
  28. package/dashboard/dist/assets/{rotate-ccw-CzAWuBD5.js → rotate-ccw-DFqk1Xmr.js} +1 -1
  29. package/dashboard/dist/assets/{sample-requests-Ctlw72Az.js → sample-requests-BxNYwxW0.js} +1 -1
  30. package/dashboard/dist/assets/{trash-2-BAenJavG.js → trash-2-CYsYg3as.js} +1 -1
  31. package/dashboard/dist/assets/{useLiveUptime-Dyb_GmdN.js → useLiveUptime-IBRIkiaM.js} +1 -1
  32. package/dashboard/dist/assets/{useSettings-fppB8ls5.js → useSettings-BiOxUpzD.js} +1 -1
  33. package/dashboard/dist/index.html +1 -1
  34. package/dist/index.js +250 -154
  35. package/package.json +1 -1
  36. package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
  37. package/dashboard/dist/assets/SyncPage-BeZ52U2s.css +0 -1
  38. package/dashboard/dist/assets/SyncPage-CZ3NhJOo.js +0 -1
@@ -1 +1 @@
1
- import{u as X,a as le,r,j as e,b as I,g as me,c as ye,T as je,A as xe,S as fe}from"./index-CbTOKOZ5.js";import{C as be,P as ve}from"./PageHeader-C8RSD2wK.js";import{I as R}from"./InfoLabel-DuNAxesz.js";import{T as m}from"./TooltipText-DudXe1Qy.js";import{s as a,u as Se}from"./useSettings-fppB8ls5.js";import{C as ce}from"./ConfirmModal-CdZW4-sk.js";import{D as de,f as ue,r as Ce,s as Ne,a as pe,d as se,S as ae,b as _e}from"./sample-requests-Ctlw72Az.js";import"./ConfirmModal.module-DJksQHBd.js";const ke="_card_jz1ya_4",Pe="_cardEmbedded_jz1ya_14",Le="_cardTitle_jz1ya_21",Re="_storageConsoleGrid_jz1ya_31",we="_storageUsageColumn_jz1ya_38",He="_storagePolicyColumn_jz1ya_39",Be="_usageRow_jz1ya_44",Me="_usageTotal_jz1ya_50",Ae="_usageBreakdown_jz1ya_57",$e="_usageCounts_jz1ya_63",ze="_storageFooter_jz1ya_70",De="_lastRunRow_jz1ya_79",Ee="_lastRunLabel_jz1ya_89",Te="_errorIcon_jz1ya_95",Ie="_tooltip_jz1ya_103",Ue="_cleanupRow_jz1ya_126",Fe="_cleanupLabel_jz1ya_133",Oe="_cleanupBtn_jz1ya_140",Ge="_cleanupBtnDanger_jz1ya_169",qe="_retentionSection_jz1ya_182",We="_retentionTitle_jz1ya_188",Ye="_retentionFieldset_jz1ya_196",Ke="_proOverlay_jz1ya_211",Ve="_modeSegments_jz1ya_223",Je="_radioLabel_jz1ya_244",Qe="_radioLabelActive_jz1ya_265",Ze="_presetGroup_jz1ya_279",Xe="_presetBtn_jz1ya_287",et="_presetBtnActive_jz1ya_310",tt="_freeInput_jz1ya_317",st="_inputError_jz1ya_334",at="_inputUnit_jz1ya_338",it="_cascadeRow_jz1ya_345",nt="_retentionActions_jz1ya_361",ot="_saveBtn_jz1ya_367",rt="_runNowBtn_jz1ya_395",lt="_errorMsg_jz1ya_439",ct="_freeInputHitArea_jz1ya_501",o={card:ke,cardEmbedded:Pe,cardTitle:Le,storageConsoleGrid:Re,storageUsageColumn:we,storagePolicyColumn:He,usageRow:Be,usageTotal:Me,usageBreakdown:Ae,usageCounts:$e,storageFooter:ze,lastRunRow:De,lastRunLabel:Ee,errorIcon:Te,tooltip:Ie,cleanupRow:Ue,cleanupLabel:Fe,cleanupBtn:Oe,cleanupBtnDanger:Ge,retentionSection:qe,retentionTitle:We,retentionFieldset:Ye,proOverlay:Ke,modeSegments:Ve,radioLabel:Je,radioLabelActive:Qe,presetGroup:Ze,presetBtn:Xe,presetBtnActive:et,freeInput:tt,inputError:st,inputUnit:at,cascadeRow:it,retentionActions:nt,saveBtn:ot,runNowBtn:rt,errorMsg:lt,freeInputHitArea:ct};function dt(t,s){return!!(t.mode==="off"&&s.mode!=="off"||t.mode==="age"&&s.mode==="age"&&(s.ageDays??0)<(t.ageDays??0)||t.mode==="size"&&s.mode==="size"&&(s.sizeMb??0)<(t.sizeMb??0)||!t.cascadeSnapshots&&s.cascadeSnapshots)}function ie(t){return t.mode==="age"?Number.isInteger(t.ageDays)&&t.ageDays>=1&&t.ageDays<=365:t.mode==="size"?Number.isInteger(t.sizeMb)&&t.sizeMb>=50&&t.sizeMb<=1e4:!0}function ut(t,s){return t.mode===s.mode&&t.ageDays===s.ageDays&&t.sizeMb===s.sizeMb&&t.cascadeSnapshots===s.cascadeSnapshots}function Y(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(2)} GB`}function pt({placeId:t,tier:s,currentPolicy:l,onSaved:d}){const{t:n}=X(),{trackEvent:b}=le(),[i,g]=r.useState(l),[p,_]=r.useState(()=>[7,14,30,90].includes(l.ageDays??-1)?"":String(l.ageDays??30)),[v,k]=r.useState(()=>[100,500,1e3].includes(l.sizeMb??-1)?"":String(l.sizeMb??500)),[P,z]=r.useState(null),[x,f]=r.useState(!1),[D,w]=r.useState(!1),[y,H]=r.useState(!1),[L,A]=r.useState(null);r.useEffect(()=>{g(l);const h=[7,14,30,90],M=[100,500,1e3];_(h.includes(l.ageDays??-1)?"":String(l.ageDays??30)),k(M.includes(l.sizeMb??-1)?"":String(l.sizeMb??500))},[l]);const $=s==="basic",N=ie(i),j=ut(l,i),E=N&&!j&&!D,S=h=>{g(M=>{const O={...M,mode:h};return h==="age"&&(O.ageDays=parseInt(p,10)||30),h==="size"&&(O.sizeMb=parseInt(v,10)||500),O})},B=h=>{_(""),g(M=>({...M,ageDays:h}))},U=h=>{k(""),g(M=>({...M,sizeMb:h}))},F=h=>{_(h);const M=parseInt(h,10);Number.isNaN(M)||g(O=>({...O,ageDays:M}))},c=h=>{k(h);const M=parseInt(h,10);Number.isNaN(M)||g(O=>({...O,sizeMb:M}))},T=async()=>{if(A(null),b("dashboard_click_event",{click_target:"ui_studio_cleanup_save",page:"settings"}),dt(l,i)){try{const h=await ue(t,{mode:i.mode,ageDays:i.ageDays,sizeMb:i.sizeMb,cascadeSnapshots:i.cascadeSnapshots});z(h.dryRun),f(!0)}catch(h){A(h.message)}return}await W()},W=async()=>{w(!0);try{await Ne(t,i),f(!1),d()}catch(h){throw A(h.message),h}finally{w(!1)}},u=async()=>{A(null),b("dashboard_click_event",{click_target:"ui_studio_cleanup_run_now",page:"settings"}),H(!0);try{await Ce(t),d()}catch(h){A(h.message)}finally{H(!1)}},C=P?`${n("uiStudio.cleanup.policy.confirm.messageStrict","이 정책으로 즉시")} ${P.wouldRemoveRequests}${n("uiStudio.cleanup.policy.confirm.requests","건")} / ${P.wouldRemoveSnapshots}${n("uiStudio.cleanup.policy.confirm.snapshots","개 화면 캡처")} / ${Y(P.wouldFreeBytes)} ${n("uiStudio.cleanup.policy.confirm.freed","가 삭제됩니다 — 적용?")}`:"",K=i.mode==="age"&&!ie(i),q=i.mode==="size"&&!ie(i);return e.jsxs("div",{className:o.retentionSection,children:[e.jsx("h3",{className:o.retentionTitle,children:e.jsx(R,{label:n("uiStudio.cleanup.policy.title","자동 삭제 정책"),tooltip:n("uiStudio.cleanup.policy.title.tooltip","Rules that automatically remove old or large captures.")})}),e.jsxs("div",{style:{position:"relative"},children:[$&&e.jsx("div",{className:o.proOverlay,title:n("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능"),children:e.jsx("div",{className:o.tooltip,children:n("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능")})}),e.jsxs("fieldset",{className:o.retentionFieldset,disabled:$,"aria-label":n("uiStudio.cleanup.policy.title","자동 삭제 정책"),style:$?{opacity:.45,pointerEvents:"none"}:void 0,children:[e.jsxs("div",{className:o.modeSegments,"data-testid":"cleanup-mode-segments",children:[e.jsx(m,{text:n("uiStudio.cleanup.policy.modeOff.tooltip","Turn off auto-cleanup. Data stays until you remove it manually."),children:e.jsxs("label",{className:`${o.radioLabel} ${i.mode==="off"?o.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"off",checked:i.mode==="off",onChange:()=>S("off")}),n("uiStudio.cleanup.policy.modeOff","사용 안 함 (off)")]})}),e.jsx(m,{text:n("uiStudio.cleanup.policy.modeAge.tooltip","Automatically delete data older than the configured number of days."),children:e.jsxs("label",{className:`${o.radioLabel} ${i.mode==="age"?o.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"age",checked:i.mode==="age",onChange:()=>S("age")}),n("uiStudio.cleanup.policy.modeAge","기간 기반 (age)")]})}),e.jsx(m,{text:n("uiStudio.cleanup.policy.modeSize.tooltip","When total usage exceeds the limit, the oldest data is removed first."),children:e.jsxs("label",{className:`${o.radioLabel} ${i.mode==="size"?o.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"size",checked:i.mode==="size",onChange:()=>S("size")}),n("uiStudio.cleanup.policy.modeSize","용량 기반 (size)")]})})]}),i.mode==="age"&&e.jsxs("div",{className:o.presetGroup,children:[[7,14,30,90].map(h=>e.jsx(m,{text:n("uiStudio.cleanup.policy.agePreset.tooltip","Delete data older than this many days."),children:e.jsxs("button",{type:"button",className:`${o.presetBtn} ${i.ageDays===h&&p===""?o.presetBtnActive:""}`,onClick:()=>B(h),children:[h,n("uiStudio.cleanup.policy.daysUnit","일")]})},h)),e.jsx(m,{text:n("uiStudio.cleanup.policy.ageInput.tooltip","Enter any value between 1 and 365 days."),children:e.jsx("label",{className:o.freeInputHitArea,children:e.jsx("input",{type:"number",className:`${o.freeInput} ${K?o.inputError:""}`,value:p,min:1,max:365,onChange:h=>F(h.target.value)})})}),e.jsxs("span",{className:o.inputUnit,children:["1–365",n("uiStudio.cleanup.policy.daysUnit","일")]})]}),i.mode==="size"&&e.jsxs("div",{className:o.presetGroup,children:[[100,500,1e3].map(h=>e.jsx(m,{text:n("uiStudio.cleanup.policy.sizePreset.tooltip","Keep total usage under this size."),children:e.jsxs("button",{type:"button",className:`${o.presetBtn} ${i.sizeMb===h&&v===""?o.presetBtnActive:""}`,onClick:()=>U(h),children:[h,n("uiStudio.cleanup.policy.mbUnit","MB")]})},h)),e.jsx(m,{text:n("uiStudio.cleanup.policy.sizeInput.tooltip","Enter any value between 50 MB and 10000 MB (10 GB)."),children:e.jsx("label",{className:o.freeInputHitArea,children:e.jsx("input",{type:"number",className:`${o.freeInput} ${q?o.inputError:""}`,value:v,min:50,max:1e4,onChange:h=>c(h.target.value)})})}),e.jsxs("span",{className:o.inputUnit,children:["50–10000",n("uiStudio.cleanup.policy.mbUnit","MB")]})]}),e.jsx(m,{text:n("uiStudio.cleanup.policy.cascade.tooltip","Also delete the capture images linked to those records. If off, the images stay."),children:e.jsxs("label",{className:o.cascadeRow,children:[e.jsx(be,{checked:i.cascadeSnapshots,onChange:h=>g(M=>({...M,cascadeSnapshots:h.target.checked}))}),n("uiStudio.cleanup.policy.cascade","연결된 화면 캡처도 함께 삭제")]})}),e.jsxs("div",{className:o.retentionActions,children:[e.jsx(m,{text:n("uiStudio.cleanup.policy.save.tooltip","Save the current cleanup rule. It runs in the background from then on."),children:e.jsx("button",{type:"button",className:o.saveBtn,onClick:()=>void T(),disabled:!E,children:n("uiStudio.cleanup.policy.save","정책 저장")})}),e.jsx(m,{text:n("uiStudio.cleanup.policy.runNow.tooltip","저장된 정리 정책을 다음 자동 실행까지 기다리지 않고 지금 한 번 실행합니다."),children:e.jsx("button",{type:"button",className:o.runNowBtn,onClick:()=>void u(),disabled:y,children:n("uiStudio.cleanup.policy.runNow","저장된 정책으로 정리")})})]}),L&&e.jsx("div",{className:o.errorMsg,children:L})]})]}),x&&P&&e.jsx(de,{title:n("uiStudio.cleanup.policy.confirm.title","정책 적용 확인"),message:C,danger:!0,confirmLabel:n("uiStudio.cleanup.policy.save","정책 저장"),busy:D,onConfirm:W,onClose:()=>f(!1)})]})}function gt({placeId:t,tier:s,onChanged:l,sampleUsage:d,sampleRetention:n,embedded:b=!1}){const{t:i}=X(),g=s==="basic"&&d!=null&&n!=null,[p,_]=r.useState(g?d:null),[v,k]=r.useState(g?n:null),[P,z]=r.useState(null),[x,f]=r.useState(null),[D,w]=r.useState(null),y=r.useCallback(async()=>{if(!g&&t!=null){z(null);try{const[S,B]=await Promise.all([pe(t),ue(t)]);_(S),k(B.policy)}catch(S){z(S.message)}}},[t,g]);r.useEffect(()=>{y()},[y]);const H=r.useCallback(()=>{y(),l==null||l()},[y,l]),L=r.useCallback(async()=>{if(x&&t!=null){w(null);try{x.kind==="keep7"?await se(t,{olderThanDays:7,alsoSnapshots:!0}):x.kind==="keep30"?await se(t,{olderThanDays:30,alsoSnapshots:!0}):await se(t,{all:!0,alsoSnapshots:!0}),f(null),y(),l==null||l()}catch(S){throw w(S.message),S}}},[x,t,y,l]);function A(S){const B=i("uiStudio.cleanup.studioPreservedNote","This deletes saved change records and screenshots on disk only; Roblox Studio instances are not affected.");return S.kind==="keep7"?`${i("uiStudio.cleanup.cleanupConfirmMessage.keep7","7일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${B}`:S.kind==="keep30"?`${i("uiStudio.cleanup.cleanupConfirmMessage.keep30","30일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${B}`:`${((p==null?void 0:p.requestCount)??0)+((p==null?void 0:p.snapshotCount)??0)}${i("uiStudio.cleanup.cleanupConfirmMessage.all","개의 저장된 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${B}`}if(t==null&&!g)return null;if(P)return e.jsx("div",{className:`${o.card} ${b?o.cardEmbedded:""}`,children:e.jsx("p",{className:o.errorMsg,children:P})});if(!p||!v)return e.jsx("div",{className:`${o.card} ${b?o.cardEmbedded:""}`,children:e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",margin:0},children:i("uiStudio.storage.loading","로딩 중...")})});const $=v.lastRunAt,N=v.lastRunStats,j=$?new Date($).toLocaleString():null,E=t??0;return e.jsxs("div",{className:`${o.card} ${b?o.cardEmbedded:""}`,children:[!b&&e.jsx("h3",{className:o.cardTitle,children:e.jsx(R,{label:i("uiStudio.storage.title","UI Studio 저장 데이터"),tooltip:i("uiStudio.storage.title.tooltip","Disk usage of UI Studio change records and screenshots.")})}),e.jsxs("div",{className:o.storageConsoleGrid,"data-testid":"ui-studio-storage-console-grid",children:[e.jsx("section",{className:o.storageUsageColumn,children:e.jsxs("div",{className:o.usageRow,children:[e.jsx(m,{text:i("uiStudio.storage.usageLabel.tooltip","Disk space currently used by UI Studio for this project."),children:e.jsxs("div",{className:o.usageTotal,children:[i("uiStudio.storage.usageLabel","사용 중")," ",Y(p.totalBytes)]})}),e.jsxs("div",{className:o.usageBreakdown,children:[e.jsx(m,{text:i("uiStudio.storage.historyBytes.tooltip","Space taken by change record data (JSON)."),children:e.jsxs("span",{children:[i("uiStudio.storage.historyBytes","변경 이력")," ",Y(p.historyBytes)]})})," · ",e.jsx(m,{text:i("uiStudio.storage.snapshotBytes.tooltip","Space taken by captured PNG image files."),children:e.jsxs("span",{children:[i("uiStudio.storage.snapshotBytes","화면 캡처")," ",Y(p.snapshotBytes)]})})]}),e.jsxs("div",{className:o.usageCounts,children:[e.jsx(m,{text:i("uiStudio.storage.requestCount.tooltip","Number of actions where AI changed the UI."),children:e.jsxs("span",{children:[i("uiStudio.storage.requestCount","변경 기록")," ",p.requestCount.toLocaleString(),i("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(m,{text:i("uiStudio.storage.mutationCount.tooltip","Number of detail changes inside actions (one property edit = 1)."),children:e.jsxs("span",{children:[i("uiStudio.storage.mutationCount","변경 상세")," ",p.mutationCount.toLocaleString(),i("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(m,{text:i("uiStudio.storage.snapshotCount.tooltip","Number of saved capture image files."),children:e.jsxs("span",{children:[i("uiStudio.storage.snapshotCount","화면 캡처")," ",p.snapshotCount.toLocaleString(),i("uiStudio.storage.countSuffix","개")]})})]})]})}),e.jsx("section",{className:o.storagePolicyColumn,children:e.jsx(pt,{placeId:E,tier:s,currentPolicy:v,onSaved:H})})]}),e.jsxs("div",{className:o.storageFooter,"data-testid":"ui-studio-storage-footer",children:[e.jsxs("div",{className:o.lastRunRow,children:[e.jsx("span",{className:o.lastRunLabel,children:e.jsx(R,{label:i("uiStudio.storage.lastRun","마지막 자동 정리"),tooltip:i("uiStudio.storage.lastRun.tooltip","When the auto-cleanup policy last ran, and what it removed.")})}),j?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:j}),N&&e.jsxs("span",{children:["· ",i("uiStudio.storage.requestCount","변경 기록")," ",N.removedRequests,i("uiStudio.storage.countSuffix","개")," / ",i("uiStudio.storage.snapshotCount","화면 캡처")," ",N.removedSnapshots,i("uiStudio.storage.countSuffix","개")," / ",Y(N.freedBytes)," ",i("uiStudio.storage.lastRunFreed","회수")]}),N&&N.errors>0&&e.jsxs("span",{className:o.errorIcon,title:`${i("uiStudio.storage.lastRunErrors","오류")} ${N.errors}건`,children:["⚠",e.jsxs("span",{className:o.tooltip,children:[i("uiStudio.storage.lastRunErrors","오류")," ",N.errors,i("uiStudio.storage.countSuffix","건")]})]})]}):e.jsx("span",{children:i("uiStudio.storage.lastRunNever","—")})]}),e.jsxs("div",{className:o.cleanupRow,children:[e.jsx("span",{className:o.cleanupLabel,children:e.jsx(R,{label:i("uiStudio.cleanup.label","수동 정리"),tooltip:i("uiStudio.cleanup.label.tooltip","Manually clean up change records and captures whenever you want.")})}),e.jsx(m,{text:i("uiStudio.cleanup.keep7.tooltip","Delete change records and captures older than 7 days."),children:e.jsx("button",{type:"button",className:o.cleanupBtn,onClick:()=>f({kind:"keep7"}),disabled:s==="basic",children:i("uiStudio.cleanup.keepLastNDays","최근 7일만 남기기").replace("{n}","7")})}),e.jsx(m,{text:i("uiStudio.cleanup.keep30.tooltip","Delete change records and captures older than 30 days."),children:e.jsx("button",{type:"button",className:o.cleanupBtn,onClick:()=>f({kind:"keep30"}),disabled:s==="basic",children:i("uiStudio.cleanup.keepLastNDays","최근 30일만 남기기").replace("{n}","30")})}),!b&&e.jsx(m,{text:i("uiStudio.cleanup.deleteAll.tooltip","Delete every change record and capture for this project. The actual UI in Roblox Studio is not affected."),children:e.jsx("button",{type:"button",className:`${o.cleanupBtn} ${o.cleanupBtnDanger}`,onClick:()=>f({kind:"all"}),disabled:s==="basic",children:i("uiStudio.cleanup.deleteAll","전체 삭제…")})})]})]}),D&&e.jsx("div",{className:o.errorMsg,children:D}),x&&e.jsx(de,{title:i("uiStudio.cleanup.cleanupConfirmTitle","정리 확인"),message:A(x),danger:!0,confirmLabel:i("common.delete","삭제"),onConfirm:L,onClose:()=>{f(null),w(null)}})]})}function ne(t,s){const l={placeId:String(t)};return s&&(l["preview.mode"]=s.mode,s.mode==="size"&&(l["preview.sizeMb"]=String(s.sizeMb))),I.get("/api/dashboard/changelog/cleanup",l)}function oe(t){return I.put("/api/dashboard/changelog/cleanup",t)}function ht(t){return I.post(`/api/dashboard/changelog/cleanup/run?placeId=${encodeURIComponent(t)}`)}const mt=[100,500,1e3];function re(t,s){return t.mode!==s.mode?!1:t.mode==="off"||s.mode==="size"&&t.sizeMb===s.sizeMb}function yt(t,s){return t.mode==="off"?!1:s.mode==="off"||t.sizeMb<s.sizeMb}function J(t){return t<1e3?`${t} B`:t<1e6?`${(t/1e3).toFixed(1)} KB`:t<1e9?`${(t/1e6).toFixed(1)} MB`:`${(t/1e9).toFixed(2)} GB`}function jt({placeId:t,onChanged:s}){const{locale:l,t:d}=X(),[n,b]=r.useState(null),[i,g]=r.useState({mode:"size",sizeMb:500}),[p,_]=r.useState(t!==null),[v,k]=r.useState(!1),[P,z]=r.useState(!1),[x,f]=r.useState(!1),[D,w]=r.useState(!1),[y,H]=r.useState(null),L=r.useCallback(async()=>{if(t===null){b(null),_(!1);return}z(!1);try{const u=await ne(t);b(u),g(u.policy)}catch{z(!0)}finally{_(!1)}},[t]);r.useEffect(()=>{_(t!==null),L()},[L,t]);const A=r.useCallback(async u=>{k(!0),f(!1),w(!1);try{await oe(u),H(null),await L(),w(!0),s==null||s()}catch{f(!0)}finally{k(!1)}},[L,s]),$=r.useCallback(async()=>{if(!(!n||t===null||re(i,n.policy))){k(!0),f(!1),w(!1);try{if(yt(i,n.policy)){const u=await ne(t,i);if(u.preview.affectedPlaceCount>0){H({policy:i,preview:u});return}}await oe(i),await L(),w(!0),s==null||s()}catch{f(!0)}finally{k(!1)}}},[n,i,L,s,t]),N=r.useCallback(async()=>{if(t!==null){k(!0),f(!1),w(!1);try{await ht(t),await L(),s==null||s()}catch{f(!0)}finally{k(!1)}}},[L,s,t]),j=n==null?void 0:n.selectedPlace.currentUsage,E=(n==null?void 0:n.policy.mode)==="size"?n.policy.sizeMb*1e6:null,S=E??Math.max((j==null?void 0:j.bytes)??0,1),B=Math.min(100,((j==null?void 0:j.sessionBytes)??0)/S*100),U=Math.min(Math.max(0,100-B),((j==null?void 0:j.contextBytes)??0)/S*100),F=n?!re(i,n.policy):!1,c=u=>u.mode==="off"?d("settings.projectChanges.cleanup.unlimited","Unlimited"):`${u.sizeMb} MB`,T=r.useMemo(()=>{if(!y)return"";const u=y.preview.preview,C=d("settings.projectChanges.cleanup.confirm.message","{places} Places · {sessions} sessions · {bytes} expected to be freed.").replace("{places}",u.affectedPlaceCount.toLocaleString()).replace("{sessions}",u.deleteSessionCount.toLocaleString()).replace("{bytes}",J(u.estimatedFreedBytes));return u.wouldRemainOverLimitPlaceCount===0?C:`${C} ${d("settings.projectChanges.cleanup.confirm.protected","{places} Place may remain over the limit because active data is protected.").replace("{places}",u.wouldRemainOverLimitPlaceCount.toLocaleString())}`},[y,d]);if(t===null)return e.jsx("div",{className:a.projectChangesPanel,children:e.jsx("p",{className:a.projectChangesEmpty,children:d("settings.projectChanges.cleanup.noPlace","Select a Place to manage saved project changes.")})});if(p)return e.jsx("div",{className:a.projectChangesPanel,children:e.jsx("p",{className:a.projectChangesEmpty,children:d("settings.projectChanges.cleanup.loading","Loading storage settings…")})});if(P||!n||!j)return e.jsxs("div",{className:a.projectChangesPanel,children:[e.jsx("p",{className:a.projectChangesError,role:"alert",children:d("settings.projectChanges.cleanup.loadFailed","Could not load storage settings.")}),e.jsx("button",{className:a.projectChangesSecondaryButton,type:"button",onClick:()=>{_(!0),L()},children:d("common.retry","Retry")})]});const W=E===null?d("settings.projectChanges.cleanup.usageUnlimited","{used} used · Unlimited").replace("{used}",J(j.bytes)):d("settings.projectChanges.cleanup.usageLimited","{used} used of {limit}").replace("{used}",J(j.bytes)).replace("{limit}",c(n.policy));return e.jsxs("div",{className:a.projectChangesPanel,children:[e.jsxs("div",{className:a.projectChangesConsoleGrid,"data-testid":"project-storage-console-grid",children:[e.jsxs("section",{className:a.projectChangesUsageColumn,children:[e.jsx("h3",{className:a.projectChangesPanelTitle,children:e.jsx(R,{label:d("settings.projectChanges.cleanup.title","Storage management"),tooltip:d("settings.projectChanges.cleanup.title.tooltip","Set how much Project Change Summary history each Place can keep.")})}),e.jsxs("div",{className:a.projectChangesUsageBlock,children:[e.jsx("div",{className:a.projectChangesUsageSummary,children:W}),e.jsxs("div",{className:a.projectChangesQuotaRail,role:"meter","aria-label":d("settings.projectChanges.cleanup.usageAria","Place storage usage"),"aria-valuemin":0,"aria-valuenow":j.bytes,"aria-valuemax":E??j.bytes,children:[e.jsx("span",{className:a.projectChangesSessionRail,style:{width:`${B}%`}}),e.jsx("span",{className:a.projectChangesContextRail,style:{width:`${U}%`}})]}),e.jsxs("div",{className:a.projectChangesUsageLegend,children:[e.jsxs("span",{children:[d("settings.projectChanges.cleanup.sessions","Sessions")," ",e.jsx("strong",{children:J(j.sessionBytes)})]}),e.jsxs("span",{children:[d("settings.projectChanges.cleanup.contexts","Contexts")," ",e.jsx("strong",{children:J(j.contextBytes)})]})]})]})]}),e.jsxs("section",{className:a.projectChangesPolicyColumn,children:[e.jsx("p",{className:a.projectChangesScope,children:d("settings.projectChanges.cleanup.scope","One setting applies the selected limit separately to every Place.")}),e.jsxs("fieldset",{className:a.projectChangesPolicyFieldset,disabled:v,children:[e.jsx("legend",{className:a.projectChangesPolicyLegend,children:d("settings.projectChanges.cleanup.limit","Limit per Place")}),e.jsxs("div",{className:a.projectChangesPresetGroup,children:[mt.map(u=>{const C=i.mode==="size"&&i.sizeMb===u;return e.jsx("button",{className:`${a.projectChangesPresetButton} ${C?a.projectChangesPresetButtonActive:""}`,type:"button","aria-pressed":C,onClick:()=>g({mode:"size",sizeMb:u}),children:d("settings.projectChanges.cleanup.preset","{sizeMb}MB").replace("{sizeMb}",String(u))},u)}),e.jsx("button",{className:`${a.projectChangesPresetButton} ${i.mode==="off"?a.projectChangesPresetButtonActive:""}`,type:"button","aria-pressed":i.mode==="off",onClick:()=>g({mode:"off"}),children:d("settings.projectChanges.cleanup.unlimited","Unlimited")})]})]}),e.jsxs("div",{className:a.projectChangesActions,children:[e.jsx("button",{className:a.projectChangesSaveButton,type:"button",disabled:!F||v,onClick:()=>void $(),children:d("common.save","Save")}),e.jsx("button",{className:a.projectChangesSecondaryButton,type:"button",disabled:v,onClick:()=>void N(),children:d("settings.projectChanges.cleanup.runNow","Run saved policy")}),D&&e.jsx("span",{className:a.projectChangesSaved,role:"status",children:d("settings.projectChanges.cleanup.saved","Saved")})]})]})]}),n.selectedPlace.dryRun.wouldRemainOverLimit&&e.jsx("p",{className:a.projectChangesWarning,children:d("settings.projectChanges.cleanup.protectedWarning","Active changes are protected, so this Place may stay over the limit.")}),e.jsxs("div",{className:a.projectChangesLastRun,"data-testid":"project-storage-footer",children:[e.jsx("span",{className:a.projectChangesLastRunLabel,children:d("settings.projectChanges.cleanup.lastRun","Last cleanup")}),n.selectedPlace.lastRun?e.jsxs("span",{children:[new Date(n.selectedPlace.lastRun.ranAt).toLocaleString(l)," · ",d("settings.projectChanges.cleanup.lastRunSummary","{sessions} sessions · {bytes} freed").replace("{sessions}",n.selectedPlace.lastRun.deletedSessionCount.toLocaleString()).replace("{bytes}",J(n.selectedPlace.lastRun.freedBytes))]}):e.jsx("span",{children:d("settings.projectChanges.cleanup.neverRun","Not run yet")})]}),x&&e.jsx("p",{className:a.projectChangesError,role:"alert",children:d("settings.projectChanges.cleanup.actionFailed","Could not update storage settings.")}),e.jsx(ce,{open:y!==null,title:d("settings.projectChanges.cleanup.confirm.title","Apply this limit and clean saved changes?"),message:T,cancelLabel:d("common.cancel","Cancel"),confirmLabel:d("settings.projectChanges.cleanup.confirm.apply","Apply and clean"),loading:v,onCancel:()=>!v&&H(null),onConfirm:()=>{y&&A(y.policy)}})]})}const xt={toolsActivity:null,toolStats:null,toolSessions:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null},ft={toolsActivity:null,toolStats:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null};function bt(t){var s;return t?t.pluginConnected?t.activePlaceId:t.lastActivePlaceId??((s=t.places[0])==null?void 0:s.placeId)??null:null}async function G(t){try{return await t}catch{return null}}function ee(t){return t?typeof t.total=="number"?t.total:Array.isArray(t.entries)?t.entries.length:null:null}function te(t,s,l,d){return s===null?t("settings.dataHistory.metric.unavailable","Unavailable"):`${s.toLocaleString()} ${t(l,d)}`}function Q(t,s,l){const d=l===null?t("settings.dataHistory.metric.sizeUnavailable","size unavailable"):Y(l);return`${s} · ${d}`}function Z(t,s){var d;const l=(d=t==null?void 0:t[s])==null?void 0:d.bytes;return typeof l=="number"&&Number.isFinite(l)?l:null}function vt(t,s){return s?[`${s.requestCount.toLocaleString()} ${t("uiStudio.storage.requestCount","change records")}`,`${s.snapshotCount.toLocaleString()} ${t("uiStudio.storage.snapshotCount","screenshots")}`,Y(s.totalBytes)].join(" · "):t("settings.dataHistory.metric.unavailable","Unavailable")}function St({tier:t}){const{t:s}=X(),[l,d]=r.useState(xt),[n,b]=r.useState(ft),[i,g]=r.useState(t==="basic"?ae:null),[p,_]=r.useState(null),[v,k]=r.useState(!0),[P,z]=r.useState(!0),[x,f]=r.useState(null),[D,w]=r.useState(()=>new Set),[y,H]=r.useState(null),[L,A]=r.useState(!1),[$,N]=r.useState(null),j=r.useCallback(async()=>{k(!0);const u=await G(me()),C=bt(u);_(C);const[K,q,h,M,O,ge,V]=await Promise.all([G(I.get("/api/dashboard/history",{limit:"1",offset:"0"})),G(I.get("/api/dashboard/tool-stats")),G(I.get("/sync/history",{limit:"1",offset:"0"})),G(I.get("/api/dashboard/playtest/history")),G(I.get("/api/dashboard/changelog",{limit:"1",offset:"0"})),G(I.get("/api/dashboard/connection-log")),G(I.get("/api/dashboard/storage-summary"))]),he=t==="basic"?ae:C===null?null:await G(pe(C));d({toolsActivity:ee(K),toolStats:(q==null?void 0:q.totalCalls)??null,toolSessions:(q==null?void 0:q.totalSessions)??null,syncLog:ee(h),playtestReports:ee(M),projectChanges:ee(O),connectionLog:ee(ge)}),b({toolsActivity:Z(V,"toolsActivity"),toolStats:Z(V,"toolStats"),syncLog:Z(V,"syncLog"),playtestReports:Z(V,"playtestReports"),projectChanges:Z(V,"projectChanges"),connectionLog:Z(V,"connectionLog")}),g(he),k(!1)},[t]);r.useEffect(()=>{j()},[j]);const E=r.useCallback(u=>{w(C=>{if(C.has(u))return C;const K=new Set(C);return K.add(u),K}),f(C=>C===u?null:u)},[]),S=r.useMemo(()=>[{key:"toolsActivity",title:s("settings.dataHistory.toolsActivity.title","Tool activity"),description:s("settings.dataHistory.toolsActivity.description","Saved tool runs shown on the Tools page."),metric:Q(s,te(s,l.toolsActivity,"settings.dataHistory.metric.records","records"),n.toolsActivity),metricTooltip:s("settings.dataHistory.toolsActivity.metric.tooltip","Number of saved tool runs and the disk space they use."),route:"/tools",clearEndpoint:"/api/dashboard/tools/history/clear"},{key:"toolStats",title:s("settings.dataHistory.toolStats.title","Tool usage statistics"),description:s("settings.dataHistory.toolStats.description","Aggregated tool counts and status totals."),metric:Q(s,l.toolStats===null?s("settings.dataHistory.metric.unavailable","Unavailable"):`${l.toolStats.toLocaleString()} ${s("settings.dataHistory.metric.runs","runs")} · ${(l.toolSessions??0).toLocaleString()} ${s("settings.dataHistory.metric.sessions","sessions")}`,n.toolStats),metricTooltip:s("settings.dataHistory.toolStats.metric.tooltip","Aggregated total runs and session counts."),route:"/tools",clearEndpoint:"/api/dashboard/tools/statistics/clear"},{key:"syncLog",title:s("settings.dataHistory.syncLog.title","Sync log"),description:s("settings.dataHistory.syncLog.description","Saved file sync events for the active place."),metric:Q(s,te(s,l.syncLog,"settings.dataHistory.metric.records","records"),n.syncLog),metricTooltip:s("settings.dataHistory.syncLog.metric.tooltip","Number of saved sync events and the disk space they use."),route:"/sync",clearEndpoint:"/api/dashboard/sync/history/clear"},{key:"playtestReports",title:s("settings.dataHistory.playtest.title","Playtest reports"),description:s("settings.dataHistory.playtest.description","Saved automated playtest reports and logs."),metric:Q(s,te(s,l.playtestReports,"settings.dataHistory.metric.reports","reports"),n.playtestReports),metricTooltip:s("settings.dataHistory.playtestReports.metric.tooltip","Number of saved playtest reports and the disk space they use."),route:"/playtest",clearEndpoint:"/api/dashboard/playtest/history/clear"},{key:"projectChanges",title:s("settings.dataHistory.projectChanges.title","Project change summary"),description:s("settings.dataHistory.projectChanges.description","Saved summaries of project changes."),metric:Q(s,te(s,l.projectChanges,"settings.dataHistory.metric.records","records"),n.projectChanges),metricTooltip:s("settings.dataHistory.projectChanges.metric.tooltip","Number of saved project change summaries and the disk space they use."),route:"/changelog",clearEndpoint:"/api/dashboard/changelog/clear"},{key:"connectionLog",title:s("settings.dataHistory.connectionLog.title","Connection log"),description:s("settings.dataHistory.connectionLog.description","Saved MCP and Studio connection events."),metric:Q(s,te(s,l.connectionLog,"settings.dataHistory.metric.records","records"),n.connectionLog),metricTooltip:s("settings.dataHistory.connectionLog.metric.tooltip","Number of saved connection events and the disk space they use."),route:"/connection",clearEndpoint:"/api/dashboard/connection-log/clear"}],[l,n,s]),B=async()=>{if(y){A(!0),N(null);try{if(y.kind==="uiStudio"){if(t!=="pro"||p===null)throw new Error("UI Studio place is unavailable");await se(p,{all:!0,alsoSnapshots:!0}),N(s("settings.dataHistory.uiStudio.clear.success","UI Studio saved data cleared."))}else{const u=y.row.key==="projectChanges";if(u&&p===null)throw new Error("Project changes place is unavailable");let C=y.row.clearEndpoint;u&&p!==null&&(C=`${C}?placeId=${encodeURIComponent(p)}`),await I.post(C),N(u?s("settings.dataHistory.projectChanges.clear.success","Project change summaries cleared."):s("settings.dataHistory.clear.success","Saved data cleared."))}H(null),await j()}catch{N(y.kind==="uiStudio"?s("settings.dataHistory.uiStudio.clear.failed","Failed to clear UI Studio saved data."):s("settings.dataHistory.clear.failed","Failed to clear saved data."))}finally{A(!1)}}},U=t==="pro"?p:0,F=t==="pro"&&p!==null,c=(y==null?void 0:y.kind)==="uiStudio",T=(y==null?void 0:y.kind)==="row"&&y.row.key==="projectChanges",W=s("settings.dataHistory.title","Data & History");return e.jsxs(e.Fragment,{children:[e.jsxs("section",{id:"data-history",className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(R,{label:s("settings.dataHistory.title","Data & History"),tooltip:s("settings.dataHistory.title.tooltip","Manage saved dashboard data in one place.")}),e.jsxs("div",{className:a.cardHeaderActions,children:[e.jsx(m,{text:s("settings.dataHistory.scope.tooltip","Clear actions apply to the current project and active place where applicable."),children:e.jsx("span",{className:a.headerBadge,children:v?s("common.loading","Loading"):s("settings.dataHistory.scope","Current project")})}),e.jsx(m,{text:s("settings.dataHistory.toggle.tooltip","Collapse or expand this section."),children:e.jsx("button",{className:a.collapseButton,type:"button","aria-expanded":P,"aria-controls":"settings-data-history-body","aria-label":P?s("settings.dataHistory.collapse","Collapse {title}").replace("{title}",W):s("settings.dataHistory.expand","Expand {title}").replace("{title}",W),onClick:()=>z(u=>!u),children:P?"▾":"▸"})})]})]}),P&&e.jsxs("div",{id:"settings-data-history-body",children:[e.jsx("p",{className:a.dataHistoryIntro,children:s("settings.dataHistory.intro","Review saved dashboard data, open the related page, or clear stored records from one place.")}),e.jsxs("div",{className:a.dataHistoryList,children:[S.map(u=>e.jsxs(r.Fragment,{children:[e.jsxs("div",{className:`${a.dataHistoryRow} ${u.key==="projectChanges"&&x==="projectChanges"?a.dataHistoryRowExpanded:""}`,children:[e.jsxs("div",{className:a.dataHistoryMain,children:[e.jsx("div",{className:a.dataHistoryTitle,children:u.title}),e.jsx("div",{className:a.dataHistoryDescription,children:u.description})]}),e.jsx(m,{text:u.metricTooltip,children:e.jsx("div",{className:a.dataHistoryMetric,children:u.metric})}),e.jsxs("div",{className:a.dataHistoryActions,children:[e.jsx(m,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:a.linkButton,href:`#${u.route}`,children:s("settings.dataHistory.open","Open")})}),u.key==="projectChanges"&&e.jsx(m,{text:s("settings.dataHistory.manageStorage.tooltip","Show or hide storage policy and cleanup controls."),children:e.jsxs("button",{className:a.manageStorageButton,type:"button","aria-expanded":x==="projectChanges","aria-controls":"settings-project-changes-storage","aria-label":s("settings.dataHistory.manageStorage.projectChanges.aria","Manage Project change summary storage"),onClick:()=>E("projectChanges"),children:[s("settings.dataHistory.manageStorage","Manage storage"),e.jsx("span",{"aria-hidden":"true",children:x==="projectChanges"?"▴":"▾"})]})}),e.jsx(m,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:a.dangerButton,type:"button",disabled:u.key==="projectChanges"&&p===null,onClick:()=>H({kind:"row",row:u}),children:u.key==="projectChanges"?s("settings.dataHistory.clearAll","Clear all"):s("common.clear","Clear")})})]})]}),u.key==="projectChanges"&&D.has("projectChanges")&&e.jsx("div",{id:"settings-project-changes-storage",className:`${a.dataHistoryDetail} ${a.projectChangesDataHistoryDetail}`,hidden:x!=="projectChanges",children:e.jsx(jt,{placeId:p,onChanged:j})})]},u.key)),e.jsxs("div",{className:`${a.dataHistoryRow} ${x==="uiStudio"?a.dataHistoryRowExpanded:""}`,children:[e.jsxs("div",{className:a.dataHistoryMain,children:[e.jsx("div",{className:a.dataHistoryTitle,children:s("settings.dataHistory.uiStudio.title","UI Studio history and screenshots")}),e.jsx("div",{className:a.dataHistoryDescription,children:s("settings.dataHistory.uiStudio.description","Saved UI Studio change records, screenshots, and cleanup policy.")})]}),e.jsx(m,{text:s("settings.dataHistory.uiStudio.metric.tooltip","UI Studio change record and capture counts, plus total disk usage."),children:e.jsx("div",{className:a.dataHistoryMetric,children:vt(s,i)})}),e.jsxs("div",{className:a.dataHistoryActions,children:[e.jsx(m,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:a.linkButton,href:"#/ui-studio?tab=history",children:s("settings.dataHistory.open","Open")})}),e.jsx(m,{text:s("settings.dataHistory.manageStorage.tooltip","Show or hide storage policy and cleanup controls."),children:e.jsxs("button",{className:a.manageStorageButton,type:"button","aria-expanded":x==="uiStudio","aria-controls":"settings-ui-studio-storage","aria-label":s("settings.dataHistory.manageStorage.uiStudio.aria","Manage UI Studio history and screenshots storage"),onClick:()=>E("uiStudio"),children:[s("settings.dataHistory.manageStorage","Manage storage"),e.jsx("span",{"aria-hidden":"true",children:x==="uiStudio"?"▴":"▾"})]})}),e.jsx(m,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:a.dangerButton,type:"button",disabled:!F,onClick:()=>H({kind:"uiStudio"}),children:s("settings.dataHistory.clearAll","Clear all")})})]})]}),D.has("uiStudio")&&e.jsx("div",{id:"settings-ui-studio-storage",className:`${a.dataHistoryDetail} ${a.uiStudioDataHistoryDetail}`,hidden:x!=="uiStudio",children:e.jsx(gt,{placeId:U,tier:t,onChanged:j,embedded:!0,...t==="basic"?{sampleUsage:ae,sampleRetention:_e}:{}})})]}),$&&e.jsx("p",{className:a.inlineStatus,children:$})]})]}),e.jsx(ce,{open:y!==null,title:c?s("settings.dataHistory.uiStudio.clear.title","Clear UI Studio saved data?"):T?s("settings.dataHistory.projectChanges.clear.title","Clear project change summaries?"):s("settings.dataHistory.clear.title","Clear saved data?"),message:c?s("settings.dataHistory.uiStudio.clear.message","This deletes saved UI Studio change records and screenshots only. Roblox Studio instances and project objects are not changed."):T?s("settings.dataHistory.projectChanges.clear.message","This deletes completed sessions and ended context history for the selected Place. Active work and Roblox Studio project data stay intact."):s("settings.dataHistory.clear.message","This deletes saved dashboard records only. Roblox Studio instances and project objects are not changed."),cancelLabel:s("common.cancel","Cancel"),confirmLabel:T||c?s("settings.dataHistory.clearAll","Clear all"):s("common.clear","Clear"),loading:L,onCancel:()=>!L&&H(null),onConfirm:()=>void B()})]})}const Ct=r.forwardRef(function({autoOpen:s,settingsFilePath:l,saving:d,targeted:n,updateDashboardPreferences:b},i){const{t:g}=X(),[p,_]=r.useState("idle"),v="settings-dashboard-auto-open-label",k=d||p==="saving",P=async x=>{_("saving");try{await b({autoOpen:x}),_("saved")}catch{_("error")}},z=p==="saving"?g("settings.dashboard.autoOpen.saving","Saving…"):p==="saved"?g("settings.dashboard.autoOpen.saved","Saved for the next server start."):p==="error"?g("settings.dashboard.autoOpen.error","Could not save. The previous setting was restored."):" ";return e.jsxs("div",{id:"settings-dashboard",ref:i,tabIndex:-1,"data-testid":"settings-dashboard-card",className:[a.card,a.dashboardCard,n?a.dashboardCardTarget:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(R,{label:g("settings.dashboard.title","Dashboard"),tooltip:g("settings.dashboard.title.tooltip","Choose how WEPPY Dashboard behaves when the MCP Server starts.")}),e.jsx(m,{text:g("settings.dashboard.autoOpen.nextStart","Applies the next time the MCP Server starts."),children:e.jsx("span",{className:a.headerBadge,children:g("settings.dashboard.nextStartBadge","Next Start")})})]}),e.jsxs("div",{className:a.dashboardSettingRow,children:[e.jsxs("div",{className:a.dashboardSettingCopy,children:[e.jsx("span",{id:v,className:a.dashboardSettingLabel,children:g("settings.dashboard.autoOpen.label","Open Dashboard when WEPPY starts")}),e.jsx("span",{className:a.dashboardSettingDescription,children:g("settings.dashboard.autoOpen.description","Automatically opens this Dashboard after the MCP Server starts.")}),e.jsx("span",{className:a.dashboardSettingMeta,children:g("settings.dashboard.autoOpen.nextStart","Applies the next time the MCP Server starts.")})]}),e.jsxs("label",{className:`${a.toggleSwitch} ${a.dashboardToggleTarget}`,children:[e.jsx("input",{className:a.toggleInput,type:"checkbox",role:"switch","aria-labelledby":v,checked:s,disabled:k,onChange:x=>{P(x.target.checked)}}),e.jsx("span",{className:a.toggleTrack,"aria-hidden":"true",children:e.jsx("span",{className:a.toggleThumb})})]})]}),e.jsxs("dl",{className:a.dashboardDetails,children:[e.jsxs("div",{className:a.dashboardDetailRow,children:[e.jsx("dt",{children:g("settings.dashboard.settingsFile.label","Settings file")}),e.jsx("dd",{children:e.jsx("code",{className:a.dashboardSettingsFilePath,children:l})})]}),e.jsxs("div",{className:a.dashboardDetailRow,children:[e.jsx("dt",{children:g("settings.dashboard.agentExample.label","Ask your Agent")}),e.jsx("dd",{className:a.dashboardAgentPrompt,children:g("settings.dashboard.agentExample.prompt","“Turn off Dashboard auto-open.”")})]})]}),e.jsx("p",{className:`${a.dashboardSaveFeedback} ${p==="error"?a.dashboardSaveFeedbackError:""}`,"aria-live":"polite",children:z})]})}),Nt={en:"English",ko:"한국어",es:"Español","pt-br":"Português (BR)",ja:"日本語",id:"Bahasa Indonesia",de:"Deutsch","fr-fr":"Français"};function _t(t){return t==="active"?a.statusActive:t==="grace"?a.statusGrace:t==="invalid"||t==="revoked"?a.statusError:a.statusInactive}function kt(t){return t?t.refreshBlockedReason==="missing_session_token"?!0:t.status==="active"||t.status==="grace"||t.status==="invalid"||t.status==="revoked"||t.status==="unknown":!1}function Pt(t,s){return t.refreshBlockedReason==="missing_session_token"?{label:s("settings.license.status.activationRequired","Activation Required"),tooltip:s("settings.license.status.activationRequired.tooltip","Manual license activation is required before WEPPY Dashboard can refresh this status."),detail:s("settings.license.detail.missingSessionToken","Refresh is blocked because the current session token is missing."),detailTone:a.licenseNoticeWarning}:t.statusDetail==="active_cancel_pending"?{label:s("settings.license.active","Active"),tooltip:s("settings.license.status.activeCancelPending.tooltip","Cancellation is pending, but Pro access remains active until the current billing period ends."),detail:s("settings.license.detail.cancelPending","Cancellation is scheduled. Pro access remains active until the current billing period ends."),detailTone:a.licenseNoticeInfo}:t.statusDetail==="grace_provider_unavailable"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.grace.tooltip","Provider verification is temporarily unavailable, but Pro access remains active during the grace period."),detail:s("settings.license.detail.graceProviderUnavailable","Provider unavailable. Pro access remains active during grace mode."),detailTone:a.licenseNoticeInfo}:t.statusDetail==="grace_expired"||t.statusDetail==="grace_payment_failed"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.graceBilling.tooltip","Pro access is still available during a billing-related grace period."),detail:s("settings.license.detail.graceBilling","Pro access remains available during a billing grace period."),detailTone:a.licenseNoticeInfo}:{label:s(`settings.license.${t.status}`,t.status),tooltip:s(`settings.license.${t.status}.tooltip`,"Current license activation state."),detail:t.refreshRequired?s("settings.license.detail.refreshRecommended","License verification should be refreshed soon."):null,detailTone:a.licenseNoticeMuted}}function zt(){const{t,selectedLocale:s,setLocale:l}=X(),{trackEvent:d}=le(),{search:n}=ye(),{settings:b,license:i,licenseControlsDisabled:g,licenseSubmitting:p,licenseMessage:_,activateLicense:v,refreshLicense:k,resetLicense:P,saving:z,updateDashboardPreferences:x,loading:f}=Se(),[D,w]=r.useState(""),y=i?Pt(i,t):null,H=kt(i),L=H&&(i==null?void 0:i.refreshBlockedReason)!=="missing_session_token",A=H,$=H?i==null?void 0:i.maskedKey:void 0,N=i!=null&&i.provider&&i.provider!=="auto"?i.provider:void 0,j=(i==null?void 0:i.tier)==="pro"?"pro":"basic",E=r.useRef(null),S=r.useRef(null),B=r.useRef(null),U=r.useMemo(()=>new URLSearchParams(n).get("section")==="license",[n]),F=r.useMemo(()=>new URLSearchParams(n).get("section")==="dashboard",[n]);return r.useEffect(()=>{var T;if(!U||f)return;const c=E.current;if((T=c==null?void 0:c.scrollIntoView)==null||T.call(c,{block:"start",behavior:"smooth"}),B.current&&!B.current.disabled){B.current.focus();return}c==null||c.focus()},[f,g,p,U]),r.useEffect(()=>{var T;if(!F||f)return;const c=S.current;(T=c==null?void 0:c.scrollIntoView)==null||T.call(c,{block:"start",behavior:"smooth"}),c==null||c.focus()},[f,F]),f?e.jsx("div",{className:a.page,children:e.jsx("div",{className:a.loading,children:t("common.loading")})}):e.jsxs("div",{className:a.page,children:[e.jsx(ve,{title:t("page.settings.title","Settings"),description:t("page.settings.description","Manage license, saved data, server environment, and language."),helpTopicId:"settings",helpState:{tier:j}}),e.jsxs("div",{id:"settings-license",ref:E,tabIndex:-1,"data-testid":"settings-license-card",className:[a.card,U?a.licenseCardTarget:"",(i==null?void 0:i.tier)==="pro"?a.licenseCardPro:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(R,{label:t("settings.license.title","License"),tooltip:t("settings.license.title.tooltip","Current license status and subscription tier.")}),e.jsx(m,{text:g?t("settings.license.disconnected.tooltip","Reconnect to the MCP server to manage license actions from WEPPY Dashboard."):t("settings.license.live.tooltip","License actions are sent to the MCP server immediately."),children:e.jsx("span",{className:`${a.headerBadge} ${g?"":a.headerBadgeLive}`,children:g?t("settings.license.disconnected","Disconnected"):t("settings.general.liveApply","Live Apply")})})]}),e.jsxs(e.Fragment,{children:[i?e.jsxs(e.Fragment,{children:[(()=>{const c=y;return e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:a.licenseGrid,children:[e.jsx("dt",{children:e.jsx(R,{label:t("settings.license.status","Status"),tooltip:t("settings.license.status.tooltip","Current license activation state.")})}),e.jsxs("dd",{children:[e.jsx("span",{className:`${a.statusDot} ${_t(i.status)}`}),e.jsx(m,{text:(c==null?void 0:c.tooltip)??t(`settings.license.${i.status}.tooltip`,"Current license activation state."),children:(c==null?void 0:c.label)??t(`settings.license.${i.status}`,i.status)})]}),e.jsx("dt",{children:e.jsx(R,{label:t("settings.license.tier","Tier"),tooltip:t("settings.license.tier.tooltip","Current subscription tier for available WEPPY Dashboard features.")})}),e.jsx("dd",{className:i.tier==="pro"?a.proBadge:"",children:e.jsx(m,{text:t(`tier.${i.tier}.tooltip`,"Available feature set for the connected license."),children:i.tier==="pro"?t("tier.pro","Pro"):t("tier.basic","Basic")})}),$&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(R,{label:t("settings.license.key","Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("dd",{children:e.jsx(m,{text:t("settings.license.keyValue.tooltip","Masked license key currently loaded by the server."),children:$})})]}),N&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(R,{label:t("settings.license.provider","Provider"),tooltip:t("settings.license.provider.tooltip","License provider used to validate this key.")})}),e.jsx("dd",{children:e.jsx(m,{text:t("settings.license.providerValue.tooltip","License provider used to validate this key."),children:N})})]})]}),(c==null?void 0:c.detail)&&e.jsx("p",{className:`${a.licenseNotice} ${c.detailTone}`,children:i.refreshBlockedReason==="missing_session_token"?t("settings.license.detail.manualActivation","Manual activation required to restore Pro access."):c.detail}),i.refreshBlockedReason==="missing_session_token"&&e.jsx("p",{className:`${a.licenseNotice} ${a.licenseNoticeMuted}`,children:c==null?void 0:c.detail})]})})(),i.tier==="basic"&&e.jsx(m,{text:t("tier.upgrade.tooltip","View Pro features and purchase options."),children:e.jsx("a",{className:a.upgradeLink,href:je.settingsLicense,target:"_blank",rel:"noopener noreferrer",onClick:()=>d("dashboard_click_event",{click_target:"upgrade_cta",placement:"settings_license",page:"settings"}),children:t("tier.upgrade","View Pro")})})]}):e.jsx("div",{className:a.loading,children:t("settings.license.unavailable")}),e.jsxs("div",{className:a.licenseControls,children:[e.jsxs("div",{className:a.licenseControlRow,children:[e.jsx(m,{text:t("settings.license.refresh.tooltip","Re-fetch the current state from the license server. Useful when a billing change hasn't appeared yet."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:g||p||!L,onClick:()=>{k()},children:p?t("common.loading"):t("settings.license.refresh","Refresh License")})}),e.jsx(m,{text:t("settings.license.reset.tooltip","Remove the currently registered license key. Use this before activating with a different key."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:g||p||!A,onClick:()=>{P()},children:p?t("common.loading"):t("settings.license.reset","Reset License")})})]}),e.jsxs("div",{className:a.licenseControlRow,children:[e.jsxs("label",{className:`${a.licenseField} ${a.licenseFieldGrow}`,children:[e.jsx("span",{className:a.controlLabel,children:e.jsx(R,{label:t("settings.license.keyInput","License Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("input",{ref:B,"aria-label":t("settings.license.keyInput","License Key"),className:a.textInput,type:"text",value:D,disabled:g||p,onChange:c=>w(c.target.value)})]}),e.jsx(m,{text:t("settings.license.activate.tooltip","Activate Pro features with the entered license key."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:g||p,onClick:()=>{(async()=>await v(D)&&w(""))()},children:p?t("common.loading"):t("settings.license.activate","Activate License")})})]}),_&&e.jsx("p",{className:a.licenseMessage,children:_})]})]})]}),e.jsx(St,{tier:j}),b&&e.jsx(Ct,{ref:S,autoOpen:b.dashboard.autoOpen,settingsFilePath:b.dashboard.settingsFilePath,saving:z,targeted:F,updateDashboardPreferences:x}),e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(R,{label:t("settings.cold.title","Server Environment"),tooltip:t("settings.cold.title.tooltip","Read-only server environment values loaded at startup.")}),e.jsx(m,{text:t("settings.readOnly.tooltip","This section shows values that cannot be edited from WEPPY Dashboard."),children:e.jsx("span",{className:a.headerBadge,children:t("settings.readOnly","Read-only")})})]}),b?e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:a.coldGrid,children:[e.jsx("dt",{children:e.jsx(R,{label:"HTTP_PORT",tooltip:t("settings.cold.httpPort.tooltip","Port number used by the MCP WEPPY Dashboard HTTP server.")})}),e.jsx("dd",{children:b.cold.HTTP_PORT}),e.jsx("dt",{children:e.jsx(R,{label:"HTTP_HOST",tooltip:t("settings.cold.httpHost.tooltip","Host interface that the MCP WEPPY Dashboard HTTP server binds to.")})}),e.jsx("dd",{children:b.cold.HTTP_HOST})]}),e.jsx("p",{className:a.coldHint,children:t("settings.cold.hint","Set via environment variables to change these values.")})]}):e.jsx("div",{className:a.loading,children:t("settings.unavailable")})]}),e.jsxs("div",{className:a.card,children:[e.jsx("div",{className:a.cardHeader,children:e.jsx(R,{label:t("settings.language.title","Language"),tooltip:t("settings.language.title.tooltip","Choose how the WEPPY Dashboard interface text is localized.")})}),e.jsxs("div",{className:a.langRow,children:[e.jsx("label",{children:e.jsx(R,{label:t("settings.language.dashboard","WEPPY Dashboard Language"),tooltip:t("settings.language.dashboard.tooltip","Overrides the WEPPY Dashboard language or follows the system language when set to Auto.")})}),e.jsx(m,{text:t("settings.language.auto.tooltip","Follow the operating system's language. Falls back to English when not supported."),children:e.jsxs("select",{className:a.select,value:s,onChange:c=>l(c.target.value),children:[e.jsx("option",{value:xe,children:t("settings.language.auto","Auto")}),fe.map(c=>e.jsx("option",{value:c,children:Nt[c]??c},c))]})})]})]})]})}export{zt as Component};
1
+ import{u as X,a as le,r,j as e,b as I,g as me,c as ye,T as je,A as xe,S as fe}from"./index-B1SnAt0o.js";import{C as be,P as ve}from"./PageHeader-QiUV3oJs.js";import{I as R}from"./InfoLabel-DfinjjFO.js";import{T as m}from"./TooltipText-x86NSn8t.js";import{s as a,u as Se}from"./useSettings-BiOxUpzD.js";import{C as ce}from"./ConfirmModal-D2yw01tT.js";import{D as de,f as ue,r as Ce,s as Ne,a as pe,d as se,S as ae,b as _e}from"./sample-requests-BxNYwxW0.js";import"./ConfirmModal.module-DJksQHBd.js";const ke="_card_jz1ya_4",Pe="_cardEmbedded_jz1ya_14",Le="_cardTitle_jz1ya_21",Re="_storageConsoleGrid_jz1ya_31",we="_storageUsageColumn_jz1ya_38",He="_storagePolicyColumn_jz1ya_39",Be="_usageRow_jz1ya_44",Me="_usageTotal_jz1ya_50",Ae="_usageBreakdown_jz1ya_57",$e="_usageCounts_jz1ya_63",ze="_storageFooter_jz1ya_70",De="_lastRunRow_jz1ya_79",Ee="_lastRunLabel_jz1ya_89",Te="_errorIcon_jz1ya_95",Ie="_tooltip_jz1ya_103",Ue="_cleanupRow_jz1ya_126",Fe="_cleanupLabel_jz1ya_133",Oe="_cleanupBtn_jz1ya_140",Ge="_cleanupBtnDanger_jz1ya_169",qe="_retentionSection_jz1ya_182",We="_retentionTitle_jz1ya_188",Ye="_retentionFieldset_jz1ya_196",Ke="_proOverlay_jz1ya_211",Ve="_modeSegments_jz1ya_223",Je="_radioLabel_jz1ya_244",Qe="_radioLabelActive_jz1ya_265",Ze="_presetGroup_jz1ya_279",Xe="_presetBtn_jz1ya_287",et="_presetBtnActive_jz1ya_310",tt="_freeInput_jz1ya_317",st="_inputError_jz1ya_334",at="_inputUnit_jz1ya_338",it="_cascadeRow_jz1ya_345",nt="_retentionActions_jz1ya_361",ot="_saveBtn_jz1ya_367",rt="_runNowBtn_jz1ya_395",lt="_errorMsg_jz1ya_439",ct="_freeInputHitArea_jz1ya_501",o={card:ke,cardEmbedded:Pe,cardTitle:Le,storageConsoleGrid:Re,storageUsageColumn:we,storagePolicyColumn:He,usageRow:Be,usageTotal:Me,usageBreakdown:Ae,usageCounts:$e,storageFooter:ze,lastRunRow:De,lastRunLabel:Ee,errorIcon:Te,tooltip:Ie,cleanupRow:Ue,cleanupLabel:Fe,cleanupBtn:Oe,cleanupBtnDanger:Ge,retentionSection:qe,retentionTitle:We,retentionFieldset:Ye,proOverlay:Ke,modeSegments:Ve,radioLabel:Je,radioLabelActive:Qe,presetGroup:Ze,presetBtn:Xe,presetBtnActive:et,freeInput:tt,inputError:st,inputUnit:at,cascadeRow:it,retentionActions:nt,saveBtn:ot,runNowBtn:rt,errorMsg:lt,freeInputHitArea:ct};function dt(t,s){return!!(t.mode==="off"&&s.mode!=="off"||t.mode==="age"&&s.mode==="age"&&(s.ageDays??0)<(t.ageDays??0)||t.mode==="size"&&s.mode==="size"&&(s.sizeMb??0)<(t.sizeMb??0)||!t.cascadeSnapshots&&s.cascadeSnapshots)}function ie(t){return t.mode==="age"?Number.isInteger(t.ageDays)&&t.ageDays>=1&&t.ageDays<=365:t.mode==="size"?Number.isInteger(t.sizeMb)&&t.sizeMb>=50&&t.sizeMb<=1e4:!0}function ut(t,s){return t.mode===s.mode&&t.ageDays===s.ageDays&&t.sizeMb===s.sizeMb&&t.cascadeSnapshots===s.cascadeSnapshots}function Y(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(2)} GB`}function pt({placeId:t,tier:s,currentPolicy:l,onSaved:d}){const{t:n}=X(),{trackEvent:b}=le(),[i,g]=r.useState(l),[p,_]=r.useState(()=>[7,14,30,90].includes(l.ageDays??-1)?"":String(l.ageDays??30)),[v,k]=r.useState(()=>[100,500,1e3].includes(l.sizeMb??-1)?"":String(l.sizeMb??500)),[P,z]=r.useState(null),[x,f]=r.useState(!1),[D,w]=r.useState(!1),[y,H]=r.useState(!1),[L,A]=r.useState(null);r.useEffect(()=>{g(l);const h=[7,14,30,90],M=[100,500,1e3];_(h.includes(l.ageDays??-1)?"":String(l.ageDays??30)),k(M.includes(l.sizeMb??-1)?"":String(l.sizeMb??500))},[l]);const $=s==="basic",N=ie(i),j=ut(l,i),E=N&&!j&&!D,S=h=>{g(M=>{const O={...M,mode:h};return h==="age"&&(O.ageDays=parseInt(p,10)||30),h==="size"&&(O.sizeMb=parseInt(v,10)||500),O})},B=h=>{_(""),g(M=>({...M,ageDays:h}))},U=h=>{k(""),g(M=>({...M,sizeMb:h}))},F=h=>{_(h);const M=parseInt(h,10);Number.isNaN(M)||g(O=>({...O,ageDays:M}))},c=h=>{k(h);const M=parseInt(h,10);Number.isNaN(M)||g(O=>({...O,sizeMb:M}))},T=async()=>{if(A(null),b("dashboard_click_event",{click_target:"ui_studio_cleanup_save",page:"settings"}),dt(l,i)){try{const h=await ue(t,{mode:i.mode,ageDays:i.ageDays,sizeMb:i.sizeMb,cascadeSnapshots:i.cascadeSnapshots});z(h.dryRun),f(!0)}catch(h){A(h.message)}return}await W()},W=async()=>{w(!0);try{await Ne(t,i),f(!1),d()}catch(h){throw A(h.message),h}finally{w(!1)}},u=async()=>{A(null),b("dashboard_click_event",{click_target:"ui_studio_cleanup_run_now",page:"settings"}),H(!0);try{await Ce(t),d()}catch(h){A(h.message)}finally{H(!1)}},C=P?`${n("uiStudio.cleanup.policy.confirm.messageStrict","이 정책으로 즉시")} ${P.wouldRemoveRequests}${n("uiStudio.cleanup.policy.confirm.requests","건")} / ${P.wouldRemoveSnapshots}${n("uiStudio.cleanup.policy.confirm.snapshots","개 화면 캡처")} / ${Y(P.wouldFreeBytes)} ${n("uiStudio.cleanup.policy.confirm.freed","가 삭제됩니다 — 적용?")}`:"",K=i.mode==="age"&&!ie(i),q=i.mode==="size"&&!ie(i);return e.jsxs("div",{className:o.retentionSection,children:[e.jsx("h3",{className:o.retentionTitle,children:e.jsx(R,{label:n("uiStudio.cleanup.policy.title","자동 삭제 정책"),tooltip:n("uiStudio.cleanup.policy.title.tooltip","Rules that automatically remove old or large captures.")})}),e.jsxs("div",{style:{position:"relative"},children:[$&&e.jsx("div",{className:o.proOverlay,title:n("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능"),children:e.jsx("div",{className:o.tooltip,children:n("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능")})}),e.jsxs("fieldset",{className:o.retentionFieldset,disabled:$,"aria-label":n("uiStudio.cleanup.policy.title","자동 삭제 정책"),style:$?{opacity:.45,pointerEvents:"none"}:void 0,children:[e.jsxs("div",{className:o.modeSegments,"data-testid":"cleanup-mode-segments",children:[e.jsx(m,{text:n("uiStudio.cleanup.policy.modeOff.tooltip","Turn off auto-cleanup. Data stays until you remove it manually."),children:e.jsxs("label",{className:`${o.radioLabel} ${i.mode==="off"?o.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"off",checked:i.mode==="off",onChange:()=>S("off")}),n("uiStudio.cleanup.policy.modeOff","사용 안 함 (off)")]})}),e.jsx(m,{text:n("uiStudio.cleanup.policy.modeAge.tooltip","Automatically delete data older than the configured number of days."),children:e.jsxs("label",{className:`${o.radioLabel} ${i.mode==="age"?o.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"age",checked:i.mode==="age",onChange:()=>S("age")}),n("uiStudio.cleanup.policy.modeAge","기간 기반 (age)")]})}),e.jsx(m,{text:n("uiStudio.cleanup.policy.modeSize.tooltip","When total usage exceeds the limit, the oldest data is removed first."),children:e.jsxs("label",{className:`${o.radioLabel} ${i.mode==="size"?o.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"size",checked:i.mode==="size",onChange:()=>S("size")}),n("uiStudio.cleanup.policy.modeSize","용량 기반 (size)")]})})]}),i.mode==="age"&&e.jsxs("div",{className:o.presetGroup,children:[[7,14,30,90].map(h=>e.jsx(m,{text:n("uiStudio.cleanup.policy.agePreset.tooltip","Delete data older than this many days."),children:e.jsxs("button",{type:"button",className:`${o.presetBtn} ${i.ageDays===h&&p===""?o.presetBtnActive:""}`,onClick:()=>B(h),children:[h,n("uiStudio.cleanup.policy.daysUnit","일")]})},h)),e.jsx(m,{text:n("uiStudio.cleanup.policy.ageInput.tooltip","Enter any value between 1 and 365 days."),children:e.jsx("label",{className:o.freeInputHitArea,children:e.jsx("input",{type:"number",className:`${o.freeInput} ${K?o.inputError:""}`,value:p,min:1,max:365,onChange:h=>F(h.target.value)})})}),e.jsxs("span",{className:o.inputUnit,children:["1–365",n("uiStudio.cleanup.policy.daysUnit","일")]})]}),i.mode==="size"&&e.jsxs("div",{className:o.presetGroup,children:[[100,500,1e3].map(h=>e.jsx(m,{text:n("uiStudio.cleanup.policy.sizePreset.tooltip","Keep total usage under this size."),children:e.jsxs("button",{type:"button",className:`${o.presetBtn} ${i.sizeMb===h&&v===""?o.presetBtnActive:""}`,onClick:()=>U(h),children:[h,n("uiStudio.cleanup.policy.mbUnit","MB")]})},h)),e.jsx(m,{text:n("uiStudio.cleanup.policy.sizeInput.tooltip","Enter any value between 50 MB and 10000 MB (10 GB)."),children:e.jsx("label",{className:o.freeInputHitArea,children:e.jsx("input",{type:"number",className:`${o.freeInput} ${q?o.inputError:""}`,value:v,min:50,max:1e4,onChange:h=>c(h.target.value)})})}),e.jsxs("span",{className:o.inputUnit,children:["50–10000",n("uiStudio.cleanup.policy.mbUnit","MB")]})]}),e.jsx(m,{text:n("uiStudio.cleanup.policy.cascade.tooltip","Also delete the capture images linked to those records. If off, the images stay."),children:e.jsxs("label",{className:o.cascadeRow,children:[e.jsx(be,{checked:i.cascadeSnapshots,onChange:h=>g(M=>({...M,cascadeSnapshots:h.target.checked}))}),n("uiStudio.cleanup.policy.cascade","연결된 화면 캡처도 함께 삭제")]})}),e.jsxs("div",{className:o.retentionActions,children:[e.jsx(m,{text:n("uiStudio.cleanup.policy.save.tooltip","Save the current cleanup rule. It runs in the background from then on."),children:e.jsx("button",{type:"button",className:o.saveBtn,onClick:()=>void T(),disabled:!E,children:n("uiStudio.cleanup.policy.save","정책 저장")})}),e.jsx(m,{text:n("uiStudio.cleanup.policy.runNow.tooltip","저장된 정리 정책을 다음 자동 실행까지 기다리지 않고 지금 한 번 실행합니다."),children:e.jsx("button",{type:"button",className:o.runNowBtn,onClick:()=>void u(),disabled:y,children:n("uiStudio.cleanup.policy.runNow","저장된 정책으로 정리")})})]}),L&&e.jsx("div",{className:o.errorMsg,children:L})]})]}),x&&P&&e.jsx(de,{title:n("uiStudio.cleanup.policy.confirm.title","정책 적용 확인"),message:C,danger:!0,confirmLabel:n("uiStudio.cleanup.policy.save","정책 저장"),busy:D,onConfirm:W,onClose:()=>f(!1)})]})}function gt({placeId:t,tier:s,onChanged:l,sampleUsage:d,sampleRetention:n,embedded:b=!1}){const{t:i}=X(),g=s==="basic"&&d!=null&&n!=null,[p,_]=r.useState(g?d:null),[v,k]=r.useState(g?n:null),[P,z]=r.useState(null),[x,f]=r.useState(null),[D,w]=r.useState(null),y=r.useCallback(async()=>{if(!g&&t!=null){z(null);try{const[S,B]=await Promise.all([pe(t),ue(t)]);_(S),k(B.policy)}catch(S){z(S.message)}}},[t,g]);r.useEffect(()=>{y()},[y]);const H=r.useCallback(()=>{y(),l==null||l()},[y,l]),L=r.useCallback(async()=>{if(x&&t!=null){w(null);try{x.kind==="keep7"?await se(t,{olderThanDays:7,alsoSnapshots:!0}):x.kind==="keep30"?await se(t,{olderThanDays:30,alsoSnapshots:!0}):await se(t,{all:!0,alsoSnapshots:!0}),f(null),y(),l==null||l()}catch(S){throw w(S.message),S}}},[x,t,y,l]);function A(S){const B=i("uiStudio.cleanup.studioPreservedNote","This deletes saved change records and screenshots on disk only; Roblox Studio instances are not affected.");return S.kind==="keep7"?`${i("uiStudio.cleanup.cleanupConfirmMessage.keep7","7일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${B}`:S.kind==="keep30"?`${i("uiStudio.cleanup.cleanupConfirmMessage.keep30","30일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${B}`:`${((p==null?void 0:p.requestCount)??0)+((p==null?void 0:p.snapshotCount)??0)}${i("uiStudio.cleanup.cleanupConfirmMessage.all","개의 저장된 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${B}`}if(t==null&&!g)return null;if(P)return e.jsx("div",{className:`${o.card} ${b?o.cardEmbedded:""}`,children:e.jsx("p",{className:o.errorMsg,children:P})});if(!p||!v)return e.jsx("div",{className:`${o.card} ${b?o.cardEmbedded:""}`,children:e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",margin:0},children:i("uiStudio.storage.loading","로딩 중...")})});const $=v.lastRunAt,N=v.lastRunStats,j=$?new Date($).toLocaleString():null,E=t??0;return e.jsxs("div",{className:`${o.card} ${b?o.cardEmbedded:""}`,children:[!b&&e.jsx("h3",{className:o.cardTitle,children:e.jsx(R,{label:i("uiStudio.storage.title","UI Studio 저장 데이터"),tooltip:i("uiStudio.storage.title.tooltip","Disk usage of UI Studio change records and screenshots.")})}),e.jsxs("div",{className:o.storageConsoleGrid,"data-testid":"ui-studio-storage-console-grid",children:[e.jsx("section",{className:o.storageUsageColumn,children:e.jsxs("div",{className:o.usageRow,children:[e.jsx(m,{text:i("uiStudio.storage.usageLabel.tooltip","Disk space currently used by UI Studio for this project."),children:e.jsxs("div",{className:o.usageTotal,children:[i("uiStudio.storage.usageLabel","사용 중")," ",Y(p.totalBytes)]})}),e.jsxs("div",{className:o.usageBreakdown,children:[e.jsx(m,{text:i("uiStudio.storage.historyBytes.tooltip","Space taken by change record data (JSON)."),children:e.jsxs("span",{children:[i("uiStudio.storage.historyBytes","변경 이력")," ",Y(p.historyBytes)]})})," · ",e.jsx(m,{text:i("uiStudio.storage.snapshotBytes.tooltip","Space taken by captured PNG image files."),children:e.jsxs("span",{children:[i("uiStudio.storage.snapshotBytes","화면 캡처")," ",Y(p.snapshotBytes)]})})]}),e.jsxs("div",{className:o.usageCounts,children:[e.jsx(m,{text:i("uiStudio.storage.requestCount.tooltip","Number of actions where AI changed the UI."),children:e.jsxs("span",{children:[i("uiStudio.storage.requestCount","변경 기록")," ",p.requestCount.toLocaleString(),i("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(m,{text:i("uiStudio.storage.mutationCount.tooltip","Number of detail changes inside actions (one property edit = 1)."),children:e.jsxs("span",{children:[i("uiStudio.storage.mutationCount","변경 상세")," ",p.mutationCount.toLocaleString(),i("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(m,{text:i("uiStudio.storage.snapshotCount.tooltip","Number of saved capture image files."),children:e.jsxs("span",{children:[i("uiStudio.storage.snapshotCount","화면 캡처")," ",p.snapshotCount.toLocaleString(),i("uiStudio.storage.countSuffix","개")]})})]})]})}),e.jsx("section",{className:o.storagePolicyColumn,children:e.jsx(pt,{placeId:E,tier:s,currentPolicy:v,onSaved:H})})]}),e.jsxs("div",{className:o.storageFooter,"data-testid":"ui-studio-storage-footer",children:[e.jsxs("div",{className:o.lastRunRow,children:[e.jsx("span",{className:o.lastRunLabel,children:e.jsx(R,{label:i("uiStudio.storage.lastRun","마지막 자동 정리"),tooltip:i("uiStudio.storage.lastRun.tooltip","When the auto-cleanup policy last ran, and what it removed.")})}),j?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:j}),N&&e.jsxs("span",{children:["· ",i("uiStudio.storage.requestCount","변경 기록")," ",N.removedRequests,i("uiStudio.storage.countSuffix","개")," / ",i("uiStudio.storage.snapshotCount","화면 캡처")," ",N.removedSnapshots,i("uiStudio.storage.countSuffix","개")," / ",Y(N.freedBytes)," ",i("uiStudio.storage.lastRunFreed","회수")]}),N&&N.errors>0&&e.jsxs("span",{className:o.errorIcon,title:`${i("uiStudio.storage.lastRunErrors","오류")} ${N.errors}건`,children:["⚠",e.jsxs("span",{className:o.tooltip,children:[i("uiStudio.storage.lastRunErrors","오류")," ",N.errors,i("uiStudio.storage.countSuffix","건")]})]})]}):e.jsx("span",{children:i("uiStudio.storage.lastRunNever","—")})]}),e.jsxs("div",{className:o.cleanupRow,children:[e.jsx("span",{className:o.cleanupLabel,children:e.jsx(R,{label:i("uiStudio.cleanup.label","수동 정리"),tooltip:i("uiStudio.cleanup.label.tooltip","Manually clean up change records and captures whenever you want.")})}),e.jsx(m,{text:i("uiStudio.cleanup.keep7.tooltip","Delete change records and captures older than 7 days."),children:e.jsx("button",{type:"button",className:o.cleanupBtn,onClick:()=>f({kind:"keep7"}),disabled:s==="basic",children:i("uiStudio.cleanup.keepLastNDays","최근 7일만 남기기").replace("{n}","7")})}),e.jsx(m,{text:i("uiStudio.cleanup.keep30.tooltip","Delete change records and captures older than 30 days."),children:e.jsx("button",{type:"button",className:o.cleanupBtn,onClick:()=>f({kind:"keep30"}),disabled:s==="basic",children:i("uiStudio.cleanup.keepLastNDays","최근 30일만 남기기").replace("{n}","30")})}),!b&&e.jsx(m,{text:i("uiStudio.cleanup.deleteAll.tooltip","Delete every change record and capture for this project. The actual UI in Roblox Studio is not affected."),children:e.jsx("button",{type:"button",className:`${o.cleanupBtn} ${o.cleanupBtnDanger}`,onClick:()=>f({kind:"all"}),disabled:s==="basic",children:i("uiStudio.cleanup.deleteAll","전체 삭제…")})})]})]}),D&&e.jsx("div",{className:o.errorMsg,children:D}),x&&e.jsx(de,{title:i("uiStudio.cleanup.cleanupConfirmTitle","정리 확인"),message:A(x),danger:!0,confirmLabel:i("common.delete","삭제"),onConfirm:L,onClose:()=>{f(null),w(null)}})]})}function ne(t,s){const l={placeId:String(t)};return s&&(l["preview.mode"]=s.mode,s.mode==="size"&&(l["preview.sizeMb"]=String(s.sizeMb))),I.get("/api/dashboard/changelog/cleanup",l)}function oe(t){return I.put("/api/dashboard/changelog/cleanup",t)}function ht(t){return I.post(`/api/dashboard/changelog/cleanup/run?placeId=${encodeURIComponent(t)}`)}const mt=[100,500,1e3];function re(t,s){return t.mode!==s.mode?!1:t.mode==="off"||s.mode==="size"&&t.sizeMb===s.sizeMb}function yt(t,s){return t.mode==="off"?!1:s.mode==="off"||t.sizeMb<s.sizeMb}function J(t){return t<1e3?`${t} B`:t<1e6?`${(t/1e3).toFixed(1)} KB`:t<1e9?`${(t/1e6).toFixed(1)} MB`:`${(t/1e9).toFixed(2)} GB`}function jt({placeId:t,onChanged:s}){const{locale:l,t:d}=X(),[n,b]=r.useState(null),[i,g]=r.useState({mode:"size",sizeMb:500}),[p,_]=r.useState(t!==null),[v,k]=r.useState(!1),[P,z]=r.useState(!1),[x,f]=r.useState(!1),[D,w]=r.useState(!1),[y,H]=r.useState(null),L=r.useCallback(async()=>{if(t===null){b(null),_(!1);return}z(!1);try{const u=await ne(t);b(u),g(u.policy)}catch{z(!0)}finally{_(!1)}},[t]);r.useEffect(()=>{_(t!==null),L()},[L,t]);const A=r.useCallback(async u=>{k(!0),f(!1),w(!1);try{await oe(u),H(null),await L(),w(!0),s==null||s()}catch{f(!0)}finally{k(!1)}},[L,s]),$=r.useCallback(async()=>{if(!(!n||t===null||re(i,n.policy))){k(!0),f(!1),w(!1);try{if(yt(i,n.policy)){const u=await ne(t,i);if(u.preview.affectedPlaceCount>0){H({policy:i,preview:u});return}}await oe(i),await L(),w(!0),s==null||s()}catch{f(!0)}finally{k(!1)}}},[n,i,L,s,t]),N=r.useCallback(async()=>{if(t!==null){k(!0),f(!1),w(!1);try{await ht(t),await L(),s==null||s()}catch{f(!0)}finally{k(!1)}}},[L,s,t]),j=n==null?void 0:n.selectedPlace.currentUsage,E=(n==null?void 0:n.policy.mode)==="size"?n.policy.sizeMb*1e6:null,S=E??Math.max((j==null?void 0:j.bytes)??0,1),B=Math.min(100,((j==null?void 0:j.sessionBytes)??0)/S*100),U=Math.min(Math.max(0,100-B),((j==null?void 0:j.contextBytes)??0)/S*100),F=n?!re(i,n.policy):!1,c=u=>u.mode==="off"?d("settings.projectChanges.cleanup.unlimited","Unlimited"):`${u.sizeMb} MB`,T=r.useMemo(()=>{if(!y)return"";const u=y.preview.preview,C=d("settings.projectChanges.cleanup.confirm.message","{places} Places · {sessions} sessions · {bytes} expected to be freed.").replace("{places}",u.affectedPlaceCount.toLocaleString()).replace("{sessions}",u.deleteSessionCount.toLocaleString()).replace("{bytes}",J(u.estimatedFreedBytes));return u.wouldRemainOverLimitPlaceCount===0?C:`${C} ${d("settings.projectChanges.cleanup.confirm.protected","{places} Place may remain over the limit because active data is protected.").replace("{places}",u.wouldRemainOverLimitPlaceCount.toLocaleString())}`},[y,d]);if(t===null)return e.jsx("div",{className:a.projectChangesPanel,children:e.jsx("p",{className:a.projectChangesEmpty,children:d("settings.projectChanges.cleanup.noPlace","Select a Place to manage saved project changes.")})});if(p)return e.jsx("div",{className:a.projectChangesPanel,children:e.jsx("p",{className:a.projectChangesEmpty,children:d("settings.projectChanges.cleanup.loading","Loading storage settings…")})});if(P||!n||!j)return e.jsxs("div",{className:a.projectChangesPanel,children:[e.jsx("p",{className:a.projectChangesError,role:"alert",children:d("settings.projectChanges.cleanup.loadFailed","Could not load storage settings.")}),e.jsx("button",{className:a.projectChangesSecondaryButton,type:"button",onClick:()=>{_(!0),L()},children:d("common.retry","Retry")})]});const W=E===null?d("settings.projectChanges.cleanup.usageUnlimited","{used} used · Unlimited").replace("{used}",J(j.bytes)):d("settings.projectChanges.cleanup.usageLimited","{used} used of {limit}").replace("{used}",J(j.bytes)).replace("{limit}",c(n.policy));return e.jsxs("div",{className:a.projectChangesPanel,children:[e.jsxs("div",{className:a.projectChangesConsoleGrid,"data-testid":"project-storage-console-grid",children:[e.jsxs("section",{className:a.projectChangesUsageColumn,children:[e.jsx("h3",{className:a.projectChangesPanelTitle,children:e.jsx(R,{label:d("settings.projectChanges.cleanup.title","Storage management"),tooltip:d("settings.projectChanges.cleanup.title.tooltip","Set how much Project Change Summary history each Place can keep.")})}),e.jsxs("div",{className:a.projectChangesUsageBlock,children:[e.jsx("div",{className:a.projectChangesUsageSummary,children:W}),e.jsxs("div",{className:a.projectChangesQuotaRail,role:"meter","aria-label":d("settings.projectChanges.cleanup.usageAria","Place storage usage"),"aria-valuemin":0,"aria-valuenow":j.bytes,"aria-valuemax":E??j.bytes,children:[e.jsx("span",{className:a.projectChangesSessionRail,style:{width:`${B}%`}}),e.jsx("span",{className:a.projectChangesContextRail,style:{width:`${U}%`}})]}),e.jsxs("div",{className:a.projectChangesUsageLegend,children:[e.jsxs("span",{children:[d("settings.projectChanges.cleanup.sessions","Sessions")," ",e.jsx("strong",{children:J(j.sessionBytes)})]}),e.jsxs("span",{children:[d("settings.projectChanges.cleanup.contexts","Contexts")," ",e.jsx("strong",{children:J(j.contextBytes)})]})]})]})]}),e.jsxs("section",{className:a.projectChangesPolicyColumn,children:[e.jsx("p",{className:a.projectChangesScope,children:d("settings.projectChanges.cleanup.scope","One setting applies the selected limit separately to every Place.")}),e.jsxs("fieldset",{className:a.projectChangesPolicyFieldset,disabled:v,children:[e.jsx("legend",{className:a.projectChangesPolicyLegend,children:d("settings.projectChanges.cleanup.limit","Limit per Place")}),e.jsxs("div",{className:a.projectChangesPresetGroup,children:[mt.map(u=>{const C=i.mode==="size"&&i.sizeMb===u;return e.jsx("button",{className:`${a.projectChangesPresetButton} ${C?a.projectChangesPresetButtonActive:""}`,type:"button","aria-pressed":C,onClick:()=>g({mode:"size",sizeMb:u}),children:d("settings.projectChanges.cleanup.preset","{sizeMb}MB").replace("{sizeMb}",String(u))},u)}),e.jsx("button",{className:`${a.projectChangesPresetButton} ${i.mode==="off"?a.projectChangesPresetButtonActive:""}`,type:"button","aria-pressed":i.mode==="off",onClick:()=>g({mode:"off"}),children:d("settings.projectChanges.cleanup.unlimited","Unlimited")})]})]}),e.jsxs("div",{className:a.projectChangesActions,children:[e.jsx("button",{className:a.projectChangesSaveButton,type:"button",disabled:!F||v,onClick:()=>void $(),children:d("common.save","Save")}),e.jsx("button",{className:a.projectChangesSecondaryButton,type:"button",disabled:v,onClick:()=>void N(),children:d("settings.projectChanges.cleanup.runNow","Run saved policy")}),D&&e.jsx("span",{className:a.projectChangesSaved,role:"status",children:d("settings.projectChanges.cleanup.saved","Saved")})]})]})]}),n.selectedPlace.dryRun.wouldRemainOverLimit&&e.jsx("p",{className:a.projectChangesWarning,children:d("settings.projectChanges.cleanup.protectedWarning","Active changes are protected, so this Place may stay over the limit.")}),e.jsxs("div",{className:a.projectChangesLastRun,"data-testid":"project-storage-footer",children:[e.jsx("span",{className:a.projectChangesLastRunLabel,children:d("settings.projectChanges.cleanup.lastRun","Last cleanup")}),n.selectedPlace.lastRun?e.jsxs("span",{children:[new Date(n.selectedPlace.lastRun.ranAt).toLocaleString(l)," · ",d("settings.projectChanges.cleanup.lastRunSummary","{sessions} sessions · {bytes} freed").replace("{sessions}",n.selectedPlace.lastRun.deletedSessionCount.toLocaleString()).replace("{bytes}",J(n.selectedPlace.lastRun.freedBytes))]}):e.jsx("span",{children:d("settings.projectChanges.cleanup.neverRun","Not run yet")})]}),x&&e.jsx("p",{className:a.projectChangesError,role:"alert",children:d("settings.projectChanges.cleanup.actionFailed","Could not update storage settings.")}),e.jsx(ce,{open:y!==null,title:d("settings.projectChanges.cleanup.confirm.title","Apply this limit and clean saved changes?"),message:T,cancelLabel:d("common.cancel","Cancel"),confirmLabel:d("settings.projectChanges.cleanup.confirm.apply","Apply and clean"),loading:v,onCancel:()=>!v&&H(null),onConfirm:()=>{y&&A(y.policy)}})]})}const xt={toolsActivity:null,toolStats:null,toolSessions:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null},ft={toolsActivity:null,toolStats:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null};function bt(t){var s;return t?t.pluginConnected?t.activePlaceId:t.lastActivePlaceId??((s=t.places[0])==null?void 0:s.placeId)??null:null}async function G(t){try{return await t}catch{return null}}function ee(t){return t?typeof t.total=="number"?t.total:Array.isArray(t.entries)?t.entries.length:null:null}function te(t,s,l,d){return s===null?t("settings.dataHistory.metric.unavailable","Unavailable"):`${s.toLocaleString()} ${t(l,d)}`}function Q(t,s,l){const d=l===null?t("settings.dataHistory.metric.sizeUnavailable","size unavailable"):Y(l);return`${s} · ${d}`}function Z(t,s){var d;const l=(d=t==null?void 0:t[s])==null?void 0:d.bytes;return typeof l=="number"&&Number.isFinite(l)?l:null}function vt(t,s){return s?[`${s.requestCount.toLocaleString()} ${t("uiStudio.storage.requestCount","change records")}`,`${s.snapshotCount.toLocaleString()} ${t("uiStudio.storage.snapshotCount","screenshots")}`,Y(s.totalBytes)].join(" · "):t("settings.dataHistory.metric.unavailable","Unavailable")}function St({tier:t}){const{t:s}=X(),[l,d]=r.useState(xt),[n,b]=r.useState(ft),[i,g]=r.useState(t==="basic"?ae:null),[p,_]=r.useState(null),[v,k]=r.useState(!0),[P,z]=r.useState(!0),[x,f]=r.useState(null),[D,w]=r.useState(()=>new Set),[y,H]=r.useState(null),[L,A]=r.useState(!1),[$,N]=r.useState(null),j=r.useCallback(async()=>{k(!0);const u=await G(me()),C=bt(u);_(C);const[K,q,h,M,O,ge,V]=await Promise.all([G(I.get("/api/dashboard/history",{limit:"1",offset:"0"})),G(I.get("/api/dashboard/tool-stats")),G(I.get("/sync/history",{limit:"1",offset:"0"})),G(I.get("/api/dashboard/playtest/history")),G(I.get("/api/dashboard/changelog",{limit:"1",offset:"0"})),G(I.get("/api/dashboard/connection-log")),G(I.get("/api/dashboard/storage-summary"))]),he=t==="basic"?ae:C===null?null:await G(pe(C));d({toolsActivity:ee(K),toolStats:(q==null?void 0:q.totalCalls)??null,toolSessions:(q==null?void 0:q.totalSessions)??null,syncLog:ee(h),playtestReports:ee(M),projectChanges:ee(O),connectionLog:ee(ge)}),b({toolsActivity:Z(V,"toolsActivity"),toolStats:Z(V,"toolStats"),syncLog:Z(V,"syncLog"),playtestReports:Z(V,"playtestReports"),projectChanges:Z(V,"projectChanges"),connectionLog:Z(V,"connectionLog")}),g(he),k(!1)},[t]);r.useEffect(()=>{j()},[j]);const E=r.useCallback(u=>{w(C=>{if(C.has(u))return C;const K=new Set(C);return K.add(u),K}),f(C=>C===u?null:u)},[]),S=r.useMemo(()=>[{key:"toolsActivity",title:s("settings.dataHistory.toolsActivity.title","Tool activity"),description:s("settings.dataHistory.toolsActivity.description","Saved tool runs shown on the Tools page."),metric:Q(s,te(s,l.toolsActivity,"settings.dataHistory.metric.records","records"),n.toolsActivity),metricTooltip:s("settings.dataHistory.toolsActivity.metric.tooltip","Number of saved tool runs and the disk space they use."),route:"/tools",clearEndpoint:"/api/dashboard/tools/history/clear"},{key:"toolStats",title:s("settings.dataHistory.toolStats.title","Tool usage statistics"),description:s("settings.dataHistory.toolStats.description","Aggregated tool counts and status totals."),metric:Q(s,l.toolStats===null?s("settings.dataHistory.metric.unavailable","Unavailable"):`${l.toolStats.toLocaleString()} ${s("settings.dataHistory.metric.runs","runs")} · ${(l.toolSessions??0).toLocaleString()} ${s("settings.dataHistory.metric.sessions","sessions")}`,n.toolStats),metricTooltip:s("settings.dataHistory.toolStats.metric.tooltip","Aggregated total runs and session counts."),route:"/tools",clearEndpoint:"/api/dashboard/tools/statistics/clear"},{key:"syncLog",title:s("settings.dataHistory.syncLog.title","Sync log"),description:s("settings.dataHistory.syncLog.description","Saved file sync events for the active place."),metric:Q(s,te(s,l.syncLog,"settings.dataHistory.metric.records","records"),n.syncLog),metricTooltip:s("settings.dataHistory.syncLog.metric.tooltip","Number of saved sync events and the disk space they use."),route:"/sync",clearEndpoint:"/api/dashboard/sync/history/clear"},{key:"playtestReports",title:s("settings.dataHistory.playtest.title","Playtest reports"),description:s("settings.dataHistory.playtest.description","Saved automated playtest reports and logs."),metric:Q(s,te(s,l.playtestReports,"settings.dataHistory.metric.reports","reports"),n.playtestReports),metricTooltip:s("settings.dataHistory.playtestReports.metric.tooltip","Number of saved playtest reports and the disk space they use."),route:"/playtest",clearEndpoint:"/api/dashboard/playtest/history/clear"},{key:"projectChanges",title:s("settings.dataHistory.projectChanges.title","Project change summary"),description:s("settings.dataHistory.projectChanges.description","Saved summaries of project changes."),metric:Q(s,te(s,l.projectChanges,"settings.dataHistory.metric.records","records"),n.projectChanges),metricTooltip:s("settings.dataHistory.projectChanges.metric.tooltip","Number of saved project change summaries and the disk space they use."),route:"/changelog",clearEndpoint:"/api/dashboard/changelog/clear"},{key:"connectionLog",title:s("settings.dataHistory.connectionLog.title","Connection log"),description:s("settings.dataHistory.connectionLog.description","Saved MCP and Studio connection events."),metric:Q(s,te(s,l.connectionLog,"settings.dataHistory.metric.records","records"),n.connectionLog),metricTooltip:s("settings.dataHistory.connectionLog.metric.tooltip","Number of saved connection events and the disk space they use."),route:"/connection",clearEndpoint:"/api/dashboard/connection-log/clear"}],[l,n,s]),B=async()=>{if(y){A(!0),N(null);try{if(y.kind==="uiStudio"){if(t!=="pro"||p===null)throw new Error("UI Studio place is unavailable");await se(p,{all:!0,alsoSnapshots:!0}),N(s("settings.dataHistory.uiStudio.clear.success","UI Studio saved data cleared."))}else{const u=y.row.key==="projectChanges";if(u&&p===null)throw new Error("Project changes place is unavailable");let C=y.row.clearEndpoint;u&&p!==null&&(C=`${C}?placeId=${encodeURIComponent(p)}`),await I.post(C),N(u?s("settings.dataHistory.projectChanges.clear.success","Project change summaries cleared."):s("settings.dataHistory.clear.success","Saved data cleared."))}H(null),await j()}catch{N(y.kind==="uiStudio"?s("settings.dataHistory.uiStudio.clear.failed","Failed to clear UI Studio saved data."):s("settings.dataHistory.clear.failed","Failed to clear saved data."))}finally{A(!1)}}},U=t==="pro"?p:0,F=t==="pro"&&p!==null,c=(y==null?void 0:y.kind)==="uiStudio",T=(y==null?void 0:y.kind)==="row"&&y.row.key==="projectChanges",W=s("settings.dataHistory.title","Data & History");return e.jsxs(e.Fragment,{children:[e.jsxs("section",{id:"data-history",className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(R,{label:s("settings.dataHistory.title","Data & History"),tooltip:s("settings.dataHistory.title.tooltip","Manage saved dashboard data in one place.")}),e.jsxs("div",{className:a.cardHeaderActions,children:[e.jsx(m,{text:s("settings.dataHistory.scope.tooltip","Clear actions apply to the current project and active place where applicable."),children:e.jsx("span",{className:a.headerBadge,children:v?s("common.loading","Loading"):s("settings.dataHistory.scope","Current project")})}),e.jsx(m,{text:s("settings.dataHistory.toggle.tooltip","Collapse or expand this section."),children:e.jsx("button",{className:a.collapseButton,type:"button","aria-expanded":P,"aria-controls":"settings-data-history-body","aria-label":P?s("settings.dataHistory.collapse","Collapse {title}").replace("{title}",W):s("settings.dataHistory.expand","Expand {title}").replace("{title}",W),onClick:()=>z(u=>!u),children:P?"▾":"▸"})})]})]}),P&&e.jsxs("div",{id:"settings-data-history-body",children:[e.jsx("p",{className:a.dataHistoryIntro,children:s("settings.dataHistory.intro","Review saved dashboard data, open the related page, or clear stored records from one place.")}),e.jsxs("div",{className:a.dataHistoryList,children:[S.map(u=>e.jsxs(r.Fragment,{children:[e.jsxs("div",{className:`${a.dataHistoryRow} ${u.key==="projectChanges"&&x==="projectChanges"?a.dataHistoryRowExpanded:""}`,children:[e.jsxs("div",{className:a.dataHistoryMain,children:[e.jsx("div",{className:a.dataHistoryTitle,children:u.title}),e.jsx("div",{className:a.dataHistoryDescription,children:u.description})]}),e.jsx(m,{text:u.metricTooltip,children:e.jsx("div",{className:a.dataHistoryMetric,children:u.metric})}),e.jsxs("div",{className:a.dataHistoryActions,children:[e.jsx(m,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:a.linkButton,href:`#${u.route}`,children:s("settings.dataHistory.open","Open")})}),u.key==="projectChanges"&&e.jsx(m,{text:s("settings.dataHistory.manageStorage.tooltip","Show or hide storage policy and cleanup controls."),children:e.jsxs("button",{className:a.manageStorageButton,type:"button","aria-expanded":x==="projectChanges","aria-controls":"settings-project-changes-storage","aria-label":s("settings.dataHistory.manageStorage.projectChanges.aria","Manage Project change summary storage"),onClick:()=>E("projectChanges"),children:[s("settings.dataHistory.manageStorage","Manage storage"),e.jsx("span",{"aria-hidden":"true",children:x==="projectChanges"?"▴":"▾"})]})}),e.jsx(m,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:a.dangerButton,type:"button",disabled:u.key==="projectChanges"&&p===null,onClick:()=>H({kind:"row",row:u}),children:u.key==="projectChanges"?s("settings.dataHistory.clearAll","Clear all"):s("common.clear","Clear")})})]})]}),u.key==="projectChanges"&&D.has("projectChanges")&&e.jsx("div",{id:"settings-project-changes-storage",className:`${a.dataHistoryDetail} ${a.projectChangesDataHistoryDetail}`,hidden:x!=="projectChanges",children:e.jsx(jt,{placeId:p,onChanged:j})})]},u.key)),e.jsxs("div",{className:`${a.dataHistoryRow} ${x==="uiStudio"?a.dataHistoryRowExpanded:""}`,children:[e.jsxs("div",{className:a.dataHistoryMain,children:[e.jsx("div",{className:a.dataHistoryTitle,children:s("settings.dataHistory.uiStudio.title","UI Studio history and screenshots")}),e.jsx("div",{className:a.dataHistoryDescription,children:s("settings.dataHistory.uiStudio.description","Saved UI Studio change records, screenshots, and cleanup policy.")})]}),e.jsx(m,{text:s("settings.dataHistory.uiStudio.metric.tooltip","UI Studio change record and capture counts, plus total disk usage."),children:e.jsx("div",{className:a.dataHistoryMetric,children:vt(s,i)})}),e.jsxs("div",{className:a.dataHistoryActions,children:[e.jsx(m,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:a.linkButton,href:"#/ui-studio?tab=history",children:s("settings.dataHistory.open","Open")})}),e.jsx(m,{text:s("settings.dataHistory.manageStorage.tooltip","Show or hide storage policy and cleanup controls."),children:e.jsxs("button",{className:a.manageStorageButton,type:"button","aria-expanded":x==="uiStudio","aria-controls":"settings-ui-studio-storage","aria-label":s("settings.dataHistory.manageStorage.uiStudio.aria","Manage UI Studio history and screenshots storage"),onClick:()=>E("uiStudio"),children:[s("settings.dataHistory.manageStorage","Manage storage"),e.jsx("span",{"aria-hidden":"true",children:x==="uiStudio"?"▴":"▾"})]})}),e.jsx(m,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:a.dangerButton,type:"button",disabled:!F,onClick:()=>H({kind:"uiStudio"}),children:s("settings.dataHistory.clearAll","Clear all")})})]})]}),D.has("uiStudio")&&e.jsx("div",{id:"settings-ui-studio-storage",className:`${a.dataHistoryDetail} ${a.uiStudioDataHistoryDetail}`,hidden:x!=="uiStudio",children:e.jsx(gt,{placeId:U,tier:t,onChanged:j,embedded:!0,...t==="basic"?{sampleUsage:ae,sampleRetention:_e}:{}})})]}),$&&e.jsx("p",{className:a.inlineStatus,children:$})]})]}),e.jsx(ce,{open:y!==null,title:c?s("settings.dataHistory.uiStudio.clear.title","Clear UI Studio saved data?"):T?s("settings.dataHistory.projectChanges.clear.title","Clear project change summaries?"):s("settings.dataHistory.clear.title","Clear saved data?"),message:c?s("settings.dataHistory.uiStudio.clear.message","This deletes saved UI Studio change records and screenshots only. Roblox Studio instances and project objects are not changed."):T?s("settings.dataHistory.projectChanges.clear.message","This deletes completed sessions and ended context history for the selected Place. Active work and Roblox Studio project data stay intact."):s("settings.dataHistory.clear.message","This deletes saved dashboard records only. Roblox Studio instances and project objects are not changed."),cancelLabel:s("common.cancel","Cancel"),confirmLabel:T||c?s("settings.dataHistory.clearAll","Clear all"):s("common.clear","Clear"),loading:L,onCancel:()=>!L&&H(null),onConfirm:()=>void B()})]})}const Ct=r.forwardRef(function({autoOpen:s,settingsFilePath:l,saving:d,targeted:n,updateDashboardPreferences:b},i){const{t:g}=X(),[p,_]=r.useState("idle"),v="settings-dashboard-auto-open-label",k=d||p==="saving",P=async x=>{_("saving");try{await b({autoOpen:x}),_("saved")}catch{_("error")}},z=p==="saving"?g("settings.dashboard.autoOpen.saving","Saving…"):p==="saved"?g("settings.dashboard.autoOpen.saved","Saved for the next server start."):p==="error"?g("settings.dashboard.autoOpen.error","Could not save. The previous setting was restored."):" ";return e.jsxs("div",{id:"settings-dashboard",ref:i,tabIndex:-1,"data-testid":"settings-dashboard-card",className:[a.card,a.dashboardCard,n?a.dashboardCardTarget:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(R,{label:g("settings.dashboard.title","Dashboard"),tooltip:g("settings.dashboard.title.tooltip","Choose how WEPPY Dashboard behaves when the MCP Server starts.")}),e.jsx(m,{text:g("settings.dashboard.autoOpen.nextStart","Applies the next time the MCP Server starts."),children:e.jsx("span",{className:a.headerBadge,children:g("settings.dashboard.nextStartBadge","Next Start")})})]}),e.jsxs("div",{className:a.dashboardSettingRow,children:[e.jsxs("div",{className:a.dashboardSettingCopy,children:[e.jsx("span",{id:v,className:a.dashboardSettingLabel,children:g("settings.dashboard.autoOpen.label","Open Dashboard when WEPPY starts")}),e.jsx("span",{className:a.dashboardSettingDescription,children:g("settings.dashboard.autoOpen.description","Automatically opens this Dashboard after the MCP Server starts.")}),e.jsx("span",{className:a.dashboardSettingMeta,children:g("settings.dashboard.autoOpen.nextStart","Applies the next time the MCP Server starts.")})]}),e.jsxs("label",{className:`${a.toggleSwitch} ${a.dashboardToggleTarget}`,children:[e.jsx("input",{className:a.toggleInput,type:"checkbox",role:"switch","aria-labelledby":v,checked:s,disabled:k,onChange:x=>{P(x.target.checked)}}),e.jsx("span",{className:a.toggleTrack,"aria-hidden":"true",children:e.jsx("span",{className:a.toggleThumb})})]})]}),e.jsxs("dl",{className:a.dashboardDetails,children:[e.jsxs("div",{className:a.dashboardDetailRow,children:[e.jsx("dt",{children:g("settings.dashboard.settingsFile.label","Settings file")}),e.jsx("dd",{children:e.jsx("code",{className:a.dashboardSettingsFilePath,children:l})})]}),e.jsxs("div",{className:a.dashboardDetailRow,children:[e.jsx("dt",{children:g("settings.dashboard.agentExample.label","Ask your Agent")}),e.jsx("dd",{className:a.dashboardAgentPrompt,children:g("settings.dashboard.agentExample.prompt","“Turn off Dashboard auto-open.”")})]})]}),e.jsx("p",{className:`${a.dashboardSaveFeedback} ${p==="error"?a.dashboardSaveFeedbackError:""}`,"aria-live":"polite",children:z})]})}),Nt={en:"English",ko:"한국어",es:"Español","pt-br":"Português (BR)",ja:"日本語",id:"Bahasa Indonesia",de:"Deutsch","fr-fr":"Français"};function _t(t){return t==="active"?a.statusActive:t==="grace"?a.statusGrace:t==="invalid"||t==="revoked"?a.statusError:a.statusInactive}function kt(t){return t?t.refreshBlockedReason==="missing_session_token"?!0:t.status==="active"||t.status==="grace"||t.status==="invalid"||t.status==="revoked"||t.status==="unknown":!1}function Pt(t,s){return t.refreshBlockedReason==="missing_session_token"?{label:s("settings.license.status.activationRequired","Activation Required"),tooltip:s("settings.license.status.activationRequired.tooltip","Manual license activation is required before WEPPY Dashboard can refresh this status."),detail:s("settings.license.detail.missingSessionToken","Refresh is blocked because the current session token is missing."),detailTone:a.licenseNoticeWarning}:t.statusDetail==="active_cancel_pending"?{label:s("settings.license.active","Active"),tooltip:s("settings.license.status.activeCancelPending.tooltip","Cancellation is pending, but Pro access remains active until the current billing period ends."),detail:s("settings.license.detail.cancelPending","Cancellation is scheduled. Pro access remains active until the current billing period ends."),detailTone:a.licenseNoticeInfo}:t.statusDetail==="grace_provider_unavailable"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.grace.tooltip","Provider verification is temporarily unavailable, but Pro access remains active during the grace period."),detail:s("settings.license.detail.graceProviderUnavailable","Provider unavailable. Pro access remains active during grace mode."),detailTone:a.licenseNoticeInfo}:t.statusDetail==="grace_expired"||t.statusDetail==="grace_payment_failed"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.graceBilling.tooltip","Pro access is still available during a billing-related grace period."),detail:s("settings.license.detail.graceBilling","Pro access remains available during a billing grace period."),detailTone:a.licenseNoticeInfo}:{label:s(`settings.license.${t.status}`,t.status),tooltip:s(`settings.license.${t.status}.tooltip`,"Current license activation state."),detail:t.refreshRequired?s("settings.license.detail.refreshRecommended","License verification should be refreshed soon."):null,detailTone:a.licenseNoticeMuted}}function zt(){const{t,selectedLocale:s,setLocale:l}=X(),{trackEvent:d}=le(),{search:n}=ye(),{settings:b,license:i,licenseControlsDisabled:g,licenseSubmitting:p,licenseMessage:_,activateLicense:v,refreshLicense:k,resetLicense:P,saving:z,updateDashboardPreferences:x,loading:f}=Se(),[D,w]=r.useState(""),y=i?Pt(i,t):null,H=kt(i),L=H&&(i==null?void 0:i.refreshBlockedReason)!=="missing_session_token",A=H,$=H?i==null?void 0:i.maskedKey:void 0,N=i!=null&&i.provider&&i.provider!=="auto"?i.provider:void 0,j=(i==null?void 0:i.tier)==="pro"?"pro":"basic",E=r.useRef(null),S=r.useRef(null),B=r.useRef(null),U=r.useMemo(()=>new URLSearchParams(n).get("section")==="license",[n]),F=r.useMemo(()=>new URLSearchParams(n).get("section")==="dashboard",[n]);return r.useEffect(()=>{var T;if(!U||f)return;const c=E.current;if((T=c==null?void 0:c.scrollIntoView)==null||T.call(c,{block:"start",behavior:"smooth"}),B.current&&!B.current.disabled){B.current.focus();return}c==null||c.focus()},[f,g,p,U]),r.useEffect(()=>{var T;if(!F||f)return;const c=S.current;(T=c==null?void 0:c.scrollIntoView)==null||T.call(c,{block:"start",behavior:"smooth"}),c==null||c.focus()},[f,F]),f?e.jsx("div",{className:a.page,children:e.jsx("div",{className:a.loading,children:t("common.loading")})}):e.jsxs("div",{className:a.page,children:[e.jsx(ve,{title:t("page.settings.title","Settings"),description:t("page.settings.description","Manage license, saved data, server environment, and language."),helpTopicId:"settings",helpState:{tier:j}}),e.jsxs("div",{id:"settings-license",ref:E,tabIndex:-1,"data-testid":"settings-license-card",className:[a.card,U?a.licenseCardTarget:"",(i==null?void 0:i.tier)==="pro"?a.licenseCardPro:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(R,{label:t("settings.license.title","License"),tooltip:t("settings.license.title.tooltip","Current license status and subscription tier.")}),e.jsx(m,{text:g?t("settings.license.disconnected.tooltip","Reconnect to the MCP server to manage license actions from WEPPY Dashboard."):t("settings.license.live.tooltip","License actions are sent to the MCP server immediately."),children:e.jsx("span",{className:`${a.headerBadge} ${g?"":a.headerBadgeLive}`,children:g?t("settings.license.disconnected","Disconnected"):t("settings.general.liveApply","Live Apply")})})]}),e.jsxs(e.Fragment,{children:[i?e.jsxs(e.Fragment,{children:[(()=>{const c=y;return e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:a.licenseGrid,children:[e.jsx("dt",{children:e.jsx(R,{label:t("settings.license.status","Status"),tooltip:t("settings.license.status.tooltip","Current license activation state.")})}),e.jsxs("dd",{children:[e.jsx("span",{className:`${a.statusDot} ${_t(i.status)}`}),e.jsx(m,{text:(c==null?void 0:c.tooltip)??t(`settings.license.${i.status}.tooltip`,"Current license activation state."),children:(c==null?void 0:c.label)??t(`settings.license.${i.status}`,i.status)})]}),e.jsx("dt",{children:e.jsx(R,{label:t("settings.license.tier","Tier"),tooltip:t("settings.license.tier.tooltip","Current subscription tier for available WEPPY Dashboard features.")})}),e.jsx("dd",{className:i.tier==="pro"?a.proBadge:"",children:e.jsx(m,{text:t(`tier.${i.tier}.tooltip`,"Available feature set for the connected license."),children:i.tier==="pro"?t("tier.pro","Pro"):t("tier.basic","Basic")})}),$&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(R,{label:t("settings.license.key","Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("dd",{children:e.jsx(m,{text:t("settings.license.keyValue.tooltip","Masked license key currently loaded by the server."),children:$})})]}),N&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(R,{label:t("settings.license.provider","Provider"),tooltip:t("settings.license.provider.tooltip","License provider used to validate this key.")})}),e.jsx("dd",{children:e.jsx(m,{text:t("settings.license.providerValue.tooltip","License provider used to validate this key."),children:N})})]})]}),(c==null?void 0:c.detail)&&e.jsx("p",{className:`${a.licenseNotice} ${c.detailTone}`,children:i.refreshBlockedReason==="missing_session_token"?t("settings.license.detail.manualActivation","Manual activation required to restore Pro access."):c.detail}),i.refreshBlockedReason==="missing_session_token"&&e.jsx("p",{className:`${a.licenseNotice} ${a.licenseNoticeMuted}`,children:c==null?void 0:c.detail})]})})(),i.tier==="basic"&&e.jsx(m,{text:t("tier.upgrade.tooltip","View Pro features and purchase options."),children:e.jsx("a",{className:a.upgradeLink,href:je.settingsLicense,target:"_blank",rel:"noopener noreferrer",onClick:()=>d("dashboard_click_event",{click_target:"upgrade_cta",placement:"settings_license",page:"settings"}),children:t("tier.upgrade","View Pro")})})]}):e.jsx("div",{className:a.loading,children:t("settings.license.unavailable")}),e.jsxs("div",{className:a.licenseControls,children:[e.jsxs("div",{className:a.licenseControlRow,children:[e.jsx(m,{text:t("settings.license.refresh.tooltip","Re-fetch the current state from the license server. Useful when a billing change hasn't appeared yet."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:g||p||!L,onClick:()=>{k()},children:p?t("common.loading"):t("settings.license.refresh","Refresh License")})}),e.jsx(m,{text:t("settings.license.reset.tooltip","Remove the currently registered license key. Use this before activating with a different key."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:g||p||!A,onClick:()=>{P()},children:p?t("common.loading"):t("settings.license.reset","Reset License")})})]}),e.jsxs("div",{className:a.licenseControlRow,children:[e.jsxs("label",{className:`${a.licenseField} ${a.licenseFieldGrow}`,children:[e.jsx("span",{className:a.controlLabel,children:e.jsx(R,{label:t("settings.license.keyInput","License Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("input",{ref:B,"aria-label":t("settings.license.keyInput","License Key"),className:a.textInput,type:"text",value:D,disabled:g||p,onChange:c=>w(c.target.value)})]}),e.jsx(m,{text:t("settings.license.activate.tooltip","Activate Pro features with the entered license key."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:g||p,onClick:()=>{(async()=>await v(D)&&w(""))()},children:p?t("common.loading"):t("settings.license.activate","Activate License")})})]}),_&&e.jsx("p",{className:a.licenseMessage,children:_})]})]})]}),e.jsx(St,{tier:j}),b&&e.jsx(Ct,{ref:S,autoOpen:b.dashboard.autoOpen,settingsFilePath:b.dashboard.settingsFilePath,saving:z,targeted:F,updateDashboardPreferences:x}),e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(R,{label:t("settings.cold.title","Server Environment"),tooltip:t("settings.cold.title.tooltip","Read-only server environment values loaded at startup.")}),e.jsx(m,{text:t("settings.readOnly.tooltip","This section shows values that cannot be edited from WEPPY Dashboard."),children:e.jsx("span",{className:a.headerBadge,children:t("settings.readOnly","Read-only")})})]}),b?e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:a.coldGrid,children:[e.jsx("dt",{children:e.jsx(R,{label:"HTTP_PORT",tooltip:t("settings.cold.httpPort.tooltip","Port number used by the MCP WEPPY Dashboard HTTP server.")})}),e.jsx("dd",{children:b.cold.HTTP_PORT}),e.jsx("dt",{children:e.jsx(R,{label:"HTTP_HOST",tooltip:t("settings.cold.httpHost.tooltip","Host interface that the MCP WEPPY Dashboard HTTP server binds to.")})}),e.jsx("dd",{children:b.cold.HTTP_HOST})]}),e.jsx("p",{className:a.coldHint,children:t("settings.cold.hint","Set via environment variables to change these values.")})]}):e.jsx("div",{className:a.loading,children:t("settings.unavailable")})]}),e.jsxs("div",{className:a.card,children:[e.jsx("div",{className:a.cardHeader,children:e.jsx(R,{label:t("settings.language.title","Language"),tooltip:t("settings.language.title.tooltip","Choose how the WEPPY Dashboard interface text is localized.")})}),e.jsxs("div",{className:a.langRow,children:[e.jsx("label",{children:e.jsx(R,{label:t("settings.language.dashboard","WEPPY Dashboard Language"),tooltip:t("settings.language.dashboard.tooltip","Overrides the WEPPY Dashboard language or follows the system language when set to Auto.")})}),e.jsx(m,{text:t("settings.language.auto.tooltip","Follow the operating system's language. Falls back to English when not supported."),children:e.jsxs("select",{className:a.select,value:s,onChange:c=>l(c.target.value),children:[e.jsx("option",{value:xe,children:t("settings.language.auto","Auto")}),fe.map(c=>e.jsx("option",{value:c,children:Nt[c]??c},c))]})})]})]})]})}export{zt as Component};
@@ -0,0 +1 @@
1
+ import{r as l,b as z,h as ne,D as fe,u as ie,j as e,a as _e,d as Se,e as ve,k as xe,T as je}from"./index-B1SnAt0o.js";import{B as H,a as J,P as we}from"./PageHeader-QiUV3oJs.js";import{I as Z}from"./InfoLabel-DfinjjFO.js";import{T as O}from"./TooltipText-x86NSn8t.js";import{C as pe}from"./ConfirmModal-D2yw01tT.js";import{T as Ne}from"./TierPromoPanel-DWTUB0jD.js";import"./ConfirmModal.module-DJksQHBd.js";const be=5e3,W={report:null,loading:!1,applying:!1,error:null};function Ie(t,a){if(a===null)return null;const _=t.filter(i=>i.placeId===a);return _.length===1?_[0]:a===0?null:_.find(i=>i.folderStatus==="canonical")??null}function ye(t,a){if(a===null||!Number.isSafeInteger(a)||a<0)return!1;const _=t.filter(i=>i.placeId===a);return a===0?_.length===1:_.length===0||_.some(i=>i.folderStatus==="canonical")}function oe(t,a){return a.placeId<=0||!Number.isSafeInteger(a.placeId)?!1:ye(t,a.placeId)&&(a.folderStatus==="canonical"||t.filter(_=>_.placeId===a.placeId).length===1)}function Re(){const[t,a]=l.useState([]),[_,i]=l.useState(null),[d,n]=l.useState(null),[N,R]=l.useState(!0),[D,j]=l.useState(null),[b,g]=l.useState([]),[C,u]=l.useState(!1),[A,E]=l.useState(null),[p,y]=l.useState(W),c=l.useRef(0),h=l.useRef(0),L=l.useRef(null),G=l.useRef(!1),B=l.useRef(null),U=l.useRef(0),q=l.useRef(null),M=l.useRef(new Set),$=l.useCallback(async()=>{const o=++c.current;try{const[f,m]=await Promise.all([z.get("/api/dashboard/sync/targets"),z.get("/api/dashboard/place-summary")]);if(o!==c.current)return;a(f.targets??[]),i(m),j(null)}catch(f){if(o!==c.current)return;a([]),i(null),j(f instanceof Error?f.message:String(f))}finally{o===c.current&&R(!1)}},[]),k=l.useMemo(()=>(_==null?void 0:_.places)??[],[_]),Q=l.useMemo(()=>new Set(t.map(o=>o.placeId).filter(o=>typeof o=="number")),[t]),K=l.useMemo(()=>k.filter(o=>o.placeId===0||!Q.has(o.placeId)),[Q,k]);l.useEffect(()=>{N||D||n(o=>{if((o==null?void 0:o.kind)==="target"&&t.some(m=>m.clientId===o.clientId)||(o==null?void 0:o.kind)==="stored"&&K.some(m=>m.placeId===o.placeId&&m.placeDirName===o.placeDirName&&oe(k,m)))return o;if(t[0])return{kind:"target",clientId:t[0].clientId};const f=K.find(m=>oe(k,m));return f?{kind:"stored",placeId:f.placeId,placeDirName:f.placeDirName}:null})},[N,k,D,K,t]);const Y=(d==null?void 0:d.kind)==="target"?t.find(o=>o.clientId===d.clientId)??null:null,v=(Y==null?void 0:Y.placeId)??((d==null?void 0:d.kind)==="stored"?d.placeId:null),X=(d==null?void 0:d.kind)==="stored"?K.find(o=>o.placeId===d.placeId&&o.placeDirName===d.placeDirName)??null:Ie(k,v),w=(d==null?void 0:d.kind)==="stored"?X!==null&&oe(k,X):ye(k,v),V=(d==null?void 0:d.kind)==="target"?`target:${d.clientId}:${v??"none"}`:(d==null?void 0:d.kind)==="stored"?`stored:${d.placeDirName}`:null;L.current=v,G.current=w,B.current=V;const r=p.applying||V!==null&&M.current.has(V),x=l.useCallback(async(o,f=!1)=>{var F,te;if(o===null){y(W);return}const m=B.current;if(m!==null&&M.current.has(m)||((F=q.current)==null?void 0:F.key)===m)return;const S=++U.current;q.current={key:m,id:S},y(T=>{var se;return f&&((se=T.report)==null?void 0:se.status)==="not_required"?T:{...T,loading:!0,error:null,progress:null}});const P=()=>S===U.current&&m===B.current&&!(m!==null&&M.current.has(m));try{const T=await z.get("/api/sync/migration",{placeId:String(o)});if(!P())return;y({...W,report:T,error:T.status==="blocked"?"migration_blocked":null})}catch(T){if(!P())return;T instanceof ne&&(T.status===404||T.status===503)?y(W):y(se=>({...se,loading:!1,progress:null,error:T instanceof ne&&T.error==="migration_in_progress"?"migration_in_progress":"unknown"}))}finally{((te=q.current)==null?void 0:te.id)===S&&(q.current=null)}},[]),I=l.useCallback(async(o,f,m=!1)=>{const S=++h.current;if(m||(g([]),E(null)),o===null||!f){u(!1),y(W);return}m||u(!0);const P=z.get("/api/dashboard/sync/history",{placeId:String(o),limit:"30"}).then(F=>{S===h.current&&(g(F.entries??[]),E(null))}).catch(F=>{S===h.current&&E(F instanceof Error?F.message:String(F))}).finally(()=>{S===h.current&&u(!1)});await Promise.all([P,x(o,m)])},[x]);l.useEffect(()=>(U.current+=1,q.current=null,y(W),I(v,w),()=>{h.current+=1,U.current+=1}),[I,v,w,(d==null?void 0:d.kind)==="target"?d.clientId:d==null?void 0:d.placeDirName]);const ee=l.useCallback(()=>{$(),I(v,w)},[I,$,v,w]),ue=l.useCallback(async()=>{w&&await x(v)},[x,v,w]),ge=l.useCallback(async()=>{var m;const o=p.report;if(!o||o.status!=="ready"||p.loading||p.applying||!w||o.placeId!==v)return;const f=B.current;if(!(f===null||M.current.has(f))&&((m=q.current)==null?void 0:m.key)!==f){M.current.add(f),U.current+=1,y(S=>({...S,loading:!1,applying:!0,error:null,progress:null}));try{const S=await z.post("/api/sync/migration",{placeId:o.placeId,fromVersion:2,previewFingerprint:o.previewFingerprint,apply:!0});if(M.current.delete(f),B.current!==f||L.current!==o.placeId)return;y({...W,report:S}),$()}catch(S){if(M.current.delete(f),B.current!==f||L.current!==o.placeId)return;if(S instanceof ne&&S.status===409&&(S.error==="preview_stale"||S.error==="migration_blocked")){if(await x(o.placeId),B.current!==f||L.current!==o.placeId)return;y(P=>({...P,applying:!1,error:S.error}))}else y(P=>({...P,applying:!1,progress:null,error:S instanceof ne&&S.error==="migration_in_progress"?"migration_in_progress":"unknown"}))}}},[x,$,p,v,w]);l.useEffect(()=>{if(!p.loading&&!r||v===null||!w)return;let o=!1,f;const m=V,S=async()=>{var P;try{const F=await z.get("/api/sync/migration/progress",{placeId:String(v)});!o&&B.current===m&&((P=F.progress)==null?void 0:P.placeId)===v&&y(te=>({...te,progress:F.progress}))}catch{}finally{o||(f=setTimeout(()=>void S(),1e3))}};return S(),()=>{o=!0,f&&clearTimeout(f)}},[p.loading,r,v,V,w]);const he=l.useCallback(async o=>{if((await z.post(`/api/dashboard/sync/history/clear?placeId=${encodeURIComponent(String(o))}`)).placeId!==o)throw new Error("Cleared Place differs from the confirmed Place.");L.current===o&&G.current&&I(o,!0)},[I]);l.useEffect(()=>{$();const o=()=>{$(),L.current!==null&&G.current&&I(L.current,!0,!0)},f=setInterval(o,be),m=new fe;m.connect();const S=m.on("sync",o),P=m.on("connection",o);return()=>{clearInterval(f),S(),P(),m.disconnect(),c.current+=1}},[I,$]);const me=p.report&&p.report.placeId!==v?W:{...p,applying:r};return{targets:t,places:k,selection:d,selectedTarget:Y,selectedPlace:X,selectedPlaceId:v,storageSafe:w,history:b,historyLoading:C,historyError:A,loading:N,snapshotError:D,migration:me,selectTarget:o=>n({kind:"target",clientId:o}),selectStored:o=>n({kind:"stored",placeId:o.placeId,placeDirName:o.placeDirName}),refresh:ee,refreshMigration:ue,applyMigration:ge,clearHistory:he}}const ke="_page_1hoev_2",Pe="_detailsStack_1hoev_9",De="_refreshButton_1hoev_15",Ce="_targetRow_1hoev_29",Ee="_storedRow_1hoev_30",Le="_storedDisclosure_1hoev_31",Te="_targetList_1hoev_33",Ae="_storedList_1hoev_33",Be="_targetRowSelected_1hoev_53",Me="_targetIdentity_1hoev_54",Fe="_targetStudio_1hoev_54",Oe="_targetState_1hoev_54",$e="_stateNote_1hoev_57",He="_selectedScope_1hoev_94",Ue="_sharedNote_1hoev_109",qe="_emptyMessage_1hoev_109",Ve="_errorMessage_1hoev_110",We="_card_1hoev_113",Ge="_cardHeader_1hoev_120",Ke="_clearButton_1hoev_132",Ye="_statusRow_1hoev_158",ze="_metaItem_1hoev_165",Xe="_statusGrid_1hoev_171",Ze="_forwardStatusReason_1hoev_191",Je="_migrationPanel_1hoev_199",Qe="_migrationHeader_1hoev_206",et="_migrationTitle_1hoev_213",tt="_migrationDescription_1hoev_222",st="_migrationLedger_1hoev_230",nt="_migrationLedgerItem_1hoev_237",ot="_migrationLedgerBlocked_1hoev_262",at="_migrationSection_1hoev_266",it="_migrationList_1hoev_280",rt="_migrationRow_1hoev_292",ct="_migrationOperation_1hoev_305",lt="_migrationRowBody_1hoev_310",dt="_migrationNotice_1hoev_331",pt="_migrationActions_1hoev_340",yt="_migrationButton_1hoev_346",ut="_migrationError_1hoev_353",gt="_migrationDisclosure_1hoev_354",ht="_migrationPagination_1hoev_356",mt="_migrationProgressHeading_1hoev_356",ft="_migrationProgressMeta_1hoev_356",_t="_migrationProgress_1hoev_356",St="_policySummary_1hoev_403",vt="_policySummaryItem_1hoev_414",xt="_policyPrimaryValue_1hoev_439",jt="_policyReviewNotice_1hoev_445",wt="_policyApplySection_1hoev_456",Nt="_policyApplyHeader_1hoev_460",bt="_policyApplyTitle_1hoev_464",It="_policyApplyDescription_1hoev_472",Rt="_policyInfoLabel_1hoev_480",kt="_policySafetyRow_1hoev_491",Pt="_policySafetyLabel_1hoev_503",Dt="_policySafetyBadge_1hoev_509",Ct="_policyDisclosure_1hoev_513",Et="_policyDisclosureIcon_1hoev_545",Lt="_policyDisclosureIconOpen_1hoev_552",Tt="_policyScopeList_1hoev_556",At="_policyScopeRow_1hoev_563",Bt="_policyScopeName_1hoev_577",Mt="_policyDirectionRail_1hoev_589",Ft="_policyDirectionEndpoint_1hoev_605",Ot="_policyDirectionEndpointStudio_1hoev_612",$t="_policyDirectionArrow_1hoev_616",Ht="_forwardBadge_1hoev_659",Ut="_logContainer_1hoev_674",qt="_logEntry_1hoev_681",Vt="_logTime_1hoev_693",Wt="_logType_1hoev_699",Gt="_logTypeWrite_1hoev_708",Kt="_logTypeUpdate_1hoev_712",Yt="_logTypeDelete_1hoev_716",zt="_logTypeIdle_1hoev_720",Xt="_logPath_1hoev_724",Zt="_logEmpty_1hoev_731",s={page:ke,detailsStack:Pe,refreshButton:De,targetRow:Ce,storedRow:Ee,storedDisclosure:Le,targetList:Te,storedList:Ae,targetRowSelected:Be,targetIdentity:Me,targetStudio:Fe,targetState:Oe,stateNote:$e,selectedScope:He,sharedNote:Ue,emptyMessage:qe,errorMessage:Ve,card:We,cardHeader:Ge,clearButton:Ke,statusRow:Ye,metaItem:ze,statusGrid:Xe,forwardStatusReason:Ze,migrationPanel:Je,migrationHeader:Qe,migrationTitle:et,migrationDescription:tt,migrationLedger:st,migrationLedgerItem:nt,migrationLedgerBlocked:ot,migrationSection:at,migrationList:it,migrationRow:rt,migrationOperation:ct,migrationRowBody:lt,migrationNotice:dt,migrationActions:pt,migrationButton:yt,migrationError:ut,migrationDisclosure:gt,migrationPagination:ht,migrationProgressHeading:mt,migrationProgressMeta:ft,migrationProgress:_t,policySummary:St,policySummaryItem:vt,policyPrimaryValue:xt,policyReviewNotice:jt,policyApplySection:wt,policyApplyHeader:Nt,policyApplyTitle:bt,policyApplyDescription:It,policyInfoLabel:Rt,policySafetyRow:kt,policySafetyLabel:Pt,policySafetyBadge:Dt,policyDisclosure:Ct,policyDisclosureIcon:Et,policyDisclosureIconOpen:Lt,policyScopeList:Tt,policyScopeRow:At,policyScopeName:Bt,policyDirectionRail:Mt,policyDirectionEndpoint:Ft,policyDirectionEndpointStudio:Ot,policyDirectionArrow:$t,forwardBadge:Ht,logContainer:Ut,logEntry:qt,logTime:Vt,logType:Wt,logTypeWrite:Gt,logTypeUpdate:Kt,logTypeDelete:Yt,logTypeIdle:zt,logPath:Xt,logEmpty:Zt},ae=50;function Jt(t){return t==="add"?"success":t==="delete"?"danger":"accent"}function re({title:t,items:a,renderItem:_}){const{t:i}=ie(),d=l.useId(),n=l.useRef(null),[N,R]=l.useState(!1),[D,j]=l.useState(0),b=Math.max(0,Math.ceil(a.length/ae)-1),g=Math.min(D,b),C=g*ae,u=Math.min(C+ae,a.length),A=E=>{var p,y;j(E),(y=(p=n.current)==null?void 0:p.scrollTo)==null||y.call(p,{top:0})};return e.jsxs("div",{className:s.migrationSection,children:[e.jsxs(J,{variant:"ghost",className:s.migrationDisclosure,"aria-expanded":N,"aria-controls":d,onClick:()=>R(!N),children:[e.jsxs("span",{children:[t," (",a.length.toLocaleString(),")"]}),e.jsx("span",{"aria-hidden":"true",children:N?"−":"+"})]}),e.jsx("div",{id:d,hidden:!N,children:N&&e.jsxs("div",{children:[e.jsx("ul",{ref:n,className:s.migrationList,tabIndex:0,"aria-label":t,children:a.slice(C,u).map((E,p)=>_(E,C+p))}),e.jsxs("div",{className:s.migrationPagination,children:[e.jsxs("span",{children:[C+1,"–",u," / ",a.length.toLocaleString()]}),b>0&&e.jsxs("div",{children:[e.jsx(J,{variant:"secondary",disabled:g===0,onClick:()=>A(g-1),children:i("sync.migration.previous","Previous")}),e.jsx(J,{variant:"secondary",disabled:g===b,onClick:()=>A(g+1),children:i("sync.migration.next","Next")})]})]})]},g)})]})}function Qt({migration:t,onRefresh:a,onApply:_}){const{t:i}=ie(),[d,n]=l.useState(!1),[N,R]=l.useState(0),D=l.useRef(null),j=!!(t!=null&&t.loading||t!=null&&t.applying),b=t==null?void 0:t.progress,g=(b==null?void 0:b.status)==="running"&&b.operation===(t!=null&&t.applying?"apply":"preview")?b:null,C=g==null?void 0:g.startedAt;l.useEffect(()=>{if(!j){R(0);return}const c=C?Date.parse(C):Date.now(),h=()=>R(Math.max(0,Math.floor((Date.now()-c)/1e3)));h();const L=setInterval(h,1e3);return()=>clearInterval(L)},[j,C]);const u=t==null?void 0:t.report;if(!t||(u==null?void 0:u.status)==="not_required"||!u&&!j&&!t.error)return null;const A=(u==null?void 0:u.status)==="blocked",E=(u==null?void 0:u.status)==="ready"&&!j,p=()=>{n(!1),_(),requestAnimationFrame(()=>{var c;return(c=D.current)==null?void 0:c.focus()})},y=[...new Set((u==null?void 0:u.blockers.map(c=>c.reason))??[])];return e.jsxs("section",{ref:D,tabIndex:-1,className:`${s.card} ${s.migrationPanel}`,"aria-labelledby":"sync-migration-title",children:[e.jsxs("div",{className:s.migrationHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{id:"sync-migration-title",className:s.migrationTitle,children:u?i("sync.migration.title","Sync format update available"):i("sync.migration.checking","Checking sync format")}),e.jsx("p",{className:s.migrationDescription,children:i("sync.migration.description","Review the metadata changes before updating this place from sync format v2 to v3.")})]}),u&&e.jsx(H,{variant:A?"warning":"accent",children:j?t.applying?i("sync.migration.applying","Applying…"):i("sync.migration.refreshing","Refreshing…"):A?i("sync.migration.status.blocked","Blocked"):i("sync.migration.status.ready","Ready to review")})]}),u&&e.jsx("div",{className:s.migrationLedger,"aria-label":i("sync.migration.preview","Review changes"),children:["add","modify","delete","blocked"].map(c=>e.jsxs("div",{className:`${s.migrationLedgerItem} ${c==="blocked"&&A?s.migrationLedgerBlocked:""}`,children:[e.jsx("span",{children:i(`sync.migration.summary.${c}`,c)}),e.jsx("strong",{children:u.summary[c].toLocaleString()})]},c))}),j&&e.jsxs("div",{className:s.migrationProgress,children:[e.jsxs("div",{role:"status",className:s.migrationProgressHeading,children:[e.jsx("span",{children:t.applying?i("sync.migration.applying","Applying…"):i("sync.migration.refreshing","Refreshing…")}),g&&e.jsx("span",{children:i(`sync.migration.phase.${g.phase}`,g.phase)})]}),e.jsx("progress",{"aria-label":i("sync.migration.progress","Update progress"),...g!=null&&g.total&&g.total>0?{value:g.completed,max:g.total}:{}}),e.jsxs("div",{className:s.migrationProgressMeta,children:[e.jsx("span",{"aria-live":"off",children:i("sync.migration.elapsed","Elapsed {seconds}s").replace("{seconds}",String(N))}),(g==null?void 0:g.total)!==null&&(g==null?void 0:g.total)!==void 0&&e.jsxs("span",{children:[g.completed.toLocaleString()," / ",g.total.toLocaleString()]})]}),e.jsx("p",{children:i("sync.migration.wait","Large places can take a while. You can keep browsing while this runs.")})]}),e.jsxs("div",{className:s.migrationNotice,"aria-live":"polite",children:[(A||t.error==="migration_blocked")&&e.jsx("span",{children:i("sync.migration.blocked","Resolve sync conflicts before updating")}),y.map(c=>e.jsx("span",{children:i(`sync.migration.reason.${c}`,c.replace(/_/g," "))},c)),t.error==="preview_stale"&&e.jsx("span",{children:i("sync.migration.stale","Preview changed. Review the latest diff.")}),t.error==="migration_in_progress"&&e.jsx("span",{children:i("sync.migration.inProgress","An update is already running for this place. Wait, then refresh the preview.")}),t.error==="unknown"&&e.jsx("span",{className:s.migrationError,children:i("sync.migration.error","Could not update the sync format. Try again.")})]}),e.jsxs("div",{className:s.migrationActions,children:[e.jsx(J,{variant:"secondary",className:s.migrationButton,disabled:j,onClick:()=>void a(),children:t.loading?i("sync.migration.refreshing","Refreshing…"):i("sync.migration.refresh","Refresh preview")}),u&&e.jsx(J,{variant:"primary",className:s.migrationButton,disabled:!E,onClick:()=>n(!0),children:t.applying?i("sync.migration.applying","Applying…"):i("sync.migration.apply","Apply update")})]}),u&&u.changes.length>0&&e.jsx(re,{title:i("sync.migration.changes","Metadata changes"),items:u.changes,renderItem:c=>e.jsxs("li",{className:s.migrationRow,children:[e.jsx(H,{variant:Jt(c.operation),className:s.migrationOperation,children:i(`sync.migration.operation.${c.operation}`,c.operation)}),e.jsxs("div",{className:s.migrationRowBody,children:[e.jsx("code",{children:c.path}),e.jsx("span",{children:i(`sync.migration.reason.${c.reason}`,c.reason.replace(/_/g," "))})]})]},`${c.operation}:${c.path}`)}),u&&u.blockers.length>0&&e.jsx(re,{title:i("sync.migration.blockers","Items to resolve"),items:u.blockers,renderItem:(c,h)=>e.jsxs("li",{className:s.migrationRow,children:[e.jsx(H,{variant:"warning",className:s.migrationOperation,children:i("sync.migration.summary.blocked","Blocked")}),e.jsxs("div",{className:s.migrationRowBody,children:[c.path&&e.jsx("code",{children:c.path}),e.jsx("span",{children:i(`sync.migration.reason.${c.reason}`,c.reason.replace(/_/g," "))})]})]},`${c.reason}:${c.path??h}`)}),e.jsx(pe,{open:d,title:i("sync.migration.confirm.title","Apply sync format update?"),message:i("sync.migration.confirm.message","Back up and update the listed sync metadata. Your Luau source files will not change."),cancelLabel:i("common.cancel","Cancel"),confirmLabel:i("sync.migration.apply","Apply update"),onCancel:()=>n(!1),onConfirm:p})]})}const es=["scriptSource","properties","structure","serviceProperties"];function ts(t){const a=new Date(t);return`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}`}function ss(t){switch(t){case"fullSyncComplete":case"write":return s.logTypeWrite;case"fullSyncStart":case"fullSyncProgress":case"update":return s.logTypeUpdate;case"fullSyncFailed":case"delete":return s.logTypeDelete;default:return s.logTypeIdle}}const ce={unknown:"neutral",off:"neutral",idle:"neutral",initializing:"info",syncing:"success",paused:"warning",error:"error"},le={unknown:"Unknown",off:"Sync OFF",idle:"Waiting",initializing:"Initializing",syncing:"Syncing",paused:"Paused",error:"Error"},ns={inactive:"Change sending off",active:"Change sending enabled",paused_play:"Paused for Play",reconciling:"Checking Edit changes",blocked:"Changes need attention",unknown:"Sending status unknown"},os={inactive:"neutral",active:"success",paused_play:"warning",reconciling:"info",blocked:"error",unknown:"neutral"};function as(t,a){switch(a){case"conflict_review":case"manual_review":return t("sync.forwardStatus.reason.review","Review changes in the Studio Plugin.");case"edit_changed_during_reconciliation":return t("sync.forwardStatus.reason.editChanged","Edit changed during the check. Inspect Sync in the Studio Plugin.");case"pre_check_failed":case"reverse_apply_failed":case"reconciliation_failed":case"sync_error":case"update_failed":case"acknowledgement_missing":case"ACK_EXPIRED":case"ACK_ID_REUSED":case"SYNC_DIRECTION_REVERSE":return t("sync.forwardStatus.reason.failed","Changes could not be confirmed. Inspect Sync in the Studio Plugin.");default:return t("sync.forwardStatus.reason.fallback","Check the Studio Plugin for details.")}}function is(t,a){const _={studio_first:"Studio First",bidirectional_review:"Bidirectional",local_code_studio_world:"Local Code, Studio World",custom:"Custom"};return t(`sync.policy.preset.${a}`,_[a])}function de(t,a){return a==="auto"?t("sync.policy.apply.auto","Auto apply"):t("sync.policy.apply.manual","Review first")}function rs(t,a){const _={forward:"Studio → Local",reverse:"Local → Studio",bidirectional:"Both ways"};return t(`sync.policy.direction.${a}`,_[a])}function cs(t){return{forward:"←",reverse:"→",bidirectional:"⇄"}[t]}function ls(t,a){const _={forward:"Studio changes are written to local files.",reverse:"Local file changes are applied to Studio.",bidirectional:"Changes can move from Studio to local files and from local files to Studio."};return t(`sync.policy.direction.${a}.tooltip`,_[a])}function ds(t,a){return a?t("sync.policy.safety.auto","Auto delete to Studio"):t("sync.policy.safety.review","Review before delete")}function ps(t,a){return a?t("sync.policy.safety.auto.tooltip","Deleting local files may automatically remove matching Studio instances. This is separate from UI Studio automatic cleanup."):t("sync.policy.safety.review.tooltip","Local file deletions wait for review before matching Studio instances are removed. This is separate from UI Studio automatic cleanup.")}function ys(t,a){switch(a){case"fullSyncStart":return t("sync.log.type.fullSyncStart","START");case"fullSyncProgress":return t("sync.log.type.fullSyncProgress","PROGRESS");case"fullSyncComplete":return t("sync.log.type.fullSyncComplete","COMPLETE");case"fullSyncFailed":return t("sync.log.type.fullSyncFailed","FAILED");case"write":return t("sync.log.type.write","WRITE");case"update":return t("sync.log.type.update","UPDATE");case"delete":return t("sync.log.type.delete","DELETE");default:return t("sync.log.type.idle","IDLE")}}function us(t,a){switch(a){case"fullSyncStart":return t("sync.log.type.fullSyncStart.tooltip","Full Sync started.");case"fullSyncProgress":return t("sync.log.type.fullSyncProgress.tooltip","Full Sync is saving the snapshot.");case"fullSyncComplete":return t("sync.log.type.fullSyncComplete.tooltip","Full Sync completed successfully.");case"fullSyncFailed":return t("sync.log.type.fullSyncFailed.tooltip","Full Sync ended without completing the snapshot.");case"write":return t("sync.log.type.write.tooltip","A new sync output was written to disk.");case"update":return t("sync.log.type.update.tooltip","An existing synced file or instance was updated.");case"delete":return t("sync.log.type.delete.tooltip","A synced file or instance was removed.");default:return t("sync.log.type.idle.tooltip","A sync event was recorded without a file mutation.")}}function xs(){var K,Y,v,X,w,V;const{t}=ie(),{trackEvent:a}=_e(),{level:_}=Se(),{tier:i,loading:d}=ve(),n=Re(),{show:N}=xe(),[R,D]=l.useState(null),[j,b]=l.useState(!1),[g,C]=l.useState(!1),[u,A]=l.useState(!1),E=!d&&i==="basic",p=n.selectedTarget,y=p==null?void 0:p.sync,c=(y==null?void 0:y.forwardSyncStatus)??"unknown",h=p?{...p.sync.status,syncEnabled:p.sync.syncEnabled,policy:p.sync.policy,policyCapabilities:p.sync.policyCapabilities,policyReviewRequired:p.sync.policyReviewRequired}:null,L=(p==null?void 0:p.placeName)??((K=n.selectedPlace)==null?void 0:K.placeName)??t("sync.targets.unknownPlace","Unknown place"),G=n.selectedPlaceId===null?L:L+" · "+n.selectedPlaceId,B=n.storageSafe?(h==null?void 0:h.instanceCount)??((Y=n.selectedPlace)==null?void 0:Y.instanceCount):null,U=n.storageSafe?(h==null?void 0:h.scriptCount)??((v=n.selectedPlace)==null?void 0:v.scriptCount):null,q=new Set(n.targets.map(r=>r.placeId)),M=n.places.filter(r=>r.placeId===0||!q.has(r.placeId)),$=e.jsx(we,{title:t("page.sync.title","Sync"),description:t("page.sync.description","Monitor Studio to local sync status, direction, apply mode, and recent sync logs."),helpTopicId:"sync",helpState:{connectionLevel:_,tier:i}}),k=n.history,Q=async()=>{if(R){b(!0);try{await n.clearHistory(R.placeId),N(t("toast.clearSuccess","Cleared successfully"),"success"),D(null)}catch{N(t("toast.clearFailed","Failed to clear data"),"error")}finally{b(!1)}}};return e.jsxs("div",{className:s.page,children:[$,e.jsxs("section",{className:s.card,"aria-label":t("sync.targets.title","Connected Studios"),children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsxs("span",{children:[t("sync.targets.title","Connected Studios")," (",n.targets.length,")"]}),e.jsx("button",{type:"button",className:s.refreshButton,onClick:n.refresh,children:t("sync.targets.refresh","Refresh")})]}),n.loading?e.jsx("p",{className:s.emptyMessage,children:t("sync.targets.loading","Loading Studio Sync status…")}):n.snapshotError?e.jsxs("p",{className:s.errorMessage,role:"alert",children:[t("sync.targets.unavailable","Studio Sync status is unavailable. Retry to check the current state.")," ",n.snapshotError]}):n.targets.length===0?e.jsx("p",{className:s.emptyMessage,children:t("sync.targets.empty","No Studio is connected. Connect the WEPPY Plugin to see live Sync status.")}):e.jsx("div",{className:s.targetList,children:n.targets.map(r=>{var I;const x=((I=n.selection)==null?void 0:I.kind)==="target"&&n.selection.clientId===r.clientId;return e.jsxs("button",{type:"button",className:`${s.targetRow} ${x?s.targetRowSelected:""}`,"aria-pressed":x,onClick:()=>n.selectTarget(r.clientId),children:[e.jsxs("span",{className:s.targetIdentity,children:[e.jsx(O,{text:r.placeName||t("sync.targets.unknownPlace","Unknown place"),children:e.jsx("strong",{children:r.placeName||t("sync.targets.unknownPlace","Unknown place")})}),e.jsxs("span",{children:[t("sync.targets.placeId","Place ID"),": ",r.placeId??"—"]})]}),e.jsxs("span",{className:s.targetStudio,children:[e.jsx(O,{text:r.clientId,children:e.jsxs("span",{children:[t("sync.targets.studioId","Studio ID"),": ",r.targetAlias]})}),e.jsx("span",{children:t("sync.targets.connected","Connected")})]}),e.jsxs("span",{className:s.targetState,children:[e.jsx(H,{variant:ce[r.sync.state],shape:"pill",children:t("sync.targets.state."+r.sync.state,le[r.sync.state])}),r.sync.syncEnabled===null&&e.jsx("span",{className:s.stateNote,children:t("sync.targets.notReported","Not reported yet")})]})]},r.clientId)})})]}),M.length>0&&e.jsxs("section",{className:s.card,"aria-label":t("sync.stored.title","Stored places"),children:[e.jsxs("button",{type:"button",className:s.storedDisclosure,"aria-expanded":u,onClick:()=>A(r=>!r),children:[e.jsxs("span",{children:[t("sync.stored.title","Stored places")," (",M.length,")"]}),e.jsx("span",{"aria-hidden":"true",children:u?"⌃":"⌄"})]}),u&&e.jsx("div",{className:s.storedList,children:M.map(r=>{var ee;const x=oe(n.places,r),I=((ee=n.selection)==null?void 0:ee.kind)==="stored"&&n.selection.placeDirName===r.placeDirName;return e.jsxs("button",{type:"button",className:`${s.storedRow} ${I?s.targetRowSelected:""}`,disabled:!x,"aria-pressed":I,onClick:()=>n.selectStored(r),children:[e.jsxs("span",{children:[r.placeName," · ",r.placeId]}),e.jsx("span",{children:x?t("sync.stored.data","Stored data"):t("sync.stored.ambiguous","Storage location unconfirmed")})]},r.placeDirName)})})]}),n.selection&&!n.snapshotError&&e.jsxs("div",{className:s.selectedScope,children:[e.jsx("span",{children:t("sync.detail.scope","Viewing Sync details for")}),e.jsx("strong",{children:G}),p&&e.jsxs("span",{children:[t("sync.targets.studioId","Studio ID"),": ",p.targetAlias]}),e.jsx("span",{children:t("sync.detail.readOnly","Viewing details does not change Studio routing.")})]}),!n.selection&&!n.loading&&!n.snapshotError&&e.jsx("p",{className:s.emptyMessage,children:t("sync.detail.empty","Select a connected Studio or stored place to view details.")}),n.selection&&!n.snapshotError&&e.jsxs("div",{className:s.detailsStack,children:[e.jsxs("div",{className:s.card,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsx(O,{text:t("sync.status.title.tooltip","Current Studio and local file sync status for this place."),children:t("sync.status.title","Sync Status")}),E&&e.jsx(O,{text:t("sync.status.forwardOnly.tooltip","Basic tier allows Studio to local forward sync only."),children:e.jsx("span",{className:s.forwardBadge,children:t("sync.status.forwardOnly","Forward Only")})})]}),e.jsxs("div",{className:s.statusRow,children:[y?e.jsx(H,{variant:ce[y.state],shape:"pill",children:t("sync.targets.state."+y.state,le[y.state])}):e.jsx(H,{variant:"neutral",shape:"pill",children:t("sync.stored.data","Stored data")}),e.jsx("span",{className:s.metaItem,children:G})]}),(y==null?void 0:y.state)==="unknown"&&e.jsx("p",{className:s.emptyMessage,children:t("sync.detail.unknown","This Studio has not reported its Sync state yet.")}),(y==null?void 0:y.state)==="error"&&e.jsx("p",{className:s.errorMessage,role:"alert",children:t("sync.detail.error","Sync reported an error. Check the Studio Plugin for details.")}),e.jsxs("dl",{className:s.statusGrid,children:[p&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(Z,{label:t("sync.forwardStatus.label","Change sending"),tooltip:t("sync.forwardStatus.tooltip","This reports whether Edit changes can be sent. Enabled does not confirm every local file is current.")})}),e.jsxs("dd",{children:[e.jsx(H,{variant:os[c],shape:"pill",children:t("sync.forwardStatus."+c,ns[c])}),c==="blocked"&&e.jsx("span",{className:s.forwardStatusReason,children:as(t,y==null?void 0:y.forwardSyncReason)})]}),(y==null?void 0:y.forwardSyncObservedAt)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:t("sync.forwardStatus.observedAt","Observed")}),e.jsx("dd",{children:new Date(y.forwardSyncObservedAt).toLocaleString()})]})]}),p&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:t("sync.targets.studioId","Studio ID")}),e.jsx("dd",{children:p.targetAlias}),e.jsx("dt",{children:t("sync.targets.connectionId","Connection ID")}),e.jsx("dd",{children:p.clientId})]}),(h==null?void 0:h.syncRoot)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(Z,{label:t("sync.status.path","Place Root"),tooltip:t("sync.status.path.tooltip","Local filesystem root currently used for this place sync output.")})}),e.jsx("dd",{children:h.syncRoot})]}),((X=n.selectedPlace)==null?void 0:X.placeDirName)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(Z,{label:t("sync.detail.placeFolder","Place folder"),tooltip:t("sync.detail.placeFolder.tooltip","The stored folder shared by Studios opening this Place.")})}),e.jsx("dd",{children:n.selectedPlace.placeDirName})]}),B!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(Z,{label:t("sync.status.instances","Instances"),tooltip:t("sync.status.instances.tooltip","Total synced Roblox instances tracked in the local mirror.")})}),e.jsx("dd",{children:B})]}),U!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(Z,{label:t("sync.status.scripts","Scripts"),tooltip:t("sync.status.scripts.tooltip","Total synced script files currently indexed for this place.")})}),e.jsx("dd",{children:U})]})]}),e.jsx("p",{className:s.sharedNote,children:t("sync.detail.sharedData","Path, counts, and log belong to the Place and are shared by Studios opening it.")})]}),n.storageSafe&&e.jsx(Qt,{migration:n.migration,onRefresh:n.refreshMigration,onApply:n.applyMigration},[n.selection.kind==="target"?n.selection.clientId:n.selection.placeDirName,n.selectedPlaceId,(V=(w=n.migration)==null?void 0:w.report)==null?void 0:V.previewFingerprint].join(":")),(h==null?void 0:h.policy)&&e.jsxs("div",{className:s.card,children:[e.jsx("div",{className:s.cardHeader,children:e.jsx(O,{text:t("sync.policy.title.tooltip","Effective Sync policy reported by the connected Studio plugin."),children:t("sync.policy.title","Sync Policy")})}),e.jsxs("dl",{className:s.policySummary,children:[e.jsxs("div",{className:s.policySummaryItem,children:[e.jsx("dt",{children:t("sync.policy.activation","Activation")}),e.jsx("dd",{children:e.jsx(H,{variant:h.syncEnabled?"success":"neutral",children:h.syncEnabled?t("sync.policy.activation.on","Sync ON"):t("sync.policy.activation.off","Sync OFF")})})]}),e.jsxs("div",{className:s.policySummaryItem,children:[e.jsx("dt",{children:t("sync.policy.preset","Workflow")}),e.jsx("dd",{className:s.policyPrimaryValue,children:is(t,h.policy.preset)})]})]}),h.policyReviewRequired&&e.jsx("div",{className:s.policyReviewNotice,role:"status",children:t("sync.policy.reviewRequired","Review this policy in the Studio plugin before starting Sync.")}),e.jsxs("section",{className:s.policyApplySection,"aria-labelledby":"sync-policy-apply-title",children:[e.jsxs("div",{className:s.policyApplyHeader,children:[e.jsx("h3",{id:"sync-policy-apply-title",className:s.policyApplyTitle,children:t("sync.policy.apply.title","How local changes apply to Studio")}),e.jsx("p",{className:s.policyApplyDescription,children:t("sync.policy.apply.description","Shows whether changes made locally are reviewed first or applied to Studio automatically.")})]}),e.jsxs("dl",{className:s.policySummary,children:[e.jsxs("div",{className:s.policySummaryItem,children:[e.jsx("dt",{children:e.jsx(O,{text:t("sync.policy.apply.content.tooltip","Script Source, property, and Service property changes made locally. Instance creation, deletion, renaming, and moves are Structure changes."),children:e.jsx("span",{className:s.policyInfoLabel,tabIndex:0,children:t("sync.policy.apply.content","Content changes")})})}),e.jsx("dd",{children:de(t,h.policy.apply.contentChanges)})]}),e.jsxs("div",{className:s.policySummaryItem,children:[e.jsx("dt",{children:e.jsx(O,{text:t("sync.policy.apply.structure.tooltip","Instance creation, deletion, renaming, and moves made locally. Automatic local deletion additionally requires the separate delete option below."),children:e.jsx("span",{className:s.policyInfoLabel,tabIndex:0,children:t("sync.policy.apply.structure","Structure changes")})})}),e.jsx("dd",{children:de(t,h.policy.apply.structureChanges)})]})]}),e.jsxs("div",{className:s.policySafetyRow,children:[e.jsx("span",{className:s.policySafetyLabel,children:t("sync.policy.safety.localDeletes","Local delete → Studio instance removal")}),e.jsx(O,{text:ps(t,h.policy.autoApplyLocalDeletesToStudio),children:e.jsx(H,{variant:h.policy.autoApplyLocalDeletesToStudio?"warning":"neutral",className:s.policySafetyBadge,tabIndex:0,children:ds(t,h.policy.autoApplyLocalDeletesToStudio)})})]})]}),e.jsxs("button",{type:"button",className:s.policyDisclosure,"aria-expanded":g,"aria-controls":"sync-policy-scope-panel",onClick:()=>C(r=>!r),children:[e.jsx("span",{children:t("sync.policy.scope.disclosure","Scope directions")}),e.jsx("span",{"aria-hidden":"true",className:`${s.policyDisclosureIcon} ${g?s.policyDisclosureIconOpen:""}`,children:"⌄"})]}),g&&e.jsx("div",{id:"sync-policy-scope-panel",className:s.policyScopeList,children:es.map(r=>{const x=h.policy.directions[r];return e.jsxs("div",{className:s.policyScopeRow,"data-testid":"sync-policy-scope-row",children:[e.jsx("span",{className:s.policyScopeName,children:t(`sync.policy.scope.${r}`,r)}),e.jsx(O,{text:ls(t,x),children:e.jsxs("span",{className:s.policyDirectionRail,"data-testid":"sync-policy-direction-rail",role:"img","aria-label":rs(t,x),tabIndex:0,children:[e.jsx("span",{className:s.policyDirectionEndpoint,children:t("sync.policy.endpoint.local","Local")}),e.jsx("span",{className:s.policyDirectionArrow,"aria-hidden":"true",children:cs(x)}),e.jsx("span",{className:`${s.policyDirectionEndpoint} ${s.policyDirectionEndpointStudio}`,children:t("sync.policy.endpoint.studio","Studio")})]})})]},r)})})]}),e.jsxs("div",{className:s.card,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsxs("span",{children:[t("sync.log.title","Sync Log")," · ",t("sync.log.shared","Shared Place log")]}),e.jsx("button",{className:s.clearButton,type:"button",disabled:!n.storageSafe||n.selectedPlaceId===null,onClick:()=>{n.selectedPlaceId!==null&&(a("dashboard_click_event",{click_target:"sync_clear_log",page:"sync"}),D({placeId:n.selectedPlaceId,label:G}))},children:t("common.clear","Clear")})]}),e.jsx("div",{className:s.logContainer,children:n.storageSafe?n.historyError?e.jsxs("div",{className:s.errorMessage,role:"alert",children:[t("sync.log.unavailable","The Place log could not be loaded. Retry to check it.")," ",n.historyError]}):n.historyLoading&&k.length===0?e.jsx("div",{className:s.logEmpty,children:t("sync.log.loading","Loading Place log…")}):k.length===0?e.jsx("div",{className:s.logEmpty,children:t("sync.log.empty","No sync events yet")}):k.map((r,x)=>e.jsxs("div",{className:s.logEntry,children:[e.jsx("span",{className:s.logTime,children:ts(r.timestamp)}),e.jsx(O,{text:us(t,r.type),children:e.jsx("span",{className:`${s.logType} ${ss(r.type)}`,children:ys(t,r.type)})}),e.jsxs("span",{className:s.logPath,children:[r.path,r.details?` — ${r.details}`:""]})]},x)):e.jsx("div",{className:s.logEmpty,children:t("sync.log.unsafe","This Place has no confirmed storage location for log access.")})})]}),E&&e.jsx(Ne,{title:t("sync.upgrade.title","Explore Full Sync with Pro"),description:t("tier.banner.save","Save AI tokens with Pro!"),benefits:[t("sync.upgrade.benefit1","Bidirectional sync — edit files, auto-apply to Studio"),t("sync.upgrade.benefit2","Reverse sync — push file changes back to Studio"),t("sync.upgrade.benefit3","Full sync history and detailed change log")],upgradeLabel:t("sync.upgrade.buy","View Pro"),upgradeHref:je.sync})]}),e.jsx(pe,{open:R!==null,title:t("sync.clear.title","Clear sync log?"),message:t("sync.clear.selectedMessage","This permanently removes the shared Sync log for {place}.").replace("{place}",(R==null?void 0:R.label)??""),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:j,onCancel:()=>!j&&D(null),onConfirm:Q})]})}export{xs as Component};
@@ -0,0 +1 @@
1
+ ._page_1hoev_2{display:flex;flex-direction:column;gap:var(--space-page);max-width:900px}._detailsStack_1hoev_9{display:flex;flex-direction:column;gap:var(--space-page)}._refreshButton_1hoev_15{min-height:32px;padding:4px 10px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-primary);font:inherit;font-size:12px;cursor:pointer}._refreshButton_1hoev_15:hover{border-color:var(--border-highlight)}._refreshButton_1hoev_15:focus-visible,._targetRow_1hoev_29:focus-visible,._storedRow_1hoev_30:focus-visible,._storedDisclosure_1hoev_31:focus-visible{outline:none;box-shadow:var(--focus-ring)}._targetList_1hoev_33,._storedList_1hoev_33{display:flex;flex-direction:column;gap:4px}._targetRow_1hoev_29{display:grid;width:100%;min-height:56px;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr) 132px;align-items:center;gap:12px;padding:8px 12px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-primary);font-family:var(--font-label);text-align:left;cursor:pointer}._targetRow_1hoev_29:hover,._storedRow_1hoev_30:hover:not(:disabled){border-color:var(--border-highlight)}._targetRowSelected_1hoev_53{border-color:var(--accent)!important;background:var(--accent-dim)}._targetIdentity_1hoev_54,._targetStudio_1hoev_54,._targetState_1hoev_54{display:flex;min-width:0;flex-direction:column;gap:3px}._targetIdentity_1hoev_54>[data-tooltip-text],._targetStudio_1hoev_54>[data-tooltip-text]{min-width:0;max-width:100%}._targetIdentity_1hoev_54 strong{display:block;min-width:0;max-width:100%;overflow:hidden;font-size:14px;text-overflow:ellipsis;white-space:nowrap}._targetIdentity_1hoev_54 span,._targetStudio_1hoev_54 span,._stateNote_1hoev_57{color:var(--text-secondary);font-size:11px}._targetStudio_1hoev_54>[data-tooltip-text]>span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._targetState_1hoev_54{align-items:flex-end;text-align:right}._storedDisclosure_1hoev_31{display:flex;width:100%;align-items:center;justify-content:space-between;border:0;background:none;color:var(--text-primary);font-family:var(--font-label);font-size:var(--type-card-title-size);font-weight:600;cursor:pointer}._storedList_1hoev_33{margin-top:12px}._storedRow_1hoev_30{display:flex;min-height:42px;align-items:center;justify-content:space-between;gap:12px;padding:8px 12px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-primary);font:inherit;font-size:12px;text-align:left;cursor:pointer}._storedRow_1hoev_30:disabled{color:var(--text-muted);cursor:default}._selectedScope_1hoev_94{display:flex;min-width:0;align-items:center;flex-wrap:wrap;gap:8px;padding:9px 12px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-secondary);font-size:12px}._selectedScope_1hoev_94 strong{min-width:0;color:var(--text-primary);overflow-wrap:anywhere}._selectedScope_1hoev_94 span:last-child{margin-left:auto}._sharedNote_1hoev_109,._emptyMessage_1hoev_109{margin:8px 0 0;color:var(--text-secondary);font-size:12px;line-height:1.45}._errorMessage_1hoev_110{margin:8px 0;color:var(--error-text);font-size:12px;line-height:1.45;overflow-wrap:anywhere}._card_1hoev_113{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:var(--card-padding-block) var(--card-padding-inline)}._cardHeader_1hoev_120{font-family:var(--font-label);font-size:var(--type-card-title-size);font-weight:600;color:var(--text-primary);margin-bottom:var(--space-section);display:flex;align-items:center;justify-content:space-between;gap:var(--space-related)}._clearButton_1hoev_132{border:1px solid var(--danger-border);background:var(--danger-bg);color:var(--danger-text);border-radius:var(--radius-control);padding:6px 12px;font-family:var(--font-label);font-size:12px;font-weight:600;cursor:pointer;transition:background var(--transition),border-color var(--transition),color var(--transition)}._clearButton_1hoev_132:hover{background:var(--danger-hover-bg);border-color:var(--danger)}._clearButton_1hoev_132:disabled{opacity:.55;cursor:not-allowed}._clearButton_1hoev_132:focus-visible{outline:none;box-shadow:var(--focus-ring)}._statusRow_1hoev_158{display:flex;align-items:center;gap:12px;margin-bottom:8px}._metaItem_1hoev_165{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._statusGrid_1hoev_171{display:grid;grid-template-columns:auto 1fr;gap:4px 16px;font-size:12px}._statusGrid_1hoev_171 dt{color:var(--text-secondary);font-family:var(--font-label)}._statusGrid_1hoev_171 dd{margin:0;font-family:var(--font-code);color:var(--text-primary);min-width:0;overflow-wrap:anywhere}._forwardStatusReason_1hoev_191{display:block;margin-top:4px;color:var(--error-text);font-size:11px}._migrationPanel_1hoev_199{display:flex;flex-direction:column;gap:12px;font-size:var(--type-body-size)}._migrationHeader_1hoev_206{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}._migrationTitle_1hoev_213{margin:0;color:var(--text-primary);font-family:var(--font-label);font-size:var(--type-surface-title-size);line-height:1.25;font-weight:600}._migrationDescription_1hoev_222{max-width:640px;margin:8px 0 0;color:var(--text-secondary);font-size:var(--type-body-size);line-height:1.5}._migrationLedger_1hoev_230{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--border);background:var(--bg-secondary)}._migrationLedgerItem_1hoev_237{display:flex;min-width:0;min-height:48px;flex-direction:column;justify-content:center;gap:4px;padding:8px 12px;border-right:1px solid var(--border);color:var(--text-secondary);font-family:var(--font-label);font-size:var(--type-body-size)}._migrationLedgerItem_1hoev_237:last-child{border-right:0}._migrationLedgerItem_1hoev_237 strong{color:var(--text-primary);font-family:var(--font-code);font-size:var(--type-surface-title-size);font-variant-numeric:tabular-nums}._migrationLedgerBlocked_1hoev_262 strong{color:var(--warning-text)}._migrationSection_1hoev_266{display:flex;flex-direction:column;gap:8px}._migrationSection_1hoev_266 h3{margin:0;color:var(--text-secondary);font-family:var(--font-label);font-size:var(--type-body-size);font-weight:600}._migrationList_1hoev_280{max-height:240px;overflow-y:auto;display:flex;flex-direction:column;gap:0;margin:0;padding:0;border:1px solid var(--border);list-style:none}._migrationRow_1hoev_292{display:grid;grid-template-columns:84px minmax(0,1fr);align-items:start;gap:12px;padding:8px 12px;border-bottom:1px solid var(--border)}._migrationRow_1hoev_292:last-child{border-bottom:0}._migrationOperation_1hoev_305{min-width:76px;text-transform:uppercase}._migrationRowBody_1hoev_310{display:flex;min-width:0;flex-direction:column;gap:4px}._migrationRowBody_1hoev_310 code{overflow-wrap:anywhere;color:var(--text-primary);font-family:var(--font-code);font-size:var(--type-body-size);line-height:1.4}._migrationRowBody_1hoev_310 span{color:var(--text-secondary);font-size:var(--type-body-size);line-height:1.4}._migrationNotice_1hoev_331{display:flex;flex-direction:column;gap:4px;color:var(--warning-text);font-size:var(--type-body-size);line-height:1.5}._migrationActions_1hoev_340{display:flex;justify-content:flex-end;gap:8px}._migrationButton_1hoev_346{min-height:32px;padding:0 16px;font-size:var(--type-body-size)}._migrationNotice_1hoev_331:empty{display:none}._migrationError_1hoev_353{color:var(--error-text)}._migrationDisclosure_1hoev_354{width:100%;justify-content:space-between}._migrationList_1hoev_280:focus-visible{outline:none;box-shadow:var(--focus-ring)}._migrationPagination_1hoev_356,._migrationPagination_1hoev_356>div,._migrationProgressHeading_1hoev_356,._migrationProgressMeta_1hoev_356{display:flex;align-items:center;justify-content:space-between;gap:8px}._migrationPagination_1hoev_356{margin-top:8px;color:var(--text-secondary);font-size:var(--type-control-size)}._migrationProgress_1hoev_356{padding:12px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary)}._migrationProgressHeading_1hoev_356{color:var(--text-primary);font-weight:600}._migrationProgressMeta_1hoev_356{color:var(--text-secondary);font-size:var(--type-control-size);font-variant-numeric:tabular-nums}._migrationProgress_1hoev_356 progress{display:block;width:100%;height:6px;margin:8px 0;border:0;accent-color:var(--accent);background:var(--border)}._migrationProgress_1hoev_356 progress::-webkit-progress-bar{background:var(--border)}._migrationProgress_1hoev_356 progress::-webkit-progress-value{background:var(--accent)}._migrationProgress_1hoev_356 progress::-moz-progress-bar{background:var(--accent)}._migrationProgress_1hoev_356 p{margin:8px 0 0;color:var(--text-secondary)}@media(max-width:640px){._migrationHeader_1hoev_206{flex-direction:column}._migrationLedger_1hoev_230{grid-template-columns:repeat(2,minmax(0,1fr))}._migrationLedgerItem_1hoev_237:nth-child(2){border-right:0}._migrationLedgerItem_1hoev_237:nth-child(-n+2){border-bottom:1px solid var(--border)}._migrationRow_1hoev_292{grid-template-columns:1fr}._migrationActions_1hoev_340{flex-direction:column-reverse}._migrationButton_1hoev_346{width:100%}}._policySummary_1hoev_403{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;margin:0;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--border)}._policySummaryItem_1hoev_414{display:grid;grid-template-columns:minmax(120px,.8fr) minmax(0,1.2fr);align-items:center;min-height:48px;gap:12px;padding:10px 12px;background:var(--bg-secondary)}._policySummaryItem_1hoev_414 dt{color:var(--text-secondary);font-family:var(--font-label);font-size:12px}._policySummaryItem_1hoev_414 dd{min-width:0;margin:0;color:var(--text-primary);font-family:var(--font-code);font-size:13px;overflow-wrap:anywhere}._policyPrimaryValue_1hoev_439{font-family:var(--font-label)!important;font-size:16px!important;font-weight:600}._policyReviewNotice_1hoev_445{margin-top:12px;padding:10px 12px;border:1px solid var(--warning-border);border-radius:var(--radius-control);background:var(--warning-bg);color:var(--warning-text);font-size:14px;line-height:1.45}._policyApplySection_1hoev_456{margin-top:12px}._policyApplyHeader_1hoev_460{margin-bottom:10px}._policyApplyTitle_1hoev_464{margin:0;color:var(--text-primary);font-family:var(--font-label);font-size:14px;font-weight:600}._policyApplyDescription_1hoev_472{margin:4px 0 0;color:var(--text-secondary);font-family:var(--font-label);font-size:13px;line-height:1.45}._policyInfoLabel_1hoev_480{border-bottom:1px dotted var(--text-muted);cursor:help}._policyInfoLabel_1hoev_480:focus-visible{outline:none;border-radius:2px;box-shadow:var(--focus-ring)}._policySafetyRow_1hoev_491{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;min-height:48px;margin-top:8px;padding:0 12px;border:1px solid var(--border);border-radius:var(--radius-control)}._policySafetyLabel_1hoev_503{color:var(--text-secondary);font-family:var(--font-label);font-size:12px}._policySafetyBadge_1hoev_509{min-height:22px}._policyDisclosure_1hoev_513{display:flex;width:100%;min-height:42px;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;padding:0 12px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card);color:var(--text-primary);font-family:var(--font-label);font-size:13px;font-weight:600;text-align:left;cursor:pointer;transition:background var(--transition),border-color var(--transition),color var(--transition)}._policyDisclosure_1hoev_513:hover{border-color:var(--border-highlight);background:var(--bg-secondary);color:var(--accent)}._policyDisclosure_1hoev_513:focus-visible{outline:none;box-shadow:var(--focus-ring)}._policyDisclosureIcon_1hoev_545{flex:0 0 auto;color:var(--text-muted);font-family:var(--font-code);transition:transform var(--transition)}._policyDisclosureIconOpen_1hoev_552{transform:rotate(180deg)}._policyScopeList_1hoev_556{margin-top:8px;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-control)}._policyScopeRow_1hoev_563{display:grid;grid-template-columns:minmax(180px,.9fr) minmax(0,1.1fr);align-items:center;min-height:44px;gap:16px;padding:8px 12px;border-bottom:1px solid var(--border)}._policyScopeRow_1hoev_563:last-child{border-bottom:0}._policyScopeName_1hoev_577{min-width:0;color:var(--text-secondary);font-family:var(--font-label);font-size:13px;overflow-wrap:anywhere}._policyScopeRow_1hoev_563>[data-tooltip-text]{width:100%}._policyDirectionRail_1hoev_589{display:grid;width:100%;min-width:0;grid-template-columns:minmax(0,1fr) 32px minmax(0,1fr);align-items:center;color:var(--text-secondary);font-family:var(--font-code)}._policyDirectionRail_1hoev_589:focus-visible{outline:none;border-radius:2px;box-shadow:var(--focus-ring)}._policyDirectionEndpoint_1hoev_605{min-width:0;font-size:11px;font-weight:500;overflow-wrap:anywhere}._policyDirectionEndpointStudio_1hoev_612{text-align:right}._policyDirectionArrow_1hoev_616{color:var(--accent);font-size:15px;font-weight:600;text-align:center}@media(max-width:640px){._policySummary_1hoev_403{grid-template-columns:1fr}._policySummaryItem_1hoev_414{grid-template-columns:minmax(112px,.8fr) minmax(0,1.2fr)}._policyScopeRow_1hoev_563{grid-template-columns:1fr;gap:6px}._policySafetyRow_1hoev_491{grid-template-columns:1fr;align-items:start;gap:8px;padding:10px 12px}._policySafetyRow_1hoev_491>[data-tooltip-text]{max-width:100%;justify-self:start}._policySafetyBadge_1hoev_509{height:auto;min-height:22px;white-space:normal;line-height:1.25;text-align:left}}._forwardBadge_1hoev_659{display:inline-flex;align-items:center;min-height:20px;padding:2px 8px;font-size:10px;font-weight:600;letter-spacing:.04em;color:var(--text-secondary);background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius-control)}._logContainer_1hoev_674{max-height:240px;overflow-y:auto;font-family:var(--font-code);font-size:11px}._logEntry_1hoev_681{display:flex;gap:10px;padding:3px 0;border-bottom:1px solid var(--border);color:var(--text-primary)}._logEntry_1hoev_681:last-child{border-bottom:none}._logTime_1hoev_693{color:var(--text-muted);flex-shrink:0;width:44px}._logType_1hoev_699{font-weight:500;flex-shrink:0;width:90px;text-transform:uppercase;font-size:10px;letter-spacing:.04em}._logTypeWrite_1hoev_708{color:var(--success)}._logTypeUpdate_1hoev_712{color:var(--accent)}._logTypeDelete_1hoev_716{color:var(--error)}._logTypeIdle_1hoev_720{color:var(--text-muted)}._logPath_1hoev_724{color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._logEmpty_1hoev_731{color:var(--text-muted);font-style:italic;padding:8px 0}._overlay_1hoev_738{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:48px 24px;gap:16px}._overlayTitle_1hoev_748{font-family:var(--font-label);font-size:15px;font-weight:600;color:var(--text-primary)}._overlayMessage_1hoev_755{font-size:13px;color:var(--text-secondary);max-width:400px}._checklist_1hoev_761{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px;text-align:left}._checkItem_1hoev_771{font-family:var(--font-code);font-size:12px;color:var(--text-secondary);padding-left:20px;position:relative}._checkItem_1hoev_771:before{content:"○";position:absolute;left:0;color:var(--text-muted)}._upgradePanel_1hoev_787{background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._upgradePanelHeader_1hoev_794{font-family:var(--font-label);font-size:13px;font-weight:600;color:var(--accent);margin-bottom:8px}._benefitList_1hoev_802{list-style:none;padding:0;margin:0 0 12px;display:flex;flex-direction:column;gap:4px}._benefitItem_1hoev_811{font-size:12px;color:var(--text-secondary);padding-left:16px;position:relative}._benefitItem_1hoev_811:before{content:"+";position:absolute;left:0;color:var(--accent);font-weight:600}._upgradeActions_1hoev_826{display:flex;gap:8px}._btn_1hoev_831{font-family:var(--font-label);font-size:12px;padding:6px 14px;border-radius:var(--radius-control);border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._btn_1hoev_831:hover{border-color:var(--accent);background:var(--accent-dim)}._btnPrimary_1hoev_848{background:var(--accent);color:var(--bg-card);border-color:var(--accent)}._btnPrimary_1hoev_848:hover{opacity:.9}._disabled_1hoev_859{opacity:.4;pointer-events:none}
@@ -1 +1 @@
1
- import{u as H,r as u,j as a,B as z,C as U,g as V,v as Y,o as F,p as B,q as D,x as G}from"./index-CbTOKOZ5.js";import{B as L}from"./PageHeader-C8RSD2wK.js";import{P as Q,a as J}from"./PlaceSelectOptions-B-hh23M4.js";const X="_scope_1i8qy_1",Z="_main_1i8qy_13",ee="_label_1i8qy_22",ce="_selectorLabel_1i8qy_30",le="_placeSelect_1i8qy_38",ae="_name_1i8qy_54",te="_id_1i8qy_65",ne="_scopeBadge_1i8qy_72",oe="_copy_1i8qy_76",se="_note_1i8qy_88",re="_folderDetails_1i8qy_92",ie="_shortcuts_1i8qy_96",de="_shortcutsTrigger_1i8qy_103",pe="_shortcutLink_1i8qy_126",ue="_shortcutsPopover_1i8qy_131",s={scope:X,main:Z,label:ee,selectorLabel:ce,placeSelect:le,name:ae,id:te,scopeBadge:ne,copy:oe,note:se,folderDetails:re,shortcuts:ie,shortcutsTrigger:de,shortcutLink:pe,shortcutsPopover:ue};function C(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}function g(e,c){return F(e.places,c)}function $(e){var c;return e.lastActivePlaceId!==null?e.lastActivePlaceId:((c=e.places[0])==null?void 0:c.placeId)??null}function T(e){var c;if(e.pluginConnected&&e.activePlaceId!==null){const l=e.places.filter(n=>n.placeId===e.activePlaceId);if(g(e,e.activePlaceId)||l.length===0)return e.activePlaceId}if(e.lastActivePlaceId!==null){const l=e.places.filter(n=>n.placeId===e.lastActivePlaceId);if(g(e,e.lastActivePlaceId)||l.length===0)return e.lastActivePlaceId}return((c=Y(e.places))==null?void 0:c.placeId)??null}function fe(e,c,l){var n;return c?((n=g(e,typeof l=="number"?l:null))==null?void 0:n.placeId)??T(e):e.pluginConnected&&e.activePlaceId!==null?e.activePlaceId:$(e)}function M(e,c){const l=g(e,c);return(l==null?void 0:l.universeId)!==void 0?l.universeId:c===e.activePlaceId?e.activeUniverseId??null:c===e.lastActivePlaceId?e.lastActiveUniverseId??null:null}function ve(e,c,l){if(!C(e))return[];const n=[];return C(c)&&n.push({label:l("placeScope.shortcuts.settings","Place settings"),href:`https://create.roblox.com/dashboard/creations/experiences/${c}/places/${e}/configure`},{label:l("placeScope.shortcuts.experience","Experience management"),href:`https://create.roblox.com/dashboard/creations/experiences/${c}/overview`}),n.push({label:l("placeScope.shortcuts.roblox","View on Roblox"),href:`https://www.roblox.com/games/${e}`}),n}function he(e,c){if(e.pluginConnected&&e.activePlaceId!==null){const o=g(e,e.activePlaceId),t=o?B(e.places,o.placeId):!1,r=c("placeScope.folder.unresolvedPlace","Place {placeId}").replace("{placeId}",String(e.activePlaceId));return{label:c("placeScope.current.label","Current Place"),placeId:e.activePlaceId,placeName:e.activePlaceName??(t?r:o==null?void 0:o.placeName)??c("placeScope.unknownPlace","Unknown place"),badge:c("placeScope.connected","Studio connected"),connected:(o==null?void 0:o.isConnected)??!0,folderUnresolved:t,hasSyncMetadata:o?D(e.places,o):void 0,note:null}}const l=$(e),n=g(e,l);if(l!==null){const o=l===e.lastActivePlaceId?e.lastActivePlaceName:null,t=n?B(e.places,n.placeId):!1,r=c("placeScope.folder.unresolvedPlace","Place {placeId}").replace("{placeId}",String(l));return{label:c("placeScope.lastActive.label","Last Active Place"),placeId:l,placeName:o??(t?r:n==null?void 0:n.placeName)??c("placeScope.unknownPlace","Unknown place"),badge:c("placeScope.stored","Stored data"),connected:!1,folderUnresolved:t,hasSyncMetadata:n?D(e.places,n):void 0,note:c("placeScope.stored.note","No connected Studio currently has this place open.")}}return{label:c("placeScope.noPlace.label","Place scope"),placeId:null,placeName:c("placeScope.noPlace.value","No place data available yet"),badge:c("placeScope.noPlace.badge","No place"),connected:!1,folderUnresolved:!1,hasSyncMetadata:void 0,note:c("placeScope.noPlace.note","Connect WEPPY Plugin and sync a place to create place-scoped data.")}}function be(e,c,l){const n=typeof c=="number"?g(e,c):null,o=T(e),t=(n==null?void 0:n.placeId)??o,r=g(e,t);if(t===null)return{label:l("placeScope.noPlace.label","Place scope"),placeId:null,placeName:l("placeScope.noPlace.value","No place data available yet"),badge:l("placeScope.noPlace.badge","No place"),connected:!1,folderUnresolved:!1,hasSyncMetadata:void 0,note:l("placeScope.noPlace.note","Connect WEPPY Plugin and sync a place to create place-scoped data.")};const S=(r==null?void 0:r.isConnected)??!1,f=e.activePlaceId===t,p=t===e.lastActivePlaceId?e.lastActivePlaceName:null,b=f?e.activePlaceName:null,P=r?B(e.places,r.placeId):!1,v=l("placeScope.folder.unresolvedPlace","Place {placeId}").replace("{placeId}",String(t));return{label:f?l("placeScope.current.label","Current Place"):l("placeScope.selected.label","Selected Place"),placeId:t,placeName:b??p??(P?v:r==null?void 0:r.placeName)??l("placeScope.unknownPlace","Unknown place"),badge:S?l("placeScope.connected","Studio connected"):l("placeScope.stored","Stored data"),connected:S,folderUnresolved:P,hasSyncMetadata:r?D(e.places,r):void 0,note:S?null:l("placeScope.stored.note","No connected Studio currently has this place open.")}}function Se(e,c){switch(e){case"sync":return c("placeScope.surface.sync","Sync status and logs use this place.");case"changelog":return c("placeScope.surface.changelog","Changelog sessions use this place.");case"playtest":return c("placeScope.surface.playtest","Playtest reports use this place.");case"uiStudio":return c("placeScope.surface.uiStudio","UI captures and change history use this place.");case"tools":return c("placeScope.surface.tools","Tool history and statistics use this place.")}}function Le({surface:e,selectable:c=!1,selectedPlaceId:l=null,onSelectedPlaceIdChange:n}){const{t:o}=H(),[t,r]=u.useState(null),[S,f]=u.useState(!0),[p,b]=u.useState(null),P=u.useRef(null),v=u.useRef(null),E=u.useId();u.useEffect(()=>{let i=!1;async function N(){try{const k=await V();i||r(k)}catch{i||r(null)}finally{i||f(!1)}}return N(),()=>{i=!0}},[]),u.useEffect(()=>{if(!c||!t)return;const i=T(t);(typeof l!="number"||!g(t,l))&&l!==i&&(n==null||n(i))},[n,c,l,t]);const I=t?fe(t,c,l):null,h=t?M(t,I):null,_=`${I??"none"}:${h??"none"}`;if(u.useEffect(()=>{b(i=>i===_?i:null)},[_]),u.useEffect(()=>{function i(){b(null)}function N(w){var j;p!==null&&!((j=P.current)!=null&&j.contains(w.target))&&i()}function k(w){var j;p!==null&&w.key==="Escape"&&(w.preventDefault(),i(),(j=v.current)==null||j.focus())}return document.addEventListener("pointerdown",N),document.addEventListener("keydown",k),()=>{document.removeEventListener("pointerdown",N),document.removeEventListener("keydown",k)}},[p]),S)return a.jsx("div",{className:s.scope,"aria-live":"polite",children:a.jsx("span",{className:s.label,children:o("placeScope.loading","Loading place scope...")})});if(!t)return a.jsx("div",{className:s.scope,"aria-live":"polite",children:a.jsx("span",{className:s.label,children:o("placeScope.unavailable","Place scope unavailable")})});const d=c?be(t,l,o):he(t,o),m=z(t),x=typeof d.placeId=="number"?String(d.placeId):"",O=c&&t.places.length>0,W=M(t,d.placeId),q=ve(d.placeId,W,o),R=_,A=p===R;return a.jsxs("div",{className:s.scope,"aria-live":"polite",children:[a.jsxs("div",{className:s.main,children:[O?a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:s.selectorLabel,children:[a.jsx("span",{className:s.label,children:o("placeScope.selector.label","Place data")}),a.jsxs("select",{className:s.placeSelect,value:x,onChange:i=>{const N=Number.parseInt(i.currentTarget.value,10);b(null),n==null||n(Number.isInteger(N)?N:null)},children:[d.placeId===null?a.jsx("option",{value:"",disabled:!0,children:o("placeScope.selector.noneSelectable","No selectable Place folder")}):null,a.jsx(Q,{places:t.places,confirmedNames:m,t:o})]})]}),a.jsx("span",{className:s.label,children:d.label}),a.jsx("span",{className:s.name,children:d.placeName})]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:s.label,children:d.label}),a.jsx("span",{className:s.name,children:d.placeName})]}),d.placeId!==null?a.jsx("span",{className:s.id,children:d.placeId}):null,a.jsx(L,{variant:d.connected?"success":"neutral",shape:"pill",className:s.scopeBadge,children:d.badge}),d.folderUnresolved?a.jsx(L,{variant:"neutral",shape:"pill",className:s.scopeBadge,children:o("placeScope.folder.unresolved","Representative folder unconfirmed")}):null,d.hasSyncMetadata===!1?a.jsx(L,{variant:"neutral",shape:"pill",className:s.scopeBadge,children:o("placeScope.folder.noSyncHistory","No sync history")}):null]}),a.jsxs("div",{className:s.copy,children:[a.jsx("span",{children:Se(e,o)}),d.note?a.jsx("span",{className:s.note,children:d.note}):null]}),t.places.some(i=>U(i)==="duplicate"||U(i)==="unresolved")?a.jsx("div",{className:s.folderDetails,children:a.jsx(J,{places:t.places,t:o})}):null,q.length>0?a.jsxs("div",{className:s.shortcuts,ref:P,children:[a.jsxs("button",{ref:v,type:"button",className:s.shortcutsTrigger,"aria-controls":E,"aria-expanded":A,onClick:()=>{b(A?null:R)},children:[o("placeScope.shortcuts.trigger","Quick links"),a.jsx("span",{"aria-hidden":"true",children:"↗"})]}),A?a.jsx("div",{id:E,className:s.shortcutsPopover,role:"group","aria-label":o("placeScope.shortcuts.label","Place shortcuts"),children:q.map(i=>a.jsxs("a",{className:s.shortcutLink,href:i.href,target:"_blank",rel:"noopener noreferrer",children:[a.jsx("span",{children:i.label}),a.jsx("span",{"aria-hidden":"true",children:"↗"})]},i.href))}):null]}):null]})}const ge="_backdrop_1sgib_1",Pe="_dialog_1sgib_19",K={backdrop:ge,dialog:Pe},_e=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contenteditable="true"]','[tabindex]:not([tabindex="-1"])'].join(", ");function Ne(e){return Array.from(e.querySelectorAll(_e))}function xe(e){const c=document.activeElement;if(!(c instanceof HTMLElement))return!1;const l=c.closest('[role="dialog"][aria-modal="true"]');return l!==null&&l!==e}function Be({open:e,ariaLabel:c,onClose:l,returnFocusTo:n=null,initialFocusRef:o,dismissDisabled:t=!1,children:r,testId:S}){const f=u.useRef(null),p=u.useRef(l),b=u.useRef(t),P=u.useRef(null);return p.current=l,b.current=t,u.useEffect(()=>{if(!e)return;const v=f.current;if(!v)return;const E=document.body.style.overflow;P.current=n??(document.activeElement instanceof HTMLElement?document.activeElement:null),document.body.style.overflow="hidden",((o==null?void 0:o.current)??v).focus();const I=h=>{if(xe(v))return;if(h.key==="Escape"){h.preventDefault(),b.current||p.current();return}if(h.key!=="Tab")return;const _=Ne(v);if(_.length===0){h.preventDefault(),v.focus();return}const d=_[0],m=_[_.length-1],x=document.activeElement;h.shiftKey&&(x===d||!v.contains(x))?(h.preventDefault(),m.focus()):!h.shiftKey&&(x===m||!v.contains(x))&&(h.preventDefault(),d.focus())};return document.addEventListener("keydown",I),()=>{document.removeEventListener("keydown",I),document.body.style.overflow=E;const h=n??P.current;h&&document.contains(h)&&h.focus()}},[o,e,n]),e?G.createPortal(a.jsx("div",{className:K.backdrop,"data-testid":S,role:"presentation",onClick:v=>{v.target===v.currentTarget&&!t&&p.current()},children:a.jsx("section",{ref:f,className:K.dialog,role:"dialog","aria-modal":"true","aria-label":c,tabIndex:-1,children:r})}),document.body):null}const Ie="_tabBar_jefog_2",je="_tabs_jefog_9",ye="_actions_jefog_14",Ee="_tab_jefog_2",me="_tabActive_jefog_52",y={tabBar:Ie,tabs:je,actions:ye,tab:Ee,tabActive:me};function De({items:e,value:c,onChange:l,ariaLabel:n,className:o,rightActions:t}){const r=u.useRef(null),S=u.useRef(null);return u.useEffect(()=>{const f=()=>{const p=r.current,b=S.current;!p||!b||typeof p.scrollTo!="function"||p.scrollTo({left:Math.max(0,b.offsetLeft+b.offsetWidth/2-p.clientWidth/2),behavior:"auto"})};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[c]),a.jsxs("div",{ref:r,className:[y.tabBar,o].filter(Boolean).join(" "),role:"tablist","aria-label":n,children:[a.jsx("div",{className:y.tabs,children:e.map(f=>{const p=f.key===c;return a.jsx("button",{ref:p?S:void 0,type:"button",role:"tab","aria-selected":p,"data-testid":f.testId,className:[y.tab,p?y.tabActive:""].filter(Boolean).join(" "),onClick:()=>l(f.key),children:f.label},f.key)})}),t?a.jsx("div",{className:y.actions,children:t}):null]})}export{Be as C,De as T,Le as a};
1
+ import{u as H,r as u,j as a,B as z,C as U,g as V,v as Y,o as F,p as B,q as D,x as G}from"./index-B1SnAt0o.js";import{B as L}from"./PageHeader-QiUV3oJs.js";import{P as Q,a as J}from"./PlaceSelectOptions-BArB7wnB.js";const X="_scope_1i8qy_1",Z="_main_1i8qy_13",ee="_label_1i8qy_22",ce="_selectorLabel_1i8qy_30",le="_placeSelect_1i8qy_38",ae="_name_1i8qy_54",te="_id_1i8qy_65",ne="_scopeBadge_1i8qy_72",oe="_copy_1i8qy_76",se="_note_1i8qy_88",re="_folderDetails_1i8qy_92",ie="_shortcuts_1i8qy_96",de="_shortcutsTrigger_1i8qy_103",pe="_shortcutLink_1i8qy_126",ue="_shortcutsPopover_1i8qy_131",s={scope:X,main:Z,label:ee,selectorLabel:ce,placeSelect:le,name:ae,id:te,scopeBadge:ne,copy:oe,note:se,folderDetails:re,shortcuts:ie,shortcutsTrigger:de,shortcutLink:pe,shortcutsPopover:ue};function C(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}function g(e,c){return F(e.places,c)}function $(e){var c;return e.lastActivePlaceId!==null?e.lastActivePlaceId:((c=e.places[0])==null?void 0:c.placeId)??null}function T(e){var c;if(e.pluginConnected&&e.activePlaceId!==null){const l=e.places.filter(n=>n.placeId===e.activePlaceId);if(g(e,e.activePlaceId)||l.length===0)return e.activePlaceId}if(e.lastActivePlaceId!==null){const l=e.places.filter(n=>n.placeId===e.lastActivePlaceId);if(g(e,e.lastActivePlaceId)||l.length===0)return e.lastActivePlaceId}return((c=Y(e.places))==null?void 0:c.placeId)??null}function fe(e,c,l){var n;return c?((n=g(e,typeof l=="number"?l:null))==null?void 0:n.placeId)??T(e):e.pluginConnected&&e.activePlaceId!==null?e.activePlaceId:$(e)}function M(e,c){const l=g(e,c);return(l==null?void 0:l.universeId)!==void 0?l.universeId:c===e.activePlaceId?e.activeUniverseId??null:c===e.lastActivePlaceId?e.lastActiveUniverseId??null:null}function ve(e,c,l){if(!C(e))return[];const n=[];return C(c)&&n.push({label:l("placeScope.shortcuts.settings","Place settings"),href:`https://create.roblox.com/dashboard/creations/experiences/${c}/places/${e}/configure`},{label:l("placeScope.shortcuts.experience","Experience management"),href:`https://create.roblox.com/dashboard/creations/experiences/${c}/overview`}),n.push({label:l("placeScope.shortcuts.roblox","View on Roblox"),href:`https://www.roblox.com/games/${e}`}),n}function he(e,c){if(e.pluginConnected&&e.activePlaceId!==null){const o=g(e,e.activePlaceId),t=o?B(e.places,o.placeId):!1,r=c("placeScope.folder.unresolvedPlace","Place {placeId}").replace("{placeId}",String(e.activePlaceId));return{label:c("placeScope.current.label","Current Place"),placeId:e.activePlaceId,placeName:e.activePlaceName??(t?r:o==null?void 0:o.placeName)??c("placeScope.unknownPlace","Unknown place"),badge:c("placeScope.connected","Studio connected"),connected:(o==null?void 0:o.isConnected)??!0,folderUnresolved:t,hasSyncMetadata:o?D(e.places,o):void 0,note:null}}const l=$(e),n=g(e,l);if(l!==null){const o=l===e.lastActivePlaceId?e.lastActivePlaceName:null,t=n?B(e.places,n.placeId):!1,r=c("placeScope.folder.unresolvedPlace","Place {placeId}").replace("{placeId}",String(l));return{label:c("placeScope.lastActive.label","Last Active Place"),placeId:l,placeName:o??(t?r:n==null?void 0:n.placeName)??c("placeScope.unknownPlace","Unknown place"),badge:c("placeScope.stored","Stored data"),connected:!1,folderUnresolved:t,hasSyncMetadata:n?D(e.places,n):void 0,note:c("placeScope.stored.note","No connected Studio currently has this place open.")}}return{label:c("placeScope.noPlace.label","Place scope"),placeId:null,placeName:c("placeScope.noPlace.value","No place data available yet"),badge:c("placeScope.noPlace.badge","No place"),connected:!1,folderUnresolved:!1,hasSyncMetadata:void 0,note:c("placeScope.noPlace.note","Connect WEPPY Plugin and sync a place to create place-scoped data.")}}function be(e,c,l){const n=typeof c=="number"?g(e,c):null,o=T(e),t=(n==null?void 0:n.placeId)??o,r=g(e,t);if(t===null)return{label:l("placeScope.noPlace.label","Place scope"),placeId:null,placeName:l("placeScope.noPlace.value","No place data available yet"),badge:l("placeScope.noPlace.badge","No place"),connected:!1,folderUnresolved:!1,hasSyncMetadata:void 0,note:l("placeScope.noPlace.note","Connect WEPPY Plugin and sync a place to create place-scoped data.")};const S=(r==null?void 0:r.isConnected)??!1,f=e.activePlaceId===t,p=t===e.lastActivePlaceId?e.lastActivePlaceName:null,b=f?e.activePlaceName:null,P=r?B(e.places,r.placeId):!1,v=l("placeScope.folder.unresolvedPlace","Place {placeId}").replace("{placeId}",String(t));return{label:f?l("placeScope.current.label","Current Place"):l("placeScope.selected.label","Selected Place"),placeId:t,placeName:b??p??(P?v:r==null?void 0:r.placeName)??l("placeScope.unknownPlace","Unknown place"),badge:S?l("placeScope.connected","Studio connected"):l("placeScope.stored","Stored data"),connected:S,folderUnresolved:P,hasSyncMetadata:r?D(e.places,r):void 0,note:S?null:l("placeScope.stored.note","No connected Studio currently has this place open.")}}function Se(e,c){switch(e){case"sync":return c("placeScope.surface.sync","Sync status and logs use this place.");case"changelog":return c("placeScope.surface.changelog","Changelog sessions use this place.");case"playtest":return c("placeScope.surface.playtest","Playtest reports use this place.");case"uiStudio":return c("placeScope.surface.uiStudio","UI captures and change history use this place.");case"tools":return c("placeScope.surface.tools","Tool history and statistics use this place.")}}function Le({surface:e,selectable:c=!1,selectedPlaceId:l=null,onSelectedPlaceIdChange:n}){const{t:o}=H(),[t,r]=u.useState(null),[S,f]=u.useState(!0),[p,b]=u.useState(null),P=u.useRef(null),v=u.useRef(null),E=u.useId();u.useEffect(()=>{let i=!1;async function N(){try{const k=await V();i||r(k)}catch{i||r(null)}finally{i||f(!1)}}return N(),()=>{i=!0}},[]),u.useEffect(()=>{if(!c||!t)return;const i=T(t);(typeof l!="number"||!g(t,l))&&l!==i&&(n==null||n(i))},[n,c,l,t]);const I=t?fe(t,c,l):null,h=t?M(t,I):null,_=`${I??"none"}:${h??"none"}`;if(u.useEffect(()=>{b(i=>i===_?i:null)},[_]),u.useEffect(()=>{function i(){b(null)}function N(w){var j;p!==null&&!((j=P.current)!=null&&j.contains(w.target))&&i()}function k(w){var j;p!==null&&w.key==="Escape"&&(w.preventDefault(),i(),(j=v.current)==null||j.focus())}return document.addEventListener("pointerdown",N),document.addEventListener("keydown",k),()=>{document.removeEventListener("pointerdown",N),document.removeEventListener("keydown",k)}},[p]),S)return a.jsx("div",{className:s.scope,"aria-live":"polite",children:a.jsx("span",{className:s.label,children:o("placeScope.loading","Loading place scope...")})});if(!t)return a.jsx("div",{className:s.scope,"aria-live":"polite",children:a.jsx("span",{className:s.label,children:o("placeScope.unavailable","Place scope unavailable")})});const d=c?be(t,l,o):he(t,o),m=z(t),x=typeof d.placeId=="number"?String(d.placeId):"",O=c&&t.places.length>0,W=M(t,d.placeId),q=ve(d.placeId,W,o),R=_,A=p===R;return a.jsxs("div",{className:s.scope,"aria-live":"polite",children:[a.jsxs("div",{className:s.main,children:[O?a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:s.selectorLabel,children:[a.jsx("span",{className:s.label,children:o("placeScope.selector.label","Place data")}),a.jsxs("select",{className:s.placeSelect,value:x,onChange:i=>{const N=Number.parseInt(i.currentTarget.value,10);b(null),n==null||n(Number.isInteger(N)?N:null)},children:[d.placeId===null?a.jsx("option",{value:"",disabled:!0,children:o("placeScope.selector.noneSelectable","No selectable Place folder")}):null,a.jsx(Q,{places:t.places,confirmedNames:m,t:o})]})]}),a.jsx("span",{className:s.label,children:d.label}),a.jsx("span",{className:s.name,children:d.placeName})]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:s.label,children:d.label}),a.jsx("span",{className:s.name,children:d.placeName})]}),d.placeId!==null?a.jsx("span",{className:s.id,children:d.placeId}):null,a.jsx(L,{variant:d.connected?"success":"neutral",shape:"pill",className:s.scopeBadge,children:d.badge}),d.folderUnresolved?a.jsx(L,{variant:"neutral",shape:"pill",className:s.scopeBadge,children:o("placeScope.folder.unresolved","Representative folder unconfirmed")}):null,d.hasSyncMetadata===!1?a.jsx(L,{variant:"neutral",shape:"pill",className:s.scopeBadge,children:o("placeScope.folder.noSyncHistory","No sync history")}):null]}),a.jsxs("div",{className:s.copy,children:[a.jsx("span",{children:Se(e,o)}),d.note?a.jsx("span",{className:s.note,children:d.note}):null]}),t.places.some(i=>U(i)==="duplicate"||U(i)==="unresolved")?a.jsx("div",{className:s.folderDetails,children:a.jsx(J,{places:t.places,t:o})}):null,q.length>0?a.jsxs("div",{className:s.shortcuts,ref:P,children:[a.jsxs("button",{ref:v,type:"button",className:s.shortcutsTrigger,"aria-controls":E,"aria-expanded":A,onClick:()=>{b(A?null:R)},children:[o("placeScope.shortcuts.trigger","Quick links"),a.jsx("span",{"aria-hidden":"true",children:"↗"})]}),A?a.jsx("div",{id:E,className:s.shortcutsPopover,role:"group","aria-label":o("placeScope.shortcuts.label","Place shortcuts"),children:q.map(i=>a.jsxs("a",{className:s.shortcutLink,href:i.href,target:"_blank",rel:"noopener noreferrer",children:[a.jsx("span",{children:i.label}),a.jsx("span",{"aria-hidden":"true",children:"↗"})]},i.href))}):null]}):null]})}const ge="_backdrop_1sgib_1",Pe="_dialog_1sgib_19",K={backdrop:ge,dialog:Pe},_e=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contenteditable="true"]','[tabindex]:not([tabindex="-1"])'].join(", ");function Ne(e){return Array.from(e.querySelectorAll(_e))}function xe(e){const c=document.activeElement;if(!(c instanceof HTMLElement))return!1;const l=c.closest('[role="dialog"][aria-modal="true"]');return l!==null&&l!==e}function Be({open:e,ariaLabel:c,onClose:l,returnFocusTo:n=null,initialFocusRef:o,dismissDisabled:t=!1,children:r,testId:S}){const f=u.useRef(null),p=u.useRef(l),b=u.useRef(t),P=u.useRef(null);return p.current=l,b.current=t,u.useEffect(()=>{if(!e)return;const v=f.current;if(!v)return;const E=document.body.style.overflow;P.current=n??(document.activeElement instanceof HTMLElement?document.activeElement:null),document.body.style.overflow="hidden",((o==null?void 0:o.current)??v).focus();const I=h=>{if(xe(v))return;if(h.key==="Escape"){h.preventDefault(),b.current||p.current();return}if(h.key!=="Tab")return;const _=Ne(v);if(_.length===0){h.preventDefault(),v.focus();return}const d=_[0],m=_[_.length-1],x=document.activeElement;h.shiftKey&&(x===d||!v.contains(x))?(h.preventDefault(),m.focus()):!h.shiftKey&&(x===m||!v.contains(x))&&(h.preventDefault(),d.focus())};return document.addEventListener("keydown",I),()=>{document.removeEventListener("keydown",I),document.body.style.overflow=E;const h=n??P.current;h&&document.contains(h)&&h.focus()}},[o,e,n]),e?G.createPortal(a.jsx("div",{className:K.backdrop,"data-testid":S,role:"presentation",onClick:v=>{v.target===v.currentTarget&&!t&&p.current()},children:a.jsx("section",{ref:f,className:K.dialog,role:"dialog","aria-modal":"true","aria-label":c,tabIndex:-1,children:r})}),document.body):null}const Ie="_tabBar_jefog_2",je="_tabs_jefog_9",ye="_actions_jefog_14",Ee="_tab_jefog_2",me="_tabActive_jefog_52",y={tabBar:Ie,tabs:je,actions:ye,tab:Ee,tabActive:me};function De({items:e,value:c,onChange:l,ariaLabel:n,className:o,rightActions:t}){const r=u.useRef(null),S=u.useRef(null);return u.useEffect(()=>{const f=()=>{const p=r.current,b=S.current;!p||!b||typeof p.scrollTo!="function"||p.scrollTo({left:Math.max(0,b.offsetLeft+b.offsetWidth/2-p.clientWidth/2),behavior:"auto"})};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[c]),a.jsxs("div",{ref:r,className:[y.tabBar,o].filter(Boolean).join(" "),role:"tablist","aria-label":n,children:[a.jsx("div",{className:y.tabs,children:e.map(f=>{const p=f.key===c;return a.jsx("button",{ref:p?S:void 0,type:"button",role:"tab","aria-selected":p,"data-testid":f.testId,className:[y.tab,p?y.tabActive:""].filter(Boolean).join(" "),onClick:()=>l(f.key),children:f.label},f.key)})}),t?a.jsx("div",{className:y.actions,children:t}):null]})}export{Be as C,De as T,Le as a};
@@ -1 +1 @@
1
- import{a as m,c as d,y as h,j as n}from"./index-CbTOKOZ5.js";const x="_actions_z7b39_60",f="_btn_z7b39_68",j="_btnPrimary_z7b39_99",z="_panel_z7b39_109",y="_panelIcon_z7b39_116",I="_panelTitle_z7b39_122",N="_panelDesc_z7b39_132",u="_benefitList_z7b39_140",v="_benefitItem_z7b39_149",e={actions:x,btn:f,btnPrimary:j,panel:z,panelIcon:y,panelTitle:I,panelDesc:N,benefitList:u,benefitItem:v};function g({icon:a,title:s,description:c,benefits:l,upgradeLabel:i,upgradeHref:r}){const{trackEvent:o}=m(),{pathname:_,search:b}=d(),p=h(_,b);return n.jsxs("div",{className:e.panel,children:[a&&n.jsx("div",{className:e.panelIcon,children:a}),n.jsx("div",{className:e.panelTitle,children:s}),n.jsx("div",{className:e.panelDesc,children:c}),n.jsx("ul",{className:e.benefitList,children:l.map(t=>n.jsx("li",{className:e.benefitItem,children:t},t))}),n.jsx("div",{className:e.actions,children:n.jsx("a",{className:`${e.btn} ${e.btnPrimary}`,href:r,target:"_blank",rel:"noreferrer",onClick:()=>o("dashboard_click_event",{click_target:"upgrade_cta",placement:"tier_panel",...p}),children:i})})]})}export{g as T};
1
+ import{a as m,c as d,y as h,j as n}from"./index-B1SnAt0o.js";const x="_actions_z7b39_60",f="_btn_z7b39_68",j="_btnPrimary_z7b39_99",z="_panel_z7b39_109",y="_panelIcon_z7b39_116",I="_panelTitle_z7b39_122",N="_panelDesc_z7b39_132",u="_benefitList_z7b39_140",v="_benefitItem_z7b39_149",e={actions:x,btn:f,btnPrimary:j,panel:z,panelIcon:y,panelTitle:I,panelDesc:N,benefitList:u,benefitItem:v};function g({icon:a,title:s,description:c,benefits:l,upgradeLabel:i,upgradeHref:r}){const{trackEvent:o}=m(),{pathname:_,search:b}=d(),p=h(_,b);return n.jsxs("div",{className:e.panel,children:[a&&n.jsx("div",{className:e.panelIcon,children:a}),n.jsx("div",{className:e.panelTitle,children:s}),n.jsx("div",{className:e.panelDesc,children:c}),n.jsx("ul",{className:e.benefitList,children:l.map(t=>n.jsx("li",{className:e.benefitItem,children:t},t))}),n.jsx("div",{className:e.actions,children:n.jsx("a",{className:`${e.btn} ${e.btnPrimary}`,href:r,target:"_blank",rel:"noreferrer",onClick:()=>o("dashboard_click_event",{click_target:"upgrade_cta",placement:"tier_panel",...p}),children:i})})]})}export{g as T};