@televet/kibble-ui 5.0.18 → 5.0.20-alpha.hunter.1
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/chunks/alert.types-BlvzpzTn.js +2 -0
- package/dist/chunks/alert.types-BlvzpzTn.js.map +1 -0
- package/dist/chunks/{alert.types-DWm1TeiF.js → alert.types-C6EN46Ra.js} +39 -38
- package/dist/chunks/alert.types-C6EN46Ra.js.map +1 -0
- package/dist/chunks/{calendar.component-D9LIca6x.js → calendar.component-B0HGQGw3.js} +2 -2
- package/dist/chunks/{calendar.component-D9LIca6x.js.map → calendar.component-B0HGQGw3.js.map} +1 -1
- package/dist/chunks/{calendar.component-D7TVct1c.js → calendar.component-BLTCblkg.js} +2 -2
- package/dist/chunks/{calendar.component-D7TVct1c.js.map → calendar.component-BLTCblkg.js.map} +1 -1
- package/dist/chunks/{datePicker.component-WeEU0Azt.js → datePicker.component-B8ztlVdE.js} +2 -2
- package/dist/chunks/{datePicker.component-WeEU0Azt.js.map → datePicker.component-B8ztlVdE.js.map} +1 -1
- package/dist/chunks/{datePicker.component-CghreQgn.js → datePicker.component-BsXWNm5Q.js} +2 -2
- package/dist/chunks/{datePicker.component-CghreQgn.js.map → datePicker.component-BsXWNm5Q.js.map} +1 -1
- package/dist/chunks/datePicker.provider-Cxvup47n.js +15 -0
- package/dist/chunks/{datePicker.provider-D9VYbH7E.js.map → datePicker.provider-Cxvup47n.js.map} +1 -1
- package/dist/chunks/{datePicker.provider-yBypj_PJ.js → datePicker.provider-Dzj41st3.js} +750 -747
- package/dist/chunks/{datePicker.provider-yBypj_PJ.js.map → datePicker.provider-Dzj41st3.js.map} +1 -1
- package/dist/chunks/{dateTimePicker.component-xTm3GhQr.js → dateTimePicker.component-DIEHmckk.js} +2 -2
- package/dist/chunks/{dateTimePicker.component-xTm3GhQr.js.map → dateTimePicker.component-DIEHmckk.js.map} +1 -1
- package/dist/chunks/{dateTimePicker.component-BYBPNCJQ.js → dateTimePicker.component-DXL7Masq.js} +3 -3
- package/dist/chunks/{dateTimePicker.component-BYBPNCJQ.js.map → dateTimePicker.component-DXL7Masq.js.map} +1 -1
- package/dist/chunks/tab.types-B8hOk0uV.js.map +1 -1
- package/dist/chunks/{tab.types-BH-Fnaz2.js → tab.types-BiDpSKGC.js} +2 -11
- package/dist/chunks/{tab.types-BH-Fnaz2.js.map → tab.types-BiDpSKGC.js.map} +1 -1
- package/dist/chunks/timePicker.component-CKv8DkMc.js +2 -0
- package/dist/chunks/timePicker.component-CKv8DkMc.js.map +1 -0
- package/dist/chunks/timePicker.component-DpiJ26SR.js +222 -0
- package/dist/chunks/timePicker.component-DpiJ26SR.js.map +1 -0
- package/dist/chunks/{timeRange.component-NX1EOY8h.js → timeRange.component-CsB9u0D-.js} +2 -2
- package/dist/chunks/{timeRange.component-NX1EOY8h.js.map → timeRange.component-CsB9u0D-.js.map} +1 -1
- package/dist/chunks/{timeRange.component-B1WKwc-X.js → timeRange.component-DAozGOj9.js} +2 -2
- package/dist/chunks/{timeRange.component-B1WKwc-X.js.map → timeRange.component-DAozGOj9.js.map} +1 -1
- package/dist/cjs/components/Alert/index.cjs +1 -1
- package/dist/cjs/components/Calendar/index.cjs +1 -1
- package/dist/cjs/components/DatePicker/index.cjs +1 -1
- package/dist/cjs/components/DateTimePicker/index.cjs +1 -1
- package/dist/cjs/components/TimePicker/index.cjs +1 -1
- package/dist/cjs/components/TimeRange/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/Alert/index.js +1 -1
- package/dist/esm/components/Calendar/index.js +1 -1
- package/dist/esm/components/DatePicker/index.js +2 -2
- package/dist/esm/components/DateTimePicker/index.js +1 -1
- package/dist/esm/components/Tabs/index.js +1 -1
- package/dist/esm/components/TimePicker/index.js +1 -1
- package/dist/esm/components/TimeRange/index.js +1 -1
- package/dist/esm/components/index.js +8 -8
- package/dist/esm/index.js +8 -8
- package/dist/types/components/Alert/alert.component.d.ts +4 -1
- package/dist/types/components/DatePicker/context/datePicker.provider.d.ts +2 -1
- package/dist/types/components/TimePicker/timePicker.component.d.ts +2 -1
- package/package.json +3 -2
- package/dist/chunks/alert.types-Ch8hn5HY.js +0 -2
- package/dist/chunks/alert.types-Ch8hn5HY.js.map +0 -1
- package/dist/chunks/alert.types-DWm1TeiF.js.map +0 -1
- package/dist/chunks/datePicker.provider-D9VYbH7E.js +0 -15
- package/dist/chunks/timePicker.component-CDb67FCr.js +0 -220
- package/dist/chunks/timePicker.component-CDb67FCr.js.map +0 -1
- package/dist/chunks/timePicker.component-CIk5bEyP.js +0 -2
- package/dist/chunks/timePicker.component-CIk5bEyP.js.map +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { A as a, a as e } from "../chunks/alert.types-
|
|
1
|
+
import { A as a, a as e } from "../chunks/alert.types-C6EN46Ra.js";
|
|
2
2
|
import { A as s } from "../chunks/avatar.component-BL6D6Lw_.js";
|
|
3
3
|
import { a as i, b as m } from "../chunks/avatar.types-C6dZZjdi.js";
|
|
4
4
|
import { A as x } from "../chunks/avatarGroup.component-Ba_rfWUg.js";
|
|
5
5
|
import { B as c } from "../chunks/button.component-BO6oee_V.js";
|
|
6
6
|
import { b as d, d as u, c as T, e as S, a as b } from "../chunks/button.types-BjfcUcMn.js";
|
|
7
7
|
import { B as g } from "../chunks/buttonGroup.component-BNOBvOyv.js";
|
|
8
|
-
import { C as D } from "../chunks/calendar.component-
|
|
8
|
+
import { C as D } from "../chunks/calendar.component-B0HGQGw3.js";
|
|
9
9
|
import { C as h } from "../chunks/card.component-B1AznjWF.js";
|
|
10
10
|
import { c as y } from "../chunks/card.types-Cixp7ouC.js";
|
|
11
11
|
import { C as z } from "../chunks/characterCounter.component-DI_FQNUR.js";
|
|
12
12
|
import { W as V } from "../chunks/checkbox.component-DDsVfE4a.js";
|
|
13
13
|
import { W as B } from "../chunks/checkboxGroup.component-Cx2Gvii5.js";
|
|
14
14
|
import { C as I } from "../chunks/conversationCard.component-D7hpX-QG.js";
|
|
15
|
-
import { D as R } from "../chunks/datePicker.component-
|
|
16
|
-
import { D as K } from "../chunks/datePicker.provider-
|
|
17
|
-
import { D as O, a as F, c as H } from "../chunks/dateTimePicker.component-
|
|
15
|
+
import { D as R } from "../chunks/datePicker.component-B8ztlVdE.js";
|
|
16
|
+
import { D as K } from "../chunks/datePicker.provider-Dzj41st3.js";
|
|
17
|
+
import { D as O, a as F, c as H } from "../chunks/dateTimePicker.component-DXL7Masq.js";
|
|
18
18
|
import { D as q } from "../chunks/divider.component-CFOh4Nw3.js";
|
|
19
19
|
import { d as J, a as Q, b as U } from "../chunks/divider.types-6MEkMNbx.js";
|
|
20
20
|
import { W as Y } from "../chunks/heading.component-CpSAN3cv.js";
|
|
@@ -41,15 +41,15 @@ import { s as Uo } from "../chunks/spinner.types-g7cTFJkb.js";
|
|
|
41
41
|
import { S as Yo, s as Zo } from "../chunks/styledAvatar.types-BaOkOA8K.js";
|
|
42
42
|
import { S as $o, s as or } from "../chunks/swatch.types-CkrkMi11.js";
|
|
43
43
|
import { W as ar } from "../chunks/switch.component-Cr8Abw0U.js";
|
|
44
|
-
import { T as tr, a as sr, t as pr } from "../chunks/tab.types-
|
|
44
|
+
import { T as tr, a as sr, t as pr } from "../chunks/tab.types-BiDpSKGC.js";
|
|
45
45
|
import { T as mr } from "../chunks/tag.component-B7V76XfM.js";
|
|
46
46
|
import { c as xr, t as nr } from "../chunks/tag.types-B-pzEt1I.js";
|
|
47
47
|
import { T as lr, a as dr } from "../chunks/tagBlock.component-DjbevH0J.js";
|
|
48
48
|
import { W as Tr } from "../chunks/text.component-DhuUgP3j.js";
|
|
49
49
|
import { W as br } from "../chunks/textInput.component-C7kdQ8hF.js";
|
|
50
50
|
import { W as gr } from "../chunks/textarea.component-W9VBnd4-.js";
|
|
51
|
-
import { M as Dr, T as Pr } from "../chunks/timePicker.component-
|
|
52
|
-
import { T as kr } from "../chunks/timeRange.component-
|
|
51
|
+
import { M as Dr, T as Pr } from "../chunks/timePicker.component-DpiJ26SR.js";
|
|
52
|
+
import { T as kr } from "../chunks/timeRange.component-DAozGOj9.js";
|
|
53
53
|
import { T as Wr } from "../chunks/timestamp.component-DkLjxUsy.js";
|
|
54
54
|
import { useToast as Mr } from "./components/Toast/index.js";
|
|
55
55
|
import { T as Ar } from "../chunks/tooltip.component-CHohp2qn.js";
|
|
@@ -5,6 +5,7 @@ import { IconProps } from '../Icon/icon.component';
|
|
|
5
5
|
import { TextProps } from '../Text/text.component';
|
|
6
6
|
import { Status } from '../../shared/types/status';
|
|
7
7
|
import { AlertButtonProps } from './components/AlertButton/alertButton.component';
|
|
8
|
+
import { IconName } from '../Icon/icon.types';
|
|
8
9
|
export interface AlertProps extends Omit<CAlert.RootProps, 'title' | 'status' | 'children' | 'variant' | 'size'> {
|
|
9
10
|
/** Props to customize the alert button. */
|
|
10
11
|
buttonProps?: AlertButtonProps;
|
|
@@ -40,9 +41,11 @@ export interface AlertProps extends Omit<CAlert.RootProps, 'title' | 'status' |
|
|
|
40
41
|
title?: React.ReactNode;
|
|
41
42
|
/** Props to customize the title when passed as a string. */
|
|
42
43
|
titleProps?: HeadingProps;
|
|
44
|
+
/** The name of the icon to be used as the close button. */
|
|
45
|
+
closeButtonIcon?: IconName;
|
|
43
46
|
/** Data test id for the alert.
|
|
44
47
|
* @default kibble-alert
|
|
45
48
|
*/
|
|
46
49
|
'data-testid'?: string;
|
|
47
50
|
}
|
|
48
|
-
export declare const Alert: ({ buttonProps, description, descriptionProps, hideCloseButton, hideIcon, iconProps, onClose, onContrast, status, title, titleProps, ["data-testid"]: dataTestId, ...rest }: AlertProps) => React.JSX.Element;
|
|
51
|
+
export declare const Alert: ({ buttonProps, description, descriptionProps, hideCloseButton, hideIcon, iconProps, onClose, onContrast, status, title, titleProps, closeButtonIcon, ["data-testid"]: dataTestId, ...rest }: AlertProps) => React.JSX.Element;
|
|
@@ -6,11 +6,12 @@ type DatePickerProviderProps = DatePickerProps & {
|
|
|
6
6
|
numberOfMonths?: number;
|
|
7
7
|
sameWidth?: boolean;
|
|
8
8
|
standalone?: boolean;
|
|
9
|
+
timezone?: string;
|
|
9
10
|
};
|
|
10
11
|
export interface DatePickerInternalState {
|
|
11
12
|
startDate: Date | null;
|
|
12
13
|
endDate: Date | null;
|
|
13
14
|
focusedInput: FocusedInput | null;
|
|
14
15
|
}
|
|
15
|
-
export declare const DatePickerProvider: ({ children, dateFormat, endDate, inputProps, maxDate, maxDaysInRange, maxYear, minDate, minYear, numberOfMonths, onDateChange, placement, startDate, withDateRange, sameWidth, standalone, firstDayOfWeek, }: DatePickerProviderProps) => React.JSX.Element;
|
|
16
|
+
export declare const DatePickerProvider: ({ children, dateFormat, endDate, inputProps, maxDate, maxDaysInRange, maxYear, minDate, minYear, numberOfMonths, onDateChange, placement, startDate, withDateRange, sameWidth, standalone, firstDayOfWeek, timezone, }: DatePickerProviderProps) => React.JSX.Element;
|
|
16
17
|
export {};
|
|
@@ -20,10 +20,11 @@ export interface TimePickerProps {
|
|
|
20
20
|
* @default bottom
|
|
21
21
|
*/
|
|
22
22
|
placement?: Placement;
|
|
23
|
+
timezone?: string;
|
|
23
24
|
/**
|
|
24
25
|
* Data test id for the time picker.
|
|
25
26
|
* @default kibble-timepicker
|
|
26
27
|
*/
|
|
27
28
|
'data-testid'?: string;
|
|
28
29
|
}
|
|
29
|
-
export declare const TimePicker: ({ initialTime, inputProps, minuteInterval, onTimeChange, onClose, placement, ["data-testid"]: dataTestId, }: TimePickerProps) => React.JSX.Element;
|
|
30
|
+
export declare const TimePicker: ({ initialTime, inputProps, minuteInterval, onTimeChange, onClose, placement, timezone, ["data-testid"]: dataTestId, }: TimePickerProps) => React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@televet/kibble-ui",
|
|
3
3
|
"description": "Kibble Design System by Otto",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.20-alpha.hunter.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/index.cjs",
|
|
7
7
|
"module": "./dist/esm/index.js",
|
|
@@ -173,7 +173,8 @@
|
|
|
173
173
|
"@emotion/react": "^11.14.0",
|
|
174
174
|
"date-fns": "^4.1.0",
|
|
175
175
|
"lodash-es": "^4.17.21",
|
|
176
|
-
"react": "^19.0.0"
|
|
176
|
+
"react": "^19.0.0",
|
|
177
|
+
"@date-fns/tz": "^1.4.1"
|
|
177
178
|
},
|
|
178
179
|
"dependencies": {
|
|
179
180
|
"@chakra-ui/react": "^3.24.0",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./jsx-runtime-BjDatQAs.js"),j=require("react"),v=require("./heading.component-DnoZOXdz.js"),y=require("./icon.component-B1hr5lLa.js"),C=require("./text.component-BDDz5KQP.js"),g=require("./button.component-DjdgBXDC.js"),A=require("./flex-BOU6tYUd.js"),f=require("../cjs/shared/records/index.cjs"),q=require("./provider-NDo8kOkE.js"),N=require("./create-slot-recipe-context-HXE1VazG.js"),S=require("./factory-a2SJjEvR.js"),l=require("./icons-B6Nwr9di.js"),w=t=>t&&t.__esModule?t:{default:t},B=w(j),[k,I]=q.createContext({name:"AlertStatusContext",hookName:"useAlertStatusContext",providerName:"<Alert />"}),{withProvider:W,withContext:R,useStyles:z}=N.createSlotRecipeContext({key:"alert"}),$=W("div","root",{forwardAsChild:!0,wrapElement(t,s){return e.jsxRuntimeExports.jsx(k,{value:{status:s.status||"info"},children:t})}}),b=R("div","title"),F=R("div","description"),M=R("div","content"),D={info:l.InfoIcon,warning:l.WarningIcon,success:l.CheckCircleIcon,error:l.WarningIcon,neutral:l.InfoIcon},H=j.forwardRef(function(s,a){const i=I(),r=z(),x=typeof i.status=="string"?D[i.status]:j.Fragment,{children:u=e.jsxRuntimeExports.jsx(x,{}),...n}=s;return e.jsxRuntimeExports.jsx(S.chakra.span,{ref:a,...n,css:[r.indicator,s.css],children:u})}),p=({buttonPosition:t="topRight",buttonText:s,status:a,["data-testid"]:i="kibble-alert-button",...r})=>e.jsxRuntimeExports.jsx(A.Flex,{className:"Alert__Button","data-testid":i,...t!=="topRight"&&{pt:2,pb:1},...t==="bottomRight"&&{justifyContent:"flex-end"},children:e.jsxRuntimeExports.jsx(g.Button,{size:"xs",variant:a==="default"?"primary":"secondary",w:"max-content",...r,children:s})}),L=({buttonProps:t,description:s,descriptionProps:a,hideCloseButton:i=!1,hideIcon:r=!1,iconProps:x,onClose:u,onContrast:n=!1,status:o="success",title:d,titleProps:_,["data-testid"]:c="kibble-alert",...E})=>{t&&!t.buttonPosition&&(t.buttonPosition="topRight");const m=t&&t.buttonPosition==="topRight",h=m?A.Flex:B.default.Fragment;return e.jsxRuntimeExports.jsxs($,{className:"Alert","data-testid":c,...E,variant:o,hideIcon:r,onContrast:n,children:[!r&&e.jsxRuntimeExports.jsx(H,{className:"Alert__Icon","data-testid":`${c}-icon`,children:e.jsxRuntimeExports.jsx(y.Icon,{variant:n?"onContrast":f.StatusTypographyMap[o],name:x?.name||f.StatusIconMap[o],size:"lg",...x})}),e.jsxRuntimeExports.jsxs(M,{className:"Alert__Content","data-testid":`${c}-content`,children:[d&&e.jsxRuntimeExports.jsxs(h,{...m&&{justifyContent:"space-between",gap:2},children:[e.jsxRuntimeExports.jsx(b,{className:"Alert__Title","data-testid":`${c}-title`,children:e.jsxRuntimeExports.jsx(v.WrappedHeading,{size:"sm",variant:n?"onContrast":"default",..._,children:d})}),t&&t.buttonPosition==="topRight"&&e.jsxRuntimeExports.jsx(p,{status:o,onContrast:n,...t})]}),s&&e.jsxRuntimeExports.jsxs(h,{...m&&{justifyContent:"space-between"},children:[e.jsxRuntimeExports.jsx(F,{className:"Alert__Description","data-testid":`${c}-description`,children:typeof s=="string"?e.jsxRuntimeExports.jsx(C.WrappedText,{size:"md",variant:n?"onContrast":"default",...a,children:s}):s}),t&&t.buttonPosition==="topRight"&&!d&&e.jsxRuntimeExports.jsx(p,{status:o,onContrast:n,...t})]}),t&&t?.buttonPosition!=="topRight"&&e.jsxRuntimeExports.jsx(p,{status:o,onContrast:n,...t})]}),!i&&e.jsxRuntimeExports.jsx(g.Button,{className:"Alert__CloseTrigger","data-testid":`${c}-close-trigger`,iconName:"close",size:"xs",variant:"ghostNeutral",onContrast:n,onClick:u})]})},T=["topRight","bottomLeft","bottomRight"];exports.Alert=L;exports.alertButtonPositions=T;
|
|
2
|
-
//# sourceMappingURL=alert.types-Ch8hn5HY.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alert.types-Ch8hn5HY.js","sources":["../../node_modules/@chakra-ui/react/dist/esm/components/alert/alert.js","../../src/components/Alert/components/AlertButton/alertButton.component.tsx","../../src/components/Alert/alert.component.tsx","../../src/components/Alert/alert.types.ts"],"sourcesContent":["\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { forwardRef, Fragment } from 'react';\nimport { createContext } from '../../create-context.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { InfoIcon, WarningIcon, CheckCircleIcon } from '../icons.js';\n\nconst [AlertStatusProvider, useAlertStatusContext] = createContext({\n name: \"AlertStatusContext\",\n hookName: \"useAlertStatusContext\",\n providerName: \"<Alert />\"\n});\nconst {\n withProvider,\n withContext,\n useStyles: useAlertStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"alert\" });\nconst AlertRoot = withProvider(\n \"div\",\n \"root\",\n {\n forwardAsChild: true,\n wrapElement(element, props) {\n return (\n // @ts-ignore fix later\n /* @__PURE__ */ jsx(AlertStatusProvider, { value: { status: props.status || \"info\" }, children: element })\n );\n }\n }\n);\nconst AlertPropsProvider = PropsProvider;\nconst AlertTitle = withContext(\n \"div\",\n \"title\"\n);\nconst AlertDescription = withContext(\"div\", \"description\");\nconst AlertContent = withContext(\n \"div\",\n \"content\"\n);\nconst iconMap = {\n info: InfoIcon,\n warning: WarningIcon,\n success: CheckCircleIcon,\n error: WarningIcon,\n neutral: InfoIcon\n};\nconst AlertIndicator = forwardRef(\n function AlertIndicator2(props, ref) {\n const api = useAlertStatusContext();\n const styles = useAlertStyles();\n const Icon = typeof api.status === \"string\" ? iconMap[api.status] : Fragment;\n const { children = /* @__PURE__ */ jsx(Icon, {}), ...rest } = props;\n return /* @__PURE__ */ jsx(chakra.span, { ref, ...rest, css: [styles.indicator, props.css], children });\n }\n);\n\nexport { AlertContent, AlertDescription, AlertIndicator, AlertPropsProvider, AlertRoot, AlertStatusProvider, AlertTitle, useAlertStatusContext, useAlertStyles };\n","import React from 'react';\nimport { AlertButtonPosition } from 'components/Alert/alert.types';\nimport { Button, ButtonProps } from 'components/Button/button.component';\nimport { Status } from 'shared/types/status';\nimport { Flex } from '@chakra-ui/react/flex';\n\nexport interface AlertButtonProps extends Omit<ButtonProps, 'children'> {\n /** Position of the button.\n * @default topRight\n */\n buttonPosition?: AlertButtonPosition;\n /** Text to display in the button. */\n buttonText: string;\n /** Data test id for the button.\n * @default kibble-alert-button\n */\n 'data-testid'?: string;\n}\n\ninterface InternalAlertButtonProps extends AlertButtonProps {\n /** Status of the alert.\n * @internal\n */\n status: Status;\n}\n\nexport const AlertButton = ({\n buttonPosition = 'topRight',\n buttonText,\n status,\n ['data-testid']: dataTestId = 'kibble-alert-button',\n ...rest\n}: InternalAlertButtonProps): React.JSX.Element => {\n return (\n <Flex\n className=\"Alert__Button\"\n data-testid={dataTestId}\n {...(buttonPosition !== 'topRight' && { pt: 2, pb: 1 })}\n {...(buttonPosition === 'bottomRight' && { justifyContent: 'flex-end' })}\n >\n <Button size=\"xs\" variant={status === 'default' ? 'primary' : 'secondary'} w=\"max-content\" {...rest}>\n {buttonText}\n </Button>\n </Flex>\n );\n};\n","import React from 'react';\nimport { Alert as CAlert } from '@chakra-ui/react/alert';\nimport { Heading, HeadingProps } from 'components/Heading/heading.component';\nimport { Icon, IconProps } from 'components/Icon/icon.component';\nimport { Text, TextProps } from 'components/Text/text.component';\nimport { Status } from 'shared/types/status';\nimport { Button } from 'components/Button/button.component';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { AlertButton, AlertButtonProps } from './components/AlertButton/alertButton.component';\nimport { StatusIconMap, StatusTypographyMap } from 'shared/records/status';\n\nexport interface AlertProps extends Omit<CAlert.RootProps, 'title' | 'status' | 'children' | 'variant' | 'size'> {\n /** Props to customize the alert button. */\n buttonProps?: AlertButtonProps;\n /** The body of the alert */\n description?: React.ReactNode;\n /** Props to customize the description when passed as a string. */\n descriptionProps?: TextProps;\n /**\n * If true, the close button will not be displayed.\n * @default false\n */\n hideCloseButton?: boolean;\n /**\n * If true, the icon will not be displayed.\n * @default false\n */\n hideIcon?: boolean;\n /** Props to customize the icon. */\n iconProps?: IconProps;\n /** Callback function to be called when the close button is clicked. */\n onClose?: React.MouseEventHandler<HTMLButtonElement>;\n /**\n * If true, the alert will use a contrasting variant according to the selected status.\n * @default false\n */\n onContrast?: boolean;\n /**\n * The status of the alert. Determines the color of the alert.\n * @default success\n */\n status?: Status;\n /** The title of the alert. */\n title?: React.ReactNode;\n /** Props to customize the title when passed as a string. */\n titleProps?: HeadingProps;\n /** Data test id for the alert.\n * @default kibble-alert\n */\n 'data-testid'?: string;\n}\n\nexport const Alert = ({\n buttonProps,\n description,\n descriptionProps,\n hideCloseButton = false,\n hideIcon = false,\n iconProps,\n onClose,\n onContrast = false,\n status = 'success',\n title,\n titleProps,\n ['data-testid']: dataTestId = 'kibble-alert',\n ...rest\n}: AlertProps): React.JSX.Element => {\n if (buttonProps && !buttonProps.buttonPosition) {\n buttonProps.buttonPosition = 'topRight';\n }\n const isTopRightButton = buttonProps && buttonProps.buttonPosition === 'topRight';\n const WithButtonWrapper = isTopRightButton ? Flex : React.Fragment;\n\n return (\n <CAlert.Root\n className=\"Alert\"\n data-testid={dataTestId}\n {...rest}\n variant={status}\n hideIcon={hideIcon}\n onContrast={onContrast}\n >\n {!hideIcon && (\n <CAlert.Indicator className=\"Alert__Icon\" data-testid={`${dataTestId}-icon`}>\n <Icon\n variant={onContrast ? 'onContrast' : StatusTypographyMap[status]}\n name={iconProps?.name || StatusIconMap[status]}\n size=\"lg\"\n {...iconProps}\n />\n </CAlert.Indicator>\n )}\n <CAlert.Content className=\"Alert__Content\" data-testid={`${dataTestId}-content`}>\n {title && (\n <WithButtonWrapper\n {...(isTopRightButton && {\n justifyContent: 'space-between',\n gap: 2,\n })}\n >\n <CAlert.Title className=\"Alert__Title\" data-testid={`${dataTestId}-title`}>\n <Heading size=\"sm\" variant={onContrast ? 'onContrast' : 'default'} {...titleProps}>\n {title}\n </Heading>\n </CAlert.Title>\n {buttonProps && buttonProps.buttonPosition === 'topRight' && (\n <AlertButton status={status} onContrast={onContrast} {...buttonProps} />\n )}\n </WithButtonWrapper>\n )}\n {description && (\n <WithButtonWrapper {...(isTopRightButton && { justifyContent: 'space-between' })}>\n <CAlert.Description className=\"Alert__Description\" data-testid={`${dataTestId}-description`}>\n {typeof description === 'string' ? (\n <Text size=\"md\" variant={onContrast ? 'onContrast' : 'default'} {...descriptionProps}>\n {description}\n </Text>\n ) : (\n description\n )}\n </CAlert.Description>\n {buttonProps && buttonProps.buttonPosition === 'topRight' && !title && (\n <AlertButton status={status} onContrast={onContrast} {...buttonProps} />\n )}\n </WithButtonWrapper>\n )}\n {buttonProps && buttonProps?.buttonPosition !== 'topRight' && (\n <AlertButton status={status} onContrast={onContrast} {...buttonProps} />\n )}\n </CAlert.Content>\n {!hideCloseButton && (\n <Button\n className=\"Alert__CloseTrigger\"\n data-testid={`${dataTestId}-close-trigger`}\n iconName=\"close\"\n size=\"xs\"\n variant=\"ghostNeutral\"\n onContrast={onContrast}\n onClick={onClose}\n />\n )}\n </CAlert.Root>\n );\n};\n","export const alertButtonPositions = ['topRight', 'bottomLeft', 'bottomRight'] as const;\nexport type AlertButtonPosition = (typeof alertButtonPositions)[number];\n"],"names":["AlertStatusProvider","useAlertStatusContext","createContext","withProvider","withContext","useAlertStyles","createSlotRecipeContext","AlertRoot","element","props","jsx","AlertTitle","AlertDescription","AlertContent","iconMap","InfoIcon","WarningIcon","CheckCircleIcon","AlertIndicator","forwardRef","ref","api","styles","Icon","Fragment","children","rest","chakra","AlertButton","buttonPosition","buttonText","status","dataTestId","Flex","Button","Alert","buttonProps","description","descriptionProps","hideCloseButton","hideIcon","iconProps","onClose","onContrast","title","titleProps","isTopRightButton","WithButtonWrapper","React","jsxs","CAlert.Root","CAlert.Indicator","StatusTypographyMap","StatusIconMap","CAlert.Content","CAlert.Title","Heading","CAlert.Description","Text","alertButtonPositions"],"mappings":"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","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alert.types-DWm1TeiF.js","sources":["../../node_modules/@chakra-ui/react/dist/esm/components/alert/alert.js","../../src/components/Alert/components/AlertButton/alertButton.component.tsx","../../src/components/Alert/alert.component.tsx","../../src/components/Alert/alert.types.ts"],"sourcesContent":["\"use strict\";\n\"use client\";\nimport { jsx } from 'react/jsx-runtime';\nimport { forwardRef, Fragment } from 'react';\nimport { createContext } from '../../create-context.js';\nimport { createSlotRecipeContext } from '../../styled-system/create-slot-recipe-context.js';\nimport { chakra } from '../../styled-system/factory.js';\nimport { InfoIcon, WarningIcon, CheckCircleIcon } from '../icons.js';\n\nconst [AlertStatusProvider, useAlertStatusContext] = createContext({\n name: \"AlertStatusContext\",\n hookName: \"useAlertStatusContext\",\n providerName: \"<Alert />\"\n});\nconst {\n withProvider,\n withContext,\n useStyles: useAlertStyles,\n PropsProvider\n} = createSlotRecipeContext({ key: \"alert\" });\nconst AlertRoot = withProvider(\n \"div\",\n \"root\",\n {\n forwardAsChild: true,\n wrapElement(element, props) {\n return (\n // @ts-ignore fix later\n /* @__PURE__ */ jsx(AlertStatusProvider, { value: { status: props.status || \"info\" }, children: element })\n );\n }\n }\n);\nconst AlertPropsProvider = PropsProvider;\nconst AlertTitle = withContext(\n \"div\",\n \"title\"\n);\nconst AlertDescription = withContext(\"div\", \"description\");\nconst AlertContent = withContext(\n \"div\",\n \"content\"\n);\nconst iconMap = {\n info: InfoIcon,\n warning: WarningIcon,\n success: CheckCircleIcon,\n error: WarningIcon,\n neutral: InfoIcon\n};\nconst AlertIndicator = forwardRef(\n function AlertIndicator2(props, ref) {\n const api = useAlertStatusContext();\n const styles = useAlertStyles();\n const Icon = typeof api.status === \"string\" ? iconMap[api.status] : Fragment;\n const { children = /* @__PURE__ */ jsx(Icon, {}), ...rest } = props;\n return /* @__PURE__ */ jsx(chakra.span, { ref, ...rest, css: [styles.indicator, props.css], children });\n }\n);\n\nexport { AlertContent, AlertDescription, AlertIndicator, AlertPropsProvider, AlertRoot, AlertStatusProvider, AlertTitle, useAlertStatusContext, useAlertStyles };\n","import React from 'react';\nimport { AlertButtonPosition } from 'components/Alert/alert.types';\nimport { Button, ButtonProps } from 'components/Button/button.component';\nimport { Status } from 'shared/types/status';\nimport { Flex } from '@chakra-ui/react/flex';\n\nexport interface AlertButtonProps extends Omit<ButtonProps, 'children'> {\n /** Position of the button.\n * @default topRight\n */\n buttonPosition?: AlertButtonPosition;\n /** Text to display in the button. */\n buttonText: string;\n /** Data test id for the button.\n * @default kibble-alert-button\n */\n 'data-testid'?: string;\n}\n\ninterface InternalAlertButtonProps extends AlertButtonProps {\n /** Status of the alert.\n * @internal\n */\n status: Status;\n}\n\nexport const AlertButton = ({\n buttonPosition = 'topRight',\n buttonText,\n status,\n ['data-testid']: dataTestId = 'kibble-alert-button',\n ...rest\n}: InternalAlertButtonProps): React.JSX.Element => {\n return (\n <Flex\n className=\"Alert__Button\"\n data-testid={dataTestId}\n {...(buttonPosition !== 'topRight' && { pt: 2, pb: 1 })}\n {...(buttonPosition === 'bottomRight' && { justifyContent: 'flex-end' })}\n >\n <Button size=\"xs\" variant={status === 'default' ? 'primary' : 'secondary'} w=\"max-content\" {...rest}>\n {buttonText}\n </Button>\n </Flex>\n );\n};\n","import React from 'react';\nimport { Alert as CAlert } from '@chakra-ui/react/alert';\nimport { Heading, HeadingProps } from 'components/Heading/heading.component';\nimport { Icon, IconProps } from 'components/Icon/icon.component';\nimport { Text, TextProps } from 'components/Text/text.component';\nimport { Status } from 'shared/types/status';\nimport { Button } from 'components/Button/button.component';\nimport { Flex } from '@chakra-ui/react/flex';\nimport { AlertButton, AlertButtonProps } from './components/AlertButton/alertButton.component';\nimport { StatusIconMap, StatusTypographyMap } from 'shared/records/status';\n\nexport interface AlertProps extends Omit<CAlert.RootProps, 'title' | 'status' | 'children' | 'variant' | 'size'> {\n /** Props to customize the alert button. */\n buttonProps?: AlertButtonProps;\n /** The body of the alert */\n description?: React.ReactNode;\n /** Props to customize the description when passed as a string. */\n descriptionProps?: TextProps;\n /**\n * If true, the close button will not be displayed.\n * @default false\n */\n hideCloseButton?: boolean;\n /**\n * If true, the icon will not be displayed.\n * @default false\n */\n hideIcon?: boolean;\n /** Props to customize the icon. */\n iconProps?: IconProps;\n /** Callback function to be called when the close button is clicked. */\n onClose?: React.MouseEventHandler<HTMLButtonElement>;\n /**\n * If true, the alert will use a contrasting variant according to the selected status.\n * @default false\n */\n onContrast?: boolean;\n /**\n * The status of the alert. Determines the color of the alert.\n * @default success\n */\n status?: Status;\n /** The title of the alert. */\n title?: React.ReactNode;\n /** Props to customize the title when passed as a string. */\n titleProps?: HeadingProps;\n /** Data test id for the alert.\n * @default kibble-alert\n */\n 'data-testid'?: string;\n}\n\nexport const Alert = ({\n buttonProps,\n description,\n descriptionProps,\n hideCloseButton = false,\n hideIcon = false,\n iconProps,\n onClose,\n onContrast = false,\n status = 'success',\n title,\n titleProps,\n ['data-testid']: dataTestId = 'kibble-alert',\n ...rest\n}: AlertProps): React.JSX.Element => {\n if (buttonProps && !buttonProps.buttonPosition) {\n buttonProps.buttonPosition = 'topRight';\n }\n const isTopRightButton = buttonProps && buttonProps.buttonPosition === 'topRight';\n const WithButtonWrapper = isTopRightButton ? Flex : React.Fragment;\n\n return (\n <CAlert.Root\n className=\"Alert\"\n data-testid={dataTestId}\n {...rest}\n variant={status}\n hideIcon={hideIcon}\n onContrast={onContrast}\n >\n {!hideIcon && (\n <CAlert.Indicator className=\"Alert__Icon\" data-testid={`${dataTestId}-icon`}>\n <Icon\n variant={onContrast ? 'onContrast' : StatusTypographyMap[status]}\n name={iconProps?.name || StatusIconMap[status]}\n size=\"lg\"\n {...iconProps}\n />\n </CAlert.Indicator>\n )}\n <CAlert.Content className=\"Alert__Content\" data-testid={`${dataTestId}-content`}>\n {title && (\n <WithButtonWrapper\n {...(isTopRightButton && {\n justifyContent: 'space-between',\n gap: 2,\n })}\n >\n <CAlert.Title className=\"Alert__Title\" data-testid={`${dataTestId}-title`}>\n <Heading size=\"sm\" variant={onContrast ? 'onContrast' : 'default'} {...titleProps}>\n {title}\n </Heading>\n </CAlert.Title>\n {buttonProps && buttonProps.buttonPosition === 'topRight' && (\n <AlertButton status={status} onContrast={onContrast} {...buttonProps} />\n )}\n </WithButtonWrapper>\n )}\n {description && (\n <WithButtonWrapper {...(isTopRightButton && { justifyContent: 'space-between' })}>\n <CAlert.Description className=\"Alert__Description\" data-testid={`${dataTestId}-description`}>\n {typeof description === 'string' ? (\n <Text size=\"md\" variant={onContrast ? 'onContrast' : 'default'} {...descriptionProps}>\n {description}\n </Text>\n ) : (\n description\n )}\n </CAlert.Description>\n {buttonProps && buttonProps.buttonPosition === 'topRight' && !title && (\n <AlertButton status={status} onContrast={onContrast} {...buttonProps} />\n )}\n </WithButtonWrapper>\n )}\n {buttonProps && buttonProps?.buttonPosition !== 'topRight' && (\n <AlertButton status={status} onContrast={onContrast} {...buttonProps} />\n )}\n </CAlert.Content>\n {!hideCloseButton && (\n <Button\n className=\"Alert__CloseTrigger\"\n data-testid={`${dataTestId}-close-trigger`}\n iconName=\"close\"\n size=\"xs\"\n variant=\"ghostNeutral\"\n onContrast={onContrast}\n onClick={onClose}\n />\n )}\n </CAlert.Root>\n );\n};\n","export const alertButtonPositions = ['topRight', 'bottomLeft', 'bottomRight'] as const;\nexport type AlertButtonPosition = (typeof alertButtonPositions)[number];\n"],"names":["AlertStatusProvider","useAlertStatusContext","createContext","withProvider","withContext","useAlertStyles","createSlotRecipeContext","AlertRoot","element","props","jsx","AlertTitle","AlertDescription","AlertContent","iconMap","InfoIcon","WarningIcon","CheckCircleIcon","AlertIndicator","forwardRef","ref","api","styles","Icon","Fragment","children","rest","chakra","AlertButton","buttonPosition","buttonText","status","dataTestId","Flex","Button","Alert","buttonProps","description","descriptionProps","hideCloseButton","hideIcon","iconProps","onClose","onContrast","title","titleProps","isTopRightButton","WithButtonWrapper","React","jsxs","CAlert.Root","CAlert.Indicator","StatusTypographyMap","StatusIconMap","CAlert.Content","CAlert.Title","Heading","CAlert.Description","Text","alertButtonPositions"],"mappings":";;;;;;;;;;;;AASA,MAAM,CAACA,GAAqBC,CAAqB,IAAIC,EAAc;AAAA,EACjE,MAAM;AAAA,EACN,UAAU;AAAA,EACV,cAAc;AAChB,CAAC,GACK;AAAA,EACJ,cAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAWC;AAEb,IAAIC,EAAwB,EAAE,KAAK,QAAO,CAAE,GACtCC,IAAYJ;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,IACE,gBAAgB;AAAA,IAChB,YAAYK,GAASC,GAAO;AAC1B;AAAA;AAAA,QAEkBC,gBAAAA,EAAAA,IAAIV,GAAqB,EAAE,OAAO,EAAE,QAAQS,EAAM,UAAU,OAAM,GAAI,UAAUD,EAAS,CAAA;AAAA;AAAA,IAEjH;AAAA,EACA;AACA,GAEMG,IAAaP;AAAA,EACjB;AAAA,EACA;AACF,GACMQ,IAAmBR,EAAY,OAAO,aAAa,GACnDS,IAAeT;AAAA,EACnB;AAAA,EACA;AACF,GACMU,IAAU;AAAA,EACd,MAAMC;AAAA,EACN,SAASC;AAAA,EACT,SAASC;AAAA,EACT,OAAOD;AAAA,EACP,SAASD;AACX,GACMG,IAAiBC;AAAA,EACrB,SAAyBV,GAAOW,GAAK;AACnC,UAAMC,IAAMpB,EAAuB,GAC7BqB,IAASjB,EAAgB,GACzBkB,IAAO,OAAOF,EAAI,UAAW,WAAWP,EAAQO,EAAI,MAAM,IAAIG,GAC9D,EAAE,UAAAC,IAA2Bf,gBAAAA,MAAIa,GAAM,CAAA,CAAE,GAAG,GAAGG,EAAI,IAAKjB;AAC9D,WAAuBC,gBAAAA,EAAG,IAACiB,EAAO,MAAM,EAAE,KAAAP,GAAK,GAAGM,GAAM,KAAK,CAACJ,EAAO,WAAWb,EAAM,GAAG,GAAG,UAAAgB,EAAQ,CAAE;AAAA,EAC1G;AACA,GChCaG,IAAc,CAAC;AAAA,EAC1B,gBAAAC,IAAiB;AAAA,EACjB,YAAAC;AAAA,EACA,QAAAC;AAAA,EACA,CAAC,gBAAgBC,IAAa;AAAA,EAC9B,GAAGN;AACL,MAEIhB,gBAAAA,EAAA;AAAA,EAACuB;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,eAAaD;AAAA,IACZ,GAAIH,MAAmB,cAAc,EAAE,IAAI,GAAG,IAAI,EAAE;AAAA,IACpD,GAAIA,MAAmB,iBAAiB,EAAE,gBAAgB,WAAW;AAAA,IAEtE,UAACnB,gBAAAA,EAAA,IAAAwB,GAAA,EAAO,MAAK,MAAK,SAASH,MAAW,YAAY,YAAY,aAAa,GAAE,eAAe,GAAGL,GAC5F,UACHI,EAAA,CAAA;AAAA,EAAA;AACF,GCSSK,KAAQ,CAAC;AAAA,EACpB,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,iBAAAC,IAAkB;AAAA,EAClB,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,QAAAZ,IAAS;AAAA,EACT,OAAAa;AAAA,EACA,YAAAC;AAAA,EACA,CAAC,gBAAgBb,IAAa;AAAA,EAC9B,GAAGN;AACL,MAAqC;AAC/B,EAAAU,KAAe,CAACA,EAAY,mBAC9BA,EAAY,iBAAiB;AAEzB,QAAAU,IAAmBV,KAAeA,EAAY,mBAAmB,YACjEW,IAAoBD,IAAmBb,IAAOe,EAAM;AAGxD,SAAAC,gBAAAA,EAAA;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,eAAalB;AAAA,MACZ,GAAGN;AAAA,MACJ,SAASK;AAAA,MACT,UAAAS;AAAA,MACA,YAAAG;AAAA,MAEC,UAAA;AAAA,QAAC,CAAAH,KACC9B,gBAAAA,EAAAA,IAAAyC,GAAA,EAAiB,WAAU,eAAc,eAAa,GAAGnB,CAAU,SAClE,UAAAtB,gBAAAA,EAAA;AAAA,UAACa;AAAA,UAAA;AAAA,YACC,SAASoB,IAAa,eAAeS,EAAoBrB,CAAM;AAAA,YAC/D,MAAMU,GAAW,QAAQY,EAActB,CAAM;AAAA,YAC7C,MAAK;AAAA,YACJ,GAAGU;AAAA,UAAA;AAAA,QAAA,GAER;AAAA,QAEFQ,gBAAAA,OAACK,GAAA,EAAe,WAAU,kBAAiB,eAAa,GAAGtB,CAAU,YAClE,UAAA;AAAA,UACCY,KAAAK,gBAAAA,EAAA;AAAA,YAACF;AAAA,YAAA;AAAA,cACE,GAAID,KAAoB;AAAA,gBACvB,gBAAgB;AAAA,gBAChB,KAAK;AAAA,cACP;AAAA,cAEA,UAAA;AAAA,gBAACpC,gBAAAA,EAAAA,IAAA6C,GAAA,EAAa,WAAU,gBAAe,eAAa,GAAGvB,CAAU,UAC/D,UAAAtB,gBAAAA,EAAAA,IAAC8C,KAAQ,MAAK,MAAK,SAASb,IAAa,eAAe,WAAY,GAAGE,GACpE,aACH,EACF,CAAA;AAAA,gBACCT,KAAeA,EAAY,mBAAmB,oCAC5CR,GAAY,EAAA,QAAAG,GAAgB,YAAAY,GAAyB,GAAGP,EAAa,CAAA;AAAA,cAAA;AAAA,YAAA;AAAA,UAE1E;AAAA,UAEDC,4BACEU,GAAmB,EAAA,GAAID,KAAoB,EAAE,gBAAgB,gBAC5D,GAAA,UAAA;AAAA,YAACpC,gBAAAA,EAAAA,IAAA+C,GAAA,EAAmB,WAAU,sBAAqB,eAAa,GAAGzB,CAAU,gBAC1E,UAAA,OAAOK,KAAgB,iCACrBqB,GAAK,EAAA,MAAK,MAAK,SAASf,IAAa,eAAe,WAAY,GAAGL,GACjE,UACHD,EAAA,CAAA,IAEAA,EAEJ,CAAA;AAAA,YACCD,KAAeA,EAAY,mBAAmB,cAAc,CAACQ,KAC5DlC,gBAAAA,MAACkB,GAAY,EAAA,QAAAG,GAAgB,YAAAY,GAAyB,GAAGP,EAAa,CAAA;AAAA,UAAA,GAE1E;AAAA,UAEDA,KAAeA,GAAa,mBAAmB,oCAC7CR,GAAY,EAAA,QAAAG,GAAgB,YAAAY,GAAyB,GAAGP,EAAa,CAAA;AAAA,QAAA,GAE1E;AAAA,QACC,CAACG,KACA7B,gBAAAA,EAAA;AAAA,UAACwB;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,eAAa,GAAGF,CAAU;AAAA,YAC1B,UAAS;AAAA,YACT,MAAK;AAAA,YACL,SAAQ;AAAA,YACR,YAAAW;AAAA,YACA,SAASD;AAAA,UAAA;AAAA,QAAA;AAAA,MACX;AAAA,IAAA;AAAA,EAEJ;AAEJ,GC/IaiB,KAAuB,CAAC,YAAY,cAAc,aAAa;","x_google_ignoreList":[0]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";const P=require("./jsx-runtime-BjDatQAs.js"),D=require("react"),We=require("./text.component-BDDz5KQP.js"),Bt=require("./index-BQRnVsAg.js"),je=require("./button.component-DjdgBXDC.js"),Yt=require("./config-jChwZPSv.js"),Y=require("./format-CK7Imh-5.js"),Ft=require("./isToday-BgNkHh5t.js"),qt=require("./create-slot-recipe-context-HXE1VazG.js"),Ye=require("./grid-item-CH3dbZHL.js"),Dt=require("./center-kk61ArhQ.js"),Ht=require("./popover-root-provider-CZDbUJ2K.js"),Lt=require("./flex-BOU6tYUd.js"),Ke=require("./menu.component-DypBuCwv.js"),ue=require("./isSymbol-BdGeV_e0.js"),It=require("./h-stack-D4MnHHRc.js"),Wt=require("./popover-C7aj8Iwj.js");var Re={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"}};function Fe(e){return function(t){var n=t||{},r=n.width?String(n.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var jt={date:Fe({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Fe({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Fe({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},At={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function be(e){return function(t,n){var r,a=n||{};if((a.context?String(a.context):"standalone")==="formatting"&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=a.width?String(a.width):o;r=e.formattingValues[i]||e.formattingValues[o]}else{var s=e.defaultWidth,u=a.width?String(a.width):e.defaultWidth;r=e.values[u]||e.values[s]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function ve(e){return function(t,n){var r=String(t),a=n||{},o=a.width,i=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],s=r.match(i);if(!s)return null;var u,l=s[0],g=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth];return u=Object.prototype.toString.call(g)==="[object Array]"?function(d,w){for(var c=0;c<d.length;c++)if(w(d[c]))return c}(g,function(d){return d.test(l)}):function(d,w){for(var c in d)if(d.hasOwnProperty(c)&&w(d[c]))return c}(g,function(d){return d.test(l)}),u=e.valueCallback?e.valueCallback(u):u,{value:u=a.valueCallback?a.valueCallback(u):u,rest:r.slice(l.length)}}}var pe,yt={code:"en-US",formatDistance:function(e,t,n){var r;return n=n||{},r=typeof Re[e]=="string"?Re[e]:t===1?Re[e].one:Re[e].other.replace("{{count}}",t),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r},formatLong:jt,formatRelative:function(e,t,n,r){return At[e]},localize:{ordinalNumber:function(e,t){var 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"},era:be({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:be({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:be({values:{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"]},defaultWidth:"wide"}),day:be({values:{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"]},defaultWidth:"wide"}),dayPeriod:be({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(pe={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e,t){var n=String(e),r=t||{},a=n.match(pe.matchPattern);if(!a)return null;var o=a[0],i=n.match(pe.parsePattern);if(!i)return null;var s=pe.valueCallback?pe.valueCallback(i[0]):i[0];return{value:s=r.valueCallback?r.valueCallback(s):s,rest:n.slice(o.length)}}),era:ve({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ve({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:ve({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:ve({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:ve({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function M(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function T(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function v(e){T(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):(typeof e!="string"&&t!=="[object String]"||typeof console>"u"||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}function Qt(e,t){T(2,arguments);var n=v(e).getTime(),r=M(t);return new Date(n+r)}function bt(e,t){T(2,arguments);var n=M(t);return Qt(e,-n)}function Gt(e,t){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in t=t||{})t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function Je(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"})}}function Ze(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"})}}var vt={p:Ze,P:function(e,t){var n,r=e.match(/(P+)(p+)?/),a=r[1],o=r[2];if(!o)return Je(e,t);switch(a){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",Je(a,t)).replace("{{time}}",Ze(o,t))}};function et(e){return e.getTime()%6e4}function pt(e){var t=new Date(e.getTime()),n=Math.ceil(t.getTimezoneOffset());return t.setSeconds(0,0),6e4*n+(n>0?(6e4+et(t))%6e4:et(t))}var _t=["D","DD"],Xt=["YY","YYYY"];function Tt(e){return _t.indexOf(e)!==-1}function xt(e){return Xt.indexOf(e)!==-1}function Ue(e){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr");if(e==="YY")throw new RangeError("Use `yy` instead of `YY` for formatting years; see: https://git.io/fxCyr");if(e==="D")throw new RangeError("Use `d` instead of `D` for formatting days of the month; see: https://git.io/fxCyr");if(e==="DD")throw new RangeError("Use `dd` instead of `DD` for formatting days of the month; see: https://git.io/fxCyr")}function ce(e,t){T(1,arguments);var n=t||{},r=n.locale,a=r&&r.options&&r.options.weekStartsOn,o=a==null?0:M(a),i=n.weekStartsOn==null?o:M(n.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=v(e),u=s.getUTCDay(),l=(u<i?7:0)+u-i;return s.setUTCDate(s.getUTCDate()-l),s.setUTCHours(0,0,0,0),s}function Xe(e,t){T(1,arguments);var n=v(e,t),r=n.getUTCFullYear(),a=t||{},o=a.locale,i=o&&o.options&&o.options.firstWeekContainsDate,s=i==null?1:M(i),u=a.firstWeekContainsDate==null?s:M(a.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var l=new Date(0);l.setUTCFullYear(r+1,0,u),l.setUTCHours(0,0,0,0);var g=ce(l,t),d=new Date(0);d.setUTCFullYear(r,0,u),d.setUTCHours(0,0,0,0);var w=ce(d,t);return n.getTime()>=g.getTime()?r+1:n.getTime()>=w.getTime()?r:r-1}function qe(e,t,n){T(2,arguments);var r=n||{},a=r.locale,o=a&&a.options&&a.options.weekStartsOn,i=o==null?0:M(o),s=r.weekStartsOn==null?i:M(r.weekStartsOn);if(!(s>=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=v(e),l=M(t),g=u.getUTCDay(),d=l%7,w=(d+7)%7,c=(w<s?7:0)+l-g;return u.setUTCDate(u.getUTCDate()+c),u}function ge(e){T(1,arguments);var t=1,n=v(e),r=n.getUTCDay(),a=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-a),n.setUTCHours(0,0,0,0),n}function kt(e){T(1,arguments);var t=v(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var a=ge(r),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var i=ge(o);return t.getTime()>=a.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function zt(e){T(1,arguments);var t=kt(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=ge(n);return r}function Ct(e){T(1,arguments);var t=v(e),n=ge(t).getTime()-zt(t).getTime();return Math.round(n/6048e5)+1}function Vt(e,t){T(1,arguments);var n=t||{},r=n.locale,a=r&&r.options&&r.options.firstWeekContainsDate,o=a==null?1:M(a),i=n.firstWeekContainsDate==null?o:M(n.firstWeekContainsDate),s=Xe(e,t),u=new Date(0);u.setUTCFullYear(s,0,i),u.setUTCHours(0,0,0,0);var l=ce(u,t);return l}function Mt(e,t){T(1,arguments);var n=v(e),r=ce(n,t).getTime()-Vt(n,t).getTime();return Math.round(r/6048e5)+1}var tt=/^(1[0-2]|0?\d)/,$t=/^(3[0-1]|[0-2]?\d)/,Kt=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,nt=/^(5[0-3]|[0-4]?\d)/,Jt=/^(2[0-3]|[0-1]?\d)/,Zt=/^(2[0-4]|[0-1]?\d)/,en=/^(1[0-1]|0?\d)/,tn=/^(1[0-2]|0?\d)/,nn=/^[0-5]?\d/,rn=/^[0-5]?\d/,an=/^\d/,on=/^\d{1,2}/,sn=/^\d{1,3}/,un=/^\d{1,4}/,cn=/^-?\d+/,dn=/^-?\d/,ln=/^-?\d{1,2}/,fn=/^-?\d{1,3}/,mn=/^-?\d{1,4}/,rt=/^([+-])(\d{2})(\d{2})?|Z/,at=/^([+-])(\d{2})(\d{2})|Z/,ot=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,it=/^([+-])(\d{2}):(\d{2})|Z/,st=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function U(e,t,n){var r=t.match(e);if(!r)return null;var a=parseInt(r[0],10);return{value:n?n(a):a,rest:t.slice(r[0].length)}}function Z(e,t){var n=t.match(e);return n?n[0]==="Z"?{value:0,rest:t.slice(1)}:{value:(n[1]==="+"?1:-1)*(36e5*(n[2]?parseInt(n[2],10):0)+6e4*(n[3]?parseInt(n[3],10):0)+1e3*(n[5]?parseInt(n[5],10):0)),rest:t.slice(n[0].length)}:null}function ut(e,t){return U(cn,e,t)}function O(e,t,n){switch(e){case 1:return U(an,t,n);case 2:return U(on,t,n);case 3:return U(sn,t,n);case 4:return U(un,t,n);default:return U(new RegExp("^\\d{1,"+e+"}"),t,n)}}function ct(e,t,n){switch(e){case 1:return U(dn,t,n);case 2:return U(ln,t,n);case 3:return U(fn,t,n);case 4:return U(mn,t,n);default:return U(new RegExp("^-?\\d{1,"+e+"}"),t,n)}}function He(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function dt(e,t){var n,r=t>0,a=r?t:1-t;if(a<=50)n=e||100;else{var o=a+50;n=e+100*Math.floor(o/100)-(e>=o%100?100:0)}return r?n:1-n}var hn=[31,28,31,30,31,30,31,31,30,31,30,31],gn=[31,29,31,30,31,30,31,31,30,31,30,31];function lt(e){return e%400==0||e%4==0&&e%100!=0}var wn={G:{priority:140,parse:function(e,t,n,r){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});case"GGGG":default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}},set:function(e,t,n,r){return t.era=n,e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["R","u","t","T"]},y:{priority:130,parse:function(e,t,n,r){var a=function(o){return{year:o,isTwoDigitYear:t==="yy"}};switch(t){case"y":return O(4,e,a);case"yo":return n.ordinalNumber(e,{unit:"year",valueCallback:a});default:return O(t.length,e,a)}},validate:function(e,t,n){return t.isTwoDigitYear||t.year>0},set:function(e,t,n,r){var a=e.getUTCFullYear();if(n.isTwoDigitYear){var o=dt(n.year,a);return e.setUTCFullYear(o,0,1),e.setUTCHours(0,0,0,0),e}var i="era"in t&&t.era!==1?1-n.year:n.year;return e.setUTCFullYear(i,0,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","u","w","I","i","e","c","t","T"]},Y:{priority:130,parse:function(e,t,n,r){var a=function(o){return{year:o,isTwoDigitYear:t==="YY"}};switch(t){case"Y":return O(4,e,a);case"Yo":return n.ordinalNumber(e,{unit:"year",valueCallback:a});default:return O(t.length,e,a)}},validate:function(e,t,n){return t.isTwoDigitYear||t.year>0},set:function(e,t,n,r){var a=Xe(e,r);if(n.isTwoDigitYear){var o=dt(n.year,a);return e.setUTCFullYear(o,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),ce(e,r)}var i="era"in t&&t.era!==1?1-n.year:n.year;return e.setUTCFullYear(i,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),ce(e,r)},incompatibleTokens:["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:{priority:130,parse:function(e,t,n,r){return ct(t==="R"?4:t.length,e)},set:function(e,t,n,r){var a=new Date(0);return a.setUTCFullYear(n,0,4),a.setUTCHours(0,0,0,0),ge(a)},incompatibleTokens:["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:{priority:130,parse:function(e,t,n,r){return ct(t==="u"?4:t.length,e)},set:function(e,t,n,r){return e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["G","y","Y","R","w","I","i","e","c","t","T"]},Q:{priority:120,parse:function(e,t,n,r){switch(t){case"Q":case"QQ":return O(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}},validate:function(e,t,n){return t>=1&&t<=4},set:function(e,t,n,r){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:{priority:120,parse:function(e,t,n,r){switch(t){case"q":case"qq":return O(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}},validate:function(e,t,n){return t>=1&&t<=4},set:function(e,t,n,r){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:{priority:110,parse:function(e,t,n,r){var a=function(o){return o-1};switch(t){case"M":return U(tt,e,a);case"MM":return O(2,e,a);case"Mo":return n.ordinalNumber(e,{unit:"month",valueCallback:a});case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}},validate:function(e,t,n){return t>=0&&t<=11},set:function(e,t,n,r){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]},L:{priority:110,parse:function(e,t,n,r){var a=function(o){return o-1};switch(t){case"L":return U(tt,e,a);case"LL":return O(2,e,a);case"Lo":return n.ordinalNumber(e,{unit:"month",valueCallback:a});case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}},validate:function(e,t,n){return t>=0&&t<=11},set:function(e,t,n,r){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:{priority:100,parse:function(e,t,n,r){switch(t){case"w":return U(nt,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return O(t.length,e)}},validate:function(e,t,n){return t>=1&&t<=53},set:function(e,t,n,r){return ce(function(a,o,i){T(2,arguments);var s=v(a),u=M(o),l=Mt(s,i)-u;return s.setUTCDate(s.getUTCDate()-7*l),s}(e,n,r),r)},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:{priority:100,parse:function(e,t,n,r){switch(t){case"I":return U(nt,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return O(t.length,e)}},validate:function(e,t,n){return t>=1&&t<=53},set:function(e,t,n,r){return ge(function(a,o){T(2,arguments);var i=v(a),s=M(o),u=Ct(i)-s;return i.setUTCDate(i.getUTCDate()-7*u),i}(e,n,r),r)},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:{priority:90,parse:function(e,t,n,r){switch(t){case"d":return U($t,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return O(t.length,e)}},validate:function(e,t,n){var r=lt(e.getUTCFullYear()),a=e.getUTCMonth();return r?t>=1&&t<=gn[a]:t>=1&&t<=hn[a]},set:function(e,t,n,r){return e.setUTCDate(n),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:{priority:90,parse:function(e,t,n,r){switch(t){case"D":case"DD":return U(Kt,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return O(t.length,e)}},validate:function(e,t,n){return lt(e.getUTCFullYear())?t>=1&&t<=366:t>=1&&t<=365},set:function(e,t,n,r){return e.setUTCMonth(0,n),e.setUTCHours(0,0,0,0),e},incompatibleTokens:["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:{priority:90,parse:function(e,t,n,r){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}},validate:function(e,t,n){return t>=0&&t<=6},set:function(e,t,n,r){return(e=qe(e,n,r)).setUTCHours(0,0,0,0),e},incompatibleTokens:["D","i","e","c","t","T"]},e:{priority:90,parse:function(e,t,n,r){var a=function(o){var i=7*Math.floor((o-1)/7);return(o+r.weekStartsOn+6)%7+i};switch(t){case"e":case"ee":return O(t.length,e,a);case"eo":return n.ordinalNumber(e,{unit:"day",valueCallback:a});case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}},validate:function(e,t,n){return t>=0&&t<=6},set:function(e,t,n,r){return(e=qe(e,n,r)).setUTCHours(0,0,0,0),e},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:{priority:90,parse:function(e,t,n,r){var a=function(o){var i=7*Math.floor((o-1)/7);return(o+r.weekStartsOn+6)%7+i};switch(t){case"c":case"cc":return O(t.length,e,a);case"co":return n.ordinalNumber(e,{unit:"day",valueCallback:a});case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}},validate:function(e,t,n){return t>=0&&t<=6},set:function(e,t,n,r){return(e=qe(e,n,r)).setUTCHours(0,0,0,0),e},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:{priority:90,parse:function(e,t,n,r){var a=function(o){return o===0?7:o};switch(t){case"i":case"ii":return O(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return n.day(e,{width:"abbreviated",context:"formatting",valueCallback:a})||n.day(e,{width:"short",context:"formatting",valueCallback:a})||n.day(e,{width:"narrow",context:"formatting",valueCallback:a});case"iiiii":return n.day(e,{width:"narrow",context:"formatting",valueCallback:a});case"iiiiii":return n.day(e,{width:"short",context:"formatting",valueCallback:a})||n.day(e,{width:"narrow",context:"formatting",valueCallback:a});case"iiii":default:return n.day(e,{width:"wide",context:"formatting",valueCallback:a})||n.day(e,{width:"abbreviated",context:"formatting",valueCallback:a})||n.day(e,{width:"short",context:"formatting",valueCallback:a})||n.day(e,{width:"narrow",context:"formatting",valueCallback:a})}},validate:function(e,t,n){return t>=1&&t<=7},set:function(e,t,n,r){return(e=function(a,o){T(2,arguments);var i=M(o);i%7==0&&(i-=7);var s=1,u=v(a),l=u.getUTCDay(),g=i%7,d=(g+7)%7,w=(d<s?7:0)+i-l;return u.setUTCDate(u.getUTCDate()+w),u}(e,n,r)).setUTCHours(0,0,0,0),e},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:{priority:80,parse:function(e,t,n,r){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}},set:function(e,t,n,r){return e.setUTCHours(He(n),0,0,0),e},incompatibleTokens:["b","B","H","K","k","t","T"]},b:{priority:80,parse:function(e,t,n,r){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}},set:function(e,t,n,r){return e.setUTCHours(He(n),0,0,0),e},incompatibleTokens:["a","B","H","K","k","t","T"]},B:{priority:80,parse:function(e,t,n,r){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}},set:function(e,t,n,r){return e.setUTCHours(He(n),0,0,0),e},incompatibleTokens:["a","b","t","T"]},h:{priority:70,parse:function(e,t,n,r){switch(t){case"h":return U(tn,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return O(t.length,e)}},validate:function(e,t,n){return t>=1&&t<=12},set:function(e,t,n,r){var a=e.getUTCHours()>=12;return a&&n<12?e.setUTCHours(n+12,0,0,0):a||n!==12?e.setUTCHours(n,0,0,0):e.setUTCHours(0,0,0,0),e},incompatibleTokens:["H","K","k","t","T"]},H:{priority:70,parse:function(e,t,n,r){switch(t){case"H":return U(Jt,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return O(t.length,e)}},validate:function(e,t,n){return t>=0&&t<=23},set:function(e,t,n,r){return e.setUTCHours(n,0,0,0),e},incompatibleTokens:["a","b","h","K","k","t","T"]},K:{priority:70,parse:function(e,t,n,r){switch(t){case"K":return U(en,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return O(t.length,e)}},validate:function(e,t,n){return t>=0&&t<=11},set:function(e,t,n,r){return e.getUTCHours()>=12&&n<12?e.setUTCHours(n+12,0,0,0):e.setUTCHours(n,0,0,0),e},incompatibleTokens:["a","b","h","H","k","t","T"]},k:{priority:70,parse:function(e,t,n,r){switch(t){case"k":return U(Zt,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return O(t.length,e)}},validate:function(e,t,n){return t>=1&&t<=24},set:function(e,t,n,r){var a=n<=24?n%24:n;return e.setUTCHours(a,0,0,0),e},incompatibleTokens:["a","b","h","H","K","t","T"]},m:{priority:60,parse:function(e,t,n,r){switch(t){case"m":return U(nn,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return O(t.length,e)}},validate:function(e,t,n){return t>=0&&t<=59},set:function(e,t,n,r){return e.setUTCMinutes(n,0,0),e},incompatibleTokens:["t","T"]},s:{priority:50,parse:function(e,t,n,r){switch(t){case"s":return U(rn,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return O(t.length,e)}},validate:function(e,t,n){return t>=0&&t<=59},set:function(e,t,n,r){return e.setUTCSeconds(n,0),e},incompatibleTokens:["t","T"]},S:{priority:30,parse:function(e,t,n,r){return O(t.length,e,function(a){return Math.floor(a*Math.pow(10,3-t.length))})},set:function(e,t,n,r){return e.setUTCMilliseconds(n),e},incompatibleTokens:["t","T"]},X:{priority:10,parse:function(e,t,n,r){switch(t){case"X":return Z(rt,e);case"XX":return Z(at,e);case"XXXX":return Z(ot,e);case"XXXXX":return Z(st,e);case"XXX":default:return Z(it,e)}},set:function(e,t,n,r){return t.timestampIsSet?e:new Date(e.getTime()-n)},incompatibleTokens:["t","T","x"]},x:{priority:10,parse:function(e,t,n,r){switch(t){case"x":return Z(rt,e);case"xx":return Z(at,e);case"xxxx":return Z(ot,e);case"xxxxx":return Z(st,e);case"xxx":default:return Z(it,e)}},set:function(e,t,n,r){return t.timestampIsSet?e:new Date(e.getTime()-n)},incompatibleTokens:["t","T","X"]},t:{priority:40,parse:function(e,t,n,r){return ut(e)},set:function(e,t,n,r){return[new Date(1e3*n),{timestampIsSet:!0}]},incompatibleTokens:"*"},T:{priority:20,parse:function(e,t,n,r){return ut(e)},set:function(e,t,n,r){return[new Date(n),{timestampIsSet:!0}]},incompatibleTokens:"*"}},Dn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bn=/^'([^]*?)'?$/,vn=/''/g,pn=/\S/,Tn=/[a-zA-Z]/;function xn(e,t,n,r){T(3,arguments);var a=String(e),o=String(t),i={},s=i.locale||yt;if(!s.match)throw new RangeError("locale must contain match property");var u=s.options&&s.options.firstWeekContainsDate,l=u==null?1:M(u),g=i.firstWeekContainsDate==null?l:M(i.firstWeekContainsDate);if(!(g>=1&&g<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var d=s.options&&s.options.weekStartsOn,w=d==null?0:M(d),c=i.weekStartsOn==null?w:M(i.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(o==="")return a===""?v(n):new Date(NaN);var y,x={firstWeekContainsDate:g,weekStartsOn:c,locale:s},R=[{priority:10,set:kn,index:0}],f=o.match(yn).map(function(W){var _=W[0];return _==="p"||_==="P"?(0,vt[_])(W,s.formatLong,x):W}).join("").match(Dn),b=[];for(y=0;y<f.length;y++){var p=f[y];!i.useAdditionalWeekYearTokens&&xt(p)&&Ue(p),!i.useAdditionalDayOfYearTokens&&Tt(p)&&Ue(p);var H=p[0],F=wn[H];if(F){var j=F.incompatibleTokens;if(Array.isArray(j)){for(var S=void 0,B=0;B<b.length;B++){var z=b[B].token;if(j.indexOf(z)!==-1||z===H){S=b[B];break}}if(S)throw new RangeError("The format string mustn't contain `".concat(S.fullToken,"` and `").concat(p,"` at the same time"))}else if(F.incompatibleTokens==="*"&&b.length)throw new RangeError("The format string mustn't contain `".concat(p,"` and any other token at the same time"));b.push({token:H,fullToken:p});var V=F.parse(a,p,s.match,x);if(!V)return new Date(NaN);R.push({priority:F.priority,set:F.set,validate:F.validate,value:V.value,index:R.length}),a=V.rest}else{if(H.match(Tn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+H+"`");if(p==="''"?p="'":H==="'"&&(p=Cn(p)),a.indexOf(p)!==0)return new Date(NaN);a=a.slice(p.length)}}if(a.length>0&&pn.test(a))return new Date(NaN);var L=R.map(function(W){return W.priority}).sort(function(W,_){return _-W}).filter(function(W,_,De){return De.indexOf(W)===_}).map(function(W){return R.filter(function(_){return _.priority===W}).reverse()}).map(function(W){return W[0]}),G=v(n);if(isNaN(G))return new Date(NaN);var C=bt(G,pt(G)),I={};for(y=0;y<L.length;y++){var A=L[y];if(A.validate&&!A.validate(C,A.value,x))return new Date(NaN);var ee=A.set(C,I,A.value,x);ee[0]?(C=ee[0],Gt(I,ee[1])):C=ee}return C}function kn(e,t){if(t.timestampIsSet)return e;var n=new Date(0);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}function Cn(e){return e.match(bn)[1].replace(vn,"'")}function Mn(e){T(1,arguments);var t=v(e);return!isNaN(t)}function k(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var Sn=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return k(t==="yy"?r%100:r,t.length)},En=function(e,t){var n=e.getUTCMonth();return t==="M"?String(n+1):k(n+1,2)},Rn=function(e,t){return k(e.getUTCDate(),t.length)},Un=function(e,t){return k(e.getUTCHours()%12||12,t.length)},Pn=function(e,t){return k(e.getUTCHours(),t.length)},Nn=function(e,t){return k(e.getUTCMinutes(),t.length)},On=function(e,t){return k(e.getUTCSeconds(),t.length)},Bn=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return k(Math.floor(r*Math.pow(10,n-3)),t.length)},Yn="midnight",Fn="noon",qn="morning",Hn="afternoon",Ln="evening",In="night",Wn={G:function(e,t,n){var r=e.getUTCFullYear()>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"){var r=e.getUTCFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return Sn(e,t)},Y:function(e,t,n,r){var a=Xe(e,r),o=a>0?a:1-a;return t==="YY"?k(o%100,2):t==="Yo"?n.ordinalNumber(o,{unit:"year"}):k(o,t.length)},R:function(e,t){return k(kt(e),t.length)},u:function(e,t){return k(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return k(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){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return k(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){var r=e.getUTCMonth();switch(t){case"M":case"MM":return En(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){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return k(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){var a=Mt(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):k(a,t.length)},I:function(e,t,n){var r=Ct(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):k(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):Rn(e,t)},D:function(e,t,n){var r=function(a){T(1,arguments);var o=v(a),i=o.getTime();o.setUTCMonth(0,1),o.setUTCHours(0,0,0,0);var s=o.getTime(),u=i-s;return Math.floor(u/864e5)+1}(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):k(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();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){var a=e.getUTCDay(),o=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return k(o,2);case"eo":return n.ordinalNumber(o,{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){var a=e.getUTCDay(),o=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return k(o,t.length);case"co":return n.ordinalNumber(o,{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){var r=e.getUTCDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return k(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){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,a=e.getUTCHours();switch(r=a===12?Fn:a===0?Yn:a/12>=1?"pm":"am",t){case"b":case"bb":case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,a=e.getUTCHours();switch(r=a>=17?Ln:a>=12?Hn:a>=4?qn:In,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){var r=e.getUTCHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Un(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Pn(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):k(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):k(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Nn(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):On(e,t)},S:function(e,t){return Bn(e,t)},X:function(e,t,n,r){var a=(r._originalDate||e).getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return mt(a);case"XXXX":case"XX":return ie(a);case"XXXXX":case"XXX":default:return ie(a,":")}},x:function(e,t,n,r){var a=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return mt(a);case"xxxx":case"xx":return ie(a);case"xxxxx":case"xxx":default:return ie(a,":")}},O:function(e,t,n,r){var a=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ft(a,":");case"OOOO":default:return"GMT"+ie(a,":")}},z:function(e,t,n,r){var a=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ft(a,":");case"zzzz":default:return"GMT"+ie(a,":")}},t:function(e,t,n,r){var a=r._originalDate||e;return k(Math.floor(a.getTime()/1e3),t.length)},T:function(e,t,n,r){return k((r._originalDate||e).getTime(),t.length)}};function ft(e,t){var n=e>0?"-":"+",r=Math.abs(e),a=Math.floor(r/60),o=r%60;if(o===0)return n+String(a);var i=t;return n+String(a)+i+k(o,2)}function mt(e,t){return e%60==0?(e>0?"-":"+")+k(Math.abs(e)/60,2):ie(e,t)}function ie(e,t){var n=t||"",r=e>0?"-":"+",a=Math.abs(e);return r+k(Math.floor(a/60),2)+n+k(a%60,2)}var jn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,An=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qn=/^'([^]*?)'?$/,Gn=/''/g,_n=/[a-zA-Z]/;function we(e,t,n){T(2,arguments);var r=String(t),a={},o=a.locale||yt,i=o.options&&o.options.firstWeekContainsDate,s=i==null?1:M(i),u=a.firstWeekContainsDate==null?s:M(a.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var l=o.options&&o.options.weekStartsOn,g=l==null?0:M(l),d=a.weekStartsOn==null?g:M(a.weekStartsOn);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var w=v(e);if(!Mn(w))throw new RangeError("Invalid time value");var c=pt(w),y=bt(w,c),x={firstWeekContainsDate:u,weekStartsOn:d,locale:o,_originalDate:w},R=r.match(An).map(function(f){var b=f[0];return b==="p"||b==="P"?(0,vt[b])(f,o.formatLong,x):f}).join("").match(jn).map(function(f){if(f==="''")return"'";var b=f[0];if(b==="'")return Xn(f);var p=Wn[b];if(p)return!a.useAdditionalWeekYearTokens&&xt(f)&&Ue(f),!a.useAdditionalDayOfYearTokens&&Tt(f)&&Ue(f),p(y,f,o.localize,x);if(b.match(_n))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return f}).join("");return R}function Xn(e){return e.match(Qn)[1].replace(Gn,"'")}/*! *****************************************************************************
|
|
2
|
-
Copyright (c) Microsoft Corporation.
|
|
3
|
-
|
|
4
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
-
purpose with or without fee is hereby granted.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */function q(e,t){T(2,arguments);var n=v(e),r=M(t);return isNaN(r)?new Date(NaN):(r&&n.setDate(n.getDate()+r),n)}function de(e,t){T(1,arguments);var n=e||{},r=v(n.start),a=v(n.end),o=a.getTime();if(!(r.getTime()<=o))throw new RangeError("Invalid interval");var i=[],s=r;s.setHours(0,0,0,0);var u=1;if(isNaN(u))throw new RangeError("`options.step` must be a number greater than 1");for(;s.getTime()<=o;)i.push(v(s)),s.setDate(s.getDate()+u),s.setHours(0,0,0,0);return i}function zn(e,t){T(1,arguments);var n={},r=n.locale,a=r&&r.options&&r.options.weekStartsOn,o=a==null?0:M(a),i=n.weekStartsOn==null?o:M(n.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=v(e),u=s.getDay(),l=6+(u<i?-7:0)-(u-i);return s.setDate(s.getDate()+l),s.setHours(23,59,59,999),s}function St(e){T(1,arguments);var t=v(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Vn(e,t){T(1,arguments);var n={},r=n.locale,a=r&&r.options&&r.options.weekStartsOn,o=a==null?0:M(a),i=n.weekStartsOn==null?o:M(n.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=v(e),u=s.getDay(),l=(u<i?7:0)+u-i;return s.setDate(s.getDate()-l),s.setHours(0,0,0,0),s}function $n(e){var t=e===void 0?{}:e,n=t.firstDayOfWeek,r=n===void 0?1:n,a=t.weekdayLabelFormat,o=a===void 0?function(s){return we(s,"iiiiii")}:a,i=new Date;return de({start:q(Vn(i),r),end:q(zn(i),r)}).reduce(function(s,u){return s.push(o(u)),s},[])}function Kn(e){var t=e.year,n=e.month,r=e.firstDayOfWeek,a=r===void 0?1:r,o=e.dayLabelFormat,i=o===void 0?function(d){return we(d,"dd")}:o,s=new Date(t,n),u=St(s),l=function(d){T(1,arguments);var w=v(d),c=w.getDay();return c}(u),g=function(d){T(1,arguments);var w=v(d),c=w.getMonth();return w.setFullYear(w.getFullYear(),c+1,0),w.setHours(23,59,59,999),w}(s);return function(){for(var d=0,w=0,c=arguments.length;w<c;w++)d+=arguments[w].length;var y=Array(d),x=0;for(w=0;w<c;w++)for(var R=arguments[w],f=0,b=R.length;f<b;f++,x++)y[x]=R[f];return y}(Array.from(Array(l>=a?l-a:6-a+l+1).keys()).fill(0),de({start:u,end:g}).map(function(d){return{date:d,dayLabel:i(d)}}))}var Jn=function(e){return we(e,"dd")},Zn=function(e){return we(e,"eeeeee")},er=function(e){return we(e,"MMMM yyyy")};function tr(e){var t=e.year,n=e.month,r=e.firstDayOfWeek,a=r===void 0?1:r,o=e.dayLabelFormat,i=o===void 0?Jn:o,s=e.weekdayLabelFormat,u=s===void 0?Zn:s,l=e.monthLabelFormat,g=l===void 0?er:l;return{days:D.useMemo(function(){return Kn({year:t,month:n,firstDayOfWeek:a,dayLabelFormat:i})},[t,n,a,i]),weekdayLabels:D.useMemo(function(){return $n({firstDayOfWeek:a,weekdayLabelFormat:u})},[a,u]),monthLabel:g(new Date(t,n))}}function oe(e,t){T(2,arguments);var n=v(e),r=v(t);return n.getTime()<r.getTime()}function Ce(e,t){T(2,arguments);var n=v(e),r=v(t);return n.getTime()>r.getTime()}function he(e,t){T(2,arguments);var n=t||{},r=v(e).getTime(),a=v(n.start).getTime(),o=v(n.end).getTime();if(!(a<=o))throw new RangeError("Invalid interval");return r>=a&&r<=o}function Ae(e){T(1,arguments);var t=v(e);return t.setHours(0,0,0,0),t}function J(e,t){T(2,arguments);var n=Ae(e),r=Ae(t);return n.getTime()===r.getTime()}function Qe(e,t){T(2,arguments);var n=v(e),r=M(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var a=n.getDate(),o=new Date(n.getTime());o.setMonth(n.getMonth()+r+1,0);var i=o.getDate();return a>=i?o:(n.setFullYear(o.getFullYear(),o.getMonth(),a),n)}var Et=function(e,t){return e===void 0&&(e=[]),e.some(function(n){return J(t,n)})};function nr(e,t,n){return!(!t||!n)&&he(e,{start:t,end:n})}function rr(e,t,n){return!!(t&&J(e,t)||n&&J(e,n))}function ar(e,t){return!(!t||!J(e,t))}function or(e,t){return!(!t||!J(e,t))}function ir(e){var t=e.date,n=e.minBookingDate,r=e.maxBookingDate,a=e.isDateBlockedFn,o=e.startDate,i=e.endDate,s=e.minBookingDays,u=s===void 0?1:s,l=e.unavailableDates,g=l===void 0?[]:l,d=n&&new Date(n.getFullYear(),n.getMonth(),n.getDate(),0,0,0),w=r&&new Date(r.getFullYear(),r.getMonth(),r.getDate(),0,0,0);return!!(Et(g,t)||d&&oe(t,d)||w&&Ce(t,w)||o&&!i&&u>1&&he(t,{start:o,end:q(o,u-2)})||a&&a(t))}function Me(e){var t=St(e);return{year:function(n){T(1,arguments);var r=v(n),a=r.getFullYear();return a}(t),month:function(n){T(1,arguments);var r=v(n),a=r.getMonth();return a}(t),date:t}}function sr(){return Me(Ae(Date.now()))}function Te(e,t){var n=t?Me(t):sr(),r=n.date,a=[n];return e>1&&(a=Array.from(Array(e-1).keys()).reduce(function(o){return r=Qe(o[o.length-1].date,1),o.concat([Me(r)])},a)),a}function fe(e,t,n,r){var a=e[r?n>0?0:e.length-r:n>0?e.length-1:0].date;return Array.from(Array(t).keys()).reduce(function(o){return a=o.length===0?Qe(a,n):Qe(a,n>=0?1:-1),n>0?o.concat([Me(a)]):[Me(a)].concat(o)},[])}function ur(e,t,n){return e&&typeof t=="string"?we(e,t):e&&typeof t=="function"?t(e):n}function xe(e){var t=e.startDate,n=e.endDate,r=e.isDateBlocked,a=e.minBookingDays,o=e.exactMinBookingDays,i=e.minBookingDate,s=e.maxBookingDate,u=!i||!oe(t,q(i,-1)),l=!s||!Ce(q(t,a-1),s);return!(!t||a!==1||n||r(t))||(t&&a>1&&!n&&!o||t&&a>0&&o&&u&&l||t&&a>0&&o&&!i&&!s?!de({start:t,end:q(t,a-1)}).some(function(g){return r(g)}):!(!t||!n||o)&&!oe(n,q(t,a-1))&&!de({start:t,end:n}).some(function(g){return r(g)}))}function cr(e){var t=e.startDate,n=e.endDate,r=e.focusedInput,a=e.minBookingDate,o=e.maxBookingDate,i=e.onDatesChange,s=e.initialVisibleMonth,u=e.exactMinBookingDays,l=u!==void 0&&u,g=e.minBookingDays,d=g===void 0?1:g,w=e.numberOfMonths,c=w===void 0?2:w,y=e.firstDayOfWeek,x=y===void 0?1:y,R=e.isDateBlocked,f=R===void 0?function(){return!1}:R,b=e.unavailableDates,p=b===void 0?[]:b,H=e.changeActiveMonthOnSelect,F=H===void 0||H,j=D.useState(function(){return Te(c,t||s||null)}),S=j[0],B=j[1],z=D.useState(null),V=z[0],L=z[1],G=D.useState(t),C=G[0],I=G[1];D.useEffect(function(){return typeof window<"u"&&window.addEventListener&&window.addEventListener("keydown",_),function(){window.removeEventListener&&window.removeEventListener("keydown",_)}});var A=function(h){return Et(p,h)||f(h)},ee=function(h){I(h),(!C||C&&!J(h,C))&&B(Te(c,h))},W=function(h){return ir({date:h,minBookingDate:a,maxBookingDate:o,startDate:t,endDate:n,minBookingDays:d,isDateBlockedFn:A})};function _(h){if((h.key==="ArrowRight"||h.key==="ArrowLeft"||h.key==="ArrowDown"||h.key==="ArrowUp")&&!C){var Q=S[0];ee(Q.date),B(Te(c,Q.date))}}var De=D.useCallback(function(){B(fe(S,c,-1)),I(null)},[S,c]),Pe=D.useCallback(function(){B(fe(S,c,-1,1)),I(null)},[S,c]),Ne=D.useCallback(function(){B(fe(S,c,1)),I(null)},[S,c]),Oe=D.useCallback(function(){B(fe(S,c,1,1)),I(null)},[S,c]),Be=D.useCallback(function(h){B(Te(c,h)),I(null)},[c]),Se=D.useCallback(function(h){h===void 0&&(h=1),B(fe(S,c,-(12*h-c+1))),I(null)},[S,c]),te=D.useCallback(function(h){h===void 0&&(h=1),B(fe(S,c,12*h-c+1)),I(null)},[S,c]);return{firstDayOfWeek:x,activeMonths:S,isDateSelected:function(h){return nr(h,t,n)},isDateHovered:function(h){return function(Q){var ae=Q.date,m=Q.startDate,N=Q.endDate,X=Q.isDateBlocked,E=Q.hoveredDate,$=Q.minBookingDays,Ee=Q.exactMinBookingDays;return E&&$>1&&Ee&&he(ae,{start:E,end:q(E,$-1)})?!de({start:E,end:q(E,$-1)}).some(function(ne){return X(ne)}):m&&!N&&E&&he(ae,{start:m,end:q(m,$-1)})&&J(m,E)&&$>1?!de({start:m,end:q(m,$-1)}).some(function(ne){return X(ne)}):!(!m||N||!E||oe(E,m)||!he(ae,{start:m,end:E}))&&!de({start:m,end:E}).some(function(ne){return X(ne)})}({date:h,hoveredDate:V,startDate:t,endDate:n,minBookingDays:d,exactMinBookingDays:l,isDateBlocked:A})},isFirstOrLastSelectedDate:function(h){return rr(h,t,n)},isStartDate:function(h){return ar(h,t)},isEndDate:function(h){return or(h,n)},isDateBlocked:W,numberOfMonths:c,isDateFocused:function(h){return!!C&&J(h,C)},focusedDate:C,hoveredDate:V,onResetDates:function(){i({startDate:null,endDate:null,focusedInput:"startDate"})},onDateHover:function(h){if(h){if(h){var Q=!W(h)||t&&J(h,t),ae=!a||!oe(h,q(a,-1)),m=!o||!Ce(h,o),N=q(h,d-1),X=!a||!oe(N,a),E=!o||!Ce(N,o),$=l&&d>1&&ae&&m&&X&&E,Ee=t&&!n&&!l&&ae&&m,ne=!(d>1&&t)||he(h,{start:t,end:q(t,d-2)}),ye=t&&J(h,t)&≠Q&&($||Ee||ye)?L(h):V!==null&&L(null)}}else L(null)},onDateSelect:function(h){(r==="endDate"||r==="startDate")&&d>0&&l&&xe({minBookingDays:d,exactMinBookingDays:l,minBookingDate:a,maxBookingDate:o,isDateBlocked:A,startDate:h,endDate:null})?i({startDate:h,endDate:q(h,d-1),focusedInput:null}):(r==="endDate"&&t&&oe(h,t)||r==="startDate"&&n&&Ce(h,n))&&!l&&xe({minBookingDays:d,isDateBlocked:A,startDate:h,endDate:null})?i({endDate:null,startDate:h,focusedInput:"endDate"}):r==="startDate"&&!l&&xe({minBookingDays:d,isDateBlocked:A,endDate:n,startDate:h})?i({endDate:n,startDate:h,focusedInput:"endDate"}):r==="startDate"&&!l&&xe({minBookingDays:d,isDateBlocked:A,endDate:null,startDate:h})?i({endDate:null,startDate:h,focusedInput:"endDate"}):r==="endDate"&&t&&!oe(h,t)&&!l&&xe({minBookingDays:d,isDateBlocked:A,startDate:t,endDate:h})&&i({startDate:t,endDate:h,focusedInput:null}),r!=="endDate"&&(!C||C&&!J(h,C))&&F&&B(Te(c,h))},onDateFocus:ee,goToPreviousMonths:De,goToPreviousMonthsByOneMonth:Pe,goToNextMonths:Ne,goToNextMonthsByOneMonth:Oe,goToDate:Be,goToPreviousYear:Se,goToNextYear:te}}function dr(e){var t=e.date,n=e.focusedDate,r=e.isDateSelected,a=e.isDateFocused,o=e.isFirstOrLastSelectedDate,i=e.isDateHovered,s=e.isDateBlocked,u=e.onDateSelect,l=e.onDateFocus,g=e.onDateHover,d=D.useCallback(function(){return u(t)},[t,u]),w=D.useCallback(function(){return g(t)},[t,g]),c=s(t)&&!i(t);return{tabIndex:n===null||a(t)?0:-1,isSelected:r(t),isSelectedStartOrEnd:o(t),isWithinHoverRange:i(t),disabledDate:c,onKeyDown:function(y){y.key==="ArrowRight"?l(q(t,1)):y.key==="ArrowLeft"?l(q(t,-1)):y.key==="ArrowUp"?l(q(t,-7)):y.key==="ArrowDown"&&l(q(t,7))},onClick:c?function(){}:d,onMouseEnter:w}}var ze=(e=>(e.ShortDate="MM/dd/yyyy",e.LongDate="MMM dd yyyy",e.DayOfWeekDayOfMonth="eeee, MMMM do",e))(ze||{}),K=(e=>(e.StartDate="startDate",e.EndDate="endDate",e))(K||{});const re=new Date,Ve=re.getFullYear(),lr=re.getMonth(),fr=re,Rt=Ve-100,Ut=Ve+5,Ge=ze.ShortDate,mr={dateFormat:Ge,endDate:null,focusedInput:null,withDateRange:!1,maxYear:Ut,minYear:Rt,startDate:null,standalone:!1,onClose:()=>{throw new Error("onClose(): boolean not implemented")},setFocusedInput:()=>{throw new Error("setFocusedInput(): boolean not implemented")},clearDates:()=>{throw new Error("clearDates(): boolean not implemented")},onQuickOptionSelect:()=>{throw new Error("onQuickOptionSelect(): boolean not implemented")},onTimeChange:()=>{throw new Error("onTimeChange(): boolean not implemented")},focusedDate:re,firstDayOfWeek:void 0,activeMonths:[],isDateFocused:()=>{throw new Error("isDateFocused(): boolean not implemented")},isDateSelected:()=>{throw new Error("isDateSelected(): boolean not implemented")},isDateHovered:()=>{throw new Error("isDateHovered(): boolean not implemented")},isDateBlocked:()=>{throw new Error("isDateBlocked(): boolean not implemented")},isFirstOrLastSelectedDate:()=>{throw new Error("isFirstOrLastSelectedDate(): boolean not implemented")},onDateFocus:()=>{throw new Error("onDateFocus(): boolean not implemented")},onDateHover:()=>{throw new Error("onDateHover(): boolean not implemented")},onDateSelect:()=>{throw new Error("onDateSelect(): boolean not implemented")},goToPreviousMonths:()=>{throw new Error("goToPreviousMonths(): boolean not implemented")},goToNextMonths:()=>{throw new Error("goToNextMonths(): boolean not implemented")},goToDate:()=>{throw new Error("goToDate(): boolean not implemented")}},Pt=D.createContext(mr),le=()=>D.useContext(Pt),hr=["root"],ht={bg:"background.secondary",borderColor:"border.focus",color:"text.contrast",_hover:{bg:"background.secondary"}},gr={default:{root:{borderColor:"transparent",_hover:{bg:"background.secondaryAlpha.hover"}}},disabled:{root:{bg:"background.subtle",borderColor:"transparent",cursor:"not-allowed",opacity:.4}},inRange:{root:{bg:"background.secondaryAlpha.pressed",borderColor:"transparent",borderRadius:"none",color:"text.info"}},selectedEnd:{root:{borderColor:"border.focus",color:"text.info"}},selectedStart:{root:ht},selectedRange:{root:{...ht,borderRadius:"sm"}}},wr=Yt.defineSlotRecipe({slots:hr,base:{root:{border:"2px",borderRadius:"4px",color:"text.subtle",cursor:"pointer",fontSize:"sm",fontWeight:"normal !important",position:"relative",px:3,py:1,overflow:"hidden"}},variants:{variant:gr,isToday:{true:{root:{color:"text",fontWeight:"semibold"}},false:{}},withDateRange:{true:{},false:{}}},compoundVariants:[{variant:["selectedStart","selectedRange"],isToday:!0,css:{root:{color:"text.contrast"}}},{variant:"inRange",isToday:!0,css:{root:{color:"text.info"}}},{withDateRange:!0,variant:"selectedStart",css:{root:{borderRightRadius:0}}},{withDateRange:!0,variant:"selectedEnd",css:{root:{borderLeftRadius:0}}}],defaultVariants:{}}),me=e=>e==="selectedStart"||e==="selectedEnd"||e==="inRange"||e==="selectedRange",se=({date:e,startDate:t,endDate:n,dateFormat:r,disabledDate:a,isSelected:o,isDateSelected:i,isDateBlocked:s})=>{const u=a||s(e),l=o||i(e);if(u)return"disabled";if(!t||!n)return l?"selectedRange":"default";const g=Y.format(e,r),d=Y.format(t,r),w=Y.format(n,r),c=g===d,y=g===w;return c&&y?"selectedRange":c?"selectedStart":y?"selectedEnd":l&&!c&&!y?"inRange":"default"},Dr=({dayLabel:e,date:t,onDaySelected:n,cornerRounding:r,["data-testid"]:a="kibble-datepicker-day"})=>{const o=D.useRef(null),{startDate:i,endDate:s,dateFormat:u,withDateRange:l}=le(),g=D.useMemo(()=>Ft.isToday(t),[t]),{focusedDate:d,isDateFocused:w,isDateSelected:c,isDateHovered:y,isDateBlocked:x,isFirstOrLastSelectedDate:R,onDateSelect:f,onDateFocus:b,onDateHover:p}=le(),{disabledDate:H,isSelected:F,onClick:j,onKeyDown:S,onMouseEnter:B,tabIndex:z}=dr({date:t,focusedDate:d,isDateFocused:w,isDateSelected:c,isDateHovered:y,isDateBlocked:x,isFirstOrLastSelectedDate:R,onDateFocus:b,onDateSelect:f,onDateHover:p}),V=D.useMemo(()=>({borderTopLeftRadius:r?.roundTopLeft?"sm":"none",borderTopRightRadius:r?.roundTopRight?"sm":"none",borderBottomLeftRadius:r?.roundBottomLeft?"sm":"none",borderBottomRightRadius:r?.roundBottomRight?"sm":"none"}),[r]),L=D.useMemo(()=>se({date:t,startDate:i,endDate:s,dateFormat:u,isDateSelected:c,isDateBlocked:x,disabledDate:H,isSelected:F}),[t,i,s,u,c,x,H,F]),C=qt.useSlotRecipe({recipe:wr})({variant:L,isToday:g,withDateRange:l});if(!e)return P.jsxRuntimeExports.jsx(P.jsxRuntimeExports.Fragment,{});const I=()=>{L!=="disabled"&&(j(),n())};return P.jsxRuntimeExports.jsx(je.Button,{className:"DatePicker__Day","data-testid":`${a}-${Y.format(t,"MM/dd/yyyy")}`,onClick:I,onKeyDown:S,onMouseEnter:B,tabIndex:z,ref:o,unstyled:!0,css:C.root,...V,children:e})},yr=e=>{const{startDate:t,endDate:n,dateFormat:r,isDateSelected:a,isDateBlocked:o}=le();return D.useMemo(()=>{const u=[];return e.some(g=>typeof g=="object"&&g!==null&&me(se({date:g.date,startDate:t,endDate:n,dateFormat:r,isDateSelected:a,isDateBlocked:o})))?(e.forEach((g,d)=>{if(typeof g!="object"||g===null){u.push(null);return}const w=se({date:g.date,startDate:t,endDate:n,dateFormat:r,isDateSelected:a,isDateBlocked:o}),c=Math.floor(d/7),y=d%7;if(!me(w)){u.push({roundTopLeft:!1,roundTopRight:!1,roundBottomLeft:!1,roundBottomRight:!1});return}const x=y===0?null:d-1,R=y===6?null:d+1,f=x!==null?e[x]:null,b=f!==null&&typeof f=="object"?se({date:f.date,startDate:t,endDate:n,dateFormat:r,isDateSelected:a,isDateBlocked:o}):"default",p=R!==null?e[R]:null,H=p!==null&&typeof p=="object"?se({date:p.date,startDate:t,endDate:n,dateFormat:r,isDateSelected:a,isDateBlocked:o}):"default",F=c===0?null:d-7,j=d+7>=e.length?null:d+7,S=F!==null&&F>=0?e[F]:null,B=S!==null&&typeof S=="object"?se({date:S.date,startDate:t,endDate:n,dateFormat:r,isDateSelected:a,isDateBlocked:o}):"default",z=j!==null&&j<e.length?e[j]:null,V=z!==null&&typeof z=="object"?se({date:z.date,startDate:t,endDate:n,dateFormat:r,isDateSelected:a,isDateBlocked:o}):"default",L=y===0||!me(b),G=y===6||!me(H),C=c===0||!me(B),I=j===null||!me(V);u.push({roundTopLeft:C&&L,roundTopRight:C&&G,roundBottomLeft:I&&L,roundBottomRight:I&&G})}),u):e.map(()=>null)},[e,t,n,r,a,o])},br=({onDaySelected:e,month:t,showMonthLabels:n,["data-testid"]:r="kibble-datepicker-month"})=>{const a=D.useRef(null),{firstDayOfWeek:o,activeMonth:i}=le(),s=D.useMemo(()=>t?.year||i?.year||Ve,[t,i]),u=D.useMemo(()=>t?.month!==void 0?t.month:i?.month!==void 0?i.month:lr,[t,i]),{days:l,weekdayLabels:g,monthLabel:d}=tr({year:s,month:u,firstDayOfWeek:o}),w=yr(l);return P.jsxRuntimeExports.jsxs(Bt.Box,{ref:a,className:"DatePicker__Month","data-testid":r,px:3,children:[n&&P.jsxRuntimeExports.jsx(We.WrappedText,{size:"sm",fontWeight:"semibold",textAlign:"center",children:d}),P.jsxRuntimeExports.jsx(Ye.Grid,{templateColumns:"repeat(7, 1fr)",my:2,children:g.map(c=>P.jsxRuntimeExports.jsx(Ye.GridItem,{children:P.jsxRuntimeExports.jsx(Dt.Center,{children:P.jsxRuntimeExports.jsx(We.WrappedText,{size:"xs",fontWeight:"semibold",children:c})})},c))}),P.jsxRuntimeExports.jsx(Ye.Grid,{templateColumns:"repeat(7, 1fr)",children:l.map((c,y)=>typeof c=="object"?P.jsxRuntimeExports.jsx(Dr,{date:c.date,dayLabel:c.dayLabel,onDaySelected:e,cornerRounding:w[y]},c.date.toString()):P.jsxRuntimeExports.jsx("div",{},y))})]})};function vr({showMonthLabels:e,["data-testid"]:t="kibble-datepicker-calendar"}){const{withDateRange:n,activeMonths:r,onClose:a,standalone:o}=le(),{setOpen:i}=Ht.usePopoverContext(),s=()=>{n||(o||i(!1),a())};return P.jsxRuntimeExports.jsx(Lt.Flex,{className:"DatePicker__Calendar","data-testid":t,py:2,children:r.map(u=>P.jsxRuntimeExports.jsx(br,{month:u,onDaySelected:s,showMonthLabels:e},`${u.year}-${u.month}`))})}var pr=Math.ceil,Tr=Math.max;function xr(e,t,n,r){for(var a=-1,o=Tr(pr((t-e)/(n||1)),0),i=Array(o);o--;)i[++a]=e,e+=n;return i}function kr(e,t,n){if(!ue.isObject(n))return!1;var r=typeof t;return(r=="number"?ue.isArrayLike(n)&&ue.isIndex(t,n.length):r=="string"&&t in n)?ue.eq(n[t],e):!1}var Cr=/\s/;function Mr(e){for(var t=e.length;t--&&Cr.test(e.charAt(t)););return t}var Sr=/^\s+/;function Er(e){return e&&e.slice(0,Mr(e)+1).replace(Sr,"")}var gt=NaN,Rr=/^[-+]0x[0-9a-f]+$/i,Ur=/^0b[01]+$/i,Pr=/^0o[0-7]+$/i,Nr=parseInt;function Or(e){if(typeof e=="number")return e;if(ue.isSymbol(e))return gt;if(ue.isObject(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ue.isObject(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Er(e);var n=Ur.test(e);return n||Pr.test(e)?Nr(e.slice(2),n?2:8):Rr.test(e)?gt:+e}var Br=1/0,Yr=17976931348623157e292;function Le(e){if(!e)return e===0?e:0;if(e=Or(e),e===Br||e===-1/0){var t=e<0?-1:1;return t*Yr}return e===e?e:0}function Fr(e){return function(t,n,r){return r&&typeof r!="number"&&kr(t,n,r)&&(n=r=void 0),t=Le(t),n===void 0?(n=t,t=0):n=Le(n),r=r===void 0?t<n?1:-1:Le(r),xr(t,n,r)}}var qr=Fr();function Hr(e,t){const n=Y.toDate(e,t?.in),r=n.getFullYear(),a=n.getMonth(),o=Y.constructFrom(n,0);return o.setFullYear(r,a+1,0),o.setHours(0,0,0,0),o.getDate()}function Lr(e,t,n){const r=Y.toDate(e,n?.in),a=r.getFullYear(),o=r.getDate(),i=Y.constructFrom(e,0);i.setFullYear(a,t,15),i.setHours(0,0,0,0);const s=Hr(i);return r.setMonth(t,Math.min(o,s)),r}function wt(e,t,n){let r=Y.toDate(e,n?.in);return isNaN(+r)?Y.constructFrom(e,NaN):(t.year!=null&&r.setFullYear(t.year),t.month!=null&&(r=Lr(r,t.month)),t.date!=null&&r.setDate(t.date),t.hours!=null&&r.setHours(t.hours),t.minutes!=null&&r.setMinutes(t.minutes),t.seconds!=null&&r.setSeconds(t.seconds),t.milliseconds!=null&&r.setMilliseconds(t.milliseconds),r)}const Ie=["January","February","March","April","May","June","July","August","September","October","November","December"];function Ir({triggerProps:e,withTriggers:t=!0,["data-testid"]:n="kibble-datepicker-header"}){const r=D.useRef(null),a=D.useRef(null),{focusedDate:o,activeMonth:i,minYear:s,maxYear:u,goToDate:l,goToNextMonths:g,goToPreviousMonths:d}=le(),w=D.useMemo(()=>Ie.map((f,b)=>{const p=b===i?.month;return{label:f,value:String(b),selected:p,...p&&{ref:r}}}),[i?.month]),c=D.useMemo(()=>qr(s,u+1).map(f=>{const b=String(f),p=f===i?.year;return{label:b,value:b,selected:p,...p&&{ref:a}}}),[i?.year,u,s]),y=({item:f})=>l(wt(o||re,{month:Number(f.value),year:i?.year})),x=({item:f})=>l(wt(o||re,{month:i?.month,year:Number(f.value)})),R=({type:f})=>{setTimeout(()=>{const b=f==="year"?a?.current:r?.current;b&&b.scrollIntoView({block:"center"})})};return P.jsxRuntimeExports.jsxs(It.HStack,{className:"DatePicker__Header","data-testid":n,w:"100%",justify:"space-between",py:2,px:3,children:[P.jsxRuntimeExports.jsx(je.Button,{iconName:"chevronLeft",onClick:d,variant:"ghostNeutral",size:"sm"}),t?P.jsxRuntimeExports.jsxs(Dt.Center,{gap:2,h:"100%",children:[P.jsxRuntimeExports.jsx(Ke.Menu,{"data-testid":`${n}-month-menu`,buttonProps:{variant:"tertiary",...e,text:Ie[i?.month||0],size:"sm"},listProps:{menuItems:w,onSelect:y,maxH:250},onOpenChange:({open:f})=>{f&&R({type:"month"})}}),P.jsxRuntimeExports.jsx(Ke.Menu,{"data-testid":`${n}-year-menu`,buttonProps:{variant:"tertiary",...e,text:String(i?.year),size:"sm"},listProps:{menuItems:c,onSelect:x,maxH:250},onOpenChange:({open:f})=>{f&&R({type:"year"})}})]}):P.jsxRuntimeExports.jsxs(We.WrappedText,{fontWeight:"semibold",children:[Ie[i?.month||0]," ",i?.year]}),P.jsxRuntimeExports.jsx(je.Button,{iconName:"chevronRight",onClick:g,variant:"ghostNeutral",size:"sm"})]})}function ke(e,t){const n=Y.toDate(e,t?.in);return n.setHours(23,59,59,999),n}function Nt(e,t,n){const r=Y.toDate(e,n?.in);return isNaN(t)?Y.constructFrom(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Ot(e,t,n){const r=Y.toDate(e,n?.in);if(isNaN(t))return Y.constructFrom(e,NaN);if(!t)return r;const a=r.getDate(),o=Y.constructFrom(e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const i=o.getDate();return a>=i?o:(r.setFullYear(o.getFullYear(),o.getMonth(),a),r)}function Wr(e,t,n){const{years:r=0,months:a=0,weeks:o=0,days:i=0,hours:s=0,minutes:u=0,seconds:l=0}=t,g=Y.toDate(e,n?.in),d=a||r?Ot(g,a+r*12):g,w=i||o?Nt(d,i+o*7):d,c=u+s*60,x=(l+c*60)*1e3;return Y.constructFrom(e,+w+x)}function _e(e,t){return+Y.toDate(e)>+Y.toDate(t)}const jr=({children:e,dateFormat:t=Ge,endDate:n,inputProps:r,maxDate:a,maxDaysInRange:o,maxYear:i,minDate:s,minYear:u,numberOfMonths:l=1,onDateChange:g,placement:d="bottom",startDate:w,withDateRange:c,sameWidth:y=!1,standalone:x=!1,firstDayOfWeek:R=1})=>{const[f,b]=D.useState({startDate:w,endDate:n||w,focusedInput:x?K.StartDate:null}),p=D.useRef(l),H=D.useCallback(m=>{if(o&&m)return ke(Wr(m,{days:o}));if(a)return ke(a)},[a,o]),F=D.useCallback((m,N)=>{if(!N)return N;const X=H(m);return X&&_e(N,X)?null:N},[H]),j=D.useCallback((m,N)=>!m||!N?{startDate:m,endDate:N}:_e(m,N)?{startDate:m,endDate:ke(m)}:{startDate:m,endDate:N},[]),S=m=>{if(!m)return;m.endDate||(m.endDate=m.startDate),m.endDate=F(m.startDate,m.endDate),m.startDate=m.startDate?Y.startOfDay(m.startDate):m.startDate,m.endDate=m.endDate?ke(m.endDate):m.endDate;const N=j(m.startDate,m.endDate);m.startDate=N.startDate,m.endDate=N.endDate,b({...m,focusedInput:m.focusedInput||K.StartDate}),(!c&&g||x&&g)&&g(m)},B=D.useCallback(m=>{b({startDate:m.startDate,endDate:m.endDate||null,focusedInput:null})},[]),z=D.useCallback(({open:m})=>{b({startDate:null,endDate:null,focusedInput:m?K.StartDate:null})},[]),V=D.useCallback((m,N)=>{m&&b(X=>{const E={...X},$=N||X.focusedInput,ne=($===K.EndDate?X.endDate:X.startDate)||X.startDate||new Date,ye=new Date(ne);ye.setHours(m.getHours(),m.getMinutes(),0,0),$===K.EndDate?E.endDate=ye:E.startDate=ye,E.endDate=F(E.startDate,E.endDate);const $e=j(E.startDate,E.endDate);return E.startDate=$e.startDate,E.endDate=$e.endDate,E})},[F,j]),{activeMonths:L,focusedDate:G,goToDate:C,goToNextMonthsByOneMonth:I,goToPreviousMonthsByOneMonth:A,isDateBlocked:ee,isDateFocused:W,isDateHovered:_,isDateSelected:De,isFirstOrLastSelectedDate:Pe,onDateFocus:Ne,onDateHover:Oe,onDateSelect:Be}=cr({endDate:f.endDate,focusedInput:f.focusedInput,initialVisibleMonth:f.startDate||re,maxBookingDate:c&&f.focusedInput===K.StartDate?void 0:H(f.startDate),minBookingDate:s,minBookingDays:1,firstDayOfWeek:R,numberOfMonths:l,onDatesChange:S,startDate:f.startDate,...!c&&{exactMinBookingDays:!0}}),Se=D.useCallback(m=>{m===K.EndDate&&f.endDate?C(f.endDate):f.startDate&&C(f.startDate)},[C,f.endDate,f.startDate]),te=D.useCallback(m=>{b(N=>({...N,focusedInput:m})),Se(m)},[Se]),h=()=>{r?.disabled||(!f.startDate||!c)&&te(K.StartDate)},Q=D.useCallback(()=>{te(null),c&&g&&setTimeout(()=>{g({startDate:f.startDate,endDate:f.endDate})},200)},[c,g,te,f.endDate,f.startDate]),ae=D.useMemo(()=>L[0],[L]);return D.useEffect(()=>{x&&!f.focusedInput&&te(K.StartDate)},[x,f.focusedInput,te]),D.useEffect(()=>{if(p.current!==l){const m=L[0]?.date||G||f.startDate||re;C(m),p.current=l}},[l,L,G,C,f.startDate]),D.useEffect(()=>{b(m=>({...m,startDate:w,endDate:n||w}))},[w,n]),P.jsxRuntimeExports.jsx(Pt.Provider,{value:{activeMonth:ae,activeMonths:L,dateFormat:t||Ge,endDate:f.endDate||null,firstDayOfWeek:R,focusedDate:G||fr,focusedInput:f.focusedInput,goToDate:C,goToNextMonths:I,goToPreviousMonths:A,setFocusedInput:te,isDateBlocked:ee,isDateFocused:W,isDateHovered:_,withDateRange:c||!1,isDateSelected:De,isFirstOrLastSelectedDate:Pe,maxDate:a,maxYear:i||Ut,minDate:s,minYear:u||Rt,onDateChange:g,onDateFocus:Ne,onDateHover:Oe,onDateSelect:Be,onTimeChange:V,onQuickOptionSelect:B,startDate:f.startDate,onClose:Q,clearDates:z,standalone:x},children:P.jsxRuntimeExports.jsx(Wt.PopoverRoot,{open:x?!0:void 0,onOpenChange:x?void 0:({open:m})=>{m?h():te(null)},positioning:{placement:d,sameWidth:y},onExitComplete:x?void 0:()=>{Q()},children:e})})};exports.DateFormats=ze;exports.DatePickerCalendar=vr;exports.DatePickerHeader=Ir;exports.DatePickerProvider=jr;exports.FocusedInput=K;exports.Ue=ur;exports.addDays=Nt;exports.addMonths=Ot;exports.endOfDay=ke;exports.isAfter=_e;exports.today=re;exports.useDatePickerContext=le;exports.xt=xn;
|
|
15
|
-
//# sourceMappingURL=datePicker.provider-D9VYbH7E.js.map
|