react-semaphor 0.1.182 → 0.1.184

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.
Files changed (42) hide show
  1. package/dist/chunks/calendar-preferences-dialog-D9oF_URo.js +1 -0
  2. package/dist/chunks/calendar-preferences-dialog-DeXKY9JD.js +457 -0
  3. package/dist/chunks/common-types-CfJLrTJd.js +1 -0
  4. package/dist/chunks/common-types-DhqlRVrq.js +8 -0
  5. package/dist/chunks/{dashboard-controls-pGlGtKRR.js → dashboard-controls-CB8282ob.js} +8 -8
  6. package/dist/chunks/{dashboard-controls-BnBXzFOj.js → dashboard-controls-lRs5t5cg.js} +499 -484
  7. package/dist/chunks/{dashboard-json-UVBr47Qj.js → dashboard-json-BmzqRV5Q.js} +1 -1
  8. package/dist/chunks/{dashboard-json-CiIyCwJi.js → dashboard-json-Brn4hMd-.js} +1 -1
  9. package/dist/chunks/date-formatter-Sz6QDaM8.js +1 -0
  10. package/dist/chunks/{index-B4EhQdS9.js → date-formatter-Y8Za1ib3.js} +500 -544
  11. package/dist/chunks/{edit-dashboard-visual-DoP_x_tT.js → edit-dashboard-visual--FJBg3i3.js} +914 -914
  12. package/dist/chunks/{edit-dashboard-visual-CXvyi_qa.js → edit-dashboard-visual-DNq8ni5W.js} +8 -8
  13. package/dist/chunks/{editor-action-buttons-5UEhKl88.js → editor-action-buttons-COCkxvCM.js} +27 -27
  14. package/dist/chunks/{editor-action-buttons-Bftd6Bfx.js → editor-action-buttons-RPpMm3Zr.js} +1 -1
  15. package/dist/chunks/{index-ahdw_esL.js → index-CyYJ0bVW.js} +24904 -24743
  16. package/dist/chunks/{index-D59dkH2b.js → index-Dz2kwOQh.js} +229 -229
  17. package/dist/chunks/{notification-bell-CKI2j8jH.js → notification-bell-B86bWytX.js} +109 -109
  18. package/dist/chunks/{notification-bell-DtWcBdzp.js → notification-bell-Bdk-qQIx.js} +2 -2
  19. package/dist/chunks/{resource-management-panel-qkl060k8.js → resource-management-panel-BZKSwkRq.js} +160 -160
  20. package/dist/chunks/{resource-management-panel-BLiCtZZE.js → resource-management-panel-CvKBoIFQ.js} +1 -1
  21. package/dist/chunks/{use-role-aware-display-preferences-CLf3yEts.js → use-role-aware-display-preferences-D-jgaajh.js} +1 -1
  22. package/dist/chunks/{use-role-aware-display-preferences-JstD5WLE.js → use-role-aware-display-preferences-Kxc427Zx.js} +1 -1
  23. package/dist/chunks/{use-visual-utils-TGjvLx_R.js → use-visual-utils-Du4NIgMk.js} +1 -1
  24. package/dist/chunks/{use-visual-utils-BbN7rxtD.js → use-visual-utils-DwQQN6wI.js} +33 -33
  25. package/dist/dashboard/index.cjs +1 -1
  26. package/dist/dashboard/index.js +3 -3
  27. package/dist/format-utils/index.cjs +5 -5
  28. package/dist/format-utils/index.js +200 -250
  29. package/dist/index.cjs +1 -1
  30. package/dist/index.js +75 -71
  31. package/dist/style.css +1 -1
  32. package/dist/surfboard/index.cjs +1 -1
  33. package/dist/surfboard/index.js +6 -4
  34. package/dist/types/dashboard.d.ts +6 -2
  35. package/dist/types/format-utils.d.ts +43 -20
  36. package/dist/types/index.cjs +1 -1
  37. package/dist/types/index.js +8 -5
  38. package/dist/types/main.d.ts +99 -9
  39. package/dist/types/surfboard.d.ts +13 -2
  40. package/dist/types/types.d.ts +319 -2
  41. package/package.json +1 -1
  42. package/dist/chunks/index-8Crk3ROJ.js +0 -1
@@ -122,6 +122,35 @@ declare interface CalculatedFieldFormula {
122
122
  */
123
123
  declare type CalculatedFieldOperation = 'sum' | 'difference' | 'product' | 'ratio' | 'change' | 'percentage' | 'scale' | 'custom';
124
124
 
125
+ /**
126
+ * Calendar context for timezone-aware date operations.
127
+ * Controls how dates are interpreted, grouped, and displayed.
128
+ */
129
+ export declare type CalendarContext = {
130
+ /**
131
+ * IANA timezone identifier.
132
+ * @example 'America/Chicago', 'Europe/London', 'Asia/Tokyo', 'UTC'
133
+ * @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
134
+ */
135
+ tz: string;
136
+ /**
137
+ * Day the week starts on.
138
+ * 0 = Sunday (US, Canada, Japan)
139
+ * 1 = Monday (ISO standard, most of Europe)
140
+ * 6 = Saturday (Middle East)
141
+ * @default 1 (Monday) for backward compatibility
142
+ */
143
+ weekStart: WeekStart;
144
+ /**
145
+ * Date anchor for relative date calculations.
146
+ * - 'now': Use current time (default, live dashboards)
147
+ * - { iso: string }: Fixed ISO 8601 date for reproducible views
148
+ */
149
+ anchor: 'now' | {
150
+ iso: string;
151
+ };
152
+ };
153
+
125
154
  declare interface CardConfig {
126
155
  groupByColumns?: GroupByField[];
127
156
  metricColumns?: MetricField[];
@@ -409,6 +438,12 @@ declare type DateSelectionMode = 'range' | 'months';
409
438
 
410
439
  declare type DateUnit = 'day' | 'week' | 'month' | 'quarter' | 'year';
411
440
 
441
+ /**
442
+ * Default CalendarContext when not provided.
443
+ * Used as fallback for backward compatibility.
444
+ */
445
+ export declare const DEFAULT_CALENDAR_CONTEXT: CalendarContext;
446
+
412
447
  declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
413
448
 
414
449
  export declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
@@ -1038,6 +1073,22 @@ declare type RelativeDateFilter = {
1038
1073
  to: number;
1039
1074
  };
1040
1075
 
1076
+ /**
1077
+ * Parameters in JWT payload (after backend resolution).
1078
+ * The backend ALWAYS includes calendarContext, even if customer didn't provide it.
1079
+ */
1080
+ export declare type ResolvedTokenParams = Omit<TokenParams, 'calendarContext'> & {
1081
+ /**
1082
+ * Full calendar context for timezone-aware operations.
1083
+ * ALWAYS present in JWT - resolved by backend from:
1084
+ * 1. Token request calendarContext (highest priority)
1085
+ * 2. Token request timezone (legacy)
1086
+ * 3. User/Tenant/Org preferences (Phase 7)
1087
+ * 4. Default: { tz: 'UTC', weekStart: 1, anchor: 'now' }
1088
+ */
1089
+ calendarContext: CalendarContext;
1090
+ };
1091
+
1041
1092
  declare type SelectedEntities = DatabaseEntityReference[] | DataModelEntityReference[] | FileEntityReference[];
1042
1093
 
1043
1094
  export declare type SelectionState = Record<Level, string | null>;
@@ -1540,6 +1591,9 @@ export declare type TDatasetOptions = {
1540
1591
  export declare type TDbCapabilities = {
1541
1592
  path: Level[];
1542
1593
  labels?: Partial<Record<Level, string>>;
1594
+ prefixLevels: Level[];
1595
+ dialect?: string;
1596
+ supportsFilterClause?: boolean;
1543
1597
  };
1544
1598
 
1545
1599
  export declare type TEvent = {
@@ -1561,8 +1615,9 @@ declare type TFilter = {
1561
1615
  title: string;
1562
1616
  column: string;
1563
1617
  dataType: string;
1564
- table: string;
1565
- database: string;
1618
+ table?: string;
1619
+ database?: string;
1620
+ qualifiedTableName?: string;
1566
1621
  sql: string;
1567
1622
  operation: Operation;
1568
1623
  /**
@@ -1729,6 +1784,235 @@ export declare type TLens = {
1729
1784
  /** Line dash style options */
1730
1785
  export declare type TLineStyle = 'solid' | 'dashed' | 'dotted' | 'dash-dot';
1731
1786
 
1787
+ /**
1788
+ * Parameters for customizing token behavior and formatting.
1789
+ * This is used for token REQUEST (customer provides these).
1790
+ */
1791
+ export declare type TokenParams = {
1792
+ /**
1793
+ * Currency formatting options.
1794
+ */
1795
+ currencyFormat?: {
1796
+ /**
1797
+ * Locale identifier (e.g., 'en-US', 'fr-FR').
1798
+ */
1799
+ locale: string;
1800
+ /**
1801
+ * Currency code compliant with ISO 4217 (e.g., 'USD', 'EUR').
1802
+ */
1803
+ currency: string;
1804
+ };
1805
+ /**
1806
+ * IANA timezone identifier for date operations.
1807
+ * @deprecated Use calendarContext.tz instead for full calendar control.
1808
+ * @example 'America/Chicago', 'Europe/London'
1809
+ */
1810
+ timezone?: string;
1811
+ /**
1812
+ * Full calendar context for timezone-aware operations.
1813
+ * Optional in token request - the backend ALWAYS resolves and includes
1814
+ * this in the JWT, even when the customer doesn't provide it.
1815
+ */
1816
+ calendarContext?: CalendarContext;
1817
+ };
1818
+
1819
+ /**
1820
+ * Token properties from JWT payload.
1821
+ * This is what the frontend receives after token generation.
1822
+ */
1823
+ export declare type TokenProps = {
1824
+ /**
1825
+ * Allowed semantic domains.
1826
+ */
1827
+ allowedSemanticDomains?: string[];
1828
+ /**
1829
+ * Type of the token request. Default is 'dashboard'.
1830
+ */
1831
+ type?: 'dashboard' | 'project';
1832
+ /**
1833
+ * Initial dashboard id to be accessed.
1834
+ */
1835
+ dashboard_id?: string;
1836
+ /**
1837
+ * Unique identifier of the project.
1838
+ */
1839
+ project_id?: string;
1840
+ /**
1841
+ * Unique identifier of the tenant.
1842
+ */
1843
+ tenantId?: string;
1844
+ /**
1845
+ * Unique identifier of the tenant user accessing the dashboard.
1846
+ */
1847
+ endUserId?: string;
1848
+ /**
1849
+ * Email of the tenant user (for personalization, audit, or identification).
1850
+ */
1851
+ endUserEmail?: string;
1852
+ /**
1853
+ * Unique identifier of the org user accessing the dashboard.
1854
+ */
1855
+ orgUserId?: string;
1856
+ /**
1857
+ * Email of the org user (for personalization, audit, or identification).
1858
+ */
1859
+ orgUserEmail?: string;
1860
+ /**
1861
+ * Display name of the end user.
1862
+ */
1863
+ displayName?: string;
1864
+ /**
1865
+ * Enables self-service editing and lens creation by the end user.
1866
+ */
1867
+ allowEdit?: boolean;
1868
+ /**
1869
+ * Schema level security policy. The schema name for the tenant.
1870
+ */
1871
+ sls?: string;
1872
+ /**
1873
+ * Connection-level security policies.
1874
+ * Can be a single policy or an array of policies.
1875
+ */
1876
+ cls?: TokenSecurityPolicy[] | TokenSecurityPolicy;
1877
+ /**
1878
+ * Row-level security policies.
1879
+ * Can be a single policy or an array of policies.
1880
+ */
1881
+ rcls?: TokenSecurityPolicy[] | TokenSecurityPolicy;
1882
+ /**
1883
+ * Parameter overrides and preferences (e.g., formatting).
1884
+ * Uses ResolvedTokenParams because backend ALWAYS includes calendarContext.
1885
+ */
1886
+ params?: ResolvedTokenParams;
1887
+ /**
1888
+ * UI behavior and feature flags.
1889
+ */
1890
+ config?: UIConfig;
1891
+ /**
1892
+ * Dataservice URL.
1893
+ */
1894
+ dataServiceUrl: string;
1895
+ /**
1896
+ * API service URL.
1897
+ */
1898
+ apiServiceUrl: string;
1899
+ };
1900
+
1901
+ /**
1902
+ * Main payload for generating a secure access token for a dashboard.
1903
+ */
1904
+ export declare type TokenRequest = {
1905
+ /**
1906
+ * Allowed semantic domains.
1907
+ */
1908
+ allowedSemanticDomains?: string[];
1909
+ /**
1910
+ * Type of the token request. Default is 'dashboard'.
1911
+ */
1912
+ type?: 'dashboard' | 'project';
1913
+ /**
1914
+ * Initial dashboard id to be accessed.
1915
+ */
1916
+ initialDashboardId?: string;
1917
+ /**
1918
+ * Identifier of the dashboard to be accessed.
1919
+ */
1920
+ dashboardId?: string;
1921
+ /**
1922
+ * Secret key used for validating access to the dashboard.
1923
+ */
1924
+ dashboardSecret?: string;
1925
+ /**
1926
+ * Unique identifier of the project.
1927
+ */
1928
+ projectId?: string;
1929
+ /**
1930
+ * Secret key used for validating access to the project.
1931
+ */
1932
+ projectSecret?: string;
1933
+ /**
1934
+ * Token expiry duration in seconds.
1935
+ */
1936
+ tokenExpiry?: number;
1937
+ /**
1938
+ * Unique identifier of the tenant.
1939
+ */
1940
+ tenantId?: string;
1941
+ /**
1942
+ * Unique identifier of the tenant user accessing the dashboard.
1943
+ */
1944
+ endUserId?: string;
1945
+ /**
1946
+ * Email of the tenant user (for personalization, audit, or identification).
1947
+ */
1948
+ endUserEmail?: string;
1949
+ /**
1950
+ * Unique identifier of the org user accessing the dashboard.
1951
+ */
1952
+ orgUserId?: string;
1953
+ /**
1954
+ * Email of the org user (for personalization, audit, or identification).
1955
+ */
1956
+ orgUserEmail?: string;
1957
+ /**
1958
+ * Display name of the end user.
1959
+ */
1960
+ displayName?: string;
1961
+ /**
1962
+ * Enables self-service editing and lens creation by the end user.
1963
+ */
1964
+ allowEdit?: boolean;
1965
+ /**
1966
+ * Schema level security policy. The schema name for the tenant.
1967
+ */
1968
+ sls?: string;
1969
+ /**
1970
+ * Connection-level security policies.
1971
+ * Can be a single policy or an array of policies.
1972
+ */
1973
+ cls?: TokenSecurityPolicy[] | TokenSecurityPolicy;
1974
+ /**
1975
+ * Row-level security policies.
1976
+ * Can be a single policy or an array of policies.
1977
+ */
1978
+ rcls?: TokenSecurityPolicy[] | TokenSecurityPolicy;
1979
+ /**
1980
+ * Parameter overrides and preferences (e.g., formatting).
1981
+ */
1982
+ params?: TokenParams;
1983
+ /**
1984
+ * UI behavior and feature flags.
1985
+ */
1986
+ config?: UIConfig;
1987
+ };
1988
+
1989
+ /**
1990
+ * Defines a security policy that can be applied at connection or row level.
1991
+ */
1992
+ export declare type TokenSecurityPolicy = {
1993
+ /**
1994
+ * Name of the policy (e.g., 'store_sales_primary', 'region_filter').
1995
+ */
1996
+ name: string;
1997
+ /**
1998
+ * Arbitrary parameters associated with the policy.
1999
+ * Examples:
2000
+ *
2001
+ * // Single value
2002
+ * {
2003
+ * tenant: 'tenant_abc_123'
2004
+ * }
2005
+ *
2006
+ * // Multiple values
2007
+ * {
2008
+ * state: ['California', 'Nevada', 'Washington']
2009
+ * }
2010
+ */
2011
+ params: {
2012
+ [key: string]: string | number | string[] | number[];
2013
+ };
2014
+ };
2015
+
1732
2016
  /** Point style options supported by Chart.js */
1733
2017
  export declare type TPointStyle = 'circle' | 'cross' | 'crossRot' | 'dash' | 'line' | 'rect' | 'rectRounded' | 'rectRot' | 'star' | 'triangle';
1734
2018
 
@@ -1750,6 +2034,31 @@ export declare type TStyle = {
1750
2034
  dark?: StyleProps;
1751
2035
  };
1752
2036
 
2037
+ /**
2038
+ * UI and behavior configuration for the embedded dashboard.
2039
+ */
2040
+ export declare type UIConfig = {
2041
+ /**
2042
+ * Enables self-service editing and lens creation by the end user. Legacy field. Use config.allowEdit instead.
2043
+ */
2044
+ allowEdit?: boolean;
2045
+ /**
2046
+ * Enables advanced mode features in the dashboard.
2047
+ * Defaults to true unless explicitly disabled.
2048
+ */
2049
+ showAdvancedMode?: boolean;
2050
+ /**
2051
+ * Enables the Info tab in the editor/explorer view.
2052
+ * Defaults to true unless explicitly disabled.
2053
+ */
2054
+ showInfoTab?: boolean;
2055
+ /**
2056
+ * Enables the AI-powered dashboard assistant.
2057
+ * Defaults to true unless explicitly disabled.
2058
+ */
2059
+ showDashboardAssistant?: boolean;
2060
+ };
2061
+
1753
2062
  export declare interface UpdateUserPreferenceRequest {
1754
2063
  defaultDashboardId: string | null;
1755
2064
  }
@@ -1832,4 +2141,12 @@ export declare type VisualDisplayPreferences = {
1832
2141
  };
1833
2142
  };
1834
2143
 
2144
+ /**
2145
+ * Week start day type.
2146
+ * 0 = Sunday (US, Canada, Japan)
2147
+ * 1 = Monday (ISO standard, most of Europe)
2148
+ * 6 = Saturday (Middle East)
2149
+ */
2150
+ export declare type WeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
2151
+
1835
2152
  export { }
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.182",
8
+ "version": "0.1.184",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -1 +0,0 @@
1
- "use strict";const pe={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"}},Pe=(e,t,n)=>{let r;const a=pe[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function U(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Se={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ke={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ie={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},We={date:U({formats:Se,defaultWidth:"full"}),time:U({formats:ke,defaultWidth:"full"}),dateTime:U({formats:Ie,defaultWidth:"full"})},ve={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ce=(e,t,n,r)=>ve[e];function P(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):s;a=e.formattingValues[o]||e.formattingValues[s]}else{const s=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[o]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const Fe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ee={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},He={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"]},$e={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"]},_e={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"}},Ue={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"}},Xe=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ze={ordinalNumber:Xe,era:P({values:Fe,defaultWidth:"wide"}),quarter:P({values:Ee,defaultWidth:"wide",argumentCallback:e=>e-1}),month:P({values:He,defaultWidth:"wide"}),day:P({values:$e,defaultWidth:"wide"}),dayPeriod:P({values:_e,defaultWidth:"wide",formattingValues:Ue,defaultFormattingWidth:"wide"})};function S(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const s=i[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(o)?Ze(o,y=>y.test(s)):Le(o,y=>y.test(s));let c;c=e.valueCallback?e.valueCallback(u):u,c=n.valueCallback?n.valueCallback(c):c;const l=t.slice(s.length);return{value:c,rest:l}}}function Le(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Ze(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function qe(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const o=t.slice(a.length);return{value:s,rest:o}}}const Re=/^(\d+)(th|st|nd|rd)?/i,Ae=/\d+/i,je={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},Qe={any:[/^b/i,/^(a|c)/i]},Ge={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Be={any:[/1/i,/2/i,/3/i,/4/i]},Ve={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},Je={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]},Ke={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},et={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]},tt={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},nt={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}},rt={ordinalNumber:qe({matchPattern:Re,parsePattern:Ae,valueCallback:e=>parseInt(e,10)}),era:S({matchPatterns:je,defaultMatchWidth:"wide",parsePatterns:Qe,defaultParseWidth:"any"}),quarter:S({matchPatterns:Ge,defaultMatchWidth:"wide",parsePatterns:Be,defaultParseWidth:"any",valueCallback:e=>e+1}),month:S({matchPatterns:Ve,defaultMatchWidth:"wide",parsePatterns:Je,defaultParseWidth:"any"}),day:S({matchPatterns:Ke,defaultMatchWidth:"wide",parsePatterns:et,defaultParseWidth:"any"}),dayPeriod:S({matchPatterns:tt,defaultMatchWidth:"any",parsePatterns:nt,defaultParseWidth:"any"})},ge={code:"en-US",formatDistance:Pe,formatLong:We,formatRelative:Ce,localize:ze,match:rt,options:{weekStartsOn:0,firstWeekContainsDate:1}};let at={};function p(){return at}const we=6048e5,it=864e5,De=6e4,j=36e5,W=43200,J=1440;function d(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function K(e){const t=d(e);return t.setHours(0,0,0,0),t}function F(e){const t=d(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function st(e,t){const n=K(e),r=K(t),a=+n-F(n),i=+r-F(r);return Math.round((a-i)/it)}function M(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function ot(e){const t=d(e),n=M(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ut(e){const t=d(e);return st(t,ot(t))+1}function I(e,t){var o,u,c,l;const n=p(),r=(t==null?void 0:t.weekStartsOn)??((u=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:u.weekStartsOn)??n.weekStartsOn??((l=(c=n.locale)==null?void 0:c.options)==null?void 0:l.weekStartsOn)??0,a=d(e),i=a.getDay(),s=(i<r?7:0)+i-r;return a.setDate(a.getDate()-s),a.setHours(0,0,0,0),a}function E(e){return I(e,{weekStartsOn:1})}function ye(e){const t=d(e),n=t.getFullYear(),r=M(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const a=E(r),i=M(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=E(i);return t.getTime()>=a.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function ct(e){const t=ye(e),n=M(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),E(n)}function ft(e){const t=d(e),n=+E(t)-+ct(t);return Math.round(n/we)+1}function be(e,t){var l,y,m,D;const n=d(e),r=n.getFullYear(),a=p(),i=(t==null?void 0:t.firstWeekContainsDate)??((y=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:y.firstWeekContainsDate)??a.firstWeekContainsDate??((D=(m=a.locale)==null?void 0:m.options)==null?void 0:D.firstWeekContainsDate)??1,s=M(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const o=I(s,t),u=M(e,0);u.setFullYear(r,0,i),u.setHours(0,0,0,0);const c=I(u,t);return n.getTime()>=o.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function dt(e,t){var o,u,c,l;const n=p(),r=(t==null?void 0:t.firstWeekContainsDate)??((u=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:u.firstWeekContainsDate)??n.firstWeekContainsDate??((l=(c=n.locale)==null?void 0:c.options)==null?void 0:l.firstWeekContainsDate)??1,a=be(e,t),i=M(e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),I(i,t)}function lt(e,t){const n=d(e),r=+I(n,t)-+dt(n,t);return Math.round(r/we)+1}function f(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const T={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return f(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):f(n+1,2)},d(e,t){return f(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return f(e.getHours()%12||12,t.length)},H(e,t){return f(e.getHours(),t.length)},m(e,t){return f(e.getMinutes(),t.length)},s(e,t){return f(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return f(a,t.length)}},x={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ee={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return T.y(e,t)},Y:function(e,t,n,r){const a=be(e,r),i=a>0?a:1-a;if(t==="YY"){const s=i%100;return f(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):f(i,t.length)},R:function(e,t){const n=ye(e);return f(n,t.length)},u:function(e,t){const n=e.getFullYear();return f(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return f(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return f(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return T.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return f(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=lt(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):f(a,t.length)},I:function(e,t,n){const r=ft(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):f(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):T.d(e,t)},D:function(e,t,n){const r=ut(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):f(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return f(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return f(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return f(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=x.noon:r===0?a=x.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=x.evening:r>=12?a=x.afternoon:r>=4?a=x.morning:a=x.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return T.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):T.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):f(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):f(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):T.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):T.s(e,t)},S:function(e,t){return T.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return ne(r);case"XXXX":case"XX":return O(r);case"XXXXX":case"XXX":default:return O(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return ne(r);case"xxxx":case"xx":return O(r);case"xxxxx":case"xxx":default:return O(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+te(r,":");case"OOOO":default:return"GMT"+O(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+te(r,":");case"zzzz":default:return"GMT"+O(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return f(r,t.length)},T:function(e,t,n){const r=e.getTime();return f(r,t.length)}};function te(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+f(i,2)}function ne(e,t){return e%60===0?(e>0?"-":"+")+f(Math.abs(e)/60,2):O(e,t)}function O(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=f(Math.trunc(r/60),2),i=f(r%60,2);return n+a+t+i}const re=(e,t)=>{switch(e){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"})}},Me=(e,t)=>{switch(e){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"})}},mt=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return re(e,t);let i;switch(r){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}}",re(r,t)).replace("{{time}}",Me(a,t))},ht={p:Me,P:mt},gt=/^D+$/,wt=/^Y+$/,Dt=["D","DD","YY","YYYY"];function yt(e){return gt.test(e)}function bt(e){return wt.test(e)}function Mt(e,t,n){const r=Tt(e,t,n);if(console.warn(r),Dt.includes(e))throw new RangeError(r)}function Tt(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Ot(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Nt(e){if(!Ot(e)&&typeof e!="number")return!1;const t=d(e);return!isNaN(Number(t))}const xt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Yt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,pt=/^'([^]*?)'?$/,Pt=/''/g,St=/[a-zA-Z]/;function Te(e,t,n){var l,y,m,D,b,N,B,V;const r=p(),a=(n==null?void 0:n.locale)??r.locale??ge,i=(n==null?void 0:n.firstWeekContainsDate)??((y=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:y.firstWeekContainsDate)??r.firstWeekContainsDate??((D=(m=r.locale)==null?void 0:m.options)==null?void 0:D.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((N=(b=n==null?void 0:n.locale)==null?void 0:b.options)==null?void 0:N.weekStartsOn)??r.weekStartsOn??((V=(B=r.locale)==null?void 0:B.options)==null?void 0:V.weekStartsOn)??0,o=d(e);if(!Nt(o))throw new RangeError("Invalid time value");let u=t.match(Yt).map(w=>{const g=w[0];if(g==="p"||g==="P"){const _=ht[g];return _(w,a.formatLong)}return w}).join("").match(xt).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const g=w[0];if(g==="'")return{isToken:!1,value:kt(w)};if(ee[g])return{isToken:!0,value:w};if(g.match(St))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:w}});a.localize.preprocessor&&(u=a.localize.preprocessor(o,u));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:a};return u.map(w=>{if(!w.isToken)return w.value;const g=w.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&bt(g)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&yt(g))&&Mt(g,t,String(e));const _=ee[g[0]];return _(o,g,a.localize,c)}).join("")}function kt(e){const t=e.match(pt);return t?t[1].replace(Pt,"'"):e}function C(e,t){const n=d(e),r=d(t),a=n.getTime()-r.getTime();return a<0?-1:a>0?1:a}function It(e){return M(e,Date.now())}function Wt(e,t){const n=d(e),r=d(t),a=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return a*12+i}function vt(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Ct(e,t){return+d(e)-+d(t)}function Ft(e){const t=d(e);return t.setHours(23,59,59,999),t}function Et(e){const t=d(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function Ht(e){const t=d(e);return+Ft(t)==+Et(t)}function $t(e,t){const n=d(e),r=d(t),a=C(n,r),i=Math.abs(Wt(n,r));let s;if(i<1)s=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-a*i);let o=C(n,r)===-a;Ht(d(e))&&i===1&&C(e,r)===1&&(o=!1),s=a*(i-Number(o))}return s===0?0:s}function _t(e,t,n){const r=Ct(e,t)/1e3;return vt(n==null?void 0:n.roundingMethod)(r)}function Ut(e,t,n){const r=p(),a=(n==null?void 0:n.locale)??r.locale??ge,i=2520,s=C(e,t);if(isNaN(s))throw new RangeError("Invalid time value");const o=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:s});let u,c;s>0?(u=d(t),c=d(e)):(u=d(e),c=d(t));const l=_t(c,u),y=(F(c)-F(u))/1e3,m=Math.round((l-y)/60);let D;if(m<2)return n!=null&&n.includeSeconds?l<5?a.formatDistance("lessThanXSeconds",5,o):l<10?a.formatDistance("lessThanXSeconds",10,o):l<20?a.formatDistance("lessThanXSeconds",20,o):l<40?a.formatDistance("halfAMinute",0,o):l<60?a.formatDistance("lessThanXMinutes",1,o):a.formatDistance("xMinutes",1,o):m===0?a.formatDistance("lessThanXMinutes",1,o):a.formatDistance("xMinutes",m,o);if(m<45)return a.formatDistance("xMinutes",m,o);if(m<90)return a.formatDistance("aboutXHours",1,o);if(m<J){const b=Math.round(m/60);return a.formatDistance("aboutXHours",b,o)}else{if(m<i)return a.formatDistance("xDays",1,o);if(m<W){const b=Math.round(m/J);return a.formatDistance("xDays",b,o)}else if(m<W*2)return D=Math.round(m/W),a.formatDistance("aboutXMonths",D,o)}if(D=$t(c,u),D<12){const b=Math.round(m/W);return a.formatDistance("xMonths",b,o)}else{const b=D%12,N=Math.trunc(D/12);return b<3?a.formatDistance("aboutXYears",N,o):b<9?a.formatDistance("overXYears",N,o):a.formatDistance("almostXYears",N+1,o)}}function Xt(e,t){return Ut(e,It(e),t)}function zt(){return Object.assign({},p())}function Lt(e,t){const r=At(e);let a;if(r.date){const u=jt(r.date,2);a=Qt(u.restDateString,u.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);const i=a.getTime();let s=0,o;if(r.time&&(s=Gt(r.time),isNaN(s)))return new Date(NaN);if(r.timezone){if(o=Bt(r.timezone),isNaN(o))return new Date(NaN)}else{const u=new Date(i+s),c=new Date(0);return c.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),c.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),c}return new Date(i+s+o)}const v={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Zt=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,qt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Rt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function At(e){const t={},n=e.split(v.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],v.timeZoneDelimiter.test(t.date)&&(t.date=e.split(v.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const a=v.timezone.exec(r);a?(t.time=r.replace(a[1],""),t.timezone=a[1]):t.time=r}return t}function jt(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?a:i*100,restDateString:e.slice((r[1]||r[2]).length)}}function Qt(e,t){if(t===null)return new Date(NaN);const n=e.match(Zt);if(!n)return new Date(NaN);const r=!!n[4],a=k(n[1]),i=k(n[2])-1,s=k(n[3]),o=k(n[4]),u=k(n[5])-1;if(r)return tn(t,o,u)?Vt(t,o,u):new Date(NaN);{const c=new Date(0);return!Kt(t,i,s)||!en(t,a)?new Date(NaN):(c.setUTCFullYear(t,i,Math.max(a,s)),c)}}function k(e){return e?parseInt(e):1}function Gt(e){const t=e.match(qt);if(!t)return NaN;const n=X(t[1]),r=X(t[2]),a=X(t[3]);return nn(n,r,a)?n*j+r*De+a*1e3:NaN}function X(e){return e&&parseFloat(e.replace(",","."))||0}function Bt(e){if(e==="Z")return 0;const t=e.match(Rt);if(!t)return 0;const n=t[1]==="+"?-1:1,r=parseInt(t[2]),a=t[3]&&parseInt(t[3])||0;return rn(r,a)?n*(r*j+a*De):NaN}function Vt(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const a=r.getUTCDay()||7,i=(t-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const Jt=[31,null,31,30,31,30,31,31,30,31,30,31];function Oe(e){return e%400===0||e%4===0&&e%100!==0}function Kt(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Jt[t]||(Oe(e)?29:28))}function en(e,t){return t>=1&&t<=(Oe(e)?366:365)}function tn(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function nn(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function rn(e,t){return t>=0&&t<=59}function ae(e,t,n){const r=zt(),a=on(e,n.timeZone,n.locale??r.locale);return"formatToParts"in a?an(a,t):sn(a,t)}function an(e,t){const n=e.formatToParts(t);for(let r=n.length-1;r>=0;--r)if(n[r].type==="timeZoneName")return n[r].value}function sn(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(n);return r?r[0].substr(1):""}function on(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function un(e,t){const n=mn(t);return"formatToParts"in n?fn(n,e):dn(n,e)}const cn={year:0,month:1,day:2,hour:3,minute:4,second:5};function fn(e,t){try{const n=e.formatToParts(t),r=[];for(let a=0;a<n.length;a++){const i=cn[n[a].type];i!==void 0&&(r[i]=parseInt(n[a].value,10))}return r}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function dn(e,t){const n=e.format(t),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(r[3],10),parseInt(r[1],10),parseInt(r[2],10),parseInt(r[4],10),parseInt(r[5],10),parseInt(r[6],10)]}const z={},ie=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),ln=ie==="06/25/2014, 00:00:00"||ie==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function mn(e){return z[e]||(z[e]=ln?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),z[e]}function Q(e,t,n,r,a,i,s){const o=new Date(0);return o.setUTCFullYear(e,t,n),o.setUTCHours(r,a,i,s),o}const se=36e5,hn=6e4,L={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function $(e,t,n){if(!e)return 0;let r=L.timezoneZ.exec(e);if(r)return 0;let a,i;if(r=L.timezoneHH.exec(e),r)return a=parseInt(r[1],10),oe(a)?-(a*se):NaN;if(r=L.timezoneHHMM.exec(e),r){a=parseInt(r[2],10);const s=parseInt(r[3],10);return oe(a,s)?(i=Math.abs(a)*se+s*hn,r[1]==="+"?-i:i):NaN}if(Dn(e)){t=new Date(t||Date.now());const s=n?t:gn(t),o=A(s,e);return-(n?o:wn(t,o,e))}return NaN}function gn(e){return Q(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function A(e,t){const n=un(e,t),r=Q(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let a=e.getTime();const i=a%1e3;return a-=i>=0?i:1e3+i,r-a}function wn(e,t,n){let a=e.getTime()-t;const i=A(new Date(a),n);if(t===i)return t;a-=i-t;const s=A(new Date(a),n);return i===s?i:Math.max(i,s)}function oe(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const ue={};function Dn(e){if(ue[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),ue[e]=!0,!0}catch{return!1}}const yn=60*1e3,bn={X:function(e,t,n){const r=Z(n.timeZone,e);if(r===0)return"Z";switch(t){case"X":return ce(r);case"XXXX":case"XX":return Y(r);case"XXXXX":case"XXX":default:return Y(r,":")}},x:function(e,t,n){const r=Z(n.timeZone,e);switch(t){case"x":return ce(r);case"xxxx":case"xx":return Y(r);case"xxxxx":case"xxx":default:return Y(r,":")}},O:function(e,t,n){const r=Z(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+Mn(r,":");case"OOOO":default:return"GMT"+Y(r,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return ae("short",e,n);case"zzzz":default:return ae("long",e,n)}}};function Z(e,t){const n=e?$(e,t,!0)/yn:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function H(e,t){const n=e<0?"-":"";let r=Math.abs(e).toString();for(;r.length<t;)r="0"+r;return n+r}function Y(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=H(Math.floor(r/60),2),i=H(Math.floor(r%60),2);return n+a+t+i}function ce(e,t){return e%60===0?(e>0?"-":"+")+H(Math.abs(e)/60,2):Y(e,t)}function Mn(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+H(i,2)}function fe(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const Ne=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,q=36e5,de=6e4,Tn=2,h={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Ne};function G(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?Tn:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const r=On(e),{year:a,restDateString:i}=Nn(r.date,n),s=xn(i,a);if(s===null||isNaN(s.getTime()))return new Date(NaN);if(s){const o=s.getTime();let u=0,c;if(r.time&&(u=Yn(r.time),u===null||isNaN(u)))return new Date(NaN);if(r.timeZone||t.timeZone){if(c=$(r.timeZone||t.timeZone,new Date(o+u)),isNaN(c))return new Date(NaN)}else c=fe(new Date(o+u)),c=fe(new Date(o+u+c));return new Date(o+u+c)}else return new Date(NaN)}function On(e){const t={};let n=h.dateTimePattern.exec(e),r;if(n?(t.date=n[1],r=n[3]):(n=h.datePattern.exec(e),n?(t.date=n[1],r=n[2]):(t.date=null,r=e)),r){const a=h.timeZone.exec(r);a?(t.time=r.replace(a[1],""),t.timeZone=a[1].trim()):t.time=r}return t}function Nn(e,t){if(e){const n=h.YYY[t],r=h.YYYYY[t];let a=h.YYYY.exec(e)||r.exec(e);if(a){const i=a[1];return{year:parseInt(i,10),restDateString:e.slice(i.length)}}if(a=h.YY.exec(e)||n.exec(e),a){const i=a[1];return{year:parseInt(i,10)*100,restDateString:e.slice(i.length)}}}return{year:null}}function xn(e,t){if(t===null)return null;let n,r,a;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let i=h.MM.exec(e);if(i)return n=new Date(0),r=parseInt(i[1],10)-1,me(t,r)?(n.setUTCFullYear(t,r),n):new Date(NaN);if(i=h.DDD.exec(e),i){n=new Date(0);const s=parseInt(i[1],10);return Sn(t,s)?(n.setUTCFullYear(t,0,s),n):new Date(NaN)}if(i=h.MMDD.exec(e),i){n=new Date(0),r=parseInt(i[1],10)-1;const s=parseInt(i[2],10);return me(t,r,s)?(n.setUTCFullYear(t,r,s),n):new Date(NaN)}if(i=h.Www.exec(e),i)return a=parseInt(i[1],10)-1,he(a)?le(t,a):new Date(NaN);if(i=h.WwwD.exec(e),i){a=parseInt(i[1],10)-1;const s=parseInt(i[2],10)-1;return he(a,s)?le(t,a,s):new Date(NaN)}return null}function Yn(e){let t,n,r=h.HH.exec(e);if(r)return t=parseFloat(r[1].replace(",",".")),R(t)?t%24*q:NaN;if(r=h.HHMM.exec(e),r)return t=parseInt(r[1],10),n=parseFloat(r[2].replace(",",".")),R(t,n)?t%24*q+n*de:NaN;if(r=h.HHMMSS.exec(e),r){t=parseInt(r[1],10),n=parseInt(r[2],10);const a=parseFloat(r[3].replace(",","."));return R(t,n,a)?t%24*q+n*de+a*1e3:NaN}return null}function le(e,t,n){t=t||0,n=n||0;const r=new Date(0);r.setUTCFullYear(e,0,4);const a=r.getUTCDay()||7,i=t*7+n+1-a;return r.setUTCDate(r.getUTCDate()+i),r}const pn=[31,28,31,30,31,30,31,31,30,31,30,31],Pn=[31,29,31,30,31,30,31,31,30,31,30,31];function xe(e){return e%400===0||e%4===0&&e%100!==0}function me(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const r=xe(e);if(r&&n>Pn[t]||!r&&n>pn[t])return!1}return!0}function Sn(e,t){if(t<1)return!1;const n=xe(e);return!(n&&t>366||!n&&t>365)}function he(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function R(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const kn=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function In(e,t,n={}){t=String(t);const r=t.match(kn);if(r){const a=G(n.originalDate||e,n);t=r.reduce(function(i,s){if(s[0]==="'")return i;const o=i.indexOf(s),u=i[o-1]==="'",c=i.replace(s,"'"+bn[s[0]](a,s,n)+"'");return u?c.substring(0,o-1)+c.substring(o+1):c},t)}return Te(e,t,n)}function Ye(e,t,n){e=G(e,n);const r=$(t,e,!0),a=new Date(e.getTime()-r),i=new Date(0);return i.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),i.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),i}function Wn(e,t,n,r){return r={...r,timeZone:t,originalDate:e},In(Ye(e,t,{timeZone:r.timeZone}),n,r)}exports.constructFrom=M;exports.format=Te;exports.formatDistanceToNow=Xt;exports.formatInTimeZone=Wn;exports.millisecondsInHour=j;exports.newDateUTC=Q;exports.parseISO=Lt;exports.toDate=d;exports.toDate$1=G;exports.toZonedTime=Ye;exports.tzParseTimezone=$;exports.tzPattern=Ne;