@weppy/roblox-mcp 2.17.5 → 2.17.7

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 (47) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +2 -2
  3. package/dashboard/dist/assets/{AiPromptExamples-B3LZ06_M.js → AiPromptExamples-FjV57hJp.js} +1 -1
  4. package/dashboard/dist/assets/AssetsPage-Bdcj6AyD.css +1 -0
  5. package/dashboard/dist/assets/AssetsPage-DvCSWpoy.js +61 -0
  6. package/dashboard/dist/assets/{ChangelogPage-D_G_HjiK.js → ChangelogPage-BrNOX2vc.js} +1 -1
  7. package/dashboard/dist/assets/{ConfirmModal-CL0Z5xwJ.js → ConfirmModal-Ddk0UX_P.js} +1 -1
  8. package/dashboard/dist/assets/{ConnectionPage-DaYME7QT.js → ConnectionPage-B62B5vSh.js} +1 -1
  9. package/dashboard/dist/assets/{ControlsPage-gnKyi48F.js → ControlsPage-Cl_mQpzx.js} +1 -1
  10. package/dashboard/dist/assets/CurrentPlaceScope-B6NllTmu.css +1 -0
  11. package/dashboard/dist/assets/CurrentPlaceScope-Y25KxsHT.js +1 -0
  12. package/dashboard/dist/assets/{GameChangeDetail-CbYXbvWl.js → GameChangeDetail-br9EgICc.js} +1 -1
  13. package/dashboard/dist/assets/{InfoLabel-BaayM8hW.js → InfoLabel-CAGC3efT.js} +1 -1
  14. package/dashboard/dist/assets/{OverviewPage-DuPB7VBe.js → OverviewPage-DxRlbjwz.js} +1 -1
  15. package/dashboard/dist/assets/{PageHeader-C1A4pFFD.js → PageHeader-Dc41DgFB.js} +1 -1
  16. package/dashboard/dist/assets/PlaceSelectOptions-DCv8Lnxo.css +1 -0
  17. package/dashboard/dist/assets/PlaceSelectOptions-Gd2pK9DL.js +1 -0
  18. package/dashboard/dist/assets/{PlaytestAiPromptExamples-Bf494cNk.js → PlaytestAiPromptExamples-CkR6t6Na.js} +1 -1
  19. package/dashboard/dist/assets/PlaytestPage-ShadLIAO.js +127 -0
  20. package/dashboard/dist/assets/{SettingsPage-Om-hGqIQ.js → SettingsPage-CGGHBxbL.js} +1 -1
  21. package/dashboard/dist/assets/{StatusBadge-CiHSf_o_.js → StatusBadge-Cdfb5vyE.js} +1 -1
  22. package/dashboard/dist/assets/{SyncPage-BTADHgCn.js → SyncPage-CT2ECSYt.js} +1 -1
  23. package/dashboard/dist/assets/{Tabs-C0QQfjUl.js → Tabs-Dl0dNd8V.js} +1 -1
  24. package/dashboard/dist/assets/{TierPromoPanel-DI3EP06A.js → TierPromoPanel-B0BctivD.js} +1 -1
  25. package/dashboard/dist/assets/{ToolsPage-CCsd60Kh.js → ToolsPage-CsFjwKOz.js} +1 -1
  26. package/dashboard/dist/assets/{TooltipText-INE_h7BS.js → TooltipText-C0DmdntK.js} +1 -1
  27. package/dashboard/dist/assets/{UiStudioPage-TfbhZvt5.js → UiStudioPage-DzG_JVxv.js} +1 -1
  28. package/dashboard/dist/assets/{WhatsNewPage-BPKMcfVs.js → WhatsNewPage-BpSGOLxW.js} +1 -1
  29. package/dashboard/dist/assets/{bot-TMxhORyF.js → bot-BCKWpJd_.js} +1 -1
  30. package/dashboard/dist/assets/{check-C5Uo2cs_.js → check-DvBWmDvn.js} +1 -1
  31. package/dashboard/dist/assets/{copy-BENnfclm.js → copy-vqzBh0XB.js} +1 -1
  32. package/dashboard/dist/assets/{index-ZP3F-qh6.js → index-CG4GxcAc.js} +96 -64
  33. package/dashboard/dist/assets/{sample-requests-DVllzgEu.js → sample-requests-BqgMpTlQ.js} +1 -1
  34. package/dashboard/dist/assets/{trash-2-C7bZq3Km.js → trash-2-zj182u9_.js} +1 -1
  35. package/dashboard/dist/assets/{useLiveUptime-CBpmama-.js → useLiveUptime-yZ9iKJ1B.js} +1 -1
  36. package/dashboard/dist/assets/useSettings-Cme-nLG9.js +1 -0
  37. package/dashboard/dist/index.html +1 -1
  38. package/dist/index.js +154 -154
  39. package/package.json +1 -1
  40. package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
  41. package/dashboard/dist/assets/AssetsPage-DBMNmn9Z.js +0 -61
  42. package/dashboard/dist/assets/AssetsPage-DX8NUPQo.css +0 -1
  43. package/dashboard/dist/assets/CurrentPlaceScope-CHRh7s-z.js +0 -1
  44. package/dashboard/dist/assets/CurrentPlaceScope-COd50R0N.css +0 -1
  45. package/dashboard/dist/assets/PlaceSelectOptions-DU7Ka-gE.js +0 -1
  46. package/dashboard/dist/assets/PlaytestPage-JPS-_xPE.js +0 -127
  47. package/dashboard/dist/assets/useSettings-Ug_fLuUn.js +0 -1
package/CHANGELOG.md CHANGED
@@ -51,6 +51,25 @@ All notable changes to this project will be documented in this file.
51
51
 
52
52
 
53
53
 
54
+
55
+
56
+
57
+ ## [2.17.7] - 2026-09-21
58
+
59
+ ### Features
60
+
61
+ - **Open published Places from the Dashboard** — The Place scope now includes a Quick links menu for opening Place settings, Experience management, and the Roblox page in a new tab. Links remain available after Studio disconnects or the WEPPY Bridge restarts. Previously saved Places may need one Studio reconnect before Experience-level links appear.
62
+ - **Use Place folders before the first Sync** — The Dashboard now discovers valid Place project folders even when they do not have Sync metadata yet, so you can select them in Tools, Playtest, Changelog, and Assets. Duplicate folders are clearly identified and protected from accidental use without changing Studio routing or Sync data.
63
+
64
+ ### Bug Fixes
65
+
66
+ - **Keep renamed Studio Places up to date** — Renaming an open Place in Studio now refreshes its name in WEPPY without reconnecting. The Place identity, selected target, routing, and Sync folder remain unchanged.
67
+
68
+ ## [2.17.6] - 2026-09-19
69
+
70
+ ### Features
71
+
72
+ - **Switch Test Values profiles without restarting Playtest** — While Play or Run remains active, you can switch, create, edit, or delete profiles. Switching keeps the current game values and updates the controls, Watch Values, and Actions available for the same session. Reset all and session cleanup restore every reversible change made through any profile to its original pre-session value. Saved defaults and Actions do not run automatically when you switch profiles.
54
73
 
55
74
  ## [2.17.5] - 2026-09-18
56
75
 
package/README.md CHANGED
@@ -162,11 +162,11 @@ The first validation that needs the companion parser downloads the exact `luau-p
162
162
 
163
163
  Ordinary runtime checks use a structured Play session. AI can wait for game UI, inspect its semantic structure and geometry, deliver virtual input, observe the UI response, and verify the resulting server state in separate evidence steps. The local Dashboard groups the saved result by server, client UI, interaction, and visual evidence so you can review what passed and why.
164
164
 
165
- The same Playtest page also includes a **Test Values** workspace for development-only values. Create multiple Place-scoped profiles for different test setups; the Dashboard remembers the last profile selected for each Place. Controls and read-only observations appear in one searchable, paginated list, so large profiles remain easy to scan. Use **Manage values** to add entries discovered from Project Test Adapters, or use a runtime path and the current Studio selection for direct values. The Dashboard shows the current Studio state and automatically connects the selected profile to an active Play session. A stale or disconnected observation is shown as the last observed value instead of being presented as current.
165
+ The same Playtest page also includes a **Test Values** workspace for development-only values. Create multiple Place-scoped profiles for different test setups; the Dashboard remembers the last profile selected for each Place. While Play or Run remains active, you can switch, create, edit, or delete profiles without restarting the game. Switching keeps the current game values and changes the controls, Watch Values, and Actions shown for the same session. Controls and read-only observations appear in one searchable, paginated list, so large profiles remain easy to scan. Use **Manage values** to add entries discovered from Project Test Adapters, or use a runtime path and the current Studio selection for direct values. A stale or disconnected observation is shown as the last observed value instead of being presented as current.
166
166
 
167
167
  Basic includes profile creation and live runtime observation. Pro adds typed value changes during Play, rollback, **Reset all**, and actual saved **Automated Test Results**. The Playtest page explains the Pro additions and links directly to available plans and purchase options.
168
168
 
169
- Studio Stop discards Play/Run Instance changes. While the runtime remains active, Reset all restores WEPPY's original values and a partially failed transaction rolls back. Games that cache values at startup or need domain operations can expose reviewed Project Test Adapter methods through optional Dashboard metadata. The Dashboard validates the metadata, shows the registration source, and links a read-only observer to each adapter control. Removing a profile reference leaves the adapter source intact.
169
+ Studio Stop discards Play/Run Instance changes. While the runtime remains active, **Reset all** restores every reversible value changed through any profile in that session, and a partially failed transaction rolls back. Games that cache values at startup or need domain operations can expose reviewed Project Test Adapter methods through optional Dashboard metadata. The Dashboard validates the metadata, shows the registration source, and links a read-only observer to each adapter control. Removing a profile reference leaves the adapter source intact.
170
170
 
171
171
  Open **Before publishing** from the Playtest page header for a plain-language reference on what returns to its original value after a Studio test, what WEPPY keeps only on your computer, and what to check before and after publishing. Common checks are separated from items that apply only when a game has test-only features or saves player data. Test connection code created by WEPPY with default settings does not run in the public game. If WEPPY has a local record that Studio-only protection was explicitly removed, the Dashboard shows an additional note for that Place. Rojo remains optional when you want to omit test source from a production project. Currency or progress saved by game code can remain after a test, and Places in the same Experience can share that data. The reference is available on Basic and Pro; it does not inspect files, remove test code, create deployment files, or certify a release as safe.
172
172
 
@@ -1 +1 @@
1
- import{r as i,j as t}from"./index-ZP3F-qh6.js";import{C as d}from"./copy-BENnfclm.js";const _="_examples_1sykl_1",m="_example_1sykl_1",h="_request_1sykl_15",j="_nextStep_1sykl_16",b="_actionRow_1sykl_40",f="_copyButton_1sykl_47",k="_success_1sykl_79",w="_error_1sykl_80",c={examples:_,example:m,request:h,nextStep:j,actionRow:b,copyButton:f,success:k,error:w};function N(s){const[p,a]=i.useState({}),n=i.useRef(0),x=s.examples.map(e=>e.id).join("|");i.useEffect(()=>(n.current+=1,a({}),()=>{n.current+=1}),[x,s.resetKey]);const y=async(e,r)=>{var u;const l=++n.current;a(o=>({...o,[e]:"copying"}));try{if(!((u=navigator.clipboard)!=null&&u.writeText))throw new Error("clipboard_unavailable");if(await navigator.clipboard.writeText(r),l!==n.current)return;a(o=>({...o,[e]:"copied"}))}catch{if(l!==n.current)return;a(o=>({...o,[e]:"error"}))}};return t.jsxs("div",{className:c.examples,children:[s.examples.map(e=>{const r=p[e.id]??"idle";return t.jsxs("section",{className:c.example,children:[t.jsx("h4",{children:e.title}),t.jsx("p",{className:c.request,children:e.request}),t.jsxs("div",{className:c.actionRow,children:[t.jsxs("button",{type:"button",className:c.copyButton,disabled:r==="copying",onClick:()=>void y(e.id,e.request),children:[t.jsx(d,{size:14,"aria-hidden":"true"}),r==="copying"?s.labels.copying:s.labels.copy]}),r==="copied"&&t.jsx("span",{className:c.success,role:"status",children:s.labels.copied})]}),r==="error"&&t.jsx("p",{className:c.error,role:"alert",children:s.labels.copyFailed})]},e.id)}),s.nextStep&&t.jsx("p",{className:c.nextStep,children:s.nextStep})]})}export{N as A};
1
+ import{r as i,j as t}from"./index-CG4GxcAc.js";import{C as d}from"./copy-vqzBh0XB.js";const _="_examples_1sykl_1",m="_example_1sykl_1",h="_request_1sykl_15",j="_nextStep_1sykl_16",b="_actionRow_1sykl_40",f="_copyButton_1sykl_47",k="_success_1sykl_79",w="_error_1sykl_80",c={examples:_,example:m,request:h,nextStep:j,actionRow:b,copyButton:f,success:k,error:w};function N(s){const[p,a]=i.useState({}),n=i.useRef(0),x=s.examples.map(e=>e.id).join("|");i.useEffect(()=>(n.current+=1,a({}),()=>{n.current+=1}),[x,s.resetKey]);const y=async(e,r)=>{var u;const l=++n.current;a(o=>({...o,[e]:"copying"}));try{if(!((u=navigator.clipboard)!=null&&u.writeText))throw new Error("clipboard_unavailable");if(await navigator.clipboard.writeText(r),l!==n.current)return;a(o=>({...o,[e]:"copied"}))}catch{if(l!==n.current)return;a(o=>({...o,[e]:"error"}))}};return t.jsxs("div",{className:c.examples,children:[s.examples.map(e=>{const r=p[e.id]??"idle";return t.jsxs("section",{className:c.example,children:[t.jsx("h4",{children:e.title}),t.jsx("p",{className:c.request,children:e.request}),t.jsxs("div",{className:c.actionRow,children:[t.jsxs("button",{type:"button",className:c.copyButton,disabled:r==="copying",onClick:()=>void y(e.id,e.request),children:[t.jsx(d,{size:14,"aria-hidden":"true"}),r==="copying"?s.labels.copying:s.labels.copy]}),r==="copied"&&t.jsx("span",{className:c.success,role:"status",children:s.labels.copied})]}),r==="error"&&t.jsx("p",{className:c.error,role:"alert",children:s.labels.copyFailed})]},e.id)}),s.nextStep&&t.jsx("p",{className:c.nextStep,children:s.nextStep})]})}export{N as A};
@@ -0,0 +1 @@
1
+ ._page_leed4_1{display:flex;flex-direction:column;gap:var(--space-page);min-height:100%;max-width:var(--content-max)}._experimentalBadge_leed4_9{display:inline-flex;align-items:center;min-height:20px;border:1px solid color-mix(in srgb,var(--accent) 45%,var(--border));border-radius:var(--radius-control);background:color-mix(in srgb,var(--accent) 14%,var(--bg-card));color:var(--accent);padding:0 7px;font-family:var(--font-label);font-size:11px;line-height:1}._toolbarShell_leed4_23{position:relative;z-index:30;border-top:1px solid var(--border);border-bottom:1px solid var(--border);padding:12px 0}._toolbar_leed4_23{display:grid;grid-template-columns:auto minmax(220px,320px) minmax(0,1fr) auto;grid-template-areas:"scope place summary actions" "category category category category";align-items:center;gap:12px}._toolbar_leed4_23>._segmented_leed4_41{grid-area:scope}._placeContextSlot_leed4_45{grid-area:place;min-width:0}._toolbar_leed4_23>._listContextSummary_leed4_50{grid-area:summary}._toolbar_leed4_23>._toolbarActions_leed4_54{grid-area:actions;justify-self:end}._toolbarExpandedSummary_leed4_59{grid-template-columns:auto minmax(220px,1fr) auto;grid-template-areas:"scope place actions" "summary summary summary" "category category category"}._placeFolderDetails_leed4_67{min-width:0;margin-top:8px}._categoryControl_leed4_72{grid-area:category;display:inline-flex;align-items:center;gap:8px;width:100%;min-width:0}._listContextSummary_leed4_50{display:flex;align-items:center;flex-wrap:wrap;row-gap:4px;min-width:0;overflow:visible;color:var(--text-secondary);font-size:12px;line-height:1.4;white-space:normal}._placeStatusGroup_leed4_94,._contextTextSummary_leed4_95{display:flex;align-items:center;flex-wrap:wrap;gap:6px}._placeStatusGroup_leed4_94{margin-right:8px}._contextTextSummary_leed4_95{column-gap:0}._listContextSummary_leed4_50 strong{color:var(--text-primary);font-family:var(--font-label);font-weight:600}._contextDivider_leed4_116{color:var(--text-muted)}._categoryControlLabel_leed4_120{flex:0 0 auto;color:var(--text-secondary);font-size:12px}._categoryRail_leed4_126{display:flex;align-items:center;gap:4px;flex-wrap:wrap;min-width:0}._categoryButton_leed4_134{min-height:32px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card);color:var(--text-secondary);padding:0 10px;font-family:var(--font-label);font-size:12px;line-height:1;cursor:pointer;transition:border-color var(--transition),color var(--transition),background var(--transition)}._categoryButton_leed4_134:hover{border-color:var(--accent);color:var(--text-primary)}._categoryButton_leed4_134:disabled{cursor:not-allowed;opacity:.48}._categoryButton_leed4_134:disabled:hover{border-color:var(--border);color:var(--text-secondary)}._categoryButtonActive_leed4_163{border-color:color-mix(in srgb,var(--accent) 76%,var(--border));background:var(--accent-dim);color:var(--accent)}._categoryButton_leed4_134:focus-visible{outline:none;box-shadow:var(--focus-ring)}._toolbarActions_leed4_54,._actionRow_leed4_175,._copyRow_leed4_176,._buttonRow_leed4_177{display:flex;align-items:center;gap:8px;flex-wrap:wrap}._segmented_leed4_41{display:inline-flex;min-height:32px;border:1px solid var(--border);border-radius:var(--radius-control);overflow:hidden;background:var(--bg-card)}._segmented_leed4_41 button{border:0;border-right:1px solid var(--border);background:transparent;color:var(--text-secondary);padding:0 10px;font-family:var(--font-label);font-size:12px;cursor:pointer;transition:background var(--transition),color var(--transition)}._segmented_leed4_41 button:hover:not(:disabled){background:var(--accent-dim);color:var(--accent)}._segmented_leed4_41 button:focus-visible{outline:none;box-shadow:inset var(--focus-ring)}._segmented_leed4_41 button:last-child{border-right:0}._segmented_leed4_41 ._segmentedActive_leed4_219{background:var(--accent-dim);color:var(--accent)}._placeSelectorLabel_leed4_224{display:inline-flex;align-items:center;gap:8px;width:100%;min-width:0;color:var(--text-secondary);font-size:12px}._placeSelectorLabel_leed4_224 span{flex:0 0 auto}._placeSelect_leed4_224{width:100%;min-width:0;min-height:32px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card);color:var(--text-primary);padding:0 28px 0 8px;font:inherit;text-overflow:ellipsis}._sharedPlaceContext_leed4_251{display:inline-flex;align-items:center;min-height:32px;color:var(--text-secondary);font-size:12px}._filterLabel_leed4_259{display:inline-flex;align-items:center;gap:8px;color:var(--text-secondary);font-size:12px}._filterLabel_leed4_259 select{min-height:32px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card);color:var(--text-primary);padding:0 8px;font:inherit}._commandButton_leed4_277,._primaryButton_leed4_278,._iconButton_leed4_279{display:inline-flex;align-items:center;justify-content:center;gap:6px;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:12px;cursor:pointer;transition:border-color var(--transition),color var(--transition),background var(--transition),opacity var(--transition)}._commandButton_leed4_277{min-height:32px;padding:6px 10px;text-decoration:none}._primaryButton_leed4_278{min-height:34px;padding:7px 12px;border-color:var(--accent);color:var(--accent)}._iconButton_leed4_279{width:32px;height:32px;padding:0}._commandButton_leed4_277:hover,._primaryButton_leed4_278:hover,._iconButton_leed4_279:hover{border-color:var(--accent)}._dangerButton_leed4_319{border-color:var(--danger-border);background:var(--danger-bg);color:var(--danger-text)}._dangerButton_leed4_319:hover{border-color:var(--danger);background:var(--danger-hover-bg);color:var(--danger-text)}._commandButton_leed4_277:focus-visible,._primaryButton_leed4_278:focus-visible,._iconButton_leed4_279:focus-visible,._placeSelect_leed4_224:focus-visible,._filterLabel_leed4_259 select:focus-visible{outline:none;box-shadow:var(--focus-ring)}._iconButtonActive_leed4_340{border-color:var(--accent);background:var(--accent-dim);color:var(--accent)}._commandButton_leed4_277:disabled,._primaryButton_leed4_278:disabled,._iconButton_leed4_279:disabled{cursor:not-allowed;opacity:.5}._grid_leed4_353{--asset-card-min: 190px;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--asset-card-min)),1fr));gap:12px}._grid_leed4_353[data-grid-size=small],._folderGrid_leed4_361[data-grid-size=small]{--asset-card-min: 144px}._grid_leed4_353[data-grid-size=large],._folderGrid_leed4_361[data-grid-size=large]{--asset-card-min: 260px}._explorer_leed4_370{display:flex;min-width:0;flex-direction:column;gap:14px}._explorerToolbar_leed4_377{display:flex;min-width:0;align-items:flex-start;justify-content:space-between;gap:16px;border-bottom:1px solid var(--border);padding-bottom:12px}._explorerLocation_leed4_387{min-width:0}._explorerLocation_leed4_387 h2{margin:5px 0 2px;overflow-wrap:anywhere;color:var(--text-primary);font-size:var(--type-surface-title-size);font-weight:600;line-height:var(--leading-title);letter-spacing:0}._explorerLocation_leed4_387 h2:focus-visible{outline:none;box-shadow:var(--focus-ring)}._explorerLocation_leed4_387 p{margin:0;color:var(--text-muted);font-size:var(--type-control-size);line-height:var(--leading-body)}._breadcrumb_leed4_413,._breadcrumbSegment_leed4_414{display:inline-flex;min-width:0;align-items:center;gap:2px;color:var(--text-muted);font-size:12px}._breadcrumb_leed4_413{max-width:100%;flex-wrap:wrap}._breadcrumb_leed4_413 button{min-height:44px;border:0;border-radius:var(--radius-control);background:transparent;color:var(--text-secondary);padding:0 7px;font:inherit;cursor:pointer;transition:background var(--transition),color var(--transition)}._breadcrumb_leed4_413 button:hover{background:var(--accent-dim);color:var(--accent)}._breadcrumb_leed4_413 button:focus-visible{outline:none;box-shadow:var(--focus-ring)}._breadcrumb_leed4_413 [aria-current=page]{min-width:0;overflow-wrap:anywhere;color:var(--text-primary);padding:0 5px}._viewOptions_leed4_457{display:flex;flex:0 0 auto;align-items:center;gap:8px;min-height:44px}._organizationModeControl_leed4_465,._viewModeControl_leed4_466,._gridSizeControl_leed4_467{display:inline-flex;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card)}._organizationModeControl_leed4_465 button,._viewModeControl_leed4_466 button,._gridSizeControl_leed4_467 button{display:inline-flex;min-height:32px;align-items:center;justify-content:center;gap:5px;border:0;border-right:1px solid var(--border);background:transparent;color:var(--text-secondary);padding:0 9px;font-family:var(--font-label);font-size:11px;cursor:pointer;transition:background var(--transition),color var(--transition)}._organizationModeControl_leed4_465 button:last-child,._viewModeControl_leed4_466 button:last-child,._gridSizeControl_leed4_467 button:last-child{border-right:0}._organizationModeControl_leed4_465 button[aria-pressed=true],._viewModeControl_leed4_466 button[aria-pressed=true],._gridSizeControl_leed4_467 button[aria-pressed=true]{background:var(--accent-dim);color:var(--accent)}._organizationModeControl_leed4_465 button:focus-visible,._viewModeControl_leed4_466 button:focus-visible,._gridSizeControl_leed4_467 button:focus-visible{z-index:1;outline:none;box-shadow:inset var(--focus-ring)}._gridSizeControl_leed4_467 button:disabled{cursor:not-allowed;opacity:.42}._explorerSection_leed4_520{display:flex;min-width:0;flex-direction:column;gap:8px}._explorerSection_leed4_520 h3{margin:0;color:var(--text-secondary);font-family:var(--font-label);font-size:12px;font-weight:600;letter-spacing:0}._folderGrid_leed4_361{--asset-card-min: 190px;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--asset-card-min)),1fr));gap:12px}._folderTile_leed4_543{display:grid;min-width:0;min-height:84px;grid-template-columns:46px minmax(0,1fr);grid-template-rows:auto auto;align-items:center;column-gap:10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);color:var(--text-primary);padding:11px;text-align:left;cursor:pointer;transition:border-color var(--transition),background var(--transition),transform var(--transition)}._folderTile_leed4_543:hover{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 6%,var(--bg-card));transform:translateY(-1px)}._folderTile_leed4_543:focus-visible,._folderListRow_leed4_568:focus-visible,._assetListRow_leed4_569:focus-visible,._assetCard_leed4_570:focus-visible{outline:none;box-shadow:var(--focus-ring)}._folderIcon_leed4_575{display:grid;grid-row:1 / span 2;place-items:center;width:40px;height:40px;border:1px solid color-mix(in srgb,var(--accent) 30%,var(--border));border-radius:8px;background:var(--accent-dim);color:var(--accent)}._folderName_leed4_587{min-width:0;align-self:end;overflow:hidden;color:var(--text-primary);font-family:var(--font-label);font-size:13px;font-weight:600;overflow-wrap:anywhere;text-overflow:ellipsis}._folderCount_leed4_599{align-self:start;color:var(--text-muted);font-size:12px}._assetList_leed4_569,._folderList_leed4_568{display:flex;min-width:0;flex-direction:column;gap:4px}._assetListHeader_leed4_613,._assetListRow_leed4_569,._folderListRow_leed4_568{display:grid;min-width:0;grid-template-columns:44px minmax(160px,1fr) 110px 120px 110px 110px;align-items:center;gap:10px}._assetListHeader_leed4_613{min-height:28px;border-bottom:1px solid var(--border);color:var(--text-muted);padding:0 10px 5px;font-size:11px}._assetListRow_leed4_569,._folderListRow_leed4_568{min-height:52px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card);color:var(--text-secondary);padding:7px 10px;text-align:left;cursor:pointer;transition:border-color var(--transition),background var(--transition)}._assetListRow_leed4_569:hover,._folderListRow_leed4_568:hover{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 5%,var(--bg-card))}._listPreviewWrap_leed4_650,._listPreview_leed4_650,._listPreviewFallback_leed4_652{width:36px;height:36px;border-radius:6px}._listPreviewWrap_leed4_650{display:grid;overflow:hidden;place-items:center;background:var(--bg-secondary)}._listPreview_leed4_650{object-fit:contain}._listPreviewFallback_leed4_652{display:grid;place-items:center;color:var(--text-secondary)}._folderListRow_leed4_568 ._folderIcon_leed4_575{grid-row:auto;width:36px;height:36px}._listAssetName_leed4_681,._folderListRow_leed4_568 ._folderName_leed4_587{min-width:0;overflow:hidden;color:var(--text-primary);font-family:var(--font-label);font-size:12px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}._listAssetCategory_leed4_693,._listAssetScope_leed4_694,._listAssetUpdated_leed4_695,._folderType_leed4_696,._folderScope_leed4_697,._folderStatus_leed4_698,._folderUpdated_leed4_699{min-width:0;overflow:hidden;color:var(--text-muted);font-size:12px;text-overflow:ellipsis;white-space:nowrap}._assetCard_leed4_570{display:flex;flex-direction:column;gap:8px;min-width:0;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);padding:8px;color:var(--text-primary);text-align:left;cursor:pointer;transition:border-color var(--transition),background var(--transition),transform var(--transition)}._assetCard_leed4_570:hover{border-color:var(--accent);transform:translateY(-1px)}._assetCardSelected_leed4_728{border-color:var(--accent);box-shadow:0 0 0 1px color-mix(in srgb,var(--accent) 40%,transparent)}._thumbnailWrap_leed4_733{display:grid;place-items:center;width:100%;aspect-ratio:1;overflow:hidden;border-radius:6px;background:var(--bg-secondary)}._thumbnail_leed4_733{width:100%;height:100%;object-fit:contain}._thumbnailFallback_leed4_749{display:grid;place-items:center;width:48px;height:48px;border:1px solid var(--border);border-radius:8px;color:var(--text-secondary);background:var(--bg-card)}._assetCardBody_leed4_760{display:flex;flex-direction:column;gap:6px;min-width:0}._assetName_leed4_767{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--font-label);font-size:13px}._assetMeta_leed4_775{display:flex;align-items:center;justify-content:space-between;gap:8px}._statusChip_leed4_782,._categoryPill_leed4_783{min-height:20px;padding:2px 7px}._assetId_leed4_788,._scopeText_leed4_789,._muted_leed4_790{color:var(--text-muted);font-size:12px}._emptyState_leed4_795,._notice_leed4_796,._errorState_leed4_797,._messageState_leed4_798{border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);padding:14px;color:var(--text-secondary)}._emptyState_leed4_795{min-height:160px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-align:center}._emptyState_leed4_795 p{margin:0;color:var(--text-primary);font-family:var(--font-label)}._emptyGuide_leed4_822{display:flex;flex-direction:column;gap:var(--space-section);padding:20px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card)}._emptyGuideHeader_leed4_832,._emptyGuideMethod_leed4_833{display:flex;flex-direction:column;gap:var(--space-related)}._emptyGuideHeader_leed4_832 h3,._emptyGuideHeader_leed4_832 p,._emptyGuideMethod_leed4_833 h4,._emptyGuideMethod_leed4_833 p{margin:0}._emptyGuideHeader_leed4_832 h3{color:var(--text-primary);font-family:var(--font-label);font-size:var(--type-section-title-size);font-weight:600}._emptyGuideHeader_leed4_832 p,._emptyGuideMethod_leed4_833 p,._emptyGuideSteps_leed4_855{color:var(--text-secondary);font-size:var(--type-body-size);line-height:var(--leading-body)}._emptyGuideMethods_leed4_861{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--space-section)}._emptyGuideMethod_leed4_833{min-width:0;padding:14px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary)}._emptyGuideMethodTitle_leed4_875{display:flex;align-items:center;gap:var(--space-related);color:var(--text-primary)}._emptyGuideMethodTitle_leed4_875 h4{font-family:var(--font-label);font-size:var(--type-card-title-size);font-weight:600}._emptyGuideSteps_leed4_855{margin:0;padding-left:20px}._emptyGuideTierNote_leed4_893{color:var(--pro-text)!important;font-size:var(--type-control-size)!important}._emptyGuideMethodHelp_leed4_898,._emptyGuideCapabilityDescription_leed4_899{color:var(--text-secondary)!important;font-size:var(--type-body-size);line-height:var(--leading-body)}._emptyGuideChoices_leed4_905{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--space-related)}._emptyGuideChoice_leed4_905{display:flex;min-width:0;min-height:68px;flex-direction:column;align-items:flex-start;justify-content:center;gap:6px;padding:9px 10px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card);color:var(--text-primary);text-align:left;cursor:pointer}._emptyGuideChoice_leed4_905:hover{border-color:var(--border-highlight);background:var(--accent-dim)}._emptyGuideChoiceSelected_leed4_933{border-color:var(--accent);background:var(--accent-dim)}._emptyGuideChoice_leed4_905:focus-visible{outline:none;box-shadow:var(--focus-ring)}._emptyGuideChoiceLabel_leed4_943{font-family:var(--font-label);font-size:var(--type-control-size);font-weight:600}._emptyGuideCapability_leed4_899{padding:2px 6px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-secondary);font-size:var(--type-meta-size);line-height:var(--leading-body)}._emptyGuideAction_leed4_959{width:fit-content;min-height:34px;padding:0 14px;border:1px solid var(--accent);border-radius:var(--radius-control);background:var(--accent);color:var(--button-primary-text);font-family:var(--font-label);font-size:var(--type-control-size);font-weight:600;cursor:pointer}._emptyGuideAction_leed4_959:focus-visible{outline:none;box-shadow:var(--focus-ring)}._emptyGuideAction_leed4_959:disabled{cursor:wait;opacity:.65}._notice_leed4_796{color:var(--warning-text);border-color:var(--warning-border);background:var(--warning-bg)}._proNotice_leed4_989{color:var(--pro-text);border-color:var(--pro-border);background:var(--pro-bg-soft)}._errorState_leed4_797{display:grid;gap:4px;color:var(--error);border-color:var(--error)}._messageState_leed4_798{color:var(--success);border-color:var(--success)}._rbxmGuide_leed4_1007{display:flex;flex-direction:column;gap:6px;border:1px solid color-mix(in srgb,var(--accent) 35%,var(--border));border-radius:var(--radius);background:color-mix(in srgb,var(--accent) 8%,var(--bg-card));padding:14px}._rbxmGuide_leed4_1007 h2{margin:0;color:var(--text-primary);font-family:var(--font-label);font-size:14px;letter-spacing:0}._rbxmGuide_leed4_1007 p{margin:0;max-width:760px;color:var(--text-secondary);font-size:12px;line-height:1.5}._drawer_leed4_1033{position:fixed;top:0;right:0;z-index:40;width:min(460px,100vw);height:100vh;overflow-y:auto;border-left:1px solid var(--border);background:var(--bg-primary);padding:18px;box-shadow:-12px 0 24px #00000047}._settingsInlinePanel_leed4_1047{position:absolute;top:calc(100% + 8px);right:0;z-index:35;display:flex;flex-direction:column;gap:12px;width:min(560px,100%);max-height:min(680px,calc(100vh - var(--header-height) - 112px));overflow-y:auto;border:1px solid var(--border);border-radius:8px;background:var(--bg-card);padding:14px;box-shadow:0 18px 44px #00000057;animation:_settingsPopoverIn_leed4_1 .12s ease-out;transform-origin:top right}._settingsDrawer_leed4_1067{width:min(560px,100%)}@keyframes _settingsPopoverIn_leed4_1{0%{opacity:0;transform:translateY(-4px) scale(.99)}to{opacity:1;transform:translateY(0) scale(1)}}._detailPopupLayer_leed4_1083{position:fixed;top:calc(var(--header-height) + 16px);right:24px;bottom:24px;left:calc(var(--sidebar-width) + 24px);z-index:900;display:flex;align-items:stretch;justify-content:center;padding:clamp(12px,2vw,24px);background:#03071294;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);box-sizing:border-box}._detailDialog_leed4_1099{width:min(1120px,100%);min-height:0;display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);color:var(--text-primary);box-shadow:0 24px 60px #0000006b}._detailDialog_leed4_1099:focus{outline:none}._detailDialogHeader_leed4_1116{flex:0 0 auto;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px;padding:14px 16px;border-bottom:1px solid var(--border);background:color-mix(in srgb,var(--bg-card) 92%,var(--bg-secondary))}._detailTitleBlock_leed4_1127{min-width:0;display:flex;flex-direction:column;gap:3px}._detailTitleBlock_leed4_1127 h2{margin:0;font-size:var(--type-surface-title-size);letter-spacing:0}._detailTitleBlock_leed4_1127 span:last-child{overflow:hidden;color:var(--text-muted);font-family:var(--font-code);font-size:12px;text-overflow:ellipsis;white-space:nowrap}._detailEyebrow_leed4_1149{color:var(--text-muted);font-family:var(--font-label);font-size:11px;font-weight:600;letter-spacing:0;text-transform:uppercase}._detailHeaderActions_leed4_1158{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0}._detailDialogBody_leed4_1166{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:minmax(260px,.9fr) minmax(360px,1.1fr);gap:0;overflow:hidden}._detailPreviewPane_leed4_1175{min-width:0;min-height:0;display:flex;align-items:center;justify-content:center;padding:24px;border-right:1px solid var(--border);background:var(--bg-secondary)}._detailPreview_leed4_1175,._detailPreviewFallback_leed4_1187{width:100%;max-width:520px;aspect-ratio:1;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card)}._detailPreview_leed4_1175{display:block;object-fit:contain}._detailPreviewFallback_leed4_1187{display:grid;place-items:center;gap:8px;color:var(--text-secondary)}._detailPreviewFallback_leed4_1187 code{color:var(--text-muted);font-family:var(--font-code);font-size:12px}._detailPreviewFallback_leed4_1187 small{max-width:88%;color:var(--text-muted);font-size:12px;line-height:1.35;overflow-wrap:anywhere;text-align:center}._detailContentPane_leed4_1223{min-width:0;overflow-y:auto;padding:18px 22px 24px}._detailContentPane_leed4_1223 ._formStack_leed4_1229{margin-top:0}._drawerHeader_leed4_1233{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}._settingsInlinePanel_leed4_1047 ._drawerHeader_leed4_1233{margin-bottom:0}._drawerHeader_leed4_1233 h2{margin:0;font-size:var(--type-surface-title-size);letter-spacing:0}._drawerHeader_leed4_1233 span{color:var(--text-muted);font-size:12px}._preview_leed4_1256,._previewFallback_leed4_1257{width:100%;aspect-ratio:1;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-secondary);margin-bottom:14px}._preview_leed4_1256{object-fit:contain}._previewFallback_leed4_1257{display:grid;place-items:center;gap:8px;color:var(--text-secondary)}._previewFallback_leed4_1257 code{color:var(--text-muted);font-family:var(--font-code);font-size:12px}._formStack_leed4_1229,._detailSection_leed4_1284,._noticeList_leed4_1285,._settingsPanel_leed4_1286{display:flex;flex-direction:column;gap:10px;margin-top:14px}._noticeList_leed4_1285{color:var(--text-muted);font-size:12px;line-height:1.45}._noticeList_leed4_1285 p{margin:0}._setupNotice_leed4_1303{display:grid;gap:8px;margin-top:14px;border:1px solid var(--warning-border);border-radius:6px;background:var(--warning-bg);color:var(--warning-text);padding:12px;font-size:12px}._setupNotice_leed4_1303 strong{color:var(--text-primary);font-size:13px}._setupNotice_leed4_1303 p{margin:0}._setupNotice_leed4_1303 ._commandButton_leed4_277{justify-self:start}._field_leed4_1328{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--text-secondary)}._fieldLabelRow_leed4_1336{display:flex;align-items:center;gap:4px;min-height:24px}._fieldLabelRow_leed4_1336 label,._fieldLabelRow_leed4_1336 span{min-width:0}._field_leed4_1328 input,._field_leed4_1328 textarea,._field_leed4_1328 select{width:100%;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-primary);padding:8px;font:inherit}._fieldHelp_leed4_1360{color:var(--text-muted);line-height:1.35}._twoColumn_leed4_1365{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}._detailSection_leed4_1284{padding-top:12px;border-top:1px solid var(--border)}._technicalDetails_leed4_1376{margin-top:14px;padding-top:12px;border-top:1px solid var(--border)}._technicalDetails_leed4_1376 summary{cursor:pointer;color:var(--text-secondary);font-size:13px;font-weight:600}._technicalDetails_leed4_1376 summary:hover{color:var(--text-primary)}._technicalDetails_leed4_1376 ._detailGrid_leed4_1393,._technicalDetails_leed4_1376 ._metadataList_leed4_1394{margin-top:10px}._detailSection_leed4_1284 h3{margin:0;font-size:13px;letter-spacing:0}._detailGrid_leed4_1393,._compactMeta_leed4_1405{display:grid;grid-template-columns:90px minmax(0,1fr);gap:6px 10px;margin:0;font-size:12px}._compactMeta_leed4_1405{border:1px solid var(--border);border-radius:var(--radius);padding:10px;background:var(--bg-card)}._detailGrid_leed4_1393 dt,._compactMeta_leed4_1405 dt{color:var(--text-muted)}._detailGrid_leed4_1393 dd,._compactMeta_leed4_1405 dd{margin:0;min-width:0;overflow-wrap:anywhere}._copyableValue_leed4_1432{display:inline-flex;align-items:center;gap:6px}._copyableValue_leed4_1432 span{min-width:0;overflow-wrap:anywhere}._inlineCopyButton_leed4_1443{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;width:24px;height:24px;border:1px solid var(--border);border-radius:var(--radius-control);background:transparent;color:var(--text-muted);cursor:pointer;transition:border-color var(--transition),color var(--transition),background var(--transition)}._inlineCopyButton_leed4_1443:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-dim)}._hashText_leed4_1464{font-family:var(--font-code)}._usageList_leed4_1468{display:flex;flex-direction:column;gap:8px}._usageItem_leed4_1474,._metadataItem_leed4_1475{display:grid;gap:4px;border:1px solid var(--border);border-radius:6px;padding:8px;background:var(--bg-card);font-size:12px}._metadataList_leed4_1394{display:flex;flex-direction:column;gap:8px}._metadataList_leed4_1394 strong,._usageItem_leed4_1474 strong{color:var(--text-primary);overflow-wrap:anywhere}._metadataItem_leed4_1475 span{color:var(--text-secondary);overflow-wrap:anywhere}._metadataItem_leed4_1475 code,._usageItem_leed4_1474 code{color:var(--accent);overflow-wrap:anywhere}._settingsPanel_leed4_1286{border:1px solid var(--border);border-radius:8px;padding:12px;background:var(--bg-card)}._settingsInlinePanel_leed4_1047 ._settingsPanel_leed4_1286{border:0;border-radius:0;background:transparent;padding:0;margin-top:0}._settingsSubsection_leed4_1523{display:grid;gap:8px}._settingsSectionHeader_leed4_1528{display:flex;align-items:center;justify-content:space-between;gap:10px}._settingsSectionHeader_leed4_1528 h3{margin:0;color:var(--text-primary);font-size:13px}._settingsDefinitionList_leed4_1541{display:grid;gap:6px;margin:0}._settingsDefinitionList_leed4_1541 div{display:grid;grid-template-columns:minmax(96px,max-content) minmax(0,1fr);gap:10px}._settingsDefinitionList_leed4_1541 dt{color:var(--text-muted)}._settingsDefinitionList_leed4_1541 dd{margin:0;color:var(--text-primary);overflow-wrap:anywhere}._toggleRow_leed4_1563{display:flex;align-items:center;justify-content:space-between;gap:16px;font-size:13px}._toggleRow_leed4_1563 span{display:grid;gap:3px}._toggleRow_leed4_1563 small,._inlineHelp_leed4_1577{color:var(--text-muted);font-size:12px}._toggleRow_leed4_1563 input{width:18px;height:18px}._inlineHelp_leed4_1577{margin:0}._inlineHelp_leed4_1577 a{color:var(--accent)}@media(max-width:1120px){._detailPopupLayer_leed4_1083{right:16px;bottom:16px;left:calc(var(--sidebar-width) + 16px);padding:12px}._detailDialogBody_leed4_1166{grid-template-columns:minmax(240px,.8fr) minmax(320px,1.2fr)}}@media(max-width:820px){._detailPopupLayer_leed4_1083{top:calc(var(--header-height) + 10px);right:10px;bottom:10px;left:calc(var(--sidebar-collapsed) + 10px);padding:8px}._detailDialogHeader_leed4_1116{grid-template-columns:minmax(0,1fr);align-items:stretch;gap:10px;padding:12px}._detailHeaderActions_leed4_1158{justify-content:flex-start;overflow-x:auto;padding-bottom:2px}._detailDialogBody_leed4_1166{grid-template-columns:minmax(0,1fr);overflow-y:auto}._detailPreviewPane_leed4_1175{min-height:auto;padding:14px;border-right:0;border-bottom:1px solid var(--border)}._detailPreview_leed4_1175,._detailPreviewFallback_leed4_1187{max-width:340px}._detailContentPane_leed4_1223{overflow:visible;padding:14px}}@media(max-width:720px){._headerRow_leed4_1654{align-items:stretch;flex-direction:column}._toolbar_leed4_23{grid-template-columns:minmax(0,1fr);grid-template-areas:"scope" "place" "summary" "actions" "category";align-items:stretch}._toolbar_leed4_23>._segmented_leed4_41,._placeContextSlot_leed4_45,._toolbar_leed4_23>._toolbarActions_leed4_54,._categoryControl_leed4_72{width:100%}._toolbar_leed4_23>._toolbarActions_leed4_54{justify-self:stretch}._headerMeta_leed4_1681{justify-items:start}._toolbarActions_leed4_54{justify-content:flex-start}._explorerToolbar_leed4_377{align-items:stretch;flex-direction:column}._viewOptions_leed4_457{width:100%;align-items:stretch;flex-direction:column}._organizationModeControl_leed4_465,._viewModeControl_leed4_466,._gridSizeControl_leed4_467{display:grid;width:100%;grid-template-columns:repeat(2,minmax(0,1fr))}._gridSizeControl_leed4_467{grid-template-columns:repeat(3,minmax(0,1fr))}._organizationModeControl_leed4_465 button,._viewModeControl_leed4_466 button,._gridSizeControl_leed4_467 button{min-width:0}._assetListHeader_leed4_613{display:none}._assetListRow_leed4_569,._folderListRow_leed4_568{grid-template-columns:40px minmax(0,1fr) auto;grid-template-areas:"preview name status" "preview type type" "preview scope updated";gap:3px 8px}._listPreviewWrap_leed4_650,._folderListRow_leed4_568 ._folderIcon_leed4_575{grid-area:preview}._listAssetName_leed4_681,._folderListRow_leed4_568 ._folderName_leed4_587{grid-area:name}._listAssetCategory_leed4_693,._folderType_leed4_696{grid-area:type}._listAssetScope_leed4_694,._folderScope_leed4_697{grid-area:scope}._assetListRow_leed4_569 ._statusChip_leed4_782,._folderStatus_leed4_698{grid-area:status;justify-self:end}._listAssetUpdated_leed4_695,._folderUpdated_leed4_699{grid-area:updated;justify-self:end}._placeSelectorLabel_leed4_224,._placeSelect_leed4_224{width:100%}._settingsInlinePanel_leed4_1047{right:auto;left:0;width:100%;transform-origin:top left}._twoColumn_leed4_1365{grid-template-columns:1fr}}
@@ -0,0 +1,61 @@
1
+ import{f as le,b as F,l as we,u as ce,j as s,P as ws,I as Rs,r as c,F as $s,m as Ls,R as fs,X as Xe,E as Us,n as bs,g as Ts,o as Ve,p as be,q as Pe,t as Bs,a as Es,e as Gs}from"./index-CG4GxcAc.js";import{C as ys}from"./ConfirmModal-Ddk0UX_P.js";import{B as me,C as Ms,D as Qe,b as Ds,P as Fs}from"./PageHeader-Dc41DgFB.js";import{P as Os,a as Hs}from"./PlaceSelectOptions-Gd2pK9DL.js";import{T as ee}from"./TooltipText-C0DmdntK.js";import{A as zs}from"./AiPromptExamples-FjV57hJp.js";import{B as Ks}from"./bot-BCKWpJd_.js";import{T as Ws}from"./trash-2-zj182u9_.js";import{C as js}from"./copy-vqzBh0XB.js";import"./ConfirmModal.module-DJksQHBd.js";/**
2
+ * @license lucide-react v1.8.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Vs=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Ys=le("arrow-left",Vs);/**
7
+ * @license lucide-react v1.8.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const qs=[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]],Xs=le("audio-lines",qs);/**
12
+ * @license lucide-react v1.8.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const Js=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}]],Zs=le("badge",Js);/**
17
+ * @license lucide-react v1.8.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const Qs=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],et=le("box",Qs);/**
22
+ * @license lucide-react v1.8.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const st=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],He=le("chevron-right",st);/**
27
+ * @license lucide-react v1.8.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const tt=[["path",{d:"m12.296 3.464 3.02 3.956",key:"qash78"}],["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z",key:"1h7j8b"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"4lm6w1"}],["path",{d:"m6.18 5.276 3.1 3.899",key:"zjj9t3"}]],at=le("clapperboard",tt);/**
32
+ * @license lucide-react v1.8.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const lt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]],nt=le("film",lt);/**
37
+ * @license lucide-react v1.8.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */const ot=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],rt=le("folder-input",ot);/**
42
+ * @license lucide-react v1.8.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const it=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],dt=le("grid-2x2",it);/**
47
+ * @license lucide-react v1.8.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */const ct=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],ut=le("list",ct);/**
52
+ * @license lucide-react v1.8.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const pt=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ht=le("search",pt);/**
57
+ * @license lucide-react v1.8.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */const mt=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],xt=le("upload",mt);function vs(e){if(e.scope==="place"&&typeof e.placeId=="number")return{placeId:String(e.placeId)}}function ne(e){const t=vs(e);return t?`?placeId=${encodeURIComponent(t.placeId)}`:""}function $e(e){return`/api/assets/${encodeURIComponent(e.scope)}/${encodeURIComponent(e.category)}`}function ue(e,t){return`${$e(e)}/${encodeURIComponent(t)}`}async function gt(e){return F.get($e(e),vs(e))}async function ft(e){return F.post(`${$e(e)}/rescan${ne(e)}`,{})}async function bt(e,t,n){return(await F.patch(`${ue(e,t)}${ne(e)}`,n)).asset}async function yt(e,t){return F.delete(`${ue(e,t)}${ne(e)}`)}async function jt(e,t,n){return(await F.post(`${ue(e,t)}/upload${ne(e)}`,n)).asset}async function es(e,t){return(await F.post(`${ue(e,t)}/status-refresh${ne(e)}`,{})).asset}async function vt(e,t,n){const l={...e,placeId:n??e.placeId};return F.post(`${ue(e,t)}/usage-scan${ne(l)}`,{})}async function Ct(e,t){return F.post(`${$e(e)}/export-selection-rbxm${ne(e)}`,t)}async function _t(e,t,n){return F.post(`${ue(e,t)}/import-rbxm${ne(e)}`,n)}async function St(e,t){return(await F.post(`${ue(e,t)}/thumbnail-generate${ne(e)}`,{})).asset}function Cs(e){return e.fileUrl?`${we}${e.fileUrl}`:`${we}/api/assets/${e.scope.kind}/${e.category}/${encodeURIComponent(e.id)}/file${ne({scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0})}`}function Ye(e){return e.previewUrl?`${we}${e.previewUrl}`:`${we}/api/assets/${e.scope.kind}/${e.category}/${encodeURIComponent(e.id)}/preview${ne({scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0})}`}const _s=["all","image","decal","rbxm"],Nt=new Set(_s),ss=["model","animation"];function Ie(e){return/\.(rbxm|rbxmx)$/i.test(e.file.original)}function At(e){return Nt.has(e)}function qe(e,t){return e==="all"?t("assets.category.all","All"):t(`assets.category.${e}`,e==="rbxm"?"RBXM":e)}function ie(e,t){return qe(Ie(e)?"rbxm":e.category,t)}function Pt(e){return e==="all"?["image","decal",...ss]:e==="rbxm"?ss:[e]}function It(e,t){return t==="all"?e.category==="image"||e.category==="decal"||Ie(e):t==="rbxm"?Ie(e):(t==="model"||t==="animation")&&Ie(e)?!1:e.category===t}function kt(e){return[...e].sort((t,n)=>n.createdAt.localeCompare(t.createdAt)||n.id.localeCompare(t.id))}function Le(e){return e?e.split("/").filter(Boolean):[]}function Je(e,t){return t.every((n,l)=>e[l]===n)}function Ss(e,t){return t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id)}function se(e){const t=e.scope.kind==="place"?e.scope.placeId:"-";return`${e.scope.kind}:${t}:${e.category}:${e.id}`}function Ze(e){return Le(e.folderPath)}function wt(e,t){const n=Le(t),l=new Map;for(const o of e){const f=Ze(o);if(f.length<=n.length||!Je(f,n))continue;const g=f[n.length],x=[...n,g].join("/"),p=l.get(x);p?p.descendantCount+=1:l.set(x,{name:g,path:x,descendantCount:1})}return[...l.values()].sort((o,f)=>o.name.localeCompare(f.name))}function Rt(e,t){const n=Le(t);return e.filter(l=>{const o=Ze(l);return o.length===n.length&&Je(o,n)}).sort(Ss)}function $t(e){return[...e].sort(Ss)}function Lt(e,t){const n=Le(t);for(;n.length>0;){if(e.some(o=>{const f=Ze(o);return f.length>=n.length&&Je(f,n)}))return n.join("/");n.pop()}return""}const Ut="_page_leed4_1",Tt="_experimentalBadge_leed4_9",Bt="_toolbarShell_leed4_23",Et="_toolbar_leed4_23",Gt="_segmented_leed4_41",Mt="_placeContextSlot_leed4_45",Dt="_listContextSummary_leed4_50",Ft="_toolbarActions_leed4_54",Ot="_toolbarExpandedSummary_leed4_59",Ht="_placeFolderDetails_leed4_67",zt="_categoryControl_leed4_72",Kt="_placeStatusGroup_leed4_94",Wt="_contextTextSummary_leed4_95",Vt="_contextDivider_leed4_116",Yt="_categoryControlLabel_leed4_120",qt="_categoryRail_leed4_126",Xt="_categoryButton_leed4_134",Jt="_categoryButtonActive_leed4_163",Zt="_copyRow_leed4_176",Qt="_buttonRow_leed4_177",ea="_segmentedActive_leed4_219",sa="_placeSelectorLabel_leed4_224",ta="_placeSelect_leed4_224",aa="_sharedPlaceContext_leed4_251",la="_commandButton_leed4_277",na="_primaryButton_leed4_278",oa="_iconButton_leed4_279",ra="_dangerButton_leed4_319",ia="_iconButtonActive_leed4_340",da="_grid_leed4_353",ca="_folderGrid_leed4_361",ua="_explorer_leed4_370",pa="_explorerToolbar_leed4_377",ha="_explorerLocation_leed4_387",ma="_breadcrumb_leed4_413",xa="_breadcrumbSegment_leed4_414",ga="_viewOptions_leed4_457",fa="_organizationModeControl_leed4_465",ba="_viewModeControl_leed4_466",ya="_gridSizeControl_leed4_467",ja="_explorerSection_leed4_520",va="_folderTile_leed4_543",Ca="_folderListRow_leed4_568",_a="_assetListRow_leed4_569",Sa="_assetCard_leed4_570",Na="_folderIcon_leed4_575",Aa="_folderName_leed4_587",Pa="_folderCount_leed4_599",Ia="_assetList_leed4_569",ka="_folderList_leed4_568",wa="_assetListHeader_leed4_613",Ra="_listPreviewWrap_leed4_650",$a="_listPreview_leed4_650",La="_listPreviewFallback_leed4_652",Ua="_listAssetName_leed4_681",Ta="_listAssetCategory_leed4_693",Ba="_listAssetScope_leed4_694",Ea="_listAssetUpdated_leed4_695",Ga="_folderType_leed4_696",Ma="_folderScope_leed4_697",Da="_folderStatus_leed4_698",Fa="_folderUpdated_leed4_699",Oa="_assetCardSelected_leed4_728",Ha="_thumbnailWrap_leed4_733",za="_thumbnail_leed4_733",Ka="_thumbnailFallback_leed4_749",Wa="_assetCardBody_leed4_760",Va="_assetName_leed4_767",Ya="_assetMeta_leed4_775",qa="_statusChip_leed4_782",Xa="_categoryPill_leed4_783",Ja="_assetId_leed4_788",Za="_scopeText_leed4_789",Qa="_muted_leed4_790",el="_emptyState_leed4_795",sl="_notice_leed4_796",tl="_errorState_leed4_797",al="_messageState_leed4_798",ll="_emptyGuide_leed4_822",nl="_emptyGuideHeader_leed4_832",ol="_emptyGuideMethod_leed4_833",rl="_emptyGuideSteps_leed4_855",il="_emptyGuideMethods_leed4_861",dl="_emptyGuideMethodTitle_leed4_875",cl="_emptyGuideTierNote_leed4_893",ul="_emptyGuideMethodHelp_leed4_898",pl="_emptyGuideCapabilityDescription_leed4_899",hl="_emptyGuideChoices_leed4_905",ml="_emptyGuideChoice_leed4_905",xl="_emptyGuideChoiceSelected_leed4_933",gl="_emptyGuideChoiceLabel_leed4_943",fl="_emptyGuideCapability_leed4_899",bl="_emptyGuideAction_leed4_959",yl="_proNotice_leed4_989",jl="_rbxmGuide_leed4_1007",vl="_settingsInlinePanel_leed4_1047",Cl="_settingsDrawer_leed4_1067",_l="_detailPopupLayer_leed4_1083",Sl="_detailDialog_leed4_1099",Nl="_detailDialogHeader_leed4_1116",Al="_detailTitleBlock_leed4_1127",Pl="_detailEyebrow_leed4_1149",Il="_detailHeaderActions_leed4_1158",kl="_detailDialogBody_leed4_1166",wl="_detailPreviewPane_leed4_1175",Rl="_detailPreview_leed4_1175",$l="_detailPreviewFallback_leed4_1187",Ll="_detailContentPane_leed4_1223",Ul="_formStack_leed4_1229",Tl="_drawerHeader_leed4_1233",Bl="_detailSection_leed4_1284",El="_noticeList_leed4_1285",Gl="_settingsPanel_leed4_1286",Ml="_setupNotice_leed4_1303",Dl="_field_leed4_1328",Fl="_fieldLabelRow_leed4_1336",Ol="_fieldHelp_leed4_1360",Hl="_twoColumn_leed4_1365",zl="_technicalDetails_leed4_1376",Kl="_detailGrid_leed4_1393",Wl="_metadataList_leed4_1394",Vl="_compactMeta_leed4_1405",Yl="_copyableValue_leed4_1432",ql="_inlineCopyButton_leed4_1443",Xl="_hashText_leed4_1464",Jl="_usageList_leed4_1468",Zl="_usageItem_leed4_1474",Ql="_metadataItem_leed4_1475",en="_settingsSubsection_leed4_1523",sn="_settingsSectionHeader_leed4_1528",tn="_settingsDefinitionList_leed4_1541",an="_toggleRow_leed4_1563",ln="_inlineHelp_leed4_1577",a={page:Ut,experimentalBadge:Tt,toolbarShell:Bt,toolbar:Et,segmented:Gt,placeContextSlot:Mt,listContextSummary:Dt,toolbarActions:Ft,toolbarExpandedSummary:Ot,placeFolderDetails:Ht,categoryControl:zt,placeStatusGroup:Kt,contextTextSummary:Wt,contextDivider:Vt,categoryControlLabel:Yt,categoryRail:qt,categoryButton:Xt,categoryButtonActive:Jt,copyRow:Zt,buttonRow:Qt,segmentedActive:ea,placeSelectorLabel:sa,placeSelect:ta,sharedPlaceContext:aa,commandButton:la,primaryButton:na,iconButton:oa,dangerButton:ra,iconButtonActive:ia,grid:da,folderGrid:ca,explorer:ua,explorerToolbar:pa,explorerLocation:ha,breadcrumb:ma,breadcrumbSegment:xa,viewOptions:ga,organizationModeControl:fa,viewModeControl:ba,gridSizeControl:ya,explorerSection:ja,folderTile:va,folderListRow:Ca,assetListRow:_a,assetCard:Sa,folderIcon:Na,folderName:Aa,folderCount:Pa,assetList:Ia,folderList:ka,assetListHeader:wa,listPreviewWrap:Ra,listPreview:$a,listPreviewFallback:La,listAssetName:Ua,listAssetCategory:Ta,listAssetScope:Ba,listAssetUpdated:Ea,folderType:Ga,folderScope:Ma,folderStatus:Da,folderUpdated:Fa,assetCardSelected:Oa,thumbnailWrap:Ha,thumbnail:za,thumbnailFallback:Ka,assetCardBody:Wa,assetName:Va,assetMeta:Ya,statusChip:qa,categoryPill:Xa,assetId:Ja,scopeText:Za,muted:Qa,emptyState:el,notice:sl,errorState:tl,messageState:al,emptyGuide:ll,emptyGuideHeader:nl,emptyGuideMethod:ol,emptyGuideSteps:rl,emptyGuideMethods:il,emptyGuideMethodTitle:dl,emptyGuideTierNote:cl,emptyGuideMethodHelp:ul,emptyGuideCapabilityDescription:pl,emptyGuideChoices:hl,emptyGuideChoice:ml,emptyGuideChoiceSelected:xl,emptyGuideChoiceLabel:gl,emptyGuideCapability:fl,emptyGuideAction:bl,proNotice:yl,rbxmGuide:jl,settingsInlinePanel:vl,settingsDrawer:Cl,detailPopupLayer:_l,detailDialog:Sl,detailDialogHeader:Nl,detailTitleBlock:Al,detailEyebrow:Pl,detailHeaderActions:Il,detailDialogBody:kl,detailPreviewPane:wl,detailPreview:Rl,detailPreviewFallback:$l,detailContentPane:Ll,formStack:Ul,drawerHeader:Tl,detailSection:Bl,noticeList:El,settingsPanel:Gl,setupNotice:Ml,field:Dl,fieldLabelRow:Fl,fieldHelp:Ol,twoColumn:Hl,technicalDetails:zl,detailGrid:Kl,metadataList:Wl,compactMeta:Vl,copyableValue:Yl,inlineCopyButton:ql,hashText:Xl,usageList:Jl,usageItem:Zl,metadataItem:Ql,settingsSubsection:en,settingsSectionHeader:sn,settingsDefinitionList:tn,toggleRow:an,inlineHelp:ln},nn={image:Rs,decal:Zs,audio:Xs,mesh:et,model:ws,video:nt,animation:at};function Re(e,t){return t(`assets.status.${e}`,e)}function ts(e){switch(e){case"uploaded":return"success";case"failed":return"error";case"processing":case"uploading":return"warning";case"localOnly":case"superseded":default:return"neutral"}}function as(e){return e.category==="image"||e.category==="decal"||!!e.file.preview}function on(e){return e.category==="decal"?e.roblox.creatorAssetId??e.roblox.assetId:e.roblox.assetId}function Ns(e,t){var g;const n=((g=e.rbxm)==null?void 0:g.studioUploads)??[];if(n.length===0)return null;const l=n.filter(x=>x.status==="uploaded").length,o=n.filter(x=>x.status==="failed").length,f=[l>0?`${l} ${t("assets.detail.rbxmStudioUploadsUploaded","uploaded")}`:null,o>0?`${o} ${t("assets.detail.rbxmStudioUploadsFailed","failed")}`:null].filter(Boolean);return`${t("assets.detail.rbxmStudioUploadsLabel","Studio uploads")}: ${f.join(", ")}`}function rn({assets:e,selectedAssetId:t,selectedAssetKey:n=null,viewMode:l="grid",gridSize:o="medium",onSelect:f}){const{t:g}=ce();return e.length===0?s.jsxs("div",{className:a.emptyState,children:[s.jsx("p",{children:g("assets.empty.title","No assets yet")}),s.jsx("span",{children:g("assets.empty.body","Choose a scope and category, then rescan that inbox folder.")})]}):s.jsx("div",{className:l==="list"?a.assetList:a.grid,"data-view-mode":l,"data-grid-size":o,children:e.map(x=>{const p=nn[x.category],L=on(x),K=Ns(x,g),B=se(x),R=n?n===B:t===x.id,r=x.scope.kind==="shared"?g("assets.scope.shared","Shared"):g("assets.scope.place","Current Place");return l==="list"?s.jsxs("button",{type:"button",className:[a.assetListRow,R?a.assetCardSelected:""].filter(Boolean).join(" "),onClick:()=>f(B),children:[s.jsx("span",{className:a.listPreviewWrap,children:as(x)?s.jsx("img",{className:a.listPreview,src:Ye(x),alt:"",loading:"lazy"}):s.jsx("span",{className:a.listPreviewFallback,"aria-hidden":"true",children:s.jsx(p,{size:18})})}),s.jsx("span",{className:a.listAssetName,children:x.displayName}),s.jsx("span",{className:a.listAssetCategory,children:ie(x,g)}),s.jsx("span",{className:a.listAssetScope,children:r}),s.jsx(me,{variant:ts(x.status),className:a.statusChip,children:Re(x.status,g)}),s.jsx("time",{className:a.listAssetUpdated,dateTime:x.updatedAt,children:new Date(x.updatedAt).toLocaleDateString()})]},B):s.jsxs("button",{type:"button",className:[a.assetCard,R?a.assetCardSelected:""].filter(Boolean).join(" "),onClick:()=>f(B),children:[s.jsx("span",{className:a.thumbnailWrap,children:as(x)?s.jsx("img",{className:a.thumbnail,src:Ye(x),alt:x.displayName,loading:"lazy"}):s.jsx("span",{className:a.thumbnailFallback,"aria-hidden":"true",children:s.jsx(p,{size:30})})}),s.jsxs("span",{className:a.assetCardBody,children:[s.jsx("span",{className:a.assetName,children:x.displayName}),s.jsxs("span",{className:a.assetMeta,children:[s.jsx(me,{variant:"neutral",className:a.categoryPill,children:ie(x,g)}),s.jsx(me,{variant:ts(x.status),className:a.statusChip,children:Re(x.status,g)})]}),s.jsxs("span",{className:a.assetMeta,children:[s.jsx("span",{className:a.scopeText,children:r}),s.jsx("span",{className:a.assetId,children:L?`#${L}`:K??g("assets.status.localOnly","Local only")})]})]})]},B)})})}function ls(e){return{scope:e==="all"?null:e,folderPath:""}}function ze(e,t,n){return t==="shared"?e.scope.kind==="shared":e.scope.kind==="place"&&(n===null||e.scope.placeId===n)}function dn(e,t){var n;return t?e.folderPath===t||((n=e.folderPath)==null?void 0:n.startsWith(`${t}/`))===!0:!0}function cn({displayScope:e,assets:t,place:n,categoryFilter:l,organizationMode:o,viewMode:f,gridSize:g,selectedAssetKey:x,onSelectAsset:p,onClearSelection:L,onOrganizationModeChange:K,onViewModeChange:B,onGridSizeChange:R,emptyContent:r}){const{t:b}=ce(),[N,T]=c.useState(()=>ls(e)),W=c.useRef(`${e}:${n.placeId??"-"}`),V=c.useRef(!1),D=c.useRef(null),G=m=>m==="shared"?b("assets.scope.shared","Shared"):n.placeName??b("assets.scope.place","Current Place"),E=m=>{V.current=!0,T(m),L()};c.useEffect(()=>{const m=`${e}:${n.placeId??"-"}`;W.current!==m&&(W.current=m,V.current=!0,T(ls(e)),L())},[e,L,n.placeId]),c.useEffect(()=>{var m;V.current&&(V.current=!1,(m=D.current)==null||m.focus())},[N]);const H=c.useMemo(()=>N.scope===null?[]:t.filter(m=>ze(m,N.scope,n.placeId)),[t,N.scope,n.placeId]);c.useEffect(()=>{if(N.scope===null)return;const m=Lt(H,N.folderPath);m!==N.folderPath&&(V.current=!0,T(U=>({...U,folderPath:m})),L())},[l,N.folderPath,N.scope,L,H]);const M=c.useMemo(()=>o==="folders"?wt(H,N.folderPath):[],[N.folderPath,o,H]),q=c.useMemo(()=>e==="all"?t:t.filter(m=>ze(m,e,n.placeId)),[t,e,n.placeId]),P=c.useMemo(()=>o==="all-assets"?$t(q):Rt(H,N.folderPath),[q,N.folderPath,o,H]);c.useEffect(()=>{x&&(P.some(m=>se(m)===x)||L())},[L,x,P]);const I=N.folderPath?N.folderPath.split("/"):[],X=o==="all-assets"?b("assets.organization.all","All assets"):I[I.length-1]??(N.scope?G(N.scope):b("assets.scope.all","All scopes")),$=N.scope===null?t.length:H.filter(m=>dn(m,N.folderPath)).length,y=Math.max(0,$-P.length),i=o==="all-assets"?b("assets.organization.summary","{count} assets").replace("{count}",String(P.length)):b("assets.explorer.summary","{direct} in this folder · {descendant} in subfolders").replace("{direct}",String(P.length)).replace("{descendant}",String(y)),A=m=>m===1?b("assets.folder.count.one","1 asset"):b("assets.folder.count.many","{count} assets").replace("{count}",String(m)),te=(m,U,h,z,_)=>s.jsxs("button",{type:"button",className:f==="list"?a.folderListRow:a.folderTile,"aria-label":`${U}, ${A(h)}`,onClick:_,children:[s.jsx("span",{className:a.folderIcon,"aria-hidden":"true",children:s.jsx($s,{size:f==="list"?22:28})}),s.jsx("span",{className:a.folderName,children:U}),f==="list"?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:a.folderType,children:b("assets.folder.type","Folder")}),s.jsx("span",{className:a.folderScope,children:G(z)}),s.jsx("span",{className:a.folderStatus,children:A(h)}),s.jsx("span",{className:a.folderUpdated,children:"—"})]}):s.jsx("span",{className:a.folderCount,children:A(h)})]},m),w=o==="folders"&&e==="all"&&N.scope===null?[{scope:"place",name:G("place")},{scope:"shared",name:G("shared")}].map(({scope:m,name:U})=>({scope:m,name:U,count:t.filter(h=>ze(h,m,n.placeId)).length})):[];return s.jsxs("section",{className:a.explorer,"aria-label":b("assets.explorer.label","Asset explorer"),children:[s.jsxs("div",{className:a.explorerToolbar,children:[s.jsxs("div",{className:a.explorerLocation,children:[s.jsxs("nav",{className:a.breadcrumb,"aria-label":b("assets.breadcrumb.label","Asset path"),children:[o==="all-assets"?s.jsxs(s.Fragment,{children:[s.jsx("span",{children:e==="all"?b("assets.scope.all","All scopes"):G(e)}),s.jsx(He,{size:14,"aria-hidden":"true"}),s.jsx("span",{"aria-current":"page",children:b("assets.organization.all","All assets")})]}):e==="all"?N.scope===null?s.jsx("span",{"aria-current":"page",children:b("assets.scope.all","All scopes")}):s.jsx("button",{type:"button",onClick:()=>E({scope:null,folderPath:""}),children:b("assets.scope.all","All scopes")}):null,o==="folders"&&N.scope?s.jsxs(s.Fragment,{children:[e==="all"?s.jsx(He,{size:14,"aria-hidden":"true"}):null,I.length>0?s.jsx("button",{type:"button",onClick:()=>E({scope:N.scope,folderPath:""}),children:G(N.scope)}):s.jsx("span",{"aria-current":"page",children:G(N.scope)})]}):null,o==="folders"&&I.map((m,U)=>{const h=I.slice(0,U+1).join("/"),z=U===I.length-1;return s.jsxs("span",{className:a.breadcrumbSegment,children:[s.jsx(He,{size:14,"aria-hidden":"true"}),z?s.jsx("span",{"aria-current":"page",children:m}):s.jsx("button",{type:"button",onClick:()=>E({scope:N.scope,folderPath:h}),children:m})]},h)})]}),s.jsx("h2",{ref:D,tabIndex:-1,children:X}),s.jsx("p",{children:i})]}),s.jsxs("div",{className:a.viewOptions,"aria-label":b("assets.view.options","View options"),children:[s.jsxs("div",{className:a.organizationModeControl,role:"group","aria-label":b("assets.organization.label","Browse"),children:[s.jsx("button",{type:"button","aria-pressed":o==="folders",onClick:()=>K("folders"),children:b("assets.organization.folders","Folders")}),s.jsx("button",{type:"button","aria-pressed":o==="all-assets",onClick:()=>K("all-assets"),children:b("assets.organization.all","All assets")})]}),s.jsxs("div",{className:a.viewModeControl,role:"group","aria-label":b("assets.view.mode","View mode"),children:[s.jsxs("button",{type:"button","aria-pressed":f==="grid",onClick:()=>B("grid"),children:[s.jsx(dt,{size:14}),b("assets.view.grid","Grid")]}),s.jsxs("button",{type:"button","aria-pressed":f==="list",onClick:()=>B("list"),children:[s.jsx(ut,{size:14}),b("assets.view.list","List")]})]}),s.jsx("div",{className:a.gridSizeControl,role:"group","aria-label":b("assets.view.thumbnailSize","Thumbnail size"),title:f==="list"?b("assets.view.thumbnailSize.listReason","Thumbnail size is available in Grid view."):void 0,children:["small","medium","large"].map(m=>s.jsx("button",{type:"button","aria-pressed":g===m,disabled:f==="list",onClick:()=>R(m),children:b(`assets.view.size.${m}`,m[0].toUpperCase()+m.slice(1))},m))})]})]}),f==="list"&&(w.length>0||M.length>0||P.length>0)?s.jsxs("div",{className:a.assetListHeader,"aria-hidden":"true",children:[s.jsx("span",{}),s.jsx("span",{children:b("assets.list.name","Name")}),s.jsx("span",{children:b("assets.list.type","Type")}),s.jsx("span",{children:b("assets.list.scope","Scope")}),s.jsx("span",{children:b("assets.list.status","Status")}),s.jsx("span",{children:b("assets.list.updated","Updated")})]}):null,w.length>0?s.jsxs("section",{className:a.explorerSection,children:[s.jsx("h3",{children:b("assets.folders.title","Folders")}),s.jsx("div",{className:f==="list"?a.folderList:a.folderGrid,"data-grid-size":g,children:w.map(m=>te(`scope:${m.scope}`,m.name,m.count,m.scope,()=>E({scope:m.scope,folderPath:""})))})]}):null,M.length>0?s.jsxs("section",{className:a.explorerSection,children:[s.jsx("h3",{children:b("assets.folders.title","Folders")}),s.jsx("div",{className:f==="list"?a.folderList:a.folderGrid,"data-grid-size":g,children:M.map(m=>te(m.path,m.name,m.descendantCount,N.scope,()=>E({scope:N.scope,folderPath:m.path})))})]}):null,P.length>0?s.jsxs("section",{className:a.explorerSection,"aria-label":o==="all-assets"?b("assets.organization.all","All assets"):void 0,children:[o==="folders"?s.jsx("h3",{children:b("assets.folder.assetsTitle","Assets in this folder")}):null,s.jsx(rn,{assets:P,selectedAssetId:null,selectedAssetKey:x,viewMode:f,gridSize:g,onSelect:p})]}):null,M.length===0&&P.length===0&&(w.length===0||t.length===0)?l==="all"&&t.length===0&&r?r:s.jsxs("div",{className:a.emptyState,children:[s.jsx("p",{children:t.length===0?l==="all"?b("assets.empty.title","No assets yet"):b("assets.empty.filteredTitle","No assets match this filter"):b("assets.empty.folderTitle","No matching assets in this folder")}),s.jsx("span",{children:t.length===0?l==="all"?b("assets.empty.body","Choose a scope and category, then rescan that inbox folder."):b("assets.empty.filteredBody","Choose another category or rescan the matching inbox folders."):b("assets.empty.folderBody","Try another folder or category filter.")})]}):null]})}function un(e){return{generate:{id:"generate-image",title:e("assets.emptyGuide.ai.generateTitle","Generate and register a new image"),request:e("assets.emptyGuide.ai.generateRequest","Create an image asset for this project. If your current tools can generate image files, first confirm its intended use, size, style, transparent-background needs, and whether to save it for the current Place or Shared. Generate the file, avoid duplicating an existing asset, register it in the WEPPY Asset Library, and make the result available on the Assets page. If you cannot generate image files, tell me and ask for an existing file location instead. Do not upload it to Roblox unless I ask.")},register:{id:"register-image",title:e("assets.emptyGuide.ai.imageTitle","Register an image file you already have"),request:e("assets.emptyGuide.ai.imageRequest","Register an image file for this project in the WEPPY Asset Library. First confirm the file location and whether to save it for the current Place or Shared. Avoid creating a duplicate of an existing asset, do not upload it to Roblox, and make the result available on the Assets page.")}}}function pn(e){const{locale:t,t:n}=ce(),[l,o]=c.useState("register"),f=un(n),g=e.scope==="all"?n("assets.emptyGuide.scope.all","Choose Current Place or Shared before adding files."):e.scope==="shared"?n("assets.emptyGuide.scope.shared","New files will be registered in the Shared library."):n("assets.emptyGuide.scope.place","New files will be registered for the selected Place.");return s.jsxs("section",{className:a.emptyGuide,children:[s.jsxs("header",{className:a.emptyGuideHeader,children:[s.jsx("h3",{children:n("assets.emptyGuide.title","Collect assets for your game")}),s.jsx("p",{children:n("assets.emptyGuide.description","Register image files or save a selected Studio model, then manage them here.")})]}),s.jsxs("div",{className:a.emptyGuideMethods,children:[s.jsxs("section",{className:a.emptyGuideMethod,children:[s.jsxs("div",{className:a.emptyGuideMethodTitle,children:[s.jsx(Ks,{size:16,"aria-hidden":"true"}),s.jsx("h4",{children:n("assets.emptyGuide.ai.title","Ask AI")})]}),s.jsx("p",{className:a.emptyGuideMethodHelp,children:n("assets.emptyGuide.ai.methodHelp","Choose a method that matches your AI. If you are unsure, register an existing image.")}),s.jsxs("div",{className:a.emptyGuideChoices,role:"radiogroup","aria-label":n("assets.emptyGuide.ai.methodLabel","Image preparation method"),children:[s.jsxs("button",{type:"button",role:"radio","aria-checked":l==="register",className:`${a.emptyGuideChoice} ${l==="register"?a.emptyGuideChoiceSelected:""}`,onClick:()=>o("register"),children:[s.jsx("span",{className:a.emptyGuideChoiceLabel,children:n("assets.emptyGuide.ai.registerOption","Register an existing image")}),s.jsx("span",{className:a.emptyGuideCapability,children:n("assets.emptyGuide.ai.registerCapability","Image generation not required")})]}),s.jsxs("button",{type:"button",role:"radio","aria-checked":l==="generate",className:`${a.emptyGuideChoice} ${l==="generate"?a.emptyGuideChoiceSelected:""}`,onClick:()=>o("generate"),children:[s.jsx("span",{className:a.emptyGuideChoiceLabel,children:n("assets.emptyGuide.ai.generateOption","Generate a new image")}),s.jsx("span",{className:a.emptyGuideCapability,children:n("assets.emptyGuide.ai.generateCapability","Image generation required")})]})]}),s.jsx("p",{className:a.emptyGuideCapabilityDescription,children:l==="register"?n("assets.emptyGuide.ai.registerDescription","Use this when you already have an image file or are unsure whether your AI can generate images."):n("assets.emptyGuide.ai.generateDescription","Use this only when your AI can create PNG or JPG files or has an image generation tool.")}),s.jsx(zs,{examples:[f[l]],resetKey:`${t}|assets-${l}`,labels:{copy:n("guidance.ai.copy","Copy request"),copying:n("guidance.ai.copying","Copying…"),copied:n("guidance.ai.copied","Copied"),copyFailed:n("guidance.ai.copyFailed","Could not copy. Select the request text and copy it manually.")},nextStep:n("guidance.ai.nextStep","Paste this request into an AI chat connected to WEPPY.")})]}),s.jsxs("section",{className:a.emptyGuideMethod,children:[s.jsxs("div",{className:a.emptyGuideMethodTitle,children:[s.jsx(rt,{size:16,"aria-hidden":"true"}),s.jsx("h4",{children:n("assets.emptyGuide.direct.title","Add files yourself")})]}),s.jsx("p",{children:g}),s.jsxs("ol",{className:a.emptyGuideSteps,children:[s.jsx("li",{children:n("assets.emptyGuide.direct.image","Put image or decal files in the inbox for the selected scope, then rescan.")}),s.jsx("li",{children:n("assets.emptyGuide.direct.model","For models, select objects in Studio and save them from WEPPY Plugin > Assets.")}),s.jsx("li",{children:n("assets.emptyGuide.direct.upload","Upload registered assets to Roblox from the asset details with Roblox Open Cloud (Pro).")})]}),!e.isPro&&s.jsx("p",{className:a.emptyGuideTierNote,children:n("assets.emptyGuide.direct.pro","Saving Studio models as RBXM and uploading assets to Roblox are available with Pro. Local image and decal registration is available on Basic.")}),s.jsx("button",{type:"button",className:a.emptyGuideAction,disabled:e.busy,onClick:e.onRescan,children:n("assets.emptyGuide.direct.rescan","Rescan inbox")})]})]})]})}const hn="https://create.roblox.com/dashboard/creations/store",mn=/^https:\/\/create\.roblox\.com\/store\/asset\/\d+(?:\/.*)?$/;function xn(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function ke(e){const t=new Date(e);if(Number.isNaN(t.getTime()))return e;const n=t.getFullYear(),l=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),f=String(t.getHours()).padStart(2,"0"),g=String(t.getMinutes()).padStart(2,"0");return`${n}-${l}-${o} ${f}:${g}`}function gn(e){return e.category==="image"||e.category==="decal"||!!e.file.preview}function fn(e){return e.file.preview?Ye(e):Cs(e)}function bn(e){var n;const t=Object.entries(((n=e.rbxm)==null?void 0:n.classCounts)??{}).sort((l,o)=>o[1]-l[1]).slice(0,8);return t.length===0?"-":t.map(([l,o])=>`${l} ${o}`).join(", ")}function ns(e){var o;const t=(o=e.rbxm)==null?void 0:o.thumbnail;if(!t)return"-";const n=t.source?` via ${t.source}`:"",l=t.message?` · ${t.message}`:"";return`${t.status}${n}${l}`}function yn(e){var o,f;const t=(f=(o=e.rbxm)==null?void 0:o.review)==null?void 0:f.summary;if(!t)return"-";const n=[["roots",t.rootCount],["parts",t.partCount],["mesh parts",t.meshPartCount],["scripts",t.scriptCount],["unanchored",t.unanchoredPartCount]].flatMap(([g,x])=>typeof x=="number"?[`${g} ${x}`]:[]),l=t.bounds;if(l&&typeof l=="object"&&"size"in l){const g=l.size;if(g&&typeof g=="object"){const{x,y:p,z:L}=g;typeof x=="number"&&typeof p=="number"&&typeof L=="number"&&n.push(`bounds ${x} x ${p} x ${L}`)}}return n.length>0?n.join(", "):"-"}function jn(e){var n,l;const t=(n=e.rbxm)==null?void 0:n.generation;return t?t.schemaMode==="custom"&&((l=t.schemaGroups)!=null&&l.length)?`custom · ${t.schemaGroups.join(", ")}`:t.predefinedSchema?`${t.schemaMode??"predefined"} · ${t.predefinedSchema}`:t.schemaMode??"-":"-"}function os(e){const{width:t,height:n}=e.file;return t===null||n===null?null:`${t} x ${n}px`}function rs(e){const{durationMs:t}=e.file;return t===null?null:t<1e3?`${t} ms`:`${(t/1e3).toFixed(1)} s`}function vn(e){return`${hn}/${e}/configure`}function Cn(e){return e.category==="decal"?e.roblox.creatorAssetId??e.roblox.assetId??null:e.roblox.assetId??null}function _n(e){const t=Cn(e),n=t?vn(t):null,l=e.category==="decal"?e.roblox.creatorAssetWebUrl??e.roblox.assetWebUrl:e.roblox.assetWebUrl;return!l||n&&mn.test(l)?n:l}function Sn(e){return`${ke(e.startedAt)} -> ${e.status}`}function is(e){return!e.creatorType||!e.creatorId?null:`${e.creatorType} ${e.creatorId}`}function ds(e){return e.assetRole?`Asset role: ${e.assetRole}`:null}function Nn(e){const t=e.sourceProperty?` · ${e.sourceProperty}`:"";return`${e.path} · ${e.assetType} · ${e.status}${t}`}function An(e){return e.assetUri&&e.assetId?`${e.assetUri} (#${e.assetId})`:e.assetUri?e.assetUri:e.assetId?`#${e.assetId}`:e.message??"-"}function Ne({label:e,value:t}){return t?s.jsx("button",{type:"button",className:a.inlineCopyButton,"aria-label":e,title:e,onClick:()=>{var n;return void((n=navigator.clipboard)==null?void 0:n.writeText(t))},children:s.jsx(js,{size:13})}):null}function Pn({asset:e,busyAction:t,canUpload:n,canImportRbxm:l,importRbxmTooltip:o,importRbxmTargetParent:f,onClose:g,onSave:x,onUpload:p,onDelete:L,onImportRbxm:K,onRefreshStatus:B,onScanUsage:R}){var $,y;const{t:r}=ce(),b=c.useRef(null),[N,T]=c.useState(""),[W,V]=c.useState("");if(c.useEffect(()=>{T((e==null?void 0:e.displayName)??""),V((e==null?void 0:e.description)??"")},[e==null?void 0:e.description,e==null?void 0:e.displayName,e==null?void 0:e.id]),c.useEffect(()=>{var A;if(!e)return;(A=b.current)==null||A.focus();const i=te=>{te.key==="Escape"&&g()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e,g]),!e)return null;const D=e.status==="processing"&&!!(e.roblox.operationId??e.roblox.operationPath),G=!!e.roblox.assetUri,E=_n(e),H=e.roblox.uploadAttempts??[],M=e.category==="decal"&&!!(e.roblox.creatorAssetId||e.roblox.backingImageAssetId||e.roblox.assetId),q=e.roblox.creatorAssetId??e.roblox.assetId,P=e.roblox.backingImageAssetId??e.roblox.assetId,I=Ns(e,r),X=e.roblox.assetId?e.usage.lastScannedAt?r("assets.detail.noUsageAfterScan","No references were found in local Sync files during the last check."):r("assets.detail.noUsageUnscanned","Run Scan usage to search local Sync files for this Roblox Asset ID."):r("assets.detail.noUsageNoRobloxId","This asset does not have a Roblox Asset ID yet, so usage cannot be checked. Upload it before scanning usage.");return s.jsx("div",{className:a.detailPopupLayer,onClick:g,role:"presentation",children:s.jsxs("section",{ref:b,className:a.detailDialog,role:"dialog","aria-modal":"true","aria-label":r("assets.detail.title","Asset details"),tabIndex:-1,onClick:i=>i.stopPropagation(),children:[s.jsxs("div",{className:a.detailDialogHeader,children:[s.jsxs("div",{className:a.detailTitleBlock,children:[s.jsxs("span",{className:a.detailEyebrow,children:[ie(e,r)," · ",Re(e.status,r)]}),s.jsx("h2",{children:e.displayName}),s.jsx("span",{children:e.id})]}),s.jsxs("div",{className:a.detailHeaderActions,children:[s.jsx(ee,{text:n?r("assets.upload.open.tooltip","Upload this local file to Roblox through Open Cloud."):r("assets.proOnly.tooltip","Roblox upload is available on Pro."),children:s.jsxs("button",{type:"button",className:a.commandButton,disabled:!n,onClick:p,children:[s.jsx(xt,{size:15}),r("assets.upload.open","Upload")]})}),l&&s.jsx(ee,{text:o,children:s.jsxs("button",{type:"button",className:a.commandButton,disabled:t==="import-rbxm",onClick:()=>void K(),children:[s.jsx(Ls,{size:15}),r("assets.detail.importRbxm","Insert into Studio")]})}),s.jsxs("button",{type:"button",className:a.commandButton,disabled:!D||t==="status-refresh",onClick:()=>void B(),children:[s.jsx(fs,{size:15}),r("assets.detail.refreshStatus","Refresh")]}),s.jsxs("button",{type:"button",className:a.commandButton,disabled:!e.roblox.assetId||t==="usage-scan",onClick:()=>void R(),children:[s.jsx(ht,{size:15}),r("assets.detail.scanUsage","Scan usage")]}),s.jsx(ee,{text:r("assets.delete.tooltip","Delete this local Asset Library item."),children:s.jsxs("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:t==="delete",onClick:L,children:[s.jsx(Ws,{size:15}),r("common.delete","Delete")]})}),s.jsx(ee,{text:r("common.close","Close"),children:s.jsx("button",{type:"button",className:a.iconButton,onClick:g,"aria-label":r("common.close","Close"),children:s.jsx(Xe,{size:16})})})]})]}),s.jsxs("div",{className:a.detailDialogBody,children:[s.jsx("div",{className:a.detailPreviewPane,children:gn(e)?s.jsx("img",{className:a.detailPreview,src:fn(e),alt:e.displayName}):s.jsxs("div",{className:a.detailPreviewFallback,children:[s.jsx("span",{children:ie(e,r)}),s.jsx("code",{children:e.file.original}),(($=e.rbxm)==null?void 0:$.thumbnail)&&s.jsx("small",{children:ns(e)})]})}),s.jsxs("div",{className:a.detailContentPane,children:[s.jsxs("div",{className:a.formStack,children:[s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:r("assets.detail.displayName","Display name")}),s.jsx("input",{value:N,onChange:i=>T(i.target.value)})]}),s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:r("assets.detail.description","Description")}),s.jsx("textarea",{value:W,rows:3,onChange:i=>V(i.target.value)})]}),s.jsx("button",{type:"button",className:a.primaryButton,disabled:t==="update",onClick:()=>void x(N,W),children:r("assets.detail.save","Save metadata")})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:r("assets.detail.localFile","Local file")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:r("assets.detail.fileName","File")}),s.jsx("dd",{children:e.file.original}),s.jsx("dt",{children:r("assets.detail.source","Source path")}),s.jsx("dd",{children:e.source.originalPath}),s.jsx("dt",{children:r("assets.detail.category","Category")}),s.jsx("dd",{children:ie(e,r)}),s.jsx("dt",{children:r("assets.detail.scope","Scope")}),s.jsx("dd",{children:e.scope.kind==="shared"?r("assets.scope.shared","Shared"):r("assets.scope.place","Current Place")}),s.jsx("dt",{children:r("assets.detail.mimeType","Type")}),s.jsx("dd",{children:e.file.mimeType}),s.jsx("dt",{children:r("assets.detail.size","Size")}),s.jsx("dd",{children:xn(e.file.sizeBytes)}),os(e)&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.dimensions","Dimensions")}),s.jsx("dd",{children:os(e)})]}),rs(e)&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.duration","Duration")}),s.jsx("dd",{children:rs(e)})]})]})]}),e.rbxm&&s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:r("assets.detail.rbxm","RBXM contents")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:r("assets.detail.rbxmExportedCount","Exported roots")}),s.jsx("dd",{children:e.rbxm.exportedCount}),s.jsx("dt",{children:r("assets.detail.rbxmClasses","Classes")}),s.jsx("dd",{children:bn(e)}),s.jsx("dt",{children:r("assets.detail.rbxmThumbnail","Thumbnail")}),s.jsx("dd",{children:ns(e)}),I&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.rbxmStudioUploadsLabel","Studio uploads")}),s.jsx("dd",{children:I})]}),l&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.studioInsertTarget","Studio insert target")}),s.jsx("dd",{children:f})]})]}),e.rbxm.roots.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:r("assets.detail.rbxmRoots","Root tree")}),e.rbxm.roots.map(i=>s.jsxs("div",{className:a.metadataItem,children:[s.jsxs("span",{children:[i.name," (",i.className,")"]}),s.jsx("code",{children:i.path})]},`${i.path}-${i.className}`))]}),e.rbxm.resourceReferences.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:r("assets.detail.rbxmReferences","Asset references")}),e.rbxm.resourceReferences.map((i,A)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsxs("span",{children:[i.path," · ",i.property]}),s.jsx("code",{children:i.assetId?`${i.value} (#${i.assetId})`:i.value})]},`${i.path}-${i.property}-${A}`))]}),e.rbxm.studioUploads&&e.rbxm.studioUploads.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:r("assets.detail.rbxmStudioUploads","Embedded Studio uploads")}),e.rbxm.studioUploads.map((i,A)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:Nn(i)}),s.jsx("code",{children:An(i)})]},`${i.path}-${i.assetType}-${i.sourceProperty??""}-${A}`))]}),e.rbxm.generation&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:r("assets.detail.rbxmGeneration","Generated model")}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:r("assets.detail.rbxmGenerationProvider","Provider")}),s.jsx("code",{children:e.rbxm.generation.provider})]}),e.rbxm.generation.prompt&&s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:r("assets.detail.rbxmGenerationPrompt","Prompt")}),s.jsx("code",{children:e.rbxm.generation.prompt})]}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:r("assets.detail.rbxmGenerationSchema","Schema")}),s.jsx("code",{children:jn(e)})]}),e.rbxm.generation.path&&s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:r("assets.detail.rbxmGenerationPath","Studio path")}),s.jsx("code",{children:e.rbxm.generation.path})]})]}),e.rbxm.review&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:r("assets.detail.rbxmReview","Model review")}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:r("assets.detail.rbxmReviewReadiness","Readiness")}),s.jsx("code",{children:e.rbxm.review.readiness})]}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:r("assets.detail.rbxmReviewSummary","Summary")}),s.jsx("code",{children:yn(e)})]}),e.rbxm.review.findings.slice(0,8).map((i,A)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsxs("span",{children:[i.severity," · ",i.category," · ",i.code]}),s.jsx("code",{children:i.path?`${i.path}: ${i.message}`:i.message})]},`${i.code}-${i.path}-${A}`))]})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:r("assets.detail.roblox","Roblox upload status")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:r("assets.detail.status","Status")}),s.jsx("dd",{children:Re(e.status,r)}),M?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.decalAssetId","Roblox Decal ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:q??r("assets.status.localOnly","Local only")}),s.jsx(Ne,{label:r("assets.detail.copyDecalAssetId","Copy Roblox Decal ID"),value:q})]}),s.jsx("dt",{children:r("assets.detail.studioTextureImageId","Studio Texture Image ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:P??"-"}),s.jsx(Ne,{label:r("assets.detail.copyStudioTextureImageId","Copy Studio Texture Image ID"),value:P})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.assetId","Asset ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:e.roblox.assetId??r("assets.status.localOnly","Local only")}),s.jsx(Ne,{label:r("assets.detail.copyAssetId","Copy Asset ID"),value:e.roblox.assetId})]})]}),s.jsx("dt",{children:r("assets.detail.studioUri","Studio URI")}),s.jsx("dd",{children:e.roblox.assetUri??"-"}),s.jsx("dt",{children:r("assets.detail.robloxWebUrl","Creator Dashboard URL")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:E??"-"}),s.jsx(Ne,{label:r("assets.detail.copyWebUrl","Copy configure URL"),value:E})]}),e.roblox.errorMessage&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.error","Error")}),s.jsx("dd",{children:e.roblox.errorMessage})]})]}),s.jsxs("div",{className:a.copyRow,children:[s.jsxs("button",{type:"button",className:a.commandButton,disabled:!G,onClick:()=>{var i;return e.roblox.assetUri&&void((i=navigator.clipboard)==null?void 0:i.writeText(e.roblox.assetUri))},children:[s.jsx(js,{size:15}),r("assets.detail.copyStudioUri","Copy Studio URI")]}),E&&s.jsxs("a",{className:a.commandButton,href:E,target:"_blank",rel:"noreferrer",children:[s.jsx(Us,{size:15}),r("assets.detail.openRobloxPage","Open configure page")]})]}),e.roblox.assetId&&s.jsx("p",{className:a.muted,children:r("assets.detail.robloxWebUrlNotice","Opening this page requires the Roblox account that owns or can manage the uploaded asset.")}),H.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:r("assets.detail.uploadHistory","Upload history")}),H.slice().reverse().map((i,A)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:Sn(i)}),is(i)&&s.jsx("code",{children:is(i)}),ds(i)&&s.jsx("code",{children:ds(i)}),i.operationPath&&s.jsx("code",{children:i.operationPath}),i.assetId&&s.jsxs("code",{children:[r("assets.detail.assetId","Asset ID"),": ",i.assetId]}),i.remotePath&&s.jsx("code",{children:i.remotePath}),i.message&&s.jsx("code",{children:i.message}),i.errorMessage&&s.jsx("code",{children:i.errorMessage})]},`${i.startedAt}-${i.operationPath??A}`))]})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:r("assets.detail.usedInPlace","Where this asset is used in this Place")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:r("assets.detail.usageSource","Checked against")}),s.jsx("dd",{children:e.usage.scanSource==="localSync"?r("assets.detail.usageSource.localSync","Local Sync files"):r("assets.detail.usageSource.notScanned","Not checked yet")}),s.jsx("dt",{children:r("assets.detail.lastScanned","Last checked")}),s.jsx("dd",{children:e.usage.lastScannedAt?r("assets.detail.lastScannedAt","Last checked: {time}").replace("{time}",ke(e.usage.lastScannedAt)):r("assets.detail.lastScanned.never","No check yet")})]}),e.usage.references.length===0?s.jsx("p",{className:a.muted,children:X}):s.jsx("div",{className:a.usageList,children:e.usage.references.map((i,A)=>s.jsxs("div",{className:a.usageItem,children:[s.jsx("strong",{children:i.kind==="property"?i.instancePath:i.filePath}),s.jsx("span",{children:i.property??r("assets.detail.line","line {line}").replace("{line}",String(i.line??"-"))}),s.jsx("code",{children:i.value})]},`${i.kind}-${A}`))})]}),s.jsxs("details",{className:a.technicalDetails,children:[s.jsx("summary",{children:r("assets.detail.technicalDetails","Technical details")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:r("assets.detail.stableId","Stable ID")}),s.jsx("dd",{className:a.hashText,children:e.id}),s.jsx("dt",{children:r("assets.detail.sourceKind","Source kind")}),s.jsx("dd",{children:e.source.kind}),s.jsx("dt",{children:r("assets.detail.sha256","SHA-256")}),s.jsx("dd",{className:a.hashText,children:e.file.sha256}),s.jsx("dt",{children:r("assets.detail.createdAt","Created")}),s.jsx("dd",{children:ke(e.createdAt)}),s.jsx("dt",{children:r("assets.detail.updatedAt","Updated")}),s.jsx("dd",{children:ke(e.updatedAt)}),e.roblox.operationId&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.operationId","Operation ID")}),s.jsx("dd",{className:a.hashText,children:e.roblox.operationId})]}),e.roblox.operationPath&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.operationPath","Operation path")}),s.jsx("dd",{className:a.hashText,children:e.roblox.operationPath})]}),e.roblox.versionId&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.versionId","Version ID")}),s.jsx("dd",{className:a.hashText,children:e.roblox.versionId})]}),e.roblox.remotePath&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.remotePath","Remote path")}),s.jsx("dd",{className:a.hashText,children:e.roblox.remotePath})]}),e.roblox.moderationState&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:r("assets.detail.moderationState","Moderation")}),s.jsx("dd",{children:e.roblox.moderationState})]})]}),((y=e.rbxm)==null?void 0:y.thumbnail.attempts)&&e.rbxm.thumbnail.attempts.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:r("assets.detail.rbxmThumbnailAttempts","Thumbnail attempts")}),e.rbxm.thumbnail.attempts.map((i,A)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsxs("span",{children:[i.method," · ",i.status]}),i.message&&s.jsx("code",{children:i.message})]},`${i.method}-${A}`))]})]})]})]})]})})}function As(e){return{assetUploadByOpenCloudEnabled:e.hot.ENABLE_ASSET_UPLOAD_BY_OPEN_CLOUD===!0}}function In(e){const t={};return typeof e.assetUploadByOpenCloudEnabled=="boolean"&&(t.ENABLE_ASSET_UPLOAD_BY_OPEN_CLOUD=e.assetUploadByOpenCloudEnabled),t}async function Ps(){const e=await F.get("/api/dashboard/settings");return As(e)}async function kn(e){const t=await F.patch("/api/dashboard/settings",In(e));return As(t)}async function Is(){return F.get("/api/dashboard/open-cloud/credential-profiles")}async function wn(e){return F.post("/api/dashboard/open-cloud/credential-profiles",e)}async function Rn(e){return F.patch("/api/dashboard/open-cloud/credential-profiles/active",{profileId:e})}async function $n(e,t){return F.put(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/api-key`,t)}async function Ln(e){return F.delete(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}`)}async function Un(e,t){return F.post(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators`,t)}async function Tn(e,t){return F.patch(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators/${encodeURIComponent(t)}/default`,{})}async function Bn(e,t){return F.delete(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators/${encodeURIComponent(t)}`)}async function En(e,t){return F.post(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/test`,t?{creatorPresetId:t}:{})}async function Gn(e){return F.post("/api/dashboard/open-cloud/credential/test",e?{apiKey:e}:{})}function Mn(e){return e.category==="image"||e.category==="decal"}function Dn(e,t){return e==="group"?t("assets.creator.group","Group"):t("assets.creator.user","User")}function Fn(e,t){return`${e.label} · ${Dn(e.creatorType,t)} ${e.creatorId}`}function cs(e){if(!e)return null;if(e.defaultCreatorId){const t=e.creators.find(n=>n.id===e.defaultCreatorId);if(t)return t}return e.creators[0]??null}function On({asset:e,open:t,canUpload:n,busyAction:l,onClose:o,onBack:f,onOpenSettings:g,onUpload:x}){const{t:p}=ce(),L=c.useRef(null),[K,B]=c.useState(null),[R,r]=c.useState(null),[b,N]=c.useState(!1),[T,W]=c.useState(null),[V,D]=c.useState(""),[G,E]=c.useState(""),[H,M]=c.useState(""),[q,P]=c.useState("user"),[I,X]=c.useState("");if(c.useEffect(()=>{D((e==null?void 0:e.displayName)??""),E((e==null?void 0:e.description)??"")},[e==null?void 0:e.description,e==null?void 0:e.displayName,e==null?void 0:e.id]),c.useEffect(()=>{if(!t)return;let _=!1;return N(!0),W(null),(async()=>{try{const[S,J]=await Promise.all([Ps(),Is()]);if(_)return;B(S);const Q=J.profiles.find(pe=>pe.id===J.activeProfileId)??J.profiles[0]??null;r(Q);const Z=cs(Q);M((Z==null?void 0:Z.id)??""),P((Z==null?void 0:Z.creatorType)??"user"),X((Z==null?void 0:Z.creatorId)??"")}catch(S){if(_)return;W(S instanceof Error?S.message:p("assets.upload.settingsLoadFailed","Failed to load upload settings.")),B(null),r(null)}finally{_||N(!1)}})(),()=>{_=!0}},[t,p]),c.useEffect(()=>{var S;if(!t||!e)return;(S=L.current)==null||S.focus();const _=J=>{J.key==="Escape"&&o()};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[e,o,t]),!t||!e)return null;const $=(K==null?void 0:K.assetUploadByOpenCloudEnabled)===!0,y=!!R,i=cs(R),A=(R==null?void 0:R.creators.find(_=>_.id===H))??null,te=!!i,m=(R==null?void 0:R.storageProvider)==="env"&&y&&!te,U=m&&I.trim().length>0,h=n&&!b&&!T&&(!$||!y||!te&&!m),z=n&&!b&&!T&&$&&y&&(te||U)&&l!=="upload";return s.jsx("div",{className:a.detailPopupLayer,onClick:o,role:"presentation",children:s.jsxs("section",{ref:L,className:a.detailDialog,role:"dialog","aria-modal":"true","aria-label":p("assets.upload.title","Upload asset"),tabIndex:-1,onClick:_=>_.stopPropagation(),children:[s.jsxs("div",{className:a.detailDialogHeader,children:[s.jsxs("div",{className:a.detailTitleBlock,children:[s.jsxs("span",{className:a.detailEyebrow,children:[ie(e,p)," · ",p("assets.upload.intent","Upload to Roblox")]}),s.jsx("h2",{children:p("assets.upload.title","Upload asset")}),s.jsx("span",{children:e.displayName})]}),s.jsxs("div",{className:a.detailHeaderActions,children:[s.jsxs("button",{type:"button",className:a.commandButton,onClick:f,children:[s.jsx(Ys,{size:15}),p("assets.upload.backToDetails","Back to details")]}),s.jsx(ee,{text:p("common.close","Close"),children:s.jsx("button",{type:"button",className:a.iconButton,onClick:o,"aria-label":p("common.close","Close"),children:s.jsx(Xe,{size:16})})})]})]}),s.jsxs("div",{className:a.detailDialogBody,children:[s.jsx("div",{className:a.detailPreviewPane,children:Mn(e)?s.jsx("img",{className:a.detailPreview,src:Cs(e),alt:e.displayName}):s.jsxs("div",{className:a.detailPreviewFallback,children:[s.jsx("span",{children:ie(e,p)}),s.jsx("code",{children:e.file.original})]})}),s.jsxs("div",{className:a.detailContentPane,children:[!n&&s.jsx("div",{className:a.notice,children:p("assets.proOnly.upload","Roblox upload is available on Pro.")}),b&&s.jsx("div",{className:a.notice,children:p("assets.upload.checkingSettings","Checking upload settings...")}),T&&s.jsx("div",{className:a.errorState,children:T}),s.jsxs("dl",{className:a.compactMeta,children:[s.jsx("dt",{children:p("assets.detail.category","Category")}),s.jsx("dd",{children:ie(e,p)}),s.jsx("dt",{children:p("assets.detail.source","Source")}),s.jsx("dd",{children:e.source.originalPath})]}),h&&s.jsxs("div",{className:a.setupNotice,children:[s.jsx("strong",{children:p("assets.upload.settingsRequired","Upload settings required")}),s.jsx("p",{children:y?$?p("assets.upload.settingsRequired.creator","Save a default Creator before uploading."):p("assets.upload.settingsRequired.toggle","Enable Open Cloud upload before uploading."):p("assets.upload.settingsRequired.apiKey","Save an Open Cloud API key before uploading.")}),s.jsxs("button",{type:"button",className:a.commandButton,onClick:g,children:[s.jsx(bs,{size:15}),p("assets.upload.openSettings","Open Asset Library settings")]})]}),s.jsxs("div",{className:a.formStack,children:[s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:p("assets.detail.displayName","Display name")}),s.jsx("input",{value:V,disabled:!n,onChange:_=>D(_.target.value)}),s.jsx("small",{className:a.fieldHelp,children:p("assets.upload.displayNameHelp","Saved to Roblox as the asset display name.")})]}),s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:p("assets.detail.description","Description")}),s.jsx("textarea",{value:G,rows:3,disabled:!n,onChange:_=>E(_.target.value)}),s.jsx("small",{className:a.fieldHelp,children:p("assets.upload.descriptionHelp","Saved to Roblox as the asset description.")})]}),te&&s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:p("assets.upload.creator","Creator")}),s.jsx("select",{"aria-label":p("assets.upload.creator","Creator"),value:H,disabled:!n||b,onChange:_=>M(_.target.value),children:R==null?void 0:R.creators.map(_=>s.jsx("option",{value:_.id,children:Fn(_,p)},_.id))}),s.jsx("small",{className:a.fieldHelp,children:p("assets.upload.creatorHelp","Used by Open Cloud as the owner of the uploaded asset.")})]}),m&&s.jsxs(s.Fragment,{children:[s.jsx("p",{className:a.inlineHelp,children:p("assets.upload.envCreatorHelp","Environment API keys cannot save a default Creator here. Enter the Creator for this upload.")}),s.jsxs("div",{className:a.twoColumn,children:[s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:p("assets.upload.creatorType","Creator type")}),s.jsxs("select",{value:q,disabled:!n,onChange:_=>P(_.target.value),children:[s.jsx("option",{value:"user",children:p("assets.creator.user","User")}),s.jsx("option",{value:"group",children:p("assets.creator.group","Group")})]}),s.jsx("small",{className:a.fieldHelp,children:p("assets.upload.creatorTypeHelp","Sent to Open Cloud as the Creator type.")})]}),s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:p("assets.upload.creatorId","Creator ID")}),s.jsx("input",{value:I,disabled:!n,onChange:_=>X(_.target.value)}),s.jsx("small",{className:a.fieldHelp,children:p("assets.upload.creatorIdHelp","Sent to Open Cloud as the User or Group ID that owns the uploaded asset.")})]})]})]}),s.jsx("button",{type:"button",className:a.primaryButton,disabled:!z,onClick:()=>{const _=I.trim(),S=m&&_?{creatorType:q,creatorId:_}:{},J=!m&&A&&i&&A.id!==i.id?{creatorType:A.creatorType,creatorId:A.creatorId}:{};x({displayName:V,description:G,...S,...J})},children:l==="upload"?p("assets.upload.uploading","Uploading..."):p("assets.upload.submit","Upload with Roblox Open Cloud")})]}),s.jsxs("div",{className:a.noticeList,children:[s.jsx("p",{children:p("assets.upload.noDelete","WEPPY does not provide Roblox asset deletion.")}),s.jsx("p",{children:p("assets.upload.delay","Roblox processing and moderation can delay visibility in Studio or Creator Dashboard.")})]})]})]})]})})}function us(e,t){return e==="env"?t("assets.settings.credential.env","Environment variable"):t("assets.settings.credential.local","Local encrypted file")}function Ke(e,t){return e==="valid"?t("assets.settings.validation.valid","Connected"):e==="invalid"?t("assets.settings.validation.invalid","Needs attention"):t("assets.settings.validation.unknown","Not tested")}function Hn(e,t){return(e==null?void 0:e.status)==="valid"?t("assets.settings.apiKeyTested","Open Cloud API key connection tested."):(e==null?void 0:e.message)??t("assets.settings.tested","Connection tested.")}function zn(e,t){return(e==null?void 0:e.status)==="valid"?t("assets.settings.apiKeyTested","Open Cloud API key connection tested."):(e==null?void 0:e.message)??t("assets.settings.tested","Connection tested.")}function Kn(e,t){return e==="group"?t("assets.creator.group","Group"):t("assets.creator.user","User")}function Wn(e,t){return`${Kn(e.creatorType,t)} ${e.creatorId}`}function Vn({open:e,tier:t,onClose:n}){const{t:l}=ce(),[o,f]=c.useState(null),[g,x]=c.useState(null),[p,L]=c.useState(""),[K,B]=c.useState(!1),[R,r]=c.useState(""),[b,N]=c.useState(""),[T,W]=c.useState("user"),[V,D]=c.useState(""),[G,E]=c.useState(""),[H,M]=c.useState(!0),[q,P]=c.useState(null),[I,X]=c.useState(null),[$,y]=c.useState(!1),i=t==="basic",A=c.useCallback(async()=>{y(!0),P(null);try{const[d,j]=await Promise.all([Ps(),Is()]);f(d),x(j);const k=j.profiles.find(O=>O.id===j.activeProfileId)??j.profiles[0]??null;L((k==null?void 0:k.id)??""),B(!k),M(!k||k.creators.length===0),W("user"),D(""),E("")}catch(d){P(d instanceof Error?d.message:l("assets.settings.loadFailed","Failed to load upload settings."))}finally{y(!1)}},[l]);if(c.useEffect(()=>{e&&A()},[A,e]),!e)return null;const te=(o==null?void 0:o.assetUploadByOpenCloudEnabled)===!0,w=b.trim(),m=V.trim(),U=(g==null?void 0:g.profiles)??[],h=U.find(d=>d.id===p)??U[0]??null,z=!!h,_=z&&(h==null?void 0:h.storageProvider)==="localFile",S=z&&(h==null?void 0:h.storageProvider)==="env",J=h!=null&&h.defaultCreatorId?h.creators.find(d=>d.id===h.defaultCreatorId):h==null?void 0:h.creators[0],Q=!!(h!=null&&h.creators.length),Z=!Q||H,pe=U.length>1,oe=i?l("assets.settings.action.proRequired","Asset upload settings are available on Pro."):$?l("assets.settings.action.busy","Wait for the current settings action to finish."):null,ve=i||$||!w,xe=oe??(w?l("assets.settings.saveApiKey.tooltip.ready","Save this API key to local encrypted storage."):l("assets.settings.saveApiKey.tooltip.enter","Enter an Open Cloud API key to save it locally.")),ae=i||$||!w&&!z,Ce=oe??(w?l("assets.settings.testConnection.tooltip.entered","Test the entered API key before saving it."):z?l("assets.settings.testConnection.tooltip.saved","Test the saved Open Cloud API key."):l("assets.settings.testConnection.tooltip.enterOrSaved","Enter an API key or save one before testing the connection.")),_e=i||$||!_,Se=oe??(_?l("assets.settings.removeApiKey.tooltip.ready","Remove the locally saved Open Cloud API key."):S?l("assets.settings.removeApiKey.tooltip.env","Environment API keys cannot be removed from Dashboard. Remove ROBLOX_OPEN_CLOUD_API_KEY outside WEPPY."):l("assets.settings.removeApiKey.tooltip.none","No local Open Cloud API key is saved.")),Ue=i||$||!_||!m,Te=oe??(S?l("assets.settings.saveCreator.tooltip.env","Environment API keys cannot save a default Creator here. Enter Creator details in the upload dialog."):_?m?l("assets.settings.saveCreator.tooltip.ready","Save this Creator as the default owner for uploads."):l("assets.settings.saveCreator.tooltip.enterId","Enter a user or group ID before saving the default Creator."):l("assets.settings.saveCreator.tooltip.noLocal","Save a local Open Cloud API key before saving a default Creator.")),Be=oe??(_?l("assets.settings.addCreator.tooltip.ready","Add another User or Group Creator preset to this profile."):l("assets.settings.saveCreator.tooltip.noLocal","Save a local Open Cloud API key before saving a default Creator.")),Ee=i||$||S||!_,Ge=oe??(_?l("assets.settings.unregisterCreator.tooltip.ready","Unregister this Creator from the selected profile."):S?l("assets.settings.saveCreator.tooltip.env","Environment API keys cannot save a default Creator here. Enter Creator details in the upload dialog."):l("assets.settings.saveCreator.tooltip.noLocal","Save a local Open Cloud API key before saving a default Creator.")),Me=J?l("assets.settings.saveCreatorPreset","Save Creator"):l("assets.settings.saveCreator","Save default Creator"),De=(h==null?void 0:h.label)??l("assets.settings.credential.none","No API key saved"),ge=d=>{const j=d.profiles.find(k=>k.id===d.activeProfileId)??d.profiles[0]??null;x(d),L((j==null?void 0:j.id)??""),M(!j||j.creators.length===0),B(d.profiles.length===0)},Fe=async()=>{if(h){y(!0);try{const d=await En(h.id,J==null?void 0:J.id);ge(d),P(zn(d.validation,l))}catch(d){P(d instanceof Error?d.message:l("assets.settings.testFailed","Connection test failed."))}finally{y(!1)}}},Oe=async()=>{if(I){y(!0);try{if(I.kind==="apiKey"){const d=await Ln(I.profileId);ge(d),P(l("assets.settings.apiKeyRemoved","Open Cloud API key unregistered from local storage."))}else{const d=await Bn(I.profileId,I.creatorPresetId);ge(d),P(l("assets.settings.creatorUnregistered","Creator unregistered from this profile."))}X(null)}catch(d){P(d instanceof Error?d.message:I.kind==="apiKey"?l("assets.settings.removeFailed","Failed to unregister API key."):l("assets.settings.creatorUnregisterFailed","Failed to unregister Creator."))}finally{y(!1)}}},u=(I==null?void 0:I.kind)==="apiKey"?l("assets.settings.unregisterApiKey.title","Unregister API Key?"):l("assets.settings.unregisterCreator.title","Unregister Creator?"),v=(I==null?void 0:I.kind)==="apiKey"?l("assets.settings.unregisterApiKey.message","Roblox API key is not revoked. WEPPY only removes the local Credential Profile registration on this device."):l("assets.settings.unregisterCreator.message","Roblox user or group is not deleted. WEPPY only removes this Creator from the selected API Key profile."),C=(I==null?void 0:I.kind)==="apiKey"?l("assets.settings.removeApiKey","Unregister API Key"):l("assets.settings.unregisterCreator","Unregister Creator");return s.jsxs("section",{id:"asset-library-settings-panel",className:`${a.settingsInlinePanel} ${a.settingsDrawer}`,role:"region","aria-label":l("assets.settings.title","Asset Library settings"),"data-panel-placement":"toolbar-popover",children:[s.jsxs("div",{className:a.drawerHeader,children:[s.jsxs("div",{children:[s.jsx("h2",{children:l("assets.settings.title","Asset Library settings")}),s.jsx("span",{children:De})]}),s.jsx(ee,{text:l("common.close","Close"),children:s.jsx("button",{type:"button",className:a.iconButton,onClick:n,"aria-label":l("common.close","Close"),children:s.jsx(Xe,{size:16})})})]}),i&&s.jsx("div",{className:`${a.notice} ${a.proNotice}`,children:l("assets.settings.proOnly","Roblox upload settings and Open Cloud credential controls are available on Pro.")}),s.jsxs("section",{className:a.settingsPanel,children:[s.jsxs("label",{className:a.toggleRow,children:[s.jsxs("span",{children:[s.jsx("strong",{children:l("assets.settings.openCloudToggle","Open Cloud upload")}),s.jsx("small",{children:l("assets.settings.openCloudToggle.help","Controls whether server-side Open Cloud upload mutations can run.")})]}),s.jsx(Ms,{checked:te,disabled:i||$,onChange:d=>{(async()=>{y(!0);try{const j=await kn({assetUploadByOpenCloudEnabled:d.target.checked});f(j),P(l("assets.settings.saved","Upload settings saved."))}catch(j){P(j instanceof Error?j.message:l("assets.settings.saveFailed","Failed to save upload settings."))}finally{y(!1)}})()}})]}),pe&&s.jsx("div",{className:a.metadataList,children:U.map(d=>{const j=d.id===(h==null?void 0:h.id);return s.jsxs("div",{className:a.metadataItem,children:[s.jsx("strong",{children:d.label}),s.jsxs("span",{children:[l("assets.settings.field.storage","Storage"),": ",us(d.storageProvider,l)]}),s.jsxs("span",{children:[l("assets.settings.field.validationStatus","Validation status"),": ",Ke(d.validationStatus,l)]}),j&&s.jsx("code",{children:l("assets.settings.activeProfileBadge","Active")}),!j&&d.storageProvider==="localFile"&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||$,onClick:()=>{(async()=>{y(!0);try{const k=await Rn(d.id),O=k.profiles.find(de=>de.id===(k.activeProfileId??d.id))??d;x(k),L(O.id),M(O.creators.length===0),W("user"),D(""),E(""),P(l("assets.settings.profileSelected","Open Cloud credential profile selected."))}catch(k){P(k instanceof Error?k.message:l("assets.settings.saveFailed","Failed to save upload settings."))}finally{y(!1)}})()},children:l("assets.settings.useProfile","Use profile")})]},d.id)})}),h&&s.jsxs("div",{className:a.settingsSubsection,children:[s.jsx("div",{className:a.settingsSectionHeader,children:s.jsx("h3",{children:l("assets.settings.credentialProfile","Credential Profile")})}),s.jsxs("div",{className:a.metadataItem,children:[s.jsxs("dl",{className:a.settingsDefinitionList,children:[s.jsxs("div",{children:[s.jsx("dt",{children:l("assets.settings.field.profile","Profile")}),s.jsx("dd",{children:h.label})]}),h.maskedKey&&s.jsxs("div",{children:[s.jsx("dt",{children:l("assets.settings.field.apiKey","API Key")}),s.jsx("dd",{children:h.maskedKey})]}),s.jsxs("div",{children:[s.jsx("dt",{children:l("assets.settings.field.storage","Storage")}),s.jsx("dd",{children:us(h.storageProvider,l)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:l("assets.settings.field.validationStatus","Validation status")}),s.jsx("dd",{children:Ke(h.validationStatus,l)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:l("assets.settings.field.creators","Creators")}),s.jsx("dd",{children:h.creators.length})]})]}),!K&&s.jsxs("div",{className:a.buttonRow,children:[s.jsx(ee,{text:Ce,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:ae,onClick:()=>{Fe()},children:l("assets.settings.testConnection","Test Connection")})}),_&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||$,onClick:()=>B(!0),children:l("assets.settings.replaceApiKey","Replace API Key")}),s.jsx(ee,{text:Se,children:s.jsx("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:_e,onClick:()=>X({kind:"apiKey",profileId:h.id}),children:l("assets.settings.removeApiKey","Unregister API Key")})})]})]})]}),K&&s.jsxs("div",{className:a.formStack,children:[s.jsxs("div",{className:a.field,children:[s.jsx("div",{className:a.fieldLabelRow,children:s.jsx("label",{htmlFor:"asset-settings-open-cloud-profile-label",children:l("assets.settings.profileLabel","Profile name")})}),s.jsx("input",{id:"asset-settings-open-cloud-profile-label",value:R,disabled:i||$,onChange:d=>r(d.target.value),placeholder:l("assets.settings.profileLabel.placeholder","Studio automation key")}),s.jsx("p",{className:a.inlineHelp,children:l("assets.settings.profileLabel.help","Optional. If left blank, WEPPY saves this profile as Open Cloud key automatically.")})]}),s.jsxs("div",{className:a.field,children:[s.jsxs("div",{className:a.fieldLabelRow,children:[s.jsx("label",{htmlFor:"asset-settings-open-cloud-api-key",children:l("assets.settings.apiKey","Open Cloud API Key")}),s.jsx(Qe,{topicId:"openCloudApiKey",variant:"field",state:{hasOpenCloudCredential:z}})]}),s.jsx("input",{id:"asset-settings-open-cloud-api-key",value:b,type:"password",disabled:i||$,onChange:d=>N(d.target.value)}),s.jsx("p",{className:a.inlineHelp,children:l("assets.settings.apiKey.inlineHelp","WEPPY uses this key only for Roblox Open Cloud requests. The key is encrypted on this device and is not sent to WEPPY servers or stored in any other external storage.")})]}),!z&&s.jsx("p",{className:a.inlineHelp,children:s.jsx("a",{href:Ds["open_cloud.api_key"].docsUrl,target:"_blank",rel:"noreferrer",children:l("assets.settings.apiKeyGuide","Create a Roblox API key with Assets Read and Write permissions.")})}),s.jsxs("div",{className:a.buttonRow,children:[s.jsx(ee,{text:xe,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:ve,onClick:()=>{(async()=>{var d;y(!0);try{const j={apiKey:w,...R.trim()?{label:R.trim()}:{}},k=(h==null?void 0:h.storageProvider)==="localFile"?await $n(h.id,j):await wn(j),O=k.profiles.find(de=>{var Y;return de.id===(k.activeProfileId??((Y=k.profile)==null?void 0:Y.id))});x(k),L(k.activeProfileId??((d=k.profile)==null?void 0:d.id)??""),M(!O||O.creators.length===0),B(!1),N(""),r(""),P(l("assets.settings.apiKeySaved","Open Cloud API key saved locally."))}catch(j){P(j instanceof Error?j.message:l("assets.settings.saveFailed","Failed to save upload settings."))}finally{y(!1)}})()},children:l("assets.settings.saveApiKey","Save API Key")})}),s.jsx(ee,{text:Ce,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:ae,onClick:()=>{(async()=>{y(!0);try{const d=await Gn(w||void 0);P(Hn(d.validation,l))}catch(d){P(d instanceof Error?d.message:l("assets.settings.testFailed","Connection test failed."))}finally{y(!1)}})()},children:l("assets.settings.testConnection","Test Connection")})}),s.jsx(ee,{text:Se,children:s.jsx("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:_e,onClick:()=>{h&&X({kind:"apiKey",profileId:h.id})},children:l("assets.settings.removeApiKey","Unregister API Key")})})]})]}),s.jsx("div",{className:a.metadataList,children:h==null?void 0:h.creators.map(d=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("strong",{children:d.label}),s.jsx("span",{children:Wn(d,l)}),d.id===h.defaultCreatorId&&s.jsx("code",{children:l("assets.settings.defaultCreatorBadge","Default")}),s.jsxs("span",{children:[l("assets.settings.field.validationStatus","Validation status"),": ",Ke(d.validationStatus,l)]}),s.jsxs("div",{className:a.buttonRow,children:[d.id!==h.defaultCreatorId&&h.storageProvider==="localFile"&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||$,onClick:()=>{(async()=>{if(h){y(!0);try{const j=await Tn(h.id,d.id);x(j),P(l("assets.settings.defaultCreatorSaved","Open Cloud default Creator saved locally."))}catch(j){P(j instanceof Error?j.message:l("assets.settings.saveFailed","Failed to save upload settings."))}finally{y(!1)}}})()},children:l("assets.settings.makeDefaultCreator","Make default")}),s.jsx(ee,{text:Ge,children:s.jsx("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:Ee,onClick:()=>X({kind:"creator",profileId:h.id,creatorPresetId:d.id}),children:l("assets.settings.unregisterCreator","Unregister Creator")})})]})]},d.id))}),Q&&!H&&s.jsx(ee,{text:Be,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:i||$||S||!_,onClick:()=>{W("user"),D(""),E(""),M(!0)},children:l("assets.settings.addCreator","Add Creator")})}),Z&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:a.twoColumn,children:[s.jsxs("div",{className:a.field,children:[s.jsx("div",{className:a.fieldLabelRow,children:s.jsx("label",{htmlFor:"asset-settings-creator-type",children:l("assets.upload.creatorType","Creator type")})}),s.jsxs("select",{id:"asset-settings-creator-type",value:T,disabled:i||$||S||!_,onChange:d=>W(d.target.value),children:[s.jsx("option",{value:"user",children:l("assets.creator.user","User")}),s.jsx("option",{value:"group",children:l("assets.creator.group","Group")})]})]}),s.jsxs("div",{className:a.field,children:[s.jsxs("div",{className:a.fieldLabelRow,children:[s.jsx("label",{htmlFor:"asset-settings-creator-id",children:l("assets.upload.creatorId","Creator ID")}),s.jsx(Qe,{topicId:"openCloudCreatorId",variant:"field",state:{hasDefaultCreator:!!J}})]}),s.jsx("input",{id:"asset-settings-creator-id",value:V,disabled:i||$||S||!_,onChange:d=>D(d.target.value)}),s.jsx("p",{className:a.inlineHelp,children:l("assets.settings.creatorId.inlineHelp","Default owner for new Roblox assets: your User ID or a Group ID.")})]})]}),s.jsxs("div",{className:a.field,children:[s.jsx("div",{className:a.fieldLabelRow,children:s.jsx("label",{htmlFor:"asset-settings-creator-label",children:l("assets.settings.creatorLabel","Creator label")})}),s.jsx("input",{id:"asset-settings-creator-label",value:G,disabled:i||$||S||!_,onChange:d=>E(d.target.value),placeholder:l("assets.settings.creatorLabel.placeholder","Main studio group")}),s.jsx("p",{className:a.inlineHelp,children:l("assets.settings.creatorLabel.help","Optional. If left blank, WEPPY automatically saves a label like User 123 or Group 456.")})]}),!J&&s.jsx("p",{className:a.inlineHelp,children:l("assets.settings.creatorHelp","Use the numeric user ID from a profile URL or group ID from a group URL.")}),s.jsxs("div",{className:a.buttonRow,children:[s.jsx(ee,{text:Te,children:s.jsx("button",{type:"button",className:a.primaryButton,disabled:Ue,onClick:()=>{(async()=>{if(h){y(!0);try{const d=await Un(h.id,{creatorType:T,creatorId:m,makeDefault:!J,...G.trim()?{label:G.trim()}:{}});x(d),D(""),E(""),M(!1),P(l("assets.settings.defaultCreatorSaved","Open Cloud default Creator saved locally."))}catch(d){P(d instanceof Error?d.message:l("assets.settings.saveFailed","Failed to save upload settings."))}finally{y(!1)}}})()},children:Me})}),Q&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||$,onClick:()=>{W("user"),D(""),E(""),M(!1)},children:l("assets.settings.cancelCreator","Cancel")})]})]})]}),q&&s.jsx("div",{className:a.messageState,children:q}),s.jsx(ys,{open:I!==null,title:u,message:v,cancelLabel:l("common.cancel","Cancel"),confirmLabel:C,loading:$,onCancel:()=>X(null),onConfirm:()=>{Oe()}})]})}const Yn=12,qn=5e3;function re(e,t){return e instanceof Error&&e.message.trim().length>0?e.message:t}function ps(e,t){return e.some(l=>je(l,t))?e.map(l=>je(l,t)?t:l):[t,...e]}function je(e,t){return e.id!==t.id||e.category!==t.category||e.scope.kind!==t.scope.kind?!1:e.scope.kind==="shared"||t.scope.kind==="place"&&e.scope.placeId===t.scope.placeId}function Xn(e,t){return e.some(n=>je(n,t))?e.map(n=>je(n,t)?t:n):e}function We(e,t){return kt(e.filter(n=>It(n,t)))}function ye(e,t){return e?`${e.displayName} (${e.id})`:t??"unknown asset"}function Jn(e){return e.length===0?"none":e.map(t=>ye(t)).join(", ")}function hs(e){const t=`status ${e.status}`;return e.roblox.assetId?`Roblox asset ${e.roblox.assetId}; ${t}`:t}function Zn(e,t){const n=ye(t);return e==="update"?`Updated metadata for asset: ${n}.`:e==="upload"?`Uploaded asset: ${n} -> ${hs(t)}.`:e==="thumbnail-generate"?`Generated thumbnail for asset: ${n}.`:e==="status-refresh"?`Refreshed Roblox status for asset: ${n} -> ${hs(t)}.`:e==="usage-scan"?`Scanned usage for asset: ${n} -> ${t.usage.references.length} reference(s).`:`Updated asset: ${n}.`}function Qn(e){return e!=="upload"&&e!=="status-refresh"}function ms(e){return e.status==="processing"&&!!(e.roblox.operationId??e.roblox.operationPath)}function Ae(e){return{scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0,category:e.category}}function eo(e,t){return e==="shared"?[{scope:"shared"}]:e==="place"?t===null?[]:[{scope:"place",placeId:t}]:[...t===null?[]:[{scope:"place",placeId:t}],{scope:"shared"}]}function xs(e,t,n){return eo(e,t).flatMap(l=>Pt(n).map(o=>({request:{...l,category:o},label:`${l.scope}/${o}`})))}function gs(e,t){if(t.length===0)return null;const n=t.map(({label:l,reason:o})=>`${l}: ${re(o,"request failed")}`);return`${e}: ${n.join("; ")}`}function so(e){if(e.pluginConnected&&e.activePlaceId!==null){const n=Ve(e.places,e.activePlaceId),l=n?be(e.places,n.placeId):!1;return{placeId:e.activePlaceId,placeName:e.activePlaceName??(l?null:(n==null?void 0:n.placeName)??null),studioConnected:!0,folderUnresolved:l,hasSyncMetadata:n?Pe(e.places,n):void 0}}if(e.lastActivePlaceId!==null){const n=Ve(e.places,e.lastActivePlaceId),l=n?be(e.places,n.placeId):!1;return{placeId:e.lastActivePlaceId,placeName:e.lastActivePlaceName??(l?null:(n==null?void 0:n.placeName)??null),studioConnected:!1,folderUnresolved:l,hasSyncMetadata:n?Pe(e.places,n):void 0}}const t=Bs(e.places);return{placeId:(t==null?void 0:t.placeId)??null,placeName:t&&!be(e.places,t.placeId)?t.placeName:null,studioConnected:!1,folderUnresolved:t?be(e.places,t.placeId):!1,hasSyncMetadata:t?Pe(e.places,t):void 0}}function to(e,t){if(typeof t=="number"){const n=Ve(e.places,t);if(n){const l=be(e.places,n.placeId);return{placeId:n.placeId,placeName:l?null:n.placeName,studioConnected:n.isConnected,folderUnresolved:l,hasSyncMetadata:Pe(e.places,n),overrideStillValid:!0}}}return{...so(e),overrideStillValid:t===null}}function ao(){const[e,t]=c.useState([]),[n,l]=c.useState(0),[o,f]=c.useState(null),[g,x]=c.useState("place"),[p,L]=c.useState("all"),[K,B]=c.useState([]),[R,r]=c.useState(null),[b,N]=c.useState(null),[T,W]=c.useState(null),[V,D]=c.useState(null),[G,E]=c.useState(!1),[H,M]=c.useState(!1),[q,P]=c.useState(void 0),[I,X]=c.useState(!1),[$,y]=c.useState(!0),[i,A]=c.useState(null),[te,w]=c.useState(null),[m,U]=c.useState(null),h=c.useRef(!0),z=c.useRef(new Map),_=c.useRef(new Set),S=c.useMemo(()=>e.find(u=>se(u)===o)??null,[e,o]),J=(S==null?void 0:S.id)??null;c.useEffect(()=>{o&&(e.some(u=>se(u)===o)||f(null))},[e,o]);const Q=c.useCallback(u=>{const v=z.current.get(u);v!==void 0&&(clearTimeout(v),z.current.delete(u))},[]),Z=c.useCallback((u,v=Yn)=>{const C=se(u);if(!ms(u)||v<=0){Q(C);return}_.current.has(C)||(Q(C),_.current.add(C),(async()=>{try{const d=await es(Ae(u),u.id);if(!h.current)return;if(t(j=>Xn(j,d)),ms(d)&&v>1){const j=se(d),k=setTimeout(()=>{z.current.delete(j),Z(d,v-1)},qn);z.current.set(j,k);return}Q(se(d))}catch(d){if(!h.current)return;Q(C),w(re(d,"Asset Library status refresh failed."))}finally{_.current.delete(C)}})())},[Q]);c.useEffect(()=>()=>{h.current=!1;for(const u of z.current.values())clearTimeout(u);z.current.clear(),_.current.clear()},[]);const pe=c.useCallback(()=>g==="shared"?{scope:"shared"}:{scope:"place",placeId:T??void 0},[T,g]),oe=c.useCallback(u=>({...pe(),category:u}),[pe]),ve=c.useCallback(async()=>{try{const u=await Ts(),v=to(u,R);return B(u.places),v.overrideStillValid||r(null),N(v.placeId),W(v.placeId),D(v.placeName),E(v.studioConnected),M(v.folderUnresolved),P(v.hasSyncMetadata),X(v.studioConnected),v.placeId}catch{return B([]),N(null),W(null),D(null),E(!1),M(!1),P(void 0),X(!1),null}},[R]),xe=c.useCallback(async()=>{w(null);try{const u=await ve();if(g==="place"&&u===null){t([]),l(0),y(!1),w("No active place is connected for place-scoped assets.");return}const v=xs(g,u,p),C=await Promise.allSettled(v.map(({request:O})=>gt(O))),d=C.flatMap(O=>O.status==="fulfilled"?[O.value]:[]),j=C.flatMap((O,de)=>O.status==="rejected"?[{label:v[de].label,reason:O.reason}]:[]);g==="all"&&u===null&&j.unshift({label:"place",reason:new Error("No active place is available")});const k=We(d.flatMap(O=>O.assets),p);t(k),l(k.length);for(const O of k)Z(O);w(gs("Some Asset Library requests failed",j))}catch(u){w(re(u,"Failed to load Asset Library."))}finally{y(!1)}},[p,ve,g,Z]);c.useEffect(()=>{xe()},[xe]);const ae=c.useCallback(async(u,v,C)=>{const d=(S==null?void 0:S.id)===v?S:e.find(j=>j.id===v)??null;if(!d)return w("Asset context is unavailable."),null;A(u),w(null),U(null);try{const j=await C(Ae(d));return t(k=>ps(k,j)),f(se(j)),Qn(u)&&U(Zn(u,j)),j}catch(j){return w(re(j,"Asset Library action failed.")),null}finally{A(null)}},[e,S]),Ce=c.useCallback(async()=>{A("rescan"),w(null),U(null);try{const u=xs(g,T,p);if(g==="place"&&T===null){w("No active place is connected for place-scoped assets.");return}const v=await Promise.allSettled(u.map(({request:Y})=>ft(Y))),C=v.flatMap(Y=>Y.status==="fulfilled"?[Y.value]:[]),d=v.flatMap((Y,fe)=>Y.status==="rejected"?[{label:u[fe].label,reason:Y.reason}]:[]);g==="all"&&T===null&&d.unshift({label:"place",reason:new Error("No active place is available")});const j=We(C.flatMap(Y=>Y.assets),p),k=C.reduce((Y,fe)=>Y+fe.adoptedCount,0),O=C.reduce((Y,fe)=>Y+fe.skippedCount,0),de=We(C.flatMap(Y=>Y.adopted),p);t(j),l(j.length),U(`Rescan complete for ${p}: ${k} asset(s) added, ${O} skipped. Added: ${Jn(de)}.`),w(gs("Some Asset Library rescans failed",d))}catch(u){w(re(u,"Asset Library rescan failed."))}finally{A(null)}},[T,p,g]),_e=c.useCallback(async(u,v)=>{A("export-selection-rbxm"),w(null),U(null);try{const C=await Ct(oe(u),v);return t(d=>ps(d,C.asset)),f(se(C.asset)),U(`Exported Studio selection as RBXM asset: ${ye(C.asset)}${C.deduplicated?" (reused existing local asset)":""}.`),C}catch(C){return w(re(C,"Asset Library .rbxm export failed.")),null}finally{A(null)}},[oe]),Se=c.useCallback((u,v)=>ae("update",u,C=>bt(C,u,v)),[ae]),Ue=c.useCallback(async(u,v)=>{const C=await ae("upload",u,d=>jt(d,u,v));return C&&Z(C),C},[ae,Z]),Te=c.useCallback(async u=>{const v=(S==null?void 0:S.id)===u?S:e.find(d=>d.id===u)??null;if(!v)return w("Asset context is unavailable."),!1;const C=se(v);Q(C),A("delete"),w(null),U(null);try{return await yt(Ae(v),u),t(d=>{const j=d.filter(k=>!je(k,v));return l(j.length),j}),f(d=>d===C?null:d),U(`Deleted asset: ${ye(v,u)}. Local files removed; uploaded Roblox assets were not deleted.`),!0}catch(d){return w(re(d,"Asset Library delete failed.")),!1}finally{A(null)}},[e,Q,S]),Be=c.useCallback(async(u,v)=>{const C=(S==null?void 0:S.id)===u?S:e.find(d=>d.id===u)??null;if(!C)return w("Asset context is unavailable."),null;A("import-rbxm"),w(null),U(null);try{const d=await _t(Ae(C),u,v);return f(se(C)),U(`Imported RBXM asset: ${ye(C,u)} -> ${d.importedCount} instance(s) to ${d.targetParent}.`),d}catch(d){return w(re(d,"Asset Library .rbxm import failed.")),null}finally{A(null)}},[e,S]),Ee=c.useCallback(u=>ae("thumbnail-generate",u,v=>St(v,u)),[ae]),Ge=c.useCallback(u=>{const v=(S==null?void 0:S.id)===u?S:e.find(C=>C.id===u)??null;return v&&Q(se(v)),ae("status-refresh",u,C=>es(C,u))},[e,Q,ae,S]),Me=c.useCallback((u,v)=>ae("usage-scan",u,async C=>(await vt(C,u,v)).asset),[ae]),De=c.useCallback(u=>{x(u),f(null)},[]),ge=c.useCallback(u=>{r(u),f(null)},[]),Fe=c.useCallback(u=>{At(u)&&L(u)},[]),Oe=c.useCallback(u=>{if(u===null){f(null);return}const C=e.find(d=>se(d)===u)??e.find(d=>d.id===u);f(C?se(C):u)},[e]);return{assets:e,totalCount:n,selectedAsset:S,selectedAssetId:J,selectedAssetKey:o,scope:g,categoryFilter:p,availablePlaces:K,selectedPlaceId:b,activePlaceId:T,activePlaceName:V,selectedPlaceIsConnected:G,selectedPlaceFolderUnresolved:H,selectedPlaceHasSyncMetadata:q,studioConnected:I,loading:$,busyAction:i,error:te,lastMessage:m,setScope:De,setSelectedPlaceId:ge,setCategoryFilter:Fe,selectAsset:Oe,refresh:xe,rescan:Ce,exportSelectionRbxm:_e,updateMetadata:Se,uploadAsset:Ue,deleteAsset:Te,importRbxm:Be,generateThumbnail:Ee,refreshStatus:Ge,scanUsage:Me}}const ks="weppy-assets-view-preferences-v1",he={organizationMode:"folders",viewMode:"grid",gridSize:"medium"};function lo(e){return e==="folders"||e==="all-assets"}function no(e){return e==="grid"||e==="list"}function oo(e){return e==="small"||e==="medium"||e==="large"}function ro(){if(typeof window>"u")return he;try{const e=window.localStorage.getItem(ks);if(!e)return he;const t=JSON.parse(e);return{organizationMode:lo(t.organizationMode)?t.organizationMode:he.organizationMode,viewMode:no(t.viewMode)?t.viewMode:he.viewMode,gridSize:oo(t.gridSize)?t.gridSize:he.gridSize}}catch{return he}}function io(){const[e,t]=c.useState(ro);return c.useEffect(()=>{try{window.localStorage.setItem(ks,JSON.stringify(e))}catch{}},[e]),{...e,setOrganizationMode:n=>{t(l=>({...l,organizationMode:n}))},setViewMode:n=>{t(l=>({...l,viewMode:n}))},setGridSize:n=>{t(l=>({...l,gridSize:n}))}}}function co(e,t){return t("assets.count.shown","Shown assets: {count}").replace("{count}",String(e))}function uo(e,t){return e===null?null:t("assets.place.id","Place ID {placeId}").replace("{placeId}",String(e))}function Co(){const{t:e}=ce(),{trackEvent:t}=Es(),{tier:n,loading:l}=Gs(),o=ao(),f=io(),[g,x]=c.useState(!1),[p,L]=c.useState(!1),[K,B]=c.useState(!1),R=!l&&n==="pro",r=o.selectedAsset,b=(r==null?void 0:r.file.original.toLowerCase().endsWith(".rbxm"))??!1,N=(r==null?void 0:r.category)==="model"||(r==null?void 0:r.category)==="animation",T="game.Workspace",V=!!(R&&o.studioConnected&&r&&b&&N),D=o.availablePlaces??[],G=o.selectedPlaceId??o.activePlaceId,E=o.selectedAssetKey??(r?se(r):null),H=c.useCallback(()=>{o.selectAsset(null)},[o.selectAsset]),M=c.useMemo(()=>{const y=typeof o.activePlaceId=="number"?e("placeScope.folder.unresolvedPlace","Place {placeId}").replace("{placeId}",String(o.activePlaceId)):e("assets.scope.place","Current Place"),i=o.selectedPlaceFolderUnresolved?y:o.activePlaceName??y;return o.scope==="shared"?[e("assets.scope.shared","Shared")]:o.scope==="all"?[e("assets.scope.all","All scopes"),i,e("assets.scope.shared","Shared")]:[i,o.selectedPlaceFolderUnresolved?null:uo(o.activePlaceId,e)].filter(A=>!!A)},[o.activePlaceId,o.activePlaceName,o.scope,o.selectedPlaceFolderUnresolved,e]),q=o.scope==="place"&&typeof G=="number"?o.selectedPlaceIsConnected?e("placeScope.connected","Studio connected"):e("placeScope.stored","Stored data"):null,P=c.useMemo(()=>qe(o.categoryFilter,e),[o.categoryFilter,e]),I=co(o.totalCount,e),X=o.scope==="place"&&(o.selectedPlaceFolderUnresolved||o.selectedPlaceHasSyncMetadata===!1),$=e("assets.detail.importRbxm.tooltip","Insert this local RBXM asset into {target} in the connected Studio place.").replace("{target}",T);return s.jsxs("div",{className:a.page,children:[s.jsx(Fs,{title:e("assets.title","Assets"),description:e("assets.subtitle","Browse local originals, upload to Roblox, and inspect synced usage by place."),badge:s.jsx("span",{className:a.experimentalBadge,children:e("assets.experimental","Experimental")}),helpTopicId:"assets",helpState:{tier:n}}),s.jsxs("div",{className:a.toolbarShell,children:[s.jsxs("div",{className:[a.toolbar,X?a.toolbarExpandedSummary:""].filter(Boolean).join(" "),children:[s.jsxs("div",{className:a.segmented,role:"group","aria-label":e("assets.scope.label","Asset scope"),children:[s.jsx("button",{type:"button","aria-pressed":o.scope==="all",className:o.scope==="all"?a.segmentedActive:"",onClick:()=>o.setScope("all"),children:e("assets.scope.all","All scopes")}),s.jsx("button",{type:"button","aria-pressed":o.scope==="place",className:o.scope==="place"?a.segmentedActive:"",onClick:()=>o.setScope("place"),children:e("assets.scope.place","Current Place")}),s.jsx("button",{type:"button","aria-pressed":o.scope==="shared",className:o.scope==="shared"?a.segmentedActive:"",onClick:()=>o.setScope("shared"),children:e("assets.scope.shared","Shared")})]}),s.jsx("div",{className:a.placeContextSlot,role:"group","aria-label":e("assets.place.context","Asset place context"),children:o.scope==="shared"?s.jsx("span",{className:a.sharedPlaceContext,children:e("assets.place.sharedLibrary","Shared library")}):D.length>0?s.jsxs("label",{className:a.placeSelectorLabel,children:[s.jsx("span",{children:e("assets.place.selector","Asset place")}),s.jsxs("select",{className:a.placeSelect,value:typeof G=="number"?String(G):"",onChange:y=>{const i=Number.parseInt(y.currentTarget.value,10);Number.isInteger(i)&&o.setSelectedPlaceId(i)},children:[typeof G!="number"?s.jsx("option",{value:"",disabled:!0,children:e("placeScope.selector.noneSelectable","No selectable Place folder")}):null,s.jsx(Os,{places:D,t:e})]})]}):s.jsx("span",{className:a.sharedPlaceContext,children:o.activePlaceName??e("assets.scope.place","Current Place")})}),s.jsxs("div",{className:a.listContextSummary,children:[q||o.scope==="place"&&(o.selectedPlaceFolderUnresolved||o.selectedPlaceHasSyncMetadata===!1)?s.jsxs("div",{className:a.placeStatusGroup,children:[q?s.jsx(me,{variant:o.selectedPlaceIsConnected?"success":"neutral",shape:"pill",children:q}):null,o.scope==="place"&&o.selectedPlaceFolderUnresolved?s.jsx(me,{variant:"neutral",shape:"pill",children:e("placeScope.folder.unresolved","Representative folder unconfirmed")}):null,o.scope==="place"&&o.selectedPlaceHasSyncMetadata===!1?s.jsx(me,{variant:"neutral",shape:"pill",children:e("placeScope.folder.noSyncHistory","No sync history")}):null]}):null,s.jsxs("div",{className:a.contextTextSummary,children:[M.map((y,i)=>s.jsxs("span",{children:[i>0?s.jsx("span",{className:a.contextDivider,children:" · "}):null,y]},`${y}-${i}`)),M.length>0?s.jsx("span",{className:a.contextDivider,children:" · "}):null,s.jsx("span",{children:P}),s.jsx("span",{className:a.contextDivider,children:" · "}),s.jsx("strong",{children:I})]})]}),s.jsxs("div",{className:a.toolbarActions,children:[s.jsx(ee,{text:e("assets.rescan.tooltip","Scan inbox folders for the current filter."),children:s.jsxs("button",{type:"button",className:a.commandButton,disabled:o.busyAction==="rescan",onClick:()=>{t("dashboard_click_event",{click_target:"assets_rescan",page:"assets"}),o.rescan()},children:[s.jsx(fs,{size:15}),e("assets.rescan","Rescan")]})}),s.jsx(ee,{text:p?"":e("assets.settings.open.tooltip","Open Roblox upload settings."),children:s.jsx("button",{type:"button",className:[a.iconButton,p?a.iconButtonActive:""].filter(Boolean).join(" "),onClick:()=>{t("dashboard_click_event",{click_target:"assets_open_settings",page:"assets"}),L(y=>!y)},"aria-label":e("assets.settings.open","Open settings"),"aria-controls":"asset-library-settings-panel","aria-expanded":p,children:s.jsx(bs,{size:16})})})]}),s.jsxs("div",{className:a.categoryControl,children:[s.jsx("span",{id:"assets-category-filter-label",className:a.categoryControlLabel,children:e("assets.category.filter","Category")}),s.jsx("div",{className:a.categoryRail,role:"radiogroup","aria-labelledby":"assets-category-filter-label",children:_s.map(y=>{const i=o.categoryFilter===y,A=qe(y,e);return s.jsx("button",{type:"button",role:"radio","aria-checked":i,className:[a.categoryButton,i?a.categoryButtonActive:""].filter(Boolean).join(" "),onClick:()=>{o.setCategoryFilter(y)},children:A},y)})})]})]}),D.some(y=>y.folderStatus==="duplicate"||y.folderStatus==="unresolved")?s.jsx("div",{className:a.placeFolderDetails,children:s.jsx(Hs,{places:D,t:e})}):null,s.jsx(Vn,{open:p,tier:n,onClose:()=>L(!1)})]}),o.error&&s.jsxs("div",{className:a.errorState,children:[o.scope==="all"?s.jsx("strong",{children:e("assets.partial.title","Some locations could not be loaded")}):null,s.jsx("span",{children:o.error})]}),o.lastMessage&&s.jsx("div",{className:a.messageState,children:o.lastMessage}),o.categoryFilter==="rbxm"&&s.jsxs("section",{className:a.rbxmGuide,"aria-label":e("assets.rbxmGuide.title","Save RBXM from Studio"),children:[s.jsx("h2",{children:e("assets.rbxmGuide.title","Save RBXM from Studio")}),s.jsx("p",{children:e("assets.rbxmGuide.body","Select objects in Roblox Studio, then use WEPPY Plugin > Assets to save the selection as a local RBXM asset.")}),s.jsx("p",{children:e("assets.rbxmGuide.thumbnail","The plugin save flow includes a thumbnail option, and saved RBXM assets appear here for management, upload, and insertion.")})]}),!R&&!l&&s.jsx("div",{className:`${a.notice} ${a.proNotice}`,children:e("assets.basic.notice","Browse, preview, edit metadata, and scan usage on Basic. Roblox upload controls are available on Pro.")}),o.loading?s.jsx("div",{className:a.emptyState,children:e("assets.loading.scope","Loading {scope} assets...").replace("{scope}",o.scope==="all"?e("assets.scope.all","All scopes"):o.scope==="shared"?e("assets.scope.shared","Shared"):e("assets.scope.place","Current Place"))}):s.jsx(cn,{displayScope:o.scope,assets:o.assets,place:{placeId:o.activePlaceId,placeName:o.activePlaceName},categoryFilter:o.categoryFilter,organizationMode:f.organizationMode,viewMode:f.viewMode,gridSize:f.gridSize,selectedAssetKey:E,onSelectAsset:o.selectAsset,onClearSelection:H,onOrganizationModeChange:f.setOrganizationMode,onViewModeChange:f.setViewMode,onGridSizeChange:f.setGridSize,emptyContent:o.error?void 0:s.jsx(pn,{scope:o.scope,isPro:R,busy:o.busyAction==="rescan",onRescan:()=>{t("dashboard_click_event",{click_target:"assets_empty_rescan",page:"assets"}),o.rescan()}})}),s.jsx(Pn,{asset:g||p||K?null:r,busyAction:o.busyAction,canUpload:R,canImportRbxm:V,importRbxmTooltip:$,importRbxmTargetParent:T,onClose:()=>o.selectAsset(null),onSave:async(y,i)=>{r&&await o.updateMetadata(r.id,{displayName:y,description:i})},onUpload:()=>x(!0),onDelete:()=>B(!0),onImportRbxm:async()=>{r&&(t("dashboard_click_event",{click_target:"assets_import_rbxm",page:"assets"}),await o.importRbxm(r.id,{targetParent:T}))},onRefreshStatus:async()=>{r&&await o.refreshStatus(r.id)},onScanUsage:async()=>{r&&(t("dashboard_click_event",{click_target:"assets_usage_scan",page:"assets"}),await o.scanUsage(r.id,o.activePlaceId??void 0))}}),s.jsx(ys,{open:K&&!!r,title:e("assets.delete.title","Delete asset"),message:e("assets.delete.message","This removes the local Asset Library files only. Uploaded Roblox assets are not deleted."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.delete","Delete"),loading:o.busyAction==="delete",onCancel:()=>B(!1),onConfirm:()=>{r&&(t("dashboard_click_event",{click_target:"assets_delete",page:"assets"}),o.deleteAsset(r.id).then(y=>{y&&B(!1)}))}}),s.jsx(On,{asset:r,open:g,canUpload:R,busyAction:o.busyAction,onClose:()=>{x(!1),o.selectAsset(null)},onBack:()=>x(!1),onOpenSettings:()=>{x(!1),L(!0)},onUpload:async y=>{if(!r)return;t("dashboard_click_event",{click_target:"assets_upload_submit",page:"assets"}),await o.uploadAsset(r.id,y)&&x(!1)}})]})}export{Co as Component};