@weppy/roblox-mcp 2.14.4 → 2.14.6

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 (40) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +5 -2
  3. package/dashboard/dist/assets/{AssetsPage-CNX7DCV_.js → AssetsPage-DfB3E1vb.js} +1 -1
  4. package/dashboard/dist/assets/{ChangelogDetailPage-DLvmebHY.js → ChangelogDetailPage-C-VVfjbe.js} +1 -1
  5. package/dashboard/dist/assets/{ChangelogPage-0aA43feO.js → ChangelogPage-CkSIdLom.js} +1 -1
  6. package/dashboard/dist/assets/{ConfirmModal-zVAe5VBr.js → ConfirmModal-BXbkJq3w.js} +1 -1
  7. package/dashboard/dist/assets/{ConnectionPage-D8FF2toA.js → ConnectionPage-ECCqDYiG.js} +1 -1
  8. package/dashboard/dist/assets/{ControlsPage-B2bjY0jv.js → ControlsPage-CBnZkDGD.js} +1 -1
  9. package/dashboard/dist/assets/{CurrentPlaceScope-DeLb8cR4.js → CurrentPlaceScope-DJheb09C.js} +1 -1
  10. package/dashboard/dist/assets/{GameChangeDetail-DCbGMtO_.js → GameChangeDetail-3hQlAqDP.js} +1 -1
  11. package/dashboard/dist/assets/{InfoLabel-DjHpz03t.js → InfoLabel-Cc4MKAYc.js} +1 -1
  12. package/dashboard/dist/assets/{OverviewPage-BIglETRP.js → OverviewPage-lps48EeB.js} +1 -1
  13. package/dashboard/dist/assets/{PageHeader-D-x0uGJu.js → PageHeader-DezmLDg1.js} +1 -1
  14. package/dashboard/dist/assets/{PlaytestPage-DCKGzlBd.js → PlaytestPage-N2blmofL.js} +1 -1
  15. package/dashboard/dist/assets/SettingsPage-D1Et0FOx.js +1 -0
  16. package/dashboard/dist/assets/{StatusBadge-DqdYVuOn.js → StatusBadge-C3ARQLqC.js} +1 -1
  17. package/dashboard/dist/assets/SyncPage-DXgj8uBq.js +1 -0
  18. package/dashboard/dist/assets/SyncPage-sHUpW30U.css +1 -0
  19. package/dashboard/dist/assets/{Tabs-fJOR1mc6.js → Tabs-iku37C2G.js} +1 -1
  20. package/dashboard/dist/assets/{ToolsPage-Bv0CkVUl.js → ToolsPage-Cpz4X8R_.js} +1 -1
  21. package/dashboard/dist/assets/{TooltipText-BAHqtajG.js → TooltipText-CMx5IM6p.js} +1 -1
  22. package/dashboard/dist/assets/{UiPrimitive-DGkX6nPT.js → UiPrimitive-ojecpNs1.js} +1 -1
  23. package/dashboard/dist/assets/{UiStudioPage-BOnzb7DH.js → UiStudioPage-htI6Z7xJ.js} +1 -1
  24. package/dashboard/dist/assets/{WhatsNewPage-CXu_qUFe.js → WhatsNewPage-DAQ11-Xx.js} +1 -1
  25. package/dashboard/dist/assets/{copy-BH9EvKHQ.js → copy-BCrOOq8E.js} +1 -1
  26. package/dashboard/dist/assets/{index-5nAADWD6.js → index-B1MZBjK4.js} +118 -54
  27. package/dashboard/dist/assets/{index-CkZeRxRT.css → index-BDzb8NjS.css} +1 -1
  28. package/dashboard/dist/assets/{sample-requests-CCiQt0Pe.js → sample-requests-DXD3uKZy.js} +1 -1
  29. package/dashboard/dist/assets/{useLiveUptime-CLDBTvFQ.js → useLiveUptime-fm3oNIW5.js} +1 -1
  30. package/dashboard/dist/assets/useSettings-BGSD8gFB.js +1 -0
  31. package/dashboard/dist/assets/useSettings-Ce19GEW2.css +1 -0
  32. package/dashboard/dist/index.html +2 -2
  33. package/dist/index.js +110 -110
  34. package/package.json +1 -1
  35. package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
  36. package/dashboard/dist/assets/SettingsPage-lgifXJ6E.js +0 -1
  37. package/dashboard/dist/assets/SyncPage-BbqGQ8N-.js +0 -4
  38. package/dashboard/dist/assets/SyncPage-BnVXEQel.css +0 -1
  39. package/dashboard/dist/assets/useSettings-BNH9ENDy.css +0 -1
  40. package/dashboard/dist/assets/useSettings-_F_53t5J.js +0 -1
@@ -0,0 +1 @@
1
+ import{r,a as I,m as A,D as V,e as H,d as W,n as q,j as e,u as M,f as G,h as z,l as Y,T as K}from"./index-B1MZBjK4.js";import{P as J}from"./PageHeader-DezmLDg1.js";import{I as L}from"./InfoLabel-Cc4MKAYc.js";import{T as S}from"./TooltipText-CMx5IM6p.js";import{C as F}from"./ConfirmModal-BXbkJq3w.js";import{C as E}from"./CurrentPlaceScope-DJheb09C.js";import{S as Q}from"./StatusBadge-C3ARQLqC.js";import{B as R,a as B}from"./UiPrimitive-ojecpNs1.js";import"./ConfirmModal.module-DJksQHBd.js";const X=5e3;function Z(){const[t,s]=r.useState(null),[c,a]=r.useState([]),[x,y]=r.useState(!0),[d,f]=r.useState(null),[h,j]=r.useState(null),[n,u]=r.useState({report:null,loading:!1,applying:!1,error:null}),k=r.useRef(null),N=r.useRef(null),v=r.useCallback(async()=>{var p;try{const[l,g]=await Promise.all([I.get("/sync/status"),I.get("/api/dashboard/place-summary")]);s(l);const D=(p=g.places)==null?void 0:p.find(U=>U.isActive);return f((D==null?void 0:D.placeDirName)??null),j(g.activePlaceId),g.activePlaceId}catch{return null}},[]),T=r.useCallback(async()=>{try{const p=await I.get("/sync/history",{limit:"30"});a(p.entries??[])}catch{a([])}},[]),o=r.useCallback(async p=>{if(p===null){u({report:null,loading:!1,applying:!1,error:null});return}u(l=>({...l,loading:!0,error:null}));try{const l=await I.get("/api/sync/migration",{placeId:String(p)});u(g=>({...g,report:l,loading:!1,error:l.status==="blocked"?"migration_blocked":null}))}catch(l){if(l instanceof A&&(l.status===404||l.status===503)){u(g=>({...g,report:null,loading:!1,error:null}));return}u(g=>({...g,loading:!1,error:"unknown"}))}},[]),_=r.useCallback(async()=>{const[p]=await Promise.all([v(),T()]);await o(p),y(!1)},[v,T,o]),P=r.useCallback(()=>{_()},[_]),C=r.useCallback(async()=>{await o(h)},[h,o]),m=r.useCallback(async()=>{const p=n.report;if(!(!p||p.status!=="ready"||n.applying)){u(l=>({...l,applying:!0,error:null}));try{const l=await I.post("/api/sync/migration",{placeId:p.placeId,fromVersion:2,previewFingerprint:p.previewFingerprint,apply:!0});u({report:l,loading:!1,applying:!1,error:null}),await v()}catch(l){if(l instanceof A&&l.status===409&&(l.error==="preview_stale"||l.error==="migration_blocked")){const g=l.error;await o(p.placeId),u(D=>({...D,applying:!1,error:g}));return}u(g=>({...g,applying:!1,error:"unknown"}))}}},[o,v,n.applying,n.report]),b=r.useCallback(async()=>{await I.post("/api/dashboard/sync/history/clear"),a([]),v()},[v]);return r.useEffect(()=>(_(),N.current=setInterval(_,X),()=>{N.current&&clearInterval(N.current)}),[_]),r.useEffect(()=>{const p=new V;k.current=p,p.connect();const l=p.on("sync",()=>{_()});return()=>{l(),p.disconnect(),k.current=null}},[_]),{status:t,history:c,loading:x,activePlaceDirName:d,migration:n,refresh:P,refreshMigration:C,applyMigration:m,clearHistory:b}}const ee="_actions_1j3p3_60",te="_btn_1j3p3_68",ie="_btnPrimary_1j3p3_99",oe="_panel_1j3p3_109",ae="_panelIcon_1j3p3_116",se="_panelTitle_1j3p3_122",ne="_panelDesc_1j3p3_131",ce="_benefitList_1j3p3_139",le="_benefitItem_1j3p3_148",w={actions:ee,btn:te,btnPrimary:ie,panel:oe,panelIcon:ae,panelTitle:se,panelDesc:ne,benefitList:ce,benefitItem:le};function re({icon:t,title:s,description:c,benefits:a,upgradeLabel:x,upgradeHref:y}){const{trackEvent:d}=H(),{pathname:f,search:h}=W(),j=q(f,h);return e.jsxs("div",{className:w.panel,children:[t&&e.jsx("div",{className:w.panelIcon,children:t}),e.jsx("div",{className:w.panelTitle,children:s}),e.jsx("div",{className:w.panelDesc,children:c}),e.jsx("ul",{className:w.benefitList,children:a.map(n=>e.jsx("li",{className:w.benefitItem,children:n},n))}),e.jsx("div",{className:w.actions,children:e.jsx("a",{className:`${w.btn} ${w.btnPrimary}`,href:y,target:"_blank",rel:"noreferrer",onClick:()=>d("dashboard_click_event",{click_target:"upgrade_cta",placement:"tier_panel",...j}),children:x})})]})}const pe="_page_1o0wf_2",de="_card_1o0wf_10",ye="_cardHeader_1o0wf_17",me="_clearButton_1o0wf_29",ue="_statusRow_1o0wf_53",ge="_metaItem_1o0wf_60",fe="_statusGrid_1o0wf_66",he="_migrationPanel_1o0wf_85",_e="_migrationHeader_1o0wf_92",xe="_migrationTitle_1o0wf_99",we="_migrationDescription_1o0wf_108",je="_migrationLedger_1o0wf_116",ve="_migrationLedgerItem_1o0wf_123",Se="_migrationLedgerBlocked_1o0wf_148",be="_migrationSection_1o0wf_152",Ne="_migrationList_1o0wf_166",Ie="_migrationRow_1o0wf_176",Le="_migrationOperation_1o0wf_189",Te="_migrationRowBody_1o0wf_194",De="_migrationNotice_1o0wf_215",Re="_migrationActions_1o0wf_222",ke="_migrationButton_1o0wf_228",Pe="_policySummary_1o0wf_265",Ce="_policySummaryItem_1o0wf_276",Ae="_policyPrimaryValue_1o0wf_301",Ee="_policyReviewNotice_1o0wf_307",Be="_policyApplySection_1o0wf_318",$e="_policyApplyHeader_1o0wf_322",Oe="_policyApplyTitle_1o0wf_326",He="_policyApplyDescription_1o0wf_334",Me="_policyInfoLabel_1o0wf_342",Fe="_policySafetyRow_1o0wf_353",Ue="_policySafetyLabel_1o0wf_365",Ve="_policySafetyBadge_1o0wf_371",We="_policyDisclosure_1o0wf_375",qe="_policyDisclosureIcon_1o0wf_407",Ge="_policyDisclosureIconOpen_1o0wf_414",ze="_policyScopeList_1o0wf_418",Ye="_policyScopeRow_1o0wf_425",Ke="_policyScopeName_1o0wf_439",Je="_policyDirectionRail_1o0wf_451",Qe="_policyDirectionEndpoint_1o0wf_467",Xe="_policyDirectionEndpointStudio_1o0wf_474",Ze="_policyDirectionArrow_1o0wf_478",et="_forwardBadge_1o0wf_521",tt="_logContainer_1o0wf_536",it="_logEntry_1o0wf_543",ot="_logTime_1o0wf_555",at="_logType_1o0wf_561",st="_logTypeWrite_1o0wf_570",nt="_logTypeUpdate_1o0wf_574",ct="_logTypeDelete_1o0wf_578",lt="_logTypeIdle_1o0wf_582",rt="_logPath_1o0wf_586",pt="_logEmpty_1o0wf_593",dt="_overlay_1o0wf_600",yt="_overlayTitle_1o0wf_610",mt="_overlayMessage_1o0wf_617",ut="_checklist_1o0wf_623",gt="_checkItem_1o0wf_633",i={page:pe,card:de,cardHeader:ye,clearButton:me,statusRow:ue,metaItem:ge,statusGrid:fe,migrationPanel:he,migrationHeader:_e,migrationTitle:xe,migrationDescription:we,migrationLedger:je,migrationLedgerItem:ve,migrationLedgerBlocked:Se,migrationSection:be,migrationList:Ne,migrationRow:Ie,migrationOperation:Le,migrationRowBody:Te,migrationNotice:De,migrationActions:Re,migrationButton:ke,policySummary:Pe,policySummaryItem:Ce,policyPrimaryValue:Ae,policyReviewNotice:Ee,policyApplySection:Be,policyApplyHeader:$e,policyApplyTitle:Oe,policyApplyDescription:He,policyInfoLabel:Me,policySafetyRow:Fe,policySafetyLabel:Ue,policySafetyBadge:Ve,policyDisclosure:We,policyDisclosureIcon:qe,policyDisclosureIconOpen:Ge,policyScopeList:ze,policyScopeRow:Ye,policyScopeName:Ke,policyDirectionRail:Je,policyDirectionEndpoint:Qe,policyDirectionEndpointStudio:Xe,policyDirectionArrow:Ze,forwardBadge:et,logContainer:tt,logEntry:it,logTime:ot,logType:at,logTypeWrite:st,logTypeUpdate:nt,logTypeDelete:ct,logTypeIdle:lt,logPath:rt,logEmpty:pt,overlay:dt,overlayTitle:yt,overlayMessage:mt,checklist:ut,checkItem:gt};function ft(t){return t==="add"?"success":t==="delete"?"danger":"accent"}function ht(t){return`sync.migration.reason.${t}`}function _t(t){return`sync.migration.reason.${t}`}function xt({migration:t,onRefresh:s,onApply:c}){const{t:a}=M(),[x,y]=r.useState(!1),d=t==null?void 0:t.report;if(!t||!d||d.status==="not_required")return null;const f=d.status==="blocked",h=d.status==="ready"&&!t.loading&&!t.applying,j=async()=>{await c(),y(!1)};return e.jsxs("section",{className:`${i.card} ${i.migrationPanel}`,"aria-labelledby":"sync-migration-title",children:[e.jsxs("div",{className:i.migrationHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{id:"sync-migration-title",className:i.migrationTitle,children:a("sync.migration.title","Sync format update available")}),e.jsx("p",{className:i.migrationDescription,children:a("sync.migration.description","Review the metadata changes before updating this place from sync format v2 to v3.")})]}),e.jsx(R,{variant:f?"warning":"accent",children:f?a("sync.migration.status.blocked","Blocked"):a("sync.migration.status.ready","Ready to review")})]}),e.jsxs("div",{className:i.migrationLedger,"aria-label":a("sync.migration.preview","Review changes"),children:[e.jsxs("div",{className:i.migrationLedgerItem,children:[e.jsx("span",{children:a("sync.migration.summary.add","Add")}),e.jsx("strong",{children:d.summary.add})]}),e.jsxs("div",{className:i.migrationLedgerItem,children:[e.jsx("span",{children:a("sync.migration.summary.modify","Modify")}),e.jsx("strong",{children:d.summary.modify})]}),e.jsxs("div",{className:i.migrationLedgerItem,children:[e.jsx("span",{children:a("sync.migration.summary.delete","Delete")}),e.jsx("strong",{children:d.summary.delete})]}),e.jsxs("div",{className:`${i.migrationLedgerItem} ${f?i.migrationLedgerBlocked:""}`,children:[e.jsx("span",{children:a("sync.migration.summary.blocked","Blocked")}),e.jsx("strong",{children:d.summary.blocked})]})]}),d.changes.length>0&&e.jsxs("div",{className:i.migrationSection,children:[e.jsx("h3",{children:a("sync.migration.changes","Metadata changes")}),e.jsx("ul",{className:i.migrationList,children:d.changes.map(n=>e.jsxs("li",{className:i.migrationRow,children:[e.jsx(R,{variant:ft(n.operation),className:i.migrationOperation,children:a(`sync.migration.operation.${n.operation}`,n.operation)}),e.jsxs("div",{className:i.migrationRowBody,children:[e.jsx("code",{children:n.path}),e.jsx("span",{children:a(ht(n.reason),n.reason.replace(/_/g," "))})]})]},`${n.operation}:${n.path}`))})]}),d.blockers.length>0&&e.jsxs("div",{className:i.migrationSection,children:[e.jsx("h3",{children:a("sync.migration.blockers","Items to resolve")}),e.jsx("ul",{className:i.migrationList,children:d.blockers.map((n,u)=>e.jsxs("li",{className:i.migrationRow,children:[e.jsx(R,{variant:"warning",className:i.migrationOperation,children:a("sync.migration.summary.blocked","Blocked")}),e.jsxs("div",{className:i.migrationRowBody,children:[n.path&&e.jsx("code",{children:n.path}),e.jsx("span",{children:a(_t(n.reason),n.reason.replace(/_/g," "))})]})]},`${n.reason}:${n.path??u}`))})]}),e.jsxs("div",{className:i.migrationNotice,"aria-live":"polite",children:[(f||t.error==="migration_blocked")&&e.jsx("span",{children:a("sync.migration.blocked","Resolve sync conflicts before updating")}),t.error==="preview_stale"&&e.jsx("span",{children:a("sync.migration.stale","Preview changed. Review the latest diff.")}),t.error==="unknown"&&e.jsx("span",{children:a("sync.migration.error","Could not update the sync format. Try again.")})]}),e.jsxs("div",{className:i.migrationActions,children:[e.jsx(B,{variant:"secondary",className:i.migrationButton,disabled:t.loading||t.applying,onClick:()=>void s(),children:t.loading?a("sync.migration.refreshing","Refreshing…"):a("sync.migration.refresh","Refresh preview")}),e.jsx(B,{variant:"primary",className:i.migrationButton,disabled:!h,onClick:()=>y(!0),children:t.applying?a("sync.migration.applying","Applying…"):a("sync.migration.apply","Apply update")})]}),e.jsx(F,{open:x,title:a("sync.migration.confirm.title","Apply sync format update?"),message:a("sync.migration.confirm.message","Back up and update the listed sync metadata. Your Luau source files will not change."),cancelLabel:a("common.cancel","Cancel"),confirmLabel:a("sync.migration.apply","Apply update"),loading:t.applying,onCancel:()=>!t.applying&&y(!1),onConfirm:()=>void j()})]})}const wt=["scriptSource","properties","structure","serviceProperties"];function jt(t){const s=new Date(t);return`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}`}function vt(t){switch(t){case"write":return i.logTypeWrite;case"update":return i.logTypeUpdate;case"delete":return i.logTypeDelete;default:return i.logTypeIdle}}function St(t){switch(t){case"syncing":return"syncing";case"initializing":return"initializing";case"idle":return"idle";default:return"offline"}}function bt(t,s){const c={studio_first:"Studio First",bidirectional_review:"Bidirectional",local_code_studio_world:"Local Code, Studio World",custom:"Custom"};return t(`sync.policy.preset.${s}`,c[s])}function $(t,s){return s==="auto"?t("sync.policy.apply.auto","Auto apply"):t("sync.policy.apply.manual","Review first")}function Nt(t,s){const c={forward:"Studio → Local",reverse:"Local → Studio",bidirectional:"Both ways"};return t(`sync.policy.direction.${s}`,c[s])}function It(t){return{forward:"←",reverse:"→",bidirectional:"⇄"}[t]}function Lt(t,s){const c={forward:"Studio changes are written to local files.",reverse:"Local file changes are applied to Studio.",bidirectional:"Changes can move from Studio to local files and from local files to Studio."};return t(`sync.policy.direction.${s}.tooltip`,c[s])}function O(...t){const s=t[0]??"",c=s.includes("\\")&&!s.includes("/")?"\\":"/";return t.filter(a=>a.length>0).map((a,x)=>x===0?a.replace(/[\\/]+$/g,""):a.replace(/^[\\/]+|[\\/]+$/g,"")).join(c)}function Tt(t){const s=t.replace(/[\\/]+$/g,""),c=s.split(/[\\/]+/);return c[c.length-1]??s}function Dt(t,s){const c=Tt(t);return c==="explorer"?t:c===s?O(t,"explorer"):O(t,s,"explorer")}function Rt(t,s){return s?t("sync.policy.safety.auto","Auto delete to Studio"):t("sync.policy.safety.review","Review before delete")}function kt(t,s){return s?t("sync.policy.safety.auto.tooltip","Deleting local files may automatically remove matching Studio instances. This is separate from UI Studio automatic cleanup."):t("sync.policy.safety.review.tooltip","Local file deletions wait for review before matching Studio instances are removed. This is separate from UI Studio automatic cleanup.")}function Pt(t,s){switch(s){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 Ct(t,s){switch(s){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 Vt(){const{t}=M(),{trackEvent:s}=H(),{level:c}=G(),{tier:a,loading:x}=z(),y=Z(),{show:d}=Y(),[f,h]=r.useState(!1),[j,n]=r.useState(!1),[u,k]=r.useState(!1),N=!x&&a==="basic",v=c==="disconnected"||c==="serverOnly",T=e.jsx(J,{title:t("page.sync.title","Sync"),description:t("page.sync.description","Monitor Studio to local sync status, direction, apply mode, and recent sync logs."),helpTopicId:"sync",helpState:{connectionLevel:c,tier:a}});if(v)return e.jsxs("div",{className:i.page,children:[T,e.jsx(E,{surface:"sync"}),e.jsx("div",{className:i.card,children:e.jsxs("div",{className:i.overlay,children:[e.jsx("div",{className:i.overlayTitle,children:t("sync.overlay.title","Roblox Studio plugin required")}),e.jsx("div",{className:i.overlayMessage,children:t("sync.overlay.message","Sync status will be available once the Roblox Studio plugin connects.")}),e.jsxs("ul",{className:i.checklist,children:[e.jsx("li",{className:i.checkItem,children:t("sync.overlay.check1","Is Roblox Studio running?")}),e.jsx("li",{className:i.checkItem,children:t("sync.overlay.check2","Is the WEPPY Plugin installed?")})]})]})})]});const o=y.status,_=y.history,P=St(o==null?void 0:o.state),C=async()=>{n(!0);try{await y.clearHistory(),d(t("toast.clearSuccess","Cleared successfully"),"success"),h(!1)}catch{d(t("toast.clearFailed","Failed to clear data"),"error")}finally{n(!1)}};return e.jsxs("div",{className:i.page,children:[T,e.jsx(E,{surface:"sync"}),e.jsxs("div",{className:i.card,children:[e.jsxs("div",{className:i.cardHeader,children:[e.jsx(S,{text:t("sync.status.title.tooltip","Current Studio and local file sync status for this place."),children:t("sync.status.title","Sync Status")}),N&&e.jsx(S,{text:t("sync.status.forwardOnly.tooltip","Basic tier allows Studio to local forward sync only."),children:e.jsx("span",{className:i.forwardBadge,children:t("sync.status.forwardOnly","Forward Only")})})]}),e.jsxs("div",{className:i.statusRow,children:[e.jsx(Q,{status:P}),(o==null?void 0:o.placeName)&&e.jsxs("span",{className:i.metaItem,children:[e.jsx(L,{label:t("sync.status.place","Place"),tooltip:t("sync.status.place.tooltip","Connected Roblox place name and place ID.")}),": ",o.placeName,o.placeId?` (${o.placeId})`:""]})]}),e.jsxs("dl",{className:i.statusGrid,children:[(o==null?void 0:o.syncRoot)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(L,{label:t("sync.status.path","Place Root"),tooltip:t("sync.status.path.tooltip","Local filesystem root currently used for this place sync output.")})}),e.jsx("dd",{children:o.syncRoot})]}),y.activePlaceDirName&&(o==null?void 0:o.syncRoot)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(L,{label:t("sync.status.placePath","Explorer Path"),tooltip:t("sync.status.placePath.tooltip","Explorer files path for the active place.")})}),e.jsx("dd",{children:Dt(o.syncRoot,y.activePlaceDirName)})]}),(o==null?void 0:o.instanceCount)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(L,{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:o.instanceCount})]}),(o==null?void 0:o.scriptCount)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(L,{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:o.scriptCount})]}),(o==null?void 0:o.state)==="syncing"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(L,{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")})]})]})]}),e.jsx(xt,{migration:y.migration,onRefresh:y.refreshMigration,onApply:y.applyMigration}),(o==null?void 0:o.policy)&&e.jsxs("div",{className:i.card,children:[e.jsx("div",{className:i.cardHeader,children:e.jsx(S,{text:t("sync.policy.title.tooltip","Effective Sync policy reported by the connected Studio plugin."),children:t("sync.policy.title","Sync Policy")})}),e.jsxs("dl",{className:i.policySummary,children:[e.jsxs("div",{className:i.policySummaryItem,children:[e.jsx("dt",{children:t("sync.policy.activation","Activation")}),e.jsx("dd",{children:e.jsx(R,{variant:o.syncEnabled?"success":"neutral",children:o.syncEnabled?t("sync.policy.activation.on","Sync ON"):t("sync.policy.activation.off","Sync OFF")})})]}),e.jsxs("div",{className:i.policySummaryItem,children:[e.jsx("dt",{children:t("sync.policy.preset","Workflow")}),e.jsx("dd",{className:i.policyPrimaryValue,children:bt(t,o.policy.preset)})]})]}),o.policyReviewRequired&&e.jsx("div",{className:i.policyReviewNotice,role:"status",children:t("sync.policy.reviewRequired","Review this policy in the Studio plugin before starting Sync.")}),e.jsxs("section",{className:i.policyApplySection,"aria-labelledby":"sync-policy-apply-title",children:[e.jsxs("div",{className:i.policyApplyHeader,children:[e.jsx("h3",{id:"sync-policy-apply-title",className:i.policyApplyTitle,children:t("sync.policy.apply.title","How local changes apply to Studio")}),e.jsx("p",{className:i.policyApplyDescription,children:t("sync.policy.apply.description","Shows whether changes made locally are reviewed first or applied to Studio automatically.")})]}),e.jsxs("dl",{className:i.policySummary,children:[e.jsxs("div",{className:i.policySummaryItem,children:[e.jsx("dt",{children:e.jsx(S,{text:t("sync.policy.apply.content.tooltip","Script Source, property, and Service property changes made locally. Instance creation, deletion, renaming, and moves are Structure changes."),children:e.jsx("span",{className:i.policyInfoLabel,tabIndex:0,children:t("sync.policy.apply.content","Content changes")})})}),e.jsx("dd",{children:$(t,o.policy.apply.contentChanges)})]}),e.jsxs("div",{className:i.policySummaryItem,children:[e.jsx("dt",{children:e.jsx(S,{text:t("sync.policy.apply.structure.tooltip","Instance creation, deletion, renaming, and moves made locally. Automatic local deletion additionally requires the separate delete option below."),children:e.jsx("span",{className:i.policyInfoLabel,tabIndex:0,children:t("sync.policy.apply.structure","Structure changes")})})}),e.jsx("dd",{children:$(t,o.policy.apply.structureChanges)})]})]}),e.jsxs("div",{className:i.policySafetyRow,children:[e.jsx("span",{className:i.policySafetyLabel,children:t("sync.policy.safety.localDeletes","Local delete → Studio instance removal")}),e.jsx(S,{text:kt(t,o.policy.autoApplyLocalDeletesToStudio),children:e.jsx(R,{variant:o.policy.autoApplyLocalDeletesToStudio?"warning":"neutral",className:i.policySafetyBadge,tabIndex:0,children:Rt(t,o.policy.autoApplyLocalDeletesToStudio)})})]})]}),e.jsxs("button",{type:"button",className:i.policyDisclosure,"aria-expanded":u,"aria-controls":"sync-policy-scope-panel",onClick:()=>k(m=>!m),children:[e.jsx("span",{children:t("sync.policy.scope.disclosure","Scope directions")}),e.jsx("span",{"aria-hidden":"true",className:`${i.policyDisclosureIcon} ${u?i.policyDisclosureIconOpen:""}`,children:"⌄"})]}),u&&e.jsx("div",{id:"sync-policy-scope-panel",className:i.policyScopeList,children:wt.map(m=>{const b=o.policy.directions[m];return e.jsxs("div",{className:i.policyScopeRow,"data-testid":"sync-policy-scope-row",children:[e.jsx("span",{className:i.policyScopeName,children:t(`sync.policy.scope.${m}`,m)}),e.jsx(S,{text:Lt(t,b),children:e.jsxs("span",{className:i.policyDirectionRail,"data-testid":"sync-policy-direction-rail",role:"img","aria-label":Nt(t,b),tabIndex:0,children:[e.jsx("span",{className:i.policyDirectionEndpoint,children:t("sync.policy.endpoint.local","Local")}),e.jsx("span",{className:i.policyDirectionArrow,"aria-hidden":"true",children:It(b)}),e.jsx("span",{className:`${i.policyDirectionEndpoint} ${i.policyDirectionEndpointStudio}`,children:t("sync.policy.endpoint.studio","Studio")})]})})]},m)})})]}),e.jsxs("div",{className:i.card,children:[e.jsxs("div",{className:i.cardHeader,children:[e.jsx("span",{children:t("sync.log.title","Sync Log")}),e.jsx("button",{className:i.clearButton,onClick:()=>{s("dashboard_click_event",{click_target:"sync_clear_log",page:"sync"}),h(!0)},children:t("common.clear","Clear")})]}),e.jsx("div",{className:i.logContainer,children:_.length===0?e.jsx("div",{className:i.logEmpty,children:t("sync.log.empty","No sync events yet")}):_.map((m,b)=>e.jsxs("div",{className:i.logEntry,children:[e.jsx("span",{className:i.logTime,children:jt(m.timestamp)}),e.jsx(S,{text:Ct(t,m.type),children:e.jsx("span",{className:`${i.logType} ${vt(m.type)}`,children:Pt(t,m.type)})}),e.jsxs("span",{className:i.logPath,children:[m.path,m.details?` — ${m.details}`:""]})]},b))})]}),N&&e.jsx(re,{title:t("sync.upgrade.title","Explore Full Sync with Pro"),description:t("tier.banner.save","Save AI tokens with Pro!"),benefits:[t("sync.upgrade.benefit1","Bidirectional sync — edit files, auto-apply to Studio"),t("sync.upgrade.benefit2","Reverse sync — push file changes back to Studio"),t("sync.upgrade.benefit3","Full sync history and detailed change log")],upgradeLabel:t("sync.upgrade.buy","View Pro"),upgradeHref:K.sync}),e.jsx(F,{open:f,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:j,onCancel:()=>!j&&h(!1),onConfirm:C})]})}export{Vt as Component};
@@ -0,0 +1 @@
1
+ ._progressPromoWrap_1j3p3_1{display:flex;flex-direction:column;gap:8px}._progressPromo_1j3p3_1{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:14px 20px;display:flex;align-items:center;gap:16px}._progressMain_1j3p3_17{flex:1;min-width:0}._progressLabel_1j3p3_22{font-family:var(--font-label);font-size:11px;color:var(--text-secondary);margin-bottom:6px;display:flex;justify-content:space-between;gap:12px}._progressBar_1j3p3_32{height:6px;background:var(--bg-secondary);border-radius:3px;overflow:hidden}._progressFill_1j3p3_39{height:100%;background:var(--pro-badge);border-radius:3px;transition:width var(--transition)}._progressTextGroup_1j3p3_46{display:flex;flex-direction:column;gap:3px}._progressText_1j3p3_46{font-family:var(--font-label);font-size:13px;color:var(--pro-badge);white-space:nowrap;font-weight:500}._actions_1j3p3_60{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}._btn_1j3p3_68{display:inline-flex;align-items:center;justify-content:center;font-family:var(--font-label);font-size:12px;padding:6px 14px;border-radius:4px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;text-decoration:none;transition:background var(--transition),border-color var(--transition),opacity var(--transition)}._btn_1j3p3_68:hover{border-color:var(--accent);background:var(--accent-dim)}._btnOutline_1j3p3_89{border-color:var(--pro-badge);color:var(--pro-badge)}._btnOutline_1j3p3_89:hover{background:var(--pro-bg-soft);border-color:var(--pro-badge)}._btnPrimary_1j3p3_99{background:var(--pro-badge);color:var(--pro-text-on-badge);border-color:var(--pro-badge)}._btnPrimary_1j3p3_99:hover{opacity:.9}._panel_1j3p3_109{background:linear-gradient(180deg,var(--pro-bg-soft),transparent 60%),var(--bg-secondary);border:1px solid var(--pro-border);border-radius:var(--radius);padding:24px 20px}._panelIcon_1j3p3_116{font-size:32px;margin-bottom:12px;text-align:center}._panelTitle_1j3p3_122{font-family:var(--font-label);font-size:15px;font-weight:600;color:var(--pro-text);margin-bottom:8px;text-align:center}._panelDesc_1j3p3_131{font-size:13px;color:var(--text-secondary);margin-bottom:16px;line-height:1.5;text-align:center}._benefitList_1j3p3_139{list-style:none;padding:0;margin:0 0 16px;display:flex;flex-direction:column;gap:4px}._benefitItem_1j3p3_148{font-size:12px;color:var(--text-secondary);padding-left:16px;position:relative}._benefitItem_1j3p3_148:before{content:"+";position:absolute;left:0;color:var(--pro-badge);font-weight:600}@media(max-width:720px){._progressPromo_1j3p3_1{flex-direction:column;align-items:stretch}._progressText_1j3p3_46{white-space:normal}._actions_1j3p3_60{justify-content:stretch}._btn_1j3p3_68{width:100%}}._page_1o0wf_2{display:flex;flex-direction:column;gap:16px;max-width:900px}._card_1o0wf_10{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._cardHeader_1o0wf_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_1o0wf_29{border:1px solid var(--danger-border);background:var(--danger-bg);color:var(--danger-text);border-radius:var(--radius-control);padding:6px 12px;font-family:var(--font-label);font-size:12px;font-weight:600;cursor:pointer;transition:background var(--transition),border-color var(--transition),color var(--transition)}._clearButton_1o0wf_29:hover{background:var(--danger-hover-bg);border-color:var(--danger)}._clearButton_1o0wf_29:focus-visible{outline:none;box-shadow:var(--focus-ring)}._statusRow_1o0wf_53{display:flex;align-items:center;gap:12px;margin-bottom:8px}._metaItem_1o0wf_60{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._statusGrid_1o0wf_66{display:grid;grid-template-columns:auto 1fr;gap:4px 16px;font-size:12px}._statusGrid_1o0wf_66 dt{color:var(--text-secondary);font-family:var(--font-label)}._statusGrid_1o0wf_66 dd{margin:0;font-family:var(--font-code);color:var(--text-primary)}._migrationPanel_1o0wf_85{display:flex;flex-direction:column;gap:16px;font-size:16px}._migrationHeader_1o0wf_92{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}._migrationTitle_1o0wf_99{margin:0;color:var(--text-primary);font-family:var(--font-label);font-size:20px;line-height:1.25;font-weight:600}._migrationDescription_1o0wf_108{max-width:640px;margin:8px 0 0;color:var(--text-secondary);font-size:16px;line-height:1.5}._migrationLedger_1o0wf_116{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--border);background:var(--bg-secondary)}._migrationLedgerItem_1o0wf_123{display:flex;min-width:0;min-height:64px;flex-direction:column;justify-content:center;gap:4px;padding:8px 12px;border-right:1px solid var(--border);color:var(--text-secondary);font-family:var(--font-label);font-size:14px}._migrationLedgerItem_1o0wf_123:last-child{border-right:0}._migrationLedgerItem_1o0wf_123 strong{color:var(--text-primary);font-family:var(--font-code);font-size:20px;font-variant-numeric:tabular-nums}._migrationLedgerBlocked_1o0wf_148 strong{color:var(--warning-text)}._migrationSection_1o0wf_152{display:flex;flex-direction:column;gap:8px}._migrationSection_1o0wf_152 h3{margin:0;color:var(--text-secondary);font-family:var(--font-label);font-size:14px;font-weight:600}._migrationList_1o0wf_166{display:flex;flex-direction:column;gap:0;margin:0;padding:0;border:1px solid var(--border);list-style:none}._migrationRow_1o0wf_176{display:grid;grid-template-columns:84px minmax(0,1fr);align-items:start;gap:12px;padding:12px;border-bottom:1px solid var(--border)}._migrationRow_1o0wf_176:last-child{border-bottom:0}._migrationOperation_1o0wf_189{min-width:76px;text-transform:uppercase}._migrationRowBody_1o0wf_194{display:flex;min-width:0;flex-direction:column;gap:4px}._migrationRowBody_1o0wf_194 code{overflow-wrap:anywhere;color:var(--text-primary);font-family:var(--font-code);font-size:14px;line-height:1.4}._migrationRowBody_1o0wf_194 span{color:var(--text-secondary);font-size:14px;line-height:1.4}._migrationNotice_1o0wf_215{min-height:24px;color:var(--warning-text);font-size:16px;line-height:1.5}._migrationActions_1o0wf_222{display:flex;justify-content:flex-end;gap:8px}._migrationButton_1o0wf_228{min-height:44px;padding:0 16px;font-size:16px}@media(max-width:640px){._migrationHeader_1o0wf_92{flex-direction:column}._migrationLedger_1o0wf_116{grid-template-columns:repeat(2,minmax(0,1fr))}._migrationLedgerItem_1o0wf_123:nth-child(2){border-right:0}._migrationLedgerItem_1o0wf_123:nth-child(-n+2){border-bottom:1px solid var(--border)}._migrationRow_1o0wf_176{grid-template-columns:1fr}._migrationActions_1o0wf_222{flex-direction:column-reverse}._migrationButton_1o0wf_228{width:100%}}._policySummary_1o0wf_265{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;margin:0;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--border)}._policySummaryItem_1o0wf_276{display:grid;grid-template-columns:minmax(120px,.8fr) minmax(0,1.2fr);align-items:center;min-height:48px;gap:12px;padding:10px 12px;background:var(--bg-secondary)}._policySummaryItem_1o0wf_276 dt{color:var(--text-secondary);font-family:var(--font-label);font-size:12px}._policySummaryItem_1o0wf_276 dd{min-width:0;margin:0;color:var(--text-primary);font-family:var(--font-code);font-size:13px;overflow-wrap:anywhere}._policyPrimaryValue_1o0wf_301{font-family:var(--font-label)!important;font-size:16px!important;font-weight:600}._policyReviewNotice_1o0wf_307{margin-top:12px;padding:10px 12px;border:1px solid var(--warning-border);border-radius:var(--radius-control);background:var(--warning-bg);color:var(--warning-text);font-size:14px;line-height:1.45}._policyApplySection_1o0wf_318{margin-top:12px}._policyApplyHeader_1o0wf_322{margin-bottom:10px}._policyApplyTitle_1o0wf_326{margin:0;color:var(--text-primary);font-family:var(--font-label);font-size:14px;font-weight:600}._policyApplyDescription_1o0wf_334{margin:4px 0 0;color:var(--text-secondary);font-family:var(--font-label);font-size:13px;line-height:1.45}._policyInfoLabel_1o0wf_342{border-bottom:1px dotted var(--text-muted);cursor:help}._policyInfoLabel_1o0wf_342:focus-visible{outline:none;border-radius:2px;box-shadow:var(--focus-ring)}._policySafetyRow_1o0wf_353{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;min-height:48px;margin-top:8px;padding:0 12px;border:1px solid var(--border);border-radius:var(--radius-control)}._policySafetyLabel_1o0wf_365{color:var(--text-secondary);font-family:var(--font-label);font-size:12px}._policySafetyBadge_1o0wf_371{min-height:22px}._policyDisclosure_1o0wf_375{display:flex;width:100%;min-height:42px;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;padding:0 12px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card);color:var(--text-primary);font-family:var(--font-label);font-size:13px;font-weight:600;text-align:left;cursor:pointer;transition:background var(--transition),border-color var(--transition),color var(--transition)}._policyDisclosure_1o0wf_375:hover{border-color:var(--border-highlight);background:var(--bg-secondary);color:var(--accent)}._policyDisclosure_1o0wf_375:focus-visible{outline:none;box-shadow:var(--focus-ring)}._policyDisclosureIcon_1o0wf_407{flex:0 0 auto;color:var(--text-muted);font-family:var(--font-code);transition:transform var(--transition)}._policyDisclosureIconOpen_1o0wf_414{transform:rotate(180deg)}._policyScopeList_1o0wf_418{margin-top:8px;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-control)}._policyScopeRow_1o0wf_425{display:grid;grid-template-columns:minmax(180px,.9fr) minmax(0,1.1fr);align-items:center;min-height:44px;gap:16px;padding:8px 12px;border-bottom:1px solid var(--border)}._policyScopeRow_1o0wf_425:last-child{border-bottom:0}._policyScopeName_1o0wf_439{min-width:0;color:var(--text-secondary);font-family:var(--font-label);font-size:13px;overflow-wrap:anywhere}._policyScopeRow_1o0wf_425>[data-tooltip-text]{width:100%}._policyDirectionRail_1o0wf_451{display:grid;width:100%;min-width:0;grid-template-columns:minmax(0,1fr) 32px minmax(0,1fr);align-items:center;color:var(--text-secondary);font-family:var(--font-code)}._policyDirectionRail_1o0wf_451:focus-visible{outline:none;border-radius:2px;box-shadow:var(--focus-ring)}._policyDirectionEndpoint_1o0wf_467{min-width:0;font-size:11px;font-weight:500;overflow-wrap:anywhere}._policyDirectionEndpointStudio_1o0wf_474{text-align:right}._policyDirectionArrow_1o0wf_478{color:var(--accent);font-size:15px;font-weight:600;text-align:center}@media(max-width:640px){._policySummary_1o0wf_265{grid-template-columns:1fr}._policySummaryItem_1o0wf_276{grid-template-columns:minmax(112px,.8fr) minmax(0,1.2fr)}._policyScopeRow_1o0wf_425{grid-template-columns:1fr;gap:6px}._policySafetyRow_1o0wf_353{grid-template-columns:1fr;align-items:start;gap:8px;padding:10px 12px}._policySafetyRow_1o0wf_353>[data-tooltip-text]{max-width:100%;justify-self:start}._policySafetyBadge_1o0wf_371{height:auto;min-height:22px;white-space:normal;line-height:1.25;text-align:left}}._forwardBadge_1o0wf_521{display:inline-flex;align-items:center;min-height:20px;padding:2px 8px;font-size:10px;font-weight:600;letter-spacing:.04em;color:var(--text-secondary);background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius-control)}._logContainer_1o0wf_536{max-height:240px;overflow-y:auto;font-family:var(--font-code);font-size:11px}._logEntry_1o0wf_543{display:flex;gap:10px;padding:3px 0;border-bottom:1px solid var(--border);color:var(--text-primary)}._logEntry_1o0wf_543:last-child{border-bottom:none}._logTime_1o0wf_555{color:var(--text-muted);flex-shrink:0;width:44px}._logType_1o0wf_561{font-weight:500;flex-shrink:0;width:90px;text-transform:uppercase;font-size:10px;letter-spacing:.04em}._logTypeWrite_1o0wf_570{color:var(--success)}._logTypeUpdate_1o0wf_574{color:var(--accent)}._logTypeDelete_1o0wf_578{color:var(--error)}._logTypeIdle_1o0wf_582{color:var(--text-muted)}._logPath_1o0wf_586{color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._logEmpty_1o0wf_593{color:var(--text-muted);font-style:italic;padding:8px 0}._overlay_1o0wf_600{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:48px 24px;gap:16px}._overlayTitle_1o0wf_610{font-family:var(--font-label);font-size:15px;font-weight:600;color:var(--text-primary)}._overlayMessage_1o0wf_617{font-size:13px;color:var(--text-secondary);max-width:400px}._checklist_1o0wf_623{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px;text-align:left}._checkItem_1o0wf_633{font-family:var(--font-code);font-size:12px;color:var(--text-secondary);padding-left:20px;position:relative}._checkItem_1o0wf_633:before{content:"○";position:absolute;left:0;color:var(--text-muted)}._upgradePanel_1o0wf_649{background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._upgradePanelHeader_1o0wf_656{font-family:var(--font-label);font-size:13px;font-weight:600;color:var(--accent);margin-bottom:8px}._benefitList_1o0wf_664{list-style:none;padding:0;margin:0 0 12px;display:flex;flex-direction:column;gap:4px}._benefitItem_1o0wf_673{font-size:12px;color:var(--text-secondary);padding-left:16px;position:relative}._benefitItem_1o0wf_673:before{content:"+";position:absolute;left:0;color:var(--accent);font-weight:600}._upgradeActions_1o0wf_688{display:flex;gap:8px}._btn_1o0wf_693{font-family:var(--font-label);font-size:12px;padding:6px 14px;border-radius:var(--radius-control);border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._btn_1o0wf_693:hover{border-color:var(--accent);background:var(--accent-dim)}._btnPrimary_1o0wf_710{background:var(--accent);color:var(--bg-card);border-color:var(--accent)}._btnPrimary_1o0wf_710:hover{opacity:.9}._disabled_1o0wf_721{opacity:.4;pointer-events:none}
@@ -1 +1 @@
1
- import{j as s}from"./index-5nAADWD6.js";const r="_tabBar_jefog_2",_="_tabs_jefog_9",j="_actions_jefog_14",d="_tab_jefog_2",f="_tabActive_jefog_52",a={tabBar:r,tabs:_,actions:j,tab:d,tabActive:f};function u({items:n,value:c,onChange:l,ariaLabel:b,className:i,rightActions:e}){return s.jsxs("div",{className:[a.tabBar,i].filter(Boolean).join(" "),role:"tablist","aria-label":b,children:[s.jsx("div",{className:a.tabs,children:n.map(t=>{const o=t.key===c;return s.jsx("button",{type:"button",role:"tab","aria-selected":o,"data-testid":t.testId,className:[a.tab,o?a.tabActive:""].filter(Boolean).join(" "),onClick:()=>l(t.key),children:t.label},t.key)})}),e?s.jsx("div",{className:a.actions,children:e}):null]})}export{u as T};
1
+ import{j as s}from"./index-B1MZBjK4.js";const r="_tabBar_jefog_2",_="_tabs_jefog_9",j="_actions_jefog_14",d="_tab_jefog_2",f="_tabActive_jefog_52",a={tabBar:r,tabs:_,actions:j,tab:d,tabActive:f};function u({items:n,value:c,onChange:l,ariaLabel:b,className:i,rightActions:e}){return s.jsxs("div",{className:[a.tabBar,i].filter(Boolean).join(" "),role:"tablist","aria-label":b,children:[s.jsx("div",{className:a.tabs,children:n.map(t=>{const o=t.key===c;return s.jsx("button",{type:"button",role:"tab","aria-selected":o,"data-testid":t.testId,className:[a.tab,o?a.tabActive:""].filter(Boolean).join(" "),onClick:()=>l(t.key),children:t.label},t.key)})}),e?s.jsx("div",{className:a.actions,children:e}):null]})}export{u as T};
@@ -1 +1 @@
1
- import{j as s,r as n,a as O,D as nt,u as ct,e as dt,l as ut}from"./index-5nAADWD6.js";import{P as pt}from"./PageHeader-D-x0uGJu.js";import{T as M}from"./TooltipText-BAHqtajG.js";import{C as ht}from"./ConfirmModal-zVAe5VBr.js";import{C as mt}from"./CurrentPlaceScope-DeLb8cR4.js";import{T as bt}from"./Tabs-fJOR1mc6.js";import"./UiPrimitive-DGkX6nPT.js";import"./ConfirmModal.module-DJksQHBd.js";const xt="_wrapper_hzgda_2",ft="_table_hzgda_7",gt="_sortable_hzgda_32",_t="_sortArrow_hzgda_41",wt="_clickable_hzgda_52",yt="_empty_hzgda_57",Ct="_expandedRow_hzgda_65",jt="_expandedCell_hzgda_74",T={wrapper:xt,table:ft,sortable:gt,sortArrow:_t,clickable:wt,empty:yt,expandedRow:Ct,expandedCell:jt};function kt({columns:t,data:a,sortBy:x,sortDir:z="asc",onSort:P,onRowClick:i,rowKey:j,emptyMessage:k,expandedKey:B,renderExpandedRow:N}){return s.jsx("div",{className:T.wrapper,children:s.jsxs("table",{className:T.table,children:[s.jsx("thead",{children:s.jsx("tr",{children:t.map(u=>s.jsxs("th",{style:u.width?{width:u.width}:void 0,className:u.sortable?T.sortable:void 0,onClick:u.sortable&&P?()=>P(u.key):void 0,children:[s.jsx("span",{children:u.label}),u.sortable&&x===u.key&&s.jsx("span",{className:T.sortArrow,children:z==="asc"?"▴":"▾"})]},u.key))})}),s.jsx("tbody",{children:a.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:t.length,className:T.empty,children:k||"No data"})}):a.map((u,E)=>{const R=j?j(u):String(E),h=B!=null&&R===B&&N?N(u):null;return s.jsxs(n.Fragment,{children:[s.jsx("tr",{className:i?T.clickable:void 0,onClick:i?()=>i(u):void 0,children:t.map(y=>s.jsx("td",{children:y.render?y.render(u):String(u[y.key]??"")},y.key))}),h&&s.jsx("tr",{className:T.expandedRow,children:s.jsx("td",{colSpan:t.length,className:T.expandedCell,children:h})})]},R)})})]})})}function St(t){return{...t,sequenceNumber:typeof t.sequenceNumber=="number"?t.sequenceNumber:void 0,executionTimeMs:typeof t.executionTimeMs=="number"?t.executionTimeMs:void 0}}const Tt=50;function Nt(t){if(typeof t=="number")return{placeId:String(t)}}function Z(t,a){return typeof a!="number"?t:`${t}?placeId=${encodeURIComponent(String(a))}`}function vt(t){const a=(t==null?void 0:t.placeId)??null,[x,z]=n.useState(null),[P,i]=n.useState(!0),[j,k]=n.useState([]),[B,N]=n.useState(0),[u,E]=n.useState(!1),[R,w]=n.useState(!0),[h,y]=n.useState(0),[f,L]=n.useState(""),F=n.useRef(null),m=n.useCallback(async()=>{i(!0);try{const c=Nt(a),C=c?await O.get("/api/dashboard/tool-stats",c):await O.get("/api/dashboard/tool-stats");z(C)}catch{}finally{i(!1)}},[a]),_=n.useCallback(async(c,C)=>{w(!0);try{const H={limit:String(Tt),offset:String(c)};C&&(H.tool=C),typeof a=="number"&&(H.placeId=String(a));const I=await O.get("/api/dashboard/history",H);k(I.entries.map(St)),N(I.total),E(I.hasMore)}catch{k([]),N(0),E(!1)}finally{w(!1)}},[a]),U=n.useCallback(()=>{m(),_(h,f)},[_,m,h,f]),V=n.useCallback(async()=>{await O.post(Z("/api/dashboard/tools/history/clear",a)),_(h,f)},[_,h,f,a]),$=n.useCallback(async()=>{await O.post(Z("/api/dashboard/tools/statistics/clear",a)),m()},[m,a]);return n.useEffect(()=>{m()},[m]),n.useEffect(()=>{_(h,f)},[_,h,f]),n.useEffect(()=>{const c=new nt;F.current=c,c.connect();const C=c.on("command",()=>{m(),_(h,f)});return()=>{C(),c.disconnect(),F.current=null}},[_,m,h,f]),{statistics:x,statsLoading:P,history:j,historyTotal:B,historyHasMore:u,historyLoading:R,historyOffset:h,historyToolFilter:f,setHistoryOffset:y,setHistoryToolFilter:L,refresh:U,clearHistory:V,clearStatistics:$}}const Mt="_page_1wi3z_2",zt="_card_1wi3z_12",Pt="_cardToolbar_1wi3z_19",Bt="_sectionTitle_1wi3z_27",Et="_dangerButton_1wi3z_33",Rt="_proBadge_1wi3z_52",Lt="_statusOk_1wi3z_67",It="_statusFallback_1wi3z_80",At="_statusUnsupported_1wi3z_93",Ht="_statusWarning_1wi3z_106",Ot="_statusError_1wi3z_119",Ft="_tierBasic_1wi3z_133",$t="_tierPro_1wi3z_137",qt="_tierMixed_1wi3z_142",Dt="_filterRow_1wi3z_153",Wt="_filterLabel_1wi3z_160",Ut="_filterSelect_1wi3z_169",Vt="_expandedRow_1wi3z_185",Kt="_expandedSection_1wi3z_190",Gt="_detailList_1wi3z_200",Jt="_detailItem_1wi3z_206",Qt="_detailLabel_1wi3z_212",Zt="_detailValue_1wi3z_217",Xt="_pre_1wi3z_222",Yt="_pagination_1wi3z_239",te="_pageInfo_1wi3z_247",ee="_btn_1wi3z_253",se="_tierDistribution_1wi3z_281",oe="_tierBarWrap_1wi3z_285",ae="_tierBarBasic_1wi3z_293",re="_tierBarPro_1wi3z_298",le="_tierLabels_1wi3z_303",ie="_statsTableWrap_1wi3z_312",ne="_statsTable_1wi3z_312",ce="_sortableHeader_1wi3z_343",de="_sortArrow_1wi3z_348",ue="_statsToolRow_1wi3z_352",pe="_statsActionRow_1wi3z_360",he="_expandButton_1wi3z_364",me="_expandIcon_1wi3z_376",be="_actionLabel_1wi3z_381",xe="_emptyStats_1wi3z_388",fe="_summaryLine_1wi3z_394",o={page:Mt,card:zt,cardToolbar:Pt,sectionTitle:Bt,dangerButton:Et,proBadge:Rt,statusOk:Lt,statusFallback:It,statusUnsupported:At,statusWarning:Ht,statusError:Ot,tierBasic:Ft,tierPro:$t,tierMixed:qt,filterRow:Dt,filterLabel:Wt,filterSelect:Ut,expandedRow:Vt,expandedSection:Kt,detailList:Gt,detailItem:Jt,detailLabel:Qt,detailValue:Zt,pre:Xt,pagination:Yt,pageInfo:te,btn:ee,tierDistribution:se,tierBarWrap:oe,tierBarBasic:ae,tierBarPro:re,tierLabels:le,statsTableWrap:ie,statsTable:ne,sortableHeader:ce,sortArrow:de,statsToolRow:ue,statsActionRow:pe,expandButton:he,expandIcon:me,actionLabel:be,emptyStats:xe,summaryLine:fe},K=50,ge=new Set(["clientId","placeId","pinnedTarget","recentPriority","globalQueue"]);function _e(t){const a=new Date(t);return`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}:${String(a.getSeconds()).padStart(2,"0")}`}function W(t){return typeof t!="number"||!Number.isFinite(t)?"-":t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function A(t,a){return a==="pro"?t("tier.pro","Pro"):a==="mixed"?t("tier.mixed","Mixed"):t("tier.basic","Basic")}function tt(t,a){return a!==t&&a.startsWith(`${t}_`)?a.slice(t.length+1):""}function we(t,a){const x=tt(t,a);return x?`${t}.${x}`:t}function X(t){return typeof t=="string"&&t.length>0?t:void 0}function ye(t){if(!Array.isArray(t))return;const a=t.filter(x=>typeof x=="string"&&x.length>0);return a.length>0?a:void 0}function Ce(t){const a=t.result??{};return{requestedCommand:t.requestedCommand??X(a.requestedCommand),executedCommand:t.executedCommand??X(a.executedCommand),alternatives:t.alternatives??ye(a.alternatives)}}function je(t,a){switch(t.status){case"fallback":return{label:a("tools.badge.fallback","FALLBACK"),tooltip:a("tools.badge.fallback.tooltip","The requested Pro action succeeded via a Basic fallback."),className:o.statusFallback};case"unsupported":return{label:a("tools.badge.unsupported","UNSUPPORTED"),tooltip:a("tools.badge.unsupported.tooltip","The requested Pro action was blocked and no fallback ran."),className:o.statusUnsupported};case"warning":return{label:a("tools.badge.warn","WARN"),tooltip:a("tools.badge.warn.tooltip","The tool call failed as an expected caller, project, policy, or user-code issue."),className:o.statusWarning};case"error":return{label:a("tools.badge.err","FAILED"),tooltip:a("tools.badge.err.tooltip","The tool run failed."),className:o.statusError};default:return{label:a("tools.status.ok","OK"),tooltip:a("tools.status.ok.tooltip","The tool run completed successfully."),className:o.statusOk}}}function g(t,a){return s.jsxs("div",{className:o.detailItem,children:[s.jsx("span",{className:o.detailLabel,children:t}),s.jsx("span",{className:o.detailValue,children:a})]})}function ke(t){if(!t||typeof t!="object")return;const a=t;if(typeof a.selectionMode=="string"&&ge.has(a.selectionMode))return a}function Y(t){if(!(!t||typeof t!="object"||!("routing"in t)))return ke(t.routing)}function Se(t){return t.routing??Y(t.result)??Y(t.data)}function Te(t,a){return t.requestedClientId?t.requestedClientId:t.requestedPlaceId!==void 0?t.requestedPlaceId:a("tools.history.routing.none","No Studio target named")}function Ne(t){return t.actualPlaceName?`${t.actualPlaceName} · ${t.actualPlaceId??"-"}`:t.actualClientId??"-"}function Ae(){const{t}=ct(),{trackEvent:a,trackPageView:x}=dt(),[z,P]=n.useState(null),i=vt({placeId:z}),{show:j}=ut(),[k,B]=n.useState("history"),[N,u]=n.useState(null),[E,R]=n.useState(null),[w,h]=n.useState(null),[y,f]=n.useState(!1),[L,F]=n.useState("totalCalls"),[m,_]=n.useState("desc"),U=n.useCallback(e=>{F(r=>r===e?(_(l=>l==="asc"?"desc":"asc"),e):(_("desc"),e))},[]),V=n.useMemo(()=>{var r;const e=new Set;return Object.keys(((r=i.statistics)==null?void 0:r.tools)??{}).forEach(l=>e.add(l)),i.history.forEach(l=>{l.tool&&e.add(l.tool)}),i.historyToolFilter&&e.add(i.historyToolFilter),Array.from(e).sort()},[i.history,i.historyToolFilter,i.statistics]),$=n.useMemo(()=>{var e;return(e=i.statistics)!=null&&e.tools?Object.values(i.statistics.tools).map(r=>{var Q;const l=Object.entries(r.commands??{}).map(([p,d])=>({toolName:r.tool,commandName:d.command??p,label:tt(r.tool,d.command??p)||(d.command??p),tier:d.tier,totalCalls:d.totalCalls,successCount:d.successCount,fallbackCount:d.fallbackCount,unsupportedCount:d.unsupportedCount,warningCount:d.warningCount??0,failureCount:d.failureCount,totalExecutionTimeMs:d.totalExecutionTimeMs,avgExecutionTimeMs:d.avgExecutionTimeMs})),b=l.reduce((p,d)=>p+d.totalCalls,0),S=l.reduce((p,d)=>p+d.successCount,0),q=l.reduce((p,d)=>p+d.fallbackCount,0),D=l.reduce((p,d)=>p+d.unsupportedCount,0),rt=l.reduce((p,d)=>p+d.warningCount,0),lt=l.reduce((p,d)=>p+d.failureCount,0),J=l.reduce((p,d)=>p+d.totalExecutionTimeMs,0),it=new Set(l.map(p=>p.tier)).size>1?"mixed":((Q=l[0])==null?void 0:Q.tier)??r.tier;return{toolName:r.tool,tier:it,commands:l,totalCalls:b,successCount:S,fallbackCount:q,unsupportedCount:D,warningCount:rt,failureCount:lt,totalExecutionTimeMs:J,avgExecutionTimeMs:b>0?Math.round(J/b):0}}):[]},[i.statistics]),c=n.useCallback((e,r,l,b)=>s.jsx(M,{text:t(l,b),children:t(e,r)}),[t]),C=n.useMemo(()=>[...$].sort((r,l)=>{const b=r[L],S=l[L];if(typeof b=="number"&&typeof S=="number")return m==="asc"?b-S:S-b;const q=String(b??""),D=String(S??"");return m==="asc"?q.localeCompare(D):D.localeCompare(q)}),[$,L,m]),H=n.useMemo(()=>[{key:"timestamp",label:c("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:e=>_e(e.timestamp)},{key:"toolName",label:c("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:e=>s.jsxs("span",{children:[we(e.tool,e.command),e.tier==="pro"&&s.jsx(M,{text:t("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:s.jsx("span",{className:o.proBadge,children:t("tools.badge.pro","PRO")})})]})},{key:"executionTimeMs",label:c("tools.col.duration","Duration","tools.col.duration.tooltip","How long the tool took to finish."),width:"80px",render:e=>W(e.executionTimeMs)},{key:"status",label:c("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"120px",render:e=>{const r=je(e,t);return s.jsx(M,{text:r.tooltip,children:s.jsx("span",{className:r.className,children:r.label})})}},{key:"tier",label:c("tools.col.tier","Tier","tools.col.tier.tooltip","License tier required for the tool or action."),width:"60px",render:e=>s.jsx("span",{className:e.tier==="pro"?o.tierPro:o.tierBasic,children:A(t,e.tier)})}],[t,c]),I=n.useMemo(()=>[{key:"toolName",label:c("tools.col.tool","Tool","tools.col.tool.tooltip","Consolidated tool name in the statistics table."),sortable:!0},{key:"totalCalls",label:c("tools.col.calls","Calls","tools.col.calls.tooltip","Total number of recorded calls for this tool."),sortable:!0,width:"70px"},{key:"successCount",label:c("tools.col.ok","OK","tools.col.ok.tooltip","Number of direct successful runs."),sortable:!0,width:"70px"},{key:"fallbackCount",label:c("tools.col.fallback","FALLBACK","tools.col.fallback.tooltip","Number of runs that succeeded through fallback execution."),sortable:!0,width:"110px"},{key:"unsupportedCount",label:c("tools.col.unsupported","UNSUPPORTED","tools.col.unsupported.tooltip","Number of blocked runs without fallback execution."),sortable:!0,width:"130px"},{key:"warningCount",label:c("tools.col.warn","WARN","tools.col.warn.tooltip","Number of expected failures caused by caller input, project state, Roblox policy, or user code."),sortable:!0,width:"80px"},{key:"failureCount",label:c("tools.col.err","FAILED","tools.col.err.tooltip","Number of runs that failed."),sortable:!0,width:"70px"},{key:"avgExecutionTimeMs",label:c("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"90px",render:e=>W(e.avgExecutionTimeMs)},{key:"tier",label:c("tools.col.tier","Tier","tools.col.tierStats.tooltip","Basic, Pro, or Mixed summary for the tool statistics row."),sortable:!0,width:"70px",render:e=>s.jsx(M,{text:e.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:e.tier==="pro"?o.tierPro:e.tier==="mixed"?o.tierMixed:o.tierBasic,children:A(t,e.tier)})})}],[t,c]),v=n.useMemo(()=>{if(!i.statistics)return null;const e=i.statistics.tierSummary.basic.totalCalls,r=i.statistics.tierSummary.pro.totalCalls,l=e+r;if(l===0)return null;const b=Math.round(e/l*100),S=100-b;return{basic:e,pro:r,basicPct:b,proPct:S}},[i.statistics]),G=n.useCallback(e=>{R(r=>r===e?null:e)},[]),et=n.useCallback(async()=>{if(w){f(!0);try{w==="history"?await i.clearHistory():await i.clearStatistics(),j(t("toast.clearSuccess","Cleared successfully"),"success"),h(null)}catch{j(t("toast.clearFailed","Failed to clear data"),"error")}finally{f(!1)}}},[w,j,t,i]),st=n.useCallback(e=>{const r=e==="history"?"tools_history":"tools_statistics";a("dashboard_click_event",{click_target:e==="history"?"tools_tab_history":"tools_tab_statistics",page:"tools",tab:r}),x({page:"tools",tab:r}),B(e)},[a,x]),ot=n.useCallback(e=>{const r=Ce(e),l=Se(e);return s.jsxs("div",{className:o.expandedRow,children:[s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(M,{text:t("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:t("tools.detail.params","Parameters")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(e.parameters,null,2)})]}),e.result&&s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(M,{text:t("tools.detail.result.tooltip","Returned result payload for this tool run."),children:t("tools.detail.result","Result")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(e.result,null,2)})]}),l?s.jsxs("div",{className:o.expandedSection,children:[s.jsx("strong",{children:t("tools.history.routing","Routing")}),s.jsxs("div",{className:o.detailList,children:[g(t("tools.history.routing.mode","Mode"),l.selectionMode),g(t("tools.history.routing.requested","Requested"),Te(l,t)),g(t("tools.history.routing.actual","Actual"),Ne(l))]})]}):null,(e.status==="fallback"||e.status==="unsupported"||e.status==="warning"||e.status==="error")&&s.jsx("div",{className:o.expandedSection,children:s.jsxs("div",{className:o.detailList,children:[e.status==="fallback"&&(r==null?void 0:r.requestedCommand)&&g(t("tools.detail.requestedCommand","Requested Command"),r.requestedCommand),e.status==="fallback"&&(r==null?void 0:r.executedCommand)&&g(t("tools.detail.executedCommand","Executed Command"),r.executedCommand),e.status==="fallback"&&(r==null?void 0:r.alternatives)&&g(t("tools.detail.alternatives","Alternatives"),r.alternatives.join(", ")),e.status==="unsupported"&&e.blockedMessage&&g(t("tools.detail.blockedMessage","Blocked Reason"),e.blockedMessage),e.status==="unsupported"&&g(t("tools.detail.noFallback","No Fallback"),t("tools.detail.noFallback.value","No fallback ran.")),e.status==="warning"&&e.warningMessage&&g(t("tools.detail.warningMessage","Warning Message"),e.warningMessage),e.status==="error"&&e.errorMessage&&g(t("tools.detail.errorMessage","Error Message"),e.errorMessage),e.status==="error"&&e.blockedMessage&&g(t("tools.detail.blockedMessage","Blocked Reason"),e.blockedMessage),e.status==="error"&&e.fallbackCommand&&g(t("tools.detail.executedCommand","Executed Command"),e.fallbackCommand)]})})]})},[t]),at=["history","statistics"].map(e=>({key:e,label:t(`tools.tab.${e}`,e.charAt(0).toUpperCase()+e.slice(1))}));return s.jsxs("div",{className:o.page,children:[s.jsx(pt,{title:t("page.tools.title","Tools"),description:t("page.tools.description","Inspect tool history, outcomes, fallback details, and usage statistics."),helpTopicId:"tools"}),s.jsx(mt,{surface:"tools",selectable:!0,selectedPlaceId:z,onSelectedPlaceIdChange:e=>{P(e),i.setHistoryOffset(0)}}),s.jsx(bt,{items:at,value:k,onChange:st}),k==="history"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:t("tools.tab.history","History")}),s.jsx("button",{className:o.dangerButton,onClick:()=>{a("dashboard_click_event",{click_target:"tools_clear_history",page:"tools",tab:"tools_history"}),h("history")},children:t("common.clear","Clear")})]}),s.jsx("div",{className:o.filterRow,children:s.jsxs("label",{className:o.filterLabel,children:[t("tools.filter.tool","Tool"),":",s.jsxs("select",{className:o.filterSelect,value:i.historyToolFilter,onChange:e=>{i.setHistoryToolFilter(e.target.value),i.setHistoryOffset(0)},children:[s.jsx("option",{value:"",children:t("tools.filter.all","All")}),V.map(e=>s.jsx("option",{value:e,children:e},e))]})]})}),s.jsx(kt,{columns:H,data:i.history,rowKey:e=>e.id,onRowClick:e=>u(r=>r===e.id?null:e.id),emptyMessage:t("tools.empty.history","No tool history entries for this place"),expandedKey:N,renderExpandedRow:ot}),s.jsxs("div",{className:o.pagination,children:[s.jsx("button",{className:o.btn,disabled:i.historyOffset===0,title:t("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>i.setHistoryOffset(Math.max(0,i.historyOffset-K)),children:t("tools.page.prev","Prev")}),s.jsxs("span",{className:o.pageInfo,children:[i.historyOffset+1,"–",Math.min(i.historyOffset+K,i.historyTotal)," / ",i.historyTotal]}),s.jsx("button",{className:o.btn,disabled:!i.historyHasMore,title:t("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>i.setHistoryOffset(i.historyOffset+K),children:t("tools.page.next","Next")})]})]}),k==="statistics"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:t("tools.tab.statistics","Statistics")}),s.jsx("button",{className:o.dangerButton,onClick:()=>{a("dashboard_click_event",{click_target:"tools_clear_statistics",page:"tools",tab:"tools_statistics"}),h("statistics")},children:t("common.clear","Clear")})]}),v&&s.jsxs("div",{className:o.tierDistribution,children:[s.jsxs("div",{className:o.tierBarWrap,children:[s.jsx("div",{className:o.tierBarBasic,style:{width:`${v.basicPct}%`}}),s.jsx("div",{className:o.tierBarPro,style:{width:`${v.proPct}%`}})]}),s.jsxs("div",{className:o.tierLabels,children:[s.jsxs("span",{children:[A(t,"basic")," ",v.basicPct,"% (",v.basic,")"]}),s.jsxs("span",{children:[A(t,"pro")," ",v.proPct,"% (",v.pro,")"]})]})]}),s.jsx("div",{className:o.statsTableWrap,children:s.jsxs("table",{className:o.statsTable,children:[s.jsx("thead",{children:s.jsx("tr",{children:I.map(e=>s.jsxs("th",{style:e.width?{width:e.width}:void 0,className:e.sortable?o.sortableHeader:void 0,onClick:e.sortable?()=>U(e.key):void 0,children:[s.jsx("span",{children:e.label}),e.sortable&&L===e.key&&s.jsx("span",{className:o.sortArrow,children:m==="asc"?"▴":"▾"})]},e.key))})}),s.jsx("tbody",{children:C.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:I.length,className:o.emptyStats,children:t("tools.empty.stats","No tool statistics for this place")})}):C.map(e=>{const r=E===e.toolName;return s.jsxs(n.Fragment,{children:[s.jsxs("tr",{className:o.statsToolRow,onClick:()=>G(e.toolName),children:[s.jsx("td",{children:s.jsxs("button",{type:"button",className:o.expandButton,"aria-expanded":r,"aria-label":`${e.toolName} ${r?t("common.collapse","Collapse"):t("common.expand","Expand")}`,onClick:l=>{l.stopPropagation(),G(e.toolName)},children:[s.jsx("span",{className:o.expandIcon,"aria-hidden":"true",children:r?"▾":"▸"}),s.jsx("span",{children:e.toolName})]})}),s.jsx("td",{children:e.totalCalls}),s.jsx("td",{children:e.successCount}),s.jsx("td",{children:e.fallbackCount}),s.jsx("td",{children:e.unsupportedCount}),s.jsx("td",{children:e.warningCount}),s.jsx("td",{children:e.failureCount}),s.jsx("td",{children:W(e.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx(M,{text:e.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:e.tier==="pro"?o.tierPro:e.tier==="mixed"?o.tierMixed:o.tierBasic,children:A(t,e.tier)})})})]}),r&&e.commands.map(l=>s.jsxs("tr",{className:o.statsActionRow,children:[s.jsx("td",{children:s.jsx("span",{className:o.actionLabel,children:l.label})}),s.jsx("td",{children:l.totalCalls}),s.jsx("td",{children:l.successCount}),s.jsx("td",{children:l.fallbackCount}),s.jsx("td",{children:l.unsupportedCount}),s.jsx("td",{children:l.warningCount}),s.jsx("td",{children:l.failureCount}),s.jsx("td",{children:W(l.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx("span",{className:l.tier==="pro"?o.tierPro:o.tierBasic,children:A(t,l.tier)})})]},`${e.toolName}:${l.commandName}`))]},e.toolName)})})]})}),i.statistics&&s.jsxs("div",{className:o.summaryLine,children:[t("tools.summary.total","Total"),": ",i.statistics.totalCalls," ",t("tools.summary.calls","calls")," | ",t("tools.summary.sessions","Sessions"),": ",i.statistics.totalSessions]})]}),s.jsx(ht,{open:w!==null,title:w==="history"?t("tools.clear.history.title","Clear history?"):t("tools.clear.statistics.title","Clear statistics?"),message:w==="history"?t("tools.clear.history.message","This permanently removes the current place tools history."):t("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:y,onCancel:()=>!y&&h(null),onConfirm:et})]})}export{Ae as Component};
1
+ import{j as s,r as n,a as O,D as nt,u as ct,e as dt,l as ut}from"./index-B1MZBjK4.js";import{P as pt}from"./PageHeader-DezmLDg1.js";import{T as M}from"./TooltipText-CMx5IM6p.js";import{C as ht}from"./ConfirmModal-BXbkJq3w.js";import{C as mt}from"./CurrentPlaceScope-DJheb09C.js";import{T as bt}from"./Tabs-iku37C2G.js";import"./UiPrimitive-ojecpNs1.js";import"./ConfirmModal.module-DJksQHBd.js";const xt="_wrapper_hzgda_2",ft="_table_hzgda_7",gt="_sortable_hzgda_32",_t="_sortArrow_hzgda_41",wt="_clickable_hzgda_52",yt="_empty_hzgda_57",Ct="_expandedRow_hzgda_65",jt="_expandedCell_hzgda_74",T={wrapper:xt,table:ft,sortable:gt,sortArrow:_t,clickable:wt,empty:yt,expandedRow:Ct,expandedCell:jt};function kt({columns:t,data:a,sortBy:x,sortDir:z="asc",onSort:P,onRowClick:i,rowKey:j,emptyMessage:k,expandedKey:B,renderExpandedRow:N}){return s.jsx("div",{className:T.wrapper,children:s.jsxs("table",{className:T.table,children:[s.jsx("thead",{children:s.jsx("tr",{children:t.map(u=>s.jsxs("th",{style:u.width?{width:u.width}:void 0,className:u.sortable?T.sortable:void 0,onClick:u.sortable&&P?()=>P(u.key):void 0,children:[s.jsx("span",{children:u.label}),u.sortable&&x===u.key&&s.jsx("span",{className:T.sortArrow,children:z==="asc"?"▴":"▾"})]},u.key))})}),s.jsx("tbody",{children:a.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:t.length,className:T.empty,children:k||"No data"})}):a.map((u,E)=>{const R=j?j(u):String(E),h=B!=null&&R===B&&N?N(u):null;return s.jsxs(n.Fragment,{children:[s.jsx("tr",{className:i?T.clickable:void 0,onClick:i?()=>i(u):void 0,children:t.map(y=>s.jsx("td",{children:y.render?y.render(u):String(u[y.key]??"")},y.key))}),h&&s.jsx("tr",{className:T.expandedRow,children:s.jsx("td",{colSpan:t.length,className:T.expandedCell,children:h})})]},R)})})]})})}function St(t){return{...t,sequenceNumber:typeof t.sequenceNumber=="number"?t.sequenceNumber:void 0,executionTimeMs:typeof t.executionTimeMs=="number"?t.executionTimeMs:void 0}}const Tt=50;function Nt(t){if(typeof t=="number")return{placeId:String(t)}}function Z(t,a){return typeof a!="number"?t:`${t}?placeId=${encodeURIComponent(String(a))}`}function vt(t){const a=(t==null?void 0:t.placeId)??null,[x,z]=n.useState(null),[P,i]=n.useState(!0),[j,k]=n.useState([]),[B,N]=n.useState(0),[u,E]=n.useState(!1),[R,w]=n.useState(!0),[h,y]=n.useState(0),[f,L]=n.useState(""),F=n.useRef(null),m=n.useCallback(async()=>{i(!0);try{const c=Nt(a),C=c?await O.get("/api/dashboard/tool-stats",c):await O.get("/api/dashboard/tool-stats");z(C)}catch{}finally{i(!1)}},[a]),_=n.useCallback(async(c,C)=>{w(!0);try{const H={limit:String(Tt),offset:String(c)};C&&(H.tool=C),typeof a=="number"&&(H.placeId=String(a));const I=await O.get("/api/dashboard/history",H);k(I.entries.map(St)),N(I.total),E(I.hasMore)}catch{k([]),N(0),E(!1)}finally{w(!1)}},[a]),U=n.useCallback(()=>{m(),_(h,f)},[_,m,h,f]),V=n.useCallback(async()=>{await O.post(Z("/api/dashboard/tools/history/clear",a)),_(h,f)},[_,h,f,a]),$=n.useCallback(async()=>{await O.post(Z("/api/dashboard/tools/statistics/clear",a)),m()},[m,a]);return n.useEffect(()=>{m()},[m]),n.useEffect(()=>{_(h,f)},[_,h,f]),n.useEffect(()=>{const c=new nt;F.current=c,c.connect();const C=c.on("command",()=>{m(),_(h,f)});return()=>{C(),c.disconnect(),F.current=null}},[_,m,h,f]),{statistics:x,statsLoading:P,history:j,historyTotal:B,historyHasMore:u,historyLoading:R,historyOffset:h,historyToolFilter:f,setHistoryOffset:y,setHistoryToolFilter:L,refresh:U,clearHistory:V,clearStatistics:$}}const Mt="_page_1wi3z_2",zt="_card_1wi3z_12",Pt="_cardToolbar_1wi3z_19",Bt="_sectionTitle_1wi3z_27",Et="_dangerButton_1wi3z_33",Rt="_proBadge_1wi3z_52",Lt="_statusOk_1wi3z_67",It="_statusFallback_1wi3z_80",At="_statusUnsupported_1wi3z_93",Ht="_statusWarning_1wi3z_106",Ot="_statusError_1wi3z_119",Ft="_tierBasic_1wi3z_133",$t="_tierPro_1wi3z_137",qt="_tierMixed_1wi3z_142",Dt="_filterRow_1wi3z_153",Wt="_filterLabel_1wi3z_160",Ut="_filterSelect_1wi3z_169",Vt="_expandedRow_1wi3z_185",Kt="_expandedSection_1wi3z_190",Gt="_detailList_1wi3z_200",Jt="_detailItem_1wi3z_206",Qt="_detailLabel_1wi3z_212",Zt="_detailValue_1wi3z_217",Xt="_pre_1wi3z_222",Yt="_pagination_1wi3z_239",te="_pageInfo_1wi3z_247",ee="_btn_1wi3z_253",se="_tierDistribution_1wi3z_281",oe="_tierBarWrap_1wi3z_285",ae="_tierBarBasic_1wi3z_293",re="_tierBarPro_1wi3z_298",le="_tierLabels_1wi3z_303",ie="_statsTableWrap_1wi3z_312",ne="_statsTable_1wi3z_312",ce="_sortableHeader_1wi3z_343",de="_sortArrow_1wi3z_348",ue="_statsToolRow_1wi3z_352",pe="_statsActionRow_1wi3z_360",he="_expandButton_1wi3z_364",me="_expandIcon_1wi3z_376",be="_actionLabel_1wi3z_381",xe="_emptyStats_1wi3z_388",fe="_summaryLine_1wi3z_394",o={page:Mt,card:zt,cardToolbar:Pt,sectionTitle:Bt,dangerButton:Et,proBadge:Rt,statusOk:Lt,statusFallback:It,statusUnsupported:At,statusWarning:Ht,statusError:Ot,tierBasic:Ft,tierPro:$t,tierMixed:qt,filterRow:Dt,filterLabel:Wt,filterSelect:Ut,expandedRow:Vt,expandedSection:Kt,detailList:Gt,detailItem:Jt,detailLabel:Qt,detailValue:Zt,pre:Xt,pagination:Yt,pageInfo:te,btn:ee,tierDistribution:se,tierBarWrap:oe,tierBarBasic:ae,tierBarPro:re,tierLabels:le,statsTableWrap:ie,statsTable:ne,sortableHeader:ce,sortArrow:de,statsToolRow:ue,statsActionRow:pe,expandButton:he,expandIcon:me,actionLabel:be,emptyStats:xe,summaryLine:fe},K=50,ge=new Set(["clientId","placeId","pinnedTarget","recentPriority","globalQueue"]);function _e(t){const a=new Date(t);return`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}:${String(a.getSeconds()).padStart(2,"0")}`}function W(t){return typeof t!="number"||!Number.isFinite(t)?"-":t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function A(t,a){return a==="pro"?t("tier.pro","Pro"):a==="mixed"?t("tier.mixed","Mixed"):t("tier.basic","Basic")}function tt(t,a){return a!==t&&a.startsWith(`${t}_`)?a.slice(t.length+1):""}function we(t,a){const x=tt(t,a);return x?`${t}.${x}`:t}function X(t){return typeof t=="string"&&t.length>0?t:void 0}function ye(t){if(!Array.isArray(t))return;const a=t.filter(x=>typeof x=="string"&&x.length>0);return a.length>0?a:void 0}function Ce(t){const a=t.result??{};return{requestedCommand:t.requestedCommand??X(a.requestedCommand),executedCommand:t.executedCommand??X(a.executedCommand),alternatives:t.alternatives??ye(a.alternatives)}}function je(t,a){switch(t.status){case"fallback":return{label:a("tools.badge.fallback","FALLBACK"),tooltip:a("tools.badge.fallback.tooltip","The requested Pro action succeeded via a Basic fallback."),className:o.statusFallback};case"unsupported":return{label:a("tools.badge.unsupported","UNSUPPORTED"),tooltip:a("tools.badge.unsupported.tooltip","The requested Pro action was blocked and no fallback ran."),className:o.statusUnsupported};case"warning":return{label:a("tools.badge.warn","WARN"),tooltip:a("tools.badge.warn.tooltip","The tool call failed as an expected caller, project, policy, or user-code issue."),className:o.statusWarning};case"error":return{label:a("tools.badge.err","FAILED"),tooltip:a("tools.badge.err.tooltip","The tool run failed."),className:o.statusError};default:return{label:a("tools.status.ok","OK"),tooltip:a("tools.status.ok.tooltip","The tool run completed successfully."),className:o.statusOk}}}function g(t,a){return s.jsxs("div",{className:o.detailItem,children:[s.jsx("span",{className:o.detailLabel,children:t}),s.jsx("span",{className:o.detailValue,children:a})]})}function ke(t){if(!t||typeof t!="object")return;const a=t;if(typeof a.selectionMode=="string"&&ge.has(a.selectionMode))return a}function Y(t){if(!(!t||typeof t!="object"||!("routing"in t)))return ke(t.routing)}function Se(t){return t.routing??Y(t.result)??Y(t.data)}function Te(t,a){return t.requestedClientId?t.requestedClientId:t.requestedPlaceId!==void 0?t.requestedPlaceId:a("tools.history.routing.none","No Studio target named")}function Ne(t){return t.actualPlaceName?`${t.actualPlaceName} · ${t.actualPlaceId??"-"}`:t.actualClientId??"-"}function Ae(){const{t}=ct(),{trackEvent:a,trackPageView:x}=dt(),[z,P]=n.useState(null),i=vt({placeId:z}),{show:j}=ut(),[k,B]=n.useState("history"),[N,u]=n.useState(null),[E,R]=n.useState(null),[w,h]=n.useState(null),[y,f]=n.useState(!1),[L,F]=n.useState("totalCalls"),[m,_]=n.useState("desc"),U=n.useCallback(e=>{F(r=>r===e?(_(l=>l==="asc"?"desc":"asc"),e):(_("desc"),e))},[]),V=n.useMemo(()=>{var r;const e=new Set;return Object.keys(((r=i.statistics)==null?void 0:r.tools)??{}).forEach(l=>e.add(l)),i.history.forEach(l=>{l.tool&&e.add(l.tool)}),i.historyToolFilter&&e.add(i.historyToolFilter),Array.from(e).sort()},[i.history,i.historyToolFilter,i.statistics]),$=n.useMemo(()=>{var e;return(e=i.statistics)!=null&&e.tools?Object.values(i.statistics.tools).map(r=>{var Q;const l=Object.entries(r.commands??{}).map(([p,d])=>({toolName:r.tool,commandName:d.command??p,label:tt(r.tool,d.command??p)||(d.command??p),tier:d.tier,totalCalls:d.totalCalls,successCount:d.successCount,fallbackCount:d.fallbackCount,unsupportedCount:d.unsupportedCount,warningCount:d.warningCount??0,failureCount:d.failureCount,totalExecutionTimeMs:d.totalExecutionTimeMs,avgExecutionTimeMs:d.avgExecutionTimeMs})),b=l.reduce((p,d)=>p+d.totalCalls,0),S=l.reduce((p,d)=>p+d.successCount,0),q=l.reduce((p,d)=>p+d.fallbackCount,0),D=l.reduce((p,d)=>p+d.unsupportedCount,0),rt=l.reduce((p,d)=>p+d.warningCount,0),lt=l.reduce((p,d)=>p+d.failureCount,0),J=l.reduce((p,d)=>p+d.totalExecutionTimeMs,0),it=new Set(l.map(p=>p.tier)).size>1?"mixed":((Q=l[0])==null?void 0:Q.tier)??r.tier;return{toolName:r.tool,tier:it,commands:l,totalCalls:b,successCount:S,fallbackCount:q,unsupportedCount:D,warningCount:rt,failureCount:lt,totalExecutionTimeMs:J,avgExecutionTimeMs:b>0?Math.round(J/b):0}}):[]},[i.statistics]),c=n.useCallback((e,r,l,b)=>s.jsx(M,{text:t(l,b),children:t(e,r)}),[t]),C=n.useMemo(()=>[...$].sort((r,l)=>{const b=r[L],S=l[L];if(typeof b=="number"&&typeof S=="number")return m==="asc"?b-S:S-b;const q=String(b??""),D=String(S??"");return m==="asc"?q.localeCompare(D):D.localeCompare(q)}),[$,L,m]),H=n.useMemo(()=>[{key:"timestamp",label:c("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:e=>_e(e.timestamp)},{key:"toolName",label:c("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:e=>s.jsxs("span",{children:[we(e.tool,e.command),e.tier==="pro"&&s.jsx(M,{text:t("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:s.jsx("span",{className:o.proBadge,children:t("tools.badge.pro","PRO")})})]})},{key:"executionTimeMs",label:c("tools.col.duration","Duration","tools.col.duration.tooltip","How long the tool took to finish."),width:"80px",render:e=>W(e.executionTimeMs)},{key:"status",label:c("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"120px",render:e=>{const r=je(e,t);return s.jsx(M,{text:r.tooltip,children:s.jsx("span",{className:r.className,children:r.label})})}},{key:"tier",label:c("tools.col.tier","Tier","tools.col.tier.tooltip","License tier required for the tool or action."),width:"60px",render:e=>s.jsx("span",{className:e.tier==="pro"?o.tierPro:o.tierBasic,children:A(t,e.tier)})}],[t,c]),I=n.useMemo(()=>[{key:"toolName",label:c("tools.col.tool","Tool","tools.col.tool.tooltip","Consolidated tool name in the statistics table."),sortable:!0},{key:"totalCalls",label:c("tools.col.calls","Calls","tools.col.calls.tooltip","Total number of recorded calls for this tool."),sortable:!0,width:"70px"},{key:"successCount",label:c("tools.col.ok","OK","tools.col.ok.tooltip","Number of direct successful runs."),sortable:!0,width:"70px"},{key:"fallbackCount",label:c("tools.col.fallback","FALLBACK","tools.col.fallback.tooltip","Number of runs that succeeded through fallback execution."),sortable:!0,width:"110px"},{key:"unsupportedCount",label:c("tools.col.unsupported","UNSUPPORTED","tools.col.unsupported.tooltip","Number of blocked runs without fallback execution."),sortable:!0,width:"130px"},{key:"warningCount",label:c("tools.col.warn","WARN","tools.col.warn.tooltip","Number of expected failures caused by caller input, project state, Roblox policy, or user code."),sortable:!0,width:"80px"},{key:"failureCount",label:c("tools.col.err","FAILED","tools.col.err.tooltip","Number of runs that failed."),sortable:!0,width:"70px"},{key:"avgExecutionTimeMs",label:c("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"90px",render:e=>W(e.avgExecutionTimeMs)},{key:"tier",label:c("tools.col.tier","Tier","tools.col.tierStats.tooltip","Basic, Pro, or Mixed summary for the tool statistics row."),sortable:!0,width:"70px",render:e=>s.jsx(M,{text:e.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:e.tier==="pro"?o.tierPro:e.tier==="mixed"?o.tierMixed:o.tierBasic,children:A(t,e.tier)})})}],[t,c]),v=n.useMemo(()=>{if(!i.statistics)return null;const e=i.statistics.tierSummary.basic.totalCalls,r=i.statistics.tierSummary.pro.totalCalls,l=e+r;if(l===0)return null;const b=Math.round(e/l*100),S=100-b;return{basic:e,pro:r,basicPct:b,proPct:S}},[i.statistics]),G=n.useCallback(e=>{R(r=>r===e?null:e)},[]),et=n.useCallback(async()=>{if(w){f(!0);try{w==="history"?await i.clearHistory():await i.clearStatistics(),j(t("toast.clearSuccess","Cleared successfully"),"success"),h(null)}catch{j(t("toast.clearFailed","Failed to clear data"),"error")}finally{f(!1)}}},[w,j,t,i]),st=n.useCallback(e=>{const r=e==="history"?"tools_history":"tools_statistics";a("dashboard_click_event",{click_target:e==="history"?"tools_tab_history":"tools_tab_statistics",page:"tools",tab:r}),x({page:"tools",tab:r}),B(e)},[a,x]),ot=n.useCallback(e=>{const r=Ce(e),l=Se(e);return s.jsxs("div",{className:o.expandedRow,children:[s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(M,{text:t("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:t("tools.detail.params","Parameters")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(e.parameters,null,2)})]}),e.result&&s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(M,{text:t("tools.detail.result.tooltip","Returned result payload for this tool run."),children:t("tools.detail.result","Result")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(e.result,null,2)})]}),l?s.jsxs("div",{className:o.expandedSection,children:[s.jsx("strong",{children:t("tools.history.routing","Routing")}),s.jsxs("div",{className:o.detailList,children:[g(t("tools.history.routing.mode","Mode"),l.selectionMode),g(t("tools.history.routing.requested","Requested"),Te(l,t)),g(t("tools.history.routing.actual","Actual"),Ne(l))]})]}):null,(e.status==="fallback"||e.status==="unsupported"||e.status==="warning"||e.status==="error")&&s.jsx("div",{className:o.expandedSection,children:s.jsxs("div",{className:o.detailList,children:[e.status==="fallback"&&(r==null?void 0:r.requestedCommand)&&g(t("tools.detail.requestedCommand","Requested Command"),r.requestedCommand),e.status==="fallback"&&(r==null?void 0:r.executedCommand)&&g(t("tools.detail.executedCommand","Executed Command"),r.executedCommand),e.status==="fallback"&&(r==null?void 0:r.alternatives)&&g(t("tools.detail.alternatives","Alternatives"),r.alternatives.join(", ")),e.status==="unsupported"&&e.blockedMessage&&g(t("tools.detail.blockedMessage","Blocked Reason"),e.blockedMessage),e.status==="unsupported"&&g(t("tools.detail.noFallback","No Fallback"),t("tools.detail.noFallback.value","No fallback ran.")),e.status==="warning"&&e.warningMessage&&g(t("tools.detail.warningMessage","Warning Message"),e.warningMessage),e.status==="error"&&e.errorMessage&&g(t("tools.detail.errorMessage","Error Message"),e.errorMessage),e.status==="error"&&e.blockedMessage&&g(t("tools.detail.blockedMessage","Blocked Reason"),e.blockedMessage),e.status==="error"&&e.fallbackCommand&&g(t("tools.detail.executedCommand","Executed Command"),e.fallbackCommand)]})})]})},[t]),at=["history","statistics"].map(e=>({key:e,label:t(`tools.tab.${e}`,e.charAt(0).toUpperCase()+e.slice(1))}));return s.jsxs("div",{className:o.page,children:[s.jsx(pt,{title:t("page.tools.title","Tools"),description:t("page.tools.description","Inspect tool history, outcomes, fallback details, and usage statistics."),helpTopicId:"tools"}),s.jsx(mt,{surface:"tools",selectable:!0,selectedPlaceId:z,onSelectedPlaceIdChange:e=>{P(e),i.setHistoryOffset(0)}}),s.jsx(bt,{items:at,value:k,onChange:st}),k==="history"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:t("tools.tab.history","History")}),s.jsx("button",{className:o.dangerButton,onClick:()=>{a("dashboard_click_event",{click_target:"tools_clear_history",page:"tools",tab:"tools_history"}),h("history")},children:t("common.clear","Clear")})]}),s.jsx("div",{className:o.filterRow,children:s.jsxs("label",{className:o.filterLabel,children:[t("tools.filter.tool","Tool"),":",s.jsxs("select",{className:o.filterSelect,value:i.historyToolFilter,onChange:e=>{i.setHistoryToolFilter(e.target.value),i.setHistoryOffset(0)},children:[s.jsx("option",{value:"",children:t("tools.filter.all","All")}),V.map(e=>s.jsx("option",{value:e,children:e},e))]})]})}),s.jsx(kt,{columns:H,data:i.history,rowKey:e=>e.id,onRowClick:e=>u(r=>r===e.id?null:e.id),emptyMessage:t("tools.empty.history","No tool history entries for this place"),expandedKey:N,renderExpandedRow:ot}),s.jsxs("div",{className:o.pagination,children:[s.jsx("button",{className:o.btn,disabled:i.historyOffset===0,title:t("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>i.setHistoryOffset(Math.max(0,i.historyOffset-K)),children:t("tools.page.prev","Prev")}),s.jsxs("span",{className:o.pageInfo,children:[i.historyOffset+1,"–",Math.min(i.historyOffset+K,i.historyTotal)," / ",i.historyTotal]}),s.jsx("button",{className:o.btn,disabled:!i.historyHasMore,title:t("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>i.setHistoryOffset(i.historyOffset+K),children:t("tools.page.next","Next")})]})]}),k==="statistics"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:t("tools.tab.statistics","Statistics")}),s.jsx("button",{className:o.dangerButton,onClick:()=>{a("dashboard_click_event",{click_target:"tools_clear_statistics",page:"tools",tab:"tools_statistics"}),h("statistics")},children:t("common.clear","Clear")})]}),v&&s.jsxs("div",{className:o.tierDistribution,children:[s.jsxs("div",{className:o.tierBarWrap,children:[s.jsx("div",{className:o.tierBarBasic,style:{width:`${v.basicPct}%`}}),s.jsx("div",{className:o.tierBarPro,style:{width:`${v.proPct}%`}})]}),s.jsxs("div",{className:o.tierLabels,children:[s.jsxs("span",{children:[A(t,"basic")," ",v.basicPct,"% (",v.basic,")"]}),s.jsxs("span",{children:[A(t,"pro")," ",v.proPct,"% (",v.pro,")"]})]})]}),s.jsx("div",{className:o.statsTableWrap,children:s.jsxs("table",{className:o.statsTable,children:[s.jsx("thead",{children:s.jsx("tr",{children:I.map(e=>s.jsxs("th",{style:e.width?{width:e.width}:void 0,className:e.sortable?o.sortableHeader:void 0,onClick:e.sortable?()=>U(e.key):void 0,children:[s.jsx("span",{children:e.label}),e.sortable&&L===e.key&&s.jsx("span",{className:o.sortArrow,children:m==="asc"?"▴":"▾"})]},e.key))})}),s.jsx("tbody",{children:C.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:I.length,className:o.emptyStats,children:t("tools.empty.stats","No tool statistics for this place")})}):C.map(e=>{const r=E===e.toolName;return s.jsxs(n.Fragment,{children:[s.jsxs("tr",{className:o.statsToolRow,onClick:()=>G(e.toolName),children:[s.jsx("td",{children:s.jsxs("button",{type:"button",className:o.expandButton,"aria-expanded":r,"aria-label":`${e.toolName} ${r?t("common.collapse","Collapse"):t("common.expand","Expand")}`,onClick:l=>{l.stopPropagation(),G(e.toolName)},children:[s.jsx("span",{className:o.expandIcon,"aria-hidden":"true",children:r?"▾":"▸"}),s.jsx("span",{children:e.toolName})]})}),s.jsx("td",{children:e.totalCalls}),s.jsx("td",{children:e.successCount}),s.jsx("td",{children:e.fallbackCount}),s.jsx("td",{children:e.unsupportedCount}),s.jsx("td",{children:e.warningCount}),s.jsx("td",{children:e.failureCount}),s.jsx("td",{children:W(e.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx(M,{text:e.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:e.tier==="pro"?o.tierPro:e.tier==="mixed"?o.tierMixed:o.tierBasic,children:A(t,e.tier)})})})]}),r&&e.commands.map(l=>s.jsxs("tr",{className:o.statsActionRow,children:[s.jsx("td",{children:s.jsx("span",{className:o.actionLabel,children:l.label})}),s.jsx("td",{children:l.totalCalls}),s.jsx("td",{children:l.successCount}),s.jsx("td",{children:l.fallbackCount}),s.jsx("td",{children:l.unsupportedCount}),s.jsx("td",{children:l.warningCount}),s.jsx("td",{children:l.failureCount}),s.jsx("td",{children:W(l.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx("span",{className:l.tier==="pro"?o.tierPro:o.tierBasic,children:A(t,l.tier)})})]},`${e.toolName}:${l.commandName}`))]},e.toolName)})})]})}),i.statistics&&s.jsxs("div",{className:o.summaryLine,children:[t("tools.summary.total","Total"),": ",i.statistics.totalCalls," ",t("tools.summary.calls","calls")," | ",t("tools.summary.sessions","Sessions"),": ",i.statistics.totalSessions]})]}),s.jsx(ht,{open:w!==null,title:w==="history"?t("tools.clear.history.title","Clear history?"):t("tools.clear.statistics.title","Clear statistics?"),message:w==="history"?t("tools.clear.history.message","This permanently removes the current place tools history."):t("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:y,onCancel:()=>!y&&h(null),onConfirm:et})]})}export{Ae as Component};
@@ -1 +1 @@
1
- import{j as r,k as s}from"./index-5nAADWD6.js";function p({text:o,children:t}){return r.jsx(s,{text:o,children:t})}export{p as T};
1
+ import{j as r,k as s}from"./index-B1MZBjK4.js";function p({text:o,children:t}){return r.jsx(s,{text:o,children:t})}export{p as T};
@@ -1 +1 @@
1
- import{r as e,j as r}from"./index-5nAADWD6.js";const i="_button_vab4n_1",d="_iconButton_vab4n_2",v="_checkboxInput_vab4n_26",m="_button_sm_vab4n_37",p="_button_md_vab4n_42",l="_primary_vab4n_47",f="_secondary_vab4n_58",B="_ghost_vab4n_69",x="_danger_vab4n_81",g="_iconButton_sm_vab4n_104",y="_iconButton_md_vab4n_109",h="_badge_vab4n_114",j="_pill_vab4n_133",k="_interactive_vab4n_137",w="_neutral_vab4n_151",I="_accent_vab4n_157",R="_success_vab4n_163",N="_warning_vab4n_169",C="_info_vab4n_175",E="_error_vab4n_181",$="_pro_vab4n_193",n={button:i,iconButton:d,checkboxInput:v,button_sm:m,button_md:p,primary:l,secondary:f,ghost:B,danger:x,iconButton_sm:g,iconButton_md:y,badge:h,pill:j,interactive:k,neutral:w,accent:I,success:R,warning:N,info:C,error:E,pro:$};function u(...a){return a.filter(Boolean).join(" ")}const z=e.forwardRef(function({variant:t="secondary",size:_="md",className:o,type:c="button",...s},b){return r.jsx("button",{ref:b,type:c,className:u(n.button,n[t],n[`button_${_}`],o),...s})}),A=e.forwardRef(function({size:t="md",className:_,type:o="button",...c},s){return r.jsx("button",{ref:s,type:o,className:u(n.iconButton,n[`iconButton_${t}`],_),...c})}),D=e.forwardRef(function({variant:t="neutral",shape:_="square",interactive:o=!1,className:c,...s},b){return r.jsx("span",{ref:b,className:u(n.badge,n[t],_==="pill"&&n.pill,o&&n.interactive,c),...s})}),F=e.forwardRef(function({className:t,type:_,...o},c){return r.jsx("input",{ref:c,type:"checkbox",className:u(n.checkboxInput,t),...o})});export{D as B,F as C,A as I,z as a};
1
+ import{r as e,j as r}from"./index-B1MZBjK4.js";const i="_button_vab4n_1",d="_iconButton_vab4n_2",v="_checkboxInput_vab4n_26",m="_button_sm_vab4n_37",p="_button_md_vab4n_42",l="_primary_vab4n_47",f="_secondary_vab4n_58",B="_ghost_vab4n_69",x="_danger_vab4n_81",g="_iconButton_sm_vab4n_104",y="_iconButton_md_vab4n_109",h="_badge_vab4n_114",j="_pill_vab4n_133",k="_interactive_vab4n_137",w="_neutral_vab4n_151",I="_accent_vab4n_157",R="_success_vab4n_163",N="_warning_vab4n_169",C="_info_vab4n_175",E="_error_vab4n_181",$="_pro_vab4n_193",n={button:i,iconButton:d,checkboxInput:v,button_sm:m,button_md:p,primary:l,secondary:f,ghost:B,danger:x,iconButton_sm:g,iconButton_md:y,badge:h,pill:j,interactive:k,neutral:w,accent:I,success:R,warning:N,info:C,error:E,pro:$};function u(...a){return a.filter(Boolean).join(" ")}const z=e.forwardRef(function({variant:t="secondary",size:_="md",className:o,type:c="button",...s},b){return r.jsx("button",{ref:b,type:c,className:u(n.button,n[t],n[`button_${_}`],o),...s})}),A=e.forwardRef(function({size:t="md",className:_,type:o="button",...c},s){return r.jsx("button",{ref:s,type:o,className:u(n.iconButton,n[`iconButton_${t}`],_),...c})}),D=e.forwardRef(function({variant:t="neutral",shape:_="square",interactive:o=!1,className:c,...s},b){return r.jsx("span",{ref:b,className:u(n.badge,n[t],_==="pill"&&n.pill,o&&n.interactive,c),...s})}),F=e.forwardRef(function({className:t,type:_,...o},c){return r.jsx("input",{ref:c,type:"checkbox",className:u(n.checkboxInput,t),...o})});export{D as B,F as C,A as I,z as a};
@@ -1,4 +1,4 @@
1
- import{i as ve,o as V,m as Ee,r as _,u as I,j as t,e as q,R as qe,X as He,T as je,h as Ue,t as Oe}from"./index-5nAADWD6.js";import{I as D}from"./InfoLabel-DjHpz03t.js";import{T as y}from"./TooltipText-BAHqtajG.js";import{C as Fe}from"./UiPrimitive-DGkX6nPT.js";import{D as re,c as ne,e as ze,g as Ve,h as We,i as le,j as Ce,k as Ke,l as ce,d as Ye}from"./sample-requests-CCiQt0Pe.js";import{T as Qe}from"./Tabs-fJOR1mc6.js";import{P as Je}from"./PageHeader-D-x0uGJu.js";import{C as Xe}from"./CurrentPlaceScope-DeLb8cR4.js";/**
1
+ import{i as ve,o as V,m as Ee,r as _,u as I,j as t,e as q,R as qe,X as He,T as je,h as Ue,t as Oe}from"./index-B1MZBjK4.js";import{I as D}from"./InfoLabel-Cc4MKAYc.js";import{T as y}from"./TooltipText-CMx5IM6p.js";import{C as Fe}from"./UiPrimitive-ojecpNs1.js";import{D as re,c as ne,e as ze,g as Ve,h as We,i as le,j as Ce,k as Ke,l as ce,d as Ye}from"./sample-requests-DXD3uKZy.js";import{T as Qe}from"./Tabs-iku37C2G.js";import{P as Je}from"./PageHeader-DezmLDg1.js";import{C as Xe}from"./CurrentPlaceScope-DJheb09C.js";/**
2
2
  * @license lucide-react v1.8.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{u as y,j as e,L as j,H as b,r as g,J as N}from"./index-5nAADWD6.js";import{P as f}from"./PageHeader-D-x0uGJu.js";import"./UiPrimitive-DGkX6nPT.js";const k="_card_1b5wm_2",C="_cardUnread_1b5wm_15",R="_cardRead_1b5wm_20",v="_cardUnreadWarning_1b5wm_25",L="_topRow_1b5wm_32",T="_categoryChip_1b5wm_39",B="_versionChip_1b5wm_52",U="_importantBadge_1b5wm_64",S="_date_1b5wm_77",A="_title_1b5wm_85",E="_body_1b5wm_94",W="_linkList_1b5wm_102",$="_link_1b5wm_102",M="_internalLink_1b5wm_124",I="_newBadge_1b5wm_146",a={card:k,cardUnread:C,cardRead:R,cardUnreadWarning:v,topRow:L,categoryChip:T,versionChip:B,importantBadge:U,date:S,title:A,body:E,linkList:W,link:$,internalLink:M,newBadge:I},P={release:"whatsNew.category.release",notice:"whatsNew.category.notice",deprecation:"whatsNew.category.deprecation",tip:"whatsNew.category.tip"};function x({announcement:t,isNew:c}){const{locale:o,t:r}=y(),d=c?a.cardUnread:a.cardRead,l=t.severity==="warning",h=l&&c?a.cardUnreadWarning:"",m=t.title[o]??t.title.en,w=t.body[o]??t.body.en,_=t.links??(t.link?[t.link]:[]),p=s=>typeof s=="string"?s:s[o]??s.en;return e.jsxs("div",{className:`${a.card} ${d} ${h}`,children:[e.jsxs("div",{className:a.topRow,children:[e.jsx("span",{className:a.categoryChip,children:r(P[t.category])}),l&&e.jsx("span",{className:a.importantBadge,children:r("whatsNew.importantBadge","IMPORTANT")}),t.version&&e.jsx("span",{className:a.versionChip,children:t.version}),c&&e.jsx("span",{className:a.newBadge,children:r("whatsNew.newBadge","NEW")}),e.jsx("span",{className:a.date,children:t.date})]}),e.jsx("h3",{className:a.title,children:m}),e.jsx("p",{className:a.body,children:w}),_.length>0&&e.jsx("div",{className:a.linkList,children:_.map(s=>{const i=p(s.url),u=p(s.label);return i.startsWith("/")?e.jsx(j,{className:`${a.link} ${a.internalLink}`,to:i,children:u},i):e.jsxs("a",{className:a.link,href:i,target:"_blank",rel:"noopener noreferrer",children:["↗"," ",u]},i)})})]})}const z="_page_1talg_2",H="_section_1talg_10",O="_sectionTitle_1talg_16",Y="_unreadCount_1talg_28",G="_empty_1talg_43",J="_divider_1talg_51",n={page:z,section:H,sectionTitle:O,unreadCount:Y,empty:G,divider:J};function F(){const{t}=y(),{readSet:c,markRead:o}=b(),r=g.useMemo(()=>{const s=[];for(const i of N)c.has(i.id)||s.push(i.id);return s},[]),d=g.useRef(r);d.current=r,g.useEffect(()=>()=>{d.current.length>0&&o(d.current)},[]);const l=g.useMemo(()=>new Set(r),[r]),h=N.filter(s=>l.has(s.id)),m=N.filter(s=>!l.has(s.id)),w=h.length>0,_=m.length>0,p=e.jsx(f,{title:t("whatsNew.pageTitle","What's New"),description:t("whatsNew.pageSubtitle","Stay up to date with MCP changes"),helpTopicId:"whatsNew"});return N.length===0?e.jsxs("div",{className:n.page,children:[p,e.jsx("p",{className:n.empty,children:t("whatsNew.empty","No announcements yet")})]}):e.jsxs("div",{className:n.page,children:[p,w&&e.jsxs("section",{className:n.section,children:[e.jsxs("h2",{className:n.sectionTitle,children:[t("whatsNew.unreadSection","Unread"),e.jsx("span",{className:n.unreadCount,children:h.length})]}),h.map(s=>e.jsx(x,{announcement:s,isNew:!0},`unread-${s.id}`))]}),w&&_&&e.jsx("hr",{className:n.divider}),_&&e.jsxs("section",{className:n.section,children:[e.jsx("h2",{className:n.sectionTitle,children:t("whatsNew.allSection","All Announcements")}),m.map(s=>e.jsx(x,{announcement:s,isNew:!1},`all-${s.id}`))]})]})}export{F as Component};
1
+ import{u as y,j as e,L as j,H as b,r as g,J as N}from"./index-B1MZBjK4.js";import{P as f}from"./PageHeader-DezmLDg1.js";import"./UiPrimitive-ojecpNs1.js";const k="_card_1b5wm_2",C="_cardUnread_1b5wm_15",R="_cardRead_1b5wm_20",v="_cardUnreadWarning_1b5wm_25",L="_topRow_1b5wm_32",T="_categoryChip_1b5wm_39",B="_versionChip_1b5wm_52",U="_importantBadge_1b5wm_64",S="_date_1b5wm_77",A="_title_1b5wm_85",E="_body_1b5wm_94",W="_linkList_1b5wm_102",$="_link_1b5wm_102",M="_internalLink_1b5wm_124",I="_newBadge_1b5wm_146",a={card:k,cardUnread:C,cardRead:R,cardUnreadWarning:v,topRow:L,categoryChip:T,versionChip:B,importantBadge:U,date:S,title:A,body:E,linkList:W,link:$,internalLink:M,newBadge:I},P={release:"whatsNew.category.release",notice:"whatsNew.category.notice",deprecation:"whatsNew.category.deprecation",tip:"whatsNew.category.tip"};function x({announcement:t,isNew:c}){const{locale:o,t:r}=y(),d=c?a.cardUnread:a.cardRead,l=t.severity==="warning",h=l&&c?a.cardUnreadWarning:"",m=t.title[o]??t.title.en,w=t.body[o]??t.body.en,_=t.links??(t.link?[t.link]:[]),p=s=>typeof s=="string"?s:s[o]??s.en;return e.jsxs("div",{className:`${a.card} ${d} ${h}`,children:[e.jsxs("div",{className:a.topRow,children:[e.jsx("span",{className:a.categoryChip,children:r(P[t.category])}),l&&e.jsx("span",{className:a.importantBadge,children:r("whatsNew.importantBadge","IMPORTANT")}),t.version&&e.jsx("span",{className:a.versionChip,children:t.version}),c&&e.jsx("span",{className:a.newBadge,children:r("whatsNew.newBadge","NEW")}),e.jsx("span",{className:a.date,children:t.date})]}),e.jsx("h3",{className:a.title,children:m}),e.jsx("p",{className:a.body,children:w}),_.length>0&&e.jsx("div",{className:a.linkList,children:_.map(s=>{const i=p(s.url),u=p(s.label);return i.startsWith("/")?e.jsx(j,{className:`${a.link} ${a.internalLink}`,to:i,children:u},i):e.jsxs("a",{className:a.link,href:i,target:"_blank",rel:"noopener noreferrer",children:["↗"," ",u]},i)})})]})}const z="_page_1talg_2",H="_section_1talg_10",O="_sectionTitle_1talg_16",Y="_unreadCount_1talg_28",G="_empty_1talg_43",J="_divider_1talg_51",n={page:z,section:H,sectionTitle:O,unreadCount:Y,empty:G,divider:J};function F(){const{t}=y(),{readSet:c,markRead:o}=b(),r=g.useMemo(()=>{const s=[];for(const i of N)c.has(i.id)||s.push(i.id);return s},[]),d=g.useRef(r);d.current=r,g.useEffect(()=>()=>{d.current.length>0&&o(d.current)},[]);const l=g.useMemo(()=>new Set(r),[r]),h=N.filter(s=>l.has(s.id)),m=N.filter(s=>!l.has(s.id)),w=h.length>0,_=m.length>0,p=e.jsx(f,{title:t("whatsNew.pageTitle","What's New"),description:t("whatsNew.pageSubtitle","Stay up to date with MCP changes"),helpTopicId:"whatsNew"});return N.length===0?e.jsxs("div",{className:n.page,children:[p,e.jsx("p",{className:n.empty,children:t("whatsNew.empty","No announcements yet")})]}):e.jsxs("div",{className:n.page,children:[p,w&&e.jsxs("section",{className:n.section,children:[e.jsxs("h2",{className:n.sectionTitle,children:[t("whatsNew.unreadSection","Unread"),e.jsx("span",{className:n.unreadCount,children:h.length})]}),h.map(s=>e.jsx(x,{announcement:s,isNew:!0},`unread-${s.id}`))]}),w&&_&&e.jsx("hr",{className:n.divider}),_&&e.jsxs("section",{className:n.section,children:[e.jsx("h2",{className:n.sectionTitle,children:t("whatsNew.allSection","All Announcements")}),m.map(s=>e.jsx(x,{announcement:s,isNew:!1},`all-${s.id}`))]})]})}export{F as Component};
@@ -1,4 +1,4 @@
1
- import{i as c}from"./index-5nAADWD6.js";/**
1
+ import{i as c}from"./index-B1MZBjK4.js";/**
2
2
  * @license lucide-react v1.8.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.