UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,470 lines 3.59 MB
var qk = Object.defineProperty; var Uk = (e, t, n) => t in e ? qk(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; var ee = (e, t, n) => Uk(e, typeof t != "symbol" ? t + "" : t, n); import { ref as C, computed as N, watch as Z, onUnmounted as Yt, inject as ce, defineComponent as ue, provide as Rt, renderSlot as Gk, createVNode as r, onMounted as xe, Fragment as ct, reactive as Nt, createApp as xl, Transition as Fr, mergeProps as Jt, toRef as Yk, isRef as gf, nextTick as rt, Teleport as To, withDirectives as Ht, vShow as $a, resolveComponent as ba, isVNode as Fn, onBeforeMount as Kn, watchEffect as ic, shallowRef as yi, render as Sd, h as _r, cloneVNode as Qk, createTextVNode as re, getCurrentInstance as lc, resolveDirective as Yn, withModifiers as Qt, onUpdated as rc, onBeforeUnmount as qa, vModelCheckbox as bi, vModelText as Ia, toRefs as Qo, Comment as cy, toRaw as Kk, compile as Xk, vModelSelect as Jk, onDeactivated as Zk, unref as mg, onActivated as eF, triggerRef as dy } from "vue"; import { isPlainObject as vg, cloneDeep as De, isUndefined as aa, debounce as so, isFunction as xd, mergeWith as Js, merge as ho, isNil as tF, isNaN as nF, flatten as fy, get as vi, trim as aF, isEmpty as oF, throttle as hf, findIndex as gg } from "lodash-es"; import zt from "bignumber.js"; import { createI18n as iF, useI18n as lF } from "vue-i18n"; import { useResizeObserver as Hr } from "@vueuse/core"; function py(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]) : De(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]) : De(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] && vg(m[g]) && vg(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 Mi = {}, pp = {}, { getSchemaByType: Va, resolveSchemaWithDefaultValue: rF, resolveSchemaToProps: my, mappingSchemaToProps: vy, setDesignerContext: sF } = py(Mi, pp); function uF(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 cF = { convertTo: (e, t, n, a) => { e.appearance || (e.appearance = {}), e.appearance[t] = n; }, convertFrom: (e, t, n) => e.appearance ? e.appearance[t] : e[t] }, dF = { convertFrom: (e, t, n) => e.buttons && e.buttons.length ? `共 ${e.buttons.length} 项` : "无" }, fF = { 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] }, Ce = { button: { type: "button", name: "按钮" }, "response-toolbar": { type: "response-toolbar", name: "工具栏" }, "response-toolbar-item": { type: "response-toolbar-item", name: "按钮" }, "content-container": { type: "content-container", name: "容器" }, table: { type: "table", name: "表格布局" }, "table-td": { type: "table-td", 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: "动态表单" } }, pF = { convertFrom: (e, t, n) => { var o; const a = e.editor && e.editor[t] ? e.editor[t] : e[t]; return ((o = Ce[a]) == null ? void 0 : o.name) || a; } }, mF = { convertTo: (e, t, n, a) => { e[t] = e[t]; }, convertFrom: (e, t, n) => e.editor ? n.getRealEditorType(e.editor.type) : "" }, vF = { 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"; } }, gF = { 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 ""; } }, hF = { convertTo: (e, t, n, a) => { if (e.column || (e.column = {}), t === "fitMode") { n && n !== "none" ? (e.column.fitColumns = !0, e.column.fitMode = n) : (e.column.fitColumns = !1, e.column.fitMode = "average"); return; } if (t === "fitColumns") { e.column.fitColumns = n, n && !e.column.fitMode && (e.column.fitMode = "average"); return; } e.column[t] = n; }, convertFrom: (e, t, n) => { if (e.column) { if (t === "fitMode") return e.column.fitColumns ? e.column.fitMode || "average" : "none"; if (t === "fitColumns") return e.column.fitColumns; } return t === "fitMode" ? "none" : ""; } }, yF = { 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 : ""; } }, bF = { 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; } } }, CF = { 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; } } }, wF = { convertTo: (e, t, n, a) => { if (e.pagination || (e.pagination = {}), t === "sizeLimits") if (n == null) delete e.pagination.sizeLimits; else { const o = [...new Set( String(n).split(",").map((i) => i.trim()).filter((i) => i !== "").map((i) => parseInt(i, 10)).filter((i) => !Number.isNaN(i) && i > 0) )]; o.length > 0 ? e.pagination.sizeLimits = o : delete e.pagination.sizeLimits; } else 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]; } }, SF = { convertTo: (e, t, n, a) => { e.rowNumber || (e.rowNumber = {}), e.rowNumber[t] = n; }, convertFrom: (e, t, n) => e.rowNumber ? e.rowNumber[t] : e[t] }, xF = { 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; } }, TF = { convertFrom: (e, t, n) => e[t] && e[t].length ? `共 ${e[t].length} 项` : "" }, kF = { convertFrom: (e, t) => e[t] || "", convertTo: (e, t, n) => { e[t] = n; } }, FF = { convertTo: (e, t, n, a) => { e.size || (e.size = {}), e.size[t] = n; }, convertFrom: (e, t, n) => e.size ? e.size[t] : e[t] }, IF = { 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; } }, PF = { 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); } }, MF = { 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; } }, EF = { 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 ""; } }, AF = { 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" : "" }, BF = { 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 gy(e, t, n) { const a = /* @__PURE__ */ new Map([ ["/converter/appearance.converter", cF], ["/converter/buttons.converter", dF], ["/converter/property-editor.converter", fF], ["/converter/items-count.converter", TF], ["/converter/type.converter", pF], ["/converter/change-editor.converter", mF], ["/converter/change-formatter.converter", vF], ["/converter/column-command.converter", gF], ["/converter/column-option.converter", hF], ["/converter/summary.converter", yF], ["/converter/group.converter", bF], ["/converter/form-group-label.converter", kF], ["/converter/field-selector.converter", CF], ["/converter/pagination.converter", wF], ["/converter/row-number.converter", SF], ["/converter/grid-selection.converter", xF], ["/converter/size.converter", FF], ["/converter/change-formatter-enum.converter", IF], ["/converter/grid-sort.converter", PF], ["/converter/grid-filter.converter", MF], ["/converter/row-option.converter", EF], ["/converter/change-formatter-type.converter", AF], ["/converter/tree-auto-check.converter", BF] ]), 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 = uF(); 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), T = 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 W = N({ get() { if (k.value) { if (["class", "style"].find((K) => K === T) && !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 G = h[F]; return Object.prototype.hasOwnProperty.call(I, "defaultValue") && (G === void 0 || typeof G == "string" && G === "") ? I.type === "boolean" ? I.defaultValue : I.defaultValue || "" : G; } return null; }, set(G) { k.value += 1, L && L.convertTo ? (L.convertTo(y, F, G, b, w), L.convertTo(h, F, G, b, w)) : (y[F] = G, h[F] = G); } }), { refreshPanelAfterChanged: $, description: _, isExpand: U, parentPropertyID: Y } = I, z = { propertyID: T, propertyName: A, propertyType: E, propertyValue: W, editor: B, visible: V, readonly: D, cascadeConfig: O, hideCascadeTitle: R, refreshPanelAfterChanged: $, description: _, isExpand: U, parentPropertyID: Y }; return g[T] = z, z; }); } function c(m, g, h = {}) { const y = {}, b = e[m]; return b && b.categories ? Object.keys(b.categories).map((S) => { const x = b.categories[S], F = x == null ? void 0 : x.title, k = f(x.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, x = h[w], F = x.type, k = n(x), T = {}, 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, T, k, x, 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), x = {}; let F = b || e[w]; if (!(F && Object.keys(F).length > 0) && h && h.getPropConfig && (F = h.getPropConfig(y)), F && F.categories) { const T = []; return Object.keys(F.categories).map((I) => { const P = F.categories[I]; if (P.$ref) { T.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 || {}, x, S, m, g, y, P.$converter), { setPropertyRelates: O } = P, R = P == null ? void 0 : P.parentPropertyID; T.push({ categoryId: I, categoryName: A, tabId: E, tabName: M, hide: B, properties: D, hideTitle: V, setPropertyRelates: O, parentPropertyID: R }); }), T; } return []; } return { getPropertyConfigBySchema: v, getPropertyConfigByType: c, propertyConverterMap: a }; } const mp = {}, vp = {}; gy(mp, vp, rF); const sc = {}, uc = {}, { getSchemaByType: Wr, resolveSchemaWithDefaultValue: VF, resolveSchemaToProps: gue, mappingSchemaToProps: hue, setDesignerContext: DF } = py(sc, uc), Tl = {}, zr = {}, { getPropertyConfigBySchema: Ls } = gy(Tl, zr, VF); function Ke(e, t, n = /* @__PURE__ */ new Map(), a = (l, s, u, d) => s, o = {}, i = (l) => l) { return Mi[t.title] = t, pp[t.title] = a, mp[t.title] = o, vp[t.title] = i, sc[t.title] = t, uc[t.title] = a, Tl[t.title] = o, zr[t.title] = i, (l = {}, s = !0) => { if (!s) return vy(l, n); const u = my(l, t, n), d = Object.keys(e).reduce((f, c) => (f[c] = e[c].default, f), {}); return Object.assign(d, u); }; } function OF(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 vn(e, t, n = /* @__PURE__ */ new Map(), a = (l, s, u, d) => s, o = {}, i = (l) => l) { return (l) => (OF(t, a, o, i, l), (s = {}, u = !0) => { if (!u) return vy(s, n); const d = my(s, t, n), f = Object.keys(e).reduce((c, p) => (c[p] = e[p].default, c), {}); return Object.assign(f, d); }); } function St(e, t) { return { customClass: t.class, customStyle: t.style }; } function hy(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 NF() { 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 yy() { 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 RF() { function e(t, n) { const { id: a } = t || {}, { dataSource: o } = t || {}; return o === void 0 ? {} : {}; } return { resolve: e }; } function yue() { function e(t, n) { const { path: a } = t.binding || {}; return a ? { "onUpdate:dataMapping": (...o) => { } } : {}; } return { resolve: e }; } function LF() { function e(t, n) { const { id: a } = t || {}, { dataSource: o } = t || {}; return o === void 0 ? {} : { events: n.getValue(a) }; } return { resolve: e }; } function $F() { function e(t, n) { const { id: a } = t || {}; return { dataId: n.getValue(a) }; } return { resolve: e }; } function jF() { 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 by() { return (e, t, n) => { if (!e || !e.emits) return {}; 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 _F() { function e(t, n) { return t.selectItemById(n); } return { selectItemById: e }; } function HF() { function e(t, n) { return t.selectItemById(n); } return { selectItemById: e }; } function Cy() { function e(t) { return t.editor; } return { resolve: e }; } function bue() { 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 Cue() { function e(t, n) { const { name: a } = n; return t[`on${a.charAt(0).toUpperCase()}${a.slice(1)}`] || t[a]; } return { resolve: e }; } function wy() { 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 WF() { 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 zF() { 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 qF() { 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 UF() { 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 GF() { 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 Sy() { function e(t, n) { const { columns: a } = n; return t.updateColumns(a); } return { updateColumns: e }; } const xy = /* @__PURE__ */ new Map([ ["appearance", St], ["size", (e, t) => { const n = {}; return t.width && (n.width = Number(t.width)), t.height && (n.height = Number(t.height)), n; }] ]), YF = "https://json-schema.org/draft/2020-12/schema", QF = "https://farris-design.gitee.io/accordion.schema.json", KF = "accordion", XF = "A Farris Container Component", JF = "object", ZF = { 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 } }, e1 = [ "id", "type", "contents" ], t1 = { $schema: YF, $id: QF, title: KF, description: XF, type: JF, properties: ZF, required: e1 }; function n1(e, t, n) { return t; } const a1 = "accordion", o1 = "A Farris Component", i1 = "object", l1 = { basic: { description: "Basic Infomation", title: "基本信息", properties: { id: { description: "组件标识", title: "标识", type: "string", readonly: !0 }, type: { description: "组件类型", title: "控件类型", type: "select", editor: { type: "waiting for modification", enum: [] } } } } }, r1 = { title: a1, description: o1, type: i1, categories: l1 }, gp = { /** * 组件自定义样式,多个时使用空格分隔,如'class1 class2' * @default '' */ customClass: { type: String, default: "" }, /** * 是否允许收折 * @default true */ enableFold: { type: Boolean, default: !0 }, /** * 是否展开所有面板 * @default false */ expanded: { type: Boolean, default: !1 }, /** * 设置组件的高度 */ height: { type: Number }, /** * 设置组件的宽度 */ width: { type: Number } }, Ty = Ke(gp, t1, xy, n1, r1); function ky(e) { const t = e.nativeElement ? e.nativeElement : e; return t.classList !== void 0 && t.classList !== null ? t : null; } function Fy(e, t) { if (t === void 0) return; const n = ky(e); n && n.classList.remove(t); } function yf(e, t) { if (t === void 0) return; const n = ky(e); n && n.classList.add(t); } const s1 = [ { 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 Iy(e) { e && e.resizeObserver && (e.resizeObserver.disconnect(), e.resizeObserver = null); } function Py(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++) Fy(t, "f-area-response--" + e.className[u]); else for (let u = e.className.length; u < a.length; u++) yf(t, "f-area-response--" + a[u]); e.className = [...a]; } } function u1(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 && (Py(e, t, a.width), e.width = parseInt(a.width + "")); }), e.resizeObserver.observe(t)) : Iy(e); } function hg(e, t) { if (e.enable) yf(t, "f-area-response"), Py(e, t); else { Fy(t, "f-area-response"); for (let n = e.className.length; n > 0; n--) yf(t, "f-area-response--" + e.className[n]); e.className = []; } u1(e, t); } function c1(e) { const t = []; return s1.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 yg(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 = c1(n)); } const pr = { // 在绑定元素的父组件 // 及他自己的所有子节点都挂载完成后调用 mounted: (e, t, n) => { n.sharedObject = { className: [], resizeObserver: null, enable: !0, autoWidth: !0, threshold: 10, width: 0, breakPoints: [] }, yg(n.sharedObject, t, e), hg(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: [] }, yg(n.sharedObject, t, e), hg(n.sharedObject, e); }, // 绑定元素的父组件卸载前调用 beforeUnmount(e, t, n) { n.sharedObject && Iy(n.sharedObject); } }, d1 = { 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 My(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(($, _) => ($[_] = !0, $), L), L; }), x = (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 T = C(k()); function I(L, W = !0) { n.value = x(L), a.value !== n.value && (a.value = n.value), W && (t.emit("change", n.value), t.emit("update:modelValue", n.value), t.emit("update:value", n.value)); } Z( () => e.modelValue, (L, W) => { if (L === W) return; const $ = x(L); I($, !($ === L)); }, { immediate: !0 } ), Z(() => e.disabled, (L, W) => { L !== W && (i.value = L); }), Z(() => e.showType, (L) => { L && (T.value = L); }), Z(() => e.type, (L) => { T.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 W = L.target.value; a.value = W, d.value === "change" && (t.emit("update:modelValue", W), t.emit("update:value", W), t.emit("change", W)); } function B(L) { t.emit("keydown", L); } function V(L) { t.emit("keyup", L); } function D(L) { const W = L.target; W.tagName !== "INPUT" && W.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 W = L.target.value; L.stopPropagation(), I(W); } } return { changeTextBoxValue: I, disabled: i, displayText: a, editable: p, hasFocused: v, inputGroupClass: S, inputType: T, 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 f1(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, x = !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 Ey(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); Z(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, T; c.value = !0; const S = ((k = w.target.querySelector("input")) == null ? void 0 : k.value) || "", x = ((T = w.target.querySelector("textarea")) == null ? void 0 : T.value) || "", F = S || x; 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 p1 = { jan: 1, feb: 2, mar: 3, apr: 4, may: 5, jun: 6, jul: 7, aug: 8, sep: 9, oct: 10, nov: 11, dec: 12 }, m1 = { sun: 0, mon: 1, tue: 2, wed: 3, thu: 4, fri: 5, sat: 6 }; class Ay { 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 p1[String(t).slice(0, 3).toLowerCase()]; } getWeekdayByName(t) { return m1[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 mn(e) { const t = Object.prototype.toString.call(e); return e instanceof Date || typeof e == "object" && t === "[object Date]" ? new e.constr