`, so it can be styled via any CSS solution you prefer.\n * @see https://floating-ui.com/docs/FloatingOverlay\n */\nconst FloatingOverlay = /*#__PURE__*/React.forwardRef(function FloatingOverlay(_ref, ref) {\n let {\n lockScroll = false,\n ...rest\n } = _ref;\n const lockId = useId();\n index(() => {\n if (!lockScroll) return;\n activeLocks.add(lockId);\n const isIOS = /iP(hone|ad|od)|iOS/.test(getPlatform());\n const bodyStyle = document.body.style;\n // RTL scrollbar\n const scrollbarX = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft;\n const paddingProp = scrollbarX ? 'paddingLeft' : 'paddingRight';\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;\n const scrollX = bodyStyle.left ? parseFloat(bodyStyle.left) : window.pageXOffset;\n const scrollY = bodyStyle.top ? parseFloat(bodyStyle.top) : window.pageYOffset;\n bodyStyle.overflow = 'hidden';\n if (scrollbarWidth) {\n bodyStyle[paddingProp] = scrollbarWidth + \"px\";\n }\n\n // Only iOS doesn't respect `overflow: hidden` on document.body, and this\n // technique has fewer side effects.\n if (isIOS) {\n var _window$visualViewpor, _window$visualViewpor2;\n // iOS 12 does not support `visualViewport`.\n const offsetLeft = ((_window$visualViewpor = window.visualViewport) == null ? void 0 : _window$visualViewpor.offsetLeft) || 0;\n const offsetTop = ((_window$visualViewpor2 = window.visualViewport) == null ? void 0 : _window$visualViewpor2.offsetTop) || 0;\n Object.assign(bodyStyle, {\n position: 'fixed',\n top: -(scrollY - Math.floor(offsetTop)) + \"px\",\n left: -(scrollX - Math.floor(offsetLeft)) + \"px\",\n right: '0'\n });\n }\n return () => {\n activeLocks.delete(lockId);\n if (activeLocks.size === 0) {\n Object.assign(bodyStyle, {\n overflow: '',\n [paddingProp]: ''\n });\n if (isIOS) {\n Object.assign(bodyStyle, {\n position: '',\n top: '',\n left: '',\n right: ''\n });\n window.scrollTo(scrollX, scrollY);\n }\n }\n };\n }, [lockId, lockScroll]);\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: ref\n }, rest, {\n style: {\n position: 'fixed',\n overflow: 'auto',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...rest.style\n }\n }));\n});\n\nfunction isButtonTarget(event) {\n return isHTMLElement(event.target) && event.target.tagName === 'BUTTON';\n}\nfunction isSpaceIgnored(element) {\n return isTypeableElement(element);\n}\n/**\n * Opens or closes the floating element when clicking the reference element.\n * @see https://floating-ui.com/docs/useClick\n */\nfunction useClick(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n onOpenChange,\n dataRef,\n elements: {\n domReference\n }\n } = context;\n const {\n enabled = true,\n event: eventOption = 'click',\n toggle = true,\n ignoreMouse = false,\n keyboardHandlers = true\n } = props;\n const pointerTypeRef = React.useRef();\n const didKeyDownRef = React.useRef(false);\n return React.useMemo(() => {\n if (!enabled) return {};\n return {\n reference: {\n onPointerDown(event) {\n pointerTypeRef.current = event.pointerType;\n },\n onMouseDown(event) {\n // Ignore all buttons except for the \"main\" button.\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n if (event.button !== 0) {\n return;\n }\n if (isMouseLikePointerType(pointerTypeRef.current, true) && ignoreMouse) {\n return;\n }\n if (eventOption === 'click') {\n return;\n }\n if (open && toggle && (dataRef.current.openEvent ? dataRef.current.openEvent.type === 'mousedown' : true)) {\n onOpenChange(false, event.nativeEvent);\n } else {\n // Prevent stealing focus from the floating element\n event.preventDefault();\n onOpenChange(true, event.nativeEvent);\n }\n },\n onClick(event) {\n if (eventOption === 'mousedown' && pointerTypeRef.current) {\n pointerTypeRef.current = undefined;\n return;\n }\n if (isMouseLikePointerType(pointerTypeRef.current, true) && ignoreMouse) {\n return;\n }\n if (open && toggle && (dataRef.current.openEvent ? dataRef.current.openEvent.type === 'click' : true)) {\n onOpenChange(false, event.nativeEvent);\n } else {\n onOpenChange(true, event.nativeEvent);\n }\n },\n onKeyDown(event) {\n pointerTypeRef.current = undefined;\n if (event.defaultPrevented || !keyboardHandlers || isButtonTarget(event)) {\n return;\n }\n if (event.key === ' ' && !isSpaceIgnored(domReference)) {\n // Prevent scrolling\n event.preventDefault();\n didKeyDownRef.current = true;\n }\n if (event.key === 'Enter') {\n if (open && toggle) {\n onOpenChange(false, event.nativeEvent);\n } else {\n onOpenChange(true, event.nativeEvent);\n }\n }\n },\n onKeyUp(event) {\n if (event.defaultPrevented || !keyboardHandlers || isButtonTarget(event) || isSpaceIgnored(domReference)) {\n return;\n }\n if (event.key === ' ' && didKeyDownRef.current) {\n didKeyDownRef.current = false;\n if (open && toggle) {\n onOpenChange(false, event.nativeEvent);\n } else {\n onOpenChange(true, event.nativeEvent);\n }\n }\n }\n }\n };\n }, [enabled, dataRef, eventOption, ignoreMouse, keyboardHandlers, domReference, toggle, open, onOpenChange]);\n}\n\n// `toString()` prevents bundlers from trying to `import { useInsertionEffect } from 'react'`\nconst useInsertionEffect = React[/*#__PURE__*/'useInsertionEffect'.toString()];\nconst useSafeInsertionEffect = useInsertionEffect || (fn => fn());\nfunction useEffectEvent(callback) {\n const ref = React.useRef(() => {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error('Cannot call an event handler while rendering.');\n }\n });\n useSafeInsertionEffect(() => {\n ref.current = callback;\n });\n return React.useCallback(function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return ref.current == null ? void 0 : ref.current(...args);\n }, []);\n}\n\nfunction createVirtualElement(domRef, data) {\n let offsetX = null;\n let offsetY = null;\n let isAutoUpdateEvent = false;\n return {\n contextElement: domRef.current || undefined,\n getBoundingClientRect() {\n var _domRef$current, _data$dataRef$current;\n const domRect = ((_domRef$current = domRef.current) == null ? void 0 : _domRef$current.getBoundingClientRect()) || {\n width: 0,\n height: 0,\n x: 0,\n y: 0\n };\n const isXAxis = data.axis === 'x' || data.axis === 'both';\n const isYAxis = data.axis === 'y' || data.axis === 'both';\n const canTrackCursorOnAutoUpdate = ['mouseenter', 'mousemove'].includes(((_data$dataRef$current = data.dataRef.current.openEvent) == null ? void 0 : _data$dataRef$current.type) || '') && data.pointerType !== 'touch';\n let width = domRect.width;\n let height = domRect.height;\n let x = domRect.x;\n let y = domRect.y;\n if (offsetX == null && data.x && isXAxis) {\n offsetX = domRect.x - data.x;\n }\n if (offsetY == null && data.y && isYAxis) {\n offsetY = domRect.y - data.y;\n }\n x -= offsetX || 0;\n y -= offsetY || 0;\n width = 0;\n height = 0;\n if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) {\n width = data.axis === 'y' ? domRect.width : 0;\n height = data.axis === 'x' ? domRect.height : 0;\n x = isXAxis && data.x != null ? data.x : x;\n y = isYAxis && data.y != null ? data.y : y;\n } else if (isAutoUpdateEvent && !canTrackCursorOnAutoUpdate) {\n height = data.axis === 'x' ? domRect.height : height;\n width = data.axis === 'y' ? domRect.width : width;\n }\n isAutoUpdateEvent = true;\n return {\n width,\n height,\n x,\n y,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x\n };\n }\n };\n}\nfunction isMouseBasedEvent(event) {\n return event != null && event.clientX != null;\n}\n/**\n * Positions the floating element relative to a client point (in the viewport),\n * such as the mouse position. By default, it follows the mouse cursor.\n * @see https://floating-ui.com/docs/useClientPoint\n */\nfunction useClientPoint(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n refs,\n dataRef,\n elements: {\n floating\n }\n } = context;\n const {\n enabled = true,\n axis = 'both',\n x = null,\n y = null\n } = props;\n const initialRef = React.useRef(false);\n const cleanupListenerRef = React.useRef(null);\n const [pointerType, setPointerType] = React.useState();\n const [reactive, setReactive] = React.useState([]);\n const setReference = useEffectEvent((x, y) => {\n if (initialRef.current) return;\n\n // Prevent setting if the open event was not a mouse-like one\n // (e.g. focus to open, then hover over the reference element).\n // Only apply if the event exists.\n if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) {\n return;\n }\n refs.setPositionReference(createVirtualElement(refs.domReference, {\n x,\n y,\n axis,\n dataRef,\n pointerType\n }));\n });\n const handleReferenceEnterOrMove = useEffectEvent(event => {\n if (x != null || y != null) return;\n if (!open) {\n setReference(event.clientX, event.clientY);\n } else if (!cleanupListenerRef.current) {\n // If there's no cleanup, there's no listener, but we want to ensure\n // we add the listener if the cursor landed on the floating element and\n // then back on the reference (i.e. it's interactive).\n setReactive([]);\n }\n });\n\n // If the pointer is a mouse-like pointer, we want to continue following the\n // mouse even if the floating element is transitioning out. On touch\n // devices, this is undesirable because the floating element will move to\n // the dismissal touch point.\n const openCheck = isMouseLikePointerType(pointerType) ? floating : open;\n const addListener = React.useCallback(() => {\n // Explicitly specified `x`/`y` coordinates shouldn't add a listener.\n if (!openCheck || !enabled || x != null || y != null) return;\n const win = getWindow(refs.floating.current);\n function handleMouseMove(event) {\n const target = getTarget(event);\n if (!contains(refs.floating.current, target)) {\n setReference(event.clientX, event.clientY);\n } else {\n win.removeEventListener('mousemove', handleMouseMove);\n cleanupListenerRef.current = null;\n }\n }\n if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) {\n win.addEventListener('mousemove', handleMouseMove);\n const cleanup = () => {\n win.removeEventListener('mousemove', handleMouseMove);\n cleanupListenerRef.current = null;\n };\n cleanupListenerRef.current = cleanup;\n return cleanup;\n }\n refs.setPositionReference(refs.domReference.current);\n }, [dataRef, enabled, openCheck, refs, setReference, x, y]);\n React.useEffect(() => {\n return addListener();\n }, [addListener, reactive]);\n React.useEffect(() => {\n if (enabled && !floating) {\n initialRef.current = false;\n }\n }, [enabled, floating]);\n React.useEffect(() => {\n if (!enabled && open) {\n initialRef.current = true;\n }\n }, [enabled, open]);\n index(() => {\n if (enabled && (x != null || y != null)) {\n initialRef.current = false;\n setReference(x, y);\n }\n }, [enabled, x, y, setReference]);\n return React.useMemo(() => {\n if (!enabled) return {};\n function setPointerTypeRef(_ref) {\n let {\n pointerType\n } = _ref;\n setPointerType(pointerType);\n }\n return {\n reference: {\n onPointerDown: setPointerTypeRef,\n onPointerEnter: setPointerTypeRef,\n onMouseMove: handleReferenceEnterOrMove,\n onMouseEnter: handleReferenceEnterOrMove\n }\n };\n }, [enabled, handleReferenceEnterOrMove]);\n}\n\nconst bubbleHandlerKeys = {\n pointerdown: 'onPointerDown',\n mousedown: 'onMouseDown',\n click: 'onClick'\n};\nconst captureHandlerKeys = {\n pointerdown: 'onPointerDownCapture',\n mousedown: 'onMouseDownCapture',\n click: 'onClickCapture'\n};\nconst normalizeBubblesProp = bubbles => {\n var _bubbles$escapeKey, _bubbles$outsidePress;\n return {\n escapeKeyBubbles: typeof bubbles === 'boolean' ? bubbles : (_bubbles$escapeKey = bubbles == null ? void 0 : bubbles.escapeKey) != null ? _bubbles$escapeKey : false,\n outsidePressBubbles: typeof bubbles === 'boolean' ? bubbles : (_bubbles$outsidePress = bubbles == null ? void 0 : bubbles.outsidePress) != null ? _bubbles$outsidePress : true\n };\n};\n/**\n * Closes the floating element when a dismissal is requested — by default, when\n * the user presses the `escape` key or outside of the floating element.\n * @see https://floating-ui.com/docs/useDismiss\n */\nfunction useDismiss(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n onOpenChange,\n events,\n nodeId,\n elements: {\n reference,\n domReference,\n floating\n },\n dataRef\n } = context;\n const {\n enabled = true,\n escapeKey = true,\n outsidePress: unstable_outsidePress = true,\n outsidePressEvent = 'pointerdown',\n referencePress = false,\n referencePressEvent = 'pointerdown',\n ancestorScroll = false,\n bubbles\n } = props;\n const tree = useFloatingTree();\n const nested = useFloatingParentNodeId() != null;\n const outsidePressFn = useEffectEvent(typeof unstable_outsidePress === 'function' ? unstable_outsidePress : () => false);\n const outsidePress = typeof unstable_outsidePress === 'function' ? outsidePressFn : unstable_outsidePress;\n const insideReactTreeRef = React.useRef(false);\n const {\n escapeKeyBubbles,\n outsidePressBubbles\n } = normalizeBubblesProp(bubbles);\n const closeOnEscapeKeyDown = useEffectEvent(event => {\n if (!open || !enabled || !escapeKey || event.key !== 'Escape') {\n return;\n }\n const children = tree ? getChildren(tree.nodesRef.current, nodeId) : [];\n if (!escapeKeyBubbles) {\n event.stopPropagation();\n if (children.length > 0) {\n let shouldDismiss = true;\n children.forEach(child => {\n var _child$context;\n if ((_child$context = child.context) != null && _child$context.open && !child.context.dataRef.current.__escapeKeyBubbles) {\n shouldDismiss = false;\n return;\n }\n });\n if (!shouldDismiss) {\n return;\n }\n }\n }\n events.emit('dismiss', {\n type: 'escapeKey',\n data: {\n returnFocus: {\n preventScroll: false\n }\n }\n });\n onOpenChange(false, isReactEvent(event) ? event.nativeEvent : event);\n });\n const closeOnPressOutside = useEffectEvent(event => {\n // Given developers can stop the propagation of the synthetic event,\n // we can only be confident with a positive value.\n const insideReactTree = insideReactTreeRef.current;\n insideReactTreeRef.current = false;\n if (insideReactTree) {\n return;\n }\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n const target = getTarget(event);\n const inertSelector = \"[\" + createAttribute('inert') + \"]\";\n const markers = getDocument(floating).querySelectorAll(inertSelector);\n let targetRootAncestor = isElement(target) ? target : null;\n while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {\n const nextParent = getParentNode(targetRootAncestor);\n if (nextParent === getDocument(floating).body || !isElement(nextParent)) {\n break;\n } else {\n targetRootAncestor = nextParent;\n }\n }\n\n // Check if the click occurred on a third-party element injected after the\n // floating element rendered.\n if (markers.length && isElement(target) && !isRootElement(target) &&\n // Clicked on a direct ancestor (e.g. FloatingOverlay).\n !contains(target, floating) &&\n // If the target root element contains none of the markers, then the\n // element was injected after the floating element rendered.\n Array.from(markers).every(marker => !contains(targetRootAncestor, marker))) {\n return;\n }\n\n // Check if the click occurred on the scrollbar\n if (isHTMLElement(target) && floating) {\n // In Firefox, `target.scrollWidth > target.clientWidth` for inline\n // elements.\n const canScrollX = target.clientWidth > 0 && target.scrollWidth > target.clientWidth;\n const canScrollY = target.clientHeight > 0 && target.scrollHeight > target.clientHeight;\n let xCond = canScrollY && event.offsetX > target.clientWidth;\n\n // In some browsers it is possible to change the (or window)\n // scrollbar to the left side, but is very rare and is difficult to\n // check for. Plus, for modal dialogs with backdrops, it is more\n // important that the backdrop is checked but not so much the window.\n if (canScrollY) {\n const isRTL = getComputedStyle(target).direction === 'rtl';\n if (isRTL) {\n xCond = event.offsetX <= target.offsetWidth - target.clientWidth;\n }\n }\n if (xCond || canScrollX && event.offsetY > target.clientHeight) {\n return;\n }\n }\n const targetIsInsideChildren = tree && getChildren(tree.nodesRef.current, nodeId).some(node => {\n var _node$context;\n return isEventTargetWithin(event, (_node$context = node.context) == null ? void 0 : _node$context.elements.floating);\n });\n if (isEventTargetWithin(event, floating) || isEventTargetWithin(event, domReference) || targetIsInsideChildren) {\n return;\n }\n const children = tree ? getChildren(tree.nodesRef.current, nodeId) : [];\n if (children.length > 0) {\n let shouldDismiss = true;\n children.forEach(child => {\n var _child$context2;\n if ((_child$context2 = child.context) != null && _child$context2.open && !child.context.dataRef.current.__outsidePressBubbles) {\n shouldDismiss = false;\n return;\n }\n });\n if (!shouldDismiss) {\n return;\n }\n }\n events.emit('dismiss', {\n type: 'outsidePress',\n data: {\n returnFocus: nested ? {\n preventScroll: true\n } : isVirtualClick(event) || isVirtualPointerEvent(event)\n }\n });\n onOpenChange(false, event);\n });\n React.useEffect(() => {\n if (!open || !enabled) {\n return;\n }\n dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;\n dataRef.current.__outsidePressBubbles = outsidePressBubbles;\n function onScroll(event) {\n onOpenChange(false, event);\n }\n const doc = getDocument(floating);\n escapeKey && doc.addEventListener('keydown', closeOnEscapeKeyDown);\n outsidePress && doc.addEventListener(outsidePressEvent, closeOnPressOutside);\n let ancestors = [];\n if (ancestorScroll) {\n if (isElement(domReference)) {\n ancestors = getOverflowAncestors(domReference);\n }\n if (isElement(floating)) {\n ancestors = ancestors.concat(getOverflowAncestors(floating));\n }\n if (!isElement(reference) && reference && reference.contextElement) {\n ancestors = ancestors.concat(getOverflowAncestors(reference.contextElement));\n }\n }\n\n // Ignore the visual viewport for scrolling dismissal (allow pinch-zoom)\n ancestors = ancestors.filter(ancestor => {\n var _doc$defaultView;\n return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport);\n });\n ancestors.forEach(ancestor => {\n ancestor.addEventListener('scroll', onScroll, {\n passive: true\n });\n });\n return () => {\n escapeKey && doc.removeEventListener('keydown', closeOnEscapeKeyDown);\n outsidePress && doc.removeEventListener(outsidePressEvent, closeOnPressOutside);\n ancestors.forEach(ancestor => {\n ancestor.removeEventListener('scroll', onScroll);\n });\n };\n }, [dataRef, floating, domReference, reference, escapeKey, outsidePress, outsidePressEvent, open, onOpenChange, ancestorScroll, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, closeOnPressOutside]);\n React.useEffect(() => {\n insideReactTreeRef.current = false;\n }, [outsidePress, outsidePressEvent]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n return {\n reference: {\n onKeyDown: closeOnEscapeKeyDown,\n [bubbleHandlerKeys[referencePressEvent]]: event => {\n if (referencePress) {\n events.emit('dismiss', {\n type: 'referencePress',\n data: {\n returnFocus: false\n }\n });\n onOpenChange(false, event.nativeEvent);\n }\n }\n },\n floating: {\n onKeyDown: closeOnEscapeKeyDown,\n [captureHandlerKeys[outsidePressEvent]]: () => {\n insideReactTreeRef.current = true;\n }\n }\n };\n }, [enabled, events, referencePress, outsidePressEvent, referencePressEvent, onOpenChange, closeOnEscapeKeyDown]);\n}\n\nlet devMessageSet;\nif (process.env.NODE_ENV !== \"production\") {\n devMessageSet = /*#__PURE__*/new Set();\n}\n\n/**\n * Provides data to position a floating element and context to add interactions.\n * @see https://floating-ui.com/docs/react\n */\nfunction useFloating(options) {\n var _options$elements2;\n if (options === void 0) {\n options = {};\n }\n const {\n open = false,\n onOpenChange: unstable_onOpenChange,\n nodeId\n } = options;\n if (process.env.NODE_ENV !== \"production\") {\n var _options$elements;\n const err = 'Floating UI: Cannot pass a virtual element to the ' + '`elements.reference` option, as it must be a real DOM element. ' + 'Use `refs.setPositionReference` instead.';\n if ((_options$elements = options.elements) != null && _options$elements.reference && !isElement(options.elements.reference)) {\n var _devMessageSet;\n if (!((_devMessageSet = devMessageSet) != null && _devMessageSet.has(err))) {\n var _devMessageSet2;\n (_devMessageSet2 = devMessageSet) == null ? void 0 : _devMessageSet2.add(err);\n console.error(err);\n }\n }\n }\n const [_domReference, setDomReference] = React.useState(null);\n const domReference = ((_options$elements2 = options.elements) == null ? void 0 : _options$elements2.reference) || _domReference;\n const position = useFloating$1(options);\n const tree = useFloatingTree();\n const onOpenChange = useEffectEvent((open, event) => {\n if (open) {\n dataRef.current.openEvent = event;\n }\n unstable_onOpenChange == null ? void 0 : unstable_onOpenChange(open, event);\n });\n const domReferenceRef = React.useRef(null);\n const dataRef = React.useRef({});\n const events = React.useState(() => createPubSub())[0];\n const floatingId = useId();\n const setPositionReference = React.useCallback(node => {\n const positionReference = isElement(node) ? {\n getBoundingClientRect: () => node.getBoundingClientRect(),\n contextElement: node\n } : node;\n position.refs.setReference(positionReference);\n }, [position.refs]);\n const setReference = React.useCallback(node => {\n if (isElement(node) || node === null) {\n domReferenceRef.current = node;\n setDomReference(node);\n }\n\n // Backwards-compatibility for passing a virtual element to `reference`\n // after it has set the DOM reference.\n if (isElement(position.refs.reference.current) || position.refs.reference.current === null ||\n // Don't allow setting virtual elements using the old technique back to\n // `null` to support `positionReference` + an unstable `reference`\n // callback ref.\n node !== null && !isElement(node)) {\n position.refs.setReference(node);\n }\n }, [position.refs]);\n const refs = React.useMemo(() => ({\n ...position.refs,\n setReference,\n setPositionReference,\n domReference: domReferenceRef\n }), [position.refs, setReference, setPositionReference]);\n const elements = React.useMemo(() => ({\n ...position.elements,\n domReference: domReference\n }), [position.elements, domReference]);\n const context = React.useMemo(() => ({\n ...position,\n refs,\n elements,\n dataRef,\n nodeId,\n floatingId,\n events,\n open,\n onOpenChange\n }), [position, nodeId, floatingId, events, open, onOpenChange, refs, elements]);\n index(() => {\n const node = tree == null ? void 0 : tree.nodesRef.current.find(node => node.id === nodeId);\n if (node) {\n node.context = context;\n }\n });\n return React.useMemo(() => ({\n ...position,\n context,\n refs,\n elements\n }), [position, refs, elements, context]);\n}\n\n/**\n * Opens the floating element while the reference element has focus, like CSS\n * `:focus`.\n * @see https://floating-ui.com/docs/useFocus\n */\nfunction useFocus(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n onOpenChange,\n dataRef,\n events,\n refs,\n elements: {\n floating,\n domReference\n }\n } = context;\n const {\n enabled = true,\n keyboardOnly = true\n } = props;\n const pointerTypeRef = React.useRef('');\n const blockFocusRef = React.useRef(false);\n const timeoutRef = React.useRef();\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n const doc = getDocument(floating);\n const win = doc.defaultView || window;\n\n // If the reference was focused and the user left the tab/window, and the\n // floating element was not open, the focus should be blocked when they\n // return to the tab/window.\n function onBlur() {\n if (!open && isHTMLElement(domReference) && domReference === activeElement(getDocument(domReference))) {\n blockFocusRef.current = true;\n }\n }\n win.addEventListener('blur', onBlur);\n return () => {\n win.removeEventListener('blur', onBlur);\n };\n }, [floating, domReference, open, enabled]);\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n function onDismiss(payload) {\n if (payload.type === 'referencePress' || payload.type === 'escapeKey') {\n blockFocusRef.current = true;\n }\n }\n events.on('dismiss', onDismiss);\n return () => {\n events.off('dismiss', onDismiss);\n };\n }, [events, enabled]);\n React.useEffect(() => {\n return () => {\n clearTimeout(timeoutRef.current);\n };\n }, []);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n return {\n reference: {\n onPointerDown(_ref) {\n let {\n pointerType\n } = _ref;\n pointerTypeRef.current = pointerType;\n blockFocusRef.current = !!(pointerType && keyboardOnly);\n },\n onMouseLeave() {\n blockFocusRef.current = false;\n },\n onFocus(event) {\n var _dataRef$current$open;\n if (blockFocusRef.current) {\n return;\n }\n\n // Dismiss with click should ignore the subsequent `focus` trigger,\n // but only if the click originated inside the reference element.\n if (event.type === 'focus' && ((_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type) === 'mousedown' && isEventTargetWithin(dataRef.current.openEvent, domReference)) {\n return;\n }\n onOpenChange(true, event.nativeEvent);\n },\n onBlur(event) {\n blockFocusRef.current = false;\n const relatedTarget = event.relatedTarget;\n\n // Hit the non-modal focus management portal guard. Focus will be\n // moved into the floating element immediately after.\n const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute('focus-guard')) && relatedTarget.getAttribute('data-type') === 'outside';\n\n // Wait for the window blur listener to fire.\n timeoutRef.current = setTimeout(() => {\n // When focusing the reference element (e.g. regular click), then\n // clicking into the floating element, prevent it from hiding.\n // Note: it must be focusable, e.g. `tabindex=\"-1\"`.\n if (contains(refs.floating.current, relatedTarget) || contains(domReference, relatedTarget) || movedToFocusGuard) {\n return;\n }\n onOpenChange(false, event.nativeEvent);\n });\n }\n }\n };\n }, [enabled, keyboardOnly, domReference, refs, dataRef, onOpenChange]);\n}\n\nfunction mergeProps(userProps, propsList, elementKey) {\n const map = new Map();\n return {\n ...(elementKey === 'floating' && {\n tabIndex: -1\n }),\n ...userProps,\n ...propsList.map(value => value ? value[elementKey] : null).concat(userProps).reduce((acc, props) => {\n if (!props) {\n return acc;\n }\n Object.entries(props).forEach(_ref => {\n let [key, value] = _ref;\n if (key.indexOf('on') === 0) {\n if (!map.has(key)) {\n map.set(key, []);\n }\n if (typeof value === 'function') {\n var _map$get;\n (_map$get = map.get(key)) == null ? void 0 : _map$get.push(value);\n acc[key] = function () {\n var _map$get2;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return (_map$get2 = map.get(key)) == null ? void 0 : _map$get2.map(fn => fn(...args)).find(val => val !== undefined);\n };\n }\n } else {\n acc[key] = value;\n }\n });\n return acc;\n }, {})\n };\n}\n\n/**\n * Merges an array of interaction hooks' props into prop getters, allowing\n * event handler functions to be composed together without overwriting one\n * another.\n * @see https://floating-ui.com/docs/react#interaction-hooks\n */\nfunction useInteractions(propsList) {\n if (propsList === void 0) {\n propsList = [];\n }\n // The dependencies are a dynamic array, so we can't use the linter's\n // suggestion to add it to the deps array.\n const deps = propsList;\n const getReferenceProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'reference'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n deps);\n const getFloatingProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'floating'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n deps);\n const getItemProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'item'),\n // Granularly check for `item` changes, because the `getItemProps` getter\n // should be as referentially stable as possible since it may be passed as\n // a prop to many components. All `item` key values must therefore be\n // memoized.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n propsList.map(key => key == null ? void 0 : key.item));\n return React.useMemo(() => ({\n getReferenceProps,\n getFloatingProps,\n getItemProps\n }), [getReferenceProps, getFloatingProps, getItemProps]);\n}\n\nlet isPreventScrollSupported = false;\nfunction doSwitch(orientation, vertical, horizontal) {\n switch (orientation) {\n case 'vertical':\n return vertical;\n case 'horizontal':\n return horizontal;\n default:\n return vertical || horizontal;\n }\n}\nfunction isMainOrientationKey(key, orientation) {\n const vertical = key === ARROW_UP || key === ARROW_DOWN;\n const horizontal = key === ARROW_LEFT || key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isMainOrientationToEndKey(key, orientation, rtl) {\n const vertical = key === ARROW_DOWN;\n const horizontal = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal) || key === 'Enter' || key == ' ' || key === '';\n}\nfunction isCrossOrientationOpenKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n const horizontal = key === ARROW_DOWN;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isCrossOrientationCloseKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;\n const horizontal = key === ARROW_UP;\n return doSwitch(orientation, vertical, horizontal);\n}\n/**\n * Adds arrow key-based navigation of a list of items, either using real DOM\n * focus or virtual focus.\n * @see https://floating-ui.com/docs/useListNavigation\n */\nfunction useListNavigation(context, props) {\n const {\n open,\n onOpenChange,\n refs,\n elements: {\n domReference,\n floating\n }\n } = context;\n const {\n listRef,\n activeIndex,\n onNavigate: unstable_onNavigate = () => {},\n enabled = true,\n selectedIndex = null,\n allowEscape = false,\n loop = false,\n nested = false,\n rtl = false,\n virtual = false,\n focusItemOnOpen = 'auto',\n focusItemOnHover = true,\n openOnArrowKeyDown = true,\n disabledIndices = undefined,\n orientation = 'vertical',\n cols = 1,\n scrollItemIntoView = true,\n virtualItemRef\n } = props;\n if (process.env.NODE_ENV !== \"production\") {\n if (allowEscape) {\n if (!loop) {\n console.warn(['Floating UI: `useListNavigation` looping must be enabled to allow', 'escaping.'].join(' '));\n }\n if (!virtual) {\n console.warn(['Floating UI: `useListNavigation` must be virtual to allow', 'escaping.'].join(' '));\n }\n }\n if (orientation === 'vertical' && cols > 1) {\n console.warn(['Floating UI: In grid list navigation mode (`cols` > 1), the', '`orientation` should be either \"horizontal\" or \"both\".'].join(' '));\n }\n }\n const parentId = useFloatingParentNodeId();\n const tree = useFloatingTree();\n const onNavigate = useEffectEvent(unstable_onNavigate);\n const focusItemOnOpenRef = React.useRef(focusItemOnOpen);\n const indexRef = React.useRef(selectedIndex != null ? selectedIndex : -1);\n const keyRef = React.useRef(null);\n const isPointerModalityRef = React.useRef(true);\n const previousOnNavigateRef = React.useRef(onNavigate);\n const previousMountedRef = React.useRef(!!floating);\n const forceSyncFocus = React.useRef(false);\n const forceScrollIntoViewRef = React.useRef(false);\n const disabledIndicesRef = useLatestRef(disabledIndices);\n const latestOpenRef = useLatestRef(open);\n const scrollItemIntoViewRef = useLatestRef(scrollItemIntoView);\n const [activeId, setActiveId] = React.useState();\n const [virtualId, setVirtualId] = React.useState();\n const focusItem = useEffectEvent(function (listRef, indexRef, forceScrollIntoView) {\n if (forceScrollIntoView === void 0) {\n forceScrollIntoView = false;\n }\n const item = listRef.current[indexRef.current];\n if (!item) return;\n if (virtual) {\n setActiveId(item.id);\n tree == null ? void 0 : tree.events.emit('virtualfocus', item);\n if (virtualItemRef) {\n virtualItemRef.current = item;\n }\n } else {\n enqueueFocus(item, {\n preventScroll: true,\n // Mac Safari does not move the virtual cursor unless the focus call\n // is sync. However, for the very first focus call, we need to wait\n // for the position to be ready in order to prevent unwanted\n // scrolling. This means the virtual cursor will not move to the first\n // item when first opening the floating element, but will on\n // subsequent calls. `preventScroll` is supported in modern Safari,\n // so we can use that instead.\n // iOS Safari must be async or the first item will not be focused.\n sync: isMac() && isSafari() ? isPreventScrollSupported || forceSyncFocus.current : false\n });\n }\n requestAnimationFrame(() => {\n const scrollIntoViewOptions = scrollItemIntoViewRef.current;\n const shouldScrollIntoView = scrollIntoViewOptions && item && (forceScrollIntoView || !isPointerModalityRef.current);\n if (shouldScrollIntoView) {\n // JSDOM doesn't support `.scrollIntoView()` but it's widely supported\n // by all browsers.\n item.scrollIntoView == null ? void 0 : item.scrollIntoView(typeof scrollIntoViewOptions === 'boolean' ? {\n block: 'nearest',\n inline: 'nearest'\n } : scrollIntoViewOptions);\n }\n });\n });\n index(() => {\n document.createElement('div').focus({\n get preventScroll() {\n isPreventScrollSupported = true;\n return false;\n }\n });\n }, []);\n\n // Sync `selectedIndex` to be the `activeIndex` upon opening the floating\n // element. Also, reset `activeIndex` upon closing the floating element.\n index(() => {\n if (!enabled) {\n return;\n }\n if (open && floating) {\n if (focusItemOnOpenRef.current && selectedIndex != null) {\n // Regardless of the pointer modality, we want to ensure the selected\n // item comes into view when the floating element is opened.\n forceScrollIntoViewRef.current = true;\n onNavigate(selectedIndex);\n }\n } else if (previousMountedRef.current) {\n // Since the user can specify `onNavigate` conditionally\n // (onNavigate: open ? setActiveIndex : setSelectedIndex),\n // we store and call the previous function.\n indexRef.current = -1;\n previousOnNavigateRef.current(null);\n }\n }, [enabled, open, floating, selectedIndex, onNavigate]);\n\n // Sync `activeIndex` to be the focused item while the floating element is\n // open.\n index(() => {\n if (!enabled) {\n return;\n }\n if (open && floating) {\n if (activeIndex == null) {\n forceSyncFocus.current = false;\n if (selectedIndex != null) {\n return;\n }\n\n // Reset while the floating element was open (e.g. the list changed).\n if (previousMountedRef.current) {\n indexRef.current = -1;\n focusItem(listRef, indexRef);\n }\n\n // Initial sync.\n if (!previousMountedRef.current && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {\n let runs = 0;\n const waitForListPopulated = () => {\n if (listRef.current[0] == null) {\n // Avoid letting the browser paint if possible on the first try,\n // otherwise use rAF. Don't try more than twice, since something\n // is wrong otherwise.\n if (runs < 2) {\n const scheduler = runs ? requestAnimationFrame : queueMicrotask;\n scheduler(waitForListPopulated);\n }\n runs++;\n } else {\n indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, orientation, rtl) || nested ? getMinIndex(listRef, disabledIndicesRef.current) : getMaxIndex(listRef, disabledIndicesRef.current);\n keyRef.current = null;\n onNavigate(indexRef.current);\n }\n };\n waitForListPopulated();\n }\n } else if (!isIndexOutOfBounds(listRef, activeIndex)) {\n indexRef.current = activeIndex;\n focusItem(listRef, indexRef, forceScrollIntoViewRef.current);\n forceScrollIntoViewRef.current = false;\n }\n }\n }, [enabled, open, floating, activeIndex, selectedIndex, nested, listRef, orientation, rtl, onNavigate, focusItem, disabledIndicesRef]);\n\n // Ensure the parent floating element has focus when a nested child closes\n // to allow arrow key navigation to work after the pointer leaves the child.\n index(() => {\n var _nodes$find, _nodes$find$context;\n if (!enabled || floating || !tree || virtual || !previousMountedRef.current) {\n return;\n }\n const nodes = tree.nodesRef.current;\n const parent = (_nodes$find = nodes.find(node => node.id === parentId)) == null ? void 0 : (_nodes$find$context = _nodes$find.context) == null ? void 0 : _nodes$find$context.elements.floating;\n const activeEl = activeElement(getDocument(floating));\n const treeContainsActiveEl = nodes.some(node => node.context && contains(node.context.elements.floating, activeEl));\n if (parent && !treeContainsActiveEl && isPointerModalityRef.current) {\n parent.focus({\n preventScroll: true\n });\n }\n }, [enabled, floating, tree, parentId, virtual]);\n index(() => {\n if (!enabled || !tree || !virtual || parentId) return;\n function handleVirtualFocus(item) {\n setVirtualId(item.id);\n if (virtualItemRef) {\n virtualItemRef.current = item;\n }\n }\n tree.events.on('virtualfocus', handleVirtualFocus);\n return () => {\n tree.events.off('virtualfocus', handleVirtualFocus);\n };\n }, [enabled, tree, virtual, parentId, virtualItemRef]);\n index(() => {\n previousOnNavigateRef.current = onNavigate;\n previousMountedRef.current = !!floating;\n });\n index(() => {\n if (!open) {\n keyRef.current = null;\n }\n }, [open]);\n const hasActiveIndex = activeIndex != null;\n const item = React.useMemo(() => {\n function syncCurrentTarget(currentTarget) {\n if (!open) return;\n const index = listRef.current.indexOf(currentTarget);\n if (index !== -1) {\n onNavigate(index);\n }\n }\n const props = {\n onFocus(_ref) {\n let {\n currentTarget\n } = _ref;\n syncCurrentTarget(currentTarget);\n },\n onClick: _ref2 => {\n let {\n currentTarget\n } = _ref2;\n return currentTarget.focus({\n preventScroll: true\n });\n },\n // Safari\n ...(focusItemOnHover && {\n onMouseMove(_ref3) {\n let {\n currentTarget\n } = _ref3;\n syncCurrentTarget(currentTarget);\n },\n onPointerLeave(_ref4) {\n let {\n pointerType\n } = _ref4;\n if (!isPointerModalityRef.current || pointerType === 'touch') {\n return;\n }\n indexRef.current = -1;\n focusItem(listRef, indexRef);\n onNavigate(null);\n if (!virtual) {\n enqueueFocus(refs.floating.current, {\n preventScroll: true\n });\n }\n }\n })\n };\n return props;\n }, [open, refs, focusItem, focusItemOnHover, listRef, onNavigate, virtual]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n const disabledIndices = disabledIndicesRef.current;\n function onKeyDown(event) {\n isPointerModalityRef.current = false;\n forceSyncFocus.current = true;\n\n // If the floating element is animating out, ignore navigation. Otherwise,\n // the `activeIndex` gets set to 0 despite not being open so the next time\n // the user ArrowDowns, the first item won't be focused.\n if (!latestOpenRef.current && event.currentTarget === refs.floating.current) {\n return;\n }\n if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl)) {\n stopEvent(event);\n onOpenChange(false, event.nativeEvent);\n if (isHTMLElement(domReference) && !virtual) {\n domReference.focus();\n }\n return;\n }\n const currentIndex = indexRef.current;\n const minIndex = getMinIndex(listRef, disabledIndices);\n const maxIndex = getMaxIndex(listRef, disabledIndices);\n if (event.key === 'Home') {\n stopEvent(event);\n indexRef.current = minIndex;\n onNavigate(indexRef.current);\n }\n if (event.key === 'End') {\n stopEvent(event);\n indexRef.current = maxIndex;\n onNavigate(indexRef.current);\n }\n\n // Grid navigation.\n if (cols > 1) {\n indexRef.current = getGridNavigatedIndex(listRef, {\n event,\n orientation,\n loop,\n cols,\n disabledIndices,\n minIndex,\n maxIndex,\n prevIndex: indexRef.current,\n stopEvent: true\n });\n onNavigate(indexRef.current);\n if (orientation === 'both') {\n return;\n }\n }\n if (isMainOrientationKey(event.key, orientation)) {\n stopEvent(event);\n\n // Reset the index if no item is focused.\n if (open && !virtual && activeElement(event.currentTarget.ownerDocument) === event.currentTarget) {\n indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;\n onNavigate(indexRef.current);\n return;\n }\n if (isMainOrientationToEndKey(event.key, orientation, rtl)) {\n if (loop) {\n indexRef.current = currentIndex >= maxIndex ? allowEscape && currentIndex !== listRef.current.length ? -1 : minIndex : findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n disabledIndices\n });\n } else {\n indexRef.current = Math.min(maxIndex, findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n disabledIndices\n }));\n }\n } else {\n if (loop) {\n indexRef.current = currentIndex <= minIndex ? allowEscape && currentIndex !== -1 ? listRef.current.length : maxIndex : findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n });\n } else {\n indexRef.current = Math.max(minIndex, findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n }));\n }\n }\n if (isIndexOutOfBounds(listRef, indexRef.current)) {\n onNavigate(null);\n } else {\n onNavigate(indexRef.current);\n }\n }\n }\n function checkVirtualMouse(event) {\n if (focusItemOnOpen === 'auto' && isVirtualClick(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n function checkVirtualPointer(event) {\n // `pointerdown` fires first, reset the state then perform the checks.\n focusItemOnOpenRef.current = focusItemOnOpen;\n if (focusItemOnOpen === 'auto' && isVirtualPointerEvent(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n const ariaActiveDescendantProp = virtual && open && hasActiveIndex && {\n 'aria-activedescendant': virtualId || activeId\n };\n const activeItem = listRef.current.find(item => (item == null ? void 0 : item.id) === activeId);\n return {\n reference: {\n ...ariaActiveDescendantProp,\n onKeyDown(event) {\n isPointerModalityRef.current = false;\n const isArrowKey = event.key.indexOf('Arrow') === 0;\n const isCrossOpenKey = isCrossOrientationOpenKey(event.key, orientation, rtl);\n const isCrossCloseKey = isCrossOrientationCloseKey(event.key, orientation, rtl);\n const isMainKey = isMainOrientationKey(event.key, orientation);\n const isNavigationKey = (nested ? isCrossOpenKey : isMainKey) || event.key === 'Enter' || event.key.trim() === '';\n if (virtual && open) {\n const rootNode = tree == null ? void 0 : tree.nodesRef.current.find(node => node.parentId == null);\n const deepestNode = tree && rootNode ? getDeepestNode(tree.nodesRef.current, rootNode.id) : null;\n if (isArrowKey && deepestNode && virtualItemRef) {\n const eventObject = new KeyboardEvent('keydown', {\n key: event.key,\n bubbles: true\n });\n if (isCrossOpenKey || isCrossCloseKey) {\n var _deepestNode$context, _deepestNode$context2;\n const isCurrentTarget = ((_deepestNode$context = deepestNode.context) == null ? void 0 : _deepestNode$context.elements.domReference) === event.currentTarget;\n const dispatchItem = isCrossCloseKey && !isCurrentTarget ? (_deepestNode$context2 = deepestNode.context) == null ? void 0 : _deepestNode$context2.elements.domReference : isCrossOpenKey ? activeItem : null;\n if (dispatchItem) {\n stopEvent(event);\n dispatchItem.dispatchEvent(eventObject);\n setVirtualId(undefined);\n }\n }\n if (isMainKey && deepestNode.context) {\n if (deepestNode.context.open && deepestNode.parentId && event.currentTarget !== deepestNode.context.elements.domReference) {\n var _deepestNode$context$;\n stopEvent(event);\n (_deepestNode$context$ = deepestNode.context.elements.domReference) == null ? void 0 : _deepestNode$context$.dispatchEvent(eventObject);\n return;\n }\n }\n }\n return onKeyDown(event);\n }\n\n // If a floating element should not open on arrow key down, avoid\n // setting `activeIndex` while it's closed.\n if (!open && !openOnArrowKeyDown && isArrowKey) {\n return;\n }\n if (isNavigationKey) {\n keyRef.current = nested && isMainKey ? null : event.key;\n }\n if (nested) {\n if (isCrossOpenKey) {\n stopEvent(event);\n if (open) {\n indexRef.current = getMinIndex(listRef, disabledIndices);\n onNavigate(indexRef.current);\n } else {\n onOpenChange(true, event.nativeEvent);\n }\n }\n return;\n }\n if (isMainKey) {\n if (selectedIndex != null) {\n indexRef.current = selectedIndex;\n }\n stopEvent(event);\n if (!open && openOnArrowKeyDown) {\n onOpenChange(true, event.nativeEvent);\n } else {\n onKeyDown(event);\n }\n if (open) {\n onNavigate(indexRef.current);\n }\n }\n },\n onFocus() {\n if (open) {\n onNavigate(null);\n }\n },\n onPointerDown: checkVirtualPointer,\n onMouseDown: checkVirtualMouse,\n onClick: checkVirtualMouse\n },\n floating: {\n 'aria-orientation': orientation === 'both' ? undefined : orientation,\n ...ariaActiveDescendantProp,\n onKeyDown,\n onPointerMove() {\n isPointerModalityRef.current = true;\n }\n },\n item\n };\n }, [domReference, refs, activeId, virtualId, disabledIndicesRef, latestOpenRef, listRef, enabled, orientation, rtl, virtual, open, hasActiveIndex, nested, selectedIndex, openOnArrowKeyDown, allowEscape, cols, loop, focusItemOnOpen, onNavigate, onOpenChange, item, tree, virtualItemRef]);\n}\n\n/**\n * Adds base screen reader props to the reference and floating elements for a\n * given floating element `role`.\n * @see https://floating-ui.com/docs/useRole\n */\nfunction useRole(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n floatingId\n } = context;\n const {\n enabled = true,\n role = 'dialog'\n } = props;\n const referenceId = useId();\n return React.useMemo(() => {\n const floatingProps = {\n id: floatingId,\n role\n };\n if (!enabled) {\n return {};\n }\n if (role === 'tooltip') {\n return {\n reference: {\n 'aria-describedby': open ? floatingId : undefined\n },\n floating: floatingProps\n };\n }\n return {\n reference: {\n 'aria-expanded': open ? 'true' : 'false',\n 'aria-haspopup': role === 'alertdialog' ? 'dialog' : role,\n 'aria-controls': open ? floatingId : undefined,\n ...(role === 'listbox' && {\n role: 'combobox'\n }),\n ...(role === 'menu' && {\n id: referenceId\n })\n },\n floating: {\n ...floatingProps,\n ...(role === 'menu' && {\n 'aria-labelledby': referenceId\n })\n }\n };\n }, [enabled, role, open, floatingId, referenceId]);\n}\n\n// Converts a JS style key like `backgroundColor` to a CSS transition-property\n// like `background-color`.\nconst camelCaseToKebabCase = str => str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? '-' : '') + $.toLowerCase());\nfunction execWithArgsOrReturn(valueOrFn, args) {\n return typeof valueOrFn === 'function' ? valueOrFn(args) : valueOrFn;\n}\nfunction useDelayUnmount(open, durationMs) {\n const [isMounted, setIsMounted] = React.useState(open);\n if (open && !isMounted) {\n setIsMounted(true);\n }\n React.useEffect(() => {\n if (!open) {\n const timeout = setTimeout(() => setIsMounted(false), durationMs);\n return () => clearTimeout(timeout);\n }\n }, [open, durationMs]);\n return isMounted;\n}\n/**\n * Provides a status string to apply CSS transitions to a floating element,\n * correctly handling placement-aware transitions.\n * @see https://floating-ui.com/docs/useTransition#usetransitionstatus\n */\nfunction useTransitionStatus(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n elements: {\n floating\n }\n } = context;\n const {\n duration = 250\n } = props;\n const isNumberDuration = typeof duration === 'number';\n const closeDuration = (isNumberDuration ? duration : duration.close) || 0;\n const [initiated, setInitiated] = React.useState(false);\n const [status, setStatus] = React.useState('unmounted');\n const isMounted = useDelayUnmount(open, closeDuration);\n\n // `initiated` check prevents this `setState` call from breaking\n //
. This call is necessary to ensure subsequent opens\n // after the initial one allows the correct side animation to play when the\n // placement has changed.\n index(() => {\n if (initiated && !isMounted) {\n setStatus('unmounted');\n }\n }, [initiated, isMounted]);\n index(() => {\n if (!floating) return;\n if (open) {\n setStatus('initial');\n const frame = requestAnimationFrame(() => {\n setStatus('open');\n });\n return () => {\n cancelAnimationFrame(frame);\n };\n } else {\n setInitiated(true);\n setStatus('close');\n }\n }, [open, floating]);\n return {\n isMounted,\n status\n };\n}\n/**\n * Provides styles to apply CSS transitions to a floating element, correctly\n * handling placement-aware transitions. Wrapper around `useTransitionStatus`.\n * @see https://floating-ui.com/docs/useTransition#usetransitionstyles\n */\nfunction useTransitionStyles(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n initial: unstable_initial = {\n opacity: 0\n },\n open: unstable_open,\n close: unstable_close,\n common: unstable_common,\n duration = 250\n } = props;\n const placement = context.placement;\n const side = placement.split('-')[0];\n const fnArgs = React.useMemo(() => ({\n side,\n placement\n }), [side, placement]);\n const isNumberDuration = typeof duration === 'number';\n const openDuration = (isNumberDuration ? duration : duration.open) || 0;\n const closeDuration = (isNumberDuration ? duration : duration.close) || 0;\n const [styles, setStyles] = React.useState(() => ({\n ...execWithArgsOrReturn(unstable_common, fnArgs),\n ...execWithArgsOrReturn(unstable_initial, fnArgs)\n }));\n const {\n isMounted,\n status\n } = useTransitionStatus(context, {\n duration\n });\n const initialRef = useLatestRef(unstable_initial);\n const openRef = useLatestRef(unstable_open);\n const closeRef = useLatestRef(unstable_close);\n const commonRef = useLatestRef(unstable_common);\n index(() => {\n const initialStyles = execWithArgsOrReturn(initialRef.current, fnArgs);\n const closeStyles = execWithArgsOrReturn(closeRef.current, fnArgs);\n const commonStyles = execWithArgsOrReturn(commonRef.current, fnArgs);\n const openStyles = execWithArgsOrReturn(openRef.current, fnArgs) || Object.keys(initialStyles).reduce((acc, key) => {\n acc[key] = '';\n return acc;\n }, {});\n if (status === 'initial') {\n setStyles(styles => ({\n transitionProperty: styles.transitionProperty,\n ...commonStyles,\n ...initialStyles\n }));\n }\n if (status === 'open') {\n setStyles({\n transitionProperty: Object.keys(openStyles).map(camelCaseToKebabCase).join(','),\n transitionDuration: openDuration + \"ms\",\n ...commonStyles,\n ...openStyles\n });\n }\n if (status === 'close') {\n const styles = closeStyles || initialStyles;\n setStyles({\n transitionProperty: Object.keys(styles).map(camelCaseToKebabCase).join(','),\n transitionDuration: closeDuration + \"ms\",\n ...commonStyles,\n ...styles\n });\n }\n }, [closeDuration, closeRef, initialRef, openRef, commonRef, openDuration, status, fnArgs]);\n return {\n isMounted,\n styles\n };\n}\n\n/**\n * Provides a matching callback that can be used to focus an item as the user\n * types, often used in tandem with `useListNavigation()`.\n * @see https://floating-ui.com/docs/useTypeahead\n */\nfunction useTypeahead(context, props) {\n var _ref;\n const {\n open,\n dataRef\n } = context;\n const {\n listRef,\n activeIndex,\n onMatch: unstable_onMatch,\n onTypingChange: unstable_onTypingChange,\n enabled = true,\n findMatch = null,\n resetMs = 750,\n ignoreKeys = [],\n selectedIndex = null\n } = props;\n const timeoutIdRef = React.useRef();\n const stringRef = React.useRef('');\n const prevIndexRef = React.useRef((_ref = selectedIndex != null ? selectedIndex : activeIndex) != null ? _ref : -1);\n const matchIndexRef = React.useRef(null);\n const onMatch = useEffectEvent(unstable_onMatch);\n const onTypingChange = useEffectEvent(unstable_onTypingChange);\n const findMatchRef = useLatestRef(findMatch);\n const ignoreKeysRef = useLatestRef(ignoreKeys);\n index(() => {\n if (open) {\n clearTimeout(timeoutIdRef.current);\n matchIndexRef.current = null;\n stringRef.current = '';\n }\n }, [open]);\n index(() => {\n // Sync arrow key navigation but not typeahead navigation.\n if (open && stringRef.current === '') {\n var _ref2;\n prevIndexRef.current = (_ref2 = selectedIndex != null ? selectedIndex : activeIndex) != null ? _ref2 : -1;\n }\n }, [open, selectedIndex, activeIndex]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n function setTypingChange(value) {\n if (value) {\n if (!dataRef.current.typing) {\n dataRef.current.typing = value;\n onTypingChange(value);\n }\n } else {\n if (dataRef.current.typing) {\n dataRef.current.typing = value;\n onTypingChange(value);\n }\n }\n }\n function getMatchingIndex(list, orderedList, string) {\n const str = findMatchRef.current ? findMatchRef.current(orderedList, string) : orderedList.find(text => (text == null ? void 0 : text.toLocaleLowerCase().indexOf(string.toLocaleLowerCase())) === 0);\n return str ? list.indexOf(str) : -1;\n }\n function onKeyDown(event) {\n const listContent = listRef.current;\n if (stringRef.current.length > 0 && stringRef.current[0] !== ' ') {\n if (getMatchingIndex(listContent, listContent, stringRef.current) === -1) {\n setTypingChange(false);\n } else if (event.key === ' ') {\n stopEvent(event);\n }\n }\n if (listContent == null || ignoreKeysRef.current.includes(event.key) ||\n // Character key.\n event.key.length !== 1 ||\n // Modifier key.\n event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n if (open && event.key !== ' ') {\n stopEvent(event);\n setTypingChange(true);\n }\n\n // Bail out if the list contains a word like \"llama\" or \"aaron\". TODO:\n // allow it in this case, too.\n const allowRapidSuccessionOfFirstLetter = listContent.every(text => {\n var _text$, _text$2;\n return text ? ((_text$ = text[0]) == null ? void 0 : _text$.toLocaleLowerCase()) !== ((_text$2 = text[1]) == null ? void 0 : _text$2.toLocaleLowerCase()) : true;\n });\n\n // Allows the user to cycle through items that start with the same letter\n // in rapid succession.\n if (allowRapidSuccessionOfFirstLetter && stringRef.current === event.key) {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n }\n stringRef.current += event.key;\n clearTimeout(timeoutIdRef.current);\n timeoutIdRef.current = setTimeout(() => {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n setTypingChange(false);\n }, resetMs);\n const prevIndex = prevIndexRef.current;\n const index = getMatchingIndex(listContent, [...listContent.slice((prevIndex || 0) + 1), ...listContent.slice(0, (prevIndex || 0) + 1)], stringRef.current);\n if (index !== -1) {\n onMatch(index);\n matchIndexRef.current = index;\n } else if (event.key !== ' ') {\n stringRef.current = '';\n setTypingChange(false);\n }\n }\n return {\n reference: {\n onKeyDown\n },\n floating: {\n onKeyDown,\n onKeyUp(event) {\n if (event.key === ' ') {\n setTypingChange(false);\n }\n }\n }\n };\n }, [enabled, open, dataRef, listRef, resetMs, ignoreKeysRef, findMatchRef, onMatch, onTypingChange]);\n}\n\nfunction getArgsWithCustomFloatingHeight(state, height) {\n return {\n ...state,\n rects: {\n ...state.rects,\n floating: {\n ...state.rects.floating,\n height\n }\n }\n };\n}\n/**\n * Positions the floating element such that an inner element inside\n * of it is anchored to the reference element.\n * @see https://floating-ui.com/docs/inner\n */\nconst inner = props => ({\n name: 'inner',\n options: props,\n async fn(state) {\n const {\n listRef,\n overflowRef,\n onFallbackChange,\n offset: innerOffset = 0,\n index = 0,\n minItemsVisible = 4,\n referenceOverflowThreshold = 0,\n scrollRef,\n ...detectOverflowOptions\n } = props;\n const {\n rects,\n elements: {\n floating\n }\n } = state;\n const item = listRef.current[index];\n if (process.env.NODE_ENV !== \"production\") {\n if (!state.placement.startsWith('bottom')) {\n console.warn(['Floating UI: `placement` side must be \"bottom\" when using the', '`inner` middleware.'].join(' '));\n }\n }\n if (!item) {\n return {};\n }\n const nextArgs = {\n ...state,\n ...(await offset(-item.offsetTop - floating.clientTop - rects.reference.height / 2 - item.offsetHeight / 2 - innerOffset).fn(state))\n };\n const el = (scrollRef == null ? void 0 : scrollRef.current) || floating;\n const overflow = await detectOverflow(getArgsWithCustomFloatingHeight(nextArgs, el.scrollHeight), detectOverflowOptions);\n const refOverflow = await detectOverflow(nextArgs, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const diffY = Math.max(0, overflow.top);\n const nextY = nextArgs.y + diffY;\n const maxHeight = Math.max(0, el.scrollHeight - diffY - Math.max(0, overflow.bottom));\n el.style.maxHeight = maxHeight + \"px\";\n el.scrollTop = diffY;\n\n // There is not enough space, fallback to standard anchored positioning\n if (onFallbackChange) {\n if (el.offsetHeight < item.offsetHeight * Math.min(minItemsVisible, listRef.current.length - 1) - 1 || refOverflow.top >= -referenceOverflowThreshold || refOverflow.bottom >= -referenceOverflowThreshold) {\n flushSync(() => onFallbackChange(true));\n } else {\n flushSync(() => onFallbackChange(false));\n }\n }\n if (overflowRef) {\n overflowRef.current = await detectOverflow(getArgsWithCustomFloatingHeight({\n ...nextArgs,\n y: nextY\n }, el.offsetHeight), detectOverflowOptions);\n }\n return {\n y: nextY\n };\n }\n});\n/**\n * Changes the `inner` middleware's `offset` upon a `wheel` event to\n * expand the floating element's height, revealing more list items.\n * @see https://floating-ui.com/docs/inner\n */\nfunction useInnerOffset(context, props) {\n const {\n open,\n elements\n } = context;\n const {\n enabled = true,\n overflowRef,\n scrollRef,\n onChange: unstable_onChange\n } = props;\n const onChange = useEffectEvent(unstable_onChange);\n const controlledScrollingRef = React.useRef(false);\n const prevScrollTopRef = React.useRef(null);\n const initialOverflowRef = React.useRef(null);\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n function onWheel(e) {\n if (e.ctrlKey || !el || overflowRef.current == null) {\n return;\n }\n const dY = e.deltaY;\n const isAtTop = overflowRef.current.top >= -0.5;\n const isAtBottom = overflowRef.current.bottom >= -0.5;\n const remainingScroll = el.scrollHeight - el.clientHeight;\n const sign = dY < 0 ? -1 : 1;\n const method = dY < 0 ? 'max' : 'min';\n if (el.scrollHeight <= el.clientHeight) {\n return;\n }\n if (!isAtTop && dY > 0 || !isAtBottom && dY < 0) {\n e.preventDefault();\n flushSync(() => {\n onChange(d => d + Math[method](dY, remainingScroll * sign));\n });\n } else if (/firefox/i.test(getUserAgent())) {\n // Needed to propagate scrolling during momentum scrolling phase once\n // it gets limited by the boundary. UX improvement, not critical.\n el.scrollTop += dY;\n }\n }\n const el = (scrollRef == null ? void 0 : scrollRef.current) || elements.floating;\n if (open && el) {\n el.addEventListener('wheel', onWheel);\n\n // Wait for the position to be ready.\n requestAnimationFrame(() => {\n prevScrollTopRef.current = el.scrollTop;\n if (overflowRef.current != null) {\n initialOverflowRef.current = {\n ...overflowRef.current\n };\n }\n });\n return () => {\n prevScrollTopRef.current = null;\n initialOverflowRef.current = null;\n el.removeEventListener('wheel', onWheel);\n };\n }\n }, [enabled, open, elements.floating, overflowRef, scrollRef, onChange]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n return {\n floating: {\n onKeyDown() {\n controlledScrollingRef.current = true;\n },\n onWheel() {\n controlledScrollingRef.current = false;\n },\n onPointerMove() {\n controlledScrollingRef.current = false;\n },\n onScroll() {\n const el = (scrollRef == null ? void 0 : scrollRef.current) || elements.floating;\n if (!overflowRef.current || !el || !controlledScrollingRef.current) {\n return;\n }\n if (prevScrollTopRef.current !== null) {\n const scrollDiff = el.scrollTop - prevScrollTopRef.current;\n if (overflowRef.current.bottom < -0.5 && scrollDiff < -1 || overflowRef.current.top < -0.5 && scrollDiff > 1) {\n flushSync(() => onChange(d => d + scrollDiff));\n }\n }\n\n // [Firefox] Wait for the height change to have been applied.\n requestAnimationFrame(() => {\n prevScrollTopRef.current = el.scrollTop;\n });\n }\n }\n };\n }, [enabled, overflowRef, elements.floating, scrollRef, onChange]);\n}\n\nfunction isPointInPolygon(point, polygon) {\n const [x, y] = point;\n let isInside = false;\n const length = polygon.length;\n for (let i = 0, j = length - 1; i < length; j = i++) {\n const [xi, yi] = polygon[i] || [0, 0];\n const [xj, yj] = polygon[j] || [0, 0];\n const intersect = yi >= y !== yj >= y && x <= (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) {\n isInside = !isInside;\n }\n }\n return isInside;\n}\nfunction isInside(point, rect) {\n return point[0] >= rect.x && point[0] <= rect.x + rect.width && point[1] >= rect.y && point[1] <= rect.y + rect.height;\n}\n/**\n * Generates a safe polygon area that the user can traverse without closing the\n * floating element once leaving the reference element.\n * @see https://floating-ui.com/docs/useHover#safePolygon\n */\nfunction safePolygon(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n buffer = 0.5,\n blockPointerEvents = false,\n requireIntent = true\n } = options;\n let timeoutId;\n let hasLanded = false;\n let lastX = null;\n let lastY = null;\n let lastCursorTime = performance.now();\n function getCursorSpeed(x, y) {\n const currentTime = performance.now();\n const elapsedTime = currentTime - lastCursorTime;\n if (lastX === null || lastY === null || elapsedTime === 0) {\n lastX = x;\n lastY = y;\n lastCursorTime = currentTime;\n return null;\n }\n const deltaX = x - lastX;\n const deltaY = y - lastY;\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n const speed = distance / elapsedTime; // px / ms\n\n lastX = x;\n lastY = y;\n lastCursorTime = currentTime;\n return speed;\n }\n const fn = _ref => {\n let {\n x,\n y,\n placement,\n elements,\n onClose,\n nodeId,\n tree\n } = _ref;\n return function onMouseMove(event) {\n function close() {\n clearTimeout(timeoutId);\n onClose();\n }\n clearTimeout(timeoutId);\n if (!elements.domReference || !elements.floating || placement == null || x == null || y == null) {\n return;\n }\n const {\n clientX,\n clientY\n } = event;\n const clientPoint = [clientX, clientY];\n const target = getTarget(event);\n const isLeave = event.type === 'mouseleave';\n const isOverFloatingEl = contains(elements.floating, target);\n const isOverReferenceEl = contains(elements.domReference, target);\n const refRect = elements.domReference.getBoundingClientRect();\n const rect = elements.floating.getBoundingClientRect();\n const side = placement.split('-')[0];\n const cursorLeaveFromRight = x > rect.right - rect.width / 2;\n const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2;\n const isOverReferenceRect = isInside(clientPoint, refRect);\n const isFloatingWider = rect.width > refRect.width;\n const isFloatingTaller = rect.height > refRect.height;\n const left = (isFloatingWider ? refRect : rect).left;\n const right = (isFloatingWider ? refRect : rect).right;\n const top = (isFloatingTaller ? refRect : rect).top;\n const bottom = (isFloatingTaller ? refRect : rect).bottom;\n if (isOverFloatingEl) {\n hasLanded = true;\n if (!isLeave) {\n return;\n }\n }\n if (isOverReferenceEl) {\n hasLanded = false;\n }\n if (isOverReferenceEl && !isLeave) {\n hasLanded = true;\n return;\n }\n\n // Prevent overlapping floating element from being stuck in an open-close\n // loop: https://github.com/floating-ui/floating-ui/issues/1910\n if (isLeave && isElement(event.relatedTarget) && contains(elements.floating, event.relatedTarget)) {\n return;\n }\n\n // If any nested child is open, abort.\n if (tree && getChildren(tree.nodesRef.current, nodeId).some(_ref2 => {\n let {\n context\n } = _ref2;\n return context == null ? void 0 : context.open;\n })) {\n return;\n }\n\n // If the pointer is leaving from the opposite side, the \"buffer\" logic\n // creates a point where the floating element remains open, but should be\n // ignored.\n // A constant of 1 handles floating point rounding errors.\n if (side === 'top' && y >= refRect.bottom - 1 || side === 'bottom' && y <= refRect.top + 1 || side === 'left' && x >= refRect.right - 1 || side === 'right' && x <= refRect.left + 1) {\n return close();\n }\n\n // Ignore when the cursor is within the rectangular trough between the\n // two elements. Since the triangle is created from the cursor point,\n // which can start beyond the ref element's edge, traversing back and\n // forth from the ref to the floating element can cause it to close. This\n // ensures it always remains open in that case.\n let rectPoly = [];\n switch (side) {\n case 'top':\n rectPoly = [[left, refRect.top + 1], [left, rect.bottom - 1], [right, rect.bottom - 1], [right, refRect.top + 1]];\n break;\n case 'bottom':\n rectPoly = [[left, rect.top + 1], [left, refRect.bottom - 1], [right, refRect.bottom - 1], [right, rect.top + 1]];\n break;\n case 'left':\n rectPoly = [[rect.right - 1, bottom], [rect.right - 1, top], [refRect.left + 1, top], [refRect.left + 1, bottom]];\n break;\n case 'right':\n rectPoly = [[refRect.right - 1, bottom], [refRect.right - 1, top], [rect.left + 1, top], [rect.left + 1, bottom]];\n break;\n }\n function getPolygon(_ref3) {\n let [x, y] = _ref3;\n switch (side) {\n case 'top':\n {\n const cursorPointOne = [isFloatingWider ? x + buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y + buffer + 1];\n const cursorPointTwo = [isFloatingWider ? x - buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y + buffer + 1];\n const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.bottom - buffer : isFloatingWider ? rect.bottom - buffer : rect.top], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.bottom - buffer : rect.top : rect.bottom - buffer]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n case 'bottom':\n {\n const cursorPointOne = [isFloatingWider ? x + buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y - buffer];\n const cursorPointTwo = [isFloatingWider ? x - buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y - buffer];\n const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.top + buffer : isFloatingWider ? rect.top + buffer : rect.bottom], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.top + buffer : rect.bottom : rect.top + buffer]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n case 'left':\n {\n const cursorPointOne = [x + buffer + 1, isFloatingTaller ? y + buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const cursorPointTwo = [x + buffer + 1, isFloatingTaller ? y - buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const commonPoints = [[cursorLeaveFromBottom ? rect.right - buffer : isFloatingTaller ? rect.right - buffer : rect.left, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.right - buffer : rect.left : rect.right - buffer, rect.bottom]];\n return [...commonPoints, cursorPointOne, cursorPointTwo];\n }\n case 'right':\n {\n const cursorPointOne = [x - buffer, isFloatingTaller ? y + buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const cursorPointTwo = [x - buffer, isFloatingTaller ? y - buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const commonPoints = [[cursorLeaveFromBottom ? rect.left + buffer : isFloatingTaller ? rect.left + buffer : rect.right, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.left + buffer : rect.right : rect.left + buffer, rect.bottom]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n }\n }\n if (isPointInPolygon([clientX, clientY], rectPoly)) {\n return;\n } else if (hasLanded && !isOverReferenceRect) {\n return close();\n }\n if (!isLeave && requireIntent) {\n const cursorSpeed = getCursorSpeed(event.clientX, event.clientY);\n const cursorSpeedThreshold = 0.1;\n if (cursorSpeed !== null && cursorSpeed < cursorSpeedThreshold) {\n return close();\n }\n }\n if (!isPointInPolygon([clientX, clientY], getPolygon([x, y]))) {\n close();\n } else if (!hasLanded && requireIntent) {\n timeoutId = window.setTimeout(close, 40);\n }\n };\n };\n fn.__options = {\n blockPointerEvents\n };\n return fn;\n}\n\nexport { Composite, CompositeItem, FloatingArrow, FloatingDelayGroup, FloatingFocusManager, FloatingList, FloatingNode, FloatingOverlay, FloatingPortal, FloatingTree, inner, safePolygon, useClick, useClientPoint, useDelayGroup, useDelayGroupContext, useDismiss, useFloating, useFloatingNodeId, useFloatingParentNodeId, useFloatingPortalNode, useFloatingTree, useFocus, useHover, useId, useInnerOffset, useInteractions, useListItem, useListNavigation, useMergeRefs, useRole, useTransitionStatus, useTransitionStyles, useTypeahead };\n","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport React, { createContext, useContext } from \"react\";\nexport const ProviderContext = createContext(undefined);\nexport const useProvider = () => useContext(ProviderContext);\n/**\n * Provides added context to the component tree.\n *\n * @see [📝 Documentation](https://aksel.nav.no/komponenter/core/provider)\n * @see 🏷️ {@link ProviderProps}\n *\n * @example\n * ```jsx\n *
\n * {app}\n * \n * ```\n */\nexport const Provider = (_a) => {\n var { children } = _a, rest = __rest(_a, [\"children\"]);\n return (React.createElement(ProviderContext.Provider, { value: rest }, children));\n};\nexport default Provider;\n//# sourceMappingURL=Provider.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport cl from \"clsx\";\nimport React, { forwardRef } from \"react\";\nconst ModalBody = forwardRef((_a, ref) => {\n var { className } = _a, rest = __rest(_a, [\"className\"]);\n return (React.createElement(\"div\", Object.assign({}, rest, { ref: ref, className: cl(\"navds-modal__body\", className) })));\n});\nexport default ModalBody;\n//# sourceMappingURL=ModalBody.js.map","import React from \"react\";\nexport const ModalContext = React.createContext(null);\n//# sourceMappingURL=ModalContext.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport cl from \"clsx\";\nimport React, { forwardRef } from \"react\";\nconst ModalFooter = forwardRef((_a, ref) => {\n var { className } = _a, rest = __rest(_a, [\"className\"]);\n return (React.createElement(\"div\", Object.assign({}, rest, { ref: ref, className: cl(\"navds-modal__footer\", className) })));\n});\nexport default ModalFooter;\n//# sourceMappingURL=ModalFooter.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport cl from \"clsx\";\nimport React, { forwardRef, useContext } from \"react\";\nimport { XMarkIcon } from \"@navikt/aksel-icons\";\nimport { Button } from \"../button\";\nimport { ModalContext } from \"./ModalContext\";\nconst ModalHeader = forwardRef((_a, ref) => {\n var { children, className, closeButton = true } = _a, rest = __rest(_a, [\"children\", \"className\", \"closeButton\"]);\n const context = useContext(ModalContext);\n if (context === null) {\n console.error(\"
has to be used within a \");\n return null;\n }\n return (React.createElement(\"div\", Object.assign({}, rest, { ref: ref, className: cl(\"navds-modal__header\", className) }),\n context.closeHandler && closeButton && (React.createElement(Button, { type: \"button\", className: \"navds-modal__button\", size: \"small\", variant: \"tertiary-neutral\", onClick: context.closeHandler, icon: React.createElement(XMarkIcon, { title: \"Lukk modalvindu\" }) })),\n children));\n});\nexport default ModalHeader;\n//# sourceMappingURL=ModalHeader.js.map","import React from \"react\";\nexport function getCloseHandler(modalRef, header, onBeforeClose) {\n if (header && header.closeButton === false)\n return undefined;\n if (onBeforeClose) {\n return () => { var _a; return onBeforeClose() !== false && ((_a = modalRef.current) === null || _a === void 0 ? void 0 : _a.close()); };\n }\n return () => { var _a; return (_a = modalRef.current) === null || _a === void 0 ? void 0 : _a.close(); };\n}\nexport const BODY_CLASS = \"navds-modal__document-body\";\nexport function useBodyScrollLock(modalRef, portalNode) {\n React.useEffect(() => {\n if (!modalRef.current || !portalNode)\n return; // We check both to avoid running this twice when not using portal\n if (modalRef.current.open)\n document.body.classList.add(BODY_CLASS); // In case `open` is true initially\n const observer = new MutationObserver(() => {\n var _a;\n if ((_a = modalRef.current) === null || _a === void 0 ? void 0 : _a.open)\n document.body.classList.add(BODY_CLASS);\n else\n document.body.classList.remove(BODY_CLASS);\n });\n observer.observe(modalRef.current, {\n attributes: true,\n attributeFilter: [\"open\"],\n });\n return () => {\n observer.disconnect();\n document.body.classList.remove(BODY_CLASS); // In case modal is unmounted before it's closed\n };\n }, [modalRef, portalNode]);\n}\n//# sourceMappingURL=ModalUtils.js.map","/* eslint-disable no-var, object-shorthand */\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-nocheck\nexport const needPolyfill = typeof window !== \"undefined\" &&\n (window.HTMLDialogElement === undefined ||\n navigator.userAgent.includes(\"jsdom\"));\n// Copyright (c) 2013 The Chromium Authors. All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n// * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n/**\n * Dispatches the passed event to both an \"on\" handler as well as via the\n * normal dispatch operation. Does not bubble.\n *\n * @param {!EventTarget} target\n * @param {!Event} event\n * @return {boolean}\n */\nfunction safeDispatchEvent(target, event) {\n var check = \"on\" + event.type.toLowerCase();\n if (typeof target[check] === \"function\") {\n target[check](event);\n }\n return target.dispatchEvent(event);\n}\n/**\n * Finds the nearest \n * ```\n * @example\n * State change with `useState`\n * ```jsx\n * const [open, setOpen] = useState(false);\n * setOpen(false)}\n * aria-labelledby=\"modal-heading\"\n * >\n * \n * My heading\n * \n * \n * Hello world\n * \n * \n * ```\n */\nexport const Modal = forwardRef((_a, ref) => {\n var _b, _c;\n var { header, children, open, onBeforeClose, onCancel, closeOnBackdropClick, width, portal, className, \"aria-labelledby\": ariaLabelledby, style, onClick } = _a, rest = __rest(_a, [\"header\", \"children\", \"open\", \"onBeforeClose\", \"onCancel\", \"closeOnBackdropClick\", \"width\", \"portal\", \"className\", \"aria-labelledby\", \"style\", \"onClick\"]);\n const modalRef = useRef(null);\n const mergedRef = useMergeRefs(modalRef, ref);\n const ariaLabelId = useId();\n const rootElement = (_b = useProvider()) === null || _b === void 0 ? void 0 : _b.rootElement;\n const portalNode = useFloatingPortalNode({ root: rootElement });\n const dateContext = useContext(DateContext);\n const modalContext = useContext(ModalContext);\n if (modalContext && !dateContext) {\n console.error(\"Modals should not be nested\");\n }\n useEffect(() => {\n // If using portal, modalRef.current will not be set before portalNode is set.\n // If not using portal, modalRef.current is available first.\n // We check both to avoid activating polyfill twice when not using portal.\n if (needPolyfill && modalRef.current && portalNode) {\n dialogPolyfill.registerDialog(modalRef.current);\n }\n // We set autofocus on the dialog element to prevent the default behavior where first focusable element gets focus when modal is opened.\n // This is mainly to fix an edge case where having a Tooltip as the first focusable element would make it activate when you open the modal.\n // We have to use JS because it doesn't work to set it with a prop (React bug?)\n // Currently doesn't seem to work in Chrome. See also Tooltip.tsx\n if (modalRef.current && portalNode)\n modalRef.current.autofocus = true;\n }, [modalRef, portalNode]);\n useEffect(() => {\n // We need to have this in a useEffect so that the content renders before the modal is displayed,\n // and in case `open` is true initially.\n // We need to check both modalRef.current and portalNode to make sure the polyfill has been activated.\n if (modalRef.current && portalNode && open !== undefined) {\n if (open && !modalRef.current.open) {\n modalRef.current.showModal();\n }\n else if (!open && modalRef.current.open) {\n modalRef.current.close();\n }\n }\n }, [modalRef, portalNode, open]);\n useBodyScrollLock(modalRef, portalNode);\n const isWidthPreset = typeof width === \"string\" && [\"small\", \"medium\"].includes(width);\n const mergedClassName = cl(\"navds-modal\", className, {\n \"navds-modal--polyfilled\": needPolyfill,\n \"navds-modal--autowidth\": !width,\n [`navds-modal--${width}`]: isWidthPreset,\n });\n const mergedStyle = Object.assign(Object.assign({}, style), (!isWidthPreset ? { width } : {}));\n /**\n * @note `closeOnBackdropClick` has issues on polyfill when nesting modals (DatePicker)\n */\n const handleModalClick = (event) => {\n if (closeOnBackdropClick &&\n !needPolyfill &&\n event.target === modalRef.current &&\n (!onBeforeClose || onBeforeClose() !== false)) {\n modalRef.current.close();\n }\n };\n /**\n * @note onCancel fires when you press `Esc`\n */\n const handleModalCancel = (event) => {\n onBeforeClose && onBeforeClose() === false && event.preventDefault();\n };\n const mergedAriaLabelledBy = !ariaLabelledby && !rest[\"aria-label\"] && header\n ? ariaLabelId\n : ariaLabelledby;\n const component = (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions\n React.createElement(\"dialog\", Object.assign({}, rest, { ref: mergedRef, className: mergedClassName, style: mergedStyle, onCancel: composeEventHandlers(onCancel, handleModalCancel), onClick: composeEventHandlers(onClick, handleModalClick), \"aria-labelledby\": mergedAriaLabelledBy }),\n React.createElement(ModalContext.Provider, { value: {\n closeHandler: getCloseHandler(modalRef, header, onBeforeClose),\n ref: modalRef,\n } },\n header && (React.createElement(ModalHeader, null,\n header.label && (React.createElement(Detail, { className: \"navds-modal__label\" }, header.label)),\n React.createElement(Heading, { size: (_c = header.size) !== null && _c !== void 0 ? _c : \"medium\", level: \"1\", id: ariaLabelId },\n React.createElement(\"span\", { className: \"navds-modal__header-icon\" }, header.icon),\n header.heading))),\n children)));\n if (portal) {\n if (portalNode)\n return createPortal(component, portalNode);\n return null;\n }\n return component;\n});\nModal.Header = ModalHeader;\nModal.Body = ModalBody;\nModal.Footer = ModalFooter;\nexport default Modal;\n//# sourceMappingURL=Modal.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport cl from \"clsx\";\nimport React, { forwardRef } from \"react\";\nimport { ChevronDownIcon } from \"@navikt/aksel-icons\";\nimport { BodyShort, ErrorMessage, Label } from \"../typography\";\nimport { omit } from \"../util\";\nimport { ReadOnlyIcon } from \"./ReadOnlyIcon\";\nimport { useFormField } from \"./useFormField\";\n/**\n * A component that displays a select input field.\n *\n * @see [📝 Documentation](https://aksel.nav.no/komponenter/core/select)\n * @see 🏷️ {@link SelectProps}\n *\n * @example\n * ```jsx\n * \n * ```\n */\nexport const Select = forwardRef((props, ref) => {\n const { inputProps, errorId, showErrorMsg, hasError, size, inputDescriptionId, readOnly, } = useFormField(props, \"select\");\n const { children, label, className, description, htmlSize, hideLabel = false, style } = props, rest = __rest(props, [\"children\", \"label\", \"className\", \"description\", \"htmlSize\", \"hideLabel\", \"style\"]);\n const readOnlyEventHandlers = {\n onMouseDown: (evt) => {\n // NOTE: does not prevent click\n if (readOnly) {\n evt.preventDefault();\n // focus on the element as per readonly input behavior\n evt.target.focus();\n }\n },\n onKeyDown: (evt) => {\n if (readOnly &&\n [\"ArrowDown\", \"ArrowUp\", \"ArrowRight\", \"ArrowLeft\", \" \"].includes(evt.key)) {\n evt.preventDefault();\n }\n },\n };\n return (React.createElement(\"div\", { className: cl(className, \"navds-form-field\", `navds-form-field--${size}`, {\n \"navds-form-field--disabled\": !!inputProps.disabled,\n \"navds-form-field--readonly\": readOnly,\n \"navds-select--error\": hasError,\n \"navds-select--readonly\": readOnly,\n }) },\n React.createElement(Label, { htmlFor: inputProps.id, size: size, className: cl(\"navds-form-field__label\", {\n \"navds-sr-only\": hideLabel,\n }) },\n React.createElement(ReadOnlyIcon, { readOnly: readOnly, nativeReadOnly: false }),\n label),\n !!description && (React.createElement(BodyShort, { className: cl(\"navds-form-field__description\", {\n \"navds-sr-only\": hideLabel,\n }), id: inputDescriptionId, size: size, as: \"div\" }, description)),\n React.createElement(\"div\", { className: \"navds-select__container\", style: style },\n React.createElement(\"select\", Object.assign({}, omit(rest, [\"error\", \"errorId\", \"size\", \"readOnly\"]), inputProps, readOnlyEventHandlers, { ref: ref, className: cl(\"navds-select__input\", \"navds-body-short\", `navds-body-short--${size !== null && size !== void 0 ? size : \"medium\"}`), size: htmlSize }), children),\n React.createElement(ChevronDownIcon, { className: \"navds-select__chevron\", \"aria-hidden\": true })),\n React.createElement(\"div\", { className: \"navds-form-field__error\", id: errorId, \"aria-relevant\": \"additions removals\", \"aria-live\": \"polite\" }, showErrorMsg && (React.createElement(ErrorMessage, { size: size }, props.error)))));\n});\nexport default Select;\n//# sourceMappingURL=Select.js.map","import { useFormField } from \"../useFormField\";\n/**\n * Handles props for Fieldset in context with parent Fieldset.\n */\nexport const useFieldset = (props) => {\n const formField = useFormField(props, \"fieldset\");\n const { inputProps } = formField;\n return Object.assign(Object.assign({}, formField), { inputProps: {\n \"aria-invalid\": inputProps[\"aria-invalid\"],\n \"aria-describedby\": inputProps[\"aria-describedby\"],\n } });\n};\n//# sourceMappingURL=useFieldset.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport cl from \"clsx\";\nimport React, { forwardRef, useContext } from \"react\";\nimport { BodyShort, ErrorMessage, Label } from \"../../typography\";\nimport { omit } from \"../../util\";\nimport { ReadOnlyIcon } from \"../ReadOnlyIcon\";\nimport { FieldsetContext } from \"./context\";\nimport { useFieldset } from \"./useFieldset\";\nexport const Fieldset = forwardRef((props, ref) => {\n var _a, _b, _c;\n const { inputProps, errorId, showErrorMsg, hasError, size, readOnly, inputDescriptionId, } = useFieldset(props);\n const fieldset = useContext(FieldsetContext);\n const { children, className, errorPropagation = true, legend, description, hideLegend, nativeReadOnly = true } = props, rest = __rest(props, [\"children\", \"className\", \"errorPropagation\", \"legend\", \"description\", \"hideLegend\", \"nativeReadOnly\"]);\n return (React.createElement(FieldsetContext.Provider, { value: {\n error: errorPropagation ? (_a = props.error) !== null && _a !== void 0 ? _a : fieldset === null || fieldset === void 0 ? void 0 : fieldset.error : undefined,\n errorId: cl({\n [errorId]: showErrorMsg,\n [(_b = fieldset === null || fieldset === void 0 ? void 0 : fieldset.errorId) !== null && _b !== void 0 ? _b : \"\"]: !!(fieldset === null || fieldset === void 0 ? void 0 : fieldset.error),\n }),\n size,\n disabled: (_c = props.disabled) !== null && _c !== void 0 ? _c : false,\n readOnly,\n } },\n React.createElement(\"fieldset\", Object.assign({}, omit(rest, [\"errorId\", \"error\", \"size\", \"readOnly\"]), omit(inputProps, [\"aria-describedby\", \"aria-invalid\"]), { ref: ref, className: cl(className, \"navds-fieldset\", `navds-fieldset--${size}`, {\n \"navds-fieldset--error\": hasError,\n \"navds-fieldset--readonly\": readOnly,\n }) }),\n React.createElement(Label, { size: size, as: \"legend\", className: cl(\"navds-fieldset__legend\", {\n \"navds-sr-only\": !!hideLegend,\n }) },\n React.createElement(ReadOnlyIcon, { readOnly: readOnly, nativeReadOnly: nativeReadOnly }),\n legend),\n !!description && (React.createElement(BodyShort, { className: cl(\"navds-fieldset__description\", {\n \"navds-sr-only\": !!hideLegend,\n }), id: inputDescriptionId, size: size !== null && size !== void 0 ? size : \"medium\", as: \"div\" }, props.description)),\n children,\n React.createElement(\"div\", { id: errorId, \"aria-relevant\": \"additions removals\", \"aria-live\": \"polite\", className: \"navds-fieldset__error\" }, showErrorMsg && (React.createElement(ErrorMessage, { size: size }, props.error))))));\n});\nexport default Fieldset;\n//# sourceMappingURL=Fieldset.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport cl from \"clsx\";\nimport React, { createContext, forwardRef, useContext, useState } from \"react\";\nimport { Fieldset, FieldsetContext } from \"../Fieldset\";\nexport const CheckboxGroupContext = createContext(null);\n/**\n * A component that allows users to select one or more options from a list.\n *\n * @see [📝 Documentation](https://aksel.nav.no/komponenter/core/checkbox)\n * @see 🏷️ {@link CheckboxProps}\n *\n * @example\n * ```jsx\n * \n * Bakerst\n * Midterst\n * Fremst\n * \n * ```\n */\nexport const CheckboxGroup = forwardRef((_a, ref) => {\n var _b, _c;\n var { value, defaultValue, onChange = () => { }, children, className } = _a, rest = __rest(_a, [\"value\", \"defaultValue\", \"onChange\", \"children\", \"className\"]);\n const fieldset = useContext(FieldsetContext);\n const [state, setState] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : []);\n const toggleValue = (v) => {\n const newValue = value !== null && value !== void 0 ? value : state;\n const newState = newValue.includes(v)\n ? newValue.filter((x) => x !== v)\n : [...newValue, v];\n value === undefined && setState(newState);\n onChange(newState);\n };\n return (React.createElement(Fieldset, Object.assign({}, rest, { ref: ref, className: cl(className, \"navds-checkbox-group\", `navds-checkbox-group--${(_c = (_b = rest.size) !== null && _b !== void 0 ? _b : fieldset === null || fieldset === void 0 ? void 0 : fieldset.size) !== null && _c !== void 0 ? _c : \"medium\"}`), nativeReadOnly: false }),\n React.createElement(CheckboxGroupContext.Provider, { value: {\n value,\n defaultValue,\n toggleValue,\n } },\n React.createElement(\"div\", { className: \"navds-checkboxes\" }, children))));\n});\nexport default CheckboxGroup;\n//# sourceMappingURL=CheckboxGroup.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { useContext } from \"react\";\nimport { omit } from \"../../util\";\nimport { useFormField } from \"../useFormField\";\nimport { CheckboxGroupContext } from \"./CheckboxGroup\";\n/**\n * Handles props for Checkboxes in context with Fieldset and CheckboxGroup\n */\nconst useCheckbox = (props) => {\n const checkboxGroup = useContext(CheckboxGroupContext);\n const _a = useFormField(omit(props, [\"description\", \"children\"]), \"checkbox\"), { inputProps, readOnly } = _a, rest = __rest(_a, [\"inputProps\", \"readOnly\"]);\n if (checkboxGroup) {\n if (props.checked) {\n console.warn(\"`checked` is unsupported on elements within a . Please set a `value` or `defaultValue` on instead.\");\n }\n if (props.value === undefined) {\n console.warn(\"A element within a requires a `value` property.\");\n }\n }\n return Object.assign(Object.assign({}, rest), { readOnly, nested: !!checkboxGroup, inputProps: Object.assign(Object.assign({}, inputProps), { checked: (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.value)\n ? checkboxGroup.value.includes(props.value)\n : props.checked, defaultChecked: (checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.defaultValue)\n ? checkboxGroup.defaultValue.includes(props.value)\n : props.defaultChecked, onChange: (e) => {\n if (readOnly) {\n return;\n }\n props.onChange && props.onChange(e);\n checkboxGroup && checkboxGroup.toggleValue(props.value);\n }, onClick: (e) => {\n var _a;\n if (readOnly) {\n e.preventDefault();\n return;\n }\n (_a = props === null || props === void 0 ? void 0 : props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);\n } }) });\n};\nexport default useCheckbox;\n//# sourceMappingURL=useCheckbox.js.map","import cl from \"clsx\";\nimport React, { forwardRef } from \"react\";\nimport { BodyShort } from \"../../typography\";\nimport { omit } from \"../../util\";\nimport { useId } from \"../../util/hooks\";\nimport { ReadOnlyIcon } from \"../ReadOnlyIcon\";\nimport useCheckbox from \"./useCheckbox\";\nexport const Checkbox = forwardRef((props, ref) => {\n const { inputProps, hasError, size, readOnly, nested } = useCheckbox(props);\n const labelId = useId();\n const descriptionId = useId();\n return (React.createElement(\"div\", { className: cl(props.className, \"navds-checkbox\", `navds-checkbox--${size}`, {\n \"navds-checkbox--error\": hasError,\n \"navds-checkbox--disabled\": inputProps.disabled,\n \"navds-checkbox--readonly\": readOnly,\n }) },\n React.createElement(\"input\", Object.assign({}, omit(props, [\n \"children\",\n \"size\",\n \"error\",\n \"description\",\n \"hideLabel\",\n \"indeterminate\",\n \"errorId\",\n \"readOnly\",\n ]), omit(inputProps, [\"aria-invalid\"]), { type: \"checkbox\", className: \"navds-checkbox__input\", \"aria-checked\": props.indeterminate ? \"mixed\" : inputProps.checked, ref: (el) => {\n var _a;\n if (el) {\n el.indeterminate = (_a = props.indeterminate) !== null && _a !== void 0 ? _a : false;\n }\n if (typeof ref === \"function\") {\n ref(el);\n }\n else if (ref != null) {\n ref.current = el;\n }\n }, \"aria-labelledby\": cl(labelId, !!props[\"aria-labelledby\"] && props[\"aria-labelledby\"], {\n [descriptionId]: props.description,\n }) })),\n React.createElement(\"label\", { htmlFor: inputProps.id, className: \"navds-checkbox__label\" },\n React.createElement(\"span\", { className: \"navds-checkbox__icon\" },\n React.createElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\", width: \"0.8125rem\", height: \"0.625rem\", viewBox: \"0 0 13 10\", fill: \"none\", focusable: false, role: \"img\", \"aria-hidden\": true },\n React.createElement(\"path\", { d: \"M4.03524 6.41478L10.4752 0.404669C11.0792 -0.160351 12.029 -0.130672 12.5955 0.47478C13.162 1.08027 13.1296 2.03007 12.5245 2.59621L5.02111 9.59934C4.74099 9.85904 4.37559 10 4.00025 10C3.60651 10 3.22717 9.84621 2.93914 9.56111L0.439143 7.06111C-0.146381 6.47558 -0.146381 5.52542 0.439143 4.93989C1.02467 4.35437 1.97483 4.35437 2.56036 4.93989L4.03524 6.41478Z\", fill: \"currentColor\" }))),\n React.createElement(\"span\", { className: cl(\"navds-checkbox__content\", {\n \"navds-sr-only\": props.hideLabel,\n }) },\n React.createElement(BodyShort, { as: \"span\", id: labelId, size: size, className: \"navds-checkbox__label-text\", \"aria-hidden\": true },\n !nested && (React.createElement(ReadOnlyIcon, { readOnly: readOnly, nativeReadOnly: false })),\n props.children),\n props.description && (React.createElement(BodyShort, { as: \"span\", id: descriptionId, size: size, className: \"navds-form-field__subdescription navds-checkbox__description\", \"aria-hidden\": true }, props.description))))));\n});\nexport default Checkbox;\n//# sourceMappingURL=Checkbox.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport cl from \"clsx\";\nimport React, { forwardRef, useContext } from \"react\";\nimport { useId } from \"../../util/hooks\";\nimport { Fieldset, FieldsetContext } from \"../Fieldset\";\nexport const RadioGroupContext = React.createContext(null);\n/**\n * Form radio group\n * @see [📝 Documentation](https://aksel.nav.no/komponenter/core/radio)\n * @see 🏷️ {@link RadioGroupProps}\n * @example\n * \n * Ja\n * Nei\n * \n */\nexport const RadioGroup = forwardRef((_a, ref) => {\n var _b, _c;\n var { children, className, name, defaultValue, value, onChange = () => { }, required, readOnly } = _a, rest = __rest(_a, [\"children\", \"className\", \"name\", \"defaultValue\", \"value\", \"onChange\", \"required\", \"readOnly\"]);\n const fieldset = useContext(FieldsetContext);\n const nameId = useId();\n return (React.createElement(Fieldset, Object.assign({}, rest, { readOnly: readOnly, ref: ref, className: cl(className, \"navds-radio-group\", `navds-radio-group--${(_c = (_b = rest.size) !== null && _b !== void 0 ? _b : fieldset === null || fieldset === void 0 ? void 0 : fieldset.size) !== null && _c !== void 0 ? _c : \"medium\"}`), nativeReadOnly: false }),\n React.createElement(RadioGroupContext.Provider, { value: {\n name: name !== null && name !== void 0 ? name : `radioGroupName-${nameId}`,\n defaultValue,\n value,\n onChange,\n required,\n } },\n React.createElement(\"div\", { className: \"navds-radio-buttons\" }, children))));\n});\nexport default RadioGroup;\n//# sourceMappingURL=RadioGroup.js.map","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { useContext } from \"react\";\nimport { omit } from \"../../util\";\nimport { useFormField } from \"../useFormField\";\nimport { RadioGroupContext } from \"./RadioGroup\";\n/**\n * Handles props for Radios in context with Fieldset and RadioGroup\n */\nexport const useRadio = (props) => {\n const radioGroup = useContext(RadioGroupContext);\n const _a = useFormField(omit(props, [\"description\"]), \"radio\"), { inputProps, readOnly } = _a, rest = __rest(_a, [\"inputProps\", \"readOnly\"]);\n if (!radioGroup) {\n console.warn(\" must be used inside .\");\n }\n if ((props === null || props === void 0 ? void 0 : props.required) !== undefined) {\n console.warn(\"required is only supported on .\");\n }\n return Object.assign(Object.assign({}, rest), { readOnly, inputProps: Object.assign(Object.assign({}, inputProps), { name: radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.name, defaultChecked: (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.defaultValue) === undefined\n ? undefined\n : (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.defaultValue) === props.value, checked: (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.value) === undefined\n ? undefined\n : (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.value) === props.value, onChange: (e) => {\n if (readOnly) {\n return;\n }\n props.onChange && props.onChange(e);\n (radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.onChange) && radioGroup.onChange(props.value);\n }, onClick: (e) => {\n var _a;\n if (readOnly) {\n e.preventDefault();\n return;\n }\n (_a = props === null || props === void 0 ? void 0 : props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);\n }, required: radioGroup === null || radioGroup === void 0 ? void 0 : radioGroup.required, type: \"radio\" }) });\n};\n//# sourceMappingURL=useRadio.js.map","import cl from \"clsx\";\nimport React, { forwardRef } from \"react\";\nimport { BodyShort } from \"../../typography\";\nimport { omit } from \"../../util\";\nimport { useId } from \"../../util/hooks\";\nimport { useRadio } from \"./useRadio\";\nexport const Radio = forwardRef((props, ref) => {\n const { inputProps, size, hasError, readOnly } = useRadio(props);\n const labelId = useId();\n const descriptionId = useId();\n return (React.createElement(\"div\", { className: cl(props.className, \"navds-radio\", `navds-radio--${size}`, {\n \"navds-radio--error\": hasError,\n \"navds-radio--disabled\": inputProps.disabled,\n \"navds-radio--readonly\": readOnly,\n }) },\n React.createElement(\"input\", Object.assign({}, omit(props, [\"children\", \"size\", \"description\", \"readOnly\"]), omit(inputProps, [\"aria-invalid\"]), { \"aria-labelledby\": cl(labelId, !!props[\"aria-labelledby\"] && props[\"aria-labelledby\"], {\n [descriptionId]: props.description,\n }), className: \"navds-radio__input\", ref: ref })),\n React.createElement(\"label\", { htmlFor: inputProps.id, className: \"navds-radio__label\" },\n React.createElement(\"span\", { className: \"navds-radio__content\" },\n React.createElement(BodyShort, { as: \"span\", id: labelId, size: size, \"aria-hidden\": true }, props.children),\n props.description && (React.createElement(BodyShort, { as: \"span\", id: descriptionId, size: size, className: \"navds-form-field__subdescription navds-radio__description\", \"aria-hidden\": true }, props.description))))));\n});\nexport default Radio;\n//# sourceMappingURL=Radio.js.map"],"names":["r","t","f","n","clsx","typoClassNames","props","cl","__rest","s","e","p","i","BodyShort","forwardRef","_a","ref","className","size","Component","spacing","truncate","weight","align","visuallyHidden","textColor","rest","React","BodyShort$1","Detail","uppercase","Detail$1","ErrorMessage","ErrorMessage$1","Heading","level","as","HeadingTag","Heading$1","Label","Label$1","omit","obj","key","prevObj","value","useClientLayoutEffect","useLayoutEffect","globalId","useGlobalId","idOverride","defaultId","setDefaultId","useState","id","useEffect","maybeReactUseId","useId","reactId","SvgChevronDown","title","_titleId","titleId","React.createElement","ChevronDownIcon","SvgPadlockLockedFill","PadlockLockedFillIcon","SvgXMark","XMarkIcon","composeEventHandlers","originalEventHandler","ourEventHandler","checkForDefaultPrevented","event","mergeRefs","refs","useMergeRefs","Loader","transparent","variant","internalId","Loader$1","Button","children","loading","disabled","style","icon","iconPosition","buttonRef","useRef","widthOverride","setWidthOverride","mergedRef","requestID","_b","filterProps","handleKeyUp","Button$1","DateContext","createContext","useDateInputContext","context","useContext","ReadOnlyIcon","readOnly","nativeReadOnly","FieldsetContext","useFormField","prefix","_c","error","propErrorId","fieldset","genId","errorId","inputDescriptionId","hasError","showErrorMsg","ariaInvalid","min","max","round","floor","createCoords","v","oppositeSideMap","oppositeAlignmentMap","clamp","start","end","evaluate","param","getSide","placement","getAlignment","getOppositeAxis","axis","getAxisLength","getSideAxis","getAlignmentAxis","getAlignmentSides","rects","rtl","alignment","alignmentAxis","length","mainAlignmentSide","getOppositePlacement","getExpandedPlacements","oppositePlacement","getOppositeAlignmentPlacement","getSideList","side","isStart","lr","rl","tb","bt","getOppositeAxisPlacements","flipAlignment","direction","list","expandPaddingObject","padding","getPaddingObject","rectToClientRect","rect","getNodeName","node","isNode","getWindow","_node$ownerDocument","getDocumentElement","_ref","isElement","isHTMLElement","isShadowRoot","isOverflowElement","element","overflow","overflowX","overflowY","display","getComputedStyle","isTableElement","isContainingBlock","webkit","isWebKit","css","getContainingBlock","currentNode","getParentNode","isLastTraversableNode","getNodeScroll","result","getNearestOverflowAncestor","parentNode","getOverflowAncestors","traverseIframes","_node$ownerDocument2","scrollableAncestor","isBody","win","contains","parent","child","rootNode","next","getPlatform","uaData","getUserAgent","brand","version","isVirtualClick","androidRe","isVirtualPointerEvent","isMouseLikePointerType","pointerType","strict","values","isReactEvent","isRootElement","getDocument","isEventTargetWithin","getTarget","TYPEABLE_SELECTOR","isTypeableElement","computeCoordsFromPlacement","reference","floating","sideAxis","alignLength","isVertical","commonX","commonY","commonAlign","coords","computePosition","config","strategy","middleware","platform","validMiddleware","x","y","statefulPlacement","middlewareData","resetCount","name","fn","nextX","nextY","data","reset","detectOverflow","state","options","_await$platform$isEle","elements","boundary","rootBoundary","elementContext","altBoundary","paddingObject","clippingClientRect","offsetParent","offsetScale","elementClientRect","arrow","arrowDimensions","isYAxis","minProp","maxProp","clientProp","endDiff","startDiff","arrowOffsetParent","clientSize","centerToReference","largestPossiblePadding","minPadding","maxPadding","min$1","center","offset","shouldAddOffset","alignmentOffset","flip","_middlewareData$arrow","_middlewareData$flip","initialPlacement","checkMainAxis","checkCrossAxis","specifiedFallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","detectOverflowOptions","isBasePlacement","fallbackPlacements","placements","overflows","overflowsData","sides","_middlewareData$flip2","_overflowsData$filter","nextIndex","nextPlacement","resetPlacement","d","a","b","_overflowsData$map$so","acc","convertValueToCoords","mainAxisMulti","crossAxisMulti","rawValue","mainAxis","crossAxis","diffCoords","shift","limiter","mainAxisCoord","crossAxisCoord","minSide","maxSide","limitedCoords","getCssDimensions","width","height","hasOffset","offsetWidth","offsetHeight","shouldFallback","unwrapElement","getScale","domElement","$","noOffsets","getVisualOffsets","shouldAddVisualOffsets","isFixed","floatingOffsetParent","getBoundingClientRect","includeScale","isFixedStrategy","clientRect","scale","visualOffsets","offsetWin","currentIFrame","iframeScale","iframeRect","left","top","convertOffsetParentRelativeRectToViewportRelativeRect","isOffsetParentAnElement","documentElement","scroll","offsets","offsetRect","getClientRects","getWindowScrollBarX","getDocumentRect","html","body","getViewportRect","visualViewport","visualViewportBased","getInnerBoundingClientRect","getClientRectFromClippingAncestor","clippingAncestor","hasFixedPositionAncestor","stopNode","getClippingElementAncestors","cache","cachedResult","el","currentContainingBlockComputedStyle","elementIsFixed","computedStyle","currentNodeIsContaining","ancestor","getClippingRect","clippingAncestors","firstClippingAncestor","clippingRect","accRect","getDimensions","getRectRelativeToOffsetParent","getTrueOffsetParent","polyfill","getOffsetParent","window","getElementRects","getOffsetParentFn","getDimensionsFn","isRTL","observeMove","onMove","io","timeoutId","root","cleanup","refresh","skip","threshold","insetTop","insetRight","insetBottom","insetLeft","isFirstUpdate","handleObserve","entries","ratio","autoUpdate","update","ancestorScroll","ancestorResize","elementResize","layoutShift","animationFrame","referenceEl","ancestors","cleanupIo","reobserveFrame","resizeObserver","firstEntry","frameId","prevRefRect","frameLoop","nextRefRect","mergedOptions","platformWithCache","computePosition$1","isRef","arrow$1","index","deepEqual","keys","getDPR","roundByDPR","dpr","useLatestRef","React.useRef","useFloating","externalReference","externalFloating","transform","whileElementsMounted","open","setData","React.useState","latestMiddleware","setLatestMiddleware","_reference","_setReference","_floating","_setFloating","setReference","React.useCallback","referenceRef","setFloating","floatingRef","floatingEl","dataRef","whileElementsMountedRef","platformRef","fullData","isMountedRef","ReactDOM.flushSync","React.useMemo","floatingStyles","initialStyles","serverHandoffComplete","count","useFloatingId","setId","React.useEffect","useReactId","createPubSub","map","_map$get","handler","listener","_map$get2","l","FloatingNodeContext","React.createContext","FloatingTreeContext","useFloatingParentNodeId","_React$useContext","React.useContext","useFloatingTree","createAttribute","getChildren","nodes","allChildren","_node$context","currentChildren","_currentChildren","_node$context2","PortalContext","useFloatingPortalNode","_temp","portalNode","setPortalNode","uniqueId","portalContext","usePortalContext","existingIdRoot","attr","subRoot","container","idWrapper","isButtonTarget","isSpaceIgnored","useClick","onOpenChange","domReference","enabled","eventOption","toggle","ignoreMouse","keyboardHandlers","pointerTypeRef","didKeyDownRef","useInsertionEffect","useSafeInsertionEffect","useEffectEvent","callback","_len","args","_key","bubbleHandlerKeys","captureHandlerKeys","normalizeBubblesProp","bubbles","_bubbles$escapeKey","_bubbles$outsidePress","useDismiss","events","nodeId","escapeKey","unstable_outsidePress","outsidePressEvent","referencePress","referencePressEvent","tree","nested","outsidePressFn","outsidePress","insideReactTreeRef","escapeKeyBubbles","outsidePressBubbles","closeOnEscapeKeyDown","shouldDismiss","_child$context","closeOnPressOutside","insideReactTree","target","inertSelector","markers","targetRootAncestor","nextParent","marker","canScrollX","canScrollY","xCond","targetIsInsideChildren","_child$context2","onScroll","doc","_doc$defaultView","_options$elements2","unstable_onOpenChange","_domReference","setDomReference","position","useFloating$1","domReferenceRef","floatingId","setPositionReference","positionReference","mergeProps","userProps","propsList","elementKey","val","useInteractions","deps","getReferenceProps","getFloatingProps","getItemProps","ProviderContext","useProvider","ModalBody","ModalBody$1","ModalContext","ModalFooter","ModalFooter$1","ModalHeader","closeButton","ModalHeader$1","getCloseHandler","modalRef","header","onBeforeClose","BODY_CLASS","useBodyScrollLock","observer","needPolyfill","safeDispatchEvent","check","findNearestDialog","safeBlur","inNodeList","nodeList","isFormMethodDialog","findFocusableElementWithin","hostElement","opts","query","elems","isConnected","findFormSubmitter","form","submitter","dialogPolyfill","maybeHandleSubmit","dialog","formmethod","dialogPolyfillInfo","mo","removed","cb","timeout","delayModel","ev","cand","fake","redirectedEvent","dialogZ","backdropZ","opt_returnValue","closeEvent","scrollTop","topValue","styleSheet","cssRules","j","rule","selectedNodes","cssTop","cssBottom","checkDOM","records","rec","c","zIndex","dpi","last","candidate","cancelEvent","clone","allowed","testForm","methodDescriptor","realGet","realSet","path","valid","nativeFormSubmit","replacementFormSubmit","dialogPolyfill$1","Modal","onCancel","closeOnBackdropClick","portal","ariaLabelledby","onClick","ariaLabelId","rootElement","dateContext","isWidthPreset","mergedClassName","mergedStyle","handleModalClick","handleModalCancel","mergedAriaLabelledBy","component","createPortal","Modal$1","Select","inputProps","label","description","htmlSize","hideLabel","readOnlyEventHandlers","evt","Select$1","useFieldset","formField","Fieldset","errorPropagation","legend","hideLegend","Fieldset$1","CheckboxGroupContext","CheckboxGroup","defaultValue","onChange","setState","toggleValue","newValue","newState","CheckboxGroup$1","useCheckbox","checkboxGroup","useCheckbox$1","Checkbox","labelId","descriptionId","Checkbox$1","RadioGroupContext","RadioGroup","required","nameId","RadioGroup$1","useRadio","radioGroup","Radio","Radio$1"],"mappings":"+DAAA,SAASA,GAAE,EAAE,CAAC,IAAIC,EAAEC,EAAEC,EAAE,GAAG,GAAa,OAAO,GAAjB,UAA8B,OAAO,GAAjB,SAAmBA,GAAG,UAAoB,OAAO,GAAjB,SAAmB,GAAG,MAAM,QAAQ,CAAC,EAAE,IAAIF,EAAE,EAAEA,EAAE,EAAE,OAAOA,IAAI,EAAEA,CAAC,IAAIC,EAAEF,GAAE,EAAEC,CAAC,CAAC,KAAKE,IAAIA,GAAG,KAAKA,GAAGD,OAAQ,KAAID,KAAK,EAAE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,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45]}
\ No newline at end of file
diff --git a/assets/app-UFoL_ngB.js b/assets/app-UFoL_ngB.js
new file mode 100644
index 000000000..4b78ee7e5
--- /dev/null
+++ b/assets/app-UFoL_ngB.js
@@ -0,0 +1,227 @@
+var Ks=Object.defineProperty;var zs=(T,C,$)=>C in T?Ks(T,C,{enumerable:!0,configurable:!0,writable:!0,value:$}):T[C]=$;var yr=(T,C,$)=>(zs(T,typeof C!="symbol"?C+"":C,$),$),wn=(T,C,$)=>{if(!C.has(T))throw TypeError("Cannot "+$)};var pe=(T,C,$)=>(wn(T,C,"read from private field"),$?$.call(T):C.get(T)),kt=(T,C,$)=>{if(C.has(T))throw TypeError("Cannot add the same private member more than once");C instanceof WeakSet?C.add(T):C.set(T,$)},Ot=(T,C,$,V)=>(wn(T,C,"write to private field"),V?V.call(T,$):C.set(T,$),$);var Cr=(T,C,$,V)=>({set _(K){Ot(T,C,K,$)},get _(){return pe(T,C,V)}}),_t=(T,C,$)=>(wn(T,C,"access private method"),$);import{a as requiredArgs,g as getDefaultOptions,b as buildFormatLongFn,d as buildLocalizeFn,e as buildMatchPatternFn,f as buildMatchFn,r as reactExports,$ as $2AODx$react,h as getDefaultExportFromCjs,i as reactDomExports,R as React,n as nn$1,k as ReactDOM,l as hentFraSessionStorage,L as LocalStorageElement,j as jsxRuntimeExports,S as SOKEAVTALE_AKTIVITET_TYPE,E as EGEN_AKTIVITET_TYPE,m as STILLING_AKTIVITET_TYPE,T as TILTAK_AKTIVITET_TYPE,G as GRUPPE_AKTIVITET_TYPE,U as UTDANNING_AKTIVITET_TYPE,I as IJOBB_AKTIVITET_TYPE,B as BEHANDLING_AKTIVITET_TYPE,M as MOTE_TYPE,o as SAMTALEREFERAT_TYPE,p as ER_INTERN_FLATE,q as STILLING_FRA_NAV_TYPE,A as ARBEIDSRETTET_DIALOG_URL,t as ARBEIDSSOKERREGISTRERING_URL,u as MINSIDE_URL,v as ER_PROD,w as commonjsGlobal,x as AKTIVITETSPLAN_ROOT_NODE_ID,y as TabId,z as STILLING_FRA_NAV_BASE_URL,C as EKSTERN_AKTIVITET_TYPE,D as getAugmentedNamespace}from"./index-pPRcGYyw.js";import{t as toDate$1,a as toInteger,b as addDays,_ as _typeof$2,c as addMilliseconds,s as subDays,d as addMinutes,A as AktivitetStatus,e as ArenaEtikett,V as VeilarbAktivitetType,i as isArenaAktivitet,S as StillingFraNavSoknadsstatus,f as isVeilarbAktivitet,g as isEksternAktivitet$1,E as EksternAktivitetType,J as JobbStatusType,K as Kanal,h as StillingStatus,j as isSamtaleOrMote,k as StillingFraNavTransaksjonsType,l as StillingTransaksjonsType,F as FellesTransaksjonsTyper,m as SamtaleReferatTransaksjonsType,M as MoteTransaksjonsType,n as ArenaAktivitetType,L as Livslopsstatus}from"./transaksjonstyperTypes-ucMukET5.js";import{c as clsx$1,t as typoClassNames,o as omit,u as useId$1,a as composeEventHandlers,C as ChevronDownIcon,H as Heading,B as Button$1,X as XMarkIcon,b as useDateInputContext,d as useFormField,L as Label,R as ReadOnlyIcon,e as BodyShort,E as ErrorMessage,M as ModalContext,D as DateContext,f as useFloating,g as useInteractions,h as useClick,i as useDismiss,j as useClientLayoutEffect,k as useMergeRefs,l as autoUpdate,m as offset,n as flip,s as shift,p as arrow,q as Modal$1,r as mergeRefs$1,v as useId$2,w as Detail,S as Select,x as Loader,y as Checkbox,z as Select$1,A as RadioGroup,F as Radio}from"./Radio-VOSI1NDc.js";function _mergeNamespaces(T,C){for(var $=0;$V[K]})}}}return Object.freeze(Object.defineProperty(T,Symbol.toStringTag,{value:"Module"}))}function addMonths(T,C){requiredArgs(2,arguments);var $=toDate$1(T),V=toInteger(C);if(isNaN(V))return new Date(NaN);if(!V)return $;var K=$.getDate(),Y=new Date($.getTime());Y.setMonth($.getMonth()+V+1,0);var J=Y.getDate();return K>=J?Y:($.setFullYear(Y.getFullYear(),Y.getMonth(),K),$)}function isWeekend(T){requiredArgs(1,arguments);var C=toDate$1(T),$=C.getDay();return $===0||$===6}function startOfWeek(T,C){var $,V,K,Y,J,re,ne,te;requiredArgs(1,arguments);var se=getDefaultOptions(),ie=toInteger(($=(V=(K=(Y=C==null?void 0:C.weekStartsOn)!==null&&Y!==void 0?Y:C==null||(J=C.locale)===null||J===void 0||(re=J.options)===null||re===void 0?void 0:re.weekStartsOn)!==null&&K!==void 0?K:se.weekStartsOn)!==null&&V!==void 0?V:(ne=se.locale)===null||ne===void 0||(te=ne.options)===null||te===void 0?void 0:te.weekStartsOn)!==null&&$!==void 0?$:0);if(!(ie>=0&&ie<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var ae=toDate$1(T),oe=ae.getDay(),le=(oe=K.getTime()?$+1:C.getTime()>=J.getTime()?$:$-1}function startOfISOWeekYear(T){requiredArgs(1,arguments);var C=getISOWeekYear(T),$=new Date(0);$.setFullYear(C,0,4),$.setHours(0,0,0,0);var V=startOfISOWeek($);return V}function getTimezoneOffsetInMilliseconds(T){var C=new Date(Date.UTC(T.getFullYear(),T.getMonth(),T.getDate(),T.getHours(),T.getMinutes(),T.getSeconds(),T.getMilliseconds()));return C.setUTCFullYear(T.getFullYear()),T.getTime()-C.getTime()}function startOfDay(T){requiredArgs(1,arguments);var C=toDate$1(T);return C.setHours(0,0,0,0),C}var MILLISECONDS_IN_DAY$1=864e5;function differenceInCalendarDays(T,C){requiredArgs(2,arguments);var $=startOfDay(T),V=startOfDay(C),K=$.getTime()-getTimezoneOffsetInMilliseconds($),Y=V.getTime()-getTimezoneOffsetInMilliseconds(V);return Math.round((K-Y)/MILLISECONDS_IN_DAY$1)}function addWeeks(T,C){requiredArgs(2,arguments);var $=toInteger(C),V=$*7;return addDays(T,V)}function addYears(T,C){requiredArgs(2,arguments);var $=toInteger(C);return addMonths(T,$*12)}function max(T){requiredArgs(1,arguments);var C;if(T&&typeof T.forEach=="function")C=T;else if(_typeof$2(T)==="object"&&T!==null)C=Array.prototype.slice.call(T);else return new Date(NaN);var $;return C.forEach(function(V){var K=toDate$1(V);($===void 0||$K||isNaN(K.getDate()))&&($=K)}),$||new Date(NaN)}function compareAsc(T,C){requiredArgs(2,arguments);var $=toDate$1(T),V=toDate$1(C),K=$.getTime()-V.getTime();return K<0?-1:K>0?1:K}var millisecondsInMinute=6e4,millisecondsInHour=36e5,millisecondsInSecond=1e3,minutesInHour=60,secondsInMinute=60;function isSameDay(T,C){requiredArgs(2,arguments);var $=startOfDay(T),V=startOfDay(C);return $.getTime()===V.getTime()}function isDate(T){return requiredArgs(1,arguments),T instanceof Date||_typeof$2(T)==="object"&&Object.prototype.toString.call(T)==="[object Date]"}function isValid$1(T){if(requiredArgs(1,arguments),!isDate(T)&&typeof T!="number")return!1;var C=toDate$1(T);return!isNaN(Number(C))}function differenceInCalendarMonths(T,C){requiredArgs(2,arguments);var $=toDate$1(T),V=toDate$1(C),K=$.getFullYear()-V.getFullYear(),Y=$.getMonth()-V.getMonth();return K*12+Y}var MILLISECONDS_IN_WEEK$4=6048e5;function differenceInCalendarWeeks(T,C,$){requiredArgs(2,arguments);var V=startOfWeek(T,$),K=startOfWeek(C,$),Y=V.getTime()-getTimezoneOffsetInMilliseconds(V),J=K.getTime()-getTimezoneOffsetInMilliseconds(K);return Math.round((Y-J)/MILLISECONDS_IN_WEEK$4)}function compareLocalAsc(T,C){var $=T.getFullYear()-C.getFullYear()||T.getMonth()-C.getMonth()||T.getDate()-C.getDate()||T.getHours()-C.getHours()||T.getMinutes()-C.getMinutes()||T.getSeconds()-C.getSeconds()||T.getMilliseconds()-C.getMilliseconds();return $<0?-1:$>0?1:$}function differenceInDays(T,C){requiredArgs(2,arguments);var $=toDate$1(T),V=toDate$1(C),K=compareLocalAsc($,V),Y=Math.abs(differenceInCalendarDays($,V));$.setDate($.getDate()-K*Y);var J=+(compareLocalAsc($,V)===-K),re=K*(Y-J);return re===0?0:re}function differenceInMilliseconds(T,C){return requiredArgs(2,arguments),toDate$1(T).getTime()-toDate$1(C).getTime()}var roundingMap={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(C){return C<0?Math.ceil(C):Math.floor(C)}},defaultRoundingMethod="trunc";function getRoundingMethod(T){return T?roundingMap[T]:roundingMap[defaultRoundingMethod]}function differenceInMinutes(T,C,$){requiredArgs(2,arguments);var V=differenceInMilliseconds(T,C)/millisecondsInMinute;return getRoundingMethod($==null?void 0:$.roundingMethod)(V)}function endOfDay(T){requiredArgs(1,arguments);var C=toDate$1(T);return C.setHours(23,59,59,999),C}function endOfMonth(T){requiredArgs(1,arguments);var C=toDate$1(T),$=C.getMonth();return C.setFullYear(C.getFullYear(),$+1,0),C.setHours(23,59,59,999),C}function isLastDayOfMonth(T){requiredArgs(1,arguments);var C=toDate$1(T);return endOfDay(C).getTime()===endOfMonth(C).getTime()}function differenceInMonths(T,C){requiredArgs(2,arguments);var $=toDate$1(T),V=toDate$1(C),K=compareAsc($,V),Y=Math.abs(differenceInCalendarMonths($,V)),J;if(Y<1)J=0;else{$.getMonth()===1&&$.getDate()>27&&$.setDate(30),$.setMonth($.getMonth()-K*Y);var re=compareAsc($,V)===-K;isLastDayOfMonth(toDate$1(T))&&Y===1&&compareAsc(T,V)===1&&(re=!1),J=K*(Y-Number(re))}return J===0?0:J}function differenceInSeconds(T,C,$){requiredArgs(2,arguments);var V=differenceInMilliseconds(T,C)/1e3;return getRoundingMethod($==null?void 0:$.roundingMethod)(V)}function startOfMonth(T){requiredArgs(1,arguments);var C=toDate$1(T);return C.setDate(1),C.setHours(0,0,0,0),C}function startOfYear(T){requiredArgs(1,arguments);var C=toDate$1(T),$=new Date(0);return $.setFullYear(C.getFullYear(),0,1),$.setHours(0,0,0,0),$}function endOfWeek(T,C){var $,V,K,Y,J,re,ne,te;requiredArgs(1,arguments);var se=getDefaultOptions(),ie=toInteger(($=(V=(K=(Y=C==null?void 0:C.weekStartsOn)!==null&&Y!==void 0?Y:C==null||(J=C.locale)===null||J===void 0||(re=J.options)===null||re===void 0?void 0:re.weekStartsOn)!==null&&K!==void 0?K:se.weekStartsOn)!==null&&V!==void 0?V:(ne=se.locale)===null||ne===void 0||(te=ne.options)===null||te===void 0?void 0:te.weekStartsOn)!==null&&$!==void 0?$:0);if(!(ie>=0&&ie<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var ae=toDate$1(T),oe=ae.getDay(),le=(oe=K.getTime()?$+1:C.getTime()>=J.getTime()?$:$-1}function startOfUTCISOWeekYear(T){requiredArgs(1,arguments);var C=getUTCISOWeekYear(T),$=new Date(0);$.setUTCFullYear(C,0,4),$.setUTCHours(0,0,0,0);var V=startOfUTCISOWeek($);return V}var MILLISECONDS_IN_WEEK$3=6048e5;function getUTCISOWeek(T){requiredArgs(1,arguments);var C=toDate$1(T),$=startOfUTCISOWeek(C).getTime()-startOfUTCISOWeekYear(C).getTime();return Math.round($/MILLISECONDS_IN_WEEK$3)+1}function startOfUTCWeek(T,C){var $,V,K,Y,J,re,ne,te;requiredArgs(1,arguments);var se=getDefaultOptions(),ie=toInteger(($=(V=(K=(Y=C==null?void 0:C.weekStartsOn)!==null&&Y!==void 0?Y:C==null||(J=C.locale)===null||J===void 0||(re=J.options)===null||re===void 0?void 0:re.weekStartsOn)!==null&&K!==void 0?K:se.weekStartsOn)!==null&&V!==void 0?V:(ne=se.locale)===null||ne===void 0||(te=ne.options)===null||te===void 0?void 0:te.weekStartsOn)!==null&&$!==void 0?$:0);if(!(ie>=0&&ie<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var ae=toDate$1(T),oe=ae.getUTCDay(),le=(oe=1&&oe<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var le=new Date(0);le.setUTCFullYear(ie+1,0,oe),le.setUTCHours(0,0,0,0);var ce=startOfUTCWeek(le,C),de=new Date(0);de.setUTCFullYear(ie,0,oe),de.setUTCHours(0,0,0,0);var he=startOfUTCWeek(de,C);return se.getTime()>=ce.getTime()?ie+1:se.getTime()>=he.getTime()?ie:ie-1}function startOfUTCWeekYear(T,C){var $,V,K,Y,J,re,ne,te;requiredArgs(1,arguments);var se=getDefaultOptions(),ie=toInteger(($=(V=(K=(Y=C==null?void 0:C.firstWeekContainsDate)!==null&&Y!==void 0?Y:C==null||(J=C.locale)===null||J===void 0||(re=J.options)===null||re===void 0?void 0:re.firstWeekContainsDate)!==null&&K!==void 0?K:se.firstWeekContainsDate)!==null&&V!==void 0?V:(ne=se.locale)===null||ne===void 0||(te=ne.options)===null||te===void 0?void 0:te.firstWeekContainsDate)!==null&&$!==void 0?$:1),ae=getUTCWeekYear(T,C),oe=new Date(0);oe.setUTCFullYear(ae,0,ie),oe.setUTCHours(0,0,0,0);var le=startOfUTCWeek(oe,C);return le}var MILLISECONDS_IN_WEEK$2=6048e5;function getUTCWeek(T,C){requiredArgs(1,arguments);var $=toDate$1(T),V=startOfUTCWeek($,C).getTime()-startOfUTCWeekYear($,C).getTime();return Math.round(V/MILLISECONDS_IN_WEEK$2)+1}function addLeadingZeros(T,C){for(var $=T<0?"-":"",V=Math.abs(T).toString();V.length0?V:1-V;return addLeadingZeros($==="yy"?K%100:K,$.length)},M:function(C,$){var V=C.getUTCMonth();return $==="M"?String(V+1):addLeadingZeros(V+1,2)},d:function(C,$){return addLeadingZeros(C.getUTCDate(),$.length)},a:function(C,$){var V=C.getUTCHours()/12>=1?"pm":"am";switch($){case"a":case"aa":return V.toUpperCase();case"aaa":return V;case"aaaaa":return V[0];case"aaaa":default:return V==="am"?"a.m.":"p.m."}},h:function(C,$){return addLeadingZeros(C.getUTCHours()%12||12,$.length)},H:function(C,$){return addLeadingZeros(C.getUTCHours(),$.length)},m:function(C,$){return addLeadingZeros(C.getUTCMinutes(),$.length)},s:function(C,$){return addLeadingZeros(C.getUTCSeconds(),$.length)},S:function(C,$){var V=$.length,K=C.getUTCMilliseconds(),Y=Math.floor(K*Math.pow(10,V-3));return addLeadingZeros(Y,$.length)}};const formatters$4=formatters$3;var dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters$1={G:function(C,$,V){var K=C.getUTCFullYear()>0?1:0;switch($){case"G":case"GG":case"GGG":return V.era(K,{width:"abbreviated"});case"GGGGG":return V.era(K,{width:"narrow"});case"GGGG":default:return V.era(K,{width:"wide"})}},y:function(C,$,V){if($==="yo"){var K=C.getUTCFullYear(),Y=K>0?K:1-K;return V.ordinalNumber(Y,{unit:"year"})}return formatters$4.y(C,$)},Y:function(C,$,V,K){var Y=getUTCWeekYear(C,K),J=Y>0?Y:1-Y;if($==="YY"){var re=J%100;return addLeadingZeros(re,2)}return $==="Yo"?V.ordinalNumber(J,{unit:"year"}):addLeadingZeros(J,$.length)},R:function(C,$){var V=getUTCISOWeekYear(C);return addLeadingZeros(V,$.length)},u:function(C,$){var V=C.getUTCFullYear();return addLeadingZeros(V,$.length)},Q:function(C,$,V){var K=Math.ceil((C.getUTCMonth()+1)/3);switch($){case"Q":return String(K);case"QQ":return addLeadingZeros(K,2);case"Qo":return V.ordinalNumber(K,{unit:"quarter"});case"QQQ":return V.quarter(K,{width:"abbreviated",context:"formatting"});case"QQQQQ":return V.quarter(K,{width:"narrow",context:"formatting"});case"QQQQ":default:return V.quarter(K,{width:"wide",context:"formatting"})}},q:function(C,$,V){var K=Math.ceil((C.getUTCMonth()+1)/3);switch($){case"q":return String(K);case"qq":return addLeadingZeros(K,2);case"qo":return V.ordinalNumber(K,{unit:"quarter"});case"qqq":return V.quarter(K,{width:"abbreviated",context:"standalone"});case"qqqqq":return V.quarter(K,{width:"narrow",context:"standalone"});case"qqqq":default:return V.quarter(K,{width:"wide",context:"standalone"})}},M:function(C,$,V){var K=C.getUTCMonth();switch($){case"M":case"MM":return formatters$4.M(C,$);case"Mo":return V.ordinalNumber(K+1,{unit:"month"});case"MMM":return V.month(K,{width:"abbreviated",context:"formatting"});case"MMMMM":return V.month(K,{width:"narrow",context:"formatting"});case"MMMM":default:return V.month(K,{width:"wide",context:"formatting"})}},L:function(C,$,V){var K=C.getUTCMonth();switch($){case"L":return String(K+1);case"LL":return addLeadingZeros(K+1,2);case"Lo":return V.ordinalNumber(K+1,{unit:"month"});case"LLL":return V.month(K,{width:"abbreviated",context:"standalone"});case"LLLLL":return V.month(K,{width:"narrow",context:"standalone"});case"LLLL":default:return V.month(K,{width:"wide",context:"standalone"})}},w:function(C,$,V,K){var Y=getUTCWeek(C,K);return $==="wo"?V.ordinalNumber(Y,{unit:"week"}):addLeadingZeros(Y,$.length)},I:function(C,$,V){var K=getUTCISOWeek(C);return $==="Io"?V.ordinalNumber(K,{unit:"week"}):addLeadingZeros(K,$.length)},d:function(C,$,V){return $==="do"?V.ordinalNumber(C.getUTCDate(),{unit:"date"}):formatters$4.d(C,$)},D:function(C,$,V){var K=getUTCDayOfYear(C);return $==="Do"?V.ordinalNumber(K,{unit:"dayOfYear"}):addLeadingZeros(K,$.length)},E:function(C,$,V){var K=C.getUTCDay();switch($){case"E":case"EE":case"EEE":return V.day(K,{width:"abbreviated",context:"formatting"});case"EEEEE":return V.day(K,{width:"narrow",context:"formatting"});case"EEEEEE":return V.day(K,{width:"short",context:"formatting"});case"EEEE":default:return V.day(K,{width:"wide",context:"formatting"})}},e:function(C,$,V,K){var Y=C.getUTCDay(),J=(Y-K.weekStartsOn+8)%7||7;switch($){case"e":return String(J);case"ee":return addLeadingZeros(J,2);case"eo":return V.ordinalNumber(J,{unit:"day"});case"eee":return V.day(Y,{width:"abbreviated",context:"formatting"});case"eeeee":return V.day(Y,{width:"narrow",context:"formatting"});case"eeeeee":return V.day(Y,{width:"short",context:"formatting"});case"eeee":default:return V.day(Y,{width:"wide",context:"formatting"})}},c:function(C,$,V,K){var Y=C.getUTCDay(),J=(Y-K.weekStartsOn+8)%7||7;switch($){case"c":return String(J);case"cc":return addLeadingZeros(J,$.length);case"co":return V.ordinalNumber(J,{unit:"day"});case"ccc":return V.day(Y,{width:"abbreviated",context:"standalone"});case"ccccc":return V.day(Y,{width:"narrow",context:"standalone"});case"cccccc":return V.day(Y,{width:"short",context:"standalone"});case"cccc":default:return V.day(Y,{width:"wide",context:"standalone"})}},i:function(C,$,V){var K=C.getUTCDay(),Y=K===0?7:K;switch($){case"i":return String(Y);case"ii":return addLeadingZeros(Y,$.length);case"io":return V.ordinalNumber(Y,{unit:"day"});case"iii":return V.day(K,{width:"abbreviated",context:"formatting"});case"iiiii":return V.day(K,{width:"narrow",context:"formatting"});case"iiiiii":return V.day(K,{width:"short",context:"formatting"});case"iiii":default:return V.day(K,{width:"wide",context:"formatting"})}},a:function(C,$,V){var K=C.getUTCHours(),Y=K/12>=1?"pm":"am";switch($){case"a":case"aa":return V.dayPeriod(Y,{width:"abbreviated",context:"formatting"});case"aaa":return V.dayPeriod(Y,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return V.dayPeriod(Y,{width:"narrow",context:"formatting"});case"aaaa":default:return V.dayPeriod(Y,{width:"wide",context:"formatting"})}},b:function(C,$,V){var K=C.getUTCHours(),Y;switch(K===12?Y=dayPeriodEnum.noon:K===0?Y=dayPeriodEnum.midnight:Y=K/12>=1?"pm":"am",$){case"b":case"bb":return V.dayPeriod(Y,{width:"abbreviated",context:"formatting"});case"bbb":return V.dayPeriod(Y,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return V.dayPeriod(Y,{width:"narrow",context:"formatting"});case"bbbb":default:return V.dayPeriod(Y,{width:"wide",context:"formatting"})}},B:function(C,$,V){var K=C.getUTCHours(),Y;switch(K>=17?Y=dayPeriodEnum.evening:K>=12?Y=dayPeriodEnum.afternoon:K>=4?Y=dayPeriodEnum.morning:Y=dayPeriodEnum.night,$){case"B":case"BB":case"BBB":return V.dayPeriod(Y,{width:"abbreviated",context:"formatting"});case"BBBBB":return V.dayPeriod(Y,{width:"narrow",context:"formatting"});case"BBBB":default:return V.dayPeriod(Y,{width:"wide",context:"formatting"})}},h:function(C,$,V){if($==="ho"){var K=C.getUTCHours()%12;return K===0&&(K=12),V.ordinalNumber(K,{unit:"hour"})}return formatters$4.h(C,$)},H:function(C,$,V){return $==="Ho"?V.ordinalNumber(C.getUTCHours(),{unit:"hour"}):formatters$4.H(C,$)},K:function(C,$,V){var K=C.getUTCHours()%12;return $==="Ko"?V.ordinalNumber(K,{unit:"hour"}):addLeadingZeros(K,$.length)},k:function(C,$,V){var K=C.getUTCHours();return K===0&&(K=24),$==="ko"?V.ordinalNumber(K,{unit:"hour"}):addLeadingZeros(K,$.length)},m:function(C,$,V){return $==="mo"?V.ordinalNumber(C.getUTCMinutes(),{unit:"minute"}):formatters$4.m(C,$)},s:function(C,$,V){return $==="so"?V.ordinalNumber(C.getUTCSeconds(),{unit:"second"}):formatters$4.s(C,$)},S:function(C,$){return formatters$4.S(C,$)},X:function(C,$,V,K){var Y=K._originalDate||C,J=Y.getTimezoneOffset();if(J===0)return"Z";switch($){case"X":return formatTimezoneWithOptionalMinutes(J);case"XXXX":case"XX":return formatTimezone(J);case"XXXXX":case"XXX":default:return formatTimezone(J,":")}},x:function(C,$,V,K){var Y=K._originalDate||C,J=Y.getTimezoneOffset();switch($){case"x":return formatTimezoneWithOptionalMinutes(J);case"xxxx":case"xx":return formatTimezone(J);case"xxxxx":case"xxx":default:return formatTimezone(J,":")}},O:function(C,$,V,K){var Y=K._originalDate||C,J=Y.getTimezoneOffset();switch($){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(J,":");case"OOOO":default:return"GMT"+formatTimezone(J,":")}},z:function(C,$,V,K){var Y=K._originalDate||C,J=Y.getTimezoneOffset();switch($){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(J,":");case"zzzz":default:return"GMT"+formatTimezone(J,":")}},t:function(C,$,V,K){var Y=K._originalDate||C,J=Math.floor(Y.getTime()/1e3);return addLeadingZeros(J,$.length)},T:function(C,$,V,K){var Y=K._originalDate||C,J=Y.getTime();return addLeadingZeros(J,$.length)}};function formatTimezoneShort(T,C){var $=T>0?"-":"+",V=Math.abs(T),K=Math.floor(V/60),Y=V%60;if(Y===0)return $+String(K);var J=C||"";return $+String(K)+J+addLeadingZeros(Y,2)}function formatTimezoneWithOptionalMinutes(T,C){if(T%60===0){var $=T>0?"-":"+";return $+addLeadingZeros(Math.abs(T)/60,2)}return formatTimezone(T,C)}function formatTimezone(T,C){var $=C||"",V=T>0?"-":"+",K=Math.abs(T),Y=addLeadingZeros(Math.floor(K/60),2),J=addLeadingZeros(K%60,2);return V+Y+$+J}const formatters$2=formatters$1;var dateLongFormatter=function(C,$){switch(C){case"P":return $.date({width:"short"});case"PP":return $.date({width:"medium"});case"PPP":return $.date({width:"long"});case"PPPP":default:return $.date({width:"full"})}},timeLongFormatter=function(C,$){switch(C){case"p":return $.time({width:"short"});case"pp":return $.time({width:"medium"});case"ppp":return $.time({width:"long"});case"pppp":default:return $.time({width:"full"})}},dateTimeLongFormatter=function(C,$){var V=C.match(/(P+)(p+)?/)||[],K=V[1],Y=V[2];if(!Y)return dateLongFormatter(C,$);var J;switch(K){case"P":J=$.dateTime({width:"short"});break;case"PP":J=$.dateTime({width:"medium"});break;case"PPP":J=$.dateTime({width:"long"});break;case"PPPP":default:J=$.dateTime({width:"full"});break}return J.replace("{{date}}",dateLongFormatter(K,$)).replace("{{time}}",timeLongFormatter(Y,$))},longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter};const longFormatters$1=longFormatters;var protectedDayOfYearTokens=["D","DD"],protectedWeekYearTokens=["YY","YYYY"];function isProtectedDayOfYearToken(T){return protectedDayOfYearTokens.indexOf(T)!==-1}function isProtectedWeekYearToken(T){return protectedWeekYearTokens.indexOf(T)!==-1}function throwProtectedError(T,C,$){if(T==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(C,"`) for formatting years to the input `").concat($,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(T==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(C,"`) for formatting years to the input `").concat($,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(T==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(C,"`) for formatting days of the month to the input `").concat($,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(T==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(C,"`) for formatting days of the month to the input `").concat($,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var formatDistanceLocale$1={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"}},formatDistance$3=function(C,$,V){var K,Y=formatDistanceLocale$1[C];return typeof Y=="string"?K=Y:$===1?K=Y.one:K=Y.other.replace("{{count}}",$.toString()),V!=null&&V.addSuffix?V.comparison&&V.comparison>0?"in "+K:K+" ago":K};const formatDistance$4=formatDistance$3;var dateFormats$2={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats$2={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats$2={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$4={date:buildFormatLongFn({formats:dateFormats$2,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$2,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$2,defaultWidth:"full"})};const formatLong$5=formatLong$4;var formatRelativeLocale$1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},formatRelative$2=function(C,$,V,K){return formatRelativeLocale$1[C]};const formatRelative$3=formatRelative$2;var eraValues$1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues$1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues$1={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"]},dayValues$1={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"]},dayPeriodValues$1={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"}},formattingDayPeriodValues={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"}},ordinalNumber$1=function(C,$){var V=Number(C),K=V%100;if(K>20||K<10)switch(K%10){case 1:return V+"st";case 2:return V+"nd";case 3:return V+"rd"}return V+"th"},localize$2={ordinalNumber:ordinalNumber$1,era:buildLocalizeFn({values:eraValues$1,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$1,defaultWidth:"wide",argumentCallback:function(C){return C-1}}),month:buildLocalizeFn({values:monthValues$1,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$1,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$1,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})};const localize$3=localize$2;var matchOrdinalNumberPattern$1=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern$1=/\d+/i,matchEraPatterns$1={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},parseEraPatterns$1={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns$1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns$1={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$1={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},parseMonthPatterns$1={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]},matchDayPatterns$1={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},parseDayPatterns$1={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]},matchDayPeriodPatterns$1={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},parseDayPeriodPatterns$1={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}},match$2={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$1,parsePattern:parseOrdinalNumberPattern$1,valueCallback:function(C){return parseInt(C,10)}}),era:buildMatchFn({matchPatterns:matchEraPatterns$1,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$1,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$1,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$1,defaultParseWidth:"any",valueCallback:function(C){return C+1}}),month:buildMatchFn({matchPatterns:matchMonthPatterns$1,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$1,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$1,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$1,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$1,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$1,defaultParseWidth:"any"})};const match$3=match$2;var locale$2={code:"en-US",formatDistance:formatDistance$4,formatLong:formatLong$5,formatRelative:formatRelative$3,localize:localize$3,match:match$3,options:{weekStartsOn:0,firstWeekContainsDate:1}};const enUS=locale$2;var formattingTokensRegExp$1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp$1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp$1=/^'([^]*?)'?$/,doubleQuoteRegExp$1=/''/g,unescapedLatinCharacterRegExp$1=/[a-zA-Z]/;function format(T,C,$){var V,K,Y,J,re,ne,te,se,ie,ae,oe,le,ce,de,he,me,ge,ye;requiredArgs(2,arguments);var fe=String(C),Te=getDefaultOptions(),Pe=(V=(K=$==null?void 0:$.locale)!==null&&K!==void 0?K:Te.locale)!==null&&V!==void 0?V:enUS,De=toInteger((Y=(J=(re=(ne=$==null?void 0:$.firstWeekContainsDate)!==null&&ne!==void 0?ne:$==null||(te=$.locale)===null||te===void 0||(se=te.options)===null||se===void 0?void 0:se.firstWeekContainsDate)!==null&&re!==void 0?re:Te.firstWeekContainsDate)!==null&&J!==void 0?J:(ie=Te.locale)===null||ie===void 0||(ae=ie.options)===null||ae===void 0?void 0:ae.firstWeekContainsDate)!==null&&Y!==void 0?Y:1);if(!(De>=1&&De<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var xe=toInteger((oe=(le=(ce=(de=$==null?void 0:$.weekStartsOn)!==null&&de!==void 0?de:$==null||(he=$.locale)===null||he===void 0||(me=he.options)===null||me===void 0?void 0:me.weekStartsOn)!==null&&ce!==void 0?ce:Te.weekStartsOn)!==null&&le!==void 0?le:(ge=Te.locale)===null||ge===void 0||(ye=ge.options)===null||ye===void 0?void 0:ye.weekStartsOn)!==null&&oe!==void 0?oe:0);if(!(xe>=0&&xe<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!Pe.localize)throw new RangeError("locale must contain localize property");if(!Pe.formatLong)throw new RangeError("locale must contain formatLong property");var Ce=toDate$1(T);if(!isValid$1(Ce))throw new RangeError("Invalid time value");var je=getTimezoneOffsetInMilliseconds(Ce),Le=subMilliseconds(Ce,je),Ke={firstWeekContainsDate:De,weekStartsOn:xe,locale:Pe,_originalDate:Ce},Se=fe.match(longFormattingTokensRegExp$1).map(function(Ie){var Ne=Ie[0];if(Ne==="p"||Ne==="P"){var pt=longFormatters$1[Ne];return pt(Ie,Pe.formatLong)}return Ie}).join("").match(formattingTokensRegExp$1).map(function(Ie){if(Ie==="''")return"'";var Ne=Ie[0];if(Ne==="'")return cleanEscapedString$1(Ie);var pt=formatters$2[Ne];if(pt)return!($!=null&&$.useAdditionalWeekYearTokens)&&isProtectedWeekYearToken(Ie)&&throwProtectedError(Ie,C,String(T)),!($!=null&&$.useAdditionalDayOfYearTokens)&&isProtectedDayOfYearToken(Ie)&&throwProtectedError(Ie,C,String(T)),pt(Le,Ie,Pe.localize,Ke);if(Ne.match(unescapedLatinCharacterRegExp$1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Ne+"`");return Ie}).join("");return Se}function cleanEscapedString$1(T){var C=T.match(escapedStringRegExp$1);return C?C[1].replace(doubleQuoteRegExp$1,"'"):T}function assign(T,C){if(T==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var $ in C)Object.prototype.hasOwnProperty.call(C,$)&&(T[$]=C[$]);return T}function cloneObject$1(T){return assign({},T)}var MINUTES_IN_DAY=1440,MINUTES_IN_ALMOST_TWO_DAYS=2520,MINUTES_IN_MONTH=43200,MINUTES_IN_TWO_MONTHS=86400;function formatDistance$2(T,C,$){var V,K;requiredArgs(2,arguments);var Y=getDefaultOptions(),J=(V=(K=$==null?void 0:$.locale)!==null&&K!==void 0?K:Y.locale)!==null&&V!==void 0?V:enUS;if(!J.formatDistance)throw new RangeError("locale must contain formatDistance property");var re=compareAsc(T,C);if(isNaN(re))throw new RangeError("Invalid time value");var ne=assign(cloneObject$1($),{addSuffix:!!($!=null&&$.addSuffix),comparison:re}),te,se;re>0?(te=toDate$1(C),se=toDate$1(T)):(te=toDate$1(T),se=toDate$1(C));var ie=differenceInSeconds(se,te),ae=(getTimezoneOffsetInMilliseconds(se)-getTimezoneOffsetInMilliseconds(te))/1e3,oe=Math.round((ie-ae)/60),le;if(oe<2)return $!=null&&$.includeSeconds?ie<5?J.formatDistance("lessThanXSeconds",5,ne):ie<10?J.formatDistance("lessThanXSeconds",10,ne):ie<20?J.formatDistance("lessThanXSeconds",20,ne):ie<40?J.formatDistance("halfAMinute",0,ne):ie<60?J.formatDistance("lessThanXMinutes",1,ne):J.formatDistance("xMinutes",1,ne):oe===0?J.formatDistance("lessThanXMinutes",1,ne):J.formatDistance("xMinutes",oe,ne);if(oe<45)return J.formatDistance("xMinutes",oe,ne);if(oe<90)return J.formatDistance("aboutXHours",1,ne);if(oe=1&&oe<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var le=new Date(0);le.setFullYear(ie+1,0,oe),le.setHours(0,0,0,0);var ce=startOfWeek(le,C),de=new Date(0);de.setFullYear(ie,0,oe),de.setHours(0,0,0,0);var he=startOfWeek(de,C);return se.getTime()>=ce.getTime()?ie+1:se.getTime()>=he.getTime()?ie:ie-1}function startOfWeekYear(T,C){var $,V,K,Y,J,re,ne,te;requiredArgs(1,arguments);var se=getDefaultOptions(),ie=toInteger(($=(V=(K=(Y=C==null?void 0:C.firstWeekContainsDate)!==null&&Y!==void 0?Y:C==null||(J=C.locale)===null||J===void 0||(re=J.options)===null||re===void 0?void 0:re.firstWeekContainsDate)!==null&&K!==void 0?K:se.firstWeekContainsDate)!==null&&V!==void 0?V:(ne=se.locale)===null||ne===void 0||(te=ne.options)===null||te===void 0?void 0:te.firstWeekContainsDate)!==null&&$!==void 0?$:1),ae=getWeekYear(T,C),oe=new Date(0);oe.setFullYear(ae,0,ie),oe.setHours(0,0,0,0);var le=startOfWeek(oe,C);return le}var MILLISECONDS_IN_WEEK=6048e5;function getWeek(T,C){requiredArgs(1,arguments);var $=toDate$1(T),V=startOfWeek($,C).getTime()-startOfWeekYear($,C).getTime();return Math.round(V/MILLISECONDS_IN_WEEK)+1}function lastDayOfMonth(T){requiredArgs(1,arguments);var C=toDate$1(T),$=C.getMonth();return C.setFullYear(C.getFullYear(),$+1,0),C.setHours(0,0,0,0),C}function getWeeksInMonth(T,C){return requiredArgs(1,arguments),differenceInCalendarWeeks(lastDayOfMonth(T),startOfMonth(T),C)+1}function isAfter(T,C){requiredArgs(2,arguments);var $=toDate$1(T),V=toDate$1(C);return $.getTime()>V.getTime()}function isBefore(T,C){requiredArgs(2,arguments);var $=toDate$1(T),V=toDate$1(C);return $.getTime()T.length)&&(C=T.length);for(var $=0,V=new Array(C);$=T.length?{done:!0}:{done:!1,value:T[V++]}},e:function(te){throw te},f:K}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Y=!0,J=!1,re;return{s:function(){$=$.call(T)},n:function(){var te=$.next();return Y=te.done,te},e:function(te){J=!0,re=te},f:function(){try{!Y&&$.return!=null&&$.return()}finally{if(J)throw re}}}}function _assertThisInitialized$2(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}function _setPrototypeOf$2(T,C){return _setPrototypeOf$2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(V,K){return V.__proto__=K,V},_setPrototypeOf$2(T,C)}function _inherits$2(T,C){if(typeof C!="function"&&C!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(C&&C.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),Object.defineProperty(T,"prototype",{writable:!1}),C&&_setPrototypeOf$2(T,C)}function _getPrototypeOf$2(T){return _getPrototypeOf$2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function($){return $.__proto__||Object.getPrototypeOf($)},_getPrototypeOf$2(T)}function _isNativeReflectConstruct$2(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _possibleConstructorReturn$2(T,C){if(C&&(_typeof$2(C)==="object"||typeof C=="function"))return C;if(C!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$2(T)}function _createSuper$2(T){var C=_isNativeReflectConstruct$2();return function(){var V=_getPrototypeOf$2(T),K;if(C){var Y=_getPrototypeOf$2(this).constructor;K=Reflect.construct(V,arguments,Y)}else K=V.apply(this,arguments);return _possibleConstructorReturn$2(this,K)}}function _classCallCheck$2(T,C){if(!(T instanceof C))throw new TypeError("Cannot call a class as a function")}function _toPrimitive(T,C){if(_typeof$2(T)!=="object"||T===null)return T;var $=T[Symbol.toPrimitive];if($!==void 0){var V=$.call(T,C||"default");if(_typeof$2(V)!=="object")return V;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(T)}function _toPropertyKey(T){var C=_toPrimitive(T,"string");return _typeof$2(C)==="symbol"?C:String(C)}function _defineProperties$2(T,C){for(var $=0;$0,V=$?C:1-C,K;if(V<=50)K=T||100;else{var Y=V+50,J=Math.floor(Y/100)*100,re=T>=Y%100;K=T+J-(re?100:0)}return $?K:1-K}function isLeapYearIndex$1(T){return T%400===0||T%4===0&&T%100!==0}var YearParser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J0}},{key:"set",value:function(K,Y,J){var re=K.getUTCFullYear();if(J.isTwoDigitYear){var ne=normalizeTwoDigitYear(J.year,re);return K.setUTCFullYear(ne,0,1),K.setUTCHours(0,0,0,0),K}var te=!("era"in Y)||Y.era===1?J.year:1-J.year;return K.setUTCFullYear(te,0,1),K.setUTCHours(0,0,0,0),K}}]),$}(Parser),LocalWeekYearParser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J0}},{key:"set",value:function(K,Y,J,re){var ne=getUTCWeekYear(K,re);if(J.isTwoDigitYear){var te=normalizeTwoDigitYear(J.year,ne);return K.setUTCFullYear(te,0,re.firstWeekContainsDate),K.setUTCHours(0,0,0,0),startOfUTCWeek(K,re)}var se=!("era"in Y)||Y.era===1?J.year:1-J.year;return K.setUTCFullYear(se,0,re.firstWeekContainsDate),K.setUTCHours(0,0,0,0),startOfUTCWeek(K,re)}}]),$}(Parser),ISOWeekYearParser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=1&&Y<=4}},{key:"set",value:function(K,Y,J){return K.setUTCMonth((J-1)*3,1),K.setUTCHours(0,0,0,0),K}}]),$}(Parser),StandAloneQuarterParser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=1&&Y<=4}},{key:"set",value:function(K,Y,J){return K.setUTCMonth((J-1)*3,1),K.setUTCHours(0,0,0,0),K}}]),$}(Parser),MonthParser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=0&&Y<=11}},{key:"set",value:function(K,Y,J){return K.setUTCMonth(J,1),K.setUTCHours(0,0,0,0),K}}]),$}(Parser),StandAloneMonthParser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=0&&Y<=11}},{key:"set",value:function(K,Y,J){return K.setUTCMonth(J,1),K.setUTCHours(0,0,0,0),K}}]),$}(Parser);function setUTCWeek(T,C,$){requiredArgs(2,arguments);var V=toDate$1(T),K=toInteger(C),Y=getUTCWeek(V,$)-K;return V.setUTCDate(V.getUTCDate()-Y*7),V}var LocalWeekParser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=1&&Y<=53}},{key:"set",value:function(K,Y,J,re){return startOfUTCWeek(setUTCWeek(K,J,re),re)}}]),$}(Parser);function setUTCISOWeek(T,C){requiredArgs(2,arguments);var $=toDate$1(T),V=toInteger(C),K=getUTCISOWeek($)-V;return $.setUTCDate($.getUTCDate()-K*7),$}var ISOWeekParser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=1&&Y<=53}},{key:"set",value:function(K,Y,J){return startOfUTCISOWeek(setUTCISOWeek(K,J))}}]),$}(Parser),DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31],DAYS_IN_MONTH_LEAP_YEAR=[31,29,31,30,31,30,31,31,30,31,30,31],DateParser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=1&&Y<=DAYS_IN_MONTH_LEAP_YEAR[ne]:Y>=1&&Y<=DAYS_IN_MONTH[ne]}},{key:"set",value:function(K,Y,J){return K.setUTCDate(J),K.setUTCHours(0,0,0,0),K}}]),$}(Parser),DayOfYearParser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=1&&Y<=366:Y>=1&&Y<=365}},{key:"set",value:function(K,Y,J){return K.setUTCMonth(0,J),K.setUTCHours(0,0,0,0),K}}]),$}(Parser);function setUTCDay(T,C,$){var V,K,Y,J,re,ne,te,se;requiredArgs(2,arguments);var ie=getDefaultOptions(),ae=toInteger((V=(K=(Y=(J=$==null?void 0:$.weekStartsOn)!==null&&J!==void 0?J:$==null||(re=$.locale)===null||re===void 0||(ne=re.options)===null||ne===void 0?void 0:ne.weekStartsOn)!==null&&Y!==void 0?Y:ie.weekStartsOn)!==null&&K!==void 0?K:(te=ie.locale)===null||te===void 0||(se=te.options)===null||se===void 0?void 0:se.weekStartsOn)!==null&&V!==void 0?V:0);if(!(ae>=0&&ae<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var oe=toDate$1(T),le=toInteger(C),ce=oe.getUTCDay(),de=le%7,he=(de+7)%7,me=(he=0&&Y<=6}},{key:"set",value:function(K,Y,J,re){return K=setUTCDay(K,J,re),K.setUTCHours(0,0,0,0),K}}]),$}(Parser),LocalDayParser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=0&&Y<=6}},{key:"set",value:function(K,Y,J,re){return K=setUTCDay(K,J,re),K.setUTCHours(0,0,0,0),K}}]),$}(Parser),StandAloneLocalDayParser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=0&&Y<=6}},{key:"set",value:function(K,Y,J,re){return K=setUTCDay(K,J,re),K.setUTCHours(0,0,0,0),K}}]),$}(Parser);function setUTCISODay(T,C){requiredArgs(2,arguments);var $=toInteger(C);$%7===0&&($=$-7);var V=1,K=toDate$1(T),Y=K.getUTCDay(),J=$%7,re=(J+7)%7,ne=(re=1&&Y<=7}},{key:"set",value:function(K,Y,J){return K=setUTCISODay(K,J),K.setUTCHours(0,0,0,0),K}}]),$}(Parser),AMPMParser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=1&&Y<=12}},{key:"set",value:function(K,Y,J){var re=K.getUTCHours()>=12;return re&&J<12?K.setUTCHours(J+12,0,0,0):!re&&J===12?K.setUTCHours(0,0,0,0):K.setUTCHours(J,0,0,0),K}}]),$}(Parser),Hour0to23Parser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=0&&Y<=23}},{key:"set",value:function(K,Y,J){return K.setUTCHours(J,0,0,0),K}}]),$}(Parser),Hour0To11Parser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=0&&Y<=11}},{key:"set",value:function(K,Y,J){var re=K.getUTCHours()>=12;return re&&J<12?K.setUTCHours(J+12,0,0,0):K.setUTCHours(J,0,0,0),K}}]),$}(Parser),Hour1To24Parser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=1&&Y<=24}},{key:"set",value:function(K,Y,J){var re=J<=24?J%24:J;return K.setUTCHours(re,0,0,0),K}}]),$}(Parser),MinuteParser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=0&&Y<=59}},{key:"set",value:function(K,Y,J){return K.setUTCMinutes(J,0,0),K}}]),$}(Parser),SecondParser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=0&&Y<=59}},{key:"set",value:function(K,Y,J){return K.setUTCSeconds(J,0),K}}]),$}(Parser),FractionOfSecondParser=function(T){_inherits$2($,T);var C=_createSuper$2($);function $(){var V;_classCallCheck$2(this,$);for(var K=arguments.length,Y=new Array(K),J=0;J=1&&Ce<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var je=toInteger((le=(ce=(de=(he=V==null?void 0:V.weekStartsOn)!==null&&he!==void 0?he:V==null||(me=V.locale)===null||me===void 0||(ge=me.options)===null||ge===void 0?void 0:ge.weekStartsOn)!==null&&de!==void 0?de:De.weekStartsOn)!==null&&ce!==void 0?ce:(ye=De.locale)===null||ye===void 0||(fe=ye.options)===null||fe===void 0?void 0:fe.weekStartsOn)!==null&&le!==void 0?le:0);if(!(je>=0&&je<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(Pe==="")return Te===""?toDate$1($):new Date(NaN);var Le={firstWeekContainsDate:Ce,weekStartsOn:je,locale:xe},Ke=[new DateToSystemTimezoneSetter],Se=Pe.match(longFormattingTokensRegExp).map(function(_e){var Oe=_e[0];if(Oe in longFormatters$1){var Qe=longFormatters$1[Oe];return Qe(_e,xe.formatLong)}return _e}).join("").match(formattingTokensRegExp),Ie=[],Ne=_createForOfIteratorHelper(Se),pt;try{var at=function(){var Oe=pt.value;!(V!=null&&V.useAdditionalWeekYearTokens)&&isProtectedWeekYearToken(Oe)&&throwProtectedError(Oe,Pe,T),!(V!=null&&V.useAdditionalDayOfYearTokens)&&isProtectedDayOfYearToken(Oe)&&throwProtectedError(Oe,Pe,T);var Qe=Oe[0],ct=parsers[Qe];if(ct){var xt=ct.incompatibleTokens;if(Array.isArray(xt)){var Tt=Ie.find(function($t){return xt.includes($t.token)||$t.token===Qe});if(Tt)throw new RangeError("The format string mustn't contain `".concat(Tt.fullToken,"` and `").concat(Oe,"` at the same time"))}else if(ct.incompatibleTokens==="*"&&Ie.length>0)throw new RangeError("The format string mustn't contain `".concat(Oe,"` and any other token at the same time"));Ie.push({token:Qe,fullToken:Oe});var Pt=ct.run(Te,Oe,xe.match,Le);if(!Pt)return{v:new Date(NaN)};Ke.push(Pt.setter),Te=Pt.rest}else{if(Qe.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Qe+"`");if(Oe==="''"?Oe="'":Qe==="'"&&(Oe=cleanEscapedString(Oe)),Te.indexOf(Oe)===0)Te=Te.slice(Oe.length);else return{v:new Date(NaN)}}};for(Ne.s();!(pt=Ne.n()).done;){var dt=at();if(_typeof$2(dt)==="object")return dt.v}}catch(_e){Ne.e(_e)}finally{Ne.f()}if(Te.length>0&¬WhitespaceRegExp.test(Te))return new Date(NaN);var Ct=Ke.map(function(_e){return _e.priority}).sort(function(_e,Oe){return Oe-_e}).filter(function(_e,Oe,Qe){return Qe.indexOf(_e)===Oe}).map(function(_e){return Ke.filter(function(Oe){return Oe.priority===_e}).sort(function(Oe,Qe){return Qe.subPriority-Oe.subPriority})}).map(function(_e){return _e[0]}),ut=toDate$1($);if(isNaN(ut.getTime()))return new Date(NaN);var bt=subMilliseconds(ut,getTimezoneOffsetInMilliseconds(ut)),Re={},ue=_createForOfIteratorHelper(Ct),be;try{for(ue.s();!(be=ue.n()).done;){var ve=be.value;if(!ve.validate(bt,Le))return new Date(NaN);var we=ve.set(bt,Re,Le);Array.isArray(we)?(bt=we[0],assign(Re,we[1])):bt=we}}catch(_e){ue.e(_e)}finally{ue.f()}return bt}function cleanEscapedString(T){return T.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp,"'")}function isSameMonth(T,C){requiredArgs(2,arguments);var $=toDate$1(T),V=toDate$1(C);return $.getFullYear()===V.getFullYear()&&$.getMonth()===V.getMonth()}function isSameYear(T,C){requiredArgs(2,arguments);var $=toDate$1(T),V=toDate$1(C);return $.getFullYear()===V.getFullYear()}function isWithinInterval(T,C){requiredArgs(2,arguments);var $=toDate$1(T).getTime(),V=toDate$1(C.start).getTime(),K=toDate$1(C.end).getTime();if(!(V<=K))throw new RangeError("Invalid interval");return $>=V&&$<=K}function minutesToHours(T){requiredArgs(1,arguments);var C=T/minutesInHour;return Math.floor(C)}function parseISO(T,C){var $;requiredArgs(1,arguments);var V=toInteger(($=C==null?void 0:C.additionalDigits)!==null&&$!==void 0?$:2);if(V!==2&&V!==1&&V!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof T=="string"||Object.prototype.toString.call(T)==="[object String]"))return new Date(NaN);var K=splitDateString(T),Y;if(K.date){var J=parseYear(K.date,V);Y=parseDate$1(J.restDateString,J.year)}if(!Y||isNaN(Y.getTime()))return new Date(NaN);var re=Y.getTime(),ne=0,te;if(K.time&&(ne=parseTime$1(K.time),isNaN(ne)))return new Date(NaN);if(K.timezone){if(te=parseTimezone(K.timezone),isNaN(te))return new Date(NaN)}else{var se=new Date(re+ne),ie=new Date(0);return ie.setFullYear(se.getUTCFullYear(),se.getUTCMonth(),se.getUTCDate()),ie.setHours(se.getUTCHours(),se.getUTCMinutes(),se.getUTCSeconds(),se.getUTCMilliseconds()),ie}return new Date(re+ne+te)}var patterns={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},dateRegex=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,timeRegex=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,timezoneRegex=/^([+-])(\d{2})(?::?(\d{2}))?$/;function splitDateString(T){var C={},$=T.split(patterns.dateTimeDelimiter),V;if($.length>2)return C;if(/:/.test($[0])?V=$[0]:(C.date=$[0],V=$[1],patterns.timeZoneDelimiter.test(C.date)&&(C.date=T.split(patterns.timeZoneDelimiter)[0],V=T.substr(C.date.length,T.length))),V){var K=patterns.timezone.exec(V);K?(C.time=V.replace(K[1],""),C.timezone=K[1]):C.time=V}return C}function parseYear(T,C){var $=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+C)+"})|(\\d{2}|[+-]\\d{"+(2+C)+"})$)"),V=T.match($);if(!V)return{year:NaN,restDateString:""};var K=V[1]?parseInt(V[1]):null,Y=V[2]?parseInt(V[2]):null;return{year:Y===null?K:Y*100,restDateString:T.slice((V[1]||V[2]).length)}}function parseDate$1(T,C){if(C===null)return new Date(NaN);var $=T.match(dateRegex);if(!$)return new Date(NaN);var V=!!$[4],K=parseDateUnit($[1]),Y=parseDateUnit($[2])-1,J=parseDateUnit($[3]),re=parseDateUnit($[4]),ne=parseDateUnit($[5])-1;if(V)return validateWeekDate(C,re,ne)?dayOfISOWeekYear(C,re,ne):new Date(NaN);var te=new Date(0);return!validateDate(C,Y,J)||!validateDayOfYearDate(C,K)?new Date(NaN):(te.setUTCFullYear(C,Y,Math.max(K,J)),te)}function parseDateUnit(T){return T?parseInt(T):1}function parseTime$1(T){var C=T.match(timeRegex);if(!C)return NaN;var $=parseTimeUnit(C[1]),V=parseTimeUnit(C[2]),K=parseTimeUnit(C[3]);return validateTime($,V,K)?$*millisecondsInHour+V*millisecondsInMinute+K*1e3:NaN}function parseTimeUnit(T){return T&&parseFloat(T.replace(",","."))||0}function parseTimezone(T){if(T==="Z")return 0;var C=T.match(timezoneRegex);if(!C)return 0;var $=C[1]==="+"?-1:1,V=parseInt(C[2]),K=C[3]&&parseInt(C[3])||0;return validateTimezone(V,K)?$*(V*millisecondsInHour+K*millisecondsInMinute):NaN}function dayOfISOWeekYear(T,C,$){var V=new Date(0);V.setUTCFullYear(T,0,4);var K=V.getUTCDay()||7,Y=(C-1)*7+$+1-K;return V.setUTCDate(V.getUTCDate()+Y),V}var daysInMonths=[31,null,31,30,31,30,31,31,30,31,30,31];function isLeapYearIndex(T){return T%400===0||T%4===0&&T%100!==0}function validateDate(T,C,$){return C>=0&&C<=11&&$>=1&&$<=(daysInMonths[C]||(isLeapYearIndex(T)?29:28))}function validateDayOfYearDate(T,C){return C>=1&&C<=(isLeapYearIndex(T)?366:365)}function validateWeekDate(T,C,$){return C>=1&&C<=53&&$>=0&&$<=6}function validateTime(T,C,$){return T===24?C===0&&$===0:$>=0&&$<60&&C>=0&&C<60&&T>=0&&T<25}function validateTimezone(T,C){return C>=0&&C<=59}function secondsToMinutes(T){requiredArgs(1,arguments);var C=T/secondsInMinute;return Math.floor(C)}function setMonth(T,C){requiredArgs(2,arguments);var $=toDate$1(T),V=toInteger(C),K=$.getFullYear(),Y=$.getDate(),J=new Date(0);J.setFullYear(K,V,15),J.setHours(0,0,0,0);var re=getDaysInMonth(J);return $.setMonth(V,Math.min(Y,re)),$}function setHours(T,C){requiredArgs(2,arguments);var $=toDate$1(T),V=toInteger(C);return $.setHours(V),$}function setMinutes(T,C){requiredArgs(2,arguments);var $=toDate$1(T),V=toInteger(C);return $.setMinutes(V),$}function setYear(T,C){requiredArgs(2,arguments);var $=toDate$1(T),V=toInteger(C);return isNaN($.getTime())?new Date(NaN):($.setFullYear(V),$)}function subMonths(T,C){requiredArgs(2,arguments);var $=toInteger(C);return addMonths(T,-$)}function sub(T,C){if(requiredArgs(2,arguments),!C||_typeof$2(C)!=="object")return new Date(NaN);var $=C.years?toInteger(C.years):0,V=C.months?toInteger(C.months):0,K=C.weeks?toInteger(C.weeks):0,Y=C.days?toInteger(C.days):0,J=C.hours?toInteger(C.hours):0,re=C.minutes?toInteger(C.minutes):0,ne=C.seconds?toInteger(C.seconds):0,te=subMonths(T,V+$*12),se=subDays(te,Y+K*7),ie=re+J*60,ae=ne+ie*60,oe=ae*1e3,le=new Date(se.getTime()-oe);return le}function subMinutes(T,C){requiredArgs(2,arguments);var $=toInteger(C);return addMinutes(T,-$)}var extendStatics=function(T,C){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function($,V){$.__proto__=V}||function($,V){for(var K in V)Object.prototype.hasOwnProperty.call(V,K)&&($[K]=V[K])},extendStatics(T,C)};function __extends$1(T,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");extendStatics(T,C);function $(){this.constructor=T}T.prototype=C===null?Object.create(C):($.prototype=C.prototype,new $)}var __assign$2=function(){return __assign$2=Object.assign||function(C){for(var $,V=1,K=arguments.length;V0&&Y[Y.length-1])&&(te[0]===6||te[0]===2)){$=0;continue}if(te[0]===3&&(!Y||te[1]>Y[0]&&te[1]=T.length&&(T=void 0),{value:T&&T[V++],done:!T}}};throw new TypeError(C?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(T,C){var $=typeof Symbol=="function"&&T[Symbol.iterator];if(!$)return T;var V=$.call(T),K,Y=[],J;try{for(;(C===void 0||C-- >0)&&!(K=V.next()).done;)Y.push(K.value)}catch(re){J={error:re}}finally{try{K&&!K.done&&($=V.return)&&$.call(V)}finally{if(J)throw J.error}}return Y}function __spreadArray$3(T,C,$){if($||arguments.length===2)for(var V=0,K=C.length,Y;V>T/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,UUID)},Timeline=function(){function T(C){this.client=C,this.queue=[],this.applying=!1,this.plugins=[]}return T.prototype.register=function(C,$){var V,K,Y;return __awaiter$1(this,void 0,void 0,function(){return __generator$1(this,function(J){switch(J.label){case 0:return C.name=(V=C.name)!==null&&V!==void 0?V:UUID(),C.type=(K=C.type)!==null&&K!==void 0?K:"enrichment",[4,(Y=C.setup)===null||Y===void 0?void 0:Y.call(C,$,this.client)];case 1:return J.sent(),this.plugins.push(C),[2]}})})},T.prototype.deregister=function(C){var $;return __awaiter$1(this,void 0,void 0,function(){var V,K;return __generator$1(this,function(Y){switch(Y.label){case 0:return V=this.plugins.findIndex(function(J){return J.name===C}),K=this.plugins[V],this.plugins.splice(V,1),[4,($=K.teardown)===null||$===void 0?void 0:$.call(K)];case 1:return Y.sent(),[2]}})})},T.prototype.reset=function(C){this.applying=!1;var $=this.plugins;$.map(function(V){var K;return(K=V.teardown)===null||K===void 0?void 0:K.call(V)}),this.plugins=[],this.client=C},T.prototype.push=function(C){var $=this;return new Promise(function(V){$.queue.push([C,V]),$.scheduleApply(0)})},T.prototype.scheduleApply=function(C){var $=this;this.applying||(this.applying=!0,setTimeout(function(){$.apply($.queue.shift()).then(function(){$.applying=!1,$.queue.length>0&&$.scheduleApply(0)})},C))},T.prototype.apply=function(C){return __awaiter$1(this,void 0,void 0,function(){var $,V,K,Y,J,re,ne,oe,le,te,se,ie,ae,oe,le,ce,de,he,me,ge,ye,fe;return __generator$1(this,function(Te){switch(Te.label){case 0:if(!C)return[2];$=__read(C,1),V=$[0],K=__read(C,2),Y=K[1],J=this.plugins.filter(function(Pe){return Pe.type==="before"}),Te.label=1;case 1:Te.trys.push([1,6,7,8]),re=__values(J),ne=re.next(),Te.label=2;case 2:return ne.done?[3,5]:(oe=ne.value,oe.execute?[4,oe.execute(__assign$2({},V))]:[3,4]);case 3:if(le=Te.sent(),le===null)return Y({event:V,code:0,message:""}),[2];V=le,Te.label=4;case 4:return ne=re.next(),[3,2];case 5:return[3,8];case 6:return te=Te.sent(),me={error:te},[3,8];case 7:try{ne&&!ne.done&&(ge=re.return)&&ge.call(re)}finally{if(me)throw me.error}return[7];case 8:se=this.plugins.filter(function(Pe){return Pe.type==="enrichment"||Pe.type===void 0}),Te.label=9;case 9:Te.trys.push([9,14,15,16]),ie=__values(se),ae=ie.next(),Te.label=10;case 10:return ae.done?[3,13]:(oe=ae.value,oe.execute?[4,oe.execute(__assign$2({},V))]:[3,12]);case 11:if(le=Te.sent(),le===null)return Y({event:V,code:0,message:""}),[2];V=le,Te.label=12;case 12:return ae=ie.next(),[3,10];case 13:return[3,16];case 14:return ce=Te.sent(),ye={error:ce},[3,16];case 15:try{ae&&!ae.done&&(fe=ie.return)&&fe.call(ie)}finally{if(ye)throw ye.error}return[7];case 16:return de=this.plugins.filter(function(Pe){return Pe.type==="destination"}),he=de.map(function(Pe){var De=__assign$2({},V);return Pe.execute(De).catch(function(xe){return buildResult(De,0,String(xe))})}),Promise.all(he).then(function(Pe){var De=__read(Pe,1),xe=De[0],Ce=xe||buildResult(V,100,"Event not tracked, no destination plugins on the instance");Y(Ce)}),[2]}})})},T.prototype.flush=function(){return __awaiter$1(this,void 0,void 0,function(){var C,$,V,K=this;return __generator$1(this,function(Y){switch(Y.label){case 0:return C=this.queue,this.queue=[],[4,Promise.all(C.map(function(J){return K.apply(J)}))];case 1:return Y.sent(),$=this.plugins.filter(function(J){return J.type==="destination"}),V=$.map(function(J){return J.flush&&J.flush()}),[4,Promise.all(V)];case 2:return Y.sent(),[2]}})})},T}(),UNSET_VALUE="-",AMPLITUDE_PREFIX="AMP",STORAGE_PREFIX="".concat(AMPLITUDE_PREFIX,"_unsent"),AMPLITUDE_SERVER_URL="https://api2.amplitude.com/2/httpapi",EU_AMPLITUDE_SERVER_URL="https://api.eu.amplitude.com/2/httpapi",AMPLITUDE_BATCH_SERVER_URL="https://api2.amplitude.com/batch",EU_AMPLITUDE_BATCH_SERVER_URL="https://api.eu.amplitude.com/batch",MAX_PROPERTY_KEYS=1e3,isValidObject=function(T){if(Object.keys(T).length>MAX_PROPERTY_KEYS)return!1;for(var C in T){var $=T[C];if(!isValidProperties(C,$))return!1}return!0},isValidProperties=function(T,C){var $,V;if(typeof T!="string")return!1;if(Array.isArray(C)){var K=!0;try{for(var Y=__values(C),J=Y.next();!J.done;J=Y.next()){var re=J.value;if(Array.isArray(re))return!1;if(typeof re=="object")K=K&&isValidObject(re);else if(!["number","string"].includes(typeof re))return!1;if(!K)return!1}}catch(ne){$={error:ne}}finally{try{J&&!J.done&&(V=Y.return)&&V.call(Y)}finally{if($)throw $.error}}}else{if(C==null)return!1;if(typeof C=="object")return isValidObject(C);if(!["number","string","boolean"].includes(typeof C))return!1}return!0},Identify=function(){function T(){this._propertySet=new Set,this._properties={}}return T.prototype.getUserProperties=function(){return __assign$2({},this._properties)},T.prototype.set=function(C,$){return this._safeSet(IdentifyOperation.SET,C,$),this},T.prototype.setOnce=function(C,$){return this._safeSet(IdentifyOperation.SET_ONCE,C,$),this},T.prototype.append=function(C,$){return this._safeSet(IdentifyOperation.APPEND,C,$),this},T.prototype.prepend=function(C,$){return this._safeSet(IdentifyOperation.PREPEND,C,$),this},T.prototype.postInsert=function(C,$){return this._safeSet(IdentifyOperation.POSTINSERT,C,$),this},T.prototype.preInsert=function(C,$){return this._safeSet(IdentifyOperation.PREINSERT,C,$),this},T.prototype.remove=function(C,$){return this._safeSet(IdentifyOperation.REMOVE,C,$),this},T.prototype.add=function(C,$){return this._safeSet(IdentifyOperation.ADD,C,$),this},T.prototype.unset=function(C){return this._safeSet(IdentifyOperation.UNSET,C,UNSET_VALUE),this},T.prototype.clearAll=function(){return this._properties={},this._properties[IdentifyOperation.CLEAR_ALL]=UNSET_VALUE,this},T.prototype._safeSet=function(C,$,V){if(this._validate(C,$,V)){var K=this._properties[C];return K===void 0&&(K={},this._properties[C]=K),K[$]=V,this._propertySet.add($),!0}return!1},T.prototype._validate=function(C,$,V){return this._properties[IdentifyOperation.CLEAR_ALL]!==void 0||this._propertySet.has($)?!1:C===IdentifyOperation.ADD?typeof V=="number":C!==IdentifyOperation.UNSET&&C!==IdentifyOperation.REMOVE?isValidProperties($,V):!0},T}(),createTrackEvent=function(T,C,$){var V=typeof T=="string"?{event_type:T}:T;return __assign$2(__assign$2(__assign$2({},V),$),C&&{event_properties:C})},createIdentifyEvent=function(T,C){var $=__assign$2(__assign$2({},C),{event_type:SpecialEventType.IDENTIFY,user_properties:T.getUserProperties()});return $},createGroupIdentifyEvent=function(T,C,$,V){var K,Y=__assign$2(__assign$2({},V),{event_type:SpecialEventType.GROUP_IDENTIFY,group_properties:$.getUserProperties(),groups:(K={},K[T]=C,K)});return Y},createGroupEvent=function(T,C,$){var V,K=new Identify;K.set(T,C);var Y=__assign$2(__assign$2({},$),{event_type:SpecialEventType.IDENTIFY,user_properties:K.getUserProperties(),groups:(V={},V[T]=C,V)});return Y},createRevenueEvent=function(T,C){return __assign$2(__assign$2({},C),{event_type:SpecialEventType.REVENUE,event_properties:T.getEventProperties()})},returnWrapper=function(T){return{promise:T||Promise.resolve()}},AmplitudeCore=function(){function T(C){C===void 0&&(C="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new Timeline(this),this.name=C}return T.prototype._init=function(C){return __awaiter$1(this,void 0,void 0,function(){return __generator$1(this,function($){switch($.label){case 0:return this.config=C,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return $.sent(),[2]}})})},T.prototype.runQueuedFunctions=function(C){return __awaiter$1(this,void 0,void 0,function(){var $,V,K,Y,J,re,ne;return __generator$1(this,function(te){switch(te.label){case 0:$=this[C],this[C]=[],te.label=1;case 1:te.trys.push([1,6,7,8]),V=__values($),K=V.next(),te.label=2;case 2:return K.done?[3,5]:(Y=K.value,[4,Y()]);case 3:te.sent(),te.label=4;case 4:return K=V.next(),[3,2];case 5:return[3,8];case 6:return J=te.sent(),re={error:J},[3,8];case 7:try{K&&!K.done&&(ne=V.return)&&ne.call(V)}finally{if(re)throw re.error}return[7];case 8:return[2]}})})},T.prototype.track=function(C,$,V){var K=createTrackEvent(C,$,V);return returnWrapper(this.dispatch(K))},T.prototype.identify=function(C,$){var V=createIdentifyEvent(C,$);return returnWrapper(this.dispatch(V))},T.prototype.groupIdentify=function(C,$,V,K){var Y=createGroupIdentifyEvent(C,$,V,K);return returnWrapper(this.dispatch(Y))},T.prototype.setGroup=function(C,$,V){var K=createGroupEvent(C,$,V);return returnWrapper(this.dispatch(K))},T.prototype.revenue=function(C,$){var V=createRevenueEvent(C,$);return returnWrapper(this.dispatch(V))},T.prototype.add=function(C){return this.config?returnWrapper(this.timeline.register(C,this.config)):(this.q.push(this.add.bind(this,C)),returnWrapper())},T.prototype.remove=function(C){return this.config?returnWrapper(this.timeline.deregister(C)):(this.q.push(this.remove.bind(this,C)),returnWrapper())},T.prototype.dispatchWithCallback=function(C,$){if(!this.config)return $(buildResult(C,0,CLIENT_NOT_INITIALIZED));this.process(C).then($)},T.prototype.dispatch=function(C){return __awaiter$1(this,void 0,void 0,function(){var $=this;return __generator$1(this,function(V){return this.config?[2,this.process(C)]:[2,new Promise(function(K){$.dispatchQ.push($.dispatchWithCallback.bind($,C,K))})]})})},T.prototype.process=function(C){return __awaiter$1(this,void 0,void 0,function(){var K,$,V,K;return __generator$1(this,function(Y){switch(Y.label){case 0:return Y.trys.push([0,2,,3]),this.config.optOut?[2,buildResult(C,0,OPT_OUT_MESSAGE)]:[4,this.timeline.push(C)];case 1:return K=Y.sent(),K.code===200?this.config.loggerProvider.log(K.message):K.code===100?this.config.loggerProvider.warn(K.message):this.config.loggerProvider.error(K.message),[2,K];case 2:return $=Y.sent(),V=String($),this.config.loggerProvider.error(V),K=buildResult(C,0,V),[2,K];case 3:return[2]}})})},T.prototype.setOptOut=function(C){if(!this.config){this.q.push(this.setOptOut.bind(this,!!C));return}this.config.optOut=!!C},T.prototype.flush=function(){return returnWrapper(this.timeline.flush())},T}(),Revenue=function(){function T(){this.productId="",this.quantity=1,this.price=0}return T.prototype.setProductId=function(C){return this.productId=C,this},T.prototype.setQuantity=function(C){return C>0&&(this.quantity=C),this},T.prototype.setPrice=function(C){return this.price=C,this},T.prototype.setRevenueType=function(C){return this.revenueType=C,this},T.prototype.setRevenue=function(C){return this.revenue=C,this},T.prototype.setEventProperties=function(C){return isValidObject(C)&&(this.properties=C),this},T.prototype.getEventProperties=function(){var C=this.properties?__assign$2({},this.properties):{};return C[RevenueProperty.REVENUE_PRODUCT_ID]=this.productId,C[RevenueProperty.REVENUE_QUANTITY]=this.quantity,C[RevenueProperty.REVENUE_PRICE]=this.price,C[RevenueProperty.REVENUE_TYPE]=this.revenueType,C[RevenueProperty.REVENUE]=this.revenue,C},T}(),chunk=function(T,C){var $=Math.max(C,1);return T.reduce(function(V,K,Y){var J=Math.floor(Y/$);return V[J]||(V[J]=[]),V[J].push(K),V},[])},PREFIX="Amplitude Logger ",Logger=function(){function T(){this.logLevel=LogLevel.None}return T.prototype.disable=function(){this.logLevel=LogLevel.None},T.prototype.enable=function(C){C===void 0&&(C=LogLevel.Warn),this.logLevel=C},T.prototype.log=function(){for(var C=[],$=0;$0&&Promise.all(V.map(function(J){return K.execute(J)})).catch(),[2,Promise.resolve(void 0)]}})})},T.prototype.execute=function(C){var $=this;return new Promise(function(V){var K={event:C,attempts:0,callback:function(Y){return V(Y)},timeout:0};$.addToQueue(K)})},T.prototype.addToQueue=function(){for(var C=this,$=[],V=0;V0&&$.schedule(C)})},C))},T.prototype.flush=function(C){return C===void 0&&(C=!1),__awaiter$1(this,void 0,void 0,function(){var $,V,K,Y=this;return __generator$1(this,function(J){switch(J.label){case 0:return this.config.offline?(this.config.loggerProvider.debug("Skipping flush while offline."),[2]):($=[],V=[],this.queue.forEach(function(re){return re.timeout===0?$.push(re):V.push(re)}),this.queue=V,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),K=chunk($,this.config.flushQueueSize),[4,Promise.all(K.map(function(re){return Y.send(re,C)}))]);case 1:return J.sent(),[2]}})})},T.prototype.send=function(C,$){return $===void 0&&($=!0),__awaiter$1(this,void 0,void 0,function(){var V,K,Y,J,re;return __generator$1(this,function(ne){switch(ne.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(C,400,MISSING_API_KEY_MESSAGE)];V={api_key:this.config.apiKey,events:C.map(function(te){var se=te.event;se.extra;var ie=__rest$14(se,["extra"]);return ie}),options:{min_id_length:this.config.minIdLength},client_upload_time:new Date().toISOString()},ne.label=1;case 1:return ne.trys.push([1,3,,4]),K=createServerConfig(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(K,V)];case 2:return Y=ne.sent(),Y===null?(this.fulfillRequest(C,0,UNEXPECTED_ERROR_MESSAGE),[2]):$?(this.handleResponse(Y,C),[3,4]):("body"in Y?this.fulfillRequest(C,Y.statusCode,"".concat(Y.status,": ").concat(getResponseBodyString(Y))):this.fulfillRequest(C,Y.statusCode,Y.status),[2]);case 3:return J=ne.sent(),re=getErrorMessage(J),this.config.loggerProvider.error(re),this.fulfillRequest(C,0,re),[3,4];case 4:return[2]}})})},T.prototype.handleResponse=function(C,$){var V=C.status;switch(V){case Status$1.Success:{this.handleSuccessResponse(C,$);break}case Status$1.Invalid:{this.handleInvalidResponse(C,$);break}case Status$1.PayloadTooLarge:{this.handlePayloadTooLargeResponse(C,$);break}case Status$1.RateLimit:{this.handleRateLimitResponse(C,$);break}default:{this.config.loggerProvider.warn(`{code: 0, error: "Status '`.concat(V,"' provided for ").concat($.length,' events"}')),this.handleOtherResponse($);break}}},T.prototype.handleSuccessResponse=function(C,$){this.fulfillRequest($,C.statusCode,SUCCESS_MESSAGE)},T.prototype.handleInvalidResponse=function(C,$){var V=this;if(C.body.missingField||C.body.error.startsWith(INVALID_API_KEY)){this.fulfillRequest($,C.statusCode,C.body.error);return}var K=__spreadArray$3(__spreadArray$3(__spreadArray$3(__spreadArray$3([],__read(Object.values(C.body.eventsWithInvalidFields)),!1),__read(Object.values(C.body.eventsWithMissingFields)),!1),__read(Object.values(C.body.eventsWithInvalidIdLengths)),!1),__read(C.body.silencedEvents),!1).flat(),Y=new Set(K),J=$.filter(function(re,ne){if(Y.has(ne)){V.fulfillRequest([re],C.statusCode,C.body.error);return}return!0});J.length>0&&this.config.loggerProvider.warn(getResponseBodyString(C)),this.addToQueue.apply(this,__spreadArray$3([],__read(J),!1))},T.prototype.handlePayloadTooLargeResponse=function(C,$){if($.length===1){this.fulfillRequest($,C.statusCode,C.body.error);return}this.config.loggerProvider.warn(getResponseBodyString(C)),this.config.flushQueueSize/=2,this.addToQueue.apply(this,__spreadArray$3([],__read($),!1))},T.prototype.handleRateLimitResponse=function(C,$){var V=this,K=Object.keys(C.body.exceededDailyQuotaUsers),Y=Object.keys(C.body.exceededDailyQuotaDevices),J=C.body.throttledEvents,re=new Set(K),ne=new Set(Y),te=new Set(J),se=$.filter(function(ie,ae){if(ie.event.user_id&&re.has(ie.event.user_id)||ie.event.device_id&&ne.has(ie.event.device_id)){V.fulfillRequest([ie],C.statusCode,C.body.error);return}return te.has(ae)&&(ie.timeout=V.throttleTimeout),!0});se.length>0&&this.config.loggerProvider.warn(getResponseBodyString(C)),this.addToQueue.apply(this,__spreadArray$3([],__read(se),!1))},T.prototype.handleOtherResponse=function(C){var $=this;this.addToQueue.apply(this,__spreadArray$3([],__read(C.map(function(V){return V.timeout=V.attempts*$.retryTimeout,V})),!1))},T.prototype.fulfillRequest=function(C,$,V){this.saveEvents(),C.forEach(function(K){return K.callback(buildResult(K.event,$,V))})},T.prototype.saveEvents=function(){if(this.config.storageProvider){var C=Array.from(this.queue.map(function($){return $.event}));this.config.storageProvider.set(this.storageKey,C)}},T}(),getStacktrace=function(T){T===void 0&&(T=0);var C=new Error().stack||"";return C.split(`
+`).slice(2+T).map(function($){return $.trim()})},getClientLogConfig=function(T){return function(){var C=__assign$2({},T.config),$=C.loggerProvider,V=C.logLevel;return{logger:$,logLevel:V}}},getValueByStringPath=function(T,C){var $,V;C=C.replace(/\[(\w+)\]/g,".$1"),C=C.replace(/^\./,"");try{for(var K=__values(C.split(".")),Y=K.next();!Y.done;Y=K.next()){var J=Y.value;if(J in T)T=T[J];else return}}catch(re){$={error:re}}finally{try{Y&&!Y.done&&(V=K.return)&&V.call(K)}finally{if($)throw $.error}}return T},getClientStates=function(T,C){return function(){var $,V,K={};try{for(var Y=__values(C),J=Y.next();!J.done;J=Y.next()){var re=J.value;K[re]=getValueByStringPath(T,re)}}catch(ne){$={error:ne}}finally{try{J&&!J.done&&(V=Y.return)&&V.call(Y)}finally{if($)throw $.error}}return K}},debugWrapper=function(T,C,$,V,K){return K===void 0&&(K=null),function(){for(var Y=[],J=0;J=200&&C<300?Status$1.Success:C===429?Status$1.RateLimit:C===413?Status$1.PayloadTooLarge:C===408?Status$1.Timeout:C>=400&&C<500?Status$1.Invalid:C>=500?Status$1.Failed:Status$1.Unknown},T}(),getGlobalScope=function(){if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global},getQueryParams=function(){var T,C=getGlobalScope();if(!(!((T=C==null?void 0:C.location)===null||T===void 0)&&T.search))return{};var $=C.location.search.substring(1).split("&").filter(Boolean),V=$.reduce(function(K,Y){var J=Y.split("=",2),re=tryDecodeURIComponent(J[0]),ne=tryDecodeURIComponent(J[1]);return ne&&(K[re]=ne),K},{});return V},tryDecodeURIComponent=function(T){T===void 0&&(T="");try{return decodeURIComponent(T)}catch{return""}},UTM_CAMPAIGN="utm_campaign",UTM_CONTENT="utm_content",UTM_ID="utm_id",UTM_MEDIUM="utm_medium",UTM_SOURCE="utm_source",UTM_TERM="utm_term",DCLID="dclid",FBCLID="fbclid",GBRAID="gbraid",GCLID="gclid",KO_CLICK_ID="ko_click_id",LI_FAT_ID="li_fat_id",MSCLKID="msclkid",RDT_CID="rtd_cid",TTCLID="ttclid",TWCLID="twclid",WBRAID="wbraid",BASE_CAMPAIGN={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},CampaignParser=function(){function T(){}return T.prototype.parse=function(){return __awaiter$1(this,void 0,void 0,function(){return __generator$1(this,function(C){return[2,__assign$2(__assign$2(__assign$2(__assign$2({},BASE_CAMPAIGN),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},T.prototype.getUtmParam=function(){var C=getQueryParams(),$=C[UTM_CAMPAIGN],V=C[UTM_CONTENT],K=C[UTM_ID],Y=C[UTM_MEDIUM],J=C[UTM_SOURCE],re=C[UTM_TERM];return{utm_campaign:$,utm_content:V,utm_id:K,utm_medium:Y,utm_source:J,utm_term:re}},T.prototype.getReferrer=function(){var C,$,V={referrer:void 0,referring_domain:void 0};try{V.referrer=document.referrer||void 0,V.referring_domain=($=(C=V.referrer)===null||C===void 0?void 0:C.split("/")[2])!==null&&$!==void 0?$:void 0}catch{}return V},T.prototype.getClickIds=function(){var C,$=getQueryParams();return C={},C[DCLID]=$[DCLID],C[FBCLID]=$[FBCLID],C[GBRAID]=$[GBRAID],C[GCLID]=$[GCLID],C[KO_CLICK_ID]=$[KO_CLICK_ID],C[LI_FAT_ID]=$[LI_FAT_ID],C[MSCLKID]=$[MSCLKID],C[RDT_CID]=$[RDT_CID],C[TTCLID]=$[TTCLID],C[TWCLID]=$[TWCLID],C[WBRAID]=$[WBRAID],C},T}(),getCookieName=function(T,C,$){return C===void 0&&(C=""),$===void 0&&($=10),[AMPLITUDE_PREFIX,C,T.substring(0,$)].filter(Boolean).join("_")},getOldCookieName=function(T){return"".concat(AMPLITUDE_PREFIX.toLowerCase(),"_").concat(T.substring(0,6))},isNewSession=function(T,C){C===void 0&&(C=Date.now());var $=Date.now(),V=$-C;return V>T},CookieStorage=function(){function T(C){this.options=__assign$2({},C)}return T.prototype.isEnabled=function(){return __awaiter$1(this,void 0,void 0,function(){var C,$,V;return __generator$1(this,function(K){switch(K.label){case 0:if(!getGlobalScope())return[2,!1];T.testValue=String(Date.now()),C=new T(this.options),$="AMP_TEST",K.label=1;case 1:return K.trys.push([1,4,5,7]),[4,C.set($,T.testValue)];case 2:return K.sent(),[4,C.get($)];case 3:return V=K.sent(),[2,V===T.testValue];case 4:return K.sent(),[2,!1];case 5:return[4,C.remove($)];case 6:return K.sent(),[7];case 7:return[2]}})})},T.prototype.get=function(C){return __awaiter$1(this,void 0,void 0,function(){var $;return __generator$1(this,function(V){switch(V.label){case 0:return[4,this.getRaw(C)];case 1:if($=V.sent(),!$)return[2,void 0];try{try{$=decodeURIComponent(atob($))}catch{}return[2,JSON.parse($)]}catch{return[2,void 0]}return[2]}})})},T.prototype.getRaw=function(C){var $,V;return __awaiter$1(this,void 0,void 0,function(){var K,Y,J;return __generator$1(this,function(re){return K=getGlobalScope(),Y=(V=($=K==null?void 0:K.document)===null||$===void 0?void 0:$.cookie.split("; "))!==null&&V!==void 0?V:[],J=Y.find(function(ne){return ne.indexOf(C+"=")===0}),J?[2,J.substring(C.length+1)]:[2,void 0]})})},T.prototype.set=function(C,$){var V;return __awaiter$1(this,void 0,void 0,function(){var K,Y,J,re,ne,te;return __generator$1(this,function(se){try{K=(V=this.options.expirationDays)!==null&&V!==void 0?V:0,Y=$!==null?K:-1,J=void 0,Y&&(re=new Date,re.setTime(re.getTime()+Y*24*60*60*1e3),J=re),ne="".concat(C,"=").concat(btoa(encodeURIComponent(JSON.stringify($)))),J&&(ne+="; expires=".concat(J.toUTCString())),ne+="; path=/",this.options.domain&&(ne+="; domain=".concat(this.options.domain)),this.options.secure&&(ne+="; Secure"),this.options.sameSite&&(ne+="; SameSite=".concat(this.options.sameSite)),te=getGlobalScope(),te&&(te.document.cookie=ne)}catch{}return[2]})})},T.prototype.remove=function(C){return __awaiter$1(this,void 0,void 0,function(){return __generator$1(this,function($){switch($.label){case 0:return[4,this.set(C,null)];case 1:return $.sent(),[2]}})})},T.prototype.reset=function(){return __awaiter$1(this,void 0,void 0,function(){return __generator$1(this,function(C){return[2]})})},T}(),FetchTransport=function(T){__extends$1(C,T);function C(){return T!==null&&T.apply(this,arguments)||this}return C.prototype.send=function($,V){return __awaiter$1(this,void 0,void 0,function(){var K,Y,J;return __generator$1(this,function(re){switch(re.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return K={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(V),method:"POST"},[4,fetch($,K)];case 1:return Y=re.sent(),[4,Y.json()];case 2:return J=re.sent(),[2,this.buildResponse(J)]}})})},C}(BaseTransport),ApplicationContextProviderImpl=function(){function T(){}return T.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:getLanguage$1(),platform:"Web",os:void 0,deviceModel:void 0}},T}(),getLanguage$1=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},EventBridgeImpl=function(){function T(){this.queue=[]}return T.prototype.logEvent=function(C){this.receiver?this.receiver(C):this.queue.length<512&&this.queue.push(C)},T.prototype.setEventReceiver=function(C){this.receiver=C,this.queue.length>0&&(this.queue.forEach(function($){C($)}),this.queue=[])},T}(),__assign$1=function(){return __assign$1=Object.assign||function(C){for(var $,V=1,K=arguments.length;V"u")return"";var K=navigator.userLanguage;return(V=($=(C=(T=navigator.languages)===null||T===void 0?void 0:T[0])!==null&&C!==void 0?C:navigator.language)!==null&&$!==void 0?$:K)!==null&&V!==void 0?V:""},isTrackingEnabled=function(T,C){return typeof T=="boolean"?T:(T==null?void 0:T[C])!==!1},isAttributionTrackingEnabled=function(T){return isTrackingEnabled(T,"attribution")},isFileDownloadTrackingEnabled=function(T){return isTrackingEnabled(T,"fileDownloads")},isFormInteractionTrackingEnabled=function(T){return isTrackingEnabled(T,"formInteractions")},isPageViewTrackingEnabled=function(T){return isTrackingEnabled(T,"pageViews")},isSessionTrackingEnabled=function(T){return isTrackingEnabled(T,"sessions")},getPageViewTrackingConfig=function(T){var C=function(){return!1},$=void 0,V,K=isPageViewTrackingEnabled(T.defaultTracking);return K&&(C=void 0,V=void 0,T.defaultTracking&&typeof T.defaultTracking=="object"&&T.defaultTracking.pageViews&&typeof T.defaultTracking.pageViews=="object"&&("trackOn"in T.defaultTracking.pageViews&&(C=T.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in T.defaultTracking.pageViews&&($=T.defaultTracking.pageViews.trackHistoryChanges),"eventType"in T.defaultTracking.pageViews&&T.defaultTracking.pageViews.eventType&&(V=T.defaultTracking.pageViews.eventType))),{trackOn:C,trackHistoryChanges:$,eventType:V}},getAttributionTrackingConfig=function(T){return isAttributionTrackingEnabled(T.defaultTracking)&&T.defaultTracking&&typeof T.defaultTracking=="object"&&T.defaultTracking.attribution&&typeof T.defaultTracking.attribution=="object"?__assign$2({},T.defaultTracking.attribution):{}},convertProxyObjectToRealObject=function(T,C){for(var $=0;$MAX_ARRAY_LENGTH?(Y=V.length-MAX_ARRAY_LENGTH,[4,T.prototype.set.call(this,$,V.slice(0,MAX_ARRAY_LENGTH))]):[3,2];case 1:return J.sent(),(K=this.loggerProvider)===null||K===void 0||K.error("Failed to save ".concat(Y," events because the queue length exceeded ").concat(MAX_ARRAY_LENGTH,".")),[3,4];case 2:return[4,T.prototype.set.call(this,$,V)];case 3:J.sent(),J.label=4;case 4:return[2]}})})},C}(BrowserStorage),SessionStorage=function(T){__extends$1(C,T);function C(){var $;return T.call(this,($=getGlobalScope())===null||$===void 0?void 0:$.sessionStorage)||this}return C}(BrowserStorage),XHRTransport=function(T){__extends$1(C,T);function C(){var $=T!==null&&T.apply(this,arguments)||this;return $.state={done:4},$}return C.prototype.send=function($,V){return __awaiter$1(this,void 0,void 0,function(){var K=this;return __generator$1(this,function(Y){return[2,new Promise(function(J,re){typeof XMLHttpRequest>"u"&&re(new Error("XHRTransport is not supported."));var ne=new XMLHttpRequest;ne.open("POST",$,!0),ne.onreadystatechange=function(){if(ne.readyState===K.state.done)try{var te=ne.responseText,se=JSON.parse(te),ie=K.buildResponse(se);J(ie)}catch(ae){re(ae)}},ne.setRequestHeader("Content-Type","application/json"),ne.setRequestHeader("Accept","*/*"),ne.send(JSON.stringify(V))})]})})},C}(BaseTransport),SendBeaconTransport=function(T){__extends$1(C,T);function C(){return T!==null&&T.apply(this,arguments)||this}return C.prototype.send=function($,V){return __awaiter$1(this,void 0,void 0,function(){var K=this;return __generator$1(this,function(Y){return[2,new Promise(function(J,re){var ne=getGlobalScope();if(!(ne!=null&&ne.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var te=JSON.stringify(V),se=ne.navigator.sendBeacon($,JSON.stringify(V));return J(se?K.buildResponse({code:200,events_ingested:V.events.length,payload_size_bytes:te.length,server_upload_time:Date.now()}):K.buildResponse({code:500}))}catch(ie){re(ie)}})]})})},C}(BaseTransport),parseLegacyCookies=function(T,C,$){return $===void 0&&($=!0),__awaiter$1(void 0,void 0,void 0,function(){var V,K,Y,J,re,ne,te,se,ie;return __generator$1(this,function(ae){switch(ae.label){case 0:return V=getOldCookieName(T),[4,C.getRaw(V)];case 1:return K=ae.sent(),K?$?[4,C.remove(V)]:[3,3]:[2,{optOut:!1}];case 2:ae.sent(),ae.label=3;case 3:return Y=__read(K.split("."),6),J=Y[0],re=Y[1],ne=Y[2],te=Y[3],se=Y[4],ie=Y[5],[2,{deviceId:J,userId:decode(re),sessionId:parseTime(te),lastEventId:parseTime(ie),lastEventTime:parseTime(se),optOut:!!ne}]}})})},parseTime=function(T){var C=parseInt(T,32);if(!isNaN(C))return C},decode=function(T){if(!(!atob||!escape||!T))try{return decodeURIComponent(escape(atob(T)))}catch{return}},DEFAULT_EVENT_PREFIX="[Amplitude]",DEFAULT_FORM_START_EVENT="".concat(DEFAULT_EVENT_PREFIX," Form Started"),DEFAULT_FORM_SUBMIT_EVENT="".concat(DEFAULT_EVENT_PREFIX," Form Submitted"),DEFAULT_FILE_DOWNLOAD_EVENT="".concat(DEFAULT_EVENT_PREFIX," File Downloaded"),DEFAULT_SESSION_START_EVENT="session_start",DEFAULT_SESSION_END_EVENT="session_end",FILE_EXTENSION="".concat(DEFAULT_EVENT_PREFIX," File Extension"),FILE_NAME="".concat(DEFAULT_EVENT_PREFIX," File Name"),LINK_ID="".concat(DEFAULT_EVENT_PREFIX," Link ID"),LINK_TEXT="".concat(DEFAULT_EVENT_PREFIX," Link Text"),LINK_URL="".concat(DEFAULT_EVENT_PREFIX," Link URL"),FORM_ID="".concat(DEFAULT_EVENT_PREFIX," Form ID"),FORM_NAME="".concat(DEFAULT_EVENT_PREFIX," Form Name"),FORM_DESTINATION="".concat(DEFAULT_EVENT_PREFIX," Form Destination"),DEFAULT_IDENTITY_STORAGE="cookie",DEFAULT_SERVER_ZONE="US",BrowserConfig=function(T){__extends$1(C,T);function C($,V,K,Y,J,re,ne,te,se,ie,ae,oe,le,ce,de,he,me,ge,ye,fe,Te,Pe,De,xe,Ce,je,Le,Ke,Se,Ie){K===void 0&&(K=new MemoryStorage),Y===void 0&&(Y={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),ne===void 0&&(ne=1e3),te===void 0&&(te=5),se===void 0&&(se=30),ie===void 0&&(ie=DEFAULT_IDENTITY_STORAGE),de===void 0&&(de=new Logger),he===void 0&&(he=LogLevel.Warn),ge===void 0&&(ge=!1),ye===void 0&&(ye=!1),Pe===void 0&&(Pe=""),De===void 0&&(De=DEFAULT_SERVER_ZONE),Ce===void 0&&(Ce=30*60*1e3),je===void 0&&(je=new LocalStorage({loggerProvider:de})),Le===void 0&&(Le={ipAddress:!0,language:!0,platform:!0}),Ke===void 0&&(Ke="fetch"),Se===void 0&&(Se=!1);var Ne=T.call(this,{apiKey:$,storageProvider:je,transportProvider:createTransport(Ke)})||this;return Ne.apiKey=$,Ne.appVersion=V,Ne.cookieOptions=Y,Ne.defaultTracking=J,Ne.flushIntervalMillis=ne,Ne.flushMaxRetries=te,Ne.flushQueueSize=se,Ne.identityStorage=ie,Ne.ingestionMetadata=ae,Ne.instanceName=oe,Ne.loggerProvider=de,Ne.logLevel=he,Ne.minIdLength=me,Ne.offline=ge,Ne.partnerId=fe,Ne.plan=Te,Ne.serverUrl=Pe,Ne.serverZone=De,Ne.sessionTimeout=Ce,Ne.storageProvider=je,Ne.trackingOptions=Le,Ne.transport=Ke,Ne.useBatch=Se,Ne._optOut=!1,Ne._cookieStorage=K,Ne.deviceId=re,Ne.lastEventId=le,Ne.lastEventTime=ce,Ne.optOut=ye,Ne.sessionId=xe,Ne.userId=Ie,Ne.loggerProvider.enable(Ne.logLevel),Ne}return Object.defineProperty(C.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function($){this._cookieStorage!==$&&(this._cookieStorage=$,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"deviceId",{get:function(){return this._deviceId},set:function($){this._deviceId!==$&&(this._deviceId=$,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"userId",{get:function(){return this._userId},set:function($){this._userId!==$&&(this._userId=$,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"sessionId",{get:function(){return this._sessionId},set:function($){this._sessionId!==$&&(this._sessionId=$,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"optOut",{get:function(){return this._optOut},set:function($){this._optOut!==$&&(this._optOut=$,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function($){this._lastEventTime!==$&&(this._lastEventTime=$,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function($){this._lastEventId!==$&&(this._lastEventId=$,this.updateStorage())},enumerable:!1,configurable:!0}),C.prototype.updateStorage=function(){var $={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId};this.cookieStorage.set(getCookieName(this.apiKey),$)},C}(Config),useBrowserConfig=function(T,C,$){return C===void 0&&(C={}),__awaiter$1(void 0,void 0,void 0,function(){var V,K,Y,J,re,ne,te,se,ie,ae,oe,le,ce,de,he,me,ge,ye,fe,Te,Pe,De,xe,Ce,je,Le,Ke,Se,Ie,Ne,pt,at,dt,Ct,ut,bt,Re,ue,be;return __generator$1(this,function(ve){switch(ve.label){case 0:return V=C.identityStorage||DEFAULT_IDENTITY_STORAGE,me={},V===DEFAULT_IDENTITY_STORAGE?[3,1]:(Y="",[3,5]);case 1:return(ye=(ge=C.cookieOptions)===null||ge===void 0?void 0:ge.domain)!==null&&ye!==void 0?(J=ye,[3,4]):[3,2];case 2:return[4,getTopLevelDomain()];case 3:J=ve.sent(),ve.label=4;case 4:Y=J,ve.label=5;case 5:return K=__assign$2.apply(void 0,[(me.domain=Y,me.expiration=365,me.sameSite="Lax",me.secure=!1,me.upgrade=!0,me),C.cookieOptions]),re=createCookieStorage(C.identityStorage,K),[4,parseLegacyCookies(T,re,(Te=(fe=C.cookieOptions)===null||fe===void 0?void 0:fe.upgrade)!==null&&Te!==void 0?Te:!0)];case 6:return ne=ve.sent(),[4,re.get(getCookieName(T))];case 7:return te=ve.sent(),se=getQueryParams(),ie=(Ce=(xe=(De=(Pe=C.deviceId)!==null&&Pe!==void 0?Pe:se.deviceId)!==null&&De!==void 0?De:te==null?void 0:te.deviceId)!==null&&xe!==void 0?xe:ne.deviceId)!==null&&Ce!==void 0?Ce:UUID(),ae=(je=te==null?void 0:te.lastEventId)!==null&&je!==void 0?je:ne.lastEventId,oe=(Le=te==null?void 0:te.lastEventTime)!==null&&Le!==void 0?Le:ne.lastEventTime,le=(Se=(Ke=C.optOut)!==null&&Ke!==void 0?Ke:te==null?void 0:te.optOut)!==null&&Se!==void 0?Se:ne.optOut,ce=(Ie=te==null?void 0:te.sessionId)!==null&&Ie!==void 0?Ie:ne.sessionId,de=(pt=(Ne=C.userId)!==null&&Ne!==void 0?Ne:te==null?void 0:te.userId)!==null&&pt!==void 0?pt:ne.userId,$.previousSessionDeviceId=(at=te==null?void 0:te.deviceId)!==null&&at!==void 0?at:ne.deviceId,$.previousSessionUserId=(dt=te==null?void 0:te.userId)!==null&&dt!==void 0?dt:ne.userId,he={ipAddress:(ut=(Ct=C.trackingOptions)===null||Ct===void 0?void 0:Ct.ipAddress)!==null&&ut!==void 0?ut:!0,language:(Re=(bt=C.trackingOptions)===null||bt===void 0?void 0:bt.language)!==null&&Re!==void 0?Re:!0,platform:(be=(ue=C.trackingOptions)===null||ue===void 0?void 0:ue.platform)!==null&&be!==void 0?be:!0},[2,new BrowserConfig(T,C.appVersion,re,K,C.defaultTracking,ie,C.flushIntervalMillis,C.flushMaxRetries,C.flushQueueSize,V,C.ingestionMetadata,C.instanceName,ae,oe,C.loggerProvider,C.logLevel,C.minIdLength,C.offline,le,C.partnerId,C.plan,C.serverUrl,C.serverZone,ce,C.sessionTimeout,C.storageProvider,he,C.transport,C.useBatch,de)]}})})},createCookieStorage=function(T,C){switch(T===void 0&&(T=DEFAULT_IDENTITY_STORAGE),C===void 0&&(C={}),T){case"localStorage":return new LocalStorage;case"sessionStorage":return new SessionStorage;case"none":return new MemoryStorage;case"cookie":default:return new CookieStorage(__assign$2(__assign$2({},C),{expirationDays:C.expiration}))}},createTransport=function(T){return T==="xhr"?new XHRTransport:T==="beacon"?new SendBeaconTransport:new FetchTransport},getTopLevelDomain=function(T){return __awaiter$1(void 0,void 0,void 0,function(){var C,$,V,K,Y,Y,J,re,ne,te;return __generator$1(this,function(se){switch(se.label){case 0:return[4,new CookieStorage().isEnabled()];case 1:if(!se.sent()||!T&&typeof location>"u")return[2,""];for(C=T??location.hostname,$=C.split("."),V=[],K="AMP_TLDTEST",Y=$.length-2;Y>=0;--Y)V.push($.slice(Y).join("."));Y=0,se.label=2;case 2:return Y"u"||typeof T.trackOn=="function"&&T.trackOn()},re=typeof location<"u"?location.href:null,ne=function(){return __awaiter$1(void 0,void 0,void 0,function(){var ie,ae,oe,le;return __generator$1(this,function(ce){switch(ce.label){case 0:return ie=location.href,ae=shouldTrackHistoryPageView(T.trackHistoryChanges,ie,re||"")&&J(),re=ie,ae?(V==null||V.log("Tracking page view event"),C!=null?[3,1]:[3,3]):[3,4];case 1:return le=(oe=C).track,[4,Y()];case 2:le.apply(oe,[ce.sent()]),ce.label=3;case 3:ce.label=4;case 4:return[2]}})})},te=function(){ne()},se={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(ie,ae){return __awaiter$1(void 0,void 0,void 0,function(){var oe,le;return __generator$1(this,function(ce){switch(ce.label){case 0:return C=ae,V=ie.loggerProvider,V.log("Installing @amplitude/plugin-page-view-tracking-browser"),$&&($.addEventListener("popstate",te),K=$.history.pushState,$.history.pushState=new Proxy($.history.pushState,{apply:function(de,he,me){var ge=__read(me,3),ye=ge[0],fe=ge[1],Te=ge[2];de.apply(he,[ye,fe,Te]),ne()}})),J()?(V.log("Tracking page view event"),le=(oe=C).track,[4,Y()]):[3,2];case 1:le.apply(oe,[ce.sent()]),ce.label=2;case 2:return[2]}})})},execute:function(ie){return __awaiter$1(void 0,void 0,void 0,function(){var ae;return __generator$1(this,function(oe){switch(oe.label){case 0:return T.trackOn==="attribution"&&isCampaignEvent(ie)?(V==null||V.log("Enriching campaign event to page view event with campaign parameters"),[4,Y()]):[3,2];case 1:ae=oe.sent(),ie.event_type=ae.event_type,ie.event_properties=__assign$2(__assign$2({},ie.event_properties),ae.event_properties),oe.label=2;case 2:return[2,ie]}})})},teardown:function(){return __awaiter$1(void 0,void 0,void 0,function(){return __generator$1(this,function(ie){return $&&($.removeEventListener("popstate",te),K&&($.history.pushState=K)),[2]})})}};return se},getCampaignParams=function(){return __awaiter$1(void 0,void 0,void 0,function(){var T;return __generator$1(this,function(C){switch(C.label){case 0:return T=omitUndefined,[4,new CampaignParser().parse()];case 1:return[2,T.apply(void 0,[C.sent()])]}})})},isCampaignEvent=function(T){if(T.event_type==="$identify"&&T.user_properties){var C=T.user_properties,$=C[IdentifyOperation.SET]||{},V=C[IdentifyOperation.UNSET]||{},K=__spreadArray$3(__spreadArray$3([],__read(Object.keys($)),!1),__read(Object.keys(V)),!1);return Object.keys(BASE_CAMPAIGN).every(function(Y){return K.includes(Y)})}return!1},shouldTrackHistoryPageView=function(T,C,$){switch(T){case"pathOnly":return C.split("?")[0]!==$.split("?")[0];default:return C!==$}},formInteractionTracking=function(){var T,C=[],$=function(te,se,ie){te.addEventListener(se,ie),C.push({element:te,type:se,handler:ie})},V=function(){C.forEach(function(te){var se=te.element,ie=te.type,ae=te.handler;se==null||se.removeEventListener(ie,ae)}),C=[]},K="@amplitude/plugin-form-interaction-tracking-browser",Y="enrichment",J=function(te,se){return __awaiter$1(void 0,void 0,void 0,function(){var ie,ae;return __generator$1(this,function(oe){return se?typeof document>"u"?[2]:(ie=function(le){var ce=!1;$(le,"change",function(){var de;ce||se.track(DEFAULT_FORM_START_EVENT,(de={},de[FORM_ID]=stringOrUndefined(le.id),de[FORM_NAME]=stringOrUndefined(le.name),de[FORM_DESTINATION]=le.action,de)),ce=!0}),$(le,"submit",function(){var de,he;ce||se.track(DEFAULT_FORM_START_EVENT,(de={},de[FORM_ID]=stringOrUndefined(le.id),de[FORM_NAME]=stringOrUndefined(le.name),de[FORM_DESTINATION]=le.action,de)),se.track(DEFAULT_FORM_SUBMIT_EVENT,(he={},he[FORM_ID]=stringOrUndefined(le.id),he[FORM_NAME]=stringOrUndefined(le.name),he[FORM_DESTINATION]=le.action,he)),ce=!1})},ae=Array.from(document.getElementsByTagName("form")),ae.forEach(ie),typeof MutationObserver<"u"&&(T=new MutationObserver(function(le){le.forEach(function(ce){ce.addedNodes.forEach(function(de){de.nodeName==="FORM"&&ie(de),"querySelectorAll"in de&&typeof de.querySelectorAll=="function"&&Array.from(de.querySelectorAll("form")).map(ie)})})}),T.observe(document.body,{subtree:!0,childList:!0})),[2]):(te.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked."),[2])})})},re=function(te){return __awaiter$1(void 0,void 0,void 0,function(){return __generator$1(this,function(se){return[2,te]})})},ne=function(){return __awaiter$1(void 0,void 0,void 0,function(){return __generator$1(this,function(te){return T==null||T.disconnect(),V(),[2]})})};return{name:K,type:Y,setup:J,execute:re,teardown:ne}},stringOrUndefined=function(T){if(typeof T=="string")return T},fileDownloadTracking=function(){var T,C=[],$=function(te,se,ie){te.addEventListener(se,ie),C.push({element:te,type:se,handler:ie})},V=function(){C.forEach(function(te){var se=te.element,ie=te.type,ae=te.handler;se==null||se.removeEventListener(ie,ae)}),C=[]},K="@amplitude/plugin-file-download-tracking-browser",Y="enrichment",J=function(te,se){return __awaiter$1(void 0,void 0,void 0,function(){var ie,ae,oe;return __generator$1(this,function(le){return se?typeof document>"u"?[2]:(ie=function(ce){var de;try{de=new URL(ce.href,window.location.href)}catch{return}var he=ae.exec(de.href),me=he==null?void 0:he[1];me&&$(ce,"click",function(){var ge;me&&se.track(DEFAULT_FILE_DOWNLOAD_EVENT,(ge={},ge[FILE_EXTENSION]=me,ge[FILE_NAME]=de.pathname,ge[LINK_ID]=ce.id,ge[LINK_TEXT]=ce.text,ge[LINK_URL]=ce.href,ge))})},ae=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)$/,oe=Array.from(document.getElementsByTagName("a")),oe.forEach(ie),typeof MutationObserver<"u"&&(T=new MutationObserver(function(ce){ce.forEach(function(de){de.addedNodes.forEach(function(he){he.nodeName==="A"&&ie(he),"querySelectorAll"in he&&typeof he.querySelectorAll=="function"&&Array.from(he.querySelectorAll("a")).map(ie)})})}),T.observe(document.body,{subtree:!0,childList:!0})),[2]):(te.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked."),[2])})})},re=function(te){return __awaiter$1(void 0,void 0,void 0,function(){return __generator$1(this,function(se){return[2,te]})})},ne=function(){return __awaiter$1(void 0,void 0,void 0,function(){return __generator$1(this,function(te){return T==null||T.disconnect(),V(),[2]})})};return{name:K,type:Y,setup:J,execute:re,teardown:ne}},notified=!1,detNotify=function(T){if(!(notified||T.defaultTracking!==void 0)){var C=`\`options.defaultTracking\` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to \`options.defaultTracking\`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:
+
+amplitude.init(, {
+ defaultTracking: true,
+});
+
+Visit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details.`;T.loggerProvider.warn(C),notified=!0}},networkConnectivityCheckerPlugin=function(){var T="@amplitude/plugin-network-checker-browser",C="before",$=getGlobalScope(),V=[],K=function(ne,te){$&&($.addEventListener(ne,te),V.push({type:ne,handler:te}))},Y=function(){V.forEach(function(ne){var te=ne.type,se=ne.handler;$&&$.removeEventListener(te,se)}),V=[]},J=function(ne,te){return __awaiter$1(void 0,void 0,void 0,function(){return __generator$1(this,function(se){return ne.offline=!navigator.onLine,K("online",function(){ne.loggerProvider.debug("Network connectivity changed to online."),ne.offline=!1,setTimeout(function(){te.flush()},ne.flushIntervalMillis)}),K("offline",function(){ne.loggerProvider.debug("Network connectivity changed to offline."),ne.offline=!0}),[2]})})},re=function(){return __awaiter$1(void 0,void 0,void 0,function(){return __generator$1(this,function(ne){return Y(),[2]})})};return{name:T,type:C,setup:J,teardown:re}},AmplitudeBrowser=function(T){__extends$1(C,T);function C(){return T!==null&&T.apply(this,arguments)||this}return C.prototype.init=function($,V,K){$===void 0&&($="");var Y,J;return arguments.length>2?(Y=V,J=K):typeof V=="string"?(Y=V,J=void 0):(Y=V==null?void 0:V.userId,J=V),returnWrapper(this._init(__assign$2(__assign$2({},J),{userId:Y,apiKey:$})))},C.prototype._init=function($){var V,K;return __awaiter$1(this,void 0,void 0,function(){var Y,J,re,ne,te=this;return __generator$1(this,function(se){switch(se.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,useBrowserConfig($.apiKey,$,this)]);case 1:return Y=se.sent(),[4,T.prototype._init.call(this,Y)];case 2:return se.sent(),this.setSessionId((K=(V=$.sessionId)!==null&&V!==void 0?V:this.config.sessionId)!==null&&K!==void 0?K:Date.now()),J=getAnalyticsConnector($.instanceName),J.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===OfflineDisabled?[3,4]:[4,this.add(networkConnectivityCheckerPlugin()).promise];case 3:se.sent(),se.label=4;case 4:return[4,this.add(new Destination).promise];case 5:return se.sent(),[4,this.add(new Context).promise];case 6:return se.sent(),[4,this.add(new IdentityEventSender).promise];case 7:return se.sent(),detNotify(this.config),isFileDownloadTrackingEnabled(this.config.defaultTracking)?[4,this.add(fileDownloadTracking()).promise]:[3,9];case 8:se.sent(),se.label=9;case 9:return isFormInteractionTrackingEnabled(this.config.defaultTracking)?[4,this.add(formInteractionTracking()).promise]:[3,11];case 10:se.sent(),se.label=11;case 11:return isAttributionTrackingEnabled(this.config.defaultTracking)?(re=getAttributionTrackingConfig(this.config),ne=webAttributionPlugin(re),[4,this.add(ne).promise]):[3,13];case 12:se.sent(),se.label=13;case 13:return[4,this.add(pageViewTrackingPlugin(getPageViewTrackingConfig(this.config))).promise];case 14:return se.sent(),this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 15:return se.sent(),J.eventBridge.setEventReceiver(function(ie){te.track(ie.eventType,ie.eventProperties)}),[2]}})})},C.prototype.getUserId=function(){var $;return($=this.config)===null||$===void 0?void 0:$.userId},C.prototype.setUserId=function($){if(!this.config){this.q.push(this.setUserId.bind(this,$));return}($!==this.config.userId||$===void 0)&&(this.config.userId=$,setConnectorUserId($,this.config.instanceName))},C.prototype.getDeviceId=function(){var $;return($=this.config)===null||$===void 0?void 0:$.deviceId},C.prototype.setDeviceId=function($){if(!this.config){this.q.push(this.setDeviceId.bind(this,$));return}this.config.deviceId=$,setConnectorDeviceId($,this.config.instanceName)},C.prototype.reset=function(){this.setDeviceId(UUID()),this.setUserId(void 0)},C.prototype.getSessionId=function(){var $;return($=this.config)===null||$===void 0?void 0:$.sessionId},C.prototype.setSessionId=function($){var V;if(!this.config){this.q.push(this.setSessionId.bind(this,$));return}if($!==this.config.sessionId){var K=this.getSessionId(),Y=this.config.lastEventTime,J=(V=this.config.lastEventId)!==null&&V!==void 0?V:-1;this.config.sessionId=$,this.config.lastEventTime=void 0,isSessionTrackingEnabled(this.config.defaultTracking)&&(K&&Y&&this.track(DEFAULT_SESSION_END_EVENT,void 0,{device_id:this.previousSessionDeviceId,event_id:++J,session_id:K,time:Y+1,user_id:this.previousSessionUserId}),this.config.lastEventTime=this.config.sessionId,this.track(DEFAULT_SESSION_START_EVENT,void 0,{event_id:++J,session_id:this.config.sessionId,time:this.config.lastEventTime})),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId}},C.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},C.prototype.setTransport=function($){if(!this.config){this.q.push(this.setTransport.bind(this,$));return}this.config.transportProvider=createTransport($)},C.prototype.identify=function($,V){if(isInstanceProxy($)){var K=$._q;$._q=[],$=convertProxyObjectToRealObject(new Identify,K)}return V!=null&&V.user_id&&this.setUserId(V.user_id),V!=null&&V.device_id&&this.setDeviceId(V.device_id),T.prototype.identify.call(this,$,V)},C.prototype.groupIdentify=function($,V,K,Y){if(isInstanceProxy(K)){var J=K._q;K._q=[],K=convertProxyObjectToRealObject(new Identify,J)}return T.prototype.groupIdentify.call(this,$,V,K,Y)},C.prototype.revenue=function($,V){if(isInstanceProxy($)){var K=$._q;$._q=[],$=convertProxyObjectToRealObject(new Revenue,K)}return T.prototype.revenue.call(this,$,V)},C.prototype.process=function($){return __awaiter$1(this,void 0,void 0,function(){var V,K;return __generator$1(this,function(Y){return V=Date.now(),K=isNewSession(this.config.sessionTimeout,this.config.lastEventTime),$.event_type!==DEFAULT_SESSION_START_EVENT&&$.event_type!==DEFAULT_SESSION_END_EVENT&&(!$.session_id||$.session_id===this.getSessionId())&&K&&this.setSessionId(V),[2,T.prototype.process.call(this,$)]})})},C}(AmplitudeCore),createInstance=function(){var T=new AmplitudeBrowser;return{init:debugWrapper(T.init.bind(T),"init",getClientLogConfig(T),getClientStates(T,["config"])),add:debugWrapper(T.add.bind(T),"add",getClientLogConfig(T),getClientStates(T,["config.apiKey","timeline.plugins"])),remove:debugWrapper(T.remove.bind(T),"remove",getClientLogConfig(T),getClientStates(T,["config.apiKey","timeline.plugins"])),track:debugWrapper(T.track.bind(T),"track",getClientLogConfig(T),getClientStates(T,["config.apiKey","timeline.queue.length"])),logEvent:debugWrapper(T.logEvent.bind(T),"logEvent",getClientLogConfig(T),getClientStates(T,["config.apiKey","timeline.queue.length"])),identify:debugWrapper(T.identify.bind(T),"identify",getClientLogConfig(T),getClientStates(T,["config.apiKey","timeline.queue.length"])),groupIdentify:debugWrapper(T.groupIdentify.bind(T),"groupIdentify",getClientLogConfig(T),getClientStates(T,["config.apiKey","timeline.queue.length"])),setGroup:debugWrapper(T.setGroup.bind(T),"setGroup",getClientLogConfig(T),getClientStates(T,["config.apiKey","timeline.queue.length"])),revenue:debugWrapper(T.revenue.bind(T),"revenue",getClientLogConfig(T),getClientStates(T,["config.apiKey","timeline.queue.length"])),flush:debugWrapper(T.flush.bind(T),"flush",getClientLogConfig(T),getClientStates(T,["config.apiKey","timeline.queue.length"])),getUserId:debugWrapper(T.getUserId.bind(T),"getUserId",getClientLogConfig(T),getClientStates(T,["config","config.userId"])),setUserId:debugWrapper(T.setUserId.bind(T),"setUserId",getClientLogConfig(T),getClientStates(T,["config","config.userId"])),getDeviceId:debugWrapper(T.getDeviceId.bind(T),"getDeviceId",getClientLogConfig(T),getClientStates(T,["config","config.deviceId"])),setDeviceId:debugWrapper(T.setDeviceId.bind(T),"setDeviceId",getClientLogConfig(T),getClientStates(T,["config","config.deviceId"])),reset:debugWrapper(T.reset.bind(T),"reset",getClientLogConfig(T),getClientStates(T,["config","config.userId","config.deviceId"])),getSessionId:debugWrapper(T.getSessionId.bind(T),"getSessionId",getClientLogConfig(T),getClientStates(T,["config"])),setSessionId:debugWrapper(T.setSessionId.bind(T),"setSessionId",getClientLogConfig(T),getClientStates(T,["config"])),extendSession:debugWrapper(T.extendSession.bind(T),"extendSession",getClientLogConfig(T),getClientStates(T,["config"])),setOptOut:debugWrapper(T.setOptOut.bind(T),"setOptOut",getClientLogConfig(T),getClientStates(T,["config"])),setTransport:debugWrapper(T.setTransport.bind(T),"setTransport",getClientLogConfig(T),getClientStates(T,["config"]))}};const client=createInstance();client.add;client.extendSession;client.flush;client.getDeviceId;client.getSessionId;client.getUserId;client.groupIdentify;client.identify;client.init;client.logEvent;client.remove;client.reset;client.revenue;client.setDeviceId;client.setGroup;client.setOptOut;client.setSessionId;client.setTransport;client.setUserId;var track=client.track;async function logAmplitudeEvent(T,C){try{track(T.name,{..."data"in T?T.data:{},...C,app:"aktivitetsplan"})}catch($){console.error($)}}function logKlikkKnapp(T){return logAmplitudeEvent({name:"knapp klikket",data:{tekst:T}})}function logAccordionAapnet(T){return logAmplitudeEvent({name:"accordion åpnet",data:{tekst:T}})}function logValgtFilter(T){return logAmplitudeEvent({name:"filtervalg",data:{filternavn:T}})}function logToggleSpraksjekkToggle(T){return logAmplitudeEvent({name:"toggle",data:{text:"Slå på klarspråkhjelp",enabled:T}})}function logReferatFullfort(T,C,$){const V=mapSpraksjekkAnalysis(T);return logAmplitudeEvent({name:"referat lagret",data:{analysis:V,referatPublisert:C,spraksjekkEnabled:$}},{variant:"D"})}function logModalLukket({isDirty:T,aktivitet:C,modalType:$,navType:V}){return logAmplitudeEvent({name:"modal lukket",data:{isDirty:T,aktivitet:C.toLocaleLowerCase(),modalType:$,navType:V}})}function mapSpraksjekkAnalysis(T){return{longParagraphs:T.longParagraphs.length,longSentences:T.longSentences.length,longWords:T.longWords.length,duplicateWords:T.duplicateWords.length,kansellisten:T.kansellisten.length,nrkOrd:T.nrkOrd.length,avloeserord:T.avloeserord.avloeserordMatches.length+T.avloeserord.datatermerMatches.length,comma:T.comma,personalData:{emails:T.personalData.emails.length,names:T.personalData.names.length,phonenumbers:T.personalData.phonenumbers.length},tools:{lix:T.tools.lix,wordCount:T.tools.wordCount}}}/**
+ * @remix-run/router v1.15.0
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function _extends$5(){return _extends$5=Object.assign?Object.assign.bind():function(T){for(var C=1;C"u")throw new Error(C)}function warning$2(T,C){if(!T){typeof console<"u"&&console.warn(C);try{throw new Error(C)}catch{}}}function createKey(){return Math.random().toString(36).substr(2,8)}function getHistoryState(T,C){return{usr:T.state,key:T.key,idx:C}}function createLocation(T,C,$,V){return $===void 0&&($=null),_extends$5({pathname:typeof T=="string"?T:T.pathname,search:"",hash:""},typeof C=="string"?parsePath(C):C,{state:$,key:C&&C.key||V||createKey()})}function createPath(T){let{pathname:C="/",search:$="",hash:V=""}=T;return $&&$!=="?"&&(C+=$.charAt(0)==="?"?$:"?"+$),V&&V!=="#"&&(C+=V.charAt(0)==="#"?V:"#"+V),C}function parsePath(T){let C={};if(T){let $=T.indexOf("#");$>=0&&(C.hash=T.substr($),T=T.substr(0,$));let V=T.indexOf("?");V>=0&&(C.search=T.substr(V),T=T.substr(0,V)),T&&(C.pathname=T)}return C}function getUrlBasedHistory(T,C,$,V){V===void 0&&(V={});let{window:K=document.defaultView,v5Compat:Y=!1}=V,J=K.history,re=Action.Pop,ne=null,te=se();te==null&&(te=0,J.replaceState(_extends$5({},J.state,{idx:te}),""));function se(){return(J.state||{idx:null}).idx}function ie(){re=Action.Pop;let de=se(),he=de==null?null:de-te;te=de,ne&&ne({action:re,location:ce.location,delta:he})}function ae(de,he){re=Action.Push;let me=createLocation(ce.location,de,he);$&&$(me,de),te=se()+1;let ge=getHistoryState(me,te),ye=ce.createHref(me);try{J.pushState(ge,"",ye)}catch(fe){if(fe instanceof DOMException&&fe.name==="DataCloneError")throw fe;K.location.assign(ye)}Y&&ne&&ne({action:re,location:ce.location,delta:1})}function oe(de,he){re=Action.Replace;let me=createLocation(ce.location,de,he);$&&$(me,de),te=se();let ge=getHistoryState(me,te),ye=ce.createHref(me);J.replaceState(ge,"",ye),Y&&ne&&ne({action:re,location:ce.location,delta:0})}function le(de){let he=K.location.origin!=="null"?K.location.origin:K.location.href,me=typeof de=="string"?de:createPath(de);return invariant$2(he,"No window.location.(origin|href) available to create URL for href: "+me),new URL(me,he)}let ce={get action(){return re},get location(){return T(K,J)},listen(de){if(ne)throw new Error("A history only accepts one active listener");return K.addEventListener(PopStateEventType,ie),ne=de,()=>{K.removeEventListener(PopStateEventType,ie),ne=null}},createHref(de){return C(K,de)},createURL:le,encodeLocation(de){let he=le(de);return{pathname:he.pathname,search:he.search,hash:he.hash}},push:ae,replace:oe,go(de){return J.go(de)}};return ce}var ResultType;(function(T){T.data="data",T.deferred="deferred",T.redirect="redirect",T.error="error"})(ResultType||(ResultType={}));function matchRoutes(T,C,$){$===void 0&&($="/");let V=typeof C=="string"?parsePath(C):C,K=stripBasename(V.pathname||"/",$);if(K==null)return null;let Y=flattenRoutes(T);rankRouteBranches(Y);let J=null;for(let re=0;J==null&&re{let ne={relativePath:re===void 0?Y.path||"":re,caseSensitive:Y.caseSensitive===!0,childrenIndex:J,route:Y};ne.relativePath.startsWith("/")&&(invariant$2(ne.relativePath.startsWith(V),'Absolute route path "'+ne.relativePath+'" nested under path '+('"'+V+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),ne.relativePath=ne.relativePath.slice(V.length));let te=joinPaths([V,ne.relativePath]),se=$.concat(ne);Y.children&&Y.children.length>0&&(invariant$2(Y.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+te+'".')),flattenRoutes(Y.children,C,se,te)),!(Y.path==null&&!Y.index)&&C.push({path:te,score:computeScore(te,Y.index),routesMeta:se})};return T.forEach((Y,J)=>{var re;if(Y.path===""||!((re=Y.path)!=null&&re.includes("?")))K(Y,J);else for(let ne of explodeOptionalSegments(Y.path))K(Y,J,ne)}),C}function explodeOptionalSegments(T){let C=T.split("/");if(C.length===0)return[];let[$,...V]=C,K=$.endsWith("?"),Y=$.replace(/\?$/,"");if(V.length===0)return K?[Y,""]:[Y];let J=explodeOptionalSegments(V.join("/")),re=[];return re.push(...J.map(ne=>ne===""?Y:[Y,ne].join("/"))),K&&re.push(...J),re.map(ne=>T.startsWith("/")&&ne===""?"/":ne)}function rankRouteBranches(T){T.sort((C,$)=>C.score!==$.score?$.score-C.score:compareIndexes(C.routesMeta.map(V=>V.childrenIndex),$.routesMeta.map(V=>V.childrenIndex)))}const paramRe=/^:[\w-]+$/,dynamicSegmentValue=3,indexRouteValue=2,emptySegmentValue=1,staticSegmentValue=10,splatPenalty=-2,isSplat=T=>T==="*";function computeScore(T,C){let $=T.split("/"),V=$.length;return $.some(isSplat)&&(V+=splatPenalty),C&&(V+=indexRouteValue),$.filter(K=>!isSplat(K)).reduce((K,Y)=>K+(paramRe.test(Y)?dynamicSegmentValue:Y===""?emptySegmentValue:staticSegmentValue),V)}function compareIndexes(T,C){return T.length===C.length&&T.slice(0,-1).every((V,K)=>V===C[K])?T[T.length-1]-C[C.length-1]:0}function matchRouteBranch(T,C){let{routesMeta:$}=T,V={},K="/",Y=[];for(let J=0;J<$.length;++J){let re=$[J],ne=J===$.length-1,te=K==="/"?C:C.slice(K.length)||"/",se=matchPath({path:re.relativePath,caseSensitive:re.caseSensitive,end:ne},te);if(!se)return null;Object.assign(V,se.params);let ie=re.route;Y.push({params:V,pathname:joinPaths([K,se.pathname]),pathnameBase:normalizePathname(joinPaths([K,se.pathnameBase])),route:ie}),se.pathnameBase!=="/"&&(K=joinPaths([K,se.pathnameBase]))}return Y}function matchPath(T,C){typeof T=="string"&&(T={path:T,caseSensitive:!1,end:!0});let[$,V]=compilePath(T.path,T.caseSensitive,T.end),K=C.match($);if(!K)return null;let Y=K[0],J=Y.replace(/(.)\/+$/,"$1"),re=K.slice(1);return{params:V.reduce((te,se,ie)=>{let{paramName:ae,isOptional:oe}=se;if(ae==="*"){let ce=re[ie]||"";J=Y.slice(0,Y.length-ce.length).replace(/(.)\/+$/,"$1")}const le=re[ie];return oe&&!le?te[ae]=void 0:te[ae]=safelyDecodeURIComponent(le||"",ae),te},{}),pathname:Y,pathnameBase:J,pattern:T}}function compilePath(T,C,$){C===void 0&&(C=!1),$===void 0&&($=!0),warning$2(T==="*"||!T.endsWith("*")||T.endsWith("/*"),'Route path "'+T+'" will be treated as if it were '+('"'+T.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+T.replace(/\*$/,"/*")+'".'));let V=[],K="^"+T.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(J,re,ne)=>(V.push({paramName:re,isOptional:ne!=null}),ne?"/?([^\\/]+)?":"/([^\\/]+)"));return T.endsWith("*")?(V.push({paramName:"*"}),K+=T==="*"||T==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):$?K+="\\/*$":T!==""&&T!=="/"&&(K+="(?:(?=\\/|$))"),[new RegExp(K,C?void 0:"i"),V]}function safelyDecodeURI(T){try{return decodeURI(T)}catch(C){return warning$2(!1,'The URL path "'+T+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+C+").")),T}}function safelyDecodeURIComponent(T,C){try{return decodeURIComponent(T)}catch($){return warning$2(!1,'The value for the URL param "'+C+'" will not be decoded because'+(' the string "'+T+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+$+").")),T}}function stripBasename(T,C){if(C==="/")return T;if(!T.toLowerCase().startsWith(C.toLowerCase()))return null;let $=C.endsWith("/")?C.length-1:C.length,V=T.charAt($);return V&&V!=="/"?null:T.slice($)||"/"}function resolvePath(T,C){C===void 0&&(C="/");let{pathname:$,search:V="",hash:K=""}=typeof T=="string"?parsePath(T):T;return{pathname:$?$.startsWith("/")?$:resolvePathname($,C):C,search:normalizeSearch(V),hash:normalizeHash(K)}}function resolvePathname(T,C){let $=C.replace(/\/+$/,"").split("/");return T.split("/").forEach(K=>{K===".."?$.length>1&&$.pop():K!=="."&&$.push(K)}),$.length>1?$.join("/"):"/"}function getInvalidPathError(T,C,$,V){return"Cannot include a '"+T+"' character in a manually specified "+("`to."+C+"` field ["+JSON.stringify(V)+"]. Please separate it out to the ")+("`to."+$+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function getPathContributingMatches(T){return T.filter((C,$)=>$===0||C.route.path&&C.route.path.length>0)}function getResolveToMatches(T,C){let $=getPathContributingMatches(T);return C?$.map((V,K)=>K===T.length-1?V.pathname:V.pathnameBase):$.map(V=>V.pathnameBase)}function resolveTo(T,C,$,V){V===void 0&&(V=!1);let K;typeof T=="string"?K=parsePath(T):(K=_extends$5({},T),invariant$2(!K.pathname||!K.pathname.includes("?"),getInvalidPathError("?","pathname","search",K)),invariant$2(!K.pathname||!K.pathname.includes("#"),getInvalidPathError("#","pathname","hash",K)),invariant$2(!K.search||!K.search.includes("#"),getInvalidPathError("#","search","hash",K)));let Y=T===""||K.pathname==="",J=Y?"/":K.pathname,re;if(J==null)re=$;else{let ie=C.length-1;if(!V&&J.startsWith("..")){let ae=J.split("/");for(;ae[0]==="..";)ae.shift(),ie-=1;K.pathname=ae.join("/")}re=ie>=0?C[ie]:"/"}let ne=resolvePath(K,re),te=J&&J!=="/"&&J.endsWith("/"),se=(Y||J===".")&&$.endsWith("/");return!ne.pathname.endsWith("/")&&(te||se)&&(ne.pathname+="/"),ne}const joinPaths=T=>T.join("/").replace(/\/\/+/g,"/"),normalizePathname=T=>T.replace(/\/+$/,"").replace(/^\/*/,"/"),normalizeSearch=T=>!T||T==="?"?"":T.startsWith("?")?T:"?"+T,normalizeHash=T=>!T||T==="#"?"":T.startsWith("#")?T:"#"+T;function isRouteErrorResponse(T){return T!=null&&typeof T.status=="number"&&typeof T.statusText=="string"&&typeof T.internal=="boolean"&&"data"in T}const validMutationMethodsArr=["post","put","patch","delete"];new Set(validMutationMethodsArr);const validRequestMethodsArr=["get",...validMutationMethodsArr];new Set(validRequestMethodsArr);/**
+ * React Router v6.22.0
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function _extends$4(){return _extends$4=Object.assign?Object.assign.bind():function(T){for(var C=1;CmatchPath(T,C),[C,T])}function useIsomorphicLayoutEffect$3(T){reactExports.useContext(NavigationContext$1).static||reactExports.useLayoutEffect(T)}function useNavigate(){let{isDataRoute:T}=reactExports.useContext(RouteContext);return T?useNavigateStable():useNavigateUnstable()}function useNavigateUnstable(){useInRouterContext()||invariant$2(!1);let T=reactExports.useContext(DataRouterContext),{basename:C,future:$,navigator:V}=reactExports.useContext(NavigationContext$1),{matches:K}=reactExports.useContext(RouteContext),{pathname:Y}=useLocation(),J=JSON.stringify(getResolveToMatches(K,$.v7_relativeSplatPath)),re=reactExports.useRef(!1);return useIsomorphicLayoutEffect$3(()=>{re.current=!0}),reactExports.useCallback(function(te,se){if(se===void 0&&(se={}),!re.current)return;if(typeof te=="number"){V.go(te);return}let ie=resolveTo(te,JSON.parse(J),Y,se.relative==="path");T==null&&C!=="/"&&(ie.pathname=ie.pathname==="/"?C:joinPaths([C,ie.pathname])),(se.replace?V.replace:V.push)(ie,se.state,se)},[C,V,J,Y,T])}const OutletContext=reactExports.createContext(null);function useOutlet(T){let C=reactExports.useContext(RouteContext).outlet;return C&&reactExports.createElement(OutletContext.Provider,{value:T},C)}function useParams(){let{matches:T}=reactExports.useContext(RouteContext),C=T[T.length-1];return C?C.params:{}}function useResolvedPath(T,C){let{relative:$}=C===void 0?{}:C,{future:V}=reactExports.useContext(NavigationContext$1),{matches:K}=reactExports.useContext(RouteContext),{pathname:Y}=useLocation(),J=JSON.stringify(getResolveToMatches(K,V.v7_relativeSplatPath));return reactExports.useMemo(()=>resolveTo(T,JSON.parse(J),Y,$==="path"),[T,J,Y,$])}function useRoutes$1(T,C){return useRoutesImpl(T,C)}function useRoutesImpl(T,C,$,V){useInRouterContext()||invariant$2(!1);let{navigator:K}=reactExports.useContext(NavigationContext$1),{matches:Y}=reactExports.useContext(RouteContext),J=Y[Y.length-1],re=J?J.params:{};J&&J.pathname;let ne=J?J.pathnameBase:"/";J&&J.route;let te=useLocation(),se;if(C){var ie;let de=typeof C=="string"?parsePath(C):C;ne==="/"||(ie=de.pathname)!=null&&ie.startsWith(ne)||invariant$2(!1),se=de}else se=te;let ae=se.pathname||"/",oe=ne==="/"?ae:ae.slice(ne.length)||"/",le=matchRoutes(T,{pathname:oe}),ce=_renderMatches(le&&le.map(de=>Object.assign({},de,{params:Object.assign({},re,de.params),pathname:joinPaths([ne,K.encodeLocation?K.encodeLocation(de.pathname).pathname:de.pathname]),pathnameBase:de.pathnameBase==="/"?ne:joinPaths([ne,K.encodeLocation?K.encodeLocation(de.pathnameBase).pathname:de.pathnameBase])})),Y,$,V);return C&&ce?reactExports.createElement(LocationContext.Provider,{value:{location:_extends$4({pathname:"/",search:"",hash:"",state:null,key:"default"},se),navigationType:Action.Pop}},ce):ce}function DefaultErrorComponent(){let T=useRouteError(),C=isRouteErrorResponse(T)?T.status+" "+T.statusText:T instanceof Error?T.message:JSON.stringify(T),$=T instanceof Error?T.stack:null,K={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},Y=null;return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("h2",null,"Unexpected Application Error!"),reactExports.createElement("h3",{style:{fontStyle:"italic"}},C),$?reactExports.createElement("pre",{style:K},$):null,Y)}const defaultErrorElement=reactExports.createElement(DefaultErrorComponent,null);class RenderErrorBoundary extends reactExports.Component{constructor(C){super(C),this.state={location:C.location,revalidation:C.revalidation,error:C.error}}static getDerivedStateFromError(C){return{error:C}}static getDerivedStateFromProps(C,$){return $.location!==C.location||$.revalidation!=="idle"&&C.revalidation==="idle"?{error:C.error,location:C.location,revalidation:C.revalidation}:{error:C.error!==void 0?C.error:$.error,location:$.location,revalidation:C.revalidation||$.revalidation}}componentDidCatch(C,$){console.error("React Router caught the following error during render",C,$)}render(){return this.state.error!==void 0?reactExports.createElement(RouteContext.Provider,{value:this.props.routeContext},reactExports.createElement(RouteErrorContext.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function RenderedRoute(T){let{routeContext:C,match:$,children:V}=T,K=reactExports.useContext(DataRouterContext);return K&&K.static&&K.staticContext&&($.route.errorElement||$.route.ErrorBoundary)&&(K.staticContext._deepestRenderedBoundaryId=$.route.id),reactExports.createElement(RouteContext.Provider,{value:C},V)}function _renderMatches(T,C,$,V){var K;if(C===void 0&&(C=[]),$===void 0&&($=null),V===void 0&&(V=null),T==null){var Y;if((Y=$)!=null&&Y.errors)T=$.matches;else return null}let J=T,re=(K=$)==null?void 0:K.errors;if(re!=null){let se=J.findIndex(ie=>ie.route.id&&(re==null?void 0:re[ie.route.id]));se>=0||invariant$2(!1),J=J.slice(0,Math.min(J.length,se+1))}let ne=!1,te=-1;if($&&V&&V.v7_partialHydration)for(let se=0;se=0?J=J.slice(0,te+1):J=[J[0]];break}}}return J.reduceRight((se,ie,ae)=>{let oe,le=!1,ce=null,de=null;$&&(oe=re&&ie.route.id?re[ie.route.id]:void 0,ce=ie.route.errorElement||defaultErrorElement,ne&&(te<0&&ae===0?(warningOnce("route-fallback",!1),le=!0,de=null):te===ae&&(le=!0,de=ie.route.hydrateFallbackElement||null)));let he=C.concat(J.slice(0,ae+1)),me=()=>{let ge;return oe?ge=ce:le?ge=de:ie.route.Component?ge=reactExports.createElement(ie.route.Component,null):ie.route.element?ge=ie.route.element:ge=se,reactExports.createElement(RenderedRoute,{match:ie,routeContext:{outlet:se,matches:he,isDataRoute:$!=null},children:ge})};return $&&(ie.route.ErrorBoundary||ie.route.errorElement||ae===0)?reactExports.createElement(RenderErrorBoundary,{location:$.location,revalidation:$.revalidation,component:ce,error:oe,children:me(),routeContext:{outlet:null,matches:he,isDataRoute:!0}}):me()},null)}var DataRouterHook$1=function(T){return T.UseBlocker="useBlocker",T.UseRevalidator="useRevalidator",T.UseNavigateStable="useNavigate",T}(DataRouterHook$1||{}),DataRouterStateHook$1=function(T){return T.UseBlocker="useBlocker",T.UseLoaderData="useLoaderData",T.UseActionData="useActionData",T.UseRouteError="useRouteError",T.UseNavigation="useNavigation",T.UseRouteLoaderData="useRouteLoaderData",T.UseMatches="useMatches",T.UseRevalidator="useRevalidator",T.UseNavigateStable="useNavigate",T.UseRouteId="useRouteId",T}(DataRouterStateHook$1||{});function useDataRouterContext(T){let C=reactExports.useContext(DataRouterContext);return C||invariant$2(!1),C}function useDataRouterState(T){let C=reactExports.useContext(DataRouterStateContext);return C||invariant$2(!1),C}function useRouteContext(T){let C=reactExports.useContext(RouteContext);return C||invariant$2(!1),C}function useCurrentRouteId(T){let C=useRouteContext(),$=C.matches[C.matches.length-1];return $.route.id||invariant$2(!1),$.route.id}function useRouteError(){var T;let C=reactExports.useContext(RouteErrorContext),$=useDataRouterState(DataRouterStateHook$1.UseRouteError),V=useCurrentRouteId(DataRouterStateHook$1.UseRouteError);return C!==void 0?C:(T=$.errors)==null?void 0:T[V]}function useNavigateStable(){let{router:T}=useDataRouterContext(DataRouterHook$1.UseNavigateStable),C=useCurrentRouteId(DataRouterStateHook$1.UseNavigateStable),$=reactExports.useRef(!1);return useIsomorphicLayoutEffect$3(()=>{$.current=!0}),reactExports.useCallback(function(K,Y){Y===void 0&&(Y={}),$.current&&(typeof K=="number"?T.navigate(K):T.navigate(K,_extends$4({fromRouteId:C},Y)))},[T,C])}const alreadyWarned={};function warningOnce(T,C,$){!C&&!alreadyWarned[T]&&(alreadyWarned[T]=!0)}function Navigate(T){let{to:C,replace:$,state:V,relative:K}=T;useInRouterContext()||invariant$2(!1);let{future:Y,static:J}=reactExports.useContext(NavigationContext$1),{matches:re}=reactExports.useContext(RouteContext),{pathname:ne}=useLocation(),te=useNavigate(),se=resolveTo(C,getResolveToMatches(re,Y.v7_relativeSplatPath),ne,K==="path"),ie=JSON.stringify(se);return reactExports.useEffect(()=>te(JSON.parse(ie),{replace:$,state:V,relative:K}),[te,ie,K,$,V]),null}function Outlet(T){return useOutlet(T.context)}function Route(T){invariant$2(!1)}function Router$1(T){let{basename:C="/",children:$=null,location:V,navigationType:K=Action.Pop,navigator:Y,static:J=!1,future:re}=T;useInRouterContext()&&invariant$2(!1);let ne=C.replace(/^\/*/,"/"),te=reactExports.useMemo(()=>({basename:ne,navigator:Y,static:J,future:_extends$4({v7_relativeSplatPath:!1},re)}),[ne,re,Y,J]);typeof V=="string"&&(V=parsePath(V));let{pathname:se="/",search:ie="",hash:ae="",state:oe=null,key:le="default"}=V,ce=reactExports.useMemo(()=>{let de=stripBasename(se,ne);return de==null?null:{location:{pathname:de,search:ie,hash:ae,state:oe,key:le},navigationType:K}},[ne,se,ie,ae,oe,le,K]);return ce==null?null:reactExports.createElement(NavigationContext$1.Provider,{value:te},reactExports.createElement(LocationContext.Provider,{children:$,value:ce}))}function Routes(T){let{children:C,location:$}=T;return useRoutes$1(createRoutesFromChildren(C),$)}new Promise(()=>{});function createRoutesFromChildren(T,C){C===void 0&&(C=[]);let $=[];return reactExports.Children.forEach(T,(V,K)=>{if(!reactExports.isValidElement(V))return;let Y=[...C,K];if(V.type===reactExports.Fragment){$.push.apply($,createRoutesFromChildren(V.props.children,Y));return}V.type!==Route&&invariant$2(!1),!V.props.index||!V.props.children||invariant$2(!1);let J={id:V.props.id||Y.join("-"),caseSensitive:V.props.caseSensitive,element:V.props.element,Component:V.props.Component,index:V.props.index,path:V.props.path,loader:V.props.loader,action:V.props.action,errorElement:V.props.errorElement,ErrorBoundary:V.props.ErrorBoundary,hasErrorBoundary:V.props.ErrorBoundary!=null||V.props.errorElement!=null,shouldRevalidate:V.props.shouldRevalidate,handle:V.props.handle,lazy:V.props.lazy};V.props.children&&(J.children=createRoutesFromChildren(V.props.children,Y)),$.push(J)}),$}/**
+ * React Router DOM v6.22.0
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function _extends$3(){return _extends$3=Object.assign?Object.assign.bind():function(T){for(var C=1;C=0)&&($[K]=T[K]);return $}function isModifiedEvent(T){return!!(T.metaKey||T.altKey||T.ctrlKey||T.shiftKey)}function shouldProcessLinkClick(T,C){return T.button===0&&(!C||C==="_self")&&!isModifiedEvent(T)}const _excluded$3=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],REACT_ROUTER_VERSION="6";try{window.__reactRouterVersion=REACT_ROUTER_VERSION}catch{}const START_TRANSITION="startTransition",startTransitionImpl=$2AODx$react[START_TRANSITION];function HashRouter(T){let{basename:C,children:$,future:V,window:K}=T,Y=reactExports.useRef();Y.current==null&&(Y.current=createHashHistory({window:K,v5Compat:!0}));let J=Y.current,[re,ne]=reactExports.useState({action:J.action,location:J.location}),{v7_startTransition:te}=V||{},se=reactExports.useCallback(ie=>{te&&startTransitionImpl?startTransitionImpl(()=>ne(ie)):ne(ie)},[ne,te]);return reactExports.useLayoutEffect(()=>J.listen(se),[J,se]),reactExports.createElement(Router$1,{basename:C,children:$,location:re.location,navigationType:re.action,navigator:J,future:V})}const isBrowser$1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ABSOLUTE_URL_REGEX=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Link$2=reactExports.forwardRef(function(C,$){let{onClick:V,relative:K,reloadDocument:Y,replace:J,state:re,target:ne,to:te,preventScrollReset:se,unstable_viewTransition:ie}=C,ae=_objectWithoutPropertiesLoose$3(C,_excluded$3),{basename:oe}=reactExports.useContext(NavigationContext$1),le,ce=!1;if(typeof te=="string"&&ABSOLUTE_URL_REGEX.test(te)&&(le=te,isBrowser$1))try{let ge=new URL(window.location.href),ye=te.startsWith("//")?new URL(ge.protocol+te):new URL(te),fe=stripBasename(ye.pathname,oe);ye.origin===ge.origin&&fe!=null?te=fe+ye.search+ye.hash:ce=!0}catch{}let de=useHref(te,{relative:K}),he=useLinkClickHandler(te,{replace:J,state:re,target:ne,preventScrollReset:se,relative:K,unstable_viewTransition:ie});function me(ge){V&&V(ge),ge.defaultPrevented||he(ge)}return reactExports.createElement("a",_extends$3({},ae,{href:le||de,onClick:ce||Y?V:me,ref:$,target:ne}))});var DataRouterHook;(function(T){T.UseScrollRestoration="useScrollRestoration",T.UseSubmit="useSubmit",T.UseSubmitFetcher="useSubmitFetcher",T.UseFetcher="useFetcher",T.useViewTransitionState="useViewTransitionState"})(DataRouterHook||(DataRouterHook={}));var DataRouterStateHook;(function(T){T.UseFetcher="useFetcher",T.UseFetchers="useFetchers",T.UseScrollRestoration="useScrollRestoration"})(DataRouterStateHook||(DataRouterStateHook={}));function useLinkClickHandler(T,C){let{target:$,replace:V,state:K,preventScrollReset:Y,relative:J,unstable_viewTransition:re}=C===void 0?{}:C,ne=useNavigate(),te=useLocation(),se=useResolvedPath(T,{relative:J});return reactExports.useCallback(ie=>{if(shouldProcessLinkClick(ie,$)){ie.preventDefault();let ae=V!==void 0?V:createPath(te)===createPath(se);ne(T,{replace:ae,state:K,preventScrollReset:Y,relative:J,unstable_viewTransition:re})}},[te,ne,se,V,K,$,T,Y,J,re])}var shim={exports:{}},useSyncExternalStoreShim_production_min={};/**
+ * @license React
+ * use-sync-external-store-shim.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var e$2=reactExports;function h$4(T,C){return T===C&&(T!==0||1/T===1/C)||T!==T&&C!==C}var k$3=typeof Object.is=="function"?Object.is:h$4,l$3=e$2.useState,m$3=e$2.useEffect,n$6=e$2.useLayoutEffect,p$4=e$2.useDebugValue;function q$4(T,C){var $=C(),V=l$3({inst:{value:$,getSnapshot:C}}),K=V[0].inst,Y=V[1];return n$6(function(){K.value=$,K.getSnapshot=C,r$5(K)&&Y({inst:K})},[T,$,C]),m$3(function(){return r$5(K)&&Y({inst:K}),T(function(){r$5(K)&&Y({inst:K})})},[T]),p$4($),$}function r$5(T){var C=T.getSnapshot;T=T.value;try{var $=C();return!k$3(T,$)}catch{return!0}}function t$6(T,C){return C()}var u$3=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?t$6:q$4;useSyncExternalStoreShim_production_min.useSyncExternalStore=e$2.useSyncExternalStore!==void 0?e$2.useSyncExternalStore:u$3;shim.exports=useSyncExternalStoreShim_production_min;var shimExports=shim.exports,withSelector={exports:{}},withSelector_production_min={};/**
+ * @license React
+ * use-sync-external-store-shim/with-selector.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var h$3=reactExports,n$5=shimExports;function p$3(T,C){return T===C&&(T!==0||1/T===1/C)||T!==T&&C!==C}var q$3=typeof Object.is=="function"?Object.is:p$3,r$4=n$5.useSyncExternalStore,t$5=h$3.useRef,u$2=h$3.useEffect,v$3=h$3.useMemo,w$3=h$3.useDebugValue;withSelector_production_min.useSyncExternalStoreWithSelector=function(T,C,$,V,K){var Y=t$5(null);if(Y.current===null){var J={hasValue:!1,value:null};Y.current=J}else J=Y.current;Y=v$3(function(){function ne(oe){if(!te){if(te=!0,se=oe,oe=V(oe),K!==void 0&&J.hasValue){var le=J.value;if(K(le,oe))return ie=le}return ie=oe}if(le=ie,q$3(se,oe))return le;var ce=V(oe);return K!==void 0&&K(le,ce)?le:(se=oe,ie=ce)}var te=!1,se,ie,ae=$===void 0?null:$;return[function(){return ne(C())},ae===null?void 0:function(){return ne(ae())}]},[C,$,V,K]);var re=r$4(T,Y[0],Y[1]);return u$2(function(){J.hasValue=!0,J.value=re},[re]),w$3(re),re};withSelector.exports=withSelector_production_min;var withSelectorExports=withSelector.exports;function defaultNoopBatch(T){T()}let batch=defaultNoopBatch;const setBatch=T=>batch=T,getBatch=()=>batch,ContextKey=Symbol.for("react-redux-context"),gT=typeof globalThis<"u"?globalThis:{};function getContext(){var T;if(!reactExports.createContext)return{};const C=(T=gT[ContextKey])!=null?T:gT[ContextKey]=new Map;let $=C.get(reactExports.createContext);return $||($=reactExports.createContext(null),C.set(reactExports.createContext,$)),$}const ReactReduxContext=getContext();function createReduxContextHook(T=ReactReduxContext){return function(){return reactExports.useContext(T)}}const useReduxContext=createReduxContextHook(),notInitialized=()=>{throw new Error("uSES not initialized!")};let useSyncExternalStoreWithSelector=notInitialized;const initializeUseSelector=T=>{useSyncExternalStoreWithSelector=T},refEquality=(T,C)=>T===C;function createSelectorHook(T=ReactReduxContext){const C=T===ReactReduxContext?useReduxContext:createReduxContextHook(T);return function(V,K={}){const{equalityFn:Y=refEquality,stabilityCheck:J=void 0,noopCheck:re=void 0}=typeof K=="function"?{equalityFn:K}:K,{store:ne,subscription:te,getServerState:se,stabilityCheck:ie,noopCheck:ae}=C();reactExports.useRef(!0);const oe=reactExports.useCallback({[V.name](ce){return V(ce)}}[V.name],[V,ie,J]),le=useSyncExternalStoreWithSelector(te.addNestedSub,ne.getState,se||ne.getState,oe,Y);return reactExports.useDebugValue(le),le}}const useSelector=createSelectorHook();function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(T){for(var C=1;C=0)&&($[K]=T[K]);return $}var reactIs$2={exports:{}},reactIs_production_min$1={};/** @license React v16.13.1
+ * react-is.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var b$2=typeof Symbol=="function"&&Symbol.for,c$2=b$2?Symbol.for("react.element"):60103,d$2=b$2?Symbol.for("react.portal"):60106,e$1=b$2?Symbol.for("react.fragment"):60107,f$2=b$2?Symbol.for("react.strict_mode"):60108,g$2=b$2?Symbol.for("react.profiler"):60114,h$2=b$2?Symbol.for("react.provider"):60109,k$2=b$2?Symbol.for("react.context"):60110,l$2=b$2?Symbol.for("react.async_mode"):60111,m$2=b$2?Symbol.for("react.concurrent_mode"):60111,n$4=b$2?Symbol.for("react.forward_ref"):60112,p$2=b$2?Symbol.for("react.suspense"):60113,q$2=b$2?Symbol.for("react.suspense_list"):60120,r$3=b$2?Symbol.for("react.memo"):60115,t$4=b$2?Symbol.for("react.lazy"):60116,v$2=b$2?Symbol.for("react.block"):60121,w$2=b$2?Symbol.for("react.fundamental"):60117,x$1=b$2?Symbol.for("react.responder"):60118,y$1=b$2?Symbol.for("react.scope"):60119;function z$3(T){if(typeof T=="object"&&T!==null){var C=T.$$typeof;switch(C){case c$2:switch(T=T.type,T){case l$2:case m$2:case e$1:case g$2:case f$2:case p$2:return T;default:switch(T=T&&T.$$typeof,T){case k$2:case n$4:case t$4:case r$3:case h$2:return T;default:return C}}case d$2:return C}}}function A$1(T){return z$3(T)===m$2}reactIs_production_min$1.AsyncMode=l$2;reactIs_production_min$1.ConcurrentMode=m$2;reactIs_production_min$1.ContextConsumer=k$2;reactIs_production_min$1.ContextProvider=h$2;reactIs_production_min$1.Element=c$2;reactIs_production_min$1.ForwardRef=n$4;reactIs_production_min$1.Fragment=e$1;reactIs_production_min$1.Lazy=t$4;reactIs_production_min$1.Memo=r$3;reactIs_production_min$1.Portal=d$2;reactIs_production_min$1.Profiler=g$2;reactIs_production_min$1.StrictMode=f$2;reactIs_production_min$1.Suspense=p$2;reactIs_production_min$1.isAsyncMode=function(T){return A$1(T)||z$3(T)===l$2};reactIs_production_min$1.isConcurrentMode=A$1;reactIs_production_min$1.isContextConsumer=function(T){return z$3(T)===k$2};reactIs_production_min$1.isContextProvider=function(T){return z$3(T)===h$2};reactIs_production_min$1.isElement=function(T){return typeof T=="object"&&T!==null&&T.$$typeof===c$2};reactIs_production_min$1.isForwardRef=function(T){return z$3(T)===n$4};reactIs_production_min$1.isFragment=function(T){return z$3(T)===e$1};reactIs_production_min$1.isLazy=function(T){return z$3(T)===t$4};reactIs_production_min$1.isMemo=function(T){return z$3(T)===r$3};reactIs_production_min$1.isPortal=function(T){return z$3(T)===d$2};reactIs_production_min$1.isProfiler=function(T){return z$3(T)===g$2};reactIs_production_min$1.isStrictMode=function(T){return z$3(T)===f$2};reactIs_production_min$1.isSuspense=function(T){return z$3(T)===p$2};reactIs_production_min$1.isValidElementType=function(T){return typeof T=="string"||typeof T=="function"||T===e$1||T===m$2||T===g$2||T===f$2||T===p$2||T===q$2||typeof T=="object"&&T!==null&&(T.$$typeof===t$4||T.$$typeof===r$3||T.$$typeof===h$2||T.$$typeof===k$2||T.$$typeof===n$4||T.$$typeof===w$2||T.$$typeof===x$1||T.$$typeof===y$1||T.$$typeof===v$2)};reactIs_production_min$1.typeOf=z$3;reactIs$2.exports=reactIs_production_min$1;var reactIsExports$1=reactIs$2.exports,reactIs$1=reactIsExports$1,REACT_STATICS={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},KNOWN_STATICS={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},FORWARD_REF_STATICS={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},MEMO_STATICS={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},TYPE_STATICS={};TYPE_STATICS[reactIs$1.ForwardRef]=FORWARD_REF_STATICS;TYPE_STATICS[reactIs$1.Memo]=MEMO_STATICS;function getStatics(T){return reactIs$1.isMemo(T)?MEMO_STATICS:TYPE_STATICS[T.$$typeof]||REACT_STATICS}var defineProperty=Object.defineProperty,getOwnPropertyNames=Object.getOwnPropertyNames,getOwnPropertySymbols=Object.getOwnPropertySymbols,getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,getPrototypeOf=Object.getPrototypeOf,objectPrototype=Object.prototype;function hoistNonReactStatics(T,C,$){if(typeof C!="string"){if(objectPrototype){var V=getPrototypeOf(C);V&&V!==objectPrototype&&hoistNonReactStatics(T,V,$)}var K=getOwnPropertyNames(C);getOwnPropertySymbols&&(K=K.concat(getOwnPropertySymbols(C)));for(var Y=getStatics(T),J=getStatics(C),re=0;reC(K(...Y)))}return $}function wrapMapToPropsConstant(T){return function($){const V=T($);function K(){return V}return K.dependsOnOwnProps=!1,K}}function getDependsOnOwnProps(T){return T.dependsOnOwnProps?!!T.dependsOnOwnProps:T.length!==1}function wrapMapToPropsFunc(T,C){return function(V,{displayName:K}){const Y=function(re,ne){return Y.dependsOnOwnProps?Y.mapToProps(re,ne):Y.mapToProps(re,void 0)};return Y.dependsOnOwnProps=!0,Y.mapToProps=function(re,ne){Y.mapToProps=T,Y.dependsOnOwnProps=getDependsOnOwnProps(T);let te=Y(re,ne);return typeof te=="function"&&(Y.mapToProps=te,Y.dependsOnOwnProps=getDependsOnOwnProps(te),te=Y(re,ne)),te},Y}}function createInvalidArgFactory(T,C){return($,V)=>{throw new Error(`Invalid value of type ${typeof T} for ${C} argument when connecting component ${V.wrappedComponentName}.`)}}function mapDispatchToPropsFactory(T){return T&&typeof T=="object"?wrapMapToPropsConstant(C=>bindActionCreators(T,C)):T?typeof T=="function"?wrapMapToPropsFunc(T):createInvalidArgFactory(T,"mapDispatchToProps"):wrapMapToPropsConstant(C=>({dispatch:C}))}function mapStateToPropsFactory(T){return T?typeof T=="function"?wrapMapToPropsFunc(T):createInvalidArgFactory(T,"mapStateToProps"):wrapMapToPropsConstant(()=>({}))}function defaultMergeProps(T,C,$){return _extends$2({},$,T,C)}function wrapMergePropsFunc(T){return function($,{displayName:V,areMergedPropsEqual:K}){let Y=!1,J;return function(ne,te,se){const ie=T(ne,te,se);return Y?K(ie,J)||(J=ie):(Y=!0,J=ie),J}}}function mergePropsFactory(T){return T?typeof T=="function"?wrapMergePropsFunc(T):createInvalidArgFactory(T,"mergeProps"):()=>defaultMergeProps}function createListenerCollection(){const T=getBatch();let C=null,$=null;return{clear(){C=null,$=null},notify(){T(()=>{let V=C;for(;V;)V.callback(),V=V.next})},get(){let V=[],K=C;for(;K;)V.push(K),K=K.next;return V},subscribe(V){let K=!0,Y=$={callback:V,next:null,prev:$};return Y.prev?Y.prev.next=Y:C=Y,function(){!K||C===null||(K=!1,Y.next?Y.next.prev=Y.prev:$=Y.prev,Y.prev?Y.prev.next=Y.next:C=Y.next)}}}}const nullListeners={notify(){},get:()=>[]};function createSubscription(T,C){let $,V=nullListeners;function K(ie){return ne(),V.subscribe(ie)}function Y(){V.notify()}function J(){se.onStateChange&&se.onStateChange()}function re(){return!!$}function ne(){$||($=C?C.addNestedSub(J):T.subscribe(J),V=createListenerCollection())}function te(){$&&($(),$=void 0,V.clear(),V=nullListeners)}const se={addNestedSub:K,notifyNestedSubs:Y,handleChangeWrapper:J,isSubscribed:re,trySubscribe:ne,tryUnsubscribe:te,getListeners:()=>V};return se}const canUseDOM$1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",useIsomorphicLayoutEffect$2=canUseDOM$1?reactExports.useLayoutEffect:reactExports.useEffect;function is(T,C){return T===C?T!==0||C!==0||1/T===1/C:T!==T&&C!==C}function shallowEqual$1(T,C){if(is(T,C))return!0;if(typeof T!="object"||T===null||typeof C!="object"||C===null)return!1;const $=Object.keys(T),V=Object.keys(C);if($.length!==V.length)return!1;for(let K=0;K<$.length;K++)if(!Object.prototype.hasOwnProperty.call(C,$[K])||!is(T[$[K]],C[$[K]]))return!1;return!0}const _excluded$1=["reactReduxForwardedRef"];let useSyncExternalStore=notInitialized;const initializeConnect=T=>{useSyncExternalStore=T},NO_SUBSCRIPTION_ARRAY=[null,null];function useIsomorphicLayoutEffectWithArgs(T,C,$){useIsomorphicLayoutEffect$2(()=>T(...C),$)}function captureWrapperProps(T,C,$,V,K,Y){T.current=V,$.current=!1,K.current&&(K.current=null,Y())}function subscribeUpdates(T,C,$,V,K,Y,J,re,ne,te,se){if(!T)return()=>{};let ie=!1,ae=null;const oe=()=>{if(ie||!re.current)return;const ce=C.getState();let de,he;try{de=V(ce,K.current)}catch(me){he=me,ae=me}he||(ae=null),de===Y.current?J.current||te():(Y.current=de,ne.current=de,J.current=!0,se())};return $.onStateChange=oe,$.trySubscribe(),oe(),()=>{if(ie=!0,$.tryUnsubscribe(),$.onStateChange=null,ae)throw ae}}function strictEqual(T,C){return T===C}function connect(T,C,$,{pure:V,areStatesEqual:K=strictEqual,areOwnPropsEqual:Y=shallowEqual$1,areStatePropsEqual:J=shallowEqual$1,areMergedPropsEqual:re=shallowEqual$1,forwardRef:ne=!1,context:te=ReactReduxContext}={}){const se=te,ie=mapStateToPropsFactory(T),ae=mapDispatchToPropsFactory(C),oe=mergePropsFactory($),le=!!T;return de=>{const he=de.displayName||de.name||"Component",me=`Connect(${he})`,ge={shouldHandleStateChanges:le,displayName:me,wrappedComponentName:he,WrappedComponent:de,initMapStateToProps:ie,initMapDispatchToProps:ae,initMergeProps:oe,areStatesEqual:K,areStatePropsEqual:J,areOwnPropsEqual:Y,areMergedPropsEqual:re};function ye(Pe){const[De,xe,Ce]=reactExports.useMemo(()=>{const{reactReduxForwardedRef:xt}=Pe,Tt=_objectWithoutPropertiesLoose$2(Pe,_excluded$1);return[Pe.context,xt,Tt]},[Pe]),je=reactExports.useMemo(()=>De&&De.Consumer&&reactIsExports.isContextConsumer(reactExports.createElement(De.Consumer,null))?De:se,[De,se]),Le=reactExports.useContext(je),Ke=!!Pe.store&&!!Pe.store.getState&&!!Pe.store.dispatch,Se=!!Le&&!!Le.store,Ie=Ke?Pe.store:Le.store,Ne=Se?Le.getServerState:Ie.getState,pt=reactExports.useMemo(()=>finalPropsSelectorFactory(Ie.dispatch,ge),[Ie]),[at,dt]=reactExports.useMemo(()=>{if(!le)return NO_SUBSCRIPTION_ARRAY;const xt=createSubscription(Ie,Ke?void 0:Le.subscription),Tt=xt.notifyNestedSubs.bind(xt);return[xt,Tt]},[Ie,Ke,Le]),Ct=reactExports.useMemo(()=>Ke?Le:_extends$2({},Le,{subscription:at}),[Ke,Le,at]),ut=reactExports.useRef(),bt=reactExports.useRef(Ce),Re=reactExports.useRef(),ue=reactExports.useRef(!1);reactExports.useRef(!1);const be=reactExports.useRef(!1),ve=reactExports.useRef();useIsomorphicLayoutEffect$2(()=>(be.current=!0,()=>{be.current=!1}),[]);const we=reactExports.useMemo(()=>()=>Re.current&&Ce===bt.current?Re.current:pt(Ie.getState(),Ce),[Ie,Ce]),_e=reactExports.useMemo(()=>Tt=>at?subscribeUpdates(le,Ie,at,pt,bt,ut,ue,be,Re,dt,Tt):()=>{},[at]);useIsomorphicLayoutEffectWithArgs(captureWrapperProps,[bt,ut,ue,Ce,Re,dt]);let Oe;try{Oe=useSyncExternalStore(_e,we,Ne?()=>pt(Ne(),Ce):we)}catch(xt){throw ve.current&&(xt.message+=`
+The error may be correlated with this previous error:
+${ve.current.stack}
+
+`),xt}useIsomorphicLayoutEffect$2(()=>{ve.current=void 0,Re.current=void 0,ut.current=Oe});const Qe=reactExports.useMemo(()=>reactExports.createElement(de,_extends$2({},Oe,{ref:xe})),[xe,de,Oe]);return reactExports.useMemo(()=>le?reactExports.createElement(je.Provider,{value:Ct},Qe):Qe,[je,Qe,Ct])}const Te=reactExports.memo(ye);if(Te.WrappedComponent=de,Te.displayName=ye.displayName=me,ne){const De=reactExports.forwardRef(function(Ce,je){return reactExports.createElement(Te,_extends$2({},Ce,{reactReduxForwardedRef:je}))});return De.displayName=me,De.WrappedComponent=de,hoistNonReactStatics$1(De,de)}return hoistNonReactStatics$1(Te,de)}}function Provider$1({store:T,context:C,children:$,serverState:V,stabilityCheck:K="once",noopCheck:Y="once"}){const J=reactExports.useMemo(()=>{const te=createSubscription(T);return{store:T,subscription:te,getServerState:V?()=>V:void 0,stabilityCheck:K,noopCheck:Y}},[T,V,K,Y]),re=reactExports.useMemo(()=>T.getState(),[T]);useIsomorphicLayoutEffect$2(()=>{const{subscription:te}=J;return te.onStateChange=te.notifyNestedSubs,te.trySubscribe(),re!==T.getState()&&te.notifyNestedSubs(),()=>{te.tryUnsubscribe(),te.onStateChange=void 0}},[J,re]);const ne=C||ReactReduxContext;return reactExports.createElement(ne.Provider,{value:J},$)}function createStoreHook(T=ReactReduxContext){const C=T===ReactReduxContext?useReduxContext:createReduxContextHook(T);return function(){const{store:V}=C();return V}}const useStore=createStoreHook();function createDispatchHook(T=ReactReduxContext){const C=T===ReactReduxContext?useStore:createStoreHook(T);return function(){return C().dispatch}}const useDispatch=createDispatchHook();initializeUseSelector(withSelectorExports.useSyncExternalStoreWithSelector);initializeConnect(shimExports.useSyncExternalStore);setBatch(reactDomExports.unstable_batchedUpdates);const useAppDispatch=useDispatch;var __rest$13=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$,size:V="medium",as:K="p",spacing:Y,truncate:J,weight:re="regular",align:ne,visuallyHidden:te,textColor:se}=T,ie=__rest$13(T,["className","size","as","spacing","truncate","weight","align","visuallyHidden","textColor"]);return React.createElement(K,Object.assign({},ie,{ref:C,className:clsx$1($,"navds-body-long",`navds-body-long--${V}`,typoClassNames({spacing:Y,truncate:J,weight:re,align:ne,visuallyHidden:te,textColor:se}))}))}),BodyLong$1=BodyLong;function debounce(T,C=166){let $;function V(...K){const Y=()=>{T.apply(this,K)};clearTimeout($),$=setTimeout(Y,C)}return V.clear=()=>{clearTimeout($)},V}const useEventListener$1=(T,C,$=typeof window<"u"?window:null)=>{reactExports.useEffect(()=>{if($)return $==null||$.addEventListener(T,C),()=>{$==null||$.removeEventListener(T,C)}},[T,C,$])};function useCallbackRef(T,C=[]){const $=reactExports.useRef(T);return reactExports.useEffect(()=>{$.current=T}),reactExports.useCallback((...V)=>{var K;return(K=$.current)===null||K===void 0?void 0:K.call($,...V)},C)}function useControllableState({value:T,defaultValue:C,onChange:$}){const V=useCallbackRef($),[K,Y]=reactExports.useState(C),J=T!==void 0,re=J?T:K,ne=useCallbackRef(te=>{const ie=typeof te=="function"?te(re):te;J||Y(ie),V(ie)},[J,V,re]);return[re,ne]}const AccordionContext=reactExports.createContext({headingSize:"small",size:"medium",openItems:[],mounted:!1});var __rest$12=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{children:$,className:V,open:K,defaultOpen:Y=!1,onOpenChange:J}=T,re=__rest$12(T,["children","className","open","defaultOpen","onOpenChange"]);const[ne,te]=useControllableState({defaultValue:Y,value:K,onChange:J}),se=reactExports.useContext(AccordionContext),ie=reactExports.useRef(!(K||Y)),ae=()=>{te(oe=>!oe),ie.current=!0};return se!=null&&se.mounted||console.error(" has to be used within an "),React.createElement("div",Object.assign({className:clsx$1("navds-accordion__item",V,{"navds-accordion__item--open":ne,"navds-accordion__item--neutral":(se==null?void 0:se.variant)==="neutral","navds-accordion__item--no-animation":!ie.current}),ref:C},omit(re,["onClick"])),React.createElement(AccordionItemContext.Provider,{value:{open:ne,toggleOpen:ae}},$))}),AccordionItem$1=AccordionItem;var __rest$11=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{children:$,className:V}=T,K=__rest$11(T,["children","className"]);const Y=reactExports.useContext(AccordionItemContext);return Y===null?(console.error(" has to be used within an "),null):React.createElement(BodyLong$1,Object.assign({},K,{as:"div",ref:C,className:clsx$1("navds-accordion__content",{"navds-accordion__content--closed":!Y.open},V),"aria-hidden":!Y.open||void 0}),$)}),AccordionContent$1=AccordionContent;var __rest$10=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$10(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{d:"M12.75 5a.75.75 0 0 0-1.5 0v12.19l-3.22-3.22a.75.75 0 0 0-1.06 1.06l4.5 4.5a.75.75 0 0 0 1.06 0l4.5-4.5a.75.75 0 1 0-1.06-1.06l-3.22 3.22V5Z",fill:"currentColor"}))}),ArrowDownIcon=SvgArrowDown;var __rest$$=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$$(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{d:"M4.47 11.47a.75.75 0 0 0 0 1.06l4.5 4.5a.75.75 0 0 0 1.06-1.06l-3.22-3.22H19a.75.75 0 0 0 0-1.5H6.81l3.22-3.22a.75.75 0 1 0-1.06-1.06l-4.5 4.5Z",fill:"currentColor"}))}),ArrowLeftIcon=SvgArrowLeft;var __rest$_=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$_(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{d:"M14.087 6.874a.752.752 0 0 0-.117 1.156l3.22 3.22H5a.75.75 0 0 0 0 1.5h12.19l-3.22 3.22a.75.75 0 0 0 1.06 1.06l4.5-4.5a.75.75 0 0 0 0-1.06l-4.5-4.5a.75.75 0 0 0-.943-.096Z",fill:"currentColor"}))}),ArrowRightIcon=SvgArrowRight;var __rest$Z=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$Z(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{d:"M12.53 4.47a.75.75 0 0 0-1.06 0l-4.5 4.5a.75.75 0 0 0 1.06 1.06l3.22-3.22V19a.75.75 0 0 0 1.5 0V6.81l3.22 3.22a.75.75 0 1 0 1.06-1.06l-4.5-4.5Z",fill:"currentColor"}))}),ArrowUpIcon=SvgArrowUp;var __rest$Y=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$Y(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.47 21.03a.75.75 0 0 0 1.06 0l3.5-3.5a.75.75 0 1 0-1.06-1.06l-2.22 2.22V9.5a.75.75 0 0 0-1.5 0v9.19l-2.22-2.22a.75.75 0 1 0-1.06 1.06l3.5 3.5ZM4.03 7.53l2.22-2.22v9.19a.75.75 0 0 0 1.5 0V5.31l2.22 2.22a.75.75 0 1 0 1.06-1.06l-3.5-3.5a.75.75 0 0 0-1.06 0l-3.5 3.5a.75.75 0 0 0 1.06 1.06Z",fill:"currentColor"}))}),ArrowsUpDownIcon=SvgArrowsUpDown;var __rest$X=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$X(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.25 7.5c0-.69.56-1.25 1.25-1.25h4.25V5c0-.966.784-1.75 1.75-1.75h5c.966 0 1.75.784 1.75 1.75v1.25h4.25c.69 0 1.25.56 1.25 1.25v5c0 .69-.56 1.25-1.25 1.25h-.25v4.75c0 .69-.56 1.25-1.25 1.25H5c-.69 0-1.25-.56-1.25-1.25v-4.75H3.5c-.69 0-1.25-.56-1.25-1.25v-5Zm7-2.5a.25.25 0 0 1 .25-.25h5a.25.25 0 0 1 .25.25v1.25h-5.5V5ZM12 15.75a.75.75 0 0 0 .75-.75v-1.25h6v4.5H5.25v-4.5h6V15c0 .414.336.75.75.75Zm0-5.5a.75.75 0 0 1 .75.75v1.25h7.5v-4.5H3.75v4.5h7.5V11a.75.75 0 0 1 .75-.75Z",fill:"currentColor"}))}),BriefcaseIcon=SvgBriefcase;var __rest$W=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$W(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 2.25a.75.75 0 0 1 .75.75v1.25h4.5V3a.75.75 0 0 1 1.5 0v1.25h3.75c.69 0 1.25.56 1.25 1.25v13c0 .69-.56 1.25-1.25 1.25h-15c-.69 0-1.25-.56-1.25-1.25v-13c0-.69.56-1.25 1.25-1.25h3.75V3A.75.75 0 0 1 9 2.25ZM15.75 7a.75.75 0 0 1-1.5 0V5.75h-4.5V7a.75.75 0 0 1-1.5 0V5.75h-3.5v3.5h14.5v-3.5h-3.5V7Zm-11 11.25v-7.5h14.5v7.5H4.75Zm2-5.25a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1-.75-.75Zm4 0a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1-.75-.75Zm4.75-.75a.75.75 0 0 0 0 1.5h1a.75.75 0 0 0 0-1.5h-1ZM10.75 16a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1-.75-.75Zm4.75-.75a.75.75 0 0 0 0 1.5h1a.75.75 0 0 0 0-1.5h-1ZM6.75 16a.75.75 0 0 1 .75-.75h1a.75.75 0 0 1 0 1.5h-1a.75.75 0 0 1-.75-.75Z",fill:"currentColor"}))}),CalendarIcon=SvgCalendar;var __rest$V=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$V(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.75 6c0-.69.56-1.25 1.25-1.25h12c.69 0 1.25.56 1.25 1.25v9c0 .69-.56 1.25-1.25 1.25H9a.75.75 0 0 0-.386.107L4.75 18.675V6ZM6 3.25A2.75 2.75 0 0 0 3.25 6v14a.75.75 0 0 0 1.136.643l4.822-2.893H18A2.75 2.75 0 0 0 20.75 15V6A2.75 2.75 0 0 0 18 3.25H6Zm3 6.5a.75.75 0 0 0 0 1.5h.01a.75.75 0 0 0 0-1.5H9Zm2.25.75a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 0 1.5H12a.75.75 0 0 1-.75-.75ZM15 9.75a.75.75 0 0 0 0 1.5h.01a.75.75 0 0 0 0-1.5H15Z",fill:"currentColor"}))}),ChatElipsisIcon=SvgChatElipsis;var __rest$U=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$U(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 21.75c5.385 0 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25 2.25 6.615 2.25 12s4.365 9.75 9.75 9.75Zm4.954-12.475a.813.813 0 0 0-1.24-1.05l-5.389 6.368L7.7 11.967a.812.812 0 0 0-1.15 1.15l3.25 3.25a.812.812 0 0 0 1.195-.05l5.959-7.042Z",fill:"currentColor"}))}),CheckmarkCircleFillIcon=SvgCheckmarkCircleFill;var __rest$T=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$T(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.53 5.97a.75.75 0 0 1 0 1.06L9.56 12l4.97 4.97a.75.75 0 1 1-1.06 1.06l-5.5-5.5a.75.75 0 0 1 0-1.06l5.5-5.5a.75.75 0 0 1 1.06 0Z",fill:"currentColor"}))}),ChevronLeftIcon=SvgChevronLeft;var __rest$S=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$S(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.47 5.97a.75.75 0 0 1 1.06 0l5.5 5.5a.75.75 0 0 1 0 1.06l-5.5 5.5a.75.75 0 1 1-1.06-1.06L14.44 12 9.47 7.03a.75.75 0 0 1 0-1.06Z",fill:"currentColor"}))}),ChevronRightIcon=SvgChevronRight;var __rest$R=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$R(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.47 7.97a.75.75 0 0 1 1.06 0l5.5 5.5a.75.75 0 1 1-1.06 1.06L12 9.56l-4.97 4.97a.75.75 0 0 1-1.06-1.06l5.5-5.5Z",fill:"currentColor"}))}),ChevronUpIcon=SvgChevronUp;var __rest$Q=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$Q(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2.25a.75.75 0 0 1 .656.387l9.527 17.25A.75.75 0 0 1 21.526 21H2.474a.75.75 0 0 1-.657-1.113l9.526-17.25A.75.75 0 0 1 12 2.25ZM12 8.75a.75.75 0 0 1 .75.75v4a.75.75 0 0 1-1.5 0v-4a.75.75 0 0 1 .75-.75Zm-1 7.75a1 1 0 1 1 2 0 1 1 0 0 1-2 0Z",fill:"currentColor"}))}),ExclamationmarkTriangleFillIcon=SvgExclamationmarkTriangleFill;var __rest$P=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$P(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5 2.25a.75.75 0 0 1 .75.75v2.25H17a.75.75 0 0 1 .6.3l3 4c.2.267.2.633 0 .9l-3 4a.75.75 0 0 1-.6.3h-4.75V21a.75.75 0 0 1-1.5 0v-6.25H4a.75.75 0 0 1-.6-1.2L6.063 10 3.4 6.45a.75.75 0 0 1 .6-1.2h6.75V3a.75.75 0 0 1 .75-.75Zm-3.9 8.2-2.1 2.8h11.125L19.063 10l-2.438-3.25H5.5l2.1 2.8c.2.267.2.633 0 .9Z",fill:"currentColor"}))}),HikingTrailSignIcon=SvgHikingTrailSign;var __rest$O=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$O(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.25 4A.75.75 0 0 1 4 3.25h16a.75.75 0 0 1 .75.75v16a.75.75 0 0 1-.75.75H4a.75.75 0 0 1-.75-.75V4ZM11 7.75a1 1 0 1 1 2 0 1 1 0 0 1-2 0Zm-1.25 3a.75.75 0 0 1 .75-.75H12a.75.75 0 0 1 .75.75v4.75h.75a.75.75 0 0 1 0 1.5h-3a.75.75 0 0 1 0-1.5h.75v-4h-.75a.75.75 0 0 1-.75-.75Z",fill:"currentColor"}))}),InformationSquareFillIcon=SvgInformationSquareFill;var __rest$N=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$N(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.638 4.417a3.252 3.252 0 0 0-4.608-.008l-9.378 9.379a.75.75 0 0 0-.191.324l-1.414 4.95a.75.75 0 0 0 .925.927l4.94-1.398a.75.75 0 0 0 .327-.191l9.39-9.391a3.252 3.252 0 0 0 .01-4.592ZM16.091 5.47a1.752 1.752 0 1 1 2.478 2.478l-.23.23-2.477-2.479.229-.23ZM14.8 6.76 6.85 14.71l-.991 3.47 3.457-.979 7.963-7.963-2.478-2.478Z",fill:"currentColor"}))}),PencilIcon=SvgPencil;var __rest$M=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$M(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.75 3.75v16.5h12.5V3.75H5.75Zm-1.5-.25c0-.69.56-1.25 1.25-1.25h13c.69 0 1.25.56 1.25 1.25v17c0 .69-.56 1.25-1.25 1.25h-13c-.69 0-1.25-.56-1.25-1.25v-17ZM12 7.25a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5ZM8.25 9.5a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0Zm1.805 7.055a2.75 2.75 0 0 1 4.667 1.552.75.75 0 1 0 1.484-.214 4.25 4.25 0 0 0-8.413 0 .75.75 0 0 0 1.485.214 2.75 2.75 0 0 1 .777-1.552Z",fill:"currentColor"}))}),PersonRectangleIcon=SvgPersonRectangle;var __rest$L=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$L(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{d:"M12.75 5.5a.75.75 0 0 0-1.5 0v5.75H5.5a.75.75 0 0 0 0 1.5h5.75v5.75a.75.75 0 0 0 1.5 0v-5.75h5.75a.75.75 0 0 0 0-1.5h-5.75V5.5Z",fill:"currentColor"}))}),PlusIcon=SvgPlus;var __rest$K=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$K(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 2.25a.75.75 0 0 0-.75.75v4.25H4A1.75 1.75 0 0 0 2.25 9v9c0 .414.336.75.75.75h3.25V21c0 .414.336.75.75.75h10a.75.75 0 0 0 .75-.75v-2.25H21a.75.75 0 0 0 .75-.75V9A1.75 1.75 0 0 0 20 7.25h-2.25V3a.75.75 0 0 0-.75-.75H7ZM3.75 9A.25.25 0 0 1 4 8.75h16a.25.25 0 0 1 .25.25v8.25h-2.5V12a.75.75 0 0 0-.75-.75H7a.75.75 0 0 0-.75.75v5.25h-2.5V9Zm12.5-1.75v-3.5h-8.5v3.5h8.5Zm-8.5 5.5v7.5h8.5v-7.5h-8.5ZM9.25 15a.75.75 0 0 1 .75-.75h4a.75.75 0 0 1 0 1.5h-4a.75.75 0 0 1-.75-.75Zm0 3a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5H10a.75.75 0 0 1-.75-.75Z",fill:"currentColor"}))}),PrinterSmallIcon=SvgPrinterSmall;var __rest$J=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=__rest$J(T,["title","titleId"]);let Y=useId$1();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.742 2.47a.75.75 0 0 1 .53-.22h7.456a.75.75 0 0 1 .53.22l5.272 5.272c.141.14.22.331.22.53v7.456a.75.75 0 0 1-.22.53l-5.272 5.272a.75.75 0 0 1-.53.22H8.272a.75.75 0 0 1-.53-.22L2.47 16.258a.75.75 0 0 1-.22-.53V8.272a.75.75 0 0 1 .22-.53L7.742 2.47Zm1.288 5.5a.75.75 0 0 0-1.06 1.06L10.94 12l-2.97 2.97a.75.75 0 1 0 1.06 1.06L12 13.06l2.97 2.97a.75.75 0 1 0 1.06-1.06L13.06 12l2.97-2.97a.75.75 0 0 0-1.06-1.06L12 10.94 9.03 7.97Z",fill:"currentColor"}))}),XMarkOctagonFillIcon=SvgXMarkOctagonFill;var __rest$I=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var $,{children:V,className:K,onClick:Y}=T,J=__rest$I(T,["children","className","onClick"]);const re=reactExports.useContext(AccordionItemContext),ne=reactExports.useContext(AccordionContext);return re===null?(console.error(" has to be used within an , which in turn must be within an "),null):React.createElement("button",Object.assign({ref:C},J,{className:clsx$1("navds-accordion__header",K),onClick:composeEventHandlers(Y,re.toggleOpen),"aria-expanded":re.open,type:"button"}),React.createElement("span",{className:"navds-accordion__icon-wrapper"},React.createElement(ChevronDownIcon,{className:"navds-accordion__header-chevron",title:"Vis mer","aria-hidden":!0})),React.createElement(Heading,{size:($=ne==null?void 0:ne.headingSize)!==null&&$!==void 0?$:"small",as:"span",className:"navds-accordion__header-content"},V))}),AccordionHeader$1=AccordionHeader;var __rest$H=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$,variant:V="default",headingSize:K="small",size:Y="medium",indent:J=!0}=T,re=__rest$H(T,["className","variant","headingSize","size","indent"]);return React.createElement(AccordionContext.Provider,{value:{variant:V,headingSize:K,size:Y,mounted:!0}},React.createElement("div",Object.assign({},re,{className:clsx$1("navds-accordion",$,`navds-accordion--${Y}`,{"navds-accordion--indent":J}),ref:C})))});Accordion.Header=AccordionHeader$1;Accordion.Content=AccordionContent$1;Accordion.Item=AccordionItem$1;const Accordion$1=Accordion,noMatchMedia=typeof window<"u"&&window.matchMedia===void 0,useMedia=(T,C)=>{const[$,V]=reactExports.useState(C);return reactExports.useEffect(()=>{if(noMatchMedia)return;const K=window.matchMedia(T);V(K.matches);const Y=J=>{V(J.matches)};return K.addEventListener("change",Y),()=>{K.removeEventListener("change",Y)}},[T]),$};var __rest$G=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{variant:C}=T,$=__rest$G(T,["variant"]);switch(C){case"error":return React.createElement(XMarkOctagonFillIcon,Object.assign({title:"Feil"},$));case"warning":return React.createElement(ExclamationmarkTriangleFillIcon,Object.assign({title:"Advarsel"},$));case"info":return React.createElement(InformationSquareFillIcon,Object.assign({title:"Informasjon"},$));case"success":return React.createElement(CheckmarkCircleFillIcon,Object.assign({title:"Suksess"},$));default:return null}},Alert=reactExports.forwardRef((T,C)=>{var{children:$,className:V,variant:K,size:Y="medium",fullWidth:J=!1,inline:re=!1,closeButton:ne=!1,onClose:te}=T,se=__rest$G(T,["children","className","variant","size","fullWidth","inline","closeButton","onClose"]);return React.createElement("div",Object.assign({},se,{ref:C,className:clsx$1(V,"navds-alert",`navds-alert--${K}`,`navds-alert--${Y}`,{"navds-alert--full-width":J,"navds-alert--inline":re,"navds-alert--close-button":ne})}),React.createElement(Icon,{variant:K,className:"navds-alert__icon"}),React.createElement(BodyLong$1,{as:"div",size:Y,className:"navds-alert__wrapper"},$),ne&&!re&&React.createElement("div",{className:"navds-alert__button-wrapper"},React.createElement(Button$1,{className:"navds-alert__button",size:"small",variant:"tertiary-neutral",onClick:te,type:"button",icon:React.createElement(XMarkIcon,{title:"Lukk Alert"})})))}),Alert$1=Alert;var __rest$F=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$,children:V,variant:K="action",removeLabel:Y="slett",onDelete:J,type:re="button",onClick:ne}=T,te=__rest$F(T,["className","children","variant","removeLabel","onDelete","type","onClick"]);return React.createElement("button",Object.assign({},te,{ref:C,type:re,className:clsx$1("navds-chips__chip navds-chips__removable navds-chips--icon-right",$,`navds-chips__removable--${K}`),"aria-label":`${V} ${Y}`,onClick:composeEventHandlers(ne,J)}),React.createElement("span",{className:"navds-chips__chip-text"},V),React.createElement("span",{className:"navds-chips__removable-icon"},React.createElement(XMarkIcon,{"aria-hidden":!0})))}),RemovableChips$1=RemovableChips;var __rest$E=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$,children:V,selected:K,variant:Y="action",checkmark:J=!0,as:re="button"}=T,ne=__rest$E(T,["className","children","selected","variant","checkmark","as"]);return React.createElement(re,Object.assign({},ne,{ref:C,className:clsx$1("navds-chips__chip navds-chips__toggle",$,`navds-chips__toggle--${Y}`,{"navds-chips__toggle--with-checkmark":J}),"aria-pressed":K}),J&&React.createElement("svg",{"aria-hidden":!0,className:"navds-chips__toggle-icon",width:"1.25em",height:"1.25em",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img"},K?React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 18.125C14.4873 18.125 18.125 14.4873 18.125 10C18.125 5.51269 14.4873 1.875 10 1.875C5.51269 1.875 1.875 5.51269 1.875 10C1.875 14.4873 5.51269 18.125 10 18.125ZM14.128 7.72904C14.3695 7.44357 14.3339 7.01635 14.0485 6.7748C13.763 6.53326 13.3358 6.56886 13.0942 6.85432L8.60428 12.1606L6.41627 9.97263C6.15185 9.70822 5.72315 9.70822 5.45873 9.97263C5.19431 10.2371 5.19431 10.6658 5.45873 10.9302L8.16706 13.6385C8.30095 13.7724 8.48479 13.8441 8.67397 13.8362C8.86316 13.8284 9.0404 13.7416 9.16271 13.5971L14.128 7.72904Z",fill:"currentColor"}):React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 3.125C6.20304 3.125 3.125 6.20304 3.125 10C3.125 13.797 6.20304 16.875 10 16.875C13.797 16.875 16.875 13.797 16.875 10C16.875 6.20304 13.797 3.125 10 3.125ZM1.875 10C1.875 5.51269 5.51269 1.875 10 1.875C14.4873 1.875 18.125 5.51269 18.125 10C18.125 14.4873 14.4873 18.125 10 18.125C5.51269 18.125 1.875 14.4873 1.875 10Z",fill:"var(--ac-chip-toggle-circle-border, var(--a-border-default))"})),React.createElement("span",{className:"navds-chips__chip-text"},V))}),ToggleChips$1=ToggleChips;var __rest$D=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$,size:V="medium",children:K}=T,Y=__rest$D(T,["className","size","children"]);return React.createElement("ul",Object.assign({},Y,{ref:C,className:clsx$1("navds-chips",$,`navds-chips--${V}`,{"navds-body-short navds-body-short--small":V==="medium","navds-detail navds-detail--small":V==="small"})}),React.Children.map(K,(J,re)=>React.createElement("li",{key:(J==null?void 0:J.toString())||re},J)))});Chips.Toggle=ToggleChips$1;Chips.Removable=RemovableChips$1;const Chips$1=Chips;var __assign=function(){return __assign=Object.assign||function(C){for(var $,V=1,K=arguments.length;V1&&(oe||!le),de=K>1&&(le||!oe),he=function(){ne&&se(ne)},me=function(){te&&se(te)},ge=($=J==null?void 0:J.CaptionLabel)!==null&&$!==void 0?$:CaptionLabel,ye=React.createElement(ge,{id:T.id,displayMonth:T.displayMonth});return React.createElement(React.Fragment,null,ye,React.createElement(Navigation,{displayMonth:T.displayMonth,hideNext:ce,hidePrevious:de,nextMonth:te,previousMonth:ne,onPreviousClick:he,onNextClick:me}))}function Caption$1(T){var C,$=useDayPicker(),V=$.classNames,K=$.disableNavigation,Y=$.styles,J=$.captionLayout,re=$.components,ne=(C=re==null?void 0:re.CaptionLabel)!==null&&C!==void 0?C:CaptionLabel,te;return K?te=React.createElement(ne,{id:T.id,displayMonth:T.displayMonth}):J==="dropdown"?te=React.createElement(CaptionDropdowns,{displayMonth:T.displayMonth,id:T.id}):te=React.createElement(CaptionNavigation,{displayMonth:T.displayMonth,id:T.id}),React.createElement("div",{className:V.caption,style:Y.caption},te)}function Footer(){var T=useDayPicker(),C=T.footer,$=T.styles,V=T.classNames.tfoot;return C?React.createElement("tfoot",{className:V,style:$.tfoot},React.createElement("tr",null,React.createElement("td",{colSpan:8},C))):React.createElement(React.Fragment,null)}function getWeekdays$1(T,C,$){for(var V=$?startOfISOWeek(new Date):startOfWeek(new Date,{locale:T,weekStartsOn:C}),K=[],Y=0;Y<7;Y++){var J=addDays(V,Y);K.push(J)}return K}function HeadRow$1(){var T=useDayPicker(),C=T.classNames,$=T.styles,V=T.showWeekNumber,K=T.locale,Y=T.weekStartsOn,J=T.ISOWeek,re=T.formatters.formatWeekdayName,ne=T.labels.labelWeekday,te=getWeekdays$1(K,Y,J);return React.createElement("tr",{style:$.head_row,className:C.head_row},V&&React.createElement("th",{scope:"col",style:$.head_cell,className:C.head_cell}),te.map(function(se,ie){return React.createElement("th",{key:ie,scope:"col",className:C.head_cell,style:$.head_cell},React.createElement("span",{"aria-hidden":!0},re(se,{locale:K})),React.createElement("span",{className:C.vhidden},ne(se,{locale:K})))}))}function Head(){var T,C=useDayPicker(),$=C.classNames,V=C.styles,K=C.components,Y=(T=K==null?void 0:K.HeadRow)!==null&&T!==void 0?T:HeadRow$1;return React.createElement("thead",{style:V.head,className:$.head},React.createElement(Y,null))}function DayContent(T){var C=useDayPicker(),$=C.locale,V=C.formatters.formatDay;return React.createElement(React.Fragment,null,V(T.date,{locale:$}))}var SelectMultipleContext=reactExports.createContext(void 0);function SelectMultipleProvider(T){if(!isDayPickerMultiple(T.initialProps)){var C={selected:void 0,modifiers:{disabled:[]}};return React.createElement(SelectMultipleContext.Provider,{value:C},T.children)}return React.createElement(SelectMultipleProviderInternal,{initialProps:T.initialProps,children:T.children})}function SelectMultipleProviderInternal(T){var C=T.initialProps,$=T.children,V=C.selected,K=C.min,Y=C.max,J=function(te,se,ie){var ae,oe;(ae=C.onDayClick)===null||ae===void 0||ae.call(C,te,se,ie);var le=!!(se.selected&&K&&(V==null?void 0:V.length)===K);if(!le){var ce=!!(!se.selected&&Y&&(V==null?void 0:V.length)===Y);if(!ce){var de=V?__spreadArray$2([],V,!0):[];if(se.selected){var he=de.findIndex(function(me){return isSameDay(te,me)});de.splice(he,1)}else de.push(te);(oe=C.onSelect)===null||oe===void 0||oe.call(C,de,te,se,ie)}}},re={disabled:[]};V&&re.disabled.push(function(te){var se=Y&&V.length>Y-1,ie=V.some(function(ae){return isSameDay(ae,te)});return!!(se&&!ie)});var ne={selected:V,onDayClick:J,modifiers:re};return React.createElement(SelectMultipleContext.Provider,{value:ne},$)}function useSelectMultiple(){var T=reactExports.useContext(SelectMultipleContext);if(!T)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return T}function addToRange(T,C){var $=C||{},V=$.from,K=$.to;if(!V)return{from:T,to:void 0};if(!K&&isSameDay(V,T))return{from:V,to:T};if(!K&&isBefore(T,V))return{from:T,to:V};if(!K)return{from:V,to:T};if(!(isSameDay(K,T)&&isSameDay(V,T))){if(isSameDay(K,T))return{from:K,to:void 0};if(!isSameDay(V,T))return isAfter(V,T)?{from:T,to:K}:{from:V,to:T}}}var SelectRangeContext=reactExports.createContext(void 0);function SelectRangeProvider(T){if(!isDayPickerRange(T.initialProps)){var C={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return React.createElement(SelectRangeContext.Provider,{value:C},T.children)}return React.createElement(SelectRangeProviderInternal,{initialProps:T.initialProps,children:T.children})}function SelectRangeProviderInternal(T){var C=T.initialProps,$=T.children,V=C.selected,K=V||{},Y=K.from,J=K.to,re=C.min,ne=C.max,te=function(oe,le,ce){var de,he;(de=C.onDayClick)===null||de===void 0||de.call(C,oe,le,ce);var me=addToRange(oe,V);(he=C.onSelect)===null||he===void 0||he.call(C,me,oe,le,ce)},se={range_start:[],range_end:[],range_middle:[],disabled:[]};if(Y&&(se.range_start=[Y],J?(se.range_end=[J],se.range_middle=[{after:Y,before:J}]):se.range_end=[Y]),re&&(Y&&!J&&se.disabled.push({after:subDays(Y,re-1),before:addDays(Y,re-1)}),Y&&J&&se.disabled.push({after:Y,before:addDays(Y,re-1)})),ne&&(Y&&!J&&(se.disabled.push({before:addDays(Y,-ne+1)}),se.disabled.push({after:addDays(Y,ne-1)})),Y&&J)){var ie=differenceInCalendarDays(J,Y)+1,ae=ne-ie;se.disabled.push({before:subDays(Y,ae)}),se.disabled.push({after:addDays(J,ae)})}return React.createElement(SelectRangeContext.Provider,{value:{selected:V,onDayClick:te,modifiers:se}},$)}function useSelectRange(){var T=reactExports.useContext(SelectRangeContext);if(!T)throw new Error("useSelectRange must be used within a SelectRangeProvider");return T}function matcherToArray(T){return Array.isArray(T)?T:T!==void 0?[T]:[]}function getCustomModifiers(T){var C={};return Object.entries(T).forEach(function($){var V=$[0],K=$[1];C[V]=matcherToArray(K)}),C}var InternalModifier;(function(T){T.Outside="outside",T.Disabled="disabled",T.Selected="selected",T.Hidden="hidden",T.Today="today",T.RangeStart="range_start",T.RangeEnd="range_end",T.RangeMiddle="range_middle"})(InternalModifier||(InternalModifier={}));var Selected=InternalModifier.Selected,Disabled=InternalModifier.Disabled,Hidden=InternalModifier.Hidden,Today=InternalModifier.Today,RangeEnd=InternalModifier.RangeEnd,RangeMiddle=InternalModifier.RangeMiddle,RangeStart=InternalModifier.RangeStart,Outside=InternalModifier.Outside;function getInternalModifiers(T,C,$){var V,K=(V={},V[Selected]=matcherToArray(T.selected),V[Disabled]=matcherToArray(T.disabled),V[Hidden]=matcherToArray(T.hidden),V[Today]=[T.today],V[RangeEnd]=[],V[RangeMiddle]=[],V[RangeStart]=[],V[Outside]=[],V);return T.fromDate&&K[Disabled].push({before:T.fromDate}),T.toDate&&K[Disabled].push({after:T.toDate}),isDayPickerMultiple(T)?K[Disabled]=K[Disabled].concat(C.modifiers[Disabled]):isDayPickerRange(T)&&(K[Disabled]=K[Disabled].concat($.modifiers[Disabled]),K[RangeStart]=$.modifiers[RangeStart],K[RangeMiddle]=$.modifiers[RangeMiddle],K[RangeEnd]=$.modifiers[RangeEnd]),K}var ModifiersContext=reactExports.createContext(void 0);function ModifiersProvider(T){var C=useDayPicker(),$=useSelectMultiple(),V=useSelectRange(),K=getInternalModifiers(C,$,V),Y=getCustomModifiers(C.modifiers),J=__assign(__assign({},K),Y);return React.createElement(ModifiersContext.Provider,{value:J},T.children)}function useModifiers(){var T=reactExports.useContext(ModifiersContext);if(!T)throw new Error("useModifiers must be used within a ModifiersProvider");return T}function isDateInterval(T){return!!(T&&typeof T=="object"&&"before"in T&&"after"in T)}function isDateRange(T){return!!(T&&typeof T=="object"&&"from"in T)}function isDateAfterType(T){return!!(T&&typeof T=="object"&&"after"in T)}function isDateBeforeType(T){return!!(T&&typeof T=="object"&&"before"in T)}function isDayOfWeekType(T){return!!(T&&typeof T=="object"&&"dayOfWeek"in T)}function isDateInRange(T,C){var $,V=C.from,K=C.to;if(!V)return!1;if(!K&&isSameDay(V,T))return!0;if(!K)return!1;var Y=differenceInCalendarDays(K,V)<0;return K&&Y&&($=[K,V],V=$[0],K=$[1]),differenceInCalendarDays(T,V)>=0&&differenceInCalendarDays(K,T)>=0}function isDateType(T){return isDate(T)}function isArrayOfDates(T){return Array.isArray(T)&&T.every(isDate)}function isMatch(T,C){return C.some(function($){if(typeof $=="boolean")return $;if(isDateType($))return isSameDay(T,$);if(isArrayOfDates($))return $.includes(T);if(isDateRange($))return isDateInRange(T,$);if(isDayOfWeekType($))return $.dayOfWeek.includes(T.getDay());if(isDateInterval($)){var V=differenceInCalendarDays($.before,T),K=differenceInCalendarDays($.after,T),Y=V>0,J=K<0,re=isAfter($.before,$.after);return re?J&&Y:Y||J}return isDateAfterType($)?differenceInCalendarDays(T,$.after)>0:isDateBeforeType($)?differenceInCalendarDays($.before,T)>0:typeof $=="function"?$(T):!1})}function getActiveModifiers(T,C,$){var V=Object.keys(C).reduce(function(Y,J){var re=C[J];return isMatch(T,re)&&Y.push(J),Y},[]),K={};return V.forEach(function(Y){return K[Y]=!0}),$&&!isSameMonth(T,$)&&(K.outside=!0),K}function getInitialFocusTarget(T,C){for(var $=startOfMonth(T[0]),V=endOfMonth(T[T.length-1]),K,Y,J=$;J<=V;){var re=getActiveModifiers(J,C),ne=!re.disabled&&!re.hidden;if(!ne){J=addDays(J,1);continue}if(re.selected)return J;re.today&&!Y&&(Y=J),K||(K=J),J=addDays(J,1)}return Y||K}var MAX_RETRY=365;function getNextFocus(T,C){var $=C.moveBy,V=C.direction,K=C.context,Y=C.modifiers,J=C.retry,re=J===void 0?{count:0,lastFocused:T}:J,ne=K.weekStartsOn,te=K.fromDate,se=K.toDate,ie=K.locale,ae={day:addDays,week:addWeeks,month:addMonths,year:addYears,startOfWeek:function(de){return K.ISOWeek?startOfISOWeek(de):startOfWeek(de,{locale:ie,weekStartsOn:ne})},endOfWeek:function(de){return K.ISOWeek?endOfISOWeek(de):endOfWeek(de,{locale:ie,weekStartsOn:ne})}},oe=ae[$](T,V==="after"?1:-1);V==="before"&&te?oe=max([te,oe]):V==="after"&&se&&(oe=min([se,oe]));var le=!0;if(Y){var ce=getActiveModifiers(oe,Y);le=!ce.disabled&&!ce.hidden}return le?oe:re.count>MAX_RETRY?re.lastFocused:getNextFocus(oe,{moveBy:$,direction:V,context:K,modifiers:Y,retry:__assign(__assign({},re),{count:re.count+1})})}var FocusContext=reactExports.createContext(void 0);function FocusProvider(T){var C=useNavigation(),$=useModifiers(),V=reactExports.useState(),K=V[0],Y=V[1],J=reactExports.useState(),re=J[0],ne=J[1],te=getInitialFocusTarget(C.displayMonths,$),se=K??(re&&C.isDateDisplayed(re))?re:te,ie=function(){ne(K),Y(void 0)},ae=function(de){Y(de)},oe=useDayPicker(),le=function(de,he){if(K){var me=getNextFocus(K,{moveBy:de,direction:he,context:oe,modifiers:$});isSameDay(K,me)||(C.goToDate(me,K),ae(me))}},ce={focusedDay:K,focusTarget:se,blur:ie,focus:ae,focusDayAfter:function(){return le("day","after")},focusDayBefore:function(){return le("day","before")},focusWeekAfter:function(){return le("week","after")},focusWeekBefore:function(){return le("week","before")},focusMonthBefore:function(){return le("month","before")},focusMonthAfter:function(){return le("month","after")},focusYearBefore:function(){return le("year","before")},focusYearAfter:function(){return le("year","after")},focusStartOfWeek:function(){return le("startOfWeek","before")},focusEndOfWeek:function(){return le("endOfWeek","after")}};return React.createElement(FocusContext.Provider,{value:ce},T.children)}function useFocusContext(){var T=reactExports.useContext(FocusContext);if(!T)throw new Error("useFocusContext must be used within a FocusProvider");return T}function useActiveModifiers(T,C){var $=useModifiers(),V=getActiveModifiers(T,$,C);return V}var SelectSingleContext=reactExports.createContext(void 0);function SelectSingleProvider(T){if(!isDayPickerSingle(T.initialProps)){var C={selected:void 0};return React.createElement(SelectSingleContext.Provider,{value:C},T.children)}return React.createElement(SelectSingleProviderInternal,{initialProps:T.initialProps,children:T.children})}function SelectSingleProviderInternal(T){var C=T.initialProps,$=T.children,V=function(Y,J,re){var ne,te,se;if((ne=C.onDayClick)===null||ne===void 0||ne.call(C,Y,J,re),J.selected&&!C.required){(te=C.onSelect)===null||te===void 0||te.call(C,void 0,Y,J,re);return}(se=C.onSelect)===null||se===void 0||se.call(C,Y,Y,J,re)},K={selected:C.selected,onDayClick:V};return React.createElement(SelectSingleContext.Provider,{value:K},$)}function useSelectSingle(){var T=reactExports.useContext(SelectSingleContext);if(!T)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return T}function useDayEventHandlers(T,C){var $=useDayPicker(),V=useSelectSingle(),K=useSelectMultiple(),Y=useSelectRange(),J=useFocusContext(),re=J.focusDayAfter,ne=J.focusDayBefore,te=J.focusWeekAfter,se=J.focusWeekBefore,ie=J.blur,ae=J.focus,oe=J.focusMonthBefore,le=J.focusMonthAfter,ce=J.focusYearBefore,de=J.focusYearAfter,he=J.focusStartOfWeek,me=J.focusEndOfWeek,ge=function(Ie){var Ne,pt,at,dt;isDayPickerSingle($)?(Ne=V.onDayClick)===null||Ne===void 0||Ne.call(V,T,C,Ie):isDayPickerMultiple($)?(pt=K.onDayClick)===null||pt===void 0||pt.call(K,T,C,Ie):isDayPickerRange($)?(at=Y.onDayClick)===null||at===void 0||at.call(Y,T,C,Ie):(dt=$.onDayClick)===null||dt===void 0||dt.call($,T,C,Ie)},ye=function(Ie){var Ne;ae(T),(Ne=$.onDayFocus)===null||Ne===void 0||Ne.call($,T,C,Ie)},fe=function(Ie){var Ne;ie(),(Ne=$.onDayBlur)===null||Ne===void 0||Ne.call($,T,C,Ie)},Te=function(Ie){var Ne;(Ne=$.onDayMouseEnter)===null||Ne===void 0||Ne.call($,T,C,Ie)},Pe=function(Ie){var Ne;(Ne=$.onDayMouseLeave)===null||Ne===void 0||Ne.call($,T,C,Ie)},De=function(Ie){var Ne;(Ne=$.onDayTouchCancel)===null||Ne===void 0||Ne.call($,T,C,Ie)},xe=function(Ie){var Ne;(Ne=$.onDayTouchEnd)===null||Ne===void 0||Ne.call($,T,C,Ie)},Ce=function(Ie){var Ne;(Ne=$.onDayTouchMove)===null||Ne===void 0||Ne.call($,T,C,Ie)},je=function(Ie){var Ne;(Ne=$.onDayTouchStart)===null||Ne===void 0||Ne.call($,T,C,Ie)},Le=function(Ie){var Ne;(Ne=$.onDayKeyUp)===null||Ne===void 0||Ne.call($,T,C,Ie)},Ke=function(Ie){var Ne;switch(Ie.key){case"ArrowLeft":Ie.preventDefault(),Ie.stopPropagation(),$.dir==="rtl"?re():ne();break;case"ArrowRight":Ie.preventDefault(),Ie.stopPropagation(),$.dir==="rtl"?ne():re();break;case"ArrowDown":Ie.preventDefault(),Ie.stopPropagation(),te();break;case"ArrowUp":Ie.preventDefault(),Ie.stopPropagation(),se();break;case"PageUp":Ie.preventDefault(),Ie.stopPropagation(),Ie.shiftKey?ce():oe();break;case"PageDown":Ie.preventDefault(),Ie.stopPropagation(),Ie.shiftKey?de():le();break;case"Home":Ie.preventDefault(),Ie.stopPropagation(),he();break;case"End":Ie.preventDefault(),Ie.stopPropagation(),me();break}(Ne=$.onDayKeyDown)===null||Ne===void 0||Ne.call($,T,C,Ie)},Se={onClick:ge,onFocus:ye,onBlur:fe,onKeyDown:Ke,onKeyUp:Le,onMouseEnter:Te,onMouseLeave:Pe,onTouchCancel:De,onTouchEnd:xe,onTouchMove:Ce,onTouchStart:je};return Se}function useSelectedDays(){var T=useDayPicker(),C=useSelectSingle(),$=useSelectMultiple(),V=useSelectRange(),K=isDayPickerSingle(T)?C.selected:isDayPickerMultiple(T)?$.selected:isDayPickerRange(T)?V.selected:void 0;return K}function isInternalModifier(T){return Object.values(InternalModifier).includes(T)}function getDayClassNames(T,C){var $=[T.classNames.day];return Object.keys(C).forEach(function(V){var K=T.modifiersClassNames[V];if(K)$.push(K);else if(isInternalModifier(V)){var Y=T.classNames["day_".concat(V)];Y&&$.push(Y)}}),$}function getDayStyle(T,C){var $=__assign({},T.styles.day);return Object.keys(C).forEach(function(V){var K;$=__assign(__assign({},$),(K=T.modifiersStyles)===null||K===void 0?void 0:K[V])}),$}function useDayRender(T,C,$){var V,K,Y,J=useDayPicker(),re=useFocusContext(),ne=useActiveModifiers(T,C),te=useDayEventHandlers(T,ne),se=useSelectedDays(),ie=!!(J.onDayClick||J.mode!=="default");reactExports.useEffect(function(){var Te;ne.outside||re.focusedDay&&ie&&isSameDay(re.focusedDay,T)&&((Te=$.current)===null||Te===void 0||Te.focus())},[re.focusedDay,T,$,ie,ne.outside]);var ae=getDayClassNames(J,ne).join(" "),oe=getDayStyle(J,ne),le=J.labels.labelDay(T,ne,{locale:J.locale}),ce=!!(ne.outside&&!J.showOutsideDays||ne.hidden),de=(Y=(K=J.components)===null||K===void 0?void 0:K.DayContent)!==null&&Y!==void 0?Y:DayContent,he=React.createElement(de,{date:T,displayMonth:C,activeModifiers:ne}),me={style:oe,className:ae,children:he,"aria-label":le},ge=re.focusTarget&&isSameDay(re.focusTarget,T)&&!ne.outside,ye=__assign(__assign(__assign({},me),(V={disabled:ne.disabled},V["aria-pressed"]=ne.selected,V["aria-label"]=le,V.tabIndex=ge?0:-1,V)),te),fe={isButton:ie,isHidden:ce,activeModifiers:ne,selectedDays:se,buttonProps:ye,divProps:me};return fe}function Day(T){var C=reactExports.useRef(null),$=useDayRender(T.date,T.displayMonth,C);return $.isHidden?React.createElement(React.Fragment,null):$.isButton?React.createElement(Button,__assign({name:"day",ref:C},$.buttonProps)):React.createElement("div",__assign({},$.divProps))}function WeekNumber$1(T){var C=T.number,$=T.dates,V=useDayPicker(),K=V.onWeekNumberClick,Y=V.styles,J=V.classNames,re=V.locale,ne=V.labels.labelWeekNumber,te=V.formatters.formatWeekNumber,se=te(Number(C),{locale:re});if(!K)return React.createElement("span",{className:J.weeknumber,style:Y.weeknumber},se);var ie=ne(Number(C),{locale:re}),ae=function(oe){K(C,$,oe)};return React.createElement(Button,{name:"week-number","aria-label":ie,className:J.weeknumber,style:Y.weeknumber,onClick:ae},se)}function Row$3(T){var C,$,V=useDayPicker(),K=V.styles,Y=V.classNames,J=V.showWeekNumber,re=V.components,ne=(C=re==null?void 0:re.Day)!==null&&C!==void 0?C:Day,te=($=re==null?void 0:re.WeekNumber)!==null&&$!==void 0?$:WeekNumber$1,se;return J&&(se=React.createElement("td",{className:Y.cell,style:K.cell},React.createElement(te,{number:T.weekNumber,dates:T.dates}))),React.createElement("tr",{className:Y.row,style:K.row},se,T.dates.map(function(ie){return React.createElement("td",{className:Y.cell,style:K.cell,key:getUnixTime(ie)},React.createElement(ne,{displayMonth:T.displayMonth,date:ie}))}))}function daysToMonthWeeks$1(T,C,$){for(var V=$!=null&&$.ISOWeek?endOfISOWeek(C):endOfWeek(C,$),K=$!=null&&$.ISOWeek?startOfISOWeek(T):startOfWeek(T,$),Y=differenceInCalendarDays(V,K),J=[],re=0;re<=Y;re++)J.push(addDays(K,re));var ne=J.reduce(function(te,se){var ie=$!=null&&$.ISOWeek?getISOWeek(se):getWeek(se,$),ae=te.find(function(oe){return oe.weekNumber===ie});return ae?(ae.dates.push(se),te):(te.push({weekNumber:ie,dates:[se]}),te)},[]);return ne}function getMonthWeeks$1(T,C){var $=daysToMonthWeeks$1(startOfMonth(T),endOfMonth(T),C);if(C!=null&&C.useFixedWeeks){var V=getWeeksInMonth(T,C);if(V<6){var K=$[$.length-1],Y=K.dates[K.dates.length-1],J=addWeeks(Y,6-V),re=daysToMonthWeeks$1(addWeeks(Y,1),J,C);$.push.apply($,re)}}return $}function Table$1(T){var C,$,V,K=useDayPicker(),Y=K.locale,J=K.classNames,re=K.styles,ne=K.hideHead,te=K.fixedWeeks,se=K.components,ie=K.weekStartsOn,ae=K.firstWeekContainsDate,oe=K.ISOWeek,le=getMonthWeeks$1(T.displayMonth,{useFixedWeeks:!!te,ISOWeek:oe,locale:Y,weekStartsOn:ie,firstWeekContainsDate:ae}),ce=(C=se==null?void 0:se.Head)!==null&&C!==void 0?C:Head,de=($=se==null?void 0:se.Row)!==null&&$!==void 0?$:Row$3,he=(V=se==null?void 0:se.Footer)!==null&&V!==void 0?V:Footer;return React.createElement("table",{className:J.table,style:re.table,role:"grid","aria-labelledby":T["aria-labelledby"]},!ne&&React.createElement(ce,null),React.createElement("tbody",{className:J.tbody,style:re.tbody},le.map(function(me){return React.createElement(de,{displayMonth:T.displayMonth,key:me.weekNumber,dates:me.dates,weekNumber:me.weekNumber})})),React.createElement(he,null))}function canUseDOM(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var useIsomorphicLayoutEffect$1=canUseDOM()?reactExports.useLayoutEffect:reactExports.useEffect,serverHandoffComplete=!1,id$1=0;function genId(){return"react-day-picker-".concat(++id$1)}function useId(T){var C,$=T??(serverHandoffComplete?genId():null),V=reactExports.useState($),K=V[0],Y=V[1];return useIsomorphicLayoutEffect$1(function(){K===null&&Y(genId())},[]),reactExports.useEffect(function(){serverHandoffComplete===!1&&(serverHandoffComplete=!0)},[]),(C=T??K)!==null&&C!==void 0?C:void 0}function Month(T){var C,$,V=useDayPicker(),K=V.dir,Y=V.classNames,J=V.styles,re=V.components,ne=useNavigation().displayMonths,te=useId(V.id?"".concat(V.id,"-").concat(T.displayIndex):void 0),se=[Y.month],ie=J.month,ae=T.displayIndex===0,oe=T.displayIndex===ne.length-1,le=!ae&&!oe;K==="rtl"&&(C=[ae,oe],oe=C[0],ae=C[1]),ae&&(se.push(Y.caption_start),ie=__assign(__assign({},ie),J.caption_start)),oe&&(se.push(Y.caption_end),ie=__assign(__assign({},ie),J.caption_end)),le&&(se.push(Y.caption_between),ie=__assign(__assign({},ie),J.caption_between));var ce=($=re==null?void 0:re.Caption)!==null&&$!==void 0?$:Caption$1;return React.createElement("div",{key:T.displayIndex,className:se.join(" "),style:ie},React.createElement(ce,{id:te,displayMonth:T.displayMonth}),React.createElement(Table$1,{"aria-labelledby":te,displayMonth:T.displayMonth}))}function Root(){var T=useDayPicker(),C=useFocusContext(),$=useNavigation(),V=reactExports.useState(!1),K=V[0],Y=V[1];reactExports.useEffect(function(){T.initialFocus&&C.focusTarget&&(K||(C.focus(C.focusTarget),Y(!0)))},[T.initialFocus,K,C.focus,C.focusTarget,C]);var J=[T.classNames.root,T.className];T.numberOfMonths>1&&J.push(T.classNames.multiple_months),T.showWeekNumber&&J.push(T.classNames.with_weeknumber);var re=__assign(__assign({},T.styles.root),T.style);return React.createElement("div",{className:J.join(" "),style:re,dir:T.dir},React.createElement("div",{className:T.classNames.months,style:T.styles.months},$.displayMonths.map(function(ne,te){return React.createElement(Month,{key:te,displayIndex:te,displayMonth:ne})})))}function RootProvider(T){var C=T.children,$=__rest$C(T,["children"]);return React.createElement(DayPickerProvider,{initialProps:$},React.createElement(NavigationProvider,null,React.createElement(SelectSingleProvider,{initialProps:$},React.createElement(SelectMultipleProvider,{initialProps:$},React.createElement(SelectRangeProvider,{initialProps:$},React.createElement(ModifiersProvider,null,React.createElement(FocusProvider,null,C)))))))}function DayPicker(T){return React.createElement(RootProvider,__assign({},T),React.createElement(Root,null))}function isValidDate(T){return T&&!isNaN(T==null?void 0:T.getTime())&&T.getFullYear()>999}const INPUT_DATE_STRING_FORMAT_DATE="dd.MM.yyyy",INPUT_DATE_STRING_FORMAT_MONTH="MMMM yyyy",ALLOWED_INPUT_FORMATS_DATE=[INPUT_DATE_STRING_FORMAT_DATE,"ddMMyyyy","dd/MM/yyyy","dd-MM-yyyy"],ALLOWED_INPUT_FORMATS_MONTH=["M/yyyy","MM/yyyy","M-yyyy","MM-yyyy","MM.yyyy",INPUT_DATE_STRING_FORMAT_MONTH,...ALLOWED_INPUT_FORMATS_DATE],parseDate=(T,C,$,V,K)=>{let Y;const J=V==="date"?ALLOWED_INPUT_FORMATS_DATE:ALLOWED_INPUT_FORMATS_MONTH;if(K){for(const re of J)if(Y=parse(T,re,C,{locale:$}),isValidDate(Y)&&!isTwoDigitYear(T,C,$,J))return Y;for(const re of[...J.map(ne=>ne.replace("yyyy","yy"))])if(Y=parse(T,re,C,{locale:$}),isValidDate(Y)&&isTwoDigitYear(T,C,$,J)){const ne=assignCenturyToDate(T,re,C,$);return isValidDate(new Date(ne))?new Date(ne):new Date("Invalid date")}return new Date("Invalid date")}else{for(const re of J)if(Y=parse(T,re,C,{locale:$}),isValidDate(Y)&&!isTwoDigitYear(T,C,$,J))return Y;return new Date("Invalid date")}};function isTwoDigitYear(T,C,$,V){let K;const Y=V.map(J=>J.replace("yyyy","yy"));for(const J of Y)if(K=parse(T,J,C,{locale:$}),isValidDate(K))return!0;return!1}function assignCenturyToDate(T,C,$,V){const K=parse(appendCenturyToTwoYearDigitDateString(T,"19"),C.replace("yy","yyyy"),$,{locale:V}),Y=parse(appendCenturyToTwoYearDigitDateString(T,"20"),C.replace("yy","yyyy"),$,{locale:V});return isValidDate(K)&&isValidDate(Y)?isBefore(K,sub(new Date,{years:80}))?Y:K:new Date("Invalid date")}function appendCenturyToTwoYearDigitDateString(T,C){const $=T.slice(-2);return`${T.slice(0,T.length-2)}${C}${$}`}const formatDateForInput=(T,C,$,V)=>format(T,V??($==="date"?INPUT_DATE_STRING_FORMAT_DATE:INPUT_DATE_STRING_FORMAT_MONTH),{locale:C}),getMonths=(T,C,$)=>{const V=[];if(isSameYear(T,C)){const K=startOfMonth(T);for(let Y=T.getMonth();Y<=C.getMonth();Y++)V.push(setMonth(K,Y))}else if(isSameYear($,C)){const K=startOfMonth(new Date);for(let Y=0;Y<=C.getMonth();Y++)V.push(setMonth(K,Y))}else if(isSameYear($,T)){const K=startOfMonth(T);for(let Y=K.getMonth();Y<=11;Y++)V.push(setMonth(K,Y))}else{const K=startOfMonth(new Date);for(let Y=0;Y<=11;Y++)V.push(setMonth(K,Y))}return V.map(K=>K.getMonth()).includes($.getMonth())||V.push($),V.sort((K,Y)=>K.getMonth()-Y.getMonth()),V},getYears=(T,C,$)=>{const V=[],K=T.getFullYear(),Y=C.getFullYear();for(let J=K;J<=Y;J++)V.push(setYear(startOfYear(new Date),J));return(K>$||Y<$)&&V.push(setYear(startOfYear(new Date),$)),V.sort((J,re)=>J.getFullYear()-re.getFullYear()),V},labelNext=(T,C)=>{var $;switch(($=C==null?void 0:C.locale)===null||$===void 0?void 0:$.code){case"nb":return"Gå til neste måned";case"nn":return"Gå til neste månad";case"en":return"Go to next month";default:return"Gå til neste måned"}},labelPrevious=(T,C)=>{var $;switch(($=C==null?void 0:C.locale)===null||$===void 0?void 0:$.code){case"nb":return"Gå til forrige måned";case"nn":return"Gå til førre månad";case"en":return"Go to previous month";default:return"Gå til forrige måned"}},labelYearDropdown=T=>{switch(T==null?void 0:T.code){case"nb":return"År";case"nn":return"År";case"en":return"Year";default:return"År"}},labelMonthDropdown=T=>{switch(T==null?void 0:T.code){case"nb":return"Måned";case"nn":return"Månad";case"en":return"Month";default:return"Måned"}},labels={labelNext,labelPrevious},labelWeekNumber=({localeCode:T,week:C})=>{switch(T){case"nb":return`Uke ${C}`;case"nn":return`Veke ${C}`;case"en-GB":return`Week ${C}`;default:return`Uke ${C}`}},labelWeekNumberButton=({localeCode:T,week:C})=>{switch(T){case"nb":return`Velg uke ${C}`;case"nn":return`Vel veke ${C}`;case"en-GB":return`Pick week ${C}`;default:return`Velg uke ${C}`}},labelWeek=T=>{switch(T){case"nb":return"Uke:";case"nn":return"Veke:";case"en-GB":return"Week:";default:return"Uke:"}},modalLabelSingle=T=>{switch(T){case"nb":return"Velg dato";case"nn":return"Vel dato";case"en-GB":return"Pick a date";default:return"Velg dato"}},modalLabelMultiple=T=>{switch(T){case"nb":return"Velg datoer";case"nn":return"Vel datoar";case"en-GB":return"Pick dates";default:return"Velg datoer"}},modalLabelRanged=T=>{switch(T){case"nb":return"Velg start- og sluttdato";case"nn":return"Vel start- og sluttdato";case"en-GB":return"Pick a start and end date";default:return"Velg start- og sluttdato"}},modalLabelMonth=T=>{switch(T){case"nb":return"Velg måned";case"nn":return"Vel månad";case"en-GB":return"Pick a month";default:return"Velg måned"}},modalLabel=(T,C)=>{switch(C){case"single":return modalLabelSingle(T);case"multiple":return modalLabelMultiple(T);case"range":return modalLabelRanged(T);case"month":return modalLabelMonth(T);default:return modalLabelSingle(T)}},modalCloseButtonLabel=T=>{switch(T){case"nb":return"Lukk";case"nn":return"Lukk";case"en-GB":return"Close";default:return"Lukk"}};var dateFormats$1={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"dd/MM/yyyy"},timeFormats$1={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$2={date:buildFormatLongFn({formats:dateFormats$1,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$1,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$1,defaultWidth:"full"})};const formatLong$3=formatLong$2;var locale$1={code:"en-GB",formatDistance:formatDistance$4,formatLong:formatLong$3,formatRelative:formatRelative$3,localize:localize$3,match:match$3,options:{weekStartsOn:1,firstWeekContainsDate:4}};const enGB=locale$1;var formatDistanceLocale={lessThanXSeconds:{one:"mindre enn ett sekund",other:"mindre enn {{count}} sekunder"},xSeconds:{one:"ett sekund",other:"{{count}} sekunder"},halfAMinute:"et halvt minutt",lessThanXMinutes:{one:"mindre enn ett minutt",other:"mindre enn {{count}} minutter"},xMinutes:{one:"ett minutt",other:"{{count}} minutter"},aboutXHours:{one:"omtrent en time",other:"omtrent {{count}} timer"},xHours:{one:"en time",other:"{{count}} timer"},xDays:{one:"en dag",other:"{{count}} dager"},aboutXWeeks:{one:"omtrent en uke",other:"omtrent {{count}} uker"},xWeeks:{one:"en uke",other:"{{count}} uker"},aboutXMonths:{one:"omtrent en måned",other:"omtrent {{count}} måneder"},xMonths:{one:"en måned",other:"{{count}} måneder"},aboutXYears:{one:"omtrent ett år",other:"omtrent {{count}} år"},xYears:{one:"ett år",other:"{{count}} år"},overXYears:{one:"over ett år",other:"over {{count}} år"},almostXYears:{one:"nesten ett år",other:"nesten {{count}} år"}},formatDistance=function(C,$,V){var K,Y=formatDistanceLocale[C];return typeof Y=="string"?K=Y:$===1?K=Y.one:K=Y.other.replace("{{count}}",String($)),V!=null&&V.addSuffix?V.comparison&&V.comparison>0?"om "+K:K+" siden":K};const formatDistance$1=formatDistance;var dateFormats={full:"EEEE d. MMMM y",long:"d. MMMM y",medium:"d. MMM y",short:"dd.MM.y"},timeFormats={full:"'kl'. HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats={full:"{{date}} 'kl.' {{time}}",long:"{{date}} 'kl.' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})};const formatLong$1=formatLong;var formatRelativeLocale={lastWeek:"'forrige' eeee 'kl.' p",yesterday:"'i går kl.' p",today:"'i dag kl.' p",tomorrow:"'i morgen kl.' p",nextWeek:"EEEE 'kl.' p",other:"P"},formatRelative=function(C,$,V,K){return formatRelativeLocale[C]};const formatRelative$1=formatRelative;var eraValues={narrow:["f.Kr.","e.Kr."],abbreviated:["f.Kr.","e.Kr."],wide:["før Kristus","etter Kristus"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. kvartal","2. kvartal","3. kvartal","4. kvartal"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mars","apr.","mai","juni","juli","aug.","sep.","okt.","nov.","des."],wide:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"]},dayValues={narrow:["S","M","T","O","T","F","L"],short:["sø","ma","ti","on","to","fr","lø"],abbreviated:["søn","man","tir","ons","tor","fre","lør"],wide:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på etterm.",evening:"på kvelden",night:"på natten"},abbreviated:{am:"a.m.",pm:"p.m.",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på etterm.",evening:"på kvelden",night:"på natten"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnatt",noon:"middag",morning:"på morgenen",afternoon:"på ettermiddagen",evening:"på kvelden",night:"på natten"}},ordinalNumber=function(C,$){var V=Number(C);return V+"."},localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:function(C){return C-1}}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide"})};const localize$1=localize;var matchOrdinalNumberPattern=/^(\d+)\.?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,abbreviated:/^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,wide:/^(før Kristus|før vår tid|etter Kristus|vår tid)/i},parseEraPatterns={any:[/^f/i,/^e/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? kvartal/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mars?|apr|mai|juni?|juli?|aug|sep|okt|nov|des)\.?/i,wide:/^(januar|februar|mars|april|mai|juni|juli|august|september|oktober|november|desember)/i},parseMonthPatterns={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,/^mai/i,/^jun/i,/^jul/i,/^aug/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns={narrow:/^[smtofl]/i,short:/^(sø|ma|ti|on|to|fr|lø)/i,abbreviated:/^(søn|man|tir|ons|tor|fre|lør)/i,wide:/^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i},parseDayPatterns={any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},matchDayPeriodPatterns={narrow:/^(midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten)|[ap])/i,any:/^([ap]\.?\s?m\.?|midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten))/i},parseDayPeriodPatterns={any:{am:/^a(\.?\s?m\.?)?$/i,pm:/^p(\.?\s?m\.?)?$/i,midnight:/^midn/i,noon:/^midd/i,morning:/morgen/i,afternoon:/ettermiddag/i,evening:/kveld/i,night:/natt/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:function(C){return parseInt(C,10)}}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:function(C){return C+1}}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})};const match$1=match;var locale={code:"nb",formatDistance:formatDistance$1,formatLong:formatLong$1,formatRelative:formatRelative$1,localize:localize$1,match:match$1,options:{weekStartsOn:1,firstWeekContainsDate:4}};const nb$1=locale,getLocaleFromString=(T="nb")=>{switch(T){case"nn":return nn$1;case"en":return enGB;default:return nb$1}};var __rest$B=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{const{className:$,hideLabel:V=!1,label:K,description:Y,variant:J="datepicker",setAnchorRef:re}=T,ne=__rest$B(T,["className","hideLabel","label","description","variant","setAnchorRef"]),te=reactExports.useRef(null),se=J==="datepicker",ie={prefix:se?"datepicker-input":"monthpicker-input",iconTitle:{open:se?"Åpne datovelger":"Åpne månedsvelger",close:se?"Lukk datovelger":"Lukk månedsvelger"}},ae=useDateInputContext(),{inputProps:oe,size:le="medium",inputDescriptionId:ce,errorId:de,showErrorMsg:he,hasError:me,readOnly:ge}=useFormField(T,ie.prefix);return React.createElement("div",{className:clsx$1($,"navds-form-field",`navds-form-field--${le}`,"navds-date__field",{"navds-text-field--error":me,"navds-date__field--error":me,"navds-form-field--disabled":!!oe.disabled,"navds-text-field--disabled":!!oe.disabled,"navds-form-field--readonly":ge,"navds-text-field--readonly":ge,"navds-date__field--readonly":ge})},React.createElement(Label,{htmlFor:oe.id,size:le,className:clsx$1("navds-form-field__label",{"navds-sr-only":V})},React.createElement(ReadOnlyIcon,{readOnly:ge}),K),!!Y&&React.createElement(BodyShort,{as:"div",className:clsx$1("navds-form-field__description",{"navds-sr-only":V}),id:ce,size:le},Y),React.createElement("div",{className:"navds-date__field-wrapper"},React.createElement("input",Object.assign({ref:C},omit(ne,["error","errorId","size"]),oe,{autoComplete:"off","aria-controls":ae!=null&&ae.open?ae.ariaId:void 0,readOnly:ge,className:clsx$1("navds-date__field-input","navds-text-field__input","navds-body-short",`navds-body-short--${le}`),size:se?11:14})),React.createElement("button",{disabled:oe.disabled||ge,tabIndex:ge||ae!=null&&ae.open?-1:0,onClick:()=>{ae==null||ae.onOpen(),re==null||re(te.current)},type:"button",className:"navds-date__field-button",ref:te},React.createElement(CalendarIcon,{pointerEvents:"none",title:ae!=null&&ae.open?ie.iconTitle.close:ie.iconTitle.open}))),React.createElement("div",{className:"navds-form-field__error",id:de,"aria-relevant":"additions removals","aria-live":"polite"},he&&React.createElement(ErrorMessage,{size:le},T.error)))}),DatePickerInput=reactExports.forwardRef((T,C)=>React.createElement(DateInput,Object.assign({},T,{ref:C})));reactExports.forwardRef((T,C)=>React.createElement(DateInput,Object.assign({},T,{variant:"monthpicker",ref:C})));var __rest$A=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$}=T,V=__rest$A(T,["className"]);return React.createElement("div",Object.assign({},V,{ref:C,className:clsx$1("navds-popover__content",$)}))}),PopoverContent$1=PopoverContent;var __rest$z=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$,children:V,anchorEl:K,arrow:Y=!0,open:J,onClose:re,placement:ne="top",offset:te,strategy:se,flip:ie=!0}=T,ae=__rest$z(T,["className","children","anchorEl","arrow","open","onClose","placement","offset","strategy","flip"]);const oe=reactExports.useRef(null),le=reactExports.useContext(ModalContext)!==null,ce=reactExports.useContext(DateContext)!==null,de=se??(le?"fixed":"absolute"),he=ce?!1:ie,{x:me,y:ge,strategy:ye,context:fe,update:Te,refs:Pe,placement:De,middlewareData:{arrow:{x:xe,y:Ce}={}}}=useFloating({strategy:de,placement:ne,open:J,onOpenChange:()=>re(),middleware:[offset(te??(Y?16:4)),he&&flip({padding:5,fallbackPlacements:["bottom","top"]}),shift({padding:12}),arrow({element:oe,padding:8})]}),{getFloatingProps:je}=useInteractions([useClick(fe),useDismiss(fe)]);useClientLayoutEffect(()=>{Pe.setReference(K)},[K]);const Le=useMergeRefs(Pe.setFloating,C);useClientLayoutEffect(()=>{if(!Pe.reference.current||!Pe.floating.current||!J)return;const Se=autoUpdate(Pe.reference.current,Pe.floating.current,Te);return()=>Se()},[Pe.floating,Pe.reference,Te,J,K]),useEventListener$1("focusin",reactExports.useCallback(Se=>{Se.target instanceof HTMLElement&&![K,Pe.floating.current].some(Ie=>Ie==null?void 0:Ie.contains(Se.target))&&!Se.target.contains(Pe.floating.current)&&J&&re()},[K,Pe,J,re]));const Ke={top:"bottom",right:"left",bottom:"top",left:"right"}[De.split("-")[0]];return React.createElement("div",Object.assign({className:clsx$1("navds-popover",$,{"navds-popover--hidden":!J||!K}),"data-placement":De,"aria-hidden":!J||!K},je({ref:Le,style:{position:ye,top:ge??0,left:me??0},tabIndex:void 0}),ae),V,Y&&React.createElement("div",{ref:Se=>{oe.current=Se},style:Object.assign(Object.assign(Object.assign({},xe!=null?{left:xe}:{}),Ce!=null?{top:Ce}:{}),Ke?{[Ke]:"-0.5rem"}:{}),className:"navds-popover__arrow"}))});Popover.Content=PopoverContent$1;const Popover$1=Popover,DateWrapper=({open:T,children:C,onClose:$,anchor:V,locale:K,variant:Y,popoverProps:J})=>{const re=reactExports.useRef(null),ne=reactExports.useContext(ModalContext)!==null;return useMedia("screen and (min-width: 768px)",!0)&&!ne?React.createElement(Popover$1,Object.assign({arrow:!1,anchorEl:V,open:T,onClose:$,placement:"bottom-start",role:"dialog",className:clsx$1("navds-date__popover",{"navds-date":Y==="month"}),flip:!1},J),C):React.createElement(Modal$1,{ref:re,open:T,onClose:se=>{se.stopPropagation(),$()},"aria-label":modalLabel(K,Y),className:clsx$1("navds-date__modal",{"navds-date__nested-modal":ne,"navds-date":Y==="month"}),closeOnBackdropClick:!0},React.createElement("div",{className:"navds-date__modal-body"},C,React.createElement(Button$1,{variant:"tertiary",onClick:()=>{var se;return(se=re==null?void 0:re.current)===null||se===void 0?void 0:se.close()},size:"small",type:"button"},modalCloseButtonLabel(K))))};var __rest$y=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{const{children:$}=T,V=__rest$y(T,["children"]);return reactExports.isValidElement($)?reactExports.cloneElement($,Object.assign(Object.assign({},mergeProps(V,$.props)),{ref:C?mergeRefs$1([C,$.ref]):$.ref})):reactExports.Children.count($)>1?(console.error("Aksel: Components using 'asChild' expects to recieve a single React element child."),reactExports.Children.only(null)):null});function mergeProps(T,C){const $=Object.assign({},C);for(const V in C){const K=T[V],Y=C[V];/^on[A-Z]/.test(V)?K&&Y?$[V]=(...re)=>{Y(...re),K(...re)}:K&&($[V]=K):V==="style"?$[V]=Object.assign(Object.assign({},K),Y):V==="className"&&($[V]=[K,Y].filter(Boolean).join(" "))}return Object.assign(Object.assign({},T),$)}var __rest$x=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{as:$="div",className:V,above:K,below:Y,variant:J,asChild:re}=T,ne=__rest$x(T,["as","className","above","below","variant","asChild"]);const te=J==="show"?K:Y,se=J==="show"?Y:K,ie=re?Slot:$;return React.createElement(ie,Object.assign({},ne,{ref:C,className:clsx$1("navds-responsive",V,{[`navds-responsive__above--${te}`]:te,[`navds-responsive__below--${se}`]:se})}))}),Hide=reactExports.forwardRef((T,C)=>React.createElement(Responsive,Object.assign({},T,{ref:C,variant:"hide"}))),Show=reactExports.forwardRef((T,C)=>React.createElement(Responsive,Object.assign({},T,{ref:C,variant:"show"})));function getMonthWeeks(T,C){const $=Object.assign(Object.assign({},C),{weekStartsOn:1}),V=daysToMonthWeeks(startOfMonth(T),endOfMonth(T),$);if($!=null&&$.useFixedWeeks){const K=getWeeksInMonth(T,$);if(K<6){const Y=V[V.length-1],J=Y.dates[Y.dates.length-1],re=addWeeks(J,6-K),ne=daysToMonthWeeks(addWeeks(J,1),re,$);V.push(...ne)}}return V}function daysToMonthWeeks(T,C,$){const V=endOfWeek(C,$),K=startOfWeek(T,$),Y=differenceInCalendarDays(V,K),J=[];for(let ne=0;ne<=Y;ne++)J.push(addDays(K,ne));return J.reduce((ne,te)=>{const se=getWeek(te,$),ie=ne.find(ae=>ae.weekNumber===se);return ie?(ie.dates.push(te),ne):(ne.push({weekNumber:se,dates:[te]}),ne)},[])}function WeekNumber(T){const{number:C,dates:$}=T,{onWeekNumberClick:V,styles:K,classNames:Y,locale:{code:J}}=useDayPicker(),re=labelWeekNumber({week:Number(C),localeCode:J});if(!V)return React.createElement("span",{className:Y.weeknumber,style:K.weeknumber,"aria-label":re},C);const ne=labelWeekNumberButton({week:Number(C),localeCode:J}),te=function(se){V(C,$,se)};return T!=null&&T.headerVersion?React.createElement(Button,{name:"week-number","aria-label":ne,className:Y.weeknumber,style:K.weeknumber,onClick:te},C):React.createElement(Button,{name:"week-number","aria-label":ne,className:Y.weeknumber,style:K.weeknumber,onClick:te},C)}const WeekRow=({displayMonth:T})=>{const{locale:C,fixedWeeks:$,onWeekNumberClick:V}=useDayPicker(),K=useId$2();if(!V)return null;const Y=getMonthWeeks(T,{useFixedWeeks:!!$,locale:C});return React.createElement(Show,{below:"sm",asChild:!0},React.createElement("table",{className:"rdp-table",role:"grid"},React.createElement("tbody",{className:"rdp-tbody"},React.createElement("tr",{className:"rdp-row navds-date__week-row"},React.createElement(Detail,{as:"th",weight:"semibold",className:"rdp-cell navds-date__week-cell"},React.createElement("span",{className:"navds-date__week-wrapper",id:K},labelWeek(C==null?void 0:C.code))),Y.map(J=>React.createElement("td",{key:J.weekNumber,className:"rdp-cell navds-date__week-cell"},React.createElement("span",{className:"navds-date__week-wrapper"},React.createElement(WeekNumber,{number:J.weekNumber,dates:J.dates,headerVersion:!0}))))))))},WeekRow$1=WeekRow,DatePickerCaption=({displayMonth:T,id:C})=>{const{goToMonth:$,nextMonth:V,previousMonth:K}=useNavigation(),{labels:{labelPrevious:Y,labelNext:J},formatters:{formatCaption:re},locale:ne}=useDayPicker(),te=Y(K,{locale:ne}),se=J(V,{locale:ne});return React.createElement(React.Fragment,null,React.createElement("div",{className:"navds-date__caption"},React.createElement(Button$1,{variant:"tertiary",disabled:!K,onClick:()=>K&&$(K),icon:React.createElement(ArrowLeftIcon,{title:te}),className:"navds-date__caption-button",type:"button"}),React.createElement(Label,{as:"span","aria-live":"polite","aria-atomic":"true",id:C,className:"navds-date__caption-label"},re(T,{locale:ne})),React.createElement(Button$1,{icon:React.createElement(ArrowRightIcon,{title:se}),onClick:()=>V&&$(V),disabled:!V,variant:"tertiary",className:"navds-date__caption-button",type:"button"})),React.createElement(WeekRow$1,{displayMonth:T}))},Caption=DatePickerCaption,DropdownCaption=({displayMonth:T,id:C})=>{const{goToMonth:$,nextMonth:V,previousMonth:K}=useNavigation(),{fromDate:Y,toDate:J,formatters:{formatYearCaption:re,formatMonthCaption:ne,formatCaption:te},labels:{labelPrevious:se,labelNext:ie},locale:ae}=useDayPicker();if(!Y||!J)return console.warn("Using dropdownCaption required fromDate and toDate"),null;const oe=fe=>{const Te=setYear(startOfMonth(T),Number(fe.target.value));$(startOfMonth(min([max([Te,Y]),J])))},le=fe=>$(setMonth(startOfMonth(T),Number(fe.target.value))),ce=getYears(Y,J,T.getFullYear()),de=getMonths(Y,J,T),he=se(K,{locale:ae}),me=ie(V,{locale:ae}),ge=labelYearDropdown(ae),ye=labelMonthDropdown(ae);return React.createElement(React.Fragment,null,React.createElement("div",{className:"navds-date__caption"},React.createElement("span",{"aria-live":"polite","aria-atomic":"true",id:C,className:"navds-sr-only"},te(T,{locale:ae})),React.createElement(Button$1,{variant:"tertiary",disabled:!K,onClick:()=>K&&$(K),icon:React.createElement(ArrowLeftIcon,{title:he}),className:"navds-date__caption-button",type:"button"}),React.createElement("div",{className:"navds-date__caption"},React.createElement(Select,{label:ye,hideLabel:!0,className:"navds-date__caption__month",value:T.getMonth(),onChange:le},de.map(fe=>React.createElement("option",{key:fe.getMonth(),value:fe.getMonth()},ne(fe,{locale:ae})))),React.createElement(Select,{label:ge,hideLabel:!0,value:T.getFullYear(),onChange:oe,className:"navds-date__caption__year"},ce.map(fe=>React.createElement("option",{key:fe.getFullYear(),value:fe.getFullYear()},re(fe,{locale:ae}))))),React.createElement(Button$1,{icon:React.createElement(ArrowRightIcon,{title:me}),onClick:()=>V&&$(V),disabled:!V,variant:"tertiary",className:"navds-date__caption-button",type:"button"})),React.createElement(WeekRow$1,{displayMonth:T}))},DropdownCaption$1=DropdownCaption;function HeadRow(){const{classNames:T,styles:C,showWeekNumber:$,locale:V,formatters:{formatWeekdayName:K},labels:{labelWeekday:Y}}=useDayPicker(),J=getWeekdays(V);return React.createElement("tr",{style:C.head_row,className:T.head_row},$&&React.createElement(Hide,{below:"sm",asChild:!0},React.createElement("td",{style:C.head_cell,className:T.head_cell})),J.map((re,ne)=>React.createElement("th",{key:ne,scope:"col",className:T.head_cell,style:C.head_cell,"aria-label":Y(re,{locale:V})},K(re,{locale:V}))))}function getWeekdays(T){const C=startOfWeek(new Date,{locale:T,weekStartsOn:1}),$=[];for(let V=0;V<7;V++){const K=addDays(C,V);$.push(K)}return $}const DayButton=T=>{const C=reactExports.useRef(null),$=useDayRender(T.date,T.displayMonth,C),{locale:V}=useDayPicker(),K=format(T.date,"cccc d",{locale:V});return $.isHidden?React.createElement(React.Fragment,null):$.isButton?React.createElement(Button,Object.assign({name:"day",ref:C},$.buttonProps,{"aria-label":K,"aria-hidden":$.activeModifiers.outside})):React.createElement("div",Object.assign({},$.divProps))},DayButton$1=DayButton;function Row$2(T){const{styles:C,classNames:$,showWeekNumber:V}=useDayPicker();return React.createElement("tr",{className:$.row,style:C.row},V&&React.createElement(Hide,{below:"sm",asChild:!0},React.createElement("td",{className:$.cell,style:C.cell},React.createElement(WeekNumber,{number:T.weekNumber,dates:T.dates}))),T.dates.map(K=>React.createElement("td",{className:$.cell,style:C.cell,key:getUnixTime(K)},React.createElement(DayButton$1,{displayMonth:T.displayMonth,date:K}))))}function TableHead(){var T;const{classNames:C,styles:$,components:V}=useDayPicker(),K=(T=V==null?void 0:V.HeadRow)!==null&&T!==void 0?T:HeadRow$1;return React.createElement("thead",{style:$.head,className:C.head,"aria-hidden":!0},React.createElement(K,null))}var __rest$w=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var $,{className:V,locale:K="nb",dropdownCaption:Y,disabled:J=[],disableWeekends:re=!1,showWeekNumber:ne=!1,selected:te,defaultSelected:se,onSelect:ie,fixedWeeks:ae=!1,onWeekNumberClick:oe}=T,le=__rest$w(T,["className","locale","dropdownCaption","disabled","disableWeekends","showWeekNumber","selected","defaultSelected","onSelect","fixedWeeks","onWeekNumberClick"]);const[ce,de]=React.useState(se),he=($=le.mode)!==null&&$!==void 0?$:"single",me=ge=>{de(ge),ie==null||ie(ge)};return React.createElement("div",{ref:C,className:clsx$1("navds-date__standalone-wrapper",V)},React.createElement(DayPicker,Object.assign({locale:getLocaleFromString(K),mode:he,onSelect:me,selected:te??ce,components:{Caption:Y?DropdownCaption$1:Caption,Head:TableHead,HeadRow,WeekNumber,Row:Row$2},className:"navds-date",classNames:{vhidden:"navds-sr-only"},disabled:ge=>re&&isWeekend(ge)||isMatch(ge,J),weekStartsOn:1,initialFocus:!1,labels,modifiers:{weekend:ge=>re&&isWeekend(ge)},modifiersClassNames:{weekend:"rdp-day__weekend"},showWeekNumber:ne,onWeekNumberClick:he==="multiple"?oe:void 0,fixedWeeks:ae,showOutsideDays:!0},omit(le,["children","id"]))))}),DatePickerStandalone$1=DatePickerStandalone;var __rest$v=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var $,{children:V,locale:K="nb",dropdownCaption:Y,disabled:J=[],disableWeekends:re=!1,showWeekNumber:ne=!1,selected:te,id:se,defaultSelected:ie,className:ae,wrapperClassName:oe,open:le,onClose:ce,onOpenToggle:de,strategy:he,onWeekNumberClick:me}=T,ge=__rest$v(T,["children","locale","dropdownCaption","disabled","disableWeekends","showWeekNumber","selected","id","defaultSelected","className","wrapperClassName","open","onClose","onOpenToggle","strategy","onWeekNumberClick"]);const ye=useId$2(se),[fe,Te]=reactExports.useState(le??!1),Pe=reactExports.useRef(null),De=useMergeRefs(Pe,C),[xe,Ce]=React.useState(ie),je=($=ge.mode)!==null&&$!==void 0?$:"single",Le=Se=>{var Ie,Ne,pt;Ce(Se),ge.mode==="single"?Se&&((Ie=ce==null?void 0:ce())!==null&&Ie!==void 0||Te(!1)):ge.mode==="range"&&Se!=null&&Se.from&&Se!=null&&Se.to&&((Ne=ce==null?void 0:ce())!==null&&Ne!==void 0||Te(!1)),(pt=ge==null?void 0:ge.onSelect)===null||pt===void 0||pt.call(ge,Se)},Ke=React.createElement(DayPicker,Object.assign({locale:getLocaleFromString(K),mode:je,onSelect:Le,selected:te??xe,components:{Caption:Y?DropdownCaption$1:Caption,Head:TableHead,HeadRow,WeekNumber,Row:Row$2},className:clsx$1("navds-date",ae),classNames:{vhidden:"navds-sr-only"},disabled:Se=>re&&isWeekend(Se)||isMatch(Se,J),weekStartsOn:1,initialFocus:!1,labels,modifiers:{weekend:Se=>re&&isWeekend(Se)},modifiersClassNames:{weekend:"rdp-day__weekend"},showWeekNumber:ne,onWeekNumberClick:je==="multiple"?me:void 0,fixedWeeks:!0,showOutsideDays:!0},omit(ge,["onSelect"])));return React.createElement(DateContext.Provider,{value:{open:le??fe,onOpen:()=>{Te(Se=>!Se),de==null||de()},ariaId:ye,defined:!0}},React.createElement("div",{ref:De,className:clsx$1("navds-date__wrapper",oe)},V,React.createElement(DateWrapper,{open:le??fe,anchor:Pe.current,onClose:()=>{var Se;return(Se=ce==null?void 0:ce())!==null&&Se!==void 0?Se:Te(!1)},locale:K,variant:je,popoverProps:{id:ye,strategy:he}},Ke)))});DatePicker.Standalone=DatePickerStandalone$1;DatePicker.Input=DatePickerInput;const DatePicker$1=DatePicker,getValidationMessage=(T={},C={})=>({from:Object.assign({isDisabled:!1,isWeekend:!1,isEmpty:!1,isInvalid:!1,isBefore:!1,isAfter:!1,isValidDate:!0},T),to:Object.assign({isDisabled:!1,isWeekend:!1,isEmpty:!1,isInvalid:!1,isBefore:!1,isAfter:!1,isBeforeFrom:!1,isValidDate:!0},C)}),RANGE={FROM:"FROM",TO:"TO"},fromValidation=(T,C)=>{const $=(C==null?void 0:C.fromDate)&&T&&differenceInCalendarDays(C==null?void 0:C.fromDate,T)>0,V=(C==null?void 0:C.toDate)&&T&&differenceInCalendarDays(T,C==null?void 0:C.toDate)>0;if(isValidDate(T)&&!(C!=null&&C.disableWeekends&&isWeekend(T))&&!(C!=null&&C.disabled&&isMatch(T,C.disabled)))return{isValidDate:!1,isInvalid:!isValidDate(T),isWeekend:(C==null?void 0:C.disableWeekends)&&isWeekend(T),isDisabled:(C==null?void 0:C.disabled)&&isMatch(T,C.disabled),isBefore:$,isAfter:V};if($||V)return{isValidDate:!1,isBefore:$,isAfter:V}},toValidation=(T,C,$)=>{var V;const K=($==null?void 0:$.fromDate)&&T&&differenceInCalendarDays($==null?void 0:$.fromDate,T)>0,Y=($==null?void 0:$.toDate)&&T&&differenceInCalendarDays(T,$==null?void 0:$.toDate)>0,J=(V=C&&differenceInCalendarDays(C,T)>0)!==null&&V!==void 0?V:!1;if(isValidDate(T)&&!($!=null&&$.disableWeekends&&isWeekend(T))&&!($!=null&&$.disabled&&isMatch(T,$.disabled)))return{isValidDate:!1,isInvalid:!isValidDate(T),isWeekend:($==null?void 0:$.disableWeekends)&&isWeekend(T),isDisabled:($==null?void 0:$.disabled)&&isMatch(T,$.disabled),isBefore:K,isAfter:Y,isBeforeFrom:J};if(K||Y||J)return{isValidDate:!1,isBefore:K,isAfter:Y,isBeforeFrom:J}},initialValidation=(T,C)=>{if(!T||!(T!=null&&T.from))return getValidationMessage({isEmpty:!0,isValidDate:!1},{isEmpty:!0,isValidDate:!1});const $=fromValidation(T.from,C),V=T.to?toValidation(T.to,T.from,C):{isEmpty:!0,isValidDate:!1};return getValidationMessage(Object.assign({},$),Object.assign({},V))},useRangeDatepicker=(T={})=>{const{locale:C="nb",defaultSelected:$,today:V=new Date,fromDate:K,toDate:Y,disabled:J,disableWeekends:re,onRangeChange:ne,inputFormat:te,onValidate:se,defaultMonth:ie,allowTwoDigitYear:ae=!0}=T,[oe,le]=reactExports.useState(null),ce=getLocaleFromString(C),[de,he]=reactExports.useState($),[me,ge]=reactExports.useState(de?de==null?void 0:de.from:ie??V),[ye,fe]=reactExports.useState(de??{from:void 0,to:void 0}),[Te,Pe]=reactExports.useState(de!=null&&de.from?formatDateForInput(de.from,ce,"date",te):""),[De,xe]=reactExports.useState(de!=null&&de.to?formatDateForInput(de.to,ce,"date",te):""),[Ce,je]=reactExports.useState(initialValidation(ye,T)),[Le,Ke]=reactExports.useState(!1),Se=_e=>{ne==null||ne(_e),fe(_e)},Ie=(_e={},Oe={})=>{const Qe=getValidationMessage(_e,Oe);je(Qe),se==null||se(Qe)},Ne=()=>{Se(de??{from:void 0,to:void 0}),ge(de?de==null?void 0:de.from:ie??V),je(initialValidation(de??{from:void 0,to:void 0},T)),Pe(de!=null&&de.from?formatDateForInput(de.from,ce,"date",te):""),xe(de!=null&&de.to?formatDateForInput(de.to,ce,"date",te):""),he($)},pt=_e=>{Se(_e),Pe(_e!=null&&_e.from?formatDateForInput(_e.from,ce,"date",te):""),xe(_e!=null&&_e.to?formatDateForInput(_e==null?void 0:_e.to,ce,"date",te):""),je(initialValidation(_e,T))},at=(_e,Oe)=>{if(_e.target.readOnly)return;const Qe=parseDate(_e.target.value,V,ce,"date",ae);if(isValidDate(Qe)){Oe===RANGE.FROM?Pe(formatDateForInput(Qe,ce,"date",te)):xe(formatDateForInput(Qe,ce,"date",te));const ct=K&&Qe&&differenceInCalendarDays(K,Qe)>0,xt=Y&&Qe&&differenceInCalendarDays(Qe,Y)>0;!ct&&!xt&&ge(Qe)}},dt=(_e,Oe)=>{const Qe=parseDate(_e.target.value,V,ce,"date",ae);isValidDate(Qe)&&(Oe===RANGE.FROM?Pe(formatDateForInput(Qe,ce,"date",te)):Oe===RANGE.TO&&xe(formatDateForInput(Qe,ce,"date",te)))},Ct=_e=>isValidDate(_e)&&!(re&&isWeekend(_e))&&!(J&&isMatch(_e,J)),ut=_e=>{_e!=null&&_e.from&&(_e!=null&&_e.to)&&(Ke(!1),oe==null||oe.focus());const Oe=!(ye!=null&&ye.from)&&(ye!=null&&ye.to)?ye==null?void 0:ye.to:_e==null?void 0:_e.to,Qe=isBefore(Oe,_e==null?void 0:_e.from);_e!=null&&_e.from?Pe(formatDateForInput(_e==null?void 0:_e.from,ce,"date",te)):Pe(""),xe(Oe&&!Qe?formatDateForInput(Oe,ce,"date",te):""),Se({from:_e==null?void 0:_e.from,to:Qe?void 0:Oe}),Ie({isValidDate:!!(_e!=null&&_e.from),isEmpty:!(_e!=null&&_e.from)},{isValidDate:!!(_e!=null&&_e.to),isEmpty:!Oe||Qe})},bt=(_e="",Oe,Qe=!1,ct=!1)=>{if(Pe(_e),!Ct(Oe)){Se(Object.assign(Object.assign({},ye),{from:void 0})),Ie({isEmpty:!_e,isValidDate:!1,isInvalid:!isValidDate(Oe),isWeekend:re&&isWeekend(Oe),isDisabled:J&&isMatch(Oe,J),isBefore:Qe,isAfter:ct},Ce.to);return}if(Qe||ct){Se(Object.assign(Object.assign({},ye),{from:void 0})),Ie({isValidDate:!1,isBefore:Qe,isAfter:ct},Ce.to);return}if(ye!=null&&ye.to&&differenceInCalendarDays(Oe,ye==null?void 0:ye.to)>0){Se({to:Oe,from:Oe}),xe(formatDateForInput(Oe,ce,"date",te)),ge(Oe),Ie();return}if(De&&!(ye!=null&&ye.to)){const xt=parseDate(De,V,ce,"date",ae);if(Ct(xt)){Se({from:Oe,to:xt}),ge(Oe),Ie();return}}Se(Object.assign(Object.assign({},ye),{from:Oe})),Ie({},Ce.to),ge(Oe)},Re=(_e="",Oe,Qe=!1,ct=!1)=>{if(xe(_e),!Ct(Oe)){Se({from:ye==null?void 0:ye.from,to:void 0}),Ie(Ce.from,{isEmpty:!_e,isValidDate:!1,isInvalid:!isValidDate(Oe),isWeekend:re&&isWeekend(Oe),isDisabled:J&&isMatch(Oe,J),isBefore:Qe,isAfter:ct});return}if(Qe||ct){Se({from:ye==null?void 0:ye.from,to:void 0}),Ie(Ce.from,{isValidDate:!1,isBefore:Qe,isAfter:ct});return}if(ye!=null&&ye.from&&differenceInCalendarDays(ye==null?void 0:ye.from,Oe)>0){Se({from:ye==null?void 0:ye.from,to:void 0}),Ie(Ce.from,{isValidDate:!1,isBeforeFrom:!0});return}Se({from:ye==null?void 0:ye.from,to:Oe}),Ie(Ce.from,{}),ge(Oe)},ue=(_e,Oe)=>{const Qe=parseDate(_e.target.value,V,ce,"date",ae),ct=K&&differenceInCalendarDays(K,Qe)>0,xt=Y&&differenceInCalendarDays(Qe,Y)>0;return Oe===RANGE.FROM?bt(_e.target.value,Qe,ct,xt):Re(_e.target.value,Qe,ct,xt)};return{datepickerProps:{month:me,onMonthChange:ge,onSelect:ut,selected:ye,locale:C,fromDate:K,toDate:Y,today:V,mode:"range",open:Le,onOpenToggle:()=>Ke(_e=>!_e),onClose:()=>{Ke(!1),oe==null||oe.focus()},disabled:J,disableWeekends:re},fromInputProps:{onChange:_e=>ue(_e,RANGE.FROM),onFocus:_e=>at(_e,RANGE.FROM),onBlur:_e=>dt(_e,RANGE.FROM),value:Te,setAnchorRef:le},toInputProps:{onChange:_e=>ue(_e,RANGE.TO),onFocus:_e=>at(_e,RANGE.TO),onBlur:_e=>dt(_e,RANGE.TO),value:De,setAnchorRef:le},reset:Ne,selectedRange:ye,setSelected:pt}};var __rest$u=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);KReact.createElement("svg",{width:"12",height:"10",viewBox:"0 0 12 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img","aria-hidden":!0,"aria-label":"Deaktiver valg"},React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2674 0.647802C11.8762 1.20971 11.9141 2.1587 11.3522 2.76743L5.35221 9.26743C5.07531 9.56739 4.68813 9.74155 4.27998 9.74971C3.87184 9.75787 3.478 9.59933 3.18934 9.31067L0.68934 6.81067C0.103553 6.22488 0.103553 5.27513 0.68934 4.68935C1.27513 4.10356 2.22487 4.10356 2.81066 4.68935L4.20673 6.08541L9.14779 0.732587C9.7097 0.123856 10.6587 0.0858967 11.2674 0.647802Z",fill:"currentColor"})),Switch=reactExports.forwardRef((T,C)=>{var $,V,K;const{inputProps:Y,size:J,readOnly:re}=useFormField(T,"switch"),{children:ne,className:te,description:se,hideLabel:ie=!1,loading:ae,checked:oe,defaultChecked:le,position:ce="left"}=T,de=__rest$u(T,["children","className","description","hideLabel","loading","checked","defaultChecked","position"]),[he,me]=reactExports.useState(($=le??oe)!==null&&$!==void 0?$:!1);return reactExports.useEffect(()=>{oe!==void 0&&me(oe)},[oe]),React.createElement("div",{className:clsx$1("navds-switch",T.className,`navds-switch--${J}`,`navds-switch--${ce}`,{"navds-switch--loading":ae,"navds-switch--disabled":(V=Y.disabled)!==null&&V!==void 0?V:ae,"navds-switch--readonly":re})},React.createElement("input",Object.assign({},omit(de,["size","readOnly"]),omit(Y,["aria-invalid","aria-describedby"]),{disabled:(K=Y.disabled)!==null&&K!==void 0?K:ae,checked:oe,defaultChecked:le,ref:C,type:"checkbox",onChange:ge=>{re||(me(ge.target.checked),T.onChange&&T.onChange(ge))},onClick:ge=>{var ye;if(re){ge.preventDefault();return}(ye=T==null?void 0:T.onClick)===null||ye===void 0||ye.call(T,ge)},className:clsx$1(te,"navds-switch__input")})),React.createElement("span",{className:"navds-switch__track"},React.createElement("span",{className:"navds-switch__thumb"},ae?React.createElement(Loader,{size:"xsmall","aria-live":"polite",variant:he?"interaction":"neutral"}):he?React.createElement(SelectedIcon,null):null)),React.createElement("label",{htmlFor:Y.id,className:"navds-switch__label-wrapper"},React.createElement("div",{className:clsx$1("navds-switch__content",{"navds-sr-only":ie,"navds-switch--with-description":!!se&&!ie})},React.createElement(BodyShort,{as:"div",size:J,className:"navds-switch__label"},React.createElement(ReadOnlyIcon,{readOnly:re,nativeReadOnly:!1}),ne),se&&React.createElement(BodyShort,{size:J,as:"div",className:"navds-form-field__subdescription navds-switch__description"},se))))}),Switch$1=Switch;var __rest$t=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{const{inputProps:$,errorId:V,showErrorMsg:K,hasError:Y,size:J,inputDescriptionId:re}=useFormField(T,"textField"),{label:ne,className:te,description:se,htmlSize:ie,hideLabel:ae=!1,type:oe="text",readOnly:le}=T,ce=__rest$t(T,["label","className","description","htmlSize","hideLabel","type","readOnly"]);return React.createElement("div",{className:clsx$1(te,"navds-form-field",`navds-form-field--${J}`,{"navds-text-field--error":Y,"navds-text-field--disabled":!!$.disabled,"navds-form-field--disabled":!!$.disabled,"navds-form-field--readonly":le,"navds-text-field--readonly":le})},React.createElement(Label,{htmlFor:$.id,size:J,className:clsx$1("navds-form-field__label",{"navds-sr-only":ae})},React.createElement(ReadOnlyIcon,{readOnly:le}),ne),!!se&&React.createElement(BodyShort,{className:clsx$1("navds-form-field__description",{"navds-sr-only":ae}),id:re,size:J,as:"div"},se),React.createElement("input",Object.assign({},omit(ce,["error","errorId","size"]),$,{ref:C,type:oe,readOnly:le,className:clsx$1("navds-text-field__input","navds-body-short",`navds-body-short--${J??"medium"}`),size:ie})),React.createElement("div",{className:"navds-form-field__error",id:V,"aria-relevant":"additions removals","aria-live":"polite"},K&&React.createElement(ErrorMessage,{size:J},T.error)))}),TextField$1=TextField;var __rest$s=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{const{outerHeightStyle:V,overflow:K}=C;return $.current<20&&(V>0&&Math.abs((T.outerHeightStyle||0)-V)>1||T.overflow!==K)?($.current+=1,C):T},ownerWindow=T=>(T&&T.ownerDocument||document).defaultView||window;function getStyleValue(T){return parseInt(T,10)||0}const TextareaAutosize=reactExports.forwardRef((T,C)=>{var $,V,{className:K,onChange:Y,maxRows:J,minRows:re=1,autoScrollbar:ne,style:te,value:se}=T,ie=__rest$s(T,["className","onChange","maxRows","minRows","autoScrollbar","style","value"]);const{current:ae}=reactExports.useRef(se!=null),oe=reactExports.useRef(null),le=useMergeRefs(oe,C),ce=reactExports.useRef(null),de=reactExports.useRef(0),[he,me]=reactExports.useState({outerHeightStyle:0}),ge=React.useCallback(()=>{const Pe=oe.current,xe=ownerWindow(Pe).getComputedStyle(Pe);if(xe.width==="0px")return{outerHeightStyle:0};const Ce=ce.current;Ce.style.width=xe.width,Ce.value=Pe.value||ie.placeholder||"x",Ce.value.slice(-1)===`
+`&&(Ce.value+=" ");const je=xe.boxSizing,Le=getStyleValue(xe.paddingBottom)+getStyleValue(xe.paddingTop),Ke=getStyleValue(xe.borderBottomWidth)+getStyleValue(xe.borderTopWidth),Se=Ce.scrollHeight-Le;Ce.value="x";const Ie=Ce.scrollHeight-Le;let Ne=Se;re&&(Ne=Math.max(Number(re)*Ie,Ne)),J&&(Ne=Math.min(Number(J)*Ie,Ne)),Ne=Math.max(Ne,Ie);const pt=Ne+(je==="border-box"?Le+Ke:0),at=Math.abs(Ne-Se)<=1;return{outerHeightStyle:pt,overflow:at}},[J,re,ie.placeholder]),ye=()=>{const Pe=ge();isEmpty(Pe)||me(De=>checkState(De,Pe,de))};useClientLayoutEffect(()=>{const Pe=()=>{const Le=ge();isEmpty(Le)||ReactDOM.flushSync(()=>{me(Ke=>checkState(Ke,Le,de))})},De=debounce(()=>{var Le,Ke,Se;if(de.current=0,!((Le=oe.current)===null||Le===void 0)&&Le.style.height||!((Ke=oe.current)===null||Ke===void 0)&&Ke.style.width){((Se=oe.current)===null||Se===void 0?void 0:Se.style.overflow)==="hidden"&&me(Ie=>Object.assign(Object.assign({},Ie),{overflow:!1}));return}Pe()}),xe=oe.current,Ce=ownerWindow(xe);Ce.addEventListener("resize",De);let je;return typeof ResizeObserver<"u"&&(je=new ResizeObserver(De),je.observe(xe)),()=>{De.clear(),Ce.removeEventListener("resize",De),je&&je.disconnect()}},[ge]),useClientLayoutEffect(()=>{ye()}),reactExports.useEffect(()=>{de.current=0},[se]);const fe=Pe=>{de.current=0,ae||ye(),Y&&Y(Pe)},Te=Object.assign({"--__ac-textarea-height":he.outerHeightStyle+"px",overflow:he.overflow&&!ne&&!(!(($=oe.current)===null||$===void 0)&&$.style.height)&&!(!((V=oe.current)===null||V===void 0)&&V.style.width)?"hidden":void 0},te);return React.createElement(React.Fragment,null,React.createElement("textarea",Object.assign({value:se,onChange:fe,ref:le,rows:re,style:Te},ie,{className:K})),React.createElement("textarea",{"aria-hidden":!0,className:K,readOnly:!0,ref:ce,tabIndex:-1,style:Object.assign({visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"},te)}))});function isEmpty(T){return T==null||Object.keys(T).length===0||T.outerHeightStyle===0&&!T.overflow}const TextareaAutosize$1=TextareaAutosize,TextareaCounter=({maxLength:T,currentLength:C,size:$,i18n:V})=>{const K=T-C,[Y,J]=reactExports.useState(K);return reactExports.useEffect(()=>{const re=debounce(()=>{J(K)},2e3);return re(),()=>{re.clear()}},[K]),React.createElement(React.Fragment,null,K<20&&React.createElement("span",{role:"status",className:"navds-textarea__sr-counter navds-sr-only"},getCounterText(Y,V)),React.createElement(BodyShort,{className:clsx$1("navds-textarea__counter",{"navds-textarea__counter--error":K<0}),size:$},getCounterText(K,V)))},getCounterText=(T,C)=>{var $,V;return T<0?`${Math.abs(T)} ${($=C==null?void 0:C.counterTooMuch)!==null&&$!==void 0?$:"tegn for mye"}`:`${T} ${(V=C==null?void 0:C.counterLeft)!==null&&V!==void 0?V:"tegn igjen"}`},Counter=TextareaCounter;var __rest$r=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var $,V,K;const{inputProps:Y,errorId:J,showErrorMsg:re,hasError:ne,size:te,inputDescriptionId:se}=useFormField(T,"textarea"),{label:ie,className:ae,description:oe,maxLength:le,hideLabel:ce=!1,resize:de,UNSAFE_autoScrollbar:he,i18n:me,readOnly:ge}=T,ye=__rest$r(T,["label","className","description","maxLength","hideLabel","resize","UNSAFE_autoScrollbar","i18n","readOnly"]),fe=useId$2(),Te=le!==void 0&&le>0,[Pe,De]=reactExports.useState(($=T==null?void 0:T.defaultValue)!==null&&$!==void 0?$:""),xe=()=>{let je=ye!=null&&ye.minRows?ye==null?void 0:ye.minRows:3;return te==="small"&&(je=ye!=null&&ye.minRows?ye==null?void 0:ye.minRows:2),je},Ce=clsx$1(Y["aria-describedby"],{[fe??""]:Te});return React.createElement("div",{className:clsx$1(ae,"navds-form-field",`navds-form-field--${te}`,{"navds-form-field--disabled":!!Y.disabled,"navds-form-field--readonly":ge,"navds-textarea--readonly":ge,"navds-textarea--error":ne,"navds-textarea--autoscrollbar":he,[`navds-textarea--resize-${de===!0?"both":de}`]:de})},React.createElement(Label,{htmlFor:Y.id,size:te,className:clsx$1("navds-form-field__label",{"navds-sr-only":ce})},React.createElement(ReadOnlyIcon,{readOnly:ge}),ie),!!oe&&React.createElement(BodyShort,{className:clsx$1("navds-form-field__description",{"navds-sr-only":ce}),id:se,size:te,as:"div"},oe),React.createElement("div",{className:"navds-textarea__wrapper"},React.createElement(TextareaAutosize$1,Object.assign({},omit(ye,["error","errorId","size"]),Y,{onChange:composeEventHandlers(T.onChange,T.value===void 0?je=>De(je.target.value):void 0),minRows:xe(),autoScrollbar:he,ref:C,readOnly:ge,className:clsx$1("navds-textarea__input","navds-body-short",`navds-body-short--${te??"medium"}`)},Ce?{"aria-describedby":Ce}:{})),Te&&!ge&&!Y.disabled&&React.createElement(React.Fragment,null,React.createElement("span",{id:fe,className:"navds-sr-only"},`Tekstområde med plass til ${le} tegn.`),React.createElement(Counter,{maxLength:le,currentLength:(K=(V=T.value)===null||V===void 0?void 0:V.length)!==null&&K!==void 0?K:Pe.length,size:te,i18n:me}))),React.createElement("div",{className:"navds-form-field__error",id:J,"aria-relevant":"additions removals","aria-live":"polite"},re&&React.createElement(ErrorMessage,{size:te},T.error)))}),Textarea$1=Textarea;var __rest$q=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{children:$,as:V="a",className:K}=T,Y=__rest$q(T,["children","as","className"]);return React.createElement(V,Object.assign({},Y,{ref:C,className:clsx$1(K,"navds-error-summary__item","navds-link")}),$)}),ErrorSummaryItem$1=ErrorSummaryItem;var __rest$p=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{children:$,className:V,size:K="medium",headingTag:Y="h2",heading:J}=T,re=__rest$p(T,["children","className","size","headingTag","heading"]);const ne=useId$2();return React.createElement("section",Object.assign({ref:C},re,{className:clsx$1(V,"navds-error-summary",`navds-error-summary--${K}`),tabIndex:-1,"aria-live":"polite","aria-relevant":"all","aria-labelledby":ne}),React.createElement(Heading,{className:"navds-error-summary__heading",as:Y,size:"small",id:ne},J),React.createElement(BodyShort,{as:"ul",size:K,className:"navds-error-summary__list"},React.Children.map($,te=>reactExports.isValidElement(te)?React.createElement("li",{key:te.toString()},te):null)))});ErrorSummary.Item=ErrorSummaryItem$1;const ErrorSummary$1=ErrorSummary;var __rest$o=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:C,titleId:$}=T,V=__rest$o(T,["title","titleId"]);let K=useId$2();return K=C?$||"title-"+K:void 0,React.createElement("svg",Object.assign({width:"56",height:"85",viewBox:"0 0 56 85",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-label":"NAV veileder illustrasjon",focusable:!1,role:"img","aria-labelledby":K},V),C?React.createElement("title",{id:K},C):null,React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M43.1888 40.4308C41.795 44.9808 39.0663 48.7576 35.5693 51.069L35.7484 53.0952L35.7474 53.1777L33.857 69.8797H21.8679L21.8181 69.5289L19.5004 53.1489L19.5862 51.1002C16.0715 48.795 13.3274 45.0119 11.9257 40.4499C11.8781 40.4544 11.83 40.4566 11.7812 40.4566C10.8745 40.4566 10.1562 39.6595 10.1562 38.6939V33.2298C10.1562 32.5825 10.479 32.0106 10.9648 31.7039C11.7229 21.5028 18.8443 13.4855 27.554 13.4855C36.2401 13.4855 43.3472 21.4596 44.1376 31.6211C44.7049 31.8986 45.0937 32.5184 45.0937 33.2298V38.6939C45.0937 39.66 44.3765 40.4566 43.4687 40.4566C43.3731 40.4566 43.2796 40.4478 43.1888 40.4308Z",fill:"#F7F7F7"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M35.1471 51.6345C35.0789 55.2819 31.7373 59.0239 27.625 59.0239C23.4949 59.0239 20.142 55.2493 20.1022 51.5869C17.9622 52.1325 14.6956 53.7781 11.9995 56.5281C9.38852 59.1912 7.3125 63.1941 7.3125 66.2993V85.0001H47.9375V66.2993C47.9375 63.1878 45.8167 59.178 43.1575 56.5119C40.4983 53.8458 37.3007 52.2225 35.1471 51.6345Z",fill:"#005B82"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.9671 51.7134C17.9959 52.4333 14.6891 54.0068 12.1875 56.3964C4.875 54.7595 1.625 50.87 1.625 50.87C1.625 50.87 8.36213 44.2596 8.3662 32.698V32.6857C8.3662 19.1478 15.6319 9.80762 27.6022 9.80762C39.5742 9.80762 46.8399 19.1478 46.8399 32.6857H46.883C46.883 44.2555 53.625 50.87 53.625 50.87C53.625 50.87 50.375 54.7595 43.0625 56.3942L43.0515 56.3964C40.6353 54.1853 37.1309 52.4799 35.2243 51.7589L35.2265 51.7582L35.1508 50.9012L35.1917 50.8302C38.7891 48.5155 41.5804 44.6159 42.9262 39.904C43.0909 39.9961 43.277 40.048 43.4739 40.048C44.1476 40.048 44.6928 39.4431 44.6928 38.6939V33.2298C44.6928 32.5887 44.2936 32.0528 43.7564 31.9114C43.7559 31.904 43.7554 31.8966 43.7549 31.8892C26.7466 33.7984 20.6199 22.068 20.117 22.0672C20.117 22.0672 14.4686 26.1538 11.769 31.0124C11.769 31.0124 11.3576 31.9296 11.3556 31.9605C10.8934 32.1527 10.5637 32.648 10.5637 33.2298V38.6939C10.5637 39.4431 11.1103 40.048 11.7826 40.048C11.9316 40.048 12.0743 40.0184 12.2062 39.9642C13.5668 44.6785 16.3759 48.5738 19.9901 50.8732L20.0035 50.9012L19.9695 51.7134H19.9671Z",fill:"#F25C5C"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.8159 35.8563C20.766 35.9417 20.4722 34.2696 20.7885 33.1776C20.848 32.9706 21.1956 32.0283 21.8109 32.0283C22.4254 32.0283 22.6968 32.5434 22.7345 32.632C23.1865 33.6965 22.9645 35.7622 21.8159 35.8563",fill:"#262626"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.9927 35.8563C35.0425 35.9417 35.3364 34.2696 35.0201 33.1776C34.9606 32.9706 34.613 32.0283 33.9977 32.0283C33.3832 32.0283 33.1118 32.5434 33.0741 32.632C32.6221 33.6965 32.8441 35.7622 33.9927 35.8563",fill:"#262626"}),React.createElement("path",{d:"M28.2935 37.5041C28.9213 37.396 29.3501 37.4638 29.5036 37.6748C30.0833 38.4721 29.8979 39.3156 28.9035 40.0081C28.3806 40.372 27.661 40.5001 27.28 40.3114C27.0937 40.2191 26.8758 40.3133 26.7934 40.5218C26.7109 40.7304 26.7951 40.9742 26.9814 41.0665C27.6111 41.3784 28.5794 41.206 29.2931 40.7092C30.6445 39.7682 30.9537 38.3611 30.0758 37.1534C29.7042 36.643 29.0465 36.5389 28.1812 36.688C27.9799 36.7227 27.8418 36.9335 27.8728 37.1589C27.9038 37.3842 28.0921 37.5388 28.2935 37.5041Z",fill:"#262626"}),React.createElement("path",{d:"M32.8337 42.9837C32.7968 43.0623 32.7122 43.2128 32.5763 43.411C32.3463 43.7465 32.0574 44.0829 31.7066 44.3966C30.6611 45.3314 29.3002 45.872 27.5683 45.8225C25.8795 45.7743 24.5247 45.2421 23.4626 44.3839C23.0726 44.0688 22.7506 43.7314 22.4933 43.395C22.3415 43.1967 22.2468 43.0463 22.2053 42.9679C22.1056 42.7794 21.8606 42.7018 21.6581 42.7946C21.4555 42.8873 21.3721 43.1153 21.4718 43.3039C21.5318 43.4174 21.6487 43.6029 21.8273 43.8363C22.1206 44.2196 22.4852 44.6018 22.9266 44.9584C24.1256 45.9272 25.6579 46.5292 27.5432 46.583C29.5064 46.6391 31.0759 46.0156 32.273 44.9453C32.6733 44.5874 33.0023 44.2042 33.2656 43.8202C33.4257 43.5867 33.5298 43.4014 33.5829 43.2881C33.6733 43.0955 33.5788 42.8713 33.3719 42.7872C33.165 42.7032 32.924 42.7911 32.8337 42.9837Z",fill:"#262626"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M41.8629 70.5H30.8865C30.3966 70.5 30 70.0974 30 69.6001V63.609C30 63.1117 30.3966 62.7084 30.8865 62.7084H41.8629C42.3527 62.7084 42.75 63.1117 42.75 63.609V69.6001C42.75 70.0974 42.3527 70.5 41.8629 70.5",fill:"white"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.0345 63.9451H35.8971C35.8128 63.9451 35.7449 63.8775 35.7449 63.7937V63.6029C35.7449 63.5197 35.8128 63.4515 35.8971 63.4515H37.0345C37.1188 63.4515 37.1867 63.5197 37.1867 63.6029V63.7937C37.1867 63.8775 37.1188 63.9451 37.0345 63.9451",fill:"#262626"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36.1365 63.7708H36.7955V62H36.1365V63.7708Z",fill:"#8F8F8F"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M40.5417 65.5H39.6457C39.6457 65.5 39.5839 65.5 39.5621 65.5545L39.0662 67.0725L38.5708 65.5545C38.5489 65.5 38.4868 65.5 38.4868 65.5H36.764C36.7267 65.5 36.6954 65.5311 36.6954 65.5682V66.0837C36.6954 65.6748 36.2603 65.5 36.0055 65.5C35.4349 65.5 35.053 65.8758 34.934 66.4472C34.9276 66.0681 34.8961 65.9323 34.794 65.7932C34.7471 65.7251 34.6793 65.6678 34.6055 65.6204C34.4535 65.5314 34.317 65.5 34.0237 65.5H33.6794C33.6794 65.5 33.6171 65.5 33.5952 65.5545L33.2818 66.331V65.5682C33.2818 65.5311 33.2508 65.5 33.2136 65.5H32.4167C32.4167 65.5 32.3552 65.5 32.3328 65.5545L32.0071 66.362C32.0071 66.362 31.9746 66.4427 32.0489 66.4427H32.3552V67.9813C32.3552 68.0195 32.3853 68.0497 32.4236 68.0497H33.2136C33.2508 68.0497 33.2818 68.0195 33.2818 67.9813V66.4427H33.5898C33.7664 66.4427 33.8039 66.4475 33.8726 66.4796C33.914 66.4952 33.9513 66.5268 33.9716 66.5633C34.0133 66.6417 34.0237 66.7359 34.0237 67.0135V67.9813C34.0237 68.0195 34.0544 68.0497 34.0923 68.0497H34.8494C34.8494 68.0497 34.935 68.0497 34.9688 67.9652L35.1366 67.5505C35.3597 67.863 35.7269 68.0497 36.1833 68.0497H36.283C36.283 68.0497 36.3691 68.0497 36.4032 67.9652L36.6954 67.2415V67.9813C36.6954 68.0195 36.7267 68.0497 36.764 68.0497H37.5368C37.5368 68.0497 37.6221 68.0497 37.6564 67.9652C37.6564 67.9652 37.9655 67.1978 37.9667 67.192H37.9671C37.979 67.1281 37.8983 67.1281 37.8983 67.1281H37.6225V65.8113L38.4904 67.9652C38.5243 68.0497 38.6097 68.0497 38.6097 68.0497H39.5228C39.5228 68.0497 39.6087 68.0497 39.6426 67.9652L40.6048 65.5826C40.6381 65.5 40.5417 65.5 40.5417 65.5V65.5ZM36.6954 67.128H36.1763C35.9696 67.128 35.8015 66.9607 35.8015 66.7538C35.8015 66.5473 35.9696 66.3789 36.1763 66.3789H36.3215C36.5276 66.3789 36.6954 66.5473 36.6954 66.7538V67.128Z",fill:"#C30000"}))};var __rest$n=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{children:$,className:V,illustration:K,poster:Y}=T,J=__rest$n(T,["children","className","illustration","poster"]);return React.createElement("div",Object.assign({},J,{ref:C,className:clsx$1("navds-guide-panel",V,{"navds-guide-panel--poster":Y===!0,"navds-guide-panel--not-poster":Y===!1,"navds-guide-panel--responsive-poster":Y===void 0})}),React.createElement("div",{className:"navds-guide"},K??React.createElement(DefaultIllustration,null)),React.createElement("div",{className:"navds-guide-panel__content"},$))}),GuidePanel$1=GuidePanel,HelpTextIcon=({title:T,filled:C=!1})=>{let $=useId$2();return $=T?`title-${$}`:void 0,React.createElement("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img","aria-labelledby":$,className:clsx$1("navds-help-text__icon",{"navds-help-text__icon--filled":C})},T?React.createElement("title",{id:$},T):null,React.createElement("circle",{cx:"12",cy:"12",r:"11",strokeWidth:"1.5",stroke:"currentColor",fill:C?"currentColor":"transparent"}),React.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.75 9C9.75 7.75736 10.7574 6.75 12 6.75H12.1716C13.3195 6.75 14.25 7.68054 14.25 8.82843C14.25 9.37966 14.031 9.90832 13.6412 10.2981L12.6412 11.2981C11.7504 12.1889 11.25 13.3971 11.25 14.6569C11.25 15.0711 11.5858 15.4069 12 15.4069C12.4142 15.4069 12.75 15.0711 12.75 14.6569C12.75 13.7949 13.0924 12.9682 13.7019 12.3588L14.7019 11.3588C15.373 10.6877 15.75 9.77748 15.75 8.82843C15.75 6.85212 14.1479 5.25 12.1716 5.25H12C9.92893 5.25 8.25 6.92893 8.25 9V9.5C8.25 9.91421 8.58579 10.25 9 10.25C9.41421 10.25 9.75 9.91421 9.75 9.5V9ZM12 16.5C11.4477 16.5 11 16.9477 11 17.5C11 18.0523 11.4477 18.5 12 18.5C12.5523 18.5 13 18.0523 13 17.5C13 16.9477 12.5523 16.5 12 16.5Z",fill:C?"var(--a-surface-default)":"currentColor"}))};var __rest$m=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$,children:V,placement:K,strategy:Y="absolute",title:J="hjelp",onClick:re,wrapperClassName:ne}=T,te=__rest$m(T,["className","children","placement","strategy","title","onClick","wrapperClassName"]);const se=reactExports.useRef(null),ie=useMergeRefs(se,C),[ae,oe]=reactExports.useState(!1);return React.createElement("div",{className:clsx$1("navds-help-text",ne)},React.createElement("button",Object.assign({},te,{ref:ie,onClick:composeEventHandlers(re,()=>oe(le=>!le)),className:clsx$1($,"navds-help-text__button"),type:"button","aria-expanded":ae}),React.createElement(HelpTextIcon,{title:J}),React.createElement(HelpTextIcon,{filled:!0,title:J})),React.createElement(Popover$1,{onClose:()=>oe(!1),className:"navds-help-text__popover",open:ae,anchorEl:se.current,placement:K,strategy:Y,offset:12},React.createElement(Popover$1.Content,{className:"navds-body-short"},V)))}),HelpText$1=HelpText;var __rest$l=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{as:$="a",className:V,underline:K=!0,variant:Y="action",inlineText:J=!1}=T,re=__rest$l(T,["as","className","underline","variant","inlineText"]);return React.createElement($,Object.assign({},re,{ref:C,className:clsx$1("navds-link",V,`navds-link--${Y}`,{"navds-link--remove-underline":!K,"navds-link--inline-text":J})}))}),Link$1=Link;var __rest$k=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{children:$,className:V,border:K=!1,as:Y="div"}=T,J=__rest$k(T,["children","className","border","as"]);return React.createElement(Y,Object.assign({ref:C,className:clsx$1("navds-panel",V,{"navds-panel--border":K})},J),$)}),Panel$1=Panel;var __rest$j=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$}=T,V=__rest$j(T,["className"]);return React.createElement(BodyLong$1,Object.assign({},V,{as:"div",ref:C,className:clsx$1("navds-link-panel__description",$)}))});var __rest$i=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$,as:V="div"}=T,K=__rest$i(T,["className","as"]);return React.createElement(V,Object.assign({},K,{ref:C,className:clsx$1("navds-link-panel__title","navds-heading","navds-heading--medium",$)}))});var __rest$h=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{children:$,as:V="a",border:K=!0,className:Y}=T,J=__rest$h(T,["children","as","border","className"]);return React.createElement(Panel$1,Object.assign({},J,{as:V,border:K,ref:C,className:clsx$1("navds-link-panel",Y)}),React.createElement("div",{className:"navds-link-panel__content"},$),React.createElement(ChevronRightIcon,{className:"navds-link-panel__chevron","aria-hidden":!0}))}),LinkPanel=LinkPanelComponent;LinkPanel.Title=LinkPanelTitle;LinkPanel.Description=LinkPanelDescription;const LinkPanel$1=LinkPanel,ListContext=reactExports.createContext({listType:"ul",isNested:null,size:"medium"});var __rest$g=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$,children:V,title:K,icon:Y}=T,J=__rest$g(T,["className","children","title","icon"]);const{listType:re,size:ne}=reactExports.useContext(ListContext);return re==="ol"&&Y&&console.warn("
: Icon prop is not supported for ordered lists. Please remove the icon prop."),React.createElement("li",Object.assign({},J,{ref:C,className:clsx$1("navds-list__item",$)}),re==="ul"&&React.createElement("div",{className:clsx$1({"navds-list__item-marker--icon":Y,"navds-list__item-marker--bullet":!Y})},Y||React.createElement("svg",{width:"6",height:"6",viewBox:"0 0 6 6",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,focusable:!1,role:"img"},React.createElement("rect",{width:"6",height:"6",rx:"3",fill:"currentColor"}))),React.createElement(BodyShort,{as:"div",size:ne,className:"navds-list__item-content"},K&&React.createElement(Label,{as:"p",size:ne},K),V))});ListItem.displayName="List.Item";var __rest$f=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var $,{children:V,className:K,as:Y="ul",title:J,description:re,headingTag:ne="h3",size:te}=T,se=__rest$f(T,["children","className","as","title","description","headingTag","size"]);const ie=useId$2(),{isNested:ae,size:oe}=reactExports.useContext(ListContext),le=($=te??oe)!==null&&$!==void 0?$:"medium";return React.createElement(ListContext.Provider,{value:{listType:Y,isNested:ae!==null,size:le}},React.createElement("div",Object.assign({},se,{ref:C,className:clsx$1("navds-list",`navds-list--${le}`,K,{"navds-list--nested":ae!==null})}),J&&React.createElement(Heading,{id:`tittel-${ie}`,size:le==="medium"?"small":"xsmall",as:ne},J),re&&React.createElement(BodyShort,{size:le,id:`description-${ie}`},re),React.createElement(Y,{"aria-labelledby":J&&`tittel-${ie}`,"aria-describedby":re&&`description-${ie}`},V)))});List.Item=ListItem;const O$1=List;var __rest$e=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{children:$,as:V="button",selected:K=!1,className:Y}=T,J=__rest$e(T,["children","as","selected","className"]);return React.createElement(Button$1,Object.assign({as:V,variant:"tertiary","aria-current":K,ref:C,className:clsx$1("navds-pagination__item",Y,{"navds-pagination__item--selected":K})},V==="button"&&{type:"button"},J),$)}),PaginationItem=Item;var __rest$d=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var K,Y;const J=(ie,ae)=>Array.from({length:ae-ie+1},(oe,le)=>ie+le);if(C<=($+V)*2+3)return J(1,C);const re=J(1,$),ne=J(C-$+1,C),te=Math.max(Math.min(T-V,C-$-V*2-1),$+2),se=te+V*2;return[...re,te-((K=re[re.length-1])!==null&&K!==void 0?K:0)===2?te-1:"ellipsis",...J(te,se),((Y=ne[0])!==null&&Y!==void 0?Y:C+1)-se===2?se+1:"ellipsis",...ne]},Pagination=reactExports.forwardRef((T,C)=>{var{page:$,onPageChange:V,count:K,boundaryCount:Y=1,siblingCount:J=1,className:re,size:ne="medium",prevNextTexts:te=!1,renderItem:se=ae=>React.createElement(PaginationItem,Object.assign({},ae))}=T,ie=__rest$d(T,["page","onPageChange","count","boundaryCount","siblingCount","className","size","prevNextTexts","renderItem"]);return $<1?(console.error("page cannot be less than 1"),null):K<1?(console.error("count cannot be less than 1"),null):Y<0?(console.error("boundaryCount cannot be less than 0"),null):J<0?(console.error("siblingCount cannot be less than 0"),null):React.createElement("nav",Object.assign({ref:C},ie,{className:clsx$1("navds-pagination",`navds-pagination--${ne}`,re)}),React.createElement("ul",{className:"navds-pagination__list"},React.createElement("li",null,React.createElement(se,{className:clsx$1("navds-pagination__prev-next",{"navds-pagination--invisible":$===1,"navds-pagination--prev-next--with-text":te}),disabled:$===1,onClick:()=>V==null?void 0:V($-1),page:$-1,size:ne,icon:React.createElement(ChevronLeftIcon,Object.assign({className:"navds-pagination__prev-next-icon"},te?{"aria-hidden":!0}:{title:"Forrige"}))},te&&React.createElement(BodyShort,{size:ne==="xsmall"?"small":ne,className:"navds-pagination__prev-text"},"Forrige"))),getSteps$1({page:$,count:K,siblingCount:J,boundaryCount:Y}).map((ae,oe)=>{const le=Number(ae);return isNaN(le)?React.createElement("li",{className:"navds-pagination__ellipsis",key:`${ae}${oe}`},React.createElement(BodyShort,{size:ne==="xsmall"?"small":ne},"...")):React.createElement("li",{key:ae},React.createElement(se,{onClick:()=>V==null?void 0:V(le),selected:$===le,page:le,size:ne},React.createElement(BodyShort,{size:ne==="xsmall"?"small":ne},le)))}),React.createElement("li",null,React.createElement(se,{className:clsx$1("navds-pagination__prev-next",{"navds-pagination--invisible":$===K,"navds-pagination--prev-next--with-text":te}),disabled:$===K,onClick:()=>V==null?void 0:V($+1),page:$+1,size:ne,icon:React.createElement(ChevronRightIcon,Object.assign({className:"navds-pagination__prev-next-icon"},te?{"aria-hidden":!0}:{title:"Neste"})),iconPosition:"right"},te&&React.createElement(BodyShort,{size:ne==="xsmall"?"small":ne,className:"navds-pagination__next-text"},"Neste")))))});Pagination.Item=PaginationItem;const ee=Pagination;var __rest$c=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$,header:V,children:K,open:Y,defaultOpen:J=!1,onClick:re,size:ne="medium",onOpenChange:te}=T,se=__rest$c(T,["className","header","children","open","defaultOpen","onClick","size","onOpenChange"]);const[ie,ae]=useControllableState({defaultValue:J,value:Y,onChange:te});return React.createElement("div",{className:clsx$1("navds-read-more",`navds-read-more--${ne}`,$,{"navds-read-more--open":ie})},React.createElement("button",Object.assign({},se,{ref:C,type:"button",className:clsx$1("navds-read-more__button","navds-body-short",{"navds-body-short--small":ne==="small"}),onClick:composeEventHandlers(re,()=>ae(oe=>!oe)),"aria-expanded":ie}),React.createElement(ChevronDownIcon,{className:"navds-read-more__expand-icon","aria-hidden":!0}),React.createElement("span",null,V)),React.createElement(BodyLong$1,{as:"div","aria-hidden":!ie,className:clsx$1("navds-read-more__content",{"navds-read-more__content--closed":!ie}),size:ne},K))}),ReadMore$1=ReadMore;var __rest$b=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$}=T,V=__rest$b(T,["className"]);return React.createElement("tbody",Object.assign({},V,{ref:C,className:clsx$1("navds-table__body",$)}))}),Body$1=Body;var __rest$a=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$,children:V,align:K,textSize:Y}=T,J=__rest$a(T,["className","children","align","textSize"]);return React.createElement("th",Object.assign({ref:C,className:clsx$1("navds-table__header-cell","navds-label",$,{[`navds-table__header-cell--align-${K}`]:K,"navds-label--small":Y==="small"})},J),V)}),HeaderCell$1=HeaderCell,TableContext=reactExports.createContext(null);var __rest$9=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var $,V,K,Y,{className:J,children:re,sortable:ne=!1,sortKey:te}=T,se=__rest$9(T,["className","children","sortable","sortKey"]);const ie=reactExports.useContext(TableContext);return ne&&!te&&console.warn("ColumnHeader with `sortable=true` must have a sortKey."),React.createElement(HeaderCell$1,Object.assign({scope:"col",ref:C,className:J,"aria-sort":ne?(($=ie==null?void 0:ie.sort)===null||$===void 0?void 0:$.orderBy)===te?(V=ie==null?void 0:ie.sort)===null||V===void 0?void 0:V.direction:"none":void 0},se),ne?React.createElement("button",{type:"button",className:"navds-table__sort-button",onClick:ne&&te?()=>{var ae;return(ae=ie==null?void 0:ie.onSortChange)===null||ae===void 0?void 0:ae.call(ie,te)}:void 0},re,((K=ie==null?void 0:ie.sort)===null||K===void 0?void 0:K.orderBy)===te?((Y=ie==null?void 0:ie.sort)===null||Y===void 0?void 0:Y.direction)==="descending"?React.createElement(ArrowDownIcon,{"aria-hidden":!0}):React.createElement(ArrowUpIcon,{"aria-hidden":!0}):React.createElement(ArrowsUpDownIcon,{"aria-hidden":!0})):re)}),ColumnHeader$1=ColumnHeader;var __rest$8=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$,children:V="",align:K,textSize:Y}=T,J=__rest$8(T,["className","children","align","textSize"]);return React.createElement(BodyShort,Object.assign({as:"td",ref:C,className:clsx$1("navds-table__data-cell",$,{[`navds-table__data-cell--align-${K}`]:K}),size:Y},J),V)}),DataCell$1=DataCell;var __rest$7=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{children:C,className:$,innerClassName:V,duration:K=250,easing:Y="ease",height:J}=T,re=__rest$7(T,["children","className","innerClassName","duration","easing","height"]);const ne=reactExports.useRef(J),te=reactExports.useRef(null),se=reactExports.useRef(),ie=reactExports.useRef(),ae=prefersReducedMotion?0:K;let oe=J,le="visible";typeof oe=="number"?(typeof J!="string"&&(oe=J<0?0:J),le="hidden"):isPercentage(oe)&&(oe=J==="0%"?0:J,le="hidden");const[ce,de]=reactExports.useState(oe),[he,me]=reactExports.useState(le),[ge,ye]=reactExports.useState(!1);reactExports.useEffect(()=>{hideContent(te.current,ce)},[]),reactExports.useEffect(()=>{if(J!==ne.current&&te.current){showContent(te.current,ne.current),te.current.style.overflow="hidden";const De=te.current.offsetHeight;te.current.style.overflow="";const xe=ae;let Ce,je,Le="hidden",Ke;const Se=ne.current==="auto";typeof J=="number"?(Ce=J<0?0:J,je=Ce):isPercentage(J)?(Ce=J==="0%"?0:J,je=Ce):(Ce=De,je="auto",Le=void 0),Se&&(je=Ce,Ce=De),de(Ce),me("hidden"),ye(!Se),clearTimeout(ie.current),clearTimeout(se.current),Se?(Ke=!0,ie.current=setTimeout(()=>{de(je),me(Le),ye(Ke)},50),se.current=setTimeout(()=>{ye(!1),hideContent(te.current,je)},xe)):ie.current=setTimeout(()=>{de(je),me(Le),ye(!1),J!=="auto"&&hideContent(te.current,Ce)},xe)}return ne.current=J,()=>{clearTimeout(ie.current),clearTimeout(se.current)}},[J]);const fe={height:ce,overflow:he};ge&&(fe.transition=`height ${ae}ms ${Y} 0ms`,fe.WebkitTransition=fe.transition);const Pe=typeof re["aria-hidden"]<"u"?re["aria-hidden"]:J===0;return React.createElement("div",Object.assign({},re,{className:$,style:fe}),React.createElement("div",{"aria-hidden":Pe,className:V,ref:te},C))},AnimateHeight$1=AnimateHeight;var __rest$6=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$,selected:V=!1,shadeOnHover:K=!0}=T,Y=__rest$6(T,["className","selected","shadeOnHover"]);return React.createElement("tr",Object.assign({},Y,{ref:C,className:clsx$1("navds-table__row",$,{"navds-table__row--selected":V,"navds-table__row--shade-on-hover":K})}))}),Row$1=Row;var __rest$5=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$,children:V,content:K,togglePlacement:Y="left",defaultOpen:J=!1,open:re,onOpenChange:ne,expansionDisabled:te=!1,expandOnRowClick:se=!1,colSpan:ie=999,onClick:ae}=T,oe=__rest$5(T,["className","children","content","togglePlacement","defaultOpen","open","onOpenChange","expansionDisabled","expandOnRowClick","colSpan","onClick"]);const[le,ce]=useControllableState({defaultValue:J,value:re,onChange:ne}),de=useId$2(),he=ye=>{ce(fe=>!fe),ye.stopPropagation()},me=ye=>!isInteractiveTarget(ye.target)&&he(ye),ge=ye=>{!te&&se&&me(ye)};return React.createElement(React.Fragment,null,React.createElement(Row$1,Object.assign({},oe,{ref:C,className:clsx$1("navds-table__expandable-row",$,{"navds-table__expandable-row--open":le,"navds-table__expandable-row--expansion-disabled":te,"navds-table__expandable-row--clickable":se}),onClick:composeEventHandlers(ae,ge)}),Y==="right"&&V,React.createElement(DataCell$1,{className:clsx$1("navds-table__toggle-expand-cell",{"navds-table__toggle-expand-cell--open":le})},!te&&React.createElement("button",{className:"navds-table__toggle-expand-button",type:"button","aria-controls":de,"aria-expanded":le,onClick:he},React.createElement(ChevronDownIcon,{className:"navds-table__expandable-icon",title:le?"Vis mindre":"Vis mer"}))),Y==="left"&&V),React.createElement("tr",{className:"navds-table__expanded-row","aria-hidden":!le,id:de},React.createElement("td",{colSpan:ie,className:"navds-table__expanded-row-cell"},React.createElement(AnimateHeight$1,{className:"navds-table__expanded-row-collapse",innerClassName:"navds-table__expanded-row-content",height:le?"auto":0,duration:250},K))))});function isInteractiveTarget(T){return T.nodeName==="TD"||T.nodeName==="TH"||!T.parentElement?!1:["BUTTON","DETAILS","LABEL","SELECT","TEXTAREA","INPUT","A"].includes(T.nodeName)?!0:isInteractiveTarget(T.parentElement)}const ExpandableRow$1=ExpandableRow;var __rest$4=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$}=T,V=__rest$4(T,["className"]);return React.createElement("thead",Object.assign({},V,{ref:C,className:clsx$1("navds-table__header",$)}))}),Header$1=Header;var __rest$3=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{className:$,zebraStripes:V=!1,size:K="medium",onSortChange:Y,sort:J}=T,re=__rest$3(T,["className","zebraStripes","size","onSortChange","sort"]);return React.createElement(TableContext.Provider,{value:{onSortChange:Y,sort:J}},React.createElement("table",Object.assign({},re,{ref:C,className:clsx$1("navds-table",`navds-table--${K}`,$,{"navds-table--zebra-stripes":V})})))});Table.Header=Header$1;Table.Body=Body$1;Table.Row=Row$1;Table.ColumnHeader=ColumnHeader$1;Table.HeaderCell=HeaderCell$1;Table.DataCell=DataCell$1;Table.ExpandableRow=ExpandableRow$1;const w$1=Table;var __rest$2=function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{children:$,className:V,variant:K,size:Y="medium",icon:J}=T,re=__rest$2(T,["children","className","variant","size","icon"]);return React.createElement(BodyShort,Object.assign({},re,{ref:C,as:"span",size:Y==="medium"?"medium":"small",className:clsx$1("navds-tag",V,`navds-tag--${K}`,`navds-tag--${Y}`)}),J&&React.createElement("span",{className:"navds-tag__icon--left"},J),$)}),Tag$1=Tag;function selectAuthSlice(T){return T.data.auth}function selectAuthSliceData(T){return selectAuthSlice(T).data}function selectExpirationTime(T){var C;return(C=selectAuthSliceData(T))==null?void 0:C.expirationTime}function n$2(T){for(var C=arguments.length,$=Array(C>1?C-1:0),V=1;V3?C.i-4:C.i:Array.isArray(T)?1:s(T)?2:v(T)?3:0}function u(T,C){return o$1(T)===2?T.has(C):Object.prototype.hasOwnProperty.call(T,C)}function a(T,C){return o$1(T)===2?T.get(C):T[C]}function f(T,C,$){var V=o$1(T);V===2?T.set(C,$):V===3?T.add($):T[C]=$}function c(T,C){return T===C?T!==0||1/T==1/C:T!=T&&C!=C}function s(T){return X&&T instanceof Map}function v(T){return q&&T instanceof Set}function p(T){return T.o||T.t}function l(T){if(Array.isArray(T))return Array.prototype.slice.call(T);var C=rn(T);delete C[Q];for(var $=nn(C),V=0;V<$.length;V++){var K=$[V],Y=C[K];Y.writable===!1&&(Y.writable=!0,Y.configurable=!0),(Y.get||Y.set)&&(C[K]={configurable:!0,writable:!0,enumerable:Y.enumerable,value:T[K]})}return Object.create(Object.getPrototypeOf(T),C)}function d(T,C){return C===void 0&&(C=!1),y(T)||r$2(T)||!t$2(T)||(o$1(T)>1&&(T.set=T.add=T.clear=T.delete=h),Object.freeze(T),C&&i$2(T,function($,V){return d(V,!0)},!0)),T}function h(){n$2(2)}function y(T){return T==null||typeof T!="object"||Object.isFrozen(T)}function b(T){var C=tn[T];return C||n$2(18,T),C}function m(T,C){tn[T]||(tn[T]=C)}function _(){return U}function j(T,C){C&&(b("Patches"),T.u=[],T.s=[],T.v=C)}function g(T){O(T),T.p.forEach(S),T.p=null}function O(T){T===U&&(U=T.l)}function w(T){return U={p:[],l:U,h:T,m:!0,_:0}}function S(T){var C=T[Q];C.i===0||C.i===1?C.j():C.g=!0}function P(T,C){C._=C.p.length;var $=C.p[0],V=T!==void 0&&T!==$;return C.h.O||b("ES5").S(C,T,V),V?($[Q].P&&(g(C),n$2(4)),t$2(T)&&(T=M(C,T),C.l||x(C,T)),C.u&&b("Patches").M($[Q].t,T,C.u,C.s)):T=M(C,$,[]),g(C),C.u&&C.v(C.u,C.s),T!==H?T:void 0}function M(T,C,$){if(y(C))return C;var V=C[Q];if(!V)return i$2(C,function(re,ne){return A(T,V,C,re,ne,$)},!0),C;if(V.A!==T)return C;if(!V.P)return x(T,V.t,!0),V.t;if(!V.I){V.I=!0,V.A._--;var K=V.i===4||V.i===5?V.o=l(V.k):V.o,Y=K,J=!1;V.i===3&&(Y=new Set(K),K.clear(),J=!0),i$2(Y,function(re,ne){return A(T,V,K,re,ne,$,J)}),x(T,K,!1),$&&T.u&&b("Patches").N(V,$,T.u,T.s)}return V.o}function A(T,C,$,V,K,Y,J){if(r$2(K)){var re=M(T,K,Y&&C&&C.i!==3&&!u(C.R,V)?Y.concat(V):void 0);if(f($,V,re),!r$2(re))return;T.m=!1}else J&&$.add(K);if(t$2(K)&&!y(K)){if(!T.h.D&&T._<1)return;M(T,K),C&&C.A.l||x(T,K)}}function x(T,C,$){$===void 0&&($=!1),!T.l&&T.h.D&&T.m&&d(C,$)}function z$2(T,C){var $=T[Q];return($?p($):T)[C]}function I(T,C){if(C in T)for(var $=Object.getPrototypeOf(T);$;){var V=Object.getOwnPropertyDescriptor($,C);if(V)return V;$=Object.getPrototypeOf($)}}function k(T){T.P||(T.P=!0,T.l&&k(T.l))}function E(T){T.o||(T.o=l(T.t))}function N(T,C,$){var V=s(C)?b("MapSet").F(C,$):v(C)?b("MapSet").T(C,$):T.O?function(K,Y){var J=Array.isArray(K),re={i:J?1:0,A:Y?Y.A:_(),P:!1,I:!1,R:{},l:Y,t:K,k:null,o:null,j:null,C:!1},ne=re,te=en;J&&(ne=[re],te=on);var se=Proxy.revocable(ne,te),ie=se.revoke,ae=se.proxy;return re.k=ae,re.j=ie,ae}(C,$):b("ES5").J(C,$);return($?$.A:_()).p.push(V),V}function R(T){return r$2(T)||n$2(22,T),function C($){if(!t$2($))return $;var V,K=$[Q],Y=o$1($);if(K){if(!K.P&&(K.i<4||!b("ES5").K(K)))return K.t;K.I=!0,V=D($,Y),K.I=!1}else V=D($,Y);return i$2(V,function(J,re){K&&a(K.t,J)===re||f(V,J,C(re))}),Y===3?new Set(V):V}(T)}function D(T,C){switch(C){case 2:return new Map(T);case 3:return Array.from(T)}return l(T)}function F(){function T(Y,J){var re=K[Y];return re?re.enumerable=J:K[Y]=re={configurable:!0,enumerable:J,get:function(){var ne=this[Q];return en.get(ne,Y)},set:function(ne){var te=this[Q];en.set(te,Y,ne)}},re}function C(Y){for(var J=Y.length-1;J>=0;J--){var re=Y[J][Q];if(!re.P)switch(re.i){case 5:V(re)&&k(re);break;case 4:$(re)&&k(re)}}}function $(Y){for(var J=Y.t,re=Y.k,ne=nn(re),te=ne.length-1;te>=0;te--){var se=ne[te];if(se!==Q){var ie=J[se];if(ie===void 0&&!u(J,se))return!0;var ae=re[se],oe=ae&&ae[Q];if(oe?oe.t!==ie:!c(ae,ie))return!0}}var le=!!J[Q];return ne.length!==nn(J).length+(le?0:1)}function V(Y){var J=Y.k;if(J.length!==Y.t.length)return!0;var re=Object.getOwnPropertyDescriptor(J,J.length-1);if(re&&!re.get)return!0;for(var ne=0;ne1?he-1:0),ge=1;ge1?se-1:0),ae=1;ae=0;K--){var Y=V[K];if(Y.path.length===0&&Y.op==="replace"){$=Y.value;break}}K>-1&&(V=V.slice(K+1));var J=b("Patches").$;return r$2($)?J($,V):this.produce($,function(re){return J(re,V)})},T}(),an=new un,fn$1=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);function ownKeys$1(T,C){var $=Object.keys(T);if(Object.getOwnPropertySymbols){var V=Object.getOwnPropertySymbols(T);C&&(V=V.filter(function(K){return Object.getOwnPropertyDescriptor(T,K).enumerable})),$.push.apply($,V)}return $}function _objectSpread2(T){for(var C=1;C"u"&&($=C,C=void 0),typeof $<"u"){if(typeof $!="function")throw new Error(formatProdErrorMessage(1));return $(createStore$1)(T,C)}if(typeof T!="function")throw new Error(formatProdErrorMessage(2));var K=T,Y=C,J=[],re=J,ne=!1;function te(){re===J&&(re=J.slice())}function se(){if(ne)throw new Error(formatProdErrorMessage(3));return Y}function ie(ce){if(typeof ce!="function")throw new Error(formatProdErrorMessage(4));if(ne)throw new Error(formatProdErrorMessage(5));var de=!0;return te(),re.push(ce),function(){if(de){if(ne)throw new Error(formatProdErrorMessage(6));de=!1,te();var me=re.indexOf(ce);re.splice(me,1),J=null}}}function ae(ce){if(!isPlainObject$2(ce))throw new Error(formatProdErrorMessage(7));if(typeof ce.type>"u")throw new Error(formatProdErrorMessage(8));if(ne)throw new Error(formatProdErrorMessage(9));try{ne=!0,Y=K(Y,ce)}finally{ne=!1}for(var de=J=re,he=0;he"u")throw new Error(formatProdErrorMessage(12));if(typeof $(void 0,{type:ActionTypes.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(formatProdErrorMessage(13))})}function combineReducers(T){for(var C=Object.keys(T),$={},V=0;V"u")throw te&&te.type,new Error(formatProdErrorMessage(14));ie[oe]=de,se=se||de!==ce}return se=se||Y.length!==Object.keys(ne).length,se?ie:ne}}function compose(){for(var T=arguments.length,C=new Array(T),$=0;$-1){var te=$[ne];return ne>0&&($.splice(ne,1),$.unshift(te)),te.value}return NOT_FOUND}function K(re,ne){V(re)===NOT_FOUND&&($.unshift({key:re,value:ne}),$.length>T&&$.pop())}function Y(){return $}function J(){$=[]}return{get:V,put:K,getEntries:Y,clear:J}}var defaultEqualityCheck=function(C,$){return C===$};function createCacheKeyComparator(T){return function($,V){if($===null||V===null||$.length!==V.length)return!1;for(var K=$.length,Y=0;Y1?C-1:0),V=1;V0&&Y[Y.length-1])&&(te[0]===6||te[0]===2)){$=0;continue}if(te[0]===3&&(!Y||te[1]>Y[0]&&te[1]-1;return $&&V}function isAsyncThunkArray(T){return typeof T[0]=="function"&&"pending"in T[0]&&"fulfilled"in T[0]&&"rejected"in T[0]}function isPending(){for(var T=[],C=0;CstatusPrioritet[C]>statusPrioritet[$]?C:$)}async function sjekkStatuskode(T){if(T.status>=200&&T.status<300&&T.ok)return T;const C={code:T.status.toString(),message:`${T.url}`,name:`${T.statusText} (${T.status})`};return Promise.reject(C)}function toJson(T){return T.status!==204?T.json():T}const getCookie=T=>{const $=new RegExp(`${T}=([^;]+)`).exec(document.cookie);return $!==null?$[1]:""},defaultHeaders={"Content-Type":"application/json",NAV_CSRF_PROTECTION:getCookie("NAV_CSRF_PROTECTION"),"Nav-Consumer-Id":"aktivitetsplan"};function fetchToJsonPlain(T,C={headers:defaultHeaders}){const $={...DEFAULT_CONFIG,...C};return fetch(T,$).then(sjekkStatuskode).then(toJson)}function fetchToJson(T,C={headers:defaultHeaders}){const $={...DEFAULT_CONFIG,...C},V=hentFraSessionStorage(LocalStorageElement.FNR);let K=T;return V&&(K=`${T}${T.indexOf("?")>=0?"&":"?"}fnr=${V}`),fetch(K,$).then(sjekkStatuskode).then(toJson)}function methodToJson(T,C,$,V){return fetchToJson(C,{method:T,headers:defaultHeaders,body:JSON.stringify($),...V})}function postAsJson(T,C={},$={}){return methodToJson("post",T,C,$)}function putAsJson(T,C={},$={}){return methodToJson("put",T,C,$)}const fetchAuthInfo=()=>fetchToJson("/auth/info");var Status=(T=>(T.NOT_STARTED="NOT_STARTED",T.PENDING="PENDING",T.OK="OK",T.RELOADING="RELOADING",T.ERROR="ERROR",T))(Status||{});const createGenericSlice=({name:T,initialState:C={status:"NOT_STARTED"},reducers:$})=>createSlice({name:T,initialState:C,reducers:{...$},extraReducers:V=>{V.addMatcher(K=>K.type.startsWith(`${T}/`)&&K.type.endsWith("/pending"),K=>{K.status=K.status==="NOT_STARTED"?"PENDING":"RELOADING"}),V.addMatcher(K=>K.type.startsWith(`${T}/`)&&K.type.endsWith("/fulfilled"),(K,Y)=>{K.data=Y.payload||C.data,K.status="OK"}),V.addMatcher(K=>K.type.startsWith(`${T}/`)&&K.type.endsWith("/rejected"),K=>{K.status="ERROR"})}}),authSlice=createGenericSlice({name:"auth",reducers:{}}),hentAuthInfo=createAsyncThunk(`${authSlice.name}/fetchAuthInfo`,async()=>await fetchAuthInfo()),authReducer=authSlice.reducer,TimeoutboxNedtelling=T=>{const{expirationTimestamp:C}=T,[$,V]=reactExports.useState(differenceInSeconds(parseISO(C),new Date));if(reactExports.useEffect(()=>{const J=setInterval(()=>{V($-1)},1e3);return()=>clearInterval(J)},[$]),$<=0)return jsxRuntimeExports.jsxs(Modal$1.Body,{children:[jsxRuntimeExports.jsx(BodyShort,{spacing:!0,children:"Sesjonen har utløpt. Du må logge inn igjen for å fortsette."}),jsxRuntimeExports.jsx(Button$1,{variant:"primary",className:"mt-2",onClick:()=>window.location.reload(),children:"Last siden på nytt"})]});const K=secondsToMinutes($),Y=K===0?`${$} sekunder`:`${K} minutter`;return jsxRuntimeExports.jsxs(Modal$1.Body,{children:[jsxRuntimeExports.jsx(BodyLong$1,{className:"blokk-xxs",spacing:!0,children:`Din sesjon vil utløpe om ${Y}. Dersom du ikke laster siden på nytt, vil du bli logget ut. Ta vare på alt ulagret arbeid. For å laste siden på nytt, vennligst trykk "Last siden på nytt".`}),jsxRuntimeExports.jsx(Button$1,{className:"mr-4",onClick:()=>window.location.reload(),children:"Last siden på nytt"}),jsxRuntimeExports.jsx(Button$1,{variant:"secondary",onClick:()=>document.querySelector("#login-knapp-id").click(),children:"Logg ut"})]})},Timeoutbox=()=>{const T=useAppDispatch(),[C,$]=reactExports.useState(!1),[V,K]=reactExports.useState(!1);reactExports.useEffect(()=>{T(hentAuthInfo())},[]);const Y=useSelector(selectExpirationTime),J=subMinutes(parseISO(Y),5);return reactExports.useEffect(()=>{let re;if(Y){const ne=differenceInMilliseconds(J,new Date);re=setTimeout(()=>{K(!0)},ne+100)}return()=>clearTimeout(re)},[Y]),Y?jsxRuntimeExports.jsx(Modal$1,{open:V&&!C,className:"max-w-2xl",onClose:()=>{$(!0)},header:{heading:"Obs!",closeButton:!0},children:jsxRuntimeExports.jsx(TimeoutboxNedtelling,{expirationTimestamp:Y})}):null};function useEventListener(T,C){const $=reactExports.useCallback(V=>{if(V&&"detail"in V)return C(V)},[C]);reactExports.useEffect(()=>(window.addEventListener(T,$),()=>window.removeEventListener(T,$)),[$,T])}const removeHostPartOfUrl=T=>{if(T.length<2)return T;const C=T.replace("https://","").replace("http://","").split("/");return C.length===1?"/":[...C.slice(1)].join("/")};removeHostPartOfUrl("https://aktivitetsplan.ekstern.dev.nav.no");const stripPrependingSlash=T=>"",DIALOG_BASE_URL=stripPrependingSlash()+"/veilarbdialog/api",AKTIVITET_BASE_URL=stripPrependingSlash()+"/veilarbaktivitet/api",AKTIVITET_GRAPHQL_BASE_URL=stripPrependingSlash()+"/veilarbaktivitet/graphql",OPPFOLGING_BASE_URL=stripPrependingSlash()+"/veilarboppfolging/api",VEILARBLEST_BASE_URL=stripPrependingSlash()+"/veilarblest/api",PERSON_BASE_URL=stripPrependingSlash()+"/veilarbperson/api",MALVERK_BASE_URL=stripPrependingSlash()+"/veilarbmalverk/api",VEILEDER_BASE_URL=stripPrependingSlash()+"/veilarbveileder/api",fetchDialoger=()=>fetchToJson(`${DIALOG_BASE_URL}/dialog`),fetchSistOppdatert=()=>fetchToJson(`${DIALOG_BASE_URL}/dialog/sistOppdatert`),fetchEskaleringsvarsel=()=>fetchToJson(`${DIALOG_BASE_URL}/eskaleringsvarsel/gjeldende`),initialState$9={data:[],status:Status.NOT_STARTED,sistOppdatert:new Date().toISOString()},dialogSlice=createSlice({name:"dialog",initialState:initialState$9,reducers:{},extraReducers:T=>{T.addCase(hentDialoger.fulfilled,(C,$)=>{C.data=$.payload,C.status=Status.OK,C.sistOppdatert=new Date().toISOString()}),T.addCase(hentDialoger.rejected,(C,$)=>{C.status=Status.ERROR})}}),hentDialoger=createAsyncThunk(`${dialogSlice.name}/fetchDialoger`,async(T,C)=>await fetchDialoger()),dialogReducer=dialogSlice.reducer,hentAktivitet$1=T=>fetchToJson(`${AKTIVITET_BASE_URL}/aktivitet/${T}`),lagNyAktivitet$1=T=>postAsJson(`${AKTIVITET_BASE_URL}/aktivitet/ny`,T),oppdaterAktivitet$1=T=>putAsJson(`${AKTIVITET_BASE_URL}/aktivitet/${T.id}`,T),settAktivitetTilAvtalt$1=(T,C,$)=>putAsJson(`${AKTIVITET_BASE_URL}/avtaltMedNav?aktivitetId=${T}`,{aktivitetVersjon:C,forhaandsorientering:$}),markerForhaandsorienteringSomLest$1=(T,C)=>putAsJson(`${AKTIVITET_BASE_URL}/avtaltMedNav/lest`,{aktivitetId:T,aktivitetVersion:C}),oppdaterCvKanDelesSvar=(T,C,$,V)=>putAsJson(`${AKTIVITET_BASE_URL}/stillingFraNav/kanDeleCV?aktivitetId=${T}`,{aktivitetVersjon:C,kanDeles:$,avtaltDato:V}),oppdaterAktivitetStatus=T=>putAsJson(`${AKTIVITET_BASE_URL}/aktivitet/${T.id}/status`,T),oppdaterAktivitetEtikett$1=T=>putAsJson(`${AKTIVITET_BASE_URL}/aktivitet/${T.id}/etikett`,T),publiserReferat$1=T=>putAsJson(`${AKTIVITET_BASE_URL}/aktivitet/${T.id}/referat/publiser`,T),oppdaterReferat$1=T=>putAsJson(`${AKTIVITET_BASE_URL}/aktivitet/${T.id}/referat`,T),hentVersjonerTilAktivitet=T=>fetchToJson(`${AKTIVITET_BASE_URL}/aktivitet/${T.id}/versjoner`),oppdaterStillingFraNavSoknadsstatus$1=(T,C,$)=>putAsJson(`${AKTIVITET_BASE_URL}/stillingFraNav/soknadStatus?aktivitetId=${T}`,{aktivitetVersjon:C,soknadsstatus:$}),hentArenaAktiviteter$1=()=>fetchToJson(`${AKTIVITET_BASE_URL}/arena/tiltak`),sendForhaandsorienteringArenaAktivitet$1=(T,C)=>putAsJson(`${AKTIVITET_BASE_URL}/arena/forhaandsorientering?arenaaktivitetId=${T}`,C),markerForhaandsorienteringSomLestArenaAktivitet$1=T=>putAsJson(`${AKTIVITET_BASE_URL}/arena/forhaandsorientering/lest?aktivitetId=${T}`),journalfoerAktivitetsplanOgDialog=(T,C)=>postAsJson(`${AKTIVITET_BASE_URL}/arkivering/journalfor?oppfolgingsperiodeId=${T}`,{forhaandsvisningOpprettet:C}),genererPdfTilForhaandsvisning=T=>fetchToJson(`${AKTIVITET_BASE_URL}/arkivering/forhaandsvisning?oppfolgingsperiodeId=${T}`),query=`
+ query($fnr: String!) {
+ perioder(fnr: $fnr) {
+ id,
+ aktiviteter {
+ id,
+ funksjonellId,
+ versjon,
+ tittel,
+ beskrivelse,
+ lenke,
+ type,
+ status,
+ fraDato,
+ tilDato,
+ opprettetDato,
+ endretDato,
+ endretAv,
+ historisk,
+ avsluttetKommentar,
+ avtalt,
+ forhaandsorientering {
+ id,
+ type,
+ tekst,
+ lestDato,
+ }
+ endretAvType,
+ transaksjonsType,
+ malid,
+ oppfolgingsperiodeId,
+
+ # stillingaktivitet
+ etikett,
+ kontaktperson,
+ arbeidsgiver,
+ arbeidssted,
+ stillingsTittel,
+
+ # // egenaktivitet
+ hensikt,
+ oppfolging,
+
+ # //sokeAvtaleAktivitet
+ antallStillingerSokes,
+ antallStillingerIUken,
+ avtaleOppfolging,
+
+ # //iJobbAktivitet
+ jobbStatus,
+ ansettelsesforhold,
+ arbeidstid,
+
+ # //behandlingAktivitet
+ behandlingType,
+ behandlingSted,
+ effekt,
+ behandlingOppfolging,
+
+ # //møte
+ adresse,
+ forberedelser,
+ kanal,
+ referat,
+ erReferatPublisert,
+
+ stillingFraNavData {
+ cvKanDelesData {
+ kanDeles,
+ endretTidspunkt,
+ endretAv,
+ endretAvType,
+ avtaltDato,
+ }
+ soknadsfrist,
+ svarfrist,
+ arbeidsgiver,
+ bestillingsId,
+ stillingsId,
+ arbeidssted,
+ kontaktpersonData {
+ navn,
+ tittel,
+ mobil,
+ }
+ soknadsstatus,
+ livslopsStatus,
+ varselId,
+ detaljer,
+ }
+
+ eksternAktivitet {
+ type,
+ oppgave {
+ ekstern {
+ subtekst,
+ tekst,
+ url
+ }
+ intern {
+ subtekst,
+ tekst,
+ url
+ }
+ }
+ handlinger {
+ url,
+ tekst,
+ subtekst,
+ lenkeType
+ }
+ detaljer {
+ label,
+ verdi
+ }
+ etiketter {
+ tekst,
+ kode,
+ sentiment
+ }
+ }
+ },
+ }
+ }
+`,queryBody=T=>({query,variables:{fnr:T}}),hentAktiviteterGraphql=async()=>{const T=hentFraSessionStorage(LocalStorageElement.FNR)||"";return fetch(AKTIVITET_GRAPHQL_BASE_URL,{...DEFAULT_CONFIG,method:"POST",headers:{"Content-Type":"application/json","Nav-Consumer-Id":"aktivitetsplan"},body:JSON.stringify(queryBody(T))}).then(sjekkStatuskode).then(toJson).then(sjekkGraphqlFeil)},sjekkGraphqlFeil=T=>{var C;return!((C=T==null?void 0:T.data)!=null&&C.perioder)&&(T==null?void 0:T.errors.length)!=0?Promise.reject("Kunne ikke hente aktiviteter"):Promise.resolve(T)},hentAktiviteter=createAsyncThunk("aktiviteter/hent",async()=>await hentAktiviteterGraphql()),hentAktivitet=createAsyncThunk("aktivitet/hent",async T=>await hentAktivitet$1(T)),oppdaterAktivitetEtikett=createAsyncThunk("aktivitet-etikett/oppdater",async T=>await oppdaterAktivitetEtikett$1(T)),oppdaterAktivitet=createAsyncThunk("aktivitet/oppdater",async T=>await oppdaterAktivitet$1(T)),settAktivitetTilAvtalt=createAsyncThunk("aktivitet/fho",async({aktivitet:T,forhaandsorientering:C})=>await settAktivitetTilAvtalt$1(T.id,T.versjon,C)),markerForhaandsorienteringSomLest=createAsyncThunk("aktivitet/fho/lest",async T=>await markerForhaandsorienteringSomLest$1(T.id,T.versjon)),flyttAktivitet=createAsyncThunk("aktivitet/flytt",async({aktivitet:T,status:C})=>await oppdaterAktivitetStatus({...T,status:C}));function flyttAktivitetMedBegrunnelse(T,C,$){const V={...T,avsluttetKommentar:$};return flyttAktivitet({aktivitet:V,status:C})}function avbrytAktivitet(T,C){const $={...T,avsluttetKommentar:C};return flyttAktivitet({aktivitet:$,status:AktivitetStatus.AVBRUTT})}function fullforAktivitet(T,C){const $={...T,avsluttetKommentar:C};return flyttAktivitet({aktivitet:$,status:AktivitetStatus.FULLFOERT})}const oppdaterCVSvar=createAsyncThunk("aktivitet/oppdaterCvSvar",async({aktivitetId:T,aktivitetVersjon:C,kanDeles:$,avtaltDato:V})=>await oppdaterCvKanDelesSvar(T,C,$,V)),oppdaterStillingFraNavSoknadsstatus=createAsyncThunk("aktivitet-stilling-fra-nav-status/oppdater",async({aktivitetId:T,aktivitetVersjon:C,soknadsstatus:$})=>await oppdaterStillingFraNavSoknadsstatus$1(T,C,$)),lagNyAktivitet=createAsyncThunk("aktivitet/opprett",async T=>await lagNyAktivitet$1(T)),oppdaterReferat=createAsyncThunk("referat/oppdater",async T=>await oppdaterReferat$1(T)),publiserReferat=createAsyncThunk("referat/publiser",async T=>await publiserReferat$1({...T,erReferatPublisert:!0})),fetchIdentitet=()=>fetchToJson(`${OPPFOLGING_BASE_URL}/oppfolging/me`),settDigital$1=()=>postAsJson(`${OPPFOLGING_BASE_URL}/oppfolging/settDigital`),fetchOppfolging=()=>fetchToJson(`${OPPFOLGING_BASE_URL}/oppfolging`),fetchMal=()=>fetchToJson(`${OPPFOLGING_BASE_URL}/oppfolging/mal`),fetchMalListe=()=>fetchToJson(`${OPPFOLGING_BASE_URL}/oppfolging/malListe`),lagreMal=T=>postAsJson(`${OPPFOLGING_BASE_URL}/oppfolging/mal`,T),fetchHarFlereAktorId=()=>fetchToJson(`${OPPFOLGING_BASE_URL}/oppfolging/harFlereAktorIderMedOppfolging`),doLesAktivitetsplan=T=>postAsJson(`${OPPFOLGING_BASE_URL}/${T}/lestaktivitetsplan`),oppfolgingSlice=createGenericSlice({name:"oppfolging",initialState:{data:void 0,status:Status.NOT_STARTED},reducers:{}}),hentOppfolging=createAsyncThunk(`${oppfolgingSlice.name}/fetchOppfolging`,async()=>await fetchOppfolging()),settDigital=createAsyncThunk(`${oppfolgingSlice.name}/settDigital`,async()=>await settDigital$1()),oppfolgingReducer=oppfolgingSlice.reducer;var UpdateTypes=(T=>(T.Dialog="DIALOG",T.Oppfolging="OPPFOLGING",T.Aktivitet="AKTIVITET",T))(UpdateTypes||{});const eventName="uppdate";function windowEvent(T){window.dispatchEvent(new CustomEvent(eventName,{detail:{uppdate:T,avsender:"aktivitetsplan"}}))}function UpdateEventHandler(){const T=useAppDispatch();return useEventListener(eventName,C=>{const $=C.detail.uppdate;if(C.detail.avsender!=="aktivitetsplan")switch($){case"AKTIVITET":return T(hentAktiviteter());case"DIALOG":return T(hentDialoger());case"OPPFOLGING":return T(hentOppfolging())}}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}const initialState$8={data:[],status:Status.NOT_STARTED},nyStateMedOppdatertAktivitet$1=(T,C)=>{const $=T.data.findIndex(K=>K.id===C.id),V=[...T.data];return V[$]=C,{...T,data:V}},arenaAktivitetSlice=createSlice({name:"arenaAktivitet",initialState:initialState$8,reducers:{},extraReducers:T=>{T.addCase(hentArenaAktiviteter.fulfilled,(C,$)=>{C.data=$.payload,C.status=Status.OK}),T.addCase(hentArenaAktiviteter.rejected,C=>{C.status=Status.ERROR}),T.addCase(sendForhaandsorienteringArenaAktivitet.fulfilled,(C,$)=>(windowEvent(UpdateTypes.Aktivitet),nyStateMedOppdatertAktivitet$1({...C},$.payload))),T.addCase(markerForhaandsorienteringSomLestArenaAktivitet.fulfilled,(C,$)=>(windowEvent(UpdateTypes.Aktivitet),nyStateMedOppdatertAktivitet$1({...C},$.payload)))}}),hentArenaAktiviteter=createAsyncThunk(`${arenaAktivitetSlice.name}/fetchArenaAktiviteter`,async()=>await hentArenaAktiviteter$1()),validArenaPrefixes=["TA","UA","GA","ARENATA","ARENAUA","ARENAGA"],erArenaId=T=>validArenaPrefixes.some(C=>T.startsWith(C)),sendForhaandsorienteringArenaAktivitet=createAsyncThunk(`${arenaAktivitetSlice.name}/oppdater`,async({arenaAktivitet:T,forhaandsorientering:C})=>erArenaId(T.id)?await sendForhaandsorienteringArenaAktivitet$1(T.id,C):await settAktivitetTilAvtalt$1(T.id,T.versjon.toString(),C)),markerForhaandsorienteringSomLestArenaAktivitet=createAsyncThunk(`${arenaAktivitetSlice.name}/fho/lest`,async T=>{if(erArenaId(T.id))return await markerForhaandsorienteringSomLestArenaAktivitet$1(T.id);{const C=await markerForhaandsorienteringSomLest$1(T.id,T.versjon.toString());return{...T,forhaandsorientering:C.forhaandsorientering}}}),arenaAktiviteterReducer=arenaAktivitetSlice.reducer,identitetSlice=createGenericSlice({name:"identitet",initialState:{data:{},status:Status.NOT_STARTED},reducers:{}}),hentIdentitet=createAsyncThunk(`${identitetSlice.name}/fetchIdentitet`,async()=>await fetchIdentitet()),identitetReducer=identitetSlice.reducer,fetchSisteLest=()=>fetchToJson(`${VEILARBLEST_BASE_URL}/aktivitetsplan/les`),postLest=T=>putAsJson(`${VEILARBLEST_BASE_URL}/informasjon/les?versjon=${T}`),lestSlice=createGenericSlice({name:"lest",initialState:{data:[],status:Status.NOT_STARTED},reducers:{}}),hentLest=createAsyncThunk(`${lestSlice.name}/fetchSisteLest`,async()=>await fetchSisteLest()),lestReducer=lestSlice.reducer,initialState$7={data:{},status:Status.NOT_STARTED},malSlice=createSlice({name:"mal",initialState:initialState$7,reducers:{},extraReducers:T=>{T.addCase(hentMal.pending,C=>{C.status=C.status===Status.NOT_STARTED?Status.PENDING:Status.RELOADING}),T.addCase(hentMal.fulfilled,(C,$)=>{C.status=Status.OK,C.data=$.payload}),T.addCase(hentMal.rejected,C=>{C.status=Status.ERROR}),T.addCase(oppdaterMal.fulfilled,(C,$)=>{C.data=$.payload})}}),hentMal=createAsyncThunk(`${malSlice.name}/fetchMal`,async()=>await fetchMal()),oppdaterMal=createAsyncThunk(`${malSlice.name}/oppdaterMal`,async T=>await lagreMal(T)),malReducer=malSlice.reducer,malListeSlice=createGenericSlice({name:"malListe",initialState:{data:[],status:Status.NOT_STARTED},reducers:{}}),hentMalListe=createAsyncThunk(`${malListeSlice.name}/fetchMalListe`,async()=>await fetchMalListe()),malListeReducer=malListeSlice.reducer,hentPerson=T=>fetchToJsonPlain(`${PERSON_BASE_URL}/v2/person?fnr=${T}`),hentAdresse=T=>fetchToJsonPlain(`${PERSON_BASE_URL}/v2/person/postadresse?fnr=${T}`),hentHarNivaa4=T=>fetchToJson(`${PERSON_BASE_URL}/person/${T}/harNivaa4`),tilgangSlice=createGenericSlice({name:"tilgang",reducers:{}}),hentNivaa4=createAsyncThunk(`${tilgangSlice.name}/fetchHarNivaa4`,async T=>await hentHarNivaa4(T)),tilgangReducer=tilgangSlice.reducer,selectFeil=(T,...C)=>Object.entries(T).filter(([$,V])=>C.includes($)).map(([$,V])=>V),selectErrors=T=>T.data.errors,hovedsideFeil=[hentOppfolging.rejected.type,hentIdentitet.rejected.type,hentAktiviteter.rejected.type,hentArenaAktiviteter.rejected.type,hentLest.rejected.type,hentDialoger.rejected.type,hentNivaa4.rejected.type,flyttAktivitet.rejected.type],selectHovedsideFeil=createSelector(selectErrors,T=>selectFeil(T,...hovedsideFeil)),selectLagNyAktivitetFeil=createSelector(selectErrors,T=>selectFeil(T,lagNyAktivitet.rejected.type)),selectOppdaterAktivitetStatusFeil=createSelector(selectErrors,T=>selectFeil(T,flyttAktivitet.rejected.type)),selectOppdaterAktivitetEtikettFeil=createSelector(selectErrors,T=>selectFeil(T,oppdaterAktivitetEtikett.rejected.type)),selectOppdaterStillingFraNavSoknadsstatusFeil=createSelector(selectErrors,T=>selectFeil(T,oppdaterStillingFraNavSoknadsstatus.rejected.type)),selectDeleCVFeil=createSelector(selectErrors,T=>selectFeil(T,oppdaterCVSvar.rejected.type)),selectSettAktivitetTilAvtaltFeil=createSelector(selectErrors,T=>selectFeil(T,settAktivitetTilAvtalt.rejected.type)),selectCanPrint=createSelector(selectErrors,T=>selectFeil(T,hentAktiviteter.rejected.type,hentDialoger.rejected.type).length===0),selectHentMalListeFeil=createSelector(selectErrors,T=>selectFeil(T,hentMal.rejected.type,hentMalListe.rejected.type)),selectOppdaterMalFeil=createSelector(selectErrors,T=>selectFeil(T,oppdaterMal.rejected.type)),selectPubliserReferatFeil=createSelector(selectErrors,T=>selectFeil(T,publiserReferat.rejected.type)),selectPubliserOgOppdaterReferatFeil=createSelector(selectErrors,T=>selectFeil(T,publiserReferat.rejected.type,oppdaterReferat.rejected.type));var classnames={exports:{}};/*!
+ Copyright (c) 2018 Jed Watson.
+ Licensed under the MIT License (MIT), see
+ http://jedwatson.github.io/classnames
+*/(function(T){(function(){var C={}.hasOwnProperty;function $(){for(var Y="",J=0;J{const C=T.length,$=T[0];switch($.code){case"401":return"Du er blitt logget ut. Ta vare på alt ulagret arbeid før du logger inn ved å laste siden på nytt.";case"403":return"Noe gikk dessverre galt med aktivitetsplanen. Du har ikke tilgang til å se dette"}if(C>1)return"Noe gikk dessverre galt med aktivitetsplanen. Prøv igjen senere.";switch($.type){case hentAktiviteter.rejected.type:case hentAktivitet.rejected.type:case hentArenaAktiviteter.rejected.type:return"Noe gikk galt, og du får dessverre ikke sett alle aktiviteter. Prøv igjen senere.";case hentNivaa4.rejected.type:return"Noe gikk galt, og du får dessverre ikke sende forhåndsorientering. Prøv igjen senere.";case hentDialoger.rejected.type:return"Noe gikk galt, og du får dessverre ikke sett dialogmeldinger. Prøv igjen senere.";case flyttAktivitet.rejected.type:return"Noe gikk galt, og du får dessverre ikke oppdatert status på aktiviteten. Prøv igjen senere.";case oppdaterMal.rejected.type:return"Noe gikk galt, og du får dessverre ikke oppdatert mål. Prøv igjen senere.";case publiserReferat.rejected.type:return"Noe gikk dessverre galt med deling av referat. Prøv igjen senere.";default:return"Noe gikk dessverre galt med aktivitetsplanen. Prøv igjen senere."}};function Feilmelding(T){const{feilmeldinger:C,inline:$=!1}=T;if(C.length===0)return null;const V=getErrorText(C);return jsxRuntimeExports.jsx("div",{className:classNames("my-4"),children:jsxRuntimeExports.jsx(Alert$1,{variant:"error",inline:$,children:V})})}const hash=(T,C=0)=>{if(T===void 0)return;let $=3735928559^C,V=1103547991^C;for(let K=0,Y;K>>16,2246822507)^Math.imul(V^V>>>13,3266489909),V=Math.imul(V^V>>>16,2246822507)^Math.imul($^$>>>13,3266489909),(4294967296*(2097151&V)+($>>>0)).toString()};function loggEvent(T,C,$){const V={name:T,fields:C,tags:$},K=`${AKTIVITET_BASE_URL}/logger/event`,Y={headers:{"Nav-Consumer-Id":"aktivitetsplan","Content-Type":"application/json"},credentials:"same-origin",method:"post",body:JSON.stringify(V)};return fetch(K,Y)}const FORHANDSORIENTERING_LOGGEVENT="aktivitetsplan.forhandsorientering",FORHANDSORIENTERING_LOGGEVENT_KRR_KVP_MANUELL="avtaltMedNavKrrKvpManuell",FORHANDSORIENTERING_LOGGEVENT_MINDRE_ENN_SYV_DAGER="avtaltMedNavMindreEnnSyvDager",FORHANDSORIENTERING_LOGGEVENT_TILLTAK_SPESIALTILPASSAD="tilltakSpesialTilltakBruker",MITTMAL_KLIKK_LOGGEVENT="aktivitetsplan.mittmal.klikk",MITTMAL_LAGRE_LOGGEVENT="aktivitetsplan.mittmal.lagre",TID_BRUKT_GAINNPA_PLANEN="tidbrukt.gainnpa.planen",STILLING_FRA_NAV_AAPNE_STILLINGSLENKE="aktivitetsplan.stillingfranav.stillingslenke.klikk",LOGGING_ANTALLBRUKERE="aktivitetsplan.antallSluttBrukere",ANTALL_VEILEDERE="aktivitetsplan.antallVeiledere",LOGG_BRUKER_IKKE_OPPFOLGING="aktivitetsplan.antallBrukerIkkeOppfolging",PRINT_MODAL_OPEN="aktivitetsplan.printmodal",TRYK_PRINT="aktivitetsplan.printmodalprint",APNE_NY_AKTIVITET="aktivitetsplan.nyAktivitet.trykk",APNE_OM_TJENESTEN="aktivitetsplan.omTjenesten.trykk",APNE_ENDRE_AKTIVITET="aktivitetsplan.endreAktivitet.trykk",OPNE_AKTIVITETFILTER="aktivitetsplan.aktivitetfilter.opne",VIS_HISTORISK_PERIODE="aktivitetsplan.vis.historisk",filterBase="aktivitetsplan.filter.",AKTIVITESTYPE_FILER_METRIKK=`${filterBase}aktivitestype`,AVTALT_FILER_METRIKK=`${filterBase}avtalt`,ETIKETT_FILTER_METRIKK=`${filterBase}etikett`,ARENA_ETIKETT_FILTER_METRIKK=`${filterBase}arenatEtikett`,AKTIVITET_FLYTTET="aktivitetsplan.aktivitet.flyttet",FORHAANDSORIENTERING_LEST="aktivitetsplan.forhaandsorientering.lest";function loggForhaandsorienteringLest(T,C){loggEvent(FORHAANDSORIENTERING_LEST,{},{aktivitetType:T,lestKnappTrykket:C})}function logTimeToAktivitestavlePaint(T){const C=!T||window.defaultSelectedTab==="AKTIVITETSPLAN";if(!window.aktivitesplanTimeToAktivitestavlePaint&&C){const $=performance.now();window.aktivitesplanTimeToAktivitestavlePaint=$,loggEvent("aktivitetsplan.timeToAktivitestavlePaintv3",{timeToAktivitestavlePaint:$},{erVeileder:T})}}function loggAntalVeiledere(T,C,$,V){const K={underOppfolging:C,veileder:hash($),bruker:hash(V)};loggEvent(ANTALL_VEILEDERE,K,{servicegruppe:T})}function loggingAntallBrukere(T,C,$){C?loggEvent(LOGGING_ANTALLBRUKERE,{bruker:hash($)},{servicegruppe:T}):loggEvent(LOGG_BRUKER_IKKE_OPPFOLGING,{},{servicegruppe:T})}function loggForhandsorienteringTiltak(){loggEvent(FORHANDSORIENTERING_LOGGEVENT,{forhandsorienteringType:FORHANDSORIENTERING_LOGGEVENT_TILLTAK_SPESIALTILPASSAD})}function metrikkTidForsteAvtalte(T){loggEvent("aktivitetsplan.aktivitet.forste.avtalt.v2",{tidSidenOppfolging:T})}function flyttetAktivitetMetrikk(T,C,$){loggEvent(AKTIVITET_FLYTTET,{fraStatus:C.status,tilStatus:$,aktivitetType:C.type,flytteMetode:T})}function loggForhandsorientering(T,C,$,V){return T?loggEvent(FORHANDSORIENTERING_LOGGEVENT,{forhandsorienteringType:FORHANDSORIENTERING_LOGGEVENT_KRR_KVP_MANUELL,aktivitettype:V}):C?loggEvent(FORHANDSORIENTERING_LOGGEVENT,{forhandsorienteringType:FORHANDSORIENTERING_LOGGEVENT_MINDRE_ENN_SYV_DAGER,aktivitettype:V}):loggEvent(FORHANDSORIENTERING_LOGGEVENT,{forhandsorienteringType:$,aktivitettype:V})}function loggMittMalKlikk(T){loggEvent(MITTMAL_KLIKK_LOGGEVENT,{erVeileder:T})}function loggMittMalLagre(T){loggEvent(MITTMAL_LAGRE_LOGGEVENT,{erVeileder:T})}function loggStillingFraNavStillingslenkeKlikk(T){loggEvent(STILLING_FRA_NAV_AAPNE_STILLINGSLENKE,{erVeileder:T})}function tidBruktFra(T,C){const $=C?new Date(C).getTime():new Date().getTime();return Math.ceil(Math.abs(new Date(T).getTime()-$)/(1e3*3600*24))}function loggTidBruktFraRegistrert(T){loggEvent(TID_BRUKT_GAINNPA_PLANEN,{tidBruktFraRegistrert:tidBruktFra(T)})}function loggTidBruktGaaInnPaaAktivitetsplanen(T,C){const $=C.find(V=>V.sluttDato===null);if($){if(T.length===0){const V=$.startDato,K=new Date("2019-02-01").getTime(),Y=new Date(V).getTime();KK.ressurs==="aktivitetsplan");if(V){const K=new Date($.startDato).getTime(),Y=new Date(V.tidspunkt).getTime();K{sendFeiltyperMetrikk(T,C),sendFeilMetrikk(T,$)},[T])}function sendFeiltyperMetrikk(T,C){const $=T.map(V=>klassifiserFeil(V));new Set($).forEach(V=>{C.current.has(V)||(C.current.add(V),loggEvent("aktivitetsplan.feil",{feil_kategori:V},{feil_kategori_tag:V}))})}function sendFeilMetrikk(T,C){const $=T.filter(V=>V.code!=="403"&&V.code!=="401");new Set($).forEach(V=>{const K=V.type;C.current.has(K)||(C.current.add(K),loggEvent("aktivitetsplan.feiltype",{feil:K,feil_kategori:klassifiserFeil(V)}))})}function klassifiserFeil(T){if(T.code==="403")return"forbidden";if(T.code==="401")return"unauthorized";switch(T.type){case hentIdentitet.rejected.type:case hentAktiviteter.rejected.type:case hentOppfolging.rejected.type:return"critical";case hentArenaAktiviteter.rejected.type:case hentDialoger.rejected.type:case hentNivaa4.rejected.type:return"degraded";default:return"unknown"}}function HovedsideFeilmelding(){const T=useSelector(selectHovedsideFeil);return useFeilMetrikker(T),jsxRuntimeExports.jsx(Feilmelding,{feilmeldinger:T})}function selectFilterSlice(T){return T.data.filter}function selectHistoriskPeriode(T){return selectFilterSlice(T).historiskPeriode}function selectAktivitetTyperFilter(T){return selectFilterSlice(T).aktivitetTyper}function selectAktivitetEtiketterFilter(T){return selectFilterSlice(T).aktivitetEtiketter}function selectArenaAktivitetEtiketterFilter(T){return selectFilterSlice(T).arenaAktivitetEtiketter}function selectAktivitetAvtaltMedNavFilter(T){return selectFilterSlice(T).aktivitetAvtaltMedNav}function selectViserInneverendePeriode(T){return!selectHistoriskPeriode(T)}function selectViserHistoriskPeriode(T){return!selectViserInneverendePeriode(T)}function selectOppfolgingSlice(T){return T.data.oppfolging}function selectOppfolgingData(T){return selectOppfolgingSlice(T).data}function selectOppfolgingStatus(T){return selectOppfolgingSlice(T).status}const selectReservasjonKRR=T=>{var C;return(C=selectOppfolgingData(T))==null?void 0:C.reservasjonKRR};function selectServicegruppe(T){var C;return(C=selectOppfolgingData(T))==null?void 0:C.servicegruppe}const selectOppfolgingsPerioder=createSelector(selectOppfolgingData,T=>(T==null?void 0:T.oppfolgingsPerioder)||[]);function selectNyesteOppfolgingsperiode(T){return selectOppfolgingsPerioder(T).find(C=>!C.sluttDato)}const selectHistoriskeOppfolgingsPerioder=createSelector(selectOppfolgingsPerioder,T=>T.filter(C=>C.sluttDato)),selectForrigeHistoriskeSluttDato=createSelector(selectHistoriskeOppfolgingsPerioder,T=>T.map(C=>C.sluttDato).sort().reverse()[0]),selectSorterteHistoriskeOppfolgingsPerioder=createSelector(selectHistoriskeOppfolgingsPerioder,T=>{let C=new Date().toISOString();return T.sort(($,V)=>$.sluttDato.localeCompare(V.sluttDato)).map($=>{const{sluttDato:V}=$,K=C;return C=V,{...$,fra:K,til:V}}).reverse()});function selectKvpPeriodeForValgteOppfolging(T){let C=selectHistoriskPeriode(T);C||(C=selectNyesteOppfolgingsperiode(T)??selectSorterteHistoriskeOppfolgingsPerioder(T)[0]);const $=C&&C.uuid,V=selectOppfolgingsPerioder(T).find(K=>K.uuid===$);return V&&V.kvpPerioder}function selectErUnderOppfolging(T){var C;return((C=selectOppfolgingData(T))==null?void 0:C.underOppfolging)||!1}function selectErBrukerManuell(T){var C;return(C=selectOppfolgingData(T))==null?void 0:C.manuell}function selectAktorId(T){var C;return(C=selectOppfolgingData(T))==null?void 0:C.aktorId}function selectErUnderKvp(T){var C;return(C=selectOppfolgingData(T))==null?void 0:C.underKvp}function selectHarSkriveTilgang(T){var C;return((C=selectOppfolgingData(T))==null?void 0:C.harSkriveTilgang)||!1}function selectKanReaktiveres(T){var C;return(C=selectOppfolgingData(T))==null?void 0:C.kanReaktiveres}function selectInaktiveringsDato(T){var C;return(C=selectOppfolgingData(T))==null?void 0:C.inaktiveringsdato}function selectTilgangSlice(T){return T.data.tilgang}function selectTilgangData(T){return selectTilgangSlice(T).data}function selectNivaa4(T){const C=selectTilgangData(T);return C?C.harbruktnivaa4:!1}function selectNivaa4LastetOk(T){return selectNivaa4Status(T)===Status.OK}function selectNivaa4Status(T){return selectTilgangSlice(T).status}const selectNivaa4Feilmeldinger=createSelector(selectTilgangSlice,selectErrors,(T,C)=>T.status===Status.ERROR?selectFeil(C,hentNivaa4.rejected.type):[]),Mere=()=>jsxRuntimeExports.jsxs(HelpText$1,{placement:"bottom",children:["Denne brukeren har ikke vært innlogget de siste 18 månedene med nivå 4 (for eksempel BankID). ",jsxRuntimeExports.jsx("br",{}),"Du kan derfor ikke sende forhåndsorientering, varsel og meldinger."]}),Nivaa4Feilmelding=()=>{const T=useSelector(selectNivaa4),C=useSelector(selectNivaa4LastetOk),$=useSelector(selectReservasjonKRR),V=useSelector(selectErBrukerManuell);return T||!C||V||$?null:jsxRuntimeExports.jsx("div",{className:"m-4",children:jsxRuntimeExports.jsxs(Alert$1,{variant:"warning",children:["Denne brukeren kan ikke logge inn i aktivitetsplan og dialog.",jsxRuntimeExports.jsx(Mere,{})]})})},aktivitetRoute=T=>`/aktivitet/vis/${T}`,nyAktivitetRoute=()=>"/aktivitet/ny",endreAktivitetRoute=T=>`/aktivitet/endre/${T}`,fullforAktivitetRoute=T=>`/aktivitet/fullfor/${T}`,avbrytAktivitetRoute=T=>`/aktivitet/avbryt/${T}`,hovedsideRoute=()=>"/",malRoute=()=>"/mal",informasjonRoute=()=>"/informasjon",useRoutes=()=>({aktivitetRoute:T=>aktivitetRoute(T),nyAktivitetRoute:()=>nyAktivitetRoute(),endreAktivitetRoute:T=>endreAktivitetRoute(T),fullforAktivitetRoute:T=>fullforAktivitetRoute(T),avbrytAktivitetRoute:T=>avbrytAktivitetRoute(T),hovedsideRoute:()=>hovedsideRoute(),malRoute:()=>malRoute(),informasjonRoute:()=>informasjonRoute()});function selectIdentitetSlice(T){return T.data.identitet}function selectIdentitetData(T){return selectIdentitetSlice(T).data}function selectErBruker(T){return selectIdentitetData(T).erBruker}function selectIdentitetId(T){return selectIdentitetData(T).id}function selectIdentitetStatus(T){return selectIdentitetSlice(T).status}function selectLestSlice(T){return T.data.lest}function selectLestData(T){return selectLestSlice(T).data}function selectLestRessurs(T,C){return selectLestData(T).filter($=>$.ressurs===C)[0]}function selectLestInformasjon(T){return selectLestRessurs(T,"informasjon")}function selectLestAktivitetsplan(T){return selectLestRessurs(T,"aktivitetsplan")}function selectLestStatus(T){return selectLestSlice(T).status}var propTypes={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function T(V,K,Y,J,re,ne){if(ne!==ReactPropTypesSecret){var te=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw te.name="Invariant Violation",te}}T.isRequired=T;function C(){return T}var $={array:T,bigint:T,bool:T,func:T,number:T,object:T,string:T,symbol:T,any:T,arrayOf:C,element:T,elementType:T,instanceOf:C,node:T,objectOf:C,oneOf:C,oneOfType:C,shape:C,exact:C,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return $.PropTypes=$,$};propTypes.exports=factoryWithThrowingShims();var propTypesExports=propTypes.exports;const PropTypes=getDefaultExportFromCjs(propTypesExports);function asArray(T){return Array.isArray(T)?T:[T]}const harStatus=(...T)=>C=>asArray(T).includes(C),noenHarFeil=T=>T.some(harStatus(Status.ERROR)),minstEnErOK=T=>T.some(harStatus(Status.OK)),alleLastet=T=>T.every(harStatus(Status.OK,Status.RELOADING)),alleErOK=T=>T.every(harStatus(Status.OK)),toStatus=T=>T?asArray(T).map(C=>!C||typeof C=="string"?C:C.status).map(C=>C||"NOT_SETT"):[],Innholdslaster=T=>{const{avhengigheter:C,spinnerSize:$="2xlarge",className:V,children:K,minstEn:Y=!1,visChildrenVedFeil:J=!1,alleOK:re=!1,...ne}=T,te=toStatus(C);return(re?alleErOK(te):alleLastet(te)||Y&&minstEnErOK(te)||J&&noenHarFeil(te))?typeof K=="function"?K(C,ne):(Array.isArray(K),K):noenHarFeil(te)?null:jsxRuntimeExports.jsx("div",{className:"flex-1 flex items-center justify-center",children:jsxRuntimeExports.jsx(Loader,{size:$,className:classNames(V,"m-3")})})},Modal=T=>{const{heading:C,subHeading:$,children:V,avhengigheter:K,onRequestClose:Y,minstEnAvhengighet:J=!1,feilmeldinger:re,tilbakeLenke:ne,onClose:te}=T,se=useNavigate(),{hovedsideRoute:ie,nyAktivitetRoute:ae}=useRoutes(),oe=()=>Y?Y():(se(ie()),!0);return jsxRuntimeExports.jsxs(Modal$1,{closeOnBackdropClick:!0,open:!0,onClose:te,onBeforeClose:oe,className:"lg:w-120","aria-labelledby":"modal-heading",children:[jsxRuntimeExports.jsx(Modal$1.Header,{closeButton:!0,children:jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[jsxRuntimeExports.jsx(Heading,{id:"modal-heading",size:"large",children:C}),ne?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Link$2,{className:"hover:cursor-pointer text-text-action underline",to:ae(),tabIndex:0,children:ne.tekst})}):null]})}),jsxRuntimeExports.jsx(Modal$1.Body,{children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col max-w-2xl mx-auto",children:[$?jsxRuntimeExports.jsx(Heading,{className:"",level:"2",size:"xsmall",children:$}):null,re&&jsxRuntimeExports.jsx(Feilmelding,{feilmeldinger:re}),jsxRuntimeExports.jsx(Innholdslaster,{className:"flex m-auto my-8",minstEn:J,avhengigheter:K,children:V})]})})]})},ModalContainer=T=>{const{className:C,children:$}=T;return jsxRuntimeExports.jsx("div",{className:classNames(C,"modal-container"),children:$})},aktivitet=PropTypes.shape({tittel:PropTypes.string,fraDato:PropTypes.string,tilDato:PropTypes.string,opprettetDato:PropTypes.string.isRequired,endretDato:PropTypes.string,historisk:PropTypes.bool,endretAvType:PropTypes.string,detaljer:PropTypes.object,beskrivelse:PropTypes.string,avtalt:PropTypes.bool,tiltaksarrangor:PropTypes.string,deltakelsesprosent:PropTypes.number,dagerPerUke:PropTypes.number});PropTypes.arrayOf(aktivitet);const henvendelse=PropTypes.shape({dialogId:PropTypes.string.isRequired,tekst:PropTypes.string.isRequired,avsender:PropTypes.string.isRequired,avsenderId:PropTypes.string,sendt:PropTypes.string.isRequired,lest:PropTypes.bool.isRequired});PropTypes.shape({id:PropTypes.string.isRequired,overskrift:PropTypes.string.isRequired,aktivitetId:PropTypes.string,lest:PropTypes.bool,sisteDato:PropTypes.string,sisteTekst:PropTypes.string,erLestAvBruker:PropTypes.bool,venterPaSvar:PropTypes.bool,ferdigBehandlet:PropTypes.bool,henvendelser:PropTypes.arrayOf(henvendelse).isRequired,egenskaper:PropTypes.arrayOf(PropTypes.string)});PropTypes.shape({id:PropTypes.string,type:PropTypes.string,visningsTekst:PropTypes.string});const slice=PropTypes.shape({status:PropTypes.string,data:PropTypes.any}),status=PropTypes.oneOf(Object.keys(Status)),avhengighet=PropTypes.oneOfType([slice,status]),avhengigheter=PropTypes.arrayOf(avhengighet),avslutningStatus=PropTypes.shape({kanAvslutte:PropTypes.bool,underOppfolging:PropTypes.bool,harYtelser:PropTypes.bool,harTiltak:PropTypes.bool,underKvp:PropTypes.bool,inaktiveringsDato:PropTypes.string}),eskaleringsvarsel=PropTypes.shape({varselId:PropTypes.number,aktorId:PropTypes.string,opprettetAv:PropTypes.string,opprettetDato:PropTypes.string,avsluttetDato:PropTypes.string,tilhorendeDialogId:PropTypes.number});PropTypes.shape({status:PropTypes.string,data:PropTypes.shape({fnr:PropTypes.string,veileder:PropTypes.string,reservasjonKRR:PropTypes.bool,manuell:PropTypes.bool,underOppfolging:PropTypes.bool,oppfolgingUtgang:PropTypes.string,gjeldendeEkskaleringsvarsel:eskaleringsvarsel,kanStarteOppfolging:PropTypes.bool,underKvp:PropTypes.bool,avslutningStatus,oppfolgingsPerioder:PropTypes.arrayOf(PropTypes.object),harSkriveTilgang:PropTypes.bool})});const mal=PropTypes.shape({mal:PropTypes.string,endretAv:PropTypes.string,dato:PropTypes.string});PropTypes.arrayOf(mal);PropTypes.shape({status:PropTypes.string,data:PropTypes.shape({navn:PropTypes.string})});PropTypes.shape({id:PropTypes.string,fra:PropTypes.string,vistFra:PropTypes.string,til:PropTypes.string});PropTypes.shape({type:PropTypes.string,httpStatus:PropTypes.number,melding:PropTypes.shape({id:PropTypes.string,type:PropTypes.string.isRequired,detaljer:PropTypes.object})});PropTypes.shape({etternavn:PropTypes.string,fornavn:PropTypes.string,ident:PropTypes.string,navn:PropTypes.string});PropTypes.shape({overskrift:PropTypes.string,beskrivelse:PropTypes.string});PropTypes.oneOf([SOKEAVTALE_AKTIVITET_TYPE,EGEN_AKTIVITET_TYPE,STILLING_AKTIVITET_TYPE,TILTAK_AKTIVITET_TYPE,GRUPPE_AKTIVITET_TYPE,UTDANNING_AKTIVITET_TYPE,IJOBB_AKTIVITET_TYPE,BEHANDLING_AKTIVITET_TYPE,MOTE_TYPE,SAMTALEREFERAT_TYPE]);const malverktype=PropTypes.shape({type:PropTypes.string,tittel:PropTypes.string,hensikt:PropTypes.string,antallStillingerSokes:PropTypes.number,avtaleOppfolging:PropTypes.string,oppfolging:PropTypes.string,beskrivelse:PropTypes.string,lenke:PropTypes.string,status:PropTypes.string,fraDato:PropTypes.string,tilDato:PropTypes.string}),lest=PropTypes.shape({tidspunkt:PropTypes.string.isRequired,verdi:PropTypes.string,ressurs:PropTypes.string.isRequired}),AktivitetskortVideo=()=>jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("iframe",{title:"Video: Aktivitetskort",src:"https://video.qbrick.com/play2/embed/qbrick-player?accountId=763558&mediaId=418eb7de-64bc-403f-a711-a57762aa6454&configId=qbrick-player&pageStyling=adaptive&autoplay=false&repeat=false&sharing=true&download=false&volume&language=nb",allow:"fullscreen",className:" w-full h-300px mt-4"})}),BrukePlanenPanel=()=>{const[T,C]=reactExports.useState(!1);function $(){T||logAccordionAapnet("Slik bruker du aktivitetsplanen"),C(!T)}return jsxRuntimeExports.jsxs(Accordion$1.Item,{children:[jsxRuntimeExports.jsx(Accordion$1.Header,{onClick:$,children:jsxRuntimeExports.jsx(Heading,{level:"2",size:"small",children:"Slik bruker du aktivitetsplanen"})}),jsxRuntimeExports.jsxs(Accordion$1.Content,{children:[jsxRuntimeExports.jsx(BodyShort,{className:"pb-4",children:"Bestem deg først for hva som er målet ditt. Du kan endre dette senere. Vurder så hvilke aktiviteter du ønsker å gjøre for å nå målet, for eksempel å søke jobber, gjennomføre et kurs eller arbeidstrening."}),jsxRuntimeExports.jsx(BodyShort,{children:"I aktivitetsplanen kan du og veilederen din samarbeide om hva som skal til for at du skal komme i aktivitet eller jobb. Du og veilederen din ser den samme planen."}),jsxRuntimeExports.jsx(Heading,{level:"3",size:"xsmall",className:"pt-4",children:"Avtalt med NAV"}),jsxRuntimeExports.jsx(BodyShort,{children:"Når du har avtalt å gjennomføre en aktivitet med veilederen din, vil veilederen merke den «Avtalt med NAV». Du må gjennomføre slike aktiviteter. Hvis du ikke følger opp avtalte aktiviteter, kan du risikere å miste pengestøtte fra NAV."}),jsxRuntimeExports.jsx(Heading,{level:"3",size:"xsmall",className:"pt-4",children:"Flytte på en aktivitet"}),jsxRuntimeExports.jsx(BodyShort,{children:"Aktivitetsplanen har fem kolonner med statusene forslag, planlegger, gjennomfører, fullført og avbrutt. Statusen på aktiviteten viser til hvor langt du har kommet i gjennomføringen. Du kan oppdatere statusen inne i aktiviteten, for eksempel fra «gjennomfører» til «fullført»."}),jsxRuntimeExports.jsx(Heading,{level:"3",size:"xsmall",className:"pt-4",children:"Blå prikk"}),jsxRuntimeExports.jsx(BodyShort,{children:"Hvis du ser at en aktivitet er merket med blå prikk, er det veilederen din som har gjort noe nytt siden sist du var inne i aktiviteten."}),jsxRuntimeExports.jsx(Heading,{level:"3",size:"xsmall",className:"pt-4",children:"Tidligere planer"}),jsxRuntimeExports.jsx(BodyShort,{children:"Hvis du har vært registrert hos NAV før, kan du se aktivitetsplanen fra denne perioden."}),jsxRuntimeExports.jsx(AktivitetskortVideo,{})]})]})},OkonomiskStotte=()=>{const[T,C]=reactExports.useState(!1);function $(){T||logAccordionAapnet("Aktivitetsplanen handler ikke om økonomi"),C(!T)}return jsxRuntimeExports.jsxs(Accordion$1.Item,{children:[jsxRuntimeExports.jsx(Accordion$1.Header,{onClick:$,children:jsxRuntimeExports.jsx(Heading,{level:"2",size:"small",children:"Aktivitetsplanen handler ikke om økonomi"})}),jsxRuntimeExports.jsxs(Accordion$1.Content,{children:[jsxRuntimeExports.jsx(BodyShort,{children:"Aktivitetsplanen og dialogen skal bare handle om jobbrettede aktiviteter. Har du spørsmål om økonomisk støtte, økonomisk sosialhjelp, boligsituasjon eller andre ting som ikke handler om å komme i jobb, kan du"}),jsxRuntimeExports.jsxs("ul",{className:"list-disc mt-4 pl-8",children:[jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsxs(BodyShort,{children:["kontakte NAV i tjenesten"," ",jsxRuntimeExports.jsx(Link$1,{href:"https://www.nav.no/person/kontakt-oss/skriv-til-oss",children:"«Skriv til oss»"})]})}),jsxRuntimeExports.jsxs("li",{children:[jsxRuntimeExports.jsx(BodyShort,{children:"ringe NAV på 55 55 33 33"})," "]})]})]})]})};function RettigheterPanel(){const[T,C]=reactExports.useState(!1);function $(){T||logAccordionAapnet("Rettigheter og personvern"),C(!T)}return jsxRuntimeExports.jsxs(Accordion$1.Item,{children:[jsxRuntimeExports.jsx(Accordion$1.Header,{onClick:$,children:jsxRuntimeExports.jsx(Heading,{level:"2",size:"small",children:"Rettigheter og personvern"})}),jsxRuntimeExports.jsxs(Accordion$1.Content,{children:[jsxRuntimeExports.jsx(BodyShort,{children:"Du har rett til å få en aktivitetsplan når du har registrert deg hos NAV. Informasjonen i aktivitetsplanen og annen informasjon du gir til veilederen din brukes til å vurdere ditt behov for hjelp fra NAV."}),jsxRuntimeExports.jsx(Heading,{level:"3",size:"xsmall",className:"pt-4",children:"Manuell oppfølging"}),jsxRuntimeExports.jsx(BodyShort,{children:"NAV henter informasjon om deg fra Folkeregisteret og sjekker mot Kontakt- og reservasjonsregisteret for å se om du har reservert deg mot digital kommunikasjon med det offentlige. Hvis du har reservert deg, eller ikke er i stand til å bruke aktivitetsplanen, vil NAV følge deg opp manuelt. Det betyr at en veileder følger deg opp, uten at du selv bruker den digitale aktivitetsplanen. Du får aktivitetsplanen skrevet ut på papir."}),jsxRuntimeExports.jsx(Heading,{level:"3",size:"xsmall",className:"pt-4",children:"Deling og lagring"}),jsxRuntimeExports.jsx(BodyShort,{className:"pb-4",children:"Opplysningene i aktivitetsplanen blir ikke delt med andre offentlige etater, med mindre de har rett til å hente slike opplysninger."}),jsxRuntimeExports.jsx(BodyShort,{className:"pb-4",children:"Opplysningene i aktivitetsplanen din blir lagret og oppbevart etter arkivloven. Aktiviteter og meldinger i dialogen kan ikke slettes når de først er opprettet."}),jsxRuntimeExports.jsxs(BodyShort,{children:["Les mer om"," ",jsxRuntimeExports.jsx(Link$1,{href:"https://www.nav.no/no/NAV+og+samfunn/Om+NAV/personvern-i-arbeids-og-velferdsetaten",children:"hvordan NAV behandler personopplysninger"}),"."]})]})]})}const DialogVideo=()=>jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("iframe",{title:"Video: Dialogen",src:"https://video.qbrick.com/play2/embed/qbrick-player?accountId=763558&mediaId=9b22ccf2-e8ba-43d2-ad57-1740db0e6b33&configId=qbrick-player&pageStyling=adaptive&autoplay=false&repeat=false&sharing=true&download=false&volume&language=nb",allow:"fullscreen",className:" w-full h-300px mt-4"})}),DialogPanel=()=>{const[T,C]=reactExports.useState(!1);function $(){T||logAccordionAapnet("Dialog med veilederen din"),C(!T)}return jsxRuntimeExports.jsxs(Accordion$1.Item,{children:[jsxRuntimeExports.jsx(Accordion$1.Header,{onClick:$,children:jsxRuntimeExports.jsx(Heading,{level:"2",size:"small",children:"Dialog med veilederen din"})}),jsxRuntimeExports.jsxs(Accordion$1.Content,{children:[jsxRuntimeExports.jsx(BodyShort,{children:"I dialogen kan du og veilederen din skrive til hverandre om arbeid og oppfølging. Dere kan blant annet sende meldinger om aktivitetene dine i aktivitetsplanen."}),jsxRuntimeExports.jsx(DialogVideo,{})]})]})},IntroduksjonVideo=()=>jsxRuntimeExports.jsx("div",{className:"color-black",children:jsxRuntimeExports.jsx("iframe",{title:"Video: Aktivitetsplan - Introduksjon",src:"https://video.qbrick.com/play2/embed/qbrick-player?accountId=763558&mediaId=fb0502e7-2ed9-4f27-a6d5-3a40a68975d2&configId=qbrick-player&pageStyling=adaptive&autoplay=false&repeat=false&sharing=true&download=false&volume&language=nb",allow:"fullscreen",className:"w-full h-300px mt-4 ",id:"introduksjonsvideo"})}),INFORMASJON_MODAL_VERSJON="v1",InformasjonModal=({erBruker:T,underOppfolging:C,lestInfo:$})=>{const V=useNavigate(),{hovedsideRoute:K}=useRoutes(),Y=()=>V(K());return reactExports.useEffect(()=>{T&&C&&(!$||$.verdi!==INFORMASJON_MODAL_VERSJON)&&postLest(INFORMASJON_MODAL_VERSJON)},[]),jsxRuntimeExports.jsx(Modal,{onClose:Y,className:"informasjon-visning",heading:"Hva er aktivitetsplanen?",children:jsxRuntimeExports.jsxs(ModalContainer,{className:"max-w-2xl",children:[jsxRuntimeExports.jsx(BodyShort,{className:"pb-4",children:"I aktivitetsplanen holder du oversikt over det du gjør for å komme i jobb eller annen aktivitet. Både du og veilederen din kan se og endre aktivitetsplanen."}),jsxRuntimeExports.jsxs(BodyShort,{children:["Du kan legge inn målet ditt, aktiviteter du skal gjøre og stillinger du vil søke på. Veilederen kan blant annet legge inn forslag til aktiviteter eller skrive referat fra et møte dere har hatt. Du kan kommunisere med veilederen din om aktivitetene i"," ",jsxRuntimeExports.jsx(Link$1,{href:"https://pto.ekstern.dev.nav.no/arbeid/dialog",children:"dialogen"}),"."]}),jsxRuntimeExports.jsx(IntroduksjonVideo,{}),jsxRuntimeExports.jsxs(Accordion$1,{className:"mt-4",children:[jsxRuntimeExports.jsx(BrukePlanenPanel,{}),jsxRuntimeExports.jsx(DialogPanel,{}),jsxRuntimeExports.jsx(OkonomiskStotte,{}),jsxRuntimeExports.jsx(RettigheterPanel,{})]})]})})};InformasjonModal.defaultProps={lestInfo:null,erBruker:!1,underOppfolging:!1};InformasjonModal.propTypes={erBruker:PropTypes.bool,underOppfolging:PropTypes.bool,lestInfo:lest};const mapStateToProps$2=T=>({lestInfo:selectLestInformasjon(T),erBruker:selectErBruker(T),underOppfolging:selectErUnderOppfolging(T)}),InformasjonModal$1=connect(mapStateToProps$2)(InformasjonModal);let erVist=!1;function InformasjonsHenting(){const T=useSelector(selectErUnderOppfolging,shallowEqual$1),C=useSelector(selectLestStatus,shallowEqual$1),$=useSelector(selectLestInformasjon,shallowEqual$1),V=useSelector(selectErBruker,shallowEqual$1),K=useSelector(selectOppfolgingsPerioder,shallowEqual$1),Y=useAppDispatch();reactExports.useEffect(()=>{fetchHarFlereAktorId(),T&&Y(hentLest()).then(ie=>{isFulfilled(ie)&&loggTidBruktGaaInnPaaAktivitetsplanen(ie.payload,K)})},[]);const{informasjonRoute:J,hovedsideRoute:re}=useRoutes(),{pathname:ne}=useLocation(),te=ne===re();return C===Status.OK&&(!$||$.verdi!==INFORMASJON_MODAL_VERSJON)&&te&&V&&!erVist?(erVist=!0,jsxRuntimeExports.jsx(Navigate,{to:J()})):null}const NotifikasjonMarkering=({visible:T})=>T?jsxRuntimeExports.jsx("div",{className:"w-2.5 m-1",children:jsxRuntimeExports.jsxs("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("title",{children:"Ulest aktivitet"}),jsxRuntimeExports.jsx("circle",{cx:"50",cy:"50",r:"50",fill:"#0067c5"})]})}):null,DndContext=reactExports.createContext({dragDropManager:void 0});function invariant$1(T,C,...$){if(isProduction$1()&&C===void 0)throw new Error("invariant requires an error message argument");if(!T){let V;if(C===void 0)V=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let K=0;V=new Error(C.replace(/%s/g,function(){return $[K++]})),V.name="Invariant Violation"}throw V.framesToPop=1,V}}function isProduction$1(){return typeof process<"u"&&!0}function get$1(T,C,$){return C.split(".").reduce((V,K)=>V&&V[K]?V[K]:$||null,T)}function without$1(T,C){return T.filter($=>$!==C)}function isObject$1(T){return typeof T=="object"}function xor(T,C){const $=new Map,V=Y=>{$.set(Y,$.has(Y)?$.get(Y)+1:1)};T.forEach(V),C.forEach(V);const K=[];return $.forEach((Y,J)=>{Y===1&&K.push(J)}),K}function intersection(T,C){return T.filter($=>C.indexOf($)>-1)}const INIT_COORDS="dnd-core/INIT_COORDS",BEGIN_DRAG="dnd-core/BEGIN_DRAG",PUBLISH_DRAG_SOURCE="dnd-core/PUBLISH_DRAG_SOURCE",HOVER="dnd-core/HOVER",DROP="dnd-core/DROP",END_DRAG="dnd-core/END_DRAG";function setClientOffset(T,C){return{type:INIT_COORDS,payload:{sourceClientOffset:C||null,clientOffset:T||null}}}const ResetCoordinatesAction={type:INIT_COORDS,payload:{clientOffset:null,sourceClientOffset:null}};function createBeginDrag(T){return function($=[],V={publishSource:!0}){const{publishSource:K=!0,clientOffset:Y,getSourceClientOffset:J}=V,re=T.getMonitor(),ne=T.getRegistry();T.dispatch(setClientOffset(Y)),verifyInvariants$1($,re,ne);const te=getDraggableSource($,re);if(te==null){T.dispatch(ResetCoordinatesAction);return}let se=null;if(Y){if(!J)throw new Error("getSourceClientOffset must be defined");verifyGetSourceClientOffsetIsFunction(J),se=J(te)}T.dispatch(setClientOffset(Y,se));const ae=ne.getSource(te).beginDrag(re,te);if(ae==null)return;verifyItemIsObject(ae),ne.pinSource(te);const oe=ne.getSourceType(te);return{type:BEGIN_DRAG,payload:{itemType:oe,item:ae,sourceId:te,clientOffset:Y||null,sourceClientOffset:se||null,isSourcePublic:!!K}}}}function verifyInvariants$1(T,C,$){invariant$1(!C.isDragging(),"Cannot call beginDrag while dragging."),T.forEach(function(V){invariant$1($.getSource(V),"Expected sourceIds to be registered.")})}function verifyGetSourceClientOffsetIsFunction(T){invariant$1(typeof T=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function verifyItemIsObject(T){invariant$1(isObject$1(T),"Item must be an object.")}function getDraggableSource(T,C){let $=null;for(let V=T.length-1;V>=0;V--)if(C.canDragSource(T[V])){$=T[V];break}return $}function _defineProperty$6(T,C,$){return C in T?Object.defineProperty(T,C,{value:$,enumerable:!0,configurable:!0,writable:!0}):T[C]=$,T}function _objectSpread$5(T){for(var C=1;C{const ne=determineDropResult(J,re,K,V),te={type:DROP,payload:{dropResult:_objectSpread$5({},$,ne)}};T.dispatch(te)})}}function verifyInvariants(T){invariant$1(T.isDragging(),"Cannot call drop while not dragging."),invariant$1(!T.didDrop(),"Cannot call drop twice during one drag operation.")}function determineDropResult(T,C,$,V){const K=$.getTarget(T);let Y=K?K.drop(V,T):void 0;return verifyDropResultType(Y),typeof Y>"u"&&(Y=C===0?{}:V.getDropResult()),Y}function verifyDropResultType(T){invariant$1(typeof T>"u"||isObject$1(T),"Drop result must either be an object or undefined.")}function getDroppableTargets(T){const C=T.getTargetIds().filter(T.canDropOnTarget,T);return C.reverse(),C}function createEndDrag(T){return function(){const $=T.getMonitor(),V=T.getRegistry();verifyIsDragging($);const K=$.getSourceId();return K!=null&&(V.getSource(K,!0).endDrag($,K),V.unpinSource()),{type:END_DRAG}}}function verifyIsDragging(T){invariant$1(T.isDragging(),"Cannot call endDrag while not dragging.")}function matchesType(T,C){return C===null?T===null:Array.isArray(T)?T.some($=>$===C):T===C}function createHover(T){return function($,{clientOffset:V}={}){verifyTargetIdsIsArray($);const K=$.slice(0),Y=T.getMonitor(),J=T.getRegistry(),re=Y.getItemType();return removeNonMatchingTargetIds(K,J,re),checkInvariants(K,Y,J),hoverAllTargets(K,Y,J),{type:HOVER,payload:{targetIds:K,clientOffset:V||null}}}}function verifyTargetIdsIsArray(T){invariant$1(Array.isArray(T),"Expected targetIds to be an array.")}function checkInvariants(T,C,$){invariant$1(C.isDragging(),"Cannot call hover while not dragging."),invariant$1(!C.didDrop(),"Cannot call hover after drop.");for(let V=0;V=0;V--){const K=T[V],Y=C.getTargetType(K);matchesType(Y,$)||T.splice(V,1)}}function hoverAllTargets(T,C,$){T.forEach(function(V){$.getTarget(V).hover(C,V)})}function createPublishDragSource(T){return function(){if(T.getMonitor().isDragging())return{type:PUBLISH_DRAG_SOURCE}}}function createDragDropActions(T){return{beginDrag:createBeginDrag(T),publishDragSource:createPublishDragSource(T),hover:createHover(T),drop:createDrop(T),endDrag:createEndDrag(T)}}class DragDropManagerImpl{receiveBackend(C){this.backend=C}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const C=this,{dispatch:$}=this.store;function V(Y){return(...J)=>{const re=Y.apply(C,J);typeof re<"u"&&$(re)}}const K=createDragDropActions(this);return Object.keys(K).reduce((Y,J)=>{const re=K[J];return Y[J]=V(re),Y},{})}dispatch(C){this.store.dispatch(C)}constructor(C,$){this.isSetUp=!1,this.handleRefCountChange=()=>{const V=this.store.getState().refCount>0;this.backend&&(V&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!V&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=C,this.monitor=$,C.subscribe(this.handleRefCountChange)}}function add(T,C){return{x:T.x+C.x,y:T.y+C.y}}function subtract(T,C){return{x:T.x-C.x,y:T.y-C.y}}function getSourceClientOffset(T){const{clientOffset:C,initialClientOffset:$,initialSourceClientOffset:V}=T;return!C||!$||!V?null:subtract(add(C,V),$)}function getDifferenceFromInitialOffset(T){const{clientOffset:C,initialClientOffset:$}=T;return!C||!$?null:subtract(C,$)}const NONE=[],ALL=[];NONE.__IS_NONE__=!0;ALL.__IS_ALL__=!0;function areDirty(T,C){return T===NONE?!1:T===ALL||typeof C>"u"?!0:intersection(C,T).length>0}class DragDropMonitorImpl{subscribeToStateChange(C,$={}){const{handlerIds:V}=$;invariant$1(typeof C=="function","listener must be a function."),invariant$1(typeof V>"u"||Array.isArray(V),"handlerIds, when specified, must be an array of strings.");let K=this.store.getState().stateId;const Y=()=>{const J=this.store.getState(),re=J.stateId;try{re===K||re===K+1&&!areDirty(J.dirtyHandlerIds,V)||C()}finally{K=re}};return this.store.subscribe(Y)}subscribeToOffsetChange(C){invariant$1(typeof C=="function","listener must be a function.");let $=this.store.getState().dragOffset;const V=()=>{const K=this.store.getState().dragOffset;K!==$&&($=K,C())};return this.store.subscribe(V)}canDragSource(C){if(!C)return!1;const $=this.registry.getSource(C);return invariant$1($,`Expected to find a valid source. sourceId=${C}`),this.isDragging()?!1:$.canDrag(this,C)}canDropOnTarget(C){if(!C)return!1;const $=this.registry.getTarget(C);if(invariant$1($,`Expected to find a valid target. targetId=${C}`),!this.isDragging()||this.didDrop())return!1;const V=this.registry.getTargetType(C),K=this.getItemType();return matchesType(V,K)&&$.canDrop(this,C)}isDragging(){return!!this.getItemType()}isDraggingSource(C){if(!C)return!1;const $=this.registry.getSource(C,!0);if(invariant$1($,`Expected to find a valid source. sourceId=${C}`),!this.isDragging()||!this.isSourcePublic())return!1;const V=this.registry.getSourceType(C),K=this.getItemType();return V!==K?!1:$.isDragging(this,C)}isOverTarget(C,$={shallow:!1}){if(!C)return!1;const{shallow:V}=$;if(!this.isDragging())return!1;const K=this.registry.getTargetType(C),Y=this.getItemType();if(Y&&!matchesType(K,Y))return!1;const J=this.getTargetIds();if(!J.length)return!1;const re=J.indexOf(C);return V?re===J.length-1:re>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return getSourceClientOffset(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return getDifferenceFromInitialOffset(this.store.getState().dragOffset)}constructor(C,$){this.store=C,this.registry=$}}const scope=typeof global<"u"?global:self,BrowserMutationObserver=scope.MutationObserver||scope.WebKitMutationObserver;function makeRequestCallFromTimer(T){return function(){const $=setTimeout(K,0),V=setInterval(K,50);function K(){clearTimeout($),clearInterval(V),T()}}}function makeRequestCallFromMutationObserver(T){let C=1;const $=new BrowserMutationObserver(T),V=document.createTextNode("");return $.observe(V,{characterData:!0}),function(){C=-C,V.data=C}}const makeRequestCall=typeof BrowserMutationObserver=="function"?makeRequestCallFromMutationObserver:makeRequestCallFromTimer;class AsapQueue{enqueueTask(C){const{queue:$,requestFlush:V}=this;$.length||(V(),this.flushing=!0),$[$.length]=C}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:C}=this;for(;this.indexthis.capacity){for(let V=0,K=C.length-this.index;V{this.pendingErrors.push(C),this.requestErrorThrow()},this.requestFlush=makeRequestCall(this.flush),this.requestErrorThrow=makeRequestCallFromTimer(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class RawTask{call(){try{this.task&&this.task()}catch(C){this.onError(C)}finally{this.task=null,this.release(this)}}constructor(C,$){this.onError=C,this.release=$,this.task=null}}class TaskFactory{create(C){const $=this.freeTasks,V=$.length?$.pop():new RawTask(this.onError,K=>$[$.length]=K);return V.task=C,V}constructor(C){this.onError=C,this.freeTasks=[]}}const asapQueue=new AsapQueue,taskFactory=new TaskFactory(asapQueue.registerPendingError);function asap(T){asapQueue.enqueueTask(taskFactory.create(T))}const ADD_SOURCE="dnd-core/ADD_SOURCE",ADD_TARGET="dnd-core/ADD_TARGET",REMOVE_SOURCE="dnd-core/REMOVE_SOURCE",REMOVE_TARGET="dnd-core/REMOVE_TARGET";function addSource(T){return{type:ADD_SOURCE,payload:{sourceId:T}}}function addTarget(T){return{type:ADD_TARGET,payload:{targetId:T}}}function removeSource(T){return{type:REMOVE_SOURCE,payload:{sourceId:T}}}function removeTarget(T){return{type:REMOVE_TARGET,payload:{targetId:T}}}function validateSourceContract(T){invariant$1(typeof T.canDrag=="function","Expected canDrag to be a function."),invariant$1(typeof T.beginDrag=="function","Expected beginDrag to be a function."),invariant$1(typeof T.endDrag=="function","Expected endDrag to be a function.")}function validateTargetContract(T){invariant$1(typeof T.canDrop=="function","Expected canDrop to be a function."),invariant$1(typeof T.hover=="function","Expected hover to be a function."),invariant$1(typeof T.drop=="function","Expected beginDrag to be a function.")}function validateType(T,C){if(C&&Array.isArray(T)){T.forEach($=>validateType($,!1));return}invariant$1(typeof T=="string"||typeof T=="symbol",C?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var HandlerRole;(function(T){T.SOURCE="SOURCE",T.TARGET="TARGET"})(HandlerRole||(HandlerRole={}));let nextUniqueId=0;function getNextUniqueId(){return nextUniqueId++}function getNextHandlerId(T){const C=getNextUniqueId().toString();switch(T){case HandlerRole.SOURCE:return`S${C}`;case HandlerRole.TARGET:return`T${C}`;default:throw new Error(`Unknown Handler Role: ${T}`)}}function parseRoleFromHandlerId(T){switch(T[0]){case"S":return HandlerRole.SOURCE;case"T":return HandlerRole.TARGET;default:throw new Error(`Cannot parse handler ID: ${T}`)}}function mapContainsValue(T,C){const $=T.entries();let V=!1;do{const{done:K,value:[,Y]}=$.next();if(Y===C)return!0;V=!!K}while(!V);return!1}class HandlerRegistryImpl{addSource(C,$){validateType(C),validateSourceContract($);const V=this.addHandler(HandlerRole.SOURCE,C,$);return this.store.dispatch(addSource(V)),V}addTarget(C,$){validateType(C,!0),validateTargetContract($);const V=this.addHandler(HandlerRole.TARGET,C,$);return this.store.dispatch(addTarget(V)),V}containsHandler(C){return mapContainsValue(this.dragSources,C)||mapContainsValue(this.dropTargets,C)}getSource(C,$=!1){return invariant$1(this.isSourceId(C),"Expected a valid source ID."),$&&C===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(C)}getTarget(C){return invariant$1(this.isTargetId(C),"Expected a valid target ID."),this.dropTargets.get(C)}getSourceType(C){return invariant$1(this.isSourceId(C),"Expected a valid source ID."),this.types.get(C)}getTargetType(C){return invariant$1(this.isTargetId(C),"Expected a valid target ID."),this.types.get(C)}isSourceId(C){return parseRoleFromHandlerId(C)===HandlerRole.SOURCE}isTargetId(C){return parseRoleFromHandlerId(C)===HandlerRole.TARGET}removeSource(C){invariant$1(this.getSource(C),"Expected an existing source."),this.store.dispatch(removeSource(C)),asap(()=>{this.dragSources.delete(C),this.types.delete(C)})}removeTarget(C){invariant$1(this.getTarget(C),"Expected an existing target."),this.store.dispatch(removeTarget(C)),this.dropTargets.delete(C),this.types.delete(C)}pinSource(C){const $=this.getSource(C);invariant$1($,"Expected an existing source."),this.pinnedSourceId=C,this.pinnedSource=$}unpinSource(){invariant$1(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(C,$,V){const K=getNextHandlerId(C);return this.types.set(K,$),C===HandlerRole.SOURCE?this.dragSources.set(K,V):C===HandlerRole.TARGET&&this.dropTargets.set(K,V),K}constructor(C){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=C}}const strictEquality=(T,C)=>T===C;function areCoordsEqual(T,C){return!T&&!C?!0:!T||!C?!1:T.x===C.x&&T.y===C.y}function areArraysEqual(T,C,$=strictEquality){if(T.length!==C.length)return!1;for(let V=0;V0||!areArraysEqual($,V)))return NONE;const J=V[V.length-1],re=$[$.length-1];return J!==re&&(J&&K.push(J),re&&K.push(re)),K}function _defineProperty$5(T,C,$){return C in T?Object.defineProperty(T,C,{value:$,enumerable:!0,configurable:!0,writable:!0}):T[C]=$,T}function _objectSpread$4(T){for(var C=1;C=0)&&Object.prototype.propertyIsEnumerable.call(T,V)&&($[V]=T[V])}return $}function _objectWithoutPropertiesLoose$1(T,C){if(T==null)return{};var $={},V=Object.keys(T),K,Y;for(Y=0;Y=0)&&($[K]=T[K]);return $}let refCount=0;const INSTANCE_SYM=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var DndProvider=reactExports.memo(function(C){var{children:$}=C,V=_objectWithoutProperties$2(C,["children"]);const[K,Y]=getDndContextValue(V);return reactExports.useEffect(()=>{if(Y){const J=getGlobalContext();return++refCount,()=>{--refCount===0&&(J[INSTANCE_SYM]=null)}}},[]),jsxRuntimeExports.jsx(DndContext.Provider,{value:K,children:$})});function getDndContextValue(T){if("manager"in T)return[{dragDropManager:T.manager},!1];const C=createSingletonDndContext(T.backend,T.context,T.options,T.debugMode),$=!T.context;return[C,$]}function createSingletonDndContext(T,C=getGlobalContext(),$,V){const K=C;return K[INSTANCE_SYM]||(K[INSTANCE_SYM]={dragDropManager:createDragDropManager(T,C,$,V)}),K[INSTANCE_SYM]}function getGlobalContext(){return typeof global<"u"?global:window}var fastDeepEqual=function T(C,$){if(C===$)return!0;if(C&&$&&typeof C=="object"&&typeof $=="object"){if(C.constructor!==$.constructor)return!1;var V,K,Y;if(Array.isArray(C)){if(V=C.length,V!=$.length)return!1;for(K=V;K--!==0;)if(!T(C[K],$[K]))return!1;return!0}if(C.constructor===RegExp)return C.source===$.source&&C.flags===$.flags;if(C.valueOf!==Object.prototype.valueOf)return C.valueOf()===$.valueOf();if(C.toString!==Object.prototype.toString)return C.toString()===$.toString();if(Y=Object.keys(C),V=Y.length,V!==Object.keys($).length)return!1;for(K=V;K--!==0;)if(!Object.prototype.hasOwnProperty.call($,Y[K]))return!1;for(K=V;K--!==0;){var J=Y[K];if(!T(C[J],$[J]))return!1}return!0}return C!==C&&$!==$};const equal=getDefaultExportFromCjs(fastDeepEqual),useIsomorphicLayoutEffect=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function useCollector(T,C,$){const[V,K]=reactExports.useState(()=>C(T)),Y=reactExports.useCallback(()=>{const J=C(T);equal(V,J)||(K(J),$&&$())},[V,T,$]);return useIsomorphicLayoutEffect(Y),[V,Y]}function useMonitorOutput(T,C,$){const[V,K]=useCollector(T,C,$);return useIsomorphicLayoutEffect(function(){const J=T.getHandlerId();if(J!=null)return T.subscribeToStateChange(K,{handlerIds:[J]})},[T,K]),V}function useCollectedProps(T,C,$){return useMonitorOutput(C,T||(()=>({})),()=>$.reconnect())}function useOptionalFactory(T,C){const $=[...C||[]];return C==null&&typeof T!="function"&&$.push(T),reactExports.useMemo(()=>typeof T=="function"?T():T,$)}function useConnectDragSource(T){return reactExports.useMemo(()=>T.hooks.dragSource(),[T])}function useConnectDragPreview(T){return reactExports.useMemo(()=>T.hooks.dragPreview(),[T])}let isCallingCanDrag=!1,isCallingIsDragging=!1;class DragSourceMonitorImpl{receiveHandlerId(C){this.sourceId=C}getHandlerId(){return this.sourceId}canDrag(){invariant$1(!isCallingCanDrag,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return isCallingCanDrag=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{isCallingCanDrag=!1}}isDragging(){if(!this.sourceId)return!1;invariant$1(!isCallingIsDragging,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return isCallingIsDragging=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{isCallingIsDragging=!1}}subscribeToStateChange(C,$){return this.internalMonitor.subscribeToStateChange(C,$)}isDraggingSource(C){return this.internalMonitor.isDraggingSource(C)}isOverTarget(C,$){return this.internalMonitor.isOverTarget(C,$)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(C){return this.internalMonitor.subscribeToOffsetChange(C)}canDragSource(C){return this.internalMonitor.canDragSource(C)}canDropOnTarget(C){return this.internalMonitor.canDropOnTarget(C)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(C){this.sourceId=null,this.internalMonitor=C.getMonitor()}}let isCallingCanDrop=!1;class DropTargetMonitorImpl{receiveHandlerId(C){this.targetId=C}getHandlerId(){return this.targetId}subscribeToStateChange(C,$){return this.internalMonitor.subscribeToStateChange(C,$)}canDrop(){if(!this.targetId)return!1;invariant$1(!isCallingCanDrop,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return isCallingCanDrop=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{isCallingCanDrop=!1}}isOver(C){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,C):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(C){this.targetId=null,this.internalMonitor=C.getMonitor()}}function registerTarget(T,C,$){const V=$.getRegistry(),K=V.addTarget(T,C);return[K,()=>V.removeTarget(K)]}function registerSource(T,C,$){const V=$.getRegistry(),K=V.addSource(T,C);return[K,()=>V.removeSource(K)]}function shallowEqual(T,C,$,V){let K=$?$.call(V,T,C):void 0;if(K!==void 0)return!!K;if(T===C)return!0;if(typeof T!="object"||!T||typeof C!="object"||!C)return!1;const Y=Object.keys(T),J=Object.keys(C);if(Y.length!==J.length)return!1;const re=Object.prototype.hasOwnProperty.bind(C);for(let ne=0;ne, or turn it into a drag source or a drop target itself.`)}function wrapHookToRecognizeElement(T){return(C=null,$=null)=>{if(!reactExports.isValidElement(C)){const Y=C;return T(Y,$),Y}const V=C;return throwIfCompositeComponentElement(V),cloneWithRef(V,$?Y=>T(Y,$):T)}}function wrapConnectorHooks(T){const C={};return Object.keys(T).forEach($=>{const V=T[$];if($.endsWith("Ref"))C[$]=T[$];else{const K=wrapHookToRecognizeElement(V);C[$]=()=>K}}),C}function setRef(T,C){typeof T=="function"?T(C):T.current=C}function cloneWithRef(T,C){const $=T.ref;return invariant$1(typeof $!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or . Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),$?reactExports.cloneElement(T,{ref:V=>{setRef($,V),setRef(C,V)}}):reactExports.cloneElement(T,{ref:C})}class SourceConnector{receiveHandlerId(C){this.handlerId!==C&&(this.handlerId=C,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(C){this.dragSourceOptionsInternal=C}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(C){this.dragPreviewOptionsInternal=C}reconnect(){const C=this.reconnectDragSource();this.reconnectDragPreview(C)}reconnectDragSource(){const C=this.dragSource,$=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return $&&this.disconnectDragSource(),this.handlerId?C?($&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=C,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,C,this.dragSourceOptions)),$):(this.lastConnectedDragSource=C,$):$}reconnectDragPreview(C=!1){const $=this.dragPreview,V=C||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(V&&this.disconnectDragPreview(),!!this.handlerId){if(!$){this.lastConnectedDragPreview=$;return}V&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=$,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,$,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!shallowEqual(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!shallowEqual(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(C){this.hooks=wrapConnectorHooks({dragSource:($,V)=>{this.clearDragSource(),this.dragSourceOptions=V||null,isRef$1($)?this.dragSourceRef=$:this.dragSourceNode=$,this.reconnectDragSource()},dragPreview:($,V)=>{this.clearDragPreview(),this.dragPreviewOptions=V||null,isRef$1($)?this.dragPreviewRef=$:this.dragPreviewNode=$,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=C}}class TargetConnector{get connectTarget(){return this.dropTarget}reconnect(){const C=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();C&&this.disconnectDropTarget();const $=this.dropTarget;if(this.handlerId){if(!$){this.lastConnectedDropTarget=$;return}C&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=$,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,$,this.dropTargetOptions))}}receiveHandlerId(C){C!==this.handlerId&&(this.handlerId=C,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(C){this.dropTargetOptionsInternal=C}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!shallowEqual(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(C){this.hooks=wrapConnectorHooks({dropTarget:($,V)=>{this.clearDropTarget(),this.dropTargetOptions=V,isRef$1($)?this.dropTargetRef=$:this.dropTargetNode=$,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=C}}function useDragDropManager(){const{dragDropManager:T}=reactExports.useContext(DndContext);return invariant$1(T!=null,"Expected drag drop context"),T}function useDragSourceConnector(T,C){const $=useDragDropManager(),V=reactExports.useMemo(()=>new SourceConnector($.getBackend()),[$]);return useIsomorphicLayoutEffect(()=>(V.dragSourceOptions=T||null,V.reconnect(),()=>V.disconnectDragSource()),[V,T]),useIsomorphicLayoutEffect(()=>(V.dragPreviewOptions=C||null,V.reconnect(),()=>V.disconnectDragPreview()),[V,C]),V}function useDragSourceMonitor(){const T=useDragDropManager();return reactExports.useMemo(()=>new DragSourceMonitorImpl(T),[T])}class DragSourceImpl{beginDrag(){const C=this.spec,$=this.monitor;let V=null;return typeof C.item=="object"?V=C.item:typeof C.item=="function"?V=C.item($):V={},V??null}canDrag(){const C=this.spec,$=this.monitor;return typeof C.canDrag=="boolean"?C.canDrag:typeof C.canDrag=="function"?C.canDrag($):!0}isDragging(C,$){const V=this.spec,K=this.monitor,{isDragging:Y}=V;return Y?Y(K):$===C.getSourceId()}endDrag(){const C=this.spec,$=this.monitor,V=this.connector,{end:K}=C;K&&K($.getItem(),$),V.reconnect()}constructor(C,$,V){this.spec=C,this.monitor=$,this.connector=V}}function useDragSource(T,C,$){const V=reactExports.useMemo(()=>new DragSourceImpl(T,C,$),[C,$]);return reactExports.useEffect(()=>{V.spec=T},[T]),V}function useDragType(T){return reactExports.useMemo(()=>{const C=T.type;return invariant$1(C!=null,"spec.type must be defined"),C},[T])}function useRegisteredDragSource(T,C,$){const V=useDragDropManager(),K=useDragSource(T,C,$),Y=useDragType(T);useIsomorphicLayoutEffect(function(){if(Y!=null){const[re,ne]=registerSource(Y,K,V);return C.receiveHandlerId(re),$.receiveHandlerId(re),ne}},[V,C,$,K,Y])}function useDrag(T,C){const $=useOptionalFactory(T,C);invariant$1(!$.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const V=useDragSourceMonitor(),K=useDragSourceConnector($.options,$.previewOptions);return useRegisteredDragSource($,V,K),[useCollectedProps($.collect,V,K),useConnectDragSource(K),useConnectDragPreview(K)]}function useConnectDropTarget(T){return reactExports.useMemo(()=>T.hooks.dropTarget(),[T])}function useDropTargetConnector(T){const C=useDragDropManager(),$=reactExports.useMemo(()=>new TargetConnector(C.getBackend()),[C]);return useIsomorphicLayoutEffect(()=>($.dropTargetOptions=T||null,$.reconnect(),()=>$.disconnectDropTarget()),[T]),$}function useDropTargetMonitor(){const T=useDragDropManager();return reactExports.useMemo(()=>new DropTargetMonitorImpl(T),[T])}function useAccept(T){const{accept:C}=T;return reactExports.useMemo(()=>(invariant$1(T.accept!=null,"accept must be defined"),Array.isArray(C)?C:[C]),[C])}class DropTargetImpl{canDrop(){const C=this.spec,$=this.monitor;return C.canDrop?C.canDrop($.getItem(),$):!0}hover(){const C=this.spec,$=this.monitor;C.hover&&C.hover($.getItem(),$)}drop(){const C=this.spec,$=this.monitor;if(C.drop)return C.drop($.getItem(),$)}constructor(C,$){this.spec=C,this.monitor=$}}function useDropTarget(T,C){const $=reactExports.useMemo(()=>new DropTargetImpl(T,C),[C]);return reactExports.useEffect(()=>{$.spec=T},[T]),$}function useRegisteredDropTarget(T,C,$){const V=useDragDropManager(),K=useDropTarget(T,C),Y=useAccept(T);useIsomorphicLayoutEffect(function(){const[re,ne]=registerTarget(Y,K,V);return C.receiveHandlerId(re),$.receiveHandlerId(re),ne},[V,C,K,$,Y.map(J=>J.toString()).join("|")])}function useDrop(T,C){const $=useOptionalFactory(T,C),V=useDropTargetMonitor(),K=useDropTargetConnector($.options);return useRegisteredDropTarget($,V,K),[useCollectedProps($.collect,V,K),useConnectDropTarget(K)]}function memoize(T){let C=null;return()=>(C==null&&(C=T()),C)}function without(T,C){return T.filter($=>$!==C)}function union(T,C){const $=new Set,V=Y=>$.add(Y);T.forEach(V),C.forEach(V);const K=[];return $.forEach(Y=>K.push(Y)),K}class EnterLeaveCounter{enter(C){const $=this.entered.length,V=K=>this.isNodeInDocument(K)&&(!K.contains||K.contains(C));return this.entered=union(this.entered.filter(V),[C]),$===0&&this.entered.length>0}leave(C){const $=this.entered.length;return this.entered=without(this.entered.filter(this.isNodeInDocument),C),$>0&&this.entered.length===0}reset(){this.entered=[]}constructor(C){this.entered=[],this.isNodeInDocument=C}}class NativeDragSource{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(C=>{Object.defineProperty(this.item,C,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${C}" until the drop event.`),null}})})}loadDataTransfer(C){if(C){const $={};Object.keys(this.config.exposeProperties).forEach(V=>{const K=this.config.exposeProperties[V];K!=null&&($[V]={value:K(C,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,$)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(C,$){return $===C.getSourceId()}endDrag(){}constructor(C){this.config=C,this.item={},this.initializeExposedProperties()}}const FILE="__NATIVE_FILE__",URL$1="__NATIVE_URL__",TEXT="__NATIVE_TEXT__",HTML="__NATIVE_HTML__",NativeTypes=Object.freeze(Object.defineProperty({__proto__:null,FILE,HTML,TEXT,URL:URL$1},Symbol.toStringTag,{value:"Module"}));function getDataFromDataTransfer(T,C,$){const V=C.reduce((K,Y)=>K||T.getData(Y),"");return V??$}const nativeTypesConfig={[FILE]:{exposeProperties:{files:T=>Array.prototype.slice.call(T.files),items:T=>T.items,dataTransfer:T=>T},matchesTypes:["Files"]},[HTML]:{exposeProperties:{html:(T,C)=>getDataFromDataTransfer(T,C,""),dataTransfer:T=>T},matchesTypes:["Html","text/html"]},[URL$1]:{exposeProperties:{urls:(T,C)=>getDataFromDataTransfer(T,C,"").split(`
+`),dataTransfer:T=>T},matchesTypes:["Url","text/uri-list"]},[TEXT]:{exposeProperties:{text:(T,C)=>getDataFromDataTransfer(T,C,""),dataTransfer:T=>T},matchesTypes:["Text","text/plain"]}};function createNativeDragSource(T,C){const $=nativeTypesConfig[T];if(!$)throw new Error(`native type ${T} has no configuration`);const V=new NativeDragSource($);return V.loadDataTransfer(C),V}function matchNativeItemType(T){if(!T)return null;const C=Array.prototype.slice.call(T.types||[]);return Object.keys(nativeTypesConfig).filter($=>{const V=nativeTypesConfig[$];return V!=null&&V.matchesTypes?V.matchesTypes.some(K=>C.indexOf(K)>-1):!1})[0]||null}const isFirefox=memoize(()=>/firefox/i.test(navigator.userAgent)),isSafari=memoize(()=>!!window.safari);class MonotonicInterpolant{interpolate(C){const{xs:$,ys:V,c1s:K,c2s:Y,c3s:J}=this;let re=$.length-1;if(C===$[re])return V[re];let ne=0,te=J.length-1,se;for(;ne<=te;){se=Math.floor(.5*(ne+te));const oe=$[se];if(oe
C)te=se-1;else return V[se]}re=Math.max(0,te);const ie=C-$[re],ae=ie*ie;return V[re]+K[re]*ie+Y[re]*ae+J[re]*ie*ae}constructor(C,$){const{length:V}=C,K=[];for(let oe=0;oeC[oe]{let Te=new MonotonicInterpolant([0,.5,1],[ne.y,ne.y/se*le,ne.y+le-se]).interpolate(ae);return isSafari()&&Y&&(Te+=(window.devicePixelRatio-1)*le),Te},de=()=>new MonotonicInterpolant([0,.5,1],[ne.x,ne.x/te*oe,ne.x+oe-te]).interpolate(ie),{offsetX:he,offsetY:me}=K,ge=he===0||he,ye=me===0||me;return{x:ge?he:de(),y:ye?me:ce()}}class OptionsReader{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var C;return!((C=this.globalContext)===null||C===void 0)&&C.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var C;return((C=this.optionsArgs)===null||C===void 0?void 0:C.rootElement)||this.window}constructor(C,$){this.ownerDocument=null,this.globalContext=C,this.optionsArgs=$}}function _defineProperty$2(T,C,$){return C in T?Object.defineProperty(T,C,{value:$,enumerable:!0,configurable:!0,writable:!0}):T[C]=$,T}function _objectSpread$1(T){for(var C=1;C{this.sourcePreviewNodes.delete(C),this.sourcePreviewNodeOptions.delete(C)}}connectDragSource(C,$,V){this.sourceNodes.set(C,$),this.sourceNodeOptions.set(C,V);const K=J=>this.handleDragStart(J,C),Y=J=>this.handleSelectStart(J);return $.setAttribute("draggable","true"),$.addEventListener("dragstart",K),$.addEventListener("selectstart",Y),()=>{this.sourceNodes.delete(C),this.sourceNodeOptions.delete(C),$.removeEventListener("dragstart",K),$.removeEventListener("selectstart",Y),$.setAttribute("draggable","false")}}connectDropTarget(C,$){const V=J=>this.handleDragEnter(J,C),K=J=>this.handleDragOver(J,C),Y=J=>this.handleDrop(J,C);return $.addEventListener("dragenter",V),$.addEventListener("dragover",K),$.addEventListener("drop",Y),()=>{$.removeEventListener("dragenter",V),$.removeEventListener("dragover",K),$.removeEventListener("drop",Y)}}addEventListeners(C){C.addEventListener&&(C.addEventListener("dragstart",this.handleTopDragStart),C.addEventListener("dragstart",this.handleTopDragStartCapture,!0),C.addEventListener("dragend",this.handleTopDragEndCapture,!0),C.addEventListener("dragenter",this.handleTopDragEnter),C.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),C.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),C.addEventListener("dragover",this.handleTopDragOver),C.addEventListener("dragover",this.handleTopDragOverCapture,!0),C.addEventListener("drop",this.handleTopDrop),C.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(C){C.removeEventListener&&(C.removeEventListener("dragstart",this.handleTopDragStart),C.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),C.removeEventListener("dragend",this.handleTopDragEndCapture,!0),C.removeEventListener("dragenter",this.handleTopDragEnter),C.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),C.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),C.removeEventListener("dragover",this.handleTopDragOver),C.removeEventListener("dragover",this.handleTopDragOverCapture,!0),C.removeEventListener("drop",this.handleTopDrop),C.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const C=this.monitor.getSourceId(),$=this.sourceNodeOptions.get(C);return _objectSpread$1({dropEffect:this.altKeyPressed?"copy":"move"},$||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const C=this.monitor.getSourceId(),$=this.sourcePreviewNodeOptions.get(C);return _objectSpread$1({anchorX:.5,anchorY:.5,captureDraggingState:!1},$||{})}isDraggingNativeItem(){const C=this.monitor.getItemType();return Object.keys(NativeTypes).some($=>NativeTypes[$]===C)}beginDragNativeItem(C,$){this.clearCurrentDragSourceNode(),this.currentNativeSource=createNativeDragSource(C,$),this.currentNativeHandle=this.registry.addSource(C,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(C){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=C;const $=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var V;return(V=this.rootElement)===null||V===void 0?void 0:V.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},$)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var C;(C=this.window)===null||C===void 0||C.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(C,$){C.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift($))}handleDragEnter(C,$){this.dragEnterTargetIds.unshift($)}handleDragOver(C,$){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift($)}handleDrop(C,$){this.dropTargetIds.unshift($)}constructor(C,$,V){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=K=>{const Y=this.sourceNodes.get(K);return Y&&getNodeClientOffset(Y)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=K=>!!(K&&this.document&&this.document.body&&this.document.body.contains(K)),this.endDragIfSourceWasRemovedFromDOM=()=>{const K=this.currentDragSourceNode;K==null||this.isNodeInDocument(K)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=K=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(K||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=K=>{if(K.defaultPrevented)return;const{dragStartSourceIds:Y}=this;this.dragStartSourceIds=null;const J=getEventClientOffset(K);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(Y||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:J});const{dataTransfer:re}=K,ne=matchNativeItemType(re);if(this.monitor.isDragging()){if(re&&typeof re.setDragImage=="function"){const se=this.monitor.getSourceId(),ie=this.sourceNodes.get(se),ae=this.sourcePreviewNodes.get(se)||ie;if(ae){const{anchorX:oe,anchorY:le,offsetX:ce,offsetY:de}=this.getCurrentSourcePreviewNodeOptions(),ge=getDragPreviewOffset(ie,ae,J,{anchorX:oe,anchorY:le},{offsetX:ce,offsetY:de});re.setDragImage(ae,ge.x,ge.y)}}try{re==null||re.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(K.target);const{captureDraggingState:te}=this.getCurrentSourcePreviewNodeOptions();te?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(ne)this.beginDragNativeItem(ne);else{if(re&&!re.types&&(K.target&&!K.target.hasAttribute||!K.target.hasAttribute("draggable")))return;K.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=K=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var Y;(Y=this.currentNativeSource)===null||Y===void 0||Y.loadDataTransfer(K.dataTransfer)}if(!this.enterLeaveCounter.enter(K.target)||this.monitor.isDragging())return;const{dataTransfer:re}=K,ne=matchNativeItemType(re);ne&&this.beginDragNativeItem(ne,re)},this.handleTopDragEnter=K=>{const{dragEnterTargetIds:Y}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=K.altKey,Y.length>0&&this.actions.hover(Y,{clientOffset:getEventClientOffset(K)}),Y.some(re=>this.monitor.canDropOnTarget(re))&&(K.preventDefault(),K.dataTransfer&&(K.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=K=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var Y;(Y=this.currentNativeSource)===null||Y===void 0||Y.loadDataTransfer(K.dataTransfer)}},this.handleTopDragOver=K=>{const{dragOverTargetIds:Y}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){K.preventDefault(),K.dataTransfer&&(K.dataTransfer.dropEffect="none");return}this.altKeyPressed=K.altKey,this.lastClientOffset=getEventClientOffset(K),this.scheduleHover(Y),(Y||[]).some(re=>this.monitor.canDropOnTarget(re))?(K.preventDefault(),K.dataTransfer&&(K.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?K.preventDefault():(K.preventDefault(),K.dataTransfer&&(K.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=K=>{this.isDraggingNativeItem()&&K.preventDefault(),this.enterLeaveCounter.leave(K.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=K=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var Y;K.preventDefault(),(Y=this.currentNativeSource)===null||Y===void 0||Y.loadDataTransfer(K.dataTransfer)}else matchNativeItemType(K.dataTransfer)&&K.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=K=>{const{dropTargetIds:Y}=this;this.dropTargetIds=[],this.actions.hover(Y,{clientOffset:getEventClientOffset(K)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=K=>{const Y=K.target;typeof Y.dragDrop=="function"&&(Y.tagName==="INPUT"||Y.tagName==="SELECT"||Y.tagName==="TEXTAREA"||Y.isContentEditable||(K.preventDefault(),Y.dragDrop()))},this.options=new OptionsReader($,V),this.actions=C.getActions(),this.monitor=C.getMonitor(),this.registry=C.getRegistry(),this.enterLeaveCounter=new EnterLeaveCounter(this.isNodeInDocument)}}const HTML5Backend=function(C,$,V){return new HTML5BackendImpl(C,$,V)},FeatureToggle=({children:T})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:T}),initialState$4={dragging:!1,aktivitet:void 0},aktivitetsviewSlice$1=createSlice({name:"drag",initialState:initialState$4,reducers:{startDragging:(T,C)=>{T.dragging=!0,T.aktivitet=C.payload},stopDragging:T=>{T.dragging=!1,T.aktivitet=void 0}}}),selectDragAndDropSlice=T=>T.view.dragAndDrop,selectDraggingAktivitet=T=>selectDragAndDropSlice(T).aktivitet,{startDragging,stopDragging}=aktivitetsviewSlice$1.actions,dragAndDropSlice=aktivitetsviewSlice$1.reducer,initialState$3={data:{perioder:[]},status:Status.NOT_STARTED};function nyStateMedOppdatertAktivitet(T,C){return{...T,data:{perioder:T.data.perioder.map($=>({...$,aktiviteter:$.aktiviteter.map(V=>V.id===C.id?C:V)}))}}}const aktivitetSlice=createSlice({name:"aktivitet",initialState:initialState$3,reducers:{},extraReducers:T=>{T.addCase(hentAktiviteter.fulfilled,(C,$)=>{C.status=Status.OK,C.data=$.payload.data}),T.addCase(hentAktivitet.fulfilled,(C,$)=>({...nyStateMedOppdatertAktivitet(C,$.payload),status:Status.OK})),T.addCase(lagNyAktivitet.fulfilled,(C,$)=>{windowEvent(UpdateTypes.Aktivitet);const V=$.payload.oppfolgingsperiodeId,K=Y=>Y!=null&&Y.length?Y:[{id:V,aktiviteter:[]}];return{status:Status.OK,data:{perioder:K(C.data.perioder).map(Y=>({...Y,aktiviteter:Y.id===$.payload.oppfolgingsperiodeId?[...Y.aktiviteter,$.payload]:Y.aktiviteter}))}}}),T.addCase(markerForhaandsorienteringSomLest.fulfilled,(C,$)=>(windowEvent(UpdateTypes.Aktivitet),nyStateMedOppdatertAktivitet(C,$.payload))),T.addCase(settAktivitetTilAvtalt.fulfilled,(C,$)=>(windowEvent(UpdateTypes.Aktivitet),nyStateMedOppdatertAktivitet(C,$.payload))),T.addMatcher(isAnyOf(oppdaterCVSvar.fulfilled,oppdaterAktivitetEtikett.fulfilled,oppdaterStillingFraNavSoknadsstatus.fulfilled),(C,$)=>nyStateMedOppdatertAktivitet(C,$.payload)),T.addMatcher(isAnyOf(flyttAktivitet.fulfilled,oppdaterReferat.fulfilled,publiserReferat.fulfilled),(C,$)=>(windowEvent(UpdateTypes.Aktivitet),nyStateMedOppdatertAktivitet(C,$.payload))),T.addMatcher(isAnyOf(hentAktiviteter.rejected,hentAktivitet.rejected),C=>{C.status=Status.ERROR})}}),aktiviteterReducer=aktivitetSlice.reducer,initialState$2={data:[],status:Status.NOT_STARTED},aktivitetVersjonerSlice=createSlice({name:"versjoner",initialState:initialState$2,reducers:{fjernVersjoner:()=>initialState$2},extraReducers:T=>{T.addCase(hentVersjonerForAktivitet.pending,C=>{C.status=C.status===Status.NOT_STARTED?Status.PENDING:Status.RELOADING}),T.addCase(hentVersjonerForAktivitet.fulfilled,(C,$)=>{C.data=$.payload,C.status=Status.OK}),T.addCase(hentVersjonerForAktivitet.rejected,C=>{C.status=Status.ERROR}),T.addMatcher(isAnyOf(oppdaterAktivitetEtikett.fulfilled,oppdaterAktivitet.fulfilled,oppdaterStillingFraNavSoknadsstatus.fulfilled,oppdaterReferat.fulfilled,publiserReferat.fulfilled,markerForhaandsorienteringSomLest.fulfilled,settAktivitetTilAvtalt.fulfilled,flyttAktivitet.fulfilled),(C,$)=>C.status===Status.NOT_STARTED?C:{...C,data:[$.payload,...C.data]})}}),hentVersjonerForAktivitet=createAsyncThunk(`${aktivitetVersjonerSlice.name}/fetchVersjonerForAktivitet`,async T=>await hentVersjonerTilAktivitet(T)),{fjernVersjoner}=aktivitetVersjonerSlice.actions,versjonReducer=aktivitetVersjonerSlice.reducer,initialState$1={data:[]},aktivitetsviewSlice=createSlice({name:"aktivitetsview",initialState:initialState$1,reducers:{settAktivitetSomVist:(T,C)=>{T.data=[...T.data,C.payload]}}}),{settAktivitetSomVist}=aktivitetsviewSlice.actions,aktivitetViewReducer=aktivitetsviewSlice.reducer,ALL_TOGGLES=[],toggles=ALL_TOGGLES.map(T=>"feature="+T).join("&");function hentFeatures(){return fetchToJson(`${AKTIVITET_BASE_URL}/feature?${toggles}`)}const initialFeatures={},featureSlice=createGenericSlice({name:"feature",initialState:{data:initialFeatures,status:Status.NOT_STARTED},reducers:{}});createAsyncThunk(`${featureSlice.name}/fetchFeatures`,async()=>await hentFeatures());const featureReducer=featureSlice.reducer,dismissableErrors=[flyttAktivitet.rejected.type,lagNyAktivitet.rejected.type,oppdaterAktivitet.rejected.type,oppdaterAktivitetEtikett.rejected.type,oppdaterStillingFraNavSoknadsstatus.rejected.type,settAktivitetTilAvtalt.rejected.type,oppdaterReferat.rejected.type,publiserReferat.rejected.type,oppdaterCVSvar.rejected.type,markerForhaandsorienteringSomLest.rejected.type,oppdaterMal.rejected.type],errorSlice=createSlice({name:"feil",initialState:{},reducers:{fjernDismissableErrors:T=>{dismissableErrors.forEach(C=>{delete T[C]})}},extraReducers:T=>{T.addMatcher(C=>isAsyncThunkAction(C)&&isRejected(C),(C,$)=>{C[$.type]={...$.error,type:$.type}}),T.addMatcher(isAnyOf(isFulfilled,isPending),(C,$)=>{const V=$.type.replace("pending","rejected").replace("fulfilled","rejected");delete C[V]})}}),{fjernDismissableErrors}=errorSlice.actions,errorReducer=errorSlice.reducer,initialState={aktivitetTyper:{ARENA_TILTAK:!1,BEHANDLING:!1,EGEN:!1,GRUPPEAKTIVITET:!1,IJOBB:!1,MIDLERTIDIG_LONNSTILSKUDD:!1,MOTE:!1,SAMTALEREFERAT:!1,SOKEAVTALE:!1,STILLING:!1,STILLING_FRA_NAV:!1,TILTAKSAKTIVITET:!1,UTDANNINGSAKTIVITET:!1,VARIG_LONNSTILSKUDD:!1},aktivitetEtiketter:{AVSLAG:!1,CV_DELT:!1,IKKE_FATT_JOBBEN:!1,INGEN_VALGT:!1,INNKALT_TIL_INTERVJU:!1,JOBBTILBUD:!1,SKAL_PAA_INTERVJU:!1,SOKNAD_SENDT:!1,VENTER:!1},arenaAktivitetEtiketter:{AKTUELL:!1,AVSLAG:!1,IKKAKTUELL:!1,IKKEM:!1,INFOMOETE:!1,JATAKK:!1,NEITAKK:!1,TILBUD:!1,VENTELISTE:!1},aktivitetAvtaltMedNav:{AVTALT_MED_NAV:!1,IKKE_AVTALT_MED_NAV:!1},historiskPeriode:null},filterSlice=createSlice({name:"filter",initialState,reducers:{toggleAktivitetsType:(T,C)=>{T.aktivitetTyper[C.payload]=!T.aktivitetTyper[C.payload]},toggleAktivitetsEtikett:(T,C)=>{T.aktivitetEtiketter[C.payload]=!T.aktivitetEtiketter[C.payload]},toggleArenaAktivitetsEtikett:(T,C)=>{T.arenaAktivitetEtiketter[C.payload]=!T.arenaAktivitetEtiketter[C.payload]},velgHistoriskPeriode:(T,C)=>{T.historiskPeriode=C.payload},toggleAktivitetAvtaltMedNav:(T,C)=>{T.aktivitetAvtaltMedNav[C.payload]=!T.aktivitetAvtaltMedNav[C.payload]}}}),{toggleAktivitetsEtikett,toggleArenaAktivitetsEtikett,toggleAktivitetsType,toggleAktivitetAvtaltMedNav,velgHistoriskPeriode}=filterSlice.actions,filterReducer=filterSlice.reducer,hentMalverkMedType$1=T=>postAsJson(`${MALVERK_BASE_URL}/mal`,{type:T}),malverkSlice=createSlice({name:"malverk",initialState:{malverker:[],valgtMalverk:{},status:Status.NOT_STARTED},reducers:{settValgtMalverk:(T,C)=>{T.valgtMalverk=C.payload},slettValgtMalverk:T=>{T.valgtMalverk={}}},extraReducers:T=>{T.addCase(hentMalverkMedType.pending,C=>{C.status=C.status===Status.NOT_STARTED?Status.PENDING:Status.RELOADING}),T.addCase(hentMalverkMedType.fulfilled,(C,$)=>{C.malverker=$.payload,C.status=Status.OK}),T.addCase(hentMalverkMedType.rejected,C=>{C.status=Status.ERROR})}}),hentMalverkMedType=createAsyncThunk(`${malverkSlice.name}/fetchMalverkMedType`,async T=>await hentMalverkMedType$1(T)),{settValgtMalverk,slettValgtMalverk}=malverkSlice.actions,malverkReducer=malverkSlice.reducer,eskaleringsvarselSlice=createGenericSlice({name:"eskaleringsvarsel",reducers:{}}),hentEskaleringsvarsel=createAsyncThunk(`${eskaleringsvarselSlice.name}/fetchEskaleringsvarsel`,async()=>await fetchEskaleringsvarsel()),eskaleringsvarselReducer=eskaleringsvarselSlice.reducer,fetchVeilederInfo=()=>fetchToJson(`${VEILEDER_BASE_URL}/veileder/me`),veilederSlice=createGenericSlice({name:"veileder",reducers:{}}),hentVeilederInfo=createAsyncThunk(`${veilederSlice.name}/fetchVeilederInfo`,async()=>await fetchVeilederInfo()),veilederReducer=veilederSlice.reducer,arkivSlice=createSlice({name:"arkiv",initialState:{forhaandsvisningStatus:Status.NOT_STARTED},reducers:{settOppfølgingsperiodeIdForArkivering:(T,C)=>{T.oppfølgingsperiodeIdForArkivering=C.payload}},extraReducers:T=>{T.addCase(hentPdfTilForhaandsvisning.pending,C=>{C.forhaandsvisningStatus=C.forhaandsvisningStatus===Status.NOT_STARTED?Status.PENDING:Status.RELOADING,C.journalføringStatus=Status.NOT_STARTED}),T.addCase(hentPdfTilForhaandsvisning.fulfilled,(C,$)=>{C.forhaandsvisning=$.payload,C.forhaandsvisningStatus=Status.OK}),T.addCase(hentPdfTilForhaandsvisning.rejected,C=>{C.forhaandsvisningStatus=Status.ERROR}),T.addCase(journalfør.rejected,C=>{C.journalføringStatus=Status.ERROR}),T.addCase(journalfør.fulfilled,(C,$)=>{C.forhaandsvisning&&(C.forhaandsvisning.sistJournalført=$.payload.sistJournalført),C.journalføringStatus=Status.OK})}}),journalfør=createAsyncThunk(`${arkivSlice.name}/journalfoering`,async({forhaandsvisningOpprettet:T},C)=>{var K;const V=(K=C.getState().data.arkiv)==null?void 0:K.oppfølgingsperiodeIdForArkivering;if(V)return await journalfoerAktivitetsplanOgDialog(V,T)});function selectJournalføringstatus(T){return T.data.arkiv.journalføringStatus}const hentPdfTilForhaandsvisning=createAsyncThunk(`${arkivSlice.name}/forhaandsvisning`,async(T,C)=>{var K;const V=(K=C.getState().data.arkiv)==null?void 0:K.oppfølgingsperiodeIdForArkivering;if(V)return await genererPdfTilForhaandsvisning(V)});function selectForhaandsvisningStatus(T){return T.data.arkiv.forhaandsvisningStatus}function selectPdf(T){var C,$;return($=(C=T.data.arkiv)==null?void 0:C.forhaandsvisning)==null?void 0:$.pdf}function selectForhaandsvisningOpprettet(T){var C,$;return($=(C=T.data.arkiv)==null?void 0:C.forhaandsvisning)==null?void 0:$.forhaandsvisningOpprettet}function selectSistJournalfort(T){var C,$;return($=(C=T.data.arkiv)==null?void 0:C.forhaandsvisning)==null?void 0:$.sistJournalført}const arkivReducer=arkivSlice.reducer,{settOppfølgingsperiodeIdForArkivering}=arkivSlice.actions,reducer$1={data:combineReducers({aktiviteter:aktiviteterReducer,arenaAktiviteter:arenaAktiviteterReducer,dialog:dialogReducer,filter:filterReducer,identitet:identitetReducer,mal:malReducer,malListe:malListeReducer,oppfolging:oppfolgingReducer,tilgang:tilgangReducer,versjoner:versjonReducer,malverk:malverkReducer,arkiv:arkivReducer,lest:lestReducer,auth:authReducer,veileder:veilederReducer,eskaleringsvarsel:eskaleringsvarselReducer,feature:featureReducer,errors:errorReducer}),view:combineReducers({visteAktiviteterMedEndringer:aktivitetViewReducer,dragAndDrop:dragAndDropSlice})};let store=null;const createStore=(T=void 0)=>{const C=configureStore({reducer:reducer$1,preloadedState:T});return store=C,C},key="aktivitetsplan-state",getPreloadedStateFromSessionStorage=T=>{var $,V;if(!T)return;const C=sessionStorage.getItem(key);if(C)try{const K=JSON.parse(C);if(T===((V=($=K.data.oppfolging)==null?void 0:$.data)==null?void 0:V.fnr))return JSON.parse(C);sessionStorage.removeItem(key);return}catch(K){console.warn(K);return}},saveReduxStateToSessionStorage=()=>{const T=store==null?void 0:store.getState();sessionStorage.setItem(key,JSON.stringify(T))},clearReduxCache=()=>sessionStorage.removeItem(key),ErVeilederContext=React.createContext(!1),useErVeileder=()=>reactExports.useContext(ErVeilederContext),FnrContext=React.createContext(void 0),useFnr=()=>reactExports.useContext(FnrContext),noOp=T=>{},Provider=({children:T,setFnrRef:C,fnr:$,preloadedState:V})=>{const[K,Y]=reactExports.useState($);reactExports.useEffect(()=>(C&&C(Y),()=>{C&&C(noOp)}),[]);const J=reactExports.useMemo(()=>createStore(V),[K]);return jsxRuntimeExports.jsx(FnrContext.Provider,{value:K,children:jsxRuntimeExports.jsx(ErVeilederContext.Provider,{value:ER_INTERN_FLATE,children:jsxRuntimeExports.jsx(Provider$1,{store:J,children:jsxRuntimeExports.jsx(DndProvider,{backend:HTML5Backend,children:jsxRuntimeExports.jsx(FeatureToggle,{children:T})})})})})},linkRegex=/((?:[\w-]+:\/\/?|www(?:-\w+)?\.)[^\s()<>]+)/g,CustomBodyLong=T=>{const{children:C,className:$,size:V="medium",formatLinks:K=!1,formatLinebreaks:Y=!1}=T;if(!C)return null;let J=[C];K&&(J=J.flatMap(ne=>typeof ne=="string"?replaceMatchesWithNode(ne,linkRegex,(te,se)=>{const ie=te.toLowerCase().startsWith("www.")?`https://${te}`:te;return jsxRuntimeExports.jsx(Link$1,{target:"_blank",href:ie,children:`${te} (åpnes i ny fane)`},`link-${se}`)}):ne));const re=classNames($,Y&&"whitespace-pre-wrap");return jsxRuntimeExports.jsx(BodyLong$1,{className:re,size:V,children:J})},replaceMatchesWithNode=(T,C,$)=>{const V=T.match(C),K=T.split(C);return V!==null?K.map((Y,J)=>V.includes(Y)?$(Y,J):Y):[T]},getAktivitetType=T=>T.type===VeilarbAktivitetType.EKSTERN_AKTIVITET_TYPE?aktivitetTypeMap[T.eksternAktivitet.type]:aktivitetTypeMap[T.type],aktivitetTypeMap={EGEN:"Jobbrettet egenaktivitet",STILLING:"Stilling",TILTAKSAKTIVITET:"Tiltak gjennom NAV",GRUPPEAKTIVITET:"Gruppeaktivitet",UTDANNINGSAKTIVITET:"Utdanning",SOKEAVTALE:"Jobbsøking",IJOBB:"Jobb jeg har nå",BEHANDLING:"Behandling",MOTE:"Møte med NAV",SAMTALEREFERAT:"Samtalereferat",STILLING_FRA_NAV:"Stilling fra NAV",ARENA_TILTAK:"Tiltak gjennom NAV",MIDLERTIDIG_LONNSTILSKUDD:"Avtale midlertidig lønnstilskudd",VARIG_LONNSTILSKUDD:"Avtale varig lønnstilskudd",INDOPPFAG:"Oppfølging",ARBFORB:"Arbeidsforberedende trening",AVKLARAG:"Avklaring",VASV:"Tilrettelagt arbeid",ARBRRHDAG:"Arbeidsrettet rehabilitering",DIGIOPPARB:"Digitalt oppfølgingstiltak",JOBBK:"Jobbklubb",GRUPPEAMO:"Arbeidsmarkedsopplæring (Gruppe)",GRUFAGYRKE:"Fag- og yrkesopplæring (Gruppe)"},aktivitetStatusMap={PLANLAGT:"Planlegger",BRUKER_ER_INTERESSERT:"Forslag",GJENNOMFORES:"Gjennomfører",FULLFORT:"Fullført",AVBRUTT:"Avbrutt"},jobbStatusTypeMap={DELTID:"Deltid",HELTID:"Heltid"},kanalMap={INTERNETT:"Videomøte",OPPMOTE:"Oppmøte",TELEFON:"Telefonmøte"},avtaltMapper={AVTALT_MED_NAV:"Avtalt med NAV",IKKE_AVTALT_MED_NAV:"Ikke avtalt med NAV"},stillingsEtikettMapper={INGEN_VALGT:"Ingen",SOKNAD_SENDT:"Søknaden er sendt",INNKALT_TIL_INTERVJU:"Skal på intervju",AVSLAG:"Ikke fått jobben",JOBBTILBUD:"Fått jobbtilbud"},stillingFraNavSoknadsstatusMapper={VENTER:"Venter på å bli kontaktet",CV_DELT:"CV er delt med arbeidsgiver",SKAL_PAA_INTERVJU:"Skal på intervju",JOBBTILBUD:"Fått jobbtilbud",AVSLAG:"Ikke fått jobben",IKKE_FATT_JOBBEN:"Ikke fått jobben",FATT_JOBBEN:"Fått jobben"},stillingOgStillingFraNavEtikettMapper={...stillingsEtikettMapper,...stillingFraNavSoknadsstatusMapper},tiltakEtikettMapper={[ArenaEtikett.AKTUELL]:"Søkt inn på tiltaket",[ArenaEtikett.AVSLAG]:"Fått avslag",[ArenaEtikett.IKKAKTUELL]:"Ikke aktuell for tiltaket",[ArenaEtikett.IKKEM]:"Ikke møtt på tiltaket",[ArenaEtikett.INFOMOETE]:"Infomøte før tiltaket",[ArenaEtikett.JATAKK]:"Takket ja til tilbud",[ArenaEtikett.NEITAKK]:"Takket nei til tilbud",[ArenaEtikett.TILBUD]:"Fått plass på tiltaket",[ArenaEtikett.VENTELISTE]:"På venteliste"},eksternAktivitetFilterTextMappings={SOKT_INN:"Søkt inn på tiltaket",AVSLAG:"Fått avslag",IKKE_AKTUELL:"Ikke aktuell for tiltaket",IKKE_MOETT:"Ikke møtt på tiltaket",INFOMOETE:"Infomøte før tiltaket",TAKKET_JA:"Takket ja til tilbud",TAKKET_NEI:"Takket nei til tilbud",FATT_PLASS:"Fått plass på tiltaket",VENTELISTE:"På venteliste"},tiltakOgEksternAktivitetEtikettMapper={...tiltakEtikettMapper,...eksternAktivitetFilterTextMappings};function selectAktiviteterSlice(T){return T.data.aktiviteter}const selectAktiviteterData=createSelector(selectAktiviteterSlice,T=>T.data.perioder.flatMap(C=>C.aktiviteter).filter(C=>C)||[]),selectAktiviteterByPeriode=T=>{var C;return((C=selectAktiviteterSlice(T).data)==null?void 0:C.perioder)||[]};function selectAktivitetStatus(T){return selectAktiviteterSlice(T).status}function selectHarTilgangTilAktiviteter(T){return selectAktivitetStatus(T)===Status.OK}function selectLasterAktivitetData(T){return selectAktivitetStatus(T)!==Status.OK}const selectAktivitetFeilmeldinger=createSelector(selectAktivitetStatus,selectErrors,(T,C)=>T===Status.ERROR?selectFeil(C,hentAktivitet.rejected.type):[]),selecteEndreAktivitetFeilmeldinger=createSelector(selectErrors,T=>{const C=selectFeil(T,oppdaterAktivitet.rejected.type),$=selectFeil(T,oppdaterAktivitetEtikett.rejected.type),V=selectFeil(T,oppdaterStillingFraNavSoknadsstatus.rejected.type),K=selectFeil(T,flyttAktivitet.rejected.type);return[...C,...$,...V,...K]}),selectArenaAktiviteterSlice=T=>T.data.arenaAktiviteter,selectArenaAktiviteterData=T=>selectArenaAktiviteterSlice(T).data||[],selectArenaAktivitetStatus=T=>selectArenaAktiviteterSlice(T).status,selectArenaFeilmeldinger=createSelector(selectArenaAktivitetStatus,selectErrors,(T,C)=>T===Status.ERROR?selectFeil(C,hentArenaAktiviteter.rejected.type):[]),selectAlleAktiviter=createSelector([selectAktiviteterData,selectArenaAktiviteterData],(T,C)=>T.concat(C)),selectVistOppfolgingsperiode=createSelector(selectHistoriskPeriode,selectOppfolgingsPerioder,(T,C)=>{const $=C.find(V=>!V.sluttDato);return T||$}),selectAktiviterForAktuellePerioden=createSelector(selectArenaAktiviteterData,selectVistOppfolgingsperiode,selectAktiviteterByPeriode,selectHistoriskPeriode,selectForrigeHistoriskeSluttDato,(T,C,$,V,K)=>{var J;const Y=T.filter(re=>datoErIPeriode(re.opprettetDato,V,K));return[...((J=$.find(re=>re.id===(C==null?void 0:C.uuid)))==null?void 0:J.aktiviteter)||[],...Y]}),selectAktivitetListe=T=>selectAktiviterForAktuellePerioden(T).filter(C=>aktivitetMatchesFilters(C,T)),selectAktivitetMedId=(T,C)=>selectAlleAktiviter(T).find($=>$.id===C),selectAktivitetListeSlice=T=>({status:aggregerStatus(selectOppfolgingStatus(T),selectIdentitetStatus(T),selectAktivitetStatus(T)),data:selectAktivitetListe(T)}),selectAktivitetListeStatus=T=>selectAktivitetListeSlice(T).status,kanEndreAktivitetStatus=(T,C)=>{if(!T)return!1;const{historisk:$,status:V,type:K}=T;return!$&&K!==VeilarbAktivitetType.EKSTERN_AKTIVITET_TYPE&&(C||K!==MOTE_TYPE)&&V!==AktivitetStatus.AVBRUTT&&V!==AktivitetStatus.FULLFOERT},kanEndreAktivitetEtikett=(T,C)=>{if(!T)return!1;const{historisk:$,type:V}=T;return!$&&(C||V!==MOTE_TYPE)},kanEndreAktivitetDetaljer=(T,C)=>{if(!T||isArenaAktivitet(T))return!1;const{avtalt:$,type:V}=T;return kanEndreAktivitetStatus(T,C)&&(C||V!==SAMTALEREFERAT_TYPE)&&V!==STILLING_FRA_NAV_TYPE&&(!$||C||V===BEHANDLING_AKTIVITET_TYPE)};function fn(T){return typeof T=="function"?T:()=>T}function autobind(T){Object.getOwnPropertyNames(T.constructor.prototype).filter(C=>typeof T[C]=="function").forEach(C=>{T[C]=T[C].bind(T)})}function storeForbokstaver(...T){return T.filter($=>$).join(" ").split(" ").map($=>$.charAt(0).toUpperCase()+$.slice(1).toLowerCase()).join(" ")}function HiddenIf({hidden:T,children:C}){return T?null:C}function visibleIfHOC(T){return class extends React.Component{render(){const{visible:$,...V}=this.props,K=fn($)(V);return K||K===void 0?React.createElement(T,V):null}}}function VisibleIfDiv(T){const{children:C}=T;return jsxRuntimeExports.jsx("div",{...T,children:C})}VisibleIfDiv.propTypes={children:PropTypes.node.isRequired};const VisibleIfDiv$1=visibleIfHOC(VisibleIfDiv),FilterCheckbox=T=>{const{filterTekst:C,nokkel:$,metrikkNavn:V,filter:K,doToggle:Y}=T,[J,re]=reactExports.useState(!1);reactExports.useEffect(()=>{re(!!K[$])},[K,$]);const ne=()=>{!K[$]&&V&&loggEvent(V,{filter:$}),Y($)};return jsxRuntimeExports.jsx(Checkbox,{onChange:ne,checked:J,onClick:()=>logValgtFilter(C),children:C})},selectorMap={avtalt:selectAktivitetAvtaltMedNavFilter,aktivitet:selectAktivitetTyperFilter,arenaEtikett:selectArenaAktivitetEtiketterFilter,etikett:selectAktivitetEtiketterFilter},togglerMap={avtalt:toggleAktivitetAvtaltMedNav,aktivitet:toggleAktivitetsType,arenaEtikett:toggleArenaAktivitetsEtikett,etikett:toggleAktivitetsEtikett},useFilterType=T=>{const C=useSelector(selectorMap[T]),$=useAppDispatch(),V=togglerMap[T];return{filterState:C,toggle:Y=>$(V(Y))}};function FilterVisning(T){const{tekst:C,metrikkNavn:$,className:V,textMapper:K,filterKategori:Y,filters:J}=T,{toggle:re,filterState:ne}=useFilterType(Y),te=(J||[]).length>0,se=(J||[]).map((ie,ae)=>jsxRuntimeExports.jsx(FilterCheckbox,{filterTekst:K[ie],filter:ne,nokkel:ie,metrikkNavn:$,doToggle:re},ae));return jsxRuntimeExports.jsx(VisibleIfDiv$1,{visible:te,className:classNames(V,"filter"),children:jsxRuntimeExports.jsxs("form",{children:[jsxRuntimeExports.jsx(Heading,{level:"2",size:"small",className:"filter__tittel",children:C}),se]})})}const getType=T=>T.type===VeilarbAktivitetType.EKSTERN_AKTIVITET_TYPE?T.eksternAktivitet.type:T.type,getTypeFilterValue=T=>[getType(T)];function AktivitetTypeFilter(){const T=useSelector(selectAktiviterForAktuellePerioden),C=Array.from(new Set(T.flatMap(getTypeFilterValue)));return jsxRuntimeExports.jsx(FilterVisning,{filterKategori:"aktivitet",filters:C,tekst:"Aktivitetstype",metrikkNavn:AKTIVITESTYPE_FILER_METRIKK,textMapper:aktivitetTypeMap})}const isEksternAktivitet=T=>T.type===VeilarbAktivitetType.EKSTERN_AKTIVITET_TYPE,getEksternFilterableFields=T=>{var C,$;return(($=(C=T.eksternAktivitet)==null?void 0:C.etiketter)==null?void 0:$.map(V=>V.kode))||[]},getArenaFilterableFields=T=>[T.etikett].filter(C=>!!C),ArenaEtikettFilter=()=>{const T=useSelector(selectAktiviterForAktuellePerioden),C=T.filter(isEksternAktivitet).flatMap(getEksternFilterableFields),$=T.filter(isArenaAktivitet).flatMap(getArenaFilterableFields),V=new Set([...C,...$]);return jsxRuntimeExports.jsx(FilterVisning,{filters:Array.from(V),filterKategori:"arenaEtikett",tekst:"Tiltaksstatus",metrikkNavn:ARENA_ETIKETT_FILTER_METRIKK,textMapper:tiltakOgEksternAktivitetEtikettMapper})};function notNull(T){return!!T}const getStillingStatusFilterValue=T=>T.type===VeilarbAktivitetType.STILLING_FRA_NAV_TYPE?[T.stillingFraNavData.soknadsstatus].map(C=>C===StillingFraNavSoknadsstatus.AVSLAG?StillingFraNavSoknadsstatus.IKKE_FATT_JOBBEN:C).filter(notNull):[T.etikett].filter(notNull),EtikettFilter=()=>{const T=useSelector(selectAktiviterForAktuellePerioden),C=Array.from(new Set(T.filter(isVeilarbAktivitet).flatMap(getStillingStatusFilterValue)));return jsxRuntimeExports.jsx(FilterVisning,{filters:C,filterKategori:"etikett",tekst:"Stillingsstatus",metrikkNavn:ETIKETT_FILTER_METRIKK,textMapper:stillingOgStillingFraNavEtikettMapper})};function erAktivtFilter(T){return Object.values(T).indexOf(!0)>=0}function selectDatoErIPeriode(T,C){const $=selectHistoriskPeriode(C),V=selectForrigeHistoriskeSluttDato(C);return datoErIPeriode(T,$,V)}const isAfterOrEqual=(T,C)=>!isBefore(T,C);function datoErIPeriode(T,C,$){const V=new Date(T);if(C){const K={start:new Date(C.startDato),end:new Date(C.sluttDato)};return isWithinInterval(V,K)}return!$||isAfterOrEqual(V,new Date($))}const hasNoOverlap=(T,C)=>T.every($=>!C.includes($)),activeFilters=T=>Object.entries(T).filter(([C,$])=>$).map(([C,$])=>C),getTiltakstatusEtiketter=T=>isArenaAktivitet(T)?getArenaFilterableFields(T):isEksternAktivitet$1(T)?getEksternFilterableFields(T):[];function aktivitetMatchesFilters(T,C){const $=selectAktivitetTyperFilter(C),V=getType(T);if(erAktivtFilter($)&&!$[V])return!1;const K=selectAktivitetEtiketterFilter(C);if(erAktivtFilter(K))return!(!isVeilarbAktivitet(T)||hasNoOverlap(getStillingStatusFilterValue(T),activeFilters(K)));const Y=selectArenaAktivitetEtiketterFilter(C);if(erAktivtFilter(Y)){const ae=Object.entries(Y).filter(([le,ce])=>!!ce).map(([le,ce])=>le),oe=getTiltakstatusEtiketter(T);if(hasNoOverlap(oe,ae))return!1}const J=selectAktivitetAvtaltMedNavFilter(C),re=J.AVTALT_MED_NAV,ne=J.IKKE_AVTALT_MED_NAV,{avtalt:te}=T;return!([re,ne].filter(ae=>ae).length===1&&(re&&!te||ne&&te))}function selectMalListeSlice(T){return T.data.malListe}function selectMalListeData(T){return selectMalListeSlice(T).data}function selectMalListeStatus(T){return selectMalListeSlice(T).status}function selectMalListe(T){var C;return((C=selectMalListeData(T))==null?void 0:C.filter($=>$.dato?selectDatoErIPeriode($.dato,T):!0))||[]}const selectMalSlice=T=>T.data.mal,selectMalData=T=>selectMalSlice(T).data,selectMalStatus=T=>selectMalSlice(T).status;function selectGjeldendeMal(T){return selectViserInneverendePeriode(T)?selectMalData(T):selectMalListe(T)[0]}const SvgAktivitetsplanMaal=T=>reactExports.createElement("svg",{width:96,height:96,viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",...T},reactExports.createElement("g",{clipPath:"url(#clip0_5085_99244)"},reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46 0H50V12H46V0ZM46 84H50V96H46V84ZM12 50V46H0V50H12ZM96 46V50H84V46H96ZM35.1846 81.7012L31.5304 80.0742L26.6496 91.0368L30.3037 92.6637L35.1846 81.7012ZM65.6963 3.33643L69.3505 4.96337L64.4696 15.9259L60.8154 14.299L65.6963 3.33643ZM23.4931 74.4462L20.7145 71.5688L12.0824 79.9047L14.861 82.7821L23.4931 74.4462ZM81.139 13.2178L83.9177 16.0951L75.2856 24.431L72.507 21.5537L81.139 13.2178ZM15.3706 63.3401L13.8722 59.6313L2.74599 64.1266L4.24441 67.8354L15.3706 63.3401ZM91.7556 28.1646L93.254 31.8733L82.1278 36.3686L80.6294 32.6598L91.7556 28.1646ZM13.9625 35.1845L15.5895 31.5303L4.62693 26.6494L2.99999 30.3036L13.9625 35.1845ZM92.3273 65.6963L90.7003 69.3505L79.7378 64.4696L81.3647 60.8154L92.3273 65.6963ZM21.2174 23.4935L24.0947 20.7148L15.7588 12.0828L12.8815 14.8614L21.2174 23.4935ZM82.446 81.1392L79.5687 83.9178L71.2328 75.2857L74.1101 72.5071L82.446 81.1392ZM32.3236 15.371L36.0323 13.8726L31.5371 2.74635L27.8283 4.24478L32.3236 15.371ZM67.4994 91.7559L63.7907 93.2543L59.2954 82.1281L63.0041 80.6297L67.4994 91.7559ZM47 73C61.3594 73 73 61.3594 73 47C73 32.6406 61.3594 21 47 21C32.6406 21 21 32.6406 21 47C21 61.3594 32.6406 73 47 73Z",fill:"#CCF1D6"}),reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26 53V59.1307H39.7392C40.4227 59.1307 41.061 59.4725 41.4399 60.0414L49 71.3916L41.4399 82.7418C41.061 83.3107 40.4227 83.6524 39.7392 83.6524H26V100H23V83.6524H1.90822C1.09235 83.6524 0.605567 82.7433 1.05785 82.0643L8.16669 71.3916L1.05785 60.7188C0.605567 60.0398 1.09235 59.1307 1.90822 59.1307H23V53C23 52.1716 23.6716 51.5 24.5 51.5C25.3284 51.5 26 52.1716 26 53ZM5.60282 62.1307L11.7713 71.3916L5.60282 80.6524H39.227L45.3955 71.3916L39.227 62.1307H5.60282Z",fill:"#262626"}),reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M73 3H63C62.4477 3 62 3.44772 62 4V9H74V4C74 3.44772 73.5523 3 73 3ZM59 4V9H42C40.8954 9 40 9.89543 40 11V26C40 27.6569 41.3431 29 43 29L43 43C43 44.6569 44.3431 46 46 46H90C91.6569 46 93 44.6569 93 43V29C94.6569 29 96 27.6569 96 26V11C96 9.89543 95.1046 9 94 9H77V4C77 1.79086 75.2091 0 73 0H63C60.7909 0 59 1.79086 59 4ZM59 12H77H93V26H92H69.5V23C69.5 22.1716 68.8284 21.5 68 21.5C67.1716 21.5 66.5 22.1716 66.5 23V26H44H43L43 12H59ZM66.5 29H46V43H90V29H69.5V31C69.5 31.8284 68.8284 32.5 68 32.5C67.1716 32.5 66.5 31.8284 66.5 31V29Z",fill:"#262626"})),reactExports.createElement("defs",null,reactExports.createElement("clipPath",{id:"clip0_5085_99244"},reactExports.createElement("rect",{width:96,height:96,fill:"white"}))));function MalText(T){return T.disabled?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"Trykk her for å se dine tidligere mål"}):T.mal?jsxRuntimeExports.jsx(CustomBodyLong,{formatLinebreaks:!0,children:T.mal}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"Du har ikke skrevet hva målet ditt er. Beskriv målet ditt, gjerne både kortsiktige og langsiktige mål og hva slags arbeidsoppgaver du ønsker deg."})}function MalContent(T){const{disabled:C,mal:$}=T,V=useErVeileder(),K=useNavigate(),{malRoute:Y}=useRoutes(),J=ne=>{K(Y()),loggMittMalKlikk(V),logKlikkKnapp(ne)},re=useSelector(selectViserInneverendePeriode,shallowEqual$1);return!$&&!C?jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(BodyShort,{children:"Skriv litt om hva som er målet ditt slik at vi kan hjelpe deg bedre."}),jsxRuntimeExports.jsxs("ul",{className:"list-disc ml-6 mb-4",children:[jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(BodyShort,{children:"Hva er målet på kort og på lang sikt?"})}),jsxRuntimeExports.jsx("li",{children:jsxRuntimeExports.jsx(BodyShort,{children:"Hva slags jobb ønsker du deg?"})})]}),jsxRuntimeExports.jsx(Button$1,{onClick:()=>J("Sett et mål"),variant:"secondary",size:"small",children:"Sett et mål"})]}):jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-start gap-4",children:[jsxRuntimeExports.jsx(MalText,{disabled:C,mal:$}),jsxRuntimeExports.jsx(Button$1,{onClick:()=>J("Endre målet"),variant:"secondary",size:"small",children:re?"Endre målet":"Se tidligere mål"})]})}function MittMaal(){const T=useAppDispatch();reactExports.useEffect(()=>{T(hentMal())},[]);const C=useSelector(selectMalStatus,shallowEqual$1),$=useSelector(selectGjeldendeMal,shallowEqual$1),V=$&&$.mal,K=useSelector(selectErUnderOppfolging,shallowEqual$1),Y=useSelector(selectViserHistoriskPeriode,shallowEqual$1),J=useSelector(selectHarSkriveTilgang,shallowEqual$1),re=!K||Y||!J,ne=erNyEndringIMal($,useSelector(selectLestAktivitetsplan),useSelector(selectIdentitetData))&&J,te=C==="ERROR";return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Innholdslaster,{avhengigheter:C,children:jsxRuntimeExports.jsx("div",{className:classNames("border-border-default flex rounded-md p-4",{"border-2 border-dashed ":!V&&!re,border:V||re}),children:jsxRuntimeExports.jsxs("div",{className:"flex sm:flex-row items-center gap-6",children:[jsxRuntimeExports.jsx(SvgAktivitetsplanMaal,{"aria-hidden":!0,role:"img",className:"hidden sm:block mx-4 min-w-fit"}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:"flex mb-2 items-center",children:[jsxRuntimeExports.jsx(NotifikasjonMarkering,{visible:ne}),jsxRuntimeExports.jsx(Heading,{level:"2",size:"medium",className:"flex",children:"Mitt mål"})]}),jsxRuntimeExports.jsx(MalContent,{disabled:re,mal:V})]})]})})}),te?jsxRuntimeExports.jsx(Alert$1,{variant:"error",children:"Kunne ikke hente mål"}):null]})}function erNyEndringIMal(T,C,$){if(!(T!=null&&T.mal))return!1;const V=!C,K=T.endretAv==="BRUKER"&&$.erBruker||T.endretAv==="VEILEDER"&&$.erVeileder;if(V)return!K;const Y=isAfter(parseISO(T.dato),parseISO(C.tidspunkt));return!K&&!T.lest&&Y}const byttTilDialogFlate=({event:T,aktivitetId:C,dialogId:$})=>{T.preventDefault(),window.history.pushState("","Dialog",getDialogLenke({erVeileder:!0,aktivitetId:C,dialogId:$})),window.dispatchEvent(new CustomEvent("visDialog",{detail:{dialogId:$,aktivitetId:C}}))},getDialogLenke=({dialogId:T,aktivitetId:C,erVeileder:$})=>$?T?`/${T}`:C?`/ny?aktivitetId=${C}`:"/":T?`${ARBEIDSRETTET_DIALOG_URL}/${T}`:C?`${ARBEIDSRETTET_DIALOG_URL}/ny?aktivitetId=${C}`:`${ARBEIDSRETTET_DIALOG_URL}`,LenkeTilDialog=T=>{const{className:C,dialogId:$,aktivitetId:V,hidden:K,children:Y}=T,J=useNavigate(),re=useErVeileder(),{hovedsideRoute:ne}=useRoutes(),te=se=>{re&&(J(ne(),{replace:!0}),byttTilDialogFlate({event:se,aktivitetId:V,dialogId:$}))};return K?null:jsxRuntimeExports.jsx("a",{href:getDialogLenke({erVeileder:re,aktivitetId:V,dialogId:$}),onClick:te,className:C,children:Y})},AdvarselMedDialogLenke=T=>{const{lenkeTekst:C,tekst:$,hidden:V,dialogId:K}=T;return V?null:jsxRuntimeExports.jsx(Alert$1,{variant:"warning",className:"mb-5 mt-4",children:jsxRuntimeExports.jsxs(BodyShort,{children:[$," ",jsxRuntimeExports.jsx(LenkeTilDialog,{dialogId:K,children:C})]})})},AdvarselMedLenkeVarsling=T=>{const{hidden:C,tekst:$,lenkeTekst:V,href:K}=T;return C?null:jsxRuntimeExports.jsxs(Alert$1,{variant:"warning",className:"mb-5 mt-4",children:[$," ",jsxRuntimeExports.jsx(Link$1,{href:K,children:V})]})},infotekstTilInaktivertBrukere=T=>{if(!T)return'Du er ikke lenger registrert hos NAV og din tidligere aktivitetsplan er lagt under "Tidligere plan". Hvis du fortsatt skal motta ytelser og få oppfølging fra NAV må du være registrert.';const C=T<=28&&T>=10,$=T<10&&T>=1;return C?"Du er ikke lenger registrert hos NAV. Hvis du fortsatt skal motta ytelser, få oppfølging fra NAV og bruke aktivitetsplanen må du være registrert.":$?`Du er ikke lenger registrert hos NAV. Hvis du fortsatt skal motta ytelser, få oppfølging fra NAV og bruke aktivitetsplanen må du være registrert. Om ${T} dager vil denne aktivitetsplanen bli avsluttet.`:'Du er ikke lenger registrert hos NAV og din tidligere aktivitetsplan er lagt under "Tidligere plan". Hvis du fortsatt skal motta ytelser og få oppfølging fra NAV må du være registrert.'},BrukerVarslinger=T=>{const{tilhorendeDialogId:C,erEskalert:$}=T,V=useSelector(selectInaktiveringsDato,shallowEqual$1),K=useSelector(selectErUnderOppfolging),Y=useSelector(selectKanReaktiveres),J=startOfDay(new Date),re=addDays(parseISO(V),28),ne=differenceInDays(re,J);return jsxRuntimeExports.jsxs("div",{className:"container",children:[jsxRuntimeExports.jsx(AdvarselMedDialogLenke,{lenkeTekst:"Les hva du må gjøre.",tekst:"Du har fått en viktig melding fra NAV.",dialogId:C,hidden:!$}),jsxRuntimeExports.jsx(AdvarselMedLenkeVarsling,{hidden:!Y,tekst:infotekstTilInaktivertBrukere(ne),lenkeTekst:"Gå til registrering",href:ARBEIDSSOKERREGISTRERING_URL}),jsxRuntimeExports.jsx(AdvarselMedLenkeVarsling,{hidden:K,tekst:'Du er ikke lenger registrert hos NAV og din tidligere aktivitetsplan er lagt under "Tidligere planer". Hvis du fortsatt skal motta ytelser, få oppfølging fra NAV og bruke aktivitetsplanen må du være registrert.',lenkeTekst:"Register deg hos NAV",href:ARBEIDSSOKERREGISTRERING_URL})]})},selectEskaleringsvarselSlice=T=>T.data.eskaleringsvarsel,selectEskaleringsvarselData=T=>selectEskaleringsvarselSlice(T).data,selectEskaleringsvarselStatus=T=>selectEskaleringsvarselSlice(T).status,selectErEskalert=T=>{var C;return!!((C=selectEskaleringsvarselData(T))!=null&&C.id)},erGyldigISODato=T=>!!(T&&isValid$1(parseISO(T)));function formatter(T,C){if(T){const $=typeof T=="string"?parseISO(T):T;return isValid$1($)?format($,C,{locale:nb$1}):void 0}}function formaterDatoManed(T){return formatter(T,"PPP")}function formaterDatoKortManed(T){return formatter(T,"PP")}function formaterDatoKortManedTid(T){return formatter(T,"PP 'kl' HH:mm")}function formaterTid(T){return formatter(T,"HH:mm")}function formaterDatoTidSiden(T){const C=parseISO(T);return isValid$1(C)?formatDistance$2(C,new Date,{addSuffix:!0,locale:nb$1}):void 0}function erMerEnntoDagerSiden(T){const C=parseISO(T),$=subDays(endOfToday(),2);return isValid$1(C)?isBefore(C,$):!1}function erMerEnnSyvDagerTil(T){const C=parseISO(T);return isValid$1(C)?isAfter(C,startOfDay(addDays(new Date,7))):!1}function formaterDatoEllerTidSiden(T){const C=parseISO(T);if(isValid$1(C))return erMerEnntoDagerSiden(T)?formaterDatoKortManedTid(T):formaterDatoTidSiden(T)}const msSince=T=>differenceInMilliseconds(new Date,parseISO(T)),oneIfPresent=T=>T?1:0;function datoComparator(T,C){const $=parseISO(T),V=parseISO(C);return isValid$1($)&&isValid$1(V)?$.getTime()-V.getTime():oneIfPresent(T)-oneIfPresent(C)}function dagerTil(T){return differenceInDays(startOfDay(parseISO(T)),startOfDay(new Date))}const VeilederVarsel=T=>{const{tilhorendeDialogId:C,opprettetDato:$,erEskalert:V}=T;if(!V)return null;const K=formaterDatoKortManed($);return jsxRuntimeExports.jsx("div",{className:"container",children:jsxRuntimeExports.jsx(Alert$1,{variant:"warning",className:"mb-5",children:jsxRuntimeExports.jsxs(BodyShort,{children:["NAV har sendt varsel ",K," ",jsxRuntimeExports.jsx(LenkeTilDialog,{dialogId:C,children:"Les meldingen"})]})})})},Varslinger=()=>{const T=useSelector(selectIdentitetStatus,shallowEqual$1),C=useSelector(selectErBruker),$=useSelector(selectEskaleringsvarselStatus,shallowEqual$1),V=useSelector(selectEskaleringsvarselData,shallowEqual$1),K=useSelector(selectErEskalert),Y=useSelector(selectOppfolgingStatus,shallowEqual$1),J=C?jsxRuntimeExports.jsx(BrukerVarslinger,{tilhorendeDialogId:V==null?void 0:V.tilhorendeDialogId,erEskalert:K}):jsxRuntimeExports.jsx(VeilederVarsel,{tilhorendeDialogId:V==null?void 0:V.tilhorendeDialogId,opprettetDato:V==null?void 0:V.opprettetDato,erEskalert:K});return jsxRuntimeExports.jsx(Innholdslaster,{avhengigheter:[Y,T,$],children:J})},selectDialogerSlice=T=>T.data.dialog,selectDialogStatus=T=>selectDialogerSlice(T).status,selectDialogerData=T=>selectDialogerSlice(T).data,selectSistOppdatert=T=>selectDialogerSlice(T).sistOppdatert,selectDialoger=createSelector([selectDialogerData,selectHistoriskPeriode,selectForrigeHistoriskeSluttDato],(T,C,$)=>T.filter(V=>datoErIPeriode(V.opprettetDato,C??void 0,$))),selectDialogForAktivitetId=T=>C=>selectDialogerData(C).find($=>$.aktivitetId===T),selectDialogFeilmeldinger=createSelector(selectDialogerSlice,selectErrors,(T,C)=>T.status===Status.ERROR?selectFeil(C,hentDialoger.rejected.type):[]);function Navigasjonslinje(){const T=useErVeileder(),C=useSelector(selectSistOppdatert,shallowEqual$1),$=useSelector(selectVistOppfolgingsperiode),V=useAppDispatch();reactExports.useEffect(()=>{const J=()=>V(hentDialoger());if(!T){let re;return re=setInterval(()=>fetchSistOppdatert().then(te=>{const se=new Date(C),ie=te.sistOppdatert;te.sistOppdatert&&isAfter(ie,se)&&J()}).catch(()=>clearInterval(re)),1e4),()=>clearInterval(re)}},[V,T,C]);const K=useSelector(selectCanPrint);function Y(){loggEvent(APNE_OM_TJENESTEN),logKlikkKnapp("Hva er aktivitetsplanen?")}return jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-2",children:[jsxRuntimeExports.jsxs("div",{className:"flex gap-y-2 gap-x-8 flex-col sm:flex-row mt-8 mb-4",children:[T?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Link$1,{href:MINSIDE_URL,children:"Min side"}),jsxRuntimeExports.jsx(Link$1,{href:ARBEIDSRETTET_DIALOG_URL,children:jsxRuntimeExports.jsx("span",{children:"Min dialog med veileder"})})]}),jsxRuntimeExports.jsx(Link$2,{to:"informasjon",className:"text-text-action underline hover:no-underline",onClick:Y,children:"Hva er aktivitetsplanen?"}),K&&jsxRuntimeExports.jsx(Link$2,{to:"utskrift",className:"text-text-action underline hover:no-underline",children:"Skriv ut"}),ER_PROD?null:T&&$&&jsxRuntimeExports.jsx(Link$2,{to:"journalforing",className:"text-text-action underline hover:no-underline",children:"Journalføring"})]}),jsxRuntimeExports.jsx(Heading,{level:"1",size:"xlarge",children:"Aktivitetsplan"})]})}function handlers(T){return C=>{T.filter($=>$).forEach($=>$(C))}}const coerceToUndefined=T=>{if(!(T===void 0||T===""||T===null))return typeof T=="string"?new Date(T):T},useOutsideClick=(T,C)=>{reactExports.useEffect(()=>(T&&window.addEventListener("click",C),()=>window.removeEventListener("click",C)),[C])},preventCloseOnInsideClick=T=>{T.stopPropagation()};function AvtaltmedNavFilter(){const T=useSelector(selectAktiviterForAktuellePerioden),V=T.filter(K=>K.avtalt).length>0&&T.filter(K=>!K.avtalt).length>0?["AVTALT_MED_NAV","IKKE_AVTALT_MED_NAV"]:[];return jsxRuntimeExports.jsx(FilterVisning,{filterKategori:"avtalt",filters:V,tekst:"Avtalt aktivitet",metrikkNavn:AVTALT_FILER_METRIKK,textMapper:avtaltMapper})}const Filter=()=>{const[T,C]=reactExports.useState(!1),V=useSelector(selectAktiviterForAktuellePerioden).length>1,K=[useSelector(selectAktivitetListeStatus)],Y=toStatus(K),J=minstEnErOK(Y);return useOutsideClick(T,()=>C(!1)),V?jsxRuntimeExports.jsxs("div",{onClick:preventCloseOnInsideClick,className:"self-stretch sm:self-auto",children:[jsxRuntimeExports.jsx(Button$1,{disabled:!J,variant:"secondary",name:"filter",className:"relative w-full",onClick:()=>{C(!T),loggEvent(OPNE_AKTIVITETFILTER)},children:"Filtrer"}),T?jsxRuntimeExports.jsxs("div",{className:"scroll-auto max-h-screen-h-1/2 rounded-md absolute p-4 bg-white border z-10 w-96 max-h-screen-h-1/2 overflow-auto flex flex-col gap-y-4",children:[jsxRuntimeExports.jsx(AvtaltmedNavFilter,{}),jsxRuntimeExports.jsx(EtikettFilter,{}),jsxRuntimeExports.jsx(ArenaEtikettFilter,{}),jsxRuntimeExports.jsx(AktivitetTypeFilter,{})]}):null]}):null},PeriodeFilter=({harHistoriskePerioder:T,historiskPeriode:C,historiskePerioder:$,doVelgHistoriskPeriode:V,skjulInneverende:K})=>{const Y=useSelector(selectErUnderOppfolging),J=useSelector(selectSorterteHistoriskeOppfolgingsPerioder);if(reactExports.useEffect(()=>{if(!Y&&T){const ne=J[0];V(ne)}},[]),!T)return null;const re=ne=>{const te=ne.target.value;if(te==="inneverende")V(null);else{const se=$.find(ie=>ie.uuid===te);if(!se)return;loggEvent(VIS_HISTORISK_PERIODE),V(se)}};return jsxRuntimeExports.jsx("div",{className:"flex items-start",children:jsxRuntimeExports.jsxs(Select$1,{className:"w-full sm:w-64",hideLabel:!0,autoComplete:"on",defaultValue:C?C.uuid:"inneverende",label:"Periode",onChange:re,children:[K?null:jsxRuntimeExports.jsx("option",{value:"inneverende",className:"filter__radio--periode",children:"Nåværende periode"}),$.map((ne,te)=>{const se=format(new Date(ne.startDato),"dd. MMM yyyy"),ie=format(new Date(ne.sluttDato),"dd. MMM yyyy");return jsxRuntimeExports.jsx("option",{value:ne.uuid,children:`${se} - ${ie}`},te)})]})})};PeriodeFilter.defaultProps={historiskPeriode:null};const mapStateToProps$1=T=>{const C=selectSorterteHistoriskeOppfolgingsPerioder(T);return{historiskePerioder:C,historiskPeriode:selectHistoriskPeriode(T),harHistoriskePerioder:C.length>0}},mapDispatchToProps$1=T=>({doVelgHistoriskPeriode:C=>T(velgHistoriskPeriode(C))}),PeriodeFilter$1=connect(mapStateToProps$1,mapDispatchToProps$1)(PeriodeFilter),FiltreringLabel=({label:T,slettFilter:C})=>jsxRuntimeExports.jsx(Chips$1.Removable,{variant:"neutral","aria-label":"slett-filter",onClick:C,children:T}),VisValgtFilter=()=>{const T=useSelector(selectFilterSlice),C=useAppDispatch(),$=ne=>C(toggleAktivitetsEtikett(ne)),V=ne=>C(toggleArenaAktivitetsEtikett(ne)),K=ne=>C(toggleAktivitetsType(ne)),Y=ne=>C(toggleAktivitetAvtaltMedNav(ne)),J=(ne,te)=>{switch(ne){case"aktivitetTyper":return{tekst:aktivitetTypeMap[te],func:K};case"aktivitetEtiketter":return{tekst:stillingOgStillingFraNavEtikettMapper[te],func:$};case"arenaAktivitetEtiketter":return{tekst:tiltakOgEksternAktivitetEtikettMapper[te],func:V};case"aktivitetAvtaltMedNav":return{tekst:avtaltMapper[te],func:Y};default:return ne}};return Object.values(T).some(ne=>ne?Object.values(ne).some(te=>te===!0):!1)?jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap flex-col",children:[jsxRuntimeExports.jsx(Label,{className:"mb-2",children:"Valgte filter"}),jsxRuntimeExports.jsx(Chips$1,{children:Object.entries(T).map(([ne,te])=>te===null||ne==="historiskPeriode"?null:Object.entries(te).filter(([se,ie])=>ie).map(([se,ie])=>{const ae=J(ne,se);return typeof ae=="string"?null:jsxRuntimeExports.jsx(FiltreringLabel,{label:ae.tekst,slettFilter:()=>{ae.func(se)}},se)}))})]}):null},Verktoylinje=()=>{const T=useSelector(selectErUnderOppfolging),C=useSelector(selectViserHistoriskPeriode),$=useSelector(selectHarSkriveTilgang),V=useSelector(selectHarTilgangTilAktiviteter),K=useNavigate(),{nyAktivitetRoute:Y}=useRoutes(),J=C||!T||!$;return jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-6",children:[jsxRuntimeExports.jsxs("div",{className:"flex gap-y-4 sm:flex-row flex-col-reverse ",children:[jsxRuntimeExports.jsxs("div",{className:"flex gap-4 items-start flex-col sm:flex-row w-full",children:[J?null:jsxRuntimeExports.jsx(Button$1,{className:"self-stretch sm:self-auto",icon:jsxRuntimeExports.jsx(PlusIcon,{role:"img","aria-hidden":!0,fontSize:"1.5rem"}),disabled:!V,onClick:()=>{loggEvent(APNE_NY_AKTIVITET),K(Y())},children:"Legg til aktivitet"}),jsxRuntimeExports.jsx(Filter,{})]}),jsxRuntimeExports.jsx(PeriodeFilter$1,{skjulInneverende:!T})]}),jsxRuntimeExports.jsx(VisValgtFilter,{})]})},LinkAsDiv=T=>{const{to:C,children:$,id:V,className:K,ariaLabel:Y,onClick:J}=T,re=useNavigate();return jsxRuntimeExports.jsx("div",{role:"link","aria-label":Y,id:V,className:K,tabIndex:0,onClick:()=>{re(C),J()},onKeyPress:ne=>{ne.key==="Enter"&&(re(C),J())},children:$})};function compareUndefindedOrNull(T,C){return T!=null&&C==null?-1:T==null&&C!=null?1:0}function sammenlignDato(T,C){return!T||!C?compareUndefindedOrNull(T,C):C.localeCompare(T)}function compareAktivitet(T,C){const $=isArenaAktivitet(T)?T.fraDato:T.endretDato,V=isArenaAktivitet(C)?C.fraDato:C.endretDato;return sammenlignDato($,V)}function delCvikkeSvartSkalVises(T){var J;const C=T.type===VeilarbAktivitetType.STILLING_FRA_NAV_TYPE,$=!((J=T.stillingFraNavData)!=null&&J.cvKanDelesData),V=T.status,K=T.historisk,Y=V===AktivitetStatus.FULLFOERT||V===AktivitetStatus.AVBRUTT||K;return C&&$&&!Y}function erNyEndringIAktivitet(T,C,$){if(T.endretAvType==="BRUKER"&&$.erBruker||T.endretAvType==="NAV"&&$.erVeileder&&T.endretAv===$.id)return!1;if(!C)return!0;const K=parseISO(T.endretDato||T.opprettetDato),Y=parseISO(C.tidspunkt);return isValid$1(K)&&isValid$1(Y)?isAfter(K,Y)&&isBefore(K,addMinutes(new Date,5)):!1}function beregnKlokkeslettVarighet(T){const{fraDato:C,tilDato:$}=T;if(C&&$){const V=new Date(C),K=new Date($),Y=differenceInMinutes(K,V),J=format(V,"HH:mm");return{dato:startOfDay(V),klokkeslett:J,varighet:Y}}}const toDate=T=>isDate(T)?T:new Date(T),validKlokkeslett=T=>{const C=T.split(":");if(C.length!=2)return!1;const[$,V]=C,K=parseInt($),Y=parseInt(V);return!isNaN(K)&&!isNaN(Y)&&Y<60&&K<24&&Y>-1&&K>-1},toHourAndMinutes=T=>{if(typeof T!="number"){const[C,$]=T.split(":").map(V=>parseInt(V));return{hour:C,minute:$}}else{const C=parseInt(T.toString()),$=minutesToHours(C),V=C-60*$;return{hour:$,minute:V}}};function beregnFraTil(T){const{dato:C,klokkeslett:$,varighet:V}=T;if(C&&$&&validKlokkeslett($)&&V!==void 0&&V!==null){const{hour:K,minute:Y}=toHourAndMinutes($),J=setMinutes(setHours(startOfDay(toDate(C)),K),Y),re=addMinutes(J,V);return{fraDato:J.toISOString(),tilDato:re.toISOString()}}return{}}function formatterVarighet(T){if(T)if(typeof T=="number"||!isNaN(parseInt(T))){const{hour:C,minute:$}=toHourAndMinutes(T);return C>0?$>0?`${C.toString()} ${C===1?"time":"timer"}, ${prefixMed0($.toString())} minutter`:`${C.toString()} ${C===1?"time":"timer"}`:`${prefixMed0($.toString())} minutter`}else return T}const prefixMed0=T=>T.length===1?"0"+T:T;function formatterKlokkeslett(T){if(!T||!validKlokkeslett(T))return;const{hour:C,minute:$}=toHourAndMinutes(T);return`${prefixMed0(C.toString())}:${prefixMed0($.toString())}`}function moteManglerPubliseringAvSamtalereferat(T,C){return T===VeilarbAktivitetType.MOTE_TYPE&&!C}function samtalreferatManglerPublisering(T,C){return T===VeilarbAktivitetType.SAMTALEREFERAT_TYPE&&!C}function manglerPubliseringAvSamtaleReferat(T,C){const{type:$,erReferatPublisert:V}=T;return moteManglerPubliseringAvSamtalereferat($,V)&&C!==AktivitetStatus.AVBRUTT||samtalreferatManglerPublisering($,V)}function erMoteOgAvbrutt(T,C){return T===AktivitetStatus.AVBRUTT&&C===MOTE_TYPE}function erAvtaltOgAvbrutt(T,C){return T&&C===AktivitetStatus.AVBRUTT}function erFullfoertUtenReferat(T,C,$){return T&&C===AktivitetStatus.FULLFOERT&&$!==SAMTALEREFERAT_TYPE&&$!==MOTE_TYPE}function trengerBegrunnelse(T,C,$){return erAvtaltOgAvbrutt(T,C)||erFullfoertUtenReferat(T,C,$)||erMoteOgAvbrutt(C,$)}function sorterAktiviteter(T,C){return T.filter($=>$.nesteStatus?$.nesteStatus===C:$.status===C).sort(compareAktivitet)}function endretNyereEnnEnManedSiden(T){const C=[T.endretDato,T.tilDato,T.fraDato].filter(V=>V!=null).find(V=>V&&isValid$1(parseISO(V))),$=C?parseISO(C):void 0;return $===void 0||isAfter($,subMonths(startOfDay(new Date),1))}const splitIEldreOgNyereAktiviteter=T=>T.reduce((C,$)=>endretNyereEnnEnManedSiden($)?{...C,nyereAktiviteter:[...C.nyereAktiviteter,$]}:{...C,eldreAktiviteter:[...C.eldreAktiviteter,$]},{nyereAktiviteter:[],eldreAktiviteter:[]}),selectAktiviteterSomHarBlittVist=T=>T.view.visteAktiviteterMedEndringer.data,selectSistVisteAktivitet=T=>{const C=selectAktiviteterSomHarBlittVist(T);return C.length===0?C[C.length-1]:void 0},aktivitetskort="_aktivitetskort_pnkum_1",tittel$1="_tittel_pnkum_19",sistVist="_sistVist_pnkum_23",type="_type_pnkum_27",drag="_drag_pnkum_30",frist="_frist_pnkum_37",fristUtgaat="_fristUtgaat_pnkum_41",ikon="_ikon_pnkum_44",flyttbar="_flyttbar_pnkum_48",dialogIkonUtenUleste="_dialogIkonUtenUleste_pnkum_52",dialogIkonMedUleste="_dialogIkonMedUleste_pnkum_58",styles$4={aktivitetskort,tittel:tittel$1,sistVist,type,drag,frist,fristUtgaat,ikon,flyttbar,dialogIkonUtenUleste,dialogIkonMedUleste};function getClassName(T){return T<0?styles$4.fristUtgaat:T<14?styles$4.frist:""}function getTekst$2(T,C){return T===0?"Søknadsfristen går ut i dag":T===1?"Søknadsfristen går ut i morgen":T>14?`Søknadsfrist: ${formaterDatoKortManed(C)}`:T<0?"Søknadsfristen har gått ut":`Søknadsfristen går ut om ${T} dager`}function Soknadfrist({aktivitet:T}){const{tilDato:C,etikett:$}=T;if($||!C)return null;const V=dagerTil(C);return jsxRuntimeExports.jsx(BodyShort,{className:getClassName(V),children:getTekst$2(V,C)})}function AktiviteskortPeriodeVisning({aktivitet:T,id:C}){const{type:$,fraDato:V,tilDato:K}=T;if($===VeilarbAktivitetType.STILLING_FRA_NAV_TYPE)return null;if($===VeilarbAktivitetType.STILLING_AKTIVITET_TYPE)return jsxRuntimeExports.jsx(Soknadfrist,{aktivitet:T});const Y=formaterDatoKortManed(V),J=formaterDatoKortManed(K);function re(){return $===MOTE_TYPE||$===SAMTALEREFERAT_TYPE||$===GRUPPE_AKTIVITET_TYPE&&J&&Y===J?Y:!V&&K?`Til: ${J}`:!K&&V?`Fra: ${Y}`:[Y,J].filter(ne=>ne).join(" - ")}return jsxRuntimeExports.jsx(BodyShort,{id:C,children:re()})}function hiddenIfHOC(T){function C({hidden:$,...V}){return fn($)(V)?null:React.createElement(T,V)}return C.defaultProps={hidden:!1},C.propTypes={hidden:PropTypes.oneOfType([PropTypes.bool,PropTypes.func])},C}function hoc(T){return hiddenIfHOC(C=>React.createElement(T,C,C.children))}const div$1=hoc("div");hoc("span");hoc("hr");const section=hoc("section");hoc("button");const CustomAlertstripe=T=>jsxRuntimeExports.jsx(Alert$1,{variant:"warning",inline:!0,className:"gap-x-2",children:T.tekst}),SkalDelCvIkkeSvartVises=T=>{const C=useSelector(selectErBruker),$=delCvikkeSvartSkalVises(T);return C&&$},DelCvIkkeSvart=()=>jsxRuntimeExports.jsx(CustomAlertstripe,{tekst:"Venter på svar fra deg"}),arenaTiltakEtikettKodeMapper={SOKT_INN:{tekst:"Søkt inn på tiltaket",variant:"info"},AVSLAG:{tekst:"Fått avslag",variant:"info"},IKKE_AKTUELL:{tekst:"Ikke aktuell for tiltaket",variant:"neutral"},IKKE_MOETT:{tekst:"Ikke møtt på tiltaket",variant:"warning"},INFOMOETE:{tekst:"Infomøte før tiltaket",variant:"info"},TAKKET_JA:{tekst:"Takket ja til tilbud",variant:"info"},TAKKET_NEI:{tekst:"Takket nei til tilbud",variant:"warning"},FATT_PLASS:{tekst:"Fått plass på tiltaket",variant:"info"},VENTELISTE:{tekst:"På venteliste",variant:"info"}},getEtikettByKode=(T,C)=>{switch(T){case EksternAktivitetType.ARENA_TILTAK_TYPE:return arenaTiltakEtikettKodeMapper[C];default:return}},EksterneEtiketter=({aktivitet:T})=>{const{etiketter:C,type:$}=T.eksternAktivitet;return!C||C.length==0?null:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:C.map(V=>V.tekst&&V.sentiment?{variant:V.sentiment==="POSITIVE"?"success":"neutral",tekst:V.tekst}:getEtikettByKode($,V.kode)).map((V,K)=>V?jsxRuntimeExports.jsx(Tag$1,{variant:V.variant,size:"small",children:V.tekst},K):null)})},getEtikett$1={SOKNAD_SENDT:{text:"Sendt søknad",variant:"success"},INNKALT_TIL_INTERVJU:{text:"Skal på intervju",variant:"info"},JOBBTILBUD:{text:"Fått jobbtilbud 🎉",variant:"warning"},AVSLAG:{text:"Ikke fått jobben",variant:"neutral"},INGEN_VALGT:{text:"Ikke fått jobben",variant:"neutral"}},StillingEtikett=T=>{const{aktivitet:C}=T,$=C.etikett;if(!$)return null;const{text:V,variant:K}=getEtikett$1[$];return jsxRuntimeExports.jsx(Tag$1,{className:"mr-2",variant:K,size:"small",children:V})},getEtikett={VENTER:{text:"Venter på å bli kontaktet",variant:"success"},CV_DELT:{text:"CV er delt med arbeidsgiver",variant:"info"},SKAL_PAA_INTERVJU:{text:"Skal på intervju",variant:"info"},JOBBTILBUD:{text:"Fått jobbtilbud 🎉",variant:"neutral"},AVSLAG:{text:"Ikke fått jobben",variant:"neutral"},IKKE_FATT_JOBBEN:{text:"Ikke fått jobben",variant:"neutral"},FATT_JOBBEN:{text:"Fått jobben 🎉",variant:"neutral"}},StillingFraNavEtikett=T=>{const{soknadsstatus:C}=T;if(!C)return null;const{text:$,variant:V}=getEtikett[C];return jsxRuntimeExports.jsx(Tag$1,{variant:V,size:"small",children:$})},getVariant=T=>{switch(T){case ArenaEtikett.JATAKK:case ArenaEtikett.AKTUELL:case ArenaEtikett.TILBUD:case ArenaEtikett.VENTELISTE:case ArenaEtikett.INFOMOETE:return"info";case ArenaEtikett.AVSLAG:case ArenaEtikett.IKKAKTUELL:return"neutral";case ArenaEtikett.IKKEM:case ArenaEtikett.NEITAKK:return"warning"}},getText$1=T=>tiltakEtikettMapper[T],TiltakEtikett=T=>{const{aktivitet:C}=T,$=C.etikett;if(!$)return null;const V=getVariant($),K=getText$1($);return jsxRuntimeExports.jsx(Tag$1,{className:"mr-2",variant:V,size:"small",children:K})},SkalIkkeDeltFerdigMarkeringVises=T=>{const{type:C,referat:$,erReferatPublisert:V}=T;return C===SAMTALEREFERAT_TYPE&&!V||C===MOTE_TYPE&&!!$&&!V},IkkeDeltFerdigMarkering=()=>{const C=useSelector(selectErBruker)?"Samtalereferatet er ikke ferdig":"Samtalereferatet er ikke delt";return jsxRuntimeExports.jsx(Tag$1,{variant:"warning",size:"small",className:"mt-0.5",children:C})};function DialogIkonUtenUleste(T){const{className:C}=T;return jsxRuntimeExports.jsx("svg",{"aria-label":"Ingen uleste meldinger",className:C,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:"false",role:"img",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 13.518L4.602 12H6v-1a4 4 0 014-4h6V4a2 2 0 00-2-2H4a2 2 0 00-2 2v9.518zM5.143 14H6v3a4 4 0 004 4h8.857L24 24V11a4 4 0 00-4-4h-2V4a4 4 0 00-4-4H4a4 4 0 00-4 4v13l5.143-3zm14.255 5L22 20.518V11a2 2 0 00-2-2H10a2 2 0 00-2 2v6a2 2 0 002 2h9.398zM11 15a1 1 0 100-2 1 1 0 000 2zm5-1a1 1 0 11-2 0 1 1 0 012 0zm3 1a1 1 0 100-2 1 1 0 000 2z",fill:"#0067C5"})})}function DialogIkonMedUleste(T){const{antallUleste:C,className:$}=T,V=C>9?23:26.8;return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("svg",{"aria-label":"Aktiviteten har uleste meldinger",className:$,xmlns:"http://www.w3.org/2000/svg",width:"40",height:"32",focusable:"false",role:"img",children:[jsxRuntimeExports.jsx("svg",{y:"8",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 13.518L4.602 12H6v-1a4 4 0 014-4h6V4a2 2 0 00-2-2H4a2 2 0 00-2 2v9.518zM5.143 14H6v3a4 4 0 004 4h8.857L24 24V11a4 4 0 00-4-4h-2V4a4 4 0 00-4-4H4a4 4 0 00-4 4v13l5.143-3zm14.255 5L22 20.518V11a2 2 0 00-2-2H10a2 2 0 00-2 2v6a2 2 0 002 2h9.398zM11 15a1 1 0 100-2 1 1 0 000 2zm5-1a1 1 0 11-2 0 1 1 0 012 0zm3 1a1 1 0 100-2 1 1 0 000 2z",fill:"#0067C5"})}),jsxRuntimeExports.jsx("circle",{opacity:"1",fill:"#c30000",cx:"30",cy:"10",r:"10"}),jsxRuntimeExports.jsx("text",{x:V,y:"14.4",fill:"#fff",opacity:"1",children:C})]}),jsxRuntimeExports.jsx("div",{className:"sr-only",children:"Aktiviteten har en dialog"})]})}function DialogIkon(T){const{antallUleste:C,classNameUtenUleste:$,classNameMedUleste:V}=T;return C===0?jsxRuntimeExports.jsx(DialogIkonUtenUleste,{className:$}):jsxRuntimeExports.jsx(DialogIkonMedUleste,{antallUleste:C,className:V})}const AvtaltMarkering=T=>{const{hidden:C}=T;return C?null:jsxRuntimeExports.jsx(Tag$1,{variant:"alt3-filled",size:"small",children:"Avtalt med NAV"})},UlestMarkering=T=>{const{hidden:C}=T;return C?null:jsxRuntimeExports.jsx(CustomAlertstripe,{tekst:"Ulest"})};var ForhaandsorienteringType=(T=>(T.SEND_STANDARD="SEND_FORHAANDSORIENTERING",T.SEND_PARAGRAF_11_9="SEND_PARAGRAF_11_9",T.IKKE_SEND="IKKE_SEND_FORHAANDSORIENTERING",T))(ForhaandsorienteringType||{});const getForhaandsorienteringText=T=>{switch(T.forhaandsorienteringType){case ForhaandsorienteringType.SEND_STANDARD:return T.avtaltText;case ForhaandsorienteringType.SEND_PARAGRAF_11_9:return T.avtaltText119;case ForhaandsorienteringType.IKKE_SEND:return"";default:throw new Error("Ukjent avtalttype")}},AVTALT_TEKST="Det er viktig at du gjennomfører denne aktiviteten med NAV. Gjør du ikke det, kan det medføre at stønaden du mottar fra NAV bortfaller for en periode eller stanses. Hvis du ikke kan gjennomføre aktiviteten, ber vi deg ta kontakt med veilederen din så snart som mulig.",AVTALT_TEKST_119="Du kan få redusert utbetaling av arbeidsavklaringspenger med én stønadsdag hvis du lar være å [komme på møtet vi har innkalt deg til [dato]/ møte på … /levere ... innen [dato]] uten rimelig grunn. Dette går fram av folketrygdloven § 11-9.",skalMarkereForhaandsorienteringSomLest=(T,C)=>{if(C===void 0)return!1;const $=C==null?void 0:C.forhaandsorientering,V=isVeilarbAktivitet(C)?!C.historisk:!0;return!!($!=null&&$.type)&&!$.lestDato&&$.type!==ForhaandsorienteringType.IKKE_SEND&&T&&V&&(C==null?void 0:C.status)!==AktivitetStatus.FULLFOERT&&(C==null?void 0:C.status)!==AktivitetStatus.AVBRUTT},UlestAvtaltMarkering=T=>{const{aktivitet:C}=T,$=useSelector(selectErBruker),V=skalMarkereForhaandsorienteringSomLest($,C);return!V&&!C.avtalt?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(UlestMarkering,{hidden:!V}),jsxRuntimeExports.jsx(AvtaltMarkering,{hidden:!C.avtalt})]})},AktivitetskortTillegg=({aktivitet:T})=>{const{avtalt:C,etikett:$}=T,V=useSelector(selectDialogForAktivitetId(T.id),shallowEqual$1),K=V?V.henvendelser:[],Y=K.filter(oe=>!oe.lest).length,re=T.type===VeilarbAktivitetType.SAMTALEREFERAT_TYPE||T.type===VeilarbAktivitetType.MOTE_TYPE?SkalIkkeDeltFerdigMarkeringVises(T):!1,ne=T.type===VeilarbAktivitetType.STILLING_FRA_NAV_TYPE,te=ne?SkalDelCvIkkeSvartVises(T):!1,se=ne?T.stillingFraNavData.soknadsstatus:void 0,ae=T.type===VeilarbAktivitetType.EKSTERN_AKTIVITET_TYPE?T.eksternAktivitet.etiketter:void 0;return C||$||V||re||te||se||ae?jsxRuntimeExports.jsxs("div",{className:"flex justify-between mt-2 w-full",children:[jsxRuntimeExports.jsxs("div",{children:[te?jsxRuntimeExports.jsx(DelCvIkkeSvart,{}):null,jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-y-1 items-start",children:[jsxRuntimeExports.jsx(UlestAvtaltMarkering,{aktivitet:T}),re?jsxRuntimeExports.jsx(IkkeDeltFerdigMarkering,{}):null,T.type===STILLING_AKTIVITET_TYPE?jsxRuntimeExports.jsx(StillingEtikett,{aktivitet:T}):null,isArenaAktivitet(T)?jsxRuntimeExports.jsx(TiltakEtikett,{aktivitet:T}):null,se?jsxRuntimeExports.jsx(StillingFraNavEtikett,{soknadsstatus:se}):null,T.type===VeilarbAktivitetType.EKSTERN_AKTIVITET_TYPE?jsxRuntimeExports.jsx(EksterneEtiketter,{aktivitet:T}):null]})]}),jsxRuntimeExports.jsx(div$1,{hidden:!V&&K.length<=0,className:"h-0 self-end",children:jsxRuntimeExports.jsx(DialogIkon,{antallUleste:Y,classNameMedUleste:styles$4.dialogIkonMedUleste,classNameUtenUleste:styles$4.dialogIkonUtenUleste})})]}):null};function Aktivitetskorttittel({aktivitet:T,harEndring:C,id:$}){return jsxRuntimeExports.jsxs("div",{className:"flex items-baseline",children:[jsxRuntimeExports.jsx(NotifikasjonMarkering,{visible:C}),jsxRuntimeExports.jsx(Heading,{level:"3",id:$,size:"xsmall",children:T.tittel})]})}const Aktivitetstype=({aktivitet:T})=>jsxRuntimeExports.jsx(Detail,{as:"p",className:styles$4.type,"data-testid":T.type,children:getAktivitetType(T)});function Arbeidsgiver({aktivitet:T}){const{arbeidsgiver:C}=T;return C?jsxRuntimeExports.jsx(BodyShort,{children:C}):null}function SokeAvtaleAntall({aktivitet:T}){const{antallStillingerSokes:C,antallStillingerIUken:$}=T;return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs(VisibleIfDiv$1,{visible:!!C&&C>0,children:["Antall søknader i perioden ",C]}),jsxRuntimeExports.jsxs(VisibleIfDiv$1,{visible:!!$&&$>0,children:["Antall søknader i uken ",$]})]})}const prefixAktivtetskortId=T=>`aktivitetskort-${T.id}`,Aktivitetskort=T=>{var he;const{aktivitet:C,className:$}=T,{id:V,type:K}=C,Y=useAppDispatch(),J=useSelector(selectLestAktivitetsplan,shallowEqual$1),re=useSelector(selectLestStatus),te=!useSelector(selectAktiviteterSomHarBlittVist,shallowEqual$1).find(me=>C.id===me.id),se=C.id===((he=useSelector(selectSistVisteAktivitet))==null?void 0:he.id),ie=useSelector(selectIdentitetData,shallowEqual$1),ae=re===Status.OK&&isVeilarbAktivitet(C)&&erNyEndringIAktivitet(C,J,ie)&&te,{aktivitetRoute:oe}=useRoutes(),le=`aktivitetskort__header__${V}`,ce=`aktivitetskort__dato__${V}`,de=`${getAktivitetType(C)}: ${C.tittel}`;return jsxRuntimeExports.jsx(LinkAsDiv,{id:prefixAktivtetskortId(C),className:classNames("rounded-md",styles$4.aktivitetskort,$,{[styles$4.sistVist]:se,"border-gray-400 border":!se}),to:oe(V),ariaLabel:de,onClick:()=>Y(settAktivitetSomVist(C)),children:jsxRuntimeExports.jsxs("article",{children:[jsxRuntimeExports.jsx(Aktivitetstype,{aktivitet:C}),jsxRuntimeExports.jsx(Aktivitetskorttittel,{id:le,aktivitet:C,harEndring:ae}),K===VeilarbAktivitetType.STILLING_AKTIVITET_TYPE?jsxRuntimeExports.jsx(Arbeidsgiver,{aktivitet:C}):null,jsxRuntimeExports.jsx(AktiviteskortPeriodeVisning,{id:ce,aktivitet:C}),K===VeilarbAktivitetType.SOKEAVTALE_AKTIVITET_TYPE?jsxRuntimeExports.jsx(SokeAvtaleAntall,{aktivitet:C}):null,jsxRuntimeExports.jsx(AktivitetskortTillegg,{aktivitet:C})]})})},useIsVisible=T=>{const[C,$]=reactExports.useState(!1),V=new IntersectionObserver(([K])=>$(K.isIntersecting));return reactExports.useEffect(()=>{if(T)return V.observe(T),()=>{V.disconnect()}},[]),C};function erDroppbar(T,C,$){const{type:V,status:K,nesteStatus:Y}=T,J=isArenaAktivitet(T),re=V===VeilarbAktivitetType.EKSTERN_AKTIVITET_TYPE,ne=J?!1:T.historisk,te=[AktivitetStatus.FULLFOERT,AktivitetStatus.AVBRUTT].includes(K),se=[SAMTALEREFERAT_TYPE,MOTE_TYPE].includes(V)&&C;return $&&!Y&&!ne&&!te&&!J&&!se&&!re}const DROP_TYPE="AktivitetsKort";function DropTargetKolonne({status:T,children:C}){const $=useAppDispatch(),V=useNavigate(),K=useSelector(selectErBruker,shallowEqual$1),Y=useSelector(selectErUnderOppfolging,shallowEqual$1),J=useSelector(selectDraggingAktivitet,shallowEqual$1),{avbrytAktivitetRoute:re,fullforAktivitetRoute:ne}=useRoutes(),[te,se]=useDrop({accept:DROP_TYPE,canDrop:({aktivitet:oe})=>T!==oe.status&&erDroppbar(oe,K,Y),drop:({aktivitet:oe})=>{flyttetAktivitetMetrikk("dragAndDrop",oe,T),T===AktivitetStatus.FULLFOERT?V(ne(oe.id)):T===AktivitetStatus.AVBRUTT?V(re(oe.id)):$(flyttAktivitet({aktivitet:oe,status:T}))},collect:oe=>({canDrop:oe.canDrop(),isOver:oe.isOver()})}),ie=!!J,ae=te.canDrop&&te.isOver;return jsxRuntimeExports.jsx("div",{ref:se,className:"z-50 h-full",children:jsxRuntimeExports.jsx("div",{className:classNames("bg-bg-subtle border-t border-border-divider rounded-none p-4 sm:p-4 lg:p-2 m-0 sm:border-t-0 sm:rounded-md aktivitetstavle__kolonne",{"opacity-50":ie&&!ae,"bg-surface-action-subtle-hover ":ae}),children:C})})}function DragbartAktivitetskort(T){const{aktivitet:C}=T,$=useAppDispatch(),[V,K]=useDrag({type:DROP_TYPE,item:()=>(setTimeout(()=>$(startDragging(C))),{aktivitet:C,type:DROP_TYPE}),end:()=>$(stopDragging()),collect:J=>({isDragging:J.isDragging()})}),Y=classNames(V.isDragging&&styles$4.drag,styles$4.flyttbar);return jsxRuntimeExports.jsx("div",{ref:K,children:jsxRuntimeExports.jsx(Aktivitetskort,{aktivitet:C,className:Y})})}const hjelpetekster={BRUKER_ER_INTERESSERT:{tittel:"Informasjon om statusen Forslag",innhold:'Her kan du legge til en aktivitet du tror du kommer til å gjøre. Dra aktiviteten til "Planlegger" når du bestemmer deg for å gjøre aktiviteten.'},PLANLAGT:{tittel:"Informasjon om statusen Planlegger",innhold:'Her kan du legge til en aktivitet du tror du kommer til å gjøre. Dra aktiviteten til "Planlegger" når du bestemmer deg for å gjøre aktiviteten.'},GJENNOMFORES:{tittel:"Informasjon om statusen Gjennomfører",innhold:'Aktiviteter som du holder på med, kan du sette til "Gjennomfører".'},FULLFORT:{tittel:"Informasjon om statusen Fullført",innhold:'Dra aktiviteter hit som du er ferdig med. Flytter du en aktivitet til "Fullført", blir den låst og kan ikke redigeres. Hvis du angrer, kan du legge til en ny aktivitet.'},AVBRUTT:{tittel:"Informasjon om statusen Avbrutt",innhold:'Dra aktiviteter hit som du avslutter eller ikke begynner på. Flytter du en aktivitet til "Avbrutt", blir den låst og kan ikke redigeres. Hvis du angrer, kan du legge til en ny aktivitet.'}},AktivitetsplanHjelpetekst=({status:T})=>{const C=hjelpetekster[T],{tittel:$,innhold:V}=C;return jsxRuntimeExports.jsx(HelpText$1,{placement:"bottom-end",id:T,"aria-label":$,title:$,onClick:()=>logKlikkKnapp("Klikket hjelpeikon i kolonne "+T),children:jsxRuntimeExports.jsx("div",{className:"w-80",children:V})})},KolonneHeader=T=>{const{status:C}=T;return jsxRuntimeExports.jsxs("div",{className:"flex justify-between pb-2",children:[jsxRuntimeExports.jsx(Heading,{className:"text-left",level:"2",size:"small",children:aktivitetStatusMap[C]}),jsxRuntimeExports.jsx(AktivitetsplanHjelpetekst,{status:C})]})},Kolonne=({status:T})=>{const C=useSelector(selectAktivitetListe,shallowEqual$1),V=sorterAktiviteter(C,T).map(K=>jsxRuntimeExports.jsx(DragbartAktivitetskort,{aktivitet:K},K.id));return jsxRuntimeExports.jsxs(DropTargetKolonne,{status:T,children:[jsxRuntimeExports.jsx(KolonneHeader,{status:T}),V]})};var Collapse$2={};function _typeof$1(T){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof$1=function($){return typeof $}:_typeof$1=function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},_typeof$1(T)}Object.defineProperty(Collapse$2,"__esModule",{value:!0});Collapse$2.Collapse=void 0;var _react$2=_interopRequireDefault$2(reactExports);function _interopRequireDefault$2(T){return T&&T.__esModule?T:{default:T}}function _classCallCheck$1(T,C){if(!(T instanceof C))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1(T,C){for(var $=0;$"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf$1(T){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf:function($){return $.__proto__||Object.getPrototypeOf($)},_getPrototypeOf$1(T)}function _defineProperty$1(T,C,$){return C in T?Object.defineProperty(T,C,{value:$,enumerable:!0,configurable:!0,writable:!0}):T[C]=$,T}var Collapse$1=function(T){_inherits$1($,T);var C=_createSuper$1($);function $(V){var K;return _classCallCheck$1(this,$),K=C.call(this,V),_defineProperty$1(_assertThisInitialized$1(K),"timeout",void 0),_defineProperty$1(_assertThisInitialized$1(K),"container",void 0),_defineProperty$1(_assertThisInitialized$1(K),"content",void 0),_defineProperty$1(_assertThisInitialized$1(K),"onResize",function(){if(clearTimeout(K.timeout),!(!K.container||!K.content)){var Y=K.props,J=Y.isOpened,re=Y.checkTimeout,ne=Math.floor(K.container.clientHeight),te=Math.floor(K.content.clientHeight),se=J&&Math.abs(te-ne)<=1,ie=!J&&Math.abs(ne)<=1;se||ie?K.onRest({isFullyOpened:se,isFullyClosed:ie,isOpened:J,containerHeight:ne,contentHeight:te}):(K.onWork({isFullyOpened:se,isFullyClosed:ie,isOpened:J,containerHeight:ne,contentHeight:te}),K.timeout=setTimeout(function(){return K.onResize()},re))}}),_defineProperty$1(_assertThisInitialized$1(K),"onRest",function(Y){var J=Y.isFullyOpened,re=Y.isFullyClosed,ne=Y.isOpened,te=Y.containerHeight,se=Y.contentHeight;if(!(!K.container||!K.content)){var ie=ne&&K.container.style.height==="".concat(se,"px"),ae=!ne&&K.container.style.height==="0px";if(ie||ae){K.container.style.overflow=ne?"initial":"hidden",K.container.style.height=ne?"auto":"0px";var oe=K.props.onRest;oe&&oe({isFullyOpened:J,isFullyClosed:re,isOpened:ne,containerHeight:te,contentHeight:se})}}}),_defineProperty$1(_assertThisInitialized$1(K),"onWork",function(Y){var J=Y.isFullyOpened,re=Y.isFullyClosed,ne=Y.isOpened,te=Y.containerHeight,se=Y.contentHeight;if(!(!K.container||!K.content)){var ie=ne&&K.container.style.height==="".concat(se,"px"),ae=!ne&&K.container.style.height==="0px";if(!(ie||ae)){K.container.style.overflow="hidden",K.container.style.height=ne?"".concat(se,"px"):"0px";var oe=K.props.onWork;oe&&oe({isFullyOpened:J,isFullyClosed:re,isOpened:ne,containerHeight:te,contentHeight:se})}}}),_defineProperty$1(_assertThisInitialized$1(K),"onRefContainer",function(Y){K.container=Y}),_defineProperty$1(_assertThisInitialized$1(K),"onRefContent",function(Y){K.content=Y}),V.initialStyle?K.initialStyle=V.initialStyle:K.initialStyle=V.isOpened?{height:"auto",overflow:"initial"}:{height:"0px",overflow:"hidden"},K}return _createClass$1($,[{key:"componentDidMount",value:function(){this.onResize()}},{key:"shouldComponentUpdate",value:function(K){var Y=this.props,J=Y.theme,re=Y.isOpened,ne=Y.children;return ne!==K.children||re!==K.isOpened||Object.keys(J).some(function(te){return J[te]!==K.theme[te]})}},{key:"getSnapshotBeforeUpdate",value:function(){if(!this.container||!this.content)return null;if(this.container.style.height==="auto"){var K=this.content.clientHeight;this.container.style.height="".concat(K,"px")}return null}},{key:"componentDidUpdate",value:function(){this.onResize()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timeout)}},{key:"render",value:function(){var K=this.props,Y=K.theme,J=K.children,re=K.isOpened;return _react$2.default.createElement("div",{ref:this.onRefContainer,className:Y.collapse,style:this.initialStyle,"aria-hidden":!re},_react$2.default.createElement("div",{ref:this.onRefContent,className:Y.content},J))}}]),$}(_react$2.default.Component);Collapse$2.Collapse=Collapse$1;_defineProperty$1(Collapse$1,"defaultProps",{theme:{collapse:"ReactCollapse--collapse",content:"ReactCollapse--content"},initialStyle:void 0,onRest:void 0,onWork:void 0,checkTimeout:50});var UnmountClosed$2={};function _typeof(T){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_typeof=function($){return typeof $}:_typeof=function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},_typeof(T)}Object.defineProperty(UnmountClosed$2,"__esModule",{value:!0});UnmountClosed$2.UnmountClosed=void 0;var _react$1=_interopRequireDefault$1(reactExports),_Collapse=Collapse$2,_excluded=["isOpened"],_excluded2=["isOpened"];function _interopRequireDefault$1(T){return T&&T.__esModule?T:{default:T}}function _extends$1(){return _extends$1=Object.assign||function(T){for(var C=1;C=0)&&Object.prototype.propertyIsEnumerable.call(T,V)&&($[V]=T[V])}return $}function _objectWithoutPropertiesLoose(T,C){if(T==null)return{};var $={},V=Object.keys(T),K,Y;for(Y=0;Y=0)&&($[K]=T[K]);return $}function _classCallCheck(T,C){if(!(T instanceof C))throw new TypeError("Cannot call a class as a function")}function _defineProperties(T,C){for(var $=0;$"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _getPrototypeOf(T){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function($){return $.__proto__||Object.getPrototypeOf($)},_getPrototypeOf(T)}function _defineProperty(T,C,$){return C in T?Object.defineProperty(T,C,{value:$,enumerable:!0,configurable:!0,writable:!0}):T[C]=$,T}var UnmountClosed$1=function(T){_inherits($,T);var C=_createSuper($);function $(V){var K;return _classCallCheck(this,$),K=C.call(this,V),_defineProperty(_assertThisInitialized(K),"onWork",function(Y){var J=Y.isOpened,re=_objectWithoutProperties$1(Y,_excluded);K.setState({isResting:!1,isOpened:J});var ne=K.props.onWork;ne&&ne(_objectSpread({isOpened:J},re))}),_defineProperty(_assertThisInitialized(K),"onRest",function(Y){var J=Y.isOpened,re=_objectWithoutProperties$1(Y,_excluded2);K.setState({isResting:!0,isOpened:J,isInitialRender:!1});var ne=K.props.onRest;ne&&ne(_objectSpread({isOpened:J},re))}),_defineProperty(_assertThisInitialized(K),"getInitialStyle",function(){var Y=K.state,J=Y.isOpened,re=Y.isInitialRender;return re?J?{height:"auto",overflow:"initial"}:{height:"0px",overflow:"hidden"}:{height:"0px",overflow:"hidden"}}),K.state={isResting:!0,isOpened:V.isOpened,isInitialRender:!0},K}return _createClass($,[{key:"componentDidUpdate",value:function(K){var Y=this.props.isOpened;K.isOpened!==Y&&this.setState({isResting:!1,isOpened:Y,isInitialRender:!1})}},{key:"render",value:function(){var K=this.state,Y=K.isResting,J=K.isOpened;return Y&&!J?null:_react$1.default.createElement(_Collapse.Collapse,_extends$1({},this.props,{initialStyle:this.getInitialStyle(),onWork:this.onWork,onRest:this.onRest}))}}]),$}(_react$1.default.PureComponent);UnmountClosed$2.UnmountClosed=UnmountClosed$1;_defineProperty(UnmountClosed$1,"defaultProps",{onWork:void 0,onRest:void 0});var _require=Collapse$2,Collapse=_require.Collapse,_require2=UnmountClosed$2,UnmountClosed=_require2.UnmountClosed,lib$1=UnmountClosed;UnmountClosed.Collapse=Collapse;UnmountClosed.UnmountClosed=UnmountClosed;const invertedLesMer="_invertedLesMer_1ppb9_1",toggle="_toggle_1ppb9_4",style$1={invertedLesMer,toggle},InvertedLestMer=T=>{const[C,$]=reactExports.useState(!1),V=()=>{C?T.onClose&&T.onClose():T.onOpen&&T.onOpen(),$(!C)},{apneTekst:K,lukkTekst:Y,hidden:J,children:re}=T;return J?null:jsxRuntimeExports.jsxs("div",{className:style$1.invertedLesMer,children:[jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(ReadMore$1,{open:C,onClick:V,header:C?Y:K,children:null})}),jsxRuntimeExports.jsx(lib$1.Collapse,{isOpened:C,children:C?re:null})]})},LOGGING_VISELDREAKITIVITETER="aktivitetsplan.viseldreaktiviter",LOGGING_SKJULELDREAKTIVITETER="aktivitetsplan.skjuleldreaktiviter",SkjulEldreAktiviteterFraKolonne=T=>{const C=useErVeileder(),$=T.aktiviteteterTilDatoMerEnnToManederSiden,V=$.length===0,{aktivitetTekst:K}=T,Y=$.map(J=>jsxRuntimeExports.jsx(DragbartAktivitetskort,{aktivitet:J},J.id));return jsxRuntimeExports.jsx(InvertedLestMer,{hidden:V,onOpen:()=>loggEvent(LOGGING_VISELDREAKITIVITETER,{erVeileder:C}),onClose:()=>loggEvent(LOGGING_SKJULELDREAKTIVITETER,{erVeileder:C}),apneTekst:`Vis ${K}`,lukkTekst:`Skjul ${K}`,children:Y})},KolonneSomSkjulerEldreAktiviteter=({status:T})=>{const C=useSelector(selectAktivitetListe,shallowEqual$1),$=sorterAktiviteter(C,T),{nyereAktiviteter:V,eldreAktiviteter:K}=splitIEldreOgNyereAktiviteter($),Y=V.map(re=>jsxRuntimeExports.jsx(DragbartAktivitetskort,{aktivitet:re},re.id)),J=T===AktivitetStatus.FULLFOERT?"eldre fullførte aktiviteter":"eldre avbrutte aktiviteter";return jsxRuntimeExports.jsxs(DropTargetKolonne,{status:T,children:[jsxRuntimeExports.jsx(KolonneHeader,{status:T}),jsxRuntimeExports.jsxs("div",{children:[Y,jsxRuntimeExports.jsx(SkjulEldreAktiviteterFraKolonne,{aktivitetTekst:J,aktiviteteterTilDatoMerEnnToManederSiden:K})]})]})};var lib={},Scrollbars={},raf$1={exports:{}},performanceNow={exports:{}};(function(){var T,C,$,V,K,Y;typeof performance<"u"&&performance!==null&&performance.now?performanceNow.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(performanceNow.exports=function(){return(T()-K)/1e6},C=process.hrtime,T=function(){var J;return J=C(),J[0]*1e9+J[1]},V=T(),Y=process.uptime()*1e9,K=V-Y):Date.now?(performanceNow.exports=function(){return Date.now()-$},$=Date.now()):(performanceNow.exports=function(){return new Date().getTime()-$},$=new Date().getTime())}).call(commonjsGlobal);var performanceNowExports=performanceNow.exports,now=performanceNowExports,root=typeof window>"u"?commonjsGlobal:window,vendors=["moz","webkit"],suffix="AnimationFrame",raf=root["request"+suffix],caf=root["cancel"+suffix]||root["cancelRequest"+suffix];for(var i$1=0;!raf&&i$1=0;K--){var Y=prefixes[K]+V;if(Y in $)return Y}return!1},toNoCase_1=toNoCase,hasSpace=/\s/,hasSeparator=/(_|-|\.|:)/,hasCamel=/([a-z][A-Z]|[A-Z][a-z])/;function toNoCase(T){return hasSpace.test(T)?T.toLowerCase():hasSeparator.test(T)?(unseparate(T)||T).toLowerCase():hasCamel.test(T)?uncamelize(T).toLowerCase():T.toLowerCase()}var separatorSplitter=/[\W_]+(.|$)/g;function unseparate(T){return T.replace(separatorSplitter,function(C,$){return $?" "+$:""})}var camelSplitter=/(.)([A-Z]+)/g;function uncamelize(T){return T.replace(camelSplitter,function(C,$,V){return $+" "+V.toLowerCase().split("").join(" ")})}var clean=toNoCase_1,toSpaceCase_1=toSpaceCase;function toSpaceCase(T){return clean(T).replace(/[\W_]+(.|$)/g,function(C,$){return $?" "+$:""}).trim()}var space=toSpaceCase_1,toCamelCase_1=toCamelCase$1;function toCamelCase$1(T){return space(T).replace(/\s(\w)/g,function(C,$){return $.toUpperCase()})}var IS_UNITLESS={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,stopOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0},addPxToStyle$1=function(T,C){return typeof C=="number"&&!IS_UNITLESS[T]?C+"px":C},prefix$1=prefixStyle,toCamelCase=toCamelCase_1,cache={float:"cssFloat"},addPxToStyle=addPxToStyle$1;function style(T,C,$){var V=cache[C];if(typeof V>"u"&&(V=detect(C)),V){if($===void 0)return T.style[V];T.style[V]=addPxToStyle(V,$)}}function each(T,C){for(var $ in C)C.hasOwnProperty($)&&style(T,$,C[$])}function detect(T){var C=toCamelCase(T),$=prefix$1(C);return cache[C]=cache[T]=cache[$]=$,$}function set$1(){arguments.length===2?typeof arguments[1]=="string"?arguments[0].style.cssText=arguments[1]:each(arguments[0],arguments[1]):style(arguments[0],arguments[1],arguments[2])}domCss.exports=set$1;domCss.exports.set=set$1;domCss.exports.get=function(T,C){return Array.isArray(C)?C.reduce(function($,V){return $[V]=style(T,V||""),$},{}):style(T,C||"")};var domCssExports=domCss.exports,isString$2={};(function(T){Object.defineProperty(T,"__esModule",{value:!0}),T.default=C;function C($){return typeof $=="string"}})(isString$2);var getScrollbarWidth={};(function(T){Object.defineProperty(T,"__esModule",{value:!0}),T.default=Y;var C=domCssExports,$=V(C);function V(J){return J&&J.__esModule?J:{default:J}}var K=!1;function Y(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(J&&K!==!1)return K;if(typeof document<"u"){var re=document.createElement("div");(0,$.default)(re,{width:100,height:100,position:"absolute",top:-9999,overflow:"scroll",MsOverflowStyle:"scrollbar"}),document.body.appendChild(re),K=re.offsetWidth-re.clientWidth,document.body.removeChild(re)}else K=0;return K||0}})(getScrollbarWidth);var returnFalse={};(function(T){Object.defineProperty(T,"__esModule",{value:!0}),T.default=C;function C(){return!1}})(returnFalse);var getInnerWidth={};(function(T){Object.defineProperty(T,"__esModule",{value:!0}),T.default=C;function C($){var V=$.clientWidth,K=getComputedStyle($),Y=K.paddingLeft,J=K.paddingRight;return V-parseFloat(Y)-parseFloat(J)}})(getInnerWidth);var getInnerHeight={};(function(T){Object.defineProperty(T,"__esModule",{value:!0}),T.default=C;function C($){var V=$.clientHeight,K=getComputedStyle($),Y=K.paddingTop,J=K.paddingBottom;return V-parseFloat(Y)-parseFloat(J)}})(getInnerHeight);var styles$3={};Object.defineProperty(styles$3,"__esModule",{value:!0});styles$3.containerStyleDefault={position:"relative",overflow:"hidden",width:"100%",height:"100%"};styles$3.containerStyleAutoHeight={height:"auto"};styles$3.viewStyleDefault={position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"scroll",WebkitOverflowScrolling:"touch"};styles$3.viewStyleAutoHeight={position:"relative",top:void 0,left:void 0,right:void 0,bottom:void 0};styles$3.viewStyleUniversalInitial={overflow:"hidden",marginRight:0,marginBottom:0};styles$3.trackHorizontalStyleDefault={position:"absolute",height:6};styles$3.trackVerticalStyleDefault={position:"absolute",width:6};styles$3.thumbHorizontalStyleDefault={position:"relative",display:"block",height:"100%"};styles$3.thumbVerticalStyleDefault={position:"relative",display:"block",width:"100%"};styles$3.disableSelectStyle={userSelect:"none"};styles$3.disableSelectStyleReset={userSelect:""};var defaultRenderElements={};Object.defineProperty(defaultRenderElements,"__esModule",{value:!0});var _extends=Object.assign||function(T){for(var C=1;C=0||Object.prototype.hasOwnProperty.call(T,V)&&($[V]=T[V]);return $}function renderViewDefault(T){return _react2.default.createElement("div",T)}function renderTrackHorizontalDefault(T){var C=T.style,$=_objectWithoutProperties(T,["style"]),V=_extends({},C,{right:2,bottom:2,left:2,borderRadius:3});return _react2.default.createElement("div",_extends({style:V},$))}function renderTrackVerticalDefault(T){var C=T.style,$=_objectWithoutProperties(T,["style"]),V=_extends({},C,{right:2,bottom:2,top:2,borderRadius:3});return _react2.default.createElement("div",_extends({style:V},$))}function renderThumbHorizontalDefault(T){var C=T.style,$=_objectWithoutProperties(T,["style"]),V=_extends({},C,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return _react2.default.createElement("div",_extends({style:V},$))}function renderThumbVerticalDefault(T){var C=T.style,$=_objectWithoutProperties(T,["style"]),V=_extends({},C,{cursor:"pointer",borderRadius:"inherit",backgroundColor:"rgba(0,0,0,.2)"});return _react2.default.createElement("div",_extends({style:V},$))}(function(T){Object.defineProperty(T,"__esModule",{value:!0});var C=Object.assign||function(Le){for(var Ke=1;Ke=0||Object.prototype.hasOwnProperty.call(Le,Ie)&&(Se[Ie]=Le[Ie]);return Se}function De(Le,Ke){if(!(Le instanceof Ke))throw new TypeError("Cannot call a class as a function")}function xe(Le,Ke){if(!Le)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ke&&(typeof Ke=="object"||typeof Ke=="function")?Ke:Le}function Ce(Le,Ke){if(typeof Ke!="function"&&Ke!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof Ke);Le.prototype=Object.create(Ke&&Ke.prototype,{constructor:{value:Le,enumerable:!1,writable:!0,configurable:!0}}),Ke&&(Object.setPrototypeOf?Object.setPrototypeOf(Le,Ke):Le.__proto__=Ke)}var je=function(Le){Ce(Ke,Le);function Ke(Se){var Ie;De(this,Ke);for(var Ne=arguments.length,pt=Array(Ne>1?Ne-1:0),at=1;at0&&arguments[0]!==void 0?arguments[0]:0;this.view&&(this.view.scrollLeft=Ie)}},{key:"scrollTop",value:function(){var Ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.view&&(this.view.scrollTop=Ie)}},{key:"scrollToLeft",value:function(){this.view&&(this.view.scrollLeft=0)}},{key:"scrollToTop",value:function(){this.view&&(this.view.scrollTop=0)}},{key:"scrollToRight",value:function(){this.view&&(this.view.scrollLeft=this.view.scrollWidth)}},{key:"scrollToBottom",value:function(){this.view&&(this.view.scrollTop=this.view.scrollHeight)}},{key:"addListeners",value:function(){if(!(typeof document>"u"||!this.view)){var Ie=this.view,Ne=this.trackHorizontal,pt=this.trackVertical,at=this.thumbHorizontal,dt=this.thumbVertical;Ie.addEventListener("scroll",this.handleScroll),(0,oe.default)()&&(Ne.addEventListener("mouseenter",this.handleTrackMouseEnter),Ne.addEventListener("mouseleave",this.handleTrackMouseLeave),Ne.addEventListener("mousedown",this.handleHorizontalTrackMouseDown),pt.addEventListener("mouseenter",this.handleTrackMouseEnter),pt.addEventListener("mouseleave",this.handleTrackMouseLeave),pt.addEventListener("mousedown",this.handleVerticalTrackMouseDown),at.addEventListener("mousedown",this.handleHorizontalThumbMouseDown),dt.addEventListener("mousedown",this.handleVerticalThumbMouseDown),window.addEventListener("resize",this.handleWindowResize))}}},{key:"removeListeners",value:function(){if(!(typeof document>"u"||!this.view)){var Ie=this.view,Ne=this.trackHorizontal,pt=this.trackVertical,at=this.thumbHorizontal,dt=this.thumbVertical;Ie.removeEventListener("scroll",this.handleScroll),(0,oe.default)()&&(Ne.removeEventListener("mouseenter",this.handleTrackMouseEnter),Ne.removeEventListener("mouseleave",this.handleTrackMouseLeave),Ne.removeEventListener("mousedown",this.handleHorizontalTrackMouseDown),pt.removeEventListener("mouseenter",this.handleTrackMouseEnter),pt.removeEventListener("mouseleave",this.handleTrackMouseLeave),pt.removeEventListener("mousedown",this.handleVerticalTrackMouseDown),at.removeEventListener("mousedown",this.handleHorizontalThumbMouseDown),dt.removeEventListener("mousedown",this.handleVerticalThumbMouseDown),window.removeEventListener("resize",this.handleWindowResize),this.teardownDragging())}}},{key:"handleScroll",value:function(Ie){var Ne=this,pt=this.props,at=pt.onScroll,dt=pt.onScrollFrame;at&&at(Ie),this.update(function(Ct){var ut=Ct.scrollLeft,bt=Ct.scrollTop;Ne.viewScrollLeft=ut,Ne.viewScrollTop=bt,dt&&dt(Ct)}),this.detectScrolling()}},{key:"handleScrollStart",value:function(){var Ie=this.props.onScrollStart;Ie&&Ie(),this.handleScrollStartAutoHide()}},{key:"handleScrollStartAutoHide",value:function(){var Ie=this.props.autoHide;Ie&&this.showTracks()}},{key:"handleScrollStop",value:function(){var Ie=this.props.onScrollStop;Ie&&Ie(),this.handleScrollStopAutoHide()}},{key:"handleScrollStopAutoHide",value:function(){var Ie=this.props.autoHide;Ie&&this.hideTracks()}},{key:"handleWindowResize",value:function(){(0,oe.default)(!1),this.forceUpdate()}},{key:"handleHorizontalTrackMouseDown",value:function(Ie){Ie.preventDefault();var Ne=Ie.target,pt=Ie.clientX,at=Ne.getBoundingClientRect(),dt=at.left,Ct=this.getThumbHorizontalWidth(),ut=Math.abs(dt-pt)-Ct/2;this.view.scrollLeft=this.getScrollLeftForOffset(ut)}},{key:"handleVerticalTrackMouseDown",value:function(Ie){Ie.preventDefault();var Ne=Ie.target,pt=Ie.clientY,at=Ne.getBoundingClientRect(),dt=at.top,Ct=this.getThumbVerticalHeight(),ut=Math.abs(dt-pt)-Ct/2;this.view.scrollTop=this.getScrollTopForOffset(ut)}},{key:"handleHorizontalThumbMouseDown",value:function(Ie){Ie.preventDefault(),this.handleDragStart(Ie);var Ne=Ie.target,pt=Ie.clientX,at=Ne.offsetWidth,dt=Ne.getBoundingClientRect(),Ct=dt.left;this.prevPageX=at-(pt-Ct)}},{key:"handleVerticalThumbMouseDown",value:function(Ie){Ie.preventDefault(),this.handleDragStart(Ie);var Ne=Ie.target,pt=Ie.clientY,at=Ne.offsetHeight,dt=Ne.getBoundingClientRect(),Ct=dt.top;this.prevPageY=at-(pt-Ct)}},{key:"setupDragging",value:function(){(0,J.default)(document.body,ye.disableSelectStyle),document.addEventListener("mousemove",this.handleDrag),document.addEventListener("mouseup",this.handleDragEnd),document.onselectstart=ce.default}},{key:"teardownDragging",value:function(){(0,J.default)(document.body,ye.disableSelectStyleReset),document.removeEventListener("mousemove",this.handleDrag),document.removeEventListener("mouseup",this.handleDragEnd),document.onselectstart=void 0}},{key:"handleDragStart",value:function(Ie){this.dragging=!0,Ie.stopImmediatePropagation(),this.setupDragging()}},{key:"handleDrag",value:function(Ie){if(this.prevPageX){var Ne=Ie.clientX,pt=this.trackHorizontal.getBoundingClientRect(),at=pt.left,dt=this.getThumbHorizontalWidth(),Ct=dt-this.prevPageX,ut=-at+Ne-Ct;this.view.scrollLeft=this.getScrollLeftForOffset(ut)}if(this.prevPageY){var bt=Ie.clientY,Re=this.trackVertical.getBoundingClientRect(),ue=Re.top,be=this.getThumbVerticalHeight(),ve=be-this.prevPageY,we=-ue+bt-ve;this.view.scrollTop=this.getScrollTopForOffset(we)}return!1}},{key:"handleDragEnd",value:function(){this.dragging=!1,this.prevPageX=this.prevPageY=0,this.teardownDragging(),this.handleDragEndAutoHide()}},{key:"handleDragEndAutoHide",value:function(){var Ie=this.props.autoHide;Ie&&this.hideTracks()}},{key:"handleTrackMouseEnter",value:function(){this.trackMouseOver=!0,this.handleTrackMouseEnterAutoHide()}},{key:"handleTrackMouseEnterAutoHide",value:function(){var Ie=this.props.autoHide;Ie&&this.showTracks()}},{key:"handleTrackMouseLeave",value:function(){this.trackMouseOver=!1,this.handleTrackMouseLeaveAutoHide()}},{key:"handleTrackMouseLeaveAutoHide",value:function(){var Ie=this.props.autoHide;Ie&&this.hideTracks()}},{key:"showTracks",value:function(){clearTimeout(this.hideTracksTimeout),(0,J.default)(this.trackHorizontal,{opacity:1}),(0,J.default)(this.trackVertical,{opacity:1})}},{key:"hideTracks",value:function(){var Ie=this;if(!this.dragging&&!this.scrolling&&!this.trackMouseOver){var Ne=this.props.autoHideTimeout;clearTimeout(this.hideTracksTimeout),this.hideTracksTimeout=setTimeout(function(){(0,J.default)(Ie.trackHorizontal,{opacity:0}),(0,J.default)(Ie.trackVertical,{opacity:0})},Ne)}}},{key:"detectScrolling",value:function(){var Ie=this;this.scrolling||(this.scrolling=!0,this.handleScrollStart(),this.detectScrollingInterval=setInterval(function(){Ie.lastViewScrollLeft===Ie.viewScrollLeft&&Ie.lastViewScrollTop===Ie.viewScrollTop&&(clearInterval(Ie.detectScrollingInterval),Ie.scrolling=!1,Ie.handleScrollStop()),Ie.lastViewScrollLeft=Ie.viewScrollLeft,Ie.lastViewScrollTop=Ie.viewScrollTop},100))}},{key:"raf",value:function(Ie){var Ne=this;this.requestFrame&&K.default.cancel(this.requestFrame),this.requestFrame=(0,K.default)(function(){Ne.requestFrame=void 0,Ie()})}},{key:"update",value:function(Ie){var Ne=this;this.raf(function(){return Ne._update(Ie)})}},{key:"_update",value:function(Ie){var Ne=this.props,pt=Ne.onUpdate,at=Ne.hideTracksWhenNotNeeded,dt=this.getValues();if((0,oe.default)()){var Ct=dt.scrollLeft,ut=dt.clientWidth,bt=dt.scrollWidth,Re=(0,he.default)(this.trackHorizontal),ue=this.getThumbHorizontalWidth(),be=Ct/(bt-ut)*(Re-ue),ve={width:ue,transform:"translateX("+be+"px)"},we=dt.scrollTop,_e=dt.clientHeight,Oe=dt.scrollHeight,Qe=(0,ge.default)(this.trackVertical),ct=this.getThumbVerticalHeight(),xt=we/(Oe-_e)*(Qe-ct),Tt={height:ct,transform:"translateY("+xt+"px)"};if(at){var Pt={visibility:bt>ut?"visible":"hidden"},$t={visibility:Oe>_e?"visible":"hidden"};(0,J.default)(this.trackHorizontal,Pt),(0,J.default)(this.trackVertical,$t)}(0,J.default)(this.thumbHorizontal,ve),(0,J.default)(this.thumbVertical,Tt)}pt&&pt(dt),typeof Ie=="function"&&Ie(dt)}},{key:"render",value:function(){var Ie=this,Ne=(0,oe.default)(),pt=this.props;pt.onScroll,pt.onScrollFrame,pt.onScrollStart,pt.onScrollStop,pt.onUpdate;var at=pt.renderView,dt=pt.renderTrackHorizontal,Ct=pt.renderTrackVertical,ut=pt.renderThumbHorizontal,bt=pt.renderThumbVertical,Re=pt.tagName;pt.hideTracksWhenNotNeeded;var ue=pt.autoHide;pt.autoHideTimeout;var be=pt.autoHideDuration;pt.thumbSize,pt.thumbMinSize;var ve=pt.universal,we=pt.autoHeight,_e=pt.autoHeightMin,Oe=pt.autoHeightMax,Qe=pt.style,ct=pt.children,xt=Pe(pt,["onScroll","onScrollFrame","onScrollStart","onScrollStop","onUpdate","renderView","renderTrackHorizontal","renderTrackVertical","renderThumbHorizontal","renderThumbVertical","tagName","hideTracksWhenNotNeeded","autoHide","autoHideTimeout","autoHideDuration","thumbSize","thumbMinSize","universal","autoHeight","autoHeightMin","autoHeightMax","style","children"]),Tt=this.state.didMountUniversal,Pt=C({},ye.containerStyleDefault,we&&C({},ye.containerStyleAutoHeight,{minHeight:_e,maxHeight:Oe}),Qe),$t=C({},ye.viewStyleDefault,{marginRight:Ne?-Ne:0,marginBottom:Ne?-Ne:0},we&&C({},ye.viewStyleAutoHeight,{minHeight:(0,ie.default)(_e)?"calc("+_e+" + "+Ne+"px)":_e+Ne,maxHeight:(0,ie.default)(Oe)?"calc("+Oe+" + "+Ne+"px)":Oe+Ne}),we&&ve&&!Tt&&{minHeight:_e,maxHeight:Oe},ve&&!Tt&&ye.viewStyleUniversalInitial),Ft={transition:"opacity "+be+"ms",opacity:0},Nt=C({},ye.trackHorizontalStyleDefault,ue&&Ft,(!Ne||ve&&!Tt)&&{display:"none"}),Gt=C({},ye.trackVerticalStyleDefault,ue&&Ft,(!Ne||ve&&!Tt)&&{display:"none"});return(0,re.createElement)(Re,C({},xt,{style:Pt,ref:function(yt){Ie.container=yt}}),[(0,re.cloneElement)(at({style:$t}),{key:"view",ref:function(yt){Ie.view=yt}},ct),(0,re.cloneElement)(dt({style:Nt}),{key:"trackHorizontal",ref:function(yt){Ie.trackHorizontal=yt}},(0,re.cloneElement)(ut({style:ye.thumbHorizontalStyleDefault}),{ref:function(yt){Ie.thumbHorizontal=yt}})),(0,re.cloneElement)(Ct({style:Gt}),{key:"trackVertical",ref:function(yt){Ie.trackVertical=yt}},(0,re.cloneElement)(bt({style:ye.thumbVerticalStyleDefault}),{ref:function(yt){Ie.thumbVertical=yt}}))])}}]),Ke}(re.Component);T.default=je,je.propTypes={onScroll:te.default.func,onScrollFrame:te.default.func,onScrollStart:te.default.func,onScrollStop:te.default.func,onUpdate:te.default.func,renderView:te.default.func,renderTrackHorizontal:te.default.func,renderTrackVertical:te.default.func,renderThumbHorizontal:te.default.func,renderThumbVertical:te.default.func,tagName:te.default.string,thumbSize:te.default.number,thumbMinSize:te.default.number,hideTracksWhenNotNeeded:te.default.bool,autoHide:te.default.bool,autoHideTimeout:te.default.number,autoHideDuration:te.default.number,autoHeight:te.default.bool,autoHeightMin:te.default.oneOfType([te.default.number,te.default.string]),autoHeightMax:te.default.oneOfType([te.default.number,te.default.string]),universal:te.default.bool,style:te.default.object,children:te.default.node},je.defaultProps={renderView:fe.renderViewDefault,renderTrackHorizontal:fe.renderTrackHorizontalDefault,renderTrackVertical:fe.renderTrackVerticalDefault,renderThumbHorizontal:fe.renderThumbHorizontalDefault,renderThumbVertical:fe.renderThumbVerticalDefault,tagName:"div",thumbMinSize:30,hideTracksWhenNotNeeded:!1,autoHide:!1,autoHideTimeout:1e3,autoHideDuration:200,autoHeight:!1,autoHeightMin:0,autoHeightMax:200,universal:!1}})(Scrollbars);(function(T){Object.defineProperty(T,"__esModule",{value:!0}),T.Scrollbars=void 0;var C=Scrollbars,$=V(C);function V(K){return K&&K.__esModule?K:{default:K}}T.default=$.default,T.Scrollbars=$.default})(lib);var rebound={exports:{}};(function(T,C){(function($,V){T.exports=V()})(commonjsGlobal,function(){var $=void 0;typeof window<"u"&&($=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),!$&&typeof process<"u"&&process.title==="node"&&($=setImmediate),$=$||function(ut){window.setTimeout(ut,1e3/60)};var V=$,K=Array.prototype.concat,Y=Array.prototype.slice;function J(ut,bt){for(var Re=arguments.length,ue=Array(Re>2?Re-2:0),be=2;be3&&arguments[3]!==void 0?arguments[3]:0,be=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1,ve=arguments[5],we=ie(bt),_e=ie(Re),Oe=Math.floor(le(ut,ue,be,we.r,_e.r)),Qe=Math.floor(le(ut,ue,be,we.g,_e.g)),ct=Math.floor(le(ut,ue,be,we.b,_e.b));return ve?"rgb("+Oe+","+Qe+","+ct+")":ae(Oe,Qe,ct)}function de(ut){return ut*Math.PI/180}function he(ut){return ut*180/Math.PI}var me=Object.freeze({mapValueInRange:le,interpolateColor:ce,degreesToRadians:de,radiansToDegrees:he});function ge(ut){return(ut-30)*3.62+194}function ye(ut){return(ut-194)/3.62+30}function fe(ut){return(ut-8)*3+25}function Te(ut){return(ut-25)/3+8}var Pe=Object.freeze({tensionFromOrigamiValue:ge,origamiValueFromTension:ye,frictionFromOrigamiValue:fe,origamiFromFriction:Te}),De=function(ut,bt){if(!(ut instanceof bt))throw new TypeError("Cannot call a class as a function")},xe=Object.assign||function(ut){for(var bt=1;bt18&&Re<=44?ue=this.b3Friction2(Re):ue=this.b3Friction3(Re),ue},ut}(),Ne=function(){ut.fromOrigamiTensionAndFriction=function(Re,ue){return new ut(ge(Re),fe(ue))},ut.fromBouncinessAndSpeed=function(Re,ue){var be=new Ie(Re,ue);return ut.fromOrigamiTensionAndFriction(be.bouncyTension,be.bouncyFriction)},ut.coastingConfigWithOrigamiFriction=function(Re){return new ut(0,fe(Re))};function ut(bt,Re){De(this,ut),this.tension=bt,this.friction=Re}return ut}();Ne.DEFAULT_ORIGAMI_SPRING_CONFIG=Ne.fromOrigamiTensionAndFriction(40,7);var pt=function ut(){De(this,ut),this.position=0,this.velocity=0},at=function(){function ut(bt){De(this,ut),this.listeners=[],this._startValue=0,this._currentState=new pt,this._displacementFromRestThreshold=.001,this._endValue=0,this._overshootClampingEnabled=!1,this._previousState=new pt,this._restSpeedThreshold=.001,this._tempState=new pt,this._timeAccumulator=0,this._wasAtRest=!0,this._id="s"+ut._ID++,this._springSystem=bt}return ut.prototype.destroy=function(){this.listeners=[],this._springSystem.deregisterSpring(this)},ut.prototype.getId=function(){return this._id},ut.prototype.setSpringConfig=function(Re){return this._springConfig=Re,this},ut.prototype.getSpringConfig=function(){return this._springConfig},ut.prototype.setCurrentValue=function(Re,ue){return this._startValue=Re,this._currentState.position=Re,ue||this.setAtRest(),this.notifyPositionUpdated(!1,!1),this},ut.prototype.getStartValue=function(){return this._startValue},ut.prototype.getCurrentValue=function(){return this._currentState.position},ut.prototype.getCurrentDisplacementDistance=function(){return this.getDisplacementDistanceForState(this._currentState)},ut.prototype.getDisplacementDistanceForState=function(Re){return Math.abs(this._endValue-Re.position)},ut.prototype.setEndValue=function(Re){if(this._endValue===Re&&this.isAtRest())return this;this._startValue=this.getCurrentValue(),this._endValue=Re,this._springSystem.activateSpring(this.getId());for(var ue=0,be=this.listeners.length;ue0&&(Reue||Re>ue&&this.getCurrentValue()ut.MAX_DELTA_TIME_SEC&&(ve=ut.MAX_DELTA_TIME_SEC),this._timeAccumulator+=ve;for(var we=this._springConfig.tension,_e=this._springConfig.friction,Oe=this._currentState.position,Qe=this._currentState.velocity,ct=this._tempState.position,xt=this._tempState.velocity,Tt=void 0,Pt=void 0,$t=void 0,Ft=void 0,Nt=void 0,Gt=void 0,ft=void 0,yt=void 0,At=void 0,Rt=void 0;this._timeAccumulator>=ut.SOLVER_TIMESTEP_SEC;)this._timeAccumulator-=ut.SOLVER_TIMESTEP_SEC,this._timeAccumulator0&&this._interpolate(this._timeAccumulator/ut.SOLVER_TIMESTEP_SEC),(this.isAtRest()||this._overshootClampingEnabled&&this.isOvershooting())&&(this._springConfig.tension>0?(this._startValue=this._endValue,this._currentState.position=this._endValue):(this._endValue=this._currentState.position,this._startValue=this._endValue),this.setVelocity(0),be=!0);var mt=!1;this._wasAtRest&&(this._wasAtRest=!1,mt=!0);var ht=!1;be&&(this._wasAtRest=!0,ht=!0),this.notifyPositionUpdated(mt,ht)}},ut.prototype.notifyPositionUpdated=function(Re,ue){for(var be=0,ve=this.listeners.length;be0;)this._idleSpringIndices.pop();for(var be=0,ve=this._activeSprings.length;be0;){var _e=this._idleSpringIndices.pop();_e>=0&&this._activeSprings.splice(_e,1)}},ut.prototype.loop=function(Re){var ue=void 0;this._lastTimeMillis===-1&&(this._lastTimeMillis=Re-1);var be=Re-this._lastTimeMillis;this._lastTimeMillis=Re;var ve=0,we=this.listeners.length;for(ve=0;vejsxRuntimeExports.jsx("div",{}),renderTrackVertical:()=>jsxRuntimeExports.jsx("div",{}),hidden:!1,autoHeight:V,autoHeightMax:$,onScrollFrame:K,children:this.props.children,ref:Y=>{this.scrollbars=Y}})}}const KOLONNEBREDDE=325,KOLONNEMARGIN=10,Tavle=T=>{const{children:C,dragging:$}=T,[V,K]=reactExports.useState(0),[Y,J]=reactExports.useState(0),[re,ne]=reactExports.useState(!0),[te,se]=reactExports.useState(!1),ie=reactExports.useRef(null),ae=()=>{var ye;const me=Math.min(V,Y)-1,ge=me*KOLONNEBREDDE;(ye=ie.current)==null||ye.scrollLeft(ge),J(me)},oe=()=>{var me;if(ie.current){const ge=ie.current.getClientWidth(),ye=ie.current.getScrollLeft(),fe=ge+KOLONNEMARGIN,Te=Math.floor((fe+ye)/KOLONNEBREDDE),Pe=Math.max(Te,Y)+1,De=Pe*KOLONNEBREDDE-fe;(me=ie.current)==null||me.scrollLeft(De),J(Pe)}else return},le=me=>{K(Math.ceil(me.scrollLeft/KOLONNEBREDDE)),ne(me.left===0),se(me.left>=.99)},ce=C.map((me,ge)=>jsxRuntimeExports.jsx("section",{className:"min-w-[300px] lg:max-w-[300px]","data-testid":`aktivitetstavle.${me.props.status}`,children:me},me.key||ge)),de=jsxRuntimeExports.jsx("button",{type:"button",className:classNames("tavle__scrollknapp knapp-forrige border",{invisible:re}),onClick:ae,disabled:re,"aria-label":"Flytt visning en kolonne til venstre",children:jsxRuntimeExports.jsx(ChevronLeftIcon,{titleId:"flytt-venstre",title:"Forrige kolonne","aria-hidden":!0,fontSize:"4rem"})}),he=jsxRuntimeExports.jsx("button",{type:"button",className:classNames("tavle__scrollknapp knapp-neste border",{invisible:te}),onClick:oe,hidden:te,"aria-label":"Flytt visning en kolonne til høyre",children:jsxRuntimeExports.jsx(ChevronRightIcon,{titleId:"flytt-hoyre",title:"Neste kolonne","aria-hidden":!0,fontSize:"4rem"})});return jsxRuntimeExports.jsxs("section",{className:classNames("tavle aktivitetstavle w-full"),tabIndex:-1,children:[de,jsxRuntimeExports.jsx(SprettendeScrollbars,{autoHeight:!0,autoHeightMax:9999,onScrollFrame:le,ref:ie,children:jsxRuntimeExports.jsx("div",{className:`kolonner flex flex-col sm:gap-y-6 sm:mx-8 sm:max-w-[624px] sm:mx-auto md:max-w-[720px]
+ lg:flex-row lg:gap-x-5 lg:mx-4 lg:max-w-full tavle-max-width:justify-center`,children:ce})}),he]})},SvgObs=T=>reactExports.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"25 10 47 85",...T},reactExports.createElement("path",{fill:"#515658",d:"M68.609 25.398H30.507c-1.573 0-2.845 1.284-2.845 2.871v48.488a2.88 2.88 0 0 0 1.038 2.214 2.815 2.815 0 0 0 1.807.656h38.102c1.572 0 2.846-1.286 2.846-2.87V28.269c0-1.587-1.274-2.871-2.846-2.871"}),reactExports.createElement("path",{fill:"#FFF",d:"M31.186 35.997v37.305a2.397 2.397 0 0 0 2.388 2.408h31.968a2.397 2.397 0 0 0 2.388-2.408V30.47c0-1.33-1.07-2.408-2.388-2.408H39.497l-8.311 7.935z"}),reactExports.createElement("path",{fill:"#C0C0BE",d:"M39.497 28.063v5.524a2.399 2.399 0 0 1-2.387 2.41h-5.924l8.311-7.934z"}),reactExports.createElement("path",{fill:"#2F3237",d:"M49.56 26.746a.923.923 0 0 1-.922-.927c0-.514.412-.93.921-.93.507 0 .92.416.92.93a.924.924 0 0 1-.92.927m5.688-3.796h-3.428v-.639a2.27 2.27 0 0 0-2.26-2.279 2.27 2.27 0 0 0-2.262 2.28v.638H43.87c-1.69 0-3.06 1.382-3.06 3.086v3.712h17.497v-3.712c0-1.704-1.371-3.086-3.06-3.086"}),reactExports.createElement("path",{d:"M53.634 52.768v2.898H45.35V38.007h8.284v2.898zM49.601 68.83c2.763 0 5.003-2.257 5.003-5.042 0-2.786-2.24-5.044-5.003-5.044s-5.003 2.258-5.003 5.044c0 2.785 2.24 5.043 5.003 5.043",fill:"#515658"})),getAdvarseltekst=(T,C)=>{if(T.status===AktivitetStatus.FULLFOERT)return"Aktiviteten er fullført og kan ikke endres.";if(T.status===AktivitetStatus.AVBRUTT)return"Aktiviteten er avbrutt og kan ikke endres.";if(T.type===MOTE_TYPE)return"Du kan ikke endre status på møtet. Ta kontakt med veilederen din for å endre møtet.";if(T.type===SAMTALEREFERAT_TYPE)return"Du kan ikke endre status på samtalereferatet. Ta kontakt med veilederen din for å endre dette.";if([UTDANNING_AKTIVITET_TYPE,GRUPPE_AKTIVITET_TYPE,TILTAK_AKTIVITET_TYPE].includes(T.type))return C?"For å endre aktiviteten må du gå til Arena.":"Du kan ikke endre denne aktiviteten selv. Send en melding til veilederen din hvis aktiviteten skal endres.";if(T.type===VeilarbAktivitetType.EKSTERN_AKTIVITET_TYPE){if(C){switch(T.eksternAktivitet.type){case EksternAktivitetType.ARENA_TILTAK_TYPE:return"For å endre aktiviteten må du gå til Arena.";case EksternAktivitetType.MIDL_LONNSTILSKUDD_TYPE:case EksternAktivitetType.VARIG_LONNSTILSKUDD_TYPE:return"Denne aktiviteten kan ikke endres fra aktivitetsplanen. Gå til avtalen for å endre status."}return"Denne aktiviteten kan ikke endres fra aktivitetsplanen. Gå til fagsystemet for å endre aktiviteten."}return"Du kan ikke endre denne aktiviteten selv. Send en melding til veilederen din hvis aktiviteten skal endres."}return"Du kan ikke endre status på denne aktiviteten. Ta kontakt med veilederen din for å gjøre endringer."},Tavleadvarsel=T=>{const{hidden:C,draggingAktivitet:$,erVeileder:V}=T;return C||!$?null:jsxRuntimeExports.jsx("div",{className:"fixed z-50 left-0 right-0 max-w-lg mx-auto",children:jsxRuntimeExports.jsx(GuidePanel$1,{illustration:jsxRuntimeExports.jsx(SvgObs,{}),poster:!0,children:jsxRuntimeExports.jsx(BodyShort,{children:getAdvarseltekst($,V)})})})};function LogTimeToAktivitestavlePaint(T){return reactExports.useEffect(()=>{logTimeToAktivitestavlePaint(T.erVeileder)},[T.erVeileder]),null}const Aktivitetstavle=()=>{const T=useAppDispatch(),C=useFnr(),$=useSelector(selectAktivitetStatus),V=useSelector(selectArenaAktivitetStatus),K=useErVeileder(),Y=useSelector(selectDraggingAktivitet,shallowEqual$1),J=useSelector(selectErUnderOppfolging),re=$===Status.NOT_STARTED&&V===Status.NOT_STARTED,ne=[$,V];reactExports.useEffect(()=>{re&&(K&&C&&(doLesAktivitetsplan(C),T(hentNivaa4(C)),T(hentVeilederInfo())),T(hentAktiviteter()),T(hentArenaAktiviteter()))},[re,K,T]);const te=!!Y,se=!!Y&&erDroppbar(Y,!K,J),ie=!te||se,ae=useSelector(de=>{const he=selectSistVisteAktivitet(de);return he?prefixAktivtetskortId(he):"no-element"}),oe=useIsVisible(document.getElementById(AKTIVITETSPLAN_ROOT_NODE_ID)),[le,ce]=reactExports.useState(!1);return useEventListener("veilarbpersonflatefs.tab-clicked",de=>{var he;TabId.AKTIVITETSPLAN===((he=de.detail)==null?void 0:he.tabId)&&ce(!0)}),reactExports.useEffect(()=>{const de=document.getElementById(ae);de&&le&&oe&&(de.scrollIntoView({behavior:"auto",block:"center",inline:"center"}),ce(!1))},[ae,le,oe]),jsxRuntimeExports.jsxs(Innholdslaster,{className:"flex m-auto mt-8",minstEn:!0,avhengigheter:ne,children:[jsxRuntimeExports.jsx(Tavleadvarsel,{hidden:ie,draggingAktivitet:Y,erVeileder:K}),jsxRuntimeExports.jsx(LogTimeToAktivitestavlePaint,{erVeileder:K}),jsxRuntimeExports.jsxs(Tavle,{dragging:te,children:[jsxRuntimeExports.jsx(Kolonne,{status:AktivitetStatus.BRUKER_ER_INTRESSERT}),jsxRuntimeExports.jsx(Kolonne,{status:AktivitetStatus.PLANLAGT}),jsxRuntimeExports.jsx(Kolonne,{status:AktivitetStatus.GJENNOMFOERT}),jsxRuntimeExports.jsx(KolonneSomSkjulerEldreAktiviteter,{status:AktivitetStatus.FULLFOERT}),jsxRuntimeExports.jsx(KolonneSomSkjulerEldreAktiviteter,{status:AktivitetStatus.AVBRUTT})]})]})},Hovedside=()=>{const T=useNavigate(),{aktivitetRoute:C}=useRoutes();useEventListener("visAktivitetsplan",V=>{const K=V.detail;K&&T(C(K))});const $=useAppDispatch();return reactExports.useEffect(()=>{$(hentDialoger()),$(hentEskaleringsvarsel())},[]),jsxRuntimeExports.jsx("main",{id:"main",className:"hovedside",children:jsxRuntimeExports.jsxs("div",{className:"flex items-center flex-col w-full h-full",children:[jsxRuntimeExports.jsx(HovedsideFeilmelding,{}),jsxRuntimeExports.jsx(Nivaa4Feilmelding,{}),jsxRuntimeExports.jsx(InformasjonsHenting,{}),jsxRuntimeExports.jsx(Varslinger,{}),jsxRuntimeExports.jsxs("div",{className:"container flex flex-col gap-y-6",children:[jsxRuntimeExports.jsx(Navigasjonslinje,{}),jsxRuntimeExports.jsx(MittMaal,{}),jsxRuntimeExports.jsx(Verktoylinje,{})]}),jsxRuntimeExports.jsx(Aktivitetstavle,{}),jsxRuntimeExports.jsx(Outlet,{})]})})};var isCheckBoxInput=T=>T.type==="checkbox",isDateObject=T=>T instanceof Date,isNullOrUndefined=T=>T==null;const isObjectType=T=>typeof T=="object";var isObject=T=>!isNullOrUndefined(T)&&!Array.isArray(T)&&isObjectType(T)&&!isDateObject(T),getEventValue=T=>isObject(T)&&T.target?isCheckBoxInput(T.target)?T.target.checked:T.target.value:T,getNodeParentName=T=>T.substring(0,T.search(/\.\d+(\.|$)/))||T,isNameInFieldArray=(T,C)=>T.has(getNodeParentName(C)),isPlainObject=T=>{const C=T.constructor&&T.constructor.prototype;return isObject(C)&&C.hasOwnProperty("isPrototypeOf")},isWeb=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function cloneObject(T){let C;const $=Array.isArray(T);if(T instanceof Date)C=new Date(T);else if(T instanceof Set)C=new Set(T);else if(!(isWeb&&(T instanceof Blob||T instanceof FileList))&&($||isObject(T)))if(C=$?[]:{},!$&&!isPlainObject(T))C=T;else for(const V in T)T.hasOwnProperty(V)&&(C[V]=cloneObject(T[V]));else return T;return C}var compact=T=>Array.isArray(T)?T.filter(Boolean):[],isUndefined=T=>T===void 0,get=(T,C,$)=>{if(!C||!isObject(T))return $;const V=compact(C.split(/[,[\].]+?/)).reduce((K,Y)=>isNullOrUndefined(K)?K:K[Y],T);return isUndefined(V)||V===T?isUndefined(T[C])?$:T[C]:V},isBoolean=T=>typeof T=="boolean";const EVENTS={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},VALIDATION_MODE={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},INPUT_VALIDATION_RULES={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},HookFormContext=React.createContext(null),useFormContext=()=>React.useContext(HookFormContext),FormProvider=T=>{const{children:C,...$}=T;return React.createElement(HookFormContext.Provider,{value:$},C)};var getProxyFormState=(T,C,$,V=!0)=>{const K={defaultValues:C._defaultValues};for(const Y in T)Object.defineProperty(K,Y,{get:()=>{const J=Y;return C._proxyFormState[J]!==VALIDATION_MODE.all&&(C._proxyFormState[J]=!V||VALIDATION_MODE.all),$&&($[J]=!0),T[J]}});return K},isEmptyObject=T=>isObject(T)&&!Object.keys(T).length,shouldRenderFormState=(T,C,$,V)=>{$(T);const{name:K,...Y}=T;return isEmptyObject(Y)||Object.keys(Y).length>=Object.keys(C).length||Object.keys(Y).find(J=>C[J]===(!V||VALIDATION_MODE.all))},convertToArrayPayload=T=>Array.isArray(T)?T:[T],shouldSubscribeByName=(T,C,$)=>!T||!C||T===C||convertToArrayPayload(T).some(V=>V&&($?V===C:V.startsWith(C)||C.startsWith(V)));function useSubscribe(T){const C=React.useRef(T);C.current=T,React.useEffect(()=>{const $=!T.disabled&&C.current.subject&&C.current.subject.subscribe({next:C.current.next});return()=>{$&&$.unsubscribe()}},[T.disabled])}function useFormState(T){const C=useFormContext(),{control:$=C.control,disabled:V,name:K,exact:Y}=T||{},[J,re]=React.useState($._formState),ne=React.useRef(!0),te=React.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),se=React.useRef(K);return se.current=K,useSubscribe({disabled:V,next:ie=>ne.current&&shouldSubscribeByName(se.current,ie.name,Y)&&shouldRenderFormState(ie,te.current,$._updateFormState)&&re({...$._formState,...ie}),subject:$._subjects.state}),React.useEffect(()=>(ne.current=!0,te.current.isValid&&$._updateValid(!0),()=>{ne.current=!1}),[$]),getProxyFormState(J,$,te.current,!1)}var isString$1=T=>typeof T=="string",generateWatchOutput=(T,C,$,V,K)=>isString$1(T)?(V&&C.watch.add(T),get($,T,K)):Array.isArray(T)?T.map(Y=>(V&&C.watch.add(Y),get($,Y))):(V&&(C.watchAll=!0),$);function useWatch(T){const C=useFormContext(),{control:$=C.control,name:V,defaultValue:K,disabled:Y,exact:J}=T||{},re=React.useRef(V);re.current=V,useSubscribe({disabled:Y,subject:$._subjects.values,next:se=>{shouldSubscribeByName(re.current,se.name,J)&&te(cloneObject(generateWatchOutput(re.current,$._names,se.values||$._formValues,!1,K)))}});const[ne,te]=React.useState($._getWatch(V,K));return React.useEffect(()=>$._removeUnmounted()),ne}var isKey=T=>/^\w*$/.test(T),stringToPath=T=>compact(T.replace(/["|']|\]/g,"").split(/\.|\[/)),set=(T,C,$)=>{let V=-1;const K=isKey(C)?[C]:stringToPath(C),Y=K.length,J=Y-1;for(;++V{const se=K._options.shouldUnregister||Y,ie=(ae,oe)=>{const le=get(K._fields,ae);le&&(le._f.mount=oe)};if(ie($,!0),se){const ae=cloneObject(get(K._options.defaultValues,$));set(K._defaultValues,$,ae),isUndefined(get(K._formValues,$))&&set(K._formValues,$,ae)}return()=>{(J?se&&!K._state.action:se)?K.unregister($):ie($,!1)}},[$,K,J,Y]),React.useEffect(()=>{get(K._fields,$)&&K._updateDisabledField({disabled:V,fields:K._fields,name:$,value:get(K._fields,$)._f.value})},[V,$,K]),{field:{name:$,value:re,...isBoolean(V)||ne.disabled?{disabled:ne.disabled||V}:{},onChange:React.useCallback(se=>te.current.onChange({target:{value:getEventValue(se),name:$},type:EVENTS.CHANGE}),[$]),onBlur:React.useCallback(()=>te.current.onBlur({target:{value:get(K._formValues,$),name:$},type:EVENTS.BLUR}),[$,K]),ref:se=>{const ie=get(K._fields,$);ie&&se&&(ie._f.ref={focus:()=>se.focus(),select:()=>se.select(),setCustomValidity:ae=>se.setCustomValidity(ae),reportValidity:()=>se.reportValidity()})}},formState:ne,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!get(ne.errors,$)},isDirty:{enumerable:!0,get:()=>!!get(ne.dirtyFields,$)},isTouched:{enumerable:!0,get:()=>!!get(ne.touchedFields,$)},error:{enumerable:!0,get:()=>get(ne.errors,$)}})}}const Controller=T=>T.render(useController(T));var appendErrors=(T,C,$,V,K)=>C?{...$[T],types:{...$[T]&&$[T].types?$[T].types:{},[V]:K||!0}}:{},getValidationModes=T=>({isOnSubmit:!T||T===VALIDATION_MODE.onSubmit,isOnBlur:T===VALIDATION_MODE.onBlur,isOnChange:T===VALIDATION_MODE.onChange,isOnAll:T===VALIDATION_MODE.all,isOnTouch:T===VALIDATION_MODE.onTouched}),isWatched=(T,C,$)=>!$&&(C.watchAll||C.watch.has(T)||[...C.watch].some(V=>T.startsWith(V)&&/^\.\w+/.test(T.slice(V.length))));const iterateFieldsByAction=(T,C,$,V)=>{for(const K of $||Object.keys(T)){const Y=get(T,K);if(Y){const{_f:J,...re}=Y;if(J){if(J.refs&&J.refs[0]&&C(J.refs[0],K)&&!V)break;if(J.ref&&C(J.ref,J.name)&&!V)break;iterateFieldsByAction(re,C)}else isObject(re)&&iterateFieldsByAction(re,C)}}};var updateFieldArrayRootError=(T,C,$)=>{const V=compact(get(T,$));return set(V,"root",C[$]),set(T,$,V),T},isFileInput=T=>T.type==="file",isFunction=T=>typeof T=="function",isHTMLElement=T=>{if(!isWeb)return!1;const C=T?T.ownerDocument:0;return T instanceof(C&&C.defaultView?C.defaultView.HTMLElement:HTMLElement)},isMessage=T=>isString$1(T),isRadioInput=T=>T.type==="radio",isRegex=T=>T instanceof RegExp;const defaultResult={value:!1,isValid:!1},validResult={value:!0,isValid:!0};var getCheckboxValue=T=>{if(Array.isArray(T)){if(T.length>1){const C=T.filter($=>$&&$.checked&&!$.disabled).map($=>$.value);return{value:C,isValid:!!C.length}}return T[0].checked&&!T[0].disabled?T[0].attributes&&!isUndefined(T[0].attributes.value)?isUndefined(T[0].value)||T[0].value===""?validResult:{value:T[0].value,isValid:!0}:validResult:defaultResult}return defaultResult};const defaultReturn={isValid:!1,value:null};var getRadioValue=T=>Array.isArray(T)?T.reduce((C,$)=>$&&$.checked&&!$.disabled?{isValid:!0,value:$.value}:C,defaultReturn):defaultReturn;function getValidateError(T,C,$="validate"){if(isMessage(T)||Array.isArray(T)&&T.every(isMessage)||isBoolean(T)&&!T)return{type:$,message:isMessage(T)?T:"",ref:C}}var getValueAndMessage=T=>isObject(T)&&!isRegex(T)?T:{value:T,message:""},validateField=async(T,C,$,V,K)=>{const{ref:Y,refs:J,required:re,maxLength:ne,minLength:te,min:se,max:ie,pattern:ae,validate:oe,name:le,valueAsNumber:ce,mount:de,disabled:he}=T._f,me=get(C,le);if(!de||he)return{};const ge=J?J[0]:Y,ye=Le=>{V&&ge.reportValidity&&(ge.setCustomValidity(isBoolean(Le)?"":Le||""),ge.reportValidity())},fe={},Te=isRadioInput(Y),Pe=isCheckBoxInput(Y),De=Te||Pe,xe=(ce||isFileInput(Y))&&isUndefined(Y.value)&&isUndefined(me)||isHTMLElement(Y)&&Y.value===""||me===""||Array.isArray(me)&&!me.length,Ce=appendErrors.bind(null,le,$,fe),je=(Le,Ke,Se,Ie=INPUT_VALIDATION_RULES.maxLength,Ne=INPUT_VALIDATION_RULES.minLength)=>{const pt=Le?Ke:Se;fe[le]={type:Le?Ie:Ne,message:pt,ref:Y,...Ce(Le?Ie:Ne,pt)}};if(K?!Array.isArray(me)||!me.length:re&&(!De&&(xe||isNullOrUndefined(me))||isBoolean(me)&&!me||Pe&&!getCheckboxValue(J).isValid||Te&&!getRadioValue(J).isValid)){const{value:Le,message:Ke}=isMessage(re)?{value:!!re,message:re}:getValueAndMessage(re);if(Le&&(fe[le]={type:INPUT_VALIDATION_RULES.required,message:Ke,ref:ge,...Ce(INPUT_VALIDATION_RULES.required,Ke)},!$))return ye(Ke),fe}if(!xe&&(!isNullOrUndefined(se)||!isNullOrUndefined(ie))){let Le,Ke;const Se=getValueAndMessage(ie),Ie=getValueAndMessage(se);if(!isNullOrUndefined(me)&&!isNaN(me)){const Ne=Y.valueAsNumber||me&&+me;isNullOrUndefined(Se.value)||(Le=Ne>Se.value),isNullOrUndefined(Ie.value)||(Ke=Nenew Date(new Date().toDateString()+" "+Ct),at=Y.type=="time",dt=Y.type=="week";isString$1(Se.value)&&me&&(Le=at?pt(me)>pt(Se.value):dt?me>Se.value:Ne>new Date(Se.value)),isString$1(Ie.value)&&me&&(Ke=at?pt(me)+Le.value,Ie=!isNullOrUndefined(Ke.value)&&me.length<+Ke.value;if((Se||Ie)&&(je(Se,Le.message,Ke.message),!$))return ye(fe[le].message),fe}if(ae&&!xe&&isString$1(me)){const{value:Le,message:Ke}=getValueAndMessage(ae);if(isRegex(Le)&&!me.match(Le)&&(fe[le]={type:INPUT_VALIDATION_RULES.pattern,message:Ke,ref:Y,...Ce(INPUT_VALIDATION_RULES.pattern,Ke)},!$))return ye(Ke),fe}if(oe){if(isFunction(oe)){const Le=await oe(me,C),Ke=getValidateError(Le,ge);if(Ke&&(fe[le]={...Ke,...Ce(INPUT_VALIDATION_RULES.validate,Ke.message)},!$))return ye(Ke.message),fe}else if(isObject(oe)){let Le={};for(const Ke in oe){if(!isEmptyObject(Le)&&!$)break;const Se=getValidateError(await oe[Ke](me,C),ge,Ke);Se&&(Le={...Se,...Ce(Ke,Se.message)},ye(Se.message),$&&(fe[le]=Le))}if(!isEmptyObject(Le)&&(fe[le]={ref:ge,...Le},!$))return fe}}return ye(!0),fe};function baseGet(T,C){const $=C.slice(0,-1).length;let V=0;for(;V<$;)T=isUndefined(T)?V++:T[C[V++]];return T}function isEmptyArray(T){for(const C in T)if(T.hasOwnProperty(C)&&!isUndefined(T[C]))return!1;return!0}function unset(T,C){const $=Array.isArray(C)?C:isKey(C)?[C]:stringToPath(C),V=$.length===1?T:baseGet(T,$),K=$.length-1,Y=$[K];return V&&delete V[Y],K!==0&&(isObject(V)&&isEmptyObject(V)||Array.isArray(V)&&isEmptyArray(V))&&unset(T,$.slice(0,-1)),T}var createSubject=()=>{let T=[];return{get observers(){return T},next:K=>{for(const Y of T)Y.next&&Y.next(K)},subscribe:K=>(T.push(K),{unsubscribe:()=>{T=T.filter(Y=>Y!==K)}}),unsubscribe:()=>{T=[]}}},isPrimitive=T=>isNullOrUndefined(T)||!isObjectType(T);function deepEqual(T,C){if(isPrimitive(T)||isPrimitive(C))return T===C;if(isDateObject(T)&&isDateObject(C))return T.getTime()===C.getTime();const $=Object.keys(T),V=Object.keys(C);if($.length!==V.length)return!1;for(const K of $){const Y=T[K];if(!V.includes(K))return!1;if(K!=="ref"){const J=C[K];if(isDateObject(Y)&&isDateObject(J)||isObject(Y)&&isObject(J)||Array.isArray(Y)&&Array.isArray(J)?!deepEqual(Y,J):Y!==J)return!1}}return!0}var isMultipleSelect=T=>T.type==="select-multiple",isRadioOrCheckbox=T=>isRadioInput(T)||isCheckBoxInput(T),live=T=>isHTMLElement(T)&&T.isConnected,objectHasFunction=T=>{for(const C in T)if(isFunction(T[C]))return!0;return!1};function markFieldsDirty(T,C={}){const $=Array.isArray(T);if(isObject(T)||$)for(const V in T)Array.isArray(T[V])||isObject(T[V])&&!objectHasFunction(T[V])?(C[V]=Array.isArray(T[V])?[]:{},markFieldsDirty(T[V],C[V])):isNullOrUndefined(T[V])||(C[V]=!0);return C}function getDirtyFieldsFromDefaultValues(T,C,$){const V=Array.isArray(T);if(isObject(T)||V)for(const K in T)Array.isArray(T[K])||isObject(T[K])&&!objectHasFunction(T[K])?isUndefined(C)||isPrimitive($[K])?$[K]=Array.isArray(T[K])?markFieldsDirty(T[K],[]):{...markFieldsDirty(T[K])}:getDirtyFieldsFromDefaultValues(T[K],isNullOrUndefined(C)?{}:C[K],$[K]):$[K]=!deepEqual(T[K],C[K]);return $}var getDirtyFields=(T,C)=>getDirtyFieldsFromDefaultValues(T,C,markFieldsDirty(C)),getFieldValueAs=(T,{valueAsNumber:C,valueAsDate:$,setValueAs:V})=>isUndefined(T)?T:C?T===""?NaN:T&&+T:$&&isString$1(T)?new Date(T):V?V(T):T;function getFieldValue(T){const C=T.ref;if(!(T.refs?T.refs.every($=>$.disabled):C.disabled))return isFileInput(C)?C.files:isRadioInput(C)?getRadioValue(T.refs).value:isMultipleSelect(C)?[...C.selectedOptions].map(({value:$})=>$):isCheckBoxInput(C)?getCheckboxValue(T.refs).value:getFieldValueAs(isUndefined(C.value)?T.ref.value:C.value,T)}var getResolverOptions=(T,C,$,V)=>{const K={};for(const Y of T){const J=get(C,Y);J&&set(K,Y,J._f)}return{criteriaMode:$,names:[...T],fields:K,shouldUseNativeValidation:V}},getRuleValue=T=>isUndefined(T)?T:isRegex(T)?T.source:isObject(T)?isRegex(T.value)?T.value.source:T.value:T,hasValidation=T=>T.mount&&(T.required||T.min||T.max||T.maxLength||T.minLength||T.pattern||T.validate);function schemaErrorLookup(T,C,$){const V=get(T,$);if(V||isKey($))return{error:V,name:$};const K=$.split(".");for(;K.length;){const Y=K.join("."),J=get(C,Y),re=get(T,Y);if(J&&!Array.isArray(J)&&$!==Y)return{name:$};if(re&&re.type)return{name:Y,error:re};K.pop()}return{name:$}}var skipValidation=(T,C,$,V,K)=>K.isOnAll?!1:!$&&K.isOnTouch?!(C||T):($?V.isOnBlur:K.isOnBlur)?!T:($?V.isOnChange:K.isOnChange)?T:!0,unsetEmptyArray=(T,C)=>!compact(get(T,C)).length&&unset(T,C);const defaultOptions={mode:VALIDATION_MODE.onSubmit,reValidateMode:VALIDATION_MODE.onChange,shouldFocusError:!0};function createFormControl(T={},C){let $={...defaultOptions,...T},V={submitCount:0,isDirty:!1,isLoading:isFunction($.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:$.errors||{},disabled:$.disabled||!1},K={},Y=isObject($.values)||isObject($.defaultValues)?cloneObject($.values||$.defaultValues)||{}:{},J=$.shouldUnregister?{}:cloneObject(Y),re={action:!1,mount:!1,watch:!1},ne={mount:new Set,unMount:new Set,array:new Set,watch:new Set},te,se=0;const ie={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},ae={values:createSubject(),array:createSubject(),state:createSubject()},oe=getValidationModes($.mode),le=getValidationModes($.reValidateMode),ce=$.criteriaMode===VALIDATION_MODE.all,de=ft=>yt=>{clearTimeout(se),se=setTimeout(ft,yt)},he=async ft=>{if(ie.isValid||ft){const yt=$.resolver?isEmptyObject((await xe()).errors):await je(K,!0);yt!==V.isValid&&ae.state.next({isValid:yt})}},me=ft=>ie.isValidating&&ae.state.next({isValidating:ft}),ge=(ft,yt=[],At,Rt,mt=!0,ht=!0)=>{if(Rt&&At){if(re.action=!0,ht&&Array.isArray(get(K,ft))){const jt=At(get(K,ft),Rt.argA,Rt.argB);mt&&set(K,ft,jt)}if(ht&&Array.isArray(get(V.errors,ft))){const jt=At(get(V.errors,ft),Rt.argA,Rt.argB);mt&&set(V.errors,ft,jt),unsetEmptyArray(V.errors,ft)}if(ie.touchedFields&&ht&&Array.isArray(get(V.touchedFields,ft))){const jt=At(get(V.touchedFields,ft),Rt.argA,Rt.argB);mt&&set(V.touchedFields,ft,jt)}ie.dirtyFields&&(V.dirtyFields=getDirtyFields(Y,J)),ae.state.next({name:ft,isDirty:Ke(ft,yt),dirtyFields:V.dirtyFields,errors:V.errors,isValid:V.isValid})}else set(J,ft,yt)},ye=(ft,yt)=>{set(V.errors,ft,yt),ae.state.next({errors:V.errors})},fe=ft=>{V.errors=ft,ae.state.next({errors:V.errors,isValid:!1})},Te=(ft,yt,At,Rt)=>{const mt=get(K,ft);if(mt){const ht=get(J,ft,isUndefined(At)?get(Y,ft):At);isUndefined(ht)||Rt&&Rt.defaultChecked||yt?set(J,ft,yt?ht:getFieldValue(mt._f)):Ne(ft,ht),re.mount&&he()}},Pe=(ft,yt,At,Rt,mt)=>{let ht=!1,jt=!1;const Vt={name:ft},Bt=!!(get(K,ft)&&get(K,ft)._f.disabled);if(!At||Rt){ie.isDirty&&(jt=V.isDirty,V.isDirty=Vt.isDirty=Ke(),ht=jt!==Vt.isDirty);const er=Bt||deepEqual(get(Y,ft),yt);jt=!!(!Bt&&get(V.dirtyFields,ft)),er||Bt?unset(V.dirtyFields,ft):set(V.dirtyFields,ft,!0),Vt.dirtyFields=V.dirtyFields,ht=ht||ie.dirtyFields&&jt!==!er}if(At){const er=get(V.touchedFields,ft);er||(set(V.touchedFields,ft,At),Vt.touchedFields=V.touchedFields,ht=ht||ie.touchedFields&&er!==At)}return ht&&mt&&ae.state.next(Vt),ht?Vt:{}},De=(ft,yt,At,Rt)=>{const mt=get(V.errors,ft),ht=ie.isValid&&isBoolean(yt)&&V.isValid!==yt;if(T.delayError&&At?(te=de(()=>ye(ft,At)),te(T.delayError)):(clearTimeout(se),te=null,At?set(V.errors,ft,At):unset(V.errors,ft)),(At?!deepEqual(mt,At):mt)||!isEmptyObject(Rt)||ht){const jt={...Rt,...ht&&isBoolean(yt)?{isValid:yt}:{},errors:V.errors,name:ft};V={...V,...jt},ae.state.next(jt)}me(!1)},xe=async ft=>$.resolver(J,$.context,getResolverOptions(ft||ne.mount,K,$.criteriaMode,$.shouldUseNativeValidation)),Ce=async ft=>{const{errors:yt}=await xe(ft);if(ft)for(const At of ft){const Rt=get(yt,At);Rt?set(V.errors,At,Rt):unset(V.errors,At)}else V.errors=yt;return yt},je=async(ft,yt,At={valid:!0})=>{for(const Rt in ft){const mt=ft[Rt];if(mt){const{_f:ht,...jt}=mt;if(ht){const Vt=ne.array.has(ht.name),Bt=await validateField(mt,J,ce,$.shouldUseNativeValidation&&!yt,Vt);if(Bt[ht.name]&&(At.valid=!1,yt))break;!yt&&(get(Bt,ht.name)?Vt?updateFieldArrayRootError(V.errors,Bt,ht.name):set(V.errors,ht.name,Bt[ht.name]):unset(V.errors,ht.name))}jt&&await je(jt,yt,At)}}return At.valid},Le=()=>{for(const ft of ne.unMount){const yt=get(K,ft);yt&&(yt._f.refs?yt._f.refs.every(At=>!live(At)):!live(yt._f.ref))&&we(ft)}ne.unMount=new Set},Ke=(ft,yt)=>(ft&&yt&&set(J,ft,yt),!deepEqual(bt(),Y)),Se=(ft,yt,At)=>generateWatchOutput(ft,ne,{...re.mount?J:isUndefined(yt)?Y:isString$1(ft)?{[ft]:yt}:yt},At,yt),Ie=ft=>compact(get(re.mount?J:Y,ft,T.shouldUnregister?get(Y,ft,[]):[])),Ne=(ft,yt,At={})=>{const Rt=get(K,ft);let mt=yt;if(Rt){const ht=Rt._f;ht&&(!ht.disabled&&set(J,ft,getFieldValueAs(yt,ht)),mt=isHTMLElement(ht.ref)&&isNullOrUndefined(yt)?"":yt,isMultipleSelect(ht.ref)?[...ht.ref.options].forEach(jt=>jt.selected=mt.includes(jt.value)):ht.refs?isCheckBoxInput(ht.ref)?ht.refs.length>1?ht.refs.forEach(jt=>(!jt.defaultChecked||!jt.disabled)&&(jt.checked=Array.isArray(mt)?!!mt.find(Vt=>Vt===jt.value):mt===jt.value)):ht.refs[0]&&(ht.refs[0].checked=!!mt):ht.refs.forEach(jt=>jt.checked=jt.value===mt):isFileInput(ht.ref)?ht.ref.value="":(ht.ref.value=mt,ht.ref.type||ae.values.next({name:ft,values:{...J}})))}(At.shouldDirty||At.shouldTouch)&&Pe(ft,mt,At.shouldTouch,At.shouldDirty,!0),At.shouldValidate&&ut(ft)},pt=(ft,yt,At)=>{for(const Rt in yt){const mt=yt[Rt],ht=`${ft}.${Rt}`,jt=get(K,ht);(ne.array.has(ft)||!isPrimitive(mt)||jt&&!jt._f)&&!isDateObject(mt)?pt(ht,mt,At):Ne(ht,mt,At)}},at=(ft,yt,At={})=>{const Rt=get(K,ft),mt=ne.array.has(ft),ht=cloneObject(yt);set(J,ft,ht),mt?(ae.array.next({name:ft,values:{...J}}),(ie.isDirty||ie.dirtyFields)&&At.shouldDirty&&ae.state.next({name:ft,dirtyFields:getDirtyFields(Y,J),isDirty:Ke(ft,ht)})):Rt&&!Rt._f&&!isNullOrUndefined(ht)?pt(ft,ht,At):Ne(ft,ht,At),isWatched(ft,ne)&&ae.state.next({...V}),ae.values.next({name:ft,values:{...J}}),!re.mount&&C()},dt=async ft=>{const yt=ft.target;let At=yt.name,Rt=!0;const mt=get(K,At),ht=()=>yt.type?getFieldValue(mt._f):getEventValue(ft),jt=Vt=>{Rt=Number.isNaN(Vt)||Vt===get(J,At,Vt)};if(mt){let Vt,Bt;const er=ht(),sr=ft.type===EVENTS.BLUR||ft.type===EVENTS.FOCUS_OUT,ir=!hasValidation(mt._f)&&!$.resolver&&!get(V.errors,At)&&!mt._f.deps||skipValidation(sr,get(V.touchedFields,At),V.isSubmitted,le,oe),dr=isWatched(At,ne,sr);set(J,At,er),sr?(mt._f.onBlur&&mt._f.onBlur(ft),te&&te(0)):mt._f.onChange&&mt._f.onChange(ft);const ar=Pe(At,er,sr,!1),or=!isEmptyObject(ar)||dr;if(!sr&&ae.values.next({name:At,type:ft.type,values:{...J}}),ir)return ie.isValid&&he(),or&&ae.state.next({name:At,...dr?{}:ar});if(!sr&&dr&&ae.state.next({...V}),me(!0),$.resolver){const{errors:cr}=await xe([At]);if(jt(er),Rt){const Lt=schemaErrorLookup(V.errors,K,At),It=schemaErrorLookup(cr,K,Lt.name||At);Vt=It.error,At=It.name,Bt=isEmptyObject(cr)}}else Vt=(await validateField(mt,J,ce,$.shouldUseNativeValidation))[At],jt(er),Rt&&(Vt?Bt=!1:ie.isValid&&(Bt=await je(K,!0)));Rt&&(mt._f.deps&&ut(mt._f.deps),De(At,Bt,Vt,ar))}},Ct=(ft,yt)=>{if(get(V.errors,yt)&&ft.focus)return ft.focus(),1},ut=async(ft,yt={})=>{let At,Rt;const mt=convertToArrayPayload(ft);if(me(!0),$.resolver){const ht=await Ce(isUndefined(ft)?ft:mt);At=isEmptyObject(ht),Rt=ft?!mt.some(jt=>get(ht,jt)):At}else ft?(Rt=(await Promise.all(mt.map(async ht=>{const jt=get(K,ht);return await je(jt&&jt._f?{[ht]:jt}:jt)}))).every(Boolean),!(!Rt&&!V.isValid)&&he()):Rt=At=await je(K);return ae.state.next({...!isString$1(ft)||ie.isValid&&At!==V.isValid?{}:{name:ft},...$.resolver||!ft?{isValid:At}:{},errors:V.errors,isValidating:!1}),yt.shouldFocus&&!Rt&&iterateFieldsByAction(K,Ct,ft?mt:ne.mount),Rt},bt=ft=>{const yt={...Y,...re.mount?J:{}};return isUndefined(ft)?yt:isString$1(ft)?get(yt,ft):ft.map(At=>get(yt,At))},Re=(ft,yt)=>({invalid:!!get((yt||V).errors,ft),isDirty:!!get((yt||V).dirtyFields,ft),isTouched:!!get((yt||V).touchedFields,ft),error:get((yt||V).errors,ft)}),ue=ft=>{ft&&convertToArrayPayload(ft).forEach(yt=>unset(V.errors,yt)),ae.state.next({errors:ft?V.errors:{}})},be=(ft,yt,At)=>{const Rt=(get(K,ft,{_f:{}})._f||{}).ref;set(V.errors,ft,{...yt,ref:Rt}),ae.state.next({name:ft,errors:V.errors,isValid:!1}),At&&At.shouldFocus&&Rt&&Rt.focus&&Rt.focus()},ve=(ft,yt)=>isFunction(ft)?ae.values.subscribe({next:At=>ft(Se(void 0,yt),At)}):Se(ft,yt,!0),we=(ft,yt={})=>{for(const At of ft?convertToArrayPayload(ft):ne.mount)ne.mount.delete(At),ne.array.delete(At),yt.keepValue||(unset(K,At),unset(J,At)),!yt.keepError&&unset(V.errors,At),!yt.keepDirty&&unset(V.dirtyFields,At),!yt.keepTouched&&unset(V.touchedFields,At),!$.shouldUnregister&&!yt.keepDefaultValue&&unset(Y,At);ae.values.next({values:{...J}}),ae.state.next({...V,...yt.keepDirty?{isDirty:Ke()}:{}}),!yt.keepIsValid&&he()},_e=({disabled:ft,name:yt,field:At,fields:Rt,value:mt})=>{if(isBoolean(ft)){const ht=ft?void 0:isUndefined(mt)?getFieldValue(At?At._f:get(Rt,yt)._f):mt;set(J,yt,ht),Pe(yt,ht,!1,!1,!0)}},Oe=(ft,yt={})=>{let At=get(K,ft);const Rt=isBoolean(yt.disabled);return set(K,ft,{...At||{},_f:{...At&&At._f?At._f:{ref:{name:ft}},name:ft,mount:!0,...yt}}),ne.mount.add(ft),At?_e({field:At,disabled:yt.disabled,name:ft,value:yt.value}):Te(ft,!0,yt.value),{...Rt?{disabled:yt.disabled}:{},...$.progressive?{required:!!yt.required,min:getRuleValue(yt.min),max:getRuleValue(yt.max),minLength:getRuleValue(yt.minLength),maxLength:getRuleValue(yt.maxLength),pattern:getRuleValue(yt.pattern)}:{},name:ft,onChange:dt,onBlur:dt,ref:mt=>{if(mt){Oe(ft,yt),At=get(K,ft);const ht=isUndefined(mt.value)&&mt.querySelectorAll&&mt.querySelectorAll("input,select,textarea")[0]||mt,jt=isRadioOrCheckbox(ht),Vt=At._f.refs||[];if(jt?Vt.find(Bt=>Bt===ht):ht===At._f.ref)return;set(K,ft,{_f:{...At._f,...jt?{refs:[...Vt.filter(live),ht,...Array.isArray(get(Y,ft))?[{}]:[]],ref:{type:ht.type,name:ft}}:{ref:ht}}}),Te(ft,!1,void 0,ht)}else At=get(K,ft,{}),At._f&&(At._f.mount=!1),($.shouldUnregister||yt.shouldUnregister)&&!(isNameInFieldArray(ne.array,ft)&&re.action)&&ne.unMount.add(ft)}}},Qe=()=>$.shouldFocusError&&iterateFieldsByAction(K,Ct,ne.mount),ct=ft=>{isBoolean(ft)&&(ae.state.next({disabled:ft}),iterateFieldsByAction(K,(yt,At)=>{let Rt=ft;const mt=get(K,At);mt&&isBoolean(mt._f.disabled)&&(Rt||(Rt=mt._f.disabled)),yt.disabled=Rt},0,!1))},xt=(ft,yt)=>async At=>{let Rt;At&&(At.preventDefault&&At.preventDefault(),At.persist&&At.persist());let mt=cloneObject(J);if(ae.state.next({isSubmitting:!0}),$.resolver){const{errors:ht,values:jt}=await xe();V.errors=ht,mt=jt}else await je(K);if(unset(V.errors,"root"),isEmptyObject(V.errors)){ae.state.next({errors:{}});try{await ft(mt,At)}catch(ht){Rt=ht}}else yt&&await yt({...V.errors},At),Qe(),setTimeout(Qe);if(ae.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:isEmptyObject(V.errors)&&!Rt,submitCount:V.submitCount+1,errors:V.errors}),Rt)throw Rt},Tt=(ft,yt={})=>{get(K,ft)&&(isUndefined(yt.defaultValue)?at(ft,cloneObject(get(Y,ft))):(at(ft,yt.defaultValue),set(Y,ft,cloneObject(yt.defaultValue))),yt.keepTouched||unset(V.touchedFields,ft),yt.keepDirty||(unset(V.dirtyFields,ft),V.isDirty=yt.defaultValue?Ke(ft,cloneObject(get(Y,ft))):Ke()),yt.keepError||(unset(V.errors,ft),ie.isValid&&he()),ae.state.next({...V}))},Pt=(ft,yt={})=>{const At=ft?cloneObject(ft):Y,Rt=cloneObject(At),mt=ft&&!isEmptyObject(ft)?Rt:Y;if(yt.keepDefaultValues||(Y=At),!yt.keepValues){if(yt.keepDirtyValues)for(const ht of ne.mount)get(V.dirtyFields,ht)?set(mt,ht,get(J,ht)):at(ht,get(mt,ht));else{if(isWeb&&isUndefined(ft))for(const ht of ne.mount){const jt=get(K,ht);if(jt&&jt._f){const Vt=Array.isArray(jt._f.refs)?jt._f.refs[0]:jt._f.ref;if(isHTMLElement(Vt)){const Bt=Vt.closest("form");if(Bt){Bt.reset();break}}}}K={}}J=T.shouldUnregister?yt.keepDefaultValues?cloneObject(Y):{}:cloneObject(mt),ae.array.next({values:{...mt}}),ae.values.next({values:{...mt}})}ne={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!re.mount&&C(),re.mount=!ie.isValid||!!yt.keepIsValid||!!yt.keepDirtyValues,re.watch=!!T.shouldUnregister,ae.state.next({submitCount:yt.keepSubmitCount?V.submitCount:0,isDirty:yt.keepDirty?V.isDirty:!!(yt.keepDefaultValues&&!deepEqual(ft,Y)),isSubmitted:yt.keepIsSubmitted?V.isSubmitted:!1,dirtyFields:yt.keepDirtyValues?yt.keepDefaultValues&&J?getDirtyFields(Y,J):V.dirtyFields:yt.keepDefaultValues&&ft?getDirtyFields(Y,ft):{},touchedFields:yt.keepTouched?V.touchedFields:{},errors:yt.keepErrors?V.errors:{},isSubmitSuccessful:yt.keepIsSubmitSuccessful?V.isSubmitSuccessful:!1,isSubmitting:!1})},$t=(ft,yt)=>Pt(isFunction(ft)?ft(J):ft,yt);return{control:{register:Oe,unregister:we,getFieldState:Re,handleSubmit:xt,setError:be,_executeSchema:xe,_getWatch:Se,_getDirty:Ke,_updateValid:he,_removeUnmounted:Le,_updateFieldArray:ge,_updateDisabledField:_e,_getFieldArray:Ie,_reset:Pt,_resetDefaultValues:()=>isFunction($.defaultValues)&&$.defaultValues().then(ft=>{$t(ft,$.resetOptions),ae.state.next({isLoading:!1})}),_updateFormState:ft=>{V={...V,...ft}},_disableForm:ct,_subjects:ae,_proxyFormState:ie,_setErrors:fe,get _fields(){return K},get _formValues(){return J},get _state(){return re},set _state(ft){re=ft},get _defaultValues(){return Y},get _names(){return ne},set _names(ft){ne=ft},get _formState(){return V},set _formState(ft){V=ft},get _options(){return $},set _options(ft){$={...$,...ft}}},trigger:ut,register:Oe,handleSubmit:xt,watch:ve,setValue:at,getValues:bt,reset:$t,resetField:Tt,clearErrors:ue,unregister:we,setError:be,setFocus:(ft,yt={})=>{const At=get(K,ft),Rt=At&&At._f;if(Rt){const mt=Rt.refs?Rt.refs[0]:Rt.ref;mt.focus&&(mt.focus(),yt.shouldSelect&&mt.select())}},getFieldState:Re}}function useForm(T={}){const C=React.useRef(),$=React.useRef(),[V,K]=React.useState({isDirty:!1,isValidating:!1,isLoading:isFunction(T.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:T.errors||{},disabled:T.disabled||!1,defaultValues:isFunction(T.defaultValues)?void 0:T.defaultValues});C.current||(C.current={...createFormControl(T,()=>K(J=>({...J}))),formState:V});const Y=C.current.control;return Y._options=T,useSubscribe({subject:Y._subjects.state,next:J=>{shouldRenderFormState(J,Y._proxyFormState,Y._updateFormState,!0)&&K({...Y._formState})}}),React.useEffect(()=>Y._disableForm(T.disabled),[Y,T.disabled]),React.useEffect(()=>{if(Y._proxyFormState.isDirty){const J=Y._getDirty();J!==V.isDirty&&Y._subjects.state.next({isDirty:J})}},[Y,V.isDirty]),React.useEffect(()=>{T.values&&!deepEqual(T.values,$.current)?(Y._reset(T.values,Y._options.resetOptions),$.current=T.values,K(J=>({...J}))):Y._resetDefaultValues()},[T.values,Y]),React.useEffect(()=>{T.errors&&Y._setErrors(T.errors)},[T.errors,Y]),React.useEffect(()=>{Y._state.mount||(Y._updateValid(),Y._state.mount=!0),Y._state.watch&&(Y._state.watch=!1,Y._subjects.state.next({...Y._formState})),Y._removeUnmounted()}),React.useEffect(()=>{T.shouldUnregister&&Y._subjects.values.next({values:Y._getWatch()})},[T.shouldUnregister,Y]),C.current.formState=getProxyFormState(V,Y),C.current}var t$1=function(T,C,$){if(T&&"reportValidity"in T){var V=get($,C);T.setCustomValidity(V&&V.message||""),T.reportValidity()}},i=function(T,C){var $=function(K){var Y=C.fields[K];Y&&Y.ref&&"reportValidity"in Y.ref?t$1(Y.ref,K,T):Y.refs&&Y.refs.forEach(function(J){return t$1(J,K,T)})};for(var V in C.fields)$(V)},n$1=function(T,C){C.shouldUseNativeValidation&&i(T,C);var $={};for(var V in T){var K=get(C.fields,V),Y=Object.assign(T[V]||{},{ref:K&&K.ref});if(o(C.names||Object.keys(T),V)){var J=Object.assign({},get($,V));set(J,"root",Y),set($,V,J)}else set($,V,Y)}return $},o=function(T,C){return T.some(function($){return $.startsWith(C+".")})},n=function(T,C){for(var $={};T.length;){var V=T[0],K=V.code,Y=V.message,J=V.path.join(".");if(!$[J])if("unionErrors"in V){var re=V.unionErrors[0].errors[0];$[J]={message:re.message,type:re.code}}else $[J]={message:Y,type:K};if("unionErrors"in V&&V.unionErrors.forEach(function(se){return se.errors.forEach(function(ie){return T.push(ie)})}),C){var ne=$[J].types,te=ne&&ne[V.code];$[J]=appendErrors(J,C,$,K,te?[].concat(te,V.message):V.message)}T.shift()}return $},t=function(T,C,$){return $===void 0&&($={}),function(V,K,Y){try{return Promise.resolve(function(J,re){try{var ne=Promise.resolve(T[$.mode==="sync"?"parse":"parseAsync"](V,C)).then(function(te){return Y.shouldUseNativeValidation&&i({},Y),{errors:{},values:$.raw?V:te}})}catch(te){return re(te)}return ne&&ne.then?ne.then(void 0,re):ne}(0,function(J){if(function(re){return re.errors!=null}(J))return{values:{},errors:n$1(n(J.errors,!Y.shouldUseNativeValidation&&Y.criteriaMode==="all"),Y)};throw J}))}catch(J){return Promise.reject(J)}}},util;(function(T){T.assertEqual=K=>K;function C(K){}T.assertIs=C;function $(K){throw new Error}T.assertNever=$,T.arrayToEnum=K=>{const Y={};for(const J of K)Y[J]=J;return Y},T.getValidEnumValues=K=>{const Y=T.objectKeys(K).filter(re=>typeof K[K[re]]!="number"),J={};for(const re of Y)J[re]=K[re];return T.objectValues(J)},T.objectValues=K=>T.objectKeys(K).map(function(Y){return K[Y]}),T.objectKeys=typeof Object.keys=="function"?K=>Object.keys(K):K=>{const Y=[];for(const J in K)Object.prototype.hasOwnProperty.call(K,J)&&Y.push(J);return Y},T.find=(K,Y)=>{for(const J of K)if(Y(J))return J},T.isInteger=typeof Number.isInteger=="function"?K=>Number.isInteger(K):K=>typeof K=="number"&&isFinite(K)&&Math.floor(K)===K;function V(K,Y=" | "){return K.map(J=>typeof J=="string"?`'${J}'`:J).join(Y)}T.joinValues=V,T.jsonStringifyReplacer=(K,Y)=>typeof Y=="bigint"?Y.toString():Y})(util||(util={}));var objectUtil;(function(T){T.mergeShapes=(C,$)=>({...C,...$})})(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=T=>{switch(typeof T){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return isNaN(T)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(T)?ZodParsedType.array:T===null?ZodParsedType.null:T.then&&typeof T.then=="function"&&T.catch&&typeof T.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&T instanceof Map?ZodParsedType.map:typeof Set<"u"&&T instanceof Set?ZodParsedType.set:typeof Date<"u"&&T instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=T=>JSON.stringify(T,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{constructor(C){super(),this.issues=[],this.addIssue=V=>{this.issues=[...this.issues,V]},this.addIssues=(V=[])=>{this.issues=[...this.issues,...V]};const $=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,$):this.__proto__=$,this.name="ZodError",this.issues=C}get errors(){return this.issues}format(C){const $=C||function(Y){return Y.message},V={_errors:[]},K=Y=>{for(const J of Y.issues)if(J.code==="invalid_union")J.unionErrors.map(K);else if(J.code==="invalid_return_type")K(J.returnTypeError);else if(J.code==="invalid_arguments")K(J.argumentsError);else if(J.path.length===0)V._errors.push($(J));else{let re=V,ne=0;for(;ne$.message){const $={},V=[];for(const K of this.issues)K.path.length>0?($[K.path[0]]=$[K.path[0]]||[],$[K.path[0]].push(C(K))):V.push(C(K));return{formErrors:V,fieldErrors:$}}get formErrors(){return this.flatten()}}ZodError.create=T=>new ZodError(T);const errorMap=(T,C)=>{let $;switch(T.code){case ZodIssueCode.invalid_type:T.received===ZodParsedType.undefined?$="Required":$=`Expected ${T.expected}, received ${T.received}`;break;case ZodIssueCode.invalid_literal:$=`Invalid literal value, expected ${JSON.stringify(T.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:$=`Unrecognized key(s) in object: ${util.joinValues(T.keys,", ")}`;break;case ZodIssueCode.invalid_union:$="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:$=`Invalid discriminator value. Expected ${util.joinValues(T.options)}`;break;case ZodIssueCode.invalid_enum_value:$=`Invalid enum value. Expected ${util.joinValues(T.options)}, received '${T.received}'`;break;case ZodIssueCode.invalid_arguments:$="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:$="Invalid function return type";break;case ZodIssueCode.invalid_date:$="Invalid date";break;case ZodIssueCode.invalid_string:typeof T.validation=="object"?"includes"in T.validation?($=`Invalid input: must include "${T.validation.includes}"`,typeof T.validation.position=="number"&&($=`${$} at one or more positions greater than or equal to ${T.validation.position}`)):"startsWith"in T.validation?$=`Invalid input: must start with "${T.validation.startsWith}"`:"endsWith"in T.validation?$=`Invalid input: must end with "${T.validation.endsWith}"`:util.assertNever(T.validation):T.validation!=="regex"?$=`Invalid ${T.validation}`:$="Invalid";break;case ZodIssueCode.too_small:T.type==="array"?$=`Array must contain ${T.exact?"exactly":T.inclusive?"at least":"more than"} ${T.minimum} element(s)`:T.type==="string"?$=`String must contain ${T.exact?"exactly":T.inclusive?"at least":"over"} ${T.minimum} character(s)`:T.type==="number"?$=`Number must be ${T.exact?"exactly equal to ":T.inclusive?"greater than or equal to ":"greater than "}${T.minimum}`:T.type==="date"?$=`Date must be ${T.exact?"exactly equal to ":T.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(T.minimum))}`:$="Invalid input";break;case ZodIssueCode.too_big:T.type==="array"?$=`Array must contain ${T.exact?"exactly":T.inclusive?"at most":"less than"} ${T.maximum} element(s)`:T.type==="string"?$=`String must contain ${T.exact?"exactly":T.inclusive?"at most":"under"} ${T.maximum} character(s)`:T.type==="number"?$=`Number must be ${T.exact?"exactly":T.inclusive?"less than or equal to":"less than"} ${T.maximum}`:T.type==="bigint"?$=`BigInt must be ${T.exact?"exactly":T.inclusive?"less than or equal to":"less than"} ${T.maximum}`:T.type==="date"?$=`Date must be ${T.exact?"exactly":T.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(T.maximum))}`:$="Invalid input";break;case ZodIssueCode.custom:$="Invalid input";break;case ZodIssueCode.invalid_intersection_types:$="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:$=`Number must be a multiple of ${T.multipleOf}`;break;case ZodIssueCode.not_finite:$="Number must be finite";break;default:$=C.defaultError,util.assertNever(T)}return{message:$}};let overrideErrorMap=errorMap;function setErrorMap(T){overrideErrorMap=T}function getErrorMap(){return overrideErrorMap}const makeIssue=T=>{const{data:C,path:$,errorMaps:V,issueData:K}=T,Y=[...$,...K.path||[]],J={...K,path:Y};let re="";const ne=V.filter(te=>!!te).slice().reverse();for(const te of ne)re=te(J,{data:C,defaultError:re}).message;return{...K,path:Y,message:K.message||re}},EMPTY_PATH=[];function addIssueToContext(T,C){const $=makeIssue({issueData:C,data:T.data,path:T.path,errorMaps:[T.common.contextualErrorMap,T.schemaErrorMap,getErrorMap(),errorMap].filter(V=>!!V)});T.common.issues.push($)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(C,$){const V=[];for(const K of $){if(K.status==="aborted")return INVALID;K.status==="dirty"&&C.dirty(),V.push(K.value)}return{status:C.value,value:V}}static async mergeObjectAsync(C,$){const V=[];for(const K of $)V.push({key:await K.key,value:await K.value});return ParseStatus.mergeObjectSync(C,V)}static mergeObjectSync(C,$){const V={};for(const K of $){const{key:Y,value:J}=K;if(Y.status==="aborted"||J.status==="aborted")return INVALID;Y.status==="dirty"&&C.dirty(),J.status==="dirty"&&C.dirty(),Y.value!=="__proto__"&&(typeof J.value<"u"||K.alwaysSet)&&(V[Y.value]=J.value)}return{status:C.value,value:V}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=T=>({status:"dirty",value:T}),OK=T=>({status:"valid",value:T}),isAborted=T=>T.status==="aborted",isDirty=T=>T.status==="dirty",isValid=T=>T.status==="valid",isAsync=T=>typeof Promise<"u"&&T instanceof Promise;var errorUtil;(function(T){T.errToObj=C=>typeof C=="string"?{message:C}:C||{},T.toString=C=>typeof C=="string"?C:C==null?void 0:C.message})(errorUtil||(errorUtil={}));class ParseInputLazyPath{constructor(C,$,V,K){this._cachedPath=[],this.parent=C,this.data=$,this._path=V,this._key=K}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(T,C)=>{if(isValid(C))return{success:!0,data:C.value};if(!T.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const $=new ZodError(T.common.issues);return this._error=$,this._error}}};function processCreateParams(T){if(!T)return{};const{errorMap:C,invalid_type_error:$,required_error:V,description:K}=T;if(C&&($||V))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return C?{errorMap:C,description:K}:{errorMap:(J,re)=>J.code!=="invalid_type"?{message:re.defaultError}:typeof re.data>"u"?{message:V??re.defaultError}:{message:$??re.defaultError},description:K}}class ZodType{constructor(C){this.spa=this.safeParseAsync,this._def=C,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(C){return getParsedType(C.data)}_getOrReturnCtx(C,$){return $||{common:C.parent.common,data:C.data,parsedType:getParsedType(C.data),schemaErrorMap:this._def.errorMap,path:C.path,parent:C.parent}}_processInputParams(C){return{status:new ParseStatus,ctx:{common:C.parent.common,data:C.data,parsedType:getParsedType(C.data),schemaErrorMap:this._def.errorMap,path:C.path,parent:C.parent}}}_parseSync(C){const $=this._parse(C);if(isAsync($))throw new Error("Synchronous parse encountered promise.");return $}_parseAsync(C){const $=this._parse(C);return Promise.resolve($)}parse(C,$){const V=this.safeParse(C,$);if(V.success)return V.data;throw V.error}safeParse(C,$){var V;const K={common:{issues:[],async:(V=$==null?void 0:$.async)!==null&&V!==void 0?V:!1,contextualErrorMap:$==null?void 0:$.errorMap},path:($==null?void 0:$.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:C,parsedType:getParsedType(C)},Y=this._parseSync({data:C,path:K.path,parent:K});return handleResult(K,Y)}async parseAsync(C,$){const V=await this.safeParseAsync(C,$);if(V.success)return V.data;throw V.error}async safeParseAsync(C,$){const V={common:{issues:[],contextualErrorMap:$==null?void 0:$.errorMap,async:!0},path:($==null?void 0:$.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:C,parsedType:getParsedType(C)},K=this._parse({data:C,path:V.path,parent:V}),Y=await(isAsync(K)?K:Promise.resolve(K));return handleResult(V,Y)}refine(C,$){const V=K=>typeof $=="string"||typeof $>"u"?{message:$}:typeof $=="function"?$(K):$;return this._refinement((K,Y)=>{const J=C(K),re=()=>Y.addIssue({code:ZodIssueCode.custom,...V(K)});return typeof Promise<"u"&&J instanceof Promise?J.then(ne=>ne?!0:(re(),!1)):J?!0:(re(),!1)})}refinement(C,$){return this._refinement((V,K)=>C(V)?!0:(K.addIssue(typeof $=="function"?$(V,K):$),!1))}_refinement(C){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:C}})}superRefine(C){return this._refinement(C)}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this,this._def)}promise(){return ZodPromise.create(this,this._def)}or(C){return ZodUnion.create([this,C],this._def)}and(C){return ZodIntersection.create(this,C,this._def)}transform(C){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:C}})}default(C){const $=typeof C=="function"?C:()=>C;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:$,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(C){const $=typeof C=="function"?C:()=>C;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:$,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(C){const $=this.constructor;return new $({...this._def,description:C})}pipe(C){return ZodPipeline.create(this,C)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[a-z][a-z0-9]*$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,ipv6Regex=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,datetimeRegex=T=>T.precision?T.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${T.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${T.precision}}Z$`):T.precision===0?T.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):T.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function isValidIP(T,C){return!!((C==="v4"||!C)&&ipv4Regex.test(T)||(C==="v6"||!C)&&ipv6Regex.test(T))}class ZodString extends ZodType{_parse(C){if(this._def.coerce&&(C.data=String(C.data)),this._getType(C)!==ZodParsedType.string){const Y=this._getOrReturnCtx(C);return addIssueToContext(Y,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:Y.parsedType}),INVALID}const V=new ParseStatus;let K;for(const Y of this._def.checks)if(Y.kind==="min")C.data.lengthY.value&&(K=this._getOrReturnCtx(C,K),addIssueToContext(K,{code:ZodIssueCode.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),V.dirty());else if(Y.kind==="length"){const J=C.data.length>Y.value,re=C.data.lengthC.test(K),{validation:$,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(V)})}_addCheck(C){return new ZodString({...this._def,checks:[...this._def.checks,C]})}email(C){return this._addCheck({kind:"email",...errorUtil.errToObj(C)})}url(C){return this._addCheck({kind:"url",...errorUtil.errToObj(C)})}emoji(C){return this._addCheck({kind:"emoji",...errorUtil.errToObj(C)})}uuid(C){return this._addCheck({kind:"uuid",...errorUtil.errToObj(C)})}cuid(C){return this._addCheck({kind:"cuid",...errorUtil.errToObj(C)})}cuid2(C){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(C)})}ulid(C){return this._addCheck({kind:"ulid",...errorUtil.errToObj(C)})}ip(C){return this._addCheck({kind:"ip",...errorUtil.errToObj(C)})}datetime(C){var $;return typeof C=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:C}):this._addCheck({kind:"datetime",precision:typeof(C==null?void 0:C.precision)>"u"?null:C==null?void 0:C.precision,offset:($=C==null?void 0:C.offset)!==null&&$!==void 0?$:!1,...errorUtil.errToObj(C==null?void 0:C.message)})}regex(C,$){return this._addCheck({kind:"regex",regex:C,...errorUtil.errToObj($)})}includes(C,$){return this._addCheck({kind:"includes",value:C,position:$==null?void 0:$.position,...errorUtil.errToObj($==null?void 0:$.message)})}startsWith(C,$){return this._addCheck({kind:"startsWith",value:C,...errorUtil.errToObj($)})}endsWith(C,$){return this._addCheck({kind:"endsWith",value:C,...errorUtil.errToObj($)})}min(C,$){return this._addCheck({kind:"min",value:C,...errorUtil.errToObj($)})}max(C,$){return this._addCheck({kind:"max",value:C,...errorUtil.errToObj($)})}length(C,$){return this._addCheck({kind:"length",value:C,...errorUtil.errToObj($)})}nonempty(C){return this.min(1,errorUtil.errToObj(C))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(C=>C.kind==="datetime")}get isEmail(){return!!this._def.checks.find(C=>C.kind==="email")}get isURL(){return!!this._def.checks.find(C=>C.kind==="url")}get isEmoji(){return!!this._def.checks.find(C=>C.kind==="emoji")}get isUUID(){return!!this._def.checks.find(C=>C.kind==="uuid")}get isCUID(){return!!this._def.checks.find(C=>C.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(C=>C.kind==="cuid2")}get isULID(){return!!this._def.checks.find(C=>C.kind==="ulid")}get isIP(){return!!this._def.checks.find(C=>C.kind==="ip")}get minLength(){let C=null;for(const $ of this._def.checks)$.kind==="min"&&(C===null||$.value>C)&&(C=$.value);return C}get maxLength(){let C=null;for(const $ of this._def.checks)$.kind==="max"&&(C===null||$.value{var C;return new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(C=T==null?void 0:T.coerce)!==null&&C!==void 0?C:!1,...processCreateParams(T)})};function floatSafeRemainder(T,C){const $=(T.toString().split(".")[1]||"").length,V=(C.toString().split(".")[1]||"").length,K=$>V?$:V,Y=parseInt(T.toFixed(K).replace(".","")),J=parseInt(C.toFixed(K).replace(".",""));return Y%J/Math.pow(10,K)}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(C){if(this._def.coerce&&(C.data=Number(C.data)),this._getType(C)!==ZodParsedType.number){const Y=this._getOrReturnCtx(C);return addIssueToContext(Y,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:Y.parsedType}),INVALID}let V;const K=new ParseStatus;for(const Y of this._def.checks)Y.kind==="int"?util.isInteger(C.data)||(V=this._getOrReturnCtx(C,V),addIssueToContext(V,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:Y.message}),K.dirty()):Y.kind==="min"?(Y.inclusive?C.dataY.value:C.data>=Y.value)&&(V=this._getOrReturnCtx(C,V),addIssueToContext(V,{code:ZodIssueCode.too_big,maximum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),K.dirty()):Y.kind==="multipleOf"?floatSafeRemainder(C.data,Y.value)!==0&&(V=this._getOrReturnCtx(C,V),addIssueToContext(V,{code:ZodIssueCode.not_multiple_of,multipleOf:Y.value,message:Y.message}),K.dirty()):Y.kind==="finite"?Number.isFinite(C.data)||(V=this._getOrReturnCtx(C,V),addIssueToContext(V,{code:ZodIssueCode.not_finite,message:Y.message}),K.dirty()):util.assertNever(Y);return{status:K.value,value:C.data}}gte(C,$){return this.setLimit("min",C,!0,errorUtil.toString($))}gt(C,$){return this.setLimit("min",C,!1,errorUtil.toString($))}lte(C,$){return this.setLimit("max",C,!0,errorUtil.toString($))}lt(C,$){return this.setLimit("max",C,!1,errorUtil.toString($))}setLimit(C,$,V,K){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:C,value:$,inclusive:V,message:errorUtil.toString(K)}]})}_addCheck(C){return new ZodNumber({...this._def,checks:[...this._def.checks,C]})}int(C){return this._addCheck({kind:"int",message:errorUtil.toString(C)})}positive(C){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(C)})}negative(C){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(C)})}nonpositive(C){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(C)})}nonnegative(C){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(C)})}multipleOf(C,$){return this._addCheck({kind:"multipleOf",value:C,message:errorUtil.toString($)})}finite(C){return this._addCheck({kind:"finite",message:errorUtil.toString(C)})}safe(C){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(C)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(C)})}get minValue(){let C=null;for(const $ of this._def.checks)$.kind==="min"&&(C===null||$.value>C)&&(C=$.value);return C}get maxValue(){let C=null;for(const $ of this._def.checks)$.kind==="max"&&(C===null||$.valueC.kind==="int"||C.kind==="multipleOf"&&util.isInteger(C.value))}get isFinite(){let C=null,$=null;for(const V of this._def.checks){if(V.kind==="finite"||V.kind==="int"||V.kind==="multipleOf")return!0;V.kind==="min"?($===null||V.value>$)&&($=V.value):V.kind==="max"&&(C===null||V.valuenew ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(T==null?void 0:T.coerce)||!1,...processCreateParams(T)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(C){if(this._def.coerce&&(C.data=BigInt(C.data)),this._getType(C)!==ZodParsedType.bigint){const Y=this._getOrReturnCtx(C);return addIssueToContext(Y,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:Y.parsedType}),INVALID}let V;const K=new ParseStatus;for(const Y of this._def.checks)Y.kind==="min"?(Y.inclusive?C.dataY.value:C.data>=Y.value)&&(V=this._getOrReturnCtx(C,V),addIssueToContext(V,{code:ZodIssueCode.too_big,type:"bigint",maximum:Y.value,inclusive:Y.inclusive,message:Y.message}),K.dirty()):Y.kind==="multipleOf"?C.data%Y.value!==BigInt(0)&&(V=this._getOrReturnCtx(C,V),addIssueToContext(V,{code:ZodIssueCode.not_multiple_of,multipleOf:Y.value,message:Y.message}),K.dirty()):util.assertNever(Y);return{status:K.value,value:C.data}}gte(C,$){return this.setLimit("min",C,!0,errorUtil.toString($))}gt(C,$){return this.setLimit("min",C,!1,errorUtil.toString($))}lte(C,$){return this.setLimit("max",C,!0,errorUtil.toString($))}lt(C,$){return this.setLimit("max",C,!1,errorUtil.toString($))}setLimit(C,$,V,K){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:C,value:$,inclusive:V,message:errorUtil.toString(K)}]})}_addCheck(C){return new ZodBigInt({...this._def,checks:[...this._def.checks,C]})}positive(C){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(C)})}negative(C){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(C)})}nonpositive(C){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(C)})}nonnegative(C){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(C)})}multipleOf(C,$){return this._addCheck({kind:"multipleOf",value:C,message:errorUtil.toString($)})}get minValue(){let C=null;for(const $ of this._def.checks)$.kind==="min"&&(C===null||$.value>C)&&(C=$.value);return C}get maxValue(){let C=null;for(const $ of this._def.checks)$.kind==="max"&&(C===null||$.value{var C;return new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(C=T==null?void 0:T.coerce)!==null&&C!==void 0?C:!1,...processCreateParams(T)})};class ZodBoolean extends ZodType{_parse(C){if(this._def.coerce&&(C.data=!!C.data),this._getType(C)!==ZodParsedType.boolean){const V=this._getOrReturnCtx(C);return addIssueToContext(V,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:V.parsedType}),INVALID}return OK(C.data)}}ZodBoolean.create=T=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(T==null?void 0:T.coerce)||!1,...processCreateParams(T)});class ZodDate extends ZodType{_parse(C){if(this._def.coerce&&(C.data=new Date(C.data)),this._getType(C)!==ZodParsedType.date){const Y=this._getOrReturnCtx(C);return addIssueToContext(Y,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:Y.parsedType}),INVALID}if(isNaN(C.data.getTime())){const Y=this._getOrReturnCtx(C);return addIssueToContext(Y,{code:ZodIssueCode.invalid_date}),INVALID}const V=new ParseStatus;let K;for(const Y of this._def.checks)Y.kind==="min"?C.data.getTime()Y.value&&(K=this._getOrReturnCtx(C,K),addIssueToContext(K,{code:ZodIssueCode.too_big,message:Y.message,inclusive:!0,exact:!1,maximum:Y.value,type:"date"}),V.dirty()):util.assertNever(Y);return{status:V.value,value:new Date(C.data.getTime())}}_addCheck(C){return new ZodDate({...this._def,checks:[...this._def.checks,C]})}min(C,$){return this._addCheck({kind:"min",value:C.getTime(),message:errorUtil.toString($)})}max(C,$){return this._addCheck({kind:"max",value:C.getTime(),message:errorUtil.toString($)})}get minDate(){let C=null;for(const $ of this._def.checks)$.kind==="min"&&(C===null||$.value>C)&&(C=$.value);return C!=null?new Date(C):null}get maxDate(){let C=null;for(const $ of this._def.checks)$.kind==="max"&&(C===null||$.valuenew ZodDate({checks:[],coerce:(T==null?void 0:T.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(T)});class ZodSymbol extends ZodType{_parse(C){if(this._getType(C)!==ZodParsedType.symbol){const V=this._getOrReturnCtx(C);return addIssueToContext(V,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:V.parsedType}),INVALID}return OK(C.data)}}ZodSymbol.create=T=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(T)});class ZodUndefined extends ZodType{_parse(C){if(this._getType(C)!==ZodParsedType.undefined){const V=this._getOrReturnCtx(C);return addIssueToContext(V,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:V.parsedType}),INVALID}return OK(C.data)}}ZodUndefined.create=T=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(T)});class ZodNull extends ZodType{_parse(C){if(this._getType(C)!==ZodParsedType.null){const V=this._getOrReturnCtx(C);return addIssueToContext(V,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:V.parsedType}),INVALID}return OK(C.data)}}ZodNull.create=T=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(T)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(C){return OK(C.data)}}ZodAny.create=T=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(T)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(C){return OK(C.data)}}ZodUnknown.create=T=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(T)});class ZodNever extends ZodType{_parse(C){const $=this._getOrReturnCtx(C);return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:$.parsedType}),INVALID}}ZodNever.create=T=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(T)});class ZodVoid extends ZodType{_parse(C){if(this._getType(C)!==ZodParsedType.undefined){const V=this._getOrReturnCtx(C);return addIssueToContext(V,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:V.parsedType}),INVALID}return OK(C.data)}}ZodVoid.create=T=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(T)});class ZodArray extends ZodType{_parse(C){const{ctx:$,status:V}=this._processInputParams(C),K=this._def;if($.parsedType!==ZodParsedType.array)return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:$.parsedType}),INVALID;if(K.exactLength!==null){const J=$.data.length>K.exactLength.value,re=$.data.lengthK.maxLength.value&&(addIssueToContext($,{code:ZodIssueCode.too_big,maximum:K.maxLength.value,type:"array",inclusive:!0,exact:!1,message:K.maxLength.message}),V.dirty()),$.common.async)return Promise.all([...$.data].map((J,re)=>K.type._parseAsync(new ParseInputLazyPath($,J,$.path,re)))).then(J=>ParseStatus.mergeArray(V,J));const Y=[...$.data].map((J,re)=>K.type._parseSync(new ParseInputLazyPath($,J,$.path,re)));return ParseStatus.mergeArray(V,Y)}get element(){return this._def.type}min(C,$){return new ZodArray({...this._def,minLength:{value:C,message:errorUtil.toString($)}})}max(C,$){return new ZodArray({...this._def,maxLength:{value:C,message:errorUtil.toString($)}})}length(C,$){return new ZodArray({...this._def,exactLength:{value:C,message:errorUtil.toString($)}})}nonempty(C){return this.min(1,C)}}ZodArray.create=(T,C)=>new ZodArray({type:T,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(C)});function deepPartialify(T){if(T instanceof ZodObject){const C={};for(const $ in T.shape){const V=T.shape[$];C[$]=ZodOptional.create(deepPartialify(V))}return new ZodObject({...T._def,shape:()=>C})}else return T instanceof ZodArray?new ZodArray({...T._def,type:deepPartialify(T.element)}):T instanceof ZodOptional?ZodOptional.create(deepPartialify(T.unwrap())):T instanceof ZodNullable?ZodNullable.create(deepPartialify(T.unwrap())):T instanceof ZodTuple?ZodTuple.create(T.items.map(C=>deepPartialify(C))):T}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const C=this._def.shape(),$=util.objectKeys(C);return this._cached={shape:C,keys:$}}_parse(C){if(this._getType(C)!==ZodParsedType.object){const te=this._getOrReturnCtx(C);return addIssueToContext(te,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:te.parsedType}),INVALID}const{status:V,ctx:K}=this._processInputParams(C),{shape:Y,keys:J}=this._getCached(),re=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const te in K.data)J.includes(te)||re.push(te);const ne=[];for(const te of J){const se=Y[te],ie=K.data[te];ne.push({key:{status:"valid",value:te},value:se._parse(new ParseInputLazyPath(K,ie,K.path,te)),alwaysSet:te in K.data})}if(this._def.catchall instanceof ZodNever){const te=this._def.unknownKeys;if(te==="passthrough")for(const se of re)ne.push({key:{status:"valid",value:se},value:{status:"valid",value:K.data[se]}});else if(te==="strict")re.length>0&&(addIssueToContext(K,{code:ZodIssueCode.unrecognized_keys,keys:re}),V.dirty());else if(te!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const te=this._def.catchall;for(const se of re){const ie=K.data[se];ne.push({key:{status:"valid",value:se},value:te._parse(new ParseInputLazyPath(K,ie,K.path,se)),alwaysSet:se in K.data})}}return K.common.async?Promise.resolve().then(async()=>{const te=[];for(const se of ne){const ie=await se.key;te.push({key:ie,value:await se.value,alwaysSet:se.alwaysSet})}return te}).then(te=>ParseStatus.mergeObjectSync(V,te)):ParseStatus.mergeObjectSync(V,ne)}get shape(){return this._def.shape()}strict(C){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...C!==void 0?{errorMap:($,V)=>{var K,Y,J,re;const ne=(J=(Y=(K=this._def).errorMap)===null||Y===void 0?void 0:Y.call(K,$,V).message)!==null&&J!==void 0?J:V.defaultError;return $.code==="unrecognized_keys"?{message:(re=errorUtil.errToObj(C).message)!==null&&re!==void 0?re:ne}:{message:ne}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(C){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...C})})}merge(C){return new ZodObject({unknownKeys:C._def.unknownKeys,catchall:C._def.catchall,shape:()=>({...this._def.shape(),...C._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(C,$){return this.augment({[C]:$})}catchall(C){return new ZodObject({...this._def,catchall:C})}pick(C){const $={};return util.objectKeys(C).forEach(V=>{C[V]&&this.shape[V]&&($[V]=this.shape[V])}),new ZodObject({...this._def,shape:()=>$})}omit(C){const $={};return util.objectKeys(this.shape).forEach(V=>{C[V]||($[V]=this.shape[V])}),new ZodObject({...this._def,shape:()=>$})}deepPartial(){return deepPartialify(this)}partial(C){const $={};return util.objectKeys(this.shape).forEach(V=>{const K=this.shape[V];C&&!C[V]?$[V]=K:$[V]=K.optional()}),new ZodObject({...this._def,shape:()=>$})}required(C){const $={};return util.objectKeys(this.shape).forEach(V=>{if(C&&!C[V])$[V]=this.shape[V];else{let Y=this.shape[V];for(;Y instanceof ZodOptional;)Y=Y._def.innerType;$[V]=Y}}),new ZodObject({...this._def,shape:()=>$})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(T,C)=>new ZodObject({shape:()=>T,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(C)});ZodObject.strictCreate=(T,C)=>new ZodObject({shape:()=>T,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(C)});ZodObject.lazycreate=(T,C)=>new ZodObject({shape:T,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(C)});class ZodUnion extends ZodType{_parse(C){const{ctx:$}=this._processInputParams(C),V=this._def.options;function K(Y){for(const re of Y)if(re.result.status==="valid")return re.result;for(const re of Y)if(re.result.status==="dirty")return $.common.issues.push(...re.ctx.common.issues),re.result;const J=Y.map(re=>new ZodError(re.ctx.common.issues));return addIssueToContext($,{code:ZodIssueCode.invalid_union,unionErrors:J}),INVALID}if($.common.async)return Promise.all(V.map(async Y=>{const J={...$,common:{...$.common,issues:[]},parent:null};return{result:await Y._parseAsync({data:$.data,path:$.path,parent:J}),ctx:J}})).then(K);{let Y;const J=[];for(const ne of V){const te={...$,common:{...$.common,issues:[]},parent:null},se=ne._parseSync({data:$.data,path:$.path,parent:te});if(se.status==="valid")return se;se.status==="dirty"&&!Y&&(Y={result:se,ctx:te}),te.common.issues.length&&J.push(te.common.issues)}if(Y)return $.common.issues.push(...Y.ctx.common.issues),Y.result;const re=J.map(ne=>new ZodError(ne));return addIssueToContext($,{code:ZodIssueCode.invalid_union,unionErrors:re}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(T,C)=>new ZodUnion({options:T,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(C)});const getDiscriminator=T=>T instanceof ZodLazy?getDiscriminator(T.schema):T instanceof ZodEffects?getDiscriminator(T.innerType()):T instanceof ZodLiteral?[T.value]:T instanceof ZodEnum?T.options:T instanceof ZodNativeEnum?Object.keys(T.enum):T instanceof ZodDefault?getDiscriminator(T._def.innerType):T instanceof ZodUndefined?[void 0]:T instanceof ZodNull?[null]:null;class ZodDiscriminatedUnion extends ZodType{_parse(C){const{ctx:$}=this._processInputParams(C);if($.parsedType!==ZodParsedType.object)return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:$.parsedType}),INVALID;const V=this.discriminator,K=$.data[V],Y=this.optionsMap.get(K);return Y?$.common.async?Y._parseAsync({data:$.data,path:$.path,parent:$}):Y._parseSync({data:$.data,path:$.path,parent:$}):(addIssueToContext($,{code:ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[V]}),INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(C,$,V){const K=new Map;for(const Y of $){const J=getDiscriminator(Y.shape[C]);if(!J)throw new Error(`A discriminator value for key \`${C}\` could not be extracted from all schema options`);for(const re of J){if(K.has(re))throw new Error(`Discriminator property ${String(C)} has duplicate value ${String(re)}`);K.set(re,Y)}}return new ZodDiscriminatedUnion({typeName:ZodFirstPartyTypeKind.ZodDiscriminatedUnion,discriminator:C,options:$,optionsMap:K,...processCreateParams(V)})}}function mergeValues(T,C){const $=getParsedType(T),V=getParsedType(C);if(T===C)return{valid:!0,data:T};if($===ZodParsedType.object&&V===ZodParsedType.object){const K=util.objectKeys(C),Y=util.objectKeys(T).filter(re=>K.indexOf(re)!==-1),J={...T,...C};for(const re of Y){const ne=mergeValues(T[re],C[re]);if(!ne.valid)return{valid:!1};J[re]=ne.data}return{valid:!0,data:J}}else if($===ZodParsedType.array&&V===ZodParsedType.array){if(T.length!==C.length)return{valid:!1};const K=[];for(let Y=0;Y{if(isAborted(Y)||isAborted(J))return INVALID;const re=mergeValues(Y.value,J.value);return re.valid?((isDirty(Y)||isDirty(J))&&$.dirty(),{status:$.value,value:re.data}):(addIssueToContext(V,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return V.common.async?Promise.all([this._def.left._parseAsync({data:V.data,path:V.path,parent:V}),this._def.right._parseAsync({data:V.data,path:V.path,parent:V})]).then(([Y,J])=>K(Y,J)):K(this._def.left._parseSync({data:V.data,path:V.path,parent:V}),this._def.right._parseSync({data:V.data,path:V.path,parent:V}))}}ZodIntersection.create=(T,C,$)=>new ZodIntersection({left:T,right:C,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams($)});class ZodTuple extends ZodType{_parse(C){const{status:$,ctx:V}=this._processInputParams(C);if(V.parsedType!==ZodParsedType.array)return addIssueToContext(V,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:V.parsedType}),INVALID;if(V.data.lengththis._def.items.length&&(addIssueToContext(V,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$.dirty());const Y=[...V.data].map((J,re)=>{const ne=this._def.items[re]||this._def.rest;return ne?ne._parse(new ParseInputLazyPath(V,J,V.path,re)):null}).filter(J=>!!J);return V.common.async?Promise.all(Y).then(J=>ParseStatus.mergeArray($,J)):ParseStatus.mergeArray($,Y)}get items(){return this._def.items}rest(C){return new ZodTuple({...this._def,rest:C})}}ZodTuple.create=(T,C)=>{if(!Array.isArray(T))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:T,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(C)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(C){const{status:$,ctx:V}=this._processInputParams(C);if(V.parsedType!==ZodParsedType.object)return addIssueToContext(V,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:V.parsedType}),INVALID;const K=[],Y=this._def.keyType,J=this._def.valueType;for(const re in V.data)K.push({key:Y._parse(new ParseInputLazyPath(V,re,V.path,re)),value:J._parse(new ParseInputLazyPath(V,V.data[re],V.path,re))});return V.common.async?ParseStatus.mergeObjectAsync($,K):ParseStatus.mergeObjectSync($,K)}get element(){return this._def.valueType}static create(C,$,V){return $ instanceof ZodType?new ZodRecord({keyType:C,valueType:$,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams(V)}):new ZodRecord({keyType:ZodString.create(),valueType:C,typeName:ZodFirstPartyTypeKind.ZodRecord,...processCreateParams($)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(C){const{status:$,ctx:V}=this._processInputParams(C);if(V.parsedType!==ZodParsedType.map)return addIssueToContext(V,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:V.parsedType}),INVALID;const K=this._def.keyType,Y=this._def.valueType,J=[...V.data.entries()].map(([re,ne],te)=>({key:K._parse(new ParseInputLazyPath(V,re,V.path,[te,"key"])),value:Y._parse(new ParseInputLazyPath(V,ne,V.path,[te,"value"]))}));if(V.common.async){const re=new Map;return Promise.resolve().then(async()=>{for(const ne of J){const te=await ne.key,se=await ne.value;if(te.status==="aborted"||se.status==="aborted")return INVALID;(te.status==="dirty"||se.status==="dirty")&&$.dirty(),re.set(te.value,se.value)}return{status:$.value,value:re}})}else{const re=new Map;for(const ne of J){const te=ne.key,se=ne.value;if(te.status==="aborted"||se.status==="aborted")return INVALID;(te.status==="dirty"||se.status==="dirty")&&$.dirty(),re.set(te.value,se.value)}return{status:$.value,value:re}}}}ZodMap.create=(T,C,$)=>new ZodMap({valueType:C,keyType:T,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams($)});class ZodSet extends ZodType{_parse(C){const{status:$,ctx:V}=this._processInputParams(C);if(V.parsedType!==ZodParsedType.set)return addIssueToContext(V,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:V.parsedType}),INVALID;const K=this._def;K.minSize!==null&&V.data.sizeK.maxSize.value&&(addIssueToContext(V,{code:ZodIssueCode.too_big,maximum:K.maxSize.value,type:"set",inclusive:!0,exact:!1,message:K.maxSize.message}),$.dirty());const Y=this._def.valueType;function J(ne){const te=new Set;for(const se of ne){if(se.status==="aborted")return INVALID;se.status==="dirty"&&$.dirty(),te.add(se.value)}return{status:$.value,value:te}}const re=[...V.data.values()].map((ne,te)=>Y._parse(new ParseInputLazyPath(V,ne,V.path,te)));return V.common.async?Promise.all(re).then(ne=>J(ne)):J(re)}min(C,$){return new ZodSet({...this._def,minSize:{value:C,message:errorUtil.toString($)}})}max(C,$){return new ZodSet({...this._def,maxSize:{value:C,message:errorUtil.toString($)}})}size(C,$){return this.min(C,$).max(C,$)}nonempty(C){return this.min(1,C)}}ZodSet.create=(T,C)=>new ZodSet({valueType:T,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(C)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(C){const{ctx:$}=this._processInputParams(C);if($.parsedType!==ZodParsedType.function)return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.function,received:$.parsedType}),INVALID;function V(re,ne){return makeIssue({data:re,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,getErrorMap(),errorMap].filter(te=>!!te),issueData:{code:ZodIssueCode.invalid_arguments,argumentsError:ne}})}function K(re,ne){return makeIssue({data:re,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,getErrorMap(),errorMap].filter(te=>!!te),issueData:{code:ZodIssueCode.invalid_return_type,returnTypeError:ne}})}const Y={errorMap:$.common.contextualErrorMap},J=$.data;if(this._def.returns instanceof ZodPromise){const re=this;return OK(async function(...ne){const te=new ZodError([]),se=await re._def.args.parseAsync(ne,Y).catch(oe=>{throw te.addIssue(V(ne,oe)),te}),ie=await Reflect.apply(J,this,se);return await re._def.returns._def.type.parseAsync(ie,Y).catch(oe=>{throw te.addIssue(K(ie,oe)),te})})}else{const re=this;return OK(function(...ne){const te=re._def.args.safeParse(ne,Y);if(!te.success)throw new ZodError([V(ne,te.error)]);const se=Reflect.apply(J,this,te.data),ie=re._def.returns.safeParse(se,Y);if(!ie.success)throw new ZodError([K(se,ie.error)]);return ie.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...C){return new ZodFunction({...this._def,args:ZodTuple.create(C).rest(ZodUnknown.create())})}returns(C){return new ZodFunction({...this._def,returns:C})}implement(C){return this.parse(C)}strictImplement(C){return this.parse(C)}static create(C,$,V){return new ZodFunction({args:C||ZodTuple.create([]).rest(ZodUnknown.create()),returns:$||ZodUnknown.create(),typeName:ZodFirstPartyTypeKind.ZodFunction,...processCreateParams(V)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(C){const{ctx:$}=this._processInputParams(C);return this._def.getter()._parse({data:$.data,path:$.path,parent:$})}}ZodLazy.create=(T,C)=>new ZodLazy({getter:T,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(C)});class ZodLiteral extends ZodType{_parse(C){if(C.data!==this._def.value){const $=this._getOrReturnCtx(C);return addIssueToContext($,{received:$.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:C.data}}get value(){return this._def.value}}ZodLiteral.create=(T,C)=>new ZodLiteral({value:T,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(C)});function createZodEnum(T,C){return new ZodEnum({values:T,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(C)})}class ZodEnum extends ZodType{_parse(C){if(typeof C.data!="string"){const $=this._getOrReturnCtx(C),V=this._def.values;return addIssueToContext($,{expected:util.joinValues(V),received:$.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._def.values.indexOf(C.data)===-1){const $=this._getOrReturnCtx(C),V=this._def.values;return addIssueToContext($,{received:$.data,code:ZodIssueCode.invalid_enum_value,options:V}),INVALID}return OK(C.data)}get options(){return this._def.values}get enum(){const C={};for(const $ of this._def.values)C[$]=$;return C}get Values(){const C={};for(const $ of this._def.values)C[$]=$;return C}get Enum(){const C={};for(const $ of this._def.values)C[$]=$;return C}extract(C){return ZodEnum.create(C)}exclude(C){return ZodEnum.create(this.options.filter($=>!C.includes($)))}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(C){const $=util.getValidEnumValues(this._def.values),V=this._getOrReturnCtx(C);if(V.parsedType!==ZodParsedType.string&&V.parsedType!==ZodParsedType.number){const K=util.objectValues($);return addIssueToContext(V,{expected:util.joinValues(K),received:V.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if($.indexOf(C.data)===-1){const K=util.objectValues($);return addIssueToContext(V,{received:V.data,code:ZodIssueCode.invalid_enum_value,options:K}),INVALID}return OK(C.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(T,C)=>new ZodNativeEnum({values:T,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(C)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(C){const{ctx:$}=this._processInputParams(C);if($.parsedType!==ZodParsedType.promise&&$.common.async===!1)return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:$.parsedType}),INVALID;const V=$.parsedType===ZodParsedType.promise?$.data:Promise.resolve($.data);return OK(V.then(K=>this._def.type.parseAsync(K,{path:$.path,errorMap:$.common.contextualErrorMap})))}}ZodPromise.create=(T,C)=>new ZodPromise({type:T,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(C)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(C){const{status:$,ctx:V}=this._processInputParams(C),K=this._def.effect||null,Y={addIssue:J=>{addIssueToContext(V,J),J.fatal?$.abort():$.dirty()},get path(){return V.path}};if(Y.addIssue=Y.addIssue.bind(Y),K.type==="preprocess"){const J=K.transform(V.data,Y);return V.common.issues.length?{status:"dirty",value:V.data}:V.common.async?Promise.resolve(J).then(re=>this._def.schema._parseAsync({data:re,path:V.path,parent:V})):this._def.schema._parseSync({data:J,path:V.path,parent:V})}if(K.type==="refinement"){const J=re=>{const ne=K.refinement(re,Y);if(V.common.async)return Promise.resolve(ne);if(ne instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return re};if(V.common.async===!1){const re=this._def.schema._parseSync({data:V.data,path:V.path,parent:V});return re.status==="aborted"?INVALID:(re.status==="dirty"&&$.dirty(),J(re.value),{status:$.value,value:re.value})}else return this._def.schema._parseAsync({data:V.data,path:V.path,parent:V}).then(re=>re.status==="aborted"?INVALID:(re.status==="dirty"&&$.dirty(),J(re.value).then(()=>({status:$.value,value:re.value}))))}if(K.type==="transform")if(V.common.async===!1){const J=this._def.schema._parseSync({data:V.data,path:V.path,parent:V});if(!isValid(J))return J;const re=K.transform(J.value,Y);if(re instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:$.value,value:re}}else return this._def.schema._parseAsync({data:V.data,path:V.path,parent:V}).then(J=>isValid(J)?Promise.resolve(K.transform(J.value,Y)).then(re=>({status:$.value,value:re})):J);util.assertNever(K)}}ZodEffects.create=(T,C,$)=>new ZodEffects({schema:T,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:C,...processCreateParams($)});ZodEffects.createWithPreprocess=(T,C,$)=>new ZodEffects({schema:C,effect:{type:"preprocess",transform:T},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams($)});class ZodOptional extends ZodType{_parse(C){return this._getType(C)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(C)}unwrap(){return this._def.innerType}}ZodOptional.create=(T,C)=>new ZodOptional({innerType:T,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(C)});class ZodNullable extends ZodType{_parse(C){return this._getType(C)===ZodParsedType.null?OK(null):this._def.innerType._parse(C)}unwrap(){return this._def.innerType}}ZodNullable.create=(T,C)=>new ZodNullable({innerType:T,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(C)});class ZodDefault extends ZodType{_parse(C){const{ctx:$}=this._processInputParams(C);let V=$.data;return $.parsedType===ZodParsedType.undefined&&(V=this._def.defaultValue()),this._def.innerType._parse({data:V,path:$.path,parent:$})}removeDefault(){return this._def.innerType}}ZodDefault.create=(T,C)=>new ZodDefault({innerType:T,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof C.default=="function"?C.default:()=>C.default,...processCreateParams(C)});class ZodCatch extends ZodType{_parse(C){const{ctx:$}=this._processInputParams(C),V={...$,common:{...$.common,issues:[]}},K=this._def.innerType._parse({data:V.data,path:V.path,parent:{...V}});return isAsync(K)?K.then(Y=>({status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new ZodError(V.common.issues)},input:V.data})})):{status:"valid",value:K.status==="valid"?K.value:this._def.catchValue({get error(){return new ZodError(V.common.issues)},input:V.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(T,C)=>new ZodCatch({innerType:T,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof C.catch=="function"?C.catch:()=>C.catch,...processCreateParams(C)});class ZodNaN extends ZodType{_parse(C){if(this._getType(C)!==ZodParsedType.nan){const V=this._getOrReturnCtx(C);return addIssueToContext(V,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:V.parsedType}),INVALID}return{status:"valid",value:C.data}}}ZodNaN.create=T=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(T)});const BRAND=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(C){const{ctx:$}=this._processInputParams(C),V=$.data;return this._def.type._parse({data:V,path:$.path,parent:$})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(C){const{status:$,ctx:V}=this._processInputParams(C);if(V.common.async)return(async()=>{const Y=await this._def.in._parseAsync({data:V.data,path:V.path,parent:V});return Y.status==="aborted"?INVALID:Y.status==="dirty"?($.dirty(),DIRTY(Y.value)):this._def.out._parseAsync({data:Y.value,path:V.path,parent:V})})();{const K=this._def.in._parseSync({data:V.data,path:V.path,parent:V});return K.status==="aborted"?INVALID:K.status==="dirty"?($.dirty(),{status:"dirty",value:K.value}):this._def.out._parseSync({data:K.value,path:V.path,parent:V})}}static create(C,$){return new ZodPipeline({in:C,out:$,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(C){const $=this._def.innerType._parse(C);return isValid($)&&($.value=Object.freeze($.value)),$}}ZodReadonly.create=(T,C)=>new ZodReadonly({innerType:T,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(C)});const custom=(T,C={},$)=>T?ZodAny.create().superRefine((V,K)=>{var Y,J;if(!T(V)){const re=typeof C=="function"?C(V):typeof C=="string"?{message:C}:C,ne=(J=(Y=re.fatal)!==null&&Y!==void 0?Y:$)!==null&&J!==void 0?J:!0,te=typeof re=="string"?{message:re}:re;K.addIssue({code:"custom",...te,fatal:ne})}}):ZodAny.create(),late={object:ZodObject.lazycreate};var ZodFirstPartyTypeKind;(function(T){T.ZodString="ZodString",T.ZodNumber="ZodNumber",T.ZodNaN="ZodNaN",T.ZodBigInt="ZodBigInt",T.ZodBoolean="ZodBoolean",T.ZodDate="ZodDate",T.ZodSymbol="ZodSymbol",T.ZodUndefined="ZodUndefined",T.ZodNull="ZodNull",T.ZodAny="ZodAny",T.ZodUnknown="ZodUnknown",T.ZodNever="ZodNever",T.ZodVoid="ZodVoid",T.ZodArray="ZodArray",T.ZodObject="ZodObject",T.ZodUnion="ZodUnion",T.ZodDiscriminatedUnion="ZodDiscriminatedUnion",T.ZodIntersection="ZodIntersection",T.ZodTuple="ZodTuple",T.ZodRecord="ZodRecord",T.ZodMap="ZodMap",T.ZodSet="ZodSet",T.ZodFunction="ZodFunction",T.ZodLazy="ZodLazy",T.ZodLiteral="ZodLiteral",T.ZodEnum="ZodEnum",T.ZodEffects="ZodEffects",T.ZodNativeEnum="ZodNativeEnum",T.ZodOptional="ZodOptional",T.ZodNullable="ZodNullable",T.ZodDefault="ZodDefault",T.ZodCatch="ZodCatch",T.ZodPromise="ZodPromise",T.ZodBranded="ZodBranded",T.ZodPipeline="ZodPipeline",T.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const instanceOfType=(T,C={message:`Input not instance of ${T.name}`})=>custom($=>$ instanceof T,C),stringType=ZodString.create,numberType=ZodNumber.create,nanType=ZodNaN.create,bigIntType=ZodBigInt.create,booleanType=ZodBoolean.create,dateType=ZodDate.create,symbolType=ZodSymbol.create,undefinedType=ZodUndefined.create,nullType=ZodNull.create,anyType=ZodAny.create,unknownType=ZodUnknown.create,neverType=ZodNever.create,voidType=ZodVoid.create,arrayType=ZodArray.create,objectType=ZodObject.create,strictObjectType=ZodObject.strictCreate,unionType=ZodUnion.create,discriminatedUnionType=ZodDiscriminatedUnion.create,intersectionType=ZodIntersection.create,tupleType=ZodTuple.create,recordType=ZodRecord.create,mapType=ZodMap.create,setType=ZodSet.create,functionType=ZodFunction.create,lazyType=ZodLazy.create,literalType=ZodLiteral.create,enumType=ZodEnum.create,nativeEnumType=ZodNativeEnum.create,promiseType=ZodPromise.create,effectsType=ZodEffects.create,optionalType=ZodOptional.create,nullableType=ZodNullable.create,preprocessType=ZodEffects.createWithPreprocess,pipelineType=ZodPipeline.create,ostring=()=>stringType().optional(),onumber=()=>numberType().optional(),oboolean=()=>booleanType().optional(),coerce={string:T=>ZodString.create({...T,coerce:!0}),number:T=>ZodNumber.create({...T,coerce:!0}),boolean:T=>ZodBoolean.create({...T,coerce:!0}),bigint:T=>ZodBigInt.create({...T,coerce:!0}),date:T=>ZodDate.create({...T,coerce:!0})},NEVER=INVALID;var z$1=Object.freeze({__proto__:null,defaultErrorMap:errorMap,setErrorMap,getErrorMap,makeIssue,EMPTY_PATH,addIssueToContext,ParseStatus,INVALID,DIRTY,OK,isAborted,isDirty,isValid,isAsync,get util(){return util},get objectUtil(){return objectUtil},ZodParsedType,getParsedType,ZodType,ZodString,ZodNumber,ZodBigInt,ZodBoolean,ZodDate,ZodSymbol,ZodUndefined,ZodNull,ZodAny,ZodUnknown,ZodNever,ZodVoid,ZodArray,ZodObject,ZodUnion,ZodDiscriminatedUnion,ZodIntersection,ZodTuple,ZodRecord,ZodMap,ZodSet,ZodFunction,ZodLazy,ZodLiteral,ZodEnum,ZodNativeEnum,ZodPromise,ZodEffects,ZodTransformer:ZodEffects,ZodOptional,ZodNullable,ZodDefault,ZodCatch,ZodNaN,BRAND,ZodBranded,ZodPipeline,ZodReadonly,custom,Schema:ZodType,ZodSchema:ZodType,late,get ZodFirstPartyTypeKind(){return ZodFirstPartyTypeKind},coerce,any:anyType,array:arrayType,bigint:bigIntType,boolean:booleanType,date:dateType,discriminatedUnion:discriminatedUnionType,effect:effectsType,enum:enumType,function:functionType,instanceof:instanceOfType,intersection:intersectionType,lazy:lazyType,literal:literalType,map:mapType,nan:nanType,nativeEnum:nativeEnumType,never:neverType,null:nullType,nullable:nullableType,number:numberType,object:objectType,oboolean,onumber,optional:optionalType,ostring,pipeline:pipelineType,preprocess:preprocessType,promise:promiseType,record:recordType,set:setType,strictObject:strictObjectType,string:stringType,symbol:symbolType,transformer:effectsType,tuple:tupleType,undefined:undefinedType,union:unionType,unknown:unknownType,void:voidType,NEVER,ZodIssueCode,quotelessJson,ZodError});const CustomErrorSummary=T=>{const{heading:C,errors:$}=T,V=reactExports.useRef(null);return reactExports.useEffect(()=>{var K;V!=null&&V.current&&((K=V.current)==null||K.focus())},[$]),Object.keys($).length===0?null:jsxRuntimeExports.jsx(ErrorSummary$1,{ref:V,heading:C||"For å gå videre må du rette opp følgende:",children:Object.entries($).map(([K,Y],J)=>{if(Y.type===z$1.ZodIssueCode.custom)return jsxRuntimeExports.jsx(ErrorSummary$1.Item,{children:Y.message},J);const re=Y.ref.id??Y.ref.name;return jsxRuntimeExports.jsx(ErrorSummary$1.Item,{href:`#${re}`,children:Y.message},J)})})},schema$f=z$1.object({begrunnelse:z$1.string().min(1,"Du må fylle ut tema begrunnelse").max(255,"Du må korte ned teksten til 255 tegn")}),BegrunnelseForm=T=>{const{beskrivelseLabel:C,lagrer:$,onSubmit:V}=T,K={begrunnelse:""},{register:Y,handleSubmit:J,watch:re,formState:{errors:ne}}=useForm({defaultValues:K,resolver:t(schema$f),shouldFocusError:!1}),te=re("begrunnelse");return jsxRuntimeExports.jsx("form",{onSubmit:J(V),children:jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(Textarea$1,{label:"Begrunnelse",description:C,maxLength:255,disabled:$,...Y("begrunnelse"),error:ne.begrunnelse&&ne.begrunnelse.message,value:te}),jsxRuntimeExports.jsx(CustomErrorSummary,{errors:ne}),jsxRuntimeExports.jsx(Button$1,{className:"mt-4",loading:$,children:"Lagre"})]})})},getManglerPubliseringTekst=T=>{switch(T.type){case VeilarbAktivitetType.SAMTALEREFERAT_TYPE:return"Du må dele referatet med brukeren før du kan sette aktiviteten til fullført eller avbrutt";case VeilarbAktivitetType.MOTE_TYPE:return"Du må dele referatet med brukeren før du kan sette aktiviteten til fullført"}},PubliserReferat=({aktivitet:T,nyStatus:C,children:$})=>manglerPubliseringAvSamtaleReferat(T,C)?jsxRuntimeExports.jsx(Alert$1,{variant:"error",inline:!0,children:getManglerPubliseringTekst(T)}):$,VisAdvarsel=({onSubmit:T})=>jsxRuntimeExports.jsxs("div",{className:"flex flex-col gap-8",children:[jsxRuntimeExports.jsx(Alert$1,{variant:"warning",inline:!0,children:"Når du lagrer, blir aktiviteten låst og du kan ikke lenger endre innholdet."}),jsxRuntimeExports.jsx(Button$1,{className:"self-baseline",onClick:T,children:"Lagre"})]}),headerTekst$1="Avbrutt aktivitet",beskrivelseLabel="Skriv en kort begrunnelse under om hvorfor du avbrøt aktiviteten. Når du lagrer blir aktiviteten låst, og du kan ikke lenger redigere innholdet.",AvbrytAktivitet=()=>{const{id:T}=useParams(),C=useSelector(ie=>T?selectAktivitetMedId(ie,T):void 0),$=useSelector(selectAktivitetListeStatus),V=useNavigate(),{hovedsideRoute:K}=useRoutes(),Y=useAppDispatch(),J=(ie,ae)=>Y(avbrytAktivitet(C,ae)),re=$!==Status.OK,ne=C?jsxRuntimeExports.jsx(BegrunnelseForm,{headerTekst:headerTekst$1,beskrivelseLabel,lagrer:re,onSubmit:async ie=>{J(C,ie.begrunnelse)}}):null,te=C?jsxRuntimeExports.jsx(VisAdvarsel,{onSubmit:()=>{J(C,null),V(K())}}):null,se=C&&trengerBegrunnelse(C.avtalt,AktivitetStatus.AVBRUTT,C.type);return jsxRuntimeExports.jsx(Modal,{onClose:()=>V(K(),{replace:!0}),heading:"Avbryt aktivitet",children:C?jsxRuntimeExports.jsx(PubliserReferat,{aktivitet:C,nyStatus:AktivitetStatus.AVBRUTT,children:se?ne:te}):jsxRuntimeExports.jsx(Loader,{})})},headerTekst="Fullført aktivitet",beskrivelseTekst="Skriv en kort kommentar om hvordan det har gått, eller noe NAV bør kjenne til. Når du lagrer, blir aktiviteten låst og du kan ikke lenger endre innholdet.",FullforAktivitet=()=>{const{id:T}=useParams(),C=useSelector(te=>T?selectAktivitetMedId(te,T):void 0),$=useSelector(te=>selectAktivitetListeStatus(te))!==Status.OK,V=useAppDispatch(),K=(te,se)=>V(fullforAktivitet(te,se)),Y=useNavigate(),{hovedsideRoute:J}=useRoutes();if(!C||isArenaAktivitet(C))return jsxRuntimeExports.jsx(Navigate,{to:J()});const re=jsxRuntimeExports.jsx(BegrunnelseForm,{headerTekst,beskrivelseLabel:beskrivelseTekst,lagrer:$,onSubmit:async te=>{Y(J(),{replace:!0}),C&&K(C,te.begrunnelse)}}),ne=jsxRuntimeExports.jsx(VisAdvarsel,{onSubmit:()=>{C&&K(C,null),Y(J())}});return jsxRuntimeExports.jsx(Modal,{onClose:()=>Y(J(),{replace:!0}),heading:"Fullfør aktivitet",children:jsxRuntimeExports.jsx(PubliserReferat,{aktivitet:C,nyStatus:AktivitetStatus.FULLFOERT,children:C.avtalt&&C.type!==SAMTALEREFERAT_TYPE&&C.type!==MOTE_TYPE?re:ne})})},Lenkepanel=({children:T,href:C})=>jsxRuntimeExports.jsx(Link$2,{to:C,children:jsxRuntimeExports.jsx(LinkPanel$1,{as:"div",children:jsxRuntimeExports.jsx(LinkPanel$1.Title,{children:T})})}),LeggTilForm=()=>{const T=useErVeileder(),C=useSelector(selectAktivitetFeilmeldinger),{nyAktivitetRoute:$,hovedsideRoute:V}=useRoutes(),K=useNavigate(),Y=()=>K(V()),J=$();return jsxRuntimeExports.jsxs(Modal,{onClose:Y,contentClass:"ny-aktivitet-visning",feilmeldinger:C,heading:"Legg til en aktivitet",children:[jsxRuntimeExports.jsx("div",{className:"mb-4",children:T?null:jsxRuntimeExports.jsx(BodyShort,{className:"mt-6",children:"Her kan du legge til ulike aktiviteter du gjør for å nå målet ditt."})}),T?jsxRuntimeExports.jsxs("div",{className:"space-y-3 flex flex-col bg-surface-alt-3-subtle -mx-[24px] px-8 py-4",children:[jsxRuntimeExports.jsx(Heading,{level:"2",size:"medium",children:"For NAV-ansatt"}),jsxRuntimeExports.jsx(Lenkepanel,{href:`${J}/sokeavtale`,children:"Avtale om å søke jobber"}),jsxRuntimeExports.jsx(Lenkepanel,{href:`${J}/mote`,children:"Møte med NAV"}),jsxRuntimeExports.jsx(Lenkepanel,{href:`${J}/samtalereferat`,children:"Samtalereferat"})]}):null,jsxRuntimeExports.jsxs("div",{className:"mt-8",children:[T?jsxRuntimeExports.jsx(Heading,{level:"2",size:"medium",className:"mb-4",children:"For bruker og NAV-ansatt"}):null,jsxRuntimeExports.jsxs("div",{className:"space-y-3 flex flex-col",children:[jsxRuntimeExports.jsx(Lenkepanel,{href:`${J}/stilling`,children:"En jobb jeg vil søke på"}),jsxRuntimeExports.jsx(Lenkepanel,{href:`${J}/ijobb`,children:"Jobb jeg har nå"}),jsxRuntimeExports.jsx(Lenkepanel,{href:`${J}/egen`,children:"Jobbrettet egenaktivitet"}),jsxRuntimeExports.jsx(Lenkepanel,{href:`${J}/behandling`,children:"Medisinsk behandling"})]})]})]})},CONFIRM="Alle endringer blir borte hvis du ikke lagrer. Er du sikker på at du vil lukke siden?",useConfirmOnBeforeUnload=T=>reactExports.useEffect(()=>(window.onbeforeunload=C=>{if(T.current)return C.returnValue=CONFIRM,CONFIRM},()=>{window.onbeforeunload=null}),[T]),removeEmptyKeysFromObject=T=>Object.entries(T).reduce((C,[$,V])=>(V!==null&&typeof V=="string"&&V.length<=0||V===void 0?C[$]=null:C[$]=V,C),{}),nb=getLocaleFromString("nb"),ControlledDatePicker=({field:{disabled:T,name:C,defaultValue:$,required:V=!1,label:K},disabledDays:Y})=>{const[J,re]=reactExports.useState(!1),ne=()=>re(!1);useOutsideClick(J,ne);const{control:te,setValue:se,clearErrors:ie}=useFormContext(),{field:ae,fieldState:{error:oe}}=useController({control:te,defaultValue:$,name:C}),[le,ce]=reactExports.useState($?format($,"dd.M.y"):""),de=ye=>{const fe=parseDate(ye.target.value,new Date,nb,"date",!0);isValidDate(fe)?se(C,fe):se(C,void 0),ce(ye.target.value),isValid$1(fe)&&(ne(),ie(C))},he=ye=>{se(C,ye,{shouldDirty:!0}),ce(ye?format(ye,"dd.M.y"):""),ye&&(ne(),ie(C))},me=()=>{ae.onBlur(),isValid$1(ae.value)&&ce(format(ae.value,"dd.M.y"))},ge=()=>{re(!J)};return jsxRuntimeExports.jsx("div",{className:"flex",children:jsxRuntimeExports.jsx("div",{onClick:preventCloseOnInsideClick,children:jsxRuntimeExports.jsx(DatePicker$1,{onClose:()=>{re(!1)},onSelect:he,selected:isValid$1(ae.value)?ae.value:void 0,disabled:Y,onOpenToggle:ge,open:J,children:jsxRuntimeExports.jsx(DatePicker$1.Input,{disabled:T,className:"flex-1",error:oe==null?void 0:oe.message,label:K??"Dato"+(V?" (obligatorisk)":""),name:C,value:le,onBlur:me,onChange:de,ref:ae.ref})})})})},DateRangePicker=({from:T,to:C,disabledDays:$})=>{var Ce,je,Le,Ke;const[V,K]=reactExports.useState(!1),Y=()=>K(!1);useOutsideClick(V,Y);const{setError:J,clearErrors:re,control:ne,setValue:te}=useFormContext(),{field:se,fieldState:ie}=useController({control:ne,name:T.name,defaultValue:T.defaultValue??void 0}),{field:ae,fieldState:oe}=useController({control:ne,name:C.name,defaultValue:C.defaultValue??void 0}),[le,ce]=reactExports.useState(void 0),de=Se=>{Se&&((Se.from.isValidDate||!T.required&&Se.from.isEmpty)&&re([T.name]),(Se.to.isValidDate||!C.required&&Se.to.isEmpty)&&re(C.name))},he=()=>{le&&(ie.isTouched&&!le.from.isEmpty&&le.from.isInvalid&&J(T.name,{message:"Ikke en gyldig dato"}),oe.isTouched&&!le.to.isEmpty&&le.to.isInvalid&&J(C.name,{message:"Ikke en gyldig dato"}),de(le))},{datepickerProps:me,toInputProps:ge,fromInputProps:ye,reset:fe,setSelected:Te}=useRangeDatepicker({defaultSelected:{from:T.defaultValue,to:C.defaultValue},disabled:$,onValidate:Se=>{ce(Se),de(Se)},onRangeChange:Se=>{te(C.name,coerceToUndefined(Se==null?void 0:Se.to),{shouldDirty:!0}),te(T.name,coerceToUndefined(Se==null?void 0:Se.from),{shouldDirty:!0})}}),Pe=reactExports.useMemo(()=>({fromDefaultValue:T.defaultValue,toDefaultValue:C.defaultValue}),[(Ce=T.defaultValue)==null?void 0:Ce.getTime(),(je=C.defaultValue)==null?void 0:je.getTime()]);reactExports.useEffect(()=>{fe(),Te({from:Pe.fromDefaultValue,to:Pe.toDefaultValue})},[Pe]);const De=Se=>{te(T.name,coerceToUndefined(Se.target.value))},xe=Se=>{te(T.name,coerceToUndefined(Se.target.value))};return jsxRuntimeExports.jsx("div",{className:"flex",onClick:preventCloseOnInsideClick,children:jsxRuntimeExports.jsx(DatePicker$1,{...me,open:V,onOpenToggle:()=>K(!V),onClose:Y,wrapperClassName:"flex flex-1",children:jsxRuntimeExports.jsxs("div",{className:"flex sm:flex-row flex-col gap-4 items-start",children:[jsxRuntimeExports.jsx(DatePicker$1.Input,{disabled:T.disabled,error:(Le=ie.error)==null?void 0:Le.message,label:(T==null?void 0:T.label)??`Fra dato ${T.required?"(obligatorisk)":"(valgfri)"}`,...ye,name:se.name,onFocus:handlers([ye.onFocus]),onBlur:handlers([se.onBlur,ye.onBlur,he,Y]),onChange:handlers([De,ye.onChange]),ref:Se=>{se.ref(Se)}}),jsxRuntimeExports.jsx(DatePicker$1.Input,{error:(Ke=oe.error)==null?void 0:Ke.message,label:(C==null?void 0:C.label)??`Til dato ${C.required?"(obligatorisk)":"(valgfri)"}`,...ge,name:ae.name,onFocus:handlers([ge.onFocus]),onBlur:handlers([ae.onBlur,ge.onBlur,he,Y]),onChange:handlers([xe,ge.onChange]),ref:Se=>{ae.ref(Se)}})]})})})};function MaybeAvtaltDateRangePicker({aktivitet:T,from:C,to:$}){const V=T!=null&&T.tilDato?new Date(T.tilDato):$.defaultValue,K=T!=null&&T.fraDato?new Date(T.fraDato):C.defaultValue;return T&&T.avtalt&&T.fraDato?jsxRuntimeExports.jsxs("div",{className:"flex gap-4",children:[jsxRuntimeExports.jsx(ControlledDatePicker,{field:{...C,disabled:!0,defaultValue:K}}),jsxRuntimeExports.jsx(ControlledDatePicker,{field:{...$,defaultValue:V},disabledDays:[{before:K}]})]}):jsxRuntimeExports.jsx(DateRangePicker,{from:{defaultValue:K,...C},to:{defaultValue:V,...$}})}function avtaltResolver(T,C,$){return async(V,K,Y)=>{const J=await $(V,K,Y);if(!T)return J;const re=Object.entries(J.errors).filter(([te,se])=>C.includes(te)).reduce((te,[se,ie])=>({...te,[se]:ie}),{});return{values:Object.keys(re).length>0?{}:V,errors:re}}}const aktivitetingress={BEHANDLING:jsxRuntimeExports.jsxs("div",{className:"mt-4",children:[jsxRuntimeExports.jsx(BodyShort,{children:"Her kan du legge inn medisinsk behandling som påvirker muligheten din til å jobbe eller være på kurs og tiltak."}),jsxRuntimeExports.jsx(BodyShort,{children:"Eksempler:"}),jsxRuntimeExports.jsxs("ul",{className:"list-disc ml-4",children:[jsxRuntimeExports.jsx("li",{children:"Oppfølging hos fastlege"}),jsxRuntimeExports.jsx("li",{children:"Behandling og veiledning hos fysioterapeut"}),jsxRuntimeExports.jsx("li",{children:"Behandling hos psykolog"}),jsxRuntimeExports.jsx("li",{children:" Behandling hos spesialist"})]})]}),EGEN:"Her kan du eller veilederen din legge inn aktiviteter som hjelper deg når du skal komme i arbeid. Eksempler kan være å registrere deg hos bemannings- og rekrutteringsbyråer, jobbe godt med CV-en, eller lage oversikt over personer som kan være nyttig å kontakte når du er på jakt etter jobb.",GRUPPEAKTIVITET:"Her ser du informasjon om en gruppeaktivitet NAV har meldt deg på",IJOBB:"Her kan du informere om der du jobber nå, for eksempel en deltidsjobb eller en midlertidig stilling. Hvis du sender inn meldekort, så må du også huske å føre opp de timene du har jobbet på meldekortet.",MOTE:"NAV ønsker et møte med deg. Du må gi beskjed så raskt som mulig hvis tidspunktet ikke passer.",SAMTALEREFERAT:"Her finner du referat fra en samtale du har hatt med NAV.",SOKEAVTALE:'Her ser du hvor mange jobber NAV forventer at du søker. Legg inn stillinger du søker på i aktivitetsplanen ved å klikke på "Legg til aktivitet". ',STILLING:"Her kan du legge til informasjon om en stilling du har lyst å søke på. Du kan også legge til en stilling du allerede har søkt på.",TILTAKSAKTIVITET:"Her finner du informasjon om et tiltak NAV har søkt deg inn på. ",UTDANNINGSAKTIVITET:"Her ser du informasjon om en utdanningsaktivitet eller et kurs NAV har registrert at du skal gjennomføre.",STILLING_FRA_NAV:"NAV hjelper en arbeidsgiver med å finne kandidater til en stilling, og tror den kan passe for deg.",EKSTERNAKTIVITET:void 0},AktivitetIngress=({aktivitetstype:T})=>{const C=aktivitetingress[T];return C?typeof C=="string"?jsxRuntimeExports.jsx("section",{className:"aktivitetingress mt-4",children:jsxRuntimeExports.jsx(CustomBodyLong,{className:"aktivitetingress__tekst",children:C})}):jsxRuntimeExports.jsx("section",{children:C}):null},AktivitetFormHeader=({aktivitetstype:T})=>jsxRuntimeExports.jsx("div",{className:"mb-8 mt-4",children:jsxRuntimeExports.jsx(AktivitetIngress,{aktivitetstype:T})}),LagreAktivitetKnapp=T=>{const{disabled:C,loading:$=!1}=T,V=useSelector(selectErUnderOppfolging);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Button$1,{className:"mt-4",loading:$,disabled:C||!V,children:"Lagre"})})},schema$e=z$1.object({tittel:z$1.string().min(1,"Du må fylle ut stillingstittel").max(100,"Du må korte ned teksten til 100 tegn"),fraDato:z$1.date({required_error:"Fra dato må fylles ut",invalid_type_error:"Ikke en gyldig dato"}),tilDato:z$1.date({invalid_type_error:"Ikke en gyldig dato"}).optional().nullable(),jobbStatus:z$1.nativeEnum(JobbStatusType,{required_error:"Du må velge heltid eller deltid"}),ansettelsesforhold:z$1.string().max(255,"Du må korte ned teksten til 255 tegn").optional().nullable(),arbeidstid:z$1.string().max(255,"Du må korte ned teksten til 255 tegn").optional().nullable(),beskrivelse:z$1.string().max(5e3,"Du må korte ned teksten til 5000 tegn").optional().nullable()}),dateOrUndefined=T=>{if(T!=null)return new Date(T)},IJobbAktivitetForm=T=>{const{onSubmit:C,dirtyRef:$,aktivitet:V}=T,K={tittel:V==null?void 0:V.tittel,fraDato:dateOrUndefined(V==null?void 0:V.fraDato),tilDato:dateOrUndefined(V==null?void 0:V.tilDato),jobbStatus:V==null?void 0:V.jobbStatus,ansettelsesforhold:V==null?void 0:V.ansettelsesforhold,arbeidstid:V==null?void 0:V.arbeidstid,beskrivelse:V==null?void 0:V.beskrivelse},Y=(V==null?void 0:V.avtalt)||!1,J=useForm({defaultValues:K,resolver:t(schema$e),shouldFocusError:!1}),{register:re,setValue:ne,handleSubmit:te,watch:se,control:ie,formState:{errors:ae,isDirty:oe,isSubmitting:le}}=J;$&&($.current=oe);const ce=se("beskrivelse"),de=he=>{ne("jobbStatus",he,{shouldValidate:!0})};return jsxRuntimeExports.jsx("form",{autoComplete:"off",noValidate:!0,onSubmit:te(he=>C(he)),children:jsxRuntimeExports.jsx(FormProvider,{...J,children:jsxRuntimeExports.jsxs("div",{className:"space-y-8",children:[jsxRuntimeExports.jsx(AktivitetFormHeader,{aktivitetstype:VeilarbAktivitetType.IJOBB_AKTIVITET_TYPE}),jsxRuntimeExports.jsx(TextField$1,{disabled:Y,label:"Stillingstittel (obligatorisk)",id:"tittel",...re("tittel"),error:ae.tittel&&ae.tittel.message}),jsxRuntimeExports.jsx(MaybeAvtaltDateRangePicker,{aktivitet:V,from:{name:"fraDato",required:!0},to:{name:"tilDato"}}),jsxRuntimeExports.jsx(Controller,{name:"jobbStatus",control:ie,render:()=>jsxRuntimeExports.jsxs(RadioGroup,{defaultValue:K.jobbStatus,disabled:Y,id:"jobbStatus",legend:"Stillingsandel (obligatorisk)",onChange:de,error:ae.jobbStatus&&ae.jobbStatus.message,children:[jsxRuntimeExports.jsx(Radio,{value:JobbStatusType.HELTID,children:"Heltid"}),jsxRuntimeExports.jsx(Radio,{value:JobbStatusType.DELTID,children:"Deltid"})]})}),jsxRuntimeExports.jsx(TextField$1,{disabled:Y,label:"Arbeidsgiver (valgfri)",id:"ansettelsesforhold",...re("ansettelsesforhold"),error:ae.ansettelsesforhold&&ae.ansettelsesforhold.message}),jsxRuntimeExports.jsx(TextField$1,{disabled:Y,label:"Ansettelsesforhold (valgfri)",description:"For eksempel fast, midlertidig, vikariat",id:"arbeidstid",...re("arbeidstid"),error:ae.arbeidstid&&ae.arbeidstid.message}),jsxRuntimeExports.jsx(Textarea$1,{disabled:Y,label:"Kort beskrivelse av stillingen (valgfri)",description:"For eksempel dag, kveld, helg, stillingsprosent eller oppgaver",maxLength:5e3,...re("beskrivelse"),error:ae.beskrivelse&&ae.beskrivelse.message,value:ce||""}),jsxRuntimeExports.jsx(CustomErrorSummary,{errors:ae}),jsxRuntimeExports.jsx(LagreAktivitetKnapp,{loading:le})]})})})},schema$d=z$1.object({tittel:z$1.string(),fraDato:z$1.date({required_error:"Fra dato må fylles ut",invalid_type_error:"Ikke en gyldig dato"}),tilDato:z$1.date({required_error:"Til dato må fylles ut",invalid_type_error:"Ikke en gyldig dato"}),behandlingType:z$1.string().min(1,"Du må fylle ut type behandling").max(100,"Du må korte ned teksten til 100 tegn"),behandlingSted:z$1.string().min(1,"Du må fylle ut behandlingssted").max(255,"Du må korte ned teksten til 100 tegn"),effekt:z$1.string().max(255,"Du må korte ned teksten til 255 tegn").optional(),behandlingOppfolging:z$1.string().max(255,"Du må korte ned teksten til 255 tegn").optional(),beskrivelse:z$1.string().max(400,"Du må korte ned teksten til 400 tegn").optional()}).superRefine((T,C)=>{isAfter(T.fraDato,T.tilDato)&&C.addIssue({path:["tilDato"],code:z$1.ZodIssueCode.custom,message:"Til dato kan ikke være før fra dato"})}),medisinskZodResolver=t(schema$d),MedisinskBehandlingForm=T=>{const{onSubmit:C,dirtyRef:$,aktivitet:V}=T,K={tittel:(V==null?void 0:V.tittel)||"Medisinsk behandling",behandlingType:(V==null?void 0:V.behandlingType)||"",behandlingSted:(V==null?void 0:V.behandlingSted)||"",fraDato:dateOrUndefined(V==null?void 0:V.fraDato),tilDato:dateOrUndefined(V==null?void 0:V.tilDato),effekt:(V==null?void 0:V.effekt)||"",beskrivelse:(V==null?void 0:V.beskrivelse)||"",behandlingOppfolging:(V==null?void 0:V.behandlingOppfolging)||""},Y=(V==null?void 0:V.avtalt)||!1,J=useForm({defaultValues:K,resolver:avtaltResolver(Y,["tilDato"],medisinskZodResolver),shouldFocusError:!1}),{register:re,handleSubmit:ne,watch:te,formState:{errors:se,isDirty:ie,isSubmitting:ae}}=J;$&&($.current=ie);const oe=te("beskrivelse");return jsxRuntimeExports.jsx("form",{autoComplete:"off",noValidate:!0,onSubmit:ne(le=>C(le)),children:jsxRuntimeExports.jsx(FormProvider,{...J,children:jsxRuntimeExports.jsxs("div",{className:"space-y-8",children:[jsxRuntimeExports.jsx(AktivitetFormHeader,{aktivitetstype:VeilarbAktivitetType.BEHANDLING_AKTIVITET_TYPE}),jsxRuntimeExports.jsx(TextField$1,{disabled:Y,label:"Type behandling (obligatorisk)",id:"behandlingstype",...re("behandlingType"),error:se.behandlingType&&se.behandlingType.message}),jsxRuntimeExports.jsx(TextField$1,{disabled:Y,label:"Behandlingssted (obligatorisk)",id:"behandlingssted",...re("behandlingSted"),error:se.behandlingSted&&se.behandlingSted.message}),jsxRuntimeExports.jsx(MaybeAvtaltDateRangePicker,{aktivitet:V,from:{name:"fraDato",required:!0,label:"Fra dato (obligatorisk)"},to:{name:"tilDato",required:!0,label:"Til dato (obligatorisk)"}}),jsxRuntimeExports.jsx(TextField$1,{disabled:Y,label:"Mål for behandlingen (valgfri)",id:"effekt",...re("effekt"),error:se.effekt&&se.effekt.message}),jsxRuntimeExports.jsx(TextField$1,{disabled:Y,label:"Oppfølging fra NAV (valgfri)",id:"behandlingoppfolging",...re("behandlingOppfolging"),error:se.behandlingOppfolging&&se.behandlingOppfolging.message}),jsxRuntimeExports.jsx(Textarea$1,{disabled:Y,label:"Kort beskrivelse av behandlingen (valgfri)",maxLength:400,...re("beskrivelse"),error:se.beskrivelse&&se.beskrivelse.message,value:oe}),jsxRuntimeExports.jsx(CustomErrorSummary,{errors:se}),jsxRuntimeExports.jsx(LagreAktivitetKnapp,{loading:ae})]})})})};function selectMalverkSlice(T){return T.data.malverk}function selectMalverkData(T){return selectMalverkSlice(T).malverker}function selectMalverkMedTittel(T,C){return selectMalverkData(T).filter($=>$.tittel===C)}function selectMalverkStatus(T){return selectMalverkSlice(T).status}function lagMalverkOption(T){return jsxRuntimeExports.jsx("option",{value:T.tittel,children:T.tittel},T.tittel)}class Malverk extends reactExports.Component{constructor(){super(...arguments);yr(this,"onChangeMalverk",$=>{const{doHentMalverkMedTittel:V,doSettValgtMalverk:K,onChange:Y}=this.props;$.preventDefault();const J=V($.target.value);K(J),Y(J[0])})}componentDidMount(){const{doHentMalverMedType:$,endre:V,type:K}=this.props;V||$(K)}componentWillUnmount(){const{doSlettValgtMalverk:$}=this.props;$()}render(){const{malverk:$,avhengigheter:V,endre:K}=this.props,Y=Object.values($).map(lagMalverkOption),J="malverk";return!K&&jsxRuntimeExports.jsx("div",{className:"skjemaelement",children:jsxRuntimeExports.jsx(Innholdslaster,{className:"flex m-auto",avhengigheter:V,spinnerSize:"large",children:jsxRuntimeExports.jsxs(Select$1,{id:J,name:"malverk",label:"Ferdig utfylt aktivitet",onChange:this.onChangeMalverk,children:[jsxRuntimeExports.jsx("option",{value:"ingen",children:"Ingen ferdig utfylt aktivitet valgt"}),Y]})})})}}Malverk.propTypes={avhengigheter:avhengigheter.isRequired,malverk:PropTypes.arrayOf(malverktype),doHentMalverkMedTittel:PropTypes.func.isRequired,doHentMalverMedType:PropTypes.func.isRequired,doSettValgtMalverk:PropTypes.func.isRequired,doSlettValgtMalverk:PropTypes.func.isRequired,onChange:PropTypes.func,endre:PropTypes.bool,type:PropTypes.string.isRequired};Malverk.defaultProps={endre:!1,malverk:void 0,onChange:()=>null};const mapDispatchToProps=T=>({doHentMalverMedType:C=>{T(hentMalverkMedType(C))},doSettValgtMalverk:C=>{T(settValgtMalverk(C))},doSlettValgtMalverk:()=>{T(slettValgtMalverk())}}),mapStateToProps=T=>({malverk:selectMalverkData(T),avhengigheter:[selectMalverkStatus(T)],doHentMalverkMedTittel:C=>selectMalverkMedTittel(T,C)}),Malverk$1=visibleIfHOC(connect(mapStateToProps,mapDispatchToProps)(Malverk)),schema$c=z$1.object({tittel:z$1.string().min(1,"Du må fylle ut navn på aktiviteten").max(100,"Du må korte ned teksten til 100 tegn"),fraDato:z$1.date({required_error:"Fra dato må fylles ut",invalid_type_error:"Ikke en gyldig dato"}),tilDato:z$1.date({required_error:"Til dato må fylles ut",invalid_type_error:"Ikke en gyldig dato"}),hensikt:z$1.string().max(255,"Du må korte ned teksten til 255 tegn").optional(),beskrivelse:z$1.string().max(5e3,"Du må korte ned teksten til 5000 tegn").optional(),oppfolging:z$1.string().max(255,"Du må korte ned teksten til 255 tegn").optional(),lenke:z$1.string().max(2e3,"Du må korte ned lenken til 2000 tegn").optional()}).superRefine((T,C)=>{isAfter(T.fraDato,T.tilDato)&&C.addIssue({path:["tilDato"],code:z$1.ZodIssueCode.custom,message:"Til dato kan ikke være før fra dato"})}),EgenAktivitetForm=T=>{const{onSubmit:C,dirtyRef:$,aktivitet:V}=T,K=useErVeileder(),Y={tittel:(V==null?void 0:V.tittel)||"",fraDato:dateOrUndefined(V==null?void 0:V.fraDato),tilDato:dateOrUndefined(V==null?void 0:V.tilDato),hensikt:(V==null?void 0:V.hensikt)||"",beskrivelse:(V==null?void 0:V.beskrivelse)||"",oppfolging:(V==null?void 0:V.oppfolging)||"",lenke:(V==null?void 0:V.lenke)||""},J=(V==null?void 0:V.avtalt)===!0,re=useForm({defaultValues:Y,resolver:t(schema$c),shouldFocusError:!1}),{register:ne,setValue:te,handleSubmit:se,reset:ie,watch:ae,formState:{errors:oe,isDirty:le,isSubmitting:ce}}=re;$&&($.current=le);const de=ae("beskrivelse"),he=me=>{me?Object.entries(me).forEach(([ge,ye],fe)=>{te(ge,ye)}):ie()};return jsxRuntimeExports.jsx("form",{autoComplete:"off",noValidate:!0,onSubmit:se(me=>C(me)),children:jsxRuntimeExports.jsx(FormProvider,{...re,children:jsxRuntimeExports.jsxs("div",{className:"space-y-8",children:[jsxRuntimeExports.jsx(AktivitetFormHeader,{aktivitetstype:VeilarbAktivitetType.EGEN_AKTIVITET_TYPE}),jsxRuntimeExports.jsx(Malverk$1,{visible:K,endre:!!V,onChange:he,type:"EGEN"}),jsxRuntimeExports.jsx(TextField$1,{disabled:J,label:"Navn på aktiviteten (obligatorisk)",id:"tittel",...ne("tittel"),error:oe.tittel&&oe.tittel.message}),jsxRuntimeExports.jsx(MaybeAvtaltDateRangePicker,{aktivitet:V,from:{name:"fraDato",required:!0},to:{name:"tilDato",required:!0}}),jsxRuntimeExports.jsx(TextField$1,{disabled:J,label:"Mål med aktiviteten (valgfri)",id:"hensikt",...ne("hensikt"),error:oe.hensikt&&oe.hensikt.message}),jsxRuntimeExports.jsx(Textarea$1,{disabled:J,label:"Kort beskrivelse av aktiviteten (valgfri)",maxLength:5e3,...ne("beskrivelse"),error:oe.beskrivelse&&oe.beskrivelse.message,value:de}),jsxRuntimeExports.jsx(TextField$1,{disabled:J,label:"Min huskeliste for denne aktiviteten (valgfri)",id:"huskeliste",...ne("oppfolging"),error:oe.oppfolging&&oe.oppfolging.message}),jsxRuntimeExports.jsx(TextField$1,{disabled:J,label:"Lenke til en aktuell nettside (valgfri)",id:"lenke",...ne("lenke"),error:oe.lenke&&oe.lenke.message}),jsxRuntimeExports.jsx(CustomErrorSummary,{errors:oe}),jsxRuntimeExports.jsx(LagreAktivitetKnapp,{loading:ce})]})})})},HuskVarsleBruker=({avtalt:T,endre:C})=>!T||!C?null:jsxRuntimeExports.jsx(Alert$1,{variant:"warning",className:"mb-8",children:"Husk å sende en dialogmelding til brukeren om endringen du gjør."}),EksternLenkeIkon=()=>jsxRuntimeExports.jsx("span",{className:"eksternlenkeIkonBoks",children:jsxRuntimeExports.jsx("svg",{className:"EksternLenkeIkon",height:"14px",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg",focusable:"false",children:jsxRuntimeExports.jsx("g",{id:"ikon_external_link",fill:"none",fillRule:"evenodd",strokeLinecap:"round",children:jsxRuntimeExports.jsx("g",{id:"LINE/interface/-external-link",transform:"translate(2 2)",stroke:"#0067C5",children:jsxRuntimeExports.jsxs("g",{id:"external-link",children:[jsxRuntimeExports.jsx("path",{d:"M10,7.07712912 L10,8.33333333 C10,9.25380792 9.25380792,10 8.33333333,10 L1.66666667,10 C0.746192084,10 0,9.25380792 0,8.33333333 L0,1.66666667 C0,0.746192084 0.746192084,0 1.66666667,0 L2.94199316,0",id:"Rectangle-6"}),jsxRuntimeExports.jsxs("g",{id:"Group-7",transform:"translate(4)",children:[jsxRuntimeExports.jsx("path",{d:"M0,6 L6,0",id:"Line-6"}),jsxRuntimeExports.jsx("polyline",{id:"Path-2",points:"2.00719286 0 6 0 6 4.06130668"})]})]})})})})}),VideoInfo=({kanal:T})=>T===Kanal.INTERNET?jsxRuntimeExports.jsxs(BodyShort,{className:"mote-aktivitet-form__video-info",children:["Les om"," ",jsxRuntimeExports.jsxs(Link$1,{href:"https://navno.sharepoint.com/sites/intranett-it/SitePages/Videom%C3%B8te-med-brukere.aspx",target:"_blank",rel:"noopener noreferrer",children:["rutiner for videomøte her ",jsxRuntimeExports.jsx(EksternLenkeIkon,{})]})]}):null,schema$b=z$1.object({tittel:z$1.string().min(1,"Du må fylle ut tema for møtet").max(100,"Du må korte ned teksten til 100 tegn"),dato:z$1.date({required_error:"Dato må fylles ut",invalid_type_error:"Ikke en gyldig dato"}),klokkeslett:z$1.string().min(1,"Du må fylle ut klokkeslett"),varighet:z$1.number({invalid_type_error:"Du må velge varighet"}),kanal:z$1.nativeEnum(Kanal,{errorMap:T=>{switch(T.code){case"invalid_enum_value":return{message:"Du må velge møteform"};default:return{message:"Noe har gått galt"}}}}),adresse:z$1.string().min(1,"Du må fylle ut møtested eller annen praktisk informasjon").max(255,"Du må korte ned teksten til 255 tegn"),beskrivelse:z$1.string().min(1,"Du må fylle ut hensikten med møtet").max(5e3,"Du må korte ned teksten til 5000 tegn"),forberedelser:z$1.string().max(500,"Du må korte ned teksten til 500 tegn").optional()}),varighet=[{minutter:15,tekst:"15 minutter"},{minutter:30,tekst:"30 minutter"},{minutter:45,tekst:"45 minutter"},{minutter:60,tekst:"1 time"},{minutter:90,tekst:"1 time, 30 minutter"},{minutter:120,tekst:"2 timer"},{minutter:150,tekst:"2 timer, 30 minutter"},{minutter:180,tekst:"3 timer"},{minutter:210,tekst:"3 timer, 30 minutter"},{minutter:240,tekst:"4 timer"},{minutter:270,tekst:"4 timer, 30 minutter"},{minutter:300,tekst:"5 timer"},{minutter:330,tekst:"5 timer, 30 minutter"},{minutter:360,tekst:"6 timer"},{minutter:390,tekst:"6 timer, 30 minutter"},{minutter:420,tekst:"7 timer"},{minutter:450,tekst:"7 timer, 30 minutter"}],MoteAktivitetForm=T=>{const{aktivitet:C,dirtyRef:$,onSubmit:V}=T,K=C?beregnKlokkeslettVarighet(C):void 0,Y={tittel:C==null?void 0:C.tittel,klokkeslett:K==null?void 0:K.klokkeslett,varighet:K==null?void 0:K.varighet,kanal:C==null?void 0:C.kanal,adresse:C==null?void 0:C.adresse,beskrivelse:C==null?void 0:C.beskrivelse,forberedelser:(C==null?void 0:C.forberedelser)??void 0,dato:coerceToUndefined(C==null?void 0:C.fraDato)},J=(C==null?void 0:C.avtalt)||!1,re=useForm({defaultValues:Y,resolver:t(schema$b),shouldFocusError:!1}),{register:ne,handleSubmit:te,watch:se,formState:{errors:ie,isDirty:ae,isSubmitting:oe}}=re;$&&($.current=ae);const le=se("beskrivelse"),ce=se("forberedelser");return jsxRuntimeExports.jsx("form",{autoComplete:"off",noValidate:!0,onSubmit:te(de=>{const{klokkeslett:he,...me}=de;return V({...me,...beregnFraTil(de),status:AktivitetStatus.PLANLAGT,avtalt:!1})}),children:jsxRuntimeExports.jsx(FormProvider,{...re,children:jsxRuntimeExports.jsxs("div",{className:"space-y-8",children:[jsxRuntimeExports.jsx(AktivitetFormHeader,{aktivitetstype:VeilarbAktivitetType.MOTE_TYPE}),jsxRuntimeExports.jsx(HuskVarsleBruker,{avtalt:J,endre:!!C}),jsxRuntimeExports.jsx(TextField$1,{disabled:J,label:"Tema for møtet (obligatorisk)",id:"tittel",...ne("tittel"),error:ie.tittel&&ie.tittel.message}),jsxRuntimeExports.jsxs("div",{className:"flex sm:flex-row flex-col gap-4",children:[jsxRuntimeExports.jsx(ControlledDatePicker,{field:{name:"dato",required:!0,defaultValue:dateOrUndefined(C==null?void 0:C.fraDato)}}),jsxRuntimeExports.jsx(TextField$1,{label:"Klokkeslett (obligatorisk)",...ne("klokkeslett"),type:"time",error:ie.klokkeslett&&ie.klokkeslett.message})]}),jsxRuntimeExports.jsxs(Select$1,{label:"Varighet (obligatorisk)",...ne("varighet",{valueAsNumber:!0}),error:ie.varighet&&ie.varighet.message,children:[jsxRuntimeExports.jsx("option",{value:"",children:"Velg varighet"}),varighet.map(de=>jsxRuntimeExports.jsx("option",{value:de.minutter,children:de.tekst},de.minutter))]}),jsxRuntimeExports.jsxs(Select$1,{label:"Møteform (obligatorisk)",...ne("kanal"),error:ie.kanal&&ie.kanal.message,children:[jsxRuntimeExports.jsx("option",{value:"",children:"Velg møteform"}),jsxRuntimeExports.jsx("option",{value:Kanal.OPPMOTE,children:"Oppmøte"}),jsxRuntimeExports.jsx("option",{value:Kanal.TELEFON,children:"Telefonmøte"}),jsxRuntimeExports.jsx("option",{value:Kanal.INTERNET,children:"Videomøte"})]}),jsxRuntimeExports.jsx(VideoInfo,{kanal:se("kanal")}),jsxRuntimeExports.jsx(TextField$1,{label:"Møtested eller annen praktisk informasjon (obligatorisk)",id:"adresse",...ne("adresse"),error:ie.adresse&&ie.adresse.message}),jsxRuntimeExports.jsx(Textarea$1,{disabled:J,label:"Hensikt med møtet (obligatorisk)",maxLength:5e3,...ne("beskrivelse"),error:ie.beskrivelse&&ie.beskrivelse.message,value:le}),jsxRuntimeExports.jsx(Textarea$1,{disabled:J,label:"Forberedelser til møtet (valgfri)",maxLength:500,...ne("forberedelser"),error:ie.forberedelser&&ie.forberedelser.message,value:ce}),jsxRuntimeExports.jsx(CustomErrorSummary,{errors:ie}),jsxRuntimeExports.jsx(LagreAktivitetKnapp,{loading:oe})]})})})},selectVeilederSlice=T=>T.data.veileder,selectVeilederData=T=>selectVeilederSlice(T).data,selectVeilederNavn=T=>{var C,$,V;return((C=selectVeilederData(T))==null?void 0:C.fornavn)&&`${($=selectVeilederData(T))==null?void 0:$.fornavn} ${(V=selectVeilederData(T))==null?void 0:V.etternavn}`},selectVeilederStatus=T=>selectVeilederSlice(T).status;var ke={exports:{}},z={};/**
+ * @license React
+ * react-jsx-runtime.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */var Ae;function Dr(){if(Ae)return z;Ae=1;var T=React,C=Symbol.for("react.element"),$=Symbol.for("react.fragment"),V=Object.prototype.hasOwnProperty,K=T.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Y={key:!0,ref:!0,__self:!0,__source:!0};function J(re,ne,te){var se,ie={},ae=null,oe=null;te!==void 0&&(ae=""+te),ne.key!==void 0&&(ae=""+ne.key),ne.ref!==void 0&&(oe=ne.ref);for(se in ne)V.call(ne,se)&&!Y.hasOwnProperty(se)&&(ie[se]=ne[se]);if(re&&re.defaultProps)for(se in ne=re.defaultProps,ne)ie[se]===void 0&&(ie[se]=ne[se]);return{$$typeof:C,type:re,key:ae,ref:oe,props:ie,_owner:K.current}}return z.Fragment=$,z.jsx=J,z.jsxs=J,z}ke.exports=Dr();var r$1=ke.exports;let Fe=0;function Lr(T){const[C,$]=reactExports.useState(T),V=T||C;return reactExports.useEffect(()=>{C==null&&(Fe+=1,$(`aksel-icon-${Fe}`))},[C]),V}const Me=React.useId;function Fr(T){var C;if(Me!==void 0){const $=Me();return T??$.replace(/(:)/g,"")}return(C=Lr(T))!==null&&C!==void 0?C:""}var Mr=globalThis&&globalThis.__rest||function(T,C){var $={};for(var V in T)Object.prototype.hasOwnProperty.call(T,V)&&C.indexOf(V)<0&&($[V]=T[V]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var K=0,V=Object.getOwnPropertySymbols(T);K{var{title:$,titleId:V}=T,K=Mr(T,["title","titleId"]);let Y=Fr();return Y=$?V||"title-"+Y:void 0,reactExports.createElement("svg",Object.assign({width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",focusable:!1,role:"img",ref:C,"aria-labelledby":Y},K),$?reactExports.createElement("title",{id:Y},$):null,reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.75 4a.75.75 0 0 1 .75-.75H20a.748.748 0 0 1 .75.75v7.5a.75.75 0 0 1-1.5 0V5.81l-8.72 8.72a.75.75 0 1 1-1.06-1.06l8.72-8.72H12.5a.75.75 0 0 1-.75-.75ZM5 8.75a.25.25 0 0 0-.25.25v10c0 .138.112.25.25.25h10a.25.25 0 0 0 .25-.25v-7a.75.75 0 0 1 1.5 0v7A1.75 1.75 0 0 1 15 20.75H5A1.75 1.75 0 0 1 3.25 19V9c0-.966.784-1.75 1.75-1.75h7a.75.75 0 0 1 0 1.5H5Z",fill:"currentColor"}))}),W=Br,Be=T=>T.replaceAll("Kopier lenke","").split(`
+`).map(C=>C.length>0&&![".",":","!","?"].includes(C.slice(-1))?C+".":C).join(`
+`).split(/\n/).sort((C,$)=>$.replace(/([.?!])\s*(?=[A-Z])/g,"$1|").split("|").length-C.replace(/([.?!])\s*(?=[A-Z])/g,"$1|").split("|").length).reduce((C,$)=>$.replace(/([.?!])\s*(?=[A-Z])/g,"$1|").split("|").length>=4?[...C,$]:[...C],[]);function Wr({value:T}){const C=Be(T);if(C.length===0)return null;const[$,V]=reactExports.useState(1),K=/^[^.!?]*[.!?]/,Y=3,J=$*Y,re=J-Y,ne=Object.entries(C).slice(re,J).map(se=>({index:parseInt(se[0]),paragraph:se[1],firstSentence:se[1].match(K)[0],sentencesInParagraph:se[1].replace(/([.?!])\s*(?=[A-Z])/g,"$1|").split("|").length})),te=Math.ceil(C.length/Y);return r$1.jsx(r$1.Fragment,{children:r$1.jsxs(Accordion$1.Item,{children:[r$1.jsxs(Accordion$1.Header,{children:[C.length," ",C.length===1?r$1.jsx(r$1.Fragment,{children:"langt avsnitt"}):r$1.jsx(r$1.Fragment,{children:"lange avsnitt"})]}),r$1.jsxs(Accordion$1.Content,{children:[r$1.jsx(BodyShort,{spacing:!0,children:"Et avsnitt bør ha ett hovedbudskap og ikke ha mer enn to til tre setninger."}),r$1.jsx(BodyShort,{spacing:!0,children:ne.map(se=>{const{paragraph:ie,sentencesInParagraph:ae,firstSentence:oe,index:le}=se,ce=oe.substring(0,15)+"... ("+ae+" setninger)";return r$1.jsx(ReadMore$1,{header:ce,children:ie},le)})}),r$1.jsxs(BodyShort,{children:["Kilde:"," ",r$1.jsxs(Link$1,{target:"_blank",href:"https://aksel.nav.no/artikkel/sprakarbeid?tema=innholdsarbeid",children:["Aksel",r$1.jsx(W,{})]})]}),C.length>Y&&r$1.jsx(ee,{page:$,onPageChange:V,count:te,size:"small",siblingCount:0,boundaryCount:1})]})]})})}const We=T=>T.replaceAll("Kopier lenke","").split(`
+`).map(C=>C.length>0&&![".",":","!","?","*"].includes(C.slice(-1))?C+".":C).join(`
+`).replace(/([.?!–"“:*])\s*(?=[A-ZÆØÅ.•*«»"“–\-\d\n])/g,"$1|").split("|").sort((C,$)=>$.split(/\s+/).length-C.split(/\s+/).length).reduce((C,$)=>$.split(/\s+/).length>=21?[...C,$]:[...C],[]);function Hr({value:T}){const C=We(T);if(C.length===0)return null;const[$,V]=reactExports.useState(1),K=3,Y=$*K,J=Y-K,re=Object.entries(C).slice(J,Y),ne=Math.ceil(C.length/K);return r$1.jsx(r$1.Fragment,{children:r$1.jsxs(Accordion$1.Item,{children:[r$1.jsxs(Accordion$1.Header,{children:[C.length," ",C.length===1?r$1.jsx(r$1.Fragment,{children:"lang setning"}):r$1.jsx(r$1.Fragment,{children:"lange setninger"})]}),r$1.jsxs(Accordion$1.Content,{children:[r$1.jsx(BodyShort,{spacing:!0,children:"Ifølge studier kan setninger med over 20 ord anses som vanskelige å lese."}),r$1.jsx(BodyShort,{spacing:!0,children:re.map(te=>{const se=te[1].substring(0,15)+"... ("+te[1].split(/\s+/).length+" ord)";return r$1.jsx(ReadMore$1,{header:se,children:te[1]},te[0])})}),r$1.jsxs(BodyShort,{spacing:!0,children:["Kilde:"," ",r$1.jsxs(Link$1,{target:"_blank",href:"https://strainindex.wordpress.com/2012/04/30/longer-the-sentence-greater-the-strain/",children:["Nirmaldasan",r$1.jsx(W,{})]})]}),C.length>K&&r$1.jsx("div",{children:r$1.jsx(ee,{page:$,onPageChange:V,count:ne,size:"small",siblingCount:0,boundaryCount:1})})]})]})})}const He=T=>reactExports.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...T},reactExports.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.75 4C11.75 3.58579 12.0858 3.25 12.5 3.25H20C20.1017 3.25 20.1987 3.27024 20.2871 3.30691C20.3755 3.34351 20.4584 3.39776 20.5303 3.46967C20.6022 3.54158 20.6565 3.62445 20.6931 3.71291C20.7251 3.79009 20.7446 3.87376 20.749 3.96141C20.7497 3.97419 20.75 3.98706 20.75 4V11.5C20.75 11.9142 20.4142 12.25 20 12.25C19.5858 12.25 19.25 11.9142 19.25 11.5V5.81066L10.5303 14.5303C10.2374 14.8232 9.76256 14.8232 9.46967 14.5303C9.17678 14.2374 9.17678 13.7626 9.46967 13.4697L18.1893 4.75H12.5C12.0858 4.75 11.75 4.41421 11.75 4ZM5 8.75C4.86193 8.75 4.75 8.86193 4.75 9V19C4.75 19.1381 4.86193 19.25 5 19.25H15C15.1381 19.25 15.25 19.1381 15.25 19V12C15.25 11.5858 15.5858 11.25 16 11.25C16.4142 11.25 16.75 11.5858 16.75 12V19C16.75 19.9665 15.9665 20.75 15 20.75H5C4.0335 20.75 3.25 19.9665 3.25 19V9C3.25 8.0335 4.0335 7.25 5 7.25H12C12.4142 7.25 12.75 7.58579 12.75 8C12.75 8.41421 12.4142 8.75 12 8.75H5Z",fill:"#262626"})),Ve=T=>T.replaceAll("Kopier lenke","").replaceAll("/"," / ").replaceAll(/(.*)\.+[A-Za-z]{2,6}/g,"").replaceAll(/http(.*)/g,"").split(`
+`).map(C=>C.length>0&&![".",":","!","?"," "].includes(C.slice(-1))?C+".":C).join(`
+`).toLowerCase().split(/\s+/).map(C=>C.replace(/[.,:?()!"«»]+/g,"")).filter(C=>!C.match(/\d/)).filter(C=>!C.match(/[-_>]/)).reduce((C,$)=>C.includes($)?[...C]:[...C,$],[]).filter(C=>C.length>=7).sort((C,$)=>$.length-C.length);function Vr({value:T}){const C=Ve(T);if(C.length===0)return null;const[$,V]=reactExports.useState(1),K=10,Y=$*K,J=Y-K,re=Object.entries(C).slice(J,Y),ne=Math.ceil(C.length/K);return r$1.jsxs(Accordion$1.Item,{children:[r$1.jsxs(Accordion$1.Header,{children:[C.length===1?r$1.jsx(r$1.Fragment,{children:"1 unikt langt"}):r$1.jsxs(r$1.Fragment,{children:[C.length," unike lange"]})," ord"]}),r$1.jsxs(Accordion$1.Content,{children:[r$1.jsx(Heading,{spacing:!0,level:"3",size:"xsmall",children:"Velg korte og enkle ord"}),"Ifølge lesbarhetsindeksen Liks anses ord med over seks bokstaver som lange -"," ",r$1.jsxs(Link$1,{target:"_blank",href:"https://no.wikipedia.org/wiki/Lesbarhetsindeks",children:["Wikipedia",r$1.jsx(He,{})]}),r$1.jsx(Heading,{spacing:!0,level:"3",size:"xsmall",children:"Ord med over seks bokstaver"}),r$1.jsx("div",{children:r$1.jsxs(w$1,{zebraStripes:!0,size:"small",children:[r$1.jsx(w$1.Header,{children:r$1.jsxs(w$1.Row,{children:[r$1.jsx(w$1.HeaderCell,{scope:"col",children:"Ord"}),r$1.jsx(w$1.HeaderCell,{scope:"col",children:"Bokstaver"})]})}),r$1.jsx(w$1.Body,{children:re.map(te=>r$1.jsxs(w$1.Row,{children:[r$1.jsx(w$1.HeaderCell,{scope:"row",children:te[1]}),r$1.jsx(w$1.DataCell,{children:te[1].length})]},te[0]))})]})}),C.length>K&&r$1.jsx("div",{children:r$1.jsx(ee,{page:$,onPageChange:V,count:ne,size:"small",siblingCount:0,boundaryCount:1})})]})]})}const ze=T=>{var C;return((C=T.replaceAll("Kontakt","").replaceAll(/\d+(?: \d+)/g,"").toLowerCase().match(/\b(\w{2,5})\s+\1\b/g))==null?void 0:C.map($=>$))??[]};function zr({value:T}){const C=ze(T);return C.length===0?null:r$1.jsxs(Accordion$1.Item,{children:[r$1.jsx(Accordion$1.Header,{children:C.length===1?r$1.jsx(r$1.Fragment,{children:"1 gjentakelse av like ord"}):r$1.jsxs(r$1.Fragment,{children:[C.length," gjentakelser av like ord"]})}),r$1.jsxs(Accordion$1.Content,{children:[r$1.jsx(BodyShort,{spacing:!0,children:" Like ord som er gjentatt etter hverandre: "}),r$1.jsx(O$1,{children:C.map(($,V)=>r$1.jsxs(O$1.Item,{children:['"',$,'"']},V))})]})]})}const $r=[{id:"1",ord:"abnorm",bruk:"1",bokmaal:"«Abnorm» ble tidligere brukt om mennesker man mente var avvikende fra flertallet. Det ble skilt mellom «åndelig abnorme» og «andre abnorme». Skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"2",ord:"blindehund",bruk:"1",bokmaal:"Bruk heller «førerhund». Hunden er utdannet til å føre en person med synshemminger, derfor er det mer korrekt å bruke betegnelsen «førerhund». Blindehund er et ord som ikke skal brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"3",ord:"blindeskrift",bruk:"1",bokmaal:"Bruk heller «punktskrift». Punktskrift viser direkte til hvordan skrifttypen er bygget opp, nemlig med opphøyde punkter. «Blindeskrift» skal ikke brukes som begrep. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"4",ord:"blindestokk",bruk:"1",bokmaal:"Bruk heller «Hvit stokk» eller «mobilitetsstokk». «Blindestokk» skal ikke brukes som begrep. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"6",ord:"brukere",bruk:"2",bokmaal:"Skal bare brukes når det henvises til hva man er bruker av, ikke som synonym/alternativ til ordet funksjonshemmet. Ordet «bruker» kan oppleves som stigmatiserende. Bruk gjerne «person», «menneske», eller navnet på vedkommende. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"7",ord:"bundet til rullestolen",bruk:"1",bokmaal:"Uttrykket «bundet/lenket til rullestolen» formidler en holdning om bruk av hjelpemidler som noe tragisk. Bruk heller «sitter i rullestol», «bruker rullestol», «får hjelp av rullestolen» eller lignende. Uttrykket «bundet/lenket til rullestolen» skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"8",ord:"lenket til rullestolen",bruk:"1",bokmaal:"Uttrykket «bundet/lenket til rullestolen» formidler en holdning om bruk av hjelpemidler som noe tragisk. Bruk heller «sitter i rullestol», «bruker rullestol», «får hjelp av rullestolen» eller lignende. Uttrykket «bundet/lenket til rullestolen» skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"9",ord:"de funksjonshemmede",bruk:"2",bokmaal:"Funksjonshemmede er en stor og variert gruppe. Det er best å spesifisere hvem man snakker om. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"10",ord:"dverg",bruk:"1",bokmaal:"Tidligere ble betegnelsen «dverg» brukt om kortvokste, spesielt om mennesker med diagnosen akondroplasi. I dag anses betegnelsen som svært nedverdigende og skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"11",ord:"døv",bruk:"2",bokmaal:"Å være døv vil si at man ikke hører lyd og tale, eller at man hører veldig lite. De fleste døve bruker tegnspråk og opplever at de tilhører en språklig/kulturell gruppe med liten vekt på selve hørselshemmingen. For mange er døvheten mer en identitetsmarkør. «Døv» blir av enkelte brukt som adjektiv eller adverb («døvt») om noe som er kjedelig, tregt eller uattraktivt, og i denne betydningen skal ordet ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"12",ord:"døvespråk",bruk:"1",bokmaal:"Språket heter tegnspråk. Begrepet «døvespråk» skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"13",ord:"døvetolk",bruk:"1",bokmaal:"Det heter tegnspråktolk. Begrepet «døvetolk» skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"14",ord:"døvstum",bruk:"1",bokmaal:"Nesten ingen døve er stumme (uten taleevne). Begrepet oppleves av mange døve som negativt fordi det gir et inntrykk av at døve ikke kan produsere meningsbærende ytringer, noe som er fullt mulig på tegnspråk. Begrepet døvstum skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"15",ord:"evneveik",bruk:"1",bokmaal:"Betegnelsen «evneveik» ble brukt fram til 1960-tallet om mennesker med kognitiv utviklingshemming. Skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"16",ord:"funksjonsfrisk",bruk:"2",bokmaal:"Begrepet blir ofte brukt som motpol til funksjonshemmet, men kan bli oppfattet som støtende fordi det motsatte av det å være frisk, er å være syk. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"17",ord:"gladjenta",bruk:"1",bokmaal:" Kreative adjektiv blir av og til brukt om utviklingshemmede. Kan oppleves som umyndiggjørende maktspråk. Skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"18",ord:"gladgutten",bruk:"1",bokmaal:"Kreative adjektiv blir av og til brukt om utviklingshemmede. Kan oppleves som umyndiggjørende maktspråk. Skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"19",ord:"handikappet",bruk:"2",bokmaal:"Handikappet ble tidligere brukt ved omtale av mennesker med fysisk funksjonshemming. Dette er et begrep som ikke bør benyttes om personer, siden det kan bli oppfattet som nedsettende. Ordet blir derimot brukt i ulike sammensetninger som HC-parkering, handikaptoalett, Handikapforbundet osv. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"20",ord:"hemma",bruk:"2",bokmaal:"Hemma er en nedsettende betegnelse på det å ha en utviklingshemming eller funksjonsnedsettelse, og ordet bør ikke brukes om personer og grupper. Derimot er det greit å bruke begrepet når det er snakk om å være hemma/hemmet i betydningene ‘hindret’, ‘lagt bånd på’ i forhold til noe. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"21",ord:"hjelpesløs",bruk:"2",bokmaal:"«Hjelpeløs» er en nedsettende betegnelse på det å ha en utviklingshemming eller funksjonsnedsettelse, og ordet bør ikke brukes om personer og grupper. Derimot er det greit å bruke begrepet ellers. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"22",ord:"hjerneskade",bruk:"2",bokmaal:"En felles betegnelse for skader på hjernen. Man kan være født med en hjerneskade eller få den senere i livet. Ordet «hjerneskadet» skal ikke brukes som nedsettende adjektiv. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"23",ord:"invalid",bruk:"1",bokmaal:"Invalid er et utdatert ord som signaliserer at personer med nedsatt funksjonsevne har mindre verdi enn andre. Skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"24",ord:"krøpling",bruk:"1",bokmaal:"Krøpling er et nedsettende og støtende begrep som blir brukt om personer med nedsatt funksjonsevne. Skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"25",ord:"mongo",bruk:"1",bokmaal:"Mongo er et slanguttrykk for «mongoloid», som tidligere var en betegnelse på personer med Downs syndrom. Betegnelsen oppleves i dag svært nedsettende. Skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"26",ord:"mongoloid",bruk:"1",bokmaal:"Mongo er et slanguttrykk for «mongoloid», som tidligere var en betegnelse på personer med Downs syndrom. Betegnelsen oppleves i dag svært nedsettende. Skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"27",ord:"psykisk utviklingshemming",bruk:"1",bokmaal:"I helseforvaltningen blir begrepet «psykisk utviklingshemming» fremdeles brukt som en spesifikk diagnoseterm, men det kan være misvisende, da det ikke er snakk om psykisk helse. Begrepet kan oppleves som krenkende og upresist. Skal ikke brukes. Foreslått alternativ: utviklingshemming / utviklingshemmet. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"28",ord:"psykisk utviklingshemmet",bruk:"1",bokmaal:"I helseforvaltningen blir begrepet «psykisk utviklingshemming» fremdeles brukt som en spesifikk diagnoseterm, men det kan være misvisende, da det ikke er snakk om psykisk helse. Begrepet kan oppleves som krenkende og upresist. Skal ikke brukes. Foreslått alternativ: utviklingshemming / utviklingshemmet. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"29",ord:"psykopat",bruk:"1",bokmaal:"En psykopat er en person som lider av varig personlighets- og karakterforstyrrelse, oftest kjennetegnet av mangelfull kontroll av driftsimpulser, følelseskulde og manglende evne til lojalitet og identifikasjon med andre. I allmennspråket er ordet brukt dels som skjellsord og dels i en videre betydning enn den medisinske. Det skal ikke brukes slik i NRK. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"30",ord:"sinnssyk",bruk:"1",bokmaal:"Begrepet ble tidligere brukt om personer med psykiske diagnoser. I dag blir ordet ofte brukt forsterkende. Skal ikke brukes ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"31",ord:"spesielle behov",bruk:"2",bokmaal:"Hvis en person som lever med funksjonsnedsettelse trenger hjelp eller tilrettelegging, sier man ofte at personen har «spesielle behov». Men behovene er som regel ikke så spesielle, som å spise, kle på seg, lese e-post og lignende. Det som varierer, er hvilke verktøy, virkemidler og løsninger man benytter for å fylle ulike behov. Det at man stadig understreker at noen har spesielle behov, kan bidra til at personen føler seg utenfor og er en belastning. Beskriv heller det aktuelle behovet. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"32",ord:"tilrettelegging",bruk:"2",bokmaal:"Tilrettelegging, det å legge til rette, er å planlegge eller tilpasse produkter og tjenester til en gruppe eller til enkeltpersoner. Hensikten med tilrettelegging er å gjøre det mulig for en person eller en gruppe å klare seg selv uten bistand. Tilrettelegging kan være å kjøpe et spesialtastatur til en ansatt eller å tilby bestilling av flybilletter over telefon for dem som ikke klarer å gjøre det over nett. Det er bedre å bruke begrepet «tilgjengelighet» eller «universell utforming» der det er mulig. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"33",ord:"tunghørt",bruk:"2",bokmaal:"Dette er en folkelig betegnelse om dem som hører dårlig eller som begynner å høre dårlig. Noen oppfatter begrepet nedsettende, og det kan gi assosiasjoner til det å ha kognitive utfordringer. Bruk gjerne begreper som «nedsatt hørsel» eller liknende. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"34",ord:"ufør",bruk:"2",bokmaal:"«Ufør» ble tidligere brukt for å beskrive personer med nedsatt funksjonsevne. Begrepet brukes i dag i forbindelse med arbeidsevne, for eksempel «medisinsk uførhet», «uførepensjon» og «uføretrygd». Ufør skal ikke brukes som en generell merkelapp på personer med funksjonsnedsettelse. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"35",ord:"vanfør",bruk:"1",bokmaal:"Nedsettende gammelt uttrykk om personer med bevegelseshemming. Skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"36",ord:"vansiret",bruk:"1",bokmaal:"Tidligere brukt om kroppsdel som var skadet, ødelagt eller ansett som stygg. Skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"37",ord:"yrkeshemmet",bruk:"1",bokmaal:"Tidligere brukt som et alternativ/synonym til ordet funksjonshemmet. Skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"38",ord:"åndssvak",bruk:"1",bokmaal:"Frem til 1960-tallet brukt om mennesker med utviklingshemming . Skal ikke brukes. ",kilde:"NRKs ordliste for funksjonsmangfold",lenke:"https://info.nrk.no/sprak/funksjonsmangfold/"},{id:"39",ord:"mulatt",bruk:"1",bokmaal:"Ordet oppfattes ofte nedsettende og ekskluderende og bør unngås.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"40",ord:"muslimsk utseende",bruk:"1",bokmaal:"Muslimer i Norge kommer fra mange forskjellige land og ser svært forskjellige ut. Vær mer presis.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"41",ord:"neger",bruk:"1",bokmaal:"Ordet oppfattes ofte nedsettende og ekskluderende og bør unngås.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"42",ord:"omreisende",bruk:"1",bokmaal:"Bør unngås i norsk sammenheng, men i enkelte situasjoner der vi omtaler f.eks. britiske romer (sigøynere) som ønsker å bli kalt reisende, kan begrepet likevel brukes.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"43",ord:"omstreifer",bruk:"1",bokmaal:"Bør unngås i norsk sammenheng, men i enkelte situasjoner der vi omtaler f.eks. britiske romer (sigøynere) som ønsker å bli kalt reisende, kan begrepet likevel brukes.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"44",ord:"politisk asyl",bruk:"1",bokmaal:"Bruk bare «asyl». Juridisk sett er det ingenting som heter politisk asyl. Behovet for vern er det sentrale, ikke grunnlaget for at man risikerer forfølgelse.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"45",ord:"romfolk",bruk:"1",bokmaal:"«Romfolk» er en kunstig konstruksjon, som kan bli oppfattet negativt. Begrepet har oppstått fordi mange har vært usikre på hvordan ordet «rom» skal bøyes. Det er ikke snakk om en helhetlig gruppe, men ulike folkegrupper. Bruk heller flertallsformen av ordet «rom» (en rom - romen - romer - romene).",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"46",ord:"utenlandsk bakgrunn",bruk:"1",bokmaal:"Helt upresist. Vær så konkret som mulig.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"47",ord:"utenlandsk opprinnelse",bruk:"1",bokmaal:"Helt upresist. Vær så konkret som mulig.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"48",ord:"utenlandsk utseende",bruk:"1",bokmaal:"Helt upresist. Vær så konkret som mulig.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"49",ord:"våre nye landsmenn",bruk:"1",bokmaal:"Brukes stort sett ironisk og anbefales ikke.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"50",ord:"andregenerasjons innvandrer",bruk:"1",bokmaal:"Den primære identiteten til noen som er født og oppvokst i Norge er gjerne norsk, og det blir derfor feil å kalle vedkommende en andregenerasjons innvandrer.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"51",ord:"tredjegenerasjons innvandrer",bruk:"1",bokmaal:"Den primære identiteten til noen som er født og oppvokst i Norge er gjerne norsk, og det blir derfor feil å kalle vedkommende en andregenerasjons innvandrer.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"52",ord:"eksotisk",bruk:"1",bokmaal:"Mange forbinder noe positivt med begrepet, men det er subjektivt og upresist. Vær mer konkret.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"53",ord:"etnisk opprinnelse",bruk:"1",bokmaal:"Er et meningsløst begrep. Vi har alle etnisk opprinnelse.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"54",ord:"fargerik",bruk:"1",bokmaal:"Er meningsløse begreper når de brukes om mennesker eller en forsamling av individer.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"55",ord:"fremmedkulturell",bruk:"1",bokmaal:"Disse begrepene er i utgangspunktet negative fordi de brukes til å skape distanse eller å ekskludere. Bruken av «fremmedspråklig» om barn med et annet morsmål enn norsk, skal erstattes av «flerspråklig». I stedet for «asiatiske fremmedarbeidere», bør man bruke «asiatiske arbeidere». Men: «Fremmedspråk» brukes fortsatt om valg av undervisning i språk som tysk, spansk, fransk.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"56",ord:"fremmedspråklig",bruk:"1",bokmaal:"Disse begrepene er i utgangspunktet negative fordi de brukes til å skape distanse eller å ekskludere. Bruken av «fremmedspråklig» om barn med et annet morsmål enn norsk, skal erstattes av «flerspråklig». I stedet for «asiatiske fremmedarbeidere», bør man bruke «asiatiske arbeidere». Men: «Fremmedspråk» brukes fortsatt om valg av undervisning i språk som tysk, spansk, fransk.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"57",ord:"fremmedarbeider",bruk:"1",bokmaal:"Disse begrepene er i utgangspunktet negative fordi de brukes til å skape distanse eller å ekskludere. Bruken av «fremmedspråklig» om barn med et annet morsmål enn norsk, skal erstattes av «flerspråklig». I stedet for «asiatiske fremmedarbeidere», bør man bruke «asiatiske arbeidere». Men: «Fremmedspråk» brukes fortsatt om valg av undervisning i språk som tysk, spansk, fransk.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"58",ord:"innvandringsmiljø",bruk:"1",bokmaal:"Lite presist, bruk andre begreper. Husk at også svenske kvinner bosatt i Norge er «innvandrerkvinner».",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"59",ord:"innvandringsbefolkning",bruk:"1",bokmaal:"Lite presist, bruk andre begreper. Husk at også svenske kvinner bosatt i Norge er «innvandrerkvinner».",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"60",ord:"innvandringskvinner",bruk:"1",bokmaal:"Lite presist, bruk andre begreper. Husk at også svenske kvinner bosatt i Norge er «innvandrerkvinner».",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"},{id:"61",ord:"kvoteflykning",bruk:"1",bokmaal:"Er en overføringsflyktning (se egen definisjon). Begrepet «kvoteflyktning» er utdatert.",kilde:"NRKs flerkulturelle ordliste",lenke:"https://fido.nrk.no/22d22e5cb682284d0e8f7cb5b5f5addd3aad59fc3c4765bb807b7de9c13a9c2d/svartelista%20a5%20bokm%C3%A5l.pdf"}],Yr=[{kanselliord:"anbringe",alternativ_1:"sette, legge, plassere, feste",alternativ_2:"@"},{kanselliord:"anbringelse",alternativ_1:"plassering",alternativ_2:"@"},{kanselliord:"anføre",alternativ_1:"oppgi, føre opp",alternativ_2:"vise til, bemerke, nevne, påpeke; hevde, argumentere med"},{kanselliord:"anførsel",alternativ_1:"merknad, opplysning, påstand; innvending, ankepunkt",alternativ_2:"@"},{kanselliord:"angjeldende",alternativ_1:"vedkommende, den det gjelder, de(n) aktuelle, denne, dette",alternativ_2:"@"},{kanselliord:"angående",alternativ_1:"om",alternativ_2:"@"},{kanselliord:"anses som",alternativ_1:"regnes som",alternativ_2:"@"},{kanselliord:"anvendelse",alternativ_1:"bruk",alternativ_2:"@"},{kanselliord:"avgi",alternativ_1:"Ofte: gi (fra seg)",alternativ_2:"@"},{kanselliord:"avhende",alternativ_1:"avstå fra, skille seg av med ved salg; selge; overføre, overdra",alternativ_2:"@"},{kanselliord:"avhending",alternativ_1:"salg (det at noe skifter eier, oftest ved kjøp og salg)",alternativ_2:"@"},{kanselliord:"befatning",alternativ_1:"Ofte: tilknytning, medansvar",alternativ_2:"@"},{kanselliord:"befordre",alternativ_1:"frakte, transportere",alternativ_2:"@"},{kanselliord:"befordring",alternativ_1:"frakt, transport",alternativ_2:"@"},{kanselliord:"beføye",alternativ_1:"råde over, ha råderett over, ha fullmakt til",alternativ_2:"@"},{kanselliord:"beføyelse",alternativ_1:"grunn, berettigelse",alternativ_2:"(del av) rettighet, rett til å rå over (greie med, gjennomføre. Ofte: fullmakt, mandat, anledning. I noen sammenhenger: kompensasjon"},{kanselliord:"begjære",alternativ_1:"anmode om, be om; kreve, gjøre krav på",alternativ_2:"@"},{kanselliord:"begjæring",alternativ_1:"anmodning; krav",alternativ_2:"@"},{kanselliord:"begunstige",alternativ_1:"tilgodese, gi fordeler",alternativ_2:"@"},{kanselliord:"begunstigelse",alternativ_1:"fordel, særrett, velvilje",alternativ_2:"@"},{kanselliord:"bekjentgjøre",alternativ_1:"kunngjøre, gjøre kjent",alternativ_2:"@"},{kanselliord:"beliggende",alternativ_1:"som ligger, som holder til",alternativ_2:"@"},{kanselliord:"besiktige",alternativ_1:"ta i øyesyn for å kontrollere, undersøke",alternativ_2:"@"},{kanselliord:"besiktigelse",alternativ_1:"ettersyn, undersøkelse, kontroll",alternativ_2:"@"},{kanselliord:"besitte",alternativ_1:"ha (til rådighet), sitte inne med. I visse tilfeller: ha på seg eller hos seg.",alternativ_2:"@"},{kanselliord:"komme i besittelse av",alternativ_1:"blir eier av",alternativ_2:"@"},{kanselliord:"være i besittelse av",alternativ_1:"ha, eie",alternativ_2:"@"},{kanselliord:"ta i besittelse",alternativ_1:"ta, overta",alternativ_2:"@"},{kanselliord:"for besittelse av",alternativ_1:"Eksempel: Han ble arrestert fordi han hadde narkotika på seg / hos seg.",alternativ_2:"@"},{kanselliord:"beskaffenhet",alternativ_1:"slag, art, type, karakter",alternativ_2:"@"},{kanselliord:"beskikke",alternativ_1:"utnevne, oppnevne",alternativ_2:"@"},{kanselliord:"beskikkelse",alternativ_1:"utnevning, oppnevning",alternativ_2:"@"},{kanselliord:"besørge",alternativ_1:"sørge for å utføre noe, ordne med, ta hånd om, påta seg",alternativ_2:"@"},{kanselliord:"bevirke",alternativ_1:"føre til, forårsake; få i stand, få til",alternativ_2:"@"},{kanselliord:"bortta",alternativ_1:"fjerne (urettmessig), ta med seg (uten lov)",alternativ_2:"@"},{kanselliord:"erlegge",alternativ_1:"betale",alternativ_2:"@"},{kanselliord:"erleggelse",alternativ_1:"betaling",alternativ_2:"@"},{kanselliord:"erverv",alternativ_1:"inntektsgivende arbeid; yrke",alternativ_2:"anskaffelse, det å skaffe seg. Ofte: kjøpe. "},{kanselliord:"erverve",alternativ_1:"skaffe (seg), anskaffe, tilegne (seg), få. Ofte: kjøpe. I noen sammenhenger: tjene.",alternativ_2:"@"},{kanselliord:"etterleve",alternativ_1:"følge, rette seg etter, lyde",alternativ_2:"@"},{kanselliord:"finne å ",alternativ_1:"Ofte: kunne, ville, finne grunnlag for",alternativ_2:"@"},{kanselliord:"forefinnes",alternativ_1:"finnes, være",alternativ_2:"@"},{kanselliord:"foregi",alternativ_1:"opplyse noe usannferdig (som grunn, unnskyldning), påstå, hevde (uten grunn), gi seg ut for (å være), bruke som påskudd, påstå",alternativ_2:"@"},{kanselliord:"forehavende",alternativ_1:"gjøremål, handling, formål, oppgave, plan",alternativ_2:"@"},{kanselliord:"foreholde noen noe",alternativ_1:"gjøre noen kjent med noe, påpeke (noe betenkelig, uheldig), fortelle noen noe, gjøre oppmerksom på (gjerne med et snev av irettesettelse eller advarsel)",alternativ_2:"@"},{kanselliord:"foreleggelse",alternativ_1:"Ofte: varsel, orientering",alternativ_2:"@"},{kanselliord:"foreligge",alternativ_1:"Ofte: finnes, være, eksistere",alternativ_2:"@"},{kanselliord:"foreliggende",alternativ_1:"Ofte: den aktuelle, dette, denne, disse, som finnes",alternativ_2:"@"},{kanselliord:"forestå",alternativ_1:"stå for; lede; sørge for",alternativ_2:"@"},{kanselliord:"forevise",alternativ_1:"vise (frem)",alternativ_2:"@"},{kanselliord:"forføye over",alternativ_1:"råde over, disponere over; forvalte, bruke",alternativ_2:"@"},{kanselliord:"forføyning",alternativ_1:"råderett, rådighet",alternativ_2:"bestemmelse; tiltak; vedtak"},{kanselliord:"formentlig",alternativ_1:"antatt, påstått",alternativ_2:"antakelig, trolig"},{kanselliord:"forsendelse",alternativ_1:"sending",alternativ_2:"@"},{kanselliord:"forsorg",alternativ_1:"hjelp; i visse sammenhenger: det å sørge for; bekostning. Merk: Det er bedre å skrive om.",alternativ_2:"@"},{kanselliord:"for så vidt gjelder",alternativ_1:"når det gjelder, for",alternativ_2:"@"},{kanselliord:"for så vidt som",alternativ_1:"i og med (at), fordi, siden",alternativ_2:"@"},{kanselliord:"fravike",alternativ_1:"I visse sammenhenger: avstå fra, gi avkall på, forlate, flytte fra",alternativ_2:"@"},{kanselliord:"fravikelse",alternativ_1:"I visse sammenhenger: avståelse, det å forlate. Ofte: utkastelse, flytting.",alternativ_2:"@"},{kanselliord:"fremgå",alternativ_1:"Ofte: være, stå (om noe i tekst), omtales",alternativ_2:"@"},{kanselliord:"fremholde",alternativ_1:"påpeke, fremheve, gjøre oppmerksom på",alternativ_2:"@"},{kanselliord:"fremkomme",alternativ_1:"komme frem, oppstå; i visse sammenhenger: være (med). Merk: Noen ganger kan dette verbet sløyfes, jf. to av eksemplene nedenfor.",alternativ_2:"@"},{kanselliord:"fullbyrde",alternativ_1:"fullføre, sette i verk",alternativ_2:"@"},{kanselliord:"fullbyrdelse",alternativ_1:"fullføring, iverksetting",alternativ_2:"@"},{kanselliord:"ha som følge",alternativ_1:"føre til, føre med seg",alternativ_2:"@"},{kanselliord:"ha til følge",alternativ_1:"føre til, føre med seg",alternativ_2:"@"},{kanselliord:"som en følge av at",alternativ_1:"i og med at, fordi, siden, på grunn av",alternativ_2:"@"},{kanselliord:"som følge av at",alternativ_1:"i og med at, fordi, siden, på grunn av",alternativ_2:"@"},{kanselliord:"gitt",alternativ_1:"på grunn av, i og med, fordi",alternativ_2:"@"},{kanselliord:"gjøre gjeldende",alternativ_1:"vise til, bruke som argument, hevde, påstå",alternativ_2:"@"},{kanselliord:"gjorde gjeldende at",alternativ_1:"viste til / brukte som argument at ...",alternativ_2:"@"},{kanselliord:"gjenstand",alternativ_1:"Ofte: ting, sak",alternativ_2:"@"},{kanselliord:"godtgjøre",alternativ_1:"betale, dekke, erstatte, refundere, tilbakebetale",alternativ_2:"dokumentere, bevise"},{kanselliord:"henhøre",alternativ_1:"høre inn under, høre (med) til; ha forbindelse med",alternativ_2:"@"},{kanselliord:"henhørende",alternativ_1:"som hører til",alternativ_2:"@"},{kanselliord:"henregne",alternativ_1:"regne for å høre med til",alternativ_2:"@"},{kanselliord:"hense",alternativ_1:"i betraktning av, med tanke på, på bakgrunn av",alternativ_2:"@"},{kanselliord:"hensett til",alternativ_1:"i betraktning av, med tanke på, på bakgrunn av",alternativ_2:"@"},{kanselliord:"se hen til",alternativ_1:"i betraktning av, med tanke på, på bakgrunn av",alternativ_2:"@"},{kanselliord:"henseende",alternativ_1:"måte, mening, sammenheng",alternativ_2:"@"},{kanselliord:"hensette",alternativ_1:"sette (fra seg), plassere; parkere (om kjøretøy)",alternativ_2:"@"},{kanselliord:"henstand",alternativ_1:"utsettelse",alternativ_2:"@"},{kanselliord:"henstille til",alternativ_1:"be om, anmode om, oppfordre til",alternativ_2:"@"},{kanselliord:"henstilling",alternativ_1:"anmodning, oppfordring, påminnelse",alternativ_2:"@"},{kanselliord:"henstå",alternativ_1:"vente, bli foreløpig utsatt",alternativ_2:"@"},{kanselliord:"stå hen",alternativ_1:"vente, bli foreløpig utsatt",alternativ_2:"@"},{kanselliord:"hensynta",alternativ_1:"ta hensyn til; ta i betraktning",alternativ_2:"@"},{kanselliord:"hensyntagen",alternativ_1:"med tanke på",alternativ_2:"@"},{kanselliord:"herunder",alternativ_1:"under dette, i den forbindelse",alternativ_2:"blant annet, medregnet, inklusive"},{kanselliord:"herværende",alternativ_1:"lokal, her på stedet, som er her, denne/dette",alternativ_2:"@"},{kanselliord:"hitsette",alternativ_1:"gjengi, oppgi, sitere",alternativ_2:"@"},{kanselliord:"hjemmehørende",alternativ_1:"som hører hjemme i/på, som ligger i/på, som bor i/på, som kommer fra ",alternativ_2:"@"},{kanselliord:"hva gjelder",alternativ_1:"når det gjelder",alternativ_2:"@"},{kanselliord:"hvoretter",alternativ_1:"og deretter",alternativ_2:"ifølge, etter"},{kanselliord:"imøtese",alternativ_1:"se frem til at noe (ventet) vil skje",alternativ_2:"@"},{kanselliord:"inneværende",alternativ_1:"dette, denne",alternativ_2:"@"},{kanselliord:"likeledes",alternativ_1:"også, likeså",alternativ_2:"@"},{kanselliord:"likevel slik at",alternativ_1:"Merk: Dette kan ofte erstattes med men. En mulighet er å dele setningen i to og eventuelt innlede neste setning med men eller NN skal likevel (ikke) ...",alternativ_2:"@"},{kanselliord:"likevel ikke slik at",alternativ_1:"Merk: Dette kan ofte erstattes med men. En mulighet er å dele setningen i to og eventuelt innlede neste setning med men eller NN skal likevel (ikke) ...",alternativ_2:"@"},{kanselliord:"meddele",alternativ_1:"gi",alternativ_2:"@"},{kanselliord:"medføre",alternativ_1:"innebære; være; føre med seg, føre til",alternativ_2:"@"},{kanselliord:"i medhold av",alternativ_1:"i samsvar med, med hjemmel i, etter",alternativ_2:"@"},{kanselliord:"med videre",alternativ_1:"og så videre",alternativ_2:"@"},{kanselliord:"medvirke",alternativ_1:"delta, hjelpe til med, bidra til, støtte, gjøre sitt",alternativ_2:"@"},{kanselliord:"nærværende",alternativ_1:"denne, dette",alternativ_2:"@"},{kanselliord:"omfattes av",alternativ_1:"faller inn under. Merk: I stedet for «X omfattes av Y» kan du skrive «Y gjelder for X».",alternativ_2:"@"},{kanselliord:"omfattet av",alternativ_1:"faller inn under. Merk: I stedet for «X omfattes av Y» kan du skrive «Y gjelder for X».",alternativ_2:"@"},{kanselliord:"oppebære",alternativ_1:"få, ha, motta, innkassere",alternativ_2:"@"},{kanselliord:"opphold",alternativ_1:"avbrudd, pause, forsinkelse i visse sammenhenger: stans",alternativ_2:"@"},{kanselliord:"opphør",alternativ_1:"stans, slutt, avbrudd; i visse sammenhenger: nedleggelse",alternativ_2:"@"},{kanselliord:"opphøre",alternativ_1:"ta slutt, slutte, bli nedlagt",alternativ_2:"@"},{kanselliord:"oppsette",alternativ_1:"I visse sammenhenger: utsette; vente med (å gjøre noe)",alternativ_2:"@"},{kanselliord:"oppstille",alternativ_1:"I visse sammenhenger: sette, stille, etablere",alternativ_2:"@"},{kanselliord:"ovenfornevnte",alternativ_1:"nevnte, som nevnes / er nevnt ovenfor",alternativ_2:"@"},{kanselliord:"ovennevnte",alternativ_1:"nevnte, som nevnes / er nevnt ovenfor",alternativ_2:"@"},{kanselliord:"påberope seg",alternativ_1:"vise til, unnskylde seg med, argumentere med",alternativ_2:"@"},{kanselliord:"påkrevd",alternativ_1:"nødvendig, om å gjøre",alternativ_2:"@"},{kanselliord:"påkrevet",alternativ_1:"nødvendig, om å gjøre",alternativ_2:"@"},{kanselliord:"påregne",alternativ_1:"regne med, vente seg",alternativ_2:"@"},{kanselliord:"riket",alternativ_1:"Oftest: landet, Norge",alternativ_2:"@"},{kanselliord:"samtlige",alternativ_1:"alle",alternativ_2:"@"},{kanselliord:"så fremt",alternativ_1:"hvis, om, dersom",alternativ_2:"@"},{kanselliord:"således",alternativ_1:"slik; dermed",alternativ_2:"@"},{kanselliord:"tarv",alternativ_1:"behov, trang, interesse",alternativ_2:"@"},{kanselliord:"tilflyte",alternativ_1:"komme til, bli til del",alternativ_2:"@"},{kanselliord:"tilkjenne",alternativ_1:"Oftest: tildele (ved dom)",alternativ_2:"@"},{kanselliord:"tilkomme",alternativ_1:"I visse sammenhenger: tilfalle (med rett), få, ha rett til, ha krav på; være (ens) sak/oppgave, være opp til",alternativ_2:"@"},{kanselliord:"tillegge",alternativ_1:"gi, tildele, pålegge (oftest om ansvar, oppgaver og plikter)",alternativ_2:"@"},{kanselliord:"tilligge",alternativ_1:"være ens plikt/oppgave; høre inn under",alternativ_2:"@"},{kanselliord:"tillike",alternativ_1:"også, i tillegg, dessuten",alternativ_2:"@"},{kanselliord:"tilstille",alternativ_1:"(over)sende, sende til",alternativ_2:"@"},{kanselliord:"tilstå",alternativ_1:"I visse sammenhenger: gi, bevilge",alternativ_2:"@"},{kanselliord:"ubesørget",alternativ_1:"ikke utført, ikke ordnet",alternativ_2:"@"},{kanselliord:"uleilighet",alternativ_1:"problem, ulempe, besvær",alternativ_2:"@"},{kanselliord:"undergi",alternativ_1:"innordne under; i visse sammenhenger: gjøre til gjenstand for, la gjennomgå. Merk: Ofte er dette verbet uten eget innhold: undergi behandling = behandle. Det er bedre å skrive om og bruke konkrete verb.",alternativ_2:"@"},{kanselliord:"undergå",alternativ_1:"gjennomgå, oppleve ",alternativ_2:"@"},{kanselliord:"underrette",alternativ_1:"gi beskjed/informasjon om, informere",alternativ_2:"@"},{kanselliord:"underretning",alternativ_1:"beskjed, informasjon, melding",alternativ_2:"@"},{kanselliord:"undertegnede",alternativ_1:"jeg",alternativ_2:"@"},{kanselliord:"unnlate",alternativ_1:"la være. Merk: Ofte er det bedre å erstatte unnlate å / unnlatt å + infinitiv med ikke + fortidsformen av det aktuelle verbet, jf. eksempelet nedenfor.",alternativ_2:"@"},{kanselliord:"unnlatelse",alternativ_1:"Merk: Ofte er det bedre å skrive om. Eksempel: Hvis du ikke...",alternativ_2:"@"},{kanselliord:"utgjøre",alternativ_1:"Ofte: være",alternativ_2:"@"},{kanselliord:"utøve",alternativ_1:"drive med; praktisere. Ofte: bruke",alternativ_2:"@"},{kanselliord:"utøvelse",alternativ_1:"gjennomføring, iverksetting. Ofte: bruk.",alternativ_2:"@"},{kanselliord:"vedrøre",alternativ_1:"angå, gjelde, ha sammenheng med",alternativ_2:"@"},{kanselliord:"vedrørende",alternativ_1:"om, i forbindelse med, som gjelder, som henger sammen med",alternativ_2:"@"},{kanselliord:"vesentlig",alternativ_1:"hovedsakelig, stort sett, for det meste, fortrinnvis",alternativ_2:"@"},{kanselliord:"vitterlig",alternativ_1:"kjent, åpenlys(t)",alternativ_2:"@"},{kanselliord:"yte",alternativ_1:"gi, bidra med. Ofte: betale",alternativ_2:"@"},{kanselliord:"ytterligere",alternativ_1:"enda (en/mer/flere), nærmere, flere",alternativ_2:"@"}],Ur=[{importord:"@",avloeserord:"krøllalfa"},{importord:"abort",avloeserord:"(IKT) programbrot/programbrudd, programavbrot/programavbrudd"},{importord:"access",avloeserord:"tilgang"},{importord:"access code",avloeserord:"tilgangskode"},{importord:"access point",avloeserord:"tilgangspunkt"},{importord:"account manager",avloeserord:"kundeleiar/kundeleder, kundeansvarleg/kundeansvarlig, kundekontakt, jf. key account manager"},{importord:"accountability",avloeserord:"ansvarsutkreving, ansvarleggjering/ansvarliggjøring"},{importord:"actionfilm",avloeserord:"spenningsfilm, valdsfilm/voldsfilm"},{importord:"adde",avloeserord:"(IKT) leggje til, leggje inn / legge til, legge inn"},{importord:"advocacy campaign",avloeserord:"påverknadskampanje/påvirkningskampanje"},{importord:"aftershave",avloeserord:"etterbarberingsvatn/etterbarberingsvann"},{importord:"agenda",avloeserord:"sakliste, dagsorden; (tids)planleggjar/(tids)planlegger, sjuande sans / sjuende sans"},{importord:"aircondition(ing)",avloeserord:"klimaanlegg, luftkondisjonering"},{importord:"allround-",avloeserord:"altmogleg-/altmulig-, allsidig, allmenn-, universal-"},{importord:"allrounder",avloeserord:"allsidig person, altmoglegperson/altmuligperson, mangkunnig person, faktotum, «potet»"},{importord:"amplifier",avloeserord:"forsterkar/forsterker"},{importord:"approach",avloeserord:"tilnærming(småte), framgangsmåte, (innfalls)vinkel"},{importord:"art director (AD)",avloeserord:"kunstnarleg leiar/kunstnerisk leder (teater m.m.); grafisk formgjevar/formgiver (rekl.); reklamesjef (arb.liv)"},{importord:"artist in residence",avloeserord:"gjestekunstnar/gjestekunstner"},{importord:"assist",avloeserord:"målgjevande pasning / målgivende pasning (fotball)"},{importord:"att: (av eng. «attention»)",avloeserord:"ved, v/ (ev. skriv ein berre namnet på ny linje)"},{importord:"attach",avloeserord:"leggje/legge ved, sende med"},{importord:"attachment",avloeserord:"vedlegg"},{importord:"audition",avloeserord:"prøvespel/prøvespill, rolleprøve, opptaksprøve"},{importord:"auditory icon",avloeserord:"lydikon, lydlogo, auditivt ikon, jf. earcon"},{importord:"babyboom",avloeserord:"babybølgje/babybølge, fødselsbølgje/fødselsbølge, jf. boom"},{importord:"backbone",avloeserord:"stamnett (IKT)"},{importord:"backing",avloeserord:"støtte, hjelp, oppfølging (allment); komp, akkompagnement, støtte (mus.); jf. oppbacking, backup"},{importord:"backlash",avloeserord:"tilbakeslag, motreaksjon"},{importord:"backlist",avloeserord:"portefølje"},{importord:"backlog",avloeserord:"restanse, etterslep"},{importord:"back-office",avloeserord:"kontortenar(program)/kontortjener(program) (IKT); kontorstøtte (adm.); jf. front-office"},{importord:"backpacker",avloeserord:"ryggsekkturist"},{importord:"backslash",avloeserord:"omvend skråstrek / omvendt skråstrek"},{importord:"backstage",avloeserord:"bak scenen, bakscenes"},{importord:"backtracking",avloeserord:"tilbakesporing (IKT)"},{importord:"backup",avloeserord:"reservekopi, tryggingskopi/sikkerhetskopi (IKT); støtte, hjelp, oppfølging (allment); jf. backing"},{importord:"bake-off",avloeserord:"ferdigheva/ferdighevet, halvsteikt/halvstekt (bakverk som er klargjord for heving og steiking); ferdigsteikt/ferdigstekt; bakekonkurranse (tv-program)"},{importord:"balanced scorecard (BSC)",avloeserord:"balansert målstyring (BMS)"},{importord:"barbecue",avloeserord:"(hage)grill; grillmat; grillfest"},{importord:"base camp",avloeserord:"baseleir"},{importord:"beacon",avloeserord:"mobilfyr"},{importord:"beacon technology",avloeserord:"mobilfyrteknologi, nettvardeteknologi"},{importord:"bear market",avloeserord:"bjørnemarknad/bjørnemarked "},{importord:"benchmark",avloeserord:"referansenivå, -norm, -verdi, styringsmål, (allment/nær.liv); fastmerke (landmåling)"},{importord:"benchmark test",avloeserord:"yteprøve (IKT)"},{importord:"benchmarking",avloeserord:"referansemåling, referansenormering, styringsnormering"},{importord:"best practice",avloeserord:"mønsterpraksis, bestepraksis, beste praksis"},{importord:"bias",avloeserord:"slagside"},{importord:"binge watching",avloeserord:"seriemaraton, seriefråtsing, tv-fråtsing"},{importord:"blackout",avloeserord:"jernteppe, minnesvinn (allment); mellombels medvitstap / midlertidig bevissthetstap (med.); stort straumbrot / stort strømbrudd (tekn.)"},{importord:"blame game",avloeserord:"skuldspel/skyldspill, syndebukkspel/syndebukkspill"},{importord:"board(s) (reklame)",avloeserord:"(reklame)tavle, reklame(skilt)"},{importord:"bodybuilder",avloeserord:"kroppsbyggjar/kroppsbygger"},{importord:"bodybuilding",avloeserord:"kroppsbygging"},{importord:"bodyguard",avloeserord:"livvakt"},{importord:"booke (inn)",avloeserord:"bestille, tinge; reservere; skrive seg inn"},{importord:"booking",avloeserord:"bestilling, tinging; reservasjon"},{importord:"bookmark",avloeserord:"bokmerke, favoritt"},{importord:"boom",avloeserord:"høgkonjunktur/høykonjunktur (økon.), brå oppgang, brå oppsving (allment); i ordsammensetninger gjerne -bølgje/-bølge, jf. babyboom"},{importord:"booster",avloeserord:"forsterkar/forsterker, effektforsterkar/effektforsterker, sluttforsterkar/sluttforsterker"},{importord:"boote",avloeserord:"starte (datamaskin), kaldstarte, jf. restart"},{importord:"brain drain",avloeserord:"hjerneflukt"},{importord:"brainstorming",avloeserord:"idédugnad, idémyldring"},{importord:"branding",avloeserord:"merkevarebygging (nær.liv); brennemerking (tatoveringsteknikk)"},{importord:"breakdown",avloeserord:"samanbrot/sammenbrudd, havari, driftsfeil, oppdeling, spesifikasjon"},{importord:"breaking news",avloeserord:"siste nytt, nyhendevarsel/nyhetsvarsel, akkurat no / akkurat nå, no:/nå, siste"},{importord:"browse",avloeserord:"bla, bla igjennom, lese"},{importord:"browse path",avloeserord:"katalogstig/katalogsti, filstig/filsti (IKT), jf. search path"},{importord:"browser / web browser",avloeserord:"nettlesar/nettleser"},{importord:"bucket list",avloeserord:"kisteliste"},{importord:"bug",avloeserord:"programfeil, jf. debug"},{importord:"bull market",avloeserord:"oksemarknad/oksemarked "},{importord:"business-to-government (B2G)/ business-to-administration (B2A)",avloeserord:"handel med offentleg sektor / handel med offentlig sektor"},{importord:"business-to-business (B2B)",avloeserord:"handel mellom næringsdrivande / handel mellom næringsdrivende, handel mellom bedrifter"},{importord:"business-to-consumer (B2C)",avloeserord:"detaljhandel"},{importord:"business-to-government (B2G)",avloeserord:"sal til det offentlege / salg til det offentlige (= business-to-administration (B2A))"},{importord:"business case",avloeserord:"prosjektgrunngjeving/prosjektbegrunnelse, verksemdsscenario/virksomhetsscenario, forretningsgrunnlag, konseptgrunnlag"},{importord:"button",avloeserord:"(jakke)merke (allment); knapp (IKT)"},{importord:"by-line (byline)",avloeserord:"signatur"},{importord:"byline picture",avloeserord:"signaturbilete/signaturbilde"},{importord:"cageball",avloeserord:"burball, burfotball"},{importord:"call center (call centre)",avloeserord:"kundesenter, kundetelefon, jf. help desk"},{importord:"calling",avloeserord:"dørtelefon (på hus)"},{importord:"canyon",avloeserord:"gjel, kløft, juv"},{importord:"canyoning",avloeserord:"juving, juvvandring"},{importord:"cap",avloeserord:"skyggelue, kaps"},{importord:"carjacking",avloeserord:"bilkapring"},{importord:"carport",avloeserord:"open garasje / åpen garasje, bilbås"},{importord:"case",avloeserord:"(jf. case study:) kasus, tilfelle, sak, emne, eksempeltilfelle (-person osv.), døme(tilfelle), typeeksempel, typedøme; undersøkelsesobjekt, granskingsemne"},{importord:"case study",avloeserord:"kasusstudie, tilfellestudie, eksempelstudie, dømestudie"},{importord:"cash management",avloeserord:"likviditetsstyring"},{importord:"catering",avloeserord:"matlevering; selskapsmat"},{importord:"catwalk",avloeserord:"motemolo"},{importord:"chat",avloeserord:"nettprat"},{importord:"chatbot",avloeserord:"samtalerobot, praterobot"},{importord:"chatte",avloeserord:"prate på nettet, nettprate, (humor.:) tjatte, tjatre"},{importord:"child grooming",avloeserord:"barnelokking"},{importord:"chip",avloeserord:"(data)brikke, integrert krins / integrert krets, jf. integrated circuit, microchip"},{importord:"chips",avloeserord:"potetgull, potetlauv/potetløv; (mer allment:) flak, spon"},{importord:"chunk",avloeserord:"klump, bit"},{importord:"citizen science",avloeserord:"folkeforsking, grasrotforsking"},{importord:"clickbait",avloeserord:"klikkagn, klikkfang"},{importord:"clou (frå fransk)",avloeserord:"høgdepunkt/høydepunkt, glansnummer"},{importord:"cloud computing",avloeserord:"nettsky (IKT)"},{importord:"clue",avloeserord:"nøkkel, kjerne, poeng"},{importord:"clutch",avloeserord:"koplingspedal, kløtsj"},{importord:"coach",avloeserord:"trenar/trener, rettleiar/veileder, leiar/leder, rådgjevar/rådgiver"},{importord:"coache",avloeserord:"trene, rettleie/veilede"},{importord:"co-branded",avloeserord:"samprodukt"},{importord:"co-branding",avloeserord:"merkevaresamarbeid, merkesamarbeid"},{importord:"cole slaw",avloeserord:"kålsalat"},{importord:"comeback",avloeserord:"tilbakekomst"},{importord:"common sense",avloeserord:"sunn fornuft, folkevett/folkevit"},{importord:"community",avloeserord:"lokalsamfunn, nettgruppe, nettsamfunn"},{importord:"community-ansvarleg",avloeserord:"nettvert, redaktør, nettstammeansvarleg/-ansvarlig, nettgruppe-, nettsamfunn- (på Internett)"},{importord:"competitive edge",avloeserord:"konkurransefordel, konkurranseforsprang"},{importord:"compliance",avloeserord:"etterleving, regeletterleving/regeletterlevelse, regeloppfylling/regeloppfyllelse, samsvar"},{importord:"compliance auditing",avloeserord:"etterlevingsrevisjon/etterlevelsesrevisjon, samsvarsrevisjon"},{importord:"connector",avloeserord:"port, utgang, kontakt, koplingspunkt (maskinvare); portnar/portner, bindeledd (programvare)"},{importord:"content management",avloeserord:"innhaldsstyring/innholdsstyring"},{importord:"content marketing",avloeserord:"innhaldsmarknadsføring/innholdsmarkedsføring"},{importord:"controller",avloeserord:"rekneskapsleiar/regnskapsleder, økonomioppfølgjar/økonomioppfølger, kontrollar/kontroller"},{importord:"cookie",avloeserord:"informasjonskapsel, infokapsel, kjeks (IKT)"},{importord:"copyright",avloeserord:"opphavsrett"},{importord:"corner",avloeserord:"hjørnespark, hjørnekast (idr.)"},{importord:"corporate governance",avloeserord:"eigarstyring og selskapsleiing / eierstyring og selskapsledelse"},{importord:"corporate social responsibility (CSR)",avloeserord:"samfunnsansvaret til bedrifta / bedriftens samfunnsansvar"},{importord:"cottage cheese",avloeserord:"hytteost"},{importord:"cover charge",avloeserord:"inngangspengar/inngangspenger, kuvertavgift, entré"},{importord:"crabsticks",avloeserord:"krabbepinnar/krabbepinner"},{importord:"cracker",avloeserord:"datapirat"},{importord:"crew",avloeserord:"stab, arbeidslag, gruppe, besetning, mannskap"},{importord:"cross media publishing",avloeserord:"tverrpublisering, tverrmedial publisering"},{importord:"crowd funding",avloeserord:"kronerulling (på nett), pengeinnsamling, folkefinansiering"},{importord:"crowdsourcing",avloeserord:"(nett)dugnad"},{importord:"cruise control",avloeserord:"fartshaldar/fartsholder"},{importord:"cyber-",avloeserord:"kyber- (brukt om datamaskiner og Internett-universet)"},{importord:"cyberstalking",avloeserord:"nettforfølging/nettforfølgelse, nett-elting, nettsjikane, netterror"},{importord:"data mart",avloeserord:"datatorg, datamarknad/datamarked"},{importord:"data warehouse",avloeserord:"datavarehus"},{importord:"deadline",avloeserord:"leveringsfrist, tidsfrist, frist"},{importord:"debug",avloeserord:"avluse; feilsøkje/feilsøke; rette programfeil, fjerne programlus; jf. bug"},{importord:"dedicated",avloeserord:"engasjert, ihuga, heilhjarta/helhjertet (allment); dedisert (litt.); dedikert, (særskilt) tilordna/tilordnet og tilpassa/tilpasset (IKT), laga/laget for"},{importord:"default",avloeserord:"standard(verdi), standardinnstilling (grunn-, forhånds-, normal-, leverandør-, produsent-)"},{importord:"degrowth",avloeserord:"nedvekst"},{importord:"desktop publishing (DTP)",avloeserord:"skrivebordssetjing/skrivebordssetting"},{importord:"direct mail",avloeserord:"direktereklame"},{importord:"disc-at-once",avloeserord:"heilbrenning/helbrenning, einøktsbrenning/enøktsbrenning, jf. session-at-once"},{importord:"disc-jockey (DJ)",avloeserord:"plateprater, platesnurrer, platekusk, plateryttar/platerytter, diskjockey"},{importord:"disclaimer",avloeserord:"ansvarsfråskriving, atterhald / ansvarsfraskrivelse, forbehold"},{importord:"display",avloeserord:"skjerm, teiknrute/tegnrute, (tekst)vindauge/(tekst)vindu (t.d. på telefonen)"},{importord:"disruptive technology",avloeserord:"brytningsteknologi"},{importord:"docu-soap",avloeserord:"dokumentarsåpe, dokusåpe"},{importord:"dot (uttalt «dått» etter eng.)",avloeserord:"punktum (i Internett- og e-postadresser)"},{importord:"dotcom-selskap",avloeserord:"nettselskap"},{importord:"double backslash",avloeserord:"dobbel omvend skråstrek / dobbelt omvendt skråstrek, jf. backslash"},{importord:"double slash",avloeserord:"dobbel skråstrek / dobbelt skråstrek, jf. slash"},{importord:"doughnut",avloeserord:"(amerikansk) smultring"},{importord:"downlight",avloeserord:"(innfelt) nedlys"},{importord:"drawback",avloeserord:"ulempe, bakdel, mangel"},{importord:"driver",avloeserord:"drivar/driver (norsk uttale), styreprogram"},{importord:"dummy",avloeserord:"modell, prototyp, falsk, uekte, skinn-"},{importord:"earcon",avloeserord:"lydikon, lydlogo, jf. auditory icon"},{importord:"e-book reader, e-book device",avloeserord:"lesebrett"},{importord:"e-business",avloeserord:"e-forretningar/e-forretninger, e-forretningsdrift; e-forretning (om det enkelte firmaet)"},{importord:"e-commerce",avloeserord:"e-handel, netthandel"},{importord:"economies of agglomeration",avloeserord:"samlokaliseringsfordelar/samlokaliseringsfordeler"},{importord:"editor",avloeserord:"redigeringsprogram (IKT)"},{importord:"e-mail",avloeserord:"jf. mail"},{importord:"embed",avloeserord:"bygge inn / byggje inn, setje/sette, felle"},{importord:"employer branding",avloeserord:"arbeidsgjevarprofilering/arbeidsgiverprofilering"},{importord:"empower",avloeserord:"myndiggjere/myndiggjøre, styrke, gje/gi styrke, setje i stand / sette i stand"},{importord:"empowerment",avloeserord:"myndiggjering/myndiggjøring, styrking (f.eks. pasientstyrking)"},{importord:"enter(tast)",avloeserord:"linjeskift(tast), retur(tast)"},{importord:"entertainer",avloeserord:"underhaldar/underholder, underhaldningsartist/underholdningsartist, enterteinar/enterteiner"},{importord:"equalizer",avloeserord:"tonekontroll; utjamnar/utjevner, utjamningsfilter/utjevningsfilter, jf. graphic equalizer"},{importord:"e-reader",avloeserord:"lesebrett"},{importord:"establishment, the",avloeserord:"det beståande / det bestående (samfunnet), etablissementet"},{importord:"e-tailer",avloeserord:"e-taljist, nettkjøpmann"},{importord:"eyeliner",avloeserord:"kajal, augeblyant/øyeblyant, jf. lipliner"},{importord:"facility management",avloeserord:"næringsforvaltning, eigedomsforvaltning/eiendomsforvaltning, bygningsforvaltning"},{importord:"faction",avloeserord:"faksjon (fakta + fiksjon)"},{importord:"factoring",avloeserord:"faktoring, fakturakreditt"},{importord:"fair",avloeserord:"rimeleg/rimelig, rettferdig, real, ærleg/ærlig"},{importord:"fair play",avloeserord:"ærleg spel /ærlig spill, rettferdig behandling"},{importord:"fan",avloeserord:"tilhengjar/tilhenger, beundrar/beundrer"},{importord:"fanklubb",avloeserord:"beundrarklubb/beundrerklubb, venelag"},{importord:"fast food",avloeserord:"kjappmat, hurtigmat, snøggmat, gatekjøkkenmat, jf. junk food"},{importord:"fatbike",avloeserord:"tjukksykkel"},{importord:"feature",avloeserord:"preg-, bakgrunns-, dokumentar-, interesse-, tema- (i ymse samansetjingar, t.d. med -artikkel , -journalistikk)"},{importord:"feed",avloeserord:"straum/strøm (i sosiale medium/sosiale medier)"},{importord:"feedback",avloeserord:"tilbakemelding, respons, reaksjon, tilbakekopling, svar"},{importord:"fight",avloeserord:"(hard eller intens) kamp, hardt oppgjer / hardt oppgjør, fait"},{importord:"fighte",avloeserord:"slåss/slåst, kjempe, konkurrere, faite"},{importord:"fighter",avloeserord:"kjempar/kjemper, faitar/faiter"},{importord:"fighting spirit",avloeserord:"kampånd, kampglød, gå-på-humør"},{importord:"file server",avloeserord:"filtenar/filtjener"},{importord:"finish",avloeserord:"sluttspurt; finpuss; finisj"},{importord:"fintech",avloeserord:"finansteknologi"},{importord:"flight",avloeserord:"(fly)avgang, (fly)rute, flyging/flygning, flytur"},{importord:"flight recorder",avloeserord:"ferd(s)skrivar/ferd(s)skriver"},{importord:"flip-over",avloeserord:"arktavle, papirtavle, stativblokk, flippover"},{importord:"flop",avloeserord:"fiasko, flopp"},{importord:"flow",avloeserord:"strøm; (psyk.:) flyt"},{importord:"flow chart",avloeserord:"flytskjema, flytdiagram"},{importord:"food processor",avloeserord:"kjøkkenmaskin, matmølle, matprosessor, matkvern"},{importord:"food truck",avloeserord:"matvogn, matbil"},{importord:"footer",avloeserord:"botntekst/bunntekst, jf. header (IKT)"},{importord:"franchise",avloeserord:"forhandlarrett/forhandlerrett, agentur"},{importord:"franchising",avloeserord:"forhandlarrettssamarbeid/forhandlerrettssamarbeid, forhandlaravtale/forhandleravtale"},{importord:"freelance",avloeserord:"frilans (adj.); frilansar/frilanser (subst.)"},{importord:"frisbee",avloeserord:"disk, skjenebrett, sendeplate"},{importord:"front-office",avloeserord:"kontorklient(program), jf. backoffice"},{importord:"frozen shoulder",avloeserord:"frosen skulder / frossen skulder (med.)"},{importord:"fun fact",avloeserord:"morofakta"},{importord:"fund raising",avloeserord:"pengeinnsamling, innsamlingsaksjon"},{importord:"fuzzy logic",avloeserord:"ullen logikk, flytande / flytende logikk, lodden logikk, linn logikk"},{importord:"gadget",avloeserord:"dings"},{importord:"gate",avloeserord:"utgang (på flyplass)"},{importord:"geek",avloeserord:"fagidiot; særling; dust"},{importord:"General Data Protection Regulation (GDPR)",avloeserord:"personvernforordningen (PVF)"},{importord:"ghost writer",avloeserord:"skyggeforfatter / skuggeforfattar"},{importord:"Global Positioning System (GPS)",avloeserord:"globalt posisjonsystem (GPS)"},{importord:"golden goal",avloeserord:"førstemålssiger/førstemålsseier, «første målet vinn» / «første målet vinner»"},{importord:"goodwill",avloeserord:"velvilje, godvilje"},{importord:"governance",avloeserord:"styring (og ettersyn); delaktighetsstyring; styresett"},{importord:"graphic equalizer",avloeserord:"grafisk tonekontroll, jf. equalizer"},{importord:"gründer",avloeserord:"grunnleggjar/grunnlegger (nøytralt); jobbar/jobber (negativt); jobbskapar/jobbskaper (positivt)"},{importord:"guide",avloeserord:"omvisar/omviser, turleder/turleiar, reiseleiar/reiseleder, gaid"},{importord:"guts",avloeserord:"(ha) mot, pågangsmot, vågemot, karakter(styrke), tæl, nerk; (være/vere) modig, djerv, uredd, ikke/ikkje skvetten"},{importord:"hacker",avloeserord:"datasnok"},{importord:"handout",avloeserord:"støtteark"},{importord:"handsfree",avloeserord:"handfri/håndfri (mobiltelefon)"},{importord:"hanggliding",avloeserord:"hengeflyging, hengegliding"},{importord:"hangover",avloeserord:"fyllesjuke, tømmermenn, bakrus"},{importord:"hard disk",avloeserord:"platelager, harddisk"},{importord:"hardware",avloeserord:"maskinvare"},{importord:"hashtag",avloeserord:"emneknagg"},{importord:"heade",avloeserord:"nikke, skalle, stange, hedde"},{importord:"header",avloeserord:"topptekst, jf. footer (IKT)"},{importord:"heading",avloeserord:"(fotball) hovudstøyt/hodestøt"},{importord:"headhunte",avloeserord:"handplukke/håndplukke, drive hovudjakt / drive hodejakt"},{importord:"headhunting",avloeserord:"handplukking/håndplukking, hovudjakt/hodejakt, utveljing/utvelging"},{importord:"heading",avloeserord:"overskrift, tittel (media); nikking, hedding (idr.)"},{importord:"heavy rock",avloeserord:"tungrock"},{importord:"help desk",avloeserord:"hjelpesentral, hjelpeteneste/hjelpetjeneste, kundehjelp, svarteneste/svartjeneste, jf. call center og support"},{importord:"hibernation mode",avloeserord:"dvalemodus (IKT)"},{importord:"highlight",avloeserord:"høgdepunkt/høydepunkt"},{importord:"hi-tech",avloeserord:"høgteknologisk/høyteknologisk"},{importord:"holding company",avloeserord:"eigarselskap/eierselskap, holdingselskap"},{importord:"horrorfilm",avloeserord:"grøssar/grøsser, skrekkfilm"},{importord:"host (med eng. uttale)",avloeserord:"(web)hotell, vert, vertsteneste/vertstjeneste (IKT)"},{importord:"hoste (med eng. uttale)",avloeserord:"drifte, leige ut / leie ut [plass til] programvare og bruk av programvare på datamaskiner over Internett, jf. web hotel"},{importord:"hosted (med eng. uttale)",avloeserord:"utleigd/utleid"},{importord:"hosting (med eng. uttale)",avloeserord:"netthotell, utleige/utleie"},{importord:"hostmaster",avloeserord:"namnemeister/navnemester, namneforvaltar/navneforvalter (for særskilde Internett-tenester)"},{importord:"hotlist",avloeserord:"favorittliste, yndlingsbokmerke/yndlingsbokmerker (IKT)"},{importord:"house",avloeserord:"huse (andres operative maskinvare i eigne lokale mot betaling), jf. hoste"},{importord:"housed",avloeserord:"husa/huset"},{importord:"housing",avloeserord:"husing"},{importord:"human resource (HR)",avloeserord:"personalressurs"},{importord:"human resource management (HRM)",avloeserord:"leiing av personalressursar / ledelse av personalressurser, leiing av menneskelege ressursar (LMR) / Ledelse av menneskelige ressurser (LMR)"},{importord:"human resource manager",avloeserord:"personalsjef"},{importord:"image",avloeserord:"uttrykk, (personleg/personlig) stil, profil, omdømme, ry"},{importord:"impact",avloeserord:"samfunnsbidrag"},{importord:"implementere",avloeserord:"setje i verk/iverksette, setje ut i livet / sette ut i livet, gjennomføre"},{importord:"India pale ale",avloeserord:"indiaøl"},{importord:"influencer",avloeserord:"påverkar/påvirker"},{importord:"infotainment",avloeserord:"nyheitsunderhaldning/nyhetsunderholdning, tabloid-"},{importord:"in-house",avloeserord:"intern-, firma- (i samansetjingar), sjølv/selv, på huset"},{importord:"inline skates",avloeserord:"(«linjeskøyter», dvs. rulleskøyter med hjulene på rekke:) rulleskøyter"},{importord:"inside trading",avloeserord:"innsidehandel"},{importord:"insider",avloeserord:"innsidar/innsider"},{importord:"instant coffee",avloeserord:"pulverkaffi/pulverkaffe"},{importord:"instant message",avloeserord:"direktemelding, hurtigmelding, snøggmelding"},{importord:"instant messaging (IM)",avloeserord:"direktemeldingst(j)eneste, snøggmeldingsteneste/hurtigmeldingstjeneste"},{importord:"integrated circuit",avloeserord:"integrert krins / integrert krets, (data)brikke, jf. chip"},{importord:"interface",avloeserord:"grensesnitt"},{importord:"Internet service provider (ISP)",avloeserord:"internettilbydar/internettilbyder"},{importord:"jetlag",avloeserord:"jet(t)sjuke/jet(t)syke, døgnville/døgnvillhet"},{importord:"jingle",avloeserord:"lydvignett, lydlogo"},{importord:"joint venture",avloeserord:"samføretak/samforetak, fellesføretak/fellesforetak, samarbeidsprosjekt"},{importord:"joystick",avloeserord:"styrespak, kontrollspak"},{importord:"junk food",avloeserord:"søppelmat, usunn mat, gatekjøkkenmat, jf. fast food"},{importord:"just-in-time-prinsippet",avloeserord:"i-rett(e)-tid-prinsippet, der-og-da-prinsippet"},{importord:"keeper",avloeserord:"målvakt"},{importord:"key account manager",avloeserord:"hovudkundeansvarleg/hovedkundeansvarlig, nøkkelkundeleiar/nøkkelkundeleder, nøkkelkundekonsulent"},{importord:"keyboard",avloeserord:"tangentbrett (mus.); tastatur (IKT)"},{importord:"kick-off",avloeserord:"avspark (idr.); oppstart, start (allment)"},{importord:"killer application («killer app»)",avloeserord:"tetprogram, vinnarprogram/vinnerprogram (IKT)"},{importord:"knowhow",avloeserord:"fagkunnskap, faginnsikt, ekspertise"},{importord:"knowledge management",avloeserord:"kunnskapsleiing/kunnskapsledelse, kompetanseleiing/kompetanseledelse"},{importord:"laptop",avloeserord:"berbar (datamaskin, pc) / bærbar (datamaskin, pc) (IKT)"},{importord:"layout",avloeserord:"grafisk utforming, oppsett, bladbunad, jf. design"},{importord:"leading zero",avloeserord:"leiande null / ledende null, førestilt null / foranstilt null"},{importord:"leasing",avloeserord:"leigefinansiering/leiefinansiering"},{importord:"leisure wear",avloeserord:"fritidsklede/fritidsklær"},{importord:"lighter",avloeserord:"(sigarett-)tennar/(sigarett-)tenner"},{importord:"link",avloeserord:"lenkje/lenke, peikar/peker, kopling (IKT)"},{importord:"lipgloss",avloeserord:"leppeglans"},{importord:"lipliner",avloeserord:"leppeblyant, leppekajal, jf. eyeliner"},{importord:"literacy",avloeserord:"skriftkultur, skriftkunne/skriftkyndighet, tekstkompetanse, litterasitet"},{importord:"literature review",avloeserord:"litteraturgjennomgang"},{importord:"live",avloeserord:"direktesend/direktesendt, direkte"},{importord:"loin",avloeserord:"(om fisk:) rygg (f.eks. torskerygg), ryggstykke, ryggfilet (uten halestykket)"},{importord:"mail",avloeserord:"e-post, e-brev, e-melding, jf. e-mail"},{importord:"maile",avloeserord:"sende e-post, e-poste"},{importord:"mailing list",avloeserord:"e-postliste"},{importord:"mainstream-",avloeserord:"hovudstraums-/hovedstrøms-, midtstims-, midtstraums-/midtstrøms-"},{importord:"makerspace",avloeserord:"folkeverkstad/folkeverksted"},{importord:"makeup",avloeserord:"sminke"},{importord:"management",avloeserord:"leiing/ledelse (bedrifts-), styring"},{importord:"management consultant",avloeserord:"bedriftsrådgjevar/bedriftsrådgiver, strategirådgjevar/strategirådgiver"},{importord:"manager",avloeserord:"leiar/leder, sjef, forretningsførar/forretningsfører, impresario, arrangør"},{importord:"manual",avloeserord:"handbok/håndbok, bruksrettleiing/bruksanvisning"},{importord:"marketing",avloeserord:"marknadsføring/markedsføring"},{importord:"mashup",avloeserord:"nettfletting (IKT)"},{importord:"match",avloeserord:"kamp (idr.); jambyrdig motstandar / jevnbyrdig motstander, make; (full) klaff"},{importord:"matche",avloeserord:"passe saman med / passe sammen med, stå til; komme opp mot, måle seg med"},{importord:"m-commerce (mobile commerce)",avloeserord:"m-handel, mobilhandel"},{importord:"memory card",avloeserord:"minnekort"},{importord:"memory stick",avloeserord:"minnepinne"},{importord:"metallic",avloeserord:"(med) metallglans"},{importord:"microchip",avloeserord:"(data)brikke, mikrobrikke, integrert krins / integrert krets, jf. chip, integrated circuit"},{importord:"mindfulness",avloeserord:"oppmerksomt nærvær / merksamt nærvær, ans"},{importord:"mnemonic",avloeserord:"hugsesymbol/huskesymbol, hugseregel/huskeregel"},{importord:"mnemonics",avloeserord:"hugsekunst/huskekunst, hugseteknikk/husketeknikk"},{importord:"moderator",avloeserord:"debattleder, ordstyrer"},{importord:"mountain bike",avloeserord:"terrengsykkel, jf. offroad-sykkel"},{importord:"mountain biking",avloeserord:"terrengsykling, jf. offroad-sykkel"},{importord:"multiple choice (question)",avloeserord:"fleirvalsoppgåve/flervalgsoppgave"},{importord:"multitasking",avloeserord:"fleiroppgåvekjøring/fleroppgavekjøring (IKT)"},{importord:"multi touch-screen",avloeserord:"fleirtrykksskjerm/flertrykksskjerm (IKT)"},{importord:"musical",avloeserord:"musikkspel/musikkspill, musikal"},{importord:"must",avloeserord:"nødvendigheit/nødvendighet"},{importord:"mute",avloeserord:"dempar/demper"},{importord:"network governance",avloeserord:"nettverksstyring"},{importord:"news on demand",avloeserord:"nyheiter etter (ved) behov, på bestilling / nyheter etter (ved) behov, på bestilling, jf. on demand"},{importord:"newsfeed",avloeserord:"nyheitsvarsling/nyhetsvarsling, -mating, -straum/strøm"},{importord:"newsgroup",avloeserord:"temagruppe, nyheitsgruppe/nyhetsgruppe, diskusjonsgruppe (IKT)"},{importord:"no-platform",avloeserord:"scenenekt"},{importord:"notebook",avloeserord:"berbar (datamaskin) / bærbar (datamaskin) (IKT)"},{importord:"offline (off-line)",avloeserord:"nedkopla/nedkoplet, fråkopla/frakoplet, jf. online"},{importord:"off-piste",avloeserord:"laussnøkjøring/løssnøkjøring, frikjøring"},{importord:"offroad-sykkel",avloeserord:"terrengsykkel, jf. mountain bike"},{importord:"on demand",avloeserord:"etter behov, behovs-, -bestillings-, tingings-, på førespurnad / på forespørsel, jf. news, print, publishing og video on demand"},{importord:"on-hook dialing",avloeserord:"rørlaus oppringing / rørløs oppringing"},{importord:"online (on-line)",avloeserord:"oppkopla/oppkoplet, tilkopla/tilkoplet, på nettet (IKT); tilgjengeleg/tilgjengelig eller «med» (sjargong), jf. offline"},{importord:"open access",avloeserord:"open/åpen tilgang"},{importord:"oppbacking",avloeserord:"oppbakking, jf. backing"},{importord:"option",avloeserord:"val/valg, alternativ, moglegheit/mulighet (allment); opsjon (økon./pol.); funksjonsval/funksjonsvalg (IKT)"},{importord:"outlet",avloeserord:"fabrikkutsalg, merkevareutsalg"},{importord:"outsider",avloeserord:"utsidar/utsider"},{importord:"out-of-office message",avloeserord:"fråværsmelding/fraværsmelding"},{importord:"outsourcing",avloeserord:"utkontraktering, tenesteutsetjing/tjenesteutsetting "},{importord:"overhead",avloeserord:"skriftprosjektør, lysarkvisar/lysarkviser (tekn.); lysark, transparent (tekn.); administrasjonskostnader, felleskostnader (økon.)"},{importord:"overheadprojektor",avloeserord:"skriftprosjektør, lysarkvisar/lysarkviser"},{importord:"pager",avloeserord:"personsøkjar/personsøker"},{importord:"paper",avloeserord:"forskingsartikkel/forskningsartikkel, vitskapleg innlegg/vitenskapelig innlegg"},{importord:"paramedic",avloeserord:"paramedisinar/paramedisiner (person)"},{importord:"paring",avloeserord:"(mobil) parkopling, paring"},{importord:"patch",avloeserord:"reparasjonsfil, programfiks, feilfiks (IKT)"},{importord:"patchwork",avloeserord:"lappeteknikk, jf. quilt"},{importord:"patient (care) pathway",avloeserord:"pasientforløp/pasientløype"},{importord:"peer review",avloeserord:"fagfellevurdering, kollegavurdering"},{importord:"peer-to-peer (P2P) network",avloeserord:"likenett, jambyrdsnett/jevnbyrdsnett"},{importord:"peptalk",avloeserord:"peppreik, pepprat, kveikpreik, piffprat"},{importord:"performance-kunst",avloeserord:"framføringskunst"},{importord:"phishing",avloeserord:"nettfisking"},{importord:"pink",avloeserord:"rosa, lyseraud/lyserød"},{importord:"pitch",avloeserord:"innsal/innsalg"},{importord:"plug-in",avloeserord:"programtillegg"},{importord:"podcast",avloeserord:"podkast, poddkast"},{importord:"pole position",avloeserord:"beste startspor"},{importord:"policy",avloeserord:"politikk, taktikk, retningslinjer"},{importord:"polish",avloeserord:"poler(ings)middel, pussemiddel, polisj"},{importord:"pop-up menu",avloeserord:"oppsprettsmeny, sprettoppmeny, hurtigmeny, snøggmeny"},{importord:"poster",avloeserord:"plakat"},{importord:"preset",avloeserord:"førehandssetje/forhåndssette, førehandsinnstille/forhåndsinnstille"},{importord:"prime time",avloeserord:"beste sendetid"},{importord:"print on demand (POD)",avloeserord:"trykk etter behov (TEB), bestillingstrykk, tingingstrykk, jf. publishing on demand"},{importord:"printe (ut)",avloeserord:"skrive ut"},{importord:"printer",avloeserord:"skrivar/skriver"},{importord:"process flow",avloeserord:"prosessflyt"},{importord:"producer",avloeserord:"produsent, produksjonsleiar/produksjonsleder, produksjonsansvarleg/produksjonsansvarlig"},{importord:"promotion",avloeserord:"salsframstøyt/salgsframstøt; (fram)hjelp, fremming, promotering"},{importord:"proof of concept (POC)",avloeserord:"konseptprov/konseptbevis"},{importord:"proxy server",avloeserord:"mellom(ledds)tenar/mellom(ledds)tjener"},{importord:"public service (broadcasting)",avloeserord:"allmennkringkasting"},{importord:"publishing on demand",avloeserord:"medieuavhengig publisering, medienøytral publisering, jf. print on demand og on demand"},{importord:"pulled pork",avloeserord:"plukksvin"},{importord:"push-up",avloeserord:"armheving"},{importord:"quilt",avloeserord:"(vattert) lappeteppe, jf. patchwork"},{importord:"quilte",avloeserord:"sy (vattert) lappeteppe, jf. patchwork"},{importord:"rack",avloeserord:"reol (mus., IKT, allment)"},{importord:"rail",avloeserord:"takreling, takhaldar/takholder (tekn.); reling (allment)"},{importord:"ransomware",avloeserord:"løysepengevirus/løsepengevirus, utpressingsvirus, gisselskadevare"},{importord:"raw food",avloeserord:"råmat"},{importord:"reality-TV",avloeserord:"røyndoms-TV/virkelighets-TV, dokusåpe"},{importord:"recovery",avloeserord:"(helse) tilfrisking/tilfriskning"},{importord:"referee",avloeserord:"fagkonsulent (i tidsskrift)"},{importord:"refill",avloeserord:"påfyll"},{importord:"release",avloeserord:"plateslepp/plateslipp"},{importord:"release notes",avloeserord:"produktmerknader, versjonsmerknader (IKT)"},{importord:"release party",avloeserord:"(plate)sleppfest/(plate)slippfest"},{importord:"research",avloeserord:"(for)undersøking/(for)undersøkelse, kjeldearbeid/kildearbeid"},{importord:"reset",avloeserord:"tilbakestille, nullstille"},{importord:"restart",avloeserord:"omstart, varmstart, jf. boote (IKT)"},{importord:"retail version",avloeserord:"forhandlarversjon/forhandlerversjon, salsversjon/salgsversjon (IKT)"},{importord:"retweet",avloeserord:"gjentvitre/oppattvitre, retvitre"},{importord:"reverse engineering",avloeserord:"omvend/omvendt utvikling, tilbakevikling, inversutvikling"},{importord:"road-movie",avloeserord:"landevegsfilm/landeveisfilm"},{importord:"roaming",avloeserord:"nettveksling, nett(om)streifing, nettgjesting"},{importord:"rockhopping",avloeserord:"(i havpadling:) brot(t)leik, brot(t)padling"},{importord:"roller blades",avloeserord:"(eg. inline skates «linjeskøyter») rulleskøyter"},{importord:"roll-on",avloeserord:"(kule)deodorant, (uformelt:) rulledeo"},{importord:"roll-up",avloeserord:"rullebanner, rulleplakat"},{importord:"RSS feed",avloeserord:"nyheitsvarsling/nyhetsvarsling, -mating"},{importord:"sample",avloeserord:"punktprøve (tekn.); lydsnutt, videosnutt (mus., media); utval/utvalg (samf.vit.)"},{importord:"sampling",avloeserord:"punktprøving (tekn.); digitalisering (mus., media); direkte utdeling av vareprøver (nær.liv)"},{importord:"scanne",avloeserord:"skanne, avlese"},{importord:"scanner",avloeserord:"skannar/skanner, avlesar/avleser"},{importord:"scoop",avloeserord:"varp, nyheitskupp/nyhetskupp, skup"},{importord:"scrapie",avloeserord:"skrapesjuke/skrapesyke (hos sau)"},{importord:"screen dump",avloeserord:"skjermdump, skjermbiletkopi/skjermbildekopi"},{importord:"screen shot",avloeserord:"skjermdump, skjermbiletkopi/skjermbildekopi"},{importord:"screening",avloeserord:"masseundersøking"},{importord:"scroll bar",avloeserord:"rullefelt, rullesjakt (IKT)"},{importord:"search path",avloeserord:"søkjebane/søkebane, søkjeveg/søkevei (i operativsystem), jf. browse path"},{importord:"segway",avloeserord:"ståhjuling"},{importord:"selfie",avloeserord:"sjølis, selvis / sjølvis, selvportrett, sjølportrett / sjølvportrett"},{importord:"server",avloeserord:"tenar/tjener, jf. webserver"},{importord:"session-at-once",avloeserord:"delbrenning, øktbrenning, fleirøktsbrenning/flerøktsbrenning, jf. disc-at-once"},{importord:"shoppe",avloeserord:"handle, gå på handletur, gå i butikkar / gå i butikker"},{importord:"shoppingsenter",avloeserord:"kjøpesenter, butikksenter"},{importord:"short message system (SMS)",avloeserord:"kortmeldingsteneste/kortmeldingstjeneste (for SMS-meldingar, dss. tekstmeldingar)"},{importord:"sidebar",avloeserord:"sidestolpe, infostolpe (IKT)"},{importord:"single touch-screen",avloeserord:"enkelttrykksskjerm/eittrykksskjerm (IKT)"},{importord:"site (web -)",avloeserord:"vevstad/vevsted, nettstad/nettsted"},{importord:"skateboard",avloeserord:"rullebrett"},{importord:"skins",avloeserord:"drakt, tema, ham (IKT), jf. themes"},{importord:"skippe",avloeserord:"late vere / la være, hoppe over, sløyfe, kutte ut"},{importord:"slash (/)",avloeserord:"skråstrek"},{importord:"slippery slope",avloeserord:"(overført:) skråplan"},{importord:"slow motion",avloeserord:"sakte film, langsam kino / langsom kino"},{importord:"smoothie",avloeserord:"smudi"},{importord:"snowboard",avloeserord:"snøbrett"},{importord:"software",avloeserord:"programvare"},{importord:"sound",avloeserord:"klangfarge, lydstil"},{importord:"soundtrack",avloeserord:"lydspor"},{importord:"sous vide",avloeserord:"vakuumlaga mat / vakuumlaget mat, vakuumtilverka mat / vakuumtilberedt mat, vakuumtrekt mat / vakuumtrukket mat, vakuumtilverking / vakuumtilberedelse"},{importord:"space management",avloeserord:"varestyring"},{importord:"space manager",avloeserord:"vareansvarleg/vareansvarlig"},{importord:"spam",avloeserord:"søppelpost"},{importord:"speaking notes",avloeserord:"handnotat/håndnotat, foredragsmanus, talemanus, talenotat/talenotater"},{importord:"spin-off",avloeserord:"avspinn, sideverknad/sidevirkning, sideeffekt"},{importord:"spoiler alert",avloeserord:"plottblottar/plottblotter, røpealarm, røpevarsel"},{importord:"spotlight",avloeserord:"punktlys, punktlampe, spotlys, rampelys"},{importord:"stakeholder",avloeserord:"interessent"},{importord:"stalker",avloeserord:"forfølger/forfølgjar, (nyno. òg:) eltar"},{importord:"standby",avloeserord:"klar, parat, i beredskap (allment); beredskaps- (-fartøy, -troppar o.a.) (mil.)"},{importord:"standbybillett",avloeserord:"sjansebillett"},{importord:"standbymodus",avloeserord:"ventemodus, kvilemodus/hvilemodus (tekn., IKT)"},{importord:"stand-in",avloeserord:"reserve"},{importord:"stand-up-komikar/stand-up-komiker",avloeserord:"spontankomikar/spontankomiker, ståoppkomikar/ståoppkomiker"},{importord:"stashe (seg opp)",avloeserord:"stase (seg opp), pynte (seg)"},{importord:"storyboard",avloeserord:"dreiebok"},{importord:"stout",avloeserord:"stautøl"},{importord:"streaming",avloeserord:"strøyming/strømming (direkteavspeling/direkteavspilling av video og lyd over Internett) (IKT)"},{importord:"street credibility",avloeserord:"gatetruverd/gatetroverdighet"},{importord:"stretchlaken",avloeserord:"strekklaken"},{importord:"sub-woofer",avloeserord:"sub-bass(høgtalar)/sub-bass(høyttaler)"},{importord:"sudden death",avloeserord:"førstemålsspel/førstemålsspill"},{importord:"sunk cost",avloeserord:"tapt kostnad, irreversibel kostnad"},{importord:"supply-båt",avloeserord:"forsyningsbåt"},{importord:"support",avloeserord:"brukarstøtte/brukerstøtte (IKT); støtte (allment); jf. help desk"},{importord:"supporter",avloeserord:"tilhengjar/tilhenger, støttemedlem"},{importord:"supporterklubb",avloeserord:"støtteklubb, tilhengjarklubb/tilhengerklubb, jf. fanklubb"},{importord:"surround sound",avloeserord:"kringlyd"},{importord:"swimming pool",avloeserord:"symjebasseng/svømmebasseng"},{importord:"system(s) engineering",avloeserord:"systemutvikling"},{importord:"tab",avloeserord:"arkfane, fane, flik; etikett, merkelapp; tabb"},{importord:"tablet (PC)",avloeserord:"nettbrett"},{importord:"take-away-food",avloeserord:"hentemat, ta-med-mat"},{importord:"talkshow",avloeserord:"prateprogram"},{importord:"tap screen",avloeserord:"trykkskjerm"},{importord:"tape (s.)",avloeserord:"limband/limbånd, lydband/lydbånd, videoband/videobånd, teip"},{importord:"tape (v.)",avloeserord:"ta opp, teipe"},{importord:"target man",avloeserord:"oppspelspunkt/oppspillspunkt (idr.)"},{importord:"team",avloeserord:"(arbeids)lag, (samarbeids)gruppe"},{importord:"teambuilding",avloeserord:"lagutvikling, lagbygging"},{importord:"teamwork",avloeserord:"lagarbeid, samarbeid"},{importord:"teaser",avloeserord:"smakebit"},{importord:"telemarketing",avloeserord:"telefonsal/telefonsalg, marknadsføring/markedsføring (over telefon)"},{importord:"themes",avloeserord:"tema, drakt, ham (IKT), jf. skins"},{importord:"think-tank",avloeserord:"tenkjesmie/tenkesmie, tenkjetank/tenketank"},{importord:"throbber",avloeserord:"puls-ikon (ikon i nettlesarar som er animert under søk el. nedlasting)"},{importord:"thumbnail",avloeserord:"miniatyrbilete/miniatyrbilde, knøttbilete/knøttbilde (IKT)"},{importord:"time manager",avloeserord:"tidsplanleggjar/tidsplanlegger"},{importord:"time-outtime outtimeout",avloeserord:"det å gå i tenkjeboksen / det å gå i tenkeboksen, pause (ped.), tidsavbrot / tidsavbrudd (IKT)"},{importord:"timeshare",avloeserord:"tidspart, deltids(bruks)rett; parts-/andels- (t.d. -båt, -hytte)"},{importord:"timesharing",avloeserord:"tidsdeling, deltidsbruk; deltids(l)eige/deltids(l)eie"},{importord:"toastmaster",avloeserord:"visevert, kjøkemeister/kjøkemester"},{importord:"to-do-liste",avloeserord:"gjereliste/gjøreliste, gjeremålsliste/gjøremålsliste"},{importord:"tooltip",avloeserord:"verktøyhjelp (IKT)"},{importord:"touch screen",avloeserord:"trykkskjerm"},{importord:"touchpad",avloeserord:"styreplate, peikeplate/pekeplate (IKT)"},{importord:"trainee",avloeserord:"opplæringstilsett/opplæringsansatt, opplæringskandidat, aspirant, praktikant"},{importord:"trick or treat",avloeserord:"knask eller knep, godteri eller fanteri, snask eller snusk, grøss eller godteri"},{importord:"trigge",avloeserord:"setje i gang / sette i gang, utløyse/utløse"},{importord:"trigger",avloeserord:"utløysande faktor / utløsende faktor, inspirasjonskjelde/inspirasjonskilde"},{importord:"true crime",avloeserord:"krim frå røyndomen / krim fra virkeligheten, røyndomskrim/virkelighetskrim, krimdokumentar, dokukrim"},{importord:"turnover",avloeserord:"gjennomtrekk, utskifting, gjennomstrøyming/gjennomstrømming "},{importord:"tutorial",avloeserord:"rettleiing/veiledning"},{importord:"tweet",avloeserord:"(verb:) tvitre, kvitre"},{importord:"tweet",avloeserord:"(substantiv:) tvitring, tvitt, twittermelding, kvitter, kvitring"},{importord:"twitter",avloeserord:"se tweet"},{importord:"underscore",avloeserord:"understrek, understreking"},{importord:"understatement",avloeserord:"underdriving/underdrivelse"},{importord:"urbanist",avloeserord:"byplanleggjar/byplanlegger"},{importord:"video on demand",avloeserord:"video på førespurnad / video på forespørsel; videotorg, tingingsvideo/bestillingsvideo"},{importord:"voice actor",avloeserord:"stemmelegger"},{importord:"voice mail",avloeserord:"talepost"},{importord:"voice over",avloeserord:"fortellerstemme, kommentatorstemme"},{importord:"voice response",avloeserord:"talesvar, innvalssørvis/innvalgssørvis, talerespons"},{importord:"voucher",avloeserord:"studiebillett, studiesertifikat (utd.); (hotell)kupong"},{importord:"walkover",avloeserord:"autoopprykk; gratissiger/gratisseier"},{importord:"weasel",avloeserord:"beltebil"},{importord:"web designer",avloeserord:"vevutformar/vevutformer, nettskreddar/nettskredder, vevarkitekt, nettsidearkitekt"},{importord:"web hotel",avloeserord:"vevhotell"},{importord:"web pad",avloeserord:"nettbrett"},{importord:"webinar",avloeserord:"nettseminar"},{importord:"webmaster",avloeserord:"nettredaktør, nettadministrator, nettmeister/nettmester"},{importord:"webserver",avloeserord:"nettenar/nettjener, vevtenar/vevtjener"},{importord:"webside",avloeserord:"nettside"},{importord:"weekend",avloeserord:"helg, vekeslutt/ukeslutt"},{importord:"whiplash",avloeserord:"nakkesleng"},{importord:"whistleblower",avloeserord:"varslar/varsler"},{importord:"whiteboard",avloeserord:"tusjtavle"},{importord:"whiteboard-tusj",avloeserord:"tavletusj"},{importord:"wicked problem",avloeserord:"gjenstridig problem"},{importord:"widescreen",avloeserord:"breiskjerm/bredskjerm"},{importord:"windsurfing",avloeserord:"brettsegling/brettseiling"},{importord:"wizard",avloeserord:"vegvisar/veiviser, los (i dataprogram)"},{importord:"workflow",avloeserord:"arbeidsflyt, arbeidsgang"},{importord:"workshop",avloeserord:"arbeidsseminar, arbeidsmøte, verkstad/verksted (f.eks. idéverkstad/idéverksted)"},{importord:"workspace",avloeserord:"arbeidsområde, arbeidsflate (IKT)"},{importord:"World Wide Web",avloeserord:"Verdsveven/Verdensveven"},{importord:"worst case scenario",avloeserord:"i verste fall, verste fall-scenario, verste tilfelle-scenario"},{importord:"zero waste",avloeserord:"null avfall, nullavfall, null svinn, nullsvinn"}],qr=[{ord:"antivirus software, antivirus program",bokmaal:"antivirusprogramvare",nynorsk:"antivirusprogramvare",definisjon:"program på en datamaskin som forsøker å identifisere, motarbeide og fjerne datavirus og liknende skadevare"},{ord:"application",bokmaal:"applikasjon",nynorsk:"applikasjon",definisjon:"programvare som benytter datamaskinens ressurser til oppgaver som brukeren ønsker utført"},{ord:"CRT monitor, CRT display",bokmaal:"bilderørskjerm",nynorsk:"biletrøyrskjerm",definisjon:"skjerm med katodestrålerøyr"},{ord:"blogosphere",bokmaal:"bloggsfære",nynorsk:"bloggsfære",definisjon:"alle blogger på Internett og koblingene mellom disse"},{ord:"user interface",bokmaal:"brukergrensesnitt",nynorsk:"brukargrensesnitt",definisjon:"grenseflata eller kommunikasjonen mellom brukar og datamaskin (Kjelde: Norsk dataordbok)"},{ord:"embed",bokmaal:"bygge inn",nynorsk:"byggje inn",definisjon:"inkorporere et selvstendig element i et system / en struktur slik at det fremstår som en enhet"},{ord:"laptop, notebook",bokmaal:"bærbar datamaskin",nynorsk:"berbar datamaskin",definisjon:"datamaskin som er konstruert for mobil bruk, er liten og lett nok til å ha på fanget, har integrert skjerm og kan ha integrert fysisk eller virtuelt tastatur og pekeenhet"},{ord:"crowd computing",bokmaal:"datadugnad",nynorsk:"datadugnad",definisjon:"verktøy som gjør det mulig å utveksle ideer og ta beslutninger ved hjelp av og via data"},{ord:"computer monitor, computer screen",bokmaal:"dataskjerm",nynorsk:"dataskjerm",definisjon:"eining som syner den visuelle delen av brukargrensesnittet på ein datamaskin"},{ord:"digital ink",bokmaal:"digitalt blekk",nynorsk:"digitalt blekk",definisjon:"teknologi som digitalt avbilder håndskrift i dens naturlige form på en LCD-skjerm"},{ord:"digital paper",bokmaal:"digitalt papir",nynorsk:"digitalt papir",definisjon:"rastra blank side som vert vist på ein skjerm, og som vert nytta saman med ein digital penn til å lage handskrivne, digitale dokument"},{ord:"swipe",bokmaal:"dra",nynorsk:"dra",definisjon:"rørsle der ein beveger ein finger raskt over ein trykkskjerm"},{ord:"flick",bokmaal:"dra fort",nynorsk:"dra fort",definisjon:"rask rørsle med éin finger for å bla på ein trykkskjerm"},{ord:"e-book",bokmaal:"e-bok",nynorsk:"e-bok",definisjon:"digital tekst som skal tilsvare en tradisjonell, trykt boktekst"},{ord:"extranet",bokmaal:"ekstranett",nynorsk:"ekstranett",definisjon:"deler av et intranett som er delvis tilgjengelige for utenforstående med begrenset tilgang"},{ord:"electronic paper, e-paper",bokmaal:"elektronisk papir",nynorsk:"elektronisk papir",definisjon:"skjermteknologi som er utforma for å likne trykksverte på papir"},{ord:"hashtag",bokmaal:"emneknagg",nynorsk:"emneknagg",definisjon:"Blir gjerne brukt i sosiale medium for å utheve tema eller gjere det lettare å søkje"},{ord:"single-touch screen",bokmaal:"enkelttrykksskjerm",nynorsk:"enkelttrykksskjerm",definisjon:"trykkskjerm der ein kan nytte berre ein peikereiskap om gongen"},{ord:"firmware",bokmaal:"fastvare",nynorsk:"fastvare",definisjon:"programvare som er innebygd i ein datamaskin, og som styrer elektriske einingar internt"},{ord:"multi-touch screen",bokmaal:"flertrykksskjerm",nynorsk:"fleirtrykksskjerm",definisjon:"trykkskjerm der ein kan nytte fleire fingrar eller peikereiskapar på skjermen samtidig"},{ord:"crowdfunding",bokmaal:"folkefinansiering",nynorsk:"folkefinansiering",definisjon:"den samlede innsatsen til enkeltpersoner som danner et nettverk og bidrar med penger, vanligvis via Internett, for å støtte tiltak som er startet av andre personer eller organisasjoner"},{ord:"bloatware",bokmaal:"gjøkeprogram",nynorsk:"gaukeprogram",definisjon:"program som tek mykje minne på eininga det er installert på"},{ord:"freeware",bokmaal:"gratisprogramvare",nynorsk:"gratisprogramvare",definisjon:"programvare som kan benyttes uten vederlag, men der utvikleren beholder opphavsretten til programkoden, som ikke kan endres eller brukes i andre sammenhenger"},{ord:"home page",bokmaal:"hjemmeside",nynorsk:"heimeside",definisjon:"nettside som fungerer som forside for et nettsted"},{ord:"PDA (Personal Digital Assistent), hand-held computer, palm",bokmaal:"håndholdt datamaskin",nynorsk:"handhalden datamaskin",definisjon:"datamaskin som er liten nok til å holdes i hånden"},{ord:"Internet",bokmaal:"Internett",nynorsk:"Internett",definisjon:"verdensomspennende nettverk av elektroniske kommunikasjonsnett som er knyttet sammen av et felles sett av grunnleggende kommunikasjonsprotokoller (TCP, UDP, IP mfl.)"},{ord:"intranet",bokmaal:"intranett",nynorsk:"intranett",definisjon:"et internt datanettverk som bruker IP-teknologi til å dele informasjon, operasjonelle systemer eller datatjenester innenfor en organisasjon og til å hindre tilgang for eksterne"},{ord:"client",bokmaal:"klient",nynorsk:"klient",definisjon:"maskinvare eller programvare som bruker ei teneste på ein tenar"},{ord:"front end",bokmaal:"klientdel",nynorsk:"klientdel",definisjon:"delen av eit klient-/tenarprogram som køyrer på klienten"},{ord:"jailbreaking",bokmaal:"knekking",nynorsk:"knekking",definisjon:"prosedyre for mobiltelefoner o.l. som gir full tilgang til alle egenskaper ved operativsystemet, og som dermed fjerner begrensninger satt av produsenten"},{ord:"pinch",bokmaal:"knipe",nynorsk:"knipe",definisjon:"rørsle der ein plasserer to fingrar på ein trykkskjerm og drar dei mot kvarandre"},{ord:"Liquid crystal display",bokmaal:"LCD-skjerm",nynorsk:"LCD-skjerm",definisjon:"tynn skjerm som er samansett av eit panel med flytande krystallar som vert lyste opp av lysrøyr"},{ord:"LED display",bokmaal:"LED-skjerm",nynorsk:"LED-skjerm",definisjon:"tynn skjerm som er samansett av eit panel med flytande krystallar som vert lyste opp av lysdiodar"},{ord:"linked data",bokmaal:"lenkede data",nynorsk:"lenkja data",definisjon:"metode for å offentliggjøre, dele og knytte sammen data på vebben ved hjelp av unike URI-er"},{ord:"e-book reader, e-book device, e-reader",bokmaal:"lesebrett",nynorsk:"lesebrett",definisjon:"elektronisk eining som er utvikla primært for lesing av digitale tekster, inntil no helst bøker og tidsskrift"},{ord:"hardware",bokmaal:"maskinvare",nynorsk:"maskinvare",definisjon:"dei fysiske delane ein datamaskin eller anna teknologisk innretning består av"},{ord:"big data",bokmaal:"massedata",nynorsk:"massedata",definisjon:"data i så store mengder at tradisjonelle database- og behandlingsteknikker ikke makter å analysere dem på en formålstjenlig måte"},{ord:"netbook",bokmaal:"minibærbar datamaskin",nynorsk:"miniberbar datamaskin",definisjon:"liten berbar datamaskin som er utforma for trådlaus kommunikasjon og tilgang til Internett, og som nyttar mindre straum og har mindre prosesseringskraft enn ein vanleg berbar datamaskin"},{ord:"widget, gadget, plugin",bokmaal:"miniprogram",nynorsk:"miniprogram",definisjon:"flyttbar kode som kan installeres og kjøres på en eller flere programvareplattformer"},{ord:"crowdsourcing",bokmaal:"nettdugnad",nynorsk:"nettdugnad",definisjon:"prosess der man får nødvendige tjenester, ideer eller innhold ved å hente inn bidrag fra en stor gruppe mennesker, særlig fra nettsamfunn"},{ord:"mashup",bokmaal:"nettfletting",nynorsk:"nettfletting",definisjon:"vebbapplikasjon som sammenstiller data fra flere forskjellige kilder og presenterer disse på en felles side"},{ord:"web page",bokmaal:"nettside",nynorsk:"nettside",definisjon:"en enkelt ressurs som kan inneholde tekst, lyd, bilde, animasjon, film og annet, som har en unik adresse (URL), og som er tilgjengelig gjennom en nettleser"},{ord:"cloud computing",bokmaal:"nettsky",nynorsk:"nettsky",definisjon:"samlebetegnelse på datatjenester som ytes over Internett og som er satt opp for å kunne samvirke med andre datatjenester"},{ord:"web site",bokmaal:"nettsted",nynorsk:"nettstad",definisjon:"samling av relaterte nettsider, bilder, videoer eller andre digitale ressurser som oppfattes som en naturlig enhet"},{ord:"RSS feed, news feed",bokmaal:"nyhetsvarsling",nynorsk:"nyheitsvarsling",definisjon:"automatisk nettjeneste som overvåker forvalgte nettsider og registrerer nytt stoff som blir publisert der, og som varsler om det nye stoffet i en kortform som inneholder noen tekstrader og en tilhørende klikkbar lenke til fullversjonen av det aktuelle stoffet"},{ord:"OLED display",bokmaal:"OLED-skjerm",nynorsk:"OLED-skjerm",definisjon:"tynn skjerm som bruker organiske lysdiodar som teknologi"},{ord:"organic light emitting diode (oled)",bokmaal:"organisk lysdiode",nynorsk:"organisk lysdiode",definisjon:"lysdiode der lyskjelda er eit organisk materiale som under påverknad av elektrisk straum sender ut farga lys"},{ord:"pan",bokmaal:"panorere",nynorsk:"panorere",definisjon:"rørsle der ein drar éin finger frå side til side på ein trykkskjerm"},{ord:"plasma display, plasma screen",bokmaal:"plasmaskjerm",nynorsk:"plasmaskjerm",definisjon:"tynn skjerm der biletelementa er samansette av gassfylte celler belagde med raudt, grønt eller blått"},{ord:"native app",bokmaal:"plattformavhengig app",nynorsk:"plattformavhengig app",definisjon:"applikasjon som bare kan kjøres på den teknologiske plattformen den ble laget for"},{ord:"podcast",bokmaal:"poddkast, podkast",nynorsk:"poddkast, podkast",definisjon:"ei multimediefil som blir distribuert over Internett for avspeling på mobile einingar og datamaskiner"},{ord:"podcasting",bokmaal:"poddkasting, podkasting",nynorsk:"poddkasting, podkasting",definisjon:"distribusjon av podkaster"},{ord:"software",bokmaal:"programvare",nynorsk:"programvare",definisjon:"dei binære filene med instruksjonar som gjer det mogleg å bruke ein datamaskin eller annan elektronikk"},{ord:"software-as-a-service",bokmaal:"programvare som tjeneste",nynorsk:"programvare som teneste",definisjon:"programvare som er tilgjengeleg som ei nettbasert teneste"},{ord:"pull technology",bokmaal:"pullteknologi",nynorsk:"pullteknologi",definisjon:"teknologi for distribusjon av data og program der brukaren sjølv må ta initiativ til levering til eige datautstyr"},{ord:"push technology",bokmaal:"pushteknologi",nynorsk:"pushteknologi",definisjon:"teknologi for distribusjon av data og program der dei blir leverte automatisk til datautstyret til brukaren i sanntid eller med gitte tidsintervall"},{ord:"adware",bokmaal:"reklameprogramvare",nynorsk:"reklameprogramvare",definisjon:"programvare med innebygd reklame som gis til brukere"},{ord:"scroll",bokmaal:"rulle",nynorsk:"rulle",definisjon:"rørsle der ein beveger biletet på ein skjerm i ønskt retning med fingrar eller mus"},{ord:"malware",bokmaal:"skadevare",nynorsk:"skadevare",definisjon:"fellesbetegnelse på programvare som er laget for å ødelegge eller avbryte datasystemer, hente ut informasjon uten brukers samtykke eller få tilgang til private datasystemer"},{ord:"wearable technology, computer wearables, wearable computing",bokmaal:"smartklær",nynorsk:"smartklede",definisjon:"datautstyr i form av klesplagg som en bruker kan ha på seg"},{ord:"interactive whiteboard",bokmaal:"smarttavle",nynorsk:"smarttavle",definisjon:"tavle som kan koplast til ein datamaskin, og som fungerer som ein stor trykkskjerm"},{ord:"wearable technology, computer wearables, wearable computing",bokmaal:"smarttilbehør",nynorsk:"smarttilbehøyr",definisjon:"datautstyr som en bruker kan ha på seg, i form av tilbehør som for eksempel klokker, briller og armbånd"},{ord:"social medium",bokmaal:"sosialt medium",nynorsk:"sosialt medium",definisjon:"system på vebben som tillater kommunikasjon eller samhandling mellom to eller flere personer"},{ord:"spyware",bokmaal:"spionprogramvare",nynorsk:"spionprogramvare",definisjon:"skadevare som installeres (ofte skjult) på en datamaskin for å overvåke brukerens anvendelse av datamaskinen, uten at det foreligger informert samtykke til dette fra brukerens side"},{ord:"spread",bokmaal:"spre",nynorsk:"spreie",definisjon:"rørsle der ein plasserer to fingrar på ein trykkskjerm og drar dei frå kvarandre"},{ord:"solid state drive (SSD)",bokmaal:"SSD-disk",nynorsk:"SSD-disk",definisjon:"datalagringsenhet som bruker integrerte kretskort som minne til varig lagring av data"},{ord:"start page",bokmaal:"startside",nynorsk:"startside",definisjon:"nettsiden som vises straks en nettleser åpnes"},{ord:"streaming",bokmaal:"strømming",nynorsk:"strøyming",definisjon:"overføring av lyd eller video over Internett hvor avspillingen foregår samtidig med nedlastingen uten at mottakeren trenger å vente til hele datamengden er overført"},{ord:"pullprint",bokmaal:"styrt utskrift",nynorsk:"styrt utskrift",definisjon:"skrivarfunksjon der utskriftsjobben til ein brukar blir værande på skrivaren til brukaren frigir den med kode, kort e.l."},{ord:"tap",bokmaal:"tappe",nynorsk:"tappe",definisjon:"rørsle der éin finger blir pressa lett mot ein trykkskjerm og så blir sloppe raskt opp"},{ord:"tablet-PC",bokmaal:"tavle-pc",nynorsk:"tavle-pc",definisjon:"bærbar datamaskin som betjenes med trykkskjerm eller stylus"},{ord:"server",bokmaal:"tjener",nynorsk:"tenar",definisjon:"funksjonsenhet som sørger for tjenester til arbeidsstasjoner i et datanett"},{ord:"back end",bokmaal:"tjenerdel",nynorsk:"tenardel",definisjon:"delen av eit klient-/tenarprogram som køyrer på tenaren"},{ord:"touch screen",bokmaal:"trykkskjerm",nynorsk:"trykkskjerm",definisjon:"skjerm som reagerer på berøring, og som fungerer som både styreeining og visningseining"},{ord:"tweet (verb)",bokmaal:"tvitre",nynorsk:"tvitre",definisjon:"sende ei twittermelding"},{ord:"tweet (substantiv)",bokmaal:"twittermelding",nynorsk:"twittermelding",definisjon:"melding skriven på nettenesta Twitter"},{ord:"subnotebook",bokmaal:"ultrabærbar datamaskin",nynorsk:"ultraberbar datamaskin",definisjon:"svært liten bærbar datamaskin med få porter eller avtakbar diskstasjon"},{ord:"host (substantiv)",bokmaal:"vert",nynorsk:"vert",definisjon:"datamaskin som er koblet til et nettverk, og som gir et tilgangspunkt til nettverket"},{ord:"viral",bokmaal:"viral",nynorsk:"viral",definisjon:"som er veldig populær og som spreier seg raskt, særleg på Internett"},{ord:"World Wide Web",bokmaal:"weben, vebben",nynorsk:"weben, vebben",definisjon:"verdensomspennende informasjonsnett bygget på Internett som består av nettsider som bruker versjoner av html for å uttrykke og lenke sammen informasjon"},{ord:"web host",bokmaal:"webhotell, vebbhotell",nynorsk:"webhotell, vebbhotell",definisjon:"tjeneste hvor tjenestetilbyderen lagrer data (og ev. programvare) på kundens vegne og gjør dette tilgjengelig på Internett"},{ord:"open access",bokmaal:"åpen tilgang",nynorsk:"open tilgang",definisjon:"ubegrenset nettilgang til artikler som er publisert i vitenskapelige tidsskrifte"}],$e=T=>T===""?[]:Yr.filter(C=>T.toLowerCase().match("\\b"+C.kanselliord.toLowerCase()+"\\b"));function Zr({value:T}){const C=$e(T);return C.length===0?null:r$1.jsxs(Accordion$1.Item,{children:[r$1.jsx(Accordion$1.Header,{children:C.length==1?r$1.jsx(r$1.Fragment,{children:"1 ord som kan byttes ut"}):r$1.jsxs(r$1.Fragment,{children:[C.length," ord som kan byttes ut"]})}),r$1.jsxs(Accordion$1.Content,{children:[r$1.jsx(BodyShort,{spacing:!0,children:"Ord og uttrykk som er utdaterte eller sier noe på en vanskeligere måte enn nødvendig."}),r$1.jsx(BodyShort,{spacing:!0,children:C.length>=1&&C.map($=>r$1.jsxs(ReadMore$1,{header:$.kanselliord,children:["Forslag til alternativer: ",$.alternativ_1]},$.kanselliord))}),r$1.jsxs(BodyShort,{children:["Kilde: ",r$1.jsxs(Link$1,{target:"_blank",href:"https://www.sprakradet.no/klarsprak/om-skriving/kansellisten/",children:["Språkrådets kanselliste",r$1.jsx(W,{})]})]})]})]})}const Ye=T=>T===""?[]:$r.filter(C=>T.toLowerCase().match("\\b"+C.ord.toLowerCase()+"\\b"));function Gr({value:T}){const C=Ye(T);if(C.length===0)return null;const $=Array.from(C.reduce((V,K)=>V.set(K.kilde,K),new Map).values());return r$1.jsxs(Accordion$1.Item,{children:[r$1.jsx(Accordion$1.Header,{children:C.length==1?r$1.jsx(r$1.Fragment,{children:"1 mulig støtende ord"}):r$1.jsxs(r$1.Fragment,{children:[C.length," mulige støtende ord"]})}),r$1.jsxs(Accordion$1.Content,{children:[r$1.jsx(BodyShort,{spacing:!0,children:"Ord i teksten som kan være støtende, eller som bør brukes med varsomhet."}),r$1.jsx(BodyShort,{spacing:!0,children:C.map(V=>r$1.jsx(ReadMore$1,{header:V.ord,children:V.bokmaal},V.id))}),$.map(V=>r$1.jsxs(BodyShort,{children:["Kilde:"," ",r$1.jsxs(Link$1,{target:"_blank",href:V.lenke,children:[V.kilde,r$1.jsx(W,{})]})]},V.kilde))]})]})}const Ue=T=>{if(T==="")return{avloeserordMatches:[],datatermerMatches:[]};const C=Ur.filter(V=>T.toLowerCase().match("\\b"+V.importord.toLowerCase()+"\\b")),$=qr.filter(V=>T.toLowerCase().match("\\b"+V.ord.toLowerCase()+"\\b"));return{avloeserordMatches:C,datatermerMatches:$}};function Jr({value:T}){const{avloeserordMatches:C,datatermerMatches:$}=Ue(T);return C.length===0&&$.length===0?null:r$1.jsx(r$1.Fragment,{children:r$1.jsxs(Accordion$1.Item,{children:[r$1.jsx(Accordion$1.Header,{children:C.length+$.length==1?r$1.jsx(r$1.Fragment,{children:"1 mulig avløserord"}):r$1.jsx(r$1.Fragment,{children:`${C.length+$.length} mulige avløserord`})}),r$1.jsxs(Accordion$1.Content,{children:[r$1.jsx(BodyShort,{spacing:!0,children:"Norske ord som kan brukes i stedet for de tilsvarende engelske:"}),r$1.jsxs(BodyShort,{spacing:!0,children:[C.length>0&&C.map(V=>r$1.jsxs(ReadMore$1,{header:`"${V.importord}"`,children:["Forslag til alternativer: ",V.avloeserord]},`ordliste-${V.importord}`)),$.length>0&&$.map(V=>r$1.jsxs(ReadMore$1,{header:`"${V.ord}"`,children:["Forslag til alternativer: ",V.bokmaal,r$1.jsx("p",{children:V.definisjon})]},`dataterm-${V.ord}`))]}),r$1.jsxs("div",{children:[C.length>0&&r$1.jsxs(BodyShort,{children:["Kilde:"," ",r$1.jsxs(Link$1,{target:"_blank",href:"https://www.sprakradet.no/sprakhjelp/Skriverad/Avloeysarord/",children:["På godt norsk – avløserord",r$1.jsx(W,{})]})]}),$.length>0&&r$1.jsxs(BodyShort,{children:["Kilde:"," ",r$1.jsxs(Link$1,{target:"_blank",href:"https://www.sprakradet.no/sprakhjelp/Skriverad/Ordlister/Datatermar/",children:["Språkrådets datatermer ",r$1.jsx(W,{})]})]})]})]})]})})}const qe=T=>{var C;return((C=T.replaceAll("Kontakt","").replaceAll(/\d+(?: \d+)/g,"").toLowerCase().match(/\b( men)\b/g))==null?void 0:C.length)??0};function Xr({value:T}){const C=qe(T);return r$1.jsx(r$1.Fragment,{children:C!=0&&r$1.jsxs(Accordion$1.Item,{children:[r$1.jsx(Accordion$1.Header,{children:C==1?r$1.jsx(r$1.Fragment,{children:"1 tilfelle av manglende komma"}):r$1.jsxs(r$1.Fragment,{children:[C," tilfeller av manglende komma"]})}),r$1.jsxs(Accordion$1.Content,{className:"",children:[r$1.jsx(Heading,{spacing:!0,level:"3",size:"xsmall",children:'Alltid komma foran "men"'}),"Det er ",C==1?r$1.jsx(r$1.Fragment,{children:"ett tilfelle"}):r$1.jsxs(r$1.Fragment,{children:[C," tilfeller"]}),' i teksten der det mangler komma foran "men".']})]})})}const Ze=T=>{const C=T.replaceAll("Kopier lenke",""),$=Y=>Y.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gi)??[],V=Y=>Y.match(/(\s*[0-9]+){8,11}/gi)??[],K=Y=>{var J;return((J=Y.match(/([A-Z][a-z][a-z]*(?: [A-Z][a-z][a-z]*){1,2})/g))==null?void 0:J.filter((re,ne)=>Y.indexOf(re)===ne))??[]};return{emails:$(C),phonenumbers:V(C),names:K(C)}};function Qr({value:T}){const{emails:C,names:$,phonenumbers:V}=Ze(T);return C.length===0&&$.length===0&&V.length===0?null:r$1.jsxs(Accordion$1.Item,{children:[r$1.jsxs(Accordion$1.Header,{children:[C.length+V.length+$.length," ",C.length+V.length+$.length===1?r$1.jsx(r$1.Fragment,{children:" mulig personopplysning"}):r$1.jsx(r$1.Fragment,{children:"mulige personopplysninger"})]}),r$1.jsxs(Accordion$1.Content,{children:[C.length>=1&&r$1.jsxs(BodyShort,{spacing:!0,children:[r$1.jsx(Heading,{spacing:!0,level:"3",size:"xsmall",children:"E-postadresser"}),r$1.jsx(O$1,{children:C.map((K,Y)=>r$1.jsxs(O$1.Item,{children:['"',K,'"']},Y))})]}),V.length>=1&&r$1.jsxs(BodyShort,{spacing:!0,children:[r$1.jsx(Heading,{spacing:!0,level:"3",size:"xsmall",children:"Telefonnummer"}),r$1.jsx(O$1,{children:V.map((K,Y)=>r$1.jsxs(O$1.Item,{children:['"',K,'"']},Y))})]}),$.length>=1&&r$1.jsxs(BodyShort,{children:[r$1.jsx(Heading,{spacing:!0,level:"3",size:"xsmall",children:"Navn"}),r$1.jsx(O$1,{children:$.map((K,Y)=>r$1.jsxs(O$1.Item,{children:['"',K,'"']},Y))})]})]})]})}const Ge=T=>{const C="!;.*?",$=T.split(/\s+/),V=T.split("").reduce((Y,J)=>C.includes(J)?Y+1:Y,0),K=$.reduce((Y,J)=>J.length>=7?Y+1:Y,0);return V===0?void 0:Math.round($.length/V+K*100/$.length)},et=T=>T<=33?"Enkel å lese":T>33&&T<44?"Middels å lese":"Vanskelig å lese";function rt({value:T}){const C=Ge(T);if(!C)return r$1.jsxs(Accordion$1.Item,{children:[r$1.jsx(Accordion$1.Header,{children:"Liks: For lite tekst"}),r$1.jsx(Accordion$1.Content,{children:"Sett inn minst én setning for å få opp resultater."})]});const $=et(C);return r$1.jsxs(Accordion$1.Item,{children:[r$1.jsxs(Accordion$1.Header,{children:["Liks: ",C,". ",$]}),r$1.jsxs(Accordion$1.Content,{children:[r$1.jsxs(BodyShort,{style:{textTransform:"initial"},children:["Liks: ",C,". Teksten er ",r$1.jsx("span",{style:{textTransform:"lowercase"},children:$})," ifølge"," ",r$1.jsxs(Link$1,{target:"_blank",href:"https://no.wikipedia.org/wiki/Lesbarhetsindeks",children:["lesbarhetsindeksen",r$1.jsx(He,{})]}),"."]}),r$1.jsxs("div",{children:[r$1.jsx(Heading,{spacing:!0,level:"3",size:"xsmall",children:"Skriveråd"}),r$1.jsxs("ul",{children:[r$1.jsx("li",{children:"Skriv korte og enkle setninger"}),r$1.jsx("li",{children:"Velg korte og enkle ord"}),r$1.jsx("li",{children:"Skriv det viktigste først"})]})]})]})]})}const Je=T=>{var C;const $=T.split(/\s+/).length,V=T.split(`
+
+`).reduce((ne,te)=>te.replace(/\s+/gi,"").length>1?ne+1:ne,0),K="!.?",Y=T.split("").reduce((ne,te)=>K.includes(te)?ne+1:ne,0),J=T.length,re=J-(((C=T.match(/\s/g))==null?void 0:C.length)??0);return{totalWords:$,totalSentences:Y,totalParagraphs:V,totalCharacters:J,totalCharactersWithoutSpaces:re}};function tt({value:T}){const{totalWords:C,totalParagraphs:$,totalSentences:V,totalCharacters:K,totalCharactersWithoutSpaces:Y}=Je(T);return r$1.jsxs(Accordion$1.Item,{children:[r$1.jsxs(Accordion$1.Header,{children:["Ordtelling: ",C," ord"]}),r$1.jsx(Accordion$1.Content,{children:r$1.jsxs("ul",{children:[r$1.jsxs("li",{children:["Ord: ",C]}),r$1.jsxs("li",{children:["Setninger: ",V]}),r$1.jsxs("li",{children:["Avsnitt: ",$]}),r$1.jsxs("li",{children:["Tegn: ",K," ",K!=Y&&r$1.jsxs(r$1.Fragment,{children:["(",Y," uten mellomrom)"]})]})]})})]})}const Xe=T=>T.replaceAll(/\<\/(.?)\>/g,"").replaceAll(/\<(.?)\>/g,"").replaceAll(/\s+/g," ").replace(/[^\w\sÆØÅæøå\/\\é-]/g,"").toLowerCase().split(/\s+/).map(C=>C.replace(/[.,:?()!"]+/g,"")).reduce((C,$)=>$===""?C:{...C,[$]:(C[$]??0)+1},{});function ot(T){const C=Xe(T.value);if(Object.keys(C).length===0)return null;const[$,V]=reactExports.useState(1),K=10,Y=$*10,J=Y-10,re=Object.entries(C).sort((te,se)=>se[1]-te[1]).slice(J,Y),ne=Math.ceil(Object.keys(C).length/K);return r$1.jsxs(Accordion$1.Item,{children:[r$1.jsx(Accordion$1.Header,{children:"Frekvensordliste"}),r$1.jsxs(Accordion$1.Content,{children:[r$1.jsx("div",{children:r$1.jsxs(w$1,{zebraStripes:!0,size:"small",children:[r$1.jsx(w$1.Header,{children:r$1.jsxs(w$1.Row,{children:[r$1.jsx(w$1.HeaderCell,{scope:"col",children:"Ord"}),r$1.jsx(w$1.HeaderCell,{scope:"col",children:"Frekvens"})]})}),r$1.jsx(w$1.Body,{children:re.map(te=>r$1.jsxs(w$1.Row,{children:[r$1.jsx(w$1.HeaderCell,{scope:"row",children:te[0]}),r$1.jsx(w$1.DataCell,{children:te[1]})]},te[0]))})]})}),ne>1&&r$1.jsx("div",{children:r$1.jsx(ee,{page:$,onPageChange:V,count:ne,size:"small",siblingCount:0,boundaryCount:1})})]})]})}function nt({value:T}){return r$1.jsxs(Accordion$1.Item,{children:[r$1.jsx(Accordion$1.Header,{children:"Liks og ordtelling"}),r$1.jsx(Accordion$1.Content,{children:r$1.jsxs(Accordion$1,{children:[r$1.jsx(rt,{value:T}),r$1.jsx(tt,{value:T}),r$1.jsx(ot,{value:T})]})})]})}const it=({value:T,open:C,options:$={}})=>{const{longParagraphs:V=!0,longSentences:K=!0,longWords:Y=!0,duplicateWords:J=!0,kansellistenDictionary:re=!0,nrkDictionary:ne=!0,avloeserordDictionary:te=!0,commaCheck:se=!0,personalData:ie=!0,tools:ae=!0}=$;return!T||!C?null:r$1.jsxs(Accordion$1,{children:[V&&r$1.jsx(Wr,{value:T}),K&&r$1.jsx(Hr,{value:T}),Y&&r$1.jsx(Vr,{value:T}),J&&r$1.jsx(zr,{value:T}),re&&r$1.jsx(Zr,{value:T}),ne&&r$1.jsx(Gr,{value:T}),te&&r$1.jsx(Jr,{value:T}),se&&r$1.jsx(Xr,{value:T}),ie&&r$1.jsx(Qr,{value:T}),ae&&r$1.jsx(nt,{value:T})]})},lt=T=>({longParagraphs:Be(T),longSentences:We(T),longWords:Ve(T),duplicateWords:ze(T),kansellisten:$e(T),nrkOrd:Ye(T),avloeserord:Ue(T),comma:qe(T),personalData:Ze(T),tools:{lix:Ge(T),wordCount:Je(T),wordFrequency:Xe(T)}}),useReferatStartTekst=()=>{const T=useSelector(selectVeilederNavn);return T?`
+Hilsen ${T}`:""},schema$a=z$1.object({tittel:z$1.string().min(1,"Du må fylle ut tema for samtalen").max(100,"Du må korte ned teksten til 100 tegn"),fraDato:z$1.date({required_error:"Fra dato må fylles ut",invalid_type_error:"Ikke en gyldig dato"}),kanal:z$1.nativeEnum(Kanal),referat:z$1.string().min(1,"Du må fylle ut samtalereferat").max(5e3,"Du må korte ned teksten til 5000 tegn")}),InnerSamtalereferatForm=T=>{const{onSubmit:C,dirtyRef:$,aktivitet:V}=T,[K,Y]=reactExports.useState(!0),J=useReferatStartTekst(),re=!V,ne={tittel:(V==null?void 0:V.tittel)||"",fraDato:dateOrUndefined(V==null?void 0:V.fraDato),kanal:(V==null?void 0:V.kanal)||Kanal.TELEFON,referat:(V==null?void 0:V.referat)||J},te=useForm({defaultValues:ne,resolver:t(schema$a),shouldFocusError:!1}),{register:se,handleSubmit:ie,watch:ae,formState:{errors:oe,isSubmitting:le,isDirty:ce}}=te;$&&($.current=ce);const de=ae("referat"),he=me=>ie(ge=>C({...ge,status:AktivitetStatus.GJENNOMFOERT,avtalt:!1,erReferatPublisert:me}).then(()=>{const ye=lt(ge.referat);logReferatFullfort(ye,me,K)}));return jsxRuntimeExports.jsx("form",{autoComplete:"off",noValidate:!0,children:jsxRuntimeExports.jsxs(FormProvider,{...te,children:[jsxRuntimeExports.jsxs("div",{className:"space-y-8",children:[jsxRuntimeExports.jsx(AktivitetFormHeader,{aktivitetstype:VeilarbAktivitetType.SAMTALEREFERAT_TYPE}),jsxRuntimeExports.jsx(TextField$1,{label:"Tema for samtalen (obligatorisk)",id:"tittel",...se("tittel"),error:oe.tittel&&oe.tittel.message}),jsxRuntimeExports.jsx(ControlledDatePicker,{field:{name:"fraDato",required:!0,defaultValue:dateOrUndefined(V==null?void 0:V.fraDato)}}),jsxRuntimeExports.jsxs(Select$1,{label:"Møteform (obligatorisk)",...se("kanal"),children:[jsxRuntimeExports.jsx("option",{value:Kanal.OPPMOTE,children:"Oppmøte"}),jsxRuntimeExports.jsx("option",{value:Kanal.TELEFON,children:"Telefonmøte"}),jsxRuntimeExports.jsx("option",{value:Kanal.INTERNET,children:"Videomøte"})]}),re&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Textarea$1,{label:"Samtalereferat (obligatorisk)",maxLength:5e3,...se("referat"),error:oe.referat&&oe.referat.message,value:de}),jsxRuntimeExports.jsx(Switch$1,{checked:K,onChange:()=>{Y(!K),logToggleSpraksjekkToggle(!K)},children:"Klarspråkhjelpen"}),jsxRuntimeExports.jsx(it,{value:de,open:K,options:{tools:!1,longWords:!1}})]}),jsxRuntimeExports.jsx(CustomErrorSummary,{errors:oe})]}),jsxRuntimeExports.jsx(Lagreknapper,{isLoading:le,isNy:re,lagreOgDel:he})]})})},Lagreknapper=T=>{const{isLoading:C,isNy:$,lagreOgDel:V}=T;return $?jsxRuntimeExports.jsxs("div",{className:"mt-4",children:[jsxRuntimeExports.jsx(Button$1,{loading:C,className:"mr-4",onClick:V(!0),children:"Del med bruker"}),jsxRuntimeExports.jsx(Button$1,{variant:"secondary",loading:C,onClick:V(!1),children:"Lagre utkast"})]}):jsxRuntimeExports.jsx(Button$1,{className:"mt-4",loading:C,onClick:V(!1),children:"Lagre"})},SamtalereferatForm=T=>{const C=useSelector(selectVeilederStatus),[$,V]=reactExports.useState(!1);return reactExports.useEffect(()=>{const K=setTimeout(()=>{C===Status.PENDING&&V(!0)},400);return clearTimeout(K)},[]),C===Status.PENDING&&!$?null:jsxRuntimeExports.jsx(InnerSamtalereferatForm,{...T})},numberErrorMessage={required_error:"Antall stillinger må fylles ut",invalid_type_error:"Antall stillinger må fylles ut"},commonFields={tittel:z$1.string(),fraDato:z$1.date({required_error:"Fra dato må fylles ut"}),tilDato:z$1.date({required_error:"Til dato må fylles ut"}),avtaleOppfolging:z$1.string().max(255,"Du må korte ned teksten til 255 tegn").optional(),beskrivelse:z$1.string().max(5e3,"Du må korte ned teksten til 5000 tegn").optional()},GammelSokeAvtaleFormValues=z$1.object({...commonFields,skjemaVersjon:z$1.literal("gammel"),antallStillingerSokes:z$1.number(numberErrorMessage).lt(100,"Antall søknader må ikke være høyere enn 99")}),NySokeAvtaleFormValues=z$1.object({...commonFields,skjemaVersjon:z$1.literal("ny"),antallStillingerIUken:z$1.number(numberErrorMessage).lt(100,"Antall søknader må ikke være høyere enn 99")}),SokeAvtaleFormValues=z$1.discriminatedUnion("skjemaVersjon",[GammelSokeAvtaleFormValues,NySokeAvtaleFormValues]),getDefaultValues=T=>{const C=T?!!T.antallStillingerIUken:!0,$={tittel:(T==null?void 0:T.tittel)||"Avtale om å søke jobber",fraDato:T!=null&&T.fraDato?new Date(T.fraDato):void 0,tilDato:T!=null&&T.tilDato?new Date(T.tilDato):void 0,avtaleOppfolging:(T==null?void 0:T.avtaleOppfolging)||"",beskrivelse:(T==null?void 0:T.beskrivelse)||""};return C?{skjemaVersjon:"ny",...$,antallStillingerIUken:(T==null?void 0:T.antallStillingerIUken)??void 0}:{skjemaVersjon:"gammel",...$,antallStillingerSokes:(T==null?void 0:T.antallStillingerSokes)??void 0}},SokeAvtaleAktivitetForm=T=>{const{aktivitet:C,dirtyRef:$,onSubmit:V}=T,K=useErVeileder(),Y=C?!!C.antallStillingerIUken:!0,J=getDefaultValues(C),re=(C==null?void 0:C.avtalt)||!1,[ne,te]=reactExports.useState({from:J.fraDato,to:J==null?void 0:J.tilDato}),se=useForm({defaultValues:J,resolver:t(SokeAvtaleFormValues),shouldFocusError:!1}),{register:ie,handleSubmit:ae,watch:oe,setValue:le,reset:ce,formState:{errors:de,isDirty:he,isSubmitting:me}}=se;$&&($.current=he);const ge=Y?{errors:de,skjemaVersjon:"ny"}:{errors:de,skjemaVersjon:"gammel"},ye=oe("beskrivelse"),fe=oe("avtaleOppfolging"),Te=Pe=>{Pe?(Object.entries(Pe).forEach(([De,xe])=>{["fraDato","tilDato"].includes(De)?le(De,new Date(xe)):le(De,xe)}),te({from:new Date(Pe.fraDato),to:new Date(Pe.tilDato)})):(te(void 0),ce())};return jsxRuntimeExports.jsx("form",{autoComplete:"off",noValidate:!0,onSubmit:ae(Pe=>V(Pe)),children:jsxRuntimeExports.jsx(FormProvider,{...se,children:jsxRuntimeExports.jsxs("div",{className:"space-y-8",children:[jsxRuntimeExports.jsx(AktivitetFormHeader,{aktivitetstype:VeilarbAktivitetType.SOKEAVTALE_AKTIVITET_TYPE}),jsxRuntimeExports.jsx(Malverk$1,{visible:K,endre:!!C,onChange:Te,type:"SOKEAVTALE"}),jsxRuntimeExports.jsx("div",{className:"dato-container",children:jsxRuntimeExports.jsx(MaybeAvtaltDateRangePicker,{aktivitet:C,from:{name:"fraDato",required:!0,defaultValue:ne==null?void 0:ne.from},to:{name:"tilDato",required:!0,defaultValue:ne==null?void 0:ne.to}})}),ge.skjemaVersjon==="ny"?jsxRuntimeExports.jsx(TextField$1,{disabled:re,type:"number",label:"Antall søknader i uken (obligatorisk)",id:"antallStillingerIUken",...ie("antallStillingerIUken",{valueAsNumber:!0}),error:ge.errors.antallStillingerIUken&&ge.errors.antallStillingerIUken.message}):jsxRuntimeExports.jsx(TextField$1,{disabled:re,type:"number",label:"Antall søknader i perioden (obligatorisk)",id:"antallStillingerSokes",...ie("antallStillingerSokes",{valueAsNumber:!0}),error:ge.errors.antallStillingerSokes&&ge.errors.antallStillingerSokes.message}),jsxRuntimeExports.jsx(Textarea$1,{disabled:re,label:"Oppfølging fra NAV (valgfri)",maxLength:255,...ie("avtaleOppfolging"),error:ge.errors.avtaleOppfolging&&ge.errors.avtaleOppfolging.message,value:fe}),jsxRuntimeExports.jsx(Textarea$1,{disabled:re,label:"Beskrivelse (valgfri)",maxLength:5e3,...ie("beskrivelse"),error:ge.errors.beskrivelse&&ge.errors.beskrivelse.message,value:ye}),jsxRuntimeExports.jsx(CustomErrorSummary,{errors:ge.errors}),jsxRuntimeExports.jsx(LagreAktivitetKnapp,{loading:me})]})})})},schema$9=z$1.object({tittel:z$1.string().min(1,"Du må fylle ut stillingstittel").max(100,"Du må korte ned teksten til 100 tegn"),fraDato:z$1.date({required_error:"Fra dato må fylles ut",invalid_type_error:"Ikke en gyldig dato"}),tilDato:z$1.date({invalid_type_error:"Ikke en gyldig dato"}).optional().nullable(),arbeidsgiver:z$1.string().max(255,"Du må korte ned teksten til 255 tegn").optional(),kontaktperson:z$1.string().max(255,"Du må korte ned teksten til 255 tegn").optional(),arbeidssted:z$1.string().max(255,"Du må korte ned teksten til 255 tegn").optional(),beskrivelse:z$1.string().max(5e3,"Du må korte ned teksten til 5000 tegn").optional(),lenke:z$1.string().max(2e3,"Du må korte ned lenken til 2000 tegn").optional()}),StillingAktivitetForm=T=>{const{onSubmit:C,dirtyRef:$,aktivitet:V}=T,K={tittel:(V==null?void 0:V.tittel)||"",fraDato:dateOrUndefined(V==null?void 0:V.fraDato)??startOfDay(new Date),tilDato:dateOrUndefined(V==null?void 0:V.tilDato),beskrivelse:(V==null?void 0:V.beskrivelse)||"",arbeidssted:(V==null?void 0:V.arbeidssted)||"",arbeidsgiver:(V==null?void 0:V.arbeidsgiver)||"",kontaktperson:(V==null?void 0:V.kontaktperson)||"",lenke:(V==null?void 0:V.lenke)||""},Y=(V==null?void 0:V.avtalt)||!1,J=useForm({defaultValues:K,resolver:t(schema$9),shouldFocusError:!1}),{register:re,handleSubmit:ne,watch:te,formState:{errors:se,isDirty:ie,isSubmitting:ae}}=J;$&&($.current=ie);const oe=te("beskrivelse");return jsxRuntimeExports.jsx("form",{autoComplete:"off",noValidate:!0,onSubmit:ne(le=>C(le)),children:jsxRuntimeExports.jsx(FormProvider,{...J,children:jsxRuntimeExports.jsxs("div",{className:"space-y-8",children:[jsxRuntimeExports.jsx(AktivitetFormHeader,{aktivitetstype:VeilarbAktivitetType.STILLING_AKTIVITET_TYPE}),jsxRuntimeExports.jsx(TextField$1,{disabled:Y,label:"Stillingstittel (obligatorisk)",id:"tittel",...re("tittel"),error:se.tittel&&se.tittel.message}),jsxRuntimeExports.jsx(MaybeAvtaltDateRangePicker,{aktivitet:V,from:{name:"fraDato",required:!0,defaultValue:K.fraDato},to:{name:"tilDato",required:!0,label:"Frist (valgfri)"}}),jsxRuntimeExports.jsx(TextField$1,{disabled:Y,label:"Arbeidsgiver (valgfri)",id:"arbeidsgiver",...re("arbeidsgiver"),error:se.arbeidsgiver&&se.arbeidsgiver.message}),jsxRuntimeExports.jsx(TextField$1,{disabled:Y,label:"Kontaktperson hos arbeidsgiver (valgfri)",id:"kontaktperson",...re("kontaktperson"),error:se.kontaktperson&&se.kontaktperson.message}),jsxRuntimeExports.jsx(TextField$1,{disabled:Y,label:"Arbeidssted (valgfri)",id:"arbeidssted",...re("arbeidssted"),error:se.arbeidssted&&se.arbeidssted.message}),jsxRuntimeExports.jsx(Textarea$1,{disabled:Y,label:"Kort beskrivelse av stillingen (valgfri)",maxLength:5e3,...re("beskrivelse"),error:se.beskrivelse&&se.beskrivelse.message,value:oe}),jsxRuntimeExports.jsx(TextField$1,{disabled:Y,label:"Lenke til stillingsannonse (valgfri)",id:"lenke",...re("lenke"),error:se.lenke&&se.lenke.message}),jsxRuntimeExports.jsx(CustomErrorSummary,{errors:se}),jsxRuntimeExports.jsx(LagreAktivitetKnapp,{loading:ae})]})})})},aktivitetHeadings={mote:"Møte med NAV",samtalereferat:"Samtalereferat",stilling:"En jobb jeg vil søke på",sokeavtale:"Avtale om å søke jobber",behandling:"Medisinsk behandling",egen:"Jobbrettet egenaktivitet",ijobb:"Jobb jeg har nå"},NyAktivitetForm=()=>{var oe;const T=useNavigate(),C=useMatch("/aktivitet/ny/:aktivitetType"),$=useAppDispatch(),{aktivitetRoute:V,hovedsideRoute:K,nyAktivitetRoute:Y}=useRoutes(),J=()=>T(K()),re=useSelector(selectLagNyAktivitetFeil),ne=useSelector(selectErUnderOppfolging),te=reactExports.useRef(!1);useConfirmOnBeforeUnload(te);const se=le=>ce=>{const de=removeEmptyKeysFromObject(ce),he={status:AktivitetStatus.PLANLAGT,type:le,...de};return $(lagNyAktivitet(he)).then(me=>{isFulfilled(me)&&T(V(me.payload.id))})};function ie(){const le=te.current;if(!le||window.confirm(CONFIRM)){const ce=C.params.aktivitetType;return T(K()),logModalLukket({isDirty:le,aktivitet:ce,modalType:"ny-aktivitet",navType:"onReqClose"}),!0}return!1}const ae=le=>{le.preventDefault();const ce=te.current;if(!ce||window.confirm(CONFIRM)){const de=C.params.aktivitetType;T(Y()),logModalLukket({isDirty:ce,aktivitet:de,modalType:"ny-aktivitet",navType:"onReqBack"})}};return ne?jsxRuntimeExports.jsxs(Modal,{heading:(oe=C==null?void 0:C.params)!=null&&oe.aktivitetType?aktivitetHeadings[C.params.aktivitetType]:"",tilbakeLenke:{tekst:"Til kategoriene",onTilbakeKlikk:ae},onRequestClose:ie,onClose:J,children:[jsxRuntimeExports.jsx("article",{children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:"mote",element:jsxRuntimeExports.jsx(MoteAktivitetForm,{onSubmit:se(VeilarbAktivitetType.MOTE_TYPE),dirtyRef:te})}),jsxRuntimeExports.jsx(Route,{path:"samtalereferat",element:jsxRuntimeExports.jsx(SamtalereferatForm,{onSubmit:se(VeilarbAktivitetType.SAMTALEREFERAT_TYPE),dirtyRef:te})}),jsxRuntimeExports.jsx(Route,{path:"stilling",element:jsxRuntimeExports.jsx(StillingAktivitetForm,{onSubmit:se(VeilarbAktivitetType.STILLING_AKTIVITET_TYPE),dirtyRef:te})}),jsxRuntimeExports.jsx(Route,{path:"sokeavtale",element:jsxRuntimeExports.jsx(SokeAvtaleAktivitetForm,{onSubmit:se(VeilarbAktivitetType.SOKEAVTALE_AKTIVITET_TYPE),dirtyRef:te})}),jsxRuntimeExports.jsx(Route,{path:"behandling",element:jsxRuntimeExports.jsx(MedisinskBehandlingForm,{onSubmit:se(VeilarbAktivitetType.BEHANDLING_AKTIVITET_TYPE),dirtyRef:te})}),jsxRuntimeExports.jsx(Route,{path:"egen",element:jsxRuntimeExports.jsx(EgenAktivitetForm,{onSubmit:se(VeilarbAktivitetType.EGEN_AKTIVITET_TYPE),dirtyRef:te})}),jsxRuntimeExports.jsx(Route,{path:"ijobb",element:jsxRuntimeExports.jsx(IJobbAktivitetForm,{onSubmit:se(VeilarbAktivitetType.IJOBB_AKTIVITET_TYPE),dirtyRef:te})})]})}),jsxRuntimeExports.jsx(Feilmelding,{feilmeldinger:re})]}):null};function getAktivitetsFormComponent(T,C){if(!T)return null;switch(T.type){case STILLING_AKTIVITET_TYPE:return jsxRuntimeExports.jsx(StillingAktivitetForm,{...C});case EGEN_AKTIVITET_TYPE:return jsxRuntimeExports.jsx(EgenAktivitetForm,{...C});case SOKEAVTALE_AKTIVITET_TYPE:return jsxRuntimeExports.jsx(SokeAvtaleAktivitetForm,{...C});case BEHANDLING_AKTIVITET_TYPE:return jsxRuntimeExports.jsx(MedisinskBehandlingForm,{...C});case MOTE_TYPE:return jsxRuntimeExports.jsx(MoteAktivitetForm,{...C});case SAMTALEREFERAT_TYPE:return jsxRuntimeExports.jsx(SamtalereferatForm,{...C});case IJOBB_AKTIVITET_TYPE:return jsxRuntimeExports.jsx(IJobbAktivitetForm,{...C});default:return null}}function EndreAktivitet(){const T=useAppDispatch(),C=ge=>T(oppdaterAktivitet(ge)),$=reactExports.useRef(!1);useConfirmOnBeforeUnload($);const V=useNavigate(),{id:K}=useParams(),Y=useSelector(ge=>K?selectAktivitetMedId(ge,K):void 0),J=[Y?Status.OK:Status.PENDING],re=useSelector(selectAktivitetFeilmeldinger),te=[...useSelector(selecteEndreAktivitetFeilmeldinger),...re],se=useSelector(ge=>selectAktivitetStatus(ge))!==Status.OK,{aktivitetRoute:ie,hovedsideRoute:ae}=useRoutes();function oe(ge){if(!Y)return Promise.resolve();const ye=removeEmptyKeysFromObject(ge),fe={...Y,...ye};return C(fe).then(Te=>{isFulfilled(Te)&&V(ie(Y.id))})}const le=()=>{if(!$.current||window.confirm(CONFIRM)){const ge=Y==null?void 0:Y.type;return ge&&logModalLukket({isDirty:$.current,aktivitet:ge,modalType:"endre-aktivitet",navType:"onReqClose"}),!0}return!1},ce=ge=>{if(ge.preventDefault(),!$.current||window.confirm(CONFIRM)){const ye=Y==null?void 0:Y.type;ye&&logModalLukket({isDirty:$.current,aktivitet:ye,modalType:"endre-aktivitet",navType:"onReqBack"}),V(-1)}},de={onSubmit:oe,endre:!0,dirtyRef:$,lagrer:se},he=Y&&isVeilarbAktivitet(Y)?getAktivitetsFormComponent(Y,{...de,aktivitet:Y}):null,me=()=>V(ae());return jsxRuntimeExports.jsxs(Modal,{onClose:me,heading:"Endre aktivitet",onRequestClose:le,tilbakeLenke:{tekst:"Tilbake",onTilbakeKlikk:ce},children:[jsxRuntimeExports.jsx("article",{children:jsxRuntimeExports.jsx(Innholdslaster,{avhengigheter:J,children:jsxRuntimeExports.jsx(ModalContainer,{children:he})})}),jsxRuntimeExports.jsx(Feilmelding,{feilmeldinger:te})]})}const DirtyContext=React.createContext({isDirty:!1,setFormIsDirty:(T,C)=>{}});function isFormsDirty(T){return Object.values(T).some(C=>C===!0)}function DirtyProvider(T){const[C,$]=reactExports.useState(!1),[,V]=reactExports.useState({}),K=reactExports.useCallback((J,re)=>{V(ne=>{const te={...ne,[J]:re};return $(isFormsDirty(te)),te})},[V,$]),Y=reactExports.useMemo(()=>({isDirty:C,setFormIsDirty:K}),[C,K]);return jsxRuntimeExports.jsx(DirtyContext.Provider,{value:Y,children:T.children})}DirtyProvider.propTypes={children:PropTypes.object.isRequired};const EndreLinje=T=>{const{tittel:C,content:$,subtittel:V,open:K,onClick:Y}=T,[J,re]=reactExports.useState(!1);function ne(te){Y(te),J||logAccordionAapnet(C),re(!J)}return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(Accordion$1.Item,{open:K,children:[jsxRuntimeExports.jsx(Accordion$1.Header,{onClick:ne,className:"items-center",children:jsxRuntimeExports.jsx("div",{className:"flex flex-row gap-4 items-center",children:jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(Heading,{size:"small",level:"2",children:C}),jsxRuntimeExports.jsx("div",{children:V})]})})}),jsxRuntimeExports.jsx(Accordion$1.Content,{children:$})]})})},schema$8=z$1.object({etikettstatus:z$1.nativeEnum(StillingStatus)}),RadioButtons$2={INGEN_VALGT:"Ikke startet",SOKNAD_SENDT:"Sendt søknad",INNKALT_TIL_INTERVJU:"Skal på intervju",JOBBTILBUD:"Fått jobbtilbud",AVSLAG:"Ikke fått jobben"},StillingEtikettForm=T=>{const{aktivitet:C,disabled:$,onSubmit:V}=T,K={etikettstatus:C.etikett||StillingStatus.INGEN_VALGT},{handleSubmit:Y,setValue:J,formState:{isDirty:re,isSubmitting:ne}}=useForm({defaultValues:K,resolver:t(schema$8),shouldFocusError:!0}),{setFormIsDirty:te}=reactExports.useContext(DirtyContext);reactExports.useEffect(()=>{te("etikett",re)},[te,re]);const se=ne||$,ie=ae=>{J("etikettstatus",ae)};return jsxRuntimeExports.jsxs("form",{onSubmit:Y(ae=>V(ae)),children:[jsxRuntimeExports.jsx("div",{className:"mb-4",children:jsxRuntimeExports.jsx(RadioGroup,{legend:"Hvor langt har du kommet i søknadsprosessen?",hideLegend:!0,defaultValue:K.etikettstatus,onChange:ie,disabled:se,children:Object.entries(RadioButtons$2).map(([ae,oe])=>jsxRuntimeExports.jsx(Radio,{value:ae,children:oe},ae))})}),jsxRuntimeExports.jsx(Feilmelding,{feilmeldinger:useSelector(selectOppdaterAktivitetEtikettFeil)}),jsxRuntimeExports.jsx(Button$1,{className:"oppdater-status",disabled:se,loading:ne,children:"Lagre"})]})},OppdaterAktivitetEtikett=T=>{const{aktivitet:C}=T,$=useErVeileder(),V=useSelector(selectLasterAktivitetData,shallowEqual$1),K=!kanEndreAktivitetEtikett(C,$),Y=!useSelector(selectErUnderOppfolging),[J,re]=reactExports.useState(!1),ne=useAppDispatch(),te=async le=>{const{etikettstatus:ce}=le;if(ce===C.etikett){re(!1);return}const de=ce===StillingStatus.INGEN_VALGT?void 0:ce;return ne(oppdaterAktivitetEtikett({...C,etikett:de})).then(he=>{var me;isRejected(he)||(re(!1),(me=document.querySelector(".aktivitet-modal"))==null||me.focus())})},se=le=>(ae("etikett",!1),te(le)),ie=V||K||Y,{setFormIsDirty:ae}=reactExports.useContext(DirtyContext),oe=jsxRuntimeExports.jsx(StillingEtikettForm,{disabled:ie,aktivitet:C,onSubmit:se});return jsxRuntimeExports.jsx(EndreLinje,{icon:jsxRuntimeExports.jsx(BriefcaseIcon,{fontSize:"1.5rem"}),onClick:()=>{J&&ae("etikett",!1),re(!J)},open:J,tittel:"Hvor langt har du kommet i søknadsprosessen?",subtittel:jsxRuntimeExports.jsx(StillingEtikett,{aktivitet:C}),content:oe})},RadioButtons$1={VENTER:"Venter på å bli kontaktet av NAV eller arbeidsgiver",SKAL_PAA_INTERVJU:"Skal på intervju",JOBBTILBUD:"Fått jobbtilbud",AVSLAG:"Ikke fått jobben"},schema$7=z$1.object({soknadsstatus:z$1.enum([StillingFraNavSoknadsstatus.VENTER,StillingFraNavSoknadsstatus.SKAL_PAA_INTERVJU,StillingFraNavSoknadsstatus.JOBBTILBUD,StillingFraNavSoknadsstatus.AVSLAG])}),SoknadsstatusForm=T=>{const{soknadsstatus:C,disabled:$,onSubmit:V}=T,K={soknadsstatus:C||StillingFraNavSoknadsstatus.VENTER},{handleSubmit:Y,setValue:J,formState:{isDirty:re,isSubmitting:ne}}=useForm({defaultValues:K,resolver:t(schema$7),shouldFocusError:!0}),{setFormIsDirty:te}=reactExports.useContext(DirtyContext);reactExports.useEffect(()=>(te("soknadsstatus",re),()=>{te("soknadsstatus",!1)}),[te,re]);const se=ne||$,ie=ae=>{J("soknadsstatus",ae)};return jsxRuntimeExports.jsxs("form",{onSubmit:Y(ae=>V(ae)),children:[jsxRuntimeExports.jsx("div",{className:"pb-4",children:jsxRuntimeExports.jsx(RadioGroup,{legend:"",defaultValue:K.soknadsstatus,onChange:ie,disabled:se,children:Object.entries(RadioButtons$1).map(([ae,oe])=>jsxRuntimeExports.jsx(Radio,{value:ae,children:oe},ae))})}),jsxRuntimeExports.jsx(Feilmelding,{feilmeldinger:useSelector(selectOppdaterStillingFraNavSoknadsstatusFeil)}),jsxRuntimeExports.jsx(Button$1,{className:"oppdater-status",disabled:se,loading:ne,children:"Lagre"})]})},useDisableSoknadsstatusEndring=T=>{const{historisk:C}=T,$=useSelector(selectLasterAktivitetData),V=useSelector(selectErUnderOppfolging),K=!C&&T.status!==AktivitetStatus.FULLFOERT&&T.status!==AktivitetStatus.AVBRUTT;return $||!V||!K},lagreSoknadsstatus=(T,C,$)=>{var K;const{soknadsstatus:V}=C;return V===((K=$.stillingFraNavData)==null?void 0:K.soknadsstatus)?Promise.resolve():T(oppdaterStillingFraNavSoknadsstatus({aktivitetId:$.id,aktivitetVersjon:$.versjon,soknadsstatus:V}))},getDetaljer=({stillingFraNavData:T})=>{const{soknadsstatus:C,detaljer:$}=T;return C?C===StillingFraNavSoknadsstatus.IKKE_FATT_JOBBEN&&$==="KANDIDATLISTE_LUKKET_NOEN_ANDRE_FIKK_JOBBEN"?"Vi har fått beskjed om at arbeidsgiver har ansatt en person. Dessverre var det ikke deg denne gangen. Ansettelsesprosessen er ferdig.":C===StillingFraNavSoknadsstatus.IKKE_FATT_JOBBEN&&$==="KANDIDATLISTE_LUKKET_INGEN_FIKK_JOBBEN"?"Vi har fått beskjed om at arbeidsgiveren ikke skal ansatte en person allikevel. Vi beklager at det ikke ble en jobbmulighet denne gangen. Lykke til videre med jobbsøkingen.":C===StillingFraNavSoknadsstatus.FATT_JOBBEN?"Ansettelsesprosessen er ferdig.":null:null},OppdaterSoknadsstatus=T=>{var se;const{aktivitet:C}=T,$=useAppDispatch(),[V,K]=reactExports.useState(!1),Y=useDisableSoknadsstatusEndring(C),J=getDetaljer(C),{setFormIsDirty:re}=reactExports.useContext(DirtyContext),ne=ie=>(re("soknadsstatus",!1),lagreSoknadsstatus($,ie,C).then(()=>{var ae;K(!1),(ae=document.querySelector(".aktivitet-modal"))==null||ae.focus()})),te=jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[J?jsxRuntimeExports.jsx(Alert$1,{variant:"info",className:"mt-4",children:J}):null,jsxRuntimeExports.jsx(SoknadsstatusForm,{disabled:Y,soknadsstatus:C.stillingFraNavData.soknadsstatus,onSubmit:ne})]});return jsxRuntimeExports.jsx(EndreLinje,{icon:jsxRuntimeExports.jsx(PersonRectangleIcon,{fontSize:"1.5rem"}),onClick:()=>{V&&re("soknadsstatus",!1),K(!V)},open:V,tittel:"Hvor er du i søknadsprosessen?",subtittel:jsxRuntimeExports.jsx(StillingFraNavEtikett,{soknadsstatus:(se=C.stillingFraNavData)==null?void 0:se.soknadsstatus}),content:te})},kanOppdatereStatus=(T,C)=>{const $=[AktivitetStatus.FULLFOERT,AktivitetStatus.AVBRUTT].includes(C);if(isSamtaleOrMote(T)&&$&&manglerPubliseringAvSamtaleReferat(T,C))return"Samtalereferatet må deles før du kan sette aktiviteten til denne statusen"},label=T=>T===AktivitetStatus.FULLFOERT?"Skriv en kort kommentar om hvordan det har gått med aktiviteten, eller noe NAV bør kjenne til.":"Skriv en kort begrunnelse om hvorfor du avbryter aktiviteten.",RadioButtons={BRUKER_ER_INTERESSERT:"Forslag",PLANLAGT:"Planlegger",GJENNOMFORES:"Gjennomfører",FULLFORT:"Fullført",AVBRUTT:"Avbrutt"},schema$6=z$1.discriminatedUnion("should_validate_begrunnelse",[z$1.object({should_validate_begrunnelse:z$1.literal(!1),aktivitetstatus:z$1.nativeEnum(AktivitetStatus),aktivitet:z$1.any()}),z$1.object({should_validate_begrunnelse:z$1.literal(!0),aktivitetstatus:z$1.nativeEnum(AktivitetStatus),begrunnelse:z$1.string().min(1,"Du må fylle ut en begrunnelse").max(255,"Du må korte ned teksten til 255 tegn"),aktivitet:z$1.any()})]).superRefine((T,C)=>{const $=kanOppdatereStatus(T.aktivitet,T.aktivitetstatus);$&&C.addIssue({code:z$1.ZodIssueCode.custom,message:$})}),AktivitetStatusForm=T=>{const{aktivitet:C,onSubmit:$,disabled:V}=T,K={should_validate_begrunnelse:!1,aktivitetstatus:C.status,aktivitet:C},{register:Y,handleSubmit:J,reset:re,setValue:ne,watch:te,formState:{errors:se,isDirty:ie,isSubmitting:ae}}=useForm({defaultValues:K,resolver:t(schema$6),shouldFocusError:!0});reactExports.useEffect(()=>{re(),ne("aktivitet",C)},[C]);const{setFormIsDirty:oe}=reactExports.useContext(DirtyContext);reactExports.useEffect(()=>(oe("status",ie),()=>{oe("status",!1)}),[oe,ie]);const le=te("aktivitetstatus"),ce=le===AktivitetStatus.FULLFOERT||le===AktivitetStatus.AVBRUTT,de=trengerBegrunnelse(C.avtalt,le,C.type),he=ge=>{ne("aktivitetstatus",ge)},me=te("begrunnelse");return reactExports.useEffect(()=>{de?ne("should_validate_begrunnelse",!0):ne("should_validate_begrunnelse",!1)},[de]),jsxRuntimeExports.jsxs("form",{onSubmit:J(ge=>$(ge)),className:"space-y-4",children:[jsxRuntimeExports.jsx(RadioGroup,{legend:"Hva er status på aktiviteten?",hideLegend:!0,value:le,onChange:he,disabled:V,children:Object.entries(RadioButtons).map(([ge,ye])=>jsxRuntimeExports.jsx(Radio,{value:ge,children:ye},ge))}),ce?jsxRuntimeExports.jsx(Alert$1,{variant:"warning",children:'Hvis du endrer til "Fullført" eller "Avbrutt", blir aktiviteten låst og du kan ikke lenger endre innholdet.'}):null,de?jsxRuntimeExports.jsx(Textarea$1,{disabled:V,label:label(le),maxLength:255,...Y("begrunnelse"),error:se.begrunnelse&&se.begrunnelse.message,value:me}):null,jsxRuntimeExports.jsx(CustomErrorSummary,{errors:se}),jsxRuntimeExports.jsx(Feilmelding,{feilmeldinger:useSelector(selectOppdaterAktivitetStatusFeil)}),jsxRuntimeExports.jsx(Button$1,{loading:ae,className:"mt-4",disabled:V,children:"Lagre"})]})},useDisableStatusEndring=(T,C)=>{const $=useSelector(selectLasterAktivitetData),V=useSelector(selectErUnderOppfolging),K=kanEndreAktivitetStatus(T,C);return $||!V||!K},lagreStatusEndringer=(T,C,$)=>C.aktivitetstatus===$.status?Promise.resolve():(flyttetAktivitetMetrikk("submit",$,C.aktivitetstatus),T(flyttAktivitetMedBegrunnelse($,C.aktivitetstatus,C.begrunnelse))),OppdaterAktivitetStatus=T=>{const{aktivitet:C}=T,[$,V]=reactExports.useState(!1),K=useAppDispatch(),Y=useErVeileder(),J=useDisableStatusEndring(C,Y),re=ie=>(te("status",!1),lagreStatusEndringer(K,ie,C).then(ae=>{var oe;if(isRejected(ae))return null;V(!1),(oe=document.querySelector(".aktivitet-modal"))==null||oe.focus()})),ne=jsxRuntimeExports.jsx(BodyShort,{children:aktivitetStatusMap[C.status]}),{setFormIsDirty:te}=reactExports.useContext(DirtyContext),se=jsxRuntimeExports.jsx(AktivitetStatusForm,{disabled:J,onSubmit:re,aktivitet:C});return jsxRuntimeExports.jsx(EndreLinje,{icon:jsxRuntimeExports.jsx(HikingTrailSignIcon,{"aria-hidden":!0,fontSize:"1.5rem"}),onClick:()=>{$&&te("status",!1),V(!$)},open:$,tittel:"Hva er status på aktiviteten?",subtittel:ne,content:se})},selectVersjonerSlice=T=>T.data.versjoner,selectVersjonerData=T=>selectVersjonerSlice(T).data,selectVersjonerStatus=T=>selectVersjonerSlice(T).status,selectSorterteVersjoner=createSelector(selectVersjonerData,T=>[...T].sort(($,V)=>V.endretDato.localeCompare($.endretDato)));function getBrukerTekst(T){switch(T){case"BRUKER":return"Du";case"NAV":case"SYSTEM":case"ARENAIDENT":return"NAV";case"ARBEIDSGIVER":return"Arbeidsgiver";case"TILTAKSARRANGOER":return"Tiltaksarrangør"}}function veilerdTekst(T,C){switch(T){case"BRUKER":return"Bruker";case"SYSTEM":return"NAV";case"NAV":case"ARENAIDENT":return C||"NAV";case"ARBEIDSGIVER":return"Arbeidsgiver "+(C||"");case"TILTAKSARRANGOER":return"Tiltaksarrangør "+(C||"")}}const hentBrukeravhengigTekst=(T,C,$)=>T?getBrukerTekst(C):veilerdTekst(C,$),Endringstekst=T=>{var Y,J,re;const{aktivitet:C,forrigeAktivitet:$}=T,V=useSelector(selectErBruker),K=jsxRuntimeExports.jsx(Label,{className:"inline",children:hentBrukeravhengigTekst(V,C.endretAvType,C.endretAv)});switch(C.transaksjonsType){case MoteTransaksjonsType.MOTE_TID_OG_STED_ENDRET:return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K," endret tid eller sted for møtet"]});case MoteTransaksjonsType.REFERAT_OPPRETTET:case SamtaleReferatTransaksjonsType.REFERAT_OPPRETTET:return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K," opprettet referat"]});case MoteTransaksjonsType.REFERAT_ENDRET:case SamtaleReferatTransaksjonsType.REFERAT_ENDRET:return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K," endret referatet"]});case MoteTransaksjonsType.REFERAT_PUBLISERT:case SamtaleReferatTransaksjonsType.REFERAT_PUBLISERT:return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K," delte referatet"]});case FellesTransaksjonsTyper.BLE_HISTORISK:return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"Aktiviteten ble automatisk arkivert"});case FellesTransaksjonsTyper.DETALJER_ENDRET:return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K," endret detaljer på aktiviteten"]});case FellesTransaksjonsTyper.AVTALT:return $!=null&&$.avtalt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K," sendte forhåndsorientering "]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K,' merket aktiviteten som "Avtalt med NAV"']});case FellesTransaksjonsTyper.OPPRETTET:return C.avtalt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K,' opprettet aktiviteten. Den er automatisk merket som "Avtalt med NAV" ']}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K," opprettet aktiviteten"]});case FellesTransaksjonsTyper.FORHAANDSORIENTERING_LEST:{const ne=V?"ditt":"sitt";return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K," bekreftet å ha lest informasjon om ansvaret ",ne]})}case FellesTransaksjonsTyper.AVTALT_DATO_ENDRET:{const ne=formaterDatoKortManed($!=null&&$.tilDato?$.tilDato:"ingen dato"),te=formaterDatoKortManed(C.tilDato);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K," endret til dato på aktiviteten fra ",ne," til ",te]})}case FellesTransaksjonsTyper.STATUS_ENDRET:{const ne=$?aktivitetStatusMap[$==null?void 0:$.status]:"ingen",te=aktivitetStatusMap[C==null?void 0:C.status];return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K," flyttet aktiviteten fra ",ne," til ",te]})}case StillingTransaksjonsType.ETIKETT_ENDRET:{const ne=C.etikett?stillingsEtikettMapper[C.etikett]:"Ingen";return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K," endret tilstand til ",ne]})}case StillingFraNavTransaksjonsType.DEL_CV_SVART:{const ne=(Y=C.stillingFraNavData.cvKanDelesData)!=null&&Y.kanDeles?"Ja":"Nei";return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K,' svarte "',ne,'" på spørsmålet "Er du interessert i denne stillingen?"']})}case StillingFraNavTransaksjonsType.SOKNADSSTATUS_ENDRET:{const ne=(J=C.stillingFraNavData)!=null&&J.soknadsstatus?stillingFraNavSoknadsstatusMapper[C.stillingFraNavData.soknadsstatus]:"Ingen";return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K," endret tilstand til ",ne]})}case StillingFraNavTransaksjonsType.IKKE_FATT_JOBBEN:case StillingFraNavTransaksjonsType.FATT_JOBBEN:{const ne=(re=C.stillingFraNavData)!=null&&re.soknadsstatus?stillingFraNavSoknadsstatusMapper[C.stillingFraNavData.soknadsstatus]:"Ingen";return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K," avsluttet aktiviteten fordi kandidaten har ",ne]})}default:return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K," gjorde noe"]})}},VersjonInnslag=T=>{const{aktivitet:C,forrigeAktivitet:$}=T;return jsxRuntimeExports.jsxs("div",{className:"m-0 pb-4",children:[jsxRuntimeExports.jsx(Endringstekst,{aktivitet:C,forrigeAktivitet:$}),jsxRuntimeExports.jsx(BodyShort,{children:formaterDatoEllerTidSiden(C.endretDato)})]})},MAX_SIZE=10,VersjonerForAktivitet=T=>{const{aktivitet:C}=T,$=useAppDispatch(),V=useSelector(selectSorterteVersjoner),K=useSelector(selectVersjonerStatus);reactExports.useEffect(()=>($(fjernVersjoner()),$(hentVersjonerForAktivitet(C)),()=>{$(fjernVersjoner())}),[]);const Y=V.slice(0,MAX_SIZE).map((re,ne)=>jsxRuntimeExports.jsx(VersjonInnslag,{aktivitet:re,forrigeAktivitet:V[ne+1]},re.endretDato)),J=jsxRuntimeExports.jsx(ReadMore$1,{header:"Vis mer",children:V.slice(MAX_SIZE).map((re,ne)=>jsxRuntimeExports.jsx(VersjonInnslag,{aktivitet:re,forrigeAktivitet:V[ne+1]},re.endretDato))});return jsxRuntimeExports.jsx(Innholdslaster,{className:"flex m-auto my-4",avhengigheter:K,spinnerSize:"xlarge",children:jsxRuntimeExports.jsxs("section",{children:[Y,jsxRuntimeExports.jsx(VisibleIfDiv$1,{visible:V.length>MAX_SIZE,children:J})]})})},EndringsLogg=T=>{const{aktivitet:C}=T,[$,V]=reactExports.useState(!1);function K(){$||logAccordionAapnet("Historikk"),V(!$)}return jsxRuntimeExports.jsxs(Accordion$1.Item,{children:[jsxRuntimeExports.jsx(Accordion$1.Header,{onClick:K,children:jsxRuntimeExports.jsx("div",{className:"flex gap-4 items-center",children:"Historikk"})}),jsxRuntimeExports.jsx(Accordion$1.Content,{children:jsxRuntimeExports.jsx(VersjonerForAktivitet,{aktivitet:C})})]})},getAccordionItems=(T,C)=>{var $;switch(T.type){case VeilarbAktivitetType.STILLING_AKTIVITET_TYPE:return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(OppdaterAktivitetEtikett,{aktivitet:T}),jsxRuntimeExports.jsx(OppdaterAktivitetStatus,{aktivitet:T}),jsxRuntimeExports.jsx(EndringsLogg,{aktivitet:T})]});case VeilarbAktivitetType.STILLING_FRA_NAV_TYPE:return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[($=T.stillingFraNavData.cvKanDelesData)!=null&&$.kanDeles?jsxRuntimeExports.jsx(OppdaterSoknadsstatus,{aktivitet:T}):null,jsxRuntimeExports.jsx(OppdaterAktivitetStatus,{aktivitet:T}),jsxRuntimeExports.jsx(EndringsLogg,{aktivitet:T})]});case VeilarbAktivitetType.BEHANDLING_AKTIVITET_TYPE:case VeilarbAktivitetType.EGEN_AKTIVITET_TYPE:case VeilarbAktivitetType.IJOBB_AKTIVITET_TYPE:case VeilarbAktivitetType.SOKEAVTALE_AKTIVITET_TYPE:return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(OppdaterAktivitetStatus,{aktivitet:T}),jsxRuntimeExports.jsx(EndringsLogg,{aktivitet:T})]});case VeilarbAktivitetType.MOTE_TYPE:case VeilarbAktivitetType.SAMTALEREFERAT_TYPE:return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[C?jsxRuntimeExports.jsx(OppdaterAktivitetStatus,{aktivitet:T}):null,jsxRuntimeExports.jsx(EndringsLogg,{aktivitet:T})]});case VeilarbAktivitetType.EKSTERN_AKTIVITET_TYPE:return jsxRuntimeExports.jsx(EndringsLogg,{aktivitet:T});case ArenaAktivitetType.GRUPPEAKTIVITET:case ArenaAktivitetType.TILTAKSAKTIVITET:case ArenaAktivitetType.UTDANNINGSAKTIVITET:return}},AktivitetvisningAccordion=({aktivitet:T})=>{const C=useErVeileder(),$=getAccordionItems(T,C);return $?jsxRuntimeExports.jsx(Accordion$1,{children:$}):null},NeiSvarTekst="Nei, og jeg vil ikke at NAV skal dele CV-en min med arbeidsgiveren",JaSvarTekst="Ja, og NAV kan dele CV-en min med denne arbeidsgiveren",overskrift="Er du interessert i denne stillingen?",getTekst$1=(T,C,$,V)=>T===AktivitetStatus.AVBRUTT&&C===Livslopsstatus.AVBRUTT_AV_SYSTEM?`Du kan ikke svare på spørsmålet fordi svarfristen gikk ut ${formaterDatoManed(V)}`:T===AktivitetStatus.AVBRUTT?"Du kan ikke svare på spørsmålet fordi aktiviteten er avbrutt":T===AktivitetStatus.FULLFOERT?"Du kan ikke svare på spørsmålet fordi aktiviteten er fullført":$?"Du kan ikke svare på spørsmålet fordi oppfølgingsperioden er avsluttet":"Noe er feil, kontakt brukerstøtte",DeleCVAvbruttVisning=T=>{const{status:C,livslopsstatus:$,erHistorisk:V,svarfrist:K}=T,Y=getTekst$1(C,$,V,K);return jsxRuntimeExports.jsxs("div",{className:"p-4 bg-surface-subtle border-border-default border rounded-md",children:[jsxRuntimeExports.jsx(Heading,{size:"medium",className:"mb-4",children:overskrift}),jsxRuntimeExports.jsx(Alert$1,{variant:"info",inline:!0,children:Y})]})},DeleCvSvarVisning=({cvKanDelesData:T})=>{const C=T.kanDeles;let $,V;return T.endretAvType==="BRUKER"?($=C?JaSvarTekst:NeiSvarTekst,V=`Du svarte ${formaterDatoManed(T.endretTidspunkt)}`):($=`NAV var i kontakt med deg ${formaterDatoManed(T.avtaltDato)}. Du sa ${C?"ja":"nei"} til at CV-en din deles med arbeidsgiver.`,V=`NAV svarte på vegne av deg ${formaterDatoManed(T.endretTidspunkt)}.`),jsxRuntimeExports.jsxs("div",{className:"p-4 bg-surface-subtle border-border-default border rounded-md",children:[jsxRuntimeExports.jsx(Heading,{size:"medium",className:"mb-4",children:C?"Du svarte at du er interessert":"Du svarte at du ikke er interessert"}),jsxRuntimeExports.jsx(BodyShort,{children:$}),jsxRuntimeExports.jsx(BodyShort,{className:"mt-4",children:V}),C?jsxRuntimeExports.jsx(BodyShort,{className:"mt-4",children:"Arbeidsgiveren eller NAV vil kontakte deg hvis du er aktuell for stillingen"}):null]})},SvarPaaVegneAvBruker=({datoBegrensninger:T})=>jsxRuntimeExports.jsxs("div",{className:"mb-4 bg-surface-alt-3-subtle border-border-alt-3 border rounded-md p-4 space-y-4",children:[jsxRuntimeExports.jsxs("div",{className:"flex justify-between",children:[jsxRuntimeExports.jsx(Heading,{size:"small",level:"3",children:"Svar på vegne av brukeren"}),jsxRuntimeExports.jsx(Detail,{children:"FOR NAV-ANSATT"})]}),jsxRuntimeExports.jsx(BodyShort,{children:"Når var du i dialog med brukeren om å dele CV-en deres med denne arbeidsgiveren"}),jsxRuntimeExports.jsx(ControlledDatePicker,{field:{label:"Dato (obligatorisk)",required:!0,name:"avtaltDato"},disabledDays:[T]})]});var SvarType=(T=>(T.JA="ja",T.NEI="nei",T))(SvarType||{});const dateErrorMap={invalid_type:"Du må fylle ut datoen for når du var i dialog med brukeren",invalid_date:"Ikke en gyldig dato"},getDateErrorMessage=T=>({message:dateErrorMap[T.code]}),kanDelesField=z$1.nativeEnum(SvarType,{required_error:"Du må svare ja eller nei",invalid_type_error:"Ikke en gyldig dato"}),getSchema=({after:T},C)=>C?z$1.object({kanDeles:kanDelesField,avtaltDato:z$1.date({errorMap:getDateErrorMessage}).max(T,{message:"Dato for dialog kan ikke være frem i tid"})}):z$1.object({kanDeles:kanDelesField}),MeldInteresseForStilling=({aktivitet:T})=>{var ce,de;const[C,$]=reactExports.useState(void 0),V=useAppDispatch(),K=useErVeileder(),Y=(ce=T.stillingFraNavData)==null?void 0:ce.svarfrist,J={after:endOfToday()},re=useForm({resolver:t(getSchema(J,K)),defaultValues:{kanDeles:void 0}}),{handleSubmit:ne,control:te,formState:{errors:se,isSubmitting:ie}}=re,{field:ae}=useController({name:"kanDeles",control:te});reactExports.useEffect(()=>{ae.value==="ja"&&$('Stillingen flyttes til "Gjennomfører"'),ae.value==="nei"&&$('Stillingen flyttes til "Avbrutt"')},[ae.value]);const oe=he=>(V(oppdaterCVSvar({aktivitetId:T.id,aktivitetVersjon:T.versjon,kanDeles:he.kanDeles==="ja",avtaltDato:he.avtaltDato})),Promise.resolve()),le=useSelector(selectDeleCVFeil);return jsxRuntimeExports.jsx("form",{className:"bg-surface-subtle rounded-md border-border-default border p-4 space-y-8",onSubmit:ne(oe),noValidate:!0,children:jsxRuntimeExports.jsxs(FormProvider,{...re,children:[jsxRuntimeExports.jsxs("div",{className:"flex flex-col",children:[jsxRuntimeExports.jsx(Heading,{size:"medium",level:"2",children:overskrift}),jsxRuntimeExports.jsx(Ingress,{className:"mt-1"}),jsxRuntimeExports.jsxs(BodyShort,{className:"mt-1",children:["Svar før: ",formaterDatoManed(Y)]})]}),K?jsxRuntimeExports.jsx(SvarPaaVegneAvBruker,{datoBegrensninger:J}):null,jsxRuntimeExports.jsxs(RadioGroup,{legend:overskrift,hideLegend:!0,value:ae.value??null,name:ae.name,onChange:ae.onChange,ref:ae.ref,role:"radiogroup",error:(de=se.kanDeles)==null?void 0:de.message,children:[jsxRuntimeExports.jsx(Radio,{id:"kanDeles",value:"ja",children:JaSvarTekst}),jsxRuntimeExports.jsx(Radio,{value:"nei",children:NeiSvarTekst})]}),jsxRuntimeExports.jsx(CustomErrorSummary,{errors:se}),jsxRuntimeExports.jsx(Feilmelding,{feilmeldinger:le}),jsxRuntimeExports.jsxs("div",{className:"flex gap-4 items-center mt-8",children:[jsxRuntimeExports.jsx(Button$1,{disabled:ie,children:"Lagre"}),C&&jsxRuntimeExports.jsx(Alert$1,{variant:"info",inline:!0,children:C})]})]})})},Ingress=({className:T})=>jsxRuntimeExports.jsx(BodyShort,{className:T,children:"Du bestemmer selv om NAV kan dele CV-en din for denne stillingen."}),DeleCvContainer=({aktivitet:T})=>{const C=T.stillingFraNavData,$=C&&(C==null?void 0:C.cvKanDelesData),V=T.historisk;return $?jsxRuntimeExports.jsx(DeleCvSvarVisning,{cvKanDelesData:$}):V||T.status===AktivitetStatus.FULLFOERT||T.status===AktivitetStatus.AVBRUTT?jsxRuntimeExports.jsx(DeleCVAvbruttVisning,{status:T.status,livslopsstatus:C.livslopsstatus,erHistorisk:V,svarfrist:C.svarfrist}):jsxRuntimeExports.jsx(MeldInteresseForStilling,{aktivitet:T})},ArenaStatusAdministrasjon=()=>{const C=useSelector(selectErBruker)?"Du kan ikke endre denne aktiviteten selv. Send en melding til veilederen din hvis aktiviteten skal endres.":"For å endre aktiviteten må du gå til Arena.";return jsxRuntimeExports.jsx(Alert$1,{variant:"info",className:"w-full mt-4",children:C})},EksternAktivitetHandlingerKnapper=({aktivitet:T})=>{const{handlinger:C}=T.eksternAktivitet,$=useErVeileder();return C?jsxRuntimeExports.jsx("div",{className:"space-y-4 flex flex-col self-end justify-self-end w-full mb-8",children:C.flatMap((V,K)=>V.lenkeType==="EKSTERN"&&$||V.lenkeType==="INTERN"&&!$?null:jsxRuntimeExports.jsxs(LinkPanel$1,{href:V.url,target:"_blank",children:[jsxRuntimeExports.jsx(Heading,{size:"small",children:V.tekst}),jsxRuntimeExports.jsx(BodyShort,{children:V.subtekst})]},K))}):null},EndreAktivitetKnapp=T=>{const{id:C,tillatEndring:$,laster:V,underOppfolging:K}=T,Y=useNavigate(),{endreAktivitetRoute:J}=useRoutes();if(!$)return null;const re=()=>{loggEvent(APNE_ENDRE_AKTIVITET),Y(J(C))};return jsxRuntimeExports.jsx(Button$1,{disabled:V||!K,onClick:re,variant:"secondary",icon:jsxRuntimeExports.jsx(PencilIcon,{"aria-hidden":!0,fontSize:"1.5rem"}),children:"Endre på aktiviteten"})},LesMerOmStillingenKnapp=({aktivitet:T})=>{const C=useErVeileder(),$=`${STILLING_FRA_NAV_BASE_URL}${T.stillingFraNavData.stillingsId}`;return jsxRuntimeExports.jsx(Button$1,{variant:"secondary",as:"a",href:$,onClick:()=>loggStillingFraNavStillingslenkeKlikk(C),target:"_blank",children:"Les mer om stillingen"})},SendEnMeldingKnapp=T=>{var ne;const{aktivitet:C}=T,$=useErVeileder(),V=useSelector(selectDialogForAktivitetId(C.id)),K=((ne=V==null?void 0:V.henvendelser)==null?void 0:ne.reduce((te,se)=>se.lest?te:te+1,0))||0,Y=useNavigate(),{hovedsideRoute:J}=useRoutes(),re=te=>{$&&(Y(J(),{replace:!0}),byttTilDialogFlate({event:te,aktivitetId:C==null?void 0:C.id,dialogId:V==null?void 0:V.id})),logKlikkKnapp("send melding (i aktivitetskort)")};return jsxRuntimeExports.jsxs("div",{className:"relative",children:[jsxRuntimeExports.jsx(Button$1,{variant:"secondary",as:"a",href:getDialogLenke({erVeileder:$,aktivitetId:C.id,dialogId:V==null?void 0:V.id}),icon:jsxRuntimeExports.jsx(ChatElipsisIcon,{"aria-hidden":!0,fontSize:"1.5rem"}),onClick:re,children:K>0?`Du har ${K} ${K===1?"ulest melding":"uleste meldinger"}`:"Send en melding"}),K?jsxRuntimeExports.jsx("div",{className:"absolute bg-red-500 rounded-full flex justify-center items-center w-3 h-3 text-white left-8 top-6"}):null]})},getActions=({aktivitet:T,tillatEndring:C,laster:$,underOppfolging:V,erVeileder:K})=>{switch(T.type){case VeilarbAktivitetType.MOTE_TYPE:case VeilarbAktivitetType.BEHANDLING_AKTIVITET_TYPE:case VeilarbAktivitetType.EGEN_AKTIVITET_TYPE:case VeilarbAktivitetType.IJOBB_AKTIVITET_TYPE:case VeilarbAktivitetType.STILLING_AKTIVITET_TYPE:case VeilarbAktivitetType.SOKEAVTALE_AKTIVITET_TYPE:return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(EndreAktivitetKnapp,{id:T.id,tillatEndring:C,laster:$,underOppfolging:V}),jsxRuntimeExports.jsx(SendEnMeldingKnapp,{aktivitet:T})]});case VeilarbAktivitetType.SAMTALEREFERAT_TYPE:return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K?jsxRuntimeExports.jsx(EndreAktivitetKnapp,{id:T.id,tillatEndring:C,laster:$,underOppfolging:V}):null,jsxRuntimeExports.jsx(SendEnMeldingKnapp,{aktivitet:T})]});case VeilarbAktivitetType.STILLING_FRA_NAV_TYPE:return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LesMerOmStillingenKnapp,{aktivitet:T}),jsxRuntimeExports.jsx(EndreAktivitetKnapp,{id:T.id,tillatEndring:C,laster:$,underOppfolging:V}),jsxRuntimeExports.jsx(SendEnMeldingKnapp,{aktivitet:T})]});case VeilarbAktivitetType.EKSTERN_AKTIVITET_TYPE:return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(EksternAktivitetHandlingerKnapper,{aktivitet:T}),jsxRuntimeExports.jsx(SendEnMeldingKnapp,{aktivitet:T})]});case ArenaAktivitetType.GRUPPEAKTIVITET:case ArenaAktivitetType.TILTAKSAKTIVITET:case ArenaAktivitetType.UTDANNINGSAKTIVITET:return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SendEnMeldingKnapp,{aktivitet:T}),jsxRuntimeExports.jsx(ArenaStatusAdministrasjon,{})]})}},ActionRad=T=>{const C=useErVeileder(),$=getActions({...T,erVeileder:C});return jsxRuntimeExports.jsx("div",{className:"my-4 gap-4 flex flex-wrap",children:$})},LestKnapp=T=>{const{lasterData:C,onClick:$}=T;return jsxRuntimeExports.jsx(Button$1,{variant:"secondary",onClick:$,className:"mt-5",loading:C,size:"medium",children:"Ok, jeg har lest beskjeden"})},tittelTekst="Informasjon om ansvaret ditt",Forhaandsorienteringsvisning=T=>{const{aktivitet:C,startAapen:$=!1}=T,V=isArenaAktivitet(C),K=C.forhaandsorientering,Y=K==null?void 0:K.tekst,J=K==null?void 0:K.lestDato,re=!!J,ne=useSelector(selectErBruker),te=useAppDispatch(),se=skalMarkereForhaandsorienteringSomLest(ne,C),[ie,ae]=reactExports.useState($),[oe,le]=reactExports.useState(!1);if(!Y)return null;const ce=()=>{le(!0),V?te(markerForhaandsorienteringSomLestArenaAktivitet(C)).then(he=>le(!1)):te(markerForhaandsorienteringSomLest(C)).then(he=>le(!1)),loggForhaandsorienteringLest(C.type,!0)},de=()=>{ce&&ce(),ae(!1)};return!re&&se?jsxRuntimeExports.jsxs(Alert$1,{variant:"warning",children:[jsxRuntimeExports.jsx(Heading,{size:"xsmall",level:"2",children:tittelTekst}),jsxRuntimeExports.jsx(BodyLong$1,{children:Y}),jsxRuntimeExports.jsx(LestKnapp,{onClick:de,lasterData:oe})]}):jsxRuntimeExports.jsxs(ReadMore$1,{header:tittelTekst,open:ie,onClick:()=>ae(!ie),children:[jsxRuntimeExports.jsx(BodyLong$1,{children:Y}),re?jsxRuntimeExports.jsxs(BodyShort,{className:"mt-4",children:["Lest ",formaterDatoManed(J)]}):null]})},ForhaandsorienteringsVisningsLinje=({aktivitet:T,erBruker:C})=>jsxRuntimeExports.jsx(Forhaandsorienteringsvisning,{aktivitet:T,startAapen:skalMarkereForhaandsorienteringSomLest(C,T)}),KanIkkeLeggeTilForhaandsorienteringInfotekst=()=>jsxRuntimeExports.jsx(Alert$1,{variant:"info",children:"Du kan ikke legge til forhåndsorientering fordi sluttdatoen er færre enn 7 dager frem i tid."}),useErBrukerDigital=()=>{const T=useSelector(selectErBrukerManuell),C=useSelector(selectReservasjonKRR),$=useSelector(selectNivaa4);return!(T||C||!$)},useKanSendeVarsel=()=>{const T=useSelector(selectErUnderKvp);return useErBrukerDigital()&&!T},useSendAvtaltMetrikker=()=>{const T=useSelector(selectAktiviteterData).filter(V=>V.avtalt).filter(V=>!V.historisk).length!==0,C=useSelector(selectOppfolgingsPerioder).filter(V=>!V.sluttDato)[0],$=useKanSendeVarsel();return(V,K,Y)=>{loggForhandsorientering(!$,Y,V,K),!T&&C&&erGyldigISODato(C.startDato)&&metrikkTidForsteAvtalte(msSince(C.startDato))}},avtaltTekstEtikett="_avtaltTekstEtikett_rgh1a_1",maxWidth300="_maxWidth300_rgh1a_6",styles$2={avtaltTekstEtikett,maxWidth300},VarslingInfo=()=>jsxRuntimeExports.jsxs("div",{className:"flex mb-2",children:[jsxRuntimeExports.jsx(Label,{children:"Teksten som blir lagt til aktiviteten:"}),jsxRuntimeExports.jsx(HelpText$1,{className:"ml-2",children:jsxRuntimeExports.jsxs("div",{className:styles$2.maxWidth300,children:["Brukeren mottar sms eller e-post (se KRR) med en lenke til aktiviteten. ",jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsx("br",{}),"På aktiviteten vil bruker se forhåndsorienteringen og en knapp for å bekrefte at en har lest. ",jsxRuntimeExports.jsx("br",{}),jsxRuntimeExports.jsx("br",{}),"Hvis ikke brukeren leser beskjeden innen 7 dager, så blir de revarslet."]})})]}),ForhaandsorienteringsMelding=T=>{const{register:C,oppdaterer:$,forhaandsorienteringType:V,avtaltText119:K,errors:Y}=T;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Select$1,{label:"Velg type forhåndsorientering",disabled:$,className:"mt-4",...C("forhaandsorienteringType"),children:[jsxRuntimeExports.jsx("option",{value:ForhaandsorienteringType.SEND_STANDARD,children:"Forhåndsorientering (standard melding)"}),jsxRuntimeExports.jsx("option",{value:ForhaandsorienteringType.SEND_PARAGRAF_11_9,children:"Forhåndsorientering for §11-9 (AAP)"}),jsxRuntimeExports.jsx("option",{value:ForhaandsorienteringType.IKKE_SEND,children:"Ingen forhåndsorientering"})]}),jsxRuntimeExports.jsxs(VisibleIfDiv$1,{visible:V===ForhaandsorienteringType.SEND_STANDARD,children:[jsxRuntimeExports.jsx(VarslingInfo,{}),jsxRuntimeExports.jsx(BodyShort,{className:"blokk-xs",children:AVTALT_TEKST})]}),jsxRuntimeExports.jsx(VisibleIfDiv$1,{visible:V===ForhaandsorienteringType.SEND_PARAGRAF_11_9,children:jsxRuntimeExports.jsx(Textarea$1,{label:jsxRuntimeExports.jsx(VarslingInfo,{}),maxLength:500,value:K,...C("avtaltText119"),error:Y.avtaltText119&&Y.avtaltText119.message})})]})},getTekst=(T,C,$,V,K,Y)=>{if(C)return"Du kan ikke legge til forhåndsorientering fordi brukeren deltar i kvalifiseringsprogrammet.";if($)return"Du kan ikke legge til forhåndsorientering fordi brukeren har reservert seg i kontakt- og reservasjonsregisteret. Du skal ha orientert brukeren om mulig konsekvens for ytelse, og dokumentert dette.";if(!V)return"Du kan ikke legge til forhåndsorientering fordi brukeren ikke har vært innlogget de siste 18 månedene med nivå 4 (for eksempel BankID). Du skal ha orientert brukeren om mulig konsekvens for ytelse, og dokumentert dette.";if(T)return"Du kan ikke legge til forhåndsorientering fordi brukeren har manuell oppfølging. Du skal ha orientert brukeren om mulig konsekvens for ytelse, og dokumentert dette.";if(Y)return'Du kan ikke sende forhåndsorientering fordi aktiviteten ikke har "til dato". Hvis du har hatt muntlig dialog med brukeren om mulige konsekvenser for ytelse og dokumentert dette i et samtalereferat, så kan du sette aktiviteten til "Avtalt med NAV"';if(K)return'Du kan ikke legge til forhåndsorientering fordi sluttdatoen er færre enn 7 dager frem i tid. Hvis du har hatt muntlig dialog med brukeren om mulige konsekvenser for ytelse og dokumentert dette i et samtalereferat, så kan du sette aktiviteten til “Avtalt med NAV".'},KanIkkeSendeForhaandsorienteringInfotekst=T=>{const C=useSelector(selectErBrukerManuell),$=useSelector(selectErUnderKvp),V=useSelector(selectReservasjonKRR),K=useSelector(selectNivaa4),Y=getTekst(C,$,V,K,T.mindreEnnSyvDagerTil,T.manglerTilDato);return Y?jsxRuntimeExports.jsx(Alert$1,{variant:"warning",children:Y}):null},schema$5=z$1.discriminatedUnion("forhaandsorienteringType",[z$1.object({forhaandsorienteringType:z$1.literal(ForhaandsorienteringType.SEND_STANDARD),avtaltText:z$1.literal(AVTALT_TEKST)}),z$1.object({forhaandsorienteringType:z$1.literal(ForhaandsorienteringType.SEND_PARAGRAF_11_9),avtaltText119:z$1.string().min(1,"Tekst til brukeren er påkrevd").max(500,"Du må korte ned teksten til 500 tegn")}),z$1.object({forhaandsorienteringType:z$1.literal(ForhaandsorienteringType.IKKE_SEND)})]),AvtaltForm=T=>{const{aktivitet:C,lasterData:$,mindreEnnSyvDagerTil:V,setSendtAtErAvtaltMedNav:K,setForhandsorienteringType:Y}=T,[J,re]=reactExports.useState(!1),ne=useAppDispatch(),te=useSendAvtaltMetrikker(),se=useSelector(selectNivaa4Status),ie=(xe,Ce)=>ne(settAktivitetTilAvtalt({aktivitet:xe,forhaandsorientering:Ce})),ae=xe=>{const Ce=xe.forhaandsorienteringType;K();const je=getForhaandsorienteringText(xe);return ie(C,{type:Ce,tekst:je}),Y(Ce),te(Ce,C.type,V),Promise.resolve()},oe=useKanSendeVarsel()&&!V,le={forhaandsorienteringType:oe?ForhaandsorienteringType.SEND_STANDARD:ForhaandsorienteringType.IKKE_SEND,avtaltText:AVTALT_TEKST,avtaltText119:AVTALT_TEKST_119},{register:ce,handleSubmit:de,watch:he,formState:{errors:me,isDirty:ge,isSubmitting:ye}}=useForm({defaultValues:le,resolver:t(schema$5)}),fe=he("forhaandsorienteringType"),Te=he("avtaltText119"),{setFormIsDirty:Pe}=reactExports.useContext(DirtyContext),De=useSelector(selectSettAktivitetTilAvtaltFeil);return reactExports.useEffect(()=>(Pe("avtalt",ge),()=>Pe("avtalt",!1)),[Pe,ge]),jsxRuntimeExports.jsxs("form",{autoComplete:"off",noValidate:!0,onSubmit:de(xe=>ae(xe)),className:"bg-surface-alt-3-subtle py-2 px-4 my-4 border border-border-alt-3 rounded-md",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center",children:[jsxRuntimeExports.jsx(Checkbox,{onChange:()=>re(!J),children:"Avtalt med NAV"}),jsxRuntimeExports.jsx(HelpText$1,{"aria-label":"Informasjon om avtalt med NAV",title:"Informasjon om avtalt med NAV",id:"hjelp",className:"ml-2 justify-self-start",children:jsxRuntimeExports.jsx("div",{className:"max-w-[300px]",children:'Aktiviteter som oppfyller brukerens aktivitets- og medvirkningsplikt skal settes som "Avtalt med NAV"'})}),jsxRuntimeExports.jsx(Detail,{className:"text-right flex-grow",children:"FOR NAV-ANSATT"})]}),jsxRuntimeExports.jsx(Innholdslaster,{avhengigheter:se,visChildrenVedFeil:!0,children:J&&jsxRuntimeExports.jsxs("div",{className:"space-y-4 mb-2",children:[jsxRuntimeExports.jsx(KanIkkeSendeForhaandsorienteringInfotekst,{mindreEnnSyvDagerTil:V,manglerTilDato:!C.tilDato}),oe?jsxRuntimeExports.jsx(ForhaandsorienteringsMelding,{register:ce,forhaandsorienteringType:fe,avtaltText119:Te,oppdaterer:ye,errors:me}):null,jsxRuntimeExports.jsx(Feilmelding,{feilmeldinger:De}),jsxRuntimeExports.jsx(Button$1,{loading:ye,disabled:$,children:"Bekreft"})]})})]})},ForhaandsorienteringsMeldingArenaaktivitet=T=>{const{lasterData:C,register:$,watch:V}=T,K=V("forhaandsorienteringType"),Y=V("avtaltText119");return jsxRuntimeExports.jsxs("div",{className:"space-y-8",children:[jsxRuntimeExports.jsxs(Select$1,{label:"Velg type forhåndsorientering",disabled:C,className:"mt-4",...$("forhaandsorienteringType"),children:[jsxRuntimeExports.jsx("option",{value:ForhaandsorienteringType.SEND_STANDARD,children:"Forhåndsorientering (standard melding)"}),jsxRuntimeExports.jsx("option",{value:ForhaandsorienteringType.SEND_PARAGRAF_11_9,children:"Forhåndsorientering for §11-9 (AAP)"})]}),jsxRuntimeExports.jsxs(VisibleIfDiv$1,{visible:K===ForhaandsorienteringType.SEND_STANDARD,children:[jsxRuntimeExports.jsx(VarslingInfo,{}),jsxRuntimeExports.jsx(BodyShort,{className:"blokk-xs",children:AVTALT_TEKST})]}),jsxRuntimeExports.jsx(VisibleIfDiv$1,{visible:K===ForhaandsorienteringType.SEND_PARAGRAF_11_9,children:jsxRuntimeExports.jsx(Textarea$1,{label:jsxRuntimeExports.jsx(VarslingInfo,{}),maxLength:500,value:Y,...$("avtaltText119")})}),jsxRuntimeExports.jsx(Button$1,{loading:C,children:"Bekreft"})]})},schema$4=z$1.discriminatedUnion("forhaandsorienteringType",[z$1.object({forhaandsorienteringType:z$1.literal(ForhaandsorienteringType.SEND_STANDARD)}),z$1.object({forhaandsorienteringType:z$1.literal(ForhaandsorienteringType.SEND_PARAGRAF_11_9),avtaltText119:z$1.string().min(1,"Du må fylle ut teksten").max(500,"Du må korte ned teksten til 500 tegn")})]),ForhaandsorienteringForm=T=>{const{aktivitet:C,setSendtAtErAvtaltMedNav:$,setForhandsorienteringType:V}=T,[K,Y]=reactExports.useState(!1),J=useSelector(selectDialogStatus),re=useSelector(selectArenaAktivitetStatus),ne=useAppDispatch(),te={forhaandsorienteringType:ForhaandsorienteringType.SEND_STANDARD,avtaltText119:AVTALT_TEKST_119},se=isArenaAktivitet(C),{register:ie,handleSubmit:ae,watch:oe}=useForm({defaultValues:te,resolver:t(schema$4)}),le=he=>{const me=he.forhaandsorienteringType===ForhaandsorienteringType.SEND_STANDARD?AVTALT_TEKST:he.avtaltText119,ge={type:he.forhaandsorienteringType,tekst:me};return V(he.forhaandsorienteringType),ne(se?sendForhaandsorienteringArenaAktivitet({arenaAktivitet:C,forhaandsorientering:ge}):settAktivitetTilAvtalt({aktivitet:C,forhaandsorientering:ge})).then(()=>{var fe;$(),loggForhandsorienteringTiltak(),(fe=document.querySelector(".aktivitet-modal"))==null||fe.focus()})},ce=J!==Status.OK||re===Status.RELOADING||re===Status.PENDING,de=isEksternAktivitet$1(C);return jsxRuntimeExports.jsxs("form",{onSubmit:ae(he=>le(he)),className:"bg-surface-alt-3-subtle py-2 px-4 border border-border-alt-3 rounded-md",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntimeExports.jsx(Checkbox,{disabled:ce,onChange:()=>Y(!K),children:"Legg til forhåndsorientering"}),jsxRuntimeExports.jsx(Detail,{children:"FOR NAV-ANSATT"})]}),de||se?jsxRuntimeExports.jsx("p",{className:"mt-2",children:'Tiltaket er automatisk merket "Avtalt med NAV"'}):null,K?jsxRuntimeExports.jsx(ForhaandsorienteringsMeldingArenaaktivitet,{lasterData:ce,register:ie,watch:oe}):null]})},ManglerDatoerInfoTekst=()=>jsxRuntimeExports.jsx(Alert$1,{variant:"info",children:"Du kan ikke legge til forhåndsorientering fordi startdato og sluttdato ikke er satt."}),AvtaltFormContainer=T=>{const{aktivitet:C}=T,$=useSelector(selectAktivitetStatus),V=!erMerEnnSyvDagerTil(C.tilDato),K=isEksternAktivitet$1(C),Y=!C.fraDato&&!C.tilDato;return K?C.avtalt?Y?jsxRuntimeExports.jsx(ManglerDatoerInfoTekst,{}):V?jsxRuntimeExports.jsx(KanIkkeLeggeTilForhaandsorienteringInfotekst,{}):jsxRuntimeExports.jsx(ForhaandsorienteringForm,{...T,aktivitet:C}):null:jsxRuntimeExports.jsx(AvtaltForm,{lasterData:$!==Status.OK,mindreEnnSyvDagerTil:V,...T})},ArenaForhaandsorienteringFormKomponent=T=>{const{aktivitet:C,setSendtAtErAvtaltMedNav:$,setForhandsorienteringType:V}=T,K=erMerEnnSyvDagerTil(C.tilDato)||!C.tilDato;return useKanSendeVarsel()?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx("div",{className:"my-4",children:K?jsxRuntimeExports.jsx(ForhaandsorienteringForm,{aktivitet:C,setSendtAtErAvtaltMedNav:$,setForhandsorienteringType:V}):jsxRuntimeExports.jsx(KanIkkeLeggeTilForhaandsorienteringInfotekst,{})})}):null},FormContainer=T=>{const{aktivitet:C,...$}=T;return isArenaAktivitet(C)?jsxRuntimeExports.jsx(ArenaForhaandsorienteringFormKomponent,{aktivitet:C,...$}):jsxRuntimeExports.jsx(AvtaltFormContainer,{aktivitet:C,...$})},getText=(T,C,$,V)=>{if(!T||!$)return'Aktiviteten er merket "Avtalt med NAV". Forhåndsorientering er ikke lagt til. Du skal ha informert bruker om mulige konsekvenser for ytelse og dokumentert dette i et samtalereferat.';if(C)return'Aktiviteten er merket "Avtalt med NAV". Forhåndsorientering er ikke lagt til fordi sluttdatoen er færre enn 7 dager frem i tid. Du skal ha informert bruker om mulige konsekvenser for ytelse og dokumentert dette i et samtalereferat.';switch(V){case ForhaandsorienteringType.IKKE_SEND:return'Aktiviteten er merket "Avtalt med NAV" og forhåndsorientering om konsekvens for ytelse er ikke lagt til aktiviteten.';case ForhaandsorienteringType.SEND_STANDARD:return"Forhåndsorientering (standard melding) er lagt til aktiviteten. Bruker får sms eller e-post.";case ForhaandsorienteringType.SEND_PARAGRAF_11_9:return"Forhåndsorientering for §11-9 (AAP) er lagt til aktiviteten. Bruker får sms eller e-post."}return"Noe er feil, kontakt brukerstøtte"},SattTilAvtaltInfotekst=T=>{const C=useKanSendeVarsel(),{mindreEnnSyvDagerTil:$,harTilDato:V,forhaandsorienteringstype:K}=T,Y=getText(C,$,V,K);return jsxRuntimeExports.jsx(Alert$1,{variant:"success",children:Y})},SattTilAvtaltVisning=({aktivitet:T,forhaandsorienteringstype:C})=>{const $=!erMerEnnSyvDagerTil(T.tilDato);return C?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SattTilAvtaltInfotekst,{mindreEnnSyvDagerTil:$,harTilDato:T.tilDato!=null,forhaandsorienteringstype:C}),jsxRuntimeExports.jsx(Forhaandsorienteringsvisning,{aktivitet:T,startAapen:!0})]}):null},AvtaltContainer=T=>{const{underOppfolging:C,aktivitet:$}=T,{type:V,status:K,avtalt:Y}=$,J="historisk"in $?$.historisk:!1,[re,ne]=reactExports.useState(!1),[te,se]=reactExports.useState(ForhaandsorienteringType.IKKE_SEND),ie=useErVeileder(),ae=useSelector(selectErBruker),oe=$.forhaandsorientering&&$.forhaandsorientering.type!==ForhaandsorienteringType.IKKE_SEND,le=re,ce=isArenaAktivitet($),de=!J&&C&&K!==AktivitetStatus.FULLFOERT&&K!==AktivitetStatus.AVBRUTT,ge=!(ce||$.type===VeilarbAktivitetType.EKSTERN_AKTIVITET_TYPE?$.forhaandsorientering:Y)&&ie&&de&&(V!==STILLING_FRA_NAV_TYPE&&V!==SAMTALEREFERAT_TYPE);return!oe&&!ge&&!le?null:ge?jsxRuntimeExports.jsx(FormContainer,{setSendtAtErAvtaltMedNav:()=>ne(!0),aktivitet:$,setForhandsorienteringType:se}):le?jsxRuntimeExports.jsx(SattTilAvtaltVisning,{forhaandsorienteringstype:te,aktivitet:$}):jsxRuntimeExports.jsx(ForhaandsorienteringsVisningsLinje,{aktivitet:$,erBruker:ae})},DetaljFelt=T=>{const{tittel:C,children:$,fullbredde:V,beskrivelse:K}=T;return jsxRuntimeExports.jsxs("div",{className:classNames("w-1/2 min-w-52 overflow-hidden overflow-ellipsis",{"w-full":V,"flex-auto break-words":K}),children:[jsxRuntimeExports.jsx(Heading,{level:"2",size:"xsmall",children:C}),$]})},InnholdsWrapper=T=>{const{children:C,formattertTekst:$}=T;return $?jsxRuntimeExports.jsx(CustomBodyLong,{formatLinks:!0,formatLinebreaks:!0,children:C}):typeof C!="string"?C:jsxRuntimeExports.jsx(BodyShort,{children:C})},Informasjonsfelt=T=>{const{tittel:C,innhold:$,fullbredde:V,formattertTekst:K,beskrivelse:Y}=T;return $===null||!$?null:jsxRuntimeExports.jsx(DetaljFelt,{tittel:C,fullbredde:V,beskrivelse:Y,children:jsxRuntimeExports.jsx(InnholdsWrapper,{formattertTekst:K,children:$})})},HiddenIfInformasjonsfelt=hiddenIfHOC(Informasjonsfelt),formatertDato=(T,C)=>C&&!T?"Dato ikke satt":formaterDatoManed(T),FraDato=({aktivitet:T,tittel:C,visIkkeSatt:$})=>jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:C||"Fra dato",innhold:formatertDato(T.fraDato,$)},"fradato"),TilDato=({aktivitet:T,tittel:C,visIkkeSatt:$})=>jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:C||"Til dato",innhold:formatertDato(T.tilDato,$)},"tildato"),Beskrivelse=({aktivitet:T})=>jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Beskrivelse",innhold:T.beskrivelse,beskrivelse:!0,fullbredde:!0,formattertTekst:!0}),BehandlingsDetaljer=({aktivitet:T})=>T.type!==BEHANDLING_AKTIVITET_TYPE?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Type behandling",innhold:T.behandlingType},"behandlingtype"),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Behandlingssted",innhold:T.behandlingSted},"behandlingsted"),jsxRuntimeExports.jsx(FraDato,{aktivitet:T}),jsxRuntimeExports.jsx(TilDato,{aktivitet:T}),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Mål for behandlingen",innhold:T.effekt,fullbredde:!0},"effekt"),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Oppfølging fra NAV",innhold:T.behandlingOppfolging,fullbredde:!0},"behandlingOppfolging"),jsxRuntimeExports.jsx(Beskrivelse,{aktivitet:T})]}),httpRegex=/^(https?):\/\/.*$/,formatterLenke=T=>{const C=T==null?void 0:T.trim();return C&&C.match(httpRegex)?C:`http://${T}`},DetaljvisningLenke=T=>{var V;const C=(V=T.lenke)==null?void 0:V.trim();if(!C)return null;let $;try{$=new URL(C.startsWith("http")?C:"http://"+C).hostname}catch{$=C}return jsxRuntimeExports.jsx(DetaljFelt,{tittel:"Lenke",fullbredde:!0,children:jsxRuntimeExports.jsxs(Link$1,{target:"_blank",href:formatterLenke(C),className:"block",children:[$," (åpnes i ny fane)"]})},"lenke")},EgenAktivitetDetaljer=({aktivitet:T})=>T.type!==EGEN_AKTIVITET_TYPE?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FraDato,{aktivitet:T}),jsxRuntimeExports.jsx(TilDato,{aktivitet:T}),jsxRuntimeExports.jsx(Informasjonsfelt,{fullbredde:!0,tittel:"Mål med aktiviteten",innhold:T.hensikt},"hensikt"),jsxRuntimeExports.jsx(Informasjonsfelt,{fullbredde:!0,tittel:"Min huskeliste",innhold:T.oppfolging},"oppfolging"),jsxRuntimeExports.jsx(Beskrivelse,{aktivitet:T}),jsxRuntimeExports.jsx(DetaljvisningLenke,{lenke:T.lenke})]}),Detaljer=({detaljer:T})=>T?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:T.map(C=>jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:C.label,innhold:C.verdi},"EKSTERN-"+C.label))}):null,EksternAktivitetDetaljer=({aktivitet:T})=>T.type!==VeilarbAktivitetType.EKSTERN_AKTIVITET_TYPE?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FraDato,{aktivitet:T,visIkkeSatt:!0}),jsxRuntimeExports.jsx(TilDato,{aktivitet:T,visIkkeSatt:!0}),jsxRuntimeExports.jsx(Detaljer,{detaljer:T.eksternAktivitet.detaljer}),jsxRuntimeExports.jsx(Beskrivelse,{aktivitet:T})]}),MoteplanInnhold=T=>jsxRuntimeExports.jsx("ul",{className:"list-disc list-inside",children:T.map((C,$)=>jsxRuntimeExports.jsx("li",{className:"",children:jsxRuntimeExports.jsxs(BodyShort,{className:"inline",children:[formaterDatoKortManedTid(C.startDato),formaterTid(C.sluttDato)==="00:00"?"":` - ${formaterTid(C.sluttDato)}`,",",` ${C.sted}`]})},$))}),GruppeDetaljer=({aktivitet:T})=>{if(T.type!==GRUPPE_AKTIVITET_TYPE)return null;const{fraDato:C,tilDato:$,moeteplanListe:V}=T,K=formaterDatoKortManed(C)===formaterDatoKortManed($);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[K?jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Dato",innhold:formaterDatoKortManed(C)||"Dato ikke satt"}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FraDato,{aktivitet:T,visIkkeSatt:!0}),jsxRuntimeExports.jsx(TilDato,{aktivitet:T,visIkkeSatt:!0})]}),jsxRuntimeExports.jsx(Informasjonsfelt,{fullbredde:!0,tittel:"Tidspunkt og sted",beskrivelse:!0,innhold:MoteplanInnhold(V)},"moteplanutenslutteklokke"),jsxRuntimeExports.jsx(Beskrivelse,{aktivitet:T})]})},IJobbDetaljer=({aktivitet:T})=>T.type!==IJOBB_AKTIVITET_TYPE?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FraDato,{aktivitet:T}),jsxRuntimeExports.jsx(TilDato,{aktivitet:T,visIkkeSatt:!0}),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Stillingsandel",innhold:jobbStatusTypeMap[T.jobbStatus]},"jobbstatus"),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Arbeidsgiver",innhold:T.ansettelsesforhold},"ansettelsesforhold"),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Ansettelsesforhold",innhold:T.arbeidstid},"arbeidstid"),jsxRuntimeExports.jsx(Beskrivelse,{aktivitet:T})]}),MoteDetaljer=({aktivitet:T})=>{if(T.type!==MOTE_TYPE)return null;const C=beregnKlokkeslettVarighet(T);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Dato",innhold:formaterDatoManed(T.fraDato)},"dato"),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Klokkeslett",innhold:formatterKlokkeslett(C==null?void 0:C.klokkeslett)},"klokkeslett"),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Møteform",innhold:T.kanal&&kanalMap[T.kanal]},"kanal"),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Varighet",innhold:formatterVarighet(C==null?void 0:C.varighet)},"varighet"),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Møtested eller annen praktisk informasjon",innhold:T.adresse,formattertTekst:!0,fullbredde:!0},"adresse"),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Hensikt med møtet",innhold:T.beskrivelse,formattertTekst:!0,fullbredde:!0},"bakgrunn"),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Forberedelser til møtet",innhold:T.forberedelser,formattertTekst:!0,fullbredde:!0},"forberedelser")]})},SamtalereferatDetaljer=({aktivitet:T})=>T.type!==SAMTALEREFERAT_TYPE?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Dato",innhold:formaterDatoKortManed(T.fraDato)},"dato"),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Møteform",innhold:T.kanal&&kanalMap[T.kanal]},"kanal")]}),SokeDetaljer=({aktivitet:T})=>T.type!==SOKEAVTALE_AKTIVITET_TYPE?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FraDato,{aktivitet:T}),jsxRuntimeExports.jsx(TilDato,{aktivitet:T}),jsxRuntimeExports.jsx(HiddenIfInformasjonsfelt,{tittel:"Antall søknader i perioden",innhold:`${T.antallStillingerSokes}`,hidden:!T.antallStillingerSokes||T.antallStillingerSokes<1},"antallStillinger"),jsxRuntimeExports.jsx(HiddenIfInformasjonsfelt,{tittel:"Antall søknader i uken",innhold:`${T.antallStillingerIUken}`,hidden:!T.antallStillingerIUken||T.antallStillingerIUken<1},"antallStillingerIUken"),jsxRuntimeExports.jsx(HiddenIfInformasjonsfelt,{tittel:"Oppfølging fra NAV",beskrivelse:!0,formattertTekst:!0,hidden:!T.avtaleOppfolging,innhold:T.avtaleOppfolging},"avtaleOppfolging"),jsxRuntimeExports.jsx(Beskrivelse,{aktivitet:T})]}),StillingDetaljer=({aktivitet:T})=>T.type!==STILLING_AKTIVITET_TYPE?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FraDato,{aktivitet:T}),jsxRuntimeExports.jsx(TilDato,{tittel:"Frist",aktivitet:T,visIkkeSatt:!0}),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Arbeidsgiver",innhold:T.arbeidsgiver},"arbeidsgiver"),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Kontaktperson",innhold:T.kontaktperson},"kontaktperson"),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Arbeidssted",innhold:T.arbeidssted},"arbeidssted"),jsxRuntimeExports.jsx(Beskrivelse,{aktivitet:T}),jsxRuntimeExports.jsx(DetaljvisningLenke,{lenke:T.lenke})]}),StillingFraNavDetaljer=({aktivitet:T})=>{if(T.type!==STILLING_FRA_NAV_TYPE)return null;const C=T.stillingFraNavData;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Arbeidsgiver",innhold:C.arbeidsgiver},"arbeidsgiver"),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Arbeidssted",innhold:C.arbeidssted},"arbeidssted")]})},TiltakDetaljer=({aktivitet:T})=>T.type!==TILTAK_AKTIVITET_TYPE?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FraDato,{aktivitet:T,visIkkeSatt:!0}),jsxRuntimeExports.jsx(TilDato,{aktivitet:T,visIkkeSatt:!0}),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Arrangør",innhold:T.arrangoer},"arrangoer"),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Deltakelse",innhold:!!T.deltakelseProsent&&`${T.deltakelseProsent}%`},"deltakelsesprosent"),jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Antall dager per uke",innhold:!!T.antallDagerPerUke&&`${T.antallDagerPerUke}`},"dagerPerUke"),jsxRuntimeExports.jsx(Beskrivelse,{aktivitet:T})]}),UtdanningDetaljer=({aktivitet:T})=>T.type!==UTDANNING_AKTIVITET_TYPE?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FraDato,{aktivitet:T,visIkkeSatt:!0}),jsxRuntimeExports.jsx(TilDato,{aktivitet:T,visIkkeSatt:!0}),jsxRuntimeExports.jsx(Beskrivelse,{aktivitet:T})]}),customAlertStripe=T=>jsxRuntimeExports.jsxs(Alert$1,{variant:"warning",children:[jsxRuntimeExports.jsx(Heading,{spacing:!0,size:"small",level:"3",children:T.tekst}),T.subtekst,jsxRuntimeExports.jsx(Button$1,{variant:"primary",as:"a",href:T.url,target:"_blank",className:"flex w-fit mt-4",children:T.knapptekst})]}),OppgaveBoks=({oppgave:T})=>{const C=useErVeileder();return T?C&&T.intern?customAlertStripe(T.intern):!C&&T.ekstern?customAlertStripe(T.ekstern):null:null},Aktivitetsdetaljer=({valgtAktivitet:T})=>jsxRuntimeExports.jsxs("section",{className:"space-y-4",children:[T.type===VeilarbAktivitetType.EKSTERN_AKTIVITET_TYPE?jsxRuntimeExports.jsx(OppgaveBoks,{oppgave:T.eksternAktivitet.oppgave}):null,jsxRuntimeExports.jsxs("div",{className:"flex flex-row flex-wrap w-full gap-y-4",children:[jsxRuntimeExports.jsx(BehandlingsDetaljer,{aktivitet:T}),jsxRuntimeExports.jsx(EgenAktivitetDetaljer,{aktivitet:T}),jsxRuntimeExports.jsx(GruppeDetaljer,{aktivitet:T}),jsxRuntimeExports.jsx(IJobbDetaljer,{aktivitet:T}),jsxRuntimeExports.jsx(MoteDetaljer,{aktivitet:T}),jsxRuntimeExports.jsx(SamtalereferatDetaljer,{aktivitet:T}),jsxRuntimeExports.jsx(SokeDetaljer,{aktivitet:T}),jsxRuntimeExports.jsx(StillingDetaljer,{aktivitet:T}),jsxRuntimeExports.jsx(TiltakDetaljer,{aktivitet:T}),jsxRuntimeExports.jsx(UtdanningDetaljer,{aktivitet:T}),jsxRuntimeExports.jsx(StillingFraNavDetaljer,{aktivitet:T}),jsxRuntimeExports.jsx(EksternAktivitetDetaljer,{aktivitet:T})]})]}),VisningIngress=({aktivitetstype:T})=>[EGEN_AKTIVITET_TYPE,IJOBB_AKTIVITET_TYPE,STILLING_AKTIVITET_TYPE,BEHANDLING_AKTIVITET_TYPE,EKSTERN_AKTIVITET_TYPE].includes(T)?null:jsxRuntimeExports.jsx(AktivitetIngress,{aktivitetstype:T}),AktivitetinformasjonVisning=T=>{const{valgtAktivitet:C,underOppfolging:$}=T,{type:V,avtalt:K}=C,Y=isSamtaleOrMote(C)?SkalIkkeDeltFerdigMarkeringVises(C):!1;return jsxRuntimeExports.jsxs("div",{className:"space-y-8 mb-8",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-8 space-x-2",children:[jsxRuntimeExports.jsx(VisningIngress,{aktivitetstype:V}),jsxRuntimeExports.jsx(AvtaltMarkering,{hidden:!K}),C.type===VeilarbAktivitetType.EKSTERN_AKTIVITET_TYPE&&jsxRuntimeExports.jsx(EksterneEtiketter,{aktivitet:C}),Y?jsxRuntimeExports.jsx(IkkeDeltFerdigMarkering,{}):null]}),jsxRuntimeExports.jsx(AvtaltContainer,{underOppfolging:$,aktivitet:C}),jsxRuntimeExports.jsx(Aktivitetsdetaljer,{valgtAktivitet:C})]})},BegrunnelseBoks=({begrunnelse:T})=>jsxRuntimeExports.jsx(Alert$1,{variant:"info",children:jsxRuntimeExports.jsx(BodyShort,{className:"tilDittNavTekst",children:T})}),VarslingBoks=({aktivitet:T})=>{const C=useSelector(selectIdentitetStatus),$=useSelector(selectDialogStatus),V=[C,$],K=useErVeileder(),Y=useSelector(selectDialogForAktivitetId(T.id)),J=useErBrukerDigital(),re=T.avtalt&&T.forhaandsorientering&&T.forhaandsorientering.type!==ForhaandsorienteringType.IKKE_SEND,ne=T.type===MOTE_TYPE&&K&&!Y&&J&&!re;return jsxRuntimeExports.jsx(div$1,{hidden:!ne,children:jsxRuntimeExports.jsx(Innholdslaster,{avhengigheter:V,children:jsxRuntimeExports.jsx(div$1,{hidden:!ne,children:jsxRuntimeExports.jsxs(Alert$1,{variant:"warning",className:"mt-4",children:["Brukeren får ikke automatisk beskjed om at aktiviteten er opprettet. ",jsxRuntimeExports.jsx("br",{}),"Send en dialogmelding slik at bruker får informasjon om møtet."]})})})})},HiddenIfHovedknapp=hiddenIfHOC(Button$1),schema$3=z$1.object({referat:z$1.string().min(0).max(5e3)}),OppdaterReferatForm=T=>{const{aktivitet:C,onFerdig:$}=T,[V,K]=reactExports.useState(!0),Y=useReferatStartTekst(),J=useAppDispatch(),re=useSelector(selectAktivitetStatus),ne=C.erReferatPublisert,{watch:te,formState:{isDirty:se,isSubmitting:ie},register:ae,handleSubmit:oe}=useForm({resolver:t(schema$3),defaultValues:{referat:C.referat||Y}}),le=ie||re===Status.PENDING||re===Status.RELOADING,{setFormIsDirty:ce}=reactExports.useContext(DirtyContext);reactExports.useEffect(()=>(ce("referat",se),()=>ce("referat",!1)),[ce,se]);const de=(ye,fe=!0)=>{const Te={...C,referat:ye.referat};return J(oppdaterReferat(Te)).then(Pe=>{if(fe){const De=lt(ye.referat);logReferatFullfort(De,C.erReferatPublisert,V)}return isFulfilled(Pe)&&$(),Pe})},he=oe(ye=>de(ye,!1).then(fe=>{fe.payload&&J(publiserReferat(fe.payload)).then(()=>{const Te=lt(ye.referat);logReferatFullfort(Te,!0,V)})})),me=useSelector(selectPubliserOgOppdaterReferatFeil),ge=te("referat");return jsxRuntimeExports.jsxs("form",{onSubmit:oe(ye=>de(ye)),className:"space-y-4 bg-surface-alt-3-subtle p-4 border border-border-alt-3 rounded-md",children:[jsxRuntimeExports.jsx(Textarea$1,{label:"Samtalereferat",disabled:le,maxLength:5e3,placeholder:"Skriv samtalereferatet her",...ae("referat"),value:ge}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Switch$1,{checked:V,onChange:()=>{K(!V),logToggleSpraksjekkToggle(!V)},children:"Klarspråkhjelpen"}),jsxRuntimeExports.jsx(it,{value:ge,open:V,options:{tools:!1,longWords:!1}})]}),jsxRuntimeExports.jsx(Feilmelding,{feilmeldinger:me}),jsxRuntimeExports.jsxs("div",{className:"space-x-4",children:[jsxRuntimeExports.jsx(HiddenIfHovedknapp,{loading:le,disabled:le,hidden:ne,onClick:he,children:"Del med bruker"}),jsxRuntimeExports.jsx(Button$1,{variant:ne?"primary":"secondary",loading:le,disabled:le,children:ne?"Del endring":"Lagre utkast"}),C.referat&&jsxRuntimeExports.jsx(Button$1,{variant:"tertiary",onClick:$,children:"Avbryt"})]})]})},button="_button_1b5vd_1",content="_content_1b5vd_20",styles$1={button,content},ToggleBetweenDisplayingTruncatedOrFullText=T=>{const{className:C,text:$,maxCharacters:V}=T,K=classNames("mb-4",C),[Y,J]=reactExports.useState(!0),re=()=>{J(!Y)};return $.length>V?jsxRuntimeExports.jsxs("div",{className:K,children:[jsxRuntimeExports.jsx(CustomBodyLong,{className:"inline",formatLinks:!0,formatLinebreaks:!0,children:Y?$.slice(0,V)+" ... ":$+" "}),jsxRuntimeExports.jsxs(Button$1,{variant:"tertiary",onClick:re,className:styles$1.button,children:[Y?"Les mer":"Vis mindre",Y?jsxRuntimeExports.jsx(ChevronDownIcon,{fontSize:"1.5rem",className:"inline"}):jsxRuntimeExports.jsx(ChevronUpIcon,{fontSize:"1.5rem",className:"inline"})]})]}):jsxRuntimeExports.jsx("div",{className:K,children:jsxRuntimeExports.jsx(CustomBodyLong,{formatLinks:!0,formatLinebreaks:!0,children:$})})},EkspanderbartTekstomrade=T=>{const{className:C,tekst:$,antallTegn:V}=T;return jsxRuntimeExports.jsx(ToggleBetweenDisplayingTruncatedOrFullText,{className:C,text:$,maxCharacters:V})},ReferatVisning=T=>{const C=useErVeileder(),{erAktivAktivitet:$,referat:V,dispatchPubliserReferat:K,publiserer:Y,erReferatPublisert:J,startOppdaterReferat:re}=T,ne=useSelector(selectPubliserReferatFeil);return jsxRuntimeExports.jsxs("section",{className:"my-4 border-t pt-8",children:[jsxRuntimeExports.jsx(Heading,{level:"2",size:"large",className:"mb-4",children:"Samtalereferat"}),jsxRuntimeExports.jsx(EkspanderbartTekstomrade,{tekst:V,antallTegn:275}),jsxRuntimeExports.jsxs(div$1,{hidden:!C||!$,className:"flex flex-col mt-8 space-y-4",children:[J?jsxRuntimeExports.jsx(Alert$1,{variant:"success",inline:!0,children:"Delt med bruker"}):null,jsxRuntimeExports.jsx(Feilmelding,{feilmeldinger:ne}),jsxRuntimeExports.jsxs("div",{className:"space-x-4",children:[jsxRuntimeExports.jsx(Button$1,{hidden:J,onClick:K,loading:Y,children:"Del med bruker"}),jsxRuntimeExports.jsx(Button$1,{variant:"secondary",onClick:re,children:"Endre referat"})]})]})]})},ReferatContainer=T=>{const{aktivitet:C}=T,$=useAppDispatch(),[V,K]=reactExports.useState(!1),Y=useSelector(selectAktivitetStatus)===(Status.PENDING||Status.RELOADING),J=useErVeileder(),re=useSelector(selectErUnderOppfolging),{referat:ne,erReferatPublisert:te,type:se}=C,ie=se===MOTE_TYPE&&isAfter(new Date,parseISO(C.fraDato))||se===SAMTALEREFERAT_TYPE,ae=!C.historisk&&re&&C.status!==AktivitetStatus.AVBRUTT&&C.status!==AktivitetStatus.FULLFOERT;return ie?J&&!ne&&ae||V?jsxRuntimeExports.jsx(OppdaterReferatForm,{aktivitet:C,onFerdig:()=>K(!1)}):ne?jsxRuntimeExports.jsx(ReferatVisning,{referat:ne,erAktivAktivitet:ae,dispatchPubliserReferat:()=>$(publiserReferat(C)),publiserer:Y,erReferatPublisert:te,startOppdaterReferat:()=>K(!0)}):null:null},Aktivitetvisning=T=>{const{aktivitet:C,tillatEndring:$,laster:V,underOppfolging:K}=T,J=!isArenaAktivitet(C)&&trengerBegrunnelse(C.avtalt,C.status,C.type);return jsxRuntimeExports.jsxs("div",{className:" space-y-8",children:[jsxRuntimeExports.jsx(VarslingBoks,{aktivitet:C}),J&&C.avsluttetKommentar?jsxRuntimeExports.jsx(BegrunnelseBoks,{begrunnelse:C.avsluttetKommentar}):null,jsxRuntimeExports.jsx(AktivitetinformasjonVisning,{valgtAktivitet:C,underOppfolging:K}),C.type===VeilarbAktivitetType.STILLING_FRA_NAV_TYPE?jsxRuntimeExports.jsx(DeleCvContainer,{aktivitet:C}):null,jsxRuntimeExports.jsx(ActionRad,{aktivitet:C,tillatEndring:$,laster:V,underOppfolging:K}),C.type===VeilarbAktivitetType.MOTE_TYPE||C.type===VeilarbAktivitetType.SAMTALEREFERAT_TYPE?jsxRuntimeExports.jsx(ReferatContainer,{aktivitet:C}):null,jsxRuntimeExports.jsx(AktivitetvisningAccordion,{aktivitet:C})]})},DIALOG_TEKST="Alle endringer blir borte hvis du ikke lagrer. Er du sikker på at du vil lukke siden?",emptySelector=()=>[],AktivitetvisningModal=T=>{const{aktivitet:C,avhengigheter:$,children:V}=T,K=reactExports.useContext(DirtyContext),Y=useNavigate(),{hovedsideRoute:J}=useRoutes(),re=()=>Y(J()),te=C===void 0?emptySelector:(he=>isArenaAktivitet(he)?selectArenaFeilmeldinger:selectAktivitetFeilmeldinger)(C),se=useSelector(te,shallowEqual$1),ie=useSelector(selectNivaa4Feilmeldinger,shallowEqual$1),ae=useSelector(selectDialogFeilmeldinger,shallowEqual$1),oe=[...se,...ae,...ie],le=useSelector(selectErBruker),ce=C==null?void 0:C.forhaandsorientering,de=skalMarkereForhaandsorienteringSomLest(le,C);return jsxRuntimeExports.jsx(Modal,{onClose:re,avhengigheter:$,subHeading:C?`${aktivitetStatusMap[C.status]} / ${getAktivitetType(C)}`:void 0,heading:(C==null?void 0:C.tittel)||"",onRequestClose:()=>K.isDirty&&!window.confirm(DIALOG_TEKST)?!1:de&&ce?(window.alert("Det er en viktig beskjed om ansvaret ditt som du må lese."),!1):(Y(J()),!0),feilmeldinger:oe,children:V})},selectAvhengigheter=createSelector(selectOppfolgingStatus,selectAktivitetStatus,(T,C)=>[T,C]),AktivitetvisningContainer=()=>{const{id:T}=useParams(),C=T,$=useAppDispatch(),V=useErVeileder(),K=useSelector(se=>C?selectAktivitetMedId(se,C):void 0),J=useSelector(se=>K?isArenaAktivitet(K)?selectArenaAktivitetStatus(se):selectAktivitetStatus(se):Status.NOT_STARTED)!==Status.OK,re=useSelector(selectAvhengigheter),ne=kanEndreAktivitetDetaljer(K,V),te=useSelector(selectErUnderOppfolging);return reactExports.useEffect(()=>(K&&(isArenaAktivitet(K)?$(hentArenaAktiviteter()):$(hentAktivitet(K.id))),()=>{const se=K&&document.querySelector(`#${prefixAktivtetskortId(K)}`);se&&(se==null||se.focus())}),[]),jsxRuntimeExports.jsx(DirtyProvider,{children:jsxRuntimeExports.jsx(AktivitetvisningModal,{aktivitet:K,avhengigheter:re,children:K?jsxRuntimeExports.jsx(Aktivitetvisning,{aktivitet:K,tillatEndring:ne,underOppfolging:te,laster:J}):jsxRuntimeExports.jsx(Navigate,{replace:!0,to:"/"})})})},Malvisning=T=>{const{onClick:C}=T,$=useSelector(selectGjeldendeMal,shallowEqual$1),V=useSelector(selectMalListe,shallowEqual$1),K=useSelector(selectViserHistoriskPeriode,shallowEqual$1),Y=useSelector(selectHarSkriveTilgang,shallowEqual$1),J=useSelector(selectErUnderOppfolging,shallowEqual$1),re=$&&$.mal,ne=K&&V.length===0||!re?"Det ble ikke skrevet mål i denne perioden":re;return jsxRuntimeExports.jsxs("div",{className:"mb-8",children:[jsxRuntimeExports.jsx(BodyLong$1,{className:"mb-8",children:ne}),jsxRuntimeExports.jsx(HiddenIfHovedknapp,{onClick:C,hidden:K,disabled:!Y||!J,children:"Rediger"})]})},schema$2=z$1.object({mal:z$1.string().min(1,"Feltet må fylles ut").max(500,"Du må korte ned teksten til 500 tegn")}),MalForm=T=>{const{mal:C,dirtyRef:$,handleComplete:V}=T,K=useAppDispatch(),Y=reactExports.useRef(null);reactExports.useLayoutEffect(()=>{const ce=Y.current;ce&&(ce==null||ce.focus(),ce.selectionStart=ce.selectionEnd=ce.value.length)},[]);const J=ce=>{ce.mal!==T.mal?K(oppdaterMal({mal:ce.mal})).then(he=>{isFulfilled(he)&&K(hentMalListe()).then(()=>V())}):V();const de=document.querySelector(".aktivitet-modal");return de&&(de==null||de.focus()),Promise.resolve()},re={mal:C||""},{register:ne,handleSubmit:te,watch:se,formState:{errors:ie,isDirty:ae}}=useForm({defaultValues:re,resolver:t(schema$2),shouldFocusError:!0});$&&($.current=ae);const oe=se("mal"),le=useSelector(selectOppdaterMalFeil);return jsxRuntimeExports.jsxs("form",{className:"my-4 space-y-8",onSubmit:te(ce=>J(ce)),children:[jsxRuntimeExports.jsx(Textarea$1,{label:"Mitt mål (obligatorisk)",maxLength:500,"aria-label":"Mitt mål",...ne("mal"),error:ie.mal&&ie.mal.message,value:oe}),jsxRuntimeExports.jsx(Feilmelding,{feilmeldinger:le}),jsxRuntimeExports.jsx(Button$1,{onClick:()=>logKlikkKnapp("Lagre mål"),children:"Lagre"})]})},MalContainer=T=>{const C=useSelector(selectViserHistoriskPeriode,shallowEqual$1),$=useSelector(selectGjeldendeMal,shallowEqual$1),V=useSelector(selectErUnderOppfolging,shallowEqual$1),K=useErVeileder(),Y=useSelector(selectHarSkriveTilgang,shallowEqual$1),J=$&&$.mal,[re,ne]=reactExports.useState(!C&&!J&&V&&Y);return re?jsxRuntimeExports.jsx(MalForm,{mal:J,dirtyRef:T.dirtyRef,handleComplete:()=>{ne(!1),T.dirtyRef.current=!1,loggMittMalLagre(K)}}):jsxRuntimeExports.jsx(Malvisning,{onClick:()=>ne(!0)})},identitetMap=(T,C)=>T?C==="BRUKER"?"bruker":"NAV":C==="BRUKER"?"deg":"NAV";function malListeVisning(T,C){return jsxRuntimeExports.jsxs("article",{children:[jsxRuntimeExports.jsxs("span",{className:"font-bold",children:[T.mal?"Skrevet av ":"Mål slettet av ",jsxRuntimeExports.jsx("span",{children:identitetMap(C,T.endretAv)})]}),` ${formaterDatoEllerTidSiden(T.dato)}`,jsxRuntimeExports.jsx(CustomBodyLong,{formatLinebreaks:!0,formatLinks:!0,children:T.mal})]},T.dato)}const MalHistorikk=()=>{const T=useSelector(selectMalListe,shallowEqual$1),C=useErVeileder();return T.length===0?null:jsxRuntimeExports.jsx(Accordion$1,{children:jsxRuntimeExports.jsxs(Accordion$1.Item,{children:[jsxRuntimeExports.jsx(Accordion$1.Header,{children:jsxRuntimeExports.jsx(Heading,{level:"2",size:"small",children:"Tidligere lagrede mål"})}),jsxRuntimeExports.jsx(Accordion$1.Content,{children:T.map($=>malListeVisning($,C))})]})})};function MalModal(T){const{children:C,heading:$}=T,V=useSelector(selectHentMalListeFeil),K=useNavigate(),{hovedsideRoute:Y}=useRoutes(),J=()=>K(Y());return jsxRuntimeExports.jsx(Modal,{onClose:J,onRequestClose:T.onRequestClosed,feilmeldinger:V,heading:$,children:C})}const Mal=()=>{const T=useSelector(selectMalStatus,shallowEqual$1),C=useSelector(selectMalListeStatus,shallowEqual$1),$=useSelector(selectViserHistoriskPeriode,shallowEqual$1),V=useSelector(selectErUnderOppfolging,shallowEqual$1),K=useSelector(selectHarSkriveTilgang,shallowEqual$1),Y=useSelector(selectMalListe,shallowEqual$1),J=reactExports.useRef(!1),re=useAppDispatch(),ne=useNavigate(),{hovedsideRoute:te}=useRoutes();reactExports.useEffect(()=>{re(hentMal()),re(hentMalListe())},[]);const se=[T,C],ie=()=>!J.current||window.confirm(CONFIRM)?(ne(te()),!0):!1;return jsxRuntimeExports.jsx(MalModal,{onRequestClosed:ie,heading:$||!V||!K?"Mitt mål fra en tidligere periode":"Mitt mål",children:jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs(ReadMore$1,{className:"mb-8",header:"Tips til mål",defaultOpen:Y.length===0,children:["Skriv noen ord om hva som er målet ditt slik at vi kan veilede deg bedre.",jsxRuntimeExports.jsxs("ul",{className:"list-disc mt-4 pl-8",children:[jsxRuntimeExports.jsx("li",{children:"Hva er målet på kort sikt? Hva er målet på lengre sikt?"}),jsxRuntimeExports.jsx("li",{children:"Hva slags arbeidsoppgaver ønsker du deg?"})]})]}),jsxRuntimeExports.jsx(Innholdslaster,{className:"flex m-auto",avhengigheter:se,alleOK:!0,children:jsxRuntimeExports.jsxs("section",{children:[jsxRuntimeExports.jsx(MalContainer,{dirtyRef:J}),jsxRuntimeExports.jsx(MalHistorikk,{})]})})]})})};function PrintVerktoylinje(T){const{avhengigheter:C,tilbakeRoute:$,kanSkriveUt:V}=T;return jsxRuntimeExports.jsxs(Innholdslaster,{avhengigheter:C,children:[jsxRuntimeExports.jsx(Heading,{className:"print:hidden",spacing:!0,size:"large",children:"Skriv ut aktivitetsplanen"}),jsxRuntimeExports.jsxs("div",{className:"print:hidden self-start flex flex-row gap-x-10 mb-8 items-center",children:[$?jsxRuntimeExports.jsx(Link$2,{className:"text-text-action underline hover:no-underline",to:$,tabIndex:0,children:"Tilbake"}):null,V?jsxRuntimeExports.jsx(Button$1,{icon:jsxRuntimeExports.jsx(PrinterSmallIcon,{}),onClick:()=>{window.print(),loggEvent(TRYK_PRINT),logKlikkKnapp("Skriv ut")},children:"Skriv ut"}):null,jsxRuntimeExports.jsx(Filter,{})]}),jsxRuntimeExports.jsx("div",{className:"print:hidden mb-8",children:jsxRuntimeExports.jsx(VisValgtFilter,{})})]})}function StoreForbokstaver(T){const{tag:C,children:$}=T;return React.createElement(C||"span",null,storeForbokstaver($))}const logoPngImagePath="/aktivitetsplan/assets/logo-11aZUo8k.png";function Adresse({adresse:T}){const C=T.adresselinje1;return C?jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(StoreForbokstaver,{tag:"div",children:`${C}`}),T.adresselinje2&&jsxRuntimeExports.jsx(StoreForbokstaver,{tag:"div",children:`${T.adresselinje2}`}),T.adresselinje3&&jsxRuntimeExports.jsx(StoreForbokstaver,{tag:"div",children:`${T.adresselinje3}`}),T.postnummer&&T.poststed&&jsxRuntimeExports.jsx(StoreForbokstaver,{tag:"div",children:`${T.postnummer} ${T.poststed}`}),T.land&&T.type!=="NORSKPOSTADRESSE"&&jsxRuntimeExports.jsx(StoreForbokstaver,{tag:"div",children:`${T.land}`})]}):jsxRuntimeExports.jsx("div",{})}function avsender(T,C){return T==="VEILEDER"?C||"NAV":"BRUKER"}function Tittel(T){const C=T.dialog;return C.aktivitetId?jsxRuntimeExports.jsx(Heading,{level:"2",size:"medium",className:"printmodal-body__statusgruppe--overskrift",children:"Dialog"}):jsxRuntimeExports.jsx(Heading,{level:"2",size:"small",className:"printmodal-body__statusgruppe--overskrift",children:C.overskrift})}function DialogPrint(T){const{dialog:C}=T;if(!C)return jsxRuntimeExports.jsx("div",{});const{henvendelser:$}=C,V=$&&[...$].sort((K,Y)=>datoComparator(K.sendt,Y.sendt));return jsxRuntimeExports.jsxs("div",{hidden:!V,className:"mt-4 pt-4 border-t border-border-divider",children:[jsxRuntimeExports.jsx(Tittel,{dialog:C}),V&&V.map(K=>jsxRuntimeExports.jsxs("div",{className:"my-4",children:[jsxRuntimeExports.jsx(Label,{className:"",children:`${avsender(K.avsender,K.avsenderId)} - ${formaterDatoKortManed(K.sendt)}`}),jsxRuntimeExports.jsx(CustomBodyLong,{formatLinebreaks:!0,formatLinks:!0,children:K.tekst})]},K.id))]})}function DialogerUtenAktivitet(T){const{dialoger:C}=T,$=C&&C.filter(K=>K.aktivitetId===null);if(!$||$.length===0)return null;const V=$.sort((K,Y)=>datoComparator(K.opprettetDato,Y.opprettetDato));return jsxRuntimeExports.jsxs("section",{className:"mt-10",children:[jsxRuntimeExports.jsx(Heading,{level:"1",size:"large",className:"mb-2",children:"Dialogen med veileder"}),V.map(K=>jsxRuntimeExports.jsx(DialogPrint,{dialog:K},K.id))]})}const AktivitetReferat=T=>{const{referat:C,erReferatPublisert:$,historisk:V}=T.aktivitet,Y=$&&(!!C||!V);return jsxRuntimeExports.jsx(div$1,{hidden:!Y,className:"printmodal-body__aktivitetreferat",children:jsxRuntimeExports.jsx(Informasjonsfelt,{tittel:"Samtalereferat",innhold:C,formattertTekst:!0},"referat")})},forhaandsorientering="_forhaandsorientering_bkwf6_1",lestTekst="_lestTekst_bkwf6_4",tittel="_tittel_bkwf6_7",styles={forhaandsorientering,lestTekst,tittel},ForhaandsorienteringPrint=T=>{const{forhaandsorienteringTekst:C,forhaandsorienteringLest:$}=T;return C?jsxRuntimeExports.jsxs("div",{className:"mt-8",children:[jsxRuntimeExports.jsx(Heading,{level:"2",size:"xsmall",children:"Informasjon om ansvaret ditt"}),jsxRuntimeExports.jsx(CustomBodyLong,{className:styles.forhaandsorientering,children:C}),$&&jsxRuntimeExports.jsxs(BodyShort,{size:"small",className:styles.lestTekst,children:["Lest ",formaterDatoManed($)]})]}):null},AktivitetPrint=T=>{const{aktivitet:C,dialog:$}=T,{id:V,tittel:K}=C,Y=C.forhaandsorientering;return jsxRuntimeExports.jsxs("div",{className:"p-4 border border-border-default rounded-md print:break-inside-avoid-page",children:[jsxRuntimeExports.jsx(Detail,{className:"uppercase",children:getAktivitetType(C)}),jsxRuntimeExports.jsx(Heading,{level:"2",size:"medium",className:"mb-4",children:K}),jsxRuntimeExports.jsx(Aktivitetsdetaljer,{valgtAktivitet:C}),C.type===VeilarbAktivitetType.MOTE_TYPE||C.type===VeilarbAktivitetType.SAMTALEREFERAT_TYPE?jsxRuntimeExports.jsx(AktivitetReferat,{aktivitet:C}):null,jsxRuntimeExports.jsx(AvtaltMarkering,{hidden:!C.avtalt}),jsxRuntimeExports.jsx(ForhaandsorienteringPrint,{forhaandsorienteringTekst:Y==null?void 0:Y.tekst,forhaandsorienteringLest:Y==null?void 0:Y.lestDato}),C.type===STILLING_AKTIVITET_TYPE?jsxRuntimeExports.jsx(StillingEtikett,{aktivitet:C}):null,isArenaAktivitet(C)?jsxRuntimeExports.jsx(TiltakEtikett,{aktivitet:C}):null,jsxRuntimeExports.jsx(DialogPrint,{dialog:$})]},V)},Gruppe=T=>{const{tittel:C,aktiviteter:$,dialoger:V}=T;if(!$)return null;const K=[...$].sort(compareAktivitet);return jsxRuntimeExports.jsxs("section",{className:"mt-12",children:[jsxRuntimeExports.jsx(Heading,{level:"1",size:"large",className:"mb-2",children:C}),jsxRuntimeExports.jsx("div",{className:"space-y-4",children:K.map(Y=>{const J=V&&V.find(re=>re.aktivitetId===Y.id);return jsxRuntimeExports.jsx(AktivitetPrint,{aktivitet:Y,dialog:J},Y.id)})})]})},Aktiviteter=T=>{const{aktiviteter:C,dialoger:$}=T;if(!C)return null;const V=C.reduce((K,Y)=>{const J=K[Y.status];return J?J.push(Y):K[Y.status]=[Y],K},{});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Gruppe,{tittel:"Aktiviteter jeg gjennomfører nå",aktiviteter:V[AktivitetStatus.GJENNOMFOERT],dialoger:$}),jsxRuntimeExports.jsx(Gruppe,{tittel:"Planlagte aktiviteter",aktiviteter:V[AktivitetStatus.PLANLAGT],dialoger:$}),jsxRuntimeExports.jsx(Gruppe,{tittel:"Forslag til aktiviteter",aktiviteter:V[AktivitetStatus.BRUKER_ER_INTRESSERT],dialoger:$}),jsxRuntimeExports.jsx(Gruppe,{tittel:"Fullførte aktiviteter",aktiviteter:V[AktivitetStatus.FULLFOERT],dialoger:$}),jsxRuntimeExports.jsx(Gruppe,{tittel:"Avbrutte aktiviteter",aktiviteter:V[AktivitetStatus.AVBRUTT],dialoger:$})]})};function aktivitetIKvpPeriode(T,C){const $=new Date(T.opprettetDato),V=new Date(C.opprettetDato);return isAfter($,V)&&(!C.avsluttetDato||isBefore($,new Date(C.avsluttetDato)))}function aktivitetUtenforKvp(T,C){return C.every($=>!aktivitetIKvpPeriode(T,$))}function filtrerAktiviteter(T,C,$,V){if(V)return $?V.filter(K=>aktivitetIKvpPeriode(K,$)):T==="aktivitetsplan"&&C?V.filter(K=>aktivitetUtenforKvp(K,C)):V}function dialogIKvpPeriode(T,C){const $=new Date(T.sisteDato),V=new Date(C.opprettetDato),K=new Date(T.opprettetDato);return isBefore($,V)?!1:!C.avsluttetDato||isBefore(K,new Date(C.avsluttetDato))}function dialogUtenforKvp(T,C){return C.every($=>!dialogIKvpPeriode(T,$))}function filtrerDialoger(T,C,$,V){if(!(!V||!T))return $?V.filter(K=>dialogIKvpPeriode(K,$)):T==="aktivitetsplan"&&C?V.filter(K=>dialogUtenforKvp(K,C)):V}function MalPrint(T){const C=T.mittMal&&T.mittMal.mal;return C?jsxRuntimeExports.jsxs("section",{className:"my-8",children:[jsxRuntimeExports.jsx(Heading,{level:"1",size:"large",children:"Mitt mål"}),jsxRuntimeExports.jsx(BodyShort,{children:C})]}):null}function Print(T){const{aktiviteter:C,bruker:$,adresse:V,printMelding:K,mittMal:Y,erVeileder:J,dialoger:re,utskriftPlanType:ne,kvpPerioder:te,hidden:se}=T,{fodselsnummer:ie,fornavn:ae,etternavn:oe,geografiskEnhet:le}=$,ce=le&&le.navn,de=ne!==void 0&&ne!=="helePlanen"&&ne!=="aktivitetsplan",he=te&&te.find(Pe=>Pe.opprettetDato===ne),me=filtrerAktiviteter(ne,te,he,C),ge=filtrerDialoger(ne,te,he,re),ye=he?formaterDatoKortManed(he.opprettetDato):void 0,fe=he?formaterDatoKortManed(he.avsluttetDato):void 0,Te=new URL(logoPngImagePath,import.meta.url).href;return jsxRuntimeExports.jsxs("div",{id:"printarea",className:"printmodal-body w-[670px]",hidden:se,children:[jsxRuntimeExports.jsx("img",{className:"my-8",src:Te,alt:"Logo NAV"}),jsxRuntimeExports.jsxs("div",{className:"flex justify-between mb-8",children:[jsxRuntimeExports.jsx("div",{className:"",children:jsxRuntimeExports.jsxs(div$1,{hidden:!J,children:[jsxRuntimeExports.jsx(StoreForbokstaver,{children:`${ae} ${oe}`}),V&&jsxRuntimeExports.jsx(Adresse,{adresse:V})]})}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(div$1,{hidden:!J,children:ce}),"Dato: ",formaterDatoKortManed(Date.now()),jsxRuntimeExports.jsxs(div$1,{hidden:!ie,children:["Fødselsnummer:",` ${ie}`]}),jsxRuntimeExports.jsx(div$1,{hidden:!de,children:"Modia Arbeidsrettet Oppfølging"}),jsxRuntimeExports.jsxs(div$1,{hidden:!de,children:["Periode: ",ye," - ",fe]})]})]}),jsxRuntimeExports.jsx(Heading,{level:"1",size:"xlarge",children:"Aktivitetsplan"}),jsxRuntimeExports.jsx(section,{hidden:K==="",children:jsxRuntimeExports.jsx("p",{children:K})}),jsxRuntimeExports.jsx(MalPrint,{mittMal:Y}),jsxRuntimeExports.jsx(Aktiviteter,{aktiviteter:me,dialoger:ge}),jsxRuntimeExports.jsx(DialogerUtenAktivitet,{dialoger:ge})]})}const defaultBeskrivelse="Her finner du avtalte aktiviteter med NAV som du skal gjennomføre for å nå målet ditt. Gi beskjed til NAV hvis det skjer endringer i situasjonen din eller hvis du ikke kan gjennomføre en aktivitet.",schema$1=z$1.object({beskrivelse:z$1.string().max(2e3,"Du må korte ned teksten til 2000 tegn")}),PrintMeldingForm=T=>{const{onSubmit:C}=T,$={beskrivelse:defaultBeskrivelse},{register:V,handleSubmit:K,watch:Y,formState:{errors:J}}=useForm({defaultValues:$,resolver:t(schema$1),shouldFocusError:!0}),re=te=>C(te),ne=Y("beskrivelse");return jsxRuntimeExports.jsxs("form",{onSubmit:K(te=>re(te)),className:"space-y-8",children:[jsxRuntimeExports.jsx("div",{className:"space-y-8",children:jsxRuntimeExports.jsx(Textarea$1,{label:"Rediger teksten under så den passer til brukeren.",maxLength:2e3,...V("beskrivelse"),value:ne,error:J.beskrivelse&&J.beskrivelse.message})}),jsxRuntimeExports.jsx(Button$1,{children:"Velg"})]})},UtskriftValg=({tittelId:T,tekstId:C})=>jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(Heading,{level:"2",size:"small",children:T}),jsxRuntimeExports.jsx(BodyShort,{children:C})]}),KvpPlanValg=T=>{const{kvpPerioder:C}=T;return C?C.length===1?jsxRuntimeExports.jsx(KvpPlanSingelValgRadio,{kvpPeriode:C[0]}):jsxRuntimeExports.jsx(KvpPlanListeValg,{kvpPerioder:C}):null},KvpPlanSingelValgRadio=({kvpPeriode:T})=>jsxRuntimeExports.jsx(Radio,{value:T.opprettetDato,disabled:!T.avsluttetDato,children:jsxRuntimeExports.jsx(UtskriftValg,{tittelId:"KVP-perioden",tekstId:"Du skriver ut innholdet i KVP-perioden"})}),KvpPlanListeValg=T=>{const{kvpPerioder:C}=T;return jsxRuntimeExports.jsxs("div",{className:"",children:[jsxRuntimeExports.jsx(UtskriftValg,{tittelId:"KVP-perioden",tekstId:"Du skriver ut innholdet i KVP-perioden"}),C&&C.map($=>jsxRuntimeExports.jsx(Radio,{className:"pt-2",value:$.opprettetDato,disabled:!$.avsluttetDato,children:jsxRuntimeExports.jsx(BodyShort,{children:`${formaterDatoKortManed($.opprettetDato)} - ${$.avsluttetDato?formaterDatoKortManed($.avsluttetDato):"nå"}`})},$.opprettetDato))]})},schema=z$1.object({utskritPlanType:z$1.string()}),VelgPlanUtskriftForm=T=>{const{kvpPerioder:C,onSubmit:$}=T,V={utskritPlanType:"helePlanen"},{handleSubmit:K,setValue:Y}=useForm({defaultValues:V,resolver:t(schema)}),J=re=>{Y("utskritPlanType",re)};return jsxRuntimeExports.jsxs("form",{onSubmit:K(re=>$(re)),className:"space-y-8",children:[jsxRuntimeExports.jsxs(RadioGroup,{legend:"Velg hva du ønsker å skrive ut",hideLegend:!0,defaultValue:"helePlanen",onChange:J,children:[jsxRuntimeExports.jsx(Radio,{value:"helePlanen",id:"id--helePlanen",children:jsxRuntimeExports.jsx(UtskriftValg,{tittelId:"Hele oppfølgingsperioden",tekstId:"Du skriver ut alt innholdet du ser i aktivitetsplan, også KVP-perioden"})}),jsxRuntimeExports.jsx(Radio,{value:"aktivitetsplan",id:"id--aktivitetsplan",children:jsxRuntimeExports.jsx(UtskriftValg,{tittelId:"Oppfølgingsperioden uten KVP-perioden",tekstId:"Du skriver ut alt innholdet du ser i aktivitetsplan, uten om KVP-perioden"})}),jsxRuntimeExports.jsx(KvpPlanValg,{kvpPerioder:C})]}),jsxRuntimeExports.jsx(Button$1,{children:"Velg"})]})},STEP_VELG_PLAN="VELG_PLAN",STEP_MELDING_FORM="MELDING_FORM",STEP_UTSKRIFT="UTSKRIFT";function getSteps(T,C){const $=[];return T&&$.push(STEP_VELG_PLAN),C&&$.push(STEP_MELDING_FORM),$.push(STEP_UTSKRIFT),$}const AktivitetsplanPrint=()=>{const T=useSelector(selectAktivitetListe),C=useSelector(selectKvpPeriodeForValgteOppfolging),$=useSelector(selectDialoger),V=useSelector(selectGjeldendeMal),K=useSelector(selectErBrukerManuell),{hovedsideRoute:Y}=useRoutes(),J=[useSelector(selectMalStatus),useSelector(selectOppfolgingStatus),useSelector(selectAktivitetListeStatus),useSelector(selectDialogStatus)],re=useAppDispatch(),ne=useErVeileder();reactExports.useEffect(()=>{re(hentMal()),re(hentMalListe()),loggEvent(PRINT_MODAL_OPEN)},[]);const te=useFnr(),[se,ie]=reactExports.useState(null),[ae,oe]=reactExports.useState({}),[le,ce]=reactExports.useState(!0),[de,he]=reactExports.useState(!0);reactExports.useEffect(()=>{te&&(hentPerson(te).then(at=>oe(at)).finally(()=>he(!1)),hentAdresse(te).then(at=>ie(at==null?void 0:at.adresse)).finally(()=>ce(!1)))},[te]);const[me,ge]=reactExports.useState(0),[ye,fe]=reactExports.useState(""),[Te,Pe]=reactExports.useState("helePlanen"),De=()=>ge(me+1),xe=at=>(fe(at.beskrivelse),De(),Promise.resolve()),Ce=at=>(Pe(at.utskritPlanType),De(),Promise.resolve()),je=C&&C.length>0&&ne,Ke=getSteps(je,K&&ne),Se=useNavigate(),Ie=()=>Se(-1);if(te&&(le||de))return jsxRuntimeExports.jsx(Loader,{});const pt=(()=>{if(Ke[me]===STEP_MELDING_FORM)return jsxRuntimeExports.jsx(Modal$1,{closeOnBackdropClick:!0,onClose:Ie,open:!0,header:{heading:`Aktivitetsplan for ${ae.fornavn}`,closeButton:!0},children:jsxRuntimeExports.jsx(Innholdslaster,{avhengigheter:J,children:jsxRuntimeExports.jsx(PrintMeldingForm,{bruker:ae,onSubmit:xe})})});if(Ke[me]===STEP_VELG_PLAN)return jsxRuntimeExports.jsx(Modal$1,{onClose:Ie,open:!0,header:{heading:"Velg hva du ønsker å skrive ut",closeButton:!0},children:jsxRuntimeExports.jsx(Modal$1.Body,{children:jsxRuntimeExports.jsx(Innholdslaster,{avhengigheter:J,children:jsxRuntimeExports.jsx(VelgPlanUtskriftForm,{kvpPerioder:C,onSubmit:Ce})})})})})();return jsxRuntimeExports.jsx("section",{className:"flex flex-col justify-center items-center p-8",children:jsxRuntimeExports.jsxs("div",{className:"aktivitetsplanprint flex justify-center items-center",children:[pt,jsxRuntimeExports.jsx(PrintVerktoylinje,{avhengigheter:J,tilbakeRoute:Y(),kanSkriveUt:Ke[me]===STEP_UTSKRIFT}),jsxRuntimeExports.jsx(Innholdslaster,{avhengigheter:J,children:jsxRuntimeExports.jsx("div",{className:"border px-12 print:border-none",children:jsxRuntimeExports.jsx(Print,{dialoger:$,bruker:ae,adresse:se,printMelding:ye,aktiviteter:T,mittMal:V,erVeileder:ne,utskriftPlanType:Te,kvpPerioder:C})})})]})})};function commonjsRequire(T){throw new Error('Could not dynamically require "'+T+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var pdf$1={exports:{}};const __viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"})),require$$5=getAugmentedNamespace(__viteBrowserExternal$1);(function(module,exports){(function(C,$){module.exports=C.pdfjsLib=$()})(globalThis,()=>(()=>{var __webpack_modules__=[,(T,C)=>{var cr;Object.defineProperty(C,"__esModule",{value:!0}),C.VerbosityLevel=C.Util=C.UnknownErrorException=C.UnexpectedResponseException=C.TextRenderingMode=C.RenderingIntentFlag=C.PromiseCapability=C.PermissionFlag=C.PasswordResponses=C.PasswordException=C.PageActionEventType=C.OPS=C.MissingPDFException=C.MAX_IMAGE_SIZE_TO_CACHE=C.LINE_FACTOR=C.LINE_DESCENT_FACTOR=C.InvalidPDFException=C.ImageKind=C.IDENTITY_MATRIX=C.FormatError=C.FeatureTest=C.FONT_IDENTITY_MATRIX=C.DocumentActionEventType=C.CMapCompressionType=C.BaseException=C.BASELINE_FACTOR=C.AnnotationType=C.AnnotationReplyType=C.AnnotationPrefix=C.AnnotationMode=C.AnnotationFlag=C.AnnotationFieldFlag=C.AnnotationEditorType=C.AnnotationEditorPrefix=C.AnnotationEditorParamsType=C.AnnotationBorderStyleType=C.AnnotationActionEventType=C.AbortException=void 0,C.assert=dt,C.bytesToString=ct,C.createValidAbsoluteUrl=ut,C.getModificationDate=Bt,C.getUuid=ar,C.getVerbosityLevel=Ie,C.info=Ne,C.isArrayBuffer=jt,C.isArrayEqual=Vt,C.isNodeJS=void 0,C.normalizeUnicode=dr,C.objectFromMap=$t,C.objectSize=Pt,C.setVerbosityLevel=Se,C.shadow=bt,C.string32=Tt,C.stringToBytes=xt,C.stringToPDFString=Rt,C.stringToUTF8String=mt,C.unreachable=at,C.utf8StringToString=ht,C.warn=pt;const $=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser");C.isNodeJS=$;const V=[1,0,0,1,0,0];C.IDENTITY_MATRIX=V;const K=[.001,0,0,.001,0,0];C.FONT_IDENTITY_MATRIX=K;const Y=1e7;C.MAX_IMAGE_SIZE_TO_CACHE=Y;const J=1.35;C.LINE_FACTOR=J;const re=.35;C.LINE_DESCENT_FACTOR=re;const ne=re/J;C.BASELINE_FACTOR=ne;const te={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,OPLIST:256};C.RenderingIntentFlag=te;const se={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3};C.AnnotationMode=se;const ie="pdfjs_internal_editor_";C.AnnotationEditorPrefix=ie;const ae={DISABLE:-1,NONE:0,FREETEXT:3,STAMP:13,INK:15};C.AnnotationEditorType=ae;const oe={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23};C.AnnotationEditorParamsType=oe;const le={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048};C.PermissionFlag=le;const ce={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4};C.TextRenderingMode=ce;const de={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3};C.ImageKind=de;const he={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};C.AnnotationType=he;const me={GROUP:"Group",REPLY:"R"};C.AnnotationReplyType=me;const ge={INVISIBLE:1,HIDDEN:2,PRINT:4,NOZOOM:8,NOROTATE:16,NOVIEW:32,READONLY:64,LOCKED:128,TOGGLENOVIEW:256,LOCKEDCONTENTS:512};C.AnnotationFlag=ge;const ye={READONLY:1,REQUIRED:2,NOEXPORT:4,MULTILINE:4096,PASSWORD:8192,NOTOGGLETOOFF:16384,RADIO:32768,PUSHBUTTON:65536,COMBO:131072,EDIT:262144,SORT:524288,FILESELECT:1048576,MULTISELECT:2097152,DONOTSPELLCHECK:4194304,DONOTSCROLL:8388608,COMB:16777216,RICHTEXT:33554432,RADIOSINUNISON:33554432,COMMITONSELCHANGE:67108864};C.AnnotationFieldFlag=ye;const fe={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};C.AnnotationBorderStyleType=fe;const Te={E:"Mouse Enter",X:"Mouse Exit",D:"Mouse Down",U:"Mouse Up",Fo:"Focus",Bl:"Blur",PO:"PageOpen",PC:"PageClose",PV:"PageVisible",PI:"PageInvisible",K:"Keystroke",F:"Format",V:"Validate",C:"Calculate"};C.AnnotationActionEventType=Te;const Pe={WC:"WillClose",WS:"WillSave",DS:"DidSave",WP:"WillPrint",DP:"DidPrint"};C.DocumentActionEventType=Pe;const De={O:"PageOpen",C:"PageClose"};C.PageActionEventType=De;const xe={ERRORS:0,WARNINGS:1,INFOS:5};C.VerbosityLevel=xe;const Ce={NONE:0,BINARY:1};C.CMapCompressionType=Ce;const je={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91};C.OPS=je;const Le={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};C.PasswordResponses=Le;let Ke=xe.WARNINGS;function Se(Lt){Number.isInteger(Lt)&&(Ke=Lt)}function Ie(){return Ke}function Ne(Lt){Ke>=xe.INFOS&&console.log(`Info: ${Lt}`)}function pt(Lt){Ke>=xe.WARNINGS&&console.log(`Warning: ${Lt}`)}function at(Lt){throw new Error(Lt)}function dt(Lt,It){Lt||at(It)}function Ct(Lt){switch(Lt==null?void 0:Lt.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function ut(Lt,It=null,St=null){if(!Lt)return null;try{if(St&&typeof Lt=="string"){if(St.addDefaultProtocol&&Lt.startsWith("www.")){const Kt=Lt.match(/\./g);(Kt==null?void 0:Kt.length)>=2&&(Lt=`http://${Lt}`)}if(St.tryConvertEncoding)try{Lt=mt(Lt)}catch{}}const Ht=It?new URL(Lt,It):new URL(Lt);if(Ct(Ht))return Ht}catch{}return null}function bt(Lt,It,St,Ht=!1){return Object.defineProperty(Lt,It,{value:St,enumerable:!Ht,configurable:!0,writable:!1}),St}const Re=function(){function It(St,Ht){this.constructor===It&&at("Cannot initialize BaseException."),this.message=St,this.name=Ht}return It.prototype=new Error,It.constructor=It,It}();C.BaseException=Re;class ue extends Re{constructor(It,St){super(It,"PasswordException"),this.code=St}}C.PasswordException=ue;class be extends Re{constructor(It,St){super(It,"UnknownErrorException"),this.details=St}}C.UnknownErrorException=be;class ve extends Re{constructor(It){super(It,"InvalidPDFException")}}C.InvalidPDFException=ve;class we extends Re{constructor(It){super(It,"MissingPDFException")}}C.MissingPDFException=we;class _e extends Re{constructor(It,St){super(It,"UnexpectedResponseException"),this.status=St}}C.UnexpectedResponseException=_e;class Oe extends Re{constructor(It){super(It,"FormatError")}}C.FormatError=Oe;class Qe extends Re{constructor(It){super(It,"AbortException")}}C.AbortException=Qe;function ct(Lt){(typeof Lt!="object"||(Lt==null?void 0:Lt.length)===void 0)&&at("Invalid argument for bytesToString");const It=Lt.length,St=8192;if(It>24&255,Lt>>16&255,Lt>>8&255,Lt&255)}function Pt(Lt){return Object.keys(Lt).length}function $t(Lt){const It=Object.create(null);for(const[St,Ht]of Lt)It[St]=Ht;return It}function Ft(){const Lt=new Uint8Array(4);return Lt[0]=1,new Uint32Array(Lt.buffer,0,1)[0]===1}function Nt(){try{return new Function(""),!0}catch{return!1}}class Gt{static get isLittleEndian(){return bt(this,"isLittleEndian",Ft())}static get isEvalSupported(){return bt(this,"isEvalSupported",Nt())}static get isOffscreenCanvasSupported(){return bt(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator>"u"?bt(this,"platform",{isWin:!1,isMac:!1}):bt(this,"platform",{isWin:navigator.platform.includes("Win"),isMac:navigator.platform.includes("Mac")})}static get isCSSRoundSupported(){var It,St;return bt(this,"isCSSRoundSupported",(St=(It=globalThis.CSS)==null?void 0:It.supports)==null?void 0:St.call(It,"width: round(1.5px, 1px)"))}}C.FeatureTest=Gt;const ft=[...Array(256).keys()].map(Lt=>Lt.toString(16).padStart(2,"0"));class yt{static makeHexColor(It,St,Ht){return`#${ft[It]}${ft[St]}${ft[Ht]}`}static scaleMinMax(It,St){let Ht;It[0]?(It[0]<0&&(Ht=St[0],St[0]=St[1],St[1]=Ht),St[0]*=It[0],St[1]*=It[0],It[3]<0&&(Ht=St[2],St[2]=St[3],St[3]=Ht),St[2]*=It[3],St[3]*=It[3]):(Ht=St[0],St[0]=St[2],St[2]=Ht,Ht=St[1],St[1]=St[3],St[3]=Ht,It[1]<0&&(Ht=St[2],St[2]=St[3],St[3]=Ht),St[2]*=It[1],St[3]*=It[1],It[2]<0&&(Ht=St[0],St[0]=St[1],St[1]=Ht),St[0]*=It[2],St[1]*=It[2]),St[0]+=It[4],St[1]+=It[4],St[2]+=It[5],St[3]+=It[5]}static transform(It,St){return[It[0]*St[0]+It[2]*St[1],It[1]*St[0]+It[3]*St[1],It[0]*St[2]+It[2]*St[3],It[1]*St[2]+It[3]*St[3],It[0]*St[4]+It[2]*St[5]+It[4],It[1]*St[4]+It[3]*St[5]+It[5]]}static applyTransform(It,St){const Ht=It[0]*St[0]+It[1]*St[2]+St[4],Kt=It[0]*St[1]+It[1]*St[3]+St[5];return[Ht,Kt]}static applyInverseTransform(It,St){const Ht=St[0]*St[3]-St[1]*St[2],Kt=(It[0]*St[3]-It[1]*St[2]+St[2]*St[5]-St[4]*St[3])/Ht,kr=(-It[0]*St[1]+It[1]*St[0]+St[4]*St[1]-St[5]*St[0])/Ht;return[Kt,kr]}static getAxialAlignedBoundingBox(It,St){const Ht=this.applyTransform(It,St),Kt=this.applyTransform(It.slice(2,4),St),kr=this.applyTransform([It[0],It[3]],St),vr=this.applyTransform([It[2],It[1]],St);return[Math.min(Ht[0],Kt[0],kr[0],vr[0]),Math.min(Ht[1],Kt[1],kr[1],vr[1]),Math.max(Ht[0],Kt[0],kr[0],vr[0]),Math.max(Ht[1],Kt[1],kr[1],vr[1])]}static inverseTransform(It){const St=It[0]*It[3]-It[1]*It[2];return[It[3]/St,-It[1]/St,-It[2]/St,It[0]/St,(It[2]*It[5]-It[4]*It[3])/St,(It[4]*It[1]-It[5]*It[0])/St]}static singularValueDecompose2dScale(It){const St=[It[0],It[2],It[1],It[3]],Ht=It[0]*St[0]+It[1]*St[2],Kt=It[0]*St[1]+It[1]*St[3],kr=It[2]*St[0]+It[3]*St[2],vr=It[2]*St[1]+It[3]*St[3],Dt=(Ht+vr)/2,zt=Math.sqrt((Ht+vr)**2-4*(Ht*vr-kr*Kt))/2,tr=Dt+zt||1,Zt=Dt-zt||1;return[Math.sqrt(tr),Math.sqrt(Zt)]}static normalizeRect(It){const St=It.slice(0);return It[0]>It[2]&&(St[0]=It[2],St[2]=It[0]),It[1]>It[3]&&(St[1]=It[3],St[3]=It[1]),St}static intersect(It,St){const Ht=Math.max(Math.min(It[0],It[2]),Math.min(St[0],St[2])),Kt=Math.min(Math.max(It[0],It[2]),Math.max(St[0],St[2]));if(Ht>Kt)return null;const kr=Math.max(Math.min(It[1],It[3]),Math.min(St[1],St[3])),vr=Math.min(Math.max(It[1],It[3]),Math.max(St[1],St[3]));return kr>vr?null:[Ht,kr,Kt,vr]}static bezierBoundingBox(It,St,Ht,Kt,kr,vr,Dt,zt){const tr=[],Zt=[[],[]];let rr,nr,mr,Wt,pr,Qt,gt,Ee;for(let wt=0;wt<2;++wt){if(wt===0?(nr=6*It-12*Ht+6*kr,rr=-3*It+9*Ht-9*kr+3*Dt,mr=3*Ht-3*It):(nr=6*St-12*Kt+6*vr,rr=-3*St+9*Kt-9*vr+3*zt,mr=3*Kt-3*St),Math.abs(rr)<1e-12){if(Math.abs(nr)<1e-12)continue;Wt=-mr/nr,0="ï"){let St;if(Lt[0]==="þ"&&Lt[1]==="ÿ"?St="utf-16be":Lt[0]==="ÿ"&&Lt[1]==="þ"?St="utf-16le":Lt[0]==="ï"&&Lt[1]==="»"&&Lt[2]==="¿"&&(St="utf-8"),St)try{const Ht=new TextDecoder(St,{fatal:!0}),Kt=xt(Lt);return Ht.decode(Kt)}catch(Ht){pt(`stringToPDFString: "${Ht}".`)}}const It=[];for(let St=0,Ht=Lt.length;St{this.resolve=Ht=>{Ot(this,cr,!0),It(Ht)},this.reject=Ht=>{Ot(this,cr,!0),St(Ht)}})}get settled(){return pe(this,cr)}}cr=new WeakMap,C.PromiseCapability=er;let sr=null,ir=null;function dr(Lt){return sr||(sr=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,ir=new Map([["ſt","ſt"]])),Lt.replaceAll(sr,(It,St,Ht)=>St?St.normalize("NFKC"):ir.get(Ht))}function ar(){if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.randomUUID)=="function")return crypto.randomUUID();const Lt=new Uint8Array(32);if(typeof crypto<"u"&&typeof(crypto==null?void 0:crypto.getRandomValues)=="function")crypto.getRandomValues(Lt);else for(let It=0;It<32;It++)Lt[It]=Math.floor(Math.random()*255);return ct(Lt)}const or="pdfjs_internal_id_";C.AnnotationPrefix=or},(__unused_webpack_module,exports,__w_pdfjs_require__)=>{var T,$,V,K,wr,J,hn,ne,te,se,ie,ae,oe,le,ce,de,mn,me,ge,jn,fe,Te;Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderTask=exports.PDFWorkerUtil=exports.PDFWorker=exports.PDFPageProxy=exports.PDFDocumentProxy=exports.PDFDocumentLoadingTask=exports.PDFDataRangeTransport=exports.LoopbackPort=exports.DefaultStandardFontDataFactory=exports.DefaultFilterFactory=exports.DefaultCanvasFactory=exports.DefaultCMapReaderFactory=void 0,Object.defineProperty(exports,"SVGGraphics",{enumerable:!0,get:function(){return _displaySvg.SVGGraphics}}),exports.build=void 0,exports.getDocument=getDocument,exports.version=void 0;var _util=__w_pdfjs_require__(1),_annotation_storage=__w_pdfjs_require__(3),_display_utils=__w_pdfjs_require__(6),_font_loader=__w_pdfjs_require__(9),_displayNode_utils=__w_pdfjs_require__(10),_canvas=__w_pdfjs_require__(11),_worker_options=__w_pdfjs_require__(14),_message_handler=__w_pdfjs_require__(15),_metadata=__w_pdfjs_require__(16),_optional_content_config=__w_pdfjs_require__(17),_transport_stream=__w_pdfjs_require__(18),_displayFetch_stream=__w_pdfjs_require__(19),_displayNetwork=__w_pdfjs_require__(22),_displayNode_stream=__w_pdfjs_require__(23),_displaySvg=__w_pdfjs_require__(24),_xfa_text=__w_pdfjs_require__(25);const DEFAULT_RANGE_CHUNK_SIZE=65536,RENDERING_CANCELLED_TIMEOUT=100,DELAYED_CLEANUP_TIMEOUT=5e3,DefaultCanvasFactory=_util.isNodeJS?_displayNode_utils.NodeCanvasFactory:_display_utils.DOMCanvasFactory;exports.DefaultCanvasFactory=DefaultCanvasFactory;const DefaultCMapReaderFactory=_util.isNodeJS?_displayNode_utils.NodeCMapReaderFactory:_display_utils.DOMCMapReaderFactory;exports.DefaultCMapReaderFactory=DefaultCMapReaderFactory;const DefaultFilterFactory=_util.isNodeJS?_displayNode_utils.NodeFilterFactory:_display_utils.DOMFilterFactory;exports.DefaultFilterFactory=DefaultFilterFactory;const DefaultStandardFontDataFactory=_util.isNodeJS?_displayNode_utils.NodeStandardFontDataFactory:_display_utils.DOMStandardFontDataFactory;exports.DefaultStandardFontDataFactory=DefaultStandardFontDataFactory;function getDocument(De){if(typeof De=="string"||De instanceof URL?De={url:De}:(0,_util.isArrayBuffer)(De)&&(De={data:De}),typeof De!="object")throw new Error("Invalid parameter in getDocument, need parameter object.");if(!De.url&&!De.data&&!De.range)throw new Error("Invalid parameter object: need either .data, .range or .url");const xe=new PDFDocumentLoadingTask,{docId:Ce}=xe,je=De.url?getUrlProp(De.url):null,Le=De.data?getDataProp(De.data):null,Ke=De.httpHeaders||null,Se=De.withCredentials===!0,Ie=De.password??null,Ne=De.range instanceof PDFDataRangeTransport?De.range:null,pt=Number.isInteger(De.rangeChunkSize)&&De.rangeChunkSize>0?De.rangeChunkSize:DEFAULT_RANGE_CHUNK_SIZE;let at=De.worker instanceof PDFWorker?De.worker:null;const dt=De.verbosity,Ct=typeof De.docBaseUrl=="string"&&!(0,_display_utils.isDataScheme)(De.docBaseUrl)?De.docBaseUrl:null,ut=typeof De.cMapUrl=="string"?De.cMapUrl:null,bt=De.cMapPacked!==!1,Re=De.CMapReaderFactory||DefaultCMapReaderFactory,ue=typeof De.standardFontDataUrl=="string"?De.standardFontDataUrl:null,be=De.StandardFontDataFactory||DefaultStandardFontDataFactory,ve=De.stopAtErrors!==!0,we=Number.isInteger(De.maxImageSize)&&De.maxImageSize>-1?De.maxImageSize:-1,_e=De.isEvalSupported!==!1,Oe=typeof De.isOffscreenCanvasSupported=="boolean"?De.isOffscreenCanvasSupported:!_util.isNodeJS,Qe=Number.isInteger(De.canvasMaxAreaInBytes)?De.canvasMaxAreaInBytes:-1,ct=typeof De.disableFontFace=="boolean"?De.disableFontFace:_util.isNodeJS,xt=De.fontExtraProperties===!0,Tt=De.enableXfa===!0,Pt=De.ownerDocument||globalThis.document,$t=De.disableRange===!0,Ft=De.disableStream===!0,Nt=De.disableAutoFetch===!0,Gt=De.pdfBug===!0,ft=Ne?Ne.length:De.length??NaN,yt=typeof De.useSystemFonts=="boolean"?De.useSystemFonts:!_util.isNodeJS&&!ct,At=typeof De.useWorkerFetch=="boolean"?De.useWorkerFetch:Re===_display_utils.DOMCMapReaderFactory&&be===_display_utils.DOMStandardFontDataFactory&&ut&&ue&&(0,_display_utils.isValidFetchUrl)(ut,document.baseURI)&&(0,_display_utils.isValidFetchUrl)(ue,document.baseURI),Rt=De.canvasFactory||new DefaultCanvasFactory({ownerDocument:Pt}),mt=De.filterFactory||new DefaultFilterFactory({docId:Ce,ownerDocument:Pt}),ht=null;(0,_util.setVerbosityLevel)(dt);const jt={canvasFactory:Rt,filterFactory:mt};if(At||(jt.cMapReaderFactory=new Re({baseUrl:ut,isCompressed:bt}),jt.standardFontDataFactory=new be({baseUrl:ue})),!at){const er={verbosity:dt,port:_worker_options.GlobalWorkerOptions.workerPort};at=er.port?PDFWorker.fromPort(er):new PDFWorker(er),xe._worker=at}const Vt={docId:Ce,apiVersion:"3.11.174",data:Le,password:Ie,disableAutoFetch:Nt,rangeChunkSize:pt,length:ft,docBaseUrl:Ct,enableXfa:Tt,evaluatorOptions:{maxImageSize:we,disableFontFace:ct,ignoreErrors:ve,isEvalSupported:_e,isOffscreenCanvasSupported:Oe,canvasMaxAreaInBytes:Qe,fontExtraProperties:xt,useSystemFonts:yt,cMapUrl:At?ut:null,standardFontDataUrl:At?ue:null}},Bt={ignoreErrors:ve,isEvalSupported:_e,disableFontFace:ct,fontExtraProperties:xt,enableXfa:Tt,ownerDocument:Pt,disableAutoFetch:Nt,pdfBug:Gt,styleElement:ht};return at.promise.then(function(){if(xe.destroyed)throw new Error("Loading aborted");const er=_fetchDocument(at,Vt),sr=new Promise(function(ir){let dr;Ne?dr=new _transport_stream.PDFDataTransportStream({length:ft,initialData:Ne.initialData,progressiveDone:Ne.progressiveDone,contentDispositionFilename:Ne.contentDispositionFilename,disableRange:$t,disableStream:Ft},Ne):Le||(dr=(or=>_util.isNodeJS?new _displayNode_stream.PDFNodeStream(or):(0,_display_utils.isValidFetchUrl)(or.url)?new _displayFetch_stream.PDFFetchStream(or):new _displayNetwork.PDFNetworkStream(or))({url:je,length:ft,httpHeaders:Ke,withCredentials:Se,rangeChunkSize:pt,disableRange:$t,disableStream:Ft})),ir(dr)});return Promise.all([er,sr]).then(function([ir,dr]){if(xe.destroyed)throw new Error("Loading aborted");const ar=new _message_handler.MessageHandler(Ce,ir,at.port),or=new WorkerTransport(ar,xe,dr,Bt,jt);xe._transport=or,ar.send("Ready",null)})}).catch(xe._capability.reject),xe}async function _fetchDocument(De,xe){if(De.destroyed)throw new Error("Worker was destroyed");const Ce=await De.messageHandler.sendWithPromise("GetDocRequest",xe,xe.data?[xe.data.buffer]:null);if(De.destroyed)throw new Error("Worker was destroyed");return Ce}function getUrlProp(De){if(De instanceof URL)return De.href;try{return new URL(De,window.location).href}catch{if(_util.isNodeJS&&typeof De=="string")return De}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function getDataProp(De){if(_util.isNodeJS&&typeof Buffer<"u"&&De instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(De instanceof Uint8Array&&De.byteLength===De.buffer.byteLength)return De;if(typeof De=="string")return(0,_util.stringToBytes)(De);if(typeof De=="object"&&!isNaN(De==null?void 0:De.length)||(0,_util.isArrayBuffer)(De))return new Uint8Array(De);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}const C=class C{constructor(){this._capability=new _util.PromiseCapability,this._transport=null,this._worker=null,this.docId=`d${Cr(C,T)._++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}async destroy(){var xe,Ce,je;this.destroyed=!0;try{(xe=this._worker)!=null&&xe.port&&(this._worker._pendingDestroy=!0),await((Ce=this._transport)==null?void 0:Ce.destroy())}catch(Le){throw(je=this._worker)!=null&&je.port&&delete this._worker._pendingDestroy,Le}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)}};T=new WeakMap,kt(C,T,0);let PDFDocumentLoadingTask=C;exports.PDFDocumentLoadingTask=PDFDocumentLoadingTask;class PDFDataRangeTransport{constructor(xe,Ce,je=!1,Le=null){this.length=xe,this.initialData=Ce,this.progressiveDone=je,this.contentDispositionFilename=Le,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=new _util.PromiseCapability}addRangeListener(xe){this._rangeListeners.push(xe)}addProgressListener(xe){this._progressListeners.push(xe)}addProgressiveReadListener(xe){this._progressiveReadListeners.push(xe)}addProgressiveDoneListener(xe){this._progressiveDoneListeners.push(xe)}onDataRange(xe,Ce){for(const je of this._rangeListeners)je(xe,Ce)}onDataProgress(xe,Ce){this._readyCapability.promise.then(()=>{for(const je of this._progressListeners)je(xe,Ce)})}onDataProgressiveRead(xe){this._readyCapability.promise.then(()=>{for(const Ce of this._progressiveReadListeners)Ce(xe)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(const xe of this._progressiveDoneListeners)xe()})}transportReady(){this._readyCapability.resolve()}requestDataRange(xe,Ce){(0,_util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}exports.PDFDataRangeTransport=PDFDataRangeTransport;class PDFDocumentProxy{constructor(xe,Ce){this._pdfInfo=xe,this._transport=Ce,Object.defineProperty(this,"getJavaScript",{value:()=>((0,_display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."),this.getJSActions().then(je=>{if(!je)return je;const Le=[];for(const Ke in je)Le.push(...je[Ke]);return Le}))})}get annotationStorage(){return this._transport.annotationStorage}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(xe){return this._transport.getPage(xe)}getPageIndex(xe){return this._transport.getPageIndex(xe)}getDestinations(){return this._transport.getDestinations()}getDestination(xe){return this._transport.getDestination(xe)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig(){return this._transport.getOptionalContentConfig()}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(xe=!1){return this._transport.startCleanup(xe||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}exports.PDFDocumentProxy=PDFDocumentProxy;class PDFPageProxy{constructor(xe,Ce,je,Le=!1){kt(this,K);kt(this,J);kt(this,$,null);kt(this,V,!1);this._pageIndex=xe,this._pageInfo=Ce,this._transport=je,this._stats=Le?new _display_utils.StatTimer:null,this._pdfBug=Le,this.commonObjs=je.commonObjs,this.objs=new PDFObjects,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:xe,rotation:Ce=this.rotate,offsetX:je=0,offsetY:Le=0,dontFlip:Ke=!1}={}){return new _display_utils.PageViewport({viewBox:this.view,scale:xe,rotation:Ce,offsetX:je,offsetY:Le,dontFlip:Ke})}getAnnotations({intent:xe="display"}={}){const Ce=this._transport.getRenderingIntent(xe);return this._transport.getAnnotations(this._pageIndex,Ce.renderingIntent)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return(0,_util.shadow)(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){var xe;return((xe=this._transport._htmlForXfa)==null?void 0:xe.children[this._pageIndex])||null}render({canvasContext:xe,viewport:Ce,intent:je="display",annotationMode:Le=_util.AnnotationMode.ENABLE,transform:Ke=null,background:Se=null,optionalContentConfigPromise:Ie=null,annotationCanvasMap:Ne=null,pageColors:pt=null,printAnnotationStorage:at=null}){var be,ve;(be=this._stats)==null||be.time("Overall");const dt=this._transport.getRenderingIntent(je,Le,at);Ot(this,V,!1),_t(this,J,hn).call(this),Ie||(Ie=this._transport.getOptionalContentConfig());let Ct=this._intentStates.get(dt.cacheKey);Ct||(Ct=Object.create(null),this._intentStates.set(dt.cacheKey,Ct)),Ct.streamReaderCancelTimeout&&(clearTimeout(Ct.streamReaderCancelTimeout),Ct.streamReaderCancelTimeout=null);const ut=!!(dt.renderingIntent&_util.RenderingIntentFlag.PRINT);Ct.displayReadyCapability||(Ct.displayReadyCapability=new _util.PromiseCapability,Ct.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(ve=this._stats)==null||ve.time("Page Request"),this._pumpOperatorList(dt));const bt=we=>{var _e,Oe;Ct.renderTasks.delete(Re),(this._maybeCleanupAfterRender||ut)&&Ot(this,V,!0),_t(this,K,wr).call(this,!ut),we?(Re.capability.reject(we),this._abortOperatorList({intentState:Ct,reason:we instanceof Error?we:new Error(we)})):Re.capability.resolve(),(_e=this._stats)==null||_e.timeEnd("Rendering"),(Oe=this._stats)==null||Oe.timeEnd("Overall")},Re=new InternalRenderTask({callback:bt,params:{canvasContext:xe,viewport:Ce,transform:Ke,background:Se},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:Ne,operatorList:Ct.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!ut,pdfBug:this._pdfBug,pageColors:pt});(Ct.renderTasks||(Ct.renderTasks=new Set)).add(Re);const ue=Re.task;return Promise.all([Ct.displayReadyCapability.promise,Ie]).then(([we,_e])=>{var Oe;if(this.destroyed){bt();return}(Oe=this._stats)==null||Oe.time("Rendering"),Re.initializeGraphics({transparency:we,optionalContentConfig:_e}),Re.operatorListChanged()}).catch(bt),ue}getOperatorList({intent:xe="display",annotationMode:Ce=_util.AnnotationMode.ENABLE,printAnnotationStorage:je=null}={}){var Ne;function Le(){Se.operatorList.lastChunk&&(Se.opListReadCapability.resolve(Se.operatorList),Se.renderTasks.delete(Ie))}const Ke=this._transport.getRenderingIntent(xe,Ce,je,!0);let Se=this._intentStates.get(Ke.cacheKey);Se||(Se=Object.create(null),this._intentStates.set(Ke.cacheKey,Se));let Ie;return Se.opListReadCapability||(Ie=Object.create(null),Ie.operatorListChanged=Le,Se.opListReadCapability=new _util.PromiseCapability,(Se.renderTasks||(Se.renderTasks=new Set)).add(Ie),Se.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},(Ne=this._stats)==null||Ne.time("Page Request"),this._pumpOperatorList(Ke)),Se.opListReadCapability.promise}streamTextContent({includeMarkedContent:xe=!1,disableNormalization:Ce=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:xe===!0,disableNormalization:Ce===!0},{highWaterMark:100,size(Le){return Le.items.length}})}getTextContent(xe={}){if(this._transport._htmlForXfa)return this.getXfa().then(je=>_xfa_text.XfaText.textContent(je));const Ce=this.streamTextContent(xe);return new Promise(function(je,Le){function Ke(){Se.read().then(function({value:Ne,done:pt}){if(pt){je(Ie);return}Object.assign(Ie.styles,Ne.styles),Ie.items.push(...Ne.items),Ke()},Le)}const Se=Ce.getReader(),Ie={items:[],styles:Object.create(null)};Ke()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const xe=[];for(const Ce of this._intentStates.values())if(this._abortOperatorList({intentState:Ce,reason:new Error("Page was destroyed."),force:!0}),!Ce.opListReadCapability)for(const je of Ce.renderTasks)xe.push(je.completed),je.cancel();return this.objs.clear(),Ot(this,V,!1),_t(this,J,hn).call(this),Promise.all(xe)}cleanup(xe=!1){Ot(this,V,!0);const Ce=_t(this,K,wr).call(this,!1);return xe&&Ce&&this._stats&&(this._stats=new _display_utils.StatTimer),Ce}_startRenderPage(xe,Ce){var Le,Ke;const je=this._intentStates.get(Ce);je&&((Le=this._stats)==null||Le.timeEnd("Page Request"),(Ke=je.displayReadyCapability)==null||Ke.resolve(xe))}_renderPageChunk(xe,Ce){for(let je=0,Le=xe.length;je{Ie.read().then(({value:at,done:dt})=>{if(dt){Ne.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(at,Ne),pt())},at=>{if(Ne.streamReader=null,!this._transport.destroyed){if(Ne.operatorList){Ne.operatorList.lastChunk=!0;for(const dt of Ne.renderTasks)dt.operatorListChanged();_t(this,K,wr).call(this,!0)}if(Ne.displayReadyCapability)Ne.displayReadyCapability.reject(at);else if(Ne.opListReadCapability)Ne.opListReadCapability.reject(at);else throw at}})};pt()}_abortOperatorList({intentState:xe,reason:Ce,force:je=!1}){if(xe.streamReader){if(xe.streamReaderCancelTimeout&&(clearTimeout(xe.streamReaderCancelTimeout),xe.streamReaderCancelTimeout=null),!je){if(xe.renderTasks.size>0)return;if(Ce instanceof _display_utils.RenderingCancelledException){let Le=RENDERING_CANCELLED_TIMEOUT;Ce.extraDelay>0&&Ce.extraDelay<1e3&&(Le+=Ce.extraDelay),xe.streamReaderCancelTimeout=setTimeout(()=>{xe.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:xe,reason:Ce,force:!0})},Le);return}}if(xe.streamReader.cancel(new _util.AbortException(Ce.message)).catch(()=>{}),xe.streamReader=null,!this._transport.destroyed){for(const[Le,Ke]of this._intentStates)if(Ke===xe){this._intentStates.delete(Le);break}this.cleanup()}}}get stats(){return this._stats}}$=new WeakMap,V=new WeakMap,K=new WeakSet,wr=function(xe=!1){if(_t(this,J,hn).call(this),!pe(this,V)||this.destroyed)return!1;if(xe)return Ot(this,$,setTimeout(()=>{Ot(this,$,null),_t(this,K,wr).call(this,!1)},DELAYED_CLEANUP_TIMEOUT)),!1;for(const{renderTasks:Ce,operatorList:je}of this._intentStates.values())if(Ce.size>0||!je.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),Ot(this,V,!1),!0},J=new WeakSet,hn=function(){pe(this,$)&&(clearTimeout(pe(this,$)),Ot(this,$,null))},exports.PDFPageProxy=PDFPageProxy;class LoopbackPort{constructor(){kt(this,ne,new Set);kt(this,te,Promise.resolve())}postMessage(xe,Ce){const je={data:structuredClone(xe,Ce?{transfer:Ce}:null)};pe(this,te).then(()=>{for(const Le of pe(this,ne))Le.call(this,je)})}addEventListener(xe,Ce){pe(this,ne).add(Ce)}removeEventListener(xe,Ce){pe(this,ne).delete(Ce)}terminate(){pe(this,ne).clear()}}ne=new WeakMap,te=new WeakMap,exports.LoopbackPort=LoopbackPort;const PDFWorkerUtil={isWorkerDisabled:!1,fallbackWorkerSrc:null,fakeWorkerId:0};exports.PDFWorkerUtil=PDFWorkerUtil;{if(_util.isNodeJS&&typeof commonjsRequire=="function")PDFWorkerUtil.isWorkerDisabled=!0,PDFWorkerUtil.fallbackWorkerSrc="./pdf.worker.js";else if(typeof document=="object"){const De=(se=document==null?void 0:document.currentScript)==null?void 0:se.src;De&&(PDFWorkerUtil.fallbackWorkerSrc=De.replace(/(\.(?:min\.)?js)(\?.*)?$/i,".worker$1$2"))}PDFWorkerUtil.isSameOrigin=function(De,xe){let Ce;try{if(Ce=new URL(De),!Ce.origin||Ce.origin==="null")return!1}catch{return!1}const je=new URL(xe,Ce);return Ce.origin===je.origin},PDFWorkerUtil.createCDNWrapper=function(De){const xe=`importScripts("${De}");`;return URL.createObjectURL(new Blob([xe]))}}const _PDFWorker=class _PDFWorker{constructor({name:De=null,port:xe=null,verbosity:Ce=(0,_util.getVerbosityLevel)()}={}){var je;if(this.name=De,this.destroyed=!1,this.verbosity=Ce,this._readyCapability=new _util.PromiseCapability,this._port=null,this._webWorker=null,this._messageHandler=null,xe){if((je=pe(_PDFWorker,ie))!=null&&je.has(xe))throw new Error("Cannot use more than one PDFWorker per port.");(pe(_PDFWorker,ie)||Ot(_PDFWorker,ie,new WeakMap)).set(xe,this),this._initializeFromPort(xe);return}this._initialize()}get promise(){return this._readyCapability.promise}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(De){this._port=De,this._messageHandler=new _message_handler.MessageHandler("main","worker",De),this._messageHandler.on("ready",function(){}),this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}_initialize(){if(!PDFWorkerUtil.isWorkerDisabled&&!_PDFWorker._mainThreadWorkerMessageHandler){let{workerSrc:De}=_PDFWorker;try{PDFWorkerUtil.isSameOrigin(window.location.href,De)||(De=PDFWorkerUtil.createCDNWrapper(new URL(De,window.location).href));const xe=new Worker(De),Ce=new _message_handler.MessageHandler("main","worker",xe),je=()=>{xe.removeEventListener("error",Le),Ce.destroy(),xe.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},Le=()=>{this._webWorker||je()};xe.addEventListener("error",Le),Ce.on("test",Se=>{if(xe.removeEventListener("error",Le),this.destroyed){je();return}Se?(this._messageHandler=Ce,this._port=xe,this._webWorker=xe,this._readyCapability.resolve(),Ce.send("configure",{verbosity:this.verbosity})):(this._setupFakeWorker(),Ce.destroy(),xe.terminate())}),Ce.on("ready",Se=>{if(xe.removeEventListener("error",Le),this.destroyed){je();return}try{Ke()}catch{this._setupFakeWorker()}});const Ke=()=>{const Se=new Uint8Array;Ce.send("test",Se,[Se.buffer])};Ke();return}catch{(0,_util.info)("The worker has been disabled.")}}this._setupFakeWorker()}_setupFakeWorker(){PDFWorkerUtil.isWorkerDisabled||((0,_util.warn)("Setting up fake worker."),PDFWorkerUtil.isWorkerDisabled=!0),_PDFWorker._setupFakeWorkerGlobal.then(De=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}const xe=new LoopbackPort;this._port=xe;const Ce=`fake${PDFWorkerUtil.fakeWorkerId++}`,je=new _message_handler.MessageHandler(Ce+"_worker",Ce,xe);De.setup(je,xe);const Le=new _message_handler.MessageHandler(Ce,Ce+"_worker",xe);this._messageHandler=Le,this._readyCapability.resolve(),Le.send("configure",{verbosity:this.verbosity})}).catch(De=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${De.message}".`))})}destroy(){var De;this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),(De=pe(_PDFWorker,ie))==null||De.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(De){var Ce;if(!(De!=null&&De.port))throw new Error("PDFWorker.fromPort - invalid method signature.");const xe=(Ce=pe(this,ie))==null?void 0:Ce.get(De.port);if(xe){if(xe._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return xe}return new _PDFWorker(De)}static get workerSrc(){if(_worker_options.GlobalWorkerOptions.workerSrc)return _worker_options.GlobalWorkerOptions.workerSrc;if(PDFWorkerUtil.fallbackWorkerSrc!==null)return _util.isNodeJS||(0,_display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'),PDFWorkerUtil.fallbackWorkerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _mainThreadWorkerMessageHandler(){var De;try{return((De=globalThis.pdfjsWorker)==null?void 0:De.WorkerMessageHandler)||null}catch{return null}}static get _setupFakeWorkerGlobal(){const loader=async()=>{const mainWorkerMessageHandler=this._mainThreadWorkerMessageHandler;if(mainWorkerMessageHandler)return mainWorkerMessageHandler;if(_util.isNodeJS&&typeof commonjsRequire=="function"){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}return await(0,_display_utils.loadScript)(this.workerSrc),window.pdfjsWorker.WorkerMessageHandler};return(0,_util.shadow)(this,"_setupFakeWorkerGlobal",loader())}};ie=new WeakMap,kt(_PDFWorker,ie,void 0);let PDFWorker=_PDFWorker;exports.PDFWorker=PDFWorker;class WorkerTransport{constructor(xe,Ce,je,Le,Ke){kt(this,de);kt(this,ae,new Map);kt(this,oe,new Map);kt(this,le,new Map);kt(this,ce,null);this.messageHandler=xe,this.loadingTask=Ce,this.commonObjs=new PDFObjects,this.fontLoader=new _font_loader.FontLoader({ownerDocument:Le.ownerDocument,styleElement:Le.styleElement}),this._params=Le,this.canvasFactory=Ke.canvasFactory,this.filterFactory=Ke.filterFactory,this.cMapReaderFactory=Ke.cMapReaderFactory,this.standardFontDataFactory=Ke.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=je,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=new _util.PromiseCapability,this.setupMessageHandler()}get annotationStorage(){return(0,_util.shadow)(this,"annotationStorage",new _annotation_storage.AnnotationStorage)}getRenderingIntent(xe,Ce=_util.AnnotationMode.ENABLE,je=null,Le=!1){let Ke=_util.RenderingIntentFlag.DISPLAY,Se=_annotation_storage.SerializableEmpty;switch(xe){case"any":Ke=_util.RenderingIntentFlag.ANY;break;case"display":break;case"print":Ke=_util.RenderingIntentFlag.PRINT;break;default:(0,_util.warn)(`getRenderingIntent - invalid intent: ${xe}`)}switch(Ce){case _util.AnnotationMode.DISABLE:Ke+=_util.RenderingIntentFlag.ANNOTATIONS_DISABLE;break;case _util.AnnotationMode.ENABLE:break;case _util.AnnotationMode.ENABLE_FORMS:Ke+=_util.RenderingIntentFlag.ANNOTATIONS_FORMS;break;case _util.AnnotationMode.ENABLE_STORAGE:Ke+=_util.RenderingIntentFlag.ANNOTATIONS_STORAGE,Se=(Ke&_util.RenderingIntentFlag.PRINT&&je instanceof _annotation_storage.PrintAnnotationStorage?je:this.annotationStorage).serializable;break;default:(0,_util.warn)(`getRenderingIntent - invalid annotationMode: ${Ce}`)}return Le&&(Ke+=_util.RenderingIntentFlag.OPLIST),{renderingIntent:Ke,cacheKey:`${Ke}_${Se.hash}`,annotationStorageSerializable:Se}}destroy(){var je;if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=new _util.PromiseCapability,(je=pe(this,ce))==null||je.reject(new Error("Worker was destroyed during onPassword callback"));const xe=[];for(const Le of pe(this,oe).values())xe.push(Le._destroy());pe(this,oe).clear(),pe(this,le).clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const Ce=this.messageHandler.sendWithPromise("Terminate",null);return xe.push(Ce),Promise.all(xe).then(()=>{var Le;this.commonObjs.clear(),this.fontLoader.clear(),pe(this,ae).clear(),this.filterFactory.destroy(),(Le=this._networkStream)==null||Le.cancelAllRequests(new _util.AbortException("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:xe,loadingTask:Ce}=this;xe.on("GetReader",(je,Le)=>{(0,_util.assert)(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=Ke=>{this._lastProgress={loaded:Ke.loaded,total:Ke.total}},Le.onPull=()=>{this._fullReader.read().then(function({value:Ke,done:Se}){if(Se){Le.close();return}(0,_util.assert)(Ke instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),Le.enqueue(new Uint8Array(Ke),1,[Ke])}).catch(Ke=>{Le.error(Ke)})},Le.onCancel=Ke=>{this._fullReader.cancel(Ke),Le.ready.catch(Se=>{if(!this.destroyed)throw Se})}}),xe.on("ReaderHeadersReady",je=>{const Le=new _util.PromiseCapability,Ke=this._fullReader;return Ke.headersReady.then(()=>{var Se;(!Ke.isStreamingSupported||!Ke.isRangeSupported)&&(this._lastProgress&&((Se=Ce.onProgress)==null||Se.call(Ce,this._lastProgress)),Ke.onProgress=Ie=>{var Ne;(Ne=Ce.onProgress)==null||Ne.call(Ce,{loaded:Ie.loaded,total:Ie.total})}),Le.resolve({isStreamingSupported:Ke.isStreamingSupported,isRangeSupported:Ke.isRangeSupported,contentLength:Ke.contentLength})},Le.reject),Le.promise}),xe.on("GetRangeReader",(je,Le)=>{(0,_util.assert)(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const Ke=this._networkStream.getRangeReader(je.begin,je.end);if(!Ke){Le.close();return}Le.onPull=()=>{Ke.read().then(function({value:Se,done:Ie}){if(Ie){Le.close();return}(0,_util.assert)(Se instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),Le.enqueue(new Uint8Array(Se),1,[Se])}).catch(Se=>{Le.error(Se)})},Le.onCancel=Se=>{Ke.cancel(Se),Le.ready.catch(Ie=>{if(!this.destroyed)throw Ie})}}),xe.on("GetDoc",({pdfInfo:je})=>{this._numPages=je.numPages,this._htmlForXfa=je.htmlForXfa,delete je.htmlForXfa,Ce._capability.resolve(new PDFDocumentProxy(je,this))}),xe.on("DocException",function(je){let Le;switch(je.name){case"PasswordException":Le=new _util.PasswordException(je.message,je.code);break;case"InvalidPDFException":Le=new _util.InvalidPDFException(je.message);break;case"MissingPDFException":Le=new _util.MissingPDFException(je.message);break;case"UnexpectedResponseException":Le=new _util.UnexpectedResponseException(je.message,je.status);break;case"UnknownErrorException":Le=new _util.UnknownErrorException(je.message,je.details);break;default:(0,_util.unreachable)("DocException - expected a valid Error.")}Ce._capability.reject(Le)}),xe.on("PasswordRequest",je=>{if(Ot(this,ce,new _util.PromiseCapability),Ce.onPassword){const Le=Ke=>{Ke instanceof Error?pe(this,ce).reject(Ke):pe(this,ce).resolve({password:Ke})};try{Ce.onPassword(Le,je.code)}catch(Ke){pe(this,ce).reject(Ke)}}else pe(this,ce).reject(new _util.PasswordException(je.message,je.code));return pe(this,ce).promise}),xe.on("DataLoaded",je=>{var Le;(Le=Ce.onProgress)==null||Le.call(Ce,{loaded:je.length,total:je.length}),this.downloadInfoCapability.resolve(je)}),xe.on("StartRenderPage",je=>{if(this.destroyed)return;pe(this,oe).get(je.pageIndex)._startRenderPage(je.transparency,je.cacheKey)}),xe.on("commonobj",([je,Le,Ke])=>{var Se;if(!this.destroyed&&!this.commonObjs.has(je))switch(Le){case"Font":const Ie=this._params;if("error"in Ke){const at=Ke.error;(0,_util.warn)(`Error during font loading: ${at}`),this.commonObjs.resolve(je,at);break}const Ne=Ie.pdfBug&&((Se=globalThis.FontInspector)!=null&&Se.enabled)?(at,dt)=>globalThis.FontInspector.fontAdded(at,dt):null,pt=new _font_loader.FontFaceObject(Ke,{isEvalSupported:Ie.isEvalSupported,disableFontFace:Ie.disableFontFace,ignoreErrors:Ie.ignoreErrors,inspectFont:Ne});this.fontLoader.bind(pt).catch(at=>xe.sendWithPromise("FontFallback",{id:je})).finally(()=>{!Ie.fontExtraProperties&&pt.data&&(pt.data=null),this.commonObjs.resolve(je,pt)});break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(je,Ke);break;default:throw new Error(`Got unknown common object type ${Le}`)}}),xe.on("obj",([je,Le,Ke,Se])=>{var Ne;if(this.destroyed)return;const Ie=pe(this,oe).get(Le);if(!Ie.objs.has(je))switch(Ke){case"Image":if(Ie.objs.resolve(je,Se),Se){let pt;if(Se.bitmap){const{width:at,height:dt}=Se;pt=at*dt*4}else pt=((Ne=Se.data)==null?void 0:Ne.length)||0;pt>_util.MAX_IMAGE_SIZE_TO_CACHE&&(Ie._maybeCleanupAfterRender=!0)}break;case"Pattern":Ie.objs.resolve(je,Se);break;default:throw new Error(`Got unknown object type ${Ke}`)}}),xe.on("DocProgress",je=>{var Le;this.destroyed||(Le=Ce.onProgress)==null||Le.call(Ce,{loaded:je.loaded,total:je.total})}),xe.on("FetchBuiltInCMap",je=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.cMapReaderFactory?this.cMapReaderFactory.fetch(je):Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))),xe.on("FetchStandardFontData",je=>this.destroyed?Promise.reject(new Error("Worker was destroyed.")):this.standardFontDataFactory?this.standardFontDataFactory.fetch(je):Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){var je;this.annotationStorage.size<=0&&(0,_util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:xe,transfers:Ce}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:xe,filename:((je=this._fullReader)==null?void 0:je.filename)??null},Ce).finally(()=>{this.annotationStorage.resetModified()})}getPage(xe){if(!Number.isInteger(xe)||xe<=0||xe>this._numPages)return Promise.reject(new Error("Invalid page request."));const Ce=xe-1,je=pe(this,le).get(Ce);if(je)return je;const Le=this.messageHandler.sendWithPromise("GetPage",{pageIndex:Ce}).then(Ke=>{if(this.destroyed)throw new Error("Transport destroyed");const Se=new PDFPageProxy(Ce,Ke,this,this._params.pdfBug);return pe(this,oe).set(Ce,Se),Se});return pe(this,le).set(Ce,Le),Le}getPageIndex(xe){return typeof xe!="object"||xe===null||!Number.isInteger(xe.num)||xe.num<0||!Number.isInteger(xe.gen)||xe.gen<0?Promise.reject(new Error("Invalid pageIndex request.")):this.messageHandler.sendWithPromise("GetPageIndex",{num:xe.num,gen:xe.gen})}getAnnotations(xe,Ce){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:xe,intent:Ce})}getFieldObjects(){return _t(this,de,mn).call(this,"GetFieldObjects")}hasJSActions(){return _t(this,de,mn).call(this,"HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(xe){return typeof xe!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:xe})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return _t(this,de,mn).call(this,"GetDocJSActions")}getPageJSActions(xe){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:xe})}getStructTree(xe){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:xe})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(){return this.messageHandler.sendWithPromise("GetOptionalContentConfig",null).then(xe=>new _optional_content_config.OptionalContentConfig(xe))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const xe="GetMetadata",Ce=pe(this,ae).get(xe);if(Ce)return Ce;const je=this.messageHandler.sendWithPromise(xe,null).then(Le=>{var Ke,Se;return{info:Le[0],metadata:Le[1]?new _metadata.Metadata(Le[1]):null,contentDispositionFilename:((Ke=this._fullReader)==null?void 0:Ke.filename)??null,contentLength:((Se=this._fullReader)==null?void 0:Se.contentLength)??null}});return pe(this,ae).set(xe,je),je}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(xe=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const Ce of pe(this,oe).values())if(!Ce.cleanup())throw new Error(`startCleanup: Page ${Ce.pageNumber} is currently rendering.`);this.commonObjs.clear(),xe||this.fontLoader.clear(),pe(this,ae).clear(),this.filterFactory.destroy(!0)}}get loadingParams(){const{disableAutoFetch:xe,enableXfa:Ce}=this._params;return(0,_util.shadow)(this,"loadingParams",{disableAutoFetch:xe,enableXfa:Ce})}}ae=new WeakMap,oe=new WeakMap,le=new WeakMap,ce=new WeakMap,de=new WeakSet,mn=function(xe,Ce=null){const je=pe(this,ae).get(xe);if(je)return je;const Le=this.messageHandler.sendWithPromise(xe,Ce);return pe(this,ae).set(xe,Le),Le};class PDFObjects{constructor(){kt(this,ge);kt(this,me,Object.create(null))}get(xe,Ce=null){if(Ce){const Le=_t(this,ge,jn).call(this,xe);return Le.capability.promise.then(()=>Ce(Le.data)),null}const je=pe(this,me)[xe];if(!(je!=null&&je.capability.settled))throw new Error(`Requesting object that isn't resolved yet ${xe}.`);return je.data}has(xe){const Ce=pe(this,me)[xe];return(Ce==null?void 0:Ce.capability.settled)||!1}resolve(xe,Ce=null){const je=_t(this,ge,jn).call(this,xe);je.data=Ce,je.capability.resolve()}clear(){var xe;for(const Ce in pe(this,me)){const{data:je}=pe(this,me)[Ce];(xe=je==null?void 0:je.bitmap)==null||xe.close()}Ot(this,me,Object.create(null))}}me=new WeakMap,ge=new WeakSet,jn=function(xe){var Ce;return(Ce=pe(this,me))[xe]||(Ce[xe]={capability:new _util.PromiseCapability,data:null})};class RenderTask{constructor(xe){kt(this,fe,null);Ot(this,fe,xe),this.onContinue=null}get promise(){return pe(this,fe).capability.promise}cancel(xe=0){pe(this,fe).cancel(null,xe)}get separateAnnots(){const{separateAnnots:xe}=pe(this,fe).operatorList;if(!xe)return!1;const{annotationCanvasMap:Ce}=pe(this,fe);return xe.form||xe.canvas&&(Ce==null?void 0:Ce.size)>0}}fe=new WeakMap,exports.RenderTask=RenderTask;const Pe=class Pe{constructor({callback:xe,params:Ce,objs:je,commonObjs:Le,annotationCanvasMap:Ke,operatorList:Se,pageIndex:Ie,canvasFactory:Ne,filterFactory:pt,useRequestAnimationFrame:at=!1,pdfBug:dt=!1,pageColors:Ct=null}){this.callback=xe,this.params=Ce,this.objs=je,this.commonObjs=Le,this.annotationCanvasMap=Ke,this.operatorListIdx=null,this.operatorList=Se,this._pageIndex=Ie,this.canvasFactory=Ne,this.filterFactory=pt,this._pdfBug=dt,this.pageColors=Ct,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=at===!0&&typeof window<"u",this.cancelled=!1,this.capability=new _util.PromiseCapability,this.task=new RenderTask(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=Ce.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:xe=!1,optionalContentConfig:Ce}){var Ie,Ne;if(this.cancelled)return;if(this._canvas){if(pe(Pe,Te).has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");pe(Pe,Te).add(this._canvas)}this._pdfBug&&((Ie=globalThis.StepperManager)!=null&&Ie.enabled)&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{canvasContext:je,viewport:Le,transform:Ke,background:Se}=this.params;this.gfx=new _canvas.CanvasGraphics(je,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:Ce},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:Ke,viewport:Le,transparency:xe,background:Se}),this.operatorListIdx=0,this.graphicsReady=!0,(Ne=this.graphicsReadyCallback)==null||Ne.call(this)}cancel(xe=null,Ce=0){var je;this.running=!1,this.cancelled=!0,(je=this.gfx)==null||je.endDrawing(),pe(Pe,Te).delete(this._canvas),this.callback(xe||new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex+1}`,Ce))}operatorListChanged(){var xe;if(!this.graphicsReady){this.graphicsReadyCallback||(this.graphicsReadyCallback=this._continueBound);return}(xe=this.stepper)==null||xe.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?window.requestAnimationFrame(()=>{this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),pe(Pe,Te).delete(this._canvas),this.callback())))}};Te=new WeakMap,kt(Pe,Te,new WeakSet);let InternalRenderTask=Pe;const version="3.11.174";exports.version=version;const build="ce8716743";exports.build=build},(T,C,$)=>{var te,se,ie,us,oe;Object.defineProperty(C,"__esModule",{value:!0}),C.SerializableEmpty=C.PrintAnnotationStorage=C.AnnotationStorage=void 0;var V=$(1),K=$(4),Y=$(8);const J=Object.freeze({map:null,hash:"",transfers:void 0});C.SerializableEmpty=J;class re{constructor(){kt(this,ie);kt(this,te,!1);kt(this,se,new Map);this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(ce,de){const he=pe(this,se).get(ce);return he===void 0?de:Object.assign(de,he)}getRawValue(ce){return pe(this,se).get(ce)}remove(ce){if(pe(this,se).delete(ce),pe(this,se).size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(const de of pe(this,se).values())if(de instanceof K.AnnotationEditor)return;this.onAnnotationEditor(null)}}setValue(ce,de){const he=pe(this,se).get(ce);let me=!1;if(he!==void 0)for(const[ge,ye]of Object.entries(de))he[ge]!==ye&&(me=!0,he[ge]=ye);else me=!0,pe(this,se).set(ce,de);me&&_t(this,ie,us).call(this),de instanceof K.AnnotationEditor&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(de.constructor._type)}has(ce){return pe(this,se).has(ce)}getAll(){return pe(this,se).size>0?(0,V.objectFromMap)(pe(this,se)):null}setAll(ce){for(const[de,he]of Object.entries(ce))this.setValue(de,he)}get size(){return pe(this,se).size}resetModified(){pe(this,te)&&(Ot(this,te,!1),typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new ne(this)}get serializable(){if(pe(this,se).size===0)return J;const ce=new Map,de=new Y.MurmurHash3_64,he=[],me=Object.create(null);let ge=!1;for(const[ye,fe]of pe(this,se)){const Te=fe instanceof K.AnnotationEditor?fe.serialize(!1,me):fe;Te&&(ce.set(ye,Te),de.update(`${ye}:${JSON.stringify(Te)}`),ge||(ge=!!Te.bitmap))}if(ge)for(const ye of ce.values())ye.bitmap&&he.push(ye.bitmap);return ce.size>0?{map:ce,hash:de.hexdigest(),transfers:he}:J}}te=new WeakMap,se=new WeakMap,ie=new WeakSet,us=function(){pe(this,te)||(Ot(this,te,!0),typeof this.onSetModified=="function"&&this.onSetModified())},C.AnnotationStorage=re;class ne extends re{constructor(de){super();kt(this,oe,void 0);const{map:he,hash:me,transfers:ge}=de.serializable,ye=structuredClone(he,ge?{transfer:ge}:null);Ot(this,oe,{map:ye,hash:me,transfers:ge})}get print(){(0,V.unreachable)("Should not call PrintAnnotationStorage.print")}get serializable(){return pe(this,oe)}}oe=new WeakMap,C.PrintAnnotationStorage=ne},(T,C,$)=>{var ne,te,se,ie,ae,oe,le,ce,de,he,me,ge,ye,fe,Te,In,De,Dn,Ce,Pn,Le,On,Se,fs,Ne,ps,at,hs,Ct,Cn,bt,ms;Object.defineProperty(C,"__esModule",{value:!0}),C.AnnotationEditor=void 0;var V=$(5),K=$(1),Y=$(6);const ue=class ue{constructor(ve){kt(this,Te);kt(this,De);kt(this,Le);kt(this,Se);kt(this,Ne);kt(this,at);kt(this,Ct);kt(this,bt);kt(this,ne,"");kt(this,te,!1);kt(this,se,null);kt(this,ie,null);kt(this,ae,null);kt(this,oe,!1);kt(this,le,null);kt(this,ce,this.focusin.bind(this));kt(this,de,this.focusout.bind(this));kt(this,he,!1);kt(this,me,!1);kt(this,ge,!1);yr(this,"_initialOptions",Object.create(null));yr(this,"_uiManager",null);yr(this,"_focusEventsAllowed",!0);yr(this,"_l10nPromise",null);kt(this,ye,!1);kt(this,fe,ue._zIndex++);this.constructor===ue&&(0,K.unreachable)("Cannot initialize AnnotationEditor."),this.parent=ve.parent,this.id=ve.id,this.width=this.height=null,this.pageIndex=ve.parent.pageIndex,this.name=ve.name,this.div=null,this._uiManager=ve.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=ve.isCentered,this._structTreeParentId=null;const{rotation:we,rawDims:{pageWidth:_e,pageHeight:Oe,pageX:Qe,pageY:ct}}=this.parent.viewport;this.rotation=we,this.pageRotation=(360+we-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[_e,Oe],this.pageTranslation=[Qe,ct];const[xt,Tt]=this.parentDimensions;this.x=ve.x/xt,this.y=ve.y/Tt,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return(0,K.shadow)(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(ve){const we=new re({id:ve.parent.getNextId(),parent:ve.parent,uiManager:ve._uiManager});we.annotationElementId=ve.annotationElementId,we.deleted=!0,we._uiManager.addToAnnotationStorage(we)}static initialize(ve,we=null){if(ue._l10nPromise||(ue._l10nPromise=new Map(["editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip"].map(Oe=>[Oe,ve.get(Oe)]))),we!=null&&we.strings)for(const Oe of we.strings)ue._l10nPromise.set(Oe,ve.get(Oe));if(ue._borderLineWidth!==-1)return;const _e=getComputedStyle(document.documentElement);ue._borderLineWidth=parseFloat(_e.getPropertyValue("--outline-width"))||0}static updateDefaultParams(ve,we){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(ve){return!1}static paste(ve,we){(0,K.unreachable)("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return pe(this,ye)}set _isDraggable(ve){var we;Ot(this,ye,ve),(we=this.div)==null||we.classList.toggle("draggable",ve)}center(){const[ve,we]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*we/(ve*2),this.y+=this.width*ve/(we*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*we/(ve*2),this.y-=this.width*ve/(we*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(ve){this._uiManager.addCommands(ve)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=pe(this,fe)}setParent(ve){ve!==null&&(this.pageIndex=ve.pageIndex,this.pageDimensions=ve.pageDimensions),this.parent=ve}focusin(ve){this._focusEventsAllowed&&(pe(this,he)?Ot(this,he,!1):this.parent.setSelected(this))}focusout(ve){var _e;if(!this._focusEventsAllowed||!this.isAttachedToDOM)return;const we=ve.relatedTarget;we!=null&&we.closest(`#${this.id}`)||(ve.preventDefault(),(_e=this.parent)!=null&&_e.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(ve,we,_e,Oe){const[Qe,ct]=this.parentDimensions;[_e,Oe]=this.screenToPageTranslation(_e,Oe),this.x=(ve+_e)/Qe,this.y=(we+Oe)/ct,this.fixAndSetPosition()}translate(ve,we){_t(this,Te,In).call(this,this.parentDimensions,ve,we)}translateInPage(ve,we){_t(this,Te,In).call(this,this.pageDimensions,ve,we),this.div.scrollIntoView({block:"nearest"})}drag(ve,we){const[_e,Oe]=this.parentDimensions;if(this.x+=ve/_e,this.y+=we/Oe,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:Pt,y:$t}=this.div.getBoundingClientRect();this.parent.findNewParent(this,Pt,$t)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:Qe,y:ct}=this;const[xt,Tt]=_t(this,De,Dn).call(this);Qe+=xt,ct+=Tt,this.div.style.left=`${(100*Qe).toFixed(2)}%`,this.div.style.top=`${(100*ct).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}fixAndSetPosition(){const[ve,we]=this.pageDimensions;let{x:_e,y:Oe,width:Qe,height:ct}=this;switch(Qe*=ve,ct*=we,_e*=ve,Oe*=we,this.rotation){case 0:_e=Math.max(0,Math.min(ve-Qe,_e)),Oe=Math.max(0,Math.min(we-ct,Oe));break;case 90:_e=Math.max(0,Math.min(ve-ct,_e)),Oe=Math.min(we,Math.max(Qe,Oe));break;case 180:_e=Math.min(ve,Math.max(Qe,_e)),Oe=Math.min(we,Math.max(ct,Oe));break;case 270:_e=Math.min(ve,Math.max(ct,_e)),Oe=Math.max(0,Math.min(we-Qe,Oe));break}this.x=_e/=ve,this.y=Oe/=we;const[xt,Tt]=_t(this,De,Dn).call(this);_e+=xt,Oe+=Tt;const{style:Pt}=this.div;Pt.left=`${(100*_e).toFixed(2)}%`,Pt.top=`${(100*Oe).toFixed(2)}%`,this.moveInDOM()}screenToPageTranslation(ve,we){var _e;return _t(_e=ue,Ce,Pn).call(_e,ve,we,this.parentRotation)}pageTranslationToScreen(ve,we){var _e;return _t(_e=ue,Ce,Pn).call(_e,ve,we,360-this.parentRotation)}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:ve,pageDimensions:[we,_e]}=this,Oe=we*ve,Qe=_e*ve;return K.FeatureTest.isCSSRoundSupported?[Math.round(Oe),Math.round(Qe)]:[Oe,Qe]}setDims(ve,we){var Qe;const[_e,Oe]=this.parentDimensions;this.div.style.width=`${(100*ve/_e).toFixed(2)}%`,pe(this,oe)||(this.div.style.height=`${(100*we/Oe).toFixed(2)}%`),(Qe=pe(this,se))==null||Qe.classList.toggle("small",ve_e.stopPropagation()),ve.addEventListener("click",_e=>{_e.preventDefault(),this._uiManager.editAltText(this)},{capture:!0}),ve.addEventListener("keydown",_e=>{_e.target===ve&&_e.key==="Enter"&&(_e.preventDefault(),this._uiManager.editAltText(this))}),_t(this,Ct,Cn).call(this),this.div.append(ve),ue.SMALL_EDITOR_SIZE||(ue.SMALL_EDITOR_SIZE=Math.min(128,Math.round(ve.getBoundingClientRect().width*1.4)))}getClientDimensions(){return this.div.getBoundingClientRect()}get altTextData(){return{altText:pe(this,ne),decorative:pe(this,te)}}set altTextData({altText:ve,decorative:we}){pe(this,ne)===ve&&pe(this,te)===we||(Ot(this,ne,ve),Ot(this,te,we),_t(this,Ct,Cn).call(this))}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.setAttribute("tabIndex",0),this.setInForeground(),this.div.addEventListener("focusin",pe(this,ce)),this.div.addEventListener("focusout",pe(this,de));const[ve,we]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*we/ve).toFixed(2)}%`,this.div.style.maxHeight=`${(100*ve/we).toFixed(2)}%`);const[_e,Oe]=this.getInitialTranslation();return this.translate(_e,Oe),(0,V.bindEvents)(this,this.div,["pointerdown"]),this.div}pointerdown(ve){const{isMac:we}=K.FeatureTest.platform;if(ve.button!==0||ve.ctrlKey&&we){ve.preventDefault();return}Ot(this,he,!0),_t(this,bt,ms).call(this,ve)}moveInDOM(){var ve;(ve=this.parent)==null||ve.moveEditorInDOM(this)}_setParentAndPosition(ve,we,_e){ve.changeParent(this),this.x=we,this.y=_e,this.fixAndSetPosition()}getRect(ve,we){const _e=this.parentScale,[Oe,Qe]=this.pageDimensions,[ct,xt]=this.pageTranslation,Tt=ve/_e,Pt=we/_e,$t=this.x*Oe,Ft=this.y*Qe,Nt=this.width*Oe,Gt=this.height*Qe;switch(this.rotation){case 0:return[$t+Tt+ct,Qe-Ft-Pt-Gt+xt,$t+Tt+Nt+ct,Qe-Ft-Pt+xt];case 90:return[$t+Pt+ct,Qe-Ft+Tt+xt,$t+Pt+Gt+ct,Qe-Ft+Tt+Nt+xt];case 180:return[$t-Tt-Nt+ct,Qe-Ft+Pt+xt,$t-Tt+ct,Qe-Ft+Pt+Gt+xt];case 270:return[$t-Pt-Gt+ct,Qe-Ft-Tt-Nt+xt,$t-Pt+ct,Qe-Ft-Tt+xt];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(ve,we){const[_e,Oe,Qe,ct]=ve,xt=Qe-_e,Tt=ct-Oe;switch(this.rotation){case 0:return[_e,we-ct,xt,Tt];case 90:return[_e,we-Oe,Tt,xt];case 180:return[Qe,we-Oe,xt,Tt];case 270:return[Qe,we-ct,Tt,xt];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){Ot(this,ge,!0)}disableEditMode(){Ot(this,ge,!1)}isInEditMode(){return pe(this,ge)}shouldGetKeyboardEvents(){return!1}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}rebuild(){var ve,we;(ve=this.div)==null||ve.addEventListener("focusin",pe(this,ce)),(we=this.div)==null||we.addEventListener("focusout",pe(this,de))}serialize(ve=!1,we=null){(0,K.unreachable)("An editor must be serializable")}static deserialize(ve,we,_e){const Oe=new this.prototype.constructor({parent:we,id:we.getNextId(),uiManager:_e});Oe.rotation=ve.rotation;const[Qe,ct]=Oe.pageDimensions,[xt,Tt,Pt,$t]=Oe.getRectInCurrentCoords(ve.rect,ct);return Oe.x=xt/Qe,Oe.y=Tt/ct,Oe.width=Pt/Qe,Oe.height=$t/ct,Oe}remove(){var ve;this.div.removeEventListener("focusin",pe(this,ce)),this.div.removeEventListener("focusout",pe(this,de)),this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),(ve=pe(this,se))==null||ve.remove(),Ot(this,se,null),Ot(this,ie,null)}get isResizable(){return!1}makeResizable(){this.isResizable&&(_t(this,Se,fs).call(this),pe(this,le).classList.remove("hidden"))}select(){var ve;this.makeResizable(),(ve=this.div)==null||ve.classList.add("selectedEditor")}unselect(){var ve,we,_e;(ve=pe(this,le))==null||ve.classList.add("hidden"),(we=this.div)==null||we.classList.remove("selectedEditor"),(_e=this.div)!=null&&_e.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus()}updateParams(ve,we){}disableEditing(){pe(this,se)&&(pe(this,se).hidden=!0)}enableEditing(){pe(this,se)&&(pe(this,se).hidden=!1)}enterInEditMode(){}get contentDiv(){return this.div}get isEditing(){return pe(this,me)}set isEditing(ve){Ot(this,me,ve),this.parent&&(ve?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(ve,we){Ot(this,oe,!0);const _e=ve/we,{style:Oe}=this.div;Oe.aspectRatio=_e,Oe.height="auto"}static get MIN_SIZE(){return 16}};ne=new WeakMap,te=new WeakMap,se=new WeakMap,ie=new WeakMap,ae=new WeakMap,oe=new WeakMap,le=new WeakMap,ce=new WeakMap,de=new WeakMap,he=new WeakMap,me=new WeakMap,ge=new WeakMap,ye=new WeakMap,fe=new WeakMap,Te=new WeakSet,In=function([ve,we],_e,Oe){[_e,Oe]=this.screenToPageTranslation(_e,Oe),this.x+=_e/ve,this.y+=Oe/we,this.fixAndSetPosition()},De=new WeakSet,Dn=function(){const[ve,we]=this.parentDimensions,{_borderLineWidth:_e}=ue,Oe=_e/ve,Qe=_e/we;switch(this.rotation){case 90:return[-Oe,Qe];case 180:return[Oe,Qe];case 270:return[Oe,-Qe];default:return[-Oe,-Qe]}},Ce=new WeakSet,Pn=function(ve,we,_e){switch(_e){case 90:return[we,-ve];case 180:return[-ve,-we];case 270:return[-we,ve];default:return[ve,we]}},Le=new WeakSet,On=function(ve){switch(ve){case 90:{const[we,_e]=this.pageDimensions;return[0,-we/_e,_e/we,0]}case 180:return[-1,0,0,-1];case 270:{const[we,_e]=this.pageDimensions;return[0,we/_e,-_e/we,0]}default:return[1,0,0,1]}},Se=new WeakSet,fs=function(){if(pe(this,le))return;Ot(this,le,document.createElement("div")),pe(this,le).classList.add("resizers");const ve=["topLeft","topRight","bottomRight","bottomLeft"];this._willKeepAspectRatio||ve.push("topMiddle","middleRight","bottomMiddle","middleLeft");for(const we of ve){const _e=document.createElement("div");pe(this,le).append(_e),_e.classList.add("resizer",we),_e.addEventListener("pointerdown",_t(this,Ne,ps).bind(this,we)),_e.addEventListener("contextmenu",Y.noContextMenu)}this.div.prepend(pe(this,le))},Ne=new WeakSet,ps=function(ve,we){we.preventDefault();const{isMac:_e}=K.FeatureTest.platform;if(we.button!==0||we.ctrlKey&&_e)return;const Oe=_t(this,at,hs).bind(this,ve),Qe=this._isDraggable;this._isDraggable=!1;const ct={passive:!0,capture:!0};window.addEventListener("pointermove",Oe,ct);const xt=this.x,Tt=this.y,Pt=this.width,$t=this.height,Ft=this.parent.div.style.cursor,Nt=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(we.target).cursor;const Gt=()=>{this._isDraggable=Qe,window.removeEventListener("pointerup",Gt),window.removeEventListener("blur",Gt),window.removeEventListener("pointermove",Oe,ct),this.parent.div.style.cursor=Ft,this.div.style.cursor=Nt;const ft=this.x,yt=this.y,At=this.width,Rt=this.height;ft===xt&&yt===Tt&&At===Pt&&Rt===$t||this.addCommands({cmd:()=>{this.width=At,this.height=Rt,this.x=ft,this.y=yt;const[mt,ht]=this.parentDimensions;this.setDims(mt*At,ht*Rt),this.fixAndSetPosition()},undo:()=>{this.width=Pt,this.height=$t,this.x=xt,this.y=Tt;const[mt,ht]=this.parentDimensions;this.setDims(mt*Pt,ht*$t),this.fixAndSetPosition()},mustExec:!0})};window.addEventListener("pointerup",Gt),window.addEventListener("blur",Gt)},at=new WeakSet,hs=function(ve,we){const[_e,Oe]=this.parentDimensions,Qe=this.x,ct=this.y,xt=this.width,Tt=this.height,Pt=ue.MIN_SIZE/_e,$t=ue.MIN_SIZE/Oe,Ft=Ht=>Math.round(Ht*1e4)/1e4,Nt=_t(this,Le,On).call(this,this.rotation),Gt=(Ht,Kt)=>[Nt[0]*Ht+Nt[2]*Kt,Nt[1]*Ht+Nt[3]*Kt],ft=_t(this,Le,On).call(this,360-this.rotation),yt=(Ht,Kt)=>[ft[0]*Ht+ft[2]*Kt,ft[1]*Ht+ft[3]*Kt];let At,Rt,mt=!1,ht=!1;switch(ve){case"topLeft":mt=!0,At=(Ht,Kt)=>[0,0],Rt=(Ht,Kt)=>[Ht,Kt];break;case"topMiddle":At=(Ht,Kt)=>[Ht/2,0],Rt=(Ht,Kt)=>[Ht/2,Kt];break;case"topRight":mt=!0,At=(Ht,Kt)=>[Ht,0],Rt=(Ht,Kt)=>[0,Kt];break;case"middleRight":ht=!0,At=(Ht,Kt)=>[Ht,Kt/2],Rt=(Ht,Kt)=>[0,Kt/2];break;case"bottomRight":mt=!0,At=(Ht,Kt)=>[Ht,Kt],Rt=(Ht,Kt)=>[0,0];break;case"bottomMiddle":At=(Ht,Kt)=>[Ht/2,Kt],Rt=(Ht,Kt)=>[Ht/2,0];break;case"bottomLeft":mt=!0,At=(Ht,Kt)=>[0,Kt],Rt=(Ht,Kt)=>[Ht,0];break;case"middleLeft":ht=!0,At=(Ht,Kt)=>[0,Kt/2],Rt=(Ht,Kt)=>[Ht,Kt/2];break}const jt=At(xt,Tt),Vt=Rt(xt,Tt);let Bt=Gt(...Vt);const er=Ft(Qe+Bt[0]),sr=Ft(ct+Bt[1]);let ir=1,dr=1,[ar,or]=this.screenToPageTranslation(we.movementX,we.movementY);if([ar,or]=yt(ar/_e,or/Oe),mt){const Ht=Math.hypot(xt,Tt);ir=dr=Math.max(Math.min(Math.hypot(Vt[0]-jt[0]-ar,Vt[1]-jt[1]-or)/Ht,1/xt,1/Tt),Pt/xt,$t/Tt)}else ht?ir=Math.max(Pt,Math.min(1,Math.abs(Vt[0]-jt[0]-ar)))/xt:dr=Math.max($t,Math.min(1,Math.abs(Vt[1]-jt[1]-or)))/Tt;const cr=Ft(xt*ir),Lt=Ft(Tt*dr);Bt=Gt(...Rt(cr,Lt));const It=er-Bt[0],St=sr-Bt[1];this.width=cr,this.height=Lt,this.x=It,this.y=St,this.setDims(_e*cr,Oe*Lt),this.fixAndSetPosition()},Ct=new WeakSet,Cn=async function(){var _e;const ve=pe(this,se);if(!ve)return;if(!pe(this,ne)&&!pe(this,te)){ve.classList.remove("done"),(_e=pe(this,ie))==null||_e.remove();return}ue._l10nPromise.get("editor_alt_text_edit_button_label").then(Oe=>{ve.setAttribute("aria-label",Oe)});let we=pe(this,ie);if(!we){Ot(this,ie,we=document.createElement("span")),we.className="tooltip",we.setAttribute("role","tooltip");const Oe=we.id=`alt-text-tooltip-${this.id}`;ve.setAttribute("aria-describedby",Oe);const Qe=100;ve.addEventListener("mouseenter",()=>{Ot(this,ae,setTimeout(()=>{Ot(this,ae,null),pe(this,ie).classList.add("show"),this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",subtype:this.editorType,data:{action:"alt_text_tooltip"}}})},Qe))}),ve.addEventListener("mouseleave",()=>{var ct;clearTimeout(pe(this,ae)),Ot(this,ae,null),(ct=pe(this,ie))==null||ct.classList.remove("show")})}ve.classList.add("done"),we.innerText=pe(this,te)?await ue._l10nPromise.get("editor_alt_text_decorative_tooltip"):pe(this,ne),we.parentNode||ve.append(we)},bt=new WeakSet,ms=function(ve){if(!this._isDraggable)return;const we=this._uiManager.isSelected(this);this._uiManager.setUpDragSession();let _e,Oe;we&&(_e={passive:!0,capture:!0},Oe=ct=>{const[xt,Tt]=this.screenToPageTranslation(ct.movementX,ct.movementY);this._uiManager.dragSelectedEditors(xt,Tt)},window.addEventListener("pointermove",Oe,_e));const Qe=()=>{if(window.removeEventListener("pointerup",Qe),window.removeEventListener("blur",Qe),we&&window.removeEventListener("pointermove",Oe,_e),Ot(this,he,!1),!this._uiManager.endDragSession()){const{isMac:ct}=K.FeatureTest.platform;ve.ctrlKey&&!ct||ve.shiftKey||ve.metaKey&&ct?this.parent.toggleSelected(this):this.parent.setSelected(this)}};window.addEventListener("pointerup",Qe),window.addEventListener("blur",Qe)},kt(ue,Ce),yr(ue,"_borderLineWidth",-1),yr(ue,"_colorManager",new V.ColorManager),yr(ue,"_zIndex",1),yr(ue,"SMALL_EDITOR_SIZE",0);let J=ue;C.AnnotationEditor=J;class re extends J{constructor(ve){super(ve),this.annotationElementId=ve.annotationElementId,this.deleted=!0}serialize(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex}}}},(T,C,$)=>{var oe,le,ce,de,he,Nn,ye,fe,Te,Pe,De,gs,je,Le,Ke,Se,Ie,Ne,pt,at,dt,Ct,ut,bt,Re,ue,be,ve,we,_e,Oe,Qe,ct,xt,Tt,Pt,$t,Ft,Nt,Gt,ft,yt,At,Rt,mt,ht,jt,vs,Bt,Mn,sr,$n,dr,gn,or,Ln,Lt,Fn,St,_r,Kt,Nr,vr,ys,zt,ks,Zt,Vn,nr,Kr,Wt,Un;Object.defineProperty(C,"__esModule",{value:!0}),C.KeyboardManager=C.CommandManager=C.ColorManager=C.AnnotationEditorUIManager=void 0,C.bindEvents=Y,C.opacityToHex=J;var V=$(1),K=$(6);function Y(gt,Ee,st){for(const vt of st)Ee.addEventListener(vt,gt[vt].bind(gt))}function J(gt){return Math.round(Math.min(255,Math.max(1,255*gt))).toString(16).padStart(2,"0")}class re{constructor(){kt(this,oe,0)}getId(){return`${V.AnnotationEditorPrefix}${Cr(this,oe)._++}`}}oe=new WeakMap;const ge=class ge{constructor(){kt(this,he);kt(this,le,(0,V.getUuid)());kt(this,ce,0);kt(this,de,null)}static get _isSVGFittingCanvas(){const Ee='data:image/svg+xml;charset=UTF-8,',vt=new OffscreenCanvas(1,3).getContext("2d"),Et=new Image;Et.src=Ee;const wt=Et.decode().then(()=>(vt.drawImage(Et,0,0,1,1,0,0,1,3),new Uint32Array(vt.getImageData(0,0,1,1).data.buffer)[0]===0));return(0,V.shadow)(this,"_isSVGFittingCanvas",wt)}async getFromFile(Ee){const{lastModified:st,name:vt,size:Et,type:wt}=Ee;return _t(this,he,Nn).call(this,`${st}_${vt}_${Et}_${wt}`,Ee)}async getFromUrl(Ee){return _t(this,he,Nn).call(this,Ee,Ee)}async getFromId(Ee){pe(this,de)||Ot(this,de,new Map);const st=pe(this,de).get(Ee);return st?st.bitmap?(st.refCounter+=1,st):st.file?this.getFromFile(st.file):this.getFromUrl(st.url):null}getSvgUrl(Ee){const st=pe(this,de).get(Ee);return st!=null&&st.isSvg?st.svgUrl:null}deleteId(Ee){pe(this,de)||Ot(this,de,new Map);const st=pe(this,de).get(Ee);st&&(st.refCounter-=1,st.refCounter===0&&(st.bitmap=null))}isValidId(Ee){return Ee.startsWith(`image_${pe(this,le)}_`)}};le=new WeakMap,ce=new WeakMap,de=new WeakMap,he=new WeakSet,Nn=async function(Ee,st){pe(this,de)||Ot(this,de,new Map);let vt=pe(this,de).get(Ee);if(vt===null)return null;if(vt!=null&&vt.bitmap)return vt.refCounter+=1,vt;try{vt||(vt={bitmap:null,id:`image_${pe(this,le)}_${Cr(this,ce)._++}`,refCounter:0,isSvg:!1});let Et;if(typeof st=="string"){vt.url=st;const wt=await fetch(st);if(!wt.ok)throw new Error(wt.statusText);Et=await wt.blob()}else Et=vt.file=st;if(Et.type==="image/svg+xml"){const wt=ge._isSVGFittingCanvas,Mt=new FileReader,Ut=new Image,Yt=new Promise((qt,ur)=>{Ut.onload=()=>{vt.bitmap=Ut,vt.isSvg=!0,qt()},Mt.onload=async()=>{const Xt=vt.svgUrl=Mt.result;Ut.src=await wt?`${Xt}#svgView(preserveAspectRatio(none))`:Xt},Ut.onerror=Mt.onerror=ur});Mt.readAsDataURL(Et),await Yt}else vt.bitmap=await createImageBitmap(Et);vt.refCounter=1}catch(Et){console.error(Et),vt=null}return pe(this,de).set(Ee,vt),vt&&pe(this,de).set(vt.id,vt),vt};let ne=ge;class te{constructor(Ee=128){kt(this,ye,[]);kt(this,fe,!1);kt(this,Te,void 0);kt(this,Pe,-1);Ot(this,Te,Ee)}add({cmd:Ee,undo:st,mustExec:vt,type:Et=NaN,overwriteIfSameType:wt=!1,keepUndo:Mt=!1}){if(vt&&Ee(),pe(this,fe))return;const Ut={cmd:Ee,undo:st,type:Et};if(pe(this,Pe)===-1){pe(this,ye).length>0&&(pe(this,ye).length=0),Ot(this,Pe,0),pe(this,ye).push(Ut);return}if(wt&&pe(this,ye)[pe(this,Pe)].type===Et){Mt&&(Ut.undo=pe(this,ye)[pe(this,Pe)].undo),pe(this,ye)[pe(this,Pe)]=Ut;return}const Yt=pe(this,Pe)+1;Yt===pe(this,Te)?pe(this,ye).splice(0,1):(Ot(this,Pe,Yt),Ytwt===st[Mt]))return Ce._colorsMapping.get(vt);return st}getHexCode(Ee){const st=this._colors.get(Ee);return st?V.Util.makeHexColor(...st):Ee}};yr(Ce,"_colorsMapping",new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]));let ie=Ce;C.ColorManager=ie;const Qt=class Qt{constructor(Ee,st,vt,Et,wt,Mt){kt(this,jt);kt(this,Bt);kt(this,sr);kt(this,dr);kt(this,or);kt(this,Lt);kt(this,St);kt(this,Kt);kt(this,vr);kt(this,zt);kt(this,Zt);kt(this,nr);kt(this,Wt);kt(this,je,null);kt(this,Le,new Map);kt(this,Ke,new Map);kt(this,Se,null);kt(this,Ie,null);kt(this,Ne,new te);kt(this,pt,0);kt(this,at,new Set);kt(this,dt,null);kt(this,Ct,null);kt(this,ut,new Set);kt(this,bt,null);kt(this,Re,new re);kt(this,ue,!1);kt(this,be,!1);kt(this,ve,null);kt(this,we,V.AnnotationEditorType.NONE);kt(this,_e,new Set);kt(this,Oe,null);kt(this,Qe,this.blur.bind(this));kt(this,ct,this.focus.bind(this));kt(this,xt,this.copy.bind(this));kt(this,Tt,this.cut.bind(this));kt(this,Pt,this.paste.bind(this));kt(this,$t,this.keydown.bind(this));kt(this,Ft,this.onEditingAction.bind(this));kt(this,Nt,this.onPageChanging.bind(this));kt(this,Gt,this.onScaleChanging.bind(this));kt(this,ft,this.onRotationChanging.bind(this));kt(this,yt,{isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1});kt(this,At,[0,0]);kt(this,Rt,null);kt(this,mt,null);kt(this,ht,null);Ot(this,mt,Ee),Ot(this,ht,st),Ot(this,Se,vt),this._eventBus=Et,this._eventBus._on("editingaction",pe(this,Ft)),this._eventBus._on("pagechanging",pe(this,Nt)),this._eventBus._on("scalechanging",pe(this,Gt)),this._eventBus._on("rotationchanging",pe(this,ft)),Ot(this,Ie,wt.annotationStorage),Ot(this,bt,wt.filterFactory),Ot(this,Oe,Mt),this.viewParameters={realScale:K.PixelsPerInch.PDF_TO_CSS_UNITS,rotation:0}}static get _keyboardManager(){const Ee=Qt.prototype,st=wt=>{const{activeElement:Mt}=document;return Mt&&pe(wt,mt).contains(Mt)&&wt.hasSomethingToControl()},vt=this.TRANSLATE_SMALL,Et=this.TRANSLATE_BIG;return(0,V.shadow)(this,"_keyboardManager",new se([[["ctrl+a","mac+meta+a"],Ee.selectAll],[["ctrl+z","mac+meta+z"],Ee.undo],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],Ee.redo],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],Ee.delete],[["Escape","mac+Escape"],Ee.unselectAll],[["ArrowLeft","mac+ArrowLeft"],Ee.translateSelectedEditors,{args:[-vt,0],checker:st}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],Ee.translateSelectedEditors,{args:[-Et,0],checker:st}],[["ArrowRight","mac+ArrowRight"],Ee.translateSelectedEditors,{args:[vt,0],checker:st}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],Ee.translateSelectedEditors,{args:[Et,0],checker:st}],[["ArrowUp","mac+ArrowUp"],Ee.translateSelectedEditors,{args:[0,-vt],checker:st}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],Ee.translateSelectedEditors,{args:[0,-Et],checker:st}],[["ArrowDown","mac+ArrowDown"],Ee.translateSelectedEditors,{args:[0,vt],checker:st}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],Ee.translateSelectedEditors,{args:[0,Et],checker:st}]]))}destroy(){_t(this,dr,gn).call(this),_t(this,Bt,Mn).call(this),this._eventBus._off("editingaction",pe(this,Ft)),this._eventBus._off("pagechanging",pe(this,Nt)),this._eventBus._off("scalechanging",pe(this,Gt)),this._eventBus._off("rotationchanging",pe(this,ft));for(const Ee of pe(this,Ke).values())Ee.destroy();pe(this,Ke).clear(),pe(this,Le).clear(),pe(this,ut).clear(),Ot(this,je,null),pe(this,_e).clear(),pe(this,Ne).destroy(),pe(this,Se).destroy()}get hcmFilter(){return(0,V.shadow)(this,"hcmFilter",pe(this,Oe)?pe(this,bt).addHCMFilter(pe(this,Oe).foreground,pe(this,Oe).background):"none")}get direction(){return(0,V.shadow)(this,"direction",getComputedStyle(pe(this,mt)).direction)}editAltText(Ee){var st;(st=pe(this,Se))==null||st.editAltText(this,Ee)}onPageChanging({pageNumber:Ee}){Ot(this,pt,Ee-1)}focusMainContainer(){pe(this,mt).focus()}findParent(Ee,st){for(const vt of pe(this,Ke).values()){const{x:Et,y:wt,width:Mt,height:Ut}=vt.div.getBoundingClientRect();if(Ee>=Et&&Ee<=Et+Mt&&st>=wt&&st<=wt+Ut)return vt}return null}disableUserSelect(Ee=!1){pe(this,ht).classList.toggle("noUserSelect",Ee)}addShouldRescale(Ee){pe(this,ut).add(Ee)}removeShouldRescale(Ee){pe(this,ut).delete(Ee)}onScaleChanging({scale:Ee}){this.commitOrRemove(),this.viewParameters.realScale=Ee*K.PixelsPerInch.PDF_TO_CSS_UNITS;for(const st of pe(this,ut))st.onScaleChanging()}onRotationChanging({pagesRotation:Ee}){this.commitOrRemove(),this.viewParameters.rotation=Ee}addToAnnotationStorage(Ee){!Ee.isEmpty()&&pe(this,Ie)&&!pe(this,Ie).has(Ee.id)&&pe(this,Ie).setValue(Ee.id,Ee)}blur(){if(!this.hasSelection)return;const{activeElement:Ee}=document;for(const st of pe(this,_e))if(st.div.contains(Ee)){Ot(this,ve,[st,Ee]),st._focusEventsAllowed=!1;break}}focus(){if(!pe(this,ve))return;const[Ee,st]=pe(this,ve);Ot(this,ve,null),st.addEventListener("focusin",()=>{Ee._focusEventsAllowed=!0},{once:!0}),st.focus()}addEditListeners(){_t(this,sr,$n).call(this),_t(this,or,Ln).call(this)}removeEditListeners(){_t(this,dr,gn).call(this),_t(this,Lt,Fn).call(this)}copy(Ee){var vt;if(Ee.preventDefault(),(vt=pe(this,je))==null||vt.commitOrRemove(),!this.hasSelection)return;const st=[];for(const Et of pe(this,_e)){const wt=Et.serialize(!0);wt&&st.push(wt)}st.length!==0&&Ee.clipboardData.setData("application/pdfjs",JSON.stringify(st))}cut(Ee){this.copy(Ee),this.delete()}paste(Ee){Ee.preventDefault();const{clipboardData:st}=Ee;for(const wt of st.items)for(const Mt of pe(this,Ct))if(Mt.isHandlingMimeForPasting(wt.type)){Mt.paste(wt,this.currentLayer);return}let vt=st.getData("application/pdfjs");if(!vt)return;try{vt=JSON.parse(vt)}catch(wt){(0,V.warn)(`paste: "${wt.message}".`);return}if(!Array.isArray(vt))return;this.unselectAll();const Et=this.currentLayer;try{const wt=[];for(const Yt of vt){const qt=Et.deserialize(Yt);if(!qt)return;wt.push(qt)}const Mt=()=>{for(const Yt of wt)_t(this,Zt,Vn).call(this,Yt);_t(this,Wt,Un).call(this,wt)},Ut=()=>{for(const Yt of wt)Yt.remove()};this.addCommands({cmd:Mt,undo:Ut,mustExec:!0})}catch(wt){(0,V.warn)(`paste: "${wt.message}".`)}}keydown(Ee){var st;(st=this.getActive())!=null&&st.shouldGetKeyboardEvents()||Qt._keyboardManager.exec(this,Ee)}onEditingAction(Ee){["undo","redo","delete","selectAll"].includes(Ee.name)&&this[Ee.name]()}setEditingState(Ee){Ee?(_t(this,jt,vs).call(this),_t(this,sr,$n).call(this),_t(this,or,Ln).call(this),_t(this,St,_r).call(this,{isEditing:pe(this,we)!==V.AnnotationEditorType.NONE,isEmpty:_t(this,nr,Kr).call(this),hasSomethingToUndo:pe(this,Ne).hasSomethingToUndo(),hasSomethingToRedo:pe(this,Ne).hasSomethingToRedo(),hasSelectedEditor:!1})):(_t(this,Bt,Mn).call(this),_t(this,dr,gn).call(this),_t(this,Lt,Fn).call(this),_t(this,St,_r).call(this,{isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(Ee){if(!pe(this,Ct)){Ot(this,Ct,Ee);for(const st of pe(this,Ct))_t(this,Kt,Nr).call(this,st.defaultPropertiesToUpdate)}}getId(){return pe(this,Re).getId()}get currentLayer(){return pe(this,Ke).get(pe(this,pt))}getLayer(Ee){return pe(this,Ke).get(Ee)}get currentPageIndex(){return pe(this,pt)}addLayer(Ee){pe(this,Ke).set(Ee.pageIndex,Ee),pe(this,ue)?Ee.enable():Ee.disable()}removeLayer(Ee){pe(this,Ke).delete(Ee.pageIndex)}updateMode(Ee,st=null){if(pe(this,we)!==Ee){if(Ot(this,we,Ee),Ee===V.AnnotationEditorType.NONE){this.setEditingState(!1),_t(this,zt,ks).call(this);return}this.setEditingState(!0),_t(this,vr,ys).call(this),this.unselectAll();for(const vt of pe(this,Ke).values())vt.updateMode(Ee);if(st){for(const vt of pe(this,Le).values())if(vt.annotationElementId===st){this.setSelected(vt),vt.enterInEditMode();break}}}}updateToolbar(Ee){Ee!==pe(this,we)&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:Ee})}updateParams(Ee,st){if(pe(this,Ct)){if(Ee===V.AnnotationEditorParamsType.CREATE){this.currentLayer.addNewEditor(Ee);return}for(const vt of pe(this,_e))vt.updateParams(Ee,st);for(const vt of pe(this,Ct))vt.updateDefaultParams(Ee,st)}}enableWaiting(Ee=!1){if(pe(this,be)!==Ee){Ot(this,be,Ee);for(const st of pe(this,Ke).values())Ee?st.disableClick():st.enableClick(),st.div.classList.toggle("waiting",Ee)}}getEditors(Ee){const st=[];for(const vt of pe(this,Le).values())vt.pageIndex===Ee&&st.push(vt);return st}getEditor(Ee){return pe(this,Le).get(Ee)}addEditor(Ee){pe(this,Le).set(Ee.id,Ee)}removeEditor(Ee){var st;pe(this,Le).delete(Ee.id),this.unselect(Ee),(!Ee.annotationElementId||!pe(this,at).has(Ee.annotationElementId))&&((st=pe(this,Ie))==null||st.remove(Ee.id))}addDeletedAnnotationElement(Ee){pe(this,at).add(Ee.annotationElementId),Ee.deleted=!0}isDeletedAnnotationElement(Ee){return pe(this,at).has(Ee)}removeDeletedAnnotationElement(Ee){pe(this,at).delete(Ee.annotationElementId),Ee.deleted=!1}setActiveEditor(Ee){pe(this,je)!==Ee&&(Ot(this,je,Ee),Ee&&_t(this,Kt,Nr).call(this,Ee.propertiesToUpdate))}toggleSelected(Ee){if(pe(this,_e).has(Ee)){pe(this,_e).delete(Ee),Ee.unselect(),_t(this,St,_r).call(this,{hasSelectedEditor:this.hasSelection});return}pe(this,_e).add(Ee),Ee.select(),_t(this,Kt,Nr).call(this,Ee.propertiesToUpdate),_t(this,St,_r).call(this,{hasSelectedEditor:!0})}setSelected(Ee){for(const st of pe(this,_e))st!==Ee&&st.unselect();pe(this,_e).clear(),pe(this,_e).add(Ee),Ee.select(),_t(this,Kt,Nr).call(this,Ee.propertiesToUpdate),_t(this,St,_r).call(this,{hasSelectedEditor:!0})}isSelected(Ee){return pe(this,_e).has(Ee)}unselect(Ee){Ee.unselect(),pe(this,_e).delete(Ee),_t(this,St,_r).call(this,{hasSelectedEditor:this.hasSelection})}get hasSelection(){return pe(this,_e).size!==0}undo(){pe(this,Ne).undo(),_t(this,St,_r).call(this,{hasSomethingToUndo:pe(this,Ne).hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:_t(this,nr,Kr).call(this)})}redo(){pe(this,Ne).redo(),_t(this,St,_r).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:pe(this,Ne).hasSomethingToRedo(),isEmpty:_t(this,nr,Kr).call(this)})}addCommands(Ee){pe(this,Ne).add(Ee),_t(this,St,_r).call(this,{hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:_t(this,nr,Kr).call(this)})}delete(){if(this.commitOrRemove(),!this.hasSelection)return;const Ee=[...pe(this,_e)],st=()=>{for(const Et of Ee)Et.remove()},vt=()=>{for(const Et of Ee)_t(this,Zt,Vn).call(this,Et)};this.addCommands({cmd:st,undo:vt,mustExec:!0})}commitOrRemove(){var Ee;(Ee=pe(this,je))==null||Ee.commitOrRemove()}hasSomethingToControl(){return pe(this,je)||this.hasSelection}selectAll(){for(const Ee of pe(this,_e))Ee.commit();_t(this,Wt,Un).call(this,pe(this,Le).values())}unselectAll(){if(pe(this,je)){pe(this,je).commitOrRemove();return}if(this.hasSelection){for(const Ee of pe(this,_e))Ee.unselect();pe(this,_e).clear(),_t(this,St,_r).call(this,{hasSelectedEditor:!1})}}translateSelectedEditors(Ee,st,vt=!1){if(vt||this.commitOrRemove(),!this.hasSelection)return;pe(this,At)[0]+=Ee,pe(this,At)[1]+=st;const[Et,wt]=pe(this,At),Mt=[...pe(this,_e)],Ut=1e3;pe(this,Rt)&&clearTimeout(pe(this,Rt)),Ot(this,Rt,setTimeout(()=>{Ot(this,Rt,null),pe(this,At)[0]=pe(this,At)[1]=0,this.addCommands({cmd:()=>{for(const Yt of Mt)pe(this,Le).has(Yt.id)&&Yt.translateInPage(Et,wt)},undo:()=>{for(const Yt of Mt)pe(this,Le).has(Yt.id)&&Yt.translateInPage(-Et,-wt)},mustExec:!1})},Ut));for(const Yt of Mt)Yt.translateInPage(Ee,st)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),Ot(this,dt,new Map);for(const Ee of pe(this,_e))pe(this,dt).set(Ee,{savedX:Ee.x,savedY:Ee.y,savedPageIndex:Ee.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!pe(this,dt))return!1;this.disableUserSelect(!1);const Ee=pe(this,dt);Ot(this,dt,null);let st=!1;for(const[{x:Et,y:wt,pageIndex:Mt},Ut]of Ee)Ut.newX=Et,Ut.newY=wt,Ut.newPageIndex=Mt,st||(st=Et!==Ut.savedX||wt!==Ut.savedY||Mt!==Ut.savedPageIndex);if(!st)return!1;const vt=(Et,wt,Mt,Ut)=>{if(pe(this,Le).has(Et.id)){const Yt=pe(this,Ke).get(Ut);Yt?Et._setParentAndPosition(Yt,wt,Mt):(Et.pageIndex=Ut,Et.x=wt,Et.y=Mt)}};return this.addCommands({cmd:()=>{for(const[Et,{newX:wt,newY:Mt,newPageIndex:Ut}]of Ee)vt(Et,wt,Mt,Ut)},undo:()=>{for(const[Et,{savedX:wt,savedY:Mt,savedPageIndex:Ut}]of Ee)vt(Et,wt,Mt,Ut)},mustExec:!0}),!0}dragSelectedEditors(Ee,st){if(pe(this,dt))for(const vt of pe(this,dt).keys())vt.drag(Ee,st)}rebuild(Ee){if(Ee.parent===null){const st=this.getLayer(Ee.pageIndex);st?(st.changeParent(Ee),st.addOrRebuild(Ee)):(this.addEditor(Ee),this.addToAnnotationStorage(Ee),Ee.rebuild())}else Ee.parent.addOrRebuild(Ee)}isActive(Ee){return pe(this,je)===Ee}getActive(){return pe(this,je)}getMode(){return pe(this,we)}get imageManager(){return(0,V.shadow)(this,"imageManager",new ne)}};je=new WeakMap,Le=new WeakMap,Ke=new WeakMap,Se=new WeakMap,Ie=new WeakMap,Ne=new WeakMap,pt=new WeakMap,at=new WeakMap,dt=new WeakMap,Ct=new WeakMap,ut=new WeakMap,bt=new WeakMap,Re=new WeakMap,ue=new WeakMap,be=new WeakMap,ve=new WeakMap,we=new WeakMap,_e=new WeakMap,Oe=new WeakMap,Qe=new WeakMap,ct=new WeakMap,xt=new WeakMap,Tt=new WeakMap,Pt=new WeakMap,$t=new WeakMap,Ft=new WeakMap,Nt=new WeakMap,Gt=new WeakMap,ft=new WeakMap,yt=new WeakMap,At=new WeakMap,Rt=new WeakMap,mt=new WeakMap,ht=new WeakMap,jt=new WeakSet,vs=function(){window.addEventListener("focus",pe(this,ct)),window.addEventListener("blur",pe(this,Qe))},Bt=new WeakSet,Mn=function(){window.removeEventListener("focus",pe(this,ct)),window.removeEventListener("blur",pe(this,Qe))},sr=new WeakSet,$n=function(){window.addEventListener("keydown",pe(this,$t),{capture:!0})},dr=new WeakSet,gn=function(){window.removeEventListener("keydown",pe(this,$t),{capture:!0})},or=new WeakSet,Ln=function(){document.addEventListener("copy",pe(this,xt)),document.addEventListener("cut",pe(this,Tt)),document.addEventListener("paste",pe(this,Pt))},Lt=new WeakSet,Fn=function(){document.removeEventListener("copy",pe(this,xt)),document.removeEventListener("cut",pe(this,Tt)),document.removeEventListener("paste",pe(this,Pt))},St=new WeakSet,_r=function(Ee){Object.entries(Ee).some(([vt,Et])=>pe(this,yt)[vt]!==Et)&&this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(pe(this,yt),Ee)})},Kt=new WeakSet,Nr=function(Ee){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:Ee})},vr=new WeakSet,ys=function(){if(!pe(this,ue)){Ot(this,ue,!0);for(const Ee of pe(this,Ke).values())Ee.enable()}},zt=new WeakSet,ks=function(){if(this.unselectAll(),pe(this,ue)){Ot(this,ue,!1);for(const Ee of pe(this,Ke).values())Ee.disable()}},Zt=new WeakSet,Vn=function(Ee){const st=pe(this,Ke).get(Ee.pageIndex);st?st.addOrRebuild(Ee):this.addEditor(Ee)},nr=new WeakSet,Kr=function(){if(pe(this,Le).size===0)return!0;if(pe(this,Le).size===1)for(const Ee of pe(this,Le).values())return Ee.isEmpty();return!1},Wt=new WeakSet,Un=function(Ee){pe(this,_e).clear();for(const st of Ee)st.isEmpty()||(pe(this,_e).add(st),st.select());_t(this,St,_r).call(this,{hasSelectedEditor:!0})},yr(Qt,"TRANSLATE_SMALL",1),yr(Qt,"TRANSLATE_BIG",10);let ae=Qt;C.AnnotationEditorUIManager=ae},(T,C,$)=>{var pt,at,dt,Ct,ut,bt,Re,ue,be,ve,we,_e,jr,Qe,Ir,xt,Bn,Pt,vn,Ft,yn,Gt,sn,yt,ln;Object.defineProperty(C,"__esModule",{value:!0}),C.StatTimer=C.RenderingCancelledException=C.PixelsPerInch=C.PageViewport=C.PDFDateString=C.DOMStandardFontDataFactory=C.DOMSVGFactory=C.DOMFilterFactory=C.DOMCanvasFactory=C.DOMCMapReaderFactory=void 0,C.deprecated=Pe,C.getColorValues=Le,C.getCurrentTransform=Ke,C.getCurrentTransformInverse=Se,C.getFilenameFromUrl=he,C.getPdfFilenameFromUrl=me,C.getRGB=je,C.getXfaPageViewport=Ce,C.isDataScheme=ce,C.isPdfFile=de,C.isValidFetchUrl=ye,C.loadScript=Te,C.noContextMenu=fe,C.setLayerDimensions=Ie;var V=$(7),K=$(1);const Y="http://www.w3.org/2000/svg",Ne=class Ne{};yr(Ne,"CSS",96),yr(Ne,"PDF",72),yr(Ne,"PDF_TO_CSS_UNITS",Ne.CSS/Ne.PDF);let J=Ne;C.PixelsPerInch=J;class re extends V.BaseFilterFactory{constructor({docId:ht,ownerDocument:jt=globalThis.document}={}){super();kt(this,_e);kt(this,Qe);kt(this,xt);kt(this,Pt);kt(this,Ft);kt(this,Gt);kt(this,yt);kt(this,pt,void 0);kt(this,at,void 0);kt(this,dt,void 0);kt(this,Ct,void 0);kt(this,ut,void 0);kt(this,bt,void 0);kt(this,Re,void 0);kt(this,ue,void 0);kt(this,be,void 0);kt(this,ve,void 0);kt(this,we,0);Ot(this,dt,ht),Ot(this,Ct,jt)}addFilter(ht){if(!ht)return"none";let jt=pe(this,_e,jr).get(ht);if(jt)return jt;let Vt,Bt,er,sr;if(ht.length===1){const or=ht[0],cr=new Array(256);for(let Lt=0;Lt<256;Lt++)cr[Lt]=or[Lt]/255;sr=Vt=Bt=er=cr.join(",")}else{const[or,cr,Lt]=ht,It=new Array(256),St=new Array(256),Ht=new Array(256);for(let Kt=0;Kt<256;Kt++)It[Kt]=or[Kt]/255,St[Kt]=cr[Kt]/255,Ht[Kt]=Lt[Kt]/255;Vt=It.join(","),Bt=St.join(","),er=Ht.join(","),sr=`${Vt}${Bt}${er}`}if(jt=pe(this,_e,jr).get(sr),jt)return pe(this,_e,jr).set(ht,jt),jt;const ir=`g_${pe(this,dt)}_transfer_map_${Cr(this,we)._++}`,dr=`url(#${ir})`;pe(this,_e,jr).set(ht,dr),pe(this,_e,jr).set(sr,dr);const ar=_t(this,Pt,vn).call(this,ir);return _t(this,Gt,sn).call(this,Vt,Bt,er,ar),dr}addHCMFilter(ht,jt){var cr;const Vt=`${ht}-${jt}`;if(pe(this,bt)===Vt)return pe(this,Re);if(Ot(this,bt,Vt),Ot(this,Re,"none"),(cr=pe(this,ut))==null||cr.remove(),!ht||!jt)return pe(this,Re);const Bt=_t(this,yt,ln).call(this,ht);ht=K.Util.makeHexColor(...Bt);const er=_t(this,yt,ln).call(this,jt);if(jt=K.Util.makeHexColor(...er),pe(this,Qe,Ir).style.color="",ht==="#000000"&&jt==="#ffffff"||ht===jt)return pe(this,Re);const sr=new Array(256);for(let Lt=0;Lt<=255;Lt++){const It=Lt/255;sr[Lt]=It<=.03928?It/12.92:((It+.055)/1.055)**2.4}const ir=sr.join(","),dr=`g_${pe(this,dt)}_hcm_filter`,ar=Ot(this,ue,_t(this,Pt,vn).call(this,dr));_t(this,Gt,sn).call(this,ir,ir,ir,ar),_t(this,xt,Bn).call(this,ar);const or=(Lt,It)=>{const St=Bt[Lt]/255,Ht=er[Lt]/255,Kt=new Array(It+1);for(let kr=0;kr<=It;kr++)Kt[kr]=St+kr/It*(Ht-St);return Kt.join(",")};return _t(this,Gt,sn).call(this,or(0,5),or(1,5),or(2,5),ar),Ot(this,Re,`url(#${dr})`),pe(this,Re)}addHighlightHCMFilter(ht,jt,Vt,Bt){var Ht;const er=`${ht}-${jt}-${Vt}-${Bt}`;if(pe(this,be)===er)return pe(this,ve);if(Ot(this,be,er),Ot(this,ve,"none"),(Ht=pe(this,ue))==null||Ht.remove(),!ht||!jt)return pe(this,ve);const[sr,ir]=[ht,jt].map(_t(this,yt,ln).bind(this));let dr=Math.round(.2126*sr[0]+.7152*sr[1]+.0722*sr[2]),ar=Math.round(.2126*ir[0]+.7152*ir[1]+.0722*ir[2]),[or,cr]=[Vt,Bt].map(_t(this,yt,ln).bind(this));ar{const Dt=new Array(256),zt=(ar-dr)/vr,tr=Kt/255,Zt=(kr-Kt)/(255*vr);let rr=0;for(let nr=0;nr<=vr;nr++){const mr=Math.round(dr+nr*zt),Wt=tr+nr*Zt;for(let pr=rr;pr<=mr;pr++)Dt[pr]=Wt;rr=mr+1}for(let nr=rr;nr<256;nr++)Dt[nr]=Dt[rr-1];return Dt.join(",")},It=`g_${pe(this,dt)}_hcm_highlight_filter`,St=Ot(this,ue,_t(this,Pt,vn).call(this,It));return _t(this,xt,Bn).call(this,St),_t(this,Gt,sn).call(this,Lt(or[0],cr[0],5),Lt(or[1],cr[1],5),Lt(or[2],cr[2],5),St),Ot(this,ve,`url(#${It})`),pe(this,ve)}destroy(ht=!1){ht&&(pe(this,Re)||pe(this,ve))||(pe(this,at)&&(pe(this,at).parentNode.parentNode.remove(),Ot(this,at,null)),pe(this,pt)&&(pe(this,pt).clear(),Ot(this,pt,null)),Ot(this,we,0))}}pt=new WeakMap,at=new WeakMap,dt=new WeakMap,Ct=new WeakMap,ut=new WeakMap,bt=new WeakMap,Re=new WeakMap,ue=new WeakMap,be=new WeakMap,ve=new WeakMap,we=new WeakMap,_e=new WeakSet,jr=function(){return pe(this,pt)||Ot(this,pt,new Map)},Qe=new WeakSet,Ir=function(){if(!pe(this,at)){const ht=pe(this,Ct).createElement("div"),{style:jt}=ht;jt.visibility="hidden",jt.contain="strict",jt.width=jt.height=0,jt.position="absolute",jt.top=jt.left=0,jt.zIndex=-1;const Vt=pe(this,Ct).createElementNS(Y,"svg");Vt.setAttribute("width",0),Vt.setAttribute("height",0),Ot(this,at,pe(this,Ct).createElementNS(Y,"defs")),ht.append(Vt),Vt.append(pe(this,at)),pe(this,Ct).body.append(ht)}return pe(this,at)},xt=new WeakSet,Bn=function(ht){const jt=pe(this,Ct).createElementNS(Y,"feColorMatrix");jt.setAttribute("type","matrix"),jt.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),ht.append(jt)},Pt=new WeakSet,vn=function(ht){const jt=pe(this,Ct).createElementNS(Y,"filter");return jt.setAttribute("color-interpolation-filters","sRGB"),jt.setAttribute("id",ht),pe(this,Qe,Ir).append(jt),jt},Ft=new WeakSet,yn=function(ht,jt,Vt){const Bt=pe(this,Ct).createElementNS(Y,jt);Bt.setAttribute("type","discrete"),Bt.setAttribute("tableValues",Vt),ht.append(Bt)},Gt=new WeakSet,sn=function(ht,jt,Vt,Bt){const er=pe(this,Ct).createElementNS(Y,"feComponentTransfer");Bt.append(er),_t(this,Ft,yn).call(this,er,"feFuncR",ht),_t(this,Ft,yn).call(this,er,"feFuncG",jt),_t(this,Ft,yn).call(this,er,"feFuncB",Vt)},yt=new WeakSet,ln=function(ht){return pe(this,Qe,Ir).style.color=ht,je(getComputedStyle(pe(this,Qe,Ir)).getPropertyValue("color"))},C.DOMFilterFactory=re;class ne extends V.BaseCanvasFactory{constructor({ownerDocument:mt=globalThis.document}={}){super(),this._document=mt}_createCanvas(mt,ht){const jt=this._document.createElement("canvas");return jt.width=mt,jt.height=ht,jt}}C.DOMCanvasFactory=ne;async function te(Rt,mt=!1){if(ye(Rt,document.baseURI)){const ht=await fetch(Rt);if(!ht.ok)throw new Error(ht.statusText);return mt?new Uint8Array(await ht.arrayBuffer()):(0,K.stringToBytes)(await ht.text())}return new Promise((ht,jt)=>{const Vt=new XMLHttpRequest;Vt.open("GET",Rt,!0),mt&&(Vt.responseType="arraybuffer"),Vt.onreadystatechange=()=>{if(Vt.readyState===XMLHttpRequest.DONE){if(Vt.status===200||Vt.status===0){let Bt;if(mt&&Vt.response?Bt=new Uint8Array(Vt.response):!mt&&Vt.responseText&&(Bt=(0,K.stringToBytes)(Vt.responseText)),Bt){ht(Bt);return}}jt(new Error(Vt.statusText))}},Vt.send(null)})}class se extends V.BaseCMapReaderFactory{_fetchData(mt,ht){return te(mt,this.isCompressed).then(jt=>({cMapData:jt,compressionType:ht}))}}C.DOMCMapReaderFactory=se;class ie extends V.BaseStandardFontDataFactory{_fetchData(mt){return te(mt,!0)}}C.DOMStandardFontDataFactory=ie;class ae extends V.BaseSVGFactory{_createSVG(mt){return document.createElementNS(Y,mt)}}C.DOMSVGFactory=ae;class oe{constructor({viewBox:mt,scale:ht,rotation:jt,offsetX:Vt=0,offsetY:Bt=0,dontFlip:er=!1}){this.viewBox=mt,this.scale=ht,this.rotation=jt,this.offsetX=Vt,this.offsetY=Bt;const sr=(mt[2]+mt[0])/2,ir=(mt[3]+mt[1])/2;let dr,ar,or,cr;switch(jt%=360,jt<0&&(jt+=360),jt){case 180:dr=-1,ar=0,or=0,cr=1;break;case 90:dr=0,ar=1,or=1,cr=0;break;case 270:dr=0,ar=-1,or=-1,cr=0;break;case 0:dr=1,ar=0,or=0,cr=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}er&&(or=-or,cr=-cr);let Lt,It,St,Ht;dr===0?(Lt=Math.abs(ir-mt[1])*ht+Vt,It=Math.abs(sr-mt[0])*ht+Bt,St=(mt[3]-mt[1])*ht,Ht=(mt[2]-mt[0])*ht):(Lt=Math.abs(sr-mt[0])*ht+Vt,It=Math.abs(ir-mt[1])*ht+Bt,St=(mt[2]-mt[0])*ht,Ht=(mt[3]-mt[1])*ht),this.transform=[dr*ht,ar*ht,or*ht,cr*ht,Lt-dr*ht*sr-or*ht*ir,It-ar*ht*sr-cr*ht*ir],this.width=St,this.height=Ht}get rawDims(){const{viewBox:mt}=this;return(0,K.shadow)(this,"rawDims",{pageWidth:mt[2]-mt[0],pageHeight:mt[3]-mt[1],pageX:mt[0],pageY:mt[1]})}clone({scale:mt=this.scale,rotation:ht=this.rotation,offsetX:jt=this.offsetX,offsetY:Vt=this.offsetY,dontFlip:Bt=!1}={}){return new oe({viewBox:this.viewBox.slice(),scale:mt,rotation:ht,offsetX:jt,offsetY:Vt,dontFlip:Bt})}convertToViewportPoint(mt,ht){return K.Util.applyTransform([mt,ht],this.transform)}convertToViewportRectangle(mt){const ht=K.Util.applyTransform([mt[0],mt[1]],this.transform),jt=K.Util.applyTransform([mt[2],mt[3]],this.transform);return[ht[0],ht[1],jt[0],jt[1]]}convertToPdfPoint(mt,ht){return K.Util.applyInverseTransform([mt,ht],this.transform)}}C.PageViewport=oe;class le extends K.BaseException{constructor(mt,ht=0){super(mt,"RenderingCancelledException"),this.extraDelay=ht}}C.RenderingCancelledException=le;function ce(Rt){const mt=Rt.length;let ht=0;for(;ht{const Vt=document.createElement("script");Vt.src=Rt,Vt.onload=function(Bt){mt&&Vt.remove(),ht(Bt)},Vt.onerror=function(){jt(new Error(`Cannot load script at: ${Vt.src}`))},(document.head||document.documentElement).append(Vt)})}function Pe(Rt){console.log("Deprecated API usage: "+Rt)}let De;class xe{static toDateObject(mt){if(!mt||typeof mt!="string")return null;De||(De=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));const ht=De.exec(mt);if(!ht)return null;const jt=parseInt(ht[1],10);let Vt=parseInt(ht[2],10);Vt=Vt>=1&&Vt<=12?Vt-1:0;let Bt=parseInt(ht[3],10);Bt=Bt>=1&&Bt<=31?Bt:1;let er=parseInt(ht[4],10);er=er>=0&&er<=23?er:0;let sr=parseInt(ht[5],10);sr=sr>=0&&sr<=59?sr:0;let ir=parseInt(ht[6],10);ir=ir>=0&&ir<=59?ir:0;const dr=ht[7]||"Z";let ar=parseInt(ht[8],10);ar=ar>=0&&ar<=23?ar:0;let or=parseInt(ht[9],10)||0;return or=or>=0&&or<=59?or:0,dr==="-"?(er+=ar,sr+=or):dr==="+"&&(er-=ar,sr-=or),new Date(Date.UTC(jt,Vt,Bt,er,sr,ir))}}C.PDFDateString=xe;function Ce(Rt,{scale:mt=1,rotation:ht=0}){const{width:jt,height:Vt}=Rt.attributes.style,Bt=[0,0,parseInt(jt),parseInt(Vt)];return new oe({viewBox:Bt,scale:mt,rotation:ht})}function je(Rt){if(Rt.startsWith("#")){const mt=parseInt(Rt.slice(1),16);return[(mt&16711680)>>16,(mt&65280)>>8,mt&255]}return Rt.startsWith("rgb(")?Rt.slice(4,-1).split(",").map(mt=>parseInt(mt)):Rt.startsWith("rgba(")?Rt.slice(5,-1).split(",").map(mt=>parseInt(mt)).slice(0,3):((0,K.warn)(`Not a valid color format: "${Rt}"`),[0,0,0])}function Le(Rt){const mt=document.createElement("span");mt.style.visibility="hidden",document.body.append(mt);for(const ht of Rt.keys()){mt.style.color=ht;const jt=window.getComputedStyle(mt).color;Rt.set(ht,je(jt))}mt.remove()}function Ke(Rt){const{a:mt,b:ht,c:jt,d:Vt,e:Bt,f:er}=Rt.getTransform();return[mt,ht,jt,Vt,Bt,er]}function Se(Rt){const{a:mt,b:ht,c:jt,d:Vt,e:Bt,f:er}=Rt.getTransform().invertSelf();return[mt,ht,jt,Vt,Bt,er]}function Ie(Rt,mt,ht=!1,jt=!0){if(mt instanceof oe){const{pageWidth:Vt,pageHeight:Bt}=mt.rawDims,{style:er}=Rt,sr=K.FeatureTest.isCSSRoundSupported,ir=`var(--scale-factor) * ${Vt}px`,dr=`var(--scale-factor) * ${Bt}px`,ar=sr?`round(${ir}, 1px)`:`calc(${ir})`,or=sr?`round(${dr}, 1px)`:`calc(${dr})`;!ht||mt.rotation%180===0?(er.width=ar,er.height=or):(er.width=or,er.height=ar)}jt&&Rt.setAttribute("data-main-rotation",mt.rotation)}},(T,C,$)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.BaseStandardFontDataFactory=C.BaseSVGFactory=C.BaseFilterFactory=C.BaseCanvasFactory=C.BaseCMapReaderFactory=void 0;var V=$(1);class K{constructor(){this.constructor===K&&(0,V.unreachable)("Cannot initialize BaseFilterFactory.")}addFilter(se){return"none"}addHCMFilter(se,ie){return"none"}addHighlightHCMFilter(se,ie,ae,oe){return"none"}destroy(se=!1){}}C.BaseFilterFactory=K;class Y{constructor(){this.constructor===Y&&(0,V.unreachable)("Cannot initialize BaseCanvasFactory.")}create(se,ie){if(se<=0||ie<=0)throw new Error("Invalid canvas size");const ae=this._createCanvas(se,ie);return{canvas:ae,context:ae.getContext("2d")}}reset(se,ie,ae){if(!se.canvas)throw new Error("Canvas is not specified");if(ie<=0||ae<=0)throw new Error("Invalid canvas size");se.canvas.width=ie,se.canvas.height=ae}destroy(se){if(!se.canvas)throw new Error("Canvas is not specified");se.canvas.width=0,se.canvas.height=0,se.canvas=null,se.context=null}_createCanvas(se,ie){(0,V.unreachable)("Abstract method `_createCanvas` called.")}}C.BaseCanvasFactory=Y;class J{constructor({baseUrl:se=null,isCompressed:ie=!0}){this.constructor===J&&(0,V.unreachable)("Cannot initialize BaseCMapReaderFactory."),this.baseUrl=se,this.isCompressed=ie}async fetch({name:se}){if(!this.baseUrl)throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');if(!se)throw new Error("CMap name must be specified.");const ie=this.baseUrl+se+(this.isCompressed?".bcmap":""),ae=this.isCompressed?V.CMapCompressionType.BINARY:V.CMapCompressionType.NONE;return this._fetchData(ie,ae).catch(oe=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${ie}`)})}_fetchData(se,ie){(0,V.unreachable)("Abstract method `_fetchData` called.")}}C.BaseCMapReaderFactory=J;class re{constructor({baseUrl:se=null}){this.constructor===re&&(0,V.unreachable)("Cannot initialize BaseStandardFontDataFactory."),this.baseUrl=se}async fetch({filename:se}){if(!this.baseUrl)throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');if(!se)throw new Error("Font filename must be specified.");const ie=`${this.baseUrl}${se}`;return this._fetchData(ie).catch(ae=>{throw new Error(`Unable to load font data at: ${ie}`)})}_fetchData(se){(0,V.unreachable)("Abstract method `_fetchData` called.")}}C.BaseStandardFontDataFactory=re;class ne{constructor(){this.constructor===ne&&(0,V.unreachable)("Cannot initialize BaseSVGFactory.")}create(se,ie,ae=!1){if(se<=0||ie<=0)throw new Error("Invalid SVG dimensions");const oe=this._createSVG("svg:svg");return oe.setAttribute("version","1.1"),ae||(oe.setAttribute("width",`${se}px`),oe.setAttribute("height",`${ie}px`)),oe.setAttribute("preserveAspectRatio","none"),oe.setAttribute("viewBox",`0 0 ${se} ${ie}`),oe}createElement(se){if(typeof se!="string")throw new Error("Invalid SVG element type");return this._createSVG(se)}_createSVG(se){(0,V.unreachable)("Abstract method `_createSVG` called.")}}C.BaseSVGFactory=ne},(T,C,$)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.MurmurHash3_64=void 0;var V=$(1);const K=3285377520,Y=4294901760,J=65535;class re{constructor(te){this.h1=te?te&4294967295:K,this.h2=te?te&4294967295:K}update(te){let se,ie;if(typeof te=="string"){se=new Uint8Array(te.length*2),ie=0;for(let Pe=0,De=te.length;Pe>>8,se[ie++]=xe&255)}}else if((0,V.isArrayBuffer)(te))se=te.slice(),ie=se.byteLength;else throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");const ae=ie>>2,oe=ie-ae*4,le=new Uint32Array(se.buffer,0,ae);let ce=0,de=0,he=this.h1,me=this.h2;const ge=3432918353,ye=461845907,fe=ge&J,Te=ye&J;for(let Pe=0;Pe>>17,ce=ce*ye&Y|ce*Te&J,he^=ce,he=he<<13|he>>>19,he=he*5+3864292196):(de=le[Pe],de=de*ge&Y|de*fe&J,de=de<<15|de>>>17,de=de*ye&Y|de*Te&J,me^=de,me=me<<13|me>>>19,me=me*5+3864292196);switch(ce=0,oe){case 3:ce^=se[ae*4+2]<<16;case 2:ce^=se[ae*4+1]<<8;case 1:ce^=se[ae*4],ce=ce*ge&Y|ce*fe&J,ce=ce<<15|ce>>>17,ce=ce*ye&Y|ce*Te&J,ae&1?he^=ce:me^=ce}this.h1=he,this.h2=me}hexdigest(){let te=this.h1,se=this.h2;return te^=se>>>1,te=te*3981806797&Y|te*36045&J,se=se*4283543511&Y|((se<<16|te>>>16)*2950163797&Y)>>>16,te^=se>>>1,te=te*444984403&Y|te*60499&J,se=se*3301882366&Y|((se<<16|te>>>16)*3120437893&Y)>>>16,te^=se>>>1,(te>>>0).toString(16).padStart(8,"0")+(se>>>0).toString(16).padStart(8,"0")}}C.MurmurHash3_64=re},(T,C,$)=>{var J;Object.defineProperty(C,"__esModule",{value:!0}),C.FontLoader=C.FontFaceObject=void 0;var V=$(1);class K{constructor({ownerDocument:ne=globalThis.document,styleElement:te=null}){kt(this,J,new Set);this._document=ne,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(ne){this.nativeFontFaces.add(ne),this._document.fonts.add(ne)}removeNativeFontFace(ne){this.nativeFontFaces.delete(ne),this._document.fonts.delete(ne)}insertRule(ne){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const te=this.styleElement.sheet;te.insertRule(ne,te.cssRules.length)}clear(){for(const ne of this.nativeFontFaces)this._document.fonts.delete(ne);this.nativeFontFaces.clear(),pe(this,J).clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont(ne){if(!(!ne||pe(this,J).has(ne.loadedName))){if((0,V.assert)(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:te,src:se,style:ie}=ne,ae=new FontFace(te,se,ie);this.addNativeFontFace(ae);try{await ae.load(),pe(this,J).add(te)}catch{(0,V.warn)(`Cannot load system font: ${ne.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(ae)}return}(0,V.unreachable)("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(ne){if(ne.attached||ne.missingFile&&!ne.systemFontInfo)return;if(ne.attached=!0,ne.systemFontInfo){await this.loadSystemFont(ne.systemFontInfo);return}if(this.isFontLoadingAPISupported){const se=ne.createNativeFontFace();if(se){this.addNativeFontFace(se);try{await se.loaded}catch(ie){throw(0,V.warn)(`Failed to load font '${se.family}': '${ie}'.`),ne.disableFontFace=!0,ie}}return}const te=ne.createFontFaceRule();if(te){if(this.insertRule(te),this.isSyncFontLoadingSupported)return;await new Promise(se=>{const ie=this._queueLoadingCallback(se);this._prepareFontLoadEvent(ne,ie)})}}get isFontLoadingAPISupported(){var te;const ne=!!((te=this._document)!=null&&te.fonts);return(0,V.shadow)(this,"isFontLoadingAPISupported",ne)}get isSyncFontLoadingSupported(){let ne=!1;return(V.isNodeJS||typeof navigator<"u"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(ne=!0),(0,V.shadow)(this,"isSyncFontLoadingSupported",ne)}_queueLoadingCallback(ne){function te(){for((0,V.assert)(!ie.done,"completeRequest() cannot be called twice."),ie.done=!0;se.length>0&&se[0].done;){const ae=se.shift();setTimeout(ae.callback,0)}}const{loadingRequests:se}=this,ie={done:!1,complete:te,callback:ne};return se.push(ie),ie}get _loadTestFont(){const ne=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAA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==");return(0,V.shadow)(this,"_loadTestFont",ne)}_prepareFontLoadEvent(ne,te){function se(je,Le){return je.charCodeAt(Le)<<24|je.charCodeAt(Le+1)<<16|je.charCodeAt(Le+2)<<8|je.charCodeAt(Le+3)&255}function ie(je,Le,Ke,Se){const Ie=je.substring(0,Le),Ne=je.substring(Le+Ke);return Ie+Se+Ne}let ae,oe;const le=this._document.createElement("canvas");le.width=1,le.height=1;const ce=le.getContext("2d");let de=0;function he(je,Le){if(++de>30){(0,V.warn)("Load test font never loaded."),Le();return}if(ce.font="30px "+je,ce.fillText(".",0,20),ce.getImageData(0,0,1,1).data[3]>0){Le();return}setTimeout(he.bind(null,je,Le))}const me=`lt${Date.now()}${this.loadTestFontId++}`;let ge=this._loadTestFont;ge=ie(ge,976,me.length,me);const fe=16,Te=1482184792;let Pe=se(ge,fe);for(ae=0,oe=me.length-3;ae{Ce.remove(),te.complete()})}}J=new WeakMap,C.FontLoader=K;class Y{constructor(ne,{isEvalSupported:te=!0,disableFontFace:se=!1,ignoreErrors:ie=!1,inspectFont:ae=null}){this.compiledGlyphs=Object.create(null);for(const oe in ne)this[oe]=ne[oe];this.isEvalSupported=te!==!1,this.disableFontFace=se===!0,this.ignoreErrors=ie===!0,this._inspectFont=ae}createNativeFontFace(){var te;if(!this.data||this.disableFontFace)return null;let ne;if(!this.cssFontInfo)ne=new FontFace(this.loadedName,this.data,{});else{const se={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(se.style=`oblique ${this.cssFontInfo.italicAngle}deg`),ne=new FontFace(this.cssFontInfo.fontFamily,this.data,se)}return(te=this._inspectFont)==null||te.call(this,this),ne}createFontFaceRule(){var ie;if(!this.data||this.disableFontFace)return null;const ne=(0,V.bytesToString)(this.data),te=`url(data:${this.mimetype};base64,${btoa(ne)});`;let se;if(!this.cssFontInfo)se=`@font-face {font-family:"${this.loadedName}";src:${te}}`;else{let ae=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(ae+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),se=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${ae}src:${te}}`}return(ie=this._inspectFont)==null||ie.call(this,this,te),se}getPathGenerator(ne,te){if(this.compiledGlyphs[te]!==void 0)return this.compiledGlyphs[te];let se;try{se=ne.get(this.loadedName+"_path_"+te)}catch(ie){if(!this.ignoreErrors)throw ie;return(0,V.warn)(`getPathGenerator - ignoring character: "${ie}".`),this.compiledGlyphs[te]=function(ae,oe){}}if(this.isEvalSupported&&V.FeatureTest.isEvalSupported){const ie=[];for(const ae of se){const oe=ae.args!==void 0?ae.args.join(","):"";ie.push("c.",ae.cmd,"(",oe,`);
+`)}return this.compiledGlyphs[te]=new Function("c","size",ie.join(""))}return this.compiledGlyphs[te]=function(ie,ae){for(const oe of se)oe.cmd==="scale"&&(oe.args=[ae,-ae]),ie[oe.cmd].apply(ie,oe.args)}}}C.FontFaceObject=Y},(T,C,$)=>{Object.defineProperty(C,"__esModule",{value:!0}),C.NodeStandardFontDataFactory=C.NodeFilterFactory=C.NodeCanvasFactory=C.NodeCMapReaderFactory=void 0;var V=$(7);$(1);const K=function(te){return new Promise((se,ie)=>{require$$5.readFile(te,(oe,le)=>{if(oe||!le){ie(new Error(oe));return}se(new Uint8Array(le))})})};class Y extends V.BaseFilterFactory{}C.NodeFilterFactory=Y;class J extends V.BaseCanvasFactory{_createCanvas(se,ie){return require$$5.createCanvas(se,ie)}}C.NodeCanvasFactory=J;class re extends V.BaseCMapReaderFactory{_fetchData(se,ie){return K(se).then(ae=>({cMapData:ae,compressionType:ie}))}}C.NodeCMapReaderFactory=re;class ne extends V.BaseStandardFontDataFactory{_fetchData(se){return K(se)}}C.NodeStandardFontDataFactory=ne},(T,C,$)=>{var at,Hn,Ct,Wn;Object.defineProperty(C,"__esModule",{value:!0}),C.CanvasGraphics=void 0;var V=$(1),K=$(6),Y=$(12),J=$(13);const re=16,ne=100,te=4096,se=15,ie=10,ae=1e3,oe=16;function le(Re,ue){if(Re._removeMirroring)throw new Error("Context is already forwarding operations.");Re.__originalSave=Re.save,Re.__originalRestore=Re.restore,Re.__originalRotate=Re.rotate,Re.__originalScale=Re.scale,Re.__originalTranslate=Re.translate,Re.__originalTransform=Re.transform,Re.__originalSetTransform=Re.setTransform,Re.__originalResetTransform=Re.resetTransform,Re.__originalClip=Re.clip,Re.__originalMoveTo=Re.moveTo,Re.__originalLineTo=Re.lineTo,Re.__originalBezierCurveTo=Re.bezierCurveTo,Re.__originalRect=Re.rect,Re.__originalClosePath=Re.closePath,Re.__originalBeginPath=Re.beginPath,Re._removeMirroring=()=>{Re.save=Re.__originalSave,Re.restore=Re.__originalRestore,Re.rotate=Re.__originalRotate,Re.scale=Re.__originalScale,Re.translate=Re.__originalTranslate,Re.transform=Re.__originalTransform,Re.setTransform=Re.__originalSetTransform,Re.resetTransform=Re.__originalResetTransform,Re.clip=Re.__originalClip,Re.moveTo=Re.__originalMoveTo,Re.lineTo=Re.__originalLineTo,Re.bezierCurveTo=Re.__originalBezierCurveTo,Re.rect=Re.__originalRect,Re.closePath=Re.__originalClosePath,Re.beginPath=Re.__originalBeginPath,delete Re._removeMirroring},Re.save=function(){ue.save(),this.__originalSave()},Re.restore=function(){ue.restore(),this.__originalRestore()},Re.translate=function(ve,we){ue.translate(ve,we),this.__originalTranslate(ve,we)},Re.scale=function(ve,we){ue.scale(ve,we),this.__originalScale(ve,we)},Re.transform=function(ve,we,_e,Oe,Qe,ct){ue.transform(ve,we,_e,Oe,Qe,ct),this.__originalTransform(ve,we,_e,Oe,Qe,ct)},Re.setTransform=function(ve,we,_e,Oe,Qe,ct){ue.setTransform(ve,we,_e,Oe,Qe,ct),this.__originalSetTransform(ve,we,_e,Oe,Qe,ct)},Re.resetTransform=function(){ue.resetTransform(),this.__originalResetTransform()},Re.rotate=function(ve){ue.rotate(ve),this.__originalRotate(ve)},Re.clip=function(ve){ue.clip(ve),this.__originalClip(ve)},Re.moveTo=function(be,ve){ue.moveTo(be,ve),this.__originalMoveTo(be,ve)},Re.lineTo=function(be,ve){ue.lineTo(be,ve),this.__originalLineTo(be,ve)},Re.bezierCurveTo=function(be,ve,we,_e,Oe,Qe){ue.bezierCurveTo(be,ve,we,_e,Oe,Qe),this.__originalBezierCurveTo(be,ve,we,_e,Oe,Qe)},Re.rect=function(be,ve,we,_e){ue.rect(be,ve,we,_e),this.__originalRect(be,ve,we,_e)},Re.closePath=function(){ue.closePath(),this.__originalClosePath()},Re.beginPath=function(){ue.beginPath(),this.__originalBeginPath()}}class ce{constructor(ue){this.canvasFactory=ue,this.cache=Object.create(null)}getCanvas(ue,be,ve){let we;return this.cache[ue]!==void 0?(we=this.cache[ue],this.canvasFactory.reset(we,be,ve)):(we=this.canvasFactory.create(be,ve),this.cache[ue]=we),we}delete(ue){delete this.cache[ue]}clear(){for(const ue in this.cache){const be=this.cache[ue];this.canvasFactory.destroy(be),delete this.cache[ue]}}}function de(Re,ue,be,ve,we,_e,Oe,Qe,ct,xt){const[Tt,Pt,$t,Ft,Nt,Gt]=(0,K.getCurrentTransform)(Re);if(Pt===0&&$t===0){const At=Oe*Tt+Nt,Rt=Math.round(At),mt=Qe*Ft+Gt,ht=Math.round(mt),jt=(Oe+ct)*Tt+Nt,Vt=Math.abs(Math.round(jt)-Rt)||1,Bt=(Qe+xt)*Ft+Gt,er=Math.abs(Math.round(Bt)-ht)||1;return Re.setTransform(Math.sign(Tt),0,0,Math.sign(Ft),Rt,ht),Re.drawImage(ue,be,ve,we,_e,0,0,Vt,er),Re.setTransform(Tt,Pt,$t,Ft,Nt,Gt),[Vt,er]}if(Tt===0&&Ft===0){const At=Qe*$t+Nt,Rt=Math.round(At),mt=Oe*Pt+Gt,ht=Math.round(mt),jt=(Qe+xt)*$t+Nt,Vt=Math.abs(Math.round(jt)-Rt)||1,Bt=(Oe+ct)*Pt+Gt,er=Math.abs(Math.round(Bt)-ht)||1;return Re.setTransform(0,Math.sign(Pt),Math.sign($t),0,Rt,ht),Re.drawImage(ue,be,ve,we,_e,0,0,er,Vt),Re.setTransform(Tt,Pt,$t,Ft,Nt,Gt),[er,Vt]}Re.drawImage(ue,be,ve,we,_e,Oe,Qe,ct,xt);const ft=Math.hypot(Tt,Pt),yt=Math.hypot($t,Ft);return[ft*ct,yt*xt]}function he(Re){const{width:ue,height:be}=Re;if(ue>ae||be>ae)return null;const ve=1e3,we=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),_e=ue+1;let Oe=new Uint8Array(_e*(be+1)),Qe,ct,xt;const Tt=ue+7&-8;let Pt=new Uint8Array(Tt*be),$t=0;for(const yt of Re.data){let At=128;for(;At>0;)Pt[$t++]=yt&At?0:255,At>>=1}let Ft=0;for($t=0,Pt[$t]!==0&&(Oe[0]=1,++Ft),ct=1;ct>2)+(Pt[$t+1]?4:0)+(Pt[$t-Tt+1]?8:0),we[yt]&&(Oe[xt+ct]=we[yt],++Ft),$t++;if(Pt[$t-Tt]!==Pt[$t]&&(Oe[xt+ct]=Pt[$t]?2:4,++Ft),Ft>ve)return null}for($t=Tt*(be-1),xt=Qe*_e,Pt[$t]!==0&&(Oe[xt]=8,++Ft),ct=1;ctve)return null;const Nt=new Int32Array([0,_e,-1,0,-_e,0,0,0,1]),Gt=new Path2D;for(Qe=0;Ft&&Qe<=be;Qe++){let yt=Qe*_e;const At=yt+ue;for(;yt>4,Oe[yt]&=mt>>2|mt<<2),Gt.lineTo(yt%_e,yt/_e|0),Oe[yt]||--Ft}while(Rt!==yt);--Qe}return Pt=null,Oe=null,function(yt){yt.save(),yt.scale(1/ue,-1/be),yt.translate(0,-be),yt.fill(Gt),yt.beginPath(),yt.restore()}}class me{constructor(ue,be){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=V.IDENTITY_MATRIX,this.textMatrixScale=1,this.fontMatrix=V.FONT_IDENTITY_MATRIX,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=V.TextRenderingMode.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,ue,be])}clone(){const ue=Object.create(this);return ue.clipBox=this.clipBox.slice(),ue}setCurrentPoint(ue,be){this.x=ue,this.y=be}updatePathMinMax(ue,be,ve){[be,ve]=V.Util.applyTransform([be,ve],ue),this.minX=Math.min(this.minX,be),this.minY=Math.min(this.minY,ve),this.maxX=Math.max(this.maxX,be),this.maxY=Math.max(this.maxY,ve)}updateRectMinMax(ue,be){const ve=V.Util.applyTransform(be,ue),we=V.Util.applyTransform(be.slice(2),ue);this.minX=Math.min(this.minX,ve[0],we[0]),this.minY=Math.min(this.minY,ve[1],we[1]),this.maxX=Math.max(this.maxX,ve[0],we[0]),this.maxY=Math.max(this.maxY,ve[1],we[1])}updateScalingPathMinMax(ue,be){V.Util.scaleMinMax(ue,be),this.minX=Math.min(this.minX,be[0]),this.maxX=Math.max(this.maxX,be[1]),this.minY=Math.min(this.minY,be[2]),this.maxY=Math.max(this.maxY,be[3])}updateCurvePathMinMax(ue,be,ve,we,_e,Oe,Qe,ct,xt,Tt){const Pt=V.Util.bezierBoundingBox(be,ve,we,_e,Oe,Qe,ct,xt);if(Tt){Tt[0]=Math.min(Tt[0],Pt[0],Pt[2]),Tt[1]=Math.max(Tt[1],Pt[0],Pt[2]),Tt[2]=Math.min(Tt[2],Pt[1],Pt[3]),Tt[3]=Math.max(Tt[3],Pt[1],Pt[3]);return}this.updateRectMinMax(ue,Pt)}getPathBoundingBox(ue=Y.PathType.FILL,be=null){const ve=[this.minX,this.minY,this.maxX,this.maxY];if(ue===Y.PathType.STROKE){be||(0,V.unreachable)("Stroke bounding box must include transform.");const we=V.Util.singularValueDecompose2dScale(be),_e=we[0]*this.lineWidth/2,Oe=we[1]*this.lineWidth/2;ve[0]-=_e,ve[1]-=Oe,ve[2]+=_e,ve[3]+=Oe}return ve}updateClipFromPath(){const ue=V.Util.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(ue||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(ue){this.clipBox=ue,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(ue=Y.PathType.FILL,be=null){return V.Util.intersect(this.clipBox,this.getPathBoundingBox(ue,be))}}function ge(Re,ue){if(typeof ImageData<"u"&&ue instanceof ImageData){Re.putImageData(ue,0,0);return}const be=ue.height,ve=ue.width,we=be%oe,_e=(be-we)/oe,Oe=we===0?_e:_e+1,Qe=Re.createImageData(ve,oe);let ct=0,xt;const Tt=ue.data,Pt=Qe.data;let $t,Ft,Nt,Gt;if(ue.kind===V.ImageKind.GRAYSCALE_1BPP){const ft=Tt.byteLength,yt=new Uint32Array(Pt.buffer,0,Pt.byteLength>>2),At=yt.length,Rt=ve+7>>3,mt=4294967295,ht=V.FeatureTest.isLittleEndian?4278190080:255;for($t=0;$tRt?ve:jt*8-7,er=Bt&-8;let sr=0,ir=0;for(;Vt>=1}for(;xt=_e&&(Nt=we,Gt=ve*Nt),xt=0,Ft=Gt;Ft--;)Pt[xt++]=Tt[ct++],Pt[xt++]=Tt[ct++],Pt[xt++]=Tt[ct++],Pt[xt++]=255;Re.putImageData(Qe,0,$t*oe)}else throw new Error(`bad image kind: ${ue.kind}`)}function ye(Re,ue){if(ue.bitmap){Re.drawImage(ue.bitmap,0,0);return}const be=ue.height,ve=ue.width,we=be%oe,_e=(be-we)/oe,Oe=we===0?_e:_e+1,Qe=Re.createImageData(ve,oe);let ct=0;const xt=ue.data,Tt=Qe.data;for(let Pt=0;Pt