UNPKG

@farris/ui-vue

Version:

Farris Vue, a Farris Design based Vue3 component library.

1,807 lines (1,806 loc) 436 kB
var rr = Object.defineProperty; var ir = (n, t, e) => t in n ? rr(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e; var I = (n, t, e) => ir(n, typeof t != "symbol" ? t + "" : t, e); import { ref as b, defineComponent as Qe, watch as be, computed as L, onMounted as gt, createVNode as M, createTextVNode as vt, mergeProps as _t, Teleport as Jn, createApp as Mn, onUnmounted as en, Fragment as zt, nextTick as Wt, onBeforeMount as ar, Transition as Zn, shallowRef as sr, render as hn, h as lr, cloneVNode as ur, inject as xt, withDirectives as eo, vShow as cr, onBeforeUnmount as En, reactive as Ct, resolveDirective as dr, provide as fr, triggerRef as pr, isVNode as mr, resolveComponent as hr } from "vue"; import { isPlainObject as Rn, cloneDeep as Ot, isUndefined as ct, throttle as vr } from "lodash-es"; import gr from "../button-edit/index.esm.js"; import { useReqAnimationFrame as yr, withInstall as to, useGuid as br, resolveField as it, FormSchemaEntityFieldTypeName as Ln, useCommonUtils as wr, useDateFormat as Cr, useNumberFormat as xr, setFieldValue as bn, getCustomClass as vn, FormSchemaEntityField$Type as Wn, FormSchemaEntityFieldType$Type as _r } from "../common/index.esm.js"; import no from "../tags/index.esm.js"; import Sr from "../popover/index.esm.js"; import { DgControl as $n } from "../designer-canvas/index.esm.js"; import { useResizeObserver as oo } from "@vueuse/core"; import { useIdentify as Tr, useGroupData as kr, useFilter as Mr, useHierarchy as Er, useLoading as Fr, useDataView as Or, useSelection as Ir, useSelectHierarchyItem as Vr, useDataViewContainerStyle as Pr, useCommandColumn as Dr, useColumn as Br, useSort as Hr, useGroupColumn as Nr, useRow as Rr, useEdit as Lr, useVisualDataBound as Wr, useVisualDataCell as $r, useVisualDataRow as jr, useVisualData as Ar, useCellPosition as qr, useSidebar as Gr, useVirtualScroll as zr, useFitColumn as Yr, useFilterHistory as Ur, useColumnFilter as Xr, useDragColumn as Qr, getColumnHeader as Kr, getSidebar as Jr, getDisableMask as Zr, getHorizontalScrollbar as ei, getVerticalScrollbar as ti, getEmpty as ni } from "../data-view/index.esm.js"; import "../modal/index.esm.js"; import oi from "../transfer/index.esm.js"; import ri from "../tabs/index.esm.js"; import ii from "../order/index.esm.js"; import "../condition/index.esm.js"; import { FCheckbox as ai } from "../checkbox/index.esm.js"; import si from "../filter-bar/index.esm.js"; import jn from "../tooltip/index.esm.js"; import li from "../pagination/index.esm.js"; import ui from "../button/index.esm.js"; import ci from "../search-box/index.esm.js"; import di, { FDynamicFormGroup as fi, FDynamicFormInput as pi } from "../dynamic-form/index.esm.js"; import { createPropsResolver as mi } from "../dynamic-resolver/index.esm.js"; import "../property-panel/index.esm.js"; import hi from "../accordion/index.esm.js"; import vi from "../avatar/index.esm.js"; import gi from "../../designer/button-edit/index.esm.js"; import yi from "../button-group/index.esm.js"; import bi from "../calendar/index.esm.js"; import wi from "../capsule/index.esm.js"; import An from "../../designer/checkbox/index.esm.js"; import qn from "../../designer/checkbox-group/index.esm.js"; import wn from "../combo-list/index.esm.js"; import Ci from "../combo-tree/index.esm.js"; import xi from "../component/index.esm.js"; import _i from "../color-picker/index.esm.js"; import Si from "../content-container/index.esm.js"; import Ti from "../date-picker/index.esm.js"; import ki from "../../designer/data-grid/index.esm.js"; import Mi from "../dropdown/index.esm.js"; import Ei from "../events-editor/index.esm.js"; import Fi from "../field-selector/index.esm.js"; import Oi from "../binding-selector/index.esm.js"; import Ii from "../image-cropper/index.esm.js"; import Vi from "../../designer/input-group/index.esm.js"; import Pi from "../layout/index.esm.js"; import Di from "../list-nav/index.esm.js"; import Bi from "../list-view/index.esm.js"; import Hi from "../lookup/index.esm.js"; import Ni from "../mapping-editor/index.esm.js"; import Ri from "../nav/index.esm.js"; import Li from "../number-range/index.esm.js"; import Wi from "../number-spinner/index.esm.js"; import $i from "../page-header/index.esm.js"; import ji from "../page-footer/index.esm.js"; import Ai from "../progress/index.esm.js"; import qi from "../query-solution/index.esm.js"; import Gi from "../../designer/radio-group/index.esm.js"; import zi from "../rate/index.esm.js"; import Yi from "../response-toolbar/index.esm.js"; import Ui from "../response-layout/index.esm.js"; import Xi from "../response-layout-editor/index.esm.js"; import Qi from "../section/index.esm.js"; import Ki from "../smoke-detector/index.esm.js"; import Ji from "../splitter/index.esm.js"; import Zi from "../step/index.esm.js"; import ea from "../switch/index.esm.js"; import ta from "../text/index.esm.js"; import na from "../time-picker/index.esm.js"; import oa from "../tree-view/index.esm.js"; import ra from "../uploader/index.esm.js"; import ia from "../verify-detail/index.esm.js"; import aa from "../video/index.esm.js"; import sa from "../textarea/index.esm.js"; import la from "../schema-selector/index.esm.js"; import ua from "../tree-grid/index.esm.js"; import ca from "../event-parameter/index.esm.js"; import da from "../filter-condition-editor/index.esm.js"; import fa from "../fieldset/index.esm.js"; import pa from "../sort-condition-editor/index.esm.js"; import ma from "../menu-lookup/index.esm.js"; import ha from "../drawer/index.esm.js"; import va from "../json-editor/index.esm.js"; import ga from "../property-editor/index.esm.js"; import ya from "../expression-editor/index.esm.js"; import ba from "../code-editor/index.esm.js"; import wa from "../html-template/index.esm.js"; import "../external-container/index.esm.js"; import "../notify/index.esm.js"; const ro = {}, io = {}; function Fn(n) { const { properties: t, title: e, ignore: o } = n, r = o && Array.isArray(o), i = Object.keys(t).reduce((a, s) => ((!r || !o.find((u) => u === s)) && (a[s] = t[s].type === "object" && t[s].properties ? Fn(t[s]) : Ot(t[s].default)), a), {}); if (e && (!r || !o.find((a) => a === "id"))) { const a = e.toLowerCase().replace(/-/g, "_"); i.id = `${a}_${Math.random().toString().slice(2, 6)}`; } return i; } function Ca(n) { const { properties: t, title: e, required: o } = n; if (o && Array.isArray(o)) { const r = o.reduce((i, a) => (i[a] = t[a].type === "object" && t[a].properties ? Fn(t[a]) : Ot(t[a].default), i), {}); if (e && o.find((i) => i === "id")) { const i = e.toLowerCase().replace(/-/g, "_"); r.id = `${i}_${Math.random().toString().slice(2, 6)}`; } return r; } return { type: e }; } function ao(n, t = {}, e) { const o = ro[n]; if (o) { let r = Ca(o); const i = io[n]; return r = i ? i({ getSchemaByType: ao }, r, t, e) : r, r; } return null; } function xa(n, t) { const e = Fn(t); return Object.keys(e).reduce((o, r) => (Object.prototype.hasOwnProperty.call(n, r) && (o[r] && Rn(o[r]) && Rn(n[r] || !n[r]) ? Object.assign(o[r], n[r] || {}) : o[r] = n[r]), o), e), e; } function so(n, t) { return Object.keys(n).filter((o) => n[o] != null).reduce((o, r) => { if (t.has(r)) { const i = t.get(r); if (typeof i == "string") o[i] = n[r]; else { const a = i(r, n[r], n); Object.assign(o, a); } } else o[r] = n[r]; return o; }, {}); } function _a(n, t, e = /* @__PURE__ */ new Map()) { const o = xa(n, t); return so(o, e); } function Sa(n = {}) { function t(d, c, l, f) { if (typeof l == "number") return f[d].length === l; if (typeof l == "object") { const p = Object.keys(l)[0], m = l[p]; if (p === "not") return Number(f[d].length) !== Number(m); if (p === "moreThan") return Number(f[d].length) >= Number(m); if (p === "lessThan") return Number(f[d].length) <= Number(m); } return !1; } function e(d, c, l, f) { return f[d] && f[d].propertyValue && String(f[d].propertyValue.value) === String(l); } const o = /* @__PURE__ */ new Map([ ["length", t], ["getProperty", e] ]); Object.keys(n).reduce((d, c) => (d.set(c, n[c]), d), o); function r(d, c) { const l = d; return typeof c == "number" ? [{ target: l, operator: "length", param: null, value: Number(c) }] : typeof c == "boolean" ? [{ target: l, operator: "getProperty", param: d, value: !!c }] : typeof c == "object" ? Object.keys(c).map((f) => { if (f === "length") return { target: l, operator: "length", param: null, value: c[f] }; const p = f, m = c[f]; return { target: l, operator: "getProperty", param: p, value: m }; }) : []; } function i(d) { return Object.keys(d).reduce((l, f) => { const p = r(f, d[f]); return l.push(...p), l; }, []); } function a(d, c) { if (o.has(d.operator)) { const l = o.get(d.operator); return l && l(d.target, d.param, d.value, c) || !1; } return !1; } function s(d, c) { return i(d).reduce((p, m) => p && a(m, c), !0); } function u(d, c) { const l = Object.keys(d), f = l.includes("allOf"), p = l.includes("anyOf"), m = f || p, g = (m ? d[m ? f ? "allOf" : "anyOf" : "allOf"] : [d]).map((y) => s(y, c)); return f ? !g.includes(!1) : g.includes(!0); } return { parseValueSchema: u }; } const fe = { 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: "标签页工具栏按钮" }, "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: "标签页工具栏" }, 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: "列表导航" }, "filter-bar": { type: "filter-bar", name: "筛选条" } }, Ta = {}, ka = {}; Sa(); function jt(n, t, e = /* @__PURE__ */ new Map(), o = (a, s, u, d) => s, r = {}, i = (a) => a) { return ro[t.title] = t, io[t.title] = o, Ta[t.title] = r, ka[t.title] = i, (a = {}, s = !0) => { if (!s) return so(a, e); const u = _a(a, t, e), d = Object.keys(n).reduce((c, l) => (c[l] = n[l].default, c), {}); return Object.assign(d, u); }; } function mn(n, t) { return { customClass: t.class, customStyle: t.style }; } function Ma() { function n(t, e) { const { dataSource: o } = t || {}; return o === void 0 ? {} : {}; } return { resolve: n }; } function Ea() { function n(t, e) { return t.selectItemById(e); } return { selectItemById: n }; } function Fa() { function n(t, e) { const { columns: o } = e; return t.updateColumns(o); } return { updateColumns: n }; } const Oa = /* @__PURE__ */ new Map([ ["appearance", mn] ]), Ia = "https://json-schema.org/draft/2020-12/schema", Va = "https://farris-design.gitee.io/time-picker.schema.json", Pa = "time-picker", Da = "A Farris Input Component", Ba = "object", Ha = { id: { description: "The unique identifier for a time picker", type: "string" }, type: { description: "The type string of time picker component", type: "string", default: "time-picker" }, appearance: { description: "", type: "object", properties: { class: { type: "string" }, style: { type: "string" } }, default: {} }, binding: { description: "", type: "object", default: {} }, disabled: { type: "string", default: !1 }, editable: { description: "", type: "boolean", default: !0 }, placeholder: { description: "", type: "string", default: "" }, readonly: { description: "", type: "boolean", default: !1 }, required: { description: "", type: "boolean", default: !1 }, tabindex: { description: "", type: "number", default: -1 }, visible: { description: "", type: "boolean", default: !0 }, format: { description: "", type: "enum", default: "HH:mm:ss" }, showHeader: { description: "", type: "boolean", default: !1 }, use12Hours: { description: "", type: "boolean", default: !1 }, hourStep: { description: "", type: "number", default: 1 }, minuteStep: { description: "", type: "number", default: 1 }, secondStep: { description: "", type: "number", default: 1 } }, Na = [ "type" ], Ra = [ "id", "appearance", "binding", "visible" ], La = { $schema: Ia, $id: Va, title: Pa, description: Da, type: Ba, properties: Ha, required: Na, ignore: Ra }; function Wa(n, t, e) { return t; } const On = { /** * 组件值,这个是与指定的format格式相对应的值 */ modelValue: { type: String, default: "" }, hourStep: { type: Number, default: 1 }, minuteStep: { type: Number, default: 1 }, secondStep: { type: Number, default: 1 }, popupClassName: { type: String, default: "" }, placeholder: { type: String, default: "请选择时间" }, placement: { type: String, default: "auto" }, /** * 默认时间控件下拉面板,展开时的值 */ defaultOpenValue: { type: Date, default: null }, format: { type: String, default: "HH:mm:ss" }, isOpen: { type: Boolean, default: !1 }, showHeader: { type: Boolean, default: !1 }, use12Hours: { type: Boolean, default: !1 }, disabledHours: { type: Function, default: null }, disabledMinutes: { type: Function, default: null }, disabledSeconds: { type: Function, default: null }, /** * 是否隐藏禁用的元素 */ hideDisabledElements: { type: Boolean, default: !1 }, disabled: { type: Boolean, default: !1 }, readonly: { type: Boolean, default: !1 }, editable: { type: Boolean, default: !0 } }, lo = jt(On, La, Oa, Wa), $a = { modelValue: { type: String, default: "" }, hourStep: { type: Number, default: 1 }, minuteStep: { type: Number, default: 1 }, secondStep: { type: Number, default: 1 }, defaultOpenValue: { type: Date, default: null }, disabledHours: { type: Function, default: null }, disabledMinutes: { type: Function, default: null }, disabledSeconds: { type: Function, default: null }, format: { type: String, default: "HH:mm:ss" }, isOpen: { type: Boolean, default: !1 }, use12Hours: { type: Boolean, default: !1 }, showHeader: { type: Boolean, default: !1 }, hideDisabledElements: { type: Boolean, default: !1 } }; function Ue(n) { const t = Object.prototype.toString.call(n); return n instanceof Date || typeof n == "object" && t === "[object Date]" ? new n.constructor(+n) : typeof n == "number" || t === "[object Number]" || typeof n == "string" || t === "[object String]" ? new Date(n) : /* @__PURE__ */ new Date(NaN); } function $e(n, t) { return n instanceof Date ? new n.constructor(t) : new Date(t); } function uo(n, t) { const e = Ue(n); return isNaN(t) ? $e(n, NaN) : (t && e.setDate(e.getDate() + t), e); } const co = 6048e5, ja = 864e5, Aa = 6e4, qa = 36e5, Ga = 1e3; let za = {}; function Ut() { return za; } function It(n, t) { var s, u, d, c; const e = Ut(), o = (t == null ? void 0 : t.weekStartsOn) ?? ((u = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : u.weekStartsOn) ?? e.weekStartsOn ?? ((c = (d = e.locale) == null ? void 0 : d.options) == null ? void 0 : c.weekStartsOn) ?? 0, r = Ue(n), i = r.getDay(), a = (i < o ? 7 : 0) + i - o; return r.setDate(r.getDate() - a), r.setHours(0, 0, 0, 0), r; } function Yt(n) { return It(n, { weekStartsOn: 1 }); } function fo(n) { const t = Ue(n), e = t.getFullYear(), o = $e(n, 0); o.setFullYear(e + 1, 0, 4), o.setHours(0, 0, 0, 0); const r = Yt(o), i = $e(n, 0); i.setFullYear(e, 0, 4), i.setHours(0, 0, 0, 0); const a = Yt(i); return t.getTime() >= r.getTime() ? e + 1 : t.getTime() >= a.getTime() ? e : e - 1; } function Gn(n) { const t = Ue(n); return t.setHours(0, 0, 0, 0), t; } function an(n) { const t = Ue(n), e = new Date( Date.UTC( t.getFullYear(), t.getMonth(), t.getDate(), t.getHours(), t.getMinutes(), t.getSeconds(), t.getMilliseconds() ) ); return e.setUTCFullYear(t.getFullYear()), +n - +e; } function Ya(n, t) { const e = Gn(n), o = Gn(t), r = +e - an(e), i = +o - an(o); return Math.round((r - i) / ja); } function Ua(n) { const t = fo(n), e = $e(n, 0); return e.setFullYear(t, 0, 4), e.setHours(0, 0, 0, 0), Yt(e); } function Xa(n) { return n instanceof Date || typeof n == "object" && Object.prototype.toString.call(n) === "[object Date]"; } function po(n) { if (!Xa(n) && typeof n != "number") return !1; const t = Ue(n); return !isNaN(Number(t)); } function Qa(n) { const t = Ue(n), e = $e(n, 0); return e.setFullYear(t.getFullYear(), 0, 1), e.setHours(0, 0, 0, 0), e; } const Ka = { lessThanXSeconds: { one: "less than a second", other: "less than {{count}} seconds" }, xSeconds: { one: "1 second", other: "{{count}} seconds" }, halfAMinute: "half a minute", lessThanXMinutes: { one: "less than a minute", other: "less than {{count}} minutes" }, xMinutes: { one: "1 minute", other: "{{count}} minutes" }, aboutXHours: { one: "about 1 hour", other: "about {{count}} hours" }, xHours: { one: "1 hour", other: "{{count}} hours" }, xDays: { one: "1 day", other: "{{count}} days" }, aboutXWeeks: { one: "about 1 week", other: "about {{count}} weeks" }, xWeeks: { one: "1 week", other: "{{count}} weeks" }, aboutXMonths: { one: "about 1 month", other: "about {{count}} months" }, xMonths: { one: "1 month", other: "{{count}} months" }, aboutXYears: { one: "about 1 year", other: "about {{count}} years" }, xYears: { one: "1 year", other: "{{count}} years" }, overXYears: { one: "over 1 year", other: "over {{count}} years" }, almostXYears: { one: "almost 1 year", other: "almost {{count}} years" } }, Ja = (n, t, e) => { let o; const r = Ka[n]; return typeof r == "string" ? o = r : t === 1 ? o = r.one : o = r.other.replace("{{count}}", t.toString()), e != null && e.addSuffix ? e.comparison && e.comparison > 0 ? "in " + o : o + " ago" : o; }; function gn(n) { return (t = {}) => { const e = t.width ? String(t.width) : n.defaultWidth; return n.formats[e] || n.formats[n.defaultWidth]; }; } const Za = { full: "EEEE, MMMM do, y", long: "MMMM do, y", medium: "MMM d, y", short: "MM/dd/yyyy" }, es = { full: "h:mm:ss a zzzz", long: "h:mm:ss a z", medium: "h:mm:ss a", short: "h:mm a" }, ts = { full: "{{date}} 'at' {{time}}", long: "{{date}} 'at' {{time}}", medium: "{{date}}, {{time}}", short: "{{date}}, {{time}}" }, ns = { date: gn({ formats: Za, defaultWidth: "full" }), time: gn({ formats: es, defaultWidth: "full" }), dateTime: gn({ formats: ts, defaultWidth: "full" }) }, os = { lastWeek: "'last' eeee 'at' p", yesterday: "'yesterday at' p", today: "'today at' p", tomorrow: "'tomorrow at' p", nextWeek: "eeee 'at' p", other: "P" }, rs = (n, t, e, o) => os[n]; function Xt(n) { return (t, e) => { const o = e != null && e.context ? String(e.context) : "standalone"; let r; if (o === "formatting" && n.formattingValues) { const a = n.defaultFormattingWidth || n.defaultWidth, s = e != null && e.width ? String(e.width) : a; r = n.formattingValues[s] || n.formattingValues[a]; } else { const a = n.defaultWidth, s = e != null && e.width ? String(e.width) : n.defaultWidth; r = n.values[s] || n.values[a]; } const i = n.argumentCallback ? n.argumentCallback(t) : t; return r[i]; }; } const is = { narrow: ["B", "A"], abbreviated: ["BC", "AD"], wide: ["Before Christ", "Anno Domini"] }, as = { narrow: ["1", "2", "3", "4"], abbreviated: ["Q1", "Q2", "Q3", "Q4"], wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"] }, ss = { narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"], abbreviated: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], wide: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ] }, ls = { narrow: ["S", "M", "T", "W", "T", "F", "S"], short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], wide: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ] }, us = { narrow: { am: "a", pm: "p", midnight: "mi", noon: "n", morning: "morning", afternoon: "afternoon", evening: "evening", night: "night" }, abbreviated: { am: "AM", pm: "PM", midnight: "midnight", noon: "noon", morning: "morning", afternoon: "afternoon", evening: "evening", night: "night" }, wide: { am: "a.m.", pm: "p.m.", midnight: "midnight", noon: "noon", morning: "morning", afternoon: "afternoon", evening: "evening", night: "night" } }, cs = { narrow: { am: "a", pm: "p", midnight: "mi", noon: "n", morning: "in the morning", afternoon: "in the afternoon", evening: "in the evening", night: "at night" }, abbreviated: { am: "AM", pm: "PM", midnight: "midnight", noon: "noon", morning: "in the morning", afternoon: "in the afternoon", evening: "in the evening", night: "at night" }, wide: { am: "a.m.", pm: "p.m.", midnight: "midnight", noon: "noon", morning: "in the morning", afternoon: "in the afternoon", evening: "in the evening", night: "at night" } }, ds = (n, t) => { const e = Number(n), o = e % 100; if (o > 20 || o < 10) switch (o % 10) { case 1: return e + "st"; case 2: return e + "nd"; case 3: return e + "rd"; } return e + "th"; }, fs = { ordinalNumber: ds, era: Xt({ values: is, defaultWidth: "wide" }), quarter: Xt({ values: as, defaultWidth: "wide", argumentCallback: (n) => n - 1 }), month: Xt({ values: ss, defaultWidth: "wide" }), day: Xt({ values: ls, defaultWidth: "wide" }), dayPeriod: Xt({ values: us, defaultWidth: "wide", formattingValues: cs, defaultFormattingWidth: "wide" }) }; function Qt(n) { return (t, e = {}) => { const o = e.width, r = o && n.matchPatterns[o] || n.matchPatterns[n.defaultMatchWidth], i = t.match(r); if (!i) return null; const a = i[0], s = o && n.parsePatterns[o] || n.parsePatterns[n.defaultParseWidth], u = Array.isArray(s) ? ms(s, (l) => l.test(a)) : ( // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type ps(s, (l) => l.test(a)) ); let d; d = n.valueCallback ? n.valueCallback(u) : u, d = e.valueCallback ? ( // eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type e.valueCallback(d) ) : d; const c = t.slice(a.length); return { value: d, rest: c }; }; } function ps(n, t) { for (const e in n) if (Object.prototype.hasOwnProperty.call(n, e) && t(n[e])) return e; } function ms(n, t) { for (let e = 0; e < n.length; e++) if (t(n[e])) return e; } function hs(n) { return (t, e = {}) => { const o = t.match(n.matchPattern); if (!o) return null; const r = o[0], i = t.match(n.parsePattern); if (!i) return null; let a = n.valueCallback ? n.valueCallback(i[0]) : i[0]; a = e.valueCallback ? e.valueCallback(a) : a; const s = t.slice(r.length); return { value: a, rest: s }; }; } const vs = /^(\d+)(th|st|nd|rd)?/i, gs = /\d+/i, ys = { narrow: /^(b|a)/i, abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i, wide: /^(before christ|before common era|anno domini|common era)/i }, bs = { any: [/^b/i, /^(a|c)/i] }, ws = { narrow: /^[1234]/i, abbreviated: /^q[1234]/i, wide: /^[1234](th|st|nd|rd)? quarter/i }, Cs = { any: [/1/i, /2/i, /3/i, /4/i] }, xs = { narrow: /^[jfmasond]/i, abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i, wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i }, _s = { narrow: [ /^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i ], any: [ /^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i ] }, Ss = { narrow: /^[smtwf]/i, short: /^(su|mo|tu|we|th|fr|sa)/i, abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i, wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i }, Ts = { narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i], any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i] }, ks = { narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i, any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i }, Ms = { any: { am: /^a/i, pm: /^p/i, midnight: /^mi/i, noon: /^no/i, morning: /morning/i, afternoon: /afternoon/i, evening: /evening/i, night: /night/i } }, Es = { ordinalNumber: hs({ matchPattern: vs, parsePattern: gs, valueCallback: (n) => parseInt(n, 10) }), era: Qt({ matchPatterns: ys, defaultMatchWidth: "wide", parsePatterns: bs, defaultParseWidth: "any" }), quarter: Qt({ matchPatterns: ws, defaultMatchWidth: "wide", parsePatterns: Cs, defaultParseWidth: "any", valueCallback: (n) => n + 1 }), month: Qt({ matchPatterns: xs, defaultMatchWidth: "wide", parsePatterns: _s, defaultParseWidth: "any" }), day: Qt({ matchPatterns: Ss, defaultMatchWidth: "wide", parsePatterns: Ts, defaultParseWidth: "any" }), dayPeriod: Qt({ matchPatterns: ks, defaultMatchWidth: "any", parsePatterns: Ms, defaultParseWidth: "any" }) }, mo = { code: "en-US", formatDistance: Ja, formatLong: ns, formatRelative: rs, localize: fs, match: Es, options: { weekStartsOn: 0, firstWeekContainsDate: 1 } }; function Fs(n) { const t = Ue(n); return Ya(t, Qa(t)) + 1; } function ho(n) { const t = Ue(n), e = +Yt(t) - +Ua(t); return Math.round(e / co) + 1; } function In(n, t) { var c, l, f, p; const e = Ue(n), o = e.getFullYear(), r = Ut(), i = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((l = (c = t == null ? void 0 : t.locale) == null ? void 0 : c.options) == null ? void 0 : l.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((p = (f = r.locale) == null ? void 0 : f.options) == null ? void 0 : p.firstWeekContainsDate) ?? 1, a = $e(n, 0); a.setFullYear(o + 1, 0, i), a.setHours(0, 0, 0, 0); const s = It(a, t), u = $e(n, 0); u.setFullYear(o, 0, i), u.setHours(0, 0, 0, 0); const d = It(u, t); return e.getTime() >= s.getTime() ? o + 1 : e.getTime() >= d.getTime() ? o : o - 1; } function Os(n, t) { var s, u, d, c; const e = Ut(), o = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((u = (s = t == null ? void 0 : t.locale) == null ? void 0 : s.options) == null ? void 0 : u.firstWeekContainsDate) ?? e.firstWeekContainsDate ?? ((c = (d = e.locale) == null ? void 0 : d.options) == null ? void 0 : c.firstWeekContainsDate) ?? 1, r = In(n, t), i = $e(n, 0); return i.setFullYear(r, 0, o), i.setHours(0, 0, 0, 0), It(i, t); } function vo(n, t) { const e = Ue(n), o = +It(e, t) - +Os(e, t); return Math.round(o / co) + 1; } function Oe(n, t) { const e = n < 0 ? "-" : "", o = Math.abs(n).toString().padStart(t, "0"); return e + o; } const Mt = { // Year y(n, t) { const e = n.getFullYear(), o = e > 0 ? e : 1 - e; return Oe(t === "yy" ? o % 100 : o, t.length); }, // Month M(n, t) { const e = n.getMonth(); return t === "M" ? String(e + 1) : Oe(e + 1, 2); }, // Day of the month d(n, t) { return Oe(n.getDate(), t.length); }, // AM or PM a(n, t) { const e = n.getHours() / 12 >= 1 ? "pm" : "am"; switch (t) { case "a": case "aa": return e.toUpperCase(); case "aaa": return e; case "aaaaa": return e[0]; case "aaaa": default: return e === "am" ? "a.m." : "p.m."; } }, // Hour [1-12] h(n, t) { return Oe(n.getHours() % 12 || 12, t.length); }, // Hour [0-23] H(n, t) { return Oe(n.getHours(), t.length); }, // Minute m(n, t) { return Oe(n.getMinutes(), t.length); }, // Second s(n, t) { return Oe(n.getSeconds(), t.length); }, // Fraction of second S(n, t) { const e = t.length, o = n.getMilliseconds(), r = Math.trunc( o * Math.pow(10, e - 3) ); return Oe(r, t.length); } }, At = { am: "am", pm: "pm", midnight: "midnight", noon: "noon", morning: "morning", afternoon: "afternoon", evening: "evening", night: "night" }, zn = { // Era G: function(n, t, e) { const o = n.getFullYear() > 0 ? 1 : 0; switch (t) { case "G": case "GG": case "GGG": return e.era(o, { width: "abbreviated" }); case "GGGGG": return e.era(o, { width: "narrow" }); case "GGGG": default: return e.era(o, { width: "wide" }); } }, // Year y: function(n, t, e) { if (t === "yo") { const o = n.getFullYear(), r = o > 0 ? o : 1 - o; return e.ordinalNumber(r, { unit: "year" }); } return Mt.y(n, t); }, // Local week-numbering year Y: function(n, t, e, o) { const r = In(n, o), i = r > 0 ? r : 1 - r; if (t === "YY") { const a = i % 100; return Oe(a, 2); } return t === "Yo" ? e.ordinalNumber(i, { unit: "year" }) : Oe(i, t.length); }, // ISO week-numbering year R: function(n, t) { const e = fo(n); return Oe(e, t.length); }, // Extended year. This is a single number designating the year of this calendar system. // The main difference between `y` and `u` localizers are B.C. years: // | Year | `y` | `u` | // |------|-----|-----| // | AC 1 | 1 | 1 | // | BC 1 | 1 | 0 | // | BC 2 | 2 | -1 | // Also `yy` always returns the last two digits of a year, // while `uu` pads single digit years to 2 characters and returns other years unchanged. u: function(n, t) { const e = n.getFullYear(); return Oe(e, t.length); }, // Quarter Q: function(n, t, e) { const o = Math.ceil((n.getMonth() + 1) / 3); switch (t) { case "Q": return String(o); case "QQ": return Oe(o, 2); case "Qo": return e.ordinalNumber(o, { unit: "quarter" }); case "QQQ": return e.quarter(o, { width: "abbreviated", context: "formatting" }); case "QQQQQ": return e.quarter(o, { width: "narrow", context: "formatting" }); case "QQQQ": default: return e.quarter(o, { width: "wide", context: "formatting" }); } }, // Stand-alone quarter q: function(n, t, e) { const o = Math.ceil((n.getMonth() + 1) / 3); switch (t) { case "q": return String(o); case "qq": return Oe(o, 2); case "qo": return e.ordinalNumber(o, { unit: "quarter" }); case "qqq": return e.quarter(o, { width: "abbreviated", context: "standalone" }); case "qqqqq": return e.quarter(o, { width: "narrow", context: "standalone" }); case "qqqq": default: return e.quarter(o, { width: "wide", context: "standalone" }); } }, // Month M: function(n, t, e) { const o = n.getMonth(); switch (t) { case "M": case "MM": return Mt.M(n, t); case "Mo": return e.ordinalNumber(o + 1, { unit: "month" }); case "MMM": return e.month(o, { width: "abbreviated", context: "formatting" }); case "MMMMM": return e.month(o, { width: "narrow", context: "formatting" }); case "MMMM": default: return e.month(o, { width: "wide", context: "formatting" }); } }, // Stand-alone month L: function(n, t, e) { const o = n.getMonth(); switch (t) { case "L": return String(o + 1); case "LL": return Oe(o + 1, 2); case "Lo": return e.ordinalNumber(o + 1, { unit: "month" }); case "LLL": return e.month(o, { width: "abbreviated", context: "standalone" }); case "LLLLL": return e.month(o, { width: "narrow", context: "standalone" }); case "LLLL": default: return e.month(o, { width: "wide", context: "standalone" }); } }, // Local week of year w: function(n, t, e, o) { const r = vo(n, o); return t === "wo" ? e.ordinalNumber(r, { unit: "week" }) : Oe(r, t.length); }, // ISO week of year I: function(n, t, e) { const o = ho(n); return t === "Io" ? e.ordinalNumber(o, { unit: "week" }) : Oe(o, t.length); }, // Day of the month d: function(n, t, e) { return t === "do" ? e.ordinalNumber(n.getDate(), { unit: "date" }) : Mt.d(n, t); }, // Day of year D: function(n, t, e) { const o = Fs(n); return t === "Do" ? e.ordinalNumber(o, { unit: "dayOfYear" }) : Oe(o, t.length); }, // Day of week E: function(n, t, e) { const o = n.getDay(); switch (t) { case "E": case "EE": case "EEE": return e.day(o, { width: "abbreviated", context: "formatting" }); case "EEEEE": return e.day(o, { width: "narrow", context: "formatting" }); case "EEEEEE": return e.day(o, { width: "short", context: "formatting" }); case "EEEE": default: return e.day(o, { width: "wide", context: "formatting" }); } }, // Local day of week e: function(n, t, e, o) { const r = n.getDay(), i = (r - o.weekStartsOn + 8) % 7 || 7; switch (t) { case "e": return String(i); case "ee": return Oe(i, 2); case "eo": return e.ordinalNumber(i, { unit: "day" }); case "eee": return e.day(r, { width: "abbreviated", context: "formatting" }); case "eeeee": return e.day(r, { width: "narrow", context: "formatting" }); case "eeeeee": return e.day(r, { width: "short", context: "formatting" }); case "eeee": default: return e.day(r, { width: "wide", context: "formatting" }); } }, // Stand-alone local day of week c: function(n, t, e, o) { const r = n.getDay(), i = (r - o.weekStartsOn + 8) % 7 || 7; switch (t) { case "c": return String(i); case "cc": return Oe(i, t.length); case "co": return e.ordinalNumber(i, { unit: "day" }); case "ccc": return e.day(r, { width: "abbreviated", context: "standalone" }); case "ccccc": return e.day(r, { width: "narrow", context: "standalone" }); case "cccccc": return e.day(r, { width: "short", context: "standalone" }); case "cccc": default: return e.day(r, { width: "wide", context: "standalone" }); } }, // ISO day of week i: function(n, t, e) { const o = n.getDay(), r = o === 0 ? 7 : o; switch (t) { case "i": return String(r); case "ii": return Oe(r, t.length); case "io": return e.ordinalNumber(r, { unit: "day" }); case "iii": return e.day(o, { width: "abbreviated", context: "formatting" }); case "iiiii": return e.day(o, { width: "narrow", context: "formatting" }); case "iiiiii": return e.day(o, { width: "short", context: "formatting" }); case "iiii": default: return e.day(o, { width: "wide", context: "formatting" }); } }, // AM or PM a: function(n, t, e) { const r = n.getHours() / 12 >= 1 ? "pm" : "am"; switch (t) { case "a": case "aa": return e.dayPeriod(r, { width: "abbreviated", context: "formatting" }); case "aaa": return e.dayPeriod(r, { width: "abbreviated", context: "formatting" }).toLowerCase(); case "aaaaa": return e.dayPeriod(r, { width: "narrow", context: "formatting" }); case "aaaa": default: return e.dayPeriod(r, { width: "wide", context: "formatting" }); } }, // AM, PM, midnight, noon b: function(n, t, e) { const o = n.getHours(); let r; switch (o === 12 ? r = At.noon : o === 0 ? r = At.midnight : r = o / 12 >= 1 ? "pm" : "am", t) { case "b": case "bb": return e.dayPeriod(r, { width: "abbreviated", context: "formatting" }); case "bbb": return e.dayPeriod(r, { width: "abbreviated", context: "formatting" }).toLowerCase(); case "bbbbb": return e.dayPeriod(r, { width: "narrow", context: "formatting" }); case "bbbb": default: return e.dayPeriod(r, { width: "wide", context: "formatting" }); } }, // in the morning, in the afternoon, in the evening, at night B: function(n, t, e) { const o = n.getHours(); let r; switch (o >= 17 ? r = At.evening : o >= 12 ? r = At.afternoon : o >= 4 ? r = At.morning : r = At.night, t) { case "B": case "BB": case "BBB": return e.dayPeriod(r, { width: "abbreviated", context: "formatting" }); case "BBBBB": return e.dayPeriod(r, { width: "narrow", context: "formatting" }); case "BBBB": default: return e.dayPeriod(r, { width: "wide", context: "formatting" }); } }, // Hour [1-12] h: function(n, t, e) { if (t === "ho") { let o = n.getHours() % 12; return o === 0 && (o = 12), e.ordinalNumber(o, { unit: "hour" }); } return Mt.h(n, t); }, // Hour [0-23] H: function(n, t, e) { return t === "Ho" ? e.ordinalNumber(n.getHours(), { unit: "hour" }) : Mt.H(n, t); }, // Hour [0-11] K: function(n, t, e) { const o = n.getHours() % 12; return t === "Ko" ? e.ordinalNumber(o, { unit: "hour" }) : Oe(o, t.length); }, // Hour [1-24] k: function(n, t, e) { let o = n.getHours(); return o === 0 && (o = 24), t === "ko" ? e.ordinalNumber(o, { unit: "hour" }) : Oe(o, t.length); }, // Minute m: function(n, t, e) { return t === "mo" ? e.ordinalNumber(n.getMinutes(), { unit: "minute" }) : Mt.m(n, t); }, // Second s: function(n, t, e) { return t === "so" ? e.ordinalNumber(n.getSeconds(), { unit: "second" }) : Mt.s(n, t); }, // Fraction of second S: function(n, t) { return Mt.S(n, t); }, // Timezone (ISO-8601. If offset is 0, output is always `'Z'`) X: function(n, t, e) { const o = n.getTimezoneOffset(); if (o === 0) return "Z"; switch (t) { case "X": return Un(o); case "XXXX": case "XX": return Nt(o); case "XXXXX": case "XXX": default: return Nt(o, ":"); } }, // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent) x: function(n, t, e) { const o = n.getTimezoneOffset(); switch (t) { case "x": return Un(o); case "xxxx": case "xx": return Nt(o); case "xxxxx": case "xxx": default: return Nt(o, ":"); } }, // Timezone (GMT) O: function(n, t, e) { const o = n.getTimezoneOffset(); switch (t) { case "O": case "OO": case "OOO": return "GMT" + Yn(o, ":"); case "OOOO": default: return "GMT" + Nt(o, ":"); } }, // Timezone (specific non-location) z: function(n, t, e) { const o = n.getTimezoneOffset(); switch (t) { case "z": case "zz": case "zzz": return "GMT" + Yn(o, ":"); case "zzzz": default: return "GMT" + Nt(o, ":"); } }, // Seconds timestamp t: function(n, t, e) { const o = Math.trunc(n.getTime() / 1e3); return Oe(o, t.length); }, // Milliseconds timestamp T: function(n, t, e) { const o = n.getTime(); return Oe(o, t.length); } }; function Yn(n, t = "") { const e = n > 0 ? "-" : "+", o = Math.abs(n), r = Math.trunc(o / 60), i = o % 60; return i === 0 ? e + String(r) : e + String(r) + t + Oe(i, 2); } function Un(n, t) { return n % 60 === 0 ? (n > 0 ? "-" : "+") + Oe(Math.abs(n) / 60, 2) : Nt(n, t); } function Nt(n, t = "") { const e = n > 0 ? "-" : "+", o = Math.abs(n), r = Oe(Math.trunc(o / 60), 2), i = Oe(o % 60, 2); return e + r + t + i; } const Xn = (n, t) => { switch (n) { case "P": return t.date({ width: "short" }); case "PP": return t.date({ width: "medium" }); case "PPP": return t.date({ width: "long" }); case "PPPP": default: return t.date({ width: "full" }); } }, go = (n, t) => { switch (n) { case "p": return t.time({ width: "short" }); case "pp": return t.time({ width: "medium" }); case "ppp": return t.time({ width: "long" }); case "pppp": default: return t.time({ width: "full" }); } }, Is = (n, t) => { const e = n.match(/(P+)(p+)?/) || [], o = e[1], r = e[2]; if (!r) return Xn(n, t); let i; switch (o) { case "P": i = t.dateTime({ width: "short" }); break; case "PP": i = t.dateTime({ width: "medium" }); break; case "PPP": i = t.dateTime({ width: "long" }); break; case "PPPP": default: i = t.dateTime({ width: "full" }); break; } return i.replace("{{date}}", Xn(o, t)).replace("{{time}}", go(r, t)); }, Cn = { p: go, P: Is }, Vs = /^D+$/, Ps = /^Y+$/, Ds = ["D", "DD", "YY", "YYYY"]; function yo(n) { return Vs.test(n); } function bo(n) { return Ps.test(n); } function xn(n, t, e) { const o = Bs(n, t, e); if (console.warn(o), Ds.includes(n)) throw new RangeError(o); } function Bs(n, t, e) { const o = n[0] === "Y" ? "years" : "days of the month"; return `Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${o} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`; } const Hs = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Ns = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Rs = /^'([^]*?)'?$/, Ls = /''/g, Ws = /[a-zA-Z]/; function sn(n, t, e) { var c, l, f, p; const o = Ut(), r = o.locale ?? mo, i = o.firstWeekContainsDate ?? ((l = (c = o.locale) == null ? void 0 : c.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, a = o.weekStartsOn ?? ((p = (f = o.locale) == null ? void 0 : f.options) == null ? void 0 : p.weekStartsOn) ?? 0, s = Ue(n); if (!po(s)) throw new RangeError("Invalid time value"); let u = t.match(Ns).map((m) => { const F = m[0]; if (F === "p" || F === "P") { const C = Cn[F]; return C(m, r.formatLong); } return m; }).join("").match(Hs).map((m) => { if (m === "''") return { isToken: !1, value: "'" }; const F = m[0]; if (F === "'") return { isToken: !1, value: $s(m) }; if (zn[F]) return { isToken: !0, value: m }; if (F.match(Ws)) throw new RangeError( "Format string contains an unescaped latin alphabet character `" + F + "`" ); return { isToken: !1, value: m }; }); r.localize.preprocessor && (u = r.localize.preprocessor(s, u)); const d = { firstWeekContainsDate: i, weekStartsOn: a, locale: r }; return u.map((m) => { if (!m.isToken) return m.value; const F = m.value; (bo(F) || yo(F)) && xn(F, t, String(n)); const C = zn[F[0]]; return C(s, F, r.localize, d); }).join(""); } function $s(n) { const t = n.match(Rs); return t ? t[1].replace(Ls, "'") : n; } function js() { return Object.assign({}, Ut()); } function As(n) { let e = Ue(n).getDay(); return e === 0 && (e = 7), e; } function qs(n, t) { const e = t instanceof Date ? $e(t, 0) : new t(0); return e.setFullYear( n.getFullYear(), n.getMonth(), n.getDate() ), e.setHours( n.getHours(), n.getMinutes(), n.getSeconds(), n.getMilliseconds() ), e; } const Gs = 10; class wo { constructor() { I(this, "subPriority", 0); } validate(t, e) { return !0; } } class zs extends wo { constructor(t, e, o, r, i) { super(), this.value = t, this.validateValue = e, this.setValue = o, this.priority = r, i && (this.subPriority = i); } validate(t, e) { return this.validateValue(t, this.value, e); } set(t, e, o) { return this.setValue(t, e, this.value, o); } } class Ys extends wo { constructor() { super(...arguments); I(this, "priority", Gs); I(this, "subPriority", -1); } set(e, o) { return o.timestampIsSet ? e : $e(e, qs(e, Date)); } } class Ee { run(t, e, o, r) { const i = this.parse(t, e, o, r); return i ? { setter: new zs( i.value, this.validate, this.set, this.priority, this.subPriority ), rest: i.rest } : null; } validate(t, e, o) { return !0; } } class Us extends Ee { constructor() { super(...arguments); I(this, "priority", 140); I(this, "incompatibleTokens", ["R", "u", "t", "T"]); } parse(e, o, r) { switch (o) { case "G": case "GG": case "GGG": return r.era(e, { width: "abbreviated" }) || r.era(e, { width: "narrow" }); case "GGGGG": return r.era(e, { width: "narrow" }); case "GGGG": default: return r.era(e, { width: "wide" }) || r.era(e, { width: "abbreviated" }) || r.era(e, { width: "narrow" }); } } set(e, o, r) { return o.era = r, e.setFullYear(r, 0, 1), e.setHours(0, 0, 0, 0), e; } } const Ae = { month: /^(1[0-2]|0?\d)/, // 0 to 12 date: /^(3[0-1]|[0-2]?\d)/, // 0 to 31 dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/, // 0 to 366 week: /^(5[0-3]|[0-4]?\d)/, // 0 to 53 hour23h: /^(2[0-3]|[0-1]?\d)/, // 0 to 23 hour24h: /^(2[0-4]|[0-1]?\d)/, // 0 to 24 hour11h: /^(1[0-1]|0?\d)/, // 0 to 11 hour12h: /^(1[0-2]|0?\d)/, // 0 to 12 minute: /^[0-5]?\d/, // 0 to 59 second: /^[0-5]?\d/, // 0 to 59 singleDigit: /^\d/, // 0 to 9 twoDigits: /^\d{1,2}/, // 0 to 99 threeDigits: /^\d{1,3}/, // 0 to 999 fourDigits: /^\d{1,4}/, // 0 to 9999 anyDigitsSigned: /^-?\d+/, singleDigitSigned: /^-?\d/, // 0 to 9, -0 to -9