@weppy/roblox-mcp 2.12.4 → 2.13.0
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.
- package/CHANGELOG.md +13 -0
- package/dashboard/dist/assets/AssetsPage-BVUpssWN.css +1 -0
- package/dashboard/dist/assets/AssetsPage-CV9wxK10.js +61 -0
- package/dashboard/dist/assets/{ChangelogDetailPage-DJm43K1h.js → ChangelogDetailPage-gpaNW7UJ.js} +1 -1
- package/dashboard/dist/assets/{ChangelogPage-M0lIALvl.js → ChangelogPage-DKIsatBF.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-DLCMn2dM.js → ConfirmModal-reOnA0XQ.js} +1 -1
- package/dashboard/dist/assets/{ConnectionPage-e-YP0BDu.js → ConnectionPage-oMLfhLWb.js} +1 -1
- package/dashboard/dist/assets/{ControlsPage-DlaSStpW.js → ControlsPage-Y8OiNJre.js} +1 -1
- package/dashboard/dist/assets/{CurrentPlaceScope-DZ2orV5_.js → CurrentPlaceScope-7RO-JoyN.js} +1 -1
- package/dashboard/dist/assets/{GameChangeDetail-78Ke4Pr3.js → GameChangeDetail-D07BEk9j.js} +1 -1
- package/dashboard/dist/assets/{InfoLabel-C3n2_cRi.js → InfoLabel-mGrfFfvs.js} +1 -1
- package/dashboard/dist/assets/{OverviewPage-a_Newk4P.js → OverviewPage-BRwPqjqA.js} +1 -1
- package/dashboard/dist/assets/{PageHeader-A_rnhaxW.js → PageHeader-CKFvQ2T_.js} +2 -2
- package/dashboard/dist/assets/{PlaytestPage-CN7oefOU.js → PlaytestPage-C00WHKjP.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-C0RRWcLC.js → SettingsPage-Camuqp3Q.js} +1 -1
- package/dashboard/dist/assets/{StatusBadge-DYqnLMML.js → StatusBadge-BuYWRuwX.js} +1 -1
- package/dashboard/dist/assets/{SyncPage-CsQe96fg.js → SyncPage-pGT5Kghx.js} +1 -1
- package/dashboard/dist/assets/{Tabs--X3ZBrw-.js → Tabs-Bzvy3UJR.js} +1 -1
- package/dashboard/dist/assets/{ToolsPage-a0ReLV98.js → ToolsPage-B31Hx606.js} +1 -1
- package/dashboard/dist/assets/{TooltipText-Duhv_UBS.js → TooltipText-Vj0LEsyy.js} +1 -1
- package/dashboard/dist/assets/{UiPrimitive-Bi3cIHAa.js → UiPrimitive-tKQal2XA.js} +1 -1
- package/dashboard/dist/assets/{UiStudioPage-Bnbxjpb2.js → UiStudioPage-Dtp8HLCl.js} +1 -1
- package/dashboard/dist/assets/{WhatsNewPage-CD2k2oln.js → WhatsNewPage-BGcnIkzC.js} +1 -1
- package/dashboard/dist/assets/{copy-hmyydPjO.js → copy-DHQ0v8nJ.js} +1 -1
- package/dashboard/dist/assets/{index-je833Nom.js → index-CahJTtjv.js} +26 -26
- package/dashboard/dist/assets/{index-jDDNKuJU.css → index-CkZeRxRT.css} +1 -1
- package/dashboard/dist/assets/{sample-requests-B-6uBLqA.js → sample-requests-C1hU0rd2.js} +1 -1
- package/dashboard/dist/assets/{useLiveUptime-DcWAg-Dy.js → useLiveUptime-CcseIxAd.js} +1 -1
- package/dashboard/dist/assets/{useSettings-JrNGM1Q7.js → useSettings-CZEc0yGK.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dist/index.js +91 -91
- package/package.json +1 -1
- package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
- package/dashboard/dist/assets/AssetsPage-Czc93xoU.css +0 -1
- package/dashboard/dist/assets/AssetsPage-FUa9ddzs.js +0 -46
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as _,r as x,j as e}from"./index-
|
|
1
|
+
import{u as _,r as x,j as e}from"./index-CahJTtjv.js";const N="_container_uv8oc_2",j="_header_uv8oc_10",v="_modeBtn_uv8oc_18",g="_modeBtnActive_uv8oc_33",w="_unifiedView_uv8oc_40",L="_diffLine_uv8oc_46",b="_lineNum_uv8oc_55",C="_lineContent_uv8oc_64",S="_lineAdded_uv8oc_68",V="_lineRemoved_uv8oc_73",B="_lineContext_uv8oc_78",$="_sideBySide_uv8oc_83",A="_sidePane_uv8oc_90",P="_sideLabel_uv8oc_100",R="_sideContent_uv8oc_112",D="_empty_uv8oc_117",s={container:N,header:j,modeBtn:v,modeBtnActive:g,unifiedView:w,diffLine:L,lineNum:b,lineContent:C,lineAdded:S,lineRemoved:V,lineContext:B,sideBySide:$,sidePane:A,sideLabel:P,sideContent:R,empty:D};function k(n,i){const l=n.split(`
|
|
2
2
|
`),d=i.split(`
|
|
3
3
|
`),a=[],f=Math.max(l.length,d.length);let t=0,r=0;for(;(t<l.length||r<d.length)&&(t<l.length&&r<d.length?l[t]===d[r]?(a.push({type:"context",content:l[t],lineNum:r+1}),t++,r++):(a.push({type:"removed",content:l[t],lineNum:t+1}),t++,t<l.length&&l[t]===d[r]?(a.push({type:"added",content:d[r],lineNum:r+1}),r++):r<d.length&&(a.push({type:"added",content:d[r],lineNum:r+1}),r++)):t<l.length?(a.push({type:"removed",content:l[t],lineNum:t+1}),t++):r<d.length&&(a.push({type:"added",content:d[r],lineNum:r+1}),r++),!(a.length>f*3)););return a}function O({before:n,after:i}){const{t:l}=_(),[d,a]=x.useState("unified"),f=typeof n=="string"?n:n!=null?JSON.stringify(n,null,2):"",t=typeof i=="string"?i:i!=null?JSON.stringify(i,null,2):"",r=x.useMemo(()=>k(f,t),[f,t]);if(!f&&!t)return e.jsx("div",{className:s.container,children:e.jsx("div",{className:s.empty,children:l("changelog.diff.empty","No diff available")})});if(!f&&t){const c=t.split(`
|
|
4
4
|
`);return e.jsx("div",{className:s.container,children:e.jsx("div",{className:s.unifiedView,children:c.map((u,m)=>e.jsxs("div",{className:`${s.diffLine} ${s.lineAdded}`,children:[e.jsx("span",{className:s.lineNum,children:m+1}),e.jsxs("span",{className:s.lineContent,children:["+ ",u]})]},m))})})}return e.jsxs("div",{className:s.container,children:[e.jsxs("div",{className:s.header,children:[e.jsx("button",{className:`${s.modeBtn} ${d==="unified"?s.modeBtnActive:""}`,onClick:()=>a("unified"),children:l("changelog.diff.unified","Unified")}),e.jsx("button",{className:`${s.modeBtn} ${d==="side-by-side"?s.modeBtnActive:""}`,onClick:()=>a("side-by-side"),children:l("changelog.diff.sideBySide","Side by Side")})]}),d==="unified"?e.jsx("div",{className:s.unifiedView,children:r.map((c,u)=>e.jsxs("div",{className:`${s.diffLine} ${c.type==="added"?s.lineAdded:c.type==="removed"?s.lineRemoved:s.lineContext}`,children:[e.jsx("span",{className:s.lineNum,children:c.lineNum??""}),e.jsxs("span",{className:s.lineContent,children:[c.type==="added"?"+ ":c.type==="removed"?"- ":" ",c.content]})]},u))}):e.jsxs("div",{className:s.sideBySide,children:[e.jsxs("div",{className:s.sidePane,children:[e.jsx("div",{className:s.sideLabel,children:l("changelog.diff.before","Before")}),e.jsx("div",{className:s.sideContent,children:f.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r,k as e}from"./index-
|
|
1
|
+
import{j as r,k as e}from"./index-CahJTtjv.js";function s({label:t,tooltip:o}){return r.jsx(e,{text:o,children:t})}export{s as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,u as R,r as v,f as L,h as F,a as M,D as V}from"./index-je833Nom.js";import{I as A}from"./InfoLabel-C3n2_cRi.js";import{P as U}from"./PageHeader-A_rnhaxW.js";import{S as z}from"./StatusBadge-DYqnLMML.js";import{T as O}from"./TooltipText-Duhv_UBS.js";import{G as X}from"./GameChangeDetail-78Ke4Pr3.js";import{u as q,f as J}from"./useLiveUptime-DcWAg-Dy.js";import"./UiPrimitive-Bi3cIHAa.js";const K="_page_1xgxh_2",Q="_card_1xgxh_10",W="_cardHeader_1xgxh_17",Y="_disconnectCard_1xgxh_28",Z="_disconnectIcon_1xgxh_36",ee="_disconnectTitle_1xgxh_41",te="_disconnectMessage_1xgxh_48",se="_reconnectGuide_1xgxh_55",ne="_guideStep_1xgxh_64",ie="_stepNumber_1xgxh_72",ce="_reconnectIndicator_1xgxh_88",re="_reconnectDot_1xgxh_98",ae="_pulse_1xgxh_1",oe="_disconnectActions_1xgxh_112",le="_btn_1xgxh_118",de="_btnSecondary_1xgxh_134",me="_metricRow_1xgxh_152",ge="_metricGrid_1xgxh_158",he="_metricCard_1xgxh_164",xe="_metric_ok_1xgxh_174",ue="_metric_warn_1xgxh_179",ve="_metric_error_1xgxh_184",_e="_metricHeader_1xgxh_189",pe="_metricIcon_1xgxh_200",fe="_metricTitle_1xgxh_204",Ce="_metricValue_1xgxh_208",je="_metricSubtitle_1xgxh_215",we="_guideCard_1xgxh_225",Ne="_guideTitle_1xgxh_232",ye="_checklist_1xgxh_239",Te="_feedEmpty_1xgxh_263",Se="_feedList_1xgxh_270",Ie="_feedItem_1xgxh_278",be="_feedTime_1xgxh_291",ke="_feedIcon_1xgxh_298",Me="_feedSummary_1xgxh_304",De="_feedText_1xgxh_313",Be="_feedContext_1xgxh_321",He="_feedItemClickable_1xgxh_330",Ee="_feedChevron_1xgxh_338",Pe="_feedDetail_1xgxh_347",$e="_feedDetailPre_1xgxh_356",Re="_feedDetailText_1xgxh_365",Ge="_changelogSummary_1xgxh_372",Le="_changeTag_1xgxh_381",Fe="_tierBar_1xgxh_393",Ve="_tierBarTrack_1xgxh_399",Ae="_tierBarFillBasic_1xgxh_407",Ue="_tierBarFillPro_1xgxh_412",ze="_tierLabels_1xgxh_417",s={page:K,card:Q,cardHeader:W,disconnectCard:Y,disconnectIcon:Z,disconnectTitle:ee,disconnectMessage:te,reconnectGuide:se,guideStep:ne,stepNumber:ie,reconnectIndicator:ce,reconnectDot:re,pulse:ae,disconnectActions:oe,btn:le,btnSecondary:de,metricRow:me,metricGrid:ge,metricCard:he,metric_ok:xe,metric_warn:ue,metric_error:ve,metricHeader:_e,metricIcon:pe,metricTitle:fe,metricValue:Ce,metricSubtitle:je,guideCard:we,guideTitle:Ne,checklist:ye,feedEmpty:Te,feedList:Se,feedItem:Ie,feedTime:be,feedIcon:ke,feedSummary:Me,feedText:De,feedContext:Be,feedItemClickable:He,feedChevron:Ee,feedDetail:Pe,feedDetailPre:$e,feedDetailText:Re,changelogSummary:Ge,changeTag:Le,tierBar:Fe,tierBarTrack:Ve,tierBarFillBasic:Ae,tierBarFillPro:Ue,tierLabels:ze};function N({title:e,value:i,icon:c,subtitle:r,status:a,children:n}){const l=a?s[`metric_${a}`]:"";return t.jsxs("div",{className:`${s.metricCard} ${l}`,children:[t.jsxs("div",{className:s.metricHeader,children:[c&&t.jsx("span",{className:s.metricIcon,children:c}),t.jsx("span",{className:s.metricTitle,children:e})]}),t.jsx("div",{className:s.metricValue,children:i}),r&&t.jsx("div",{className:s.metricSubtitle,children:r}),n]})}function Oe(e){var c,r;const i=e==null?void 0:e.contextSummary;return(i==null?void 0:i.intent)??((r=(c=i==null?void 0:i.affectedAreas)==null?void 0:c[0])==null?void 0:r.label)??(i==null?void 0:i.testScenario)??null}function H({changes:e}){const{t:i}=R(),[c,r]=v.useState(null);return e.length===0?t.jsx("div",{className:s.feedEmpty,children:i("overview.feed.empty")}):t.jsx("div",{className:s.feedList,children:e.map((a,n)=>{const l=c===n,m=a.raw,g=m&&(m.before!=null||m.after!=null||m.details!=null),_=Oe(m);return t.jsxs("div",{children:[t.jsxs("div",{className:`${s.feedItem} ${g?s.feedItemClickable:""}`,onClick:()=>g&&r(l?null:n),children:[t.jsx("span",{className:s.feedTime,children:a.timestamp}),t.jsx("span",{className:s.feedIcon,children:a.icon}),t.jsxs("span",{className:s.feedText,children:[t.jsx("span",{className:s.feedSummary,children:a.summary}),_&&t.jsx("span",{className:s.feedContext,children:_})]}),g&&t.jsx("span",{className:s.feedChevron,children:l?"▴":"▾"})]}),l&&m&&t.jsx("div",{className:s.feedDetail,children:t.jsx(X,{change:m})})]},n)})})}const E=20;function G(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}function P(){return G(new Date)}function $(e){switch(e){case"script":return"📝";case"instance":return"🧱";case"property":return"🎨";case"lighting":return"💡";case"terrain":return"⛰️";case"asset":return"📦";default:return"🔧"}}function Xe(){const{level:e,status:i}=L(),c=F(),[r,a]=v.useState(null),[n,l]=v.useState(null),[m,g]=v.useState(null),[_,h]=v.useState([]),y=v.useRef(null),T=v.useCallback(async()=>{try{const o=await M.get("/connection-info");a(o)}catch{a(null)}},[]),S=v.useCallback(async()=>{try{const o=await M.get("/api/dashboard/changelog/active");if(g(o),o.recentChanges&&o.recentChanges.length>0){const p=o.recentChanges.map(x=>({timestamp:x.timestamp?G(new Date(x.timestamp)):P(),icon:$(x.category),summary:x.summary,category:x.category,raw:x}));h(p)}}catch{g(null)}},[]),f=v.useCallback(async()=>{try{const o=await M.get("/sync/status");l(o)}catch{l(null)}},[]);return v.useEffect(()=>{e!=="disconnected"?(T(),S(),f()):(a(null),l(null),g(null));const o=new V;y.current=o,o.connect();const p=o.on("game_change",C=>{const u=C,j={timestamp:P(),icon:$(u.category),summary:u.summary,category:u.category};h(k=>{const w=[j,...k];return w.length>E?w.slice(0,E):w}),S()}),x=o.on("sync",C=>{const u=C;l(j=>({...j,state:u.status,...u.placeId?{placeId:u.placeId}:{}}))});return()=>{p(),x(),o.disconnect(),y.current=null}},[e,T,S,f]),{level:e,status:i,connectionInfo:r,syncStatus:n,changeSummary:m,recentChanges:_,tier:c}}function D(e){return e.scriptsModified+e.scriptsCreated+e.instancesCreated+e.instancesDeleted+e.instancesMoved+e.propertiesChanged+e.assetsInserted+(e.lightingChanged?1:0)+(e.terrainChanged?1:0)}function qe(e,i){switch(e){case"syncing":return i("status.syncing","Syncing");case"initializing":return i("status.initializing","Initializing");case"error":return i("status.error","Error");default:return i("status.idle","Idle")}}function Je(e){switch(e){case"syncing":return"ok";case"initializing":return"warn";case"error":return"error";default:return"ok"}}function b(e,i,c,r){return t.jsxs("div",{className:e.metricSubtitle,children:[t.jsx(A,{label:i,tooltip:c}),": ",r]},i)}function d(e,i){return t.jsx(O,{text:i,children:e})}function nt(){var w,B;const{t:e}=R(),{level:i,status:c,connectionInfo:r,syncStatus:a,changeSummary:n,recentChanges:l}=Xe(),m=q(c==null?void 0:c.uptime),g=t.jsx(U,{title:e("page.overview.title","Overview"),description:e("page.overview.description","Check server, plugin, agent, sync, and recent game-change status in one place."),helpTopicId:"overview",helpState:{connectionLevel:i}});if(i==="disconnected")return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.disconnectCard,children:[t.jsx("div",{className:s.disconnectIcon,children:"⚠️"}),t.jsx("h2",{className:s.disconnectTitle,children:e("overview.l0.title")}),t.jsx("p",{className:s.disconnectMessage,children:e("overview.l0.message")}),t.jsxs("div",{className:s.reconnectGuide,children:[t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"1"}),t.jsx("span",{children:e("overview.l0.step1")})]}),t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"2"}),t.jsx("span",{children:e("overview.l0.step2")})]})]}),t.jsxs("div",{className:s.reconnectIndicator,children:[t.jsx("span",{className:s.reconnectDot}),e("overview.l0.reconnecting")]}),t.jsxs("div",{className:s.disconnectActions,children:[t.jsx("button",{className:s.btn,onClick:()=>window.location.reload(),children:e("overview.l0.reconnectBtn")}),t.jsx("button",{className:s.btnSecondary,onClick:()=>{window.location.hash="#/settings"},children:e("overview.l0.settingsBtn")})]})]})]});const _=(r==null?void 0:r.mcpInstanceCount)??0,h=((w=r==null?void 0:r.mcpInstances)==null?void 0:w.find(I=>!I.isServer&&I.aiClientName))??((B=r==null?void 0:r.mcpInstances)==null?void 0:B.find(I=>!!I.aiClientName))??null,y=(c==null?void 0:c.pluginClients)??[],T=y.length>0,S=(c==null?void 0:c.sessionId)??(r==null?void 0:r.sessionId)??"-",f=e("overview.metric.server.tooltip","MCP server runtime and process status"),o=e("overview.metric.plugin.tooltip","Roblox Studio plugin connection and version status"),p=e("overview.metric.agent.tooltip","Connected AI coding agents and their runtime state"),x=e("overview.metric.sync.tooltip","Current Studio to local sync activity"),C=c?[b(s,e("overview.meta.version","Version"),e("overview.meta.version.tooltip","Installed MCP server version"),`v${c.version}`),b(s,e("overview.meta.session","Session"),e("overview.meta.session.tooltip","Current MCP session identifier"),S),b(s,e("overview.meta.pid","PID"),e("overview.meta.pid.tooltip","Operating system process identifier"),String(c.pid??"-")),b(s,e("overview.meta.uptime","Uptime"),e("overview.meta.uptime.tooltip","Time elapsed since the MCP server started"),J(m??c.uptime))]:[];if(i==="serverOnly")return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.metricRow,children:[t.jsx(N,{title:d(e("overview.metric.server"),f),value:d(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsxs(t.Fragment,{children:[C,t.jsx(z,{status:"online"})]})}),t.jsx(N,{title:d(e("overview.metric.agent"),p),value:d((h==null?void 0:h.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:h?"ok":"warn"})]}),t.jsxs("div",{className:s.guideCard,children:[t.jsx("h3",{className:s.guideTitle,children:e("overview.l1.pluginGuide")}),t.jsxs("ul",{className:s.checklist,children:[t.jsx("li",{children:e("overview.l1.check1")}),t.jsx("li",{children:e("overview.l1.check2")})]})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),l.length>0?t.jsx(H,{changes:l}):t.jsx("div",{className:s.feedEmpty,children:e("overview.l1.feedHint")})]}),n&&D(n)>0&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",D(n)]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]});const u=y[0],j=n?D(n):0,k=!!n&&j>0;return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.metricGrid,children:[t.jsx(N,{title:d(e("overview.metric.server"),f),value:d(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsx(t.Fragment,{children:C})}),t.jsx(N,{title:d(e("overview.metric.plugin"),o),value:d(e(T?"status.online":"status.offline"),o),icon:"🔌",subtitle:u?`${u.placeName??"-"} / v${u.pluginVersion??"-"}`:void 0,status:T?"ok":"error"}),t.jsx(N,{title:d(e("overview.metric.agent"),p),value:d((h==null?void 0:h.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:h?"ok":"warn"}),t.jsx(N,{title:d(e("overview.metric.sync"),x),value:d(qe(a==null?void 0:a.state,e),x),icon:"🔄",status:Je(a==null?void 0:a.state)})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),t.jsx(H,{changes:l})]}),k&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",j]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]})}export{nt as Component};
|
|
1
|
+
import{j as t,u as R,r as v,f as L,h as F,a as M,D as V}from"./index-CahJTtjv.js";import{I as A}from"./InfoLabel-mGrfFfvs.js";import{P as U}from"./PageHeader-CKFvQ2T_.js";import{S as z}from"./StatusBadge-BuYWRuwX.js";import{T as O}from"./TooltipText-Vj0LEsyy.js";import{G as X}from"./GameChangeDetail-D07BEk9j.js";import{u as q,f as J}from"./useLiveUptime-CcseIxAd.js";import"./UiPrimitive-tKQal2XA.js";const K="_page_1xgxh_2",Q="_card_1xgxh_10",W="_cardHeader_1xgxh_17",Y="_disconnectCard_1xgxh_28",Z="_disconnectIcon_1xgxh_36",ee="_disconnectTitle_1xgxh_41",te="_disconnectMessage_1xgxh_48",se="_reconnectGuide_1xgxh_55",ne="_guideStep_1xgxh_64",ie="_stepNumber_1xgxh_72",ce="_reconnectIndicator_1xgxh_88",re="_reconnectDot_1xgxh_98",ae="_pulse_1xgxh_1",oe="_disconnectActions_1xgxh_112",le="_btn_1xgxh_118",de="_btnSecondary_1xgxh_134",me="_metricRow_1xgxh_152",ge="_metricGrid_1xgxh_158",he="_metricCard_1xgxh_164",xe="_metric_ok_1xgxh_174",ue="_metric_warn_1xgxh_179",ve="_metric_error_1xgxh_184",_e="_metricHeader_1xgxh_189",pe="_metricIcon_1xgxh_200",fe="_metricTitle_1xgxh_204",Ce="_metricValue_1xgxh_208",je="_metricSubtitle_1xgxh_215",we="_guideCard_1xgxh_225",Ne="_guideTitle_1xgxh_232",ye="_checklist_1xgxh_239",Te="_feedEmpty_1xgxh_263",Se="_feedList_1xgxh_270",Ie="_feedItem_1xgxh_278",be="_feedTime_1xgxh_291",ke="_feedIcon_1xgxh_298",Me="_feedSummary_1xgxh_304",De="_feedText_1xgxh_313",Be="_feedContext_1xgxh_321",He="_feedItemClickable_1xgxh_330",Ee="_feedChevron_1xgxh_338",Pe="_feedDetail_1xgxh_347",$e="_feedDetailPre_1xgxh_356",Re="_feedDetailText_1xgxh_365",Ge="_changelogSummary_1xgxh_372",Le="_changeTag_1xgxh_381",Fe="_tierBar_1xgxh_393",Ve="_tierBarTrack_1xgxh_399",Ae="_tierBarFillBasic_1xgxh_407",Ue="_tierBarFillPro_1xgxh_412",ze="_tierLabels_1xgxh_417",s={page:K,card:Q,cardHeader:W,disconnectCard:Y,disconnectIcon:Z,disconnectTitle:ee,disconnectMessage:te,reconnectGuide:se,guideStep:ne,stepNumber:ie,reconnectIndicator:ce,reconnectDot:re,pulse:ae,disconnectActions:oe,btn:le,btnSecondary:de,metricRow:me,metricGrid:ge,metricCard:he,metric_ok:xe,metric_warn:ue,metric_error:ve,metricHeader:_e,metricIcon:pe,metricTitle:fe,metricValue:Ce,metricSubtitle:je,guideCard:we,guideTitle:Ne,checklist:ye,feedEmpty:Te,feedList:Se,feedItem:Ie,feedTime:be,feedIcon:ke,feedSummary:Me,feedText:De,feedContext:Be,feedItemClickable:He,feedChevron:Ee,feedDetail:Pe,feedDetailPre:$e,feedDetailText:Re,changelogSummary:Ge,changeTag:Le,tierBar:Fe,tierBarTrack:Ve,tierBarFillBasic:Ae,tierBarFillPro:Ue,tierLabels:ze};function N({title:e,value:i,icon:c,subtitle:r,status:a,children:n}){const l=a?s[`metric_${a}`]:"";return t.jsxs("div",{className:`${s.metricCard} ${l}`,children:[t.jsxs("div",{className:s.metricHeader,children:[c&&t.jsx("span",{className:s.metricIcon,children:c}),t.jsx("span",{className:s.metricTitle,children:e})]}),t.jsx("div",{className:s.metricValue,children:i}),r&&t.jsx("div",{className:s.metricSubtitle,children:r}),n]})}function Oe(e){var c,r;const i=e==null?void 0:e.contextSummary;return(i==null?void 0:i.intent)??((r=(c=i==null?void 0:i.affectedAreas)==null?void 0:c[0])==null?void 0:r.label)??(i==null?void 0:i.testScenario)??null}function H({changes:e}){const{t:i}=R(),[c,r]=v.useState(null);return e.length===0?t.jsx("div",{className:s.feedEmpty,children:i("overview.feed.empty")}):t.jsx("div",{className:s.feedList,children:e.map((a,n)=>{const l=c===n,m=a.raw,g=m&&(m.before!=null||m.after!=null||m.details!=null),_=Oe(m);return t.jsxs("div",{children:[t.jsxs("div",{className:`${s.feedItem} ${g?s.feedItemClickable:""}`,onClick:()=>g&&r(l?null:n),children:[t.jsx("span",{className:s.feedTime,children:a.timestamp}),t.jsx("span",{className:s.feedIcon,children:a.icon}),t.jsxs("span",{className:s.feedText,children:[t.jsx("span",{className:s.feedSummary,children:a.summary}),_&&t.jsx("span",{className:s.feedContext,children:_})]}),g&&t.jsx("span",{className:s.feedChevron,children:l?"▴":"▾"})]}),l&&m&&t.jsx("div",{className:s.feedDetail,children:t.jsx(X,{change:m})})]},n)})})}const E=20;function G(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}function P(){return G(new Date)}function $(e){switch(e){case"script":return"📝";case"instance":return"🧱";case"property":return"🎨";case"lighting":return"💡";case"terrain":return"⛰️";case"asset":return"📦";default:return"🔧"}}function Xe(){const{level:e,status:i}=L(),c=F(),[r,a]=v.useState(null),[n,l]=v.useState(null),[m,g]=v.useState(null),[_,h]=v.useState([]),y=v.useRef(null),T=v.useCallback(async()=>{try{const o=await M.get("/connection-info");a(o)}catch{a(null)}},[]),S=v.useCallback(async()=>{try{const o=await M.get("/api/dashboard/changelog/active");if(g(o),o.recentChanges&&o.recentChanges.length>0){const p=o.recentChanges.map(x=>({timestamp:x.timestamp?G(new Date(x.timestamp)):P(),icon:$(x.category),summary:x.summary,category:x.category,raw:x}));h(p)}}catch{g(null)}},[]),f=v.useCallback(async()=>{try{const o=await M.get("/sync/status");l(o)}catch{l(null)}},[]);return v.useEffect(()=>{e!=="disconnected"?(T(),S(),f()):(a(null),l(null),g(null));const o=new V;y.current=o,o.connect();const p=o.on("game_change",C=>{const u=C,j={timestamp:P(),icon:$(u.category),summary:u.summary,category:u.category};h(k=>{const w=[j,...k];return w.length>E?w.slice(0,E):w}),S()}),x=o.on("sync",C=>{const u=C;l(j=>({...j,state:u.status,...u.placeId?{placeId:u.placeId}:{}}))});return()=>{p(),x(),o.disconnect(),y.current=null}},[e,T,S,f]),{level:e,status:i,connectionInfo:r,syncStatus:n,changeSummary:m,recentChanges:_,tier:c}}function D(e){return e.scriptsModified+e.scriptsCreated+e.instancesCreated+e.instancesDeleted+e.instancesMoved+e.propertiesChanged+e.assetsInserted+(e.lightingChanged?1:0)+(e.terrainChanged?1:0)}function qe(e,i){switch(e){case"syncing":return i("status.syncing","Syncing");case"initializing":return i("status.initializing","Initializing");case"error":return i("status.error","Error");default:return i("status.idle","Idle")}}function Je(e){switch(e){case"syncing":return"ok";case"initializing":return"warn";case"error":return"error";default:return"ok"}}function b(e,i,c,r){return t.jsxs("div",{className:e.metricSubtitle,children:[t.jsx(A,{label:i,tooltip:c}),": ",r]},i)}function d(e,i){return t.jsx(O,{text:i,children:e})}function nt(){var w,B;const{t:e}=R(),{level:i,status:c,connectionInfo:r,syncStatus:a,changeSummary:n,recentChanges:l}=Xe(),m=q(c==null?void 0:c.uptime),g=t.jsx(U,{title:e("page.overview.title","Overview"),description:e("page.overview.description","Check server, plugin, agent, sync, and recent game-change status in one place."),helpTopicId:"overview",helpState:{connectionLevel:i}});if(i==="disconnected")return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.disconnectCard,children:[t.jsx("div",{className:s.disconnectIcon,children:"⚠️"}),t.jsx("h2",{className:s.disconnectTitle,children:e("overview.l0.title")}),t.jsx("p",{className:s.disconnectMessage,children:e("overview.l0.message")}),t.jsxs("div",{className:s.reconnectGuide,children:[t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"1"}),t.jsx("span",{children:e("overview.l0.step1")})]}),t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"2"}),t.jsx("span",{children:e("overview.l0.step2")})]})]}),t.jsxs("div",{className:s.reconnectIndicator,children:[t.jsx("span",{className:s.reconnectDot}),e("overview.l0.reconnecting")]}),t.jsxs("div",{className:s.disconnectActions,children:[t.jsx("button",{className:s.btn,onClick:()=>window.location.reload(),children:e("overview.l0.reconnectBtn")}),t.jsx("button",{className:s.btnSecondary,onClick:()=>{window.location.hash="#/settings"},children:e("overview.l0.settingsBtn")})]})]})]});const _=(r==null?void 0:r.mcpInstanceCount)??0,h=((w=r==null?void 0:r.mcpInstances)==null?void 0:w.find(I=>!I.isServer&&I.aiClientName))??((B=r==null?void 0:r.mcpInstances)==null?void 0:B.find(I=>!!I.aiClientName))??null,y=(c==null?void 0:c.pluginClients)??[],T=y.length>0,S=(c==null?void 0:c.sessionId)??(r==null?void 0:r.sessionId)??"-",f=e("overview.metric.server.tooltip","MCP server runtime and process status"),o=e("overview.metric.plugin.tooltip","Roblox Studio plugin connection and version status"),p=e("overview.metric.agent.tooltip","Connected AI coding agents and their runtime state"),x=e("overview.metric.sync.tooltip","Current Studio to local sync activity"),C=c?[b(s,e("overview.meta.version","Version"),e("overview.meta.version.tooltip","Installed MCP server version"),`v${c.version}`),b(s,e("overview.meta.session","Session"),e("overview.meta.session.tooltip","Current MCP session identifier"),S),b(s,e("overview.meta.pid","PID"),e("overview.meta.pid.tooltip","Operating system process identifier"),String(c.pid??"-")),b(s,e("overview.meta.uptime","Uptime"),e("overview.meta.uptime.tooltip","Time elapsed since the MCP server started"),J(m??c.uptime))]:[];if(i==="serverOnly")return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.metricRow,children:[t.jsx(N,{title:d(e("overview.metric.server"),f),value:d(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsxs(t.Fragment,{children:[C,t.jsx(z,{status:"online"})]})}),t.jsx(N,{title:d(e("overview.metric.agent"),p),value:d((h==null?void 0:h.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:h?"ok":"warn"})]}),t.jsxs("div",{className:s.guideCard,children:[t.jsx("h3",{className:s.guideTitle,children:e("overview.l1.pluginGuide")}),t.jsxs("ul",{className:s.checklist,children:[t.jsx("li",{children:e("overview.l1.check1")}),t.jsx("li",{children:e("overview.l1.check2")})]})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),l.length>0?t.jsx(H,{changes:l}):t.jsx("div",{className:s.feedEmpty,children:e("overview.l1.feedHint")})]}),n&&D(n)>0&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",D(n)]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]});const u=y[0],j=n?D(n):0,k=!!n&&j>0;return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.metricGrid,children:[t.jsx(N,{title:d(e("overview.metric.server"),f),value:d(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsx(t.Fragment,{children:C})}),t.jsx(N,{title:d(e("overview.metric.plugin"),o),value:d(e(T?"status.online":"status.offline"),o),icon:"🔌",subtitle:u?`${u.placeName??"-"} / v${u.pluginVersion??"-"}`:void 0,status:T?"ok":"error"}),t.jsx(N,{title:d(e("overview.metric.agent"),p),value:d((h==null?void 0:h.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:h?"ok":"warn"}),t.jsx(N,{title:d(e("overview.metric.sync"),x),value:d(qe(a==null?void 0:a.state,e),x),icon:"🔄",status:Je(a==null?void 0:a.state)})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),t.jsx(H,{changes:l})]}),k&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",j]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]})}export{nt as Component};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{i as te,u as oe,e as ne,r as p,j as t,X as se,E as ae,k as re,
|
|
1
|
+
import{i as te,u as oe,e as ne,r as p,j as t,X as se,E as ae,k as re,K as ie}from"./index-CahJTtjv.js";import{I as X,a as le}from"./UiPrimitive-tKQal2XA.js";/**
|
|
2
2
|
* @license lucide-react v1.8.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const ce=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],z=te("circle-question-mark",ce),O={"studio.mesh_image_apis":{action:'In Studio, open File → Experience Settings → Security and enable "Allow Mesh / Image APIs".'},"open_cloud.api_key":{action:"In Roblox Creator Hub, create an API key, add Assets under Access Permissions, enable both Read and Write, then save and test the key in WEPPY Assets settings.",docsUrl:"https://create.roblox.com/docs/cloud/auth/api-keys"},"open_cloud.assets":{docsUrl:"https://create.roblox.com/docs/cloud/guides/usage-assets"}},n={canDo:{key:"dashboardHelp.section.canDo",fallback:"What you can do here"},howItWorks:{key:"dashboardHelp.section.howItWorks",fallback:"How it works"},needs:{key:"dashboardHelp.section.needs",fallback:"What you need to use it"},currentState:{key:"dashboardHelp.section.currentState",fallback:"Check based on current status"}},de=O["studio.mesh_image_apis"],J=O["open_cloud.api_key"],ue=O["open_cloud.assets"],pe=J.docsUrl,he=ue.docsUrl,fe="https://create.roblox.com/docs/cloud/reference/features/assets",ge="https://create.roblox.com/docs/reference/engine/classes/DataModel#CreatorId",ye="https://create.roblox.com/docs/reference/engine/classes/Player#UserId",be="https://create.roblox.com/docs/projects/groups",me="https://create.roblox.com/docs/cloud/reference/features/groups";function g(e,a,s,h){return{id:e,title:{key:`dashboardHelp.${e}.title`,fallback:a},sections:s,links:h}}function i(e,a,s,h){return{heading:e,items:h.map((y,P)=>({key:`dashboardHelp.${a}.${s}.${P+1}`,fallback:y}))}}function r(e,a,s){return{heading:n.currentState,items:[{key:`dashboardHelp.${e}.currentState.${a}`,fallback:s}]}}function v(e,a,s,h,y,P){return g(e,a,[i(n.canDo,e,"canDo",s),i(n.needs,e,"needs",h),i(n.currentState,e,"currentState",y)],P)}function ke(e){return e.tier==="basic"?r("assets","basic","Activate Pro before uploading to Roblox."):e.uploadEnabled===!1?r("assets","uploadDisabled","Turn on API Key local upload in Assets settings."):e.hasOpenCloudCredential===!1?r("assets","noCredential","Save and test an Open Cloud API Key."):e.hasDefaultCreator===!1?r("assets","noCreator","Save a default Creator ID or enter Creator details during upload."):r("assets","default","Open an asset detail dialog to start upload or usage scan.")}function ve(e){return e.connectionLevel!==void 0&&e.connectionLevel!=="studioConnected"?r("sync","pluginMissing","Connect WEPPY Plugin in Studio before using live sync details."):e.tier==="basic"?r("sync","basic","Activate Pro to use bidirectional or reverse sync."):r("sync","default","Use the sync log to diagnose stuck or failed sync activity.")}function Pe(e,a={}){return e==="studioRouting"?{id:e,title:{key:"controls.studioRouting.helpLabel",fallback:"How Studio routing works"},sections:[{heading:n.canDo,items:[{key:"controls.studioRouting.priorityDescription",fallback:"Explicit Studio ID, Connection ID, or Place ID requests bypass this priority setting and route to the named Studio."}]},{heading:n.howItWorks,items:[{key:"controls.studioRouting.help.auto",fallback:"Automatic uses the highest-priority active Studio, based on recent routed commands and connection order."},{key:"controls.studioRouting.help.pinned",fallback:"Studio fixed uses the selected Studio unless the request names a Studio ID, Connection ID, or Place ID."}]}]}:e==="luauValidation"?{id:e,title:{key:"controls.luauValidation.helpLabel",fallback:"How Luau syntax validation works"},sections:[{heading:n.canDo,items:[{key:"controls.luauValidation.benefit",fallback:"After AI edits a Script, check for Luau syntax errors."}]},{heading:n.howItWorks,items:[{key:"controls.luauValidation.help.behavior",fallback:"When On, after AI finishes replacing, editing, inserting, or deleting Script lines, WEPPY checks the full code that was actually saved. When Off, the Script is edited without an automatic syntax check."},{key:"controls.luauValidation.help.response",fallback:"A clean Script keeps the usual short completion response. WEPPY gives details only when it finds an error or cannot complete the check. Large Scripts may take a little longer."},{key:"controls.luauValidation.help.nonBlocking",fallback:"If WEPPY finds a syntax error or cannot complete the check, the saved Script change is not undone. The result helps the AI fix the same Script right away."},{key:"controls.luauValidation.priority",fallback:"If an AI request differs from this setting, the Dashboard setting is used. Turn it on or off here to change how Script edits are checked."}]}]}:e==="openCloudApiKey"?g(e,"Open Cloud API Key help",[i(n.canDo,e,"canDo",["WEPPY uses this key only for Roblox Open Cloud requests."]),i(n.needs,e,"needs",[J.action,"Set the key target to the same User or Group that you use as the upload Creator.","The raw key is encrypted on this device. It is not sent to WEPPY servers, and it is not stored in any other external storage, browser storage, telemetry, logs, tool history, or Asset Library metadata."]),a.hasOpenCloudCredential?r(e,"saved","Use Test Connection to confirm the saved key still works."):r(e,"empty","Create an API key in Roblox Creator Hub, paste it here, then save and test it.")],[{label:{key:"dashboardHelp.openCloudApiKey.link.apiKeys",fallback:"Roblox API keys"},href:pe},{label:{key:"dashboardHelp.openCloudApiKey.link.assetsGuide",fallback:"Assets API usage guide"},href:he},{label:{key:"dashboardHelp.openCloudApiKey.link.assetsReference",fallback:"Assets API reference"},href:fe}]):e==="openCloudCreatorId"?g(e,"Creator ID help",[i(n.canDo,e,"canDo",["The default Creator decides which User or Group owns newly uploaded Roblox assets."]),i(n.needs,e,"needs",["For User, sign in to roblox.com, open your profile from your avatar or username, then copy only the number between /users/ and /profile in the browser URL.","For Group, open the Roblox group or community page, then copy only the number after /groups/ or /communities/ in the browser URL.","Paste only the numeric ID in Creator ID. Do not paste the full URL, rbxassetid://, User, or Group text."]),a.hasDefaultCreator?r(e,"saved","Keep this value if new assets should continue using the same owner."):r(e,"empty","Choose User or Group, paste the numeric ID, then save the default Creator.")],[{label:{key:"dashboardHelp.openCloudCreatorId.link.creatorId",fallback:"Creator ID reference"},href:ge},{label:{key:"dashboardHelp.openCloudCreatorId.link.userId",fallback:"User ID reference"},href:ye},{label:{key:"dashboardHelp.openCloudCreatorId.link.groups",fallback:"Roblox groups"},href:be},{label:{key:"dashboardHelp.openCloudCreatorId.link.groupsApi",fallback:"Groups Cloud API"},href:me}]):{overview:g("overview","Overview help",[i(n.canDo,"overview","canDo",["Check MCP server, WEPPY Plugin, AI Agent, Sync, and recent game changes in one place."]),i(n.needs,"overview","needs",["Useful status requires the MCP server. Live Studio status also needs WEPPY Plugin connected to the active place."]),a.connectionLevel==="serverOnly"?r("overview","serverOnly","Open Roblox Studio and start WEPPY Plugin so live place data can appear."):r("overview","default","If the server disconnects, restart MCP or wait for the automatic reconnect.")]),connection:v("connection","Connection help",["Inspect server process details, connected AI agents, Studio plugin clients, and connection log events."],["The MCP server must be reachable. Plugin rows appear after Studio sends heartbeats."],["If Plugin is missing, open Roblox Studio and run WEPPY Plugin. If AI Agent is missing, reconnect the MCP server from your AI tool."]),sync:g("sync","Sync help",[i(n.canDo,"sync","canDo",["Review Studio to local sync status, direction, apply mode, and sync logs."]),i(n.needs,"sync","needs",["Sync needs an active place and connected WEPPY Plugin. Two-way and reverse workflows depend on Pro."]),ve(a)]),assets:g("assets","Assets help",[i(n.canDo,"assets","canDo",["Browse local Asset Library files, switch place/shared scope, filter categories, scan usage, insert RBXM into Studio, and upload local assets to Roblox."]),i(n.needs,"assets","needs",["Upload needs Pro, the Open Cloud upload toggle, a valid API Key, and a Creator. Browse and preview work on Basic."]),ke(a)]),changelog:v("changelog","Changelog help",["Review real game-change sessions extracted from AI actions and sync events."],["Entries are scoped to the active place. Basic shows only the latest preview entries."],["If the list is empty, ask the AI Agent to make a game change. Clear only deletes saved history records, not Studio objects."]),playtest:g("playtest","Playtest help",[i(n.canDo,"playtest","canDo",["Review Playtest results and reports saved by the AI Agent."]),i(n.needs,"playtest","needs",["Pro shows real stored reports. Basic shows sample preview data. Live active-place confidence needs WEPPY Plugin connected."]),a.tier==="basic"?r("playtest","basic","Activate Pro to use real Playtest history."):r("playtest","default","Ask the AI Agent to run a Playtest when no report is available.")]),uiStudio:g("uiStudio","UI Studio help",[i(n.canDo,"uiStudio","canDo",["Review AI-created UI analysis, improvement suggestions, captures, and before/after history."]),i(n.needs,"uiStudio","needs",["Pro shows real UI Studio data. Basic shows a bundled sample. New capture/check actions need WEPPY Plugin connected."]),a.tier==="basic"?r("uiStudio","basic","Activate Pro to use live UI Studio previews."):r("uiStudio","default","Ask the AI Agent to capture the UI or recheck improvement suggestions, then copy follow-up requests back to the AI chat.")]),tools:v("tools","Tools help",["Inspect tool history, status classification, fallback/unsupported/warn/error details, and usage statistics."],["History and statistics depend on local recording settings and the active place bucket."],["If no records appear, check Controls > General Settings and confirm history/statistics are enabled. Expand failed rows to inspect input, permission, or connection causes."]),controls:v("controls","Controls help",["Manage Project Root, Studio routing, and MCP hot settings."],["Project Root and Studio Routing need MCP server connection. Hot settings need a server response. Asset upload controls live in Assets settings."],["Use Project Root only when MCP should write sync data under a different project folder. Use Studio Routing only for requests where the agent does not name Studio ID, Connection ID, or Place ID."]),settings:v("settings","Settings help",["Manage License, saved data cleanup, server environment display, and language."],["License actions need MCP server connection. Server environment values are read-only here. Asset upload controls live in Assets settings.",de.action],["Activate a license for Pro features. Change environment values outside WEPPY Dashboard, then restart MCP. Review delete confirmations before clearing saved data."]),whatsNew:v("whatsNew","What's New help",["Review WEPPY Dashboard, MCP, and Plugin announcements, releases, and change notes."],["Announcements are bundled locally. Unread state is stored in this browser."],["After you visit this page, unread announcements from this visit are marked read when you leave. The top header does not show a duplicate What's New button on this page."])}[e]}const _e="_root_15e9p_1",we="_rootPage_15e9p_7",Ie="_rootField_15e9p_11",Ce="_helpButton_15e9p_15",Se="_panel_15e9p_19",Ae="_panelField_15e9p_34",Ee="_panelPage_15e9p_38",xe="_panelHeader_15e9p_42",Re="_closeButton_15e9p_60",De="_sectionStack_15e9p_64",Le="_helpSection_15e9p_69",He="_linkList_15e9p_70",c={root:_e,rootPage:we,rootField:Ie,helpButton:Ce,panel:Se,panelField:Ae,panelPage:Ee,panelHeader:xe,closeButton:Re,sectionStack:De,helpSection:Le,linkList:He},b=12,E=8,Ue=120,je=360,Oe=340,V=560;function Ne({topicId:e,state:a,variant:s="page",className:h,tooltip:y,triggerClassName:P}){const{t:f}=oe(),{trackEvent:N}=ne(),[d,_]=p.useState(!1),[C,M]=p.useState(null),R=p.useId(),B=p.useRef(null),D=p.useRef(null),L=p.useRef(null),m=Pe(e,a),S=f(m.title.key,m.title.fallback),A=p.useCallback(()=>{const o=D.current,l=L.current;if(!o||!l||typeof window>"u")return;const u=o.getBoundingClientRect(),k=l.getBoundingClientRect(),w=window.innerWidth,I=window.innerHeight,Z=s==="field"?Oe:je,G=k.width||Math.min(Z,w-b*2),F=k.height||V;let H=s==="field"?u.left:u.right-G;H=Math.max(b,Math.min(H,w-G-b));const U=I-u.bottom-E-b,Y=u.top-E-b,K=U<Math.min(F,220)&&Y>U,ee=Math.max(Ue,K?Y:U),q=Math.min(V,ee),$=Math.min(F,q);let j=K?u.top-E-$:u.bottom+E;j=Math.max(b,Math.min(j,I-$-b)),M({top:Math.round(j),left:Math.round(H),maxHeight:Math.round(q)})},[s]);p.useLayoutEffect(()=>{d?A():M(null)},[d,A]),p.useEffect(()=>{if(!d)return;const o=u=>{var w,I;const k=u.target;k&&!((w=B.current)!=null&&w.contains(k))&&!((I=L.current)!=null&&I.contains(k))&&_(!1)},l=u=>{u.key==="Escape"&&_(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",l)}},[d]),p.useEffect(()=>{if(!d)return;const o=()=>A();return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[d,A]);const W=s==="field"?f("dashboardHelp.fieldButton.ariaLabel","Open field help"):f("dashboardHelp.pageButton.ariaLabel","Open page help"),Q=C?{top:C.top,left:C.left,maxHeight:C.maxHeight}:{top:-9999,left:-9999,visibility:"hidden"},T=d?t.jsxs("section",{ref:L,id:R,className:[c.panel,s==="field"?c.panelField:c.panelPage].filter(Boolean).join(" "),style:Q,role:"dialog","aria-label":S,"data-panel-placement":"help-portal",children:[t.jsxs("div",{className:c.panelHeader,children:[t.jsx("h2",{children:S}),t.jsx(X,{type:"button",size:"sm",className:c.closeButton,"aria-label":f("common.close","Close"),onClick:()=>_(!1),children:t.jsx(se,{size:15,"aria-hidden":"true"})})]}),t.jsx("div",{className:c.sectionStack,children:m.sections.map(o=>t.jsxs("section",{className:c.helpSection,children:[t.jsx("h3",{children:f(o.heading.key,o.heading.fallback)}),t.jsx("ul",{children:o.items.map(l=>t.jsx("li",{children:f(l.key,l.fallback)},l.key))})]},o.heading.key))}),m.links&&m.links.length>0&&t.jsxs("div",{className:c.linkList,children:[t.jsx("h3",{children:f("dashboardHelp.section.links","Related links")}),m.links.map(o=>t.jsxs("a",{href:o.href,target:"_blank",rel:"noreferrer",children:[f(o.label.key,o.label.fallback),t.jsx(ae,{size:12,"aria-hidden":"true"})]},o.href))]})]}):null;return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:B,className:[c.root,s==="field"?c.rootField:c.rootPage,h??""].filter(Boolean).join(" "),children:s==="field"?t.jsx(re,{text:y??"",disabled:d,children:t.jsx(X,{ref:D,type:"button",size:"sm",className:[c.helpButton,P??""].filter(Boolean).join(" "),"aria-label":`${W}: ${S}`,"aria-expanded":d,"aria-controls":R,onClick:()=>{_(o=>{const l=!o;return o||N("dashboard_click_event",{click_target:"dashboard_help_open",help_topic:e,placement:s}),l})},children:t.jsx(z,{size:14,"aria-hidden":"true"})})}):t.jsxs(le,{ref:D,type:"button",variant:"secondary",size:"sm",className:c.helpButton,"aria-label":`${W}: ${S}`,"aria-expanded":d,"aria-controls":R,onClick:()=>{_(o=>{const l=!o;return o||N("dashboard_click_event",{click_target:"dashboard_help_open",help_topic:e,placement:s}),l})},children:[t.jsx(z,{size:16,"aria-hidden":"true"}),t.jsx("span",{children:f("dashboardHelp.button","Help")})]})}),T&&typeof document<"u"?ie.createPortal(T,document.body):null]})}const Me="_pageHeader_qym7v_1",Be="_copy_qym7v_9",We="_titleLine_qym7v_16",Te="_actions_qym7v_39",x={pageHeader:Me,copy:Be,titleLine:We,actions:Te};function Ye({title:e,description:a,badge:s,helpTopicId:h,helpState:y}){return t.jsxs("div",{className:x.pageHeader,children:[t.jsxs("div",{className:x.copy,children:[t.jsxs("div",{className:x.titleLine,children:[t.jsx("h1",{children:e}),s]}),t.jsx("p",{children:a})]}),t.jsx("div",{className:x.actions,children:t.jsx(Ne,{topicId:h,state:y})})]})}export{Ne as D,Ye as P,O as a};
|
|
6
|
+
*/const ce=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],z=te("circle-question-mark",ce),O={"studio.mesh_image_apis":{action:'In Studio, open File → Experience Settings → Security and enable "Allow Mesh / Image APIs".'},"open_cloud.api_key":{action:"In Roblox Creator Hub, create an API key, add Assets under Access Permissions, enable both Read and Write, then save and test the key in WEPPY Assets settings.",docsUrl:"https://create.roblox.com/docs/cloud/auth/api-keys"},"open_cloud.assets":{docsUrl:"https://create.roblox.com/docs/cloud/guides/usage-assets"}},n={canDo:{key:"dashboardHelp.section.canDo",fallback:"What you can do here"},howItWorks:{key:"dashboardHelp.section.howItWorks",fallback:"How it works"},needs:{key:"dashboardHelp.section.needs",fallback:"What you need to use it"},currentState:{key:"dashboardHelp.section.currentState",fallback:"Check based on current status"}},de=O["studio.mesh_image_apis"],Q=O["open_cloud.api_key"],ue=O["open_cloud.assets"],pe=Q.docsUrl,he=ue.docsUrl,fe="https://create.roblox.com/docs/cloud/reference/features/assets",ge="https://create.roblox.com/docs/reference/engine/classes/DataModel#CreatorId",ye="https://create.roblox.com/docs/reference/engine/classes/Player#UserId",be="https://create.roblox.com/docs/projects/groups",me="https://create.roblox.com/docs/cloud/reference/features/groups";function g(e,a,s,h){return{id:e,title:{key:`dashboardHelp.${e}.title`,fallback:a},sections:s,links:h}}function i(e,a,s,h){return{heading:e,items:h.map((y,P)=>({key:`dashboardHelp.${a}.${s}.${P+1}`,fallback:y}))}}function r(e,a,s){return{heading:n.currentState,items:[{key:`dashboardHelp.${e}.currentState.${a}`,fallback:s}]}}function v(e,a,s,h,y,P){return g(e,a,[i(n.canDo,e,"canDo",s),i(n.needs,e,"needs",h),i(n.currentState,e,"currentState",y)],P)}function ke(e){return e.tier==="basic"?r("assets","basic","Activate Pro before uploading to Roblox."):e.uploadEnabled===!1?r("assets","uploadDisabled","Turn on API Key local upload in Assets settings."):e.hasOpenCloudCredential===!1?r("assets","noCredential","Save and test an Open Cloud API Key."):e.hasDefaultCreator===!1?r("assets","noCreator","Save a default Creator ID or enter Creator details during upload."):r("assets","default","Open an asset detail dialog to start upload or usage scan.")}function ve(e){return e.connectionLevel!==void 0&&e.connectionLevel!=="studioConnected"?r("sync","pluginMissing","Connect WEPPY Plugin in Studio before using live sync details."):e.tier==="basic"?r("sync","basic","Activate Pro to use bidirectional or reverse sync."):r("sync","default","Use the sync log to diagnose stuck or failed sync activity.")}function Pe(e,a={}){return e==="studioRouting"?{id:e,title:{key:"controls.studioRouting.helpLabel",fallback:"How Studio routing works"},sections:[{heading:n.canDo,items:[{key:"controls.studioRouting.priorityDescription",fallback:"Explicit Studio ID, Connection ID, or Place ID requests bypass this priority setting and route to the named Studio."}]},{heading:n.howItWorks,items:[{key:"controls.studioRouting.help.auto",fallback:"Automatic uses the highest-priority active Studio, based on recent routed commands and connection order."},{key:"controls.studioRouting.help.pinned",fallback:"Studio fixed uses the selected Studio unless the request names a Studio ID, Connection ID, or Place ID."}]}]}:e==="luauValidation"?{id:e,title:{key:"controls.luauValidation.helpLabel",fallback:"How Luau syntax validation works"},sections:[{heading:n.canDo,items:[{key:"controls.luauValidation.benefit",fallback:"After AI edits a Script, check for Luau syntax errors."}]},{heading:n.howItWorks,items:[{key:"controls.luauValidation.help.behavior",fallback:"When On, after AI finishes replacing, editing, inserting, or deleting Script lines, WEPPY checks the full code that was actually saved. When Off, the Script is edited without an automatic syntax check."},{key:"controls.luauValidation.help.response",fallback:"A clean Script keeps the usual short completion response. WEPPY gives details only when it finds an error or cannot complete the check. Large Scripts may take a little longer."},{key:"controls.luauValidation.help.nonBlocking",fallback:"If WEPPY finds a syntax error or cannot complete the check, the saved Script change is not undone. The result helps the AI fix the same Script right away."},{key:"controls.luauValidation.priority",fallback:"If an AI request differs from this setting, the Dashboard setting is used. Turn it on or off here to change how Script edits are checked."}]}]}:e==="openCloudApiKey"?g(e,"Open Cloud API Key help",[i(n.canDo,e,"canDo",["WEPPY uses this key only for Roblox Open Cloud requests."]),i(n.needs,e,"needs",[Q.action,"Set the key target to the same User or Group that you use as the upload Creator.","The raw key is encrypted on this device. It is not sent to WEPPY servers, and it is not stored in any other external storage, browser storage, telemetry, logs, tool history, or Asset Library metadata."]),a.hasOpenCloudCredential?r(e,"saved","Use Test Connection to confirm the saved key still works."):r(e,"empty","Create an API key in Roblox Creator Hub, paste it here, then save and test it.")],[{label:{key:"dashboardHelp.openCloudApiKey.link.apiKeys",fallback:"Roblox API keys"},href:pe},{label:{key:"dashboardHelp.openCloudApiKey.link.assetsGuide",fallback:"Assets API usage guide"},href:he},{label:{key:"dashboardHelp.openCloudApiKey.link.assetsReference",fallback:"Assets API reference"},href:fe}]):e==="openCloudCreatorId"?g(e,"Creator ID help",[i(n.canDo,e,"canDo",["The default Creator decides which User or Group owns newly uploaded Roblox assets."]),i(n.needs,e,"needs",["For User, sign in to roblox.com, open your profile from your avatar or username, then copy only the number between /users/ and /profile in the browser URL.","For Group, open the Roblox group or community page, then copy only the number after /groups/ or /communities/ in the browser URL.","Paste only the numeric ID in Creator ID. Do not paste the full URL, rbxassetid://, User, or Group text."]),a.hasDefaultCreator?r(e,"saved","Keep this value if new assets should continue using the same owner."):r(e,"empty","Choose User or Group, paste the numeric ID, then save the default Creator.")],[{label:{key:"dashboardHelp.openCloudCreatorId.link.creatorId",fallback:"Creator ID reference"},href:ge},{label:{key:"dashboardHelp.openCloudCreatorId.link.userId",fallback:"User ID reference"},href:ye},{label:{key:"dashboardHelp.openCloudCreatorId.link.groups",fallback:"Roblox groups"},href:be},{label:{key:"dashboardHelp.openCloudCreatorId.link.groupsApi",fallback:"Groups Cloud API"},href:me}]):{overview:g("overview","Overview help",[i(n.canDo,"overview","canDo",["Check MCP server, WEPPY Plugin, AI Agent, Sync, and recent game changes in one place."]),i(n.needs,"overview","needs",["Useful status requires the MCP server. Live Studio status also needs WEPPY Plugin connected to the active place."]),a.connectionLevel==="serverOnly"?r("overview","serverOnly","Open Roblox Studio and start WEPPY Plugin so live place data can appear."):r("overview","default","If the server disconnects, restart MCP or wait for the automatic reconnect.")]),connection:v("connection","Connection help",["Inspect server process details, connected AI agents, Studio plugin clients, and connection log events."],["The MCP server must be reachable. Plugin rows appear after Studio sends heartbeats."],["If Plugin is missing, open Roblox Studio and run WEPPY Plugin. If AI Agent is missing, reconnect the MCP server from your AI tool."]),sync:g("sync","Sync help",[i(n.canDo,"sync","canDo",["Review Studio to local sync status, direction, apply mode, and sync logs."]),i(n.needs,"sync","needs",["Sync needs an active place and connected WEPPY Plugin. Two-way and reverse workflows depend on Pro."]),ve(a)]),assets:g("assets","Assets help",[i(n.canDo,"assets","canDo",["Browse local Asset Library files, switch place/shared scope, filter categories, scan usage, insert RBXM into Studio, and upload local assets to Roblox."]),i(n.needs,"assets","needs",["Upload needs Pro, the Open Cloud upload toggle, a valid API Key, and a Creator. Browse and preview work on Basic."]),ke(a)]),changelog:v("changelog","Changelog help",["Review real game-change sessions extracted from AI actions and sync events."],["Entries are scoped to the active place. Basic shows only the latest preview entries."],["If the list is empty, ask the AI Agent to make a game change. Clear only deletes saved history records, not Studio objects."]),playtest:g("playtest","Playtest help",[i(n.canDo,"playtest","canDo",["Review Playtest results and reports saved by the AI Agent."]),i(n.needs,"playtest","needs",["Pro shows real stored reports. Basic shows sample preview data. Live active-place confidence needs WEPPY Plugin connected."]),a.tier==="basic"?r("playtest","basic","Activate Pro to use real Playtest history."):r("playtest","default","Ask the AI Agent to run a Playtest when no report is available.")]),uiStudio:g("uiStudio","UI Studio help",[i(n.canDo,"uiStudio","canDo",["Review AI-created UI analysis, improvement suggestions, captures, and before/after history."]),i(n.needs,"uiStudio","needs",["Pro shows real UI Studio data. Basic shows a bundled sample. New capture/check actions need WEPPY Plugin connected."]),a.tier==="basic"?r("uiStudio","basic","Activate Pro to use live UI Studio previews."):r("uiStudio","default","Ask the AI Agent to capture the UI or recheck improvement suggestions, then copy follow-up requests back to the AI chat.")]),tools:v("tools","Tools help",["Inspect tool history, status classification, fallback/unsupported/warn/error details, and usage statistics."],["History and statistics depend on local recording settings and the active place bucket."],["If no records appear, check Controls > General Settings and confirm history/statistics are enabled. Expand failed rows to inspect input, permission, or connection causes."]),controls:v("controls","Controls help",["Manage Project Root, Studio routing, and MCP hot settings."],["Project Root and Studio Routing need MCP server connection. Hot settings need a server response. Asset upload controls live in Assets settings."],["Use Project Root only when MCP should write sync data under a different project folder. Use Studio Routing only for requests where the agent does not name Studio ID, Connection ID, or Place ID."]),settings:v("settings","Settings help",["Manage License, saved data cleanup, server environment display, and language."],["License actions need MCP server connection. Server environment values are read-only here. Asset upload controls live in Assets settings.",de.action],["Activate a license for Pro features. Change environment values outside WEPPY Dashboard, then restart MCP. Review delete confirmations before clearing saved data."]),whatsNew:v("whatsNew","What's New help",["Review WEPPY Dashboard, MCP, and Plugin announcements, releases, and change notes."],["Announcements are bundled locally. Unread state is stored in this browser."],["After you visit this page, unread announcements from this visit are marked read when you leave. The top header does not show a duplicate What's New button on this page."])}[e]}const _e="_root_15e9p_1",we="_rootPage_15e9p_7",Ie="_rootField_15e9p_11",Ce="_helpButton_15e9p_15",Se="_panel_15e9p_19",Ae="_panelField_15e9p_34",Ee="_panelPage_15e9p_38",xe="_panelHeader_15e9p_42",Re="_closeButton_15e9p_60",De="_sectionStack_15e9p_64",Le="_helpSection_15e9p_69",He="_linkList_15e9p_70",c={root:_e,rootPage:we,rootField:Ie,helpButton:Ce,panel:Se,panelField:Ae,panelPage:Ee,panelHeader:xe,closeButton:Re,sectionStack:De,helpSection:Le,linkList:He},b=12,E=8,Ue=120,je=360,Oe=340,V=560;function Ne({topicId:e,state:a,variant:s="page",className:h,tooltip:y,triggerClassName:P}){const{t:f}=oe(),{trackEvent:N}=ne(),[d,_]=p.useState(!1),[C,M]=p.useState(null),R=p.useId(),B=p.useRef(null),D=p.useRef(null),L=p.useRef(null),m=Pe(e,a),S=f(m.title.key,m.title.fallback),A=p.useCallback(()=>{const o=D.current,l=L.current;if(!o||!l||typeof window>"u")return;const u=o.getBoundingClientRect(),k=l.getBoundingClientRect(),w=window.innerWidth,I=window.innerHeight,Z=s==="field"?Oe:je,G=k.width||Math.min(Z,w-b*2),F=k.height||V;let H=s==="field"?u.left:u.right-G;H=Math.max(b,Math.min(H,w-G-b));const U=I-u.bottom-E-b,Y=u.top-E-b,K=U<Math.min(F,220)&&Y>U,ee=Math.max(Ue,K?Y:U),q=Math.min(V,ee),$=Math.min(F,q);let j=K?u.top-E-$:u.bottom+E;j=Math.max(b,Math.min(j,I-$-b)),M({top:Math.round(j),left:Math.round(H),maxHeight:Math.round(q)})},[s]);p.useLayoutEffect(()=>{d?A():M(null)},[d,A]),p.useEffect(()=>{if(!d)return;const o=u=>{var w,I;const k=u.target;k&&!((w=B.current)!=null&&w.contains(k))&&!((I=L.current)!=null&&I.contains(k))&&_(!1)},l=u=>{u.key==="Escape"&&_(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",l)}},[d]),p.useEffect(()=>{if(!d)return;const o=()=>A();return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[d,A]);const W=s==="field"?f("dashboardHelp.fieldButton.ariaLabel","Open field help"):f("dashboardHelp.pageButton.ariaLabel","Open page help"),J=C?{top:C.top,left:C.left,maxHeight:C.maxHeight}:{top:-9999,left:-9999,visibility:"hidden"},T=d?t.jsxs("section",{ref:L,id:R,className:[c.panel,s==="field"?c.panelField:c.panelPage].filter(Boolean).join(" "),style:J,role:"dialog","aria-label":S,"data-panel-placement":"help-portal",children:[t.jsxs("div",{className:c.panelHeader,children:[t.jsx("h2",{children:S}),t.jsx(X,{type:"button",size:"sm",className:c.closeButton,"aria-label":f("common.close","Close"),onClick:()=>_(!1),children:t.jsx(se,{size:15,"aria-hidden":"true"})})]}),t.jsx("div",{className:c.sectionStack,children:m.sections.map(o=>t.jsxs("section",{className:c.helpSection,children:[t.jsx("h3",{children:f(o.heading.key,o.heading.fallback)}),t.jsx("ul",{children:o.items.map(l=>t.jsx("li",{children:f(l.key,l.fallback)},l.key))})]},o.heading.key))}),m.links&&m.links.length>0&&t.jsxs("div",{className:c.linkList,children:[t.jsx("h3",{children:f("dashboardHelp.section.links","Related links")}),m.links.map(o=>t.jsxs("a",{href:o.href,target:"_blank",rel:"noreferrer",children:[f(o.label.key,o.label.fallback),t.jsx(ae,{size:12,"aria-hidden":"true"})]},o.href))]})]}):null;return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:B,className:[c.root,s==="field"?c.rootField:c.rootPage,h??""].filter(Boolean).join(" "),children:s==="field"?t.jsx(re,{text:y??"",disabled:d,children:t.jsx(X,{ref:D,type:"button",size:"sm",className:[c.helpButton,P??""].filter(Boolean).join(" "),"aria-label":`${W}: ${S}`,"aria-expanded":d,"aria-controls":R,onClick:()=>{_(o=>{const l=!o;return o||N("dashboard_click_event",{click_target:"dashboard_help_open",help_topic:e,placement:s}),l})},children:t.jsx(z,{size:14,"aria-hidden":"true"})})}):t.jsxs(le,{ref:D,type:"button",variant:"secondary",size:"sm",className:c.helpButton,"aria-label":`${W}: ${S}`,"aria-expanded":d,"aria-controls":R,onClick:()=>{_(o=>{const l=!o;return o||N("dashboard_click_event",{click_target:"dashboard_help_open",help_topic:e,placement:s}),l})},children:[t.jsx(z,{size:16,"aria-hidden":"true"}),t.jsx("span",{children:f("dashboardHelp.button","Help")})]})}),T&&typeof document<"u"?ie.createPortal(T,document.body):null]})}const Me="_pageHeader_qym7v_1",Be="_copy_qym7v_9",We="_titleLine_qym7v_16",Te="_actions_qym7v_39",x={pageHeader:Me,copy:Be,titleLine:We,actions:Te};function Ye({title:e,description:a,badge:s,helpTopicId:h,helpState:y}){return t.jsxs("div",{className:x.pageHeader,children:[t.jsxs("div",{className:x.copy,children:[t.jsxs("div",{className:x.titleLine,children:[t.jsx("h1",{children:e}),s]}),t.jsx("p",{children:a})]}),t.jsx("div",{className:x.actions,children:t.jsx(Ne,{topicId:h,state:y})})]})}export{Ne as D,Ye as P,O as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as l,a as v,u as N,j as t,e as D,h as E,l as $,T as U}from"./index-
|
|
1
|
+
import{r as l,a as v,u as N,j as t,e as D,h as E,l as $,T as U}from"./index-CahJTtjv.js";import{P as O}from"./PageHeader-CKFvQ2T_.js";import{I as B}from"./InfoLabel-mGrfFfvs.js";import{C as F}from"./CurrentPlaceScope-7RO-JoyN.js";import{T as S}from"./TooltipText-Vj0LEsyy.js";import{C as V}from"./ConfirmModal-reOnA0XQ.js";import"./UiPrimitive-tKQal2XA.js";import"./ConfirmModal.module-DJksQHBd.js";const W=5e3;function T(e){if(typeof e=="number")return{placeId:String(e)}}function z(e,o){return typeof o!="number"?e:`${e}?placeId=${encodeURIComponent(String(o))}`}function G(e){const o=(e==null?void 0:e.enabled)??!0,r=(e==null?void 0:e.placeId)??null,[n,a]=l.useState([]),[m,i]=l.useState(null),[p,c]=l.useState(o),d=l.useRef(null),u=l.useCallback(async()=>{try{const y=T(r),x=y?await v.get("/api/dashboard/playtest/history",y):await v.get("/api/dashboard/playtest/history");a(x.entries??[])}catch{}},[r]),h=l.useCallback(async()=>{if(!o){c(!1);return}await u(),c(!1)},[o,u]),g=l.useCallback(async()=>{o&&(await v.post(z("/api/dashboard/playtest/history/clear",r)),a([]),i(null))},[o,r]);l.useEffect(()=>{i(null)},[r]);const f=l.useCallback(async y=>{if(o)try{const x=T(r),w=x?await v.get(`/api/dashboard/playtest/report/${y}`,x):await v.get(`/api/dashboard/playtest/report/${y}`);i(w)}catch{i(null)}},[o,r]);return l.useEffect(()=>{if(!o){c(!1);return}return h(),d.current=setInterval(h,W),()=>{d.current&&clearInterval(d.current)}},[o,h]),{history:n,selectedReport:m,loading:p,loadReport:f,clearHistory:g}}function Q(e){const o="2026-03-27T15:26:00.000Z",r={testScenario:e("playtest.sample.context.why","Spawn into the arena, survive the opener, and verify the HUD responds immediately."),expectedBehavior:e("playtest.sample.context.expected","The player spawns safely, the countdown UI appears within one second, and the first wave starts without errors."),observedBehavior:e("playtest.sample.context.observed","Spawn protection held, the HUD updated on time, and wave one completed with no gameplay regressions.")};return{history:[{timestamp:o,testName:e("playtest.sample.history.name","Sample Arena Smoke Test"),mode:"play",status:"passed",durationMs:4820,contextId:"sample_playtest_preview",contextSummary:r}],report:{markdown:e("playtest.sample.report.markdown",`# Sample Arena Smoke Test
|
|
2
2
|
|
|
3
3
|
- Spawn flow: PASS
|
|
4
4
|
- HUD countdown: PASS
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as te,e as re,r as l,j as e,a as T,g as me,d as ye,T as je,A as fe,S as xe}from"./index-je833Nom.js";import{P as ve}from"./PageHeader-A_rnhaxW.js";import{I as k}from"./InfoLabel-C3n2_cRi.js";import{T as g}from"./TooltipText-Duhv_UBS.js";import{s as n,u as Se}from"./useSettings-JrNGM1Q7.js";import{C as ce}from"./ConfirmModal-DLCMn2dM.js";import{D as de,f as ue,r as be,s as Ce,a as pe,d as se,S as ae,b as Ne}from"./sample-requests-B-6uBLqA.js";import{C as _e}from"./UiPrimitive-Bi3cIHAa.js";import"./ConfirmModal.module-DJksQHBd.js";const ke="_card_1ende_4",Le="_cardEmbedded_1ende_14",Pe="_cardTitle_1ende_21",Re="_storageConsoleGrid_1ende_30",we="_storageUsageColumn_1ende_37",He="_storagePolicyColumn_1ende_38",Be="_usageRow_1ende_43",Ae="_usageTotal_1ende_49",Me="_usageBreakdown_1ende_56",$e="_usageCounts_1ende_62",De="_storageFooter_1ende_69",Ee="_lastRunRow_1ende_78",Te="_lastRunLabel_1ende_88",Ue="_errorIcon_1ende_94",Ie="_tooltip_1ende_102",ze="_cleanupRow_1ende_125",Fe="_cleanupLabel_1ende_132",Oe="_cleanupBtn_1ende_139",Ge="_cleanupBtnDanger_1ende_168",qe="_retentionSection_1ende_181",We="_retentionTitle_1ende_187",Ye="_retentionFieldset_1ende_194",Ke="_proOverlay_1ende_209",Ve="_modeSegments_1ende_221",Je="_radioLabel_1ende_242",Qe="_radioLabelActive_1ende_263",Ze="_presetGroup_1ende_277",Xe="_presetBtn_1ende_285",et="_presetBtnActive_1ende_308",tt="_freeInput_1ende_315",st="_inputError_1ende_332",at="_inputUnit_1ende_336",nt="_cascadeRow_1ende_343",it="_retentionActions_1ende_359",ot="_saveBtn_1ende_365",lt="_runNowBtn_1ende_393",rt="_errorMsg_1ende_437",ct="_freeInputHitArea_1ende_499",o={card:ke,cardEmbedded:Le,cardTitle:Pe,storageConsoleGrid:Re,storageUsageColumn:we,storagePolicyColumn:He,usageRow:Be,usageTotal:Ae,usageBreakdown:Me,usageCounts:$e,storageFooter:De,lastRunRow:Ee,lastRunLabel:Te,errorIcon:Ue,tooltip:Ie,cleanupRow:ze,cleanupLabel:Fe,cleanupBtn:Oe,cleanupBtnDanger:Ge,retentionSection:qe,retentionTitle:We,retentionFieldset:Ye,proOverlay:Ke,modeSegments:Ve,radioLabel:Je,radioLabelActive:Qe,presetGroup:Ze,presetBtn:Xe,presetBtnActive:et,freeInput:tt,inputError:st,inputUnit:at,cascadeRow:nt,retentionActions:it,saveBtn:ot,runNowBtn:lt,errorMsg:rt,freeInputHitArea:ct};function dt(t,s){return!!(t.mode==="off"&&s.mode!=="off"||t.mode==="age"&&s.mode==="age"&&(s.ageDays??0)<(t.ageDays??0)||t.mode==="size"&&s.mode==="size"&&(s.sizeMb??0)<(t.sizeMb??0)||!t.cascadeSnapshots&&s.cascadeSnapshots)}function ne(t){return t.mode==="age"?Number.isInteger(t.ageDays)&&t.ageDays>=1&&t.ageDays<=365:t.mode==="size"?Number.isInteger(t.sizeMb)&&t.sizeMb>=50&&t.sizeMb<=1e4:!0}function ut(t,s){return t.mode===s.mode&&t.ageDays===s.ageDays&&t.sizeMb===s.sizeMb&&t.cascadeSnapshots===s.cascadeSnapshots}function q(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(2)} GB`}function pt({placeId:t,tier:s,currentPolicy:c,onSaved:u}){const{t:i}=te(),{trackEvent:C}=re(),[a,j]=l.useState(c),[h,w]=l.useState(()=>[7,14,30,90].includes(c.ageDays??-1)?"":String(c.ageDays??30)),[N,L]=l.useState(()=>[100,500,1e3].includes(c.sizeMb??-1)?"":String(c.sizeMb??500)),[P,D]=l.useState(null),[f,x]=l.useState(!1),[E,_]=l.useState(!1),[y,H]=l.useState(!1),[S,B]=l.useState(null);l.useEffect(()=>{j(c);const p=[7,14,30,90],R=[100,500,1e3];w(p.includes(c.ageDays??-1)?"":String(c.ageDays??30)),L(R.includes(c.sizeMb??-1)?"":String(c.sizeMb??500))},[c]);const M=s==="basic",b=ne(a),m=ut(c,a),$=b&&!m&&!E,r=p=>{j(R=>{const U={...R,mode:p};return p==="age"&&(U.ageDays=parseInt(h,10)||30),p==="size"&&(U.sizeMb=parseInt(N,10)||500),U})},A=p=>{w(""),j(R=>({...R,ageDays:p}))},W=p=>{L(""),j(R=>({...R,sizeMb:p}))},Z=p=>{w(p);const R=parseInt(p,10);Number.isNaN(R)||j(U=>({...U,ageDays:R}))},F=p=>{L(p);const R=parseInt(p,10);Number.isNaN(R)||j(U=>({...U,sizeMb:R}))},O=async()=>{if(B(null),C("dashboard_click_event",{click_target:"ui_studio_cleanup_save",page:"settings"}),dt(c,a)){try{const p=await ue(t,{mode:a.mode,ageDays:a.ageDays,sizeMb:a.sizeMb,cascadeSnapshots:a.cascadeSnapshots});D(p.dryRun),x(!0)}catch(p){B(p.message)}return}await G()},G=async()=>{_(!0);try{await Ce(t,a),x(!1),u()}catch(p){throw B(p.message),p}finally{_(!1)}},d=async()=>{B(null),C("dashboard_click_event",{click_target:"ui_studio_cleanup_run_now",page:"settings"}),H(!0);try{await be(t),u()}catch(p){B(p.message)}finally{H(!1)}},v=P?`${i("uiStudio.cleanup.policy.confirm.messageStrict","이 정책으로 즉시")} ${P.wouldRemoveRequests}${i("uiStudio.cleanup.policy.confirm.requests","건")} / ${P.wouldRemoveSnapshots}${i("uiStudio.cleanup.policy.confirm.snapshots","개 화면 캡처")} / ${q(P.wouldFreeBytes)} ${i("uiStudio.cleanup.policy.confirm.freed","가 삭제됩니다 — 적용?")}`:"",Y=a.mode==="age"&&!ne(a),z=a.mode==="size"&&!ne(a);return e.jsxs("div",{className:o.retentionSection,children:[e.jsx("h3",{className:o.retentionTitle,children:e.jsx(k,{label:i("uiStudio.cleanup.policy.title","자동 삭제 정책"),tooltip:i("uiStudio.cleanup.policy.title.tooltip","Rules that automatically remove old or large captures.")})}),e.jsxs("div",{style:{position:"relative"},children:[M&&e.jsx("div",{className:o.proOverlay,title:i("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능"),children:e.jsx("div",{className:o.tooltip,children:i("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능")})}),e.jsxs("fieldset",{className:o.retentionFieldset,disabled:M,"aria-label":i("uiStudio.cleanup.policy.title","자동 삭제 정책"),style:M?{opacity:.45,pointerEvents:"none"}:void 0,children:[e.jsxs("div",{className:o.modeSegments,"data-testid":"cleanup-mode-segments",children:[e.jsx(g,{text:i("uiStudio.cleanup.policy.modeOff.tooltip","Turn off auto-cleanup. Data stays until you remove it manually."),children:e.jsxs("label",{className:`${o.radioLabel} ${a.mode==="off"?o.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"off",checked:a.mode==="off",onChange:()=>r("off")}),i("uiStudio.cleanup.policy.modeOff","사용 안 함 (off)")]})}),e.jsx(g,{text:i("uiStudio.cleanup.policy.modeAge.tooltip","Automatically delete data older than the configured number of days."),children:e.jsxs("label",{className:`${o.radioLabel} ${a.mode==="age"?o.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"age",checked:a.mode==="age",onChange:()=>r("age")}),i("uiStudio.cleanup.policy.modeAge","기간 기반 (age)")]})}),e.jsx(g,{text:i("uiStudio.cleanup.policy.modeSize.tooltip","When total usage exceeds the limit, the oldest data is removed first."),children:e.jsxs("label",{className:`${o.radioLabel} ${a.mode==="size"?o.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"size",checked:a.mode==="size",onChange:()=>r("size")}),i("uiStudio.cleanup.policy.modeSize","용량 기반 (size)")]})})]}),a.mode==="age"&&e.jsxs("div",{className:o.presetGroup,children:[[7,14,30,90].map(p=>e.jsx(g,{text:i("uiStudio.cleanup.policy.agePreset.tooltip","Delete data older than this many days."),children:e.jsxs("button",{type:"button",className:`${o.presetBtn} ${a.ageDays===p&&h===""?o.presetBtnActive:""}`,onClick:()=>A(p),children:[p,i("uiStudio.cleanup.policy.daysUnit","일")]})},p)),e.jsx(g,{text:i("uiStudio.cleanup.policy.ageInput.tooltip","Enter any value between 1 and 365 days."),children:e.jsx("label",{className:o.freeInputHitArea,children:e.jsx("input",{type:"number",className:`${o.freeInput} ${Y?o.inputError:""}`,value:h,min:1,max:365,onChange:p=>Z(p.target.value)})})}),e.jsxs("span",{className:o.inputUnit,children:["1–365",i("uiStudio.cleanup.policy.daysUnit","일")]})]}),a.mode==="size"&&e.jsxs("div",{className:o.presetGroup,children:[[100,500,1e3].map(p=>e.jsx(g,{text:i("uiStudio.cleanup.policy.sizePreset.tooltip","Keep total usage under this size."),children:e.jsxs("button",{type:"button",className:`${o.presetBtn} ${a.sizeMb===p&&N===""?o.presetBtnActive:""}`,onClick:()=>W(p),children:[p,i("uiStudio.cleanup.policy.mbUnit","MB")]})},p)),e.jsx(g,{text:i("uiStudio.cleanup.policy.sizeInput.tooltip","Enter any value between 50 MB and 10000 MB (10 GB)."),children:e.jsx("label",{className:o.freeInputHitArea,children:e.jsx("input",{type:"number",className:`${o.freeInput} ${z?o.inputError:""}`,value:N,min:50,max:1e4,onChange:p=>F(p.target.value)})})}),e.jsxs("span",{className:o.inputUnit,children:["50–10000",i("uiStudio.cleanup.policy.mbUnit","MB")]})]}),e.jsx(g,{text:i("uiStudio.cleanup.policy.cascade.tooltip","Also delete the capture images linked to those records. If off, the images stay."),children:e.jsxs("label",{className:o.cascadeRow,children:[e.jsx(_e,{checked:a.cascadeSnapshots,onChange:p=>j(R=>({...R,cascadeSnapshots:p.target.checked}))}),i("uiStudio.cleanup.policy.cascade","연결된 화면 캡처도 함께 삭제")]})}),e.jsxs("div",{className:o.retentionActions,children:[e.jsx(g,{text:i("uiStudio.cleanup.policy.save.tooltip","Save the current cleanup rule. It runs in the background from then on."),children:e.jsx("button",{type:"button",className:o.saveBtn,onClick:()=>void O(),disabled:!$,children:i("uiStudio.cleanup.policy.save","정책 저장")})}),e.jsx(g,{text:i("uiStudio.cleanup.policy.runNow.tooltip","저장된 정리 정책을 다음 자동 실행까지 기다리지 않고 지금 한 번 실행합니다."),children:e.jsx("button",{type:"button",className:o.runNowBtn,onClick:()=>void d(),disabled:y,children:i("uiStudio.cleanup.policy.runNow","저장된 정책으로 정리")})})]}),S&&e.jsx("div",{className:o.errorMsg,children:S})]})]}),f&&P&&e.jsx(de,{title:i("uiStudio.cleanup.policy.confirm.title","정책 적용 확인"),message:v,danger:!0,confirmLabel:i("uiStudio.cleanup.policy.save","정책 저장"),busy:E,onConfirm:G,onClose:()=>x(!1)})]})}function gt({placeId:t,tier:s,onChanged:c,sampleUsage:u,sampleRetention:i,embedded:C=!1}){const{t:a}=te(),j=s==="basic"&&u!=null&&i!=null,[h,w]=l.useState(j?u:null),[N,L]=l.useState(j?i:null),[P,D]=l.useState(null),[f,x]=l.useState(null),[E,_]=l.useState(null),y=l.useCallback(async()=>{if(!j&&t!=null){D(null);try{const[r,A]=await Promise.all([pe(t),ue(t)]);w(r),L(A.policy)}catch(r){D(r.message)}}},[t,j]);l.useEffect(()=>{y()},[y]);const H=l.useCallback(()=>{y(),c==null||c()},[y,c]),S=l.useCallback(async()=>{if(f&&t!=null){_(null);try{f.kind==="keep7"?await se(t,{olderThanDays:7,alsoSnapshots:!0}):f.kind==="keep30"?await se(t,{olderThanDays:30,alsoSnapshots:!0}):await se(t,{all:!0,alsoSnapshots:!0}),x(null),y(),c==null||c()}catch(r){throw _(r.message),r}}},[f,t,y,c]);function B(r){const A=a("uiStudio.cleanup.studioPreservedNote","This deletes saved change records and screenshots on disk only; Roblox Studio instances are not affected.");return r.kind==="keep7"?`${a("uiStudio.cleanup.cleanupConfirmMessage.keep7","7일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${A}`:r.kind==="keep30"?`${a("uiStudio.cleanup.cleanupConfirmMessage.keep30","30일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${A}`:`${((h==null?void 0:h.requestCount)??0)+((h==null?void 0:h.snapshotCount)??0)}${a("uiStudio.cleanup.cleanupConfirmMessage.all","개의 저장된 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${A}`}if(t==null&&!j)return null;if(P)return e.jsx("div",{className:`${o.card} ${C?o.cardEmbedded:""}`,children:e.jsx("p",{className:o.errorMsg,children:P})});if(!h||!N)return e.jsx("div",{className:`${o.card} ${C?o.cardEmbedded:""}`,children:e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",margin:0},children:a("uiStudio.storage.loading","로딩 중...")})});const M=N.lastRunAt,b=N.lastRunStats,m=M?new Date(M).toLocaleString():null,$=t??0;return e.jsxs("div",{className:`${o.card} ${C?o.cardEmbedded:""}`,children:[!C&&e.jsx("h3",{className:o.cardTitle,children:e.jsx(k,{label:a("uiStudio.storage.title","UI Studio 저장 데이터"),tooltip:a("uiStudio.storage.title.tooltip","Disk usage of UI Studio change records and screenshots.")})}),e.jsxs("div",{className:o.storageConsoleGrid,"data-testid":"ui-studio-storage-console-grid",children:[e.jsx("section",{className:o.storageUsageColumn,children:e.jsxs("div",{className:o.usageRow,children:[e.jsx(g,{text:a("uiStudio.storage.usageLabel.tooltip","Disk space currently used by UI Studio for this project."),children:e.jsxs("div",{className:o.usageTotal,children:[a("uiStudio.storage.usageLabel","사용 중")," ",q(h.totalBytes)]})}),e.jsxs("div",{className:o.usageBreakdown,children:[e.jsx(g,{text:a("uiStudio.storage.historyBytes.tooltip","Space taken by change record data (JSON)."),children:e.jsxs("span",{children:[a("uiStudio.storage.historyBytes","변경 이력")," ",q(h.historyBytes)]})})," · ",e.jsx(g,{text:a("uiStudio.storage.snapshotBytes.tooltip","Space taken by captured PNG image files."),children:e.jsxs("span",{children:[a("uiStudio.storage.snapshotBytes","화면 캡처")," ",q(h.snapshotBytes)]})})]}),e.jsxs("div",{className:o.usageCounts,children:[e.jsx(g,{text:a("uiStudio.storage.requestCount.tooltip","Number of actions where AI changed the UI."),children:e.jsxs("span",{children:[a("uiStudio.storage.requestCount","변경 기록")," ",h.requestCount.toLocaleString(),a("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(g,{text:a("uiStudio.storage.mutationCount.tooltip","Number of detail changes inside actions (one property edit = 1)."),children:e.jsxs("span",{children:[a("uiStudio.storage.mutationCount","변경 상세")," ",h.mutationCount.toLocaleString(),a("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(g,{text:a("uiStudio.storage.snapshotCount.tooltip","Number of saved capture image files."),children:e.jsxs("span",{children:[a("uiStudio.storage.snapshotCount","화면 캡처")," ",h.snapshotCount.toLocaleString(),a("uiStudio.storage.countSuffix","개")]})})]})]})}),e.jsx("section",{className:o.storagePolicyColumn,children:e.jsx(pt,{placeId:$,tier:s,currentPolicy:N,onSaved:H})})]}),e.jsxs("div",{className:o.storageFooter,"data-testid":"ui-studio-storage-footer",children:[e.jsxs("div",{className:o.lastRunRow,children:[e.jsx("span",{className:o.lastRunLabel,children:e.jsx(k,{label:a("uiStudio.storage.lastRun","마지막 자동 정리"),tooltip:a("uiStudio.storage.lastRun.tooltip","When the auto-cleanup policy last ran, and what it removed.")})}),m?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:m}),b&&e.jsxs("span",{children:["· ",a("uiStudio.storage.requestCount","변경 기록")," ",b.removedRequests,a("uiStudio.storage.countSuffix","개")," / ",a("uiStudio.storage.snapshotCount","화면 캡처")," ",b.removedSnapshots,a("uiStudio.storage.countSuffix","개")," / ",q(b.freedBytes)," ",a("uiStudio.storage.lastRunFreed","회수")]}),b&&b.errors>0&&e.jsxs("span",{className:o.errorIcon,title:`${a("uiStudio.storage.lastRunErrors","오류")} ${b.errors}건`,children:["⚠",e.jsxs("span",{className:o.tooltip,children:[a("uiStudio.storage.lastRunErrors","오류")," ",b.errors,a("uiStudio.storage.countSuffix","건")]})]})]}):e.jsx("span",{children:a("uiStudio.storage.lastRunNever","—")})]}),e.jsxs("div",{className:o.cleanupRow,children:[e.jsx("span",{className:o.cleanupLabel,children:e.jsx(k,{label:a("uiStudio.cleanup.label","수동 정리"),tooltip:a("uiStudio.cleanup.label.tooltip","Manually clean up change records and captures whenever you want.")})}),e.jsx(g,{text:a("uiStudio.cleanup.keep7.tooltip","Delete change records and captures older than 7 days."),children:e.jsx("button",{type:"button",className:o.cleanupBtn,onClick:()=>x({kind:"keep7"}),disabled:s==="basic",children:a("uiStudio.cleanup.keepLastNDays","최근 7일만 남기기").replace("{n}","7")})}),e.jsx(g,{text:a("uiStudio.cleanup.keep30.tooltip","Delete change records and captures older than 30 days."),children:e.jsx("button",{type:"button",className:o.cleanupBtn,onClick:()=>x({kind:"keep30"}),disabled:s==="basic",children:a("uiStudio.cleanup.keepLastNDays","최근 30일만 남기기").replace("{n}","30")})}),!C&&e.jsx(g,{text:a("uiStudio.cleanup.deleteAll.tooltip","Delete every change record and capture for this project. The actual UI in Roblox Studio is not affected."),children:e.jsx("button",{type:"button",className:`${o.cleanupBtn} ${o.cleanupBtnDanger}`,onClick:()=>x({kind:"all"}),disabled:s==="basic",children:a("uiStudio.cleanup.deleteAll","전체 삭제…")})})]})]}),E&&e.jsx("div",{className:o.errorMsg,children:E}),f&&e.jsx(de,{title:a("uiStudio.cleanup.cleanupConfirmTitle","정리 확인"),message:B(f),danger:!0,confirmLabel:a("common.delete","삭제"),onConfirm:S,onClose:()=>{x(null),_(null)}})]})}function ie(t,s){const c={placeId:String(t)};return s&&(c["preview.mode"]=s.mode,s.mode==="size"&&(c["preview.sizeMb"]=String(s.sizeMb))),T.get("/api/dashboard/changelog/cleanup",c)}function oe(t){return T.put("/api/dashboard/changelog/cleanup",t)}function ht(t){return T.post(`/api/dashboard/changelog/cleanup/run?placeId=${encodeURIComponent(t)}`)}const mt=[100,500,1e3];function le(t,s){return t.mode!==s.mode?!1:t.mode==="off"||s.mode==="size"&&t.sizeMb===s.sizeMb}function yt(t,s){return t.mode==="off"?!1:s.mode==="off"||t.sizeMb<s.sizeMb}function V(t){return t<1e3?`${t} B`:t<1e6?`${(t/1e3).toFixed(1)} KB`:t<1e9?`${(t/1e6).toFixed(1)} MB`:`${(t/1e9).toFixed(2)} GB`}function jt({placeId:t,onChanged:s}){const{locale:c,t:u}=te(),[i,C]=l.useState(null),[a,j]=l.useState({mode:"size",sizeMb:500}),[h,w]=l.useState(t!==null),[N,L]=l.useState(!1),[P,D]=l.useState(!1),[f,x]=l.useState(!1),[E,_]=l.useState(!1),[y,H]=l.useState(null),S=l.useCallback(async()=>{if(t===null){C(null),w(!1);return}D(!1);try{const d=await ie(t);C(d),j(d.policy)}catch{D(!0)}finally{w(!1)}},[t]);l.useEffect(()=>{w(t!==null),S()},[S,t]);const B=l.useCallback(async d=>{L(!0),x(!1),_(!1);try{await oe(d),H(null),await S(),_(!0),s==null||s()}catch{x(!0)}finally{L(!1)}},[S,s]),M=l.useCallback(async()=>{if(!(!i||t===null||le(a,i.policy))){L(!0),x(!1),_(!1);try{if(yt(a,i.policy)){const d=await ie(t,a);if(d.preview.affectedPlaceCount>0){H({policy:a,preview:d});return}}await oe(a),await S(),_(!0),s==null||s()}catch{x(!0)}finally{L(!1)}}},[i,a,S,s,t]),b=l.useCallback(async()=>{if(t!==null){L(!0),x(!1),_(!1);try{await ht(t),await S(),s==null||s()}catch{x(!0)}finally{L(!1)}}},[S,s,t]),m=i==null?void 0:i.selectedPlace.currentUsage,$=(i==null?void 0:i.policy.mode)==="size"?i.policy.sizeMb*1e6:null,r=$??Math.max((m==null?void 0:m.bytes)??0,1),A=Math.min(100,((m==null?void 0:m.sessionBytes)??0)/r*100),W=Math.min(Math.max(0,100-A),((m==null?void 0:m.contextBytes)??0)/r*100),Z=i?!le(a,i.policy):!1,F=d=>d.mode==="off"?u("settings.projectChanges.cleanup.unlimited","Unlimited"):`${d.sizeMb} MB`,O=l.useMemo(()=>{if(!y)return"";const d=y.preview.preview,v=u("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}",V(d.estimatedFreedBytes));return d.wouldRemainOverLimitPlaceCount===0?v:`${v} ${u("settings.projectChanges.cleanup.confirm.protected","{places} Place may remain over the limit because active data is protected.").replace("{places}",d.wouldRemainOverLimitPlaceCount.toLocaleString())}`},[y,u]);if(t===null)return e.jsx("div",{className:n.projectChangesPanel,children:e.jsx("p",{className:n.projectChangesEmpty,children:u("settings.projectChanges.cleanup.noPlace","Select a Place to manage saved project changes.")})});if(h)return e.jsx("div",{className:n.projectChangesPanel,children:e.jsx("p",{className:n.projectChangesEmpty,children:u("settings.projectChanges.cleanup.loading","Loading storage settings…")})});if(P||!i||!m)return e.jsxs("div",{className:n.projectChangesPanel,children:[e.jsx("p",{className:n.projectChangesError,role:"alert",children:u("settings.projectChanges.cleanup.loadFailed","Could not load storage settings.")}),e.jsx("button",{className:n.projectChangesSecondaryButton,type:"button",onClick:()=>{w(!0),S()},children:u("common.retry","Retry")})]});const G=$===null?u("settings.projectChanges.cleanup.usageUnlimited","{used} used · Unlimited").replace("{used}",V(m.bytes)):u("settings.projectChanges.cleanup.usageLimited","{used} used of {limit}").replace("{used}",V(m.bytes)).replace("{limit}",F(i.policy));return e.jsxs("div",{className:n.projectChangesPanel,children:[e.jsxs("div",{className:n.projectChangesConsoleGrid,"data-testid":"project-storage-console-grid",children:[e.jsxs("section",{className:n.projectChangesUsageColumn,children:[e.jsx("h3",{className:n.projectChangesPanelTitle,children:e.jsx(k,{label:u("settings.projectChanges.cleanup.title","Storage management"),tooltip:u("settings.projectChanges.cleanup.title.tooltip","Set how much Project Change Summary history each Place can keep.")})}),e.jsxs("div",{className:n.projectChangesUsageBlock,children:[e.jsx("div",{className:n.projectChangesUsageSummary,children:G}),e.jsxs("div",{className:n.projectChangesQuotaRail,role:"meter","aria-label":u("settings.projectChanges.cleanup.usageAria","Place storage usage"),"aria-valuemin":0,"aria-valuenow":m.bytes,"aria-valuemax":$??m.bytes,children:[e.jsx("span",{className:n.projectChangesSessionRail,style:{width:`${A}%`}}),e.jsx("span",{className:n.projectChangesContextRail,style:{width:`${W}%`}})]}),e.jsxs("div",{className:n.projectChangesUsageLegend,children:[e.jsxs("span",{children:[u("settings.projectChanges.cleanup.sessions","Sessions")," ",e.jsx("strong",{children:V(m.sessionBytes)})]}),e.jsxs("span",{children:[u("settings.projectChanges.cleanup.contexts","Contexts")," ",e.jsx("strong",{children:V(m.contextBytes)})]})]})]})]}),e.jsxs("section",{className:n.projectChangesPolicyColumn,children:[e.jsx("p",{className:n.projectChangesScope,children:u("settings.projectChanges.cleanup.scope","One setting applies the selected limit separately to every Place.")}),e.jsxs("fieldset",{className:n.projectChangesPolicyFieldset,disabled:N,children:[e.jsx("legend",{className:n.projectChangesPolicyLegend,children:u("settings.projectChanges.cleanup.limit","Limit per Place")}),e.jsxs("div",{className:n.projectChangesPresetGroup,children:[mt.map(d=>{const v=a.mode==="size"&&a.sizeMb===d;return e.jsx("button",{className:`${n.projectChangesPresetButton} ${v?n.projectChangesPresetButtonActive:""}`,type:"button","aria-pressed":v,onClick:()=>j({mode:"size",sizeMb:d}),children:u("settings.projectChanges.cleanup.preset","{sizeMb}MB").replace("{sizeMb}",String(d))},d)}),e.jsx("button",{className:`${n.projectChangesPresetButton} ${a.mode==="off"?n.projectChangesPresetButtonActive:""}`,type:"button","aria-pressed":a.mode==="off",onClick:()=>j({mode:"off"}),children:u("settings.projectChanges.cleanup.unlimited","Unlimited")})]})]}),e.jsxs("div",{className:n.projectChangesActions,children:[e.jsx("button",{className:n.projectChangesSaveButton,type:"button",disabled:!Z||N,onClick:()=>void M(),children:u("common.save","Save")}),e.jsx("button",{className:n.projectChangesSecondaryButton,type:"button",disabled:N,onClick:()=>void b(),children:u("settings.projectChanges.cleanup.runNow","Run saved policy")}),E&&e.jsx("span",{className:n.projectChangesSaved,role:"status",children:u("settings.projectChanges.cleanup.saved","Saved")})]})]})]}),i.selectedPlace.dryRun.wouldRemainOverLimit&&e.jsx("p",{className:n.projectChangesWarning,children:u("settings.projectChanges.cleanup.protectedWarning","Active changes are protected, so this Place may stay over the limit.")}),e.jsxs("div",{className:n.projectChangesLastRun,"data-testid":"project-storage-footer",children:[e.jsx("span",{className:n.projectChangesLastRunLabel,children:u("settings.projectChanges.cleanup.lastRun","Last cleanup")}),i.selectedPlace.lastRun?e.jsxs("span",{children:[new Date(i.selectedPlace.lastRun.ranAt).toLocaleString(c)," · ",u("settings.projectChanges.cleanup.lastRunSummary","{sessions} sessions · {bytes} freed").replace("{sessions}",i.selectedPlace.lastRun.deletedSessionCount.toLocaleString()).replace("{bytes}",V(i.selectedPlace.lastRun.freedBytes))]}):e.jsx("span",{children:u("settings.projectChanges.cleanup.neverRun","Not run yet")})]}),f&&e.jsx("p",{className:n.projectChangesError,role:"alert",children:u("settings.projectChanges.cleanup.actionFailed","Could not update storage settings.")}),e.jsx(ce,{open:y!==null,title:u("settings.projectChanges.cleanup.confirm.title","Apply this limit and clean saved changes?"),message:O,cancelLabel:u("common.cancel","Cancel"),confirmLabel:u("settings.projectChanges.cleanup.confirm.apply","Apply and clean"),loading:N,onCancel:()=>!N&&H(null),onConfirm:()=>{y&&B(y.policy)}})]})}const ft={toolsActivity:null,toolStats:null,toolSessions:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null},xt={toolsActivity:null,toolStats:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null};function vt(t){var s;return t?t.pluginConnected?t.activePlaceId:t.lastActivePlaceId??((s=t.places[0])==null?void 0:s.placeId)??null:null}async function I(t){try{return await t}catch{return null}}function X(t){return t?typeof t.total=="number"?t.total:Array.isArray(t.entries)?t.entries.length:null:null}function ee(t,s,c,u){return s===null?t("settings.dataHistory.metric.unavailable","Unavailable"):`${s.toLocaleString()} ${t(c,u)}`}function J(t,s,c){const u=c===null?t("settings.dataHistory.metric.sizeUnavailable","size unavailable"):q(c);return`${s} · ${u}`}function Q(t,s){var u;const c=(u=t==null?void 0:t[s])==null?void 0:u.bytes;return typeof c=="number"&&Number.isFinite(c)?c:null}function St(t,s){return s?[`${s.requestCount.toLocaleString()} ${t("uiStudio.storage.requestCount","change records")}`,`${s.snapshotCount.toLocaleString()} ${t("uiStudio.storage.snapshotCount","screenshots")}`,q(s.totalBytes)].join(" · "):t("settings.dataHistory.metric.unavailable","Unavailable")}function bt({tier:t}){const{t:s}=te(),[c,u]=l.useState(ft),[i,C]=l.useState(xt),[a,j]=l.useState(t==="basic"?ae:null),[h,w]=l.useState(null),[N,L]=l.useState(!0),[P,D]=l.useState(!0),[f,x]=l.useState(null),[E,_]=l.useState(()=>new Set),[y,H]=l.useState(null),[S,B]=l.useState(!1),[M,b]=l.useState(null),m=l.useCallback(async()=>{L(!0);const d=await I(me()),v=vt(d);w(v);const[Y,z,p,R,U,ge,K]=await Promise.all([I(T.get("/api/dashboard/history",{limit:"1",offset:"0"})),I(T.get("/api/dashboard/tool-stats")),I(T.get("/sync/history",{limit:"1",offset:"0"})),I(T.get("/api/dashboard/playtest/history")),I(T.get("/api/dashboard/changelog",{limit:"1",offset:"0"})),I(T.get("/api/dashboard/connection-log")),I(T.get("/api/dashboard/storage-summary"))]),he=t==="basic"?ae:v===null?null:await I(pe(v));u({toolsActivity:X(Y),toolStats:(z==null?void 0:z.totalCalls)??null,toolSessions:(z==null?void 0:z.totalSessions)??null,syncLog:X(p),playtestReports:X(R),projectChanges:X(U),connectionLog:X(ge)}),C({toolsActivity:Q(K,"toolsActivity"),toolStats:Q(K,"toolStats"),syncLog:Q(K,"syncLog"),playtestReports:Q(K,"playtestReports"),projectChanges:Q(K,"projectChanges"),connectionLog:Q(K,"connectionLog")}),j(he),L(!1)},[t]);l.useEffect(()=>{m()},[m]);const $=l.useCallback(d=>{_(v=>{if(v.has(d))return v;const Y=new Set(v);return Y.add(d),Y}),x(v=>v===d?null:d)},[]),r=l.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:J(s,ee(s,c.toolsActivity,"settings.dataHistory.metric.records","records"),i.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:J(s,c.toolStats===null?s("settings.dataHistory.metric.unavailable","Unavailable"):`${c.toolStats.toLocaleString()} ${s("settings.dataHistory.metric.runs","runs")} · ${(c.toolSessions??0).toLocaleString()} ${s("settings.dataHistory.metric.sessions","sessions")}`,i.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:J(s,ee(s,c.syncLog,"settings.dataHistory.metric.records","records"),i.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:J(s,ee(s,c.playtestReports,"settings.dataHistory.metric.reports","reports"),i.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:J(s,ee(s,c.projectChanges,"settings.dataHistory.metric.records","records"),i.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:J(s,ee(s,c.connectionLog,"settings.dataHistory.metric.records","records"),i.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"}],[c,i,s]),A=async()=>{if(y){B(!0),b(null);try{if(y.kind==="uiStudio"){if(t!=="pro"||h===null)throw new Error("UI Studio place is unavailable");await se(h,{all:!0,alsoSnapshots:!0}),b(s("settings.dataHistory.uiStudio.clear.success","UI Studio saved data cleared."))}else{const d=y.row.key==="projectChanges";if(d&&h===null)throw new Error("Project changes place is unavailable");let v=y.row.clearEndpoint;d&&h!==null&&(v=`${v}?placeId=${encodeURIComponent(h)}`),await T.post(v),b(d?s("settings.dataHistory.projectChanges.clear.success","Project change summaries cleared."):s("settings.dataHistory.clear.success","Saved data cleared."))}H(null),await m()}catch{b(y.kind==="uiStudio"?s("settings.dataHistory.uiStudio.clear.failed","Failed to clear UI Studio saved data."):s("settings.dataHistory.clear.failed","Failed to clear saved data."))}finally{B(!1)}}},W=t==="pro"?h:0,Z=t==="pro"&&h!==null,F=(y==null?void 0:y.kind)==="uiStudio",O=(y==null?void 0:y.kind)==="row"&&y.row.key==="projectChanges",G=s("settings.dataHistory.title","Data & History");return e.jsxs(e.Fragment,{children:[e.jsxs("section",{id:"data-history",className:n.card,children:[e.jsxs("div",{className:n.cardHeader,children:[e.jsx(k,{label:s("settings.dataHistory.title","Data & History"),tooltip:s("settings.dataHistory.title.tooltip","Manage saved dashboard data in one place.")}),e.jsxs("div",{className:n.cardHeaderActions,children:[e.jsx(g,{text:s("settings.dataHistory.scope.tooltip","Clear actions apply to the current project and active place where applicable."),children:e.jsx("span",{className:n.headerBadge,children:N?s("common.loading","Loading"):s("settings.dataHistory.scope","Current project")})}),e.jsx(g,{text:s("settings.dataHistory.toggle.tooltip","Collapse or expand this section."),children:e.jsx("button",{className:n.collapseButton,type:"button","aria-expanded":P,"aria-controls":"settings-data-history-body","aria-label":P?s("settings.dataHistory.collapse","Collapse {title}").replace("{title}",G):s("settings.dataHistory.expand","Expand {title}").replace("{title}",G),onClick:()=>D(d=>!d),children:P?"▾":"▸"})})]})]}),P&&e.jsxs("div",{id:"settings-data-history-body",children:[e.jsx("p",{className:n.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:n.dataHistoryList,children:[r.map(d=>e.jsxs(l.Fragment,{children:[e.jsxs("div",{className:`${n.dataHistoryRow} ${d.key==="projectChanges"&&f==="projectChanges"?n.dataHistoryRowExpanded:""}`,children:[e.jsxs("div",{className:n.dataHistoryMain,children:[e.jsx("div",{className:n.dataHistoryTitle,children:d.title}),e.jsx("div",{className:n.dataHistoryDescription,children:d.description})]}),e.jsx(g,{text:d.metricTooltip,children:e.jsx("div",{className:n.dataHistoryMetric,children:d.metric})}),e.jsxs("div",{className:n.dataHistoryActions,children:[e.jsx(g,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:n.linkButton,href:`#${d.route}`,children:s("settings.dataHistory.open","Open")})}),d.key==="projectChanges"&&e.jsx(g,{text:s("settings.dataHistory.manageStorage.tooltip","Show or hide storage policy and cleanup controls."),children:e.jsxs("button",{className:n.manageStorageButton,type:"button","aria-expanded":f==="projectChanges","aria-controls":"settings-project-changes-storage","aria-label":s("settings.dataHistory.manageStorage.projectChanges.aria","Manage Project change summary storage"),onClick:()=>$("projectChanges"),children:[s("settings.dataHistory.manageStorage","Manage storage"),e.jsx("span",{"aria-hidden":"true",children:f==="projectChanges"?"▴":"▾"})]})}),e.jsx(g,{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:n.dangerButton,type:"button",disabled:d.key==="projectChanges"&&h===null,onClick:()=>H({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:`${n.dataHistoryDetail} ${n.projectChangesDataHistoryDetail}`,hidden:f!=="projectChanges",children:e.jsx(jt,{placeId:h,onChanged:m})})]},d.key)),e.jsxs("div",{className:`${n.dataHistoryRow} ${f==="uiStudio"?n.dataHistoryRowExpanded:""}`,children:[e.jsxs("div",{className:n.dataHistoryMain,children:[e.jsx("div",{className:n.dataHistoryTitle,children:s("settings.dataHistory.uiStudio.title","UI Studio history and screenshots")}),e.jsx("div",{className:n.dataHistoryDescription,children:s("settings.dataHistory.uiStudio.description","Saved UI Studio change records, screenshots, and cleanup policy.")})]}),e.jsx(g,{text:s("settings.dataHistory.uiStudio.metric.tooltip","UI Studio change record and capture counts, plus total disk usage."),children:e.jsx("div",{className:n.dataHistoryMetric,children:St(s,a)})}),e.jsxs("div",{className:n.dataHistoryActions,children:[e.jsx(g,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:n.linkButton,href:"#/ui-studio?tab=history",children:s("settings.dataHistory.open","Open")})}),e.jsx(g,{text:s("settings.dataHistory.manageStorage.tooltip","Show or hide storage policy and cleanup controls."),children:e.jsxs("button",{className:n.manageStorageButton,type:"button","aria-expanded":f==="uiStudio","aria-controls":"settings-ui-studio-storage","aria-label":s("settings.dataHistory.manageStorage.uiStudio.aria","Manage UI Studio history and screenshots storage"),onClick:()=>$("uiStudio"),children:[s("settings.dataHistory.manageStorage","Manage storage"),e.jsx("span",{"aria-hidden":"true",children:f==="uiStudio"?"▴":"▾"})]})}),e.jsx(g,{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:n.dangerButton,type:"button",disabled:!Z,onClick:()=>H({kind:"uiStudio"}),children:s("settings.dataHistory.clearAll","Clear all")})})]})]}),E.has("uiStudio")&&e.jsx("div",{id:"settings-ui-studio-storage",className:`${n.dataHistoryDetail} ${n.uiStudioDataHistoryDetail}`,hidden:f!=="uiStudio",children:e.jsx(gt,{placeId:W,tier:t,onChanged:m,embedded:!0,...t==="basic"?{sampleUsage:ae,sampleRetention:Ne}:{}})})]}),M&&e.jsx("p",{className:n.inlineStatus,children:M})]})]}),e.jsx(ce,{open:y!==null,title:F?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:F?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||F?s("settings.dataHistory.clearAll","Clear all"):s("common.clear","Clear"),loading:S,onCancel:()=>!S&&H(null),onConfirm:()=>void A()})]})}const Ct={en:"English",ko:"한국어",es:"Español","pt-br":"Português (BR)",ja:"日本語",id:"Bahasa Indonesia",de:"Deutsch","fr-fr":"Français"};function Nt(t){return t==="active"?n.statusActive:t==="grace"?n.statusGrace:t==="invalid"||t==="revoked"?n.statusError:n.statusInactive}function _t(t){return t?t.refreshBlockedReason==="missing_session_token"?!0:t.status==="active"||t.status==="grace"||t.status==="invalid"||t.status==="revoked"||t.status==="unknown":!1}function kt(t,s){return t.refreshBlockedReason==="missing_session_token"?{label:s("settings.license.status.activationRequired","Activation Required"),tooltip:s("settings.license.status.activationRequired.tooltip","Manual license activation is required before WEPPY Dashboard can refresh this status."),detail:s("settings.license.detail.missingSessionToken","Refresh is blocked because the current session token is missing."),detailTone:n.licenseNoticeWarning}:t.statusDetail==="active_cancel_pending"?{label:s("settings.license.active","Active"),tooltip:s("settings.license.status.activeCancelPending.tooltip","Cancellation is pending, but Pro access remains active until the current billing period ends."),detail:s("settings.license.detail.cancelPending","Cancellation is scheduled. Pro access remains active until the current billing period ends."),detailTone:n.licenseNoticeInfo}:t.statusDetail==="grace_provider_unavailable"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.grace.tooltip","Provider verification is temporarily unavailable, but Pro access remains active during the grace period."),detail:s("settings.license.detail.graceProviderUnavailable","Provider unavailable. Pro access remains active during grace mode."),detailTone:n.licenseNoticeInfo}:t.statusDetail==="grace_expired"||t.statusDetail==="grace_payment_failed"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.graceBilling.tooltip","Pro access is still available during a billing-related grace period."),detail:s("settings.license.detail.graceBilling","Pro access remains available during a billing grace period."),detailTone:n.licenseNoticeInfo}:{label:s(`settings.license.${t.status}`,t.status),tooltip:s(`settings.license.${t.status}.tooltip`,"Current license activation state."),detail:t.refreshRequired?s("settings.license.detail.refreshRecommended","License verification should be refreshed soon."):null,detailTone:n.licenseNoticeMuted}}function Dt(){const{t,selectedLocale:s,setLocale:c}=te(),{trackEvent:u}=re(),{search:i}=ye(),{settings:C,license:a,licenseControlsDisabled:j,licenseSubmitting:h,licenseMessage:w,activateLicense:N,refreshLicense:L,resetLicense:P,loading:D}=Se(),[f,x]=l.useState(""),E=a?kt(a,t):null,_=_t(a),y=_&&(a==null?void 0:a.refreshBlockedReason)!=="missing_session_token",H=_,S=_?a==null?void 0:a.maskedKey:void 0,B=a!=null&&a.provider&&a.provider!=="auto"?a.provider:void 0,M=(a==null?void 0:a.tier)==="pro"?"pro":"basic",b=l.useRef(null),m=l.useRef(null),$=l.useMemo(()=>new URLSearchParams(i).get("section")==="license",[i]);return l.useEffect(()=>{var A;if(!$||D)return;const r=b.current;if((A=r==null?void 0:r.scrollIntoView)==null||A.call(r,{block:"start",behavior:"smooth"}),m.current&&!m.current.disabled){m.current.focus();return}r==null||r.focus()},[D,j,h,$]),D?e.jsx("div",{className:n.page,children:e.jsx("div",{className:n.loading,children:t("common.loading")})}):e.jsxs("div",{className:n.page,children:[e.jsx(ve,{title:t("page.settings.title","Settings"),description:t("page.settings.description","Manage license, saved data, server environment, and language."),helpTopicId:"settings",helpState:{tier:M}}),e.jsxs("div",{id:"settings-license",ref:b,tabIndex:-1,"data-testid":"settings-license-card",className:[n.card,$?n.licenseCardTarget:"",(a==null?void 0:a.tier)==="pro"?n.licenseCardPro:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:n.cardHeader,children:[e.jsx(k,{label:t("settings.license.title","License"),tooltip:t("settings.license.title.tooltip","Current license status and subscription tier.")}),e.jsx(g,{text:j?t("settings.license.disconnected.tooltip","Reconnect to the MCP server to manage license actions from WEPPY Dashboard."):t("settings.license.live.tooltip","License actions are sent to the MCP server immediately."),children:e.jsx("span",{className:`${n.headerBadge} ${j?"":n.headerBadgeLive}`,children:j?t("settings.license.disconnected","Disconnected"):t("settings.general.liveApply","Live Apply")})})]}),e.jsxs(e.Fragment,{children:[a?e.jsxs(e.Fragment,{children:[(()=>{const r=E;return e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:n.licenseGrid,children:[e.jsx("dt",{children:e.jsx(k,{label:t("settings.license.status","Status"),tooltip:t("settings.license.status.tooltip","Current license activation state.")})}),e.jsxs("dd",{children:[e.jsx("span",{className:`${n.statusDot} ${Nt(a.status)}`}),e.jsx(g,{text:(r==null?void 0:r.tooltip)??t(`settings.license.${a.status}.tooltip`,"Current license activation state."),children:(r==null?void 0:r.label)??t(`settings.license.${a.status}`,a.status)})]}),e.jsx("dt",{children:e.jsx(k,{label:t("settings.license.tier","Tier"),tooltip:t("settings.license.tier.tooltip","Current subscription tier for available WEPPY Dashboard features.")})}),e.jsx("dd",{className:a.tier==="pro"?n.proBadge:"",children:e.jsx(g,{text:t(`tier.${a.tier}.tooltip`,"Available feature set for the connected license."),children:a.tier==="pro"?t("tier.pro","Pro"):t("tier.basic","Basic")})}),S&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(k,{label:t("settings.license.key","Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("dd",{children:e.jsx(g,{text:t("settings.license.keyValue.tooltip","Masked license key currently loaded by the server."),children:S})})]}),B&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(k,{label:t("settings.license.provider","Provider"),tooltip:t("settings.license.provider.tooltip","License provider used to validate this key.")})}),e.jsx("dd",{children:e.jsx(g,{text:t("settings.license.providerValue.tooltip","License provider used to validate this key."),children:B})})]})]}),(r==null?void 0:r.detail)&&e.jsx("p",{className:`${n.licenseNotice} ${r.detailTone}`,children:a.refreshBlockedReason==="missing_session_token"?t("settings.license.detail.manualActivation","Manual activation required to restore Pro access."):r.detail}),a.refreshBlockedReason==="missing_session_token"&&e.jsx("p",{className:`${n.licenseNotice} ${n.licenseNoticeMuted}`,children:r==null?void 0:r.detail})]})})(),a.tier==="basic"&&e.jsx(g,{text:t("tier.upgrade.tooltip","View Pro features and purchase options."),children:e.jsx("a",{className:n.upgradeLink,href:je.settingsLicense,target:"_blank",rel:"noopener noreferrer",onClick:()=>u("dashboard_click_event",{click_target:"upgrade_cta",placement:"settings_license",page:"settings"}),children:t("tier.upgrade","View Pro")})})]}):e.jsx("div",{className:n.loading,children:t("settings.license.unavailable")}),e.jsxs("div",{className:n.licenseControls,children:[e.jsxs("div",{className:n.licenseControlRow,children:[e.jsx(g,{text:t("settings.license.refresh.tooltip","Re-fetch the current state from the license server. Useful when a billing change hasn't appeared yet."),children:e.jsx("button",{type:"button",className:n.actionBtn,disabled:j||h||!y,onClick:()=>{L()},children:h?t("common.loading"):t("settings.license.refresh","Refresh License")})}),e.jsx(g,{text:t("settings.license.reset.tooltip","Remove the currently registered license key. Use this before activating with a different key."),children:e.jsx("button",{type:"button",className:n.actionBtn,disabled:j||h||!H,onClick:()=>{P()},children:h?t("common.loading"):t("settings.license.reset","Reset License")})})]}),e.jsxs("div",{className:n.licenseControlRow,children:[e.jsxs("label",{className:`${n.licenseField} ${n.licenseFieldGrow}`,children:[e.jsx("span",{className:n.controlLabel,children:e.jsx(k,{label:t("settings.license.keyInput","License Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("input",{ref:m,"aria-label":t("settings.license.keyInput","License Key"),className:n.textInput,type:"text",value:f,disabled:j||h,onChange:r=>x(r.target.value)})]}),e.jsx(g,{text:t("settings.license.activate.tooltip","Activate Pro features with the entered license key."),children:e.jsx("button",{type:"button",className:n.actionBtn,disabled:j||h,onClick:()=>{(async()=>await N(f)&&x(""))()},children:h?t("common.loading"):t("settings.license.activate","Activate License")})})]}),w&&e.jsx("p",{className:n.licenseMessage,children:w})]})]})]}),e.jsx(bt,{tier:M}),e.jsxs("div",{className:n.card,children:[e.jsxs("div",{className:n.cardHeader,children:[e.jsx(k,{label:t("settings.cold.title","Server Environment"),tooltip:t("settings.cold.title.tooltip","Read-only server environment values loaded at startup.")}),e.jsx(g,{text:t("settings.readOnly.tooltip","This section shows values that cannot be edited from WEPPY Dashboard."),children:e.jsx("span",{className:n.headerBadge,children:t("settings.readOnly","Read-only")})})]}),C?e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:n.coldGrid,children:[e.jsx("dt",{children:e.jsx(k,{label:"HTTP_PORT",tooltip:t("settings.cold.httpPort.tooltip","Port number used by the MCP WEPPY Dashboard HTTP server.")})}),e.jsx("dd",{children:C.cold.HTTP_PORT}),e.jsx("dt",{children:e.jsx(k,{label:"HTTP_HOST",tooltip:t("settings.cold.httpHost.tooltip","Host interface that the MCP WEPPY Dashboard HTTP server binds to.")})}),e.jsx("dd",{children:C.cold.HTTP_HOST}),e.jsx("dt",{children:e.jsx(k,{label:"DASHBOARD_AUTO_OPEN",tooltip:t("settings.cold.dashboardAutoOpen.tooltip","Controls whether WEPPY Dashboard opens automatically in the browser when the server starts.")})}),e.jsx("dd",{children:e.jsx(g,{text:t("settings.cold.dashboardAutoOpen.value.tooltip","Current startup behavior for opening WEPPY Dashboard in a browser."),children:String(C.cold.DASHBOARD_AUTO_OPEN)})})]}),e.jsx("p",{className:n.coldHint,children:t("settings.cold.hint","Set via environment variables to change these values.")})]}):e.jsx("div",{className:n.loading,children:t("settings.unavailable")})]}),e.jsxs("div",{className:n.card,children:[e.jsx("div",{className:n.cardHeader,children:e.jsx(k,{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:n.langRow,children:[e.jsx("label",{children:e.jsx(k,{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(g,{text:t("settings.language.auto.tooltip","Follow the operating system's language. Falls back to English when not supported."),children:e.jsxs("select",{className:n.select,value:s,onChange:r=>c(r.target.value),children:[e.jsx("option",{value:fe,children:t("settings.language.auto","Auto")}),xe.map(r=>e.jsx("option",{value:r,children:Ct[r]??r},r))]})})]})]})]})}export{Dt as Component};
|
|
1
|
+
import{u as te,e as re,r as l,j as e,a as T,g as me,d as ye,T as je,A as fe,S as xe}from"./index-CahJTtjv.js";import{P as ve}from"./PageHeader-CKFvQ2T_.js";import{I as k}from"./InfoLabel-mGrfFfvs.js";import{T as g}from"./TooltipText-Vj0LEsyy.js";import{s as n,u as Se}from"./useSettings-CZEc0yGK.js";import{C as ce}from"./ConfirmModal-reOnA0XQ.js";import{D as de,f as ue,r as be,s as Ce,a as pe,d as se,S as ae,b as Ne}from"./sample-requests-C1hU0rd2.js";import{C as _e}from"./UiPrimitive-tKQal2XA.js";import"./ConfirmModal.module-DJksQHBd.js";const ke="_card_1ende_4",Le="_cardEmbedded_1ende_14",Pe="_cardTitle_1ende_21",Re="_storageConsoleGrid_1ende_30",we="_storageUsageColumn_1ende_37",He="_storagePolicyColumn_1ende_38",Be="_usageRow_1ende_43",Ae="_usageTotal_1ende_49",Me="_usageBreakdown_1ende_56",$e="_usageCounts_1ende_62",De="_storageFooter_1ende_69",Ee="_lastRunRow_1ende_78",Te="_lastRunLabel_1ende_88",Ue="_errorIcon_1ende_94",Ie="_tooltip_1ende_102",ze="_cleanupRow_1ende_125",Fe="_cleanupLabel_1ende_132",Oe="_cleanupBtn_1ende_139",Ge="_cleanupBtnDanger_1ende_168",qe="_retentionSection_1ende_181",We="_retentionTitle_1ende_187",Ye="_retentionFieldset_1ende_194",Ke="_proOverlay_1ende_209",Ve="_modeSegments_1ende_221",Je="_radioLabel_1ende_242",Qe="_radioLabelActive_1ende_263",Ze="_presetGroup_1ende_277",Xe="_presetBtn_1ende_285",et="_presetBtnActive_1ende_308",tt="_freeInput_1ende_315",st="_inputError_1ende_332",at="_inputUnit_1ende_336",nt="_cascadeRow_1ende_343",it="_retentionActions_1ende_359",ot="_saveBtn_1ende_365",lt="_runNowBtn_1ende_393",rt="_errorMsg_1ende_437",ct="_freeInputHitArea_1ende_499",o={card:ke,cardEmbedded:Le,cardTitle:Pe,storageConsoleGrid:Re,storageUsageColumn:we,storagePolicyColumn:He,usageRow:Be,usageTotal:Ae,usageBreakdown:Me,usageCounts:$e,storageFooter:De,lastRunRow:Ee,lastRunLabel:Te,errorIcon:Ue,tooltip:Ie,cleanupRow:ze,cleanupLabel:Fe,cleanupBtn:Oe,cleanupBtnDanger:Ge,retentionSection:qe,retentionTitle:We,retentionFieldset:Ye,proOverlay:Ke,modeSegments:Ve,radioLabel:Je,radioLabelActive:Qe,presetGroup:Ze,presetBtn:Xe,presetBtnActive:et,freeInput:tt,inputError:st,inputUnit:at,cascadeRow:nt,retentionActions:it,saveBtn:ot,runNowBtn:lt,errorMsg:rt,freeInputHitArea:ct};function dt(t,s){return!!(t.mode==="off"&&s.mode!=="off"||t.mode==="age"&&s.mode==="age"&&(s.ageDays??0)<(t.ageDays??0)||t.mode==="size"&&s.mode==="size"&&(s.sizeMb??0)<(t.sizeMb??0)||!t.cascadeSnapshots&&s.cascadeSnapshots)}function ne(t){return t.mode==="age"?Number.isInteger(t.ageDays)&&t.ageDays>=1&&t.ageDays<=365:t.mode==="size"?Number.isInteger(t.sizeMb)&&t.sizeMb>=50&&t.sizeMb<=1e4:!0}function ut(t,s){return t.mode===s.mode&&t.ageDays===s.ageDays&&t.sizeMb===s.sizeMb&&t.cascadeSnapshots===s.cascadeSnapshots}function q(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(2)} GB`}function pt({placeId:t,tier:s,currentPolicy:c,onSaved:u}){const{t:i}=te(),{trackEvent:C}=re(),[a,j]=l.useState(c),[h,w]=l.useState(()=>[7,14,30,90].includes(c.ageDays??-1)?"":String(c.ageDays??30)),[N,L]=l.useState(()=>[100,500,1e3].includes(c.sizeMb??-1)?"":String(c.sizeMb??500)),[P,D]=l.useState(null),[f,x]=l.useState(!1),[E,_]=l.useState(!1),[y,H]=l.useState(!1),[S,B]=l.useState(null);l.useEffect(()=>{j(c);const p=[7,14,30,90],R=[100,500,1e3];w(p.includes(c.ageDays??-1)?"":String(c.ageDays??30)),L(R.includes(c.sizeMb??-1)?"":String(c.sizeMb??500))},[c]);const M=s==="basic",b=ne(a),m=ut(c,a),$=b&&!m&&!E,r=p=>{j(R=>{const U={...R,mode:p};return p==="age"&&(U.ageDays=parseInt(h,10)||30),p==="size"&&(U.sizeMb=parseInt(N,10)||500),U})},A=p=>{w(""),j(R=>({...R,ageDays:p}))},W=p=>{L(""),j(R=>({...R,sizeMb:p}))},Z=p=>{w(p);const R=parseInt(p,10);Number.isNaN(R)||j(U=>({...U,ageDays:R}))},F=p=>{L(p);const R=parseInt(p,10);Number.isNaN(R)||j(U=>({...U,sizeMb:R}))},O=async()=>{if(B(null),C("dashboard_click_event",{click_target:"ui_studio_cleanup_save",page:"settings"}),dt(c,a)){try{const p=await ue(t,{mode:a.mode,ageDays:a.ageDays,sizeMb:a.sizeMb,cascadeSnapshots:a.cascadeSnapshots});D(p.dryRun),x(!0)}catch(p){B(p.message)}return}await G()},G=async()=>{_(!0);try{await Ce(t,a),x(!1),u()}catch(p){throw B(p.message),p}finally{_(!1)}},d=async()=>{B(null),C("dashboard_click_event",{click_target:"ui_studio_cleanup_run_now",page:"settings"}),H(!0);try{await be(t),u()}catch(p){B(p.message)}finally{H(!1)}},v=P?`${i("uiStudio.cleanup.policy.confirm.messageStrict","이 정책으로 즉시")} ${P.wouldRemoveRequests}${i("uiStudio.cleanup.policy.confirm.requests","건")} / ${P.wouldRemoveSnapshots}${i("uiStudio.cleanup.policy.confirm.snapshots","개 화면 캡처")} / ${q(P.wouldFreeBytes)} ${i("uiStudio.cleanup.policy.confirm.freed","가 삭제됩니다 — 적용?")}`:"",Y=a.mode==="age"&&!ne(a),z=a.mode==="size"&&!ne(a);return e.jsxs("div",{className:o.retentionSection,children:[e.jsx("h3",{className:o.retentionTitle,children:e.jsx(k,{label:i("uiStudio.cleanup.policy.title","자동 삭제 정책"),tooltip:i("uiStudio.cleanup.policy.title.tooltip","Rules that automatically remove old or large captures.")})}),e.jsxs("div",{style:{position:"relative"},children:[M&&e.jsx("div",{className:o.proOverlay,title:i("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능"),children:e.jsx("div",{className:o.tooltip,children:i("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능")})}),e.jsxs("fieldset",{className:o.retentionFieldset,disabled:M,"aria-label":i("uiStudio.cleanup.policy.title","자동 삭제 정책"),style:M?{opacity:.45,pointerEvents:"none"}:void 0,children:[e.jsxs("div",{className:o.modeSegments,"data-testid":"cleanup-mode-segments",children:[e.jsx(g,{text:i("uiStudio.cleanup.policy.modeOff.tooltip","Turn off auto-cleanup. Data stays until you remove it manually."),children:e.jsxs("label",{className:`${o.radioLabel} ${a.mode==="off"?o.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"off",checked:a.mode==="off",onChange:()=>r("off")}),i("uiStudio.cleanup.policy.modeOff","사용 안 함 (off)")]})}),e.jsx(g,{text:i("uiStudio.cleanup.policy.modeAge.tooltip","Automatically delete data older than the configured number of days."),children:e.jsxs("label",{className:`${o.radioLabel} ${a.mode==="age"?o.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"age",checked:a.mode==="age",onChange:()=>r("age")}),i("uiStudio.cleanup.policy.modeAge","기간 기반 (age)")]})}),e.jsx(g,{text:i("uiStudio.cleanup.policy.modeSize.tooltip","When total usage exceeds the limit, the oldest data is removed first."),children:e.jsxs("label",{className:`${o.radioLabel} ${a.mode==="size"?o.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"size",checked:a.mode==="size",onChange:()=>r("size")}),i("uiStudio.cleanup.policy.modeSize","용량 기반 (size)")]})})]}),a.mode==="age"&&e.jsxs("div",{className:o.presetGroup,children:[[7,14,30,90].map(p=>e.jsx(g,{text:i("uiStudio.cleanup.policy.agePreset.tooltip","Delete data older than this many days."),children:e.jsxs("button",{type:"button",className:`${o.presetBtn} ${a.ageDays===p&&h===""?o.presetBtnActive:""}`,onClick:()=>A(p),children:[p,i("uiStudio.cleanup.policy.daysUnit","일")]})},p)),e.jsx(g,{text:i("uiStudio.cleanup.policy.ageInput.tooltip","Enter any value between 1 and 365 days."),children:e.jsx("label",{className:o.freeInputHitArea,children:e.jsx("input",{type:"number",className:`${o.freeInput} ${Y?o.inputError:""}`,value:h,min:1,max:365,onChange:p=>Z(p.target.value)})})}),e.jsxs("span",{className:o.inputUnit,children:["1–365",i("uiStudio.cleanup.policy.daysUnit","일")]})]}),a.mode==="size"&&e.jsxs("div",{className:o.presetGroup,children:[[100,500,1e3].map(p=>e.jsx(g,{text:i("uiStudio.cleanup.policy.sizePreset.tooltip","Keep total usage under this size."),children:e.jsxs("button",{type:"button",className:`${o.presetBtn} ${a.sizeMb===p&&N===""?o.presetBtnActive:""}`,onClick:()=>W(p),children:[p,i("uiStudio.cleanup.policy.mbUnit","MB")]})},p)),e.jsx(g,{text:i("uiStudio.cleanup.policy.sizeInput.tooltip","Enter any value between 50 MB and 10000 MB (10 GB)."),children:e.jsx("label",{className:o.freeInputHitArea,children:e.jsx("input",{type:"number",className:`${o.freeInput} ${z?o.inputError:""}`,value:N,min:50,max:1e4,onChange:p=>F(p.target.value)})})}),e.jsxs("span",{className:o.inputUnit,children:["50–10000",i("uiStudio.cleanup.policy.mbUnit","MB")]})]}),e.jsx(g,{text:i("uiStudio.cleanup.policy.cascade.tooltip","Also delete the capture images linked to those records. If off, the images stay."),children:e.jsxs("label",{className:o.cascadeRow,children:[e.jsx(_e,{checked:a.cascadeSnapshots,onChange:p=>j(R=>({...R,cascadeSnapshots:p.target.checked}))}),i("uiStudio.cleanup.policy.cascade","연결된 화면 캡처도 함께 삭제")]})}),e.jsxs("div",{className:o.retentionActions,children:[e.jsx(g,{text:i("uiStudio.cleanup.policy.save.tooltip","Save the current cleanup rule. It runs in the background from then on."),children:e.jsx("button",{type:"button",className:o.saveBtn,onClick:()=>void O(),disabled:!$,children:i("uiStudio.cleanup.policy.save","정책 저장")})}),e.jsx(g,{text:i("uiStudio.cleanup.policy.runNow.tooltip","저장된 정리 정책을 다음 자동 실행까지 기다리지 않고 지금 한 번 실행합니다."),children:e.jsx("button",{type:"button",className:o.runNowBtn,onClick:()=>void d(),disabled:y,children:i("uiStudio.cleanup.policy.runNow","저장된 정책으로 정리")})})]}),S&&e.jsx("div",{className:o.errorMsg,children:S})]})]}),f&&P&&e.jsx(de,{title:i("uiStudio.cleanup.policy.confirm.title","정책 적용 확인"),message:v,danger:!0,confirmLabel:i("uiStudio.cleanup.policy.save","정책 저장"),busy:E,onConfirm:G,onClose:()=>x(!1)})]})}function gt({placeId:t,tier:s,onChanged:c,sampleUsage:u,sampleRetention:i,embedded:C=!1}){const{t:a}=te(),j=s==="basic"&&u!=null&&i!=null,[h,w]=l.useState(j?u:null),[N,L]=l.useState(j?i:null),[P,D]=l.useState(null),[f,x]=l.useState(null),[E,_]=l.useState(null),y=l.useCallback(async()=>{if(!j&&t!=null){D(null);try{const[r,A]=await Promise.all([pe(t),ue(t)]);w(r),L(A.policy)}catch(r){D(r.message)}}},[t,j]);l.useEffect(()=>{y()},[y]);const H=l.useCallback(()=>{y(),c==null||c()},[y,c]),S=l.useCallback(async()=>{if(f&&t!=null){_(null);try{f.kind==="keep7"?await se(t,{olderThanDays:7,alsoSnapshots:!0}):f.kind==="keep30"?await se(t,{olderThanDays:30,alsoSnapshots:!0}):await se(t,{all:!0,alsoSnapshots:!0}),x(null),y(),c==null||c()}catch(r){throw _(r.message),r}}},[f,t,y,c]);function B(r){const A=a("uiStudio.cleanup.studioPreservedNote","This deletes saved change records and screenshots on disk only; Roblox Studio instances are not affected.");return r.kind==="keep7"?`${a("uiStudio.cleanup.cleanupConfirmMessage.keep7","7일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${A}`:r.kind==="keep30"?`${a("uiStudio.cleanup.cleanupConfirmMessage.keep30","30일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${A}`:`${((h==null?void 0:h.requestCount)??0)+((h==null?void 0:h.snapshotCount)??0)}${a("uiStudio.cleanup.cleanupConfirmMessage.all","개의 저장된 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${A}`}if(t==null&&!j)return null;if(P)return e.jsx("div",{className:`${o.card} ${C?o.cardEmbedded:""}`,children:e.jsx("p",{className:o.errorMsg,children:P})});if(!h||!N)return e.jsx("div",{className:`${o.card} ${C?o.cardEmbedded:""}`,children:e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",margin:0},children:a("uiStudio.storage.loading","로딩 중...")})});const M=N.lastRunAt,b=N.lastRunStats,m=M?new Date(M).toLocaleString():null,$=t??0;return e.jsxs("div",{className:`${o.card} ${C?o.cardEmbedded:""}`,children:[!C&&e.jsx("h3",{className:o.cardTitle,children:e.jsx(k,{label:a("uiStudio.storage.title","UI Studio 저장 데이터"),tooltip:a("uiStudio.storage.title.tooltip","Disk usage of UI Studio change records and screenshots.")})}),e.jsxs("div",{className:o.storageConsoleGrid,"data-testid":"ui-studio-storage-console-grid",children:[e.jsx("section",{className:o.storageUsageColumn,children:e.jsxs("div",{className:o.usageRow,children:[e.jsx(g,{text:a("uiStudio.storage.usageLabel.tooltip","Disk space currently used by UI Studio for this project."),children:e.jsxs("div",{className:o.usageTotal,children:[a("uiStudio.storage.usageLabel","사용 중")," ",q(h.totalBytes)]})}),e.jsxs("div",{className:o.usageBreakdown,children:[e.jsx(g,{text:a("uiStudio.storage.historyBytes.tooltip","Space taken by change record data (JSON)."),children:e.jsxs("span",{children:[a("uiStudio.storage.historyBytes","변경 이력")," ",q(h.historyBytes)]})})," · ",e.jsx(g,{text:a("uiStudio.storage.snapshotBytes.tooltip","Space taken by captured PNG image files."),children:e.jsxs("span",{children:[a("uiStudio.storage.snapshotBytes","화면 캡처")," ",q(h.snapshotBytes)]})})]}),e.jsxs("div",{className:o.usageCounts,children:[e.jsx(g,{text:a("uiStudio.storage.requestCount.tooltip","Number of actions where AI changed the UI."),children:e.jsxs("span",{children:[a("uiStudio.storage.requestCount","변경 기록")," ",h.requestCount.toLocaleString(),a("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(g,{text:a("uiStudio.storage.mutationCount.tooltip","Number of detail changes inside actions (one property edit = 1)."),children:e.jsxs("span",{children:[a("uiStudio.storage.mutationCount","변경 상세")," ",h.mutationCount.toLocaleString(),a("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(g,{text:a("uiStudio.storage.snapshotCount.tooltip","Number of saved capture image files."),children:e.jsxs("span",{children:[a("uiStudio.storage.snapshotCount","화면 캡처")," ",h.snapshotCount.toLocaleString(),a("uiStudio.storage.countSuffix","개")]})})]})]})}),e.jsx("section",{className:o.storagePolicyColumn,children:e.jsx(pt,{placeId:$,tier:s,currentPolicy:N,onSaved:H})})]}),e.jsxs("div",{className:o.storageFooter,"data-testid":"ui-studio-storage-footer",children:[e.jsxs("div",{className:o.lastRunRow,children:[e.jsx("span",{className:o.lastRunLabel,children:e.jsx(k,{label:a("uiStudio.storage.lastRun","마지막 자동 정리"),tooltip:a("uiStudio.storage.lastRun.tooltip","When the auto-cleanup policy last ran, and what it removed.")})}),m?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:m}),b&&e.jsxs("span",{children:["· ",a("uiStudio.storage.requestCount","변경 기록")," ",b.removedRequests,a("uiStudio.storage.countSuffix","개")," / ",a("uiStudio.storage.snapshotCount","화면 캡처")," ",b.removedSnapshots,a("uiStudio.storage.countSuffix","개")," / ",q(b.freedBytes)," ",a("uiStudio.storage.lastRunFreed","회수")]}),b&&b.errors>0&&e.jsxs("span",{className:o.errorIcon,title:`${a("uiStudio.storage.lastRunErrors","오류")} ${b.errors}건`,children:["⚠",e.jsxs("span",{className:o.tooltip,children:[a("uiStudio.storage.lastRunErrors","오류")," ",b.errors,a("uiStudio.storage.countSuffix","건")]})]})]}):e.jsx("span",{children:a("uiStudio.storage.lastRunNever","—")})]}),e.jsxs("div",{className:o.cleanupRow,children:[e.jsx("span",{className:o.cleanupLabel,children:e.jsx(k,{label:a("uiStudio.cleanup.label","수동 정리"),tooltip:a("uiStudio.cleanup.label.tooltip","Manually clean up change records and captures whenever you want.")})}),e.jsx(g,{text:a("uiStudio.cleanup.keep7.tooltip","Delete change records and captures older than 7 days."),children:e.jsx("button",{type:"button",className:o.cleanupBtn,onClick:()=>x({kind:"keep7"}),disabled:s==="basic",children:a("uiStudio.cleanup.keepLastNDays","최근 7일만 남기기").replace("{n}","7")})}),e.jsx(g,{text:a("uiStudio.cleanup.keep30.tooltip","Delete change records and captures older than 30 days."),children:e.jsx("button",{type:"button",className:o.cleanupBtn,onClick:()=>x({kind:"keep30"}),disabled:s==="basic",children:a("uiStudio.cleanup.keepLastNDays","최근 30일만 남기기").replace("{n}","30")})}),!C&&e.jsx(g,{text:a("uiStudio.cleanup.deleteAll.tooltip","Delete every change record and capture for this project. The actual UI in Roblox Studio is not affected."),children:e.jsx("button",{type:"button",className:`${o.cleanupBtn} ${o.cleanupBtnDanger}`,onClick:()=>x({kind:"all"}),disabled:s==="basic",children:a("uiStudio.cleanup.deleteAll","전체 삭제…")})})]})]}),E&&e.jsx("div",{className:o.errorMsg,children:E}),f&&e.jsx(de,{title:a("uiStudio.cleanup.cleanupConfirmTitle","정리 확인"),message:B(f),danger:!0,confirmLabel:a("common.delete","삭제"),onConfirm:S,onClose:()=>{x(null),_(null)}})]})}function ie(t,s){const c={placeId:String(t)};return s&&(c["preview.mode"]=s.mode,s.mode==="size"&&(c["preview.sizeMb"]=String(s.sizeMb))),T.get("/api/dashboard/changelog/cleanup",c)}function oe(t){return T.put("/api/dashboard/changelog/cleanup",t)}function ht(t){return T.post(`/api/dashboard/changelog/cleanup/run?placeId=${encodeURIComponent(t)}`)}const mt=[100,500,1e3];function le(t,s){return t.mode!==s.mode?!1:t.mode==="off"||s.mode==="size"&&t.sizeMb===s.sizeMb}function yt(t,s){return t.mode==="off"?!1:s.mode==="off"||t.sizeMb<s.sizeMb}function V(t){return t<1e3?`${t} B`:t<1e6?`${(t/1e3).toFixed(1)} KB`:t<1e9?`${(t/1e6).toFixed(1)} MB`:`${(t/1e9).toFixed(2)} GB`}function jt({placeId:t,onChanged:s}){const{locale:c,t:u}=te(),[i,C]=l.useState(null),[a,j]=l.useState({mode:"size",sizeMb:500}),[h,w]=l.useState(t!==null),[N,L]=l.useState(!1),[P,D]=l.useState(!1),[f,x]=l.useState(!1),[E,_]=l.useState(!1),[y,H]=l.useState(null),S=l.useCallback(async()=>{if(t===null){C(null),w(!1);return}D(!1);try{const d=await ie(t);C(d),j(d.policy)}catch{D(!0)}finally{w(!1)}},[t]);l.useEffect(()=>{w(t!==null),S()},[S,t]);const B=l.useCallback(async d=>{L(!0),x(!1),_(!1);try{await oe(d),H(null),await S(),_(!0),s==null||s()}catch{x(!0)}finally{L(!1)}},[S,s]),M=l.useCallback(async()=>{if(!(!i||t===null||le(a,i.policy))){L(!0),x(!1),_(!1);try{if(yt(a,i.policy)){const d=await ie(t,a);if(d.preview.affectedPlaceCount>0){H({policy:a,preview:d});return}}await oe(a),await S(),_(!0),s==null||s()}catch{x(!0)}finally{L(!1)}}},[i,a,S,s,t]),b=l.useCallback(async()=>{if(t!==null){L(!0),x(!1),_(!1);try{await ht(t),await S(),s==null||s()}catch{x(!0)}finally{L(!1)}}},[S,s,t]),m=i==null?void 0:i.selectedPlace.currentUsage,$=(i==null?void 0:i.policy.mode)==="size"?i.policy.sizeMb*1e6:null,r=$??Math.max((m==null?void 0:m.bytes)??0,1),A=Math.min(100,((m==null?void 0:m.sessionBytes)??0)/r*100),W=Math.min(Math.max(0,100-A),((m==null?void 0:m.contextBytes)??0)/r*100),Z=i?!le(a,i.policy):!1,F=d=>d.mode==="off"?u("settings.projectChanges.cleanup.unlimited","Unlimited"):`${d.sizeMb} MB`,O=l.useMemo(()=>{if(!y)return"";const d=y.preview.preview,v=u("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}",V(d.estimatedFreedBytes));return d.wouldRemainOverLimitPlaceCount===0?v:`${v} ${u("settings.projectChanges.cleanup.confirm.protected","{places} Place may remain over the limit because active data is protected.").replace("{places}",d.wouldRemainOverLimitPlaceCount.toLocaleString())}`},[y,u]);if(t===null)return e.jsx("div",{className:n.projectChangesPanel,children:e.jsx("p",{className:n.projectChangesEmpty,children:u("settings.projectChanges.cleanup.noPlace","Select a Place to manage saved project changes.")})});if(h)return e.jsx("div",{className:n.projectChangesPanel,children:e.jsx("p",{className:n.projectChangesEmpty,children:u("settings.projectChanges.cleanup.loading","Loading storage settings…")})});if(P||!i||!m)return e.jsxs("div",{className:n.projectChangesPanel,children:[e.jsx("p",{className:n.projectChangesError,role:"alert",children:u("settings.projectChanges.cleanup.loadFailed","Could not load storage settings.")}),e.jsx("button",{className:n.projectChangesSecondaryButton,type:"button",onClick:()=>{w(!0),S()},children:u("common.retry","Retry")})]});const G=$===null?u("settings.projectChanges.cleanup.usageUnlimited","{used} used · Unlimited").replace("{used}",V(m.bytes)):u("settings.projectChanges.cleanup.usageLimited","{used} used of {limit}").replace("{used}",V(m.bytes)).replace("{limit}",F(i.policy));return e.jsxs("div",{className:n.projectChangesPanel,children:[e.jsxs("div",{className:n.projectChangesConsoleGrid,"data-testid":"project-storage-console-grid",children:[e.jsxs("section",{className:n.projectChangesUsageColumn,children:[e.jsx("h3",{className:n.projectChangesPanelTitle,children:e.jsx(k,{label:u("settings.projectChanges.cleanup.title","Storage management"),tooltip:u("settings.projectChanges.cleanup.title.tooltip","Set how much Project Change Summary history each Place can keep.")})}),e.jsxs("div",{className:n.projectChangesUsageBlock,children:[e.jsx("div",{className:n.projectChangesUsageSummary,children:G}),e.jsxs("div",{className:n.projectChangesQuotaRail,role:"meter","aria-label":u("settings.projectChanges.cleanup.usageAria","Place storage usage"),"aria-valuemin":0,"aria-valuenow":m.bytes,"aria-valuemax":$??m.bytes,children:[e.jsx("span",{className:n.projectChangesSessionRail,style:{width:`${A}%`}}),e.jsx("span",{className:n.projectChangesContextRail,style:{width:`${W}%`}})]}),e.jsxs("div",{className:n.projectChangesUsageLegend,children:[e.jsxs("span",{children:[u("settings.projectChanges.cleanup.sessions","Sessions")," ",e.jsx("strong",{children:V(m.sessionBytes)})]}),e.jsxs("span",{children:[u("settings.projectChanges.cleanup.contexts","Contexts")," ",e.jsx("strong",{children:V(m.contextBytes)})]})]})]})]}),e.jsxs("section",{className:n.projectChangesPolicyColumn,children:[e.jsx("p",{className:n.projectChangesScope,children:u("settings.projectChanges.cleanup.scope","One setting applies the selected limit separately to every Place.")}),e.jsxs("fieldset",{className:n.projectChangesPolicyFieldset,disabled:N,children:[e.jsx("legend",{className:n.projectChangesPolicyLegend,children:u("settings.projectChanges.cleanup.limit","Limit per Place")}),e.jsxs("div",{className:n.projectChangesPresetGroup,children:[mt.map(d=>{const v=a.mode==="size"&&a.sizeMb===d;return e.jsx("button",{className:`${n.projectChangesPresetButton} ${v?n.projectChangesPresetButtonActive:""}`,type:"button","aria-pressed":v,onClick:()=>j({mode:"size",sizeMb:d}),children:u("settings.projectChanges.cleanup.preset","{sizeMb}MB").replace("{sizeMb}",String(d))},d)}),e.jsx("button",{className:`${n.projectChangesPresetButton} ${a.mode==="off"?n.projectChangesPresetButtonActive:""}`,type:"button","aria-pressed":a.mode==="off",onClick:()=>j({mode:"off"}),children:u("settings.projectChanges.cleanup.unlimited","Unlimited")})]})]}),e.jsxs("div",{className:n.projectChangesActions,children:[e.jsx("button",{className:n.projectChangesSaveButton,type:"button",disabled:!Z||N,onClick:()=>void M(),children:u("common.save","Save")}),e.jsx("button",{className:n.projectChangesSecondaryButton,type:"button",disabled:N,onClick:()=>void b(),children:u("settings.projectChanges.cleanup.runNow","Run saved policy")}),E&&e.jsx("span",{className:n.projectChangesSaved,role:"status",children:u("settings.projectChanges.cleanup.saved","Saved")})]})]})]}),i.selectedPlace.dryRun.wouldRemainOverLimit&&e.jsx("p",{className:n.projectChangesWarning,children:u("settings.projectChanges.cleanup.protectedWarning","Active changes are protected, so this Place may stay over the limit.")}),e.jsxs("div",{className:n.projectChangesLastRun,"data-testid":"project-storage-footer",children:[e.jsx("span",{className:n.projectChangesLastRunLabel,children:u("settings.projectChanges.cleanup.lastRun","Last cleanup")}),i.selectedPlace.lastRun?e.jsxs("span",{children:[new Date(i.selectedPlace.lastRun.ranAt).toLocaleString(c)," · ",u("settings.projectChanges.cleanup.lastRunSummary","{sessions} sessions · {bytes} freed").replace("{sessions}",i.selectedPlace.lastRun.deletedSessionCount.toLocaleString()).replace("{bytes}",V(i.selectedPlace.lastRun.freedBytes))]}):e.jsx("span",{children:u("settings.projectChanges.cleanup.neverRun","Not run yet")})]}),f&&e.jsx("p",{className:n.projectChangesError,role:"alert",children:u("settings.projectChanges.cleanup.actionFailed","Could not update storage settings.")}),e.jsx(ce,{open:y!==null,title:u("settings.projectChanges.cleanup.confirm.title","Apply this limit and clean saved changes?"),message:O,cancelLabel:u("common.cancel","Cancel"),confirmLabel:u("settings.projectChanges.cleanup.confirm.apply","Apply and clean"),loading:N,onCancel:()=>!N&&H(null),onConfirm:()=>{y&&B(y.policy)}})]})}const ft={toolsActivity:null,toolStats:null,toolSessions:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null},xt={toolsActivity:null,toolStats:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null};function vt(t){var s;return t?t.pluginConnected?t.activePlaceId:t.lastActivePlaceId??((s=t.places[0])==null?void 0:s.placeId)??null:null}async function I(t){try{return await t}catch{return null}}function X(t){return t?typeof t.total=="number"?t.total:Array.isArray(t.entries)?t.entries.length:null:null}function ee(t,s,c,u){return s===null?t("settings.dataHistory.metric.unavailable","Unavailable"):`${s.toLocaleString()} ${t(c,u)}`}function J(t,s,c){const u=c===null?t("settings.dataHistory.metric.sizeUnavailable","size unavailable"):q(c);return`${s} · ${u}`}function Q(t,s){var u;const c=(u=t==null?void 0:t[s])==null?void 0:u.bytes;return typeof c=="number"&&Number.isFinite(c)?c:null}function St(t,s){return s?[`${s.requestCount.toLocaleString()} ${t("uiStudio.storage.requestCount","change records")}`,`${s.snapshotCount.toLocaleString()} ${t("uiStudio.storage.snapshotCount","screenshots")}`,q(s.totalBytes)].join(" · "):t("settings.dataHistory.metric.unavailable","Unavailable")}function bt({tier:t}){const{t:s}=te(),[c,u]=l.useState(ft),[i,C]=l.useState(xt),[a,j]=l.useState(t==="basic"?ae:null),[h,w]=l.useState(null),[N,L]=l.useState(!0),[P,D]=l.useState(!0),[f,x]=l.useState(null),[E,_]=l.useState(()=>new Set),[y,H]=l.useState(null),[S,B]=l.useState(!1),[M,b]=l.useState(null),m=l.useCallback(async()=>{L(!0);const d=await I(me()),v=vt(d);w(v);const[Y,z,p,R,U,ge,K]=await Promise.all([I(T.get("/api/dashboard/history",{limit:"1",offset:"0"})),I(T.get("/api/dashboard/tool-stats")),I(T.get("/sync/history",{limit:"1",offset:"0"})),I(T.get("/api/dashboard/playtest/history")),I(T.get("/api/dashboard/changelog",{limit:"1",offset:"0"})),I(T.get("/api/dashboard/connection-log")),I(T.get("/api/dashboard/storage-summary"))]),he=t==="basic"?ae:v===null?null:await I(pe(v));u({toolsActivity:X(Y),toolStats:(z==null?void 0:z.totalCalls)??null,toolSessions:(z==null?void 0:z.totalSessions)??null,syncLog:X(p),playtestReports:X(R),projectChanges:X(U),connectionLog:X(ge)}),C({toolsActivity:Q(K,"toolsActivity"),toolStats:Q(K,"toolStats"),syncLog:Q(K,"syncLog"),playtestReports:Q(K,"playtestReports"),projectChanges:Q(K,"projectChanges"),connectionLog:Q(K,"connectionLog")}),j(he),L(!1)},[t]);l.useEffect(()=>{m()},[m]);const $=l.useCallback(d=>{_(v=>{if(v.has(d))return v;const Y=new Set(v);return Y.add(d),Y}),x(v=>v===d?null:d)},[]),r=l.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:J(s,ee(s,c.toolsActivity,"settings.dataHistory.metric.records","records"),i.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:J(s,c.toolStats===null?s("settings.dataHistory.metric.unavailable","Unavailable"):`${c.toolStats.toLocaleString()} ${s("settings.dataHistory.metric.runs","runs")} · ${(c.toolSessions??0).toLocaleString()} ${s("settings.dataHistory.metric.sessions","sessions")}`,i.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:J(s,ee(s,c.syncLog,"settings.dataHistory.metric.records","records"),i.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:J(s,ee(s,c.playtestReports,"settings.dataHistory.metric.reports","reports"),i.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:J(s,ee(s,c.projectChanges,"settings.dataHistory.metric.records","records"),i.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:J(s,ee(s,c.connectionLog,"settings.dataHistory.metric.records","records"),i.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"}],[c,i,s]),A=async()=>{if(y){B(!0),b(null);try{if(y.kind==="uiStudio"){if(t!=="pro"||h===null)throw new Error("UI Studio place is unavailable");await se(h,{all:!0,alsoSnapshots:!0}),b(s("settings.dataHistory.uiStudio.clear.success","UI Studio saved data cleared."))}else{const d=y.row.key==="projectChanges";if(d&&h===null)throw new Error("Project changes place is unavailable");let v=y.row.clearEndpoint;d&&h!==null&&(v=`${v}?placeId=${encodeURIComponent(h)}`),await T.post(v),b(d?s("settings.dataHistory.projectChanges.clear.success","Project change summaries cleared."):s("settings.dataHistory.clear.success","Saved data cleared."))}H(null),await m()}catch{b(y.kind==="uiStudio"?s("settings.dataHistory.uiStudio.clear.failed","Failed to clear UI Studio saved data."):s("settings.dataHistory.clear.failed","Failed to clear saved data."))}finally{B(!1)}}},W=t==="pro"?h:0,Z=t==="pro"&&h!==null,F=(y==null?void 0:y.kind)==="uiStudio",O=(y==null?void 0:y.kind)==="row"&&y.row.key==="projectChanges",G=s("settings.dataHistory.title","Data & History");return e.jsxs(e.Fragment,{children:[e.jsxs("section",{id:"data-history",className:n.card,children:[e.jsxs("div",{className:n.cardHeader,children:[e.jsx(k,{label:s("settings.dataHistory.title","Data & History"),tooltip:s("settings.dataHistory.title.tooltip","Manage saved dashboard data in one place.")}),e.jsxs("div",{className:n.cardHeaderActions,children:[e.jsx(g,{text:s("settings.dataHistory.scope.tooltip","Clear actions apply to the current project and active place where applicable."),children:e.jsx("span",{className:n.headerBadge,children:N?s("common.loading","Loading"):s("settings.dataHistory.scope","Current project")})}),e.jsx(g,{text:s("settings.dataHistory.toggle.tooltip","Collapse or expand this section."),children:e.jsx("button",{className:n.collapseButton,type:"button","aria-expanded":P,"aria-controls":"settings-data-history-body","aria-label":P?s("settings.dataHistory.collapse","Collapse {title}").replace("{title}",G):s("settings.dataHistory.expand","Expand {title}").replace("{title}",G),onClick:()=>D(d=>!d),children:P?"▾":"▸"})})]})]}),P&&e.jsxs("div",{id:"settings-data-history-body",children:[e.jsx("p",{className:n.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:n.dataHistoryList,children:[r.map(d=>e.jsxs(l.Fragment,{children:[e.jsxs("div",{className:`${n.dataHistoryRow} ${d.key==="projectChanges"&&f==="projectChanges"?n.dataHistoryRowExpanded:""}`,children:[e.jsxs("div",{className:n.dataHistoryMain,children:[e.jsx("div",{className:n.dataHistoryTitle,children:d.title}),e.jsx("div",{className:n.dataHistoryDescription,children:d.description})]}),e.jsx(g,{text:d.metricTooltip,children:e.jsx("div",{className:n.dataHistoryMetric,children:d.metric})}),e.jsxs("div",{className:n.dataHistoryActions,children:[e.jsx(g,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:n.linkButton,href:`#${d.route}`,children:s("settings.dataHistory.open","Open")})}),d.key==="projectChanges"&&e.jsx(g,{text:s("settings.dataHistory.manageStorage.tooltip","Show or hide storage policy and cleanup controls."),children:e.jsxs("button",{className:n.manageStorageButton,type:"button","aria-expanded":f==="projectChanges","aria-controls":"settings-project-changes-storage","aria-label":s("settings.dataHistory.manageStorage.projectChanges.aria","Manage Project change summary storage"),onClick:()=>$("projectChanges"),children:[s("settings.dataHistory.manageStorage","Manage storage"),e.jsx("span",{"aria-hidden":"true",children:f==="projectChanges"?"▴":"▾"})]})}),e.jsx(g,{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:n.dangerButton,type:"button",disabled:d.key==="projectChanges"&&h===null,onClick:()=>H({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:`${n.dataHistoryDetail} ${n.projectChangesDataHistoryDetail}`,hidden:f!=="projectChanges",children:e.jsx(jt,{placeId:h,onChanged:m})})]},d.key)),e.jsxs("div",{className:`${n.dataHistoryRow} ${f==="uiStudio"?n.dataHistoryRowExpanded:""}`,children:[e.jsxs("div",{className:n.dataHistoryMain,children:[e.jsx("div",{className:n.dataHistoryTitle,children:s("settings.dataHistory.uiStudio.title","UI Studio history and screenshots")}),e.jsx("div",{className:n.dataHistoryDescription,children:s("settings.dataHistory.uiStudio.description","Saved UI Studio change records, screenshots, and cleanup policy.")})]}),e.jsx(g,{text:s("settings.dataHistory.uiStudio.metric.tooltip","UI Studio change record and capture counts, plus total disk usage."),children:e.jsx("div",{className:n.dataHistoryMetric,children:St(s,a)})}),e.jsxs("div",{className:n.dataHistoryActions,children:[e.jsx(g,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:n.linkButton,href:"#/ui-studio?tab=history",children:s("settings.dataHistory.open","Open")})}),e.jsx(g,{text:s("settings.dataHistory.manageStorage.tooltip","Show or hide storage policy and cleanup controls."),children:e.jsxs("button",{className:n.manageStorageButton,type:"button","aria-expanded":f==="uiStudio","aria-controls":"settings-ui-studio-storage","aria-label":s("settings.dataHistory.manageStorage.uiStudio.aria","Manage UI Studio history and screenshots storage"),onClick:()=>$("uiStudio"),children:[s("settings.dataHistory.manageStorage","Manage storage"),e.jsx("span",{"aria-hidden":"true",children:f==="uiStudio"?"▴":"▾"})]})}),e.jsx(g,{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:n.dangerButton,type:"button",disabled:!Z,onClick:()=>H({kind:"uiStudio"}),children:s("settings.dataHistory.clearAll","Clear all")})})]})]}),E.has("uiStudio")&&e.jsx("div",{id:"settings-ui-studio-storage",className:`${n.dataHistoryDetail} ${n.uiStudioDataHistoryDetail}`,hidden:f!=="uiStudio",children:e.jsx(gt,{placeId:W,tier:t,onChanged:m,embedded:!0,...t==="basic"?{sampleUsage:ae,sampleRetention:Ne}:{}})})]}),M&&e.jsx("p",{className:n.inlineStatus,children:M})]})]}),e.jsx(ce,{open:y!==null,title:F?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:F?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||F?s("settings.dataHistory.clearAll","Clear all"):s("common.clear","Clear"),loading:S,onCancel:()=>!S&&H(null),onConfirm:()=>void A()})]})}const Ct={en:"English",ko:"한국어",es:"Español","pt-br":"Português (BR)",ja:"日本語",id:"Bahasa Indonesia",de:"Deutsch","fr-fr":"Français"};function Nt(t){return t==="active"?n.statusActive:t==="grace"?n.statusGrace:t==="invalid"||t==="revoked"?n.statusError:n.statusInactive}function _t(t){return t?t.refreshBlockedReason==="missing_session_token"?!0:t.status==="active"||t.status==="grace"||t.status==="invalid"||t.status==="revoked"||t.status==="unknown":!1}function kt(t,s){return t.refreshBlockedReason==="missing_session_token"?{label:s("settings.license.status.activationRequired","Activation Required"),tooltip:s("settings.license.status.activationRequired.tooltip","Manual license activation is required before WEPPY Dashboard can refresh this status."),detail:s("settings.license.detail.missingSessionToken","Refresh is blocked because the current session token is missing."),detailTone:n.licenseNoticeWarning}:t.statusDetail==="active_cancel_pending"?{label:s("settings.license.active","Active"),tooltip:s("settings.license.status.activeCancelPending.tooltip","Cancellation is pending, but Pro access remains active until the current billing period ends."),detail:s("settings.license.detail.cancelPending","Cancellation is scheduled. Pro access remains active until the current billing period ends."),detailTone:n.licenseNoticeInfo}:t.statusDetail==="grace_provider_unavailable"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.grace.tooltip","Provider verification is temporarily unavailable, but Pro access remains active during the grace period."),detail:s("settings.license.detail.graceProviderUnavailable","Provider unavailable. Pro access remains active during grace mode."),detailTone:n.licenseNoticeInfo}:t.statusDetail==="grace_expired"||t.statusDetail==="grace_payment_failed"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.graceBilling.tooltip","Pro access is still available during a billing-related grace period."),detail:s("settings.license.detail.graceBilling","Pro access remains available during a billing grace period."),detailTone:n.licenseNoticeInfo}:{label:s(`settings.license.${t.status}`,t.status),tooltip:s(`settings.license.${t.status}.tooltip`,"Current license activation state."),detail:t.refreshRequired?s("settings.license.detail.refreshRecommended","License verification should be refreshed soon."):null,detailTone:n.licenseNoticeMuted}}function Dt(){const{t,selectedLocale:s,setLocale:c}=te(),{trackEvent:u}=re(),{search:i}=ye(),{settings:C,license:a,licenseControlsDisabled:j,licenseSubmitting:h,licenseMessage:w,activateLicense:N,refreshLicense:L,resetLicense:P,loading:D}=Se(),[f,x]=l.useState(""),E=a?kt(a,t):null,_=_t(a),y=_&&(a==null?void 0:a.refreshBlockedReason)!=="missing_session_token",H=_,S=_?a==null?void 0:a.maskedKey:void 0,B=a!=null&&a.provider&&a.provider!=="auto"?a.provider:void 0,M=(a==null?void 0:a.tier)==="pro"?"pro":"basic",b=l.useRef(null),m=l.useRef(null),$=l.useMemo(()=>new URLSearchParams(i).get("section")==="license",[i]);return l.useEffect(()=>{var A;if(!$||D)return;const r=b.current;if((A=r==null?void 0:r.scrollIntoView)==null||A.call(r,{block:"start",behavior:"smooth"}),m.current&&!m.current.disabled){m.current.focus();return}r==null||r.focus()},[D,j,h,$]),D?e.jsx("div",{className:n.page,children:e.jsx("div",{className:n.loading,children:t("common.loading")})}):e.jsxs("div",{className:n.page,children:[e.jsx(ve,{title:t("page.settings.title","Settings"),description:t("page.settings.description","Manage license, saved data, server environment, and language."),helpTopicId:"settings",helpState:{tier:M}}),e.jsxs("div",{id:"settings-license",ref:b,tabIndex:-1,"data-testid":"settings-license-card",className:[n.card,$?n.licenseCardTarget:"",(a==null?void 0:a.tier)==="pro"?n.licenseCardPro:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:n.cardHeader,children:[e.jsx(k,{label:t("settings.license.title","License"),tooltip:t("settings.license.title.tooltip","Current license status and subscription tier.")}),e.jsx(g,{text:j?t("settings.license.disconnected.tooltip","Reconnect to the MCP server to manage license actions from WEPPY Dashboard."):t("settings.license.live.tooltip","License actions are sent to the MCP server immediately."),children:e.jsx("span",{className:`${n.headerBadge} ${j?"":n.headerBadgeLive}`,children:j?t("settings.license.disconnected","Disconnected"):t("settings.general.liveApply","Live Apply")})})]}),e.jsxs(e.Fragment,{children:[a?e.jsxs(e.Fragment,{children:[(()=>{const r=E;return e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:n.licenseGrid,children:[e.jsx("dt",{children:e.jsx(k,{label:t("settings.license.status","Status"),tooltip:t("settings.license.status.tooltip","Current license activation state.")})}),e.jsxs("dd",{children:[e.jsx("span",{className:`${n.statusDot} ${Nt(a.status)}`}),e.jsx(g,{text:(r==null?void 0:r.tooltip)??t(`settings.license.${a.status}.tooltip`,"Current license activation state."),children:(r==null?void 0:r.label)??t(`settings.license.${a.status}`,a.status)})]}),e.jsx("dt",{children:e.jsx(k,{label:t("settings.license.tier","Tier"),tooltip:t("settings.license.tier.tooltip","Current subscription tier for available WEPPY Dashboard features.")})}),e.jsx("dd",{className:a.tier==="pro"?n.proBadge:"",children:e.jsx(g,{text:t(`tier.${a.tier}.tooltip`,"Available feature set for the connected license."),children:a.tier==="pro"?t("tier.pro","Pro"):t("tier.basic","Basic")})}),S&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(k,{label:t("settings.license.key","Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("dd",{children:e.jsx(g,{text:t("settings.license.keyValue.tooltip","Masked license key currently loaded by the server."),children:S})})]}),B&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(k,{label:t("settings.license.provider","Provider"),tooltip:t("settings.license.provider.tooltip","License provider used to validate this key.")})}),e.jsx("dd",{children:e.jsx(g,{text:t("settings.license.providerValue.tooltip","License provider used to validate this key."),children:B})})]})]}),(r==null?void 0:r.detail)&&e.jsx("p",{className:`${n.licenseNotice} ${r.detailTone}`,children:a.refreshBlockedReason==="missing_session_token"?t("settings.license.detail.manualActivation","Manual activation required to restore Pro access."):r.detail}),a.refreshBlockedReason==="missing_session_token"&&e.jsx("p",{className:`${n.licenseNotice} ${n.licenseNoticeMuted}`,children:r==null?void 0:r.detail})]})})(),a.tier==="basic"&&e.jsx(g,{text:t("tier.upgrade.tooltip","View Pro features and purchase options."),children:e.jsx("a",{className:n.upgradeLink,href:je.settingsLicense,target:"_blank",rel:"noopener noreferrer",onClick:()=>u("dashboard_click_event",{click_target:"upgrade_cta",placement:"settings_license",page:"settings"}),children:t("tier.upgrade","View Pro")})})]}):e.jsx("div",{className:n.loading,children:t("settings.license.unavailable")}),e.jsxs("div",{className:n.licenseControls,children:[e.jsxs("div",{className:n.licenseControlRow,children:[e.jsx(g,{text:t("settings.license.refresh.tooltip","Re-fetch the current state from the license server. Useful when a billing change hasn't appeared yet."),children:e.jsx("button",{type:"button",className:n.actionBtn,disabled:j||h||!y,onClick:()=>{L()},children:h?t("common.loading"):t("settings.license.refresh","Refresh License")})}),e.jsx(g,{text:t("settings.license.reset.tooltip","Remove the currently registered license key. Use this before activating with a different key."),children:e.jsx("button",{type:"button",className:n.actionBtn,disabled:j||h||!H,onClick:()=>{P()},children:h?t("common.loading"):t("settings.license.reset","Reset License")})})]}),e.jsxs("div",{className:n.licenseControlRow,children:[e.jsxs("label",{className:`${n.licenseField} ${n.licenseFieldGrow}`,children:[e.jsx("span",{className:n.controlLabel,children:e.jsx(k,{label:t("settings.license.keyInput","License Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("input",{ref:m,"aria-label":t("settings.license.keyInput","License Key"),className:n.textInput,type:"text",value:f,disabled:j||h,onChange:r=>x(r.target.value)})]}),e.jsx(g,{text:t("settings.license.activate.tooltip","Activate Pro features with the entered license key."),children:e.jsx("button",{type:"button",className:n.actionBtn,disabled:j||h,onClick:()=>{(async()=>await N(f)&&x(""))()},children:h?t("common.loading"):t("settings.license.activate","Activate License")})})]}),w&&e.jsx("p",{className:n.licenseMessage,children:w})]})]})]}),e.jsx(bt,{tier:M}),e.jsxs("div",{className:n.card,children:[e.jsxs("div",{className:n.cardHeader,children:[e.jsx(k,{label:t("settings.cold.title","Server Environment"),tooltip:t("settings.cold.title.tooltip","Read-only server environment values loaded at startup.")}),e.jsx(g,{text:t("settings.readOnly.tooltip","This section shows values that cannot be edited from WEPPY Dashboard."),children:e.jsx("span",{className:n.headerBadge,children:t("settings.readOnly","Read-only")})})]}),C?e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:n.coldGrid,children:[e.jsx("dt",{children:e.jsx(k,{label:"HTTP_PORT",tooltip:t("settings.cold.httpPort.tooltip","Port number used by the MCP WEPPY Dashboard HTTP server.")})}),e.jsx("dd",{children:C.cold.HTTP_PORT}),e.jsx("dt",{children:e.jsx(k,{label:"HTTP_HOST",tooltip:t("settings.cold.httpHost.tooltip","Host interface that the MCP WEPPY Dashboard HTTP server binds to.")})}),e.jsx("dd",{children:C.cold.HTTP_HOST}),e.jsx("dt",{children:e.jsx(k,{label:"DASHBOARD_AUTO_OPEN",tooltip:t("settings.cold.dashboardAutoOpen.tooltip","Controls whether WEPPY Dashboard opens automatically in the browser when the server starts.")})}),e.jsx("dd",{children:e.jsx(g,{text:t("settings.cold.dashboardAutoOpen.value.tooltip","Current startup behavior for opening WEPPY Dashboard in a browser."),children:String(C.cold.DASHBOARD_AUTO_OPEN)})})]}),e.jsx("p",{className:n.coldHint,children:t("settings.cold.hint","Set via environment variables to change these values.")})]}):e.jsx("div",{className:n.loading,children:t("settings.unavailable")})]}),e.jsxs("div",{className:n.card,children:[e.jsx("div",{className:n.cardHeader,children:e.jsx(k,{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:n.langRow,children:[e.jsx("label",{children:e.jsx(k,{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(g,{text:t("settings.language.auto.tooltip","Follow the operating system's language. Falls back to English when not supported."),children:e.jsxs("select",{className:n.select,value:s,onChange:r=>c(r.target.value),children:[e.jsx("option",{value:fe,children:t("settings.language.auto","Auto")}),xe.map(r=>e.jsx("option",{value:r,children:Ct[r]??r},r))]})})]})]})]})}export{Dt as Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as o,j as s}from"./index-
|
|
1
|
+
import{u as o,j as s}from"./index-CahJTtjv.js";const e="_badge_1ucqq_2",c="_dot_1ucqq_12",a="_online_1ucqq_20",l="_offline_1ucqq_25",_="_idle_1ucqq_30",u="_syncing_1ucqq_34",d="_initializing_1ucqq_35",n={badge:e,dot:c,online:a,offline:l,idle:_,syncing:u,initializing:d},g={online:"status.online",offline:"status.offline",idle:"status.idle",syncing:"status.syncing",initializing:"status.initializing"};function f({status:i}){const{t}=o();return s.jsxs("span",{className:n.badge,children:[s.jsx("span",{className:`${n.dot} ${n[i]}`}),t(g[i])]})}export{f as S};
|