@ahrowe/ui 0.16.0 → 0.16.2
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/esm/common/numberInput/numberInput.mjs +1 -1
- package/dist/esm/common/numberInput/numberInput.mjs.map +1 -1
- package/dist/esm/common/sectionHeader/sectionHeader.module.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/package/common/numberInput/numberInput.d.ts +1 -0
- package/docs/NumberInput.md +1 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import t from"../interactableDiv/index.mjs";import n from"../input/input.mjs";import r from"./numberInput.module.mjs";import"react";import
|
|
1
|
+
import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import t from"../interactableDiv/index.mjs";import n from"../input/input.mjs";import r from"./numberInput.module.mjs";import i from"react";import a from"classnames";import{FontAwesomeIcon as o}from"@fortawesome/react-fontawesome";import{faChevronDown as s,faChevronUp as c}from"@fortawesome/free-solid-svg-icons";import{jsx as l,jsxs as u}from"react/jsx-runtime";import{NumericFormat as d}from"react-number-format";function f(f){let p=i.useRef(void 0),{value:m,onChange:h,formValidator:g,label:_,error:v,className:y,style:b,allowNegative:x=!1,decimalSeparator:S,thousandSeparator:C,prefix:w,suffix:T,decimalScale:E,fixedDecimalScale:D=!0,placeholder:O,sign:k,showArrows:A=!1,step:j=1,readOnly:M=!1,isRequired:N=!1,onKeyDown:P,...F}=e(`NumberInput`,f),[,I]=i.useState(0);i.useEffect(()=>{if(p.current=g,!g)return;let e=()=>I(e=>e+1);return g.registerOnUpdateListener(e),()=>{g.removeOnUpdateListener(e)}},[g]);let L=N||!!g?.validators.find(e=>e.validatorId===`required`),R=g==null?m:g.value,z=k!=null&&R!=null?Math.abs(Number(R)):R,B=z==null?``:String(z);function V(e){let t=e;t!==void 0&&(k===`-`&&(t=-Math.abs(t)),k===`+`&&(t=Math.abs(t))),g?.set(t??null),h?.(t)}function H(e){if(M)return;let t=(R!=null&&R!==``?Number(R):0)+e;!x&&k!==`-`&&(t=Math.max(0,t)),k===`-`&&(t=Math.min(0,t)),V(t)}function U(e){if(M){P?.(e);return}if(e.key===`ArrowUp`){e.preventDefault(),H(e.shiftKey?j*10:j);return}if(e.key===`ArrowDown`){e.preventDefault(),H(e.shiftKey?-j*10:-j);return}P?.(e)}let W=k===`-`?`-`:k===`+`?`+`:w,G=A&&!M?u(`div`,{className:r.arrows,children:[l(t,{className:r.arrowBtn,tabIndex:-1,onMouseDown:e=>{e.preventDefault(),H(e.shiftKey?j*10:j)},children:l(o,{icon:c})}),l(t,{className:r.arrowBtn,tabIndex:-1,onMouseDown:e=>{e.preventDefault(),H(e.shiftKey?-j*10:-j)},children:l(o,{icon:s})})]}):null;return l(n,{label:_,className:a(r.numberInput,y),style:b,value:B,onChange:()=>{},formValidator:null,isRequired:L,onBlur:()=>{p.current&&(p.current.touched=!0)},isValid:g?g.touched?!g.hasError():!0:!v,errorMessage:g?g.touched?g.getCurrentErrorMessage()??``:``:v??``,placeholder:O,readOnly:M,suffix:G,inputMode:E===0?`numeric`:`decimal`,customInput:l(d,{onValueChange:e=>V(e.floatValue),allowNegative:k==null?x:!1,decimalSeparator:S,thousandSeparator:C,decimalScale:E,fixedDecimalScale:D,prefix:W,suffix:T,onKeyDown:A?U:P,...F})})}export{f as default};
|
|
2
2
|
//# sourceMappingURL=numberInput.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberInput.mjs","names":[],"sources":["../../../../package/common/numberInput/numberInput.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport React from 'react';\nimport cx from 'classnames';\nimport { NumericFormat, NumericFormatProps } from 'react-number-format';\nimport type { FormValidator } from 'services/formValidation';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faChevronUp, faChevronDown } from '@fortawesome/free-solid-svg-icons';\n\nimport styles from './numberInput.module.pcss';\nimport Input from '../input';\nimport InteractableDiv from '../interactableDiv';\nimport { useComponentDefaults } from '../configProvider';\n\nexport interface NumberInputProps\n extends Omit<NumericFormatProps, 'onValueChange' | 'value' | 'customInput' | 'onChange' | 'step' | 'onKeyDown'> {\n value?: number | string;\n onChange?: (value: number | undefined) => void;\n formValidator?: FormValidator | null;\n label?: string;\n error?: string;\n className?: string;\n allowNegative?: boolean;\n decimalSeparator?: string;\n thousandSeparator?: string | boolean;\n prefix?: string;\n suffix?: string;\n decimalScale?: number;\n /**\n * Whether to pad the value to exactly `decimalScale` decimals. Default `true`\n * (e.g. with `decimalScale={2}`, `12` displays as `12.00`). Set `false` to make\n * `decimalScale` an upper limit only — the user may type fewer decimals and they\n * are kept as-is (`12` stays `12`, `12.1` stays `12.1`), while anything beyond\n * `decimalScale` is still truncated.\n */\n fixedDecimalScale?: boolean;\n placeholder?: string;\n sign?: '+' | '-';\n showArrows?: boolean;\n step?: number;\n readOnly?: boolean;\n onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n}\n\nfunction NumberInput(props: NumberInputProps): ReactElement {\n const {\n value,\n onChange,\n formValidator,\n label,\n error,\n className,\n style,\n allowNegative = false,\n decimalSeparator,\n thousandSeparator,\n prefix,\n suffix,\n decimalScale,\n fixedDecimalScale = true,\n placeholder,\n sign,\n showArrows = false,\n step = 1,\n readOnly = false,\n onKeyDown: onKeyDownProp,\n ...rest\n } = useComponentDefaults('NumberInput', props);\n const rawValue = formValidator != null ? formValidator.value as number | string : value;\n // When a sign is forced, display the absolute value — the prefix character carries the sign visually.\n const displayValue = sign != null && rawValue != null ? Math.abs(Number(rawValue)) : rawValue;\n const controlledValue = displayValue != null ? String(displayValue) : '';\n\n function handleValueChange(floatValue: number | undefined) {\n let out = floatValue;\n if (out !== undefined) {\n if (sign === '-') out = -Math.abs(out);\n if (sign === '+') out = Math.abs(out);\n }\n if (formValidator != null) formValidator.set(out ?? null);\n onChange?.(out);\n }\n\n function handleStep(delta: number) {\n if (readOnly) return;\n const current = rawValue != null && rawValue !== '' ? Number(rawValue) : 0;\n let next = current + delta;\n if (!allowNegative && sign !== '-') next = Math.max(0, next);\n if (sign === '-') next = Math.min(0, next);\n handleValueChange(next);\n }\n\n function handleKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {\n if (readOnly) { onKeyDownProp?.(e); return; }\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n handleStep(e.shiftKey ? step * 10 : step);\n return;\n }\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n handleStep(e.shiftKey ? -step * 10 : -step);\n return;\n }\n onKeyDownProp?.(e);\n }\n\n const resolvedPrefix = sign === '-' ? '-' : sign === '+' ? '+' : prefix;\n\n const arrowSuffix = showArrows && !readOnly ? (\n <div className={styles.arrows}>\n <InteractableDiv\n className={styles.arrowBtn}\n tabIndex={-1}\n onMouseDown={(e) => { e.preventDefault(); handleStep(e.shiftKey ? step * 10 : step); }}\n >\n <FontAwesomeIcon icon={faChevronUp} />\n </InteractableDiv>\n <InteractableDiv\n className={styles.arrowBtn}\n tabIndex={-1}\n onMouseDown={(e) => { e.preventDefault(); handleStep(e.shiftKey ? -step * 10 : -step); }}\n >\n <FontAwesomeIcon icon={faChevronDown} />\n </InteractableDiv>\n </div>\n ) : null;\n\n return (\n <Input\n label={label}\n className={cx(styles.numberInput, className)}\n style={style}\n value={controlledValue}\n onChange={() => {}}\n formValidator={null}\n isValid={formValidator ? (formValidator.touched ? !formValidator.hasError() : true) : !error}\n errorMessage={formValidator ? (formValidator.getCurrentErrorMessage() ?? '') : (error ?? '')}\n placeholder={placeholder}\n readOnly={readOnly}\n suffix={arrowSuffix}\n inputMode={decimalScale === 0 ? 'numeric' : 'decimal'}\n customInput={\n <NumericFormat\n onValueChange={(vals) => handleValueChange(vals.floatValue)}\n allowNegative={sign != null ? false : allowNegative}\n decimalSeparator={decimalSeparator}\n thousandSeparator={thousandSeparator}\n decimalScale={decimalScale}\n fixedDecimalScale={fixedDecimalScale}\n prefix={resolvedPrefix}\n suffix={suffix}\n onKeyDown={showArrows ? handleKeyDown : onKeyDownProp}\n {...rest}\n />\n }\n />\n );\n}\n\nexport default NumberInput;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"numberInput.mjs","names":[],"sources":["../../../../package/common/numberInput/numberInput.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport React from 'react';\nimport cx from 'classnames';\nimport { NumericFormat, NumericFormatProps } from 'react-number-format';\nimport type { FormValidator } from 'services/formValidation';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faChevronUp, faChevronDown } from '@fortawesome/free-solid-svg-icons';\n\nimport styles from './numberInput.module.pcss';\nimport Input from '../input';\nimport InteractableDiv from '../interactableDiv';\nimport { useComponentDefaults } from '../configProvider';\n\nexport interface NumberInputProps\n extends Omit<NumericFormatProps, 'onValueChange' | 'value' | 'customInput' | 'onChange' | 'step' | 'onKeyDown'> {\n value?: number | string;\n onChange?: (value: number | undefined) => void;\n formValidator?: FormValidator | null;\n label?: string;\n error?: string;\n className?: string;\n allowNegative?: boolean;\n decimalSeparator?: string;\n thousandSeparator?: string | boolean;\n prefix?: string;\n suffix?: string;\n decimalScale?: number;\n /**\n * Whether to pad the value to exactly `decimalScale` decimals. Default `true`\n * (e.g. with `decimalScale={2}`, `12` displays as `12.00`). Set `false` to make\n * `decimalScale` an upper limit only — the user may type fewer decimals and they\n * are kept as-is (`12` stays `12`, `12.1` stays `12.1`), while anything beyond\n * `decimalScale` is still truncated.\n */\n fixedDecimalScale?: boolean;\n placeholder?: string;\n sign?: '+' | '-';\n showArrows?: boolean;\n step?: number;\n readOnly?: boolean;\n isRequired?: boolean;\n onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;\n}\n\nfunction NumberInput(props: NumberInputProps): ReactElement {\n const fvRef = React.useRef<FormValidator | null | undefined>(undefined);\n const {\n value,\n onChange,\n formValidator,\n label,\n error,\n className,\n style,\n allowNegative = false,\n decimalSeparator,\n thousandSeparator,\n prefix,\n suffix,\n decimalScale,\n fixedDecimalScale = true,\n placeholder,\n sign,\n showArrows = false,\n step = 1,\n readOnly = false,\n isRequired = false,\n onKeyDown: onKeyDownProp,\n ...rest\n } = useComponentDefaults('NumberInput', props);\n const [, forceUpdate] = React.useState(0);\n React.useEffect(() => {\n fvRef.current = formValidator;\n if (!formValidator) return;\n const listener = () => forceUpdate((n) => n + 1);\n formValidator.registerOnUpdateListener(listener);\n return () => { formValidator.removeOnUpdateListener(listener); };\n }, [formValidator]);\n const computedIsRequired = isRequired || !!formValidator?.validators.find(\n (v) => (v as { validatorId?: string }).validatorId === 'required'\n );\n const rawValue = formValidator != null ? formValidator.value as number | string : value;\n // When a sign is forced, display the absolute value — the prefix character carries the sign visually.\n const displayValue = sign != null && rawValue != null ? Math.abs(Number(rawValue)) : rawValue;\n const controlledValue = displayValue != null ? String(displayValue) : '';\n\n function handleValueChange(floatValue: number | undefined) {\n let out = floatValue;\n if (out !== undefined) {\n if (sign === '-') out = -Math.abs(out);\n if (sign === '+') out = Math.abs(out);\n }\n if (formValidator != null) formValidator.set(out ?? null);\n onChange?.(out);\n }\n\n function handleStep(delta: number) {\n if (readOnly) return;\n const current = rawValue != null && rawValue !== '' ? Number(rawValue) : 0;\n let next = current + delta;\n if (!allowNegative && sign !== '-') next = Math.max(0, next);\n if (sign === '-') next = Math.min(0, next);\n handleValueChange(next);\n }\n\n function handleKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {\n if (readOnly) { onKeyDownProp?.(e); return; }\n if (e.key === 'ArrowUp') {\n e.preventDefault();\n handleStep(e.shiftKey ? step * 10 : step);\n return;\n }\n if (e.key === 'ArrowDown') {\n e.preventDefault();\n handleStep(e.shiftKey ? -step * 10 : -step);\n return;\n }\n onKeyDownProp?.(e);\n }\n\n const resolvedPrefix = sign === '-' ? '-' : sign === '+' ? '+' : prefix;\n\n const arrowSuffix = showArrows && !readOnly ? (\n <div className={styles.arrows}>\n <InteractableDiv\n className={styles.arrowBtn}\n tabIndex={-1}\n onMouseDown={(e) => { e.preventDefault(); handleStep(e.shiftKey ? step * 10 : step); }}\n >\n <FontAwesomeIcon icon={faChevronUp} />\n </InteractableDiv>\n <InteractableDiv\n className={styles.arrowBtn}\n tabIndex={-1}\n onMouseDown={(e) => { e.preventDefault(); handleStep(e.shiftKey ? -step * 10 : -step); }}\n >\n <FontAwesomeIcon icon={faChevronDown} />\n </InteractableDiv>\n </div>\n ) : null;\n\n return (\n <Input\n label={label}\n className={cx(styles.numberInput, className)}\n style={style}\n value={controlledValue}\n onChange={() => {}}\n formValidator={null}\n isRequired={computedIsRequired}\n onBlur={() => { if (fvRef.current) fvRef.current.touched = true; }}\n isValid={formValidator ? (formValidator.touched ? !formValidator.hasError() : true) : !error}\n errorMessage={formValidator ? (formValidator.touched ? (formValidator.getCurrentErrorMessage() ?? '') : '') : (error ?? '')}\n placeholder={placeholder}\n readOnly={readOnly}\n suffix={arrowSuffix}\n inputMode={decimalScale === 0 ? 'numeric' : 'decimal'}\n customInput={\n <NumericFormat\n onValueChange={(vals) => handleValueChange(vals.floatValue)}\n allowNegative={sign != null ? false : allowNegative}\n decimalSeparator={decimalSeparator}\n thousandSeparator={thousandSeparator}\n decimalScale={decimalScale}\n fixedDecimalScale={fixedDecimalScale}\n prefix={resolvedPrefix}\n suffix={suffix}\n onKeyDown={showArrows ? handleKeyDown : onKeyDownProp}\n {...rest}\n />\n }\n />\n );\n}\n\nexport default NumberInput;\n"],"mappings":"ifA4CA,SAAS,EAAY,EAAuC,CAC1D,IAAM,EAAQ,EAAM,OAAyC,IAAA,EAAS,EAChE,CACN,QACA,WACA,gBACA,QACA,QACA,YACA,QACA,gBAAgB,GAChB,mBACA,oBACA,SACA,SACA,eACA,oBAAoB,GACpB,cACA,OACA,aAAa,GACb,OAAO,EACP,WAAW,GACX,aAAa,GACb,UAAW,EACX,GAAG,GACC,EAAqB,cAAe,CAAK,EACvC,EAAG,GAAe,EAAM,SAAS,CAAC,EACxC,EAAM,cAAgB,CAEpB,GADA,EAAM,QAAU,EACZ,CAAC,EAAe,OACpB,IAAM,MAAiB,EAAa,GAAM,EAAI,CAAC,EAE/C,OADA,EAAc,yBAAyB,CAAQ,MAClC,CAAE,EAAc,uBAAuB,CAAQ,CAAG,CACjE,EAAG,CAAC,CAAa,CAAC,EAClB,IAAM,EAAqB,GAAc,CAAC,CAAC,GAAe,WAAW,KAClE,GAAO,EAA+B,cAAgB,UACzD,EACM,EAAW,GAAiB,KAAgD,EAAzC,EAAc,MAEjD,EAAe,GAAQ,MAAQ,GAAY,KAAO,KAAK,IAAI,OAAO,CAAQ,CAAC,EAAI,EAC/E,EAAkB,GAAgB,KAA8B,GAAvB,OAAO,CAAY,EAElE,SAAS,EAAkB,EAAgC,CACzD,IAAI,EAAM,EACN,IAAQ,IAAA,KACN,IAAS,MAAK,EAAM,CAAC,KAAK,IAAI,CAAG,GACjC,IAAS,MAAK,EAAO,KAAK,IAAI,CAAG,IAEnC,GAAqC,IAAI,GAAO,IAAI,EACxD,IAAW,CAAG,CAChB,CAEA,SAAS,EAAW,EAAe,CACjC,GAAI,EAAU,OAEd,IAAI,GADY,GAAY,MAAQ,IAAa,GAAK,OAAO,CAAQ,EAAI,GACpD,EACjB,CAAC,GAAiB,IAAS,MAAK,EAAO,KAAK,IAAI,EAAG,CAAI,GACvD,IAAS,MAAK,EAAO,KAAK,IAAI,EAAG,CAAI,GACzC,EAAkB,CAAI,CACxB,CAEA,SAAS,EAAc,EAA0C,CAC/D,GAAI,EAAU,CAAE,IAAgB,CAAC,EAAG,MAAQ,CAC5C,GAAI,EAAE,MAAQ,UAAW,CACvB,EAAE,eAAe,EACjB,EAAW,EAAE,SAAW,EAAO,GAAK,CAAI,EACxC,MACF,CACA,GAAI,EAAE,MAAQ,YAAa,CACzB,EAAE,eAAe,EACjB,EAAW,EAAE,SAAW,CAAC,EAAO,GAAK,CAAC,CAAI,EAC1C,MACF,CACA,IAAgB,CAAC,CACnB,CAEA,IAAM,EAAiB,IAAS,IAAM,IAAM,IAAS,IAAM,IAAM,EAE3D,EAAc,GAAc,CAAC,EACjC,EAAC,MAAD,CAAK,UAAW,EAAO,gBAAvB,CACE,EAAC,EAAD,CACE,UAAW,EAAO,SAClB,SAAU,GACV,YAAc,GAAM,CAAE,EAAE,eAAe,EAAG,EAAW,EAAE,SAAW,EAAO,GAAK,CAAI,CAAG,WAErF,EAAC,EAAD,CAAiB,KAAM,CAAc,CAAA,CACtB,CAAA,EACjB,EAAC,EAAD,CACE,UAAW,EAAO,SAClB,SAAU,GACV,YAAc,GAAM,CAAE,EAAE,eAAe,EAAG,EAAW,EAAE,SAAW,CAAC,EAAO,GAAK,CAAC,CAAI,CAAG,WAEvF,EAAC,EAAD,CAAiB,KAAM,CAAgB,CAAA,CACxB,CAAA,CACd,IACH,KAEJ,OACE,EAAC,EAAD,CACS,QACP,UAAW,EAAG,EAAO,YAAa,CAAS,EACpC,QACP,MAAO,EACP,aAAgB,CAAC,EACjB,cAAe,KACf,WAAY,EACZ,WAAc,CAAM,EAAM,UAAS,EAAM,QAAQ,QAAU,GAAM,EACjE,QAAS,EAAiB,EAAc,QAAU,CAAC,EAAc,SAAS,EAAI,GAAQ,CAAC,EACvF,aAAc,EAAiB,EAAc,QAAW,EAAc,uBAAuB,GAAK,GAAM,GAAO,GAAS,GAC3G,cACH,WACV,OAAQ,EACR,UAAW,IAAiB,EAAI,UAAY,UAC5C,YACE,EAAC,EAAD,CACE,cAAgB,GAAS,EAAkB,EAAK,UAAU,EAC1D,cAAe,GAAQ,KAAe,EAAR,GACZ,mBACC,oBACL,eACK,oBACnB,OAAQ,EACA,SACR,UAAW,EAAa,EAAgB,EACxC,GAAI,CACL,CAAA,CAEJ,CAAA,CAEL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sectionHeader.module.mjs","names":[],"sources":["../../../../package/common/sectionHeader/sectionHeader.module.pcss"],"sourcesContent":[".sectionHeader {\n display: flex;\n flex-wrap: wrap;\n gap: var(--spacing-m, 16px);\n align-items: center;\n color: var(--text-color);\n\n &-leading {\n display: flex;\n justify-content: center;\n align-items: center;\n width: var(--section-header-leading-size);\n height: var(--section-header-leading-size);\n color: var(--primary-color);\n background: var(--background-accent);\n border-radius: var(--default-border-radius);\n overflow: hidden;\n background-size: cover;\n background-position: center;\n flex-shrink: 0;\n font-size: calc(var(--section-header-leading-size) * 0.5);\n }\n\n &-titles {\n display: flex;\n flex-flow: column;\n flex: 0 1 auto;\n gap: 2px;\n min-width: 0;\n }\n\n &-title {\n margin: 0;\n font-size: var(--section-header-title-size);\n font-weight: var(--header-font-weight, 600);\n line-height: 1.2;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &-subtitle {\n color: var(--text-dark);\n font-weight: 300;\n font-size: var(--section-header-subtitle-size);\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &-trailing {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: var(--spacing-m, 16px);\n flex: 1 1 auto;\n }\n\n &-left {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n &-center {\n display: flex;\n align-items: center;\n min-width: 0;\n }\n\n &-actions {\n display: flex;\n gap: var(--spacing-s, 8px);\n flex-wrap: wrap;\n flex-shrink: 0;\n align-items: center;\n justify-content: flex-end;\n }\n\n &-divider {\n margin-top: var(--spacing-s, 8px);\n }\n\n &-size {\n &-small {\n --section-header-title-size: var(--header-small-font-size, 16px);\n --section-header-subtitle-size: 12px;\n --section-header-leading-size: calc(var(--section-header-title-size) * 2.2);\n }\n\n &-medium {\n --section-header-title-size: var(--header-medium-font-size, 18px);\n --section-header-subtitle-size: 14px;\n --section-header-leading-size: calc(var(--section-header-title-size) * 2.2);\n }\n\n &-large {\n --section-header-title-size: var(--header-font-size, 24px);\n --section-header-subtitle-size: 15px;\n --section-header-leading-size: calc(var(--section-header-title-size) * 2.2);\n }\n }\n}\n\n@media (max-width: 640px) {\n .sectionHeader-center {\n flex: 1 1 100%;\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"sectionHeader.module.mjs","names":[],"sources":["../../../../package/common/sectionHeader/sectionHeader.module.pcss"],"sourcesContent":[".sectionHeader {\n display: flex;\n flex-wrap: wrap;\n gap: var(--spacing-m, 16px);\n align-items: center;\n color: var(--text-color);\n\n &-leading {\n display: flex;\n justify-content: center;\n align-items: center;\n width: var(--section-header-leading-size);\n height: var(--section-header-leading-size);\n color: var(--primary-color);\n background: var(--background-accent);\n border-radius: var(--default-border-radius);\n overflow: hidden;\n background-size: cover;\n background-position: center;\n flex-shrink: 0;\n font-size: calc(var(--section-header-leading-size) * 0.5);\n }\n\n &-titles {\n display: flex;\n flex-flow: column;\n flex: 0 1 auto;\n gap: 2px;\n min-width: 0;\n }\n\n &-title {\n margin: 0;\n font-size: var(--section-header-title-size);\n font-weight: var(--header-font-weight, 600);\n line-height: 1.2;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &-subtitle {\n color: var(--text-dark);\n font-weight: 300;\n font-size: var(--section-header-subtitle-size);\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &-trailing {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: var(--spacing-m, 16px);\n flex: 1 1 auto;\n }\n\n &-left {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n\n &-center {\n display: flex;\n align-items: center;\n min-width: 0;\n }\n\n &-actions {\n display: flex;\n gap: var(--spacing-s, 8px);\n flex-wrap: wrap;\n flex-shrink: 0;\n align-items: center;\n justify-content: flex-end;\n }\n\n &-divider {\n margin-top: var(--spacing-s, 8px);\n }\n\n &-size {\n &-small {\n --section-header-title-size: var(--header-small-font-size, 16px);\n --section-header-subtitle-size: 12px;\n --section-header-leading-size: calc(var(--section-header-title-size) * 2.2);\n }\n\n &-medium {\n --section-header-title-size: var(--header-medium-font-size, 18px);\n --section-header-subtitle-size: 14px;\n --section-header-leading-size: calc(var(--section-header-title-size) * 2.2);\n }\n\n &-large {\n --section-header-title-size: var(--header-font-size, 24px);\n --section-header-subtitle-size: 15px;\n --section-header-leading-size: calc(var(--section-header-title-size) * 2.2);\n }\n }\n}\n\n@media (max-width: 640px) {\n .sectionHeader-center:not(:empty) {\n flex: 1 1 100%;\n }\n}\n"],"mappings":""}
|
package/dist/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.
|
|
|
5
5
|
While dragging, use the arrow keys to move it — for a card, between positions and columns;
|
|
6
6
|
for a column, left/right to reorder it.
|
|
7
7
|
Press space or enter again to drop it, or press escape to cancel.
|
|
8
|
-
`};function zr({columns:e,items:t,renderItem:n,onChange:r,dragHandle:i,getItemLabel:a=Pr,getItemDisabled:o,renderEmptyColumn:s,renderColumnActions:u,reorderableColumns:d,collapseEmptyColumns:p,columnMaxHeight:m,onLoadMore:h,loadMoreThreshold:v,className:y,style:b,classNames:x,styles:S,...C}){let[w,T]=(0,c.useState)(null),[E,D]=(0,c.useState)(!1),[O,k]=(0,c.useState)(null),A=(0,c.useRef)(null),j=(0,g.useSensors)((0,g.useSensor)(g.MouseSensor,Fr),(0,g.useSensor)(g.TouchSensor,Ir),(0,g.useSensor)(g.KeyboardSensor,Lr)),M=O??e,N=(0,c.useMemo)(()=>M.map(e=>e.id),[M]),P=(0,c.useMemo)(()=>jr(M,t,a),[M,t,a]),F=(0,c.useMemo)(()=>({announcements:P,screenReaderInstructions:Rr}),[P]);function I({active:t}){T(String(t.id)),D(Er(t.data.current)),k(e),A.current=null}function L({active:t,over:n}){if(!n)return;if(Er(t.data.current)){let r=String(t.id),i=String(n.id);k(t=>{let n=t??e,a=Dr(n,r,i);return a===n?t:a});return}let r=String(t.id),i=String(n.id),a=t.rect.current.translated??t.rect.current.initial,o=a?`${a.top}:${a.left}`:null;o!==null&&o===A.current||(A.current=o,k(t=>{let o=t??e,s=Ar(o,r,i,{activeRect:a,overRect:n.rect});return s===o?t:s}))}function R({over:t}){if(T(null),D(!1),!t||!O){k(null);return}wr(O,e)||r(O),k(null)}function z(){T(null),D(!1),k(null)}let B=w&&E?M.find(e=>e.id===w):void 0;return(0,f.jsxs)(g.DndContext,{sensors:j,collisionDetection:Or,onDragStart:I,onDragOver:L,onDragEnd:R,onDragCancel:z,accessibility:F,children:[(0,f.jsx)(_.SortableContext,{id:`kanban-columns`,items:N,strategy:_.horizontalListSortingStrategy,children:(0,f.jsx)(`div`,{...C,className:(0,l.default)(Z.board,y),style:b,children:M.map(e=>(0,f.jsx)(Cr,{id:e.id,title:e.title,itemIds:e.itemIds,maxItems:e.maxItems,disabled:e.disabled,getItemDisabled:o,emptyPlaceholder:s?.(e),actions:u?.(e),reorderable:d,activeIsColumn:w!==null&&E,collapseEmptyColumns:p,columnMaxHeight:m,hasMore:e.hasMore,onLoadMore:h?()=>h(e.id):void 0,loadMoreThreshold:v,items:t,renderItem:n,dragHandle:i,preserveSizeWhileEmpty:w!==null},e.id))})}),(0,f.jsx)(g.DragOverlay,{children:B?(0,f.jsx)(`div`,{className:(0,l.default)(Z.column,Z.columnDragOverlay),children:(0,f.jsx)(`div`,{className:Z.columnHeader,children:(0,f.jsx)(`span`,{className:Z.columnHeaderTitle,children:B.title})})}):w&&!E&&t[w]!==void 0?(0,f.jsx)(`div`,{className:(0,l.default)(Z.dragOverlay,x?.dragOverlay),style:S?.dragOverlay,children:n(t[w],w)}):null})]})}var Br=`https://api.klipy.com/v2`,Vr=class{constructor(e){this.key=e}async search(e,t={}){let n=new URLSearchParams({q:e,key:this.key});return t.limit!=null&&n.set(`limit`,String(t.limit)),t.contentfilter!=null&&n.set(`contentfilter`,t.contentfilter),t.pos!=null&&n.set(`pos`,t.pos),(await fetch(`${Br}/search?${n}`)).json()}async searchSuggestions(e){let t=new URLSearchParams({q:e,key:this.key});return(await fetch(`${Br}/search_suggestions?${t}`)).json()}registerShare(e,t){let n=new URLSearchParams({id:t,q:e,key:this.key});fetch(`${Br}/registershare?${n}`).catch(()=>null)}},Hr={resultCount:`resultCount_Sn48Q`};function Ur({value:e,onChange:t,onDebounce:n,placeholder:r,label:i,debounceMs:a=500,totalAmount:o,showAmount:s=!0,className:l,width:u,...d}){let p=(0,c.useRef)(null);(0,c.useEffect)(()=>()=>{p.current!==null&&clearTimeout(p.current)},[]);function m(e){let r=e==null?``:String(e),i=r.trim()===``?``:r;t(i),p.current!==null&&clearTimeout(p.current),p.current=setTimeout(()=>{n?.(i)},a)}let h=s&&typeof o==`number`&&!Number.isNaN(o);return(0,f.jsxs)(`div`,{...d,className:l,style:u==null?void 0:{width:u},children:[(0,f.jsx)(Tt,{type:Ct.Search,label:i,placeholder:r,value:e,onChange:m}),h&&(0,f.jsxs)(`p`,{className:Hr.resultCount,children:[o,` `,o===1?`result`:`results`]})]})}var Wr={gifPreview:`gifPreview_jAXT2`,"gifPreview-image":`gifPreview-image_41bwm`,gifPreviewImage:`gifPreview-image_41bwm`,"gifPreview-image-container":`gifPreview-image-container_5hAjJ`,gifPreviewImageContainer:`gifPreview-image-container_5hAjJ`,gradientBottomLeftToTopRight:`gradientBottomLeftToTopRight_9EI0A`};function Gr({className:e,previewItems:t=[],onSelect:n,onLoadAdditional:r}){function i(e){let t=e.currentTarget,n=t.scrollHeight-t.clientHeight*1.5;t.scrollTop>=n&&r?.()}return(0,f.jsx)(f.Fragment,{children:t.length>0&&(0,f.jsx)(`div`,{className:(0,l.default)(Wr.gifPreview,e),onScroll:i,children:t.map((e,t)=>(0,f.jsx)(U,{className:Wr.gifPreviewImageContainer,onClick:()=>n?.(e),children:(0,f.jsx)(`div`,{className:Wr.gifPreviewImage,style:{backgroundImage:`url(${e.media_formats.tinygif.url})`}})},`${e.id}_${t}`))})})}var Kr={gifView:`gifView_YUeLK`,"gifView-loading":`gifView-loading_N1Lzx`,gifViewLoading:`gifView-loading_N1Lzx`,gradientBottomLeftToTopRight:`gradientBottomLeftToTopRight_OmJUc`};function qr({className:e,src:t=``}){let[n,r]=(0,c.useState)(!0);return(0,c.useEffect)(()=>{r(!0)},[t]),(0,f.jsxs)(`div`,{className:(0,l.default)(Kr.gifView,e),children:[(0,f.jsx)(`img`,{className:Kr.klipyPickerSelected,src:t,onLoad:()=>r(!1)}),n&&(0,f.jsx)(`div`,{className:Kr.gifViewLoading})]})}var Jr={"klipyPicker-selected":`klipyPicker-selected_Watxl`,klipyPickerSelected:`klipyPicker-selected_Watxl`,"klipyPicker-modal-content":`klipyPicker-modal-content_3CBV9`,klipyPickerModalContent:`klipyPicker-modal-content_3CBV9`,"klipyPicker-suggestions-container":`klipyPicker-suggestions-container_-csDI`,klipyPickerSuggestionsContainer:`klipyPicker-suggestions-container_-csDI`,"klipyPicker-suggestions-item":`klipyPicker-suggestions-item_nHHSA`,klipyPickerSuggestionsItem:`klipyPicker-suggestions-item_nHHSA`};function Yr({className:e,token:t=``,isModal:n=!1,onSelect:r=()=>void 0,selected:i=null}){let a=(0,c.useMemo)(()=>new Vr(t),[t]),[o,s]=(0,c.useState)(``),[u,d]=(0,c.useState)([]),[p,m]=(0,c.useState)([]),[h,g]=(0,c.useState)(null),[_,v]=(0,c.useState)(!1);async function y(e){if(s(e),!e.trim()){d([]),m([]),g(null);return}let[{results:t=[],next:n=null},{results:r=[]}]=await Promise.all([a.search(e,{limit:18,contentfilter:`medium`}),a.searchSuggestions(e)]);d(t),g(n),m(r)}async function b(){let{results:e=[],next:t=null}=await a.search(o,{limit:36,pos:h??void 0,contentfilter:`medium`});g(t),d(t=>[...t,...e])}async function x(e){await r(e),v(!1),e&&a.registerShare(o,e.id)}function S(){return(0,f.jsx)(gt,{inline:!0,className:Jr.klipyPickerSuggestionsContainer,children:p.map(e=>(0,f.jsx)(ht,{className:Jr.klipyPickerSuggestionsItem,text:e,onClick:()=>y(e)},e))})}function C(){return(0,f.jsx)(Gr,{previewItems:u,onSelect:x,onLoadAdditional:b})}function w(){return(0,f.jsx)(Ur,{label:`Pick gif`,value:o,onDebounce:y,onChange:s})}return n?(0,f.jsxs)(`div`,{className:(0,l.default)(Jr.klipyPicker,e),children:[(0,f.jsxs)(`div`,{className:j.actionButtons,children:[(0,f.jsx)(H,{onClick:()=>v(!0),children:`Pick gif`}),i&&(0,f.jsx)(H,{styleType:I.Delete,onClick:()=>x(null),children:`Remove gif`})]}),i&&(0,f.jsx)(qr,{className:Jr.klipyPickerSelected,src:i}),(0,f.jsx)(Bt,{isOpen:_,onClose:()=>v(!1),children:(0,f.jsxs)(`div`,{className:Jr.klipyPickerModalContent,children:[w(),S(),C()]})})]}):(0,f.jsxs)(`div`,{className:(0,l.default)(Jr.klipyPicker,e),children:[(0,f.jsx)(Ue,{align:Ve.Left,isOpen:u.length>0&&_,onOpenChange:v,dontCloseOnChildClick:!0,content:(0,f.jsxs)(f.Fragment,{children:[S(),C()]}),children:w()}),i&&(0,f.jsx)(H,{styleType:I.Delete,onClick:()=>x(null),children:`Remove gif`}),i&&(0,f.jsx)(qr,{className:Jr.klipyPickerSelected,src:i})]})}var Xr={iconLoading:`iconLoading_wovj4`,"spin-to-oblivion":`spin-to-oblivion_0tZtm`,spinToOblivion:`spin-to-oblivion_0tZtm`,"iconLoading-first":`iconLoading-first_SBwP3`,iconLoadingFirst:`iconLoading-first_SBwP3`,"draw-line":`draw-line_1NiWA`,drawLine:`draw-line_1NiWA`,"iconLoading-second":`iconLoading-second_nHrW3`,iconLoadingSecond:`iconLoading-second_nHrW3`,"draw-line-two":`draw-line-two_HmaHl`,drawLineTwo:`draw-line-two_HmaHl`};function Zr({className:e=``}){return(0,f.jsx)(`div`,{className:(0,l.default)(Xr.iconLoading,e),children:(0,f.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`-8 -1 16 14`,children:[(0,f.jsx)(`path`,{className:Xr.iconLoadingFirst,d:`M 0 0 C 3 5 6 5 6 12`,strokeWidth:`1.7`,fill:`none`}),(0,f.jsx)(`path`,{className:Xr.iconLoadingFirst,d:`M 0 0 C -3 5 -6 5 -6 12`,strokeWidth:`1.7`,fill:`none`}),(0,f.jsx)(`path`,{className:Xr.iconLoadingFirst,d:`M 0 0 L 0 10`,strokeWidth:`1.7`,fill:`none`}),(0,f.jsx)(`path`,{className:Xr.iconLoadingSecond,d:`M 0.1 10 C -3 10 -4 10 -6 12`,strokeWidth:`1.7`,fill:`none`}),(0,f.jsx)(`path`,{className:Xr.iconLoadingSecond,d:`M -0.1 10 C 3 10 4 10 6 12`,strokeWidth:`1.7`,fill:`none`})]})})}var Qr=Zr,$r={numberInput:`numberInput_7p2O3`,arrows:`arrows_yjRlc`,arrowBtn:`arrowBtn_DbJoa`};function ei(e){let{value:t,onChange:n,formValidator:r,label:i,error:a,className:o,style:s,allowNegative:c=!1,decimalSeparator:p,thousandSeparator:m,prefix:h,suffix:g,decimalScale:_,fixedDecimalScale:v=!0,placeholder:b,sign:x,showArrows:S=!1,step:C=1,readOnly:w=!1,onKeyDown:T,...E}=O(`NumberInput`,e),D=r==null?t:r.value,k=x!=null&&D!=null?Math.abs(Number(D)):D,A=k==null?``:String(k);function j(e){let t=e;t!==void 0&&(x===`-`&&(t=-Math.abs(t)),x===`+`&&(t=Math.abs(t))),r?.set(t??null),n?.(t)}function M(e){if(w)return;let t=(D!=null&&D!==``?Number(D):0)+e;!c&&x!==`-`&&(t=Math.max(0,t)),x===`-`&&(t=Math.min(0,t)),j(t)}function N(e){if(w){T?.(e);return}if(e.key===`ArrowUp`){e.preventDefault(),M(e.shiftKey?C*10:C);return}if(e.key===`ArrowDown`){e.preventDefault(),M(e.shiftKey?-C*10:-C);return}T?.(e)}let P=x===`-`?`-`:x===`+`?`+`:h,F=S&&!w?(0,f.jsxs)(`div`,{className:$r.arrows,children:[(0,f.jsx)(U,{className:$r.arrowBtn,tabIndex:-1,onMouseDown:e=>{e.preventDefault(),M(e.shiftKey?C*10:C)},children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faChevronUp})}),(0,f.jsx)(U,{className:$r.arrowBtn,tabIndex:-1,onMouseDown:e=>{e.preventDefault(),M(e.shiftKey?-C*10:-C)},children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faChevronDown})})]}):null;return(0,f.jsx)(Tt,{label:i,className:(0,l.default)($r.numberInput,o),style:s,value:A,onChange:()=>{},formValidator:null,isValid:r?r.touched?!r.hasError():!0:!a,errorMessage:r?r.getCurrentErrorMessage()??``:a??``,placeholder:b,readOnly:w,suffix:F,inputMode:_===0?`numeric`:`decimal`,customInput:(0,f.jsx)(y.NumericFormat,{onValueChange:e=>j(e.floatValue),allowNegative:x==null?c:!1,decimalSeparator:p,thousandSeparator:m,decimalScale:_,fixedDecimalScale:v,prefix:P,suffix:g,onKeyDown:S?N:T,...E})})}var ti=ei,ni={optionPicker:`optionPicker_Yx82s`,"optionPicker-chip":`optionPicker-chip_ywtvr`,optionPickerChip:`optionPicker-chip_ywtvr`,"optionPicker-option":`optionPicker-option_uq0vK`,optionPickerOption:`optionPicker-option_uq0vK`,"optionPicker-option-active":`optionPicker-option-active_yUECW`,optionPickerOptionActive:`optionPicker-option-active_yUECW`};function ri({className:e=void 0,options:t,onChange:n,value:r,...i}){let a=t.findIndex(e=>e.key===r)*100/t.length;return(0,f.jsxs)(`div`,{...i,className:(0,l.default)(ni.optionPicker,e),children:[(0,f.jsx)(`div`,{className:ni.optionPickerChip,style:{left:`${a}%`,width:`${100/t.length}%`}}),t.map(e=>(0,f.jsx)(U,{onClick:t=>n(e.key,t),className:(0,l.default)(ni.optionPickerOption,e.key===r&&ni.optionPickerOptionActive),tabIndex:e.key===r?-1:0,children:e.label},e.key))]})}var ii=768;function ai(){let[e,t]=(0,c.useState)(()=>({width:window.innerWidth,height:window.innerHeight,isMobileSize:window.innerWidth<ii}));return(0,c.useEffect)(()=>{function e(){t({width:window.innerWidth,height:window.innerHeight,isMobileSize:window.innerWidth<ii})}return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}var oi={overscroll:`overscroll_Ij750`,"overscroll-header":`overscroll-header_S6vYc`,overscrollHeader:`overscroll-header_S6vYc`,"overscroll-header-centered":`overscroll-header-centered_8VlsP`,overscrollHeaderCentered:`overscroll-header-centered_8VlsP`,"overscroll-header-container":`overscroll-header-container_iignp`,overscrollHeaderContainer:`overscroll-header-container_iignp`};function si({children:e=null,overscrollContent:t=null,overscrollContentDesktop:n=null,centerHeader:r=!0,min:i=10,max:a=80,start:o=30,unit:s=`%`,mobileOnly:u=!0,onScrollChange:d=()=>{},scrollDisabled:p=!1}){let{isMobileSize:m,height:h}=ai(),g=(0,c.useRef)(null),_=(0,c.useRef)(null),v=(0,c.useRef)(null),y=(0,c.useRef)(!1),b=(0,c.useRef)(null),x=(0,c.useRef)(d);x.current=d;let S=(0,c.useCallback)(e=>{let t;if(s===`%`){if(!v.current)return;let n=v.current.clientHeight;t=Math.max(n*i/100,n-e)}else t=Math.max(i,a-e);_.current&&(_.current.style.height=`${t}px`)},[i,a,s]),C=(0,c.useCallback)(()=>{let e;if(s===`%`){if(!v.current)return;let t=v.current.clientHeight/a*100;e=v.current.clientHeight-o/100*t}else e=a-o;g.current&&(g.current.scrollTop=e,S(e))},[a,o,s,S]);(0,c.useEffect)(()=>{let e=setTimeout(C,100);return()=>clearTimeout(e)},[C]),(0,c.useEffect)(()=>{g.current&&(g.current.style.overflow=p?`hidden`:`auto`)},[p]);let w=(0,c.useRef)(m);(0,c.useEffect)(()=>{m&&!w.current&&C(),w.current=m},[m,C]);let T=(0,c.useRef)(u);(0,c.useEffect)(()=>{!u&&T.current&&C(),T.current=u},[u,C]);let E=(0,c.useRef)(h);(0,c.useEffect)(()=>{m&&h!==E.current&&g.current&&S(g.current.scrollTop),E.current=h},[h,m,S]);function D(e){S(e.currentTarget.scrollTop),y.current||(y.current=!0,x.current(!0)),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{b.current=null,y.current=!1,x.current(!1)},500)}if(u&&!m)return n?(0,f.jsxs)(`div`,{children:[n,e]}):(0,f.jsx)(f.Fragment,{children:e});let O=s===`%`?`${100-i}%`:`calc(100% - ${i}px)`;return(0,f.jsxs)(`div`,{className:oi.overscroll,ref:g,onScroll:D,children:[(0,f.jsx)(`div`,{className:oi.overscrollHeaderContainer,style:{height:`${a}${s}`},ref:v,children:(0,f.jsx)(`div`,{className:(0,l.default)(oi.overscrollHeader,r&&oi.overscrollHeaderCentered),ref:_,children:t})}),(0,f.jsx)(`div`,{style:{minHeight:O},children:e})]})}var ci={popover:`popover_hhmvN`,"popover-trigger":`popover-trigger_R4ckf`,popoverTrigger:`popover-trigger_R4ckf`,"popover-floating":`popover-floating_mhXrQ`,popoverFloating:`popover-floating_mhXrQ`,"popover-panel":`popover-panel_tVB2k`,popoverPanel:`popover-panel_tVB2k`,popoverIn:`popoverIn_nKOqX`,"popover-arrow":`popover-arrow_B8kB-`,popoverArrow:`popover-arrow_B8kB-`},li=function(e){return e.Top=`top`,e.Bottom=`bottom`,e.Left=`left`,e.Right=`right`,e}({}),ui=function(e){return e.Start=`start`,e.Center=`center`,e.End=`end`,e}({}),di=function(e){return e.Click=`click`,e.Hover=`hover`,e.Focus=`focus`,e}({}),fi={[li.Top]:`bottom`,[li.Bottom]:`top`,[li.Left]:`right`,[li.Right]:`left`},pi=8;function mi({isOpen:e,placement:t,align:n,offset:r,triggerRef:i,floatingRef:a,panelRef:o,arrowRef:s}){(0,c.useLayoutEffect)(()=>{if(!e)return;let c,l;function u(){let e=i.current,d=a.current,f=o.current;if(!e||!d||!f){c=requestAnimationFrame(u);return}let p=Fe(e);function m(){let i=e.getBoundingClientRect(),a=f.offsetWidth,o=f.offsetHeight,c=window.innerWidth,l=window.innerHeight,u={top:i.top,bottom:l-i.bottom,left:i.left,right:c-i.right},m=t===li.Top||t===li.Bottom?o:a,h=t,g=fi[t];u[h]<m+r&&u[g]>u[h]&&(h=g);let _=h===`top`||h===`bottom`,v,y;h===`bottom`?v=i.bottom+r:h===`top`?v=i.top-r-o:y=h===`right`?i.right+r:i.left-r-a,_?(y=n===ui.Start?i.left:n===ui.End?i.right-a:i.left+i.width/2-a/2,y=Math.max(pi,Math.min(y,c-a-pi))):(v=n===ui.Start?i.top:n===ui.End?i.bottom-o:i.top+i.height/2-o/2,v=Math.max(pi,Math.min(v,l-o-pi))),d.style.top=`${v}px`,d.style.left=`${y}px`,d.style.visibility=Ie(i,p)?`hidden`:`visible`,d.dataset.placement=h;let b=s.current;if(b){let e=b.offsetWidth/2||5;if(_){let t=i.left+i.width/2-y;b.style.setProperty(`--arrow-x`,`${Math.max(e+2,Math.min(t,a-e-2))}px`),b.style.removeProperty(`--arrow-y`)}else{let t=i.top+i.height/2-v;b.style.setProperty(`--arrow-y`,`${Math.max(e+2,Math.min(t,o-e-2))}px`),b.style.removeProperty(`--arrow-x`)}}}m();let h=[window,...p];h.forEach(e=>e.addEventListener(`scroll`,m,{passive:!0})),window.addEventListener(`resize`,m),l=()=>{h.forEach(e=>e.removeEventListener(`scroll`,m)),window.removeEventListener(`resize`,m)}}return u(),()=>{c!==void 0&&cancelAnimationFrame(c),l?.()}},[e,t,n,r,i,a,o,s])}function hi({children:e=null,content:t=null,placement:n=li.Bottom,align:r=ui.Center,trigger:i=di.Click,isOpen:a,defaultOpen:o=!1,onOpenChange:s=()=>{},offset:u=10,withArrow:d=!0,closeOnOutsideClick:p=!0,closeOnEscape:m=!0,openDelay:h=100,closeDelay:g=120,disabled:_=!1,className:v,style:y,classNames:b,styles:x,...S}){let C=(0,c.useRef)(null),w=(0,c.useRef)(null),T=(0,c.useRef)(null),E=(0,c.useRef)(null),D=(0,c.useRef)(void 0),O=a!==void 0,[k,A]=(0,c.useState)(o),j=O?a:k,M=(0,c.useRef)(s);(0,c.useEffect)(()=>{M.current=s});let N=(0,c.useCallback)(e=>{_&&e||(O||A(e),M.current(e))},[_,O]);mi({isOpen:!!j,placement:n,align:r,offset:u,triggerRef:C,floatingRef:w,panelRef:T,arrowRef:d?E:{current:null}});let{restoreFocusToTrigger:P,focusAfterTrigger:F}=Be({triggerRef:C,contentRef:w});(0,c.useEffect)(()=>{if(!j||i!==di.Click)return;let e=ze(T.current);e.length!==0&&(w.current?.setAttribute(`role`,`dialog`),e[0].focus())},[j,i]);function I(e){if(e.key!==`Tab`||i!==di.Click)return;let t=ze(T.current);if(t.length===0)return;let n=document.activeElement;!e.shiftKey&&n===t[t.length-1]?(e.preventDefault(),F(),N(!1)):e.shiftKey&&n===t[0]&&(e.preventDefault(),P(),N(!1))}(0,c.useEffect)(()=>{if(!j)return;function e(e){let t=e.target,n=w.current?.contains(t),r=C.current?.contains(t);!n&&!r&&N(!1)}function t(e){e.key===`Escape`&&(w.current?.contains(document.activeElement)&&(ze(C.current)[0]??C.current)?.focus(),N(!1))}function n(e){let t=e.target,n=w.current?.contains(t),r=C.current?.contains(t);!n&&!r&&N(!1)}return p&&i!==di.Hover&&(window.addEventListener(`mouseup`,e),document.addEventListener(`focusin`,n)),m&&window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`mouseup`,e),document.removeEventListener(`focusin`,n),window.removeEventListener(`keydown`,t)}},[j,p,m,i,N]),(0,c.useEffect)(()=>()=>clearTimeout(D.current),[]);function L(e){clearTimeout(D.current),D.current=setTimeout(()=>N(e),e?h:g)}let R=i===di.Click?{onClick:()=>N(!j)}:i===di.Hover?{onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1)}:{onFocus:()=>N(!0),onBlur:()=>N(!1)},z=i===di.Hover?{onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1)}:{};return(0,f.jsxs)(`div`,{...S,className:(0,l.default)(ci.popover,v,b?.root),style:{...y,...x?.root},children:[(0,f.jsx)(`div`,{ref:C,className:(0,l.default)(ci.popoverTrigger,b?.trigger),style:x?.trigger,...R,children:e}),j&&(0,f.jsx)(Ne,{children:(0,f.jsxs)(`div`,{ref:w,className:(0,l.default)(ci.popoverFloating,b?.floating),style:x?.floating,"data-placement":n,onKeyDown:I,...z,children:[(0,f.jsx)(`div`,{ref:T,className:(0,l.default)(ci.popoverPanel,b?.panel),style:x?.panel,children:t}),d&&(0,f.jsx)(`div`,{ref:E,className:(0,l.default)(ci.popoverArrow,b?.arrow),style:x?.arrow})]})})]})}var gi={progressBar:`progressBar_LO0sX`,"progressBar-fill":`progressBar-fill_rt32j`,progressBarFill:`progressBar-fill_rt32j`,"progressBar-fill-end":`progressBar-fill-end_71wL3`,progressBarFillEnd:`progressBar-fill-end_71wL3`,"progressBar-label":`progressBar-label_jWud2`,progressBarLabel:`progressBar-label_jWud2`,"progressBar-label-custom":`progressBar-label-custom_sSump`,progressBarLabelCustom:`progressBar-label-custom_sSump`};function _i(e){let t=e.replace(`#`,``),n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16);return(.299*n+.587*r+.114*i)/255>.5?`#000000`:`#ffffff`}function vi({className:e=void 0,total:t=100,progress:n=0,style:r=void 0,...i}){function a(){let e=[];return Array.isArray(n)?e.push(...n):typeof n==`object`?e.push(n):e.push({amount:n}),e.map((n,i)=>{let a=t?n.amount/t*100:0;return(0,f.jsx)(`div`,{className:(0,l.default)(gi.progressBarFill,i===e.length-1&&gi.progressBarFillEnd,n.class),style:{width:`${a}%`,background:n.color||void 0,...r||{}},title:n.label?`${n.label}: ${n.amount}`:void 0,children:n.label&&(0,f.jsx)(`div`,{className:gi.progressBarLabel,style:n.color?{color:_i(n.color)}:{},children:n.label})},i)})}return(0,f.jsx)(`div`,{...i,className:(0,l.default)(gi.progressBar,e),style:r,children:a()})}var yi=function(e){return e.Vertical=`vertical`,e.Horizontal=`horizontal`,e}({}),bi={radioGroup:`radioGroup_5PUYO`,"radioGroup-horizontal":`radioGroup-horizontal_cfCch`,radioGroupHorizontal:`radioGroup-horizontal_cfCch`,"radioGroup-disabled":`radioGroup-disabled_O2hKy`,radioGroupDisabled:`radioGroup-disabled_O2hKy`,"radioGroup-error":`radioGroup-error_HVUcn`,radioGroupError:`radioGroup-error_HVUcn`,"radioGroup-radio":`radioGroup-radio_XLU2j`,radioGroupRadio:`radioGroup-radio_XLU2j`,"radioGroup-radio-checked":`radioGroup-radio-checked_AOEJu`,radioGroupRadioChecked:`radioGroup-radio-checked_AOEJu`,"radioGroup-option":`radioGroup-option_QxMeW`,radioGroupOption:`radioGroup-option_QxMeW`,"radioGroup-option-disabled":`radioGroup-option-disabled_Q0y35`,radioGroupOptionDisabled:`radioGroup-option-disabled_Q0y35`,"radioGroup-dot":`radioGroup-dot_Q-4Ge`,radioGroupDot:`radioGroup-dot_Q-4Ge`,"radioGroup-dot-checked":`radioGroup-dot-checked_7djgv`,radioGroupDotChecked:`radioGroup-dot-checked_7djgv`,"radioGroup-text":`radioGroup-text_8ekBs`,radioGroupText:`radioGroup-text_8ekBs`,"radioGroup-label":`radioGroup-label_hJD2S`,radioGroupLabel:`radioGroup-label_hJD2S`,"radioGroup-description":`radioGroup-description_xZSLE`,radioGroupDescription:`radioGroup-description_xZSLE`};function xi(e){let{options:t=[],value:n,defaultValue:r,onChange:i=()=>{},orientation:a=yi.Vertical,disabled:o=!1,size:s=`18px`,tabIndex:u=0,formValidator:d=null,errorMessage:p=``,isValid:m=!0,className:h,style:g,classNames:_,styles:v,...y}=O(`RadioGroup`,e),b=(0,c.useRef)([]),x=(0,c.useRef)(d);(0,c.useEffect)(()=>{x.current=d});let[,S]=(0,c.useState)(0),[C,w]=(0,c.useState)(r),[T,E]=(0,c.useState)(!1),[D,k]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(!d)return;d.validate();let e=()=>S(e=>e+1);return d.registerOnUpdateListener(e),()=>d.removeOnUpdateListener(e)},[d]);let A=d?d.touched&&d.hasError():!m||!!p,j=d?d.getCurrentErrorMessage():p||``,M=n!==void 0&&!d,N=d?d.value:M?n:C;function P(e,t){d?d.set(e):M||w(e),i(e,t)}function F(e){e.currentTarget.contains(e.relatedTarget)||(E(!1),x.current&&(x.current.touched=!0))}let I=t.findIndex(e=>e.value===N),L=t.findIndex(e=>!e.disabled),R=I>=0?I:L;function z(e){b.current[e]?.focus()}function B(e,n,r){if(o||t.length===0)return;let i=n;for(let n=0;n<t.length;n++)if(i=(i+e+t.length)%t.length,!t[i].disabled){z(i),P(t[i].value,r);return}}function V(e,n){let r=t[n];switch(e.key){case`ArrowDown`:case`ArrowRight`:e.preventDefault(),B(1,n,e);break;case`ArrowUp`:case`ArrowLeft`:e.preventDefault(),B(-1,n,e);break;case` `:case`Enter`:e.preventDefault(),!o&&!r.disabled&&P(r.value,e);break;default:break}}return(0,f.jsxs)(`div`,{...y,role:`radiogroup`,"aria-orientation":a,"aria-disabled":o||void 0,"aria-invalid":A||void 0,className:(0,l.default)(bi.radioGroup,a===yi.Horizontal&&bi.radioGroupHorizontal,o&&bi.radioGroupDisabled,A&&bi.radioGroupError,h,_?.root),style:{"--radio-size":s,...g,...v?.root},onFocus:()=>E(!0),onBlur:F,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:[t.map((e,t)=>{let n=e.value===N,r=o||!!e.disabled;return(0,f.jsxs)(`div`,{ref:e=>{b.current[t]=e},role:`radio`,"aria-checked":n,"aria-disabled":r||void 0,tabIndex:r?-1:t===R?u:-1,className:(0,l.default)(bi.radioGroupOption,n&&bi.radioGroupOptionChecked,r&&bi.radioGroupOptionDisabled,_?.option),style:v?.option,onClick:()=>{r||P(e.value)},onKeyDown:e=>V(e,t),children:[(0,f.jsx)(`div`,{className:(0,l.default)(bi.radioGroupRadio,n&&bi.radioGroupRadioChecked,_?.radio),style:v?.radio,children:(0,f.jsx)(`div`,{className:(0,l.default)(bi.radioGroupDot,n&&bi.radioGroupDotChecked,_?.dot),style:v?.dot})}),(e.label??e.value)!==``&&(0,f.jsxs)(`div`,{className:bi.radioGroupText,children:[(0,f.jsx)(`div`,{className:(0,l.default)(bi.radioGroupLabel,_?.label),style:v?.label,children:e.label??e.value}),e.description!=null&&(0,f.jsx)(`div`,{className:(0,l.default)(bi.radioGroupDescription,_?.description),style:v?.description,children:e.description})]})]},String(e.value))}),(0,f.jsx)(vt,{variant:`error`,message:j,isVisible:A&&(T||D)})]})}var Si={rating:`rating_eDKeX`,"rating-disabled":`rating-disabled_Xk0cI`,ratingDisabled:`rating-disabled_Xk0cI`,"rating-readOnly":`rating-readOnly_o8Kx1`,ratingReadOnly:`rating-readOnly_o8Kx1`,"rating-item":`rating-item_4tqx2`,ratingItem:`rating-item_4tqx2`,"rating-iconEmpty":`rating-iconEmpty_3uk2A`,ratingIconEmpty:`rating-iconEmpty_3uk2A`,"rating-iconFilledClip":`rating-iconFilledClip_4aNxG`,ratingIconFilledClip:`rating-iconFilledClip_4aNxG`,"rating-iconFilled":`rating-iconFilled_-rQ58`,ratingIconFilled:`rating-iconFilled_-rQ58`},Ci=4;function wi(e,t){return Math.max(0,Math.min(t,e))}function Ti(e){let{value:t,defaultValue:n=0,onChange:r=()=>{},max:i=5,allowHalf:a=!1,allowClear:o=!0,readOnly:s=!1,disabled:p=!1,icon:m=d.faStar,"aria-label":h=`Rating`,className:g,style:_,classNames:v,styles:y,...b}=O(`Rating`,e),x=t!==void 0,[S,C]=(0,c.useState)(n),w=wi(x?t:S,i),[T,E]=(0,c.useState)(null),D=!s&&!p,k=T??w,A=(0,c.useRef)(null),j=(0,c.useRef)(w),M=(0,c.useRef)(!1),N=(0,c.useRef)(0),P=(0,c.useRef)(!1);function F(e){let t=wi(e,i);x||C(t),r(t)}function I(e){let t=A.current?.getBoundingClientRect();if(!t||t.width===0)return null;let n=wi((e-t.left)/t.width,1)*i;return a?Math.round(n*2)/2:Math.ceil(n)}function L(e){if(!D)return;e.currentTarget.setPointerCapture?.(e.pointerId),M.current=!0,P.current=!1,N.current=e.clientX,j.current=w;let t=I(e.clientX);t!==null&&E(t)}function R(e){if(!D)return;let t=I(e.clientX);t!==null&&(M.current&&(e.preventDefault(),Math.abs(e.clientX-N.current)>Ci&&(P.current=!0)),E(t))}function z(e){if(!D||!M.current)return;e.currentTarget.releasePointerCapture?.(e.pointerId),M.current=!1;let t=I(e.clientX)??T;t!==null&&F(!P.current&&o&&t===j.current?0:t),E(null)}function B(){!D||M.current||E(null)}function V(e){let t=a?.5:1;e.key===`ArrowRight`||e.key===`ArrowUp`?(e.preventDefault(),F(w+t)):e.key===`ArrowLeft`||e.key===`ArrowDown`?(e.preventDefault(),F(w-t)):e.key===`Home`?(e.preventDefault(),F(0)):e.key===`End`&&(e.preventDefault(),F(i))}return(0,f.jsx)(`div`,{...b,ref:A,role:`slider`,"aria-label":h,"aria-valuemin":0,"aria-valuemax":i,"aria-valuenow":w,"aria-valuetext":`${w} out of ${i}`,"aria-readonly":s||void 0,"aria-disabled":p||void 0,tabIndex:D?0:-1,className:(0,l.default)(Si.rating,p&&Si.ratingDisabled,s&&Si.ratingReadOnly,v?.root,g),style:{..._,...y?.root},onKeyDown:D?V:void 0,onPointerDown:D?L:void 0,onPointerMove:D?R:void 0,onPointerUp:D?z:void 0,onPointerCancel:D?z:void 0,onPointerLeave:D?B:void 0,children:Array.from({length:i},(e,t)=>{let n=Math.round(Math.max(0,Math.min(1,k-t))*100);return(0,f.jsxs)(`div`,{className:(0,l.default)(Si.ratingItem,v?.item),style:y?.item,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:m,className:(0,l.default)(Si.ratingIconEmpty,v?.iconEmpty),style:y?.iconEmpty}),(0,f.jsx)(`div`,{className:Si.ratingIconFilledClip,style:{width:`${n}%`},children:(0,f.jsx)(u.FontAwesomeIcon,{icon:m,className:(0,l.default)(Si.ratingIconFilled,v?.iconFilled),style:y?.iconFilled})})]},t)})})}var Ei={revealLens:`revealLens_V3Kkk`,"revealLens-background":`revealLens-background_pQyK9`,revealLensBackground:`revealLens-background_pQyK9`,"revealLens-overlay":`revealLens-overlay_NOUoj`,revealLensOverlay:`revealLens-overlay_NOUoj`,"revealLens-overlay-transitioning":`revealLens-overlay-transitioning_-co2e`,revealLensOverlayTransitioning:`revealLens-overlay-transitioning_-co2e`};function Di(e,t,n,r){let i=Math.max(n-r,0);return`radial-gradient(circle ${n}px at ${e}px ${t}px, transparent ${i}px, transparent ${i}px, white ${n}px)`}function Oi(e,t){e.style.setProperty(`mask-image`,t),e.style.setProperty(`-webkit-mask-image`,t)}function ki(e){e.style.removeProperty(`mask-image`),e.style.removeProperty(`-webkit-mask-image`)}function Ai(e){let{background:t,overlay:n,radius:r=120,feather:i=24,shape:a=`circle`,maskImage:o,disabled:s=!1,className:u,style:d,classNames:p,styles:m,...h}=O(`RevealLens`,e),g=(0,c.useRef)(null),_=(0,c.useRef)(null),v=(e,t)=>{let n=g.current,a=_.current;if(!n||!a)return;let s=n.getBoundingClientRect(),c=e-s.left,l=t-s.top;a.classList.remove(Ei.revealLensOverlayTransitioning),Oi(a,o??Di(c,l,r,i))},y=()=>{let e=_.current;e&&(e.classList.add(Ei.revealLensOverlayTransitioning),ki(e))},b=e=>{s||(e.currentTarget.setPointerCapture?.(e.pointerId),v(e.clientX,e.clientY))},x=e=>{s||v(e.clientX,e.clientY)},S=e=>{s||e.pointerType===`mouse`||y()},C=e=>{if(s)return;let t=g.current;if(t){let n=t.getBoundingClientRect();if(e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom)return;if(typeof document.elementFromPoint==`function`){let n=document.elementFromPoint(e.clientX,e.clientY);if(n&&t.contains(n))return}}y()};return(0,f.jsxs)(`div`,{...h,ref:g,className:(0,l.default)(Ei.revealLens,u,p?.root),style:{...d,...m?.root},"data-reveal-shape":a,onPointerDown:b,onPointerMove:x,onPointerUp:S,onPointerCancel:C,onPointerLeave:C,children:[(0,f.jsx)(`div`,{className:(0,l.default)(Ei.revealLensBackground,p?.background),style:m?.background,children:t}),(0,f.jsx)(`div`,{ref:_,className:(0,l.default)(Ei.revealLensOverlay,p?.overlay),style:m?.overlay,children:n})]})}function ji(e){return Math.round(e/5)*5}function Mi(e){return{x:ji(e.x),y:ji(e.y)}}function Ni(e,t,n){let r=n.createSVGPoint();r.x=e,r.y=t;let i=n.getScreenCTM();if(!i)return{x:0,y:0};let a=r.matrixTransform(i.inverse());return Mi({x:a.x,y:a.y})}function Pi(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function Fi(e,t,n){let r=n.x-t.x,i=n.y-t.y,a=r*r+i*i;if(a===0)return{dist:Pi(e,t),t:0};let o=Math.max(0,Math.min(1,((e.x-t.x)*r+(e.y-t.y)*i)/a)),s=t.x+o*r,c=t.y+o*i;return{dist:Math.sqrt((e.x-s)**2+(e.y-c)**2),t:o}}function Ii(e,t){let n=null;for(let r of t){let t=r.points;for(let i=0;i<t.length;i++){let a=t[i],o=t[(i+1)%t.length],{dist:s,t:c}=Fi(e,a,o);s<=8&&(!n||s<n.dist)&&(n={roomId:r.id,wallIndex:i,t:c,dist:s})}}return n}function Li(e,t){let n=!1;for(let r=0,i=t.length-1;r<t.length;i=r++){let a=t[r].x,o=t[r].y,s=t[i].x,c=t[i].y;o>e.y!=c>e.y&&e.x<(s-a)*(e.y-o)/(c-o)+a&&(n=!n)}return n}function Ri(e){return{x:e.reduce((e,t)=>e+t.x,0)/e.length,y:e.reduce((e,t)=>e+t.y,0)/e.length}}function zi(e,t,n,r){return[{x:e,y:t},{x:e+n,y:t},{x:e+n,y:t+r},{x:e,y:t+r}]}function Bi(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=Math.sqrt(i*i+a*a);if(o<.001)return null;let s=i/o,c=a/o,l=e.x+i*n,u=e.y+a*n,d=Math.min(r/2,o/2-.001);return{p1:{x:l-s*d,y:u-c*d},p2:{x:l+s*d,y:u+c*d},perp:{x:-c,y:s}}}function Vi(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function Hi(e){return e.map((e,t)=>`${t===0?`M`:`L`} ${e.x.toFixed(2)},${e.y.toFixed(2)}`).join(` `)+` Z`}function Ui(e,t){if(e.length<2)return[];if(t.length===0)return[e.map((e,t)=>`${t===0?`M`:`L`} ${e.x.toFixed(2)},${e.y.toFixed(2)}`).join(` `)+` Z`];let n=e.length,r=[],i=[`M ${e[0].x.toFixed(2)},${e[0].y.toFixed(2)}`];for(let a=0;a<n;a++){let o=e[a],s=e[(a+1)%n],c=s.x-o.x,l=s.y-o.y,u=Math.sqrt(c*c+l*l),d=t.filter(e=>e.wallIndex===a).sort((e,t)=>e.t-t.t);if(d.length===0)i.push(`L ${s.x.toFixed(2)},${s.y.toFixed(2)}`);else{for(let e of d){let t=e.width/2,n=Math.max(0,e.t-t/u),a=Math.min(1,e.t+t/u),s={x:o.x+c*n,y:o.y+l*n},d={x:o.x+c*a,y:o.y+l*a};i.push(`L ${s.x.toFixed(2)},${s.y.toFixed(2)}`),r.push(i),i=[`M ${d.x.toFixed(2)},${d.y.toFixed(2)}`]}i.push(`L ${s.x.toFixed(2)},${s.y.toFixed(2)}`)}}return r[0]=[...i,...r[0].slice(1)],r.map(e=>e.join(` `))}function Wi(e,t,n){let r=Bi(e,t,n.t,n.width);if(!r)return``;let{p1:i,p2:a,perp:o}=r,s={x:i.x+o.x*n.width,y:i.y+o.y*n.width};return[`M ${i.x.toFixed(2)},${i.y.toFixed(2)} L ${a.x.toFixed(2)},${a.y.toFixed(2)}`,`M ${i.x.toFixed(2)},${i.y.toFixed(2)} A ${n.width},${n.width} 0 0,1 ${s.x.toFixed(2)},${s.y.toFixed(2)}`].join(` `)}function Gi(e,t){let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let t of e)for(let e of t.points)e.x<n&&(n=e.x),e.y<r&&(r=e.y),e.x>i&&(i=e.x),e.y>a&&(a=e.y);isFinite(n)||(n=0,r=0,i=400,a=300);let o=[(n-5).toFixed(2),(r-5).toFixed(2),(i-n+10).toFixed(2),(a-r+10).toFixed(2)].join(` `),s=e.map(e=>{let n=t.filter(t=>t.roomId===e.id),r=Ui(e.points,n),i=Hi(e.points),a=Ri(e.points),o=r.map(e=>` <path d="${e}" />`).join(`
|
|
8
|
+
`};function zr({columns:e,items:t,renderItem:n,onChange:r,dragHandle:i,getItemLabel:a=Pr,getItemDisabled:o,renderEmptyColumn:s,renderColumnActions:u,reorderableColumns:d,collapseEmptyColumns:p,columnMaxHeight:m,onLoadMore:h,loadMoreThreshold:v,className:y,style:b,classNames:x,styles:S,...C}){let[w,T]=(0,c.useState)(null),[E,D]=(0,c.useState)(!1),[O,k]=(0,c.useState)(null),A=(0,c.useRef)(null),j=(0,g.useSensors)((0,g.useSensor)(g.MouseSensor,Fr),(0,g.useSensor)(g.TouchSensor,Ir),(0,g.useSensor)(g.KeyboardSensor,Lr)),M=O??e,N=(0,c.useMemo)(()=>M.map(e=>e.id),[M]),P=(0,c.useMemo)(()=>jr(M,t,a),[M,t,a]),F=(0,c.useMemo)(()=>({announcements:P,screenReaderInstructions:Rr}),[P]);function I({active:t}){T(String(t.id)),D(Er(t.data.current)),k(e),A.current=null}function L({active:t,over:n}){if(!n)return;if(Er(t.data.current)){let r=String(t.id),i=String(n.id);k(t=>{let n=t??e,a=Dr(n,r,i);return a===n?t:a});return}let r=String(t.id),i=String(n.id),a=t.rect.current.translated??t.rect.current.initial,o=a?`${a.top}:${a.left}`:null;o!==null&&o===A.current||(A.current=o,k(t=>{let o=t??e,s=Ar(o,r,i,{activeRect:a,overRect:n.rect});return s===o?t:s}))}function R({over:t}){if(T(null),D(!1),!t||!O){k(null);return}wr(O,e)||r(O),k(null)}function z(){T(null),D(!1),k(null)}let B=w&&E?M.find(e=>e.id===w):void 0;return(0,f.jsxs)(g.DndContext,{sensors:j,collisionDetection:Or,onDragStart:I,onDragOver:L,onDragEnd:R,onDragCancel:z,accessibility:F,children:[(0,f.jsx)(_.SortableContext,{id:`kanban-columns`,items:N,strategy:_.horizontalListSortingStrategy,children:(0,f.jsx)(`div`,{...C,className:(0,l.default)(Z.board,y),style:b,children:M.map(e=>(0,f.jsx)(Cr,{id:e.id,title:e.title,itemIds:e.itemIds,maxItems:e.maxItems,disabled:e.disabled,getItemDisabled:o,emptyPlaceholder:s?.(e),actions:u?.(e),reorderable:d,activeIsColumn:w!==null&&E,collapseEmptyColumns:p,columnMaxHeight:m,hasMore:e.hasMore,onLoadMore:h?()=>h(e.id):void 0,loadMoreThreshold:v,items:t,renderItem:n,dragHandle:i,preserveSizeWhileEmpty:w!==null},e.id))})}),(0,f.jsx)(g.DragOverlay,{children:B?(0,f.jsx)(`div`,{className:(0,l.default)(Z.column,Z.columnDragOverlay),children:(0,f.jsx)(`div`,{className:Z.columnHeader,children:(0,f.jsx)(`span`,{className:Z.columnHeaderTitle,children:B.title})})}):w&&!E&&t[w]!==void 0?(0,f.jsx)(`div`,{className:(0,l.default)(Z.dragOverlay,x?.dragOverlay),style:S?.dragOverlay,children:n(t[w],w)}):null})]})}var Br=`https://api.klipy.com/v2`,Vr=class{constructor(e){this.key=e}async search(e,t={}){let n=new URLSearchParams({q:e,key:this.key});return t.limit!=null&&n.set(`limit`,String(t.limit)),t.contentfilter!=null&&n.set(`contentfilter`,t.contentfilter),t.pos!=null&&n.set(`pos`,t.pos),(await fetch(`${Br}/search?${n}`)).json()}async searchSuggestions(e){let t=new URLSearchParams({q:e,key:this.key});return(await fetch(`${Br}/search_suggestions?${t}`)).json()}registerShare(e,t){let n=new URLSearchParams({id:t,q:e,key:this.key});fetch(`${Br}/registershare?${n}`).catch(()=>null)}},Hr={resultCount:`resultCount_Sn48Q`};function Ur({value:e,onChange:t,onDebounce:n,placeholder:r,label:i,debounceMs:a=500,totalAmount:o,showAmount:s=!0,className:l,width:u,...d}){let p=(0,c.useRef)(null);(0,c.useEffect)(()=>()=>{p.current!==null&&clearTimeout(p.current)},[]);function m(e){let r=e==null?``:String(e),i=r.trim()===``?``:r;t(i),p.current!==null&&clearTimeout(p.current),p.current=setTimeout(()=>{n?.(i)},a)}let h=s&&typeof o==`number`&&!Number.isNaN(o);return(0,f.jsxs)(`div`,{...d,className:l,style:u==null?void 0:{width:u},children:[(0,f.jsx)(Tt,{type:Ct.Search,label:i,placeholder:r,value:e,onChange:m}),h&&(0,f.jsxs)(`p`,{className:Hr.resultCount,children:[o,` `,o===1?`result`:`results`]})]})}var Wr={gifPreview:`gifPreview_jAXT2`,"gifPreview-image":`gifPreview-image_41bwm`,gifPreviewImage:`gifPreview-image_41bwm`,"gifPreview-image-container":`gifPreview-image-container_5hAjJ`,gifPreviewImageContainer:`gifPreview-image-container_5hAjJ`,gradientBottomLeftToTopRight:`gradientBottomLeftToTopRight_9EI0A`};function Gr({className:e,previewItems:t=[],onSelect:n,onLoadAdditional:r}){function i(e){let t=e.currentTarget,n=t.scrollHeight-t.clientHeight*1.5;t.scrollTop>=n&&r?.()}return(0,f.jsx)(f.Fragment,{children:t.length>0&&(0,f.jsx)(`div`,{className:(0,l.default)(Wr.gifPreview,e),onScroll:i,children:t.map((e,t)=>(0,f.jsx)(U,{className:Wr.gifPreviewImageContainer,onClick:()=>n?.(e),children:(0,f.jsx)(`div`,{className:Wr.gifPreviewImage,style:{backgroundImage:`url(${e.media_formats.tinygif.url})`}})},`${e.id}_${t}`))})})}var Kr={gifView:`gifView_YUeLK`,"gifView-loading":`gifView-loading_N1Lzx`,gifViewLoading:`gifView-loading_N1Lzx`,gradientBottomLeftToTopRight:`gradientBottomLeftToTopRight_OmJUc`};function qr({className:e,src:t=``}){let[n,r]=(0,c.useState)(!0);return(0,c.useEffect)(()=>{r(!0)},[t]),(0,f.jsxs)(`div`,{className:(0,l.default)(Kr.gifView,e),children:[(0,f.jsx)(`img`,{className:Kr.klipyPickerSelected,src:t,onLoad:()=>r(!1)}),n&&(0,f.jsx)(`div`,{className:Kr.gifViewLoading})]})}var Jr={"klipyPicker-selected":`klipyPicker-selected_Watxl`,klipyPickerSelected:`klipyPicker-selected_Watxl`,"klipyPicker-modal-content":`klipyPicker-modal-content_3CBV9`,klipyPickerModalContent:`klipyPicker-modal-content_3CBV9`,"klipyPicker-suggestions-container":`klipyPicker-suggestions-container_-csDI`,klipyPickerSuggestionsContainer:`klipyPicker-suggestions-container_-csDI`,"klipyPicker-suggestions-item":`klipyPicker-suggestions-item_nHHSA`,klipyPickerSuggestionsItem:`klipyPicker-suggestions-item_nHHSA`};function Yr({className:e,token:t=``,isModal:n=!1,onSelect:r=()=>void 0,selected:i=null}){let a=(0,c.useMemo)(()=>new Vr(t),[t]),[o,s]=(0,c.useState)(``),[u,d]=(0,c.useState)([]),[p,m]=(0,c.useState)([]),[h,g]=(0,c.useState)(null),[_,v]=(0,c.useState)(!1);async function y(e){if(s(e),!e.trim()){d([]),m([]),g(null);return}let[{results:t=[],next:n=null},{results:r=[]}]=await Promise.all([a.search(e,{limit:18,contentfilter:`medium`}),a.searchSuggestions(e)]);d(t),g(n),m(r)}async function b(){let{results:e=[],next:t=null}=await a.search(o,{limit:36,pos:h??void 0,contentfilter:`medium`});g(t),d(t=>[...t,...e])}async function x(e){await r(e),v(!1),e&&a.registerShare(o,e.id)}function S(){return(0,f.jsx)(gt,{inline:!0,className:Jr.klipyPickerSuggestionsContainer,children:p.map(e=>(0,f.jsx)(ht,{className:Jr.klipyPickerSuggestionsItem,text:e,onClick:()=>y(e)},e))})}function C(){return(0,f.jsx)(Gr,{previewItems:u,onSelect:x,onLoadAdditional:b})}function w(){return(0,f.jsx)(Ur,{label:`Pick gif`,value:o,onDebounce:y,onChange:s})}return n?(0,f.jsxs)(`div`,{className:(0,l.default)(Jr.klipyPicker,e),children:[(0,f.jsxs)(`div`,{className:j.actionButtons,children:[(0,f.jsx)(H,{onClick:()=>v(!0),children:`Pick gif`}),i&&(0,f.jsx)(H,{styleType:I.Delete,onClick:()=>x(null),children:`Remove gif`})]}),i&&(0,f.jsx)(qr,{className:Jr.klipyPickerSelected,src:i}),(0,f.jsx)(Bt,{isOpen:_,onClose:()=>v(!1),children:(0,f.jsxs)(`div`,{className:Jr.klipyPickerModalContent,children:[w(),S(),C()]})})]}):(0,f.jsxs)(`div`,{className:(0,l.default)(Jr.klipyPicker,e),children:[(0,f.jsx)(Ue,{align:Ve.Left,isOpen:u.length>0&&_,onOpenChange:v,dontCloseOnChildClick:!0,content:(0,f.jsxs)(f.Fragment,{children:[S(),C()]}),children:w()}),i&&(0,f.jsx)(H,{styleType:I.Delete,onClick:()=>x(null),children:`Remove gif`}),i&&(0,f.jsx)(qr,{className:Jr.klipyPickerSelected,src:i})]})}var Xr={iconLoading:`iconLoading_wovj4`,"spin-to-oblivion":`spin-to-oblivion_0tZtm`,spinToOblivion:`spin-to-oblivion_0tZtm`,"iconLoading-first":`iconLoading-first_SBwP3`,iconLoadingFirst:`iconLoading-first_SBwP3`,"draw-line":`draw-line_1NiWA`,drawLine:`draw-line_1NiWA`,"iconLoading-second":`iconLoading-second_nHrW3`,iconLoadingSecond:`iconLoading-second_nHrW3`,"draw-line-two":`draw-line-two_HmaHl`,drawLineTwo:`draw-line-two_HmaHl`};function Zr({className:e=``}){return(0,f.jsx)(`div`,{className:(0,l.default)(Xr.iconLoading,e),children:(0,f.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`-8 -1 16 14`,children:[(0,f.jsx)(`path`,{className:Xr.iconLoadingFirst,d:`M 0 0 C 3 5 6 5 6 12`,strokeWidth:`1.7`,fill:`none`}),(0,f.jsx)(`path`,{className:Xr.iconLoadingFirst,d:`M 0 0 C -3 5 -6 5 -6 12`,strokeWidth:`1.7`,fill:`none`}),(0,f.jsx)(`path`,{className:Xr.iconLoadingFirst,d:`M 0 0 L 0 10`,strokeWidth:`1.7`,fill:`none`}),(0,f.jsx)(`path`,{className:Xr.iconLoadingSecond,d:`M 0.1 10 C -3 10 -4 10 -6 12`,strokeWidth:`1.7`,fill:`none`}),(0,f.jsx)(`path`,{className:Xr.iconLoadingSecond,d:`M -0.1 10 C 3 10 4 10 6 12`,strokeWidth:`1.7`,fill:`none`})]})})}var Qr=Zr,$r={numberInput:`numberInput_7p2O3`,arrows:`arrows_yjRlc`,arrowBtn:`arrowBtn_DbJoa`};function ei(e){let t=c.default.useRef(void 0),{value:n,onChange:r,formValidator:i,label:a,error:o,className:s,style:p,allowNegative:m=!1,decimalSeparator:h,thousandSeparator:g,prefix:_,suffix:v,decimalScale:b,fixedDecimalScale:x=!0,placeholder:S,sign:C,showArrows:w=!1,step:T=1,readOnly:E=!1,isRequired:D=!1,onKeyDown:k,...A}=O(`NumberInput`,e),[,j]=c.default.useState(0);c.default.useEffect(()=>{if(t.current=i,!i)return;let e=()=>j(e=>e+1);return i.registerOnUpdateListener(e),()=>{i.removeOnUpdateListener(e)}},[i]);let M=D||!!i?.validators.find(e=>e.validatorId===`required`),N=i==null?n:i.value,P=C!=null&&N!=null?Math.abs(Number(N)):N,F=P==null?``:String(P);function I(e){let t=e;t!==void 0&&(C===`-`&&(t=-Math.abs(t)),C===`+`&&(t=Math.abs(t))),i?.set(t??null),r?.(t)}function L(e){if(E)return;let t=(N!=null&&N!==``?Number(N):0)+e;!m&&C!==`-`&&(t=Math.max(0,t)),C===`-`&&(t=Math.min(0,t)),I(t)}function R(e){if(E){k?.(e);return}if(e.key===`ArrowUp`){e.preventDefault(),L(e.shiftKey?T*10:T);return}if(e.key===`ArrowDown`){e.preventDefault(),L(e.shiftKey?-T*10:-T);return}k?.(e)}let z=C===`-`?`-`:C===`+`?`+`:_,B=w&&!E?(0,f.jsxs)(`div`,{className:$r.arrows,children:[(0,f.jsx)(U,{className:$r.arrowBtn,tabIndex:-1,onMouseDown:e=>{e.preventDefault(),L(e.shiftKey?T*10:T)},children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faChevronUp})}),(0,f.jsx)(U,{className:$r.arrowBtn,tabIndex:-1,onMouseDown:e=>{e.preventDefault(),L(e.shiftKey?-T*10:-T)},children:(0,f.jsx)(u.FontAwesomeIcon,{icon:d.faChevronDown})})]}):null;return(0,f.jsx)(Tt,{label:a,className:(0,l.default)($r.numberInput,s),style:p,value:F,onChange:()=>{},formValidator:null,isRequired:M,onBlur:()=>{t.current&&(t.current.touched=!0)},isValid:i?i.touched?!i.hasError():!0:!o,errorMessage:i?i.touched?i.getCurrentErrorMessage()??``:``:o??``,placeholder:S,readOnly:E,suffix:B,inputMode:b===0?`numeric`:`decimal`,customInput:(0,f.jsx)(y.NumericFormat,{onValueChange:e=>I(e.floatValue),allowNegative:C==null?m:!1,decimalSeparator:h,thousandSeparator:g,decimalScale:b,fixedDecimalScale:x,prefix:z,suffix:v,onKeyDown:w?R:k,...A})})}var ti=ei,ni={optionPicker:`optionPicker_Yx82s`,"optionPicker-chip":`optionPicker-chip_ywtvr`,optionPickerChip:`optionPicker-chip_ywtvr`,"optionPicker-option":`optionPicker-option_uq0vK`,optionPickerOption:`optionPicker-option_uq0vK`,"optionPicker-option-active":`optionPicker-option-active_yUECW`,optionPickerOptionActive:`optionPicker-option-active_yUECW`};function ri({className:e=void 0,options:t,onChange:n,value:r,...i}){let a=t.findIndex(e=>e.key===r)*100/t.length;return(0,f.jsxs)(`div`,{...i,className:(0,l.default)(ni.optionPicker,e),children:[(0,f.jsx)(`div`,{className:ni.optionPickerChip,style:{left:`${a}%`,width:`${100/t.length}%`}}),t.map(e=>(0,f.jsx)(U,{onClick:t=>n(e.key,t),className:(0,l.default)(ni.optionPickerOption,e.key===r&&ni.optionPickerOptionActive),tabIndex:e.key===r?-1:0,children:e.label},e.key))]})}var ii=768;function ai(){let[e,t]=(0,c.useState)(()=>({width:window.innerWidth,height:window.innerHeight,isMobileSize:window.innerWidth<ii}));return(0,c.useEffect)(()=>{function e(){t({width:window.innerWidth,height:window.innerHeight,isMobileSize:window.innerWidth<ii})}return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),e}var oi={overscroll:`overscroll_Ij750`,"overscroll-header":`overscroll-header_S6vYc`,overscrollHeader:`overscroll-header_S6vYc`,"overscroll-header-centered":`overscroll-header-centered_8VlsP`,overscrollHeaderCentered:`overscroll-header-centered_8VlsP`,"overscroll-header-container":`overscroll-header-container_iignp`,overscrollHeaderContainer:`overscroll-header-container_iignp`};function si({children:e=null,overscrollContent:t=null,overscrollContentDesktop:n=null,centerHeader:r=!0,min:i=10,max:a=80,start:o=30,unit:s=`%`,mobileOnly:u=!0,onScrollChange:d=()=>{},scrollDisabled:p=!1}){let{isMobileSize:m,height:h}=ai(),g=(0,c.useRef)(null),_=(0,c.useRef)(null),v=(0,c.useRef)(null),y=(0,c.useRef)(!1),b=(0,c.useRef)(null),x=(0,c.useRef)(d);x.current=d;let S=(0,c.useCallback)(e=>{let t;if(s===`%`){if(!v.current)return;let n=v.current.clientHeight;t=Math.max(n*i/100,n-e)}else t=Math.max(i,a-e);_.current&&(_.current.style.height=`${t}px`)},[i,a,s]),C=(0,c.useCallback)(()=>{let e;if(s===`%`){if(!v.current)return;let t=v.current.clientHeight/a*100;e=v.current.clientHeight-o/100*t}else e=a-o;g.current&&(g.current.scrollTop=e,S(e))},[a,o,s,S]);(0,c.useEffect)(()=>{let e=setTimeout(C,100);return()=>clearTimeout(e)},[C]),(0,c.useEffect)(()=>{g.current&&(g.current.style.overflow=p?`hidden`:`auto`)},[p]);let w=(0,c.useRef)(m);(0,c.useEffect)(()=>{m&&!w.current&&C(),w.current=m},[m,C]);let T=(0,c.useRef)(u);(0,c.useEffect)(()=>{!u&&T.current&&C(),T.current=u},[u,C]);let E=(0,c.useRef)(h);(0,c.useEffect)(()=>{m&&h!==E.current&&g.current&&S(g.current.scrollTop),E.current=h},[h,m,S]);function D(e){S(e.currentTarget.scrollTop),y.current||(y.current=!0,x.current(!0)),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{b.current=null,y.current=!1,x.current(!1)},500)}if(u&&!m)return n?(0,f.jsxs)(`div`,{children:[n,e]}):(0,f.jsx)(f.Fragment,{children:e});let O=s===`%`?`${100-i}%`:`calc(100% - ${i}px)`;return(0,f.jsxs)(`div`,{className:oi.overscroll,ref:g,onScroll:D,children:[(0,f.jsx)(`div`,{className:oi.overscrollHeaderContainer,style:{height:`${a}${s}`},ref:v,children:(0,f.jsx)(`div`,{className:(0,l.default)(oi.overscrollHeader,r&&oi.overscrollHeaderCentered),ref:_,children:t})}),(0,f.jsx)(`div`,{style:{minHeight:O},children:e})]})}var ci={popover:`popover_hhmvN`,"popover-trigger":`popover-trigger_R4ckf`,popoverTrigger:`popover-trigger_R4ckf`,"popover-floating":`popover-floating_mhXrQ`,popoverFloating:`popover-floating_mhXrQ`,"popover-panel":`popover-panel_tVB2k`,popoverPanel:`popover-panel_tVB2k`,popoverIn:`popoverIn_nKOqX`,"popover-arrow":`popover-arrow_B8kB-`,popoverArrow:`popover-arrow_B8kB-`},li=function(e){return e.Top=`top`,e.Bottom=`bottom`,e.Left=`left`,e.Right=`right`,e}({}),ui=function(e){return e.Start=`start`,e.Center=`center`,e.End=`end`,e}({}),di=function(e){return e.Click=`click`,e.Hover=`hover`,e.Focus=`focus`,e}({}),fi={[li.Top]:`bottom`,[li.Bottom]:`top`,[li.Left]:`right`,[li.Right]:`left`},pi=8;function mi({isOpen:e,placement:t,align:n,offset:r,triggerRef:i,floatingRef:a,panelRef:o,arrowRef:s}){(0,c.useLayoutEffect)(()=>{if(!e)return;let c,l;function u(){let e=i.current,d=a.current,f=o.current;if(!e||!d||!f){c=requestAnimationFrame(u);return}let p=Fe(e);function m(){let i=e.getBoundingClientRect(),a=f.offsetWidth,o=f.offsetHeight,c=window.innerWidth,l=window.innerHeight,u={top:i.top,bottom:l-i.bottom,left:i.left,right:c-i.right},m=t===li.Top||t===li.Bottom?o:a,h=t,g=fi[t];u[h]<m+r&&u[g]>u[h]&&(h=g);let _=h===`top`||h===`bottom`,v,y;h===`bottom`?v=i.bottom+r:h===`top`?v=i.top-r-o:y=h===`right`?i.right+r:i.left-r-a,_?(y=n===ui.Start?i.left:n===ui.End?i.right-a:i.left+i.width/2-a/2,y=Math.max(pi,Math.min(y,c-a-pi))):(v=n===ui.Start?i.top:n===ui.End?i.bottom-o:i.top+i.height/2-o/2,v=Math.max(pi,Math.min(v,l-o-pi))),d.style.top=`${v}px`,d.style.left=`${y}px`,d.style.visibility=Ie(i,p)?`hidden`:`visible`,d.dataset.placement=h;let b=s.current;if(b){let e=b.offsetWidth/2||5;if(_){let t=i.left+i.width/2-y;b.style.setProperty(`--arrow-x`,`${Math.max(e+2,Math.min(t,a-e-2))}px`),b.style.removeProperty(`--arrow-y`)}else{let t=i.top+i.height/2-v;b.style.setProperty(`--arrow-y`,`${Math.max(e+2,Math.min(t,o-e-2))}px`),b.style.removeProperty(`--arrow-x`)}}}m();let h=[window,...p];h.forEach(e=>e.addEventListener(`scroll`,m,{passive:!0})),window.addEventListener(`resize`,m),l=()=>{h.forEach(e=>e.removeEventListener(`scroll`,m)),window.removeEventListener(`resize`,m)}}return u(),()=>{c!==void 0&&cancelAnimationFrame(c),l?.()}},[e,t,n,r,i,a,o,s])}function hi({children:e=null,content:t=null,placement:n=li.Bottom,align:r=ui.Center,trigger:i=di.Click,isOpen:a,defaultOpen:o=!1,onOpenChange:s=()=>{},offset:u=10,withArrow:d=!0,closeOnOutsideClick:p=!0,closeOnEscape:m=!0,openDelay:h=100,closeDelay:g=120,disabled:_=!1,className:v,style:y,classNames:b,styles:x,...S}){let C=(0,c.useRef)(null),w=(0,c.useRef)(null),T=(0,c.useRef)(null),E=(0,c.useRef)(null),D=(0,c.useRef)(void 0),O=a!==void 0,[k,A]=(0,c.useState)(o),j=O?a:k,M=(0,c.useRef)(s);(0,c.useEffect)(()=>{M.current=s});let N=(0,c.useCallback)(e=>{_&&e||(O||A(e),M.current(e))},[_,O]);mi({isOpen:!!j,placement:n,align:r,offset:u,triggerRef:C,floatingRef:w,panelRef:T,arrowRef:d?E:{current:null}});let{restoreFocusToTrigger:P,focusAfterTrigger:F}=Be({triggerRef:C,contentRef:w});(0,c.useEffect)(()=>{if(!j||i!==di.Click)return;let e=ze(T.current);e.length!==0&&(w.current?.setAttribute(`role`,`dialog`),e[0].focus())},[j,i]);function I(e){if(e.key!==`Tab`||i!==di.Click)return;let t=ze(T.current);if(t.length===0)return;let n=document.activeElement;!e.shiftKey&&n===t[t.length-1]?(e.preventDefault(),F(),N(!1)):e.shiftKey&&n===t[0]&&(e.preventDefault(),P(),N(!1))}(0,c.useEffect)(()=>{if(!j)return;function e(e){let t=e.target,n=w.current?.contains(t),r=C.current?.contains(t);!n&&!r&&N(!1)}function t(e){e.key===`Escape`&&(w.current?.contains(document.activeElement)&&(ze(C.current)[0]??C.current)?.focus(),N(!1))}function n(e){let t=e.target,n=w.current?.contains(t),r=C.current?.contains(t);!n&&!r&&N(!1)}return p&&i!==di.Hover&&(window.addEventListener(`mouseup`,e),document.addEventListener(`focusin`,n)),m&&window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`mouseup`,e),document.removeEventListener(`focusin`,n),window.removeEventListener(`keydown`,t)}},[j,p,m,i,N]),(0,c.useEffect)(()=>()=>clearTimeout(D.current),[]);function L(e){clearTimeout(D.current),D.current=setTimeout(()=>N(e),e?h:g)}let R=i===di.Click?{onClick:()=>N(!j)}:i===di.Hover?{onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1)}:{onFocus:()=>N(!0),onBlur:()=>N(!1)},z=i===di.Hover?{onMouseEnter:()=>L(!0),onMouseLeave:()=>L(!1)}:{};return(0,f.jsxs)(`div`,{...S,className:(0,l.default)(ci.popover,v,b?.root),style:{...y,...x?.root},children:[(0,f.jsx)(`div`,{ref:C,className:(0,l.default)(ci.popoverTrigger,b?.trigger),style:x?.trigger,...R,children:e}),j&&(0,f.jsx)(Ne,{children:(0,f.jsxs)(`div`,{ref:w,className:(0,l.default)(ci.popoverFloating,b?.floating),style:x?.floating,"data-placement":n,onKeyDown:I,...z,children:[(0,f.jsx)(`div`,{ref:T,className:(0,l.default)(ci.popoverPanel,b?.panel),style:x?.panel,children:t}),d&&(0,f.jsx)(`div`,{ref:E,className:(0,l.default)(ci.popoverArrow,b?.arrow),style:x?.arrow})]})})]})}var gi={progressBar:`progressBar_LO0sX`,"progressBar-fill":`progressBar-fill_rt32j`,progressBarFill:`progressBar-fill_rt32j`,"progressBar-fill-end":`progressBar-fill-end_71wL3`,progressBarFillEnd:`progressBar-fill-end_71wL3`,"progressBar-label":`progressBar-label_jWud2`,progressBarLabel:`progressBar-label_jWud2`,"progressBar-label-custom":`progressBar-label-custom_sSump`,progressBarLabelCustom:`progressBar-label-custom_sSump`};function _i(e){let t=e.replace(`#`,``),n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16);return(.299*n+.587*r+.114*i)/255>.5?`#000000`:`#ffffff`}function vi({className:e=void 0,total:t=100,progress:n=0,style:r=void 0,...i}){function a(){let e=[];return Array.isArray(n)?e.push(...n):typeof n==`object`?e.push(n):e.push({amount:n}),e.map((n,i)=>{let a=t?n.amount/t*100:0;return(0,f.jsx)(`div`,{className:(0,l.default)(gi.progressBarFill,i===e.length-1&&gi.progressBarFillEnd,n.class),style:{width:`${a}%`,background:n.color||void 0,...r||{}},title:n.label?`${n.label}: ${n.amount}`:void 0,children:n.label&&(0,f.jsx)(`div`,{className:gi.progressBarLabel,style:n.color?{color:_i(n.color)}:{},children:n.label})},i)})}return(0,f.jsx)(`div`,{...i,className:(0,l.default)(gi.progressBar,e),style:r,children:a()})}var yi=function(e){return e.Vertical=`vertical`,e.Horizontal=`horizontal`,e}({}),bi={radioGroup:`radioGroup_5PUYO`,"radioGroup-horizontal":`radioGroup-horizontal_cfCch`,radioGroupHorizontal:`radioGroup-horizontal_cfCch`,"radioGroup-disabled":`radioGroup-disabled_O2hKy`,radioGroupDisabled:`radioGroup-disabled_O2hKy`,"radioGroup-error":`radioGroup-error_HVUcn`,radioGroupError:`radioGroup-error_HVUcn`,"radioGroup-radio":`radioGroup-radio_XLU2j`,radioGroupRadio:`radioGroup-radio_XLU2j`,"radioGroup-radio-checked":`radioGroup-radio-checked_AOEJu`,radioGroupRadioChecked:`radioGroup-radio-checked_AOEJu`,"radioGroup-option":`radioGroup-option_QxMeW`,radioGroupOption:`radioGroup-option_QxMeW`,"radioGroup-option-disabled":`radioGroup-option-disabled_Q0y35`,radioGroupOptionDisabled:`radioGroup-option-disabled_Q0y35`,"radioGroup-dot":`radioGroup-dot_Q-4Ge`,radioGroupDot:`radioGroup-dot_Q-4Ge`,"radioGroup-dot-checked":`radioGroup-dot-checked_7djgv`,radioGroupDotChecked:`radioGroup-dot-checked_7djgv`,"radioGroup-text":`radioGroup-text_8ekBs`,radioGroupText:`radioGroup-text_8ekBs`,"radioGroup-label":`radioGroup-label_hJD2S`,radioGroupLabel:`radioGroup-label_hJD2S`,"radioGroup-description":`radioGroup-description_xZSLE`,radioGroupDescription:`radioGroup-description_xZSLE`};function xi(e){let{options:t=[],value:n,defaultValue:r,onChange:i=()=>{},orientation:a=yi.Vertical,disabled:o=!1,size:s=`18px`,tabIndex:u=0,formValidator:d=null,errorMessage:p=``,isValid:m=!0,className:h,style:g,classNames:_,styles:v,...y}=O(`RadioGroup`,e),b=(0,c.useRef)([]),x=(0,c.useRef)(d);(0,c.useEffect)(()=>{x.current=d});let[,S]=(0,c.useState)(0),[C,w]=(0,c.useState)(r),[T,E]=(0,c.useState)(!1),[D,k]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(!d)return;d.validate();let e=()=>S(e=>e+1);return d.registerOnUpdateListener(e),()=>d.removeOnUpdateListener(e)},[d]);let A=d?d.touched&&d.hasError():!m||!!p,j=d?d.getCurrentErrorMessage():p||``,M=n!==void 0&&!d,N=d?d.value:M?n:C;function P(e,t){d?d.set(e):M||w(e),i(e,t)}function F(e){e.currentTarget.contains(e.relatedTarget)||(E(!1),x.current&&(x.current.touched=!0))}let I=t.findIndex(e=>e.value===N),L=t.findIndex(e=>!e.disabled),R=I>=0?I:L;function z(e){b.current[e]?.focus()}function B(e,n,r){if(o||t.length===0)return;let i=n;for(let n=0;n<t.length;n++)if(i=(i+e+t.length)%t.length,!t[i].disabled){z(i),P(t[i].value,r);return}}function V(e,n){let r=t[n];switch(e.key){case`ArrowDown`:case`ArrowRight`:e.preventDefault(),B(1,n,e);break;case`ArrowUp`:case`ArrowLeft`:e.preventDefault(),B(-1,n,e);break;case` `:case`Enter`:e.preventDefault(),!o&&!r.disabled&&P(r.value,e);break;default:break}}return(0,f.jsxs)(`div`,{...y,role:`radiogroup`,"aria-orientation":a,"aria-disabled":o||void 0,"aria-invalid":A||void 0,className:(0,l.default)(bi.radioGroup,a===yi.Horizontal&&bi.radioGroupHorizontal,o&&bi.radioGroupDisabled,A&&bi.radioGroupError,h,_?.root),style:{"--radio-size":s,...g,...v?.root},onFocus:()=>E(!0),onBlur:F,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:[t.map((e,t)=>{let n=e.value===N,r=o||!!e.disabled;return(0,f.jsxs)(`div`,{ref:e=>{b.current[t]=e},role:`radio`,"aria-checked":n,"aria-disabled":r||void 0,tabIndex:r?-1:t===R?u:-1,className:(0,l.default)(bi.radioGroupOption,n&&bi.radioGroupOptionChecked,r&&bi.radioGroupOptionDisabled,_?.option),style:v?.option,onClick:()=>{r||P(e.value)},onKeyDown:e=>V(e,t),children:[(0,f.jsx)(`div`,{className:(0,l.default)(bi.radioGroupRadio,n&&bi.radioGroupRadioChecked,_?.radio),style:v?.radio,children:(0,f.jsx)(`div`,{className:(0,l.default)(bi.radioGroupDot,n&&bi.radioGroupDotChecked,_?.dot),style:v?.dot})}),(e.label??e.value)!==``&&(0,f.jsxs)(`div`,{className:bi.radioGroupText,children:[(0,f.jsx)(`div`,{className:(0,l.default)(bi.radioGroupLabel,_?.label),style:v?.label,children:e.label??e.value}),e.description!=null&&(0,f.jsx)(`div`,{className:(0,l.default)(bi.radioGroupDescription,_?.description),style:v?.description,children:e.description})]})]},String(e.value))}),(0,f.jsx)(vt,{variant:`error`,message:j,isVisible:A&&(T||D)})]})}var Si={rating:`rating_eDKeX`,"rating-disabled":`rating-disabled_Xk0cI`,ratingDisabled:`rating-disabled_Xk0cI`,"rating-readOnly":`rating-readOnly_o8Kx1`,ratingReadOnly:`rating-readOnly_o8Kx1`,"rating-item":`rating-item_4tqx2`,ratingItem:`rating-item_4tqx2`,"rating-iconEmpty":`rating-iconEmpty_3uk2A`,ratingIconEmpty:`rating-iconEmpty_3uk2A`,"rating-iconFilledClip":`rating-iconFilledClip_4aNxG`,ratingIconFilledClip:`rating-iconFilledClip_4aNxG`,"rating-iconFilled":`rating-iconFilled_-rQ58`,ratingIconFilled:`rating-iconFilled_-rQ58`},Ci=4;function wi(e,t){return Math.max(0,Math.min(t,e))}function Ti(e){let{value:t,defaultValue:n=0,onChange:r=()=>{},max:i=5,allowHalf:a=!1,allowClear:o=!0,readOnly:s=!1,disabled:p=!1,icon:m=d.faStar,"aria-label":h=`Rating`,className:g,style:_,classNames:v,styles:y,...b}=O(`Rating`,e),x=t!==void 0,[S,C]=(0,c.useState)(n),w=wi(x?t:S,i),[T,E]=(0,c.useState)(null),D=!s&&!p,k=T??w,A=(0,c.useRef)(null),j=(0,c.useRef)(w),M=(0,c.useRef)(!1),N=(0,c.useRef)(0),P=(0,c.useRef)(!1);function F(e){let t=wi(e,i);x||C(t),r(t)}function I(e){let t=A.current?.getBoundingClientRect();if(!t||t.width===0)return null;let n=wi((e-t.left)/t.width,1)*i;return a?Math.round(n*2)/2:Math.ceil(n)}function L(e){if(!D)return;e.currentTarget.setPointerCapture?.(e.pointerId),M.current=!0,P.current=!1,N.current=e.clientX,j.current=w;let t=I(e.clientX);t!==null&&E(t)}function R(e){if(!D)return;let t=I(e.clientX);t!==null&&(M.current&&(e.preventDefault(),Math.abs(e.clientX-N.current)>Ci&&(P.current=!0)),E(t))}function z(e){if(!D||!M.current)return;e.currentTarget.releasePointerCapture?.(e.pointerId),M.current=!1;let t=I(e.clientX)??T;t!==null&&F(!P.current&&o&&t===j.current?0:t),E(null)}function B(){!D||M.current||E(null)}function V(e){let t=a?.5:1;e.key===`ArrowRight`||e.key===`ArrowUp`?(e.preventDefault(),F(w+t)):e.key===`ArrowLeft`||e.key===`ArrowDown`?(e.preventDefault(),F(w-t)):e.key===`Home`?(e.preventDefault(),F(0)):e.key===`End`&&(e.preventDefault(),F(i))}return(0,f.jsx)(`div`,{...b,ref:A,role:`slider`,"aria-label":h,"aria-valuemin":0,"aria-valuemax":i,"aria-valuenow":w,"aria-valuetext":`${w} out of ${i}`,"aria-readonly":s||void 0,"aria-disabled":p||void 0,tabIndex:D?0:-1,className:(0,l.default)(Si.rating,p&&Si.ratingDisabled,s&&Si.ratingReadOnly,v?.root,g),style:{..._,...y?.root},onKeyDown:D?V:void 0,onPointerDown:D?L:void 0,onPointerMove:D?R:void 0,onPointerUp:D?z:void 0,onPointerCancel:D?z:void 0,onPointerLeave:D?B:void 0,children:Array.from({length:i},(e,t)=>{let n=Math.round(Math.max(0,Math.min(1,k-t))*100);return(0,f.jsxs)(`div`,{className:(0,l.default)(Si.ratingItem,v?.item),style:y?.item,children:[(0,f.jsx)(u.FontAwesomeIcon,{icon:m,className:(0,l.default)(Si.ratingIconEmpty,v?.iconEmpty),style:y?.iconEmpty}),(0,f.jsx)(`div`,{className:Si.ratingIconFilledClip,style:{width:`${n}%`},children:(0,f.jsx)(u.FontAwesomeIcon,{icon:m,className:(0,l.default)(Si.ratingIconFilled,v?.iconFilled),style:y?.iconFilled})})]},t)})})}var Ei={revealLens:`revealLens_V3Kkk`,"revealLens-background":`revealLens-background_pQyK9`,revealLensBackground:`revealLens-background_pQyK9`,"revealLens-overlay":`revealLens-overlay_NOUoj`,revealLensOverlay:`revealLens-overlay_NOUoj`,"revealLens-overlay-transitioning":`revealLens-overlay-transitioning_-co2e`,revealLensOverlayTransitioning:`revealLens-overlay-transitioning_-co2e`};function Di(e,t,n,r){let i=Math.max(n-r,0);return`radial-gradient(circle ${n}px at ${e}px ${t}px, transparent ${i}px, transparent ${i}px, white ${n}px)`}function Oi(e,t){e.style.setProperty(`mask-image`,t),e.style.setProperty(`-webkit-mask-image`,t)}function ki(e){e.style.removeProperty(`mask-image`),e.style.removeProperty(`-webkit-mask-image`)}function Ai(e){let{background:t,overlay:n,radius:r=120,feather:i=24,shape:a=`circle`,maskImage:o,disabled:s=!1,className:u,style:d,classNames:p,styles:m,...h}=O(`RevealLens`,e),g=(0,c.useRef)(null),_=(0,c.useRef)(null),v=(e,t)=>{let n=g.current,a=_.current;if(!n||!a)return;let s=n.getBoundingClientRect(),c=e-s.left,l=t-s.top;a.classList.remove(Ei.revealLensOverlayTransitioning),Oi(a,o??Di(c,l,r,i))},y=()=>{let e=_.current;e&&(e.classList.add(Ei.revealLensOverlayTransitioning),ki(e))},b=e=>{s||(e.currentTarget.setPointerCapture?.(e.pointerId),v(e.clientX,e.clientY))},x=e=>{s||v(e.clientX,e.clientY)},S=e=>{s||e.pointerType===`mouse`||y()},C=e=>{if(s)return;let t=g.current;if(t){let n=t.getBoundingClientRect();if(e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom)return;if(typeof document.elementFromPoint==`function`){let n=document.elementFromPoint(e.clientX,e.clientY);if(n&&t.contains(n))return}}y()};return(0,f.jsxs)(`div`,{...h,ref:g,className:(0,l.default)(Ei.revealLens,u,p?.root),style:{...d,...m?.root},"data-reveal-shape":a,onPointerDown:b,onPointerMove:x,onPointerUp:S,onPointerCancel:C,onPointerLeave:C,children:[(0,f.jsx)(`div`,{className:(0,l.default)(Ei.revealLensBackground,p?.background),style:m?.background,children:t}),(0,f.jsx)(`div`,{ref:_,className:(0,l.default)(Ei.revealLensOverlay,p?.overlay),style:m?.overlay,children:n})]})}function ji(e){return Math.round(e/5)*5}function Mi(e){return{x:ji(e.x),y:ji(e.y)}}function Ni(e,t,n){let r=n.createSVGPoint();r.x=e,r.y=t;let i=n.getScreenCTM();if(!i)return{x:0,y:0};let a=r.matrixTransform(i.inverse());return Mi({x:a.x,y:a.y})}function Pi(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function Fi(e,t,n){let r=n.x-t.x,i=n.y-t.y,a=r*r+i*i;if(a===0)return{dist:Pi(e,t),t:0};let o=Math.max(0,Math.min(1,((e.x-t.x)*r+(e.y-t.y)*i)/a)),s=t.x+o*r,c=t.y+o*i;return{dist:Math.sqrt((e.x-s)**2+(e.y-c)**2),t:o}}function Ii(e,t){let n=null;for(let r of t){let t=r.points;for(let i=0;i<t.length;i++){let a=t[i],o=t[(i+1)%t.length],{dist:s,t:c}=Fi(e,a,o);s<=8&&(!n||s<n.dist)&&(n={roomId:r.id,wallIndex:i,t:c,dist:s})}}return n}function Li(e,t){let n=!1;for(let r=0,i=t.length-1;r<t.length;i=r++){let a=t[r].x,o=t[r].y,s=t[i].x,c=t[i].y;o>e.y!=c>e.y&&e.x<(s-a)*(e.y-o)/(c-o)+a&&(n=!n)}return n}function Ri(e){return{x:e.reduce((e,t)=>e+t.x,0)/e.length,y:e.reduce((e,t)=>e+t.y,0)/e.length}}function zi(e,t,n,r){return[{x:e,y:t},{x:e+n,y:t},{x:e+n,y:t+r},{x:e,y:t+r}]}function Bi(e,t,n,r){let i=t.x-e.x,a=t.y-e.y,o=Math.sqrt(i*i+a*a);if(o<.001)return null;let s=i/o,c=a/o,l=e.x+i*n,u=e.y+a*n,d=Math.min(r/2,o/2-.001);return{p1:{x:l-s*d,y:u-c*d},p2:{x:l+s*d,y:u+c*d},perp:{x:-c,y:s}}}function Vi(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function Hi(e){return e.map((e,t)=>`${t===0?`M`:`L`} ${e.x.toFixed(2)},${e.y.toFixed(2)}`).join(` `)+` Z`}function Ui(e,t){if(e.length<2)return[];if(t.length===0)return[e.map((e,t)=>`${t===0?`M`:`L`} ${e.x.toFixed(2)},${e.y.toFixed(2)}`).join(` `)+` Z`];let n=e.length,r=[],i=[`M ${e[0].x.toFixed(2)},${e[0].y.toFixed(2)}`];for(let a=0;a<n;a++){let o=e[a],s=e[(a+1)%n],c=s.x-o.x,l=s.y-o.y,u=Math.sqrt(c*c+l*l),d=t.filter(e=>e.wallIndex===a).sort((e,t)=>e.t-t.t);if(d.length===0)i.push(`L ${s.x.toFixed(2)},${s.y.toFixed(2)}`);else{for(let e of d){let t=e.width/2,n=Math.max(0,e.t-t/u),a=Math.min(1,e.t+t/u),s={x:o.x+c*n,y:o.y+l*n},d={x:o.x+c*a,y:o.y+l*a};i.push(`L ${s.x.toFixed(2)},${s.y.toFixed(2)}`),r.push(i),i=[`M ${d.x.toFixed(2)},${d.y.toFixed(2)}`]}i.push(`L ${s.x.toFixed(2)},${s.y.toFixed(2)}`)}}return r[0]=[...i,...r[0].slice(1)],r.map(e=>e.join(` `))}function Wi(e,t,n){let r=Bi(e,t,n.t,n.width);if(!r)return``;let{p1:i,p2:a,perp:o}=r,s={x:i.x+o.x*n.width,y:i.y+o.y*n.width};return[`M ${i.x.toFixed(2)},${i.y.toFixed(2)} L ${a.x.toFixed(2)},${a.y.toFixed(2)}`,`M ${i.x.toFixed(2)},${i.y.toFixed(2)} A ${n.width},${n.width} 0 0,1 ${s.x.toFixed(2)},${s.y.toFixed(2)}`].join(` `)}function Gi(e,t){let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let t of e)for(let e of t.points)e.x<n&&(n=e.x),e.y<r&&(r=e.y),e.x>i&&(i=e.x),e.y>a&&(a=e.y);isFinite(n)||(n=0,r=0,i=400,a=300);let o=[(n-5).toFixed(2),(r-5).toFixed(2),(i-n+10).toFixed(2),(a-r+10).toFixed(2)].join(` `),s=e.map(e=>{let n=t.filter(t=>t.roomId===e.id),r=Ui(e.points,n),i=Hi(e.points),a=Ri(e.points),o=r.map(e=>` <path d="${e}" />`).join(`
|
|
9
9
|
`),s=n.map(t=>{let n=e.points[t.wallIndex],r=e.points[(t.wallIndex+1)%e.points.length],i=Wi(n,r,t);return i?` <path d="${i}" fill="none" />`:``}).filter(Boolean).join(`
|
|
10
10
|
`),c=e.name?` <text fontSize="5" x="${a.x.toFixed(1)}" y="${a.y.toFixed(1)}">${Vi(e.name)}</text>`:``;return[` <g id="${e.id}">`,o,` <path id="background" d="${i}" />`,s,c,` </g>`].filter(Boolean).join(`
|
|
11
11
|
`)});return[`<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="${o}">`,` <g id="layer1">`,...s,` </g>`,` <use id="use" href="" />`,`</svg>`].join(`
|