@weppy/roblox-mcp 2.17.20 → 2.17.22

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 (47) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dashboard/dist/assets/AiPromptExamples-CQGYhsSq.js +1 -0
  3. package/dashboard/dist/assets/{AssetsPage-CAyaS2og.js → AssetsPage-tnh7G0oI.js} +1 -1
  4. package/dashboard/dist/assets/{ChangelogPage-3HMHHgjw.js → ChangelogPage-niZk_9S5.js} +1 -1
  5. package/dashboard/dist/assets/{ConfirmModal-DtH41UBe.js → ConfirmModal-BSuAB3WU.js} +1 -1
  6. package/dashboard/dist/assets/{ConnectionPage-DEKNG3dL.js → ConnectionPage-4Bu7ELYr.js} +1 -1
  7. package/dashboard/dist/assets/{ContentScopedDialog-CO7HgbDh.js → ContentScopedDialog-BZBRfU-h.js} +1 -1
  8. package/dashboard/dist/assets/{ControlsPage-DALL8aLL.js → ControlsPage-CMQLZIv5.js} +1 -1
  9. package/dashboard/dist/assets/{DialogHeader-DGlG63xP.js → DialogHeader-DYe1ZbDg.js} +1 -1
  10. package/dashboard/dist/assets/{GameChangeDetail-DWovwQok.js → GameChangeDetail-C3zrRv4g.js} +1 -1
  11. package/dashboard/dist/assets/{InfoLabel-CH5CpR7R.js → InfoLabel-C9QuVrs9.js} +1 -1
  12. package/dashboard/dist/assets/{OverviewPage-C3wYZrG8.js → OverviewPage-CI3l2Ay4.js} +1 -1
  13. package/dashboard/dist/assets/{PageHeader-DfhSm4j-.js → PageHeader-plAaGWcw.js} +1 -1
  14. package/dashboard/dist/assets/{PlaceSelectOptions-CMtQalSy.js → PlaceSelectOptions-Bh6TVGoa.js} +1 -1
  15. package/dashboard/dist/assets/{PlaytestAiPromptExamples-DJFxefZu.js → PlaytestAiPromptExamples-CV1U6nF6.js} +1 -1
  16. package/dashboard/dist/assets/{PlaytestPage-DU9ZdQ21.js → PlaytestPage-BgG_4l9a.js} +17 -22
  17. package/dashboard/dist/assets/SettingsPage-CKqiItPX.js +23 -0
  18. package/dashboard/dist/assets/{SyncPage-D_yCFS3B.js → SyncPage-k_67oQ0S.js} +1 -1
  19. package/dashboard/dist/assets/{Tabs-D9FkOjPv.js → Tabs-BDAljzT9.js} +1 -1
  20. package/dashboard/dist/assets/{TierPromoPanel-e1H_6c6Z.js → TierPromoPanel-DUwTC3Zz.js} +1 -1
  21. package/dashboard/dist/assets/{ToolsPage-CKfktddT.js → ToolsPage-RoWl4i2b.js} +1 -1
  22. package/dashboard/dist/assets/{TooltipText-DSn3s49K.js → TooltipText-Btgvmrqc.js} +1 -1
  23. package/dashboard/dist/assets/{UiStudioPage-DmWjv22S.css → UiStudioPage-SojeKPNs.css} +1 -1
  24. package/dashboard/dist/assets/UiStudioPage-Tbo30itW.js +23 -0
  25. package/dashboard/dist/assets/WhatsNewPage-C4uGwv-a.css +1 -0
  26. package/dashboard/dist/assets/WhatsNewPage-n-lW5_0g.js +1 -0
  27. package/dashboard/dist/assets/{bot-BQBLv2uC.js → bot-Cw9-c1xX.js} +1 -1
  28. package/dashboard/dist/assets/{check-uNk3Ma2d.js → check-D8GciAv-.js} +1 -1
  29. package/dashboard/dist/assets/{copy-D8MSHyQE.js → copy-CcmKRqlO.js} +1 -1
  30. package/dashboard/dist/assets/index-CfT3smRY.js +900 -0
  31. package/dashboard/dist/assets/{index-VXvX8jPK.css → index-CrljkNgf.css} +1 -1
  32. package/dashboard/dist/assets/{rotate-ccw-Dwy8_z07.js → rotate-ccw-B9h7F-0m.js} +1 -1
  33. package/dashboard/dist/assets/{sample-requests-x7wuDmFr.js → sample-requests-cbyN06Aw.js} +1 -1
  34. package/dashboard/dist/assets/{trash-2-Cw-jysM1.js → trash-2-ElF9PcCM.js} +1 -1
  35. package/dashboard/dist/assets/{useLiveUptime-BEJbC8rw.js → useLiveUptime-CXdR7Bos.js} +1 -1
  36. package/dashboard/dist/assets/useSettings-DhD_vaHX.js +2 -0
  37. package/dashboard/dist/index.html +2 -2
  38. package/dist/index.js +165 -518
  39. package/package.json +1 -1
  40. package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
  41. package/dashboard/dist/assets/AiPromptExamples-BLQgKnq1.js +0 -1
  42. package/dashboard/dist/assets/SettingsPage-OMdBse7E.js +0 -23
  43. package/dashboard/dist/assets/UiStudioPage-DD_9F7Lm.js +0 -11
  44. package/dashboard/dist/assets/WhatsNewPage-BmnQR1Zm.js +0 -1
  45. package/dashboard/dist/assets/WhatsNewPage-WMbbAUsL.css +0 -1
  46. package/dashboard/dist/assets/index-CJYQedSN.js +0 -858
  47. package/dashboard/dist/assets/useSettings-PZ2Tx5jE.js +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weppy/roblox-mcp",
3
- "version": "2.17.20",
3
+ "version": "2.17.22",
4
4
  "description": "MCP (Model Context Protocol) server for Roblox Studio integration - enables AI coding agents to interact with Roblox Studio in real-time",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
Binary file
@@ -1 +0,0 @@
1
- import{r as i,j as t}from"./index-CJYQedSN.js";import{C as d}from"./copy-D8MSHyQE.js";const _="_examples_1sykl_1",m="_example_1sykl_1",h="_request_1sykl_15",j="_nextStep_1sykl_16",b="_actionRow_1sykl_40",f="_copyButton_1sykl_47",k="_success_1sykl_79",w="_error_1sykl_80",c={examples:_,example:m,request:h,nextStep:j,actionRow:b,copyButton:f,success:k,error:w};function N(s){const[p,a]=i.useState({}),n=i.useRef(0),x=s.examples.map(e=>e.id).join("|");i.useEffect(()=>(n.current+=1,a({}),()=>{n.current+=1}),[x,s.resetKey]);const y=async(e,r)=>{var u;const l=++n.current;a(o=>({...o,[e]:"copying"}));try{if(!((u=navigator.clipboard)!=null&&u.writeText))throw new Error("clipboard_unavailable");if(await navigator.clipboard.writeText(r),l!==n.current)return;a(o=>({...o,[e]:"copied"}))}catch{if(l!==n.current)return;a(o=>({...o,[e]:"error"}))}};return t.jsxs("div",{className:c.examples,children:[s.examples.map(e=>{const r=p[e.id]??"idle";return t.jsxs("section",{className:c.example,children:[t.jsx("h4",{children:e.title}),t.jsx("p",{className:c.request,children:e.request}),t.jsxs("div",{className:c.actionRow,children:[t.jsxs("button",{type:"button",className:c.copyButton,disabled:r==="copying",onClick:()=>void y(e.id,e.request),children:[t.jsx(d,{size:14,"aria-hidden":"true"}),r==="copying"?s.labels.copying:s.labels.copy]}),r==="copied"&&t.jsx("span",{className:c.success,role:"status",children:s.labels.copied})]}),r==="error"&&t.jsx("p",{className:c.error,role:"alert",children:s.labels.copyFailed})]},e.id)}),s.nextStep&&t.jsx("p",{className:c.nextStep,children:s.nextStep})]})}export{N as A};
@@ -1,23 +0,0 @@
1
- import{c as re,u as Q,s as Pe,j as e,a as we,b as Se,r,R as Re,H as ye,K as He,T as ze,d as Y,g as De,e as Ae,A as $e,S as Be}from"./index-CJYQedSN.js";import{C as Ee}from"./ContentScopedDialog-CO7HgbDh.js";import{D as Te}from"./DialogHeader-DGlG63xP.js";import{C as he}from"./ConfirmModal-DtH41UBe.js";import{l as Me,m as Ie,c as Ue,s as a,u as Fe}from"./useSettings-PZ2Tx5jE.js";import{C as je}from"./check-uNk3Ma2d.js";import{T as Oe}from"./trash-2-Cw-jysM1.js";import{C as qe}from"./copy-D8MSHyQE.js";import{C as We,P as Ye}from"./PageHeader-DfhSm4j-.js";import{I as F}from"./InfoLabel-CH5CpR7R.js";import{T as v}from"./TooltipText-DSn3s49K.js";import{D as Ce,f as _e,r as Ge,s as Ke,a as Ne,d as ie,S as le,b as Ve}from"./sample-requests-x7wuDmFr.js";import"./ConfirmModal.module-DJksQHBd.js";/**
2
- * @license lucide-react v1.8.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const Ze=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],de=re("life-buoy",Ze);/**
7
- * @license lucide-react v1.8.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const Je=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Qe=re("mail",Je);/**
12
- * @license lucide-react v1.8.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const Xe=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],ue=re("shield-alert",Xe);/**
17
- * @license lucide-react v1.8.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const et=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],tt=re("shield-check",et),st="_details_mi07g_1",at="_reference_mi07g_6",fe={details:st,reference:at};function ot({value:t}){const{t:s}=Q(),i=Pe(t);if(!i)return null;const c=i.traceId??i.clientOperationId??i.requestId;return e.jsxs("details",{className:fe.details,children:[e.jsx("summary",{children:s("settings.license.ux.technical","Technical details")}),e.jsxs("dl",{children:[e.jsx("dt",{children:s("settings.license.ux.code","Diagnostic code")}),e.jsx("dd",{children:e.jsx("code",{children:i.code})}),i.stage&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:s("settings.license.ux.stage","Processing stage")}),e.jsx("dd",{children:e.jsx("code",{children:i.stage})})]}),c&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:s(i.traceId?"settings.license.ux.serverId":"settings.license.ux.localId",i.traceId?"Server trace ID":"Local request ID")}),e.jsx("dd",{children:e.jsx("code",{className:fe.reference,children:c})})]})]}),!i.traceId&&e.jsx("p",{children:s("settings.license.localReference","Local request only; no server trace was received.")})]})}const nt="_card_if7f5_1",it="_header_if7f5_2",rt="_eyebrow_if7f5_3",ct="_connection_if7f5_4",lt="_hero_if7f5_5",dt="_stateCopy_if7f5_8",ut="_stateLine_if7f5_9",pt="_inlineStatus_if7f5_10",ht="_emblem_if7f5_11",gt="_pro_if7f5_12",mt="_notice_if7f5_13",yt="_problem_if7f5_16",jt="_metadata_if7f5_17",ft="_actions_if7f5_22",xt="_dialogBody_if7f5_23",vt="_supportActions_if7f5_23",bt="_more_if7f5_25",St="_primary_if7f5_27",Ct="_changeKey_if7f5_29",_t="_danger_if7f5_32",Nt="_keyForm_if7f5_33",kt="_field_if7f5_37",Lt="_plans_if7f5_39",Pt="_issueDot_if7f5_40",wt="_historyToolbar_if7f5_43",Rt="_historyList_if7f5_44",Ht="_recordHeader_if7f5_46",zt="_goodIcon_if7f5_49",Dt="_badIcon_if7f5_50",At="_empty_if7f5_51",$t="_supportLead_if7f5_53",Bt="_supportFooter_if7f5_60",Et="_spin_if7f5_61",j={card:nt,header:it,eyebrow:rt,connection:ct,hero:lt,stateCopy:dt,stateLine:ut,inlineStatus:pt,emblem:ht,pro:gt,notice:mt,problem:yt,metadata:jt,actions:ft,dialogBody:xt,supportActions:vt,more:bt,primary:St,changeKey:Ct,danger:_t,keyForm:Nt,field:kt,plans:Lt,issueDot:Pt,historyToolbar:wt,historyList:Rt,recordHeader:Ht,goodIcon:zt,badIcon:Dt,empty:At,supportLead:$t,supportFooter:Bt,spin:Et};function Tt(t){return t.replace(/(?:WEPPY_-)?[A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-F0-9]{12}|[A-F0-9]{8}(?:-[A-F0-9]{8}){3}|(?:ls3|st|v1)\.[A-Za-z0-9_.-]+/gi,"[redacted]")}function Mt({license:t,records:s,disabled:i,submitting:c,targeted:n,cardRef:L,inputRef:o,activate:y,refresh:m,reset:z}){const{t:f,locale:P}=Q(),{status:S}=we(),{trackEvent:M}=Se(),[x,_]=r.useState(""),[E,D]=r.useState(!1),[h,w]=r.useState(null),[N,g]=r.useState(!1),[R,$]=r.useState(""),[b,U]=r.useState("idle"),H=r.useRef(null),I=r.useRef(null),G=s.find(C=>C.operation!=="status"),T=Me(t,G),B=(t==null?void 0:t.tier)==="pro",O=!["active","required","reset"].includes(T),q=!!t&&(t.status!=="unlicensed"||t.refreshBlockedReason==="missing_session_token"),d=q&&(t==null?void 0:t.refreshBlockedReason)!=="missing_session_token",k=(t==null?void 0:t.provisional)&&!B&&d&&t.status!=="invalid"&&t.status!=="revoked"&&T!=="invalid"&&T!=="revoked",J=q||!!(t!=null&&t.maskedKey)&&t.status!=="unlicensed",K=q?Ie(t==null?void 0:t.maskedKey):void 0,u=t!=null&&t.checkedAt?new Date(t.checkedAt*1e3).toLocaleString(P):null,A=`MCP ${(S==null?void 0:S.version)??"-"} · Node ${(S==null?void 0:S.nodeVersion)??"-"} · ${navigator.platform||"Browser"}`,W=r.useMemo(()=>Ue(t,s,A),[t,s,A]),ae=`${Tt(R.trim())}${R.trim()?`
22
-
23
- `:""}${W}`,V=`mailto:support@weppyai.com?subject=${encodeURIComponent("WEPPY license support")}&body=${encodeURIComponent(ae)}`,p=(C,ce)=>f(`settings.license.ux.${C}`,ce),ge={active:"Your license is ready to use.",required:"Enter your license key to get started.",invalid:"We could not verify this license key.",revoked:"This license no longer provides Pro access.",connection:"We could not complete this license check.",unavailable:"Your license needs to be checked.",reset:"The license has been removed from this installation."}[T],ke={invalid:"Check that you copied the full key from your purchase, then try again.",revoked:"Check your purchase or contact support for help with this license.",connection:"Check your connection and try again. If it continues, contact support."}[T]??"Enter your license key again. If the problem continues, contact support.",me=()=>{w(null),U("idle")};async function Le(){try{await navigator.clipboard.writeText(ae),U("copied")}catch{U("manual")}}return e.jsxs(e.Fragment,{children:[e.jsxs("div",{id:"settings-license",ref:L,tabIndex:-1,"data-testid":"settings-license-card",className:[a.card,j.card,B?a.licenseCardPro:"",n?a.licenseCardTarget:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:j.header,children:[e.jsx("span",{className:j.eyebrow,children:f("settings.license.title","License")}),e.jsx("span",{className:j.connection,children:i?f("settings.license.disconnected","Disconnected"):p("connected","Connected")})]}),e.jsxs("div",{className:j.hero,children:[e.jsx("span",{className:`${j.emblem} ${B?j.pro:""}`,children:B?e.jsx(tt,{size:22}):e.jsx(ue,{size:22})}),e.jsxs("div",{className:j.stateCopy,children:[e.jsxs("div",{className:j.stateLine,children:[e.jsx("h2",{children:B?p("usingPro","Pro is ready"):p("usingBasic","Basic is ready")}),!O&&T!=="required"&&e.jsxs("span",{className:j.inlineStatus,role:"status",children:[e.jsx(je,{size:14}),p(`notice.${T}`,ge)]})]}),!B&&!O&&e.jsx("p",{children:T==="required"?p("notice.required","Enter your license key to get started."):p("basicDescription","Activate a license to use Pro features.")})]})]}),O&&e.jsxs("div",{className:`${j.notice} ${j.problem}`,role:"alert",children:[e.jsx(ue,{size:18}),e.jsxs("div",{children:[e.jsx("strong",{children:p(`notice.${T}`,ge)}),e.jsxs("p",{children:[k?p("help.recheck","Select Check license to verify your saved license. If the problem continues, contact support."):p(`help.${T}`,ke),B&&` ${p("accessUnchanged","Your existing Pro access is still available.")}`]})]})]}),(t==null?void 0:t.statusDetail)==="active_cancel_pending"&&e.jsx("p",{className:j.supportFooter,children:f("settings.license.detail.cancelPending","Cancellation is scheduled. Pro access remains active until the current billing period ends.")}),e.jsxs("dl",{className:j.metadata,children:[e.jsxs("div",{children:[e.jsx("dt",{children:f("settings.license.provider","Provider")}),e.jsx("dd",{children:t!=null&&t.provider&&t.provider!=="auto"?t.provider==="gumroad"?"Gumroad":t.provider==="polar"?"Polar":"WEPPY":"—"})]}),e.jsxs("div",{children:[e.jsx("dt",{children:f("settings.license.key","Key")}),e.jsx("dd",{children:e.jsx("code",{children:K??"—"})})]}),e.jsxs("div",{children:[e.jsx("dt",{children:p("lastCheck","Last checked")}),e.jsx("dd",{children:u??p("notChecked","Not checked yet")})]})]}),e.jsxs("div",{className:j.actions,children:[e.jsxs("button",{className:B?j.primary:void 0,disabled:i||c||!d,onClick:()=>void m(),children:[e.jsx(Re,{size:15,className:c?j.spin:""}),f("settings.license.refresh","Check license")]}),e.jsxs("button",{ref:H,onClick:()=>w("history"),children:[e.jsx(ye,{size:15}),p("history","Diagnostic history"),G&&!G.success&&e.jsx("span",{className:j.issueDot})]}),e.jsxs("button",{ref:I,onClick:()=>w("support"),children:[e.jsx(de,{size:15}),p("support","Contact support")]}),B&&!E&&e.jsxs("button",{className:j.changeKey,disabled:i||c,onClick:()=>{D(!0),setTimeout(()=>{var C;return(C=o.current)==null?void 0:C.focus()},0)},children:[e.jsx(He,{size:14}),p("changeKey","Use a different key")]}),e.jsxs("details",{className:j.more,children:[e.jsx("summary",{children:p("more","More")}),e.jsxs("button",{className:j.danger,disabled:i||c||!J,onClick:()=>g(!0),children:[e.jsx(Oe,{size:14}),f("settings.license.reset","Remove registration")]})]})]}),!B||E?e.jsxs("form",{className:j.keyForm,onSubmit:C=>{C.preventDefault(),y(x).then(ce=>{ce&&(_(""),D(!1))})},children:[e.jsx("label",{htmlFor:"license-key-input",children:f("settings.license.keyInput","License Key")}),e.jsxs("div",{children:[e.jsx("input",{ref:o,id:"license-key-input",autoComplete:"off",spellCheck:!1,type:"password",value:x,onChange:C=>_(C.target.value),disabled:i||c,placeholder:p("keyPlaceholder","Enter your license key")}),e.jsx("button",{className:j.primary,disabled:i||c,type:"submit",children:f("settings.license.activate","Activate License")})]})]}):null,!B&&e.jsx("a",{className:j.plans,href:ze.settingsLicense,target:"_blank",rel:"noopener noreferrer",onClick:()=>M("dashboard_click_event",{click_target:"upgrade_cta",placement:"settings_license",page:"settings"}),children:f("tier.upgrade","View Pro")})]}),e.jsxs(Ee,{open:h!==null,ariaLabel:h==="history"?p("history","Diagnostic history"):p("support","Contact support"),onClose:me,returnFocusTo:h==="history"?H.current:I.current,children:[e.jsx(Te,{title:h==="history"?p("history","Diagnostic history"):p("support","Contact support"),description:h==="history"?p("historyScope","Recent license actions in this Dashboard tab. Up to 50 entries; cleared on reload."):p("supportDescription","Tell us what happened. Review the details before sharing."),closeLabel:f("common.close","Close"),onRequestClose:me}),e.jsx("div",{className:j.dialogBody,children:h==="history"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:j.historyToolbar,children:[e.jsxs("span",{children:[s.length," / 50"]}),e.jsxs("button",{onClick:()=>w("support"),children:[e.jsx(de,{size:15}),p("support","Contact support")]})]}),s.length?e.jsx("ol",{className:j.historyList,children:s.map(C=>e.jsxs("li",{children:[e.jsxs("div",{className:j.recordHeader,children:[e.jsx("span",{className:C.success?j.goodIcon:j.badIcon,children:C.success?e.jsx(je,{size:17}):e.jsx(ue,{size:17})}),e.jsx("strong",{children:p(`operation.${C.operation}`,{status:"License status",activate:"License activation",refresh:"License check",reset:"License removed",recheck:"Automatic license check"}[C.operation])}),e.jsx("time",{dateTime:new Date(C.at).toISOString(),children:new Date(C.at).toLocaleTimeString(P)})]}),e.jsx("p",{children:C.success?p(C.tier==="pro"?"recordPro":"recordDone",C.tier==="pro"?"Completed · Pro is available":"Completed"):p("recordAttention","Could not complete this action. Check your key or contact support.")}),e.jsx(ot,{value:C.diagnostic})]},C.id))}):e.jsxs("div",{className:j.empty,children:[e.jsx(ye,{size:28}),e.jsx("strong",{children:p("emptyHistory","No license actions recorded yet")}),e.jsx("p",{children:p("emptyHistoryHint","Your next license check will appear here.")})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:j.supportLead,children:[e.jsx(de,{size:22}),e.jsxs("div",{children:[e.jsx("strong",{children:p("supportLead","We can help with your license")}),e.jsx("p",{children:p("supportHint","Include what you tried and what you expected. Your license key and session token are excluded.")})]})]}),e.jsxs("label",{className:j.field,children:[p("symptoms","What happened?"),e.jsx("textarea",{rows:3,value:R,onChange:C=>$(C.target.value),placeholder:p("symptomsPlaceholder","Example: I purchased Pro, but activation does not complete.")})]}),e.jsxs("label",{className:j.field,children:[p("supportPreview","Information to share"),e.jsx("textarea",{readOnly:!0,rows:9,value:ae,onFocus:C=>C.currentTarget.select()})]}),e.jsxs("div",{className:j.supportActions,children:[e.jsxs("button",{className:j.primary,onClick:()=>void Le(),children:[e.jsx(qe,{size:15}),b==="copied"?p("copied","Copied"):p("copy","Copy support information")]}),e.jsxs("a",{href:V.length<7e3?V:"mailto:support@weppyai.com",children:[e.jsx(Qe,{size:15}),p("email","Write an email")]})]}),e.jsx("p",{className:j.supportFooter,children:b==="manual"?p("manualCopy","Select the information above and copy it manually."):p("emailHint","Email support@weppyai.com. If no mail app opens, copy the information and paste it into your email.")})]})})]}),e.jsx(he,{open:N,title:p("resetTitle","Remove this license?"),message:p("resetHelp","This removes the license from this installation. You will need your key to activate Pro again."),cancelLabel:f("common.cancel","Cancel"),confirmLabel:p("remove","Remove license"),loading:c,onCancel:()=>g(!1),onConfirm:()=>{z().then(()=>g(!1))}})]})}const It="_card_jz1ya_4",Ut="_cardEmbedded_jz1ya_14",Ft="_cardTitle_jz1ya_21",Ot="_storageConsoleGrid_jz1ya_31",qt="_storageUsageColumn_jz1ya_38",Wt="_storagePolicyColumn_jz1ya_39",Yt="_usageRow_jz1ya_44",Gt="_usageTotal_jz1ya_50",Kt="_usageBreakdown_jz1ya_57",Vt="_usageCounts_jz1ya_63",Zt="_storageFooter_jz1ya_70",Jt="_lastRunRow_jz1ya_79",Qt="_lastRunLabel_jz1ya_89",Xt="_errorIcon_jz1ya_95",es="_tooltip_jz1ya_103",ts="_cleanupRow_jz1ya_126",ss="_cleanupLabel_jz1ya_133",as="_cleanupBtn_jz1ya_140",os="_cleanupBtnDanger_jz1ya_169",ns="_retentionSection_jz1ya_182",is="_retentionTitle_jz1ya_188",rs="_retentionFieldset_jz1ya_196",cs="_proOverlay_jz1ya_211",ls="_modeSegments_jz1ya_223",ds="_radioLabel_jz1ya_244",us="_radioLabelActive_jz1ya_265",ps="_presetGroup_jz1ya_279",hs="_presetBtn_jz1ya_287",gs="_presetBtnActive_jz1ya_310",ms="_freeInput_jz1ya_317",ys="_inputError_jz1ya_334",js="_inputUnit_jz1ya_338",fs="_cascadeRow_jz1ya_345",xs="_retentionActions_jz1ya_361",vs="_saveBtn_jz1ya_367",bs="_runNowBtn_jz1ya_395",Ss="_errorMsg_jz1ya_439",Cs="_freeInputHitArea_jz1ya_501",l={card:It,cardEmbedded:Ut,cardTitle:Ft,storageConsoleGrid:Ot,storageUsageColumn:qt,storagePolicyColumn:Wt,usageRow:Yt,usageTotal:Gt,usageBreakdown:Kt,usageCounts:Vt,storageFooter:Zt,lastRunRow:Jt,lastRunLabel:Qt,errorIcon:Xt,tooltip:es,cleanupRow:ts,cleanupLabel:ss,cleanupBtn:as,cleanupBtnDanger:os,retentionSection:ns,retentionTitle:is,retentionFieldset:rs,proOverlay:cs,modeSegments:ls,radioLabel:ds,radioLabelActive:us,presetGroup:ps,presetBtn:hs,presetBtnActive:gs,freeInput:ms,inputError:ys,inputUnit:js,cascadeRow:fs,retentionActions:xs,saveBtn:vs,runNowBtn:bs,errorMsg:Ss,freeInputHitArea:Cs};function _s(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 pe(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 Ns(t,s){return t.mode===s.mode&&t.ageDays===s.ageDays&&t.sizeMb===s.sizeMb&&t.cascadeSnapshots===s.cascadeSnapshots}function X(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 ks({placeId:t,tier:s,currentPolicy:i,onSaved:c}){const{t:n}=Q(),{trackEvent:L}=Se(),[o,y]=r.useState(i),[m,z]=r.useState(()=>[7,14,30,90].includes(i.ageDays??-1)?"":String(i.ageDays??30)),[f,P]=r.useState(()=>[100,500,1e3].includes(i.sizeMb??-1)?"":String(i.sizeMb??500)),[S,M]=r.useState(null),[x,_]=r.useState(!1),[E,D]=r.useState(!1),[h,w]=r.useState(!1),[N,g]=r.useState(null);r.useEffect(()=>{y(i);const u=[7,14,30,90],A=[100,500,1e3];z(u.includes(i.ageDays??-1)?"":String(i.ageDays??30)),P(A.includes(i.sizeMb??-1)?"":String(i.sizeMb??500))},[i]);const R=s==="basic",$=pe(o),b=Ns(i,o),U=$&&!b&&!E,H=u=>{y(A=>{const W={...A,mode:u};return u==="age"&&(W.ageDays=parseInt(m,10)||30),u==="size"&&(W.sizeMb=parseInt(f,10)||500),W})},I=u=>{z(""),y(A=>({...A,ageDays:u}))},G=u=>{P(""),y(A=>({...A,sizeMb:u}))},T=u=>{z(u);const A=parseInt(u,10);Number.isNaN(A)||y(W=>({...W,ageDays:A}))},B=u=>{P(u);const A=parseInt(u,10);Number.isNaN(A)||y(W=>({...W,sizeMb:A}))},O=async()=>{if(g(null),L("dashboard_click_event",{click_target:"ui_studio_cleanup_save",page:"settings"}),_s(i,o)){try{const u=await _e(t,{mode:o.mode,ageDays:o.ageDays,sizeMb:o.sizeMb,cascadeSnapshots:o.cascadeSnapshots});M(u.dryRun),_(!0)}catch(u){g(u.message)}return}await q()},q=async()=>{D(!0);try{await Ke(t,o),_(!1),c()}catch(u){throw g(u.message),u}finally{D(!1)}},d=async()=>{g(null),L("dashboard_click_event",{click_target:"ui_studio_cleanup_run_now",page:"settings"}),w(!0);try{await Ge(t),c()}catch(u){g(u.message)}finally{w(!1)}},k=S?`${n("uiStudio.cleanup.policy.confirm.messageStrict","이 정책으로 즉시")} ${S.wouldRemoveRequests}${n("uiStudio.cleanup.policy.confirm.requests","건")} / ${S.wouldRemoveSnapshots}${n("uiStudio.cleanup.policy.confirm.snapshots","개 화면 캡처")} / ${X(S.wouldFreeBytes)} ${n("uiStudio.cleanup.policy.confirm.freed","가 삭제됩니다 — 적용?")}`:"",J=o.mode==="age"&&!pe(o),K=o.mode==="size"&&!pe(o);return e.jsxs("div",{className:l.retentionSection,children:[e.jsx("h3",{className:l.retentionTitle,children:e.jsx(F,{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:[R&&e.jsx("div",{className:l.proOverlay,title:n("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능"),children:e.jsx("div",{className:l.tooltip,children:n("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능")})}),e.jsxs("fieldset",{className:l.retentionFieldset,disabled:R,"aria-label":n("uiStudio.cleanup.policy.title","자동 삭제 정책"),style:R?{opacity:.45,pointerEvents:"none"}:void 0,children:[e.jsxs("div",{className:l.modeSegments,"data-testid":"cleanup-mode-segments",children:[e.jsx(v,{text:n("uiStudio.cleanup.policy.modeOff.tooltip","Turn off auto-cleanup. Data stays until you remove it manually."),children:e.jsxs("label",{className:`${l.radioLabel} ${o.mode==="off"?l.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"off",checked:o.mode==="off",onChange:()=>H("off")}),n("uiStudio.cleanup.policy.modeOff","사용 안 함 (off)")]})}),e.jsx(v,{text:n("uiStudio.cleanup.policy.modeAge.tooltip","Automatically delete data older than the configured number of days."),children:e.jsxs("label",{className:`${l.radioLabel} ${o.mode==="age"?l.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"age",checked:o.mode==="age",onChange:()=>H("age")}),n("uiStudio.cleanup.policy.modeAge","기간 기반 (age)")]})}),e.jsx(v,{text:n("uiStudio.cleanup.policy.modeSize.tooltip","When total usage exceeds the limit, the oldest data is removed first."),children:e.jsxs("label",{className:`${l.radioLabel} ${o.mode==="size"?l.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"size",checked:o.mode==="size",onChange:()=>H("size")}),n("uiStudio.cleanup.policy.modeSize","용량 기반 (size)")]})})]}),o.mode==="age"&&e.jsxs("div",{className:l.presetGroup,children:[[7,14,30,90].map(u=>e.jsx(v,{text:n("uiStudio.cleanup.policy.agePreset.tooltip","Delete data older than this many days."),children:e.jsxs("button",{type:"button",className:`${l.presetBtn} ${o.ageDays===u&&m===""?l.presetBtnActive:""}`,onClick:()=>I(u),children:[u,n("uiStudio.cleanup.policy.daysUnit","일")]})},u)),e.jsx(v,{text:n("uiStudio.cleanup.policy.ageInput.tooltip","Enter any value between 1 and 365 days."),children:e.jsx("label",{className:l.freeInputHitArea,children:e.jsx("input",{type:"number",className:`${l.freeInput} ${J?l.inputError:""}`,value:m,min:1,max:365,onChange:u=>T(u.target.value)})})}),e.jsxs("span",{className:l.inputUnit,children:["1–365",n("uiStudio.cleanup.policy.daysUnit","일")]})]}),o.mode==="size"&&e.jsxs("div",{className:l.presetGroup,children:[[100,500,1e3].map(u=>e.jsx(v,{text:n("uiStudio.cleanup.policy.sizePreset.tooltip","Keep total usage under this size."),children:e.jsxs("button",{type:"button",className:`${l.presetBtn} ${o.sizeMb===u&&f===""?l.presetBtnActive:""}`,onClick:()=>G(u),children:[u,n("uiStudio.cleanup.policy.mbUnit","MB")]})},u)),e.jsx(v,{text:n("uiStudio.cleanup.policy.sizeInput.tooltip","Enter any value between 50 MB and 10000 MB (10 GB)."),children:e.jsx("label",{className:l.freeInputHitArea,children:e.jsx("input",{type:"number",className:`${l.freeInput} ${K?l.inputError:""}`,value:f,min:50,max:1e4,onChange:u=>B(u.target.value)})})}),e.jsxs("span",{className:l.inputUnit,children:["50–10000",n("uiStudio.cleanup.policy.mbUnit","MB")]})]}),e.jsx(v,{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:l.cascadeRow,children:[e.jsx(We,{checked:o.cascadeSnapshots,onChange:u=>y(A=>({...A,cascadeSnapshots:u.target.checked}))}),n("uiStudio.cleanup.policy.cascade","연결된 화면 캡처도 함께 삭제")]})}),e.jsxs("div",{className:l.retentionActions,children:[e.jsx(v,{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:l.saveBtn,onClick:()=>void O(),disabled:!U,children:n("uiStudio.cleanup.policy.save","정책 저장")})}),e.jsx(v,{text:n("uiStudio.cleanup.policy.runNow.tooltip","저장된 정리 정책을 다음 자동 실행까지 기다리지 않고 지금 한 번 실행합니다."),children:e.jsx("button",{type:"button",className:l.runNowBtn,onClick:()=>void d(),disabled:h,children:n("uiStudio.cleanup.policy.runNow","저장된 정책으로 정리")})})]}),N&&e.jsx("div",{className:l.errorMsg,children:N})]})]}),x&&S&&e.jsx(Ce,{title:n("uiStudio.cleanup.policy.confirm.title","정책 적용 확인"),message:k,danger:!0,confirmLabel:n("uiStudio.cleanup.policy.save","정책 저장"),busy:E,onConfirm:q,onClose:()=>_(!1)})]})}function Ls({placeId:t,tier:s,onChanged:i,sampleUsage:c,sampleRetention:n,embedded:L=!1}){const{t:o}=Q(),y=s==="basic"&&c!=null&&n!=null,[m,z]=r.useState(y?c:null),[f,P]=r.useState(y?n:null),[S,M]=r.useState(null),[x,_]=r.useState(null),[E,D]=r.useState(null),h=r.useCallback(async()=>{if(!y&&t!=null){M(null);try{const[H,I]=await Promise.all([Ne(t),_e(t)]);z(H),P(I.policy)}catch(H){M(H.message)}}},[t,y]);r.useEffect(()=>{h()},[h]);const w=r.useCallback(()=>{h(),i==null||i()},[h,i]),N=r.useCallback(async()=>{if(x&&t!=null){D(null);try{x.kind==="keep7"?await ie(t,{olderThanDays:7,alsoSnapshots:!0}):x.kind==="keep30"?await ie(t,{olderThanDays:30,alsoSnapshots:!0}):await ie(t,{all:!0,alsoSnapshots:!0}),_(null),h(),i==null||i()}catch(H){throw D(H.message),H}}},[x,t,h,i]);function g(H){const I=o("uiStudio.cleanup.studioPreservedNote","This deletes saved change records and screenshots on disk only; Roblox Studio instances are not affected.");return H.kind==="keep7"?`${o("uiStudio.cleanup.cleanupConfirmMessage.keep7","7일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${I}`:H.kind==="keep30"?`${o("uiStudio.cleanup.cleanupConfirmMessage.keep30","30일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${I}`:`${((m==null?void 0:m.requestCount)??0)+((m==null?void 0:m.snapshotCount)??0)}${o("uiStudio.cleanup.cleanupConfirmMessage.all","개의 저장된 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${I}`}if(t==null&&!y)return null;if(S)return e.jsx("div",{className:`${l.card} ${L?l.cardEmbedded:""}`,children:e.jsx("p",{className:l.errorMsg,children:S})});if(!m||!f)return e.jsx("div",{className:`${l.card} ${L?l.cardEmbedded:""}`,children:e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",margin:0},children:o("uiStudio.storage.loading","로딩 중...")})});const R=f.lastRunAt,$=f.lastRunStats,b=R?new Date(R).toLocaleString():null,U=t??0;return e.jsxs("div",{className:`${l.card} ${L?l.cardEmbedded:""}`,children:[!L&&e.jsx("h3",{className:l.cardTitle,children:e.jsx(F,{label:o("uiStudio.storage.title","UI Studio 저장 데이터"),tooltip:o("uiStudio.storage.title.tooltip","Disk usage of UI Studio change records and screenshots.")})}),e.jsxs("div",{className:l.storageConsoleGrid,"data-testid":"ui-studio-storage-console-grid",children:[e.jsx("section",{className:l.storageUsageColumn,children:e.jsxs("div",{className:l.usageRow,children:[e.jsx(v,{text:o("uiStudio.storage.usageLabel.tooltip","Disk space currently used by UI Studio for this project."),children:e.jsxs("div",{className:l.usageTotal,children:[o("uiStudio.storage.usageLabel","사용 중")," ",X(m.totalBytes)]})}),e.jsxs("div",{className:l.usageBreakdown,children:[e.jsx(v,{text:o("uiStudio.storage.historyBytes.tooltip","Space taken by change record data (JSON)."),children:e.jsxs("span",{children:[o("uiStudio.storage.historyBytes","변경 이력")," ",X(m.historyBytes)]})})," · ",e.jsx(v,{text:o("uiStudio.storage.snapshotBytes.tooltip","Space taken by captured PNG image files."),children:e.jsxs("span",{children:[o("uiStudio.storage.snapshotBytes","화면 캡처")," ",X(m.snapshotBytes)]})})]}),e.jsxs("div",{className:l.usageCounts,children:[e.jsx(v,{text:o("uiStudio.storage.requestCount.tooltip","Number of actions where AI changed the UI."),children:e.jsxs("span",{children:[o("uiStudio.storage.requestCount","변경 기록")," ",m.requestCount.toLocaleString(),o("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(v,{text:o("uiStudio.storage.mutationCount.tooltip","Number of detail changes inside actions (one property edit = 1)."),children:e.jsxs("span",{children:[o("uiStudio.storage.mutationCount","변경 상세")," ",m.mutationCount.toLocaleString(),o("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(v,{text:o("uiStudio.storage.snapshotCount.tooltip","Number of saved capture image files."),children:e.jsxs("span",{children:[o("uiStudio.storage.snapshotCount","화면 캡처")," ",m.snapshotCount.toLocaleString(),o("uiStudio.storage.countSuffix","개")]})})]})]})}),e.jsx("section",{className:l.storagePolicyColumn,children:e.jsx(ks,{placeId:U,tier:s,currentPolicy:f,onSaved:w})})]}),e.jsxs("div",{className:l.storageFooter,"data-testid":"ui-studio-storage-footer",children:[e.jsxs("div",{className:l.lastRunRow,children:[e.jsx("span",{className:l.lastRunLabel,children:e.jsx(F,{label:o("uiStudio.storage.lastRun","마지막 자동 정리"),tooltip:o("uiStudio.storage.lastRun.tooltip","When the auto-cleanup policy last ran, and what it removed.")})}),b?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:b}),$&&e.jsxs("span",{children:["· ",o("uiStudio.storage.requestCount","변경 기록")," ",$.removedRequests,o("uiStudio.storage.countSuffix","개")," / ",o("uiStudio.storage.snapshotCount","화면 캡처")," ",$.removedSnapshots,o("uiStudio.storage.countSuffix","개")," / ",X($.freedBytes)," ",o("uiStudio.storage.lastRunFreed","회수")]}),$&&$.errors>0&&e.jsxs("span",{className:l.errorIcon,title:`${o("uiStudio.storage.lastRunErrors","오류")} ${$.errors}건`,children:["⚠",e.jsxs("span",{className:l.tooltip,children:[o("uiStudio.storage.lastRunErrors","오류")," ",$.errors,o("uiStudio.storage.countSuffix","건")]})]})]}):e.jsx("span",{children:o("uiStudio.storage.lastRunNever","—")})]}),e.jsxs("div",{className:l.cleanupRow,children:[e.jsx("span",{className:l.cleanupLabel,children:e.jsx(F,{label:o("uiStudio.cleanup.label","수동 정리"),tooltip:o("uiStudio.cleanup.label.tooltip","Manually clean up change records and captures whenever you want.")})}),e.jsx(v,{text:o("uiStudio.cleanup.keep7.tooltip","Delete change records and captures older than 7 days."),children:e.jsx("button",{type:"button",className:l.cleanupBtn,onClick:()=>_({kind:"keep7"}),disabled:s==="basic",children:o("uiStudio.cleanup.keepLastNDays","최근 7일만 남기기").replace("{n}","7")})}),e.jsx(v,{text:o("uiStudio.cleanup.keep30.tooltip","Delete change records and captures older than 30 days."),children:e.jsx("button",{type:"button",className:l.cleanupBtn,onClick:()=>_({kind:"keep30"}),disabled:s==="basic",children:o("uiStudio.cleanup.keepLastNDays","최근 30일만 남기기").replace("{n}","30")})}),!L&&e.jsx(v,{text:o("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:`${l.cleanupBtn} ${l.cleanupBtnDanger}`,onClick:()=>_({kind:"all"}),disabled:s==="basic",children:o("uiStudio.cleanup.deleteAll","전체 삭제…")})})]})]}),E&&e.jsx("div",{className:l.errorMsg,children:E}),x&&e.jsx(Ce,{title:o("uiStudio.cleanup.cleanupConfirmTitle","정리 확인"),message:g(x),danger:!0,confirmLabel:o("common.delete","삭제"),onConfirm:N,onClose:()=>{_(null),D(null)}})]})}function xe(t,s){const i={placeId:String(t)};return s&&(i["preview.mode"]=s.mode,s.mode==="size"&&(i["preview.sizeMb"]=String(s.sizeMb))),Y.get("/api/dashboard/changelog/cleanup",i)}function ve(t){return Y.put("/api/dashboard/changelog/cleanup",t)}function Ps(t){return Y.post(`/api/dashboard/changelog/cleanup/run?placeId=${encodeURIComponent(t)}`)}const ws=[100,500,1e3];function be(t,s){return t.mode!==s.mode?!1:t.mode==="off"||s.mode==="size"&&t.sizeMb===s.sizeMb}function Rs(t,s){return t.mode==="off"?!1:s.mode==="off"||t.sizeMb<s.sizeMb}function ee(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 Hs({placeId:t,onChanged:s}){const{locale:i,t:c}=Q(),[n,L]=r.useState(null),[o,y]=r.useState({mode:"size",sizeMb:500}),[m,z]=r.useState(t!==null),[f,P]=r.useState(!1),[S,M]=r.useState(!1),[x,_]=r.useState(!1),[E,D]=r.useState(!1),[h,w]=r.useState(null),N=r.useCallback(async()=>{if(t===null){L(null),z(!1);return}M(!1);try{const d=await xe(t);L(d),y(d.policy)}catch{M(!0)}finally{z(!1)}},[t]);r.useEffect(()=>{z(t!==null),N()},[N,t]);const g=r.useCallback(async d=>{P(!0),_(!1),D(!1);try{await ve(d),w(null),await N(),D(!0),s==null||s()}catch{_(!0)}finally{P(!1)}},[N,s]),R=r.useCallback(async()=>{if(!(!n||t===null||be(o,n.policy))){P(!0),_(!1),D(!1);try{if(Rs(o,n.policy)){const d=await xe(t,o);if(d.preview.affectedPlaceCount>0){w({policy:o,preview:d});return}}await ve(o),await N(),D(!0),s==null||s()}catch{_(!0)}finally{P(!1)}}},[n,o,N,s,t]),$=r.useCallback(async()=>{if(t!==null){P(!0),_(!1),D(!1);try{await Ps(t),await N(),s==null||s()}catch{_(!0)}finally{P(!1)}}},[N,s,t]),b=n==null?void 0:n.selectedPlace.currentUsage,U=(n==null?void 0:n.policy.mode)==="size"?n.policy.sizeMb*1e6:null,H=U??Math.max((b==null?void 0:b.bytes)??0,1),I=Math.min(100,((b==null?void 0:b.sessionBytes)??0)/H*100),G=Math.min(Math.max(0,100-I),((b==null?void 0:b.contextBytes)??0)/H*100),T=n?!be(o,n.policy):!1,B=d=>d.mode==="off"?c("settings.projectChanges.cleanup.unlimited","Unlimited"):`${d.sizeMb} MB`,O=r.useMemo(()=>{if(!h)return"";const d=h.preview.preview,k=c("settings.projectChanges.cleanup.confirm.message","{places} Places · {sessions} sessions · {bytes} expected to be freed.").replace("{places}",d.affectedPlaceCount.toLocaleString()).replace("{sessions}",d.deleteSessionCount.toLocaleString()).replace("{bytes}",ee(d.estimatedFreedBytes));return d.wouldRemainOverLimitPlaceCount===0?k:`${k} ${c("settings.projectChanges.cleanup.confirm.protected","{places} Place may remain over the limit because active data is protected.").replace("{places}",d.wouldRemainOverLimitPlaceCount.toLocaleString())}`},[h,c]);if(t===null)return e.jsx("div",{className:a.projectChangesPanel,children:e.jsx("p",{className:a.projectChangesEmpty,children:c("settings.projectChanges.cleanup.noPlace","Select a Place to manage saved project changes.")})});if(m)return e.jsx("div",{className:a.projectChangesPanel,children:e.jsx("p",{className:a.projectChangesEmpty,children:c("settings.projectChanges.cleanup.loading","Loading storage settings…")})});if(S||!n||!b)return e.jsxs("div",{className:a.projectChangesPanel,children:[e.jsx("p",{className:a.projectChangesError,role:"alert",children:c("settings.projectChanges.cleanup.loadFailed","Could not load storage settings.")}),e.jsx("button",{className:a.projectChangesSecondaryButton,type:"button",onClick:()=>{z(!0),N()},children:c("common.retry","Retry")})]});const q=U===null?c("settings.projectChanges.cleanup.usageUnlimited","{used} used · Unlimited").replace("{used}",ee(b.bytes)):c("settings.projectChanges.cleanup.usageLimited","{used} used of {limit}").replace("{used}",ee(b.bytes)).replace("{limit}",B(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(F,{label:c("settings.projectChanges.cleanup.title","Storage management"),tooltip:c("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:q}),e.jsxs("div",{className:a.projectChangesQuotaRail,role:"meter","aria-label":c("settings.projectChanges.cleanup.usageAria","Place storage usage"),"aria-valuemin":0,"aria-valuenow":b.bytes,"aria-valuemax":U??b.bytes,children:[e.jsx("span",{className:a.projectChangesSessionRail,style:{width:`${I}%`}}),e.jsx("span",{className:a.projectChangesContextRail,style:{width:`${G}%`}})]}),e.jsxs("div",{className:a.projectChangesUsageLegend,children:[e.jsxs("span",{children:[c("settings.projectChanges.cleanup.sessions","Sessions")," ",e.jsx("strong",{children:ee(b.sessionBytes)})]}),e.jsxs("span",{children:[c("settings.projectChanges.cleanup.contexts","Contexts")," ",e.jsx("strong",{children:ee(b.contextBytes)})]})]})]})]}),e.jsxs("section",{className:a.projectChangesPolicyColumn,children:[e.jsx("p",{className:a.projectChangesScope,children:c("settings.projectChanges.cleanup.scope","One setting applies the selected limit separately to every Place.")}),e.jsxs("fieldset",{className:a.projectChangesPolicyFieldset,disabled:f,children:[e.jsx("legend",{className:a.projectChangesPolicyLegend,children:c("settings.projectChanges.cleanup.limit","Limit per Place")}),e.jsxs("div",{className:a.projectChangesPresetGroup,children:[ws.map(d=>{const k=o.mode==="size"&&o.sizeMb===d;return e.jsx("button",{className:`${a.projectChangesPresetButton} ${k?a.projectChangesPresetButtonActive:""}`,type:"button","aria-pressed":k,onClick:()=>y({mode:"size",sizeMb:d}),children:c("settings.projectChanges.cleanup.preset","{sizeMb}MB").replace("{sizeMb}",String(d))},d)}),e.jsx("button",{className:`${a.projectChangesPresetButton} ${o.mode==="off"?a.projectChangesPresetButtonActive:""}`,type:"button","aria-pressed":o.mode==="off",onClick:()=>y({mode:"off"}),children:c("settings.projectChanges.cleanup.unlimited","Unlimited")})]})]}),e.jsxs("div",{className:a.projectChangesActions,children:[e.jsx("button",{className:a.projectChangesSaveButton,type:"button",disabled:!T||f,onClick:()=>void R(),children:c("common.save","Save")}),e.jsx("button",{className:a.projectChangesSecondaryButton,type:"button",disabled:f,onClick:()=>void $(),children:c("settings.projectChanges.cleanup.runNow","Run saved policy")}),E&&e.jsx("span",{className:a.projectChangesSaved,role:"status",children:c("settings.projectChanges.cleanup.saved","Saved")})]})]})]}),n.selectedPlace.dryRun.wouldRemainOverLimit&&e.jsx("p",{className:a.projectChangesWarning,children:c("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:c("settings.projectChanges.cleanup.lastRun","Last cleanup")}),n.selectedPlace.lastRun?e.jsxs("span",{children:[new Date(n.selectedPlace.lastRun.ranAt).toLocaleString(i)," · ",c("settings.projectChanges.cleanup.lastRunSummary","{sessions} sessions · {bytes} freed").replace("{sessions}",n.selectedPlace.lastRun.deletedSessionCount.toLocaleString()).replace("{bytes}",ee(n.selectedPlace.lastRun.freedBytes))]}):e.jsx("span",{children:c("settings.projectChanges.cleanup.neverRun","Not run yet")})]}),x&&e.jsx("p",{className:a.projectChangesError,role:"alert",children:c("settings.projectChanges.cleanup.actionFailed","Could not update storage settings.")}),e.jsx(he,{open:h!==null,title:c("settings.projectChanges.cleanup.confirm.title","Apply this limit and clean saved changes?"),message:O,cancelLabel:c("common.cancel","Cancel"),confirmLabel:c("settings.projectChanges.cleanup.confirm.apply","Apply and clean"),loading:f,onCancel:()=>!f&&w(null),onConfirm:()=>{h&&g(h.policy)}})]})}const zs={toolsActivity:null,toolStats:null,toolSessions:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null},Ds={toolsActivity:null,toolStats:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null};function As(t){var s;return t?t.pluginConnected?t.activePlaceId:t.lastActivePlaceId??((s=t.places[0])==null?void 0:s.placeId)??null:null}async function Z(t){try{return await t}catch{return null}}function oe(t){return t?typeof t.total=="number"?t.total:Array.isArray(t.entries)?t.entries.length:null:null}function ne(t,s,i,c){return s===null?t("settings.dataHistory.metric.unavailable","Unavailable"):`${s.toLocaleString()} ${t(i,c)}`}function te(t,s,i){const c=i===null?t("settings.dataHistory.metric.sizeUnavailable","size unavailable"):X(i);return`${s} · ${c}`}function se(t,s){var c;const i=(c=t==null?void 0:t[s])==null?void 0:c.bytes;return typeof i=="number"&&Number.isFinite(i)?i:null}function $s(t,s){return s?[`${s.requestCount.toLocaleString()} ${t("uiStudio.storage.requestCount","change records")}`,`${s.snapshotCount.toLocaleString()} ${t("uiStudio.storage.snapshotCount","screenshots")}`,X(s.totalBytes)].join(" · "):t("settings.dataHistory.metric.unavailable","Unavailable")}function Bs({tier:t}){const{t:s}=Q(),[i,c]=r.useState(zs),[n,L]=r.useState(Ds),[o,y]=r.useState(t==="basic"?le:null),[m,z]=r.useState(null),[f,P]=r.useState(!0),[S,M]=r.useState(!0),[x,_]=r.useState(null),[E,D]=r.useState(()=>new Set),[h,w]=r.useState(null),[N,g]=r.useState(!1),[R,$]=r.useState(null),b=r.useCallback(async()=>{P(!0);const d=await Z(De()),k=As(d);z(k);const[J,K,u,A,W,ae,V]=await Promise.all([Z(Y.get("/api/dashboard/history",{limit:"1",offset:"0"})),Z(Y.get("/api/dashboard/tool-stats")),Z(Y.get("/sync/history",{limit:"1",offset:"0"})),Z(Y.get("/api/dashboard/playtest/history")),Z(Y.get("/api/dashboard/changelog",{limit:"1",offset:"0"})),Z(Y.get("/api/dashboard/connection-log")),Z(Y.get("/api/dashboard/storage-summary"))]),p=t==="basic"?le:k===null?null:await Z(Ne(k));c({toolsActivity:oe(J),toolStats:(K==null?void 0:K.totalCalls)??null,toolSessions:(K==null?void 0:K.totalSessions)??null,syncLog:oe(u),playtestReports:oe(A),projectChanges:oe(W),connectionLog:oe(ae)}),L({toolsActivity:se(V,"toolsActivity"),toolStats:se(V,"toolStats"),syncLog:se(V,"syncLog"),playtestReports:se(V,"playtestReports"),projectChanges:se(V,"projectChanges"),connectionLog:se(V,"connectionLog")}),y(p),P(!1)},[t]);r.useEffect(()=>{b()},[b]);const U=r.useCallback(d=>{D(k=>{if(k.has(d))return k;const J=new Set(k);return J.add(d),J}),_(k=>k===d?null:d)},[]),H=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:te(s,ne(s,i.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:te(s,i.toolStats===null?s("settings.dataHistory.metric.unavailable","Unavailable"):`${i.toolStats.toLocaleString()} ${s("settings.dataHistory.metric.runs","runs")} · ${(i.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:te(s,ne(s,i.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:te(s,ne(s,i.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:te(s,ne(s,i.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:te(s,ne(s,i.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"}],[i,n,s]),I=async()=>{if(h){g(!0),$(null);try{if(h.kind==="uiStudio"){if(t!=="pro"||m===null)throw new Error("UI Studio place is unavailable");await ie(m,{all:!0,alsoSnapshots:!0}),$(s("settings.dataHistory.uiStudio.clear.success","UI Studio saved data cleared."))}else{const d=h.row.key==="projectChanges";if(d&&m===null)throw new Error("Project changes place is unavailable");let k=h.row.clearEndpoint;d&&m!==null&&(k=`${k}?placeId=${encodeURIComponent(m)}`),await Y.post(k),$(d?s("settings.dataHistory.projectChanges.clear.success","Project change summaries cleared."):s("settings.dataHistory.clear.success","Saved data cleared."))}w(null),await b()}catch{$(h.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{g(!1)}}},G=t==="pro"?m:0,T=t==="pro"&&m!==null,B=(h==null?void 0:h.kind)==="uiStudio",O=(h==null?void 0:h.kind)==="row"&&h.row.key==="projectChanges",q=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(F,{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(v,{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:f?s("common.loading","Loading"):s("settings.dataHistory.scope","Current project")})}),e.jsx(v,{text:s("settings.dataHistory.toggle.tooltip","Collapse or expand this section."),children:e.jsx("button",{className:a.collapseButton,type:"button","aria-expanded":S,"aria-controls":"settings-data-history-body","aria-label":S?s("settings.dataHistory.collapse","Collapse {title}").replace("{title}",q):s("settings.dataHistory.expand","Expand {title}").replace("{title}",q),onClick:()=>M(d=>!d),children:S?"▾":"▸"})})]})]}),S&&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:[H.map(d=>e.jsxs(r.Fragment,{children:[e.jsxs("div",{className:`${a.dataHistoryRow} ${d.key==="projectChanges"&&x==="projectChanges"?a.dataHistoryRowExpanded:""}`,children:[e.jsxs("div",{className:a.dataHistoryMain,children:[e.jsx("div",{className:a.dataHistoryTitle,children:d.title}),e.jsx("div",{className:a.dataHistoryDescription,children:d.description})]}),e.jsx(v,{text:d.metricTooltip,children:e.jsx("div",{className:a.dataHistoryMetric,children:d.metric})}),e.jsxs("div",{className:a.dataHistoryActions,children:[e.jsx(v,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:a.linkButton,href:`#${d.route}`,children:s("settings.dataHistory.open","Open")})}),d.key==="projectChanges"&&e.jsx(v,{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:()=>U("projectChanges"),children:[s("settings.dataHistory.manageStorage","Manage storage"),e.jsx("span",{"aria-hidden":"true",children:x==="projectChanges"?"▴":"▾"})]})}),e.jsx(v,{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:d.key==="projectChanges"&&m===null,onClick:()=>w({kind:"row",row:d}),children:d.key==="projectChanges"?s("settings.dataHistory.clearAll","Clear all"):s("common.clear","Clear")})})]})]}),d.key==="projectChanges"&&E.has("projectChanges")&&e.jsx("div",{id:"settings-project-changes-storage",className:`${a.dataHistoryDetail} ${a.projectChangesDataHistoryDetail}`,hidden:x!=="projectChanges",children:e.jsx(Hs,{placeId:m,onChanged:b})})]},d.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(v,{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:$s(s,o)})}),e.jsxs("div",{className:a.dataHistoryActions,children:[e.jsx(v,{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(v,{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:()=>U("uiStudio"),children:[s("settings.dataHistory.manageStorage","Manage storage"),e.jsx("span",{"aria-hidden":"true",children:x==="uiStudio"?"▴":"▾"})]})}),e.jsx(v,{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:!T,onClick:()=>w({kind:"uiStudio"}),children:s("settings.dataHistory.clearAll","Clear all")})})]})]}),E.has("uiStudio")&&e.jsx("div",{id:"settings-ui-studio-storage",className:`${a.dataHistoryDetail} ${a.uiStudioDataHistoryDetail}`,hidden:x!=="uiStudio",children:e.jsx(Ls,{placeId:G,tier:t,onChanged:b,embedded:!0,...t==="basic"?{sampleUsage:le,sampleRetention:Ve}:{}})})]}),R&&e.jsx("p",{className:a.inlineStatus,children:R})]})]}),e.jsx(he,{open:h!==null,title:B?s("settings.dataHistory.uiStudio.clear.title","Clear UI Studio saved data?"):O?s("settings.dataHistory.projectChanges.clear.title","Clear project change summaries?"):s("settings.dataHistory.clear.title","Clear saved data?"),message:B?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."):O?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:O||B?s("settings.dataHistory.clearAll","Clear all"):s("common.clear","Clear"),loading:N,onCancel:()=>!N&&w(null),onConfirm:()=>void I()})]})}const Es=r.forwardRef(function({autoOpen:s,settingsFilePath:i,saving:c,targeted:n,updateDashboardPreferences:L},o){const{t:y}=Q(),[m,z]=r.useState("idle"),f="settings-dashboard-auto-open-label",P=c||m==="saving",S=async x=>{z("saving");try{await L({autoOpen:x}),z("saved")}catch{z("error")}},M=m==="saving"?y("settings.dashboard.autoOpen.saving","Saving…"):m==="saved"?y("settings.dashboard.autoOpen.saved","Saved for the next server start."):m==="error"?y("settings.dashboard.autoOpen.error","Could not save. The previous setting was restored."):" ";return e.jsxs("div",{id:"settings-dashboard",ref:o,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(F,{label:y("settings.dashboard.title","Dashboard"),tooltip:y("settings.dashboard.title.tooltip","Choose how WEPPY Dashboard behaves when the MCP Server starts.")}),e.jsx(v,{text:y("settings.dashboard.autoOpen.nextStart","Applies the next time the MCP Server starts."),children:e.jsx("span",{className:a.headerBadge,children:y("settings.dashboard.nextStartBadge","Next Start")})})]}),e.jsxs("div",{className:a.dashboardSettingRow,children:[e.jsxs("div",{className:a.dashboardSettingCopy,children:[e.jsx("span",{id:f,className:a.dashboardSettingLabel,children:y("settings.dashboard.autoOpen.label","Open Dashboard when WEPPY starts")}),e.jsx("span",{className:a.dashboardSettingDescription,children:y("settings.dashboard.autoOpen.description","Automatically opens this Dashboard after the MCP Server starts.")}),e.jsx("span",{className:a.dashboardSettingMeta,children:y("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":f,checked:s,disabled:P,onChange:x=>{S(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:y("settings.dashboard.settingsFile.label","Settings file")}),e.jsx("dd",{children:e.jsx("code",{className:a.dashboardSettingsFilePath,children:i})})]}),e.jsxs("div",{className:a.dashboardDetailRow,children:[e.jsx("dt",{children:y("settings.dashboard.agentExample.label","Ask your Agent")}),e.jsx("dd",{className:a.dashboardAgentPrompt,children:y("settings.dashboard.agentExample.prompt","“Turn off Dashboard auto-open.”")})]})]}),e.jsx("p",{className:`${a.dashboardSaveFeedback} ${m==="error"?a.dashboardSaveFeedbackError:""}`,"aria-live":"polite",children:M})]})}),Ts={en:"English",ko:"한국어",es:"Español","pt-br":"Português (BR)",ja:"日本語",id:"Bahasa Indonesia",de:"Deutsch","fr-fr":"Français"};function Qs(){const{t,selectedLocale:s,setLocale:i}=Q(),{search:c}=Ae(),{settings:n,license:L,licenseControlsDisabled:o,licenseSubmitting:y,licenseRecords:m=[],activateLicense:z,refreshLicense:f,resetLicense:P,saving:S,updateDashboardPreferences:M,loading:x}=Fe(),_=(L==null?void 0:L.tier)==="pro"?"pro":"basic",E=r.useRef(null),D=r.useRef(null),h=r.useRef(null),w=r.useMemo(()=>new URLSearchParams(c).get("section")==="license",[c]),N=r.useMemo(()=>new URLSearchParams(c).get("section")==="dashboard",[c]);return r.useEffect(()=>{var R;if(!w||x)return;const g=E.current;if((R=g==null?void 0:g.scrollIntoView)==null||R.call(g,{block:"start",behavior:"smooth"}),h.current&&!h.current.disabled){h.current.focus();return}g==null||g.focus()},[x,o,y,w]),r.useEffect(()=>{var R;if(!N||x)return;const g=D.current;(R=g==null?void 0:g.scrollIntoView)==null||R.call(g,{block:"start",behavior:"smooth"}),g==null||g.focus()},[x,N]),x?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(Ye,{title:t("page.settings.title","Settings"),description:t("page.settings.description","Manage license, saved data, server environment, and language."),helpTopicId:"settings",helpState:{tier:_}}),e.jsx(Mt,{license:L,records:m,disabled:o,submitting:y,targeted:w,cardRef:E,inputRef:h,activate:z,refresh:f,reset:P}),e.jsx(Bs,{tier:_}),n&&e.jsx(Es,{ref:D,autoOpen:n.dashboard.autoOpen,settingsFilePath:n.dashboard.settingsFilePath,saving:S,targeted:N,updateDashboardPreferences:M}),e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(F,{label:t("settings.cold.title","Server Environment"),tooltip:t("settings.cold.title.tooltip","Read-only server environment values loaded at startup.")}),e.jsx(v,{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")})})]}),n?e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:a.coldGrid,children:[e.jsx("dt",{children:e.jsx(F,{label:"HTTP_PORT",tooltip:t("settings.cold.httpPort.tooltip","Port number used by the MCP WEPPY Dashboard HTTP server.")})}),e.jsx("dd",{children:n.cold.HTTP_PORT}),e.jsx("dt",{children:e.jsx(F,{label:"HTTP_HOST",tooltip:t("settings.cold.httpHost.tooltip","Host interface that the MCP WEPPY Dashboard HTTP server binds to.")})}),e.jsx("dd",{children:n.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(F,{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(F,{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(v,{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:g=>i(g.target.value),children:[e.jsx("option",{value:$e,children:t("settings.language.auto","Auto")}),Be.map(g=>e.jsx("option",{value:g,children:Ts[g]??g},g))]})})]})]}),e.jsxs("p",{className:a.licenseNotices,children:[t("settings.notices.description","WEPPY uses open-source components.")," ",e.jsx("a",{href:"/dashboard/THIRD_PARTY_NOTICES.txt",target:"_blank",rel:"noopener noreferrer",children:t("settings.notices.open","View open-source notices")})]})]})}export{Qs as Component};
@@ -1,11 +0,0 @@
1
- import{c as ke,m as W,h as Fe,r as g,u as k,j as t,b as E,R as ze,X as Ve,T as je,f as We,B as Ke}from"./index-CJYQedSN.js";import{I as R}from"./InfoLabel-CH5CpR7R.js";import{T as y}from"./TooltipText-DSn3s49K.js";import{C as Ye,P as Qe}from"./PageHeader-DfhSm4j-.js";import{D as le,c as ce,e as Je,g as Xe,h as Ze,i as ue,j as Ie,k as et,l as de,d as tt}from"./sample-requests-x7wuDmFr.js";import{C as it}from"./ContentScopedDialog-CO7HgbDh.js";import{A as pe}from"./AiPromptExamples-BLQgKnq1.js";import{B as st}from"./bot-BQBLv2uC.js";import{C as at,T as rt}from"./Tabs-D9FkOjPv.js";import"./copy-D8MSHyQE.js";import"./PlaceSelectOptions-CMtQalSy.js";/**
2
- * @license lucide-react v1.8.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const nt=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],ot=ke("camera",nt);/**
7
- * @license lucide-react v1.8.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const lt=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],ct=ke("ellipsis",lt);async function Ne(e){const i=await fetch(`${W}${e}`);if(!i.ok){let s=null;try{s=await i.json()}catch{}throw new Fe(i.status,(s==null?void 0:s.message)??i.statusText,(s==null?void 0:s.error)??null,s)}return await i.json()}function U(e){return typeof e=="number"&&Number.isFinite(e)?e:0}const ut=["structure","visual","interaction","primary_view_context","responsive_viewport"];function he(e){const i=e.coverage_dimensions,s={structure:{status:e.deterministic_status==="failed"?"failed":"completed",reasons:[]},visual:{status:e.visual_status??"not_requested",reasons:[]},interaction:{status:"skipped",reasons:[]},primary_view_context:{status:"skipped",reasons:[]},responsive_viewport:{status:"skipped",reasons:[]}};if(!i)return s;for(const n of ut){const o=i[n];o&&["completed","not_requested","skipped","failed"].includes(o.status)&&(s[n]={status:o.status,reasons:Array.isArray(o.reasons)?o.reasons.filter(a=>typeof a=="string"):[]})}return s}function dt(e,i){return e.readiness==="ready"||e.readiness==="review_required"||e.readiness==="insufficient_evidence"?e.readiness:"insufficient_evidence"}function pt(e){return e==="recompose"||e==="refine"||e==="approved"?e:void 0}function ht(e){return e==="recommended"||e==="required"?e:void 0}function _t(e){if(Array.isArray(e))return e.filter(i=>i==="primary_visual"||i==="functional_safe"||i==="responsive_ready")}function gt(e){if(e.design_check_summary){const n={platform_guidance:e.design_check_summary.platform_guidance,platform_ui:e.design_check_summary.platform_ui,priority_high:U(e.design_check_summary.priority_high),priority_medium:U(e.design_check_summary.priority_medium),priority_low:U(e.design_check_summary.priority_low),deterministic_status:e.design_check_summary.deterministic_status==="failed"?"failed":"completed",visual_status:e.design_check_summary.visual_status??"not_requested",coverage:e.design_check_summary.coverage==="structural_and_visual"?"structural_and_visual":"structural_only",skipped_reasons:Array.isArray(e.design_check_summary.skipped_reasons)?e.design_check_summary.skipped_reasons.filter(a=>typeof a=="string"):[],primary_visual_status:e.design_check_summary.primary_visual_status,primary_visual_verdict:pt(e.design_check_summary.primary_visual_verdict),critic_summary:typeof e.design_check_summary.critic_summary=="string"?e.design_check_summary.critic_summary:void 0,functional_safe:typeof e.design_check_summary.functional_safe=="boolean"?e.design_check_summary.functional_safe:void 0,responsive_requirement:ht(e.design_check_summary.responsive_requirement),responsive_ready:typeof e.design_check_summary.responsive_ready=="boolean"?e.design_check_summary.responsive_ready:void 0,required_dimensions:_t(e.design_check_summary.required_dimensions),observation_source:e.design_check_summary.observation_source==="play_client"?"play_client":e.design_check_summary.observation_source==="edit"?"edit":void 0,runtime_status:e.design_check_summary.runtime_status==="completed"||e.design_check_summary.runtime_status==="skipped"?e.design_check_summary.runtime_status:void 0,limitations:Array.isArray(e.design_check_summary.limitations)?e.design_check_summary.limitations.filter(a=>typeof a=="string"):[],state_coverage:Array.isArray(e.design_check_summary.state_coverage)?e.design_check_summary.state_coverage:[]},o=he({...n,coverage_dimensions:e.design_check_summary.coverage_dimensions});return{...n,coverage_dimensions:o,viewport_profiles_tested:Array.isArray(e.design_check_summary.viewport_profiles_tested)?e.design_check_summary.viewport_profiles_tested.filter(a=>typeof a=="string"):[],readiness:dt(e.design_check_summary)}}if(!e.lint_summary)return null;const i={priority_high:U(e.lint_summary.errors),priority_medium:U(e.lint_summary.warnings),priority_low:0,deterministic_status:"completed",visual_status:"not_requested",coverage:"structural_only",skipped_reasons:[]},s=he(i);return{...i,coverage_dimensions:s,viewport_profiles_tested:[],readiness:"insufficient_evidence"}}function mt(e){return{guidance_refs:e.guidance_refs,evidence:e.evidence,rule:e.rule,path:e.path,displayPriority:e.displayPriority??(e.severity==="error"?"priority_high":"priority_medium"),actual:e.actual,expected:e.expected,hint:e.hint}}function Pe(e){return{snapshot_id:e.snapshot_id,captured_at:e.captured_at,brief_id:e.brief_id,thresholds_source:e.thresholds_source,scope:e.scope,target:e.target,design_check_summary:gt(e),primary_view_context:e.primary_view_context,image:e.image}}function yt(e){const i=e.check_results??e.lint_results??[];return{...Pe(e),check_results:i.map(mt),image_url:e.image_url,meta:e.meta,layout_metadata:e.layout_metadata,target_profiles:e.target_profiles,profile_simulations:e.profile_simulations,design_check_context:e.design_check_context}}async function _e(e,i){const s=new URLSearchParams;i!==void 0&&s.set("limit",String(i));const n=s.toString()?`?${s.toString()}`:"",o=await Ne(`/api/ui-studio/snapshots${n}`);return{...o,snapshots:o.snapshots.map(Pe)}}async function ft(e,i){const s=i!==void 0?`?placeId=${i}`:"",n=await Ne(`/api/ui-studio/snapshots/${encodeURIComponent(e)}${s}`);return yt(n)}function Te(e,i){const s=i!==void 0?`?placeId=${i}`:"";return`${W}/api/ui-studio/snapshots/${encodeURIComponent(e)}/image${s}`}const St=1e4;function qe(e=50){const[i,s]=g.useState(null),[n,o]=g.useState(!0),[a,l]=g.useState(null),u=g.useCallback(async()=>{try{const p=await _e(void 0,e);s(p),l(null)}catch(p){l(p instanceof Error?p.message:String(p))}finally{o(!1)}},[e]);return g.useEffect(()=>{let p=!1;const d=async()=>{try{const h=await _e(void 0,e);p||(s(h),l(null))}catch(h){p||l(h instanceof Error?h.message:String(h))}finally{p||o(!1)}};d();const m=setInterval(()=>{d()},St);return()=>{p=!0,clearInterval(m)}},[e]),{data:i,loading:n,error:a,refresh:u}}const xt="_page_12gq5_2",vt="_grid_12gq5_9",Ct="_card_12gq5_16",bt="_cardBodyButton_12gq5_31",wt="_thumb_12gq5_48",kt="_runtimeObservationPlaceholder_12gq5_57",jt="_badges_12gq5_69",It="_priorityHighBadge_12gq5_77",Nt="_priorityMediumBadge_12gq5_78",Pt="_priorityLowBadge_12gq5_79",Tt="_cardMeta_12gq5_109",qt="_target_12gq5_115",Rt="_time_12gq5_122",Bt="_drawer_12gq5_127",Gt="_drawerToolbar_12gq5_144",Dt="_drawerTitleBlock_12gq5_155",At="_drawerEyebrow_12gq5_162",Mt="_drawerTarget_12gq5_171",$t="_drawerToolbarActions_12gq5_181",Lt="_closeBtn_12gq5_189",Et="_detailBody_12gq5_210",Ut="_screenshotPreviewFrame_12gq5_217",Ot="_fullImg_12gq5_230",Ht="_metaDl_12gq5_237",Ft="_platformGuidance_12gq5_249",zt="_platformGuidanceItem_12gq5_267",Vt="_platformGuidanceKind_12gq5_277",Wt="_errorMsg_12gq5_290",Kt="_suggestionsWrap_12gq5_295",Yt="_prioritySection_12gq5_302",Qt="_sectionHighHeader_12gq5_306",Jt="_sectionLowHeader_12gq5_312",Xt="_sectionMediumHeader_12gq5_318",Zt="_groupCard_12gq5_324",ei="_groupHeader_12gq5_331",ti="_groupLabel_12gq5_347",ii="_groupCount_12gq5_352",si="_groupChevron_12gq5_359",ai="_groupBody_12gq5_363",ri="_groupDescription_12gq5_366",ni="_groupFix_12gq5_371",oi="_falsePositive_12gq5_380",li="_itemList_12gq5_388",ci="_suggestionItem_12gq5_396",ui="_suggestionInfo_12gq5_406",di="_pathBreadcrumb_12gq5_412",pi="_currentValue_12gq5_421",hi="_copyFixBtn_12gq5_425",_i="_emptySuggestions_12gq5_439",gi="_sampleBanner_12gq5_447",mi="_sampleBannerRow_12gq5_460",yi="_sampleBannerMain_12gq5_468",fi="_sampleBadge_12gq5_476",Si="_sampleTitle_12gq5_486",xi="_sampleMessage_12gq5_493",vi="_sampleActions_12gq5_500",Ci="_primaryAction_12gq5_508",bi="_secondaryAction_12gq5_509",wi="_emptyState_12gq5_544",ki="_pluginGuideCard_12gq5_552",ji="_pluginGuideMarker_12gq5_563",Ii="_pluginGuideBody_12gq5_578",Ni="_pluginGuideTitle_12gq5_582",Pi="_pluginGuideMessage_12gq5_590",Ti="_pluginGuideChecklist_12gq5_597",qi="_pluginGuideWaiting_12gq5_620",Ri="_pluginGuideDot_12gq5_629",Bi="_analysisWorkspace_12gq5_637",Gi="_analysisMainColumn_12gq5_642",Di="_analysisSummaryPanel_12gq5_647",Ai="_recentCapturesHeader_12gq5_660",Mi="_analysisSummaryText_12gq5_667",$i="_recentCapturesMeta_12gq5_668",Li="_analysisReportGrid_12gq5_674",Ei="_analysisReportGroup_12gq5_681",Ui="_analysisReportCard_12gq5_685",Oi="_analysisReportThumb_12gq5_707",Hi="_analysisReportBody_12gq5_716",Fi="_analysisReportTopline_12gq5_723",zi="_analysisVerdict_12gq5_730",Vi="_analysisVerdict_needsFix_12gq5_741",Wi="_analysisVerdict_review_12gq5_742",Ki="_analysisVerdict_incomplete_12gq5_747",Yi="_analysisVerdict_passed_12gq5_752",Qi="_analysisReportCounts_12gq5_757",Ji="_readinessSummary_12gq5_762",Xi="_readinessChip_12gq5_768",Zi="_readinessChipReady_12gq5_783",es="_readinessChipPending_12gq5_789",ts="_primaryReadinessBlock_12gq5_795",is="_criticSummary_12gq5_802",ss="_analysisReportTarget_12gq5_821",as="_analysisReportIssue_12gq5_830",rs="_analysisReportCoverage_12gq5_836",ns="_coverageChips_12gq5_842",os="_coverageChip_12gq5_842",ls="_coverageChip_completed_12gq5_863",cs="_coverageChip_failed_12gq5_868",us="_coverageChip_skipped_12gq5_873",ds="_coverageChip_not_requested_12gq5_874",ps="_analysisReportMeta_12gq5_879",hs="_analysisChildList_12gq5_886",_s="_analysisChildRow_12gq5_897",gs="_analysisChildPath_12gq5_918",ms="_analysisChildSummary_12gq5_927",ys="_analysisChildDetailHint_12gq5_928",fs="_drawerAnalysisSummary_12gq5_937",Ss="_drawerAnalysisSummaryItem_12gq5_948",xs="_drawerAnalysisLabel_12gq5_955",vs="_drawerAnalysisCounts_12gq5_961",Cs="_drawerAnalysisValue_12gq5_962",bs="_recentCapturesSection_12gq5_967",ws="_drawerPrimaryActions_12gq5_979",ks="_drawerActionBtn_12gq5_986",js="_drawerMoreMenu_12gq5_1015",Is="_drawerMoreButton_12gq5_1020",Ns="_drawerMoreMenuBody_12gq5_1045",Ps="_drawerMenuItem_12gq5_1058",Ts="_drawerMenuItemDanger_12gq5_1081",qs="_actionErrMsg_12gq5_1090",Rs="_actionStatusMsg_12gq5_1099",Bs="_actionStatus_info_12gq5_1113",Gs="_actionStatus_success_12gq5_1119",Ds="_actionStatus_warning_12gq5_1125",As="_actionStatusDetail_12gq5_1131",Ms="_galleryHeader_12gq5_1137",$s="_cardChecked_12gq5_1154",Ls="_cardCheckbox_12gq5_1161",Es="_captureSelectionActions_12gq5_1176",Us="_selectionToolbar_12gq5_1185",Os="_selectionBar_12gq5_1186",Hs="_selectionToolbarCount_12gq5_1205",Fs="_selectionToolbarActions_12gq5_1212",zs="_selectionBarBtn_12gq5_1219",Vs="_selectionBarBtnDanger_12gq5_1245",r={page:xt,grid:vt,card:Ct,cardBodyButton:bt,thumb:wt,runtimeObservationPlaceholder:kt,badges:jt,priorityHighBadge:It,priorityMediumBadge:Nt,priorityLowBadge:Pt,cardMeta:Tt,target:qt,time:Rt,drawer:Bt,drawerToolbar:Gt,drawerTitleBlock:Dt,drawerEyebrow:At,drawerTarget:Mt,drawerToolbarActions:$t,closeBtn:Lt,detailBody:Et,screenshotPreviewFrame:Ut,fullImg:Ot,metaDl:Ht,platformGuidance:Ft,platformGuidanceItem:zt,platformGuidanceKind:Vt,errorMsg:Wt,suggestionsWrap:Kt,prioritySection:Yt,sectionHighHeader:Qt,sectionLowHeader:Jt,sectionMediumHeader:Xt,groupCard:Zt,groupHeader:ei,groupLabel:ti,groupCount:ii,groupChevron:si,groupBody:ai,groupDescription:ri,groupFix:ni,falsePositive:oi,itemList:li,suggestionItem:ci,suggestionInfo:ui,pathBreadcrumb:di,currentValue:pi,copyFixBtn:hi,emptySuggestions:_i,sampleBanner:gi,sampleBannerRow:mi,sampleBannerMain:yi,sampleBadge:fi,sampleTitle:Si,sampleMessage:xi,sampleActions:vi,primaryAction:Ci,secondaryAction:bi,emptyState:wi,pluginGuideCard:ki,pluginGuideMarker:ji,pluginGuideBody:Ii,pluginGuideTitle:Ni,pluginGuideMessage:Pi,pluginGuideChecklist:Ti,pluginGuideWaiting:qi,pluginGuideDot:Ri,analysisWorkspace:Bi,analysisMainColumn:Gi,analysisSummaryPanel:Di,recentCapturesHeader:Ai,analysisSummaryText:Mi,recentCapturesMeta:$i,analysisReportGrid:Li,analysisReportGroup:Ei,analysisReportCard:Ui,analysisReportThumb:Oi,analysisReportBody:Hi,analysisReportTopline:Fi,analysisVerdict:zi,analysisVerdict_needsFix:Vi,analysisVerdict_review:Wi,analysisVerdict_incomplete:Ki,analysisVerdict_passed:Yi,analysisReportCounts:Qi,readinessSummary:Ji,readinessChip:Xi,readinessChipReady:Zi,readinessChipPending:es,primaryReadinessBlock:ts,criticSummary:is,analysisReportTarget:ss,analysisReportIssue:as,analysisReportCoverage:rs,coverageChips:ns,coverageChip:os,coverageChip_completed:ls,coverageChip_failed:cs,coverageChip_skipped:us,coverageChip_not_requested:ds,analysisReportMeta:ps,analysisChildList:hs,analysisChildRow:_s,analysisChildPath:gs,analysisChildSummary:ms,analysisChildDetailHint:ys,drawerAnalysisSummary:fs,drawerAnalysisSummaryItem:Ss,drawerAnalysisLabel:xs,drawerAnalysisCounts:vs,drawerAnalysisValue:Cs,recentCapturesSection:bs,drawerPrimaryActions:ws,drawerActionBtn:ks,drawerMoreMenu:js,drawerMoreButton:Is,drawerMoreMenuBody:Ns,drawerMenuItem:Ps,drawerMenuItemDanger:Ts,actionErrMsg:qs,actionStatusMsg:Rs,actionStatus_info:Bs,actionStatus_success:Gs,actionStatus_warning:Ds,actionStatusDetail:As,galleryHeader:Ms,cardChecked:$s,cardCheckbox:Ls,captureSelectionActions:Es,selectionToolbar:Us,selectionBar:Os,selectionToolbarCount:Hs,selectionToolbarActions:Fs,selectionBarBtn:zs,selectionBarBtnDanger:Vs};function Ws({snapshot:e,placeId:i,onClick:s,imageUrlOverride:n,selectable:o,selected:a,onToggleSelect:l}){var v,I,B;const{t:u}=k(),p=((v=e.design_check_summary)==null?void 0:v.priority_high)??0,d=((I=e.design_check_summary)==null?void 0:I.priority_medium)??0,m=((B=e.design_check_summary)==null?void 0:B.priority_low)??0,h=new Date(e.captured_at*1e3).toLocaleString(),S=n??Te(e.snapshot_id,i),f=()=>{l==null||l(e.snapshot_id)};return t.jsxs("div",{className:`${r.card} ${a?r.cardChecked:""}`,children:[o&&t.jsx(y,{text:u("uiStudio.gallery.cardCheckbox.tooltip","Select this capture. Pick multiple to delete them together."),children:t.jsx(Ye,{className:r.cardCheckbox,"aria-label":u("uiStudio.gallery.cardCheckbox","Select screenshot"),checked:!!a,onChange:f})}),t.jsxs("button",{className:r.cardBodyButton,onClick:j=>s(j.currentTarget),type:"button",children:[e.image?t.jsx("img",{className:r.thumb,src:S,alt:e.snapshot_id,loading:"lazy"}):t.jsx("div",{className:`${r.thumb} ${r.runtimeObservationPlaceholder}`,role:"img","aria-label":u("uiStudio.runtimeStructureObservation","Runtime structure observation"),children:u("uiStudio.runtimeStructureObservation","Runtime structure observation")}),t.jsxs("div",{className:r.badges,children:[p>0&&t.jsx(y,{text:u("uiStudio.gallery.priorityHighBadge.tooltip","Number of suggestions to review first. Click for details."),children:t.jsx("span",{className:r.priorityHighBadge,children:p})}),d>0&&t.jsx(y,{text:u("uiStudio.gallery.priorityMediumBadge.tooltip","Number of recommended suggestions."),children:t.jsx("span",{className:r.priorityMediumBadge,children:d})}),m>0&&t.jsx(y,{text:u("uiStudio.gallery.priorityLowBadge.tooltip","Number of optional improvements."),children:t.jsx("span",{className:r.priorityLowBadge,children:m})})]}),t.jsxs("div",{className:r.cardMeta,children:[t.jsx("div",{className:r.target,children:e.target??e.scope}),t.jsx("div",{className:r.time,children:h})]})]})]})}const Ks={touch_target:"touchTarget",contrast:"contrast",text_scaled:"textScaled",safezone:"safezone",min_text_size:"minTextSize"};function Ys(e){return e.rule==="contrast"&&/\.(Icon|Avatar|EmptyIcon|GoldIcon|[A-Za-z]*Icon)$/.test(e.path)}const Qs={touch_target:{checkLabel:"터치 타겟 크기",description:"모바일에서 손가락으로 누르기 편한 최소 크기를 만족하는지 확인합니다.",howToFix:"버튼 Size 를 44x44 px 이상으로 키우거나 UIPadding 으로 터치 영역을 확장하세요.",buildUpdateCommand:e=>JSON.stringify({action:"update",targetPath:e.path,changes:{properties:{Size:{xScale:0,xOffset:44,yScale:0,yOffset:44}}}},null,2)},contrast:{checkLabel:"텍스트 대비",description:"텍스트와 배경의 명암 비율이 WCAG 접근성 기준을 만족하는지 확인합니다.",howToFix:"TextColor3 를 더 밝은 색(예: #FFFFFF) 으로 바꾸거나, 배경(BackgroundColor3)을 어둡게 조정하세요.",falsePositiveNote:"이모지 아이콘의 경우 색이 고정되어 대비 규칙이 오탐하는 경우가 많습니다. 실제 가독성에 문제 없으면 무시해도 됩니다.",buildUpdateCommand:e=>JSON.stringify({action:"update",targetPath:e.path,changes:{properties:{TextColor3:{r:255,g:255,b:255}}}},null,2)},text_scaled:{checkLabel:"TextScaled 사용",description:"TextScaled 가 켜져 있으나 UITextSizeConstraint 가 없으면 언어 확장 시 레이아웃이 깨질 수 있습니다.",howToFix:"해당 TextLabel 에 UITextSizeConstraint 자식을 추가하고 MaxTextSize 를 지정하세요.",buildUpdateCommand:e=>JSON.stringify({action:"update",targetPath:e.path,changes:{addChildren:[{className:"UITextSizeConstraint",name:"SizeConstraint",properties:{MaxTextSize:24,MinTextSize:10}}]}},null,2)},safezone:{checkLabel:"세이프존 배치",description:"버튼이 플랫폼별 세이프존(노치·홈 인디케이터·TV safe margin) 안에 있는지 확인합니다.",howToFix:"화면 가장자리 배치가 가독성이나 조작에 영향을 준다면, 측정된 영역과 적용 가능한 Roblox 지침을 검토하고 의도한 배치를 존중하는 대안을 고려하세요.",buildUpdateCommand:()=>null},min_text_size:{checkLabel:"최소 폰트 크기",description:"텍스트가 너무 작아 가독성이 떨어지는지 확인합니다. 브리프 기준 하한을 사용합니다.",howToFix:"TextSize 를 14 이상(본문 기준)으로 올리세요.",buildUpdateCommand:e=>{const i=typeof e.expected=="string"?parseInt(e.expected.replace(/[^\d]/g,""),10):14;return JSON.stringify({action:"update",targetPath:e.path,changes:{properties:{TextSize:Number.isFinite(i)?i:14}}},null,2)}}};function Js(e,i,s){const n=Ks[e];return n?{...i,checkLabel:s(`uiStudio.fix.${n}.label`,i.checkLabel),description:s(`uiStudio.fix.${n}.description`,i.description),howToFix:s(`uiStudio.fix.${n}.howToFix`,i.howToFix),falsePositiveNote:i.falsePositiveNote?s(`uiStudio.fix.${n}.falsePositive`,i.falsePositiveNote):void 0}:i}function Xs(e,i){const s=Qs[e]??null;return s?i?Js(e,s,i):s:null}function Zs(e){return Ys(e)}function ea(e,i){const s=new Map;for(const o of e){const a=`${o.displayPriority}::${o.rule}`,l=s.get(a)??[];l.push(o),s.set(a,l)}const n=[];for(const[o,a]of s){const[l,u]=o.split("::"),p=a.filter(Zs).length;n.push({rule:u??"unknown",priority:l,items:a,fixTemplate:Xs(u??"",i),falsePositiveRatio:a.length>0?p/a.length:0})}return n.sort((o,a)=>{const l={priority_high:0,priority_medium:1,priority_low:2};return o.priority!==a.priority?l[o.priority]-l[a.priority]:a.items.length-o.items.length}),{high:n.filter(o=>o.priority==="priority_high"),medium:n.filter(o=>o.priority==="priority_medium"),low:n.filter(o=>o.priority==="priority_low")}}function Re(e){const i=e.split("."),s=i[i.length-1]??e,n=i[i.length-2],o=n?`${n} > ${s}`:s;return{full:e,breadcrumb:o,leaf:s}}function ta(e){if(!e||typeof e!="object")return!1;const i=e;return["id","revision","title","summary","applies_when","limitations"].every(s=>typeof i[s]=="string")&&(i.kind==="constraint"||i.kind==="recommendation")&&!!i.source&&["url","section","checked_at"].every(s=>typeof i.source[s]=="string")}function ia(e){try{const i=new URL(e);return i.protocol==="https:"&&i.hostname==="create.roblox.com"&&!i.username&&!i.password?i.href:void 0}catch{return}}function sa({summary:e}){const{t:i}=k(),s=Array.isArray(e==null?void 0:e.platform_guidance)?e.platform_guidance.filter(ta):[];return s.length===0?null:t.jsxs("details",{className:r.platformGuidance,children:[t.jsx("summary",{children:i("uiStudio.platformGuidance.title","Roblox guidance")}),t.jsx("p",{children:i("uiStudio.platformGuidance.context","Reference guidance for the AI to interpret in your project. It does not authorize changes.")}),s.map(n=>{const o=ia(n.source.url);return t.jsxs("section",{className:r.platformGuidanceItem,children:[t.jsx("h4",{children:n.title}),t.jsx("p",{className:r.platformGuidanceKind,children:n.kind==="constraint"?i("uiStudio.platformGuidance.constraint","API constraint"):i("uiStudio.platformGuidance.recommendation","Recommendation")}),t.jsx("p",{children:n.summary}),t.jsxs("dl",{className:r.metaDl,children:[t.jsx("dt",{children:i("uiStudio.platformGuidance.appliesWhen","Applies when")}),t.jsx("dd",{children:n.applies_when}),t.jsx("dt",{children:i("uiStudio.platformGuidance.limitations","Limits")}),t.jsx("dd",{children:n.limitations}),t.jsx("dt",{children:i("uiStudio.platformGuidance.source","Official source")}),t.jsx("dd",{children:o?t.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:n.source.section}):n.source.section}),t.jsx("dt",{children:i("uiStudio.platformGuidance.checkedAt","Source checked")}),t.jsx("dd",{children:n.source.checked_at}),t.jsx("dt",{children:i("uiStudio.platformGuidance.revision","Guidance revision")}),t.jsx("dd",{children:n.revision})]})]},`${n.id}:${n.revision}`)})]})}function Be(e){return typeof e=="object"&&e!==null}function ge(e){return Be(e.data)?e.data:{}}function se(e,i){const s=e[i];return Be(s)?s:{}}function Q(e,i){const s=e[i];return typeof s=="string"?s:null}function J(e,i){const s=e[i];return typeof s=="number"&&Number.isFinite(s)?s:0}function aa(e){const i=se(e,"design_check_summary");return{priority_high:J(i,"priority_high"),priority_medium:J(i,"priority_medium"),priority_low:J(i,"priority_low")}}function me(e){if(!(e.success??e.ok??!e.error))throw new Error(e.error??"UI Studio action failed")}function ye(e,i){return Ge(e,aa(i))}function O(e,i,s,n,o){const a=e(i,s);return o?`${a}: ${o} · ${n}`:`${a}: ${n}`}function ra(e){const i=e.design_check_summary;return((i==null?void 0:i.priority_high)??0)>0?"needsFix":(i==null?void 0:i.readiness)==="insufficient_evidence"?"incomplete":((i==null?void 0:i.priority_medium)??0)>0||((i==null?void 0:i.priority_low)??0)>0?"review":"passed"}function na(e,i){return i==="needsFix"||i==="review"?e("uiStudio.analysis.verdict.hasSuggestions","개선 제안 있음"):i==="incomplete"?e("uiStudio.analysis.verdict.incomplete","검토 증거 부족"):e("uiStudio.analysis.verdict.passed","현재 개선 제안 없음")}function X(e,i){return`${i}${e("uiStudio.storage.countSuffix","개")}`}function Ge(e,i){return`${e("uiStudio.priorityHigh","우선 검토")} ${X(e,(i==null?void 0:i.priority_high)??0)} · ${e("uiStudio.priorityMedium","검토 권장")} ${X(e,(i==null?void 0:i.priority_medium)??0)} · ${e("uiStudio.priorityLow","선택 개선")} ${X(e,(i==null?void 0:i.priority_low)??0)}`}function oa(e,i){return Ge(e,i.design_check_summary)}function la(e,i){return i==="recompose"?e("uiStudio.primaryVisual.recompose","Recompose"):i==="refine"?e("uiStudio.primaryVisual.refine","Refine"):i==="approved"?e("uiStudio.primaryVisual.approved","Approved"):e("uiStudio.primaryVisual.unknown","Unknown")}function ca(e,i){return i==="ready"?e("uiStudio.readiness.ready","Ready"):i==="review_required"?e("uiStudio.readiness.reviewRequired","Review required"):i==="insufficient_evidence"?e("uiStudio.readiness.insufficient","Evidence incomplete"):e("uiStudio.readiness.unknown","Readiness unknown")}function ua({snapshotId:e,placeId:i,onClose:s,sampleDetail:n,tier:o,onActionDone:a}){const[l,u]=g.useState(n??null),[p,d]=g.useState(null),[m,h]=g.useState(null),[S,f]=g.useState(null),[v,I]=g.useState(null),[B,j]=g.useState(null),{t:_}=k(),{trackEvent:q}=E(),N=o==="pro";g.useEffect(()=>{if(n){u(n),d(null);return}let b=!1;return ft(e,i).then(A=>{b||u(A)}).catch(A=>{b||d(A instanceof Error?A.message:String(A))}),()=>{b=!0}},[e,i,n]);const C=async()=>{if(l!=null&&l.target){q("dashboard_click_event",{click_target:"ui_studio_capture_current",page:"ui-studio",tab:"ui_studio_analysis"}),h(null),I("preview"),f({tone:"info",message:_("uiStudio.actions.previewRunning","캡처 중..."),detail:_("uiStudio.actions.previewRunningDetail","완료되면 새 화면 캡처 파일 ID를 표시합니다.")});try{const b=await ce("preview",{targetPath:l.target,placeId:i});me(b);const A=ge(b),$=Q(A,"snapshot_id"),Y=se(A,"screenshot"),x=se(A,"meta"),M=Q(Y,"saved_path"),T=Q(x,"persist_warning"),F=ye(_,A);f(T?{tone:"warning",message:O(_,"uiStudio.actions.previewNeedsSaveCheck","캡처 완료, 저장 확인 필요",F,$),detail:T}:$&&M?{tone:"success",message:O(_,"uiStudio.actions.previewSaved","새 화면 캡처 저장 완료",F,$),detail:_("uiStudio.actions.previewSavedDetail","기존 화면 캡처는 변경하지 않고 새 파일로 저장했습니다.")}:$?{tone:"warning",message:O(_,"uiStudio.actions.previewComplete","캡처 완료",F,$),detail:_("uiStudio.actions.previewSavedPathMissing","새 화면 캡처 ID는 받았지만 저장 경로를 확인하지 못했습니다.")}:{tone:"warning",message:O(_,"uiStudio.actions.previewComplete","캡처 완료",F),detail:_("uiStudio.actions.previewSnapshotIdMissing","새 화면 캡처 ID를 확인하지 못했습니다. 목록을 새로고침해 저장 여부를 확인해 주세요.")}),await(a==null?void 0:a())}catch(b){h(b instanceof Error?b.message:String(b))}finally{I(null)}}},P=async()=>{if(l!=null&&l.target){q("dashboard_click_event",{click_target:"ui_studio_check_again",page:"ui-studio",tab:"ui_studio_analysis"}),h(null),I("check"),f({tone:"info",message:_("uiStudio.actions.designCheckRunning","개선 제안 확인 중..."),detail:_("uiStudio.actions.designCheckRunningDetail","완료되면 우선 검토/검토 권장/선택 개선 항목 수를 표시합니다.")});try{const b=await ce("check",{targetPath:l.target,placeId:i});me(b);const A=ge(b),$=ye(_,A);f({tone:"success",message:O(_,"uiStudio.actions.designCheckComplete","개선 제안 확인 완료",$),detail:_("uiStudio.actions.designCheckNoSnapshotSaved","이 작업은 화면 캡처 파일을 새로 저장하지 않습니다.")}),await(a==null?void 0:a())}catch(b){h(b instanceof Error?b.message:String(b))}finally{I(null)}}},D=async()=>{h(null),f(null);try{await Je(i,e),await(a==null?void 0:a()),j(null),s()}catch(b){throw h(b instanceof Error?b.message:String(b)),b}},G=N?void 0:_("uiStudio.actions.proRequired","Pro에서 사용 가능"),w=l!=null&&l.target?Re(l.target):null;return t.jsxs("div",{className:r.drawer,children:[t.jsxs("div",{className:r.drawerToolbar,"data-testid":"snapshot-detail-toolbar",children:[t.jsxs("div",{className:r.drawerTitleBlock,children:[t.jsx("span",{className:r.drawerEyebrow,children:_("uiStudio.analysis.detailDialog","Analysis detail")}),t.jsx("span",{className:r.drawerTarget,title:(w==null?void 0:w.full)??e,children:(w==null?void 0:w.breadcrumb)??e})]}),t.jsxs("div",{className:r.drawerToolbarActions,children:[l&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:r.drawerPrimaryActions,children:[t.jsx(y,{text:G??_("uiStudio.actions.captureCurrentState.tooltip","Save the UI currently shown in Studio as a new capture. Existing captures are kept."),children:t.jsxs("button",{className:r.drawerActionBtn,onClick:()=>void C(),disabled:!N||!l.target||v!==null,type:"button",children:[t.jsx(ot,{size:15,"aria-hidden":"true"}),t.jsx("span",{children:_("uiStudio.actions.captureCurrentState","현재 상태 캡처")})]})}),t.jsx(y,{text:G??_("uiStudio.actions.checkSuggestionsAgain.tooltip","Recompute suggestions for this capture without taking a new screenshot."),children:t.jsxs("button",{className:r.drawerActionBtn,onClick:()=>void P(),disabled:!N||!l.target||v!==null,type:"button",children:[t.jsx(ze,{size:15,"aria-hidden":"true"}),t.jsx("span",{children:_("uiStudio.actions.checkSuggestionsAgain","개선 제안 다시 확인")})]})})]}),t.jsxs("details",{className:r.drawerMoreMenu,children:[t.jsx("summary",{className:r.drawerMoreButton,title:_("uiStudio.actions.more.tooltip","Open additional actions."),"aria-label":_("uiStudio.actions.more","More"),children:t.jsx(ct,{size:18,"aria-hidden":"true"})}),t.jsx("div",{className:r.drawerMoreMenuBody,children:t.jsx(y,{text:G??_("uiStudio.actions.deleteSnapshot.tooltip","Delete only this capture file. The actual UI in Roblox Studio is not affected."),children:t.jsx("button",{className:`${r.drawerMenuItem} ${r.drawerMenuItemDanger}`,onClick:()=>{q("dashboard_click_event",{click_target:"ui_studio_delete_snapshot",page:"ui-studio",tab:"ui_studio_analysis"}),j("deleteSnapshot")},disabled:!N,type:"button",children:_("uiStudio.actions.deleteSnapshot","이 화면 캡처 삭제")})})})]})]}),t.jsx(y,{text:_("uiStudio.detailClose.tooltip","Close this detail panel."),children:t.jsx("button",{className:r.closeBtn,onClick:s,type:"button","aria-label":_("uiStudio.detailClose","Close"),children:t.jsx(Ve,{size:18,"aria-hidden":"true"})})})]})]}),p&&t.jsx("div",{className:r.errorMsg,children:p}),l&&t.jsxs("div",{className:r.detailBody,children:[m&&t.jsx("div",{className:r.actionErrMsg,children:m}),S&&t.jsxs("div",{className:`${r.actionStatusMsg} ${r[`actionStatus_${S.tone}`]??""}`,children:[t.jsx("div",{children:S.message}),S.detail&&t.jsx("div",{className:r.actionStatusDetail,children:S.detail})]}),t.jsx(da,{detail:l}),t.jsx("div",{className:r.screenshotPreviewFrame,"data-testid":"analysis-screenshot-preview",children:l.image?t.jsx("img",{className:r.fullImg,src:l.image_url,alt:l.snapshot_id}):t.jsx("div",{className:`${r.fullImg} ${r.runtimeObservationPlaceholder}`,role:"img","aria-label":_("uiStudio.runtimeStructureObservation","Runtime structure observation"),children:_("uiStudio.runtimeStructureObservation","Runtime structure observation")})}),t.jsx(ga,{items:l.check_results,summary:l.design_check_summary}),t.jsx(sa,{summary:l.design_check_summary}),t.jsxs("dl",{className:r.metaDl,children:[t.jsx("dt",{children:t.jsx(R,{label:_("uiStudio.capturedAt","Captured"),tooltip:_("uiStudio.capturedAt.tooltip","When this screen was captured.")})}),t.jsx("dd",{children:new Date(l.captured_at*1e3).toLocaleString()}),t.jsx("dt",{children:t.jsx(R,{label:_("uiStudio.scope","Scope"),tooltip:_("uiStudio.scope.tooltip","Capture scope (full screen or a specific UI).")})}),t.jsx("dd",{children:l.scope}),l.target&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(R,{label:_("uiStudio.target","Target"),tooltip:_("uiStudio.target.tooltip","Exact path of the captured UI instance.")})}),t.jsx("dd",{children:l.target})]}),l.brief_id&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(R,{label:_("uiStudio.briefId","Brief"),tooltip:_("uiStudio.briefId.tooltip","Identifier of the design brief that produced this UI.")})}),t.jsx("dd",{children:l.brief_id})]})]})]}),B==="deleteSnapshot"&&t.jsx(le,{title:_("uiStudio.confirm.deleteSnapshotTitle","화면 캡처 삭제"),message:_("uiStudio.confirm.deleteSnapshotMessage","이 화면 캡처 파일만 삭제됩니다 (Studio 인스턴스 보존)."),danger:!0,confirmLabel:_("common.delete","삭제"),onConfirm:D,onClose:()=>j(null)})]})}function da({detail:e}){const{t:i}=k(),s=ra(e);return t.jsxs("section",{className:r.drawerAnalysisSummary,children:[t.jsxs("div",{className:r.drawerAnalysisSummaryItem,children:[t.jsx("span",{className:r.drawerAnalysisLabel,children:t.jsx(R,{label:i("uiStudio.analysis.verdictLabel","개선 요약"),tooltip:i("uiStudio.analysis.verdictLabel.tooltip","Overall improvement verdict for this capture.")})}),t.jsx("span",{className:`${r.analysisVerdict} ${r[`analysisVerdict_${s}`]??""}`,children:na(i,s)}),t.jsx("span",{className:r.drawerAnalysisCounts,children:oa(i,e)})]}),t.jsxs("div",{className:r.drawerAnalysisSummaryItem,children:[t.jsx("span",{className:r.drawerAnalysisLabel,children:t.jsx(R,{label:i("uiStudio.analysis.thresholds","검토 기준"),tooltip:i("uiStudio.analysis.thresholds.tooltip","The threshold set used for this review (default or custom).")})}),t.jsx("span",{className:r.drawerAnalysisValue,children:e.thresholds_source})]}),t.jsx(pa,{summary:e.design_check_summary}),t.jsx(_a,{summary:e.design_check_summary}),t.jsx(ha,{summary:e.design_check_summary})]})}function pa({summary:e}){const{t:i}=k();if(!e)return null;const s=e.functional_safe===!0?i("uiStudio.functional.checkedScopeSafe","Checked scope safe"):e.functional_safe===!1?i("uiStudio.functional.risk","Risk found"):i("uiStudio.functional.unknown","Unknown"),n=e.responsive_requirement==="required"?i("uiStudio.responsive.required","Required"):e.responsive_requirement==="recommended"?i("uiStudio.responsive.recommended","Recommended"):i("uiStudio.responsive.unknown","Unknown");return t.jsxs("div",{className:r.primaryReadinessBlock,children:[t.jsxs("div",{className:r.readinessSummary,"aria-label":i("uiStudio.readiness.summary","UI readiness"),children:[t.jsxs("span",{className:r.readinessChip,children:[i("uiStudio.primaryVisual.label","Primary visual")," · ",la(i,e.primary_visual_verdict)]}),t.jsxs("span",{className:r.readinessChip,children:[i("uiStudio.functional.label","Functional")," · ",s]}),t.jsxs("span",{className:r.readinessChip,children:[i("uiStudio.responsive.label","Responsive")," · ",n]}),e.observation_source&&t.jsxs("span",{className:r.readinessChip,children:[i("uiStudio.observationSource.label","검사 출처")," · ",e.observation_source==="play_client"?i("uiStudio.observationSource.playClient","Play client"):i("uiStudio.observationSource.edit","Edit")]}),t.jsx("span",{className:`${r.readinessChip} ${e.readiness==="ready"?r.readinessChipReady:r.readinessChipPending}`,children:ca(i,e.readiness)})]}),e.critic_summary&&t.jsxs("p",{className:r.criticSummary,children:[t.jsx("span",{children:i("uiStudio.criticSummary","Critic summary")}),e.critic_summary]})]})}function ha({summary:e}){var s,n;const{t:i}=k();return!e||!((s=e.state_coverage)!=null&&s.length)&&!((n=e.limitations)!=null&&n.length)?null:t.jsxs("div",{className:r.primaryReadinessBlock,children:[e.state_coverage&&e.state_coverage.length>0&&t.jsx("div",{className:r.coverageChips,"aria-label":i("uiStudio.stateCoverage.label","상태별 검토"),children:e.state_coverage.map(o=>t.jsxs("span",{className:r.coverageChip,title:o.reasons.join(", "),children:[o.stateId," · ",o.status==="completed"?i("uiStudio.analysis.coverageStatus.completed","완료"):o.status==="failed"?i("uiStudio.analysis.coverageStatus.failed","실패"):i("uiStudio.analysis.coverageStatus.skipped","생략")]},`${o.stateId}:${o.status}`))}),e.limitations&&e.limitations.length>0&&t.jsx("div",{className:r.coverageChips,"aria-label":i("uiStudio.limitations.label","검토 제한"),children:e.limitations.map(o=>t.jsx("span",{className:r.coverageChip,children:o},o))})]})}function _a({summary:e}){const{t:i}=k(),s=e==null?void 0:e.coverage_dimensions;if(!s)return null;const n=[["Structure",s.structure],["Visual",s.visual],["Interaction",s.interaction],["Primary view",s.primary_view_context],["Responsive",s.responsive_viewport]];return t.jsx("div",{className:r.coverageChips,"aria-label":i("uiStudio.analysis.coverageDimensions","검토 범위"),children:n.map(([o,a])=>t.jsxs("span",{className:`${r.coverageChip} ${r[`coverageChip_${a.status}`]??""}`,title:a.reasons.join(", "),children:[o," · ",a.status==="completed"?i("uiStudio.analysis.coverageStatus.completed","완료"):a.status==="failed"?i("uiStudio.analysis.coverageStatus.failed","실패"):i("uiStudio.analysis.coverageStatus.skipped","생략")]},o))})}function ga({items:e,summary:i}){const{t:s}=k();if(e.length===0)return t.jsx("p",{className:r.emptySuggestions,children:(i==null?void 0:i.readiness)==="insufficient_evidence"?s("uiStudio.noSuggestionsIncomplete","제안은 없지만 검토되지 않은 범위가 남아 있습니다."):s("uiStudio.noSuggestions","현재 개선 제안 없음")});const{high:n,medium:o,low:a}=ea(e,s);return t.jsxs("div",{className:r.suggestionsWrap,children:[t.jsx("h3",{children:t.jsx(R,{label:s("uiStudio.designCheckResultsTitle","Design Check suggestions"),tooltip:s("uiStudio.designCheckResultsTitle.tooltip","All improvement suggestions found in this capture.")})}),n.length>0&&t.jsxs("section",{className:r.prioritySection,children:[t.jsx("h4",{className:r.sectionHighHeader,children:s("uiStudio.highPrioritySection","우선 검토")}),n.map(l=>t.jsx(Z,{group:l},`h-${l.rule}`))]}),o.length>0&&t.jsxs("section",{className:r.prioritySection,children:[t.jsx("h4",{className:r.sectionMediumHeader,children:s("uiStudio.mediumPrioritySection","검토 권장")}),o.map(l=>t.jsx(Z,{group:l},`m-${l.rule}`))]}),a.length>0&&t.jsxs("section",{className:r.prioritySection,children:[t.jsx("h4",{className:r.sectionLowHeader,children:s("uiStudio.lowPrioritySection","선택 개선")}),a.map(l=>t.jsx(Z,{group:l},`l-${l.rule}`))]})]})}function Z({group:e}){var l,u,p;const{t:i}=k(),[s,n]=g.useState(e.priority==="priority_high"&&e.items.length<=5),o=e.falsePositiveRatio>=.5&&!!((l=e.fixTemplate)!=null&&l.falsePositiveNote),a=((u=e.fixTemplate)==null?void 0:u.checkLabel)??e.rule;return t.jsxs("div",{className:r.groupCard,children:[t.jsx(y,{text:i("uiStudio.suggestionGroup.tooltip","Suggestions of the same kind grouped together. Click to expand or collapse."),children:t.jsxs("button",{className:r.groupHeader,onClick:()=>n(d=>!d),type:"button",children:[t.jsx("span",{className:r.groupLabel,children:a}),t.jsx(y,{text:i("uiStudio.groupSummary.tooltip","Number of UI elements matching this group."),children:t.jsxs("span",{className:r.groupCount,children:[e.items.length," ",i("uiStudio.groupSummary","items")]})}),t.jsx("span",{className:r.groupChevron,children:s?"▾":"▸"})]})}),s&&t.jsxs("div",{className:r.groupBody,children:[e.fixTemplate&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:r.groupDescription,children:e.fixTemplate.description}),t.jsx("p",{className:r.groupFix,children:e.fixTemplate.howToFix})]}),o&&t.jsx(y,{text:i("uiStudio.falsePositiveWarning.tooltip","This check can produce false positives — verify before applying."),children:t.jsxs("p",{className:r.falsePositive,children:[i("uiStudio.falsePositiveWarning","May contain false positives"),":"," ",(p=e.fixTemplate)==null?void 0:p.falsePositiveNote]})}),t.jsx("ul",{className:r.itemList,children:e.items.map((d,m)=>t.jsx(ma,{item:d,group:e},`${d.path}-${m}`))})]})]})}function ma({item:e,group:i}){var d;const{t:s}=k(),{trackEvent:n}=E(),[o,a]=g.useState(!1),l=Re(e.path),u=((d=i.fixTemplate)==null?void 0:d.buildUpdateCommand(e))??null,p=async()=>{if(u)try{await navigator.clipboard.writeText(u),n("dashboard_click_event",{click_target:"ui_studio_copy_ai_instruction",page:"ui-studio",tab:"ui_studio_analysis"}),a(!0),setTimeout(()=>a(!1),2e3)}catch{}};return t.jsxs("li",{className:r.suggestionItem,children:[t.jsxs("div",{className:r.suggestionInfo,children:[t.jsx("code",{className:r.pathBreadcrumb,title:`${s("uiStudio.fullPath","Full path")}: ${l.full}`,children:l.breadcrumb}),t.jsxs("span",{className:r.currentValue,children:[t.jsx(y,{text:s("uiStudio.colCurrent.tooltip","The currently applied value."),children:t.jsx("span",{children:s("uiStudio.colCurrent","Current")})}),": ",t.jsx("strong",{children:String(e.actual)})," → ",t.jsx(y,{text:s("uiStudio.colRecommended.tooltip","The recommended value."),children:t.jsx("span",{children:s("uiStudio.colRecommended","Recommended")})}),": ",t.jsx("strong",{children:String(e.expected)})]})]}),u&&t.jsx(y,{text:s("uiStudio.copyFixCommand.tooltip","Copy a prompt that asks the AI to fix this issue."),children:t.jsx("button",{className:r.copyFixBtn,onClick:p,type:"button",children:o?s("uiStudio.copiedToClipboard","Copied"):s("uiStudio.copyFixCommand","Copy AI instruction")})})]})}function ee(e,i){return Object.entries(i).reduce((s,[n,o])=>s.split(`{${n}}`).join(String(o)),e)}function ya(e,i){return i.rule==="contrast"?ee(e("uiStudio.sample.designCheck.contrast","Text contrast is below {expected} (current {actual}). Adjust TextColor3 or BackgroundColor3."),{expected:String(i.expected),actual:String(i.actual)}):i.rule==="touch_target"?ee(e("uiStudio.sample.designCheck.touchTarget","Touch targets should be at least {expected} px (current {actual}). Increase Size or padding."),{expected:String(i.expected),actual:String(i.actual)}):i.rule==="min_text_size"?ee(e("uiStudio.sample.designCheck.minTextSize","TextSize is below {expected} (current {actual}). Increase it for readability."),{expected:String(i.expected),actual:String(i.actual)}):i.hint}const De="sample_inventory_preview",ae=Xe,fa=[{path:"StarterGui.InventoryGame.Overlay.Modal.Header.GoldBox.Icon",hint:"텍스트 대비 4.5:1 미만 (현재 1.24). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥4.5:1",rule:"contrast",actual:"1.24"},{path:"StarterGui.InventoryGame.Overlay.Modal.Header.CloseBtn",hint:"텍스트 대비 4.5:1 미만 (현재 4.11). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥4.5:1",rule:"contrast",actual:"4.11"},{path:"StarterGui.InventoryGame.Overlay.Modal.LeftPanel.Portrait.Avatar",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.LeftPanel.EquipGrid.Slot1.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.LeftPanel.EquipGrid.Slot2.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.LeftPanel.EquipGrid.Slot3.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.LeftPanel.EquipGrid.Slot4.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.LeftPanel.EquipGrid.Slot5.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.LeftPanel.EquipGrid.Slot6.EmptyIcon",hint:"텍스트 대비 3.0:1 미만 (현재 2.53). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"2.53"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.TabBar.TabAll",hint:"터치 타겟 44x44 px 이상 권장 (현재 64x32). Size 또는 padding 늘리세요.",displayPriority:"priority_high",expected:"≥44x44",rule:"touch_target",actual:"64x32"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.TabBar.TabWeapon",hint:"터치 타겟 44x44 px 이상 권장 (현재 64x32). Size 또는 padding 늘리세요.",displayPriority:"priority_high",expected:"≥44x44",rule:"touch_target",actual:"64x32"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.TabBar.TabArmor",hint:"터치 타겟 44x44 px 이상 권장 (현재 64x32). Size 또는 padding 늘리세요.",displayPriority:"priority_high",expected:"≥44x44",rule:"touch_target",actual:"64x32"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.TabBar.TabConsume",hint:"터치 타겟 44x44 px 이상 권장 (현재 64x32). Size 또는 padding 늘리세요.",displayPriority:"priority_high",expected:"≥44x44",rule:"touch_target",actual:"64x32"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.TabBar.TabMisc",hint:"터치 타겟 44x44 px 이상 권장 (현재 64x32). Size 또는 padding 늘리세요.",displayPriority:"priority_high",expected:"≥44x44",rule:"touch_target",actual:"64x32"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I1.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I1.Qty",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I2.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I3.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I4.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I5.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I6.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I7.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I8.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I9.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I10.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I11.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I12.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I13.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I13.Qty",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I14.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I14.Qty",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I15.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I15.Qty",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I16.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I16.Qty",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I17.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I17.Qty",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I18.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I19.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I19.Qty",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I20.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.CenterPanel.ItemGrid.I20.Qty",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.DetailPanel.ItemIconBox.Icon",hint:"텍스트 대비 3.0:1 미만 (현재 1.25). TextColor3 또는 BackgroundColor3 조정 필요.",displayPriority:"priority_high",expected:"≥3.0:1",rule:"contrast",actual:"1.25"},{path:"StarterGui.InventoryGame.Overlay.Modal.DetailPanel.Rarity",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12},{path:"StarterGui.InventoryGame.Overlay.Modal.DetailPanel.StatsBox.Passive",hint:"TextSize 12 미만 (하한 14). 가독성 확보를 위해 상향 조정 권장.",displayPriority:"priority_medium",expected:"≥14",rule:"min_text_size",actual:12}];function Sa(e){const n={snapshot_id:De,captured_at:1776757908,brief_id:null,thresholds_source:"default",scope:"targetPath",target:"StarterGui.InventoryGame",design_check_summary:{priority_high:35,priority_medium:10,priority_low:0},image:{file:"ui-studio-sample.png",width:402,height:252}},o={...n,check_results:fa.map(l=>({...l,hint:ya(e,l)})),image_url:ae};return{list:{placeId:0,snapshots:[n],totalCount:1},detail:o}}const xa=/plugin not connected|sync not started/i;function re(e){return typeof e=="string"&&xa.test(e)}function Ae(){const{t:e}=k();return t.jsxs("section",{className:r.pluginGuideCard,role:"status","aria-live":"polite",children:[t.jsx("div",{className:r.pluginGuideMarker,"aria-hidden":"true",children:"!"}),t.jsxs("div",{className:r.pluginGuideBody,children:[t.jsx("h2",{className:r.pluginGuideTitle,children:e("uiStudio.pluginGuide.title","Roblox Studio 플러그인이 연결되지 않았습니다")}),t.jsx("p",{className:r.pluginGuideMessage,children:e("uiStudio.pluginGuide.message","UI Studio는 연결된 Studio place의 화면 캡처와 변경 이력을 표시합니다. Studio와 WEPPY Plugin을 연결하면 자동으로 갱신됩니다.")}),t.jsxs("ul",{className:r.pluginGuideChecklist,children:[t.jsx("li",{children:e("uiStudio.pluginGuide.check1","Roblox Studio가 실행 중인가요?")}),t.jsx("li",{children:e("uiStudio.pluginGuide.check2","WEPPY Plugin이 설치되어 실행 중인가요?")})]}),t.jsxs("div",{className:r.pluginGuideWaiting,children:[t.jsx("span",{className:r.pluginGuideDot,"aria-hidden":"true"}),e("uiStudio.pluginGuide.waiting","플러그인 연결을 기다리는 중...")]})]})]})}function va(e){return{review:{id:"review-ui",title:e("uiStudio.emptyGuide.ai.reviewTitle","Review an existing UI"),request:e("uiStudio.emptyGuide.ai.reviewRequest","Inspect both Edit UI and UI created in the Play Client, then identify a screen to review. If there are several candidates, ask me which one to use first. Check text readability, overlapping elements, safe areas, and content outside the screen, then save the evidence in UI Studio. Do not modify the existing UI, and clearly separate semantic runtime observations, available screenshots, required states, and anything you could not verify.")},create:{id:"create-ui",title:e("uiStudio.emptyGuide.ai.createTitle","Create a new UI"),request:e("uiStudio.emptyGuide.ai.createRequest","Create an inventory UI for this game. Check the existing UI and data structure first, and ask me if the required features or visual direction are unclear. Do not overwrite existing UI. Capture and review the finished screen, then save the results in UI Studio.")}}}const Ca="_emptyState_13gyl_1",ba="_header_13gyl_11",wa="_method_13gyl_12",ka="_methodTitle_13gyl_44",ja="_moreExamples_13gyl_57",H={emptyState:Ca,header:ba,method:wa,methodTitle:ka,moreExamples:ja};function Me({kind:e}){const{locale:i,t:s}=k(),n=va(s),o=e==="analysis",a={copy:s("guidance.ai.copy","Copy request"),copying:s("guidance.ai.copying","Copying…"),copied:s("guidance.ai.copied","Copied"),copyFailed:s("guidance.ai.copyFailed","Could not copy. Select the request text and copy it manually.")};return t.jsxs("section",{className:H.emptyState,children:[t.jsxs("header",{className:H.header,children:[t.jsx("h3",{children:o?s("uiStudio.emptyGuide.analysis.title","Create or review game UI"):s("uiStudio.emptyGuide.history.title","Start a UI task")}),t.jsx("p",{children:o?s("uiStudio.emptyGuide.analysis.description","Ask AI to create or review UI, then inspect the saved screens and findings here."):s("uiStudio.emptyGuide.history.description","When AI creates or changes UI, the change record will appear here.")})]}),t.jsxs("section",{className:H.method,children:[t.jsxs("div",{className:H.methodTitle,children:[t.jsx(st,{size:16,"aria-hidden":"true"}),t.jsx("h4",{children:s("uiStudio.emptyGuide.ai.title","Ask AI")})]}),t.jsx(pe,{examples:[o?n.review:n.create],resetKey:`${i}|ui-studio-${e}`,labels:a,nextStep:s("guidance.ai.nextStep","Paste this request into an AI chat connected to WEPPY.")}),o&&t.jsxs("details",{className:H.moreExamples,children:[t.jsx("summary",{children:s("uiStudio.emptyGuide.ai.more","Other request examples")}),t.jsx(pe,{examples:[n.create],resetKey:`${i}|ui-studio-create`,labels:a})]})]})]})}function Ia(e){return((e==null?void 0:e.priority_high)??0)>0||((e==null?void 0:e.priority_medium)??0)>0||((e==null?void 0:e.priority_low)??0)>0}function K(e){return e===null||e.readiness==="insufficient_evidence"}function $e(e){return e.target??e.scope}function Na(e){const i=$e(e),s=i.split(".").filter(o=>o.length>0),n=s.findIndex(o=>o==="StarterGui");return n>=0&&s[n+1]?["StarterGui",s[n+1]].join("."):i}function Le(e){return((e==null?void 0:e.priority_high)??0)>0?"needsFix":((e==null?void 0:e.priority_medium)??0)>0||((e==null?void 0:e.priority_low)??0)>0?"review":K(e)?"incomplete":"passed"}function Pa(e){return Le(e.design_check_summary)}function fe(e){return ne(e.design_check_summary)}function ne(e){return((e==null?void 0:e.priority_high)??0)>0?0:((e==null?void 0:e.priority_medium)??0)>0?1:((e==null?void 0:e.priority_low)??0)>0?2:K(e)?3:4}function Ta(e){var l;if(e.length===0)return null;if(e.length===1)return((l=e[0])==null?void 0:l.latest.design_check_summary)??null;const i=e.reduce((u,p)=>{const d=p.latest.design_check_summary;u.priority_high+=(d==null?void 0:d.priority_high)??0,u.priority_medium+=(d==null?void 0:d.priority_medium)??0,u.priority_low+=(d==null?void 0:d.priority_low)??0,(d==null?void 0:d.deterministic_status)==="failed"&&(u.deterministic_status="failed"),(d==null?void 0:d.visual_status)==="failed"?u.visual_status="failed":(d==null?void 0:d.visual_status)==="skipped"&&u.visual_status!=="failed"?u.visual_status="skipped":(d==null?void 0:d.visual_status)==="completed"&&u.visual_status==="completed"?u.visual_status="completed":(d==null?void 0:d.visual_status)!=="completed"&&u.visual_status==="completed"&&(u.visual_status="not_requested"),(d==null?void 0:d.coverage)!=="structural_and_visual"&&(u.coverage="structural_only");for(const m of(d==null?void 0:d.skipped_reasons)??[])u.skipped_reasons.add(m);(d==null?void 0:d.readiness)==="insufficient_evidence"?u.readiness="insufficient_evidence":(d==null?void 0:d.readiness)==="review_required"&&u.readiness==="ready"&&(u.readiness="review_required");for(const m of(d==null?void 0:d.viewport_profiles_tested)??[])u.viewport_profiles_tested.add(m);return u},{priority_high:0,priority_medium:0,priority_low:0,deterministic_status:"completed",visual_status:"completed",coverage:"structural_and_visual",skipped_reasons:new Set,readiness:"ready",viewport_profiles_tested:new Set}),s=e.flatMap(u=>u.latest.design_check_summary?[u.latest.design_check_summary]:[]),n=u=>{const p=s.flatMap(h=>{var S;return(S=h.coverage_dimensions)!=null&&S[u]?[h.coverage_dimensions[u]]:[]}),d=p.map(h=>h.status);return{status:d.includes("failed")?"failed":d.length===s.length&&d.every(h=>h==="completed")?"completed":d.length>0&&d.every(h=>h==="not_requested")?"not_requested":"skipped",reasons:Array.from(new Set(p.flatMap(h=>h.reasons)))}},o=s.some(u=>u.coverage_dimensions)?{structure:n("structure"),visual:n("visual"),interaction:n("interaction"),primary_view_context:n("primary_view_context"),responsive_viewport:n("responsive_viewport")}:void 0,a=Array.from(new Set(s.flatMap(u=>u.observation_source?[u.observation_source]:[])));return{priority_high:i.priority_high,priority_medium:i.priority_medium,priority_low:i.priority_low,deterministic_status:i.deterministic_status,visual_status:i.visual_status,coverage:i.coverage,skipped_reasons:[...i.skipped_reasons],readiness:i.readiness,viewport_profiles_tested:[...i.viewport_profiles_tested],coverage_dimensions:o,observation_source:a.length===1?a[0]:void 0,limitations:Array.from(new Set(s.flatMap(u=>u.limitations??[]))),state_coverage:s.flatMap(u=>u.state_coverage??[])}}function qa(e){const i=new Map;for(const o of e){const a=$e(o),l=i.get(a);if(!l){i.set(a,{latest:o,snapshotCount:1});continue}l.snapshotCount+=1,o.captured_at>l.latest.captured_at&&(l.latest=o)}const s=[...i.entries()].map(([o,a])=>({key:o,latest:a.latest,snapshotCount:a.snapshotCount,verdict:Pa(a.latest)})),n=new Map;for(const o of s){const a=Na(o.latest),l=n.get(a)??[];l.push(o),n.set(a,l)}return[...n.entries()].map(([o,a])=>{var d;const l=a.sort((m,h)=>{const S=fe(m.latest)-fe(h.latest);return S!==0?S:h.latest.captured_at-m.latest.captured_at}),u=l.reduce((m,h)=>h.latest.captured_at>m.captured_at?h.latest:m,((d=l[0])==null?void 0:d.latest)??a[0].latest),p=Ta(l);return{key:o,latest:u,snapshotCount:l.reduce((m,h)=>m+h.snapshotCount,0),children:l,summary:p,verdict:Le(p)}}).sort((o,a)=>{const l=ne(o.summary)-ne(a.summary);return l!==0?l:a.latest.captured_at-o.latest.captured_at})}function Ra(e){return e.reduce((i,s)=>(Ia(s.summary)?i.hasSuggestions+=1:s.summary&&(i.noSuggestions+=1),K(s.summary)&&(i.evidenceIncomplete+=1),i),{hasSuggestions:0,evidenceIncomplete:0,noSuggestions:0})}function L(e,i){return`${i}${e("uiStudio.storage.countSuffix","개")}`}function oe(e,i){const s=K(i)?` · ${e("uiStudio.analysis.verdict.incomplete","검토 증거 부족")}`:"";return`${e("uiStudio.priorityHigh","우선 검토")} ${L(e,(i==null?void 0:i.priority_high)??0)} · ${e("uiStudio.priorityMedium","검토 권장")} ${L(e,(i==null?void 0:i.priority_medium)??0)} · ${e("uiStudio.priorityLow","선택 개선")} ${L(e,(i==null?void 0:i.priority_low)??0)}${s}`}function Se(e){const i=e==null?void 0:e.coverage_dimensions;return i?[["Visual",i.visual],["Interaction",i.interaction],["Primary view",i.primary_view_context],["Responsive",i.responsive_viewport]].flatMap(([s,n])=>typeof n=="object"&&n.status!=="completed"?[s]:[]):[]}function Ba(e,i){return i==="recompose"?e("uiStudio.primaryVisual.recompose","Recompose"):i==="refine"?e("uiStudio.primaryVisual.refine","Refine"):i==="approved"?e("uiStudio.primaryVisual.approved","Approved"):e("uiStudio.primaryVisual.unknown","Unknown")}function Ga(e,i){return i==="ready"?e("uiStudio.readiness.ready","Ready"):i==="review_required"?e("uiStudio.readiness.reviewRequired","Review required"):i==="insufficient_evidence"?e("uiStudio.readiness.insufficient","Evidence incomplete"):e("uiStudio.readiness.unknown","Readiness unknown")}function Da(e,i,s){const n=s.evidenceIncomplete>0?` · ${V(e,"incomplete")} ${L(e,s.evidenceIncomplete)}`:"";return`${e("uiStudio.analysis.targetCountLabel","분석 대상")} ${L(e,i)} · ${V(e,"needsFix")} ${L(e,s.hasSuggestions)}${n} · ${V(e,"passed")} ${L(e,s.noSuggestions)}`}function xe(e,i){return(i==null?void 0:i.deterministic_status)==="failed"?e("uiStudio.analysis.coverage.deterministicFailed","구조 검사 실패"):(i==null?void 0:i.coverage)==="structural_and_visual"&&i.visual_status==="completed"?e("uiStudio.analysis.coverage.full","구조·시각 검사 완료"):(i==null?void 0:i.visual_status)==="skipped"?e("uiStudio.analysis.coverage.visualSkipped","구조 검사만 완료 · 시각 검사 생략"):(i==null?void 0:i.visual_status)==="failed"?e("uiStudio.analysis.coverage.visualFailed","구조 검사 완료 · 시각 검사 실패"):e("uiStudio.analysis.coverage.structuralOnly","구조 검사만 완료")}function Aa({tier:e}){const{t:i}=k(),{trackEvent:s}=E(),n=e==="basic",o=qe(50),a=g.useRef(null),[l,u]=g.useState(null),[p,d]=g.useState(new Set),[m,h]=g.useState(new Set),[S,f]=g.useState(!1),v=g.useCallback((x,M)=>{const T=l===x;T||(a.current=M??null),u(T?null:x)},[l]),I=g.useCallback(()=>{u(null)},[]),B=g.useCallback(x=>{d(M=>{const T=new Set(M);return T.has(x)?T.delete(x):T.add(x),T})},[]),j=n?Sa(i):null,_=(j==null?void 0:j.list)??o.data,q=n?!1:o.loading,N=g.useCallback(x=>{h(M=>{const T=new Set(M);return T.has(x)?T.delete(x):T.add(x),T})},[]),C=x=>{h(new Set(x))},P=()=>{h(new Set)},D=async()=>{const x=(_==null?void 0:_.placeId)??0;s("dashboard_click_event",{click_target:"ui_studio_delete_selected_snapshots",page:"ui-studio",tab:"ui_studio_analysis"}),await Ze(x,{ids:[...m]}),await o.refresh(),f(!1),h(new Set)};if(q)return t.jsx("div",{className:r.page,children:i("uiStudio.loading","Loading...")});if(!n&&re(o.error))return t.jsx(Ae,{});if(!n&&o.error)return t.jsxs("div",{className:r.page,children:[i("uiStudio.error","Error"),": ",o.error]});const G=(_==null?void 0:_.snapshots)??[],w=_!==null,b=(_==null?void 0:_.placeId)??0,A=G.map(x=>x.snapshot_id),$=qa(G),Y=Ra($);return t.jsxs("div",{children:[t.jsx("div",{className:r.analysisWorkspace,"data-detail-open":l?"true":"false",children:t.jsxs("div",{className:r.analysisMainColumn,"data-testid":"analysis-main-column",children:[n&&t.jsx("div",{className:r.sampleBanner,children:t.jsxs("div",{className:r.sampleBannerRow,children:[t.jsxs("div",{className:r.sampleBannerMain,children:[t.jsx("div",{className:r.sampleBadge,children:i("uiStudio.sample.badge","Preview of the Pro UI gallery")}),t.jsx("div",{className:r.sampleTitle,children:i("uiStudio.sample.title","You are previewing the UI screenshot gallery that unlocks after upgrading to Pro.")}),t.jsx("div",{className:r.sampleMessage,children:i("uiStudio.sample.message","This preview uses sample data from a demo inventory UI. Real screenshots, review history, and AI-driven fixes unlock with Pro.")})]}),t.jsx("div",{className:r.sampleActions,children:t.jsx("a",{className:r.primaryAction,href:je.uiStudioAnalysis,target:"_blank",rel:"noreferrer",onClick:()=>s("dashboard_click_event",{click_target:"upgrade_cta",placement:"ui_studio_analysis_banner",page:"ui-studio",tab:"ui_studio_analysis"}),children:i("tier.upgrade","View Pro")})})]})}),t.jsx("div",{className:r.galleryHeader,children:t.jsx("h2",{children:t.jsx(R,{label:i("uiStudio.title","UI Studio"),tooltip:i("uiStudio.title.tooltip","A central place to review AI-generated UI screens and improvement suggestions.")})})}),G.length===0?w?t.jsx(Me,{kind:"analysis"}):t.jsx("div",{className:r.emptyState,children:i("uiStudio.empty.unavailable","UI Studio data is not available yet.")}):t.jsxs(t.Fragment,{children:[t.jsx("section",{className:r.analysisSummaryPanel,children:t.jsxs("div",{children:[t.jsx("h2",{children:t.jsx(R,{label:i("uiStudio.analysis.reportsTitle","UI 루트별 최신 분석"),tooltip:i("uiStudio.analysis.reportsTitle.tooltip","Shows the latest capture and suggestion summary per UI (e.g., Inventory window, Main menu).")})}),t.jsx("p",{className:r.analysisSummaryText,children:Da(i,$.length,Y)})]})}),t.jsx("div",{className:r.analysisReportGrid,"data-testid":"analysis-report-grid",children:$.map(x=>t.jsx($a,{report:x,placeId:b,imageUrlOverride:n?ae:void 0,expanded:p.has(x.key),onPrimaryClick:M=>{x.children.length>1?B(x.key):v(x.latest.snapshot_id,M)},onChildClick:(M,T)=>v(M,T)},x.key))}),t.jsxs("section",{className:r.recentCapturesSection,children:[t.jsxs("div",{className:r.recentCapturesHeader,children:[t.jsxs("div",{children:[t.jsx("h2",{children:t.jsx(R,{label:i("uiStudio.analysis.recentCapturesTitle","최근 캡처"),tooltip:i("uiStudio.analysis.recentCapturesTitle.tooltip","All recently saved captures in chronological order.")})}),t.jsxs("p",{className:r.recentCapturesMeta,children:[i("uiStudio.storage.snapshotCount","화면 캡처")," ",L(i,G.length)]})]}),!n&&G.length>0&&t.jsxs("div",{className:r.captureSelectionActions,children:[t.jsx(y,{text:i("uiStudio.gallery.selectAll.tooltip","Select every visible capture at once."),children:t.jsx("button",{className:r.selectionBarBtn,onClick:()=>C(A),type:"button",children:i("uiStudio.gallery.selectAll","모두 선택")})}),m.size>0&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:r.selectionToolbarCount,children:[m.size,i("uiStudio.gallery.selection.selectedCount"," selected")]}),t.jsx(y,{text:i("uiStudio.gallery.clearSelection.tooltip","Clear the current selection."),children:t.jsx("button",{className:r.selectionBarBtn,onClick:P,type:"button",children:i("uiStudio.gallery.clearSelection","선택 해제")})}),t.jsx(y,{text:i("uiStudio.gallery.deleteSelected.tooltip","Delete only the selected capture files. The actual UI in Roblox Studio is not affected."),children:t.jsx("button",{className:`${r.selectionBarBtn} ${r.selectionBarBtnDanger}`,onClick:()=>f(!0),type:"button",children:i("common.delete","삭제")})})]})]})]}),t.jsx("div",{className:r.grid,children:G.map(x=>t.jsx(Ws,{snapshot:x,placeId:b,onClick:M=>v(x.snapshot_id,M),imageUrlOverride:n?ae:void 0,selectable:!n,selected:m.has(x.snapshot_id),onToggleSelect:N},x.snapshot_id))})]})]})]})}),t.jsx(it,{open:l!==null,ariaLabel:i("uiStudio.analysis.detailDialog","Analysis detail"),onClose:I,returnFocusTo:a.current,testId:"analysis-detail-popup-layer",children:l&&t.jsx(ua,{snapshotId:l,placeId:b,onClose:I,sampleDetail:n&&l===De?(j==null?void 0:j.detail)??null:null,tier:e,onActionDone:n?void 0:o.refresh})}),S&&t.jsx(le,{title:i("uiStudio.confirm.deleteBatchTitle","화면 캡처 일괄 삭제"),message:i("uiStudio.confirm.deleteBatchMessage",`선택한 ${m.size}개의 화면 캡처를 삭제합니다. 이 작업은 되돌릴 수 없습니다.`),danger:!0,confirmLabel:i("common.delete","삭제"),onConfirm:D,onClose:()=>f(!1)})]})}function V(e,i){return i==="needsFix"||i==="review"?e("uiStudio.analysis.verdict.hasSuggestions","개선 제안 있음"):i==="incomplete"?e("uiStudio.analysis.verdict.incomplete","검토 증거 부족"):e("uiStudio.analysis.verdict.passed","현재 개선 제안 없음")}function Ma(e,i){if(((i==null?void 0:i.priority_high)??0)>0||((i==null?void 0:i.priority_medium)??0)>0||((i==null?void 0:i.priority_low)??0)>0){if((i==null?void 0:i.readiness)==="insufficient_evidence"){const s=Se(i);return s.length>0?`${e("uiStudio.analysis.remainingReview","남은 검토")}: ${s.join(", ")}`:e("uiStudio.analysis.issueSummary.incomplete","검토 증거가 더 필요합니다.")}return oe(e,i)}if((i==null?void 0:i.readiness)==="insufficient_evidence"){const s=Se(i);return s.length>0?`${e("uiStudio.analysis.remainingReview","남은 검토")}: ${s.join(", ")}`:e("uiStudio.analysis.issueSummary.incomplete","검토 증거가 더 필요합니다.")}return e("uiStudio.analysis.issueSummary.passed","현재 검토 기준에서 추가 개선 제안은 없습니다.")}function $a({report:e,placeId:i,imageUrlOverride:s,expanded:n,onPrimaryClick:o,onChildClick:a}){var S;const{t:l}=k(),u=e.latest,p=s??Te(u.snapshot_id,i),d=new Date(u.captured_at*1e3).toLocaleString(),m=V(l,e.verdict),h=e.children.length>1;return t.jsxs("div",{className:r.analysisReportGroup,children:[t.jsxs("button",{className:r.analysisReportCard,"aria-expanded":h?n:void 0,"aria-label":`${e.key} ${h?l("uiStudio.analysis.expandChildren","하위 대상 보기"):l("uiStudio.analysis.openDetail","상세 보기")}`,onClick:f=>o(f.currentTarget),type:"button",children:[u.image?t.jsx("img",{className:r.analysisReportThumb,src:p,alt:u.snapshot_id,loading:"lazy"}):t.jsx("div",{className:`${r.analysisReportThumb} ${r.runtimeObservationPlaceholder}`,role:"img","aria-label":l("uiStudio.runtimeStructureObservation","Runtime structure observation"),children:l("uiStudio.runtimeStructureObservation","Runtime structure observation")}),t.jsxs("div",{className:r.analysisReportBody,children:[t.jsxs("div",{className:r.analysisReportTopline,children:[t.jsx(y,{text:e.verdict==="passed"?l("uiStudio.analysis.verdict.passed.tooltip","No improvements suggested under the current review thresholds."):l("uiStudio.analysis.verdict.hasSuggestions.tooltip","Some improvements were found in this UI. Click the card for details."),children:t.jsx("span",{className:`${r.analysisVerdict} ${r[`analysisVerdict_${e.verdict}`]??""}`,children:m})}),t.jsx(y,{text:l("uiStudio.analysis.counts.tooltip","Shows how many suggestions are marked review first, recommended, or optional."),children:t.jsx("span",{className:r.analysisReportCounts,children:oe(l,e.summary)})})]}),t.jsx("div",{className:r.analysisReportTarget,children:e.key}),((S=e.summary)==null?void 0:S.readiness)==="insufficient_evidence"&&e.verdict!=="incomplete"&&t.jsx("div",{className:r.analysisReportIssue,children:l("uiStudio.analysis.verdict.incomplete","검토 증거 부족")}),t.jsx(La,{summary:e.summary}),t.jsx("div",{className:r.analysisReportIssue,children:Ma(l,e.summary)}),t.jsx("div",{className:r.analysisReportCoverage,children:xe(l,e.summary)}),t.jsx(Ea,{summary:e.summary}),t.jsxs("div",{className:r.analysisReportMeta,children:[d," ·"," ",t.jsx(y,{text:l("uiStudio.analysis.thresholds.tooltip","The threshold set used for this review (default or custom)."),children:t.jsx("span",{children:l("uiStudio.analysis.thresholds","검토 기준")})}),": ",u.thresholds_source,e.snapshotCount>1?` · ${l("uiStudio.analysis.captureLabel","캡처")} ${L(l,e.snapshotCount)}`:"",h?` · ${l("uiStudio.analysis.childTargets","하위 대상")} ${L(l,e.children.length)}`:""]})]})]}),h&&n&&t.jsx("div",{className:r.analysisChildList,children:e.children.map(f=>t.jsxs("button",{className:r.analysisChildRow,onClick:v=>a(f.latest.snapshot_id,v.currentTarget),type:"button",children:[t.jsx("span",{className:r.analysisChildPath,children:f.key}),t.jsx("span",{className:r.analysisChildSummary,children:oe(l,f.latest.design_check_summary)}),t.jsx("span",{className:r.analysisChildSummary,children:xe(l,f.latest.design_check_summary)}),t.jsx("span",{className:r.analysisChildDetailHint,children:l("uiStudio.analysis.childDetailHint","하위 대상 상세 보기")})]},f.key))})]})}function La({summary:e}){const{t:i}=k();if(!e)return null;const s=e.functional_safe===!0?i("uiStudio.functional.checkedScopeSafe","Checked scope safe"):e.functional_safe===!1?i("uiStudio.functional.risk","Risk found"):i("uiStudio.functional.unknown","Unknown"),n=e.responsive_requirement==="required"?i("uiStudio.responsive.required","Required"):e.responsive_requirement==="recommended"?i("uiStudio.responsive.recommended","Recommended"):i("uiStudio.responsive.unknown","Unknown");return t.jsxs("div",{className:r.readinessSummary,"aria-label":i("uiStudio.readiness.summary","UI readiness"),children:[t.jsxs("span",{className:r.readinessChip,children:[i("uiStudio.primaryVisual.label","Primary visual")," · ",Ba(i,e.primary_visual_verdict)]}),t.jsxs("span",{className:r.readinessChip,children:[i("uiStudio.functional.label","Functional")," · ",s]}),t.jsxs("span",{className:r.readinessChip,children:[i("uiStudio.responsive.label","Responsive")," · ",n]}),e.observation_source&&t.jsxs("span",{className:r.readinessChip,children:[i("uiStudio.observationSource.label","검사 출처")," · ",e.observation_source==="play_client"?i("uiStudio.observationSource.playClient","Play client"):i("uiStudio.observationSource.edit","Edit")]}),t.jsx("span",{className:`${r.readinessChip} ${e.readiness==="ready"?r.readinessChipReady:r.readinessChipPending}`,children:Ga(i,e.readiness)})]})}function Ea({summary:e}){const{t:i}=k(),s=e==null?void 0:e.coverage_dimensions;if(!s)return null;const n=[["Structure",s.structure],["Visual",s.visual],["Interaction",s.interaction],["Primary view",s.primary_view_context],["Responsive",s.responsive_viewport]];return t.jsx("div",{className:r.coverageChips,"aria-label":i("uiStudio.analysis.coverageDimensions","검토 범위"),children:n.map(([o,a])=>t.jsxs("span",{className:`${r.coverageChip} ${r[`coverageChip_${a.status}`]??""}`,title:a.reasons.join(", "),children:[o," · ",a.status==="completed"?i("uiStudio.analysis.coverageStatus.completed","완료"):a.status==="failed"?i("uiStudio.analysis.coverageStatus.failed","실패"):i("uiStudio.analysis.coverageStatus.skipped","생략")]},o))})}function Ua(e,i,s=1e4){const[n,o]=g.useState(null),[a,l]=g.useState(!0),[u,p]=g.useState(null),d=JSON.stringify(i),m=g.useCallback(async()=>{if(e===null){o(null),p(null),l(!1);return}try{const h=await ue(e,i);o(h),p(null)}catch(h){p(h.message)}finally{l(!1)}},[e,d]);return g.useEffect(()=>{let h=!0;if(e===null)return o(null),p(null),l(!1),()=>{h=!1};const S=async()=>{try{const v=await ue(e,i);h&&(o(v),p(null))}catch(v){h&&p(v.message)}finally{h&&l(!1)}};S();const f=setInterval(()=>{S()},s);return()=>{h=!1,clearInterval(f)}},[e,d,s]),{data:n,loading:a,error:u,refresh:m}}const Oa="_filterBar_1203k_4",Ha="_filterGroup_1203k_14",Fa="_filterLabel_1203k_21",za="_filterCheckbox_1203k_28",Va="_segmentGroup_1203k_45",Wa="_segmentBtn_1203k_55",Ka="_segmentBtnActive_1203k_73",Ya="_filterInput_1203k_79",Qa="_filterResetBtn_1203k_95",Ja="_requestRow_1203k_114",Xa="_requestRowMain_1203k_127",Za="_requestDetailToggle_1203k_134",er="_thumbPair_1203k_156",tr="_thumbPairButton_1203k_164",ir="_thumbSlot_1203k_179",sr="_thumbImg_1203k_204",ar="_thumbPlaceholder_1203k_211",rr="_thumbArrow_1203k_219",nr="_extraPathsBadge_1203k_225",or="_requestMeta_1203k_239",lr="_requestLabel_1203k_247",cr="_requestTime_1203k_256",ur="_requestStats_1203k_261",dr="_statDot_1203k_269",pr="_summaryPill_1203k_273",hr="_requestReadiness_1203k_277",_r="_requestReadinessPill_1203k_283",gr="_requestReadinessReady_1203k_297",mr="_requestReadinessPending_1203k_303",yr="_requestActions_1203k_310",fr="_expandHint_1203k_317",Sr="_mutationsArea_1203k_330",xr="_mutLoading_1203k_339",vr="_mutEmpty_1203k_340",Cr="_mutError_1203k_346",br="_mutationRow_1203k_352",wr="_mutationLine_1203k_362",kr="_mutTs_1203k_369",jr="_mutCommand_1203k_375",Ir="_mutPath_1203k_381",Nr="_mutDiff_1203k_391",Pr="_mutErr_1203k_346",Tr="_changeDetails_1203k_406",qr="_changeDetailRow_1203k_414",Rr="_changeDetailRowNoBefore_1203k_423",Br="_changeDetailBadge_1203k_427",Gr="_changeDetail_text_1203k_444",Dr="_changeDetail_color_1203k_449",Ar="_changeDetail_size_1203k_454",Mr="_changeDetail_layout_1203k_459",$r="_changeDetail_state_1203k_464",Lr="_changeDetail_asset_1203k_469",Er="_changeDetail_property_1203k_474",Ur="_changeDetailProperty_1203k_478",Or="_changeDetailArrow_1203k_486",Hr="_changeDetailOldValue_1203k_492",Fr="_changeDetailNewValue_1203k_493",zr="_compareDialogLayer_1203k_511",Vr="_compareDialog_1203k_511",Wr="_beforeAfterDrawer_1203k_542",Kr="_drawerHeader_1203k_552",Yr="_drawerTitle_1203k_561",Qr="_drawerCloseBtn_1203k_569",Jr="_drawerBody_1203k_585",Xr="_pathTabs_1203k_592",Zr="_pathTab_1203k_592",en="_pathTabActive_1203k_621",tn="_comparePanel_1203k_627",sn="_compareHalf_1203k_637",an="_compareLabel_1203k_644",rn="_compareImg_1203k_655",nn="_comparePlaceholder_1203k_663",on="_compareDetailsPanel_1203k_675",ln="_compareDetailsHeader_1203k_684",cn="_drawerFooter_1203k_702",un="_drawerActionBtn_1203k_710",dn="_historyTabWrap_1203k_728",pn="_historyWorkspace_1203k_734",hn="_historyMainColumn_1203k_739",_n="_requestList_1203k_743",gn="_emptyHistory_1203k_748",mn="_historyError_1203k_758",yn="_historyLoading_1203k_764",fn="_listHeader_1203k_772",Sn="_listHeaderTitle_1203k_781",xn="_clearBtn_1203k_788",vn="_deleteErrBanner_1203k_812",c={filterBar:Oa,filterGroup:Ha,filterLabel:Fa,filterCheckbox:za,segmentGroup:Va,segmentBtn:Wa,segmentBtnActive:Ka,filterInput:Ya,filterResetBtn:Qa,requestRow:Ja,requestRowMain:Xa,requestDetailToggle:Za,thumbPair:er,thumbPairButton:tr,thumbSlot:ir,thumbImg:sr,thumbPlaceholder:ar,thumbArrow:rr,extraPathsBadge:nr,requestMeta:or,requestLabel:lr,requestTime:cr,requestStats:ur,statDot:dr,summaryPill:pr,requestReadiness:hr,requestReadinessPill:_r,requestReadinessReady:gr,requestReadinessPending:mr,requestActions:yr,expandHint:fr,mutationsArea:Sr,mutLoading:xr,mutEmpty:vr,mutError:Cr,mutationRow:br,mutationLine:wr,mutTs:kr,mutCommand:jr,mutPath:Ir,mutDiff:Nr,mutErr:Pr,changeDetails:Tr,changeDetailRow:qr,changeDetailRowNoBefore:Rr,changeDetailBadge:Br,changeDetail_text:Gr,changeDetail_color:Dr,changeDetail_size:Ar,changeDetail_layout:Mr,changeDetail_state:$r,changeDetail_asset:Lr,changeDetail_property:Er,changeDetailProperty:Ur,changeDetailArrow:Or,changeDetailOldValue:Hr,changeDetailNewValue:Fr,compareDialogLayer:zr,compareDialog:Vr,beforeAfterDrawer:Wr,drawerHeader:Kr,drawerTitle:Yr,drawerCloseBtn:Qr,drawerBody:Jr,pathTabs:Xr,pathTab:Zr,pathTabActive:en,comparePanel:tn,compareHalf:sn,compareLabel:an,compareImg:rn,comparePlaceholder:nn,compareDetailsPanel:on,compareDetailsHeader:ln,drawerFooter:cn,drawerActionBtn:un,historyTabWrap:dn,historyWorkspace:pn,historyMainColumn:hn,requestList:_n,emptyHistory:gn,historyError:mn,historyLoading:yn,listHeader:fn,listHeaderTitle:Sn,clearBtn:xn,deleteErrBanner:vn};function Cn(e){try{return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}function ve(e){return e==null?"nil":typeof e=="string"?`"${e}"`:typeof e=="object"?JSON.stringify(e):String(e)}function Ee({mutations:e,emptyLabel:i}){const{t:s}=k();return e.length===0?t.jsx("div",{className:c.mutEmpty,children:i??s("uiStudio.history.row.mutationsEmpty","No change details")}):t.jsx(t.Fragment,{children:e.map(n=>t.jsx(bn,{mutation:n},n.mutationId))})}function bn({mutation:e}){return t.jsxs("div",{className:c.mutationRow,children:[t.jsxs("div",{className:c.mutationLine,children:[t.jsx("span",{className:c.mutTs,children:Cn(e.ts)}),t.jsx("span",{className:c.mutCommand,children:e.command}),e.targetPath&&t.jsx("span",{className:c.mutPath,children:e.targetPath}),e.diffSummary&&t.jsx("span",{className:c.mutDiff,children:e.diffSummary})]}),e.changeDetails&&e.changeDetails.length>0&&t.jsx("div",{className:c.changeDetails,children:e.changeDetails.map(i=>t.jsx(wn,{detail:i},`${i.property}:${i.category}`))}),!e.ok&&e.error&&t.jsx("span",{className:c.mutErr,children:e.error})]})}function wn({detail:e}){const i=Object.prototype.hasOwnProperty.call(e,"before");return t.jsxs("div",{className:`${c.changeDetailRow} ${i?"":c.changeDetailRowNoBefore}`,children:[t.jsx("span",{className:`${c.changeDetailBadge} ${c[`changeDetail_${e.category}`]??""}`,children:e.label}),t.jsx("span",{className:c.changeDetailProperty,children:e.property}),i&&t.jsx("span",{className:c.changeDetailOldValue,children:ve(e.before)}),t.jsx("span",{className:c.changeDetailArrow,children:"→"}),t.jsx("span",{className:c.changeDetailNewValue,children:ve(e.after)})]})}function Ce(e,i){return`${W}/api/ui-studio/snapshots/${encodeURIComponent(e)}/image?placeId=${i}`}function kn(e){try{return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}function jn(e){if(!e)return null;const i=e.split(/[./]/).filter(n=>n.length>0);if(i.length===0)return null;const s=i.findIndex(n=>n==="StarterGui");return s>=0&&i[s+1]?i[s+1]:i[i.length-1]??null}function te(e,i){if(i.label)return i.label;const s=jn(i.affectedPaths[0]);if(s){const n=i.mutationCount===1?"uiStudio.history.row.pathLabelOne":"uiStudio.history.row.pathLabelMany",o=i.mutationCount===1?"{path} · {n} change detail":"{path} · {n} change details";return e(n,o).replace("{path}",s).replace("{n}",String(i.mutationCount))}return e("uiStudio.history.row.toolLabel","UI changes ({n})").replace("{n}",String(i.mutationCount))}function ie(e,i){return`${i}${e("uiStudio.storage.countSuffix","")}`}function In(e,i){if(!i)return null;const s=[i.style_family,i.layout_family,i.device_policy,i.safe_area_policy].filter(n=>typeof n=="string"&&n.length>0);return s.length===0?null:`${e("uiStudio.history.row.qualityPlan","Design direction")}: ${s.join(" · ")}`}function Nn(e,i,s){if(!i)return null;if(i.source==="unavailable")return e("uiStudio.history.row.designCheckUnavailable","Suggestions: unavailable");if(s==="insufficient_evidence"||i.readiness==="insufficient_evidence")return e("uiStudio.history.row.readinessIncomplete","Readiness: evidence incomplete");if(i.total===0)return e("uiStudio.history.row.designCheckNone","Suggestions: none");const n=`${e("uiStudio.priorityHigh","Priority")} ${ie(e,i.priority_high)}`,o=`${e("uiStudio.priorityMedium","Recommended")} ${ie(e,i.priority_medium)}`,a=`${e("uiStudio.priorityLow","Optional")} ${ie(e,i.priority_low)}`;return`${e("uiStudio.history.row.designCheck","Suggestions")}: ${n} · ${o} · ${a}`}function Pn(e,i){return i==="recompose"?e("uiStudio.primaryVisual.recompose","Recompose"):i==="refine"?e("uiStudio.primaryVisual.refine","Refine"):i==="approved"?e("uiStudio.primaryVisual.approved","Approved"):e("uiStudio.primaryVisual.unknown","Unknown")}function Ue({req:e,placeId:i,onOpenCompare:s,imageUrlOverride:n,sampleMutations:o}){const{t:a}=k(),[l,u]=g.useState(!1),[p,d]=g.useState(null),[m,h]=g.useState(!1),[S,f]=g.useState(null),v=n!=null,I=e.affectedPaths[0]??null,B=e.affectedPaths.length-1,j=I?e.beforeSnapshots[I]??null:null,_=I?e.afterSnapshots[I]??null:null,q=j?v?n:Ce(j,i):null,N=_?v?n:Ce(_,i):null,C=In(a,e.qualityPlanSummary),P=Nn(a,e.postChangeDesignCheckSummary,e.readiness),D=e.postChangeDesignCheckSummary,G=async()=>{if(!l&&p===null)if(v&&o!=null)d(o);else{h(!0),f(null);try{const w=await Ie(i,e.requestId);d(w.mutations)}catch(w){f(w.message)}finally{h(!1)}}u(w=>!w)};return t.jsxs("div",{className:c.requestRow,children:[t.jsxs("div",{className:c.requestRowMain,children:[t.jsx(y,{text:a("uiStudio.history.row.compare.tooltip","Compare the before and after screens. Click to open the full comparison view."),children:t.jsxs("button",{className:`${c.thumbPair} ${c.thumbPairButton}`,onClick:w=>s(w.currentTarget),disabled:!I,"aria-label":`${te(a,e)} ${a("uiStudio.history.row.compare","Before / After")}`,type:"button",children:[t.jsx("div",{className:c.thumbSlot,children:q?t.jsx("img",{className:c.thumbImg,src:q,alt:a("uiStudio.compare.before","Before"),loading:"lazy"}):t.jsx(y,{text:a("uiStudio.history.row.noBeforeState.tooltip","No capture saved before this change."),children:t.jsx("span",{className:c.thumbPlaceholder,children:a("uiStudio.history.row.noBeforeState","이전 없음")})})}),t.jsx("span",{className:c.thumbArrow,children:"→"}),t.jsx("div",{className:c.thumbSlot,children:N?t.jsx("img",{className:c.thumbImg,src:N,alt:a("uiStudio.compare.after","After"),loading:"lazy"}):t.jsx(y,{text:a("uiStudio.history.row.noAfterState.tooltip","No capture saved after this change."),children:t.jsx("span",{className:c.thumbPlaceholder,children:a("uiStudio.history.row.noAfterState","이후 없음")})})}),B>0&&t.jsx(y,{text:a("uiStudio.history.row.extraPaths.tooltip","Number of additional UIs changed in this action."),children:t.jsxs("span",{className:c.extraPathsBadge,children:["+",B]})})]})}),t.jsxs("button",{className:c.requestDetailToggle,type:"button","aria-expanded":l,"aria-label":`${te(a,e)} ${a("uiStudio.history.row.toggleDetails","Toggle change details")}`,onClick:()=>void G(),children:[t.jsxs("span",{className:c.requestMeta,children:[t.jsx("span",{className:c.requestLabel,children:te(a,e)}),t.jsx("span",{className:c.requestTime,children:kn(e.startedAt)}),t.jsxs("span",{className:c.requestStats,children:[t.jsx(y,{text:a("uiStudio.history.row.affectedPaths.tooltip","Number of UIs affected by this action."),children:t.jsxs("span",{children:[a("uiStudio.history.row.affectedPaths","Paths")," ",e.affectedPaths.length,a("uiStudio.storage.countSuffix","")]})}),t.jsx("span",{className:c.statDot,children:"·"}),t.jsx(y,{text:a("uiStudio.history.row.mutations.tooltip","Number of detailed changes (e.g., property edits)."),children:t.jsxs("span",{children:[a("uiStudio.history.row.mutations","Change details")," ",e.mutationCount,a("uiStudio.storage.countSuffix","")]})}),C&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:c.statDot,children:"·"}),t.jsx(y,{text:a("uiStudio.history.row.qualityPlan.tooltip","Brief design direction used for this change."),children:t.jsx("span",{className:c.summaryPill,children:C})})]}),P&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:c.statDot,children:"·"}),t.jsx(y,{text:a("uiStudio.history.row.designCheck.tooltip","Post-change Design Check suggestion summary."),children:t.jsx("span",{className:c.summaryPill,children:P})})]})]}),D&&t.jsxs("span",{className:c.requestReadiness,"aria-label":a("uiStudio.readiness.summary","UI readiness"),children:[t.jsx("span",{className:c.requestReadinessPill,children:Pn(a,D.primary_visual_verdict)}),t.jsx("span",{className:c.requestReadinessPill,children:D.functional_safe===!0?a("uiStudio.functional.safeCompact","Functional safe"):D.functional_safe===!1?a("uiStudio.functional.riskCompact","Functional risk"):a("uiStudio.functional.unknownCompact","Functional unknown")}),t.jsx("span",{className:c.requestReadinessPill,children:D.responsive_requirement==="required"?a("uiStudio.responsive.requiredCompact","Responsive required"):D.responsive_requirement==="recommended"?a("uiStudio.responsive.recommendedCompact","Responsive recommended"):a("uiStudio.responsive.unknownCompact","Responsive unknown")}),D.readiness==="ready"&&t.jsx("span",{className:`${c.requestReadinessPill} ${c.requestReadinessReady}`,children:a("uiStudio.readiness.ready","Ready")}),D.readiness==="review_required"&&t.jsx("span",{className:`${c.requestReadinessPill} ${c.requestReadinessPending}`,children:a("uiStudio.readiness.reviewRequired","Review required")})]})]}),t.jsx("span",{className:c.requestActions,children:t.jsx(y,{text:a("uiStudio.history.row.toggleDetails.tooltip","Show or hide a per-line breakdown of what changed."),children:t.jsx("span",{className:c.expandHint,children:l?a("uiStudio.history.row.collapseDetails","Hide change details"):a("uiStudio.history.row.expandDetails","Show {n} change details").replace("{n}",String(e.mutationCount))})})})]})]}),l&&t.jsxs("div",{className:c.mutationsArea,children:[m&&t.jsx("div",{className:c.mutLoading,children:a("uiStudio.history.loading","로딩 중...")}),S&&t.jsx("div",{className:c.mutError,children:S}),p&&t.jsx(Ee,{mutations:p,emptyLabel:a("uiStudio.history.row.mutationsEmpty","No change details")})]})]})}function be(e,i){return`${W}/api/ui-studio/snapshots/${encodeURIComponent(e)}/image?placeId=${i}`}function Oe({requestId:e,placeId:i,onClose:s,imageUrlOverride:n,sampleDetail:o}){const{t:a}=k(),l=g.useRef(null),u=o!=null,[p,d]=g.useState(u?o:null),[m,h]=g.useState(!u),[S,f]=g.useState(null),[v,I]=g.useState(u&&o.affectedPaths.length>0?o.affectedPaths[0]:null);g.useEffect(()=>{var C;(C=l.current)==null||C.focus()},[]),g.useEffect(()=>{const C=P=>{P.key==="Escape"&&(P.preventDefault(),s())};return document.addEventListener("keydown",C),()=>{document.removeEventListener("keydown",C)}},[s]),g.useEffect(()=>{if(u)return;let C=!0;return h(!0),f(null),Ie(i,e).then(P=>{C&&(d(P),P.affectedPaths.length>0&&I(P.affectedPaths[0]))}).catch(P=>{C&&f(P.message)}).finally(()=>{C&&h(!1)}),()=>{C=!1}},[e,i,u]);const B=v&&p?p.beforeSnapshots[v]??null:null,j=v&&p?p.afterSnapshots[v]??null:null,_=B?n??be(B,i):null,q=j?n??be(j,i):null,N=a("uiStudio.history.row.compare","전후 비교");return t.jsx("div",{className:c.compareDialogLayer,"data-testid":"history-compare-dialog-layer",onClick:s,role:"presentation",children:t.jsx("section",{ref:l,className:c.compareDialog,role:"dialog","aria-modal":"true","aria-label":N,tabIndex:-1,onClick:C=>C.stopPropagation(),children:t.jsxs("div",{className:c.beforeAfterDrawer,children:[t.jsxs("div",{className:c.drawerHeader,children:[t.jsx("h2",{className:c.drawerTitle,children:N}),t.jsx("button",{className:c.drawerCloseBtn,onClick:s,type:"button",children:a("uiStudio.history.drawer.close","닫기")})]}),m&&t.jsx("div",{className:c.drawerBody,children:a("uiStudio.history.loading","로딩 중...")}),S&&t.jsx("div",{className:c.drawerBody,children:t.jsx("span",{className:c.mutErr,children:S})}),!m&&!S&&p&&t.jsxs(t.Fragment,{children:[p.affectedPaths.length>0&&t.jsx("div",{className:c.pathTabs,role:"tablist",children:p.affectedPaths.map(C=>t.jsx(y,{text:`${a("uiStudio.compare.path.tooltip","The UI instance path for this screen.")} ${C}`,children:t.jsx("button",{role:"tab","aria-selected":v===C,className:`${c.pathTab} ${v===C?c.pathTabActive:""}`,onClick:()=>I(C),type:"button",children:C.split("/").pop()??C})},C))}),t.jsxs("div",{className:c.comparePanel,children:[t.jsxs("div",{className:c.compareHalf,children:[t.jsx(y,{text:a("uiStudio.compare.before.tooltip","The screen saved just before AI made the change."),children:t.jsx("div",{className:c.compareLabel,children:a("uiStudio.compare.before","Before")})}),_?t.jsx("img",{className:c.compareImg,src:_,alt:a("uiStudio.compare.before","Before")}):t.jsx("div",{className:c.comparePlaceholder,children:a("uiStudio.history.row.noBeforeState","이전 상태 없음")})]}),t.jsxs("div",{className:c.compareHalf,children:[t.jsx(y,{text:a("uiStudio.compare.after.tooltip","The screen saved just after AI made the change."),children:t.jsx("div",{className:c.compareLabel,children:a("uiStudio.compare.after","After")})}),q?t.jsx("img",{className:c.compareImg,src:q,alt:a("uiStudio.compare.after","After")}):t.jsx("div",{className:c.comparePlaceholder,children:a("uiStudio.history.row.noAfterState","이후 상태 없음")})]})]}),t.jsxs("section",{className:c.compareDetailsPanel,children:[t.jsx("div",{className:c.compareDetailsHeader,children:a("uiStudio.history.drawer.changeDetails","Change details")}),t.jsx(Ee,{mutations:p.mutations,emptyLabel:a("uiStudio.history.row.mutationsEmpty","No change details")})]})]}),t.jsx("div",{className:c.drawerFooter,children:t.jsx("button",{className:c.drawerActionBtn,onClick:s,type:"button",children:a("uiStudio.history.drawer.close","닫기")})})]})})})}function z(e){const i=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0,0),s=new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59,999);return{start:i,end:s}}function we(e,i){const s=e.split("-").map(Number);if(s.length!==3||s.some(l=>Number.isNaN(l)))return;const[n,o,a]=s;return new Date(n,o-1,a,i?23:0,i?59:0,i?59:0,i?999:0).toISOString()}function Tn(e){const i={limit:50};if(e.action!=="all"&&(i.action=e.action),e.datePreset==="custom"){const s=e.from?we(e.from,!1):void 0,n=e.to?we(e.to,!0):void 0;s&&(i.from=s),n&&(i.to=n)}else if(e.datePreset!=="all"){const s=new Date;if(e.datePreset==="today"){const{start:n,end:o}=z(s);i.from=n.toISOString(),i.to=o.toISOString()}else if(e.datePreset==="yesterday"){const n=new Date(s);n.setDate(n.getDate()-1);const{start:o,end:a}=z(n);i.from=o.toISOString(),i.to=a.toISOString()}else{const n=e.datePreset==="7d"?6:29,o=new Date(s);o.setDate(o.getDate()-n);const{start:a}=z(o),{end:l}=z(s);i.from=a.toISOString(),i.to=l.toISOString()}}return i}function He(){return{action:"all",datePreset:"all"}}function qn(e){return e.action==="all"&&e.datePreset==="all"&&e.from===void 0&&e.to===void 0}function Rn(){const{t:e}=k(),{trackEvent:i}=E(),s=et(e),[n,o]=g.useState(null),a=n?s.requests.find(p=>p.requestId===n)??null:null,l=g.useCallback((p,d)=>{o(p)},[]),u=g.useCallback(()=>{o(null)},[]);return t.jsxs("div",{className:c.historyTabWrap,children:[t.jsx("div",{className:r.sampleBanner,children:t.jsxs("div",{className:r.sampleBannerRow,children:[t.jsxs("div",{className:r.sampleBannerMain,children:[t.jsx("div",{className:r.sampleBadge,children:e("uiStudio.history.sample.bannerBadge","Preview of the Pro change history")}),t.jsx("div",{className:r.sampleTitle,children:e("uiStudio.history.sample.bannerTitle","You are previewing the UI change history that unlocks after upgrading to Pro.")}),t.jsx("div",{className:r.sampleMessage,children:e("uiStudio.history.sample.bannerMessage","This preview uses sample data. Real change history, before/after comparison, and batch delete unlock with Pro.")})]}),t.jsx("div",{className:r.sampleActions,children:t.jsx("a",{className:r.primaryAction,href:je.uiStudioHistory,target:"_blank",rel:"noreferrer",title:e("uiStudio.history.sample.tooltip","Full history is available with Pro"),onClick:()=>i("dashboard_click_event",{click_target:"upgrade_cta",placement:"ui_studio_history_banner",page:"ui-studio",tab:"ui_studio_history"}),children:e("tier.upgrade","View Pro")})})]})}),t.jsxs("div",{className:c.historyWorkspace,"data-compare-open":n?"true":"false",children:[t.jsxs("div",{className:c.historyMainColumn,"data-testid":"history-main-column",children:[t.jsx("div",{className:c.listHeader,children:t.jsx("h2",{className:c.listHeaderTitle,children:t.jsx(R,{label:e("uiStudio.history.title","변경 이력"),tooltip:e("uiStudio.history.title.tooltip","A timeline of every UI change made by AI.")})})}),t.jsx("div",{className:c.requestList,children:s.requests.map(p=>t.jsx(Ue,{req:p,placeId:0,onOpenCompare:d=>l(p.requestId,d),imageUrlOverride:de,sampleMutations:s.mutationsByRequest[p.requestId]},p.requestId))})]}),n&&a&&t.jsx(Oe,{requestId:n,placeId:0,onClose:u,imageUrlOverride:de,sampleDetail:{...a,mutations:s.mutationsByRequest[a.requestId]??[]}})]})]})}function Bn({filter:e,onChange:i}){const{t:s}=k(),n=[{value:"all",label:s("uiStudio.history.filter.actionAll","All"),tooltip:s("uiStudio.history.filter.actionAll.tooltip","Show every kind of action.")},{value:"create_tree",label:s("uiStudio.history.filter.actionCreate","Create"),tooltip:s("uiStudio.history.filter.actionCreate.tooltip","Show only actions that created a new UI.")},{value:"update",label:s("uiStudio.history.filter.actionUpdate","Update"),tooltip:s("uiStudio.history.filter.actionUpdate.tooltip","Show only actions that updated an existing UI.")},{value:"delete",label:s("uiStudio.history.filter.actionDelete","Delete"),tooltip:s("uiStudio.history.filter.actionDelete.tooltip","Show only actions that deleted a UI.")}],o=[{value:"all",label:s("uiStudio.history.filter.dateAll","All"),tooltip:s("uiStudio.history.filter.dateAll.tooltip","Show the full history.")},{value:"today",label:s("uiStudio.history.filter.today","Today"),tooltip:s("uiStudio.history.filter.today.tooltip","Show only changes from today.")},{value:"yesterday",label:s("uiStudio.history.filter.yesterday","Yesterday"),tooltip:s("uiStudio.history.filter.yesterday.tooltip","Show only changes from yesterday.")},{value:"7d",label:s("uiStudio.history.filter.last7Days","Last 7 days"),tooltip:s("uiStudio.history.filter.last7Days.tooltip","Show changes from the last 7 days.")},{value:"30d",label:s("uiStudio.history.filter.last30Days","Last 30 days"),tooltip:s("uiStudio.history.filter.last30Days.tooltip","Show changes from the last 30 days.")},{value:"custom",label:s("uiStudio.history.filter.customRange","Custom range"),tooltip:s("uiStudio.history.filter.customRange.tooltip","Pick a custom start and end date.")}];return t.jsxs("div",{className:c.filterBar,children:[t.jsxs("div",{className:c.filterGroup,children:[t.jsx("span",{className:c.filterLabel,children:t.jsx(R,{label:s("uiStudio.history.filter.actions","작업 유형"),tooltip:s("uiStudio.history.filter.actions.tooltip","Filter records by the kind of change AI made.")})}),t.jsx("div",{className:c.segmentGroup,children:n.map(a=>t.jsx(y,{text:a.tooltip,children:t.jsx("button",{className:`${c.segmentBtn} ${e.action===a.value?c.segmentBtnActive:""}`,onClick:()=>i({...e,action:a.value}),"aria-pressed":e.action===a.value,type:"button",children:a.label})},a.value))})]}),t.jsxs("div",{className:c.filterGroup,children:[t.jsx("span",{className:c.filterLabel,children:t.jsx(R,{label:s("uiStudio.history.filter.period","Period"),tooltip:s("uiStudio.history.filter.period.tooltip","Filter records by time range.")})}),t.jsx("div",{className:c.segmentGroup,children:o.map(a=>t.jsx(y,{text:a.tooltip,children:t.jsx("button",{className:`${c.segmentBtn} ${e.datePreset===a.value?c.segmentBtnActive:""}`,onClick:()=>i({...e,datePreset:a.value,from:a.value==="custom"?e.from:void 0,to:a.value==="custom"?e.to:void 0}),"aria-pressed":e.datePreset===a.value,type:"button",children:a.label})},a.value))})]}),e.datePreset==="custom"&&t.jsxs("div",{className:c.filterGroup,children:[t.jsx("label",{className:c.filterLabel,htmlFor:"ui-history-from-date",children:t.jsx(R,{label:s("uiStudio.history.filter.from","시작일"),tooltip:s("uiStudio.history.filter.from.tooltip","Start date for the query.")})}),t.jsx("input",{id:"ui-history-from-date",type:"date",className:c.filterInput,value:e.from??"",onChange:a=>i({...e,from:a.target.value||void 0})}),t.jsx("label",{className:c.filterLabel,htmlFor:"ui-history-to-date",children:t.jsx(R,{label:s("uiStudio.history.filter.to","종료일"),tooltip:s("uiStudio.history.filter.to.tooltip","End date for the query.")})}),t.jsx("input",{id:"ui-history-to-date",type:"date",className:c.filterInput,value:e.to??"",onChange:a=>i({...e,to:a.target.value||void 0})})]}),t.jsx(y,{text:s("uiStudio.history.filter.reset.tooltip","Reset all filters to defaults."),children:t.jsx("button",{className:c.filterResetBtn,onClick:()=>i(He()),type:"button",children:s("uiStudio.history.filter.reset","Reset")})})]})}function Gn(){var G;const{t:e}=k(),{trackEvent:i}=E(),s=qe(1),n=((G=s.data)==null?void 0:G.placeId)??null,[o,a]=g.useState(He),{data:l,loading:u,error:p,refresh:d}=Ua(n,Tn(o)),[m,h]=g.useState(null),[S,f]=g.useState(!1),[v,I]=g.useState(!1),[B,j]=g.useState(null),_=async()=>{if(j(null),n===null){j(e("uiStudio.history.noPlaceAction","Current place is not available yet."));return}try{await tt(n,{all:!0,alsoSnapshots:v}),await d(),f(!1)}catch(w){throw j(w.message),w}},q=(l==null?void 0:l.requests)??[],N=n===null&&s.loading,C=re(s.error)||re(p),P=g.useCallback((w,b)=>{i("dashboard_click_event",{click_target:"ui_studio_compare_before_after",page:"ui-studio",tab:"ui_studio_history"}),h(w)},[i]),D=g.useCallback(()=>{h(null)},[]);return t.jsxs("div",{className:c.historyTabWrap,children:[C?t.jsx(Ae,{}):t.jsxs("div",{className:c.historyWorkspace,"data-compare-open":m?"true":"false",children:[t.jsxs("div",{className:c.historyMainColumn,"data-testid":"history-main-column",children:[t.jsx(Bn,{filter:o,onChange:a}),t.jsxs("div",{className:c.listHeader,children:[t.jsx("h2",{className:c.listHeaderTitle,children:t.jsx(R,{label:e("uiStudio.history.title","변경 이력"),tooltip:e("uiStudio.history.title.tooltip","A timeline of every UI change made by AI.")})}),q.length>0&&t.jsx(y,{text:e("uiStudio.history.clear.tooltip","Delete every change record for this project. The actual UI in Roblox Studio is not affected."),children:t.jsx("button",{className:c.clearBtn,onClick:()=>{i("dashboard_click_event",{click_target:"ui_studio_clear_history",page:"ui-studio",tab:"ui_studio_history"}),f(!0)},type:"button",children:e("uiStudio.history.clear","Clear")})})]}),N&&t.jsx("div",{className:c.historyLoading,children:e("uiStudio.history.loadingPlace","Loading current place...")}),!N&&u&&t.jsx("div",{className:c.historyLoading,children:e("uiStudio.history.loading","로딩 중...")}),!N&&!u&&p&&t.jsxs("div",{className:c.historyError,children:[e("uiStudio.history.error","오류"),": ",p]}),!N&&!u&&!p&&n===null&&t.jsx("div",{className:c.emptyHistory,children:e("uiStudio.history.noPlace","No current place data is available yet. Connect WEPPY Plugin and sync a place to view UI change history.")}),!N&&!u&&!p&&n!==null&&q.length===0&&(qn(o)?t.jsx(Me,{kind:"history"}):t.jsxs("div",{className:c.emptyHistory,children:[t.jsx("strong",{children:e("uiStudio.history.filteredEmpty.title","No change history matches these filters")}),t.jsx("span",{children:e("uiStudio.history.filteredEmpty.body","Change the filters or use Reset to show the full history.")})]})),!N&&!u&&n!==null&&q.length>0&&t.jsx("div",{className:c.requestList,children:q.map(w=>t.jsx(Ue,{req:w,placeId:n,onOpenCompare:b=>P(w.requestId,b)},w.requestId))}),B&&t.jsx("div",{className:c.deleteErrBanner,children:B})]}),m&&n!==null&&t.jsx(Oe,{requestId:m,placeId:n,onClose:D})]}),S&&t.jsx(le,{title:e("uiStudio.history.confirm.clearRequestsTitle","변경 이력 삭제"),message:e("uiStudio.history.confirm.clearRequestsMessage","현재 place의 변경 이력을 삭제합니다. Studio 인스턴스에는 영향을 주지 않습니다."),danger:!0,cascadeOption:{label:e("uiStudio.history.confirm.cascadeOption","연결된 화면 캡처도 함께 삭제"),checked:v,onChange:I},confirmLabel:e("common.delete","삭제"),onConfirm:_,onClose:()=>f(!1)})]})}function Dn({tier:e}){return e==="basic"?t.jsx(Rn,{}):t.jsx(Gn,{})}const An=["analysis","history"];function Kn(){const{t:e}=k(),{trackEvent:i}=E(),{tier:s,loading:n}=We(),[o,a]=Ke(),l=o.get("tab"),u=l&&An.includes(l)?l:"analysis",p=m=>{i("dashboard_click_event",{click_target:m==="analysis"?"ui_studio_tab_analysis":"ui_studio_tab_history",page:"ui-studio",tab:m==="analysis"?"ui_studio_analysis":"ui_studio_history"}),a(h=>{const S=new URLSearchParams(h);return S.set("tab",m),S})},d=[{key:"analysis",label:t.jsx(y,{text:e("uiStudio.tabs.analysis.tooltip","Browse AI-captured UI screens and quickly find which UIs need improvement."),children:e("uiStudio.tabs.analysis","Analysis")})},{key:"history",label:t.jsx(y,{text:e("uiStudio.tabs.history.tooltip","Every UI change AI made, in order. Compare before and after screens."),children:e("uiStudio.tabs.history","History")})}];return t.jsxs("div",{className:r.page,children:[t.jsx(Qe,{title:e("page.uiStudio.title","UI Studio"),description:e("page.uiStudio.description","Review UI captures, improvement suggestions, and before/after change history."),helpTopicId:"uiStudio",helpState:{tier:s}}),!n&&s==="pro"&&t.jsx(at,{surface:"uiStudio"}),t.jsx(rt,{items:d,value:u,onChange:p}),n?t.jsx("div",{className:r.emptyState,children:e("uiStudio.loading","Loading...")}):u==="analysis"?t.jsx(Aa,{tier:s}):t.jsx(Dn,{tier:s})]})}export{Kn as Component};
@@ -1 +0,0 @@
1
- import{u as j,j as e,L as f,a0 as k,r as g,a1 as x}from"./index-CJYQedSN.js";import{P as z}from"./PageHeader-DfhSm4j-.js";import{P as C}from"./PlaytestAiPromptExamples-DJFxefZu.js";import"./AiPromptExamples-BLQgKnq1.js";import"./copy-D8MSHyQE.js";const P="_card_15ozw_2",v="_cardUnread_15ozw_15",R="_cardRead_15ozw_20",T="_cardUnreadWarning_15ozw_25",A="_topRow_15ozw_32",I="_categoryChip_15ozw_39",L="_versionChip_15ozw_52",B="_importantBadge_15ozw_64",U="_date_15ozw_77",b="_title_15ozw_85",E="_body_15ozw_94",S="_aiPrompt_15ozw_102",W="_aiPromptIntro_15ozw_112",$="_linkList_15ozw_125",M="_link_15ozw_125",O="_internalLink_15ozw_147",Y="_newBadge_15ozw_169",t={card:P,cardUnread:v,cardRead:R,cardUnreadWarning:T,topRow:A,categoryChip:I,versionChip:L,importantBadge:B,date:U,title:b,body:E,aiPrompt:S,aiPromptIntro:W,linkList:$,link:M,internalLink:O,newBadge:Y},H={release:"whatsNew.category.release",notice:"whatsNew.category.notice",deprecation:"whatsNew.category.deprecation",tip:"whatsNew.category.tip"};function u({announcement:s,isNew:i}){var a;const{locale:c,t:n}=j(),d=i?t.cardUnread:t.cardRead,l=s.severity==="warning",p=l&&i?t.cardUnreadWarning:"",w=s.title[c]??s.title.en,N=s.body[c]??s.body.en,h=s.links??(s.link?[s.link]:[]),_=r=>typeof r=="string"?r:r[c]??r.en;return e.jsxs("div",{className:`${t.card} ${d} ${p}`,children:[e.jsxs("div",{className:t.topRow,children:[e.jsx("span",{className:t.categoryChip,children:n(H[s.category])}),l&&e.jsx("span",{className:t.importantBadge,children:n("whatsNew.importantBadge","IMPORTANT")}),s.version&&e.jsx("span",{className:t.versionChip,children:s.version}),i&&e.jsx("span",{className:t.newBadge,children:n("whatsNew.newBadge","NEW")}),e.jsx("span",{className:t.date,children:s.date})]}),e.jsx("h3",{className:t.title,children:w}),e.jsx("p",{className:t.body,children:N}),((a=s.aiPrompt)==null?void 0:a.kind)==="playtest-values"&&e.jsxs("div",{className:t.aiPrompt,children:[e.jsxs("div",{className:t.aiPromptIntro,children:[e.jsx("strong",{children:n("playtest.emptyValues.aiTitle","Ask AI")}),e.jsx("span",{children:n("playtest.emptyValues.aiDescription","Copy a request and paste it into an AI chat connected to WEPPY.")})]}),e.jsx(C,{exampleIds:[s.aiPrompt.exampleId]})]}),h.length>0&&e.jsx("div",{className:t.linkList,children:h.map(r=>{const m=_(r.url),y=_(r.label);return m.startsWith("/")?e.jsx(f,{className:`${t.link} ${t.internalLink}`,to:m,children:y},m):e.jsxs("a",{className:t.link,href:m,target:"_blank",rel:"noopener noreferrer",children:["↗"," ",y]},m)})})]})}const V="_page_4653w_2",q="_section_4653w_10",D="_sectionTitle_4653w_16",G="_unreadCount_4653w_28",K="_empty_4653w_43",F="_divider_4653w_51",o={page:V,section:q,sectionTitle:D,unreadCount:G,empty:K,divider:F};function se(){const{t:s}=j(),{readSet:i,markRead:c}=k(),n=g.useMemo(()=>{const a=[];for(const r of x)i.has(r.id)||a.push(r.id);return a},[]),d=g.useRef(n);d.current=n,g.useEffect(()=>()=>{d.current.length>0&&c(d.current)},[]);const l=g.useMemo(()=>new Set(n),[n]),p=x.filter(a=>l.has(a.id)),w=x.filter(a=>!l.has(a.id)),N=p.length>0,h=w.length>0,_=e.jsx(z,{title:s("whatsNew.pageTitle","What's New"),description:s("whatsNew.pageSubtitle","Stay up to date with MCP changes"),helpTopicId:"whatsNew"});return x.length===0?e.jsxs("div",{className:o.page,children:[_,e.jsx("p",{className:o.empty,children:s("whatsNew.empty","No announcements yet")})]}):e.jsxs("div",{className:o.page,children:[_,N&&e.jsxs("section",{className:o.section,children:[e.jsxs("h2",{className:o.sectionTitle,children:[s("whatsNew.unreadSection","Unread"),e.jsx("span",{className:o.unreadCount,children:p.length})]}),p.map(a=>e.jsx(u,{announcement:a,isNew:!0},`unread-${a.id}`))]}),N&&h&&e.jsx("hr",{className:o.divider}),h&&e.jsxs("section",{className:o.section,children:[e.jsx("h2",{className:o.sectionTitle,children:s("whatsNew.allSection","All Announcements")}),w.map(a=>e.jsx(u,{announcement:a,isNew:!1},`all-${a.id}`))]})]})}export{se as Component};
@@ -1 +0,0 @@
1
- ._card_15ozw_2{position:relative;display:flex;flex-direction:column;gap:8px;padding:14px 16px;border:1px solid var(--border);border-radius:var(--radius);border-left-width:3px;background:var(--bg-card)}._cardUnread_15ozw_15{border-left-color:var(--accent)}._cardRead_15ozw_20{border-left-color:var(--text-muted)}._cardUnreadWarning_15ozw_25{border-width:1px;border-color:var(--warning-border);background:var(--warning-bg)}._topRow_15ozw_32{display:flex;align-items:center;gap:8px;flex-wrap:wrap}._categoryChip_15ozw_39{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em;background:var(--accent-dim);color:var(--accent)}._versionChip_15ozw_52{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-size:11px;font-weight:600;background:#7f8daa24;color:var(--text-secondary);font-family:var(--font-code)}._importantBadge_15ozw_64{display:inline-flex;align-items:center;padding:2px 8px;border:1px solid var(--warning-border);border-radius:var(--radius-sm);background:var(--warning-bg);color:var(--warning-text);font-size:11px;font-weight:800;letter-spacing:.04em}._date_15ozw_77{margin-left:auto;font-size:12px;color:var(--text-muted);white-space:nowrap}._title_15ozw_85{margin:0;font-size:var(--type-record-title-size);font-weight:700;color:var(--text-primary);line-height:var(--leading-title)}._body_15ozw_94{font-size:var(--type-body-size);color:var(--text-secondary);line-height:var(--leading-body);white-space:pre-wrap;word-break:break-word}._aiPrompt_15ozw_102{display:flex;flex-direction:column;gap:var(--space-related);padding:12px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary)}._aiPromptIntro_15ozw_112{display:flex;flex-direction:column;gap:3px;color:var(--text-primary);font-size:var(--type-body-size);line-height:var(--leading-body)}._aiPromptIntro_15ozw_112 span{color:var(--text-secondary)}._linkList_15ozw_125{display:flex;align-items:flex-start;flex-wrap:wrap;gap:8px}._link_15ozw_125{display:inline-flex;align-items:center;gap:4px;font-size:13px;color:var(--accent);text-decoration:none;font-weight:600}._link_15ozw_125:hover{text-decoration:underline}._internalLink_15ozw_147{min-height:44px;padding:0 14px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-primary);font-size:14px}._internalLink_15ozw_147:hover{border-color:var(--border-highlight);background:var(--accent-dim);text-decoration:none}._internalLink_15ozw_147:focus-visible{outline:none;box-shadow:var(--focus-ring)}._newBadge_15ozw_169{display:inline-flex;align-items:center;padding:1px 6px;border-radius:999px;font-size:10px;font-weight:800;letter-spacing:.06em;background:var(--error);color:#fff}._page_4653w_2{display:flex;flex-direction:column;gap:var(--space-page);max-width:720px}._section_4653w_10{display:flex;flex-direction:column;gap:var(--space-section)}._sectionTitle_4653w_16{display:flex;align-items:center;gap:var(--space-related);margin:0;font-size:var(--type-section-title-size);font-weight:600;color:var(--text-primary);text-transform:uppercase;letter-spacing:.06em}._unreadCount_4653w_28{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:999px;font-size:11px;font-weight:700;background:var(--error);color:#fff}._empty_4653w_43{padding:32px 0;text-align:center;font-size:14px;color:var(--text-muted)}._divider_4653w_51{height:1px;background:var(--border);border:none;margin:0}