@weppy/roblox-mcp 2.12.4 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dashboard/dist/assets/AssetsPage-BVUpssWN.css +1 -0
- package/dashboard/dist/assets/AssetsPage-CV9wxK10.js +61 -0
- package/dashboard/dist/assets/{ChangelogDetailPage-DJm43K1h.js → ChangelogDetailPage-gpaNW7UJ.js} +1 -1
- package/dashboard/dist/assets/{ChangelogPage-M0lIALvl.js → ChangelogPage-DKIsatBF.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-DLCMn2dM.js → ConfirmModal-reOnA0XQ.js} +1 -1
- package/dashboard/dist/assets/{ConnectionPage-e-YP0BDu.js → ConnectionPage-oMLfhLWb.js} +1 -1
- package/dashboard/dist/assets/{ControlsPage-DlaSStpW.js → ControlsPage-Y8OiNJre.js} +1 -1
- package/dashboard/dist/assets/{CurrentPlaceScope-DZ2orV5_.js → CurrentPlaceScope-7RO-JoyN.js} +1 -1
- package/dashboard/dist/assets/{GameChangeDetail-78Ke4Pr3.js → GameChangeDetail-D07BEk9j.js} +1 -1
- package/dashboard/dist/assets/{InfoLabel-C3n2_cRi.js → InfoLabel-mGrfFfvs.js} +1 -1
- package/dashboard/dist/assets/{OverviewPage-a_Newk4P.js → OverviewPage-BRwPqjqA.js} +1 -1
- package/dashboard/dist/assets/{PageHeader-A_rnhaxW.js → PageHeader-CKFvQ2T_.js} +2 -2
- package/dashboard/dist/assets/{PlaytestPage-CN7oefOU.js → PlaytestPage-C00WHKjP.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-C0RRWcLC.js → SettingsPage-Camuqp3Q.js} +1 -1
- package/dashboard/dist/assets/{StatusBadge-DYqnLMML.js → StatusBadge-BuYWRuwX.js} +1 -1
- package/dashboard/dist/assets/{SyncPage-CsQe96fg.js → SyncPage-pGT5Kghx.js} +1 -1
- package/dashboard/dist/assets/{Tabs--X3ZBrw-.js → Tabs-Bzvy3UJR.js} +1 -1
- package/dashboard/dist/assets/{ToolsPage-a0ReLV98.js → ToolsPage-B31Hx606.js} +1 -1
- package/dashboard/dist/assets/{TooltipText-Duhv_UBS.js → TooltipText-Vj0LEsyy.js} +1 -1
- package/dashboard/dist/assets/{UiPrimitive-Bi3cIHAa.js → UiPrimitive-tKQal2XA.js} +1 -1
- package/dashboard/dist/assets/{UiStudioPage-Bnbxjpb2.js → UiStudioPage-Dtp8HLCl.js} +1 -1
- package/dashboard/dist/assets/{WhatsNewPage-CD2k2oln.js → WhatsNewPage-BGcnIkzC.js} +1 -1
- package/dashboard/dist/assets/{copy-hmyydPjO.js → copy-DHQ0v8nJ.js} +1 -1
- package/dashboard/dist/assets/{index-je833Nom.js → index-CahJTtjv.js} +26 -26
- package/dashboard/dist/assets/{index-jDDNKuJU.css → index-CkZeRxRT.css} +1 -1
- package/dashboard/dist/assets/{sample-requests-B-6uBLqA.js → sample-requests-C1hU0rd2.js} +1 -1
- package/dashboard/dist/assets/{useLiveUptime-DcWAg-Dy.js → useLiveUptime-CcseIxAd.js} +1 -1
- package/dashboard/dist/assets/{useSettings-JrNGM1Q7.js → useSettings-CZEc0yGK.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dist/index.js +91 -91
- package/package.json +1 -1
- package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
- package/dashboard/dist/assets/AssetsPage-Czc93xoU.css +0 -1
- package/dashboard/dist/assets/AssetsPage-FUa9ddzs.js +0 -46
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as d,a as I,m as A,D as U,e as O,d as W,n as q,j as e,u as M,f as G,h as V,l as z,k as Y,T as K}from"./index-je833Nom.js";import{P as J}from"./PageHeader-A_rnhaxW.js";import{I as v}from"./InfoLabel-C3n2_cRi.js";import{T as N}from"./TooltipText-Duhv_UBS.js";import{C as H}from"./ConfirmModal-DLCMn2dM.js";import{C as $}from"./CurrentPlaceScope-DZ2orV5_.js";import{S as Q}from"./StatusBadge-DYqnLMML.js";import{B,a as D}from"./UiPrimitive-Bi3cIHAa.js";import"./ConfirmModal.module-DJksQHBd.js";const X=5e3;function Z(){const[t,a]=d.useState(null),[y,i]=d.useState([]),[g,p]=d.useState(!0),[c,_]=d.useState(null),[f,b]=d.useState(null),[o,m]=d.useState({report:null,loading:!1,applying:!1,error:null}),R=d.useRef(null),P=d.useRef(null),s=d.useCallback(async()=>{var r;try{const[l,h]=await Promise.all([I.get("/sync/status"),I.get("/api/dashboard/place-summary")]);a(l);const L=(r=h.places)==null?void 0:r.find(F=>F.isActive);return _((L==null?void 0:L.placeDirName)??null),b(h.activePlaceId),h.activePlaceId}catch{return null}},[]),k=d.useCallback(async()=>{try{const r=await I.get("/sync/history",{limit:"30"});i(r.entries??[])}catch{i([])}},[]),w=d.useCallback(async r=>{if(r===null){m({report:null,loading:!1,applying:!1,error:null});return}m(l=>({...l,loading:!0,error:null}));try{const l=await I.get("/api/sync/migration",{placeId:String(r)});m(h=>({...h,report:l,loading:!1,error:l.status==="blocked"?"migration_blocked":null}))}catch(l){if(l instanceof A&&(l.status===404||l.status===503)){m(h=>({...h,report:null,loading:!1,error:null}));return}m(h=>({...h,loading:!1,error:"unknown"}))}},[]),x=d.useCallback(async()=>{const[r]=await Promise.all([s(),k()]);await w(r),p(!1)},[s,k,w]),u=d.useCallback(()=>{x()},[x]),T=d.useCallback(async()=>{await w(f)},[f,w]),S=d.useCallback(async()=>{const r=o.report;if(!(!r||r.status!=="ready"||o.applying)){m(l=>({...l,applying:!0,error:null}));try{const l=await I.post("/api/sync/migration",{placeId:r.placeId,fromVersion:2,previewFingerprint:r.previewFingerprint,apply:!0});m({report:l,loading:!1,applying:!1,error:null}),await s()}catch(l){if(l instanceof A&&l.status===409&&(l.error==="preview_stale"||l.error==="migration_blocked")){const h=l.error;await w(r.placeId),m(L=>({...L,applying:!1,error:h}));return}m(h=>({...h,applying:!1,error:"unknown"}))}}},[w,s,o.applying,o.report]),C=d.useCallback(async()=>{await I.post("/api/dashboard/sync/history/clear"),i([]),s()},[s]);return d.useEffect(()=>(x(),P.current=setInterval(x,X),()=>{P.current&&clearInterval(P.current)}),[x]),d.useEffect(()=>{const r=new U;R.current=r,r.connect();const l=r.on("sync",()=>{x()});return()=>{l(),r.disconnect(),R.current=null}},[x]),{status:t,history:y,loading:g,activePlaceDirName:c,migration:o,refresh:u,refreshMigration:T,applyMigration:S,clearHistory:C}}const ee="_actions_1j3p3_60",te="_btn_1j3p3_68",ne="_btnPrimary_1j3p3_99",ie="_panel_1j3p3_109",se="_panelIcon_1j3p3_116",ae="_panelTitle_1j3p3_122",oe="_panelDesc_1j3p3_131",re="_benefitList_1j3p3_139",ce="_benefitItem_1j3p3_148",j={actions:ee,btn:te,btnPrimary:ne,panel:ie,panelIcon:se,panelTitle:ae,panelDesc:oe,benefitList:re,benefitItem:ce};function le({icon:t,title:a,description:y,benefits:i,upgradeLabel:g,upgradeHref:p}){const{trackEvent:c}=O(),{pathname:_,search:f}=W(),b=q(_,f);return e.jsxs("div",{className:j.panel,children:[t&&e.jsx("div",{className:j.panelIcon,children:t}),e.jsx("div",{className:j.panelTitle,children:a}),e.jsx("div",{className:j.panelDesc,children:y}),e.jsx("ul",{className:j.benefitList,children:i.map(o=>e.jsx("li",{className:j.benefitItem,children:o},o))}),e.jsx("div",{className:j.actions,children:e.jsx("a",{className:`${j.btn} ${j.btnPrimary}`,href:p,target:"_blank",rel:"noreferrer",onClick:()=>c("dashboard_click_event",{click_target:"upgrade_cta",placement:"tier_panel",...b}),children:g})})]})}const de="_page_8pvc2_2",pe="_card_8pvc2_10",ye="_cardHeader_8pvc2_17",ue="_clearButton_8pvc2_29",me="_statusRow_8pvc2_53",ge="_metaItem_8pvc2_60",he="_statusGrid_8pvc2_66",_e="_migrationPanel_8pvc2_85",fe="_migrationHeader_8pvc2_92",ve="_migrationTitle_8pvc2_99",xe="_migrationDescription_8pvc2_108",je="_migrationLedger_8pvc2_116",be="_migrationLedgerItem_8pvc2_123",we="_migrationLedgerBlocked_8pvc2_148",Ne="_migrationSection_8pvc2_152",Pe="_migrationList_8pvc2_166",Te="_migrationRow_8pvc2_176",Ie="_migrationOperation_8pvc2_189",ke="_migrationRowBody_8pvc2_194",Le="_migrationNotice_8pvc2_215",Re="_migrationActions_8pvc2_222",Se="_migrationButton_8pvc2_228",Ce="_table_8pvc2_265",Be="_deletePolicyRow_8pvc2_292",Ae="_deletePolicyBadge_8pvc2_305",$e="_directionRail_8pvc2_310",De="_endpointLabel_8pvc2_316",Ee="_optionRail_8pvc2_320",Oe="_directionOption_8pvc2_326",Me="_directionOptionActive_8pvc2_340",He="_directionOptionInactive_8pvc2_344",Fe="_direction_forward_8pvc2_350",Ue="_direction_bidirectional_8pvc2_354",We="_direction_reverse_8pvc2_358",qe="_lockBadge_8pvc2_363",Ge="_proBadge_8pvc2_371",Ve="_forwardBadge_8pvc2_385",ze="_logContainer_8pvc2_400",Ye="_logEntry_8pvc2_407",Ke="_logTime_8pvc2_419",Je="_logType_8pvc2_425",Qe="_logTypeWrite_8pvc2_434",Xe="_logTypeUpdate_8pvc2_438",Ze="_logTypeDelete_8pvc2_442",et="_logTypeIdle_8pvc2_446",tt="_logPath_8pvc2_450",nt="_logEmpty_8pvc2_457",it="_overlay_8pvc2_464",st="_overlayTitle_8pvc2_474",at="_overlayMessage_8pvc2_481",ot="_checklist_8pvc2_487",rt="_checkItem_8pvc2_497",ct="_upgradePanel_8pvc2_513",lt="_upgradePanelHeader_8pvc2_520",dt="_benefitList_8pvc2_528",pt="_benefitItem_8pvc2_537",yt="_upgradeActions_8pvc2_552",ut="_btn_8pvc2_557",mt="_btnPrimary_8pvc2_574",gt="_disabled_8pvc2_585",n={page:de,card:pe,cardHeader:ye,clearButton:ue,statusRow:me,metaItem:ge,statusGrid:he,migrationPanel:_e,migrationHeader:fe,migrationTitle:ve,migrationDescription:xe,migrationLedger:je,migrationLedgerItem:be,migrationLedgerBlocked:we,migrationSection:Ne,migrationList:Pe,migrationRow:Te,migrationOperation:Ie,migrationRowBody:ke,migrationNotice:Le,migrationActions:Re,migrationButton:Se,table:Ce,deletePolicyRow:Be,deletePolicyBadge:Ae,directionRail:$e,endpointLabel:De,optionRail:Ee,directionOption:Oe,directionOptionActive:Me,directionOptionInactive:He,direction_forward:Fe,direction_bidirectional:Ue,direction_reverse:We,lockBadge:qe,proBadge:Ge,forwardBadge:Ve,logContainer:ze,logEntry:Ye,logTime:Ke,logType:Je,logTypeWrite:Qe,logTypeUpdate:Xe,logTypeDelete:Ze,logTypeIdle:et,logPath:tt,logEmpty:nt,overlay:it,overlayTitle:st,overlayMessage:at,checklist:ot,checkItem:rt,upgradePanel:ct,upgradePanelHeader:lt,benefitList:dt,benefitItem:pt,upgradeActions:yt,btn:ut,btnPrimary:mt,disabled:gt};function ht(t){return t==="add"?"success":t==="delete"?"danger":"accent"}function _t(t){return`sync.migration.reason.${t}`}function ft(t){return`sync.migration.reason.${t}`}function vt({migration:t,onRefresh:a,onApply:y}){const{t:i}=M(),[g,p]=d.useState(!1),c=t==null?void 0:t.report;if(!t||!c||c.status==="not_required")return null;const _=c.status==="blocked",f=c.status==="ready"&&!t.loading&&!t.applying,b=async()=>{await y(),p(!1)};return e.jsxs("section",{className:`${n.card} ${n.migrationPanel}`,"aria-labelledby":"sync-migration-title",children:[e.jsxs("div",{className:n.migrationHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{id:"sync-migration-title",className:n.migrationTitle,children:i("sync.migration.title","Sync format update available")}),e.jsx("p",{className:n.migrationDescription,children:i("sync.migration.description","Review the metadata changes before updating this place from sync format v2 to v3.")})]}),e.jsx(B,{variant:_?"warning":"accent",children:_?i("sync.migration.status.blocked","Blocked"):i("sync.migration.status.ready","Ready to review")})]}),e.jsxs("div",{className:n.migrationLedger,"aria-label":i("sync.migration.preview","Review changes"),children:[e.jsxs("div",{className:n.migrationLedgerItem,children:[e.jsx("span",{children:i("sync.migration.summary.add","Add")}),e.jsx("strong",{children:c.summary.add})]}),e.jsxs("div",{className:n.migrationLedgerItem,children:[e.jsx("span",{children:i("sync.migration.summary.modify","Modify")}),e.jsx("strong",{children:c.summary.modify})]}),e.jsxs("div",{className:n.migrationLedgerItem,children:[e.jsx("span",{children:i("sync.migration.summary.delete","Delete")}),e.jsx("strong",{children:c.summary.delete})]}),e.jsxs("div",{className:`${n.migrationLedgerItem} ${_?n.migrationLedgerBlocked:""}`,children:[e.jsx("span",{children:i("sync.migration.summary.blocked","Blocked")}),e.jsx("strong",{children:c.summary.blocked})]})]}),c.changes.length>0&&e.jsxs("div",{className:n.migrationSection,children:[e.jsx("h3",{children:i("sync.migration.changes","Metadata changes")}),e.jsx("ul",{className:n.migrationList,children:c.changes.map(o=>e.jsxs("li",{className:n.migrationRow,children:[e.jsx(B,{variant:ht(o.operation),className:n.migrationOperation,children:i(`sync.migration.operation.${o.operation}`,o.operation)}),e.jsxs("div",{className:n.migrationRowBody,children:[e.jsx("code",{children:o.path}),e.jsx("span",{children:i(_t(o.reason),o.reason.replace(/_/g," "))})]})]},`${o.operation}:${o.path}`))})]}),c.blockers.length>0&&e.jsxs("div",{className:n.migrationSection,children:[e.jsx("h3",{children:i("sync.migration.blockers","Items to resolve")}),e.jsx("ul",{className:n.migrationList,children:c.blockers.map((o,m)=>e.jsxs("li",{className:n.migrationRow,children:[e.jsx(B,{variant:"warning",className:n.migrationOperation,children:i("sync.migration.summary.blocked","Blocked")}),e.jsxs("div",{className:n.migrationRowBody,children:[o.path&&e.jsx("code",{children:o.path}),e.jsx("span",{children:i(ft(o.reason),o.reason.replace(/_/g," "))})]})]},`${o.reason}:${o.path??m}`))})]}),e.jsxs("div",{className:n.migrationNotice,"aria-live":"polite",children:[(_||t.error==="migration_blocked")&&e.jsx("span",{children:i("sync.migration.blocked","Resolve sync conflicts before updating")}),t.error==="preview_stale"&&e.jsx("span",{children:i("sync.migration.stale","Preview changed. Review the latest diff.")}),t.error==="unknown"&&e.jsx("span",{children:i("sync.migration.error","Could not update the sync format. Try again.")})]}),e.jsxs("div",{className:n.migrationActions,children:[e.jsx(D,{variant:"secondary",className:n.migrationButton,disabled:t.loading||t.applying,onClick:()=>void a(),children:t.loading?i("sync.migration.refreshing","Refreshing…"):i("sync.migration.refresh","Refresh preview")}),e.jsx(D,{variant:"primary",className:n.migrationButton,disabled:!f,onClick:()=>p(!0),children:t.applying?i("sync.migration.applying","Applying…"):i("sync.migration.apply","Apply update")})]}),e.jsx(H,{open:g,title:i("sync.migration.confirm.title","Apply sync format update?"),message:i("sync.migration.confirm.message","Back up and update the listed sync metadata. Your Luau source files will not change."),cancelLabel:i("common.cancel","Cancel"),confirmLabel:i("sync.migration.apply","Apply update"),loading:t.applying,onCancel:()=>!t.applying&&p(!1),onConfirm:()=>void b()})]})}const xt=[{key:"forward",symbol:"←"},{key:"bidirectional",symbol:"↔"},{key:"reverse",symbol:"→"}];function jt(t){const a=new Date(t);return`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}`}function bt(t){switch(t){case"write":return n.logTypeWrite;case"update":return n.logTypeUpdate;case"delete":return n.logTypeDelete;default:return n.logTypeIdle}}function wt(t){switch(t){case"syncing":return"syncing";case"initializing":return"initializing";case"idle":return"idle";default:return"offline"}}function Nt(t,a,y,i){const g=t(`sync.directions.cat.${a}`,a.charAt(0).toUpperCase()+a.slice(1)),p=t("sync.directions.endpoint.local","Local"),c=t("sync.directions.endpoint.studio","Studio");switch(y){case"forward":return[`${g}: ${p} <- ${c}`,t("sync.directions.tooltip.forward.body","Studio changes sync to local files only")].join(`
|
|
1
|
+
import{r as d,a as I,m as A,D as U,e as O,d as W,n as q,j as e,u as M,f as G,h as V,l as z,k as Y,T as K}from"./index-CahJTtjv.js";import{P as J}from"./PageHeader-CKFvQ2T_.js";import{I as v}from"./InfoLabel-mGrfFfvs.js";import{T as N}from"./TooltipText-Vj0LEsyy.js";import{C as H}from"./ConfirmModal-reOnA0XQ.js";import{C as $}from"./CurrentPlaceScope-7RO-JoyN.js";import{S as Q}from"./StatusBadge-BuYWRuwX.js";import{B,a as D}from"./UiPrimitive-tKQal2XA.js";import"./ConfirmModal.module-DJksQHBd.js";const X=5e3;function Z(){const[t,a]=d.useState(null),[y,i]=d.useState([]),[g,p]=d.useState(!0),[c,_]=d.useState(null),[f,b]=d.useState(null),[o,m]=d.useState({report:null,loading:!1,applying:!1,error:null}),R=d.useRef(null),P=d.useRef(null),s=d.useCallback(async()=>{var r;try{const[l,h]=await Promise.all([I.get("/sync/status"),I.get("/api/dashboard/place-summary")]);a(l);const L=(r=h.places)==null?void 0:r.find(F=>F.isActive);return _((L==null?void 0:L.placeDirName)??null),b(h.activePlaceId),h.activePlaceId}catch{return null}},[]),k=d.useCallback(async()=>{try{const r=await I.get("/sync/history",{limit:"30"});i(r.entries??[])}catch{i([])}},[]),w=d.useCallback(async r=>{if(r===null){m({report:null,loading:!1,applying:!1,error:null});return}m(l=>({...l,loading:!0,error:null}));try{const l=await I.get("/api/sync/migration",{placeId:String(r)});m(h=>({...h,report:l,loading:!1,error:l.status==="blocked"?"migration_blocked":null}))}catch(l){if(l instanceof A&&(l.status===404||l.status===503)){m(h=>({...h,report:null,loading:!1,error:null}));return}m(h=>({...h,loading:!1,error:"unknown"}))}},[]),x=d.useCallback(async()=>{const[r]=await Promise.all([s(),k()]);await w(r),p(!1)},[s,k,w]),u=d.useCallback(()=>{x()},[x]),T=d.useCallback(async()=>{await w(f)},[f,w]),S=d.useCallback(async()=>{const r=o.report;if(!(!r||r.status!=="ready"||o.applying)){m(l=>({...l,applying:!0,error:null}));try{const l=await I.post("/api/sync/migration",{placeId:r.placeId,fromVersion:2,previewFingerprint:r.previewFingerprint,apply:!0});m({report:l,loading:!1,applying:!1,error:null}),await s()}catch(l){if(l instanceof A&&l.status===409&&(l.error==="preview_stale"||l.error==="migration_blocked")){const h=l.error;await w(r.placeId),m(L=>({...L,applying:!1,error:h}));return}m(h=>({...h,applying:!1,error:"unknown"}))}}},[w,s,o.applying,o.report]),C=d.useCallback(async()=>{await I.post("/api/dashboard/sync/history/clear"),i([]),s()},[s]);return d.useEffect(()=>(x(),P.current=setInterval(x,X),()=>{P.current&&clearInterval(P.current)}),[x]),d.useEffect(()=>{const r=new U;R.current=r,r.connect();const l=r.on("sync",()=>{x()});return()=>{l(),r.disconnect(),R.current=null}},[x]),{status:t,history:y,loading:g,activePlaceDirName:c,migration:o,refresh:u,refreshMigration:T,applyMigration:S,clearHistory:C}}const ee="_actions_1j3p3_60",te="_btn_1j3p3_68",ne="_btnPrimary_1j3p3_99",ie="_panel_1j3p3_109",se="_panelIcon_1j3p3_116",ae="_panelTitle_1j3p3_122",oe="_panelDesc_1j3p3_131",re="_benefitList_1j3p3_139",ce="_benefitItem_1j3p3_148",j={actions:ee,btn:te,btnPrimary:ne,panel:ie,panelIcon:se,panelTitle:ae,panelDesc:oe,benefitList:re,benefitItem:ce};function le({icon:t,title:a,description:y,benefits:i,upgradeLabel:g,upgradeHref:p}){const{trackEvent:c}=O(),{pathname:_,search:f}=W(),b=q(_,f);return e.jsxs("div",{className:j.panel,children:[t&&e.jsx("div",{className:j.panelIcon,children:t}),e.jsx("div",{className:j.panelTitle,children:a}),e.jsx("div",{className:j.panelDesc,children:y}),e.jsx("ul",{className:j.benefitList,children:i.map(o=>e.jsx("li",{className:j.benefitItem,children:o},o))}),e.jsx("div",{className:j.actions,children:e.jsx("a",{className:`${j.btn} ${j.btnPrimary}`,href:p,target:"_blank",rel:"noreferrer",onClick:()=>c("dashboard_click_event",{click_target:"upgrade_cta",placement:"tier_panel",...b}),children:g})})]})}const de="_page_8pvc2_2",pe="_card_8pvc2_10",ye="_cardHeader_8pvc2_17",ue="_clearButton_8pvc2_29",me="_statusRow_8pvc2_53",ge="_metaItem_8pvc2_60",he="_statusGrid_8pvc2_66",_e="_migrationPanel_8pvc2_85",fe="_migrationHeader_8pvc2_92",ve="_migrationTitle_8pvc2_99",xe="_migrationDescription_8pvc2_108",je="_migrationLedger_8pvc2_116",be="_migrationLedgerItem_8pvc2_123",we="_migrationLedgerBlocked_8pvc2_148",Ne="_migrationSection_8pvc2_152",Pe="_migrationList_8pvc2_166",Te="_migrationRow_8pvc2_176",Ie="_migrationOperation_8pvc2_189",ke="_migrationRowBody_8pvc2_194",Le="_migrationNotice_8pvc2_215",Re="_migrationActions_8pvc2_222",Se="_migrationButton_8pvc2_228",Ce="_table_8pvc2_265",Be="_deletePolicyRow_8pvc2_292",Ae="_deletePolicyBadge_8pvc2_305",$e="_directionRail_8pvc2_310",De="_endpointLabel_8pvc2_316",Ee="_optionRail_8pvc2_320",Oe="_directionOption_8pvc2_326",Me="_directionOptionActive_8pvc2_340",He="_directionOptionInactive_8pvc2_344",Fe="_direction_forward_8pvc2_350",Ue="_direction_bidirectional_8pvc2_354",We="_direction_reverse_8pvc2_358",qe="_lockBadge_8pvc2_363",Ge="_proBadge_8pvc2_371",Ve="_forwardBadge_8pvc2_385",ze="_logContainer_8pvc2_400",Ye="_logEntry_8pvc2_407",Ke="_logTime_8pvc2_419",Je="_logType_8pvc2_425",Qe="_logTypeWrite_8pvc2_434",Xe="_logTypeUpdate_8pvc2_438",Ze="_logTypeDelete_8pvc2_442",et="_logTypeIdle_8pvc2_446",tt="_logPath_8pvc2_450",nt="_logEmpty_8pvc2_457",it="_overlay_8pvc2_464",st="_overlayTitle_8pvc2_474",at="_overlayMessage_8pvc2_481",ot="_checklist_8pvc2_487",rt="_checkItem_8pvc2_497",ct="_upgradePanel_8pvc2_513",lt="_upgradePanelHeader_8pvc2_520",dt="_benefitList_8pvc2_528",pt="_benefitItem_8pvc2_537",yt="_upgradeActions_8pvc2_552",ut="_btn_8pvc2_557",mt="_btnPrimary_8pvc2_574",gt="_disabled_8pvc2_585",n={page:de,card:pe,cardHeader:ye,clearButton:ue,statusRow:me,metaItem:ge,statusGrid:he,migrationPanel:_e,migrationHeader:fe,migrationTitle:ve,migrationDescription:xe,migrationLedger:je,migrationLedgerItem:be,migrationLedgerBlocked:we,migrationSection:Ne,migrationList:Pe,migrationRow:Te,migrationOperation:Ie,migrationRowBody:ke,migrationNotice:Le,migrationActions:Re,migrationButton:Se,table:Ce,deletePolicyRow:Be,deletePolicyBadge:Ae,directionRail:$e,endpointLabel:De,optionRail:Ee,directionOption:Oe,directionOptionActive:Me,directionOptionInactive:He,direction_forward:Fe,direction_bidirectional:Ue,direction_reverse:We,lockBadge:qe,proBadge:Ge,forwardBadge:Ve,logContainer:ze,logEntry:Ye,logTime:Ke,logType:Je,logTypeWrite:Qe,logTypeUpdate:Xe,logTypeDelete:Ze,logTypeIdle:et,logPath:tt,logEmpty:nt,overlay:it,overlayTitle:st,overlayMessage:at,checklist:ot,checkItem:rt,upgradePanel:ct,upgradePanelHeader:lt,benefitList:dt,benefitItem:pt,upgradeActions:yt,btn:ut,btnPrimary:mt,disabled:gt};function ht(t){return t==="add"?"success":t==="delete"?"danger":"accent"}function _t(t){return`sync.migration.reason.${t}`}function ft(t){return`sync.migration.reason.${t}`}function vt({migration:t,onRefresh:a,onApply:y}){const{t:i}=M(),[g,p]=d.useState(!1),c=t==null?void 0:t.report;if(!t||!c||c.status==="not_required")return null;const _=c.status==="blocked",f=c.status==="ready"&&!t.loading&&!t.applying,b=async()=>{await y(),p(!1)};return e.jsxs("section",{className:`${n.card} ${n.migrationPanel}`,"aria-labelledby":"sync-migration-title",children:[e.jsxs("div",{className:n.migrationHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{id:"sync-migration-title",className:n.migrationTitle,children:i("sync.migration.title","Sync format update available")}),e.jsx("p",{className:n.migrationDescription,children:i("sync.migration.description","Review the metadata changes before updating this place from sync format v2 to v3.")})]}),e.jsx(B,{variant:_?"warning":"accent",children:_?i("sync.migration.status.blocked","Blocked"):i("sync.migration.status.ready","Ready to review")})]}),e.jsxs("div",{className:n.migrationLedger,"aria-label":i("sync.migration.preview","Review changes"),children:[e.jsxs("div",{className:n.migrationLedgerItem,children:[e.jsx("span",{children:i("sync.migration.summary.add","Add")}),e.jsx("strong",{children:c.summary.add})]}),e.jsxs("div",{className:n.migrationLedgerItem,children:[e.jsx("span",{children:i("sync.migration.summary.modify","Modify")}),e.jsx("strong",{children:c.summary.modify})]}),e.jsxs("div",{className:n.migrationLedgerItem,children:[e.jsx("span",{children:i("sync.migration.summary.delete","Delete")}),e.jsx("strong",{children:c.summary.delete})]}),e.jsxs("div",{className:`${n.migrationLedgerItem} ${_?n.migrationLedgerBlocked:""}`,children:[e.jsx("span",{children:i("sync.migration.summary.blocked","Blocked")}),e.jsx("strong",{children:c.summary.blocked})]})]}),c.changes.length>0&&e.jsxs("div",{className:n.migrationSection,children:[e.jsx("h3",{children:i("sync.migration.changes","Metadata changes")}),e.jsx("ul",{className:n.migrationList,children:c.changes.map(o=>e.jsxs("li",{className:n.migrationRow,children:[e.jsx(B,{variant:ht(o.operation),className:n.migrationOperation,children:i(`sync.migration.operation.${o.operation}`,o.operation)}),e.jsxs("div",{className:n.migrationRowBody,children:[e.jsx("code",{children:o.path}),e.jsx("span",{children:i(_t(o.reason),o.reason.replace(/_/g," "))})]})]},`${o.operation}:${o.path}`))})]}),c.blockers.length>0&&e.jsxs("div",{className:n.migrationSection,children:[e.jsx("h3",{children:i("sync.migration.blockers","Items to resolve")}),e.jsx("ul",{className:n.migrationList,children:c.blockers.map((o,m)=>e.jsxs("li",{className:n.migrationRow,children:[e.jsx(B,{variant:"warning",className:n.migrationOperation,children:i("sync.migration.summary.blocked","Blocked")}),e.jsxs("div",{className:n.migrationRowBody,children:[o.path&&e.jsx("code",{children:o.path}),e.jsx("span",{children:i(ft(o.reason),o.reason.replace(/_/g," "))})]})]},`${o.reason}:${o.path??m}`))})]}),e.jsxs("div",{className:n.migrationNotice,"aria-live":"polite",children:[(_||t.error==="migration_blocked")&&e.jsx("span",{children:i("sync.migration.blocked","Resolve sync conflicts before updating")}),t.error==="preview_stale"&&e.jsx("span",{children:i("sync.migration.stale","Preview changed. Review the latest diff.")}),t.error==="unknown"&&e.jsx("span",{children:i("sync.migration.error","Could not update the sync format. Try again.")})]}),e.jsxs("div",{className:n.migrationActions,children:[e.jsx(D,{variant:"secondary",className:n.migrationButton,disabled:t.loading||t.applying,onClick:()=>void a(),children:t.loading?i("sync.migration.refreshing","Refreshing…"):i("sync.migration.refresh","Refresh preview")}),e.jsx(D,{variant:"primary",className:n.migrationButton,disabled:!f,onClick:()=>p(!0),children:t.applying?i("sync.migration.applying","Applying…"):i("sync.migration.apply","Apply update")})]}),e.jsx(H,{open:g,title:i("sync.migration.confirm.title","Apply sync format update?"),message:i("sync.migration.confirm.message","Back up and update the listed sync metadata. Your Luau source files will not change."),cancelLabel:i("common.cancel","Cancel"),confirmLabel:i("sync.migration.apply","Apply update"),loading:t.applying,onCancel:()=>!t.applying&&p(!1),onConfirm:()=>void b()})]})}const xt=[{key:"forward",symbol:"←"},{key:"bidirectional",symbol:"↔"},{key:"reverse",symbol:"→"}];function jt(t){const a=new Date(t);return`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}`}function bt(t){switch(t){case"write":return n.logTypeWrite;case"update":return n.logTypeUpdate;case"delete":return n.logTypeDelete;default:return n.logTypeIdle}}function wt(t){switch(t){case"syncing":return"syncing";case"initializing":return"initializing";case"idle":return"idle";default:return"offline"}}function Nt(t,a,y,i){const g=t(`sync.directions.cat.${a}`,a.charAt(0).toUpperCase()+a.slice(1)),p=t("sync.directions.endpoint.local","Local"),c=t("sync.directions.endpoint.studio","Studio");switch(y){case"forward":return[`${g}: ${p} <- ${c}`,t("sync.directions.tooltip.forward.body","Studio changes sync to local files only")].join(`
|
|
2
2
|
`);case"bidirectional":return[`${g}: ${p} <-> ${c}`,t("sync.directions.tooltip.bidirectional.body","Two-way sync between Local and Studio"),i?t("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
|
|
3
3
|
`);case"reverse":return[`${g}: ${p} -> ${c}`,t("sync.directions.tooltip.reverse.body","Push local file changes to Studio"),i?t("sync.directions.tooltip.proRequired","Pro required in Basic tier"):""].filter(Boolean).join(`
|
|
4
4
|
`);default:return g}}const Pt=["scripts","values","containers","data","services"];function Tt(t,a){return a==="manual"?t("sync.directions.mode.manual","Manual"):a==="auto"?t("sync.directions.mode.auto","Auto"):"-"}function E(...t){const a=t[0]??"",y=a.includes("\\")&&!a.includes("/")?"\\":"/";return t.filter(i=>i.length>0).map((i,g)=>g===0?i.replace(/[\\/]+$/g,""):i.replace(/^[\\/]+|[\\/]+$/g,"")).join(y)}function It(t){const a=t.replace(/[\\/]+$/g,""),y=a.split(/[\\/]+/);return y[y.length-1]??a}function kt(t,a){const y=It(t);return y==="explorer"?t:y===a?E(t,"explorer"):E(t,a,"explorer")}function Lt(t,a){return a==="manual"?t("sync.directions.mode.manual.tooltip","Applies sync changes only when you trigger them manually."):a==="auto"?t("sync.directions.mode.auto.tooltip","Applies sync changes automatically when updates arrive."):""}function Rt(t,a){return a===!0?t("sync.directions.deletePolicy.auto","Auto Delete"):t("sync.directions.deletePolicy.ask","Ask Before Delete")}function St(t,a){return a===!0?t("sync.directions.deletePolicy.auto.tooltip","Deleted local files can remove matching Studio instances automatically."):t("sync.directions.deletePolicy.ask.tooltip","Deleted local files are reviewed before Studio instances are removed.")}function Ct(t,a){switch(a){case"write":return t("sync.log.type.write","WRITE");case"update":return t("sync.log.type.update","UPDATE");case"delete":return t("sync.log.type.delete","DELETE");default:return t("sync.log.type.idle","IDLE")}}function Bt(t,a){switch(a){case"write":return t("sync.log.type.write.tooltip","A new sync output was written to disk.");case"update":return t("sync.log.type.update.tooltip","An existing synced file or instance was updated.");case"delete":return t("sync.log.type.delete.tooltip","A synced file or instance was removed.");default:return t("sync.log.type.idle.tooltip","A sync event was recorded without a file mutation.")}}function Wt(){const{t}=M(),{trackEvent:a}=O(),{level:y}=G(),{tier:i,loading:g}=V(),p=Z(),{show:c}=z(),[_,f]=d.useState(!1),[b,o]=d.useState(!1),m=!g&&i==="basic",R=y==="disconnected"||y==="serverOnly",P=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:y,tier:i}});if(R)return e.jsxs("div",{className:n.page,children:[P,e.jsx($,{surface:"sync"}),e.jsx("div",{className:n.card,children:e.jsxs("div",{className:n.overlay,children:[e.jsx("div",{className:n.overlayTitle,children:t("sync.overlay.title","Roblox Studio plugin required")}),e.jsx("div",{className:n.overlayMessage,children:t("sync.overlay.message","Sync status will be available once the Roblox Studio plugin connects.")}),e.jsxs("ul",{className:n.checklist,children:[e.jsx("li",{className:n.checkItem,children:t("sync.overlay.check1","Is Roblox Studio running?")}),e.jsx("li",{className:n.checkItem,children:t("sync.overlay.check2","Is the WEPPY Plugin installed?")})]})]})})]});const s=p.status,k=p.history,w=wt(s==null?void 0:s.state),x=async()=>{o(!0);try{await p.clearHistory(),c(t("toast.clearSuccess","Cleared successfully"),"success"),f(!1)}catch{c(t("toast.clearFailed","Failed to clear data"),"error")}finally{o(!1)}};return e.jsxs("div",{className:n.page,children:[P,e.jsx($,{surface:"sync"}),e.jsxs("div",{className:n.card,children:[e.jsxs("div",{className:n.cardHeader,children:[e.jsx(N,{text:t("sync.status.title.tooltip","Current Studio and local file sync status for this place."),children:t("sync.status.title","Sync Status")}),m&&e.jsx(N,{text:t("sync.status.forwardOnly.tooltip","Basic tier allows Studio to local forward sync only."),children:e.jsx("span",{className:n.forwardBadge,children:t("sync.status.forwardOnly","Forward Only")})})]}),e.jsxs("div",{className:n.statusRow,children:[e.jsx(Q,{status:w}),(s==null?void 0:s.placeName)&&e.jsxs("span",{className:n.metaItem,children:[e.jsx(v,{label:t("sync.status.place","Place"),tooltip:t("sync.status.place.tooltip","Connected Roblox place name and place ID.")}),": ",s.placeName,s.placeId?` (${s.placeId})`:""]})]}),e.jsxs("dl",{className:n.statusGrid,children:[(s==null?void 0:s.syncRoot)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(v,{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:s.syncRoot})]}),p.activePlaceDirName&&(s==null?void 0:s.syncRoot)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(v,{label:t("sync.status.placePath","Explorer Path"),tooltip:t("sync.status.placePath.tooltip","Explorer files path for the active place.")})}),e.jsx("dd",{children:kt(s.syncRoot,p.activePlaceDirName)})]}),(s==null?void 0:s.instanceCount)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(v,{label:t("sync.status.instances","Instances"),tooltip:t("sync.status.instances.tooltip","Total synced Roblox instances tracked in the local mirror.")})}),e.jsx("dd",{children:s.instanceCount})]}),(s==null?void 0:s.scriptCount)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(v,{label:t("sync.status.scripts","Scripts"),tooltip:t("sync.status.scripts.tooltip","Total synced script files currently indexed for this place.")})}),e.jsx("dd",{children:s.scriptCount})]}),(s==null?void 0:s.state)==="syncing"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(v,{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(vt,{migration:p.migration,onRefresh:p.refreshMigration,onApply:p.applyMigration}),(s==null?void 0:s.directions)&&e.jsxs("div",{className:n.card,children:[e.jsx("div",{className:n.cardHeader,children:e.jsx(N,{text:t("sync.directions.title.tooltip","Per-category sync direction and apply behavior between Local and Studio."),children:t("sync.directions.title","Sync Directions")})}),e.jsxs("div",{className:n.deletePolicyRow,children:[e.jsx(v,{label:t("sync.directions.deletePolicy","Delete Policy"),tooltip:t("sync.directions.deletePolicy.tooltip","Controls whether local file deletes can remove matching Studio instances automatically.")}),e.jsx(N,{text:St(t,s.autoApplyDeletes),children:e.jsx(B,{variant:s.autoApplyDeletes===!0?"warning":"neutral",className:n.deletePolicyBadge,children:Rt(t,s.autoApplyDeletes)})})]}),e.jsxs("table",{className:n.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:e.jsx(v,{label:t("sync.directions.type","Type"),tooltip:t("sync.directions.type.tooltip","Sync category affected by this rule.")})}),e.jsx("th",{children:e.jsx(v,{label:t("sync.directions.direction","Direction"),tooltip:t("sync.directions.direction.tooltip","Whether each category syncs from Studio, to Studio, or both ways.")})}),e.jsx("th",{children:e.jsx(v,{label:t("sync.directions.applyMode","Apply Mode"),tooltip:t("sync.directions.applyMode.tooltip","How incoming sync changes are applied for this category.")})})]})}),e.jsx("tbody",{children:Pt.map(u=>{var C;const T=s.directions[u],S=(C=s.applyModes)==null?void 0:C[u];return e.jsxs("tr",{children:[e.jsx("td",{children:t(`sync.directions.cat.${u}`,u.charAt(0).toUpperCase()+u.slice(1))}),e.jsx("td",{children:e.jsxs("div",{className:n.directionRail,"aria-label":`${u}-direction-rail`,children:[e.jsx(N,{text:t("sync.directions.endpoint.local.tooltip","Local files on disk are always shown on the left side of the direction rail."),children:e.jsx("span",{className:n.endpointLabel,children:t("sync.directions.endpoint.local","Local")})}),e.jsx("span",{className:n.optionRail,children:xt.map(r=>e.jsx(Y,{text:Nt(t,u,r.key,m),children:e.jsx("span",{className:`${n.directionOption} ${T===r.key?n.directionOptionActive:n.directionOptionInactive} ${n[`direction_${r.key}`]??""}`,"data-active":T===r.key?"true":"false",children:r.symbol})},r.key))}),e.jsx(N,{text:t("sync.directions.endpoint.studio.tooltip","Roblox Studio is always shown on the right side of the direction rail."),children:e.jsx("span",{className:n.endpointLabel,children:t("sync.directions.endpoint.studio","Studio")})})]})}),e.jsx("td",{children:e.jsx(N,{text:Lt(t,S),children:Tt(t,S)})})]},u)})})]})]}),e.jsxs("div",{className:n.card,children:[e.jsxs("div",{className:n.cardHeader,children:[e.jsx("span",{children:t("sync.log.title","Sync Log")}),e.jsx("button",{className:n.clearButton,onClick:()=>{a("dashboard_click_event",{click_target:"sync_clear_log",page:"sync"}),f(!0)},children:t("common.clear","Clear")})]}),e.jsx("div",{className:n.logContainer,children:k.length===0?e.jsx("div",{className:n.logEmpty,children:t("sync.log.empty","No sync events yet")}):k.map((u,T)=>e.jsxs("div",{className:n.logEntry,children:[e.jsx("span",{className:n.logTime,children:jt(u.timestamp)}),e.jsx(N,{text:Bt(t,u.type),children:e.jsx("span",{className:`${n.logType} ${bt(u.type)}`,children:Ct(t,u.type)})}),e.jsxs("span",{className:n.logPath,children:[u.path,u.details?` — ${u.details}`:""]})]},T))})]}),m&&e.jsx(le,{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(H,{open:_,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:b,onCancel:()=>!b&&f(!1),onConfirm:x})]})}export{Wt as Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./index-
|
|
1
|
+
import{j as s}from"./index-CahJTtjv.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-je833Nom.js";import{P as pt}from"./PageHeader-A_rnhaxW.js";import{T as M}from"./TooltipText-Duhv_UBS.js";import{C as ht}from"./ConfirmModal-DLCMn2dM.js";import{C as mt}from"./CurrentPlaceScope-DZ2orV5_.js";import{T as bt}from"./Tabs--X3ZBrw-.js";import"./UiPrimitive-Bi3cIHAa.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-CahJTtjv.js";import{P as pt}from"./PageHeader-CKFvQ2T_.js";import{T as M}from"./TooltipText-Vj0LEsyy.js";import{C as ht}from"./ConfirmModal-reOnA0XQ.js";import{C as mt}from"./CurrentPlaceScope-7RO-JoyN.js";import{T as bt}from"./Tabs-Bzvy3UJR.js";import"./UiPrimitive-tKQal2XA.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-
|
|
1
|
+
import{j as r,k as s}from"./index-CahJTtjv.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-
|
|
1
|
+
import{r as e,j as r}from"./index-CahJTtjv.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 Se,o as q,m as Le,r as m,u as M,j as t,e as H,R as $e,X as Ee,T as fe,h as He,t as Oe}from"./index-
|
|
1
|
+
import{i as Se,o as q,m as Le,r as m,u as M,j as t,e as H,R as $e,X as Ee,T as fe,h as He,t as Oe}from"./index-CahJTtjv.js";import{I as G}from"./InfoLabel-mGrfFfvs.js";import{T as y}from"./TooltipText-Vj0LEsyy.js";import{C as Fe}from"./UiPrimitive-tKQal2XA.js";import{D as se,c as ne,e as Ue,g as ze,h as qe,i as le,j as je,k as Ve,l as ce,d as We}from"./sample-requests-C1hU0rd2.js";import{T as Ke}from"./Tabs-Bzvy3UJR.js";import{P as Qe}from"./PageHeader-CKFvQ2T_.js";import{C as Ye}from"./CurrentPlaceScope-7RO-JoyN.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,
|
|
1
|
+
import{u as y,j as e,L as j,H as b,r as g,J as N}from"./index-CahJTtjv.js";import{P as f}from"./PageHeader-CKFvQ2T_.js";import"./UiPrimitive-tKQal2XA.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};
|