UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,452 lines 3.49 MB
var kk = Object.defineProperty; var Fk = (e, t, n) => t in e ? kk(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var ee = (e, t, n) => Fk(e, typeof t != "symbol" ? t + "" : t, n); import { ref as C, computed as N, watch as J, onUnmounted as Kt, inject as ce, defineComponent as ue, provide as Bt, renderSlot as Pk, createVNode as r, onMounted as Te, Fragment as st, reactive as At, createApp as xl, Transition as wr, mergeProps as Qt, toRef as Ik, nextTick as rt, Teleport as ei, withDirectives as Ot, vShow as Ya, resolveComponent as xa, isVNode as En, onBeforeMount as Jn, watchEffect as Hu, shallowRef as xi, render as od, h as Or, cloneVNode as Mk, createTextVNode as se, getCurrentInstance as Wu, resolveDirective as Xn, withModifiers as Ut, onUpdated as ip, onBeforeUnmount as Ao, vModelCheckbox as Ti, vModelText as Va, Comment as Gh, toRefs as ti, toRaw as Ek, compile as Ak, vModelSelect as Bk, onDeactivated as Dk, unref as ng, onActivated as Vk, isRef as ag, triggerRef as Ok } from "vue"; import { isPlainObject as og, cloneDeep as Ne, isUndefined as la, debounce as Bo, isFunction as id, mergeWith as Gs, merge as To, isNil as Nk, trim as Rk, isNaN as Lk, flatten as Yh, get as Ci, isEmpty as $k, throttle as Qd, findIndex as ig } from "lodash-es"; import Nt from "bignumber.js"; import { createI18n as jk, useI18n as _k } from "vue-i18n"; import { useResizeObserver as Nr } from "@vueuse/core"; function Qh(e, t) { let n; function a(c) { const { properties: p, title: v, ignore: m } = c, g = m && Array.isArray(m), h = Object.keys(p).reduce((y, b) => ((!g || !m.find((w) => w === b)) && (y[b] = p[b].type === "object" && p[b].properties ? a(p[b]) : Ne(p[b].default)), y), {}); if (v && (!g || !m.find((y) => y === "id"))) { const y = v.toLowerCase().replace(/-/g, "_"); h.id = `${y}_${Math.random().toString().slice(2, 6)}`; } return h; } function o(c) { const { properties: p, title: v, required: m } = c; if (m && Array.isArray(m)) { const g = m.reduce((h, y) => (h[y] = p[y].type === "object" && p[y].properties ? a(p[y]) : Ne(p[y].default), h), {}); if (v && m.find((h) => h === "id")) { const h = v.toLowerCase().replace(/-/g, "_"); g.id = `${h}_${Math.random().toString().slice(2, 6)}`; } return g; } return { type: v }; } function i(c, p = {}, v) { const m = e[c]; if (m) { let g = o(m); const h = t[c]; return g = h ? h({ getSchemaByType: i }, g, p, v) : g, n != null && n.appendIdentifyForNewControl && n.appendIdentifyForNewControl(g), g; } return null; } function l(c, p) { const v = a(p); return Object.keys(v).reduce((m, g) => (Object.prototype.hasOwnProperty.call(c, g) && (m[g] && og(m[g]) && og(c[g] || !c[g]) ? Object.assign(m[g], c[g] || {}) : m[g] = c[g]), m), v), v; } function s(c, p) { return Object.keys(c).filter((m) => c[m] != null).reduce((m, g) => { if (p.has(g)) { const h = p.get(g); if (typeof h == "string") m[h] = c[g]; else { const y = h(g, c[g], c); Object.assign(m, y); } } else m[g] = c[g]; return m; }, {}); } function u(c, p, v = /* @__PURE__ */ new Map()) { const m = l(c, p); return s(m, v); } function d(c) { var v; const p = c.type; if (p) { const m = e[p]; if (!m) return c; const g = l(c, m), h = ((v = c.editor) == null ? void 0 : v.type) || ""; if (h) { const y = e[h], b = l(c.editor, y); g.editor = b; } return g; } return c; } function f(c) { n = c; } return { getSchemaByType: i, resolveSchemaWithDefaultValue: d, resolveSchemaToProps: u, mappingSchemaToProps: s, setDesignerContext: f }; } const Vi = {}, lp = {}, { getSchemaByType: _a, resolveSchemaWithDefaultValue: Hk, resolveSchemaToProps: Kh, mappingSchemaToProps: Xh, setDesignerContext: Wk } = Qh(Vi, lp); function zk(e = {}) { function t(d, f, c, p) { if (typeof c == "number") return p[d].length === c; if (typeof c == "object") { const v = Object.keys(c)[0], m = c[v]; if (v === "not") return Number(p[d].length) !== Number(m); if (v === "moreThan") return Number(p[d].length) >= Number(m); if (v === "lessThan") return Number(p[d].length) <= Number(m); } return !1; } function n(d, f, c, p) { return p[d] && p[d].propertyValue && String(p[d].propertyValue.value) === String(c); } const a = /* @__PURE__ */ new Map([ ["length", t], ["getProperty", n] ]); Object.keys(e).reduce((d, f) => (d.set(f, e[f]), d), a); function o(d, f) { const c = d; return typeof f == "number" ? [{ target: c, operator: "length", param: null, value: Number(f) }] : typeof f == "boolean" ? [{ target: c, operator: "getProperty", param: d, value: !!f }] : typeof f == "object" ? Object.keys(f).map((p) => { if (p === "length") return { target: c, operator: "length", param: null, value: f[p] }; const v = p, m = f[p]; return { target: c, operator: "getProperty", param: v, value: m }; }) : []; } function i(d) { return Object.keys(d).reduce((c, p) => { const v = o(p, d[p]); return c.push(...v), c; }, []); } function l(d, f) { if (a.has(d.operator)) { const c = a.get(d.operator); return c && c(d.target, d.param, d.value, f) || !1; } return !1; } function s(d, f) { return i(d).reduce((v, m) => v && l(m, f), !0); } function u(d, f) { const c = Object.keys(d), p = c.includes("allOf"), v = c.includes("anyOf"), m = p || v, y = (m ? d[m ? p ? "allOf" : "anyOf" : "allOf"] : [d]).map((w) => s(w, f)); return p ? !y.includes(!1) : y.includes(!0); } return { parseValueSchema: u }; } const qk = { convertTo: (e, t, n, a) => { e.appearance || (e.appearance = {}), e.appearance[t] = n; }, convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t] }, Uk = { convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无" }, Gk = { convertTo: (e, t, n, a) => { e.editor && (e.editor[t] = n); }, convertFrom: (e, t, n) => e.editor && Object.prototype.hasOwnProperty.call(e.editor, t) ? e.editor[t] : e[t] }, Se = { button: { type: "button", name: "按钮" }, "response-toolbar": { type: "response-toolbar", name: "工具栏" }, "response-toolbar-item": { type: "response-toolbar-item", name: "按钮" }, "content-container": { type: "content-container", name: "容器" }, "input-group": { type: "input-group", name: "文本" }, textarea: { type: "textarea", name: "多行文本" }, lookup: { type: "lookup", name: "帮助" }, "number-spinner": { type: "number-spinner", name: "数值" }, "date-picker": { type: "date-picker", name: "日期" }, switch: { type: "switch", name: "开关" }, "radio-group": { type: "radio-group", name: "单选组" }, "check-box": { type: "check-box", name: "复选框" }, "check-group": { type: "check-group", name: "复选框组" }, "combo-list": { type: "combo-list", name: "下拉列表" }, "response-form": { type: "response-form", name: "卡片面板" }, "response-layout": { type: "response-layout", name: "布局容器", icon: "response-layout-3" }, "response-layout-item": { type: "response-layout-item", name: "布局", icon: "response-layout-1" }, "tree-grid": { type: "tree-grid", name: "树表格" }, "tree-grid-column": { type: "tree-grid-column", name: "树表格列" }, "data-grid": { type: "data-grid", name: "表格" }, "data-grid-column": { type: "data-grid-column", name: "表格列" }, module: { type: "Module", name: "模块" }, component: { type: "component", name: "组件" }, tabs: { type: "tabs", name: "标签页" }, "tab-page": { type: "tab-page", name: "标签页项", dependentParentControl: "Tab" }, "tab-toolbar-item": { type: "tab-toolbar-item", name: "标签页工具栏按钮" }, "drawer-toolbar-item": { type: "drawer-toolbar-item", name: "抽屉工具栏按钮" }, "html-template": { type: "html-template", name: "模板容器" }, "time-picker": { type: "time-picker", name: "时间选择" }, section: { type: "section", name: "分组面板" }, "section-toolbar": { type: "section-toolbar", name: "分组面板工具栏" }, "section-toolbar-item": { type: "section-toolbar-item", name: "分组面板按钮" }, splitter: { type: "splitter", name: "分栏面板" }, "splitter-pane": { type: "splitter-pane", name: "分栏面板项", dependentParentControl: "Splitter" }, "component-ref": { type: "component-ref", name: "组件引用节点" }, uploader: { type: "uploader", name: "附件上传" }, "page-header": { type: "page-header", name: "页头" }, "page-footer": { type: "page-footer", name: "页脚" }, "tab-toolbar": { type: "tab-toolbar", name: "标签页工具栏" }, "drawer-toolbar": { type: "drawer-toolbar", name: "抽屉工具栏" }, fieldset: { type: "fieldset", name: "分组" }, "query-solution": { type: "query-solution", name: "筛选方案" }, drawer: { type: "drawer", name: "抽屉" }, "external-container": { type: "external-container", name: "外部容器", icon: "content-container" }, "list-nav": { type: "list-nav", name: "列表导航" }, nav: { type: "nav", name: "标签类导航" }, "list-view": { type: "list-view", name: "列表" }, "filter-bar": { type: "filter-bar", name: "筛选条" }, "language-textbox": { type: "language-textbox", name: "多语输入框" }, image: { type: "image", name: "图像" }, avatar: { type: "avatar", name: "头像" }, "discussion-editor": { type: "discussion-editor", name: "评论编辑区" }, "discussion-list": { type: "discussion-list", name: "评论列表" }, comment: { type: "comment", name: "评论区" }, "approval-logs": { type: "approval-logs", name: "审批记录" }, "rich-text-editor": { type: "rich-text-editor", name: "富文本", icon: "rich-text-box" }, calendar: { type: "calendar", name: "日历", icon: "date-picker" }, wizard: { type: "wizard", name: "向导", icon: "wizard" }, "wizard-page": { type: "wizard-page", name: "向导页", icon: "wizard" }, "wizard-page-detail": { type: "wizard-page-detail", name: "向导详情", icon: "wizard" }, step: { type: "step", name: "步骤条", icon: "step" }, "dynamic-form": { type: "dynamic-form", name: "动态表单" } }, Yk = { convertFrom: (e, t, n) => { var o; const a = e.editor && e.editor[t] ? e.editor[t] : e[t]; return ((o = Se[a]) == null ? void 0 : o.name) || a; } }, Qk = { convertTo: (e, t, n, a) => { e[t] = e[t]; }, convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : "" }, Kk = { convertTo: (e, t, n, a) => { (e.type === "data-grid-column" || e.type === "tree-grid-column") && (e.formatter ? e.formatter[t] = n : e.formatter = { [t]: n }); }, convertFrom: (e, t, n) => { if (e.formatter) { if (t === "trueText") return e.formatter.trueText; if (t === "falseText") return e.formatter.falseText; if (t === "prefix") return e.formatter.prefix; if (t === "suffix") return e.formatter.suffix; if (t === "precision") return e.formatter.precision; if (t === "decimal") return e.formatter.decimal; if (t === "thousand") return e.formatter.thousand; if (t === "dateFormat") return e.formatter.dateFormat || "yyyy-MM-dd"; if (t === "customFormat") return e.formatter.customFormat; if (t === "type") return e.formatter.type || "none"; } return "none"; } }, Xk = { convertTo: (e, t, n, a) => { e.command ? e.command[t] = n : e.command = { [t]: n }, t === "enableType" && n === "default" && (e.command.enable = !0, e.command.formatter = "", e.command.commands = [ { text: "编辑", type: "primary", command: "edit" }, { text: "删除", type: "danger", command: "remove" } ]), t === "enableType" && n === "custom" && (e.command.enable = !0, e.command.commands = [ { value: "add", text: "增加", type: "link" }, { value: "edit", text: "编辑", type: "link" }, { value: "remove", text: "删除", type: "link" } ]), t === "enableType" && n === "unable" && (e.command.enable = !1, e.command.formatter = ""); }, convertFrom: (e, t, n) => { var a, o; if (e.command) { if (t === "enableType") { if (e.command.enableType) return e.command.enableType; const i = (o = (a = e.command) == null ? void 0 : a.commands) == null ? void 0 : o.find((l) => l.command === "edit" && l.type === "primary"); return e.command.enable ? i ? "default" : "custom" : "unable"; } if (t === "commands") return e.command.enableType === "custom" ? e.command.commands : []; if (t === "formatter") return e.command.formatter; if (t === "count") return e.command.count; if (t === "columnWidth") return e.command.columnWidth || 200; } return ""; } }, Jk = { convertTo: (e, t, n, a) => { e.column ? e.column[t] = n : e.column = { [t]: n }, t === "fitColumns" && n && (e.column.fitMode || (e.column.fitMode = "average")); }, convertFrom: (e, t, n) => { if (e.column) { if (t === "fitColumns") return e.column.fitColumns; if (t === "fitMode") return e.column.fitMode; } return ""; } }, Zk = { convertTo: (e, t, n, a) => { e.summary ? e.summary[t] = n : e.summary = { [t]: n }, t === "enable" && n && (e.summary ? e.summary.groupFields || (e.summary.groupFields = []) : e.summary = { enable: n, groupFields: [] }); }, convertFrom: (e, t, n) => { var a, o; return t === "customSummaryStyle" ? e.summary.customSummaryStyle : t === "position" ? ((a = e.summary) == null ? void 0 : a[t]) || "bottom" : t === "customRender" ? ((o = e.summary) == null ? void 0 : o[t]) || "" : e.summary && t === "enable" ? e.summary.enable : e.type === "data-grid-column" ? e.enableSummary === void 0 ? !1 : e.enableSummary : ""; } }, eF = { convertTo: (e, t, n, a) => { e.group ? e.group[t] = n : e.group = { [t]: n }, t === "enable" && n && (e.group ? e.group.groupFields || (e.group.groupFields = []) : e.group = { enable: n, groupFields: [], showSummary: !1, customRender: "" }); }, convertFrom: (e, t, n) => { if (e.group) { if (t === "enable") return e.group.enable; if (t === "showSummary") return e.group.showSummary; if (t === "customRender") return e.group.customRender; if (t === "groupFields") return e.group.groupFields; } } }, tF = { convertFrom: (e, t) => e.binding ? e.binding.path : "", convertTo: (e, t, n) => { if (n && n.length > 0) { const a = n[0]; e.binding || (e.binding = {}), e.binding.type = "Form", e.binding.path = a.bindingField, e.binding.field = a.id, e.binding.fullPath = a.path, e.path = a.bindingPath; } } }, nF = { convertTo: (e, t, n, a) => { e.pagination || (e.pagination = {}), t === "sizeLimits" ? e.pagination.sizeLimits = n.split(",") : e.pagination[t] = n; }, convertFrom: (e, t, n) => { var a; return e.pagination ? t === "sizeLimits" ? (a = e.pagination.sizeLimits) == null ? void 0 : a.join(",") : e.pagination[t] : e[t]; } }, aF = { convertTo: (e, t, n, a) => { e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = n; }, convertFrom: (e, t, n) => e.rowNumber ? e.rowNumber[t] : e[t] }, oF = { convertTo: (e, t, n, a) => { e.selection || (e.selection = {}), e.selection[t] = n; }, convertFrom: (e, t, n) => { if (!e.selection) return !!e[t]; const a = !!e.selection[t]; return t === "showCheckbox" && a == null && e.selection.multiSelect === !0 ? !0 : a; } }, iF = { convertFrom: (e, t, n) => e[t] && e[t].length ? `共 ${e[t].length} 项` : "" }, lF = { convertFrom: (e, t) => e[t] || "", convertTo: (e, t, n) => { e[t] = n; } }, rF = { convertTo: (e, t, n, a) => { e.size || (e.size = {}), e.size[t] = n; }, convertFrom: (e, t, n) => e.size ? e.size[t] : e[t] }, sF = { convertFrom: (e, t, n) => { var a, o; return (a = e.formatter) != null && a.data && t === "formatterEnumData" && !e.formatterEnumData ? (o = e.formatter) == null ? void 0 : o.data : e.formatterEnumData; } }, uF = { convertTo: (e, t, n, a) => { e.sort || (e.sort = {}), e.sort[t] = n; }, convertFrom: (e, t, n) => { var a, o; if (t === "mode") return ((a = e.sort) == null ? void 0 : a.mode) || "client"; if (t === "multiSort") return !!((o = e.sort) != null && o.multiSort); } }, cF = { convertTo: (e, t, n, a) => { e.filter || (e.filter = {}), e.filter[t] = n, t === "enable" && (e.enableFilter = !1); }, convertFrom: (e, t, n) => { var a, o, i, l; return t === "mode" ? ((a = e.filter) == null ? void 0 : a.mode) || "server" : t === "filterStyle" ? ((o = e.filter) == null ? void 0 : o.filterStyle) || "filter-column" : t === "enable" ? ((i = e.filter) == null ? void 0 : i.enable) !== void 0 ? !!e.filter.enable : !!e.enableFilter : ((l = e.filter) == null ? void 0 : l[t]) || void 0; } }, dF = { convertTo: (e, t, n, a) => { e.rowOption ? e.rowOption[t] = n : e.rowOption = { [t]: n }; }, convertFrom: (e, t, n) => { if (e.rowOption) { if (t === "customRowStyle") return e.rowOption.customRowStyle; if (t === "customCellStyle") return e.rowOption.customCellStyle; if (t === "height") return e.rowOption.height; } return ""; } }, fF = { convertTo: (e, t, n, a) => { (e.type === "data-grid-column" || e.type === "tree-grid-column") && (e[t] = n, t === "columnTemplateType" && n === "hyperlink" && (e.onClickLinkCommand ? e.columnTemplate = ` <span class="f-pretend-link f-cursor-pointer" @click="(ctx)=>viewModel.current.${e.onClickLinkCommand || ""}({id: rowData.id,context: ctx})"> {{rowData.${e.field}}} </span>` : e.columnTemplate = ` <span class="f-pretend-link f-cursor-pointer"> {{rowData.${e.field}}} </span>`), t === "columnTemplateType" && n === "default" && (e.columnTemplate = ""), t === "columnTemplateType" && n === "custom" && (e.columnTemplate = "")); }, convertFrom: (e, t, n) => t === "columnTemplate" ? e.columnTemplate : t === "columnTemplateType" ? e.columnTemplateType ? e.columnTemplateType || "default" : e.columnTemplate && !e.onClickLinkCommand ? "custom" : e.columnTemplate && e.onClickLinkCommand ? "hyperlink" : "default" : "" }, pF = { convertTo: (e, t, n, a) => { e.hierarchy || (e.hierarchy = { cascadeOption: {} }), e.hierarchy.cascadeOption || (e.hierarchy.cascadeOption = {}), e.hierarchy.cascadeOption[t] = n; }, convertFrom: (e, t, n) => { var a, o; return !!((o = (a = e.hierarchy) == null ? void 0 : a.cascadeOption) != null && o[t]); } }; function Jh(e, t, n) { const a = /* @__PURE__ */ new Map([ ["/converter/appearance.converter", qk], ["/converter/buttons.converter", Uk], ["/converter/property-editor.converter", Gk], ["/converter/items-count.converter", iF], ["/converter/type.converter", Yk], ["/converter/change-editor.converter", Qk], ["/converter/change-formatter.converter", Kk], ["/converter/column-command.converter", Xk], ["/converter/column-option.converter", Jk], ["/converter/summary.converter", Zk], ["/converter/group.converter", eF], ["/converter/form-group-label.converter", lF], ["/converter/field-selector.converter", tF], ["/converter/pagination.converter", nF], ["/converter/row-number.converter", aF], ["/converter/grid-selection.converter", oF], ["/converter/size.converter", rF], ["/converter/change-formatter-enum.converter", sF], ["/converter/grid-sort.converter", uF], ["/converter/grid-filter.converter", cF], ["/converter/row-option.converter", dF], ["/converter/change-formatter-type.converter", fF], ["/converter/tree-auto-check.converter", pF] ]), o = /* @__PURE__ */ new Map([ ["string", { type: "input-group", enableClear: !1 }], ["boolean", { type: "combo-list", textField: "name", valueField: "value", idField: "value", enableClear: !1, editable: !1, data: [ { value: !0, name: "是" }, { value: !1, name: "否" } ] }], ["enum", { type: "combo-list", maxHeight: 128, enableClear: !1, editable: !1 }], ["array", { type: "button-edit" }], ["number", { type: "number-spinner", placeholder: "" }], ["events-editor", { type: "events-editor", hide: !0 }], ["multiLanguage", { type: "language-textbox" }] ]), i = zk(); function l(m, g) { return () => i.parseValueSchema(m, g); } function s(m, g, h) { return m.includes("visible") && g.visible !== void 0 ? typeof g.visible == "boolean" ? () => !!g.visible : g.visible === void 0 ? !0 : l(g.visible, h) : () => !0; } function u(m, g, h) { return m.includes("readonly") && g.readonly !== void 0 ? typeof g.readonly == "boolean" ? () => !!g.readonly : l(g.readonly, h) : () => !1; } function d(m, g) { const h = m.$converter || g; return typeof h == "string" && h && a.has(h) ? a.get(h) || null : h || null; } function f(m, g, h, y, b, w = "", S = "") { return Object.keys(m).map((F) => { const k = C(1), x = F, I = m[F], P = Object.keys(I), A = I.title, E = I.type, M = o.get(E) || { type: "input-group", enableClear: !1 }, B = I.editor ? Object.assign({}, M, I.editor) : Object.assign({}, M), V = s(P, I, g), D = u(P, I, g); B.readonly = B.readonly === void 0 ? D() : B.readonly; const O = I.type === "cascade" ? f(I.properties, g, h, y, b, w, S) : [], R = !0; let L = d(I, S); const H = N({ get() { if (k.value) { if (["class", "style"].find((K) => K === x) && !L && (L = a.get("/converter/appearance.converter") || null), L && L.convertFrom) { const K = L.convertFrom(h, F, b, w); return K === void 0 && Object.prototype.hasOwnProperty.call(I, "defaultValue") ? I.type === "boolean" ? I.defaultValue : I.defaultValue || "" : K; } const U = h[F]; return Object.prototype.hasOwnProperty.call(I, "defaultValue") && (U === void 0 || typeof U == "string" && U === "") ? I.type === "boolean" ? I.defaultValue : I.defaultValue || "" : U; } return null; }, set(U) { k.value += 1, L && L.convertTo ? (L.convertTo(y, F, U, b, w), L.convertTo(h, F, U, b, w)) : (y[F] = U, h[F] = U); } }), { refreshPanelAfterChanged: $, description: W, isExpand: G, parentPropertyID: Y } = I, z = { propertyID: x, propertyName: A, propertyType: E, propertyValue: H, editor: B, visible: V, readonly: D, cascadeConfig: O, hideCascadeTitle: R, refreshPanelAfterChanged: $, description: W, isExpand: G, parentPropertyID: Y }; return g[x] = z, z; }); } function c(m, g, h = {}) { const y = {}, b = e[m]; return b && b.categories ? Object.keys(b.categories).map((S) => { const T = b.categories[S], F = T == null ? void 0 : T.title, k = f(T.properties || {}, y, {}, h, g); return { categoryId: S, categoryName: F, properties: k }; }) : []; } function p(m, g, h, y, b = "") { const w = g.$ref.schema, S = g.$ref.converter, T = h[w], F = T.type, k = n(T), x = {}, I = e[F]; if (I && I.categories) { const P = I.categories[m], A = P == null ? void 0 : P.title; S && Object.keys(P.properties).forEach((B) => { P.properties[B].$converter = S; }); const E = (P == null ? void 0 : P.properties) || {}, M = f(E, x, k, T, y, b); return { categoryId: m, categoryName: A, properties: M }; } return { categoryId: m, categoryName: "", properties: [] }; } function v(m, g, h, y, b) { const w = m.type, S = n(m), T = {}; let F = b || e[w]; if (!(F && Object.keys(F).length > 0) && h && h.getPropConfig && (F = h.getPropConfig(y)), F && F.categories) { const x = []; return Object.keys(F.categories).map((I) => { const P = F.categories[I]; if (P.$ref) { x.push(p(I, P, m, g, y)); return; } const A = P == null ? void 0 : P.title, E = P == null ? void 0 : P.tabId, M = P == null ? void 0 : P.tabName, B = P == null ? void 0 : P.hide, V = P == null ? void 0 : P.hideTitle, D = f(P.properties || {}, T, S, m, g, y, P.$converter), { setPropertyRelates: O } = P, R = P == null ? void 0 : P.parentPropertyID; x.push({ categoryId: I, categoryName: A, tabId: E, tabName: M, hide: B, properties: D, hideTitle: V, setPropertyRelates: O, parentPropertyID: R }); }), x; } return []; } return { getPropertyConfigBySchema: v, getPropertyConfigByType: c, propertyConverterMap: a }; } const rp = {}, sp = {}; Jh(rp, sp, Hk); const zu = {}, qu = {}, { getSchemaByType: Rr, resolveSchemaWithDefaultValue: mF, resolveSchemaToProps: use, mappingSchemaToProps: cse, setDesignerContext: vF } = Qh(zu, qu), Tl = {}, Lr = {}, { getPropertyConfigBySchema: Ds } = Jh(Tl, Lr, mF); function Xe(e, t, n = /* @__PURE__ */ new Map(), a = (l, s, u, d) => s, o = {}, i = (l) => l) { return Vi[t.title] = t, lp[t.title] = a, rp[t.title] = o, sp[t.title] = i, zu[t.title] = t, qu[t.title] = a, Tl[t.title] = o, Lr[t.title] = i, (l = {}, s = !0) => { if (!s) return Xh(l, n); const u = Kh(l, t, n), d = Object.keys(e).reduce((f, c) => (f[c] = e[c].default, f), {}); return Object.assign(d, u); }; } function gF(e, t, n, a, o) { const { schemaMap: i, schemaResolverMap: l, propertyConfigSchemaMap: s, propertyEffectMap: u } = o; i[e.title] = e, l[e.title] = t, s[e.title] = n, u[e.title] = a; } function yn(e, t, n = /* @__PURE__ */ new Map(), a = (l, s, u, d) => s, o = {}, i = (l) => l) { return (l) => (gF(t, a, o, i, l), (s = {}, u = !0) => { if (!u) return Xh(s, n); const d = Kh(s, t, n), f = Object.keys(e).reduce((c, p) => (c[p] = e[p].default, c), {}); return Object.assign(f, d); }); } function ht(e, t) { return { customClass: t.class, customStyle: t.style }; } function Zh(e, t) { var a, o; const n = {}; if (t != null && t.buttons) { const i = []; (a = t == null ? void 0 : t.buttons) == null || a.map((l) => { const s = {}; Object.keys(l).map((u) => { var d; u === "appearance" ? s.class = ((d = l[u]) == null ? void 0 : d.class) || "" : s[u] = l[u]; }), i.push(s); }), n.buttons = i; } return (o = t == null ? void 0 : t.appearance) != null && o.class && (n.buttonClass = t.appearance.class || "col-6"), t != null && t.id && (n.toolbarId = t.id), t && Object.prototype.hasOwnProperty.call(t, "visible") && (n.buttonsVisible = t.visible), t && Object.prototype.hasOwnProperty.call(t, "buttonSize") && (n.buttonSize = t.buttonSize), n; } function hF() { function e(t, n) { const { id: a } = t || {}; if (t.binding === void 0 || typeof t.binding != "object") return {}; const { field: o } = t.binding || {}; return { modelValue: n.getValue(a), "onUpdate:modelValue": (i) => { n.setValue(a, o, i); } }; } return { resolve: e }; } function ey() { function e(t, n) { const { id: a } = t || {}, { dataSource: o } = t || {}; return o === void 0 ? {} : { data: n.getValue(a), "onUpdate:data": (...i) => { } }; } return { resolve: e }; } function yF() { function e(t, n) { const { id: a } = t || {}, { dataSource: o } = t || {}; return o === void 0 ? {} : {}; } return { resolve: e }; } function dse() { function e(t, n) { const { path: a } = t.binding || {}; return a ? { "onUpdate:dataMapping": (...o) => { } } : {}; } return { resolve: e }; } function bF() { function e(t, n) { const { id: a } = t || {}, { dataSource: o } = t || {}; return o === void 0 ? {} : { events: n.getValue(a) }; } return { resolve: e }; } function CF() { function e(t, n) { const { id: a } = t || {}; return { dataId: n.getValue(a) }; } return { resolve: e }; } function ty() { return (e, t, n) => { const a = t.id, { type: o } = t, i = e.emits; return i ? i.filter((l) => l !== "update:modelValue").reduce((l, s) => { const u = `on${s.charAt(0).toUpperCase()}${s.slice(1)}`; return l[u] = (...d) => { n.dispatch(a, s, o, d); }, l; }, {}) : {}; }; } function wF() { function e(t, n) { return t.selectItemById(n); } return { selectItemById: e }; } function SF() { function e(t, n) { return t.selectItemById(n); } return { selectItemById: e }; } function xF() { function e(t) { return t.editor; } return { resolve: e }; } function fse() { function e(t) { return Object.prototype.hasOwnProperty.call(t, "visible") ? t.visible : null; } return { resolve: e }; } function kl(e, t) { if (!e || e.length < 1) return null; for (const n of e) { if (n.id === t) return n; if (n.children) { const a = n.children.find((o) => o.id === t); if (a) return a; } } return null; } function pse() { function e(t, n) { const { name: a } = n; return t[`on${a.charAt(0).toUpperCase()}${a.slice(1)}`] || t[a]; } return { resolve: e }; } function ny() { function e(t, n) { var s; const a = (s = t.toolbar) == null ? void 0 : s.buttons; if (!a || a.length < 1) return null; const [o, i] = n.payloads, l = kl(a, i); return l ? l.onClick || l.click : null; } return { resolve: e }; } function TF() { function e(t, n) { const { name: a } = n, [o, i] = n.payloads; if (a === "tabChange" || a === "tabRemove") return t[`on${a.charAt(0).toUpperCase()}${a.slice(1)}`]; const l = t.contents; if (!l || l.length < 1) return null; const s = l.reduce((d, f) => { const c = f.toolbar && f.toolbar.buttons || []; return d.push(...c), d; }, []); if (!s || s.length < 1) return; const u = kl(s, i); return u ? u.onClick || u.click : null; } return { resolve: e }; } function kF() { function e(t, n) { const a = t.buttons; if (!a || a.length < 1) return null; const [o, i] = n.payloads, l = kl(a, i); return l ? l.onClick || l.click : null; } return { resolve: e }; } function FF() { function e(t, n) { var s; const a = (s = t.toolbar) == null ? void 0 : s.buttons; if (!a || a.length < 1) return null; const [o, i] = n.payloads, l = kl(a, i); return l ? l.onClick || l.click : null; } return { resolve: e }; } function PF() { function e(t, n) { const { footerToolbar: a, headerToolbar: o } = t, i = ((a == null ? void 0 : a.buttons) || []).concat((o == null ? void 0 : o.buttons) || []); if (!i || i.length < 1) return null; const [l, s] = n.payloads, u = kl(i, s); return u ? u.onClick || u.click : null; } return { resolve: e }; } function IF() { function e(t, n) { const { name: a } = n; if (a !== "fieldsClick") return t[`on${a.charAt(0).toUpperCase()}${a.slice(1)}`] || t[a]; const o = t.cardToolbar; if (!o || o.length < 1) return null; const [i, l] = n.payloads, s = kl(o, l); return s ? s.onClick || s.click : null; } return { resolve: e }; } function ay() { function e(t, n) { const { columns: a } = n; return t.updateColumns(a); } return { updateColumns: e }; } const oy = /* @__PURE__ */ new Map([ ["appearance", ht], ["size", (e, t) => { const n = {}; return t.width && (n.width = Number(t.width)), t.height && (n.height = Number(t.height)), n; }] ]), MF = "https://json-schema.org/draft/2020-12/schema", EF = "https://farris-design.gitee.io/accordion.schema.json", AF = "accordion", BF = "A Farris Container Component", DF = "object", VF = { id: { description: "The unique identifier for a Accordion", type: "string" }, type: { description: "The type string of Accordion component", type: "string", default: "accordion" }, appearance: { description: "", type: "object", properties: { class: { type: "string" }, style: { type: "string" } }, default: {} }, contents: { description: "", type: "array", default: [] }, customClass: { description: "", type: "string", default: "" }, size: { description: "", type: "object", properties: { width: { type: "number" }, height: { type: "number" } }, default: null }, enableFold: { description: "", type: "boolean", default: !0 }, expanded: { description: "", type: "boolean", default: !1 } }, OF = [ "id", "type", "contents" ], NF = { $schema: MF, $id: EF, title: AF, description: BF, type: DF, properties: VF, required: OF }; function RF(e, t, n) { return t; } const LF = "accordion", $F = "A Farris Component", jF = "object", _F = { basic: { description: "Basic Infomation", title: "基本信息", properties: { id: { description: "组件标识", title: "标识", type: "string", readonly: !0 }, type: { description: "组件类型", title: "控件类型", type: "select", editor: { type: "waiting for modification", enum: [] } } } } }, HF = { title: LF, description: $F, type: jF, categories: _F }, up = { customClass: { type: String, default: "" }, enableFold: { type: Boolean, default: !0 }, expanded: { type: Boolean, default: !1 }, height: { type: Number }, width: { type: Number } }, iy = Xe(up, NF, oy, RF, HF); function ly(e) { const t = e.nativeElement ? e.nativeElement : e; return t.classList !== void 0 && t.classList !== null ? t : null; } function ry(e, t) { if (t === void 0) return; const n = ly(e); n && n.classList.remove(t); } function Kd(e, t) { if (t === void 0) return; const n = ly(e); n && n.classList.add(t); } const WF = [ { size: "sm", width: 576, pattern: /\b(col-|col-sm-)\d+\b/ }, { size: "md", width: 768, pattern: /\bcol-md-\d+\b/ }, { size: "lg", width: 888, pattern: /\bcol-lg-\d+\b/ }, { size: "xl", width: 1200, pattern: /\bcol-xl-\d+\b/ }, { size: "el", width: 1690, pattern: /\bcol-el-\d+\b/ } ]; function sy(e) { e && e.resizeObserver && (e.resizeObserver.disconnect(), e.resizeObserver = null); } function uy(e, t, n = 0) { const a = []; if (!t) return; const o = n || t.getBoundingClientRect().width, i = parseFloat(o), l = e.breakPoints; for (let s = 0; s < l.length; s++) l[s].width <= i && a.push(l[s].size); if (e.className.join(",") !== a.join(",")) { if (e.className.length - a.length > 0) for (let u = a.length; u < e.className.length; u++) ry(t, "f-area-response--" + e.className[u]); else for (let u = e.className.length; u < a.length; u++) Kd(t, "f-area-response--" + a[u]); e.className = [...a]; } } function zF(e, t) { e.enable && e.autoWidth ? e.resizeObserver || (e.resizeObserver = new ResizeObserver((n) => { if (!n || n.length < 1 || !n[0].contentRect) return; const a = n[0].contentRect; Math.abs(parseInt(a.width + "") - e.width) > e.threshold && (uy(e, t, a.width), e.width = parseInt(a.width + "")); }), e.resizeObserver.observe(t)) : sy(e); } function lg(e, t) { if (e.enable) Kd(t, "f-area-response"), uy(e, t); else { ry(t, "f-area-response"); for (let n = e.className.length; n > 0; n--) Kd(t, "f-area-response--" + e.className[n]); e.className = []; } zF(e, t); } function qF(e) { const t = []; return WF.map((n) => { const a = "col-" + n.size + "-"; if (e.querySelectorAll('[class*="' + a + '"]').length > 0) t.push({ size: n.size, width: n.width }); else if (n.size === "sm") { const i = e.querySelectorAll('[class*="col-"]'); Array.from(i).some((s) => s.className.match(n.pattern)) && t.push({ size: n.size, width: n.width }); } }), t; } function rg(e, t, n) { t.value && Object.prototype.hasOwnProperty.call(t.value, "enable") && (e.enable = t.value.enable), t.value && Object.prototype.hasOwnProperty.call(t.value, "autoWidth") && (e.autoWidth = t.value.autoWidth), e && (e.breakPoints = qF(n)); } const sr = { // 在绑定元素的父组件 // 及他自己的所有子节点都挂载完成后调用 mounted: (e, t, n) => { n.sharedObject = { className: [], resizeObserver: null, enable: !0, autoWidth: !0, threshold: 10, width: 0, breakPoints: [] }, rg(n.sharedObject, t, e), lg(n.sharedObject, e); }, // 在绑定元素的父组件 // 及他自己的所有子节点都更新后调用 updated: function(e, t, n, a) { a && a.sharedObject ? n.sharedObject = a.sharedObject : n.sharedObject = { className: [], resizeObserver: null, enable: !0, autoWidth: !0, threshold: 10, width: 0, breakPoints: [] }, rg(n.sharedObject, t, e), lg(n.sharedObject, e); }, // 绑定元素的父组件卸载前调用 beforeUnmount(e, t, n) { n.sharedObject && sy(n.sharedObject); } }, UF = { created(e, t) { e.setAttribute("title", e.textContent || t.value || ""); }, mounted(e, t) { const n = t.value || e.textContent || ""; e.setAttribute("title", n); }, updated(e, t) { const n = t.value || e.textContent || ""; e.setAttribute("title", n); }, beforeUpdate(e, t) { const n = t.value || e.textContent || ""; e.setAttribute("title", n); } }; function cy(e, t, n, a, o) { const i = C(e.disabled), l = C(!1), s = C(e.showBorder), u = C(e.textAlign), d = C(e.updateOn), f = C(!1), c = N(() => e.editable || !e.readonly && !e.disabled), p = N(() => e.editable && !e.disabled && !e.readonly), v = N(() => !e.disabled && !e.readonly && l.value), m = N(() => n.value === "" || n.value === null || n.value === void 0), g = N(() => (e.disabled || e.readonly) && !e.forcePlaceholder ? "" : e.placeholder), h = N(() => e.readonly || !e.editable), y = N(() => e.enableTitle ? n.value : ""), b = N(() => e.maxLength > 0 ? e.maxLength : void 0), w = N(() => ({ "form-control": !0, "f-utils-fill": !0, "text-left": u.value === "left", "text-center": u.value === "center", "text-right": u.value === "right" })), S = N(() => { const L = { "f-cmp-inputgroup": !0, "input-group": !0, "f-state-disabled": i.value, "f-state-editable": p.value, "f-state-readonly": h.value, "f-state-focus": v.value, "input-group--has-clear": e.enableClear && f.value }; return (e.customClass || "").split(" ").reduce(($, W) => ($[W] = !0, $), L), L; }), T = (L) => e.maxLength > 0 && typeof L == "string" ? L.slice(0, e.maxLength) : L, F = N(() => s.value ? "" : "border-width : 0 "); function k() { return e.type && e.type !== "text" ? e.type : e.showType || "text"; } const x = C(k()); function I(L, H = !0) { n.value = T(L), a.value !== n.value && (a.value = n.value), H && (t.emit("change", n.value), t.emit("update:modelValue", n.value), t.emit("update:value", n.value)); } J( () => e.modelValue, (L, H) => { if (L === H) return; const $ = T(L); I($, !($ === L)); }, { immediate: !0 } ), J(() => e.disabled, (L, H) => { L !== H && (i.value = L); }), J(() => e.showType, (L) => { L && (x.value = L); }), J(() => e.type, (L) => { x.value = L; }); function P(L) { return L.stopPropagation(), l.value = !1, t.emit("blur", L), L.target.tagName === "TEXTAREA" && d.value === "blur" && (t.emit("update:modelValue", L.target.value), t.emit("update:value", L.target.value), t.emit("change", L.target.value)), !1; } function A(L) { t.emit("click", L); } function E(L) { i.value || h.value || (s.value && (l.value = !0), c.value && t.emit("focus", L)); } function M(L) { t.emit("input", L.target.value, L); const H = L.target.value; a.value = H, d.value === "change" && (t.emit("update:modelValue", H), t.emit("update:value", H), t.emit("change", H)); } function B(L) { t.emit("keydown", L); } function V(L) { t.emit("keyup", L); } function D(L) { const H = L.target; H.tagName !== "INPUT" && H.tagName !== "TEXTAREA" && L.preventDefault(), L.stopPropagation(), t.emit("mousedownEvent", L); } function O(L) { t.emit("mouseupEvent", L); } function R(L) { if (d.value === "blur") { const H = L.target.value; L.stopPropagation(), I(H); } } return { changeTextBoxValue: I, disabled: i, displayText: a, editable: p, hasFocused: v, inputGroupClass: S, inputType: x, isEmpty: m, modelValue: n, readonly: h, maxLength: b, onBlur: P, hasClearClass: f, onClick: A, onFocus: E, onInput: M, onKeydown: B, onKeyup: V, onMousedown: D, onMouseup: O, onTextBoxValueChange: R, placeholder: g, textBoxClass: w, textBoxTitle: y, inputGroupStyle: F }; } function GF(e, t, n, a) { const o = C(e.disabled), i = C(!1), l = C("text"), s = C(e.showBorder), u = C(e.textAlign); N(() => e.editable || !e.readonly); const d = N(() => e.editable && !e.disabled && !e.readonly), f = N(() => !e.disabled && i.value), c = N(() => n.value === "" || n.value === null || n.value === void 0), p = N(() => e.placeholder), v = N(() => e.readonly || !e.editable), m = N(() => e.enableTitle ? n.value : ""), g = N(() => e.maxLength > 0 ? e.maxLength : void 0), h = N(() => ({ "form-control": !0, // 'f-utils-fill': true, "text-left": u.value === "left", "text-center": u.value === "center", "text-right": u.value === "right" })), y = N(() => ({ "f-cmp-inputgroup": !0, "input-group": !0, "f-state-disabled": !0, "f-state-editable": !1, "f-state-readonly": !0 // 'f-state-focus': hasFocused.value })), b = N(() => s.value ? "" : "border-width : 0 "); function w(S, T = !0) { } return { changeTextBoxValue: w, disabled: o, displayText: a, editable: d, hasFocused: f, inputGroupClass: y, inputType: l, isEmpty: c, modelValue: n, readonly: v, maxLength: g, // onBlur, // onClick, // onFocus, // onInput, // onKeydown, // onKeyup, // onMousedown, // onTextBoxValueChange, placeholder: p, textBoxClass: h, textBoxTitle: m, inputGroupStyle: b }; } function dy(e, t, n) { const a = C(!1), o = N(() => e.enableClear && !e.readonly && !e.disabled), { changeTextBoxValue: i, displayText: l, hasFocused: s, modelValue: u, isEmpty: d, hasClearClass: f } = n, c = C(!1); function p(w) { a.value = w, f && (f.value = a.value); } const v = N(() => o.value && !!(l != null && l.value) && c.value); J(l, () => { p(v.value); }); const m = N(() => ({ "input-group-text": !0, "input-group-clear": !0 })), g = N(() => ({ width: "24px", display: a.value ? "flex" : "none" })); function h(w) { w.stopPropagation(), o.value && (i("", !0), p(!a.value), t.emit("clear")); } function y(w) { var k, x; c.value = !0; const S = ((k = w.target.querySelector("input")) == null ? void 0 : k.value) || "", T = ((x = w.target.querySelector("textarea")) == null ? void 0 : x.value) || "", F = S || T; F !== u.value && (u.value = F), o.value && p(!!F); } function b(w) { c.value = !1, o.value && p(!1); } return { clearButtonClass: m, clearButtonStyle: g, hasShownClearButton: a, onClearValue: h, onMouseEnter: y, onMouseLeave: b, shouldShowClearButton: o }; } const YF = { jan: 1, feb: 2, mar: 3, apr: 4, may: 5, jun: 6, jul: 7, aug: 8, sep: 9, oct: 10, nov: 11, dec: 12 }, QF = { sun: 0, mon: 1, tue: 2, wed: 3, thu: 4, fri: 5, sat: 6 }; class fy { constructor() { ee(this, "regexes", { YEAR: "[1-9]\\d{3}", MONTH: "1[0-2]|0?[1-9]", MONTH2: "1[0-2]|0[1-9]", MONTHNAME: "jan|january|feb|february|mar|march|apr|april|may|jun|june|jul|july|aug|august|sep|september|oct|october|nov|november|dec|december", DAYNAME: "mon|monday|tue|tuesday|wed|wednesday|thu|thursday|fri|friday|sat|saturday|sun|sunday", DAY: "3[01]|[12]\\d|0?[1-9]", DAY2: "3[01]|[12]\\d|0[1-9]", TIMEZONE: "[+-][01]\\d\\:?[0-5]\\d", H24: "[01]\\d|2[0-3]", MIN: "[0-5]\\d", SEC: "[0-5]\\d", MS: "\\d{3,}", H12: "0?[1-9]|1[012]", AMPM: "am|pm", UNIT: "year|month|week|day|hour|minute|second|millisecond" }); ee(this, "patterns", [ // 2010-03-15 ["iso_8601", this.makePattern("^(_YEAR_)-(_MONTH_)-(_DAY_)$"), "$2/$3/$1"], // 3-15-2010 ["us", this.makePattern("^(_MONTH_)([\\/-])(_DAY_)\\2(_YEAR_)$"), "$1/$3/$4"], // 15.03.2010 ["world", this.makePattern("^(_DAY_)([\\/\\.])(_MONTH_)\\2(_YEAR_)$"), "$3/$1/$4"], // 15-Mar-2010, 8 Dec 2011, "Thu, 8 Dec 2011" ["chicago", this.makePattern("^(?:(?:_DAYNAME_),? )?(_DAY_)([ -])(_MONTHNAME_)\\2(_YEAR_)$"), "$3 $1, $4"], // "March 4, 2012", "Mar 4 2012", "Sun Mar 4 2012" ["conversational", this.makePattern("^(?:(?:_DAYNAME_),? )?(_MONTHNAME_) (_DAY_),? (_YEAR_)$"), "$1 $2, $3"], // Tue Jun 22 17:47:27 +0000 2010 [ "month_day_time_year", this.makePattern("^(?:_DAYNAME_) (_MONTHNAME_) (_DAY_) ((?:_H24_)\\:(?:_MIN_)(?:\\:_SEC_)?) (_TIMEZONE_) (_YEAR_)$"), (t) => { const n = ("" + this.getMonthByName(t[1])).padStart(2, "0"), a = ("" + t[2]).padStart(2, "0"), o = t[5], i = t[3], l = t[4], s = o + "-" + n + "-" + a + "T" + i + l; return isNaN(s) ? !1 : s; } ], // @123456789 [ "unix", /^@(-?\d+)$/, (t) => this.create(parseInt(t[1], 10) * 1e3) ], // 24-hour time (This will help catch Date objects that are casted to a string) [ "24_hour", this.makePattern("^(?:(.+?)(?: |T))?(_H24_)\\:(_MIN_)(?:\\:(_SEC_)(?:\\.(_MS_))?)? ?(?:GMT)?(_TIMEZONE_)?(?: \\([A-Z]+\\))?$"), (t) => { let n; const a = t[1]; if (a) { if (n = this.create(a), isNaN(n)) return !1; } else n = /* @__PURE__ */ new Date(), n.setMilliseconds(0); const o = t[2], i = t[3], l = t[4], s = t[5]; return n.setHours(parseFloat(o), parseFloat(i), parseFloat(l || 0)), s && n.setMilliseconds(+String(s).slice(0, 3)), n; } ], // 12-hour time [ "12_hour", this.makePattern("^(?:(.+) )?(_H12_)(?:\\:(_MIN_)(?:\\:(_SEC_))?)? ?(_AMPM_)$"), (t) => { let n; const a = t[1]; if (a) { if (n = this.create(a), isNaN(n)) return !1; } else n = /* @__PURE__ */ new Date(), n.setMilliseconds(0); let o = parseFloat(t[2]); o = t[5].toLowerCase() === "am" ? o === 12 ? 0 : o : o === 12 ? 12 : o + 12; const i = t[3], l = t[4]; return n.setHours(o, parseFloat(i || 0), parseFloat(l || 0)), n; } ] ]); } makePattern(t) { return t = t.replace(/_([A-Z][A-Z0-9]+)_/g, (n, a) => this.regexes[a]), new RegExp(t, "i"); } getMonthByName(t) { return YF[String(t).slice(0, 3).toLowerCase()]; } getWeekdayByName(t) { return QF[String(t).slice(0, 3).toLowerCase()]; } parse(t) { if (!isNaN(Number(t))) return new Date(t); if (t = String(t).replace(/^\s*(.*)\s*$/, "$1"), t = t.replace(/\s{2,}/g, " "), t === "") return Date.now(); let n = 0; for (; n < this.patterns.length; ) { const a = this.patterns[n]; let o, i; typeof a[0] == "string" ? (i = a[1], o = a[2]) : (i = a[0], o = a[1]); const l = t.match(i); if (!l) { n++; continue; } if (typeof o == "function") { const s = o(l); if (s instanceof Date) return s; } else { const s = Date.parse(t.replace(i, o)); if (!isNaN(s)) return new Date(s); } n++; } return NaN; } create(t) { return t == null ? Date.now() : t instanceof Date ? t : this.parse(t); } } function gn(e) { const t = Object.prototype.toString.call(e); return e instanceof Date || typeof e == "object" && t === "[object Date]" ? new e.constructor(+e) : typeof e == "number" || t === "[object Number]" || typeof e == "string" || t === "[object String]" ? new Date(e) : /* @__PURE__ */ new Date(NaN); } function Sn(e, t) { return e instanceof Date ? new e.constructor(t) : new Date(t); } function jo(e, t) { const n = gn(e); return isNaN(t) ? Sn(e, NaN) : (t && n.setDate(n.getDate() + t), n); } function cp(e, t) { const n = gn(e); if (isNaN(t)) return Sn(e, NaN); if (!t) return n; const a = n.getDate(), o = Sn(e, n.getTime()); o.setMonth(n.getMonth() + t + 1, 0); const i = o.getDate(); return a >= i ? o : (n.setFullYear( o.getFullYear(), o.getMonth(), a ), n); } const py = 6048e5, KF = 864e5, dp = 6e4, fp = 36e5, XF = 1e3; let JF = {}; function Oi() { return JF; } function Ja(e, t) { var s, u, d, f; const n = Oi(), a = (t == null ? void 0 : t.weekStartsOn) ?? ((u = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : u.weekStartsOn) ?? n.weekStartsOn ?? ((f = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : f.weekStartsOn) ?? 0, o = gn(e), i = o.getDay(), l = (i < a ? 7 : 0) + i - a; return o.setDate(o.getDate() - l), o.setHours(0, 0, 0, 0), o; } function dl(e) { return Ja(e, { weekStartsOn: 1 }); } function my(e) { const t = gn(e), n = t.getFullYear(), a =