@oomol-lab/open-flow 0.1.0-beta.81 → 0.1.0-beta.82
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/README.md +35 -0
- package/dist/browser/{FlowCanvas-CrsiDHK8.js → FlowCanvas-Dew2fmoT.js} +55 -274
- package/dist/browser/{createResourceDialog-CS3u9ga9.js → createResourceDialog-bdOJa5Zk.js} +2 -1
- package/dist/browser/{exportPng-BOPfjeEi.js → exportPng-Cjdb6COo.js} +2 -2
- package/dist/browser/{flowChanges-CFj5pL4Y.js → flowChanges-URBEd4DI.js} +2583 -71
- package/dist/browser/{flowWorkspace-BeQaeJ3e.js → flowWorkspace-BlXx-yAn.js} +440 -2578
- package/dist/browser/{markdownContent-CAG_CQfH.js → markdownContent-D8G_oNOe.js} +18 -41
- package/dist/browser/{markdownContent-frwDfQQU.js → markdownContent-IS8xXDoc.js} +18 -40
- package/dist/browser/preview.css +88 -80
- package/dist/browser/preview.js +150 -60
- package/dist/browser/ui.css +8 -0
- package/dist/browser/{dist-CHwj9BhV.js → videoLink-NAWDmBtf.js} +35 -1
- package/dist/browser/workbench-contract.d.ts +6 -0
- package/dist/browser/workbench.css +259 -251
- package/dist/browser/workbench.d.ts +2 -0
- package/dist/browser/workbench.js +289 -137
- package/dist/browser/{ContentIcon-CMn0c-kl.js → wrapLayout-DZvW9dBs.js} +4397 -4152
- package/dist/command/index.js +43 -41
- package/dist/common/authoring.d.ts +1 -1
- package/dist/common/control-api-conformance.js +306 -2
- package/dist/common/control-api.d.ts +20 -0
- package/dist/common/control-api.js +306 -4
- package/dist/common/control-requests.d.ts +3 -5
- package/dist/common/control-requests.js +5 -7
- package/dist/common/flow-encoding.d.ts +1 -0
- package/dist/common/flow-encoding.js +167 -1
- package/dist/common/flow-semantics.js +20 -0
- package/dist/common/flow-workflowBundle.d.ts +27 -0
- package/dist/common/flow-workflowFile.d.ts +2 -0
- package/dist/common/flow-workflowReferences.d.ts +4 -0
- package/dist/common/mcp.d.ts +2 -0
- package/dist/common/mcp.js +312 -4
- package/dist/render/browser/licenses.md +4047 -0
- package/dist/render/browser/runtime.css +14877 -0
- package/dist/render/browser/runtime.js +266765 -0
- package/dist/render/common/png.d.ts +24 -0
- package/dist/render/node/index.d.ts +11 -0
- package/dist/render/node/index.js +9491 -0
- package/dist/render/node/licenses.md +75 -0
- package/package.json +12 -2
- package/src/control/common/api.ts +50 -0
- package/src/control/common/flowDecoders.ts +2 -0
- package/src/control/common/mcp.ts +4 -4
- package/src/control/common/requests.ts +12 -1
- package/src/flow/common/encoding.ts +1 -0
- package/src/flow/common/workflowBundle.ts +117 -0
- package/src/flow/common/workflowFile.ts +4 -0
- package/src/flow/common/workflowReferences.ts +20 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { o as __toESM, t as __commonJSMin } from "./rolldown-runtime-CEgmsyvS.js";
|
|
2
|
-
import { $ as
|
|
1
|
+
import { i as __require, o as __toESM, t as __commonJSMin } from "./rolldown-runtime-CEgmsyvS.js";
|
|
2
|
+
import { $ as waitBranchLocales, B as useCompositeItem, C as useIconifyCollectionLoader, D as DropdownMenuContent, L as DropdownMenuTrigger, N as DropdownMenuSeparator, T as DropdownMenu, Z as uiLocales, _ as ContentIcon, a as ACTIVE_COMPOSITE_ITEM, at as fr_default$3, b as placeholderIcon, ct as providerIconAppearance, d as PopoverTitle, et as zh_TW_default$3, f as PopoverTrigger, g as Z, i as CompositeRoot, it as ja_default$3, k as DropdownMenuItem, lt as Checkbox, m as ScrollArea, n as canvasDirection, nt as ru_default$3, o as Popover, ot as en_default$3, r as Textarea, rt as ko_default$3, s as PopoverContent, st as I18n, t as wrapLayout, tt as zh_CN_default$3, w as useIconifyData, x as spriteIcon, y as imageIcon } from "./wrapLayout-DZvW9dBs.js";
|
|
3
3
|
import { a as derive, i as compute, l as val, t as arrayShallowEqual } from "./dist-bO8nvHFH.js";
|
|
4
|
-
import { a as toPlainObject, l as useTranslate, o as I18nProvider, u as useVal } from "./dist-BFmpkX4P.js";
|
|
5
|
-
import { $n as inputClear, A as string$1, Bn as transitionStatusMapping, Br as useRefWithInit, C as literal, Cr as cn, Dn as getTarget, Dr as EMPTY_ARRAY, E as object$2, En as contains, Er as useRenderElement, Et as useFloatingRootContext, F as IndexGuessBehavior, Fr as formatErrorMessage, Ft as useDismiss, Gn as createGenericEventDetails, I as useCompositeListItem, In as useTransitionStatus, Ir as mergeProps, It as useClick, Jn as closePress, Kt as DROPDOWN_COLLISION_AVOIDANCE, Ln as useOpenChangeComplete, Lr as useIsoLayoutEffect, Lt as FloatingFocusManager, M as unknown, Mn as ownerDocument, Mr as useButton, Nn as useLabelableId, O as record$3, On as isAndroid, Or as EMPTY_OBJECT, Qn as inputChange, Qt as useStore, S as lazy$1, Sn as stopEvent, Sr as buttonVariants, T as number, Un as useValueChanged, Ur as isElement, Wn as createChangeEventDetails, Wt as FloatingPortal, Yn as escapeKey, Zt as Store, _ as array, _r as fieldValidityMapping, an as useOnFirstRender, at as useAnchorPositioning, b as int, br as useControlled, bt as useListNavigation, ct as CompositeList, dr as useFormContext, er as inputPress, et as useAnchoredPopupScrollLock, fr as useRegisterFieldControl, ft as popupStateMapping, g as _enum, gr as DEFAULT_FIELD_STATE_ATTRIBUTES, ht as useOpenInteractionType, i as TooltipTrigger, in as useValueAsRef, it as InternalBackdrop, j as union, jr as useMergedRefs, k as strictObject, kn as isFirefox, kr as NOOP, lt as inertValue, mr as useBaseUiId, n as TooltipContent, nr as listNavigation, nt as usePositioner, p as timeZoneOffsetMinutes, pr as useFieldRootContext, pt as pressableTriggerOpenStateMapping, rn as createSelector, rr as none, rt as getDisabledMountTransitionStyles, sn as useTimeout, st as useDirection, t as Tooltip, tr as itemPress, ur as useLabelableContext, ut as getPseudoElementBounds, v as boolean, vr as visuallyHidden, vt as useTypeahead, wn as isInteractiveElement, wr as cva, x as json$3, xr as Button, xt as useInteractions, y as discriminatedUnion, yr as visuallyHiddenInput, zr as useStableCallback } from "./tooltip-BDcVTNpu.js";
|
|
4
|
+
import { a as toPlainObject, l as useTranslate, o as I18nProvider, s as useI18n, u as useVal } from "./dist-BFmpkX4P.js";
|
|
5
|
+
import { $n as inputClear, A as string$1, Bn as transitionStatusMapping, Br as useRefWithInit, C as literal, Cr as cn, Dn as getTarget, Dr as EMPTY_ARRAY, E as object$2, En as contains, Er as useRenderElement, Et as useFloatingRootContext, F as IndexGuessBehavior, Fr as formatErrorMessage, Ft as useDismiss, Gn as createGenericEventDetails, I as useCompositeListItem, In as useTransitionStatus, Ir as mergeProps, It as useClick, Jn as closePress, Kt as DROPDOWN_COLLISION_AVOIDANCE, Ln as useOpenChangeComplete, Lr as useIsoLayoutEffect, Lt as FloatingFocusManager, M as unknown, Mn as ownerDocument, Mr as useButton, Nn as useLabelableId, O as record$3, On as isAndroid, Or as EMPTY_OBJECT, Qn as inputChange, Qt as useStore, S as lazy$1, Sn as stopEvent, Sr as buttonVariants, T as number, Tn as activeElement, Tr as clsx, Un as useValueChanged, Ur as isElement, Wn as createChangeEventDetails, Wt as FloatingPortal, Yn as escapeKey, Zt as Store, _ as array, _r as fieldValidityMapping, an as useOnFirstRender, at as useAnchorPositioning, b as int, br as useControlled, bt as useListNavigation, ct as CompositeList, dr as useFormContext, er as inputPress, et as useAnchoredPopupScrollLock, fr as useRegisterFieldControl, ft as popupStateMapping, g as _enum, gr as DEFAULT_FIELD_STATE_ATTRIBUTES, ht as useOpenInteractionType, i as TooltipTrigger, in as useValueAsRef, it as InternalBackdrop, j as union, jr as useMergedRefs, k as strictObject, kn as isFirefox, kr as NOOP, lt as inertValue, mr as useBaseUiId, n as TooltipContent, nr as listNavigation, nt as usePositioner, p as timeZoneOffsetMinutes, pr as useFieldRootContext, pt as pressableTriggerOpenStateMapping, rn as createSelector, rr as none, rt as getDisabledMountTransitionStyles, sn as useTimeout, st as useDirection, t as Tooltip, tr as itemPress, ur as useLabelableContext, ut as getPseudoElementBounds, v as boolean, vr as visuallyHidden, vt as useTypeahead, wn as isInteractiveElement, wr as cva, x as json$3, xr as Button, xt as useInteractions, y as discriminatedUnion, yr as visuallyHiddenInput, zn as TransitionStatusDataAttributes, zr as useStableCallback } from "./tooltip-BDcVTNpu.js";
|
|
6
6
|
import { $t as defaultItemEquality, B as authoringDefinitionSchemas, D as nodeSystemOutputPorts, Dt as matchesSchema, Et as comparePorts, Ft as flowStateViewSchema, G as workflowAgentToolSchema, Gt as SelectTrigger, H as connectorCapabilitySchema, Ht as SelectGroup, I as otherwiseOutput, It as skipDuplicatesConfigSchema, J as webhookResponseAllowsBody, Jt as hasNullItemLabel, K as webhookHeaderValuePort, Kt as SelectValue, Lt as skipDuplicatesTask, Mt as format, N as nodeInputMappings, Nt as flowStateSummarySchema, Ot as portsAssignable, Pt as flowStateValuesSchema, Q as workflowOutputsPort, Qt as compareItemEquality, Rt as dequal$1, S as resourceNameIssue, Tt as webhookSupportsBody, U as decodeRevisionContent, Ut as SelectItem, V as connectorAgentToolSchema, Vt as SelectContent, W as httpCapabilitySchema, Xt as stringifyAsLabel, Y as webhookResponseInputs, Yt as isGroupedItems, Z as webhookStatusCodePort, Zt as stringifyAsValue, _ as applyFlowChanges$1, a as DialogFooter, ct as httpRequestInputs, d as Field, dt as withHttpParameterFields, en as findItemIndex, ft as withHttpParameterSource, gt as renamedPort, h as FieldLabel, ht as renameOutputMapping, i as DialogDescription, in as Input, it as checkJsonDepth, j as conditionInputPorts, jt as isSchemaKeyword, k as clearConditionBindings, kt as schemaObject, mt as remapInputMappings, n as DialogClose, nn as selectedValueIncludes, nt as retryConfigurationSchema, o as DialogHeader, p as FieldError, pt as httpHeaderNameIssue, q as webhookHeadersPort, qt as resolveAriaLabelledBy, r as DialogContent, rn as Label, s as DialogTitle, st as httpRequestConfigSchema, t as Dialog, tn as removeItem, ut as httpRequestTask, v as isTriggerNode, x as normalizeNodeName, xt as decisionTask, y as nextNodeName, z as agentToolFields, zt as Select } from "./dialog-CFlvkliO.js";
|
|
7
7
|
import { a as uiLanguages, n as isUiLanguage, r as resolveUiLanguage } from "./languages-gYzoQqCi.js";
|
|
8
8
|
import "./lib-Dws05GHj.js";
|
|
@@ -1670,12 +1670,12 @@ function decodeLiveDetails(value) {
|
|
|
1670
1670
|
publication: current,
|
|
1671
1671
|
status,
|
|
1672
1672
|
enabled: source.enabled,
|
|
1673
|
-
entries: decodeEntries(source.entries, current),
|
|
1673
|
+
entries: decodeEntries$1(source.entries, current),
|
|
1674
1674
|
version: 1
|
|
1675
1675
|
};
|
|
1676
1676
|
}
|
|
1677
1677
|
/** Both producers and consumers enforce the same published-entry invariants. */
|
|
1678
|
-
function decodeEntries(values, current) {
|
|
1678
|
+
function decodeEntries$1(values, current) {
|
|
1679
1679
|
const parsed = array(entrySchema).safeParse(values);
|
|
1680
1680
|
if (!parsed.success) return invalidResponse();
|
|
1681
1681
|
const ids = /* @__PURE__ */ new Set();
|
|
@@ -1856,6 +1856,8 @@ var envelope = strictObject({
|
|
|
1856
1856
|
kind: literal("open-flow-workflow"),
|
|
1857
1857
|
version: literal(1),
|
|
1858
1858
|
name: string$1().optional(),
|
|
1859
|
+
icon: string$1().optional(),
|
|
1860
|
+
description: string$1().optional(),
|
|
1859
1861
|
content: unknown(),
|
|
1860
1862
|
presentation: record$3(string$1(), json$3()).optional()
|
|
1861
1863
|
});
|
|
@@ -1868,9 +1870,6 @@ function decodeWorkflowFile(value) {
|
|
|
1868
1870
|
content: decodeRevisionContent(file.content)
|
|
1869
1871
|
};
|
|
1870
1872
|
}
|
|
1871
|
-
function parseWorkflowFile(text) {
|
|
1872
|
-
return decodeWorkflowFile(JSON.parse(text));
|
|
1873
|
-
}
|
|
1874
1873
|
function cleanInput(input) {
|
|
1875
1874
|
if (input.kind != "sources" || !input.sources.some((source) => source.kind == "binding")) return input;
|
|
1876
1875
|
const sources = input.sources.filter((source) => source.kind != "binding");
|
|
@@ -1935,6 +1934,78 @@ function workflowFileName(name) {
|
|
|
1935
1934
|
function workflowNameFromFile(name) {
|
|
1936
1935
|
return name.replace(/(?:\.openflow)?\.json$/i, "");
|
|
1937
1936
|
}
|
|
1937
|
+
//#endregion
|
|
1938
|
+
//#region src/flow/common/workflowBundle.ts
|
|
1939
|
+
var entries$1 = array(strictObject({
|
|
1940
|
+
flowId: string$1().min(1),
|
|
1941
|
+
file: unknown()
|
|
1942
|
+
})).min(1);
|
|
1943
|
+
var bundleSchema = strictObject({
|
|
1944
|
+
kind: literal("open-flow-workflow-bundle"),
|
|
1945
|
+
version: literal(1),
|
|
1946
|
+
entryFlowId: string$1().min(1),
|
|
1947
|
+
workflows: entries$1
|
|
1948
|
+
});
|
|
1949
|
+
var previewSchema = strictObject({
|
|
1950
|
+
version: literal(1),
|
|
1951
|
+
entryFlowId: string$1().min(1),
|
|
1952
|
+
workflows: entries$1,
|
|
1953
|
+
unavailableFlowIds: array(string$1().min(1))
|
|
1954
|
+
});
|
|
1955
|
+
function decodeEntries(value, entryFlowId, unavailableFlowIds = []) {
|
|
1956
|
+
const workflows = value.map(({ flowId, file }) => ({
|
|
1957
|
+
flowId,
|
|
1958
|
+
file: decodeWorkflowFile(file)
|
|
1959
|
+
}));
|
|
1960
|
+
const ids = new Set(workflows.map(({ flowId }) => flowId));
|
|
1961
|
+
if (ids.size != workflows.length || !ids.has(entryFlowId)) throw new TypeError("Workflow identities must be unique and include the entry workflow.");
|
|
1962
|
+
const unavailable = new Set(unavailableFlowIds);
|
|
1963
|
+
if (unavailable.size != unavailableFlowIds.length || unavailableFlowIds.some((id) => ids.has(id))) throw new TypeError("Invalid unavailable workflow identities.");
|
|
1964
|
+
for (const { file } of workflows) for (const node of Object.values(file.content.document.graph.nodes)) for (const { target } of nodeWorkflowReferences(node)) if (target.flowId && !ids.has(target.flowId) && !unavailable.has(target.flowId)) throw new TypeError("A referenced workflow is missing from the bundle.");
|
|
1965
|
+
return workflows;
|
|
1966
|
+
}
|
|
1967
|
+
function decodeWorkflowBundle(value) {
|
|
1968
|
+
checkJsonDepth(value, -4);
|
|
1969
|
+
const bundle = bundleSchema.parse(value);
|
|
1970
|
+
return {
|
|
1971
|
+
...bundle,
|
|
1972
|
+
workflows: decodeEntries(bundle.workflows, bundle.entryFlowId)
|
|
1973
|
+
};
|
|
1974
|
+
}
|
|
1975
|
+
function decodeWorkflowExportPreview(value) {
|
|
1976
|
+
checkJsonDepth(value, -4);
|
|
1977
|
+
const preview = previewSchema.parse(value);
|
|
1978
|
+
return {
|
|
1979
|
+
...preview,
|
|
1980
|
+
workflows: decodeEntries(preview.workflows, preview.entryFlowId, preview.unavailableFlowIds)
|
|
1981
|
+
};
|
|
1982
|
+
}
|
|
1983
|
+
function cleanWorkflowBundle(value) {
|
|
1984
|
+
const bundle = decodeWorkflowBundle(value);
|
|
1985
|
+
return {
|
|
1986
|
+
...bundle,
|
|
1987
|
+
workflows: bundle.workflows.map(({ flowId, file }) => ({
|
|
1988
|
+
flowId,
|
|
1989
|
+
file: cleanWorkflowFile(file).file
|
|
1990
|
+
}))
|
|
1991
|
+
};
|
|
1992
|
+
}
|
|
1993
|
+
function workflowBundleFromPreview(preview) {
|
|
1994
|
+
if (preview.unavailableFlowIds.length) throw new TypeError("Some referenced workflows are unavailable.");
|
|
1995
|
+
return cleanWorkflowBundle({
|
|
1996
|
+
kind: "open-flow-workflow-bundle",
|
|
1997
|
+
version: 1,
|
|
1998
|
+
entryFlowId: preview.entryFlowId,
|
|
1999
|
+
workflows: preview.workflows
|
|
2000
|
+
});
|
|
2001
|
+
}
|
|
2002
|
+
function encodeWorkflowBundle(bundle) {
|
|
2003
|
+
return `${JSON.stringify(cleanWorkflowBundle(bundle), null, 2)}\n`;
|
|
2004
|
+
}
|
|
2005
|
+
function parseWorkflowImportFile(text) {
|
|
2006
|
+
const value = JSON.parse(text);
|
|
2007
|
+
return value != null && typeof value == "object" && "kind" in value && value.kind == "open-flow-workflow-bundle" ? decodeWorkflowBundle(value) : decodeWorkflowFile(value);
|
|
2008
|
+
}
|
|
1938
2009
|
new TextEncoder();
|
|
1939
2010
|
//#endregion
|
|
1940
2011
|
//#region src/control/common/providerAccess.ts
|
|
@@ -2370,6 +2441,13 @@ function hasJsonShape(root) {
|
|
|
2370
2441
|
}
|
|
2371
2442
|
}
|
|
2372
2443
|
}
|
|
2444
|
+
function isJsonValue(value) {
|
|
2445
|
+
try {
|
|
2446
|
+
return hasJsonShape(value);
|
|
2447
|
+
} catch {
|
|
2448
|
+
return false;
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2373
2451
|
function isJsonObject(value) {
|
|
2374
2452
|
try {
|
|
2375
2453
|
return value != null && typeof value == "object" && !Array.isArray(value) && hasJsonShape(value);
|
|
@@ -3288,6 +3366,8 @@ function flow(value) {
|
|
|
3288
3366
|
resourceReferences: resourceReferences(source.resourceReferences),
|
|
3289
3367
|
flowId: string(source.flowId),
|
|
3290
3368
|
name: string(source.name),
|
|
3369
|
+
...source.icon === void 0 ? {} : { icon: string(source.icon) },
|
|
3370
|
+
...source.description === void 0 ? {} : { description: string(source.description) },
|
|
3291
3371
|
status,
|
|
3292
3372
|
updatedAt: string(source.updatedAt),
|
|
3293
3373
|
version: 1
|
|
@@ -3778,6 +3858,18 @@ function decodeTagListItem(value) {
|
|
|
3778
3858
|
}
|
|
3779
3859
|
//#endregion
|
|
3780
3860
|
//#region src/control/common/api.ts
|
|
3861
|
+
function decodeWorkflowBundleImportResult(value) {
|
|
3862
|
+
const source = record$2(value);
|
|
3863
|
+
if (source.version != 1 || !Array.isArray(source.flows) || source.flows.length == 0) return invalidResponse();
|
|
3864
|
+
const entry = flow(source.flow);
|
|
3865
|
+
const flows = source.flows.map(flow);
|
|
3866
|
+
if (new Set(flows.map((item) => item.flowId)).size != flows.length || !flows.some((item) => item.flowId == entry.flowId)) return invalidResponse();
|
|
3867
|
+
return {
|
|
3868
|
+
version: 1,
|
|
3869
|
+
flow: entry,
|
|
3870
|
+
flows
|
|
3871
|
+
};
|
|
3872
|
+
}
|
|
3781
3873
|
function isRunTerminalEvent(event) {
|
|
3782
3874
|
return event?.kind == "run.completed" || event?.kind == "run.failed" || event?.kind == "run.canceled" || event?.kind == "run.indeterminate";
|
|
3783
3875
|
}
|
|
@@ -4095,6 +4187,32 @@ var ControlClient = class {
|
|
|
4095
4187
|
return invalidResponse();
|
|
4096
4188
|
}
|
|
4097
4189
|
}
|
|
4190
|
+
async getFlowExportPreview(flowId) {
|
|
4191
|
+
const value = await this.request(`/v1/flows/${segment$1(flowId)}/export-preview`);
|
|
4192
|
+
try {
|
|
4193
|
+
return decodeWorkflowExportPreview(value);
|
|
4194
|
+
} catch {
|
|
4195
|
+
return invalidResponse();
|
|
4196
|
+
}
|
|
4197
|
+
}
|
|
4198
|
+
async exportFlowBundle(flowId) {
|
|
4199
|
+
const preview = await this.getFlowExportPreview(flowId);
|
|
4200
|
+
if (preview.unavailableFlowIds.length) throw new ApiError(400, "flow.invalid", "Some referenced workflows are unavailable.");
|
|
4201
|
+
return workflowBundleFromPreview(preview);
|
|
4202
|
+
}
|
|
4203
|
+
async importFlowBundle(file, options = {}) {
|
|
4204
|
+
return decodeWorkflowBundleImportResult(await this.request("/v1/flows/import-bundle", {
|
|
4205
|
+
method: "POST",
|
|
4206
|
+
headers: { "Idempotency-Key": options.idempotencyKey ?? `flow-${randomId()}` },
|
|
4207
|
+
body: JSON.stringify({
|
|
4208
|
+
file,
|
|
4209
|
+
name: options.name,
|
|
4210
|
+
teamId: options.teamId,
|
|
4211
|
+
tagIds: options.tagIds,
|
|
4212
|
+
version: 1
|
|
4213
|
+
})
|
|
4214
|
+
}));
|
|
4215
|
+
}
|
|
4098
4216
|
async importFlow(file, options = {}) {
|
|
4099
4217
|
return flow(await this.request("/v1/flows/import", {
|
|
4100
4218
|
method: "POST",
|
|
@@ -5289,13 +5407,13 @@ function FeishuEventPicker({ value, onChange, disabled = false, allowedEvents })
|
|
|
5289
5407
|
//#region src/canvas/browser/i18n/timeZoneLocales.ts
|
|
5290
5408
|
/** The IANA-keyed city names shared by the canvas schedule summary and schedule editor. */
|
|
5291
5409
|
var timeZoneLocales = {
|
|
5292
|
-
"en": { timeZoneNames: en_default$
|
|
5293
|
-
"zh-CN": { timeZoneNames: zh_CN_default$
|
|
5294
|
-
"zh-TW": { timeZoneNames: zh_TW_default$
|
|
5295
|
-
"ja": { timeZoneNames: ja_default$
|
|
5296
|
-
"ko": { timeZoneNames: ko_default$
|
|
5297
|
-
"ru": { timeZoneNames: ru_default$
|
|
5298
|
-
"fr": { timeZoneNames: fr_default$
|
|
5410
|
+
"en": { timeZoneNames: en_default$3.timeZoneNames },
|
|
5411
|
+
"zh-CN": { timeZoneNames: zh_CN_default$3.timeZoneNames },
|
|
5412
|
+
"zh-TW": { timeZoneNames: zh_TW_default$3.timeZoneNames },
|
|
5413
|
+
"ja": { timeZoneNames: ja_default$3.timeZoneNames },
|
|
5414
|
+
"ko": { timeZoneNames: ko_default$3.timeZoneNames },
|
|
5415
|
+
"ru": { timeZoneNames: ru_default$3.timeZoneNames },
|
|
5416
|
+
"fr": { timeZoneNames: fr_default$3.timeZoneNames }
|
|
5299
5417
|
};
|
|
5300
5418
|
//#endregion
|
|
5301
5419
|
//#region src/form/browser/locales.ts
|
|
@@ -7318,7 +7436,10 @@ var resources = {
|
|
|
7318
7436
|
"discardTitle": "Discard changes?",
|
|
7319
7437
|
"discardDescription": "Your Flow settings have not been saved.",
|
|
7320
7438
|
"continueEditing": "Continue editing",
|
|
7321
|
-
"discardChanges": "Discard changes"
|
|
7439
|
+
"discardChanges": "Discard changes",
|
|
7440
|
+
"icon": "Icon",
|
|
7441
|
+
"resetIcon": "Reset icon",
|
|
7442
|
+
"description": "Description"
|
|
7322
7443
|
},
|
|
7323
7444
|
flowState: {
|
|
7324
7445
|
"title": "Persistent data",
|
|
@@ -7332,7 +7453,7 @@ var resources = {
|
|
|
7332
7453
|
"clear": "Clear",
|
|
7333
7454
|
"orphaned": "Outside the current view",
|
|
7334
7455
|
"nearLimit": "Flow history is at least 80% full. Clear unused history.",
|
|
7335
|
-
"
|
|
7456
|
+
"usage": "Usage",
|
|
7336
7457
|
"scope": "Scope",
|
|
7337
7458
|
"refresh": "Refresh",
|
|
7338
7459
|
"cancel": "Cancel",
|
|
@@ -7360,7 +7481,7 @@ var resources = {
|
|
|
7360
7481
|
"pendingClear": "{{count}} pending; finish or cancel their Runs before clearing.",
|
|
7361
7482
|
"clearBlocked": "This history has pending records. Finish or cancel their Runs, then refresh.",
|
|
7362
7483
|
"clearSource": "Clear {{name}}",
|
|
7363
|
-
"
|
|
7484
|
+
"sourceUsage": "{{name}} usage",
|
|
7364
7485
|
"confirmTitle": "Clear {{name}}?",
|
|
7365
7486
|
"confirmValues": "This will clear {{count}} saved entries in {{scope}}. Subsequent Runs will no longer be able to read these values.",
|
|
7366
7487
|
"confirmHistory": "This will clear {{count}} deduplication records in {{scope}}. These items may be processed again.",
|
|
@@ -7371,6 +7492,14 @@ var resources = {
|
|
|
7371
7492
|
"loadFailed": "Unable to load",
|
|
7372
7493
|
"valuesHelp": "{{name}}: Content explicitly saved by the workflow, available to later runs.",
|
|
7373
7494
|
"historyHelp": "{{name}}: Item identifiers used to avoid processing duplicates."
|
|
7495
|
+
},
|
|
7496
|
+
workflowTransfer: {
|
|
7497
|
+
"includeDependencies": "Include referenced workflows",
|
|
7498
|
+
"workflowCount": "Workflows ({{count}})",
|
|
7499
|
+
"unavailable": "Unavailable workflows: {{count}}.",
|
|
7500
|
+
"export": "Export",
|
|
7501
|
+
"hostUnsupported": "This host does not support workflow bundle imports yet.",
|
|
7502
|
+
"unnamed": "Untitled workflow"
|
|
7374
7503
|
}
|
|
7375
7504
|
},
|
|
7376
7505
|
"zh-CN": {
|
|
@@ -8687,7 +8816,10 @@ var resources = {
|
|
|
8687
8816
|
"discardTitle": "放弃修改?",
|
|
8688
8817
|
"discardDescription": "工作流设置的修改尚未保存。",
|
|
8689
8818
|
"continueEditing": "继续编辑",
|
|
8690
|
-
"discardChanges": "放弃修改"
|
|
8819
|
+
"discardChanges": "放弃修改",
|
|
8820
|
+
"icon": "图标",
|
|
8821
|
+
"resetIcon": "重置图标",
|
|
8822
|
+
"description": "描述"
|
|
8691
8823
|
},
|
|
8692
8824
|
flowState: {
|
|
8693
8825
|
"title": "持久化数据",
|
|
@@ -8701,7 +8833,7 @@ var resources = {
|
|
|
8701
8833
|
"clear": "清空",
|
|
8702
8834
|
"orphaned": "当前视图外",
|
|
8703
8835
|
"nearLimit": "该工作流的去重记录已使用至少 80%。请清理不再需要的记录。",
|
|
8704
|
-
"
|
|
8836
|
+
"usage": "用量",
|
|
8705
8837
|
"scope": "作用域",
|
|
8706
8838
|
"refresh": "刷新",
|
|
8707
8839
|
"cancel": "取消",
|
|
@@ -8729,7 +8861,7 @@ var resources = {
|
|
|
8729
8861
|
"pendingClear": "{{count}} 条待提交,相关运行结束或取消后可清理。",
|
|
8730
8862
|
"clearBlocked": "这些记录尚待提交。请等待相关运行结束或取消后再刷新。",
|
|
8731
8863
|
"clearSource": "清空{{name}}",
|
|
8732
|
-
"
|
|
8864
|
+
"sourceUsage": "{{name}}用量",
|
|
8733
8865
|
"confirmTitle": "清空「{{name}}」?",
|
|
8734
8866
|
"confirmValues": "将清空{{scope}}环境保存的 {{count}} 条数据,后续运行将无法读取这些值。",
|
|
8735
8867
|
"confirmHistory": "将清空{{scope}}环境的 {{count}} 条去重记录,这些条目之后可能再次被处理。",
|
|
@@ -8740,6 +8872,14 @@ var resources = {
|
|
|
8740
8872
|
"loadFailed": "加载失败",
|
|
8741
8873
|
"valuesHelp": "{{name}}:工作流主动保存的内容,后续运行可以继续读取。",
|
|
8742
8874
|
"historyHelp": "{{name}}:条目的识别标记,用来避免重复处理。"
|
|
8875
|
+
},
|
|
8876
|
+
workflowTransfer: {
|
|
8877
|
+
"includeDependencies": "包含引用的工作流",
|
|
8878
|
+
"workflowCount": "{{count}} 个工作流",
|
|
8879
|
+
"unavailable": "{{count}} 个引用的工作流不可用。",
|
|
8880
|
+
"export": "导出",
|
|
8881
|
+
"hostUnsupported": "当前宿主尚不支持导入工作流包。",
|
|
8882
|
+
"unnamed": "未命名工作流"
|
|
8743
8883
|
}
|
|
8744
8884
|
},
|
|
8745
8885
|
"zh-TW": {
|
|
@@ -10056,7 +10196,10 @@ var resources = {
|
|
|
10056
10196
|
"discardTitle": "放棄變更?",
|
|
10057
10197
|
"discardDescription": "工作流程設定的變更尚未儲存。",
|
|
10058
10198
|
"continueEditing": "繼續編輯",
|
|
10059
|
-
"discardChanges": "放棄變更"
|
|
10199
|
+
"discardChanges": "放棄變更",
|
|
10200
|
+
"icon": "圖示",
|
|
10201
|
+
"resetIcon": "重設圖示",
|
|
10202
|
+
"description": "說明"
|
|
10060
10203
|
},
|
|
10061
10204
|
flowState: {
|
|
10062
10205
|
"title": "持久化資料",
|
|
@@ -10070,7 +10213,7 @@ var resources = {
|
|
|
10070
10213
|
"clear": "清空",
|
|
10071
10214
|
"orphaned": "目前檢視之外",
|
|
10072
10215
|
"nearLimit": "此工作流的去重記錄已使用至少 80%。請清理不再需要的記錄。",
|
|
10073
|
-
"
|
|
10216
|
+
"usage": "用量",
|
|
10074
10217
|
"scope": "範圍",
|
|
10075
10218
|
"refresh": "重新整理",
|
|
10076
10219
|
"cancel": "取消",
|
|
@@ -10098,7 +10241,7 @@ var resources = {
|
|
|
10098
10241
|
"pendingClear": "{{count}} 筆待提交,相關執行結束或取消後可清理。",
|
|
10099
10242
|
"clearBlocked": "這些記錄尚待提交。請等待相關執行結束或取消後再重新整理。",
|
|
10100
10243
|
"clearSource": "清空{{name}}",
|
|
10101
|
-
"
|
|
10244
|
+
"sourceUsage": "{{name}}用量",
|
|
10102
10245
|
"confirmTitle": "清空「{{name}}」?",
|
|
10103
10246
|
"confirmValues": "將清空{{scope}}環境儲存的 {{count}} 筆資料,後續執行將無法讀取這些值。",
|
|
10104
10247
|
"confirmHistory": "將清空{{scope}}環境的 {{count}} 筆去重記錄,這些項目之後可能再次被處理。",
|
|
@@ -10109,6 +10252,14 @@ var resources = {
|
|
|
10109
10252
|
"loadFailed": "載入失敗",
|
|
10110
10253
|
"valuesHelp": "{{name}}:工作流主動儲存的內容,後續執行可以繼續讀取。",
|
|
10111
10254
|
"historyHelp": "{{name}}:項目的識別標記,用來避免重複處理。"
|
|
10255
|
+
},
|
|
10256
|
+
workflowTransfer: {
|
|
10257
|
+
"includeDependencies": "包含參照的工作流程",
|
|
10258
|
+
"workflowCount": "{{count}} 個工作流程",
|
|
10259
|
+
"unavailable": "{{count}} 個參照的工作流程無法使用。",
|
|
10260
|
+
"export": "匯出",
|
|
10261
|
+
"hostUnsupported": "目前的宿主尚未支援匯入工作流程套件。",
|
|
10262
|
+
"unnamed": "未命名工作流程"
|
|
10112
10263
|
}
|
|
10113
10264
|
},
|
|
10114
10265
|
"ja": {
|
|
@@ -11425,7 +11576,10 @@ var resources = {
|
|
|
11425
11576
|
"discardTitle": "変更を破棄しますか?",
|
|
11426
11577
|
"discardDescription": "ワークフロー設定の変更は保存されていません。",
|
|
11427
11578
|
"continueEditing": "編集を続ける",
|
|
11428
|
-
"discardChanges": "変更を破棄"
|
|
11579
|
+
"discardChanges": "変更を破棄",
|
|
11580
|
+
"icon": "アイコン",
|
|
11581
|
+
"resetIcon": "アイコンをリセット",
|
|
11582
|
+
"description": "説明"
|
|
11429
11583
|
},
|
|
11430
11584
|
flowState: {
|
|
11431
11585
|
"title": "永続データ",
|
|
@@ -11439,7 +11593,7 @@ var resources = {
|
|
|
11439
11593
|
"clear": "消去",
|
|
11440
11594
|
"orphaned": "現在のビューの外",
|
|
11441
11595
|
"nearLimit": "フローの重複履歴が 80% 以上使用されています。不要な履歴を削除してください。",
|
|
11442
|
-
"
|
|
11596
|
+
"usage": "使用量",
|
|
11443
11597
|
"scope": "スコープ",
|
|
11444
11598
|
"refresh": "更新",
|
|
11445
11599
|
"cancel": "キャンセル",
|
|
@@ -11467,7 +11621,7 @@ var resources = {
|
|
|
11467
11621
|
"pendingClear": "{{count}} 件が確定待ちです。関連する実行の完了またはキャンセル後に消去できます。",
|
|
11468
11622
|
"clearBlocked": "確定待ちの記録があります。関連する実行の完了またはキャンセル後に更新してください。",
|
|
11469
11623
|
"clearSource": "{{name}}を消去",
|
|
11470
|
-
"
|
|
11624
|
+
"sourceUsage": "{{name}}の使用量",
|
|
11471
11625
|
"confirmTitle": "「{{name}}」を消去しますか?",
|
|
11472
11626
|
"confirmValues": "{{scope}}環境の保存データ {{count}} 件を消去します。以降の実行ではこれらの値を読み取れなくなります。",
|
|
11473
11627
|
"confirmHistory": "{{scope}}環境の重複排除記録 {{count}} 件を消去します。これらの項目が再処理される場合があります。",
|
|
@@ -11478,6 +11632,14 @@ var resources = {
|
|
|
11478
11632
|
"loadFailed": "読み込みに失敗しました",
|
|
11479
11633
|
"valuesHelp": "{{name}}:フローが明示的に保存し、後続の実行で読み取れる内容です。",
|
|
11480
11634
|
"historyHelp": "{{name}}:同じ項目を繰り返し処理しないための識別情報です。"
|
|
11635
|
+
},
|
|
11636
|
+
workflowTransfer: {
|
|
11637
|
+
"includeDependencies": "参照先のワークフローを含める",
|
|
11638
|
+
"workflowCount": "ワークフロー({{count}} 件)",
|
|
11639
|
+
"unavailable": "参照先のワークフロー {{count}} 件を利用できません。",
|
|
11640
|
+
"export": "エクスポート",
|
|
11641
|
+
"hostUnsupported": "このホストはワークフローバンドルのインポートにまだ対応していません。",
|
|
11642
|
+
"unnamed": "無題のワークフロー"
|
|
11481
11643
|
}
|
|
11482
11644
|
},
|
|
11483
11645
|
"ko": {
|
|
@@ -12794,7 +12956,10 @@ var resources = {
|
|
|
12794
12956
|
"discardTitle": "변경 사항을 버릴까요?",
|
|
12795
12957
|
"discardDescription": "워크플로 설정의 변경 사항이 저장되지 않았습니다.",
|
|
12796
12958
|
"continueEditing": "계속 편집",
|
|
12797
|
-
"discardChanges": "변경 사항 버리기"
|
|
12959
|
+
"discardChanges": "변경 사항 버리기",
|
|
12960
|
+
"icon": "아이콘",
|
|
12961
|
+
"resetIcon": "아이콘 초기화",
|
|
12962
|
+
"description": "설명"
|
|
12798
12963
|
},
|
|
12799
12964
|
flowState: {
|
|
12800
12965
|
"title": "영구 데이터",
|
|
@@ -12808,7 +12973,7 @@ var resources = {
|
|
|
12808
12973
|
"clear": "지우기",
|
|
12809
12974
|
"orphaned": "현재 보기 외부",
|
|
12810
12975
|
"nearLimit": "Flow 중복 기록이 80% 이상 찼습니다. 필요 없는 기록을 지우세요.",
|
|
12811
|
-
"
|
|
12976
|
+
"usage": "사용량",
|
|
12812
12977
|
"scope": "범위",
|
|
12813
12978
|
"refresh": "새로 고침",
|
|
12814
12979
|
"cancel": "취소",
|
|
@@ -12836,7 +13001,7 @@ var resources = {
|
|
|
12836
13001
|
"pendingClear": "{{count}}개 확정 대기 중. 관련 실행이 완료되거나 취소된 후 지울 수 있습니다.",
|
|
12837
13002
|
"clearBlocked": "확정 대기 중인 기록이 있습니다. 관련 실행을 완료하거나 취소한 후 새로 고침하세요.",
|
|
12838
13003
|
"clearSource": "{{name}} 지우기",
|
|
12839
|
-
"
|
|
13004
|
+
"sourceUsage": "{{name}} 사용량",
|
|
12840
13005
|
"confirmTitle": "{{name}}을(를) 지울까요?",
|
|
12841
13006
|
"confirmValues": "{{scope}} 환경에 저장된 데이터 {{count}}개를 지웁니다. 이후 실행에서 이 값을 읽을 수 없습니다.",
|
|
12842
13007
|
"confirmHistory": "{{scope}} 환경의 중복 제거 기록 {{count}}개를 지웁니다. 해당 항목이 다시 처리될 수 있습니다.",
|
|
@@ -12847,6 +13012,14 @@ var resources = {
|
|
|
12847
13012
|
"loadFailed": "불러오기 실패",
|
|
12848
13013
|
"valuesHelp": "{{name}}: 워크플로가 직접 저장하여 이후 실행에서 읽을 수 있는 내용입니다.",
|
|
12849
13014
|
"historyHelp": "{{name}}: 같은 항목을 반복 처리하지 않기 위한 식별 정보입니다."
|
|
13015
|
+
},
|
|
13016
|
+
workflowTransfer: {
|
|
13017
|
+
"includeDependencies": "참조된 워크플로 포함",
|
|
13018
|
+
"workflowCount": "워크플로 {{count}}개",
|
|
13019
|
+
"unavailable": "참조된 워크플로 {{count}}개를 사용할 수 없습니다.",
|
|
13020
|
+
"export": "내보내기",
|
|
13021
|
+
"hostUnsupported": "이 호스트는 아직 워크플로 번들 가져오기를 지원하지 않습니다.",
|
|
13022
|
+
"unnamed": "이름 없는 워크플로"
|
|
12850
13023
|
}
|
|
12851
13024
|
},
|
|
12852
13025
|
"ru": {
|
|
@@ -14163,7 +14336,10 @@ var resources = {
|
|
|
14163
14336
|
"discardTitle": "Отменить изменения?",
|
|
14164
14337
|
"discardDescription": "Изменения настроек процесса не сохранены.",
|
|
14165
14338
|
"continueEditing": "Продолжить редактирование",
|
|
14166
|
-
"discardChanges": "Отменить изменения"
|
|
14339
|
+
"discardChanges": "Отменить изменения",
|
|
14340
|
+
"icon": "Значок",
|
|
14341
|
+
"resetIcon": "Сбросить значок",
|
|
14342
|
+
"description": "Описание"
|
|
14167
14343
|
},
|
|
14168
14344
|
flowState: {
|
|
14169
14345
|
"title": "Постоянные данные",
|
|
@@ -14177,7 +14353,7 @@ var resources = {
|
|
|
14177
14353
|
"clear": "Очистить",
|
|
14178
14354
|
"orphaned": "Вне текущего представления",
|
|
14179
14355
|
"nearLimit": "История Flow заполнена минимум на 80 %. Удалите ненужные записи.",
|
|
14180
|
-
"
|
|
14356
|
+
"usage": "Использование",
|
|
14181
14357
|
"scope": "Область",
|
|
14182
14358
|
"refresh": "Обновить",
|
|
14183
14359
|
"cancel": "Отмена",
|
|
@@ -14205,7 +14381,7 @@ var resources = {
|
|
|
14205
14381
|
"pendingClear": "Ожидают фиксации: {{count}}. Завершите или отмените связанные запуски перед очисткой.",
|
|
14206
14382
|
"clearBlocked": "Есть записи, ожидающие фиксации. Завершите или отмените связанные запуски и обновите данные.",
|
|
14207
14383
|
"clearSource": "Очистить {{name}}",
|
|
14208
|
-
"
|
|
14384
|
+
"sourceUsage": "Использование: {{name}}",
|
|
14209
14385
|
"confirmTitle": "Очистить «{{name}}»?",
|
|
14210
14386
|
"confirmValues": "Будут удалены сохранённые записи ({{count}}) в среде «{{scope}}». Последующие запуски не смогут прочитать эти значения.",
|
|
14211
14387
|
"confirmHistory": "Будут удалены записи дедупликации ({{count}}) в среде «{{scope}}». Эти элементы могут быть обработаны повторно.",
|
|
@@ -14216,6 +14392,14 @@ var resources = {
|
|
|
14216
14392
|
"loadFailed": "Не удалось загрузить",
|
|
14217
14393
|
"valuesHelp": "{{name}}: данные, явно сохранённые процессом для чтения в следующих запусках.",
|
|
14218
14394
|
"historyHelp": "{{name}}: идентификаторы элементов, предотвращающие повторную обработку."
|
|
14395
|
+
},
|
|
14396
|
+
workflowTransfer: {
|
|
14397
|
+
"includeDependencies": "Включить связанные процессы",
|
|
14398
|
+
"workflowCount": "Процессы ({{count}})",
|
|
14399
|
+
"unavailable": "Связанные процессы недоступны: {{count}}.",
|
|
14400
|
+
"export": "Экспортировать",
|
|
14401
|
+
"hostUnsupported": "Этот хост пока не поддерживает импорт пакетов процессов.",
|
|
14402
|
+
"unnamed": "Процесс без названия"
|
|
14219
14403
|
}
|
|
14220
14404
|
},
|
|
14221
14405
|
"fr": {
|
|
@@ -15532,7 +15716,10 @@ var resources = {
|
|
|
15532
15716
|
"discardTitle": "Ignorer les modifications ?",
|
|
15533
15717
|
"discardDescription": "Les modifications des paramètres du workflow n’ont pas été enregistrées.",
|
|
15534
15718
|
"continueEditing": "Continuer à modifier",
|
|
15535
|
-
"discardChanges": "Ignorer les modifications"
|
|
15719
|
+
"discardChanges": "Ignorer les modifications",
|
|
15720
|
+
"icon": "Icône",
|
|
15721
|
+
"resetIcon": "Réinitialiser l’icône",
|
|
15722
|
+
"description": "Description"
|
|
15536
15723
|
},
|
|
15537
15724
|
flowState: {
|
|
15538
15725
|
"title": "Données persistantes",
|
|
@@ -15546,7 +15733,7 @@ var resources = {
|
|
|
15546
15733
|
"clear": "Effacer",
|
|
15547
15734
|
"orphaned": "Hors de la vue actuelle",
|
|
15548
15735
|
"nearLimit": "L’historique du Flow est rempli à au moins 80 %. Effacez les entrées inutiles.",
|
|
15549
|
-
"
|
|
15736
|
+
"usage": "Utilisation",
|
|
15550
15737
|
"scope": "Portée",
|
|
15551
15738
|
"refresh": "Actualiser",
|
|
15552
15739
|
"cancel": "Annuler",
|
|
@@ -15574,7 +15761,7 @@ var resources = {
|
|
|
15574
15761
|
"pendingClear": "{{count}} en attente de validation. Terminez ou annulez les exécutions concernées avant de vider.",
|
|
15575
15762
|
"clearBlocked": "Des entrées sont en attente de validation. Terminez ou annulez les exécutions concernées, puis actualisez.",
|
|
15576
15763
|
"clearSource": "Vider {{name}}",
|
|
15577
|
-
"
|
|
15764
|
+
"sourceUsage": "Utilisation de {{name}}",
|
|
15578
15765
|
"confirmTitle": "Vider « {{name}} » ?",
|
|
15579
15766
|
"confirmValues": "Cela supprimera {{count}} entrées enregistrées en environnement {{scope}}. Les exécutions suivantes ne pourront plus lire ces valeurs.",
|
|
15580
15767
|
"confirmHistory": "Cela supprimera {{count}} entrées de déduplication en environnement {{scope}}. Ces éléments pourront être traités à nouveau.",
|
|
@@ -15585,6 +15772,14 @@ var resources = {
|
|
|
15585
15772
|
"loadFailed": "Chargement impossible",
|
|
15586
15773
|
"valuesHelp": "{{name}} : contenu enregistré explicitement par le workflow, accessible aux exécutions suivantes.",
|
|
15587
15774
|
"historyHelp": "{{name}} : identifiants des éléments utilisés pour éviter les traitements en double."
|
|
15775
|
+
},
|
|
15776
|
+
workflowTransfer: {
|
|
15777
|
+
"includeDependencies": "Inclure les workflows référencés",
|
|
15778
|
+
"workflowCount": "Workflows ({{count}})",
|
|
15779
|
+
"unavailable": "Workflows référencés indisponibles : {{count}}.",
|
|
15780
|
+
"export": "Exporter",
|
|
15781
|
+
"hostUnsupported": "Cet hôte ne prend pas encore en charge l’import de lots de workflows.",
|
|
15782
|
+
"unnamed": "Workflow sans nom"
|
|
15588
15783
|
}
|
|
15589
15784
|
}
|
|
15590
15785
|
};
|
|
@@ -16431,6 +16626,326 @@ function EmptyContent({ className, ...props }) {
|
|
|
16431
16626
|
});
|
|
16432
16627
|
}
|
|
16433
16628
|
//#endregion
|
|
16629
|
+
//#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/icon/defaults.js
|
|
16630
|
+
/** Default values for dimensions */
|
|
16631
|
+
var defaultIconDimensions = Object.freeze({
|
|
16632
|
+
left: 0,
|
|
16633
|
+
top: 0,
|
|
16634
|
+
width: 16,
|
|
16635
|
+
height: 16
|
|
16636
|
+
});
|
|
16637
|
+
/** Default values for transformations */
|
|
16638
|
+
var defaultIconTransformations = Object.freeze({
|
|
16639
|
+
rotate: 0,
|
|
16640
|
+
vFlip: false,
|
|
16641
|
+
hFlip: false
|
|
16642
|
+
});
|
|
16643
|
+
/** Default values for all optional IconifyIcon properties */
|
|
16644
|
+
var defaultIconProps = Object.freeze({
|
|
16645
|
+
...defaultIconDimensions,
|
|
16646
|
+
...defaultIconTransformations
|
|
16647
|
+
});
|
|
16648
|
+
/** Default values for all properties used in ExtendedIconifyIcon */
|
|
16649
|
+
var defaultExtendedIconProps = Object.freeze({
|
|
16650
|
+
...defaultIconProps,
|
|
16651
|
+
body: "",
|
|
16652
|
+
hidden: false
|
|
16653
|
+
});
|
|
16654
|
+
//#endregion
|
|
16655
|
+
//#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/customisations/defaults.js
|
|
16656
|
+
/**
|
|
16657
|
+
* Default icon customisations values
|
|
16658
|
+
*/
|
|
16659
|
+
var defaultIconSizeCustomisations = Object.freeze({
|
|
16660
|
+
width: null,
|
|
16661
|
+
height: null
|
|
16662
|
+
});
|
|
16663
|
+
var defaultIconCustomisations = Object.freeze({
|
|
16664
|
+
...defaultIconSizeCustomisations,
|
|
16665
|
+
...defaultIconTransformations
|
|
16666
|
+
});
|
|
16667
|
+
//#endregion
|
|
16668
|
+
//#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/icon/transformations.js
|
|
16669
|
+
/**
|
|
16670
|
+
* Merge transformations
|
|
16671
|
+
*/
|
|
16672
|
+
function mergeIconTransformations(obj1, obj2) {
|
|
16673
|
+
const result = {};
|
|
16674
|
+
if (!obj1.hFlip !== !obj2.hFlip) result.hFlip = true;
|
|
16675
|
+
if (!obj1.vFlip !== !obj2.vFlip) result.vFlip = true;
|
|
16676
|
+
const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
|
|
16677
|
+
if (rotate) result.rotate = rotate;
|
|
16678
|
+
return result;
|
|
16679
|
+
}
|
|
16680
|
+
//#endregion
|
|
16681
|
+
//#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/icon/merge.js
|
|
16682
|
+
/**
|
|
16683
|
+
* Merge icon and alias
|
|
16684
|
+
*
|
|
16685
|
+
* Can also be used to merge default values and icon
|
|
16686
|
+
*/
|
|
16687
|
+
function mergeIconData(parent, child) {
|
|
16688
|
+
const result = mergeIconTransformations(parent, child);
|
|
16689
|
+
for (const key in defaultExtendedIconProps) if (key in defaultIconTransformations) {
|
|
16690
|
+
if (key in parent && !(key in result)) result[key] = defaultIconTransformations[key];
|
|
16691
|
+
} else if (key in child) result[key] = child[key];
|
|
16692
|
+
else if (key in parent) result[key] = parent[key];
|
|
16693
|
+
return result;
|
|
16694
|
+
}
|
|
16695
|
+
//#endregion
|
|
16696
|
+
//#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/icon-set/tree.js
|
|
16697
|
+
/**
|
|
16698
|
+
* Resolve icon set icons
|
|
16699
|
+
*
|
|
16700
|
+
* Returns parent icon for each icon
|
|
16701
|
+
*/
|
|
16702
|
+
function getIconsTree(data, names) {
|
|
16703
|
+
const icons = data.icons;
|
|
16704
|
+
const aliases = data.aliases || Object.create(null);
|
|
16705
|
+
const resolved = Object.create(null);
|
|
16706
|
+
function resolve(name) {
|
|
16707
|
+
if (icons[name]) return resolved[name] = [];
|
|
16708
|
+
if (!(name in resolved)) {
|
|
16709
|
+
resolved[name] = null;
|
|
16710
|
+
const parent = aliases[name] && aliases[name].parent;
|
|
16711
|
+
const value = parent && resolve(parent);
|
|
16712
|
+
if (value) resolved[name] = [parent].concat(value);
|
|
16713
|
+
}
|
|
16714
|
+
return resolved[name];
|
|
16715
|
+
}
|
|
16716
|
+
(names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
|
|
16717
|
+
return resolved;
|
|
16718
|
+
}
|
|
16719
|
+
//#endregion
|
|
16720
|
+
//#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/icon-set/get-icon.js
|
|
16721
|
+
/**
|
|
16722
|
+
* Get icon data, using prepared aliases tree
|
|
16723
|
+
*/
|
|
16724
|
+
function internalGetIconData(data, name, tree) {
|
|
16725
|
+
const icons = data.icons;
|
|
16726
|
+
const aliases = data.aliases || Object.create(null);
|
|
16727
|
+
let currentProps = {};
|
|
16728
|
+
function parse(name) {
|
|
16729
|
+
currentProps = mergeIconData(icons[name] || aliases[name], currentProps);
|
|
16730
|
+
}
|
|
16731
|
+
parse(name);
|
|
16732
|
+
tree.forEach(parse);
|
|
16733
|
+
return mergeIconData(data, currentProps);
|
|
16734
|
+
}
|
|
16735
|
+
/**
|
|
16736
|
+
* Get data for icon
|
|
16737
|
+
*/
|
|
16738
|
+
function getIconData(data, name) {
|
|
16739
|
+
if (data.icons[name]) return internalGetIconData(data, name, []);
|
|
16740
|
+
const tree = getIconsTree(data, [name])[name];
|
|
16741
|
+
return tree ? internalGetIconData(data, name, tree) : null;
|
|
16742
|
+
}
|
|
16743
|
+
//#endregion
|
|
16744
|
+
//#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/svg/size.js
|
|
16745
|
+
/**
|
|
16746
|
+
* Regular expressions for calculating dimensions
|
|
16747
|
+
*/
|
|
16748
|
+
var unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
|
|
16749
|
+
var unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
16750
|
+
function calculateSize(size, ratio, precision) {
|
|
16751
|
+
if (ratio === 1) return size;
|
|
16752
|
+
precision = precision || 100;
|
|
16753
|
+
if (typeof size === "number") return Math.ceil(size * ratio * precision) / precision;
|
|
16754
|
+
if (typeof size !== "string") return size;
|
|
16755
|
+
const oldParts = size.split(unitsSplit);
|
|
16756
|
+
if (oldParts === null || !oldParts.length) return size;
|
|
16757
|
+
const newParts = [];
|
|
16758
|
+
let code = oldParts.shift();
|
|
16759
|
+
let isNumber = unitsTest.test(code);
|
|
16760
|
+
while (true) {
|
|
16761
|
+
if (isNumber) {
|
|
16762
|
+
const num = parseFloat(code);
|
|
16763
|
+
if (isNaN(num)) newParts.push(code);
|
|
16764
|
+
else newParts.push(Math.ceil(num * ratio * precision) / precision);
|
|
16765
|
+
} else newParts.push(code);
|
|
16766
|
+
code = oldParts.shift();
|
|
16767
|
+
if (code === void 0) return newParts.join("");
|
|
16768
|
+
isNumber = !isNumber;
|
|
16769
|
+
}
|
|
16770
|
+
}
|
|
16771
|
+
//#endregion
|
|
16772
|
+
//#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/svg/defs.js
|
|
16773
|
+
function splitSVGDefs(content, tag = "defs") {
|
|
16774
|
+
let defs = "";
|
|
16775
|
+
const index = content.indexOf("<" + tag);
|
|
16776
|
+
while (index >= 0) {
|
|
16777
|
+
const start = content.indexOf(">", index);
|
|
16778
|
+
const end = content.indexOf("</" + tag);
|
|
16779
|
+
if (start === -1 || end === -1) break;
|
|
16780
|
+
const endEnd = content.indexOf(">", end);
|
|
16781
|
+
if (endEnd === -1) break;
|
|
16782
|
+
defs += content.slice(start + 1, end).trim();
|
|
16783
|
+
content = content.slice(0, index).trim() + content.slice(endEnd + 1);
|
|
16784
|
+
}
|
|
16785
|
+
return {
|
|
16786
|
+
defs,
|
|
16787
|
+
content
|
|
16788
|
+
};
|
|
16789
|
+
}
|
|
16790
|
+
/**
|
|
16791
|
+
* Merge defs and content
|
|
16792
|
+
*/
|
|
16793
|
+
function mergeDefsAndContent(defs, content) {
|
|
16794
|
+
return defs ? "<defs>" + defs + "</defs>" + content : content;
|
|
16795
|
+
}
|
|
16796
|
+
/**
|
|
16797
|
+
* Wrap SVG content, without wrapping definitions
|
|
16798
|
+
*/
|
|
16799
|
+
function wrapSVGContent(body, start, end) {
|
|
16800
|
+
const split = splitSVGDefs(body);
|
|
16801
|
+
return mergeDefsAndContent(split.defs, start + split.content + end);
|
|
16802
|
+
}
|
|
16803
|
+
//#endregion
|
|
16804
|
+
//#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/svg/build.js
|
|
16805
|
+
/**
|
|
16806
|
+
* Check if value should be unset. Allows multiple keywords
|
|
16807
|
+
*/
|
|
16808
|
+
var isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
|
|
16809
|
+
/**
|
|
16810
|
+
* Get SVG attributes and content from icon + customisations
|
|
16811
|
+
*
|
|
16812
|
+
* Does not generate style to make it compatible with frameworks that use objects for style, such as React.
|
|
16813
|
+
* Instead, it generates 'inline' value. If true, rendering engine should add verticalAlign: -0.125em to icon.
|
|
16814
|
+
*
|
|
16815
|
+
* Customisations should be normalised by platform specific parser.
|
|
16816
|
+
* Result should be converted to <svg> by platform specific parser.
|
|
16817
|
+
* Use replaceIDs to generate unique IDs for body.
|
|
16818
|
+
*/
|
|
16819
|
+
function iconToSVG(icon, customisations) {
|
|
16820
|
+
const fullIcon = {
|
|
16821
|
+
...defaultIconProps,
|
|
16822
|
+
...icon
|
|
16823
|
+
};
|
|
16824
|
+
const fullCustomisations = {
|
|
16825
|
+
...defaultIconCustomisations,
|
|
16826
|
+
...customisations
|
|
16827
|
+
};
|
|
16828
|
+
const box = {
|
|
16829
|
+
left: fullIcon.left,
|
|
16830
|
+
top: fullIcon.top,
|
|
16831
|
+
width: fullIcon.width,
|
|
16832
|
+
height: fullIcon.height
|
|
16833
|
+
};
|
|
16834
|
+
let body = fullIcon.body;
|
|
16835
|
+
[fullIcon, fullCustomisations].forEach((props) => {
|
|
16836
|
+
const transformations = [];
|
|
16837
|
+
const hFlip = props.hFlip;
|
|
16838
|
+
const vFlip = props.vFlip;
|
|
16839
|
+
let rotation = props.rotate;
|
|
16840
|
+
if (hFlip) if (vFlip) rotation += 2;
|
|
16841
|
+
else {
|
|
16842
|
+
transformations.push("translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")");
|
|
16843
|
+
transformations.push("scale(-1 1)");
|
|
16844
|
+
box.top = box.left = 0;
|
|
16845
|
+
}
|
|
16846
|
+
else if (vFlip) {
|
|
16847
|
+
transformations.push("translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")");
|
|
16848
|
+
transformations.push("scale(1 -1)");
|
|
16849
|
+
box.top = box.left = 0;
|
|
16850
|
+
}
|
|
16851
|
+
let tempValue;
|
|
16852
|
+
if (rotation < 0) rotation -= Math.floor(rotation / 4) * 4;
|
|
16853
|
+
rotation = rotation % 4;
|
|
16854
|
+
switch (rotation) {
|
|
16855
|
+
case 1:
|
|
16856
|
+
tempValue = box.height / 2 + box.top;
|
|
16857
|
+
transformations.unshift("rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")");
|
|
16858
|
+
break;
|
|
16859
|
+
case 2:
|
|
16860
|
+
transformations.unshift("rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")");
|
|
16861
|
+
break;
|
|
16862
|
+
case 3:
|
|
16863
|
+
tempValue = box.width / 2 + box.left;
|
|
16864
|
+
transformations.unshift("rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")");
|
|
16865
|
+
}
|
|
16866
|
+
if (rotation % 2 === 1) {
|
|
16867
|
+
if (box.left !== box.top) {
|
|
16868
|
+
tempValue = box.left;
|
|
16869
|
+
box.left = box.top;
|
|
16870
|
+
box.top = tempValue;
|
|
16871
|
+
}
|
|
16872
|
+
if (box.width !== box.height) {
|
|
16873
|
+
tempValue = box.width;
|
|
16874
|
+
box.width = box.height;
|
|
16875
|
+
box.height = tempValue;
|
|
16876
|
+
}
|
|
16877
|
+
}
|
|
16878
|
+
if (transformations.length) body = wrapSVGContent(body, "<g transform=\"" + transformations.join(" ") + "\">", "</g>");
|
|
16879
|
+
});
|
|
16880
|
+
const customisationsWidth = fullCustomisations.width;
|
|
16881
|
+
const customisationsHeight = fullCustomisations.height;
|
|
16882
|
+
const boxWidth = box.width;
|
|
16883
|
+
const boxHeight = box.height;
|
|
16884
|
+
let width;
|
|
16885
|
+
let height;
|
|
16886
|
+
if (customisationsWidth === null) {
|
|
16887
|
+
height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
|
|
16888
|
+
width = calculateSize(height, boxWidth / boxHeight);
|
|
16889
|
+
} else {
|
|
16890
|
+
width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
|
|
16891
|
+
height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
|
|
16892
|
+
}
|
|
16893
|
+
const attributes = {};
|
|
16894
|
+
const setAttr = (prop, value) => {
|
|
16895
|
+
if (!isUnsetKeyword(value)) attributes[prop] = value.toString();
|
|
16896
|
+
};
|
|
16897
|
+
setAttr("width", width);
|
|
16898
|
+
setAttr("height", height);
|
|
16899
|
+
const viewBox = [
|
|
16900
|
+
box.left,
|
|
16901
|
+
box.top,
|
|
16902
|
+
boxWidth,
|
|
16903
|
+
boxHeight
|
|
16904
|
+
];
|
|
16905
|
+
attributes.viewBox = viewBox.join(" ");
|
|
16906
|
+
return {
|
|
16907
|
+
attributes,
|
|
16908
|
+
viewBox,
|
|
16909
|
+
body
|
|
16910
|
+
};
|
|
16911
|
+
}
|
|
16912
|
+
//#endregion
|
|
16913
|
+
//#region ../../node_modules/.bun/@iconify+utils@3.1.4/node_modules/@iconify/utils/lib/svg/id.js
|
|
16914
|
+
/**
|
|
16915
|
+
* Regular expression for finding ids
|
|
16916
|
+
*/
|
|
16917
|
+
var regex = /\sid="(\S+)"/g;
|
|
16918
|
+
/**
|
|
16919
|
+
* Counters
|
|
16920
|
+
*/
|
|
16921
|
+
var counters = /* @__PURE__ */ new Map();
|
|
16922
|
+
/**
|
|
16923
|
+
* Get unique new ID
|
|
16924
|
+
*/
|
|
16925
|
+
function nextID(id) {
|
|
16926
|
+
id = id.replace(/[0-9]+$/, "") || "a";
|
|
16927
|
+
const count = counters.get(id) || 0;
|
|
16928
|
+
counters.set(id, count + 1);
|
|
16929
|
+
return count ? `${id}${count}` : id;
|
|
16930
|
+
}
|
|
16931
|
+
/**
|
|
16932
|
+
* Replace IDs in SVG output with unique IDs
|
|
16933
|
+
*/
|
|
16934
|
+
function replaceIDs(body) {
|
|
16935
|
+
const ids = [];
|
|
16936
|
+
let match;
|
|
16937
|
+
while (match = regex.exec(body)) ids.push(match[1]);
|
|
16938
|
+
if (!ids.length) return body;
|
|
16939
|
+
const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
16940
|
+
ids.forEach((id) => {
|
|
16941
|
+
const newID = nextID(id);
|
|
16942
|
+
const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
16943
|
+
body = body.replace(new RegExp("([#;\"])(" + escapedID + ")([\")]|\\.[a-z])", "g"), "$1" + newID + suffix + "$3");
|
|
16944
|
+
});
|
|
16945
|
+
body = body.replace(new RegExp(suffix, "g"), "");
|
|
16946
|
+
return body;
|
|
16947
|
+
}
|
|
16948
|
+
//#endregion
|
|
16434
16949
|
//#region src/ui/browser/input-group.tsx
|
|
16435
16950
|
var InputGroup = React.forwardRef(function InputGroup({ className, ...props }, ref) {
|
|
16436
16951
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -16510,35 +17025,1877 @@ function useFlowQuery(store, query) {
|
|
|
16510
17025
|
nextCursor: useVal(catalog?.$.nextCursor)
|
|
16511
17026
|
};
|
|
16512
17027
|
}
|
|
17028
|
+
var IconPicker_module_default = {
|
|
17029
|
+
container: "IconPicker_container_1b462",
|
|
17030
|
+
filter: "IconPicker_filter_1b462",
|
|
17031
|
+
tabs: "IconPicker_tabs_1b462",
|
|
17032
|
+
colors: "IconPicker_colors_1b462",
|
|
17033
|
+
color: "IconPicker_color_1b462",
|
|
17034
|
+
panel: "IconPicker_panel_1b462",
|
|
17035
|
+
row: "IconPicker_row_1b462",
|
|
17036
|
+
icon: "IconPicker_icon_1b462",
|
|
17037
|
+
subtitle: "IconPicker_subtitle_1b462",
|
|
17038
|
+
loading: "IconPicker_loading_1b462",
|
|
17039
|
+
spin: "IconPicker_spin_1b462"
|
|
17040
|
+
};
|
|
16513
17041
|
//#endregion
|
|
16514
|
-
//#region ../../node_modules/.bun
|
|
16515
|
-
|
|
16516
|
-
|
|
16517
|
-
|
|
16518
|
-
|
|
16519
|
-
|
|
16520
|
-
|
|
16521
|
-
|
|
16522
|
-
|
|
16523
|
-
|
|
16524
|
-
|
|
16525
|
-
|
|
16526
|
-
|
|
17042
|
+
//#region ../../node_modules/.bun/fzf@0.5.2/node_modules/fzf/dist/fzf.es.js
|
|
17043
|
+
/** @license
|
|
17044
|
+
* fzf v0.5.2
|
|
17045
|
+
* Copyright (c) 2021 Ajit
|
|
17046
|
+
* Licensed under BSD 3-Clause
|
|
17047
|
+
*/
|
|
17048
|
+
var normalized = {
|
|
17049
|
+
216: "O",
|
|
17050
|
+
223: "s",
|
|
17051
|
+
248: "o",
|
|
17052
|
+
273: "d",
|
|
17053
|
+
295: "h",
|
|
17054
|
+
305: "i",
|
|
17055
|
+
320: "l",
|
|
17056
|
+
322: "l",
|
|
17057
|
+
359: "t",
|
|
17058
|
+
383: "s",
|
|
17059
|
+
384: "b",
|
|
17060
|
+
385: "B",
|
|
17061
|
+
387: "b",
|
|
17062
|
+
390: "O",
|
|
17063
|
+
392: "c",
|
|
17064
|
+
393: "D",
|
|
17065
|
+
394: "D",
|
|
17066
|
+
396: "d",
|
|
17067
|
+
398: "E",
|
|
17068
|
+
400: "E",
|
|
17069
|
+
402: "f",
|
|
17070
|
+
403: "G",
|
|
17071
|
+
407: "I",
|
|
17072
|
+
409: "k",
|
|
17073
|
+
410: "l",
|
|
17074
|
+
412: "M",
|
|
17075
|
+
413: "N",
|
|
17076
|
+
414: "n",
|
|
17077
|
+
415: "O",
|
|
17078
|
+
421: "p",
|
|
17079
|
+
427: "t",
|
|
17080
|
+
429: "t",
|
|
17081
|
+
430: "T",
|
|
17082
|
+
434: "V",
|
|
17083
|
+
436: "y",
|
|
17084
|
+
438: "z",
|
|
17085
|
+
477: "e",
|
|
17086
|
+
485: "g",
|
|
17087
|
+
544: "N",
|
|
17088
|
+
545: "d",
|
|
17089
|
+
549: "z",
|
|
17090
|
+
564: "l",
|
|
17091
|
+
565: "n",
|
|
17092
|
+
566: "t",
|
|
17093
|
+
567: "j",
|
|
17094
|
+
570: "A",
|
|
17095
|
+
571: "C",
|
|
17096
|
+
572: "c",
|
|
17097
|
+
573: "L",
|
|
17098
|
+
574: "T",
|
|
17099
|
+
575: "s",
|
|
17100
|
+
576: "z",
|
|
17101
|
+
579: "B",
|
|
17102
|
+
580: "U",
|
|
17103
|
+
581: "V",
|
|
17104
|
+
582: "E",
|
|
17105
|
+
583: "e",
|
|
17106
|
+
584: "J",
|
|
17107
|
+
585: "j",
|
|
17108
|
+
586: "Q",
|
|
17109
|
+
587: "q",
|
|
17110
|
+
588: "R",
|
|
17111
|
+
589: "r",
|
|
17112
|
+
590: "Y",
|
|
17113
|
+
591: "y",
|
|
17114
|
+
592: "a",
|
|
17115
|
+
593: "a",
|
|
17116
|
+
595: "b",
|
|
17117
|
+
596: "o",
|
|
17118
|
+
597: "c",
|
|
17119
|
+
598: "d",
|
|
17120
|
+
599: "d",
|
|
17121
|
+
600: "e",
|
|
17122
|
+
603: "e",
|
|
17123
|
+
604: "e",
|
|
17124
|
+
605: "e",
|
|
17125
|
+
606: "e",
|
|
17126
|
+
607: "j",
|
|
17127
|
+
608: "g",
|
|
17128
|
+
609: "g",
|
|
17129
|
+
610: "G",
|
|
17130
|
+
613: "h",
|
|
17131
|
+
614: "h",
|
|
17132
|
+
616: "i",
|
|
17133
|
+
618: "I",
|
|
17134
|
+
619: "l",
|
|
17135
|
+
620: "l",
|
|
17136
|
+
621: "l",
|
|
17137
|
+
623: "m",
|
|
17138
|
+
624: "m",
|
|
17139
|
+
625: "m",
|
|
17140
|
+
626: "n",
|
|
17141
|
+
627: "n",
|
|
17142
|
+
628: "N",
|
|
17143
|
+
629: "o",
|
|
17144
|
+
633: "r",
|
|
17145
|
+
634: "r",
|
|
17146
|
+
635: "r",
|
|
17147
|
+
636: "r",
|
|
17148
|
+
637: "r",
|
|
17149
|
+
638: "r",
|
|
17150
|
+
639: "r",
|
|
17151
|
+
640: "R",
|
|
17152
|
+
641: "R",
|
|
17153
|
+
642: "s",
|
|
17154
|
+
647: "t",
|
|
17155
|
+
648: "t",
|
|
17156
|
+
649: "u",
|
|
17157
|
+
651: "v",
|
|
17158
|
+
652: "v",
|
|
17159
|
+
653: "w",
|
|
17160
|
+
654: "y",
|
|
17161
|
+
655: "Y",
|
|
17162
|
+
656: "z",
|
|
17163
|
+
657: "z",
|
|
17164
|
+
663: "c",
|
|
17165
|
+
665: "B",
|
|
17166
|
+
666: "e",
|
|
17167
|
+
667: "G",
|
|
17168
|
+
668: "H",
|
|
17169
|
+
669: "j",
|
|
17170
|
+
670: "k",
|
|
17171
|
+
671: "L",
|
|
17172
|
+
672: "q",
|
|
17173
|
+
686: "h",
|
|
17174
|
+
867: "a",
|
|
17175
|
+
868: "e",
|
|
17176
|
+
869: "i",
|
|
17177
|
+
870: "o",
|
|
17178
|
+
871: "u",
|
|
17179
|
+
872: "c",
|
|
17180
|
+
873: "d",
|
|
17181
|
+
874: "h",
|
|
17182
|
+
875: "m",
|
|
17183
|
+
876: "r",
|
|
17184
|
+
877: "t",
|
|
17185
|
+
878: "v",
|
|
17186
|
+
879: "x",
|
|
17187
|
+
7424: "A",
|
|
17188
|
+
7427: "B",
|
|
17189
|
+
7428: "C",
|
|
17190
|
+
7429: "D",
|
|
17191
|
+
7431: "E",
|
|
17192
|
+
7432: "e",
|
|
17193
|
+
7433: "i",
|
|
17194
|
+
7434: "J",
|
|
17195
|
+
7435: "K",
|
|
17196
|
+
7436: "L",
|
|
17197
|
+
7437: "M",
|
|
17198
|
+
7438: "N",
|
|
17199
|
+
7439: "O",
|
|
17200
|
+
7440: "O",
|
|
17201
|
+
7441: "o",
|
|
17202
|
+
7442: "o",
|
|
17203
|
+
7443: "o",
|
|
17204
|
+
7446: "o",
|
|
17205
|
+
7447: "o",
|
|
17206
|
+
7448: "P",
|
|
17207
|
+
7449: "R",
|
|
17208
|
+
7450: "R",
|
|
17209
|
+
7451: "T",
|
|
17210
|
+
7452: "U",
|
|
17211
|
+
7453: "u",
|
|
17212
|
+
7454: "u",
|
|
17213
|
+
7455: "m",
|
|
17214
|
+
7456: "V",
|
|
17215
|
+
7457: "W",
|
|
17216
|
+
7458: "Z",
|
|
17217
|
+
7522: "i",
|
|
17218
|
+
7523: "r",
|
|
17219
|
+
7524: "u",
|
|
17220
|
+
7525: "v",
|
|
17221
|
+
7834: "a",
|
|
17222
|
+
7835: "s",
|
|
17223
|
+
8305: "i",
|
|
17224
|
+
8341: "h",
|
|
17225
|
+
8342: "k",
|
|
17226
|
+
8343: "l",
|
|
17227
|
+
8344: "m",
|
|
17228
|
+
8345: "n",
|
|
17229
|
+
8346: "p",
|
|
17230
|
+
8347: "s",
|
|
17231
|
+
8348: "t",
|
|
17232
|
+
8580: "c"
|
|
17233
|
+
};
|
|
17234
|
+
for (let i = "̀".codePointAt(0); i <= "ͯ".codePointAt(0); ++i) {
|
|
17235
|
+
const diacritic = String.fromCodePoint(i);
|
|
17236
|
+
for (const asciiChar of "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") {
|
|
17237
|
+
const withDiacriticCodePoint = (asciiChar + diacritic).normalize().codePointAt(0);
|
|
17238
|
+
if (withDiacriticCodePoint > 126) normalized[withDiacriticCodePoint] = asciiChar;
|
|
17239
|
+
}
|
|
17240
|
+
}
|
|
17241
|
+
var ranges = {
|
|
17242
|
+
a: [7844, 7863],
|
|
17243
|
+
e: [7870, 7879],
|
|
17244
|
+
o: [7888, 7907],
|
|
17245
|
+
u: [7912, 7921]
|
|
17246
|
+
};
|
|
17247
|
+
for (const lowerChar of Object.keys(ranges)) {
|
|
17248
|
+
const upperChar = lowerChar.toUpperCase();
|
|
17249
|
+
for (let i = ranges[lowerChar][0]; i <= ranges[lowerChar][1]; ++i) normalized[i] = i % 2 === 0 ? upperChar : lowerChar;
|
|
17250
|
+
}
|
|
17251
|
+
function normalizeRune(rune) {
|
|
17252
|
+
if (rune < 192 || rune > 8580) return rune;
|
|
17253
|
+
const normalizedChar = normalized[rune];
|
|
17254
|
+
if (normalizedChar !== void 0) return normalizedChar.codePointAt(0);
|
|
17255
|
+
return rune;
|
|
17256
|
+
}
|
|
17257
|
+
function toShort(number) {
|
|
17258
|
+
return number;
|
|
17259
|
+
}
|
|
17260
|
+
function toInt(number) {
|
|
17261
|
+
return number;
|
|
17262
|
+
}
|
|
17263
|
+
function maxInt16(num1, num2) {
|
|
17264
|
+
return num1 > num2 ? num1 : num2;
|
|
17265
|
+
}
|
|
17266
|
+
var strToRunes = (str) => str.split("").map((s) => s.codePointAt(0));
|
|
17267
|
+
var whitespaceRunes = new Set(" \f\n\r \v\xA0 \u2028\u2029 ".split("").map((v) => v.codePointAt(0)));
|
|
17268
|
+
for (let codePoint = " ".codePointAt(0); codePoint <= " ".codePointAt(0); codePoint++) whitespaceRunes.add(codePoint);
|
|
17269
|
+
var MAX_ASCII = "".codePointAt(0);
|
|
17270
|
+
var CAPITAL_A_RUNE = "A".codePointAt(0);
|
|
17271
|
+
var CAPITAL_Z_RUNE = "Z".codePointAt(0);
|
|
17272
|
+
var SMALL_A_RUNE = "a".codePointAt(0);
|
|
17273
|
+
var SMALL_Z_RUNE = "z".codePointAt(0);
|
|
17274
|
+
var NUMERAL_ZERO_RUNE = "0".codePointAt(0);
|
|
17275
|
+
var NUMERAL_NINE_RUNE = "9".codePointAt(0);
|
|
17276
|
+
function indexAt(index, max, forward) {
|
|
17277
|
+
if (forward) return index;
|
|
17278
|
+
return max - index - 1;
|
|
17279
|
+
}
|
|
17280
|
+
var SCORE_MATCH = 16;
|
|
17281
|
+
var SCORE_GAP_START = -3;
|
|
17282
|
+
var SCORE_GAP_EXTENTION = -1;
|
|
17283
|
+
var BONUS_BOUNDARY = SCORE_MATCH / 2;
|
|
17284
|
+
var BONUS_NON_WORD = SCORE_MATCH / 2;
|
|
17285
|
+
var BONUS_CAMEL_123 = 7;
|
|
17286
|
+
var BONUS_CONSECUTIVE = 4;
|
|
17287
|
+
var BONUS_FIRST_CHAR_MULTIPLIER = 2;
|
|
17288
|
+
function createPosSet(withPos) {
|
|
17289
|
+
if (withPos) return /* @__PURE__ */ new Set();
|
|
17290
|
+
return null;
|
|
17291
|
+
}
|
|
17292
|
+
function alloc16(offset, slab2, size) {
|
|
17293
|
+
if (slab2 !== null && slab2.i16.length > offset + size) {
|
|
17294
|
+
const subarray = slab2.i16.subarray(offset, offset + size);
|
|
17295
|
+
return [offset + size, subarray];
|
|
17296
|
+
}
|
|
17297
|
+
return [offset, new Int16Array(size)];
|
|
17298
|
+
}
|
|
17299
|
+
function alloc32(offset, slab2, size) {
|
|
17300
|
+
if (slab2 !== null && slab2.i32.length > offset + size) {
|
|
17301
|
+
const subarray = slab2.i32.subarray(offset, offset + size);
|
|
17302
|
+
return [offset + size, subarray];
|
|
17303
|
+
}
|
|
17304
|
+
return [offset, new Int32Array(size)];
|
|
17305
|
+
}
|
|
17306
|
+
function charClassOfAscii(rune) {
|
|
17307
|
+
if (rune >= SMALL_A_RUNE && rune <= SMALL_Z_RUNE) return 1;
|
|
17308
|
+
else if (rune >= CAPITAL_A_RUNE && rune <= CAPITAL_Z_RUNE) return 2;
|
|
17309
|
+
else if (rune >= NUMERAL_ZERO_RUNE && rune <= NUMERAL_NINE_RUNE) return 4;
|
|
17310
|
+
else return 0;
|
|
17311
|
+
}
|
|
17312
|
+
function charClassOfNonAscii(rune) {
|
|
17313
|
+
const char = String.fromCodePoint(rune);
|
|
17314
|
+
if (char !== char.toUpperCase()) return 1;
|
|
17315
|
+
else if (char !== char.toLowerCase()) return 2;
|
|
17316
|
+
else if (char.match(/\p{Number}/gu) !== null) return 4;
|
|
17317
|
+
else if (char.match(/\p{Letter}/gu) !== null) return 3;
|
|
17318
|
+
return 0;
|
|
17319
|
+
}
|
|
17320
|
+
function charClassOf(rune) {
|
|
17321
|
+
if (rune <= MAX_ASCII) return charClassOfAscii(rune);
|
|
17322
|
+
return charClassOfNonAscii(rune);
|
|
17323
|
+
}
|
|
17324
|
+
function bonusFor(prevClass, currClass) {
|
|
17325
|
+
if (prevClass === 0 && currClass !== 0) return BONUS_BOUNDARY;
|
|
17326
|
+
else if (prevClass === 1 && currClass === 2 || prevClass !== 4 && currClass === 4) return BONUS_CAMEL_123;
|
|
17327
|
+
else if (currClass === 0) return BONUS_NON_WORD;
|
|
17328
|
+
return 0;
|
|
17329
|
+
}
|
|
17330
|
+
function bonusAt(input, idx) {
|
|
17331
|
+
if (idx === 0) return BONUS_BOUNDARY;
|
|
17332
|
+
return bonusFor(charClassOf(input[idx - 1]), charClassOf(input[idx]));
|
|
17333
|
+
}
|
|
17334
|
+
function trySkip(input, caseSensitive, char, from) {
|
|
17335
|
+
let rest = input.slice(from);
|
|
17336
|
+
let idx = rest.indexOf(char);
|
|
17337
|
+
if (idx === 0) return from;
|
|
17338
|
+
if (!caseSensitive && char >= SMALL_A_RUNE && char <= SMALL_Z_RUNE) {
|
|
17339
|
+
if (idx > 0) rest = rest.slice(0, idx);
|
|
17340
|
+
const uidx = rest.indexOf(char - 32);
|
|
17341
|
+
if (uidx >= 0) idx = uidx;
|
|
17342
|
+
}
|
|
17343
|
+
if (idx < 0) return -1;
|
|
17344
|
+
return from + idx;
|
|
17345
|
+
}
|
|
17346
|
+
function isAscii(runes) {
|
|
17347
|
+
for (const rune of runes) if (rune >= 128) return false;
|
|
17348
|
+
return true;
|
|
16527
17349
|
}
|
|
16528
|
-
function
|
|
16529
|
-
|
|
16530
|
-
if (!
|
|
16531
|
-
|
|
17350
|
+
function asciiFuzzyIndex(input, pattern, caseSensitive) {
|
|
17351
|
+
if (!isAscii(input)) return 0;
|
|
17352
|
+
if (!isAscii(pattern)) return -1;
|
|
17353
|
+
let firstIdx = 0, idx = 0;
|
|
17354
|
+
for (let pidx = 0; pidx < pattern.length; pidx++) {
|
|
17355
|
+
idx = trySkip(input, caseSensitive, pattern[pidx], idx);
|
|
17356
|
+
if (idx < 0) return -1;
|
|
17357
|
+
if (pidx === 0 && idx > 0) firstIdx = idx - 1;
|
|
17358
|
+
idx++;
|
|
17359
|
+
}
|
|
17360
|
+
return firstIdx;
|
|
17361
|
+
}
|
|
17362
|
+
var fuzzyMatchV2 = (caseSensitive, normalize, forward, input, pattern, withPos, slab2) => {
|
|
17363
|
+
const M = pattern.length;
|
|
17364
|
+
if (M === 0) return [{
|
|
17365
|
+
start: 0,
|
|
17366
|
+
end: 0,
|
|
17367
|
+
score: 0
|
|
17368
|
+
}, createPosSet(withPos)];
|
|
17369
|
+
const N = input.length;
|
|
17370
|
+
if (slab2 !== null && N * M > slab2.i16.length) return fuzzyMatchV1(caseSensitive, normalize, forward, input, pattern, withPos);
|
|
17371
|
+
const idx = asciiFuzzyIndex(input, pattern, caseSensitive);
|
|
17372
|
+
if (idx < 0) return [{
|
|
17373
|
+
start: -1,
|
|
17374
|
+
end: -1,
|
|
17375
|
+
score: 0
|
|
17376
|
+
}, null];
|
|
17377
|
+
let offset16 = 0, offset32 = 0, H0 = null, C0 = null, B = null, F = null;
|
|
17378
|
+
[offset16, H0] = alloc16(offset16, slab2, N);
|
|
17379
|
+
[offset16, C0] = alloc16(offset16, slab2, N);
|
|
17380
|
+
[offset16, B] = alloc16(offset16, slab2, N);
|
|
17381
|
+
[offset32, F] = alloc32(offset32, slab2, M);
|
|
17382
|
+
const [, T] = alloc32(offset32, slab2, N);
|
|
17383
|
+
for (let i = 0; i < T.length; i++) T[i] = input[i];
|
|
17384
|
+
let maxScore = toShort(0), maxScorePos = 0;
|
|
17385
|
+
let pidx = 0, lastIdx = 0;
|
|
17386
|
+
const pchar0 = pattern[0];
|
|
17387
|
+
let pchar = pattern[0], prevH0 = toShort(0), prevCharClass = 0, inGap = false;
|
|
17388
|
+
let Tsub = T.subarray(idx);
|
|
17389
|
+
let H0sub = H0.subarray(idx).subarray(0, Tsub.length), C0sub = C0.subarray(idx).subarray(0, Tsub.length), Bsub = B.subarray(idx).subarray(0, Tsub.length);
|
|
17390
|
+
for (let [off, char] of Tsub.entries()) {
|
|
17391
|
+
let charClass = null;
|
|
17392
|
+
if (char <= MAX_ASCII) {
|
|
17393
|
+
charClass = charClassOfAscii(char);
|
|
17394
|
+
if (!caseSensitive && charClass === 2) char += 32;
|
|
17395
|
+
} else {
|
|
17396
|
+
charClass = charClassOfNonAscii(char);
|
|
17397
|
+
if (!caseSensitive && charClass === 2) char = String.fromCodePoint(char).toLowerCase().codePointAt(0);
|
|
17398
|
+
if (normalize) char = normalizeRune(char);
|
|
17399
|
+
}
|
|
17400
|
+
Tsub[off] = char;
|
|
17401
|
+
const bonus = bonusFor(prevCharClass, charClass);
|
|
17402
|
+
Bsub[off] = bonus;
|
|
17403
|
+
prevCharClass = charClass;
|
|
17404
|
+
if (char === pchar) {
|
|
17405
|
+
if (pidx < M) {
|
|
17406
|
+
F[pidx] = toInt(idx + off);
|
|
17407
|
+
pidx++;
|
|
17408
|
+
pchar = pattern[Math.min(pidx, M - 1)];
|
|
17409
|
+
}
|
|
17410
|
+
lastIdx = idx + off;
|
|
17411
|
+
}
|
|
17412
|
+
if (char === pchar0) {
|
|
17413
|
+
const score = SCORE_MATCH + bonus * BONUS_FIRST_CHAR_MULTIPLIER;
|
|
17414
|
+
H0sub[off] = score;
|
|
17415
|
+
C0sub[off] = 1;
|
|
17416
|
+
if (M === 1 && (forward && score > maxScore || !forward && score >= maxScore)) {
|
|
17417
|
+
maxScore = score;
|
|
17418
|
+
maxScorePos = idx + off;
|
|
17419
|
+
if (forward && bonus === BONUS_BOUNDARY) break;
|
|
17420
|
+
}
|
|
17421
|
+
inGap = false;
|
|
17422
|
+
} else {
|
|
17423
|
+
if (inGap) H0sub[off] = maxInt16(prevH0 + SCORE_GAP_EXTENTION, 0);
|
|
17424
|
+
else H0sub[off] = maxInt16(prevH0 + SCORE_GAP_START, 0);
|
|
17425
|
+
C0sub[off] = 0;
|
|
17426
|
+
inGap = true;
|
|
17427
|
+
}
|
|
17428
|
+
prevH0 = H0sub[off];
|
|
17429
|
+
}
|
|
17430
|
+
if (pidx !== M) return [{
|
|
17431
|
+
start: -1,
|
|
17432
|
+
end: -1,
|
|
17433
|
+
score: 0
|
|
17434
|
+
}, null];
|
|
17435
|
+
if (M === 1) {
|
|
17436
|
+
const result = {
|
|
17437
|
+
start: maxScorePos,
|
|
17438
|
+
end: maxScorePos + 1,
|
|
17439
|
+
score: maxScore
|
|
17440
|
+
};
|
|
17441
|
+
if (!withPos) return [result, null];
|
|
17442
|
+
const pos2 = /* @__PURE__ */ new Set();
|
|
17443
|
+
pos2.add(maxScorePos);
|
|
17444
|
+
return [result, pos2];
|
|
17445
|
+
}
|
|
17446
|
+
const f0 = F[0];
|
|
17447
|
+
const width = lastIdx - f0 + 1;
|
|
17448
|
+
let H = null;
|
|
17449
|
+
[offset16, H] = alloc16(offset16, slab2, width * M);
|
|
17450
|
+
{
|
|
17451
|
+
const toCopy = H0.subarray(f0, lastIdx + 1);
|
|
17452
|
+
for (const [i, v] of toCopy.entries()) H[i] = v;
|
|
17453
|
+
}
|
|
17454
|
+
let [, C] = alloc16(offset16, slab2, width * M);
|
|
17455
|
+
{
|
|
17456
|
+
const toCopy = C0.subarray(f0, lastIdx + 1);
|
|
17457
|
+
for (const [i, v] of toCopy.entries()) C[i] = v;
|
|
17458
|
+
}
|
|
17459
|
+
const Fsub = F.subarray(1);
|
|
17460
|
+
const Psub = pattern.slice(1).slice(0, Fsub.length);
|
|
17461
|
+
for (const [off, f] of Fsub.entries()) {
|
|
17462
|
+
let inGap2 = false;
|
|
17463
|
+
const pchar2 = Psub[off], pidx2 = off + 1, row = pidx2 * width, Tsub2 = T.subarray(f, lastIdx + 1), Bsub2 = B.subarray(f).subarray(0, Tsub2.length), Csub = C.subarray(row + f - f0).subarray(0, Tsub2.length), Cdiag = C.subarray(row + f - f0 - 1 - width).subarray(0, Tsub2.length), Hsub = H.subarray(row + f - f0).subarray(0, Tsub2.length), Hdiag = H.subarray(row + f - f0 - 1 - width).subarray(0, Tsub2.length), Hleft = H.subarray(row + f - f0 - 1).subarray(0, Tsub2.length);
|
|
17464
|
+
Hleft[0] = 0;
|
|
17465
|
+
for (const [off2, char] of Tsub2.entries()) {
|
|
17466
|
+
const col = off2 + f;
|
|
17467
|
+
let s1 = 0, s2 = 0, consecutive = 0;
|
|
17468
|
+
if (inGap2) s2 = Hleft[off2] + SCORE_GAP_EXTENTION;
|
|
17469
|
+
else s2 = Hleft[off2] + SCORE_GAP_START;
|
|
17470
|
+
if (pchar2 === char) {
|
|
17471
|
+
s1 = Hdiag[off2] + SCORE_MATCH;
|
|
17472
|
+
let b = Bsub2[off2];
|
|
17473
|
+
consecutive = Cdiag[off2] + 1;
|
|
17474
|
+
if (b === BONUS_BOUNDARY) consecutive = 1;
|
|
17475
|
+
else if (consecutive > 1) b = maxInt16(b, maxInt16(BONUS_CONSECUTIVE, B[col - consecutive + 1]));
|
|
17476
|
+
if (s1 + b < s2) {
|
|
17477
|
+
s1 += Bsub2[off2];
|
|
17478
|
+
consecutive = 0;
|
|
17479
|
+
} else s1 += b;
|
|
17480
|
+
}
|
|
17481
|
+
Csub[off2] = consecutive;
|
|
17482
|
+
inGap2 = s1 < s2;
|
|
17483
|
+
const score = maxInt16(maxInt16(s1, s2), 0);
|
|
17484
|
+
if (pidx2 === M - 1 && (forward && score > maxScore || !forward && score >= maxScore)) {
|
|
17485
|
+
maxScore = score;
|
|
17486
|
+
maxScorePos = col;
|
|
17487
|
+
}
|
|
17488
|
+
Hsub[off2] = score;
|
|
17489
|
+
}
|
|
17490
|
+
}
|
|
17491
|
+
const pos = createPosSet(withPos);
|
|
17492
|
+
let j = f0;
|
|
17493
|
+
if (withPos && pos !== null) {
|
|
17494
|
+
let i = M - 1;
|
|
17495
|
+
j = maxScorePos;
|
|
17496
|
+
let preferMatch = true;
|
|
17497
|
+
while (true) {
|
|
17498
|
+
const I = i * width, j0 = j - f0, s = H[I + j0];
|
|
17499
|
+
let s1 = 0, s2 = 0;
|
|
17500
|
+
if (i > 0 && j >= F[i]) s1 = H[I - width + j0 - 1];
|
|
17501
|
+
if (j > F[i]) s2 = H[I + j0 - 1];
|
|
17502
|
+
if (s > s1 && (s > s2 || s === s2 && preferMatch)) {
|
|
17503
|
+
pos.add(j);
|
|
17504
|
+
if (i === 0) break;
|
|
17505
|
+
i--;
|
|
17506
|
+
}
|
|
17507
|
+
preferMatch = C[I + j0] > 1 || I + width + j0 + 1 < C.length && C[I + width + j0 + 1] > 0;
|
|
17508
|
+
j--;
|
|
17509
|
+
}
|
|
17510
|
+
}
|
|
17511
|
+
return [{
|
|
17512
|
+
start: j,
|
|
17513
|
+
end: maxScorePos + 1,
|
|
17514
|
+
score: maxScore
|
|
17515
|
+
}, pos];
|
|
17516
|
+
};
|
|
17517
|
+
function calculateScore(caseSensitive, normalize, text, pattern, sidx, eidx, withPos) {
|
|
17518
|
+
let pidx = 0, score = 0, inGap = false, consecutive = 0, firstBonus = toShort(0);
|
|
17519
|
+
const pos = createPosSet(withPos);
|
|
17520
|
+
let prevCharClass = 0;
|
|
17521
|
+
if (sidx > 0) prevCharClass = charClassOf(text[sidx - 1]);
|
|
17522
|
+
for (let idx = sidx; idx < eidx; idx++) {
|
|
17523
|
+
let rune = text[idx];
|
|
17524
|
+
const charClass = charClassOf(rune);
|
|
17525
|
+
if (!caseSensitive) {
|
|
17526
|
+
if (rune >= CAPITAL_A_RUNE && rune <= CAPITAL_Z_RUNE) rune += 32;
|
|
17527
|
+
else if (rune > MAX_ASCII) rune = String.fromCodePoint(rune).toLowerCase().codePointAt(0);
|
|
17528
|
+
}
|
|
17529
|
+
if (normalize) rune = normalizeRune(rune);
|
|
17530
|
+
if (rune === pattern[pidx]) {
|
|
17531
|
+
if (withPos && pos !== null) pos.add(idx);
|
|
17532
|
+
score += SCORE_MATCH;
|
|
17533
|
+
let bonus = bonusFor(prevCharClass, charClass);
|
|
17534
|
+
if (consecutive === 0) firstBonus = bonus;
|
|
17535
|
+
else {
|
|
17536
|
+
if (bonus === BONUS_BOUNDARY) firstBonus = bonus;
|
|
17537
|
+
bonus = maxInt16(maxInt16(bonus, firstBonus), BONUS_CONSECUTIVE);
|
|
17538
|
+
}
|
|
17539
|
+
if (pidx === 0) score += bonus * BONUS_FIRST_CHAR_MULTIPLIER;
|
|
17540
|
+
else score += bonus;
|
|
17541
|
+
inGap = false;
|
|
17542
|
+
consecutive++;
|
|
17543
|
+
pidx++;
|
|
17544
|
+
} else {
|
|
17545
|
+
if (inGap) score += SCORE_GAP_EXTENTION;
|
|
17546
|
+
else score += SCORE_GAP_START;
|
|
17547
|
+
inGap = true;
|
|
17548
|
+
consecutive = 0;
|
|
17549
|
+
firstBonus = 0;
|
|
17550
|
+
}
|
|
17551
|
+
prevCharClass = charClass;
|
|
17552
|
+
}
|
|
17553
|
+
return [score, pos];
|
|
17554
|
+
}
|
|
17555
|
+
var fuzzyMatchV1 = (caseSensitive, normalize, forward, text, pattern, withPos, slab2) => {
|
|
17556
|
+
if (pattern.length === 0) return [{
|
|
17557
|
+
start: 0,
|
|
17558
|
+
end: 0,
|
|
17559
|
+
score: 0
|
|
17560
|
+
}, null];
|
|
17561
|
+
if (asciiFuzzyIndex(text, pattern, caseSensitive) < 0) return [{
|
|
17562
|
+
start: -1,
|
|
17563
|
+
end: -1,
|
|
17564
|
+
score: 0
|
|
17565
|
+
}, null];
|
|
17566
|
+
let pidx = 0, sidx = -1, eidx = -1;
|
|
17567
|
+
const lenRunes = text.length;
|
|
17568
|
+
const lenPattern = pattern.length;
|
|
17569
|
+
for (let index = 0; index < lenRunes; index++) {
|
|
17570
|
+
let rune = text[indexAt(index, lenRunes, forward)];
|
|
17571
|
+
if (!caseSensitive) {
|
|
17572
|
+
if (rune >= CAPITAL_A_RUNE && rune <= CAPITAL_Z_RUNE) rune += 32;
|
|
17573
|
+
else if (rune > MAX_ASCII) rune = String.fromCodePoint(rune).toLowerCase().codePointAt(0);
|
|
17574
|
+
}
|
|
17575
|
+
if (normalize) rune = normalizeRune(rune);
|
|
17576
|
+
const pchar = pattern[indexAt(pidx, lenPattern, forward)];
|
|
17577
|
+
if (rune === pchar) {
|
|
17578
|
+
if (sidx < 0) sidx = index;
|
|
17579
|
+
pidx++;
|
|
17580
|
+
if (pidx === lenPattern) {
|
|
17581
|
+
eidx = index + 1;
|
|
17582
|
+
break;
|
|
17583
|
+
}
|
|
17584
|
+
}
|
|
17585
|
+
}
|
|
17586
|
+
if (sidx >= 0 && eidx >= 0) {
|
|
17587
|
+
pidx--;
|
|
17588
|
+
for (let index = eidx - 1; index >= sidx; index--) {
|
|
17589
|
+
let rune = text[indexAt(index, lenRunes, forward)];
|
|
17590
|
+
if (!caseSensitive) {
|
|
17591
|
+
if (rune >= CAPITAL_A_RUNE && rune <= CAPITAL_Z_RUNE) rune += 32;
|
|
17592
|
+
else if (rune > MAX_ASCII) rune = String.fromCodePoint(rune).toLowerCase().codePointAt(0);
|
|
17593
|
+
}
|
|
17594
|
+
const pchar = pattern[indexAt(pidx, lenPattern, forward)];
|
|
17595
|
+
if (rune === pchar) {
|
|
17596
|
+
pidx--;
|
|
17597
|
+
if (pidx < 0) {
|
|
17598
|
+
sidx = index;
|
|
17599
|
+
break;
|
|
17600
|
+
}
|
|
17601
|
+
}
|
|
17602
|
+
}
|
|
17603
|
+
if (!forward) {
|
|
17604
|
+
const sidxTemp = sidx;
|
|
17605
|
+
sidx = lenRunes - eidx;
|
|
17606
|
+
eidx = lenRunes - sidxTemp;
|
|
17607
|
+
}
|
|
17608
|
+
const [score, pos] = calculateScore(caseSensitive, normalize, text, pattern, sidx, eidx, withPos);
|
|
17609
|
+
return [{
|
|
17610
|
+
start: sidx,
|
|
17611
|
+
end: eidx,
|
|
17612
|
+
score
|
|
17613
|
+
}, pos];
|
|
17614
|
+
}
|
|
17615
|
+
return [{
|
|
17616
|
+
start: -1,
|
|
17617
|
+
end: -1,
|
|
17618
|
+
score: 0
|
|
17619
|
+
}, null];
|
|
17620
|
+
};
|
|
17621
|
+
var exactMatchNaive = (caseSensitive, normalize, forward, text, pattern, withPos, slab2) => {
|
|
17622
|
+
if (pattern.length === 0) return [{
|
|
17623
|
+
start: 0,
|
|
17624
|
+
end: 0,
|
|
17625
|
+
score: 0
|
|
17626
|
+
}, null];
|
|
17627
|
+
const lenRunes = text.length;
|
|
17628
|
+
const lenPattern = pattern.length;
|
|
17629
|
+
if (lenRunes < lenPattern) return [{
|
|
17630
|
+
start: -1,
|
|
17631
|
+
end: -1,
|
|
17632
|
+
score: 0
|
|
17633
|
+
}, null];
|
|
17634
|
+
if (asciiFuzzyIndex(text, pattern, caseSensitive) < 0) return [{
|
|
17635
|
+
start: -1,
|
|
17636
|
+
end: -1,
|
|
17637
|
+
score: 0
|
|
17638
|
+
}, null];
|
|
17639
|
+
let pidx = 0;
|
|
17640
|
+
let bestPos = -1, bonus = toShort(0), bestBonus = toShort(-1);
|
|
17641
|
+
for (let index = 0; index < lenRunes; index++) {
|
|
17642
|
+
const index_ = indexAt(index, lenRunes, forward);
|
|
17643
|
+
let rune = text[index_];
|
|
17644
|
+
if (!caseSensitive) {
|
|
17645
|
+
if (rune >= CAPITAL_A_RUNE && rune <= CAPITAL_Z_RUNE) rune += 32;
|
|
17646
|
+
else if (rune > MAX_ASCII) rune = String.fromCodePoint(rune).toLowerCase().codePointAt(0);
|
|
17647
|
+
}
|
|
17648
|
+
if (normalize) rune = normalizeRune(rune);
|
|
17649
|
+
const pidx_ = indexAt(pidx, lenPattern, forward);
|
|
17650
|
+
if (pattern[pidx_] === rune) {
|
|
17651
|
+
if (pidx_ === 0) bonus = bonusAt(text, index_);
|
|
17652
|
+
pidx++;
|
|
17653
|
+
if (pidx === lenPattern) {
|
|
17654
|
+
if (bonus > bestBonus) {
|
|
17655
|
+
bestPos = index;
|
|
17656
|
+
bestBonus = bonus;
|
|
17657
|
+
}
|
|
17658
|
+
if (bonus === BONUS_BOUNDARY) break;
|
|
17659
|
+
index -= pidx - 1;
|
|
17660
|
+
pidx = 0;
|
|
17661
|
+
bonus = 0;
|
|
17662
|
+
}
|
|
17663
|
+
} else {
|
|
17664
|
+
index -= pidx;
|
|
17665
|
+
pidx = 0;
|
|
17666
|
+
bonus = 0;
|
|
17667
|
+
}
|
|
17668
|
+
}
|
|
17669
|
+
if (bestPos >= 0) {
|
|
17670
|
+
let sidx = 0, eidx = 0;
|
|
17671
|
+
if (forward) {
|
|
17672
|
+
sidx = bestPos - lenPattern + 1;
|
|
17673
|
+
eidx = bestPos + 1;
|
|
17674
|
+
} else {
|
|
17675
|
+
sidx = lenRunes - (bestPos + 1);
|
|
17676
|
+
eidx = lenRunes - (bestPos - lenPattern + 1);
|
|
17677
|
+
}
|
|
17678
|
+
const [score] = calculateScore(caseSensitive, normalize, text, pattern, sidx, eidx, false);
|
|
17679
|
+
return [{
|
|
17680
|
+
start: sidx,
|
|
17681
|
+
end: eidx,
|
|
17682
|
+
score
|
|
17683
|
+
}, null];
|
|
17684
|
+
}
|
|
17685
|
+
return [{
|
|
17686
|
+
start: -1,
|
|
17687
|
+
end: -1,
|
|
17688
|
+
score: 0
|
|
17689
|
+
}, null];
|
|
17690
|
+
};
|
|
17691
|
+
var SLAB_16_SIZE = 102400;
|
|
17692
|
+
var SLAB_32_SIZE = 2048;
|
|
17693
|
+
function makeSlab(size16, size32) {
|
|
17694
|
+
return {
|
|
17695
|
+
i16: new Int16Array(size16),
|
|
17696
|
+
i32: new Int32Array(size32)
|
|
17697
|
+
};
|
|
16532
17698
|
}
|
|
16533
|
-
|
|
16534
|
-
|
|
16535
|
-
|
|
16536
|
-
|
|
17699
|
+
var slab = makeSlab(SLAB_16_SIZE, SLAB_32_SIZE);
|
|
17700
|
+
var buildPatternForBasicMatch = (query, casing, normalize) => {
|
|
17701
|
+
let caseSensitive = false;
|
|
17702
|
+
switch (casing) {
|
|
17703
|
+
case "smart-case":
|
|
17704
|
+
if (query.toLowerCase() !== query) caseSensitive = true;
|
|
17705
|
+
break;
|
|
17706
|
+
case "case-sensitive":
|
|
17707
|
+
caseSensitive = true;
|
|
17708
|
+
break;
|
|
17709
|
+
case "case-insensitive":
|
|
17710
|
+
query = query.toLowerCase();
|
|
17711
|
+
caseSensitive = false;
|
|
17712
|
+
}
|
|
17713
|
+
let queryRunes = strToRunes(query);
|
|
17714
|
+
if (normalize) queryRunes = queryRunes.map(normalizeRune);
|
|
17715
|
+
return {
|
|
17716
|
+
queryRunes,
|
|
17717
|
+
caseSensitive
|
|
17718
|
+
};
|
|
17719
|
+
};
|
|
17720
|
+
function getResultFromScoreMap(scoreMap, limit) {
|
|
17721
|
+
const scoresInDesc = Object.keys(scoreMap).map((v) => parseInt(v, 10)).sort((a, b) => b - a);
|
|
17722
|
+
let result = [];
|
|
17723
|
+
for (const score of scoresInDesc) {
|
|
17724
|
+
result = result.concat(scoreMap[score]);
|
|
17725
|
+
if (result.length >= limit) break;
|
|
17726
|
+
}
|
|
17727
|
+
return result;
|
|
16537
17728
|
}
|
|
16538
|
-
function
|
|
16539
|
-
return
|
|
17729
|
+
function getBasicMatchIter(scoreMap, queryRunes, caseSensitive) {
|
|
17730
|
+
return (idx) => {
|
|
17731
|
+
const itemRunes = this.runesList[idx];
|
|
17732
|
+
if (queryRunes.length > itemRunes.length) return;
|
|
17733
|
+
let [match, positions] = this.algoFn(caseSensitive, this.opts.normalize, this.opts.forward, itemRunes, queryRunes, true, slab);
|
|
17734
|
+
if (match.start === -1) return;
|
|
17735
|
+
if (this.opts.fuzzy === false) {
|
|
17736
|
+
positions = /* @__PURE__ */ new Set();
|
|
17737
|
+
for (let position = match.start; position < match.end; ++position) positions.add(position);
|
|
17738
|
+
}
|
|
17739
|
+
const scoreKey = this.opts.sort ? match.score : 0;
|
|
17740
|
+
if (scoreMap[scoreKey] === void 0) scoreMap[scoreKey] = [];
|
|
17741
|
+
scoreMap[scoreKey].push({
|
|
17742
|
+
item: this.items[idx],
|
|
17743
|
+
...match,
|
|
17744
|
+
positions: positions != null ? positions : /* @__PURE__ */ new Set()
|
|
17745
|
+
});
|
|
17746
|
+
};
|
|
16540
17747
|
}
|
|
16541
|
-
|
|
17748
|
+
var isNode = typeof __require !== "undefined" && typeof window === "undefined";
|
|
17749
|
+
function asyncMatcher(token, len, iter2, onFinish) {
|
|
17750
|
+
return new Promise((resolve, reject) => {
|
|
17751
|
+
const INCREMENT = 1e3;
|
|
17752
|
+
let i = 0, end = Math.min(INCREMENT, len);
|
|
17753
|
+
const step = () => {
|
|
17754
|
+
if (token.cancelled) return reject("search cancelled");
|
|
17755
|
+
for (; i < end; ++i) iter2(i);
|
|
17756
|
+
if (end < len) {
|
|
17757
|
+
end = Math.min(end + INCREMENT, len);
|
|
17758
|
+
isNode ? setImmediate(step) : setTimeout(step);
|
|
17759
|
+
} else resolve(onFinish());
|
|
17760
|
+
};
|
|
17761
|
+
step();
|
|
17762
|
+
});
|
|
17763
|
+
}
|
|
17764
|
+
function asyncBasicMatch(query, token) {
|
|
17765
|
+
const { queryRunes, caseSensitive } = buildPatternForBasicMatch(query, this.opts.casing, this.opts.normalize);
|
|
17766
|
+
const scoreMap = {};
|
|
17767
|
+
return asyncMatcher(token, this.runesList.length, getBasicMatchIter.bind(this)(scoreMap, queryRunes, caseSensitive), () => getResultFromScoreMap(scoreMap, this.opts.limit));
|
|
17768
|
+
}
|
|
17769
|
+
var defaultOpts = {
|
|
17770
|
+
limit: Infinity,
|
|
17771
|
+
selector: (v) => v,
|
|
17772
|
+
casing: "smart-case",
|
|
17773
|
+
normalize: true,
|
|
17774
|
+
fuzzy: "v2",
|
|
17775
|
+
tiebreakers: [],
|
|
17776
|
+
sort: true,
|
|
17777
|
+
forward: true
|
|
17778
|
+
};
|
|
17779
|
+
var BaseFinder = class {
|
|
17780
|
+
constructor(list, ...optionsTuple) {
|
|
17781
|
+
this.opts = {
|
|
17782
|
+
...defaultOpts,
|
|
17783
|
+
...optionsTuple[0]
|
|
17784
|
+
};
|
|
17785
|
+
this.items = list;
|
|
17786
|
+
this.runesList = list.map((item) => strToRunes(this.opts.selector(item).normalize()));
|
|
17787
|
+
this.algoFn = exactMatchNaive;
|
|
17788
|
+
switch (this.opts.fuzzy) {
|
|
17789
|
+
case "v2":
|
|
17790
|
+
this.algoFn = fuzzyMatchV2;
|
|
17791
|
+
break;
|
|
17792
|
+
case "v1": this.algoFn = fuzzyMatchV1;
|
|
17793
|
+
}
|
|
17794
|
+
}
|
|
17795
|
+
};
|
|
17796
|
+
({ ...defaultOpts });
|
|
17797
|
+
var asyncDefaultOpts = {
|
|
17798
|
+
...defaultOpts,
|
|
17799
|
+
match: asyncBasicMatch
|
|
17800
|
+
};
|
|
17801
|
+
var AsyncFinder = class extends BaseFinder {
|
|
17802
|
+
constructor(list, ...optionsTuple) {
|
|
17803
|
+
super(list, ...optionsTuple);
|
|
17804
|
+
this.opts = {
|
|
17805
|
+
...asyncDefaultOpts,
|
|
17806
|
+
...optionsTuple[0]
|
|
17807
|
+
};
|
|
17808
|
+
this.token = { cancelled: false };
|
|
17809
|
+
}
|
|
17810
|
+
async find(query) {
|
|
17811
|
+
this.token.cancelled = true;
|
|
17812
|
+
this.token = { cancelled: false };
|
|
17813
|
+
if (query.length === 0 || this.items.length === 0) return this.items.slice(0, this.opts.limit).map(createResultItemWithEmptyPos);
|
|
17814
|
+
query = query.normalize();
|
|
17815
|
+
return postProcessResultItems(await this.opts.match.bind(this)(query, this.token), this.opts);
|
|
17816
|
+
}
|
|
17817
|
+
};
|
|
17818
|
+
var createResultItemWithEmptyPos = (item) => ({
|
|
17819
|
+
item,
|
|
17820
|
+
start: -1,
|
|
17821
|
+
end: -1,
|
|
17822
|
+
score: 0,
|
|
17823
|
+
positions: /* @__PURE__ */ new Set()
|
|
17824
|
+
});
|
|
17825
|
+
function postProcessResultItems(result, opts) {
|
|
17826
|
+
if (opts.sort) {
|
|
17827
|
+
const { selector } = opts;
|
|
17828
|
+
result.sort((a, b) => {
|
|
17829
|
+
if (a.score === b.score) for (const tiebreaker of opts.tiebreakers) {
|
|
17830
|
+
const diff = tiebreaker(a, b, selector);
|
|
17831
|
+
if (diff !== 0) return diff;
|
|
17832
|
+
}
|
|
17833
|
+
return 0;
|
|
17834
|
+
});
|
|
17835
|
+
}
|
|
17836
|
+
if (Number.isFinite(opts.limit)) result.splice(opts.limit);
|
|
17837
|
+
return result;
|
|
17838
|
+
}
|
|
17839
|
+
var AsyncFzf = class {
|
|
17840
|
+
constructor(list, ...optionsTuple) {
|
|
17841
|
+
this.finder = new AsyncFinder(list, ...optionsTuple);
|
|
17842
|
+
this.find = this.finder.find.bind(this.finder);
|
|
17843
|
+
}
|
|
17844
|
+
};
|
|
17845
|
+
//#endregion
|
|
17846
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/root/TabsRootContext.js
|
|
17847
|
+
/**
|
|
17848
|
+
* @internal
|
|
17849
|
+
*/
|
|
17850
|
+
var TabsRootContext = /*#__PURE__*/ React.createContext(void 0);
|
|
17851
|
+
if (process.env.NODE_ENV !== "production") TabsRootContext.displayName = "TabsRootContext";
|
|
17852
|
+
function useTabsRootContext() {
|
|
17853
|
+
const context = React.useContext(TabsRootContext);
|
|
17854
|
+
if (context === void 0) throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>." : formatErrorMessage(64));
|
|
17855
|
+
return context;
|
|
17856
|
+
}
|
|
17857
|
+
//#endregion
|
|
17858
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/root/TabsRootDataAttributes.js
|
|
17859
|
+
var TabsRootDataAttributes = /*#__PURE__*/ function(TabsRootDataAttributes) {
|
|
17860
|
+
/**
|
|
17861
|
+
* Indicates the direction of the activation (based on the previous active tab).
|
|
17862
|
+
* @type {'left' | 'right' | 'up' | 'down' | 'none'}
|
|
17863
|
+
*/
|
|
17864
|
+
TabsRootDataAttributes["activationDirection"] = "data-activation-direction";
|
|
17865
|
+
/**
|
|
17866
|
+
* Indicates the orientation of the tabs.
|
|
17867
|
+
* @type {'horizontal' | 'vertical'}
|
|
17868
|
+
*/
|
|
17869
|
+
TabsRootDataAttributes["orientation"] = "data-orientation";
|
|
17870
|
+
return TabsRootDataAttributes;
|
|
17871
|
+
}({});
|
|
17872
|
+
//#endregion
|
|
17873
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/root/stateAttributesMapping.js
|
|
17874
|
+
var tabsStateAttributesMapping = { tabActivationDirection: (dir) => ({ [TabsRootDataAttributes.activationDirection]: dir }) };
|
|
17875
|
+
//#endregion
|
|
17876
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/root/TabsRoot.js
|
|
17877
|
+
/**
|
|
17878
|
+
* Groups the tabs and the corresponding panels.
|
|
17879
|
+
* Renders a `<div>` element.
|
|
17880
|
+
*
|
|
17881
|
+
* Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)
|
|
17882
|
+
*/
|
|
17883
|
+
var TabsRoot = /*#__PURE__*/ React.forwardRef(function TabsRoot(componentProps, forwardedRef) {
|
|
17884
|
+
const { className, defaultValue: defaultValueProp = 0, onValueChange: onValueChangeProp, orientation = "horizontal", render, value: valueProp, style, ...elementProps } = componentProps;
|
|
17885
|
+
const hasExplicitDefaultValueProp = Object.hasOwn(componentProps, "defaultValue");
|
|
17886
|
+
const tabPanelRefs = React.useRef([]);
|
|
17887
|
+
const [mountedTabPanels, setMountedTabPanels] = React.useState(() => /* @__PURE__ */ new Map());
|
|
17888
|
+
const [value, setValue] = useControlled({
|
|
17889
|
+
controlled: valueProp,
|
|
17890
|
+
default: defaultValueProp,
|
|
17891
|
+
name: "Tabs",
|
|
17892
|
+
state: "value"
|
|
17893
|
+
});
|
|
17894
|
+
const isControlled = valueProp !== void 0;
|
|
17895
|
+
const [tabMap, setTabMap] = React.useState(() => /* @__PURE__ */ new Map());
|
|
17896
|
+
const getTabElementBySelectedValue = React.useCallback((selectedValue) => {
|
|
17897
|
+
if (selectedValue === void 0) return null;
|
|
17898
|
+
for (const [tabElement, tabMetadata] of tabMap.entries()) if (tabMetadata != null && selectedValue === (tabMetadata.value ?? tabMetadata.index)) return tabElement;
|
|
17899
|
+
return null;
|
|
17900
|
+
}, [tabMap]);
|
|
17901
|
+
const [activationDirectionState, setActivationDirectionState] = React.useState(() => ({
|
|
17902
|
+
previousValue: value,
|
|
17903
|
+
tabActivationDirection: "none"
|
|
17904
|
+
}));
|
|
17905
|
+
const { previousValue, tabActivationDirection: committedTabActivationDirection } = activationDirectionState;
|
|
17906
|
+
let tabActivationDirection = committedTabActivationDirection;
|
|
17907
|
+
let directionComputationIncomplete = false;
|
|
17908
|
+
if (previousValue !== value) {
|
|
17909
|
+
tabActivationDirection = computeActivationDirection(previousValue, value, orientation, tabMap);
|
|
17910
|
+
directionComputationIncomplete = previousValue != null && value != null && getTabElementBySelectedValue(value) == null;
|
|
17911
|
+
}
|
|
17912
|
+
const nextPreviousValue = directionComputationIncomplete ? previousValue : value;
|
|
17913
|
+
const shouldSyncActivationDirectionState = previousValue !== nextPreviousValue || committedTabActivationDirection !== tabActivationDirection;
|
|
17914
|
+
useIsoLayoutEffect(() => {
|
|
17915
|
+
if (!shouldSyncActivationDirectionState) return;
|
|
17916
|
+
setActivationDirectionState({
|
|
17917
|
+
previousValue: nextPreviousValue,
|
|
17918
|
+
tabActivationDirection
|
|
17919
|
+
});
|
|
17920
|
+
}, [
|
|
17921
|
+
nextPreviousValue,
|
|
17922
|
+
shouldSyncActivationDirectionState,
|
|
17923
|
+
tabActivationDirection
|
|
17924
|
+
]);
|
|
17925
|
+
const onValueChange = useStableCallback((newValue, eventDetails) => {
|
|
17926
|
+
eventDetails.activationDirection = computeActivationDirection(value, newValue, orientation, tabMap);
|
|
17927
|
+
onValueChangeProp?.(newValue, eventDetails);
|
|
17928
|
+
if (eventDetails.isCanceled) return;
|
|
17929
|
+
setValue(newValue);
|
|
17930
|
+
});
|
|
17931
|
+
const registerMountedTabPanel = useStableCallback((panelValue, panelId) => {
|
|
17932
|
+
setMountedTabPanels((prev) => {
|
|
17933
|
+
if (prev.get(panelValue) === panelId) return prev;
|
|
17934
|
+
const next = new Map(prev);
|
|
17935
|
+
next.set(panelValue, panelId);
|
|
17936
|
+
return next;
|
|
17937
|
+
});
|
|
17938
|
+
});
|
|
17939
|
+
const unregisterMountedTabPanel = useStableCallback((panelValue, panelId) => {
|
|
17940
|
+
setMountedTabPanels((prev) => {
|
|
17941
|
+
if (!prev.has(panelValue) || prev.get(panelValue) !== panelId) return prev;
|
|
17942
|
+
const next = new Map(prev);
|
|
17943
|
+
next.delete(panelValue);
|
|
17944
|
+
return next;
|
|
17945
|
+
});
|
|
17946
|
+
});
|
|
17947
|
+
const getTabPanelIdByValue = React.useCallback((tabValue) => {
|
|
17948
|
+
return mountedTabPanels.get(tabValue);
|
|
17949
|
+
}, [mountedTabPanels]);
|
|
17950
|
+
const getTabIdByPanelValue = React.useCallback((tabPanelValue) => {
|
|
17951
|
+
for (const tabMetadata of tabMap.values()) if (tabPanelValue === tabMetadata?.value) return tabMetadata?.id;
|
|
17952
|
+
}, [tabMap]);
|
|
17953
|
+
const tabsContextValue = React.useMemo(() => ({
|
|
17954
|
+
getTabElementBySelectedValue,
|
|
17955
|
+
getTabIdByPanelValue,
|
|
17956
|
+
getTabPanelIdByValue,
|
|
17957
|
+
onValueChange,
|
|
17958
|
+
orientation,
|
|
17959
|
+
registerMountedTabPanel,
|
|
17960
|
+
setTabMap,
|
|
17961
|
+
unregisterMountedTabPanel,
|
|
17962
|
+
tabActivationDirection,
|
|
17963
|
+
value
|
|
17964
|
+
}), [
|
|
17965
|
+
getTabElementBySelectedValue,
|
|
17966
|
+
getTabIdByPanelValue,
|
|
17967
|
+
getTabPanelIdByValue,
|
|
17968
|
+
onValueChange,
|
|
17969
|
+
orientation,
|
|
17970
|
+
registerMountedTabPanel,
|
|
17971
|
+
setTabMap,
|
|
17972
|
+
unregisterMountedTabPanel,
|
|
17973
|
+
tabActivationDirection,
|
|
17974
|
+
value
|
|
17975
|
+
]);
|
|
17976
|
+
const selectedTabMetadata = React.useMemo(() => {
|
|
17977
|
+
for (const tabMetadata of tabMap.values()) if (tabMetadata != null && tabMetadata.value === value) return tabMetadata;
|
|
17978
|
+
}, [tabMap, value]);
|
|
17979
|
+
const firstEnabledTabValue = React.useMemo(() => {
|
|
17980
|
+
for (const tabMetadata of tabMap.values()) if (tabMetadata != null && !tabMetadata.disabled) return tabMetadata.value;
|
|
17981
|
+
}, [tabMap]);
|
|
17982
|
+
useIsoLayoutEffect(() => {
|
|
17983
|
+
if (isControlled || tabMap.size === 0) return;
|
|
17984
|
+
const selectionIsDisabled = selectedTabMetadata?.disabled;
|
|
17985
|
+
const selectionIsMissing = selectedTabMetadata == null && value !== null;
|
|
17986
|
+
if (hasExplicitDefaultValueProp && selectionIsDisabled && value === defaultValueProp) return;
|
|
17987
|
+
if (!selectionIsDisabled && !selectionIsMissing) return;
|
|
17988
|
+
const fallbackValue = firstEnabledTabValue ?? null;
|
|
17989
|
+
if (value === fallbackValue) return;
|
|
17990
|
+
setValue(fallbackValue);
|
|
17991
|
+
setActivationDirectionState((prev) => {
|
|
17992
|
+
if (prev.tabActivationDirection === "none") return prev;
|
|
17993
|
+
return {
|
|
17994
|
+
...prev,
|
|
17995
|
+
tabActivationDirection: "none"
|
|
17996
|
+
};
|
|
17997
|
+
});
|
|
17998
|
+
}, [
|
|
17999
|
+
defaultValueProp,
|
|
18000
|
+
firstEnabledTabValue,
|
|
18001
|
+
hasExplicitDefaultValueProp,
|
|
18002
|
+
isControlled,
|
|
18003
|
+
selectedTabMetadata,
|
|
18004
|
+
setValue,
|
|
18005
|
+
tabMap,
|
|
18006
|
+
value
|
|
18007
|
+
]);
|
|
18008
|
+
const element = useRenderElement("div", componentProps, {
|
|
18009
|
+
state: {
|
|
18010
|
+
orientation,
|
|
18011
|
+
tabActivationDirection
|
|
18012
|
+
},
|
|
18013
|
+
ref: forwardedRef,
|
|
18014
|
+
props: elementProps,
|
|
18015
|
+
stateAttributesMapping: tabsStateAttributesMapping
|
|
18016
|
+
});
|
|
18017
|
+
return /*#__PURE__*/ jsx(TabsRootContext.Provider, {
|
|
18018
|
+
value: tabsContextValue,
|
|
18019
|
+
children: /*#__PURE__*/ jsx(CompositeList, {
|
|
18020
|
+
elementsRef: tabPanelRefs,
|
|
18021
|
+
children: element
|
|
18022
|
+
})
|
|
18023
|
+
});
|
|
18024
|
+
});
|
|
18025
|
+
if (process.env.NODE_ENV !== "production") TabsRoot.displayName = "TabsRoot";
|
|
18026
|
+
function computeActivationDirection(oldValue, newValue, orientation, tabMap) {
|
|
18027
|
+
if (oldValue == null || newValue == null) return "none";
|
|
18028
|
+
let oldTab = null;
|
|
18029
|
+
let newTab = null;
|
|
18030
|
+
for (const [tabElement, tabMetadata] of tabMap.entries()) {
|
|
18031
|
+
if (tabMetadata == null) continue;
|
|
18032
|
+
const tabValue = tabMetadata.value ?? tabMetadata.index;
|
|
18033
|
+
if (oldValue === tabValue) oldTab = tabElement;
|
|
18034
|
+
if (newValue === tabValue) newTab = tabElement;
|
|
18035
|
+
if (oldTab != null && newTab != null) break;
|
|
18036
|
+
}
|
|
18037
|
+
if (oldTab == null || newTab == null) {
|
|
18038
|
+
if (oldTab !== newTab && (typeof oldValue === "number" || typeof oldValue === "string") && typeof oldValue === typeof newValue) {
|
|
18039
|
+
if (orientation === "horizontal") return newValue > oldValue ? "right" : "left";
|
|
18040
|
+
return newValue > oldValue ? "down" : "up";
|
|
18041
|
+
}
|
|
18042
|
+
return "none";
|
|
18043
|
+
}
|
|
18044
|
+
const oldRect = oldTab.getBoundingClientRect();
|
|
18045
|
+
const newRect = newTab.getBoundingClientRect();
|
|
18046
|
+
if (orientation === "horizontal") {
|
|
18047
|
+
if (newRect.left < oldRect.left) return "left";
|
|
18048
|
+
if (newRect.left > oldRect.left) return "right";
|
|
18049
|
+
} else {
|
|
18050
|
+
if (newRect.top < oldRect.top) return "up";
|
|
18051
|
+
if (newRect.top > oldRect.top) return "down";
|
|
18052
|
+
}
|
|
18053
|
+
return "none";
|
|
18054
|
+
}
|
|
18055
|
+
//#endregion
|
|
18056
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/list/TabsListContext.js
|
|
18057
|
+
var TabsListContext = /*#__PURE__*/ React.createContext(void 0);
|
|
18058
|
+
if (process.env.NODE_ENV !== "production") TabsListContext.displayName = "TabsListContext";
|
|
18059
|
+
function useTabsListContext() {
|
|
18060
|
+
const context = React.useContext(TabsListContext);
|
|
18061
|
+
if (context === void 0) throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>." : formatErrorMessage(65));
|
|
18062
|
+
return context;
|
|
18063
|
+
}
|
|
18064
|
+
//#endregion
|
|
18065
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/tab/TabsTab.js
|
|
18066
|
+
/**
|
|
18067
|
+
* An individual interactive tab button that toggles the corresponding panel.
|
|
18068
|
+
* Renders a `<button>` element.
|
|
18069
|
+
*
|
|
18070
|
+
* Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)
|
|
18071
|
+
*/
|
|
18072
|
+
var TabsTab = /*#__PURE__*/ React.forwardRef(function TabsTab(componentProps, forwardedRef) {
|
|
18073
|
+
const { className, disabled = false, render, value, id: idProp, nativeButton = true, style, ...elementProps } = componentProps;
|
|
18074
|
+
const { value: activeTabValue, getTabPanelIdByValue, orientation } = useTabsRootContext();
|
|
18075
|
+
const { activateOnFocus, highlightedTabIndex, onTabActivation, registerTabResizeObserverElement, setHighlightedTabIndex, tabsListElement } = useTabsListContext();
|
|
18076
|
+
const id = useBaseUiId(idProp);
|
|
18077
|
+
const tabMetadata = React.useMemo(() => ({
|
|
18078
|
+
disabled,
|
|
18079
|
+
id,
|
|
18080
|
+
value
|
|
18081
|
+
}), [
|
|
18082
|
+
disabled,
|
|
18083
|
+
id,
|
|
18084
|
+
value
|
|
18085
|
+
]);
|
|
18086
|
+
const { compositeProps, compositeRef, index } = useCompositeItem({ metadata: tabMetadata });
|
|
18087
|
+
const active = value === activeTabValue;
|
|
18088
|
+
const isNavigatingRef = React.useRef(false);
|
|
18089
|
+
const tabElementRef = React.useRef(null);
|
|
18090
|
+
React.useEffect(() => {
|
|
18091
|
+
const tabElement = tabElementRef.current;
|
|
18092
|
+
if (!tabElement) return;
|
|
18093
|
+
return registerTabResizeObserverElement(tabElement);
|
|
18094
|
+
}, [registerTabResizeObserverElement]);
|
|
18095
|
+
useIsoLayoutEffect(() => {
|
|
18096
|
+
if (isNavigatingRef.current) {
|
|
18097
|
+
isNavigatingRef.current = false;
|
|
18098
|
+
return;
|
|
18099
|
+
}
|
|
18100
|
+
if (!(active && index > -1 && highlightedTabIndex !== index)) return;
|
|
18101
|
+
const listElement = tabsListElement;
|
|
18102
|
+
if (listElement != null) {
|
|
18103
|
+
const activeEl = activeElement(ownerDocument(listElement));
|
|
18104
|
+
if (activeEl && contains(listElement, activeEl)) return;
|
|
18105
|
+
}
|
|
18106
|
+
if (!disabled) setHighlightedTabIndex(index);
|
|
18107
|
+
}, [
|
|
18108
|
+
active,
|
|
18109
|
+
index,
|
|
18110
|
+
highlightedTabIndex,
|
|
18111
|
+
setHighlightedTabIndex,
|
|
18112
|
+
disabled,
|
|
18113
|
+
tabsListElement
|
|
18114
|
+
]);
|
|
18115
|
+
const { getButtonProps, buttonRef } = useButton({
|
|
18116
|
+
disabled,
|
|
18117
|
+
native: nativeButton,
|
|
18118
|
+
focusableWhenDisabled: true
|
|
18119
|
+
});
|
|
18120
|
+
const tabPanelId = getTabPanelIdByValue(value);
|
|
18121
|
+
const isPressingRef = React.useRef(false);
|
|
18122
|
+
const isMainButtonRef = React.useRef(false);
|
|
18123
|
+
function onClick(event) {
|
|
18124
|
+
if (active || disabled) return;
|
|
18125
|
+
onTabActivation(value, createChangeEventDetails(none, event.nativeEvent, void 0, { activationDirection: "none" }));
|
|
18126
|
+
}
|
|
18127
|
+
function onFocus(event) {
|
|
18128
|
+
if (active) return;
|
|
18129
|
+
if (index > -1 && !disabled) setHighlightedTabIndex(index);
|
|
18130
|
+
if (disabled) return;
|
|
18131
|
+
if (activateOnFocus && (!isPressingRef.current || isPressingRef.current && isMainButtonRef.current)) onTabActivation(value, createChangeEventDetails(none, event.nativeEvent, void 0, { activationDirection: "none" }));
|
|
18132
|
+
}
|
|
18133
|
+
function onPointerDown(event) {
|
|
18134
|
+
if (active || disabled) return;
|
|
18135
|
+
isPressingRef.current = true;
|
|
18136
|
+
function handlePointerUp() {
|
|
18137
|
+
isPressingRef.current = false;
|
|
18138
|
+
isMainButtonRef.current = false;
|
|
18139
|
+
}
|
|
18140
|
+
if (!event.button || event.button === 0) {
|
|
18141
|
+
isMainButtonRef.current = true;
|
|
18142
|
+
ownerDocument(event.currentTarget).addEventListener("pointerup", handlePointerUp, { once: true });
|
|
18143
|
+
}
|
|
18144
|
+
}
|
|
18145
|
+
return useRenderElement("button", componentProps, {
|
|
18146
|
+
state: {
|
|
18147
|
+
disabled,
|
|
18148
|
+
active,
|
|
18149
|
+
orientation
|
|
18150
|
+
},
|
|
18151
|
+
ref: [
|
|
18152
|
+
forwardedRef,
|
|
18153
|
+
buttonRef,
|
|
18154
|
+
compositeRef,
|
|
18155
|
+
tabElementRef
|
|
18156
|
+
],
|
|
18157
|
+
props: [
|
|
18158
|
+
compositeProps,
|
|
18159
|
+
{
|
|
18160
|
+
role: "tab",
|
|
18161
|
+
"aria-controls": tabPanelId,
|
|
18162
|
+
"aria-selected": active,
|
|
18163
|
+
id,
|
|
18164
|
+
onClick,
|
|
18165
|
+
onFocus,
|
|
18166
|
+
onPointerDown,
|
|
18167
|
+
[ACTIVE_COMPOSITE_ITEM]: active ? "" : void 0,
|
|
18168
|
+
onKeyDownCapture() {
|
|
18169
|
+
isNavigatingRef.current = true;
|
|
18170
|
+
}
|
|
18171
|
+
},
|
|
18172
|
+
elementProps,
|
|
18173
|
+
getButtonProps
|
|
18174
|
+
]
|
|
18175
|
+
});
|
|
18176
|
+
});
|
|
18177
|
+
if (process.env.NODE_ENV !== "production") TabsTab.displayName = "TabsTab";
|
|
18178
|
+
//#endregion
|
|
18179
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/panel/TabsPanelDataAttributes.js
|
|
18180
|
+
var TabsPanelDataAttributes = function(TabsPanelDataAttributes) {
|
|
18181
|
+
/**
|
|
18182
|
+
* Indicates the index of the tab panel.
|
|
18183
|
+
*/
|
|
18184
|
+
TabsPanelDataAttributes["index"] = "data-index";
|
|
18185
|
+
/**
|
|
18186
|
+
* Indicates the direction of the activation (based on the previous active tab).
|
|
18187
|
+
* @type {'left' | 'right' | 'up' | 'down' | 'none'}
|
|
18188
|
+
*/
|
|
18189
|
+
TabsPanelDataAttributes["activationDirection"] = "data-activation-direction";
|
|
18190
|
+
/**
|
|
18191
|
+
* Indicates the orientation of the tabs.
|
|
18192
|
+
* @type {'horizontal' | 'vertical'}
|
|
18193
|
+
*/
|
|
18194
|
+
TabsPanelDataAttributes["orientation"] = "data-orientation";
|
|
18195
|
+
/**
|
|
18196
|
+
* Present when the panel is hidden.
|
|
18197
|
+
*/
|
|
18198
|
+
TabsPanelDataAttributes["hidden"] = "data-hidden";
|
|
18199
|
+
/**
|
|
18200
|
+
* Present when the panel is animating in.
|
|
18201
|
+
*/
|
|
18202
|
+
TabsPanelDataAttributes[TabsPanelDataAttributes["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle";
|
|
18203
|
+
/**
|
|
18204
|
+
* Present when the panel is animating out.
|
|
18205
|
+
*/
|
|
18206
|
+
TabsPanelDataAttributes[TabsPanelDataAttributes["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle";
|
|
18207
|
+
return TabsPanelDataAttributes;
|
|
18208
|
+
}({});
|
|
18209
|
+
//#endregion
|
|
18210
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/panel/TabsPanel.js
|
|
18211
|
+
var stateAttributesMapping$1 = {
|
|
18212
|
+
...tabsStateAttributesMapping,
|
|
18213
|
+
...transitionStatusMapping
|
|
18214
|
+
};
|
|
18215
|
+
/**
|
|
18216
|
+
* A panel displayed when the corresponding tab is active.
|
|
18217
|
+
* Renders a `<div>` element.
|
|
18218
|
+
*
|
|
18219
|
+
* Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)
|
|
18220
|
+
*/
|
|
18221
|
+
var TabsPanel = /*#__PURE__*/ React.forwardRef(function TabPanel(componentProps, forwardedRef) {
|
|
18222
|
+
const { className, value, render, keepMounted = false, style, ...elementProps } = componentProps;
|
|
18223
|
+
const { value: selectedValue, getTabIdByPanelValue, orientation, tabActivationDirection, registerMountedTabPanel, unregisterMountedTabPanel } = useTabsRootContext();
|
|
18224
|
+
const id = useBaseUiId();
|
|
18225
|
+
const metadata = React.useMemo(() => ({
|
|
18226
|
+
id,
|
|
18227
|
+
value
|
|
18228
|
+
}), [id, value]);
|
|
18229
|
+
const { ref: listItemRef, index } = useCompositeListItem({ metadata });
|
|
18230
|
+
const open = value === selectedValue;
|
|
18231
|
+
const { mounted, transitionStatus, setMounted } = useTransitionStatus(open);
|
|
18232
|
+
const hidden = !mounted;
|
|
18233
|
+
const correspondingTabId = getTabIdByPanelValue(value);
|
|
18234
|
+
const state = {
|
|
18235
|
+
hidden,
|
|
18236
|
+
orientation,
|
|
18237
|
+
tabActivationDirection,
|
|
18238
|
+
transitionStatus
|
|
18239
|
+
};
|
|
18240
|
+
const panelRef = React.useRef(null);
|
|
18241
|
+
const element = useRenderElement("div", componentProps, {
|
|
18242
|
+
state,
|
|
18243
|
+
ref: [
|
|
18244
|
+
forwardedRef,
|
|
18245
|
+
listItemRef,
|
|
18246
|
+
panelRef
|
|
18247
|
+
],
|
|
18248
|
+
props: [{
|
|
18249
|
+
"aria-labelledby": correspondingTabId,
|
|
18250
|
+
hidden,
|
|
18251
|
+
id,
|
|
18252
|
+
role: "tabpanel",
|
|
18253
|
+
tabIndex: open ? 0 : -1,
|
|
18254
|
+
inert: inertValue(!open),
|
|
18255
|
+
[TabsPanelDataAttributes.index]: index
|
|
18256
|
+
}, elementProps],
|
|
18257
|
+
stateAttributesMapping: stateAttributesMapping$1
|
|
18258
|
+
});
|
|
18259
|
+
useOpenChangeComplete({
|
|
18260
|
+
open,
|
|
18261
|
+
ref: panelRef,
|
|
18262
|
+
onComplete() {
|
|
18263
|
+
if (!open) setMounted(false);
|
|
18264
|
+
}
|
|
18265
|
+
});
|
|
18266
|
+
useIsoLayoutEffect(() => {
|
|
18267
|
+
if (hidden && !keepMounted) return;
|
|
18268
|
+
if (id == null) return;
|
|
18269
|
+
registerMountedTabPanel(value, id);
|
|
18270
|
+
return () => {
|
|
18271
|
+
unregisterMountedTabPanel(value, id);
|
|
18272
|
+
};
|
|
18273
|
+
}, [
|
|
18274
|
+
hidden,
|
|
18275
|
+
keepMounted,
|
|
18276
|
+
value,
|
|
18277
|
+
id,
|
|
18278
|
+
registerMountedTabPanel,
|
|
18279
|
+
unregisterMountedTabPanel
|
|
18280
|
+
]);
|
|
18281
|
+
if (!(keepMounted || mounted)) return null;
|
|
18282
|
+
return element;
|
|
18283
|
+
});
|
|
18284
|
+
if (process.env.NODE_ENV !== "production") TabsPanel.displayName = "TabsPanel";
|
|
18285
|
+
//#endregion
|
|
18286
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/tabs/list/TabsList.js
|
|
18287
|
+
/**
|
|
18288
|
+
* Groups the individual tab buttons.
|
|
18289
|
+
* Renders a `<div>` element.
|
|
18290
|
+
*
|
|
18291
|
+
* Documentation: [Base UI Tabs](https://base-ui.com/react/components/tabs)
|
|
18292
|
+
*/
|
|
18293
|
+
var TabsList$1 = /*#__PURE__*/ React.forwardRef(function TabsList(componentProps, forwardedRef) {
|
|
18294
|
+
const { activateOnFocus = false, className, loopFocus = true, render, style, ...elementProps } = componentProps;
|
|
18295
|
+
const { onValueChange, orientation, value, setTabMap, tabActivationDirection } = useTabsRootContext();
|
|
18296
|
+
const [highlightedTabIndex, setHighlightedTabIndex] = React.useState(0);
|
|
18297
|
+
const [tabsListElement, setTabsListElement] = React.useState(null);
|
|
18298
|
+
const indicatorUpdateListenersRef = React.useRef(/* @__PURE__ */ new Set());
|
|
18299
|
+
const tabResizeObserverElementsRef = React.useRef(/* @__PURE__ */ new Set());
|
|
18300
|
+
const resizeObserverRef = React.useRef(null);
|
|
18301
|
+
const notifyIndicatorUpdateListeners = useStableCallback(() => {
|
|
18302
|
+
indicatorUpdateListenersRef.current.forEach((listener) => {
|
|
18303
|
+
listener();
|
|
18304
|
+
});
|
|
18305
|
+
});
|
|
18306
|
+
React.useEffect(() => {
|
|
18307
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
18308
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
18309
|
+
if (!indicatorUpdateListenersRef.current.size) return;
|
|
18310
|
+
notifyIndicatorUpdateListeners();
|
|
18311
|
+
});
|
|
18312
|
+
resizeObserverRef.current = resizeObserver;
|
|
18313
|
+
if (tabsListElement) resizeObserver.observe(tabsListElement);
|
|
18314
|
+
tabResizeObserverElementsRef.current.forEach((element) => {
|
|
18315
|
+
resizeObserver.observe(element);
|
|
18316
|
+
});
|
|
18317
|
+
return () => {
|
|
18318
|
+
resizeObserver.disconnect();
|
|
18319
|
+
resizeObserverRef.current = null;
|
|
18320
|
+
};
|
|
18321
|
+
}, [tabsListElement, notifyIndicatorUpdateListeners]);
|
|
18322
|
+
const registerIndicatorUpdateListener = useStableCallback((listener) => {
|
|
18323
|
+
indicatorUpdateListenersRef.current.add(listener);
|
|
18324
|
+
return () => {
|
|
18325
|
+
indicatorUpdateListenersRef.current.delete(listener);
|
|
18326
|
+
};
|
|
18327
|
+
});
|
|
18328
|
+
const registerTabResizeObserverElement = useStableCallback((element) => {
|
|
18329
|
+
tabResizeObserverElementsRef.current.add(element);
|
|
18330
|
+
resizeObserverRef.current?.observe(element);
|
|
18331
|
+
return () => {
|
|
18332
|
+
tabResizeObserverElementsRef.current.delete(element);
|
|
18333
|
+
resizeObserverRef.current?.unobserve(element);
|
|
18334
|
+
};
|
|
18335
|
+
});
|
|
18336
|
+
const onTabActivation = useStableCallback((newValue, eventDetails) => {
|
|
18337
|
+
if (newValue !== value) onValueChange(newValue, eventDetails);
|
|
18338
|
+
});
|
|
18339
|
+
const state = {
|
|
18340
|
+
orientation,
|
|
18341
|
+
tabActivationDirection
|
|
18342
|
+
};
|
|
18343
|
+
const defaultProps = {
|
|
18344
|
+
"aria-orientation": orientation === "vertical" ? "vertical" : void 0,
|
|
18345
|
+
role: "tablist"
|
|
18346
|
+
};
|
|
18347
|
+
const tabsListContextValue = React.useMemo(() => ({
|
|
18348
|
+
activateOnFocus,
|
|
18349
|
+
highlightedTabIndex,
|
|
18350
|
+
registerIndicatorUpdateListener,
|
|
18351
|
+
registerTabResizeObserverElement,
|
|
18352
|
+
onTabActivation,
|
|
18353
|
+
setHighlightedTabIndex,
|
|
18354
|
+
tabsListElement
|
|
18355
|
+
}), [
|
|
18356
|
+
activateOnFocus,
|
|
18357
|
+
highlightedTabIndex,
|
|
18358
|
+
registerIndicatorUpdateListener,
|
|
18359
|
+
registerTabResizeObserverElement,
|
|
18360
|
+
onTabActivation,
|
|
18361
|
+
setHighlightedTabIndex,
|
|
18362
|
+
tabsListElement
|
|
18363
|
+
]);
|
|
18364
|
+
return /*#__PURE__*/ jsx(TabsListContext.Provider, {
|
|
18365
|
+
value: tabsListContextValue,
|
|
18366
|
+
children: /*#__PURE__*/ jsx(CompositeRoot, {
|
|
18367
|
+
render,
|
|
18368
|
+
className,
|
|
18369
|
+
style,
|
|
18370
|
+
state,
|
|
18371
|
+
refs: [forwardedRef, setTabsListElement],
|
|
18372
|
+
props: [defaultProps, elementProps],
|
|
18373
|
+
stateAttributesMapping: tabsStateAttributesMapping,
|
|
18374
|
+
highlightedIndex: highlightedTabIndex,
|
|
18375
|
+
enableHomeAndEndKeys: true,
|
|
18376
|
+
loopFocus,
|
|
18377
|
+
orientation,
|
|
18378
|
+
onHighlightedIndexChange: setHighlightedTabIndex,
|
|
18379
|
+
onMapChange: setTabMap,
|
|
18380
|
+
disabledIndices: EMPTY_ARRAY
|
|
18381
|
+
})
|
|
18382
|
+
});
|
|
18383
|
+
});
|
|
18384
|
+
if (process.env.NODE_ENV !== "production") TabsList$1.displayName = "TabsList";
|
|
18385
|
+
//#endregion
|
|
18386
|
+
//#region src/ui/browser/tabs.tsx
|
|
18387
|
+
function Tabs({ className, orientation = "horizontal", ...props }) {
|
|
18388
|
+
return /* @__PURE__ */ jsx(TabsRoot, {
|
|
18389
|
+
"data-slot": "tabs",
|
|
18390
|
+
"data-orientation": orientation,
|
|
18391
|
+
className: cn("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col", className),
|
|
18392
|
+
orientation,
|
|
18393
|
+
...props
|
|
18394
|
+
});
|
|
18395
|
+
}
|
|
18396
|
+
var tabsListVariants = cva("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg text-muted-foreground group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none", {
|
|
18397
|
+
variants: {
|
|
18398
|
+
size: {
|
|
18399
|
+
default: "p-[3px] group-data-[orientation=horizontal]/tabs:h-8",
|
|
18400
|
+
sm: "rounded-[6px] p-0.5 group-data-[orientation=horizontal]/tabs:h-6"
|
|
18401
|
+
},
|
|
18402
|
+
variant: {
|
|
18403
|
+
default: "bg-muted",
|
|
18404
|
+
line: "gap-1 bg-transparent",
|
|
18405
|
+
navigation: "gap-1 bg-transparent data-[variant=navigation]:p-0 group-data-[orientation=horizontal]/tabs:data-[variant=navigation]:h-auto",
|
|
18406
|
+
flat: "gap-1 bg-[color-mix(in_srgb,var(--ui-foreground)_8%,var(--ui-popover))] dark:bg-[color-mix(in_srgb,black_16%,var(--ui-popover))]"
|
|
18407
|
+
}
|
|
18408
|
+
},
|
|
18409
|
+
defaultVariants: {
|
|
18410
|
+
size: "default",
|
|
18411
|
+
variant: "default"
|
|
18412
|
+
}
|
|
18413
|
+
});
|
|
18414
|
+
function TabsList({ className, variant = "default", size = "default", ...props }) {
|
|
18415
|
+
return /* @__PURE__ */ jsx(TabsList$1, {
|
|
18416
|
+
"data-slot": "tabs-list",
|
|
18417
|
+
"data-variant": variant,
|
|
18418
|
+
"data-size": size,
|
|
18419
|
+
className: cn(tabsListVariants({
|
|
18420
|
+
variant,
|
|
18421
|
+
size
|
|
18422
|
+
}), className),
|
|
18423
|
+
...props
|
|
18424
|
+
});
|
|
18425
|
+
}
|
|
18426
|
+
function TabsTrigger({ className, ...props }) {
|
|
18427
|
+
return /* @__PURE__ */ jsx(TabsTab, {
|
|
18428
|
+
"data-slot": "tabs-trigger",
|
|
18429
|
+
className: cn("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-[color,background-color,border-color,box-shadow,opacity] group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-border focus-visible:outline-2 focus-visible:outline-solid focus-visible:ring-0 focus-visible:aria-invalid:ring-0 focus-visible:outline-offset-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:transition-none dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent", "group-data-[variant=navigation]/tabs-list:h-auto group-data-[variant=navigation]/tabs-list:flex-none group-data-[variant=navigation]/tabs-list:rounded-[6px] group-data-[variant=navigation]/tabs-list:border-0 group-data-[variant=navigation]/tabs-list:px-3 group-data-[variant=navigation]/tabs-list:py-2 group-data-[variant=navigation]/tabs-list:text-[13px] group-data-[variant=navigation]/tabs-list:font-normal group-data-[variant=navigation]/tabs-list:text-muted-foreground group-data-[variant=navigation]/tabs-list:hover:bg-muted group-data-[variant=navigation]/tabs-list:hover:text-foreground group-data-[variant=navigation]/tabs-list:data-active:bg-muted group-data-[variant=navigation]/tabs-list:data-active:font-semibold group-data-[variant=navigation]/tabs-list:data-active:text-foreground dark:group-data-[variant=navigation]/tabs-list:data-active:bg-muted dark:group-data-[variant=navigation]/tabs-list:data-active:text-foreground", "group-data-[variant=flat]/tabs-list:h-full group-data-[variant=flat]/tabs-list:border-0 group-data-[variant=flat]/tabs-list:data-active:bg-popover group-data-[variant=flat]/tabs-list:data-active:shadow-[0_1px_2px_rgb(0_0_0/0.08)] dark:group-data-[variant=flat]/tabs-list:data-active:bg-[color-mix(in_srgb,var(--ui-foreground)_8%,var(--ui-popover))]", "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100 motion-reduce:after:transition-none", "group-data-[size=sm]/tabs-list:rounded-[4px] group-data-[size=sm]/tabs-list:gap-1 group-data-[size=sm]/tabs-list:py-0 group-data-[size=sm]/tabs-list:text-[11px] group-data-[size=sm]/tabs-list:leading-4 group-data-[orientation=horizontal]/tabs:group-data-[size=sm]/tabs-list:after:bottom-[-4px]", "group-data-[variant=navigation]/tabs-list:group-data-[size=sm]/tabs-list:rounded-[4px] group-data-[variant=navigation]/tabs-list:group-data-[size=sm]/tabs-list:px-2 group-data-[variant=navigation]/tabs-list:group-data-[size=sm]/tabs-list:py-1 group-data-[variant=navigation]/tabs-list:group-data-[size=sm]/tabs-list:text-[12px]", className),
|
|
18430
|
+
...props
|
|
18431
|
+
});
|
|
18432
|
+
}
|
|
18433
|
+
function TabsContent({ className, ...props }) {
|
|
18434
|
+
return /* @__PURE__ */ jsx(TabsPanel, {
|
|
18435
|
+
"data-slot": "tabs-content",
|
|
18436
|
+
className: cn("flex-1 text-sm outline-none", className),
|
|
18437
|
+
...props
|
|
18438
|
+
});
|
|
18439
|
+
}
|
|
18440
|
+
//#endregion
|
|
18441
|
+
//#region src/ui/browser/icons/picker/IconPicker.tsx
|
|
18442
|
+
var translations = {
|
|
18443
|
+
"en": {
|
|
18444
|
+
emoji: "Emoji",
|
|
18445
|
+
icon: "Icon",
|
|
18446
|
+
random: "Random",
|
|
18447
|
+
filter: "Filter...",
|
|
18448
|
+
more: "More...",
|
|
18449
|
+
loading: "Loading...",
|
|
18450
|
+
carbon: "Carbon",
|
|
18451
|
+
close: "Close",
|
|
18452
|
+
color: "Color"
|
|
18453
|
+
},
|
|
18454
|
+
"zh-CN": {
|
|
18455
|
+
emoji: "Emoji",
|
|
18456
|
+
icon: "图标",
|
|
18457
|
+
random: "随机",
|
|
18458
|
+
filter: "搜索...",
|
|
18459
|
+
more: "更多...",
|
|
18460
|
+
loading: "加载中...",
|
|
18461
|
+
carbon: "Carbon",
|
|
18462
|
+
close: "关闭",
|
|
18463
|
+
color: "颜色"
|
|
18464
|
+
},
|
|
18465
|
+
"zh-TW": {
|
|
18466
|
+
emoji: "Emoji",
|
|
18467
|
+
icon: "圖示",
|
|
18468
|
+
random: "隨機",
|
|
18469
|
+
filter: "搜尋...",
|
|
18470
|
+
more: "更多...",
|
|
18471
|
+
loading: "載入中...",
|
|
18472
|
+
carbon: "Carbon",
|
|
18473
|
+
close: "關閉",
|
|
18474
|
+
color: "顏色"
|
|
18475
|
+
},
|
|
18476
|
+
"ja": {
|
|
18477
|
+
emoji: "絵文字",
|
|
18478
|
+
icon: "アイコン",
|
|
18479
|
+
random: "ランダム",
|
|
18480
|
+
filter: "検索…",
|
|
18481
|
+
more: "もっと見る…",
|
|
18482
|
+
loading: "読み込み中…",
|
|
18483
|
+
carbon: "Carbon",
|
|
18484
|
+
close: "閉じる",
|
|
18485
|
+
color: "色"
|
|
18486
|
+
},
|
|
18487
|
+
"ko": {
|
|
18488
|
+
emoji: "이모지",
|
|
18489
|
+
icon: "아이콘",
|
|
18490
|
+
random: "무작위",
|
|
18491
|
+
filter: "필터...",
|
|
18492
|
+
more: "더 보기...",
|
|
18493
|
+
loading: "불러오는 중...",
|
|
18494
|
+
carbon: "Carbon",
|
|
18495
|
+
close: "닫기",
|
|
18496
|
+
color: "색상"
|
|
18497
|
+
},
|
|
18498
|
+
"ru": {
|
|
18499
|
+
emoji: "Эмодзи",
|
|
18500
|
+
icon: "Значок",
|
|
18501
|
+
random: "Случайно",
|
|
18502
|
+
filter: "Фильтр…",
|
|
18503
|
+
more: "Ещё…",
|
|
18504
|
+
loading: "Загрузка…",
|
|
18505
|
+
carbon: "Carbon",
|
|
18506
|
+
close: "Закрыть",
|
|
18507
|
+
color: "Цвет"
|
|
18508
|
+
},
|
|
18509
|
+
"fr": {
|
|
18510
|
+
emoji: "Emoji",
|
|
18511
|
+
icon: "Icône",
|
|
18512
|
+
random: "Aléatoire",
|
|
18513
|
+
filter: "Filtrer...",
|
|
18514
|
+
more: "Plus...",
|
|
18515
|
+
loading: "Chargement...",
|
|
18516
|
+
carbon: "Carbon",
|
|
18517
|
+
close: "Fermer",
|
|
18518
|
+
color: "Couleur"
|
|
18519
|
+
}
|
|
18520
|
+
};
|
|
18521
|
+
var rememberLastTab;
|
|
18522
|
+
var rememberLastColor;
|
|
18523
|
+
function getTranslate(lang) {
|
|
18524
|
+
const data = translations[resolveUiLanguage([lang])];
|
|
18525
|
+
return (key) => data[key] || translations.en[key] || key;
|
|
18526
|
+
}
|
|
18527
|
+
var COLUMNS = 9;
|
|
18528
|
+
var CONTAINER_STYLE = {
|
|
18529
|
+
width: 308,
|
|
18530
|
+
height: 360
|
|
18531
|
+
};
|
|
18532
|
+
var MAX_ITEMS_INIT = 180;
|
|
18533
|
+
var MAX_ITEMS_STEP = 90;
|
|
18534
|
+
var COLORS = [
|
|
18535
|
+
"currentColor",
|
|
18536
|
+
"#CC3E44",
|
|
18537
|
+
"#E37933",
|
|
18538
|
+
"#CBCB41",
|
|
18539
|
+
"#8DC149",
|
|
18540
|
+
"#7494A3",
|
|
18541
|
+
"#519ABA",
|
|
18542
|
+
"#A074C4",
|
|
18543
|
+
"#F55385",
|
|
18544
|
+
"#6D8086"
|
|
18545
|
+
];
|
|
18546
|
+
function computeRows(iconifyData, filteredIcons, categories, collection) {
|
|
18547
|
+
const rows = [];
|
|
18548
|
+
if (!iconifyData) return rows;
|
|
18549
|
+
if (filteredIcons) for (let i = 0; i < filteredIcons.length; i += COLUMNS) rows.push(filteredIcons.slice(i, i + COLUMNS));
|
|
18550
|
+
else if (categories) for (const category in categories) {
|
|
18551
|
+
rows.push(category);
|
|
18552
|
+
const icons = categories[category];
|
|
18553
|
+
for (let i = 0; i < icons.length; i += COLUMNS) rows.push(icons.slice(i, i + COLUMNS));
|
|
18554
|
+
}
|
|
18555
|
+
else if (collection) {
|
|
18556
|
+
const icons = iconifyData[collection]?.icons.icons;
|
|
18557
|
+
if (icons) {
|
|
18558
|
+
filteredIcons = Object.keys(icons);
|
|
18559
|
+
for (let i = 0; i < filteredIcons.length; i += COLUMNS) rows.push(filteredIcons.slice(i, i + COLUMNS));
|
|
18560
|
+
}
|
|
18561
|
+
}
|
|
18562
|
+
return rows;
|
|
18563
|
+
}
|
|
18564
|
+
var ICON_SIZE = 32;
|
|
18565
|
+
var BUFFER_SIZE = 320;
|
|
18566
|
+
var ROW_STYLE = { height: ICON_SIZE };
|
|
18567
|
+
var PickerIcon = ({ iconSet, name, color }) => {
|
|
18568
|
+
const svg = useMemo(() => {
|
|
18569
|
+
const icon = getIconData(iconSet, name);
|
|
18570
|
+
if (!icon) return null;
|
|
18571
|
+
const result = iconToSVG(icon, {
|
|
18572
|
+
width: "1em",
|
|
18573
|
+
height: "1em"
|
|
18574
|
+
});
|
|
18575
|
+
return {
|
|
18576
|
+
body: replaceIDs(result.body),
|
|
18577
|
+
viewBox: result.attributes.viewBox
|
|
18578
|
+
};
|
|
18579
|
+
}, [iconSet, name]);
|
|
18580
|
+
if (!svg) return null;
|
|
18581
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
18582
|
+
"aria-hidden": "true",
|
|
18583
|
+
className: clsx(IconPicker_module_default.icon, "text-lg"),
|
|
18584
|
+
focusable: "false",
|
|
18585
|
+
style: { color },
|
|
18586
|
+
viewBox: svg.viewBox,
|
|
18587
|
+
dangerouslySetInnerHTML: { __html: svg.body }
|
|
18588
|
+
});
|
|
18589
|
+
};
|
|
18590
|
+
function renderRow(index, row, iconSet, color) {
|
|
18591
|
+
return /* @__PURE__ */ jsx("div", {
|
|
18592
|
+
className: IconPicker_module_default.row,
|
|
18593
|
+
style: ROW_STYLE,
|
|
18594
|
+
children: Array.isArray(row) ? row.map((icon) => /* @__PURE__ */ jsx(Button, {
|
|
18595
|
+
variant: "ghost",
|
|
18596
|
+
size: "icon-sm",
|
|
18597
|
+
"aria-label": icon,
|
|
18598
|
+
"data-icon": icon,
|
|
18599
|
+
title: icon,
|
|
18600
|
+
type: "button",
|
|
18601
|
+
children: /* @__PURE__ */ jsx(PickerIcon, {
|
|
18602
|
+
iconSet,
|
|
18603
|
+
name: icon,
|
|
18604
|
+
color
|
|
18605
|
+
})
|
|
18606
|
+
}, icon)) : /* @__PURE__ */ jsx("div", {
|
|
18607
|
+
className: IconPicker_module_default.subtitle,
|
|
18608
|
+
children: row
|
|
18609
|
+
})
|
|
18610
|
+
}, index);
|
|
18611
|
+
}
|
|
18612
|
+
var IconPickerIconsPanel = ({ filteredIcons, collection, color, categories, onClick }) => {
|
|
18613
|
+
const iconifyData = useIconifyData(true);
|
|
18614
|
+
const iconSet = iconifyData?.[collection]?.icons;
|
|
18615
|
+
const [viewport, setViewport] = useState(null);
|
|
18616
|
+
const rows = useMemo(() => computeRows(iconifyData, filteredIcons, categories, collection), [
|
|
18617
|
+
iconifyData,
|
|
18618
|
+
filteredIcons,
|
|
18619
|
+
categories,
|
|
18620
|
+
collection
|
|
18621
|
+
]);
|
|
18622
|
+
return /* @__PURE__ */ jsx(ScrollArea, {
|
|
18623
|
+
className: IconPicker_module_default.panel,
|
|
18624
|
+
defer: false,
|
|
18625
|
+
events: { initialized: (instance) => setViewport(instance.elements().viewport) },
|
|
18626
|
+
onClick,
|
|
18627
|
+
children: viewport && iconSet && /* @__PURE__ */ jsx(Z, {
|
|
18628
|
+
data: rows,
|
|
18629
|
+
itemSize: ICON_SIZE,
|
|
18630
|
+
bufferSize: BUFFER_SIZE,
|
|
18631
|
+
scrollRef: { current: viewport },
|
|
18632
|
+
children: (row, index) => renderRow(index, row, iconSet, color)
|
|
18633
|
+
})
|
|
18634
|
+
});
|
|
18635
|
+
};
|
|
18636
|
+
var IconPicker = ({ className, emoji, carbon = true, defaultTab = rememberLastTab || (emoji ? "twemoji" : "carbon"), defaultColor = rememberLastColor || COLORS[0], locale, onChange, onCancel }) => {
|
|
18637
|
+
if (!emoji && !carbon) carbon = true;
|
|
18638
|
+
const i18n = useI18n(true);
|
|
18639
|
+
const language$ = locale || i18n?.lang$ || "en";
|
|
18640
|
+
const t = getTranslate(useVal(language$));
|
|
18641
|
+
const root = useRef(null);
|
|
18642
|
+
const [tab, setTab] = useState(defaultTab);
|
|
18643
|
+
const [searchText, setSearchText] = useState("");
|
|
18644
|
+
const [maxItems, setMaxItems] = useState(MAX_ITEMS_INIT);
|
|
18645
|
+
const [filteredIcons, setIcons] = useState(null);
|
|
18646
|
+
const [selectedColor, setColor] = useState(defaultColor);
|
|
18647
|
+
const [colorsPanel, setColorsPanel] = useState(false);
|
|
18648
|
+
const hasColors = tab === "carbon";
|
|
18649
|
+
const iconifyData = useIconifyData(true);
|
|
18650
|
+
const loadCollection = useIconifyCollectionLoader();
|
|
18651
|
+
useEffect(() => {
|
|
18652
|
+
loadCollection?.(tab).catch((error) => console.error(`Failed to load the ${tab} icon collection.`, error));
|
|
18653
|
+
}, [loadCollection, tab]);
|
|
18654
|
+
const fzf = useMemo(() => {
|
|
18655
|
+
const collection = iconifyData?.[tab];
|
|
18656
|
+
if (collection) return new AsyncFzf(Object.keys(collection.icons.icons), {
|
|
18657
|
+
casing: "case-insensitive",
|
|
18658
|
+
fuzzy: "v1"
|
|
18659
|
+
});
|
|
18660
|
+
return null;
|
|
18661
|
+
}, [iconifyData, tab]);
|
|
18662
|
+
const loadMore = useCallback(() => {
|
|
18663
|
+
setMaxItems((currentMaxItems) => currentMaxItems + MAX_ITEMS_STEP);
|
|
18664
|
+
}, []);
|
|
18665
|
+
const searchTimeout = useRef(0);
|
|
18666
|
+
useEffect(() => {
|
|
18667
|
+
clearTimeout(searchTimeout.current);
|
|
18668
|
+
if (searchText) {
|
|
18669
|
+
setIcons([]);
|
|
18670
|
+
if (!fzf || !searchText) return;
|
|
18671
|
+
let isMounted = true;
|
|
18672
|
+
searchTimeout.current = window.setTimeout(async () => {
|
|
18673
|
+
const result = await fzf.find(searchText);
|
|
18674
|
+
if (isMounted) {
|
|
18675
|
+
setMaxItems(MAX_ITEMS_INIT);
|
|
18676
|
+
setIcons(result.map((i) => i.item));
|
|
18677
|
+
}
|
|
18678
|
+
}, 200);
|
|
18679
|
+
return () => {
|
|
18680
|
+
isMounted = false;
|
|
18681
|
+
};
|
|
18682
|
+
} else setIcons(null);
|
|
18683
|
+
}, [fzf, searchText]);
|
|
18684
|
+
const onClickShuffle = useCallback(() => {
|
|
18685
|
+
const collection = iconifyData?.[tab];
|
|
18686
|
+
if (onChange && collection) {
|
|
18687
|
+
const keys = Object.keys(collection.icons.icons);
|
|
18688
|
+
const icon = keys[Math.floor(Math.random() * keys.length)];
|
|
18689
|
+
const color = COLORS[Math.floor(Math.random() * COLORS.length)];
|
|
18690
|
+
onChange(tab, icon, color, true);
|
|
18691
|
+
}
|
|
18692
|
+
}, [tab, onChange]);
|
|
18693
|
+
const toggleColorsPanel = useCallback(() => {
|
|
18694
|
+
setColorsPanel((e) => !e);
|
|
18695
|
+
}, []);
|
|
18696
|
+
const onClickColors = useCallback((event) => {
|
|
18697
|
+
const color = event.target.dataset.color;
|
|
18698
|
+
if (color) setColor(rememberLastColor = color);
|
|
18699
|
+
}, []);
|
|
18700
|
+
const onClickIcon = useCallback((event) => {
|
|
18701
|
+
const icon = event.target.dataset.icon;
|
|
18702
|
+
if (icon && onChange) onChange(tab, icon, selectedColor, false);
|
|
18703
|
+
}, [
|
|
18704
|
+
tab,
|
|
18705
|
+
selectedColor,
|
|
18706
|
+
onChange
|
|
18707
|
+
]);
|
|
18708
|
+
const onKeyDown = useCallback((event) => {
|
|
18709
|
+
if (event.key === "Escape" && onCancel) {
|
|
18710
|
+
event.stopPropagation();
|
|
18711
|
+
onCancel();
|
|
18712
|
+
}
|
|
18713
|
+
}, [onCancel]);
|
|
18714
|
+
useEffect(() => {
|
|
18715
|
+
root.current?.focus();
|
|
18716
|
+
}, []);
|
|
18717
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
18718
|
+
className: clsx(IconPicker_module_default.container, className),
|
|
18719
|
+
style: CONTAINER_STYLE,
|
|
18720
|
+
tabIndex: -1,
|
|
18721
|
+
onKeyDown,
|
|
18722
|
+
children: [
|
|
18723
|
+
/* @__PURE__ */ jsxs("div", {
|
|
18724
|
+
className: IconPicker_module_default.filter,
|
|
18725
|
+
children: [/* @__PURE__ */ jsxs(InputGroup, {
|
|
18726
|
+
className: "h-6",
|
|
18727
|
+
children: [/* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx("i", {
|
|
18728
|
+
"aria-hidden": "true",
|
|
18729
|
+
className: "i-lucide-light:search text-sm"
|
|
18730
|
+
}) }), /* @__PURE__ */ jsx(InputGroupInput, {
|
|
18731
|
+
className: "h-full py-0 text-[11px] md:text-[11px]",
|
|
18732
|
+
"aria-label": t("filter"),
|
|
18733
|
+
autoComplete: "off",
|
|
18734
|
+
type: "search",
|
|
18735
|
+
placeholder: t("filter"),
|
|
18736
|
+
value: searchText,
|
|
18737
|
+
onChange: (e) => setSearchText(e.target.value),
|
|
18738
|
+
autoFocus: true
|
|
18739
|
+
})]
|
|
18740
|
+
}), /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
18741
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
18742
|
+
variant: "ghost",
|
|
18743
|
+
size: "icon-xs",
|
|
18744
|
+
"aria-label": t("random"),
|
|
18745
|
+
onClick: onClickShuffle,
|
|
18746
|
+
type: "button"
|
|
18747
|
+
}),
|
|
18748
|
+
children: /* @__PURE__ */ jsx("i", {
|
|
18749
|
+
"aria-hidden": "true",
|
|
18750
|
+
className: "i-lucide-light:shuffle text-sm"
|
|
18751
|
+
})
|
|
18752
|
+
}), /* @__PURE__ */ jsx(TooltipContent, { children: t("random") })] })]
|
|
18753
|
+
}),
|
|
18754
|
+
/* @__PURE__ */ jsxs("div", {
|
|
18755
|
+
className: IconPicker_module_default.tabs,
|
|
18756
|
+
children: [
|
|
18757
|
+
/* @__PURE__ */ jsx(Tabs, {
|
|
18758
|
+
value: tab,
|
|
18759
|
+
onValueChange: (value) => {
|
|
18760
|
+
setTab(rememberLastTab = value);
|
|
18761
|
+
setColorsPanel(false);
|
|
18762
|
+
},
|
|
18763
|
+
className: "min-w-0 flex-1",
|
|
18764
|
+
children: /* @__PURE__ */ jsxs(TabsList, {
|
|
18765
|
+
variant: "flat",
|
|
18766
|
+
className: "w-full rounded-[6px] p-0.5 group-data-[orientation=horizontal]/tabs:h-6",
|
|
18767
|
+
children: [emoji && /* @__PURE__ */ jsx(TabsTrigger, {
|
|
18768
|
+
className: "text-[11px] group-data-[variant=flat]/tabs-list:rounded-[4px]",
|
|
18769
|
+
value: "twemoji",
|
|
18770
|
+
children: t("emoji")
|
|
18771
|
+
}), carbon && /* @__PURE__ */ jsx(TabsTrigger, {
|
|
18772
|
+
className: "text-[11px] group-data-[variant=flat]/tabs-list:rounded-[4px]",
|
|
18773
|
+
value: "carbon",
|
|
18774
|
+
children: t("carbon")
|
|
18775
|
+
})]
|
|
18776
|
+
})
|
|
18777
|
+
}),
|
|
18778
|
+
hasColors && /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
18779
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
18780
|
+
variant: "ghost",
|
|
18781
|
+
size: "icon-xs",
|
|
18782
|
+
"aria-expanded": colorsPanel,
|
|
18783
|
+
"aria-label": t("color"),
|
|
18784
|
+
onClick: toggleColorsPanel,
|
|
18785
|
+
type: "button"
|
|
18786
|
+
}),
|
|
18787
|
+
children: /* @__PURE__ */ jsx("i", {
|
|
18788
|
+
"aria-hidden": "true",
|
|
18789
|
+
className: "i-lucide-light:palette text-sm",
|
|
18790
|
+
style: { color: selectedColor }
|
|
18791
|
+
})
|
|
18792
|
+
}), /* @__PURE__ */ jsx(TooltipContent, { children: t("color") })] }),
|
|
18793
|
+
/* @__PURE__ */ jsx("div", {
|
|
18794
|
+
onClick: onClickColors,
|
|
18795
|
+
className: IconPicker_module_default.colors,
|
|
18796
|
+
style: hasColors && colorsPanel ? {} : { display: "none" },
|
|
18797
|
+
children: COLORS.map((color) => /* @__PURE__ */ jsx("button", {
|
|
18798
|
+
"aria-label": `${t("color")}: ${color}`,
|
|
18799
|
+
"aria-pressed": selectedColor === color,
|
|
18800
|
+
className: IconPicker_module_default.color,
|
|
18801
|
+
"data-color": color,
|
|
18802
|
+
style: { backgroundColor: color },
|
|
18803
|
+
type: "button"
|
|
18804
|
+
}, color))
|
|
18805
|
+
})
|
|
18806
|
+
]
|
|
18807
|
+
}),
|
|
18808
|
+
iconifyData?.[tab] ? /* @__PURE__ */ jsx(IconPickerIconsPanel, {
|
|
18809
|
+
filteredIcons: filteredIcons?.slice(0, maxItems),
|
|
18810
|
+
collection: tab,
|
|
18811
|
+
categories: iconifyData?.[tab]?.metadata?.categories,
|
|
18812
|
+
color: selectedColor,
|
|
18813
|
+
onClick: onClickIcon
|
|
18814
|
+
}, tab) : /* @__PURE__ */ jsxs("div", {
|
|
18815
|
+
className: IconPicker_module_default.loading,
|
|
18816
|
+
children: [/* @__PURE__ */ jsx("i", { className: "i-codicon:loading" }), /* @__PURE__ */ jsx("span", { children: t("loading") })]
|
|
18817
|
+
}),
|
|
18818
|
+
filteredIcons && filteredIcons.length > maxItems && /* @__PURE__ */ jsx(Button, {
|
|
18819
|
+
variant: "ghost",
|
|
18820
|
+
size: "xs",
|
|
18821
|
+
className: "mx-3 mb-2 shrink-0 text-[11px]",
|
|
18822
|
+
onClick: loadMore,
|
|
18823
|
+
type: "button",
|
|
18824
|
+
children: t("more")
|
|
18825
|
+
})
|
|
18826
|
+
]
|
|
18827
|
+
});
|
|
18828
|
+
};
|
|
18829
|
+
//#endregion
|
|
18830
|
+
//#region src/ui/browser/icons/icon-picker-button.tsx
|
|
18831
|
+
function IconPickerButton({ children, className, disabled, label, onChange, side = "bottom", size = "icon-xs", variant = "ghost" }) {
|
|
18832
|
+
const [open, setOpen] = useState(false);
|
|
18833
|
+
const [container, setContainer] = useState(null);
|
|
18834
|
+
return /* @__PURE__ */ jsx("div", {
|
|
18835
|
+
className: "inline-flex",
|
|
18836
|
+
ref: setContainer,
|
|
18837
|
+
children: /* @__PURE__ */ jsxs(Popover, {
|
|
18838
|
+
open: open && !disabled,
|
|
18839
|
+
onOpenChange: setOpen,
|
|
18840
|
+
children: [/* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
18841
|
+
render: /* @__PURE__ */ jsx(PopoverTrigger, { render: /* @__PURE__ */ jsx(Button, {
|
|
18842
|
+
type: "button",
|
|
18843
|
+
"aria-label": label,
|
|
18844
|
+
className,
|
|
18845
|
+
disabled,
|
|
18846
|
+
size,
|
|
18847
|
+
variant
|
|
18848
|
+
}) }),
|
|
18849
|
+
children
|
|
18850
|
+
}), /* @__PURE__ */ jsx(TooltipContent, {
|
|
18851
|
+
container,
|
|
18852
|
+
children: label
|
|
18853
|
+
})] }), /* @__PURE__ */ jsx(PopoverContent, {
|
|
18854
|
+
"aria-label": label,
|
|
18855
|
+
container,
|
|
18856
|
+
side,
|
|
18857
|
+
className: "w-auto overflow-hidden border border-foreground/10 p-0 ring-0",
|
|
18858
|
+
children: /* @__PURE__ */ jsx(IconPicker, {
|
|
18859
|
+
emoji: true,
|
|
18860
|
+
onCancel: () => setOpen(false),
|
|
18861
|
+
onChange: (collection, icon, color) => {
|
|
18862
|
+
onChange(color.toLowerCase() === "currentcolor" ? `:${collection}:${icon}:` : `:${collection}:${icon}:${color}:`);
|
|
18863
|
+
setOpen(false);
|
|
18864
|
+
}
|
|
18865
|
+
})
|
|
18866
|
+
})]
|
|
18867
|
+
})
|
|
18868
|
+
});
|
|
18869
|
+
}
|
|
18870
|
+
//#endregion
|
|
18871
|
+
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/combobox/root/ComboboxRootContext.js
|
|
18872
|
+
var ComboboxRootContext = /*#__PURE__*/ React.createContext(void 0);
|
|
18873
|
+
if (process.env.NODE_ENV !== "production") ComboboxRootContext.displayName = "ComboboxRootContext";
|
|
18874
|
+
var ComboboxFloatingContext = /*#__PURE__*/ React.createContext(void 0);
|
|
18875
|
+
if (process.env.NODE_ENV !== "production") ComboboxFloatingContext.displayName = "ComboboxFloatingContext";
|
|
18876
|
+
var ComboboxDerivedItemsContext = /*#__PURE__*/ React.createContext(void 0);
|
|
18877
|
+
if (process.env.NODE_ENV !== "production") ComboboxDerivedItemsContext.displayName = "ComboboxDerivedItemsContext";
|
|
18878
|
+
var ComboboxInputValueContext = /*#__PURE__*/ React.createContext("");
|
|
18879
|
+
if (process.env.NODE_ENV !== "production") ComboboxInputValueContext.displayName = "ComboboxInputValueContext";
|
|
18880
|
+
function useComboboxRootContext() {
|
|
18881
|
+
const context = React.useContext(ComboboxRootContext);
|
|
18882
|
+
if (!context) throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>." : formatErrorMessage(22));
|
|
18883
|
+
return context;
|
|
18884
|
+
}
|
|
18885
|
+
function useComboboxFloatingContext() {
|
|
18886
|
+
const context = React.useContext(ComboboxFloatingContext);
|
|
18887
|
+
if (!context) throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>." : formatErrorMessage(23));
|
|
18888
|
+
return context;
|
|
18889
|
+
}
|
|
18890
|
+
function useComboboxDerivedItemsContext() {
|
|
18891
|
+
const context = React.useContext(ComboboxDerivedItemsContext);
|
|
18892
|
+
if (!context) throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>." : formatErrorMessage(24));
|
|
18893
|
+
return context;
|
|
18894
|
+
}
|
|
18895
|
+
function useComboboxInputValueContext() {
|
|
18896
|
+
return React.useContext(ComboboxInputValueContext);
|
|
18897
|
+
}
|
|
18898
|
+
//#endregion
|
|
16542
18899
|
//#region ../../node_modules/.bun/@base-ui+react@1.4.1+fa6c2f29eeb10566/node_modules/@base-ui/react/esm/combobox/store.js
|
|
16543
18900
|
var selectors = {
|
|
16544
18901
|
id: createSelector((state) => state.id),
|
|
@@ -19406,6 +21763,8 @@ function FlowSettingsDialog({ flow, onClose, onSaved, finalFocus, ...context })
|
|
|
19406
21763
|
const t = useTranslate();
|
|
19407
21764
|
const original = useRef(flow).current;
|
|
19408
21765
|
const [name, setName] = useState(original.name);
|
|
21766
|
+
const [icon, setIcon] = useState(original.icon ?? null);
|
|
21767
|
+
const [description, setDescription] = useState(original.description ?? "");
|
|
19409
21768
|
const [ids, setIds] = useState(original.tagIds ?? []);
|
|
19410
21769
|
const [creating, setCreating] = useState(false);
|
|
19411
21770
|
const [pending, setPending] = useState(false);
|
|
@@ -19416,19 +21775,23 @@ function FlowSettingsDialog({ flow, onClose, onSaved, finalFocus, ...context })
|
|
|
19416
21775
|
const tags = useVal(context.store.tags.state);
|
|
19417
21776
|
const titleId = useId();
|
|
19418
21777
|
const tagsId = useId();
|
|
21778
|
+
const descriptionId = useId();
|
|
19419
21779
|
const issue = resourceNameIssue(name);
|
|
19420
21780
|
const nameChanged = name.trim() != original.name;
|
|
19421
21781
|
const tagsChanged = JSON.stringify(ids.toSorted()) != JSON.stringify((original.tagIds ?? []).toSorted());
|
|
21782
|
+
const iconChanged = icon != (original.icon ?? null);
|
|
21783
|
+
const descriptionChanged = description != (original.description ?? "");
|
|
21784
|
+
const changed = nameChanged || iconChanged || descriptionChanged || tagsChanged;
|
|
19422
21785
|
function requestClose(proceed = onClose) {
|
|
19423
21786
|
if (pending || creating) return;
|
|
19424
|
-
if (
|
|
21787
|
+
if (changed) {
|
|
19425
21788
|
leaveAction.current = proceed;
|
|
19426
21789
|
setConfirmDiscard(true);
|
|
19427
21790
|
} else proceed();
|
|
19428
21791
|
}
|
|
19429
21792
|
async function save() {
|
|
19430
21793
|
if (pending || creating || issue != null || tagsChanged && (tags.loading || tags.failed)) return;
|
|
19431
|
-
if (!
|
|
21794
|
+
if (!changed) {
|
|
19432
21795
|
onClose();
|
|
19433
21796
|
return;
|
|
19434
21797
|
}
|
|
@@ -19436,6 +21799,8 @@ function FlowSettingsDialog({ flow, onClose, onSaved, finalFocus, ...context })
|
|
|
19436
21799
|
try {
|
|
19437
21800
|
if (await context.store.updateFlowSettings(flow.flowId, {
|
|
19438
21801
|
...nameChanged ? { name: name.trim() } : {},
|
|
21802
|
+
...iconChanged ? { icon } : {},
|
|
21803
|
+
...descriptionChanged ? { description: description || null } : {},
|
|
19439
21804
|
...tagsChanged ? { tagIds: ids } : {}
|
|
19440
21805
|
})) {
|
|
19441
21806
|
onSaved?.();
|
|
@@ -19471,6 +21836,31 @@ function FlowSettingsDialog({ flow, onClose, onSaved, finalFocus, ...context })
|
|
|
19471
21836
|
className: "sr-only",
|
|
19472
21837
|
children: t("flowSettings.title")
|
|
19473
21838
|
}),
|
|
21839
|
+
/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, { children: t("flowSettings.icon") }), /* @__PURE__ */ jsxs("div", {
|
|
21840
|
+
className: "flex items-center gap-2",
|
|
21841
|
+
children: [/* @__PURE__ */ jsx(IconPickerButton, {
|
|
21842
|
+
label: t("flowSettings.icon"),
|
|
21843
|
+
disabled: pending,
|
|
21844
|
+
size: "icon",
|
|
21845
|
+
variant: "outline",
|
|
21846
|
+
onChange: setIcon,
|
|
21847
|
+
children: /* @__PURE__ */ jsx(ContentIcon, {
|
|
21848
|
+
src: icon ?? void 0,
|
|
21849
|
+
className: "size-5",
|
|
21850
|
+
fallback: /* @__PURE__ */ jsx("i", {
|
|
21851
|
+
"aria-hidden": "true",
|
|
21852
|
+
className: "i-lucide-light:workflow size-5"
|
|
21853
|
+
})
|
|
21854
|
+
})
|
|
21855
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
21856
|
+
type: "button",
|
|
21857
|
+
variant: "ghost",
|
|
21858
|
+
size: "sm",
|
|
21859
|
+
disabled: icon == null,
|
|
21860
|
+
onClick: () => setIcon(null),
|
|
21861
|
+
children: t("flowSettings.resetIcon")
|
|
21862
|
+
})]
|
|
21863
|
+
})] }),
|
|
19474
21864
|
/* @__PURE__ */ jsxs(Field, {
|
|
19475
21865
|
"data-invalid": issue != null,
|
|
19476
21866
|
children: [
|
|
@@ -19493,6 +21883,17 @@ function FlowSettingsDialog({ flow, onClose, onSaved, finalFocus, ...context })
|
|
|
19493
21883
|
})
|
|
19494
21884
|
]
|
|
19495
21885
|
}),
|
|
21886
|
+
/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
21887
|
+
htmlFor: descriptionId,
|
|
21888
|
+
children: t("flowSettings.description")
|
|
21889
|
+
}), /* @__PURE__ */ jsx(Textarea, {
|
|
21890
|
+
id: descriptionId,
|
|
21891
|
+
name: "flow-description",
|
|
21892
|
+
rows: 3,
|
|
21893
|
+
className: "max-h-40 resize-y",
|
|
21894
|
+
value: description,
|
|
21895
|
+
onChange: (event) => setDescription(event.target.value)
|
|
21896
|
+
})] }),
|
|
19496
21897
|
/* @__PURE__ */ jsxs(Field, { children: [/* @__PURE__ */ jsx(FieldLabel, {
|
|
19497
21898
|
htmlFor: tagsId,
|
|
19498
21899
|
children: t("tags.title")
|
|
@@ -19519,7 +21920,7 @@ function FlowSettingsDialog({ flow, onClose, onSaved, finalFocus, ...context })
|
|
|
19519
21920
|
children: t("common.cancel")
|
|
19520
21921
|
}), /* @__PURE__ */ jsx(Button, {
|
|
19521
21922
|
type: "submit",
|
|
19522
|
-
disabled: pending || creating || issue != null || !
|
|
21923
|
+
disabled: pending || creating || issue != null || !changed || tagsChanged && (tags.loading || tags.failed),
|
|
19523
21924
|
children: t("common.save")
|
|
19524
21925
|
})] })
|
|
19525
21926
|
]
|
|
@@ -19646,6 +22047,21 @@ function IdTooltip(props) {
|
|
|
19646
22047
|
}
|
|
19647
22048
|
//#endregion
|
|
19648
22049
|
//#region src/workbench/browser/runtime/shell/workflowExportMenuItem.tsx
|
|
22050
|
+
/** Finish the menu's focus restoration before an export dialog can open. */
|
|
22051
|
+
function useWorkflowExportAction(onExport) {
|
|
22052
|
+
const requested = useRef(false);
|
|
22053
|
+
return {
|
|
22054
|
+
onClick: () => {
|
|
22055
|
+
requested.current = true;
|
|
22056
|
+
},
|
|
22057
|
+
onOpenChangeComplete: (open) => {
|
|
22058
|
+
if (!open && requested.current) {
|
|
22059
|
+
requested.current = false;
|
|
22060
|
+
onExport?.();
|
|
22061
|
+
}
|
|
22062
|
+
}
|
|
22063
|
+
};
|
|
22064
|
+
}
|
|
19649
22065
|
function WorkflowExportMenuItem({ disabled, onClick, className }) {
|
|
19650
22066
|
const t = useTranslate();
|
|
19651
22067
|
return /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
@@ -19659,6 +22075,103 @@ function WorkflowExportMenuItem({ disabled, onClick, className }) {
|
|
|
19659
22075
|
});
|
|
19660
22076
|
}
|
|
19661
22077
|
//#endregion
|
|
22078
|
+
//#region src/workbench/browser/runtime/shell/workflowTransfer.tsx
|
|
22079
|
+
function WorkflowListItem({ name }) {
|
|
22080
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
22081
|
+
className: "flex items-start gap-2",
|
|
22082
|
+
children: [/* @__PURE__ */ jsx("i", {
|
|
22083
|
+
"aria-hidden": "true",
|
|
22084
|
+
className: "i-lucide-light:workflow mt-0.5 size-4 shrink-0 text-muted-foreground"
|
|
22085
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
22086
|
+
className: "min-w-0 break-words",
|
|
22087
|
+
children: name
|
|
22088
|
+
})]
|
|
22089
|
+
});
|
|
22090
|
+
}
|
|
22091
|
+
function WorkflowBundleSummary({ bundle, entryName }) {
|
|
22092
|
+
const t = useTranslate();
|
|
22093
|
+
return /* @__PURE__ */ jsxs("details", {
|
|
22094
|
+
className: "group text-sm",
|
|
22095
|
+
children: [/* @__PURE__ */ jsxs("summary", {
|
|
22096
|
+
className: "flex cursor-pointer list-none items-center gap-2 text-muted-foreground [&::-webkit-details-marker]:hidden",
|
|
22097
|
+
children: [/* @__PURE__ */ jsx("i", {
|
|
22098
|
+
"aria-hidden": "true",
|
|
22099
|
+
className: "i-lucide-light:chevron-right shrink-0 group-open:rotate-90"
|
|
22100
|
+
}), t("workflowTransfer.workflowCount", { count: bundle.workflows.length })]
|
|
22101
|
+
}), /* @__PURE__ */ jsx("ul", {
|
|
22102
|
+
className: "m-0 mt-2 max-h-40 list-none space-y-1 overflow-y-auto p-0 pl-5",
|
|
22103
|
+
children: bundle.workflows.map(({ flowId, file }) => /* @__PURE__ */ jsx(WorkflowListItem, { name: flowId == bundle.entryFlowId ? entryName : file.name ?? t("workflowTransfer.unnamed") }, flowId))
|
|
22104
|
+
})]
|
|
22105
|
+
});
|
|
22106
|
+
}
|
|
22107
|
+
function ExportDialog({ preview, workspace, container }) {
|
|
22108
|
+
const t = useTranslate();
|
|
22109
|
+
const id = useId();
|
|
22110
|
+
const [includeDependencies, setIncludeDependencies] = useState(true);
|
|
22111
|
+
const workflows = includeDependencies ? preview.workflows : preview.workflows.filter((item) => item.flowId == preview.entryFlowId);
|
|
22112
|
+
const missing = includeDependencies ? preview.unavailableFlowIds.length : 0;
|
|
22113
|
+
return /* @__PURE__ */ jsx(Dialog, {
|
|
22114
|
+
open: true,
|
|
22115
|
+
onOpenChange: (open) => {
|
|
22116
|
+
if (!open) workspace.closeExport();
|
|
22117
|
+
},
|
|
22118
|
+
children: /* @__PURE__ */ jsxs(DialogContent, {
|
|
22119
|
+
container,
|
|
22120
|
+
showCloseButton: false,
|
|
22121
|
+
className: "max-h-[calc(100dvh-2rem)] grid-rows-[auto_auto_minmax(0,1fr)_auto]",
|
|
22122
|
+
children: [
|
|
22123
|
+
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: t("resource.exportFlow") }) }),
|
|
22124
|
+
/* @__PURE__ */ jsxs(Field, {
|
|
22125
|
+
orientation: "horizontal",
|
|
22126
|
+
children: [/* @__PURE__ */ jsx(Checkbox, {
|
|
22127
|
+
id,
|
|
22128
|
+
checked: includeDependencies,
|
|
22129
|
+
onCheckedChange: setIncludeDependencies
|
|
22130
|
+
}), /* @__PURE__ */ jsx(FieldLabel, {
|
|
22131
|
+
htmlFor: id,
|
|
22132
|
+
children: t("workflowTransfer.includeDependencies")
|
|
22133
|
+
})]
|
|
22134
|
+
}),
|
|
22135
|
+
/* @__PURE__ */ jsxs("div", {
|
|
22136
|
+
className: "min-h-0 overflow-y-auto",
|
|
22137
|
+
children: [
|
|
22138
|
+
/* @__PURE__ */ jsx("p", {
|
|
22139
|
+
className: "m-0 mb-2 text-xs text-muted-foreground",
|
|
22140
|
+
children: t("workflowTransfer.workflowCount", { count: workflows.length + missing })
|
|
22141
|
+
}),
|
|
22142
|
+
/* @__PURE__ */ jsx("ul", {
|
|
22143
|
+
className: "m-0 list-none space-y-2 p-0",
|
|
22144
|
+
children: workflows.map(({ flowId, file }) => /* @__PURE__ */ jsx(WorkflowListItem, { name: file.name ?? t("workflowTransfer.unnamed") }, flowId))
|
|
22145
|
+
}),
|
|
22146
|
+
missing > 0 && /* @__PURE__ */ jsx("p", {
|
|
22147
|
+
role: "alert",
|
|
22148
|
+
className: "m-0 mt-2 text-sm text-destructive",
|
|
22149
|
+
children: t("workflowTransfer.unavailable", { count: missing })
|
|
22150
|
+
})
|
|
22151
|
+
]
|
|
22152
|
+
}),
|
|
22153
|
+
/* @__PURE__ */ jsxs(DialogFooter, { children: [/* @__PURE__ */ jsx(Button, {
|
|
22154
|
+
variant: "outline",
|
|
22155
|
+
onClick: () => workspace.closeExport(),
|
|
22156
|
+
children: t("common.cancel")
|
|
22157
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
22158
|
+
disabled: missing > 0,
|
|
22159
|
+
onClick: () => workspace.completeExport(includeDependencies),
|
|
22160
|
+
children: t("workflowTransfer.export")
|
|
22161
|
+
})] })
|
|
22162
|
+
]
|
|
22163
|
+
})
|
|
22164
|
+
});
|
|
22165
|
+
}
|
|
22166
|
+
function WorkflowExportDialog({ workspace, container }) {
|
|
22167
|
+
const preview = useVal(workspace.exportPreview);
|
|
22168
|
+
return preview == null ? null : /* @__PURE__ */ jsx(ExportDialog, {
|
|
22169
|
+
preview,
|
|
22170
|
+
workspace,
|
|
22171
|
+
container
|
|
22172
|
+
}, preview.entryFlowId);
|
|
22173
|
+
}
|
|
22174
|
+
//#endregion
|
|
19662
22175
|
//#region ../../node_modules/.bun/dequal@2.0.3/node_modules/dequal/dist/index.mjs
|
|
19663
22176
|
var has = Object.prototype.hasOwnProperty;
|
|
19664
22177
|
function find(iter, tar, key) {
|
|
@@ -21292,11 +23805,10 @@ var RevisionView = class {
|
|
|
21292
23805
|
}
|
|
21293
23806
|
};
|
|
21294
23807
|
function revisionView(revision) {
|
|
21295
|
-
|
|
21296
|
-
if (
|
|
21297
|
-
|
|
21298
|
-
|
|
21299
|
-
}
|
|
23808
|
+
const cached = views.get(revision);
|
|
23809
|
+
if (cached) return cached;
|
|
23810
|
+
const view = new RevisionView(revision);
|
|
23811
|
+
views.set(revision, view);
|
|
21300
23812
|
return view;
|
|
21301
23813
|
}
|
|
21302
23814
|
function connectorAccessReferences(document) {
|
|
@@ -22073,7 +24585,7 @@ function nodeDiagnosticCount(node, diagnostics) {
|
|
|
22073
24585
|
return diagnostics.filter((diagnostic) => paths.some((path) => diagnostic.path.startsWith(path))).length;
|
|
22074
24586
|
}
|
|
22075
24587
|
function runProjection(revision, run, events) {
|
|
22076
|
-
if (run
|
|
24588
|
+
if (run == null || revision.revision.flowId == null || revision.revision.revisionId == null || run.flowId != revision.revision.flowId || run.revisionId != revision.revision.revisionId) return { nodes: /* @__PURE__ */ new Map() };
|
|
22077
24589
|
const active = run.status == "queued" || run.status == "starting" || run.status == "running" || run.status == "waiting";
|
|
22078
24590
|
const nodes = /* @__PURE__ */ new Map();
|
|
22079
24591
|
if ("waits" in run) for (const wait of run.waits) nodes.set(wait.nodeId, {
|
|
@@ -25500,4 +28012,4 @@ function updateHttpParameters(revision, nodeId, group, edit, bindingId) {
|
|
|
25500
28012
|
return cleanVariableBindings(content, [...operations, ...binding]);
|
|
25501
28013
|
}
|
|
25502
28014
|
//#endregion
|
|
25503
|
-
export { resourceValue as $,
|
|
28015
|
+
export { resourceValue as $, allConnectorConnectionsQuery as $n, WorkflowExportDialog as $t, schemaForEditor as A, TabsTrigger as An, serverAddress as Ar, actionWithConnections as At, datePickerValue as B, EmptyMedia as Bn, ApiError as Br, setNodeContentHidden as Bt, updateValue as C, selectors as Cn, inputValue as Cr, flowResourceReferences as Ct, defaultValueEditorSchema as D, Tabs as Dn, openApiTask as Dr, diagnosticMessage as Dt, supportsFeishuChatFilter as E, IconPickerButton as En, openApiFieldIssues as Er, diagnosticItems as Et, calendarChange as F, InputGroupInput as Fn, workflowCandidateGroup as Fr, removeComments as Ft, indexAddNodeOptions as G, SourceSelect as Gn, setCodeActions as Gt, isDateFormat as H, Badge as Hn, eventSourceKind as Hr, setVerticalNodeWidth as Ht, calendarDate as I, Empty as In, workflowCapability as Ir, restoreCanvasPresentation as It, scopedValue as J, EventSourceSetup as Jn, setServiceConnections as Jt, combineSources as K, createI18n as Kn, setConnectorConnection as Kt, dateFromTimeZone as L, EmptyContent as Ln, workflowSelectionTask as Lr, setCanvasLayout as Lt, getDefaultValue as M, followWorkbenchLink as Mn, sameWorkflowInterface as Mr, canvasPresentationChange as Mt, isUnconstrainedSchema as N, InputGroup as Nn, workflowAgentTool as Nr, commentIds as Nt, editorComponent as O, TabsContent as On, securityOptions as Or, diagnosticNodeId as Ot, typeOfSchema as P, InputGroupAddon as Pn, workflowCandidate as Pr, flowPresentation as Pt, resourceData as Q, randomId as Qn, WorkflowBundleSummary as Qt, dateInTimeZone as R, EmptyDescription as Rn, invalidResponse as Rr, setComment as Rt, updateTriggerConfig as S, ComboboxRoot as Sn, triggerConfigValues as Sr, revisionView as St, feishuResourceKind as T, useComboboxRootContext as Tn, object$1 as Tr, deriveInspectorDiagnostics as Tt, addNodeIntent as U, EventSourcesPage as Un, repairNodeNames as Ut, dateTimeWall as V, EmptyTitle as Vn, controlErrorCode as Vr, setNodePositions as Vt, deriveAddNodeOptions as W, SourceForm as Wn, resetInputValues as Wt, CacheResource as X, WorkbenchClient as Xn, updateTriggerSchedule as Xt, connectorActionPresentation as Y, errorNotice as Yn, updateStartInputDefs as Yt, observeResource as Z, normalizeFlowQuery as Zn, dequal as Zt, updateOutputPorts as _, ComboboxList as _n, workflowBundleFromPreview as _r, actionSummary as _t, nameCreatedNodes as a, FlowTagChips as an, webhookResponseDiagnostics as ar, getActionsCache as at, updateTaskAdditionalInputs as b, ComboboxInputGroup as bn, workflowNameFromFile as br, canCancelRun as bt, setInputVariable as c, selectionMenuItemClass as cn, normalizeTriggerOutputs as cr, getProvidersCache as ct, updateCondition as d, valueEditor_module_default as dn, isJsonObject as dr, loadJson as dt, WorkflowExportMenuItem as en, decodeResultList as er, action as et, updateHttpParameters as f, ComboboxItemIndicator as fn, isJsonValue as fr, designerGraph as ft, updateNodeSettings as g, ComboboxPortal as gn, parseWorkflowImportFile as gr, triggerNodeIcon as gt, updateNodeName as h, ComboboxPositioner as hn, encodeWorkflowBundle as hr, semanticNodeIcon as ht, deleteSelection as i, FlowSettingsDialog as in, resolutionOutputPorts as ir, decodeAppCatalogResponse as it, valueForEditor as j, useFlowQuery as jn, servers as jr, connectionCatalog as jt, editorGroups as k, TabsList as kn, selectOperation as kr, schemaMismatchMessage as kt, setTriggerConnection as l, ValueControl as ln, sampleErrorOutputs as lr, createPersistentCache as lt, updateNodeIcon as m, ComboboxPopup as mn, connectorActionMetadata as mr, nodeTitle as mt, agentTool as n, IdTooltip as nn, executionReachableNodes as nr, proxyResponse as nt, selectWebhookResponse as o, TagPicker as on, sourceOutputLabel as or, getAppCatalogCache as ot, updateNodeDescription as p, ComboboxItem as pn, connection as pr, nodeIcon as pt, mapSource as q, FeishuEventPicker as qn, setInputSources as qt, applyFlowChanges as r, FlowSettingsButton as rn, inputSourceCandidates as rr, validateAction as rt, setInputValue as s, selectionMenuContentClass as sn, sourcePort as sr, getConnectionsCache as st, addNode as t, useWorkflowExportAction as tn, decodeTriggerCatalog as tr, provider as tt, setTriggerEventSource as u, ValueEditorFeedback as un, triggerOutputDefinitions as ur, createSessionCache as ut, updateResolution as v, GroupCollectionProvider as vn, encodeWorkflowFile as vr, providerIcon as vt, updateWebhook as w, useComboboxInputValueContext as wn, listOperations as wr, Latest as wt, updateTaskPorts as x, ComboboxInput as xn, triggerConfigValue as xr, hasRunFilter as xt, updateTask as y, ComboboxTrigger as yn, workflowFileName as yr, RunStore as yt, datePickerChange as z, EmptyHeader as zn, record$2 as zr, setFlowViewport as zt };
|