@weppy/roblox-mcp 2.1.2 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +17 -11
  3. package/README.md +1 -1
  4. package/docs/en/dashboard/overview.md +1 -1
  5. package/docs/en/dashboard/settings.md +1 -8
  6. package/docs/en/dashboard/sync.md +0 -7
  7. package/docs/en/sync/overview.md +0 -1
  8. package/docs/en/tools/overview.md +0 -1
  9. package/docs/es/dashboard/overview.md +1 -1
  10. package/docs/es/dashboard/settings.md +1 -8
  11. package/docs/es/dashboard/sync.md +0 -7
  12. package/docs/es/sync/overview.md +0 -1
  13. package/docs/es/tools/overview.md +0 -1
  14. package/docs/id/dashboard/overview.md +1 -1
  15. package/docs/id/dashboard/settings.md +1 -8
  16. package/docs/id/dashboard/sync.md +0 -7
  17. package/docs/id/sync/overview.md +0 -1
  18. package/docs/id/tools/overview.md +0 -1
  19. package/docs/ja/dashboard/overview.md +1 -1
  20. package/docs/ja/dashboard/settings.md +1 -8
  21. package/docs/ja/dashboard/sync.md +0 -7
  22. package/docs/ja/sync/overview.md +0 -1
  23. package/docs/ja/tools/overview.md +0 -1
  24. package/docs/ko/dashboard/overview.md +1 -1
  25. package/docs/ko/dashboard/settings.md +1 -8
  26. package/docs/ko/dashboard/sync.md +0 -7
  27. package/docs/ko/sync/overview.md +0 -1
  28. package/docs/ko/tools/overview.md +0 -1
  29. package/docs/pt-br/dashboard/overview.md +1 -1
  30. package/docs/pt-br/dashboard/settings.md +1 -8
  31. package/docs/pt-br/dashboard/sync.md +0 -7
  32. package/docs/pt-br/sync/overview.md +0 -1
  33. package/docs/pt-br/tools/overview.md +0 -1
  34. package/llms-full.txt +1 -2
  35. package/package.json +1 -1
  36. package/plugins/weppy-roblox-mcp/.claude-plugin/plugin.json +1 -1
  37. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ChangelogDetailPage-2ZPwh_Le.js → ChangelogDetailPage-D7eMrarv.js} +1 -1
  38. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ChangelogPage-DW2_STiE.js → ChangelogPage-DFCCRyyK.js} +1 -1
  39. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ConfirmModal-CInBBLZW.js → ConfirmModal-BmRJ2JXZ.js} +1 -1
  40. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ConnectionPage-nNwPIEZw.js → ConnectionPage-CiaCY026.js} +1 -1
  41. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{InfoLabel-B_Ys60mi.js → InfoLabel-CCDWZLC9.js} +1 -1
  42. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{OverviewPage-BMBzDR4R.js → OverviewPage-BHpt3LI2.js} +1 -1
  43. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{PlaytestPage-BDgsWgto.js → PlaytestPage-CNwwI5Ro.js} +1 -1
  44. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{PropertyDiff-BbsF9z4D.js → PropertyDiff-DIplDn-J.js} +1 -1
  45. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SettingsPage-CPqQYZPN.js +1 -0
  46. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SettingsPage-DTv0NbEY.css +1 -0
  47. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{StatusBadge-FYpJOX7r.js → StatusBadge-C8VKAPpk.js} +1 -1
  48. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SyncPage-CLt9jxd8.css +1 -0
  49. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SyncPage-DTSKbpio.js +4 -0
  50. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/TierComparison-7ofkPwj3.js +1 -0
  51. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{TierPromoProgress-Cuz1dgcs.js → TierPromoProgress-SnRUjAPh.js} +1 -1
  52. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ToolsPage-YGBoDwbQ.js → ToolsPage-CrdNh3D9.js} +1 -1
  53. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/index-DGGmfli1.js +129 -0
  54. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{useLiveUptime-D5Ux8dA5.js → useLiveUptime-BnXeLpOw.js} +1 -1
  55. package/plugins/weppy-roblox-mcp/dashboard/dist/index.html +1 -1
  56. package/plugins/weppy-roblox-mcp/dist/index.js +61 -64
  57. package/plugins/weppy-roblox-mcp/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
  58. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SettingsPage-BB7-WAMU.css +0 -1
  59. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SettingsPage-BPSAA3lu.js +0 -1
  60. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SyncPage-BcXYv0GI.js +0 -4
  61. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SyncPage-Bf1SdHGg.css +0 -1
  62. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/TierComparison-D4uVUGcZ.js +0 -1
  63. package/plugins/weppy-roblox-mcp/dashboard/dist/assets/index-BNdn6WpU.js +0 -129
@@ -1 +1 @@
1
- import{r as i,a as D,D as O,u as F,j as e,T as I,c as V,i as U}from"./index-BNdn6WpU.js";import{C as G}from"./ConfirmModal-CInBBLZW.js";import{u as H,T as Z,D as W,a as q}from"./TierComparison-D4uVUGcZ.js";import{t as d}from"./TierPromo.module-CAoUYgIx.js";const z=10;function J(){const[t,p]=i.useState([]),[s,a]=i.useState(0),[u,f]=i.useState(!1),[r,v]=i.useState(!0),[l,C]=i.useState(0),[g,j]=i.useState("all"),b=i.useRef(null),x=i.useCallback(async(h,o)=>{v(!0);try{const S={limit:String(z),offset:String(h)};o!=="all"&&(S.status=o);const N=await D.get("/api/dashboard/changelog",S);p(N.entries),a(N.total),f(N.hasMore)}catch{p([]),a(0),f(!1)}finally{v(!1)}},[]),y=i.useCallback(()=>{x(l,g)},[x,l,g]),_=i.useCallback(async()=>{await D.post("/api/dashboard/changelog/clear"),p([]),a(0),f(!1)},[]);return i.useEffect(()=>{x(l,g)},[x,l,g]),i.useEffect(()=>{const h=new O;b.current=h,h.connect();const o=h.on("command",()=>{x(l,g)});return()=>{o(),h.disconnect(),b.current=null}},[x,l,g]),{entries:t,total:s,hasMore:u,loading:r,offset:l,statusFilter:g,setOffset:C,setStatusFilter:j,refresh:y,clear:_}}const K="_card_1n89u_2",Q="_header_1n89u_17",X="_statusBadge_1n89u_24",Y="_statusDot_1n89u_35",ee="_active_1n89u_41",se="_completed_1n89u_50",te="_timeRange_1n89u_58",ae="_summaryList_1n89u_65",ne="_summaryItem_1n89u_71",oe="_summaryIcon_1n89u_80",ce="_summaryText_1n89u_86",ie="_progressBar_1n89u_91",re="_progressFill_1n89u_99",le="_emptySummary_1n89u_112",de="_contextBlock_1n89u_120",ge="_contextLabel_1n89u_129",me="_contextValue_1n89u_137",n={card:K,header:Q,statusBadge:X,statusDot:Y,active:ee,completed:se,timeRange:te,summaryList:ae,summaryItem:ne,summaryIcon:oe,summaryText:ce,progressBar:ie,progressFill:re,emptySummary:le,contextBlock:de,contextLabel:ge,contextValue:me};function E(t){if(!t)return"--:--";const p=new Date(t);return`${String(p.getHours()).padStart(2,"0")}:${String(p.getMinutes()).padStart(2,"0")}`}function he({entry:t,onClick:p}){var S,N,k,B,L,w,A,M,R,P;const{t:s}=F(),a=t.changeSummary,u=t.status==="active",f=t.isBootstrapOnly===!0,r=[],v=a.scriptsModified+a.scriptsCreated;if(v>0){const m=[];a.scriptsModified>0&&m.push(`${a.scriptsModified} ${s("changelog.card.modified","modified")}`),a.scriptsCreated>0&&m.push(`${a.scriptsCreated} ${s("changelog.card.created","created")}`);const T=`${v} ${s("changelog.card.scripts","scripts")} ${m.join(", ")}`;r.push({icon:"📝",text:T,tooltip:s("changelog.card.scripts.tooltip","Script changes made in this session.")})}const l=a.instancesCreated+a.instancesDeleted+a.instancesMoved;if(l>0){const m=[];a.instancesCreated>0&&m.push(`${a.instancesCreated} ${s("changelog.card.created","created")}`),a.instancesDeleted>0&&m.push(`${a.instancesDeleted} ${s("changelog.card.deleted","deleted")}`),a.instancesMoved>0&&m.push(`${a.instancesMoved} ${s("changelog.card.moved","moved")}`);const T=`${l} ${s("changelog.card.instances","instances")} ${m.join(", ")}`;r.push({icon:"🧱",text:T,tooltip:s("changelog.card.instances.tooltip","Instance create, delete, move, or clone changes in this session.")})}a.propertiesChanged>0&&r.push({icon:"🎨",text:`${a.propertiesChanged} ${s("changelog.card.propertiesChanged","properties changed")}`,tooltip:s("changelog.card.propertiesChanged.tooltip","Property value changes recorded for this session.")}),a.lightingChanged&&r.push({icon:"🌅",text:s("changelog.card.lightingConfigured","Lighting configured"),tooltip:s("changelog.card.lightingConfigured.tooltip","Lighting or atmosphere settings changed in this session.")}),a.terrainChanged&&r.push({icon:"⛰️",text:s("changelog.card.terrainConfigured","Terrain configured"),tooltip:s("changelog.card.terrainConfigured.tooltip","Terrain data or terrain settings changed in this session.")}),a.assetsInserted>0&&r.push({icon:"📦",text:`${a.assetsInserted} ${s("changelog.card.assetsInserted","assets inserted")}`,tooltip:s("changelog.card.assetsInserted.tooltip","Assets inserted into the place during this session.")});const C=E(t.startTime),g=u?s("changelog.card.inProgress","in progress"):t.endTime?E(t.endTime):"--:--",j=f?s("changelog.card.bootstrapStatus","Bootstrap"):u?s("changelog.card.active","Active"):s("changelog.card.completed","Completed"),b=f?s("changelog.card.bootstrapStatus.tooltip","This session only contains the initial sync bootstrap snapshot."):u?s("changelog.card.active.tooltip","This session is still receiving new game changes."):s("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),x=f?s("changelog.card.bootstrapSummary","Initial sync snapshot"):s("changelog.card.noChanges","No changes yet"),y=f?s("changelog.card.bootstrapSummary.tooltip","Initial file sync writes are collapsed into a single bootstrap snapshot row."):s("changelog.card.noChanges.tooltip","No game changes have been extracted for this session yet."),_=(N=(S=t.contextSummary)==null?void 0:S.intent)==null?void 0:N.trim(),h=((w=(L=(B=(k=t.contextSummary)==null?void 0:k.affectedAreas)==null?void 0:B[0])==null?void 0:L.label)==null?void 0:w.trim())||((M=(A=t.contextSummary)==null?void 0:A.testScenario)==null?void 0:M.trim()),o=(P=(R=t.verificationSummary)==null?void 0:R.label)==null?void 0:P.trim();return e.jsxs("div",{className:n.card,onClick:p,children:[e.jsxs("div",{className:n.header,children:[e.jsx(I,{text:b,children:e.jsxs("span",{className:`${n.statusBadge} ${u?n.active:n.completed}`,children:[e.jsx("span",{className:n.statusDot}),j]})}),e.jsxs("span",{className:n.timeRange,children:[C,"~",g]})]}),e.jsx("div",{className:n.summaryList,children:r.length>0?r.map((m,T)=>e.jsxs("div",{className:n.summaryItem,children:[e.jsx("span",{className:n.summaryIcon,children:m.icon}),e.jsx(I,{text:m.tooltip,children:e.jsx("span",{className:n.summaryText,children:m.text})})]},T)):e.jsx(I,{text:y,children:e.jsx("span",{className:n.emptySummary,style:{display:"block"},children:x})})}),_&&e.jsxs("div",{className:n.contextBlock,children:[e.jsx("span",{className:n.contextLabel,children:s("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:n.contextValue,children:_})]}),!_&&h&&e.jsxs("div",{className:n.contextBlock,children:[e.jsx("span",{className:n.contextLabel,children:s("changelog.card.representativeArea","Representative area")}),e.jsx("span",{className:n.contextValue,children:h})]}),o&&e.jsxs("div",{className:n.contextBlock,children:[e.jsx("span",{className:n.contextLabel,children:s("changelog.card.verification","Verification")}),e.jsx("span",{className:n.contextValue,children:o})]}),u&&e.jsx("div",{className:n.progressBar,children:e.jsx("div",{className:n.progressFill})})]})}const pe="_page_1srvj_2",ue="_limitNotice_1srvj_9",fe="_limitNoticeTitle_1srvj_18",xe="_limitNoticeText_1srvj_25",_e="_headerRow_1srvj_31",ve="_header_1srvj_31",je="_clearButton_1srvj_48",be="_headerSub_1srvj_57",ye="_filterTabs_1srvj_67",Ne="_filterTab_1srvj_67",Ce="_filterTabActive_1srvj_90",Se="_list_1srvj_96",Te="_empty_1srvj_103",$e="_loading_1srvj_112",Ie="_pagination_1srvj_121",ke="_pageInfo_1srvj_129",Be="_btn_1srvj_135",c={page:pe,limitNotice:ue,limitNoticeTitle:fe,limitNoticeText:xe,headerRow:_e,header:ve,clearButton:je,headerSub:be,filterTabs:ye,filterTab:Ne,filterTabActive:Ce,list:Se,empty:Te,loading:$e,pagination:Ie,pageInfo:ke,btn:Be},$=10,Le=[{key:"all",label:"changelog.filter.all"},{key:"active",label:"changelog.filter.active"},{key:"completed",label:"changelog.filter.completed"}];function Pe(){const{t}=F(),p=V(),s=J(),a=H(),{show:u}=U(),[f,r]=i.useState(!1),[v,l]=i.useState(!1),[C,g]=i.useState(!1),j=!a.loading&&a.tier==="basic",b=j?s.entries.slice(0,3):s.entries,x=!j&&s.total>$,y=b.length,_=s.total,h=async()=>{l(!0);try{await s.clear(),u(t("toast.clearSuccess","Cleared successfully"),"success"),r(!1)}catch{u(t("toast.clearFailed","Failed to clear data"),"error")}finally{l(!1)}};return e.jsxs("div",{className:c.page,children:[e.jsxs("div",{className:c.headerRow,children:[e.jsxs("h2",{className:c.header,children:[t("sidebar.changelog","Changelog"),e.jsx("span",{className:c.headerSub,children:t("changelog.subtitle","Game Change History")})]}),e.jsx("button",{className:c.clearButton,onClick:()=>r(!0),children:t("common.clear","Clear")})]}),e.jsx("div",{className:c.filterTabs,children:Le.map(o=>e.jsx("button",{className:`${c.filterTab} ${s.statusFilter===o.key?c.filterTabActive:""}`,onClick:()=>{s.setStatusFilter(o.key),s.setOffset(0)},children:t(o.label,o.key.charAt(0).toUpperCase()+o.key.slice(1))},o.key))}),s.loading&&s.entries.length===0&&e.jsx("div",{className:c.loading,children:t("common.loading","Loading...")}),!s.loading&&s.entries.length===0?e.jsx("div",{className:c.empty,children:t("changelog.empty","No changelog entries yet")}):e.jsx("div",{className:c.list,children:b.map(o=>e.jsx(he,{entry:o,onClick:()=>p(`/changelog/${o.entryId}`)},o.entryId))}),x&&e.jsxs("div",{className:c.pagination,children:[e.jsx("button",{className:c.btn,disabled:s.offset===0,onClick:()=>s.setOffset(Math.max(0,s.offset-$)),children:t("tools.page.prev","Prev")}),e.jsxs("span",{className:c.pageInfo,children:[s.offset+1,"–",Math.min(s.offset+$,s.total)," / ",s.total]}),e.jsx("button",{className:c.btn,disabled:!s.hasMore,onClick:()=>s.setOffset(s.offset+$),children:t("tools.page.next","Next")})]}),j&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:c.limitNotice,children:[e.jsx("div",{className:c.limitNoticeTitle,children:t("changelog.basic.limit.title","Basic preview shows the latest 3 sessions")}),e.jsx("div",{className:c.limitNoticeText,children:t("changelog.basic.limit.body","Upgrade to Pro to browse the full changelog timeline for this place.")})]}),e.jsxs("div",{className:d.progressPromoWrap,children:[e.jsxs("div",{className:d.progressPromo,children:[e.jsxs("div",{className:d.progressMain,children:[e.jsxs("div",{className:d.progressLabel,children:[e.jsx("span",{children:t("changelog.basic.metricLabel","Visible Changelog / Total")}),e.jsxs("span",{children:[y," / ",_]})]}),e.jsx("div",{className:d.progressBar,children:e.jsx("div",{className:d.progressFill,style:{width:`${_>0?Math.min(y/_*100,100):0}%`}})}),e.jsxs("div",{className:d.progressLabel,children:[e.jsxs("span",{children:[y," ",t("changelog.basic.visible","visible")]}),e.jsxs("span",{children:[_," ",t("changelog.basic.total","total")]})]})]}),e.jsx("span",{className:d.progressText,children:t("tier.banner.save","Save AI tokens with Pro!")}),e.jsxs("div",{className:d.actions,children:[e.jsx("button",{className:`${d.btn} ${d.btnOutline}`,onClick:()=>g(!0),children:t("tier.compare","Basic vs Pro")}),e.jsx("a",{className:`${d.btn} ${d.btnPrimary}`,href:Z.changelog,target:"_blank",rel:"noreferrer",children:t("tier.upgrade","Upgrade to Pro")})]})]}),e.jsx(W,{variant:"centered"})]})]}),e.jsx(G,{open:f,title:t("changelog.clear.title","Clear changelog?"),message:t("changelog.clear.message","This permanently removes the stored changelog for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:v,onCancel:()=>!v&&r(!1),onConfirm:h}),C&&e.jsx(q,{onClose:()=>g(!1)})]})}export{Pe as Component};
1
+ import{r as i,a as D,D as O,u as F,j as e,T as I,c as V,i as U}from"./index-DGGmfli1.js";import{C as G}from"./ConfirmModal-BmRJ2JXZ.js";import{u as H,T as Z,D as W,a as q}from"./TierComparison-7ofkPwj3.js";import{t as d}from"./TierPromo.module-CAoUYgIx.js";const z=10;function J(){const[t,p]=i.useState([]),[s,a]=i.useState(0),[u,f]=i.useState(!1),[r,v]=i.useState(!0),[l,C]=i.useState(0),[g,j]=i.useState("all"),b=i.useRef(null),x=i.useCallback(async(h,o)=>{v(!0);try{const S={limit:String(z),offset:String(h)};o!=="all"&&(S.status=o);const N=await D.get("/api/dashboard/changelog",S);p(N.entries),a(N.total),f(N.hasMore)}catch{p([]),a(0),f(!1)}finally{v(!1)}},[]),y=i.useCallback(()=>{x(l,g)},[x,l,g]),_=i.useCallback(async()=>{await D.post("/api/dashboard/changelog/clear"),p([]),a(0),f(!1)},[]);return i.useEffect(()=>{x(l,g)},[x,l,g]),i.useEffect(()=>{const h=new O;b.current=h,h.connect();const o=h.on("command",()=>{x(l,g)});return()=>{o(),h.disconnect(),b.current=null}},[x,l,g]),{entries:t,total:s,hasMore:u,loading:r,offset:l,statusFilter:g,setOffset:C,setStatusFilter:j,refresh:y,clear:_}}const K="_card_1n89u_2",Q="_header_1n89u_17",X="_statusBadge_1n89u_24",Y="_statusDot_1n89u_35",ee="_active_1n89u_41",se="_completed_1n89u_50",te="_timeRange_1n89u_58",ae="_summaryList_1n89u_65",ne="_summaryItem_1n89u_71",oe="_summaryIcon_1n89u_80",ce="_summaryText_1n89u_86",ie="_progressBar_1n89u_91",re="_progressFill_1n89u_99",le="_emptySummary_1n89u_112",de="_contextBlock_1n89u_120",ge="_contextLabel_1n89u_129",me="_contextValue_1n89u_137",n={card:K,header:Q,statusBadge:X,statusDot:Y,active:ee,completed:se,timeRange:te,summaryList:ae,summaryItem:ne,summaryIcon:oe,summaryText:ce,progressBar:ie,progressFill:re,emptySummary:le,contextBlock:de,contextLabel:ge,contextValue:me};function E(t){if(!t)return"--:--";const p=new Date(t);return`${String(p.getHours()).padStart(2,"0")}:${String(p.getMinutes()).padStart(2,"0")}`}function he({entry:t,onClick:p}){var S,N,k,B,L,w,A,M,R,P;const{t:s}=F(),a=t.changeSummary,u=t.status==="active",f=t.isBootstrapOnly===!0,r=[],v=a.scriptsModified+a.scriptsCreated;if(v>0){const m=[];a.scriptsModified>0&&m.push(`${a.scriptsModified} ${s("changelog.card.modified","modified")}`),a.scriptsCreated>0&&m.push(`${a.scriptsCreated} ${s("changelog.card.created","created")}`);const T=`${v} ${s("changelog.card.scripts","scripts")} ${m.join(", ")}`;r.push({icon:"📝",text:T,tooltip:s("changelog.card.scripts.tooltip","Script changes made in this session.")})}const l=a.instancesCreated+a.instancesDeleted+a.instancesMoved;if(l>0){const m=[];a.instancesCreated>0&&m.push(`${a.instancesCreated} ${s("changelog.card.created","created")}`),a.instancesDeleted>0&&m.push(`${a.instancesDeleted} ${s("changelog.card.deleted","deleted")}`),a.instancesMoved>0&&m.push(`${a.instancesMoved} ${s("changelog.card.moved","moved")}`);const T=`${l} ${s("changelog.card.instances","instances")} ${m.join(", ")}`;r.push({icon:"🧱",text:T,tooltip:s("changelog.card.instances.tooltip","Instance create, delete, move, or clone changes in this session.")})}a.propertiesChanged>0&&r.push({icon:"🎨",text:`${a.propertiesChanged} ${s("changelog.card.propertiesChanged","properties changed")}`,tooltip:s("changelog.card.propertiesChanged.tooltip","Property value changes recorded for this session.")}),a.lightingChanged&&r.push({icon:"🌅",text:s("changelog.card.lightingConfigured","Lighting configured"),tooltip:s("changelog.card.lightingConfigured.tooltip","Lighting or atmosphere settings changed in this session.")}),a.terrainChanged&&r.push({icon:"⛰️",text:s("changelog.card.terrainConfigured","Terrain configured"),tooltip:s("changelog.card.terrainConfigured.tooltip","Terrain data or terrain settings changed in this session.")}),a.assetsInserted>0&&r.push({icon:"📦",text:`${a.assetsInserted} ${s("changelog.card.assetsInserted","assets inserted")}`,tooltip:s("changelog.card.assetsInserted.tooltip","Assets inserted into the place during this session.")});const C=E(t.startTime),g=u?s("changelog.card.inProgress","in progress"):t.endTime?E(t.endTime):"--:--",j=f?s("changelog.card.bootstrapStatus","Bootstrap"):u?s("changelog.card.active","Active"):s("changelog.card.completed","Completed"),b=f?s("changelog.card.bootstrapStatus.tooltip","This session only contains the initial sync bootstrap snapshot."):u?s("changelog.card.active.tooltip","This session is still receiving new game changes."):s("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),x=f?s("changelog.card.bootstrapSummary","Initial sync snapshot"):s("changelog.card.noChanges","No changes yet"),y=f?s("changelog.card.bootstrapSummary.tooltip","Initial file sync writes are collapsed into a single bootstrap snapshot row."):s("changelog.card.noChanges.tooltip","No game changes have been extracted for this session yet."),_=(N=(S=t.contextSummary)==null?void 0:S.intent)==null?void 0:N.trim(),h=((w=(L=(B=(k=t.contextSummary)==null?void 0:k.affectedAreas)==null?void 0:B[0])==null?void 0:L.label)==null?void 0:w.trim())||((M=(A=t.contextSummary)==null?void 0:A.testScenario)==null?void 0:M.trim()),o=(P=(R=t.verificationSummary)==null?void 0:R.label)==null?void 0:P.trim();return e.jsxs("div",{className:n.card,onClick:p,children:[e.jsxs("div",{className:n.header,children:[e.jsx(I,{text:b,children:e.jsxs("span",{className:`${n.statusBadge} ${u?n.active:n.completed}`,children:[e.jsx("span",{className:n.statusDot}),j]})}),e.jsxs("span",{className:n.timeRange,children:[C,"~",g]})]}),e.jsx("div",{className:n.summaryList,children:r.length>0?r.map((m,T)=>e.jsxs("div",{className:n.summaryItem,children:[e.jsx("span",{className:n.summaryIcon,children:m.icon}),e.jsx(I,{text:m.tooltip,children:e.jsx("span",{className:n.summaryText,children:m.text})})]},T)):e.jsx(I,{text:y,children:e.jsx("span",{className:n.emptySummary,style:{display:"block"},children:x})})}),_&&e.jsxs("div",{className:n.contextBlock,children:[e.jsx("span",{className:n.contextLabel,children:s("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:n.contextValue,children:_})]}),!_&&h&&e.jsxs("div",{className:n.contextBlock,children:[e.jsx("span",{className:n.contextLabel,children:s("changelog.card.representativeArea","Representative area")}),e.jsx("span",{className:n.contextValue,children:h})]}),o&&e.jsxs("div",{className:n.contextBlock,children:[e.jsx("span",{className:n.contextLabel,children:s("changelog.card.verification","Verification")}),e.jsx("span",{className:n.contextValue,children:o})]}),u&&e.jsx("div",{className:n.progressBar,children:e.jsx("div",{className:n.progressFill})})]})}const pe="_page_1srvj_2",ue="_limitNotice_1srvj_9",fe="_limitNoticeTitle_1srvj_18",xe="_limitNoticeText_1srvj_25",_e="_headerRow_1srvj_31",ve="_header_1srvj_31",je="_clearButton_1srvj_48",be="_headerSub_1srvj_57",ye="_filterTabs_1srvj_67",Ne="_filterTab_1srvj_67",Ce="_filterTabActive_1srvj_90",Se="_list_1srvj_96",Te="_empty_1srvj_103",$e="_loading_1srvj_112",Ie="_pagination_1srvj_121",ke="_pageInfo_1srvj_129",Be="_btn_1srvj_135",c={page:pe,limitNotice:ue,limitNoticeTitle:fe,limitNoticeText:xe,headerRow:_e,header:ve,clearButton:je,headerSub:be,filterTabs:ye,filterTab:Ne,filterTabActive:Ce,list:Se,empty:Te,loading:$e,pagination:Ie,pageInfo:ke,btn:Be},$=10,Le=[{key:"all",label:"changelog.filter.all"},{key:"active",label:"changelog.filter.active"},{key:"completed",label:"changelog.filter.completed"}];function Pe(){const{t}=F(),p=V(),s=J(),a=H(),{show:u}=U(),[f,r]=i.useState(!1),[v,l]=i.useState(!1),[C,g]=i.useState(!1),j=!a.loading&&a.tier==="basic",b=j?s.entries.slice(0,3):s.entries,x=!j&&s.total>$,y=b.length,_=s.total,h=async()=>{l(!0);try{await s.clear(),u(t("toast.clearSuccess","Cleared successfully"),"success"),r(!1)}catch{u(t("toast.clearFailed","Failed to clear data"),"error")}finally{l(!1)}};return e.jsxs("div",{className:c.page,children:[e.jsxs("div",{className:c.headerRow,children:[e.jsxs("h2",{className:c.header,children:[t("sidebar.changelog","Changelog"),e.jsx("span",{className:c.headerSub,children:t("changelog.subtitle","Game Change History")})]}),e.jsx("button",{className:c.clearButton,onClick:()=>r(!0),children:t("common.clear","Clear")})]}),e.jsx("div",{className:c.filterTabs,children:Le.map(o=>e.jsx("button",{className:`${c.filterTab} ${s.statusFilter===o.key?c.filterTabActive:""}`,onClick:()=>{s.setStatusFilter(o.key),s.setOffset(0)},children:t(o.label,o.key.charAt(0).toUpperCase()+o.key.slice(1))},o.key))}),s.loading&&s.entries.length===0&&e.jsx("div",{className:c.loading,children:t("common.loading","Loading...")}),!s.loading&&s.entries.length===0?e.jsx("div",{className:c.empty,children:t("changelog.empty","No changelog entries yet")}):e.jsx("div",{className:c.list,children:b.map(o=>e.jsx(he,{entry:o,onClick:()=>p(`/changelog/${o.entryId}`)},o.entryId))}),x&&e.jsxs("div",{className:c.pagination,children:[e.jsx("button",{className:c.btn,disabled:s.offset===0,onClick:()=>s.setOffset(Math.max(0,s.offset-$)),children:t("tools.page.prev","Prev")}),e.jsxs("span",{className:c.pageInfo,children:[s.offset+1,"–",Math.min(s.offset+$,s.total)," / ",s.total]}),e.jsx("button",{className:c.btn,disabled:!s.hasMore,onClick:()=>s.setOffset(s.offset+$),children:t("tools.page.next","Next")})]}),j&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:c.limitNotice,children:[e.jsx("div",{className:c.limitNoticeTitle,children:t("changelog.basic.limit.title","Basic preview shows the latest 3 sessions")}),e.jsx("div",{className:c.limitNoticeText,children:t("changelog.basic.limit.body","Upgrade to Pro to browse the full changelog timeline for this place.")})]}),e.jsxs("div",{className:d.progressPromoWrap,children:[e.jsxs("div",{className:d.progressPromo,children:[e.jsxs("div",{className:d.progressMain,children:[e.jsxs("div",{className:d.progressLabel,children:[e.jsx("span",{children:t("changelog.basic.metricLabel","Visible Changelog / Total")}),e.jsxs("span",{children:[y," / ",_]})]}),e.jsx("div",{className:d.progressBar,children:e.jsx("div",{className:d.progressFill,style:{width:`${_>0?Math.min(y/_*100,100):0}%`}})}),e.jsxs("div",{className:d.progressLabel,children:[e.jsxs("span",{children:[y," ",t("changelog.basic.visible","visible")]}),e.jsxs("span",{children:[_," ",t("changelog.basic.total","total")]})]})]}),e.jsx("span",{className:d.progressText,children:t("tier.banner.save","Save AI tokens with Pro!")}),e.jsxs("div",{className:d.actions,children:[e.jsx("button",{className:`${d.btn} ${d.btnOutline}`,onClick:()=>g(!0),children:t("tier.compare","Basic vs Pro")}),e.jsx("a",{className:`${d.btn} ${d.btnPrimary}`,href:Z.changelog,target:"_blank",rel:"noreferrer",children:t("tier.upgrade","Upgrade to Pro")})]})]}),e.jsx(W,{variant:"centered"})]})]}),e.jsx(G,{open:f,title:t("changelog.clear.title","Clear changelog?"),message:t("changelog.clear.message","This permanently removes the stored changelog for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:v,onCancel:()=>!v&&r(!1),onConfirm:h}),C&&e.jsx(q,{onClose:()=>g(!1)})]})}export{Pe as Component};
@@ -1 +1 @@
1
- import{j as s,s as e}from"./index-BNdn6WpU.js";function x({open:c,title:i,message:n,cancelLabel:t,confirmLabel:o,loading:a=!1,onCancel:l,onConfirm:r}){return c?s.jsx("div",{className:e.backdrop,onClick:a?void 0:l,children:s.jsxs("div",{className:e.modal,onClick:d=>d.stopPropagation(),children:[s.jsx("h2",{className:e.title,children:i}),s.jsx("p",{className:e.message,children:n}),s.jsxs("div",{className:e.actions,children:[s.jsx("button",{className:e.cancelButton,onClick:l,disabled:a,children:t}),s.jsx("button",{className:e.confirmButton,onClick:r,disabled:a,children:a?"...":o})]})]})}):null}export{x as C};
1
+ import{j as s,s as e}from"./index-DGGmfli1.js";function x({open:c,title:i,message:n,cancelLabel:t,confirmLabel:o,loading:a=!1,onCancel:l,onConfirm:r}){return c?s.jsx("div",{className:e.backdrop,onClick:a?void 0:l,children:s.jsxs("div",{className:e.modal,onClick:d=>d.stopPropagation(),children:[s.jsx("h2",{className:e.title,children:i}),s.jsx("p",{className:e.message,children:n}),s.jsxs("div",{className:e.actions,children:[s.jsx("button",{className:e.cancelButton,onClick:l,disabled:a,children:t}),s.jsx("button",{className:e.confirmButton,onClick:r,disabled:a,children:a?"...":o})]})]})}):null}export{x as C};
@@ -1 +1 @@
1
- import{u as $,r,j as e,d as R,a as N,D as I,i as L,T as M}from"./index-BNdn6WpU.js";import{I as a}from"./InfoLabel-B_Ys60mi.js";import{S as A}from"./StatusBadge-FYpJOX7r.js";import{C as E}from"./ConfirmModal-CInBBLZW.js";import{u as P,f as k}from"./useLiveUptime-D5Ux8dA5.js";const T="_container_1h084_2",H="_entry_1h084_14",B="_timestamp_1h084_21",D="_message_1h084_27",F="_warn_1h084_34",U="_error_1h084_39",G="_empty_1h084_44",v={container:T,entry:H,timestamp:B,message:D,warn:F,error:U,empty:G};function O(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 V({entries:n}){const{t}=$(),c=r.useRef(null);return r.useEffect(()=>{const l=c.current;l&&(l.scrollTop=l.scrollHeight)},[n.length]),e.jsx("div",{ref:c,className:v.container,children:n.length===0?e.jsx("div",{className:v.empty,children:t("connection.log.empty","No events yet")}):n.map((l,u)=>e.jsxs("div",{className:`${v.entry} ${l.type?v[l.type]:""}`,children:[e.jsx("span",{className:v.timestamp,children:O(l.timestamp)}),e.jsx("span",{className:v.message,children:l.message})]},u))})}const S=50;function q(){const n=new Date;return`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}`}function X(){const{level:n,status:t,error:c}=R(),[l,u]=r.useState(null),[y,h]=r.useState([]),g=r.useRef(null),_=r.useCallback((i,f)=>{h(d=>{const p=[...d,{timestamp:q(),message:i,type:f}];return p.length>S?p.slice(-S):p})},[]),x=r.useCallback(async()=>{try{const i=await N.get("/connection-info");u(i)}catch{u(null)}},[]),j=r.useCallback(async()=>{try{const i=await N.get("/api/dashboard/connection-log");h(i.entries??[])}catch{h([])}},[]),C=r.useCallback(async()=>{await N.post("/api/dashboard/connection-log/clear"),h([])},[]);return r.useEffect(()=>{n!=="disconnected"&&t&&x(),j()},[n,t,x,j]),r.useEffect(()=>{const i=new I;g.current=i,i.connect();const f=i.on("connection",p=>{const m=p,b=m.status==="connected"?"connected":"disconnected";_(`Plugin ${b} — ${m.clientId}`,m.status==="connected"?"info":"warn")}),d=i.on("mcp_status",p=>{const m=p,b=m.status==="registered"?"registered":"unregistered";_(`MCP ${b} — ${m.aiClientName}`,m.status==="registered"?"info":"warn"),x()});return()=>{f(),d(),i.disconnect(),g.current=null}},[_,x]),{status:t,connectionInfo:l,connectionLog:y,level:n,error:c,clearConnectionLog:C}}const z="_page_12byi_2",J="_card_12byi_10",K="_disabled_12byi_18",Q="_cardHeader_12byi_24",W="_clearButton_12byi_37",Y="_serverGrid_12byi_47",Z="_statusRow_12byi_65",ee="_table_12byi_79",ne="_toggleBtn_12byi_104",te="_disconnected_12byi_119",se="_disconnectedActions_12byi_136",ce="_btn_12byi_143",oe="_emptyRow_12byi_161",s={page:z,card:J,disabled:K,cardHeader:Q,clearButton:W,serverGrid:Y,statusRow:Z,table:ee,toggleBtn:ne,disconnected:te,disconnectedActions:se,btn:ce,emptyRow:oe};function w(n,t){const c=Math.max(0,Math.floor((Date.now()-n)/1e3));return c<60?`${c}${t("connection.time.secondsAgo","s ago")}`:c<3600?`${Math.floor(c/60)}${t("connection.time.minutesAgo","m ago")}`:`${Math.floor(c/3600)}${t("connection.time.hoursAgo","h ago")}`}function pe(){var b;const{t:n}=$(),{status:t,connectionInfo:c,connectionLog:l,level:u,clearConnectionLog:y}=X(),{show:h}=L(),[g,_]=r.useState(!0),[x,j]=r.useState(!1),[C,i]=r.useState(!1),f=P(t==null?void 0:t.uptime),d=u==="disconnected",p=d?"offline":"online",m=async()=>{i(!0);try{await y(),h(n("toast.clearSuccess","Cleared successfully"),"success"),j(!1)}catch{h(n("toast.clearFailed","Failed to clear data"),"error")}finally{i(!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")}),d?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(A,{status:p})}),e.jsxs("dl",{className:s.serverGrid,children:[(t==null?void 0:t.version)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(a,{label:n("connection.server.version","Version"),tooltip:n("connection.server.version.tooltip","Installed MCP server version")})}),e.jsx("dd",{children:e.jsx(M,{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(a,{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(a,{label:n("connection.server.uptime","Uptime"),tooltip:n("connection.server.uptime.tooltip","Time elapsed since the MCP server started")})}),e.jsx("dd",{children:k(f??t.uptime)})]}),(t==null?void 0:t.sessionId)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(a,{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)})]}),(c==null?void 0:c.serverExecutable)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(a,{label:n("connection.server.exec","Exec"),tooltip:n("connection.server.exec.tooltip","Executable path used to launch the MCP server")})}),e.jsx("dd",{children:c.serverExecutable})]})]})]})]}),e.jsxs("div",{className:`${s.card} ${d?s.disabled:""}`,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsxs("span",{children:[n("connection.agents.title","AI Agents")," ","(",(c==null?void 0:c.mcpInstanceCount)??0,")"]}),e.jsx("button",{className:s.toggleBtn,onClick:()=>_(o=>!o),"aria-label":g?n("common.collapse","Collapse"):n("common.expand","Expand"),children:g?"▾":"▸"})]}),g&&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(a,{label:n("connection.server.pid","PID"),tooltip:n("connection.server.pid.tooltip","Operating system process identifier")})}),e.jsx("th",{children:e.jsx(a,{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("tbody",{children:c!=null&&c.mcpInstances&&c.mcpInstances.length>0?c.mcpInstances.map(o=>e.jsxs("tr",{children:[e.jsx("td",{children:o.aiClientName??n("connection.agents.unknown","Unknown")}),e.jsx("td",{children:o.pid}),e.jsx("td",{children:o.projectRoot??o.cwd??n("connection.agents.projectRoot.unresolved","Unresolved")}),e.jsx("td",{children:w(o.connectedAt,n)})]},o.instanceId)):e.jsx("tr",{children:e.jsx("td",{colSpan:4,className:s.emptyRow,children:n("connection.agents.none","No agents connected")})})})]})]}),e.jsxs("div",{className:`${s.card} ${d?s.disabled:""}`,children:[e.jsxs("div",{className:s.cardHeader,children:[n("connection.plugins.title","Plugins")," ","(",((b=t==null?void 0:t.pluginClients)==null?void 0:b.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(a,{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(a,{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(a,{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(o=>e.jsxs("tr",{children:[e.jsx("td",{children:o.placeName??o.projectName??"-"}),e.jsx("td",{children:o.clientId.slice(0,10)}),e.jsx("td",{children:w(o.lastSeen,n)}),e.jsx("td",{children:o.pluginVersion??"-"})]},o.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} ${d?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:()=>j(!0),children:n("common.clear","Clear")})]}),e.jsx(V,{entries:l})]}),e.jsx(E,{open:x,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:C,onCancel:()=>!C&&j(!1),onConfirm:m})]})}export{pe as Component};
1
+ import{u as $,r,j as e,d as R,a as N,D as I,i as L,T as M}from"./index-DGGmfli1.js";import{I as a}from"./InfoLabel-CCDWZLC9.js";import{S as A}from"./StatusBadge-C8VKAPpk.js";import{C as E}from"./ConfirmModal-BmRJ2JXZ.js";import{u as P,f as k}from"./useLiveUptime-BnXeLpOw.js";const T="_container_1h084_2",H="_entry_1h084_14",B="_timestamp_1h084_21",D="_message_1h084_27",F="_warn_1h084_34",U="_error_1h084_39",G="_empty_1h084_44",v={container:T,entry:H,timestamp:B,message:D,warn:F,error:U,empty:G};function O(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 V({entries:n}){const{t}=$(),c=r.useRef(null);return r.useEffect(()=>{const l=c.current;l&&(l.scrollTop=l.scrollHeight)},[n.length]),e.jsx("div",{ref:c,className:v.container,children:n.length===0?e.jsx("div",{className:v.empty,children:t("connection.log.empty","No events yet")}):n.map((l,u)=>e.jsxs("div",{className:`${v.entry} ${l.type?v[l.type]:""}`,children:[e.jsx("span",{className:v.timestamp,children:O(l.timestamp)}),e.jsx("span",{className:v.message,children:l.message})]},u))})}const S=50;function q(){const n=new Date;return`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}`}function X(){const{level:n,status:t,error:c}=R(),[l,u]=r.useState(null),[y,h]=r.useState([]),g=r.useRef(null),_=r.useCallback((i,f)=>{h(d=>{const p=[...d,{timestamp:q(),message:i,type:f}];return p.length>S?p.slice(-S):p})},[]),x=r.useCallback(async()=>{try{const i=await N.get("/connection-info");u(i)}catch{u(null)}},[]),j=r.useCallback(async()=>{try{const i=await N.get("/api/dashboard/connection-log");h(i.entries??[])}catch{h([])}},[]),C=r.useCallback(async()=>{await N.post("/api/dashboard/connection-log/clear"),h([])},[]);return r.useEffect(()=>{n!=="disconnected"&&t&&x(),j()},[n,t,x,j]),r.useEffect(()=>{const i=new I;g.current=i,i.connect();const f=i.on("connection",p=>{const m=p,b=m.status==="connected"?"connected":"disconnected";_(`Plugin ${b} — ${m.clientId}`,m.status==="connected"?"info":"warn")}),d=i.on("mcp_status",p=>{const m=p,b=m.status==="registered"?"registered":"unregistered";_(`MCP ${b} — ${m.aiClientName}`,m.status==="registered"?"info":"warn"),x()});return()=>{f(),d(),i.disconnect(),g.current=null}},[_,x]),{status:t,connectionInfo:l,connectionLog:y,level:n,error:c,clearConnectionLog:C}}const z="_page_12byi_2",J="_card_12byi_10",K="_disabled_12byi_18",Q="_cardHeader_12byi_24",W="_clearButton_12byi_37",Y="_serverGrid_12byi_47",Z="_statusRow_12byi_65",ee="_table_12byi_79",ne="_toggleBtn_12byi_104",te="_disconnected_12byi_119",se="_disconnectedActions_12byi_136",ce="_btn_12byi_143",oe="_emptyRow_12byi_161",s={page:z,card:J,disabled:K,cardHeader:Q,clearButton:W,serverGrid:Y,statusRow:Z,table:ee,toggleBtn:ne,disconnected:te,disconnectedActions:se,btn:ce,emptyRow:oe};function w(n,t){const c=Math.max(0,Math.floor((Date.now()-n)/1e3));return c<60?`${c}${t("connection.time.secondsAgo","s ago")}`:c<3600?`${Math.floor(c/60)}${t("connection.time.minutesAgo","m ago")}`:`${Math.floor(c/3600)}${t("connection.time.hoursAgo","h ago")}`}function pe(){var b;const{t:n}=$(),{status:t,connectionInfo:c,connectionLog:l,level:u,clearConnectionLog:y}=X(),{show:h}=L(),[g,_]=r.useState(!0),[x,j]=r.useState(!1),[C,i]=r.useState(!1),f=P(t==null?void 0:t.uptime),d=u==="disconnected",p=d?"offline":"online",m=async()=>{i(!0);try{await y(),h(n("toast.clearSuccess","Cleared successfully"),"success"),j(!1)}catch{h(n("toast.clearFailed","Failed to clear data"),"error")}finally{i(!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")}),d?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(A,{status:p})}),e.jsxs("dl",{className:s.serverGrid,children:[(t==null?void 0:t.version)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(a,{label:n("connection.server.version","Version"),tooltip:n("connection.server.version.tooltip","Installed MCP server version")})}),e.jsx("dd",{children:e.jsx(M,{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(a,{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(a,{label:n("connection.server.uptime","Uptime"),tooltip:n("connection.server.uptime.tooltip","Time elapsed since the MCP server started")})}),e.jsx("dd",{children:k(f??t.uptime)})]}),(t==null?void 0:t.sessionId)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(a,{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)})]}),(c==null?void 0:c.serverExecutable)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(a,{label:n("connection.server.exec","Exec"),tooltip:n("connection.server.exec.tooltip","Executable path used to launch the MCP server")})}),e.jsx("dd",{children:c.serverExecutable})]})]})]})]}),e.jsxs("div",{className:`${s.card} ${d?s.disabled:""}`,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsxs("span",{children:[n("connection.agents.title","AI Agents")," ","(",(c==null?void 0:c.mcpInstanceCount)??0,")"]}),e.jsx("button",{className:s.toggleBtn,onClick:()=>_(o=>!o),"aria-label":g?n("common.collapse","Collapse"):n("common.expand","Expand"),children:g?"▾":"▸"})]}),g&&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(a,{label:n("connection.server.pid","PID"),tooltip:n("connection.server.pid.tooltip","Operating system process identifier")})}),e.jsx("th",{children:e.jsx(a,{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("tbody",{children:c!=null&&c.mcpInstances&&c.mcpInstances.length>0?c.mcpInstances.map(o=>e.jsxs("tr",{children:[e.jsx("td",{children:o.aiClientName??n("connection.agents.unknown","Unknown")}),e.jsx("td",{children:o.pid}),e.jsx("td",{children:o.projectRoot??o.cwd??n("connection.agents.projectRoot.unresolved","Unresolved")}),e.jsx("td",{children:w(o.connectedAt,n)})]},o.instanceId)):e.jsx("tr",{children:e.jsx("td",{colSpan:4,className:s.emptyRow,children:n("connection.agents.none","No agents connected")})})})]})]}),e.jsxs("div",{className:`${s.card} ${d?s.disabled:""}`,children:[e.jsxs("div",{className:s.cardHeader,children:[n("connection.plugins.title","Plugins")," ","(",((b=t==null?void 0:t.pluginClients)==null?void 0:b.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(a,{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(a,{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(a,{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(o=>e.jsxs("tr",{children:[e.jsx("td",{children:o.placeName??o.projectName??"-"}),e.jsx("td",{children:o.clientId.slice(0,10)}),e.jsx("td",{children:w(o.lastSeen,n)}),e.jsx("td",{children:o.pluginVersion??"-"})]},o.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} ${d?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:()=>j(!0),children:n("common.clear","Clear")})]}),e.jsx(V,{entries:l})]}),e.jsx(E,{open:x,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:C,onCancel:()=>!C&&j(!1),onConfirm:m})]})}export{pe as Component};
@@ -1 +1 @@
1
- import{j as r,m as e}from"./index-BNdn6WpU.js";function s({label:t,tooltip:o}){return r.jsx(e,{text:o,children:t})}export{s as I};
1
+ import{j as r,m as e}from"./index-DGGmfli1.js";function s({label:t,tooltip:o}){return r.jsx(e,{text:o,children:t})}export{s as I};
@@ -1 +1 @@
1
- import{j as t,u as $,r as u,d as L,a as D,D as F,T as U}from"./index-BNdn6WpU.js";import{I as V}from"./InfoLabel-B_Ys60mi.js";import{S as A}from"./StatusBadge-FYpJOX7r.js";import{D as z,P as O}from"./PropertyDiff-BbsF9z4D.js";import{u as J,T as X}from"./TierComparison-D4uVUGcZ.js";import{u as q,f as K}from"./useLiveUptime-D5Ux8dA5.js";import{T as Q}from"./TierPromoProgress-Cuz1dgcs.js";import"./TierPromo.module-CAoUYgIx.js";const W="_page_1xgxh_2",Y="_card_1xgxh_10",Z="_cardHeader_1xgxh_17",ee="_disconnectCard_1xgxh_28",te="_disconnectIcon_1xgxh_36",se="_disconnectTitle_1xgxh_41",ne="_disconnectMessage_1xgxh_48",ie="_reconnectGuide_1xgxh_55",re="_guideStep_1xgxh_64",ce="_stepNumber_1xgxh_72",ae="_reconnectIndicator_1xgxh_88",oe="_reconnectDot_1xgxh_98",le="_pulse_1xgxh_1",de="_disconnectActions_1xgxh_112",me="_btn_1xgxh_118",xe="_btnSecondary_1xgxh_134",ge="_metricRow_1xgxh_152",he="_metricGrid_1xgxh_158",ue="_metricCard_1xgxh_164",ve="_metric_ok_1xgxh_174",_e="_metric_warn_1xgxh_179",pe="_metric_error_1xgxh_184",fe="_metricHeader_1xgxh_189",je="_metricIcon_1xgxh_200",Ce="_metricTitle_1xgxh_204",we="_metricValue_1xgxh_208",Ne="_metricSubtitle_1xgxh_215",ye="_guideCard_1xgxh_225",Te="_guideTitle_1xgxh_232",Se="_checklist_1xgxh_239",be="_feedEmpty_1xgxh_263",Ie="_feedList_1xgxh_270",ke="_feedItem_1xgxh_278",De="_feedTime_1xgxh_291",Me="_feedIcon_1xgxh_298",Pe="_feedSummary_1xgxh_304",Ee="_feedText_1xgxh_313",Be="_feedContext_1xgxh_321",He="_feedItemClickable_1xgxh_330",Re="_feedChevron_1xgxh_338",$e="_feedDetail_1xgxh_347",Ge="_feedDetailPre_1xgxh_356",Le="_feedDetailText_1xgxh_365",Fe="_changelogSummary_1xgxh_372",Ue="_changeTag_1xgxh_381",Ve="_tierBar_1xgxh_393",Ae="_tierBarTrack_1xgxh_399",ze="_tierBarFillBasic_1xgxh_407",Oe="_tierBarFillPro_1xgxh_412",Je="_tierLabels_1xgxh_417",s={page:W,card:Y,cardHeader:Z,disconnectCard:ee,disconnectIcon:te,disconnectTitle:se,disconnectMessage:ne,reconnectGuide:ie,guideStep:re,stepNumber:ce,reconnectIndicator:ae,reconnectDot:oe,pulse:le,disconnectActions:de,btn:me,btnSecondary:xe,metricRow:ge,metricGrid:he,metricCard:ue,metric_ok:ve,metric_warn:_e,metric_error:pe,metricHeader:fe,metricIcon:je,metricTitle:Ce,metricValue:we,metricSubtitle:Ne,guideCard:ye,guideTitle:Te,checklist:Se,feedEmpty:be,feedList:Ie,feedItem:ke,feedTime:De,feedIcon:Me,feedSummary:Pe,feedText:Ee,feedContext:Be,feedItemClickable:He,feedChevron:Re,feedDetail:$e,feedDetailPre:Ge,feedDetailText:Le,changelogSummary:Fe,changeTag:Ue,tierBar:Ve,tierBarTrack:Ae,tierBarFillBasic:ze,tierBarFillPro:Oe,tierLabels:Je};function N({title:e,value:i,icon:r,subtitle:c,status:a,children:n}){const d=a?s[`metric_${a}`]:"";return t.jsxs("div",{className:`${s.metricCard} ${d}`,children:[t.jsxs("div",{className:s.metricHeader,children:[r&&t.jsx("span",{className:s.metricIcon,children:r}),t.jsx("span",{className:s.metricTitle,children:e})]}),t.jsx("div",{className:s.metricValue,children:i}),c&&t.jsx("div",{className:s.metricSubtitle,children:c}),n]})}function Xe(e){var r,c;const i=e==null?void 0:e.contextSummary;return(i==null?void 0:i.intent)??((c=(r=i==null?void 0:i.affectedAreas)==null?void 0:r[0])==null?void 0:c.label)??(i==null?void 0:i.testScenario)??null}function E({changes:e}){const{t:i}=$(),[r,c]=u.useState(null);return e.length===0?t.jsx("div",{className:s.feedEmpty,children:i("overview.feed.empty")}):t.jsx("div",{className:s.feedList,children:e.map((a,n)=>{const d=r===n,o=a.raw,v=o&&(o.before!=null||o.after!=null||o.details!=null),_=Xe(o);return t.jsxs("div",{children:[t.jsxs("div",{className:`${s.feedItem} ${v?s.feedItemClickable:""}`,onClick:()=>v&&c(d?null:n),children:[t.jsx("span",{className:s.feedTime,children:a.timestamp}),t.jsx("span",{className:s.feedIcon,children:a.icon}),t.jsxs("span",{className:s.feedText,children:[t.jsx("span",{className:s.feedSummary,children:a.summary}),_&&t.jsx("span",{className:s.feedContext,children:_})]}),v&&t.jsx("span",{className:s.feedChevron,children:d?"▴":"▾"})]}),d&&o&&t.jsx("div",{className:s.feedDetail,children:t.jsx(qe,{change:o})})]},n)})})}function qe({change:e}){return e.category==="script"&&(e.before||e.after)?t.jsx(z,{before:e.before,after:e.after}):e.category==="property"?t.jsx(O,{before:e.before,after:e.after}):e.details?t.jsx("pre",{className:s.feedDetailPre,children:JSON.stringify(e.details,null,2)}):t.jsx("div",{className:s.feedDetailText,children:e.target})}const B=20;function G(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}function H(){return G(new Date)}function R(e){switch(e){case"script":return"📝";case"instance":return"🧱";case"property":return"🎨";case"lighting":return"💡";case"terrain":return"⛰️";case"asset":return"📦";default:return"🔧"}}function Ke(){const{level:e,status:i}=L(),r=J(),[c,a]=u.useState(null),[n,d]=u.useState(null),[o,v]=u.useState(null),[_,g]=u.useState([]),y=u.useRef(null),T=u.useCallback(async()=>{try{const l=await D.get("/connection-info");a(l)}catch{a(null)}},[]),S=u.useCallback(async()=>{try{const l=await D.get("/api/dashboard/changelog/active");if(v(l),l.recentChanges&&l.recentChanges.length>0){const p=l.recentChanges.map(h=>({timestamp:h.timestamp?G(new Date(h.timestamp)):H(),icon:R(h.category),summary:h.summary,category:h.category,raw:h}));g(p)}}catch{v(null)}},[]),f=u.useCallback(async()=>{try{const l=await D.get("/sync/status");d(l)}catch{d(null)}},[]);return u.useEffect(()=>{e!=="disconnected"?(T(),S(),f()):(a(null),d(null),v(null));const l=new F;y.current=l,l.connect();const p=l.on("game_change",j=>{const m=j,C={timestamp:H(),icon:R(m.category),summary:m.summary,category:m.category};g(k=>{const w=[C,...k];return w.length>B?w.slice(0,B):w}),S()}),h=l.on("sync",j=>{const m=j;d(C=>({...C,state:m.status,...m.placeId?{placeId:m.placeId}:{}}))});return()=>{p(),h(),l.disconnect(),y.current=null}},[e,T,S,f]),{level:e,status:i,connectionInfo:c,syncStatus:n,changeSummary:o,recentChanges:_,tier:r}}function M(e){return e.scriptsModified+e.scriptsCreated+e.instancesCreated+e.instancesDeleted+e.instancesMoved+e.propertiesChanged+e.assetsInserted+(e.lightingChanged?1:0)+(e.terrainChanged?1:0)}function Qe(e,i){switch(e){case"syncing":return i("status.syncing","Syncing");case"initializing":return i("status.initializing","Initializing");case"error":return i("status.error","Error");default:return i("status.idle","Idle")}}function We(e){switch(e){case"syncing":return"ok";case"initializing":return"warn";case"error":return"error";default:return"ok"}}function I(e,i,r,c){return t.jsxs("div",{className:e.metricSubtitle,children:[t.jsx(V,{label:i,tooltip:r}),": ",c]},i)}function x(e,i){return t.jsx(U,{text:i,children:e})}function ct(){var w,P;const{t:e}=$(),{level:i,status:r,connectionInfo:c,syncStatus:a,changeSummary:n,recentChanges:d,tier:o}=Ke(),v=q(r==null?void 0:r.uptime);if(i==="disconnected")return t.jsx("div",{className:s.page,children:t.jsxs("div",{className:s.disconnectCard,children:[t.jsx("div",{className:s.disconnectIcon,children:"⚠️"}),t.jsx("h2",{className:s.disconnectTitle,children:e("overview.l0.title")}),t.jsx("p",{className:s.disconnectMessage,children:e("overview.l0.message")}),t.jsxs("div",{className:s.reconnectGuide,children:[t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"1"}),t.jsx("span",{children:e("overview.l0.step1")})]}),t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"2"}),t.jsx("span",{children:e("overview.l0.step2")})]})]}),t.jsxs("div",{className:s.reconnectIndicator,children:[t.jsx("span",{className:s.reconnectDot}),e("overview.l0.reconnecting")]}),t.jsxs("div",{className:s.disconnectActions,children:[t.jsx("button",{className:s.btn,onClick:()=>window.location.reload(),children:e("overview.l0.reconnectBtn")}),t.jsx("button",{className:s.btnSecondary,onClick:()=>{window.location.hash="#/settings"},children:e("overview.l0.settingsBtn")})]})]})});const _=(c==null?void 0:c.mcpInstanceCount)??0,g=((w=c==null?void 0:c.mcpInstances)==null?void 0:w.find(b=>!b.isServer&&b.aiClientName))??((P=c==null?void 0:c.mcpInstances)==null?void 0:P.find(b=>!!b.aiClientName))??null,y=(r==null?void 0:r.pluginClients)??[],T=y.length>0,S=(r==null?void 0:r.sessionId)??(c==null?void 0:c.sessionId)??"-",f=e("overview.metric.server.tooltip","MCP server runtime and process status"),l=e("overview.metric.plugin.tooltip","Roblox Studio plugin connection and version status"),p=e("overview.metric.agent.tooltip","Connected AI coding agents and their runtime state"),h=e("overview.metric.sync.tooltip","Current Studio to local sync activity"),j=r?[I(s,e("overview.meta.version","Version"),e("overview.meta.version.tooltip","Installed MCP server version"),`v${r.version}`),I(s,e("overview.meta.session","Session"),e("overview.meta.session.tooltip","Current MCP session identifier"),S),I(s,e("overview.meta.pid","PID"),e("overview.meta.pid.tooltip","Operating system process identifier"),String(r.pid??"-")),I(s,e("overview.meta.uptime","Uptime"),e("overview.meta.uptime.tooltip","Time elapsed since the MCP server started"),K(v??r.uptime))]:[];if(i==="serverOnly")return t.jsxs("div",{className:s.page,children:[t.jsxs("div",{className:s.metricRow,children:[t.jsx(N,{title:x(e("overview.metric.server"),f),value:x(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsxs(t.Fragment,{children:[j,t.jsx(A,{status:"online"})]})}),t.jsx(N,{title:x(e("overview.metric.agent"),p),value:x((g==null?void 0:g.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:g?"ok":"warn"})]}),t.jsxs("div",{className:s.guideCard,children:[t.jsx("h3",{className:s.guideTitle,children:e("overview.l1.pluginGuide")}),t.jsxs("ul",{className:s.checklist,children:[t.jsx("li",{children:e("overview.l1.check1")}),t.jsx("li",{children:e("overview.l1.check2")}),t.jsx("li",{children:e("overview.l1.check3")})]})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),d.length>0?t.jsx(E,{changes:d}):t.jsx("div",{className:s.feedEmpty,children:e("overview.l1.feedHint")})]}),n&&M(n)>0&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",M(n)]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]});const m=y[0],C=n?M(n):0,k=!!n&&C>0;return t.jsxs("div",{className:s.page,children:[t.jsxs("div",{className:s.metricGrid,children:[t.jsx(N,{title:x(e("overview.metric.server"),f),value:x(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsx(t.Fragment,{children:j})}),t.jsx(N,{title:x(e("overview.metric.plugin"),l),value:x(e(T?"status.online":"status.offline"),l),icon:"🔌",subtitle:m?`${m.placeName??m.projectName??"-"} / v${m.pluginVersion??"-"}`:void 0,status:T?"ok":"error"}),t.jsx(N,{title:x(e("overview.metric.agent"),p),value:x((g==null?void 0:g.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:g?"ok":"warn"}),t.jsx(N,{title:x(e("overview.metric.sync"),h),value:x(Qe(a==null?void 0:a.state,e),h),icon:"🔄",status:We(a==null?void 0:a.state)})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),t.jsx(E,{changes:d})]}),k&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",C]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]}),!o.loading&&o.tier==="basic"&&o.totalCalls>0&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.tier.title")}),t.jsx(Q,{basicCalls:o.basicCalls,proCalls:o.proCalls,totalCalls:o.totalCalls,proUsagePercent:o.proUsagePercent,upgradeHref:X.overview})]})]})}export{ct as Component};
1
+ import{j as t,u as $,r as u,d as L,a as D,D as F,T as U}from"./index-DGGmfli1.js";import{I as V}from"./InfoLabel-CCDWZLC9.js";import{S as A}from"./StatusBadge-C8VKAPpk.js";import{D as z,P as O}from"./PropertyDiff-DIplDn-J.js";import{u as J,T as X}from"./TierComparison-7ofkPwj3.js";import{u as q,f as K}from"./useLiveUptime-BnXeLpOw.js";import{T as Q}from"./TierPromoProgress-SnRUjAPh.js";import"./TierPromo.module-CAoUYgIx.js";const W="_page_1xgxh_2",Y="_card_1xgxh_10",Z="_cardHeader_1xgxh_17",ee="_disconnectCard_1xgxh_28",te="_disconnectIcon_1xgxh_36",se="_disconnectTitle_1xgxh_41",ne="_disconnectMessage_1xgxh_48",ie="_reconnectGuide_1xgxh_55",re="_guideStep_1xgxh_64",ce="_stepNumber_1xgxh_72",ae="_reconnectIndicator_1xgxh_88",oe="_reconnectDot_1xgxh_98",le="_pulse_1xgxh_1",de="_disconnectActions_1xgxh_112",me="_btn_1xgxh_118",xe="_btnSecondary_1xgxh_134",ge="_metricRow_1xgxh_152",he="_metricGrid_1xgxh_158",ue="_metricCard_1xgxh_164",ve="_metric_ok_1xgxh_174",_e="_metric_warn_1xgxh_179",pe="_metric_error_1xgxh_184",fe="_metricHeader_1xgxh_189",je="_metricIcon_1xgxh_200",Ce="_metricTitle_1xgxh_204",we="_metricValue_1xgxh_208",Ne="_metricSubtitle_1xgxh_215",ye="_guideCard_1xgxh_225",Te="_guideTitle_1xgxh_232",Se="_checklist_1xgxh_239",be="_feedEmpty_1xgxh_263",Ie="_feedList_1xgxh_270",ke="_feedItem_1xgxh_278",De="_feedTime_1xgxh_291",Me="_feedIcon_1xgxh_298",Pe="_feedSummary_1xgxh_304",Ee="_feedText_1xgxh_313",Be="_feedContext_1xgxh_321",He="_feedItemClickable_1xgxh_330",Re="_feedChevron_1xgxh_338",$e="_feedDetail_1xgxh_347",Ge="_feedDetailPre_1xgxh_356",Le="_feedDetailText_1xgxh_365",Fe="_changelogSummary_1xgxh_372",Ue="_changeTag_1xgxh_381",Ve="_tierBar_1xgxh_393",Ae="_tierBarTrack_1xgxh_399",ze="_tierBarFillBasic_1xgxh_407",Oe="_tierBarFillPro_1xgxh_412",Je="_tierLabels_1xgxh_417",s={page:W,card:Y,cardHeader:Z,disconnectCard:ee,disconnectIcon:te,disconnectTitle:se,disconnectMessage:ne,reconnectGuide:ie,guideStep:re,stepNumber:ce,reconnectIndicator:ae,reconnectDot:oe,pulse:le,disconnectActions:de,btn:me,btnSecondary:xe,metricRow:ge,metricGrid:he,metricCard:ue,metric_ok:ve,metric_warn:_e,metric_error:pe,metricHeader:fe,metricIcon:je,metricTitle:Ce,metricValue:we,metricSubtitle:Ne,guideCard:ye,guideTitle:Te,checklist:Se,feedEmpty:be,feedList:Ie,feedItem:ke,feedTime:De,feedIcon:Me,feedSummary:Pe,feedText:Ee,feedContext:Be,feedItemClickable:He,feedChevron:Re,feedDetail:$e,feedDetailPre:Ge,feedDetailText:Le,changelogSummary:Fe,changeTag:Ue,tierBar:Ve,tierBarTrack:Ae,tierBarFillBasic:ze,tierBarFillPro:Oe,tierLabels:Je};function N({title:e,value:i,icon:r,subtitle:c,status:a,children:n}){const d=a?s[`metric_${a}`]:"";return t.jsxs("div",{className:`${s.metricCard} ${d}`,children:[t.jsxs("div",{className:s.metricHeader,children:[r&&t.jsx("span",{className:s.metricIcon,children:r}),t.jsx("span",{className:s.metricTitle,children:e})]}),t.jsx("div",{className:s.metricValue,children:i}),c&&t.jsx("div",{className:s.metricSubtitle,children:c}),n]})}function Xe(e){var r,c;const i=e==null?void 0:e.contextSummary;return(i==null?void 0:i.intent)??((c=(r=i==null?void 0:i.affectedAreas)==null?void 0:r[0])==null?void 0:c.label)??(i==null?void 0:i.testScenario)??null}function E({changes:e}){const{t:i}=$(),[r,c]=u.useState(null);return e.length===0?t.jsx("div",{className:s.feedEmpty,children:i("overview.feed.empty")}):t.jsx("div",{className:s.feedList,children:e.map((a,n)=>{const d=r===n,o=a.raw,v=o&&(o.before!=null||o.after!=null||o.details!=null),_=Xe(o);return t.jsxs("div",{children:[t.jsxs("div",{className:`${s.feedItem} ${v?s.feedItemClickable:""}`,onClick:()=>v&&c(d?null:n),children:[t.jsx("span",{className:s.feedTime,children:a.timestamp}),t.jsx("span",{className:s.feedIcon,children:a.icon}),t.jsxs("span",{className:s.feedText,children:[t.jsx("span",{className:s.feedSummary,children:a.summary}),_&&t.jsx("span",{className:s.feedContext,children:_})]}),v&&t.jsx("span",{className:s.feedChevron,children:d?"▴":"▾"})]}),d&&o&&t.jsx("div",{className:s.feedDetail,children:t.jsx(qe,{change:o})})]},n)})})}function qe({change:e}){return e.category==="script"&&(e.before||e.after)?t.jsx(z,{before:e.before,after:e.after}):e.category==="property"?t.jsx(O,{before:e.before,after:e.after}):e.details?t.jsx("pre",{className:s.feedDetailPre,children:JSON.stringify(e.details,null,2)}):t.jsx("div",{className:s.feedDetailText,children:e.target})}const B=20;function G(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}function H(){return G(new Date)}function R(e){switch(e){case"script":return"📝";case"instance":return"🧱";case"property":return"🎨";case"lighting":return"💡";case"terrain":return"⛰️";case"asset":return"📦";default:return"🔧"}}function Ke(){const{level:e,status:i}=L(),r=J(),[c,a]=u.useState(null),[n,d]=u.useState(null),[o,v]=u.useState(null),[_,g]=u.useState([]),y=u.useRef(null),T=u.useCallback(async()=>{try{const l=await D.get("/connection-info");a(l)}catch{a(null)}},[]),S=u.useCallback(async()=>{try{const l=await D.get("/api/dashboard/changelog/active");if(v(l),l.recentChanges&&l.recentChanges.length>0){const p=l.recentChanges.map(h=>({timestamp:h.timestamp?G(new Date(h.timestamp)):H(),icon:R(h.category),summary:h.summary,category:h.category,raw:h}));g(p)}}catch{v(null)}},[]),f=u.useCallback(async()=>{try{const l=await D.get("/sync/status");d(l)}catch{d(null)}},[]);return u.useEffect(()=>{e!=="disconnected"?(T(),S(),f()):(a(null),d(null),v(null));const l=new F;y.current=l,l.connect();const p=l.on("game_change",j=>{const m=j,C={timestamp:H(),icon:R(m.category),summary:m.summary,category:m.category};g(k=>{const w=[C,...k];return w.length>B?w.slice(0,B):w}),S()}),h=l.on("sync",j=>{const m=j;d(C=>({...C,state:m.status,...m.placeId?{placeId:m.placeId}:{}}))});return()=>{p(),h(),l.disconnect(),y.current=null}},[e,T,S,f]),{level:e,status:i,connectionInfo:c,syncStatus:n,changeSummary:o,recentChanges:_,tier:r}}function M(e){return e.scriptsModified+e.scriptsCreated+e.instancesCreated+e.instancesDeleted+e.instancesMoved+e.propertiesChanged+e.assetsInserted+(e.lightingChanged?1:0)+(e.terrainChanged?1:0)}function Qe(e,i){switch(e){case"syncing":return i("status.syncing","Syncing");case"initializing":return i("status.initializing","Initializing");case"error":return i("status.error","Error");default:return i("status.idle","Idle")}}function We(e){switch(e){case"syncing":return"ok";case"initializing":return"warn";case"error":return"error";default:return"ok"}}function I(e,i,r,c){return t.jsxs("div",{className:e.metricSubtitle,children:[t.jsx(V,{label:i,tooltip:r}),": ",c]},i)}function x(e,i){return t.jsx(U,{text:i,children:e})}function ct(){var w,P;const{t:e}=$(),{level:i,status:r,connectionInfo:c,syncStatus:a,changeSummary:n,recentChanges:d,tier:o}=Ke(),v=q(r==null?void 0:r.uptime);if(i==="disconnected")return t.jsx("div",{className:s.page,children:t.jsxs("div",{className:s.disconnectCard,children:[t.jsx("div",{className:s.disconnectIcon,children:"⚠️"}),t.jsx("h2",{className:s.disconnectTitle,children:e("overview.l0.title")}),t.jsx("p",{className:s.disconnectMessage,children:e("overview.l0.message")}),t.jsxs("div",{className:s.reconnectGuide,children:[t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"1"}),t.jsx("span",{children:e("overview.l0.step1")})]}),t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"2"}),t.jsx("span",{children:e("overview.l0.step2")})]})]}),t.jsxs("div",{className:s.reconnectIndicator,children:[t.jsx("span",{className:s.reconnectDot}),e("overview.l0.reconnecting")]}),t.jsxs("div",{className:s.disconnectActions,children:[t.jsx("button",{className:s.btn,onClick:()=>window.location.reload(),children:e("overview.l0.reconnectBtn")}),t.jsx("button",{className:s.btnSecondary,onClick:()=>{window.location.hash="#/settings"},children:e("overview.l0.settingsBtn")})]})]})});const _=(c==null?void 0:c.mcpInstanceCount)??0,g=((w=c==null?void 0:c.mcpInstances)==null?void 0:w.find(b=>!b.isServer&&b.aiClientName))??((P=c==null?void 0:c.mcpInstances)==null?void 0:P.find(b=>!!b.aiClientName))??null,y=(r==null?void 0:r.pluginClients)??[],T=y.length>0,S=(r==null?void 0:r.sessionId)??(c==null?void 0:c.sessionId)??"-",f=e("overview.metric.server.tooltip","MCP server runtime and process status"),l=e("overview.metric.plugin.tooltip","Roblox Studio plugin connection and version status"),p=e("overview.metric.agent.tooltip","Connected AI coding agents and their runtime state"),h=e("overview.metric.sync.tooltip","Current Studio to local sync activity"),j=r?[I(s,e("overview.meta.version","Version"),e("overview.meta.version.tooltip","Installed MCP server version"),`v${r.version}`),I(s,e("overview.meta.session","Session"),e("overview.meta.session.tooltip","Current MCP session identifier"),S),I(s,e("overview.meta.pid","PID"),e("overview.meta.pid.tooltip","Operating system process identifier"),String(r.pid??"-")),I(s,e("overview.meta.uptime","Uptime"),e("overview.meta.uptime.tooltip","Time elapsed since the MCP server started"),K(v??r.uptime))]:[];if(i==="serverOnly")return t.jsxs("div",{className:s.page,children:[t.jsxs("div",{className:s.metricRow,children:[t.jsx(N,{title:x(e("overview.metric.server"),f),value:x(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsxs(t.Fragment,{children:[j,t.jsx(A,{status:"online"})]})}),t.jsx(N,{title:x(e("overview.metric.agent"),p),value:x((g==null?void 0:g.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:g?"ok":"warn"})]}),t.jsxs("div",{className:s.guideCard,children:[t.jsx("h3",{className:s.guideTitle,children:e("overview.l1.pluginGuide")}),t.jsxs("ul",{className:s.checklist,children:[t.jsx("li",{children:e("overview.l1.check1")}),t.jsx("li",{children:e("overview.l1.check2")}),t.jsx("li",{children:e("overview.l1.check3")})]})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),d.length>0?t.jsx(E,{changes:d}):t.jsx("div",{className:s.feedEmpty,children:e("overview.l1.feedHint")})]}),n&&M(n)>0&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",M(n)]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]});const m=y[0],C=n?M(n):0,k=!!n&&C>0;return t.jsxs("div",{className:s.page,children:[t.jsxs("div",{className:s.metricGrid,children:[t.jsx(N,{title:x(e("overview.metric.server"),f),value:x(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsx(t.Fragment,{children:j})}),t.jsx(N,{title:x(e("overview.metric.plugin"),l),value:x(e(T?"status.online":"status.offline"),l),icon:"🔌",subtitle:m?`${m.placeName??m.projectName??"-"} / v${m.pluginVersion??"-"}`:void 0,status:T?"ok":"error"}),t.jsx(N,{title:x(e("overview.metric.agent"),p),value:x((g==null?void 0:g.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:g?"ok":"warn"}),t.jsx(N,{title:x(e("overview.metric.sync"),h),value:x(Qe(a==null?void 0:a.state,e),h),icon:"🔄",status:We(a==null?void 0:a.state)})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),t.jsx(E,{changes:d})]}),k&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",C]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]}),!o.loading&&o.tier==="basic"&&o.totalCalls>0&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.tier.title")}),t.jsx(Q,{basicCalls:o.basicCalls,proCalls:o.proCalls,totalCalls:o.totalCalls,proUsagePercent:o.proUsagePercent,upgradeHref:X.overview})]})]})}export{ct as Component};
@@ -1,4 +1,4 @@
1
- import{r as n,a as v,u as S,j as e,T as x,i as A}from"./index-BNdn6WpU.js";import{u as H,T as D,D as E,a as U}from"./TierComparison-D4uVUGcZ.js";import{I as R}from"./InfoLabel-B_Ys60mi.js";import{C as $}from"./ConfirmModal-CInBBLZW.js";const O=5e3;function F(t){const o=(t==null?void 0:t.enabled)??!0,[d,r]=n.useState([]),[a,i]=n.useState(null),[m,l]=n.useState(o),c=n.useRef(null),p=n.useCallback(async()=>{try{const _=await v.get("/api/dashboard/playtest/history");r(_.entries??[])}catch{r([])}},[]),u=n.useCallback(async()=>{if(!o){l(!1);return}await p(),l(!1)},[o,p]),y=n.useCallback(async()=>{o&&(await v.post("/api/dashboard/playtest/history/clear"),r([]),i(null))},[o]),w=n.useCallback(async _=>{if(o)try{const g=await v.get(`/api/dashboard/playtest/report/${_}`);i(g)}catch{i(null)}},[o]);return n.useEffect(()=>{if(!o){l(!1);return}return u(),c.current=setInterval(u,O),()=>{c.current&&clearInterval(c.current)}},[o,u]),{history:d,selectedReport:a,loading:m,loadReport:w,clearHistory:y}}function W(t){const o="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:o,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
1
+ import{r as n,a as v,u as S,j as e,T as x,i as A}from"./index-DGGmfli1.js";import{u as H,T as D,D as E,a as U}from"./TierComparison-7ofkPwj3.js";import{I as R}from"./InfoLabel-CCDWZLC9.js";import{C as $}from"./ConfirmModal-BmRJ2JXZ.js";const O=5e3;function F(t){const o=(t==null?void 0:t.enabled)??!0,[d,r]=n.useState([]),[a,i]=n.useState(null),[m,l]=n.useState(o),c=n.useRef(null),p=n.useCallback(async()=>{try{const _=await v.get("/api/dashboard/playtest/history");r(_.entries??[])}catch{r([])}},[]),u=n.useCallback(async()=>{if(!o){l(!1);return}await p(),l(!1)},[o,p]),y=n.useCallback(async()=>{o&&(await v.post("/api/dashboard/playtest/history/clear"),r([]),i(null))},[o]),w=n.useCallback(async _=>{if(o)try{const g=await v.get(`/api/dashboard/playtest/report/${_}`);i(g)}catch{i(null)}},[o]);return n.useEffect(()=>{if(!o){l(!1);return}return u(),c.current=setInterval(u,O),()=>{c.current&&clearInterval(c.current)}},[o,u]),{history:d,selectedReport:a,loading:m,loadReport:w,clearHistory:y}}function W(t){const o="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:o,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
2
 
3
3
  - Spawn flow: PASS
4
4
  - HUD countdown: PASS
@@ -1,4 +1,4 @@
1
- import{u as f,r as h,j as n}from"./index-BNdn6WpU.js";const _="_container_uv8oc_2",p="_header_uv8oc_10",N="_modeBtn_uv8oc_18",x="_modeBtnActive_uv8oc_33",v="_unifiedView_uv8oc_40",j="_diffLine_uv8oc_46",y="_lineNum_uv8oc_55",g="_lineContent_uv8oc_64",C="_lineAdded_uv8oc_68",B="_lineRemoved_uv8oc_73",V="_lineContext_uv8oc_78",w="_sideBySide_uv8oc_83",L="_sidePane_uv8oc_90",$="_sideLabel_uv8oc_100",b="_sideContent_uv8oc_112",A="_empty_uv8oc_117",e={container:_,header:p,modeBtn:N,modeBtnActive:x,unifiedView:v,diffLine:j,lineNum:y,lineContent:g,lineAdded:C,lineRemoved:B,lineContext:V,sideBySide:w,sidePane:L,sideLabel:$,sideContent:b,empty:A};function S(t,c){const d=t.split(`
1
+ import{u as f,r as h,j as n}from"./index-DGGmfli1.js";const _="_container_uv8oc_2",p="_header_uv8oc_10",N="_modeBtn_uv8oc_18",x="_modeBtnActive_uv8oc_33",v="_unifiedView_uv8oc_40",j="_diffLine_uv8oc_46",y="_lineNum_uv8oc_55",g="_lineContent_uv8oc_64",C="_lineAdded_uv8oc_68",B="_lineRemoved_uv8oc_73",V="_lineContext_uv8oc_78",w="_sideBySide_uv8oc_83",L="_sidePane_uv8oc_90",$="_sideLabel_uv8oc_100",b="_sideContent_uv8oc_112",A="_empty_uv8oc_117",e={container:_,header:p,modeBtn:N,modeBtnActive:x,unifiedView:v,diffLine:j,lineNum:y,lineContent:g,lineAdded:C,lineRemoved:B,lineContext:V,sideBySide:w,sidePane:L,sideLabel:$,sideContent:b,empty:A};function S(t,c){const d=t.split(`
2
2
  `),l=c.split(`
3
3
  `),a=[],m=Math.max(d.length,l.length);let s=0,i=0;for(;(s<d.length||i<l.length)&&(s<d.length&&i<l.length?d[s]===l[i]?(a.push({type:"context",content:d[s],lineNum:i+1}),s++,i++):(a.push({type:"removed",content:d[s],lineNum:s+1}),s++,s<d.length&&d[s]===l[i]?(a.push({type:"added",content:l[i],lineNum:i+1}),i++):i<l.length&&(a.push({type:"added",content:l[i],lineNum:i+1}),i++)):s<d.length?(a.push({type:"removed",content:d[s],lineNum:s+1}),s++):i<l.length&&(a.push({type:"added",content:l[i],lineNum:i+1}),i++),!(a.length>m*3)););return a}function E({before:t,after:c}){const{t:d}=f(),[l,a]=h.useState("unified"),m=h.useMemo(()=>S(t??"",c??""),[t,c]);if(!t&&!c)return n.jsx("div",{className:e.container,children:n.jsx("div",{className:e.empty,children:d("changelog.diff.empty","No diff available")})});if(!t&&c){const s=c.split(`
4
4
  `);return n.jsx("div",{className:e.container,children:n.jsx("div",{className:e.unifiedView,children:s.map((i,u)=>n.jsxs("div",{className:`${e.diffLine} ${e.lineAdded}`,children:[n.jsx("span",{className:e.lineNum,children:u+1}),n.jsxs("span",{className:e.lineContent,children:["+ ",i]})]},u))})})}return n.jsxs("div",{className:e.container,children:[n.jsxs("div",{className:e.header,children:[n.jsx("button",{className:`${e.modeBtn} ${l==="unified"?e.modeBtnActive:""}`,onClick:()=>a("unified"),children:d("changelog.diff.unified","Unified")}),n.jsx("button",{className:`${e.modeBtn} ${l==="side-by-side"?e.modeBtnActive:""}`,onClick:()=>a("side-by-side"),children:d("changelog.diff.sideBySide","Side by Side")})]}),l==="unified"?n.jsx("div",{className:e.unifiedView,children:m.map((s,i)=>n.jsxs("div",{className:`${e.diffLine} ${s.type==="added"?e.lineAdded:s.type==="removed"?e.lineRemoved:e.lineContext}`,children:[n.jsx("span",{className:e.lineNum,children:s.lineNum??""}),n.jsxs("span",{className:e.lineContent,children:[s.type==="added"?"+ ":s.type==="removed"?"- ":" ",s.content]})]},i))}):n.jsxs("div",{className:e.sideBySide,children:[n.jsxs("div",{className:e.sidePane,children:[n.jsx("div",{className:e.sideLabel,children:d("changelog.diff.before","Before")}),n.jsx("div",{className:e.sideContent,children:(t??"").split(`
@@ -0,0 +1 @@
1
+ import{d as w,r,f as P,D as z,e as B,g as H,h as D,a as O,u as M,j as e,T as x,A as $,S as G}from"./index-DGGmfli1.js";import{I as c}from"./InfoLabel-CCDWZLC9.js";function W(){const{level:t}=w(),[l,L]=r.useState(null),[u,a]=r.useState(null),[E,v]=r.useState(!1),[b,y]=r.useState(!0),[A,_]=r.useState(!1),[k,m]=r.useState(null),g="gumroad",h=t==="disconnected",p=r.useCallback(n=>{n&&a(o=>({...o,...n,maskedKey:n.maskedKey??(o==null?void 0:o.maskedKey),provider:n.provider??(o==null?void 0:o.provider)??g}))},[g]),f=r.useCallback(n=>{if(!n){a(null);return}a({...n,provider:n.provider??g})},[g]),N=r.useCallback(async()=>{try{return await P(g)}catch{return null}},[g]);r.useEffect(()=>{let n=!1;async function o(){try{const[d,T]=await Promise.all([O.get("/api/dashboard/settings").catch(()=>null),N()]);if(n)return;d&&L(d),T&&p(T)}catch{}finally{n||y(!1)}}return o(),()=>{n=!0}},[N,p]),r.useEffect(()=>{const n=new z;n.connect();const o=n.on("license",d=>{N().then(T=>{if(T){if((d==null?void 0:d.cleared)===!0){f(T);return}p(T)}})});return()=>{o(),n.disconnect()}},[N,p,f]);const j=r.useCallback((n,o)=>{m(n??o)},[]),R=r.useCallback(async n=>{if(h)return!1;if(!n.trim())return m("License key is required."),!1;_(!0);try{const o=await B({provider:g,licenseKey:n.trim()});return p(o.license),j(o.message,o.ok?"License updated.":"License activation failed."),o.ok}catch{return m("License activation failed."),!1}finally{_(!1)}},[j,h,g,p]),S=r.useCallback(async()=>{if(!h){_(!0);try{const n=await H({provider:g});p(n.license),j(n.message,n.ok?"License updated.":"License refresh failed.")}catch{m("License refresh failed.")}finally{_(!1)}}},[j,h,g,p]),C=r.useCallback(async()=>{if(!h){_(!0);try{const n=await D({provider:g});f(n.license),j(n.message,n.ok?"License reset.":"License reset failed.")}catch{m("License reset failed.")}finally{_(!1)}}},[j,h,g,f]),i=r.useCallback(async(n,o)=>{if(l){L(d=>d&&{...d,hot:{...d.hot,[n]:o}}),v(!0);try{await O.patch("/api/dashboard/settings",{[n]:o})}catch{L(d=>d&&{...d,hot:{...d.hot,[n]:l.hot[n]}})}finally{v(!1)}}},[l]);return{settings:l,license:u,saving:E,licenseProvider:g,licenseControlsDisabled:h,licenseSubmitting:A,licenseMessage:k,activateLicense:R,refreshLicense:S,resetLicense:C,updateHotSetting:i,loading:b}}const X="_page_vbvzx_2",F="_card_vbvzx_10",q="_licenseCardPro_vbvzx_17",U="_cardHeader_vbvzx_28",K="_headerBadge_vbvzx_42",V="_headerBadgeLive_vbvzx_53",Q="_licenseGrid_vbvzx_59",Y="_statusDot_vbvzx_77",J="_statusActive_vbvzx_86",Z="_statusGrace_vbvzx_91",ee="_statusInactive_vbvzx_96",te="_statusError_vbvzx_100",se="_proBadge_vbvzx_105",ie="_upgradeLink_vbvzx_119",ne="_licenseControls_vbvzx_133",ae="_licenseControlRow_vbvzx_142",le="_licenseField_vbvzx_149",oe="_licenseFieldGrow_vbvzx_155",ce="_controlLabel_vbvzx_160",re="_textInput_vbvzx_166",de="_actionBtn_vbvzx_182",ge="_licenseMessage_vbvzx_204",ue="_licenseNotice_vbvzx_211",he="_licenseNoticeInfo_vbvzx_221",ve="_licenseNoticeWarning_vbvzx_227",pe="_licenseNoticeMuted_vbvzx_233",be="_settingRow_vbvzx_239",xe="_settingLabel_vbvzx_253",_e="_settingControl_vbvzx_260",me="_select_vbvzx_269",je="_numberInput_vbvzx_287",Le="_toggleSwitch_vbvzx_305",fe="_toggleInput_vbvzx_312",Ne="_toggleTrack_vbvzx_320",Ce="_toggleThumb_vbvzx_342",Te="_savedIndicator_vbvzx_391",ye="_savedIndicatorHidden_vbvzx_402",Re="_coldGrid_vbvzx_407",Se="_coldHint_vbvzx_425",Ee="_langRow_vbvzx_434",Ae="_loading_vbvzx_447",ke="_unit_vbvzx_456",s={page:X,card:F,licenseCardPro:q,cardHeader:U,headerBadge:K,headerBadgeLive:V,licenseGrid:Q,statusDot:Y,statusActive:J,statusGrace:Z,statusInactive:ee,statusError:te,proBadge:se,upgradeLink:ie,licenseControls:ne,licenseControlRow:ae,licenseField:le,licenseFieldGrow:oe,controlLabel:ce,textInput:re,actionBtn:de,licenseMessage:ge,licenseNotice:ue,licenseNoticeInfo:he,licenseNoticeWarning:ve,licenseNoticeMuted:pe,settingRow:be,settingLabel:xe,settingControl:_e,select:me,numberInput:je,toggleSwitch:Le,toggleInput:fe,toggleTrack:Ne,toggleThumb:Ce,savedIndicator:Te,savedIndicatorHidden:ye,coldGrid:Re,coldHint:Se,langRow:Ee,loading:Ae,unit:ke},Ie={en:"English",ko:"한국어",es:"Español","pt-br":"Português (BR)",ja:"日本語",id:"Bahasa Indonesia"},Oe=["debug","info","warn","error"];function we(t){return t==="active"?s.statusActive:t==="grace"?s.statusGrace:t==="invalid"||t==="revoked"?s.statusError:s.statusInactive}function Pe(t,l){return t.refreshBlockedReason==="missing_session_token"?{label:l("settings.license.status.activationRequired","Activation Required"),tooltip:l("settings.license.status.activationRequired.tooltip","Manual license activation is required before WROX Dashboard can refresh this status."),detail:l("settings.license.detail.missingSessionToken","Refresh is blocked because the current session token is missing."),detailTone:s.licenseNoticeWarning}:t.statusDetail==="active_cancel_pending"?{label:l("settings.license.active","Active"),tooltip:l("settings.license.status.activeCancelPending.tooltip","Cancellation is pending, but Pro access remains active until the current billing period ends."),detail:l("settings.license.detail.cancelPending","Cancellation is scheduled. Pro access remains active until the current billing period ends."),detailTone:s.licenseNoticeInfo}:t.statusDetail==="grace_provider_unavailable"?{label:l("settings.license.status.grace","Grace"),tooltip:l("settings.license.status.grace.tooltip","Provider verification is temporarily unavailable, but Pro access remains active during the grace period."),detail:l("settings.license.detail.graceProviderUnavailable","Provider unavailable. Pro access remains active during grace mode."),detailTone:s.licenseNoticeInfo}:t.statusDetail==="grace_expired"||t.statusDetail==="grace_payment_failed"?{label:l("settings.license.status.grace","Grace"),tooltip:l("settings.license.status.graceBilling.tooltip","Pro access is still available during a billing-related grace period."),detail:l("settings.license.detail.graceBilling","Pro access remains available during a billing grace period."),detailTone:s.licenseNoticeInfo}:{label:l(`settings.license.${t.status}`,t.status),tooltip:l(`settings.license.${t.status}.tooltip`,"Current license activation state."),detail:t.refreshRequired?l("settings.license.detail.refreshRecommended","License verification should be refreshed soon."):null,detailTone:s.licenseNoticeMuted}}function I({checked:t,onChange:l,testId:L,ariaLabel:u}){return e.jsxs("label",{className:s.toggleSwitch,"data-testid":L,children:[e.jsx("input",{type:"checkbox",className:s.toggleInput,checked:t,"aria-label":u,onChange:a=>l(a.target.checked)}),e.jsx("span",{className:s.toggleTrack,"aria-hidden":"true",children:e.jsx("span",{className:s.toggleThumb})})]})}function He(){const{t,selectedLocale:l,setLocale:L}=M(),{settings:u,license:a,licenseProvider:E,licenseControlsDisabled:v,licenseSubmitting:b,licenseMessage:y,activateLicense:A,refreshLicense:_,resetLicense:k,updateHotSetting:m,loading:g}=W(),[h,p]=r.useState(null),[f,N]=r.useState(""),j=a?Pe(a,t):null,R=(a==null?void 0:a.tier)==="pro",S=(a==null?void 0:a.tier)==="pro"?a.maskedKey:void 0,C=r.useCallback(async(i,n)=>{await m(i,n),p(i),setTimeout(()=>p(o=>o===i?null:o),2e3)},[m]);return g?e.jsx("div",{className:s.page,children:e.jsx("div",{className:s.loading,children:t("common.loading")})}):e.jsxs("div",{className:s.page,children:[e.jsxs("div",{"data-testid":"settings-license-card",className:[s.card,(a==null?void 0:a.tier)==="pro"?s.licenseCardPro:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsx(c,{label:t("settings.license.title","License"),tooltip:t("settings.license.title.tooltip","Current license status and subscription tier.")}),e.jsx(x,{text:v?t("settings.license.disconnected.tooltip","Reconnect to the MCP server to manage license actions from WROX Dashboard."):t("settings.license.live.tooltip","License actions are sent to the MCP server immediately."),children:e.jsx("span",{className:`${s.headerBadge} ${v?"":s.headerBadgeLive}`,children:v?t("settings.license.disconnected","Disconnected"):t("settings.general.liveApply","Live Apply")})})]}),e.jsxs(e.Fragment,{children:[a?e.jsxs(e.Fragment,{children:[(()=>{const i=j;return e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:s.licenseGrid,children:[e.jsx("dt",{children:e.jsx(c,{label:t("settings.license.status","Status"),tooltip:t("settings.license.status.tooltip","Current license activation state.")})}),e.jsxs("dd",{children:[e.jsx("span",{className:`${s.statusDot} ${we(a.status)}`}),e.jsx(x,{text:(i==null?void 0:i.tooltip)??t(`settings.license.${a.status}.tooltip`,"Current license activation state."),children:(i==null?void 0:i.label)??t(`settings.license.${a.status}`,a.status)})]}),e.jsx("dt",{children:e.jsx(c,{label:t("settings.license.tier","Tier"),tooltip:t("settings.license.tier.tooltip","Current subscription tier for available WROX Dashboard features.")})}),e.jsx("dd",{className:a.tier==="pro"?s.proBadge:"",children:e.jsx(x,{text:t(`tier.${a.tier}.tooltip`,"Available feature set for the connected license."),children:a.tier==="pro"?t("tier.pro","Pro"):t("tier.basic","Basic")})}),S&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(c,{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(x,{text:t("settings.license.keyValue.tooltip","Masked license key currently loaded by the server."),children:S})})]}),a.provider&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(c,{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(x,{text:t("settings.license.providerValue.tooltip","License provider used to validate this key."),children:a.provider})})]})]}),(i==null?void 0:i.detail)&&e.jsx("p",{className:`${s.licenseNotice} ${i.detailTone}`,children:a.refreshBlockedReason==="missing_session_token"?t("settings.license.detail.manualActivation","Manual activation required to restore Pro access."):i.detail}),a.refreshBlockedReason==="missing_session_token"&&e.jsx("p",{className:`${s.licenseNotice} ${s.licenseNoticeMuted}`,children:i==null?void 0:i.detail})]})})(),a.tier==="basic"&&e.jsx("a",{className:s.upgradeLink,href:"https://gum.co/u/din5in7h",target:"_blank",rel:"noopener noreferrer",children:t("tier.upgrade")})]}):e.jsx("div",{className:s.loading,children:t("settings.license.unavailable")}),e.jsxs("div",{className:s.licenseControls,children:[e.jsxs("div",{className:s.licenseControlRow,children:[e.jsxs("label",{className:s.licenseField,children:[e.jsx("span",{className:s.controlLabel,children:e.jsx(c,{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:s.select,value:E,disabled:v||b,onChange:()=>{},children:e.jsx("option",{value:"gumroad",children:"gumroad"})})]}),e.jsx("button",{type:"button",className:s.actionBtn,disabled:v||b||!R,onClick:()=>{_()},children:b?t("common.loading"):t("settings.license.refresh","Refresh License")}),e.jsx("button",{type:"button",className:s.actionBtn,disabled:v||b||!R,onClick:()=>{k()},children:b?t("common.loading"):t("settings.license.reset","Reset License")})]}),e.jsxs("div",{className:s.licenseControlRow,children:[e.jsxs("label",{className:`${s.licenseField} ${s.licenseFieldGrow}`,children:[e.jsx("span",{className:s.controlLabel,children:e.jsx(c,{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:s.textInput,type:"text",value:f,disabled:v||b,onChange:i=>N(i.target.value)})]}),e.jsx("button",{type:"button",className:s.actionBtn,disabled:v||b,onClick:()=>{(async()=>await A(f)&&N(""))()},children:b?t("common.loading"):t("settings.license.activate","Activate License")})]}),y&&e.jsx("p",{className:s.licenseMessage,children:y})]})]})]}),e.jsxs("div",{className:s.card,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsx(c,{label:t("settings.general.title","General Settings"),tooltip:t("settings.general.title.tooltip","Hot settings that apply immediately when changed.")}),e.jsx(x,{text:t("settings.general.liveApply.tooltip","Changes in this section are applied immediately without a separate save button."),children:e.jsx("span",{className:`${s.headerBadge} ${s.headerBadgeLive}`,children:t("settings.general.liveApply","Live Apply")})})]}),u?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:s.settingRow,children:[e.jsx("span",{className:s.settingLabel,children:e.jsx(c,{label:t("settings.general.logLevel","Log Level"),tooltip:t("settings.general.logLevel.tooltip","Sets how much detail WROX Dashboard writes to its logs.")})}),e.jsxs("div",{className:s.settingControl,children:[e.jsx("select",{className:s.select,value:u.hot.LOG_LEVEL,onChange:i=>C("LOG_LEVEL",i.target.value),children:Oe.map(i=>e.jsx("option",{value:i,children:i},i))}),h==="LOG_LEVEL"&&e.jsx("span",{className:s.savedIndicator,children:t("settings.general.applied")})]})]}),e.jsxs("div",{className:s.settingRow,children:[e.jsx("span",{className:s.settingLabel,children:e.jsx(c,{label:t("settings.general.localHistory","Tool History Recording"),tooltip:t("settings.general.localHistory.tooltip","Stores local tool execution history for the WROX Dashboard history views.")})}),e.jsxs("div",{className:s.settingControl,children:[e.jsx("span",{className:`${s.savedIndicator} ${h==="ENABLE_LOCAL_HISTORY"?"":s.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(I,{checked:u.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:s.settingRow,children:[e.jsx("span",{className:s.settingLabel,children:e.jsx(c,{label:t("settings.general.localStatistics","Tool Statistics Collection"),tooltip:t("settings.general.localStatistics.tooltip","Aggregates local usage statistics for WROX Dashboard reporting.")})}),e.jsxs("div",{className:s.settingControl,children:[e.jsx("span",{className:`${s.savedIndicator} ${h==="ENABLE_LOCAL_STATISTICS"?"":s.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(I,{checked:u.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:s.settingRow,children:[e.jsx("span",{className:s.settingLabel,children:e.jsx(c,{label:t("settings.general.contextCapture","Context Capture"),tooltip:t("settings.general.contextCapture.tooltip","When enabled, WROX Dashboard records structured execution context for changelog and playtest views.")})}),e.jsxs("div",{className:s.settingControl,children:[e.jsx("span",{className:`${s.savedIndicator} ${h==="ENABLE_CONTEXT_CAPTURE"?"":s.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(I,{checked:u.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:s.settingRow,children:[e.jsx("span",{className:s.settingLabel,children:e.jsx(c,{label:t("settings.general.requestTimeout","Request Timeout"),tooltip:t("settings.general.requestTimeout.tooltip","Maximum time WROX Dashboard waits for a request before it fails.")})}),e.jsxs("div",{className:s.settingControl,children:[e.jsx("input",{type:"number",className:s.numberInput,value:u.hot.REQUEST_TIMEOUT,min:1e3,max:12e4,step:1e3,onChange:i=>{const n=parseInt(i.target.value,10);isNaN(n)||C("REQUEST_TIMEOUT",n)}}),e.jsx(x,{text:t("settings.general.requestTimeout.unit.tooltip","Request timeout is measured in milliseconds."),children:e.jsx("span",{className:s.unit,children:t("settings.general.requestTimeout.unit","ms")})}),h==="REQUEST_TIMEOUT"&&e.jsx("span",{className:s.savedIndicator,children:t("settings.general.applied","Applied")})]})]})]}):e.jsx("div",{className:s.loading,children:t("settings.unavailable")})]}),e.jsxs("div",{className:s.card,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsx(c,{label:t("settings.cold.title","Server Environment"),tooltip:t("settings.cold.title.tooltip","Read-only server environment values loaded at startup.")}),e.jsx(x,{text:t("settings.readOnly.tooltip","This section shows values that cannot be edited from WROX Dashboard."),children:e.jsx("span",{className:s.headerBadge,children:t("settings.readOnly","Read-only")})})]}),u?e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:s.coldGrid,children:[e.jsx("dt",{children:e.jsx(c,{label:"HTTP_PORT",tooltip:t("settings.cold.httpPort.tooltip","Port number used by the MCP WROX Dashboard HTTP server.")})}),e.jsx("dd",{children:u.cold.HTTP_PORT}),e.jsx("dt",{children:e.jsx(c,{label:"HTTP_HOST",tooltip:t("settings.cold.httpHost.tooltip","Host interface that the MCP WROX Dashboard HTTP server binds to.")})}),e.jsx("dd",{children:u.cold.HTTP_HOST}),e.jsx("dt",{children:e.jsx(c,{label:"DASHBOARD_AUTO_OPEN",tooltip:t("settings.cold.dashboardAutoOpen.tooltip","Controls whether WROX Dashboard opens automatically in the browser when the server starts.")})}),e.jsx("dd",{children:e.jsx(x,{text:t("settings.cold.dashboardAutoOpen.value.tooltip","Current startup behavior for opening WROX Dashboard in a browser."),children:String(u.cold.DASHBOARD_AUTO_OPEN)})})]}),e.jsx("p",{className:s.coldHint,children:t("settings.cold.hint","Set via environment variables to change these values.")})]}):e.jsx("div",{className:s.loading,children:t("settings.unavailable")})]}),e.jsxs("div",{className:s.card,children:[e.jsx("div",{className:s.cardHeader,children:e.jsx(c,{label:t("settings.language.title","Language"),tooltip:t("settings.language.title.tooltip","Choose how the WROX Dashboard interface text is localized.")})}),e.jsxs("div",{className:s.langRow,children:[e.jsx("label",{children:e.jsx(c,{label:t("settings.language.dashboard","WROX Dashboard Language"),tooltip:t("settings.language.dashboard.tooltip","Overrides the WROX Dashboard language or follows the system language when set to Auto.")})}),e.jsxs("select",{className:s.select,value:l,onChange:i=>L(i.target.value),children:[e.jsx("option",{value:$,children:t("settings.language.auto","Auto")}),G.map(i=>e.jsx("option",{value:i,children:Ie[i]??i},i))]})]})]})]})}export{He as Component};
@@ -0,0 +1 @@
1
+ ._page_vbvzx_2{display:flex;flex-direction:column;gap:16px;max-width:820px}._card_vbvzx_10{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._licenseCardPro_vbvzx_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_vbvzx_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}._headerBadge_vbvzx_42{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_vbvzx_53{color:var(--success);border-color:var(--success)}._licenseGrid_vbvzx_59{display:grid;grid-template-columns:auto 1fr;gap:6px 16px;font-family:var(--font-code);font-size:13px}._licenseGrid_vbvzx_59 dt{color:var(--text-muted)}._licenseGrid_vbvzx_59 dd{color:var(--text-primary);margin:0}._statusDot_vbvzx_77{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px;vertical-align:middle}._statusActive_vbvzx_86{background:var(--success);box-shadow:0 0 4px var(--success)}._statusGrace_vbvzx_91{background:var(--warning, #b7791f);box-shadow:0 0 4px color-mix(in srgb,var(--warning, #b7791f) 70%,transparent)}._statusInactive_vbvzx_96{background:var(--text-muted)}._statusError_vbvzx_100{background:var(--error)}._proBadge_vbvzx_105{color:var(--pro-badge);font-weight:500}._licenseCardPro_vbvzx_17 ._cardHeader_vbvzx_28 span:first-child{color:var(--pro-text)}._licenseCardPro_vbvzx_17 ._licenseGrid_vbvzx_59 dt{color:var(--pro-badge)}._upgradeLink_vbvzx_119{display:inline-block;margin-top:8px;font-family:var(--font-label);font-size:12px;color:var(--accent);cursor:pointer;text-decoration:underline}._upgradeLink_vbvzx_119:hover{opacity:.8}._licenseControls_vbvzx_133{display:flex;flex-direction:column;gap:10px;margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}._licenseControlRow_vbvzx_142{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}._licenseField_vbvzx_149{display:flex;flex-direction:column;gap:6px}._licenseFieldGrow_vbvzx_155{flex:1;min-width:220px}._controlLabel_vbvzx_160{font-family:var(--font-label);font-size:12px;color:var(--text-primary)}._textInput_vbvzx_166{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_vbvzx_166:focus{border-color:var(--accent)}._actionBtn_vbvzx_182{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_vbvzx_182:hover{background:var(--accent);color:var(--bg-primary)}._actionBtn_vbvzx_182:disabled{opacity:.5;cursor:not-allowed}._licenseMessage_vbvzx_204{margin:0;font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._licenseNotice_vbvzx_211{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_vbvzx_221{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_vbvzx_227{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_vbvzx_233{color:var(--text-secondary);background:var(--bg-secondary)}._settingRow_vbvzx_239{display:flex;align-items:center;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--border);font-size:13px}._settingRow_vbvzx_239:last-child{border-bottom:none}._settingLabel_vbvzx_253{font-family:var(--font-label);color:var(--text-primary);flex:1}._settingControl_vbvzx_260{display:flex;align-items:center;gap:8px;justify-content:flex-end;min-width:112px}._select_vbvzx_269{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_vbvzx_269:focus{border-color:var(--accent)}._numberInput_vbvzx_287{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_vbvzx_287:focus{border-color:var(--accent)}._toggleSwitch_vbvzx_305{position:relative;display:inline-flex;align-items:center;cursor:pointer}._toggleInput_vbvzx_312{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}._toggleTrack_vbvzx_320{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_vbvzx_342{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_vbvzx_312:focus-visible+._toggleTrack_vbvzx_320{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_vbvzx_312:checked+._toggleTrack_vbvzx_320{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_vbvzx_312:checked+._toggleTrack_vbvzx_320 ._toggleThumb_vbvzx_342{transform:translate(18px);background:radial-gradient(circle at 30% 30%,#ffffffeb,#ffffff1f 42%),linear-gradient(180deg,#fff,#d8e5ff)}._toggleSwitch_vbvzx_305:hover ._toggleTrack_vbvzx_320{border-color:color-mix(in srgb,var(--accent) 38%,var(--border))}._toggleSwitch_vbvzx_305:hover ._toggleInput_vbvzx_312:checked+._toggleTrack_vbvzx_320{box-shadow:inset 0 1px #ffffff29,0 0 20px color-mix(in srgb,var(--accent) 28%,transparent)}._savedIndicator_vbvzx_391{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_vbvzx_402{opacity:0}._coldGrid_vbvzx_407{display:grid;grid-template-columns:auto 1fr;gap:6px 16px;font-family:var(--font-code);font-size:13px}._coldGrid_vbvzx_407 dt{color:var(--text-muted)}._coldGrid_vbvzx_407 dd{color:var(--text-primary);margin:0}._coldHint_vbvzx_425{margin-top:10px;font-family:var(--font-label);font-size:12px;color:var(--text-muted);font-style:italic}._langRow_vbvzx_434{display:flex;align-items:center;gap:12px;font-size:13px}._langRow_vbvzx_434 label{font-family:var(--font-label);color:var(--text-primary)}._loading_vbvzx_447{color:var(--text-muted);font-family:var(--font-code);font-size:13px;padding:32px 0;text-align:center}._unit_vbvzx_456{font-family:var(--font-code);font-size:11px;color:var(--text-muted)}
@@ -1 +1 @@
1
- import{u as o,j as s}from"./index-BNdn6WpU.js";const e="_badge_1ucqq_2",c="_dot_1ucqq_12",a="_online_1ucqq_20",l="_offline_1ucqq_25",_="_idle_1ucqq_30",u="_syncing_1ucqq_34",d="_initializing_1ucqq_35",n={badge:e,dot:c,online:a,offline:l,idle:_,syncing:u,initializing:d},g={online:"status.online",offline:"status.offline",idle:"status.idle",syncing:"status.syncing",initializing:"status.initializing"};function f({status:i}){const{t}=o();return s.jsxs("span",{className:n.badge,children:[s.jsx("span",{className:`${n.dot} ${n[i]}`}),t(g[i])]})}export{f as S};
1
+ import{u as o,j as s}from"./index-DGGmfli1.js";const e="_badge_1ucqq_2",c="_dot_1ucqq_12",a="_online_1ucqq_20",l="_offline_1ucqq_25",_="_idle_1ucqq_30",u="_syncing_1ucqq_34",d="_initializing_1ucqq_35",n={badge:e,dot:c,online:a,offline:l,idle:_,syncing:u,initializing:d},g={online:"status.online",offline:"status.offline",idle:"status.idle",syncing:"status.syncing",initializing:"status.initializing"};function f({status:i}){const{t}=o();return s.jsxs("span",{className:n.badge,children:[s.jsx("span",{className:`${n.dot} ${n[i]}`}),t(g[i])]})}export{f as S};
@@ -0,0 +1 @@
1
+ ._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}
@@ -0,0 +1,4 @@
1
+ import{r as o,a as T,D as R,u as I,k as L,l as k,j as e,d as P,i as O,T as f,m as E}from"./index-DGGmfli1.js";import{I as w}from"./InfoLabel-CCDWZLC9.js";import{C as $}from"./ConfirmModal-BmRJ2JXZ.js";import{S as A}from"./StatusBadge-C8VKAPpk.js";import{D as B,a as D,u as H,T as M}from"./TierComparison-7ofkPwj3.js";import{t as l}from"./TierPromo.module-CAoUYgIx.js";const U=5e3;function F(){const[t,n]=o.useState(null),[_,u]=o.useState([]),[c,y]=o.useState(!0),h=o.useRef(null),g=o.useRef(null),r=o.useCallback(async()=>{try{const p=await T.get("/sync/status");n(p)}catch{}},[]),m=o.useCallback(async()=>{try{const p=await T.get("/sync/history",{limit:"30"});u(p.entries??[])}catch{u([])}},[]),d=o.useCallback(async()=>{await Promise.all([r(),m()]),y(!1)},[r,m]),b=o.useCallback(()=>{d()},[d]),a=o.useCallback(async()=>{await T.post("/api/dashboard/sync/history/clear"),u([]),r()},[r]);return o.useEffect(()=>(d(),g.current=setInterval(d,U),()=>{g.current&&clearInterval(g.current)}),[d]),o.useEffect(()=>{const p=new R;h.current=p,p.connect();const v=p.on("sync",()=>{r(),m()});return()=>{v(),p.disconnect(),h.current=null}},[r,m]),{status:t,history:_,loading:c,refresh:b,clearHistory:a}}function W({icon:t,title:n,description:_,benefits:u,upgradeLabel:c,upgradeHref:y}){const{t:h}=I(),[g,r]=o.useState(!1),{trackEvent:m}=L(),{pathname:d}=k(),b=d.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:n}),e.jsx("div",{className:l.panelDesc,children:_}),e.jsx("ul",{className:l.benefitList,children:u.map(a=>e.jsx("li",{className:l.benefitItem,children:a},a))}),e.jsx("div",{className:l.panelDiscountWrap,children:e.jsx(B,{variant:"centered"})}),e.jsxs("div",{className:l.actions,children:[e.jsx("button",{className:`${l.btn} ${l.btnOutline}`,onClick:()=>{m("dashboard_tier_toggle",{page:b}),r(!0)},children:h("tier.compare","Basic vs Pro")}),e.jsx("a",{className:`${l.btn} ${l.btnPrimary}`,href:y,target:"_blank",rel:"noreferrer",onClick:()=>m("dashboard_upgrade_click",{page:b}),children:c})]})]}),g&&e.jsx(D,{onClose:()=>r(!1)})]})}const q="_page_1warw_2",G="_card_1warw_10",z="_cardHeader_1warw_17",V="_clearButton_1warw_29",X="_statusRow_1warw_39",Y="_metaItem_1warw_46",J="_statusGrid_1warw_52",Q="_table_1warw_71",Z="_directionRail_1warw_99",K="_endpointLabel_1warw_105",ee="_optionRail_1warw_109",te="_directionOption_1warw_115",se="_directionOptionActive_1warw_129",ae="_directionOptionInactive_1warw_133",ne="_direction_forward_1warw_139",ie="_direction_bidirectional_1warw_143",oe="_direction_reverse_1warw_147",ce="_lockBadge_1warw_152",re="_proBadge_1warw_160",le="_forwardBadge_1warw_174",de="_logContainer_1warw_187",pe="_logEntry_1warw_194",ue="_logTime_1warw_206",ye="_logType_1warw_212",he="_logTypeWrite_1warw_221",me="_logTypeUpdate_1warw_225",ge="_logTypeDelete_1warw_229",we="_logTypeIdle_1warw_233",_e="_logPath_1warw_237",fe="_logEmpty_1warw_244",xe="_overlay_1warw_251",be="_overlayTitle_1warw_261",je="_overlayMessage_1warw_268",ve="_checklist_1warw_274",Te="_checkItem_1warw_284",Ne="_upgradePanel_1warw_300",Ce="_upgradePanelHeader_1warw_307",Ie="_benefitList_1warw_315",Se="_benefitItem_1warw_324",Re="_upgradeActions_1warw_339",Le="_btn_1warw_344",ke="_btnPrimary_1warw_361",Pe="_disabled_1warw_372",s={page:q,card:G,cardHeader:z,clearButton:V,statusRow:X,metaItem:Y,statusGrid:J,table:Q,directionRail:Z,endpointLabel:K,optionRail:ee,directionOption:te,directionOptionActive:se,directionOptionInactive:ae,direction_forward:ne,direction_bidirectional:ie,direction_reverse:oe,lockBadge:ce,proBadge:re,forwardBadge:le,logContainer:de,logEntry:pe,logTime:ue,logType:ye,logTypeWrite:he,logTypeUpdate:me,logTypeDelete:ge,logTypeIdle:we,logPath:_e,logEmpty:fe,overlay:xe,overlayTitle:be,overlayMessage:je,checklist:ve,checkItem:Te,upgradePanel:Ne,upgradePanelHeader:Ce,benefitList:Ie,benefitItem:Se,upgradeActions:Re,btn:Le,btnPrimary:ke,disabled:Pe},Oe=[{key:"forward",symbol:"←"},{key:"bidirectional",symbol:"↔"},{key:"reverse",symbol:"→"}];function Ee(t){const n=new Date(t);return`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}`}function $e(t){switch(t){case"write":return s.logTypeWrite;case"update":return s.logTypeUpdate;case"delete":return s.logTypeDelete;default:return s.logTypeIdle}}function Ae(t){switch(t){case"syncing":return"syncing";case"initializing":return"initializing";case"idle":return"idle";default:return"offline"}}function Be(t,n,_,u){const c=t(`sync.directions.cat.${n}`,n.charAt(0).toUpperCase()+n.slice(1)),y=t("sync.directions.endpoint.local","Local"),h=t("sync.directions.endpoint.studio","Studio");switch(_){case"forward":return[`${c}: ${y} <- ${h}`,t("sync.directions.tooltip.forward.body","Studio changes sync to local files only")].join(`
2
+ `);case"bidirectional":return[`${c}: ${y} <-> ${h}`,t("sync.directions.tooltip.bidirectional.body","Two-way sync between Local and Studio"),u?t("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
3
+ `);case"reverse":return[`${c}: ${y} -> ${h}`,t("sync.directions.tooltip.reverse.body","Push local file changes to Studio"),u?t("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
4
+ `);default:return c}}const De=["scripts","values","containers","data","services"];function He(t,n){return n==="manual"?t("sync.directions.mode.manual","Manual"):n==="auto"?t("sync.directions.mode.auto","Auto"):"-"}function Me(t,n){return n==="manual"?t("sync.directions.mode.manual.tooltip","Applies sync changes only when you trigger them manually."):n==="auto"?t("sync.directions.mode.auto.tooltip","Applies sync changes automatically when updates arrive."):""}function Ue(t,n){switch(n){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 Fe(t,n){switch(n){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 Ye(){const{t}=I(),{level:n}=P(),{tier:_,loading:u}=H(),c=F(),{show:y}=O(),[h,g]=o.useState(!1),[r,m]=o.useState(!1),d=!u&&_==="basic";if(n==="disconnected"||n==="serverOnly")return e.jsx("div",{className:s.page,children:e.jsx("div",{className:s.card,children:e.jsxs("div",{className:s.overlay,children:[e.jsx("div",{className:s.overlayTitle,children:t("sync.overlay.title","Roblox Studio plugin required")}),e.jsx("div",{className:s.overlayMessage,children:t("sync.overlay.message","Sync status will be available once the Roblox Studio plugin connects.")}),e.jsxs("ul",{className:s.checklist,children:[e.jsx("li",{className:s.checkItem,children:t("sync.overlay.check1","Is Roblox Studio running?")}),e.jsx("li",{className:s.checkItem,children:t("sync.overlay.check2","Is the WROX Plugin installed?")}),e.jsx("li",{className:s.checkItem,children:t("sync.overlay.check3","Are HTTP Requests enabled in Studio settings?")})]})]})})});const a=c.status,p=c.history,v=Ae(a==null?void 0:a.state),S=async()=>{m(!0);try{await c.clearHistory(),y(t("toast.clearSuccess","Cleared successfully"),"success"),g(!1)}catch{y(t("toast.clearFailed","Failed to clear data"),"error")}finally{m(!1)}};return e.jsxs("div",{className:s.page,children:[e.jsxs("div",{className:s.card,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsx(f,{text:t("sync.status.title.tooltip","Current Studio and local file sync status for this place."),children:t("sync.status.title","Sync Status")}),d&&e.jsx(f,{text:t("sync.status.forwardOnly.tooltip","Basic tier allows Studio to local forward sync only."),children:e.jsx("span",{className:s.forwardBadge,children:t("sync.status.forwardOnly","Forward Only")})})]}),e.jsxs("div",{className:s.statusRow,children:[e.jsx(A,{status:v}),(a==null?void 0:a.placeName)&&e.jsxs("span",{className:s.metaItem,children:[e.jsx(w,{label:t("sync.status.place","Place"),tooltip:t("sync.status.place.tooltip","Connected Roblox place name and place ID.")}),": ",a.placeName,a.placeId?` (${a.placeId})`:""]})]}),e.jsxs("dl",{className:s.statusGrid,children:[(a==null?void 0:a.syncRoot)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(w,{label:t("sync.status.path","Path"),tooltip:t("sync.status.path.tooltip","Local filesystem root currently used for sync output.")})}),e.jsx("dd",{children:a.syncRoot})]}),(a==null?void 0:a.instanceCount)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(w,{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:a.instanceCount})]}),(a==null?void 0:a.scriptCount)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(w,{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:a.scriptCount})]}),(a==null?void 0:a.state)==="syncing"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(w,{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")})]})]})]}),(a==null?void 0:a.directions)&&e.jsxs("div",{className:s.card,children:[e.jsx("div",{className:s.cardHeader,children:e.jsx(f,{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:s.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:e.jsx(w,{label:t("sync.directions.type","Type"),tooltip:t("sync.directions.type.tooltip","Sync category affected by this rule.")})}),e.jsx("th",{children:e.jsx(w,{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(w,{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:De.map(i=>{var C;const j=a.directions[i],N=(C=a.applyModes)==null?void 0:C[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:s.directionRail,"aria-label":`${i}-direction-rail`,children:[e.jsx(f,{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:s.endpointLabel,children:t("sync.directions.endpoint.local","Local")})}),e.jsx("span",{className:s.optionRail,children:Oe.map(x=>e.jsx(E,{text:Be(t,i,x.key,d),children:e.jsx("span",{className:`${s.directionOption} ${j===x.key?s.directionOptionActive:s.directionOptionInactive} ${s[`direction_${x.key}`]??""}`,"data-active":j===x.key?"true":"false",children:x.symbol})},x.key))}),e.jsx(f,{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:s.endpointLabel,children:t("sync.directions.endpoint.studio","Studio")})})]})}),e.jsx("td",{children:e.jsx(f,{text:Me(t,N),children:He(t,N)})})]},i)})})]})]}),e.jsxs("div",{className:s.card,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsx("span",{children:t("sync.log.title","Sync Log")}),e.jsx("button",{className:s.clearButton,onClick:()=>g(!0),children:t("common.clear","Clear")})]}),e.jsx("div",{className:s.logContainer,children:p.length===0?e.jsx("div",{className:s.logEmpty,children:t("sync.log.empty","No sync events yet")}):p.map((i,j)=>e.jsxs("div",{className:s.logEntry,children:[e.jsx("span",{className:s.logTime,children:Ee(i.timestamp)}),e.jsx(f,{text:Fe(t,i.type),children:e.jsx("span",{className:`${s.logType} ${$e(i.type)}`,children:Ue(t,i.type)})}),e.jsxs("span",{className:s.logPath,children:[i.path,i.details?` — ${i.details}`:""]})]},j))})]}),d&&e.jsx(W,{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:M.sync}),e.jsx($,{open:h,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:r,onCancel:()=>!r&&g(!1),onConfirm:S})]})}export{Ye as Component};
@@ -0,0 +1 @@
1
+ import{r as o,D as S,a as T,f as R,u as j,j as t}from"./index-DGGmfli1.js";function pe(){const[c,e]=o.useState("basic"),[m,n]=o.useState(0),[p,g]=o.useState(0),[a,i]=o.useState(0),[k,P]=o.useState(!0);o.useEffect(()=>{let _=!1;async function y(){try{return await R("gumroad")}catch{return null}}async function C(){var r,b;try{const[u,d]=await Promise.all([y(),T.get("/api/dashboard/tool-stats").catch(()=>null)]);if(_)return;if(u!=null&&u.tier&&e(u.tier),d!=null&&d.tierSummary){const f=((r=d.tierSummary.basic)==null?void 0:r.totalCalls)??0,x=((b=d.tierSummary.pro)==null?void 0:b.totalCalls)??0;i(f),g(x),n(f+x)}}catch{}finally{_||P(!1)}}C();const h=new S;h.connect();const N=h.on("license",()=>{y().then(r=>{!_&&(r!=null&&r.tier)&&e(r.tier)})});return()=>{_=!0,N(),h.disconnect()}},[]);const w=m>0?p/m*100:0;return{tier:c,proUsagePercent:w,totalCalls:m,proCalls:p,basicCalls:a,loading:k}}const O=[{name:"query_instances",description:"Query Roblox instances: get, children, find child/descendant, wait for child, class info, search by name/class. [PRO] file_tree, project_structure, descendants, ancestors, search by property/tag.",basic:["get","children","find_child","find_descendant","wait_for_child","class_info","search_name","search_class"],pro:["search_property","search_tag","file_tree","project_structure","descendants","ancestors"]},{name:"mutate_instances",description:"Create, delete, clone, move, rename, or pivot instances. [PRO] create_tree, mass_create, mass_delete, mass_duplicate, smart_duplicate.",basic:["create","create_with_props","delete","clone","move","rename","pivot"],pro:["create_tree","mass_create","mass_delete","mass_duplicate","smart_duplicate"]},{name:"manage_properties",description:"Get/set properties, attributes, and tags on instances. [PRO] set_calculated, set_relative, mass_set, mass_get, modify_children.",basic:["get","set","get_all","set_multiple","get_attr","set_attr","get_all_attrs","delete_attr","add_tag","remove_tag","check_tag","get_tags","get_tagged"],pro:["set_calculated","set_relative","mass_set","mass_get","modify_children"]},{name:"manage_scripts",description:"Manage script source code: read, write, create, delete, edit lines, search. [PRO] replace across scripts.",basic:["get_source","set_source","create","delete","edit_replace","edit_insert","edit_delete","search","get_dependencies"],pro:["replace"]},{name:"manage_lighting",description:"[PRO] Configure environment: lighting, atmosphere, sky, terrain properties, time of day.",basic:[],pro:["lighting","atmosphere","sky","terrain_props","time"]},{name:"manage_selection",description:"Get, set, or clear selection. [PRO] context, details, add/remove items, watch changes.",basic:["get","set","clear","cached"],pro:["context","details","add","remove","watch"]},{name:"manage_camera",description:"Camera operations: get info, focus on instance by path or position, get suggested view.",basic:["info","focus_path","focus_position","suggest"],pro:[]},{name:"manage_tween",description:"[PRO] Tween service: create, play, pause, cancel tweens for smooth animations.",basic:[],pro:["create","play","pause","cancel"]},{name:"manage_audio",description:"[PRO] Audio management: play, stop, pause, resume sounds. Set audio listener.",basic:[],pro:["play","stop","pause","resume","set_listener"]},{name:"manage_animation",description:"[PRO] Animation: load, play, stop animations. Get animation tracks from humanoid/controller.",basic:[],pro:["load","play","stop","get_tracks"]},{name:"manage_physics",description:"[PRO] Physics collision groups: register, set collidable between groups, list groups.",basic:[],pro:["register_group","set_collidable","get_groups"]},{name:"manage_effects",description:"[PRO] Particle effects: emit particles, clear all particles, toggle effect enabled state.",basic:[],pro:["emit","clear","toggle"]},{name:"manage_terrain",description:"[PRO] Terrain operations: fill shapes, clear regions, replace materials, manage colors, read/write voxels, generate procedural terrain, smooth terrain.",basic:[],pro:["fill_block","fill_ball","fill_cylinder","fill_wedge","clear_region","clear_bounds","replace_material","colors_get","colors_set","read_voxel","read_voxels","write_voxels","generate","smooth"]},{name:"spatial_query",description:"[PRO] Spatial queries: raycast, find ground, check placement, multi-raycast, scan area, find flat areas, find spawn positions, analyze walkable, spatial map, find empty space, get bounds, snap to grid, check collision.",basic:[],pro:["raycast","find_ground","check_placement","multi_raycast","scan_area","find_flat","find_spawn","analyze_walkable","spatial_map","find_space","bounds","snap_grid","collision"]},{name:"manage_assets",description:"[PRO] Asset management: insert models by ID, get asset info, search creator store, insert free models/packages, export selection.",basic:[],pro:["insert","info","search","search_insert","insert_free","insert_package","export"]},{name:"manage_sync",description:"[PRO] Project sync management: status, history, direction settings, read/write synced files.",basic:[],pro:["status","history","directions","read_file","write_file","progress"]},{name:"workspace_state",description:"[PRO] Workspace state: full sync, snapshot, recent changes, viewport info, clear history, metadata, scripts, selection info, clear cache.",basic:[],pro:["sync","snapshot","changes","viewport","clear_history","metadata","scripts","selection_info","clear_cache"]},{name:"manage_logs",description:"Output logs: get filtered logs, poll incrementally with sinceSeq cursor, clear buffer, get recent errors.",basic:["get","clear","errors"],pro:[]},{name:"system_info",description:"System info: ping, connection status, usage tier. [PRO] place info, services list, studio settings, playtest control, automated test runner.",basic:["ping","connection","usage"],pro:["place_info","services","studio_settings","play","stop","pause","resume","play_status","run_test"]},{name:"batch_execute",description:'[PRO] Execute multiple commands in a single batch. Each command is an object with "tool" name and "args". Commands execute sequentially; optionally continue on error.',basic:[],pro:["batch_execute"]},{name:"execute_luau",description:"[PRO] Execute arbitrary Luau code in Roblox Studio sandbox. Blocked services: HttpService, DataStoreService, MessagingService. Cannot access CoreGui/CorePackages.",basic:[],pro:["execute_luau"]}],B={proOnlyTools:13,mixedTools:6,totalBasicActions:51,totalProActions:106},L={tools:O,summary:B},A=new Date("2026-04-30T23:59:59");function v(){return Date.now()<=A.getTime()}const _e={overview:"https://gum.co/u/2nc0fhky",changelog:"https://gum.co/u/wjcnucpy",sync:"https://gum.co/u/p0barnlb",playtest:"https://gum.co/u/kchczjry",tools:"https://gum.co/u/ljmteaed"},D="_tag_1wj0q_2",E="_label_1wj0q_17",q="_code_1wj0q_22",G="_expiry_1wj0q_31",M="_inline_1wj0q_49",$="_centered_1wj0q_54",l={tag:D,label:E,code:q,expiry:G,inline:M,centered:$};function W({variant:c}){const{t:e}=j();return v()?t.jsxs("div",{className:`${l.tag} ${c==="centered"?l.centered:l.inline}`,children:[t.jsx("span",{className:l.label,children:e("tier.promo.discount.context","🎁 Gumroad 결제 시 할인코드 입력:")}),t.jsx("span",{className:l.code,children:e("tier.comparison.discount.code","WEPPY-MCP")}),t.jsx("span",{className:l.expiry,children:e("tier.comparison.discount.expiry","Valid until April 30")})]}):null}const H="_overlay_171mk_2",I="_modal_171mk_13",U="_summaryGrid_171mk_32",z="_summaryCard_171mk_39",Y="_basicCard_171mk_45",F="_proCard_171mk_49",Q="_cardTitle_171mk_54",V="_summarySection_171mk_70",X="_sectionTitle_171mk_78",J="_featureList_171mk_90",K="_summary_171mk_32",Z="_statBasic_171mk_116",ee="_statPro_171mk_120",te="_statMixed_171mk_124",se="_detailHeader_171mk_128",ae="_tableWrap_171mk_137",ie="_table_171mk_137",re="_toolName_171mk_165",ce="_description_171mk_171",ne="_actionList_171mk_176",oe="_none_171mk_184",le="_discountBanner_171mk_189",me="_closeBtn_171mk_227",s={overlay:H,modal:I,summaryGrid:U,summaryCard:z,basicCard:Y,proCard:F,cardTitle:Q,summarySection:V,sectionTitle:X,featureList:J,summary:K,statBasic:Z,statPro:ee,statMixed:te,detailHeader:se,tableWrap:ae,table:ie,toolName:re,description:ce,actionList:ne,none:oe,discountBanner:le,closeBtn:me};function ue({onClose:c}){const{t:e}=j(),{tools:m,summary:n}=L,p=[{title:e("tier.comparison.basic.core","Core MCP workflow"),items:[e("tier.comparison.basic.core.item1","Script create/edit"),e("tier.comparison.basic.core.item2","Instance management"),e("tier.comparison.basic.core.item3","Property control"),e("tier.comparison.basic.core.item4","Selection and search"),e("tier.comparison.basic.core.item5","Tag management"),e("tier.comparison.basic.core.item6","Camera control"),e("tier.comparison.basic.core.item7","Log monitoring")]},{title:e("tier.comparison.basic.sync","Sync (Basic)"),items:[e("tier.comparison.basic.sync.item1","Studio to Local one-way sync"),e("tier.comparison.basic.sync.item2","Manual apply as default")]}],g=[{title:e("tier.comparison.pro.all","Everything in Basic, plus"),items:[]},{title:e("tier.comparison.pro.sync","Advanced Sync workflow"),items:[e("tier.comparison.pro.sync.item1","Per-type sync direction"),e("tier.comparison.pro.sync.item2","Per-type apply mode"),e("tier.comparison.pro.sync.item3","Bidirectional and reverse sync"),e("tier.comparison.pro.sync.item4","Full sync, resync, and push to Studio"),e("tier.comparison.pro.sync.item5","Multi-place sync")]},{title:e("tier.comparison.pro.playtest","Playtest control"),items:[e("tier.comparison.pro.playtest.item1","Play, stop, pause, and resume"),e("tier.comparison.pro.playtest.item2","Playtest state inspection"),e("tier.comparison.pro.playtest.item3","Automated test execution")]},{title:e("tier.comparison.pro.creation","Advanced creation workflow"),items:[e("tier.comparison.pro.creation.item1","Bulk operations"),e("tier.comparison.pro.creation.item2","Terrain generation"),e("tier.comparison.pro.creation.item3","Asset search and insert"),e("tier.comparison.pro.creation.item4","Raycast and spatial analysis"),e("tier.comparison.pro.creation.item5","Environment control")]}];return t.jsx("div",{className:s.overlay,onClick:c,children:t.jsxs("div",{className:s.modal,onClick:a=>a.stopPropagation(),children:[v()&&t.jsx("div",{className:s.discountBanner,children:t.jsx(W,{variant:"centered"})}),t.jsx("h2",{children:e("tier.compare")}),t.jsxs("div",{className:s.summaryGrid,children:[t.jsxs("section",{className:`${s.summaryCard} ${s.basicCard}`,children:[t.jsx("h3",{className:s.cardTitle,children:e("tier.basic")}),p.map(a=>t.jsxs("div",{className:s.summarySection,children:[t.jsx("div",{className:s.sectionTitle,children:a.title}),t.jsx("ul",{className:s.featureList,children:a.items.map(i=>t.jsx("li",{children:i},i))})]},a.title))]}),t.jsxs("section",{className:`${s.summaryCard} ${s.proCard}`,children:[t.jsx("h3",{className:s.cardTitle,children:e("tier.pro")}),g.map(a=>t.jsxs("div",{className:s.summarySection,children:[t.jsx("div",{className:s.sectionTitle,children:a.title}),a.items.length>0&&t.jsx("ul",{className:s.featureList,children:a.items.map(i=>t.jsx("li",{children:i},i))})]},a.title))]})]}),t.jsxs("div",{className:s.summary,children:[t.jsxs("span",{className:s.statBasic,children:["Basic: ",n.totalBasicActions," actions"]}),t.jsxs("span",{className:s.statPro,children:["Pro: ",n.totalProActions," actions"]}),t.jsxs("span",{className:s.statMixed,children:[n.mixedTools," mixed / ",n.proOnlyTools," pro-only"]})]}),t.jsx("div",{className:s.detailHeader,children:e("tier.comparison.detailTitle","Detailed Tool Catalog")}),t.jsx("div",{className:s.tableWrap,children:t.jsxs("table",{className:s.table,children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:e("tools.col.tool")}),t.jsx("th",{children:e("tier.comparison.description","Description")}),t.jsx("th",{children:e("tier.basic")}),t.jsx("th",{children:e("tier.pro")})]})}),t.jsx("tbody",{children:m.map(a=>t.jsxs("tr",{children:[t.jsx("td",{className:s.toolName,children:a.name}),t.jsx("td",{className:s.description,children:e(`tier.tool.${a.name}.desc`,a.description)}),t.jsx("td",{className:s.actionList,children:a.basic.length>0?a.basic.join(", "):t.jsx("span",{className:s.none,children:"—"})}),t.jsx("td",{className:s.actionList,children:a.pro.length>0?a.pro.join(", "):t.jsx("span",{className:s.none,children:"—"})})]},a.name))})]})}),t.jsx("button",{className:s.closeBtn,onClick:c,children:e("tier.comparison.close","Close")})]})})}export{W as D,_e as T,ue as a,pe as u};
@@ -1 +1 @@
1
- import{u as h,r as x,k as j,l as g,j as s}from"./index-BNdn6WpU.js";import{D as v,a as u}from"./TierComparison-D4uVUGcZ.js";import{t as e}from"./TierPromo.module-CAoUYgIx.js";function f({basicCalls:n,proCalls:a,totalCalls:c,proUsagePercent:l,upgradeHref:d}){const{t:r}=h(),[p,o]=x.useState(!1),{trackEvent:i}=j(),{pathname:m}=g(),t=m.replace(/^\//,"").split("/")[0]||"overview";return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:e.progressPromoWrap,children:[s.jsxs("div",{className:e.progressPromo,children:[s.jsxs("div",{className:e.progressMain,children:[s.jsxs("div",{className:e.progressLabel,children:[s.jsx("span",{children:r("tier.progress.label","Pro / Total")}),s.jsxs("span",{children:[a," / ",c]})]}),s.jsx("div",{className:e.progressBar,children:s.jsx("div",{className:e.progressFill,style:{width:`${Math.min(l,100)}%`}})}),s.jsxs("div",{className:e.progressLabel,children:[s.jsxs("span",{children:[r("tier.basic")," ",n]}),s.jsxs("span",{children:[r("tier.pro")," ",a]})]})]}),s.jsx("span",{className:e.progressText,children:r("tier.banner.save","Save AI tokens with Pro!")}),s.jsxs("div",{className:e.actions,children:[s.jsx("button",{className:`${e.btn} ${e.btnOutline}`,onClick:()=>{i("dashboard_tier_toggle",{page:t}),o(!0)},children:r("tier.compare","Basic vs Pro")}),s.jsx("a",{className:`${e.btn} ${e.btnPrimary}`,href:d,target:"_blank",rel:"noreferrer",onClick:()=>i("dashboard_upgrade_click",{page:t}),children:r("tier.upgrade","Upgrade to Pro")})]})]}),s.jsx(v,{variant:"centered"})]}),p&&s.jsx(u,{onClose:()=>o(!1)})]})}export{f as T};
1
+ import{u as h,r as x,k as j,l as g,j as s}from"./index-DGGmfli1.js";import{D as v,a as u}from"./TierComparison-7ofkPwj3.js";import{t as e}from"./TierPromo.module-CAoUYgIx.js";function f({basicCalls:n,proCalls:a,totalCalls:c,proUsagePercent:l,upgradeHref:d}){const{t:r}=h(),[p,o]=x.useState(!1),{trackEvent:i}=j(),{pathname:m}=g(),t=m.replace(/^\//,"").split("/")[0]||"overview";return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:e.progressPromoWrap,children:[s.jsxs("div",{className:e.progressPromo,children:[s.jsxs("div",{className:e.progressMain,children:[s.jsxs("div",{className:e.progressLabel,children:[s.jsx("span",{children:r("tier.progress.label","Pro / Total")}),s.jsxs("span",{children:[a," / ",c]})]}),s.jsx("div",{className:e.progressBar,children:s.jsx("div",{className:e.progressFill,style:{width:`${Math.min(l,100)}%`}})}),s.jsxs("div",{className:e.progressLabel,children:[s.jsxs("span",{children:[r("tier.basic")," ",n]}),s.jsxs("span",{children:[r("tier.pro")," ",a]})]})]}),s.jsx("span",{className:e.progressText,children:r("tier.banner.save","Save AI tokens with Pro!")}),s.jsxs("div",{className:e.actions,children:[s.jsx("button",{className:`${e.btn} ${e.btnOutline}`,onClick:()=>{i("dashboard_tier_toggle",{page:t}),o(!0)},children:r("tier.compare","Basic vs Pro")}),s.jsx("a",{className:`${e.btn} ${e.btnPrimary}`,href:d,target:"_blank",rel:"noreferrer",onClick:()=>i("dashboard_upgrade_click",{page:t}),children:r("tier.upgrade","Upgrade to Pro")})]})]}),s.jsx(v,{variant:"centered"})]}),p&&s.jsx(u,{onClose:()=>o(!1)})]})}export{f as T};
@@ -1 +1 @@
1
- import{j as s,r as l,a as R,D as Z,u as q,i as z,T as w}from"./index-BNdn6WpU.js";import{C as Q}from"./ConfirmModal-CInBBLZW.js";import{u as X,T as Y}from"./TierComparison-D4uVUGcZ.js";import{T as tt}from"./TierPromoProgress-Cuz1dgcs.js";import"./TierPromo.module-CAoUYgIx.js";const st="_wrapper_1s3lp_2",et="_table_1s3lp_7",at="_sortable_1s3lp_32",ot="_sortArrow_1s3lp_41",rt="_clickable_1s3lp_52",lt="_empty_1s3lp_57",M={wrapper:st,table:et,sortable:at,sortArrow:ot,clickable:rt,empty:lt};function it({columns:e,data:o,sortBy:T,sortDir:f="asc",onSort:g,onRowClick:S,rowKey:C,emptyMessage:v}){return s.jsx("div",{className:M.wrapper,children:s.jsxs("table",{className:M.table,children:[s.jsx("thead",{children:s.jsx("tr",{children:e.map(n=>s.jsxs("th",{style:n.width?{width:n.width}:void 0,className:n.sortable?M.sortable:void 0,onClick:n.sortable&&g?()=>g(n.key):void 0,children:[s.jsx("span",{children:n.label}),n.sortable&&T===n.key&&s.jsx("span",{className:M.sortArrow,children:f==="asc"?"▴":"▾"})]},n.key))})}),s.jsx("tbody",{children:o.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:e.length,className:M.empty,children:v||"No data"})}):o.map((n,k)=>s.jsx("tr",{className:S?M.clickable:void 0,onClick:S?()=>S(n):void 0,children:e.map(p=>s.jsx("td",{children:p.render?p.render(n):String(n[p.key]??"")},p.key))},C?C(n):k))})]})})}const V=50;function nt(){const[e,o]=l.useState(null),[T,f]=l.useState(!0),[g,S]=l.useState([]),[C,v]=l.useState(0),[n,k]=l.useState(!1),[p,N]=l.useState(!0),[x,H]=l.useState(0),[u,D]=l.useState(""),[B,E]=l.useState([]),[U,A]=l.useState(0),[O,d]=l.useState(!1),[$,F]=l.useState(!0),[b,j]=l.useState(0),L=l.useRef(null),y=l.useCallback(async()=>{f(!0);try{const m=await R.get("/api/dashboard/tool-stats");o(m)}catch{}finally{f(!1)}},[]),t=l.useCallback(async(m,_)=>{N(!0);try{const K={limit:String(V),offset:String(m)};_&&(K.tool=_);const W=await R.get("/api/dashboard/history",K);S(W.entries),v(W.total),k(W.hasMore)}catch{S([]),v(0),k(!1)}finally{N(!1)}},[]),r=l.useCallback(async m=>{F(!0);try{const _=await R.get("/api/dashboard/failures",{limit:String(V),offset:String(m)});E(_.entries),A(_.total),d(_.hasMore)}catch{E([]),A(0),d(!1)}finally{F(!1)}},[]),i=l.useCallback(()=>{y(),t(x,u),r(b)},[y,t,r,x,u,b]),h=l.useCallback(async()=>{await R.post("/api/dashboard/tools/history/clear"),t(x,u),r(b)},[t,r,x,u,b]),c=l.useCallback(async()=>{await R.post("/api/dashboard/tools/statistics/clear"),y()},[y]);return l.useEffect(()=>{y()},[y]),l.useEffect(()=>{t(x,u)},[t,x,u]),l.useEffect(()=>{r(b)},[r,b]),l.useEffect(()=>{const m=new Z;L.current=m,m.connect();const _=m.on("command",()=>{y(),t(x,u),r(b)});return()=>{_(),m.disconnect(),L.current=null}},[y,t,r,x,u,b]),{statistics:e,statsLoading:T,history:g,historyTotal:C,historyHasMore:n,historyLoading:p,historyOffset:x,historyToolFilter:u,setHistoryOffset:H,setHistoryToolFilter:D,failures:B,failuresTotal:U,failuresHasMore:O,failuresLoading:$,failuresOffset:b,setFailuresOffset:j,refresh:i,clearHistory:h,clearStatistics:c}}const ct="_page_184r6_2",dt="_tabs_184r6_10",ut="_tab_184r6_10",pt="_tabActive_184r6_34",ht="_card_184r6_40",mt="_cardToolbar_184r6_47",xt="_sectionTitle_184r6_55",bt="_dangerButton_184r6_61",ft="_proBadge_184r6_71",_t="_statusOk_184r6_85",yt="_tierBasic_184r6_91",jt="_tierPro_184r6_95",gt="_tierMixed_184r6_100",St="_filterRow_184r6_111",Tt="_filterLabel_184r6_118",Ct="_filterSelect_184r6_127",Nt="_expandedRow_184r6_138",wt="_expandedSection_184r6_146",vt="_pre_184r6_156",kt="_pagination_184r6_173",Bt="_pageInfo_184r6_181",Mt="_btn_184r6_187",Pt="_tierDistribution_184r6_210",Et="_tierBarWrap_184r6_214",Lt="_tierBarBasic_184r6_222",Rt="_tierBarPro_184r6_227",Ht="_tierLabels_184r6_232",At="_statsTableWrap_184r6_241",Ot="_statsTable_184r6_241",$t="_sortableHeader_184r6_272",Ft="_sortArrow_184r6_277",It="_statsToolRow_184r6_281",Dt="_statsActionRow_184r6_289",Ut="_expandButton_184r6_293",Wt="_expandIcon_184r6_305",Gt="_actionLabel_184r6_310",Jt="_emptyStats_184r6_317",Kt="_summaryLine_184r6_323",a={page:ct,tabs:dt,tab:ut,tabActive:pt,card:ht,cardToolbar:mt,sectionTitle:xt,dangerButton:bt,proBadge:ft,statusOk:_t,tierBasic:yt,tierPro:jt,tierMixed:gt,filterRow:St,filterLabel:Tt,filterSelect:Ct,expandedRow:Nt,expandedSection:wt,pre:vt,pagination:kt,pageInfo:Bt,btn:Mt,tierDistribution:Pt,tierBarWrap:Et,tierBarBasic:Lt,tierBarPro:Rt,tierLabels:Ht,statsTableWrap:At,statsTable:Ot,sortableHeader:$t,sortArrow:Ft,statsToolRow:It,statsActionRow:Dt,expandButton:Ut,expandIcon:Wt,actionLabel:Gt,emptyStats:Jt,summaryLine:Kt},G=50;function Vt(e){const o=new Date(e);return`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}:${String(o.getSeconds()).padStart(2,"0")}`}function I(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function J(e,o){return o===0?"-":`${Math.round(e/o*100)}%`}function P(e,o){return o==="pro"?e("tier.pro","Pro"):o==="mixed"?e("tier.mixed","Mixed"):e("tier.basic","Basic")}function Yt(){const{t:e}=q(),o=nt(),{show:T}=z(),f=X(),[g,S]=l.useState("history"),[C,v]=l.useState(null),[n,k]=l.useState(null),[p,N]=l.useState(null),[x,H]=l.useState(!1),[u,D]=l.useState("totalCalls"),[B,E]=l.useState("desc"),U=l.useCallback(t=>{D(r=>r===t?(E(i=>i==="asc"?"desc":"asc"),t):(E("desc"),t))},[]),A=l.useMemo(()=>{var t;return(t=o.statistics)!=null&&t.tools?Object.keys(o.statistics.tools).sort():[]},[o.statistics]),O=l.useMemo(()=>{var t;return(t=o.statistics)!=null&&t.tools?Object.values(o.statistics.tools).map(r=>{const i=Object.entries(r.actions??{}).map(([h,c])=>({toolName:r.toolName,actionName:c.action??h,tier:c.tier,totalCalls:c.totalCalls,successCount:c.successCount,failureCount:c.failureCount,totalExecutionTimeMs:c.totalExecutionTimeMs,avgExecutionTimeMs:c.avgExecutionTimeMs,firstUsed:c.firstUsed,lastUsed:c.lastUsed}));return{toolName:r.toolName,tier:r.tier,actions:i,totalCalls:r.totalCalls,successCount:r.successCount,failureCount:r.failureCount,totalExecutionTimeMs:r.totalExecutionTimeMs,avgExecutionTimeMs:r.avgExecutionTimeMs,firstUsed:r.firstUsed,lastUsed:r.lastUsed}}):[]},[o.statistics]),d=l.useCallback((t,r,i,h)=>s.jsx(w,{text:e(i,h),children:e(t,r)}),[e]),$=l.useMemo(()=>[...O].sort((r,i)=>{const h=r[u],c=i[u];if(typeof h=="number"&&typeof c=="number")return B==="asc"?h-c:c-h;const m=String(h??""),_=String(c??"");return B==="asc"?m.localeCompare(_):_.localeCompare(m)}),[O,u,B]),F=l.useMemo(()=>[{key:"timestamp",label:d("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:t=>Vt(t.timestamp)},{key:"toolName",label:d("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:t=>{var i;const r=((i=t.parameters)==null?void 0:i.action)??"";return s.jsxs("span",{children:[t.toolName,r?`.${r}`:"",t.tier==="pro"&&s.jsx(w,{text:e("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:s.jsx("span",{className:a.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=>I(t.executionTimeMs)},{key:"status",label:d("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"60px",render:()=>s.jsx(w,{text:e("tools.status.ok.tooltip","The tool run completed successfully."),children:s.jsx("span",{className:a.statusOk,children:e("tools.status.ok","OK")})})},{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"?a.tierPro:a.tierBasic,children:P(e,t.tier)})}],[e,d]),b=l.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:"successRate",label:d("tools.col.okRate","OK%","tools.col.okRate.tooltip","Percentage of calls that finished successfully."),sortable:!1,width:"60px",render:t=>J(t.successCount,t.totalCalls)},{key:"avgExecutionTimeMs",label:d("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"80px",render:t=>I(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:"60px",render:t=>s.jsx(w,{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"?a.tierPro:t.tier==="mixed"?a.tierMixed:a.tierBasic,children:P(e,t.tier)})})}],[e,d]),j=l.useMemo(()=>{if(!o.statistics)return null;const t=o.statistics.tierSummary.basic.totalCalls,r=o.statistics.tierSummary.pro.totalCalls,i=t+r;if(i===0)return null;const h=Math.round(t/i*100),c=100-h;return{basic:t,pro:r,total:i,basicPct:h,proPct:c}},[o.statistics]),L=l.useCallback(t=>{k(r=>r===t?null:t)},[]),y=l.useCallback(async()=>{if(p){H(!0);try{p==="history"?await o.clearHistory():await o.clearStatistics(),T(e("toast.clearSuccess","Cleared successfully"),"success"),N(null)}catch{T(e("toast.clearFailed","Failed to clear data"),"error")}finally{H(!1)}}},[p,T,e,o]);return s.jsxs("div",{className:a.page,children:[s.jsx("div",{className:a.tabs,children:["history","statistics"].map(t=>s.jsx("button",{className:`${a.tab} ${g===t?a.tabActive:""}`,onClick:()=>S(t),children:e(`tools.tab.${t}`,t.charAt(0).toUpperCase()+t.slice(1))},t))}),g==="history"&&s.jsxs("div",{className:a.card,children:[s.jsxs("div",{className:a.cardToolbar,children:[s.jsx("div",{className:a.sectionTitle,children:e("tools.tab.history","History")}),s.jsx("button",{className:a.dangerButton,onClick:()=>N("history"),children:e("common.clear","Clear")})]}),s.jsx("div",{className:a.filterRow,children:s.jsxs("label",{className:a.filterLabel,children:[e("tools.filter.tool","Tool"),":",s.jsxs("select",{className:a.filterSelect,value:o.historyToolFilter,onChange:t=>{o.setHistoryToolFilter(t.target.value),o.setHistoryOffset(0)},children:[s.jsx("option",{value:"",children:e("tools.filter.all","All")}),A.map(t=>s.jsx("option",{value:t,children:t},t))]})]})}),s.jsx(it,{columns:F,data:o.history,rowKey:t=>t.id,onRowClick:t=>v(r=>r===t.id?null:t.id),emptyMessage:e("tools.empty.history","No history entries")}),C&&(()=>{const t=o.history.find(r=>r.id===C);return t?s.jsxs("div",{className:a.expandedRow,children:[s.jsxs("div",{className:a.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(w,{text:e("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:e("tools.detail.params","Parameters")}),":"]}),s.jsx("pre",{className:a.pre,children:JSON.stringify(t.parameters,null,2)})]}),t.result&&s.jsxs("div",{className:a.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(w,{text:e("tools.detail.result.tooltip","Returned result payload for this tool run."),children:e("tools.detail.result","Result")}),":"]}),s.jsx("pre",{className:a.pre,children:JSON.stringify(t.result,null,2)})]})]}):null})(),s.jsxs("div",{className:a.pagination,children:[s.jsx("button",{className:a.btn,disabled:o.historyOffset===0,title:e("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>o.setHistoryOffset(Math.max(0,o.historyOffset-G)),children:e("tools.page.prev","Prev")}),s.jsxs("span",{className:a.pageInfo,children:[o.historyOffset+1,"–",Math.min(o.historyOffset+G,o.historyTotal)," / ",o.historyTotal]}),s.jsx("button",{className:a.btn,disabled:!o.historyHasMore,title:e("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>o.setHistoryOffset(o.historyOffset+G),children:e("tools.page.next","Next")})]})]}),g==="statistics"&&s.jsxs("div",{className:a.card,children:[s.jsxs("div",{className:a.cardToolbar,children:[s.jsx("div",{className:a.sectionTitle,children:e("tools.tab.statistics","Statistics")}),s.jsx("button",{className:a.dangerButton,onClick:()=>N("statistics"),children:e("common.clear","Clear")})]}),j&&s.jsxs("div",{className:a.tierDistribution,children:[s.jsxs("div",{className:a.tierBarWrap,children:[s.jsx("div",{className:a.tierBarBasic,style:{width:`${j.basicPct}%`}}),s.jsx("div",{className:a.tierBarPro,style:{width:`${j.proPct}%`}})]}),s.jsxs("div",{className:a.tierLabels,children:[s.jsxs("span",{children:[P(e,"basic")," ",j.basicPct,"% (",j.basic,")"]}),s.jsxs("span",{children:[P(e,"pro")," ",j.proPct,"% (",j.pro,")"]})]})]}),s.jsx("div",{className:a.statsTableWrap,children:s.jsxs("table",{className:a.statsTable,children:[s.jsx("thead",{children:s.jsx("tr",{children:b.map(t=>s.jsxs("th",{style:t.width?{width:t.width}:void 0,className:t.sortable?a.sortableHeader:void 0,onClick:t.sortable?()=>U(t.key):void 0,children:[s.jsx("span",{children:t.label}),t.sortable&&u===t.key&&s.jsx("span",{className:a.sortArrow,children:B==="asc"?"▴":"▾"})]},t.key))})}),s.jsx("tbody",{children:$.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:b.length,className:a.emptyStats,children:e("tools.empty.stats","No tool statistics")})}):$.map(t=>{const r=n===t.toolName;return s.jsxs(l.Fragment,{children:[s.jsxs("tr",{className:a.statsToolRow,onClick:()=>L(t.toolName),children:[s.jsx("td",{children:s.jsxs("button",{type:"button",className:a.expandButton,"aria-expanded":r,"aria-label":`${t.toolName} ${r?e("common.collapse","Collapse"):e("common.expand","Expand")}`,onClick:i=>{i.stopPropagation(),L(t.toolName)},children:[s.jsx("span",{className:a.expandIcon,"aria-hidden":"true",children:r?"▾":"▸"}),s.jsx("span",{children:t.toolName})]})}),s.jsx("td",{children:t.totalCalls}),s.jsx("td",{children:J(t.successCount,t.totalCalls)}),s.jsx("td",{children:I(t.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx(w,{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"?a.tierPro:t.tier==="mixed"?a.tierMixed:a.tierBasic,children:P(e,t.tier)})})})]}),r&&t.actions.map(i=>s.jsxs("tr",{className:a.statsActionRow,children:[s.jsx("td",{children:s.jsx("span",{className:a.actionLabel,children:i.actionName})}),s.jsx("td",{children:i.totalCalls}),s.jsx("td",{children:J(i.successCount,i.totalCalls)}),s.jsx("td",{children:I(i.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx("span",{className:i.tier==="pro"?a.tierPro:a.tierBasic,children:P(e,i.tier)})})]},`${t.toolName}:${i.actionName}`))]},t.toolName)})})]})}),o.statistics&&s.jsxs("div",{className:a.summaryLine,children:[e("tools.summary.total","Total"),": ",o.statistics.totalCalls," ",e("tools.summary.calls","calls")," | ",e("tools.summary.sessions","Sessions"),": ",o.statistics.totalSessions]})]}),!f.loading&&f.tier==="basic"&&s.jsx(tt,{basicCalls:f.basicCalls,proCalls:f.proCalls,totalCalls:f.totalCalls,proUsagePercent:f.proUsagePercent,upgradeHref:Y.tools}),s.jsx(Q,{open:p!==null,title:p==="history"?e("tools.clear.history.title","Clear history?"):e("tools.clear.statistics.title","Clear statistics?"),message:p==="history"?e("tools.clear.history.message","This permanently removes the current place tool history and failures."):e("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.clear","Clear"),loading:x,onCancel:()=>!x&&N(null),onConfirm:y})]})}export{Yt as Component};
1
+ import{j as s,r as l,a as R,D as Z,u as q,i as z,T as w}from"./index-DGGmfli1.js";import{C as Q}from"./ConfirmModal-BmRJ2JXZ.js";import{u as X,T as Y}from"./TierComparison-7ofkPwj3.js";import{T as tt}from"./TierPromoProgress-SnRUjAPh.js";import"./TierPromo.module-CAoUYgIx.js";const st="_wrapper_1s3lp_2",et="_table_1s3lp_7",at="_sortable_1s3lp_32",ot="_sortArrow_1s3lp_41",rt="_clickable_1s3lp_52",lt="_empty_1s3lp_57",M={wrapper:st,table:et,sortable:at,sortArrow:ot,clickable:rt,empty:lt};function it({columns:e,data:o,sortBy:T,sortDir:f="asc",onSort:g,onRowClick:S,rowKey:C,emptyMessage:v}){return s.jsx("div",{className:M.wrapper,children:s.jsxs("table",{className:M.table,children:[s.jsx("thead",{children:s.jsx("tr",{children:e.map(n=>s.jsxs("th",{style:n.width?{width:n.width}:void 0,className:n.sortable?M.sortable:void 0,onClick:n.sortable&&g?()=>g(n.key):void 0,children:[s.jsx("span",{children:n.label}),n.sortable&&T===n.key&&s.jsx("span",{className:M.sortArrow,children:f==="asc"?"▴":"▾"})]},n.key))})}),s.jsx("tbody",{children:o.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:e.length,className:M.empty,children:v||"No data"})}):o.map((n,k)=>s.jsx("tr",{className:S?M.clickable:void 0,onClick:S?()=>S(n):void 0,children:e.map(p=>s.jsx("td",{children:p.render?p.render(n):String(n[p.key]??"")},p.key))},C?C(n):k))})]})})}const V=50;function nt(){const[e,o]=l.useState(null),[T,f]=l.useState(!0),[g,S]=l.useState([]),[C,v]=l.useState(0),[n,k]=l.useState(!1),[p,N]=l.useState(!0),[x,H]=l.useState(0),[u,D]=l.useState(""),[B,E]=l.useState([]),[U,A]=l.useState(0),[O,d]=l.useState(!1),[$,F]=l.useState(!0),[b,j]=l.useState(0),L=l.useRef(null),y=l.useCallback(async()=>{f(!0);try{const m=await R.get("/api/dashboard/tool-stats");o(m)}catch{}finally{f(!1)}},[]),t=l.useCallback(async(m,_)=>{N(!0);try{const K={limit:String(V),offset:String(m)};_&&(K.tool=_);const W=await R.get("/api/dashboard/history",K);S(W.entries),v(W.total),k(W.hasMore)}catch{S([]),v(0),k(!1)}finally{N(!1)}},[]),r=l.useCallback(async m=>{F(!0);try{const _=await R.get("/api/dashboard/failures",{limit:String(V),offset:String(m)});E(_.entries),A(_.total),d(_.hasMore)}catch{E([]),A(0),d(!1)}finally{F(!1)}},[]),i=l.useCallback(()=>{y(),t(x,u),r(b)},[y,t,r,x,u,b]),h=l.useCallback(async()=>{await R.post("/api/dashboard/tools/history/clear"),t(x,u),r(b)},[t,r,x,u,b]),c=l.useCallback(async()=>{await R.post("/api/dashboard/tools/statistics/clear"),y()},[y]);return l.useEffect(()=>{y()},[y]),l.useEffect(()=>{t(x,u)},[t,x,u]),l.useEffect(()=>{r(b)},[r,b]),l.useEffect(()=>{const m=new Z;L.current=m,m.connect();const _=m.on("command",()=>{y(),t(x,u),r(b)});return()=>{_(),m.disconnect(),L.current=null}},[y,t,r,x,u,b]),{statistics:e,statsLoading:T,history:g,historyTotal:C,historyHasMore:n,historyLoading:p,historyOffset:x,historyToolFilter:u,setHistoryOffset:H,setHistoryToolFilter:D,failures:B,failuresTotal:U,failuresHasMore:O,failuresLoading:$,failuresOffset:b,setFailuresOffset:j,refresh:i,clearHistory:h,clearStatistics:c}}const ct="_page_184r6_2",dt="_tabs_184r6_10",ut="_tab_184r6_10",pt="_tabActive_184r6_34",ht="_card_184r6_40",mt="_cardToolbar_184r6_47",xt="_sectionTitle_184r6_55",bt="_dangerButton_184r6_61",ft="_proBadge_184r6_71",_t="_statusOk_184r6_85",yt="_tierBasic_184r6_91",jt="_tierPro_184r6_95",gt="_tierMixed_184r6_100",St="_filterRow_184r6_111",Tt="_filterLabel_184r6_118",Ct="_filterSelect_184r6_127",Nt="_expandedRow_184r6_138",wt="_expandedSection_184r6_146",vt="_pre_184r6_156",kt="_pagination_184r6_173",Bt="_pageInfo_184r6_181",Mt="_btn_184r6_187",Pt="_tierDistribution_184r6_210",Et="_tierBarWrap_184r6_214",Lt="_tierBarBasic_184r6_222",Rt="_tierBarPro_184r6_227",Ht="_tierLabels_184r6_232",At="_statsTableWrap_184r6_241",Ot="_statsTable_184r6_241",$t="_sortableHeader_184r6_272",Ft="_sortArrow_184r6_277",It="_statsToolRow_184r6_281",Dt="_statsActionRow_184r6_289",Ut="_expandButton_184r6_293",Wt="_expandIcon_184r6_305",Gt="_actionLabel_184r6_310",Jt="_emptyStats_184r6_317",Kt="_summaryLine_184r6_323",a={page:ct,tabs:dt,tab:ut,tabActive:pt,card:ht,cardToolbar:mt,sectionTitle:xt,dangerButton:bt,proBadge:ft,statusOk:_t,tierBasic:yt,tierPro:jt,tierMixed:gt,filterRow:St,filterLabel:Tt,filterSelect:Ct,expandedRow:Nt,expandedSection:wt,pre:vt,pagination:kt,pageInfo:Bt,btn:Mt,tierDistribution:Pt,tierBarWrap:Et,tierBarBasic:Lt,tierBarPro:Rt,tierLabels:Ht,statsTableWrap:At,statsTable:Ot,sortableHeader:$t,sortArrow:Ft,statsToolRow:It,statsActionRow:Dt,expandButton:Ut,expandIcon:Wt,actionLabel:Gt,emptyStats:Jt,summaryLine:Kt},G=50;function Vt(e){const o=new Date(e);return`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}:${String(o.getSeconds()).padStart(2,"0")}`}function I(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function J(e,o){return o===0?"-":`${Math.round(e/o*100)}%`}function P(e,o){return o==="pro"?e("tier.pro","Pro"):o==="mixed"?e("tier.mixed","Mixed"):e("tier.basic","Basic")}function Yt(){const{t:e}=q(),o=nt(),{show:T}=z(),f=X(),[g,S]=l.useState("history"),[C,v]=l.useState(null),[n,k]=l.useState(null),[p,N]=l.useState(null),[x,H]=l.useState(!1),[u,D]=l.useState("totalCalls"),[B,E]=l.useState("desc"),U=l.useCallback(t=>{D(r=>r===t?(E(i=>i==="asc"?"desc":"asc"),t):(E("desc"),t))},[]),A=l.useMemo(()=>{var t;return(t=o.statistics)!=null&&t.tools?Object.keys(o.statistics.tools).sort():[]},[o.statistics]),O=l.useMemo(()=>{var t;return(t=o.statistics)!=null&&t.tools?Object.values(o.statistics.tools).map(r=>{const i=Object.entries(r.actions??{}).map(([h,c])=>({toolName:r.toolName,actionName:c.action??h,tier:c.tier,totalCalls:c.totalCalls,successCount:c.successCount,failureCount:c.failureCount,totalExecutionTimeMs:c.totalExecutionTimeMs,avgExecutionTimeMs:c.avgExecutionTimeMs,firstUsed:c.firstUsed,lastUsed:c.lastUsed}));return{toolName:r.toolName,tier:r.tier,actions:i,totalCalls:r.totalCalls,successCount:r.successCount,failureCount:r.failureCount,totalExecutionTimeMs:r.totalExecutionTimeMs,avgExecutionTimeMs:r.avgExecutionTimeMs,firstUsed:r.firstUsed,lastUsed:r.lastUsed}}):[]},[o.statistics]),d=l.useCallback((t,r,i,h)=>s.jsx(w,{text:e(i,h),children:e(t,r)}),[e]),$=l.useMemo(()=>[...O].sort((r,i)=>{const h=r[u],c=i[u];if(typeof h=="number"&&typeof c=="number")return B==="asc"?h-c:c-h;const m=String(h??""),_=String(c??"");return B==="asc"?m.localeCompare(_):_.localeCompare(m)}),[O,u,B]),F=l.useMemo(()=>[{key:"timestamp",label:d("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:t=>Vt(t.timestamp)},{key:"toolName",label:d("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:t=>{var i;const r=((i=t.parameters)==null?void 0:i.action)??"";return s.jsxs("span",{children:[t.toolName,r?`.${r}`:"",t.tier==="pro"&&s.jsx(w,{text:e("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:s.jsx("span",{className:a.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=>I(t.executionTimeMs)},{key:"status",label:d("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"60px",render:()=>s.jsx(w,{text:e("tools.status.ok.tooltip","The tool run completed successfully."),children:s.jsx("span",{className:a.statusOk,children:e("tools.status.ok","OK")})})},{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"?a.tierPro:a.tierBasic,children:P(e,t.tier)})}],[e,d]),b=l.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:"successRate",label:d("tools.col.okRate","OK%","tools.col.okRate.tooltip","Percentage of calls that finished successfully."),sortable:!1,width:"60px",render:t=>J(t.successCount,t.totalCalls)},{key:"avgExecutionTimeMs",label:d("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"80px",render:t=>I(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:"60px",render:t=>s.jsx(w,{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"?a.tierPro:t.tier==="mixed"?a.tierMixed:a.tierBasic,children:P(e,t.tier)})})}],[e,d]),j=l.useMemo(()=>{if(!o.statistics)return null;const t=o.statistics.tierSummary.basic.totalCalls,r=o.statistics.tierSummary.pro.totalCalls,i=t+r;if(i===0)return null;const h=Math.round(t/i*100),c=100-h;return{basic:t,pro:r,total:i,basicPct:h,proPct:c}},[o.statistics]),L=l.useCallback(t=>{k(r=>r===t?null:t)},[]),y=l.useCallback(async()=>{if(p){H(!0);try{p==="history"?await o.clearHistory():await o.clearStatistics(),T(e("toast.clearSuccess","Cleared successfully"),"success"),N(null)}catch{T(e("toast.clearFailed","Failed to clear data"),"error")}finally{H(!1)}}},[p,T,e,o]);return s.jsxs("div",{className:a.page,children:[s.jsx("div",{className:a.tabs,children:["history","statistics"].map(t=>s.jsx("button",{className:`${a.tab} ${g===t?a.tabActive:""}`,onClick:()=>S(t),children:e(`tools.tab.${t}`,t.charAt(0).toUpperCase()+t.slice(1))},t))}),g==="history"&&s.jsxs("div",{className:a.card,children:[s.jsxs("div",{className:a.cardToolbar,children:[s.jsx("div",{className:a.sectionTitle,children:e("tools.tab.history","History")}),s.jsx("button",{className:a.dangerButton,onClick:()=>N("history"),children:e("common.clear","Clear")})]}),s.jsx("div",{className:a.filterRow,children:s.jsxs("label",{className:a.filterLabel,children:[e("tools.filter.tool","Tool"),":",s.jsxs("select",{className:a.filterSelect,value:o.historyToolFilter,onChange:t=>{o.setHistoryToolFilter(t.target.value),o.setHistoryOffset(0)},children:[s.jsx("option",{value:"",children:e("tools.filter.all","All")}),A.map(t=>s.jsx("option",{value:t,children:t},t))]})]})}),s.jsx(it,{columns:F,data:o.history,rowKey:t=>t.id,onRowClick:t=>v(r=>r===t.id?null:t.id),emptyMessage:e("tools.empty.history","No history entries")}),C&&(()=>{const t=o.history.find(r=>r.id===C);return t?s.jsxs("div",{className:a.expandedRow,children:[s.jsxs("div",{className:a.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(w,{text:e("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:e("tools.detail.params","Parameters")}),":"]}),s.jsx("pre",{className:a.pre,children:JSON.stringify(t.parameters,null,2)})]}),t.result&&s.jsxs("div",{className:a.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(w,{text:e("tools.detail.result.tooltip","Returned result payload for this tool run."),children:e("tools.detail.result","Result")}),":"]}),s.jsx("pre",{className:a.pre,children:JSON.stringify(t.result,null,2)})]})]}):null})(),s.jsxs("div",{className:a.pagination,children:[s.jsx("button",{className:a.btn,disabled:o.historyOffset===0,title:e("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>o.setHistoryOffset(Math.max(0,o.historyOffset-G)),children:e("tools.page.prev","Prev")}),s.jsxs("span",{className:a.pageInfo,children:[o.historyOffset+1,"–",Math.min(o.historyOffset+G,o.historyTotal)," / ",o.historyTotal]}),s.jsx("button",{className:a.btn,disabled:!o.historyHasMore,title:e("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>o.setHistoryOffset(o.historyOffset+G),children:e("tools.page.next","Next")})]})]}),g==="statistics"&&s.jsxs("div",{className:a.card,children:[s.jsxs("div",{className:a.cardToolbar,children:[s.jsx("div",{className:a.sectionTitle,children:e("tools.tab.statistics","Statistics")}),s.jsx("button",{className:a.dangerButton,onClick:()=>N("statistics"),children:e("common.clear","Clear")})]}),j&&s.jsxs("div",{className:a.tierDistribution,children:[s.jsxs("div",{className:a.tierBarWrap,children:[s.jsx("div",{className:a.tierBarBasic,style:{width:`${j.basicPct}%`}}),s.jsx("div",{className:a.tierBarPro,style:{width:`${j.proPct}%`}})]}),s.jsxs("div",{className:a.tierLabels,children:[s.jsxs("span",{children:[P(e,"basic")," ",j.basicPct,"% (",j.basic,")"]}),s.jsxs("span",{children:[P(e,"pro")," ",j.proPct,"% (",j.pro,")"]})]})]}),s.jsx("div",{className:a.statsTableWrap,children:s.jsxs("table",{className:a.statsTable,children:[s.jsx("thead",{children:s.jsx("tr",{children:b.map(t=>s.jsxs("th",{style:t.width?{width:t.width}:void 0,className:t.sortable?a.sortableHeader:void 0,onClick:t.sortable?()=>U(t.key):void 0,children:[s.jsx("span",{children:t.label}),t.sortable&&u===t.key&&s.jsx("span",{className:a.sortArrow,children:B==="asc"?"▴":"▾"})]},t.key))})}),s.jsx("tbody",{children:$.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:b.length,className:a.emptyStats,children:e("tools.empty.stats","No tool statistics")})}):$.map(t=>{const r=n===t.toolName;return s.jsxs(l.Fragment,{children:[s.jsxs("tr",{className:a.statsToolRow,onClick:()=>L(t.toolName),children:[s.jsx("td",{children:s.jsxs("button",{type:"button",className:a.expandButton,"aria-expanded":r,"aria-label":`${t.toolName} ${r?e("common.collapse","Collapse"):e("common.expand","Expand")}`,onClick:i=>{i.stopPropagation(),L(t.toolName)},children:[s.jsx("span",{className:a.expandIcon,"aria-hidden":"true",children:r?"▾":"▸"}),s.jsx("span",{children:t.toolName})]})}),s.jsx("td",{children:t.totalCalls}),s.jsx("td",{children:J(t.successCount,t.totalCalls)}),s.jsx("td",{children:I(t.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx(w,{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"?a.tierPro:t.tier==="mixed"?a.tierMixed:a.tierBasic,children:P(e,t.tier)})})})]}),r&&t.actions.map(i=>s.jsxs("tr",{className:a.statsActionRow,children:[s.jsx("td",{children:s.jsx("span",{className:a.actionLabel,children:i.actionName})}),s.jsx("td",{children:i.totalCalls}),s.jsx("td",{children:J(i.successCount,i.totalCalls)}),s.jsx("td",{children:I(i.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx("span",{className:i.tier==="pro"?a.tierPro:a.tierBasic,children:P(e,i.tier)})})]},`${t.toolName}:${i.actionName}`))]},t.toolName)})})]})}),o.statistics&&s.jsxs("div",{className:a.summaryLine,children:[e("tools.summary.total","Total"),": ",o.statistics.totalCalls," ",e("tools.summary.calls","calls")," | ",e("tools.summary.sessions","Sessions"),": ",o.statistics.totalSessions]})]}),!f.loading&&f.tier==="basic"&&s.jsx(tt,{basicCalls:f.basicCalls,proCalls:f.proCalls,totalCalls:f.totalCalls,proUsagePercent:f.proUsagePercent,upgradeHref:Y.tools}),s.jsx(Q,{open:p!==null,title:p==="history"?e("tools.clear.history.title","Clear history?"):e("tools.clear.statistics.title","Clear statistics?"),message:p==="history"?e("tools.clear.history.message","This permanently removes the current place tool history and failures."):e("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.clear","Clear"),loading:x,onCancel:()=>!x&&N(null),onConfirm:y})]})}export{Yt as Component};