@weppy/roblox-mcp 2.17.15 → 2.17.16

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 (38) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dashboard/dist/assets/{AiPromptExamples-Cwfw0ZqC.js → AiPromptExamples-BT5RrshJ.js} +1 -1
  3. package/dashboard/dist/assets/{AssetsPage-Cd1Ir_6o.js → AssetsPage-B91Jd91K.js} +1 -1
  4. package/dashboard/dist/assets/{ChangelogPage-BPP9_53U.js → ChangelogPage-D8QDjq9V.js} +1 -1
  5. package/dashboard/dist/assets/{ConfirmModal-CdZW4-sk.js → ConfirmModal-D2yw01tT.js} +1 -1
  6. package/dashboard/dist/assets/{ConnectionPage-j6oGLSEC.js → ConnectionPage-DuE65ANO.js} +1 -1
  7. package/dashboard/dist/assets/{ControlsPage-CkU_Xz6W.js → ControlsPage-Cl2JDzO5.js} +1 -1
  8. package/dashboard/dist/assets/{GameChangeDetail-BVanxiU-.js → GameChangeDetail-B-rutxUx.js} +1 -1
  9. package/dashboard/dist/assets/{InfoLabel-DuNAxesz.js → InfoLabel-DfinjjFO.js} +1 -1
  10. package/dashboard/dist/assets/{OverviewPage-DaR6Zf4N.js → OverviewPage-D_R1KBze.js} +1 -1
  11. package/dashboard/dist/assets/{PageHeader-C8RSD2wK.js → PageHeader-QiUV3oJs.js} +1 -1
  12. package/dashboard/dist/assets/{PlaceSelectOptions-B-hh23M4.js → PlaceSelectOptions-BArB7wnB.js} +1 -1
  13. package/dashboard/dist/assets/{PlaytestAiPromptExamples-CVThXrz5.js → PlaytestAiPromptExamples-BymEsVMx.js} +1 -1
  14. package/dashboard/dist/assets/{PlaytestPage-BoKMpsGY.js → PlaytestPage-xSVycgy8.js} +1 -1
  15. package/dashboard/dist/assets/{SettingsPage-Cgnm6p8V.js → SettingsPage-f3RT7b9T.js} +1 -1
  16. package/dashboard/dist/assets/SyncPage-CMHX43na.js +1 -0
  17. package/dashboard/dist/assets/SyncPage-DswNmXeG.css +1 -0
  18. package/dashboard/dist/assets/{Tabs-Br8Zgvmi.js → Tabs-Cnh4bdIv.js} +1 -1
  19. package/dashboard/dist/assets/{TierPromoPanel-BYdwzdxN.js → TierPromoPanel-DWTUB0jD.js} +1 -1
  20. package/dashboard/dist/assets/{ToolsPage-DC8hKMbq.js → ToolsPage-BWDGROg9.js} +1 -1
  21. package/dashboard/dist/assets/{TooltipText-DudXe1Qy.js → TooltipText-x86NSn8t.js} +1 -1
  22. package/dashboard/dist/assets/{UiStudioPage-DZUmNIp2.js → UiStudioPage-DruAP3cs.js} +1 -1
  23. package/dashboard/dist/assets/{WhatsNewPage-EVjYD3ti.js → WhatsNewPage-DdlnBlsD.js} +1 -1
  24. package/dashboard/dist/assets/{bot-Cud9Il_O.js → bot-SjZv9JDp.js} +1 -1
  25. package/dashboard/dist/assets/{check-CsYm1hvL.js → check-BTcudP1t.js} +1 -1
  26. package/dashboard/dist/assets/{copy-yeY7HS26.js → copy-BV32y84n.js} +1 -1
  27. package/dashboard/dist/assets/{index-CbTOKOZ5.js → index-B1SnAt0o.js} +11 -11
  28. package/dashboard/dist/assets/{rotate-ccw-CzAWuBD5.js → rotate-ccw-DFqk1Xmr.js} +1 -1
  29. package/dashboard/dist/assets/{sample-requests-Ctlw72Az.js → sample-requests-BxNYwxW0.js} +1 -1
  30. package/dashboard/dist/assets/{trash-2-BAenJavG.js → trash-2-CYsYg3as.js} +1 -1
  31. package/dashboard/dist/assets/{useLiveUptime-Dyb_GmdN.js → useLiveUptime-IBRIkiaM.js} +1 -1
  32. package/dashboard/dist/assets/{useSettings-fppB8ls5.js → useSettings-BiOxUpzD.js} +1 -1
  33. package/dashboard/dist/index.html +1 -1
  34. package/dist/index.js +250 -154
  35. package/package.json +1 -1
  36. package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
  37. package/dashboard/dist/assets/SyncPage-BeZ52U2s.css +0 -1
  38. package/dashboard/dist/assets/SyncPage-CZ3NhJOo.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weppy/roblox-mcp",
3
- "version": "2.17.15",
3
+ "version": "2.17.16",
4
4
  "description": "MCP (Model Context Protocol) server for Roblox Studio integration - enables AI coding agents to interact with Roblox Studio in real-time",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
Binary file
@@ -1 +0,0 @@
1
- ._page_188sy_2{display:flex;flex-direction:column;gap:var(--space-page);max-width:900px}._detailsStack_188sy_9{display:flex;flex-direction:column;gap:var(--space-page)}._refreshButton_188sy_15{min-height:32px;padding:4px 10px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-primary);font:inherit;font-size:12px;cursor:pointer}._refreshButton_188sy_15:hover{border-color:var(--border-highlight)}._refreshButton_188sy_15:focus-visible,._targetRow_188sy_29:focus-visible,._storedRow_188sy_30:focus-visible,._storedDisclosure_188sy_31:focus-visible{outline:none;box-shadow:var(--focus-ring)}._targetList_188sy_33,._storedList_188sy_33{display:flex;flex-direction:column;gap:4px}._targetRow_188sy_29{display:grid;width:100%;min-height:56px;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr) 132px;align-items:center;gap:12px;padding:8px 12px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-primary);font-family:var(--font-label);text-align:left;cursor:pointer}._targetRow_188sy_29:hover,._storedRow_188sy_30:hover:not(:disabled){border-color:var(--border-highlight)}._targetRowSelected_188sy_53{border-color:var(--accent)!important;background:var(--accent-dim)}._targetIdentity_188sy_54,._targetStudio_188sy_54,._targetState_188sy_54{display:flex;min-width:0;flex-direction:column;gap:3px}._targetIdentity_188sy_54>[data-tooltip-text],._targetStudio_188sy_54>[data-tooltip-text]{min-width:0;max-width:100%}._targetIdentity_188sy_54 strong{display:block;min-width:0;max-width:100%;overflow:hidden;font-size:14px;text-overflow:ellipsis;white-space:nowrap}._targetIdentity_188sy_54 span,._targetStudio_188sy_54 span,._stateNote_188sy_57{color:var(--text-secondary);font-size:11px}._targetStudio_188sy_54>[data-tooltip-text]>span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._targetState_188sy_54{align-items:flex-end;text-align:right}._storedDisclosure_188sy_31{display:flex;width:100%;align-items:center;justify-content:space-between;border:0;background:none;color:var(--text-primary);font-family:var(--font-label);font-size:var(--type-card-title-size);font-weight:600;cursor:pointer}._storedList_188sy_33{margin-top:12px}._storedRow_188sy_30{display:flex;min-height:42px;align-items:center;justify-content:space-between;gap:12px;padding:8px 12px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-primary);font:inherit;font-size:12px;text-align:left;cursor:pointer}._storedRow_188sy_30:disabled{color:var(--text-muted);cursor:default}._selectedScope_188sy_94{display:flex;min-width:0;align-items:center;flex-wrap:wrap;gap:8px;padding:9px 12px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-secondary);font-size:12px}._selectedScope_188sy_94 strong{min-width:0;color:var(--text-primary);overflow-wrap:anywhere}._selectedScope_188sy_94 span:last-child{margin-left:auto}._sharedNote_188sy_109,._emptyMessage_188sy_109{margin:8px 0 0;color:var(--text-secondary);font-size:12px;line-height:1.45}._errorMessage_188sy_110{margin:8px 0;color:var(--error-text);font-size:12px;line-height:1.45;overflow-wrap:anywhere}._card_188sy_113{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:var(--card-padding-block) var(--card-padding-inline)}._cardHeader_188sy_120{font-family:var(--font-label);font-size:var(--type-card-title-size);font-weight:600;color:var(--text-primary);margin-bottom:var(--space-section);display:flex;align-items:center;justify-content:space-between;gap:var(--space-related)}._clearButton_188sy_132{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_188sy_132:hover{background:var(--danger-hover-bg);border-color:var(--danger)}._clearButton_188sy_132:disabled{opacity:.55;cursor:not-allowed}._clearButton_188sy_132:focus-visible{outline:none;box-shadow:var(--focus-ring)}._statusRow_188sy_158{display:flex;align-items:center;gap:12px;margin-bottom:8px}._metaItem_188sy_165{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._statusGrid_188sy_171{display:grid;grid-template-columns:auto 1fr;gap:4px 16px;font-size:12px}._statusGrid_188sy_171 dt{color:var(--text-secondary);font-family:var(--font-label)}._statusGrid_188sy_171 dd{margin:0;font-family:var(--font-code);color:var(--text-primary);min-width:0;overflow-wrap:anywhere}._forwardStatusReason_188sy_191{display:block;margin-top:4px;color:var(--error-text);font-size:11px}._migrationPanel_188sy_199{display:flex;flex-direction:column;gap:16px;font-size:16px}._migrationHeader_188sy_206{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}._migrationTitle_188sy_213{margin:0;color:var(--text-primary);font-family:var(--font-label);font-size:20px;line-height:1.25;font-weight:600}._migrationDescription_188sy_222{max-width:640px;margin:8px 0 0;color:var(--text-secondary);font-size:16px;line-height:1.5}._migrationLedger_188sy_230{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--border);background:var(--bg-secondary)}._migrationLedgerItem_188sy_237{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_188sy_237:last-child{border-right:0}._migrationLedgerItem_188sy_237 strong{color:var(--text-primary);font-family:var(--font-code);font-size:20px;font-variant-numeric:tabular-nums}._migrationLedgerBlocked_188sy_262 strong{color:var(--warning-text)}._migrationSection_188sy_266{display:flex;flex-direction:column;gap:8px}._migrationSection_188sy_266 h3{margin:0;color:var(--text-secondary);font-family:var(--font-label);font-size:14px;font-weight:600}._migrationList_188sy_280{display:flex;flex-direction:column;gap:0;margin:0;padding:0;border:1px solid var(--border);list-style:none}._migrationRow_188sy_290{display:grid;grid-template-columns:84px minmax(0,1fr);align-items:start;gap:12px;padding:12px;border-bottom:1px solid var(--border)}._migrationRow_188sy_290:last-child{border-bottom:0}._migrationOperation_188sy_303{min-width:76px;text-transform:uppercase}._migrationRowBody_188sy_308{display:flex;min-width:0;flex-direction:column;gap:4px}._migrationRowBody_188sy_308 code{overflow-wrap:anywhere;color:var(--text-primary);font-family:var(--font-code);font-size:14px;line-height:1.4}._migrationRowBody_188sy_308 span{color:var(--text-secondary);font-size:14px;line-height:1.4}._migrationNotice_188sy_329{min-height:24px;color:var(--warning-text);font-size:16px;line-height:1.5}._migrationActions_188sy_336{display:flex;justify-content:flex-end;gap:8px}._migrationButton_188sy_342{min-height:44px;padding:0 16px;font-size:16px}@media(max-width:640px){._migrationHeader_188sy_206{flex-direction:column}._migrationLedger_188sy_230{grid-template-columns:repeat(2,minmax(0,1fr))}._migrationLedgerItem_188sy_237:nth-child(2){border-right:0}._migrationLedgerItem_188sy_237:nth-child(-n+2){border-bottom:1px solid var(--border)}._migrationRow_188sy_290{grid-template-columns:1fr}._migrationActions_188sy_336{flex-direction:column-reverse}._migrationButton_188sy_342{width:100%}}._policySummary_188sy_379{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_188sy_390{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_188sy_390 dt{color:var(--text-secondary);font-family:var(--font-label);font-size:12px}._policySummaryItem_188sy_390 dd{min-width:0;margin:0;color:var(--text-primary);font-family:var(--font-code);font-size:13px;overflow-wrap:anywhere}._policyPrimaryValue_188sy_415{font-family:var(--font-label)!important;font-size:16px!important;font-weight:600}._policyReviewNotice_188sy_421{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_188sy_432{margin-top:12px}._policyApplyHeader_188sy_436{margin-bottom:10px}._policyApplyTitle_188sy_440{margin:0;color:var(--text-primary);font-family:var(--font-label);font-size:14px;font-weight:600}._policyApplyDescription_188sy_448{margin:4px 0 0;color:var(--text-secondary);font-family:var(--font-label);font-size:13px;line-height:1.45}._policyInfoLabel_188sy_456{border-bottom:1px dotted var(--text-muted);cursor:help}._policyInfoLabel_188sy_456:focus-visible{outline:none;border-radius:2px;box-shadow:var(--focus-ring)}._policySafetyRow_188sy_467{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_188sy_479{color:var(--text-secondary);font-family:var(--font-label);font-size:12px}._policySafetyBadge_188sy_485{min-height:22px}._policyDisclosure_188sy_489{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_188sy_489:hover{border-color:var(--border-highlight);background:var(--bg-secondary);color:var(--accent)}._policyDisclosure_188sy_489:focus-visible{outline:none;box-shadow:var(--focus-ring)}._policyDisclosureIcon_188sy_521{flex:0 0 auto;color:var(--text-muted);font-family:var(--font-code);transition:transform var(--transition)}._policyDisclosureIconOpen_188sy_528{transform:rotate(180deg)}._policyScopeList_188sy_532{margin-top:8px;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-control)}._policyScopeRow_188sy_539{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_188sy_539:last-child{border-bottom:0}._policyScopeName_188sy_553{min-width:0;color:var(--text-secondary);font-family:var(--font-label);font-size:13px;overflow-wrap:anywhere}._policyScopeRow_188sy_539>[data-tooltip-text]{width:100%}._policyDirectionRail_188sy_565{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_188sy_565:focus-visible{outline:none;border-radius:2px;box-shadow:var(--focus-ring)}._policyDirectionEndpoint_188sy_581{min-width:0;font-size:11px;font-weight:500;overflow-wrap:anywhere}._policyDirectionEndpointStudio_188sy_588{text-align:right}._policyDirectionArrow_188sy_592{color:var(--accent);font-size:15px;font-weight:600;text-align:center}@media(max-width:640px){._policySummary_188sy_379{grid-template-columns:1fr}._policySummaryItem_188sy_390{grid-template-columns:minmax(112px,.8fr) minmax(0,1.2fr)}._policyScopeRow_188sy_539{grid-template-columns:1fr;gap:6px}._policySafetyRow_188sy_467{grid-template-columns:1fr;align-items:start;gap:8px;padding:10px 12px}._policySafetyRow_188sy_467>[data-tooltip-text]{max-width:100%;justify-self:start}._policySafetyBadge_188sy_485{height:auto;min-height:22px;white-space:normal;line-height:1.25;text-align:left}}._forwardBadge_188sy_635{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_188sy_650{max-height:240px;overflow-y:auto;font-family:var(--font-code);font-size:11px}._logEntry_188sy_657{display:flex;gap:10px;padding:3px 0;border-bottom:1px solid var(--border);color:var(--text-primary)}._logEntry_188sy_657:last-child{border-bottom:none}._logTime_188sy_669{color:var(--text-muted);flex-shrink:0;width:44px}._logType_188sy_675{font-weight:500;flex-shrink:0;width:90px;text-transform:uppercase;font-size:10px;letter-spacing:.04em}._logTypeWrite_188sy_684{color:var(--success)}._logTypeUpdate_188sy_688{color:var(--accent)}._logTypeDelete_188sy_692{color:var(--error)}._logTypeIdle_188sy_696{color:var(--text-muted)}._logPath_188sy_700{color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._logEmpty_188sy_707{color:var(--text-muted);font-style:italic;padding:8px 0}._overlay_188sy_714{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:48px 24px;gap:16px}._overlayTitle_188sy_724{font-family:var(--font-label);font-size:15px;font-weight:600;color:var(--text-primary)}._overlayMessage_188sy_731{font-size:13px;color:var(--text-secondary);max-width:400px}._checklist_188sy_737{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px;text-align:left}._checkItem_188sy_747{font-family:var(--font-code);font-size:12px;color:var(--text-secondary);padding-left:20px;position:relative}._checkItem_188sy_747:before{content:"○";position:absolute;left:0;color:var(--text-muted)}._upgradePanel_188sy_763{background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._upgradePanelHeader_188sy_770{font-family:var(--font-label);font-size:13px;font-weight:600;color:var(--accent);margin-bottom:8px}._benefitList_188sy_778{list-style:none;padding:0;margin:0 0 12px;display:flex;flex-direction:column;gap:4px}._benefitItem_188sy_787{font-size:12px;color:var(--text-secondary);padding-left:16px;position:relative}._benefitItem_188sy_787:before{content:"+";position:absolute;left:0;color:var(--accent);font-weight:600}._upgradeActions_188sy_802{display:flex;gap:8px}._btn_188sy_807{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_188sy_807:hover{border-color:var(--accent);background:var(--accent-dim)}._btnPrimary_188sy_824{background:var(--accent);color:var(--bg-card);border-color:var(--accent)}._btnPrimary_188sy_824:hover{opacity:.9}._disabled_188sy_835{opacity:.4;pointer-events:none}
@@ -1 +0,0 @@
1
- import{r as d,b as q,h as ee,D as le,u as ie,j as e,a as de,d as pe,e as ye,k as ue,T as ge}from"./index-CbTOKOZ5.js";import{B as E,a as te,P as me}from"./PageHeader-C8RSD2wK.js";import{I as G}from"./InfoLabel-DuNAxesz.js";import{T as D}from"./TooltipText-DudXe1Qy.js";import{C as oe}from"./ConfirmModal-CdZW4-sk.js";import{T as he}from"./TierPromoPanel-BYdwzdxN.js";import"./ConfirmModal.module-DJksQHBd.js";const fe=5e3,T={report:null,loading:!1,applying:!1,error:null};function Se(t,i){if(i===null)return null;const m=t.filter(c=>c.placeId===i);return m.length===1?m[0]:i===0?null:m.find(c=>c.folderStatus==="canonical")??null}function ce(t,i){if(i===null||!Number.isSafeInteger(i)||i<0)return!1;const m=t.filter(c=>c.placeId===i);return i===0?m.length===1:m.length===0||m.some(c=>c.folderStatus==="canonical")}function X(t,i){return i.placeId<=0||!Number.isSafeInteger(i.placeId)?!1:ce(t,i.placeId)&&(i.folderStatus==="canonical"||t.filter(m=>m.placeId===i.placeId).length===1)}function _e(){const[t,i]=d.useState([]),[m,c]=d.useState(null),[r,n]=d.useState(null),[f,j]=d.useState(!0),[P,F]=d.useState(null),[h,A]=d.useState([]),[J,M]=d.useState(!1),[Q,H]=d.useState(null),[u,p]=d.useState(T),R=d.useRef(0),l=d.useRef(0),k=d.useRef(null),O=d.useRef(!1),x=d.useRef(null),b=d.useRef(new Set),C=d.useCallback(async()=>{const a=++R.current;try{const[g,y]=await Promise.all([q.get("/api/dashboard/sync/targets"),q.get("/api/dashboard/place-summary")]);if(a!==R.current)return;i(g.targets??[]),c(y),F(null)}catch(g){if(a!==R.current)return;i([]),c(null),F(g instanceof Error?g.message:String(g))}finally{a===R.current&&j(!1)}},[]),w=d.useMemo(()=>(m==null?void 0:m.places)??[],[m]),Y=d.useMemo(()=>new Set(t.map(a=>a.placeId).filter(a=>typeof a=="number")),[t]),B=d.useMemo(()=>w.filter(a=>a.placeId===0||!Y.has(a.placeId)),[Y,w]);d.useEffect(()=>{f||P||n(a=>{if((a==null?void 0:a.kind)==="target"&&t.some(y=>y.clientId===a.clientId)||(a==null?void 0:a.kind)==="stored"&&B.some(y=>y.placeId===a.placeId&&y.placeDirName===a.placeDirName&&X(w,y)))return a;if(t[0])return{kind:"target",clientId:t[0].clientId};const g=B.find(y=>X(w,y));return g?{kind:"stored",placeId:g.placeId,placeDirName:g.placeDirName}:null})},[f,w,P,B,t]);const U=(r==null?void 0:r.kind)==="target"?t.find(a=>a.clientId===r.clientId)??null:null,S=(U==null?void 0:U.placeId)??((r==null?void 0:r.kind)==="stored"?r.placeId:null),V=(r==null?void 0:r.kind)==="stored"?B.find(a=>a.placeId===r.placeId&&a.placeDirName===r.placeDirName)??null:Se(w,S),v=(r==null?void 0:r.kind)==="stored"?V!==null&&X(w,V):ce(w,S),W=(r==null?void 0:r.kind)==="target"?`target:${r.clientId}:${S??"none"}`:(r==null?void 0:r.kind)==="stored"?`stored:${r.placeDirName}`:null;k.current=S,O.current=v,x.current=W;const L=d.useCallback(async(a,g,y=!1)=>{if(a===null){p(T);return}if(!(y&&x.current!==null&&b.current.has(x.current))){y||p({...T,loading:!0});try{const _=await q.get("/api/sync/migration",{placeId:String(a)});if(g!==l.current||x.current!==null&&b.current.has(x.current))return;p({...T,report:_,applying:x.current!==null&&b.current.has(x.current),error:_.status==="blocked"?"migration_blocked":null})}catch(_){if(g!==l.current||x.current!==null&&b.current.has(x.current))return;_ instanceof ee&&(_.status===404||_.status===503)?p(T):p({...T,error:"unknown"})}}},[]),I=d.useCallback(async(a,g,y=!1)=>{const _=++l.current;if(y||(A([]),H(null),p(T)),a===null||!g){M(!1);return}y||M(!0);const Z=q.get("/api/dashboard/sync/history",{placeId:String(a),limit:"30"}).then(K=>{_===l.current&&(A(K.entries??[]),H(null))}).catch(K=>{_===l.current&&H(K instanceof Error?K.message:String(K))}).finally(()=>{_===l.current&&M(!1)});await Promise.all([Z,L(a,_,y)])},[L]);d.useEffect(()=>(I(S,v),()=>{l.current+=1}),[I,S,v,(r==null?void 0:r.kind)==="target"?r.clientId:r==null?void 0:r.placeDirName]);const o=d.useCallback(()=>{C(),I(S,v)},[I,C,S,v]),N=d.useCallback(async()=>{v&&await L(S,l.current)},[L,S,v]),$=d.useCallback(async()=>{const a=u.report;if(!a||a.status!=="ready"||u.applying||!v||a.placeId!==S)return;const g=x.current;if(!(g===null||b.current.has(g))){b.current.add(g),p(y=>({...y,applying:!0,error:null}));try{const y=await q.post("/api/sync/migration",{placeId:a.placeId,fromVersion:2,previewFingerprint:a.previewFingerprint,apply:!0});if(b.current.delete(g),x.current!==g||k.current!==a.placeId)return;p({...T,report:y}),C()}catch(y){if(b.current.delete(g),x.current!==g||k.current!==a.placeId)return;if(y instanceof ee&&y.status===409&&(y.error==="preview_stale"||y.error==="migration_blocked")){if(await L(a.placeId,l.current),x.current!==g||k.current!==a.placeId)return;p(_=>({..._,applying:!1,error:y.error}))}else p(_=>({..._,applying:!1,error:"unknown"}))}}},[L,C,u,S,v]),z=d.useCallback(async a=>{if((await q.post(`/api/dashboard/sync/history/clear?placeId=${encodeURIComponent(String(a))}`)).placeId!==a)throw new Error("Cleared Place differs from the confirmed Place.");k.current===a&&O.current&&I(a,!0)},[I]);d.useEffect(()=>{C();const a=()=>{C(),k.current!==null&&O.current&&I(k.current,!0,!0)},g=setInterval(a,fe),y=new le;y.connect();const _=y.on("sync",a),Z=y.on("connection",a);return()=>{clearInterval(g),_(),Z(),y.disconnect(),R.current+=1}},[I,C]);const re=u.report&&u.report.placeId!==S?T:{...u,applying:u.applying||W!==null&&b.current.has(W)};return{targets:t,places:w,selection:r,selectedTarget:U,selectedPlace:V,selectedPlaceId:S,storageSafe:v,history:h,historyLoading:J,historyError:Q,loading:f,snapshotError:P,migration:re,selectTarget:a=>n({kind:"target",clientId:a}),selectStored:a=>n({kind:"stored",placeId:a.placeId,placeDirName:a.placeDirName}),refresh:o,refreshMigration:N,applyMigration:$,clearHistory:z}}const xe="_page_188sy_2",je="_detailsStack_188sy_9",we="_refreshButton_188sy_15",ve="_targetRow_188sy_29",Ne="_storedRow_188sy_30",be="_storedDisclosure_188sy_31",Ie="_targetList_188sy_33",Re="_storedList_188sy_33",ke="_targetRowSelected_188sy_53",De="_targetIdentity_188sy_54",Pe="_targetStudio_188sy_54",Ce="_targetState_188sy_54",Le="_stateNote_188sy_57",Te="_selectedScope_188sy_94",Ee="_sharedNote_188sy_109",Ae="_emptyMessage_188sy_109",Be="_errorMessage_188sy_110",Fe="_card_188sy_113",Me="_cardHeader_188sy_120",Oe="_clearButton_188sy_132",$e="_statusRow_188sy_158",He="_metaItem_188sy_165",Ue="_statusGrid_188sy_171",Ve="_forwardStatusReason_188sy_191",We="_migrationPanel_188sy_199",qe="_migrationHeader_188sy_206",Ke="_migrationTitle_188sy_213",Ge="_migrationDescription_188sy_222",Ye="_migrationLedger_188sy_230",ze="_migrationLedgerItem_188sy_237",Xe="_migrationLedgerBlocked_188sy_262",Je="_migrationSection_188sy_266",Qe="_migrationList_188sy_280",Ze="_migrationRow_188sy_290",et="_migrationOperation_188sy_303",tt="_migrationRowBody_188sy_308",st="_migrationNotice_188sy_329",nt="_migrationActions_188sy_336",at="_migrationButton_188sy_342",it="_policySummary_188sy_379",ot="_policySummaryItem_188sy_390",ct="_policyPrimaryValue_188sy_415",rt="_policyReviewNotice_188sy_421",lt="_policyApplySection_188sy_432",dt="_policyApplyHeader_188sy_436",pt="_policyApplyTitle_188sy_440",yt="_policyApplyDescription_188sy_448",ut="_policyInfoLabel_188sy_456",gt="_policySafetyRow_188sy_467",mt="_policySafetyLabel_188sy_479",ht="_policySafetyBadge_188sy_485",ft="_policyDisclosure_188sy_489",St="_policyDisclosureIcon_188sy_521",_t="_policyDisclosureIconOpen_188sy_528",xt="_policyScopeList_188sy_532",jt="_policyScopeRow_188sy_539",wt="_policyScopeName_188sy_553",vt="_policyDirectionRail_188sy_565",Nt="_policyDirectionEndpoint_188sy_581",bt="_policyDirectionEndpointStudio_188sy_588",It="_policyDirectionArrow_188sy_592",Rt="_forwardBadge_188sy_635",kt="_logContainer_188sy_650",Dt="_logEntry_188sy_657",Pt="_logTime_188sy_669",Ct="_logType_188sy_675",Lt="_logTypeWrite_188sy_684",Tt="_logTypeUpdate_188sy_688",Et="_logTypeDelete_188sy_692",At="_logTypeIdle_188sy_696",Bt="_logPath_188sy_700",Ft="_logEmpty_188sy_707",s={page:xe,detailsStack:je,refreshButton:we,targetRow:ve,storedRow:Ne,storedDisclosure:be,targetList:Ie,storedList:Re,targetRowSelected:ke,targetIdentity:De,targetStudio:Pe,targetState:Ce,stateNote:Le,selectedScope:Te,sharedNote:Ee,emptyMessage:Ae,errorMessage:Be,card:Fe,cardHeader:Me,clearButton:Oe,statusRow:$e,metaItem:He,statusGrid:Ue,forwardStatusReason:Ve,migrationPanel:We,migrationHeader:qe,migrationTitle:Ke,migrationDescription:Ge,migrationLedger:Ye,migrationLedgerItem:ze,migrationLedgerBlocked:Xe,migrationSection:Je,migrationList:Qe,migrationRow:Ze,migrationOperation:et,migrationRowBody:tt,migrationNotice:st,migrationActions:nt,migrationButton:at,policySummary:it,policySummaryItem:ot,policyPrimaryValue:ct,policyReviewNotice:rt,policyApplySection:lt,policyApplyHeader:dt,policyApplyTitle:pt,policyApplyDescription:yt,policyInfoLabel:ut,policySafetyRow:gt,policySafetyLabel:mt,policySafetyBadge:ht,policyDisclosure:ft,policyDisclosureIcon:St,policyDisclosureIconOpen:_t,policyScopeList:xt,policyScopeRow:jt,policyScopeName:wt,policyDirectionRail:vt,policyDirectionEndpoint:Nt,policyDirectionEndpointStudio:bt,policyDirectionArrow:It,forwardBadge:Rt,logContainer:kt,logEntry:Dt,logTime:Pt,logType:Ct,logTypeWrite:Lt,logTypeUpdate:Tt,logTypeDelete:Et,logTypeIdle:At,logPath:Bt,logEmpty:Ft};function Mt(t){return t==="add"?"success":t==="delete"?"danger":"accent"}function Ot(t){return`sync.migration.reason.${t}`}function $t(t){return`sync.migration.reason.${t}`}function Ht({migration:t,onRefresh:i,onApply:m}){const{t:c}=ie(),[r,n]=d.useState(!1),f=t==null?void 0:t.report;if(!t||!f||f.status==="not_required")return null;const j=f.status==="blocked",P=f.status==="ready"&&!t.loading&&!t.applying,F=async()=>{await m(),n(!1)};return e.jsxs("section",{className:`${s.card} ${s.migrationPanel}`,"aria-labelledby":"sync-migration-title",children:[e.jsxs("div",{className:s.migrationHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{id:"sync-migration-title",className:s.migrationTitle,children:c("sync.migration.title","Sync format update available")}),e.jsx("p",{className:s.migrationDescription,children:c("sync.migration.description","Review the metadata changes before updating this place from sync format v2 to v3.")})]}),e.jsx(E,{variant:j?"warning":"accent",children:j?c("sync.migration.status.blocked","Blocked"):c("sync.migration.status.ready","Ready to review")})]}),e.jsxs("div",{className:s.migrationLedger,"aria-label":c("sync.migration.preview","Review changes"),children:[e.jsxs("div",{className:s.migrationLedgerItem,children:[e.jsx("span",{children:c("sync.migration.summary.add","Add")}),e.jsx("strong",{children:f.summary.add})]}),e.jsxs("div",{className:s.migrationLedgerItem,children:[e.jsx("span",{children:c("sync.migration.summary.modify","Modify")}),e.jsx("strong",{children:f.summary.modify})]}),e.jsxs("div",{className:s.migrationLedgerItem,children:[e.jsx("span",{children:c("sync.migration.summary.delete","Delete")}),e.jsx("strong",{children:f.summary.delete})]}),e.jsxs("div",{className:`${s.migrationLedgerItem} ${j?s.migrationLedgerBlocked:""}`,children:[e.jsx("span",{children:c("sync.migration.summary.blocked","Blocked")}),e.jsx("strong",{children:f.summary.blocked})]})]}),f.changes.length>0&&e.jsxs("div",{className:s.migrationSection,children:[e.jsx("h3",{children:c("sync.migration.changes","Metadata changes")}),e.jsx("ul",{className:s.migrationList,children:f.changes.map(h=>e.jsxs("li",{className:s.migrationRow,children:[e.jsx(E,{variant:Mt(h.operation),className:s.migrationOperation,children:c(`sync.migration.operation.${h.operation}`,h.operation)}),e.jsxs("div",{className:s.migrationRowBody,children:[e.jsx("code",{children:h.path}),e.jsx("span",{children:c(Ot(h.reason),h.reason.replace(/_/g," "))})]})]},`${h.operation}:${h.path}`))})]}),f.blockers.length>0&&e.jsxs("div",{className:s.migrationSection,children:[e.jsx("h3",{children:c("sync.migration.blockers","Items to resolve")}),e.jsx("ul",{className:s.migrationList,children:f.blockers.map((h,A)=>e.jsxs("li",{className:s.migrationRow,children:[e.jsx(E,{variant:"warning",className:s.migrationOperation,children:c("sync.migration.summary.blocked","Blocked")}),e.jsxs("div",{className:s.migrationRowBody,children:[h.path&&e.jsx("code",{children:h.path}),e.jsx("span",{children:c($t(h.reason),h.reason.replace(/_/g," "))})]})]},`${h.reason}:${h.path??A}`))})]}),e.jsxs("div",{className:s.migrationNotice,"aria-live":"polite",children:[(j||t.error==="migration_blocked")&&e.jsx("span",{children:c("sync.migration.blocked","Resolve sync conflicts before updating")}),t.error==="preview_stale"&&e.jsx("span",{children:c("sync.migration.stale","Preview changed. Review the latest diff.")}),t.error==="unknown"&&e.jsx("span",{children:c("sync.migration.error","Could not update the sync format. Try again.")})]}),e.jsxs("div",{className:s.migrationActions,children:[e.jsx(te,{variant:"secondary",className:s.migrationButton,disabled:t.loading||t.applying,onClick:()=>void i(),children:t.loading?c("sync.migration.refreshing","Refreshing…"):c("sync.migration.refresh","Refresh preview")}),e.jsx(te,{variant:"primary",className:s.migrationButton,disabled:!P,onClick:()=>n(!0),children:t.applying?c("sync.migration.applying","Applying…"):c("sync.migration.apply","Apply update")})]}),e.jsx(oe,{open:r,title:c("sync.migration.confirm.title","Apply sync format update?"),message:c("sync.migration.confirm.message","Back up and update the listed sync metadata. Your Luau source files will not change."),cancelLabel:c("common.cancel","Cancel"),confirmLabel:c("sync.migration.apply","Apply update"),loading:t.applying,onCancel:()=>!t.applying&&n(!1),onConfirm:()=>void F()})]})}const Ut=["scriptSource","properties","structure","serviceProperties"];function Vt(t){const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function Wt(t){switch(t){case"fullSyncComplete":case"write":return s.logTypeWrite;case"fullSyncStart":case"fullSyncProgress":case"update":return s.logTypeUpdate;case"fullSyncFailed":case"delete":return s.logTypeDelete;default:return s.logTypeIdle}}const se={unknown:"neutral",off:"neutral",idle:"neutral",initializing:"info",syncing:"success",paused:"warning",error:"error"},ne={unknown:"Unknown",off:"Sync OFF",idle:"Waiting",initializing:"Initializing",syncing:"Syncing",paused:"Paused",error:"Error"},qt={inactive:"Change sending off",active:"Change sending enabled",paused_play:"Paused for Play",reconciling:"Checking Edit changes",blocked:"Changes need attention",unknown:"Sending status unknown"},Kt={inactive:"neutral",active:"success",paused_play:"warning",reconciling:"info",blocked:"error",unknown:"neutral"};function Gt(t,i){switch(i){case"conflict_review":case"manual_review":return t("sync.forwardStatus.reason.review","Review changes in the Studio Plugin.");case"edit_changed_during_reconciliation":return t("sync.forwardStatus.reason.editChanged","Edit changed during the check. Inspect Sync in the Studio Plugin.");case"pre_check_failed":case"reverse_apply_failed":case"reconciliation_failed":case"sync_error":case"update_failed":case"acknowledgement_missing":case"ACK_EXPIRED":case"ACK_ID_REUSED":case"SYNC_DIRECTION_REVERSE":return t("sync.forwardStatus.reason.failed","Changes could not be confirmed. Inspect Sync in the Studio Plugin.");default:return t("sync.forwardStatus.reason.fallback","Check the Studio Plugin for details.")}}function Yt(t,i){const m={studio_first:"Studio First",bidirectional_review:"Bidirectional",local_code_studio_world:"Local Code, Studio World",custom:"Custom"};return t(`sync.policy.preset.${i}`,m[i])}function ae(t,i){return i==="auto"?t("sync.policy.apply.auto","Auto apply"):t("sync.policy.apply.manual","Review first")}function zt(t,i){const m={forward:"Studio → Local",reverse:"Local → Studio",bidirectional:"Both ways"};return t(`sync.policy.direction.${i}`,m[i])}function Xt(t){return{forward:"←",reverse:"→",bidirectional:"⇄"}[t]}function Jt(t,i){const m={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.${i}.tooltip`,m[i])}function Qt(t,i){return i?t("sync.policy.safety.auto","Auto delete to Studio"):t("sync.policy.safety.review","Review before delete")}function Zt(t,i){return i?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 es(t,i){switch(i){case"fullSyncStart":return t("sync.log.type.fullSyncStart","START");case"fullSyncProgress":return t("sync.log.type.fullSyncProgress","PROGRESS");case"fullSyncComplete":return t("sync.log.type.fullSyncComplete","COMPLETE");case"fullSyncFailed":return t("sync.log.type.fullSyncFailed","FAILED");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 ts(t,i){switch(i){case"fullSyncStart":return t("sync.log.type.fullSyncStart.tooltip","Full Sync started.");case"fullSyncProgress":return t("sync.log.type.fullSyncProgress.tooltip","Full Sync is saving the snapshot.");case"fullSyncComplete":return t("sync.log.type.fullSyncComplete.tooltip","Full Sync completed successfully.");case"fullSyncFailed":return t("sync.log.type.fullSyncFailed.tooltip","Full Sync ended without completing the snapshot.");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 ls(){var S,V,v,W,L,I;const{t}=ie(),{trackEvent:i}=de(),{level:m}=pe(),{tier:c,loading:r}=ye(),n=_e(),{show:f}=ue(),[j,P]=d.useState(null),[F,h]=d.useState(!1),[A,J]=d.useState(!1),[M,Q]=d.useState(!1),H=!r&&c==="basic",u=n.selectedTarget,p=u==null?void 0:u.sync,R=(p==null?void 0:p.forwardSyncStatus)??"unknown",l=u?{...u.sync.status,syncEnabled:u.sync.syncEnabled,policy:u.sync.policy,policyCapabilities:u.sync.policyCapabilities,policyReviewRequired:u.sync.policyReviewRequired}:null,k=(u==null?void 0:u.placeName)??((S=n.selectedPlace)==null?void 0:S.placeName)??t("sync.targets.unknownPlace","Unknown place"),O=n.selectedPlaceId===null?k:k+" · "+n.selectedPlaceId,x=n.storageSafe?(l==null?void 0:l.instanceCount)??((V=n.selectedPlace)==null?void 0:V.instanceCount):null,b=n.storageSafe?(l==null?void 0:l.scriptCount)??((v=n.selectedPlace)==null?void 0:v.scriptCount):null,C=new Set(n.targets.map(o=>o.placeId)),w=n.places.filter(o=>o.placeId===0||!C.has(o.placeId)),Y=e.jsx(me,{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:m,tier:c}}),B=n.history,U=async()=>{if(j){h(!0);try{await n.clearHistory(j.placeId),f(t("toast.clearSuccess","Cleared successfully"),"success"),P(null)}catch{f(t("toast.clearFailed","Failed to clear data"),"error")}finally{h(!1)}}};return e.jsxs("div",{className:s.page,children:[Y,e.jsxs("section",{className:s.card,"aria-label":t("sync.targets.title","Connected Studios"),children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsxs("span",{children:[t("sync.targets.title","Connected Studios")," (",n.targets.length,")"]}),e.jsx("button",{type:"button",className:s.refreshButton,onClick:n.refresh,children:t("sync.targets.refresh","Refresh")})]}),n.loading?e.jsx("p",{className:s.emptyMessage,children:t("sync.targets.loading","Loading Studio Sync status…")}):n.snapshotError?e.jsxs("p",{className:s.errorMessage,role:"alert",children:[t("sync.targets.unavailable","Studio Sync status is unavailable. Retry to check the current state.")," ",n.snapshotError]}):n.targets.length===0?e.jsx("p",{className:s.emptyMessage,children:t("sync.targets.empty","No Studio is connected. Connect the WEPPY Plugin to see live Sync status.")}):e.jsx("div",{className:s.targetList,children:n.targets.map(o=>{var $;const N=(($=n.selection)==null?void 0:$.kind)==="target"&&n.selection.clientId===o.clientId;return e.jsxs("button",{type:"button",className:`${s.targetRow} ${N?s.targetRowSelected:""}`,"aria-pressed":N,onClick:()=>n.selectTarget(o.clientId),children:[e.jsxs("span",{className:s.targetIdentity,children:[e.jsx(D,{text:o.placeName||t("sync.targets.unknownPlace","Unknown place"),children:e.jsx("strong",{children:o.placeName||t("sync.targets.unknownPlace","Unknown place")})}),e.jsxs("span",{children:[t("sync.targets.placeId","Place ID"),": ",o.placeId??"—"]})]}),e.jsxs("span",{className:s.targetStudio,children:[e.jsx(D,{text:o.clientId,children:e.jsxs("span",{children:[t("sync.targets.studioId","Studio ID"),": ",o.targetAlias]})}),e.jsx("span",{children:t("sync.targets.connected","Connected")})]}),e.jsxs("span",{className:s.targetState,children:[e.jsx(E,{variant:se[o.sync.state],shape:"pill",children:t("sync.targets.state."+o.sync.state,ne[o.sync.state])}),o.sync.syncEnabled===null&&e.jsx("span",{className:s.stateNote,children:t("sync.targets.notReported","Not reported yet")})]})]},o.clientId)})})]}),w.length>0&&e.jsxs("section",{className:s.card,"aria-label":t("sync.stored.title","Stored places"),children:[e.jsxs("button",{type:"button",className:s.storedDisclosure,"aria-expanded":M,onClick:()=>Q(o=>!o),children:[e.jsxs("span",{children:[t("sync.stored.title","Stored places")," (",w.length,")"]}),e.jsx("span",{"aria-hidden":"true",children:M?"⌃":"⌄"})]}),M&&e.jsx("div",{className:s.storedList,children:w.map(o=>{var z;const N=X(n.places,o),$=((z=n.selection)==null?void 0:z.kind)==="stored"&&n.selection.placeDirName===o.placeDirName;return e.jsxs("button",{type:"button",className:`${s.storedRow} ${$?s.targetRowSelected:""}`,disabled:!N,"aria-pressed":$,onClick:()=>n.selectStored(o),children:[e.jsxs("span",{children:[o.placeName," · ",o.placeId]}),e.jsx("span",{children:N?t("sync.stored.data","Stored data"):t("sync.stored.ambiguous","Storage location unconfirmed")})]},o.placeDirName)})})]}),n.selection&&!n.snapshotError&&e.jsxs("div",{className:s.selectedScope,children:[e.jsx("span",{children:t("sync.detail.scope","Viewing Sync details for")}),e.jsx("strong",{children:O}),u&&e.jsxs("span",{children:[t("sync.targets.studioId","Studio ID"),": ",u.targetAlias]}),e.jsx("span",{children:t("sync.detail.readOnly","Viewing details does not change Studio routing.")})]}),!n.selection&&!n.loading&&!n.snapshotError&&e.jsx("p",{className:s.emptyMessage,children:t("sync.detail.empty","Select a connected Studio or stored place to view details.")}),n.selection&&!n.snapshotError&&e.jsxs("div",{className:s.detailsStack,children:[e.jsxs("div",{className:s.card,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsx(D,{text:t("sync.status.title.tooltip","Current Studio and local file sync status for this place."),children:t("sync.status.title","Sync Status")}),H&&e.jsx(D,{text:t("sync.status.forwardOnly.tooltip","Basic tier allows Studio to local forward sync only."),children:e.jsx("span",{className:s.forwardBadge,children:t("sync.status.forwardOnly","Forward Only")})})]}),e.jsxs("div",{className:s.statusRow,children:[p?e.jsx(E,{variant:se[p.state],shape:"pill",children:t("sync.targets.state."+p.state,ne[p.state])}):e.jsx(E,{variant:"neutral",shape:"pill",children:t("sync.stored.data","Stored data")}),e.jsx("span",{className:s.metaItem,children:O})]}),(p==null?void 0:p.state)==="unknown"&&e.jsx("p",{className:s.emptyMessage,children:t("sync.detail.unknown","This Studio has not reported its Sync state yet.")}),(p==null?void 0:p.state)==="error"&&e.jsx("p",{className:s.errorMessage,role:"alert",children:t("sync.detail.error","Sync reported an error. Check the Studio Plugin for details.")}),e.jsxs("dl",{className:s.statusGrid,children:[u&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(G,{label:t("sync.forwardStatus.label","Change sending"),tooltip:t("sync.forwardStatus.tooltip","This reports whether Edit changes can be sent. Enabled does not confirm every local file is current.")})}),e.jsxs("dd",{children:[e.jsx(E,{variant:Kt[R],shape:"pill",children:t("sync.forwardStatus."+R,qt[R])}),R==="blocked"&&e.jsx("span",{className:s.forwardStatusReason,children:Gt(t,p==null?void 0:p.forwardSyncReason)})]}),(p==null?void 0:p.forwardSyncObservedAt)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:t("sync.forwardStatus.observedAt","Observed")}),e.jsx("dd",{children:new Date(p.forwardSyncObservedAt).toLocaleString()})]})]}),u&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:t("sync.targets.studioId","Studio ID")}),e.jsx("dd",{children:u.targetAlias}),e.jsx("dt",{children:t("sync.targets.connectionId","Connection ID")}),e.jsx("dd",{children:u.clientId})]}),(l==null?void 0:l.syncRoot)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(G,{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:l.syncRoot})]}),((W=n.selectedPlace)==null?void 0:W.placeDirName)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(G,{label:t("sync.detail.placeFolder","Place folder"),tooltip:t("sync.detail.placeFolder.tooltip","The stored folder shared by Studios opening this Place.")})}),e.jsx("dd",{children:n.selectedPlace.placeDirName})]}),x!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(G,{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:x})]}),b!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(G,{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:b})]})]}),e.jsx("p",{className:s.sharedNote,children:t("sync.detail.sharedData","Path, counts, and log belong to the Place and are shared by Studios opening it.")})]}),n.storageSafe&&e.jsx(Ht,{migration:n.migration,onRefresh:n.refreshMigration,onApply:n.applyMigration},[n.selection.kind==="target"?n.selection.clientId:n.selection.placeDirName,n.selectedPlaceId,(I=(L=n.migration)==null?void 0:L.report)==null?void 0:I.previewFingerprint].join(":")),(l==null?void 0:l.policy)&&e.jsxs("div",{className:s.card,children:[e.jsx("div",{className:s.cardHeader,children:e.jsx(D,{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:s.policySummary,children:[e.jsxs("div",{className:s.policySummaryItem,children:[e.jsx("dt",{children:t("sync.policy.activation","Activation")}),e.jsx("dd",{children:e.jsx(E,{variant:l.syncEnabled?"success":"neutral",children:l.syncEnabled?t("sync.policy.activation.on","Sync ON"):t("sync.policy.activation.off","Sync OFF")})})]}),e.jsxs("div",{className:s.policySummaryItem,children:[e.jsx("dt",{children:t("sync.policy.preset","Workflow")}),e.jsx("dd",{className:s.policyPrimaryValue,children:Yt(t,l.policy.preset)})]})]}),l.policyReviewRequired&&e.jsx("div",{className:s.policyReviewNotice,role:"status",children:t("sync.policy.reviewRequired","Review this policy in the Studio plugin before starting Sync.")}),e.jsxs("section",{className:s.policyApplySection,"aria-labelledby":"sync-policy-apply-title",children:[e.jsxs("div",{className:s.policyApplyHeader,children:[e.jsx("h3",{id:"sync-policy-apply-title",className:s.policyApplyTitle,children:t("sync.policy.apply.title","How local changes apply to Studio")}),e.jsx("p",{className:s.policyApplyDescription,children:t("sync.policy.apply.description","Shows whether changes made locally are reviewed first or applied to Studio automatically.")})]}),e.jsxs("dl",{className:s.policySummary,children:[e.jsxs("div",{className:s.policySummaryItem,children:[e.jsx("dt",{children:e.jsx(D,{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:s.policyInfoLabel,tabIndex:0,children:t("sync.policy.apply.content","Content changes")})})}),e.jsx("dd",{children:ae(t,l.policy.apply.contentChanges)})]}),e.jsxs("div",{className:s.policySummaryItem,children:[e.jsx("dt",{children:e.jsx(D,{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:s.policyInfoLabel,tabIndex:0,children:t("sync.policy.apply.structure","Structure changes")})})}),e.jsx("dd",{children:ae(t,l.policy.apply.structureChanges)})]})]}),e.jsxs("div",{className:s.policySafetyRow,children:[e.jsx("span",{className:s.policySafetyLabel,children:t("sync.policy.safety.localDeletes","Local delete → Studio instance removal")}),e.jsx(D,{text:Zt(t,l.policy.autoApplyLocalDeletesToStudio),children:e.jsx(E,{variant:l.policy.autoApplyLocalDeletesToStudio?"warning":"neutral",className:s.policySafetyBadge,tabIndex:0,children:Qt(t,l.policy.autoApplyLocalDeletesToStudio)})})]})]}),e.jsxs("button",{type:"button",className:s.policyDisclosure,"aria-expanded":A,"aria-controls":"sync-policy-scope-panel",onClick:()=>J(o=>!o),children:[e.jsx("span",{children:t("sync.policy.scope.disclosure","Scope directions")}),e.jsx("span",{"aria-hidden":"true",className:`${s.policyDisclosureIcon} ${A?s.policyDisclosureIconOpen:""}`,children:"⌄"})]}),A&&e.jsx("div",{id:"sync-policy-scope-panel",className:s.policyScopeList,children:Ut.map(o=>{const N=l.policy.directions[o];return e.jsxs("div",{className:s.policyScopeRow,"data-testid":"sync-policy-scope-row",children:[e.jsx("span",{className:s.policyScopeName,children:t(`sync.policy.scope.${o}`,o)}),e.jsx(D,{text:Jt(t,N),children:e.jsxs("span",{className:s.policyDirectionRail,"data-testid":"sync-policy-direction-rail",role:"img","aria-label":zt(t,N),tabIndex:0,children:[e.jsx("span",{className:s.policyDirectionEndpoint,children:t("sync.policy.endpoint.local","Local")}),e.jsx("span",{className:s.policyDirectionArrow,"aria-hidden":"true",children:Xt(N)}),e.jsx("span",{className:`${s.policyDirectionEndpoint} ${s.policyDirectionEndpointStudio}`,children:t("sync.policy.endpoint.studio","Studio")})]})})]},o)})})]}),e.jsxs("div",{className:s.card,children:[e.jsxs("div",{className:s.cardHeader,children:[e.jsxs("span",{children:[t("sync.log.title","Sync Log")," · ",t("sync.log.shared","Shared Place log")]}),e.jsx("button",{className:s.clearButton,type:"button",disabled:!n.storageSafe||n.selectedPlaceId===null,onClick:()=>{n.selectedPlaceId!==null&&(i("dashboard_click_event",{click_target:"sync_clear_log",page:"sync"}),P({placeId:n.selectedPlaceId,label:O}))},children:t("common.clear","Clear")})]}),e.jsx("div",{className:s.logContainer,children:n.storageSafe?n.historyError?e.jsxs("div",{className:s.errorMessage,role:"alert",children:[t("sync.log.unavailable","The Place log could not be loaded. Retry to check it.")," ",n.historyError]}):n.historyLoading&&B.length===0?e.jsx("div",{className:s.logEmpty,children:t("sync.log.loading","Loading Place log…")}):B.length===0?e.jsx("div",{className:s.logEmpty,children:t("sync.log.empty","No sync events yet")}):B.map((o,N)=>e.jsxs("div",{className:s.logEntry,children:[e.jsx("span",{className:s.logTime,children:Vt(o.timestamp)}),e.jsx(D,{text:ts(t,o.type),children:e.jsx("span",{className:`${s.logType} ${Wt(o.type)}`,children:es(t,o.type)})}),e.jsxs("span",{className:s.logPath,children:[o.path,o.details?` — ${o.details}`:""]})]},N)):e.jsx("div",{className:s.logEmpty,children:t("sync.log.unsafe","This Place has no confirmed storage location for log access.")})})]}),H&&e.jsx(he,{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:ge.sync})]}),e.jsx(oe,{open:j!==null,title:t("sync.clear.title","Clear sync log?"),message:t("sync.clear.selectedMessage","This permanently removes the shared Sync log for {place}.").replace("{place}",(j==null?void 0:j.label)??""),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:F,onCancel:()=>!F&&P(null),onConfirm:U})]})}export{ls as Component};