@weppy/roblox-mcp 2.7.1 → 2.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +11 -0
  3. package/package.json +1 -1
  4. package/plugins/weppy-roblox-mcp/.claude-plugin/plugin.json +1 -1
  5. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ChangelogDetailPage-DxktONbL.js → ChangelogDetailPage-BWM0bhGw.js} +1 -1
  6. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/ChangelogPage-DOXmMWDc.js +1 -0
  7. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ConfirmModal-CmJCz5rg.js → ConfirmModal-Dak7jVJo.js} +1 -1
  8. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/ConnectionPage-CNtjimlm.css +1 -0
  9. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/ConnectionPage-Cds2YIvI.js +1 -0
  10. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{GameChangeDetail-Be32PRgR.css → GameChangeDetail-C1XtdYwk.css} +1 -1
  11. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{GameChangeDetail-D1kE2L_v.js → GameChangeDetail-MfVogSqQ.js} +5 -5
  12. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{InfoLabel-B9KT3kfU.js → InfoLabel-BDieYXVe.js} +1 -1
  13. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{OverviewPage-T2WCTHpo.js → OverviewPage-CTH7jUzQ.js} +1 -1
  14. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/PlaytestPage-BHQoeC4V.js +11 -0
  15. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/PlaytestPage-DjjsIkke.css +1 -0
  16. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SettingsPage-BL3qgVfn.js +1 -0
  17. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SettingsPage-Du8-FZAO.css +1 -0
  18. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{StatusBadge-Bxe88ki2.js → StatusBadge-MxsMOCZ3.js} +1 -1
  19. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SyncPage-Dm7Ni3j_.css +1 -0
  20. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SyncPage-IZEcPmIw.js +4 -0
  21. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{Tabs-BNtOqYlc.js → Tabs-CuTJuL80.js} +1 -1
  22. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{TierComparison-Dyf-knpe.js → TierComparison-DvuMctLJ.js} +1 -1
  23. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/ToolsPage-ByA_a1TP.js +1 -0
  24. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/ToolsPage-Dq7uIer6.css +1 -0
  25. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{TooltipText-Baw38jOU.js → TooltipText-DgxJjq91.js} +1 -1
  26. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/UiStudioPage-DVFz_q9v.js +16 -0
  27. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/UiStudioPage-eSinjpOX.css +1 -0
  28. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{WhatsNewPage-BlOSWgSn.js → WhatsNewPage-CcELayE3.js} +1 -1
  29. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/index-CX4MHzNt.css +1 -0
  30. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{index-FfT2oWAB.js → index-CjBiayQg.js} +37 -37
  31. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{sample-requests-X_hsWdLX.js → sample-requests-BrVQkhcR.js} +1 -1
  32. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/sample-requests-CygerZZ_.css +1 -0
  33. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{useLiveUptime-DhJz484L.js → useLiveUptime-s_CjVcUM.js} +1 -1
  34. package/plugins/weppy-roblox-mcp/dashboard/dist/index.html +2 -2
  35. package/plugins/weppy-roblox-mcp/dist/index.js +74 -74
  36. package/plugins/weppy-roblox-mcp/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
  37. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/ChangelogPage-DOY-SmWM.js +0 -1
  38. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/ConnectionPage-BiiIQs7f.js +0 -1
  39. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/ConnectionPage-D_mEFudd.css +0 -1
  40. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/PlaytestPage-CW8Xfp6b.js +0 -11
  41. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/PlaytestPage-CYSu0pfO.css +0 -1
  42. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SettingsPage-Cc9Wnj8M.css +0 -1
  43. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SettingsPage-DcUt5qjG.js +0 -1
  44. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SyncPage-BmMeN4N9.css +0 -1
  45. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SyncPage-C09YF6D5.js +0 -4
  46. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/ToolsPage-B3fMk-22.css +0 -1
  47. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/ToolsPage-HKbmsKMQ.js +0 -1
  48. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/UiStudioPage-Cbgl7xIC.js +0 -16
  49. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/UiStudioPage-DQOd5VrU.css +0 -1
  50. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/index-Gu7et1DX.css +0 -1
  51. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/sample-requests-Bx1zpYdG.css +0 -1
@@ -1 +0,0 @@
1
- import{r as i,a as A,D as O,u as R,j as t,c as P,l as V,m as K}from"./index-FfT2oWAB.js";import{C as G}from"./ConfirmModal-CmJCz5rg.js";import{T as I}from"./TooltipText-Baw38jOU.js";import{T as H}from"./Tabs-BNtOqYlc.js";const U=10;function Z(){const[s,m]=i.useState([]),[e,a]=i.useState(0),[h,p]=i.useState(!1),[c,f]=i.useState(!0),[l,x]=i.useState(0),[g,v]=i.useState("all"),y=i.useRef(null),o=i.useCallback(async(u,_)=>{f(!0);try{const C={limit:String(U),offset:String(u)};_!=="all"&&(C.status=_);const b=await A.get("/api/dashboard/changelog",C);m(b.entries),a(b.total),p(b.hasMore)}catch{m([]),a(0),p(!1)}finally{f(!1)}},[]),T=i.useCallback(()=>{o(l,g)},[o,l,g]),N=i.useCallback(async()=>{await A.post("/api/dashboard/changelog/clear"),m([]),a(0),p(!1)},[]);return i.useEffect(()=>{o(l,g)},[o,l,g]),i.useEffect(()=>{const u=new O;y.current=u,u.connect();const _=u.on("command",()=>{o(l,g)});return()=>{_(),u.disconnect(),y.current=null}},[o,l,g]),{entries:s,total:e,hasMore:h,loading:c,offset:l,statusFilter:g,setOffset:x,setStatusFilter:v,refresh:T,clear:N}}const q="_card_1n89u_2",z="_header_1n89u_17",J="_statusBadge_1n89u_24",Q="_statusDot_1n89u_35",W="_active_1n89u_41",X="_completed_1n89u_50",Y="_timeRange_1n89u_58",ee="_summaryList_1n89u_65",te="_summaryItem_1n89u_71",se="_summaryIcon_1n89u_80",ae="_summaryText_1n89u_86",ne="_progressBar_1n89u_91",oe="_progressFill_1n89u_99",ce="_emptySummary_1n89u_112",ie="_contextBlock_1n89u_120",le="_contextLabel_1n89u_129",re="_contextValue_1n89u_137",n={card:q,header:z,statusBadge:J,statusDot:Q,active:W,completed:X,timeRange:Y,summaryList:ee,summaryItem:te,summaryIcon:se,summaryText:ae,progressBar:ne,progressFill:oe,emptySummary:ce,contextBlock:ie,contextLabel:le,contextValue:re};function D(s){if(!s)return"--:--";const m=new Date(s);return`${String(m.getHours()).padStart(2,"0")}:${String(m.getMinutes()).padStart(2,"0")}`}function de({entry:s,onClick:m}){var C,b,$,w,B,k,L,M,E,F;const{t:e}=R(),a=s.changeSummary,h=s.status==="active",p=s.isBootstrapOnly===!0,c=[],f=a.scriptsModified+a.scriptsCreated;if(f>0){const r=[];a.scriptsModified>0&&r.push(`${a.scriptsModified} ${e("changelog.card.modified","modified")}`),a.scriptsCreated>0&&r.push(`${a.scriptsCreated} ${e("changelog.card.created","created")}`);const j=`${f} ${e("changelog.card.scripts","scripts")} ${r.join(", ")}`;c.push({icon:"📝",text:j,tooltip:e("changelog.card.scripts.tooltip","Script changes made in this session.")})}const l=a.instancesCreated+a.instancesDeleted+a.instancesMoved;if(l>0){const r=[];a.instancesCreated>0&&r.push(`${a.instancesCreated} ${e("changelog.card.created","created")}`),a.instancesDeleted>0&&r.push(`${a.instancesDeleted} ${e("changelog.card.deleted","deleted")}`),a.instancesMoved>0&&r.push(`${a.instancesMoved} ${e("changelog.card.moved","moved")}`);const j=`${l} ${e("changelog.card.instances","instances")} ${r.join(", ")}`;c.push({icon:"🧱",text:j,tooltip:e("changelog.card.instances.tooltip","Instance create, delete, move, or clone changes in this session.")})}a.propertiesChanged>0&&c.push({icon:"🎨",text:`${a.propertiesChanged} ${e("changelog.card.propertiesChanged","properties changed")}`,tooltip:e("changelog.card.propertiesChanged.tooltip","Property value changes recorded for this session.")}),a.lightingChanged&&c.push({icon:"🌅",text:e("changelog.card.lightingConfigured","Lighting configured"),tooltip:e("changelog.card.lightingConfigured.tooltip","Lighting or atmosphere settings changed in this session.")}),a.terrainChanged&&c.push({icon:"⛰️",text:e("changelog.card.terrainConfigured","Terrain configured"),tooltip:e("changelog.card.terrainConfigured.tooltip","Terrain data or terrain settings changed in this session.")}),a.assetsInserted>0&&c.push({icon:"📦",text:`${a.assetsInserted} ${e("changelog.card.assetsInserted","assets inserted")}`,tooltip:e("changelog.card.assetsInserted.tooltip","Assets inserted into the place during this session.")});const x=D(s.startTime),g=h?e("changelog.card.inProgress","in progress"):s.endTime?D(s.endTime):"--:--",v=p?e("changelog.card.bootstrapStatus","Bootstrap"):h?e("changelog.card.active","Active"):e("changelog.card.completed","Completed"),y=p?e("changelog.card.bootstrapStatus.tooltip","This session only contains the initial sync bootstrap snapshot."):h?e("changelog.card.active.tooltip","This session is still receiving new game changes."):e("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),o=p?e("changelog.card.bootstrapSummary","Initial sync snapshot"):e("changelog.card.noChanges","No changes yet"),T=p?e("changelog.card.bootstrapSummary.tooltip","Initial file sync writes are collapsed into a single bootstrap snapshot row."):e("changelog.card.noChanges.tooltip","No game changes have been extracted for this session yet."),N=(b=(C=s.contextSummary)==null?void 0:C.intent)==null?void 0:b.trim(),u=((k=(B=(w=($=s.contextSummary)==null?void 0:$.affectedAreas)==null?void 0:w[0])==null?void 0:B.label)==null?void 0:k.trim())||((M=(L=s.contextSummary)==null?void 0:L.testScenario)==null?void 0:M.trim()),_=(F=(E=s.verificationSummary)==null?void 0:E.label)==null?void 0:F.trim();return t.jsxs("div",{className:n.card,onClick:m,children:[t.jsxs("div",{className:n.header,children:[t.jsx(I,{text:y,children:t.jsxs("span",{className:`${n.statusBadge} ${h?n.active:n.completed}`,children:[t.jsx("span",{className:n.statusDot}),v]})}),t.jsxs("span",{className:n.timeRange,children:[x,"~",g]})]}),t.jsx("div",{className:n.summaryList,children:c.length>0?c.map((r,j)=>t.jsxs("div",{className:n.summaryItem,children:[t.jsx("span",{className:n.summaryIcon,children:r.icon}),t.jsx(I,{text:r.tooltip,children:t.jsx("span",{className:n.summaryText,children:r.text})})]},j)):t.jsx(I,{text:T,children:t.jsx("span",{className:n.emptySummary,style:{display:"block"},children:o})})}),N&&t.jsxs("div",{className:n.contextBlock,children:[t.jsx("span",{className:n.contextLabel,children:e("changelog.card.sessionIntent","Session intent")}),t.jsx("span",{className:n.contextValue,children:N})]}),!N&&u&&t.jsxs("div",{className:n.contextBlock,children:[t.jsx("span",{className:n.contextLabel,children:e("changelog.card.representativeArea","Representative area")}),t.jsx("span",{className:n.contextValue,children:u})]}),_&&t.jsxs("div",{className:n.contextBlock,children:[t.jsx("span",{className:n.contextLabel,children:e("changelog.card.verification","Verification")}),t.jsx("span",{className:n.contextValue,children:_})]}),h&&t.jsx("div",{className:n.progressBar,children:t.jsx("div",{className:n.progressFill})})]})}const ge="_page_1ynbw_2",me="_limitNotice_1ynbw_9",he="_limitNoticeTitle_1ynbw_18",pe="_limitNoticeText_1ynbw_25",ue="_clearButton_1ynbw_33",fe="_list_1ynbw_54",xe="_empty_1ynbw_61",_e="_loading_1ynbw_70",ye="_pagination_1ynbw_79",be="_pageInfo_1ynbw_87",ve="_btn_1ynbw_93",d={page:ge,limitNotice:me,limitNoticeTitle:he,limitNoticeText:pe,clearButton:ue,list:fe,empty:xe,loading:_e,pagination:ye,pageInfo:be,btn:ve},S=10,Ne=[{key:"all",labelKey:"changelog.filter.all"},{key:"active",labelKey:"changelog.filter.active"},{key:"completed",labelKey:"changelog.filter.completed"}];function Ie(){const{t:s}=R(),m=P(),e=Z(),a=V(),{show:h}=K(),[p,c]=i.useState(!1),[f,l]=i.useState(!1),x=!a.loading&&a.tier==="basic",g=x?e.entries.slice(0,3):e.entries,v=!x&&e.total>S,y=async()=>{l(!0);try{await e.clear(),h(s("toast.clearSuccess","Cleared successfully"),"success"),c(!1)}catch{h(s("toast.clearFailed","Failed to clear data"),"error")}finally{l(!1)}};return t.jsxs("div",{className:d.page,children:[t.jsx(H,{items:Ne.map(o=>({key:o.key,label:s(o.labelKey,o.key.charAt(0).toUpperCase()+o.key.slice(1))})),value:e.statusFilter,onChange:o=>{e.setStatusFilter(o),e.setOffset(0)},rightActions:t.jsx("button",{className:d.clearButton,onClick:()=>c(!0),children:s("common.clear","Clear")})}),e.loading&&e.entries.length===0&&t.jsx("div",{className:d.loading,children:s("common.loading","Loading...")}),!e.loading&&e.entries.length===0?t.jsx("div",{className:d.empty,children:s("changelog.empty","No changelog entries yet")}):t.jsx("div",{className:d.list,children:g.map(o=>t.jsx(de,{entry:o,onClick:()=>m(`/changelog/${o.entryId}`)},o.entryId))}),v&&t.jsxs("div",{className:d.pagination,children:[t.jsx("button",{className:d.btn,disabled:e.offset===0,onClick:()=>e.setOffset(Math.max(0,e.offset-S)),children:s("tools.page.prev","Prev")}),t.jsxs("span",{className:d.pageInfo,children:[e.offset+1,"–",Math.min(e.offset+S,e.total)," / ",e.total]}),t.jsx("button",{className:d.btn,disabled:!e.hasMore,onClick:()=>e.setOffset(e.offset+S),children:s("tools.page.next","Next")})]}),x&&t.jsx(t.Fragment,{children:t.jsxs("div",{className:d.limitNotice,children:[t.jsx("div",{className:d.limitNoticeTitle,children:s("changelog.basic.limit.title","Basic preview shows the latest 3 sessions")}),t.jsx("div",{className:d.limitNoticeText,children:s("changelog.basic.limit.body","Upgrade to Pro to browse the full changelog timeline for this place.")})]})}),t.jsx(G,{open:p,title:s("changelog.clear.title","Clear changelog?"),message:s("changelog.clear.message","This permanently removes the stored changelog for the current place."),cancelLabel:s("common.cancel","Cancel"),confirmLabel:s("common.clear","Clear"),loading:f,onCancel:()=>!f&&c(!1),onConfirm:y})]})}export{Ie as Component};
@@ -1 +0,0 @@
1
- import{u as R,r as i,j as e,d as E,a as w,D as B,m as P}from"./index-FfT2oWAB.js";import{I as r}from"./InfoLabel-B9KT3kfU.js";import{S as T}from"./StatusBadge-Bxe88ki2.js";import{T as D}from"./TooltipText-Baw38jOU.js";import{C as $}from"./ConfirmModal-CmJCz5rg.js";import{u as F,f as H}from"./useLiveUptime-DhJz484L.js";const U="_container_1h084_2",K="_entry_1h084_14",G="_timestamp_1h084_21",O="_message_1h084_27",V="_warn_1h084_34",X="_error_1h084_39",z="_empty_1h084_44",_={container:U,entry:K,timestamp:G,message:O,warn:V,error:X,empty:z};function J(n){const t=new Date(n);return Number.isNaN(t.getTime())?n:`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function Q({entries:n}){const{t}=R(),o=i.useRef(null);return i.useEffect(()=>{const l=o.current;l&&(l.scrollTop=l.scrollHeight)},[n.length]),e.jsx("div",{ref:o,className:_.container,children:n.length===0?e.jsx("div",{className:_.empty,children:t("connection.log.empty","No events yet")}):n.map((l,j)=>e.jsxs("div",{className:`${_.entry} ${l.type?_[l.type]:""}`,children:[e.jsx("span",{className:_.timestamp,children:J(l.timestamp)}),e.jsx("span",{className:_.message,children:l.message})]},j))})}const A=50;function W(){const n=new Date;return`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}`}function Y(){const{level:n,status:t,error:o}=E(),[l,j]=i.useState(null),[k,f]=i.useState([]),g=i.useRef(null),u=i.useCallback((a,d)=>{f(x=>{const m=[...x,{timestamp:W(),message:a,type:d}];return m.length>A?m.slice(-A):m})},[]),h=i.useCallback(async()=>{try{const a=await w.get("/connection-info");j(a)}catch{j(null)}},[]),y=i.useCallback(async()=>{try{const a=await w.get("/api/dashboard/connection-log");f(a.entries??[])}catch{f([])}},[]),v=i.useCallback(async()=>{await w.post("/api/dashboard/connection-log/clear"),f([])},[]),S=i.useCallback(async a=>{await w.post("/api/dashboard/kill-agent",{instanceId:a}),await h()},[h]);return i.useEffect(()=>{n!=="disconnected"&&t&&h(),y()},[n,t,h,y]),i.useEffect(()=>{const a=new B;g.current=a,a.connect();const d=a.on("connection",m=>{const p=m,b=p.status==="connected"?"connected":"disconnected";u(`Plugin ${b} — ${p.clientId}`,p.status==="connected"?"info":"warn")}),x=a.on("mcp_status",m=>{const p=m,b=p.status==="registered"?"registered":"unregistered";u(`MCP ${b} — ${p.aiClientName}`,p.status==="registered"?"info":"warn"),h()});return()=>{d(),x(),a.disconnect(),g.current=null}},[u,h]),{status:t,connectionInfo:l,connectionLog:k,level:n,error:o,clearConnectionLog:v,killAgent:S}}const Z="_page_sf4qa_2",ee="_card_sf4qa_10",ne="_disabled_sf4qa_18",te="_cardHeader_sf4qa_24",se="_clearButton_sf4qa_37",ce="_serverGrid_sf4qa_47",oe="_statusRow_sf4qa_65",ie="_metaItem_sf4qa_72",ae="_table_sf4qa_79",le="_toggleBtn_sf4qa_104",re="_disconnected_sf4qa_119",de="_disconnectedActions_sf4qa_136",me="_btn_sf4qa_143",pe="_activity_active_sf4qa_161",he="_activity_stale_sf4qa_162",ge="_activity_unknown_sf4qa_163",ue="_killBtn_sf4qa_187",xe="_emptyRow_sf4qa_207",s={page:Z,card:ee,disabled:ne,cardHeader:te,clearButton:se,serverGrid:ce,statusRow:oe,metaItem:ie,table:ae,toggleBtn:le,disconnected:re,disconnectedActions:de,btn:me,activity_active:pe,activity_stale:he,activity_unknown:ge,killBtn:ue,emptyRow:xe};function N(n,t){const o=Math.max(0,Math.floor((Date.now()-n)/1e3));return o<60?`${o}${t("connection.time.secondsAgo","s ago")}`:o<3600?`${Math.floor(o/60)}${t("connection.time.minutesAgo","m ago")}`:`${Math.floor(o/3600)}${t("connection.time.hoursAgo","h ago")}`}function je(n){return n?Date.now()-n<3e4?"active":"stale":"unknown"}function Se(){var I;const{t:n}=R(),{status:t,connectionInfo:o,connectionLog:l,level:j,clearConnectionLog:k,killAgent:f}=Y(),{show:g}=P(),[u,h]=i.useState(!0),[y,v]=i.useState(!1),[S,a]=i.useState(!1),[d,x]=i.useState(null),[m,p]=i.useState(!1),b=F(t==null?void 0:t.uptime),C=j==="disconnected",L=C?"offline":"online",q=async()=>{if(d){p(!0);try{await f(d.instanceId),g(n("connection.agents.killed","Agent killed"),"success"),x(null)}catch{g(n("connection.agents.killFailed","Failed to kill agent"),"error")}finally{p(!1)}}},M=async()=>{a(!0);try{await k(),g(n("toast.clearSuccess","Cleared successfully"),"success"),v(!1)}catch{g(n("toast.clearFailed","Failed to clear data"),"error")}finally{a(!1)}};return e.jsxs("div",{className:s.page,children:[e.jsxs("div",{className:s.card,children:[e.jsx("div",{className:s.cardHeader,children:n("connection.server.title","Server Status")}),C?e.jsxs("div",{className:s.disconnected,children:[e.jsx("h3",{children:n("level.l0.title")}),e.jsx("p",{children:n("level.l0.message")}),e.jsx("p",{children:n("common.reconnecting")}),e.jsxs("div",{className:s.disconnectedActions,children:[e.jsx("button",{className:s.btn,onClick:()=>window.location.reload(),children:n("connection.reconnect","Reconnect")}),e.jsx("button",{className:s.btn,onClick:()=>{window.location.hash="#/settings"},children:n("connection.checkSettings","Check Settings")})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:s.statusRow,children:e.jsx(T,{status:L})}),e.jsxs("dl",{className:s.serverGrid,children:[(t==null?void 0:t.version)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(r,{label:n("connection.server.version","Version"),tooltip:n("connection.server.version.tooltip","Installed MCP server version")})}),e.jsx("dd",{children:e.jsx(D,{text:n("connection.server.version.tooltip","Installed MCP server version"),children:`v${t.version}`})})]}),(t==null?void 0:t.pid)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(r,{label:n("connection.server.pid","PID"),tooltip:n("connection.server.pid.tooltip","Operating system process identifier")})}),e.jsx("dd",{children:t.pid})]}),(t==null?void 0:t.uptime)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(r,{label:n("connection.server.uptime","Uptime"),tooltip:n("connection.server.uptime.tooltip","Time elapsed since the MCP server started")})}),e.jsx("dd",{children:H(b??t.uptime)})]}),(t==null?void 0:t.sessionId)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(r,{label:n("connection.server.session","Session"),tooltip:n("connection.server.session.tooltip","Current MCP session identifier")})}),e.jsx("dd",{children:t.sessionId.slice(0,8)})]}),(o==null?void 0:o.serverExecutable)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(r,{label:n("connection.server.exec","Exec"),tooltip:n("connection.server.exec.tooltip","Executable path used to launch the MCP server")})}),e.jsx("dd",{children:o.serverExecutable})]})]})]})]}),e.jsxs("div",{className:`${s.card} ${C?s.disabled:""}`,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsxs("span",{children:[n("connection.agents.title","AI Agents")," ","(",(o==null?void 0:o.mcpInstanceCount)??0,")"]}),e.jsx("button",{className:s.toggleBtn,onClick:()=>h(c=>!c),"aria-label":u?n("common.collapse","Collapse"):n("common.expand","Expand"),children:u?"▾":"▸"})]}),u&&e.jsxs("table",{className:s.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:n("connection.agents.name","Agent")}),e.jsx("th",{children:e.jsx(r,{label:n("connection.server.pid","PID"),tooltip:n("connection.server.pid.tooltip","Operating system process identifier")})}),e.jsx("th",{children:e.jsx(r,{label:n("connection.agents.projectRoot","Project Root"),tooltip:n("connection.agents.projectRoot.tooltip","Authoritative project root for sync ownership")})}),e.jsx("th",{children:n("connection.agents.connected","Connected")}),e.jsx("th",{children:e.jsx(r,{label:n("connection.agents.lastSeen","Last Seen"),tooltip:n("connection.agents.lastSeen.tooltip","Most recent heartbeat or activity from this agent")})}),e.jsx("th",{children:e.jsx(r,{label:n("connection.agents.lastCommand","Last Command"),tooltip:n("connection.agents.lastCommand.tooltip","Most recent tool call executed by this agent")})}),e.jsx("th",{})]})}),e.jsx("tbody",{children:o!=null&&o.mcpInstances&&o.mcpInstances.length>0?o.mcpInstances.map(c=>e.jsxs("tr",{children:[e.jsxs("td",{children:[e.jsx("span",{className:s[`activity_${je(c.lastSeen)}`]}),c.aiClientName??n("connection.agents.unknown","Unknown")]}),e.jsx("td",{children:c.pid}),e.jsx("td",{children:c.projectRoot??c.cwd??n("connection.agents.projectRoot.unresolved","Unresolved")}),e.jsx("td",{children:N(c.connectedAt,n)}),e.jsx("td",{children:c.lastSeen?N(c.lastSeen,n):"-"}),e.jsx("td",{children:c.lastCommandAt?N(c.lastCommandAt,n):"-"}),e.jsx("td",{children:!c.isServer&&e.jsx("button",{className:s.killBtn,onClick:()=>x({instanceId:c.instanceId,name:c.aiClientName??c.instanceId.slice(0,8)}),children:n("connection.agents.kill","Kill")})})]},c.instanceId)):e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:s.emptyRow,children:n("connection.agents.none","No agents connected")})})})]})]}),e.jsxs("div",{className:`${s.card} ${C?s.disabled:""}`,children:[e.jsxs("div",{className:s.cardHeader,children:[n("connection.plugins.title","Plugins")," ","(",((I=t==null?void 0:t.pluginClients)==null?void 0:I.length)??0,")"]}),e.jsxs("table",{className:s.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:n("connection.plugins.place","Place")}),e.jsx("th",{children:e.jsx(r,{label:n("connection.plugins.clientId","Client ID"),tooltip:n("connection.plugins.clientId.tooltip","Unique plugin client identifier for this Studio connection")})}),e.jsx("th",{children:e.jsx(r,{label:n("connection.plugins.lastSeen","Last Seen"),tooltip:n("connection.plugins.lastSeen.tooltip","Most recent heartbeat received from the plugin")})}),e.jsx("th",{children:e.jsx(r,{label:n("connection.plugins.version","Ver"),tooltip:n("connection.plugins.version.tooltip","Installed plugin version reported by Studio")})})]})}),e.jsx("tbody",{children:t!=null&&t.pluginClients&&t.pluginClients.length>0?t.pluginClients.map(c=>e.jsxs("tr",{children:[e.jsx("td",{children:c.placeName??c.projectName??"-"}),e.jsx("td",{children:c.clientId.slice(0,10)}),e.jsx("td",{children:N(c.lastSeen,n)}),e.jsx("td",{children:c.pluginVersion??"-"})]},c.clientId)):e.jsx("tr",{children:e.jsx("td",{colSpan:4,className:s.emptyRow,children:n("connection.plugins.none","No plugins connected")})})})]})]}),e.jsxs("div",{className:`${s.card} ${C?s.disabled:""}`,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsx("span",{children:n("connection.log.title","Connection Log")}),e.jsx("button",{className:s.clearButton,onClick:()=>v(!0),children:n("common.clear","Clear")})]}),e.jsx(Q,{entries:l})]}),e.jsx($,{open:y,title:n("connection.clear.title","Clear connection log?"),message:n("connection.clear.message","This permanently removes the stored connection log for the current project."),cancelLabel:n("common.cancel","Cancel"),confirmLabel:n("common.clear","Clear"),loading:S,onCancel:()=>!S&&v(!1),onConfirm:M}),e.jsx($,{open:!!d,title:n("connection.agents.kill.title","Kill agent?"),message:`"${d==null?void 0:d.name}" 프로세스를 강제 종료합니다. 해당 에이전트의 진행 중인 작업이 중단됩니다.`,cancelLabel:n("common.cancel","Cancel"),confirmLabel:n("connection.agents.kill","Kill"),loading:m,onCancel:()=>!m&&x(null),onConfirm:q})]})}export{Se as Component};
@@ -1 +0,0 @@
1
- ._container_1h084_2{max-height:200px;overflow-y:auto;font-family:var(--font-code);font-size:12px;line-height:1.6;padding:8px 12px;background:var(--bg-secondary);border-radius:4px}._entry_1h084_14{display:flex;gap:8px;white-space:nowrap}._timestamp_1h084_21{color:var(--text-muted);flex-shrink:0}._message_1h084_27{color:var(--text-primary);overflow:hidden;text-overflow:ellipsis}._warn_1h084_34 ._message_1h084_27{color:var(--warning)}._error_1h084_39 ._message_1h084_27{color:var(--error)}._empty_1h084_44{color:var(--text-muted);font-style:italic;padding:8px 0}._page_sf4qa_2{display:flex;flex-direction:column;gap:16px;max-width:820px}._card_sf4qa_10{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._disabled_sf4qa_18{opacity:.4;pointer-events:none}._cardHeader_sf4qa_24{font-family:var(--font-label);font-weight:500;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-secondary);margin-bottom:12px;display:flex;align-items:center;justify-content:space-between}._clearButton_sf4qa_37{border:1px solid var(--error-border);background:var(--error-bg);color:var(--error-text);border-radius:var(--radius-sm);padding:6px 12px;cursor:pointer}._serverGrid_sf4qa_47{display:grid;grid-template-columns:auto 1fr;gap:4px 16px;font-family:var(--font-code);font-size:13px}._serverGrid_sf4qa_47 dt{color:var(--text-muted)}._serverGrid_sf4qa_47 dd{color:var(--text-primary);margin:0}._statusRow_sf4qa_65{display:flex;align-items:center;gap:16px;margin-bottom:12px}._metaItem_sf4qa_72{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._table_sf4qa_79{width:100%;border-collapse:collapse;font-family:var(--font-code);font-size:12px}._table_sf4qa_79 th{text-align:left;color:var(--text-muted);font-weight:400;padding:4px 8px 4px 0;border-bottom:1px solid var(--border)}._table_sf4qa_79 td{padding:6px 8px 6px 0;color:var(--text-primary)}._table_sf4qa_79 tr:hover td{background:var(--accent-dim)}._toggleBtn_sf4qa_104{background:none;border:none;color:var(--text-secondary);cursor:pointer;font-size:12px;padding:0 4px;transition:color var(--transition)}._toggleBtn_sf4qa_104:hover{color:var(--accent)}._disconnected_sf4qa_119{text-align:center;padding:32px 16px}._disconnected_sf4qa_119 h3{color:var(--error);font-size:16px;margin:0 0 8px}._disconnected_sf4qa_119 p{color:var(--text-secondary);font-size:13px;margin:0 0 4px}._disconnectedActions_sf4qa_136{display:flex;gap:8px;justify-content:center;margin-top:16px}._btn_sf4qa_143{font-family:var(--font-label);font-size:12px;padding:6px 14px;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._btn_sf4qa_143:hover{border-color:var(--accent);background:var(--accent-dim)}._activity_active_sf4qa_161,._activity_stale_sf4qa_162,._activity_unknown_sf4qa_163{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:6px;vertical-align:middle}._activity_active_sf4qa_161{background:var(--success, #4ade80);box-shadow:0 0 4px var(--success, #4ade80)}._activity_stale_sf4qa_162{background:var(--text-muted, #666)}._activity_unknown_sf4qa_163{background:var(--text-muted, #666);opacity:.4}._killBtn_sf4qa_187{font-family:var(--font-label);font-size:11px;padding:3px 10px;border-radius:var(--radius-sm);border:1px solid var(--error-border);background:var(--error-bg);color:var(--error-text);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._killBtn_sf4qa_187:hover{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text);filter:brightness(1.15)}._emptyRow_sf4qa_207{color:var(--text-muted);font-style:italic}
@@ -1,11 +0,0 @@
1
- import{r as n,a as v,u as S,j as e,k as H,l as D,m as E,o as U}from"./index-FfT2oWAB.js";import{D as $,T as O}from"./TierComparison-Dyf-knpe.js";import{I as P}from"./InfoLabel-B9KT3kfU.js";import{T as _}from"./TooltipText-Baw38jOU.js";import{C as F}from"./ConfirmModal-CmJCz5rg.js";const W=5e3;function V(t){const r=(t==null?void 0:t.enabled)??!0,[d,o]=n.useState([]),[a,l]=n.useState(null),[m,i]=n.useState(r),c=n.useRef(null),h=n.useCallback(async()=>{try{const x=await v.get("/api/dashboard/playtest/history");o(x.entries??[])}catch{}},[]),p=n.useCallback(async()=>{if(!r){i(!1);return}await h(),i(!1)},[r,h]),y=n.useCallback(async()=>{r&&(await v.post("/api/dashboard/playtest/history/clear"),o([]),l(null))},[r]),j=n.useCallback(async x=>{if(r)try{const w=await v.get(`/api/dashboard/playtest/report/${x}`);l(w)}catch{l(null)}},[r]);return n.useEffect(()=>{if(!r){i(!1);return}return p(),c.current=setInterval(p,W),()=>{c.current&&clearInterval(c.current)}},[r,p]),{history:d,selectedReport:a,loading:m,loadReport:j,clearHistory:y}}function Y(t){const r="2026-03-27T15:26:00.000Z",d={testScenario:t("playtest.sample.context.why","Spawn into the arena, survive the opener, and verify the HUD responds immediately."),expectedBehavior:t("playtest.sample.context.expected","The player spawns safely, the countdown UI appears within one second, and the first wave starts without errors."),observedBehavior:t("playtest.sample.context.observed","Spawn protection held, the HUD updated on time, and wave one completed with no gameplay regressions.")};return{history:[{timestamp:r,testName:t("playtest.sample.history.name","Sample Arena Smoke Test"),mode:"play",status:"passed",durationMs:4820,contextId:"sample_playtest_preview",contextSummary:d}],report:{markdown:t("playtest.sample.report.markdown",`# Sample Arena Smoke Test
2
-
3
- - Spawn flow: PASS
4
- - HUD countdown: PASS
5
- - Wave bootstrap: PASS
6
-
7
- This is a sample preview. Upgrade to Pro to save and review real automated playtest reports.`),logs:t("playtest.sample.report.logs",`[sample] boot playtest preview
8
- [sample] spawn protection active
9
- [sample] hud countdown rendered
10
- [sample] wave one completed
11
- [sample] preview report finished`),contextId:"sample_playtest_preview",contextSummary:d}}}const z="_page_wjm6d_2",G="_sampleBanner_wjm6d_9",Z="_sampleBannerRow_wjm6d_21",q="_sampleBannerMain_wjm6d_28",J="_sampleBadge_wjm6d_35",K="_sampleTitle_wjm6d_50",Q="_sampleMessage_wjm6d_57",X="_sampleActions_wjm6d_64",ee="_primaryAction_wjm6d_72",te="_secondaryAction_wjm6d_73",se="_card_wjm6d_109",ae="_cardHeader_wjm6d_116",re="_clearButton_wjm6d_128",oe="_statusRow_wjm6d_143",ne="_statusIndicator_wjm6d_150",le="_statusRunning_wjm6d_158",ie="_statusPaused_wjm6d_163",ce="_statusNotRunning_wjm6d_167",de="_statusLabel_wjm6d_171",me="_statusMeta_wjm6d_178",pe="_controlButtons_wjm6d_184",ue="_btn_wjm6d_191",he="_btnPrimary_wjm6d_213",ye="_btnDanger_wjm6d_223",_e="_historyList_wjm6d_233",xe="_historyItem_wjm6d_241",je="_historyItemSelected_wjm6d_260",we="_historyItemHeader_wjm6d_265",ge="_historyIcon_wjm6d_271",ve="_historyTimestamp_wjm6d_276",Se="_historyName_wjm6d_283",fe="_historyItemMeta_wjm6d_293",be="_historyMode_wjm6d_302",Ne="_historyDuration_wjm6d_306",Ce="_historyStatus_wjm6d_310",Le="_status_passed_wjm6d_317",Ie="_status_failed_wjm6d_321",Pe="_status_running_wjm6d_325",Re="_historyError_wjm6d_329",Be="_historyContext_wjm6d_339",Te="_historyContextLine_wjm6d_348",Me="_historyContextLabel_wjm6d_354",ke="_reportContainer_wjm6d_363",Ae="_reportContextPanel_wjm6d_369",He="_reportContextRow_wjm6d_379",De="_reportContextLabel_wjm6d_387",Ee="_reportSection_wjm6d_395",Ue="_reportSectionHeader_wjm6d_401",$e="_reportMarkdown_wjm6d_413",Oe="_reportLogs_wjm6d_426",Fe="_emptyState_wjm6d_441",We="_emptyStateTitle_wjm6d_448",Ve="_emptyStateMessage_wjm6d_456",Ye="_upgradePanel_wjm6d_465",ze="_upgradePanelIcon_wjm6d_473",Ge="_upgradePanelTitle_wjm6d_478",Ze="_upgradePanelDesc_wjm6d_486",qe="_benefitList_wjm6d_496",Je="_benefitItem_wjm6d_507",Ke="_upgradeActions_wjm6d_522",s={page:z,sampleBanner:G,sampleBannerRow:Z,sampleBannerMain:q,sampleBadge:J,sampleTitle:K,sampleMessage:Q,sampleActions:X,primaryAction:ee,secondaryAction:te,card:se,cardHeader:ae,clearButton:re,statusRow:oe,statusIndicator:ne,statusRunning:le,statusPaused:ie,statusNotRunning:ce,statusLabel:de,statusMeta:me,controlButtons:pe,btn:ue,btnPrimary:he,btnDanger:ye,historyList:_e,historyItem:xe,historyItemSelected:je,historyItemHeader:we,historyIcon:ge,historyTimestamp:ve,historyName:Se,historyItemMeta:fe,historyMode:be,historyDuration:Ne,historyStatus:Ce,status_passed:Le,status_failed:Ie,status_running:Pe,historyError:Re,historyContext:Be,historyContextLine:Te,historyContextLabel:Me,reportContainer:ke,reportContextPanel:Ae,reportContextRow:He,reportContextLabel:De,reportSection:Ee,reportSectionHeader:Ue,reportMarkdown:$e,reportLogs:Oe,emptyState:Fe,emptyStateTitle:We,emptyStateMessage:Ve,upgradePanel:Ye,upgradePanelIcon:ze,upgradePanelTitle:Ge,upgradePanelDesc:Ze,benefitList:qe,benefitItem:Je,upgradeActions:Ke};function g(t){return t.trim().toLowerCase()}function Qe(t){switch(g(t)){case"passed":return"✅";case"failed":return"❌";case"running":return"⏱";default:return"❓"}}function Xe(t,r){switch(g(r)){case"run":return t("playtest.status.mode.run","Run");case"server":return t("playtest.status.mode.server","Server");case"edit":return t("playtest.status.mode.edit","Edit");case"play":return t("playtest.status.mode.play","Play");default:return r}}function et(t,r){switch(g(r)){case"passed":return t("playtest.history.status.passed","Passed");case"failed":return t("playtest.history.status.failed","Failed");case"running":return t("playtest.history.status.running","Running");default:return t("playtest.history.status.unknown","Unknown")}}function tt(t){return t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function st({entries:t,onSelect:r,selectedTimestamp:d}){const{t:o}=S();return t.length===0?e.jsx("div",{className:s.emptyState,children:o("playtest.history.empty","No test results yet")}):e.jsx("div",{className:s.historyList,children:t.map(a=>{var m,i,c,h,p,y;const l=a.timestamp===d;return e.jsxs("button",{className:`${s.historyItem} ${l?s.historyItemSelected:""}`,onClick:()=>r(a.timestamp),children:[e.jsxs("div",{className:s.historyItemHeader,children:[e.jsx("span",{className:s.historyIcon,children:Qe(a.status)}),e.jsx("span",{className:s.historyTimestamp,children:a.timestamp}),e.jsx("span",{className:s.historyName,children:a.testName})]}),e.jsxs("div",{className:s.historyItemMeta,children:[e.jsx(_,{text:o("playtest.history.mode.tooltip","Playtest mode used for this recorded test run."),children:e.jsxs("span",{className:s.historyMode,children:[o("playtest.history.mode","Mode"),": ",Xe(o,a.mode)]})}),e.jsx("span",{className:s.historyDuration,children:tt(a.durationMs)}),e.jsx(_,{text:o("playtest.history.status.tooltip","Recorded result state for this automated playtest run."),children:e.jsx("span",{className:`${s.historyStatus} ${s[`status_${g(a.status)}`]??""}`,children:et(o,a.status)})})]}),a.errorMessage&&e.jsx("div",{className:s.historyError,children:a.errorMessage}),(a.contextId||((m=a.contextSummary)==null?void 0:m.testScenario)||((i=a.contextSummary)==null?void 0:i.expectedBehavior)||((c=a.contextSummary)==null?void 0:c.observedBehavior))&&e.jsxs("div",{className:s.historyContext,children:[a.contextId&&e.jsxs("div",{className:s.historyContextLine,children:[e.jsx("span",{className:s.historyContextLabel,children:o("playtest.context.contextId","Context ID")}),e.jsx("span",{children:a.contextId})]}),((h=a.contextSummary)==null?void 0:h.testScenario)&&e.jsxs("div",{className:s.historyContextLine,children:[e.jsx("span",{className:s.historyContextLabel,children:o("playtest.context.why","Why this test ran")}),e.jsx("span",{children:a.contextSummary.testScenario})]}),((p=a.contextSummary)==null?void 0:p.expectedBehavior)&&e.jsxs("div",{className:s.historyContextLine,children:[e.jsx("span",{className:s.historyContextLabel,children:o("playtest.context.expected","Expected")}),e.jsx("span",{children:a.contextSummary.expectedBehavior})]}),((y=a.contextSummary)==null?void 0:y.observedBehavior)&&e.jsxs("div",{className:s.historyContextLine,children:[e.jsx("span",{className:s.historyContextLabel,children:o("playtest.context.observed","Observed")}),e.jsx("span",{children:a.contextSummary.observedBehavior})]})]})]},a.timestamp)})})}function at({report:t}){var o,a,l,m,i,c;const{t:r}=S(),d=!!((o=t.contextSummary)!=null&&o.testScenario||(a=t.contextSummary)!=null&&a.expectedBehavior||(l=t.contextSummary)!=null&&l.observedBehavior);return e.jsxs("div",{className:s.reportContainer,children:[d&&e.jsxs("div",{className:s.reportContextPanel,children:[((m=t.contextSummary)==null?void 0:m.testScenario)&&e.jsxs("div",{className:s.reportContextRow,children:[e.jsx("span",{className:s.reportContextLabel,children:r("playtest.context.why","Why this test ran")}),e.jsx("span",{children:t.contextSummary.testScenario})]}),((i=t.contextSummary)==null?void 0:i.expectedBehavior)&&e.jsxs("div",{className:s.reportContextRow,children:[e.jsx("span",{className:s.reportContextLabel,children:r("playtest.context.expected","Expected")}),e.jsx("span",{children:t.contextSummary.expectedBehavior})]}),((c=t.contextSummary)==null?void 0:c.observedBehavior)&&e.jsxs("div",{className:s.reportContextRow,children:[e.jsx("span",{className:s.reportContextLabel,children:r("playtest.context.observed","Observed")}),e.jsx("span",{children:t.contextSummary.observedBehavior})]})]}),t.markdown&&e.jsxs("div",{className:s.reportSection,children:[e.jsx("div",{className:s.reportSectionHeader,children:e.jsx(_,{text:r("playtest.report.content.tooltip","Markdown summary for the selected automated playtest run."),children:e.jsx("span",{children:r("playtest.report.content","Report")})})}),e.jsx("pre",{className:s.reportMarkdown,children:t.markdown})]}),t.logs&&e.jsxs("div",{className:s.reportSection,children:[e.jsx("div",{className:s.reportSectionHeader,children:e.jsx(_,{text:r("playtest.report.logs.tooltip","Execution logs captured for the selected automated playtest run."),children:e.jsx("span",{children:r("playtest.report.logs","Logs")})})}),e.jsx("pre",{className:s.reportLogs,children:t.logs})]}),!t.markdown&&!t.logs&&e.jsx("div",{className:s.emptyState,children:r("playtest.report.empty","No report content available")})]})}function ct(){var L;const{t}=S(),{trackEvent:r}=H(),{tier:d,loading:o}=D(),a=!o&&d==="basic",l=V({enabled:!a}),{show:m}=E(),[i,c]=n.useState(null),[h,p]=n.useState(!1),[y,j]=n.useState(!1),[x,w]=n.useState(!1),{history:R,selectedReport:B,loading:T}=l,u=a?Y(t):null,f=((L=u==null?void 0:u.history[0])==null?void 0:L.timestamp)??null,b=a?i??f:i,N=(u==null?void 0:u.history)??R,C=u&&b===f?u.report:B,M=a?!1:T,k=I=>{c(I),!a&&l.loadReport(I)},A=async()=>{j(!0);try{await l.clearHistory(),m(t("toast.clearSuccess","Cleared successfully"),"success"),p(!1),c(null)}catch{m(t("toast.clearFailed","Failed to clear data"),"error")}finally{j(!1)}};return e.jsxs("div",{className:s.page,children:[a&&e.jsxs("div",{className:s.sampleBanner,children:[e.jsxs("div",{className:s.sampleBannerRow,children:[e.jsxs("div",{className:s.sampleBannerMain,children:[e.jsx("div",{className:s.sampleBadge,children:t("playtest.sample.badge","Preview of the Pro playtest view")}),e.jsx("div",{className:s.sampleTitle,children:t("playtest.sample.title","You are previewing the report viewer that becomes available after upgrading to Pro.")}),e.jsx("div",{className:s.sampleMessage,children:t("playtest.sample.message","This preview uses sample data. Real playtest history management and stored reports unlock with Pro.")})]}),e.jsxs("div",{className:s.sampleActions,children:[e.jsx("button",{className:s.secondaryAction,onClick:()=>{r("dashboard_click_event",{click_target:"tier_compare",placement:"playtest_sample_banner",page:"playtest"}),w(!0)},children:t("tier.compare","Basic vs Pro")}),e.jsx("a",{className:s.primaryAction,href:U.playtest,target:"_blank",rel:"noreferrer",onClick:()=>r("dashboard_click_event",{click_target:"upgrade_cta",placement:"playtest_sample_banner",page:"playtest"}),children:t("tier.upgrade","Upgrade to Pro")})]})]}),e.jsx($,{variant:"centered"})]}),e.jsxs("div",{className:s.card,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsx(P,{label:t("playtest.history.title","Test History"),tooltip:t("playtest.history.title.tooltip","Recorded automated playtest runs for this project.")}),a?e.jsx(_,{text:t("playtest.sample.clearDisabled","Upgrade to Pro to clear live playtest history."),children:e.jsx("span",{children:e.jsx("button",{className:s.clearButton,disabled:!0,children:t("common.clear","Clear")})})}):e.jsx("button",{className:s.clearButton,onClick:()=>p(!0),children:t("common.clear","Clear")})]}),M?e.jsx("div",{className:s.emptyState,children:t("common.loading","Loading...")}):N.length===0?e.jsxs("div",{className:s.emptyState,children:[e.jsx("div",{className:s.emptyStateTitle,children:t("playtest.empty.title","No playtest results yet")}),e.jsxs("div",{className:s.emptyStateMessage,children:[t("playtest.empty.message.before","Test results will appear here when the AI agent runs automated tests via")," ",e.jsx(_,{text:t("playtest.empty.runTest.tooltip","WEPPY Dashboard automation entry point that runs Roblox playtest checks through the system_info tool."),children:e.jsx("span",{children:"system_info.run_test"})}),t("playtest.empty.message.after",".")]})]}):e.jsx(st,{entries:N,onSelect:k,selectedTimestamp:b??void 0})]}),C&&e.jsxs("div",{className:s.card,children:[e.jsx("div",{className:s.cardHeader,children:e.jsx(P,{label:t("playtest.report.title","Selected Report"),tooltip:t("playtest.report.title.tooltip","Detailed output for the currently selected automated playtest run.")})}),e.jsx(at,{report:C})]}),!a&&e.jsx(F,{open:h,title:t("playtest.clear.title","Clear test history?"),message:t("playtest.clear.message","This permanently removes the stored playtest reports for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:y,onCancel:()=>!y&&p(!1),onConfirm:A}),x&&e.jsx(O,{onClose:()=>w(!1)})]})}export{ct as Component};
@@ -1 +0,0 @@
1
- ._page_wjm6d_2{display:flex;flex-direction:column;gap:16px;max-width:900px}._sampleBanner_wjm6d_9{display:flex;flex-direction:column;gap:12px;padding:18px 20px;border:1px solid var(--pro-border);border-radius:var(--radius);background:linear-gradient(135deg,#f0bd5829,#f0bd5808 55%),var(--bg-card)}._sampleBannerRow_wjm6d_21{display:flex;align-items:center;justify-content:space-between;gap:20px}._sampleBannerMain_wjm6d_28{display:flex;flex-direction:column;gap:8px;min-width:0}._sampleBadge_wjm6d_35{width:fit-content;padding:0;border-radius:0;background:none;border:none;color:var(--pro-text);font-family:var(--font-label);font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:none;opacity:.92}._sampleTitle_wjm6d_50{font-family:var(--font-label);font-size:16px;font-weight:600;color:var(--text-primary)}._sampleMessage_wjm6d_57{max-width:560px;color:var(--text-secondary);font-size:13px;line-height:1.5}._sampleActions_wjm6d_64{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}._primaryAction_wjm6d_72,._secondaryAction_wjm6d_73{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:0 14px;border-radius:8px;font-family:var(--font-label);font-size:12px;text-decoration:none;transition:background var(--transition),border-color var(--transition),opacity var(--transition)}._secondaryAction_wjm6d_73{border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer}._secondaryAction_wjm6d_73:hover{border-color:var(--accent);background:var(--accent-dim)}._primaryAction_wjm6d_72{border:1px solid var(--pro-badge);background:var(--pro-badge);color:#1a1407}._primaryAction_wjm6d_72:hover{opacity:.9}._card_wjm6d_109{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._cardHeader_wjm6d_116{font-family:var(--font-label);font-size:13px;font-weight:600;color:var(--text-primary);margin-bottom:12px;display:flex;align-items:center;justify-content:space-between;gap:8px}._clearButton_wjm6d_128{border:1px solid rgba(209,84,84,.5);background:#d154541f;color:#f4c1c1;border-radius:8px;padding:6px 12px;cursor:pointer}._clearButton_wjm6d_128:disabled{cursor:not-allowed;opacity:.55}._statusRow_wjm6d_143{display:flex;align-items:center;gap:12px;margin-bottom:8px}._statusIndicator_wjm6d_150{display:inline-block;width:8px;height:8px;border-radius:50%;flex-shrink:0}._statusRunning_wjm6d_158{background:var(--success);box-shadow:0 0 6px var(--success)}._statusPaused_wjm6d_163{background:var(--warning)}._statusNotRunning_wjm6d_167{background:var(--text-muted)}._statusLabel_wjm6d_171{font-family:var(--font-code);font-size:13px;font-weight:600;color:var(--text-primary)}._statusMeta_wjm6d_178{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._controlButtons_wjm6d_184{display:flex;gap:8px;margin-top:12px}._btn_wjm6d_191{font-family:var(--font-label);font-size:12px;padding:6px 14px;border-radius:4px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._btn_wjm6d_191:hover{border-color:var(--accent);background:var(--accent-dim)}._btn_wjm6d_191:disabled{opacity:.4;pointer-events:none}._btnPrimary_wjm6d_213{background:var(--accent);color:var(--bg-card);border-color:var(--accent)}._btnPrimary_wjm6d_213:hover{opacity:.9}._btnDanger_wjm6d_223{border-color:var(--error);color:var(--error)}._btnDanger_wjm6d_223:hover{background:#ef44441a}._historyList_wjm6d_233{display:flex;flex-direction:column;gap:4px;max-height:320px;overflow-y:auto}._historyItem_wjm6d_241{display:flex;flex-direction:column;gap:4px;padding:8px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);cursor:pointer;text-align:left;width:100%;font-family:inherit;transition:border-color var(--transition)}._historyItem_wjm6d_241:hover{border-color:var(--accent)}._historyItemSelected_wjm6d_260{border-color:var(--accent);background:var(--accent-dim)}._historyItemHeader_wjm6d_265{display:flex;align-items:center;gap:8px}._historyIcon_wjm6d_271{font-size:14px;flex-shrink:0}._historyTimestamp_wjm6d_276{font-family:var(--font-code);font-size:11px;color:var(--text-muted);flex-shrink:0}._historyName_wjm6d_283{font-family:var(--font-label);font-size:12px;font-weight:500;color:var(--text-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._historyItemMeta_wjm6d_293{display:flex;gap:12px;font-family:var(--font-code);font-size:11px;color:var(--text-secondary);padding-left:22px}._historyMode_wjm6d_302{color:var(--text-muted)}._historyDuration_wjm6d_306{color:var(--text-secondary)}._historyStatus_wjm6d_310{font-weight:500;text-transform:uppercase;font-size:10px;letter-spacing:.04em}._status_passed_wjm6d_317{color:var(--success)}._status_failed_wjm6d_321{color:var(--error)}._status_running_wjm6d_325{color:var(--accent)}._historyError_wjm6d_329{font-family:var(--font-code);font-size:11px;color:var(--error);padding-left:22px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._historyContext_wjm6d_339{display:flex;flex-direction:column;gap:4px;padding-left:22px;color:var(--text-secondary);font-size:11px}._historyContextLine_wjm6d_348{display:flex;flex-direction:column;gap:2px}._historyContextLabel_wjm6d_354{font-family:var(--font-label);font-size:10px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em}._reportContainer_wjm6d_363{display:flex;flex-direction:column;gap:12px}._reportContextPanel_wjm6d_369{display:flex;flex-direction:column;gap:10px;padding:12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-secondary)}._reportContextRow_wjm6d_379{display:flex;flex-direction:column;gap:4px;color:var(--text-primary);font-size:12px}._reportContextLabel_wjm6d_387{font-family:var(--font-label);font-size:10px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em}._reportSection_wjm6d_395{border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}._reportSectionHeader_wjm6d_401{font-family:var(--font-label);font-size:11px;font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.06em;padding:6px 12px;background:var(--bg-secondary);border-bottom:1px solid var(--border)}._reportMarkdown_wjm6d_413{padding:12px;margin:0;font-family:var(--font-code);font-size:12px;line-height:1.6;color:var(--text-primary);white-space:pre-wrap;word-break:break-word;max-height:400px;overflow-y:auto}._reportLogs_wjm6d_426{padding:12px;margin:0;font-family:var(--font-code);font-size:11px;line-height:1.5;color:var(--text-secondary);white-space:pre-wrap;word-break:break-word;max-height:240px;overflow-y:auto;background:var(--bg-secondary)}._emptyState_wjm6d_441{text-align:center;padding:32px 16px;color:var(--text-muted);font-size:13px}._emptyStateTitle_wjm6d_448{font-family:var(--font-label);font-size:14px;font-weight:600;color:var(--text-secondary);margin-bottom:8px}._emptyStateMessage_wjm6d_456{font-size:12px;color:var(--text-muted);max-width:360px;margin:0 auto;line-height:1.5}._upgradePanel_wjm6d_465{background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius);padding:32px 24px;text-align:center}._upgradePanelIcon_wjm6d_473{font-size:32px;margin-bottom:12px}._upgradePanelTitle_wjm6d_478{font-family:var(--font-label);font-size:15px;font-weight:600;color:var(--text-primary);margin-bottom:8px}._upgradePanelDesc_wjm6d_486{font-size:13px;color:var(--text-secondary);margin-bottom:16px;max-width:400px;margin-left:auto;margin-right:auto;line-height:1.5}._benefitList_wjm6d_496{list-style:none;padding:0;margin:0 auto 16px;display:flex;flex-direction:column;gap:4px;max-width:360px;text-align:left}._benefitItem_wjm6d_507{font-size:12px;color:var(--text-secondary);padding-left:16px;position:relative}._benefitItem_wjm6d_507:before{content:"+";position:absolute;left:0;color:var(--accent);font-weight:600}._upgradeActions_wjm6d_522{display:flex;gap:8px;justify-content:center}@media(max-width:720px){._sampleBannerRow_wjm6d_21{flex-direction:column;align-items:stretch}._sampleActions_wjm6d_64{justify-content:stretch}._primaryAction_wjm6d_72,._secondaryAction_wjm6d_73{width:100%}}
@@ -1 +0,0 @@
1
- ._card_83d0e_4{border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);padding:16px 20px;display:flex;flex-direction:column;gap:14px}._cardEmbedded_83d0e_14{border:none;border-radius:0;background:transparent;padding:14px 0 0}._cardTitle_83d0e_21{margin:0;font-size:13px;font-weight:600;color:var(--text-primary);letter-spacing:.02em}._usageRow_83d0e_30{display:flex;flex-direction:column;gap:4px}._usageTotal_83d0e_36{font-size:13px;font-weight:600;color:var(--text-primary)}._usageBreakdown_83d0e_42{font-size:12px;color:var(--text-muted)}._usageCounts_83d0e_47{font-size:12px;color:var(--text-secondary)}._divider_83d0e_53{border:none;border-top:1px solid var(--border);margin:0}._lastRunRow_83d0e_60{font-size:12px;color:var(--text-secondary);display:flex;align-items:center;gap:6px;flex-wrap:wrap}._lastRunLabel_83d0e_69{color:var(--text-muted);font-weight:500;white-space:nowrap}._errorIcon_83d0e_75{color:var(--error-text, #e05555);cursor:help;font-size:13px;line-height:1;position:relative}._errorIcon_83d0e_75:hover ._tooltip_83d0e_83{display:block}._tooltip_83d0e_83{display:none;position:absolute;bottom:calc(100% + 6px);left:50%;transform:translate(-50%);background:var(--bg-secondary);border:1px solid var(--border);border-radius:4px;padding:4px 8px;font-size:11px;color:var(--error-text, #e05555);white-space:nowrap;z-index:10;pointer-events:none;box-shadow:0 2px 8px #0003}._cleanupRow_83d0e_106{display:flex;flex-wrap:wrap;gap:8px;align-items:center}._cleanupLabel_83d0e_113{font-size:12px;color:var(--text-muted);font-weight:500;white-space:nowrap}._cleanupBtn_83d0e_120{padding:5px 10px;border-radius:5px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-secondary);font-family:var(--font-label);font-size:11px;cursor:pointer;white-space:nowrap;transition:border-color var(--transition),color var(--transition)}._cleanupBtn_83d0e_120:hover:not(:disabled){border-color:var(--accent);color:var(--text-primary)}._cleanupBtn_83d0e_120:disabled{opacity:.45;cursor:not-allowed}._cleanupBtnDanger_83d0e_143{border-color:var(--error-border, rgba(224, 85, 85, .4));color:var(--error-text, #e05555)}._cleanupBtnDanger_83d0e_143:hover:not(:disabled){border-color:var(--error-text, #e05555);background:var(--error-bg, rgba(224, 85, 85, .08));color:var(--error-text, #e05555)}._retentionSection_83d0e_155{display:flex;flex-direction:column;gap:10px}._retentionTitle_83d0e_161{margin:0;font-size:12px;font-weight:600;color:var(--text-muted);letter-spacing:.04em;text-transform:uppercase}._retentionFieldset_83d0e_170{display:flex;flex-direction:column;gap:10px;border:none;margin:0;padding:0;position:relative}._retentionFieldset_83d0e_170[disabled]{opacity:.5;pointer-events:none}._proOverlay_83d0e_185{position:absolute;top:0;right:0;bottom:0;left:0;cursor:not-allowed;z-index:1}._proOverlay_83d0e_185:hover ._tooltip_83d0e_83{display:block}._radioRow_83d0e_197{display:flex;align-items:center;gap:8px;flex-wrap:wrap}._radioLabel_83d0e_204{display:flex;align-items:center;gap:5px;font-size:13px;color:var(--text-secondary);cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap}._radioLabel_83d0e_204 input[type=radio]{width:14px;height:14px;cursor:pointer;accent-color:var(--accent);flex-shrink:0}._presetGroup_83d0e_224{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-left:20px}._presetBtn_83d0e_232{padding:3px 8px;border-radius:4px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-secondary);font-family:var(--font-label);font-size:11px;cursor:pointer;transition:border-color var(--transition),background var(--transition)}._presetBtn_83d0e_232:hover{border-color:var(--accent);color:var(--text-primary)}._presetBtnActive_83d0e_249{border-color:var(--accent);background:var(--accent-dim);color:var(--accent);font-weight:600}._freeInput_83d0e_256{width:72px;font-size:12px;padding:3px 7px;border:1px solid var(--border);border-radius:4px;background:var(--bg-secondary);color:var(--text-primary);font-family:inherit}._freeInput_83d0e_256:focus{outline:none;border-color:var(--accent)}._freeInput_83d0e_256._inputError_83d0e_272{border-color:var(--error-text, #e05555)}._inputUnit_83d0e_276{font-size:11px;color:var(--text-muted);white-space:nowrap}._cascadeRow_83d0e_283{display:flex;align-items:center;gap:7px;font-size:13px;color:var(--text-secondary);cursor:pointer;-webkit-user-select:none;user-select:none}._cascadeRow_83d0e_283 input[type=checkbox]{width:14px;height:14px;cursor:pointer;accent-color:var(--accent);flex-shrink:0}._retentionActions_83d0e_302{display:flex;gap:8px;flex-wrap:wrap}._saveBtn_83d0e_308{padding:6px 14px;border-radius:5px;border:1px solid transparent;background:var(--accent);color:var(--bg-card);font-family:var(--font-label);font-size:12px;font-weight:600;cursor:pointer;transition:opacity var(--transition)}._saveBtn_83d0e_308:hover:not(:disabled){opacity:.88}._saveBtn_83d0e_308:disabled{opacity:.45;cursor:not-allowed}._runNowBtn_83d0e_330{padding:6px 14px;border-radius:5px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-secondary);font-family:var(--font-label);font-size:12px;cursor:pointer;transition:border-color var(--transition),color var(--transition)}._runNowBtn_83d0e_330:hover:not(:disabled){border-color:var(--accent);color:var(--text-primary)}._runNowBtn_83d0e_330:disabled{opacity:.45;cursor:not-allowed}._errorMsg_83d0e_353{font-size:12px;color:var(--error-text, #e05555);padding:4px 0}._page_1uhow_2{display:flex;flex-direction:column;gap:16px;max-width:820px}._card_1uhow_10{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._licenseCardPro_1uhow_17{border-color:var(--pro-border);background:linear-gradient(180deg,var(--pro-bg-soft),transparent 28%),var(--bg-card);box-shadow:inset 0 1px #f3d46b2e,0 0 0 1px #8f6f1f24}._cardHeader_1uhow_28{font-family:var(--font-label);font-weight:500;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-secondary);margin-bottom:12px;display:flex;align-items:center;justify-content:space-between}._cardHeaderActions_1uhow_41{display:flex;align-items:center;gap:8px}._collapseButton_1uhow_47{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border);border-radius:4px;background:var(--bg-secondary);color:var(--text-secondary);font-size:12px;line-height:1;cursor:pointer;transition:border-color var(--transition),color var(--transition),background var(--transition)}._collapseButton_1uhow_47:hover{border-color:var(--accent);color:var(--text-primary)}._headerBadge_1uhow_69{font-size:10px;font-weight:400;padding:2px 8px;border-radius:4px;border:1px solid var(--border);color:var(--text-muted);text-transform:none;letter-spacing:0}._headerBadgeLive_1uhow_80{color:var(--success);border-color:var(--success)}._licenseGrid_1uhow_86{display:grid;grid-template-columns:auto 1fr;gap:6px 16px;font-family:var(--font-code);font-size:13px}._licenseGrid_1uhow_86 dt{color:var(--text-muted)}._licenseGrid_1uhow_86 dd{color:var(--text-primary);margin:0}._statusDot_1uhow_104{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px;vertical-align:middle}._statusActive_1uhow_113{background:var(--success);box-shadow:0 0 4px var(--success)}._statusGrace_1uhow_118{background:var(--warning, #b7791f);box-shadow:0 0 4px color-mix(in srgb,var(--warning, #b7791f) 70%,transparent)}._statusInactive_1uhow_123{background:var(--text-muted)}._statusError_1uhow_127{background:var(--error)}._proBadge_1uhow_132{color:var(--pro-badge);font-weight:500}._licenseCardPro_1uhow_17 ._cardHeader_1uhow_28 span:first-child{color:var(--pro-text)}._licenseCardPro_1uhow_17 ._licenseGrid_1uhow_86 dt{color:var(--pro-badge)}._upgradeLink_1uhow_146{display:inline-block;margin-top:8px;font-family:var(--font-label);font-size:12px;color:var(--accent);cursor:pointer;text-decoration:underline}._upgradeLink_1uhow_146:hover{opacity:.8}._licenseControls_1uhow_160{display:flex;flex-direction:column;gap:10px;margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}._licenseControlRow_1uhow_169{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}._licenseField_1uhow_176{display:flex;flex-direction:column;gap:6px}._licenseFieldGrow_1uhow_182{flex:1;min-width:220px}._controlLabel_1uhow_187{font-family:var(--font-label);font-size:12px;color:var(--text-primary)}._textInput_1uhow_193{font-family:var(--font-code);font-size:12px;padding:6px 8px;border-radius:4px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);outline:none;transition:border-color var(--transition)}._textInput_1uhow_193:focus{border-color:var(--accent)}._actionBtn_1uhow_209{font-family:var(--font-label);font-size:12px;padding:6px 14px;border-radius:4px;border:1px solid var(--accent);background:transparent;color:var(--accent);cursor:pointer;transition:background var(--transition),color var(--transition),opacity var(--transition)}._actionBtn_1uhow_209:hover{background:var(--accent);color:var(--bg-primary)}._actionBtn_1uhow_209:disabled{opacity:.5;cursor:not-allowed}._licenseMessage_1uhow_231{margin:0;font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._licenseNotice_1uhow_238{margin:12px 0 0;padding:10px 12px;border-radius:8px;border:1px solid var(--border);font-family:var(--font-label);font-size:12px;line-height:1.5}._licenseNoticeInfo_1uhow_248{color:var(--text-primary);background:color-mix(in srgb,var(--accent) 8%,transparent);border-color:color-mix(in srgb,var(--accent) 28%,var(--border))}._licenseNoticeWarning_1uhow_254{color:var(--text-primary);background:color-mix(in srgb,var(--warning, #b7791f) 12%,transparent);border-color:color-mix(in srgb,var(--warning, #b7791f) 34%,var(--border))}._licenseNoticeMuted_1uhow_260{color:var(--text-secondary);background:var(--bg-secondary)}._settingRow_1uhow_266{display:flex;align-items:center;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--border);font-size:13px}._settingRow_1uhow_266:last-child{border-bottom:none}._settingLabel_1uhow_280{font-family:var(--font-label);color:var(--text-primary);flex:1}._settingControl_1uhow_287{display:flex;align-items:center;gap:8px;justify-content:flex-end;min-width:112px}._select_1uhow_296{font-family:var(--font-code);font-size:12px;padding:4px 8px;border-radius:4px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;outline:none;transition:border-color var(--transition)}._select_1uhow_296:focus{border-color:var(--accent)}._numberInput_1uhow_314{font-family:var(--font-code);font-size:12px;padding:4px 8px;border-radius:4px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);width:80px;outline:none;transition:border-color var(--transition)}._numberInput_1uhow_314:focus{border-color:var(--accent)}._toggleSwitch_1uhow_332{position:relative;display:inline-flex;align-items:center;cursor:pointer}._toggleInput_1uhow_339{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}._toggleTrack_1uhow_347{position:relative;display:inline-flex;align-items:center;width:46px;height:28px;padding:3px;border-radius:999px;border:1px solid color-mix(in srgb,var(--border) 82%,transparent);background:linear-gradient(180deg,#ffffff08,#fff0),color-mix(in srgb,var(--bg-secondary) 88%,#0b1220 12%);box-shadow:inset 0 1px #ffffff0d,inset 0 0 0 1px #070a122e;transition:background var(--transition),border-color var(--transition),box-shadow var(--transition),transform var(--transition)}._toggleThumb_1uhow_369{width:20px;height:20px;border-radius:50%;background:radial-gradient(circle at 30% 30%,#ffffffd1,#ffffff14 45%),linear-gradient(180deg,#f7fbff,#c8d4ea);box-shadow:0 4px 10px #00000047,inset 0 1px #ffffffa6;transform:translate(0);transition:transform var(--transition),background var(--transition),box-shadow var(--transition)}._toggleInput_1uhow_339:focus-visible+._toggleTrack_1uhow_347{border-color:color-mix(in srgb,var(--accent) 70%,white 8%);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 24%,transparent),inset 0 1px #ffffff0d}._toggleInput_1uhow_339:checked+._toggleTrack_1uhow_347{border-color:color-mix(in srgb,var(--accent) 62%,white 6%);background:linear-gradient(180deg,color-mix(in srgb,var(--accent) 36%,white 4%),color-mix(in srgb,var(--accent) 78%,#1b2640 22%)),var(--accent);box-shadow:inset 0 1px #ffffff29,0 0 16px color-mix(in srgb,var(--accent) 22%,transparent)}._toggleInput_1uhow_339:checked+._toggleTrack_1uhow_347 ._toggleThumb_1uhow_369{transform:translate(18px);background:radial-gradient(circle at 30% 30%,#ffffffeb,#ffffff1f 42%),linear-gradient(180deg,#fff,#d8e5ff)}._toggleSwitch_1uhow_332:hover ._toggleTrack_1uhow_347{border-color:color-mix(in srgb,var(--accent) 38%,var(--border))}._toggleSwitch_1uhow_332:hover ._toggleInput_1uhow_339:checked+._toggleTrack_1uhow_347{box-shadow:inset 0 1px #ffffff29,0 0 20px color-mix(in srgb,var(--accent) 28%,transparent)}._savedIndicator_1uhow_418{font-family:var(--font-code);font-size:11px;color:var(--success);opacity:1;min-width:56px;text-align:right;white-space:nowrap;transition:opacity .3s ease}._savedIndicatorHidden_1uhow_429{opacity:0}._dataHistoryIntro_1uhow_434{margin:0 0 12px;font-family:var(--font-label);font-size:12px;line-height:1.5;color:var(--text-secondary)}._dataHistoryList_1uhow_442{display:flex;flex-direction:column;border-top:1px solid var(--border)}._dataHistoryRow_1uhow_448{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:14px;padding:12px 0;border-bottom:1px solid var(--border)}._dataHistoryDetail_1uhow_457{padding:0 0 14px;border-bottom:1px solid var(--border)}._uiStudioDataHistoryRow_1uhow_462{border-bottom:none;padding-bottom:10px}._uiStudioDataHistoryDetail_1uhow_467{margin-left:16px;padding:12px 0 16px 16px;border-left:2px solid var(--border);background:linear-gradient(90deg,color-mix(in srgb,var(--bg-secondary) 42%,transparent),transparent 58%)}._dataHistoryMain_1uhow_474{min-width:0}._dataHistoryTitle_1uhow_478{font-family:var(--font-label);font-size:13px;color:var(--text-primary)}._dataHistoryDescription_1uhow_484{margin-top:3px;font-family:var(--font-label);font-size:12px;line-height:1.45;color:var(--text-muted)}._dataHistoryMetric_1uhow_492{font-family:var(--font-code);font-size:12px;color:var(--text-secondary);white-space:nowrap}._dataHistoryActions_1uhow_499{display:flex;align-items:center;gap:8px}._linkButton_1uhow_505,._dangerButton_1uhow_506{font-family:var(--font-label);font-size:12px;line-height:1;padding:7px 10px;border-radius:4px;text-decoration:none;cursor:pointer;transition:background var(--transition),color var(--transition),border-color var(--transition),opacity var(--transition)}._linkButton_1uhow_505{color:var(--accent);border:1px solid var(--border);background:transparent}._linkButton_1uhow_505:hover{border-color:var(--accent)}._dangerButton_1uhow_506{color:var(--error-text);border:1px solid var(--error-border);background:var(--error-bg)}._dangerButton_1uhow_506:hover{opacity:.86}._dangerButton_1uhow_506:disabled{opacity:.45;cursor:not-allowed}._inlineStatus_1uhow_542{margin:12px 0 0;font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._coldGrid_1uhow_550{display:grid;grid-template-columns:auto 1fr;gap:6px 16px;font-family:var(--font-code);font-size:13px}._coldGrid_1uhow_550 dt{color:var(--text-muted)}._coldGrid_1uhow_550 dd{color:var(--text-primary);margin:0}._coldHint_1uhow_568{margin-top:10px;font-family:var(--font-label);font-size:12px;color:var(--text-muted);font-style:italic}._langRow_1uhow_577{display:flex;align-items:center;gap:12px;font-size:13px}._langRow_1uhow_577 label{font-family:var(--font-label);color:var(--text-primary)}._loading_1uhow_590{color:var(--text-muted);font-family:var(--font-code);font-size:13px;padding:32px 0;text-align:center}._unit_1uhow_599{font-family:var(--font-code);font-size:11px;color:var(--text-muted)}@media(max-width:720px){._dataHistoryRow_1uhow_448{grid-template-columns:minmax(0,1fr);align-items:stretch}._dataHistoryMetric_1uhow_492{white-space:normal}._dataHistoryActions_1uhow_499{justify-content:flex-start}._uiStudioDataHistoryDetail_1uhow_467{margin-left:0}}
@@ -1 +0,0 @@
1
- import{d as oe,r as u,f as le,D as re,e as ce,g as de,h as ue,a as D,u as V,j as e,i as ge,k as pe,A as he,S as me}from"./index-FfT2oWAB.js";import{I as v}from"./InfoLabel-B9KT3kfU.js";import{T as p}from"./TooltipText-Baw38jOU.js";import{C as ye}from"./ConfirmModal-CmJCz5rg.js";import{D as ae,f as ie,r as xe,s as _e,a as ne,d as K,S as ee,b as ve}from"./sample-requests-X_hsWdLX.js";function be(){const{level:t}=oe(),[s,d]=u.useState(null),[j,n]=u.useState(null),[l,o]=u.useState(!1),[f,h]=u.useState(!0),[A,N]=u.useState(!1),[T,w]=u.useState(null),b="gumroad",y=t==="disconnected",x=u.useCallback(c=>{c&&n(i=>({...i,...c,maskedKey:c.maskedKey??(i==null?void 0:i.maskedKey),provider:c.provider??(i==null?void 0:i.provider)??b}))},[b]),H=u.useCallback(c=>{if(!c){n(null);return}n({...c,provider:c.provider??b})},[b]),k=u.useCallback(async()=>{try{return await le(b)}catch{return null}},[b]);u.useEffect(()=>{let c=!1;async function i(){try{const[m,_]=await Promise.all([D.get("/api/dashboard/settings").catch(()=>null),k()]);if(c)return;m&&d(m),_&&x(_)}catch{}finally{c||h(!1)}}return i(),()=>{c=!0}},[k,x]),u.useEffect(()=>{const c=new re;c.connect();const i=c.on("license",m=>{k().then(_=>{if(_){if((m==null?void 0:m.cleared)===!0){H(_);return}x(_)}})});return()=>{i(),c.disconnect()}},[k,x,H]);const S=u.useCallback((c,i)=>{w(c??i)},[]),E=u.useCallback(async c=>{if(y)return!1;if(!c.trim())return w("License key is required."),!1;N(!0);try{const i=await ce({provider:b,licenseKey:c.trim()});return x(i.license),S(i.message,i.ok?"License updated.":"License activation failed."),i.ok}catch{return w("License activation failed."),!1}finally{N(!1)}},[S,y,b,x]),C=u.useCallback(async()=>{if(!y){N(!0);try{const c=await de({provider:b});x(c.license),S(c.message,c.ok?"License updated.":"License refresh failed.")}catch{w("License refresh failed.")}finally{N(!1)}}},[S,y,b,x]),B=u.useCallback(async()=>{if(!y){N(!0);try{const c=await ue({provider:b});H(c.license),S(c.message,c.ok?"License reset.":"License reset failed.")}catch{w("License reset failed.")}finally{N(!1)}}},[S,y,b,H]),I=u.useCallback(async(c,i)=>{if(s){d(m=>m&&{...m,hot:{...m.hot,[c]:i}}),o(!0);try{await D.patch("/api/dashboard/settings",{[c]:i})}catch{d(m=>m&&{...m,hot:{...m.hot,[c]:s.hot[c]}})}finally{o(!1)}}},[s]);return{settings:s,license:j,saving:l,licenseProvider:b,licenseControlsDisabled:y,licenseSubmitting:A,licenseMessage:T,activateLicense:E,refreshLicense:C,resetLicense:B,updateHotSetting:I,loading:f}}const fe="_card_83d0e_4",Se="_cardEmbedded_83d0e_14",je="_cardTitle_83d0e_21",Ne="_usageRow_83d0e_30",Le="_usageTotal_83d0e_36",we="_usageBreakdown_83d0e_42",Ce="_usageCounts_83d0e_47",He="_divider_83d0e_53",ke="_lastRunRow_83d0e_60",Re="_lastRunLabel_83d0e_69",Te="_errorIcon_83d0e_75",Ee="_tooltip_83d0e_83",Ae="_cleanupRow_83d0e_106",Be="_cleanupLabel_83d0e_113",Ie="_cleanupBtn_83d0e_120",De="_cleanupBtnDanger_83d0e_143",Pe="_retentionSection_83d0e_155",Me="_retentionTitle_83d0e_161",$e="_retentionFieldset_83d0e_170",Ue="_proOverlay_83d0e_185",Oe="_radioRow_83d0e_197",ze="_radioLabel_83d0e_204",Fe="_presetGroup_83d0e_224",Ge="_presetBtn_83d0e_232",qe="_presetBtnActive_83d0e_249",We="_freeInput_83d0e_256",Ye="_inputError_83d0e_272",Ke="_inputUnit_83d0e_276",Ve="_cascadeRow_83d0e_283",Qe="_retentionActions_83d0e_302",Xe="_saveBtn_83d0e_308",Je="_runNowBtn_83d0e_330",Ze="_errorMsg_83d0e_353",r={card:fe,cardEmbedded:Se,cardTitle:je,usageRow:Ne,usageTotal:Le,usageBreakdown:we,usageCounts:Ce,divider:He,lastRunRow:ke,lastRunLabel:Re,errorIcon:Te,tooltip:Ee,cleanupRow:Ae,cleanupLabel:Be,cleanupBtn:Ie,cleanupBtnDanger:De,retentionSection:Pe,retentionTitle:Me,retentionFieldset:$e,proOverlay:Ue,radioRow:Oe,radioLabel:ze,presetGroup:Fe,presetBtn:Ge,presetBtnActive:qe,freeInput:We,inputError:Ye,inputUnit:Ke,cascadeRow:Ve,retentionActions:Qe,saveBtn:Xe,runNowBtn:Je,errorMsg:Ze};function et(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 te(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 tt(t,s){return t.mode===s.mode&&t.ageDays===s.ageDays&&t.sizeMb===s.sizeMb&&t.cascadeSnapshots===s.cascadeSnapshots}function O(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 st({placeId:t,tier:s,currentPolicy:d,onSaved:j}){const{t:n}=V(),[l,o]=u.useState(d),[f,h]=u.useState(()=>[7,14,30,90].includes(d.ageDays??-1)?"":String(d.ageDays??30)),[A,N]=u.useState(()=>[100,500,1e3].includes(d.sizeMb??-1)?"":String(d.sizeMb??500)),[T,w]=u.useState(null),[b,y]=u.useState(!1),[x,H]=u.useState(!1),[k,S]=u.useState(!1),[E,C]=u.useState(null);u.useEffect(()=>{o(d);const g=[7,14,30,90],R=[100,500,1e3];h(g.includes(d.ageDays??-1)?"":String(d.ageDays??30)),N(R.includes(d.sizeMb??-1)?"":String(d.sizeMb??500))},[d]);const B=s==="basic",I=te(l),c=tt(d,l),i=I&&!c&&!x,m=g=>{o(R=>{const U={...R,mode:g};return g==="age"&&(U.ageDays=parseInt(f,10)||30),g==="size"&&(U.sizeMb=parseInt(A,10)||500),U})},_=g=>{h(""),o(R=>({...R,ageDays:g}))},L=g=>{N(""),o(R=>({...R,sizeMb:g}))},z=g=>{h(g);const R=parseInt(g,10);Number.isNaN(R)||o(U=>({...U,ageDays:R}))},Q=g=>{N(g);const R=parseInt(g,10);Number.isNaN(R)||o(U=>({...U,sizeMb:R}))},M=async()=>{if(C(null),et(d,l)){try{const g=await ie(t,{mode:l.mode,ageDays:l.ageDays,sizeMb:l.sizeMb,cascadeSnapshots:l.cascadeSnapshots});w(g.dryRun),y(!0)}catch(g){C(g.message)}return}await Y()},Y=async()=>{H(!0);try{await _e(t,l),y(!1),j()}catch(g){throw C(g.message),g}finally{H(!1)}},X=async()=>{C(null),S(!0);try{await xe(t),j()}catch(g){C(g.message)}finally{S(!1)}},J=T?`${n("uiStudio.cleanup.policy.confirm.messageStrict","이 정책으로 즉시")} ${T.wouldRemoveRequests}${n("uiStudio.cleanup.policy.confirm.requests","건")} / ${T.wouldRemoveSnapshots}${n("uiStudio.cleanup.policy.confirm.snapshots","개 화면 캡처")} / ${O(T.wouldFreeBytes)} ${n("uiStudio.cleanup.policy.confirm.freed","가 삭제됩니다 — 적용?")}`:"",Z=l.mode==="age"&&!te(l),$=l.mode==="size"&&!te(l);return e.jsxs("div",{className:r.retentionSection,children:[e.jsx("h3",{className:r.retentionTitle,children:e.jsx(v,{label:n("uiStudio.cleanup.policy.title","자동 삭제 정책"),tooltip:n("uiStudio.cleanup.policy.title.tooltip","Rules that automatically remove old or large captures.")})}),e.jsxs("div",{style:{position:"relative"},children:[B&&e.jsx("div",{className:r.proOverlay,title:n("uiStudio.cleanup.policy.proRequired","Pro 업그레이드 후 사용 가능"),children:e.jsx("div",{className:r.tooltip,children:n("uiStudio.cleanup.policy.proRequired","Pro 업그레이드 후 사용 가능")})}),e.jsxs("fieldset",{className:r.retentionFieldset,disabled:B,style:B?{opacity:.45,pointerEvents:"none"}:void 0,children:[e.jsx("div",{className:r.radioRow,children:e.jsx(p,{text:n("uiStudio.cleanup.policy.modeOff.tooltip","Turn off auto-cleanup. Data stays until you remove it manually."),children:e.jsxs("label",{className:r.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"off",checked:l.mode==="off",onChange:()=>m("off")}),n("uiStudio.cleanup.policy.modeOff","사용 안 함 (off)")]})})}),e.jsxs("div",{children:[e.jsx("div",{className:r.radioRow,children:e.jsx(p,{text:n("uiStudio.cleanup.policy.modeAge.tooltip","Automatically delete data older than the configured number of days."),children:e.jsxs("label",{className:r.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"age",checked:l.mode==="age",onChange:()=>m("age")}),n("uiStudio.cleanup.policy.modeAge","기간 기반 (age)")]})})}),l.mode==="age"&&e.jsxs("div",{className:r.presetGroup,children:[[7,14,30,90].map(g=>e.jsx(p,{text:n("uiStudio.cleanup.policy.agePreset.tooltip","Delete data older than this many days."),children:e.jsxs("button",{type:"button",className:`${r.presetBtn} ${l.ageDays===g&&f===""?r.presetBtnActive:""}`,onClick:()=>_(g),children:[g,n("uiStudio.cleanup.policy.daysUnit","일")]})},g)),e.jsx(p,{text:n("uiStudio.cleanup.policy.ageInput.tooltip","Enter any value between 1 and 365 days."),children:e.jsx("input",{type:"number",className:`${r.freeInput} ${Z?r.inputError:""}`,value:f,min:1,max:365,onChange:g=>z(g.target.value)})}),e.jsxs("span",{className:r.inputUnit,children:["1–365",n("uiStudio.cleanup.policy.daysUnit","일")]})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:r.radioRow,children:e.jsx(p,{text:n("uiStudio.cleanup.policy.modeSize.tooltip","When total usage exceeds the limit, the oldest data is removed first."),children:e.jsxs("label",{className:r.radioLabel,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"size",checked:l.mode==="size",onChange:()=>m("size")}),n("uiStudio.cleanup.policy.modeSize","용량 기반 (size)")]})})}),l.mode==="size"&&e.jsxs("div",{className:r.presetGroup,children:[[100,500,1e3].map(g=>e.jsx(p,{text:n("uiStudio.cleanup.policy.sizePreset.tooltip","Keep total usage under this size."),children:e.jsxs("button",{type:"button",className:`${r.presetBtn} ${l.sizeMb===g&&A===""?r.presetBtnActive:""}`,onClick:()=>L(g),children:[g,n("uiStudio.cleanup.policy.mbUnit","MB")]})},g)),e.jsx(p,{text:n("uiStudio.cleanup.policy.sizeInput.tooltip","Enter any value between 50 MB and 10000 MB (10 GB)."),children:e.jsx("input",{type:"number",className:`${r.freeInput} ${$?r.inputError:""}`,value:A,min:50,max:1e4,onChange:g=>Q(g.target.value)})}),e.jsxs("span",{className:r.inputUnit,children:["50–10000",n("uiStudio.cleanup.policy.mbUnit","MB")]})]})]}),e.jsx(p,{text:n("uiStudio.cleanup.policy.cascade.tooltip","Also delete the capture images linked to those records. If off, the images stay."),children:e.jsxs("label",{className:r.cascadeRow,children:[e.jsx("input",{type:"checkbox",checked:l.cascadeSnapshots,onChange:g=>o(R=>({...R,cascadeSnapshots:g.target.checked}))}),n("uiStudio.cleanup.policy.cascade","연결된 화면 캡처도 함께 삭제")]})}),e.jsxs("div",{className:r.retentionActions,children:[e.jsx(p,{text:n("uiStudio.cleanup.policy.save.tooltip","Save the current cleanup rule. It runs in the background from then on."),children:e.jsx("button",{type:"button",className:r.saveBtn,onClick:()=>void M(),disabled:!i,children:n("uiStudio.cleanup.policy.save","정책 저장")})}),e.jsx(p,{text:n("uiStudio.cleanup.policy.runNow.tooltip","Run the current rule once now, without waiting for the next scheduled run."),children:e.jsx("button",{type:"button",className:r.runNowBtn,onClick:()=>void X(),disabled:k,children:n("uiStudio.cleanup.policy.runNow","지금 정리")})})]}),E&&e.jsx("div",{className:r.errorMsg,children:E})]})]}),b&&T&&e.jsx(ae,{title:n("uiStudio.cleanup.policy.confirm.title","정책 적용 확인"),message:J,danger:!0,confirmLabel:n("uiStudio.cleanup.policy.save","정책 저장"),busy:x,onConfirm:Y,onClose:()=>y(!1)})]})}function at({placeId:t,tier:s,onChanged:d,sampleUsage:j,sampleRetention:n,embedded:l=!1}){const{t:o}=V(),f=s==="basic"&&j!=null&&n!=null,[h,A]=u.useState(f?j:null),[N,T]=u.useState(f?n:null),[w,b]=u.useState(null),[y,x]=u.useState(null),[H,k]=u.useState(null),S=u.useCallback(async()=>{if(!f&&t!=null){b(null);try{const[_,L]=await Promise.all([ne(t),ie(t)]);A(_),T(L.policy)}catch(_){b(_.message)}}},[t,f]);u.useEffect(()=>{S()},[S]);const E=u.useCallback(()=>{S(),d==null||d()},[S,d]),C=u.useCallback(async()=>{if(y&&t!=null){k(null);try{y.kind==="keep7"?await K(t,{olderThanDays:7,alsoSnapshots:!0}):y.kind==="keep30"?await K(t,{olderThanDays:30,alsoSnapshots:!0}):await K(t,{all:!0,alsoSnapshots:!0}),x(null),S(),d==null||d()}catch(_){throw k(_.message),_}}},[y,t,S,d]);function B(_){const L=o("uiStudio.cleanup.studioPreservedNote","This deletes saved change records and screenshots on disk only; Roblox Studio instances are not affected.");return _.kind==="keep7"?`${o("uiStudio.cleanup.cleanupConfirmMessage.keep7","7일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${L}`:_.kind==="keep30"?`${o("uiStudio.cleanup.cleanupConfirmMessage.keep30","30일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${L}`:`${((h==null?void 0:h.requestCount)??0)+((h==null?void 0:h.snapshotCount)??0)}${o("uiStudio.cleanup.cleanupConfirmMessage.all","개의 저장된 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${L}`}if(t==null&&!f)return null;if(w)return e.jsx("div",{className:`${r.card} ${l?r.cardEmbedded:""}`,children:e.jsx("p",{className:r.errorMsg,children:w})});if(!h||!N)return e.jsx("div",{className:`${r.card} ${l?r.cardEmbedded:""}`,children:e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",margin:0},children:o("uiStudio.storage.loading","로딩 중...")})});const I=N.lastRunAt,c=N.lastRunStats,i=I?new Date(I).toLocaleString():null,m=t??0;return e.jsxs("div",{className:`${r.card} ${l?r.cardEmbedded:""}`,children:[e.jsx("h3",{className:r.cardTitle,children:e.jsx(v,{label:o("uiStudio.storage.title","UI Studio 저장 데이터"),tooltip:o("uiStudio.storage.title.tooltip","Disk usage of UI Studio change records and screenshots.")})}),e.jsxs("div",{className:r.usageRow,children:[e.jsx(p,{text:o("uiStudio.storage.usageLabel.tooltip","Disk space currently used by UI Studio for this project."),children:e.jsxs("div",{className:r.usageTotal,children:[o("uiStudio.storage.usageLabel","사용 중")," ",O(h.totalBytes)]})}),e.jsxs("div",{className:r.usageBreakdown,children:[e.jsx(p,{text:o("uiStudio.storage.historyBytes.tooltip","Space taken by change record data (JSON)."),children:e.jsxs("span",{children:[o("uiStudio.storage.historyBytes","변경 이력")," ",O(h.historyBytes)]})})," · ",e.jsx(p,{text:o("uiStudio.storage.snapshotBytes.tooltip","Space taken by captured PNG image files."),children:e.jsxs("span",{children:[o("uiStudio.storage.snapshotBytes","화면 캡처")," ",O(h.snapshotBytes)]})})]}),e.jsxs("div",{className:r.usageCounts,children:[e.jsx(p,{text:o("uiStudio.storage.requestCount.tooltip","Number of actions where AI changed the UI."),children:e.jsxs("span",{children:[o("uiStudio.storage.requestCount","변경 기록")," ",h.requestCount.toLocaleString(),o("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(p,{text:o("uiStudio.storage.mutationCount.tooltip","Number of detail changes inside actions (one property edit = 1)."),children:e.jsxs("span",{children:[o("uiStudio.storage.mutationCount","변경 상세")," ",h.mutationCount.toLocaleString(),o("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(p,{text:o("uiStudio.storage.snapshotCount.tooltip","Number of saved capture image files."),children:e.jsxs("span",{children:[o("uiStudio.storage.snapshotCount","화면 캡처")," ",h.snapshotCount.toLocaleString(),o("uiStudio.storage.countSuffix","개")]})})]})]}),e.jsx("hr",{className:r.divider}),e.jsx(st,{placeId:m,tier:s,currentPolicy:N,onSaved:E}),e.jsx("hr",{className:r.divider}),e.jsxs("div",{className:r.lastRunRow,children:[e.jsx("span",{className:r.lastRunLabel,children:e.jsx(v,{label:o("uiStudio.storage.lastRun","마지막 자동 정리"),tooltip:o("uiStudio.storage.lastRun.tooltip","When the auto-cleanup policy last ran, and what it removed.")})}),i?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:i}),c&&e.jsxs("span",{children:["· ",o("uiStudio.storage.requestCount","변경 기록")," ",c.removedRequests,o("uiStudio.storage.countSuffix","개")," / ",o("uiStudio.storage.snapshotCount","화면 캡처")," ",c.removedSnapshots,o("uiStudio.storage.countSuffix","개")," / ",O(c.freedBytes)," ",o("uiStudio.storage.lastRunFreed","회수")]}),c&&c.errors>0&&e.jsxs("span",{className:r.errorIcon,title:`${o("uiStudio.storage.lastRunErrors","오류")} ${c.errors}건`,children:["⚠",e.jsxs("span",{className:r.tooltip,children:[o("uiStudio.storage.lastRunErrors","오류")," ",c.errors,o("uiStudio.storage.countSuffix","건")]})]})]}):e.jsx("span",{children:o("uiStudio.storage.lastRunNever","—")})]}),e.jsx("hr",{className:r.divider}),e.jsxs("div",{className:r.cleanupRow,children:[e.jsx("span",{className:r.cleanupLabel,children:e.jsx(v,{label:o("uiStudio.cleanup.label","수동 정리"),tooltip:o("uiStudio.cleanup.label.tooltip","Manually clean up change records and captures whenever you want.")})}),e.jsx(p,{text:o("uiStudio.cleanup.keep7.tooltip","Delete change records and captures older than 7 days."),children:e.jsx("button",{type:"button",className:r.cleanupBtn,onClick:()=>x({kind:"keep7"}),disabled:s==="basic",children:o("uiStudio.cleanup.keepLastNDays","최근 7일만 남기기").replace("{n}","7")})}),e.jsx(p,{text:o("uiStudio.cleanup.keep30.tooltip","Delete change records and captures older than 30 days."),children:e.jsx("button",{type:"button",className:r.cleanupBtn,onClick:()=>x({kind:"keep30"}),disabled:s==="basic",children:o("uiStudio.cleanup.keepLastNDays","최근 30일만 남기기").replace("{n}","30")})}),e.jsx(p,{text:o("uiStudio.cleanup.deleteAll.tooltip","Delete every change record and capture for this project. The actual UI in Roblox Studio is not affected."),children:e.jsx("button",{type:"button",className:`${r.cleanupBtn} ${r.cleanupBtnDanger}`,onClick:()=>x({kind:"all"}),disabled:s==="basic",children:o("uiStudio.cleanup.deleteAll","전체 삭제…")})})]}),H&&e.jsx("div",{className:r.errorMsg,children:H}),y&&e.jsx(ae,{title:o("uiStudio.cleanup.cleanupConfirmTitle","정리 확인"),message:B(y),danger:!0,confirmLabel:o("common.delete","삭제"),onConfirm:C,onClose:()=>{x(null),k(null)}})]})}const it="_page_1uhow_2",nt="_card_1uhow_10",ot="_licenseCardPro_1uhow_17",lt="_cardHeader_1uhow_28",rt="_cardHeaderActions_1uhow_41",ct="_collapseButton_1uhow_47",dt="_headerBadge_1uhow_69",ut="_headerBadgeLive_1uhow_80",gt="_licenseGrid_1uhow_86",pt="_statusDot_1uhow_104",ht="_statusActive_1uhow_113",mt="_statusGrace_1uhow_118",yt="_statusInactive_1uhow_123",xt="_statusError_1uhow_127",_t="_proBadge_1uhow_132",vt="_upgradeLink_1uhow_146",bt="_licenseControls_1uhow_160",ft="_licenseControlRow_1uhow_169",St="_licenseField_1uhow_176",jt="_licenseFieldGrow_1uhow_182",Nt="_controlLabel_1uhow_187",Lt="_textInput_1uhow_193",wt="_actionBtn_1uhow_209",Ct="_licenseMessage_1uhow_231",Ht="_licenseNotice_1uhow_238",kt="_licenseNoticeInfo_1uhow_248",Rt="_licenseNoticeWarning_1uhow_254",Tt="_licenseNoticeMuted_1uhow_260",Et="_settingRow_1uhow_266",At="_settingLabel_1uhow_280",Bt="_settingControl_1uhow_287",It="_select_1uhow_296",Dt="_numberInput_1uhow_314",Pt="_toggleSwitch_1uhow_332",Mt="_toggleInput_1uhow_339",$t="_toggleTrack_1uhow_347",Ut="_toggleThumb_1uhow_369",Ot="_savedIndicator_1uhow_418",zt="_savedIndicatorHidden_1uhow_429",Ft="_dataHistoryIntro_1uhow_434",Gt="_dataHistoryList_1uhow_442",qt="_dataHistoryRow_1uhow_448",Wt="_dataHistoryDetail_1uhow_457",Yt="_uiStudioDataHistoryRow_1uhow_462",Kt="_uiStudioDataHistoryDetail_1uhow_467",Vt="_dataHistoryMain_1uhow_474",Qt="_dataHistoryTitle_1uhow_478",Xt="_dataHistoryDescription_1uhow_484",Jt="_dataHistoryMetric_1uhow_492",Zt="_dataHistoryActions_1uhow_499",es="_linkButton_1uhow_505",ts="_dangerButton_1uhow_506",ss="_inlineStatus_1uhow_542",as="_coldGrid_1uhow_550",is="_coldHint_1uhow_568",ns="_langRow_1uhow_577",os="_loading_1uhow_590",ls="_unit_1uhow_599",a={page:it,card:nt,licenseCardPro:ot,cardHeader:lt,cardHeaderActions:rt,collapseButton:ct,headerBadge:dt,headerBadgeLive:ut,licenseGrid:gt,statusDot:pt,statusActive:ht,statusGrace:mt,statusInactive:yt,statusError:xt,proBadge:_t,upgradeLink:vt,licenseControls:bt,licenseControlRow:ft,licenseField:St,licenseFieldGrow:jt,controlLabel:Nt,textInput:Lt,actionBtn:wt,licenseMessage:Ct,licenseNotice:Ht,licenseNoticeInfo:kt,licenseNoticeWarning:Rt,licenseNoticeMuted:Tt,settingRow:Et,settingLabel:At,settingControl:Bt,select:It,numberInput:Dt,toggleSwitch:Pt,toggleInput:Mt,toggleTrack:$t,toggleThumb:Ut,savedIndicator:Ot,savedIndicatorHidden:zt,dataHistoryIntro:Ft,dataHistoryList:Gt,dataHistoryRow:qt,dataHistoryDetail:Wt,uiStudioDataHistoryRow:Yt,uiStudioDataHistoryDetail:Kt,dataHistoryMain:Vt,dataHistoryTitle:Qt,dataHistoryDescription:Xt,dataHistoryMetric:Jt,dataHistoryActions:Zt,linkButton:es,dangerButton:ts,inlineStatus:ss,coldGrid:as,coldHint:is,langRow:ns,loading:os,unit:ls},rs={toolsActivity:null,toolStats:null,toolSessions:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null},cs={toolsActivity:null,toolStats:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null};function ds(t){var s;return t?t.pluginConnected?t.activePlaceId:t.lastActivePlaceId??((s=t.places[0])==null?void 0:s.placeId)??null:null}async function P(t){try{return await t}catch{return null}}function q(t){return t?typeof t.total=="number"?t.total:Array.isArray(t.entries)?t.entries.length:null:null}function W(t,s,d,j){return s===null?t("settings.dataHistory.metric.unavailable","Unavailable"):`${s.toLocaleString()} ${t(d,j)}`}function F(t,s,d){const j=d===null?t("settings.dataHistory.metric.sizeUnavailable","size unavailable"):O(d);return`${s} · ${j}`}function G(t,s){var j;const d=(j=t==null?void 0:t[s])==null?void 0:j.bytes;return typeof d=="number"&&Number.isFinite(d)?d:null}function us(t,s){return s?[`${s.requestCount.toLocaleString()} ${t("uiStudio.storage.requestCount","change records")}`,`${s.snapshotCount.toLocaleString()} ${t("uiStudio.storage.snapshotCount","screenshots")}`,O(s.totalBytes)].join(" · "):t("settings.dataHistory.metric.unavailable","Unavailable")}function gs({tier:t}){const{t:s}=V(),[d,j]=u.useState(rs),[n,l]=u.useState(cs),[o,f]=u.useState(t==="basic"?ee:null),[h,A]=u.useState(null),[N,T]=u.useState(!0),[w,b]=u.useState(!0),[y,x]=u.useState(null),[H,k]=u.useState(!1),[S,E]=u.useState(null),C=u.useCallback(async()=>{T(!0);const L=await P(ge()),z=ds(L);A(z);const[Q,M,Y,X,J,Z,$]=await Promise.all([P(D.get("/api/dashboard/history",{limit:"1",offset:"0"})),P(D.get("/api/dashboard/tool-stats")),P(D.get("/sync/history",{limit:"1",offset:"0"})),P(D.get("/api/dashboard/playtest/history")),P(D.get("/api/dashboard/changelog",{limit:"1",offset:"0"})),P(D.get("/api/dashboard/connection-log")),P(D.get("/api/dashboard/storage-summary"))]),g=t==="basic"?ee:z===null?null:await P(ne(z));j({toolsActivity:q(Q),toolStats:(M==null?void 0:M.totalCalls)??null,toolSessions:(M==null?void 0:M.totalSessions)??null,syncLog:q(Y),playtestReports:q(X),projectChanges:q(J),connectionLog:q(Z)}),l({toolsActivity:G($,"toolsActivity"),toolStats:G($,"toolStats"),syncLog:G($,"syncLog"),playtestReports:G($,"playtestReports"),projectChanges:G($,"projectChanges"),connectionLog:G($,"connectionLog")}),f(g),T(!1)},[t]);u.useEffect(()=>{C()},[C]);const B=u.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:F(s,W(s,d.toolsActivity,"settings.dataHistory.metric.records","records"),n.toolsActivity),metricTooltip:s("settings.dataHistory.toolsActivity.metric.tooltip","Number of saved tool runs and the disk space they use."),route:"/tools",clearEndpoint:"/api/dashboard/tools/history/clear"},{key:"toolStats",title:s("settings.dataHistory.toolStats.title","Tool usage statistics"),description:s("settings.dataHistory.toolStats.description","Aggregated tool counts and status totals."),metric:F(s,d.toolStats===null?s("settings.dataHistory.metric.unavailable","Unavailable"):`${d.toolStats.toLocaleString()} ${s("settings.dataHistory.metric.runs","runs")} · ${(d.toolSessions??0).toLocaleString()} ${s("settings.dataHistory.metric.sessions","sessions")}`,n.toolStats),metricTooltip:s("settings.dataHistory.toolStats.metric.tooltip","Aggregated total runs and session counts."),route:"/tools",clearEndpoint:"/api/dashboard/tools/statistics/clear"},{key:"syncLog",title:s("settings.dataHistory.syncLog.title","Sync log"),description:s("settings.dataHistory.syncLog.description","Saved file sync events for the active place."),metric:F(s,W(s,d.syncLog,"settings.dataHistory.metric.records","records"),n.syncLog),metricTooltip:s("settings.dataHistory.syncLog.metric.tooltip","Number of saved sync events and the disk space they use."),route:"/sync",clearEndpoint:"/api/dashboard/sync/history/clear"},{key:"playtestReports",title:s("settings.dataHistory.playtest.title","Playtest reports"),description:s("settings.dataHistory.playtest.description","Saved automated playtest reports and logs."),metric:F(s,W(s,d.playtestReports,"settings.dataHistory.metric.reports","reports"),n.playtestReports),metricTooltip:s("settings.dataHistory.playtestReports.metric.tooltip","Number of saved playtest reports and the disk space they use."),route:"/playtest",clearEndpoint:"/api/dashboard/playtest/history/clear"},{key:"projectChanges",title:s("settings.dataHistory.projectChanges.title","Project change summary"),description:s("settings.dataHistory.projectChanges.description","Saved summaries of project changes."),metric:F(s,W(s,d.projectChanges,"settings.dataHistory.metric.records","records"),n.projectChanges),metricTooltip:s("settings.dataHistory.projectChanges.metric.tooltip","Number of saved project change summaries and the disk space they use."),route:"/changelog",clearEndpoint:"/api/dashboard/changelog/clear"},{key:"connectionLog",title:s("settings.dataHistory.connectionLog.title","Connection log"),description:s("settings.dataHistory.connectionLog.description","Saved MCP and Studio connection events."),metric:F(s,W(s,d.connectionLog,"settings.dataHistory.metric.records","records"),n.connectionLog),metricTooltip:s("settings.dataHistory.connectionLog.metric.tooltip","Number of saved connection events and the disk space they use."),route:"/connection",clearEndpoint:"/api/dashboard/connection-log/clear"}],[d,n,s]),I=async()=>{if(y){k(!0),E(null);try{if(y.kind==="uiStudio"){if(t!=="pro"||h===null)throw new Error("UI Studio place is unavailable");await K(h,{all:!0,alsoSnapshots:!0}),E(s("settings.dataHistory.uiStudio.clear.success","UI Studio saved data cleared."))}else await D.post(y.row.clearEndpoint),E(s("settings.dataHistory.clear.success","Saved data cleared."));x(null),await C()}catch{E(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{k(!1)}}},c=t==="pro"?h:0,i=t==="pro"&&h!==null,m=(y==null?void 0:y.kind)==="uiStudio",_=s("settings.dataHistory.title","Data & History");return e.jsxs(e.Fragment,{children:[e.jsxs("section",{id:"data-history",className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(v,{label:s("settings.dataHistory.title","Data & History"),tooltip:s("settings.dataHistory.title.tooltip","Manage saved dashboard data in one place.")}),e.jsxs("div",{className:a.cardHeaderActions,children:[e.jsx(p,{text:s("settings.dataHistory.scope.tooltip","Clear actions apply to the current project and active place where applicable."),children:e.jsx("span",{className:a.headerBadge,children:N?s("common.loading","Loading"):s("settings.dataHistory.scope","Current project")})}),e.jsx(p,{text:s("settings.dataHistory.toggle.tooltip","Collapse or expand this section."),children:e.jsx("button",{className:a.collapseButton,type:"button","aria-expanded":w,"aria-controls":"settings-data-history-body","aria-label":w?s("settings.dataHistory.collapse","Collapse {title}").replace("{title}",_):s("settings.dataHistory.expand","Expand {title}").replace("{title}",_),onClick:()=>b(L=>!L),children:w?"▾":"▸"})})]})]}),w&&e.jsxs("div",{id:"settings-data-history-body",children:[e.jsx("p",{className:a.dataHistoryIntro,children:s("settings.dataHistory.intro","Review saved dashboard data, open the related page, or clear stored records from one place.")}),e.jsxs("div",{className:a.dataHistoryList,children:[B.map(L=>e.jsxs("div",{className:a.dataHistoryRow,children:[e.jsxs("div",{className:a.dataHistoryMain,children:[e.jsx("div",{className:a.dataHistoryTitle,children:L.title}),e.jsx("div",{className:a.dataHistoryDescription,children:L.description})]}),e.jsx(p,{text:L.metricTooltip,children:e.jsx("div",{className:a.dataHistoryMetric,children:L.metric})}),e.jsxs("div",{className:a.dataHistoryActions,children:[e.jsx(p,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:a.linkButton,href:`#${L.route}`,children:s("settings.dataHistory.open","Open")})}),e.jsx(p,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:a.dangerButton,type:"button",onClick:()=>x({kind:"row",row:L}),children:s("common.clear","Clear")})})]})]},L.key)),e.jsxs("div",{className:`${a.dataHistoryRow} ${a.uiStudioDataHistoryRow}`,children:[e.jsxs("div",{className:a.dataHistoryMain,children:[e.jsx("div",{className:a.dataHistoryTitle,children:s("settings.dataHistory.uiStudio.title","UI Studio history and screenshots")}),e.jsx("div",{className:a.dataHistoryDescription,children:s("settings.dataHistory.uiStudio.description","Saved UI Studio change records, screenshots, and cleanup policy.")})]}),e.jsx(p,{text:s("settings.dataHistory.uiStudio.metric.tooltip","UI Studio change record and capture counts, plus total disk usage."),children:e.jsx("div",{className:a.dataHistoryMetric,children:us(s,o)})}),e.jsxs("div",{className:a.dataHistoryActions,children:[e.jsx(p,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:a.linkButton,href:"#/ui-studio?tab=history",children:s("settings.dataHistory.open","Open")})}),e.jsx(p,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:a.dangerButton,type:"button",disabled:!i,onClick:()=>x({kind:"uiStudio"}),children:s("common.clear","Clear")})})]})]}),e.jsx("div",{className:`${a.dataHistoryDetail} ${a.uiStudioDataHistoryDetail}`,children:e.jsx(at,{placeId:c,tier:t,onChanged:C,embedded:!0,...t==="basic"?{sampleUsage:ee,sampleRetention:ve}:{}})})]}),S&&e.jsx("p",{className:a.inlineStatus,children:S})]})]}),e.jsx(ye,{open:y!==null,title:m?s("settings.dataHistory.uiStudio.clear.title","Clear UI Studio saved data?"):s("settings.dataHistory.clear.title","Clear saved data?"),message:m?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."):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:s("common.clear","Clear"),loading:H,onCancel:()=>!H&&x(null),onConfirm:()=>void I()})]})}const ps={en:"English",ko:"한국어",es:"Español","pt-br":"Português (BR)",ja:"日本語",id:"Bahasa Indonesia",de:"Deutsch"},hs=["debug","info","warn","error"];function ms(t){return t==="active"?a.statusActive:t==="grace"?a.statusGrace:t==="invalid"||t==="revoked"?a.statusError:a.statusInactive}function ys(t,s){return t.refreshBlockedReason==="missing_session_token"?{label:s("settings.license.status.activationRequired","Activation Required"),tooltip:s("settings.license.status.activationRequired.tooltip","Manual license activation is required before WEPPY Dashboard can refresh this status."),detail:s("settings.license.detail.missingSessionToken","Refresh is blocked because the current session token is missing."),detailTone:a.licenseNoticeWarning}:t.statusDetail==="active_cancel_pending"?{label:s("settings.license.active","Active"),tooltip:s("settings.license.status.activeCancelPending.tooltip","Cancellation is pending, but Pro access remains active until the current billing period ends."),detail:s("settings.license.detail.cancelPending","Cancellation is scheduled. Pro access remains active until the current billing period ends."),detailTone:a.licenseNoticeInfo}:t.statusDetail==="grace_provider_unavailable"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.grace.tooltip","Provider verification is temporarily unavailable, but Pro access remains active during the grace period."),detail:s("settings.license.detail.graceProviderUnavailable","Provider unavailable. Pro access remains active during grace mode."),detailTone:a.licenseNoticeInfo}:t.statusDetail==="grace_expired"||t.statusDetail==="grace_payment_failed"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.graceBilling.tooltip","Pro access is still available during a billing-related grace period."),detail:s("settings.license.detail.graceBilling","Pro access remains available during a billing grace period."),detailTone:a.licenseNoticeInfo}:{label:s(`settings.license.${t.status}`,t.status),tooltip:s(`settings.license.${t.status}.tooltip`,"Current license activation state."),detail:t.refreshRequired?s("settings.license.detail.refreshRecommended","License verification should be refreshed soon."):null,detailTone:a.licenseNoticeMuted}}function se({checked:t,onChange:s,testId:d,ariaLabel:j}){return e.jsxs("label",{className:a.toggleSwitch,"data-testid":d,children:[e.jsx("input",{type:"checkbox",className:a.toggleInput,checked:t,"aria-label":j,onChange:n=>s(n.target.checked)}),e.jsx("span",{className:a.toggleTrack,"aria-hidden":"true",children:e.jsx("span",{className:a.toggleThumb})})]})}function Ss(){const{t,selectedLocale:s,setLocale:d}=V(),{trackEvent:j}=pe(),{settings:n,license:l,licenseProvider:o,licenseControlsDisabled:f,licenseSubmitting:h,licenseMessage:A,activateLicense:N,refreshLicense:T,resetLicense:w,updateHotSetting:b,loading:y}=be(),[x,H]=u.useState(null),[k,S]=u.useState(""),E=l?ys(l,t):null,C=(l==null?void 0:l.tier)==="pro",B=(l==null?void 0:l.tier)==="pro"?l.maskedKey:void 0,I=(l==null?void 0:l.tier)==="pro"?"pro":"basic",c=u.useCallback(async(i,m)=>{await b(i,m),H(i),setTimeout(()=>H(_=>_===i?null:_),2e3)},[b]);return y?e.jsx("div",{className:a.page,children:e.jsx("div",{className:a.loading,children:t("common.loading")})}):e.jsxs("div",{className:a.page,children:[e.jsxs("div",{"data-testid":"settings-license-card",className:[a.card,(l==null?void 0:l.tier)==="pro"?a.licenseCardPro:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(v,{label:t("settings.license.title","License"),tooltip:t("settings.license.title.tooltip","Current license status and subscription tier.")}),e.jsx(p,{text:f?t("settings.license.disconnected.tooltip","Reconnect to the MCP server to manage license actions from WEPPY Dashboard."):t("settings.license.live.tooltip","License actions are sent to the MCP server immediately."),children:e.jsx("span",{className:`${a.headerBadge} ${f?"":a.headerBadgeLive}`,children:f?t("settings.license.disconnected","Disconnected"):t("settings.general.liveApply","Live Apply")})})]}),e.jsxs(e.Fragment,{children:[l?e.jsxs(e.Fragment,{children:[(()=>{const i=E;return e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:a.licenseGrid,children:[e.jsx("dt",{children:e.jsx(v,{label:t("settings.license.status","Status"),tooltip:t("settings.license.status.tooltip","Current license activation state.")})}),e.jsxs("dd",{children:[e.jsx("span",{className:`${a.statusDot} ${ms(l.status)}`}),e.jsx(p,{text:(i==null?void 0:i.tooltip)??t(`settings.license.${l.status}.tooltip`,"Current license activation state."),children:(i==null?void 0:i.label)??t(`settings.license.${l.status}`,l.status)})]}),e.jsx("dt",{children:e.jsx(v,{label:t("settings.license.tier","Tier"),tooltip:t("settings.license.tier.tooltip","Current subscription tier for available WEPPY Dashboard features.")})}),e.jsx("dd",{className:l.tier==="pro"?a.proBadge:"",children:e.jsx(p,{text:t(`tier.${l.tier}.tooltip`,"Available feature set for the connected license."),children:l.tier==="pro"?t("tier.pro","Pro"):t("tier.basic","Basic")})}),B&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(v,{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(p,{text:t("settings.license.keyValue.tooltip","Masked license key currently loaded by the server."),children:B})})]}),l.provider&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(v,{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(p,{text:t("settings.license.providerValue.tooltip","License provider used to validate this key."),children:l.provider})})]})]}),(i==null?void 0:i.detail)&&e.jsx("p",{className:`${a.licenseNotice} ${i.detailTone}`,children:l.refreshBlockedReason==="missing_session_token"?t("settings.license.detail.manualActivation","Manual activation required to restore Pro access."):i.detail}),l.refreshBlockedReason==="missing_session_token"&&e.jsx("p",{className:`${a.licenseNotice} ${a.licenseNoticeMuted}`,children:i==null?void 0:i.detail})]})})(),l.tier==="basic"&&e.jsx(p,{text:t("tier.upgrade.tooltip","Upgrade to Pro to unlock every feature."),children:e.jsx("a",{className:a.upgradeLink,href:"https://gum.co/u/din5in7h",target:"_blank",rel:"noopener noreferrer",onClick:()=>j("dashboard_click_event",{click_target:"upgrade_cta",placement:"settings_license",page:"settings"}),children:t("tier.upgrade")})})]}):e.jsx("div",{className:a.loading,children:t("settings.license.unavailable")}),e.jsxs("div",{className:a.licenseControls,children:[e.jsxs("div",{className:a.licenseControlRow,children:[e.jsxs("label",{className:a.licenseField,children:[e.jsx("span",{className:a.controlLabel,children:e.jsx(v,{label:t("settings.license.provider","Provider"),tooltip:t("settings.license.provider.tooltip","License provider used to validate this key.")})}),e.jsx("select",{"aria-label":t("settings.license.provider","Provider"),className:a.select,value:o,disabled:f||h,onChange:()=>{},children:e.jsx("option",{value:"gumroad",children:"gumroad"})})]}),e.jsx(p,{text:t("settings.license.refresh.tooltip","Re-fetch the current state from the license server. Useful when a billing change hasn't appeared yet."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:f||h||!C,onClick:()=>{T()},children:h?t("common.loading"):t("settings.license.refresh","Refresh License")})}),e.jsx(p,{text:t("settings.license.reset.tooltip","Remove the currently registered license key. Use this before activating with a different key."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:f||h||!C,onClick:()=>{w()},children:h?t("common.loading"):t("settings.license.reset","Reset License")})})]}),e.jsxs("div",{className:a.licenseControlRow,children:[e.jsxs("label",{className:`${a.licenseField} ${a.licenseFieldGrow}`,children:[e.jsx("span",{className:a.controlLabel,children:e.jsx(v,{label:t("settings.license.keyInput","License Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("input",{"aria-label":t("settings.license.keyInput","License Key"),className:a.textInput,type:"text",value:k,disabled:f||h,onChange:i=>S(i.target.value)})]}),e.jsx(p,{text:t("settings.license.activate.tooltip","Activate Pro features with the entered license key."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:f||h,onClick:()=>{(async()=>await N(k)&&S(""))()},children:h?t("common.loading"):t("settings.license.activate","Activate License")})})]}),A&&e.jsx("p",{className:a.licenseMessage,children:A})]})]})]}),e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(v,{label:t("settings.general.title","General Settings"),tooltip:t("settings.general.title.tooltip","Hot settings that apply immediately when changed.")}),e.jsx(p,{text:t("settings.general.liveApply.tooltip","Changes in this section are applied immediately without a separate save button."),children:e.jsx("span",{className:`${a.headerBadge} ${a.headerBadgeLive}`,children:t("settings.general.liveApply","Live Apply")})})]}),n?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:a.settingRow,children:[e.jsx("span",{className:a.settingLabel,children:e.jsx(v,{label:t("settings.general.logLevel","Log Level"),tooltip:t("settings.general.logLevel.tooltip","Sets how much detail WEPPY Dashboard writes to its logs.")})}),e.jsxs("div",{className:a.settingControl,children:[e.jsx("select",{className:a.select,value:n.hot.LOG_LEVEL,onChange:i=>c("LOG_LEVEL",i.target.value),children:hs.map(i=>e.jsx("option",{value:i,children:i},i))}),x==="LOG_LEVEL"&&e.jsx("span",{className:a.savedIndicator,children:t("settings.general.applied")})]})]}),e.jsxs("div",{className:a.settingRow,children:[e.jsx("span",{className:a.settingLabel,children:e.jsx(v,{label:t("settings.general.localHistory","Tool History Recording"),tooltip:t("settings.general.localHistory.tooltip","Stores local tool execution history for the WEPPY Dashboard history views.")})}),e.jsxs("div",{className:a.settingControl,children:[e.jsx("span",{className:`${a.savedIndicator} ${x==="ENABLE_LOCAL_HISTORY"?"":a.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(se,{checked:n.hot.ENABLE_LOCAL_HISTORY,ariaLabel:t("settings.general.localHistory","Tool History Recording"),testId:"settings-toggle-enable-local-history",onChange:i=>c("ENABLE_LOCAL_HISTORY",i)})]})]}),e.jsxs("div",{className:a.settingRow,children:[e.jsx("span",{className:a.settingLabel,children:e.jsx(v,{label:t("settings.general.localStatistics","Tool Statistics Collection"),tooltip:t("settings.general.localStatistics.tooltip","Aggregates local usage statistics for WEPPY Dashboard reporting.")})}),e.jsxs("div",{className:a.settingControl,children:[e.jsx("span",{className:`${a.savedIndicator} ${x==="ENABLE_LOCAL_STATISTICS"?"":a.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(se,{checked:n.hot.ENABLE_LOCAL_STATISTICS,ariaLabel:t("settings.general.localStatistics","Tool Statistics Collection"),testId:"settings-toggle-enable-local-statistics",onChange:i=>c("ENABLE_LOCAL_STATISTICS",i)})]})]}),e.jsxs("div",{className:a.settingRow,children:[e.jsx("span",{className:a.settingLabel,children:e.jsx(v,{label:t("settings.general.contextCapture","Context Capture"),tooltip:t("settings.general.contextCapture.tooltip","When enabled, WEPPY Dashboard records structured execution context for changelog and playtest views.")})}),e.jsxs("div",{className:a.settingControl,children:[e.jsx("span",{className:`${a.savedIndicator} ${x==="ENABLE_CONTEXT_CAPTURE"?"":a.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(se,{checked:n.hot.ENABLE_CONTEXT_CAPTURE,ariaLabel:t("settings.general.contextCapture","Context Capture"),testId:"settings-toggle-enable-context-capture",onChange:i=>c("ENABLE_CONTEXT_CAPTURE",i)})]})]}),e.jsxs("div",{className:a.settingRow,children:[e.jsx("span",{className:a.settingLabel,children:e.jsx(v,{label:t("settings.general.requestTimeout","Action Timeout"),tooltip:t("settings.general.requestTimeout.tooltip","Maximum time WEPPY Dashboard waits for an action before it fails.")})}),e.jsxs("div",{className:a.settingControl,children:[e.jsx("input",{type:"number",className:a.numberInput,value:n.hot.REQUEST_TIMEOUT,min:1e3,max:12e4,step:1e3,onChange:i=>{const m=parseInt(i.target.value,10);isNaN(m)||c("REQUEST_TIMEOUT",m)}}),e.jsx(p,{text:t("settings.general.requestTimeout.unit.tooltip","Action timeout is measured in milliseconds."),children:e.jsx("span",{className:a.unit,children:t("settings.general.requestTimeout.unit","ms")})}),x==="REQUEST_TIMEOUT"&&e.jsx("span",{className:a.savedIndicator,children:t("settings.general.applied","Applied")})]})]})]}):e.jsx("div",{className:a.loading,children:t("settings.unavailable")})]}),e.jsx(gs,{tier:I}),e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(v,{label:t("settings.cold.title","Server Environment"),tooltip:t("settings.cold.title.tooltip","Read-only server environment values loaded at startup.")}),e.jsx(p,{text:t("settings.readOnly.tooltip","This section shows values that cannot be edited from WEPPY Dashboard."),children:e.jsx("span",{className:a.headerBadge,children:t("settings.readOnly","Read-only")})})]}),n?e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:a.coldGrid,children:[e.jsx("dt",{children:e.jsx(v,{label:"HTTP_PORT",tooltip:t("settings.cold.httpPort.tooltip","Port number used by the MCP WEPPY Dashboard HTTP server.")})}),e.jsx("dd",{children:n.cold.HTTP_PORT}),e.jsx("dt",{children:e.jsx(v,{label:"HTTP_HOST",tooltip:t("settings.cold.httpHost.tooltip","Host interface that the MCP WEPPY Dashboard HTTP server binds to.")})}),e.jsx("dd",{children:n.cold.HTTP_HOST}),e.jsx("dt",{children:e.jsx(v,{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(p,{text:t("settings.cold.dashboardAutoOpen.value.tooltip","Current startup behavior for opening WEPPY Dashboard in a browser."),children:String(n.cold.DASHBOARD_AUTO_OPEN)})})]}),e.jsx("p",{className:a.coldHint,children:t("settings.cold.hint","Set via environment variables to change these values.")})]}):e.jsx("div",{className:a.loading,children:t("settings.unavailable")})]}),e.jsxs("div",{className:a.card,children:[e.jsx("div",{className:a.cardHeader,children:e.jsx(v,{label:t("settings.language.title","Language"),tooltip:t("settings.language.title.tooltip","Choose how the WEPPY Dashboard interface text is localized.")})}),e.jsxs("div",{className:a.langRow,children:[e.jsx("label",{children:e.jsx(v,{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(p,{text:t("settings.language.auto.tooltip","Follow the operating system's language. Falls back to English when not supported."),children:e.jsxs("select",{className:a.select,value:s,onChange:i=>d(i.target.value),children:[e.jsx("option",{value:he,children:t("settings.language.auto","Auto")}),me.map(i=>e.jsx("option",{value:i,children:ps[i]??i},i))]})})]})]})]})}export{Ss as Component};
@@ -1 +0,0 @@
1
- ._progressPromoWrap_t6ypv_1{display:flex;flex-direction:column;gap:8px}._progressPromo_t6ypv_1{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:14px 20px;display:flex;align-items:center;gap:16px}._progressMain_t6ypv_17{flex:1;min-width:0}._progressLabel_t6ypv_22{font-family:var(--font-label);font-size:11px;color:var(--text-secondary);margin-bottom:6px;display:flex;justify-content:space-between;gap:12px}._progressBar_t6ypv_32{height:6px;background:var(--bg-secondary);border-radius:3px;overflow:hidden}._progressFill_t6ypv_39{height:100%;background:var(--pro-badge);border-radius:3px;transition:width var(--transition)}._progressTextGroup_t6ypv_46{display:flex;flex-direction:column;gap:3px}._progressText_t6ypv_46{font-family:var(--font-label);font-size:13px;color:var(--pro-badge);white-space:nowrap;font-weight:500}._discountHint_t6ypv_60{font-size:11px;color:var(--text-muted);white-space:nowrap}._actions_t6ypv_66{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}._btn_t6ypv_74{display:inline-flex;align-items:center;justify-content:center;font-family:var(--font-label);font-size:12px;padding:6px 14px;border-radius:4px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;text-decoration:none;transition:background var(--transition),border-color var(--transition),opacity var(--transition)}._btn_t6ypv_74:hover{border-color:var(--accent);background:var(--accent-dim)}._btnOutline_t6ypv_95{border-color:var(--pro-badge);color:var(--pro-badge)}._btnOutline_t6ypv_95:hover{background:var(--pro-bg-soft);border-color:var(--pro-badge)}._btnPrimary_t6ypv_105{background:var(--pro-badge);color:#1a1407;border-color:var(--pro-badge)}._btnPrimary_t6ypv_105:hover{opacity:.9}._panel_t6ypv_115{background:linear-gradient(180deg,var(--pro-bg-soft),transparent 60%),var(--bg-secondary);border:1px solid var(--pro-border);border-radius:var(--radius);padding:24px 20px}._panelIcon_t6ypv_122{font-size:32px;margin-bottom:12px;text-align:center}._panelTitle_t6ypv_128{font-family:var(--font-label);font-size:15px;font-weight:600;color:var(--pro-text);margin-bottom:8px;text-align:center}._panelDesc_t6ypv_137{font-size:13px;color:var(--text-secondary);margin-bottom:16px;line-height:1.5;text-align:center}._benefitList_t6ypv_145{list-style:none;padding:0;margin:0 0 16px;display:flex;flex-direction:column;gap:4px}._benefitItem_t6ypv_154{font-size:12px;color:var(--text-secondary);padding-left:16px;position:relative}._benefitItem_t6ypv_154:before{content:"+";position:absolute;left:0;color:var(--pro-badge);font-weight:600}._panelDiscountHint_t6ypv_169{font-size:11px;color:var(--text-muted);text-align:center;margin-bottom:12px}@media(max-width:720px){._progressPromo_t6ypv_1{flex-direction:column;align-items:stretch}._progressText_t6ypv_46,._discountHint_t6ypv_60{white-space:normal}._actions_t6ypv_66{justify-content:stretch}._btn_t6ypv_74{width:100%}}._page_1warw_2{display:flex;flex-direction:column;gap:16px;max-width:900px}._card_1warw_10{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._cardHeader_1warw_17{font-family:var(--font-label);font-size:13px;font-weight:600;color:var(--text-primary);margin-bottom:12px;display:flex;align-items:center;justify-content:space-between;gap:8px}._clearButton_1warw_29{border:1px solid rgba(209,84,84,.5);background:#d154541f;color:#f4c1c1;border-radius:8px;padding:6px 12px;cursor:pointer}._statusRow_1warw_39{display:flex;align-items:center;gap:12px;margin-bottom:8px}._metaItem_1warw_46{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._statusGrid_1warw_52{display:grid;grid-template-columns:auto 1fr;gap:4px 16px;font-size:12px}._statusGrid_1warw_52 dt{color:var(--text-secondary);font-family:var(--font-label)}._statusGrid_1warw_52 dd{margin:0;font-family:var(--font-code);color:var(--text-primary)}._table_1warw_71{width:100%;border-collapse:collapse;font-family:var(--font-code);font-size:12px}._table_1warw_71 th{text-align:left;padding:6px 12px;border-bottom:1px solid var(--border);color:var(--text-secondary);font-family:var(--font-label);font-weight:500;font-size:11px}._table_1warw_71 td{padding:6px 12px;border-bottom:1px solid var(--border);color:var(--text-primary)}._table_1warw_71 tr:last-child td{border-bottom:none}._directionRail_1warw_99{display:inline-flex;align-items:center;gap:10px}._endpointLabel_1warw_105{color:var(--text-secondary)}._optionRail_1warw_109{display:inline-flex;align-items:center;gap:6px}._directionOption_1warw_115{display:inline-flex;align-items:center;justify-content:center;width:28px;height:24px;border-radius:6px;border:1px solid var(--border);font-family:var(--font-code);font-size:13px;cursor:help;-webkit-user-select:none;user-select:none}._directionOptionActive_1warw_129{background:var(--bg-secondary)}._directionOptionInactive_1warw_133{background:transparent;opacity:.45;color:var(--text-muted)}._directionOptionActive_1warw_129._direction_forward_1warw_139{color:var(--success)}._directionOptionActive_1warw_129._direction_bidirectional_1warw_143{color:var(--accent)}._directionOptionActive_1warw_129._direction_reverse_1warw_147{color:var(--warning)}._lockBadge_1warw_152{display:inline-block;margin-left:6px;font-size:11px;color:var(--text-muted)}._proBadge_1warw_160{display:inline-block;margin-left:6px;padding:1px 5px;font-size:9px;font-weight:600;letter-spacing:.05em;color:#1a1407;background:var(--pro-badge);border-radius:3px;vertical-align:middle}._forwardBadge_1warw_174{display:inline-block;padding:2px 8px;font-size:10px;font-weight:600;letter-spacing:.04em;color:var(--text-secondary);background:var(--bg-secondary);border:1px solid var(--border);border-radius:4px}._logContainer_1warw_187{max-height:240px;overflow-y:auto;font-family:var(--font-code);font-size:11px}._logEntry_1warw_194{display:flex;gap:10px;padding:3px 0;border-bottom:1px solid var(--border);color:var(--text-primary)}._logEntry_1warw_194:last-child{border-bottom:none}._logTime_1warw_206{color:var(--text-muted);flex-shrink:0;width:44px}._logType_1warw_212{font-weight:500;flex-shrink:0;width:90px;text-transform:uppercase;font-size:10px;letter-spacing:.04em}._logTypeWrite_1warw_221{color:var(--success)}._logTypeUpdate_1warw_225{color:var(--accent)}._logTypeDelete_1warw_229{color:var(--error)}._logTypeIdle_1warw_233{color:var(--text-muted)}._logPath_1warw_237{color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._logEmpty_1warw_244{color:var(--text-muted);font-style:italic;padding:8px 0}._overlay_1warw_251{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:48px 24px;gap:16px}._overlayTitle_1warw_261{font-family:var(--font-label);font-size:15px;font-weight:600;color:var(--text-primary)}._overlayMessage_1warw_268{font-size:13px;color:var(--text-secondary);max-width:400px}._checklist_1warw_274{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px;text-align:left}._checkItem_1warw_284{font-family:var(--font-code);font-size:12px;color:var(--text-secondary);padding-left:20px;position:relative}._checkItem_1warw_284:before{content:"○";position:absolute;left:0;color:var(--text-muted)}._upgradePanel_1warw_300{background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._upgradePanelHeader_1warw_307{font-family:var(--font-label);font-size:13px;font-weight:600;color:var(--accent);margin-bottom:8px}._benefitList_1warw_315{list-style:none;padding:0;margin:0 0 12px;display:flex;flex-direction:column;gap:4px}._benefitItem_1warw_324{font-size:12px;color:var(--text-secondary);padding-left:16px;position:relative}._benefitItem_1warw_324:before{content:"+";position:absolute;left:0;color:var(--accent);font-weight:600}._upgradeActions_1warw_339{display:flex;gap:8px}._btn_1warw_344{font-family:var(--font-label);font-size:12px;padding:6px 14px;border-radius:4px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._btn_1warw_344:hover{border-color:var(--accent);background:var(--accent-dim)}._btnPrimary_1warw_361{background:var(--accent);color:var(--bg-card);border-color:var(--accent)}._btnPrimary_1warw_361:hover{opacity:.9}._disabled_1warw_372{opacity:.4;pointer-events:none}
@@ -1,4 +0,0 @@
1
- import{r as c,a as I,D as L,u as C,k as S,n as R,j as e,d as k,l as $,m as O,T as D,o as A}from"./index-FfT2oWAB.js";import{I as h}from"./InfoLabel-B9KT3kfU.js";import{T as x}from"./TooltipText-Baw38jOU.js";import{C as E}from"./ConfirmModal-CmJCz5rg.js";import{S as B}from"./StatusBadge-Bxe88ki2.js";import{D as H,T as M}from"./TierComparison-Dyf-knpe.js";const F=5e3;function U(){const[t,a]=c.useState(null),[w,p]=c.useState([]),[o,y]=c.useState(!0),[u,f]=c.useState(null),m=c.useRef(null),_=c.useRef(null),r=c.useCallback(async()=>{var d;try{const[i,b]=await Promise.all([I.get("/sync/status"),I.get("/api/dashboard/place-summary")]);a(i);const j=(d=b.places)==null?void 0:d.find(N=>N.isActive);f((j==null?void 0:j.placeDirName)??null)}catch{}},[]),g=c.useCallback(async()=>{try{const d=await I.get("/sync/history",{limit:"30"});p(d.entries??[])}catch{p([])}},[]),s=c.useCallback(async()=>{await Promise.all([r(),g()]),y(!1)},[r,g]),T=c.useCallback(()=>{s()},[s]),P=c.useCallback(async()=>{await I.post("/api/dashboard/sync/history/clear"),p([]),r()},[r]);return c.useEffect(()=>(s(),_.current=setInterval(s,F),()=>{_.current&&clearInterval(_.current)}),[s]),c.useEffect(()=>{const d=new L;m.current=d,d.connect();const i=d.on("sync",()=>{r(),g()});return()=>{i(),d.disconnect(),m.current=null}},[r,g]),{status:t,history:w,loading:o,activePlaceDirName:u,refresh:T,clearHistory:P}}const W="_actions_t6ypv_66",q="_btn_t6ypv_74",G="_btnOutline_t6ypv_95",z="_btnPrimary_t6ypv_105",Y="_panel_t6ypv_115",V="_panelIcon_t6ypv_122",J="_panelTitle_t6ypv_128",Q="_panelDesc_t6ypv_137",X="_benefitList_t6ypv_145",Z="_benefitItem_t6ypv_154",l={actions:W,btn:q,btnOutline:G,btnPrimary:z,panel:Y,panelIcon:V,panelTitle:J,panelDesc:Q,benefitList:X,benefitItem:Z};function K({icon:t,title:a,description:w,benefits:p,upgradeLabel:o,upgradeHref:y}){const{t:u}=C(),[f,m]=c.useState(!1),{trackEvent:_}=S(),{pathname:r}=R(),g=r.replace(/^\//,"").split("/")[0]||"overview";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:l.panel,children:[t&&e.jsx("div",{className:l.panelIcon,children:t}),e.jsx("div",{className:l.panelTitle,children:a}),e.jsx("div",{className:l.panelDesc,children:w}),e.jsx("ul",{className:l.benefitList,children:p.map(s=>e.jsx("li",{className:l.benefitItem,children:s},s))}),e.jsx("div",{className:l.panelDiscountWrap,children:e.jsx(H,{variant:"centered"})}),e.jsxs("div",{className:l.actions,children:[e.jsx("button",{className:`${l.btn} ${l.btnOutline}`,onClick:()=>{_("dashboard_click_event",{click_target:"tier_compare",placement:"tier_panel",page:g}),m(!0)},children:u("tier.compare","Basic vs Pro")}),e.jsx("a",{className:`${l.btn} ${l.btnPrimary}`,href:y,target:"_blank",rel:"noreferrer",onClick:()=>_("dashboard_click_event",{click_target:"upgrade_cta",placement:"tier_panel",page:g}),children:o})]})]}),f&&e.jsx(M,{onClose:()=>m(!1)})]})}const ee="_page_1warw_2",te="_card_1warw_10",se="_cardHeader_1warw_17",ne="_clearButton_1warw_29",ae="_statusRow_1warw_39",ie="_metaItem_1warw_46",ce="_statusGrid_1warw_52",oe="_table_1warw_71",re="_directionRail_1warw_99",le="_endpointLabel_1warw_105",de="_optionRail_1warw_109",pe="_directionOption_1warw_115",ye="_directionOptionActive_1warw_129",ue="_directionOptionInactive_1warw_133",_e="_direction_forward_1warw_139",he="_direction_bidirectional_1warw_143",me="_direction_reverse_1warw_147",ge="_lockBadge_1warw_152",we="_proBadge_1warw_160",fe="_forwardBadge_1warw_174",xe="_logContainer_1warw_187",be="_logEntry_1warw_194",je="_logTime_1warw_206",ve="_logType_1warw_212",Te="_logTypeWrite_1warw_221",Ne="_logTypeUpdate_1warw_225",Ie="_logTypeDelete_1warw_229",Pe="_logTypeIdle_1warw_233",Ce="_logPath_1warw_237",Le="_logEmpty_1warw_244",Se="_overlay_1warw_251",Re="_overlayTitle_1warw_261",ke="_overlayMessage_1warw_268",$e="_checklist_1warw_274",Oe="_checkItem_1warw_284",De="_upgradePanel_1warw_300",Ae="_upgradePanelHeader_1warw_307",Ee="_benefitList_1warw_315",Be="_benefitItem_1warw_324",He="_upgradeActions_1warw_339",Me="_btn_1warw_344",Fe="_btnPrimary_1warw_361",Ue="_disabled_1warw_372",n={page:ee,card:te,cardHeader:se,clearButton:ne,statusRow:ae,metaItem:ie,statusGrid:ce,table:oe,directionRail:re,endpointLabel:le,optionRail:de,directionOption:pe,directionOptionActive:ye,directionOptionInactive:ue,direction_forward:_e,direction_bidirectional:he,direction_reverse:me,lockBadge:ge,proBadge:we,forwardBadge:fe,logContainer:xe,logEntry:be,logTime:je,logType:ve,logTypeWrite:Te,logTypeUpdate:Ne,logTypeDelete:Ie,logTypeIdle:Pe,logPath:Ce,logEmpty:Le,overlay:Se,overlayTitle:Re,overlayMessage:ke,checklist:$e,checkItem:Oe,upgradePanel:De,upgradePanelHeader:Ae,benefitList:Ee,benefitItem:Be,upgradeActions:He,btn:Me,btnPrimary:Fe,disabled:Ue},We=[{key:"forward",symbol:"←"},{key:"bidirectional",symbol:"↔"},{key:"reverse",symbol:"→"}];function qe(t){const a=new Date(t);return`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}`}function Ge(t){switch(t){case"write":return n.logTypeWrite;case"update":return n.logTypeUpdate;case"delete":return n.logTypeDelete;default:return n.logTypeIdle}}function ze(t){switch(t){case"syncing":return"syncing";case"initializing":return"initializing";case"idle":return"idle";default:return"offline"}}function Ye(t,a,w,p){const o=t(`sync.directions.cat.${a}`,a.charAt(0).toUpperCase()+a.slice(1)),y=t("sync.directions.endpoint.local","Local"),u=t("sync.directions.endpoint.studio","Studio");switch(w){case"forward":return[`${o}: ${y} <- ${u}`,t("sync.directions.tooltip.forward.body","Studio changes sync to local files only")].join(`
2
- `);case"bidirectional":return[`${o}: ${y} <-> ${u}`,t("sync.directions.tooltip.bidirectional.body","Two-way sync between Local and Studio"),p?t("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
3
- `);case"reverse":return[`${o}: ${y} -> ${u}`,t("sync.directions.tooltip.reverse.body","Push local file changes to Studio"),p?t("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
4
- `);default:return o}}const Ve=["scripts","values","containers","data","services"];function Je(t,a){return a==="manual"?t("sync.directions.mode.manual","Manual"):a==="auto"?t("sync.directions.mode.auto","Auto"):"-"}function Qe(t,a){return a==="manual"?t("sync.directions.mode.manual.tooltip","Applies sync changes only when you trigger them manually."):a==="auto"?t("sync.directions.mode.auto.tooltip","Applies sync changes automatically when updates arrive."):""}function Xe(t,a){switch(a){case"write":return t("sync.log.type.write","WRITE");case"update":return t("sync.log.type.update","UPDATE");case"delete":return t("sync.log.type.delete","DELETE");default:return t("sync.log.type.idle","IDLE")}}function Ze(t,a){switch(a){case"write":return t("sync.log.type.write.tooltip","A new sync output was written to disk.");case"update":return t("sync.log.type.update.tooltip","An existing synced file or instance was updated.");case"delete":return t("sync.log.type.delete.tooltip","A synced file or instance was removed.");default:return t("sync.log.type.idle.tooltip","A sync event was recorded without a file mutation.")}}function it(){const{t}=C(),{level:a}=k(),{tier:w,loading:p}=$(),o=U(),{show:y}=O(),[u,f]=c.useState(!1),[m,_]=c.useState(!1),r=!p&&w==="basic";if(a==="disconnected"||a==="serverOnly")return e.jsx("div",{className:n.page,children:e.jsx("div",{className:n.card,children:e.jsxs("div",{className:n.overlay,children:[e.jsx("div",{className:n.overlayTitle,children:t("sync.overlay.title","Roblox Studio plugin required")}),e.jsx("div",{className:n.overlayMessage,children:t("sync.overlay.message","Sync status will be available once the Roblox Studio plugin connects.")}),e.jsxs("ul",{className:n.checklist,children:[e.jsx("li",{className:n.checkItem,children:t("sync.overlay.check1","Is Roblox Studio running?")}),e.jsx("li",{className:n.checkItem,children:t("sync.overlay.check2","Is the WEPPY Plugin installed?")})]})]})})});const s=o.status,T=o.history,P=ze(s==null?void 0:s.state),d=async()=>{_(!0);try{await o.clearHistory(),y(t("toast.clearSuccess","Cleared successfully"),"success"),f(!1)}catch{y(t("toast.clearFailed","Failed to clear data"),"error")}finally{_(!1)}};return e.jsxs("div",{className:n.page,children:[e.jsxs("div",{className:n.card,children:[e.jsxs("div",{className:n.cardHeader,children:[e.jsx(x,{text:t("sync.status.title.tooltip","Current Studio and local file sync status for this place."),children:t("sync.status.title","Sync Status")}),r&&e.jsx(x,{text:t("sync.status.forwardOnly.tooltip","Basic tier allows Studio to local forward sync only."),children:e.jsx("span",{className:n.forwardBadge,children:t("sync.status.forwardOnly","Forward Only")})})]}),e.jsxs("div",{className:n.statusRow,children:[e.jsx(B,{status:P}),(s==null?void 0:s.placeName)&&e.jsxs("span",{className:n.metaItem,children:[e.jsx(h,{label:t("sync.status.place","Place"),tooltip:t("sync.status.place.tooltip","Connected Roblox place name and place ID.")}),": ",s.placeName,s.placeId?` (${s.placeId})`:""]})]}),e.jsxs("dl",{className:n.statusGrid,children:[(s==null?void 0:s.syncRoot)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(h,{label:t("sync.status.path","Path"),tooltip:t("sync.status.path.tooltip","Local filesystem root currently used for sync output.")})}),e.jsx("dd",{children:s.syncRoot})]}),o.activePlaceDirName&&(s==null?void 0:s.syncRoot)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(h,{label:t("sync.status.placePath","Place Path"),tooltip:t("sync.status.placePath.tooltip","Active place directory where explorer files are synced.")})}),e.jsx("dd",{children:`${s.syncRoot}/${o.activePlaceDirName}/explorer`})]}),(s==null?void 0:s.instanceCount)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(h,{label:t("sync.status.instances","Instances"),tooltip:t("sync.status.instances.tooltip","Total synced Roblox instances tracked in the local mirror.")})}),e.jsx("dd",{children:s.instanceCount})]}),(s==null?void 0:s.scriptCount)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(h,{label:t("sync.status.scripts","Scripts"),tooltip:t("sync.status.scripts.tooltip","Total synced script files currently indexed for this place.")})}),e.jsx("dd",{children:s.scriptCount})]}),(s==null?void 0:s.state)==="syncing"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(h,{label:t("sync.status.state","State"),tooltip:t("sync.status.state.tooltip","Current runtime sync state reported by the server.")})}),e.jsx("dd",{children:t("status.syncing","Syncing")})]})]})]}),(s==null?void 0:s.directions)&&e.jsxs("div",{className:n.card,children:[e.jsx("div",{className:n.cardHeader,children:e.jsx(x,{text:t("sync.directions.title.tooltip","Per-category sync direction and apply behavior between Local and Studio."),children:t("sync.directions.title","Sync Directions")})}),e.jsxs("table",{className:n.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:e.jsx(h,{label:t("sync.directions.type","Type"),tooltip:t("sync.directions.type.tooltip","Sync category affected by this rule.")})}),e.jsx("th",{children:e.jsx(h,{label:t("sync.directions.direction","Direction"),tooltip:t("sync.directions.direction.tooltip","Whether each category syncs from Studio, to Studio, or both ways.")})}),e.jsx("th",{children:e.jsx(h,{label:t("sync.directions.applyMode","Apply Mode"),tooltip:t("sync.directions.applyMode.tooltip","How incoming sync changes are applied for this category.")})})]})}),e.jsx("tbody",{children:Ve.map(i=>{var N;const b=s.directions[i],j=(N=s.applyModes)==null?void 0:N[i];return e.jsxs("tr",{children:[e.jsx("td",{children:t(`sync.directions.cat.${i}`,i.charAt(0).toUpperCase()+i.slice(1))}),e.jsx("td",{children:e.jsxs("div",{className:n.directionRail,"aria-label":`${i}-direction-rail`,children:[e.jsx(x,{text:t("sync.directions.endpoint.local.tooltip","Local files on disk are always shown on the left side of the direction rail."),children:e.jsx("span",{className:n.endpointLabel,children:t("sync.directions.endpoint.local","Local")})}),e.jsx("span",{className:n.optionRail,children:We.map(v=>e.jsx(D,{text:Ye(t,i,v.key,r),children:e.jsx("span",{className:`${n.directionOption} ${b===v.key?n.directionOptionActive:n.directionOptionInactive} ${n[`direction_${v.key}`]??""}`,"data-active":b===v.key?"true":"false",children:v.symbol})},v.key))}),e.jsx(x,{text:t("sync.directions.endpoint.studio.tooltip","Roblox Studio is always shown on the right side of the direction rail."),children:e.jsx("span",{className:n.endpointLabel,children:t("sync.directions.endpoint.studio","Studio")})})]})}),e.jsx("td",{children:e.jsx(x,{text:Qe(t,j),children:Je(t,j)})})]},i)})})]})]}),e.jsxs("div",{className:n.card,children:[e.jsxs("div",{className:n.cardHeader,children:[e.jsx("span",{children:t("sync.log.title","Sync Log")}),e.jsx("button",{className:n.clearButton,onClick:()=>f(!0),children:t("common.clear","Clear")})]}),e.jsx("div",{className:n.logContainer,children:T.length===0?e.jsx("div",{className:n.logEmpty,children:t("sync.log.empty","No sync events yet")}):T.map((i,b)=>e.jsxs("div",{className:n.logEntry,children:[e.jsx("span",{className:n.logTime,children:qe(i.timestamp)}),e.jsx(x,{text:Ze(t,i.type),children:e.jsx("span",{className:`${n.logType} ${Ge(i.type)}`,children:Xe(t,i.type)})}),e.jsxs("span",{className:n.logPath,children:[i.path,i.details?` — ${i.details}`:""]})]},b))})]}),r&&e.jsx(K,{title:t("sync.upgrade.title","Unlock Full Sync with Pro"),description:t("tier.banner.save","Save AI tokens with Pro!"),benefits:[t("sync.upgrade.benefit1","Bidirectional sync — edit files, auto-apply to Studio"),t("sync.upgrade.benefit2","Reverse sync — push file changes back to Studio"),t("sync.upgrade.benefit3","Full sync history and detailed change log")],upgradeLabel:t("sync.upgrade.buy","Upgrade to Pro"),upgradeHref:A.sync}),e.jsx(E,{open:u,title:t("sync.clear.title","Clear sync log?"),message:t("sync.clear.message","This permanently removes the stored sync log for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:m,onCancel:()=>!m&&f(!1),onConfirm:d})]})}export{it as Component};
@@ -1 +0,0 @@
1
- ._wrapper_hzgda_2{overflow-x:auto}._table_hzgda_7{width:100%;border-collapse:collapse;font-family:var(--font-code);font-size:12px}._table_hzgda_7 th{text-align:left;color:var(--text-muted);font-weight:500;padding:6px 8px;border-bottom:1px solid var(--border);background:var(--bg-secondary);white-space:nowrap;-webkit-user-select:none;user-select:none}._table_hzgda_7 td{padding:6px 8px;color:var(--text-primary);border-bottom:1px solid var(--border-dim, rgba(255, 255, 255, .04))}._sortable_hzgda_32{cursor:pointer;transition:color var(--transition)}._sortable_hzgda_32:hover{color:var(--accent)}._sortArrow_hzgda_41{margin-left:4px;font-size:10px}._table_hzgda_7 tbody tr:hover td{background:var(--accent-dim)}._clickable_hzgda_52{cursor:pointer}._empty_hzgda_57{text-align:center;color:var(--text-muted);font-style:italic;padding:24px 8px}._expandedRow_hzgda_65 td{padding:0!important;border-bottom:1px solid var(--border)}._expandedRow_hzgda_65:hover td{background:transparent!important}._expandedCell_hzgda_74{padding:0!important}._page_z41at_2{display:flex;flex-direction:column;gap:var(--content-gap);max-width:var(--content-max)}._card_z41at_12{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._cardToolbar_z41at_19{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}._sectionTitle_z41at_27{font-family:var(--font-label);font-size:13px;color:var(--text-primary)}._dangerButton_z41at_33{border:1px solid var(--danger-border);background:var(--danger-bg);color:var(--danger-text);border-radius:var(--radius-sm);padding:6px 12px;font-family:var(--font-label);font-size:12px;font-weight:500;cursor:pointer;transition:background var(--transition),border-color var(--transition)}._dangerButton_z41at_33:hover{background:var(--danger-hover-bg);border-color:var(--danger)}._proBadge_z41at_52{display:inline-block;margin-left:6px;padding:1px 5px;font-size:9px;font-weight:600;letter-spacing:.05em;color:#1a1407;background:var(--pro-badge);border-radius:3px;vertical-align:middle}._statusOk_z41at_66{display:inline-block;padding:2px 8px;border-radius:999px;background:color-mix(in srgb,var(--success) 14%,transparent);color:var(--success);font-weight:500}._statusFallback_z41at_75{display:inline-block;padding:2px 8px;border-radius:999px;background:#4990e224;color:#6fb6ff;font-weight:600}._statusUnsupported_z41at_84{display:inline-block;padding:2px 8px;border-radius:999px;background:#f0b42826;color:#d7a43c;font-weight:600}._statusError_z41at_93{display:inline-block;padding:2px 8px;border-radius:999px;background:#d1545424;color:#f09c9c;font-weight:600}._tierBasic_z41at_103{color:var(--text-secondary)}._tierPro_z41at_107{color:var(--pro-badge);font-weight:500}._tierMixed_z41at_112{color:var(--text-primary);font-weight:500}._errorText_z41at_118{color:var(--error)}._filterRow_z41at_123{display:flex;align-items:center;gap:12px;margin-bottom:12px}._filterLabel_z41at_130{font-family:var(--font-label);font-size:11px;color:var(--text-secondary);display:flex;align-items:center;gap:6px}._filterSelect_z41at_139{font-family:var(--font-code);font-size:12px;padding:3px 8px;border:1px solid var(--border);border-radius:4px;background:var(--bg-secondary);color:var(--text-primary)}._expandedRow_z41at_150{background:var(--bg-secondary);padding:12px 16px}._expandedSection_z41at_155{margin-bottom:8px;font-size:12px;color:var(--text-secondary)}._expandedSection_z41at_155:last-child{margin-bottom:0}._detailList_z41at_165{display:flex;flex-direction:column;gap:6px}._detailItem_z41at_171{display:flex;flex-wrap:wrap;gap:6px}._detailLabel_z41at_177{font-family:var(--font-label);color:var(--text-muted)}._detailValue_z41at_182{color:var(--text-primary);word-break:break-word}._pre_z41at_187{font-family:var(--font-code);font-size:11px;color:var(--text-primary);background:var(--bg-card);border:1px solid var(--border);border-radius:4px;padding:8px;margin-top:4px;overflow-x:auto;max-height:200px;overflow-y:auto;white-space:pre-wrap;word-break:break-all}._pagination_z41at_204{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:12px}._pageInfo_z41at_212{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._btn_z41at_218{font-family:var(--font-label);font-size:12px;padding:4px 12px;border-radius:4px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._btn_z41at_218:hover:not(:disabled){border-color:var(--accent);background:var(--accent-dim)}._btn_z41at_218:disabled{opacity:.4;cursor:default}._tierDistribution_z41at_241{margin-bottom:16px}._tierBarWrap_z41at_245{display:flex;height:12px;border-radius:6px;overflow:hidden;background:var(--bg-secondary)}._tierBarBasic_z41at_253{background:var(--text-secondary);transition:width .3s ease}._tierBarPro_z41at_258{background:var(--accent);transition:width .3s ease}._tierLabels_z41at_263{display:flex;justify-content:space-between;margin-top:4px;font-family:var(--font-code);font-size:11px;color:var(--text-secondary)}._statsTableWrap_z41at_272{border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}._statsTable_z41at_272{width:100%;border-collapse:collapse}._statsTable_z41at_272 th,._statsTable_z41at_272 td{padding:10px 12px;font-size:12px;text-align:left;border-bottom:1px solid var(--border)}._statsTable_z41at_272 th{font-family:var(--font-label);font-size:11px;font-weight:500;color:var(--text-secondary);background:var(--bg-secondary)}._statsTable_z41at_272 tbody tr:last-child td{border-bottom:none}._sortableHeader_z41at_303{cursor:pointer;-webkit-user-select:none;user-select:none}._sortArrow_z41at_308{margin-left:4px}._statsToolRow_z41at_312{cursor:pointer}._statsToolRow_z41at_312:hover td{background:var(--bg-secondary)}._statsActionRow_z41at_320 td{background:color-mix(in srgb,var(--bg-secondary) 72%,transparent)}._expandButton_z41at_324{display:inline-flex;align-items:center;gap:8px;padding:0;border:none;background:transparent;color:inherit;font:inherit;cursor:pointer}._expandIcon_z41at_336{width:10px;color:var(--text-secondary)}._actionLabel_z41at_341{display:inline-block;padding-left:18px;font-family:var(--font-code);color:var(--text-secondary)}._emptyStats_z41at_348{text-align:center;color:var(--text-muted)}._summaryLine_z41at_354{margin-top:12px;font-family:var(--font-code);font-size:12px;color:var(--text-muted);text-align:right}
@@ -1 +0,0 @@
1
- import{j as s,r,a as D,D as tt,u as et,m as st}from"./index-FfT2oWAB.js";import{T as B}from"./TooltipText-Baw38jOU.js";import{C as at}from"./ConfirmModal-CmJCz5rg.js";import{T as ot}from"./Tabs-BNtOqYlc.js";const lt="_wrapper_hzgda_2",rt="_table_hzgda_7",it="_sortable_hzgda_32",nt="_sortArrow_hzgda_41",ct="_clickable_hzgda_52",dt="_empty_hzgda_57",ut="_expandedRow_hzgda_65",pt="_expandedCell_hzgda_74",S={wrapper:lt,table:rt,sortable:it,sortArrow:nt,clickable:ct,empty:dt,expandedRow:ut,expandedCell:pt};function ht({columns:e,data:a,sortBy:m,sortDir:j="asc",onSort:M,onRowClick:k,rowKey:E,emptyMessage:L,expandedKey:A,renderExpandedRow:b}){return s.jsx("div",{className:S.wrapper,children:s.jsxs("table",{className:S.table,children:[s.jsx("thead",{children:s.jsx("tr",{children:e.map(c=>s.jsxs("th",{style:c.width?{width:c.width}:void 0,className:c.sortable?S.sortable:void 0,onClick:c.sortable&&M?()=>M(c.key):void 0,children:[s.jsx("span",{children:c.label}),c.sortable&&m===c.key&&s.jsx("span",{className:S.sortArrow,children:j==="asc"?"▴":"▾"})]},c.key))})}),s.jsx("tbody",{children:a.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:e.length,className:S.empty,children:L||"No data"})}):a.map((c,w)=>{const p=E?E(c):String(w),h=A!=null&&p===A&&b?b(c):null;return s.jsxs(r.Fragment,{children:[s.jsx("tr",{className:k?S.clickable:void 0,onClick:k?()=>k(c):void 0,children:e.map(f=>s.jsx("td",{children:f.render?f.render(c):String(c[f.key]??"")},f.key))}),h&&s.jsx("tr",{className:S.expandedRow,children:s.jsx("td",{colSpan:e.length,className:S.expandedCell,children:h})})]},p)})})]})})}function mt(e){return{...e,sequenceNumber:typeof e.sequenceNumber=="number"?e.sequenceNumber:void 0,executionTimeMs:typeof e.executionTimeMs=="number"?e.executionTimeMs:void 0}}const xt=50;function bt(){const[e,a]=r.useState(null),[m,j]=r.useState(!0),[M,k]=r.useState([]),[E,L]=r.useState(0),[A,b]=r.useState(!1),[c,w]=r.useState(!0),[p,v]=r.useState(0),[h,f]=r.useState(""),H=r.useRef(null),_=r.useCallback(async()=>{j(!0);try{const y=await D.get("/api/dashboard/tool-stats");a(y)}catch{}finally{j(!1)}},[]),g=r.useCallback(async(y,z)=>{w(!0);try{const C={limit:String(xt),offset:String(y)};z&&(C.tool=z);const P=await D.get("/api/dashboard/history",C);k(P.entries.map(mt)),L(P.total),b(P.hasMore)}catch{k([]),L(0),b(!1)}finally{w(!1)}},[]),F=r.useCallback(()=>{_(),g(p,h)},[g,_,p,h]),d=r.useCallback(async()=>{await D.post("/api/dashboard/tools/history/clear"),g(p,h)},[g,p,h]),O=r.useCallback(async()=>{await D.post("/api/dashboard/tools/statistics/clear"),_()},[_]);return r.useEffect(()=>{_()},[_]),r.useEffect(()=>{g(p,h)},[g,p,h]),r.useEffect(()=>{const y=new tt;H.current=y,y.connect();const z=y.on("command",()=>{_(),g(p,h)});return()=>{z(),y.disconnect(),H.current=null}},[g,_,p,h]),{statistics:e,statsLoading:m,history:M,historyTotal:E,historyHasMore:A,historyLoading:c,historyOffset:p,historyToolFilter:h,setHistoryOffset:v,setHistoryToolFilter:f,refresh:F,clearHistory:d,clearStatistics:O}}const ft="_page_z41at_2",_t="_card_z41at_12",gt="_cardToolbar_z41at_19",yt="_sectionTitle_z41at_27",Ct="_dangerButton_z41at_33",jt="_proBadge_z41at_52",kt="_statusOk_z41at_66",Tt="_statusFallback_z41at_75",St="_statusUnsupported_z41at_84",Nt="_statusError_z41at_93",wt="_tierBasic_z41at_103",vt="_tierPro_z41at_107",zt="_tierMixed_z41at_112",Bt="_filterRow_z41at_123",Mt="_filterLabel_z41at_130",Et="_filterSelect_z41at_139",Lt="_expandedRow_z41at_150",At="_expandedSection_z41at_155",Pt="_detailList_z41at_165",Rt="_detailItem_z41at_171",Ht="_detailLabel_z41at_177",Ft="_detailValue_z41at_182",Ot="_pre_z41at_187",It="_pagination_z41at_204",$t="_pageInfo_z41at_212",Dt="_btn_z41at_218",qt="_tierDistribution_z41at_241",Wt="_tierBarWrap_z41at_245",Ut="_tierBarBasic_z41at_253",Kt="_tierBarPro_z41at_258",Vt="_tierLabels_z41at_263",Gt="_statsTableWrap_z41at_272",Jt="_statsTable_z41at_272",Zt="_sortableHeader_z41at_303",Qt="_sortArrow_z41at_308",Xt="_statsToolRow_z41at_312",Yt="_statsActionRow_z41at_320",te="_expandButton_z41at_324",ee="_expandIcon_z41at_336",se="_actionLabel_z41at_341",ae="_emptyStats_z41at_348",oe="_summaryLine_z41at_354",o={page:ft,card:_t,cardToolbar:gt,sectionTitle:yt,dangerButton:Ct,proBadge:jt,statusOk:kt,statusFallback:Tt,statusUnsupported:St,statusError:Nt,tierBasic:wt,tierPro:vt,tierMixed:zt,filterRow:Bt,filterLabel:Mt,filterSelect:Et,expandedRow:Lt,expandedSection:At,detailList:Pt,detailItem:Rt,detailLabel:Ht,detailValue:Ft,pre:Ot,pagination:It,pageInfo:$t,btn:Dt,tierDistribution:qt,tierBarWrap:Wt,tierBarBasic:Ut,tierBarPro:Kt,tierLabels:Vt,statsTableWrap:Gt,statsTable:Jt,sortableHeader:Zt,sortArrow:Qt,statsToolRow:Xt,statsActionRow:Yt,expandButton:te,expandIcon:ee,actionLabel:se,emptyStats:ae,summaryLine:oe},W=50;function le(e){const a=new Date(e);return`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}:${String(a.getSeconds()).padStart(2,"0")}`}function q(e){return typeof e!="number"||!Number.isFinite(e)?"-":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function R(e,a){return a==="pro"?e("tier.pro","Pro"):a==="mixed"?e("tier.mixed","Mixed"):e("tier.basic","Basic")}function G(e,a){return a!==e&&a.startsWith(`${e}_`)?a.slice(e.length+1):""}function re(e,a){const m=G(e,a);return m?`${e}.${m}`:e}function V(e){return typeof e=="string"&&e.length>0?e:void 0}function ie(e){if(!Array.isArray(e))return;const a=e.filter(m=>typeof m=="string"&&m.length>0);return a.length>0?a:void 0}function ne(e){const a=e.result??{};return{requestedCommand:e.requestedCommand??V(a.requestedCommand),executedCommand:e.executedCommand??V(a.executedCommand),alternatives:e.alternatives??ie(a.alternatives)}}function ce(e,a){switch(e.status){case"fallback":return{label:a("tools.badge.fallback","FALLBACK"),tooltip:a("tools.badge.fallback.tooltip","The requested Pro action succeeded via a Basic fallback."),className:o.statusFallback};case"unsupported":return{label:a("tools.badge.unsupported","UNSUPPORTED"),tooltip:a("tools.badge.unsupported.tooltip","The requested Pro action was blocked and no fallback ran."),className:o.statusUnsupported};case"error":return{label:a("tools.badge.err","FAILED"),tooltip:a("tools.badge.err.tooltip","The tool run failed."),className:o.statusError};default:return{label:a("tools.status.ok","OK"),tooltip:a("tools.status.ok.tooltip","The tool run completed successfully."),className:o.statusOk}}}function N(e,a){return s.jsxs("div",{className:o.detailItem,children:[s.jsx("span",{className:o.detailLabel,children:e}),s.jsx("span",{className:o.detailValue,children:a})]})}function xe(){const{t:e}=et(),a=bt(),{show:m}=st(),[j,M]=r.useState("history"),[k,E]=r.useState(null),[L,A]=r.useState(null),[b,c]=r.useState(null),[w,p]=r.useState(!1),[v,h]=r.useState("totalCalls"),[f,H]=r.useState("desc"),_=r.useCallback(t=>{h(l=>l===t?(H(i=>i==="asc"?"desc":"asc"),t):(H("desc"),t))},[]),g=r.useMemo(()=>{var l;const t=new Set;return Object.keys(((l=a.statistics)==null?void 0:l.tools)??{}).forEach(i=>t.add(i)),a.history.forEach(i=>{i.tool&&t.add(i.tool)}),a.historyToolFilter&&t.add(a.historyToolFilter),Array.from(t).sort()},[a.history,a.historyToolFilter,a.statistics]),F=r.useMemo(()=>{var t;return(t=a.statistics)!=null&&t.tools?Object.values(a.statistics.tools).map(l=>{var K;const i=Object.entries(l.commands??{}).map(([u,n])=>({toolName:l.tool,commandName:n.command??u,label:G(l.tool,n.command??u)||(n.command??u),tier:n.tier,totalCalls:n.totalCalls,successCount:n.successCount,fallbackCount:n.fallbackCount,unsupportedCount:n.unsupportedCount,failureCount:n.failureCount,totalExecutionTimeMs:n.totalExecutionTimeMs,avgExecutionTimeMs:n.avgExecutionTimeMs})),x=i.reduce((u,n)=>u+n.totalCalls,0),T=i.reduce((u,n)=>u+n.successCount,0),I=i.reduce((u,n)=>u+n.fallbackCount,0),$=i.reduce((u,n)=>u+n.unsupportedCount,0),X=i.reduce((u,n)=>u+n.failureCount,0),U=i.reduce((u,n)=>u+n.totalExecutionTimeMs,0),Y=new Set(i.map(u=>u.tier)).size>1?"mixed":((K=i[0])==null?void 0:K.tier)??l.tier;return{toolName:l.tool,tier:Y,commands:i,totalCalls:x,successCount:T,fallbackCount:I,unsupportedCount:$,failureCount:X,totalExecutionTimeMs:U,avgExecutionTimeMs:x>0?Math.round(U/x):0}}):[]},[a.statistics]),d=r.useCallback((t,l,i,x)=>s.jsx(B,{text:e(i,x),children:e(t,l)}),[e]),O=r.useMemo(()=>[...F].sort((l,i)=>{const x=l[v],T=i[v];if(typeof x=="number"&&typeof T=="number")return f==="asc"?x-T:T-x;const I=String(x??""),$=String(T??"");return f==="asc"?I.localeCompare($):$.localeCompare(I)}),[F,v,f]),y=r.useMemo(()=>[{key:"timestamp",label:d("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:t=>le(t.timestamp)},{key:"toolName",label:d("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:t=>s.jsxs("span",{children:[re(t.tool,t.command),t.tier==="pro"&&s.jsx(B,{text:e("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:s.jsx("span",{className:o.proBadge,children:e("tools.badge.pro","PRO")})})]})},{key:"executionTimeMs",label:d("tools.col.duration","Duration","tools.col.duration.tooltip","How long the tool took to finish."),width:"80px",render:t=>q(t.executionTimeMs)},{key:"status",label:d("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"120px",render:t=>{const l=ce(t,e);return s.jsx(B,{text:l.tooltip,children:s.jsx("span",{className:l.className,children:l.label})})}},{key:"tier",label:d("tools.col.tier","Tier","tools.col.tier.tooltip","License tier required for the tool or action."),width:"60px",render:t=>s.jsx("span",{className:t.tier==="pro"?o.tierPro:o.tierBasic,children:R(e,t.tier)})}],[e,d]),z=r.useMemo(()=>[{key:"toolName",label:d("tools.col.tool","Tool","tools.col.tool.tooltip","Consolidated tool name in the statistics table."),sortable:!0},{key:"totalCalls",label:d("tools.col.calls","Calls","tools.col.calls.tooltip","Total number of recorded calls for this tool."),sortable:!0,width:"70px"},{key:"successCount",label:d("tools.col.ok","OK","tools.col.ok.tooltip","Number of direct successful runs."),sortable:!0,width:"70px"},{key:"fallbackCount",label:d("tools.col.fallback","FALLBACK","tools.col.fallback.tooltip","Number of runs that succeeded through fallback execution."),sortable:!0,width:"110px"},{key:"unsupportedCount",label:d("tools.col.unsupported","UNSUPPORTED","tools.col.unsupported.tooltip","Number of blocked runs without fallback execution."),sortable:!0,width:"130px"},{key:"failureCount",label:d("tools.col.err","FAILED","tools.col.err.tooltip","Number of runs that failed."),sortable:!0,width:"70px"},{key:"avgExecutionTimeMs",label:d("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"90px",render:t=>q(t.avgExecutionTimeMs)},{key:"tier",label:d("tools.col.tier","Tier","tools.col.tierStats.tooltip","Basic, Pro, or Mixed summary for the tool statistics row."),sortable:!0,width:"70px",render:t=>s.jsx(B,{text:t.tier==="mixed"?e("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:t.tier==="pro"?o.tierPro:t.tier==="mixed"?o.tierMixed:o.tierBasic,children:R(e,t.tier)})})}],[e,d]),C=r.useMemo(()=>{if(!a.statistics)return null;const t=a.statistics.tierSummary.basic.totalCalls,l=a.statistics.tierSummary.pro.totalCalls,i=t+l;if(i===0)return null;const x=Math.round(t/i*100),T=100-x;return{basic:t,pro:l,basicPct:x,proPct:T}},[a.statistics]),P=r.useCallback(t=>{A(l=>l===t?null:t)},[]),J=r.useCallback(async()=>{if(b){p(!0);try{b==="history"?await a.clearHistory():await a.clearStatistics(),m(e("toast.clearSuccess","Cleared successfully"),"success"),c(null)}catch{m(e("toast.clearFailed","Failed to clear data"),"error")}finally{p(!1)}}},[b,m,e,a]),Z=r.useCallback(t=>{const l=ne(t);return s.jsxs("div",{className:o.expandedRow,children:[s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(B,{text:e("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:e("tools.detail.params","Parameters")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(t.parameters,null,2)})]}),t.result&&s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(B,{text:e("tools.detail.result.tooltip","Returned result payload for this tool run."),children:e("tools.detail.result","Result")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(t.result,null,2)})]}),(t.status==="fallback"||t.status==="unsupported"||t.status==="error")&&s.jsx("div",{className:o.expandedSection,children:s.jsxs("div",{className:o.detailList,children:[t.status==="fallback"&&(l==null?void 0:l.requestedCommand)&&N(e("tools.detail.requestedCommand","Requested Command"),l.requestedCommand),t.status==="fallback"&&(l==null?void 0:l.executedCommand)&&N(e("tools.detail.executedCommand","Executed Command"),l.executedCommand),t.status==="fallback"&&(l==null?void 0:l.alternatives)&&N(e("tools.detail.alternatives","Alternatives"),l.alternatives.join(", ")),t.status==="unsupported"&&t.blockedMessage&&N(e("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage),t.status==="unsupported"&&N(e("tools.detail.noFallback","No Fallback"),e("tools.detail.noFallback.value","No fallback ran.")),t.status==="error"&&t.errorMessage&&N(e("tools.detail.errorMessage","Error Message"),t.errorMessage),t.status==="error"&&t.blockedMessage&&N(e("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage),t.status==="error"&&t.fallbackCommand&&N(e("tools.detail.executedCommand","Executed Command"),t.fallbackCommand)]})})]})},[e]),Q=["history","statistics"].map(t=>({key:t,label:e(`tools.tab.${t}`,t.charAt(0).toUpperCase()+t.slice(1))}));return s.jsxs("div",{className:o.page,children:[s.jsx(ot,{items:Q,value:j,onChange:M}),j==="history"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:e("tools.tab.history","History")}),s.jsx("button",{className:o.dangerButton,onClick:()=>c("history"),children:e("common.clear","Clear")})]}),s.jsx("div",{className:o.filterRow,children:s.jsxs("label",{className:o.filterLabel,children:[e("tools.filter.tool","Tool"),":",s.jsxs("select",{className:o.filterSelect,value:a.historyToolFilter,onChange:t=>{a.setHistoryToolFilter(t.target.value),a.setHistoryOffset(0)},children:[s.jsx("option",{value:"",children:e("tools.filter.all","All")}),g.map(t=>s.jsx("option",{value:t,children:t},t))]})]})}),s.jsx(ht,{columns:y,data:a.history,rowKey:t=>t.id,onRowClick:t=>E(l=>l===t.id?null:t.id),emptyMessage:e("tools.empty.history","No history entries"),expandedKey:k,renderExpandedRow:Z}),s.jsxs("div",{className:o.pagination,children:[s.jsx("button",{className:o.btn,disabled:a.historyOffset===0,title:e("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>a.setHistoryOffset(Math.max(0,a.historyOffset-W)),children:e("tools.page.prev","Prev")}),s.jsxs("span",{className:o.pageInfo,children:[a.historyOffset+1,"–",Math.min(a.historyOffset+W,a.historyTotal)," / ",a.historyTotal]}),s.jsx("button",{className:o.btn,disabled:!a.historyHasMore,title:e("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>a.setHistoryOffset(a.historyOffset+W),children:e("tools.page.next","Next")})]})]}),j==="statistics"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:e("tools.tab.statistics","Statistics")}),s.jsx("button",{className:o.dangerButton,onClick:()=>c("statistics"),children:e("common.clear","Clear")})]}),C&&s.jsxs("div",{className:o.tierDistribution,children:[s.jsxs("div",{className:o.tierBarWrap,children:[s.jsx("div",{className:o.tierBarBasic,style:{width:`${C.basicPct}%`}}),s.jsx("div",{className:o.tierBarPro,style:{width:`${C.proPct}%`}})]}),s.jsxs("div",{className:o.tierLabels,children:[s.jsxs("span",{children:[R(e,"basic")," ",C.basicPct,"% (",C.basic,")"]}),s.jsxs("span",{children:[R(e,"pro")," ",C.proPct,"% (",C.pro,")"]})]})]}),s.jsx("div",{className:o.statsTableWrap,children:s.jsxs("table",{className:o.statsTable,children:[s.jsx("thead",{children:s.jsx("tr",{children:z.map(t=>s.jsxs("th",{style:t.width?{width:t.width}:void 0,className:t.sortable?o.sortableHeader:void 0,onClick:t.sortable?()=>_(t.key):void 0,children:[s.jsx("span",{children:t.label}),t.sortable&&v===t.key&&s.jsx("span",{className:o.sortArrow,children:f==="asc"?"▴":"▾"})]},t.key))})}),s.jsx("tbody",{children:O.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:z.length,className:o.emptyStats,children:e("tools.empty.stats","No tool statistics")})}):O.map(t=>{const l=L===t.toolName;return s.jsxs(r.Fragment,{children:[s.jsxs("tr",{className:o.statsToolRow,onClick:()=>P(t.toolName),children:[s.jsx("td",{children:s.jsxs("button",{type:"button",className:o.expandButton,"aria-expanded":l,"aria-label":`${t.toolName} ${l?e("common.collapse","Collapse"):e("common.expand","Expand")}`,onClick:i=>{i.stopPropagation(),P(t.toolName)},children:[s.jsx("span",{className:o.expandIcon,"aria-hidden":"true",children:l?"▾":"▸"}),s.jsx("span",{children:t.toolName})]})}),s.jsx("td",{children:t.totalCalls}),s.jsx("td",{children:t.successCount}),s.jsx("td",{children:t.fallbackCount}),s.jsx("td",{children:t.unsupportedCount}),s.jsx("td",{children:t.failureCount}),s.jsx("td",{children:q(t.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx(B,{text:t.tier==="mixed"?e("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:t.tier==="pro"?o.tierPro:t.tier==="mixed"?o.tierMixed:o.tierBasic,children:R(e,t.tier)})})})]}),l&&t.commands.map(i=>s.jsxs("tr",{className:o.statsActionRow,children:[s.jsx("td",{children:s.jsx("span",{className:o.actionLabel,children:i.label})}),s.jsx("td",{children:i.totalCalls}),s.jsx("td",{children:i.successCount}),s.jsx("td",{children:i.fallbackCount}),s.jsx("td",{children:i.unsupportedCount}),s.jsx("td",{children:i.failureCount}),s.jsx("td",{children:q(i.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx("span",{className:i.tier==="pro"?o.tierPro:o.tierBasic,children:R(e,i.tier)})})]},`${t.toolName}:${i.commandName}`))]},t.toolName)})})]})}),a.statistics&&s.jsxs("div",{className:o.summaryLine,children:[e("tools.summary.total","Total"),": ",a.statistics.totalCalls," ",e("tools.summary.calls","calls")," | ",e("tools.summary.sessions","Sessions"),": ",a.statistics.totalSessions]})]}),s.jsx(at,{open:b!==null,title:b==="history"?e("tools.clear.history.title","Clear history?"):e("tools.clear.statistics.title","Clear statistics?"),message:b==="history"?e("tools.clear.history.message","This permanently removes the current place tools history."):e("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.clear","Clear"),loading:w,onCancel:()=>!w&&c(null),onConfirm:J})]})}export{xe as Component};