@weppy/roblox-mcp 2.17.0 → 2.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dashboard/dist/assets/AiPromptExamples-CJjCcxg8.js +1 -0
- package/dashboard/dist/assets/AiPromptExamples-DvVR2a1g.css +1 -0
- package/dashboard/dist/assets/AssetsPage-DTiyyQxl.js +61 -0
- package/dashboard/dist/assets/AssetsPage-DX8NUPQo.css +1 -0
- package/dashboard/dist/assets/{ChangelogPage-DXZxXvJY.js → ChangelogPage-DuuVSnIa.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-CQhMb2gs.js → ConfirmModal-DaOuVA6n.js} +1 -1
- package/dashboard/dist/assets/{ConnectionPage-Bk4HeU0-.js → ConnectionPage-BIq2TqY_.js} +2 -7
- package/dashboard/dist/assets/{ControlsPage-jEHyFrVc.js → ControlsPage-DqEbayDU.js} +1 -1
- package/dashboard/dist/assets/{CurrentPlaceScope-B60o8hpn.js → CurrentPlaceScope-p_fkZWK9.js} +1 -1
- package/dashboard/dist/assets/{GameChangeDetail-B5X_6M-R.js → GameChangeDetail-BOp_DXQ9.js} +1 -1
- package/dashboard/dist/assets/{InfoLabel-csGVLmJ3.js → InfoLabel-gl5i0JQy.js} +1 -1
- package/dashboard/dist/assets/{OverviewPage-B2_8B6fs.js → OverviewPage-DcQz5h3p.js} +1 -1
- package/dashboard/dist/assets/{PageHeader-B42Je0MJ.js → PageHeader-BkXyqPrA.js} +1 -1
- package/dashboard/dist/assets/PlaytestAiPromptExamples-Ciyd-GNB.js +1 -0
- package/dashboard/dist/assets/PlaytestPage-C3Vjgtlg.css +1 -0
- package/dashboard/dist/assets/PlaytestPage-CoclFxfc.js +127 -0
- package/dashboard/dist/assets/{SettingsPage-eLuRrn1E.js → SettingsPage-BC0XIU-3.js} +1 -1
- package/dashboard/dist/assets/{StatusBadge-Ct9C2L71.js → StatusBadge-BQsRd8hv.js} +1 -1
- package/dashboard/dist/assets/{SyncPage-CKbsNp8O.js → SyncPage-DF2YdMPy.js} +1 -1
- package/dashboard/dist/assets/{Tabs-Dos9flTe.js → Tabs-Dy5daI-F.js} +1 -1
- package/dashboard/dist/assets/{TierPromoPanel-Ci_piK2n.js → TierPromoPanel-nA1RBcJp.js} +1 -1
- package/dashboard/dist/assets/{ToolsPage-mfcba-cj.js → ToolsPage-DSsqmlnt.js} +1 -1
- package/dashboard/dist/assets/{TooltipText-EK4_jbu2.js → TooltipText-BEK9VoiS.js} +1 -1
- package/dashboard/dist/assets/UiStudioPage-CiRNdRE-.js +11 -0
- package/dashboard/dist/assets/{UiStudioPage-CSK5gQMN.css → UiStudioPage-DdLVbHdA.css} +1 -1
- package/dashboard/dist/assets/WhatsNewPage-DX9G9ZFd.js +1 -0
- package/dashboard/dist/assets/WhatsNewPage-WMbbAUsL.css +1 -0
- package/dashboard/dist/assets/bot-B06rJuWg.js +6 -0
- package/dashboard/dist/assets/{check-BgcyMSc_.js → check-CZ_wdz7l.js} +1 -1
- package/dashboard/dist/assets/{copy-BJc7IQHD.js → copy-CGFMtAPH.js} +1 -1
- package/dashboard/dist/assets/{index-89-Xnii6.js → index-Hgv8iCTe.js} +55 -55
- package/dashboard/dist/assets/{sample-requests-DOteSh1j.js → sample-requests-DafsjfJi.js} +1 -1
- package/dashboard/dist/assets/{trash-2-CeZRGbl-.js → trash-2-DMQtyT_y.js} +1 -1
- package/dashboard/dist/assets/{useLiveUptime-BX-d0MHY.js → useLiveUptime-C6MCUOz0.js} +1 -1
- package/dashboard/dist/assets/{useSettings-B45j17ns.js → useSettings-DfLxtt-w.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/dist/index.js +136 -136
- package/package.json +1 -1
- package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
- package/dashboard/dist/assets/AssetsPage-BRZSoLQp.css +0 -1
- package/dashboard/dist/assets/AssetsPage-FecplRby.js +0 -56
- package/dashboard/dist/assets/PlaytestPage-B89cLi76.css +0 -1
- package/dashboard/dist/assets/PlaytestPage-Cww1uTQ8.js +0 -122
- package/dashboard/dist/assets/UiStudioPage-Y2PR7h_q.js +0 -11
- package/dashboard/dist/assets/WhatsNewPage-BsVZv6D8.css +0 -1
- package/dashboard/dist/assets/WhatsNewPage-uAPdDJaM.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -46,6 +46,28 @@ All notable changes to this project will be documented in this file.
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## [2.17.2] - 2026-09-12
|
|
53
|
+
|
|
54
|
+
### Features
|
|
55
|
+
|
|
56
|
+
- **Start Assets and UI Studio from an empty Dashboard** — Empty Assets and UI Studio views now explain what to do next, provide copyable AI requests, and keep loading, connection, error, and filtered-empty states distinct from first-use guidance.
|
|
57
|
+
- **Choose an image workflow that matches your AI** — Assets defaults to registering an existing image and clearly marks new image creation as requiring an AI that can create PNG or JPG files or use an image-generation tool. The same guide also explains inbox rescanning, saving Studio models, and uploading registered assets through Roblox Open Cloud on Pro.
|
|
58
|
+
|
|
59
|
+
## [2.17.1] - 2026-09-10
|
|
60
|
+
|
|
61
|
+
### Features
|
|
62
|
+
|
|
63
|
+
- **Start Playtest from an empty Dashboard** — Empty Test Values and Automated Test Results now show copyable AI request examples. Test Values also explains how to select an object in Studio and add a supported property, Attribute, or Value directly.
|
|
64
|
+
|
|
65
|
+
### Bug Fixes
|
|
66
|
+
|
|
67
|
+
- **Fix missing Playtest profile deletion in the Dashboard** — Test profiles can now be deleted from the profile editor after reviewing what will be removed. Profiles currently in use remain protected until Play or Run stops, and deleting a profile does not remove game objects, scripts, test connection code, other profiles, or saved automated test results.
|
|
68
|
+
- **Release Playtest profiles when a session ends** — Stopping a profile-started Play, returning Studio to Edit, or disconnecting Studio now closes the matching control session, releases the profile for editing or deletion, and marks its Watch values unavailable instead of leaving old values looking current.
|
|
69
|
+
- **Keep profile revision requirements visible to AI clients** — Profile update and deletion requests now explain when the current revision is required, helping AI agents avoid stale changes and retry with the latest profile when another edit has already occurred.
|
|
70
|
+
- **Close MCP Adapter sessions cleanly when input ends** — A normal AI client shutdown now finishes Adapter cleanup without forcing an immediate process exit, while the existing timeout fallback still handles leaked resources. This avoids abrupt shutdown behavior on Windows and keeps the shared Studio connection lifecycle separate.
|
|
49
71
|
|
|
50
72
|
## [2.17.0] - 2026-09-10
|
|
51
73
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,j as t}from"./index-Hgv8iCTe.js";import{C as d}from"./copy-CGFMtAPH.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
|
+
._examples_1sykl_1{display:flex;flex-direction:column;gap:var(--space-section)}._example_1sykl_1{display:flex;flex-direction:column;gap:var(--space-related);min-width:0}._example_1sykl_1 h4,._request_1sykl_15,._nextStep_1sykl_16{margin:0}._example_1sykl_1 h4{color:var(--text-primary);font-family:var(--font-label);font-size:var(--type-card-title-size);font-weight:600;line-height:var(--leading-title)}._request_1sykl_15{padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-secondary);font-size:var(--type-body-size);line-height:var(--leading-body);white-space:pre-wrap;-webkit-user-select:text;user-select:text}._actionRow_1sykl_40{display:flex;align-items:center;gap:var(--space-related);min-height:34px}._copyButton_1sykl_47{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:34px;padding:0 12px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-primary);font-family:var(--font-label);font-size:var(--type-control-size);font-weight:600;cursor:pointer}._copyButton_1sykl_47:hover:not(:disabled){border-color:var(--accent);background:var(--accent-dim)}._copyButton_1sykl_47:focus-visible{outline:none;box-shadow:var(--focus-ring)}._copyButton_1sykl_47:disabled{cursor:wait;opacity:.65}._success_1sykl_79,._error_1sykl_80,._nextStep_1sykl_16{font-size:var(--type-control-size);line-height:var(--leading-body)}._success_1sykl_79{color:var(--success-text)}._error_1sykl_80{color:var(--error-text)}._nextStep_1sykl_16{color:var(--text-secondary)}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import{f as re,b as F,l as ke,u as pe,j as s,P as Ns,I as As,r as c,F as Is,m as Ps,R as ms,X as Ke,E as ws,n as hs,g as Rs,a as $s,e as Ls}from"./index-Hgv8iCTe.js";import{C as gs}from"./ConfirmModal-DaOuVA6n.js";import{B as Ge,C as Ts,D as qe,b as Bs,P as Us}from"./PageHeader-BkXyqPrA.js";import{T as J}from"./TooltipText-BEK9VoiS.js";import{A as Es}from"./AiPromptExamples-CJjCcxg8.js";import{B as Gs}from"./bot-B06rJuWg.js";import{T as Ds}from"./trash-2-DMQtyT_y.js";import{C as xs}from"./copy-CGFMtAPH.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 Ms=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Fs=re("arrow-left",Ms);/**
|
|
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 Os=[["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"}]],Hs=re("audio-lines",Os);/**
|
|
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 zs=[["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"}]],Ks=re("badge",zs);/**
|
|
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 Ws=[["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"}]],Vs=re("box",Ws);/**
|
|
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 Ys=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],De=re("chevron-right",Ys);/**
|
|
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 qs=[["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"}]],Xs=re("clapperboard",qs);/**
|
|
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 Js=[["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"}]],Zs=re("film",Js);/**
|
|
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 Qs=[["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"}]],et=re("folder-input",Qs);/**
|
|
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 st=[["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"}]],tt=re("grid-2x2",st);/**
|
|
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 at=[["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"}]],nt=re("list",at);/**
|
|
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 rt=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ot=re("search",rt);/**
|
|
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 lt=[["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"}]],it=re("upload",lt);function fs(e){if(e.scope==="place"&&typeof e.placeId=="number")return{placeId:String(e.placeId)}}function oe(e){const t=fs(e);return t?`?placeId=${encodeURIComponent(t.placeId)}`:""}function Ae(e){return`/api/assets/${encodeURIComponent(e.scope)}/${encodeURIComponent(e.category)}`}function me(e,t){return`${Ae(e)}/${encodeURIComponent(t)}`}async function ct(e){return F.get(Ae(e),fs(e))}async function dt(e){return F.post(`${Ae(e)}/rescan${oe(e)}`,{})}async function ut(e,t,r){return(await F.patch(`${me(e,t)}${oe(e)}`,r)).asset}async function pt(e,t){return F.delete(`${me(e,t)}${oe(e)}`)}async function mt(e,t,r){return(await F.post(`${me(e,t)}/upload${oe(e)}`,r)).asset}async function Xe(e,t){return(await F.post(`${me(e,t)}/status-refresh${oe(e)}`,{})).asset}async function ht(e,t,r){const n={...e,placeId:r??e.placeId};return F.post(`${me(e,t)}/usage-scan${oe(n)}`,{})}async function gt(e,t){return F.post(`${Ae(e)}/export-selection-rbxm${oe(e)}`,t)}async function xt(e,t,r){return F.post(`${me(e,t)}/import-rbxm${oe(e)}`,r)}async function ft(e,t){return(await F.post(`${me(e,t)}/thumbnail-generate${oe(e)}`,{})).asset}function bs(e){return e.fileUrl?`${ke}${e.fileUrl}`:`${ke}/api/assets/${e.scope.kind}/${e.category}/${encodeURIComponent(e.id)}/file${oe({scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0})}`}function He(e){return e.previewUrl?`${ke}${e.previewUrl}`:`${ke}/api/assets/${e.scope.kind}/${e.category}/${encodeURIComponent(e.id)}/preview${oe({scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0})}`}const ys=["all","image","decal","rbxm"],bt=new Set(ys),Je=["model","animation"];function _e(e){return/\.(rbxm|rbxmx)$/i.test(e.file.original)}function yt(e){return bt.has(e)}function ze(e,t){return e==="all"?t("assets.category.all","All"):t(`assets.category.${e}`,e==="rbxm"?"RBXM":e)}function de(e,t){return ze(_e(e)?"rbxm":e.category,t)}function jt(e){return e==="all"?["image","decal",...Je]:e==="rbxm"?Je:[e]}function vt(e,t){return t==="all"?e.category==="image"||e.category==="decal"||_e(e):t==="rbxm"?_e(e):(t==="model"||t==="animation")&&_e(e)?!1:e.category===t}function Ct(e){return[...e].sort((t,r)=>r.createdAt.localeCompare(t.createdAt)||r.id.localeCompare(t.id))}function Ie(e){return e?e.split("/").filter(Boolean):[]}function We(e,t){return t.every((r,n)=>e[n]===r)}function js(e,t){return t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id)}function te(e){const t=e.scope.kind==="place"?e.scope.placeId:"-";return`${e.scope.kind}:${t}:${e.category}:${e.id}`}function Ve(e){return Ie(e.folderPath)}function _t(e,t){const r=Ie(t),n=new Map;for(const o of e){const f=Ve(o);if(f.length<=r.length||!We(f,r))continue;const x=f[r.length],g=[...r,x].join("/"),p=n.get(g);p?p.descendantCount+=1:n.set(g,{name:x,path:g,descendantCount:1})}return[...n.values()].sort((o,f)=>o.name.localeCompare(f.name))}function St(e,t){const r=Ie(t);return e.filter(n=>{const o=Ve(n);return o.length===r.length&&We(o,r)}).sort(js)}function kt(e){return[...e].sort(js)}function Nt(e,t){const r=Ie(t);for(;r.length>0;){if(e.some(o=>{const f=Ve(o);return f.length>=r.length&&We(f,r)}))return r.join("/");r.pop()}return""}const At="_page_7mrkg_1",It="_experimentalBadge_7mrkg_9",Pt="_toolbarShell_7mrkg_23",wt="_toolbar_7mrkg_23",Rt="_segmented_7mrkg_41",$t="_placeContextSlot_7mrkg_45",Lt="_listContextSummary_7mrkg_50",Tt="_toolbarActions_7mrkg_54",Bt="_categoryControl_7mrkg_59",Ut="_contextDivider_7mrkg_84",Et="_categoryControlLabel_7mrkg_88",Gt="_categoryRail_7mrkg_94",Dt="_categoryButton_7mrkg_102",Mt="_categoryButtonActive_7mrkg_131",Ft="_copyRow_7mrkg_144",Ot="_buttonRow_7mrkg_145",Ht="_segmentedActive_7mrkg_187",zt="_placeSelectorLabel_7mrkg_192",Kt="_placeSelect_7mrkg_192",Wt="_sharedPlaceContext_7mrkg_218",Vt="_commandButton_7mrkg_244",Yt="_primaryButton_7mrkg_245",qt="_iconButton_7mrkg_246",Xt="_dangerButton_7mrkg_286",Jt="_iconButtonActive_7mrkg_307",Zt="_grid_7mrkg_320",Qt="_folderGrid_7mrkg_328",ea="_explorer_7mrkg_337",sa="_explorerToolbar_7mrkg_344",ta="_explorerLocation_7mrkg_354",aa="_breadcrumb_7mrkg_380",na="_breadcrumbSegment_7mrkg_381",ra="_viewOptions_7mrkg_424",oa="_organizationModeControl_7mrkg_432",la="_viewModeControl_7mrkg_433",ia="_gridSizeControl_7mrkg_434",ca="_explorerSection_7mrkg_487",da="_folderTile_7mrkg_510",ua="_folderListRow_7mrkg_535",pa="_assetListRow_7mrkg_536",ma="_assetCard_7mrkg_537",ha="_folderIcon_7mrkg_542",ga="_folderName_7mrkg_554",xa="_folderCount_7mrkg_566",fa="_assetList_7mrkg_536",ba="_folderList_7mrkg_535",ya="_assetListHeader_7mrkg_580",ja="_listPreviewWrap_7mrkg_617",va="_listPreview_7mrkg_617",Ca="_listPreviewFallback_7mrkg_619",_a="_listAssetName_7mrkg_648",Sa="_listAssetCategory_7mrkg_660",ka="_listAssetScope_7mrkg_661",Na="_listAssetUpdated_7mrkg_662",Aa="_folderType_7mrkg_663",Ia="_folderScope_7mrkg_664",Pa="_folderStatus_7mrkg_665",wa="_folderUpdated_7mrkg_666",Ra="_assetCardSelected_7mrkg_695",$a="_thumbnailWrap_7mrkg_700",La="_thumbnail_7mrkg_700",Ta="_thumbnailFallback_7mrkg_716",Ba="_assetCardBody_7mrkg_727",Ua="_assetName_7mrkg_734",Ea="_assetMeta_7mrkg_742",Ga="_statusChip_7mrkg_749",Da="_categoryPill_7mrkg_750",Ma="_assetId_7mrkg_755",Fa="_scopeText_7mrkg_756",Oa="_muted_7mrkg_757",Ha="_emptyState_7mrkg_762",za="_notice_7mrkg_763",Ka="_errorState_7mrkg_764",Wa="_messageState_7mrkg_765",Va="_emptyGuide_7mrkg_789",Ya="_emptyGuideHeader_7mrkg_799",qa="_emptyGuideMethod_7mrkg_800",Xa="_emptyGuideSteps_7mrkg_822",Ja="_emptyGuideMethods_7mrkg_828",Za="_emptyGuideMethodTitle_7mrkg_842",Qa="_emptyGuideTierNote_7mrkg_860",en="_emptyGuideMethodHelp_7mrkg_865",sn="_emptyGuideCapabilityDescription_7mrkg_866",tn="_emptyGuideChoices_7mrkg_872",an="_emptyGuideChoice_7mrkg_872",nn="_emptyGuideChoiceSelected_7mrkg_900",rn="_emptyGuideChoiceLabel_7mrkg_910",on="_emptyGuideCapability_7mrkg_866",ln="_emptyGuideAction_7mrkg_926",cn="_proNotice_7mrkg_956",dn="_rbxmGuide_7mrkg_974",un="_settingsInlinePanel_7mrkg_1014",pn="_settingsDrawer_7mrkg_1034",mn="_detailPopupLayer_7mrkg_1050",hn="_detailDialog_7mrkg_1066",gn="_detailDialogHeader_7mrkg_1083",xn="_detailTitleBlock_7mrkg_1094",fn="_detailEyebrow_7mrkg_1116",bn="_detailHeaderActions_7mrkg_1125",yn="_detailDialogBody_7mrkg_1133",jn="_detailPreviewPane_7mrkg_1142",vn="_detailPreview_7mrkg_1142",Cn="_detailPreviewFallback_7mrkg_1154",_n="_detailContentPane_7mrkg_1190",Sn="_formStack_7mrkg_1196",kn="_drawerHeader_7mrkg_1200",Nn="_detailSection_7mrkg_1251",An="_noticeList_7mrkg_1252",In="_settingsPanel_7mrkg_1253",Pn="_setupNotice_7mrkg_1270",wn="_field_7mrkg_1295",Rn="_fieldLabelRow_7mrkg_1303",$n="_fieldHelp_7mrkg_1327",Ln="_twoColumn_7mrkg_1332",Tn="_technicalDetails_7mrkg_1343",Bn="_detailGrid_7mrkg_1360",Un="_metadataList_7mrkg_1361",En="_compactMeta_7mrkg_1372",Gn="_copyableValue_7mrkg_1399",Dn="_inlineCopyButton_7mrkg_1410",Mn="_hashText_7mrkg_1431",Fn="_usageList_7mrkg_1435",On="_usageItem_7mrkg_1441",Hn="_metadataItem_7mrkg_1442",zn="_settingsSubsection_7mrkg_1490",Kn="_settingsSectionHeader_7mrkg_1495",Wn="_settingsDefinitionList_7mrkg_1508",Vn="_toggleRow_7mrkg_1530",Yn="_inlineHelp_7mrkg_1544",a={page:At,experimentalBadge:It,toolbarShell:Pt,toolbar:wt,segmented:Rt,placeContextSlot:$t,listContextSummary:Lt,toolbarActions:Tt,categoryControl:Bt,contextDivider:Ut,categoryControlLabel:Et,categoryRail:Gt,categoryButton:Dt,categoryButtonActive:Mt,copyRow:Ft,buttonRow:Ot,segmentedActive:Ht,placeSelectorLabel:zt,placeSelect:Kt,sharedPlaceContext:Wt,commandButton:Vt,primaryButton:Yt,iconButton:qt,dangerButton:Xt,iconButtonActive:Jt,grid:Zt,folderGrid:Qt,explorer:ea,explorerToolbar:sa,explorerLocation:ta,breadcrumb:aa,breadcrumbSegment:na,viewOptions:ra,organizationModeControl:oa,viewModeControl:la,gridSizeControl:ia,explorerSection:ca,folderTile:da,folderListRow:ua,assetListRow:pa,assetCard:ma,folderIcon:ha,folderName:ga,folderCount:xa,assetList:fa,folderList:ba,assetListHeader:ya,listPreviewWrap:ja,listPreview:va,listPreviewFallback:Ca,listAssetName:_a,listAssetCategory:Sa,listAssetScope:ka,listAssetUpdated:Na,folderType:Aa,folderScope:Ia,folderStatus:Pa,folderUpdated:wa,assetCardSelected:Ra,thumbnailWrap:$a,thumbnail:La,thumbnailFallback:Ta,assetCardBody:Ba,assetName:Ua,assetMeta:Ea,statusChip:Ga,categoryPill:Da,assetId:Ma,scopeText:Fa,muted:Oa,emptyState:Ha,notice:za,errorState:Ka,messageState:Wa,emptyGuide:Va,emptyGuideHeader:Ya,emptyGuideMethod:qa,emptyGuideSteps:Xa,emptyGuideMethods:Ja,emptyGuideMethodTitle:Za,emptyGuideTierNote:Qa,emptyGuideMethodHelp:en,emptyGuideCapabilityDescription:sn,emptyGuideChoices:tn,emptyGuideChoice:an,emptyGuideChoiceSelected:nn,emptyGuideChoiceLabel:rn,emptyGuideCapability:on,emptyGuideAction:ln,proNotice:cn,rbxmGuide:dn,settingsInlinePanel:un,settingsDrawer:pn,detailPopupLayer:mn,detailDialog:hn,detailDialogHeader:gn,detailTitleBlock:xn,detailEyebrow:fn,detailHeaderActions:bn,detailDialogBody:yn,detailPreviewPane:jn,detailPreview:vn,detailPreviewFallback:Cn,detailContentPane:_n,formStack:Sn,drawerHeader:kn,detailSection:Nn,noticeList:An,settingsPanel:In,setupNotice:Pn,field:wn,fieldLabelRow:Rn,fieldHelp:$n,twoColumn:Ln,technicalDetails:Tn,detailGrid:Bn,metadataList:Un,compactMeta:En,copyableValue:Gn,inlineCopyButton:Dn,hashText:Mn,usageList:Fn,usageItem:On,metadataItem:Hn,settingsSubsection:zn,settingsSectionHeader:Kn,settingsDefinitionList:Wn,toggleRow:Vn,inlineHelp:Yn},qn={image:As,decal:Ks,audio:Hs,mesh:Vs,model:Ns,video:Zs,animation:Xs};function Ne(e,t){return t(`assets.status.${e}`,e)}function Ze(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 Qe(e){return e.category==="image"||e.category==="decal"||!!e.file.preview}function Xn(e){return e.category==="decal"?e.roblox.creatorAssetId??e.roblox.assetId:e.roblox.assetId}function vs(e,t){var x;const r=((x=e.rbxm)==null?void 0:x.studioUploads)??[];if(r.length===0)return null;const n=r.filter(g=>g.status==="uploaded").length,o=r.filter(g=>g.status==="failed").length,f=[n>0?`${n} ${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 Jn({assets:e,selectedAssetId:t,selectedAssetKey:r=null,viewMode:n="grid",gridSize:o="medium",onSelect:f}){const{t:x}=pe();return e.length===0?s.jsxs("div",{className:a.emptyState,children:[s.jsx("p",{children:x("assets.empty.title","No assets yet")}),s.jsx("span",{children:x("assets.empty.body","Choose a scope and category, then rescan that inbox folder.")})]}):s.jsx("div",{className:n==="list"?a.assetList:a.grid,"data-view-mode":n,"data-grid-size":o,children:e.map(g=>{const p=qn[g.category],L=Xn(g),V=vs(g,x),U=te(g),$=r?r===U:t===g.id,l=g.scope.kind==="shared"?x("assets.scope.shared","Shared"):x("assets.scope.place","Current Place");return n==="list"?s.jsxs("button",{type:"button",className:[a.assetListRow,$?a.assetCardSelected:""].filter(Boolean).join(" "),onClick:()=>f(U),children:[s.jsx("span",{className:a.listPreviewWrap,children:Qe(g)?s.jsx("img",{className:a.listPreview,src:He(g),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:g.displayName}),s.jsx("span",{className:a.listAssetCategory,children:de(g,x)}),s.jsx("span",{className:a.listAssetScope,children:l}),s.jsx(Ge,{variant:Ze(g.status),className:a.statusChip,children:Ne(g.status,x)}),s.jsx("time",{className:a.listAssetUpdated,dateTime:g.updatedAt,children:new Date(g.updatedAt).toLocaleDateString()})]},U):s.jsxs("button",{type:"button",className:[a.assetCard,$?a.assetCardSelected:""].filter(Boolean).join(" "),onClick:()=>f(U),children:[s.jsx("span",{className:a.thumbnailWrap,children:Qe(g)?s.jsx("img",{className:a.thumbnail,src:He(g),alt:g.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:g.displayName}),s.jsxs("span",{className:a.assetMeta,children:[s.jsx(Ge,{variant:"neutral",className:a.categoryPill,children:de(g,x)}),s.jsx(Ge,{variant:Ze(g.status),className:a.statusChip,children:Ne(g.status,x)})]}),s.jsxs("span",{className:a.assetMeta,children:[s.jsx("span",{className:a.scopeText,children:l}),s.jsx("span",{className:a.assetId,children:L?`#${L}`:V??x("assets.status.localOnly","Local only")})]})]})]},U)})})}function es(e){return{scope:e==="all"?null:e,folderPath:""}}function Me(e,t,r){return t==="shared"?e.scope.kind==="shared":e.scope.kind==="place"&&(r===null||e.scope.placeId===r)}function Zn(e,t){var r;return t?e.folderPath===t||((r=e.folderPath)==null?void 0:r.startsWith(`${t}/`))===!0:!0}function Qn({displayScope:e,assets:t,place:r,categoryFilter:n,organizationMode:o,viewMode:f,gridSize:x,selectedAssetKey:g,onSelectAsset:p,onClearSelection:L,onOrganizationModeChange:V,onViewModeChange:U,onGridSizeChange:$,emptyContent:l}){const{t:b}=pe(),[N,B]=c.useState(()=>es(e)),Y=c.useRef(`${e}:${r.placeId??"-"}`),q=c.useRef(!1),z=c.useRef(null),O=m=>m==="shared"?b("assets.scope.shared","Shared"):r.placeName??b("assets.scope.place","Current Place"),E=m=>{q.current=!0,B(m),L()};c.useEffect(()=>{const m=`${e}:${r.placeId??"-"}`;Y.current!==m&&(Y.current=m,q.current=!0,B(es(e)),L())},[e,L,r.placeId]),c.useEffect(()=>{var m;q.current&&(q.current=!1,(m=z.current)==null||m.focus())},[N]);const K=c.useMemo(()=>N.scope===null?[]:t.filter(m=>Me(m,N.scope,r.placeId)),[t,N.scope,r.placeId]);c.useEffect(()=>{if(N.scope===null)return;const m=Nt(K,N.folderPath);m!==N.folderPath&&(q.current=!0,B(I=>({...I,folderPath:m})),L())},[n,N.folderPath,N.scope,L,K]);const D=c.useMemo(()=>o==="folders"?_t(K,N.folderPath):[],[N.folderPath,o,K]),Z=c.useMemo(()=>e==="all"?t:t.filter(m=>Me(m,e,r.placeId)),[t,e,r.placeId]),P=c.useMemo(()=>o==="all-assets"?kt(Z):St(K,N.folderPath),[Z,N.folderPath,o,K]);c.useEffect(()=>{g&&(P.some(m=>te(m)===g)||L())},[L,g,P]);const R=N.folderPath?N.folderPath.split("/"):[],_=o==="all-assets"?b("assets.organization.all","All assets"):R[R.length-1]??(N.scope?O(N.scope):b("assets.scope.all","All scopes")),A=N.scope===null?t.length:K.filter(m=>Zn(m,N.folderPath)).length,y=Math.max(0,A-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)),w=m=>m===1?b("assets.folder.count.one","1 asset"):b("assets.folder.count.many","{count} assets").replace("{count}",String(m)),Q=(m,I,h,M,j)=>s.jsxs("button",{type:"button",className:f==="list"?a.folderListRow:a.folderTile,"aria-label":`${I}, ${w(h)}`,onClick:j,children:[s.jsx("span",{className:a.folderIcon,"aria-hidden":"true",children:s.jsx(Is,{size:f==="list"?22:28})}),s.jsx("span",{className:a.folderName,children:I}),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:O(M)}),s.jsx("span",{className:a.folderStatus,children:w(h)}),s.jsx("span",{className:a.folderUpdated,children:"—"})]}):s.jsx("span",{className:a.folderCount,children:w(h)})]},m),W=o==="folders"&&e==="all"&&N.scope===null?[{scope:"place",name:O("place")},{scope:"shared",name:O("shared")}].map(({scope:m,name:I})=>({scope:m,name:I,count:t.filter(h=>Me(h,m,r.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"):O(e)}),s.jsx(De,{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(De,{size:14,"aria-hidden":"true"}):null,R.length>0?s.jsx("button",{type:"button",onClick:()=>E({scope:N.scope,folderPath:""}),children:O(N.scope)}):s.jsx("span",{"aria-current":"page",children:O(N.scope)})]}):null,o==="folders"&&R.map((m,I)=>{const h=R.slice(0,I+1).join("/"),M=I===R.length-1;return s.jsxs("span",{className:a.breadcrumbSegment,children:[s.jsx(De,{size:14,"aria-hidden":"true"}),M?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:z,tabIndex:-1,children:_}),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:()=>V("folders"),children:b("assets.organization.folders","Folders")}),s.jsx("button",{type:"button","aria-pressed":o==="all-assets",onClick:()=>V("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:()=>U("grid"),children:[s.jsx(tt,{size:14}),b("assets.view.grid","Grid")]}),s.jsxs("button",{type:"button","aria-pressed":f==="list",onClick:()=>U("list"),children:[s.jsx(nt,{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":x===m,disabled:f==="list",onClick:()=>$(m),children:b(`assets.view.size.${m}`,m[0].toUpperCase()+m.slice(1))},m))})]})]}),f==="list"&&(W.length>0||D.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":x,children:W.map(m=>Q(`scope:${m.scope}`,m.name,m.count,m.scope,()=>E({scope:m.scope,folderPath:""})))})]}):null,D.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":x,children:D.map(m=>Q(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(Jn,{assets:P,selectedAssetId:null,selectedAssetKey:g,viewMode:f,gridSize:x,onSelect:p})]}):null,D.length===0&&P.length===0&&(W.length===0||t.length===0)?n==="all"&&t.length===0&&l?l:s.jsxs("div",{className:a.emptyState,children:[s.jsx("p",{children:t.length===0?n==="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?n==="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 er(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 sr(e){const{locale:t,t:r}=pe(),[n,o]=c.useState("register"),f=er(r),x=e.scope==="all"?r("assets.emptyGuide.scope.all","Choose Current Place or Shared before adding files."):e.scope==="shared"?r("assets.emptyGuide.scope.shared","New files will be registered in the Shared library."):r("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:r("assets.emptyGuide.title","Collect assets for your game")}),s.jsx("p",{children:r("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(Gs,{size:16,"aria-hidden":"true"}),s.jsx("h4",{children:r("assets.emptyGuide.ai.title","Ask AI")})]}),s.jsx("p",{className:a.emptyGuideMethodHelp,children:r("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":r("assets.emptyGuide.ai.methodLabel","Image preparation method"),children:[s.jsxs("button",{type:"button",role:"radio","aria-checked":n==="register",className:`${a.emptyGuideChoice} ${n==="register"?a.emptyGuideChoiceSelected:""}`,onClick:()=>o("register"),children:[s.jsx("span",{className:a.emptyGuideChoiceLabel,children:r("assets.emptyGuide.ai.registerOption","Register an existing image")}),s.jsx("span",{className:a.emptyGuideCapability,children:r("assets.emptyGuide.ai.registerCapability","Image generation not required")})]}),s.jsxs("button",{type:"button",role:"radio","aria-checked":n==="generate",className:`${a.emptyGuideChoice} ${n==="generate"?a.emptyGuideChoiceSelected:""}`,onClick:()=>o("generate"),children:[s.jsx("span",{className:a.emptyGuideChoiceLabel,children:r("assets.emptyGuide.ai.generateOption","Generate a new image")}),s.jsx("span",{className:a.emptyGuideCapability,children:r("assets.emptyGuide.ai.generateCapability","Image generation required")})]})]}),s.jsx("p",{className:a.emptyGuideCapabilityDescription,children:n==="register"?r("assets.emptyGuide.ai.registerDescription","Use this when you already have an image file or are unsure whether your AI can generate images."):r("assets.emptyGuide.ai.generateDescription","Use this only when your AI can create PNG or JPG files or has an image generation tool.")}),s.jsx(Es,{examples:[f[n]],resetKey:`${t}|assets-${n}`,labels:{copy:r("guidance.ai.copy","Copy request"),copying:r("guidance.ai.copying","Copying…"),copied:r("guidance.ai.copied","Copied"),copyFailed:r("guidance.ai.copyFailed","Could not copy. Select the request text and copy it manually.")},nextStep:r("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(et,{size:16,"aria-hidden":"true"}),s.jsx("h4",{children:r("assets.emptyGuide.direct.title","Add files yourself")})]}),s.jsx("p",{children:x}),s.jsxs("ol",{className:a.emptyGuideSteps,children:[s.jsx("li",{children:r("assets.emptyGuide.direct.image","Put image or decal files in the inbox for the selected scope, then rescan.")}),s.jsx("li",{children:r("assets.emptyGuide.direct.model","For models, select objects in Studio and save them from WEPPY Plugin > Assets.")}),s.jsx("li",{children:r("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:r("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:r("assets.emptyGuide.direct.rescan","Rescan inbox")})]})]})]})}const tr="https://create.roblox.com/dashboard/creations/store",ar=/^https:\/\/create\.roblox\.com\/store\/asset\/\d+(?:\/.*)?$/;function nr(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Se(e){const t=new Date(e);if(Number.isNaN(t.getTime()))return e;const r=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),o=String(t.getDate()).padStart(2,"0"),f=String(t.getHours()).padStart(2,"0"),x=String(t.getMinutes()).padStart(2,"0");return`${r}-${n}-${o} ${f}:${x}`}function rr(e){return e.category==="image"||e.category==="decal"||!!e.file.preview}function or(e){return e.file.preview?He(e):bs(e)}function lr(e){var r;const t=Object.entries(((r=e.rbxm)==null?void 0:r.classCounts)??{}).sort((n,o)=>o[1]-n[1]).slice(0,8);return t.length===0?"-":t.map(([n,o])=>`${n} ${o}`).join(", ")}function ss(e){var o;const t=(o=e.rbxm)==null?void 0:o.thumbnail;if(!t)return"-";const r=t.source?` via ${t.source}`:"",n=t.message?` · ${t.message}`:"";return`${t.status}${r}${n}`}function ir(e){var o,f;const t=(f=(o=e.rbxm)==null?void 0:o.review)==null?void 0:f.summary;if(!t)return"-";const r=[["roots",t.rootCount],["parts",t.partCount],["mesh parts",t.meshPartCount],["scripts",t.scriptCount],["unanchored",t.unanchoredPartCount]].flatMap(([x,g])=>typeof g=="number"?[`${x} ${g}`]:[]),n=t.bounds;if(n&&typeof n=="object"&&"size"in n){const x=n.size;if(x&&typeof x=="object"){const{x:g,y:p,z:L}=x;typeof g=="number"&&typeof p=="number"&&typeof L=="number"&&r.push(`bounds ${g} x ${p} x ${L}`)}}return r.length>0?r.join(", "):"-"}function cr(e){var r,n;const t=(r=e.rbxm)==null?void 0:r.generation;return t?t.schemaMode==="custom"&&((n=t.schemaGroups)!=null&&n.length)?`custom · ${t.schemaGroups.join(", ")}`:t.predefinedSchema?`${t.schemaMode??"predefined"} · ${t.predefinedSchema}`:t.schemaMode??"-":"-"}function ts(e){const{width:t,height:r}=e.file;return t===null||r===null?null:`${t} x ${r}px`}function as(e){const{durationMs:t}=e.file;return t===null?null:t<1e3?`${t} ms`:`${(t/1e3).toFixed(1)} s`}function dr(e){return`${tr}/${e}/configure`}function ur(e){return e.category==="decal"?e.roblox.creatorAssetId??e.roblox.assetId??null:e.roblox.assetId??null}function pr(e){const t=ur(e),r=t?dr(t):null,n=e.category==="decal"?e.roblox.creatorAssetWebUrl??e.roblox.assetWebUrl:e.roblox.assetWebUrl;return!n||r&&ar.test(n)?r:n}function mr(e){return`${Se(e.startedAt)} -> ${e.status}`}function ns(e){return!e.creatorType||!e.creatorId?null:`${e.creatorType} ${e.creatorId}`}function rs(e){return e.assetRole?`Asset role: ${e.assetRole}`:null}function hr(e){const t=e.sourceProperty?` · ${e.sourceProperty}`:"";return`${e.path} · ${e.assetType} · ${e.status}${t}`}function gr(e){return e.assetUri&&e.assetId?`${e.assetUri} (#${e.assetId})`:e.assetUri?e.assetUri:e.assetId?`#${e.assetId}`:e.message??"-"}function ve({label:e,value:t}){return t?s.jsx("button",{type:"button",className:a.inlineCopyButton,"aria-label":e,title:e,onClick:()=>{var r;return void((r=navigator.clipboard)==null?void 0:r.writeText(t))},children:s.jsx(xs,{size:13})}):null}function xr({asset:e,busyAction:t,canUpload:r,canImportRbxm:n,importRbxmTooltip:o,importRbxmTargetParent:f,onClose:x,onSave:g,onUpload:p,onDelete:L,onImportRbxm:V,onRefreshStatus:U,onScanUsage:$}){var A,y;const{t:l}=pe(),b=c.useRef(null),[N,B]=c.useState(""),[Y,q]=c.useState("");if(c.useEffect(()=>{B((e==null?void 0:e.displayName)??""),q((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 w;if(!e)return;(w=b.current)==null||w.focus();const i=Q=>{Q.key==="Escape"&&x()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e,x]),!e)return null;const z=e.status==="processing"&&!!(e.roblox.operationId??e.roblox.operationPath),O=!!e.roblox.assetUri,E=pr(e),K=e.roblox.uploadAttempts??[],D=e.category==="decal"&&!!(e.roblox.creatorAssetId||e.roblox.backingImageAssetId||e.roblox.assetId),Z=e.roblox.creatorAssetId??e.roblox.assetId,P=e.roblox.backingImageAssetId??e.roblox.assetId,R=vs(e,l),_=e.roblox.assetId?e.usage.lastScannedAt?l("assets.detail.noUsageAfterScan","No references were found in local Sync files during the last check."):l("assets.detail.noUsageUnscanned","Run Scan usage to search local Sync files for this Roblox Asset ID."):l("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:x,role:"presentation",children:s.jsxs("section",{ref:b,className:a.detailDialog,role:"dialog","aria-modal":"true","aria-label":l("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:[de(e,l)," · ",Ne(e.status,l)]}),s.jsx("h2",{children:e.displayName}),s.jsx("span",{children:e.id})]}),s.jsxs("div",{className:a.detailHeaderActions,children:[s.jsx(J,{text:r?l("assets.upload.open.tooltip","Upload this local file to Roblox through Open Cloud."):l("assets.proOnly.tooltip","Roblox upload is available on Pro."),children:s.jsxs("button",{type:"button",className:a.commandButton,disabled:!r,onClick:p,children:[s.jsx(it,{size:15}),l("assets.upload.open","Upload")]})}),n&&s.jsx(J,{text:o,children:s.jsxs("button",{type:"button",className:a.commandButton,disabled:t==="import-rbxm",onClick:()=>void V(),children:[s.jsx(Ps,{size:15}),l("assets.detail.importRbxm","Insert into Studio")]})}),s.jsxs("button",{type:"button",className:a.commandButton,disabled:!z||t==="status-refresh",onClick:()=>void U(),children:[s.jsx(ms,{size:15}),l("assets.detail.refreshStatus","Refresh")]}),s.jsxs("button",{type:"button",className:a.commandButton,disabled:!e.roblox.assetId||t==="usage-scan",onClick:()=>void $(),children:[s.jsx(ot,{size:15}),l("assets.detail.scanUsage","Scan usage")]}),s.jsx(J,{text:l("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(Ds,{size:15}),l("common.delete","Delete")]})}),s.jsx(J,{text:l("common.close","Close"),children:s.jsx("button",{type:"button",className:a.iconButton,onClick:x,"aria-label":l("common.close","Close"),children:s.jsx(Ke,{size:16})})})]})]}),s.jsxs("div",{className:a.detailDialogBody,children:[s.jsx("div",{className:a.detailPreviewPane,children:rr(e)?s.jsx("img",{className:a.detailPreview,src:or(e),alt:e.displayName}):s.jsxs("div",{className:a.detailPreviewFallback,children:[s.jsx("span",{children:de(e,l)}),s.jsx("code",{children:e.file.original}),((A=e.rbxm)==null?void 0:A.thumbnail)&&s.jsx("small",{children:ss(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:l("assets.detail.displayName","Display name")}),s.jsx("input",{value:N,onChange:i=>B(i.target.value)})]}),s.jsxs("label",{className:a.field,children:[s.jsx("span",{children:l("assets.detail.description","Description")}),s.jsx("textarea",{value:Y,rows:3,onChange:i=>q(i.target.value)})]}),s.jsx("button",{type:"button",className:a.primaryButton,disabled:t==="update",onClick:()=>void g(N,Y),children:l("assets.detail.save","Save metadata")})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:l("assets.detail.localFile","Local file")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:l("assets.detail.fileName","File")}),s.jsx("dd",{children:e.file.original}),s.jsx("dt",{children:l("assets.detail.source","Source path")}),s.jsx("dd",{children:e.source.originalPath}),s.jsx("dt",{children:l("assets.detail.category","Category")}),s.jsx("dd",{children:de(e,l)}),s.jsx("dt",{children:l("assets.detail.scope","Scope")}),s.jsx("dd",{children:e.scope.kind==="shared"?l("assets.scope.shared","Shared"):l("assets.scope.place","Current Place")}),s.jsx("dt",{children:l("assets.detail.mimeType","Type")}),s.jsx("dd",{children:e.file.mimeType}),s.jsx("dt",{children:l("assets.detail.size","Size")}),s.jsx("dd",{children:nr(e.file.sizeBytes)}),ts(e)&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:l("assets.detail.dimensions","Dimensions")}),s.jsx("dd",{children:ts(e)})]}),as(e)&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:l("assets.detail.duration","Duration")}),s.jsx("dd",{children:as(e)})]})]})]}),e.rbxm&&s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:l("assets.detail.rbxm","RBXM contents")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:l("assets.detail.rbxmExportedCount","Exported roots")}),s.jsx("dd",{children:e.rbxm.exportedCount}),s.jsx("dt",{children:l("assets.detail.rbxmClasses","Classes")}),s.jsx("dd",{children:lr(e)}),s.jsx("dt",{children:l("assets.detail.rbxmThumbnail","Thumbnail")}),s.jsx("dd",{children:ss(e)}),R&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:l("assets.detail.rbxmStudioUploadsLabel","Studio uploads")}),s.jsx("dd",{children:R})]}),n&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:l("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:l("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:l("assets.detail.rbxmReferences","Asset references")}),e.rbxm.resourceReferences.map((i,w)=>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}-${w}`))]}),e.rbxm.studioUploads&&e.rbxm.studioUploads.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:l("assets.detail.rbxmStudioUploads","Embedded Studio uploads")}),e.rbxm.studioUploads.map((i,w)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:hr(i)}),s.jsx("code",{children:gr(i)})]},`${i.path}-${i.assetType}-${i.sourceProperty??""}-${w}`))]}),e.rbxm.generation&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:l("assets.detail.rbxmGeneration","Generated model")}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:l("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:l("assets.detail.rbxmGenerationPrompt","Prompt")}),s.jsx("code",{children:e.rbxm.generation.prompt})]}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:l("assets.detail.rbxmGenerationSchema","Schema")}),s.jsx("code",{children:cr(e)})]}),e.rbxm.generation.path&&s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:l("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:l("assets.detail.rbxmReview","Model review")}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:l("assets.detail.rbxmReviewReadiness","Readiness")}),s.jsx("code",{children:e.rbxm.review.readiness})]}),s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:l("assets.detail.rbxmReviewSummary","Summary")}),s.jsx("code",{children:ir(e)})]}),e.rbxm.review.findings.slice(0,8).map((i,w)=>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}-${w}`))]})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:l("assets.detail.roblox","Roblox upload status")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:l("assets.detail.status","Status")}),s.jsx("dd",{children:Ne(e.status,l)}),D?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:l("assets.detail.decalAssetId","Roblox Decal ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:Z??l("assets.status.localOnly","Local only")}),s.jsx(ve,{label:l("assets.detail.copyDecalAssetId","Copy Roblox Decal ID"),value:Z})]}),s.jsx("dt",{children:l("assets.detail.studioTextureImageId","Studio Texture Image ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:P??"-"}),s.jsx(ve,{label:l("assets.detail.copyStudioTextureImageId","Copy Studio Texture Image ID"),value:P})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:l("assets.detail.assetId","Asset ID")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:e.roblox.assetId??l("assets.status.localOnly","Local only")}),s.jsx(ve,{label:l("assets.detail.copyAssetId","Copy Asset ID"),value:e.roblox.assetId})]})]}),s.jsx("dt",{children:l("assets.detail.studioUri","Studio URI")}),s.jsx("dd",{children:e.roblox.assetUri??"-"}),s.jsx("dt",{children:l("assets.detail.robloxWebUrl","Creator Dashboard URL")}),s.jsxs("dd",{className:a.copyableValue,children:[s.jsx("span",{children:E??"-"}),s.jsx(ve,{label:l("assets.detail.copyWebUrl","Copy configure URL"),value:E})]}),e.roblox.errorMessage&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:l("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:!O,onClick:()=>{var i;return e.roblox.assetUri&&void((i=navigator.clipboard)==null?void 0:i.writeText(e.roblox.assetUri))},children:[s.jsx(xs,{size:15}),l("assets.detail.copyStudioUri","Copy Studio URI")]}),E&&s.jsxs("a",{className:a.commandButton,href:E,target:"_blank",rel:"noreferrer",children:[s.jsx(ws,{size:15}),l("assets.detail.openRobloxPage","Open configure page")]})]}),e.roblox.assetId&&s.jsx("p",{className:a.muted,children:l("assets.detail.robloxWebUrlNotice","Opening this page requires the Roblox account that owns or can manage the uploaded asset.")}),K.length>0&&s.jsxs("div",{className:a.metadataList,children:[s.jsx("strong",{children:l("assets.detail.uploadHistory","Upload history")}),K.slice().reverse().map((i,w)=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("span",{children:mr(i)}),ns(i)&&s.jsx("code",{children:ns(i)}),rs(i)&&s.jsx("code",{children:rs(i)}),i.operationPath&&s.jsx("code",{children:i.operationPath}),i.assetId&&s.jsxs("code",{children:[l("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??w}`))]})]}),s.jsxs("section",{className:a.detailSection,children:[s.jsx("h3",{children:l("assets.detail.usedInPlace","Where this asset is used in this Place")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:l("assets.detail.usageSource","Checked against")}),s.jsx("dd",{children:e.usage.scanSource==="localSync"?l("assets.detail.usageSource.localSync","Local Sync files"):l("assets.detail.usageSource.notScanned","Not checked yet")}),s.jsx("dt",{children:l("assets.detail.lastScanned","Last checked")}),s.jsx("dd",{children:e.usage.lastScannedAt?l("assets.detail.lastScannedAt","Last checked: {time}").replace("{time}",Se(e.usage.lastScannedAt)):l("assets.detail.lastScanned.never","No check yet")})]}),e.usage.references.length===0?s.jsx("p",{className:a.muted,children:_}):s.jsx("div",{className:a.usageList,children:e.usage.references.map((i,w)=>s.jsxs("div",{className:a.usageItem,children:[s.jsx("strong",{children:i.kind==="property"?i.instancePath:i.filePath}),s.jsx("span",{children:i.property??l("assets.detail.line","line {line}").replace("{line}",String(i.line??"-"))}),s.jsx("code",{children:i.value})]},`${i.kind}-${w}`))})]}),s.jsxs("details",{className:a.technicalDetails,children:[s.jsx("summary",{children:l("assets.detail.technicalDetails","Technical details")}),s.jsxs("dl",{className:a.detailGrid,children:[s.jsx("dt",{children:l("assets.detail.stableId","Stable ID")}),s.jsx("dd",{className:a.hashText,children:e.id}),s.jsx("dt",{children:l("assets.detail.sourceKind","Source kind")}),s.jsx("dd",{children:e.source.kind}),s.jsx("dt",{children:l("assets.detail.sha256","SHA-256")}),s.jsx("dd",{className:a.hashText,children:e.file.sha256}),s.jsx("dt",{children:l("assets.detail.createdAt","Created")}),s.jsx("dd",{children:Se(e.createdAt)}),s.jsx("dt",{children:l("assets.detail.updatedAt","Updated")}),s.jsx("dd",{children:Se(e.updatedAt)}),e.roblox.operationId&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:l("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:l("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:l("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:l("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:l("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:l("assets.detail.rbxmThumbnailAttempts","Thumbnail attempts")}),e.rbxm.thumbnail.attempts.map((i,w)=>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}-${w}`))]})]})]})]})]})})}function Cs(e){return{assetUploadByOpenCloudEnabled:e.hot.ENABLE_ASSET_UPLOAD_BY_OPEN_CLOUD===!0}}function fr(e){const t={};return typeof e.assetUploadByOpenCloudEnabled=="boolean"&&(t.ENABLE_ASSET_UPLOAD_BY_OPEN_CLOUD=e.assetUploadByOpenCloudEnabled),t}async function _s(){const e=await F.get("/api/dashboard/settings");return Cs(e)}async function br(e){const t=await F.patch("/api/dashboard/settings",fr(e));return Cs(t)}async function Ss(){return F.get("/api/dashboard/open-cloud/credential-profiles")}async function yr(e){return F.post("/api/dashboard/open-cloud/credential-profiles",e)}async function jr(e){return F.patch("/api/dashboard/open-cloud/credential-profiles/active",{profileId:e})}async function vr(e,t){return F.put(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/api-key`,t)}async function Cr(e){return F.delete(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}`)}async function _r(e,t){return F.post(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators`,t)}async function Sr(e,t){return F.patch(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators/${encodeURIComponent(t)}/default`,{})}async function kr(e,t){return F.delete(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/creators/${encodeURIComponent(t)}`)}async function Nr(e,t){return F.post(`/api/dashboard/open-cloud/credential-profiles/${encodeURIComponent(e)}/test`,t?{creatorPresetId:t}:{})}async function Ar(e){return F.post("/api/dashboard/open-cloud/credential/test",e?{apiKey:e}:{})}function Ir(e){return e.category==="image"||e.category==="decal"}function Pr(e,t){return e==="group"?t("assets.creator.group","Group"):t("assets.creator.user","User")}function wr(e,t){return`${e.label} · ${Pr(e.creatorType,t)} ${e.creatorId}`}function os(e){if(!e)return null;if(e.defaultCreatorId){const t=e.creators.find(r=>r.id===e.defaultCreatorId);if(t)return t}return e.creators[0]??null}function Rr({asset:e,open:t,canUpload:r,busyAction:n,onClose:o,onBack:f,onOpenSettings:x,onUpload:g}){const{t:p}=pe(),L=c.useRef(null),[V,U]=c.useState(null),[$,l]=c.useState(null),[b,N]=c.useState(!1),[B,Y]=c.useState(null),[q,z]=c.useState(""),[O,E]=c.useState(""),[K,D]=c.useState(""),[Z,P]=c.useState("user"),[R,_]=c.useState("");if(c.useEffect(()=>{z((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 j=!1;return N(!0),Y(null),(async()=>{try{const[H,X]=await Promise.all([_s(),Ss()]);if(j)return;U(H);const le=X.profiles.find(ae=>ae.id===X.activeProfileId)??X.profiles[0]??null;l(le);const ee=os(le);D((ee==null?void 0:ee.id)??""),P((ee==null?void 0:ee.creatorType)??"user"),_((ee==null?void 0:ee.creatorId)??"")}catch(H){if(j)return;Y(H instanceof Error?H.message:p("assets.upload.settingsLoadFailed","Failed to load upload settings.")),U(null),l(null)}finally{j||N(!1)}})(),()=>{j=!0}},[t,p]),c.useEffect(()=>{var H;if(!t||!e)return;(H=L.current)==null||H.focus();const j=X=>{X.key==="Escape"&&o()};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[e,o,t]),!t||!e)return null;const A=(V==null?void 0:V.assetUploadByOpenCloudEnabled)===!0,y=!!$,i=os($),w=($==null?void 0:$.creators.find(j=>j.id===K))??null,Q=!!i,m=($==null?void 0:$.storageProvider)==="env"&&y&&!Q,I=m&&R.trim().length>0,h=r&&!b&&!B&&(!A||!y||!Q&&!m),M=r&&!b&&!B&&A&&y&&(Q||I)&&n!=="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:j=>j.stopPropagation(),children:[s.jsxs("div",{className:a.detailDialogHeader,children:[s.jsxs("div",{className:a.detailTitleBlock,children:[s.jsxs("span",{className:a.detailEyebrow,children:[de(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(Fs,{size:15}),p("assets.upload.backToDetails","Back to details")]}),s.jsx(J,{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(Ke,{size:16})})})]})]}),s.jsxs("div",{className:a.detailDialogBody,children:[s.jsx("div",{className:a.detailPreviewPane,children:Ir(e)?s.jsx("img",{className:a.detailPreview,src:bs(e),alt:e.displayName}):s.jsxs("div",{className:a.detailPreviewFallback,children:[s.jsx("span",{children:de(e,p)}),s.jsx("code",{children:e.file.original})]})}),s.jsxs("div",{className:a.detailContentPane,children:[!r&&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...")}),B&&s.jsx("div",{className:a.errorState,children:B}),s.jsxs("dl",{className:a.compactMeta,children:[s.jsx("dt",{children:p("assets.detail.category","Category")}),s.jsx("dd",{children:de(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?A?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:x,children:[s.jsx(hs,{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:q,disabled:!r,onChange:j=>z(j.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:O,rows:3,disabled:!r,onChange:j=>E(j.target.value)}),s.jsx("small",{className:a.fieldHelp,children:p("assets.upload.descriptionHelp","Saved to Roblox as the asset description.")})]}),Q&&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:K,disabled:!r||b,onChange:j=>D(j.target.value),children:$==null?void 0:$.creators.map(j=>s.jsx("option",{value:j.id,children:wr(j,p)},j.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:Z,disabled:!r,onChange:j=>P(j.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:R,disabled:!r,onChange:j=>_(j.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:!M,onClick:()=>{const j=R.trim(),H=m&&j?{creatorType:Z,creatorId:j}:{},X=!m&&w&&i&&w.id!==i.id?{creatorType:w.creatorType,creatorId:w.creatorId}:{};g({displayName:q,description:O,...H,...X})},children:n==="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 ls(e,t){return e==="env"?t("assets.settings.credential.env","Environment variable"):t("assets.settings.credential.local","Local encrypted file")}function Fe(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 $r(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 Lr(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 Tr(e,t){return e==="group"?t("assets.creator.group","Group"):t("assets.creator.user","User")}function Br(e,t){return`${Tr(e.creatorType,t)} ${e.creatorId}`}function Ur({open:e,tier:t,onClose:r}){const{t:n}=pe(),[o,f]=c.useState(null),[x,g]=c.useState(null),[p,L]=c.useState(""),[V,U]=c.useState(!1),[$,l]=c.useState(""),[b,N]=c.useState(""),[B,Y]=c.useState("user"),[q,z]=c.useState(""),[O,E]=c.useState(""),[K,D]=c.useState(!0),[Z,P]=c.useState(null),[R,_]=c.useState(null),[A,y]=c.useState(!1),i=t==="basic",w=c.useCallback(async()=>{y(!0),P(null);try{const[u,S]=await Promise.all([_s(),Ss()]);f(u),g(S);const T=S.profiles.find(ue=>ue.id===S.activeProfileId)??S.profiles[0]??null;L((T==null?void 0:T.id)??""),U(!T),D(!T||T.creators.length===0),Y("user"),z(""),E("")}catch(u){P(u instanceof Error?u.message:n("assets.settings.loadFailed","Failed to load upload settings."))}finally{y(!1)}},[n]);if(c.useEffect(()=>{e&&w()},[w,e]),!e)return null;const Q=(o==null?void 0:o.assetUploadByOpenCloudEnabled)===!0,W=b.trim(),m=q.trim(),I=(x==null?void 0:x.profiles)??[],h=I.find(u=>u.id===p)??I[0]??null,M=!!h,j=M&&(h==null?void 0:h.storageProvider)==="localFile",H=M&&(h==null?void 0:h.storageProvider)==="env",X=h!=null&&h.defaultCreatorId?h.creators.find(u=>u.id===h.defaultCreatorId):h==null?void 0:h.creators[0],le=!!(h!=null&&h.creators.length),ee=!le||K,ae=I.length>1,ie=i?n("assets.settings.action.proRequired","Asset upload settings are available on Pro."):A?n("assets.settings.action.busy","Wait for the current settings action to finish."):null,Pe=i||A||!W,we=ie??(W?n("assets.settings.saveApiKey.tooltip.ready","Save this API key to local encrypted storage."):n("assets.settings.saveApiKey.tooltip.enter","Enter an Open Cloud API key to save it locally.")),fe=i||A||!W&&!M,be=ie??(W?n("assets.settings.testConnection.tooltip.entered","Test the entered API key before saving it."):M?n("assets.settings.testConnection.tooltip.saved","Test the saved Open Cloud API key."):n("assets.settings.testConnection.tooltip.enterOrSaved","Enter an API key or save one before testing the connection.")),ye=i||A||!j,je=ie??(j?n("assets.settings.removeApiKey.tooltip.ready","Remove the locally saved Open Cloud API key."):H?n("assets.settings.removeApiKey.tooltip.env","Environment API keys cannot be removed from Dashboard. Remove ROBLOX_OPEN_CLOUD_API_KEY outside WEPPY."):n("assets.settings.removeApiKey.tooltip.none","No local Open Cloud API key is saved.")),Re=i||A||!j||!m,$e=ie??(H?n("assets.settings.saveCreator.tooltip.env","Environment API keys cannot save a default Creator here. Enter Creator details in the upload dialog."):j?m?n("assets.settings.saveCreator.tooltip.ready","Save this Creator as the default owner for uploads."):n("assets.settings.saveCreator.tooltip.enterId","Enter a user or group ID before saving the default Creator."):n("assets.settings.saveCreator.tooltip.noLocal","Save a local Open Cloud API key before saving a default Creator.")),Le=ie??(j?n("assets.settings.addCreator.tooltip.ready","Add another User or Group Creator preset to this profile."):n("assets.settings.saveCreator.tooltip.noLocal","Save a local Open Cloud API key before saving a default Creator.")),Te=i||A||H||!j,Be=ie??(j?n("assets.settings.unregisterCreator.tooltip.ready","Unregister this Creator from the selected profile."):H?n("assets.settings.saveCreator.tooltip.env","Environment API keys cannot save a default Creator here. Enter Creator details in the upload dialog."):n("assets.settings.saveCreator.tooltip.noLocal","Save a local Open Cloud API key before saving a default Creator.")),Ue=X?n("assets.settings.saveCreatorPreset","Save Creator"):n("assets.settings.saveCreator","Save default Creator"),d=(h==null?void 0:h.label)??n("assets.settings.credential.none","No API key saved"),v=u=>{const S=u.profiles.find(T=>T.id===u.activeProfileId)??u.profiles[0]??null;g(u),L((S==null?void 0:S.id)??""),D(!S||S.creators.length===0),U(u.profiles.length===0)},C=async()=>{if(h){y(!0);try{const u=await Nr(h.id,X==null?void 0:X.id);v(u),P(Lr(u.validation,n))}catch(u){P(u instanceof Error?u.message:n("assets.settings.testFailed","Connection test failed."))}finally{y(!1)}}},k=async()=>{if(R){y(!0);try{if(R.kind==="apiKey"){const u=await Cr(R.profileId);v(u),P(n("assets.settings.apiKeyRemoved","Open Cloud API key unregistered from local storage."))}else{const u=await kr(R.profileId,R.creatorPresetId);v(u),P(n("assets.settings.creatorUnregistered","Creator unregistered from this profile."))}_(null)}catch(u){P(u instanceof Error?u.message:R.kind==="apiKey"?n("assets.settings.removeFailed","Failed to unregister API key."):n("assets.settings.creatorUnregisterFailed","Failed to unregister Creator."))}finally{y(!1)}}},G=(R==null?void 0:R.kind)==="apiKey"?n("assets.settings.unregisterApiKey.title","Unregister API Key?"):n("assets.settings.unregisterCreator.title","Unregister Creator?"),ne=(R==null?void 0:R.kind)==="apiKey"?n("assets.settings.unregisterApiKey.message","Roblox API key is not revoked. WEPPY only removes the local Credential Profile registration on this device."):n("assets.settings.unregisterCreator.message","Roblox user or group is not deleted. WEPPY only removes this Creator from the selected API Key profile."),se=(R==null?void 0:R.kind)==="apiKey"?n("assets.settings.removeApiKey","Unregister API Key"):n("assets.settings.unregisterCreator","Unregister Creator");return s.jsxs("section",{id:"asset-library-settings-panel",className:`${a.settingsInlinePanel} ${a.settingsDrawer}`,role:"region","aria-label":n("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:n("assets.settings.title","Asset Library settings")}),s.jsx("span",{children:d})]}),s.jsx(J,{text:n("common.close","Close"),children:s.jsx("button",{type:"button",className:a.iconButton,onClick:r,"aria-label":n("common.close","Close"),children:s.jsx(Ke,{size:16})})})]}),i&&s.jsx("div",{className:`${a.notice} ${a.proNotice}`,children:n("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:n("assets.settings.openCloudToggle","Open Cloud upload")}),s.jsx("small",{children:n("assets.settings.openCloudToggle.help","Controls whether server-side Open Cloud upload mutations can run.")})]}),s.jsx(Ts,{checked:Q,disabled:i||A,onChange:u=>{(async()=>{y(!0);try{const S=await br({assetUploadByOpenCloudEnabled:u.target.checked});f(S),P(n("assets.settings.saved","Upload settings saved."))}catch(S){P(S instanceof Error?S.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{y(!1)}})()}})]}),ae&&s.jsx("div",{className:a.metadataList,children:I.map(u=>{const S=u.id===(h==null?void 0:h.id);return s.jsxs("div",{className:a.metadataItem,children:[s.jsx("strong",{children:u.label}),s.jsxs("span",{children:[n("assets.settings.field.storage","Storage"),": ",ls(u.storageProvider,n)]}),s.jsxs("span",{children:[n("assets.settings.field.validationStatus","Validation status"),": ",Fe(u.validationStatus,n)]}),S&&s.jsx("code",{children:n("assets.settings.activeProfileBadge","Active")}),!S&&u.storageProvider==="localFile"&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||A,onClick:()=>{(async()=>{y(!0);try{const T=await jr(u.id),ue=T.profiles.find(Ee=>Ee.id===(T.activeProfileId??u.id))??u;g(T),L(ue.id),D(ue.creators.length===0),Y("user"),z(""),E(""),P(n("assets.settings.profileSelected","Open Cloud credential profile selected."))}catch(T){P(T instanceof Error?T.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{y(!1)}})()},children:n("assets.settings.useProfile","Use profile")})]},u.id)})}),h&&s.jsxs("div",{className:a.settingsSubsection,children:[s.jsx("div",{className:a.settingsSectionHeader,children:s.jsx("h3",{children:n("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:n("assets.settings.field.profile","Profile")}),s.jsx("dd",{children:h.label})]}),h.maskedKey&&s.jsxs("div",{children:[s.jsx("dt",{children:n("assets.settings.field.apiKey","API Key")}),s.jsx("dd",{children:h.maskedKey})]}),s.jsxs("div",{children:[s.jsx("dt",{children:n("assets.settings.field.storage","Storage")}),s.jsx("dd",{children:ls(h.storageProvider,n)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:n("assets.settings.field.validationStatus","Validation status")}),s.jsx("dd",{children:Fe(h.validationStatus,n)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:n("assets.settings.field.creators","Creators")}),s.jsx("dd",{children:h.creators.length})]})]}),!V&&s.jsxs("div",{className:a.buttonRow,children:[s.jsx(J,{text:be,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:fe,onClick:()=>{C()},children:n("assets.settings.testConnection","Test Connection")})}),j&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||A,onClick:()=>U(!0),children:n("assets.settings.replaceApiKey","Replace API Key")}),s.jsx(J,{text:je,children:s.jsx("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:ye,onClick:()=>_({kind:"apiKey",profileId:h.id}),children:n("assets.settings.removeApiKey","Unregister API Key")})})]})]})]}),V&&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:n("assets.settings.profileLabel","Profile name")})}),s.jsx("input",{id:"asset-settings-open-cloud-profile-label",value:$,disabled:i||A,onChange:u=>l(u.target.value),placeholder:n("assets.settings.profileLabel.placeholder","Studio automation key")}),s.jsx("p",{className:a.inlineHelp,children:n("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:n("assets.settings.apiKey","Open Cloud API Key")}),s.jsx(qe,{topicId:"openCloudApiKey",variant:"field",state:{hasOpenCloudCredential:M}})]}),s.jsx("input",{id:"asset-settings-open-cloud-api-key",value:b,type:"password",disabled:i||A,onChange:u=>N(u.target.value)}),s.jsx("p",{className:a.inlineHelp,children:n("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.")})]}),!M&&s.jsx("p",{className:a.inlineHelp,children:s.jsx("a",{href:Bs["open_cloud.api_key"].docsUrl,target:"_blank",rel:"noreferrer",children:n("assets.settings.apiKeyGuide","Create a Roblox API key with Assets Read and Write permissions.")})}),s.jsxs("div",{className:a.buttonRow,children:[s.jsx(J,{text:we,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:Pe,onClick:()=>{(async()=>{var u;y(!0);try{const S={apiKey:W,...$.trim()?{label:$.trim()}:{}},T=(h==null?void 0:h.storageProvider)==="localFile"?await vr(h.id,S):await yr(S),ue=T.profiles.find(Ee=>{var Ye;return Ee.id===(T.activeProfileId??((Ye=T.profile)==null?void 0:Ye.id))});g(T),L(T.activeProfileId??((u=T.profile)==null?void 0:u.id)??""),D(!ue||ue.creators.length===0),U(!1),N(""),l(""),P(n("assets.settings.apiKeySaved","Open Cloud API key saved locally."))}catch(S){P(S instanceof Error?S.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{y(!1)}})()},children:n("assets.settings.saveApiKey","Save API Key")})}),s.jsx(J,{text:be,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:fe,onClick:()=>{(async()=>{y(!0);try{const u=await Ar(W||void 0);P($r(u.validation,n))}catch(u){P(u instanceof Error?u.message:n("assets.settings.testFailed","Connection test failed."))}finally{y(!1)}})()},children:n("assets.settings.testConnection","Test Connection")})}),s.jsx(J,{text:je,children:s.jsx("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:ye,onClick:()=>{h&&_({kind:"apiKey",profileId:h.id})},children:n("assets.settings.removeApiKey","Unregister API Key")})})]})]}),s.jsx("div",{className:a.metadataList,children:h==null?void 0:h.creators.map(u=>s.jsxs("div",{className:a.metadataItem,children:[s.jsx("strong",{children:u.label}),s.jsx("span",{children:Br(u,n)}),u.id===h.defaultCreatorId&&s.jsx("code",{children:n("assets.settings.defaultCreatorBadge","Default")}),s.jsxs("span",{children:[n("assets.settings.field.validationStatus","Validation status"),": ",Fe(u.validationStatus,n)]}),s.jsxs("div",{className:a.buttonRow,children:[u.id!==h.defaultCreatorId&&h.storageProvider==="localFile"&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||A,onClick:()=>{(async()=>{if(h){y(!0);try{const S=await Sr(h.id,u.id);g(S),P(n("assets.settings.defaultCreatorSaved","Open Cloud default Creator saved locally."))}catch(S){P(S instanceof Error?S.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{y(!1)}}})()},children:n("assets.settings.makeDefaultCreator","Make default")}),s.jsx(J,{text:Be,children:s.jsx("button",{type:"button",className:`${a.commandButton} ${a.dangerButton}`,disabled:Te,onClick:()=>_({kind:"creator",profileId:h.id,creatorPresetId:u.id}),children:n("assets.settings.unregisterCreator","Unregister Creator")})})]})]},u.id))}),le&&!K&&s.jsx(J,{text:Le,children:s.jsx("button",{type:"button",className:a.commandButton,disabled:i||A||H||!j,onClick:()=>{Y("user"),z(""),E(""),D(!0)},children:n("assets.settings.addCreator","Add Creator")})}),ee&&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:n("assets.upload.creatorType","Creator type")})}),s.jsxs("select",{id:"asset-settings-creator-type",value:B,disabled:i||A||H||!j,onChange:u=>Y(u.target.value),children:[s.jsx("option",{value:"user",children:n("assets.creator.user","User")}),s.jsx("option",{value:"group",children:n("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:n("assets.upload.creatorId","Creator ID")}),s.jsx(qe,{topicId:"openCloudCreatorId",variant:"field",state:{hasDefaultCreator:!!X}})]}),s.jsx("input",{id:"asset-settings-creator-id",value:q,disabled:i||A||H||!j,onChange:u=>z(u.target.value)}),s.jsx("p",{className:a.inlineHelp,children:n("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:n("assets.settings.creatorLabel","Creator label")})}),s.jsx("input",{id:"asset-settings-creator-label",value:O,disabled:i||A||H||!j,onChange:u=>E(u.target.value),placeholder:n("assets.settings.creatorLabel.placeholder","Main studio group")}),s.jsx("p",{className:a.inlineHelp,children:n("assets.settings.creatorLabel.help","Optional. If left blank, WEPPY automatically saves a label like User 123 or Group 456.")})]}),!X&&s.jsx("p",{className:a.inlineHelp,children:n("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(J,{text:$e,children:s.jsx("button",{type:"button",className:a.primaryButton,disabled:Re,onClick:()=>{(async()=>{if(h){y(!0);try{const u=await _r(h.id,{creatorType:B,creatorId:m,makeDefault:!X,...O.trim()?{label:O.trim()}:{}});g(u),z(""),E(""),D(!1),P(n("assets.settings.defaultCreatorSaved","Open Cloud default Creator saved locally."))}catch(u){P(u instanceof Error?u.message:n("assets.settings.saveFailed","Failed to save upload settings."))}finally{y(!1)}}})()},children:Ue})}),le&&s.jsx("button",{type:"button",className:a.commandButton,disabled:i||A,onClick:()=>{Y("user"),z(""),E(""),D(!1)},children:n("assets.settings.cancelCreator","Cancel")})]})]})]}),Z&&s.jsx("div",{className:a.messageState,children:Z}),s.jsx(gs,{open:R!==null,title:G,message:ne,cancelLabel:n("common.cancel","Cancel"),confirmLabel:se,loading:A,onCancel:()=>_(null),onConfirm:()=>{k()}})]})}const Er=12,Gr=5e3;function ce(e,t){return e instanceof Error&&e.message.trim().length>0?e.message:t}function is(e,t){return e.some(n=>xe(n,t))?e.map(n=>xe(n,t)?t:n):[t,...e]}function xe(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 Dr(e,t){return e.some(r=>xe(r,t))?e.map(r=>xe(r,t)?t:r):e}function Oe(e,t){return Ct(e.filter(r=>vt(r,t)))}function ge(e,t){return e?`${e.displayName} (${e.id})`:t??"unknown asset"}function Mr(e){return e.length===0?"none":e.map(t=>ge(t)).join(", ")}function cs(e){const t=`status ${e.status}`;return e.roblox.assetId?`Roblox asset ${e.roblox.assetId}; ${t}`:t}function Fr(e,t){const r=ge(t);return e==="update"?`Updated metadata for asset: ${r}.`:e==="upload"?`Uploaded asset: ${r} -> ${cs(t)}.`:e==="thumbnail-generate"?`Generated thumbnail for asset: ${r}.`:e==="status-refresh"?`Refreshed Roblox status for asset: ${r} -> ${cs(t)}.`:e==="usage-scan"?`Scanned usage for asset: ${r} -> ${t.usage.references.length} reference(s).`:`Updated asset: ${r}.`}function Or(e){return e!=="upload"&&e!=="status-refresh"}function ds(e){return e.status==="processing"&&!!(e.roblox.operationId??e.roblox.operationPath)}function Ce(e){return{scope:e.scope.kind,placeId:e.scope.kind==="place"?e.scope.placeId:void 0,category:e.category}}function Hr(e,t){return e==="shared"?[{scope:"shared"}]:e==="place"?t===null?[]:[{scope:"place",placeId:t}]:[...t===null?[]:[{scope:"place",placeId:t}],{scope:"shared"}]}function us(e,t,r){return Hr(e,t).flatMap(n=>jt(r).map(o=>({request:{...n,category:o},label:`${n.scope}/${o}`})))}function ps(e,t){if(t.length===0)return null;const r=t.map(({label:n,reason:o})=>`${n}: ${ce(o,"request failed")}`);return`${e}: ${r.join("; ")}`}function zr(e){if(e.pluginConnected&&e.activePlaceId!==null)return{placeId:e.activePlaceId,placeName:e.activePlaceName,studioConnected:!0};if(e.lastActivePlaceId!==null)return{placeId:e.lastActivePlaceId,placeName:e.lastActivePlaceName,studioConnected:!1};const t=e.places[0];return{placeId:(t==null?void 0:t.placeId)??null,placeName:(t==null?void 0:t.placeName)??null,studioConnected:!1}}function Kr(e,t){if(typeof t=="number"){const r=e.places.find(n=>n.placeId===t);if(r)return{placeId:r.placeId,placeName:r.placeName,studioConnected:r.isConnected,overrideStillValid:!0}}return{...zr(e),overrideStillValid:t===null}}function Wr(){const[e,t]=c.useState([]),[r,n]=c.useState(0),[o,f]=c.useState(null),[x,g]=c.useState("place"),[p,L]=c.useState("all"),[V,U]=c.useState([]),[$,l]=c.useState(null),[b,N]=c.useState(null),[B,Y]=c.useState(null),[q,z]=c.useState(null),[O,E]=c.useState(!1),[K,D]=c.useState(!1),[Z,P]=c.useState(!0),[R,_]=c.useState(null),[A,y]=c.useState(null),[i,w]=c.useState(null),Q=c.useRef(!0),W=c.useRef(new Map),m=c.useRef(new Set),I=c.useMemo(()=>e.find(d=>te(d)===o)??null,[e,o]),h=(I==null?void 0:I.id)??null;c.useEffect(()=>{o&&(e.some(d=>te(d)===o)||f(null))},[e,o]);const M=c.useCallback(d=>{const v=W.current.get(d);v!==void 0&&(clearTimeout(v),W.current.delete(d))},[]),j=c.useCallback((d,v=Er)=>{const C=te(d);if(!ds(d)||v<=0){M(C);return}m.current.has(C)||(M(C),m.current.add(C),(async()=>{try{const k=await Xe(Ce(d),d.id);if(!Q.current)return;if(t(G=>Dr(G,k)),ds(k)&&v>1){const G=te(k),ne=setTimeout(()=>{W.current.delete(G),j(k,v-1)},Gr);W.current.set(G,ne);return}M(te(k))}catch(k){if(!Q.current)return;M(C),y(ce(k,"Asset Library status refresh failed."))}finally{m.current.delete(C)}})())},[M]);c.useEffect(()=>()=>{Q.current=!1;for(const d of W.current.values())clearTimeout(d);W.current.clear(),m.current.clear()},[]);const H=c.useCallback(()=>x==="shared"?{scope:"shared"}:{scope:"place",placeId:B??void 0},[B,x]),X=c.useCallback(d=>({...H(),category:d}),[H]),le=c.useCallback(async()=>{try{const d=await Rs(),v=Kr(d,$);return U(d.places),v.overrideStillValid||l(null),N(v.placeId),Y(v.placeId),z(v.placeName),E(v.studioConnected),D(v.studioConnected),v.placeId}catch{return U([]),N(null),Y(null),z(null),E(!1),D(!1),null}},[$]),ee=c.useCallback(async()=>{y(null);try{const d=await le();if(x==="place"&&d===null){t([]),n(0),P(!1),y("No active place is connected for place-scoped assets.");return}const v=us(x,d,p),C=await Promise.allSettled(v.map(({request:se})=>ct(se))),k=C.flatMap(se=>se.status==="fulfilled"?[se.value]:[]),G=C.flatMap((se,u)=>se.status==="rejected"?[{label:v[u].label,reason:se.reason}]:[]);x==="all"&&d===null&&G.unshift({label:"place",reason:new Error("No active place is available")});const ne=Oe(k.flatMap(se=>se.assets),p);t(ne),n(ne.length);for(const se of ne)j(se);y(ps("Some Asset Library requests failed",G))}catch(d){y(ce(d,"Failed to load Asset Library."))}finally{P(!1)}},[p,le,x,j]);c.useEffect(()=>{ee()},[ee]);const ae=c.useCallback(async(d,v,C)=>{const k=(I==null?void 0:I.id)===v?I:e.find(G=>G.id===v)??null;if(!k)return y("Asset context is unavailable."),null;_(d),y(null),w(null);try{const G=await C(Ce(k));return t(ne=>is(ne,G)),f(te(G)),Or(d)&&w(Fr(d,G)),G}catch(G){return y(ce(G,"Asset Library action failed.")),null}finally{_(null)}},[e,I]),ie=c.useCallback(async()=>{_("rescan"),y(null),w(null);try{const d=us(x,B,p);if(x==="place"&&B===null){y("No active place is connected for place-scoped assets.");return}const v=await Promise.allSettled(d.map(({request:S})=>dt(S))),C=v.flatMap(S=>S.status==="fulfilled"?[S.value]:[]),k=v.flatMap((S,T)=>S.status==="rejected"?[{label:d[T].label,reason:S.reason}]:[]);x==="all"&&B===null&&k.unshift({label:"place",reason:new Error("No active place is available")});const G=Oe(C.flatMap(S=>S.assets),p),ne=C.reduce((S,T)=>S+T.adoptedCount,0),se=C.reduce((S,T)=>S+T.skippedCount,0),u=Oe(C.flatMap(S=>S.adopted),p);t(G),n(G.length),w(`Rescan complete for ${p}: ${ne} asset(s) added, ${se} skipped. Added: ${Mr(u)}.`),y(ps("Some Asset Library rescans failed",k))}catch(d){y(ce(d,"Asset Library rescan failed."))}finally{_(null)}},[B,p,x]),Pe=c.useCallback(async(d,v)=>{_("export-selection-rbxm"),y(null),w(null);try{const C=await gt(X(d),v);return t(k=>is(k,C.asset)),f(te(C.asset)),w(`Exported Studio selection as RBXM asset: ${ge(C.asset)}${C.deduplicated?" (reused existing local asset)":""}.`),C}catch(C){return y(ce(C,"Asset Library .rbxm export failed.")),null}finally{_(null)}},[X]),we=c.useCallback((d,v)=>ae("update",d,C=>ut(C,d,v)),[ae]),fe=c.useCallback(async(d,v)=>{const C=await ae("upload",d,k=>mt(k,d,v));return C&&j(C),C},[ae,j]),be=c.useCallback(async d=>{const v=(I==null?void 0:I.id)===d?I:e.find(k=>k.id===d)??null;if(!v)return y("Asset context is unavailable."),!1;const C=te(v);M(C),_("delete"),y(null),w(null);try{return await pt(Ce(v),d),t(k=>{const G=k.filter(ne=>!xe(ne,v));return n(G.length),G}),f(k=>k===C?null:k),w(`Deleted asset: ${ge(v,d)}. Local files removed; uploaded Roblox assets were not deleted.`),!0}catch(k){return y(ce(k,"Asset Library delete failed.")),!1}finally{_(null)}},[e,M,I]),ye=c.useCallback(async(d,v)=>{const C=(I==null?void 0:I.id)===d?I:e.find(k=>k.id===d)??null;if(!C)return y("Asset context is unavailable."),null;_("import-rbxm"),y(null),w(null);try{const k=await xt(Ce(C),d,v);return f(te(C)),w(`Imported RBXM asset: ${ge(C,d)} -> ${k.importedCount} instance(s) to ${k.targetParent}.`),k}catch(k){return y(ce(k,"Asset Library .rbxm import failed.")),null}finally{_(null)}},[e,I]),je=c.useCallback(d=>ae("thumbnail-generate",d,v=>ft(v,d)),[ae]),Re=c.useCallback(d=>{const v=(I==null?void 0:I.id)===d?I:e.find(C=>C.id===d)??null;return v&&M(te(v)),ae("status-refresh",d,C=>Xe(C,d))},[e,M,ae,I]),$e=c.useCallback((d,v)=>ae("usage-scan",d,async C=>(await ht(C,d,v)).asset),[ae]),Le=c.useCallback(d=>{g(d),f(null)},[]),Te=c.useCallback(d=>{l(d),f(null)},[]),Be=c.useCallback(d=>{yt(d)&&L(d)},[]),Ue=c.useCallback(d=>{if(d===null){f(null);return}const C=e.find(k=>te(k)===d)??e.find(k=>k.id===d);f(C?te(C):d)},[e]);return{assets:e,totalCount:r,selectedAsset:I,selectedAssetId:h,selectedAssetKey:o,scope:x,categoryFilter:p,availablePlaces:V,selectedPlaceId:b,activePlaceId:B,activePlaceName:q,selectedPlaceIsConnected:O,studioConnected:K,loading:Z,busyAction:R,error:A,lastMessage:i,setScope:Le,setSelectedPlaceId:Te,setCategoryFilter:Be,selectAsset:Ue,refresh:ee,rescan:ie,exportSelectionRbxm:Pe,updateMetadata:we,uploadAsset:fe,deleteAsset:be,importRbxm:ye,generateThumbnail:je,refreshStatus:Re,scanUsage:$e}}const ks="weppy-assets-view-preferences-v1",he={organizationMode:"folders",viewMode:"grid",gridSize:"medium"};function Vr(e){return e==="folders"||e==="all-assets"}function Yr(e){return e==="grid"||e==="list"}function qr(e){return e==="small"||e==="medium"||e==="large"}function Xr(){if(typeof window>"u")return he;try{const e=window.localStorage.getItem(ks);if(!e)return he;const t=JSON.parse(e);return{organizationMode:Vr(t.organizationMode)?t.organizationMode:he.organizationMode,viewMode:Yr(t.viewMode)?t.viewMode:he.viewMode,gridSize:qr(t.gridSize)?t.gridSize:he.gridSize}}catch{return he}}function Jr(){const[e,t]=c.useState(Xr);return c.useEffect(()=>{try{window.localStorage.setItem(ks,JSON.stringify(e))}catch{}},[e]),{...e,setOrganizationMode:r=>{t(n=>({...n,organizationMode:r}))},setViewMode:r=>{t(n=>({...n,viewMode:r}))},setGridSize:r=>{t(n=>({...n,gridSize:r}))}}}function Zr(e,t){return t("assets.count.shown","Shown assets: {count}").replace("{count}",String(e))}function Qr(e,t){return e===null?null:t("assets.place.id","Place ID {placeId}").replace("{placeId}",String(e))}function co(){const{t:e}=pe(),{trackEvent:t}=$s(),{tier:r,loading:n}=Ls(),o=Wr(),f=Jr(),[x,g]=c.useState(!1),[p,L]=c.useState(!1),[V,U]=c.useState(!1),$=!n&&r==="pro",l=o.selectedAsset,b=(l==null?void 0:l.file.original.toLowerCase().endsWith(".rbxm"))??!1,N=(l==null?void 0:l.category)==="model"||(l==null?void 0:l.category)==="animation",B="game.Workspace",q=!!($&&o.studioConnected&&l&&b&&N),z=o.availablePlaces??[],O=o.selectedPlaceId??o.activePlaceId,E=o.selectedAssetKey??(l?te(l):null),K=c.useCallback(()=>{o.selectAsset(null)},[o.selectAsset]),D=c.useMemo(()=>o.scope==="shared"?[e("assets.scope.shared","Shared")]:o.scope==="all"?[e("assets.scope.all","All scopes"),o.activePlaceName??e("assets.scope.place","Current Place"),e("assets.scope.shared","Shared")]:[o.activePlaceName??e("assets.scope.place","Current Place"),Qr(o.activePlaceId,e),o.selectedPlaceIsConnected?e("assets.place.connected","Connected"):null].filter(_=>!!_),[o.activePlaceId,o.activePlaceName,o.scope,o.selectedPlaceIsConnected,e]),Z=c.useMemo(()=>ze(o.categoryFilter,e),[o.categoryFilter,e]),P=Zr(o.totalCount,e),R=e("assets.detail.importRbxm.tooltip","Insert this local RBXM asset into {target} in the connected Studio place.").replace("{target}",B);return s.jsxs("div",{className:a.page,children:[s.jsx(Us,{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:r}}),s.jsxs("div",{className:a.toolbarShell,children:[s.jsxs("div",{className:a.toolbar,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")}):z.length>0?s.jsxs("label",{className:a.placeSelectorLabel,children:[s.jsx("span",{children:e("assets.place.selector","Asset place")}),s.jsx("select",{className:a.placeSelect,value:typeof O=="number"?String(O):"",onChange:_=>{const A=Number.parseInt(_.currentTarget.value,10);Number.isInteger(A)&&o.setSelectedPlaceId(A)},children:z.map(_=>s.jsxs("option",{value:_.placeId,children:[_.placeName," (",_.placeId,")"]},_.placeId))})]}):s.jsx("span",{className:a.sharedPlaceContext,children:o.activePlaceName??e("assets.scope.place","Current Place")})}),s.jsxs("div",{className:a.listContextSummary,children:[D.map((_,A)=>s.jsxs("span",{children:[A>0?s.jsx("span",{className:a.contextDivider,children:" · "}):null,_]},`${_}-${A}`)),s.jsx("span",{className:a.contextDivider,children:" · "}),s.jsx("span",{children:Z}),s.jsx("span",{className:a.contextDivider,children:" · "}),s.jsx("strong",{children:P})]}),s.jsxs("div",{className:a.toolbarActions,children:[s.jsx(J,{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(ms,{size:15}),e("assets.rescan","Rescan")]})}),s.jsx(J,{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(_=>!_)},"aria-label":e("assets.settings.open","Open settings"),"aria-controls":"asset-library-settings-panel","aria-expanded":p,children:s.jsx(hs,{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:ys.map(_=>{const A=o.categoryFilter===_,y=ze(_,e);return s.jsx("button",{type:"button",role:"radio","aria-checked":A,className:[a.categoryButton,A?a.categoryButtonActive:""].filter(Boolean).join(" "),onClick:()=>{o.setCategoryFilter(_)},children:y},_)})})]})]}),s.jsx(Ur,{open:p,tier:r,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.")})]}),!$&&!n&&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(Qn,{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:K,onOrganizationModeChange:f.setOrganizationMode,onViewModeChange:f.setViewMode,onGridSizeChange:f.setGridSize,emptyContent:o.error?void 0:s.jsx(sr,{scope:o.scope,isPro:$,busy:o.busyAction==="rescan",onRescan:()=>{t("dashboard_click_event",{click_target:"assets_empty_rescan",page:"assets"}),o.rescan()}})}),s.jsx(xr,{asset:x||p||V?null:l,busyAction:o.busyAction,canUpload:$,canImportRbxm:q,importRbxmTooltip:R,importRbxmTargetParent:B,onClose:()=>o.selectAsset(null),onSave:async(_,A)=>{l&&await o.updateMetadata(l.id,{displayName:_,description:A})},onUpload:()=>g(!0),onDelete:()=>U(!0),onImportRbxm:async()=>{l&&(t("dashboard_click_event",{click_target:"assets_import_rbxm",page:"assets"}),await o.importRbxm(l.id,{targetParent:B}))},onRefreshStatus:async()=>{l&&await o.refreshStatus(l.id)},onScanUsage:async()=>{l&&(t("dashboard_click_event",{click_target:"assets_usage_scan",page:"assets"}),await o.scanUsage(l.id,o.activePlaceId??void 0))}}),s.jsx(gs,{open:V&&!!l,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:()=>U(!1),onConfirm:()=>{l&&(t("dashboard_click_event",{click_target:"assets_delete",page:"assets"}),o.deleteAsset(l.id).then(_=>{_&&U(!1)}))}}),s.jsx(Rr,{asset:l,open:x,canUpload:$,busyAction:o.busyAction,onClose:()=>{g(!1),o.selectAsset(null)},onBack:()=>g(!1),onOpenSettings:()=>{g(!1),L(!0)},onUpload:async _=>{if(!l)return;t("dashboard_click_event",{click_target:"assets_upload_submit",page:"assets"}),await o.uploadAsset(l.id,_)&&g(!1)}})]})}export{co as Component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._page_7mrkg_1{display:flex;flex-direction:column;gap:var(--space-page);min-height:100%;max-width:var(--content-max)}._experimentalBadge_7mrkg_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_7mrkg_23{position:relative;z-index:30;border-top:1px solid var(--border);border-bottom:1px solid var(--border);padding:12px 0}._toolbar_7mrkg_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_7mrkg_23>._segmented_7mrkg_41{grid-area:scope}._placeContextSlot_7mrkg_45{grid-area:place;min-width:0}._toolbar_7mrkg_23>._listContextSummary_7mrkg_50{grid-area:summary}._toolbar_7mrkg_23>._toolbarActions_7mrkg_54{grid-area:actions;justify-self:end}._categoryControl_7mrkg_59{grid-area:category;display:inline-flex;align-items:center;gap:8px;width:100%;min-width:0}._listContextSummary_7mrkg_50{min-width:0;overflow:hidden;color:var(--text-secondary);font-size:12px;line-height:1.4;text-overflow:ellipsis;white-space:nowrap}._listContextSummary_7mrkg_50 strong{color:var(--text-primary);font-family:var(--font-label);font-weight:600}._contextDivider_7mrkg_84{color:var(--text-muted)}._categoryControlLabel_7mrkg_88{flex:0 0 auto;color:var(--text-secondary);font-size:12px}._categoryRail_7mrkg_94{display:flex;align-items:center;gap:4px;flex-wrap:wrap;min-width:0}._categoryButton_7mrkg_102{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_7mrkg_102:hover{border-color:var(--accent);color:var(--text-primary)}._categoryButton_7mrkg_102:disabled{cursor:not-allowed;opacity:.48}._categoryButton_7mrkg_102:disabled:hover{border-color:var(--border);color:var(--text-secondary)}._categoryButtonActive_7mrkg_131{border-color:color-mix(in srgb,var(--accent) 76%,var(--border));background:var(--accent-dim);color:var(--accent)}._categoryButton_7mrkg_102:focus-visible{outline:none;box-shadow:var(--focus-ring)}._toolbarActions_7mrkg_54,._actionRow_7mrkg_143,._copyRow_7mrkg_144,._buttonRow_7mrkg_145{display:flex;align-items:center;gap:8px;flex-wrap:wrap}._segmented_7mrkg_41{display:inline-flex;min-height:32px;border:1px solid var(--border);border-radius:var(--radius-control);overflow:hidden;background:var(--bg-card)}._segmented_7mrkg_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_7mrkg_41 button:hover:not(:disabled){background:var(--accent-dim);color:var(--accent)}._segmented_7mrkg_41 button:focus-visible{outline:none;box-shadow:inset var(--focus-ring)}._segmented_7mrkg_41 button:last-child{border-right:0}._segmented_7mrkg_41 ._segmentedActive_7mrkg_187{background:var(--accent-dim);color:var(--accent)}._placeSelectorLabel_7mrkg_192{display:inline-flex;align-items:center;gap:8px;width:100%;min-width:0;color:var(--text-secondary);font-size:12px}._placeSelectorLabel_7mrkg_192 span{flex:0 0 auto}._placeSelect_7mrkg_192{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 8px;font:inherit}._sharedPlaceContext_7mrkg_218{display:inline-flex;align-items:center;min-height:32px;color:var(--text-secondary);font-size:12px}._filterLabel_7mrkg_226{display:inline-flex;align-items:center;gap:8px;color:var(--text-secondary);font-size:12px}._filterLabel_7mrkg_226 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_7mrkg_244,._primaryButton_7mrkg_245,._iconButton_7mrkg_246{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_7mrkg_244{min-height:32px;padding:6px 10px;text-decoration:none}._primaryButton_7mrkg_245{min-height:34px;padding:7px 12px;border-color:var(--accent);color:var(--accent)}._iconButton_7mrkg_246{width:32px;height:32px;padding:0}._commandButton_7mrkg_244:hover,._primaryButton_7mrkg_245:hover,._iconButton_7mrkg_246:hover{border-color:var(--accent)}._dangerButton_7mrkg_286{border-color:var(--danger-border);background:var(--danger-bg);color:var(--danger-text)}._dangerButton_7mrkg_286:hover{border-color:var(--danger);background:var(--danger-hover-bg);color:var(--danger-text)}._commandButton_7mrkg_244:focus-visible,._primaryButton_7mrkg_245:focus-visible,._iconButton_7mrkg_246:focus-visible,._placeSelect_7mrkg_192:focus-visible,._filterLabel_7mrkg_226 select:focus-visible{outline:none;box-shadow:var(--focus-ring)}._iconButtonActive_7mrkg_307{border-color:var(--accent);background:var(--accent-dim);color:var(--accent)}._commandButton_7mrkg_244:disabled,._primaryButton_7mrkg_245:disabled,._iconButton_7mrkg_246:disabled{cursor:not-allowed;opacity:.5}._grid_7mrkg_320{--asset-card-min: 190px;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--asset-card-min)),1fr));gap:12px}._grid_7mrkg_320[data-grid-size=small],._folderGrid_7mrkg_328[data-grid-size=small]{--asset-card-min: 144px}._grid_7mrkg_320[data-grid-size=large],._folderGrid_7mrkg_328[data-grid-size=large]{--asset-card-min: 260px}._explorer_7mrkg_337{display:flex;min-width:0;flex-direction:column;gap:14px}._explorerToolbar_7mrkg_344{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_7mrkg_354{min-width:0}._explorerLocation_7mrkg_354 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_7mrkg_354 h2:focus-visible{outline:none;box-shadow:var(--focus-ring)}._explorerLocation_7mrkg_354 p{margin:0;color:var(--text-muted);font-size:var(--type-control-size);line-height:var(--leading-body)}._breadcrumb_7mrkg_380,._breadcrumbSegment_7mrkg_381{display:inline-flex;min-width:0;align-items:center;gap:2px;color:var(--text-muted);font-size:12px}._breadcrumb_7mrkg_380{max-width:100%;flex-wrap:wrap}._breadcrumb_7mrkg_380 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_7mrkg_380 button:hover{background:var(--accent-dim);color:var(--accent)}._breadcrumb_7mrkg_380 button:focus-visible{outline:none;box-shadow:var(--focus-ring)}._breadcrumb_7mrkg_380 [aria-current=page]{min-width:0;overflow-wrap:anywhere;color:var(--text-primary);padding:0 5px}._viewOptions_7mrkg_424{display:flex;flex:0 0 auto;align-items:center;gap:8px;min-height:44px}._organizationModeControl_7mrkg_432,._viewModeControl_7mrkg_433,._gridSizeControl_7mrkg_434{display:inline-flex;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card)}._organizationModeControl_7mrkg_432 button,._viewModeControl_7mrkg_433 button,._gridSizeControl_7mrkg_434 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_7mrkg_432 button:last-child,._viewModeControl_7mrkg_433 button:last-child,._gridSizeControl_7mrkg_434 button:last-child{border-right:0}._organizationModeControl_7mrkg_432 button[aria-pressed=true],._viewModeControl_7mrkg_433 button[aria-pressed=true],._gridSizeControl_7mrkg_434 button[aria-pressed=true]{background:var(--accent-dim);color:var(--accent)}._organizationModeControl_7mrkg_432 button:focus-visible,._viewModeControl_7mrkg_433 button:focus-visible,._gridSizeControl_7mrkg_434 button:focus-visible{z-index:1;outline:none;box-shadow:inset var(--focus-ring)}._gridSizeControl_7mrkg_434 button:disabled{cursor:not-allowed;opacity:.42}._explorerSection_7mrkg_487{display:flex;min-width:0;flex-direction:column;gap:8px}._explorerSection_7mrkg_487 h3{margin:0;color:var(--text-secondary);font-family:var(--font-label);font-size:12px;font-weight:600;letter-spacing:0}._folderGrid_7mrkg_328{--asset-card-min: 190px;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,var(--asset-card-min)),1fr));gap:12px}._folderTile_7mrkg_510{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_7mrkg_510:hover{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 6%,var(--bg-card));transform:translateY(-1px)}._folderTile_7mrkg_510:focus-visible,._folderListRow_7mrkg_535:focus-visible,._assetListRow_7mrkg_536:focus-visible,._assetCard_7mrkg_537:focus-visible{outline:none;box-shadow:var(--focus-ring)}._folderIcon_7mrkg_542{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_7mrkg_554{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_7mrkg_566{align-self:start;color:var(--text-muted);font-size:12px}._assetList_7mrkg_536,._folderList_7mrkg_535{display:flex;min-width:0;flex-direction:column;gap:4px}._assetListHeader_7mrkg_580,._assetListRow_7mrkg_536,._folderListRow_7mrkg_535{display:grid;min-width:0;grid-template-columns:44px minmax(160px,1fr) 110px 120px 110px 110px;align-items:center;gap:10px}._assetListHeader_7mrkg_580{min-height:28px;border-bottom:1px solid var(--border);color:var(--text-muted);padding:0 10px 5px;font-size:11px}._assetListRow_7mrkg_536,._folderListRow_7mrkg_535{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_7mrkg_536:hover,._folderListRow_7mrkg_535:hover{border-color:var(--accent);background:color-mix(in srgb,var(--accent) 5%,var(--bg-card))}._listPreviewWrap_7mrkg_617,._listPreview_7mrkg_617,._listPreviewFallback_7mrkg_619{width:36px;height:36px;border-radius:6px}._listPreviewWrap_7mrkg_617{display:grid;overflow:hidden;place-items:center;background:var(--bg-secondary)}._listPreview_7mrkg_617{object-fit:contain}._listPreviewFallback_7mrkg_619{display:grid;place-items:center;color:var(--text-secondary)}._folderListRow_7mrkg_535 ._folderIcon_7mrkg_542{grid-row:auto;width:36px;height:36px}._listAssetName_7mrkg_648,._folderListRow_7mrkg_535 ._folderName_7mrkg_554{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_7mrkg_660,._listAssetScope_7mrkg_661,._listAssetUpdated_7mrkg_662,._folderType_7mrkg_663,._folderScope_7mrkg_664,._folderStatus_7mrkg_665,._folderUpdated_7mrkg_666{min-width:0;overflow:hidden;color:var(--text-muted);font-size:12px;text-overflow:ellipsis;white-space:nowrap}._assetCard_7mrkg_537{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_7mrkg_537:hover{border-color:var(--accent);transform:translateY(-1px)}._assetCardSelected_7mrkg_695{border-color:var(--accent);box-shadow:0 0 0 1px color-mix(in srgb,var(--accent) 40%,transparent)}._thumbnailWrap_7mrkg_700{display:grid;place-items:center;width:100%;aspect-ratio:1;overflow:hidden;border-radius:6px;background:var(--bg-secondary)}._thumbnail_7mrkg_700{width:100%;height:100%;object-fit:contain}._thumbnailFallback_7mrkg_716{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_7mrkg_727{display:flex;flex-direction:column;gap:6px;min-width:0}._assetName_7mrkg_734{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--font-label);font-size:13px}._assetMeta_7mrkg_742{display:flex;align-items:center;justify-content:space-between;gap:8px}._statusChip_7mrkg_749,._categoryPill_7mrkg_750{min-height:20px;padding:2px 7px}._assetId_7mrkg_755,._scopeText_7mrkg_756,._muted_7mrkg_757{color:var(--text-muted);font-size:12px}._emptyState_7mrkg_762,._notice_7mrkg_763,._errorState_7mrkg_764,._messageState_7mrkg_765{border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);padding:14px;color:var(--text-secondary)}._emptyState_7mrkg_762{min-height:160px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-align:center}._emptyState_7mrkg_762 p{margin:0;color:var(--text-primary);font-family:var(--font-label)}._emptyGuide_7mrkg_789{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_7mrkg_799,._emptyGuideMethod_7mrkg_800{display:flex;flex-direction:column;gap:var(--space-related)}._emptyGuideHeader_7mrkg_799 h3,._emptyGuideHeader_7mrkg_799 p,._emptyGuideMethod_7mrkg_800 h4,._emptyGuideMethod_7mrkg_800 p{margin:0}._emptyGuideHeader_7mrkg_799 h3{color:var(--text-primary);font-family:var(--font-label);font-size:var(--type-section-title-size);font-weight:600}._emptyGuideHeader_7mrkg_799 p,._emptyGuideMethod_7mrkg_800 p,._emptyGuideSteps_7mrkg_822{color:var(--text-secondary);font-size:var(--type-body-size);line-height:var(--leading-body)}._emptyGuideMethods_7mrkg_828{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--space-section)}._emptyGuideMethod_7mrkg_800{min-width:0;padding:14px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary)}._emptyGuideMethodTitle_7mrkg_842{display:flex;align-items:center;gap:var(--space-related);color:var(--text-primary)}._emptyGuideMethodTitle_7mrkg_842 h4{font-family:var(--font-label);font-size:var(--type-card-title-size);font-weight:600}._emptyGuideSteps_7mrkg_822{margin:0;padding-left:20px}._emptyGuideTierNote_7mrkg_860{color:var(--pro-text)!important;font-size:var(--type-control-size)!important}._emptyGuideMethodHelp_7mrkg_865,._emptyGuideCapabilityDescription_7mrkg_866{color:var(--text-secondary)!important;font-size:var(--type-body-size);line-height:var(--leading-body)}._emptyGuideChoices_7mrkg_872{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--space-related)}._emptyGuideChoice_7mrkg_872{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_7mrkg_872:hover{border-color:var(--border-highlight);background:var(--accent-dim)}._emptyGuideChoiceSelected_7mrkg_900{border-color:var(--accent);background:var(--accent-dim)}._emptyGuideChoice_7mrkg_872:focus-visible{outline:none;box-shadow:var(--focus-ring)}._emptyGuideChoiceLabel_7mrkg_910{font-family:var(--font-label);font-size:var(--type-control-size);font-weight:600}._emptyGuideCapability_7mrkg_866{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_7mrkg_926{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_7mrkg_926:focus-visible{outline:none;box-shadow:var(--focus-ring)}._emptyGuideAction_7mrkg_926:disabled{cursor:wait;opacity:.65}._notice_7mrkg_763{color:var(--warning-text);border-color:var(--warning-border);background:var(--warning-bg)}._proNotice_7mrkg_956{color:var(--pro-text);border-color:var(--pro-border);background:var(--pro-bg-soft)}._errorState_7mrkg_764{display:grid;gap:4px;color:var(--error);border-color:var(--error)}._messageState_7mrkg_765{color:var(--success);border-color:var(--success)}._rbxmGuide_7mrkg_974{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_7mrkg_974 h2{margin:0;color:var(--text-primary);font-family:var(--font-label);font-size:14px;letter-spacing:0}._rbxmGuide_7mrkg_974 p{margin:0;max-width:760px;color:var(--text-secondary);font-size:12px;line-height:1.5}._drawer_7mrkg_1000{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_7mrkg_1014{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_7mrkg_1 .12s ease-out;transform-origin:top right}._settingsDrawer_7mrkg_1034{width:min(560px,100%)}@keyframes _settingsPopoverIn_7mrkg_1{0%{opacity:0;transform:translateY(-4px) scale(.99)}to{opacity:1;transform:translateY(0) scale(1)}}._detailPopupLayer_7mrkg_1050{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_7mrkg_1066{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_7mrkg_1066:focus{outline:none}._detailDialogHeader_7mrkg_1083{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_7mrkg_1094{min-width:0;display:flex;flex-direction:column;gap:3px}._detailTitleBlock_7mrkg_1094 h2{margin:0;font-size:var(--type-surface-title-size);letter-spacing:0}._detailTitleBlock_7mrkg_1094 span:last-child{overflow:hidden;color:var(--text-muted);font-family:var(--font-code);font-size:12px;text-overflow:ellipsis;white-space:nowrap}._detailEyebrow_7mrkg_1116{color:var(--text-muted);font-family:var(--font-label);font-size:11px;font-weight:600;letter-spacing:0;text-transform:uppercase}._detailHeaderActions_7mrkg_1125{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0}._detailDialogBody_7mrkg_1133{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:minmax(260px,.9fr) minmax(360px,1.1fr);gap:0;overflow:hidden}._detailPreviewPane_7mrkg_1142{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_7mrkg_1142,._detailPreviewFallback_7mrkg_1154{width:100%;max-width:520px;aspect-ratio:1;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card)}._detailPreview_7mrkg_1142{display:block;object-fit:contain}._detailPreviewFallback_7mrkg_1154{display:grid;place-items:center;gap:8px;color:var(--text-secondary)}._detailPreviewFallback_7mrkg_1154 code{color:var(--text-muted);font-family:var(--font-code);font-size:12px}._detailPreviewFallback_7mrkg_1154 small{max-width:88%;color:var(--text-muted);font-size:12px;line-height:1.35;overflow-wrap:anywhere;text-align:center}._detailContentPane_7mrkg_1190{min-width:0;overflow-y:auto;padding:18px 22px 24px}._detailContentPane_7mrkg_1190 ._formStack_7mrkg_1196{margin-top:0}._drawerHeader_7mrkg_1200{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}._settingsInlinePanel_7mrkg_1014 ._drawerHeader_7mrkg_1200{margin-bottom:0}._drawerHeader_7mrkg_1200 h2{margin:0;font-size:var(--type-surface-title-size);letter-spacing:0}._drawerHeader_7mrkg_1200 span{color:var(--text-muted);font-size:12px}._preview_7mrkg_1223,._previewFallback_7mrkg_1224{width:100%;aspect-ratio:1;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-secondary);margin-bottom:14px}._preview_7mrkg_1223{object-fit:contain}._previewFallback_7mrkg_1224{display:grid;place-items:center;gap:8px;color:var(--text-secondary)}._previewFallback_7mrkg_1224 code{color:var(--text-muted);font-family:var(--font-code);font-size:12px}._formStack_7mrkg_1196,._detailSection_7mrkg_1251,._noticeList_7mrkg_1252,._settingsPanel_7mrkg_1253{display:flex;flex-direction:column;gap:10px;margin-top:14px}._noticeList_7mrkg_1252{color:var(--text-muted);font-size:12px;line-height:1.45}._noticeList_7mrkg_1252 p{margin:0}._setupNotice_7mrkg_1270{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_7mrkg_1270 strong{color:var(--text-primary);font-size:13px}._setupNotice_7mrkg_1270 p{margin:0}._setupNotice_7mrkg_1270 ._commandButton_7mrkg_244{justify-self:start}._field_7mrkg_1295{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--text-secondary)}._fieldLabelRow_7mrkg_1303{display:flex;align-items:center;gap:4px;min-height:24px}._fieldLabelRow_7mrkg_1303 label,._fieldLabelRow_7mrkg_1303 span{min-width:0}._field_7mrkg_1295 input,._field_7mrkg_1295 textarea,._field_7mrkg_1295 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_7mrkg_1327{color:var(--text-muted);line-height:1.35}._twoColumn_7mrkg_1332{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}._detailSection_7mrkg_1251{padding-top:12px;border-top:1px solid var(--border)}._technicalDetails_7mrkg_1343{margin-top:14px;padding-top:12px;border-top:1px solid var(--border)}._technicalDetails_7mrkg_1343 summary{cursor:pointer;color:var(--text-secondary);font-size:13px;font-weight:600}._technicalDetails_7mrkg_1343 summary:hover{color:var(--text-primary)}._technicalDetails_7mrkg_1343 ._detailGrid_7mrkg_1360,._technicalDetails_7mrkg_1343 ._metadataList_7mrkg_1361{margin-top:10px}._detailSection_7mrkg_1251 h3{margin:0;font-size:13px;letter-spacing:0}._detailGrid_7mrkg_1360,._compactMeta_7mrkg_1372{display:grid;grid-template-columns:90px minmax(0,1fr);gap:6px 10px;margin:0;font-size:12px}._compactMeta_7mrkg_1372{border:1px solid var(--border);border-radius:var(--radius);padding:10px;background:var(--bg-card)}._detailGrid_7mrkg_1360 dt,._compactMeta_7mrkg_1372 dt{color:var(--text-muted)}._detailGrid_7mrkg_1360 dd,._compactMeta_7mrkg_1372 dd{margin:0;min-width:0;overflow-wrap:anywhere}._copyableValue_7mrkg_1399{display:inline-flex;align-items:center;gap:6px}._copyableValue_7mrkg_1399 span{min-width:0;overflow-wrap:anywhere}._inlineCopyButton_7mrkg_1410{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_7mrkg_1410:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-dim)}._hashText_7mrkg_1431{font-family:var(--font-code)}._usageList_7mrkg_1435{display:flex;flex-direction:column;gap:8px}._usageItem_7mrkg_1441,._metadataItem_7mrkg_1442{display:grid;gap:4px;border:1px solid var(--border);border-radius:6px;padding:8px;background:var(--bg-card);font-size:12px}._metadataList_7mrkg_1361{display:flex;flex-direction:column;gap:8px}._metadataList_7mrkg_1361 strong,._usageItem_7mrkg_1441 strong{color:var(--text-primary);overflow-wrap:anywhere}._metadataItem_7mrkg_1442 span{color:var(--text-secondary);overflow-wrap:anywhere}._metadataItem_7mrkg_1442 code,._usageItem_7mrkg_1441 code{color:var(--accent);overflow-wrap:anywhere}._settingsPanel_7mrkg_1253{border:1px solid var(--border);border-radius:8px;padding:12px;background:var(--bg-card)}._settingsInlinePanel_7mrkg_1014 ._settingsPanel_7mrkg_1253{border:0;border-radius:0;background:transparent;padding:0;margin-top:0}._settingsSubsection_7mrkg_1490{display:grid;gap:8px}._settingsSectionHeader_7mrkg_1495{display:flex;align-items:center;justify-content:space-between;gap:10px}._settingsSectionHeader_7mrkg_1495 h3{margin:0;color:var(--text-primary);font-size:13px}._settingsDefinitionList_7mrkg_1508{display:grid;gap:6px;margin:0}._settingsDefinitionList_7mrkg_1508 div{display:grid;grid-template-columns:minmax(96px,max-content) minmax(0,1fr);gap:10px}._settingsDefinitionList_7mrkg_1508 dt{color:var(--text-muted)}._settingsDefinitionList_7mrkg_1508 dd{margin:0;color:var(--text-primary);overflow-wrap:anywhere}._toggleRow_7mrkg_1530{display:flex;align-items:center;justify-content:space-between;gap:16px;font-size:13px}._toggleRow_7mrkg_1530 span{display:grid;gap:3px}._toggleRow_7mrkg_1530 small,._inlineHelp_7mrkg_1544{color:var(--text-muted);font-size:12px}._toggleRow_7mrkg_1530 input{width:18px;height:18px}._inlineHelp_7mrkg_1544{margin:0}._inlineHelp_7mrkg_1544 a{color:var(--accent)}@media(max-width:1120px){._detailPopupLayer_7mrkg_1050{right:16px;bottom:16px;left:calc(var(--sidebar-width) + 16px);padding:12px}._detailDialogBody_7mrkg_1133{grid-template-columns:minmax(240px,.8fr) minmax(320px,1.2fr)}}@media(max-width:820px){._detailPopupLayer_7mrkg_1050{top:calc(var(--header-height) + 10px);right:10px;bottom:10px;left:calc(var(--sidebar-collapsed) + 10px);padding:8px}._detailDialogHeader_7mrkg_1083{grid-template-columns:minmax(0,1fr);align-items:stretch;gap:10px;padding:12px}._detailHeaderActions_7mrkg_1125{justify-content:flex-start;overflow-x:auto;padding-bottom:2px}._detailDialogBody_7mrkg_1133{grid-template-columns:minmax(0,1fr);overflow-y:auto}._detailPreviewPane_7mrkg_1142{min-height:auto;padding:14px;border-right:0;border-bottom:1px solid var(--border)}._detailPreview_7mrkg_1142,._detailPreviewFallback_7mrkg_1154{max-width:340px}._detailContentPane_7mrkg_1190{overflow:visible;padding:14px}}@media(max-width:720px){._headerRow_7mrkg_1621{align-items:stretch;flex-direction:column}._toolbar_7mrkg_23{grid-template-columns:minmax(0,1fr);grid-template-areas:"scope" "place" "summary" "actions" "category";align-items:stretch}._toolbar_7mrkg_23>._segmented_7mrkg_41,._placeContextSlot_7mrkg_45,._toolbar_7mrkg_23>._toolbarActions_7mrkg_54,._categoryControl_7mrkg_59{width:100%}._toolbar_7mrkg_23>._toolbarActions_7mrkg_54{justify-self:stretch}._headerMeta_7mrkg_1648{justify-items:start}._toolbarActions_7mrkg_54{justify-content:flex-start}._explorerToolbar_7mrkg_344{align-items:stretch;flex-direction:column}._viewOptions_7mrkg_424{width:100%;align-items:stretch;flex-direction:column}._organizationModeControl_7mrkg_432,._viewModeControl_7mrkg_433,._gridSizeControl_7mrkg_434{display:grid;width:100%;grid-template-columns:repeat(2,minmax(0,1fr))}._gridSizeControl_7mrkg_434{grid-template-columns:repeat(3,minmax(0,1fr))}._organizationModeControl_7mrkg_432 button,._viewModeControl_7mrkg_433 button,._gridSizeControl_7mrkg_434 button{min-width:0}._assetListHeader_7mrkg_580{display:none}._assetListRow_7mrkg_536,._folderListRow_7mrkg_535{grid-template-columns:40px minmax(0,1fr) auto;grid-template-areas:"preview name status" "preview type type" "preview scope updated";gap:3px 8px}._listPreviewWrap_7mrkg_617,._folderListRow_7mrkg_535 ._folderIcon_7mrkg_542{grid-area:preview}._listAssetName_7mrkg_648,._folderListRow_7mrkg_535 ._folderName_7mrkg_554{grid-area:name}._listAssetCategory_7mrkg_660,._folderType_7mrkg_663{grid-area:type}._listAssetScope_7mrkg_661,._folderScope_7mrkg_664{grid-area:scope}._assetListRow_7mrkg_536 ._statusChip_7mrkg_749,._folderStatus_7mrkg_665{grid-area:status;justify-self:end}._listAssetUpdated_7mrkg_662,._folderUpdated_7mrkg_666{grid-area:updated;justify-self:end}._placeSelectorLabel_7mrkg_192,._placeSelect_7mrkg_192{width:100%}._settingsInlinePanel_7mrkg_1014{right:auto;left:0;width:100%;transform-origin:top left}._twoColumn_7mrkg_1332{grid-template-columns:1fr}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,b as P,D as Q,u as q,j as e,X as W,a as X,o as Y,c as J,e as ee,i as te,T as ae}from"./index-89-Xnii6.js";import{B as ne,P as se}from"./PageHeader-B42Je0MJ.js";import{C as ie}from"./ConfirmModal-CQhMb2gs.js";import{C as ce}from"./CurrentPlaceScope-B60o8hpn.js";import{T as O}from"./TooltipText-EK4_jbu2.js";import{C as oe,T as re}from"./Tabs-Dos9flTe.js";import{I as le}from"./InfoLabel-csGVLmJ3.js";import{G as de}from"./GameChangeDetail-B5X_6M-R.js";import"./ConfirmModal.module-DJksQHBd.js";const ge=10;function me(t,i){return typeof i!="number"?t:`${t}?placeId=${encodeURIComponent(String(i))}`}function he(t){const i=(t==null?void 0:t.placeId)??null,[m,c]=o.useState([]),[n,s]=o.useState(0),[u,p]=o.useState(!1),[r,T]=o.useState(!0),[C,E]=o.useState(0),[f,z]=o.useState("all"),B=o.useRef(null),S=o.useCallback(async(y,v)=>{T(!0);try{const k={limit:String(ge),offset:String(y)};v!=="all"&&(k.status=v),typeof i=="number"&&(k.placeId=String(i));const w=await P.get("/api/dashboard/changelog",k);c(w.entries),s(w.total),p(w.hasMore)}catch{c([]),s(0),p(!1)}finally{T(!1)}},[i]),I=o.useCallback(()=>{S(C,f)},[S,C,f]),$=o.useCallback(async()=>{await P.post(me("/api/dashboard/changelog/clear",i)),c([]),s(0),p(!1)},[i]);return o.useEffect(()=>{S(C,f)},[S,C,f]),o.useEffect(()=>{const y=new Q;B.current=y,y.connect();const v=y.on("command",()=>{S(C,f)});return()=>{v(),y.disconnect(),B.current=null}},[S,C,f]),{entries:m,total:n,hasMore:u,loading:r,offset:C,statusFilter:f,setOffset:E,setStatusFilter:z,refresh:I,clear:$}}const ue="_card_qniob_2",pe="_header_qniob_27",fe="_statusBadge_qniob_34",ye="_statusDot_qniob_45",xe="_active_qniob_51",_e="_completed_qniob_60",be="_timeRange_qniob_68",Ce="_summaryList_qniob_75",Se="_summaryItem_qniob_81",ve="_summaryIcon_qniob_90",je="_summaryText_qniob_96",Ne="_progressBar_qniob_101",Te="_progressFill_qniob_110",Ie="_emptySummary_qniob_124",ke="_contextBlock_qniob_132",we="_contextLabel_qniob_141",$e="_contextValue_qniob_149",h={card:ue,header:pe,statusBadge:fe,statusDot:ye,active:xe,completed:_e,timeRange:be,summaryList:Ce,summaryItem:Se,summaryIcon:ve,summaryText:je,progressBar:Ne,progressFill:Te,emptySummary:Ie,contextBlock:ke,contextLabel:we,contextValue:$e};function H(t){if(!t)return"--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function Be({entry:t,onClick:i,buttonRef:m}){var v,k,w,L,A,R,d,_,D,M;const{t:c}=q(),n=t.changeSummary,s=t.status==="active",u=t.isBootstrapOnly===!0,p=[],r=n.scriptsModified+n.scriptsCreated;if(r>0){const g=[];n.scriptsModified>0&&g.push(`${n.scriptsModified} ${c("changelog.card.modified","modified")}`),n.scriptsCreated>0&&g.push(`${n.scriptsCreated} ${c("changelog.card.created","created")}`);const x=`${r} ${c("changelog.card.scripts","scripts")} ${g.join(", ")}`;p.push({icon:"📝",text:x,tooltip:c("changelog.card.scripts.tooltip","Script changes made in this session.")})}const T=n.instancesCreated+n.instancesDeleted+n.instancesMoved;if(T>0){const g=[];n.instancesCreated>0&&g.push(`${n.instancesCreated} ${c("changelog.card.created","created")}`),n.instancesDeleted>0&&g.push(`${n.instancesDeleted} ${c("changelog.card.deleted","deleted")}`),n.instancesMoved>0&&g.push(`${n.instancesMoved} ${c("changelog.card.moved","moved")}`);const x=`${T} ${c("changelog.card.instances","instances")} ${g.join(", ")}`;p.push({icon:"🧱",text:x,tooltip:c("changelog.card.instances.tooltip","Instance create, delete, move, or clone changes in this session.")})}n.propertiesChanged>0&&p.push({icon:"🎨",text:`${n.propertiesChanged} ${c("changelog.card.propertiesChanged","properties changed")}`,tooltip:c("changelog.card.propertiesChanged.tooltip","Property value changes recorded for this session.")}),n.lightingChanged&&p.push({icon:"🌅",text:c("changelog.card.lightingConfigured","Lighting configured"),tooltip:c("changelog.card.lightingConfigured.tooltip","Lighting or atmosphere settings changed in this session.")}),n.terrainChanged&&p.push({icon:"⛰️",text:c("changelog.card.terrainConfigured","Terrain configured"),tooltip:c("changelog.card.terrainConfigured.tooltip","Terrain data or terrain settings changed in this session.")}),n.assetsInserted>0&&p.push({icon:"📦",text:`${n.assetsInserted} ${c("changelog.card.assetsInserted","assets inserted")}`,tooltip:c("changelog.card.assetsInserted.tooltip","Assets inserted into the place during this session.")});const C=H(t.startTime),E=s?c("changelog.card.inProgress","in progress"):t.endTime?H(t.endTime):"--:--",f=u?c("changelog.card.bootstrapStatus","Bootstrap"):s?c("changelog.card.active","Active"):c("changelog.card.completed","Completed"),z=u?c("changelog.card.bootstrapStatus.tooltip","This session only contains the initial sync bootstrap snapshot."):s?c("changelog.card.active.tooltip","This session is still receiving new game changes."):c("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),B=u?c("changelog.card.bootstrapSummary","Initial sync snapshot"):c("changelog.card.noChanges","No changes yet"),S=u?c("changelog.card.bootstrapSummary.tooltip","Initial file sync writes are collapsed into a single bootstrap snapshot row."):c("changelog.card.noChanges.tooltip","No game changes have been extracted for this session yet."),I=(k=(v=t.contextSummary)==null?void 0:v.intent)==null?void 0:k.trim(),$=((R=(A=(L=(w=t.contextSummary)==null?void 0:w.affectedAreas)==null?void 0:L[0])==null?void 0:A.label)==null?void 0:R.trim())||((_=(d=t.contextSummary)==null?void 0:d.testScenario)==null?void 0:_.trim()),y=(M=(D=t.verificationSummary)==null?void 0:D.label)==null?void 0:M.trim();return e.jsxs("button",{ref:m,className:h.card,type:"button",onClick:g=>i(g.currentTarget),children:[e.jsxs("span",{className:h.header,children:[e.jsx(O,{text:z,children:e.jsxs("span",{className:`${h.statusBadge} ${s?h.active:h.completed}`,children:[e.jsx("span",{className:h.statusDot}),f]})}),e.jsxs("span",{className:h.timeRange,children:[C,"~",E]})]}),e.jsx("span",{className:h.summaryList,children:p.length>0?p.map((g,x)=>e.jsxs("span",{className:h.summaryItem,children:[e.jsx("span",{className:h.summaryIcon,children:g.icon}),e.jsx(O,{text:g.tooltip,children:e.jsx("span",{className:h.summaryText,children:g.text})})]},x)):e.jsx(O,{text:S,children:e.jsx("span",{className:h.emptySummary,style:{display:"block"},children:B})})}),I&&e.jsxs("span",{className:h.contextBlock,children:[e.jsx("span",{className:h.contextLabel,children:c("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:h.contextValue,children:I})]}),!I&&$&&e.jsxs("span",{className:h.contextBlock,children:[e.jsx("span",{className:h.contextLabel,children:c("changelog.card.representativeArea","Representative area")}),e.jsx("span",{className:h.contextValue,children:$})]}),y&&e.jsxs("span",{className:h.contextBlock,children:[e.jsx("span",{className:h.contextLabel,children:c("changelog.card.verification","Verification")}),e.jsx("span",{className:h.contextValue,children:y})]}),s&&e.jsx("span",{className:h.progressBar,children:e.jsx("span",{className:h.progressFill})})]})}function ze(t){const i={scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0};for(const m of t)switch(m.category){case"script":m.changeType==="create"?i.scriptsCreated++:i.scriptsModified++;break;case"instance":m.changeType==="create"?i.instancesCreated++:m.changeType==="delete"?i.instancesDeleted++:m.changeType==="move"&&i.instancesMoved++;break;case"property":i.propertiesChanged++;break;case"lighting":i.lightingChanged=!0;break;case"terrain":i.terrainChanged=!0;break;case"asset":i.assetsInserted++;break}return i}function Ee(t){if(typeof t=="number")return{placeId:String(t)}}function Le(t,i){const[m,c]=o.useState(""),[n,s]=o.useState(""),[u,p]=o.useState(),[r,T]=o.useState("completed"),[C,E]=o.useState([]),[f,z]=o.useState([]),[B,S]=o.useState([]),[I,$]=o.useState(),[y,v]=o.useState(),[k,w]=o.useState(),[L,A]=o.useState({scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0}),[R,d]=o.useState(!0),[_,D]=o.useState(null),M=o.useCallback(async()=>{if(t){d(!0),D(null);try{const g=Ee(i),[x,G]=await Promise.all([g?P.get(`/api/dashboard/changelog/${t}`,g):P.get(`/api/dashboard/changelog/${t}`),g?P.get(`/api/dashboard/changelog/${t}/changes`,g):P.get(`/api/dashboard/changelog/${t}/changes`)]);c(x.entryId),s(x.startTime),p(x.endTime),T(x.status),E(x.entries),z(x.failures),$(x.contextSummary),v(x.replayMetadata),w(x.verificationSummary),S(G.changes),A(ze(G.changes))}catch(g){D(g instanceof Error?g.message:"Failed to load changelog detail")}finally{d(!1)}}},[t,i]);return o.useEffect(()=>{M()},[M]),{entryId:m,startTime:n,endTime:u,status:r,entries:C,failures:f,changes:B,changeSummary:L,contextSummary:I,replayMetadata:y,verificationSummary:k,loading:R,error:_,refresh:M}}const Ae={script:"📝",instance:"🧱",property:"🎨",lighting:"🌅",terrain:"⛰️",asset:"📦"};function Re(t){return Ae[t]??"❓"}const Me="_dialogContent_197zf_2",Oe="_dialogHeader_197zf_10",De="_dialogTitleGroup_197zf_20",Fe="_dialogTitle_197zf_20",Pe="_dialogMeta_197zf_36",Ge="_dialogClose_197zf_43",Ke="_dialogBody_197zf_68",Ve="_page_197zf_77",qe="_headerTime_197zf_84",Ue="_dialogActions_197zf_90",He="_retryButton_197zf_96",Ze="_statusActive_197zf_129",Qe="_statusCompleted_197zf_134",We="_section_197zf_139",Xe="_sectionTitle_197zf_146",Ye="_summaryGrid_197zf_159",Je="_summaryCard_197zf_165",et="_summaryCardActive_197zf_188",tt="_summaryIcon_197zf_193",at="_summaryCount_197zf_199",nt="_summaryLabel_197zf_207",st="_contextGrid_197zf_217",it="_contextRow_197zf_223",ct="_contextKey_197zf_229",ot="_contextValue_197zf_237",rt="_timelineFilter_197zf_245",lt="_filterLabel_197zf_253",dt="_filterSelect_197zf_259",gt="_ownershipToggle_197zf_269",mt="_timeline_197zf_245",ht="_timelineEntry_197zf_297",ut="_timelineTime_197zf_326",pt="_timelineIcon_197zf_334",ft="_timelineBody_197zf_339",yt="_timelineSummary_197zf_345",xt="_timelineTarget_197zf_353",_t="_timelineConfidence_197zf_361",bt="_ownershipBadge_197zf_370",Ct="_confidenceExact_197zf_378",St="_confidencePartial_197zf_383",vt="_confidenceAfterOnly_197zf_388",jt="_confidenceIntentOnly_197zf_393",Nt="_confidenceUnknown_197zf_398",Tt="_timelineExpanded_197zf_404",It="_empty_197zf_413",kt="_loading_197zf_422",wt="_error_197zf_431",a={dialogContent:Me,dialogHeader:Oe,dialogTitleGroup:De,dialogTitle:Fe,dialogMeta:Pe,dialogClose:Ge,dialogBody:Ke,page:Ve,headerTime:qe,dialogActions:Ue,retryButton:He,statusActive:Ze,statusCompleted:Qe,section:We,sectionTitle:Xe,summaryGrid:Ye,summaryCard:Je,summaryCardActive:et,summaryIcon:tt,summaryCount:at,summaryLabel:nt,contextGrid:st,contextRow:it,contextKey:ct,contextValue:ot,timelineFilter:rt,filterLabel:lt,filterSelect:dt,ownershipToggle:gt,timeline:mt,timelineEntry:ht,timelineTime:ut,timelineIcon:pt,timelineBody:ft,timelineSummary:yt,timelineTarget:xt,timelineConfidence:_t,ownershipBadge:bt,confidenceExact:Ct,confidencePartial:St,confidenceAfterOnly:vt,confidenceIntentOnly:jt,confidenceUnknown:Nt,timelineExpanded:Tt,empty:It,loading:kt,error:wt},Z=[{key:"script",icon:"📝",labelKey:"changelog.category.script"},{key:"instance",icon:"🧱",labelKey:"changelog.category.instance"},{key:"property",icon:"🎨",labelKey:"changelog.category.property"},{key:"lighting",icon:"🌅",labelKey:"changelog.category.lighting"},{key:"terrain",icon:"⛰️",labelKey:"changelog.category.terrain"},{key:"asset",icon:"📦",labelKey:"changelog.category.asset"}];function V(t){if(!t)return"--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function $t(t){if(!t)return"--:--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}`}function Bt(t,i){if(!t||!i)return"";const m=new Date(i).getTime()-new Date(t).getTime();return m<0?"":`${Math.round(m/6e4)}min`}function zt(t){switch(t){case"exact":return a.confidenceExact;case"partial":return a.confidencePartial;case"after-only":return a.confidenceAfterOnly;case"intent-only":return a.confidenceIntentOnly;default:return a.confidenceUnknown}}function Et(t,i){switch(i){case"exact":return t("changelog.detail.confidence.exact","Exact");case"partial":return t("changelog.detail.confidence.partial","Partial");case"after-only":return t("changelog.detail.confidence.afterOnly","After only");case"intent-only":return t("changelog.detail.confidence.intentOnly","Intent only");default:return t("changelog.detail.confidence.unknown","Unknown")}}function Lt(t,i){switch(i){case"exact":return t("changelog.detail.confidence.exact.tooltip","Both the before and after state were confirmed for this change.");case"partial":return t("changelog.detail.confidence.partial.tooltip","Only part of the before and after state could be confirmed for this change.");case"after-only":return t("changelog.detail.confidence.afterOnly.tooltip","Only the resulting state after the change could be confirmed.");case"intent-only":return t("changelog.detail.confidence.intentOnly.tooltip","Only the requested action was recorded, not the resulting state.");default:return t("changelog.detail.confidence.unknown.tooltip","This change could not be confidently classified from the available data.")}}function At(t,i){switch(i){case"user_source":return t("changelog.ownership.userSource","User source");case"canonical_mirror":return t("changelog.ownership.canonicalMirror","Mirror metadata");case"generated":return t("changelog.ownership.generated","Generated");default:return null}}function Rt({entryId:t,placeId:i,onClose:m,returnFocusTo:c=null}){var v,k,w,L,A,R,d,_,D,M,g,x,G,U;const{t:n}=q(),s=Le(t,i),[u,p]=o.useState("all"),[r,T]=o.useState(!0),[C,E]=o.useState(null),f=o.useMemo(()=>{const l=r?s.changes:s.changes.filter(b=>b.artifactOwnership!=="generated");return[...u==="all"?l:l.filter(b=>b.category===u)].reverse()},[s.changes,u,r]),z=s.changes.some(l=>l.artifactOwnership==="generated"),B=Bt(s.startTime,s.endTime),S=s.endTime?`${V(s.startTime)} → ${V(s.endTime)} (${B})`:`${V(s.startTime)} → ${n("changelog.card.inProgress","in progress")}`,I=!!((v=s.contextSummary)!=null&&v.intent||(k=s.contextSummary)!=null&&k.testScenario||(w=s.contextSummary)!=null&&w.expectedBehavior||(L=s.contextSummary)!=null&&L.observedBehavior),$=!!((A=s.verificationSummary)!=null&&A.label||(R=s.verificationSummary)!=null&&R.status||(d=s.verificationSummary)!=null&&d.testTimestamp),y=n("changelog.detail.dialogLabel","Changelog detail");return e.jsx(oe,{open:!0,ariaLabel:y,onClose:m,returnFocusTo:c,testId:"changelog-detail-backdrop",children:e.jsxs("div",{className:a.dialogContent,children:[e.jsxs("div",{className:a.dialogHeader,children:[e.jsxs("div",{className:a.dialogTitleGroup,children:[e.jsx("h2",{className:a.dialogTitle,children:y}),!s.loading&&!s.error&&e.jsxs("div",{className:a.dialogMeta,children:[e.jsx("span",{className:a.headerTime,children:S}),e.jsx(O,{text:s.status==="active"?n("changelog.card.active.tooltip","This session is still receiving new game changes."):n("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),children:e.jsx("span",{className:s.status==="active"?a.statusActive:a.statusCompleted,children:s.status==="active"?n("changelog.card.active","Active"):n("changelog.card.completed","Completed")})})]})]}),e.jsx("button",{className:a.dialogClose,type:"button","aria-label":n("common.close","Close"),onClick:m,children:e.jsx(W,{size:18,"aria-hidden":"true"})})]}),e.jsxs("div",{className:a.dialogBody,children:[s.loading&&e.jsx("div",{className:a.loading,children:n("common.loading","Loading...")}),s.error&&e.jsxs("div",{className:a.error,children:[e.jsx("span",{children:s.error}),e.jsxs("div",{className:a.dialogActions,children:[e.jsx("button",{className:a.retryButton,type:"button",onClick:s.refresh,children:n("common.retry","Retry")}),e.jsx("button",{className:a.retryButton,type:"button",onClick:m,children:n("common.close","Close")})]})]}),!s.loading&&!s.error&&e.jsxs("div",{className:a.page,children:[e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.changeSummary.tooltip","Counts of extracted game changes grouped by category for this session."),children:e.jsx("span",{children:n("changelog.detail.changeSummary","Change Summary")})})}),e.jsx("div",{className:a.summaryGrid,children:Z.map(l=>{const j=s.changeSummary;let b;switch(l.key){case"script":b=j.scriptsModified+j.scriptsCreated;break;case"instance":b=j.instancesCreated+j.instancesDeleted+j.instancesMoved;break;case"property":b=j.propertiesChanged;break;case"lighting":b=j.lightingChanged?1:0;break;case"terrain":b=j.terrainChanged?1:0;break;case"asset":b=j.assetsInserted;break;default:b=0}const F=u===l.key;return e.jsxs("button",{type:"button",className:`${a.summaryCard} ${F?a.summaryCardActive:""}`,"aria-label":`${n(l.labelKey,l.key)}: ${b}`,"aria-pressed":F,onClick:()=>p(F?"all":l.key),children:[e.jsx("span",{className:a.summaryIcon,children:l.icon}),e.jsx("span",{className:a.summaryCount,children:b}),e.jsx("span",{className:a.summaryLabel,children:n(l.labelKey,l.key)})]},l.key)})})]}),I&&e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.context.tooltip","Structured execution context captured for this changelog session."),children:e.jsx("span",{children:n("changelog.detail.context.title","Context Summary")})})}),e.jsxs("div",{className:a.contextGrid,children:[((_=s.contextSummary)==null?void 0:_.intent)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.intent})]}),((D=s.contextSummary)==null?void 0:D.testScenario)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("playtest.context.why","Why this test ran")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.testScenario})]}),((M=s.contextSummary)==null?void 0:M.expectedBehavior)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("playtest.context.expected","Expected")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.expectedBehavior})]}),((g=s.contextSummary)==null?void 0:g.observedBehavior)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("playtest.context.observed","Observed")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.observedBehavior})]})]})]}),$&&e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.verification.tooltip","Verification signals linked to this changelog session."),children:e.jsx("span",{children:n("changelog.detail.verification.title","Verification")})})}),e.jsxs("div",{className:a.contextGrid,children:[((x=s.verificationSummary)==null?void 0:x.label)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.detail.verification.label","Result")}),e.jsx("span",{className:a.contextValue,children:s.verificationSummary.label})]}),((G=s.verificationSummary)==null?void 0:G.status)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.detail.verification.status","Status")}),e.jsx("span",{className:a.contextValue,children:s.verificationSummary.status})]}),((U=s.verificationSummary)==null?void 0:U.testTimestamp)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.detail.verification.timestamp","Recorded at")}),e.jsx("span",{className:a.contextValue,children:s.verificationSummary.testTimestamp})]})]})]}),e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.changeTimeline.tooltip","Chronological list of extracted game changes for this session."),children:e.jsx("span",{children:n("changelog.detail.changeTimeline","Change Timeline")})})}),e.jsxs("div",{className:a.timelineFilter,children:[e.jsx("span",{className:a.filterLabel,children:e.jsx(le,{label:`${n("changelog.detail.filterCategory","Category")}:`,tooltip:n("changelog.detail.filterCategory.tooltip","Filter the timeline to a single change category.")})}),e.jsxs("select",{className:a.filterSelect,value:u,onChange:l=>p(l.target.value),children:[e.jsx("option",{value:"all",children:n("tools.filter.all","All")}),Z.map(l=>e.jsxs("option",{value:l.key,children:[l.icon," ",n(l.labelKey,l.key)]},l.key))]}),z&&e.jsxs("label",{className:a.ownershipToggle,children:[e.jsx("input",{type:"checkbox",checked:r,onChange:l=>T(l.target.checked)}),n("changelog.ownership.showGenerated","Show generated metadata")]})]}),f.length===0?e.jsx("div",{className:a.empty,children:n("changelog.detail.noChanges","No changes in this category")}):e.jsx("div",{className:a.timeline,children:f.map((l,j)=>{const b=C===j,F=At(n,l.artifactOwnership);return e.jsxs("div",{children:[e.jsxs("button",{type:"button",className:a.timelineEntry,"aria-expanded":b,onClick:()=>E(b?null:j),children:[e.jsx("span",{className:a.timelineTime,children:$t(l.timestamp)}),e.jsx("span",{className:a.timelineIcon,children:Re(l.category)}),e.jsxs("span",{className:a.timelineBody,children:[e.jsxs("span",{className:a.timelineSummary,children:[l.summary,F&&e.jsx(ne,{variant:l.artifactOwnership==="generated"?"neutral":"accent",className:a.ownershipBadge,children:F}),e.jsx(O,{text:Lt(n,l.confidence),children:e.jsx("span",{className:`${a.timelineConfidence} ${zt(l.confidence)}`,children:Et(n,l.confidence)})})]}),e.jsx("span",{className:a.timelineTarget,children:l.target})]})]}),b&&e.jsx("div",{className:a.timelineExpanded,children:e.jsx(de,{change:l})})]},j)})})]})]})]})]})})}const Mt="_page_1tggr_2",Ot="_limitNotice_1tggr_9",Dt="_limitNoticeContent_1tggr_23",Ft="_limitNoticeTitle_1tggr_28",Pt="_limitNoticeText_1tggr_35",Gt="_primaryAction_1tggr_41",Kt="_clearButton_1tggr_67",Vt="_list_1tggr_88",qt="_empty_1tggr_95",Ut="_loading_1tggr_104",Ht="_pagination_1tggr_113",Zt="_pageInfo_1tggr_121",Qt="_btn_1tggr_127",N={page:Mt,limitNotice:Ot,limitNoticeContent:Dt,limitNoticeTitle:Ft,limitNoticeText:Pt,primaryAction:Gt,clearButton:Kt,list:Vt,empty:qt,loading:Ut,pagination:Ht,pageInfo:Zt,btn:Qt},K=10;function Wt(t,i){return typeof i!="number"?`/changelog/${t}`:`/changelog/${t}?placeId=${encodeURIComponent(String(i))}`}function Xt(t){const i=/^\/changelog\/([^/]+)$/.exec(t);if(!i)return null;try{return decodeURIComponent(i[1])}catch{return i[1]}}function Yt(t){const i=new URLSearchParams(t).get("placeId");if(!i)return null;const m=Number.parseInt(i,10);return Number.isInteger(m)&&m>=0?m:null}const Jt=[{key:"all",labelKey:"changelog.filter.all"},{key:"active",labelKey:"changelog.filter.active"},{key:"completed",labelKey:"changelog.filter.completed"}];function la(){const{t}=q(),{trackEvent:i,trackPageView:m}=X(),c=Y(),n=J(),s=Xt(n.pathname),[u,p]=o.useState(()=>Yt(n.search)),r=he({placeId:u}),T=ee(),{show:C}=te(),[E,f]=o.useState(!1),[z,B]=o.useState(!1),[S,I]=o.useState(null),$=o.useRef(null),y=s??S,v=!T.loading&&T.tier==="basic",k=v?r.entries.slice(0,3):r.entries,w=!v&&r.total>K;o.useEffect(()=>{s&&s===S&&I(null)},[S,s]);const L=async()=>{B(!0);try{await r.clear(),C(t("toast.clearSuccess","Cleared successfully"),"success"),f(!1)}catch{C(t("toast.clearFailed","Failed to clear data"),"error")}finally{B(!1)}},A=(d,_)=>{$.current=_,I(d),c(Wt(d,u))},R=()=>{I(null),c("/changelog",{replace:!0})};return e.jsxs("div",{className:N.page,children:[e.jsx(se,{title:t("page.changelog.title","Changelog"),description:t("page.changelog.description","Review game-change sessions captured from AI actions and sync events."),helpTopicId:"changelog",helpState:{tier:T.tier}}),e.jsx(ce,{surface:"changelog",selectable:!0,selectedPlaceId:u,onSelectedPlaceIdChange:d=>{p(d),r.setOffset(0)}}),e.jsx(re,{items:Jt.map(d=>({key:d.key,label:t(d.labelKey,d.key.charAt(0).toUpperCase()+d.key.slice(1))})),value:r.statusFilter,onChange:d=>{const _=`changelog_${d}`;i("dashboard_click_event",{click_target:`changelog_tab_${d}`,page:"changelog",tab:_}),m({page:"changelog",tab:_}),r.setStatusFilter(d),r.setOffset(0)},rightActions:e.jsx("button",{className:N.clearButton,onClick:()=>{i("dashboard_click_event",{click_target:"changelog_clear",page:"changelog",tab:`changelog_${r.statusFilter}`}),f(!0)},children:t("common.clear","Clear")})}),r.loading&&r.entries.length===0&&e.jsx("div",{className:N.loading,children:t("common.loading","Loading...")}),!r.loading&&r.entries.length===0?e.jsx("div",{className:N.empty,children:t("changelog.empty","No changelog entries for the current place yet")}):e.jsx("div",{className:N.list,children:k.map(d=>e.jsx(Be,{entry:d,onClick:_=>A(d.entryId,_),buttonRef:_=>{d.entryId===y&&_&&($.current=_)}},d.entryId))}),w&&e.jsxs("div",{className:N.pagination,children:[e.jsx("button",{className:N.btn,disabled:r.offset===0,onClick:()=>r.setOffset(Math.max(0,r.offset-K)),children:t("tools.page.prev","Prev")}),e.jsxs("span",{className:N.pageInfo,children:[r.offset+1,"–",Math.min(r.offset+K,r.total)," / ",r.total]}),e.jsx("button",{className:N.btn,disabled:!r.hasMore,onClick:()=>r.setOffset(r.offset+K),children:t("tools.page.next","Next")})]}),v&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:N.limitNotice,children:[e.jsxs("div",{className:N.limitNoticeContent,children:[e.jsx("div",{className:N.limitNoticeTitle,children:t("changelog.basic.limit.title","Basic preview shows the latest 3 sessions")}),e.jsx("div",{className:N.limitNoticeText,children:t("changelog.basic.limit.body","Full changelog timeline browsing is available with Pro.")})]}),e.jsx("a",{className:N.primaryAction,href:ae.changelog,target:"_blank",rel:"noreferrer",onClick:()=>i("dashboard_click_event",{click_target:"upgrade_cta",placement:"changelog_limit_notice",page:"changelog",tab:`changelog_${r.statusFilter}`}),children:t("tier.upgrade","View Pro")})]})}),e.jsx(ie,{open:E,title:t("changelog.clear.title","Clear changelog?"),message:t("changelog.clear.message","This permanently removes the stored changelog for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:z,onCancel:()=>!z&&f(!1),onConfirm:L}),y&&e.jsx(Rt,{entryId:y,placeId:u,onClose:R,returnFocusTo:$.current})]})}export{la as Component};
|
|
1
|
+
import{r as o,b as P,D as Q,u as q,j as e,X as W,a as X,o as Y,c as J,e as ee,i as te,T as ae}from"./index-Hgv8iCTe.js";import{B as ne,P as se}from"./PageHeader-BkXyqPrA.js";import{C as ie}from"./ConfirmModal-DaOuVA6n.js";import{C as ce}from"./CurrentPlaceScope-p_fkZWK9.js";import{T as O}from"./TooltipText-BEK9VoiS.js";import{C as oe,T as re}from"./Tabs-Dy5daI-F.js";import{I as le}from"./InfoLabel-gl5i0JQy.js";import{G as de}from"./GameChangeDetail-BOp_DXQ9.js";import"./ConfirmModal.module-DJksQHBd.js";const ge=10;function me(t,i){return typeof i!="number"?t:`${t}?placeId=${encodeURIComponent(String(i))}`}function he(t){const i=(t==null?void 0:t.placeId)??null,[m,c]=o.useState([]),[n,s]=o.useState(0),[u,p]=o.useState(!1),[r,T]=o.useState(!0),[C,E]=o.useState(0),[f,z]=o.useState("all"),B=o.useRef(null),S=o.useCallback(async(y,v)=>{T(!0);try{const k={limit:String(ge),offset:String(y)};v!=="all"&&(k.status=v),typeof i=="number"&&(k.placeId=String(i));const w=await P.get("/api/dashboard/changelog",k);c(w.entries),s(w.total),p(w.hasMore)}catch{c([]),s(0),p(!1)}finally{T(!1)}},[i]),I=o.useCallback(()=>{S(C,f)},[S,C,f]),$=o.useCallback(async()=>{await P.post(me("/api/dashboard/changelog/clear",i)),c([]),s(0),p(!1)},[i]);return o.useEffect(()=>{S(C,f)},[S,C,f]),o.useEffect(()=>{const y=new Q;B.current=y,y.connect();const v=y.on("command",()=>{S(C,f)});return()=>{v(),y.disconnect(),B.current=null}},[S,C,f]),{entries:m,total:n,hasMore:u,loading:r,offset:C,statusFilter:f,setOffset:E,setStatusFilter:z,refresh:I,clear:$}}const ue="_card_qniob_2",pe="_header_qniob_27",fe="_statusBadge_qniob_34",ye="_statusDot_qniob_45",xe="_active_qniob_51",_e="_completed_qniob_60",be="_timeRange_qniob_68",Ce="_summaryList_qniob_75",Se="_summaryItem_qniob_81",ve="_summaryIcon_qniob_90",je="_summaryText_qniob_96",Ne="_progressBar_qniob_101",Te="_progressFill_qniob_110",Ie="_emptySummary_qniob_124",ke="_contextBlock_qniob_132",we="_contextLabel_qniob_141",$e="_contextValue_qniob_149",h={card:ue,header:pe,statusBadge:fe,statusDot:ye,active:xe,completed:_e,timeRange:be,summaryList:Ce,summaryItem:Se,summaryIcon:ve,summaryText:je,progressBar:Ne,progressFill:Te,emptySummary:Ie,contextBlock:ke,contextLabel:we,contextValue:$e};function H(t){if(!t)return"--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function Be({entry:t,onClick:i,buttonRef:m}){var v,k,w,L,A,R,d,_,D,M;const{t:c}=q(),n=t.changeSummary,s=t.status==="active",u=t.isBootstrapOnly===!0,p=[],r=n.scriptsModified+n.scriptsCreated;if(r>0){const g=[];n.scriptsModified>0&&g.push(`${n.scriptsModified} ${c("changelog.card.modified","modified")}`),n.scriptsCreated>0&&g.push(`${n.scriptsCreated} ${c("changelog.card.created","created")}`);const x=`${r} ${c("changelog.card.scripts","scripts")} ${g.join(", ")}`;p.push({icon:"📝",text:x,tooltip:c("changelog.card.scripts.tooltip","Script changes made in this session.")})}const T=n.instancesCreated+n.instancesDeleted+n.instancesMoved;if(T>0){const g=[];n.instancesCreated>0&&g.push(`${n.instancesCreated} ${c("changelog.card.created","created")}`),n.instancesDeleted>0&&g.push(`${n.instancesDeleted} ${c("changelog.card.deleted","deleted")}`),n.instancesMoved>0&&g.push(`${n.instancesMoved} ${c("changelog.card.moved","moved")}`);const x=`${T} ${c("changelog.card.instances","instances")} ${g.join(", ")}`;p.push({icon:"🧱",text:x,tooltip:c("changelog.card.instances.tooltip","Instance create, delete, move, or clone changes in this session.")})}n.propertiesChanged>0&&p.push({icon:"🎨",text:`${n.propertiesChanged} ${c("changelog.card.propertiesChanged","properties changed")}`,tooltip:c("changelog.card.propertiesChanged.tooltip","Property value changes recorded for this session.")}),n.lightingChanged&&p.push({icon:"🌅",text:c("changelog.card.lightingConfigured","Lighting configured"),tooltip:c("changelog.card.lightingConfigured.tooltip","Lighting or atmosphere settings changed in this session.")}),n.terrainChanged&&p.push({icon:"⛰️",text:c("changelog.card.terrainConfigured","Terrain configured"),tooltip:c("changelog.card.terrainConfigured.tooltip","Terrain data or terrain settings changed in this session.")}),n.assetsInserted>0&&p.push({icon:"📦",text:`${n.assetsInserted} ${c("changelog.card.assetsInserted","assets inserted")}`,tooltip:c("changelog.card.assetsInserted.tooltip","Assets inserted into the place during this session.")});const C=H(t.startTime),E=s?c("changelog.card.inProgress","in progress"):t.endTime?H(t.endTime):"--:--",f=u?c("changelog.card.bootstrapStatus","Bootstrap"):s?c("changelog.card.active","Active"):c("changelog.card.completed","Completed"),z=u?c("changelog.card.bootstrapStatus.tooltip","This session only contains the initial sync bootstrap snapshot."):s?c("changelog.card.active.tooltip","This session is still receiving new game changes."):c("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),B=u?c("changelog.card.bootstrapSummary","Initial sync snapshot"):c("changelog.card.noChanges","No changes yet"),S=u?c("changelog.card.bootstrapSummary.tooltip","Initial file sync writes are collapsed into a single bootstrap snapshot row."):c("changelog.card.noChanges.tooltip","No game changes have been extracted for this session yet."),I=(k=(v=t.contextSummary)==null?void 0:v.intent)==null?void 0:k.trim(),$=((R=(A=(L=(w=t.contextSummary)==null?void 0:w.affectedAreas)==null?void 0:L[0])==null?void 0:A.label)==null?void 0:R.trim())||((_=(d=t.contextSummary)==null?void 0:d.testScenario)==null?void 0:_.trim()),y=(M=(D=t.verificationSummary)==null?void 0:D.label)==null?void 0:M.trim();return e.jsxs("button",{ref:m,className:h.card,type:"button",onClick:g=>i(g.currentTarget),children:[e.jsxs("span",{className:h.header,children:[e.jsx(O,{text:z,children:e.jsxs("span",{className:`${h.statusBadge} ${s?h.active:h.completed}`,children:[e.jsx("span",{className:h.statusDot}),f]})}),e.jsxs("span",{className:h.timeRange,children:[C,"~",E]})]}),e.jsx("span",{className:h.summaryList,children:p.length>0?p.map((g,x)=>e.jsxs("span",{className:h.summaryItem,children:[e.jsx("span",{className:h.summaryIcon,children:g.icon}),e.jsx(O,{text:g.tooltip,children:e.jsx("span",{className:h.summaryText,children:g.text})})]},x)):e.jsx(O,{text:S,children:e.jsx("span",{className:h.emptySummary,style:{display:"block"},children:B})})}),I&&e.jsxs("span",{className:h.contextBlock,children:[e.jsx("span",{className:h.contextLabel,children:c("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:h.contextValue,children:I})]}),!I&&$&&e.jsxs("span",{className:h.contextBlock,children:[e.jsx("span",{className:h.contextLabel,children:c("changelog.card.representativeArea","Representative area")}),e.jsx("span",{className:h.contextValue,children:$})]}),y&&e.jsxs("span",{className:h.contextBlock,children:[e.jsx("span",{className:h.contextLabel,children:c("changelog.card.verification","Verification")}),e.jsx("span",{className:h.contextValue,children:y})]}),s&&e.jsx("span",{className:h.progressBar,children:e.jsx("span",{className:h.progressFill})})]})}function ze(t){const i={scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0};for(const m of t)switch(m.category){case"script":m.changeType==="create"?i.scriptsCreated++:i.scriptsModified++;break;case"instance":m.changeType==="create"?i.instancesCreated++:m.changeType==="delete"?i.instancesDeleted++:m.changeType==="move"&&i.instancesMoved++;break;case"property":i.propertiesChanged++;break;case"lighting":i.lightingChanged=!0;break;case"terrain":i.terrainChanged=!0;break;case"asset":i.assetsInserted++;break}return i}function Ee(t){if(typeof t=="number")return{placeId:String(t)}}function Le(t,i){const[m,c]=o.useState(""),[n,s]=o.useState(""),[u,p]=o.useState(),[r,T]=o.useState("completed"),[C,E]=o.useState([]),[f,z]=o.useState([]),[B,S]=o.useState([]),[I,$]=o.useState(),[y,v]=o.useState(),[k,w]=o.useState(),[L,A]=o.useState({scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0}),[R,d]=o.useState(!0),[_,D]=o.useState(null),M=o.useCallback(async()=>{if(t){d(!0),D(null);try{const g=Ee(i),[x,G]=await Promise.all([g?P.get(`/api/dashboard/changelog/${t}`,g):P.get(`/api/dashboard/changelog/${t}`),g?P.get(`/api/dashboard/changelog/${t}/changes`,g):P.get(`/api/dashboard/changelog/${t}/changes`)]);c(x.entryId),s(x.startTime),p(x.endTime),T(x.status),E(x.entries),z(x.failures),$(x.contextSummary),v(x.replayMetadata),w(x.verificationSummary),S(G.changes),A(ze(G.changes))}catch(g){D(g instanceof Error?g.message:"Failed to load changelog detail")}finally{d(!1)}}},[t,i]);return o.useEffect(()=>{M()},[M]),{entryId:m,startTime:n,endTime:u,status:r,entries:C,failures:f,changes:B,changeSummary:L,contextSummary:I,replayMetadata:y,verificationSummary:k,loading:R,error:_,refresh:M}}const Ae={script:"📝",instance:"🧱",property:"🎨",lighting:"🌅",terrain:"⛰️",asset:"📦"};function Re(t){return Ae[t]??"❓"}const Me="_dialogContent_197zf_2",Oe="_dialogHeader_197zf_10",De="_dialogTitleGroup_197zf_20",Fe="_dialogTitle_197zf_20",Pe="_dialogMeta_197zf_36",Ge="_dialogClose_197zf_43",Ke="_dialogBody_197zf_68",Ve="_page_197zf_77",qe="_headerTime_197zf_84",Ue="_dialogActions_197zf_90",He="_retryButton_197zf_96",Ze="_statusActive_197zf_129",Qe="_statusCompleted_197zf_134",We="_section_197zf_139",Xe="_sectionTitle_197zf_146",Ye="_summaryGrid_197zf_159",Je="_summaryCard_197zf_165",et="_summaryCardActive_197zf_188",tt="_summaryIcon_197zf_193",at="_summaryCount_197zf_199",nt="_summaryLabel_197zf_207",st="_contextGrid_197zf_217",it="_contextRow_197zf_223",ct="_contextKey_197zf_229",ot="_contextValue_197zf_237",rt="_timelineFilter_197zf_245",lt="_filterLabel_197zf_253",dt="_filterSelect_197zf_259",gt="_ownershipToggle_197zf_269",mt="_timeline_197zf_245",ht="_timelineEntry_197zf_297",ut="_timelineTime_197zf_326",pt="_timelineIcon_197zf_334",ft="_timelineBody_197zf_339",yt="_timelineSummary_197zf_345",xt="_timelineTarget_197zf_353",_t="_timelineConfidence_197zf_361",bt="_ownershipBadge_197zf_370",Ct="_confidenceExact_197zf_378",St="_confidencePartial_197zf_383",vt="_confidenceAfterOnly_197zf_388",jt="_confidenceIntentOnly_197zf_393",Nt="_confidenceUnknown_197zf_398",Tt="_timelineExpanded_197zf_404",It="_empty_197zf_413",kt="_loading_197zf_422",wt="_error_197zf_431",a={dialogContent:Me,dialogHeader:Oe,dialogTitleGroup:De,dialogTitle:Fe,dialogMeta:Pe,dialogClose:Ge,dialogBody:Ke,page:Ve,headerTime:qe,dialogActions:Ue,retryButton:He,statusActive:Ze,statusCompleted:Qe,section:We,sectionTitle:Xe,summaryGrid:Ye,summaryCard:Je,summaryCardActive:et,summaryIcon:tt,summaryCount:at,summaryLabel:nt,contextGrid:st,contextRow:it,contextKey:ct,contextValue:ot,timelineFilter:rt,filterLabel:lt,filterSelect:dt,ownershipToggle:gt,timeline:mt,timelineEntry:ht,timelineTime:ut,timelineIcon:pt,timelineBody:ft,timelineSummary:yt,timelineTarget:xt,timelineConfidence:_t,ownershipBadge:bt,confidenceExact:Ct,confidencePartial:St,confidenceAfterOnly:vt,confidenceIntentOnly:jt,confidenceUnknown:Nt,timelineExpanded:Tt,empty:It,loading:kt,error:wt},Z=[{key:"script",icon:"📝",labelKey:"changelog.category.script"},{key:"instance",icon:"🧱",labelKey:"changelog.category.instance"},{key:"property",icon:"🎨",labelKey:"changelog.category.property"},{key:"lighting",icon:"🌅",labelKey:"changelog.category.lighting"},{key:"terrain",icon:"⛰️",labelKey:"changelog.category.terrain"},{key:"asset",icon:"📦",labelKey:"changelog.category.asset"}];function V(t){if(!t)return"--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function $t(t){if(!t)return"--:--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}`}function Bt(t,i){if(!t||!i)return"";const m=new Date(i).getTime()-new Date(t).getTime();return m<0?"":`${Math.round(m/6e4)}min`}function zt(t){switch(t){case"exact":return a.confidenceExact;case"partial":return a.confidencePartial;case"after-only":return a.confidenceAfterOnly;case"intent-only":return a.confidenceIntentOnly;default:return a.confidenceUnknown}}function Et(t,i){switch(i){case"exact":return t("changelog.detail.confidence.exact","Exact");case"partial":return t("changelog.detail.confidence.partial","Partial");case"after-only":return t("changelog.detail.confidence.afterOnly","After only");case"intent-only":return t("changelog.detail.confidence.intentOnly","Intent only");default:return t("changelog.detail.confidence.unknown","Unknown")}}function Lt(t,i){switch(i){case"exact":return t("changelog.detail.confidence.exact.tooltip","Both the before and after state were confirmed for this change.");case"partial":return t("changelog.detail.confidence.partial.tooltip","Only part of the before and after state could be confirmed for this change.");case"after-only":return t("changelog.detail.confidence.afterOnly.tooltip","Only the resulting state after the change could be confirmed.");case"intent-only":return t("changelog.detail.confidence.intentOnly.tooltip","Only the requested action was recorded, not the resulting state.");default:return t("changelog.detail.confidence.unknown.tooltip","This change could not be confidently classified from the available data.")}}function At(t,i){switch(i){case"user_source":return t("changelog.ownership.userSource","User source");case"canonical_mirror":return t("changelog.ownership.canonicalMirror","Mirror metadata");case"generated":return t("changelog.ownership.generated","Generated");default:return null}}function Rt({entryId:t,placeId:i,onClose:m,returnFocusTo:c=null}){var v,k,w,L,A,R,d,_,D,M,g,x,G,U;const{t:n}=q(),s=Le(t,i),[u,p]=o.useState("all"),[r,T]=o.useState(!0),[C,E]=o.useState(null),f=o.useMemo(()=>{const l=r?s.changes:s.changes.filter(b=>b.artifactOwnership!=="generated");return[...u==="all"?l:l.filter(b=>b.category===u)].reverse()},[s.changes,u,r]),z=s.changes.some(l=>l.artifactOwnership==="generated"),B=Bt(s.startTime,s.endTime),S=s.endTime?`${V(s.startTime)} → ${V(s.endTime)} (${B})`:`${V(s.startTime)} → ${n("changelog.card.inProgress","in progress")}`,I=!!((v=s.contextSummary)!=null&&v.intent||(k=s.contextSummary)!=null&&k.testScenario||(w=s.contextSummary)!=null&&w.expectedBehavior||(L=s.contextSummary)!=null&&L.observedBehavior),$=!!((A=s.verificationSummary)!=null&&A.label||(R=s.verificationSummary)!=null&&R.status||(d=s.verificationSummary)!=null&&d.testTimestamp),y=n("changelog.detail.dialogLabel","Changelog detail");return e.jsx(oe,{open:!0,ariaLabel:y,onClose:m,returnFocusTo:c,testId:"changelog-detail-backdrop",children:e.jsxs("div",{className:a.dialogContent,children:[e.jsxs("div",{className:a.dialogHeader,children:[e.jsxs("div",{className:a.dialogTitleGroup,children:[e.jsx("h2",{className:a.dialogTitle,children:y}),!s.loading&&!s.error&&e.jsxs("div",{className:a.dialogMeta,children:[e.jsx("span",{className:a.headerTime,children:S}),e.jsx(O,{text:s.status==="active"?n("changelog.card.active.tooltip","This session is still receiving new game changes."):n("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),children:e.jsx("span",{className:s.status==="active"?a.statusActive:a.statusCompleted,children:s.status==="active"?n("changelog.card.active","Active"):n("changelog.card.completed","Completed")})})]})]}),e.jsx("button",{className:a.dialogClose,type:"button","aria-label":n("common.close","Close"),onClick:m,children:e.jsx(W,{size:18,"aria-hidden":"true"})})]}),e.jsxs("div",{className:a.dialogBody,children:[s.loading&&e.jsx("div",{className:a.loading,children:n("common.loading","Loading...")}),s.error&&e.jsxs("div",{className:a.error,children:[e.jsx("span",{children:s.error}),e.jsxs("div",{className:a.dialogActions,children:[e.jsx("button",{className:a.retryButton,type:"button",onClick:s.refresh,children:n("common.retry","Retry")}),e.jsx("button",{className:a.retryButton,type:"button",onClick:m,children:n("common.close","Close")})]})]}),!s.loading&&!s.error&&e.jsxs("div",{className:a.page,children:[e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.changeSummary.tooltip","Counts of extracted game changes grouped by category for this session."),children:e.jsx("span",{children:n("changelog.detail.changeSummary","Change Summary")})})}),e.jsx("div",{className:a.summaryGrid,children:Z.map(l=>{const j=s.changeSummary;let b;switch(l.key){case"script":b=j.scriptsModified+j.scriptsCreated;break;case"instance":b=j.instancesCreated+j.instancesDeleted+j.instancesMoved;break;case"property":b=j.propertiesChanged;break;case"lighting":b=j.lightingChanged?1:0;break;case"terrain":b=j.terrainChanged?1:0;break;case"asset":b=j.assetsInserted;break;default:b=0}const F=u===l.key;return e.jsxs("button",{type:"button",className:`${a.summaryCard} ${F?a.summaryCardActive:""}`,"aria-label":`${n(l.labelKey,l.key)}: ${b}`,"aria-pressed":F,onClick:()=>p(F?"all":l.key),children:[e.jsx("span",{className:a.summaryIcon,children:l.icon}),e.jsx("span",{className:a.summaryCount,children:b}),e.jsx("span",{className:a.summaryLabel,children:n(l.labelKey,l.key)})]},l.key)})})]}),I&&e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.context.tooltip","Structured execution context captured for this changelog session."),children:e.jsx("span",{children:n("changelog.detail.context.title","Context Summary")})})}),e.jsxs("div",{className:a.contextGrid,children:[((_=s.contextSummary)==null?void 0:_.intent)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.intent})]}),((D=s.contextSummary)==null?void 0:D.testScenario)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("playtest.context.why","Why this test ran")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.testScenario})]}),((M=s.contextSummary)==null?void 0:M.expectedBehavior)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("playtest.context.expected","Expected")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.expectedBehavior})]}),((g=s.contextSummary)==null?void 0:g.observedBehavior)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("playtest.context.observed","Observed")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.observedBehavior})]})]})]}),$&&e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.verification.tooltip","Verification signals linked to this changelog session."),children:e.jsx("span",{children:n("changelog.detail.verification.title","Verification")})})}),e.jsxs("div",{className:a.contextGrid,children:[((x=s.verificationSummary)==null?void 0:x.label)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.detail.verification.label","Result")}),e.jsx("span",{className:a.contextValue,children:s.verificationSummary.label})]}),((G=s.verificationSummary)==null?void 0:G.status)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.detail.verification.status","Status")}),e.jsx("span",{className:a.contextValue,children:s.verificationSummary.status})]}),((U=s.verificationSummary)==null?void 0:U.testTimestamp)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.detail.verification.timestamp","Recorded at")}),e.jsx("span",{className:a.contextValue,children:s.verificationSummary.testTimestamp})]})]})]}),e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.changeTimeline.tooltip","Chronological list of extracted game changes for this session."),children:e.jsx("span",{children:n("changelog.detail.changeTimeline","Change Timeline")})})}),e.jsxs("div",{className:a.timelineFilter,children:[e.jsx("span",{className:a.filterLabel,children:e.jsx(le,{label:`${n("changelog.detail.filterCategory","Category")}:`,tooltip:n("changelog.detail.filterCategory.tooltip","Filter the timeline to a single change category.")})}),e.jsxs("select",{className:a.filterSelect,value:u,onChange:l=>p(l.target.value),children:[e.jsx("option",{value:"all",children:n("tools.filter.all","All")}),Z.map(l=>e.jsxs("option",{value:l.key,children:[l.icon," ",n(l.labelKey,l.key)]},l.key))]}),z&&e.jsxs("label",{className:a.ownershipToggle,children:[e.jsx("input",{type:"checkbox",checked:r,onChange:l=>T(l.target.checked)}),n("changelog.ownership.showGenerated","Show generated metadata")]})]}),f.length===0?e.jsx("div",{className:a.empty,children:n("changelog.detail.noChanges","No changes in this category")}):e.jsx("div",{className:a.timeline,children:f.map((l,j)=>{const b=C===j,F=At(n,l.artifactOwnership);return e.jsxs("div",{children:[e.jsxs("button",{type:"button",className:a.timelineEntry,"aria-expanded":b,onClick:()=>E(b?null:j),children:[e.jsx("span",{className:a.timelineTime,children:$t(l.timestamp)}),e.jsx("span",{className:a.timelineIcon,children:Re(l.category)}),e.jsxs("span",{className:a.timelineBody,children:[e.jsxs("span",{className:a.timelineSummary,children:[l.summary,F&&e.jsx(ne,{variant:l.artifactOwnership==="generated"?"neutral":"accent",className:a.ownershipBadge,children:F}),e.jsx(O,{text:Lt(n,l.confidence),children:e.jsx("span",{className:`${a.timelineConfidence} ${zt(l.confidence)}`,children:Et(n,l.confidence)})})]}),e.jsx("span",{className:a.timelineTarget,children:l.target})]})]}),b&&e.jsx("div",{className:a.timelineExpanded,children:e.jsx(de,{change:l})})]},j)})})]})]})]})]})})}const Mt="_page_1tggr_2",Ot="_limitNotice_1tggr_9",Dt="_limitNoticeContent_1tggr_23",Ft="_limitNoticeTitle_1tggr_28",Pt="_limitNoticeText_1tggr_35",Gt="_primaryAction_1tggr_41",Kt="_clearButton_1tggr_67",Vt="_list_1tggr_88",qt="_empty_1tggr_95",Ut="_loading_1tggr_104",Ht="_pagination_1tggr_113",Zt="_pageInfo_1tggr_121",Qt="_btn_1tggr_127",N={page:Mt,limitNotice:Ot,limitNoticeContent:Dt,limitNoticeTitle:Ft,limitNoticeText:Pt,primaryAction:Gt,clearButton:Kt,list:Vt,empty:qt,loading:Ut,pagination:Ht,pageInfo:Zt,btn:Qt},K=10;function Wt(t,i){return typeof i!="number"?`/changelog/${t}`:`/changelog/${t}?placeId=${encodeURIComponent(String(i))}`}function Xt(t){const i=/^\/changelog\/([^/]+)$/.exec(t);if(!i)return null;try{return decodeURIComponent(i[1])}catch{return i[1]}}function Yt(t){const i=new URLSearchParams(t).get("placeId");if(!i)return null;const m=Number.parseInt(i,10);return Number.isInteger(m)&&m>=0?m:null}const Jt=[{key:"all",labelKey:"changelog.filter.all"},{key:"active",labelKey:"changelog.filter.active"},{key:"completed",labelKey:"changelog.filter.completed"}];function la(){const{t}=q(),{trackEvent:i,trackPageView:m}=X(),c=Y(),n=J(),s=Xt(n.pathname),[u,p]=o.useState(()=>Yt(n.search)),r=he({placeId:u}),T=ee(),{show:C}=te(),[E,f]=o.useState(!1),[z,B]=o.useState(!1),[S,I]=o.useState(null),$=o.useRef(null),y=s??S,v=!T.loading&&T.tier==="basic",k=v?r.entries.slice(0,3):r.entries,w=!v&&r.total>K;o.useEffect(()=>{s&&s===S&&I(null)},[S,s]);const L=async()=>{B(!0);try{await r.clear(),C(t("toast.clearSuccess","Cleared successfully"),"success"),f(!1)}catch{C(t("toast.clearFailed","Failed to clear data"),"error")}finally{B(!1)}},A=(d,_)=>{$.current=_,I(d),c(Wt(d,u))},R=()=>{I(null),c("/changelog",{replace:!0})};return e.jsxs("div",{className:N.page,children:[e.jsx(se,{title:t("page.changelog.title","Changelog"),description:t("page.changelog.description","Review game-change sessions captured from AI actions and sync events."),helpTopicId:"changelog",helpState:{tier:T.tier}}),e.jsx(ce,{surface:"changelog",selectable:!0,selectedPlaceId:u,onSelectedPlaceIdChange:d=>{p(d),r.setOffset(0)}}),e.jsx(re,{items:Jt.map(d=>({key:d.key,label:t(d.labelKey,d.key.charAt(0).toUpperCase()+d.key.slice(1))})),value:r.statusFilter,onChange:d=>{const _=`changelog_${d}`;i("dashboard_click_event",{click_target:`changelog_tab_${d}`,page:"changelog",tab:_}),m({page:"changelog",tab:_}),r.setStatusFilter(d),r.setOffset(0)},rightActions:e.jsx("button",{className:N.clearButton,onClick:()=>{i("dashboard_click_event",{click_target:"changelog_clear",page:"changelog",tab:`changelog_${r.statusFilter}`}),f(!0)},children:t("common.clear","Clear")})}),r.loading&&r.entries.length===0&&e.jsx("div",{className:N.loading,children:t("common.loading","Loading...")}),!r.loading&&r.entries.length===0?e.jsx("div",{className:N.empty,children:t("changelog.empty","No changelog entries for the current place yet")}):e.jsx("div",{className:N.list,children:k.map(d=>e.jsx(Be,{entry:d,onClick:_=>A(d.entryId,_),buttonRef:_=>{d.entryId===y&&_&&($.current=_)}},d.entryId))}),w&&e.jsxs("div",{className:N.pagination,children:[e.jsx("button",{className:N.btn,disabled:r.offset===0,onClick:()=>r.setOffset(Math.max(0,r.offset-K)),children:t("tools.page.prev","Prev")}),e.jsxs("span",{className:N.pageInfo,children:[r.offset+1,"–",Math.min(r.offset+K,r.total)," / ",r.total]}),e.jsx("button",{className:N.btn,disabled:!r.hasMore,onClick:()=>r.setOffset(r.offset+K),children:t("tools.page.next","Next")})]}),v&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:N.limitNotice,children:[e.jsxs("div",{className:N.limitNoticeContent,children:[e.jsx("div",{className:N.limitNoticeTitle,children:t("changelog.basic.limit.title","Basic preview shows the latest 3 sessions")}),e.jsx("div",{className:N.limitNoticeText,children:t("changelog.basic.limit.body","Full changelog timeline browsing is available with Pro.")})]}),e.jsx("a",{className:N.primaryAction,href:ae.changelog,target:"_blank",rel:"noreferrer",onClick:()=>i("dashboard_click_event",{click_target:"upgrade_cta",placement:"changelog_limit_notice",page:"changelog",tab:`changelog_${r.statusFilter}`}),children:t("tier.upgrade","View Pro")})]})}),e.jsx(ie,{open:E,title:t("changelog.clear.title","Clear changelog?"),message:t("changelog.clear.message","This permanently removes the stored changelog for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:z,onCancel:()=>!z&&f(!1),onConfirm:L}),y&&e.jsx(Rt,{entryId:y,placeId:u,onClose:R,returnFocusTo:$.current})]})}export{la as Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,j as s}from"./index-
|
|
1
|
+
import{r as t,j as s}from"./index-Hgv8iCTe.js";import{s as r}from"./ConfirmModal.module-DJksQHBd.js";function D({open:a,title:y,message:E,cancelLabel:R,confirmLabel:j,loading:n=!1,onCancel:c,onConfirm:k}){const i=t.useId(),o=t.useRef(null),f=t.useRef(null),d=t.useRef(null),m=t.useRef(c),h=t.useRef(n);return m.current=c,h.current=n,t.useEffect(()=>{var b;if(!a)return;d.current=document.activeElement instanceof HTMLElement?document.activeElement:null,(b=f.current)==null||b.focus();const l=e=>{if(e.key==="Escape"){e.preventDefault(),h.current||m.current();return}if(e.key!=="Tab"||!o.current)return;const u=Array.from(o.current.querySelectorAll("button:not([disabled])"));if(u.length===0){e.preventDefault(),o.current.focus();return}const p=u[0],x=u[u.length-1];e.shiftKey&&document.activeElement===p?(e.preventDefault(),x.focus()):!e.shiftKey&&document.activeElement===x&&(e.preventDefault(),p.focus())};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l);const e=d.current;e&&document.contains(e)&&e.focus()}},[a]),a?s.jsx("div",{className:r.backdrop,onClick:n?void 0:c,children:s.jsxs("div",{ref:o,className:r.modal,role:"dialog","aria-modal":"true","aria-labelledby":i,tabIndex:-1,onClick:l=>l.stopPropagation(),children:[s.jsx("h2",{id:i,className:r.title,children:y}),s.jsx("p",{className:r.message,children:E}),s.jsxs("div",{className:r.actions,children:[s.jsx("button",{ref:f,className:r.cancelButton,onClick:c,disabled:n,children:R}),s.jsx("button",{className:r.confirmButton,onClick:k,disabled:n,children:n?"...":j})]})]})}):null}export{D as C};
|