epic-designer-cjh
Version:
基于vue3的设计器,可视化开发页面表单
1,003 lines (1,002 loc) • 26.9 kB
JavaScript
import { onMounted as G, onBeforeUnmount as Y, computed as ut, defineComponent as E, provide as dt, getCurrentInstance as ht, inject as L, ref as N, withDirectives as Z, watch as W, nextTick as ft, toRef as B, h as O } from "vue";
import { i as mt, b as pt, c as J, L as vt, z as ct } from "./index-b826a2e2.js";
import { o as D, a as I } from "./delegate-6e021bb9.js";
import { C as bt, u as wt } from "./index-e2a664aa.js";
import { u as Q } from "./use-memo-01b53d71.js";
import { i as yt } from "./use-is-mounted-a0b9f33e.js";
let A = [];
const R = /* @__PURE__ */ new WeakMap();
function gt() {
A.forEach((n) => n(...R.get(n))), A = [];
}
function Mt(n, ...t) {
R.set(n, t), !A.includes(n) && A.push(n) === 1 && requestAnimationFrame(gt);
}
let M, P;
const xt = () => {
var n, t;
M = mt ? (t = (n = document) === null || n === void 0 ? void 0 : n.fonts) === null || t === void 0 ? void 0 : t.ready : void 0, P = !1, M !== void 0 ? M.then(() => {
P = !0;
}) : P = !0;
};
xt();
function $t(n) {
if (P)
return;
let t = !1;
G(() => {
P || M == null || M.then(() => {
t || n();
});
}), Y(() => {
t = !0;
});
}
function ze(n, t) {
return ut(() => {
for (const e of t)
if (n[e] !== void 0)
return n[e];
return n[t[t.length - 1]];
});
}
let y = null;
function tt() {
if (y === null && (y = document.getElementById("v-binder-view-measurer"), y === null)) {
y = document.createElement("div"), y.id = "v-binder-view-measurer";
const { style: n } = y;
n.position = "fixed", n.left = "0", n.right = "0", n.top = "0", n.bottom = "0", n.pointerEvents = "none", n.visibility = "hidden", document.body.appendChild(y);
}
return y.getBoundingClientRect();
}
function Pt(n, t) {
const e = tt();
return {
top: t,
left: n,
height: 0,
width: 0,
right: e.width - n,
bottom: e.height - t
};
}
function F(n) {
const t = n.getBoundingClientRect(), e = tt();
return {
left: t.left - e.left,
top: t.top - e.top,
bottom: e.height + e.top - t.bottom,
right: e.width + e.left - t.right,
width: t.width,
height: t.height
};
}
function Wt(n) {
return n.nodeType === 9 ? null : n.parentNode;
}
function et(n) {
if (n === null)
return null;
const t = Wt(n);
if (t === null)
return null;
if (t.nodeType === 9)
return document;
if (t.nodeType === 1) {
const { overflow: e, overflowX: r, overflowY: o } = getComputedStyle(t);
if (/(auto|scroll|overlay)/.test(e + o + r))
return t;
}
return et(t);
}
const zt = E({
name: "Binder",
props: {
syncTargetWithParent: Boolean,
syncTarget: {
type: Boolean,
default: !0
}
},
setup(n) {
var t;
dt("VBinder", (t = ht()) === null || t === void 0 ? void 0 : t.proxy);
const e = L("VBinder", null), r = N(null), o = (l) => {
r.value = l, e && n.syncTargetWithParent && e.setTargetRef(l);
};
let u = [];
const d = () => {
let l = r.value;
for (; l = et(l), l !== null; )
u.push(l);
for (const b of u)
I("scroll", b, c, !0);
}, p = () => {
for (const l of u)
D("scroll", l, c, !0);
u = [];
}, i = /* @__PURE__ */ new Set(), f = (l) => {
i.size === 0 && d(), i.has(l) || i.add(l);
}, w = (l) => {
i.has(l) && i.delete(l), i.size === 0 && p();
}, c = () => {
Mt(a);
}, a = () => {
i.forEach((l) => l());
}, s = /* @__PURE__ */ new Set(), m = (l) => {
s.size === 0 && I("resize", window, v), s.has(l) || s.add(l);
}, h = (l) => {
s.has(l) && s.delete(l), s.size === 0 && D("resize", window, v);
}, v = () => {
s.forEach((l) => l());
};
return Y(() => {
D("resize", window, v), p();
}), {
targetRef: r,
setTargetRef: o,
addScrollListener: f,
removeScrollListener: w,
addResizeListener: m,
removeResizeListener: h
};
},
render() {
return pt("binder", this.$slots);
}
}), Ce = zt, Ae = E({
name: "Target",
setup() {
const { setTargetRef: n, syncTarget: t } = L("VBinder");
return {
syncTarget: t,
setTargetDirective: {
mounted: n,
updated: n
}
};
},
render() {
const { syncTarget: n, setTargetDirective: t } = this;
return n ? Z(J("follower", this.$slots), [
[t]
]) : J("follower", this.$slots);
}
}), { c: z } = bt(), Ct = "vueuc-style", C = {
top: "bottom",
bottom: "top",
left: "right",
right: "left"
}, U = {
start: "end",
center: "center",
end: "start"
}, V = {
top: "height",
bottom: "height",
left: "width",
right: "width"
}, At = {
"bottom-start": "top left",
bottom: "top center",
"bottom-end": "top right",
"top-start": "bottom left",
top: "bottom center",
"top-end": "bottom right",
"right-start": "top left",
right: "center left",
"right-end": "bottom left",
"left-start": "top right",
left: "center right",
"left-end": "bottom right"
}, St = {
"bottom-start": "bottom left",
bottom: "bottom center",
"bottom-end": "bottom right",
"top-start": "top left",
top: "top center",
"top-end": "top right",
"right-start": "top right",
right: "center right",
"right-end": "bottom right",
"left-start": "top left",
left: "center left",
"left-end": "bottom left"
}, kt = {
"bottom-start": "right",
"bottom-end": "left",
"top-start": "right",
"top-end": "left",
"right-start": "bottom",
"right-end": "top",
"left-start": "bottom",
"left-end": "top"
}, H = {
top: !0,
bottom: !1,
left: !0,
right: !1
// left--
}, K = {
top: "end",
bottom: "start",
left: "end",
right: "start"
};
function Bt(n, t, e, r, o, u) {
if (!o || u)
return { placement: n, top: 0, left: 0 };
const [d, p] = n.split("-");
let i = p ?? "center", f = {
top: 0,
left: 0
};
const w = (s, m, h) => {
let v = 0, l = 0;
const b = e[s] - t[m] - t[s];
return b > 0 && r && (h ? l = H[m] ? b : -b : v = H[m] ? b : -b), {
left: v,
top: l
};
}, c = d === "left" || d === "right";
if (i !== "center") {
const s = kt[n], m = C[s], h = V[s];
if (e[h] > t[h]) {
if (
// current space is not enough
// ----------[ target ]---------|
// -------[ follower ]
t[s] + t[h] < e[h]
) {
const v = (e[h] - t[h]) / 2;
t[s] < v || t[m] < v ? t[s] < t[m] ? (i = U[p], f = w(h, m, c)) : f = w(h, s, c) : i = "center";
}
} else
e[h] < t[h] && t[m] < 0 && // opposite align has larger space
// ------------[ target ]
// ----------------[follower]
t[s] > t[m] && (i = U[p]);
} else {
const s = d === "bottom" || d === "top" ? "left" : "top", m = C[s], h = V[s], v = (e[h] - t[h]) / 2;
// center is not enough
// ----------- [ target ]--|
// -------[ follower ]
(t[s] < v || t[m] < v) && (t[s] > t[m] ? (i = K[s], f = w(h, s, c)) : (i = K[m], f = w(h, m, c)));
}
let a = d;
return (
// space is not enough
t[d] < e[V[d]] && // opposite position's space is larger
t[d] < t[C[d]] && (a = C[d]), {
placement: i !== "center" ? `${a}-${i}` : a,
left: f.left,
top: f.top
}
);
}
function Ot(n, t) {
return t ? St[n] : At[n];
}
function Dt(n, t, e, r, o, u) {
if (u)
switch (n) {
case "bottom-start":
return {
top: `${Math.round(e.top - t.top + e.height)}px`,
left: `${Math.round(e.left - t.left)}px`,
transform: "translateY(-100%)"
};
case "bottom-end":
return {
top: `${Math.round(e.top - t.top + e.height)}px`,
left: `${Math.round(e.left - t.left + e.width)}px`,
transform: "translateX(-100%) translateY(-100%)"
};
case "top-start":
return {
top: `${Math.round(e.top - t.top)}px`,
left: `${Math.round(e.left - t.left)}px`,
transform: ""
};
case "top-end":
return {
top: `${Math.round(e.top - t.top)}px`,
left: `${Math.round(e.left - t.left + e.width)}px`,
transform: "translateX(-100%)"
};
case "right-start":
return {
top: `${Math.round(e.top - t.top)}px`,
left: `${Math.round(e.left - t.left + e.width)}px`,
transform: "translateX(-100%)"
};
case "right-end":
return {
top: `${Math.round(e.top - t.top + e.height)}px`,
left: `${Math.round(e.left - t.left + e.width)}px`,
transform: "translateX(-100%) translateY(-100%)"
};
case "left-start":
return {
top: `${Math.round(e.top - t.top)}px`,
left: `${Math.round(e.left - t.left)}px`,
transform: ""
};
case "left-end":
return {
top: `${Math.round(e.top - t.top + e.height)}px`,
left: `${Math.round(e.left - t.left)}px`,
transform: "translateY(-100%)"
};
case "top":
return {
top: `${Math.round(e.top - t.top)}px`,
left: `${Math.round(e.left - t.left + e.width / 2)}px`,
transform: "translateX(-50%)"
};
case "right":
return {
top: `${Math.round(e.top - t.top + e.height / 2)}px`,
left: `${Math.round(e.left - t.left + e.width)}px`,
transform: "translateX(-100%) translateY(-50%)"
};
case "left":
return {
top: `${Math.round(e.top - t.top + e.height / 2)}px`,
left: `${Math.round(e.left - t.left)}px`,
transform: "translateY(-50%)"
};
case "bottom":
default:
return {
top: `${Math.round(e.top - t.top + e.height)}px`,
left: `${Math.round(e.left - t.left + e.width / 2)}px`,
transform: "translateX(-50%) translateY(-100%)"
};
}
switch (n) {
case "bottom-start":
return {
top: `${Math.round(e.top - t.top + e.height + r)}px`,
left: `${Math.round(e.left - t.left + o)}px`,
transform: ""
};
case "bottom-end":
return {
top: `${Math.round(e.top - t.top + e.height + r)}px`,
left: `${Math.round(e.left - t.left + e.width + o)}px`,
transform: "translateX(-100%)"
};
case "top-start":
return {
top: `${Math.round(e.top - t.top + r)}px`,
left: `${Math.round(e.left - t.left + o)}px`,
transform: "translateY(-100%)"
};
case "top-end":
return {
top: `${Math.round(e.top - t.top + r)}px`,
left: `${Math.round(e.left - t.left + e.width + o)}px`,
transform: "translateX(-100%) translateY(-100%)"
};
case "right-start":
return {
top: `${Math.round(e.top - t.top + r)}px`,
left: `${Math.round(e.left - t.left + e.width + o)}px`,
transform: ""
};
case "right-end":
return {
top: `${Math.round(e.top - t.top + e.height + r)}px`,
left: `${Math.round(e.left - t.left + e.width + o)}px`,
transform: "translateY(-100%)"
};
case "left-start":
return {
top: `${Math.round(e.top - t.top + r)}px`,
left: `${Math.round(e.left - t.left + o)}px`,
transform: "translateX(-100%)"
};
case "left-end":
return {
top: `${Math.round(e.top - t.top + e.height + r)}px`,
left: `${Math.round(e.left - t.left + o)}px`,
transform: "translateX(-100%) translateY(-100%)"
};
case "top":
return {
top: `${Math.round(e.top - t.top + r)}px`,
left: `${Math.round(e.left - t.left + e.width / 2 + o)}px`,
transform: "translateY(-100%) translateX(-50%)"
};
case "right":
return {
top: `${Math.round(e.top - t.top + e.height / 2 + r)}px`,
left: `${Math.round(e.left - t.left + e.width + o)}px`,
transform: "translateY(-50%)"
};
case "left":
return {
top: `${Math.round(e.top - t.top + e.height / 2 + r)}px`,
left: `${Math.round(e.left - t.left + o)}px`,
transform: "translateY(-50%) translateX(-100%)"
};
case "bottom":
default:
return {
top: `${Math.round(e.top - t.top + e.height + r)}px`,
left: `${Math.round(e.left - t.left + e.width / 2 + o)}px`,
transform: "translateX(-50%)"
};
}
}
const Ft = z([
z(".v-binder-follower-container", {
position: "absolute",
left: "0",
right: "0",
top: "0",
height: "0",
pointerEvents: "none",
zIndex: "auto"
}),
z(".v-binder-follower-content", {
position: "absolute",
zIndex: "auto"
}, [
z("> *", {
pointerEvents: "all"
})
])
]), Se = E({
name: "Follower",
inheritAttrs: !1,
props: {
show: Boolean,
enabled: {
type: Boolean,
default: void 0
},
placement: {
type: String,
default: "bottom"
},
syncTrigger: {
type: Array,
default: ["resize", "scroll"]
},
to: [String, Object],
flip: {
type: Boolean,
default: !0
},
internalShift: Boolean,
x: Number,
y: Number,
width: String,
minWidth: String,
containerClass: String,
teleportDisabled: Boolean,
zindexable: {
type: Boolean,
default: !0
},
zIndex: Number,
overlap: Boolean
},
setup(n) {
const t = L("VBinder"), e = Q(() => n.enabled !== void 0 ? n.enabled : n.show), r = N(null), o = N(null), u = () => {
const { syncTrigger: a } = n;
a.includes("scroll") && t.addScrollListener(i), a.includes("resize") && t.addResizeListener(i);
}, d = () => {
t.removeScrollListener(i), t.removeResizeListener(i);
};
G(() => {
e.value && (i(), u());
});
const p = wt();
Ft.mount({
id: "vueuc/binder",
head: !0,
anchorMetaName: Ct,
ssr: p
}), Y(() => {
d();
}), $t(() => {
e.value && i();
});
const i = () => {
if (!e.value)
return;
const a = r.value;
if (a === null)
return;
const s = t.targetRef, { x: m, y: h, overlap: v } = n, l = m !== void 0 && h !== void 0 ? Pt(m, h) : F(s);
a.style.setProperty("--v-target-width", `${Math.round(l.width)}px`), a.style.setProperty("--v-target-height", `${Math.round(l.height)}px`);
const { width: b, minWidth: S, placement: j, internalShift: nt, flip: rt } = n;
a.setAttribute("v-placement", j), v ? a.setAttribute("v-overlap", "") : a.removeAttribute("v-overlap");
const { style: g } = a;
b === "target" ? g.width = `${l.width}px` : b !== void 0 ? g.width = b : g.width = "", S === "target" ? g.minWidth = `${l.width}px` : S !== void 0 ? g.minWidth = S : g.minWidth = "";
const ot = F(a), at = F(o.value), { left: T, top: _, placement: k } = Bt(j, l, ot, nt, rt, v), q = Ot(k, v), { left: it, top: lt, transform: st } = Dt(k, at, l, _, T, v);
a.setAttribute("v-placement", k), a.style.setProperty("--v-offset-left", `${Math.round(T)}px`), a.style.setProperty("--v-offset-top", `${Math.round(_)}px`), a.style.transform = `translateX(${it}) translateY(${lt}) ${st}`, a.style.setProperty("--v-transform-origin", q), a.style.transformOrigin = q;
};
W(e, (a) => {
a ? (u(), f()) : d();
});
const f = () => {
ft().then(i).catch((a) => console.error(a));
};
[
"placement",
"x",
"y",
"internalShift",
"flip",
"width",
"overlap",
"minWidth"
].forEach((a) => {
W(B(n, a), i);
}), ["teleportDisabled"].forEach((a) => {
W(B(n, a), f);
}), W(B(n, "syncTrigger"), (a) => {
a.includes("resize") ? t.addResizeListener(i) : t.removeResizeListener(i), a.includes("scroll") ? t.addScrollListener(i) : t.removeScrollListener(i);
});
const w = yt(), c = Q(() => {
const { to: a } = n;
if (a !== void 0)
return a;
w.value;
});
return {
VBinder: t,
mergedEnabled: e,
offsetContainerRef: o,
followerRef: r,
mergedTo: c,
syncPosition: i
};
},
render() {
return O(vt, {
show: this.show,
to: this.mergedTo,
disabled: this.teleportDisabled
}, {
default: () => {
var n, t;
const e = O("div", {
class: ["v-binder-follower-container", this.containerClass],
ref: "offsetContainerRef"
}, [
O("div", {
class: "v-binder-follower-content",
ref: "followerRef"
}, (t = (n = this.$slots).default) === null || t === void 0 ? void 0 : t.call(n))
]);
return this.zindexable ? Z(e, [
[
ct,
{
enabled: this.mergedEnabled,
zIndex: this.zIndex
}
]
]) : e;
}
});
}
});
function X(n) {
return function() {
var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = t.width ? String(t.width) : n.defaultWidth, r = n.formats[e] || n.formats[n.defaultWidth];
return r;
};
}
function x(n) {
return function(t, e) {
var r = e != null && e.context ? String(e.context) : "standalone", o;
if (r === "formatting" && n.formattingValues) {
var u = n.defaultFormattingWidth || n.defaultWidth, d = e != null && e.width ? String(e.width) : u;
o = n.formattingValues[d] || n.formattingValues[u];
} else {
var p = n.defaultWidth, i = e != null && e.width ? String(e.width) : n.defaultWidth;
o = n.values[i] || n.values[p];
}
var f = n.argumentCallback ? n.argumentCallback(t) : t;
return o[f];
};
}
function $(n) {
return function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = e.width, o = r && n.matchPatterns[r] || n.matchPatterns[n.defaultMatchWidth], u = t.match(o);
if (!u)
return null;
var d = u[0], p = r && n.parsePatterns[r] || n.parsePatterns[n.defaultParseWidth], i = Array.isArray(p) ? Xt(p, function(c) {
return c.test(d);
}) : Vt(p, function(c) {
return c.test(d);
}), f;
f = n.valueCallback ? n.valueCallback(i) : i, f = e.valueCallback ? e.valueCallback(f) : f;
var w = t.slice(d.length);
return {
value: f,
rest: w
};
};
}
function Vt(n, t) {
for (var e in n)
if (n.hasOwnProperty(e) && t(n[e]))
return e;
}
function Xt(n, t) {
for (var e = 0; e < n.length; e++)
if (t(n[e]))
return e;
}
function Nt(n) {
return function(t) {
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = t.match(n.matchPattern);
if (!r)
return null;
var o = r[0], u = t.match(n.parsePattern);
if (!u)
return null;
var d = n.valueCallback ? n.valueCallback(u[0]) : u[0];
d = e.valueCallback ? e.valueCallback(d) : d;
var p = t.slice(o.length);
return {
value: d,
rest: p
};
};
}
var Yt = {
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"
}
}, Et = function(t, e, r) {
var o, u = Yt[t];
return typeof u == "string" ? o = u : e === 1 ? o = u.one : o = u.other.replace("{{count}}", e.toString()), r != null && r.addSuffix ? r.comparison && r.comparison > 0 ? "in " + o : o + " ago" : o;
};
const Lt = Et;
var jt = {
full: "EEEE, MMMM do, y",
long: "MMMM do, y",
medium: "MMM d, y",
short: "MM/dd/yyyy"
}, Tt = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a"
}, _t = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
}, qt = {
date: X({
formats: jt,
defaultWidth: "full"
}),
time: X({
formats: Tt,
defaultWidth: "full"
}),
dateTime: X({
formats: _t,
defaultWidth: "full"
})
};
const Jt = qt;
var It = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: "P"
}, Qt = function(t, e, r, o) {
return It[t];
};
const Ut = Qt;
var Ht = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"]
}, Kt = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
}, Gt = {
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"]
}, Zt = {
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"]
}, Rt = {
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"
}
}, te = {
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"
}
}, ee = function(t, e) {
var r = Number(t), o = r % 100;
if (o > 20 || o < 10)
switch (o % 10) {
case 1:
return r + "st";
case 2:
return r + "nd";
case 3:
return r + "rd";
}
return r + "th";
}, ne = {
ordinalNumber: ee,
era: x({
values: Ht,
defaultWidth: "wide"
}),
quarter: x({
values: Kt,
defaultWidth: "wide",
argumentCallback: function(t) {
return t - 1;
}
}),
month: x({
values: Gt,
defaultWidth: "wide"
}),
day: x({
values: Zt,
defaultWidth: "wide"
}),
dayPeriod: x({
values: Rt,
defaultWidth: "wide",
formattingValues: te,
defaultFormattingWidth: "wide"
})
};
const re = ne;
var oe = /^(\d+)(th|st|nd|rd)?/i, ae = /\d+/i, ie = {
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
}, le = {
any: [/^b/i, /^(a|c)/i]
}, se = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i
}, ue = {
any: [/1/i, /2/i, /3/i, /4/i]
}, de = {
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
}, he = {
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]
}, fe = {
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
}, me = {
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]
}, pe = {
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
}, ve = {
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
}
}, ce = {
ordinalNumber: Nt({
matchPattern: oe,
parsePattern: ae,
valueCallback: function(t) {
return parseInt(t, 10);
}
}),
era: $({
matchPatterns: ie,
defaultMatchWidth: "wide",
parsePatterns: le,
defaultParseWidth: "any"
}),
quarter: $({
matchPatterns: se,
defaultMatchWidth: "wide",
parsePatterns: ue,
defaultParseWidth: "any",
valueCallback: function(t) {
return t + 1;
}
}),
month: $({
matchPatterns: de,
defaultMatchWidth: "wide",
parsePatterns: he,
defaultParseWidth: "any"
}),
day: $({
matchPatterns: fe,
defaultMatchWidth: "wide",
parsePatterns: me,
defaultParseWidth: "any"
}),
dayPeriod: $({
matchPatterns: pe,
defaultMatchWidth: "any",
parsePatterns: ve,
defaultParseWidth: "any"
})
};
const be = ce;
var we = {
code: "en-US",
formatDistance: Lt,
formatLong: Jt,
formatRelative: Ut,
localize: re,
match: be,
options: {
weekStartsOn: 0,
firstWeekContainsDate: 1
}
};
const ye = we, ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: ye
}, Symbol.toStringTag, { value: "Module" }));
export {
Ce as V,
z as a,
Mt as b,
Ct as c,
Se as d,
Ae as e,
X as f,
x as g,
Nt as h,
$ as i,
Lt as j,
Ut as k,
re as l,
be as m,
ke as n,
$t as o,
ye as p,
ze as u
};