@fses/workbench-app 0.2.18 → 0.2.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/WORKBENCH-CLOSURE.json +14 -14
  2. package/dist/WorkbenchCardCenterDrawer-BxRFAZDG.js +421 -0
  3. package/dist/WorkbenchDiagnosticsFooter-BXQJLBMu.js +22 -0
  4. package/dist/WorkbenchDiagnosticsPage-OdYSvQ2O.js +72 -0
  5. package/dist/Workspace-C4Co3cIc.js +22678 -0
  6. package/dist/adapters/defaultAgentTransportAdapter.d.ts +6 -0
  7. package/dist/adapters/defaultBrowserAdapters.d.ts +22 -0
  8. package/dist/adapters/defaultPlatformRequestAdapter.d.ts +6 -0
  9. package/dist/adapters/defaultRealtimeAdapter.d.ts +6 -0
  10. package/dist/adapters/endpointResolver.d.ts +16 -0
  11. package/dist/adapters/index.d.ts +7 -1
  12. package/dist/adapters/servicePorts.d.ts +20 -0
  13. package/dist/adapters/types.d.ts +27 -1
  14. package/dist/canvas/api/index.js +1 -1
  15. package/dist/canvas/bridge/workbenchCanvasBus.d.ts +13 -1
  16. package/dist/canvas/persistence/canvasSnapshotStorage.d.ts +3 -2
  17. package/dist/{canvasFacade-B8jYm_aO.js → canvasFacade-ZFqB_i7z.js} +1 -1
  18. package/dist/{cardFactory-DmEBcCf4.js → cardFactory-D5dyYSC3.js} +197 -161
  19. package/dist/components/WorkbenchAppHost.vue.d.ts +5 -5
  20. package/dist/components/WorkbenchApplication.vue.d.ts +2 -2
  21. package/dist/components/WorkbenchCardCenterDrawer.vue.d.ts +2 -0
  22. package/dist/components/WorkbenchDiagnosticsFooter.vue.d.ts +2 -0
  23. package/dist/components/WorkbenchDiagnosticsPage.vue.d.ts +2 -0
  24. package/dist/components/WorkbenchDrawerOutlet.vue.d.ts +6 -0
  25. package/dist/components/WorkbenchFeatureOutlet.vue.d.ts +2 -0
  26. package/dist/components/WorkbenchSlotOutlet.vue.d.ts +5 -0
  27. package/dist/config/workbenchAppConfig.d.ts +4 -0
  28. package/dist/customCardCatalog-D8woQgB9.js +512 -0
  29. package/dist/extensions/index.d.ts +3 -54
  30. package/dist/extensions/index.js +7 -5
  31. package/dist/extensions/manifest.d.ts +27 -0
  32. package/dist/extensions/normalizeWorkbenchExtensions.d.ts +19 -0
  33. package/dist/extensions/types.d.ts +62 -0
  34. package/dist/fses-workbench-app.js +109 -89
  35. package/dist/i18n/index.d.ts +17 -0
  36. package/dist/i18n/index.js +14 -0
  37. package/dist/index-C1Y_OWV9.js +1772 -0
  38. package/dist/index-DkGYPLLJ.js +34 -0
  39. package/dist/index.d.ts +12 -1
  40. package/dist/internal/personal-workbench/components/workbench/WorkbenchCanvas.vue.d.ts +4 -4
  41. package/dist/internal/personal-workbench/components/workbench/WorkbenchCanvasSettingsMenu.vue.d.ts +4 -4
  42. package/dist/internal/personal-workbench/components/workbench/WorkbenchFdeImageComposeDrawer.vue.d.ts +19 -0
  43. package/dist/internal/personal-workbench/components/workbench/WorkbenchFdeToolbar.vue.d.ts +36 -0
  44. package/dist/internal/personal-workbench/components/workbench/WorkbenchStudio.vue.d.ts +2 -2
  45. package/dist/internal/personal-workbench/components/workbench/controllers/canvasConfigController.d.ts +23 -0
  46. package/dist/internal/personal-workbench/components/workbench/controllers/canvasLayoutController.d.ts +12 -0
  47. package/dist/internal/personal-workbench/components/workbench/controllers/canvasRefreshController.d.ts +11 -0
  48. package/dist/internal/personal-workbench/components/workbench/controllers/canvasSelectionController.d.ts +11 -0
  49. package/dist/internal/personal-workbench/components/workbench/showcase/WorkbenchShowcase.vue.d.ts +4 -4
  50. package/dist/internal/personal-workbench/controllers/workbenchBuiltinPluginBridge.d.ts +32 -0
  51. package/dist/internal/personal-workbench/controllers/workbenchChartConfigModel.d.ts +68 -0
  52. package/dist/internal/personal-workbench/controllers/workbenchChartDataSourceController.d.ts +100 -0
  53. package/dist/internal/personal-workbench/controllers/workbenchChartDrilldownController.d.ts +96 -0
  54. package/dist/internal/personal-workbench/controllers/workbenchChartDrilldownTable.d.ts +34 -0
  55. package/dist/internal/personal-workbench/controllers/workbenchFdeVersionController.d.ts +107 -0
  56. package/dist/internal/personal-workbench/controllers/workbenchRecommendationConfigModel.d.ts +82 -0
  57. package/dist/internal/personal-workbench/lib/deepAgentApi.d.ts +13 -9
  58. package/dist/internal/personal-workbench/lib/deepAgentQueueState.d.ts +3 -1
  59. package/dist/internal/personal-workbench/lib/fdeWorkbenchConfigClient.d.ts +6 -5
  60. package/dist/internal/personal-workbench/lib/runtimeIdentity.d.ts +5 -0
  61. package/dist/internal/personal-workbench/lib/runtimePrimitiveRegistry.d.ts +1 -1
  62. package/dist/internal/personal-workbench/lib/vueRuntimeAdapters.d.ts +4 -4
  63. package/dist/internal/personal-workbench/lib/workbenchApi.d.ts +61 -47
  64. package/dist/internal/personal-workbench/lib/workbenchMetricDetailApi.d.ts +2 -1
  65. package/dist/internal/personal-workbench/lib/workbenchRemoteClient.d.ts +3 -1
  66. package/dist/internal/personal-workbench/lib/workbenchRequestTransport.d.ts +24 -0
  67. package/dist/internal/personal-workbench/lib/workbenchStorage.d.ts +8 -7
  68. package/dist/internal/personal-workbench/pages/Workspace.vue.d.ts +2 -2
  69. package/dist/internal/personal-workbench/stores/domains/actionsRuntime.d.ts +35 -0
  70. package/dist/internal/personal-workbench/stores/domains/canvasRuntime.d.ts +44 -0
  71. package/dist/internal/personal-workbench/stores/domains/conversationRuntime.d.ts +29 -0
  72. package/dist/internal/personal-workbench/stores/domains/dataBindingRuntime.d.ts +27 -0
  73. package/dist/internal/personal-workbench/stores/domains/fdeRuntime.d.ts +38 -0
  74. package/dist/internal/personal-workbench/stores/domains/memoryRuntime.d.ts +53 -0
  75. package/dist/internal/personal-workbench/stores/workbenchRuntime.d.ts +28 -1
  76. package/dist/kernel/command/createCommandRegistry.d.ts +19 -0
  77. package/dist/kernel/createWorkbenchHostContext.d.ts +43 -0
  78. package/dist/kernel/createWorkbenchKernel.d.ts +7 -0
  79. package/dist/kernel/diagnostics/createWorkbenchDiagnostics.d.ts +35 -0
  80. package/dist/kernel/event/createEventBus.d.ts +16 -0
  81. package/dist/kernel/plugin/createPluginManager.d.ts +7 -0
  82. package/dist/kernel/plugin/registrationScope.d.ts +15 -0
  83. package/dist/kernel/plugin/types.d.ts +30 -0
  84. package/dist/kernel/registry/createRegistry.d.ts +42 -0
  85. package/dist/kernel/registry/resolveSlotContributions.d.ts +14 -0
  86. package/dist/kernel/types.d.ts +52 -0
  87. package/dist/kernel/workbenchHostContext.d.ts +14 -0
  88. package/dist/normalizeWorkbenchExtensions-Ccv3n3fC.js +425 -0
  89. package/dist/plugin/index.d.ts +7 -0
  90. package/dist/plugin/index.js +8 -0
  91. package/dist/plugin/types.d.ts +106 -0
  92. package/dist/plugins/defaultWorkbenchPlugins.d.ts +11 -0
  93. package/dist/plugins/workbenchCardCenterPlugin.d.ts +13 -0
  94. package/dist/plugins/workbenchDiagnosticsPlugin.d.ts +15 -0
  95. package/dist/plugins/workbenchDrawerCommands.d.ts +16 -0
  96. package/dist/plugins/workbenchSettingsPlugin.d.ts +19 -0
  97. package/dist/plugins/workbenchThemePlugin.d.ts +15 -0
  98. package/dist/routing/createWorkbenchFeatureRoute.d.ts +11 -0
  99. package/dist/routing/resolveWorkbenchFeatureRoute.d.ts +23 -0
  100. package/dist/runtime/index.d.ts +6 -1
  101. package/dist/runtime/index.js +6 -3
  102. package/dist/runtime/scope/createWorkbenchRuntimeScope.d.ts +10 -0
  103. package/dist/runtime/store/workbenchRuntimeContext.d.ts +12 -0
  104. package/dist/runtime/store/workbenchRuntimeFacade.d.ts +3 -0
  105. package/dist/style.css +1 -1
  106. package/dist/types/index.d.ts +2 -0
  107. package/dist/useWorkbenchRuntime-CJLqEtgU.js +24062 -0
  108. package/dist/version.d.ts +1 -1
  109. package/node_modules/@fses/ai-chat/dist/fses-ai-chat.js +28256 -7528
  110. package/node_modules/@fses/ai-chat/dist/fses-ai-chat.umd.cjs +17 -17
  111. package/node_modules/@fses/ai-chat/dist/style.css +1 -1
  112. package/node_modules/@fses/ai-chat/package.json +3 -3
  113. package/node_modules/@fses/workbench-card/dist/fses-workbench-card-renderers.js +5 -5
  114. package/node_modules/@fses/workbench-card/dist/fses-workbench-card.js +5 -5
  115. package/node_modules/@fses/workbench-card/dist/fses-workbench-card.umd.cjs +1 -1
  116. package/node_modules/@fses/workbench-card/dist/types/block.d.ts +4 -1
  117. package/node_modules/@fses/workbench-card/package.json +1 -1
  118. package/node_modules/@fses/workbench-card/src/registry/cardRegistry.ts +4 -4
  119. package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.js +1 -1
  120. package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.ts +1 -1
  121. package/node_modules/@fses/workbench-card/src/types/block.ts +4 -12
  122. package/package.json +11 -3
  123. package/dist/Workspace-JvnSC-w9.js +0 -23186
  124. package/dist/index-D-WW3bXH.js +0 -829
  125. package/dist/useWorkbenchRuntime-D_AtkXIX.js +0 -23865
  126. package/dist/workbenchCustomComponentRegistry-CWUPjCnJ.js +0 -267
@@ -0,0 +1,1772 @@
1
+ import "./i18n/index.js";
2
+ import { toRefs as Fe, shallowReadonly as Y, inject as ye, defineComponent as M, provide as G, openBlock as k, createElementBlock as W, renderSlot as O, createElementVNode as D, normalizeClass as ie, normalizeStyle as q, withModifiers as He, unref as J, createCommentVNode as U, createVNode as T, Transition as $e, withCtx as H, shallowRef as re, onMounted as ke, watch as Ee, onBeforeUnmount as L, toDisplayString as Ke, createBlock as V, resolveDynamicComponent as ne, Fragment as qe, renderList as Ue, computed as Ie, defineAsyncComponent as Q, ref as xe, h as Le } from "vue";
3
+ import { d as u, f as Ae, g as _e, h as Re, i as Ve } from "./cardFactory-D5dyYSC3.js";
4
+ import { n as Ge, w as ze } from "./normalizeWorkbenchExtensions-Ccv3n3fC.js";
5
+ import { W as Ce, a as Qe, c as je } from "./index-DkGYPLLJ.js";
6
+ import { fetchEventSource as Ye } from "@microsoft/fetch-event-source";
7
+ import { r as Je, e as Xe, d as Ze, f as et, g as tt, c as rt, a as nt, W as ot, h as st } from "./useWorkbenchRuntime-CJLqEtgU.js";
8
+ import "./canvasFacade-ZFqB_i7z.js";
9
+ import { useRoute as at } from "vue-router";
10
+ const it = "0.2.21", ce = "workbench-app-version";
11
+ function ct() {
12
+ if (typeof document > "u" || document.querySelector(`meta[name="${ce}"]`)) return !1;
13
+ const e = document.createElement("meta");
14
+ return e.name = ce, e.content = it, document.head.appendChild(e), !0;
15
+ }
16
+ ct();
17
+ const We = Symbol("workbench-app-context");
18
+ function dt(e) {
19
+ const { adapters: t, config: r, extensions: n } = Fe(e);
20
+ return {
21
+ adapters: Y(t),
22
+ config: Y(r),
23
+ extensions: Y(n)
24
+ };
25
+ }
26
+ function an() {
27
+ const e = ye(We);
28
+ if (!e)
29
+ throw new Error("useWorkbenchAppContext must be used inside WorkbenchWorkspaceCore");
30
+ return e;
31
+ }
32
+ const lt = { class: "fses-workbench-app" }, ut = /* @__PURE__ */ M({
33
+ __name: "WorkbenchWorkspaceCore",
34
+ props: {
35
+ adapters: {},
36
+ config: {},
37
+ extensions: {}
38
+ },
39
+ setup(e) {
40
+ return G(We, dt(e)), (r, n) => (k(), W("div", lt, [
41
+ O(r.$slots, "default")
42
+ ]));
43
+ }
44
+ }), oe = Symbol("workbench-host-context");
45
+ function j() {
46
+ const e = ye(oe);
47
+ if (!e) throw new Error("useWorkbenchHostContext must be used inside a workbench host root");
48
+ return e;
49
+ }
50
+ const ft = { class: "workbench-shell" }, ht = ["aria-label"], mt = ["aria-hidden", "inert"], pt = { class: "workbench-studio-panel__body" }, gt = ["aria-label"], de = 48, bt = /* @__PURE__ */ M({
51
+ __name: "WorkbenchShell",
52
+ props: {
53
+ studioPanelWidth: {},
54
+ studioPanelCollapsed: { type: Boolean },
55
+ studioPanelEnabled: { type: Boolean },
56
+ drawerOpen: { type: Boolean },
57
+ drawerWidth: {},
58
+ dragging: { type: Boolean },
59
+ canvasFocusMode: { type: Boolean },
60
+ imageWorkbench: { type: Boolean }
61
+ },
62
+ emits: ["startDrag"],
63
+ setup(e, { emit: t }) {
64
+ const r = t;
65
+ return (n, o) => (k(), W("div", ft, [
66
+ D("div", {
67
+ class: ie(["workbench-shell__body", { "workbench-shell__body--dragging": e.dragging }])
68
+ }, [
69
+ D("div", {
70
+ class: "workbench-shell__canvas-pane",
71
+ style: q({
72
+ flexBasis: e.drawerOpen ? `calc(100% - ${e.drawerWidth || 392}px)` : e.canvasFocusMode || !e.studioPanelEnabled ? "100%" : e.studioPanelCollapsed ? `calc(100% - ${de}px)` : `calc(100% - ${e.studioPanelWidth}px - 8px)`
73
+ })
74
+ }, [
75
+ O(n.$slots, "left", {}, void 0, !0)
76
+ ], 4),
77
+ e.studioPanelEnabled && !e.studioPanelCollapsed && !e.canvasFocusMode && !e.drawerOpen ? (k(), W("div", {
78
+ key: 0,
79
+ "aria-orientation": "vertical",
80
+ "data-i18n-aria-label": "FWA.8cb91787571066462",
81
+ "aria-label": J(u)("FWA.8cb91787571066462"),
82
+ class: "workbench-splitter",
83
+ role: "separator",
84
+ onPointerdown: o[0] || (o[0] = (s) => r("startDrag", s)),
85
+ onDragstart: o[1] || (o[1] = He(() => {
86
+ }, ["prevent"]))
87
+ }, [...o[2] || (o[2] = [
88
+ D("div", { class: "workbench-splitter__track" }, null, -1)
89
+ ])], 40, ht)) : U("", !0),
90
+ e.studioPanelEnabled && !e.canvasFocusMode && !e.drawerOpen ? (k(), W("div", {
91
+ key: 1,
92
+ class: ie(["workbench-studio-panel", { "workbench-studio-panel--collapsed": e.studioPanelCollapsed }]),
93
+ style: q({ flexBasis: e.studioPanelCollapsed ? "0px" : `${e.studioPanelWidth}px` }),
94
+ "aria-hidden": e.studioPanelCollapsed ? "true" : void 0,
95
+ inert: e.studioPanelCollapsed ? !0 : void 0
96
+ }, [
97
+ D("div", pt, [
98
+ O(n.$slots, "right", {}, void 0, !0)
99
+ ])
100
+ ], 14, mt)) : U("", !0),
101
+ T($e, { name: "workbench-assistant-rail-shell" }, {
102
+ default: H(() => [
103
+ e.studioPanelEnabled && e.studioPanelCollapsed && !e.canvasFocusMode && !e.drawerOpen ? (k(), W("div", {
104
+ key: 0,
105
+ class: "workbench-assistant-rail-shell",
106
+ style: q({ flexBasis: `${de}px` }),
107
+ "data-i18n-aria-label": "FWA.f0e91787570935726",
108
+ "aria-label": J(u)("FWA.f0e91787570935726")
109
+ }, [
110
+ O(n.$slots, "collapsed-right", {}, void 0, !0)
111
+ ], 12, gt)) : U("", !0)
112
+ ]),
113
+ _: 3
114
+ }),
115
+ e.drawerOpen ? (k(), W("div", {
116
+ key: 2,
117
+ class: "workbench-shell__drawer",
118
+ style: q({ flexBasis: `${e.drawerWidth || 392}px` })
119
+ }, [
120
+ O(n.$slots, "drawer", {}, void 0, !0)
121
+ ], 4)) : U("", !0)
122
+ ], 2)
123
+ ]));
124
+ }
125
+ }), se = (e, t) => {
126
+ const r = e.__vccOpts || e;
127
+ for (const [n, o] of t)
128
+ r[n] = o;
129
+ return r;
130
+ }, wt = /* @__PURE__ */ se(bt, [["__scopeId", "data-v-1cfa390d"]]), yt = ["aria-label"], kt = { class: "workbench-extension-drawer__header" }, Et = { class: "workbench-extension-drawer__title" }, It = { class: "workbench-extension-drawer__body" }, At = /* @__PURE__ */ M({
131
+ __name: "WorkbenchDrawerOutlet",
132
+ props: {
133
+ drawerId: {},
134
+ onClose: { type: Function }
135
+ },
136
+ setup(e) {
137
+ const t = e, r = j(), n = re(null);
138
+ let o = !1;
139
+ async function s() {
140
+ var a;
141
+ await r.ready, !o && (n.value = t.drawerId && ((a = r.kernel.drawers.get(t.drawerId)) == null ? void 0 : a.contribution) || null);
142
+ }
143
+ return ke(() => {
144
+ s().catch((a) => {
145
+ r.services.loggerAdapter.error("Workbench drawer contribution failed to load", {
146
+ drawerId: t.drawerId,
147
+ message: a instanceof Error ? a.message : String(a)
148
+ });
149
+ });
150
+ }), Ee(() => t.drawerId, () => {
151
+ s();
152
+ }), L(() => {
153
+ o = !0, n.value = null;
154
+ }), (a, i) => n.value ? (k(), W("aside", {
155
+ key: 0,
156
+ class: "workbench-extension-drawer",
157
+ style: q({ width: `${n.value.defaultWidth || 392}px` }),
158
+ "aria-label": n.value.title
159
+ }, [
160
+ D("header", kt, [
161
+ D("h2", Et, Ke(n.value.title), 1),
162
+ D("button", {
163
+ type: "button",
164
+ class: "workbench-extension-drawer__close",
165
+ "aria-label": "Close",
166
+ onClick: i[0] || (i[0] = (d) => {
167
+ var c;
168
+ return (c = t.onClose) == null ? void 0 : c.call(t);
169
+ })
170
+ }, " × ")
171
+ ]),
172
+ D("div", It, [
173
+ (k(), V(ne(n.value.component)))
174
+ ])
175
+ ], 12, yt)) : U("", !0);
176
+ }
177
+ }), _t = /* @__PURE__ */ se(At, [["__scopeId", "data-v-5f390de6"]]);
178
+ function Rt(e, t, r) {
179
+ return e.filter((n) => {
180
+ var o;
181
+ if (n.slot !== t) return !1;
182
+ try {
183
+ return ((o = n.when) == null ? void 0 : o.call(n)) !== !1;
184
+ } catch (s) {
185
+ return r == null || r(n.id, s), !1;
186
+ }
187
+ });
188
+ }
189
+ const F = /* @__PURE__ */ M({
190
+ __name: "WorkbenchSlotOutlet",
191
+ props: {
192
+ slotName: {}
193
+ },
194
+ setup(e) {
195
+ const t = e, r = j(), n = re([]);
196
+ async function o() {
197
+ await r.ready, n.value = Rt(
198
+ r.kernel.slots.list().map((s) => s.contribution),
199
+ t.slotName,
200
+ (s, a) => {
201
+ r.services.loggerAdapter.warn("Workbench slot condition failed", {
202
+ contributionId: s,
203
+ message: a instanceof Error ? a.message : String(a),
204
+ slotName: t.slotName
205
+ });
206
+ }
207
+ );
208
+ }
209
+ return ke(() => {
210
+ o().catch((s) => {
211
+ var a;
212
+ (a = r.services.loggerAdapter) == null || a.error("Workbench slot contributions failed to load", {
213
+ message: s instanceof Error ? s.message : String(s),
214
+ slotName: t.slotName
215
+ });
216
+ });
217
+ }), (s, a) => (k(!0), W(qe, null, Ue(n.value, (i) => (k(), V(ne(i.component), {
218
+ key: i.id
219
+ }))), 128));
220
+ }
221
+ }), cn = /* @__PURE__ */ M({
222
+ __name: "WorkbenchAppHost",
223
+ props: {
224
+ adapters: {},
225
+ config: {},
226
+ extensions: {},
227
+ runtime: {}
228
+ },
229
+ setup(e) {
230
+ const t = e, r = j();
231
+ function n(i) {
232
+ if (!i || typeof i != "object") return "";
233
+ const d = i.drawerId;
234
+ return typeof d == "string" ? d.trim() : "";
235
+ }
236
+ const o = r.kernel.events.on("workbench.drawer.open", (i) => {
237
+ var c, l;
238
+ const d = n(i);
239
+ d && ((l = (c = t.runtime).openDrawer) == null || l.call(c, d));
240
+ }), s = r.kernel.events.on("workbench.drawer.close", () => {
241
+ var i, d;
242
+ (d = (i = t.runtime).closeDrawer) == null || d.call(i);
243
+ });
244
+ L(() => {
245
+ o.dispose(), s.dispose();
246
+ });
247
+ const a = Ie(() => ({
248
+ canvasFocusMode: t.runtime.canvasFocusMode ?? !1,
249
+ drawerOpen: t.runtime.drawerOpen ?? !1,
250
+ drawerWidth: t.runtime.drawerWidth,
251
+ dragging: t.runtime.dragging ?? !1,
252
+ imageWorkbench: t.runtime.imageWorkbench ?? !1,
253
+ studioPanelCollapsed: t.runtime.studioPanelCollapsed ?? !1,
254
+ studioPanelEnabled: t.runtime.studioPanelEnabled ?? !0,
255
+ studioPanelWidth: t.runtime.studioPanelWidth ?? 420
256
+ }));
257
+ return (i, d) => (k(), V(ut, {
258
+ adapters: t.adapters,
259
+ config: t.config,
260
+ extensions: t.extensions
261
+ }, {
262
+ default: H(() => [
263
+ T(wt, {
264
+ "canvas-focus-mode": a.value.canvasFocusMode,
265
+ "drawer-open": a.value.drawerOpen,
266
+ "drawer-width": a.value.drawerWidth,
267
+ dragging: a.value.dragging,
268
+ "image-workbench": a.value.imageWorkbench,
269
+ "studio-panel-collapsed": a.value.studioPanelCollapsed,
270
+ "studio-panel-enabled": a.value.studioPanelEnabled,
271
+ "studio-panel-width": a.value.studioPanelWidth,
272
+ onStartDrag: d[0] || (d[0] = (c) => {
273
+ var l, b;
274
+ return (b = (l = t.runtime).startStudioPanelDrag) == null ? void 0 : b.call(l, c);
275
+ })
276
+ }, {
277
+ left: H(() => [
278
+ T(F, { "slot-name": "workspace.header.actions" }),
279
+ T(F, { "slot-name": "canvas.toolbar" }),
280
+ O(i.$slots, "left")
281
+ ]),
282
+ right: H(() => [
283
+ T(F, { "slot-name": "studio.toolbar" }),
284
+ T(F, { "slot-name": "studio.settings" }),
285
+ O(i.$slots, "right"),
286
+ T(F, { "slot-name": "studio.footer" })
287
+ ]),
288
+ "collapsed-right": H(() => [
289
+ O(i.$slots, "collapsed-right")
290
+ ]),
291
+ drawer: H(() => [
292
+ T(_t, {
293
+ "drawer-id": t.runtime.drawerId,
294
+ "on-close": t.runtime.closeDrawer
295
+ }, null, 8, ["drawer-id", "on-close"]),
296
+ O(i.$slots, "drawer"),
297
+ T(F, { "slot-name": "drawer.footer" })
298
+ ]),
299
+ _: 3
300
+ }, 8, ["canvas-focus-mode", "drawer-open", "drawer-width", "dragging", "image-workbench", "studio-panel-collapsed", "studio-panel-enabled", "studio-panel-width"])
301
+ ]),
302
+ _: 3
303
+ }, 8, ["adapters", "config", "extensions"]));
304
+ }
305
+ }), Ct = "workbench.builtin.card-center", Wt = "workbench.card-center", le = "workbench.card-center.drawer", vt = "workbench.card-center.open", dn = "workbench.card-center.insert-system-card", ln = "workbench.card-center.insert-custom-card", un = "workbench.card-center.config-dialog-change", St = Q(
306
+ () => import("./WorkbenchCardCenterDrawer-BxRFAZDG.js")
307
+ );
308
+ function Pt() {
309
+ return {
310
+ id: Ct,
311
+ kernelApiVersion: 1,
312
+ requires: {
313
+ plugins: ["workbench.core.drawer-commands"]
314
+ },
315
+ setup(e) {
316
+ e.capabilities.register({
317
+ id: Wt,
318
+ version: 1
319
+ }), e.drawers.register({
320
+ component: St,
321
+ defaultWidth: 400,
322
+ id: le,
323
+ title: u("FWA.3ade1787571500868")
324
+ }), e.commands.register({
325
+ id: vt,
326
+ execute: () => e.commands.execute(Ce, {
327
+ drawerId: le
328
+ })
329
+ });
330
+ },
331
+ version: "1.0.0"
332
+ };
333
+ }
334
+ const Tt = "workbench.optional.diagnostics", Nt = "workbench.diagnostics.route", Ot = "workbench.diagnostics.refresh", Dt = "workbench.diagnostics.refreshed", ue = Q(() => import("./WorkbenchDiagnosticsPage-OdYSvQ2O.js")), Mt = Q(() => import("./WorkbenchDiagnosticsFooter-BXQJLBMu.js"));
335
+ function Bt() {
336
+ return {
337
+ id: Tt,
338
+ kernelApiVersion: 1,
339
+ /**
340
+ * 释放诊断插件资源;当前贡献均由注册作用域托管,无额外资源需要清理。
341
+ * @returns Nothing.
342
+ */
343
+ dispose() {
344
+ },
345
+ setup(e) {
346
+ var t;
347
+ if (((t = e.config.features) == null ? void 0 : t.debugRoutes) === !0 && (e.routes.register({
348
+ id: Nt,
349
+ loadComponent: async () => ue,
350
+ path: "diagnostics"
351
+ }), e.slots.register({
352
+ component: Mt,
353
+ id: "workbench.diagnostics.footer",
354
+ slot: "studio.footer"
355
+ }), e.drawers.register({
356
+ component: ue,
357
+ defaultWidth: 480,
358
+ id: Qe,
359
+ title: "运行态诊断"
360
+ }), e.commands.register({
361
+ id: Ot,
362
+ execute: async (r, n) => (n.services.loggerAdapter.info("Workbench diagnostics refreshed", {
363
+ instanceId: n.instanceId
364
+ }), await e.events.emit(Dt, {
365
+ instanceId: n.instanceId
366
+ }), e.instanceId)
367
+ }), !e.commands.has(Ce)))
368
+ throw new Error("WORKBENCH_DRAWER_OPEN_COMMAND_UNAVAILABLE");
369
+ },
370
+ version: "1.0.0"
371
+ };
372
+ }
373
+ const Ft = "workbench.builtin.settings", Ht = "workbench.settings", $t = "workbench.settings.open", Kt = "workbench.settings.close", qt = "workbench.settings.save", Ut = "workbench.settings.open-requested", xt = "workbench.settings.close-requested", Lt = "workbench.settings.save-requested";
374
+ function Vt() {
375
+ return {
376
+ id: Ft,
377
+ kernelApiVersion: 1,
378
+ setup(e) {
379
+ e.capabilities.register({ id: Ht, version: 1 }), e.commands.register({
380
+ id: $t,
381
+ execute: async () => (await e.events.emit(Ut), { opened: !0 })
382
+ }), e.commands.register({
383
+ id: Kt,
384
+ execute: async () => (await e.events.emit(xt), { closed: !0 })
385
+ }), e.commands.register({
386
+ id: qt,
387
+ execute: async (t) => (await e.events.emit(Lt, t), { requested: !0 })
388
+ });
389
+ },
390
+ version: "1.0.0"
391
+ };
392
+ }
393
+ const Gt = "workbench.builtin.theme", zt = "workbench.theme", Qt = "workbench.theme.apply", jt = "workbench.theme.apply-requested";
394
+ function Yt(e) {
395
+ const t = e && typeof e == "object" ? e.themeKey : void 0;
396
+ if (typeof t != "string" || !t.trim())
397
+ throw new Error("WORKBENCH_THEME_KEY_REQUIRED");
398
+ return t.trim();
399
+ }
400
+ function Jt() {
401
+ return {
402
+ id: Gt,
403
+ kernelApiVersion: 1,
404
+ setup(e) {
405
+ e.capabilities.register({ id: zt, version: 1 }), e.commands.register({
406
+ id: Qt,
407
+ execute: async (t) => {
408
+ const n = { themeKey: Yt(t) };
409
+ return await e.events.emit(jt, n), n;
410
+ }
411
+ });
412
+ },
413
+ version: "1.0.0"
414
+ };
415
+ }
416
+ const Xt = [
417
+ {
418
+ criticality: "core",
419
+ plugin: je()
420
+ },
421
+ {
422
+ criticality: "optional",
423
+ plugin: Pt()
424
+ },
425
+ {
426
+ criticality: "optional",
427
+ plugin: Jt()
428
+ },
429
+ {
430
+ criticality: "optional",
431
+ plugin: Vt()
432
+ },
433
+ {
434
+ criticality: "optional",
435
+ plugin: Bt()
436
+ }
437
+ ];
438
+ function Zt(e) {
439
+ if (e !== void 0)
440
+ return typeof e == "string" ? e : JSON.stringify(e);
441
+ }
442
+ function er(e) {
443
+ try {
444
+ return JSON.parse(e);
445
+ } catch {
446
+ return e;
447
+ }
448
+ }
449
+ const tr = {
450
+ async openEventStream(e) {
451
+ await Ye(e.url, {
452
+ body: Zt(e.body),
453
+ headers: {
454
+ ...e.headers,
455
+ ...e.lastEventId ? { "Last-Event-ID": e.lastEventId } : {}
456
+ },
457
+ method: e.method || "POST",
458
+ onmessage(t) {
459
+ t.data && e.onEvent(er(t.data), { id: t.id });
460
+ },
461
+ async onopen(t) {
462
+ var r;
463
+ if (!t.ok) throw new Error(`HTTP ${t.status}`);
464
+ (r = e.onOpen) == null || r.call(e);
465
+ },
466
+ onerror(t) {
467
+ var r;
468
+ throw (r = e.onError) == null || r.call(e, t instanceof Error ? t : new Error(String(t))), t;
469
+ },
470
+ openWhenHidden: e.openWhenHidden,
471
+ signal: e.signal
472
+ });
473
+ },
474
+ requestJson(e) {
475
+ return Je({
476
+ headers: e.headers,
477
+ method: e.method,
478
+ payload: e.body,
479
+ signal: e.signal,
480
+ url: e.url
481
+ });
482
+ }
483
+ }, ve = {
484
+ ensureSessionReady: Xe,
485
+ requestJson(e) {
486
+ return Ze({
487
+ headers: e.headers,
488
+ method: e.method,
489
+ params: e.params,
490
+ payload: e.payload,
491
+ signal: e.signal,
492
+ url: e.url
493
+ });
494
+ }
495
+ };
496
+ function rr(e) {
497
+ const t = {}, r = new URLSearchParams(e.replace(/^\?/, ""));
498
+ for (const [n, o] of r.entries()) {
499
+ const s = t[n];
500
+ t[n] = s === void 0 ? o : Array.isArray(s) ? [...s, o] : [s, o];
501
+ }
502
+ return t;
503
+ }
504
+ function nr() {
505
+ return {
506
+ push(e) {
507
+ typeof window > "u" || window.history.pushState({}, "", e);
508
+ },
509
+ readQuery() {
510
+ return typeof window > "u" ? {} : rr(window.location.search);
511
+ },
512
+ replaceQuery(e) {
513
+ if (typeof window > "u") return;
514
+ const t = new URL(window.location.href);
515
+ t.search = "";
516
+ for (const [r, n] of Object.entries(e))
517
+ n !== void 0 && t.searchParams.set(r, n);
518
+ window.history.replaceState({}, "", t);
519
+ }
520
+ };
521
+ }
522
+ function or() {
523
+ const e = /* @__PURE__ */ new Map(), t = (() => {
524
+ try {
525
+ return globalThis.localStorage;
526
+ } catch {
527
+ return;
528
+ }
529
+ })();
530
+ return {
531
+ getItem(r) {
532
+ return (t == null ? void 0 : t.getItem(r)) ?? e.get(r) ?? null;
533
+ },
534
+ removeItem(r) {
535
+ t == null || t.removeItem(r), e.delete(r);
536
+ },
537
+ setItem(r, n) {
538
+ t == null || t.setItem(r, n), e.set(r, n);
539
+ }
540
+ };
541
+ }
542
+ function sr(e) {
543
+ return {
544
+ readIdentity: () => ve.requestJson({
545
+ headers: { "Content-Type": "application/json" },
546
+ method: "GET",
547
+ url: e.resolve("workbench.identity")
548
+ })
549
+ };
550
+ }
551
+ const ar = {
552
+ uploadFile(e, t) {
553
+ if (!(t != null && t.url)) throw new Error("WORKBENCH_UPLOAD_URL_REQUIRED");
554
+ return et({
555
+ file: e,
556
+ filename: t.fileName,
557
+ url: t.url
558
+ });
559
+ }
560
+ };
561
+ function fe(e, t) {
562
+ var n;
563
+ const r = (n = e == null ? void 0 : e[t]) == null ? void 0 : n.trim();
564
+ if (!r) throw new Error(`WORKBENCH_REALTIME_PARAM_REQUIRED:${t}`);
565
+ return r;
566
+ }
567
+ const ir = {
568
+ connect(e) {
569
+ const t = fe(e.params, "workspaceId"), r = fe(e.params, "userId"), n = tt({
570
+ baseUrl: e.channel,
571
+ onEvent: (o) => e.onEvent(o),
572
+ socketPath: e.socketPath,
573
+ userId: r,
574
+ workspaceId: t
575
+ });
576
+ return n.connect(), {
577
+ disconnect: () => n.disconnect(),
578
+ requestSnapshot: () => n.requestSnapshot()
579
+ };
580
+ }
581
+ };
582
+ function Se(e = {}) {
583
+ return {
584
+ resolve(t, r) {
585
+ var s;
586
+ const n = ((s = e.endpoints) == null ? void 0 : s[t]) || t, o = Object.entries(r || {}).filter(([, a]) => a !== void 0).map(([a, i]) => `${encodeURIComponent(a)}=${encodeURIComponent(String(i))}`).join("&");
587
+ return o ? `${n}${n.includes("?") ? "&" : "?"}${o}` : n;
588
+ }
589
+ };
590
+ }
591
+ const fn = Se();
592
+ function cr(e, t = {}) {
593
+ const r = e.endpointResolver ?? Se(t);
594
+ return {
595
+ ...e,
596
+ agentTransportAdapter: e.agentTransportAdapter ?? tr,
597
+ assetAdapter: e.assetAdapter ?? Re,
598
+ endpointResolver: r,
599
+ loggerAdapter: e.loggerAdapter ?? _e,
600
+ messageAdapter: e.messageAdapter ?? Ae,
601
+ platformRequestAdapter: e.platformRequestAdapter ?? ve,
602
+ realtimeAdapter: e.realtimeAdapter ?? ir,
603
+ identityAdapter: e.identityAdapter ?? sr(r),
604
+ routerAdapter: e.routerAdapter ?? nr(),
605
+ storageAdapter: e.storageAdapter ?? or(),
606
+ uploadAdapter: e.uploadAdapter ?? ar,
607
+ transportMode: t.transportMode ?? "adapter"
608
+ };
609
+ }
610
+ function Pe(e = {}) {
611
+ const t = /* @__PURE__ */ new Map(), r = e.duplicatePolicy ?? "preserve-first";
612
+ return {
613
+ clear() {
614
+ t.clear();
615
+ },
616
+ get(n) {
617
+ return t.get(n);
618
+ },
619
+ has(n) {
620
+ return t.has(n);
621
+ },
622
+ list() {
623
+ return [...t.values()].sort((n, o) => (n.contribution.order ?? 0) - (o.contribution.order ?? 0) || n.contribution.id.localeCompare(o.contribution.id));
624
+ },
625
+ register(n, o) {
626
+ var d;
627
+ const s = t.get(o.id);
628
+ if (s && s.contribution.overridable !== !0) {
629
+ const c = {
630
+ id: o.id,
631
+ existingOwnerId: s.ownerId,
632
+ existingContribution: s.contribution,
633
+ incomingOwnerId: n,
634
+ incomingContribution: o
635
+ };
636
+ if ((d = e.onConflict) == null || d.call(e, c), r === "throw")
637
+ throw new Error(`Duplicate workbench contribution: ${o.id}`);
638
+ return { active: !1, dispose: () => {
639
+ } };
640
+ }
641
+ const a = { contribution: o, ownerId: n };
642
+ t.set(o.id, a);
643
+ let i = !0;
644
+ return {
645
+ active: !0,
646
+ dispose() {
647
+ i && (i = !1, t.get(o.id) === a && (s ? t.set(o.id, s) : t.delete(o.id)));
648
+ }
649
+ };
650
+ }
651
+ };
652
+ }
653
+ function dr(e, t = Pe()) {
654
+ return {
655
+ async execute(r, n) {
656
+ var s;
657
+ const o = (s = t.get(r)) == null ? void 0 : s.contribution;
658
+ if (!o) throw new Error(`Workbench command not found: ${r}`);
659
+ return await o.execute(n, e);
660
+ },
661
+ has(r) {
662
+ return t.has(r);
663
+ },
664
+ register(r, n) {
665
+ return t.register(r, n);
666
+ }
667
+ };
668
+ }
669
+ function lr() {
670
+ const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), r = [];
671
+ return {
672
+ recordContribution(n) {
673
+ t.set(`${n.type}:${n.id}:${n.ownerId}`, { ...n });
674
+ },
675
+ recordPlugin(n) {
676
+ e.set(n.id, { ...n });
677
+ },
678
+ snapshot() {
679
+ return {
680
+ contributions: [...t.values()].sort((n, o) => `${n.type}:${n.id}:${n.ownerId}`.localeCompare(`${o.type}:${o.id}:${o.ownerId}`)),
681
+ plugins: [...e.values()].sort((n, o) => n.id.localeCompare(o.id)),
682
+ warnings: [...r]
683
+ };
684
+ },
685
+ warn(n) {
686
+ r.push(n);
687
+ }
688
+ };
689
+ }
690
+ function ur(e) {
691
+ const t = /* @__PURE__ */ new Map();
692
+ return {
693
+ async emit(r, n) {
694
+ const o = [...t.get(r) ?? []];
695
+ await Promise.all(o.map(async (s) => {
696
+ try {
697
+ await s(n);
698
+ } catch (a) {
699
+ e == null || e(r, a);
700
+ }
701
+ }));
702
+ },
703
+ on(r, n) {
704
+ const o = t.get(r) ?? /* @__PURE__ */ new Set();
705
+ o.add(n), t.set(r, o);
706
+ let s = !0;
707
+ return {
708
+ active: !0,
709
+ dispose() {
710
+ s && (s = !1, o.delete(n), o.size === 0 && t.delete(r));
711
+ }
712
+ };
713
+ }
714
+ };
715
+ }
716
+ function fr() {
717
+ const e = [];
718
+ let t = !1;
719
+ return {
720
+ dispose() {
721
+ if (!t) {
722
+ t = !0;
723
+ for (const r of [...e].reverse())
724
+ r.dispose();
725
+ e.length = 0;
726
+ }
727
+ },
728
+ track(r) {
729
+ return t ? (r.dispose(), { active: !1, dispose: () => {
730
+ } }) : (e.push(r), r);
731
+ }
732
+ };
733
+ }
734
+ function he(e) {
735
+ return e instanceof Error ? e.message : String(e);
736
+ }
737
+ function hr(e) {
738
+ const t = [], r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
739
+ function o(s) {
740
+ var i;
741
+ if (n.has(s)) return;
742
+ if (r.has(s)) throw new Error(`Circular workbench plugin dependency: ${s}`);
743
+ const a = e.get(s);
744
+ if (a) {
745
+ r.add(s);
746
+ for (const d of [...((i = a.plugin.requires) == null ? void 0 : i.plugins) ?? []].sort())
747
+ o(d);
748
+ r.delete(s), n.add(s), t.push(a);
749
+ }
750
+ }
751
+ for (const s of [...e.keys()].sort()) o(s);
752
+ return t;
753
+ }
754
+ function mr(e) {
755
+ const t = /* @__PURE__ */ new Map(), r = [];
756
+ let n = !1, o = !1;
757
+ function s(i) {
758
+ if (n || o) throw new Error("Workbench plugins must be registered before initialization");
759
+ if (t.has(i.plugin.id))
760
+ throw new Error(`Duplicate workbench plugin: ${i.plugin.id}`);
761
+ t.set(i.plugin.id, i), e.diagnostics.recordPlugin({
762
+ id: i.plugin.id,
763
+ status: "registered",
764
+ version: i.plugin.version
765
+ });
766
+ }
767
+ async function a() {
768
+ var i, d;
769
+ for (const c of [...r].reverse())
770
+ try {
771
+ await ((d = (i = c.registration.plugin).dispose) == null ? void 0 : d.call(i));
772
+ } catch (l) {
773
+ e.diagnostics.warn(
774
+ `Plugin dispose failed: ${c.registration.plugin.id}: ${he(l)}`
775
+ );
776
+ } finally {
777
+ c.scope.dispose();
778
+ }
779
+ r.length = 0;
780
+ }
781
+ return {
782
+ async dispose() {
783
+ o || (o = !0, await a());
784
+ },
785
+ async initialize(i = {}) {
786
+ var l, b, A, P;
787
+ if (o) throw new Error("Workbench plugin manager is disposed");
788
+ if (n) return;
789
+ n = !0;
790
+ const d = new Set(i.disabledPluginIds ?? []), c = /* @__PURE__ */ new Set();
791
+ for (const S of hr(t)) {
792
+ const { plugin: h } = S;
793
+ if (S.criticality === "optional" && h.remoteConfigurable === !0 && d.has(h.id)) {
794
+ e.diagnostics.recordPlugin({
795
+ id: h.id,
796
+ reason: "disabled by remote capability config",
797
+ status: "disabled",
798
+ version: h.version
799
+ });
800
+ continue;
801
+ }
802
+ const B = (b = (l = h.requires) == null ? void 0 : l.plugins) == null ? void 0 : b.find((y) => !c.has(y));
803
+ if (B) {
804
+ const y = new Error(`Missing active workbench plugin dependency: ${h.id} -> ${B}`);
805
+ if (e.diagnostics.recordPlugin({
806
+ id: h.id,
807
+ reason: y.message,
808
+ status: S.criticality === "core" ? "failed" : "disabled",
809
+ version: h.version
810
+ }), S.criticality === "core")
811
+ throw await a(), y;
812
+ continue;
813
+ }
814
+ const p = fr(), g = e.createContext(h.id, p), f = (P = (A = h.requires) == null ? void 0 : A.capabilities) == null ? void 0 : P.find(
815
+ (y) => !g.capabilities.isEnabled(y)
816
+ );
817
+ if (f) {
818
+ p.dispose();
819
+ const y = new Error(`Missing workbench capability dependency: ${h.id} -> ${f}`);
820
+ if (e.diagnostics.recordPlugin({
821
+ id: h.id,
822
+ reason: y.message,
823
+ status: S.criticality === "core" ? "failed" : "disabled",
824
+ version: h.version
825
+ }), S.criticality === "core")
826
+ throw await a(), y;
827
+ continue;
828
+ }
829
+ try {
830
+ await h.setup(g), r.push({ registration: S, scope: p }), c.add(h.id), e.diagnostics.recordPlugin({ id: h.id, status: "active", version: h.version });
831
+ } catch (y) {
832
+ if (p.dispose(), e.diagnostics.recordPlugin({
833
+ id: h.id,
834
+ reason: he(y),
835
+ status: "failed",
836
+ version: h.version
837
+ }), S.criticality === "core")
838
+ throw await a(), y;
839
+ }
840
+ }
841
+ },
842
+ registerBuiltIn(i, d) {
843
+ s({
844
+ criticality: d.criticality,
845
+ plugin: i,
846
+ source: "built-in"
847
+ });
848
+ },
849
+ registerHost(i) {
850
+ s({ criticality: "optional", plugin: i, source: "host" });
851
+ }
852
+ };
853
+ }
854
+ function $(e, t, r) {
855
+ const n = Pe({
856
+ duplicatePolicy: t ? "throw" : "preserve-first",
857
+ onConflict(o) {
858
+ r.recordContribution({
859
+ id: o.id,
860
+ ownerId: o.incomingOwnerId,
861
+ reason: `conflicts with ${o.existingOwnerId}`,
862
+ status: "conflict",
863
+ type: e
864
+ });
865
+ }
866
+ });
867
+ return {
868
+ raw: n,
869
+ owned: {
870
+ get: (o) => n.get(o),
871
+ has: (o) => n.has(o),
872
+ list: () => n.list(),
873
+ register(o, s) {
874
+ const a = n.register(o, s);
875
+ return a.active && r.recordContribution({
876
+ id: s.id,
877
+ ownerId: o,
878
+ status: "active",
879
+ type: e
880
+ }), a;
881
+ }
882
+ }
883
+ };
884
+ }
885
+ function pr(e = {}) {
886
+ const t = lr(), r = e.strictRegistrations === !0, n = e.config ?? {}, o = cr(e.services ?? {}, {
887
+ endpoints: n.endpoints,
888
+ transportMode: n.transportMode
889
+ }), s = e.instanceId ?? "workbench-kernel", a = rt(s), i = $("route", r, t), d = $("slot", r, t), c = $("drawer", r, t), l = $("card", r, t), b = $("capability", r, t), A = $("command", r, t), P = dr(
890
+ { config: n, instanceId: s, services: o },
891
+ A.raw
892
+ ), S = ur((p, g) => {
893
+ const f = g instanceof Error ? g.message : String(g);
894
+ t.warn(`Event listener failed: ${p}: ${f}`);
895
+ }), h = {
896
+ ...b.owned,
897
+ isEnabled(p) {
898
+ var f;
899
+ const g = (f = b.raw.get(p)) == null ? void 0 : f.contribution;
900
+ return g ? typeof g.enabled == "function" ? g.enabled() : g.enabled !== !1 : !1;
901
+ }
902
+ };
903
+ function ae(p, g) {
904
+ return {
905
+ capabilities: {
906
+ has: (f) => h.has(f),
907
+ isEnabled: (f) => h.isEnabled(f),
908
+ register: (f) => g.track(h.register(p, f))
909
+ },
910
+ cards: {
911
+ register: (f) => g.track(l.owned.register(p, f))
912
+ },
913
+ commands: {
914
+ execute: (f, y) => P.execute(f, y),
915
+ has: (f) => P.has(f),
916
+ register: (f) => g.track(P.register(p, f))
917
+ },
918
+ config: n,
919
+ drawers: {
920
+ register: (f) => g.track(c.owned.register(p, f))
921
+ },
922
+ events: {
923
+ emit: (f, y) => S.emit(f, y),
924
+ on: (f, y) => g.track(S.on(f, y))
925
+ },
926
+ instanceId: s,
927
+ routes: {
928
+ register: (f) => g.track(i.owned.register(p, f))
929
+ },
930
+ runtime: a,
931
+ services: o,
932
+ slots: {
933
+ register: (f) => g.track(d.owned.register(p, f))
934
+ }
935
+ };
936
+ }
937
+ const B = mr({ createContext: ae, diagnostics: t });
938
+ return {
939
+ capabilities: h,
940
+ cards: l.owned,
941
+ commands: P,
942
+ diagnostics: t,
943
+ async dispose() {
944
+ await B.dispose(), i.raw.clear(), d.raw.clear(), c.raw.clear(), l.raw.clear(), b.raw.clear(), A.raw.clear(), a.dispose();
945
+ },
946
+ drawers: c.owned,
947
+ events: S,
948
+ initialize: (p) => B.initialize(p),
949
+ registerBuiltInPlugin: (p, g) => B.registerBuiltIn(p, g),
950
+ registerHostPlugin: (p) => B.registerHost(p),
951
+ routes: i.owned,
952
+ runtime: a,
953
+ services: o,
954
+ slots: d.owned
955
+ };
956
+ }
957
+ function gr() {
958
+ var t, r;
959
+ const e = (r = (t = globalThis.crypto) == null ? void 0 : t.randomUUID) == null ? void 0 : r.call(t);
960
+ return e ? `workbench-${e}` : `workbench-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`;
961
+ }
962
+ function br(e, t) {
963
+ var d;
964
+ const r = t.featureRoutes ?? [], n = t.slots ?? [], o = t.commands ?? [], s = t.capabilities ?? [], a = t.drawers ?? [], i = [
965
+ ...t.cardContributions ?? [],
966
+ ...(((d = t.cards) == null ? void 0 : d.customCardCatalog) ?? []).map((c, l) => ({
967
+ capabilityId: c.capabilityId,
968
+ id: `legacy.card.${c.capabilityId}`,
969
+ order: l
970
+ }))
971
+ ];
972
+ return r.length === 0 && n.length === 0 && o.length === 0 && s.length === 0 && a.length === 0 && i.length === 0 ? null : {
973
+ id: `host.manifest.${e}`,
974
+ kernelApiVersion: 1,
975
+ setup(c) {
976
+ for (const l of s) c.capabilities.register(l);
977
+ for (const l of i) c.cards.register(l);
978
+ for (const l of o) c.commands.register(l);
979
+ for (const l of a) c.drawers.register(l);
980
+ for (const l of r) c.routes.register(l);
981
+ for (const l of n) c.slots.register(l);
982
+ },
983
+ version: "1.0.0"
984
+ };
985
+ }
986
+ function Te(e, t = {}) {
987
+ const r = t.instanceId ?? gr(), n = Ge(e.extensions), o = pr({
988
+ config: e.config,
989
+ instanceId: r,
990
+ services: e.adapters,
991
+ strictRegistrations: t.strictRegistrations
992
+ });
993
+ for (const i of n.warnings) o.diagnostics.warn(i);
994
+ for (const i of t.builtInPlugins ?? Xt)
995
+ o.registerBuiltInPlugin(i.plugin, { criticality: i.criticality });
996
+ for (const i of n.manifest.plugins ?? []) o.registerHostPlugin(i);
997
+ const s = br(r, n.manifest);
998
+ s && o.registerHostPlugin(s);
999
+ const a = o.initialize({ disabledPluginIds: t.disabledPluginIds });
1000
+ return {
1001
+ config: e.config,
1002
+ dispose: () => o.dispose(),
1003
+ extensions: n.manifest,
1004
+ instanceId: r,
1005
+ kernel: o,
1006
+ ready: a,
1007
+ runtime: o.runtime,
1008
+ services: o.services
1009
+ };
1010
+ }
1011
+ const hn = /* @__PURE__ */ M({
1012
+ __name: "WorkbenchApplication",
1013
+ props: {
1014
+ adapters: {},
1015
+ config: {},
1016
+ embedInPortal: { type: Boolean, default: !1 },
1017
+ extensions: {}
1018
+ },
1019
+ setup(e) {
1020
+ const t = e, r = Te({
1021
+ adapters: t.adapters,
1022
+ config: t.config,
1023
+ extensions: t.extensions
1024
+ });
1025
+ G(oe, r);
1026
+ const n = nt(
1027
+ `workbench-runtime-${r.instanceId}`,
1028
+ {
1029
+ agentTransportAdapter: r.services.agentTransportAdapter,
1030
+ canvasBus: r.runtime.canvasBus,
1031
+ endpointResolver: r.services.endpointResolver,
1032
+ platformRequestAdapter: r.services.platformRequestAdapter,
1033
+ realtimeAdapter: r.services.realtimeAdapter,
1034
+ storageAdapter: r.services.storageAdapter,
1035
+ transportMode: r.services.transportMode
1036
+ }
1037
+ );
1038
+ G(ot, n), r.ready.catch((a) => {
1039
+ var i;
1040
+ (i = t.adapters.loggerAdapter) == null || i.error("Workbench host context initialization failed", {
1041
+ message: a instanceof Error ? a.message : String(a)
1042
+ });
1043
+ }), L(() => {
1044
+ var i;
1045
+ const a = n();
1046
+ (i = a.disposeRuntimeResources) == null || i.call(a), r.dispose();
1047
+ });
1048
+ const o = ze(r.extensions);
1049
+ Ve(t.adapters, t.config, o);
1050
+ const s = Q(() => import("./Workspace-C4Co3cIc.js"));
1051
+ return (a, i) => (k(), V(J(s), {
1052
+ "embed-in-portal": t.embedInPortal
1053
+ }, {
1054
+ "before-workbench": H(() => [
1055
+ O(a.$slots, "before-workbench"),
1056
+ T(F, { "slot-name": "workspace.before" })
1057
+ ]),
1058
+ _: 3
1059
+ }, 8, ["embed-in-portal"]));
1060
+ }
1061
+ });
1062
+ function mn(e = {}) {
1063
+ const t = /* @__PURE__ */ new Map();
1064
+ return {
1065
+ agentTransportAdapter: {
1066
+ openEventStream: async () => {
1067
+ },
1068
+ requestJson: async () => ({})
1069
+ },
1070
+ assetAdapter: Re,
1071
+ identityAdapter: {
1072
+ readIdentity: () => ({ appId: "test-app", roleId: "default", tenantId: "test-tenant", userId: "test-user" })
1073
+ },
1074
+ loggerAdapter: _e,
1075
+ messageAdapter: Ae,
1076
+ platformRequestAdapter: {
1077
+ ensureSessionReady: async () => !0,
1078
+ requestJson: async () => ({})
1079
+ },
1080
+ routerAdapter: {
1081
+ push: () => {
1082
+ },
1083
+ readQuery: () => ({}),
1084
+ replaceQuery: () => {
1085
+ }
1086
+ },
1087
+ storageAdapter: {
1088
+ getItem: (r) => t.get(r) ?? null,
1089
+ removeItem: (r) => {
1090
+ t.delete(r);
1091
+ },
1092
+ setItem: (r, n) => {
1093
+ t.set(r, n);
1094
+ }
1095
+ },
1096
+ uploadAdapter: {
1097
+ uploadFile: async () => ({})
1098
+ },
1099
+ ...e
1100
+ };
1101
+ }
1102
+ const wr = [
1103
+ "attachments",
1104
+ "cards",
1105
+ "cardRecommendationDraft",
1106
+ "defaultExpanded",
1107
+ "detail",
1108
+ "error",
1109
+ "initialEventsPending",
1110
+ "markThinking",
1111
+ "memoryCaptureDraft",
1112
+ "planDraft",
1113
+ "processInvocations",
1114
+ "processPreamble",
1115
+ "queryResultTable",
1116
+ "queryResultTables",
1117
+ "registeredCardInsertDraft",
1118
+ "removeThinking",
1119
+ "taskStateDraft",
1120
+ "thinkingProcess",
1121
+ "thinkingProcessMessages",
1122
+ "workbenchTurnId"
1123
+ ];
1124
+ function pn(e, t) {
1125
+ for (const r of wr)
1126
+ e[r] = t[r];
1127
+ }
1128
+ function yr(e) {
1129
+ const t = e.cardRecommendationDraft;
1130
+ if (!t || typeof t != "object") return "";
1131
+ const r = t.sourceTurnId;
1132
+ return typeof r == "string" && r.trim() ? r.trim() : "";
1133
+ }
1134
+ function kr(e) {
1135
+ const t = e.cardRecommendationDraft;
1136
+ if (!t || typeof t != "object") return "";
1137
+ const r = t.placementTurnId;
1138
+ return typeof r == "string" && r.trim() ? r.trim() : "";
1139
+ }
1140
+ function Ne(e) {
1141
+ const t = e.workbenchTurnId;
1142
+ return typeof t == "string" && t.trim() ? t.trim() : "";
1143
+ }
1144
+ function Oe(e) {
1145
+ if (typeof e != "string" || !e.startsWith("workbench-turn-")) return "";
1146
+ const t = ["-reply", "-conclusion-stream", "-item-", "-process-", "-task-", "-card-mutation-confirmation"];
1147
+ for (const r of t) {
1148
+ const n = e.indexOf(r, 15);
1149
+ if (n > 15) return e.slice(15, n);
1150
+ }
1151
+ return "";
1152
+ }
1153
+ function X(e, t) {
1154
+ var n;
1155
+ if (e.role !== "assistant" || !((n = e.content) != null && n.trim())) return !1;
1156
+ const r = Ne(e);
1157
+ return r ? r === t : Oe(e.id) !== t ? !1 : typeof e.id == "string" && (e.id.endsWith("-reply") || e.id.endsWith("-conclusion-stream"));
1158
+ }
1159
+ function me(e, t) {
1160
+ return !!(t && e.some((r) => X(r, t)));
1161
+ }
1162
+ function Er(e, t) {
1163
+ const r = yr(t), n = kr(t);
1164
+ return me(e, r) ? r : me(e, n) ? n : n || Ne(t) || r || Oe(t.id);
1165
+ }
1166
+ function gn(e) {
1167
+ for (const t of e.appendedMessages.values()) {
1168
+ if (!t.cardRecommendationDraft) continue;
1169
+ const r = Er(e.messages, t);
1170
+ if (!r) continue;
1171
+ const n = e.messages.indexOf(t);
1172
+ if (n < 0) continue;
1173
+ const o = e.messages.findIndex((i) => X(i, r));
1174
+ if (o < 0 || n === o + 1) continue;
1175
+ const [s] = e.messages.splice(n, 1), a = e.messages.findIndex((i) => X(i, r));
1176
+ if (a < 0) {
1177
+ e.messages.splice(n, 0, s);
1178
+ continue;
1179
+ }
1180
+ e.messages.splice(a + 1, 0, s);
1181
+ }
1182
+ }
1183
+ function Ir(e) {
1184
+ return !e.thinkingProcess;
1185
+ }
1186
+ function Ar(e) {
1187
+ const t = e.content.trim();
1188
+ if (!Ir(e)) return t;
1189
+ const r = t.replace(/完成(?:,用时 .*)?$/u, "").trim();
1190
+ return u("FWA.cc001787570980831", { p0: r });
1191
+ }
1192
+ function bn(e, t) {
1193
+ return {
1194
+ content: Ar(e),
1195
+ loading: !1,
1196
+ ...typeof e.startTime == "number" ? { startTime: e.startTime } : {},
1197
+ ...typeof e.endTime == "number" ? { endTime: e.endTime } : typeof t == "number" ? { endTime: t } : {}
1198
+ };
1199
+ }
1200
+ function N(e) {
1201
+ return e && typeof e == "object" && !Array.isArray(e) ? e : {};
1202
+ }
1203
+ function m(e) {
1204
+ return typeof e == "string" ? e.trim() : typeof e == "number" || typeof e == "boolean" ? String(e) : "";
1205
+ }
1206
+ function pe(e) {
1207
+ return Array.isArray(e) ? String(e.length) : "";
1208
+ }
1209
+ function De(e) {
1210
+ const t = N(e);
1211
+ return [
1212
+ m(t.bindingId),
1213
+ m(t.id),
1214
+ m(t.metricId),
1215
+ m(t.metricCode),
1216
+ m(t.source),
1217
+ m(t.bindingKind),
1218
+ m(t.serviceOperation),
1219
+ m(t.refreshApi),
1220
+ m(t.contractHash)
1221
+ ].join("|");
1222
+ }
1223
+ function Me(e) {
1224
+ const t = N(e), r = N(t.data);
1225
+ return [
1226
+ m(t.resultId),
1227
+ m(t.sourceTurnId),
1228
+ m(t.rowCount),
1229
+ pe(t.rows || r.rows),
1230
+ pe(t.columns || r.columns),
1231
+ De(t.dataBinding || r.dataBinding)
1232
+ ].join("|");
1233
+ }
1234
+ function _r(e) {
1235
+ const t = N(e), r = N(t.blockPlan), n = N(r.data), o = N(r.meta), s = N(o.queryResult);
1236
+ return [
1237
+ m(t.recommendationId),
1238
+ m(t.capabilityId),
1239
+ m(t.title),
1240
+ m(t.previewStatus),
1241
+ m(t.nextAction),
1242
+ m(t.dataShape),
1243
+ m(r.id),
1244
+ m(r.title),
1245
+ De(t.dataBinding || n.dataBinding),
1246
+ Me(t.queryResult || s)
1247
+ ].join(":");
1248
+ }
1249
+ function wn(e) {
1250
+ const t = N(e), r = typeof t.type == "string" ? t.type : "";
1251
+ if (r === "card_recommendations_ready") {
1252
+ const n = Array.isArray(t.recommendations) ? t.recommendations : [], o = st({
1253
+ payload: t,
1254
+ conversationId: m(t.conversationId),
1255
+ groupType: r
1256
+ });
1257
+ return [
1258
+ r,
1259
+ o.renderKey,
1260
+ m(t.sourceTurnId),
1261
+ m(t.placementTurnId),
1262
+ Me(t.queryResult),
1263
+ n.map(_r).join(",")
1264
+ ].join(":");
1265
+ }
1266
+ if (r === "query_result_table_ready") {
1267
+ const n = N(t.queryResult), o = Array.isArray(n.rows) ? n.rows.length : "", s = Array.isArray(n.columns) ? n.columns.length : "";
1268
+ return `${r}:${o}:${s}:${n.rowCount ?? ""}`;
1269
+ }
1270
+ return r;
1271
+ }
1272
+ const Rr = /* @__PURE__ */ new Set(["pending", "running"]), Cr = "/data-binding-candidate/query", Wr = "/workbench/v2/documents/", vr = "/data-bindings/";
1273
+ function Sr(e) {
1274
+ return typeof (e == null ? void 0 : e.refreshApi) == "string" ? e.refreshApi.trim() : "";
1275
+ }
1276
+ function Pr(e) {
1277
+ return e.includes(Cr);
1278
+ }
1279
+ function Be(e) {
1280
+ let t = e;
1281
+ try {
1282
+ t = new URL(e, "http://localhost").pathname;
1283
+ } catch {
1284
+ t = e;
1285
+ }
1286
+ return t.includes(Wr) && t.includes(vr);
1287
+ }
1288
+ function Z(e) {
1289
+ return !!(e && typeof e == "object" && !Array.isArray(e));
1290
+ }
1291
+ function v(e) {
1292
+ if (!Z(e)) return !1;
1293
+ const t = typeof e.source == "string" ? e.source.trim().toLowerCase() : "", r = typeof e.sourceType == "string" ? e.sourceType.trim().toLowerCase() : "", n = typeof e.composeSource == "string" ? e.composeSource.trim().toLowerCase() : "";
1294
+ return t === "image" || r === "image" || n === "image" || v(e.params);
1295
+ }
1296
+ function x(e) {
1297
+ return Z(e) ? v(e) || v(e.recognition) ? !0 : Z(e.v2) ? x(e.v2) : !1 : !1;
1298
+ }
1299
+ function Tr(e, t, r) {
1300
+ return (t == null ? void 0 : t.suppressImageComposeAutoRefresh) !== !0 || !Be(r) ? !1 : v(e == null ? void 0 : e.params) || v(e) || v(t) || v(t == null ? void 0 : t.source) || v(t == null ? void 0 : t.data) || x(t == null ? void 0 : t.recognition) || x(t == null ? void 0 : t.meta);
1301
+ }
1302
+ function Nr(e, t) {
1303
+ return v(e == null ? void 0 : e.params) || v(e) || v(t) || v(t == null ? void 0 : t.source) || v(t == null ? void 0 : t.data) || x(t == null ? void 0 : t.recognition) || x(t == null ? void 0 : t.meta);
1304
+ }
1305
+ function yn(e, t) {
1306
+ if (!e) return !1;
1307
+ const r = Sr(e);
1308
+ if (!r || Pr(r) || Tr(e, t, r)) return !1;
1309
+ const n = typeof (e == null ? void 0 : e.status) == "string" ? e.status.trim().toLowerCase() : "";
1310
+ return !(Rr.has(n) || Be(r) && Nr(e, t));
1311
+ }
1312
+ function kn(e) {
1313
+ var n;
1314
+ const t = (n = e.title) == null ? void 0 : n.trim(), r = t ? Or(t) : void 0;
1315
+ return r || u("FWA.56db1787570894461", { p0: e.index + 1 });
1316
+ }
1317
+ function Or(e) {
1318
+ const t = e.replace(/[A-Za-z0-9_./\\()[\]{}::,,;;#%+\-=]+/gu, "").replace(/\s+/gu, "").trim();
1319
+ return t && /[\u3400-\u9fff]/u.test(t) ? t : void 0;
1320
+ }
1321
+ function ge(e) {
1322
+ return e.trim().replace(/^\/+|\/+$/g, "");
1323
+ }
1324
+ function Dr(e, t) {
1325
+ const r = ge(t), n = e.routes.list().map((s) => s.contribution).find((s) => ge(s.path) === r);
1326
+ if (!n) return { status: "not-found" };
1327
+ const o = (n.requiredCapabilities ?? []).filter((s) => !e.capabilities.isEnabled(s));
1328
+ return o.length > 0 ? { missingCapabilities: o, status: "forbidden" } : { route: n, status: "ready" };
1329
+ }
1330
+ const Mr = ["data-workbench-feature-state"], Br = { key: 0 }, Fr = { key: 1 }, Hr = { key: 2 }, $r = { key: 3 }, Kr = /* @__PURE__ */ M({
1331
+ __name: "WorkbenchFeatureOutlet",
1332
+ setup(e) {
1333
+ const t = at(), r = j(), n = xe("loading"), o = re(null);
1334
+ let s = 0;
1335
+ function a() {
1336
+ const c = t.params.featurePath;
1337
+ return Array.isArray(c) ? c.join("/") : String(c ?? "");
1338
+ }
1339
+ const i = Ie(a);
1340
+ async function d() {
1341
+ var l;
1342
+ const c = ++s;
1343
+ n.value = "loading", o.value = null;
1344
+ try {
1345
+ if (await r.ready, c !== s) return;
1346
+ const b = Dr(r.kernel, i.value);
1347
+ if (b.status !== "ready") {
1348
+ n.value = b.status;
1349
+ return;
1350
+ }
1351
+ const A = await b.route.loadComponent();
1352
+ if (c !== s) return;
1353
+ o.value = typeof A == "object" && A !== null && "default" in A ? A.default : A, n.value = "ready";
1354
+ } catch (b) {
1355
+ if (c !== s) return;
1356
+ n.value = "error", (l = r.services.loggerAdapter) == null || l.error("Workbench feature route failed to load", {
1357
+ featurePath: i.value,
1358
+ message: b instanceof Error ? b.message : String(b)
1359
+ });
1360
+ }
1361
+ }
1362
+ return Ee(i, () => {
1363
+ d();
1364
+ }, { immediate: !0 }), L(() => {
1365
+ s += 1;
1366
+ }), (c, l) => n.value === "ready" && o.value ? (k(), V(ne(o.value), { key: 0 })) : (k(), W("main", {
1367
+ key: 1,
1368
+ class: "workbench-feature-outlet-state",
1369
+ "data-workbench-feature-state": n.value,
1370
+ "aria-live": "polite"
1371
+ }, [
1372
+ n.value === "loading" ? (k(), W("p", Br, "工作台功能加载中")) : n.value === "forbidden" ? (k(), W("p", Fr, "当前账号无权访问该工作台功能")) : n.value === "error" ? (k(), W("p", Hr, "工作台功能加载失败,请稍后重试")) : (k(), W("p", $r, "当前版本不支持该工作台功能"))
1373
+ ], 8, Mr));
1374
+ }
1375
+ }), qr = /* @__PURE__ */ se(Kr, [["__scopeId", "data-v-6723ad51"]]);
1376
+ function En(e) {
1377
+ return {
1378
+ component: M({
1379
+ name: "WorkbenchFeatureRouteHost",
1380
+ setup() {
1381
+ const r = Te(e.host);
1382
+ return G(oe, r), r.ready.catch((n) => {
1383
+ var o;
1384
+ (o = e.host.adapters.loggerAdapter) == null || o.error("Workbench feature host initialization failed", {
1385
+ message: n instanceof Error ? n.message : String(n)
1386
+ });
1387
+ }), L(() => {
1388
+ r.dispose();
1389
+ }), () => Le(qr);
1390
+ }
1391
+ }),
1392
+ meta: { workbenchFeatureOutlet: !0 },
1393
+ name: "workbench-app-feature-outlet",
1394
+ path: "/workbench-app/:featurePath(.*)*"
1395
+ };
1396
+ }
1397
+ function ee(e, t = {}, r = "-") {
1398
+ return Number.isFinite(e) ? new Intl.NumberFormat("zh-CN", t).format(e) : r;
1399
+ }
1400
+ function In(e, t = "") {
1401
+ return t === "percent" ? `${(e * 100).toFixed(1)}%` : t === "currency" ? Math.abs(e) >= 1e8 ? u("FWA.15b51787570950350", { p0: (e / 1e8).toFixed(2) }) : Math.abs(e) >= 1e4 ? u("FWA.e1c91787570950875", { p0: (e / 1e4).toFixed(1) }) : `¥${ee(e)}` : ee(e);
1402
+ }
1403
+ function An(e, t = {}) {
1404
+ return e === 0 ? "-" : ee(e, t);
1405
+ }
1406
+ function be(e = {}) {
1407
+ var r, n, o, s, a, i, d, c, l, b, A, P;
1408
+ const t = {
1409
+ workspaceId: _([
1410
+ w((r = e.routeQuery) == null ? void 0 : r.workspaceId),
1411
+ I(e.locationSearch, "workspaceId"),
1412
+ R(e.locationHash, "workspaceId"),
1413
+ C(e.locationPathname, "workspaceId")
1414
+ ]),
1415
+ userId: _([
1416
+ w((n = e.routeQuery) == null ? void 0 : n.userId),
1417
+ I(e.locationSearch, "userId"),
1418
+ R(e.locationHash, "userId"),
1419
+ C(e.locationPathname, "userId")
1420
+ ]),
1421
+ tenantId: we(e, ["tenantId", "tenant_id", "tenant-id"]),
1422
+ appId: we(e, ["appId", "app_id", "app-id"]),
1423
+ roleId: "",
1424
+ mode: _([
1425
+ w((o = e.routeQuery) == null ? void 0 : o.mode),
1426
+ I(e.locationSearch, "mode"),
1427
+ R(e.locationHash, "mode"),
1428
+ C(e.locationPathname, "mode")
1429
+ ]),
1430
+ fdeMode: _([
1431
+ w((s = e.routeQuery) == null ? void 0 : s.fdeMode),
1432
+ I(e.locationSearch, "fdeMode"),
1433
+ R(e.locationHash, "fdeMode"),
1434
+ C(e.locationPathname, "fdeMode")
1435
+ ]),
1436
+ workbenchEditable: _([
1437
+ w((a = e.routeQuery) == null ? void 0 : a.workbenchEditable),
1438
+ I(e.locationSearch, "workbenchEditable"),
1439
+ R(e.locationHash, "workbenchEditable"),
1440
+ C(e.locationPathname, "workbenchEditable")
1441
+ ]),
1442
+ conversationId: _([
1443
+ w((i = e.routeQuery) == null ? void 0 : i.conversationId),
1444
+ I(e.locationSearch, "conversationId"),
1445
+ R(e.locationHash, "conversationId"),
1446
+ C(e.locationPathname, "conversationId")
1447
+ ]),
1448
+ resourceId: _([
1449
+ w((d = e.routeQuery) == null ? void 0 : d.resourceId),
1450
+ I(e.locationSearch, "resourceId"),
1451
+ R(e.locationHash, "resourceId"),
1452
+ C(e.locationPathname, "resourceId")
1453
+ ]),
1454
+ fdeResourceId: _([
1455
+ w((c = e.routeQuery) == null ? void 0 : c.fdeResourceId),
1456
+ I(e.locationSearch, "fdeResourceId"),
1457
+ R(e.locationHash, "fdeResourceId"),
1458
+ C(e.locationPathname, "fdeResourceId")
1459
+ ]),
1460
+ path: _([
1461
+ w((l = e.routeQuery) == null ? void 0 : l.path),
1462
+ I(e.locationSearch, "path"),
1463
+ R(e.locationHash, "path"),
1464
+ C(e.locationPathname, "path")
1465
+ ]),
1466
+ fdePath: _([
1467
+ w((b = e.routeQuery) == null ? void 0 : b.fdePath),
1468
+ I(e.locationSearch, "fdePath"),
1469
+ R(e.locationHash, "fdePath"),
1470
+ C(e.locationPathname, "fdePath")
1471
+ ]),
1472
+ name: _([
1473
+ w((A = e.routeQuery) == null ? void 0 : A.name),
1474
+ I(e.locationSearch, "name"),
1475
+ R(e.locationHash, "name"),
1476
+ C(e.locationPathname, "name")
1477
+ ]),
1478
+ fdeName: _([
1479
+ w((P = e.routeQuery) == null ? void 0 : P.fdeName),
1480
+ I(e.locationSearch, "fdeName"),
1481
+ R(e.locationHash, "fdeName"),
1482
+ C(e.locationPathname, "fdeName")
1483
+ ])
1484
+ };
1485
+ return Lr(t);
1486
+ }
1487
+ function _n(e) {
1488
+ if (typeof window > "u")
1489
+ return be({ routeQuery: e });
1490
+ const t = be({
1491
+ routeQuery: e,
1492
+ locationPathname: window.location.pathname,
1493
+ locationSearch: window.location.search,
1494
+ locationHash: window.location.hash
1495
+ });
1496
+ return {
1497
+ ...t,
1498
+ userId: t.userId || Ur(window)
1499
+ };
1500
+ }
1501
+ function w(e) {
1502
+ return Array.isArray(e) ? w(e[0]) : typeof e == "string" ? e.trim() : "";
1503
+ }
1504
+ function I(e, t) {
1505
+ var r;
1506
+ return e && ((r = new URLSearchParams(e.startsWith("?") ? e.slice(1) : e).get(t)) == null ? void 0 : r.trim()) || "";
1507
+ }
1508
+ function R(e, t) {
1509
+ if (!e) return "";
1510
+ const r = e.indexOf("?");
1511
+ if (r < 0) return "";
1512
+ const n = e.indexOf("#", r + 1), o = n >= 0 ? e.slice(r + 1, n) : e.slice(r + 1);
1513
+ return I(o, t);
1514
+ }
1515
+ function C(e, t) {
1516
+ if (!e || !e.includes("=")) return "";
1517
+ const r = e.split("/").filter(Boolean).find((n) => n.includes("="));
1518
+ return r ? I(r, t) : "";
1519
+ }
1520
+ function we(e, t) {
1521
+ return _(t.flatMap((r) => {
1522
+ var n;
1523
+ return [
1524
+ w((n = e.routeQuery) == null ? void 0 : n[r]),
1525
+ I(e.locationSearch, r),
1526
+ R(e.locationHash, r),
1527
+ C(e.locationPathname, r)
1528
+ ];
1529
+ }));
1530
+ }
1531
+ function _(e) {
1532
+ return e.find((t) => t.trim()) || "";
1533
+ }
1534
+ function Ur(e) {
1535
+ const t = [
1536
+ e.__BT_WORKBENCH_USER__,
1537
+ e.__BT_RUNTIME_IDENTITY__,
1538
+ e.__BT_RUNTIME_CONTEXT__
1539
+ ];
1540
+ for (const r of t) {
1541
+ const n = xr(r);
1542
+ if (n) return n;
1543
+ }
1544
+ return "";
1545
+ }
1546
+ function xr(e) {
1547
+ if (!e || typeof e != "object" || Array.isArray(e)) return "";
1548
+ const t = e;
1549
+ return _([
1550
+ w(t.userId),
1551
+ w(t.user_id),
1552
+ w(t.egoUserinfo),
1553
+ w(t.egoUserInfo),
1554
+ w(t["ego-userinfo"])
1555
+ ]);
1556
+ }
1557
+ function Lr(e) {
1558
+ if (!Vr(e)) return e;
1559
+ const t = e.fdeResourceId || e.resourceId;
1560
+ return {
1561
+ ...e,
1562
+ workspaceId: e.workspaceId || t,
1563
+ userId: e.userId || "fdeadmin",
1564
+ roleId: e.roleId || "fde",
1565
+ fdeResourceId: t
1566
+ };
1567
+ }
1568
+ function Vr(e) {
1569
+ const t = e.mode.trim().toLowerCase(), r = e.fdeMode.trim().toLowerCase();
1570
+ return t === "fde" || r === "true" || r === "1" || r === "yes";
1571
+ }
1572
+ const E = {
1573
+ radius: "standard",
1574
+ border: "light",
1575
+ shadow: "soft",
1576
+ texture: "white",
1577
+ textureColor: "#ffffff",
1578
+ motion: "none",
1579
+ density: "standard"
1580
+ }, Rn = [
1581
+ {
1582
+ key: "radius",
1583
+ label: u("FWA.71e11787571689316"),
1584
+ options: [
1585
+ { value: "square", label: u("FWA.fbad1787571689609") },
1586
+ { value: "small", label: u("FWA.50721787571587373") },
1587
+ { value: "standard", label: u("FWA.e83b1787571408644") },
1588
+ { value: "large", label: u("FWA.c0491787571587595") }
1589
+ ]
1590
+ },
1591
+ {
1592
+ key: "border",
1593
+ label: u("FWA.49d21787571689615"),
1594
+ options: [
1595
+ { value: "none", label: u("FWA.f0961787571587988") },
1596
+ { value: "light", label: u("FWA.36d41787571258647") },
1597
+ { value: "strong", label: u("FWA.35961787571588423") }
1598
+ ]
1599
+ },
1600
+ {
1601
+ key: "shadow",
1602
+ label: u("FWA.30c71787571689687"),
1603
+ options: [
1604
+ { value: "none", label: u("FWA.6e7c1787571588944") },
1605
+ { value: "soft", label: u("FWA.db821787571589152") },
1606
+ { value: "strong", label: u("FWA.7fbe1787571589516") }
1607
+ ]
1608
+ },
1609
+ {
1610
+ key: "texture",
1611
+ label: u("FWA.e4e81787571690132"),
1612
+ options: [
1613
+ { value: "white", label: u("FWA.3e791787571690179") },
1614
+ { value: "muted", label: u("FWA.2b471787571590077") },
1615
+ { value: "glass", label: u("FWA.c3e41787571409224") },
1616
+ { value: "texture", label: u("FWA.6b941787571590518") }
1617
+ ]
1618
+ },
1619
+ {
1620
+ key: "motion",
1621
+ label: u("FWA.f1801787571690658"),
1622
+ options: [
1623
+ { value: "none", label: u("FWA.252a1787571591043") },
1624
+ { value: "lift", label: u("FWA.f1bf1787571410166") },
1625
+ { value: "glow", label: u("FWA.8a811787571410691") }
1626
+ ]
1627
+ },
1628
+ {
1629
+ key: "density",
1630
+ label: u("FWA.b02d1787571690666"),
1631
+ options: [
1632
+ { value: "loose", label: u("FWA.2d611787571591242") },
1633
+ { value: "standard", label: u("FWA.780f1787571591588") },
1634
+ { value: "compact", label: u("FWA.6a711787571146025") }
1635
+ ]
1636
+ }
1637
+ ], Gr = {
1638
+ radius: ["square", "small", "standard", "large"],
1639
+ border: ["none", "light", "strong"],
1640
+ shadow: ["none", "soft", "strong"],
1641
+ texture: ["white", "muted", "glass", "texture", "color"],
1642
+ motion: ["none", "lift", "glow"],
1643
+ density: ["loose", "standard", "compact"]
1644
+ };
1645
+ function te(e) {
1646
+ return e && typeof e == "object" && !Array.isArray(e) ? e : {};
1647
+ }
1648
+ function K(e, t) {
1649
+ const r = E[e];
1650
+ return typeof t == "string" && Gr[e].includes(t) ? t : r;
1651
+ }
1652
+ function zr(e) {
1653
+ return typeof e == "string" && /^#[0-9a-fA-F]{6}$/.test(e) ? e.toLowerCase() : E.textureColor;
1654
+ }
1655
+ function z(e) {
1656
+ const t = te(e);
1657
+ return {
1658
+ radius: K("radius", t.radius),
1659
+ border: K("border", t.border),
1660
+ shadow: K("shadow", t.shadow),
1661
+ texture: K("texture", t.texture),
1662
+ textureColor: zr(t.textureColor),
1663
+ motion: K("motion", t.motion),
1664
+ density: K("density", t.density)
1665
+ };
1666
+ }
1667
+ function Cn(e) {
1668
+ const t = z(e);
1669
+ return t.radius === E.radius && t.border === E.border && t.shadow === E.shadow && t.texture === E.texture && t.textureColor === E.textureColor && t.motion === E.motion && t.density === E.density;
1670
+ }
1671
+ const Qr = {
1672
+ square: 0,
1673
+ small: 4,
1674
+ standard: 8,
1675
+ large: 16
1676
+ }, jr = {
1677
+ none: "none",
1678
+ soft: "soft",
1679
+ standard: "soft",
1680
+ strong: "strong"
1681
+ }, Yr = {
1682
+ thumbnail: "compact",
1683
+ compact: "compact",
1684
+ standard: "standard",
1685
+ expanded: "loose"
1686
+ };
1687
+ function Wn(e) {
1688
+ const t = z(e);
1689
+ return {
1690
+ cardStyle: {
1691
+ cardRadius: Qr[t.radius],
1692
+ cardShadow: t.shadow === "strong" ? "strong" : t.shadow,
1693
+ density: t.density === "loose" ? "expanded" : t.density,
1694
+ ...t.texture === "color" ? { backgroundColor: t.textureColor } : {},
1695
+ shell: { ...t }
1696
+ }
1697
+ };
1698
+ }
1699
+ function vn(e) {
1700
+ const t = te(e == null ? void 0 : e.cardStyle), r = te(t.shell);
1701
+ if (Object.keys(r).length > 0)
1702
+ return z(r);
1703
+ const n = typeof t.cardRadius == "number" ? t.cardRadius <= 0 ? "square" : t.cardRadius <= 4 ? "small" : t.cardRadius >= 16 ? "large" : "standard" : E.radius, o = typeof t.cardShadow == "string" && jr[t.cardShadow] || E.shadow, s = typeof t.density == "string" && Yr[t.density] || E.density, a = typeof t.backgroundColor == "string" ? t.backgroundColor : void 0;
1704
+ return z({
1705
+ radius: n,
1706
+ border: E.border,
1707
+ shadow: o,
1708
+ texture: a ? "color" : E.texture,
1709
+ textureColor: a,
1710
+ motion: E.motion,
1711
+ density: s
1712
+ });
1713
+ }
1714
+ const Sn = "@fses/workbench-app";
1715
+ export {
1716
+ ar as $,
1717
+ cn as A,
1718
+ vn as B,
1719
+ Cn as C,
1720
+ E as D,
1721
+ Wn as E,
1722
+ We as F,
1723
+ Sn as G,
1724
+ it as H,
1725
+ oe as I,
1726
+ hn as J,
1727
+ wt as K,
1728
+ ut as L,
1729
+ sr as M,
1730
+ nr as N,
1731
+ or as O,
1732
+ dt as P,
1733
+ mn as Q,
1734
+ Se as R,
1735
+ En as S,
1736
+ Te as T,
1737
+ cr as U,
1738
+ tr as V,
1739
+ Ot as W,
1740
+ fn as X,
1741
+ ve as Y,
1742
+ ir as Z,
1743
+ se as _,
1744
+ dn as a,
1745
+ An as a0,
1746
+ an as a1,
1747
+ ln as b,
1748
+ un as c,
1749
+ Rn as d,
1750
+ Ar as e,
1751
+ In as f,
1752
+ pn as g,
1753
+ bn as h,
1754
+ wn as i,
1755
+ jt as j,
1756
+ Ut as k,
1757
+ xt as l,
1758
+ Lt as m,
1759
+ z as n,
1760
+ Qt as o,
1761
+ gn as p,
1762
+ qt as q,
1763
+ kn as r,
1764
+ yn as s,
1765
+ $t as t,
1766
+ j as u,
1767
+ Kt as v,
1768
+ Sr as w,
1769
+ vt as x,
1770
+ _n as y,
1771
+ le as z
1772
+ };