react-semaphor 0.1.326 → 0.1.327
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +1 -1
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +4 -4
- package/dist/chunks/{braces-dHeaioTd.js → braces-B6qRDu1H.js} +1 -1
- package/dist/chunks/{braces-DVaMJoCd.js → braces-BGWZEnQJ.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog--2jD-eKu.js → calendar-preferences-dialog-CjwbE_82.js} +3 -3
- package/dist/chunks/{calendar-preferences-dialog-mqU_uOmY.js → calendar-preferences-dialog-fkLUMJyR.js} +1 -1
- package/dist/chunks/{chevrons-up-down-CLbzBHoI.js → chevrons-up-down-BpsogQvv.js} +1 -1
- package/dist/chunks/{chevrons-up-down-DNQE-uEp.js → chevrons-up-down-xG-bVFD9.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DguNfFr8.js → dashboard-briefing-launcher-Co57xBfS.js} +2 -2
- package/dist/chunks/{dashboard-briefing-launcher-DsjXUPFq.js → dashboard-briefing-launcher-Cy1nWZRW.js} +713 -719
- package/dist/chunks/{dashboard-controls-DgNkM1yT.js → dashboard-controls-BWnVEFJq.js} +7 -7
- package/dist/chunks/{dashboard-controls-XCa9PZuU.js → dashboard-controls-C7rOGZO-.js} +1 -1
- package/dist/chunks/{dashboard-json-DkA6Bf0Y.js → dashboard-json-BpRNSsF3.js} +2 -2
- package/dist/chunks/{dashboard-json-DiBd65Xf.js → dashboard-json-DBPMknGo.js} +1 -1
- package/dist/chunks/date-formatter-B4EBSe9C.js +1 -0
- package/dist/chunks/date-formatter-CzcPZx39.js +416 -0
- package/dist/chunks/edit-dashboard-visual-B2vkIKEa.js +178 -0
- package/dist/chunks/{edit-dashboard-visual-Q5hW5MXk.js → edit-dashboard-visual-CYf26co_.js} +8241 -7784
- package/dist/chunks/{index-B1-46PoR.js → index-BD90s-wf.js} +208 -202
- package/dist/chunks/{index-DwfDwtv2.js → index-DTlbYpxd.js} +26702 -26334
- package/dist/chunks/{palette-DtmNws9a.js → palette-CSF7IVJn.js} +1 -1
- package/dist/chunks/{palette-DpcvHAiY.js → palette-CWgEPBoG.js} +1 -1
- package/dist/chunks/{resource-management-panel-CGwWKZOP.js → resource-management-panel-D6nbfJY3.js} +1 -1
- package/dist/chunks/{resource-management-panel-D2oAQkKi.js → resource-management-panel-D893Onv8.js} +3 -3
- package/dist/chunks/{save-Cv_XRb94.js → save-CtQbSub2.js} +1 -1
- package/dist/chunks/{save-BY7WF62U.js → save-DRdFKF57.js} +1 -1
- package/dist/chunks/switch-DJJJD_g1.js +168 -0
- package/dist/chunks/{switch-j3AThLFk.js → switch-DKf6vHfP.js} +2447 -2405
- package/dist/chunks/{use-create-flow-overlay-state-BQPXP0AM.js → use-create-flow-overlay-state-C4LgoK8q.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-CP6GDQAX.js → use-create-flow-overlay-state-p21zs2p6.js} +4 -4
- package/dist/chunks/{use-visual-utils-CSXU-96k.js → use-visual-utils-BKBua6o4.js} +2 -2
- package/dist/chunks/{use-visual-utils-NpOW5uZ1.js → use-visual-utils-BqWm0QeW.js} +1 -1
- package/dist/chunks/{validators-DvTxl9i0.js → validators-DDAweCzB.js} +67 -48
- package/dist/chunks/validators-odlRJblR.js +2 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +907 -527
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +1 -1
- package/dist/format-utils/index.cjs +4 -4
- package/dist/format-utils/index.js +22 -21
- package/dist/index.cjs +1 -1
- package/dist/index.js +7 -7
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +1 -0
- package/dist/types/dashboard-authoring.d.ts +79 -2
- package/dist/types/dashboard.d.ts +17 -2
- package/dist/types/data-app-sdk.d.ts +1 -0
- package/dist/types/format-utils.d.ts +25 -0
- package/dist/types/main.d.ts +65 -10
- package/dist/types/shared.d.ts +17 -2
- package/dist/types/surfboard.d.ts +17 -2
- package/dist/types/types.d.ts +32 -3
- package/package.json +1 -1
- package/dist/chunks/date-formatter-D9Bvw5Qk.js +0 -1
- package/dist/chunks/date-formatter-DyIOb6uC.js +0 -333
- package/dist/chunks/edit-dashboard-visual-BC9eOc4U.js +0 -178
- package/dist/chunks/switch-5aQ_jcLH.js +0 -168
- package/dist/chunks/validators-DJUMR5An.js +0 -2
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as t, jsxs as i, Fragment as R } from "react/jsx-runtime";
|
|
2
|
-
import { c as K, u as N, B as _, az as dt, E as Vt, L as Hr, a1 as jr, a as te, aA as qr, aB as Vr, aC as rt, aD as me, aE as ct, aF as Kt, f as $e, X as Qt, aG as Wt, aH as Kr, G as Rt, Y as Qr, Z as Wr, _ as Jr, a0 as Yr, j as Xr, aI as Zr } from "./switch-
|
|
3
|
-
import { bf as ea, u as G, b as Jt, bg as ta, aH as re, c as Yt, d as ra, e as at, f as nt, n as aa, bh as ue, aU as Fe, bi as na, bj as Ut, bk as Xt, bl as Zt, bm as sa, b8 as lt, bn as oa, bo as ia, bp as da, bq as ca, br as la, bs as ua, ad as pe, bt as fe, o as k, bu as ma, bv as er, ay as ut, bd as pa, bw as fa, bx as ha, by as tr, aT as rr, aW as ar, ax as ga, aL as ba, bz as xa, bA as va, y as ya, x as Ue, J as wa, z as Ye, bB as Na, bC as Sa, bD as Da, Z as Ca, bE as ka, I as Xe, bF as Ea, bG as La, bH as Ia, bI as Aa, aM as Ma, aN as Pa, aO as Oa, aP as _a, aQ as $, bJ as Ra, aR as Tt, bK as Ua, bL as Ta, bM as Fa, H as $a, bN as Ga, a$ as Ba, b0 as za, b1 as Ha, b2 as ja, b3 as qa, b4 as Va, b5 as Ka, b6 as Ft, v as st } from "./index-
|
|
2
|
+
import { c as K, u as N, B as _, az as dt, E as Vt, L as Hr, a1 as jr, a as te, aA as qr, aB as Vr, aC as rt, aD as me, aE as ct, aF as Kt, f as $e, X as Qt, aG as Wt, aH as Kr, G as Rt, Y as Qr, Z as Wr, _ as Jr, a0 as Yr, j as Xr, aI as Zr } from "./switch-DKf6vHfP.js";
|
|
3
|
+
import { bf as ea, u as G, b as Jt, bg as ta, aH as re, c as Yt, d as ra, e as at, f as nt, n as aa, bh as ue, aU as Fe, bi as na, bj as Ut, bk as Xt, bl as Zt, bm as sa, b8 as lt, bn as oa, bo as ia, bp as da, bq as ca, br as la, bs as ua, ad as pe, bt as fe, o as k, bu as ma, bv as er, ay as ut, bd as pa, bw as fa, bx as ha, by as tr, aT as rr, aW as ar, ax as ga, aL as ba, bz as xa, bA as va, y as ya, x as Ue, J as wa, z as Ye, bB as Na, bC as Sa, bD as Da, Z as Ca, bE as ka, I as Xe, bF as Ea, bG as La, bH as Ia, bI as Aa, aM as Ma, aN as Pa, aO as Oa, aP as _a, aQ as $, bJ as Ra, aR as Tt, bK as Ua, bL as Ta, bM as Fa, H as $a, bN as Ga, a$ as Ba, b0 as za, b1 as Ha, b2 as ja, b3 as qa, b4 as Va, b5 as Ka, b6 as Ft, v as st } from "./index-DTlbYpxd.js";
|
|
4
4
|
import "./index-CuHybtft.js";
|
|
5
5
|
import * as I from "react";
|
|
6
6
|
import nr, { useState as w, useMemo as V, useEffect as Ge, useRef as $t, useLayoutEffect as Qa, useCallback as Wa } from "react";
|
|
7
7
|
import "./index-CJdxSyQq.js";
|
|
8
8
|
import { createPortal as Ja } from "react-dom";
|
|
9
|
-
import { L as Ya, b as Xa, u as Za, A as en, V as tn, K as rn, e as an, M as nn, N as sn, U as on } from "./dashboard-briefing-launcher-
|
|
9
|
+
import { L as Ya, b as Xa, u as Za, A as en, V as tn, K as rn, e as an, M as nn, N as sn, U as on } from "./dashboard-briefing-launcher-Cy1nWZRW.js";
|
|
10
10
|
import { d as sr } from "./index-DFOb_6HB.js";
|
|
11
|
-
import { C as dn } from "./calendar-preferences-dialog
|
|
11
|
+
import { C as dn } from "./calendar-preferences-dialog-CjwbE_82.js";
|
|
12
12
|
import { u as cn } from "./use-debounced-dirty-check-BwAbnX_5.js";
|
|
13
13
|
import { s as Ze } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
|
|
14
|
-
import { S as Gt } from "./save-
|
|
15
|
-
import { P as ln } from "./palette-
|
|
16
|
-
import { B as un } from "./braces-
|
|
14
|
+
import { S as Gt } from "./save-DRdFKF57.js";
|
|
15
|
+
import { P as ln } from "./palette-CSF7IVJn.js";
|
|
16
|
+
import { B as un } from "./braces-B6qRDu1H.js";
|
|
17
17
|
/**
|
|
18
18
|
* @license lucide-react v0.453.0 - ISC
|
|
19
19
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("./switch-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("./switch-DJJJD_g1.js"),s=require("./index-BD90s-wf.js");require("./index-BxM99sFL.js");const v=require("react");require("./index-DRlMUglg.js");const Zt=require("react-dom"),O=require("./dashboard-briefing-launcher-Co57xBfS.js"),xt=require("./index-D7KJindZ.js"),es=require("./calendar-preferences-dialog-fkLUMJyR.js"),ts=require("./use-debounced-dirty-check-XHSwAefL.js"),Re=require("./normalize-dashboard-for-dirty-check-BXRUMVb2.js"),ct=require("./save-CtQbSub2.js"),ss=require("./palette-CWgEPBoG.js"),rs=require("./braces-BGWZEnQJ.js");function ns(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const E=ns(v);/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as m, useState as b, useRef as f, useEffect as S } from "react";
|
|
3
3
|
import "./index-CuHybtft.js";
|
|
4
|
-
import { u as o, a as p, B as N, X as D, C as J } from "./switch-
|
|
5
|
-
import "./index-
|
|
4
|
+
import { u as o, a as p, B as N, X as D, C as J } from "./switch-DKf6vHfP.js";
|
|
5
|
+
import "./index-DTlbYpxd.js";
|
|
6
6
|
import "./index-CJdxSyQq.js";
|
|
7
7
|
import "react-dom";
|
|
8
8
|
function V() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=require("react");require("./index-BxM99sFL.js");const s=require("./switch-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=require("react");require("./index-BxM99sFL.js");const s=require("./switch-DJJJD_g1.js");require("./index-BD90s-wf.js");require("./index-DRlMUglg.js");require("react-dom");function b(){const t=s.useDashboardStore(e=>e.dashboard),c=s.useDashboardStore(e=>e.actions.setDashboard),u=s.useDashboardStore(e=>e.showDashboardJSON),h=s.useDashboardStore(e=>e.actions.setShowDashboardJSON),a=o.useMemo(()=>t?JSON.stringify(t,null,2):"",[t]),[l,d]=o.useState(a),n=o.useRef(a);return o.useEffect(()=>{a!==n.current&&(d(a),n.current=a)},[a]),r.jsxs("div",{className:s.cn("relative p-2",{hidden:!u}),children:[r.jsxs(s.Button,{variant:"secondary",size:"sm",className:"absolute right-2 top-2 z-10 h-8",onClick:()=>h(!1),children:[r.jsx(s.X,{className:"mr-2 h-4 w-4"}),"Close"]}),r.jsx("div",{className:"h-[550px] overflow-hidden",children:r.jsx(s.CodeEditor,{value:l,onValueChange:e=>{d(e);try{const i=JSON.parse(e);n.current=JSON.stringify(i,null,2),c(i)}catch{}},language:"json"})})]})}exports.default=b;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("./index-D7KJindZ.js");function M(t,e){const r=a.toDate(t),n=a.toDate(e),c=r.getTime()-n.getTime();return c<0?-1:c>0?1:c}function _(t){return a.constructFrom(t,Date.now())}function C(t,e){const r=a.toDate(t),n=a.toDate(e),c=r.getFullYear()-n.getFullYear(),i=r.getMonth()-n.getMonth();return c*12+i}function A(t){return e=>{const n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}function R(t,e){return+a.toDate(t)-+a.toDate(e)}function X(t){const e=a.toDate(t);return e.setHours(23,59,59,999),e}function B(t){const e=a.toDate(t),r=e.getMonth();return e.setFullYear(e.getFullYear(),r+1,0),e.setHours(23,59,59,999),e}function V(t){const e=a.toDate(t);return+X(e)==+B(e)}function W(t,e){const r=a.toDate(t),n=a.toDate(e),c=M(r,n),i=Math.abs(C(r,n));let f;if(i<1)f=0;else{r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-c*i);let u=M(r,n)===-c;V(a.toDate(t))&&i===1&&M(t,n)===1&&(u=!1),f=c*(i-Number(u))}return f===0?0:f}function Y(t,e,r){const n=R(t,e)/1e3;return A(r==null?void 0:r.roundingMethod)(n)}function E(t,e,r){const n=a.getDefaultOptions(),c=(r==null?void 0:r.locale)??n.locale??a.enUS,i=2520,f=M(t,e);if(isNaN(f))throw new RangeError("Invalid time value");const u=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:f});let l,d;f>0?(l=a.toDate(e),d=a.toDate(t)):(l=a.toDate(t),d=a.toDate(e));const m=Y(d,l),T=(a.getTimezoneOffsetInMilliseconds(d)-a.getTimezoneOffsetInMilliseconds(l))/1e3,s=Math.round((m-T)/60);let D;if(s<2)return r!=null&&r.includeSeconds?m<5?c.formatDistance("lessThanXSeconds",5,u):m<10?c.formatDistance("lessThanXSeconds",10,u):m<20?c.formatDistance("lessThanXSeconds",20,u):m<40?c.formatDistance("halfAMinute",0,u):m<60?c.formatDistance("lessThanXMinutes",1,u):c.formatDistance("xMinutes",1,u):s===0?c.formatDistance("lessThanXMinutes",1,u):c.formatDistance("xMinutes",s,u);if(s<45)return c.formatDistance("xMinutes",s,u);if(s<90)return c.formatDistance("aboutXHours",1,u);if(s<a.minutesInDay){const g=Math.round(s/60);return c.formatDistance("aboutXHours",g,u)}else{if(s<i)return c.formatDistance("xDays",1,u);if(s<a.minutesInMonth){const g=Math.round(s/a.minutesInDay);return c.formatDistance("xDays",g,u)}else if(s<a.minutesInMonth*2)return D=Math.round(s/a.minutesInMonth),c.formatDistance("aboutXMonths",D,u)}if(D=W(d,l),D<12){const g=Math.round(s/a.minutesInMonth);return c.formatDistance("xMonths",g,u)}else{const g=D%12,x=Math.trunc(D/12);return g<3?c.formatDistance("aboutXYears",x,u):g<9?c.formatDistance("overXYears",x,u):c.formatDistance("almostXYears",x+1,u)}}function U(t,e){return E(t,_(t),e)}function S(t){if(!t)return!1;const e=t.toLowerCase().replace("_","-");return e==="en-in"||e.startsWith("en-in-")}function P(t,e){const r=Math.abs(t);return r>=1e12?{divisor:1e12,suffix:"T"}:r>=1e9?{divisor:1e9,suffix:"B"}:S(e)&&r>=1e7?{divisor:1e7,suffix:"Cr"}:r>=1e6?{divisor:1e6,suffix:"M"}:S(e)&&r>=1e5?{divisor:1e5,suffix:"L"}:r>=1e3?{divisor:1e3,suffix:"K"}:{divisor:1,suffix:""}}function y(t,e){try{const r=h(e);return P(t,r)}catch{return P(t,"en-US")}}function k(t){try{return new Intl.NumberFormat(t),!0}catch{return!1}}function h(t){return t&&k(t)?t:"en-US"}function I(t,e){if(t==null||isNaN(t))return"";const r=h(e==null?void 0:e.locale);let n=t;if(e!=null&&e.multiplyBy&&(n*=e.multiplyBy),e!=null&&e.useSuffix){const{divisor:i,suffix:f}=y(n,r);n=n/i;const u=new Intl.NumberFormat(r,{minimumFractionDigits:(e==null?void 0:e.minimumFractionDigits)??0,maximumFractionDigits:(e==null?void 0:e.maximumFractionDigits)??2,useGrouping:(e==null?void 0:e.useGrouping)??!0}).format(n);return`${(e==null?void 0:e.prefix)??""}${u}${f}${(e==null?void 0:e.suffix)??""}`}const c=new Intl.NumberFormat(r,{minimumFractionDigits:(e==null?void 0:e.minimumFractionDigits)??0,maximumFractionDigits:(e==null?void 0:e.maximumFractionDigits)??2,useGrouping:(e==null?void 0:e.useGrouping)??!0}).format(n);if(e!=null&&e.negativeInParentheses&&n<0){const i=c.replace("-","");return`(${(e==null?void 0:e.prefix)??""}${i}${(e==null?void 0:e.suffix)??""})`}return`${(e==null?void 0:e.prefix)??""}${c}${(e==null?void 0:e.suffix)??""}`}function G(t,e){if(t==null||isNaN(t))return"";const r=h(e==null?void 0:e.locale),n=(e==null?void 0:e.currency)||"USD",c=t<0,i=!!(e!=null&&e.negativeInParentheses&&c),f=i?Math.abs(t):t;try{if(e!=null&&e.useSuffix){const{divisor:l,suffix:d}=y(f,r),m=f/l,s=`${new Intl.NumberFormat(r,{style:"currency",currency:n,minimumFractionDigits:(e==null?void 0:e.minimumFractionDigits)??0,maximumFractionDigits:(e==null?void 0:e.maximumFractionDigits)??2,useGrouping:(e==null?void 0:e.useGrouping)??!0}).format(m)}${d}`;return i?`(${s})`:s}const u=new Intl.NumberFormat(r,{style:"currency",currency:n,minimumFractionDigits:(e==null?void 0:e.minimumFractionDigits)??0,maximumFractionDigits:(e==null?void 0:e.maximumFractionDigits)??2,useGrouping:(e==null?void 0:e.useGrouping)??!0}).format(f);return i?`(${u})`:u}catch{const u=Math.abs(t),l=e!=null&&e.useSuffix?y(u,r):{divisor:1,suffix:""},d=I(u/l.divisor,{locale:r,minimumFractionDigits:(e==null?void 0:e.minimumFractionDigits)??0,maximumFractionDigits:(e==null?void 0:e.maximumFractionDigits)??2,useGrouping:(e==null?void 0:e.useGrouping)??!0}),m=`${n} ${d}${l.suffix}`;return c?e!=null&&e.negativeInParentheses?`(${m})`:`-${m}`:m}}function v(t,e){if(t==null||isNaN(t))return"";const r=h(e==null?void 0:e.locale),c=(e==null?void 0:e.alreadyPercent)??(e==null?void 0:e.percentValueMode)==="whole"?t/100:t;return new Intl.NumberFormat(r,{style:"percent",minimumFractionDigits:(e==null?void 0:e.minimumFractionDigits)??0,maximumFractionDigits:(e==null?void 0:e.maximumFractionDigits)??2,useGrouping:(e==null?void 0:e.useGrouping)??!0}).format(c)}function w(t,e){if(t==null||isNaN(t))return"";const r=h(e==null?void 0:e.locale);return new Intl.NumberFormat(r,{notation:"scientific",minimumFractionDigits:(e==null?void 0:e.minimumFractionDigits)??0,maximumFractionDigits:(e==null?void 0:e.maximumFractionDigits)??2}).format(t)}function j(t,e,r="en-US"){if(t==null||isNaN(t))return"";const n=h((e==null?void 0:e.locale)||r),c=(e==null?void 0:e.style)||"decimal";if(c==="percent"){const f=((e==null?void 0:e.percentValueMode)??"whole")==="whole"?t/100:t;return new Intl.NumberFormat(n,{style:"percent",minimumFractionDigits:(e==null?void 0:e.minimumFractionDigits)??0,maximumFractionDigits:(e==null?void 0:e.maximumFractionDigits)??2,useGrouping:(e==null?void 0:e.useGrouping)??!0}).format(f)}return c==="currency"?new Intl.NumberFormat(n,{style:"currency",currency:(e==null?void 0:e.currency)||"USD",minimumFractionDigits:(e==null?void 0:e.minimumFractionDigits)??0,maximumFractionDigits:(e==null?void 0:e.maximumFractionDigits)??2,useGrouping:(e==null?void 0:e.useGrouping)??!0}).format(t):c==="scientific"?w(t,{locale:n,minimumFractionDigits:(e==null?void 0:e.minimumFractionDigits)??0,maximumFractionDigits:(e==null?void 0:e.maximumFractionDigits)??2}):new Intl.NumberFormat(n,{minimumFractionDigits:(e==null?void 0:e.minimumFractionDigits)??0,maximumFractionDigits:(e==null?void 0:e.maximumFractionDigits)??2,useGrouping:(e==null?void 0:e.useGrouping)??!0}).format(t)}function H(t,e,r){const n={style:e==="currency"?"currency":e==="percent"?"percent":"decimal",locale:r==null?void 0:r.locale,currency:r==null?void 0:r.currency,minimumFractionDigits:r==null?void 0:r.decimalPlaces,maximumFractionDigits:r==null?void 0:r.decimalPlaces,useSuffix:r==null?void 0:r.useSuffix,prefix:r==null?void 0:r.prefix,suffix:r==null?void 0:r.suffix,negativeInParentheses:r==null?void 0:r.negativeInParentheses,multiplyBy:r==null?void 0:r.multiplyBy};switch(e){case"currency":return G(t,n);case"percent":return v(t,n);case"scientific":return w(t,n);default:return I(t,n)}}const O=["day","hour","minute","second","millisecond"],N={day:864e5,hour:36e5,minute:6e4,second:1e3,millisecond:1},q={day:"d",hour:"hr",minute:"min",second:"s",millisecond:"ms"},K={day:["day","days"],hour:["hour","hours"],minute:["minute","minutes"],second:["second","seconds"],millisecond:["millisecond","milliseconds"]};function z(t){return t==="day"||t==="hour"||t==="minute"||t==="second"||t==="millisecond"}function Z(t,e){return z(t)?t:e}function L(t,e){return O.indexOf(Z(t,e))}function J(t,e){const r=L(t,"day"),n=L(e,"second"),c=Math.min(r,n),i=Math.max(r,n);return O.slice(c,i+1)}function Q(t,e){return t*N[Z(e,"second")]}function F(t,e){const r=J(e.largestUnit,e.smallestUnit),n=r[r.length-1],c=N[n];let i=Math.round(t/c)*c;return r.map(f=>{const u=N[f],l=Math.floor(i/u);return i-=l*u,{unit:f,value:l}})}function b(t,e){const r=t.filter(i=>i.value!==0),n=r.length>0?r:[t[t.length-1]],c=typeof e=="number"&&Number.isFinite(e)?Math.max(1,Math.trunc(e)):n.length;return n.slice(0,c).map(i=>`${i.value}${q[i.unit]}`).join(" ")}function o(t,e){const r=t.filter(i=>i.value!==0),n=r.length>0?r:[t[t.length-1]],c=typeof e=="number"&&Number.isFinite(e)?Math.max(1,Math.trunc(e)):n.length;return n.slice(0,c).map(i=>{const[f,u]=K[i.unit];return`${i.value} ${i.value===1?f:u}`}).join(" ")}function p(t){const e=t.some(l=>l.unit==="day"&&l.value!==0),r=t.some(l=>l.unit==="millisecond"),n=t.findIndex(l=>l.value!==0),c=Math.max(0,t.length-2),i=e?0:n===-1?c:Math.min(n,c),f=n===-1?t.slice(c):t.slice(i);if(f.length===0)return"0";const u=f.map((l,d)=>l.unit==="millisecond"?String(l.value).padStart(3,"0"):d===0?String(l.value):String(l.value).padStart(2,"0")).join(":");return r?u.replace(/:(\d{3})$/,".$1"):u}function ee(t,e,r){const n=`${r.prefix||""}${t}${r.suffix||""}`;return e?r.negativeInParentheses?`(${n})`:`-${n}`:n}function te(t,e={}){if(t==null)return"";const r=typeof t=="number"?t:typeof t=="string"&&t.trim()?Number(t):NaN;if(!Number.isFinite(r))return"";const n=e.inputUnit||"second",c=e.outputStyle==="digital"||e.outputStyle==="long"?e.outputStyle:"compact",i=r<0,f=Math.abs(Q(r,n)),u=F(f,e),l=c==="digital"?p(u):c==="long"?o(u,e.maxUnits):b(u,e.maxUnits);return ee(l,i,e)}function re(t,e){return t&&t!=="auto"?t:e}function ne(t,e=new Date){try{const r={timeZone:t,timeZoneName:"short"},c=new Intl.DateTimeFormat("en-US",r).formatToParts(e).find(i=>i.type==="timeZoneName");return(c==null?void 0:c.value)||t}catch{return t}}function ce(t){try{const e={timeZone:t,timeZoneName:"long"},n=new Intl.DateTimeFormat("en-US",e).formatToParts(new Date).find(c=>c.type==="timeZoneName");return(n==null?void 0:n.value)||t}catch{return t}}function $(t,e="auto"){if(!t)return new Date(NaN);const r=t.endsWith("Z"),n=/[+-]\d{2}:?\d{2}$/.test(t),c=/\([A-Z]{3,4}\)$/.test(t);if(e==="auto")return r||n||c?new Date(t):new Date(t+"Z");if(e==="local"){if(r||n){const i=t.replace(/Z$/,"").replace(/[+-]\d{2}:?\d{2}$/,"");return new Date(i)}return new Date(t)}else return e==="UTC"?r?new Date(t):n?new Date(t):new Date(t+"Z"):r||n||c?new Date(t):a.fromZonedTime(t,e)}const ie="MM/dd/yyyy",ue=(t,e,r,n="auto")=>{if(!t)return"";try{const c=$(t,n);if(isNaN(c.getTime()))return t;const f=(e&&e.trim()?e:ie).replace(/LLLL/g,"MMMM").replace(/LLL/g,"MMM");return r&&r!=="auto"?a.formatInTimeZone(c,r,f):a.format(c,f)}catch(c){return console.error("Date formatting error:",c),t}},ae=(t,e="auto")=>{if(!t)return"";try{const r=$(t,e);return isNaN(r.getTime())?t:U(r,{addSuffix:!0})}catch(r){return console.error("Relative time formatting error:",r),t}};exports.formatCurrency=G;exports.formatDate=ue;exports.formatDistanceToNow=U;exports.formatDuration=te;exports.formatNumber=I;exports.formatNumberCustom=H;exports.formatNumberWithColumnSettings=j;exports.formatPercent=v;exports.formatRelativeTime=ae;exports.formatScientific=w;exports.getTimezoneAbbreviation=ne;exports.getTimezoneName=ce;exports.parseWithSourceTimezone=$;exports.resolveTimezone=re;
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
import { t as l, c as v, g as A, e as C, a as $, m as P, b as x, f as R, d as X, h as B } from "./index-DFOb_6HB.js";
|
|
2
|
+
function M(t, e) {
|
|
3
|
+
const r = l(t), c = l(e), n = r.getTime() - c.getTime();
|
|
4
|
+
return n < 0 ? -1 : n > 0 ? 1 : n;
|
|
5
|
+
}
|
|
6
|
+
function V(t) {
|
|
7
|
+
return v(t, Date.now());
|
|
8
|
+
}
|
|
9
|
+
function Y(t, e) {
|
|
10
|
+
const r = l(t), c = l(e), n = r.getFullYear() - c.getFullYear(), i = r.getMonth() - c.getMonth();
|
|
11
|
+
return n * 12 + i;
|
|
12
|
+
}
|
|
13
|
+
function W(t) {
|
|
14
|
+
return (e) => {
|
|
15
|
+
const c = (t ? Math[t] : Math.trunc)(e);
|
|
16
|
+
return c === 0 ? 0 : c;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function k(t, e) {
|
|
20
|
+
return +l(t) - +l(e);
|
|
21
|
+
}
|
|
22
|
+
function E(t) {
|
|
23
|
+
const e = l(t);
|
|
24
|
+
return e.setHours(23, 59, 59, 999), e;
|
|
25
|
+
}
|
|
26
|
+
function j(t) {
|
|
27
|
+
const e = l(t), r = e.getMonth();
|
|
28
|
+
return e.setFullYear(e.getFullYear(), r + 1, 0), e.setHours(23, 59, 59, 999), e;
|
|
29
|
+
}
|
|
30
|
+
function H(t) {
|
|
31
|
+
const e = l(t);
|
|
32
|
+
return +E(e) == +j(e);
|
|
33
|
+
}
|
|
34
|
+
function K(t, e) {
|
|
35
|
+
const r = l(t), c = l(e), n = M(r, c), i = Math.abs(
|
|
36
|
+
Y(r, c)
|
|
37
|
+
);
|
|
38
|
+
let a;
|
|
39
|
+
if (i < 1)
|
|
40
|
+
a = 0;
|
|
41
|
+
else {
|
|
42
|
+
r.getMonth() === 1 && r.getDate() > 27 && r.setDate(30), r.setMonth(r.getMonth() - n * i);
|
|
43
|
+
let u = M(r, c) === -n;
|
|
44
|
+
H(l(t)) && i === 1 && M(t, c) === 1 && (u = !1), a = n * (i - Number(u));
|
|
45
|
+
}
|
|
46
|
+
return a === 0 ? 0 : a;
|
|
47
|
+
}
|
|
48
|
+
function q(t, e, r) {
|
|
49
|
+
const c = k(t, e) / 1e3;
|
|
50
|
+
return W(r == null ? void 0 : r.roundingMethod)(c);
|
|
51
|
+
}
|
|
52
|
+
function J(t, e, r) {
|
|
53
|
+
const c = A(), n = (r == null ? void 0 : r.locale) ?? c.locale ?? C, i = 2520, a = M(t, e);
|
|
54
|
+
if (isNaN(a))
|
|
55
|
+
throw new RangeError("Invalid time value");
|
|
56
|
+
const u = Object.assign({}, r, {
|
|
57
|
+
addSuffix: r == null ? void 0 : r.addSuffix,
|
|
58
|
+
comparison: a
|
|
59
|
+
});
|
|
60
|
+
let f, d;
|
|
61
|
+
a > 0 ? (f = l(e), d = l(t)) : (f = l(t), d = l(e));
|
|
62
|
+
const m = q(d, f), w = ($(d) - $(f)) / 1e3, s = Math.round((m - w) / 60);
|
|
63
|
+
let h;
|
|
64
|
+
if (s < 2)
|
|
65
|
+
return r != null && r.includeSeconds ? m < 5 ? n.formatDistance("lessThanXSeconds", 5, u) : m < 10 ? n.formatDistance("lessThanXSeconds", 10, u) : m < 20 ? n.formatDistance("lessThanXSeconds", 20, u) : m < 40 ? n.formatDistance("halfAMinute", 0, u) : m < 60 ? n.formatDistance("lessThanXMinutes", 1, u) : n.formatDistance("xMinutes", 1, u) : s === 0 ? n.formatDistance("lessThanXMinutes", 1, u) : n.formatDistance("xMinutes", s, u);
|
|
66
|
+
if (s < 45)
|
|
67
|
+
return n.formatDistance("xMinutes", s, u);
|
|
68
|
+
if (s < 90)
|
|
69
|
+
return n.formatDistance("aboutXHours", 1, u);
|
|
70
|
+
if (s < P) {
|
|
71
|
+
const g = Math.round(s / 60);
|
|
72
|
+
return n.formatDistance("aboutXHours", g, u);
|
|
73
|
+
} else {
|
|
74
|
+
if (s < i)
|
|
75
|
+
return n.formatDistance("xDays", 1, u);
|
|
76
|
+
if (s < x) {
|
|
77
|
+
const g = Math.round(s / P);
|
|
78
|
+
return n.formatDistance("xDays", g, u);
|
|
79
|
+
} else if (s < x * 2)
|
|
80
|
+
return h = Math.round(s / x), n.formatDistance("aboutXMonths", h, u);
|
|
81
|
+
}
|
|
82
|
+
if (h = K(d, f), h < 12) {
|
|
83
|
+
const g = Math.round(s / x);
|
|
84
|
+
return n.formatDistance("xMonths", g, u);
|
|
85
|
+
} else {
|
|
86
|
+
const g = h % 12, y = Math.trunc(h / 12);
|
|
87
|
+
return g < 3 ? n.formatDistance("aboutXYears", y, u) : g < 9 ? n.formatDistance("overXYears", y, u) : n.formatDistance("almostXYears", y + 1, u);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
function Q(t, e) {
|
|
91
|
+
return J(t, V(t), e);
|
|
92
|
+
}
|
|
93
|
+
function S(t) {
|
|
94
|
+
if (!t) return !1;
|
|
95
|
+
const e = t.toLowerCase().replace("_", "-");
|
|
96
|
+
return e === "en-in" || e.startsWith("en-in-");
|
|
97
|
+
}
|
|
98
|
+
function T(t, e) {
|
|
99
|
+
const r = Math.abs(t);
|
|
100
|
+
return r >= 1e12 ? { divisor: 1e12, suffix: "T" } : r >= 1e9 ? { divisor: 1e9, suffix: "B" } : S(e) && r >= 1e7 ? { divisor: 1e7, suffix: "Cr" } : r >= 1e6 ? { divisor: 1e6, suffix: "M" } : S(e) && r >= 1e5 ? { divisor: 1e5, suffix: "L" } : r >= 1e3 ? { divisor: 1e3, suffix: "K" } : { divisor: 1, suffix: "" };
|
|
101
|
+
}
|
|
102
|
+
function N(t, e) {
|
|
103
|
+
try {
|
|
104
|
+
const r = D(e);
|
|
105
|
+
return T(t, r);
|
|
106
|
+
} catch {
|
|
107
|
+
return T(t, "en-US");
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function F(t) {
|
|
111
|
+
try {
|
|
112
|
+
return new Intl.NumberFormat(t), !0;
|
|
113
|
+
} catch {
|
|
114
|
+
return !1;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function D(t) {
|
|
118
|
+
return t && F(t) ? t : "en-US";
|
|
119
|
+
}
|
|
120
|
+
function U(t, e) {
|
|
121
|
+
if (t == null || isNaN(t))
|
|
122
|
+
return "";
|
|
123
|
+
const r = D(e == null ? void 0 : e.locale);
|
|
124
|
+
let c = t;
|
|
125
|
+
if (e != null && e.multiplyBy && (c *= e.multiplyBy), e != null && e.useSuffix) {
|
|
126
|
+
const { divisor: i, suffix: a } = N(c, r);
|
|
127
|
+
c = c / i;
|
|
128
|
+
const u = new Intl.NumberFormat(r, {
|
|
129
|
+
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
130
|
+
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
|
|
131
|
+
useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
|
|
132
|
+
}).format(c);
|
|
133
|
+
return `${(e == null ? void 0 : e.prefix) ?? ""}${u}${a}${(e == null ? void 0 : e.suffix) ?? ""}`;
|
|
134
|
+
}
|
|
135
|
+
const n = new Intl.NumberFormat(r, {
|
|
136
|
+
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
137
|
+
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
|
|
138
|
+
useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
|
|
139
|
+
}).format(c);
|
|
140
|
+
if (e != null && e.negativeInParentheses && c < 0) {
|
|
141
|
+
const i = n.replace("-", "");
|
|
142
|
+
return `(${(e == null ? void 0 : e.prefix) ?? ""}${i}${(e == null ? void 0 : e.suffix) ?? ""})`;
|
|
143
|
+
}
|
|
144
|
+
return `${(e == null ? void 0 : e.prefix) ?? ""}${n}${(e == null ? void 0 : e.suffix) ?? ""}`;
|
|
145
|
+
}
|
|
146
|
+
function z(t, e) {
|
|
147
|
+
if (t == null || isNaN(t))
|
|
148
|
+
return "";
|
|
149
|
+
const r = D(e == null ? void 0 : e.locale), c = (e == null ? void 0 : e.currency) || "USD", n = t < 0, i = !!(e != null && e.negativeInParentheses && n), a = i ? Math.abs(t) : t;
|
|
150
|
+
try {
|
|
151
|
+
if (e != null && e.useSuffix) {
|
|
152
|
+
const { divisor: f, suffix: d } = N(a, r), m = a / f, s = `${new Intl.NumberFormat(r, {
|
|
153
|
+
style: "currency",
|
|
154
|
+
currency: c,
|
|
155
|
+
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
156
|
+
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
|
|
157
|
+
useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
|
|
158
|
+
}).format(m)}${d}`;
|
|
159
|
+
return i ? `(${s})` : s;
|
|
160
|
+
}
|
|
161
|
+
const u = new Intl.NumberFormat(r, {
|
|
162
|
+
style: "currency",
|
|
163
|
+
currency: c,
|
|
164
|
+
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
165
|
+
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
|
|
166
|
+
useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
|
|
167
|
+
}).format(a);
|
|
168
|
+
return i ? `(${u})` : u;
|
|
169
|
+
} catch {
|
|
170
|
+
const u = Math.abs(t), f = e != null && e.useSuffix ? N(u, r) : { divisor: 1, suffix: "" }, d = U(
|
|
171
|
+
u / f.divisor,
|
|
172
|
+
{
|
|
173
|
+
locale: r,
|
|
174
|
+
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
175
|
+
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
|
|
176
|
+
useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
|
|
177
|
+
}
|
|
178
|
+
), m = `${c} ${d}${f.suffix}`;
|
|
179
|
+
return n ? e != null && e.negativeInParentheses ? `(${m})` : `-${m}` : m;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function b(t, e) {
|
|
183
|
+
if (t == null || isNaN(t))
|
|
184
|
+
return "";
|
|
185
|
+
const r = D(e == null ? void 0 : e.locale), n = (e == null ? void 0 : e.alreadyPercent) ?? (e == null ? void 0 : e.percentValueMode) === "whole" ? t / 100 : t;
|
|
186
|
+
return new Intl.NumberFormat(r, {
|
|
187
|
+
style: "percent",
|
|
188
|
+
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
189
|
+
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
|
|
190
|
+
useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
|
|
191
|
+
}).format(n);
|
|
192
|
+
}
|
|
193
|
+
function G(t, e) {
|
|
194
|
+
if (t == null || isNaN(t))
|
|
195
|
+
return "";
|
|
196
|
+
const r = D(e == null ? void 0 : e.locale);
|
|
197
|
+
return new Intl.NumberFormat(r, {
|
|
198
|
+
notation: "scientific",
|
|
199
|
+
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
200
|
+
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
|
|
201
|
+
}).format(t);
|
|
202
|
+
}
|
|
203
|
+
function le(t, e, r = "en-US") {
|
|
204
|
+
if (t == null || isNaN(t))
|
|
205
|
+
return "";
|
|
206
|
+
const c = D((e == null ? void 0 : e.locale) || r), n = (e == null ? void 0 : e.style) || "decimal";
|
|
207
|
+
if (n === "percent") {
|
|
208
|
+
const a = ((e == null ? void 0 : e.percentValueMode) ?? "whole") === "whole" ? t / 100 : t;
|
|
209
|
+
return new Intl.NumberFormat(c, {
|
|
210
|
+
style: "percent",
|
|
211
|
+
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
212
|
+
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
|
|
213
|
+
useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
|
|
214
|
+
}).format(a);
|
|
215
|
+
}
|
|
216
|
+
return n === "currency" ? new Intl.NumberFormat(c, {
|
|
217
|
+
style: "currency",
|
|
218
|
+
currency: (e == null ? void 0 : e.currency) || "USD",
|
|
219
|
+
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
220
|
+
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
|
|
221
|
+
useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
|
|
222
|
+
}).format(t) : n === "scientific" ? G(t, {
|
|
223
|
+
locale: c,
|
|
224
|
+
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
225
|
+
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2
|
|
226
|
+
}) : new Intl.NumberFormat(c, {
|
|
227
|
+
minimumFractionDigits: (e == null ? void 0 : e.minimumFractionDigits) ?? 0,
|
|
228
|
+
maximumFractionDigits: (e == null ? void 0 : e.maximumFractionDigits) ?? 2,
|
|
229
|
+
useGrouping: (e == null ? void 0 : e.useGrouping) ?? !0
|
|
230
|
+
}).format(t);
|
|
231
|
+
}
|
|
232
|
+
function me(t, e, r) {
|
|
233
|
+
const c = {
|
|
234
|
+
style: e === "currency" ? "currency" : e === "percent" ? "percent" : "decimal",
|
|
235
|
+
locale: r == null ? void 0 : r.locale,
|
|
236
|
+
currency: r == null ? void 0 : r.currency,
|
|
237
|
+
minimumFractionDigits: r == null ? void 0 : r.decimalPlaces,
|
|
238
|
+
maximumFractionDigits: r == null ? void 0 : r.decimalPlaces,
|
|
239
|
+
useSuffix: r == null ? void 0 : r.useSuffix,
|
|
240
|
+
prefix: r == null ? void 0 : r.prefix,
|
|
241
|
+
suffix: r == null ? void 0 : r.suffix,
|
|
242
|
+
negativeInParentheses: r == null ? void 0 : r.negativeInParentheses,
|
|
243
|
+
multiplyBy: r == null ? void 0 : r.multiplyBy
|
|
244
|
+
};
|
|
245
|
+
switch (e) {
|
|
246
|
+
case "currency":
|
|
247
|
+
return z(t, c);
|
|
248
|
+
case "percent":
|
|
249
|
+
return b(t, c);
|
|
250
|
+
case "scientific":
|
|
251
|
+
return G(t, c);
|
|
252
|
+
default:
|
|
253
|
+
return U(t, c);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
const Z = [
|
|
257
|
+
"day",
|
|
258
|
+
"hour",
|
|
259
|
+
"minute",
|
|
260
|
+
"second",
|
|
261
|
+
"millisecond"
|
|
262
|
+
], I = {
|
|
263
|
+
day: 864e5,
|
|
264
|
+
hour: 36e5,
|
|
265
|
+
minute: 6e4,
|
|
266
|
+
second: 1e3,
|
|
267
|
+
millisecond: 1
|
|
268
|
+
}, o = {
|
|
269
|
+
day: "d",
|
|
270
|
+
hour: "hr",
|
|
271
|
+
minute: "min",
|
|
272
|
+
second: "s",
|
|
273
|
+
millisecond: "ms"
|
|
274
|
+
}, p = {
|
|
275
|
+
day: ["day", "days"],
|
|
276
|
+
hour: ["hour", "hours"],
|
|
277
|
+
minute: ["minute", "minutes"],
|
|
278
|
+
second: ["second", "seconds"],
|
|
279
|
+
millisecond: ["millisecond", "milliseconds"]
|
|
280
|
+
};
|
|
281
|
+
function ee(t) {
|
|
282
|
+
return t === "day" || t === "hour" || t === "minute" || t === "second" || t === "millisecond";
|
|
283
|
+
}
|
|
284
|
+
function O(t, e) {
|
|
285
|
+
return ee(t) ? t : e;
|
|
286
|
+
}
|
|
287
|
+
function L(t, e) {
|
|
288
|
+
return Z.indexOf(O(t, e));
|
|
289
|
+
}
|
|
290
|
+
function te(t, e) {
|
|
291
|
+
const r = L(t, "day"), c = L(e, "second"), n = Math.min(r, c), i = Math.max(r, c);
|
|
292
|
+
return Z.slice(n, i + 1);
|
|
293
|
+
}
|
|
294
|
+
function re(t, e) {
|
|
295
|
+
return t * I[O(e, "second")];
|
|
296
|
+
}
|
|
297
|
+
function ce(t, e) {
|
|
298
|
+
const r = te(e.largestUnit, e.smallestUnit), c = r[r.length - 1], n = I[c];
|
|
299
|
+
let i = Math.round(t / n) * n;
|
|
300
|
+
return r.map((a) => {
|
|
301
|
+
const u = I[a], f = Math.floor(i / u);
|
|
302
|
+
return i -= f * u, { unit: a, value: f };
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
function ne(t, e) {
|
|
306
|
+
const r = t.filter((i) => i.value !== 0), c = r.length > 0 ? r : [t[t.length - 1]], n = typeof e == "number" && Number.isFinite(e) ? Math.max(1, Math.trunc(e)) : c.length;
|
|
307
|
+
return c.slice(0, n).map((i) => `${i.value}${o[i.unit]}`).join(" ");
|
|
308
|
+
}
|
|
309
|
+
function ie(t, e) {
|
|
310
|
+
const r = t.filter((i) => i.value !== 0), c = r.length > 0 ? r : [t[t.length - 1]], n = typeof e == "number" && Number.isFinite(e) ? Math.max(1, Math.trunc(e)) : c.length;
|
|
311
|
+
return c.slice(0, n).map((i) => {
|
|
312
|
+
const [a, u] = p[i.unit];
|
|
313
|
+
return `${i.value} ${i.value === 1 ? a : u}`;
|
|
314
|
+
}).join(" ");
|
|
315
|
+
}
|
|
316
|
+
function ue(t) {
|
|
317
|
+
const e = t.some(
|
|
318
|
+
(f) => f.unit === "day" && f.value !== 0
|
|
319
|
+
), r = t.some((f) => f.unit === "millisecond"), c = t.findIndex((f) => f.value !== 0), n = Math.max(0, t.length - 2), i = e ? 0 : c === -1 ? n : Math.min(c, n), a = c === -1 ? t.slice(n) : t.slice(i);
|
|
320
|
+
if (a.length === 0)
|
|
321
|
+
return "0";
|
|
322
|
+
const u = a.map((f, d) => f.unit === "millisecond" ? String(f.value).padStart(3, "0") : d === 0 ? String(f.value) : String(f.value).padStart(2, "0")).join(":");
|
|
323
|
+
return r ? u.replace(/:(\d{3})$/, ".$1") : u;
|
|
324
|
+
}
|
|
325
|
+
function ae(t, e, r) {
|
|
326
|
+
const c = `${r.prefix || ""}${t}${r.suffix || ""}`;
|
|
327
|
+
return e ? r.negativeInParentheses ? `(${c})` : `-${c}` : c;
|
|
328
|
+
}
|
|
329
|
+
function de(t, e = {}) {
|
|
330
|
+
if (t == null)
|
|
331
|
+
return "";
|
|
332
|
+
const r = typeof t == "number" ? t : typeof t == "string" && t.trim() ? Number(t) : NaN;
|
|
333
|
+
if (!Number.isFinite(r))
|
|
334
|
+
return "";
|
|
335
|
+
const c = e.inputUnit || "second", n = e.outputStyle === "digital" || e.outputStyle === "long" ? e.outputStyle : "compact", i = r < 0, a = Math.abs(re(r, c)), u = ce(a, e), f = n === "digital" ? ue(u) : n === "long" ? ie(u, e.maxUnits) : ne(u, e.maxUnits);
|
|
336
|
+
return ae(f, i, e);
|
|
337
|
+
}
|
|
338
|
+
function ge(t, e) {
|
|
339
|
+
return t && t !== "auto" ? t : e;
|
|
340
|
+
}
|
|
341
|
+
function he(t, e = /* @__PURE__ */ new Date()) {
|
|
342
|
+
try {
|
|
343
|
+
const r = {
|
|
344
|
+
timeZone: t,
|
|
345
|
+
timeZoneName: "short"
|
|
346
|
+
}, n = new Intl.DateTimeFormat("en-US", r).formatToParts(e).find((i) => i.type === "timeZoneName");
|
|
347
|
+
return (n == null ? void 0 : n.value) || t;
|
|
348
|
+
} catch {
|
|
349
|
+
return t;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
function De(t) {
|
|
353
|
+
try {
|
|
354
|
+
const e = {
|
|
355
|
+
timeZone: t,
|
|
356
|
+
timeZoneName: "long"
|
|
357
|
+
}, c = new Intl.DateTimeFormat("en-US", e).formatToParts(
|
|
358
|
+
/* @__PURE__ */ new Date()
|
|
359
|
+
).find((n) => n.type === "timeZoneName");
|
|
360
|
+
return (c == null ? void 0 : c.value) || t;
|
|
361
|
+
} catch {
|
|
362
|
+
return t;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
function _(t, e = "auto") {
|
|
366
|
+
if (!t)
|
|
367
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
368
|
+
const r = t.endsWith("Z"), c = /[+-]\d{2}:?\d{2}$/.test(t), n = /\([A-Z]{3,4}\)$/.test(t);
|
|
369
|
+
if (e === "auto")
|
|
370
|
+
return r || c || n ? new Date(t) : /* @__PURE__ */ new Date(t + "Z");
|
|
371
|
+
if (e === "local") {
|
|
372
|
+
if (r || c) {
|
|
373
|
+
const i = t.replace(/Z$/, "").replace(/[+-]\d{2}:?\d{2}$/, "");
|
|
374
|
+
return new Date(i);
|
|
375
|
+
}
|
|
376
|
+
return new Date(t);
|
|
377
|
+
} else return e === "UTC" ? r ? new Date(t) : c ? new Date(t) : /* @__PURE__ */ new Date(t + "Z") : r || c || n ? new Date(t) : B(t, e);
|
|
378
|
+
}
|
|
379
|
+
const fe = "MM/dd/yyyy", xe = (t, e, r, c = "auto") => {
|
|
380
|
+
if (!t)
|
|
381
|
+
return "";
|
|
382
|
+
try {
|
|
383
|
+
const n = _(t, c);
|
|
384
|
+
if (isNaN(n.getTime()))
|
|
385
|
+
return t;
|
|
386
|
+
const a = (e && e.trim() ? e : fe).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
|
|
387
|
+
return r && r !== "auto" ? R(n, r, a) : X(n, a);
|
|
388
|
+
} catch (n) {
|
|
389
|
+
return console.error("Date formatting error:", n), t;
|
|
390
|
+
}
|
|
391
|
+
}, Me = (t, e = "auto") => {
|
|
392
|
+
if (!t)
|
|
393
|
+
return "";
|
|
394
|
+
try {
|
|
395
|
+
const r = _(t, e);
|
|
396
|
+
return isNaN(r.getTime()) ? t : Q(r, { addSuffix: !0 });
|
|
397
|
+
} catch (r) {
|
|
398
|
+
return console.error("Relative time formatting error:", r), t;
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
export {
|
|
402
|
+
Me as a,
|
|
403
|
+
xe as b,
|
|
404
|
+
U as c,
|
|
405
|
+
z as d,
|
|
406
|
+
b as e,
|
|
407
|
+
le as f,
|
|
408
|
+
G as g,
|
|
409
|
+
me as h,
|
|
410
|
+
de as i,
|
|
411
|
+
he as j,
|
|
412
|
+
De as k,
|
|
413
|
+
Q as l,
|
|
414
|
+
_ as p,
|
|
415
|
+
ge as r
|
|
416
|
+
};
|