@medplum/app 3.0.11 → 3.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,555 @@
1
+ function fS(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var j0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Km(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hS={exports:{}},Gd={},pS={exports:{}},Ue={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var pc=Symbol.for("react.element"),Zk=Symbol.for("react.portal"),eR=Symbol.for("react.fragment"),tR=Symbol.for("react.strict_mode"),nR=Symbol.for("react.profiler"),rR=Symbol.for("react.provider"),oR=Symbol.for("react.context"),iR=Symbol.for("react.forward_ref"),sR=Symbol.for("react.suspense"),aR=Symbol.for("react.memo"),lR=Symbol.for("react.lazy"),P0=Symbol.iterator;function cR(e){return e===null||typeof e!="object"?null:(e=P0&&e[P0]||e["@@iterator"],typeof e=="function"?e:null)}var mS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},gS=Object.assign,yS={};function Na(e,t,n){this.props=e,this.context=t,this.refs=yS,this.updater=n||mS}Na.prototype.isReactComponent={};Na.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Na.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function vS(){}vS.prototype=Na.prototype;function Ym(e,t,n){this.props=e,this.context=t,this.refs=yS,this.updater=n||mS}var Xm=Ym.prototype=new vS;Xm.constructor=Ym;gS(Xm,Na.prototype);Xm.isPureReactComponent=!0;var T0=Array.isArray,xS=Object.prototype.hasOwnProperty,Jm={current:null},wS={key:!0,ref:!0,__self:!0,__source:!0};function SS(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)xS.call(t,r)&&!wS.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:pc,type:e,key:i,ref:s,props:o,_owner:Jm.current}}function uR(e,t){return{$$typeof:pc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Zm(e){return typeof e=="object"&&e!==null&&e.$$typeof===pc}function dR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var k0=/\/+/g;function ph(e,t){return typeof e=="object"&&e!==null&&e.key!=null?dR(""+e.key):t.toString(36)}function Au(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case pc:case Zk:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+ph(s,0):r,T0(o)?(n="",e!=null&&(n=e.replace(k0,"$&/")+"/"),Au(o,t,n,"",function(u){return u})):o!=null&&(Zm(o)&&(o=uR(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(k0,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",T0(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+ph(i,l);s+=Au(i,t,n,c,o)}else if(c=cR(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+ph(i,l++),s+=Au(i,t,n,c,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function ru(e,t,n){if(e==null)return e;var r=[],o=0;return Au(e,r,"","",function(i){return t.call(n,i,o++)}),r}function fR(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Pn={current:null},Nu={transition:null},hR={ReactCurrentDispatcher:Pn,ReactCurrentBatchConfig:Nu,ReactCurrentOwner:Jm};Ue.Children={map:ru,forEach:function(e,t,n){ru(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ru(e,function(){t++}),t},toArray:function(e){return ru(e,function(t){return t})||[]},only:function(e){if(!Zm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ue.Component=Na;Ue.Fragment=eR;Ue.Profiler=nR;Ue.PureComponent=Ym;Ue.StrictMode=tR;Ue.Suspense=sR;Ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hR;Ue.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=gS({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Jm.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)xS.call(t,c)&&!wS.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:pc,type:e.type,key:o,ref:i,props:r,_owner:s}};Ue.createContext=function(e){return e={$$typeof:oR,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:rR,_context:e},e.Consumer=e};Ue.createElement=SS;Ue.createFactory=function(e){var t=SS.bind(null,e);return t.type=e,t};Ue.createRef=function(){return{current:null}};Ue.forwardRef=function(e){return{$$typeof:iR,render:e}};Ue.isValidElement=Zm;Ue.lazy=function(e){return{$$typeof:lR,_payload:{_status:-1,_result:e},_init:fR}};Ue.memo=function(e,t){return{$$typeof:aR,type:e,compare:t===void 0?null:t}};Ue.startTransition=function(e){var t=Nu.transition;Nu.transition={};try{e()}finally{Nu.transition=t}};Ue.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Ue.useCallback=function(e,t){return Pn.current.useCallback(e,t)};Ue.useContext=function(e){return Pn.current.useContext(e)};Ue.useDebugValue=function(){};Ue.useDeferredValue=function(e){return Pn.current.useDeferredValue(e)};Ue.useEffect=function(e,t){return Pn.current.useEffect(e,t)};Ue.useId=function(){return Pn.current.useId()};Ue.useImperativeHandle=function(e,t,n){return Pn.current.useImperativeHandle(e,t,n)};Ue.useInsertionEffect=function(e,t){return Pn.current.useInsertionEffect(e,t)};Ue.useLayoutEffect=function(e,t){return Pn.current.useLayoutEffect(e,t)};Ue.useMemo=function(e,t){return Pn.current.useMemo(e,t)};Ue.useReducer=function(e,t,n){return Pn.current.useReducer(e,t,n)};Ue.useRef=function(e){return Pn.current.useRef(e)};Ue.useState=function(e){return Pn.current.useState(e)};Ue.useSyncExternalStore=function(e,t,n){return Pn.current.useSyncExternalStore(e,t,n)};Ue.useTransition=function(){return Pn.current.useTransition()};Ue.version="18.2.0";pS.exports=Ue;var p=pS.exports;const C=Km(p),eg=fS({__proto__:null,default:C},[p]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var pR=p,mR=Symbol.for("react.element"),gR=Symbol.for("react.fragment"),yR=Object.prototype.hasOwnProperty,vR=pR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,xR={key:!0,ref:!0,__self:!0,__source:!0};function bS(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)yR.call(t,r)&&!xR.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:mR,type:e,key:i,ref:s,props:o,_owner:vR.current}}Gd.Fragment=gR;Gd.jsx=bS;Gd.jsxs=bS;hS.exports=Gd;var a=hS.exports,eo=function(){return eo=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},eo.apply(this,arguments)};function CS(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function wR(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ou="right-scroll-bar-position",Mu="width-before-scroll-bar",SR="with-scroll-bars-hidden",bR="--removed-body-scroll-bar-size";function mh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function CR(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var ER=typeof window<"u"?p.useLayoutEffect:p.useEffect,R0=new WeakMap;function jR(e,t){var n=CR(t||null,function(r){return e.forEach(function(o){return mh(o,r)})});return ER(function(){var r=R0.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(l){i.has(l)||mh(l,null)}),i.forEach(function(l){o.has(l)||mh(l,s)})}R0.set(n,e)},[e]),n}function PR(e){return e}function TR(e,t){t===void 0&&(t=PR);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(l){return l!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var l=n;n=[],l.forEach(i),s=n}var c=function(){var d=s;s=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){s.push(d),u()},filter:function(d){return s=s.filter(d),n}}}};return o}function kR(e){e===void 0&&(e={});var t=TR(null);return t.options=eo({async:!0,ssr:!1},e),t}var ES=function(e){var t=e.sideCar,n=CS(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,eo({},n))};ES.isSideCarExport=!0;function RR(e,t){return e.useMedium(t),ES}var jS=kR(),gh=function(){},Qd=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:gh,onWheelCapture:gh,onTouchMoveCapture:gh}),o=r[0],i=r[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,S=e.as,v=S===void 0?"div":S,x=e.gapMode,w=CS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=h,j=jR([n,t]),E=eo(eo({},w),o);return p.createElement(p.Fragment,null,d&&p.createElement(b,{sideCar:jS,removeScrollBar:u,shards:f,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:x}),s?p.cloneElement(p.Children.only(l),eo(eo({},E),{ref:j})):p.createElement(v,eo({},E,{className:c,ref:j}),l))});Qd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Qd.classNames={fullWidth:Mu,zeroRight:Ou};var DR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function IR(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=DR();return t&&e.setAttribute("nonce",t),e}function _R(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function AR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var NR=function(){var e=0,t=null;return{add:function(n){e==0&&(t=IR())&&(_R(t,n),AR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},OR=function(){var e=NR();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},PS=function(){var e=OR(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},MR={left:0,top:0,right:0,gap:0},yh=function(e){return parseInt(e||"",10)||0},LR=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[yh(n),yh(r),yh(o)]},$R=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return MR;var t=LR(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},FR=PS(),aa="data-scroll-locked",zR=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,l=e.gap;return n===void 0&&(n="margin"),`
18
+ .`.concat(SR,` {
19
+ overflow: hidden `).concat(r,`;
20
+ padding-right: `).concat(l,"px ").concat(r,`;
21
+ }
22
+ body[`).concat(aa,`] {
23
+ overflow: hidden `).concat(r,`;
24
+ overscroll-behavior: contain;
25
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
26
+ padding-left: `.concat(o,`px;
27
+ padding-top: `).concat(i,`px;
28
+ padding-right: `).concat(s,`px;
29
+ margin-left:0;
30
+ margin-top:0;
31
+ margin-right: `).concat(l,"px ").concat(r,`;
32
+ `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
33
+ }
34
+
35
+ .`).concat(Ou,` {
36
+ right: `).concat(l,"px ").concat(r,`;
37
+ }
38
+
39
+ .`).concat(Mu,` {
40
+ margin-right: `).concat(l,"px ").concat(r,`;
41
+ }
42
+
43
+ .`).concat(Ou," .").concat(Ou,` {
44
+ right: 0 `).concat(r,`;
45
+ }
46
+
47
+ .`).concat(Mu," .").concat(Mu,` {
48
+ margin-right: 0 `).concat(r,`;
49
+ }
50
+
51
+ body[`).concat(aa,`] {
52
+ `).concat(bR,": ").concat(l,`px;
53
+ }
54
+ `)},D0=function(){var e=parseInt(document.body.getAttribute(aa)||"0",10);return isFinite(e)?e:0},BR=function(){p.useEffect(function(){return document.body.setAttribute(aa,(D0()+1).toString()),function(){var e=D0()-1;e<=0?document.body.removeAttribute(aa):document.body.setAttribute(aa,e.toString())}},[])},UR=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;BR();var i=p.useMemo(function(){return $R(o)},[o]);return p.createElement(FR,{styles:zR(i,!t,o,n?"":"!important")})},yp=!1;if(typeof window<"u")try{var ou=Object.defineProperty({},"passive",{get:function(){return yp=!0,!0}});window.addEventListener("test",ou,ou),window.removeEventListener("test",ou,ou)}catch{yp=!1}var _s=yp?{passive:!1}:!1,VR=function(e){return e.tagName==="TEXTAREA"},TS=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!VR(e)&&n[t]==="visible")},WR=function(e){return TS(e,"overflowY")},HR=function(e){return TS(e,"overflowX")},I0=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=kS(e,r);if(o){var i=RS(e,r),s=i[1],l=i[2];if(s>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},qR=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},GR=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},kS=function(e,t){return e==="v"?WR(t):HR(t)},RS=function(e,t){return e==="v"?qR(t):GR(t)},QR=function(e,t){return e==="h"&&t==="rtl"?-1:1},KR=function(e,t,n,r,o){var i=QR(e,window.getComputedStyle(t).direction),s=i*r,l=n.target,c=t.contains(l),u=!1,d=s>0,f=0,h=0;do{var m=RS(e,l),g=m[0],y=m[1],S=m[2],v=y-S-i*g;(g||v)&&kS(e,l)&&(f+=v,h+=g),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(o&&Math.abs(f)<1||!o&&s>f)||!d&&(o&&Math.abs(h)<1||!o&&-s>h))&&(u=!0),u},iu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_0=function(e){return[e.deltaX,e.deltaY]},A0=function(e){return e&&"current"in e?e.current:e},YR=function(e,t){return e[0]===t[0]&&e[1]===t[1]},XR=function(e){return`
55
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
56
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
57
+ `)},JR=0,As=[];function ZR(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(JR++)[0],i=p.useState(PS)[0],s=p.useRef(e);p.useEffect(function(){s.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=wR([e.lockRef.current],(e.shards||[]).map(A0),!0).filter(Boolean);return y.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(y,S){if("touches"in y&&y.touches.length===2)return!s.current.allowPinchZoom;var v=iu(y),x=n.current,w="deltaX"in y?y.deltaX:x[0]-v[0],b="deltaY"in y?y.deltaY:x[1]-v[1],j,E=y.target,P=Math.abs(w)>Math.abs(b)?"h":"v";if("touches"in y&&P==="h"&&E.type==="range")return!1;var T=I0(P,E);if(!T)return!0;if(T?j=P:(j=P==="v"?"h":"v",T=I0(P,E)),!T)return!1;if(!r.current&&"changedTouches"in y&&(w||b)&&(r.current=j),!j)return!0;var D=r.current||j;return KR(D,S,y,D==="h"?w:b,!0)},[]),c=p.useCallback(function(y){var S=y;if(!(!As.length||As[As.length-1]!==i)){var v="deltaY"in S?_0(S):iu(S),x=t.current.filter(function(j){return j.name===S.type&&(j.target===S.target||S.target===j.shadowParent)&&YR(j.delta,v)})[0];if(x&&x.should){S.cancelable&&S.preventDefault();return}if(!x){var w=(s.current.shards||[]).map(A0).filter(Boolean).filter(function(j){return j.contains(S.target)}),b=w.length>0?l(S,w[0]):!s.current.noIsolation;b&&S.cancelable&&S.preventDefault()}}},[]),u=p.useCallback(function(y,S,v,x){var w={name:y,delta:S,target:v,should:x,shadowParent:e2(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(b){return b!==w})},1)},[]),d=p.useCallback(function(y){n.current=iu(y),r.current=void 0},[]),f=p.useCallback(function(y){u(y.type,_0(y),y.target,l(y,e.lockRef.current))},[]),h=p.useCallback(function(y){u(y.type,iu(y),y.target,l(y,e.lockRef.current))},[]);p.useEffect(function(){return As.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,_s),document.addEventListener("touchmove",c,_s),document.addEventListener("touchstart",d,_s),function(){As=As.filter(function(y){return y!==i}),document.removeEventListener("wheel",c,_s),document.removeEventListener("touchmove",c,_s),document.removeEventListener("touchstart",d,_s)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(i,{styles:XR(o)}):null,m?p.createElement(UR,{gapMode:e.gapMode}):null)}function e2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const t2=RR(jS,ZR);var Kd=p.forwardRef(function(e,t){return p.createElement(Qd,eo({},e,{ref:t,sideCar:t2}))});Kd.classNames=Qd.classNames;function pt(e){return Object.keys(e)}function vh(e){return e&&typeof e=="object"&&!Array.isArray(e)}function tg(e,t){const n={...e},r=t;return vh(e)&&vh(t)&&Object.keys(t).forEach(o=>{vh(r[o])&&o in e?n[o]=tg(n[o],r[o]):n[o]=r[o]}),n}function n2(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function r2(e){var t;return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:(t=e.match(/^calc\((.*?)\)$/))==null?void 0:t[1].split("*")[0].trim()}function vp(e){const t=r2(e);return typeof t=="number"?t:typeof t=="string"?t.includes("calc")||t.includes("var")?t:t.includes("px")?Number(t.replace("px","")):t.includes("rem")?Number(t.replace("rem",""))*16:t.includes("em")?Number(t.replace("em",""))*16:Number(t):NaN}function xh(e){return`calc(${e} * var(--mantine-scale))`}function DS(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const o=`${r/16}${e}`;return t?xh(o):o}if(typeof r=="string"){if(r.startsWith("calc(")||r.startsWith("var(")||r.startsWith("clamp("))return r;if(r.includes(" "))return r.split(" ").map(i=>n(i)).join(" ");if(r.includes(e))return t?xh(r):r;const o=r.replace("px","");if(!Number.isNaN(Number(o))){const i=`${Number(o)/16}${e}`;return t?xh(i):i}}return r}return n}const B=DS("rem",{shouldScale:!0}),Ju=DS("em");function ds(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function IS(e){return typeof e=="number"?!0:typeof e=="string"?e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&e.trim()!==""?!0:/[0-9]/.test(e.trim().replace("-","")[0]):!1}function Ao(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==C.Fragment:!1}function Tn(e){const t=p.createContext(null);return[({children:o,value:i})=>C.createElement(t.Provider,{value:i},o),()=>{const o=p.useContext(t);if(o===null)throw new Error(e);return o}]}function mc(e=null){const t=p.createContext(e);return[({children:o,value:i})=>C.createElement(t.Provider,{value:i},o),()=>p.useContext(t)]}function N0(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function Zu(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function o2(e,t,n){for(let r=e-1;r>=0;r-=1)if(!t[r].disabled)return r;if(n){for(let r=t.length-1;r>-1;r-=1)if(!t[r].disabled)return r}return e}function i2(e,t,n){for(let r=e+1;r<t.length;r+=1)if(!t[r].disabled)return r;if(n){for(let r=0;r<t.length;r+=1)if(!t[r].disabled)return r}return e}function s2(e,t,n){return Zu(e,n)===Zu(t,n)}function _S({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:o=!1,dir:i="rtl",orientation:s}){return l=>{var g;n==null||n(l);const c=Array.from(((g=Zu(l.currentTarget,e))==null?void 0:g.querySelectorAll(t))||[]).filter(y=>s2(l.currentTarget,y,e)),u=c.findIndex(y=>l.currentTarget===y),d=i2(u,c,r),f=o2(u,c,r),h=i==="rtl"?f:d,m=i==="rtl"?d:f;switch(l.key){case"ArrowRight":{s==="horizontal"&&(l.stopPropagation(),l.preventDefault(),c[h].focus(),o&&c[h].click());break}case"ArrowLeft":{s==="horizontal"&&(l.stopPropagation(),l.preventDefault(),c[m].focus(),o&&c[m].click());break}case"ArrowUp":{s==="vertical"&&(l.stopPropagation(),l.preventDefault(),c[f].focus(),o&&c[f].click());break}case"ArrowDown":{s==="vertical"&&(l.stopPropagation(),l.preventDefault(),c[d].focus(),o&&c[d].click());break}case"Home":{l.stopPropagation(),l.preventDefault(),!c[0].disabled&&c[0].focus();break}case"End":{l.stopPropagation(),l.preventDefault();const y=c.length-1;!c[y].disabled&&c[y].focus();break}}}}const a2={app:100,modal:200,popover:300,overlay:400,max:9999};function zr(e){return a2[e]}const l2=()=>{};function c2(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||l2:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function Pe(e,t="size",n=!0){if(e!==void 0)return IS(e)?n?B(e):e:`var(--${t}-${e})`}function rn(e){return Pe(e,"mantine-spacing")}function gt(e){return e===void 0?"var(--mantine-radius-default)":Pe(e,"mantine-radius")}function Kt(e){return Pe(e,"mantine-font-size")}function AS(e){return Pe(e,"mantine-line-height",!1)}function ng(e){if(e)return Pe(e,"mantine-shadow",!1)}function Gn(e,t){return n=>{e==null||e(n),t==null||t(n)}}function rg(e,t){return e in t.breakpoints?vp(t.breakpoints[e]):vp(e)}function Ll(e,t){const n=e.map(r=>({value:r,px:rg(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function ni(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function u2(e,t,n){var r;return n?Array.from(((r=Zu(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(o=>o===n):null}function d2(){const[e,t]=p.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function og(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function O0(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function $i(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Yd(e,t){const n=$i(e),r=p.useRef(0);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),p.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}const M0=["mousedown","touchstart"];function f2(e,t,n){const r=p.useRef();return p.useEffect(()=>{const o=i=>{const{target:s}=i??{};if(Array.isArray(n)){const l=(s==null?void 0:s.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(s)&&s.tagName!=="HTML";n.every(u=>!!u&&!i.composedPath().includes(u))&&!l&&e()}else r.current&&!r.current.contains(s)&&e()};return(t||M0).forEach(i=>document.addEventListener(i,o)),()=>{(t||M0).forEach(i=>document.removeEventListener(i,o))}},[r,e,n]),r}function NS({timeout:e=2e3}={}){const[t,n]=p.useState(null),[r,o]=p.useState(!1),[i,s]=p.useState(null),l=d=>{window.clearTimeout(i),s(window.setTimeout(()=>o(!1),e)),o(d)};return{copy:d=>{"clipboard"in navigator?navigator.clipboard.writeText(d).then(()=>l(!0)).catch(f=>n(f)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{o(!1),n(null),window.clearTimeout(i)},error:t,copied:r}}function h2(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function p2(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function OS(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=p.useState(n?t:p2(e)),i=p.useRef();return p.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),h2(i.current,s=>o(s.matches))},[e]),r}function m2(e,t){return OS("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const Oa=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Co(e,t){const n=p.useRef(!1);p.useEffect(()=>()=>{n.current=!1},[]),p.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function MS({opened:e,shouldReturnFocus:t=!0}){const n=p.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return Co(()=>{let o=-1;const i=s=>{s.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",i),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",i)}},[e,t]),r}function g2(e,t="body > :not(script)"){const n=og(),r=Array.from(document.querySelectorAll(t)).map(o=>{var c;if((c=o==null?void 0:o.shadowRoot)!=null&&c.contains(e)||o.contains(e))return;const i=o.getAttribute("aria-hidden"),s=o.getAttribute("data-hidden"),l=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),i===null||i==="false"?o.setAttribute("aria-hidden","true"):!s&&!l&&o.setAttribute("data-hidden",i),{node:o,ariaHidden:s||null}});return()=>{r.forEach(o=>{!o||n!==o.node.getAttribute("data-focus-id")||(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden),o.node.removeAttribute("data-focus-id"),o.node.removeAttribute("data-hidden"))})}}const y2=/input|select|textarea|button|object/,LS="a, input, select, textarea, button, object, [tabindex]";function v2(e){return e.style.display==="none"}function x2(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let n=e;for(;n&&!(n===document.body||n.nodeType===11);){if(v2(n))return!1;n=n.parentNode}return!0}function $S(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function xp(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN($S(e));return(y2.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&x2(e)}function FS(e){const t=$S(e);return(Number.isNaN(t)||t>=0)&&xp(e)}function w2(e){return Array.from(e.querySelectorAll(LS)).filter(FS)}function S2(e,t){const n=w2(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();let i=r===o.activeElement||e===o.activeElement;const s=o.activeElement;if(s.tagName==="INPUT"&&s.getAttribute("type")==="radio"&&(i=n.filter(d=>d.getAttribute("type")==="radio"&&d.getAttribute("name")===s.getAttribute("name")).includes(r)),!i)return;t.preventDefault();const c=n[t.shiftKey?n.length-1:0];c&&c.focus()}function b2(e=!0){const t=p.useRef(),n=p.useRef(null),r=i=>{let s=i.querySelector("[data-autofocus]");if(!s){const l=Array.from(i.querySelectorAll(LS));s=l.find(FS)||l.find(xp)||null,!s&&xp(i)&&(s=i)}s&&s.focus({preventScroll:!0})},o=p.useCallback(i=>{if(e){if(i===null){n.current&&(n.current(),n.current=null);return}n.current=g2(i),t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&r(i)}),t.current=i):t.current=null)}},[e]);return p.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const i=s=>{s.key==="Tab"&&t.current&&S2(t.current,s)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),n.current&&n.current()}},[e]),o}const C2=e=>(e+1)%1e6;function E2(){const[,e]=p.useReducer(C2,0);return e}const j2=C.useId||(()=>{});function P2(){const e=j2();return e?`mantine-${e.replace(/:/g,"")}`:""}function kn(e){const t=P2(),[n,r]=p.useState(t);return Oa(()=>{r(og())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function zS(e,t,n){p.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function ig(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function T2(...e){return t=>{e.forEach(n=>ig(n,t))}}function Zt(...e){return p.useCallback(T2(...e),e)}function gn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,i]=p.useState(t!==void 0?t:n),s=(l,...c)=>{i(l),r==null||r(l,...c)};return e!==void 0?[e,r,!0]:[o,s,!1]}function qo(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const su="dots";function k2({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:o=1,onChange:i}){const s=Math.max(Math.trunc(e),0),[l,c]=gn({value:r,onChange:i,defaultValue:o,finalValue:o}),u=y=>{y<=0?c(1):y>s?c(s):c(y)},d=()=>u(l+1),f=()=>u(l-1),h=()=>u(1),m=()=>u(s);return{range:p.useMemo(()=>{if(t*2+3+n*2>=s)return qo(1,s);const S=Math.max(l-t,n),v=Math.min(l+t,s-n),x=S>n+2,w=v<s-(n+1);if(!x&&w){const b=t*2+n+2;return[...qo(1,b),su,...qo(s-(n-1),s)]}if(x&&!w){const b=n+1+2*t;return[...qo(1,n),su,...qo(s-b,s)]}return[...qo(1,n),su,...qo(S,v),su,...qo(s-n+1,s)]},[s,t,l]),active:l,setPage:u,next:d,previous:f,first:h,last:m}}function sg(e,t){return OS("(prefers-reduced-motion: reduce)",e,t)}const R2={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function D2(e){const t=p.useRef(0),n=p.useRef(null),[r,o]=p.useState(R2),i=p.useMemo(()=>typeof window<"u"?new ResizeObserver(s=>{const l=s[0];l&&(cancelAnimationFrame(t.current),t.current=requestAnimationFrame(()=>{n.current&&o(l.contentRect)}))}):null,[]);return p.useEffect(()=>(n.current&&(i==null||i.observe(n.current,e)),()=>{i==null||i.disconnect(),t.current&&cancelAnimationFrame(t.current)}),[n.current]),[n,r]}function I2(e=!1,t){const{onOpen:n,onClose:r}=t||{},[o,i]=p.useState(e),s=p.useCallback(()=>{i(u=>u||(n==null||n(),!0))},[n]),l=p.useCallback(()=>{i(u=>u&&(r==null||r(),!1))},[r]),c=p.useCallback(()=>{o?l():s()},[l,s,o]);return[o,{open:s,close:l,toggle:c}]}function _2(e,t,n={autoInvoke:!1}){const r=p.useRef(null),o=p.useCallback((...s)=>{r.current||(r.current=window.setTimeout(()=>{e(s),r.current=null},t))},[t]),i=p.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return p.useEffect(()=>(n.autoInvoke&&o(),i),[i,o]),{start:o,clear:i}}var A2={};function BS(){return typeof process<"u"&&A2?"production":"development"}function US(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=US(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function et(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=US(e))&&(r&&(r+=" "),r+=t);return r}const N2={};function O2(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,o])=>{t[r]?t[r]=et(t[r],o):t[r]=o})}),t}function Xd({theme:e,classNames:t,props:n,stylesCtx:r}){const i=(Array.isArray(t)?t:[t]).map(s=>typeof s=="function"?s(e,n,r):s||N2);return O2(i)}function ed({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((i,s)=>typeof s=="function"?{...i,...s(e,n,r)}:{...i,...s},{})}const ag=p.createContext(null);function Ma(){const e=p.useContext(ag);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function M2(){return Ma().cssVariablesResolver}function L2(){return Ma().classNamesPrefix}function lg(){return Ma().getStyleNonce}function $2(){return Ma().withStaticClasses}function F2(){return Ma().headless}function z2(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function B2(e){let t=e.replace("#","");if(t.length===3){const s=t.split("");t=[s[0],s[0],s[1],s[1],s[2],s[2]].join("")}if(t.length===8){const s=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:s}}const n=parseInt(t,16),r=n>>16&255,o=n>>8&255,i=n&255;return{r,g:o,b:i,a:1}}function U2(e){const[t,n,r,o]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:o||1}}function V2(e){const t=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=e.match(t);if(!n)return{r:0,g:0,b:0,a:1};const r=parseInt(n[1],10),o=parseInt(n[2],10)/100,i=parseInt(n[3],10)/100,s=n[5]?parseFloat(n[5]):void 0,l=(1-Math.abs(2*i-1))*o,c=r/60,u=l*(1-Math.abs(c%2-1)),d=i-l/2;let f,h,m;return c>=0&&c<1?(f=l,h=u,m=0):c>=1&&c<2?(f=u,h=l,m=0):c>=2&&c<3?(f=0,h=l,m=u):c>=3&&c<4?(f=0,h=u,m=l):c>=4&&c<5?(f=u,h=0,m=l):(f=l,h=0,m=u),{r:Math.round((f+d)*255),g:Math.round((h+d)*255),b:Math.round((m+d)*255),a:s||1}}function cg(e){return z2(e)?B2(e):e.startsWith("rgb")?U2(e):e.startsWith("hsl")?V2(e):{r:0,g:0,b:0,a:1}}function au(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:i}=cg(e),s=1-t,l=c=>Math.round(c*s);return`rgba(${l(n)}, ${l(r)}, ${l(o)}, ${i})`}function td(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function wh(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function W2(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function H2(e){if(e.startsWith("oklch("))return(W2(e)||0)/100;const{r:t,g:n,b:r}=cg(e),o=t/255,i=n/255,s=r/255,l=wh(o),c=wh(i),u=wh(s);return .2126*l+.7152*c+.0722*u}function tl(e,t=.179){return e.startsWith("var(")?!1:H2(e)>t}function ao({color:e,theme:t,colorScheme:n}){if(typeof e!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e==="bright")return{color:e,value:n==="dark"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:tl(n==="dark"?t.white:t.black,t.luminanceThreshold),variable:"--mantine-color-bright"};if(e==="dimmed")return{color:e,value:n==="dark"?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:tl(n==="dark"?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:"--mantine-color-dimmed"};if(e==="white"||e==="black")return{color:e,value:e==="white"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:tl(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,o]=e.split("."),i=o?Number(o):void 0,s=r in t.colors;if(s){const l=i!==void 0?t.colors[r][i]:t.colors[r][td(t,n||"light")];return{color:r,value:l,shade:i,isThemeColor:s,isLight:tl(l,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${i}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:s,isLight:tl(e,t.luminanceThreshold),shade:i,variable:void 0}}function mt(e,t){const n=ao({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function wp(e,t){const n={from:(e==null?void 0:e.from)||t.defaultGradient.from,to:(e==null?void 0:e.to)||t.defaultGradient.to,deg:(e==null?void 0:e.deg)||t.defaultGradient.deg||0},r=mt(n.from,t),o=mt(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function nn(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const i=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${i}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:o}=cg(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const q2=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const i=ao({color:e,theme:t}),s=typeof o=="boolean"?o:t.autoContrast;if(n==="filled"){const l=s&&i.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return i.isThemeColor?i.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:l,border:`${B(1)} solid transparent`}:{background:`var(--mantine-color-${i.color}-${i.shade})`,hover:`var(--mantine-color-${i.color}-${i.shade===9?8:i.shade+1})`,color:l,border:`${B(1)} solid transparent`}:{background:e,hover:au(e,.1),color:l,border:`${B(1)} solid transparent`}}if(n==="light"){if(i.isThemeColor){if(i.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${B(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:nn(l,.1),hover:nn(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${B(1)} solid transparent`}}return{background:nn(e,.1),hover:nn(e,.12),color:e,border:`${B(1)} solid transparent`}}if(n==="outline")return i.isThemeColor?i.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${B(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:nn(t.colors[i.color][i.shade],.05),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${B(1)} solid var(--mantine-color-${i.color}-${i.shade})`}:{background:"transparent",hover:nn(e,.05),color:e,border:`${B(1)} solid ${e}`};if(n==="subtle"){if(i.isThemeColor){if(i.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${B(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:"transparent",hover:nn(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${B(1)} solid transparent`}}return{background:"transparent",hover:nn(e,.12),color:e,border:`${B(1)} solid transparent`}}return n==="transparent"?i.isThemeColor?i.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${B(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${B(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${B(1)} solid transparent`}:n==="white"?i.isThemeColor?i.shade===void 0?{background:"var(--mantine-color-white)",hover:au(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${B(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:au(t.white,.01),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${B(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:au(t.white,.01),color:e,border:`${B(1)} solid transparent`}:n==="gradient"?{background:wp(r,t),hover:wp(r,t),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${B(1)} solid var(--mantine-color-default-border)`}:{}},G2={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},L0="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",ug={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:G2,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:q2,autoContrast:!1,luminanceThreshold:.3,fontFamily:L0,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:L0,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:B(34),lineHeight:"1.3"},h2:{fontSize:B(26),lineHeight:"1.35"},h3:{fontSize:B(22),lineHeight:"1.4"},h4:{fontSize:B(18),lineHeight:"1.45"},h5:{fontSize:B(16),lineHeight:"1.5"},h6:{fontSize:B(14),lineHeight:"1.5"}}},fontSizes:{xs:B(12),sm:B(14),md:B(16),lg:B(18),xl:B(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:B(2),sm:B(4),md:B(8),lg:B(16),xl:B(32)},spacing:{xs:B(10),sm:B(12),md:B(16),lg:B(20),xl:B(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${B(1)} ${B(3)} rgba(0, 0, 0, 0.05), 0 ${B(1)} ${B(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${B(1)} ${B(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${B(10)} ${B(15)} ${B(-5)}, rgba(0, 0, 0, 0.04) 0 ${B(7)} ${B(7)} ${B(-5)}`,md:`0 ${B(1)} ${B(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${B(20)} ${B(25)} ${B(-5)}, rgba(0, 0, 0, 0.04) 0 ${B(10)} ${B(10)} ${B(-5)}`,lg:`0 ${B(1)} ${B(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${B(28)} ${B(23)} ${B(-7)}, rgba(0, 0, 0, 0.04) 0 ${B(12)} ${B(12)} ${B(-7)}`,xl:`0 ${B(1)} ${B(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${B(36)} ${B(28)} ${B(-7)}, rgba(0, 0, 0, 0.04) 0 ${B(17)} ${B(17)} ${B(-7)}`},other:{},components:{}};function $0(e){return e==="auto"||e==="dark"||e==="light"}function Q2({key:e="mantine-color-scheme-value"}={}){let t;return{get:n=>{if(typeof window>"u")return n;try{const r=window.localStorage.getItem(e);return $0(r)?r:n}catch{return n}},set:n=>{try{window.localStorage.setItem(e,n)}catch(r){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",r)}},subscribe:n=>{t=r=>{r.storageArea===window.localStorage&&r.key===e&&$0(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const K2="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",F0="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Sh(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function z0(e){if(!(e.primaryColor in e.colors))throw new Error(K2);if(typeof e.primaryShade=="object"&&(!Sh(e.primaryShade.dark)||!Sh(e.primaryShade.light)))throw new Error(F0);if(typeof e.primaryShade=="number"&&!Sh(e.primaryShade))throw new Error(F0)}function Y2(e,t){var r;if(!t)return z0(e),e;const n=tg(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),z0(n),n}const dg=p.createContext(null),X2=()=>p.useContext(dg)||ug;function kt(){const e=p.useContext(dg);if(!e)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return e}function VS({theme:e,children:t,inherit:n=!0}){const r=X2(),o=p.useMemo(()=>Y2(n?r:ug,e),[e,r,n]);return C.createElement(dg.Provider,{value:o},t)}VS.displayName="@mantine/core/MantineThemeProvider";function J2(){const e=kt(),t=lg(),n=pt(e.breakpoints).reduce((r,o)=>{const i=e.breakpoints[o].includes("px"),s=vp(e.breakpoints[o]),l=i?`${s-.1}px`:Ju(s-.1),c=i?`${s}px`:Ju(s);return`${r}@media (max-width: ${l}) {.mantine-visible-from-${o} {display: none !important;}}@media (min-width: ${c}) {.mantine-hidden-from-${o} {display: none !important;}}`},"");return C.createElement("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function bh(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Ch(e,t){return(Array.isArray(e)?e:[e]).reduce((r,o)=>`${o}{${r}}`,t)}function Z2(e,t){const n=bh(e.variables),r=n?Ch(t,n):"",o=bh(e.dark),i=o?Ch(`${t}[data-mantine-color-scheme="dark"]`,o):"",s=bh(e.light),l=s?Ch(`${t}[data-mantine-color-scheme="light"]`,s):"";return`${r}${i}${l}`}function fs({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&ao({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function B0(e,t){return fs({color:e.colors[e.primaryColor][td(e,t)],theme:e,autoContrast:null})}function Ns(e,t,n){pt(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const WS=e=>{const t=td(e,"dark"),n=td(e,"light"),r=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:B(e.defaultRadius),o={variables:{"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-color-scheme":"light dark","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":r,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-primary-color-contrast":B0(e,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${n})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)"},dark:{"--mantine-primary-color-contrast":B0(e,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)"}};Ns(o.variables,e.breakpoints,"breakpoint"),Ns(o.variables,e.spacing,"spacing"),Ns(o.variables,e.fontSizes,"font-size"),Ns(o.variables,e.lineHeights,"line-height"),Ns(o.variables,e.shadows,"shadow"),Ns(o.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((s,l)=>{o.variables[`--mantine-primary-color-${l}`]=`var(--mantine-color-${e.primaryColor}-${l})`}),pt(e.colors).forEach(s=>{e.colors[s].forEach((u,d)=>{o.variables[`--mantine-color-${s}-${d}`]=u});const l=`var(--mantine-color-${s}-${n===9?8:n+1})`,c=`var(--mantine-color-${s}-${t===9?8:t+1})`;o.light["--mantine-color-dimmed"]="var(--mantine-color-gray-6)",o.light[`--mantine-color-${s}-text`]=`var(--mantine-color-${s}-filled)`,o.light[`--mantine-color-${s}-filled`]=`var(--mantine-color-${s}-${n})`,o.light[`--mantine-color-${s}-filled-hover`]=l,o.light[`--mantine-color-${s}-light`]=nn(e.colors[s][n],.1),o.light[`--mantine-color-${s}-light-hover`]=nn(e.colors[s][n],.12),o.light[`--mantine-color-${s}-light-color`]=`var(--mantine-color-${s}-${n})`,o.light[`--mantine-color-${s}-outline`]=`var(--mantine-color-${s}-${n})`,o.light[`--mantine-color-${s}-outline-hover`]=nn(e.colors[s][n],.05),o.dark["--mantine-color-dimmed"]="var(--mantine-color-dark-2)",o.dark[`--mantine-color-${s}-text`]=`var(--mantine-color-${s}-4)`,o.dark[`--mantine-color-${s}-filled`]=`var(--mantine-color-${s}-${t})`,o.dark[`--mantine-color-${s}-filled-hover`]=c,o.dark[`--mantine-color-${s}-light`]=nn(e.colors[s][Math.max(0,t-2)],.15),o.dark[`--mantine-color-${s}-light-hover`]=nn(e.colors[s][Math.max(0,t-2)],.2),o.dark[`--mantine-color-${s}-light-color`]=`var(--mantine-color-${s}-${Math.max(t-5,0)})`,o.dark[`--mantine-color-${s}-outline`]=`var(--mantine-color-${s}-${Math.max(t-4,0)})`,o.dark[`--mantine-color-${s}-outline-hover`]=nn(e.colors[s][Math.max(t-4,0)],.05)});const i=e.headings.sizes;return pt(i).forEach(s=>{o.variables[`--mantine-${s}-font-size`]=i[s].fontSize,o.variables[`--mantine-${s}-line-height`]=i[s].lineHeight,o.variables[`--mantine-${s}-font-weight`]=i[s].fontWeight||e.headings.fontWeight}),o};function eD({theme:e,generator:t}){const n=WS(e),r=t==null?void 0:t(e);return r?tg(n,r):n}const Eh=WS(ug);function tD(e){const t={variables:{},light:{},dark:{}};return pt(e.variables).forEach(n=>{Eh.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),pt(e.light).forEach(n=>{Eh.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),pt(e.dark).forEach(n=>{Eh.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function nD(e){return`
58
+ ${e}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }
59
+ ${e}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }
60
+ `}function HS({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=kt(),r=lg(),o=M2(),i=eD({theme:n,generator:o}),s=e===":root"&&t,l=s?tD(i):i,c=Z2(l,e);return c?C.createElement("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${c}${s?"":nD(e)}`}}):null}HS.displayName="@mantine/CssVariables";function rD(){const e=console.error;console.error=(...t)=>{t.length>1&&typeof t[0]=="string"&&t[0].toLowerCase().includes("extra attributes from the server")&&typeof t[1]=="string"&&t[1].toLowerCase().includes("data-mantine-color-scheme")||e(...t)}}function Os(e,t){var r;const n=e!=="auto"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";(r=t())==null||r.setAttribute("data-mantine-color-scheme",n)}function oD({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=p.useRef(),[i,s]=p.useState(()=>e.get(t)),l=r||i,c=p.useCallback(d=>{r||(Os(d,n),s(d),e.set(d))},[e.set,l,r]),u=p.useCallback(()=>{s(t),Os(t,n),e.clear()},[e.clear,t]);return p.useEffect(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),Oa(()=>{Os(e.get(t),n)},[]),p.useEffect(()=>{var f;if(r)return Os(r,n),()=>{};r===void 0&&Os(i,n),o.current=window.matchMedia("(prefers-color-scheme: dark)");const d=h=>{i==="auto"&&Os(h.matches?"dark":"light",n)};return(f=o.current)==null||f.addEventListener("change",d),()=>{var h;return(h=o.current)==null?void 0:h.removeEventListener("change",d)}},[i,r]),{colorScheme:l,setColorScheme:c,clearColorScheme:u}}function iD({respectReducedMotion:e,getRootElement:t}){Oa(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}rD();function qS({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:o=!0,deduplicateCssVariables:i=!0,withCssVariables:s=!0,cssVariablesSelector:l=":root",classNamesPrefix:c="mantine",colorSchemeManager:u=Q2(),defaultColorScheme:d="light",getRootElement:f=()=>document.documentElement,cssVariablesResolver:h,forceColorScheme:m}){const{colorScheme:g,setColorScheme:y,clearColorScheme:S}=oD({defaultColorScheme:d,forceColorScheme:m,manager:u,getRootElement:f});return iD({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:f}),C.createElement(ag.Provider,{value:{colorScheme:g,setColorScheme:y,clearColorScheme:S,getRootElement:f,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:h,cssVariablesSelector:l,withStaticClasses:r}},C.createElement(VS,{theme:e},s&&C.createElement(HS,{cssVariablesSelector:l,deduplicateCssVariables:i}),o&&C.createElement(J2,null),t))}qS.displayName="@mantine/core/MantineProvider";function Jd({classNames:e,styles:t,props:n,stylesCtx:r}){const o=kt();return{resolvedClassNames:Xd({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:ed({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const sD={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function aD({theme:e,options:t,unstyled:n}){return et((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||sD[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function lD({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return Xd({theme:o,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function cD({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return Xd({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function uD({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function dD({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function fD({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function hD({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(i=>{var s,l;return(l=Xd({theme:t,classNames:(s=t.components[i])==null?void 0:s.classNames,props:r,stylesCtx:o}))==null?void 0:l[n]})}function pD({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function mD({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:i,classes:s,unstyled:l,className:c,rootSelector:u,props:d,stylesCtx:f,withStaticClasses:h,headless:m}){return et(aD({theme:e,options:t,unstyled:l||m}),hD({theme:e,themeName:n,selector:r,props:d,stylesCtx:f}),pD({options:t,classes:s,selector:r,unstyled:l}),cD({selector:r,stylesCtx:f,theme:e,classNames:i,props:d}),lD({selector:r,stylesCtx:f,options:t,props:d,theme:e}),uD({rootSelector:u,selector:r,className:c}),dD({selector:r,classes:s,unstyled:l||m}),h&&!m&&fD({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function gD({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(i=>{var s;return ed({theme:e,styles:(s=e.components[i])==null?void 0:s.styles,props:n,stylesCtx:r})[o]}).reduce((i,s)=>({...i,...s}),{})}function Sp({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Sp({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function yD(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...ds(n[r])}}),t),{})}function vD({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:i,themeName:s,headless:l}){var c;return(c=yD([l?{}:t==null?void 0:t(n,r,o),...s.map(u=>{var d,f,h;return(h=(f=(d=n.components)==null?void 0:d[u])==null?void 0:f.vars)==null?void 0:h.call(f,n,r,o)}),e==null?void 0:e(n,r,o)]))==null?void 0:c[i]}function xD({theme:e,themeName:t,selector:n,options:r,props:o,stylesCtx:i,rootSelector:s,styles:l,style:c,vars:u,varsResolver:d,headless:f}){return{...gD({theme:e,themeName:t,props:o,stylesCtx:i,selector:n}),...ed({theme:e,styles:l,props:o,stylesCtx:i})[n],...ed({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||o,stylesCtx:i})[n],...vD({theme:e,props:o,stylesCtx:i,vars:u,varsResolver:d,selector:n,themeName:t,headless:f}),...s===n?Sp({style:c,theme:e}):null,...Sp({style:r==null?void 0:r.style,theme:e})}}function de({name:e,classes:t,props:n,stylesCtx:r,className:o,style:i,rootSelector:s="root",unstyled:l,classNames:c,styles:u,vars:d,varsResolver:f}){const h=kt(),m=L2(),g=$2(),y=F2(),S=(Array.isArray(e)?e:[e]).filter(v=>v);return(v,x)=>({className:mD({theme:h,options:x,themeName:S,selector:v,classNamesPrefix:m,classNames:c,classes:t,unstyled:l,className:o,rootSelector:s,props:n,stylesCtx:r,withStaticClasses:g,headless:y}),style:xD({theme:h,themeName:S,selector:v,options:x,props:n,stylesCtx:r,rootSelector:s,styles:u,style:i,vars:d,varsResolver:f,headless:y})})}function gc(e,t){return typeof e=="boolean"?e:t.autoContrast}function U0(){const e=document.createElement("style");return e.innerHTML="*, *::before, *::after {transition: none !important;}",e.setAttribute("data-mantine-disable-transition","true"),document.head.appendChild(e),()=>document.querySelectorAll("[data-mantine-disable-transition]").forEach(n=>n.remove())}function wD({keepTransitions:e}={}){const t=p.useRef(),n=p.useRef(),r=p.useContext(ag);if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const o=u=>{r.setColorScheme(u),t.current=e?()=>{}:U0(),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var d;(d=t.current)==null||d.call(t)},10)},i=()=>{r.clearColorScheme(),t.current=e?()=>{}:U0(),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var u;(u=t.current)==null||u.call(t)},10)},s=m2("light",{getInitialValueInEffect:!1}),l=r.colorScheme==="auto"?s:r.colorScheme,c=p.useCallback(()=>o(l==="light"?"dark":"light"),[o,l]);return p.useEffect(()=>()=>{var u;(u=t.current)==null||u.call(t),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:o,clearColorScheme:i,toggleColorScheme:c}}function U(e,t,n){var s;const r=kt(),o=(s=r.components[e])==null?void 0:s.defaultProps,i=typeof o=="function"?o(r):o;return{...t,...i,...ds(n)}}function V0(e){return pt(e).reduce((t,n)=>e[n]!==void 0?`${t}${n2(n)}:${e[n]};`:t,"").trim()}function SD({selector:e,styles:t,media:n}){const r=t?V0(t):"",o=Array.isArray(n)?n.map(i=>`@media${i.query}{${e}{${V0(i.styles)}}}`):[];return`${r?`${e}{${r}}`:""}${o.join("")}`.trim()}function La({selector:e,styles:t,media:n}){const r=lg();return C.createElement("style",{"data-mantine-styles":"inline",nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:SD({selector:e,styles:t,media:n})}})}function No(e){const{m:t,mx:n,my:r,mt:o,mb:i,ml:s,mr:l,me:c,ms:u,p:d,px:f,py:h,pt:m,pb:g,pl:y,pr:S,pe:v,ps:x,bg:w,c:b,opacity:j,ff:E,fz:P,fw:T,lts:D,ta:_,lh:O,fs:I,tt:$,td:N,w:L,miw:M,maw:R,h:k,mih:F,mah:q,bgsz:G,bgp:oe,bgr:xe,bga:me,pos:Ce,top:je,left:Be,bottom:Me,right:Ke,inset:St,display:X,flex:ke,hiddenFrom:tt,visibleFrom:Ne,lightHidden:Ve,darkHidden:Rt,...ln}=e;return{styleProps:ds({m:t,mx:n,my:r,mt:o,mb:i,ml:s,mr:l,me:c,ms:u,p:d,px:f,py:h,pt:m,pb:g,pl:y,pr:S,pe:v,ps:x,bg:w,c:b,opacity:j,ff:E,fz:P,fw:T,lts:D,ta:_,lh:O,fs:I,tt:$,td:N,w:L,miw:M,maw:R,h:k,mih:F,mah:q,bgsz:G,bgp:oe,bgr:xe,bga:me,pos:Ce,top:je,left:Be,bottom:Me,right:Ke,inset:St,display:X,flex:ke,hiddenFrom:tt,visibleFrom:Ne,lightHidden:Ve,darkHidden:Rt}),rest:ln}}const bD={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"identity",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function GS(e,t){const n=ao({color:e,theme:t});return n.color==="dimmed"?"var(--mantine-color-dimmed)":n.color==="bright"?"var(--mantine-color-bright)":n.variable?`var(${n.variable})`:n.color}function CD(e,t){const n=ao({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:GS(e,t)}const W0={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)"};function ED(e){return typeof e=="string"&&e in W0?W0[e]:e}function jD(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="number"||typeof e=="string"?B(e):e}function PD(e){return e}function TD(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:e}function kD(e){return typeof e=="number"?B(e):e}function RD(e,t){if(typeof e=="number")return B(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return B(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const jh={color:GS,textColor:CD,fontSize:jD,spacing:RD,identity:PD,size:kD,lineHeight:TD,fontFamily:ED};function H0(e){return e.replace("(min-width: ","").replace("em)","")}function DD({media:e,...t}){const r=Object.keys(e).sort((o,i)=>Number(H0(o))-Number(H0(i))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function ID(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function _D(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function AD(e){return typeof e=="object"&&e!==null?pt(e).filter(t=>t!=="base"):[]}function ND(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function QS({styleProps:e,data:t,theme:n}){return DD(pt(e).reduce((r,o)=>{if(o==="hiddenFrom"||o==="visibleFrom")return r;const i=t[o],s=Array.isArray(i.property)?i.property:[i.property],l=_D(e[o]);if(!ID(e[o]))return s.forEach(u=>{r.inlineStyles[u]=jh[i.type](l,n)}),r;r.hasResponsiveStyles=!0;const c=AD(e[o]);return s.forEach(u=>{l&&(r.styles[u]=jh[i.type](l,n)),c.forEach(d=>{const f=`(min-width: ${n.breakpoints[d]})`;r.media[f]={...r.media[f],[u]:jh[i.type](ND(e[o],d),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function yc(){return`__m__-${p.useId().replace(/:/g,"")}`}function KS(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...KS(r,t)}),{}):typeof e=="function"?e(t):e??{}}function YS(e){return e.startsWith("data-")?e:`data-${e}`}function OD(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[YS(n)]=e[n]),t},{})}function XS(e){return e?typeof e=="string"?{[YS(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...XS(n)}),{}):OD(e):null}function bp(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...bp(r,t)}),{}):typeof e=="function"?e(t):e??{}}function MD({theme:e,style:t,vars:n,styleProps:r}){const o=bp(t,e),i=bp(n,e);return{...o,...i,...r}}const JS=p.forwardRef(({component:e,style:t,__vars:n,className:r,variant:o,mod:i,size:s,hiddenFrom:l,visibleFrom:c,lightHidden:u,darkHidden:d,renderRoot:f,...h},m)=>{const g=kt(),y=e||"div",{styleProps:S,rest:v}=No(h),x=yc(),w=QS({styleProps:S,theme:g,data:bD}),b={ref:m,style:MD({theme:g,style:t,vars:n,styleProps:w.inlineStyles}),className:et(r,{[x]:w.hasResponsiveStyles,"mantine-light-hidden":u,"mantine-dark-hidden":d,[`mantine-hidden-from-${l}`]:l,[`mantine-visible-from-${c}`]:c}),"data-variant":o,"data-size":IS(s)?void 0:s||void 0,...XS(i),...v};return C.createElement(C.Fragment,null,w.hasResponsiveStyles&&C.createElement(La,{selector:`.${x}`,styles:w.styles,media:w.media}),typeof f=="function"?f(b):C.createElement(y,{...b}))});JS.displayName="@mantine/core/Box";const W=JS;function ZS(e){return e}function Q(e){const t=p.forwardRef(e);return t.extend=ZS,t}function vn(e){const t=p.forwardRef(e);return t.extend=ZS,t}const LD=p.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function hs(){return p.useContext(LD)}var eb={exports:{}},nr={},tb={exports:{}},nb={};/**
61
+ * @license React
62
+ * scheduler.production.min.js
63
+ *
64
+ * Copyright (c) Facebook, Inc. and its affiliates.
65
+ *
66
+ * This source code is licensed under the MIT license found in the
67
+ * LICENSE file in the root directory of this source tree.
68
+ */(function(e){function t(k,F){var q=k.length;k.push(F);e:for(;0<q;){var G=q-1>>>1,oe=k[G];if(0<o(oe,F))k[G]=F,k[q]=oe,q=G;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var F=k[0],q=k.pop();if(q!==F){k[0]=q;e:for(var G=0,oe=k.length,xe=oe>>>1;G<xe;){var me=2*(G+1)-1,Ce=k[me],je=me+1,Be=k[je];if(0>o(Ce,q))je<oe&&0>o(Be,Ce)?(k[G]=Be,k[je]=q,G=je):(k[G]=Ce,k[me]=q,G=me);else if(je<oe&&0>o(Be,q))k[G]=Be,k[je]=q,G=je;else break e}}return F}function o(k,F){var q=k.sortIndex-F.sortIndex;return q!==0?q:k.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,g=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(k){for(var F=n(u);F!==null;){if(F.callback===null)r(u);else if(F.startTime<=k)r(u),F.sortIndex=F.expirationTime,t(c,F);else break;F=n(u)}}function b(k){if(y=!1,w(k),!g)if(n(c)!==null)g=!0,M(j);else{var F=n(u);F!==null&&R(b,F.startTime-k)}}function j(k,F){g=!1,y&&(y=!1,v(T),T=-1),m=!0;var q=h;try{for(w(F),f=n(c);f!==null&&(!(f.expirationTime>F)||k&&!O());){var G=f.callback;if(typeof G=="function"){f.callback=null,h=f.priorityLevel;var oe=G(f.expirationTime<=F);F=e.unstable_now(),typeof oe=="function"?f.callback=oe:f===n(c)&&r(c),w(F)}else r(c);f=n(c)}if(f!==null)var xe=!0;else{var me=n(u);me!==null&&R(b,me.startTime-F),xe=!1}return xe}finally{f=null,h=q,m=!1}}var E=!1,P=null,T=-1,D=5,_=-1;function O(){return!(e.unstable_now()-_<D)}function I(){if(P!==null){var k=e.unstable_now();_=k;var F=!0;try{F=P(!0,k)}finally{F?$():(E=!1,P=null)}}else E=!1}var $;if(typeof x=="function")$=function(){x(I)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,L=N.port2;N.port1.onmessage=I,$=function(){L.postMessage(null)}}else $=function(){S(I,0)};function M(k){P=k,E||(E=!0,$())}function R(k,F){T=S(function(){k(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(k){k.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,M(j))},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(k){switch(h){case 1:case 2:case 3:var F=3;break;default:F=h}var q=h;h=F;try{return k()}finally{h=q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(k,F){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var q=h;h=k;try{return F()}finally{h=q}},e.unstable_scheduleCallback=function(k,F,q){var G=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?G+q:G):q=G,k){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=q+oe,k={id:d++,callback:F,priorityLevel:k,startTime:q,expirationTime:oe,sortIndex:-1},q>G?(k.sortIndex=q,t(u,k),n(c)===null&&k===n(u)&&(y?(v(T),T=-1):y=!0,R(b,q-G))):(k.sortIndex=oe,t(c,k),g||m||(g=!0,M(j))),k},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(k){var F=h;return function(){var q=h;h=F;try{return k.apply(this,arguments)}finally{h=q}}}})(nb);tb.exports=nb;var $D=tb.exports;/**
69
+ * @license React
70
+ * react-dom.production.min.js
71
+ *
72
+ * Copyright (c) Facebook, Inc. and its affiliates.
73
+ *
74
+ * This source code is licensed under the MIT license found in the
75
+ * LICENSE file in the root directory of this source tree.
76
+ */var rb=p,Xn=$D;function K(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ob=new Set,$l={};function ps(e,t){ga(e,t),ga(e+"Capture",t)}function ga(e,t){for($l[e]=t,e=0;e<t.length;e++)ob.add(t[e])}var Eo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cp=Object.prototype.hasOwnProperty,FD=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,q0={},G0={};function zD(e){return Cp.call(G0,e)?!0:Cp.call(q0,e)?!1:FD.test(e)?G0[e]=!0:(q0[e]=!0,!1)}function BD(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function UD(e,t,n,r){if(t===null||typeof t>"u"||BD(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Rn(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var an={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){an[e]=new Rn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];an[t]=new Rn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){an[e]=new Rn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){an[e]=new Rn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){an[e]=new Rn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){an[e]=new Rn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){an[e]=new Rn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){an[e]=new Rn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){an[e]=new Rn(e,5,!1,e.toLowerCase(),null,!1,!1)});var fg=/[\-:]([a-z])/g;function hg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(fg,hg);an[t]=new Rn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(fg,hg);an[t]=new Rn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(fg,hg);an[t]=new Rn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){an[e]=new Rn(e,1,!1,e.toLowerCase(),null,!1,!1)});an.xlinkHref=new Rn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){an[e]=new Rn(e,1,!1,e.toLowerCase(),null,!0,!0)});function pg(e,t,n,r){var o=an.hasOwnProperty(t)?an[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(UD(t,n,o,r)&&(n=null),r||o===null?zD(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Oo=rb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,lu=Symbol.for("react.element"),Ws=Symbol.for("react.portal"),Hs=Symbol.for("react.fragment"),mg=Symbol.for("react.strict_mode"),Ep=Symbol.for("react.profiler"),ib=Symbol.for("react.provider"),sb=Symbol.for("react.context"),gg=Symbol.for("react.forward_ref"),jp=Symbol.for("react.suspense"),Pp=Symbol.for("react.suspense_list"),yg=Symbol.for("react.memo"),Ko=Symbol.for("react.lazy"),ab=Symbol.for("react.offscreen"),Q0=Symbol.iterator;function nl(e){return e===null||typeof e!="object"?null:(e=Q0&&e[Q0]||e["@@iterator"],typeof e=="function"?e:null)}var Tt=Object.assign,Ph;function wl(e){if(Ph===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ph=t&&t[1]||""}return`
77
+ `+Ph+e}var Th=!1;function kh(e,t){if(!e||Th)return"";Th=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
78
+ `),i=r.stack.split(`
79
+ `),s=o.length-1,l=i.length-1;1<=s&&0<=l&&o[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(o[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||o[s]!==i[l]){var c=`
80
+ `+o[s].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=s&&0<=l);break}}}finally{Th=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?wl(e):""}function VD(e){switch(e.tag){case 5:return wl(e.type);case 16:return wl("Lazy");case 13:return wl("Suspense");case 19:return wl("SuspenseList");case 0:case 2:case 15:return e=kh(e.type,!1),e;case 11:return e=kh(e.type.render,!1),e;case 1:return e=kh(e.type,!0),e;default:return""}}function Tp(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Hs:return"Fragment";case Ws:return"Portal";case Ep:return"Profiler";case mg:return"StrictMode";case jp:return"Suspense";case Pp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case sb:return(e.displayName||"Context")+".Consumer";case ib:return(e._context.displayName||"Context")+".Provider";case gg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case yg:return t=e.displayName||null,t!==null?t:Tp(e.type)||"Memo";case Ko:t=e._payload,e=e._init;try{return Tp(e(t))}catch{}}return null}function WD(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Tp(t);case 8:return t===mg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function gi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lb(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function HD(e){var t=lb(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function cu(e){e._valueTracker||(e._valueTracker=HD(e))}function cb(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=lb(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function nd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function kp(e,t){var n=t.checked;return Tt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function K0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=gi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ub(e,t){t=t.checked,t!=null&&pg(e,"checked",t,!1)}function Rp(e,t){ub(e,t);var n=gi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Dp(e,t.type,n):t.hasOwnProperty("defaultValue")&&Dp(e,t.type,gi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Y0(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Dp(e,t,n){(t!=="number"||nd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Sl=Array.isArray;function la(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+gi(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Ip(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(K(91));return Tt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function X0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(K(92));if(Sl(n)){if(1<n.length)throw Error(K(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:gi(n)}}function db(e,t){var n=gi(t.value),r=gi(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function J0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function fb(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function _p(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?fb(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var uu,hb=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(uu=uu||document.createElement("div"),uu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=uu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Fl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qD=["Webkit","ms","Moz","O"];Object.keys(Pl).forEach(function(e){qD.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pl[t]=Pl[e]})});function pb(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Pl.hasOwnProperty(e)&&Pl[e]?(""+t).trim():t+"px"}function mb(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=pb(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var GD=Tt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ap(e,t){if(t){if(GD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function Np(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Op=null;function vg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mp=null,ca=null,ua=null;function Z0(e){if(e=wc(e)){if(typeof Mp!="function")throw Error(K(280));var t=e.stateNode;t&&(t=rf(t),Mp(e.stateNode,e.type,t))}}function gb(e){ca?ua?ua.push(e):ua=[e]:ca=e}function yb(){if(ca){var e=ca,t=ua;if(ua=ca=null,Z0(e),t)for(e=0;e<t.length;e++)Z0(t[e])}}function vb(e,t){return e(t)}function xb(){}var Rh=!1;function wb(e,t,n){if(Rh)return e(t,n);Rh=!0;try{return vb(e,t,n)}finally{Rh=!1,(ca!==null||ua!==null)&&(xb(),yb())}}function zl(e,t){var n=e.stateNode;if(n===null)return null;var r=rf(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(K(231,t,typeof n));return n}var Lp=!1;if(Eo)try{var rl={};Object.defineProperty(rl,"passive",{get:function(){Lp=!0}}),window.addEventListener("test",rl,rl),window.removeEventListener("test",rl,rl)}catch{Lp=!1}function QD(e,t,n,r,o,i,s,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var Tl=!1,rd=null,od=!1,$p=null,KD={onError:function(e){Tl=!0,rd=e}};function YD(e,t,n,r,o,i,s,l,c){Tl=!1,rd=null,QD.apply(KD,arguments)}function XD(e,t,n,r,o,i,s,l,c){if(YD.apply(this,arguments),Tl){if(Tl){var u=rd;Tl=!1,rd=null}else throw Error(K(198));od||(od=!0,$p=u)}}function ms(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Sb(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ex(e){if(ms(e)!==e)throw Error(K(188))}function JD(e){var t=e.alternate;if(!t){if(t=ms(e),t===null)throw Error(K(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return ex(o),e;if(i===r)return ex(o),t;i=i.sibling}throw Error(K(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s)throw Error(K(189))}}if(n.alternate!==r)throw Error(K(190))}if(n.tag!==3)throw Error(K(188));return n.stateNode.current===n?e:t}function bb(e){return e=JD(e),e!==null?Cb(e):null}function Cb(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Cb(e);if(t!==null)return t;e=e.sibling}return null}var Eb=Xn.unstable_scheduleCallback,tx=Xn.unstable_cancelCallback,ZD=Xn.unstable_shouldYield,eI=Xn.unstable_requestPaint,Bt=Xn.unstable_now,tI=Xn.unstable_getCurrentPriorityLevel,xg=Xn.unstable_ImmediatePriority,jb=Xn.unstable_UserBlockingPriority,id=Xn.unstable_NormalPriority,nI=Xn.unstable_LowPriority,Pb=Xn.unstable_IdlePriority,Zd=null,no=null;function rI(e){if(no&&typeof no.onCommitFiberRoot=="function")try{no.onCommitFiberRoot(Zd,e,void 0,(e.current.flags&128)===128)}catch{}}var _r=Math.clz32?Math.clz32:sI,oI=Math.log,iI=Math.LN2;function sI(e){return e>>>=0,e===0?32:31-(oI(e)/iI|0)|0}var du=64,fu=4194304;function bl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function sd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=bl(l):(i&=s,i!==0&&(r=bl(i)))}else s=n&~o,s!==0?r=bl(s):i!==0&&(r=bl(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-_r(t),o=1<<n,r|=e[n],t&=~o;return r}function aI(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function lI(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-_r(i),l=1<<s,c=o[s];c===-1?(!(l&n)||l&r)&&(o[s]=aI(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function Fp(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Tb(){var e=du;return du<<=1,!(du&4194240)&&(du=64),e}function Dh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-_r(t),e[t]=n}function cI(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-_r(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function wg(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-_r(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var Ze=0;function kb(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Rb,Sg,Db,Ib,_b,zp=!1,hu=[],si=null,ai=null,li=null,Bl=new Map,Ul=new Map,ei=[],uI="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function nx(e,t){switch(e){case"focusin":case"focusout":si=null;break;case"dragenter":case"dragleave":ai=null;break;case"mouseover":case"mouseout":li=null;break;case"pointerover":case"pointerout":Bl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ul.delete(t.pointerId)}}function ol(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=wc(t),t!==null&&Sg(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function dI(e,t,n,r,o){switch(t){case"focusin":return si=ol(si,e,t,n,r,o),!0;case"dragenter":return ai=ol(ai,e,t,n,r,o),!0;case"mouseover":return li=ol(li,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Bl.set(i,ol(Bl.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Ul.set(i,ol(Ul.get(i)||null,e,t,n,r,o)),!0}return!1}function Ab(e){var t=zi(e.target);if(t!==null){var n=ms(t);if(n!==null){if(t=n.tag,t===13){if(t=Sb(n),t!==null){e.blockedOn=t,_b(e.priority,function(){Db(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Lu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Bp(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Op=r,n.target.dispatchEvent(r),Op=null}else return t=wc(n),t!==null&&Sg(t),e.blockedOn=n,!1;t.shift()}return!0}function rx(e,t,n){Lu(e)&&n.delete(t)}function fI(){zp=!1,si!==null&&Lu(si)&&(si=null),ai!==null&&Lu(ai)&&(ai=null),li!==null&&Lu(li)&&(li=null),Bl.forEach(rx),Ul.forEach(rx)}function il(e,t){e.blockedOn===t&&(e.blockedOn=null,zp||(zp=!0,Xn.unstable_scheduleCallback(Xn.unstable_NormalPriority,fI)))}function Vl(e){function t(o){return il(o,e)}if(0<hu.length){il(hu[0],e);for(var n=1;n<hu.length;n++){var r=hu[n];r.blockedOn===e&&(r.blockedOn=null)}}for(si!==null&&il(si,e),ai!==null&&il(ai,e),li!==null&&il(li,e),Bl.forEach(t),Ul.forEach(t),n=0;n<ei.length;n++)r=ei[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ei.length&&(n=ei[0],n.blockedOn===null);)Ab(n),n.blockedOn===null&&ei.shift()}var da=Oo.ReactCurrentBatchConfig,ad=!0;function hI(e,t,n,r){var o=Ze,i=da.transition;da.transition=null;try{Ze=1,bg(e,t,n,r)}finally{Ze=o,da.transition=i}}function pI(e,t,n,r){var o=Ze,i=da.transition;da.transition=null;try{Ze=4,bg(e,t,n,r)}finally{Ze=o,da.transition=i}}function bg(e,t,n,r){if(ad){var o=Bp(e,t,n,r);if(o===null)zh(e,t,r,ld,n),nx(e,r);else if(dI(o,e,t,n,r))r.stopPropagation();else if(nx(e,r),t&4&&-1<uI.indexOf(e)){for(;o!==null;){var i=wc(o);if(i!==null&&Rb(i),i=Bp(e,t,n,r),i===null&&zh(e,t,r,ld,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else zh(e,t,r,null,n)}}var ld=null;function Bp(e,t,n,r){if(ld=null,e=vg(r),e=zi(e),e!==null)if(t=ms(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Sb(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return ld=e,null}function Nb(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(tI()){case xg:return 1;case jb:return 4;case id:case nI:return 16;case Pb:return 536870912;default:return 16}default:return 16}}var ri=null,Cg=null,$u=null;function Ob(){if($u)return $u;var e,t=Cg,n=t.length,r,o="value"in ri?ri.value:ri.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return $u=o.slice(e,1<r?1-r:void 0)}function Fu(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function pu(){return!0}function ox(){return!1}function rr(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?pu:ox,this.isPropagationStopped=ox,this}return Tt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=pu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=pu)},persist:function(){},isPersistent:pu}),t}var $a={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Eg=rr($a),xc=Tt({},$a,{view:0,detail:0}),mI=rr(xc),Ih,_h,sl,ef=Tt({},xc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jg,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==sl&&(sl&&e.type==="mousemove"?(Ih=e.screenX-sl.screenX,_h=e.screenY-sl.screenY):_h=Ih=0,sl=e),Ih)},movementY:function(e){return"movementY"in e?e.movementY:_h}}),ix=rr(ef),gI=Tt({},ef,{dataTransfer:0}),yI=rr(gI),vI=Tt({},xc,{relatedTarget:0}),Ah=rr(vI),xI=Tt({},$a,{animationName:0,elapsedTime:0,pseudoElement:0}),wI=rr(xI),SI=Tt({},$a,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bI=rr(SI),CI=Tt({},$a,{data:0}),sx=rr(CI),EI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jI={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},PI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function TI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=PI[e])?!!t[e]:!1}function jg(){return TI}var kI=Tt({},xc,{key:function(e){if(e.key){var t=EI[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?jI[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jg,charCode:function(e){return e.type==="keypress"?Fu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),RI=rr(kI),DI=Tt({},ef,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ax=rr(DI),II=Tt({},xc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jg}),_I=rr(II),AI=Tt({},$a,{propertyName:0,elapsedTime:0,pseudoElement:0}),NI=rr(AI),OI=Tt({},ef,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),MI=rr(OI),LI=[9,13,27,32],Pg=Eo&&"CompositionEvent"in window,kl=null;Eo&&"documentMode"in document&&(kl=document.documentMode);var $I=Eo&&"TextEvent"in window&&!kl,Mb=Eo&&(!Pg||kl&&8<kl&&11>=kl),lx=" ",cx=!1;function Lb(e,t){switch(e){case"keyup":return LI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $b(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var qs=!1;function FI(e,t){switch(e){case"compositionend":return $b(t);case"keypress":return t.which!==32?null:(cx=!0,lx);case"textInput":return e=t.data,e===lx&&cx?null:e;default:return null}}function zI(e,t){if(qs)return e==="compositionend"||!Pg&&Lb(e,t)?(e=Ob(),$u=Cg=ri=null,qs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Mb&&t.locale!=="ko"?null:t.data;default:return null}}var BI={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ux(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!BI[e.type]:t==="textarea"}function Fb(e,t,n,r){gb(r),t=cd(t,"onChange"),0<t.length&&(n=new Eg("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Rl=null,Wl=null;function UI(e){Yb(e,0)}function tf(e){var t=Ks(e);if(cb(t))return e}function VI(e,t){if(e==="change")return t}var zb=!1;if(Eo){var Nh;if(Eo){var Oh="oninput"in document;if(!Oh){var dx=document.createElement("div");dx.setAttribute("oninput","return;"),Oh=typeof dx.oninput=="function"}Nh=Oh}else Nh=!1;zb=Nh&&(!document.documentMode||9<document.documentMode)}function fx(){Rl&&(Rl.detachEvent("onpropertychange",Bb),Wl=Rl=null)}function Bb(e){if(e.propertyName==="value"&&tf(Wl)){var t=[];Fb(t,Wl,e,vg(e)),wb(UI,t)}}function WI(e,t,n){e==="focusin"?(fx(),Rl=t,Wl=n,Rl.attachEvent("onpropertychange",Bb)):e==="focusout"&&fx()}function HI(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return tf(Wl)}function qI(e,t){if(e==="click")return tf(t)}function GI(e,t){if(e==="input"||e==="change")return tf(t)}function QI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Or=typeof Object.is=="function"?Object.is:QI;function Hl(e,t){if(Or(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Cp.call(t,o)||!Or(e[o],t[o]))return!1}return!0}function hx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function px(e,t){var n=hx(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=hx(n)}}function Ub(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ub(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vb(){for(var e=window,t=nd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=nd(e.document)}return t}function Tg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function KI(e){var t=Vb(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ub(n.ownerDocument.documentElement,n)){if(r!==null&&Tg(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=px(n,i);var s=px(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var YI=Eo&&"documentMode"in document&&11>=document.documentMode,Gs=null,Up=null,Dl=null,Vp=!1;function mx(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vp||Gs==null||Gs!==nd(r)||(r=Gs,"selectionStart"in r&&Tg(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Dl&&Hl(Dl,r)||(Dl=r,r=cd(Up,"onSelect"),0<r.length&&(t=new Eg("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Gs)))}function mu(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Qs={animationend:mu("Animation","AnimationEnd"),animationiteration:mu("Animation","AnimationIteration"),animationstart:mu("Animation","AnimationStart"),transitionend:mu("Transition","TransitionEnd")},Mh={},Wb={};Eo&&(Wb=document.createElement("div").style,"AnimationEvent"in window||(delete Qs.animationend.animation,delete Qs.animationiteration.animation,delete Qs.animationstart.animation),"TransitionEvent"in window||delete Qs.transitionend.transition);function nf(e){if(Mh[e])return Mh[e];if(!Qs[e])return e;var t=Qs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Wb)return Mh[e]=t[n];return e}var Hb=nf("animationend"),qb=nf("animationiteration"),Gb=nf("animationstart"),Qb=nf("transitionend"),Kb=new Map,gx="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function bi(e,t){Kb.set(e,t),ps(t,[e])}for(var Lh=0;Lh<gx.length;Lh++){var $h=gx[Lh],XI=$h.toLowerCase(),JI=$h[0].toUpperCase()+$h.slice(1);bi(XI,"on"+JI)}bi(Hb,"onAnimationEnd");bi(qb,"onAnimationIteration");bi(Gb,"onAnimationStart");bi("dblclick","onDoubleClick");bi("focusin","onFocus");bi("focusout","onBlur");bi(Qb,"onTransitionEnd");ga("onMouseEnter",["mouseout","mouseover"]);ga("onMouseLeave",["mouseout","mouseover"]);ga("onPointerEnter",["pointerout","pointerover"]);ga("onPointerLeave",["pointerout","pointerover"]);ps("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ps("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ps("onBeforeInput",["compositionend","keypress","textInput","paste"]);ps("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ps("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ps("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ZI=new Set("cancel close invalid load scroll toggle".split(" ").concat(Cl));function yx(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,XD(r,t,void 0,e),e.currentTarget=null}function Yb(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&o.isPropagationStopped())break e;yx(o,l,u),i=c}else for(s=0;s<r.length;s++){if(l=r[s],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&o.isPropagationStopped())break e;yx(o,l,u),i=c}}}if(od)throw e=$p,od=!1,$p=null,e}function yt(e,t){var n=t[Qp];n===void 0&&(n=t[Qp]=new Set);var r=e+"__bubble";n.has(r)||(Xb(t,e,2,!1),n.add(r))}function Fh(e,t,n){var r=0;t&&(r|=4),Xb(n,e,r,t)}var gu="_reactListening"+Math.random().toString(36).slice(2);function ql(e){if(!e[gu]){e[gu]=!0,ob.forEach(function(n){n!=="selectionchange"&&(ZI.has(n)||Fh(n,!1,e),Fh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[gu]||(t[gu]=!0,Fh("selectionchange",!1,t))}}function Xb(e,t,n,r){switch(Nb(t)){case 1:var o=hI;break;case 4:o=pI;break;default:o=bg}n=o.bind(null,t,n,e),o=void 0,!Lp||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function zh(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var c=s.tag;if((c===3||c===4)&&(c=s.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;s=s.return}for(;l!==null;){if(s=zi(l),s===null)return;if(c=s.tag,c===5||c===6){r=i=s;continue e}l=l.parentNode}}r=r.return}wb(function(){var u=i,d=vg(n),f=[];e:{var h=Kb.get(e);if(h!==void 0){var m=Eg,g=e;switch(e){case"keypress":if(Fu(n)===0)break e;case"keydown":case"keyup":m=RI;break;case"focusin":g="focus",m=Ah;break;case"focusout":g="blur",m=Ah;break;case"beforeblur":case"afterblur":m=Ah;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=ix;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=yI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=_I;break;case Hb:case qb:case Gb:m=wI;break;case Qb:m=NI;break;case"scroll":m=mI;break;case"wheel":m=MI;break;case"copy":case"cut":case"paste":m=bI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=ax}var y=(t&4)!==0,S=!y&&e==="scroll",v=y?h!==null?h+"Capture":null:h;y=[];for(var x=u,w;x!==null;){w=x;var b=w.stateNode;if(w.tag===5&&b!==null&&(w=b,v!==null&&(b=zl(x,v),b!=null&&y.push(Gl(x,b,w)))),S)break;x=x.return}0<y.length&&(h=new m(h,g,null,n,d),f.push({event:h,listeners:y}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==Op&&(g=n.relatedTarget||n.fromElement)&&(zi(g)||g[jo]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(g=n.relatedTarget||n.toElement,m=u,g=g?zi(g):null,g!==null&&(S=ms(g),g!==S||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(y=ix,b="onMouseLeave",v="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(y=ax,b="onPointerLeave",v="onPointerEnter",x="pointer"),S=m==null?h:Ks(m),w=g==null?h:Ks(g),h=new y(b,x+"leave",m,n,d),h.target=S,h.relatedTarget=w,b=null,zi(d)===u&&(y=new y(v,x+"enter",g,n,d),y.target=w,y.relatedTarget=S,b=y),S=b,m&&g)t:{for(y=m,v=g,x=0,w=y;w;w=Ms(w))x++;for(w=0,b=v;b;b=Ms(b))w++;for(;0<x-w;)y=Ms(y),x--;for(;0<w-x;)v=Ms(v),w--;for(;x--;){if(y===v||v!==null&&y===v.alternate)break t;y=Ms(y),v=Ms(v)}y=null}else y=null;m!==null&&vx(f,h,m,y,!1),g!==null&&S!==null&&vx(f,S,g,y,!0)}}e:{if(h=u?Ks(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var j=VI;else if(ux(h))if(zb)j=GI;else{j=HI;var E=WI}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=qI);if(j&&(j=j(e,u))){Fb(f,j,n,d);break e}E&&E(e,h,u),e==="focusout"&&(E=h._wrapperState)&&E.controlled&&h.type==="number"&&Dp(h,"number",h.value)}switch(E=u?Ks(u):window,e){case"focusin":(ux(E)||E.contentEditable==="true")&&(Gs=E,Up=u,Dl=null);break;case"focusout":Dl=Up=Gs=null;break;case"mousedown":Vp=!0;break;case"contextmenu":case"mouseup":case"dragend":Vp=!1,mx(f,n,d);break;case"selectionchange":if(YI)break;case"keydown":case"keyup":mx(f,n,d)}var P;if(Pg)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else qs?Lb(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(Mb&&n.locale!=="ko"&&(qs||T!=="onCompositionStart"?T==="onCompositionEnd"&&qs&&(P=Ob()):(ri=d,Cg="value"in ri?ri.value:ri.textContent,qs=!0)),E=cd(u,T),0<E.length&&(T=new sx(T,e,null,n,d),f.push({event:T,listeners:E}),P?T.data=P:(P=$b(n),P!==null&&(T.data=P)))),(P=$I?FI(e,n):zI(e,n))&&(u=cd(u,"onBeforeInput"),0<u.length&&(d=new sx("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=P))}Yb(f,t)})}function Gl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function cd(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=zl(e,n),i!=null&&r.unshift(Gl(e,i,o)),i=zl(e,t),i!=null&&r.push(Gl(e,i,o))),e=e.return}return r}function Ms(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function vx(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,o?(c=zl(n,i),c!=null&&s.unshift(Gl(n,c,l))):o||(c=zl(n,i),c!=null&&s.push(Gl(n,c,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var e_=/\r\n?/g,t_=/\u0000|\uFFFD/g;function xx(e){return(typeof e=="string"?e:""+e).replace(e_,`
81
+ `).replace(t_,"")}function yu(e,t,n){if(t=xx(t),xx(e)!==t&&n)throw Error(K(425))}function ud(){}var Wp=null,Hp=null;function qp(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Gp=typeof setTimeout=="function"?setTimeout:void 0,n_=typeof clearTimeout=="function"?clearTimeout:void 0,wx=typeof Promise=="function"?Promise:void 0,r_=typeof queueMicrotask=="function"?queueMicrotask:typeof wx<"u"?function(e){return wx.resolve(null).then(e).catch(o_)}:Gp;function o_(e){setTimeout(function(){throw e})}function Bh(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Vl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Vl(t)}function ci(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Sx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Fa=Math.random().toString(36).slice(2),to="__reactFiber$"+Fa,Ql="__reactProps$"+Fa,jo="__reactContainer$"+Fa,Qp="__reactEvents$"+Fa,i_="__reactListeners$"+Fa,s_="__reactHandles$"+Fa;function zi(e){var t=e[to];if(t)return t;for(var n=e.parentNode;n;){if(t=n[jo]||n[to]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Sx(e);e!==null;){if(n=e[to])return n;e=Sx(e)}return t}e=n,n=e.parentNode}return null}function wc(e){return e=e[to]||e[jo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ks(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(K(33))}function rf(e){return e[Ql]||null}var Kp=[],Ys=-1;function Ci(e){return{current:e}}function xt(e){0>Ys||(e.current=Kp[Ys],Kp[Ys]=null,Ys--)}function dt(e,t){Ys++,Kp[Ys]=e.current,e.current=t}var yi={},yn=Ci(yi),Ln=Ci(!1),Yi=yi;function ya(e,t){var n=e.type.contextTypes;if(!n)return yi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function $n(e){return e=e.childContextTypes,e!=null}function dd(){xt(Ln),xt(yn)}function bx(e,t,n){if(yn.current!==yi)throw Error(K(168));dt(yn,t),dt(Ln,n)}function Jb(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(K(108,WD(e)||"Unknown",o));return Tt({},n,r)}function fd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||yi,Yi=yn.current,dt(yn,e),dt(Ln,Ln.current),!0}function Cx(e,t,n){var r=e.stateNode;if(!r)throw Error(K(169));n?(e=Jb(e,t,Yi),r.__reactInternalMemoizedMergedChildContext=e,xt(Ln),xt(yn),dt(yn,e)):xt(Ln),dt(Ln,n)}var go=null,of=!1,Uh=!1;function Zb(e){go===null?go=[e]:go.push(e)}function a_(e){of=!0,Zb(e)}function Ei(){if(!Uh&&go!==null){Uh=!0;var e=0,t=Ze;try{var n=go;for(Ze=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}go=null,of=!1}catch(o){throw go!==null&&(go=go.slice(e+1)),Eb(xg,Ei),o}finally{Ze=t,Uh=!1}}return null}var Xs=[],Js=0,hd=null,pd=0,cr=[],ur=0,Xi=null,yo=1,vo="";function Ni(e,t){Xs[Js++]=pd,Xs[Js++]=hd,hd=e,pd=t}function eC(e,t,n){cr[ur++]=yo,cr[ur++]=vo,cr[ur++]=Xi,Xi=e;var r=yo;e=vo;var o=32-_r(r)-1;r&=~(1<<o),n+=1;var i=32-_r(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,yo=1<<32-_r(t)+o|n<<o|r,vo=i+e}else yo=1<<i|n<<o|r,vo=e}function kg(e){e.return!==null&&(Ni(e,1),eC(e,1,0))}function Rg(e){for(;e===hd;)hd=Xs[--Js],Xs[Js]=null,pd=Xs[--Js],Xs[Js]=null;for(;e===Xi;)Xi=cr[--ur],cr[ur]=null,vo=cr[--ur],cr[ur]=null,yo=cr[--ur],cr[ur]=null}var Yn=null,Qn=null,bt=!1,Dr=null;function tC(e,t){var n=dr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Ex(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Yn=e,Qn=ci(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Yn=e,Qn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Xi!==null?{id:yo,overflow:vo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=dr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Yn=e,Qn=null,!0):!1;default:return!1}}function Yp(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Xp(e){if(bt){var t=Qn;if(t){var n=t;if(!Ex(e,t)){if(Yp(e))throw Error(K(418));t=ci(n.nextSibling);var r=Yn;t&&Ex(e,t)?tC(r,n):(e.flags=e.flags&-4097|2,bt=!1,Yn=e)}}else{if(Yp(e))throw Error(K(418));e.flags=e.flags&-4097|2,bt=!1,Yn=e}}}function jx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Yn=e}function vu(e){if(e!==Yn)return!1;if(!bt)return jx(e),bt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!qp(e.type,e.memoizedProps)),t&&(t=Qn)){if(Yp(e))throw nC(),Error(K(418));for(;t;)tC(e,t),t=ci(t.nextSibling)}if(jx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(K(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Qn=ci(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Qn=null}}else Qn=Yn?ci(e.stateNode.nextSibling):null;return!0}function nC(){for(var e=Qn;e;)e=ci(e.nextSibling)}function va(){Qn=Yn=null,bt=!1}function Dg(e){Dr===null?Dr=[e]:Dr.push(e)}var l_=Oo.ReactCurrentBatchConfig;function Tr(e,t){if(e&&e.defaultProps){t=Tt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var md=Ci(null),gd=null,Zs=null,Ig=null;function _g(){Ig=Zs=gd=null}function Ag(e){var t=md.current;xt(md),e._currentValue=t}function Jp(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function fa(e,t){gd=e,Ig=Zs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Mn=!0),e.firstContext=null)}function pr(e){var t=e._currentValue;if(Ig!==e)if(e={context:e,memoizedValue:t,next:null},Zs===null){if(gd===null)throw Error(K(308));Zs=e,gd.dependencies={lanes:0,firstContext:e}}else Zs=Zs.next=e;return t}var Bi=null;function Ng(e){Bi===null?Bi=[e]:Bi.push(e)}function rC(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Ng(t)):(n.next=o.next,o.next=n),t.interleaved=n,Po(e,r)}function Po(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Yo=!1;function Og(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function oC(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function xo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ui(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Qe&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Po(e,n)}return o=r.interleaved,o===null?(t.next=t,Ng(r)):(t.next=o.next,o.next=t),r.interleaved=t,Po(e,n)}function zu(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wg(e,n)}}function Px(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function yd(e,t,n,r){var o=e.updateQueue;Yo=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var c=l,u=c.next;c.next=null,s===null?i=u:s.next=u,s=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==s&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=o.baseState;s=0,d=u=c=null,l=i;do{var h=l.lane,m=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,y=l;switch(h=t,m=n,y.tag){case 1:if(g=y.payload,typeof g=="function"){f=g.call(m,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=y.payload,h=typeof g=="function"?g.call(m,f,h):g,h==null)break e;f=Tt({},f,h);break e;case 2:Yo=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,s|=h;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;h=l,l=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(!0);if(d===null&&(c=f),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Zi|=s,e.lanes=s,e.memoizedState=f}}function Tx(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(K(191,o));o.call(r)}}}var iC=new rb.Component().refs;function Zp(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Tt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var sf={isMounted:function(e){return(e=e._reactInternals)?ms(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=En(),o=fi(e),i=xo(r,o);i.payload=t,n!=null&&(i.callback=n),t=ui(e,i,o),t!==null&&(Ar(t,e,o,r),zu(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=En(),o=fi(e),i=xo(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ui(e,i,o),t!==null&&(Ar(t,e,o,r),zu(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=En(),r=fi(e),o=xo(n,r);o.tag=2,t!=null&&(o.callback=t),t=ui(e,o,r),t!==null&&(Ar(t,e,r,n),zu(t,e,r))}};function kx(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Hl(n,r)||!Hl(o,i):!0}function sC(e,t,n){var r=!1,o=yi,i=t.contextType;return typeof i=="object"&&i!==null?i=pr(i):(o=$n(t)?Yi:yn.current,r=t.contextTypes,i=(r=r!=null)?ya(e,o):yi),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=sf,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Rx(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&sf.enqueueReplaceState(t,t.state,null)}function em(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=iC,Og(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=pr(i):(i=$n(t)?Yi:yn.current,o.context=ya(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Zp(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&sf.enqueueReplaceState(o,o.state,null),yd(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function al(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(K(309));var r=n.stateNode}if(!r)throw Error(K(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=o.refs;l===iC&&(l=o.refs={}),s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(K(284));if(!n._owner)throw Error(K(290,e))}return e}function xu(e,t){throw e=Object.prototype.toString.call(t),Error(K(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Dx(e){var t=e._init;return t(e._payload)}function aC(e){function t(v,x){if(e){var w=v.deletions;w===null?(v.deletions=[x],v.flags|=16):w.push(x)}}function n(v,x){if(!e)return null;for(;x!==null;)t(v,x),x=x.sibling;return null}function r(v,x){for(v=new Map;x!==null;)x.key!==null?v.set(x.key,x):v.set(x.index,x),x=x.sibling;return v}function o(v,x){return v=hi(v,x),v.index=0,v.sibling=null,v}function i(v,x,w){return v.index=w,e?(w=v.alternate,w!==null?(w=w.index,w<x?(v.flags|=2,x):w):(v.flags|=2,x)):(v.flags|=1048576,x)}function s(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,x,w,b){return x===null||x.tag!==6?(x=Kh(w,v.mode,b),x.return=v,x):(x=o(x,w),x.return=v,x)}function c(v,x,w,b){var j=w.type;return j===Hs?d(v,x,w.props.children,b,w.key):x!==null&&(x.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Ko&&Dx(j)===x.type)?(b=o(x,w.props),b.ref=al(v,x,w),b.return=v,b):(b=qu(w.type,w.key,w.props,null,v.mode,b),b.ref=al(v,x,w),b.return=v,b)}function u(v,x,w,b){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=Yh(w,v.mode,b),x.return=v,x):(x=o(x,w.children||[]),x.return=v,x)}function d(v,x,w,b,j){return x===null||x.tag!==7?(x=Qi(w,v.mode,b,j),x.return=v,x):(x=o(x,w),x.return=v,x)}function f(v,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Kh(""+x,v.mode,w),x.return=v,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case lu:return w=qu(x.type,x.key,x.props,null,v.mode,w),w.ref=al(v,null,x),w.return=v,w;case Ws:return x=Yh(x,v.mode,w),x.return=v,x;case Ko:var b=x._init;return f(v,b(x._payload),w)}if(Sl(x)||nl(x))return x=Qi(x,v.mode,w,null),x.return=v,x;xu(v,x)}return null}function h(v,x,w,b){var j=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return j!==null?null:l(v,x,""+w,b);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case lu:return w.key===j?c(v,x,w,b):null;case Ws:return w.key===j?u(v,x,w,b):null;case Ko:return j=w._init,h(v,x,j(w._payload),b)}if(Sl(w)||nl(w))return j!==null?null:d(v,x,w,b,null);xu(v,w)}return null}function m(v,x,w,b,j){if(typeof b=="string"&&b!==""||typeof b=="number")return v=v.get(w)||null,l(x,v,""+b,j);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case lu:return v=v.get(b.key===null?w:b.key)||null,c(x,v,b,j);case Ws:return v=v.get(b.key===null?w:b.key)||null,u(x,v,b,j);case Ko:var E=b._init;return m(v,x,w,E(b._payload),j)}if(Sl(b)||nl(b))return v=v.get(w)||null,d(x,v,b,j,null);xu(x,b)}return null}function g(v,x,w,b){for(var j=null,E=null,P=x,T=x=0,D=null;P!==null&&T<w.length;T++){P.index>T?(D=P,P=null):D=P.sibling;var _=h(v,P,w[T],b);if(_===null){P===null&&(P=D);break}e&&P&&_.alternate===null&&t(v,P),x=i(_,x,T),E===null?j=_:E.sibling=_,E=_,P=D}if(T===w.length)return n(v,P),bt&&Ni(v,T),j;if(P===null){for(;T<w.length;T++)P=f(v,w[T],b),P!==null&&(x=i(P,x,T),E===null?j=P:E.sibling=P,E=P);return bt&&Ni(v,T),j}for(P=r(v,P);T<w.length;T++)D=m(P,v,T,w[T],b),D!==null&&(e&&D.alternate!==null&&P.delete(D.key===null?T:D.key),x=i(D,x,T),E===null?j=D:E.sibling=D,E=D);return e&&P.forEach(function(O){return t(v,O)}),bt&&Ni(v,T),j}function y(v,x,w,b){var j=nl(w);if(typeof j!="function")throw Error(K(150));if(w=j.call(w),w==null)throw Error(K(151));for(var E=j=null,P=x,T=x=0,D=null,_=w.next();P!==null&&!_.done;T++,_=w.next()){P.index>T?(D=P,P=null):D=P.sibling;var O=h(v,P,_.value,b);if(O===null){P===null&&(P=D);break}e&&P&&O.alternate===null&&t(v,P),x=i(O,x,T),E===null?j=O:E.sibling=O,E=O,P=D}if(_.done)return n(v,P),bt&&Ni(v,T),j;if(P===null){for(;!_.done;T++,_=w.next())_=f(v,_.value,b),_!==null&&(x=i(_,x,T),E===null?j=_:E.sibling=_,E=_);return bt&&Ni(v,T),j}for(P=r(v,P);!_.done;T++,_=w.next())_=m(P,v,T,_.value,b),_!==null&&(e&&_.alternate!==null&&P.delete(_.key===null?T:_.key),x=i(_,x,T),E===null?j=_:E.sibling=_,E=_);return e&&P.forEach(function(I){return t(v,I)}),bt&&Ni(v,T),j}function S(v,x,w,b){if(typeof w=="object"&&w!==null&&w.type===Hs&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case lu:e:{for(var j=w.key,E=x;E!==null;){if(E.key===j){if(j=w.type,j===Hs){if(E.tag===7){n(v,E.sibling),x=o(E,w.props.children),x.return=v,v=x;break e}}else if(E.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Ko&&Dx(j)===E.type){n(v,E.sibling),x=o(E,w.props),x.ref=al(v,E,w),x.return=v,v=x;break e}n(v,E);break}else t(v,E);E=E.sibling}w.type===Hs?(x=Qi(w.props.children,v.mode,b,w.key),x.return=v,v=x):(b=qu(w.type,w.key,w.props,null,v.mode,b),b.ref=al(v,x,w),b.return=v,v=b)}return s(v);case Ws:e:{for(E=w.key;x!==null;){if(x.key===E)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){n(v,x.sibling),x=o(x,w.children||[]),x.return=v,v=x;break e}else{n(v,x);break}else t(v,x);x=x.sibling}x=Yh(w,v.mode,b),x.return=v,v=x}return s(v);case Ko:return E=w._init,S(v,x,E(w._payload),b)}if(Sl(w))return g(v,x,w,b);if(nl(w))return y(v,x,w,b);xu(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(v,x.sibling),x=o(x,w),x.return=v,v=x):(n(v,x),x=Kh(w,v.mode,b),x.return=v,v=x),s(v)):n(v,x)}return S}var xa=aC(!0),lC=aC(!1),Sc={},ro=Ci(Sc),Kl=Ci(Sc),Yl=Ci(Sc);function Ui(e){if(e===Sc)throw Error(K(174));return e}function Mg(e,t){switch(dt(Yl,t),dt(Kl,e),dt(ro,Sc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:_p(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=_p(t,e)}xt(ro),dt(ro,t)}function wa(){xt(ro),xt(Kl),xt(Yl)}function cC(e){Ui(Yl.current);var t=Ui(ro.current),n=_p(t,e.type);t!==n&&(dt(Kl,e),dt(ro,n))}function Lg(e){Kl.current===e&&(xt(ro),xt(Kl))}var Et=Ci(0);function vd(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vh=[];function $g(){for(var e=0;e<Vh.length;e++)Vh[e]._workInProgressVersionPrimary=null;Vh.length=0}var Bu=Oo.ReactCurrentDispatcher,Wh=Oo.ReactCurrentBatchConfig,Ji=0,Pt=null,Wt=null,Qt=null,xd=!1,Il=!1,Xl=0,c_=0;function un(){throw Error(K(321))}function Fg(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Or(e[n],t[n]))return!1;return!0}function zg(e,t,n,r,o,i){if(Ji=i,Pt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Bu.current=e===null||e.memoizedState===null?h_:p_,e=n(r,o),Il){i=0;do{if(Il=!1,Xl=0,25<=i)throw Error(K(301));i+=1,Qt=Wt=null,t.updateQueue=null,Bu.current=m_,e=n(r,o)}while(Il)}if(Bu.current=wd,t=Wt!==null&&Wt.next!==null,Ji=0,Qt=Wt=Pt=null,xd=!1,t)throw Error(K(300));return e}function Bg(){var e=Xl!==0;return Xl=0,e}function Jr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qt===null?Pt.memoizedState=Qt=e:Qt=Qt.next=e,Qt}function mr(){if(Wt===null){var e=Pt.alternate;e=e!==null?e.memoizedState:null}else e=Wt.next;var t=Qt===null?Pt.memoizedState:Qt.next;if(t!==null)Qt=t,Wt=e;else{if(e===null)throw Error(K(310));Wt=e,e={memoizedState:Wt.memoizedState,baseState:Wt.baseState,baseQueue:Wt.baseQueue,queue:Wt.queue,next:null},Qt===null?Pt.memoizedState=Qt=e:Qt=Qt.next=e}return Qt}function Jl(e,t){return typeof t=="function"?t(e):t}function Hh(e){var t=mr(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=Wt,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,c=null,u=i;do{var d=u.lane;if((Ji&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,s=r):c=c.next=f,Pt.lanes|=d,Zi|=d}u=u.next}while(u!==null&&u!==i);c===null?s=r:c.next=l,Or(r,t.memoizedState)||(Mn=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,Pt.lanes|=i,Zi|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function qh(e){var t=mr(),n=t.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);Or(i,t.memoizedState)||(Mn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function uC(){}function dC(e,t){var n=Pt,r=mr(),o=t(),i=!Or(r.memoizedState,o);if(i&&(r.memoizedState=o,Mn=!0),r=r.queue,Ug(pC.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Qt!==null&&Qt.memoizedState.tag&1){if(n.flags|=2048,Zl(9,hC.bind(null,n,r,o,t),void 0,null),Yt===null)throw Error(K(349));Ji&30||fC(n,t,o)}return o}function fC(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Pt.updateQueue,t===null?(t={lastEffect:null,stores:null},Pt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function hC(e,t,n,r){t.value=n,t.getSnapshot=r,mC(t)&&gC(e)}function pC(e,t,n){return n(function(){mC(t)&&gC(e)})}function mC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Or(e,n)}catch{return!0}}function gC(e){var t=Po(e,1);t!==null&&Ar(t,e,1,-1)}function Ix(e){var t=Jr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Jl,lastRenderedState:e},t.queue=e,e=e.dispatch=f_.bind(null,Pt,e),[t.memoizedState,e]}function Zl(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Pt.updateQueue,t===null?(t={lastEffect:null,stores:null},Pt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function yC(){return mr().memoizedState}function Uu(e,t,n,r){var o=Jr();Pt.flags|=e,o.memoizedState=Zl(1|t,n,void 0,r===void 0?null:r)}function af(e,t,n,r){var o=mr();r=r===void 0?null:r;var i=void 0;if(Wt!==null){var s=Wt.memoizedState;if(i=s.destroy,r!==null&&Fg(r,s.deps)){o.memoizedState=Zl(t,n,i,r);return}}Pt.flags|=e,o.memoizedState=Zl(1|t,n,i,r)}function _x(e,t){return Uu(8390656,8,e,t)}function Ug(e,t){return af(2048,8,e,t)}function vC(e,t){return af(4,2,e,t)}function xC(e,t){return af(4,4,e,t)}function wC(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function SC(e,t,n){return n=n!=null?n.concat([e]):null,af(4,4,wC.bind(null,t,e),n)}function Vg(){}function bC(e,t){var n=mr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Fg(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function CC(e,t){var n=mr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Fg(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function EC(e,t,n){return Ji&21?(Or(n,t)||(n=Tb(),Pt.lanes|=n,Zi|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Mn=!0),e.memoizedState=n)}function u_(e,t){var n=Ze;Ze=n!==0&&4>n?n:4,e(!0);var r=Wh.transition;Wh.transition={};try{e(!1),t()}finally{Ze=n,Wh.transition=r}}function jC(){return mr().memoizedState}function d_(e,t,n){var r=fi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},PC(e))TC(t,n);else if(n=rC(e,t,n,r),n!==null){var o=En();Ar(n,e,r,o),kC(n,t,r)}}function f_(e,t,n){var r=fi(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(PC(e))TC(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,Or(l,s)){var c=t.interleaved;c===null?(o.next=o,Ng(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=rC(e,t,o,r),n!==null&&(o=En(),Ar(n,e,r,o),kC(n,t,r))}}function PC(e){var t=e.alternate;return e===Pt||t!==null&&t===Pt}function TC(e,t){Il=xd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function kC(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wg(e,n)}}var wd={readContext:pr,useCallback:un,useContext:un,useEffect:un,useImperativeHandle:un,useInsertionEffect:un,useLayoutEffect:un,useMemo:un,useReducer:un,useRef:un,useState:un,useDebugValue:un,useDeferredValue:un,useTransition:un,useMutableSource:un,useSyncExternalStore:un,useId:un,unstable_isNewReconciler:!1},h_={readContext:pr,useCallback:function(e,t){return Jr().memoizedState=[e,t===void 0?null:t],e},useContext:pr,useEffect:_x,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Uu(4194308,4,wC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Uu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Uu(4,2,e,t)},useMemo:function(e,t){var n=Jr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Jr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=d_.bind(null,Pt,e),[r.memoizedState,e]},useRef:function(e){var t=Jr();return e={current:e},t.memoizedState=e},useState:Ix,useDebugValue:Vg,useDeferredValue:function(e){return Jr().memoizedState=e},useTransition:function(){var e=Ix(!1),t=e[0];return e=u_.bind(null,e[1]),Jr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Pt,o=Jr();if(bt){if(n===void 0)throw Error(K(407));n=n()}else{if(n=t(),Yt===null)throw Error(K(349));Ji&30||fC(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,_x(pC.bind(null,r,i,e),[e]),r.flags|=2048,Zl(9,hC.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Jr(),t=Yt.identifierPrefix;if(bt){var n=vo,r=yo;n=(r&~(1<<32-_r(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Xl++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=c_++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},p_={readContext:pr,useCallback:bC,useContext:pr,useEffect:Ug,useImperativeHandle:SC,useInsertionEffect:vC,useLayoutEffect:xC,useMemo:CC,useReducer:Hh,useRef:yC,useState:function(){return Hh(Jl)},useDebugValue:Vg,useDeferredValue:function(e){var t=mr();return EC(t,Wt.memoizedState,e)},useTransition:function(){var e=Hh(Jl)[0],t=mr().memoizedState;return[e,t]},useMutableSource:uC,useSyncExternalStore:dC,useId:jC,unstable_isNewReconciler:!1},m_={readContext:pr,useCallback:bC,useContext:pr,useEffect:Ug,useImperativeHandle:SC,useInsertionEffect:vC,useLayoutEffect:xC,useMemo:CC,useReducer:qh,useRef:yC,useState:function(){return qh(Jl)},useDebugValue:Vg,useDeferredValue:function(e){var t=mr();return Wt===null?t.memoizedState=e:EC(t,Wt.memoizedState,e)},useTransition:function(){var e=qh(Jl)[0],t=mr().memoizedState;return[e,t]},useMutableSource:uC,useSyncExternalStore:dC,useId:jC,unstable_isNewReconciler:!1};function Sa(e,t){try{var n="",r=t;do n+=VD(r),r=r.return;while(r);var o=n}catch(i){o=`
82
+ Error generating stack: `+i.message+`
83
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function Gh(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function tm(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var g_=typeof WeakMap=="function"?WeakMap:Map;function RC(e,t,n){n=xo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){bd||(bd=!0,dm=r),tm(e,t)},n}function DC(e,t,n){n=xo(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){tm(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){tm(e,t),typeof r!="function"&&(di===null?di=new Set([this]):di.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Ax(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new g_;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=D_.bind(null,e,t,n),t.then(e,e))}function Nx(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ox(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=xo(-1,1),t.tag=2,ui(n,t,1))),n.lanes|=1),e)}var y_=Oo.ReactCurrentOwner,Mn=!1;function wn(e,t,n,r){t.child=e===null?lC(t,null,n,r):xa(t,e.child,n,r)}function Mx(e,t,n,r,o){n=n.render;var i=t.ref;return fa(t,o),r=zg(e,t,n,r,i,o),n=Bg(),e!==null&&!Mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,To(e,t,o)):(bt&&n&&kg(t),t.flags|=1,wn(e,t,r,o),t.child)}function Lx(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Xg(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,IC(e,t,i,r,o)):(e=qu(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Hl,n(s,r)&&e.ref===t.ref)return To(e,t,o)}return t.flags|=1,e=hi(i,r),e.ref=t.ref,e.return=t,t.child=e}function IC(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Hl(i,r)&&e.ref===t.ref)if(Mn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Mn=!0);else return t.lanes=e.lanes,To(e,t,o)}return nm(e,t,n,r,o)}function _C(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},dt(ta,qn),qn|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,dt(ta,qn),qn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,dt(ta,qn),qn|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,dt(ta,qn),qn|=r;return wn(e,t,o,n),t.child}function AC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function nm(e,t,n,r,o){var i=$n(n)?Yi:yn.current;return i=ya(t,i),fa(t,o),n=zg(e,t,n,r,i,o),r=Bg(),e!==null&&!Mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,To(e,t,o)):(bt&&r&&kg(t),t.flags|=1,wn(e,t,n,o),t.child)}function $x(e,t,n,r,o){if($n(n)){var i=!0;fd(t)}else i=!1;if(fa(t,o),t.stateNode===null)Vu(e,t),sC(t,n,r),em(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var c=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=pr(u):(u=$n(n)?Yi:yn.current,u=ya(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||c!==u)&&Rx(t,s,r,u),Yo=!1;var h=t.memoizedState;s.state=h,yd(t,r,s,o),c=t.memoizedState,l!==r||h!==c||Ln.current||Yo?(typeof d=="function"&&(Zp(t,n,d,r),c=t.memoizedState),(l=Yo||kx(t,n,l,r,h,c,u))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),s.props=r,s.state=c,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,oC(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Tr(t.type,l),s.props=u,f=t.pendingProps,h=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=pr(c):(c=$n(n)?Yi:yn.current,c=ya(t,c));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==f||h!==c)&&Rx(t,s,r,c),Yo=!1,h=t.memoizedState,s.state=h,yd(t,r,s,o);var g=t.memoizedState;l!==f||h!==g||Ln.current||Yo?(typeof m=="function"&&(Zp(t,n,m,r),g=t.memoizedState),(u=Yo||kx(t,n,u,r,h,g,c)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,g,c),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,g,c)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),s.props=r,s.state=g,s.context=c,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return rm(e,t,n,r,i,o)}function rm(e,t,n,r,o,i){AC(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Cx(t,n,!1),To(e,t,i);r=t.stateNode,y_.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=xa(t,e.child,null,i),t.child=xa(t,null,l,i)):wn(e,t,l,i),t.memoizedState=r.state,o&&Cx(t,n,!0),t.child}function NC(e){var t=e.stateNode;t.pendingContext?bx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&bx(e,t.context,!1),Mg(e,t.containerInfo)}function Fx(e,t,n,r,o){return va(),Dg(o),t.flags|=256,wn(e,t,n,r),t.child}var om={dehydrated:null,treeContext:null,retryLane:0};function im(e){return{baseLanes:e,cachePool:null,transitions:null}}function OC(e,t,n){var r=t.pendingProps,o=Et.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),dt(Et,o&1),e===null)return Xp(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=uf(s,r,0,null),e=Qi(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=im(n),t.memoizedState=om,e):Wg(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return v_(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var c={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=hi(o,c),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=hi(l,i):(i=Qi(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?im(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=om,r}return i=e.child,e=i.sibling,r=hi(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Wg(e,t){return t=uf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function wu(e,t,n,r){return r!==null&&Dg(r),xa(t,e.child,null,n),e=Wg(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function v_(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=Gh(Error(K(422))),wu(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=uf({mode:"visible",children:r.children},o,0,null),i=Qi(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&xa(t,e.child,null,s),t.child.memoizedState=im(s),t.memoizedState=om,i);if(!(t.mode&1))return wu(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(K(419)),r=Gh(i,r,void 0),wu(e,t,s,r)}if(l=(s&e.childLanes)!==0,Mn||l){if(r=Yt,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Po(e,o),Ar(r,e,o,-1))}return Yg(),r=Gh(Error(K(421))),wu(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=I_.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Qn=ci(o.nextSibling),Yn=t,bt=!0,Dr=null,e!==null&&(cr[ur++]=yo,cr[ur++]=vo,cr[ur++]=Xi,yo=e.id,vo=e.overflow,Xi=t),t=Wg(t,r.children),t.flags|=4096,t)}function zx(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Jp(e.return,t,n)}function Qh(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function MC(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(wn(e,t,r.children,n),r=Et.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&zx(e,n,t);else if(e.tag===19)zx(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(dt(Et,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&vd(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Qh(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&vd(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Qh(t,!0,n,null,i);break;case"together":Qh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Vu(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function To(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Zi|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,n=hi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=hi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function x_(e,t,n){switch(t.tag){case 3:NC(t),va();break;case 5:cC(t);break;case 1:$n(t.type)&&fd(t);break;case 4:Mg(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;dt(md,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(dt(Et,Et.current&1),t.flags|=128,null):n&t.child.childLanes?OC(e,t,n):(dt(Et,Et.current&1),e=To(e,t,n),e!==null?e.sibling:null);dt(Et,Et.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return MC(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),dt(Et,Et.current),r)break;return null;case 22:case 23:return t.lanes=0,_C(e,t,n)}return To(e,t,n)}var LC,sm,$C,FC;LC=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};sm=function(){};$C=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Ui(ro.current);var i=null;switch(n){case"input":o=kp(e,o),r=kp(e,r),i=[];break;case"select":o=Tt({},o,{value:void 0}),r=Tt({},r,{value:void 0}),i=[];break;case"textarea":o=Ip(e,o),r=Ip(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ud)}Ap(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&($l.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(l=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||c&&c.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in c)c.hasOwnProperty(s)&&l[s]!==c[s]&&(n||(n={}),n[s]=c[s])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&($l.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&yt("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};FC=function(e,t,n,r){n!==r&&(t.flags|=4)};function ll(e,t){if(!bt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function dn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function w_(e,t,n){var r=t.pendingProps;switch(Rg(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dn(t),null;case 1:return $n(t.type)&&dd(),dn(t),null;case 3:return r=t.stateNode,wa(),xt(Ln),xt(yn),$g(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(vu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Dr!==null&&(pm(Dr),Dr=null))),sm(e,t),dn(t),null;case 5:Lg(t);var o=Ui(Yl.current);if(n=t.type,e!==null&&t.stateNode!=null)$C(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(K(166));return dn(t),null}if(e=Ui(ro.current),vu(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[to]=t,r[Ql]=i,e=(t.mode&1)!==0,n){case"dialog":yt("cancel",r),yt("close",r);break;case"iframe":case"object":case"embed":yt("load",r);break;case"video":case"audio":for(o=0;o<Cl.length;o++)yt(Cl[o],r);break;case"source":yt("error",r);break;case"img":case"image":case"link":yt("error",r),yt("load",r);break;case"details":yt("toggle",r);break;case"input":K0(r,i),yt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},yt("invalid",r);break;case"textarea":X0(r,i),yt("invalid",r)}Ap(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&yu(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&yu(r.textContent,l,e),o=["children",""+l]):$l.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&yt("scroll",r)}switch(n){case"input":cu(r),Y0(r,i,!0);break;case"textarea":cu(r),J0(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=ud)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=fb(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[to]=t,e[Ql]=r,LC(e,t,!1,!1),t.stateNode=e;e:{switch(s=Np(n,r),n){case"dialog":yt("cancel",e),yt("close",e),o=r;break;case"iframe":case"object":case"embed":yt("load",e),o=r;break;case"video":case"audio":for(o=0;o<Cl.length;o++)yt(Cl[o],e);o=r;break;case"source":yt("error",e),o=r;break;case"img":case"image":case"link":yt("error",e),yt("load",e),o=r;break;case"details":yt("toggle",e),o=r;break;case"input":K0(e,r),o=kp(e,r),yt("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Tt({},r,{value:void 0}),yt("invalid",e);break;case"textarea":X0(e,r),o=Ip(e,r),yt("invalid",e);break;default:o=r}Ap(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?mb(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&hb(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Fl(e,c):typeof c=="number"&&Fl(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&($l.hasOwnProperty(i)?c!=null&&i==="onScroll"&&yt("scroll",e):c!=null&&pg(e,i,c,s))}switch(n){case"input":cu(e),Y0(e,r,!1);break;case"textarea":cu(e),J0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+gi(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?la(e,!!r.multiple,i,!1):r.defaultValue!=null&&la(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=ud)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return dn(t),null;case 6:if(e&&t.stateNode!=null)FC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(K(166));if(n=Ui(Yl.current),Ui(ro.current),vu(t)){if(r=t.stateNode,n=t.memoizedProps,r[to]=t,(i=r.nodeValue!==n)&&(e=Yn,e!==null))switch(e.tag){case 3:yu(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&yu(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[to]=t,t.stateNode=r}return dn(t),null;case 13:if(xt(Et),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(bt&&Qn!==null&&t.mode&1&&!(t.flags&128))nC(),va(),t.flags|=98560,i=!1;else if(i=vu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(K(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(K(317));i[to]=t}else va(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dn(t),i=!1}else Dr!==null&&(pm(Dr),Dr=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Et.current&1?Ht===0&&(Ht=3):Yg())),t.updateQueue!==null&&(t.flags|=4),dn(t),null);case 4:return wa(),sm(e,t),e===null&&ql(t.stateNode.containerInfo),dn(t),null;case 10:return Ag(t.type._context),dn(t),null;case 17:return $n(t.type)&&dd(),dn(t),null;case 19:if(xt(Et),i=t.memoizedState,i===null)return dn(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)ll(i,!1);else{if(Ht!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=vd(e),s!==null){for(t.flags|=128,ll(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return dt(Et,Et.current&1|2),t.child}e=e.sibling}i.tail!==null&&Bt()>ba&&(t.flags|=128,r=!0,ll(i,!1),t.lanes=4194304)}else{if(!r)if(e=vd(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ll(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!bt)return dn(t),null}else 2*Bt()-i.renderingStartTime>ba&&n!==1073741824&&(t.flags|=128,r=!0,ll(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Bt(),t.sibling=null,n=Et.current,dt(Et,r?n&1|2:n&1),t):(dn(t),null);case 22:case 23:return Kg(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?qn&1073741824&&(dn(t),t.subtreeFlags&6&&(t.flags|=8192)):dn(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function S_(e,t){switch(Rg(t),t.tag){case 1:return $n(t.type)&&dd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return wa(),xt(Ln),xt(yn),$g(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Lg(t),null;case 13:if(xt(Et),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));va()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xt(Et),null;case 4:return wa(),null;case 10:return Ag(t.type._context),null;case 22:case 23:return Kg(),null;case 24:return null;default:return null}}var Su=!1,hn=!1,b_=typeof WeakSet=="function"?WeakSet:Set,ce=null;function ea(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){_t(e,t,r)}else n.current=null}function am(e,t,n){try{n()}catch(r){_t(e,t,r)}}var Bx=!1;function C_(e,t){if(Wp=ad,e=Vb(),Tg(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||o!==0&&f.nodeType!==3||(l=s+o),f!==i||r!==0&&f.nodeType!==3||(c=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===o&&(l=s),h===i&&++d===r&&(c=s),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Hp={focusedElem:e,selectionRange:n},ad=!1,ce=t;ce!==null;)if(t=ce,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ce=e;else for(;ce!==null;){t=ce;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,S=g.memoizedState,v=t.stateNode,x=v.getSnapshotBeforeUpdate(t.elementType===t.type?y:Tr(t.type,y),S);v.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(b){_t(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,ce=e;break}ce=t.return}return g=Bx,Bx=!1,g}function _l(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&am(t,n,i)}o=o.next}while(o!==r)}}function lf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function lm(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function zC(e){var t=e.alternate;t!==null&&(e.alternate=null,zC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[to],delete t[Ql],delete t[Qp],delete t[i_],delete t[s_])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function BC(e){return e.tag===5||e.tag===3||e.tag===4}function Ux(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||BC(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cm(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ud));else if(r!==4&&(e=e.child,e!==null))for(cm(e,t,n),e=e.sibling;e!==null;)cm(e,t,n),e=e.sibling}function um(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(um(e,t,n),e=e.sibling;e!==null;)um(e,t,n),e=e.sibling}var tn=null,kr=!1;function Go(e,t,n){for(n=n.child;n!==null;)UC(e,t,n),n=n.sibling}function UC(e,t,n){if(no&&typeof no.onCommitFiberUnmount=="function")try{no.onCommitFiberUnmount(Zd,n)}catch{}switch(n.tag){case 5:hn||ea(n,t);case 6:var r=tn,o=kr;tn=null,Go(e,t,n),tn=r,kr=o,tn!==null&&(kr?(e=tn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):tn.removeChild(n.stateNode));break;case 18:tn!==null&&(kr?(e=tn,n=n.stateNode,e.nodeType===8?Bh(e.parentNode,n):e.nodeType===1&&Bh(e,n),Vl(e)):Bh(tn,n.stateNode));break;case 4:r=tn,o=kr,tn=n.stateNode.containerInfo,kr=!0,Go(e,t,n),tn=r,kr=o;break;case 0:case 11:case 14:case 15:if(!hn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&am(n,t,s),o=o.next}while(o!==r)}Go(e,t,n);break;case 1:if(!hn&&(ea(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){_t(n,t,l)}Go(e,t,n);break;case 21:Go(e,t,n);break;case 22:n.mode&1?(hn=(r=hn)||n.memoizedState!==null,Go(e,t,n),hn=r):Go(e,t,n);break;default:Go(e,t,n)}}function Vx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new b_),t.forEach(function(r){var o=__.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Er(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:tn=l.stateNode,kr=!1;break e;case 3:tn=l.stateNode.containerInfo,kr=!0;break e;case 4:tn=l.stateNode.containerInfo,kr=!0;break e}l=l.return}if(tn===null)throw Error(K(160));UC(i,s,o),tn=null,kr=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(u){_t(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)VC(t,e),t=t.sibling}function VC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Er(t,e),Kr(e),r&4){try{_l(3,e,e.return),lf(3,e)}catch(y){_t(e,e.return,y)}try{_l(5,e,e.return)}catch(y){_t(e,e.return,y)}}break;case 1:Er(t,e),Kr(e),r&512&&n!==null&&ea(n,n.return);break;case 5:if(Er(t,e),Kr(e),r&512&&n!==null&&ea(n,n.return),e.flags&32){var o=e.stateNode;try{Fl(o,"")}catch(y){_t(e,e.return,y)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&ub(o,i),Np(l,s);var u=Np(l,i);for(s=0;s<c.length;s+=2){var d=c[s],f=c[s+1];d==="style"?mb(o,f):d==="dangerouslySetInnerHTML"?hb(o,f):d==="children"?Fl(o,f):pg(o,d,f,u)}switch(l){case"input":Rp(o,i);break;case"textarea":db(o,i);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?la(o,!!i.multiple,m,!1):h!==!!i.multiple&&(i.defaultValue!=null?la(o,!!i.multiple,i.defaultValue,!0):la(o,!!i.multiple,i.multiple?[]:"",!1))}o[Ql]=i}catch(y){_t(e,e.return,y)}}break;case 6:if(Er(t,e),Kr(e),r&4){if(e.stateNode===null)throw Error(K(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(y){_t(e,e.return,y)}}break;case 3:if(Er(t,e),Kr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Vl(t.containerInfo)}catch(y){_t(e,e.return,y)}break;case 4:Er(t,e),Kr(e);break;case 13:Er(t,e),Kr(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Gg=Bt())),r&4&&Vx(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(hn=(u=hn)||d,Er(t,e),hn=u):Er(t,e),Kr(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ce=e,d=e.child;d!==null;){for(f=ce=d;ce!==null;){switch(h=ce,m=h.child,h.tag){case 0:case 11:case 14:case 15:_l(4,h,h.return);break;case 1:ea(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(y){_t(r,n,y)}}break;case 5:ea(h,h.return);break;case 22:if(h.memoizedState!==null){Hx(f);continue}}m!==null?(m.return=h,ce=m):Hx(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{o=f.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,c=f.memoizedProps.style,s=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=pb("display",s))}catch(y){_t(e,e.return,y)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(y){_t(e,e.return,y)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Er(t,e),Kr(e),r&4&&Vx(e);break;case 21:break;default:Er(t,e),Kr(e)}}function Kr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(BC(n)){var r=n;break e}n=n.return}throw Error(K(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Fl(o,""),r.flags&=-33);var i=Ux(e);um(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=Ux(e);cm(e,l,s);break;default:throw Error(K(161))}}catch(c){_t(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function E_(e,t,n){ce=e,WC(e)}function WC(e,t,n){for(var r=(e.mode&1)!==0;ce!==null;){var o=ce,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Su;if(!s){var l=o.alternate,c=l!==null&&l.memoizedState!==null||hn;l=Su;var u=hn;if(Su=s,(hn=c)&&!u)for(ce=o;ce!==null;)s=ce,c=s.child,s.tag===22&&s.memoizedState!==null?qx(o):c!==null?(c.return=s,ce=c):qx(o);for(;i!==null;)ce=i,WC(i),i=i.sibling;ce=o,Su=l,hn=u}Wx(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,ce=i):Wx(e)}}function Wx(e){for(;ce!==null;){var t=ce;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:hn||lf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!hn)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Tr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Tx(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Tx(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&Vl(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}hn||t.flags&512&&lm(t)}catch(h){_t(t,t.return,h)}}if(t===e){ce=null;break}if(n=t.sibling,n!==null){n.return=t.return,ce=n;break}ce=t.return}}function Hx(e){for(;ce!==null;){var t=ce;if(t===e){ce=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ce=n;break}ce=t.return}}function qx(e){for(;ce!==null;){var t=ce;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{lf(4,t)}catch(c){_t(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(c){_t(t,o,c)}}var i=t.return;try{lm(t)}catch(c){_t(t,i,c)}break;case 5:var s=t.return;try{lm(t)}catch(c){_t(t,s,c)}}}catch(c){_t(t,t.return,c)}if(t===e){ce=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ce=l;break}ce=t.return}}var j_=Math.ceil,Sd=Oo.ReactCurrentDispatcher,Hg=Oo.ReactCurrentOwner,fr=Oo.ReactCurrentBatchConfig,Qe=0,Yt=null,Ut=null,sn=0,qn=0,ta=Ci(0),Ht=0,ec=null,Zi=0,cf=0,qg=0,Al=null,On=null,Gg=0,ba=1/0,mo=null,bd=!1,dm=null,di=null,bu=!1,oi=null,Cd=0,Nl=0,fm=null,Wu=-1,Hu=0;function En(){return Qe&6?Bt():Wu!==-1?Wu:Wu=Bt()}function fi(e){return e.mode&1?Qe&2&&sn!==0?sn&-sn:l_.transition!==null?(Hu===0&&(Hu=Tb()),Hu):(e=Ze,e!==0||(e=window.event,e=e===void 0?16:Nb(e.type)),e):1}function Ar(e,t,n,r){if(50<Nl)throw Nl=0,fm=null,Error(K(185));vc(e,n,r),(!(Qe&2)||e!==Yt)&&(e===Yt&&(!(Qe&2)&&(cf|=n),Ht===4&&ti(e,sn)),Fn(e,r),n===1&&Qe===0&&!(t.mode&1)&&(ba=Bt()+500,of&&Ei()))}function Fn(e,t){var n=e.callbackNode;lI(e,t);var r=sd(e,e===Yt?sn:0);if(r===0)n!==null&&tx(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&tx(n),t===1)e.tag===0?a_(Gx.bind(null,e)):Zb(Gx.bind(null,e)),r_(function(){!(Qe&6)&&Ei()}),n=null;else{switch(kb(r)){case 1:n=xg;break;case 4:n=jb;break;case 16:n=id;break;case 536870912:n=Pb;break;default:n=id}n=JC(n,HC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function HC(e,t){if(Wu=-1,Hu=0,Qe&6)throw Error(K(327));var n=e.callbackNode;if(ha()&&e.callbackNode!==n)return null;var r=sd(e,e===Yt?sn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Ed(e,r);else{t=r;var o=Qe;Qe|=2;var i=GC();(Yt!==e||sn!==t)&&(mo=null,ba=Bt()+500,Gi(e,t));do try{k_();break}catch(l){qC(e,l)}while(!0);_g(),Sd.current=i,Qe=o,Ut!==null?t=0:(Yt=null,sn=0,t=Ht)}if(t!==0){if(t===2&&(o=Fp(e),o!==0&&(r=o,t=hm(e,o))),t===1)throw n=ec,Gi(e,0),ti(e,r),Fn(e,Bt()),n;if(t===6)ti(e,r);else{if(o=e.current.alternate,!(r&30)&&!P_(o)&&(t=Ed(e,r),t===2&&(i=Fp(e),i!==0&&(r=i,t=hm(e,i))),t===1))throw n=ec,Gi(e,0),ti(e,r),Fn(e,Bt()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(K(345));case 2:Oi(e,On,mo);break;case 3:if(ti(e,r),(r&130023424)===r&&(t=Gg+500-Bt(),10<t)){if(sd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){En(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Gp(Oi.bind(null,e,On,mo),t);break}Oi(e,On,mo);break;case 4:if(ti(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-_r(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Bt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*j_(r/1960))-r,10<r){e.timeoutHandle=Gp(Oi.bind(null,e,On,mo),r);break}Oi(e,On,mo);break;case 5:Oi(e,On,mo);break;default:throw Error(K(329))}}}return Fn(e,Bt()),e.callbackNode===n?HC.bind(null,e):null}function hm(e,t){var n=Al;return e.current.memoizedState.isDehydrated&&(Gi(e,t).flags|=256),e=Ed(e,t),e!==2&&(t=On,On=n,t!==null&&pm(t)),e}function pm(e){On===null?On=e:On.push.apply(On,e)}function P_(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!Or(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ti(e,t){for(t&=~qg,t&=~cf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-_r(t),r=1<<n;e[n]=-1,t&=~r}}function Gx(e){if(Qe&6)throw Error(K(327));ha();var t=sd(e,0);if(!(t&1))return Fn(e,Bt()),null;var n=Ed(e,t);if(e.tag!==0&&n===2){var r=Fp(e);r!==0&&(t=r,n=hm(e,r))}if(n===1)throw n=ec,Gi(e,0),ti(e,t),Fn(e,Bt()),n;if(n===6)throw Error(K(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Oi(e,On,mo),Fn(e,Bt()),null}function Qg(e,t){var n=Qe;Qe|=1;try{return e(t)}finally{Qe=n,Qe===0&&(ba=Bt()+500,of&&Ei())}}function es(e){oi!==null&&oi.tag===0&&!(Qe&6)&&ha();var t=Qe;Qe|=1;var n=fr.transition,r=Ze;try{if(fr.transition=null,Ze=1,e)return e()}finally{Ze=r,fr.transition=n,Qe=t,!(Qe&6)&&Ei()}}function Kg(){qn=ta.current,xt(ta)}function Gi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,n_(n)),Ut!==null)for(n=Ut.return;n!==null;){var r=n;switch(Rg(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&dd();break;case 3:wa(),xt(Ln),xt(yn),$g();break;case 5:Lg(r);break;case 4:wa();break;case 13:xt(Et);break;case 19:xt(Et);break;case 10:Ag(r.type._context);break;case 22:case 23:Kg()}n=n.return}if(Yt=e,Ut=e=hi(e.current,null),sn=qn=t,Ht=0,ec=null,qg=cf=Zi=0,On=Al=null,Bi!==null){for(t=0;t<Bi.length;t++)if(n=Bi[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}Bi=null}return e}function qC(e,t){do{var n=Ut;try{if(_g(),Bu.current=wd,xd){for(var r=Pt.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}xd=!1}if(Ji=0,Qt=Wt=Pt=null,Il=!1,Xl=0,Hg.current=null,n===null||n.return===null){Ht=1,ec=t,Ut=null;break}e:{var i=e,s=n.return,l=n,c=t;if(t=sn,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Nx(s);if(m!==null){m.flags&=-257,Ox(m,s,l,i,t),m.mode&1&&Ax(i,u,t),t=m,c=u;var g=t.updateQueue;if(g===null){var y=new Set;y.add(c),t.updateQueue=y}else g.add(c);break e}else{if(!(t&1)){Ax(i,u,t),Yg();break e}c=Error(K(426))}}else if(bt&&l.mode&1){var S=Nx(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),Ox(S,s,l,i,t),Dg(Sa(c,l));break e}}i=c=Sa(c,l),Ht!==4&&(Ht=2),Al===null?Al=[i]:Al.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var v=RC(i,c,t);Px(i,v);break e;case 1:l=c;var x=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(di===null||!di.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=DC(i,l,t);Px(i,b);break e}}i=i.return}while(i!==null)}KC(n)}catch(j){t=j,Ut===n&&n!==null&&(Ut=n=n.return);continue}break}while(!0)}function GC(){var e=Sd.current;return Sd.current=wd,e===null?wd:e}function Yg(){(Ht===0||Ht===3||Ht===2)&&(Ht=4),Yt===null||!(Zi&268435455)&&!(cf&268435455)||ti(Yt,sn)}function Ed(e,t){var n=Qe;Qe|=2;var r=GC();(Yt!==e||sn!==t)&&(mo=null,Gi(e,t));do try{T_();break}catch(o){qC(e,o)}while(!0);if(_g(),Qe=n,Sd.current=r,Ut!==null)throw Error(K(261));return Yt=null,sn=0,Ht}function T_(){for(;Ut!==null;)QC(Ut)}function k_(){for(;Ut!==null&&!ZD();)QC(Ut)}function QC(e){var t=XC(e.alternate,e,qn);e.memoizedProps=e.pendingProps,t===null?KC(e):Ut=t,Hg.current=null}function KC(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=S_(n,t),n!==null){n.flags&=32767,Ut=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ht=6,Ut=null;return}}else if(n=w_(n,t,qn),n!==null){Ut=n;return}if(t=t.sibling,t!==null){Ut=t;return}Ut=t=e}while(t!==null);Ht===0&&(Ht=5)}function Oi(e,t,n){var r=Ze,o=fr.transition;try{fr.transition=null,Ze=1,R_(e,t,n,r)}finally{fr.transition=o,Ze=r}return null}function R_(e,t,n,r){do ha();while(oi!==null);if(Qe&6)throw Error(K(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(K(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(cI(e,i),e===Yt&&(Ut=Yt=null,sn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||bu||(bu=!0,JC(id,function(){return ha(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=fr.transition,fr.transition=null;var s=Ze;Ze=1;var l=Qe;Qe|=4,Hg.current=null,C_(e,n),VC(n,e),KI(Hp),ad=!!Wp,Hp=Wp=null,e.current=n,E_(n),eI(),Qe=l,Ze=s,fr.transition=i}else e.current=n;if(bu&&(bu=!1,oi=e,Cd=o),i=e.pendingLanes,i===0&&(di=null),rI(n.stateNode),Fn(e,Bt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(bd)throw bd=!1,e=dm,dm=null,e;return Cd&1&&e.tag!==0&&ha(),i=e.pendingLanes,i&1?e===fm?Nl++:(Nl=0,fm=e):Nl=0,Ei(),null}function ha(){if(oi!==null){var e=kb(Cd),t=fr.transition,n=Ze;try{if(fr.transition=null,Ze=16>e?16:e,oi===null)var r=!1;else{if(e=oi,oi=null,Cd=0,Qe&6)throw Error(K(331));var o=Qe;for(Qe|=4,ce=e.current;ce!==null;){var i=ce,s=i.child;if(ce.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ce=u;ce!==null;){var d=ce;switch(d.tag){case 0:case 11:case 15:_l(8,d,i)}var f=d.child;if(f!==null)f.return=d,ce=f;else for(;ce!==null;){d=ce;var h=d.sibling,m=d.return;if(zC(d),d===u){ce=null;break}if(h!==null){h.return=m,ce=h;break}ce=m}}}var g=i.alternate;if(g!==null){var y=g.child;if(y!==null){g.child=null;do{var S=y.sibling;y.sibling=null,y=S}while(y!==null)}}ce=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,ce=s;else e:for(;ce!==null;){if(i=ce,i.flags&2048)switch(i.tag){case 0:case 11:case 15:_l(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,ce=v;break e}ce=i.return}}var x=e.current;for(ce=x;ce!==null;){s=ce;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,ce=w;else e:for(s=x;ce!==null;){if(l=ce,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:lf(9,l)}}catch(j){_t(l,l.return,j)}if(l===s){ce=null;break e}var b=l.sibling;if(b!==null){b.return=l.return,ce=b;break e}ce=l.return}}if(Qe=o,Ei(),no&&typeof no.onPostCommitFiberRoot=="function")try{no.onPostCommitFiberRoot(Zd,e)}catch{}r=!0}return r}finally{Ze=n,fr.transition=t}}return!1}function Qx(e,t,n){t=Sa(n,t),t=RC(e,t,1),e=ui(e,t,1),t=En(),e!==null&&(vc(e,1,t),Fn(e,t))}function _t(e,t,n){if(e.tag===3)Qx(e,e,n);else for(;t!==null;){if(t.tag===3){Qx(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(di===null||!di.has(r))){e=Sa(n,e),e=DC(t,e,1),t=ui(t,e,1),e=En(),t!==null&&(vc(t,1,e),Fn(t,e));break}}t=t.return}}function D_(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=En(),e.pingedLanes|=e.suspendedLanes&n,Yt===e&&(sn&n)===n&&(Ht===4||Ht===3&&(sn&130023424)===sn&&500>Bt()-Gg?Gi(e,0):qg|=n),Fn(e,t)}function YC(e,t){t===0&&(e.mode&1?(t=fu,fu<<=1,!(fu&130023424)&&(fu=4194304)):t=1);var n=En();e=Po(e,t),e!==null&&(vc(e,t,n),Fn(e,n))}function I_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),YC(e,n)}function __(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(K(314))}r!==null&&r.delete(t),YC(e,n)}var XC;XC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ln.current)Mn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Mn=!1,x_(e,t,n);Mn=!!(e.flags&131072)}else Mn=!1,bt&&t.flags&1048576&&eC(t,pd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Vu(e,t),e=t.pendingProps;var o=ya(t,yn.current);fa(t,n),o=zg(null,t,r,e,o,n);var i=Bg();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,$n(r)?(i=!0,fd(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Og(t),o.updater=sf,t.stateNode=o,o._reactInternals=t,em(t,r,e,n),t=rm(null,t,r,!0,i,n)):(t.tag=0,bt&&i&&kg(t),wn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Vu(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=N_(r),e=Tr(r,e),o){case 0:t=nm(null,t,r,e,n);break e;case 1:t=$x(null,t,r,e,n);break e;case 11:t=Mx(null,t,r,e,n);break e;case 14:t=Lx(null,t,r,Tr(r.type,e),n);break e}throw Error(K(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tr(r,o),nm(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tr(r,o),$x(e,t,r,o,n);case 3:e:{if(NC(t),e===null)throw Error(K(387));r=t.pendingProps,i=t.memoizedState,o=i.element,oC(e,t),yd(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Sa(Error(K(423)),t),t=Fx(e,t,r,n,o);break e}else if(r!==o){o=Sa(Error(K(424)),t),t=Fx(e,t,r,n,o);break e}else for(Qn=ci(t.stateNode.containerInfo.firstChild),Yn=t,bt=!0,Dr=null,n=lC(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(va(),r===o){t=To(e,t,n);break e}wn(e,t,r,n)}t=t.child}return t;case 5:return cC(t),e===null&&Xp(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,qp(r,o)?s=null:i!==null&&qp(r,i)&&(t.flags|=32),AC(e,t),wn(e,t,s,n),t.child;case 6:return e===null&&Xp(t),null;case 13:return OC(e,t,n);case 4:return Mg(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=xa(t,null,r,n):wn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tr(r,o),Mx(e,t,r,o,n);case 7:return wn(e,t,t.pendingProps,n),t.child;case 8:return wn(e,t,t.pendingProps.children,n),t.child;case 12:return wn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,dt(md,r._currentValue),r._currentValue=s,i!==null)if(Or(i.value,s)){if(i.children===o.children&&!Ln.current){t=To(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=xo(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Jp(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(K(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Jp(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}wn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,fa(t,n),o=pr(o),r=r(o),t.flags|=1,wn(e,t,r,n),t.child;case 14:return r=t.type,o=Tr(r,t.pendingProps),o=Tr(r.type,o),Lx(e,t,r,o,n);case 15:return IC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Tr(r,o),Vu(e,t),t.tag=1,$n(r)?(e=!0,fd(t)):e=!1,fa(t,n),sC(t,r,o),em(t,r,o,n),rm(null,t,r,!0,e,n);case 19:return MC(e,t,n);case 22:return _C(e,t,n)}throw Error(K(156,t.tag))};function JC(e,t){return Eb(e,t)}function A_(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dr(e,t,n,r){return new A_(e,t,n,r)}function Xg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function N_(e){if(typeof e=="function")return Xg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===gg)return 11;if(e===yg)return 14}return 2}function hi(e,t){var n=e.alternate;return n===null?(n=dr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function qu(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Xg(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Hs:return Qi(n.children,o,i,t);case mg:s=8,o|=8;break;case Ep:return e=dr(12,n,t,o|2),e.elementType=Ep,e.lanes=i,e;case jp:return e=dr(13,n,t,o),e.elementType=jp,e.lanes=i,e;case Pp:return e=dr(19,n,t,o),e.elementType=Pp,e.lanes=i,e;case ab:return uf(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ib:s=10;break e;case sb:s=9;break e;case gg:s=11;break e;case yg:s=14;break e;case Ko:s=16,r=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=dr(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Qi(e,t,n,r){return e=dr(7,e,r,t),e.lanes=n,e}function uf(e,t,n,r){return e=dr(22,e,r,t),e.elementType=ab,e.lanes=n,e.stateNode={isHidden:!1},e}function Kh(e,t,n){return e=dr(6,e,null,t),e.lanes=n,e}function Yh(e,t,n){return t=dr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function O_(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Dh(0),this.expirationTimes=Dh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dh(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Jg(e,t,n,r,o,i,s,l,c){return e=new O_(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=dr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Og(i),e}function M_(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ws,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function ZC(e){if(!e)return yi;e=e._reactInternals;e:{if(ms(e)!==e||e.tag!==1)throw Error(K(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if($n(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(K(171))}if(e.tag===1){var n=e.type;if($n(n))return Jb(e,n,t)}return t}function eE(e,t,n,r,o,i,s,l,c){return e=Jg(n,r,!0,e,o,i,s,l,c),e.context=ZC(null),n=e.current,r=En(),o=fi(n),i=xo(r,o),i.callback=t??null,ui(n,i,o),e.current.lanes=o,vc(e,o,r),Fn(e,r),e}function df(e,t,n,r){var o=t.current,i=En(),s=fi(o);return n=ZC(n),t.context===null?t.context=n:t.pendingContext=n,t=xo(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ui(o,t,s),e!==null&&(Ar(e,o,s,i),zu(e,o,s)),s}function jd(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Kx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Zg(e,t){Kx(e,t),(e=e.alternate)&&Kx(e,t)}function L_(){return null}var tE=typeof reportError=="function"?reportError:function(e){console.error(e)};function ey(e){this._internalRoot=e}ff.prototype.render=ey.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(K(409));df(e,t,null,null)};ff.prototype.unmount=ey.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;es(function(){df(null,e,null,null)}),t[jo]=null}};function ff(e){this._internalRoot=e}ff.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ib();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ei.length&&t!==0&&t<ei[n].priority;n++);ei.splice(n,0,e),n===0&&Ab(e)}};function ty(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function hf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Yx(){}function $_(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=jd(s);i.call(u)}}var s=eE(t,r,e,0,null,!1,!1,"",Yx);return e._reactRootContainer=s,e[jo]=s.current,ql(e.nodeType===8?e.parentNode:e),es(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=jd(c);l.call(u)}}var c=Jg(e,0,!1,null,null,!1,!1,"",Yx);return e._reactRootContainer=c,e[jo]=c.current,ql(e.nodeType===8?e.parentNode:e),es(function(){df(t,c,n,r)}),c}function pf(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var c=jd(s);l.call(c)}}df(t,s,e,o)}else s=$_(n,t,e,o,r);return jd(s)}Rb=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=bl(t.pendingLanes);n!==0&&(wg(t,n|1),Fn(t,Bt()),!(Qe&6)&&(ba=Bt()+500,Ei()))}break;case 13:es(function(){var r=Po(e,1);if(r!==null){var o=En();Ar(r,e,1,o)}}),Zg(e,1)}};Sg=function(e){if(e.tag===13){var t=Po(e,134217728);if(t!==null){var n=En();Ar(t,e,134217728,n)}Zg(e,134217728)}};Db=function(e){if(e.tag===13){var t=fi(e),n=Po(e,t);if(n!==null){var r=En();Ar(n,e,t,r)}Zg(e,t)}};Ib=function(){return Ze};_b=function(e,t){var n=Ze;try{return Ze=e,t()}finally{Ze=n}};Mp=function(e,t,n){switch(t){case"input":if(Rp(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=rf(r);if(!o)throw Error(K(90));cb(r),Rp(r,o)}}}break;case"textarea":db(e,n);break;case"select":t=n.value,t!=null&&la(e,!!n.multiple,t,!1)}};vb=Qg;xb=es;var F_={usingClientEntryPoint:!1,Events:[wc,Ks,rf,gb,yb,Qg]},cl={findFiberByHostInstance:zi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},z_={bundleType:cl.bundleType,version:cl.version,rendererPackageName:cl.rendererPackageName,rendererConfig:cl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Oo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=bb(e),e===null?null:e.stateNode},findFiberByHostInstance:cl.findFiberByHostInstance||L_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Cu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cu.isDisabled&&Cu.supportsFiber)try{Zd=Cu.inject(z_),no=Cu}catch{}}nr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F_;nr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ty(t))throw Error(K(200));return M_(e,t,null,n)};nr.createRoot=function(e,t){if(!ty(e))throw Error(K(299));var n=!1,r="",o=tE;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Jg(e,1,!1,null,null,n,!1,r,o),e[jo]=t.current,ql(e.nodeType===8?e.parentNode:e),new ey(t)};nr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(K(188)):(e=Object.keys(e).join(","),Error(K(268,e)));return e=bb(t),e=e===null?null:e.stateNode,e};nr.flushSync=function(e){return es(e)};nr.hydrate=function(e,t,n){if(!hf(t))throw Error(K(200));return pf(null,e,t,!0,n)};nr.hydrateRoot=function(e,t,n){if(!ty(e))throw Error(K(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=tE;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=eE(t,null,e,1,n??null,o,!1,i,s),e[jo]=t.current,ql(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new ff(t)};nr.render=function(e,t,n){if(!hf(t))throw Error(K(200));return pf(null,e,t,!1,n)};nr.unmountComponentAtNode=function(e){if(!hf(e))throw Error(K(40));return e._reactRootContainer?(es(function(){pf(null,null,e,!1,function(){e._reactRootContainer=null,e[jo]=null})}),!0):!1};nr.unstable_batchedUpdates=Qg;nr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!hf(n))throw Error(K(200));if(e==null||e._reactInternals===void 0)throw Error(K(38));return pf(e,t,n,!1,r)};nr.version="18.2.0-next-9e3b772b8-20220608";function nE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nE)}catch(e){console.error(e)}}nE(),eb.exports=nr;var bc=eb.exports;const na=Km(bc),B_=fS({__proto__:null,default:na},[bc]),[U_,yr]=Tn("ScrollArea.Root component was not found in tree");function Ca(e,t){const n=$i(t);Oa(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const V_=C.forwardRef((e,t)=>{const{style:n,...r}=e,o=yr(),[i,s]=C.useState(0),[l,c]=C.useState(0),u=!!(i&&l);return Ca(o.scrollbarX,()=>{var f;const d=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(d),c(d)}),Ca(o.scrollbarY,()=>{var f;const d=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(d),s(d)}),u?C.createElement("div",{...r,ref:t,style:{...n,width:i,height:l}}):null}),W_=C.forwardRef((e,t)=>{const n=yr(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?C.createElement(V_,{...e,ref:t}):null}),H_={scrollHideDelay:1e3,type:"hover"},rE=p.forwardRef((e,t)=>{const n=U("ScrollAreaRoot",H_,e),{type:r,scrollHideDelay:o,scrollbars:i,...s}=n,[l,c]=p.useState(null),[u,d]=p.useState(null),[f,h]=p.useState(null),[m,g]=p.useState(null),[y,S]=p.useState(null),[v,x]=p.useState(0),[w,b]=p.useState(0),[j,E]=p.useState(!1),[P,T]=p.useState(!1),D=Zt(t,_=>c(_));return C.createElement(U_,{value:{type:r,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:j,onScrollbarXEnabledChange:E,scrollbarY:y,onScrollbarYChange:S,scrollbarYEnabled:P,onScrollbarYEnabledChange:T,onCornerWidthChange:x,onCornerHeightChange:b}},C.createElement(W,{...s,ref:D,__vars:{"--sa-corner-width":i!=="xy"?"0px":`${v}px`,"--sa-corner-height":i!=="xy"?"0px":`${w}px`}}))});rE.displayName="@mantine/core/ScrollAreaRoot";function oE(e,t){const n=e/t;return Number.isNaN(n)?0:n}function mf(e){const t=oE(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function iE(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function q_(e,[t,n]){return Math.min(n,Math.max(t,e))}function Xx(e,t,n="ltr"){const r=mf(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,l=i-r,c=n==="ltr"?[0,s]:[s*-1,0],u=q_(e,c);return iE([0,s],[0,l])(u)}function G_(e,t,n,r="ltr"){const o=mf(n),i=o/2,s=t||i,l=o-s,c=n.scrollbar.paddingStart+s,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return iE([c,u],f)(e)}function sE(e,t){return e>0&&e<t}function Pd(e){return e?parseInt(e,10):0}function Ki(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[Q_,aE]=Tn("ScrollAreaScrollbar was not found in tree"),lE=p.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,h=yr(),[m,g]=C.useState(null),y=Zt(t,T=>g(T)),S=C.useRef(null),v=C.useRef(""),{viewport:x}=h,w=n.content-n.viewport,b=$i(u),j=$i(l),E=Yd(d,10),P=T=>{if(S.current){const D=T.clientX-S.current.left,_=T.clientY-S.current.top;c({x:D,y:_})}};return p.useEffect(()=>{const T=D=>{const _=D.target;(m==null?void 0:m.contains(_))&&b(D,w)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[x,m,w,b]),p.useEffect(j,[n,j]),Ca(m,E),Ca(h.content,E),C.createElement(Q_,{value:{scrollbar:m,hasThumb:r,onThumbChange:$i(o),onThumbPointerUp:$i(i),onThumbPositionChange:j,onThumbPointerDown:$i(s)}},C.createElement("div",{...f,ref:y,style:{position:"absolute",...f.style},onPointerDown:Ki(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),S.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",P(T))}),onPointerMove:Ki(e.onPointerMove,P),onPointerUp:Ki(e.onPointerUp,T=>{const D=T.target;D.hasPointerCapture(T.pointerId)&&D.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=v.current,S.current=null})}))}),K_=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,s=yr(),[l,c]=p.useState(),u=p.useRef(null),d=Zt(t,u,s.onScrollbarXChange);return p.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),C.createElement(lE,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{...o,"--sa-thumb-width":`${mf(n)}px`},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(s.viewport){const m=s.viewport.scrollLeft+f.deltaX;e.onWheelScroll(m),sE(m,h)&&f.preventDefault()}},onResize:()=>{u.current&&s.viewport&&l&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Pd(l.paddingLeft),paddingEnd:Pd(l.paddingRight)}})}})}),Y_=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,s=yr(),[l,c]=C.useState(),u=p.useRef(null),d=Zt(t,u,s.onScrollbarYChange);return p.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),C.createElement(lE,{...i,"data-orientation":"vertical",ref:d,sizes:n,style:{"--sa-thumb-height":`${mf(n)}px`,...o},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(s.viewport){const m=s.viewport.scrollTop+f.deltaY;e.onWheelScroll(m),sE(m,h)&&f.preventDefault()}},onResize:()=>{u.current&&s.viewport&&l&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Pd(l.paddingTop),paddingEnd:Pd(l.paddingBottom)}})}})}),ny=p.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=hs(),i=yr(),s=p.useRef(null),l=p.useRef(0),[c,u]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=oE(c.viewport,c.content),f={...r,sizes:c,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:m=>{s.current=m},onThumbPointerUp:()=>{l.current=0},onThumbPointerDown:m=>{l.current=m}},h=(m,g)=>G_(m,l.current,c,g);return n==="horizontal"?C.createElement(K_,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const m=i.viewport.scrollLeft,g=Xx(m,c,o);s.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollLeft=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollLeft=h(m,o))}}):n==="vertical"?C.createElement(Y_,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const m=i.viewport.scrollTop,g=Xx(m,c);s.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollTop=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollTop=h(m))}}):null}),cE=p.forwardRef((e,t)=>{const n=yr(),{forceMount:r,...o}=e,[i,s]=p.useState(!1),l=e.orientation==="horizontal",c=Yd(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;s(l?u:d)}},10);return Ca(n.viewport,c),Ca(n.content,c),r||i?C.createElement(ny,{"data-state":i?"visible":"hidden",...o,ref:t}):null}),X_=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yr(),[i,s]=p.useState(!1);return p.useEffect(()=>{const{scrollArea:l}=o;let c=0;if(l){const u=()=>{window.clearTimeout(c),s(!0)},d=()=>{c=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),n||i?C.createElement(cE,{"data-state":i?"visible":"hidden",...r,ref:t}):null}),J_=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yr(),i=e.orientation==="horizontal",[s,l]=p.useState("hidden"),c=Yd(()=>l("idle"),100);return p.useEffect(()=>{if(s==="idle"){const u=window.setTimeout(()=>l("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[s,o.scrollHideDelay]),p.useEffect(()=>{const{viewport:u}=o,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const m=u[d];f!==m&&(l("scrolling"),c()),f=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[o.viewport,i,c]),n||s!=="hidden"?C.createElement(ny,{"data-state":s==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ki(e.onPointerEnter,()=>l("interacting")),onPointerLeave:Ki(e.onPointerLeave,()=>l("idle"))}):null}),Jx=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yr(),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,l=e.orientation==="horizontal";return C.useEffect(()=>(l?i(!0):s(!0),()=>{l?i(!1):s(!1)}),[l,i,s]),o.type==="hover"?C.createElement(X_,{...r,ref:t,forceMount:n}):o.type==="scroll"?C.createElement(J_,{...r,ref:t,forceMount:n}):o.type==="auto"?C.createElement(cE,{...r,ref:t,forceMount:n}):o.type==="always"?C.createElement(ny,{...r,ref:t}):null});function Z_(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,l=n.top!==i.top;(s||l)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)}const eA=p.forwardRef((e,t)=>{const{style:n,...r}=e,o=yr(),i=aE(),{onThumbPositionChange:s}=i,l=Zt(t,d=>i.onThumbChange(d)),c=p.useRef(),u=Yd(()=>{c.current&&(c.current(),c.current=void 0)},100);return p.useEffect(()=>{const{viewport:d}=o;if(d){const f=()=>{if(u(),!c.current){const h=Z_(d,s);c.current=h,s()}};return s(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[o.viewport,u,s]),C.createElement("div",{"data-state":i.hasThumb?"visible":"hidden",...r,ref:l,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:Ki(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),m=d.clientX-h.left,g=d.clientY-h.top;i.onThumbPointerDown({x:m,y:g})}),onPointerUp:Ki(e.onPointerUp,i.onThumbPointerUp)})}),Zx=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=aE();return n||o.hasThumb?C.createElement(eA,{ref:t,...r}):null}),uE=p.forwardRef(({children:e,style:t,...n},r)=>{const o=yr(),i=Zt(r,o.onViewportChange);return C.createElement(W,{...n,ref:i,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t}},C.createElement("div",{style:{minWidth:"100%",display:"table"},ref:o.onContentChange},e))});uE.displayName="@mantine/core/ScrollAreaViewport";var ry={root:"m-d57069b5",viewport:"m-c0783ff9",viewportInner:"m-f8f631dd",scrollbar:"m-c44ba933",thumb:"m-d8b5e363",corner:"m-21657268"};const dE={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},tA=(e,{scrollbarSize:t})=>({root:{"--scrollarea-scrollbar-size":B(t)}}),vr=Q((e,t)=>{const n=U("ScrollArea",dE,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,scrollbarSize:c,vars:u,type:d,scrollHideDelay:f,viewportProps:h,viewportRef:m,onScrollPositionChange:g,children:y,offsetScrollbars:S,scrollbars:v,...x}=n,[w,b]=p.useState(!1),j=de({name:"ScrollArea",props:n,classes:ry,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:u,varsResolver:tA});return C.createElement(rE,{type:d==="never"?"always":d,scrollHideDelay:f,ref:t,scrollbars:v,...j("root"),...x},C.createElement(uE,{...h,...j("viewport",{style:h==null?void 0:h.style}),ref:m,"data-offset-scrollbars":S===!0?"xy":S||void 0,"data-scrollbars":v||void 0,onScroll:typeof g=="function"?({currentTarget:E})=>g({x:E.scrollLeft,y:E.scrollTop}):void 0},y),(v==="xy"||v==="x")&&C.createElement(Jx,{...j("scrollbar"),orientation:"horizontal","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1)},C.createElement(Zx,{...j("thumb")})),(v==="xy"||v==="y")&&C.createElement(Jx,{...j("scrollbar"),orientation:"vertical","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1)},C.createElement(Zx,{...j("thumb")})),C.createElement(W_,{...j("corner"),"data-hovered":w||void 0,"data-hidden":d==="never"||void 0}))});vr.displayName="@mantine/core/ScrollArea";const oy=Q((e,t)=>{const{children:n,classNames:r,styles:o,scrollbarSize:i,scrollHideDelay:s,type:l,dir:c,offsetScrollbars:u,viewportRef:d,onScrollPositionChange:f,unstyled:h,variant:m,viewportProps:g,scrollbars:y,style:S,vars:v,...x}=U("ScrollAreaAutosize",dE,e);return C.createElement(W,{...x,ref:t,style:[{display:"flex",overflow:"auto"},S]},C.createElement(W,{style:{display:"flex",flexDirection:"column",flex:1}},C.createElement(vr,{classNames:r,styles:o,scrollHideDelay:s,scrollbarSize:i,type:l,dir:c,offsetScrollbars:u,viewportRef:d,onScrollPositionChange:f,unstyled:h,variant:m,viewportProps:g,vars:v,scrollbars:y},n)))});vr.classes=ry;oy.displayName="@mantine/core/ScrollAreaAutosize";oy.classes=ry;vr.Autosize=oy;var fE={root:"m-87cf2631"};const nA={__staticSelector:"UnstyledButton"},Jn=vn((e,t)=>{const n=U("UnstyledButton",nA,e),{className:r,component:o="button",__staticSelector:i,unstyled:s,classNames:l,styles:c,style:u,...d}=n,f=de({name:i,props:n,classes:fE,className:r,style:u,classNames:l,styles:c,unstyled:s});return C.createElement(W,{...f("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...d})});Jn.classes=fE;Jn.displayName="@mantine/core/UnstyledButton";var hE={root:"m-515a97f8"};const rA={},iy=Q((e,t)=>{const n=U("VisuallyHidden",rA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,...u}=n,d=de({name:"VisuallyHidden",classes:hE,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l});return C.createElement(W,{component:"span",ref:t,...d("root"),...u})});iy.classes=hE;iy.displayName="@mantine/core/VisuallyHidden";var pE={root:"m-1b7284a3"};const oA={},iA=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:gt(t),"--paper-shadow":ng(n)}}),zn=vn((e,t)=>{const n=U("Paper",oA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,withBorder:c,vars:u,radius:d,shadow:f,variant:h,mod:m,...g}=n,y=de({name:"Paper",props:n,classes:pE,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:u,varsResolver:iA});return C.createElement(W,{ref:t,mod:[{"data-with-border":c},m],...y("root"),variant:h,...g})});zn.classes=pE;zn.displayName="@mantine/core/Paper";function vi(e){return mE(e)?(e.nodeName||"").toLowerCase():"#document"}function Bn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mo(e){var t;return(t=(mE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function mE(e){return e instanceof Node||e instanceof Bn(e).Node}function jt(e){return e instanceof Element||e instanceof Bn(e).Element}function Zn(e){return e instanceof HTMLElement||e instanceof Bn(e).HTMLElement}function mm(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bn(e).ShadowRoot}function Cc(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=er(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function sA(e){return["table","td","th"].includes(vi(e))}function sy(e){const t=ay(),n=er(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function aA(e){let t=ts(e);for(;Zn(t)&&!Ea(t);){if(sy(t))return t;t=ts(t)}return null}function ay(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ea(e){return["html","body","#document"].includes(vi(e))}function er(e){return Bn(e).getComputedStyle(e)}function gf(e){return jt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ts(e){if(vi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||mm(e)&&e.host||Mo(e);return mm(t)?t.host:t}function gE(e){const t=ts(e);return Ea(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zn(t)&&Cc(t)?t:gE(t)}function wo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=gE(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Bn(o);return i?t.concat(s,s.visualViewport||[],Cc(o)?o:[],s.frameElement&&n?wo(s.frameElement):[]):t.concat(o,wo(o,[],n))}function e1(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function tc(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&mm(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function yE(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function vE(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function lA(e){return dA()?!1:!t1()&&e.width===0&&e.height===0||t1()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function cA(){return/apple/i.test(navigator.vendor)}function t1(){const e=/android/i;return e.test(yE())||e.test(vE())}function uA(){return yE().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function dA(){return vE().includes("jsdom/")}function xE(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function fA(e){return"nativeEvent"in e}function hA(e){return e.matches("html,body")}function Vi(e){return(e==null?void 0:e.ownerDocument)||document}function Xh(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Bs(e){return"composedPath"in e?e.composedPath()[0]:e.target}const pA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function mA(e){return Zn(e)&&e.matches(pA)}const Mr=Math.min,pn=Math.max,Td=Math.round,Eu=Math.floor,xi=e=>({x:e,y:e}),gA={left:"right",right:"left",bottom:"top",top:"bottom"},yA={start:"end",end:"start"};function gm(e,t,n){return pn(e,Mr(t,n))}function ko(e,t){return typeof e=="function"?e(t):e}function Lr(e){return e.split("-")[0]}function za(e){return e.split("-")[1]}function ly(e){return e==="x"?"y":"x"}function cy(e){return e==="y"?"height":"width"}function gs(e){return["top","bottom"].includes(Lr(e))?"y":"x"}function uy(e){return ly(gs(e))}function vA(e,t,n){n===void 0&&(n=!1);const r=za(e),o=uy(e),i=cy(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=kd(s)),[s,kd(s)]}function xA(e){const t=kd(e);return[ym(e),t,ym(t)]}function ym(e){return e.replace(/start|end/g,t=>yA[t])}function wA(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function SA(e,t,n,r){const o=za(e);let i=wA(Lr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(ym)))),i}function kd(e){return e.replace(/left|right|bottom|top/g,t=>gA[t])}function bA(e){return{top:0,right:0,bottom:0,left:0,...e}}function dy(e){return typeof e!="number"?bA(e):{top:e,right:e,bottom:e,left:e}}function ja(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function n1(e,t,n){let{reference:r,floating:o}=e;const i=gs(t),s=uy(t),l=cy(s),c=Lr(t),u=i==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[l]/2-o[l]/2;let m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(za(t)){case"start":m[s]-=h*(n&&u?-1:1);break;case"end":m[s]+=h*(n&&u?-1:1);break}return m}const CA=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=n1(u,r,c),h=r,m={},g=0;for(let y=0;y<l.length;y++){const{name:S,fn:v}=l[y],{x,y:w,data:b,reset:j}=await v({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:u,platform:s,elements:{reference:e,floating:t}});d=x??d,f=w??f,m={...m,[S]:{...m[S],...b}},j&&g<=50&&(g++,typeof j=="object"&&(j.placement&&(h=j.placement),j.rects&&(u=j.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:d,y:f}=n1(u,h,c)),y=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:m}};async function fy(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=ko(t,e),g=dy(m),S=l[h?f==="floating"?"reference":"floating":f],v=ja(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(S)))==null||n?S:S.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),x=f==="floating"?{...s.floating,x:r,y:o}:s.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),b=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},j=ja(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:w,strategy:c}):x);return{top:(v.top-j.top+g.top)/b.y,bottom:(j.bottom-v.bottom+g.bottom)/b.y,left:(v.left-j.left+g.left)/b.x,right:(j.right-v.right+g.right)/b.x}}const EA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=ko(e,t)||{};if(u==null)return{};const f=dy(d),h={x:n,y:r},m=uy(o),g=cy(m),y=await s.getDimensions(u),S=m==="y",v=S?"top":"left",x=S?"bottom":"right",w=S?"clientHeight":"clientWidth",b=i.reference[g]+i.reference[m]-h[m]-i.floating[g],j=h[m]-i.reference[m],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let P=E?E[w]:0;(!P||!await(s.isElement==null?void 0:s.isElement(E)))&&(P=l.floating[w]||i.floating[g]);const T=b/2-j/2,D=P/2-y[g]/2-1,_=Mr(f[v],D),O=Mr(f[x],D),I=_,$=P-y[g]-O,N=P/2-y[g]/2+T,L=gm(I,N,$),M=!c.arrow&&za(o)!=null&&N!==L&&i.reference[g]/2-(N<I?_:O)-y[g]/2<0,R=M?N<I?N-I:N-$:0;return{[m]:h[m]+R,data:{[m]:L,centerOffset:N-L-R,...M&&{alignmentOffset:R}},reset:M}}}),jA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...S}=ko(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=Lr(o),x=Lr(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),b=h||(x||!y?[kd(l)]:xA(l));!h&&g!=="none"&&b.push(...SA(l,y,g,w));const j=[l,...b],E=await fy(t,S),P=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&P.push(E[v]),f){const I=vA(o,s,w);P.push(E[I[0]],E[I[1]])}if(T=[...T,{placement:o,overflows:P}],!P.every(I=>I<=0)){var D,_;const I=(((D=i.flip)==null?void 0:D.index)||0)+1,$=j[I];if($)return{data:{index:I,overflows:T},reset:{placement:$}};let N=(_=T.filter(L=>L.overflows[0]<=0).sort((L,M)=>L.overflows[1]-M.overflows[1])[0])==null?void 0:_.placement;if(!N)switch(m){case"bestFit":{var O;const L=(O=T.map(M=>[M.placement,M.overflows.filter(R=>R>0).reduce((R,k)=>R+k,0)]).sort((M,R)=>M[1]-R[1])[0])==null?void 0:O[0];L&&(N=L);break}case"initialPlacement":N=l;break}if(o!==N)return{reset:{placement:N}}}return{}}}};function wE(e){const t=Mr(...e.map(i=>i.left)),n=Mr(...e.map(i=>i.top)),r=pn(...e.map(i=>i.right)),o=pn(...e.map(i=>i.bottom));return{x:t,y:n,width:r-t,height:o-n}}function PA(e){const t=e.slice().sort((o,i)=>o.y-i.y),n=[];let r=null;for(let o=0;o<t.length;o++){const i=t[o];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(o=>ja(wE(o)))}const TA=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:s}=t,{padding:l=2,x:c,y:u}=ko(e,t),d=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(r.reference))||[]),f=PA(d),h=ja(wE(d)),m=dy(l);function g(){if(f.length===2&&f[0].left>f[1].right&&c!=null&&u!=null)return f.find(S=>c>S.left-m.left&&c<S.right+m.right&&u>S.top-m.top&&u<S.bottom+m.bottom)||h;if(f.length>=2){if(gs(n)==="y"){const _=f[0],O=f[f.length-1],I=Lr(n)==="top",$=_.top,N=O.bottom,L=I?_.left:O.left,M=I?_.right:O.right,R=M-L,k=N-$;return{top:$,bottom:N,left:L,right:M,width:R,height:k,x:L,y:$}}const S=Lr(n)==="left",v=pn(...f.map(_=>_.right)),x=Mr(...f.map(_=>_.left)),w=f.filter(_=>S?_.left===x:_.right===v),b=w[0].top,j=w[w.length-1].bottom,E=x,P=v,T=P-E,D=j-b;return{top:b,bottom:j,left:E,right:P,width:T,height:D,x:E,y:b}}return h}const y=await i.getElementRects({reference:{getBoundingClientRect:g},floating:r.floating,strategy:s});return o.reference.x!==y.reference.x||o.reference.y!==y.reference.y||o.reference.width!==y.reference.width||o.reference.height!==y.reference.height?{reset:{rects:y}}:{}}}};async function kA(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Lr(n),l=za(n),c=gs(n)==="y",u=["left","top"].includes(s)?-1:1,d=i&&c?-1:1,f=ko(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const SE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await kA(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},RA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:S=>{let{x:v,y:x}=S;return{x:v,y:x}}},...c}=ko(e,t),u={x:n,y:r},d=await fy(t,c),f=gs(Lr(o)),h=ly(f);let m=u[h],g=u[f];if(i){const S=h==="y"?"top":"left",v=h==="y"?"bottom":"right",x=m+d[S],w=m-d[v];m=gm(x,m,w)}if(s){const S=f==="y"?"top":"left",v=f==="y"?"bottom":"right",x=g+d[S],w=g-d[v];g=gm(x,g,w)}const y=l.fn({...t,[h]:m,[f]:g});return{...y,data:{x:y.x-n,y:y.y-r}}}}},DA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=ko(e,t),d={x:n,y:r},f=gs(o),h=ly(f);let m=d[h],g=d[f];const y=ko(l,t),S=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const w=h==="y"?"height":"width",b=i.reference[h]-i.floating[w]+S.mainAxis,j=i.reference[h]+i.reference[w]-S.mainAxis;m<b?m=b:m>j&&(m=j)}if(u){var v,x;const w=h==="y"?"width":"height",b=["top","left"].includes(Lr(o)),j=i.reference[f]-i.floating[w]+(b&&((v=s.offset)==null?void 0:v[f])||0)+(b?0:S.crossAxis),E=i.reference[f]+i.reference[w]+(b?0:((x=s.offset)==null?void 0:x[f])||0)-(b?S.crossAxis:0);g<j?g=j:g>E&&(g=E)}return{[h]:m,[f]:g}}}},IA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...l}=ko(e,t),c=await fy(t,l),u=Lr(n),d=za(n),f=gs(n)==="y",{width:h,height:m}=r.floating;let g,y;u==="top"||u==="bottom"?(g=u,y=d===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(y=u,g=d==="end"?"top":"bottom");const S=m-c[g],v=h-c[y],x=!t.middlewareData.shift;let w=S,b=v;if(f){const E=h-c.left-c.right;b=d||x?Mr(v,E):E}else{const E=m-c.top-c.bottom;w=d||x?Mr(S,E):E}if(x&&!d){const E=pn(c.left,0),P=pn(c.right,0),T=pn(c.top,0),D=pn(c.bottom,0);f?b=h-2*(E!==0||P!==0?E+P:pn(c.left,c.right)):w=m-2*(T!==0||D!==0?T+D:pn(c.top,c.bottom))}await s({...t,availableWidth:b,availableHeight:w});const j=await o.getDimensions(i.floating);return h!==j.width||m!==j.height?{reset:{rects:!0}}:{}}}};function bE(e){const t=er(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Zn(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,l=Td(n)!==i||Td(r)!==s;return l&&(n=i,r=s),{width:n,height:r,$:l}}function hy(e){return jt(e)?e:e.contextElement}function pa(e){const t=hy(e);if(!Zn(t))return xi(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=bE(t);let s=(i?Td(n.width):n.width)/r,l=(i?Td(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const _A=xi(0);function CE(e){const t=Bn(e);return!ay()||!t.visualViewport?_A:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function AA(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bn(e)?!1:t}function ns(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=hy(e);let s=xi(1);t&&(r?jt(r)&&(s=pa(r)):s=pa(e));const l=AA(i,n,r)?CE(i):xi(0);let c=(o.left+l.x)/s.x,u=(o.top+l.y)/s.y,d=o.width/s.x,f=o.height/s.y;if(i){const h=Bn(i),m=r&&jt(r)?Bn(r):r;let g=h,y=g.frameElement;for(;y&&r&&m!==g;){const S=pa(y),v=y.getBoundingClientRect(),x=er(y),w=v.left+(y.clientLeft+parseFloat(x.paddingLeft))*S.x,b=v.top+(y.clientTop+parseFloat(x.paddingTop))*S.y;c*=S.x,u*=S.y,d*=S.x,f*=S.y,c+=w,u+=b,g=Bn(y),y=g.frameElement}}return ja({width:d,height:f,x:c,y:u})}const NA=[":popover-open",":modal"];function EE(e){return NA.some(t=>{try{return e.matches(t)}catch{return!1}})}function OA(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Mo(r),l=t?EE(t.floating):!1;if(r===s||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=xi(1);const d=xi(0),f=Zn(r);if((f||!f&&!i)&&((vi(r)!=="body"||Cc(s))&&(c=gf(r)),Zn(r))){const h=ns(r);u=pa(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x,y:n.y*u.y-c.scrollTop*u.y+d.y}}function MA(e){return Array.from(e.getClientRects())}function jE(e){return ns(Mo(e)).left+gf(e).scrollLeft}function LA(e){const t=Mo(e),n=gf(e),r=e.ownerDocument.body,o=pn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=pn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+jE(e);const l=-n.scrollTop;return er(r).direction==="rtl"&&(s+=pn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}function $A(e,t){const n=Bn(e),r=Mo(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const u=ay();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:l,y:c}}function FA(e,t){const n=ns(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Zn(e)?pa(e):xi(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,u=r*i.y;return{width:s,height:l,x:c,y:u}}function r1(e,t,n){let r;if(t==="viewport")r=$A(e,n);else if(t==="document")r=LA(Mo(e));else if(jt(t))r=FA(t,n);else{const o=CE(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return ja(r)}function PE(e,t){const n=ts(e);return n===t||!jt(n)||Ea(n)?!1:er(n).position==="fixed"||PE(n,t)}function zA(e,t){const n=t.get(e);if(n)return n;let r=wo(e,[],!1).filter(l=>jt(l)&&vi(l)!=="body"),o=null;const i=er(e).position==="fixed";let s=i?ts(e):e;for(;jt(s)&&!Ea(s);){const l=er(s),c=sy(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Cc(s)&&!c&&PE(e,s))?r=r.filter(d=>d!==s):o=l,s=ts(s)}return t.set(e,r),r}function BA(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?zA(t,this._c):[].concat(n),r],l=s[0],c=s.reduce((u,d)=>{const f=r1(t,d,o);return u.top=pn(f.top,u.top),u.right=Mr(f.right,u.right),u.bottom=Mr(f.bottom,u.bottom),u.left=pn(f.left,u.left),u},r1(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function UA(e){const{width:t,height:n}=bE(e);return{width:t,height:n}}function VA(e,t,n){const r=Zn(t),o=Mo(t),i=n==="fixed",s=ns(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=xi(0);if(r||!r&&!i)if((vi(t)!=="body"||Cc(o))&&(l=gf(t)),r){const f=ns(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&(c.x=jE(o));const u=s.left+l.scrollLeft-c.x,d=s.top+l.scrollTop-c.y;return{x:u,y:d,width:s.width,height:s.height}}function o1(e,t){return!Zn(e)||er(e).position==="fixed"?null:t?t(e):e.offsetParent}function TE(e,t){const n=Bn(e);if(!Zn(e)||EE(e))return n;let r=o1(e,t);for(;r&&sA(r)&&er(r).position==="static";)r=o1(r,t);return r&&(vi(r)==="html"||vi(r)==="body"&&er(r).position==="static"&&!sy(r))?n:r||aA(e)||n}const WA=async function(e){const t=this.getOffsetParent||TE,n=this.getDimensions;return{reference:VA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}};function HA(e){return er(e).direction==="rtl"}const qA={convertOffsetParentRelativeRectToViewportRelativeRect:OA,getDocumentElement:Mo,getClippingRect:BA,getOffsetParent:TE,getElementRects:WA,getClientRects:MA,getDimensions:UA,getScale:pa,isElement:jt,isRTL:HA};function GA(e,t){let n=null,r;const o=Mo(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:u,top:d,width:f,height:h}=e.getBoundingClientRect();if(l||t(),!f||!h)return;const m=Eu(d),g=Eu(o.clientWidth-(u+f)),y=Eu(o.clientHeight-(d+h)),S=Eu(u),x={rootMargin:-m+"px "+-g+"px "+-y+"px "+-S+"px",threshold:pn(0,Mr(1,c))||1};let w=!0;function b(j){const E=j[0].intersectionRatio;if(E!==c){if(!w)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},100)}w=!1}try{n=new IntersectionObserver(b,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,x)}n.observe(e)}return s(!0),i}function QA(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=hy(e),d=o||i?[...u?wo(u):[],...wo(t)]:[];d.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const f=u&&l?GA(u,n):null;let h=-1,m=null;s&&(m=new ResizeObserver(v=>{let[x]=v;x&&x.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let g,y=c?ns(e):null;c&&S();function S(){const v=ns(e);y&&(v.x!==y.x||v.y!==y.y||v.width!==y.width||v.height!==y.height)&&n(),y=v,g=requestAnimationFrame(S)}return n(),()=>{var v;d.forEach(x=>{o&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f==null||f(),(v=m)==null||v.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const py=RA,kE=jA,KA=IA,i1=EA,RE=TA,YA=DA,XA=(e,t,n)=>{const r=new Map,o={platform:qA,...n},i={...o.platform,_c:r};return CA(e,t,{...o,platform:i})},DE=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?i1({element:r.current,padding:o}).fn(n):{}:r?i1({element:r,padding:o}).fn(n):{}}}};var Gu=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Rd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Rd(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Rd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function IE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function s1(e,t){const n=IE(e);return Math.round(t*n)/n}function a1(e){const t=p.useRef(e);return Gu(()=>{t.current=e}),t}function JA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(r);Rd(h,r)||m(r);const[g,y]=p.useState(null),[S,v]=p.useState(null),x=p.useCallback(R=>{R!==E.current&&(E.current=R,y(R))},[]),w=p.useCallback(R=>{R!==P.current&&(P.current=R,v(R))},[]),b=i||g,j=s||S,E=p.useRef(null),P=p.useRef(null),T=p.useRef(d),D=c!=null,_=a1(c),O=a1(o),I=p.useCallback(()=>{if(!E.current||!P.current)return;const R={placement:t,strategy:n,middleware:h};O.current&&(R.platform=O.current),XA(E.current,P.current,R).then(k=>{const F={...k,isPositioned:!0};$.current&&!Rd(T.current,F)&&(T.current=F,bc.flushSync(()=>{f(F)}))})},[h,t,n,O]);Gu(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(R=>({...R,isPositioned:!1})))},[u]);const $=p.useRef(!1);Gu(()=>($.current=!0,()=>{$.current=!1}),[]),Gu(()=>{if(b&&(E.current=b),j&&(P.current=j),b&&j){if(_.current)return _.current(b,j,I);I()}},[b,j,I,_,D]);const N=p.useMemo(()=>({reference:E,floating:P,setReference:x,setFloating:w}),[x,w]),L=p.useMemo(()=>({reference:b,floating:j}),[b,j]),M=p.useMemo(()=>{const R={position:n,left:0,top:0};if(!L.floating)return R;const k=s1(L.floating,d.x),F=s1(L.floating,d.y);return l?{...R,transform:"translate("+k+"px, "+F+"px)",...IE(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:F}},[n,l,L.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:I,refs:N,elements:L,floatingStyles:M}),[d,I,N,L,M])}const ZA=eg.useInsertionEffect,e4=ZA||(e=>e());function Us(e){const t=p.useRef(()=>{});return e4(()=>{t.current=e}),p.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var So=typeof document<"u"?p.useLayoutEffect:p.useEffect;let Jh=!1,t4=0;const l1=()=>"floating-ui-"+t4++;function n4(){const[e,t]=p.useState(()=>Jh?l1():void 0);return So(()=>{e==null&&t(l1())},[]),p.useEffect(()=>{Jh||(Jh=!0)},[]),e}const r4=eg.useId,_E=r4||n4;function o4(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const i4=p.createContext(null),s4=p.createContext(null),my=()=>{var e;return((e=p.useContext(i4))==null?void 0:e.id)||null},gy=()=>p.useContext(s4);function yy(e){return"data-floating-ui-"+e}function c1(e){const t=p.useRef(e);return So(()=>{t.current=e}),t}const u1=yy("safe-polygon");function Qu(e,t,n){return n&&!xE(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function a4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:s,floating:l},refs:c}=e,{enabled:u=!0,delay:d=0,handleClose:f=null,mouseOnly:h=!1,restMs:m=0,move:g=!0}=t,y=gy(),S=my(),v=c1(f),x=c1(d),w=p.useRef(),b=p.useRef(),j=p.useRef(),E=p.useRef(),P=p.useRef(!0),T=p.useRef(!1),D=p.useRef(()=>{}),_=p.useCallback(()=>{var N;const L=(N=o.current.openEvent)==null?void 0:N.type;return(L==null?void 0:L.includes("mouse"))&&L!=="mousedown"},[o]);p.useEffect(()=>{if(!u)return;function N(L){let{open:M}=L;M||(clearTimeout(b.current),clearTimeout(E.current),P.current=!0)}return i.on("openchange",N),()=>{i.off("openchange",N)}},[u,i]),p.useEffect(()=>{if(!u||!v.current||!n)return;function N(M){_()&&r(!1,M,"hover")}const L=Vi(l).documentElement;return L.addEventListener("mouseleave",N),()=>{L.removeEventListener("mouseleave",N)}},[l,n,r,u,v,_]);const O=p.useCallback(function(N,L,M){L===void 0&&(L=!0),M===void 0&&(M="hover");const R=Qu(x.current,"close",w.current);R&&!j.current?(clearTimeout(b.current),b.current=setTimeout(()=>r(!1,N,M),R)):L&&(clearTimeout(b.current),r(!1,N,M))},[x,r]),I=p.useCallback(()=>{D.current(),j.current=void 0},[]),$=p.useCallback(()=>{if(T.current){const N=Vi(c.floating.current).body;N.style.pointerEvents="",N.removeAttribute(u1),T.current=!1}},[c]);return p.useEffect(()=>{if(!u)return;function N(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function L(k){if(clearTimeout(b.current),P.current=!1,h&&!xE(w.current)||m>0&&Qu(x.current,"open")===0)return;const F=Qu(x.current,"open",w.current);F?b.current=setTimeout(()=>{r(!0,k,"hover")},F):r(!0,k,"hover")}function M(k){if(N())return;D.current();const F=Vi(l);if(clearTimeout(E.current),v.current){n||clearTimeout(b.current),j.current=v.current({...e,tree:y,x:k.clientX,y:k.clientY,onClose(){$(),I(),O(k,!0,"safe-polygon")}});const G=j.current;F.addEventListener("mousemove",G),D.current=()=>{F.removeEventListener("mousemove",G)};return}(w.current==="touch"?!tc(l,k.relatedTarget):!0)&&O(k)}function R(k){N()||v.current==null||v.current({...e,tree:y,x:k.clientX,y:k.clientY,onClose(){$(),I(),O(k)}})(k)}if(jt(s)){const k=s;return n&&k.addEventListener("mouseleave",R),l==null||l.addEventListener("mouseleave",R),g&&k.addEventListener("mousemove",L,{once:!0}),k.addEventListener("mouseenter",L),k.addEventListener("mouseleave",M),()=>{n&&k.removeEventListener("mouseleave",R),l==null||l.removeEventListener("mouseleave",R),g&&k.removeEventListener("mousemove",L),k.removeEventListener("mouseenter",L),k.removeEventListener("mouseleave",M)}}},[s,l,u,e,h,m,g,O,I,$,r,n,y,x,v,o]),So(()=>{var N;if(u&&n&&(N=v.current)!=null&&N.__options.blockPointerEvents&&_()){const M=Vi(l).body;if(M.setAttribute(u1,""),M.style.pointerEvents="none",T.current=!0,jt(s)&&l){var L;const R=s,k=y==null||(L=y.nodesRef.current.find(F=>F.id===S))==null||(L=L.context)==null?void 0:L.elements.floating;return k&&(k.style.pointerEvents=""),R.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{R.style.pointerEvents="",l.style.pointerEvents=""}}}},[u,n,S,l,s,y,v,_]),So(()=>{n||(w.current=void 0,I(),$())},[n,I,$]),p.useEffect(()=>()=>{I(),clearTimeout(b.current),clearTimeout(E.current),$()},[u,s,I,$]),p.useMemo(()=>{if(!u)return{};function N(L){w.current=L.pointerType}return{reference:{onPointerDown:N,onPointerEnter:N,onMouseMove(L){n||m===0||(clearTimeout(E.current),E.current=setTimeout(()=>{P.current||r(!0,L.nativeEvent,"hover")},m))}},floating:{onMouseEnter(){clearTimeout(b.current)},onMouseLeave(L){O(L.nativeEvent,!1)}}}},[u,m,n,r,O])}const AE=p.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),NE=()=>p.useContext(AE),l4=e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,i]=p.useReducer((c,u)=>({...c,...u}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),s=p.useRef(null),l=p.useCallback(c=>{i({currentId:c})},[]);return So(()=>{o.currentId?s.current===null?s.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),s.current=null)},[o.currentId]),p.createElement(AE.Provider,{value:p.useMemo(()=>({...o,setState:i,setCurrentId:l}),[o,l])},t)},c4=(e,t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:i,setCurrentId:s,initialDelay:l,setState:c,timeoutMs:u}=NE();So(()=>{i&&(c({delay:{open:1,close:Qu(l,"close")}}),i!==o&&r(!1))},[o,r,c,i,l]),So(()=>{function d(){r(!1),c({delay:l,currentId:null})}if(!n&&i===o){if(u){const f=window.setTimeout(d,u);return()=>{clearTimeout(f)}}d()}},[n,c,i,o,r,l,u]),So(()=>{n&&s(o)},[n,s,o])};function Zh(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)}),r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(s=>{var l;return o.parentId===s.id&&((l=o.context)==null?void 0:l.open)})}),n=n.concat(r);return n}const u4={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},d4={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},d1=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function f4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,nodeId:o,elements:{reference:i,domReference:s,floating:l},dataRef:c}=e,{enabled:u=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:h="pointerdown",referencePress:m=!1,referencePressEvent:g="pointerdown",ancestorScroll:y=!1,bubbles:S,capture:v}=t,x=gy(),w=Us(typeof f=="function"?f:()=>!1),b=typeof f=="function"?w:f,j=p.useRef(!1),E=p.useRef(!1),{escapeKey:P,outsidePress:T}=d1(S),{escapeKey:D,outsidePress:_}=d1(v),O=Us(L=>{if(!n||!u||!d||L.key!=="Escape")return;const M=x?Zh(x.nodesRef.current,o):[];if(!P&&(L.stopPropagation(),M.length>0)){let R=!0;if(M.forEach(k=>{var F;if((F=k.context)!=null&&F.open&&!k.context.dataRef.current.__escapeKeyBubbles){R=!1;return}}),!R)return}r(!1,fA(L)?L.nativeEvent:L,"escape-key")}),I=Us(L=>{var M;const R=()=>{var k;O(L),(k=Bs(L))==null||k.removeEventListener("keydown",R)};(M=Bs(L))==null||M.addEventListener("keydown",R)}),$=Us(L=>{const M=j.current;j.current=!1;const R=E.current;if(E.current=!1,h==="click"&&R||M||typeof b=="function"&&!b(L))return;const k=Bs(L),F="["+yy("inert")+"]",q=Vi(l).querySelectorAll(F);let G=jt(k)?k:null;for(;G&&!Ea(G);){const me=ts(G);if(Ea(me)||!jt(me))break;G=me}if(q.length&&jt(k)&&!hA(k)&&!tc(k,l)&&Array.from(q).every(me=>!tc(G,me)))return;if(Zn(k)&&l){const me=k.clientWidth>0&&k.scrollWidth>k.clientWidth,Ce=k.clientHeight>0&&k.scrollHeight>k.clientHeight;let je=Ce&&L.offsetX>k.clientWidth;if(Ce&&er(k).direction==="rtl"&&(je=L.offsetX<=k.offsetWidth-k.clientWidth),je||me&&L.offsetY>k.clientHeight)return}const oe=x&&Zh(x.nodesRef.current,o).some(me=>{var Ce;return Xh(L,(Ce=me.context)==null?void 0:Ce.elements.floating)});if(Xh(L,l)||Xh(L,s)||oe)return;const xe=x?Zh(x.nodesRef.current,o):[];if(xe.length>0){let me=!0;if(xe.forEach(Ce=>{var je;if((je=Ce.context)!=null&&je.open&&!Ce.context.dataRef.current.__outsidePressBubbles){me=!1;return}}),!me)return}r(!1,L,"outside-press")}),N=Us(L=>{var M;const R=()=>{var k;$(L),(k=Bs(L))==null||k.removeEventListener(h,R)};(M=Bs(L))==null||M.addEventListener(h,R)});return p.useEffect(()=>{if(!n||!u)return;c.current.__escapeKeyBubbles=P,c.current.__outsidePressBubbles=T;function L(k){r(!1,k,"ancestor-scroll")}const M=Vi(l);d&&M.addEventListener("keydown",D?I:O,D),b&&M.addEventListener(h,_?N:$,_);let R=[];return y&&(jt(s)&&(R=wo(s)),jt(l)&&(R=R.concat(wo(l))),!jt(i)&&i&&i.contextElement&&(R=R.concat(wo(i.contextElement)))),R=R.filter(k=>{var F;return k!==((F=M.defaultView)==null?void 0:F.visualViewport)}),R.forEach(k=>{k.addEventListener("scroll",L,{passive:!0})}),()=>{d&&M.removeEventListener("keydown",D?I:O,D),b&&M.removeEventListener(h,_?N:$,_),R.forEach(k=>{k.removeEventListener("scroll",L)})}},[c,l,s,i,d,b,h,n,r,y,u,P,T,O,D,I,$,_,N]),p.useEffect(()=>{j.current=!1},[b,h]),p.useMemo(()=>u?{reference:{onKeyDown:O,[u4[g]]:L=>{m&&r(!1,L.nativeEvent,"reference-press")}},floating:{onKeyDown:O,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[d4[h]]:()=>{j.current=!0}}}:{},[u,m,h,g,r,O])}function vy(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:o}=e,[i,s]=p.useState(null),l=((t=e.elements)==null?void 0:t.reference)||i,c=JA(e),u=gy(),d=my()!=null,f=Us((j,E,P)=>{j&&(m.current.openEvent=E),g.emit("openchange",{open:j,event:E,reason:P,nested:d}),r==null||r(j,E,P)}),h=p.useRef(null),m=p.useRef({}),g=p.useState(()=>o4())[0],y=_E(),S=p.useCallback(j=>{const E=jt(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),contextElement:j}:j;c.refs.setReference(E)},[c.refs]),v=p.useCallback(j=>{(jt(j)||j===null)&&(h.current=j,s(j)),(jt(c.refs.reference.current)||c.refs.reference.current===null||j!==null&&!jt(j))&&c.refs.setReference(j)},[c.refs]),x=p.useMemo(()=>({...c.refs,setReference:v,setPositionReference:S,domReference:h}),[c.refs,v,S]),w=p.useMemo(()=>({...c.elements,domReference:l}),[c.elements,l]),b=p.useMemo(()=>({...c,refs:x,elements:w,dataRef:m,nodeId:o,floatingId:y,events:g,open:n,onOpenChange:f}),[c,o,y,g,n,f,x,w]);return So(()=>{const j=u==null?void 0:u.nodesRef.current.find(E=>E.id===o);j&&(j.context=b)}),p.useMemo(()=>({...c,context:b,refs:x,elements:w}),[c,x,w,b])}function h4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,refs:i,elements:{domReference:s}}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=p.useRef(!1),d=p.useRef(),f=p.useRef(!0);return p.useEffect(()=>{if(!l)return;const h=Bn(s);function m(){!n&&Zn(s)&&s===e1(Vi(s))&&(u.current=!0)}function g(){f.current=!0}return h.addEventListener("blur",m),h.addEventListener("keydown",g,!0),()=>{h.removeEventListener("blur",m),h.removeEventListener("keydown",g,!0)}},[s,n,l]),p.useEffect(()=>{if(!l)return;function h(m){let{reason:g}=m;(g==="reference-press"||g==="escape-key")&&(u.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,l]),p.useEffect(()=>()=>{clearTimeout(d.current)},[]),p.useMemo(()=>l?{reference:{onPointerDown(h){lA(h.nativeEvent)||(f.current=!1)},onMouseLeave(){u.current=!1},onFocus(h){if(u.current)return;const m=Bs(h.nativeEvent);if(c&&jt(m))try{if(cA()&&uA())throw Error();if(!m.matches(":focus-visible"))return}catch{if(!f.current&&!mA(m))return}r(!0,h.nativeEvent,"focus")},onBlur(h){u.current=!1;const m=h.relatedTarget,g=jt(m)&&m.hasAttribute(yy("focus-guard"))&&m.getAttribute("data-type")==="outside";d.current=window.setTimeout(()=>{const y=e1(s?s.ownerDocument:document);!m&&y===s||tc(i.floating.current,y)||tc(s,y)||g||r(!1,h.nativeEvent,"focus")})}}}:{},[l,c,s,i,r])}const f1="active",h1="selected";function ep(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[f1]:s,[h1]:l,...c}=e;i=c}return{...n==="floating"&&{tabIndex:-1},...i,...t.map(s=>{const l=s?s[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((s,l)=>(l&&Object.entries(l).forEach(c=>{let[u,d]=c;if(!(o&&[f1,h1].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof d=="function"){var f;(f=r.get(u))==null||f.push(d),s[u]=function(){for(var h,m=arguments.length,g=new Array(m),y=0;y<m;y++)g[y]=arguments[y];return(h=r.get(u))==null?void 0:h.map(S=>S(...g)).find(S=>S!==void 0)}}}else s[u]=d}),s),{})}}function p4(e){e===void 0&&(e=[]);const t=e,n=p.useCallback(i=>ep(i,e,"reference"),t),r=p.useCallback(i=>ep(i,e,"floating"),t),o=p.useCallback(i=>ep(i,e,"item"),e.map(i=>i==null?void 0:i.item));return p.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])}const m4=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function g4(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:s="dialog"}=t,l=(n=m4.get(s))!=null?n:s,c=_E(),d=my()!=null;return p.useMemo(()=>{if(!i)return{};const f={id:o,...l&&{role:l}};return l==="tooltip"||s==="label"?{reference:{["aria-"+(s==="label"?"labelledby":"describedby")]:r?o:void 0},floating:f}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":l==="alertdialog"?"dialog":l,"aria-controls":r?o:void 0,...l==="listbox"&&{role:"combobox"},...l==="menu"&&{id:c},...l==="menu"&&d&&{role:"menuitem"},...s==="select"&&{"aria-autocomplete":"none"},...s==="combobox"&&{"aria-autocomplete":"list"}},floating:{...f,...l==="menu"&&{"aria-labelledby":c}},item(h){let{active:m,selected:g}=h;const y={role:"option",...m&&{id:o+"-option"}};switch(s){case"select":return{...y,"aria-selected":m&&g};case"combobox":return{...y,...m&&{"aria-selected":!0}}}return{}}}},[i,s,l,r,o,c,d])}function OE(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}function p1(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function m1(e,t,n,r,o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const y4={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function v4({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:i,arrowY:s,dir:l}){const[c,u="center"]=e.split("-"),d={width:B(t),height:B(t),transform:"rotate(45deg)",position:"absolute",[y4[c]]:B(r)},f=B(-t/2);return c==="left"?{...d,...p1(u,s,n,o),right:f,borderLeftColor:"transparent",borderBottomColor:"transparent"}:c==="right"?{...d,...p1(u,s,n,o),left:f,borderRightColor:"transparent",borderTopColor:"transparent"}:c==="top"?{...d,...m1(u,i,n,o,l),bottom:f,borderTopColor:"transparent",borderLeftColor:"transparent"}:c==="bottom"?{...d,...m1(u,i,n,o,l),top:f,borderBottomColor:"transparent",borderRightColor:"transparent"}:{}}const xy=p.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:i,arrowX:s,arrowY:l,style:c,...u},d)=>{const{dir:f}=hs();return i?C.createElement("div",{...u,ref:d,style:{...c,...v4({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:f,arrowX:s,arrowY:l})}}):null});xy.displayName="@mantine/core/FloatingArrow";const[x4,ME]=Tn("Popover component was not found in the tree");function yf({children:e,active:t=!0,refProp:n="ref"}){const r=b2(t),o=Zt(r,e==null?void 0:e.ref);return Ao(e)?p.cloneElement(e,{[n]:o}):e}function LE(e){return C.createElement(iy,{tabIndex:-1,"data-autofocus":!0,...e})}yf.displayName="@mantine/core/FocusTrap";LE.displayName="@mantine/core/FocusTrapInitialFocus";yf.InitialFocus=LE;function w4(e){const t=document.createElement("div");return t.setAttribute("data-portal","true"),typeof e.className=="string"&&t.classList.add(...e.className.split(" ").filter(Boolean)),typeof e.style=="object"&&Object.assign(t.style,e.style),typeof e.id=="string"&&t.setAttribute("id",e.id),t}const S4={},$E=p.forwardRef((e,t)=>{const{children:n,target:r,...o}=U("Portal",S4,e),[i,s]=p.useState(!1),l=p.useRef(null);return Oa(()=>(s(!0),l.current=r?typeof r=="string"?document.querySelector(r):r:w4(o),ig(t,l.current),!r&&l.current&&document.body.appendChild(l.current),()=>{!r&&l.current&&document.body.removeChild(l.current)}),[r]),!i||!l.current?null:bc.createPortal(C.createElement(C.Fragment,null,n),l.current)});$E.displayName="@mantine/core/Portal";function ys({withinPortal:e=!0,children:t,...n}){return e?C.createElement($E,{...n},t):C.createElement(C.Fragment,null,t)}ys.displayName="@mantine/core/OptionalPortal";const ul=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${B(e==="bottom"?10:-10)})`},transitionProperty:"transform, opacity"}),ju={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${B(-20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${B(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${B(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${B(20)}) rotate(5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...ul("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...ul("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...ul("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...ul("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...ul("top"),common:{transformOrigin:"top right"}}},g1={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function b4({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in ju?{transitionProperty:ju[e].transitionProperty,...o,...ju[e].common,...ju[e][g1[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[g1[t]]}}function C4({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:i,onEntered:s,onExited:l}){const c=kt(),u=sg(),d=c.respectReducedMotion?u:!1,[f,h]=p.useState(d?0:e),[m,g]=p.useState(r?"entered":"exited"),y=p.useRef(-1),S=p.useRef(-1),v=x=>{const w=x?o:i,b=x?s:l;window.clearTimeout(y.current);const j=d?0:x?e:t;h(j),j===0?(typeof w=="function"&&w(),typeof b=="function"&&b(),g(x?"entered":"exited")):S.current=requestAnimationFrame(()=>{na.flushSync(()=>{g(x?"pre-entering":"pre-exiting")}),S.current=requestAnimationFrame(()=>{typeof w=="function"&&w(),g(x?"entering":"exiting"),y.current=window.setTimeout(()=>{typeof b=="function"&&b(),g(x?"entered":"exited")},j)})})};return Co(()=>{v(r)},[r]),p.useEffect(()=>()=>{window.clearTimeout(y.current),cancelAnimationFrame(S.current)},[]),{transitionDuration:f,transitionStatus:m,transitionTimingFunction:n||"ease"}}function Lo({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:o,children:i,timingFunction:s="ease",onExit:l,onEntered:c,onEnter:u,onExited:d}){const{transitionDuration:f,transitionStatus:h,transitionTimingFunction:m}=C4({mounted:o,exitDuration:r,duration:n,timingFunction:s,onExit:l,onEntered:c,onEnter:u,onExited:d});return f===0?o?C.createElement(C.Fragment,null,i({})):e?i({display:"none"}):null:h==="exited"?e?i({display:"none"}):null:C.createElement(C.Fragment,null,i(b4({transition:t,duration:f,state:h,timingFunction:m})))}Lo.displayName="@mantine/core/Transition";var FE={dropdown:"m-38a85659",arrow:"m-a31dc6c1"};const E4={},wy=Q((e,t)=>{var S,v,x,w;const n=U("PopoverDropdown",E4,e),{className:r,style:o,vars:i,children:s,onKeyDownCapture:l,variant:c,classNames:u,styles:d,...f}=n,h=ME(),m=MS({opened:h.opened,shouldReturnFocus:h.returnFocus}),g=h.withRoles?{"aria-labelledby":h.getTargetId(),id:h.getDropdownId(),role:"dialog",tabIndex:-1}:{},y=Zt(t,h.floating);return h.disabled?null:C.createElement(ys,{...h.portalProps,withinPortal:h.withinPortal},C.createElement(Lo,{mounted:h.opened,...h.transitionProps,transition:((S=h.transitionProps)==null?void 0:S.transition)||"fade",duration:((v=h.transitionProps)==null?void 0:v.duration)??150,keepMounted:h.keepMounted,exitDuration:typeof((x=h.transitionProps)==null?void 0:x.exitDuration)=="number"?h.transitionProps.exitDuration:(w=h.transitionProps)==null?void 0:w.duration},b=>C.createElement(yf,{active:h.trapFocus},C.createElement(W,{...g,...f,variant:c,ref:y,onKeyDownCapture:c2(h.onClose,{active:h.closeOnEscape,onTrigger:m,onKeyDown:l}),"data-position":h.placement,...h.getStyles("dropdown",{className:r,props:n,classNames:u,styles:d,style:[{...b,zIndex:h.zIndex,top:h.y??0,left:h.x??0,width:h.width==="target"?void 0:B(h.width)},o]})},s,C.createElement(xy,{ref:h.arrowRef,arrowX:h.arrowX,arrowY:h.arrowY,visible:h.withArrow,position:h.placement,arrowSize:h.arrowSize,arrowRadius:h.arrowRadius,arrowOffset:h.arrowOffset,arrowPosition:h.arrowPosition,...h.getStyles("arrow",{props:n,classNames:u,styles:d})})))))});wy.classes=FE;wy.displayName="@mantine/core/PopoverDropdown";const j4={refProp:"ref",popupType:"dialog"},zE=Q((e,t)=>{const{children:n,refProp:r,popupType:o,...i}=U("PopoverTarget",j4,e);if(!Ao(n))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const s=i,l=ME(),c=Zt(l.reference,n.ref,t),u=l.withRoles?{"aria-haspopup":o,"aria-expanded":l.opened,"aria-controls":l.getDropdownId(),id:l.getTargetId()}:{};return p.cloneElement(n,{...s,...u,...l.targetProps,className:et(l.targetProps.className,s.className,n.props.className),[r]:c,...l.controlled?null:{onClick:l.onToggle}})});zE.displayName="@mantine/core/PopoverTarget";function BE({opened:e,floating:t,position:n,positionDependencies:r}){const[o,i]=p.useState(0);p.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return QA(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Co(()=>{t.update()},r),Co(()=>{i(s=>s+1)},[e])}function P4(e,t){var r,o,i,s;const n=[SE(e.offset)];return(r=e.middlewares)!=null&&r.shift&&n.push(py({limiter:YA()})),(o=e.middlewares)!=null&&o.flip&&n.push(kE()),(i=e.middlewares)!=null&&i.inline&&n.push(RE()),n.push(DE({element:e.arrowRef,padding:e.arrowOffset})),((s=e.middlewares)!=null&&s.size||e.width==="target")&&n.push(KA({apply({rects:l,availableWidth:c,availableHeight:u}){var h,m;const f=((h=t().refs.floating.current)==null?void 0:h.style)??{};(m=e.middlewares)!=null&&m.size&&Object.assign(f,{maxWidth:`${c}px`,maxHeight:`${u}px`}),e.width==="target"&&Object.assign(f,{width:`${l.reference.width}px`})}})),n}function T4(e){const[t,n]=gn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var s;t&&((s=e.onClose)==null||s.call(e),n(!1))},o=()=>{var s,l;t?((s=e.onClose)==null||s.call(e),n(!1)):((l=e.onOpen)==null||l.call(e),n(!0))},i=vy({strategy:e.strategy,placement:e.position,middleware:P4(e,()=>i)});return BE({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies||[],floating:i}),Co(()=>{var s;(s=e.onPositionChange)==null||s.call(e,i.placement)},[i.placement]),Co(()=>{var s,l;e.opened?(l=e.onOpen)==null||l.call(e):(s=e.onClose)==null||s.call(e)},[e.opened]),{floating:i,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const k4={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:zr("popover"),__staticSelector:"Popover",width:"max-content"},R4=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:gt(t),"--popover-shadow":ng(n)}});function Br(e){var ln,br,en,uo,re,De;const t=U("Popover",k4,e),{children:n,position:r,offset:o,onPositionChange:i,positionDependencies:s,opened:l,transitionProps:c,width:u,middlewares:d,withArrow:f,arrowSize:h,arrowOffset:m,arrowRadius:g,arrowPosition:y,unstyled:S,classNames:v,styles:x,closeOnClickOutside:w,withinPortal:b,portalProps:j,closeOnEscape:E,clickOutsideEvents:P,trapFocus:T,onClose:D,onOpen:_,onChange:O,zIndex:I,radius:$,shadow:N,id:L,defaultOpened:M,__staticSelector:R,withRoles:k,disabled:F,returnFocus:q,variant:G,keepMounted:oe,vars:xe,floatingStrategy:me,...Ce}=t,je=de({name:R,props:t,classes:FE,classNames:v,styles:x,unstyled:S,rootSelector:"dropdown",vars:xe,varsResolver:R4}),Be=p.useRef(null),[Me,Ke]=p.useState(null),[St,X]=p.useState(null),{dir:ke}=hs(),tt=kn(L),Ne=T4({middlewares:d,width:u,position:OE(ke,r),offset:typeof o=="number"?o+(f?h/2:0):o,arrowRef:Be,arrowOffset:m,onPositionChange:i,positionDependencies:s,opened:l,defaultOpened:M,onChange:O,onOpen:_,onClose:D,strategy:me});f2(()=>w&&Ne.onClose(),P,[Me,St]);const Ve=p.useCallback(qe=>{Ke(qe),Ne.floating.refs.setReference(qe)},[Ne.floating.refs.setReference]),Rt=p.useCallback(qe=>{X(qe),Ne.floating.refs.setFloating(qe)},[Ne.floating.refs.setFloating]);return C.createElement(x4,{value:{returnFocus:q,disabled:F,controlled:Ne.controlled,reference:Ve,floating:Rt,x:Ne.floating.x,y:Ne.floating.y,arrowX:(en=(br=(ln=Ne.floating)==null?void 0:ln.middlewareData)==null?void 0:br.arrow)==null?void 0:en.x,arrowY:(De=(re=(uo=Ne.floating)==null?void 0:uo.middlewareData)==null?void 0:re.arrow)==null?void 0:De.y,opened:Ne.opened,arrowRef:Be,transitionProps:c,width:u,withArrow:f,arrowSize:h,arrowOffset:m,arrowRadius:g,arrowPosition:y,placement:Ne.floating.placement,trapFocus:T,withinPortal:b,portalProps:j,zIndex:I,radius:$,shadow:N,closeOnEscape:E,onClose:Ne.onClose,onToggle:Ne.onToggle,getTargetId:()=>`${tt}-target`,getDropdownId:()=>`${tt}-dropdown`,withRoles:k,targetProps:Ce,__staticSelector:R,classNames:v,styles:x,unstyled:S,variant:G,keepMounted:oe,getStyles:je}},n)}Br.Target=zE;Br.Dropdown=wy;Br.displayName="@mantine/core/Popover";Br.extend=e=>e;var Ir={root:"m-5ae2e3c",barsLoader:"m-7a2bd4cd",bar:"m-870bb79","bars-loader-animation":"m-5d2b3b9d",dotsLoader:"m-4e3f22d7",dot:"m-870c4af","loader-dots-animation":"m-aac34a1",ovalLoader:"m-b34414df","oval-loader-animation":"m-f8e89c4b"};const D4=p.forwardRef(({className:e,...t},n)=>C.createElement(W,{component:"span",className:et(Ir.barsLoader,e),...t,ref:n},C.createElement("span",{className:Ir.bar}),C.createElement("span",{className:Ir.bar}),C.createElement("span",{className:Ir.bar}))),I4=p.forwardRef(({className:e,...t},n)=>C.createElement(W,{component:"span",className:et(Ir.dotsLoader,e),...t,ref:n},C.createElement("span",{className:Ir.dot}),C.createElement("span",{className:Ir.dot}),C.createElement("span",{className:Ir.dot}))),_4=p.forwardRef(({className:e,...t},n)=>C.createElement(W,{component:"span",className:et(Ir.ovalLoader,e),...t,ref:n})),UE={bars:D4,oval:_4,dots:I4},A4={loaders:UE,type:"oval"},N4=(e,{size:t,color:n})=>({root:{"--loader-size":Pe(t,"loader-size"),"--loader-color":n?mt(n,e):void 0}}),Vn=Q((e,t)=>{const n=U("Loader",A4,e),{size:r,color:o,type:i,vars:s,className:l,style:c,classNames:u,styles:d,unstyled:f,loaders:h,variant:m,children:g,...y}=n,S=de({name:"Loader",props:n,classes:Ir,className:l,style:c,classNames:u,styles:d,unstyled:f,vars:s,varsResolver:N4});return g?C.createElement(W,{...S("root"),ref:t,...y},g):C.createElement(W,{...S("root"),ref:t,component:h[i],variant:m,size:r,...y})});Vn.defaultLoaders=UE;Vn.classes=Ir;Vn.displayName="@mantine/core/Loader";var vf={root:"m-8d3f4000",icon:"m-8d3afb97",loader:"m-302b9fb1",group:"m-1a0f1b21"};const y1={orientation:"horizontal"},O4=(e,{borderWidth:t})=>({group:{"--ai-border-width":B(t)}}),Sy=Q((e,t)=>{const n=U("ActionIconGroup",y1,e),{className:r,style:o,classNames:i,styles:s,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...m}=U("ActionIconGroup",y1,e),g=de({name:"ActionIconGroup",props:n,classes:vf,className:r,style:o,classNames:i,styles:s,unstyled:l,vars:u,varsResolver:O4,rootSelector:"group"});return C.createElement(W,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...m})});Sy.classes=vf;Sy.displayName="@mantine/core/ActionIconGroup";const M4={},L4=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:s})=>{const l=e.variantColorResolver({color:i||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:s});return{root:{"--ai-size":Pe(t,"ai-size"),"--ai-radius":n===void 0?void 0:gt(n),"--ai-bg":i||r?l.background:void 0,"--ai-hover":i||r?l.hover:void 0,"--ai-hover-color":i||r?l.hoverColor:void 0,"--ai-color":l.color,"--ai-bd":i||r?l.border:void 0}}},qt=vn((e,t)=>{const n=U("ActionIcon",M4,e),{className:r,unstyled:o,variant:i,classNames:s,styles:l,style:c,loading:u,loaderProps:d,size:f,color:h,radius:m,__staticSelector:g,gradient:y,vars:S,children:v,disabled:x,"data-disabled":w,autoContrast:b,mod:j,...E}=n,P=de({name:["ActionIcon",g],props:n,className:r,style:c,classes:vf,classNames:s,styles:l,unstyled:o,vars:S,varsResolver:L4});return C.createElement(Jn,{...P("root",{active:!x&&!u&&!w}),...E,unstyled:o,variant:i,size:f,disabled:x||u,ref:t,mod:[{loading:u,disabled:x||w},j]},C.createElement(Lo,{mounted:!!u,transition:"slide-down",duration:150},T=>C.createElement(W,{component:"span",...P("loader",{style:T}),"aria-hidden":!0},C.createElement(Vn,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...d}))),C.createElement(W,{component:"span",mod:{loading:u},...P("icon")},v))});qt.classes=vf;qt.displayName="@mantine/core/ActionIcon";qt.Group=Sy;const VE=p.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>C.createElement("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:r,...n},C.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})));VE.displayName="@mantine/core/CloseIcon";var WE={root:"m-86a44da5","root--subtle":"m-220c80f2"};const $4={variant:"subtle"},F4=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":Pe(t,"cb-size"),"--cb-radius":n===void 0?void 0:gt(n),"--cb-icon-size":B(r)}}),vs=vn((e,t)=>{const n=U("CloseButton",$4,e),{iconSize:r,children:o,vars:i,radius:s,className:l,classNames:c,style:u,styles:d,unstyled:f,"data-disabled":h,disabled:m,variant:g,icon:y,mod:S,...v}=n,x=de({name:"CloseButton",props:n,className:l,style:u,classes:WE,classNames:c,styles:d,unstyled:f,vars:i,varsResolver:F4});return C.createElement(Jn,{ref:t,...v,unstyled:f,variant:g,disabled:m,mod:[{disabled:m||h},S],...x("root",{variant:g,active:!0})},y||C.createElement(VE,null),o)});vs.classes=WE;vs.displayName="@mantine/core/CloseButton";function z4(e){return p.Children.toArray(e).filter(Boolean)}var HE={root:"m-4081bf90"};const B4={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},U4=(e,{grow:t,preventGrowOverflow:n,gap:r,align:o,justify:i,wrap:s},{childWidth:l})=>({root:{"--group-child-width":t&&n?l:void 0,"--group-gap":rn(r),"--group-align":o,"--group-justify":i,"--group-wrap":s}}),Y=Q((e,t)=>{const n=U("Group",B4,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,children:c,gap:u,align:d,justify:f,wrap:h,grow:m,preventGrowOverflow:g,vars:y,variant:S,__size:v,mod:x,...w}=n,b=z4(c),j=b.length,E=rn(u??"md"),T={childWidth:`calc(${100/j}% - (${E} - ${E} / ${j}))`},D=de({name:"Group",props:n,stylesCtx:T,className:o,style:i,classes:HE,classNames:r,styles:s,unstyled:l,vars:y,varsResolver:U4});return C.createElement(W,{...D("root"),ref:t,variant:S,mod:[{grow:m},x],size:v,...w},b)});Y.classes=HE;Y.displayName="@mantine/core/Group";var qE={root:"m-9814e45f"};const V4={zIndex:zr("modal")},W4=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:i,zIndex:s})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&nn(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${B(o)})`:void 0,"--overlay-radius":i===void 0?void 0:gt(i),"--overlay-z-index":s==null?void 0:s.toString()}}),nc=vn((e,t)=>{const n=U("Overlay",V4,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,fixed:u,center:d,children:f,radius:h,zIndex:m,gradient:g,blur:y,color:S,backgroundOpacity:v,mod:x,...w}=n,b=de({name:"Overlay",props:n,classes:qE,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:W4});return C.createElement(W,{ref:t,...b("root"),mod:[{center:d,fixed:u},x],...w},f)});nc.classes=qE;nc.displayName="@mantine/core/Overlay";const[H4,$o]=Tn("ModalBase component was not found in tree");function q4({opened:e,transitionDuration:t}){const[n,r]=p.useState(e),o=p.useRef(),s=sg()?0:t;return p.useEffect(()=>(e?(r(!0),window.clearTimeout(o.current)):s===0?r(!1):o.current=window.setTimeout(()=>r(!1),s),()=>window.clearTimeout(o.current)),[e,s]),n}function G4({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:i,returnFocus:s}){const l=kn(e),[c,u]=p.useState(!1),[d,f]=p.useState(!1),h=typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200,m=q4({opened:n,transitionDuration:h});return zS("keydown",g=>{var y;g.key==="Escape"&&o&&((y=g.target)==null?void 0:y.getAttribute("data-mantine-stop-propagation"))!=="true"&&i()},{capture:!0}),MS({opened:n,shouldReturnFocus:r&&s}),{_id:l,titleMounted:c,bodyMounted:d,shouldLockScroll:m,setTitleMounted:u,setBodyMounted:f}}const Q4=p.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:o,trapFocus:i,closeOnEscape:s,returnFocus:l,closeOnClickOutside:c,withinPortal:u,portalProps:d,lockScroll:f,children:h,zIndex:m,shadow:g,padding:y,__vars:S,unstyled:v,removeScrollProps:x,...w},b)=>{const{_id:j,titleMounted:E,bodyMounted:P,shouldLockScroll:T,setTitleMounted:D,setBodyMounted:_}=G4({id:r,transitionProps:o,opened:t,trapFocus:i,closeOnEscape:s,onClose:n,returnFocus:l});return C.createElement(ys,{...d,withinPortal:u},C.createElement(H4,{value:{opened:t,onClose:n,closeOnClickOutside:c,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${j}-title`,getBodyId:()=>`${j}-body`,titleMounted:E,bodyMounted:P,setTitleMounted:D,setBodyMounted:_,trapFocus:i,closeOnEscape:s,zIndex:m,unstyled:v}},C.createElement(Kd,{enabled:T&&f,...x},C.createElement(W,{ref:b,...w,__vars:{...S,"--mb-z-index":(m||zr("modal")).toString(),"--mb-shadow":ng(g),"--mb-padding":rn(y)}},h))))});function K4(){const e=$o();return p.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Pa={title:"m-615af6c9",header:"m-b5489c3c",inner:"m-60c222c7",content:"m-fd1ab0aa",close:"m-606cb269",body:"m-5df29311"};const GE=p.forwardRef(({className:e,...t},n)=>{const r=K4(),o=$o();return C.createElement(W,{ref:n,...t,id:r,className:et({[Pa.body]:!o.unstyled},e)})});GE.displayName="@mantine/core/ModalBaseBody";const QE=p.forwardRef(({className:e,onClick:t,...n},r)=>{const o=$o();return C.createElement(vs,{ref:r,...n,onClick:i=>{o.onClose(),t==null||t(i)},className:et({[Pa.close]:!o.unstyled},e),unstyled:o.unstyled})});QE.displayName="@mantine/core/ModalBaseCloseButton";const Y4=p.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...i},s)=>{const l=$o();return C.createElement(Lo,{mounted:l.opened,transition:"pop",...l.transitionProps,...e},c=>C.createElement("div",{...n,className:et({[Pa.inner]:!l.unstyled},n.className)},C.createElement(yf,{active:l.opened&&l.trapFocus},C.createElement(zn,{...i,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":l.bodyMounted?l.getBodyId():void 0,"aria-labelledby":l.titleMounted?l.getTitleId():void 0,ref:s,style:[o,c],className:et({[Pa.content]:!l.unstyled},t),unstyled:l.unstyled},i.children))))}),KE=p.forwardRef(({className:e,...t},n)=>{const r=$o();return C.createElement(W,{component:"header",ref:n,className:et({[Pa.header]:!r.unstyled},e),...t})});KE.displayName="@mantine/core/ModalBaseHeader";const X4={duration:200,timingFunction:"ease",transition:"fade"};function J4(e){const t=$o();return{...X4,...t.transitionProps,...e}}const YE=p.forwardRef(({onClick:e,transitionProps:t,style:n,...r},o)=>{const i=$o(),s=J4(t);return C.createElement(Lo,{mounted:i.opened,...s,transition:"fade"},l=>C.createElement(nc,{ref:o,fixed:!0,style:[n,l],zIndex:i.zIndex,unstyled:i.unstyled,onClick:c=>{e==null||e(c),i.closeOnClickOutside&&i.onClose()},...r}))});YE.displayName="@mantine/core/ModalBaseOverlay";function Z4(){const e=$o();return p.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const XE=p.forwardRef(({className:e,...t},n)=>{const r=Z4(),o=$o();return C.createElement(W,{component:"h2",ref:n,className:et({[Pa.title]:!o.unstyled},e),...t,id:r})});XE.displayName="@mantine/core/ModalBaseTitle";function eN({children:e}){return C.createElement(C.Fragment,null,e)}const[tN,Ba]=mc({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var xr={wrapper:"m-6c018570",input:"m-8fb7ebe7",section:"m-82577fc2",placeholder:"m-88bacfd0",root:"m-46b77525",label:"m-8fdc1311",required:"m-78a94662",error:"m-8f816625",description:"m-fe47ce59"};const v1={},nN=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${Kt(t)} - ${B(2)})`}}),xf=Q((e,t)=>{const n=U("InputDescription",v1,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,__staticSelector:d,__inheritStyles:f=!0,variant:h,...m}=U("InputDescription",v1,n),g=Ba(),y=de({name:["InputWrapper",d],props:n,classes:xr,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"description",vars:c,varsResolver:nN}),S=f&&(g==null?void 0:g.getStyles)||y;return C.createElement(W,{component:"p",ref:t,variant:h,size:u,...S("description",g!=null&&g.getStyles?{className:o,style:i}:void 0),...m})});xf.classes=xr;xf.displayName="@mantine/core/InputDescription";const rN={},oN=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${Kt(t)} - ${B(2)})`}}),wf=Q((e,t)=>{const n=U("InputError",rN,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,__staticSelector:d,__inheritStyles:f=!0,variant:h,...m}=n,g=de({name:["InputWrapper",d],props:n,classes:xr,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"error",vars:c,varsResolver:oN}),y=Ba(),S=f&&(y==null?void 0:y.getStyles)||g;return C.createElement(W,{component:"p",ref:t,variant:h,size:u,...S("error",y!=null&&y.getStyles?{className:o,style:i}:void 0),...m})});wf.classes=xr;wf.displayName="@mantine/core/InputError";const x1={labelElement:"label"},iN=(e,{size:t})=>({label:{"--input-label-size":Kt(t),"--input-asterisk-color":void 0}}),Sf=Q((e,t)=>{const n=U("InputLabel",x1,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,labelElement:u,size:d,required:f,htmlFor:h,onMouseDown:m,children:g,__staticSelector:y,variant:S,mod:v,...x}=U("InputLabel",x1,n),w=de({name:["InputWrapper",y],props:n,classes:xr,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"label",vars:c,varsResolver:iN}),b=Ba(),j=(b==null?void 0:b.getStyles)||w;return C.createElement(W,{...j("label",b!=null&&b.getStyles?{className:o,style:i}:void 0),component:u,variant:S,size:d,ref:t,htmlFor:u==="label"?h:void 0,mod:[{required:f},v],onMouseDown:E=>{m==null||m(E),!E.defaultPrevented&&E.detail>1&&E.preventDefault()},...x},g,f&&C.createElement("span",{...j("required"),"aria-hidden":!0}," *"))});Sf.classes=xr;Sf.displayName="@mantine/core/InputLabel";const w1={},by=Q((e,t)=>{const n=U("InputPlaceholder",w1,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,__staticSelector:u,variant:d,error:f,mod:h,...m}=U("InputPlaceholder",w1,n),g=de({name:["InputPlaceholder",u],props:n,classes:xr,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"placeholder"});return C.createElement(W,{...g("placeholder"),mod:[{error:!!f},h],component:"span",variant:d,ref:t,...m})});by.classes=xr;by.displayName="@mantine/core/InputPlaceholder";function sN(e,{hasDescription:t,hasError:n}){const r=e.findIndex(c=>c==="input"),o=e[r-1],i=e[r+1];return{offsetBottom:t&&i==="description"||n&&i==="error",offsetTop:t&&o==="description"||n&&o==="error"}}const aN={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},lN=(e,{size:t})=>({label:{"--input-label-size":Kt(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${Kt(t)} - ${B(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${Kt(t)} - ${B(2)})`}}),Cy=Q((e,t)=>{const n=U("InputWrapper",aN,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,variant:d,__staticSelector:f,inputContainer:h,inputWrapperOrder:m,label:g,error:y,description:S,labelProps:v,descriptionProps:x,errorProps:w,labelElement:b,children:j,withAsterisk:E,id:P,required:T,__stylesApiProps:D,mod:_,...O}=n,I=de({name:["InputWrapper",f],props:D||n,classes:xr,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:lN}),$={size:u,variant:d,__staticSelector:f},N=kn(P),L=typeof E=="boolean"?E:T,M=(w==null?void 0:w.id)||`${N}-error`,R=(x==null?void 0:x.id)||`${N}-description`,k=N,F=!!y&&typeof y!="boolean",q=!!S,G=`${F?M:""} ${q?R:""}`,oe=G.trim().length>0?G.trim():void 0,xe=(v==null?void 0:v.id)||`${N}-label`,me=g&&C.createElement(Sf,{key:"label",labelElement:b,id:xe,htmlFor:k,required:L,...$,...v},g),Ce=q&&C.createElement(xf,{key:"description",...x,...$,size:(x==null?void 0:x.size)||$.size,id:(x==null?void 0:x.id)||R},S),je=C.createElement(C.Fragment,{key:"input"},h(j)),Be=F&&C.createElement(wf,{...w,...$,size:(w==null?void 0:w.size)||$.size,key:"error",id:(w==null?void 0:w.id)||M},y),Me=m.map(Ke=>{switch(Ke){case"label":return me;case"input":return je;case"description":return Ce;case"error":return Be;default:return null}});return C.createElement(tN,{value:{getStyles:I,describedBy:oe,inputId:k,labelId:xe,...sN(m,{hasDescription:q,hasError:F})}},C.createElement(W,{ref:t,variant:d,size:u,mod:[{error:!!y},_],...I("root"),...O},Me))});Cy.classes=xr;Cy.displayName="@mantine/core/InputWrapper";const cN={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},uN=(e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":n.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":Pe(t.size,"input-height"),"--input-fz":Kt(t.size),"--input-radius":t.radius===void 0?void 0:gt(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?B(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?B(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?Pe(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),Ct=vn((e,t)=>{const n=U("Input",cN,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,required:c,__staticSelector:u,__stylesApiProps:d,size:f,wrapperProps:h,error:m,disabled:g,leftSection:y,leftSectionProps:S,leftSectionWidth:v,rightSection:x,rightSectionProps:w,rightSectionWidth:b,rightSectionPointerEvents:j,leftSectionPointerEvents:E,variant:P,vars:T,pointer:D,multiline:_,radius:O,id:I,withAria:$,withErrorStyles:N,mod:L,...M}=n,{styleProps:R,rest:k}=No(M),F=Ba(),q={offsetBottom:F==null?void 0:F.offsetBottom,offsetTop:F==null?void 0:F.offsetTop},G=de({name:["Input",u],props:d||n,classes:xr,className:o,style:i,classNames:r,styles:s,unstyled:l,stylesCtx:q,rootSelector:"wrapper",vars:T,varsResolver:uN}),oe=$?{required:c,disabled:g,"aria-invalid":!!m,"aria-describedby":F==null?void 0:F.describedBy,id:(F==null?void 0:F.inputId)||I}:{};return C.createElement(W,{...G("wrapper"),...R,...h,mod:[{error:!!m&&N,pointer:D,disabled:g,multiline:_,"data-with-right-section":!!x,"data-with-left-section":!!y},L],variant:P,size:f},y&&C.createElement("div",{...S,"data-position":"left",...G("section",{className:S==null?void 0:S.className,style:S==null?void 0:S.style})},y),C.createElement(W,{component:"input",...k,...oe,ref:t,required:c,mod:{disabled:g,error:!!m&&N},variant:P,...G("input")}),x&&C.createElement("div",{...w,"data-position":"right",...G("section",{className:w==null?void 0:w.className,style:w==null?void 0:w.style})},x))});Ct.classes=xr;Ct.Wrapper=Cy;Ct.Label=Sf;Ct.Error=wf;Ct.Description=xf;Ct.Placeholder=by;Ct.displayName="@mantine/core/Input";function dN(e,t,n){const r=U(e,t,n),{label:o,description:i,error:s,required:l,classNames:c,styles:u,className:d,unstyled:f,__staticSelector:h,__stylesApiProps:m,errorProps:g,labelProps:y,descriptionProps:S,wrapperProps:v,id:x,size:w,style:b,inputContainer:j,inputWrapperOrder:E,withAsterisk:P,variant:T,vars:D,mod:_,...O}=r,{styleProps:I,rest:$}=No(O),N={label:o,description:i,error:s,required:l,classNames:c,className:d,__staticSelector:h,__stylesApiProps:m||r,errorProps:g,labelProps:y,descriptionProps:S,unstyled:f,styles:u,size:w,style:b,inputContainer:j,inputWrapperOrder:E,withAsterisk:P,variant:T,id:x,mod:_,...v};return{...$,classNames:c,styles:u,unstyled:f,wrapperProps:{...N,...I},inputProps:{required:l,classNames:c,styles:u,unstyled:f,size:w,__staticSelector:h,__stylesApiProps:m||r,error:s,variant:T,id:x}}}const fN={__staticSelector:"InputBase",withAria:!0},wr=vn((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=dN("InputBase",fN,e);return C.createElement(Ct.Wrapper,{...r},C.createElement(Ct,{...n,...o,ref:t}))});wr.classes={...Ct.classes,...Ct.Wrapper.classes};wr.displayName="@mantine/core/InputBase";const hN={gap:{type:"spacing",property:"gap"},rowGap:{type:"spacing",property:"rowGap"},columnGap:{type:"spacing",property:"columnGap"},align:{type:"identity",property:"alignItems"},justify:{type:"identity",property:"justifyContent"},wrap:{type:"identity",property:"flexWrap"},direction:{type:"identity",property:"flexDirection"}};var JE={root:"m-8bffd616"};const pN={},rs=vn((e,t)=>{const n=U("Flex",pN,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,gap:u,rowGap:d,columnGap:f,align:h,justify:m,wrap:g,direction:y,...S}=n,v=de({name:"Flex",classes:JE,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c}),x=kt(),w=yc(),b=QS({styleProps:{gap:u,rowGap:d,columnGap:f,align:h,justify:m,wrap:g,direction:y},theme:x,data:hN});return C.createElement(C.Fragment,null,b.hasResponsiveStyles&&C.createElement(La,{selector:`.${w}`,styles:b.styles,media:b.media}),C.createElement(W,{ref:t,...v("root",{className:w,style:ds(b.inlineStyles)}),...S}))});rs.classes=JE;rs.displayName="@mantine/core/Flex";var ZE={root:"m-66836ed3",wrapper:"m-a5d60502",body:"m-667c2793",title:"m-6a03f287",label:"m-698f4f23",icon:"m-667f2a6a",message:"m-7fa78076",closeButton:"m-87f54839"};const mN={},gN=(e,{radius:t,color:n,variant:r,autoContrast:o})=>{const i=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:o});return{root:{"--alert-radius":t===void 0?void 0:gt(t),"--alert-bg":n||r?i.background:void 0,"--alert-color":i.color,"--alert-bd":n||r?i.border:void 0}}},xs=Q((e,t)=>{const n=U("Alert",mN,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,radius:u,color:d,title:f,children:h,id:m,icon:g,withCloseButton:y,onClose:S,closeButtonLabel:v,variant:x,autoContrast:w,...b}=n,j=de({name:"Alert",classes:ZE,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:gN}),E=kn(m),P=f&&`${E}-title`||void 0,T=`${E}-body`;return C.createElement(W,{id:E,...j("root",{variant:x}),variant:x,ref:t,...b,role:"alert","aria-describedby":T,"aria-labelledby":P},C.createElement("div",{...j("wrapper")},g&&C.createElement("div",{...j("icon")},g),C.createElement("div",{...j("body")},f&&C.createElement("div",{...j("title"),"data-with-close-button":y||void 0},C.createElement("span",{id:P,...j("label")},f)),h&&C.createElement("div",{id:T,...j("message"),"data-variant":x},h)),y&&C.createElement(vs,{...j("closeButton"),onClick:S,variant:"transparent",size:16,iconSize:16,"aria-label":v,unstyled:l})))});xs.classes=ZE;xs.displayName="@mantine/core/Alert";var ej={root:"m-b6d8b162"};function yN(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const vN={inherit:!1},xN=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:i})=>({root:{"--text-fz":Kt(o),"--text-lh":AS(o),"--text-gradient":t==="gradient"?wp(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":i?mt(i,e):void 0}}),se=vn((e,t)=>{const n=U("Text",vN,e),{lineClamp:r,truncate:o,inline:i,inherit:s,gradient:l,span:c,__staticSelector:u,vars:d,className:f,style:h,classNames:m,styles:g,unstyled:y,variant:S,mod:v,size:x,...w}=n,b=de({name:["Text",u],props:n,classes:ej,className:f,style:h,classNames:m,styles:g,unstyled:y,vars:d,varsResolver:xN});return C.createElement(W,{...b("root",{focusable:!0}),ref:t,component:c?"span":"p",variant:S,mod:[{"data-truncate":yN(o),"data-line-clamp":typeof r=="number","data-inline":i,"data-inherit":s},v],size:x,...w})});se.classes=ej;se.displayName="@mantine/core/Text";var tj={root:"m-849cf0da"};const wN={underline:"hover"},He=vn((e,t)=>{const{underline:n,className:r,unstyled:o,mod:i,...s}=U("Anchor",wN,e);return C.createElement(se,{component:"a",ref:t,className:et({[tj.root]:!o},r),...s,mod:[{underline:n},i],__staticSelector:"Anchor",unstyled:o})});He.classes=tj;He.displayName="@mantine/core/Anchor";const[SN,Ua]=Tn("AppShell was not found in tree");var ji={root:"m-89ab340",navbar:"m-45252eee",aside:"m-9cdde9a",header:"m-3b16f56b",main:"m-8983817",footer:"m-3840c879",section:"m-6dcfc7c7"};const bN={},Ey=Q((e,t)=>{const n=U("AppShellAside",bN,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=Ua();return m.disabled?null:C.createElement(W,{component:"aside",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("aside",{className:o,classNames:r,styles:s,style:i}),...h,__vars:{"--app-shell-aside-z-index":`calc(${d??m.zIndex} + 1)`}})});Ey.classes=ji;Ey.displayName="@mantine/core/AppShellAside";const CN={},jy=Q((e,t)=>{var g;const n=U("AppShellFooter",CN,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=Ua();return m.disabled?null:C.createElement(W,{component:"footer",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("footer",{className:et({[Kd.classNames.zeroRight]:m.offsetScrollbars},o),classNames:r,styles:s,style:i}),...h,__vars:{"--app-shell-footer-z-index":(g=d??m.zIndex)==null?void 0:g.toString()}})});jy.classes=ji;jy.displayName="@mantine/core/AppShellFooter";const EN={},Py=Q((e,t)=>{var g;const n=U("AppShellHeader",EN,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=Ua();return m.disabled?null:C.createElement(W,{component:"header",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("header",{className:et({[Kd.classNames.zeroRight]:m.offsetScrollbars},o),classNames:r,styles:s,style:i}),...h,__vars:{"--app-shell-header-z-index":(g=d??m.zIndex)==null?void 0:g.toString()}})});Py.classes=ji;Py.displayName="@mantine/core/AppShellHeader";const jN={},Ty=Q((e,t)=>{const n=U("AppShellMain",jN,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Ua();return C.createElement(W,{component:"main",ref:t,...u.getStyles("main",{className:o,style:i,classNames:r,styles:s}),...c})});Ty.classes=ji;Ty.displayName="@mantine/core/AppShellMain";function Ec(e){return typeof e=="object"?e.base:e}function jc(e){const t=typeof e=="object"&&e!==null&&typeof e.base<"u"&&Object.keys(e).length===1;return typeof e=="number"||typeof e=="string"||t}function Pc(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function PN({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:o}){var c,u,d;const i=r==null?void 0:r.width,s="translateX(var(--app-shell-aside-width))",l="translateX(calc(var(--app-shell-aside-width) * -1))";if(r!=null&&r.breakpoint&&!((c=r==null?void 0:r.collapsed)!=null&&c.mobile)&&(n[r==null?void 0:r.breakpoint]=n[r==null?void 0:r.breakpoint]||{},n[r==null?void 0:r.breakpoint]["--app-shell-aside-width"]="100%",n[r==null?void 0:r.breakpoint]["--app-shell-aside-offset"]="0px"),jc(i)){const f=B(Ec(i));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(Pc(i)&&(typeof i.base<"u"&&(e["--app-shell-aside-width"]=B(i.base),e["--app-shell-aside-offset"]=B(i.base)),pt(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-aside-width"]=B(i[f]),t[f]["--app-shell-aside-offset"]=B(i[f]))})),(u=r==null?void 0:r.collapsed)!=null&&u.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-aside-transform"]=s,t[f]["--app-shell-aside-transform-rtl"]=l,t[f]["--app-shell-aside-offset"]="0px !important"}if((d=r==null?void 0:r.collapsed)!=null&&d.mobile){const f=rg(r.breakpoint,o)-.1;n[f]=n[f]||{},n[f]["--app-shell-aside-width"]="100%",n[f]["--app-shell-aside-offset"]="0px",n[f]["--app-shell-aside-transform"]=s,n[f]["--app-shell-aside-transform-rtl"]=l}}function TN({baseStyles:e,minMediaStyles:t,footer:n}){const r=n==null?void 0:n.height,o="translateY(var(--app-shell-footer-height))",i=(n==null?void 0:n.offset)??!0;if(jc(r)){const s=B(Ec(r));e["--app-shell-footer-height"]=s,i&&(e["--app-shell-footer-offset"]=s)}Pc(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=B(r.base),i&&(e["--app-shell-footer-offset"]=B(r.base))),pt(r).forEach(s=>{s!=="base"&&(t[s]=t[s]||{},t[s]["--app-shell-footer-height"]=B(r[s]),i&&(t[s]["--app-shell-footer-offset"]=B(r[s])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=o,e["--app-shell-footer-offset"]="0px !important")}function kN({baseStyles:e,minMediaStyles:t,header:n}){const r=n==null?void 0:n.height,o="translateY(calc(var(--app-shell-header-height) * -1))",i=(n==null?void 0:n.offset)??!0;if(jc(r)){const s=B(Ec(r));e["--app-shell-header-height"]=s,i&&(e["--app-shell-header-offset"]=s)}Pc(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=B(r.base),i&&(e["--app-shell-header-offset"]=B(r.base))),pt(r).forEach(s=>{s!=="base"&&(t[s]=t[s]||{},t[s]["--app-shell-header-height"]=B(r[s]),i&&(t[s]["--app-shell-header-offset"]=B(r[s])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=o,e["--app-shell-header-offset"]="0px !important")}function RN({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:o}){var c,u,d;const i=r==null?void 0:r.width,s="translateX(calc(var(--app-shell-navbar-width) * -1))",l="translateX(var(--app-shell-navbar-width))";if(r!=null&&r.breakpoint&&!((c=r==null?void 0:r.collapsed)!=null&&c.mobile)&&(n[r==null?void 0:r.breakpoint]=n[r==null?void 0:r.breakpoint]||{},n[r==null?void 0:r.breakpoint]["--app-shell-navbar-width"]="100%",n[r==null?void 0:r.breakpoint]["--app-shell-navbar-offset"]="0px"),jc(i)){const f=B(Ec(i));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(Pc(i)&&(typeof i.base<"u"&&(e["--app-shell-navbar-width"]=B(i.base),e["--app-shell-navbar-offset"]=B(i.base)),pt(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-navbar-width"]=B(i[f]),t[f]["--app-shell-navbar-offset"]=B(i[f]))})),(u=r==null?void 0:r.collapsed)!=null&&u.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-navbar-transform"]=s,t[f]["--app-shell-navbar-transform-rtl"]=l,t[f]["--app-shell-navbar-offset"]="0px !important"}if((d=r==null?void 0:r.collapsed)!=null&&d.mobile){const f=rg(r.breakpoint,o)-.1;n[f]=n[f]||{},n[f]["--app-shell-navbar-width"]="100%",n[f]["--app-shell-navbar-offset"]="0px",n[f]["--app-shell-navbar-transform"]=s,n[f]["--app-shell-navbar-transform-rtl"]=l}}function tp(e){return Number(e)===0?"0px":rn(e)}function DN({padding:e,baseStyles:t,minMediaStyles:n}){jc(e)&&(t["--app-shell-padding"]=tp(Ec(e))),Pc(e)&&(e.base&&(t["--app-shell-padding"]=tp(e.base)),pt(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=tp(e[r]))}))}function IN({navbar:e,header:t,footer:n,aside:r,padding:o,theme:i}){const s={},l={},c={};RN({baseStyles:c,minMediaStyles:s,maxMediaStyles:l,navbar:e,theme:i}),PN({baseStyles:c,minMediaStyles:s,maxMediaStyles:l,aside:r,theme:i}),kN({baseStyles:c,minMediaStyles:s,header:t}),TN({baseStyles:c,minMediaStyles:s,footer:n}),DN({baseStyles:c,minMediaStyles:s,padding:o});const u=Ll(pt(s),i).map(h=>({query:`(min-width: ${Ju(h.px)})`,styles:s[h.value]})),d=Ll(pt(l),i).map(h=>({query:`(max-width: ${Ju(h.px)})`,styles:l[h.value]})),f=[...u,...d];return{baseStyles:c,media:f}}function _N({navbar:e,header:t,aside:n,footer:r,padding:o}){const i=kt(),s=Ma(),{media:l,baseStyles:c}=IN({navbar:e,header:t,footer:r,aside:n,padding:o,theme:i});return C.createElement(La,{media:l,styles:c,selector:s.cssVariablesSelector})}const AN={},ky=Q((e,t)=>{const n=U("AppShellNavbar",AN,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=Ua();return m.disabled?null:C.createElement(W,{component:"nav",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("navbar",{className:o,classNames:r,styles:s,style:i}),...h,__vars:{"--app-shell-navbar-z-index":`calc(${d??m.zIndex} + 1)`}})});ky.classes=ji;ky.displayName="@mantine/core/AppShellNavbar";const NN={},Ry=vn((e,t)=>{const n=U("AppShellSection",NN,e),{classNames:r,className:o,style:i,styles:s,vars:l,grow:c,mod:u,...d}=n,f=Ua();return C.createElement(W,{ref:t,mod:[{grow:c},u],...f.getStyles("section",{className:o,style:i,classNames:r,styles:s}),...d})});Ry.classes=ji;Ry.displayName="@mantine/core/AppShellSection";function ON({transitionDuration:e,disabled:t}){const[n,r]=p.useState(!1),o=p.useRef(),i=p.useRef();return zS("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>r(!1),200)}),Oa(()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>r(!1),e||0)},[t,e]),n}const MN={withBorder:!0,offsetScrollbars:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:zr("app")},LN=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Un=Q((e,t)=>{const n=U("AppShell",MN,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,navbar:u,withBorder:d,padding:f,transitionDuration:h,transitionTimingFunction:m,header:g,zIndex:y,layout:S,disabled:v,aside:x,footer:w,offsetScrollbars:b,mod:j,...E}=n,P=de({name:"AppShell",classes:ji,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:LN}),T=ON({disabled:v,transitionDuration:h});return C.createElement(SN,{value:{getStyles:P,withBorder:d,zIndex:y,disabled:v,offsetScrollbars:b}},C.createElement(_N,{navbar:u,header:g,aside:x,footer:w,padding:f}),C.createElement(W,{ref:t,...P("root"),mod:[{resizing:T,layout:S,disabled:v},j],...E}))});Un.classes=ji;Un.displayName="@mantine/core/AppShell";Un.Navbar=ky;Un.Header=Py;Un.Main=Ty;Un.Aside=Ey;Un.Footer=jy;Un.Section=Ry;function nj(e){return typeof e=="string"?{value:e,label:e}:"value"in e&&!("label"in e)?{value:e.value,label:e.value,disabled:e.disabled}:typeof e=="number"?{value:e.toString(),label:e.toString()}:"group"in e?{group:e.group,items:e.items.map(t=>nj(t))}:e}function rj(e){return e?e.map(t=>nj(t)):[]}function oj(e){return e.reduce((t,n)=>"group"in n?{...t,...oj(n.items)}:(t[n.value]=n,t),{})}var Wn={dropdown:"m-88b62a41",options:"m-b2821a6e",option:"m-92253aa5",search:"m-985517d8",empty:"m-2530cd1d",header:"m-858f94bd",footer:"m-82b967cb",group:"m-254f3e4f",groupLabel:"m-2bb2e9e5",chevron:"m-2943220b",optionsDropdownOption:"m-390b5f4",optionsDropdownCheckIcon:"m-8ee53fc2"};const $N={error:null},FN=(e,{size:t})=>({chevron:{"--combobox-chevron-size":Pe(t,"combobox-chevron-size")}}),bf=Q((e,t)=>{const n=U("ComboboxChevron",$N,e),{size:r,error:o,style:i,className:s,classNames:l,styles:c,unstyled:u,vars:d,mod:f,...h}=n,m=de({name:"ComboboxChevron",classes:Wn,props:n,style:i,className:s,classNames:l,styles:c,unstyled:u,vars:d,varsResolver:FN,rootSelector:"chevron"});return C.createElement(W,{component:"svg",...h,...m("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:o},f],ref:t},C.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))});bf.classes=Wn;bf.displayName="@mantine/core/ComboboxChevron";const[zN,Sr]=Tn("Combobox component was not found in tree"),ij=p.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},i)=>C.createElement(vs,{ref:i,size:e||"sm",variant:"transparent",tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:s=>{s.preventDefault(),t==null||t(s)},onClick:s=>{r(),n==null||n(s)}}));ij.displayName="@mantine/core/ComboboxClearButton";const BN={},Dy=Q((e,t)=>{const{classNames:n,styles:r,className:o,style:i,hidden:s,...l}=U("ComboboxDropdown",BN,e),c=Sr();return C.createElement(Br.Dropdown,{...l,ref:t,role:"presentation","data-hidden":s||void 0,...c.getStyles("dropdown",{className:o,style:i,classNames:n,styles:r})})});Dy.classes=Wn;Dy.displayName="@mantine/core/ComboboxDropdown";const UN={refProp:"ref"},sj=Q((e,t)=>{const{children:n,refProp:r}=U("ComboboxDropdownTarget",UN,e);if(Sr(),!Ao(n))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return C.createElement(Br.Target,{ref:t,refProp:r},n)});sj.displayName="@mantine/core/ComboboxDropdownTarget";const VN={},Iy=Q((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=U("ComboboxEmpty",VN,e),c=Sr();return C.createElement(W,{ref:t,...c.getStyles("empty",{className:r,classNames:n,styles:i,style:o}),...l})});Iy.classes=Wn;Iy.displayName="@mantine/core/ComboboxEmpty";function _y({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:i}){const s=Sr(),[l,c]=p.useState(null),u=f=>{if(e==null||e(f),!s.readOnly&&t){if(f.nativeEvent.code==="ArrowDown"&&(f.preventDefault(),s.store.dropdownOpened?c(s.store.selectNextOption()):(s.store.openDropdown("keyboard"),c(s.store.selectActiveOption()))),f.nativeEvent.code==="ArrowUp"&&(f.preventDefault(),s.store.dropdownOpened?c(s.store.selectPreviousOption()):(s.store.openDropdown("keyboard"),c(s.store.selectActiveOption()))),f.nativeEvent.code==="Enter"||f.nativeEvent.code==="NumpadEnter"){const h=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&h!==-1?(f.preventDefault(),s.store.clickSelectedOption()):o==="button"&&(f.preventDefault(),s.store.openDropdown("keyboard"))}f.nativeEvent.code==="Escape"&&s.store.closeDropdown("keyboard"),f.nativeEvent.code==="Space"&&o==="button"&&(f.preventDefault(),s.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!!(s.store.listId&&s.store.dropdownOpened)||void 0,"aria-controls":s.store.listId,"aria-activedescendant":s.store.dropdownOpened&&l||void 0,autoComplete:i,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},onKeyDown:u}}const WN={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},aj=Q((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:s,targetType:l,autoComplete:c,...u}=U("ComboboxEventsTarget",WN,e);if(!Ao(n))throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const d=Sr(),f=_y({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:s,onKeyDown:n.props.onKeyDown,autoComplete:c});return p.cloneElement(n,{...f,...u,[r]:Zt(t,d.store.targetRef,n==null?void 0:n.ref)})});aj.displayName="@mantine/core/ComboboxEventsTarget";const HN={},Ay=Q((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=U("ComboboxFooter",HN,e),c=Sr();return C.createElement(W,{ref:t,...c.getStyles("footer",{className:r,classNames:n,style:o,styles:i}),...l})});Ay.classes=Wn;Ay.displayName="@mantine/core/ComboboxFooter";const qN={},Ny=Q((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,children:l,label:c,...u}=U("ComboboxGroup",qN,e),d=Sr();return C.createElement(W,{ref:t,...d.getStyles("group",{className:r,classNames:n,style:o,styles:i}),...u},c&&C.createElement("div",{...d.getStyles("groupLabel",{classNames:n,styles:i})},c),l)});Ny.classes=Wn;Ny.displayName="@mantine/core/ComboboxGroup";const GN={},Oy=Q((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=U("ComboboxHeader",GN,e),c=Sr();return C.createElement(W,{ref:t,...c.getStyles("header",{className:r,classNames:n,style:o,styles:i}),...l})});Oy.classes=Wn;Oy.displayName="@mantine/core/ComboboxHeader";const QN={},My=Q((e,t)=>{const n=U("ComboboxOption",QN,e),{classNames:r,className:o,style:i,styles:s,vars:l,onClick:c,id:u,active:d,onMouseDown:f,onMouseOver:h,disabled:m,selected:g,mod:y,...S}=n,v=Sr(),x=p.useId(),w=u||x;return C.createElement(W,{...v.getStyles("option",{className:o,classNames:r,styles:s,style:i}),...S,ref:t,id:w,mod:["combobox-option",{"combobox-active":d,"combobox-disabled":m,"combobox-selected":g},y],role:"option",onClick:b=>{var j;m?b.preventDefault():((j=v.onOptionSubmit)==null||j.call(v,n.value,n),c==null||c(b))},onMouseDown:b=>{b.preventDefault(),f==null||f(b)},onMouseOver:b=>{v.resetSelectionOnOptionHover&&v.store.resetSelectedOption(),h==null||h(b)}})});My.classes=Wn;My.displayName="@mantine/core/ComboboxOption";const KN={},Ly=Q((e,t)=>{const n=U("ComboboxOptions",KN,e),{classNames:r,className:o,style:i,styles:s,id:l,onMouseDown:c,labelledBy:u,...d}=n,f=Sr(),h=kn(l);return p.useEffect(()=>{f.store.setListId(h)},[h]),C.createElement(W,{ref:t,...f.getStyles("options",{className:o,style:i,classNames:r,styles:s}),...d,id:h,role:"listbox","aria-labelledby":u,onMouseDown:m=>{m.preventDefault(),c==null||c(m)}})});Ly.classes=Wn;Ly.displayName="@mantine/core/ComboboxOptions";const YN={withAriaAttributes:!0,withKeyboardNavigation:!0},$y=Q((e,t)=>{const n=U("ComboboxSearch",YN,e),{classNames:r,styles:o,unstyled:i,vars:s,withAriaAttributes:l,onKeyDown:c,withKeyboardNavigation:u,size:d,...f}=n,h=Sr(),m=h.getStyles("search"),g=_y({targetType:"input",withAriaAttributes:l,withKeyboardNavigation:u,withExpandedAttribute:!1,onKeyDown:c,autoComplete:"off"});return C.createElement(Ct,{ref:Zt(t,h.store.searchRef),classNames:[{input:m.className},r],styles:[{input:m.style},o],size:d||h.size,...g,...f,__staticSelector:"Combobox"})});$y.classes=Wn;$y.displayName="@mantine/core/ComboboxSearch";const XN={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},lj=Q((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:s,targetType:l,autoComplete:c,...u}=U("ComboboxTarget",XN,e);if(!Ao(n))throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const d=Sr(),f=_y({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:s,onKeyDown:n.props.onKeyDown,autoComplete:c}),h=p.cloneElement(n,{...f,...u});return C.createElement(Br.Target,{ref:Zt(t,d.store.targetRef)},h)});lj.displayName="@mantine/core/ComboboxTarget";function JN(e,t,n){for(let r=e-1;r>=0;r-=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;if(n){for(let r=t.length-1;r>-1;r-=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r}return e}function ZN(e,t,n){for(let r=e+1;r<t.length;r+=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;if(n){for(let r=0;r<t.length;r+=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r}return e}function e3(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function Tc({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:i=!0,scrollBehavior:s="instant"}={}){const[l,c]=gn({value:t,defaultValue:e,finalValue:!1,onChange:n}),u=p.useRef(null),d=p.useRef(-1),f=p.useRef(null),h=p.useRef(null),m=p.useRef(-1),g=p.useRef(-1),y=p.useRef(-1),S=p.useCallback((M="unknown")=>{l||(c(!0),o==null||o(M))},[c,o,l]),v=p.useCallback((M="unknown")=>{l&&(c(!1),r==null||r(M))},[c,r,l]),x=p.useCallback((M="unknown")=>{l?v(M):S(M)},[v,S,l]),w=p.useCallback(()=>{const M=document.querySelector(`#${u.current} [data-combobox-selected]`);M==null||M.removeAttribute("data-combobox-selected"),M==null||M.removeAttribute("aria-selected")},[]),b=p.useCallback(M=>{const R=document.getElementById(u.current),k=R==null?void 0:R.querySelectorAll("[data-combobox-option]");if(!k)return null;const F=M>=k.length?0:M<0?k.length-1:M;return d.current=F,k!=null&&k[F]&&!k[F].hasAttribute("data-combobox-disabled")?(w(),k[F].setAttribute("data-combobox-selected","true"),k[F].setAttribute("aria-selected","true"),k[F].scrollIntoView({block:"nearest",behavior:s}),k[F].id):null},[s,w]),j=p.useCallback(()=>{const M=document.querySelector(`#${u.current} [data-combobox-active]`);if(M){const R=document.querySelectorAll(`#${u.current} [data-combobox-option]`),k=Array.from(R).findIndex(F=>F===M);return b(k)}return b(0)},[b]),E=p.useCallback(()=>b(ZN(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[b,i]),P=p.useCallback(()=>b(JN(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[b,i]),T=p.useCallback(()=>b(e3(document.querySelectorAll(`#${u.current} [data-combobox-option]`))),[b]),D=p.useCallback((M="selected",R)=>{y.current=window.setTimeout(()=>{var q;const k=document.querySelectorAll(`#${u.current} [data-combobox-option]`),F=Array.from(k).findIndex(G=>G.hasAttribute(`data-combobox-${M}`));d.current=F,R!=null&&R.scrollIntoView&&((q=k[F])==null||q.scrollIntoView({block:"nearest",behavior:s}))},0)},[]),_=p.useCallback(()=>{d.current=-1,w()},[w]),O=p.useCallback(()=>{const M=document.querySelectorAll(`#${u.current} [data-combobox-option]`),R=M==null?void 0:M[d.current];R==null||R.click()},[]),I=p.useCallback(M=>{u.current=M},[]),$=p.useCallback(()=>{m.current=window.setTimeout(()=>f.current.focus(),0)},[]),N=p.useCallback(()=>{g.current=window.setTimeout(()=>h.current.focus(),0)},[]),L=p.useCallback(()=>d.current,[]);return p.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(g.current),window.clearTimeout(y.current)},[]),{dropdownOpened:l,openDropdown:S,closeDropdown:v,toggleDropdown:x,selectedOptionIndex:d.current,getSelectedOptionIndex:L,selectOption:b,selectFirstOption:T,selectActiveOption:j,selectNextOption:E,selectPreviousOption:P,resetSelectedOption:_,updateSelectedOptionIndex:D,listId:u.current,setListId:I,clickSelectedOption:O,searchRef:f,focusSearchInput:$,targetRef:h,focusTarget:N}}const t3={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},n3=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":Kt(t),"--combobox-option-padding":Pe(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:B(n),"--combobox-option-fz":Kt(t),"--combobox-option-padding":Pe(t,"combobox-option-padding")}});function Ee(e){const t=U("Combobox",t3,e),{classNames:n,styles:r,unstyled:o,children:i,store:s,vars:l,onOptionSubmit:c,onClose:u,size:d,dropdownPadding:f,resetSelectionOnOptionHover:h,__staticSelector:m,readOnly:g,...y}=t,S=Tc(),v=s||S,x=de({name:m||"Combobox",classes:Wn,props:t,classNames:n,styles:r,unstyled:o,vars:l,varsResolver:n3}),w=()=>{u==null||u(),v.closeDropdown()};return C.createElement(zN,{value:{getStyles:x,store:v,onOptionSubmit:c,size:d,resetSelectionOnOptionHover:h,readOnly:g}},C.createElement(Br,{opened:v.dropdownOpened,...y,onClose:w,withRoles:!1,unstyled:o},i))}const r3=e=>e;Ee.extend=r3;Ee.classes=Wn;Ee.displayName="@mantine/core/Combobox";Ee.Target=lj;Ee.Dropdown=Dy;Ee.Options=Ly;Ee.Option=My;Ee.Search=$y;Ee.Empty=Iy;Ee.Chevron=bf;Ee.Footer=Ay;Ee.Header=Oy;Ee.EventsTarget=aj;Ee.DropdownTarget=sj;Ee.Group=Ny;Ee.ClearButton=ij;var cj={root:"m-5f75b09e",body:"m-5f6e695e",labelWrapper:"m-d3ea56bb",label:"m-8ee546b8",description:"m-328f68c0",error:"m-8e8a99cc"};const uj=cj,Cf=p.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:o,unstyled:i,children:s,label:l,description:c,id:u,disabled:d,error:f,size:h,labelPosition:m="left",bodyElement:g="div",labelElement:y="label",variant:S,style:v,vars:x,mod:w,...b},j)=>{const E=de({name:e,props:t,className:n,style:v,classes:cj,classNames:r,styles:o,unstyled:i});return C.createElement(W,{...E("root"),ref:j,__vars:{"--label-fz":Kt(h),"--label-lh":Pe(h,"label-lh")},mod:[{"label-position":m},w],variant:S,size:h,...b},C.createElement(W,{component:g,htmlFor:g==="label"?u:void 0,...E("body")},s,C.createElement("div",{...E("labelWrapper"),"data-disabled":d||void 0},l&&C.createElement(W,{component:y,htmlFor:y==="label"?u:void 0,...E("label"),"data-disabled":d||void 0},l),c&&C.createElement(Ct.Description,{size:h,__inheritStyles:!1,...E("description")},c),f&&f!=="boolean"&&C.createElement(Ct.Error,{size:h,__inheritStyles:!1,...E("error")},f))))});Cf.displayName="@mantine/core/InlineInput";const dj=p.createContext(null),o3=dj.Provider,i3=()=>p.useContext(dj);function Fy({children:e,role:t}){const n=Ba();return n?C.createElement("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy},e):C.createElement(C.Fragment,null,e)}const s3={},zy=Q((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:s,children:l,readOnly:c,...u}=U("CheckboxGroup",s3,e),[d,f]=gn({value:n,defaultValue:r,finalValue:[],onChange:o}),h=m=>{const g=m.currentTarget.value;!c&&f(d.includes(g)?d.filter(y=>y!==g):[...d,g])};return C.createElement(o3,{value:{value:d,onChange:h,size:i}},C.createElement(Ct.Wrapper,{size:i,ref:t,...s,...u,labelElement:"div",__staticSelector:"CheckboxGroup"},C.createElement(Fy,{role:"group"},l)))});zy.classes=Ct.Wrapper.classes;zy.displayName="@mantine/core/CheckboxGroup";function Ef({size:e,style:t,...n}){const r=e!==void 0?{width:B(e),height:B(e),...t}:t;return C.createElement("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n},C.createElement("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function a3({indeterminate:e,...t}){return e?C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t},C.createElement("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})):C.createElement(Ef,{...t})}var fj={root:"m-bf2d988c",inner:"m-26062bec",input:"m-26063560",icon:"m-bf295423","input--outline":"m-215c4542"};const l3={labelPosition:"right",icon:a3},c3=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:s})=>{const l=ao({color:n||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{root:{"--checkbox-size":Pe(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:gt(t),"--checkbox-color":i==="outline"?c:mt(n,e),"--checkbox-icon-color":o?mt(o,e):gc(s,e)?fs({color:n,theme:e}):void 0}}},gr=Q((e,t)=>{const n=U("Checkbox",l3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,color:u,label:d,id:f,size:h,radius:m,wrapperProps:g,children:y,checked:S,labelPosition:v,description:x,error:w,disabled:b,variant:j,indeterminate:E,icon:P,rootRef:T,iconColor:D,onChange:_,autoContrast:O,mod:I,...$}=n,N=i3(),L=h||(N==null?void 0:N.size),M=P,R=de({name:"Checkbox",props:n,classes:fj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:c3}),{styleProps:k,rest:F}=No($),q=kn(f),G=N?{checked:N.value.includes(F.value),onChange:oe=>{N.onChange(oe),_==null||_(oe)}}:{};return C.createElement(Cf,{...R("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:q,size:L,labelPosition:v,label:d,description:x,error:w,disabled:b,classNames:r,styles:s,unstyled:l,"data-checked":G.checked||S||void 0,variant:j,ref:T,mod:I,...k,...g},C.createElement(W,{...R("inner"),mod:{"data-label-position":v}},C.createElement(W,{component:"input",id:q,ref:t,checked:S,disabled:b,mod:{error:!!w,indeterminate:E},...R("input",{focusable:!0,variant:j}),onChange:_,...F,...G,type:"checkbox"}),C.createElement(M,{indeterminate:E,...R("icon")})))});gr.classes={...fj,...uj};gr.displayName="@mantine/core/Checkbox";gr.Group=zy;function Ta(e){return"group"in e}function hj({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),o=[];for(let i=0;i<e.length;i+=1){const s=e[i];if(o.length===n)return o;Ta(s)&&o.push({group:s.group,items:hj({options:s.items,search:t,limit:n-o.length})}),Ta(s)||s.label.toLowerCase().includes(r)&&o.push(s)}return o}function u3(e){if(e.length===0)return!0;for(const t of e)if(!("group"in t)||t.items.length>0)return!1;return!0}function pj(e,t=new Set){if(Array.isArray(e))for(const n of e)if(Ta(n))pj(n.items,t);else{if(typeof n.value>"u")throw new Error("[@mantine/core] Each option must have value property");if(typeof n.value!="string")throw new Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof n.value}`);if(t.has(n.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function d3(e,t){return Array.isArray(e)?e.includes(t):e===t}function mj({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:o,renderOption:i}){if(!Ta(e)){const l=d3(n,e.value),c=t&&l&&C.createElement(Ef,{className:Wn.optionsDropdownCheckIcon}),u=C.createElement(C.Fragment,null,r==="left"&&c,C.createElement("span",null,e.label),r==="right"&&c);return C.createElement(Ee.Option,{value:e.value,disabled:e.disabled,className:et({[Wn.optionsDropdownOption]:!o}),"data-reverse":r==="right"||void 0,"data-checked":l||void 0,"aria-selected":l,active:l},typeof i=="function"?i({option:e,checked:l}):u)}const s=e.items.map(l=>C.createElement(mj,{data:l,value:n,key:l.value,unstyled:o,withCheckIcon:t,checkIconPosition:r}));return C.createElement(Ee.Group,{label:e.group},s)}function f3({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:o,limit:i,maxDropdownHeight:s,withScrollArea:l=!0,filterOptions:c=!0,withCheckIcon:u=!1,value:d,checkIconPosition:f,nothingFoundMessage:h,unstyled:m,labelId:g,renderOption:y}){pj(e);const v=typeof o=="string"?(r||hj)({options:e,search:c?o:"",limit:i??1/0}):e,x=u3(v),w=v.map(b=>C.createElement(mj,{data:b,key:Ta(b)?b.group:b.value,withCheckIcon:u,value:d,checkIconPosition:f,unstyled:m,renderOption:y}));return C.createElement(Ee.Dropdown,{hidden:t||n&&x},C.createElement(Ee.Options,{labelledBy:g},l?C.createElement(vr.Autosize,{mah:s??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y"},w):w,x&&h&&C.createElement(Ee.Empty,null,h)))}const gj=p.createContext(null),h3=gj.Provider;function p3(){return{withinGroup:!!p.useContext(gj)}}var jf={group:"m-11def92b",root:"m-f85678b6",image:"m-11f8ac07",placeholder:"m-104cd71f"};const m3={},g3=(e,{spacing:t})=>({group:{"--ag-spacing":rn(t)}}),By=Q((e,t)=>{const n=U("AvatarGroup",m3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,spacing:u,...d}=n,f=de({name:"AvatarGroup",classes:jf,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:g3,rootSelector:"group"});return C.createElement(h3,{value:!0},C.createElement(W,{ref:t,...f("group"),...d}))});By.classes=jf;By.displayName="@mantine/core/AvatarGroup";function y3(e){return C.createElement("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C.createElement("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}const v3={},x3=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:s})=>{const l=e.variantColorResolver({color:i||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:s});return{root:{"--avatar-size":Pe(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:gt(n),"--avatar-bg":i||r?l.background:void 0,"--avatar-color":i||r?l.color:void 0,"--avatar-bd":i||r?l.border:void 0}}},os=vn((e,t)=>{const n=U("Avatar",v3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,src:u,alt:d,radius:f,color:h,gradient:m,imageProps:g,children:y,autoContrast:S,mod:v,...x}=n,w=p3(),[b,j]=p.useState(!u),E=de({name:"Avatar",props:n,classes:jf,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:x3});return p.useEffect(()=>j(!u),[u]),C.createElement(W,{...E("root"),mod:[{"within-group":w.withinGroup},v],ref:t,...x},b?C.createElement("span",{...E("placeholder"),title:d},y||C.createElement(y3,null)):C.createElement("img",{...g,...E("image"),src:u,alt:d,onError:P=>{var T;j(!0),(T=g==null?void 0:g.onError)==null||T.call(g,P)}}))});os.classes=jf;os.displayName="@mantine/core/Avatar";os.Group=By;var yj={root:"m-347db0ec","root--dot":"m-fbd81e3d",label:"m-5add502a",section:"m-91fdda9b"};const w3={},S3=(e,{radius:t,color:n,gradient:r,variant:o,size:i,autoContrast:s})=>{const l=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:s});return{root:{"--badge-height":Pe(i,"badge-height"),"--badge-padding-x":Pe(i,"badge-padding-x"),"--badge-fz":Pe(i,"badge-fz"),"--badge-radius":t===void 0?void 0:gt(t),"--badge-bg":n||o?l.background:void 0,"--badge-color":n||o?l.color:void 0,"--badge-bd":n||o?l.border:void 0,"--badge-dot-color":o==="dot"?mt(n,e):void 0}}},kc=vn((e,t)=>{const n=U("Badge",w3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,radius:u,color:d,gradient:f,leftSection:h,rightSection:m,children:g,variant:y,fullWidth:S,autoContrast:v,circle:x,mod:w,...b}=n,j=de({name:"Badge",props:n,classes:yj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:S3});return C.createElement(W,{variant:y,mod:[{block:S,circle:x},w],...j("root",{variant:y}),ref:t,...b},h&&C.createElement("span",{...j("section"),"data-position":"left"},h),C.createElement("span",{...j("label")},g),m&&C.createElement("span",{...j("section"),"data-position":"right"},m))});kc.classes=yj;kc.displayName="@mantine/core/Badge";var vj={root:"m-ddec01c0",icon:"m-dde7bd57",cite:"m-dde51a35"};const b3={iconSize:48},C3=(e,{color:t,iconSize:n,radius:r})=>{const o=ao({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),i=ao({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":nn(i.value,.07),"--bq-bg-dark":nn(o.value,.06),"--bq-bd":mt(t,e),"--bq-icon-size":B(n),"--bq-radius":gt(r)}}},Uy=Q((e,t)=>{const n=U("Blockquote",b3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,children:u,icon:d,iconSize:f,cite:h,...m}=n,g=de({name:"Blockquote",classes:vj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:C3});return C.createElement(W,{component:"blockquote",ref:t,...g("root"),...m},d&&C.createElement("span",{...g("icon")},d),u,h&&C.createElement("cite",{...g("cite")},h))});Uy.classes=vj;Uy.displayName="@mantine/core/Blockquote";var Pf={root:"m-77c9d27d",inner:"m-80f1301b",label:"m-811560b9",section:"m-a74036a",loader:"m-a25b86ee",group:"m-80d6d844"};const S1={orientation:"horizontal"},E3=(e,{borderWidth:t})=>({group:{"--button-border-width":B(t)}}),Vy=Q((e,t)=>{const n=U("ButtonGroup",S1,e),{className:r,style:o,classNames:i,styles:s,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...m}=U("ButtonGroup",S1,e),g=de({name:"ButtonGroup",props:n,classes:Pf,className:r,style:o,classNames:i,styles:s,unstyled:l,vars:u,varsResolver:E3,rootSelector:"group"});return C.createElement(W,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...m})});Vy.classes=Pf;Vy.displayName="@mantine/core/ButtonGroup";const j3={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${B(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},P3={},T3=(e,{radius:t,color:n,gradient:r,variant:o,size:i,justify:s,autoContrast:l})=>{const c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:l});return{root:{"--button-justify":s,"--button-height":Pe(i,"button-height"),"--button-padding-x":Pe(i,"button-padding-x"),"--button-fz":i!=null&&i.includes("compact")?Kt(i.replace("compact-","")):Kt(i),"--button-radius":t===void 0?void 0:gt(t),"--button-bg":n||o?c.background:void 0,"--button-hover":n||o?c.hover:void 0,"--button-color":c.color,"--button-bd":n||o?c.border:void 0,"--button-hover-color":n||o?c.hoverColor:void 0}}},te=vn((e,t)=>{const n=U("Button",P3,e),{style:r,vars:o,className:i,color:s,disabled:l,children:c,leftSection:u,rightSection:d,fullWidth:f,variant:h,radius:m,loading:g,loaderProps:y,gradient:S,classNames:v,styles:x,unstyled:w,"data-disabled":b,autoContrast:j,mod:E,...P}=n,T=de({name:"Button",props:n,classes:Pf,className:i,style:r,classNames:v,styles:x,unstyled:w,vars:o,varsResolver:T3}),D=!!u,_=!!d;return C.createElement(Jn,{ref:t,...T("root",{active:!l&&!g&&!b}),unstyled:w,variant:h,disabled:l||g,mod:[{disabled:l||b,loading:g,block:f,"with-left-section":D,"with-right-section":_},E],...P},C.createElement(Lo,{mounted:!!g,transition:j3,duration:150},O=>C.createElement(W,{component:"span",...T("loader",{style:O}),"aria-hidden":!0},C.createElement(Vn,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...y}))),C.createElement("span",{...T("inner")},u&&C.createElement(W,{component:"span",...T("section"),mod:{position:"left"}},u),C.createElement(W,{component:"span",mod:{loading:g},...T("label")},c),d&&C.createElement(W,{component:"span",...T("section"),mod:{position:"right"}},d)))});te.classes=Pf;te.displayName="@mantine/core/Button";te.Group=Vy;var xj={root:"m-4451eb3a"};const k3={},on=vn((e,t)=>{const n=U("Center",k3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,inline:u,mod:d,...f}=n,h=de({name:"Center",props:n,classes:xj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c});return C.createElement(W,{ref:t,mod:[{inline:u},d],...h("root"),...f})});on.classes=xj;on.displayName="@mantine/core/Center";const[R3,D3]=mc(),I3={};function wj(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:i}=U("ChipGroup",I3,e),[s,l]=gn({value:t,defaultValue:n,finalValue:o?[]:null,onChange:r}),c=d=>Array.isArray(s)?s.includes(d):d===s,u=d=>{const f=d.currentTarget.value;Array.isArray(s)?l(s.includes(f)?s.filter(h=>h!==f):[...s,f]):l(f)};return C.createElement(R3,{value:{isChipSelected:c,onChange:u,multiple:o}},i)}wj.displayName="@mantine/core/ChipGroup";var Sj={root:"m-f59ffda3",label:"m-be049a53","label--outline":"m-3904c1af","label--filled":"m-fa109255","label--light":"m-f7e165c3",iconWrapper:"m-9ac86df9",checkIcon:"m-d6d72580",input:"m-bde07329"};const _3={type:"checkbox"},A3=(e,{size:t,radius:n,variant:r,color:o,autoContrast:i})=>{const s=e.variantColorResolver({color:o||e.primaryColor,theme:e,variant:r||"filled",autoContrast:i});return{root:{"--chip-fz":Kt(t),"--chip-size":Pe(t,"chip-size"),"--chip-radius":n===void 0?void 0:gt(n),"--chip-checked-padding":Pe(t,"chip-checked-padding"),"--chip-padding":Pe(t,"chip-padding"),"--chip-icon-size":Pe(t,"chip-icon-size"),"--chip-bg":o||r?s.background:void 0,"--chip-hover":o||r?s.hover:void 0,"--chip-color":o||r?s.color:void 0,"--chip-bd":o||r?s.border:void 0,"--chip-spacing":Pe(t,"chip-spacing")}}},rc=Q((e,t)=>{const n=U("Chip",_3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,id:u,checked:d,defaultChecked:f,onChange:h,value:m,wrapperProps:g,type:y,disabled:S,children:v,size:x,variant:w,icon:b,rootRef:j,autoContrast:E,mod:P,...T}=n,D=de({name:"Chip",classes:Sj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:A3}),_=D3(),O=kn(u),{styleProps:I,rest:$}=No(T),[N,L]=gn({value:d,defaultValue:f,finalValue:!1,onChange:h}),M=_?{checked:_.isChipSelected(m),onChange:k=>{_.onChange(k),h==null||h(k.currentTarget.checked)},type:_.multiple?"checkbox":"radio"}:{},R=M.checked||N;return C.createElement(W,{size:x,variant:w,ref:j,mod:P,...D("root"),...I,...g},C.createElement("input",{type:y,...D("input"),checked:R,onChange:k=>L(k.currentTarget.checked),id:O,disabled:S,ref:t,value:m,...M,...$}),C.createElement("label",{htmlFor:O,"data-checked":R||void 0,"data-disabled":S||void 0,...D("label",{variant:w||"filled"})},R&&C.createElement("span",{...D("iconWrapper")},b||C.createElement(Ef,{...D("checkIcon")})),C.createElement("span",null,v)))});rc.classes=Sj;rc.displayName="@mantine/core/Chip";rc.Group=wj;var bj={root:"m-b183c0a2"};const N3={},O3=(e,{color:t})=>({root:{"--code-bg":t?mt(t,e):void 0}}),Wy=Q((e,t)=>{const n=U("Code",N3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,color:u,block:d,variant:f,mod:h,...m}=n,g=de({name:"Code",props:n,classes:bj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:O3});return C.createElement(W,{component:d?"pre":"code",variant:f,ref:t,mod:[{block:d},h],...g("root"),...m,dir:"ltr"})});Wy.classes=bj;Wy.displayName="@mantine/core/Code";var Cj={root:"m-7485cace"};const M3={},L3=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:Pe(t,"container-size")}}),Hy=Q((e,t)=>{const n=U("Container",M3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,fluid:u,mod:d,...f}=n,h=de({name:"Container",classes:Cj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:L3});return C.createElement(W,{ref:t,mod:[{fluid:u},d],...h("root"),...f})});Hy.classes=Cj;Hy.displayName="@mantine/core/Container";const $3={timeout:1e3};function Ej(e){const{children:t,timeout:n,value:r,...o}=U("CopyButton",$3,e),i=NS({timeout:n}),s=()=>i.copy(r);return C.createElement(C.Fragment,null,t({copy:s,copied:i.copied,...o}))}Ej.displayName="@mantine/core/CopyButton";var jj={root:"m-3eebeb36",label:"m-9e365f20"};const F3={orientation:"horizontal"},z3=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?mt(t,e):void 0,"--divider-border-style":n,"--divider-size":Pe(r,"divider-size")}}),fn=Q((e,t)=>{const n=U("Divider",F3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,color:u,orientation:d,label:f,labelPosition:h,mod:m,...g}=n,y=de({name:"Divider",classes:jj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:z3});return C.createElement(W,{ref:t,mod:[{orientation:d,"with-label":!!f},m],...y("root"),...g,role:"separator"},f&&C.createElement(W,{component:"span",mod:{position:h},...y("label")},f))});fn.classes=jj;fn.displayName="@mantine/core/Divider";function B3({open:e,close:t,openDelay:n,closeDelay:r}){const o=p.useRef(-1),i=p.useRef(-1),s=()=>{window.clearTimeout(o.current),window.clearTimeout(i.current)},l=()=>{s(),n===0||n===void 0?e():o.current=window.setTimeout(e,n)},c=()=>{s(),r===0||r===void 0?t():i.current=window.setTimeout(t,r)};return p.useEffect(()=>s,[]),{openDropdown:l,closeDropdown:c}}const[U3,Pj]=Tn("Grid component was not found in tree"),vm=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,b1=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":vm(e,t),C1=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},E1=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function V3({span:e,order:t,offset:n,selector:r}){var h;const o=kt(),i=Pj(),l=ni(e)===void 0?12:ni(e),c=ds({"--col-order":(h=ni(t))==null?void 0:h.toString(),"--col-flex-grow":C1(l,i.grow),"--col-flex-basis":vm(l,i.columns),"--col-width":l==="content"?"auto":void 0,"--col-max-width":b1(l,i.columns,i.grow),"--col-offset":E1(ni(n),i.columns)}),u=pt(o.breakpoints).reduce((m,g)=>{var y;return m[g]||(m[g]={}),typeof t=="object"&&t[g]!==void 0&&(m[g]["--col-order"]=(y=t[g])==null?void 0:y.toString()),typeof e=="object"&&e[g]!==void 0&&(m[g]["--col-flex-grow"]=C1(e[g],i.grow),m[g]["--col-flex-basis"]=vm(e[g],i.columns),m[g]["--col-width"]=e[g]==="content"?"auto":void 0,m[g]["--col-max-width"]=b1(e[g],i.columns,i.grow)),typeof n=="object"&&n[g]!==void 0&&(m[g]["--col-offset"]=E1(n[g],i.columns)),m},{}),f=Ll(pt(u),o).filter(m=>pt(u[m.value]).length>0).map(m=>({query:`(min-width: ${o.breakpoints[m.value]})`,styles:u[m.value]}));return C.createElement(La,{styles:c,media:f,selector:r})}var qy={root:"m-410352e9",inner:"m-dee7bd2f",col:"m-96bdd299"};const W3={span:12},Gy=Q((e,t)=>{const n=U("GridCol",W3,e),{classNames:r,className:o,style:i,styles:s,vars:l,span:c,order:u,offset:d,...f}=n,h=Pj(),m=yc();return C.createElement(C.Fragment,null,C.createElement(V3,{selector:`.${m}`,span:c,order:u,offset:d}),C.createElement(W,{ref:t,...h.getStyles("col",{className:et(o,m),style:i,classNames:r,styles:s}),...f}))});Gy.classes=qy;Gy.displayName="@mantine/core/GridCol";function H3({gutter:e,selector:t}){const n=kt(),r=ds({"--grid-gutter":rn(ni(e))}),o=pt(n.breakpoints).reduce((l,c)=>(l[c]||(l[c]={}),typeof e=="object"&&e[c]!==void 0&&(l[c]["--grid-gutter"]=rn(e[c])),l),{}),s=Ll(pt(o),n).filter(l=>pt(o[l.value]).length>0).map(l=>({query:`(min-width: ${n.breakpoints[l.value]})`,styles:o[l.value]}));return C.createElement(La,{styles:r,media:s,selector:t})}const q3={gutter:"md",grow:!1,columns:12},G3=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),Kn=Q((e,t)=>{const n=U("Grid",q3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,grow:u,gutter:d,columns:f,align:h,justify:m,children:g,...y}=n,S=de({name:"Grid",classes:qy,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:G3}),v=yc();return C.createElement(U3,{value:{getStyles:S,grow:u,columns:f}},C.createElement(H3,{selector:`.${v}`,...n}),C.createElement(W,{ref:t,...S("root",{className:v}),...y},C.createElement("div",{...S("inner")},g)))});Kn.classes=qy;Kn.displayName="@mantine/core/Grid";Kn.Col=Gy;function Dd(){return Dd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dd.apply(this,arguments)}function Qy(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Q3=p.useLayoutEffect,K3=function(t){var n=p.useRef(t);return Q3(function(){n.current=t}),n},j1=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},Y3=function(t,n){var r=p.useRef();return p.useCallback(function(o){t.current=o,r.current&&j1(r.current,null),r.current=n,n&&j1(n,o)},[n])},P1={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},X3=function(t){Object.keys(P1).forEach(function(n){t.style.setProperty(n,P1[n],"important")})},T1=X3,xn=null,k1=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function J3(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),xn||(xn=document.createElement("textarea"),xn.setAttribute("tabindex","-1"),xn.setAttribute("aria-hidden","true"),T1(xn)),xn.parentNode===null&&document.body.appendChild(xn);var o=e.paddingSize,i=e.borderSize,s=e.sizingStyle,l=s.boxSizing;Object.keys(s).forEach(function(h){var m=h;xn.style[m]=s[m]}),T1(xn),xn.value=t;var c=k1(xn,e);xn.value=t,c=k1(xn,e),xn.value="x";var u=xn.scrollHeight-o,d=u*n;l==="border-box"&&(d=d+o+i),c=Math.max(d,c);var f=u*r;return l==="border-box"&&(f=f+o+i),c=Math.min(f,c),[c,u]}var R1=function(){},Z3=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},e9=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],t9=!!document.documentElement.currentStyle,n9=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=Z3(e9,n),o=r.boxSizing;if(o==="")return null;t9&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var i=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),s=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:i,borderSize:s}},r9=n9;function Tj(e,t,n){var r=K3(n);p.useLayoutEffect(function(){var o=function(s){return r.current(s)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var o9=function(t){Tj(window,"resize",t)},i9=function(t){Tj(document.fonts,"loadingdone",t)},s9=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],a9=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,i=t.minRows,s=t.onChange,l=s===void 0?R1:s,c=t.onHeightChange,u=c===void 0?R1:c,d=Qy(t,s9),f=d.value!==void 0,h=p.useRef(null),m=Y3(h,n),g=p.useRef(0),y=p.useRef(),S=function(){var w=h.current,b=r&&y.current?y.current:r9(w);if(b){y.current=b;var j=J3(b,w.value||w.placeholder||"x",i,o),E=j[0],P=j[1];g.current!==E&&(g.current=E,w.style.setProperty("height",E+"px","important"),u(E,{rowHeight:P}))}},v=function(w){f||S(),l(w)};return p.useLayoutEffect(S),o9(S),i9(S),p.createElement("textarea",Dd({},d,{onChange:v,ref:m}))},l9=p.forwardRef(a9);const c9={},ws=Q((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:i,resize:s,...l}=U("Textarea",c9,e),c=n&&BS()!=="test",u=c?{maxRows:r,minRows:o}:{};return C.createElement(wr,{component:c?l9:"textarea",ref:t,...l,__staticSelector:i||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":s},...u})});ws.classes=wr.classes;ws.displayName="@mantine/core/Textarea";function D1(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const u9={serialize:JSON.stringify,deserialize:JSON.parse},Va=Q((e,t)=>{const{value:n,defaultValue:r,onChange:o,formatOnBlur:i,validationError:s,serialize:l,deserialize:c,onFocus:u,onBlur:d,readOnly:f,error:h,...m}=U("JsonInput",u9,e),[g,y]=gn({value:n,defaultValue:r,finalValue:"",onChange:o}),[S,v]=p.useState(D1(g,c)),x=b=>{u==null||u(b),v(!0)},w=b=>{typeof d=="function"&&d(b);const j=D1(b.currentTarget.value,c);i&&!f&&j&&b.currentTarget.value.trim()!==""&&y(l(c(b.currentTarget.value),null,2)),v(j)};return C.createElement(ws,{value:g,onChange:b=>y(b.currentTarget.value),onFocus:x,onBlur:w,ref:t,readOnly:f,...m,autoComplete:"off",__staticSelector:"JsonInput",error:S?h:s||!0,"data-monospace":!0})});Va.classes=wr.classes;Va.displayName="@mantine/core/JsonInput";const[d9,f9]=Tn("List component was not found in tree");var Ky={root:"m-abbac491",item:"m-abb6bec2",itemWrapper:"m-75cd9f71",itemIcon:"m-60f83e5b"};const h9={},Yy=Q((e,t)=>{const n=U("ListItem",h9,e),{classNames:r,className:o,style:i,styles:s,vars:l,icon:c,children:u,mod:d,...f}=n,h=f9(),m=c||h.icon,g={classNames:r,styles:s};return C.createElement(W,{...h.getStyles("item",{...g,className:o,style:i}),component:"li",mod:[{"with-icon":!!m,centered:h.center},d],ref:t,...f},C.createElement("div",{...h.getStyles("itemWrapper",g)},m&&C.createElement("span",{...h.getStyles("itemIcon",g)},m),C.createElement("span",{...h.getStyles("itemLabel",g)},u)))});Yy.classes=Ky;Yy.displayName="@mantine/core/ListItem";const p9={type:"unordered"},m9=(e,{size:t,spacing:n})=>({root:{"--list-fz":Kt(t),"--list-lh":AS(t),"--list-spacing":rn(n)}}),Cn=Q((e,t)=>{const n=U("List",p9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,children:u,type:d,withPadding:f,icon:h,spacing:m,center:g,listStyleType:y,mod:S,...v}=n,x=de({name:"List",classes:Ky,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:m9});return C.createElement(d9,{value:{center:g,icon:h,getStyles:x}},C.createElement(W,{...x("root",{style:{listStyleType:y}}),component:d==="unordered"?"ul":"ol",mod:[{"with-padding":f},S],ref:t,...v},u))});Cn.classes=Ky;Cn.displayName="@mantine/core/List";Cn.Item=Yy;var kj={root:"m-6e45937b",loader:"m-e8eb006c",overlay:"m-df587f17"};const I1={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:zr("overlay")},g9=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),Xy=Q((e,t)=>{const n=U("LoadingOverlay",I1,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,transitionProps:u,loaderProps:d,overlayProps:f,visible:h,zIndex:m,...g}=n,y=kt(),S=de({name:"LoadingOverlay",classes:kj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:g9}),v={...I1.overlayProps,...f};return C.createElement(Lo,{transition:"fade",...u,mounted:!!h},x=>C.createElement(W,{...S("root",{style:x}),ref:t,...g},C.createElement(Vn,{...S("loader"),unstyled:l,...d}),C.createElement(nc,{...v,...S("overlay"),darkHidden:!0,unstyled:l,color:(f==null?void 0:f.color)||y.white}),C.createElement(nc,{...v,...S("overlay"),lightHidden:!0,unstyled:l,color:(f==null?void 0:f.color)||y.colors.dark[5]})))});Xy.classes=kj;Xy.displayName="@mantine/core/LoadingOverlay";const[y9,Rc]=Tn("Menu component was not found in the tree");var Wa={dropdown:"m-dc9b7c9f",label:"m-9bfac126",divider:"m-efdf90cb",item:"m-99ac2aa1",itemLabel:"m-5476e0d3",itemSection:"m-8b75e504"};const v9={},Jy=Q((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=U("MenuDivider",v9,e),c=Rc();return C.createElement(W,{ref:t,...c.getStyles("divider",{className:r,style:o,styles:i,classNames:n}),...l})});Jy.classes=Wa;Jy.displayName="@mantine/core/MenuDivider";const x9={},Zy=Q((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,onMouseEnter:l,onMouseLeave:c,children:u,...d}=U("MenuDropdown",x9,e),f=p.useRef(null),h=Rc(),m=S=>{var v,x;(S.key==="ArrowUp"||S.key==="ArrowDown")&&(S.preventDefault(),(x=(v=f.current)==null?void 0:v.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||x.focus())},g=Gn(l,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.openDropdown()),y=Gn(c,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.closeDropdown());return C.createElement(Br.Dropdown,{...d,onMouseEnter:g,onMouseLeave:y,role:"menu","aria-orientation":"vertical",ref:Zt(t,f),...h.getStyles("dropdown",{className:r,style:o,styles:i,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:m},C.createElement("div",{tabIndex:-1,"data-autofocus":!0,"aria-hidden":!0}),u)});Zy.classes=Wa;Zy.displayName="@mantine/core/MenuDropdown";const w9={},ev=vn((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,color:l,closeMenuOnClick:c,leftSection:u,rightSection:d,children:f,disabled:h,...m}=U("MenuItem",w9,e),g=Rc(),y=kt(),{dir:S}=hs(),v=p.useRef(),x=g.getItemIndex(v.current),w=m,b=Gn(w.onMouseLeave,()=>g.setHovered(-1)),j=Gn(w.onMouseEnter,()=>g.setHovered(g.getItemIndex(v.current))),E=Gn(w.onClick,()=>{typeof c=="boolean"?c&&g.closeDropdownImmediately():g.closeOnItemClick&&g.closeDropdownImmediately()}),P=Gn(w.onFocus,()=>g.setHovered(g.getItemIndex(v.current))),T=l?y.variantColorResolver({color:l,theme:y,variant:"light"}):void 0,D=l?ao({color:l,theme:y}):null;return C.createElement(Jn,{...m,unstyled:g.unstyled,tabIndex:g.menuItemTabIndex,onFocus:P,...g.getStyles("item",{className:r,style:o,styles:i,classNames:n}),ref:Zt(v,t),role:"menuitem",disabled:h,"data-menu-item":!0,"data-disabled":h||void 0,"data-hovered":g.hovered===x?!0:void 0,onMouseEnter:j,onMouseLeave:b,onClick:E,onKeyDown:_S({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:g.loop,dir:S,orientation:"vertical",onKeyDown:w.onKeydown}),__vars:{"--menu-item-color":D!=null&&D.isThemeColor&&(D==null?void 0:D.shade)===void 0?`var(--mantine-color-${D.color}-6)`:T==null?void 0:T.color,"--menu-item-hover":T==null?void 0:T.hover}},u&&C.createElement("div",{...g.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"left"},u),f&&C.createElement("div",{...g.getStyles("itemLabel",{styles:i,classNames:n})},f),d&&C.createElement("div",{...g.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"right"},d))});ev.classes=Wa;ev.displayName="@mantine/core/MenuItem";const S9={},tv=Q((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=U("MenuLabel",S9,e),c=Rc();return C.createElement(W,{ref:t,...c.getStyles("label",{className:r,style:o,styles:i,classNames:n}),...l})});tv.classes=Wa;tv.displayName="@mantine/core/MenuLabel";const b9={refProp:"ref"},Rj=p.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=U("MenuTarget",b9,e);if(!Ao(n))throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const i=Rc(),s=Gn(n.props.onClick,()=>{i.trigger==="click"?i.toggleDropdown():i.trigger==="click-hover"&&(i.setOpenedViaClick(!0),i.opened||i.openDropdown())}),l=Gn(n.props.onMouseEnter,()=>(i.trigger==="hover"||i.trigger==="click-hover")&&i.openDropdown()),c=Gn(n.props.onMouseLeave,()=>{(i.trigger==="hover"||i.trigger==="click-hover"&&!i.openedViaClick)&&i.closeDropdown()});return C.createElement(Br.Target,{refProp:r,popupType:"menu",ref:t,...o},p.cloneElement(n,{onClick:s,onMouseEnter:l,onMouseLeave:c,"data-expanded":i.opened?!0:void 0}))});Rj.displayName="@mantine/core/MenuTarget";const C9={trapFocus:!0,closeOnItemClick:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function Z(e){const t=U("Menu",C9,e),{children:n,onOpen:r,onClose:o,opened:i,defaultOpened:s,trapFocus:l,onChange:c,closeOnItemClick:u,loop:d,closeOnEscape:f,trigger:h,openDelay:m,closeDelay:g,classNames:y,styles:S,unstyled:v,variant:x,vars:w,menuItemTabIndex:b,keepMounted:j,...E}=t,P=de({name:"Menu",classes:Wa,props:t,classNames:y,styles:S,unstyled:v}),[T,{setHovered:D,resetHovered:_}]=d2(),[O,I]=gn({value:i,defaultValue:s,finalValue:!1,onChange:c}),[$,N]=p.useState(!1),L=()=>{I(!1),N(!1),O&&(o==null||o())},M=()=>{I(!0),!O&&(r==null||r())},R=()=>{O?L():M()},{openDropdown:k,closeDropdown:F}=B3({open:M,close:L,closeDelay:g,openDelay:m}),q=xe=>u2("[data-menu-item]","[data-menu-dropdown]",xe),{resolvedClassNames:G,resolvedStyles:oe}=Jd({classNames:y,styles:S,props:t});return Co(()=>{_()},[O]),C.createElement(y9,{value:{getStyles:P,opened:O,toggleDropdown:R,getItemIndex:q,hovered:T,setHovered:D,openedViaClick:$,setOpenedViaClick:N,closeOnItemClick:u,closeDropdown:h==="click"?L:F,openDropdown:h==="click"?M:k,closeDropdownImmediately:L,loop:d,trigger:h,unstyled:v,menuItemTabIndex:b}},C.createElement(Br,{...E,opened:O,onChange:R,defaultOpened:s,trapFocus:j?!1:l,closeOnEscape:f,__staticSelector:"Menu",classNames:G,styles:oe,unstyled:v,variant:x,keepMounted:j},n))}Z.extend=e=>e;Z.classes=Wa;Z.displayName="@mantine/core/Menu";Z.Item=ev;Z.Label=tv;Z.Dropdown=Zy;Z.Target=Rj;Z.Divider=Jy;const[E9,Ha]=Tn("Modal component was not found in tree");var Fo={root:"m-9df02822",content:"m-54c44539",inner:"m-1f958f16",header:"m-d0e2b9cd"};const j9={},Tf=Q((e,t)=>{const n=U("ModalBody",j9,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Ha();return C.createElement(GE,{ref:t,...u.getStyles("body",{classNames:r,style:i,styles:s,className:o}),...c})});Tf.classes=Fo;Tf.displayName="@mantine/core/ModalBody";const P9={},kf=Q((e,t)=>{const n=U("ModalCloseButton",P9,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Ha();return C.createElement(QE,{ref:t,...u.getStyles("close",{classNames:r,style:i,styles:s,className:o}),...c})});kf.classes=Fo;kf.displayName="@mantine/core/ModalCloseButton";const T9={},Rf=Q((e,t)=>{const n=U("ModalContent",T9,e),{classNames:r,className:o,style:i,styles:s,vars:l,children:c,...u}=n,d=Ha(),f=d.scrollAreaComponent||eN;return C.createElement(Y4,{...d.getStyles("content",{className:o,style:i,styles:s,classNames:r}),innerProps:d.getStyles("inner",{className:o,style:i,styles:s,classNames:r}),"data-full-screen":d.fullScreen||void 0,ref:t,...u},C.createElement(f,{style:{maxHeight:d.fullScreen?"100dvh":`calc(100dvh - (${B(d.yOffset)} * 2))`}},c))});Rf.classes=Fo;Rf.displayName="@mantine/core/ModalContent";const k9={},Df=Q((e,t)=>{const n=U("ModalHeader",k9,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Ha();return C.createElement(KE,{ref:t,...u.getStyles("header",{classNames:r,style:i,styles:s,className:o}),...c})});Df.classes=Fo;Df.displayName="@mantine/core/ModalHeader";const R9={},If=Q((e,t)=>{const n=U("ModalOverlay",R9,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Ha();return C.createElement(YE,{ref:t,...u.getStyles("overlay",{classNames:r,style:i,styles:s,className:o}),...c})});If.classes=Fo;If.displayName="@mantine/core/ModalOverlay";const D9={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:zr("modal"),transitionProps:{duration:200,transition:"pop"},yOffset:"5dvh"},I9=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:gt(t),"--modal-size":Pe(n,"modal-size"),"--modal-y-offset":B(r),"--modal-x-offset":B(o)}}),_f=Q((e,t)=>{const n=U("ModalRoot",D9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,yOffset:u,scrollAreaComponent:d,radius:f,fullScreen:h,centered:m,xOffset:g,__staticSelector:y,...S}=n,v=de({name:y,classes:Fo,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:I9});return C.createElement(E9,{value:{yOffset:u,scrollAreaComponent:d,getStyles:v,fullScreen:h}},C.createElement(Q4,{ref:t,...v("root"),"data-full-screen":h||void 0,"data-centered":m||void 0,unstyled:l,...S}))});_f.classes=Fo;_f.displayName="@mantine/core/ModalRoot";const _9={},Af=Q((e,t)=>{const n=U("ModalTitle",_9,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Ha();return C.createElement(XE,{ref:t,...u.getStyles("title",{classNames:r,style:i,styles:s,className:o}),...c})});Af.classes=Fo;Af.displayName="@mantine/core/ModalTitle";const A9={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:zr("modal"),transitionProps:{duration:200,transition:"pop"},withOverlay:!0,withCloseButton:!0},Dn=Q((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:i,closeButtonProps:s,children:l,radius:c,...u}=U("Modal",A9,e),d=!!n||i;return C.createElement(_f,{ref:t,radius:c,...u},r&&C.createElement(If,{...o}),C.createElement(Rf,{radius:c},d&&C.createElement(Df,null,n&&C.createElement(Af,null,n),i&&C.createElement(kf,{...s})),C.createElement(Tf,null,l)))});Dn.classes=Fo;Dn.displayName="@mantine/core/Modal";Dn.Root=_f;Dn.Overlay=If;Dn.Content=Rf;Dn.Body=Tf;Dn.Header=Df;Dn.Title=Af;Dn.CloseButton=kf;const[N9,nv]=mc(),[O9,M9]=mc();var Nf={root:"m-7cda1cd6","root--default":"m-44da308b","root--contrast":"m-e3a01f8",label:"m-1e0e6180",remove:"m-ae386778",group:"m-1dcfd90b"};const L9={},$9=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?Pe(t):Pe(n,"pg-gap")}}),rv=Q((e,t)=>{const n=U("PillGroup",L9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,disabled:d,...f}=n,h=nv(),m=(h==null?void 0:h.size)||u||void 0,g=de({name:"PillGroup",classes:Nf,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:$9,stylesCtx:{size:m},rootSelector:"group"});return C.createElement(O9,{value:{size:m,disabled:d}},C.createElement(W,{ref:t,size:m,...g("group"),...f}))});rv.classes=Nf;rv.displayName="@mantine/core/PillGroup";const F9={variant:"default"},z9=(e,{radius:t},{size:n})=>({root:{"--pill-fz":Pe(n,"pill-fz"),"--pill-height":Pe(n,"pill-height"),"--pill-radius":t===void 0?void 0:gt(t)}}),is=Q((e,t)=>{const n=U("Pill",F9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,variant:u,children:d,withRemoveButton:f,onRemove:h,removeButtonProps:m,radius:g,size:y,disabled:S,mod:v,...x}=n,w=M9(),b=nv(),j=y||(w==null?void 0:w.size)||void 0,E=(b==null?void 0:b.variant)==="filled"?"contrast":u||"default",P=de({name:"Pill",classes:Nf,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:z9,stylesCtx:{size:j}});return C.createElement(W,{component:"span",ref:t,variant:E,size:j,...P("root",{variant:E}),mod:[{"with-remove":f,disabled:S||(w==null?void 0:w.disabled)},v],...x},C.createElement("span",{...P("label")},d),f&&C.createElement(vs,{variant:"transparent",radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:l,...m,...P("remove",{className:m==null?void 0:m.className,style:m==null?void 0:m.style}),onMouseDown:T=>{var D;T.preventDefault(),T.stopPropagation(),(D=m==null?void 0:m.onMouseDown)==null||D.call(m,T)},onClick:T=>{var D;T.stopPropagation(),h==null||h(),(D=m==null?void 0:m.onClick)==null||D.call(m,T)}}))});is.classes=Nf;is.displayName="@mantine/core/Pill";is.Group=rv;var Dj={field:"m-45c4369d"};const B9={type:"visible"},ov=Q((e,t)=>{const n=U("PillsInputField",B9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,type:u,disabled:d,id:f,pointer:h,mod:m,...g}=n,y=nv(),S=Ba(),v=de({name:"PillsInputField",classes:Dj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"field"}),x=d||(y==null?void 0:y.disabled);return C.createElement(W,{component:"input",ref:Zt(t,y==null?void 0:y.fieldRef),"data-type":u,disabled:x,mod:[{disabled:x,pointer:h},m],...v("field"),...g,id:(S==null?void 0:S.inputId)||f,"aria-invalid":y==null?void 0:y.hasError,"aria-describedby":S==null?void 0:S.describedBy,type:"text",onMouseDown:w=>!h&&w.stopPropagation()})});ov.classes=Dj;ov.displayName="@mantine/core/PillsInputField";const U9={},ka=Q((e,t)=>{const n=U("PillsInput",U9,e),{children:r,onMouseDown:o,onClick:i,size:s,disabled:l,__staticSelector:c,error:u,variant:d,...f}=n,h=p.useRef();return C.createElement(N9,{value:{fieldRef:h,size:s,disabled:l,hasError:!!u,variant:d}},C.createElement(wr,{size:s,error:u,variant:d,component:"div",ref:t,onMouseDown:m=>{var g;m.preventDefault(),o==null||o(m),(g=h.current)==null||g.focus()},onClick:m=>{var g;m.preventDefault(),i==null||i(m),(g=h.current)==null||g.focus()},...f,multiline:!0,disabled:l,__staticSelector:c||"PillsInput",withAria:!1},r))});ka.displayName="@mantine/core/PillsInput";ka.Field=ov;function V9({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,i)=>(Ta(i)?o.push({group:i.group,items:i.items.filter(s=>n.indexOf(s.value.toLowerCase().trim())===-1)}):n.indexOf(i.value.toLowerCase().trim())===-1&&o.push(i),o),[])}const W9={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},Of=Q((e,t)=>{const n=U("MultiSelect",W9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,value:d,defaultValue:f,onChange:h,onKeyDown:m,variant:g,data:y,dropdownOpened:S,defaultDropdownOpened:v,onDropdownOpen:x,onDropdownClose:w,selectFirstOptionOnChange:b,onOptionSubmit:j,comboboxProps:E,filter:P,limit:T,withScrollArea:D,maxDropdownHeight:_,searchValue:O,defaultSearchValue:I,onSearchChange:$,readOnly:N,disabled:L,onFocus:M,onBlur:R,onPaste:k,radius:F,rightSection:q,rightSectionWidth:G,rightSectionPointerEvents:oe,rightSectionProps:xe,leftSection:me,leftSectionWidth:Ce,leftSectionPointerEvents:je,leftSectionProps:Be,inputContainer:Me,inputWrapperOrder:Ke,withAsterisk:St,labelProps:X,descriptionProps:ke,errorProps:tt,wrapperProps:Ne,description:Ve,label:Rt,error:ln,maxValues:br,searchable:en,nothingFoundMessage:uo,withCheckIcon:re,checkIconPosition:De,hidePickedOptions:qe,withErrorStyles:nt,name:Lt,form:Hr,id:or,clearable:Di,clearButtonProps:In,hiddenInputProps:qr,placeholder:Cr,hiddenInputValuesDivider:Ho,required:Ja,mod:eu,renderOption:ks,onRemove:ir,onClear:Ii,...dh}=n,Rs=kn(or),Za=rj(y),fo=oj(Za),_n=Tc({opened:S,defaultOpened:v,onDropdownOpen:x,onDropdownClose:()=>{w==null||w(),_n.resetSelectedOption()}}),{styleProps:A,rest:{type:z,autoComplete:H,...J}}=No(dh),[ee,Re]=gn({value:d,defaultValue:f,finalValue:[],onChange:h}),[we,ye]=gn({value:O,defaultValue:I,finalValue:"",onChange:$}),ge=de({name:"MultiSelect",classes:{},props:n,classNames:r,styles:s,unstyled:l}),{resolvedClassNames:Le,resolvedStyles:$t}=Jd({props:n,styles:s,classNames:r}),_e=Ae=>{m==null||m(Ae),Ae.key===" "&&!en&&(Ae.preventDefault(),_n.toggleDropdown()),Ae.key==="Backspace"&&we.length===0&&ee.length>0&&(ir==null||ir(ee[ee.length-1]),Re(ee.slice(0,ee.length-1)))},rt=ee.map((Ae,Gr)=>{var Ds,ho;return C.createElement(is,{key:`${Ae}-${Gr}`,withRemoveButton:!N&&!((Ds=fo[Ae])!=null&&Ds.disabled),onRemove:()=>{Re(ee.filter(Qr=>Ae!==Qr)),ir==null||ir(Ae)},unstyled:l,...ge("pill")},((ho=fo[Ae])==null?void 0:ho.label)||Ae)});p.useEffect(()=>{b&&_n.selectFirstOption()},[b,ee]);const Ft=Di&&ee.length>0&&!L&&!N&&C.createElement(Ee.ClearButton,{size:u,...In,onClear:()=>{Ii==null||Ii(),Re([]),ye("")}}),cn=V9({data:Za,value:ee});return C.createElement(C.Fragment,null,C.createElement(Ee,{store:_n,classNames:Le,styles:$t,unstyled:l,size:u,readOnly:N,__staticSelector:"MultiSelect",onOptionSubmit:Ae=>{j==null||j(Ae),ye(""),_n.updateSelectedOptionIndex("selected"),ee.includes(fo[Ae].value)?(Re(ee.filter(Gr=>Gr!==fo[Ae].value)),ir==null||ir(fo[Ae].value)):ee.length<br&&Re([...ee,fo[Ae].value])},...E},C.createElement(Ee.DropdownTarget,null,C.createElement(ka,{...A,__staticSelector:"MultiSelect",classNames:Le,styles:$t,unstyled:l,size:u,className:o,style:i,variant:g,disabled:L,radius:F,rightSection:q||Ft||C.createElement(Ee.Chevron,{size:u,error:ln,unstyled:l}),rightSectionPointerEvents:oe||(Ft?"all":"none"),rightSectionWidth:G,rightSectionProps:xe,leftSection:me,leftSectionWidth:Ce,leftSectionPointerEvents:je,leftSectionProps:Be,inputContainer:Me,inputWrapperOrder:Ke,withAsterisk:St,labelProps:X,descriptionProps:ke,errorProps:tt,wrapperProps:Ne,description:Ve,label:Rt,error:ln,multiline:!0,withErrorStyles:nt,__stylesApiProps:{...n,rightSectionPointerEvents:oe||(Ft?"all":"none"),multiline:!0},pointer:!en,onClick:()=>en?_n.openDropdown():_n.toggleDropdown(),"data-expanded":_n.dropdownOpened||void 0,id:Rs,required:Ja,mod:eu},C.createElement(is.Group,{disabled:L,unstyled:l,...ge("pillsList")},rt,C.createElement(Ee.EventsTarget,{autoComplete:H},C.createElement(ka.Field,{...J,ref:t,id:Rs,placeholder:Cr,type:!en&&!Cr?"hidden":"visible",...ge("inputField"),unstyled:l,onFocus:Ae=>{M==null||M(Ae),en&&_n.openDropdown()},onBlur:Ae=>{R==null||R(Ae),_n.closeDropdown(),ye("")},onKeyDown:_e,value:we,onChange:Ae=>{ye(Ae.currentTarget.value),en&&_n.openDropdown(),b&&_n.selectFirstOption()},disabled:L,readOnly:N||!en,pointer:!en}))))),C.createElement(f3,{data:qe?cn:Za,hidden:N||L,filter:P,search:we,limit:T,hiddenWhenEmpty:!en||!uo||qe&&cn.length===0&&we.trim().length===0,withScrollArea:D,maxDropdownHeight:_,filterOptions:en,value:ee,checkIconPosition:De,withCheckIcon:re,nothingFoundMessage:uo,unstyled:l,labelId:`${Rs}-label`,renderOption:ks})),C.createElement("input",{type:"hidden",name:Lt,value:ee.join(Ho),form:Hr,disabled:L,...qr}))});Of.classes={...wr.classes,...Ee.classes};Of.displayName="@mantine/core/MultiSelect";function H9(e){return"group"in e}function iv({data:e}){if(H9(e)){const o=e.items.map(i=>C.createElement(iv,{key:i.value,data:i}));return C.createElement("optgroup",{label:e.group},o)}const{value:t,label:n,...r}=e;return C.createElement("option",{key:e.value,value:e.value,...r},e.label)}iv.displayName="@mantine/core/NativeSelectOption";const q9={rightSectionPointerEvents:"none"},wt=Q((e,t)=>{const{data:n,children:r,size:o,error:i,rightSection:s,unstyled:l,...c}=U("NativeSelect",q9,e),u=rj(n).map((d,f)=>C.createElement(iv,{key:f,data:d}));return C.createElement(wr,{component:"select",ref:t,...c,__staticSelector:"NativeSelect",size:o,pointer:!0,error:i,unstyled:l,rightSection:s||C.createElement(bf,{size:o,error:i,unstyled:l})},r||u)});wt.classes=wr.classes;wt.displayName="@mantine/core/NativeSelect";var Ij={root:"m-a513464",icon:"m-a4ceffb",loader:"m-b0920b15",body:"m-a49ed24",title:"m-3feedf16",description:"m-3d733a3a",closeButton:"m-919a4d88"};const G9={withCloseButton:!0},Q9=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:gt(t),"--notification-color":n?mt(n,e):void 0}}),sv=Q((e,t)=>{const n=U("Notification",G9,e),{className:r,color:o,radius:i,loading:s,withCloseButton:l,withBorder:c,title:u,icon:d,children:f,onClose:h,closeButtonProps:m,classNames:g,style:y,styles:S,unstyled:v,variant:x,vars:w,mod:b,...j}=n,E=de({name:"Notification",classes:Ij,props:n,className:r,style:y,classNames:g,styles:S,unstyled:v,vars:w,varsResolver:Q9});return C.createElement(W,{...E("root"),mod:[{"data-with-icon":!!d||s,"data-with-border":c},b],ref:t,variant:x,...j,role:"alert"},d&&!s&&C.createElement("div",{...E("icon")},d),s&&C.createElement(Vn,{size:28,color:o,...E("loader")}),C.createElement("div",{...E("body")},u&&C.createElement("div",{...E("title")},u),C.createElement(W,{...E("description"),mod:{"data-with-title":!!u}},f)),l&&C.createElement(vs,{iconSize:16,color:"gray",...m,unstyled:v,onClick:h,...E("closeButton")}))});sv.classes=Ij;sv.displayName="@mantine/core/Notification";const[K9,Mf]=Tn("Pagination.Root component was not found in tree");var Dc={root:"m-4addd315",control:"m-326d024a",dots:"m-4ad7767d"};const Y9={withPadding:!0},Ic=Q((e,t)=>{const n=U("PaginationControl",Y9,e),{classNames:r,className:o,style:i,styles:s,vars:l,active:c,disabled:u,withPadding:d,mod:f,...h}=n,m=Mf(),g=u||m.disabled;return C.createElement(Jn,{ref:t,disabled:g,mod:[{active:c,disabled:g,"with-padding":d},f],...m.getStyles("control",{className:o,style:i,classNames:r,styles:s,active:!g}),...h})});Ic.classes=Dc;Ic.displayName="@mantine/core/PaginationControl";function _c({style:e,children:t,path:n,...r}){return C.createElement("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)",...e},...r},C.createElement("path",{d:n,fill:"currentColor"}))}const X9=e=>C.createElement(_c,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),J9=e=>C.createElement(_c,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),Z9=e=>C.createElement(_c,{...e,path:"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z"}),e5=e=>C.createElement(_c,{...e,path:"M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z"}),t5=e=>C.createElement(_c,{...e,path:"M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z"}),n5={icon:t5},Lf=Q((e,t)=>{const n=U("PaginationDots",n5,e),{classNames:r,className:o,style:i,styles:s,vars:l,icon:c,...u}=n,d=Mf(),f=c;return C.createElement(W,{ref:t,...d.getStyles("dots",{className:o,style:i,styles:s,classNames:r}),...u},C.createElement(f,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}}))});Lf.classes=Dc;Lf.displayName="@mantine/core/PaginationDots";function $f({icon:e,name:t,action:n,type:r}){const o={icon:e},i=p.forwardRef((s,l)=>{const{icon:c,...u}=U(t,o,s),d=c,f=Mf(),h=r==="next"?f.active===f.total:f.active===1;return C.createElement(Ic,{disabled:f.disabled||h,ref:l,onClick:f[n],withPadding:!1,...u},C.createElement(d,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}}))});return i.displayName=`@mantine/core/${t}`,i}const _j=$f({icon:X9,name:"PaginationNext",action:"onNext",type:"next"}),Aj=$f({icon:J9,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),Nj=$f({icon:Z9,name:"PaginationFirst",action:"onFirst",type:"previous"}),Oj=$f({icon:e5,name:"PaginationLast",action:"onLast",type:"next"});function av({dotsIcon:e}){const t=Mf(),n=t.range.map((r,o)=>{var i;return r==="dots"?C.createElement(Lf,{icon:e,key:o}):C.createElement(Ic,{key:o,active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...(i=t.getItemProps)==null?void 0:i.call(t,r)},r)});return C.createElement(C.Fragment,null,n)}av.displayName="@mantine/core/PaginationItems";const r5={siblings:1,boundaries:1},o5=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:gt(n),"--pagination-control-size":Pe(t,"pagination-control-size"),"--pagination-control-fz":Kt(t),"--pagination-active-bg":r?mt(r,e):void 0,"--pagination-active-color":gc(o,e)?fs({color:r,theme:e}):void 0}}),Ff=Q((e,t)=>{const n=U("PaginationRoot",r5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,total:u,value:d,defaultValue:f,onChange:h,disabled:m,siblings:g,boundaries:y,color:S,radius:v,onNextPage:x,onPreviousPage:w,onFirstPage:b,onLastPage:j,getItemProps:E,autoContrast:P,...T}=n,D=de({name:"Pagination",classes:Dc,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:o5}),{range:_,setPage:O,next:I,previous:$,active:N,first:L,last:M}=k2({page:d,initialPage:f,onChange:h,total:u,siblings:g,boundaries:y}),R=Gn(x,I),k=Gn(w,$),F=Gn(b,L),q=Gn(j,M);return C.createElement(K9,{value:{total:u,range:_,active:N,disabled:m,getItemProps:E,onChange:O,onNext:R,onPrevious:k,onFirst:F,onLast:q,getStyles:D}},C.createElement(W,{ref:t,...D("root"),...T}))});Ff.classes=Dc;Ff.displayName="@mantine/core/PaginationRoot";const i5={withControls:!0,siblings:1,boundaries:1,gap:8},Ur=Q((e,t)=>{const n=U("Pagination",i5,e),{withEdges:r,withControls:o,getControlProps:i,nextIcon:s,previousIcon:l,lastIcon:c,firstIcon:u,dotsIcon:d,total:f,gap:h,...m}=n;return f<=0?null:C.createElement(Ff,{ref:t,total:f,...m},C.createElement(Y,{gap:h},r&&C.createElement(Nj,{icon:u,...i==null?void 0:i("first")}),o&&C.createElement(Aj,{icon:l,...i==null?void 0:i("previous")}),C.createElement(av,{dotsIcon:d}),o&&C.createElement(_j,{icon:s,...i==null?void 0:i("next")}),r&&C.createElement(Oj,{icon:c,...i==null?void 0:i("last")})))});Ur.classes=Dc;Ur.displayName="@mantine/core/Pagination";Ur.Root=Ff;Ur.Control=Ic;Ur.Dots=Lf;Ur.First=Nj;Ur.Last=Oj;Ur.Next=_j;Ur.Previous=Aj;Ur.Items=av;const s5=({reveal:e})=>C.createElement("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"}},C.createElement("path",{d:e?"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z":"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}));var xm={root:"m-f61ca620",input:"m-ccf8da4c",innerInput:"m-f2d85dd2",visibilityToggle:"m-b1072d44"};const a5={visibilityToggleIcon:s5},l5=(e,{size:t})=>({root:{"--psi-icon-size":Pe(t,"psi-icon-size"),"--psi-button-size":Pe(t,"psi-button-size")}}),Nr=Q((e,t)=>{const n=U("PasswordInput",a5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,required:u,error:d,leftSection:f,disabled:h,id:m,variant:g,inputContainer:y,description:S,label:v,size:x,errorProps:w,descriptionProps:b,labelProps:j,withAsterisk:E,inputWrapperOrder:P,wrapperProps:T,radius:D,rightSection:_,rightSectionWidth:O,rightSectionPointerEvents:I,leftSectionWidth:$,visible:N,defaultVisible:L,onVisibilityChange:M,visibilityToggleIcon:R,visibilityToggleButtonProps:k,rightSectionProps:F,leftSectionProps:q,leftSectionPointerEvents:G,mod:oe,...xe}=n,me=kn(m),[Ce,je]=gn({value:N,defaultValue:L,finalValue:!1,onChange:M}),Be=()=>je(!Ce),Me=de({name:"PasswordInput",classes:xm,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:l5}),{resolvedClassNames:Ke,resolvedStyles:St}=Jd({classNames:r,styles:s,props:n}),{styleProps:X,rest:ke}=No(xe),tt=R,Ne=C.createElement(qt,{...Me("visibilityToggle"),disabled:h,radius:D,"aria-hidden":!k,tabIndex:-1,...k,variant:"subtle",color:"gray",unstyled:l,onMouseDown:Ve=>{var Rt;Ve.preventDefault(),(Rt=k==null?void 0:k.onMouseDown)==null||Rt.call(k,Ve),Be()},onKeyDown:Ve=>{var Rt;(Rt=k==null?void 0:k.onKeyDown)==null||Rt.call(k,Ve),Ve.key===" "&&(Ve.preventDefault(),Be())}},C.createElement(tt,{reveal:Ce}));return C.createElement(Ct.Wrapper,{required:u,id:me,label:v,error:d,description:S,size:x,classNames:Ke,styles:St,__staticSelector:"PasswordInput",errorProps:w,descriptionProps:b,unstyled:l,withAsterisk:E,inputWrapperOrder:P,inputContainer:y,variant:g,labelProps:{...j,htmlFor:me},mod:oe,...Me("root"),...X,...T},C.createElement(Ct,{component:"div",error:d,leftSection:f,size:x,classNames:{...Ke,input:et(xm.input,Ke.input)},styles:St,radius:D,disabled:h,__staticSelector:"PasswordInput",rightSectionWidth:O,rightSection:_??Ne,variant:g,unstyled:l,leftSectionWidth:$,rightSectionPointerEvents:I||"all",rightSectionProps:F,leftSectionProps:q,leftSectionPointerEvents:G,withAria:!1},C.createElement("input",{required:u,"data-invalid":!!d||void 0,"data-with-left-section":!!f||void 0,...Me("innerInput"),disabled:h,id:me,ref:t,...ke,autoComplete:ke.autoComplete||"off",type:Ce?"text":"password"})))});Nr.classes={...wr.classes,...xm};Nr.displayName="@mantine/core/PasswordInput";const[c5,u5]=mc(),d5={},lv=Q((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:s,children:l,name:c,readOnly:u,...d}=U("RadioGroup",d5,e),f=kn(c),[h,m]=gn({value:n,defaultValue:r,finalValue:"",onChange:o}),g=y=>!u&&m(y.currentTarget.value);return C.createElement(c5,{value:{value:h,onChange:g,size:i,name:f}},C.createElement(Ct.Wrapper,{size:i,ref:t,...s,...d,labelElement:"div",__staticSelector:"RadioGroup"},C.createElement(Fy,{role:"radiogroup"},l)))});lv.classes=Ct.Wrapper.classes;lv.displayName="@mantine/core/RadioGroup";function f5({size:e,style:t,...n}){return C.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:B(e),height:B(e),...t},"aria-hidden":!0,...n},C.createElement("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"}))}var Mj={root:"m-f3f1af94",inner:"m-89c4f5e4",icon:"m-f3ed6b2b",radio:"m-8a3dbb89","radio--outline":"m-1bfe9d39"};const h5={labelPosition:"right"},p5=(e,{size:t,radius:n,color:r,iconColor:o,variant:i,autoContrast:s})=>{const l=ao({color:r||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{root:{"--radio-size":Pe(t,"radio-size"),"--radio-radius":n===void 0?void 0:gt(n),"--radio-color":i==="outline"?c:mt(r,e),"--radio-icon-color":o?mt(o,e):gc(s,e)?fs({color:r,theme:e}):void 0,"--radio-icon-size":Pe(t,"radio-icon-size")}}},oc=Q((e,t)=>{const n=U("Radio",h5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,id:u,size:d,label:f,labelPosition:h,description:m,error:g,radius:y,color:S,variant:v,disabled:x,wrapperProps:w,icon:b=f5,rootRef:j,iconColor:E,onChange:P,mod:T,...D}=n,_=de({name:"Radio",classes:Mj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:p5}),O=u5(),I=(O==null?void 0:O.size)??d,$=n.size?d:I,{styleProps:N,rest:L}=No(D),M=kn(u),R=O?{checked:O.value===L.value,name:L.name??O.name,onChange:k=>{O.onChange(k),P==null||P(k)}}:{};return C.createElement(Cf,{..._("root"),__staticSelector:"Radio",__stylesApiProps:n,id:M,size:$,labelPosition:h,label:f,description:m,error:g,disabled:x,classNames:r,styles:s,unstyled:l,"data-checked":R.checked||void 0,variant:v,ref:j,mod:T,...N,...w},C.createElement(W,{..._("inner"),mod:{"label-position":h}},C.createElement(W,{..._("radio",{focusable:!0,variant:v}),onChange:P,...L,...R,component:"input",mod:{error:!!g},ref:t,id:M,disabled:x,type:"radio"}),C.createElement(b,{..._("icon"),"aria-hidden":!0})))});oc.classes=Mj;oc.displayName="@mantine/core/Radio";oc.Group=lv;const m5={duration:100,transition:"fade"};function g5(e,t){return{...m5,...t,...e}}function y5({offset:e,position:t}){const[n,r]=p.useState(!1),o=p.useRef(),{x:i,y:s,elements:l,refs:c,update:u,placement:d}=vy({placement:t,middleware:[py({crossAxis:!0,padding:5,rootBoundary:"document"})]}),f=d.includes("right")?e:t.includes("left")?e*-1:0,h=d.includes("bottom")?e:t.includes("top")?e*-1:0,m=p.useCallback(({clientX:g,clientY:y})=>{c.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:g,y,left:g+f,top:y+h,right:g,bottom:y}}})},[l.reference]);return p.useEffect(()=>{if(c.floating.current){const g=o.current;g.addEventListener("mousemove",m);const y=wo(c.floating.current);return y.forEach(S=>{S.addEventListener("scroll",u)}),()=>{g.removeEventListener("mousemove",m),y.forEach(S=>{S.removeEventListener("scroll",u)})}}},[l.reference,c.floating.current,u,m,n]),{handleMouseMove:m,x:i,y:s,opened:n,setOpened:r,boundaryRef:o,floating:c.setFloating}}var zf={tooltip:"m-1b3c8819",arrow:"m-f898399f"};const v5={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:zr("popover")},x5=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:gt(t),"--tooltip-bg":n?mt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),cv=Q((e,t)=>{const n=U("TooltipFloating",v5,e),{children:r,refProp:o,withinPortal:i,style:s,className:l,classNames:c,styles:u,unstyled:d,radius:f,color:h,label:m,offset:g,position:y,multiline:S,zIndex:v,disabled:x,variant:w,vars:b,portalProps:j,...E}=n,P=kt(),T=de({name:"TooltipFloating",props:n,classes:zf,className:l,style:s,classNames:c,styles:u,unstyled:d,rootSelector:"tooltip",vars:b,varsResolver:x5}),{handleMouseMove:D,x:_,y:O,opened:I,boundaryRef:$,floating:N,setOpened:L}=y5({offset:g,position:y});if(!Ao(r))throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const M=Zt($,r.ref,t),R=F=>{var q,G;(G=(q=r.props).onMouseEnter)==null||G.call(q,F),D(F),L(!0)},k=F=>{var q,G;(G=(q=r.props).onMouseLeave)==null||G.call(q,F),L(!1)};return C.createElement(C.Fragment,null,C.createElement(ys,{...j,withinPortal:i},C.createElement(W,{...E,...T("tooltip",{style:{...KS(s,P),zIndex:v,display:!x&&I?"block":"none",top:(O&&Math.round(O))??"",left:(_&&Math.round(_))??""}}),variant:w,ref:N,mod:{multiline:S}},m)),p.cloneElement(r,{...r.props,[o]:M,onMouseEnter:R,onMouseLeave:k}))});cv.classes=zf;cv.displayName="@mantine/core/TooltipFloating";const Lj=p.createContext(!1),w5=Lj.Provider,S5=()=>p.useContext(Lj),b5={openDelay:0,closeDelay:0};function $j(e){const{openDelay:t,closeDelay:n,children:r}=U("TooltipGroup",b5,e);return C.createElement(w5,{value:!0},C.createElement(l4,{delay:{open:t,close:n}},r))}$j.displayName="@mantine/core/TooltipGroup";function C5(e){var E,P,T;const[t,n]=p.useState(!1),o=typeof e.opened=="boolean"?e.opened:t,i=S5(),s=kn(),{delay:l,currentId:c,setCurrentId:u}=NE(),d=p.useCallback(D=>{n(D),D&&u(s)},[u,s]),{x:f,y:h,context:m,refs:g,update:y,placement:S,middlewareData:{arrow:{x:v,y:x}={}}}=vy({strategy:e.strategy,placement:e.position,open:o,onOpenChange:d,middleware:[SE(e.offset),py({padding:8}),kE(),DE({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[RE()]:[]]}),{getReferenceProps:w,getFloatingProps:b}=p4([a4(m,{enabled:(E=e.events)==null?void 0:E.hover,delay:i?l:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((P=e.events)!=null&&P.touch)}),h4(m,{enabled:(T=e.events)==null?void 0:T.focus,visibleOnly:!0}),g4(m,{role:"tooltip"}),f4(m,{enabled:typeof e.opened>"u"}),c4(m,{id:s})]);BE({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:y}}),Co(()=>{var D;(D=e.onPositionChange)==null||D.call(e,S)},[S]);const j=o&&c&&c!==s;return{x:f,y:h,arrowX:v,arrowY:x,reference:g.setReference,floating:g.setFloating,getFloatingProps:b,getReferenceProps:w,isGroupPhase:j,opened:o,placement:S}}const _1={position:"top",refProp:"ref",withinPortal:!0,inline:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:zr("popover"),positionDependencies:[]},E5=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:gt(t),"--tooltip-bg":n?mt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),qa=Q((e,t)=>{const n=U("Tooltip",_1,e),{children:r,position:o,refProp:i,label:s,openDelay:l,closeDelay:c,onPositionChange:u,opened:d,withinPortal:f,radius:h,color:m,classNames:g,styles:y,unstyled:S,style:v,className:x,withArrow:w,arrowSize:b,arrowOffset:j,arrowRadius:E,arrowPosition:P,offset:T,transitionProps:D,multiline:_,events:O,zIndex:I,disabled:$,positionDependencies:N,onClick:L,onMouseEnter:M,onMouseLeave:R,inline:k,variant:F,keepMounted:q,vars:G,portalProps:oe,mod:xe,floatingStrategy:me,...Ce}=U("Tooltip",_1,n),{dir:je}=hs(),Be=p.useRef(null),Me=C5({position:OE(je,o),closeDelay:c,openDelay:l,onPositionChange:u,opened:d,events:O,arrowRef:Be,arrowOffset:j,offset:typeof T=="number"?T+(w?b/2:0):T,positionDependencies:[...N,r],inline:k,strategy:me}),Ke=de({name:"Tooltip",props:n,classes:zf,className:x,style:v,classNames:g,styles:y,unstyled:S,rootSelector:"tooltip",vars:G,varsResolver:E5});if(!Ao(r))throw new Error("[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const St=Zt(Me.reference,r.ref,t),X=g5(D,{duration:100,transition:"fade"});return C.createElement(C.Fragment,null,C.createElement(ys,{...oe,withinPortal:f},C.createElement(Lo,{...X,keepMounted:q,mounted:!$&&!!Me.opened,duration:Me.isGroupPhase?10:X.duration},ke=>C.createElement(W,{...Ce,variant:F,mod:[{multiline:_},xe],...Me.getFloatingProps({ref:Me.floating,className:Ke("tooltip").className,style:{...Ke("tooltip").style,...ke,zIndex:I,top:Me.y??0,left:Me.x??0}})},s,C.createElement(xy,{ref:Be,arrowX:Me.arrowX,arrowY:Me.arrowY,visible:w,position:Me.placement,arrowSize:b,arrowOffset:j,arrowRadius:E,arrowPosition:P,...Ke("arrow")})))),p.cloneElement(r,Me.getReferenceProps({onClick:L,onMouseEnter:M,onMouseLeave:R,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,[i]:St,className:et(x,r.props.className),...r.props})))});qa.classes=zf;qa.displayName="@mantine/core/Tooltip";qa.Floating=cv;qa.Group=$j;function j5({size:e,thickness:t,sum:n,value:r,root:o,offset:i}){const s=(e*.9-t*2)/2,l=Math.PI*s*2/100,c=o||r===void 0?`${(100-n)*l}, ${n*l}`:`${r*l}, ${(100-r)*l}`;return{strokeWidth:Number.isNaN(t)?12:t,cx:e/2||0,cy:e/2||0,r:s||0,transform:o?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:c,strokeDashoffset:o?0:i||0}}function Fj({size:e,value:t,offset:n,sum:r,thickness:o,root:i,color:s,lineRoundCaps:l,tooltip:c,getStyles:u,display:d,...f}){const h=kt();return C.createElement(qa.Floating,{disabled:!c,label:c},C.createElement(W,{component:"circle",...f,...u("curve"),__vars:{"--curve-color":s?mt(s,h):void 0},fill:"none",strokeLinecap:l?"round":"butt",...j5({sum:r,size:e,thickness:o,value:t,offset:n,root:i})}))}Fj.displayName="@mantine/core/Curve";function P5({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:o}){const i=n.reduce((d,f)=>d+f.value,0),s=Math.PI*((e*.9-t*2)/2)*2;let l=s;const c=[],u=[];for(let d=0;d<n.length;d+=1)c.push({sum:i,offset:l,data:n[d],root:!1}),l-=n[d].value/100*s;if(c.push({sum:i,offset:l,data:{color:o},root:!0}),u.push({...c[c.length-1],lineRoundCaps:!1}),c.length>2){u.push({...c[0],lineRoundCaps:r}),u.push({...c[c.length-2],lineRoundCaps:r});for(let d=1;d<=c.length-3;d+=1)u.push({...c[d],lineRoundCaps:!1})}else u.push({...c[0],lineRoundCaps:r});return u}var zj={root:"m-b32e4812",svg:"m-d43b5134",curve:"m-b1ca1fbf",label:"m-b23f9dc4"};function T5(e,t){return Math.min(e||12,(t||120)/4)}const k5={size:120,thickness:12},R5=(e,{size:t,thickness:n})=>({root:{"--rp-size":B(t),"--rp-label-offset":B(n*2)}}),Bf=Q((e,t)=>{const n=U("RingProgress",k5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,label:u,sections:d,size:f,thickness:h,roundCaps:m,rootColor:g,...y}=n,S=de({name:"RingProgress",classes:zj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:R5}),v=T5(h,f),x=P5({size:f,thickness:v,sections:d,renderRoundedLineCaps:m,rootColor:g}).map(({data:w,sum:b,root:j,lineRoundCaps:E,offset:P},T)=>C.createElement(Fj,{...w,key:T,size:f,thickness:v,sum:b,offset:P,color:w==null?void 0:w.color,root:j,lineRoundCaps:E,getStyles:S}));return C.createElement(W,{...S("root"),size:f,ref:t,...y},C.createElement("svg",{...S("svg")},x),u&&C.createElement("div",{...S("label")},u))});Bf.classes=zj;Bf.displayName="@mantine/core/RingProgress";function Pu(e,t){const n=parseFloat(e.replace("px",""));return Number.isNaN(n)?t:n}function D5(e,t){const n=window.getComputedStyle(e);return{top:Pu(n.getPropertyValue("padding-top"),t),right:Pu(n.getPropertyValue("padding-right"),t),bottom:Pu(n.getPropertyValue("padding-bottom"),t),left:Pu(n.getPropertyValue("padding-left"),t)}}var Bj={root:"m-cf365364",indicator:"m-9e182ccd",label:"m-1738fcb2",input:"m-1714d588",control:"m-69686b9b"};const I5=4,_5={withItemsBorders:!0},A5=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:i})=>({root:{"--sc-radius":t===void 0?void 0:gt(t),"--sc-color":n?mt(n,e):void 0,"--sc-shadow":n?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":i,"--sc-padding":Pe(o,"sc-padding"),"--sc-font-size":Kt(o)}}),uv=Q((e,t)=>{var Ke,St;const n=U("SegmentedControl",_5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,data:u,value:d,defaultValue:f,onChange:h,size:m,name:g,disabled:y,readOnly:S,fullWidth:v,orientation:x,radius:w,color:b,transitionDuration:j,transitionTimingFunction:E,variant:P,autoContrast:T,withItemsBorders:D,mod:_,...O}=n,I=de({name:"SegmentedControl",props:n,classes:Bj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:A5}),{dir:$}=hs(),N=kt(),L=u.map(X=>typeof X=="string"?{label:X,value:X}:X),[M,R]=gn({value:d,defaultValue:f,finalValue:Array.isArray(u)?((Ke=L.find(X=>!X.disabled))==null?void 0:Ke.value)??((St=u[0])==null?void 0:St.value)??null:null,onChange:h}),[k,F]=p.useState({width:0,height:0,translate:[0,0]}),q=kn(g),G=p.useRef({}),oe=p.useRef(null),[xe,me]=p.useState(!1),[Ce,je]=D2();p.useEffect(()=>{if(Ce.current){const X=G.current[M];if(X){const ke=D5(oe.current,I5),tt=X.getBoundingClientRect(),Ne=X.offsetWidth/tt.width,Ve=X.clientWidth*Ne||0,Rt=X.clientHeight*Ne||0,ln=je.width-X.parentElement.offsetLeft+($==="rtl"?ke.left:ke.right)-Ve,br=X.parentElement.offsetLeft-($==="rtl"?ke.right:ke.left);F({width:Ve,height:Rt,translate:[$==="rtl"?ln*-1:br,X.parentElement.offsetTop-ke.top]})}else F({width:0,height:0,translate:[0,0]})}},[M,je,$]),_2(()=>{BS()!=="test"&&me(!0)},20,{autoInvoke:!0});const Be=L.map(X=>C.createElement(W,{...I("control"),mod:{active:M===X.value,orientation:x},key:X.value},C.createElement("input",{...I("input"),disabled:y||X.disabled,type:"radio",name:q,value:X.value,id:`${q}-${X.value}`,checked:M===X.value,onChange:()=>!S&&R(X.value),"data-focus-ring":N.focusRing}),C.createElement(W,{component:"label",...I("label"),mod:{active:M===X.value&&!(y||X.disabled),disabled:y||X.disabled,"read-only":S},htmlFor:`${q}-${X.value}`,ref:ke=>{G.current[X.value]=ke},__vars:{"--sc-label-color":b!==void 0?fs({color:b,theme:N,autoContrast:T}):void 0}},X.label))),Me=Zt(Ce,oe,t);return u.length===0?null:C.createElement(W,{...I("root"),variant:P,size:m,ref:Me,mod:[{"full-width":v,orientation:x,initialization:!xe,"with-items-borders":D},_],...O,role:"radiogroup"},typeof M=="string"&&C.createElement(W,{component:"span",...I("indicator"),__vars:{"--sc-indicator-width":`${k.width}px`,"--sc-indicator-height":`${k.height}px`,"--sc-indicator-transform":`translate(${k.translate[0]}px, ${k.translate[1]}px)`}}),Be)});uv.classes=Bj;uv.displayName="@mantine/core/SegmentedControl";function N5({spacing:e,verticalSpacing:t,cols:n,selector:r}){var d;const o=kt(),i=t===void 0?e:t,s=ds({"--sg-spacing-x":rn(ni(e)),"--sg-spacing-y":rn(ni(i)),"--sg-cols":(d=ni(n))==null?void 0:d.toString()}),l=pt(o.breakpoints).reduce((f,h)=>(f[h]||(f[h]={}),typeof e=="object"&&e[h]!==void 0&&(f[h]["--sg-spacing-x"]=rn(e[h])),typeof i=="object"&&i[h]!==void 0&&(f[h]["--sg-spacing-y"]=rn(i[h])),typeof n=="object"&&n[h]!==void 0&&(f[h]["--sg-cols"]=n[h]),f),{}),u=Ll(pt(l),o).filter(f=>pt(l[f.value]).length>0).map(f=>({query:`(min-width: ${o.breakpoints[f.value]})`,styles:l[f.value]}));return C.createElement(La,{styles:s,media:u,selector:r})}var Uj={root:"m-2415a157"};const O5={cols:1,spacing:"md"},dv=Q((e,t)=>{const n=U("SimpleGrid",O5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,cols:u,verticalSpacing:d,spacing:f,...h}=n,m=de({name:"SimpleGrid",classes:Uj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c}),g=yc();return C.createElement(C.Fragment,null,C.createElement(N5,{...n,selector:`.${g}`}),C.createElement(W,{ref:t,...m("root",{className:g}),...h}))});dv.classes=Uj;dv.displayName="@mantine/core/SimpleGrid";const M5={},Uf=Q((e,t)=>{const{w:n,h:r,miw:o,mih:i,...s}=U("Space",M5,e);return C.createElement(W,{ref:t,...s,w:n,miw:o??n,h:r,mih:i??r})});Uf.displayName="@mantine/core/Space";var Vj={root:"m-6d731127"};const L5={gap:"md",align:"stretch",justify:"flex-start"},$5=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":rn(t),"--stack-align":n,"--stack-justify":r}}),be=Q((e,t)=>{const n=U("Stack",L5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,align:u,justify:d,gap:f,variant:h,...m}=n,g=de({name:"Stack",props:n,classes:Vj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:$5});return C.createElement(W,{ref:t,...g("root"),variant:h,...m})});be.classes=Vj;be.displayName="@mantine/core/Stack";const[F5,z5]=Tn("Stepper component was not found in tree"),Id=()=>null;Id.displayName="@mantine/core/StepperCompleted";var fv={root:"m-cbb4ea7e",steps:"m-aaf89d0b",separator:"m-2a371ac9",content:"m-78da155d",step:"m-cbb57068","step--horizontal":"m-f56b1e2c","step--vertical":"m-833edb7e",verticalSeparator:"m-6496b3f3",stepWrapper:"m-818e70b",stepIcon:"m-1959ad01",stepCompletedIcon:"m-a79331dc",stepBody:"m-1956aa2a",stepLabel:"m-12051f6c",stepDescription:"m-164eea74"};const Tu=(e,t)=>typeof e=="function"?C.createElement(e,{step:t||0}):e,B5={withIcon:!0,allowStepClick:!0,iconPosition:"left"},hv=Q((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,step:l,state:c,color:u,icon:d,completedIcon:f,progressIcon:h,label:m,description:g,withIcon:y,iconSize:S,loading:v,allowStepClick:x,allowStepSelect:w,iconPosition:b,orientation:j,mod:E,...P}=U("StepperStep",B5,e),T=z5(),D=kt(),_={classNames:n,styles:i},O=c==="stepCompleted"?null:c==="stepProgress"?h:d,I={"data-progress":c==="stepProgress"||void 0,"data-completed":c==="stepCompleted"||void 0};return C.createElement(Jn,{...T.getStyles("step",{className:r,style:o,variant:T.orientation,..._}),mod:[{"icon-position":b||T.iconPosition,"allow-click":x},E],ref:t,...I,...P,__vars:{"--step-color":u?mt(u,D):void 0},tabIndex:x?0:-1},y&&C.createElement("span",{...T.getStyles("stepWrapper",_)},C.createElement("span",{...T.getStyles("stepIcon",_),...I},C.createElement(Lo,{mounted:c==="stepCompleted",transition:"pop",duration:200},$=>C.createElement("span",{...T.getStyles("stepCompletedIcon",{style:$,..._})},v?C.createElement(Vn,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...T.getStyles("stepLoader",_)}):Tu(f,l)||C.createElement(Ef,{size:"60%"}))),c!=="stepCompleted"?v?C.createElement(Vn,{...T.getStyles("stepLoader",_),size:"calc(var(--stepper-icon-size) / 2)",color:u}):Tu(O||d,l):null),j==="vertical"&&C.createElement("span",{...T.getStyles("verticalSeparator",_),"data-active":c==="stepCompleted"||void 0})),(m||g)&&C.createElement("span",{...T.getStyles("stepBody",_),"data-orientation":T.orientation,"data-icon-position":b||T.iconPosition},m&&C.createElement("span",{...T.getStyles("stepLabel",_)},Tu(m,l)),g&&C.createElement("span",{...T.getStyles("stepDescription",_)},Tu(g,l))))});hv.classes=fv;hv.displayName="@mantine/core/StepperStep";const U5={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},V5=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:i,autoContrast:s})=>({root:{"--stepper-color":t?mt(t,e):void 0,"--stepper-icon-color":gc(s,e)?fs({color:t,theme:e}):void 0,"--stepper-icon-size":n===void 0?Pe(r,"stepper-icon-size"):B(n),"--stepper-content-padding":rn(o),"--stepper-radius":i===void 0?void 0:gt(i),"--stepper-fz":Kt(r),"--stepper-spacing":rn(r)}}),Ra=Q((e,t)=>{var R,k,F;const n=U("Stepper",U5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,children:u,onStepClick:d,active:f,icon:h,completedIcon:m,progressIcon:g,color:y,iconSize:S,contentPadding:v,orientation:x,iconPosition:w,size:b,radius:j,allowNextStepsSelect:E,wrap:P,...T}=n,D=de({name:"Stepper",classes:fv,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:V5}),_=p.Children.toArray(u),O=_.filter(q=>q.type!==Id),I=_.find(q=>q.type===Id),$=O.reduce((q,G,oe)=>{const xe=f===oe?"stepProgress":f>oe?"stepCompleted":"stepInactive",Ce=typeof d!="function"?!1:typeof G.props.allowStepSelect=="boolean"?G.props.allowStepSelect:xe==="stepCompleted"||E;return q.push(p.cloneElement(G,{icon:G.props.icon||h||oe+1,key:oe,step:oe,state:xe,onClick:()=>Ce&&(d==null?void 0:d(oe)),allowStepClick:Ce,completedIcon:G.props.completedIcon||m,progressIcon:G.props.progressIcon||g,color:G.props.color||y,iconSize:S,radius:j,iconPosition:G.props.iconPosition||w,orientation:x,unstyled:l})),x==="horizontal"&&oe!==O.length-1&&q.push(C.createElement("div",{...D("separator"),"data-active":oe<f||void 0,"data-orientation":x,key:`separator-${oe}`})),q},[]),N=(k=(R=O[f])==null?void 0:R.props)==null?void 0:k.children,L=(F=I==null?void 0:I.props)==null?void 0:F.children,M=f>O.length-1?L:N;return C.createElement(F5,{value:{getStyles:D,orientation:x,iconPosition:w}},C.createElement(W,{...D("root"),ref:t,size:b,...T},C.createElement(W,{...D("steps"),mod:{orientation:x,"icon-position":w,wrap:P&&x!=="vertical"}},$),M&&C.createElement("div",{...D("content")},M)))});Ra.classes=fv;Ra.displayName="@mantine/core/Stepper";Ra.Completed=Id;Ra.Step=hv;const Wj=p.createContext(null),W5=Wj.Provider,H5=()=>p.useContext(Wj),q5={},pv=Q((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:s,children:l,readOnly:c,...u}=U("SwitchGroup",q5,e),[d,f]=gn({value:n,defaultValue:r,finalValue:[],onChange:o}),h=m=>{const g=m.currentTarget.value;!c&&f(d.includes(g)?d.filter(y=>y!==g):[...d,g])};return C.createElement(W5,{value:{value:d,onChange:h,size:i}},C.createElement(Ct.Wrapper,{size:i,ref:t,...s,...u,labelElement:"div",__staticSelector:"SwitchGroup"},C.createElement(Fy,{role:"group"},l)))});pv.classes=Ct.Wrapper.classes;pv.displayName="@mantine/core/SwitchGroup";var Hj={root:"m-5f93f3bb",input:"m-926b4011",track:"m-9307d992",thumb:"m-93039a1d",trackLabel:"m-8277e082"};const G5={labelPosition:"right"},Q5=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:gt(t),"--switch-height":Pe(r,"switch-height"),"--switch-width":Pe(r,"switch-width"),"--switch-thumb-size":Pe(r,"switch-thumb-size"),"--switch-label-font-size":Pe(r,"switch-label-font-size"),"--switch-track-label-padding":Pe(r,"switch-track-label-padding"),"--switch-color":n?mt(n,e):void 0}}),Ac=Q((e,t)=>{const n=U("Switch",G5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,color:u,label:d,offLabel:f,onLabel:h,id:m,size:g,radius:y,wrapperProps:S,children:v,thumbIcon:x,checked:w,defaultChecked:b,onChange:j,labelPosition:E,description:P,error:T,disabled:D,variant:_,rootRef:O,mod:I,...$}=n,N=H5(),L=g||(N==null?void 0:N.size),M=de({name:"Switch",props:n,classes:Hj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:Q5}),{styleProps:R,rest:k}=No($),F=kn(m),q=N?{checked:N.value.includes(k.value),onChange:N.onChange}:{},[G,oe]=gn({value:q.checked??w,defaultValue:b,finalValue:!1});return C.createElement(Cf,{...M("root"),__staticSelector:"Switch",__stylesApiProps:n,id:F,size:L,labelPosition:E,label:d,description:P,error:T,disabled:D,bodyElement:"label",labelElement:"span",classNames:r,styles:s,unstyled:l,"data-checked":q.checked||void 0,variant:_,ref:O,mod:I,...R,...S},C.createElement("input",{...k,disabled:D,checked:G,onChange:xe=>{var me;N?(me=q.onChange)==null||me.call(q,xe):j==null||j(xe),oe(xe.currentTarget.checked)},id:F,ref:t,type:"checkbox",role:"switch",...M("input")}),C.createElement(W,{"aria-hidden":"true",mod:{error:T,"label-position":E},...M("track")},C.createElement(W,{component:"span",mod:"reduce-motion",...M("thumb")},x),C.createElement("span",{...M("trackLabel")},G?h:f)))});Ac.classes={...Hj,...uj};Ac.displayName="@mantine/core/Switch";Ac.Group=pv;const[K5,Y5]=Tn("Table component was not found in the tree");var Nc={table:"m-b23fa0ef",th:"m-4e7aa4f3",tr:"m-4e7aa4fd",td:"m-4e7aa4ef",tbody:"m-b2404537",thead:"m-b242d975",caption:"m-9e5a3ac7",scrollContainer:"m-a100c15",scrollContainerInner:"m-62259741"};function X5(e,t){if(!t)return;const n={};return t.columnBorder&&e.withColumnBorders&&(n["data-with-column-border"]=!0),t.rowBorder&&e.withRowBorders&&(n["data-with-row-border"]=!0),t.striped&&e.striped&&(n["data-striped"]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n["data-hover"]=!0),t.captionSide&&e.captionSide&&(n["data-side"]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n["data-sticky"]=!0),n}function Ss(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=Q((o,i)=>{const s=U(n,{},o),{classNames:l,className:c,style:u,styles:d,...f}=s,h=Y5();return C.createElement(W,{component:e,ref:i,...X5(h,t),...h.getStyles(e,{className:c,classNames:l,style:u,styles:d,props:s}),...f})});return r.displayName=`@mantine/core/${n}`,r.classes=Nc,r}const wm=Ss("th",{columnBorder:!0}),qj=Ss("td",{columnBorder:!0}),Ku=Ss("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),Gj=Ss("thead",{stickyHeader:!0}),Qj=Ss("tbody"),Kj=Ss("tfoot"),Yj=Ss("caption",{captionSide:!0});function mv({data:e}){return C.createElement(C.Fragment,null,e.caption&&C.createElement(Yj,null,e.caption),e.head&&C.createElement(Gj,null,C.createElement(Ku,null,e.head.map((t,n)=>C.createElement(wm,{key:n},t)))),e.body&&C.createElement(Qj,null,e.body.map((t,n)=>C.createElement(Ku,{key:n},t.map((r,o)=>C.createElement(qj,{key:o},r))))),e.foot&&C.createElement(Kj,null,C.createElement(Ku,null,e.foot.map((t,n)=>C.createElement(wm,{key:n},t)))))}mv.displayName="@mantine/core/TableDataRenderer";const J5={type:"scrollarea"},Z5=(e,{minWidth:t,type:n})=>({scrollContainer:{"--table-min-width":B(t),"--table-overflow":n==="native"?"auto":void 0}}),gv=Q((e,t)=>{const n=U("TableScrollContainer",J5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,children:u,minWidth:d,type:f,...h}=n,m=de({name:"TableScrollContainer",classes:Nc,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:Z5,rootSelector:"scrollContainer"});return C.createElement(W,{component:f==="scrollarea"?vr:"div",...f==="scrollarea"?{offsetScrollbars:"x"}:{},ref:t,...m("scrollContainer"),...h},C.createElement("div",{...m("scrollContainerInner")},u))});gv.classes=Nc;gv.displayName="@mantine/core/TableScrollContainer";const eO={withRowBorders:!0,verticalSpacing:7},tO=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:o,borderColor:i,stripedColor:s,highlightOnHoverColor:l,striped:c,highlightOnHover:u,stickyHeaderOffset:d,stickyHeader:f})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":rn(r),"--table-vertical-spacing":rn(o),"--table-border-color":i?mt(i,e):void 0,"--table-striped-color":c&&s?mt(s,e):void 0,"--table-highlight-on-hover-color":u&&l?mt(l,e):void 0,"--table-sticky-header-offset":f?B(d):void 0}}),le=Q((e,t)=>{const n=U("Table",eO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,horizontalSpacing:u,verticalSpacing:d,captionSide:f,stripedColor:h,highlightOnHoverColor:m,striped:g,highlightOnHover:y,withColumnBorders:S,withRowBorders:v,withTableBorder:x,borderColor:w,layout:b,variant:j,data:E,children:P,stickyHeader:T,stickyHeaderOffset:D,mod:_,...O}=n,I=de({name:"Table",props:n,className:o,style:i,classes:Nc,classNames:r,styles:s,unstyled:l,rootSelector:"table",vars:c,varsResolver:tO});return C.createElement(K5,{value:{getStyles:I,stickyHeader:T,striped:g===!0?"odd":g||void 0,highlightOnHover:y,withColumnBorders:S,withRowBorders:v,captionSide:f||"bottom"}},C.createElement(W,{component:"table",variant:j,ref:t,mod:[{"data-with-table-border":x},_],...I("table"),...O},P||!!E&&C.createElement(mv,{data:E})))});le.classes=Nc;le.displayName="@mantine/core/Table";le.Td=qj;le.Th=wm;le.Tr=Ku;le.Thead=Gj;le.Tbody=Qj;le.Tfoot=Kj;le.Caption=Yj;le.ScrollContainer=gv;le.DataRenderer=mv;const[nO,yv]=Tn("Tabs component was not found in the tree");var Oc={root:"m-89d60db1","list--default":"m-576c9d4",list:"m-89d33d6d",panel:"m-b0c91715",tab:"m-4ec4dce6",tabSection:"m-fc420b1f","tab--default":"m-539e827b","list--outline":"m-6772fbd5","tab--outline":"m-b59ab47c","tab--pills":"m-c3381914"};const rO={},vv=Q((e,t)=>{const n=U("TabsList",rO,e),{children:r,className:o,grow:i,justify:s,classNames:l,styles:c,style:u,mod:d,...f}=n,h=yv();return C.createElement(W,{...f,...h.getStyles("list",{className:o,style:u,classNames:l,styles:c,props:n,variant:h.variant}),ref:t,role:"tablist",variant:h.variant,mod:[{grow:i,orientation:h.orientation,placement:h.orientation==="vertical"&&h.placement,inverted:h.inverted},d],"aria-orientation":h.orientation,__vars:{"--tabs-justify":s}},r)});vv.classes=Oc;vv.displayName="@mantine/core/TabsList";const oO={},xv=Q((e,t)=>{const n=U("TabsPanel",oO,e),{children:r,className:o,value:i,classNames:s,styles:l,style:c,mod:u,...d}=n,f=yv(),h=f.value===i,m=f.keepMounted||n.keepMounted||h?r:null;return C.createElement(W,{...d,...f.getStyles("panel",{className:o,classNames:s,styles:l,style:[c,h?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:f.orientation},u],role:"tabpanel",id:f.getPanelId(i),"aria-labelledby":f.getTabId(i)},m)});xv.classes=Oc;xv.displayName="@mantine/core/TabsPanel";const iO={},wv=Q((e,t)=>{const n=U("TabsTab",iO,e),{className:r,children:o,rightSection:i,leftSection:s,value:l,onClick:c,onKeyDown:u,disabled:d,color:f,style:h,classNames:m,styles:g,vars:y,mod:S,...v}=n,x=kt(),{dir:w}=hs(),b=yv(),j=l===b.value,E=T=>{b.onChange(b.allowTabDeactivation&&l===b.value?null:l),c==null||c(T)},P={classNames:m,styles:g,props:n};return C.createElement(Jn,{...v,...b.getStyles("tab",{className:r,style:h,variant:b.variant,...P}),disabled:d,unstyled:b.unstyled,variant:b.variant,mod:[{active:j,disabled:d,orientation:b.orientation,inverted:b.inverted,placement:b.orientation==="vertical"&&b.placement},S],ref:t,role:"tab",id:b.getTabId(l),"aria-selected":j,tabIndex:j||b.value===null?0:-1,"aria-controls":b.getPanelId(l),onClick:E,__vars:{"--tabs-color":f?mt(f,x):void 0},onKeyDown:_S({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:b.activateTabWithKeyboard,loop:b.loop,orientation:b.orientation||"horizontal",dir:w,onKeyDown:u})},s&&C.createElement("span",{...b.getStyles("tabSection",P),"data-position":"left"},s),o&&C.createElement("span",{...b.getStyles("tabLabel",P)},o),i&&C.createElement("span",{...b.getStyles("tabSection",P),"data-position":"right"},i))});wv.classes=Oc;wv.displayName="@mantine/core/TabsTab";const A1="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",sO={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},aO=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":gt(t),"--tabs-color":mt(n,e),"--tabs-text-color":gc(r,e)?fs({color:n,theme:e}):void 0}}),Ge=Q((e,t)=>{const n=U("Tabs",sO,e),{defaultValue:r,value:o,onChange:i,orientation:s,children:l,loop:c,id:u,activateTabWithKeyboard:d,allowTabDeactivation:f,variant:h,color:m,radius:g,inverted:y,placement:S,keepMounted:v,classNames:x,styles:w,unstyled:b,className:j,style:E,vars:P,autoContrast:T,mod:D,..._}=n,O=kn(u),[I,$]=gn({value:o,defaultValue:r,finalValue:null,onChange:i}),N=de({name:"Tabs",props:n,classes:Oc,className:j,style:E,classNames:x,styles:w,unstyled:b,vars:P,varsResolver:aO});return C.createElement(nO,{value:{placement:S,value:I,orientation:s,id:O,loop:c,activateTabWithKeyboard:d,getTabId:N0(`${O}-tab`,A1),getPanelId:N0(`${O}-panel`,A1),onChange:$,allowTabDeactivation:f,variant:h,color:m,radius:g,inverted:y,keepMounted:v,unstyled:b,getStyles:N}},C.createElement(W,{ref:t,id:O,variant:h,mod:[{orientation:s,inverted:s==="horizontal"&&y,placement:s==="vertical"&&S},D],...N("root"),..._},l))});Ge.classes=Oc;Ge.displayName="@mantine/core/Tabs";Ge.Tab=wv;Ge.Panel=xv;Ge.List=vv;const lO={},ae=Q((e,t)=>{const n=U("TextInput",lO,e);return C.createElement(wr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});ae.classes=wr.classes;ae.displayName="@mantine/core/TextInput";var Xj={root:"m-7341320d"};const cO={},uO=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:s})=>{const l=e.variantColorResolver({color:i||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:s});return{root:{"--ti-size":Pe(t,"ti-size"),"--ti-radius":n===void 0?void 0:gt(n),"--ti-bg":i||r?l.background:void 0,"--ti-color":i||r?l.color:void 0,"--ti-bd":i||r?l.border:void 0}}},Sv=Q((e,t)=>{const n=U("ThemeIcon",cO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,autoContrast:u,...d}=n,f=de({name:"ThemeIcon",classes:Xj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:uO});return C.createElement(W,{ref:t,...f("root"),...d})});Sv.classes=Xj;Sv.displayName="@mantine/core/ThemeIcon";const dO=["h1","h2","h3","h4","h5","h6"];function fO(e,t){const n=t!==void 0?t:`h${e}`;return dO.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:{fontSize:B(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var Jj={root:"m-8a5d1357"};const hO={order:1},pO=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const i=fO(t,n);return{root:{"--title-fw":i.fontWeight,"--title-lh":i.lineHeight,"--title-fz":i.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":o}}},ue=Q((e,t)=>{const n=U("Title",hO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,order:c,vars:u,size:d,variant:f,lineClamp:h,textWrap:m,mod:g,...y}=n,S=de({name:"Title",props:n,classes:Jj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:u,varsResolver:pO});return[1,2,3,4,5,6].includes(c)?C.createElement(W,{...S("root"),component:`h${c}`,variant:f,ref:t,mod:[{order:c,"data-line-clamp":typeof h=="number"},g],size:d,...y}):null});ue.classes=Jj;ue.displayName="@mantine/core/Title";function mO(e){let t=e,n=!1;const r=new Set;return{getState(){return t},updateState(o){t=typeof o=="function"?o(t):o},setState(o){this.updateState(o),r.forEach(i=>i(t))},initialize(o){n||(t=o,n=!0)},subscribe(o){return r.add(o),()=>r.delete(o)}}}function gO(e){return p.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}const yO=()=>mO({notifications:[],queue:[],limit:5}),bs=yO(),vO=(e=bs)=>gO(e);function Ga(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]);e.setState({notifications:r.slice(0,n.limit),queue:r.slice(n.limit),limit:n.limit})}function fe(e,t=bs){const n=e.id||og();return Ga(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function Zj(e,t=bs){return Ga(t,n=>n.filter(r=>{var o;return r.id===e?((o=r.onClose)==null||o.call(r,r),!1):!0})),e}function El(e,t=bs){return Ga(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function xO(e=bs){Ga(e,()=>[])}function wO(e=bs){Ga(e,t=>t.slice(0,e.getState().limit))}const oo={show:fe,hide:Zj,update:El,clean:xO,cleanQueue:wO,updateState:Ga};function Sm(e,t){return Sm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Sm(e,t)}function eP(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Sm(e,t)}var tP={exports:{}},SO="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",bO=SO,CO=bO;function nP(){}function rP(){}rP.resetWarningCache=nP;var EO=function(){function e(r,o,i,s,l,c){if(c!==CO){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:rP,resetWarningCache:nP};return n.PropTypes=n,n};tP.exports=EO();var jO=tP.exports;const st=Km(jO),N1={disabled:!1},_d=C.createContext(null);var PO=function(t){return t.scrollTop},jl="unmounted",Mi="exited",Li="entering",Vs="entered",bm="exiting",zo=function(e){eP(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var s=o,l=s&&!s.isMounting?r.enter:r.appear,c;return i.appearStatus=null,r.in?l?(c=Mi,i.appearStatus=Li):c=Vs:r.unmountOnExit||r.mountOnEnter?c=jl:c=Mi,i.state={status:c},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===jl?{status:Mi}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var s=this.state.status;this.props.in?s!==Li&&s!==Vs&&(i=Li):(s===Li||s===Vs)&&(i=bm)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,s,l;return i=s=l=o,o!=null&&typeof o!="number"&&(i=o.exit,s=o.enter,l=o.appear!==void 0?o.appear:s),{exit:i,enter:s,appear:l}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===Li){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:na.findDOMNode(this);s&&PO(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Mi&&this.setState({status:jl})},n.performEnter=function(o){var i=this,s=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[na.findDOMNode(this),l],u=c[0],d=c[1],f=this.getTimeouts(),h=l?f.appear:f.enter;if(!o&&!s||N1.disabled){this.safeSetState({status:Vs},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:Li},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:Vs},function(){i.props.onEntered(u,d)})})})},n.performExit=function(){var o=this,i=this.props.exit,s=this.getTimeouts(),l=this.props.nodeRef?void 0:na.findDOMNode(this);if(!i||N1.disabled){this.safeSetState({status:Mi},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:bm},function(){o.props.onExiting(l),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:Mi},function(){o.props.onExited(l)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,s=!0;return this.nextCallback=function(l){s&&(s=!1,i.nextCallback=null,o(l))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var s=this.props.nodeRef?this.props.nodeRef.current:na.findDOMNode(this),l=o==null&&!this.props.addEndListener;if(!s||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],u=c[0],d=c[1];this.props.addEndListener(u,d)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===jl)return null;var i=this.props,s=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var l=Qy(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return C.createElement(_d.Provider,{value:null},typeof s=="function"?s(o,l):C.cloneElement(C.Children.only(s),l))},t}(C.Component);zo.contextType=_d;zo.propTypes={};function Ls(){}zo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ls,onEntering:Ls,onEntered:Ls,onExit:Ls,onExiting:Ls,onExited:Ls};zo.UNMOUNTED=jl;zo.EXITED=Mi;zo.ENTERING=Li;zo.ENTERED=Vs;zo.EXITING=bm;const TO=zo;function kO(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bv(e,t){var n=function(i){return t&&p.isValidElement(i)?t(i):i},r=Object.create(null);return e&&p.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function RO(e,t){e=e||{},t=t||{};function n(d){return d in t?t[d]:e[d]}var r=Object.create(null),o=[];for(var i in e)i in t?o.length&&(r[i]=o,o=[]):o.push(i);var s,l={};for(var c in t){if(r[c])for(s=0;s<r[c].length;s++){var u=r[c][s];l[r[c][s]]=n(u)}l[c]=n(c)}for(s=0;s<o.length;s++)l[o[s]]=n(o[s]);return l}function Wi(e,t,n){return n[t]!=null?n[t]:e.props[t]}function DO(e,t){return bv(e.children,function(n){return p.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Wi(n,"appear",e),enter:Wi(n,"enter",e),exit:Wi(n,"exit",e)})})}function IO(e,t,n){var r=bv(e.children),o=RO(t,r);return Object.keys(o).forEach(function(i){var s=o[i];if(p.isValidElement(s)){var l=i in t,c=i in r,u=t[i],d=p.isValidElement(u)&&!u.props.in;c&&(!l||d)?o[i]=p.cloneElement(s,{onExited:n.bind(null,s),in:!0,exit:Wi(s,"exit",e),enter:Wi(s,"enter",e)}):!c&&l&&!d?o[i]=p.cloneElement(s,{in:!1}):c&&l&&p.isValidElement(u)&&(o[i]=p.cloneElement(s,{onExited:n.bind(null,s),in:u.props.in,exit:Wi(s,"exit",e),enter:Wi(s,"enter",e)}))}}),o}var _O=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},AO={component:"div",childFactory:function(t){return t}},Cv=function(e){eP(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var s=i.handleExited.bind(kO(i));return i.state={contextValue:{isMounting:!0},handleExited:s,firstRender:!0},i}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,i){var s=i.children,l=i.handleExited,c=i.firstRender;return{children:c?DO(o,l):IO(o,s,l),firstRender:!1}},n.handleExited=function(o,i){var s=bv(this.props.children);o.key in s||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(l){var c=Dd({},l.children);return delete c[o.key],{children:c}}))},n.render=function(){var o=this.props,i=o.component,s=o.childFactory,l=Qy(o,["component","childFactory"]),c=this.state.contextValue,u=_O(this.state.children).map(s);return delete l.appear,delete l.enter,delete l.exit,i===null?C.createElement(_d.Provider,{value:c},u):C.createElement(_d.Provider,{value:c},C.createElement(i,l,u))},t}(C.Component);Cv.propTypes={};Cv.defaultProps=AO;const NO=Cv,O1={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},OO={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function MO({state:e,maxHeight:t,position:n,transitionDuration:r}){const[o,i]=n.split("-"),s=i==="center"?`${o}-center`:i,l={opacity:0,maxHeight:t,transform:O1[s],transitionDuration:`${r}ms, ${r}ms, ${r}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},c={opacity:1,transform:OO[s]},u={opacity:0,maxHeight:0,transform:O1[s]};return{...l,...{entering:c,entered:c,exiting:u,exited:u}[e]}}function LO(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const oP=p.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:i,message:s,...l}=e,c=LO(n,e.autoClose),u=p.useRef(),d=()=>window.clearTimeout(u.current),f=()=>{t(e.id),d()},h=()=>{typeof c=="number"&&(u.current=window.setTimeout(f,c))};return p.useEffect(()=>{var m;(m=e.onOpen)==null||m.call(e,e)},[]),p.useEffect(()=>(h(),d),[c]),C.createElement(sv,{...r,...l,onClose:f,ref:o,onMouseEnter:d,onMouseLeave:h},s)});oP.displayName="@mantine/notifications/NotificationContainer";var iP={root:"m-b37d9ac7",notification:"m-5ed0edd0"};const $O=TO,FO={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:zr("overlay"),store:bs,withinPortal:!0},zO=(e,{zIndex:t,position:n,containerWidth:r})=>{const[o,i]=n.split("-");return{root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-top":o==="top"?"var(--mantine-spacing-md)":void 0,"--notifications-bottom":o==="bottom"?"var(--mantine-spacing-md)":void 0,"--notifications-left":i==="left"?"var(--mantine-spacing-md)":i==="center"?"50%":void 0,"--notifications-right":i==="right"?"var(--mantine-spacing-md)":void 0,"--notifications-transform":i==="center"?"translateX(-50%)":void 0,"--notifications-container-width":B(r)}}},Bo=Q((e,t)=>{const n=U("Notifications",FO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,position:u,autoClose:d,transitionDuration:f,containerWidth:h,notificationMaxHeight:m,limit:g,zIndex:y,store:S,portalProps:v,withinPortal:x,...w}=n,b=kt(),j=vO(S),E=E2(),P=sg(),T=p.useRef({}),D=p.useRef(0),O=(b.respectReducedMotion?P:!1)?1:f,I=de({name:"Notifications",classes:iP,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:zO});p.useEffect(()=>{S==null||S.updateState(N=>({...N,limit:g||5}))},[g]),Co(()=>{j.notifications.length>D.current&&setTimeout(()=>E(),0),D.current=j.notifications.length},[j.notifications]);const $=j.notifications.map(({style:N,...L})=>C.createElement($O,{key:L.id,timeout:O,onEnter:()=>T.current[L.id].offsetHeight,nodeRef:{current:T.current[L.id]}},M=>C.createElement(oP,{ref:R=>{T.current[L.id]=R},data:L,onHide:R=>Zj(R,S),autoClose:d,...I("notification",{style:{...MO({state:M,position:u,transitionDuration:O,maxHeight:m}),...N}})})));return C.createElement(ys,{withinPortal:x,...v},C.createElement(W,{...I("root"),ref:t,...w},C.createElement(NO,null,$)))});Bo.classes=iP;Bo.displayName="@mantine/notifications/Notifications";Bo.show=oo.show;Bo.hide=oo.hide;Bo.update=oo.update;Bo.clean=oo.clean;Bo.cleanQueue=oo.cleanQueue;Bo.updateState=oo.updateState;class BO{constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Mc{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}}class UO{constructor(){this.prefixParselets={},this.infixParselets={}}registerInfix(t,n){return this.infixParselets[t]=n,this}registerPrefix(t,n){return this.prefixParselets[t]=n,this}prefix(t,n,r){return this.registerPrefix(t,{parse(o,i){const s=o.consumeAndParse(n);return r(i,s)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(o,i,s){const l=o.consumeAndParse(n);return r(i,s,l)},precedence:n})}construct(t){return new VO(t,this.prefixParselets,this.infixParselets)}}class VO{constructor(t,n,r){this.tokens=t,this.prefixParselets=n,this.infixParselets=r}hasMore(){return this.tokens.length>0}match(t){const n=this.peek();return(n==null?void 0:n.id)!==t?!1:(this.consume(),!0)}consumeAndParse(t=1/0){const n=this.consume(),r=this.prefixParselets[n.id];if(!r)throw Error(`Parse error at "${n.value}" (line ${n.line}, column ${n.column}). No matching prefix parselet.`);let o=r.parse(this,n);for(;t>this.getPrecedence();){const i=this.consume();o=this.getInfixParselet(i).parse(this,o,i)}return o}getPrecedence(){const t=this.peek();if(!t)return 1/0;const n=this.getInfixParselet(t);return n?n.precedence:1/0}consume(t,n){var r,o;if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&((r=this.peek())==null?void 0:r.id)!==t){const i=this.peek();throw Error(`Expected ${t} but got "${i.id}" (${i.value}) at line ${i.line} column ${i.column}.`)}if(n&&((o=this.peek())==null?void 0:o.value)!==n){const i=this.peek();throw Error(`Expected "${n}" but got "${i.value}" at line ${i.line} column ${i.column}.`)}return this.tokens.shift()}peek(){return this.tokens.length>0?this.tokens[0]:void 0}removeComments(){this.tokens=this.tokens.filter(t=>t.id!=="Comment")}getInfixParselet(t){return this.infixParselets[t.id==="Symbol"?t.value:t.id]}}const WO="http://hl7.org",sP="ok",HO="created",qO="gone",GO="not-modified",QO="not-found",KO="forbidden",YO="accepted",XO={resourceType:"OperationOutcome",id:sP,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},JO={resourceType:"OperationOutcome",id:QO,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},aP={resourceType:"OperationOutcome",id:KO,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function pi(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},expression:t?[t]:void 0}]}}function vt(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function ZO(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function Vf(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function lP(e){return e.id===sP||e.id===HO||e.id===GO||e.id===YO}function eM(e){return e.id===qO}class $e extends Error{constructor(t,n){super(cP(t)),this.outcome=t,this.cause=n}}function lt(e){return e instanceof $e?e.outcome:Vf(e)?e:pi(Te(e))}function Te(e){return e?typeof e=="string"?e:e instanceof Error?e.message:Vf(e)?cP(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function cP(e){var n;const t=((n=e.issue)==null?void 0:n.map(uP))??[];return t.length>0?t.join("; "):"Unknown error"}function uP(e){var n,r;let t;return(n=e.details)!=null&&n.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",(r=e.expression)!=null&&r.length&&(t+=` (${e.expression.join(", ")})`),t}function tM(e,t){const n=t.max&&t.max===Number.MAX_SAFE_INTEGER?Number.POSITIVE_INFINITY:t.max;return{path:e,description:"",type:t.type??[],min:t.min??0,max:n??1,isArray:!!n&&n>1,constraints:[]}}function nM(e){const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]={name:n,elements:Object.fromEntries(Object.entries(r.elements).map(([o,i])=>[o,tM(o,i)])),constraints:[],innerTypes:[]};return t}const rM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},oM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},iM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},type:{type:[{code:"code"}]},text:{type:[{code:"string"}]},line:{max:9007199254740991,type:[{code:"string"}]},city:{type:[{code:"string"}]},district:{type:[{code:"string"}]},state:{type:[{code:"string"}]},postalCode:{type:[{code:"string"}]},country:{type:[{code:"string"}]},period:{type:[{code:"Period"}]}}},sM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},aM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},"author[x]":{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Organization"]},{code:"string"}]},time:{type:[{code:"dateTime"}]},text:{min:1,type:[{code:"markdown"}]}}},lM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},contentType:{type:[{code:"code"}]},language:{type:[{code:"code"}]},data:{type:[{code:"base64Binary"}]},url:{type:[{code:"url"}]},size:{type:[{code:"unsignedInt"}]},hash:{type:[{code:"base64Binary"}]},title:{type:[{code:"string"}]},creation:{type:[{code:"dateTime"}]}}},cM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},uM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},system:{type:[{code:"uri"}]},version:{type:[{code:"string"}]},code:{type:[{code:"code"}]},display:{type:[{code:"string"}]},userSelected:{type:[{code:"boolean"}]}}},dM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},fM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},system:{type:[{code:"code"}]},value:{type:[{code:"string"}]},use:{type:[{code:"code"}]},rank:{type:[{code:"positiveInt"}]},period:{type:[{code:"Period"}]}}},hM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},name:{min:1,type:[{code:"string"}]},contact:{max:9007199254740991,type:[{code:"ContactDetail"}]}}},pM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},mM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},"subject[x]":{type:[{code:"CodeableConcept"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Group"]}]},mustSupport:{max:9007199254740991,type:[{code:"string"}]},codeFilter:{max:9007199254740991,type:[{code:"DataRequirementCodeFilter"}]},dateFilter:{max:9007199254740991,type:[{code:"DataRequirementDateFilter"}]},limit:{type:[{code:"positiveInt"}]},sort:{max:9007199254740991,type:[{code:"DataRequirementSort"}]}}},gM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},yM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},sequence:{type:[{code:"integer"}]},text:{type:[{code:"string"}]},additionalInstruction:{max:9007199254740991,type:[{code:"CodeableConcept"}]},patientInstruction:{type:[{code:"string"}]},timing:{type:[{code:"Timing"}]},"asNeeded[x]":{type:[{code:"boolean"},{code:"CodeableConcept"}]},site:{type:[{code:"CodeableConcept"}]},route:{type:[{code:"CodeableConcept"}]},method:{type:[{code:"CodeableConcept"}]},doseAndRate:{max:9007199254740991,type:[{code:"DosageDoseAndRate"}]},maxDosePerPeriod:{type:[{code:"Ratio"}]},maxDosePerAdministration:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},maxDosePerLifetime:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},vM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},xM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},representation:{max:9007199254740991,type:[{code:"code"}]},sliceName:{type:[{code:"string"}]},sliceIsConstraining:{type:[{code:"boolean"}]},label:{type:[{code:"string"}]},code:{max:9007199254740991,type:[{code:"Coding"}]},slicing:{type:[{code:"ElementDefinitionSlicing"}]},short:{type:[{code:"string"}]},definition:{type:[{code:"markdown"}]},comment:{type:[{code:"markdown"}]},requirements:{type:[{code:"markdown"}]},alias:{max:9007199254740991,type:[{code:"string"}]},min:{type:[{code:"unsignedInt"}]},max:{type:[{code:"string"}]},base:{type:[{code:"ElementDefinitionBase"}]},contentReference:{type:[{code:"uri"}]},type:{max:9007199254740991,type:[{code:"ElementDefinitionType"}]},"defaultValue[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},meaningWhenMissing:{type:[{code:"markdown"}]},orderMeaning:{type:[{code:"string"}]},"fixed[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},"pattern[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},example:{max:9007199254740991,type:[{code:"ElementDefinitionExample"}]},"minValue[x]":{type:[{code:"date"},{code:"dateTime"},{code:"instant"},{code:"time"},{code:"decimal"},{code:"integer"},{code:"positiveInt"},{code:"unsignedInt"},{code:"Quantity"}]},"maxValue[x]":{type:[{code:"date"},{code:"dateTime"},{code:"instant"},{code:"time"},{code:"decimal"},{code:"integer"},{code:"positiveInt"},{code:"unsignedInt"},{code:"Quantity"}]},maxLength:{type:[{code:"integer"}]},condition:{max:9007199254740991,type:[{code:"id"}]},constraint:{max:9007199254740991,type:[{code:"ElementDefinitionConstraint"}]},mustSupport:{type:[{code:"boolean"}]},isModifier:{type:[{code:"boolean"}]},isModifierReason:{type:[{code:"string"}]},isSummary:{type:[{code:"boolean"}]},binding:{type:[{code:"ElementDefinitionBinding"}]},mapping:{max:9007199254740991,type:[{code:"ElementDefinitionMapping"}]}}},wM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},description:{type:[{code:"string"}]},name:{type:[{code:"id"}]},language:{min:1,type:[{code:"code"}]},expression:{type:[{code:"string"}]},reference:{type:[{code:"uri"}]}}},SM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},url:{min:1,type:[{code:"uri"}]},"value[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]}}},bM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},text:{type:[{code:"string"}]},family:{type:[{code:"string"}]},given:{max:9007199254740991,type:[{code:"string"}]},prefix:{max:9007199254740991,type:[{code:"string"}]},suffix:{max:9007199254740991,type:[{code:"string"}]},period:{type:[{code:"Period"}]}}},CM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},type:{type:[{code:"CodeableConcept"}]},system:{type:[{code:"uri"}]},value:{type:[{code:"string"}]},period:{type:[{code:"Period"}]},assigner:{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Organization"]}]}}},EM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},country:{min:1,type:[{code:"CodeableConcept"}]},jurisdiction:{type:[{code:"CodeableConcept"}]},status:{min:1,type:[{code:"CodeableConcept"}]},dateRange:{min:1,type:[{code:"Period"}]},restoreDate:{type:[{code:"dateTime"}]}}},jM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},versionId:{type:[{code:"id"}]},lastUpdated:{type:[{code:"instant"}]},source:{type:[{code:"uri"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},security:{max:9007199254740991,type:[{code:"Coding"}]},tag:{max:9007199254740991,type:[{code:"Coding"}]},project:{type:[{code:"uri"}]},author:{type:[{code:"Reference"}]},account:{type:[{code:"Reference"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},PM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},TM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},kM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"code"}]},use:{min:1,type:[{code:"code"}]},min:{type:[{code:"integer"}]},max:{type:[{code:"string"}]},documentation:{type:[{code:"string"}]},type:{min:1,type:[{code:"code"}]},profile:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]}}},RM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},DM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},"age[x]":{type:[{code:"Range"},{code:"CodeableConcept"}]},gender:{type:[{code:"CodeableConcept"}]},race:{type:[{code:"CodeableConcept"}]},physiologicalCondition:{type:[{code:"CodeableConcept"}]}}},IM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},height:{type:[{code:"Quantity"}]},width:{type:[{code:"Quantity"}]},depth:{type:[{code:"Quantity"}]},weight:{type:[{code:"Quantity"}]},nominalVolume:{type:[{code:"Quantity"}]},externalDiameter:{type:[{code:"Quantity"}]},shape:{type:[{code:"string"}]},color:{max:9007199254740991,type:[{code:"string"}]},imprint:{max:9007199254740991,type:[{code:"string"}]},image:{max:9007199254740991,type:[{code:"Attachment"}]},scoring:{type:[{code:"CodeableConcept"}]}}},_M={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},identifier:{type:[{code:"Identifier"}]},type:{min:1,type:[{code:"CodeableConcept"}]},period:{min:1,type:[{code:"Quantity"}]},specialPrecautionsForStorage:{max:9007199254740991,type:[{code:"CodeableConcept"}]}}},AM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},NM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},low:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},high:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},OM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},MM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},reference:{type:[{code:"string"}]},type:{type:[{code:"uri"}]},identifier:{type:[{code:"Identifier"}]},display:{type:[{code:"string"}]}}},LM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},label:{type:[{code:"string"}]},display:{type:[{code:"string"}]},citation:{type:[{code:"markdown"}]},url:{type:[{code:"url"}]},document:{type:[{code:"Attachment"}]},resource:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/Resource"]}]}}},$M={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},origin:{min:1,type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},period:{min:1,type:[{code:"decimal"}]},factor:{type:[{code:"decimal"}]},lowerLimit:{type:[{code:"decimal"}]},upperLimit:{type:[{code:"decimal"}]},dimensions:{min:1,type:[{code:"positiveInt"}]},data:{type:[{code:"string"}]}}},FM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,max:9007199254740991,type:[{code:"Coding"}]},when:{min:1,type:[{code:"instant"}]},who:{min:1,type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Organization"]}]},onBehalfOf:{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Organization"]}]},targetFormat:{type:[{code:"code"}]},sigFormat:{type:[{code:"code"}]},data:{type:[{code:"base64Binary"}]}}},zM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},"amount[x]":{type:[{code:"Quantity"},{code:"Range"},{code:"string"}]},amountType:{type:[{code:"CodeableConcept"}]},amountText:{type:[{code:"string"}]},referenceRange:{type:[{code:"SubstanceAmountReferenceRange"}]}}},BM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},event:{max:9007199254740991,type:[{code:"dateTime"}]},repeat:{type:[{code:"TimingRepeat"}]},code:{type:[{code:"CodeableConcept"}]}}},UM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},name:{type:[{code:"string"}]},"timing[x]":{type:[{code:"Timing"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Schedule"]},{code:"date"},{code:"dateTime"}]},data:{max:9007199254740991,type:[{code:"DataRequirement"}]},condition:{type:[{code:"Expression"}]}}},VM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},code:{min:1,type:[{code:"Coding"}]},"value[x]":{min:1,type:[{code:"CodeableConcept"},{code:"Quantity"},{code:"Range"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/PlanDefinition","http://hl7.org/fhir/StructureDefinition/ResearchStudy","http://hl7.org/fhir/StructureDefinition/InsurancePlan","http://hl7.org/fhir/StructureDefinition/HealthcareService","http://hl7.org/fhir/StructureDefinition/Group","http://hl7.org/fhir/StructureDefinition/Location","http://hl7.org/fhir/StructureDefinition/Organization"]}]}}},WM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},HM={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{max:0,type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},qM={elements:{id:{type:[{code:"string"}]},meta:{type:[{code:"Meta"}]},implicitRules:{type:[{code:"uri"}]},language:{type:[{code:"code"}]},text:{type:[{code:"Narrative"}]},contained:{max:9007199254740991,type:[{code:"Resource"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},url:{type:[{code:"uri"}]},version:{type:[{code:"string"}]},name:{type:[{code:"string"}]},title:{type:[{code:"string"}]},status:{min:1,type:[{code:"code"}]},experimental:{type:[{code:"boolean"}]},date:{type:[{code:"dateTime"}]},publisher:{type:[{code:"string"}]},contact:{max:9007199254740991,type:[{code:"ContactDetail"}]},description:{type:[{code:"markdown"}]},useContext:{max:9007199254740991,type:[{code:"UsageContext"}]},jurisdiction:{max:9007199254740991,type:[{code:"CodeableConcept"}]}}},GM={elements:{authorizeUrl:{min:1,type:[{code:"string"}]},tokenUrl:{min:1,type:[{code:"string"}]},tokenAuthMethod:{type:[{code:"code"}]},userInfoUrl:{min:1,type:[{code:"string"}]},clientId:{min:1,type:[{code:"string"}]},clientSecret:{min:1,type:[{code:"string"}]},usePkce:{type:[{code:"boolean"}]},useSubject:{type:[{code:"boolean"}]}}},QM={Element:rM,BackboneElement:oM,Address:iM,Age:sM,Annotation:aM,Attachment:lM,CodeableConcept:cM,Coding:uM,ContactDetail:dM,ContactPoint:fM,Contributor:hM,Count:pM,DataRequirement:mM,Distance:gM,Dosage:yM,Duration:vM,ElementDefinition:xM,Expression:wM,Extension:SM,HumanName:bM,Identifier:CM,MarketingStatus:EM,Meta:jM,Money:PM,Narrative:TM,ParameterDefinition:kM,Period:RM,Population:DM,ProdCharacteristic:IM,ProductShelfLife:_M,Quantity:AM,Range:NM,Ratio:OM,Reference:MM,RelatedArtifact:LM,SampledData:$M,Signature:FM,SubstanceAmount:zM,Timing:BM,TriggerDefinition:UM,UsageContext:VM,MoneyQuantity:WM,SimpleQuantity:HM,MetadataResource:qM,IdentityProvider:GM};function KM(e){return new YM(e).parse()}const dP=nM(QM),Ev=Object.create(null),M1=Object.create(null);function Cm(e){let t;return e?(t=M1[e],t||(t=M1[e]=Object.create(null))):t=dP,t}function L1(e,t){var r;const n=Array.isArray(e)?e:((r=e.entry)==null?void 0:r.map(o=>o.resource))??[];for(const o of n)fP(o,t)}function fP(e,t){if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const n=KM(e),r=Cm(t);r[e.name]=n,t&&e.url===t&&(Ev[t]=n);for(const o of n.innerTypes)o.parentType=n,r[o.name]=o}function hP(e){return!!dP[e]}function Wf(e,t){let n=Cm(t)[e];return!n&&t&&(n=Cm()[e]),n}function pP(e,t){const n=Wf(e,t);if(!n)throw new $e(pi("Unknown data type: "+e));return n}function jv(e){return!!Ev[e]}function Cs(e){return Ev[e]}class YM{constructor(t){var n;if(!((n=t.snapshot)!=null&&n.element)||t.snapshot.element.length===0)throw new Error(`No snapshot defined for StructureDefinition '${t.name}'`);this.root=t.snapshot.element[0],this.elements=t.snapshot.element.slice(1),this.elementIndex=Object.create(null),this.index=0,this.resourceSchema={name:t.name,title:t.title,type:t.type,url:t.url,kind:t.kind,description:ZM(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var n,r,o,i,s;let t=this.next();for(;t;){if(t.sliceName)this.parseSliceStart(t);else if((n=t.id)!=null&&n.includes(":")){if((r=this.slicingContext)!=null&&r.current){const l=np(t,this.slicingContext.path);this.slicingContext.current.elements[l]=this.parseElementDefinition(t)}}else{const l=this.parseElementDefinition(t);this.checkFieldEnter(t,l);let c=this.backboneContext;for(;c;){if((o=t.path)!=null&&o.startsWith(c.path+".")){c.type.elements[np(t,c.path)]=l;break}c=c.parent}if(!c){const u=np(t,this.root.path);t.isSummary&&((i=this.resourceSchema.summaryProperties)==null||i.add(u.replace("[x]",""))),l.min>0&&((s=this.resourceSchema.mandatoryProperties)==null||s.add(u.replace("[x]",""))),this.resourceSchema.elements[u]=l}this.checkFieldExit(t)}t=this.next()}return this.checkFieldExit(),this.innerTypes.length>0&&(this.resourceSchema.innerTypes=this.innerTypes),this.resourceSchema}checkFieldEnter(t,n){this.isInnerType(t)&&this.enterInnerType(t),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){var n,r,o;for(;this.backboneContext&&!$s((n=this.backboneContext)==null?void 0:n.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;this.backboneContext={type:{name:q1(t),title:t.label,description:t.definition,elements:{},constraints:this.parseElementDefinition(t).constraints,innerTypes:[]},path:t.path??"",parent:$s((r=this.backboneContext)==null?void 0:r.path,t.path)?this.backboneContext:(o=this.backboneContext)==null?void 0:o.parent}}enterSlice(t,n){var r,o,i,s;JM(t)&&!((r=this.peek())!=null&&r.sliceName)||(n.slicing={discriminator:(((o=t.slicing)==null?void 0:o.discriminator)??[]).map(l=>{if(l.type!=="value"&&l.type!=="pattern"&&l.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${l.type}`);return{path:l.path,type:l.type}}),slices:[],ordered:((i=t.slicing)==null?void 0:i.ordered)??!1,rule:(s=t.slicing)==null?void 0:s.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){var n;if(this.backboneContext&&!$s(this.backboneContext.path,t==null?void 0:t.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!$s(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),delete this.backboneContext;this.slicingContext&&!$s(this.slicingContext.path,t==null?void 0:t.path)&&((n=this.slicingContext)!=null&&n.current&&this.slicingContext.field.slices.push(this.slicingContext.current),delete this.slicingContext)}next(){const t=this.peek();if(t)return this.index++,t}peek(){const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const n=this.elementIndex[t.contentReference.slice(t.contentReference.indexOf("#")+1)];return n?{...n,id:t.id,path:t.path,min:t.min??n.min,max:t.max??n.max,contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var r;const n=this.peek();return!!($s(t==null?void 0:t.path,n==null?void 0:n.path)&&((r=t.type)!=null&&r.some(o=>["BackboneElement","Element"].includes(o.code))))}parseSliceStart(t){if(!this.slicingContext)throw new Error(`Invalid slice start before discriminator: ${t.sliceName} (${t.id})`);this.slicingContext.current&&this.slicingContext.field.slices.push(this.slicingContext.current),this.slicingContext.current={name:t.sliceName??"",path:t.path??"",definition:t.definition,type:this.parseElementDefinitionType(t),elements:{},min:t.min??0,max:t.max==="*"?Number.POSITIVE_INFINITY:Number.parseInt(t.max,10),binding:t.binding}}parseElementDefinitionType(t){return(t.type??[]).map(n=>{var o;let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=q1(t)),r||(r=(o=Lc(n,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type"))==null?void 0:o.valueUrl),r||(r=n.code??""),{code:r,targetProfile:n.targetProfile,profile:n.profile}})}parseElementDefinition(t){var i,s;const n=$1(t.max),r=(i=t.base)!=null&&i.max?$1(t.base.max):n,o={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((s=t.base)==null?void 0:s.path)||"",min:t.min??0,max:n,isArray:r>1,constraints:(t.constraint??[]).map(l=>({key:l.key??"",severity:l.severity??"error",expression:l.expression??"",description:l.human??""})),type:this.parseElementDefinitionType(t),fixed:F1(Xt(o,"fixed[x]")),pattern:F1(Xt(o,"pattern[x]")),binding:t.binding}}}function $1(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function np(e,t=""){return XM(e.path,t)}function XM(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function $s(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function F1(e){return Array.isArray(e)&&e.length>0?e[0]:Ot(e)?void 0:e}function JM(e){var n,r;const t=(n=e.slicing)==null?void 0:n.discriminator;return!!((r=e.type)!=null&&r.some(o=>o.code==="Extension")&&(t==null?void 0:t.length)===1&&t[0].type==="value"&&t[0].path==="url")}function ZM(e){let t=e.description;return t!=null&&t.startsWith(`Base StructureDefinition for ${e.name} Type: `)&&(t=t.substring(`Base StructureDefinition for ${e.name} Type: `.length)),t}function eL(e,t,n){if(t==="$this")return[e];const[r,...o]=t.split(".");let i=[Xt(e,r,n)];for(const s of o){const l=[];for(const c of i)if(Array.isArray(c))for(const u of c)l.push(Xt(u,s,n));else c!==void 0&&l.push(Xt(c,s,n));i=l}return i}const mP={base64Binary:/^([A-Za-z\d+/]{4})*([A-Za-z\d+/]{2}==|[A-Za-z\d+/]{3}=)?$/,canonical:/^\S*$/,code:/^[^\s]+( [^\s]+)*$/,date:/^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1]))?)?$/,dateTime:/^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1])(T([01]\d|2[0-3])(:[0-5]\d:([0-5]\d|60)(\.\d{1,9})?)?)?)?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00)?)?)?$/,id:/^[A-Za-z0-9\-.]{1,64}$/,instant:/^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)-(0[1-9]|1[0-2])-(0[1-9]|[1-2]\d|3[0-1])T([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00))$/,markdown:/^[\s\S]+$/,oid:/^urn:oid:[0-2](\.(0|[1-9]\d*))+$/,string:/^[\s\S]+$/,time:/^([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?$/,uri:/^\S*$/,url:/^\S*$/,uuid:/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,xhtml:/.*/};function tL(e,t){return!(t.pattern&&!Tv(e,t.pattern)||t.fixed&&!$c(e,t.fixed))}function nL(e,t,n,r){if(Array.isArray(e))return!1;const o=(r??n.elements)[t.path],i=n.type;switch(t.type){case"value":case"pattern":if(!e||!o)return!1;if(tL(e,o))return!0;break;case"type":return!e||!(i!=null&&i.length)?!1:i.some(s=>s.code===e.type)}return!1}function ve(e){return[{type:V.boolean,value:e}]}function lo(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:V.integer,value:e}:typeof e=="number"?{type:V.decimal,value:e}:typeof e=="boolean"?{type:V.boolean,value:e}:typeof e=="string"?{type:V.string,value:e}:hr(e)?{type:V.Quantity,value:e}:Uo(e)?{type:e.resourceType,value:e}:{type:V.BackboneElement,value:e}}function ii(e){return e.length===0?!1:!!e[0].value}function Ro(e,t){if(e.length!==0){if(e.length===1&&(!t||e[0].type===t))return e[0];throw new Error(`Expected singleton of type ${t}, but found ${JSON.stringify(e)}`)}}function Xt(e,t,n){if(!e.value)return;const r=js(e.type,t,n==null?void 0:n.profileUrl);return r?gP(e,t,r):rL(e,t)}function gP(e,t,n){const r=e.value,o=n.type;if(!o||o.length===0)return;let i,s="undefined",l;if(n.path.endsWith("[x]")){const c=n.path.split(".").pop().replace("[x]","");for(const u of o){const d=c+Vt(u.code);if(i=r[d],l=r["_"+d],i!==void 0||l!==void 0){s=u.code;break}}}else console.assert(o.length===1,"Expected single type",n.path),i=r[t],s=o[0].code,l=r["_"+t];if(l)if(Array.isArray(i)){i=i.slice();for(let c=0;c<Math.max(i.length,l.length);c++)i[c]=V1(i[c],l[c])}else i=V1(i,l);if(!Ot(i))return(s==="Element"||s==="BackboneElement")&&(s=n.type[0].code),Array.isArray(i)?i.map(c=>z1(c,s)):z1(i,s)}function z1(e,t){return t==="Resource"&&Uo(e)&&(t=e.resourceType),{type:t,value:e}}function rL(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n)r=n[t];else for(const o in V){const i=t+Vt(o);if(i in n){r=n[i];break}}if(!Ot(r))return Array.isArray(r)?r.map(lo):lo(r)}function yP(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(ii(wP(n,o))){r=!0;break}r||t.push(n)}return t}function vP(e){return ve(!ii(e))}function xP(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?ve(!1):ve(e.every((n,r)=>ii(wP(n,t[r]))))}function wP(e,t){var o,i;const n=(o=e.value)==null?void 0:o.valueOf(),r=(i=t.value)==null?void 0:i.valueOf();return typeof n=="number"&&typeof r=="number"?ve(Math.abs(n-r)<1e-8):hr(n)&&hr(r)?ve(CP(n,r)):ve(typeof n=="object"&&typeof r=="object"?Pv(e,t):n===r)}function SP(e,t){return e.length===0&&t.length===0?ve(!0):e.length!==t.length?ve(!1):(e.sort(B1),t.sort(B1),ve(e.every((n,r)=>ii(oL(n,t[r])))))}function oL(e,t){const{type:n,value:r}=e,{type:o,value:i}=t,s=r==null?void 0:r.valueOf(),l=i==null?void 0:i.valueOf();return typeof s=="number"&&typeof l=="number"?ve(Math.abs(s-l)<.01):hr(s)&&hr(l)?ve(CP(s,l)):ve(n==="Coding"&&o==="Coding"?typeof s!="object"||typeof l!="object"?!1:s.code===l.code&&s.system===l.system:typeof s=="object"&&typeof l=="object"?Pv({...s,id:void 0},{...l,id:void 0}):typeof s=="string"&&typeof l=="string"?s.toLowerCase()===l.toLowerCase():s===l)}function B1(e,t){var o,i;const n=(o=e.value)==null?void 0:o.valueOf(),r=(i=t.value)==null?void 0:i.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function bP(e,t){const{value:n}=e;if(n==null)return!1;switch(t){case"Boolean":return typeof n=="boolean";case"Decimal":case"Integer":return typeof n=="number";case"Date":return iL(n);case"DateTime":return Em(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return sL(n);case"Quantity":return hr(n);default:return typeof n=="object"&&(n==null?void 0:n.resourceType)===t}}function iL(e){return typeof e=="string"&&!!mP.date.exec(e)}function Em(e){return typeof e=="string"&&!!mP.dateTime.exec(e)}function sL(e){return!!(e&&typeof e=="object"&&("start"in e&&Em(e.start)||"end"in e&&Em(e.end)))}function hr(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function CP(e,t){return Math.abs(e.value-t.value)<.01&&(e.unit===t.unit||e.code===t.code||e.unit===t.code||e.code===t.unit)}function Pv(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o],s=t[o];if(U1(i)&&U1(s)){if(!Pv(i,s))return!1}else if(i!==s)return!1}return!0}function U1(e){return e!==null&&typeof e=="object"}function V1(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return aL(e??{},t)}return e}function aL(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function ft(e){const t=ht(e),n=Do(e);return n===t?{reference:t}:{reference:t,display:n}}function ht(e){return Ps(e)?e.reference:`${e.resourceType}/${e.id}`}function Hf(e){if(e)return Ps(e)?e.reference.split("/")[1]:e.id}function lL(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Do(e){if(lL(e)){const t=cL(e);if(t)return t}if(e.resourceType==="Device"){const t=uL(e);if(t)return t}if(e.resourceType==="MedicationRequest"){const t=e.medicationCodeableConcept;if(t)return wi(t)}if(e.resourceType==="User"&&e.email)return e.email;if("name"in e&&e.name&&typeof e.name=="string")return e.name;if("code"in e&&e.code){let t=e.code;if(Array.isArray(t)&&(t=t[0]),wL(t))return wi(t);if(SL(t))return t.text}return ht(e)}function cL(e){const t=e.name;if(t&&t.length>0)return Fc(t[0])}function uL(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function dL(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=W1(n);if(r)return r}else return W1(t)}function W1(e){if(e.url&&e.contentType&&e.contentType.startsWith("image/"))return e.url}function EP(e,t){const n=new Date(e);n.setUTCHours(0,0,0,0);const r=t?new Date(t):new Date;r.setUTCHours(0,0,0,0);const o=n.getUTCFullYear(),i=n.getUTCMonth(),s=n.getUTCDate(),l=r.getUTCFullYear(),c=r.getUTCMonth(),u=r.getUTCDate();let d=l-o;(c<i||c===i&&u<s)&&d--;let f=l*12+c-(o*12+i);u<s&&f--;const h=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:d,months:f,days:h}}function fL(e,t){const{years:n,months:r,days:o}=EP(e,t);return n>=2?n.toString().padStart(3,"0")+"Y":r>=1?r.toString().padStart(3,"0")+"M":o.toString().padStart(3,"0")+"D"}function Lc(e,...t){var r;let n=e;for(let o=0;o<t.length&&n;o++)n=(r=n==null?void 0:n.extension)==null?void 0:r.find(i=>i.url===t[o]);return n}function tr(e,t){return JSON.stringify(e,hL,t?2:void 0)}function hL(e,t){return!pL(e)&&Ot(t)?void 0:t}function pL(e){return!!/\d+$/.exec(e)}function Ot(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!Nt(e):!1}function Nt(e){if(e==null)return!1;const t=typeof e;return t==="string"&&e!==""||t==="object"&&("length"in e&&e.length>0||Object.keys(e).length>0)}function $c(e,t,n){return e===t||Ot(e)&&Ot(t)?!0:Ot(e)||Ot(t)?!1:Array.isArray(e)&&Array.isArray(t)?mL(e,t):Array.isArray(e)||Array.isArray(t)?!1:mn(e)&&mn(t)?gL(e,t,n):(mn(e)||mn(t),!1)}function mL(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!$c(e[n],t[n]))return!1;return!0}function gL(e,t,n){const r=new Set;Object.keys(e).forEach(o=>r.add(o)),Object.keys(t).forEach(o=>r.add(o)),n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const o of r){const i=e[o],s=t[o];if(!$c(i,s,o))return!1}return!0}function Tv(e,t){return Ot(e)?!0:Ot(t)?!1:Array.isArray(e)&&Array.isArray(t)?yL(e,t):Array.isArray(e)||Array.isArray(t)?!1:mn(e)&&mn(t)?vL(e,t):mn(e)||mn(t)?!1:e===t}function yL(e,t){return t.every(n=>e.some(r=>Tv(r,n)))}function vL(e,t){return Object.entries(t).every(([n,r])=>n in e&&Tv(e[n],r))}function co(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function jP(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function mn(e){return e!==null&&typeof e=="object"}function xL(e){return mn(e)&&"code"in e&&typeof e.code=="string"}function wL(e){return mn(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(xL)}function SL(e){return mn(e)&&"text"in e&&typeof e.text=="string"}const PP=[];for(let e=0;e<256;e++)PP.push(e.toString(16).padStart(2,"0"));function bL(e){const t=new Uint8Array(e),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=PP[t[r]];return n.join("")}function CL(e){const t=new Uint8Array(e),n=[];for(let r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return window.btoa(n.join(""))}function Vt(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function kv(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function ic(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function EL(e,t){var n,r;return(r=(n=e.coding)==null?void 0:n.find(o=>o.system===t))==null?void 0:r.code}function jL(e){if(e)return Array.isArray(e)?e:[e]}const H1=e=>new Promise(t=>{setTimeout(t,e)});function PL(e,t,n){const r=[];for(let o=0;o<n-1;o++){const i=e.indexOf(t);if(i<0)break;r.push(e.slice(0,i)),e=e.slice(i+t.length)}return r.push(e),r}function TL(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function dl(e,t){return e?(e.push(t),e):[t]}function kL(e,t){return new URL(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function RL(e,t){const n=[];if(e.line&&n.push(...e.line),e.city||e.state||e.postalCode){const r=[];e.city&&r.push(e.city),e.state&&r.push(e.state),e.postalCode&&r.push(e.postalCode),n.push(r.join(", "))}return e.use&&(t!=null&&t.all||t!=null&&t.use)&&n.push("["+e.use+"]"),n.join((t==null?void 0:t.lineSeparator)??", ").trim()}function Fc(e,t){const n=[];if(e.prefix&&(t==null?void 0:t.prefix)!==!1&&n.push(...e.prefix),e.given&&n.push(...e.given),e.family&&n.push(e.family),e.suffix&&(t==null?void 0:t.suffix)!==!1&&n.push(...e.suffix),e.use&&(t!=null&&t.all||t!=null&&t.use)&&n.push("["+e.use+"]"),n.length===0){const r=ac(e.text);if(r)return r}return n.join(" ").trim()}function qf(e){return e instanceof Date&&!isNaN(e.getTime())}function DL(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return qf(r)?r.toLocaleTimeString(t,n):""}function jn(e,t,n){if(!e)return"";const r=new Date(e);return qf(r)?r.toLocaleString(t,n):""}function IL(e,t,n){return!e||!e.start&&!e.end?"":jn(e.start,t,n)+" - "+jn(e.end,t,n)}const _L={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},AL={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},NL={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function TP(e){if(!e)return"";const t=[];return OL(t,e.repeat),e.event&&t.push(e.event.map(n=>jn(n)).join(", ")),Vt(t.join(" ").trim())}function OL(e,t){if(!(t!=null&&t.periodUnit))return;const n=t.frequency??1,r=t.period??1,o=t.periodUnit;n===1&&r===1?e.push(_L[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+AL[o]):e.push("per "+r+" "+NL[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(Vt).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(i=>DL(i)).join(", "))}function sc(e,t,n=!1){if(n&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const r=(e==null?void 0:e.low)&&{...e.low,comparator:void 0},o=(e==null?void 0:e.high)&&{...e.high,comparator:void 0};return(r==null?void 0:r.value)===void 0&&(o==null?void 0:o.value)===void 0?"":(r==null?void 0:r.value)!==void 0&&(o==null?void 0:o.value)===void 0?n&&t!==void 0?(r.value=$L(r.value,t),`> ${Xo(r,t)}`):`>= ${Xo(r,t)}`:(r==null?void 0:r.value)===void 0&&(o==null?void 0:o.value)!==void 0?n&&t!==void 0?(o.value=LL(o.value,t),`< ${Xo(o,t)}`):`<= ${Xo(o,t)}`:((r==null?void 0:r.unit)===(o==null?void 0:o.unit)&&(r==null||delete r.unit),`${Xo(r,t)} - ${Xo(o,t)}`)}function Xo(e,t){if(!e)return"";const n=[];return e.comparator&&(n.push(e.comparator),n.push(" ")),e.value!==void 0&&(t!==void 0?n.push(e.value.toFixed(t)):n.push(e.value)),e.unit&&(e.unit!=="%"&&n[n.length-1]!==" "&&n.push(" "),n.push(e.unit)),n.join("").trim()}function ML(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function wi(e){if(!e)return"";const t=ac(e.text);return t||(e.coding?e.coding.map(n=>Es(n)).join(", "):"")}function Es(e){return ac(e==null?void 0:e.display)??ac(e==null?void 0:e.code)??""}function kP(e){if(!e)return"";if("component"in e)return e.component.map(n=>kP(n)).join(" / ");if(e.valueQuantity)return Xo(e.valueQuantity);if(e.valueCodeableConcept)return wi(e.valueCodeableConcept);const t=ac(e.valueString);return t||""}function ac(e){return typeof e=="string"?e:void 0}function LL(e,t,n=1){return(RP(e,t)+n)*Math.pow(10,-t)}function $L(e,t,n=1){return(RP(e,t)-n)*Math.pow(10,-t)}function RP(e,t){return t===void 0?e:Math.round(e*Math.pow(10,t))}const V={Address:"Address",Age:"Age",Annotation:"Annotation",Attachment:"Attachment",BackboneElement:"BackboneElement",CodeableConcept:"CodeableConcept",Coding:"Coding",ContactDetail:"ContactDetail",ContactPoint:"ContactPoint",Contributor:"Contributor",Count:"Count",DataRequirement:"DataRequirement",Distance:"Distance",Dosage:"Dosage",Duration:"Duration",Expression:"Expression",Extension:"Extension",HumanName:"HumanName",Identifier:"Identifier",MarketingStatus:"MarketingStatus",Meta:"Meta",Money:"Money",Narrative:"Narrative",ParameterDefinition:"ParameterDefinition",Period:"Period",Population:"Population",ProdCharacteristic:"ProdCharacteristic",ProductShelfLife:"ProductShelfLife",Quantity:"Quantity",Range:"Range",Ratio:"Ratio",Reference:"Reference",RelatedArtifact:"RelatedArtifact",SampledData:"SampledData",Signature:"Signature",SubstanceAmount:"SubstanceAmount",SystemString:"http://hl7.org/fhirpath/System.String",Timing:"Timing",TriggerDefinition:"TriggerDefinition",UsageContext:"UsageContext",base64Binary:"base64Binary",boolean:"boolean",canonical:"canonical",code:"code",date:"date",dateTime:"dateTime",decimal:"decimal",id:"id",instant:"instant",integer:"integer",markdown:"markdown",oid:"oid",positiveInt:"positiveInt",string:"string",time:"time",unsignedInt:"unsignedInt",uri:"uri",url:"url",uuid:"uuid"};function FL(e){for(const t of e.base??[]){let n=Io.types[t];n||(n={searchParamsDetails:{}},Io.types[t]=n),n.searchParams||(n.searchParams={_id:{base:[t],code:"_id",type:"token",expression:t+".id"},_lastUpdated:{base:[t],code:"_lastUpdated",type:"date",expression:t+".meta.lastUpdated"},_compartment:{base:[t],code:"_compartment",type:"reference",expression:t+".meta.compartment"},_profile:{base:[t],code:"_profile",type:"uri",expression:t+".meta.profile"},_security:{base:[t],code:"_security",type:"token",expression:t+".meta.security"},_source:{base:[t],code:"_source",type:"uri",expression:t+".meta.source"},_tag:{base:[t],code:"_tag",type:"token",expression:t+".meta.tag"}}),n.searchParams[e.code]=e}}function q1(e){var n,r,o,i;const t=(r=(n=e.type)==null?void 0:n[0])==null?void 0:r.code;return t==="BackboneElement"||t==="Element"?zL((i=((o=e.base)==null?void 0:o.path)??e.path)==null?void 0:i.split(".")):t}function zL(e){return e.length===1?e[0]:e.map(Vt).join("")}function Rv(e){var t;return(t=Io.types[e])==null?void 0:t.searchParams}function BL(e,t){var n,r;return(r=(n=Io.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function ss(e){const t=e.replaceAll("[x]","").split(".").pop();return DP(t)}function DP(e){let t;return e.length<100?t=e.match(/[A-Z]+(?![a-z])|[A-Z]?[a-z]+|\d+/g)??[]:t=e.split(/(?=[A-Z])/),t.map(VL).join(" ").replace("_"," ").replace(/\s+/g," ")}const UL=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function VL(e){const t=e.toUpperCase();return e===t?e:UL.has(t)?t:t.charAt(0)+e.slice(1)}function js(e,t,n){const r=Wf(e,n);if(r)return WL(r.elements,t)}function WL(e,t){const n=e[t]??e[t+"[x]"];if(n)return n;for(let r=0;r<t.length;r++){const o=t[r];if(o>="A"&&o<="Z"){const i=t.slice(0,r)+"[x]",s=e[i];if(s)return s}}}function Uo(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function Ps(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const Io={types:{}};function Yu(e){if(e.startsWith("T"))return e+"T00:00:00.000Z".substring(e.length);if(e.length<=10)return e;try{return new Date(e).toISOString()}catch{return e}}const fl=()=>[],Nn={empty:(e,t)=>ve(t.length===0||t.every(n=>Ot(n.value))),hasValue:(e,t)=>ve(t.length!==0),exists:(e,t,n)=>ve(n?t.filter(r=>ii(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!Ot(r.value))),all:(e,t,n)=>ve(t.every(r=>ii(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return ve(!1);return ve(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return ve(!0);return ve(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return ve(!1);return ve(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return ve(!0);return ve(!1)},subsetOf:fl,supersetOf:fl,count:(e,t)=>[{type:V.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(o=>o.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>ve(t.length===Nn.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>ii(n.eval({parent:e,variables:{$this:r}},[r]))),select:(e,t,n)=>t.map(r=>n.eval(e,[r])).flat(),repeat:fl,ofType:(e,t,n)=>t.filter(r=>r.type===n.name),single:(e,t)=>{if(t.length>1)throw new Error("Expected input length one for single()");return t.length===0?[]:t.slice(0,1)},first:(e,t)=>t.length===0?[]:t.slice(0,1),last:(e,t)=>t.length===0?[]:t.slice(t.length-1,t.length),tail:(e,t)=>t.length===0?[]:t.slice(1,t.length),skip:(e,t,n)=>{var o;const r=(o=n.eval(e,t)[0])==null?void 0:o.value;if(typeof r!="number")throw new Error("Expected a number for skip(num)");return r>=t.length?[]:r<=0?t:t.slice(r,t.length)},take:(e,t,n)=>{var o;const r=(o=n.eval(e,t)[0])==null?void 0:o.value;if(typeof r!="number")throw new Error("Expected a number for take(num)");return r>=t.length?t:r<=0?[]:t.slice(0,r)},intersect:(e,t,n)=>{if(!n)return t;const r=n.eval(e,t),o=[];for(const i of t)!o.some(s=>s.value===i.value)&&r.some(s=>s.value===i.value)&&o.push(i);return o},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,t),o=[];for(const i of t)r.some(s=>s.value===i.value)||o.push(i);return o},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,t);return yP([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,t);return[...t,...r]},htmlChecks:(e,t,n)=>[lo(!0)],iif:(e,t,n,r,o)=>{const i=n.eval(e,t);if(i.length>1||i.length===1&&typeof i[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return ii(i)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zr(t,1);if(typeof n=="boolean")return[{type:V.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return ve(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return ve(!0);if(["false","f","no","n","0","0.0"].includes(r))return ve(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:ve(Nn.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zr(t,1);return typeof n=="number"?[{type:V.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:V.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:V.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:ve(Nn.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zr(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:V.date,value:Yu(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:ve(Nn.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zr(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:V.dateTime,value:Yu(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:ve(Nn.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zr(t,1);return typeof n=="number"?[{type:V.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:V.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:V.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:ve(Nn.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zr(t,1);return hr(n)?[{type:V.Quantity,value:n}]:typeof n=="number"?[{type:V.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:V.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:V.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:ve(Nn.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zr(t,1);return n==null?[]:hr(n)?[{type:V.string,value:`${n.value} '${n.unit}'`}]:[{type:V.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:ve(Nn.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zr(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:V.time,value:Yu("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:ve(Nn.toTime(e,t).length===1),indexOf:(e,t,n)=>sr((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>sr((o,i,s)=>{const l=i,c=s?l+s:o.length;return l<0||l>=o.length?void 0:o.substring(l,c)},e,t,n,r),startsWith:(e,t,n)=>sr((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>sr((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>sr((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>sr(n=>n.toUpperCase(),e,t),lower:(e,t)=>sr(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>sr((o,i,s)=>o.replaceAll(i,s),e,t,n,r),matches:(e,t,n)=>sr((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>sr((o,i,s)=>o.replaceAll(i,s),e,t,n,r),length:(e,t)=>sr(n=>n.length,e,t),toChars:(e,t)=>sr(n=>n?n.split(""):void 0,e,t),abs:(e,t)=>Yr(Math.abs,e,t),ceiling:(e,t)=>Yr(Math.ceil,e,t),exp:(e,t)=>Yr(Math.exp,e,t),floor:(e,t)=>Yr(Math.floor,e,t),ln:(e,t)=>Yr(Math.log,e,t),log:(e,t,n)=>Yr((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>Yr(Math.pow,e,t,n),round:(e,t)=>Yr(Math.round,e,t),sqrt:(e,t)=>Yr(Math.sqrt,e,t),truncate:(e,t)=>Yr(n=>n|0,e,t),children:fl,descendants:fl,trace:(e,t,n)=>t,now:()=>[{type:V.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:V.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:V.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,o)=>{var u;const i=Nn.toDateTime(e,n.eval(e,t));if(i.length===0)throw new Error("Invalid start date");const s=Nn.toDateTime(e,r.eval(e,t));if(s.length===0)throw new Error("Invalid end date");const l=(u=o.eval(e,t)[0])==null?void 0:u.value;if(l!=="years"&&l!=="months"&&l!=="days")throw new Error("Invalid units");const c=EP(i[0].value,s[0].value);return[{type:V.Quantity,value:{value:c[l],unit:l}}]},is:(e,t,n)=>{let r="";return n instanceof Dv?r=n.name:n instanceof _v&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:V.boolean,value:bP(o,r)})):[]},not:(e,t)=>Nn.toBoolean(e,t).map(n=>({type:V.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let o;if(typeof r=="string")o=r;else if(typeof r=="object"){const i=r;if(i.resource)return lo(i.resource);i.reference?o=i.reference:i.type&&i.identifier&&(o=`${i.type}?identifier=${i.identifier.system}|${i.identifier.value}`)}if(o!=null&&o.includes("?")){const[i]=o.split("?");return{type:i,value:{resourceType:i}}}if(o!=null&&o.includes("/")){const[i,s]=o.split("/");return{type:i,value:{resourceType:i,id:s}}}return{type:V.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:V.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:V.BackboneElement,value:{namespace:"System",name:"Integer"}}:Uo(n)?{type:V.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:V.BackboneElement,value:null}),conformsTo:(e,t,n)=>{const r=n.eval(e,t)[0].value;if(!r.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const o=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(i=>{var s;return{type:V.boolean,value:((s=i.value)==null?void 0:s.resourceType)===o}})}};function sr(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=Zr(n,1);if(typeof o!="string")throw new Error("String function cannot be called with non-string");const i=e(o,...r.map(s=>{var l;return(l=s==null?void 0:s.eval(t,n)[0])==null?void 0:l.value}));return i===void 0?[]:Array.isArray(i)?i.map(lo):[lo(i)]}function Yr(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=Zr(n,1),i=hr(o),s=i?o.value:o;if(typeof s!="number")throw new Error("Math function cannot be called with non-number");const l=e(s,...r.map(d=>{var f;return(f=d.eval(t,n)[0])==null?void 0:f.value})),c=i?V.Quantity:n[0].type,u=i?{...o,value:l}:l;return[{type:c,value:u}]}function Zr(e,t){if(e.length!==t)throw new Error(`Expected ${t} arguments`);for(const n of e)if(n==null)throw new Error("Expected non-null argument");return e}class HL{constructor(t,n){this.original=t,this.child=n}eval(t,n){try{if(n.length>0){const r=[];for(const o of n)r.push(this.child.eval({parent:t,variables:{$this:o}},[o]));return r.flat()}else return this.child.eval(t,[])}catch(r){throw new Error(`FhirPathError on "${this.original}": ${r}`)}}toString(){return this.child.toString()}}class Fs{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class Dv{constructor(t){this.name=t}eval(t,n){const r=this.getVariable(t);if(r)return[r];if(this.name.startsWith("%"))throw new Error(`Undefined variable ${this.name}`);return n.flatMap(o=>this.evalValue(o)).filter(o=>(o==null?void 0:o.value)!==void 0)}getVariable(t){const n=t.variables[this.name];if(n!==void 0)return n;if(t.parent)return this.getVariable(t.parent)}evalValue(t){const n=t.value;if(!(!n||typeof n!="object"))return Uo(n)&&n.resourceType===this.name?t:Xt(t,this.name)}toString(){return this.name}}class qL{eval(){return[]}toString(){return"{}"}}class GL extends BO{constructor(t,n,r){super(t,n),this.impl=r}eval(t,n){return this.impl(this.child.eval(t,n))}toString(){return this.operator+this.child.toString()}}class Iv extends Mc{constructor(t,n){super("as",t,n)}eval(t,n){return Nn.ofType(t,this.left.eval(t,n),this.right)}}class Hn extends Mc{}class jr extends Hn{constructor(t,n,r,o){super(t,n,r),this.impl=o}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.eval(t,n);if(o.length!==1)return[];const i=r[0].value,s=o[0].value,l=hr(i)?i.value:i,c=hr(s)?s.value:s,u=this.impl(l,c);return typeof u=="boolean"?ve(u):hr(i)?[{type:V.Quantity,value:{...i,value:u}}]:[lo(u)]}}class QL extends Mc{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n),i=[...r,...o];return i.length>0&&i.every(s=>typeof s.value=="string")?[{type:V.string,value:i.map(s=>s.value).join("")}]:i}}class KL extends Hn{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return ve(r.some(i=>i.value===o[0].value))}}class YL extends Hn{constructor(t,n){super("in",t,n)}eval(t,n){const r=Ro(this.left.eval(t,n)),o=this.right.eval(t,n);return r?ve(o.some(i=>i.value===r.value)):[]}}class _v extends Mc{constructor(t,n){super(".",t,n)}eval(t,n){return this.right.eval(t,this.left.eval(t,n))}toString(){return`${this.left.toString()}.${this.right.toString()}`}}class IP extends Mc{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return yP([...r,...o])}}class XL extends Hn{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return xP(r,o)}}class JL extends Hn{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return vP(xP(r,o))}}class ZL extends Hn{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return SP(r,o)}}class e$ extends Hn{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return vP(SP(r,o))}}class Av extends Hn{constructor(t,n){super("is",t,n)}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.name;return ve(bP(r[0],o))}}class t$ extends Hn{constructor(t,n){super("and",t,n)}eval(t,n){const r=Ro(this.left.eval(t,n),"boolean"),o=Ro(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!0&&(o==null?void 0:o.value)===!0?ve(!0):(r==null?void 0:r.value)===!1||(o==null?void 0:o.value)===!1?ve(!1):[]}}class n$ extends Hn{constructor(t,n){super("or",t,n)}eval(t,n){const r=Ro(this.left.eval(t,n),"boolean"),o=Ro(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!1&&(o==null?void 0:o.value)===!1?ve(!1):r!=null&&r.value||o!=null&&o.value?ve(!0):[]}}class r$ extends Hn{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Ro(this.left.eval(t,n),"boolean"),o=Ro(this.right.eval(t,n),"boolean");return!r||!o?[]:ve(r.value!==o.value)}}class o$ extends Hn{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Ro(this.left.eval(t,n),"boolean"),o=Ro(this.right.eval(t,n),"boolean");return(o==null?void 0:o.value)===!0||(r==null?void 0:r.value)===!1?ve(!0):!r||!o?[]:ve(!1)}}class Nv{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Nn[this.name];if(!r)throw new Error("Unrecognized function: "+this.name);return r(t,n,...this.args)}toString(){return`${this.name}(${this.args.map(t=>t.toString()).join(", ")})`}}class Ov{constructor(t,n){this.left=t,this.expr=n}eval(t,n){const r=this.expr.eval(t,n);if(r.length!==1)return[];const o=r[0].value;if(typeof o!="number")throw new Error("Invalid indexer expression: should return integer}");const i=this.left.eval(t,n);return o in i?[i[o]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const i$=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class s${constructor(t,n,r,o){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!(o!=null&&o.dateTimeLiterals),this.symbolRegex=(o==null?void 0:o.symbolRegex)??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const n=this.peek();return t==="/"&&n==="*"?this.consumeMultiLineComment():t==="/"&&n==="/"?this.consumeSingleLineComment():t==="'"||t==='"'?this.consumeString(t):t==="`"?this.consumeBacktickSymbol():t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(n)?this.consumeSymbol():this.consumeOperator()}consumeWhitespace(){this.consumeWhile(()=>/\s/.exec(this.curr()))}consumeMultiLineComment(){const t=this.pos.index;return this.consumeWhile(()=>this.curr()!=="*"||this.peek()!=="/"),this.advance(),this.advance(),this.buildToken("Comment",this.str.substring(t,this.pos.index))}consumeSingleLineComment(){return this.buildToken("Comment",this.consumeWhile(()=>this.curr()!==`
84
+ `))}consumeString(t){this.advance();const n=this.buildToken("String",this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t));return this.advance(),n}consumeBacktickSymbol(){this.advance();const t=this.buildToken("Symbol",this.consumeWhile(()=>this.curr()!=="`"));return this.advance(),t}consumeDateTime(){this.advance();const t=this.pos.index;this.consumeWhile(()=>/[\d-]/.exec(this.curr()));let n=!1,r=!1;this.curr()==="T"&&(n=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="Z"?(r=!0,this.advance()):(this.curr()==="+"||this.curr()==="-")&&(r=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr()))));let o=this.str.substring(t,this.pos.index);return o.endsWith("T")?o=o.substring(0,o.length-1):!o.startsWith("T")&&n&&!r&&(o+="Z"),this.buildToken("DateTime",o)}consumeNumber(){const t=this.pos.index;let n="Number";return this.consumeWhile(()=>/\d/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="-"&&this.dateTimeLiterals?(this.pos.index=t-1,this.consumeDateTime()):(this.curr()===" "&&a$(this.peekToken())&&(n="Quantity",this.consumeToken()),this.buildToken(n,this.str.substring(t,this.pos.index)))}consumeSymbol(){var n;const t=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return((n=this.prevToken())==null?void 0:n.value)!=="."&&this.keywords.includes(t)?this.buildToken(t,t):this.buildToken("Symbol",t)}consumeOperator(){const t=this.curr(),n=this.peek(),r=t+n;return this.operators.includes(r)?(this.advance(),this.advance(),this.buildToken(r,r)):(this.advance(),this.buildToken(t,t))}consumeWhile(t){const n=this.pos.index;for(;this.pos.index<this.str.length&&t();)this.advance();return this.str.substring(n,this.pos.index)}curr(){return this.str[this.pos.index]}prev(){return this.str[this.pos.index-1]??""}peek(){return this.str[this.pos.index+1]??""}mark(){this.markStack.push({...this.pos})}reset(){const t=this.markStack.pop();if(!t)throw new Error("No mark to reset to");this.pos.index=t.index,this.pos.line=t.line,this.pos.column=t.column}advance(){this.pos.index++,this.curr()===`
85
+ `?(this.pos.line++,this.pos.column=0):this.pos.column++}buildToken(t,n){const r=this.markStack.pop();if(!r)throw new Error("No mark for token");return{id:t,value:n,...r}}}function a$(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&i$.includes(e.value)))}const l$=["true","false"],c$=["!=","!~","<=",">=","{}","->"];function u$(e){return new s$(e,l$,c$).tokenize()}const Je={FunctionCall:0,Dot:1,Indexer:2,UnaryAdd:3,UnarySubtract:3,Multiply:4,Divide:4,IntegerDivide:4,Modulo:4,Add:5,Subtract:5,Ampersand:5,Is:6,As:6,Union:7,GreaterThan:8,GreaterThanOrEquals:8,LessThan:8,LessThanOrEquals:8,Equals:9,Equivalent:9,NotEquals:9,NotEquivalent:9,In:10,Contains:10,And:11,Xor:12,Or:12,Implies:13,Arrow:100,Semicolon:200},d$={parse(e){var n;const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+((n=e.peek())==null?void 0:n.value)+"`");return t}},f$={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new Ov(t,n)},precedence:Je.Indexer},h$={parse(e,t){if(!(t instanceof Dv))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new Nv(t.name,n)},precedence:Je.FunctionCall};function p$(e){const t=e.split(" "),n=parseFloat(t[0]);let r=t[1];return r!=null&&r.startsWith("'")&&r.endsWith("'")?r=r.substring(1,r.length-1):r="{"+r+"}",{value:n,unit:r}}function m$(){return new UO().registerPrefix("String",{parse:(e,t)=>new Fs({type:V.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Fs({type:V.dateTime,value:Yu(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Fs({type:V.Quantity,value:p$(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Fs({type:t.value.includes(".")?V.decimal:V.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Fs({type:V.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Fs({type:V.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new Dv(t.value)}).registerPrefix("{}",{parse:()=>new qL}).registerPrefix("(",d$).registerInfix("[",f$).registerInfix("(",h$).prefix("+",Je.UnaryAdd,(e,t)=>new GL("+",t,n=>n)).prefix("-",Je.UnarySubtract,(e,t)=>new jr("-",t,t,(n,r)=>-r)).infixLeft(".",Je.Dot,(e,t,n)=>new _v(e,n)).infixLeft("/",Je.Divide,(e,t,n)=>new jr("/",e,n,(r,o)=>r/o)).infixLeft("*",Je.Multiply,(e,t,n)=>new jr("*",e,n,(r,o)=>r*o)).infixLeft("+",Je.Add,(e,t,n)=>new jr("+",e,n,(r,o)=>r+o)).infixLeft("-",Je.Subtract,(e,t,n)=>new jr("-",e,n,(r,o)=>r-o)).infixLeft("|",Je.Union,(e,t,n)=>new IP(e,n)).infixLeft("=",Je.Equals,(e,t,n)=>new XL(e,n)).infixLeft("!=",Je.NotEquals,(e,t,n)=>new JL(e,n)).infixLeft("~",Je.Equivalent,(e,t,n)=>new ZL(e,n)).infixLeft("!~",Je.NotEquivalent,(e,t,n)=>new e$(e,n)).infixLeft("<",Je.LessThan,(e,t,n)=>new jr("<",e,n,(r,o)=>r<o)).infixLeft("<=",Je.LessThanOrEquals,(e,t,n)=>new jr("<=",e,n,(r,o)=>r<=o)).infixLeft(">",Je.GreaterThan,(e,t,n)=>new jr(">",e,n,(r,o)=>r>o)).infixLeft(">=",Je.GreaterThanOrEquals,(e,t,n)=>new jr(">=",e,n,(r,o)=>r>=o)).infixLeft("&",Je.Ampersand,(e,t,n)=>new QL(e,n)).infixLeft("and",Je.And,(e,t,n)=>new t$(e,n)).infixLeft("as",Je.As,(e,t,n)=>new Iv(e,n)).infixLeft("contains",Je.Contains,(e,t,n)=>new KL(e,n)).infixLeft("div",Je.Divide,(e,t,n)=>new jr("div",e,n,(r,o)=>r/o|0)).infixLeft("in",Je.In,(e,t,n)=>new YL(e,n)).infixLeft("is",Je.Is,(e,t,n)=>new Av(e,n)).infixLeft("mod",Je.Modulo,(e,t,n)=>new jr("mod",e,n,(r,o)=>r%o)).infixLeft("or",Je.Or,(e,t,n)=>new n$(e,n)).infixLeft("xor",Je.Xor,(e,t,n)=>new r$(e,n)).infixLeft("implies",Je.Implies,(e,t,n)=>new o$(e,n))}const g$=m$();function _P(e){return new HL(e,g$.construct(u$(e)).consumeAndParse())}function y$(e,t){const n=Array.isArray(t)?t:[t];for(let r=0;r<n.length;r++){const o=n[r];typeof o=="object"&&"type"in o&&"value"in o||(n[r]=lo(n[r]))}return lc(e,n).map(r=>r.value)}function lc(e,t,n){const r=n??{};return _P(e).eval({variables:r},t).map(i=>{var s;return{type:i.type,value:(s=i.value)==null?void 0:s.valueOf()}})}var Jo=(e=>(e.BOOLEAN="BOOLEAN",e.NUMBER="NUMBER",e.QUANTITY="QUANTITY",e.TEXT="TEXT",e.REFERENCE="REFERENCE",e.CANONICAL="CANONICAL",e.DATE="DATE",e.DATETIME="DATETIME",e.PERIOD="PERIOD",e.UUID="UUID",e))(Jo||{});function Gf(e,t){var r,o;let n=(o=(r=Io.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:o[t.code];return n||(n=x$(e,t)),n}function v$(e,t,n){let r=Io.types[e];r||(r={},Io.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function x$(e,t){const n=t.code,r=b$(n),o=E$(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const l of o){const c=Ol(l),u=TL(()=>c.join("."));c.length===1&&c[0]instanceof Hn?i.propertyTypes.add("boolean"):u().endsWith("extension.value.code")||u().endsWith("extension.value.coding.code")?(i.array=!0,i.propertyTypes.add("code")):AP(i,Ol(l),e,1),u().endsWith("extension.valueDateTime")&&(i.array=!1)}const s={columnName:r,type:C$(t,i.propertyTypes),elementDefinitions:i.elementDefinitions,array:i.array};return v$(e,n,s),s}function AP(e,t,n,r){const o=t[r];if(o instanceof Iv){e.propertyTypes.add(o.right.toString());return}if(o instanceof Nv){w$(e,o);return}const i=o.toString(),s=js(n,i);if(!s)throw new Error(`Element definition not found for ${n} ${i}`);let l=!1,c=r+1;if(c<t.length&&t[c]instanceof Ov&&(l=!0,c++),s.isArray&&!l&&(e.array=!0),c>=t.length){e.elementDefinitions.push(s);for(const u of s.type)e.propertyTypes.add(u.code);return}for(const u of s.type){let d=u.code;S$(d)&&(d=s.type[0].code),AP(e,t,d,c)}}function w$(e,t){if(t.name==="as"){e.propertyTypes.add(t.args[0].toString());return}if(t.name==="resolve"){e.propertyTypes.add("string");return}if(t.name==="where"&&t.args[0]instanceof Av){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function S$(e){return e==="Element"||e==="BackboneElement"}function b$(e){return e.split("-").reduce((t,n,r)=>t+(r?Vt(n):n),"")}function C$(e,t){switch(e.type){case"date":return t.size===1&&t.has(V.date)?"DATE":"DATETIME";case"number":return"NUMBER";case"quantity":return"QUANTITY";case"reference":return t.has(V.canonical)?"CANONICAL":"REFERENCE";case"token":return t.size===1&&t.has(V.boolean)?"BOOLEAN":"TEXT";default:return"TEXT"}}function E$(e,t){const n=[],r=_P(t);return jm(e,r.child,n),n}function jm(e,t,n){t instanceof IP?(jm(e,t.left,n),jm(e,t.right,n)):t.toString().startsWith(e+".")&&n.push(t)}function Ol(e){if(e instanceof Iv||e instanceof Ov)return[Ol(e.left),e].flat();if(e instanceof Hn)return[e];if(e instanceof _v)return[Ol(e.left),Ol(e.right)].flat();if(e instanceof Nv){if(e.name==="where"&&!(e.args[0]instanceof Av))return[];if(e.name==="last")return[]}return[e]}const Qf=20;var ie=(e=>(e.EQUALS="eq",e.NOT_EQUALS="ne",e.GREATER_THAN="gt",e.LESS_THAN="lt",e.GREATER_THAN_OR_EQUALS="ge",e.LESS_THAN_OR_EQUALS="le",e.STARTS_AFTER="sa",e.ENDS_BEFORE="eb",e.APPROXIMATELY="ap",e.CONTAINS="contains",e.EXACT="exact",e.TEXT="text",e.NOT="not",e.ABOVE="above",e.BELOW="below",e.IN="in",e.NOT_IN="not-in",e.OF_TYPE="of-type",e.MISSING="missing",e.IDENTIFIER="identifier",e.ITERATE="iterate",e))(ie||{});const NP={contains:"contains",exact:"exact",above:"above",below:"below",text:"text",not:"not",in:"in","not-in":"not-in","of-type":"of-type",missing:"missing",identifier:"identifier",iterate:"iterate"},Mv={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap"};function j$(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[s,l]=e.split("?");n=s,r=new URLSearchParams(l)}else n=e;else typeof e=="object"&&(n=e.pathname,r=e.searchParams);let o;n.includes("/")?o=n.split("/").filter(Boolean).pop():o=n;const i=[];if(r&&i.push(...r.entries()),t)for(const[s,l]of Object.entries(t))if(Array.isArray(l))for(const c of l)i.push([s,c]);else i.push([s,l??""]);return P$(o,i)}function P$(e,t){const n={resourceType:e};for(const[r,o]of t)T$(n,r,o);return n}function T$(e,t,n){var s,l;let r,o;const i=t.indexOf(":");if(i>=0?(r=t.substring(0,i),o=t.substring(i+1)):(r=t,o=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=dl(e.filters,{code:t,operator:"eq",value:n});return}switch(r){case"_sort":k$(e,n);break;case"_count":e.count=parseInt(n,10);break;case"_offset":e.offset=parseInt(n,10);break;case"_total":e.total=n;break;case"_summary":n==="count"?(e.total="accurate",e.count=0):(n==="true"||n==="data"||n==="text")&&(e.summary=n);break;case"_include":{const c=G1(n);o==="iterate"&&(c.modifier="iterate"),e.include=dl(e.include,c);break}case"_revinclude":{const c=G1(n);o==="iterate"&&(c.modifier="iterate"),e.revInclude=dl(e.revInclude,c);break}case"_fields":case"_elements":e.fields=n.split(",");break;case"_type":e.types=n.split(",");break;case"_format":e.format=n;break;case"_pretty":e.pretty=n==="true";break;default:{const c=(l=(s=Io.types[e.resourceType])==null?void 0:s.searchParams)==null?void 0:l[r];c?e.filters=dl(e.filters,R$(c,o,n)):e.filters=dl(e.filters,_$(r,o,n))}}}}function k$(e,t){for(const n of t.split(",")){let r,o=!1;n.startsWith("-")?(r=n.substring(1),o=!0):r=n,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:r,descending:o})}}function R$(e,t,n){if(t==="missing")return{code:e.code,operator:"missing",value:n};switch(e.type){case"number":case"date":case"quantity":return D$(e,n);case"reference":case"string":case"token":case"uri":return I$(e,t,n);default:throw new Error("Unrecognized search parameter type: "+e.type)}}function D$(e,t){const{operator:n,value:r}=A$(t);return{code:e.code,operator:n,value:r}}function I$(e,t,n){return{code:e.code,operator:N$(t),value:n}}function _$(e,t,n){var o;let r="eq";if(t)r=t;else if(n.length>=2){const i=n.substring(0,2);i in Mv&&(n.length===2||(o=n.at(2))!=null&&o.match(/\d/))&&(r=i,n=n.substring(i.length))}return{code:e,operator:r,value:n}}function A$(e){const t=e.substring(0,2),n=Mv[t];return n?{operator:n,value:e.substring(2)}:{operator:"eq",value:e}}function N$(e){return NP[e]??"eq"}function G1(e){const t=e.split(":");if(t.includes("*"))throw new $e(pi("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new $e(pi(`Invalid include value '${e}': must be of the form ResourceType:search-parameter`));if(t.length===2)return{resourceType:t[0],searchParam:t[1]};if(t.length===3)return{resourceType:t[0],searchParam:t[1],targetType:t[2]};throw new $e(pi(`Invalid include value '${e}'`))}function ra(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(O$(n))),e.sortRules&&e.sortRules.length>0&&t.push(M$(e.sortRules)),e.offset!==void 0&&t.push("_offset="+e.offset),e.count!==void 0&&t.push("_count="+e.count),e.total!==void 0&&t.push("_total="+e.total),e.include&&e.include.forEach(n=>t.push(Q1("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(Q1("_revinclude",n))),t.length===0?"":(t.sort((n,r)=>n.localeCompare(r)),"?"+t.join("&"))}function O$(e){const t=e.operator in NP?":"+e.operator:"",n=e.operator!=="eq"&&e.operator in Mv?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function M$(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function Q1(e,t){return e+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function L$(e){if(typeof window<"u")return window.atob(e);if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("binary");throw new Error("Unable to decode base64")}function $$(e){if(typeof window<"u")return window.btoa(e);if(typeof Buffer<"u")return Buffer.from(e,"binary").toString("base64");throw new Error("Unable to encode base64")}function K1(){const e=new Uint32Array(28);return crypto.getRandomValues(e),bL(e.buffer)}async function F$(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function OP(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function MP(e){var o,i,s;const t={};e=co(e);for(const l of e.entry||[]){((o=l.resource)==null?void 0:o.meta)!==void 0&&(delete l.resource.meta.author,delete l.resource.meta.compartment,delete l.resource.meta.lastUpdated,delete l.resource.meta.project,delete l.resource.meta.versionId);const c=(i=l.resource)==null?void 0:i.id;c&&(t[c]=OP(),l.fullUrl="urn:uuid:"+t[c],(s=l.resource)==null||delete s.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n==null?void 0:n.map(l=>({fullUrl:l.fullUrl,request:{method:"POST",url:l.resource.resourceType},resource:l.resource}))},(l,c)=>z$(l,c,t),2);return B$(JSON.parse(r))}function z$(e,t,n){if(e==="reference"&&typeof t=="string"){let r;if(t.includes("/")?r=t.split("/")[1]:t.startsWith("urn:uuid:")?r=t.slice(9):t.startsWith("#")&&(r=t.slice(1)),r){const o=n[r];if(o)return"urn:uuid:"+o}}return t}function B$(e){const t=V$(e),{sorted:n,cycles:r}=U$(t),o={};for(const s of e.entry||[])s.fullUrl&&(o[s.fullUrl]=s);const i=n.map(s=>o[s]);for(const s of r)for(const l of s){const c=o[l],u={...c,request:{...c.request,method:"PUT"}};i.push(u)}return{...e,entry:i}}function U$(e){const t=[],n={},r=[];for(const i of Object.keys(e))n[i]=0;function o(i,s){if(n[i]===2)return!0;if(n[i]===1){const c=s.lastIndexOf(i);return c!==-1&&r.push(s.slice(c)),!0}n[i]=1,s.push(i);let l=!1;for(const c of e[i])o(c,s)||(l=!0);return n[i]=2,s.pop(),t.unshift(i),!l}for(const i in e)n[i]===0&&o(i,[]);return{sorted:t,cycles:r}}function LP(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(Ps(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else LP(r,t)}}function V$(e){const t={};for(const n of e.entry||[])n.fullUrl&&(t[n.fullUrl]=[]);for(const n of e.entry||[]){const r=n.fullUrl;n.resource&&LP(n.resource,o=>{t[o]&&t[o].push(r)})}return t}class $P{constructor(t=10){this.max=t,this.cache=new Map}clear(){this.cache.clear()}get(t){const n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){this.cache.has(t)?this.cache.delete(t):this.cache.size>=this.max&&this.cache.delete(this.first()),this.cache.set(t,n)}delete(t){this.cache.delete(t)}keys(){return this.cache.keys()}first(){return this.cache.keys().next().value}}const Gt={CSS:"text/css",DICOM:"application/dicom",FAVICON:"image/vnd.microsoft.icon",FHIR_JSON:"application/fhir+json",FORM_URL_ENCODED:"application/x-www-form-urlencoded",HL7_V2:"x-application/hl7-v2+er7",HTML:"text/html",JAVASCRIPT:"text/javascript",JSON:"application/json",JSON_PATCH:"application/json-patch+json",PNG:"image/png",SCIM_JSON:"application/scim+json",SVG:"image/svg+xml",TEXT:"text/plain",TYPESCRIPT:"text/typescript",PING:"x-application/ping"};class FP{constructor(){this.listeners={}}addEventListener(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)}removeEventListener(t,n){const r=this.listeners[t];if(r){for(let o=0;o<r.length;o++)if(r[o]===n){r.splice(o,1);return}}}dispatchEvent(t){const n=this.listeners[t.type];if(n)for(const r of n)r.call(this,t);return!t.defaultPrevented}removeAllListeners(){this.listeners={}}}class Lv{constructor(){this.emitter=new FP}dispatchEvent(t){this.emitter.dispatchEvent(t)}addEventListener(t,n){this.emitter.addEventListener(t,n)}removeEventListener(t,n){this.emitter.removeEventListener(t,n)}removeAllListeners(){this.emitter.removeAllListeners()}}const Pm={"Patient-open":"Patient-open","Patient-close":"Patient-close","ImagingStudy-open":"ImagingStudy-open","ImagingStudy-close":"ImagingStudy-close","Encounter-open":"Encounter-open","Encounter-close":"Encounter-close","DiagnosticReport-open":"DiagnosticReport-open","DiagnosticReport-close":"DiagnosticReport-close","DiagnosticReport-select":"DiagnosticReport-select","DiagnosticReport-update":"DiagnosticReport-update",syncerror:"syncerror"},W$=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],$v=["DiagnosticReport-update"];function H$(e){return $v.includes(e)}function q$(e){if($v.includes(e))throw new $e(vt(`'context.version' is required for '${e}'.`))}const G$={"Patient-open":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"Patient-close":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"ImagingStudy-open":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"ImagingStudy-close":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"Encounter-open":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"Encounter-close":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"DiagnosticReport-open":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-close":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-select":{report:{resourceType:"DiagnosticReport"},select:{resourceType:"*",isArray:!0}},"DiagnosticReport-update":{report:{resourceType:"DiagnosticReport"},patient:{resourceType:"Patient",optional:!0},study:{resourceType:"ImagingStudy",optional:!0},updates:{resourceType:"Bundle"}},syncerror:{operationoutcome:{resourceType:"OperationOutcome"}}};function Q$(e){return W$.includes(e)}function zP(e){return!!e.endpoint}function Y1(e){if(!Fv(e))throw new $e(vt("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:o}=e,i={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":o.join(",")};return zP(e)&&(i.endpoint=e.endpoint),new URLSearchParams(i).toString()}function Fv(e){if(typeof e!="object")return!1;const{channelType:t,mode:n,topic:r,events:o}=e;if(!(t&&n&&r&&o)||typeof r!="string"||typeof o!="object"||!Array.isArray(o)||o.length<1||t!=="websocket"||n!=="subscribe"&&n!=="unsubscribe")return!1;for(const i of o)if(!Pm[i])return!1;return!(zP(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function X1(e,t,n,r){if(typeof t!="object")throw new $e(vt(`context[${n}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));if(!(t.id&&typeof t.id=="string"))throw new $e(vt(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new $e(vt(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!Q$(t.resourceType))throw new $e(vt(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(o&&t.resourceType!==o)throw new $e(vt(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function K$(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),!r.isArray)X1(e,t.resource,n,r);else{const{resources:i}=t;if(!i)throw new $e(vt(`context[${n}] is invalid. context[${n}] for the '${e}' with key '${String(t.key)}' should contain an array of resources on the key 'resources'.`));for(const s of i)X1(e,s,n,r)}}function Y$(e,t){const n=new Map,r=G$[e];for(let o=0;o<t.length;o++){const i=t[o].key;if(!r[i])throw new $e(vt(`Key '${i}' not found for event '${e}'. Make sure to add only valid keys.`));K$(e,t[o],o,r[i],n)}for(const[o,i]of Object.entries(r)){if(!(i.optional||n.has(o)))throw new $e(vt(`Missing required key '${o}' on context for '${e}' event.`));if(!i.manyAllowed&&(n.get(o)||0)>1)throw new $e(vt(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function J1(e,t,n,r){if(!(e&&typeof e=="string"))throw new $e(vt("Must provide a topic."));if(!Pm[t])throw new $e(vt(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Pm).join(", ")}`));if(typeof n!="object")throw new $e(vt("context must be a context object or array of context objects."));if($v.includes(t)&&!r)throw new $e(vt(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return Y$(t,o),{timestamp:new Date().toISOString(),id:OP(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class X$ extends Lv{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new $e(vt("Subscription request should contain an endpoint."));if(!Fv(t))throw new $e(vt("Subscription request failed validation."));const n=new WebSocket(t.endpoint);n.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),n.addEventListener("message",r=>{const o=JSON.parse(r.data);if(o["hub.topic"])return;const i=o;i.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:i}),n.send(JSON.stringify({id:o==null?void 0:o.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function J$(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=L$(t),r=Array.from(n).reduce((i,s)=>{const l=("00"+s.charCodeAt(0).toString(16)).slice(-2);return`${i}%${l}`},""),o=decodeURIComponent(r);return JSON.parse(o)}function Z$(e){return e.split(".").length===3}function zv(e){const[t,n,r]=e.split(".");return J$(n)}function e7(e){try{return typeof zv(e).login_id=="string"}catch{return!1}}function t7(e){try{const n=zv(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class n7{constructor(t){this.medplum=t}async get(t){return this.medplum.get(`keyvalue/v1/${t}`)}async set(t,n){await this.medplum.put(`keyvalue/v1/${t}`,n)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var Z1;class Pr{constructor(t){this[Z1]="ReadablePromise",this.status="pending",this.suspender=t.then(n=>(this.status="success",this.response=n,n),n=>{throw this.status="error",this.error=n,n})}isPending(){return this.status==="pending"}isOk(){return this.status==="success"}read(){switch(this.status){case"pending":throw this.suspender;case"error":throw this.error;default:return this.response}}then(t,n){return this.suspender.then(t,n)}catch(t){return this.suspender.catch(t)}finally(t){return this.suspender.finally(t)}}Z1=Symbol.toStringTag;class r7{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new o7)}clear(){this.storage.clear()}getString(t){return this.storage.getItem(t)??void 0}setString(t,n){n?this.storage.setItem(t,n):this.storage.removeItem(t)}getObject(t){const n=this.getString(t);return n?JSON.parse(n):void 0}setObject(t,n){this.setString(t,n?tr(n):void 0)}}class o7{constructor(){this.data=new Map}get length(){return this.data.size}clear(){this.data.clear()}getItem(t){return this.data.get(t)??null}setItem(t,n){n?this.data.set(t,n):this.data.delete(t)}removeItem(t){this.data.delete(t)}key(t){return Array.from(this.data.keys())[t]}}class i7 extends Lv{constructor(t){super(),this.bufferedAmount=-1/0,this.extensions="NOT_IMPLEMENTED",this.messageBuffer=[];const n=new WebSocket(t);n.addEventListener("open",()=>{if(this.messageBuffer.length){const r=this.messageBuffer;for(const o of r)n.send(o)}this.dispatchEvent(new Event("open"))}),n.addEventListener("error",r=>{this.dispatchEvent(r)}),n.addEventListener("message",r=>{this.dispatchEvent(r)}),n.addEventListener("close",r=>{this.dispatchEvent(r)}),this.ws=n}get readyState(){return this.ws.readyState}close(){this.ws.close()}send(t){if(this.ws.readyState!==WebSocket.OPEN){this.messageBuffer.push(t);return}try{this.ws.send(t)}catch(n){this.dispatchEvent(new ErrorEvent("error",{error:n,message:n.message})),this.messageBuffer.push(t)}}}class Tm extends Lv{constructor(...t){super(),this.criteria=new Set(t)}getCriteria(){return this.criteria}_addCriteria(t){this.criteria.add(t)}_removeCriteria(t){this.criteria.delete(t)}}class s7{constructor(t){this.criteria=t,this.emitter=new Tm(t),this.refCount=1}}class a7{constructor(t,n,r){if(!(t instanceof BP))throw new $e(vt("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new $e(vt("Not a valid URL"))}const i=r!=null&&r.RobustWebSocket?new r.RobustWebSocket(o):new i7(o);this.medplum=t,this.ws=i,this.masterSubEmitter=new Tm,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.setupWebSocketListeners()}setupWebSocketListeners(){const t=this.ws;t.addEventListener("message",n=>{var r,o,i,s,l;try{const c=JSON.parse(n.data),u=(o=(r=c==null?void 0:c.entry)==null?void 0:r[0])==null?void 0:o.resource;if(u.type==="heartbeat"){(i=this.masterSubEmitter)==null||i.dispatchEvent({type:"heartbeat",payload:c});return}(s=this.masterSubEmitter)==null||s.dispatchEvent({type:"message",payload:c});const d=this.criteriaEntriesBySubscriptionId.get(Hf(u.subscription));if(!d){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}d.emitter.dispatchEvent({type:"message",payload:c})}catch(c){console.error(c);const u={type:"error",payload:c};(l=this.masterSubEmitter)==null||l.dispatchEvent(u);for(const{emitter:d}of this.criteriaEntries.values())d.dispatchEvent(u)}}),t.addEventListener("error",()=>{var r;const n={type:"error",payload:new $e(ZO(new Error("WebSocket error")))};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const{emitter:o}of this.criteriaEntries.values())o.dispatchEvent(n)}),t.addEventListener("close",()=>{var r;const n={type:"close"};this.wsClosed&&((r=this.masterSubEmitter)==null||r.dispatchEvent(n));for(const{emitter:o}of this.criteriaEntries.values())o.dispatchEvent(n)})}emitConnect(t){var r;const n={type:"connect",payload:{subscriptionId:t}};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const{emitter:o}of this.criteriaEntries.values())o.dispatchEvent(n)}emitError(t,n){var o,i,s;const r={type:"error",payload:n};(o=this.masterSubEmitter)==null||o.dispatchEvent(r),(s=(i=this.criteriaEntries.get(t))==null?void 0:i.emitter)==null||s.dispatchEvent(r)}async getTokenForCriteria(t){var s,l;let n=t==null?void 0:t.subscriptionId;n||(n=(await this.medplum.createResource({resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${ht(this.medplum.getProfile())}`,criteria:t.criteria,channel:{type:"websocket"}})).id);const{parameter:r}=await this.medplum.get(`/fhir/R4/Subscription/${n}/$get-ws-binding-token`),o=(s=r==null?void 0:r.find(c=>c.name==="token"))==null?void 0:s.valueString,i=(l=r==null?void 0:r.find(c=>c.name==="websocket-url"))==null?void 0:l.valueUrl;if(!o)throw new $e(vt("Failed to get token"));if(!i)throw new $e(vt("Failed to get URL from $get-ws-binding-token"));return[n,o]}addCriteria(t){this.masterSubEmitter&&this.masterSubEmitter._addCriteria(t);const n=this.criteriaEntries.get(t);if(n)return n.refCount+=1,n.emitter;const r=new s7(t);return this.criteriaEntries.set(t,r),this.getTokenForCriteria(r).then(([o,i])=>{r.subscriptionId=o,this.criteriaEntriesBySubscriptionId.set(o,r),this.emitConnect(o),this.ws.send(JSON.stringify({type:"bind-with-token",payload:{token:i}}))}).catch(o=>{console.error(o.message),this.emitError(t,o),this.criteriaEntries.delete(t)}),r.emitter}removeCriteria(t){var i,s,l;const n=this.criteriaEntries.get(t);if(!n){console.warn("Criteria not known to `SubscriptionManager`. Possibly called remove too many times.");return}if(n.refCount-=1,n.refCount>0)return;const r=(i=this.criteriaEntries.get(t))==null?void 0:i.subscriptionId,o={type:"disconnect",payload:{subscriptionId:r}};this.masterSubEmitter&&(this.masterSubEmitter._removeCriteria(t),this.masterSubEmitter.dispatchEvent(o)),(l=(s=this.criteriaEntries.get(t))==null?void 0:s.emitter)==null||l.dispatchEvent(o),this.criteriaEntries.delete(t),r&&this.criteriaEntriesBySubscriptionId.delete(r)}closeWebSocket(){this.wsClosed||(this.wsClosed=!0,this.ws.close())}getCriteriaCount(){return this.criteriaEntries.size}getMasterEmitter(){return this.masterSubEmitter||(this.masterSubEmitter=new Tm(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const l7="3.0.12-787031d28",c7=Gt.FHIR_JSON+", */*; q=0.1",u7="https://api.medplum.com/",d7=1e3,f7=6e4,h7=0,p7="Binary/",ew={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]};class BP extends FP{constructor(t){if(super(),this.initComplete=!0,t!=null&&t.baseUrl&&!t.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");if(this.options=t??{},this.fetch=(t==null?void 0:t.fetch)??m7(),this.storage=(t==null?void 0:t.storage)??new r7,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=nw((t==null?void 0:t.baseUrl)??u7),this.fhirBaseUrl=nw(ku(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4/")),this.authorizeUrl=ku(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=ku(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=ku(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),this.clientId=(t==null?void 0:t.clientId)??"",this.clientSecret=(t==null?void 0:t.clientSecret)??"",this.onUnauthenticated=t==null?void 0:t.onUnauthenticated,this.cacheTime=(t==null?void 0:t.cacheTime)??(typeof window>"u"?h7:f7),this.cacheTime>0?this.requestCache=new $P((t==null?void 0:t.resourceCacheSize)??d7):this.requestCache=void 0,t!=null&&t.autoBatchTime?(this.autoBatchTime=t.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),t!=null&&t.accessToken)this.setAccessToken(t.accessToken),this.initPromise=Promise.resolve();else if(this.storage.getInitPromise!==void 0){const n=this.storage.getInitPromise(),r=new Promise((o,i)=>{n.then(()=>{this.attemptResumeActiveLogin().then(o).catch(s=>{console.error(s),o()}),this.initComplete=!0}).catch(i)});this.initPromise=r,this.initComplete=!1}else this.initPromise=this.attemptResumeActiveLogin().catch(console.error);this.setupStorageListener()}get isInitialized(){return this.initComplete}getInitPromise(){return this.initPromise}async attemptResumeActiveLogin(){const t=this.getActiveLogin();t&&(this.setAccessToken(t.accessToken,t.refreshToken),await this.refreshProfile())}getBaseUrl(){return this.baseUrl}getAuthorizeUrl(){return this.authorizeUrl}getTokenUrl(){return this.tokenUrl}getLogoutUrl(){return this.logoutUrl}clear(){this.storage.clear(),sessionStorage.clear(),this.clearActiveLogin()}clearActiveLogin(){var t;this.storage.setString("activeLogin",void 0),(t=this.requestCache)==null||t.clear(),this.accessToken=void 0,this.refreshToken=void 0,this.refreshPromise=void 0,this.accessTokenExpires=void 0,this.sessionDetails=void 0,this.medplumServer=void 0,this.dispatchEvent({type:"change"})}invalidateUrl(t){var n;t=t.toString(),(n=this.requestCache)==null||n.delete(t)}invalidateAll(){var t;(t=this.requestCache)==null||t.clear()}invalidateSearches(t){const n=this.fhirBaseUrl+t;if(this.requestCache)for(const r of this.requestCache.keys())(r.endsWith(n)||r.includes(n+"?"))&&this.requestCache.delete(r)}get(t,n={}){t=t.toString();const r=this.getCacheEntry(t,n);if(r)return r.value;let o;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue?o=new Promise((s,l)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:s,reject:l}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):o=this.request("GET",t,n);const i=new Pr(o);return this.setCacheEntry(t,i),i}post(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("POST",t,o)}put(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("PUT",t,o)}patch(t,n,r={}){return t=t.toString(),this.setRequestBody(r,n),this.setRequestContentType(r,Gt.JSON_PATCH),this.invalidateUrl(t),this.request("PATCH",t,r)}delete(t,n){return t=t.toString(),this.invalidateUrl(t),this.request("DELETE",t,n)}async startNewUser(t,n){const{codeChallengeMethod:r,codeChallenge:o}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:o},void 0,n)}async startNewProject(t,n){return this.post("auth/newproject",t,void 0,n)}async startNewPatient(t,n){return this.post("auth/newpatient",t,void 0,n)}async startLogin(t,n){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async startGoogleLogin(t,n){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const r=new URLSearchParams(window.location.search).get("code");if(!r){await this.requestAuthorization(t);return}return this.processCode(r)}signOutWithRedirect(){window.location.assign(this.logoutUrl)}async signInWithExternalAuth(t,n,r,o,i=!0){let s=o;i&&(s=await this.ensureCodeChallenge(o)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,s,i))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");const r=new URLSearchParams;return r.set("grant_type","urn:ietf:params:oauth:grant-type:token-exchange"),r.set("subject_token_type","urn:ietf:params:oauth:token-type:access_token"),r.set("client_id",n),r.set("subject_token",t),this.fetchTokens(r)}getExternalAuthRedirectUri(t,n,r,o,i=!0){const s=new URL(t);if(s.searchParams.set("response_type","code"),s.searchParams.set("client_id",n),s.searchParams.set("redirect_uri",r),s.searchParams.set("scope",o.scope??"openid profile email"),s.searchParams.set("state",JSON.stringify(o)),i){const{codeChallenge:l,codeChallengeMethod:c}=o;if(!c)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!l)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");s.searchParams.set("code_challenge_method",c),s.searchParams.set("code_challenge",l)}return s.toString()}fhirUrl(...t){return new URL(t.join("/"),this.fhirBaseUrl)}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=new URLSearchParams(n).toString()),r}search(t,n,r){const o=this.fhirSearchUrl(t,n),i="search-"+o.toString(),s=this.getCacheEntry(i,r);if(s)return s.value;const l=new Pr((async()=>{const c=await this.get(o,r);if(c.entry)for(const u of c.entry)this.cacheResource(u.resource);return c})());return this.setCacheEntry(i,l),l}searchOne(t,n,r){const o=this.fhirSearchUrl(t,n);o.searchParams.set("_count","1"),o.searchParams.sort();const i="searchOne-"+o.toString(),s=this.getCacheEntry(i,r);if(s)return s.value;const l=new Pr(this.search(t,o.searchParams,r).then(c=>{var u,d;return(d=(u=c.entry)==null?void 0:u[0])==null?void 0:d.resource}));return this.setCacheEntry(i,l),l}searchResources(t,n,r){const i="searchResources-"+this.fhirSearchUrl(t,n).toString(),s=this.getCacheEntry(i,r);if(s)return s.value;const l=new Pr(this.search(t,n,r).then(rp));return this.setCacheEntry(i,l),l}async*searchResourcePages(t,n,r){var i,s;let o=this.fhirSearchUrl(t,n);for(;o;){const l=new URL(o).searchParams,c=await this.search(t,l,r),u=(i=c.link)==null?void 0:i.find(d=>d.relation==="next");if(!((s=c.entry)!=null&&s.length)&&!u)break;yield rp(c),o=u!=null&&u.url?new URL(u.url):void 0}}searchValueSet(t,n,r){return this.valueSetExpand({url:t,filter:n},r)}valueSetExpand(t,n){const r=this.fhirUrl("ValueSet","$expand");return r.search=new URLSearchParams(t).toString(),this.get(r.toString(),n)}getCached(t,n){var o,i;const r=(i=(o=this.requestCache)==null?void 0:o.get(this.fhirUrl(t,n).toString()))==null?void 0:i.value;return r!=null&&r.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return ew;const[r,o]=n.split("/");if(!(!r||!o))return this.getCached(r,o)}readResource(t,n,r){return this.get(this.fhirUrl(t,n),r)}readReference(t,n){const r=t.reference;if(!r)return new Pr(Promise.reject(new Error("Missing reference")));if(r==="system")return new Pr(Promise.resolve(ew));const[o,i]=r.split("/");return!o||!i?new Pr(Promise.reject(new Error("Invalid reference"))):this.readResource(o,i,n)}requestSchema(t){if(hP(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new Pr((async()=>{const i=`{
86
+ StructureDefinitionList(name: "${t}") {
87
+ resourceType,
88
+ name,
89
+ kind,
90
+ description,
91
+ type,
92
+ snapshot {
93
+ element {
94
+ id,
95
+ path,
96
+ definition,
97
+ min,
98
+ max,
99
+ base {
100
+ path,
101
+ min,
102
+ max
103
+ },
104
+ contentReference,
105
+ type {
106
+ code,
107
+ profile,
108
+ targetProfile
109
+ },
110
+ binding {
111
+ strength,
112
+ valueSet
113
+ }
114
+ }
115
+ }
116
+ }
117
+ SearchParameterList(base: "${t}", _count: 100) {
118
+ base,
119
+ code,
120
+ type,
121
+ expression,
122
+ target
123
+ }
124
+ }`.replace(/\s+/g," "),s=await this.graphql(i);L1(s.data.StructureDefinitionList);for(const l of s.data.SearchParameterList)FL(l)})());return this.setCacheEntry(n,o),o}requestProfileSchema(t,n){if(!(n!=null&&n.expandProfile)&&jv(t))return Promise.resolve([t]);const r=t+"-requestSchema"+(n!=null&&n.expandProfile?"-nested":""),o=this.getCacheEntry(r,void 0);if(o)return o.value;const i=new Pr((async()=>{if(n!=null&&n.expandProfile){const s=this.fhirUrl("StructureDefinition","$expand-profile");s.search=new URLSearchParams({url:t}).toString();const l=await this.post(s.toString(),{});return rp(l).map(c=>(fP(c,c.url),c.url))}else{const s=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});return s?(L1([s],t),[t]):(console.warn(`No StructureDefinition found for ${t}!`),[])}})());return this.setCacheEntry(r,i),i}readHistory(t,n,r){return this.get(this.fhirUrl(t,n,"_history"),r)}readVersion(t,n,r,o){return this.get(this.fhirUrl(t,n,"_history",r),o)}readPatientEverything(t,n){return this.get(this.fhirUrl("Patient",t,"$everything"),n)}createResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");return this.invalidateSearches(t.resourceType),this.post(this.fhirUrl(t.resourceType),t,void 0,n)}async createResourceIfNoneExist(t,n,r){return await this.searchOne(t.resourceType,n,r)??this.createResource(t,r)}async createAttachment(t,n,r,o,i){const s=ow(t,n,r,o),l=i??(typeof n=="object"?n:{}),c=await this.createBinary(s,l);return{contentType:s.contentType,url:c.url,title:s.filename}}createBinary(t,n,r,o,i){const s=ow(t,n,r,o),l=i??(typeof n=="object"?n:{}),{data:c,contentType:u,filename:d,securityContext:f,onProgress:h}=s,m=this.fhirUrl("Binary");return d&&m.searchParams.set("_filename",d),f!=null&&f.reference&&this.setRequestHeader(l,"X-Security-Context",f.reference),h?this.uploadwithProgress(m,c,u,h,l):this.post(m,c,u,l)}uploadwithProgress(t,n,r,o,i){return new Promise((s,l)=>{var f;const c=new XMLHttpRequest,u=()=>c.abort();(f=i==null?void 0:i.signal)==null||f.addEventListener("abort",u);const d=h=>{var m;(m=i==null?void 0:i.signal)==null||m.removeEventListener("abort",u),h instanceof Error?l(h):s(h)};if(c.responseType="json",c.onabort=()=>d(new Error("Request aborted")),c.onerror=()=>d(new Error("Request error")),o&&(c.upload.onprogress=h=>o(h),c.upload.onload=h=>o(h)),c.onload=()=>{c.status>=200&&c.status<300?d(c.response):d(new $e(lt(c.response||c.statusText)))},c.open("POST",t),c.withCredentials=!0,c.setRequestHeader("Authorization","Bearer "+this.accessToken),c.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),c.setRequestHeader("Content-Type",r),c.setRequestHeader("X-Medplum","extended"),i!=null&&i.headers){const h=i.headers;for(const[m,g]of Object.entries(h))c.setRequestHeader(m,g)}c.send(n)})}async createPdf(t,n,r,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const i=v7(t,n,r,o),s=typeof n=="object"?n:{},{docDefinition:l,tableLayouts:c,fonts:u,...d}=i,f=await this.createPdfImpl(l,c,u),h={...d,data:f,contentType:"application/pdf"};return this.createBinary(h,s)}createComment(t,n,r){const o=this.getProfile();let i,s;return t.resourceType==="Encounter"&&(i=ft(t),s=t.subject),t.resourceType==="ServiceRequest"&&(i=t.encounter,s=t.subject),t.resourceType==="Patient"&&(s=ft(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[ft(t)],encounter:i,subject:s,sender:o?ft(o):void 0,sent:new Date().toISOString(),payload:[{contentString:n}]},r)}async updateResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");let r=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,n);return r||(r=t),this.cacheResource(r),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),r}patchResource(t,n,r,o){return this.invalidateSearches(t),this.patch(this.fhirUrl(t,n),r,o)}deleteResource(t,n,r){return this.deleteCacheEntry(this.fhirUrl(t,n).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,n),r)}validateResource(t,n){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,n)}executeBot(t,n,r,o){let i;if(typeof t=="string"){const s=t;i=this.fhirUrl("Bot",s,"$execute")}else{const s=t;i=this.fhirUrl("Bot","$execute"),i.searchParams.set("identifier",s.system+"|"+s.value)}return this.post(i,n,r,o)}executeBatch(t,n){return this.post(this.fhirBaseUrl.slice(0,-1),t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,Gt.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},Gt.JSON,o)}readResourceGraph(t,n,r,o){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,o)}pushToAgent(t,n,r,o,i,s){return this.post(this.fhirUrl("Agent",Hf(t),"$push"),{destination:typeof n=="string"?n:ht(n),body:r,contentType:o,waitForResponse:i},Gt.FHIR_JSON,s)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||ht(this.sessionDetails.profile)!==((r=t.profile)==null?void 0:r.reference))&&this.clearActiveLogin(),this.setAccessToken(t.accessToken,t.refreshToken),this.storage.setObject("activeLogin",t),this.addLogin(t),this.refreshPromise=void 0,await this.refreshProfile()}getAccessToken(){return this.accessToken}setAccessToken(t,n){this.accessToken=t,this.refreshToken=n,this.sessionDetails=void 0,this.accessTokenExpires=t7(t),this.medplumServer=e7(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>{var o,i;return((o=r.profile)==null?void 0:o.reference)!==((i=t.profile)==null?void 0:i.reference)});n.push(t),this.storage.setObject("logins",n)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((t,n)=>{this.get("auth/me").then(r=>{var i,s;this.profilePromise=void 0;const o=((s=(i=this.sessionDetails)==null?void 0:i.profile)==null?void 0:s.id)!==r.profile.id;this.sessionDetails=r,o&&this.dispatchEvent({type:"change"}),t(r.profile)}).catch(n)}),this.profilePromise):Promise.resolve(void 0)}isLoading(){return!this.isInitialized||!!this.profilePromise}isSuperAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.project.superAdmin)}isProjectAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.membership.admin)}getProject(){var t;return(t=this.sessionDetails)==null?void 0:t.project}getProjectMembership(){var t;return(t=this.sessionDetails)==null?void 0:t.membership}getProfile(){var t;return(t=this.sessionDetails)==null?void 0:t.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){var t;return(t=this.sessionDetails)==null?void 0:t.config}getAccessPolicy(){var t;return(t=this.sessionDetails)==null?void 0:t.accessPolicy}async download(t,n={}){this.refreshPromise&&await this.refreshPromise;const r=t.toString();r.startsWith(p7)&&(t=this.fhirUrl(r));let o=n.headers;return o||(o={},n.headers=o),o.Accept||(o.Accept="*/*"),this.addFetchOptionsDefaults(n),(await this.fetchWithRetry(t.toString(),n)).blob()}async createMedia(t,n){const{additionalFields:r,...o}=t,i=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});o.securityContext||(o.securityContext=ft(i));const s=await this.createAttachment(o,n);return this.updateResource({...i,status:"completed",content:s})}async uploadMedia(t,n,r,o,i){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:o},i)}async bulkExport(t="",n,r,o){const i=t&&`${t}/`,s=this.fhirUrl(`${i}$export`);return n&&s.searchParams.set("_type",n),r&&s.searchParams.set("_since",r),this.startAsyncRequest(s.toString(),o)}async startAsyncRequest(t,n={}){this.addFetchOptionsDefaults(n);const r=n.headers;return r.Prefer="respond-async",this.request("POST",t,n)}get keyValue(){return this.keyValueClient||(this.keyValueClient=new n7(this)),this.keyValueClient}getCacheEntry(t,n){if(!this.requestCache||(n==null?void 0:n.cache)==="no-cache"||(n==null?void 0:n.cache)==="reload")return;const r=this.requestCache.get(t);if(!(!r||r.requestTime+this.cacheTime<Date.now()))return r}setCacheEntry(t,n){this.requestCache&&this.requestCache.set(t,{requestTime:Date.now(),value:n})}cacheResource(t){var n,r;t!=null&&t.id&&!((r=(n=t.meta)==null?void 0:n.tag)!=null&&r.some(o=>o.code==="SUBSETTED"))&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new Pr(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={},o={}){await this.refreshIfExpired(),r.method=t,this.addFetchOptionsDefaults(r);const i=await this.fetchWithRetry(n,r);if(i.status===401)return this.handleUnauthenticated(t,n,r);if(i.status===204||i.status===304)return;const s=i.headers.get("content-type"),l=s==null?void 0:s.includes("json");if(i.status===404&&!l)throw new $e(JO);const c=await this.parseBody(i,l);if(i.status===200&&r.followRedirectOnOk||i.status===201&&r.followRedirectOnCreated){const u=await rw(i,c);if(u)return this.request("GET",u,{...r,body:void 0})}if(i.status===202&&r.pollStatusOnAccepted){const d=await rw(i,c)??o.statusUrl;if(d)return this.pollStatus(d,r,o)}if(i.status>=400)throw new $e(lt(c));return c}async parseBody(t,n){let r;if(n)try{r=await t.json()}catch(o){throw console.error("Error parsing response",t.status,o),o}else r=await t.text();return r}async fetchWithRetry(t,n){t.startsWith("http")||(t=new URL(t,this.baseUrl).href);const r=3,o=200;let i;for(let s=0;s<r;s++){try{if(this.options.verbose&&this.logRequest(t,n),i=await this.fetch(t,n),this.options.verbose&&this.logResponse(i),i.status<500)return i}catch(l){this.retryCatch(s,r,l)}await H1(o)}return i}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers,o=Object.entries(r).sort((i,s)=>i[0].localeCompare(s[0]));for(const[i,s]of o)console.log(`> ${i}: ${s}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((n,r)=>console.log(`< ${r}: ${n}`))}async pollStatus(t,n,r){const o={...n,method:"GET",body:void 0,redirect:"follow"};if(r.pollCount===void 0)n.headers&&typeof n.headers=="object"&&"Prefer"in n.headers&&(o.headers={...n.headers},delete o.headers.Prefer),r.statusUrl=t,r.pollCount=1;else{const i=n.pollStatusPeriod??1e3;await H1(i),r.pollCount++}return this.request("GET",t,o,r)}async executeAutoBatch(){var o,i;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const s=t[0];try{s.resolve(await this.request(s.method,this.fhirBaseUrl+s.url,s.options))}catch(l){s.reject(new $e(lt(l)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(s=>({request:{method:s.method,url:s.url},resource:s.options.body?JSON.parse(s.options.body):void 0}))},r=await this.post(this.fhirBaseUrl.slice(0,-1),n);for(let s=0;s<t.length;s++){const l=t[s],c=(o=r.entry)==null?void 0:o[s];(i=c==null?void 0:c.response)!=null&&i.outcome&&!lP(c.response.outcome)?l.reject(new $e(c.response.outcome)):l.resolve(c==null?void 0:c.resource)}}addFetchOptionsDefaults(t){this.setRequestHeader(t,"X-Medplum","extended"),this.setRequestHeader(t,"Accept",c7,!0),t.body&&this.setRequestHeader(t,"Content-Type",Gt.FHIR_JSON,!0),this.accessToken?this.setRequestHeader(t,"Authorization","Bearer "+this.accessToken):this.basicAuth&&this.setRequestHeader(t,"Authorization","Basic "+this.basicAuth),t.cache||(t.cache="no-cache"),t.credentials||(t.credentials="include")}setRequestContentType(t,n){this.setRequestHeader(t,"Content-Type",n)}setRequestHeader(t,n,r,o=!1){t.headers||(t.headers={});const i=t.headers;o&&i[n]||(i[n]=r)}setRequestBody(t,n){typeof n=="string"||typeof Blob<"u"&&(n instanceof Blob||n.constructor.name==="Blob")||typeof File<"u"&&(n instanceof File||n.constructor.name==="File")||typeof Uint8Array<"u"&&(n instanceof Uint8Array||n.constructor.name==="Uint8Array")?t.body=n:n&&(t.body=JSON.stringify(n))}handleUnauthenticated(t,n,r){return this.refresh()?this.request(t,n,r):(this.clearActiveLogin(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new Error("Unauthenticated")))}async startPkce(){const t=K1();sessionStorage.setItem("pkceState",t);const n=K1();sessionStorage.setItem("codeVerifier",n);const r=await F$(n),o=CL(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","");return sessionStorage.setItem("codeChallenge",o),{codeChallengeMethod:"S256",codeChallenge:o}}async requestAuthorization(t){const n=await this.ensureCodeChallenge(t??{}),r=new URL(this.authorizeUrl);r.searchParams.set("response_type","code"),r.searchParams.set("state",sessionStorage.getItem("pkceState")),r.searchParams.set("client_id",n.clientId??this.clientId),r.searchParams.set("redirect_uri",n.redirectUri??tw()),r.searchParams.set("code_challenge_method",n.codeChallengeMethod),r.searchParams.set("code_challenge",n.codeChallenge),r.searchParams.set("scope",n.scope??"openid profile"),window.location.assign(r.toString())}processCode(t,n){const r=new URLSearchParams;if(r.set("grant_type","authorization_code"),r.set("code",t),r.set("client_id",(n==null?void 0:n.clientId)??this.clientId),r.set("redirect_uri",(n==null?void 0:n.redirectUri)??tw()),typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&r.set("code_verifier",o)}return this.fetchTokens(r)}refreshIfExpired(){return!this.refreshPromise&&this.accessTokenExpires!==void 0&&this.accessTokenExpires<Date.now()&&this.refresh(),this.refreshPromise??Promise.resolve()}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken){const t=new URLSearchParams;return t.set("grant_type","refresh_token"),t.set("client_id",this.clientId),t.set("refresh_token",this.refreshToken),this.refreshPromise=this.fetchTokens(t),this.refreshPromise}if(this.clientId&&this.clientSecret)return this.refreshPromise=this.startClientLogin(this.clientId,this.clientSecret),this.refreshPromise}async startClientLogin(t,n){this.clientId=t,this.clientSecret=n;const r=new URLSearchParams;return r.set("grant_type","client_credentials"),r.set("client_id",t),r.set("client_secret",n),this.fetchTokens(r)}async startJwtBearerLogin(t,n,r){this.clientId=t;const o=new URLSearchParams;return o.set("grant_type","urn:ietf:params:oauth:grant-type:jwt-bearer"),o.set("client_id",t),o.set("assertion",n),o.set("scope",r),this.fetchTokens(o)}async startJwtAssertionLogin(t){const n=new URLSearchParams;return n.append("grant_type","client_credentials"),n.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),n.append("client_assertion",t),this.fetchTokens(n)}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=$$(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new $e(vt("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new $e(vt("Invalid events provided. Events must be an array of event names containing at least one event."));const r={channelType:"websocket",mode:"subscribe",topic:t,events:n},i=(await this.post("/fhircast/STU3",Y1(r),Gt.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!i)throw new Error("Invalid response!");return r.endpoint=i,r}async fhircastUnsubscribe(t){if(!Fv(t))throw new $e(vt("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new $e(vt("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post("/fhircast/STU3",Y1(t),Gt.FORM_URL_ENCODED)}fhircastConnect(t){return new X$(t)}async fhircastPublish(t,n,r,o){return H$(n)?this.post(`/fhircast/STU3/${t}`,J1(t,n,r,o),Gt.JSON):(q$(n),this.post(`/fhircast/STU3/${t}`,J1(t,n,r),Gt.JSON))}async fhircastGetContext(t){return this.get(`/fhircast/STU3/${t}`)}async invite(t,n){return this.post("admin/projects/"+t+"/invite",n)}async fetchTokens(t){const n={method:"POST",headers:{"Content-Type":Gt.FORM_URL_ENCODED},body:t.toString(),credentials:"include"},r=n.headers;this.basicAuth&&(r.Authorization=`Basic ${this.basicAuth}`);let o;try{o=await this.fetchWithRetry(this.tokenUrl,n)}catch(s){throw this.refreshPromise=void 0,s}if(!o.ok){this.clearActiveLogin();try{const s=await o.json();throw new $e(pi(s.error_description))}catch(s){throw new $e(pi("Failed to fetch tokens"),s)}}const i=await o.json();return await this.verifyTokens(i),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(Z$(n)){const r=zv(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new Error("Token expired");if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}setupStorageListener(){try{window.addEventListener("storage",t=>{(t.key===null||t.key==="activeLogin")&&window.location.reload()})}catch{}}retryCatch(t,n,r){if(r.message==="Failed to fetch"&&t===1&&this.dispatchEvent({type:"offline"}),t>=n-1)throw r}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new a7(this,kL("/ws/subscriptions-r4",this.baseUrl))),this.subscriptionManager}subscribeToCriteria(t){return this.getSubscriptionManager().addCriteria(t)}unsubscribeFromCriteria(t){this.subscriptionManager&&(this.subscriptionManager.removeCriteria(t),this.subscriptionManager.getCriteriaCount()===0&&this.subscriptionManager.closeWebSocket())}getMasterSubscriptionEmitter(){return this.getSubscriptionManager().getMasterEmitter()}}function m7(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function tw(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}function nw(e){return e.endsWith("/")?e:e+"/"}function ku(e,t){return new URL(t,e).toString()}async function rw(e,t){var o,i;const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(Vf(t)&&((i=(o=t.issue)==null?void 0:o[0])!=null&&i.diagnostics))return t.issue[0].diagnostics}function rp(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function g7(e){return mn(e)&&"data"in e&&"contentType"in e}function ow(e,t,n,r){return g7(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function y7(e){return mn(e)&&"docDefinition"in e}function v7(e,t,n,r){return y7(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function Da({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:o}){if(t===(e==null?void 0:e.path))return;const i=x7(t,n,e,!!o),s=Object.create(null);for(const[l,c]of Object.entries(i))s[t+"."+l]=c;return{path:t,elements:i,elementsByPath:s,profileUrl:r??(e==null?void 0:e.profileUrl),debugMode:o??(e==null?void 0:e.debugMode)??!1}}function x7(e,t,n,r){const o=Object.create(null);if(n)for(const[s,l]of Object.entries(n.elementsByPath)){const c=ic(e,s);c!==void 0&&(o[c]=l)}let i=!1;if(t)for(const[s,l]of Object.entries(t))s in o||(o[s]=l,i=!0);return r&&console.assert(i,"Unnecessary ElementsContext; not using any newly provided elements"),o}function UP(e){return e.type!==void 0&&e.type.length>0}function w7(e,t,n,r){var i;const o=eL(e,t.path,{profileUrl:r});if(o){const s=((i=n.typeSchema)==null?void 0:i.elements)??n.elements;return o.some(l=>nL(l,t,n,s))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function VP(e,t,n,r){var o,i;if(e)for(const s of t){const l={value:e,type:((o=s.typeSchema)==null?void 0:o.name)??((i=s.type)==null?void 0:i[0].code)};if(n.every(c=>{var u;return w7(l,c,s,((u=s.typeSchema)==null?void 0:u.url)??r)}))return s.name}}class S7{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const o=Da({parentContext:void 0,path:this.rootSchema.type,elements:r??this.rootSchema.elements,profileUrl:this.rootSchema.name===this.rootSchema.type?void 0:this.rootSchema.url});if(o===void 0)throw new Error("Could not create root elements context");this.elementsContextStack=[o],this.visitor=n}get elementsContext(){return this.elementsContextStack[this.elementsContextStack.length-1]}crawlElement(t,n,r){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema);const o=Object.fromEntries(Object.entries(this.elementsContext.elements).filter(([i])=>i.startsWith(n)));this.crawlElementsImpl(o,r),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlSlice(t,n,r){const o=this.prepareSlices(r.slices,r);if(!Nt(o.slices))throw new Error(`cannot crawl slice ${n.name} since it has no type information`);this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.sliceAllowList=[n],this.crawlSliceImpl(o.slices[0],n.path,o),this.sliceAllowList=void 0,this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlResource(){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.crawlElementsImpl(this.rootSchema.elements,this.rootSchema.type),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlElementsImpl(t,n){const r=b7(t);for(const o of r)this.crawlElementNode(o,n)}crawlElementNode(t,n){var o,i;const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const s of t.children)this.crawlElementNode(s,n);Nt((i=(o=t.element)==null?void 0:o.slicing)==null?void 0:i.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){var i,s;const r=[];for(const l of t){if(!UP(l))continue;const c=(s=(i=l.type.find(u=>Nt(u.profile)))==null?void 0:i.profile)==null?void 0:s[0];if(Nt(c)){const u=Cs(c);u&&(l.typeSchema=u)}r.push(l)}return{...n,slices:r}}crawlSlicingImpl(t,n){const r=this.prepareSlices(t.slices,t);for(const o of r.slices)(this.sliceAllowList===void 0||this.sliceAllowList.includes(o))&&this.crawlSliceImpl(o,n,r)}crawlSliceImpl(t,n,r){const o=t.typeSchema;o&&this.visitor.onEnterSchema&&this.visitor.onEnterSchema(o),this.visitor.onEnterSlice&&this.visitor.onEnterSlice(n,t,r);let i;const s=(o==null?void 0:o.elements)??t.elements;Nt(s)&&(i=Da({path:n,parentContext:this.elementsContext,elements:s})),i&&this.elementsContextStack.push(i),this.crawlElementsImpl(s,n),i&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),o&&this.visitor.onExitSchema&&this.visitor.onExitSchema(o)}}function b7(e){const t=[];function n(i,s){return s.startsWith(i+".")}function r(i,s){for(const l of i.children)if(n(l.key,s.key)){r(l,s);return}i.children.push(s)}const o=Object.entries(e);o.sort((i,s)=>i[0].localeCompare(s[0]));for(const[i,s]of o){const l={key:i,element:s,children:[]};let c=!1;for(const u of t)if(n(u.key,i)){r(u,l),c=!0;break}c||t.push(l)}return t}const op="__sliceName";function C7(e,t){const n=new E7(e,e.resourceType,"resource");return new S7(t,n).crawlResource(),n.getDefaultValue()}function iw(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){Ad(e,r,o,t);continue}const i=ic(n,r);i!==void 0&&Ad(e,i,o,t)}return e}class E7{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=co(t),this.valueStack.splice(0,this.valueStack.length,{type:r,path:n,values:[this.rootValue]})}get schema(){return this.schemaStack[this.schemaStack.length-1]}get value(){return this.valueStack[this.valueStack.length-1]}onEnterSchema(t){this.schemaStack.push(t)}onExitSchema(){this.schemaStack.pop()}onEnterElement(t,n,r){const o=this.value.values,i=this.value.path,s=ic(i,t);if(s===void 0)throw new Error(`Expected ${t} to be prefixed by ${i}`);const l=[];for(const c of o){if(c===void 0)continue;const u=Array.isArray(c)?c:[c];for(const d of u){j7(d,s,n,r.elements),Ad(d,s,n,r.elements);const f=Rm(d,s,n,r.elements);f!==void 0&&l.push(f)}}this.valueStack.push({type:"element",path:t,values:l})}onExitElement(t,n,r){if(!this.valueStack.pop())throw new Error("Expected value context to exist when exiting element");const i=ic(this.value.path,t);if(i===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);for(const s of this.value.values){const l=Rm(s,i,n,r.elements);if(Array.isArray(l))for(let c=l.length-1;c>=0;c--){const u=l[c];Nt(u)||l.splice(c,1)}Ot(l)&&km(s,void 0,i,n)}}onEnterSlice(t,n,r){const o=this.value.values,i=[];for(const s of o){if(s===void 0)continue;if(!Array.isArray(s))throw new Error("Expected array value for sliced element");const l=this.getMatchingSliceValues(s,n,r);i.push(l)}this.valueStack.push({type:"slice",path:t,values:i})}getMatchingSliceValues(t,n,r){const o=[];for(const i of t)(i[op]??VP(i,[n],r.discriminator,this.schema.url))===n.name&&o.push(i);for(let i=o.length;i<n.min;i++)if(kv(n.type[0].code)){const s=Object.create(null);o.push(s),t.push(s)}return o}onExitSlice(){const t=this.valueStack.pop();if(!t)throw new Error("Expected value context to exist in onExitSlice");for(const n of t.values)for(let r=n.length-1;r>=0;r--){const o=n[r];op in o&&delete o[op]}}getDefaultValue(){return this.rootValue}}function j7(e,t,n,r){const o=Rm(e,t,n,r);n.min>0&&o===void 0&&kv(n.type[0].code)&&(n.isArray?km(e,[Object.create(null)],t,n):km(e,Object.create(null),t,n))}function km(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let o=n;if(n.includes("[x]")){const i=r.type[0].code;o=n.replace("[x]",Vt(i))}t===void 0?delete e[o]:e[o]=t}function Rm(e,t,n,r){const o=t.split(".");let i=e,s;for(let l=0;l<o.length;l++){let c=o[l];if(c.includes("[x]")){const d=r[o.slice(0,l+1).join(".")].type[0].code;c=c.replace("[x]",Vt(d))}if(l===o.length-1){Array.isArray(i)?s=i.map(u=>u[c]):s=i[c];continue}if(Array.isArray(i))i=i.map(u=>u[c]);else if(mn(i)){if(i[c]===void 0)return;i=i[c]}else return}return s}function Ad(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(l=>Ad(l,t,n,r));e==null&&(e=Object.create(null));const o=e,i=t.split(".");let s=o;for(let l=0;l<i.length;l++){let c=i[l];if(c.includes("[x]")){const d=r[i.slice(0,l+1).join(".")].type[0].code;c=c.replace("[x]",Vt(d))}if(l===i.length-1){const u=Array.isArray(s)?s:[s];for(const d of u)n.fixed?d[c]??(d[c]=n.fixed.value):n.pattern&&(d[c]=WP(d[c],n.pattern.value))}else{if(!(c in s)){const u=i.slice(0,l+1).join(".");s[c]=r[u].isArray?[Object.create(null)]:Object.create(null)}s=s[c]}}return o}function WP(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:co(t);if(mn(t)&&(mn(e)&&!Array.isArray(e)||e===void 0)){const n=co(e)??Object.create(null);for(const r of Object.keys(t))n[r]=WP(n[r],t[r]);return n}return e}var HP=p.createContext(void 0);function Kf(){return p.useContext(HP)}function ne(){return Kf().medplum}function Yf(){return Kf().navigate}function Xf(){return Kf().profile}function P7(e){let t=e.medplum,n=e.navigate??T7,[r,o]=p.useState({profile:t.getProfile(),loading:!t.isInitialized});p.useEffect(()=>{t&&(t.isInitialized||(o(s=>({...s,loading:!0})),t.getInitPromise().then(()=>o(s=>({...s,loading:!1}))).catch(console.error)))},[t,t.isInitialized]),p.useEffect(()=>{function s(){o({...r,profile:t.getProfile()})}return t.addEventListener("change",s),()=>t.removeEventListener("change",s)},[t,r]);let i=p.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return a.jsx(HP.Provider,{value:i,children:e.children})}function T7(e){window.location.assign(e)}var sw=new Map,qP=e=>p.useMemo(()=>{if(!e)return;let t=e.split("?")[0];if(!t)return e;let n;try{n=new URLSearchParams(new URL(e).search)}catch{return e}if(!n.has("Key-Pair-Id")||!n.has("Signature"))return e;let r=n.get("Expires");if(!r||r.length>13)return e;let o=sw.get(t);if(o){let i=new URLSearchParams(new URL(o).search).get("Expires");if(i&&parseInt(i,10)*1e3-5e3>Date.now())return o}return sw.set(t,e),e},[e]);function ct(e,t){let n=ne(),[r,o]=p.useState(aw(n,e)),i=p.useCallback(s=>{$c(s,r)||o(s)},[r,o]);return p.useEffect(()=>{i(aw(n,e))},[n,e,i]),p.useEffect(()=>{let s=!0;return Ps(e)&&n.readReference(e).then(l=>{s&&i(l)}).catch(l=>{s&&(i(void 0),t&&t(lt(l)))}),()=>s=!1},[n,r,e,i,t]),r}function aw(e,t){if(t){if(Uo(t))return t;if(Ps(t))return e.getCachedReference(t)}}function k7(e,t){return GP("searchOne",e,t)}function Ia(e,t){return GP("searchResources",e,t)}function GP(e,t,n){let r=ne(),[o,i]=p.useState(),[s,l]=p.useState(!1),[c,u]=p.useState(),[d,f]=p.useState();return p.useEffect(()=>{let h=r.fhirSearchUrl(t,n).toString();h!==o&&(i(h),r[e](t,n).then(m=>{l(!1),u(m),f(XO)}).catch(m=>{l(!1),u(void 0),f(lt(m))}))},[r,e,t,n,o]),[c,s,d]}function R7(e){const t=e.value;return t?a.jsx(a.Fragment,{children:RL(t)}):null}function lw(e,t){return e.line&&e.line.length>t?e.line[t]:""}function cw(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function D7(e){const[t,n]=p.useState(e.defaultValue||{}),r=p.useRef();r.current=t;function o(h){n(h),e.onChange&&e.onChange(h)}function i(h){o({...r.current,use:h})}function s(h){o({...r.current,type:h})}function l(h){o(cw(r.current||{},0,h))}function c(h){o(cw(r.current||{},1,h))}function u(h){o({...r.current,city:h})}function d(h){o({...r.current,state:h})}function f(h){o({...r.current,postalCode:h})}return a.jsxs(Y,{gap:"xs",wrap:"nowrap",grow:!0,children:[a.jsx(wt,{"data-testid":"address-use",defaultValue:t.use,onChange:h=>i(h.currentTarget.value),data:["","home","work","temp","old","billing"]}),a.jsx(wt,{"data-testid":"address-type",defaultValue:t.type,onChange:h=>s(h.currentTarget.value),data:["","postal","physical","both"]}),a.jsx(ae,{placeholder:"Line 1",defaultValue:lw(t,0),onChange:h=>l(h.currentTarget.value)}),a.jsx(ae,{placeholder:"Line 2",defaultValue:lw(t,1),onChange:h=>c(h.currentTarget.value)}),a.jsx(ae,{placeholder:"City",defaultValue:t.city,onChange:h=>u(h.currentTarget.value)}),a.jsx(ae,{placeholder:"State",defaultValue:t.state,onChange:h=>d(h.currentTarget.value)}),a.jsx(ae,{placeholder:"Postal Code",defaultValue:t.postalCode,onChange:h=>f(h.currentTarget.value)})]})}function I7(e){const t=Xf(),[n,r]=p.useState(e.defaultValue||{});function o(i){const s=i?{text:i,authorReference:t&&ft(t),time:new Date().toISOString()}:{};r(s),e.onChange&&e.onChange(s)}return a.jsx(ae,{name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:i=>o(i.currentTarget.value)})}/**
125
+ * @license @tabler/icons-react v3.1.0 - MIT
126
+ *
127
+ * This source code is licensed under the MIT license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */var _7={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
130
+ * @license @tabler/icons-react v3.1.0 - MIT
131
+ *
132
+ * This source code is licensed under the MIT license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const pe=(e,t,n,r)=>{const o=p.forwardRef(({color:i="currentColor",size:s=24,stroke:l=2,className:c,children:u,...d},f)=>p.createElement("svg",{ref:f,..._7[e],width:s,height:s,className:["tabler-icon",`tabler-icon-${t}`,c].join(" "),...e==="filled"?{fill:i}:{strokeWidth:l,stroke:i},...d},[...r.map(([h,m])=>p.createElement(h,m)),...Array.isArray(u)?u:[u]]));return o.displayName=`${n}`,o};/**
135
+ * @license @tabler/icons-react v3.1.0 - MIT
136
+ *
137
+ * This source code is licensed under the MIT license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */var A7=pe("outline","adjustments-horizontal","IconAdjustmentsHorizontal",[["path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M4 6l8 0",key:"svg-1"}],["path",{d:"M16 6l4 0",key:"svg-2"}],["path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-3"}],["path",{d:"M4 12l2 0",key:"svg-4"}],["path",{d:"M10 12l10 0",key:"svg-5"}],["path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-6"}],["path",{d:"M4 18l11 0",key:"svg-7"}],["path",{d:"M19 18l1 0",key:"svg-8"}]]);/**
140
+ * @license @tabler/icons-react v3.1.0 - MIT
141
+ *
142
+ * This source code is licensed under the MIT license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */var zc=pe("outline","alert-circle","IconAlertCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]]);/**
145
+ * @license @tabler/icons-react v3.1.0 - MIT
146
+ *
147
+ * This source code is licensed under the MIT license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */var N7=pe("outline","arrow-down","IconArrowDown",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]]);/**
150
+ * @license @tabler/icons-react v3.1.0 - MIT
151
+ *
152
+ * This source code is licensed under the MIT license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */var O7=pe("outline","arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]);/**
155
+ * @license @tabler/icons-react v3.1.0 - MIT
156
+ *
157
+ * This source code is licensed under the MIT license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */var M7=pe("outline","bleach-off","IconBleachOff",[["path",{d:"M5 19h14m1.986 -1.977a2 2 0 0 0 -.146 -.773l-7.1 -12.25a2 2 0 0 0 -3.5 0l-.815 1.405m-1.488 2.568l-4.797 8.277a2 2 0 0 0 1.75 2.75",key:"svg-0"}],["path",{d:"M3 3l18 18",key:"svg-1"}]]);/**
160
+ * @license @tabler/icons-react v3.1.0 - MIT
161
+ *
162
+ * This source code is licensed under the MIT license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */var L7=pe("outline","bleach","IconBleach",[["path",{d:"M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75",key:"svg-0"}]]);/**
165
+ * @license @tabler/icons-react v3.1.0 - MIT
166
+ *
167
+ * This source code is licensed under the MIT license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */var $7=pe("outline","box-multiple","IconBoxMultiple",[["path",{d:"M7 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2",key:"svg-1"}]]);/**
170
+ * @license @tabler/icons-react v3.1.0 - MIT
171
+ *
172
+ * This source code is licensed under the MIT license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */var F7=pe("outline","brackets-contain","IconBracketsContain",[["path",{d:"M7 4h-4v16h4",key:"svg-0"}],["path",{d:"M17 4h4v16h-4",key:"svg-1"}],["path",{d:"M8 16h.01",key:"svg-2"}],["path",{d:"M12 16h.01",key:"svg-3"}],["path",{d:"M16 16h.01",key:"svg-4"}]]);/**
175
+ * @license @tabler/icons-react v3.1.0 - MIT
176
+ *
177
+ * This source code is licensed under the MIT license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */var z7=pe("outline","brand-asana","IconBrandAsana",[["path",{d:"M12 7m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M17 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M7 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}]]);/**
180
+ * @license @tabler/icons-react v3.1.0 - MIT
181
+ *
182
+ * This source code is licensed under the MIT license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */var B7=pe("outline","bucket-off","IconBucketOff",[["path",{d:"M5.029 5.036c-.655 .58 -1.029 1.25 -1.029 1.964c0 2.033 3.033 3.712 6.96 3.967m3.788 -.21c3.064 -.559 5.252 -2.029 5.252 -3.757c0 -2.21 -3.582 -4 -8 -4c-1.605 0 -3.1 .236 -4.352 .643",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.1 -.3 .252 -.812 .457 -1.535m.862 -3.146c.262 -.975 .735 -2.76 1.418 -5.354a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]]);/**
185
+ * @license @tabler/icons-react v3.1.0 - MIT
186
+ *
187
+ * This source code is licensed under the MIT license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */var U7=pe("outline","bucket","IconBucket",[["path",{d:"M12 7m-8 0a8 4 0 1 0 16 0a8 4 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.333 -1 1.246 -4.345 2.737 -10.035a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}]]);/**
190
+ * @license @tabler/icons-react v3.1.0 - MIT
191
+ *
192
+ * This source code is licensed under the MIT license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */var V7=pe("outline","building","IconBuilding",[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M9 8l1 0",key:"svg-1"}],["path",{d:"M9 12l1 0",key:"svg-2"}],["path",{d:"M9 16l1 0",key:"svg-3"}],["path",{d:"M14 8l1 0",key:"svg-4"}],["path",{d:"M14 12l1 0",key:"svg-5"}],["path",{d:"M14 16l1 0",key:"svg-6"}],["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16",key:"svg-7"}]]);/**
195
+ * @license @tabler/icons-react v3.1.0 - MIT
196
+ *
197
+ * This source code is licensed under the MIT license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */var Ai=pe("outline","calendar","IconCalendar",[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]]);/**
200
+ * @license @tabler/icons-react v3.1.0 - MIT
201
+ *
202
+ * This source code is licensed under the MIT license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */var Jf=pe("outline","check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);/**
205
+ * @license @tabler/icons-react v3.1.0 - MIT
206
+ *
207
+ * This source code is licensed under the MIT license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */var W7=pe("outline","checkbox","IconCheckbox",[["path",{d:"M9 11l3 3l8 -8",key:"svg-0"}],["path",{d:"M20 12v6a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h9",key:"svg-1"}]]);/**
210
+ * @license @tabler/icons-react v3.1.0 - MIT
211
+ *
212
+ * This source code is licensed under the MIT license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */var QP=pe("outline","chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);/**
215
+ * @license @tabler/icons-react v3.1.0 - MIT
216
+ *
217
+ * This source code is licensed under the MIT license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */var Nd=pe("outline","circle-minus","IconCircleMinus",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l6 0",key:"svg-1"}]]);/**
220
+ * @license @tabler/icons-react v3.1.0 - MIT
221
+ *
222
+ * This source code is licensed under the MIT license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */var Od=pe("outline","circle-plus","IconCirclePlus",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M9 12h6",key:"svg-1"}],["path",{d:"M12 9v6",key:"svg-2"}]]);/**
225
+ * @license @tabler/icons-react v3.1.0 - MIT
226
+ *
227
+ * This source code is licensed under the MIT license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */var Bv=pe("outline","cloud-upload","IconCloudUpload",[["path",{d:"M7 18a4.6 4.4 0 0 1 0 -9a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-1",key:"svg-0"}],["path",{d:"M9 15l3 -3l3 3",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}]]);/**
230
+ * @license @tabler/icons-react v3.1.0 - MIT
231
+ *
232
+ * This source code is licensed under the MIT license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */var H7=pe("outline","columns","IconColumns",[["path",{d:"M4 6l5.5 0",key:"svg-0"}],["path",{d:"M4 10l5.5 0",key:"svg-1"}],["path",{d:"M4 14l5.5 0",key:"svg-2"}],["path",{d:"M4 18l5.5 0",key:"svg-3"}],["path",{d:"M14.5 6l5.5 0",key:"svg-4"}],["path",{d:"M14.5 10l5.5 0",key:"svg-5"}],["path",{d:"M14.5 14l5.5 0",key:"svg-6"}],["path",{d:"M14.5 18l5.5 0",key:"svg-7"}]]);/**
235
+ * @license @tabler/icons-react v3.1.0 - MIT
236
+ *
237
+ * This source code is licensed under the MIT license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */var KP=pe("outline","copy","IconCopy",[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]]);/**
240
+ * @license @tabler/icons-react v3.1.0 - MIT
241
+ *
242
+ * This source code is licensed under the MIT license.
243
+ * See the LICENSE file in the root directory of this source tree.
244
+ */var q7=pe("outline","currency-dollar","IconCurrencyDollar",[["path",{d:"M16.7 8a3 3 0 0 0 -2.7 -2h-4a3 3 0 0 0 0 6h4a3 3 0 0 1 0 6h-4a3 3 0 0 1 -2.7 -2",key:"svg-0"}],["path",{d:"M12 3v3m0 12v3",key:"svg-1"}]]);/**
245
+ * @license @tabler/icons-react v3.1.0 - MIT
246
+ *
247
+ * This source code is licensed under the MIT license.
248
+ * See the LICENSE file in the root directory of this source tree.
249
+ */var G7=pe("outline","device-floppy","IconDeviceFloppy",[["path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M14 4l0 4l-6 0l0 -4",key:"svg-2"}]]);/**
250
+ * @license @tabler/icons-react v3.1.0 - MIT
251
+ *
252
+ * This source code is licensed under the MIT license.
253
+ * See the LICENSE file in the root directory of this source tree.
254
+ */var Q7=pe("outline","dots","IconDots",[["path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]]);/**
255
+ * @license @tabler/icons-react v3.1.0 - MIT
256
+ *
257
+ * This source code is licensed under the MIT license.
258
+ * See the LICENSE file in the root directory of this source tree.
259
+ */var K7=pe("outline","edit","IconEdit",[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]]);/**
260
+ * @license @tabler/icons-react v3.1.0 - MIT
261
+ *
262
+ * This source code is licensed under the MIT license.
263
+ * See the LICENSE file in the root directory of this source tree.
264
+ */var Bc=pe("outline","equal-not","IconEqualNot",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]]);/**
265
+ * @license @tabler/icons-react v3.1.0 - MIT
266
+ *
267
+ * This source code is licensed under the MIT license.
268
+ * See the LICENSE file in the root directory of this source tree.
269
+ */var Uc=pe("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
270
+ * @license @tabler/icons-react v3.1.0 - MIT
271
+ *
272
+ * This source code is licensed under the MIT license.
273
+ * See the LICENSE file in the root directory of this source tree.
274
+ */var uw=pe("outline","file-alert","IconFileAlert",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 17l.01 0",key:"svg-2"}],["path",{d:"M12 11l0 3",key:"svg-3"}]]);/**
275
+ * @license @tabler/icons-react v3.1.0 - MIT
276
+ *
277
+ * This source code is licensed under the MIT license.
278
+ * See the LICENSE file in the root directory of this source tree.
279
+ */var Y7=pe("outline","file-plus","IconFilePlus",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 11l0 6",key:"svg-2"}],["path",{d:"M9 14l6 0",key:"svg-3"}]]);/**
280
+ * @license @tabler/icons-react v3.1.0 - MIT
281
+ *
282
+ * This source code is licensed under the MIT license.
283
+ * See the LICENSE file in the root directory of this source tree.
284
+ */var X7=pe("outline","filter","IconFilter",[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z",key:"svg-0"}]]);/**
285
+ * @license @tabler/icons-react v3.1.0 - MIT
286
+ *
287
+ * This source code is licensed under the MIT license.
288
+ * See the LICENSE file in the root directory of this source tree.
289
+ */var J7=pe("outline","forms","IconForms",[["path",{d:"M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3",key:"svg-0"}],["path",{d:"M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3",key:"svg-1"}],["path",{d:"M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7",key:"svg-2"}],["path",{d:"M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1",key:"svg-3"}],["path",{d:"M17 12h.01",key:"svg-4"}],["path",{d:"M13 12h.01",key:"svg-5"}]]);/**
290
+ * @license @tabler/icons-react v3.1.0 - MIT
291
+ *
292
+ * This source code is licensed under the MIT license.
293
+ * See the LICENSE file in the root directory of this source tree.
294
+ */var Z7=pe("outline","id","IconId",[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M9 10m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M15 8l2 0",key:"svg-2"}],["path",{d:"M15 12l2 0",key:"svg-3"}],["path",{d:"M7 16l10 0",key:"svg-4"}]]);/**
295
+ * @license @tabler/icons-react v3.1.0 - MIT
296
+ *
297
+ * This source code is licensed under the MIT license.
298
+ * See the LICENSE file in the root directory of this source tree.
299
+ */var e6=pe("outline","list-details","IconListDetails",[["path",{d:"M13 5h8",key:"svg-0"}],["path",{d:"M13 9h5",key:"svg-1"}],["path",{d:"M13 15h8",key:"svg-2"}],["path",{d:"M13 19h5",key:"svg-3"}],["path",{d:"M3 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M3 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-5"}]]);/**
300
+ * @license @tabler/icons-react v3.1.0 - MIT
301
+ *
302
+ * This source code is licensed under the MIT license.
303
+ * See the LICENSE file in the root directory of this source tree.
304
+ */var t6=pe("outline","lock-access","IconLockAccess",[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M8 11m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M10 11v-2a2 2 0 1 1 4 0v2",key:"svg-5"}]]);/**
305
+ * @license @tabler/icons-react v3.1.0 - MIT
306
+ *
307
+ * This source code is licensed under the MIT license.
308
+ * See the LICENSE file in the root directory of this source tree.
309
+ */var n6=pe("outline","lock","IconLock",[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]]);/**
310
+ * @license @tabler/icons-react v3.1.0 - MIT
311
+ *
312
+ * This source code is licensed under the MIT license.
313
+ * See the LICENSE file in the root directory of this source tree.
314
+ */var r6=pe("outline","logout","IconLogout",[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]]);/**
315
+ * @license @tabler/icons-react v3.1.0 - MIT
316
+ *
317
+ * This source code is licensed under the MIT license.
318
+ * See the LICENSE file in the root directory of this source tree.
319
+ */var YP=pe("outline","math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]);/**
320
+ * @license @tabler/icons-react v3.1.0 - MIT
321
+ *
322
+ * This source code is licensed under the MIT license.
323
+ * See the LICENSE file in the root directory of this source tree.
324
+ */var XP=pe("outline","math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]);/**
325
+ * @license @tabler/icons-react v3.1.0 - MIT
326
+ *
327
+ * This source code is licensed under the MIT license.
328
+ * See the LICENSE file in the root directory of this source tree.
329
+ */var o6=pe("outline","message","IconMessage",[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z",key:"svg-2"}]]);/**
330
+ * @license @tabler/icons-react v3.1.0 - MIT
331
+ *
332
+ * This source code is licensed under the MIT license.
333
+ * See the LICENSE file in the root directory of this source tree.
334
+ */var i6=pe("outline","microscope","IconMicroscope",[["path",{d:"M5 21h14",key:"svg-0"}],["path",{d:"M6 18h2",key:"svg-1"}],["path",{d:"M7 18v3",key:"svg-2"}],["path",{d:"M9 11l3 3l6 -6l-3 -3z",key:"svg-3"}],["path",{d:"M10.5 12.5l-1.5 1.5",key:"svg-4"}],["path",{d:"M17 3l3 3",key:"svg-5"}],["path",{d:"M12 21a6 6 0 0 0 3.715 -10.712",key:"svg-6"}]]);/**
335
+ * @license @tabler/icons-react v3.1.0 - MIT
336
+ *
337
+ * This source code is licensed under the MIT license.
338
+ * See the LICENSE file in the root directory of this source tree.
339
+ */var s6=pe("outline","packages","IconPackages",[["path",{d:"M7 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-0"}],["path",{d:"M2 13.5v5.5l5 3",key:"svg-1"}],["path",{d:"M7 16.545l5 -3.03",key:"svg-2"}],["path",{d:"M17 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-3"}],["path",{d:"M12 19l5 3",key:"svg-4"}],["path",{d:"M17 16.5l5 -3",key:"svg-5"}],["path",{d:"M12 13.5v-5.5l-5 -3l5 -3l5 3v5.5",key:"svg-6"}],["path",{d:"M7 5.03v5.455",key:"svg-7"}],["path",{d:"M12 8l5 -3",key:"svg-8"}]]);/**
340
+ * @license @tabler/icons-react v3.1.0 - MIT
341
+ *
342
+ * This source code is licensed under the MIT license.
343
+ * See the LICENSE file in the root directory of this source tree.
344
+ */var a6=pe("outline","pin","IconPin",[["path",{d:"M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4",key:"svg-0"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-1"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-2"}]]);/**
345
+ * @license @tabler/icons-react v3.1.0 - MIT
346
+ *
347
+ * This source code is licensed under the MIT license.
348
+ * See the LICENSE file in the root directory of this source tree.
349
+ */var l6=pe("outline","pinned-off","IconPinnedOff",[["path",{d:"M3 3l18 18",key:"svg-0"}],["path",{d:"M15 4.5l-3.249 3.249m-2.57 1.433l-2.181 .818l-1.5 1.5l7 7l1.5 -1.5l.82 -2.186m1.43 -2.563l3.25 -3.251",key:"svg-1"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-2"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-3"}]]);/**
350
+ * @license @tabler/icons-react v3.1.0 - MIT
351
+ *
352
+ * This source code is licensed under the MIT license.
353
+ * See the LICENSE file in the root directory of this source tree.
354
+ */var c6=pe("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]);/**
355
+ * @license @tabler/icons-react v3.1.0 - MIT
356
+ *
357
+ * This source code is licensed under the MIT license.
358
+ * See the LICENSE file in the root directory of this source tree.
359
+ */var u6=pe("outline","plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);/**
360
+ * @license @tabler/icons-react v3.1.0 - MIT
361
+ *
362
+ * This source code is licensed under the MIT license.
363
+ * See the LICENSE file in the root directory of this source tree.
364
+ */var d6=pe("outline","receipt","IconReceipt",[["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16l-3 -2l-2 2l-2 -2l-2 2l-2 -2l-3 2m4 -14h6m-6 4h6m-2 4h2",key:"svg-0"}]]);/**
365
+ * @license @tabler/icons-react v3.1.0 - MIT
366
+ *
367
+ * This source code is licensed under the MIT license.
368
+ * See the LICENSE file in the root directory of this source tree.
369
+ */var f6=pe("outline","refresh","IconRefresh",[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]]);/**
370
+ * @license @tabler/icons-react v3.1.0 - MIT
371
+ *
372
+ * This source code is licensed under the MIT license.
373
+ * See the LICENSE file in the root directory of this source tree.
374
+ */var h6=pe("outline","report-medical","IconReportMedical",[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-1"}],["path",{d:"M10 14l4 0",key:"svg-2"}],["path",{d:"M12 12l0 4",key:"svg-3"}]]);/**
375
+ * @license @tabler/icons-react v3.1.0 - MIT
376
+ *
377
+ * This source code is licensed under the MIT license.
378
+ * See the LICENSE file in the root directory of this source tree.
379
+ */var p6=pe("outline","router","IconRouter",[["path",{d:"M3 13m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17l0 .01",key:"svg-1"}],["path",{d:"M13 17l0 .01",key:"svg-2"}],["path",{d:"M15 13l0 -2",key:"svg-3"}],["path",{d:"M11.75 8.75a4 4 0 0 1 6.5 0",key:"svg-4"}],["path",{d:"M8.5 6.5a8 8 0 0 1 13 0",key:"svg-5"}]]);/**
380
+ * @license @tabler/icons-react v3.1.0 - MIT
381
+ *
382
+ * This source code is licensed under the MIT license.
383
+ * See the LICENSE file in the root directory of this source tree.
384
+ */var m6=pe("outline","search","IconSearch",[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]]);/**
385
+ * @license @tabler/icons-react v3.1.0 - MIT
386
+ *
387
+ * This source code is licensed under the MIT license.
388
+ * See the LICENSE file in the root directory of this source tree.
389
+ */var Dm=pe("outline","settings","IconSettings",[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]]);/**
390
+ * @license @tabler/icons-react v3.1.0 - MIT
391
+ *
392
+ * This source code is licensed under the MIT license.
393
+ * See the LICENSE file in the root directory of this source tree.
394
+ */var Uv=pe("outline","sort-ascending","IconSortAscending",[["path",{d:"M4 6l7 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l9 0",key:"svg-2"}],["path",{d:"M15 9l3 -3l3 3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]]);/**
395
+ * @license @tabler/icons-react v3.1.0 - MIT
396
+ *
397
+ * This source code is licensed under the MIT license.
398
+ * See the LICENSE file in the root directory of this source tree.
399
+ */var Vv=pe("outline","sort-descending","IconSortDescending",[["path",{d:"M4 6l9 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l7 0",key:"svg-2"}],["path",{d:"M15 15l3 3l3 -3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]]);/**
400
+ * @license @tabler/icons-react v3.1.0 - MIT
401
+ *
402
+ * This source code is licensed under the MIT license.
403
+ * See the LICENSE file in the root directory of this source tree.
404
+ */var g6=pe("outline","square","IconSquare",[["path",{d:"M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}]]);/**
405
+ * @license @tabler/icons-react v3.1.0 - MIT
406
+ *
407
+ * This source code is licensed under the MIT license.
408
+ * See the LICENSE file in the root directory of this source tree.
409
+ */var y6=pe("outline","star","IconStar",[["path",{d:"M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z",key:"svg-0"}]]);/**
410
+ * @license @tabler/icons-react v3.1.0 - MIT
411
+ *
412
+ * This source code is licensed under the MIT license.
413
+ * See the LICENSE file in the root directory of this source tree.
414
+ */var v6=pe("outline","switch-horizontal","IconSwitchHorizontal",[["path",{d:"M16 3l4 4l-4 4",key:"svg-0"}],["path",{d:"M10 7l10 0",key:"svg-1"}],["path",{d:"M8 13l-4 4l4 4",key:"svg-2"}],["path",{d:"M4 17l9 0",key:"svg-3"}]]);/**
415
+ * @license @tabler/icons-react v3.1.0 - MIT
416
+ *
417
+ * This source code is licensed under the MIT license.
418
+ * See the LICENSE file in the root directory of this source tree.
419
+ */var x6=pe("outline","table-export","IconTableExport",[["path",{d:"M12.5 21h-7.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7.5",key:"svg-0"}],["path",{d:"M3 10h18",key:"svg-1"}],["path",{d:"M10 3v18",key:"svg-2"}],["path",{d:"M16 19h6",key:"svg-3"}],["path",{d:"M19 16l3 3l-3 3",key:"svg-4"}]]);/**
420
+ * @license @tabler/icons-react v3.1.0 - MIT
421
+ *
422
+ * This source code is licensed under the MIT license.
423
+ * See the LICENSE file in the root directory of this source tree.
424
+ */var JP=pe("outline","trash","IconTrash",[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]]);/**
425
+ * @license @tabler/icons-react v3.1.0 - MIT
426
+ *
427
+ * This source code is licensed under the MIT license.
428
+ * See the LICENSE file in the root directory of this source tree.
429
+ */var dw=pe("outline","upload","IconUpload",[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 9l5 -5l5 5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]]);/**
430
+ * @license @tabler/icons-react v3.1.0 - MIT
431
+ *
432
+ * This source code is licensed under the MIT license.
433
+ * See the LICENSE file in the root directory of this source tree.
434
+ */var w6=pe("outline","webhook","IconWebhook",[["path",{d:"M4.876 13.61a4 4 0 1 0 6.124 3.39h6",key:"svg-0"}],["path",{d:"M15.066 20.502a4 4 0 1 0 1.934 -7.502c-.706 0 -1.424 .179 -2 .5l-3 -5.5",key:"svg-1"}],["path",{d:"M16 8a4 4 0 1 0 -8 0c0 1.506 .77 2.818 2 3.5l-3 5.5",key:"svg-2"}]]);/**
435
+ * @license @tabler/icons-react v3.1.0 - MIT
436
+ *
437
+ * This source code is licensed under the MIT license.
438
+ * See the LICENSE file in the root directory of this source tree.
439
+ */var Md=pe("outline","x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);/**
440
+ * @license @tabler/icons-react v3.1.0 - MIT
441
+ *
442
+ * This source code is licensed under the MIT license.
443
+ * See the LICENSE file in the root directory of this source tree.
444
+ */var S6=pe("filled","circle-filled","IconCircleFilled",[["path",{d:"M7 3.34a10 10 0 1 1 -4.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 4.995 -8.336z",key:"svg-0"}]]);class ZP extends p.Component{constructor(t){super(t),this.state={lastLocation:window.location.toString()}}static getDerivedStateFromError(t){return{error:t,lastLocation:window.location.toString()}}componentDidUpdate(t,n){window.location.toString()!==this.state.lastLocation&&this.setState({lastLocation:window.location.toString(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==window.location.toString())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?a.jsx(xs,{icon:a.jsx(zc,{size:16}),title:"Something went wrong",color:"red",children:Te(this.state.error)}):this.props.children}}function $r(){return a.jsx(on,{style:{width:"100%",height:"100vh"},children:a.jsx(Vn,{})})}const b6="_main_1szoq_1",C6={main:b6};function it(e){e.preventDefault(),e.stopPropagation()}function eT(e){if(fw(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&fw(t[0]))return!0}return!1}function fw(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}function Fe(e){const t=Yf(),{to:n,suffix:r,label:o,onClick:i,children:s,...l}=e;let c=E6(n);return r&&(c+="/"+r),a.jsx(He,{href:c,"aria-label":o,onClick:u=>{it(u),i?i(u):n&&t(c)},...l,children:s})}function E6(e){if(e){if(typeof e=="string")return j6(e);if(Uo(e))return P6(e);if(Ps(e))return T6(e)}return"#"}function j6(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function P6(e){return`/${e.resourceType}/${e.id}`}function T6(e){return`/${e.reference}`}function k6(e){const t=e.split(" ").filter(Boolean);return t.length>1?t[0][0]+t[t.length-1][0]:t.length===1?t[0][0]:""}function Pi(e){const t=ct(e.value),n=t?Do(t):e.alt??"",r=k6(n),o=(t&&dL(t))??e.src,i=qP(o??void 0),s=e.radius??"xl",l={...e};return delete l.value,delete l.link,e.link?a.jsx(Fe,{to:t,children:a.jsx(os,{src:i,alt:n,radius:s,...l,children:r})}):a.jsx(os,{src:i,alt:n,radius:s,...l,children:r})}const R6="_logoButton_189g3_1",D6="_user_189g3_11",I6="_userName_189g3_21",_6="_userActive_189g3_31",Ru={logoButton:R6,user:D6,userName:I6,userActive:_6};function Wv(e){const t=e.value;return t?a.jsx(a.Fragment,{children:Fc(t,e.options)}):null}function A6(e){var c,u,d;const t=Kf(),{medplum:n,profile:r,navigate:o}=t,i=n.getLogins(),{colorScheme:s,setColorScheme:l}=wD();return a.jsxs(a.Fragment,{children:[a.jsxs(be,{align:"center",p:"xl",children:[a.jsx(Pi,{size:"xl",radius:100,value:t.profile}),a.jsx(Wv,{value:(u=(c=t.profile)==null?void 0:c.name)==null?void 0:u[0]}),a.jsx(se,{c:"dimmed",size:"xs",children:(d=n.getActiveLogin())==null?void 0:d.project.display})]}),i.length>1&&a.jsx(Z.Divider,{}),i.map(f=>f.profile.reference!==ht(t.profile)&&a.jsx(Z.Item,{onClick:()=>{n.setActiveLogin(f).then(()=>window.location.reload()).catch(console.log)},children:a.jsxs(Y,{children:[a.jsx(os,{radius:"xl"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(se,{size:"sm",fw:500,children:f.profile.display}),a.jsx(se,{c:"dimmed",size:"xs",children:f.project.display})]})]})},f.profile.reference)),a.jsx(Z.Divider,{}),a.jsx(Y,{justify:"center",children:a.jsx(uv,{size:"xs",value:s,onChange:f=>l(f),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),a.jsx(Z.Divider,{}),a.jsx(Z.Item,{leftSection:a.jsx(v6,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),a.jsx(Z.Item,{leftSection:a.jsx(Dm,{size:14,stroke:1.5}),onClick:()=>o(`/${ht(r)}`),children:"Account settings"}),a.jsx(Z.Item,{leftSection:a.jsx(r6,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),a.jsx(se,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}function Hv(e){const t=Tc({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:o,error:i,defaultValue:s,toOption:l,loadOptions:c,itemComponent:u,onChange:d,onCreate:f,creatable:h,clearable:m,required:g,placeholder:y,leftSection:S,maxValues:v,...x}=e,w=N6(s),[b,j]=p.useState(""),[E,P]=p.useState(),[T,D]=p.useState(),[_,O]=p.useState(),[I,$]=p.useState(w.map(l)),[N,L]=p.useState([]),M=u??O6,R=p.useRef();R.current=b;const k=p.useRef(),F=p.useRef(),q=p.useRef();q.current=E;const G=p.useRef();G.current=T;const oe=p.useRef();oe.current=_;const xe=p.useRef();xe.current=N;const me=p.useCallback(()=>{if(P(void 0),R.current===F.current&&c===k.current)return;F.current=R.current,k.current=c;const X=new AbortController;D(X),c(R.current??"",X.signal).then(ke=>{X.signal.aborted||(L(ke.map(l)),D(void 0),oe.current?(ke.length>0&&d(ke.slice(0,1)),O(!1)):ke.length>0&&t.openDropdown())}).catch(ke=>{X.signal.aborted||ke.message.includes("aborted")||fe({color:"red",message:Te(ke)})})},[t,c,d,l]),Ce=p.useCallback(X=>{(N&&N.length>0||h)&&t.openDropdown(),t.updateSelectedOptionIndex(),j(X.currentTarget.value),G.current&&(G.current.abort(),D(void 0)),q.current!==void 0&&window.clearTimeout(q.current);const ke=window.setTimeout(()=>me(),100);P(ke)},[t,N,h,me]),je=p.useCallback(X=>{const ke=[],tt=[...I];let Ne=N==null?void 0:N.find(Rt=>Rt.value===X),Ve=Ne==null?void 0:Ne.resource;if(!Ve&&h!==!1&&f&&(Ve=f(X),Ne=l(Ve)),Ve&&ke.push(Ve),Ne&&tt.push(Ne),v!==void 0)for(;tt.length>v;)tt.shift();d(ke),$(tt)},[h,N,I,v,d,f,l]),Be=X=>{j(""),L([]),t.closeDropdown(),F.current=void 0,je(X==="$create"?b:X)},Me=p.useCallback(X=>{const ke=I.filter(tt=>tt.value!==X.value);d(ke.map(tt=>tt.resource)),$(ke)},[I,d]),Ke=p.useCallback(X=>{X.key==="Enter"?!E&&!T?(it(X),N&&N.length>0&&(L(N.slice(0,1)),je(N[0].value))):O(!0):X.key==="Backspace"&&b.length===0&&(it(X),Me(I[I.length-1]))},[b,I,N,E,T,je,Me]);p.useEffect(()=>()=>{G.current&&G.current.abort()},[]);const St=m&&I.length>0&&a.jsx(Ee.ClearButton,{title:"Clear all",size:16,onClear:()=>{j(""),$([]),d([]),t.closeDropdown()}});return a.jsxs(Ee,{store:t,onOptionSubmit:Be,withinPortal:!0,shadow:"xl",...x,children:[a.jsx(Ee.DropdownTarget,{children:a.jsx(ka,{label:r,description:o,error:i,className:e.className,leftSection:S,rightSection:T?a.jsx(Vn,{size:16}):St,required:g,children:a.jsxs(is.Group,{children:[I.map(X=>a.jsx(is,{withRemoveButton:!0,onRemove:()=>Me(X),children:X.label},X.value)),(v===void 0||v===0||I.length<v)&&a.jsx(Ee.EventsTarget,{children:a.jsx(ka.Field,{role:"searchbox",name:n,value:b,placeholder:y,onFocus:Ce,onBlur:()=>t.closeDropdown(),onKeyDown:Ke,onChange:Ce})})]})})}),a.jsx(Ee.Dropdown,{children:a.jsxs(Ee.Options,{children:[N.map(X=>a.jsx(Ee.Option,{value:X.value,active:I.includes(X),children:a.jsx(M,{...X})},X.value)),h&&b.trim().length>0&&a.jsxs(Ee.Option,{value:"$create",children:["+ Create ",b]}),!h&&b.trim().length>0&&N.length===0&&a.jsx(Ee.Empty,{children:"Nothing found"})]})})]})}function N6(e){return e?Array.isArray(e)?e:[e]:[]}function O6(e){return a.jsx(Y,{gap:"sm",children:a.jsx("span",{children:e.label})})}const M6="_searchInput_dick8_1",L6={searchInput:M6};function $6(e){return{value:e.id,label:Do(e),resource:e}}function F6(e){const t=Yf(),n=ne(),r=p.useCallback(async(i,s)=>{const l=B6(i),c={signal:s},u=await n.graphql(l,void 0,void 0,c);return U6(u,i)},[n]),o=p.useCallback(i=>{i.length>0&&t(`/${ht(i[0])}`)},[t]);return a.jsx(Hv,{size:"sm",radius:"md",className:L6.searchInput,leftSection:a.jsx(m6,{size:16}),placeholder:"Search",itemComponent:z6,toOption:$6,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const z6=p.forwardRef(({resource:e,...t},n)=>{var o;let r;return e.resourceType==="Patient"?r=e.birthDate:e.resourceType==="ServiceRequest"&&(r=(o=e.subject)==null?void 0:o.display),a.jsx("div",{ref:n,...t,children:a.jsxs(Y,{wrap:"nowrap",children:[a.jsx(Pi,{value:e}),a.jsxs("div",{children:[a.jsx(se,{children:Do(e)}),a.jsx(se,{size:"xs",c:"dimmed",children:r})]})]})})});function B6(e){const t=JSON.stringify(e);return jP(e)?`{
445
+ Patients1: PatientList(_id: ${t}, _count: 1) {
446
+ resourceType
447
+ id
448
+ identifier {
449
+ system
450
+ value
451
+ }
452
+ name {
453
+ given
454
+ family
455
+ }
456
+ birthDate
457
+ }
458
+ ServiceRequestList(_id: ${t}, _count: 1) {
459
+ resourceType
460
+ id
461
+ identifier {
462
+ system
463
+ value
464
+ }
465
+ subject {
466
+ display
467
+ }
468
+ }
469
+ }`.replace(/\s+/g," "):`{
470
+ Patients1: PatientList(name: ${t}, _count: 5) {
471
+ resourceType
472
+ id
473
+ identifier {
474
+ system
475
+ value
476
+ }
477
+ name {
478
+ given
479
+ family
480
+ }
481
+ birthDate
482
+ }
483
+ Patients2: PatientList(identifier: ${t}, _count: 5) {
484
+ resourceType
485
+ id
486
+ identifier {
487
+ system
488
+ value
489
+ }
490
+ name {
491
+ given
492
+ family
493
+ }
494
+ birthDate
495
+ }
496
+ ServiceRequestList(identifier: ${t}, _count: 5) {
497
+ resourceType
498
+ id
499
+ identifier {
500
+ system
501
+ value
502
+ }
503
+ subject {
504
+ display
505
+ }
506
+ }
507
+ }`.replace(/\s+/g," ")}function U6(e,t){const n=[];return e.data.Patients1&&n.push(...e.data.Patients1),e.data.Patients2&&n.push(...e.data.Patients2),e.data.ServiceRequestList&&n.push(...e.data.ServiceRequestList),W6(V6(n),t).slice(0,5)}function V6(e){const t=new Set,n=[];for(const r of e)t.has(r.id)||(t.add(r.id),n.push(r));return n}function W6(e,t){return e.sort((n,r)=>hw(r,t)-hw(n,t))}function hw(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,pw(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,pw(Fc(r),t));return n}function pw(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function H6(e){var o;const t=Xf(),[n,r]=p.useState(!1);return a.jsx(Un.Header,{p:8,style:{zIndex:101},children:a.jsxs(Y,{justify:"space-between",children:[a.jsxs(Y,{gap:"xs",children:[a.jsx(Jn,{className:Ru.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&a.jsx(F6,{pathname:e.pathname,searchParams:e.searchParams})]}),a.jsxs(Y,{gap:"lg",pr:"sm",children:[e.notifications,a.jsxs(Z,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[a.jsx(Z.Target,{children:a.jsx(Jn,{className:et(Ru.user,{[Ru.userActive]:n}),onClick:()=>r(i=>!i),children:a.jsxs(Y,{gap:7,children:[a.jsx(Pi,{value:t,radius:"xl",size:24}),a.jsx(se,{size:"sm",className:Ru.userName,children:Fc((o=t==null?void 0:t.name)==null?void 0:o[0])}),a.jsx(QP,{size:12,stroke:1.5})]})})}),a.jsx(Z.Dropdown,{children:a.jsx(A6,{version:e.version})})]})]})]})})}function q6(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?G6(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&Q6(t,n);return t}function G6(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function Q6(e,t){e[t.name]=t.value}function We(e){return a.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:t=>{t.preventDefault();const n=q6(t.target);e.onSubmit&&e.onSubmit(n)},children:e.children})}function K6(e){const t=ne(),n=t.getUserConfiguration();function r(o){var d,f;const{menuname:i,bookmarkname:s}=o,l=`${e.pathname}?${e.searchParams.toString()}`,c=co(n),u=(d=c.menu)==null?void 0:d.find(({title:h})=>h===i);(f=u==null?void 0:u.link)==null||f.push({name:s,target:l}),t.updateResource(c).then(h=>{n.menu=h.menu,t.dispatchEvent({type:"change"}),fe({color:"green",message:"Success"}),e.onOk()}).catch(h=>{fe({color:"red",message:Te(h)})})}return a.jsx(Dn,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:a.jsx(We,{onSubmit:r,children:a.jsxs(be,{children:[a.jsx(Y6,{config:n}),a.jsx(ae,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),a.jsx(Y,{justify:"flex-end",children:a.jsx(te,{mt:"sm",type:"submit",children:"OK"})})]})})})}function Y6(e){function t(r){var o;return(o=r==null?void 0:r.menu)==null?void 0:o.map(i=>i.title)}const n=t(e.config);return a.jsx(wt,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function tT(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function X6(e){return typeof e.display=="string"?e.display:tT(e)}function J6(e){return{value:tT(e),label:X6(e),resource:e}}function Z6(e){return{code:e,display:e}}function qv(e){const t=ne(),{binding:n,creatable:r,clearable:o,expandParams:i,withHelpText:s,...l}=e,c=p.useCallback(async(u,d)=>{var g;if(!n)return[];const h=(g=(await t.valueSetExpand({...i,url:n,filter:u},{signal:d})).expansion)==null?void 0:g.contains,m=[];for(const y of h)y.code&&!m.some(S=>S.code===y.code)&&m.push(y);return m},[t,i,n]);return a.jsx(Hv,{...l,creatable:r??!0,clearable:o??!0,toOption:J6,loadOptions:c,onCreate:Z6,itemComponent:s?eF:void 0})}const eF=p.forwardRef(({label:e,resource:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsx(Y,{wrap:"nowrap",children:a.jsxs("div",{children:[a.jsx(se,{children:e}),a.jsx(se,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})})}));function nT(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,s]=p.useState(t);function l(c){const u=c[0],d=nF(u);s(d),n&&n(d)}return a.jsx(qv,{defaultValue:tF(i),onChange:l,withHelpText:r??!0,...o})}function tF(e){return e?{code:e}:void 0}function nF(e){return e==null?void 0:e.code}function Gv(e){const[t,n]=p.useState(e.defaultValue),r=e.onChange,o=p.useCallback(i=>{n(i),r&&r(i)},[r]);return a.jsx(nT,{"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:o,name:e.name,placeholder:e.placeholder,binding:"https://medplum.com/fhir/ValueSet/resource-types",creatable:!1,maxValues:e.maxValues??1,clearable:!1,withHelpText:!1})}const rF="_menuTitle_9g6l5_1",oF="_link_9g6l5_9",iF="_linkActive_9g6l5_38",Im={menuTitle:rF,link:oF,linkActive:iF};function sF(e){var l;const t=Yf(),n=cF(e.pathname,e.searchParams,e.menus),[r,o]=p.useState(!1);function i(c,u){c.stopPropagation(),c.preventDefault(),t(u),window.innerWidth<768&&e.closeNavbar()}function s(c){c&&t(`/${c}`)}return a.jsxs(a.Fragment,{children:[a.jsx(Un.Navbar,{children:a.jsxs(vr,{p:"xs",children:[!e.resourceTypeSearchDisabled&&a.jsx(Un.Section,{mb:"sm",children:a.jsx(Gv,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:c=>s(c)},window.location.pathname)}),a.jsxs(Un.Section,{grow:!0,children:[(l=e.menus)==null?void 0:l.map(c=>{var u;return a.jsxs(p.Fragment,{children:[a.jsx(se,{className:Im.menuTitle,children:c.title}),(u=c.links)==null?void 0:u.map(d=>a.jsxs(aF,{to:d.href,active:d.href===(n==null?void 0:n.href),onClick:f=>i(f,d.href),children:[a.jsx(lF,{to:d.href,icon:d.icon}),a.jsx("span",{children:d.label})]},d.href))]},`menu-${c.title}`)}),e.displayAddBookmark&&a.jsx(te,{variant:"subtle",size:"xs",mt:"xl",leftSection:a.jsx(u6,{size:"0.75rem"}),onClick:()=>o(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&a.jsx(K6,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>o(!1),onCancel:()=>o(!1)})]})}function aF(e){return a.jsx(Fe,{onClick:e.onClick,to:e.to,className:et(Im.link,{[Im.linkActive]:e.active}),children:e.children})}function lF(e){return e.icon?e.icon:a.jsx(Uf,{w:30})}function cF(e,t,n){if(!e||!t||!n)return;let r,o=0;for(const i of n)if(i.links)for(const s of i.links){const l=uF(e,t,s.href);l>o&&(o=l,r=s)}return r}function uF(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const o=["_count","_offset"];for(const[s,l]of r.searchParams.entries())if(!o.includes(s)&&t.get(s)!==l)return 0;let i=1;for(const[s,l]of t.entries())o.includes(s)||r.searchParams.get(s)===l&&i++;return i}function dF(e){const[t,n]=p.useState(localStorage.navbarOpen==="true"),r=ne(),o=Xf();p.useEffect(()=>{function c(){fe({color:"red",message:"No connection to server",autoClose:!1})}return r.addEventListener("offline",c),()=>r.removeEventListener("offline",c)},[r]);function i(c){localStorage.navbarOpen=c.toString(),n(c)}function s(){i(!1)}function l(){i(!t)}return r.isLoading()?a.jsx($r,{}):a.jsxs(Un,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!o||!t,mobile:!o||!t}},padding:0,children:[o&&a.jsx(H6,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:l,notifications:e.notifications}),o&&t?a.jsx(sF,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:s,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,a.jsx(Un.Main,{className:C6.main,children:a.jsx(ZP,{children:a.jsx(p.Suspense,{fallback:a.jsx($r,{}),children:e.children})})})]})}function Vc(e){const{contentType:t,url:n,title:r}=e.value??{},o=qP(n);return o?a.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&a.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:o,alt:r}),(t==null?void 0:t.startsWith("video/"))&&a.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:a.jsx("source",{type:t,src:o})}),t==="application/pdf"&&a.jsx("div",{"data-testid":"attachment-pdf",style:{maxWidth:e.maxWidth,minHeight:400},children:a.jsx("iframe",{width:"100%",height:"400",src:o+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),a.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:a.jsx(He,{href:o,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:fF(r),children:r||"Download"})})]}):null}function fF(e){return e!=null&&e.includes(".")?e:void 0}const hF="_root_17n8t_1",pF="_compact_17n8t_25",mw={root:hF,compact:pF};function Qv(e){const{children:t,compact:n}=e;return a.jsx("dl",{className:et(mw.root,{[mw.compact]:n}),children:t})}function bo(e){return a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:e.term}),a.jsx("dd",{children:e.children})]})}function mF(e){var r;const t=(r=e.values)==null?void 0:r.map((o,i)=>a.jsx("div",{children:a.jsx(Vc,{value:o,maxWidth:e.maxWidth})},"attatchment-"+i));let n;if(e.includeDescriptionListEntry){if(e.property===void 0)throw new Error("props.property is required when includeDescriptionListEntry is true");if(!Nt(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const o=e.path.split(".").pop();n=a.jsx(bo,{term:ss(o),children:t})}else n=a.jsx(a.Fragment,{children:t});return n}function Kv(e){const t=ne(),n=p.useRef(null);function r(s){var l;it(s),(l=n.current)==null||l.click()}function o(s){it(s);const l=s.target.files;l&&Array.from(l).forEach(i)}function i(s){!s||!s.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:s,contentType:s.type||"application/octet-stream",filename:s.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(c=>e.onUpload(c)).catch(c=>{e.onUploadError&&e.onUploadError(lt(c))}))}return a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:s=>o(s)}),e.children({onClick:r})]})}function gF(e){const[t,n]=p.useState(e.defaultValue??[]),r=p.useRef();r.current=t;function o(i){n(i),e.onChange&&e.onChange(i)}return a.jsxs("table",{style:{width:"100%"},children:[a.jsxs("colgroup",{children:[a.jsx("col",{width:"97%"}),a.jsx("col",{width:"3%"})]}),a.jsxs("tbody",{children:[t.map((i,s)=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(Vc,{value:i,maxWidth:200})}),a.jsx("td",{children:a.jsx(qt,{title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:l=>{it(l);const c=t.slice();c.splice(s,1),o(c)},children:a.jsx(Nd,{})})})]},`${s}-${t.length}`)),a.jsxs("tr",{children:[a.jsx("td",{}),a.jsx("td",{children:a.jsx(Kv,{onUpload:i=>{o([...r.current,i])},children:i=>a.jsx(qt,{...i,title:"Add",variant:"subtle",size:"sm",color:"green",children:a.jsx(Bv,{})})})})]})]})]})}function rT(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return t?a.jsxs(a.Fragment,{children:[a.jsx(Vc,{value:t,maxWidth:200}),a.jsx(te,{onClick:o=>{it(o),r(void 0)},children:"Remove"})]}):a.jsx(Kv,{securityContext:e.securityContext,onUpload:r,children:o=>a.jsx(te,{...o,children:"Upload..."})})}const oT=["meta","implicitRules","contained","extension","modifierExtension"],iT=["language","text"];function io(e){return a.jsx(a.Fragment,{children:wi(e.value)})}function yF(e){return a.jsx(a.Fragment,{children:Es(e.value)})}function sT(e){const t=e.value;if(!t)return null;const n=[];return t.value&&n.push(t.value),(t.use||t.system)&&(n.push(" ["),t.use&&n.push(t.use),t.use&&t.system&&n.push(" "),t.system&&n.push(t.system),n.push("]")),a.jsx(a.Fragment,{children:n.join("").trim()})}function vF(e){var n;const t=e.value;return t?a.jsxs(a.Fragment,{children:[t.name,t.name&&": ",(n=t.telecom)==null?void 0:n.map(r=>a.jsx(sT,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function xF(e){var t,n;return a.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(n=e.value)==null?void 0:n.value]})}function wF(e){return a.jsx(a.Fragment,{children:ML(e.value)})}function cc(e){return a.jsx(a.Fragment,{children:Xo(e.value)})}function Yv(e){return a.jsx(a.Fragment,{children:sc(e.value)})}function SF(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[a.jsx(cc,{value:t.numerator})," / ",a.jsx(cc,{value:t.denominator})]}):null}function Ld(e){if(!e.value)return null;const t=e.value.display||e.value.reference||tr(e.value);return e.link!==!1&&e.value.reference?a.jsx(Fe,{to:e.value,children:t}):a.jsx(a.Fragment,{children:t})}const Jt=C.createContext({path:"",profileUrl:void 0,elements:Object.create(null),elementsByPath:Object.create(null),debugMode:!1});Jt.displayName="ElementsContext";function aT(e,t,n,r){if(!Nt(n==null?void 0:n.slices))return[e];const o=new Array(t.length+1);for(let i=0;i<o.length;i++)o[i]=[];for(const i of e){const s=VP(i,t,n.discriminator,r);let l=s?t.findIndex(c=>c.name===s):-1;l===-1&&(l=t.length),o[l].push(i)}return o}async function lT({medplum:e,property:t}){return new Promise((n,r)=>{var l,c;if(!t.slicing){n([]);return}const o=[],i=[],s=[];for(const u of t.slicing.slices){if(!UP(u)){console.debug("Unsupported slice definition",u);continue}let d;Nt(u.elements)||(d=(c=(l=u.type[0])==null?void 0:l.profile)==null?void 0:c[0]),o.push(u),i.push(d),d?s.push(e.requestProfileSchema(d)):s.push(Promise.resolve([]))}Promise.all(s).then(()=>{for(let u=0;u<o.length;u++){const d=o[u],f=i[u];if(f){const h=Cs(f);d.typeSchema=h}}n(o)}).catch(r)})}function Zf(e,t,n){return t!==void 0?a.jsx(e,{value:t,children:n}):n}function bF(e){var s,l;const{slice:t,property:n}=e,r=((s=t.typeSchema)==null?void 0:s.elements)??t.elements,o=p.useContext(Jt),i=p.useMemo(()=>{var c;if(Nt(r))return Da({parentContext:o,elements:r,path:e.path,profileUrl:(c=t.typeSchema)==null?void 0:c.url})},[o,e.path,(l=t.typeSchema)==null?void 0:l.url,r]);return Zf(Jt.Provider,i,a.jsx(a.Fragment,{children:e.value.map((c,u)=>a.jsx("div",{children:a.jsx(Fr,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:c,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${u}-${e.value.length}`))}))}function CF(e){var g;const{property:t,propertyType:n}=e,r=ne(),o=p.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[i,s]=p.useState(!0),[l,c]=p.useState([]),[u,d]=p.useState(()=>[o]),f=p.useContext(Jt);if(p.useEffect(()=>{lT({medplum:r,property:t}).then(y=>{c(y);const S=aT(o,y,t.slicing,f.profileUrl);d(S),s(!1)}).catch(y=>{console.error(y),s(!1)})},[r,t,f.profileUrl,d,o]),i)return a.jsx("div",{children:"Loading..."});let h;if(((g=t.type[0])==null?void 0:g.code)!=="Extension"){const y=u[l.length],S=y.map((v,x)=>a.jsx("div",{children:a.jsx(Fr,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:v,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${x}-${y.length}`));if(e.includeDescriptionListEntry){if(!Nt(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const v=e.path.split(".").pop();h=a.jsx(bo,{term:ss(v),children:S})}else h=a.jsx(a.Fragment,{children:S})}return a.jsxs(a.Fragment,{children:[l.map((y,S)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let v=a.jsx(bF,{path:e.path,slice:y,property:t,value:u[S],ignoreMissingValues:e.ignoreMissingValues,link:e.link},y.name);return e.includeDescriptionListEntry&&(v=a.jsx(bo,{term:ss(y.name),children:v},y.name)),v}),h]})}function Wc(e,t,n){const r=Xt(e,t,{profileUrl:n});return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function EF(e,t,n){const r=gP(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function jF(e){const{elementDefinitionType:t}=e,n=ne(),r=p.useContext(Jt),[o,i]=p.useState(pP("Extension")),s=p.useMemo(()=>{if(Nt(t==null?void 0:t.profile))return t.profile[0]},[t]),[l,c]=p.useState(s!==void 0);if(p.useEffect(()=>{s&&(c(!0),n.requestProfileSchema(s).then(()=>{const f=Cs(s);c(!1),f&&i(f)}).catch(f=>{c(!1),console.warn(f)}))},[n,s]),s&&(l||!jv(s)))return a.jsx("div",{children:"Loading..."});const u=o.elements["value[x]"];if((u==null?void 0:u.max)!==0){const[f,h]=Wc({type:"Extension",value:e.value},"value[x]",s??r.profileUrl);return a.jsx(Fr,{propertyType:h,value:f})}return a.jsx($d,{path:e.path,value:{type:o.name,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:s})}function Fr(e){var s;const{property:t,propertyType:n,value:r}=e;if((s=t==null?void 0:t.path)==null?void 0:s.endsWith(".id"))return a.jsxs(W,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!Ot(r)&&a.jsx(Ej,{value:r,timeout:2e3,children:({copied:l,copy:c})=>a.jsx(qa,{label:l?"Copied":"Copy",withArrow:!0,position:"right",children:a.jsx(qt,{variant:"subtle",color:l?"teal":"gray",onClick:c,children:l?a.jsx(Jf,{size:"1rem"}):a.jsx(KP,{size:"1rem"})})})})]});const i=!!e.arrayElement;if(t!=null&&t.max&&t.max>1&&!i)return n===V.Attachment?a.jsx(mF,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):a.jsx(CF,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case V.boolean:return a.jsx(a.Fragment,{children:r===void 0?"":(!!r).toString()});case V.SystemString:case V.string:return a.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case V.code:case V.date:case V.decimal:case V.id:case V.integer:case V.positiveInt:case V.unsignedInt:case V.uri:case V.url:return a.jsx(a.Fragment,{children:r});case V.canonical:return a.jsx(Ld,{value:{reference:r},link:e.link});case V.dateTime:case V.instant:return a.jsx(a.Fragment,{children:jn(r)});case V.markdown:return a.jsx("pre",{children:r});case V.Address:return a.jsx(R7,{value:r});case V.Annotation:return a.jsx(a.Fragment,{children:r==null?void 0:r.text});case V.Attachment:return a.jsx(Vc,{value:r,maxWidth:e.maxWidth});case V.CodeableConcept:return a.jsx(io,{value:r});case V.Coding:return a.jsx(yF,{value:r});case V.ContactDetail:return a.jsx(vF,{value:r});case V.ContactPoint:return a.jsx(sT,{value:r});case V.HumanName:return a.jsx(Wv,{value:r});case V.Identifier:return a.jsx(xF,{value:r});case V.Money:return a.jsx(wF,{value:r});case V.Period:return a.jsx(a.Fragment,{children:IL(r)});case V.Quantity:case V.Duration:return a.jsx(cc,{value:r});case V.Range:return a.jsx(Yv,{value:r});case V.Ratio:return a.jsx(SF,{value:r});case V.Reference:return a.jsx(Ld,{value:r,link:e.link});case V.Timing:return a.jsx(a.Fragment,{children:TP(r)});case V.Dosage:case V.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx($d,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case V.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(jF,{path:e.path,value:r,compact:!0,ignoreMissingValues:e.ignoreMissingValues,elementDefinitionType:e.elementDefinitionType});default:if(!t)throw Error(`Displaying property of type ${e.propertyType} requires element schema`);if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx($d,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const cT=["extension","modifierExtension"],PF=oT.filter(e=>!cT.includes(e));function $d(e){const t=e.value,{value:n,type:r}=t,o=p.useContext(Jt),i=e.profileUrl??(o==null?void 0:o.profileUrl),s=p.useMemo(()=>Wf(r,i),[i,r]),l=p.useMemo(()=>{if(s)return Da({parentContext:o,elements:s.elements,path:e.path,profileUrl:s.url})},[s,e.path,o]);if(Ot(n))return null;if(!s)return a.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return a.jsx("div",{children:n.name});const c=l??o;return Zf(Jt.Provider,l,a.jsx(Qv,{compact:e.compact,children:Object.entries(c.elements).map(([u,d])=>{var y;if(cT.includes(u)&&Ot((y=d.slicing)==null?void 0:y.slices))return null;if(PF.includes(u))return null;if(iT.includes(u)&&d.path.split(".").length===2||u.includes("."))return null;const[f,h]=Wc(t,u,c.profileUrl);if((e.ignoreMissingValues||d.max===0)&&Ot(f)||e.path.endsWith(".extension")&&(u==="url"||u==="id"))return null;const m=d.max>1||d.isArray,g=a.jsx(Fr,{property:d,propertyType:h,path:e.path+"."+u,value:f,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:m,link:e.link},u);return m?g:a.jsx(bo,{term:ss(u),children:g},u)})}))}function uT(e){const{debugMode:t}=p.useContext(Jt);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,a.jsxs(Y,{wrap:"nowrap","data-testid":e.testId,children:[a.jsx("div",{children:e.children}),a.jsx("div",{children:a.jsx(Ct.Wrapper,{id:e.htmlFor,label:n,description:e.description,withAsterisk:e.withAsterisk,children:null})})]})}function ze(e,t){var n,r,o;return(o=(r=(n=e==null?void 0:e.issue)==null?void 0:n.filter(i=>{var s;return dT((s=i.expression)==null?void 0:s[0],t)}))==null?void 0:r.map(i=>{var s;return(s=i.details)==null?void 0:s.text}))==null?void 0:o.join(`
508
+ `)}function Hc(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var o;return dT((o=r.expression)==null?void 0:o[0],t)})}function dT(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=e.indexOf(".");if(n>=0&&e.substring(n+1)===t)return!0;const r=t.indexOf(".");return r>=0&&t.substring(r+1)===e}function at(e){const{debugMode:t}=p.useContext(Jt);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,a.jsx(Ct.Wrapper,{id:e.htmlFor,label:n,description:e.description,withAsterisk:e.withAsterisk,error:ze(e.outcome,e.htmlFor),"data-testid":e.testId,children:e.children})}function fT(e,t,n,r,o){const i=r.type;if(i.length>1)for(const s of i){const l=t.replace("[x]",Vt(s.code));l in e&&delete e[l]}return e[n]=o,e}function TF(e){return!!e&&!Ot(e.url)&&!Ot(e.name)}function kF(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,s]=p.useState(t);function l(c){const u=DF(c);s(u),n&&n(u)}return a.jsx(qv,{defaultValue:i&&RF(i),onChange:l,withHelpText:r??!0,...o})}function RF(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function DF(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function hT(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,s]=p.useState(t);function l(c){const u=c[0],d=u&&_F(u);s(d),n&&n(d)}return a.jsx(qv,{defaultValue:i&&IF(i),maxValues:1,onChange:l,withHelpText:r??!0,...o})}function IF(e){return{system:e.system,code:e.code,display:e.display}}function _F(e){return{system:e.system,code:e.code,display:e.display}}function pT(e){const{path:t,outcome:n}=e,{elementsByPath:r}=p.useContext(Jt),[o,i]=p.useState(e.defaultValue),s=p.useRef();s.current=o;const[l,c,u]=p.useMemo(()=>["system","use","value"].map(g=>r[t+"."+g]),[r,t]);function d(g){g&&Object.keys(g).length===0&&(g=void 0),i(g),e.onChange&&e.onChange(g)}function f(g){const y={...s.current,system:g};g||delete y.system,d(y)}function h(g){const y={...s.current,use:g};g||delete y.use,d(y)}function m(g){const y={...s.current,value:g};g||delete y.value,d(y)}return a.jsxs(Y,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(wt,{"data-testid":"system",defaultValue:o==null?void 0:o.system,required:((l==null?void 0:l.min)??0)>0,onChange:g=>f(g.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:ze(n,t+".system")}),a.jsx(wt,{"data-testid":"use",defaultValue:o==null?void 0:o.use,required:((c==null?void 0:c.min)??0)>0,onChange:g=>h(g.currentTarget.value),data:["","home","work","temp","old","mobile"],error:ze(n,t+".use")}),a.jsx(ae,{placeholder:"Value",defaultValue:o==null?void 0:o.value,required:((u==null?void 0:u.min)??0)>0,onChange:g=>m(g.currentTarget.value),error:ze(n,t+".value")})]})}function AF(e){var l;const[t,n]=p.useState(e.defaultValue),r=p.useRef();r.current=t;function o(c){n(c),e.onChange&&e.onChange(c)}function i(c){const u={...r.current,name:c};c||delete u.name,o(u)}function s(c){const u={...r.current,telecom:c&&[c]};c||delete u.telecom,o(u)}return a.jsxs(Y,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(ae,{"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:c=>i(c.currentTarget.value)}),a.jsx(pT,{name:e.name+"-telecom",path:e.path+".telecom",defaultValue:(l=t==null?void 0:t.telecom)==null?void 0:l[0],onChange:s,outcome:e.outcome})]})}function NF(e){if(!e)return"";const t=new Date(e);return qf(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function mT(e){if(!e)return"";const t=new Date(e);return qf(t)?t.toISOString():""}var OF={MEDPLUM_BASE_URL:"__MEDPLUM_BASE_URL__",MEDPLUM_CLIENT_ID:"__MEDPLUM_CLIENT_ID__",GOOGLE_CLIENT_ID:"__GOOGLE_CLIENT_ID__",RECAPTCHA_SITE_KEY:"__RECAPTCHA_SITE_KEY__",MEDPLUM_REGISTER_ENABLED:"__MEDPLUM_REGISTER_ENABLED__",MEDPLUM_VERSION:"3.0.12-787031d28",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function as(e){return a.jsx(ae,{id:e.name,name:e.name,label:e.label,"data-autofocus":e.autoFocus,"data-testid":e.name,placeholder:e.placeholder,required:e.required,type:MF(),defaultValue:NF(e.defaultValue),autoFocus:e.autoFocus,error:ze(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(mT(n))}}})}function MF(){return OF.NODE_ENV==="test"?"text":"datetime-local"}function LF(e){const{propertyType:t}=e,n=ne(),[r,o]=p.useState(),i=p.useMemo(()=>{if(Nt(t.profile))return t.profile[0]},[t]),[s,l]=p.useState(i!==void 0);return p.useEffect(()=>{i&&(l(!0),n.requestProfileSchema(i).then(()=>{const c=Cs(i);l(!1),o(c)}).catch(c=>{l(!1),console.warn(c)}))},[n,i]),i&&(s||!jv(i))?a.jsx("div",{children:"Loading..."}):a.jsx(e0,{profileUrl:i,path:e.path,typeName:(r==null?void 0:r.name)??"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function $F(e){var f,h,m;const{outcome:t,path:n}=e,[r,o]=p.useState(e.defaultValue);function i(g){o(g),e.onChange&&e.onChange(g)}function s(g){i({...r,use:g||void 0})}function l(g){i({...r,prefix:g?g.split(" "):void 0})}function c(g){i({...r,given:g?g.split(" "):void 0})}function u(g){i({...r,family:g||void 0})}function d(g){i({...r,suffix:g?g.split(" "):void 0})}return a.jsxs(Y,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(wt,{defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:g=>s(g.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:ze(t,n+".use")}),a.jsx(ae,{placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(f=r==null?void 0:r.prefix)==null?void 0:f.join(" "),onChange:g=>l(g.currentTarget.value),error:ze(t,n+".prefix")}),a.jsx(ae,{placeholder:"Given",name:e.name+"-given",defaultValue:(h=r==null?void 0:r.given)==null?void 0:h.join(" "),onChange:g=>c(g.currentTarget.value),error:ze(t,n+".given")}),a.jsx(ae,{name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:g=>u(g.currentTarget.value),error:ze(t,n+".family")}),a.jsx(ae,{placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(m=r==null?void 0:r.suffix)==null?void 0:m.join(" "),onChange:g=>d(g.currentTarget.value),error:ze(t,n+".suffix")})]})}function FF(e){const{path:t,outcome:n}=e,[r,o]=p.useState(e.defaultValue),{elementsByPath:i}=p.useContext(Jt),[s,l]=p.useMemo(()=>["system","value"].map(u=>i[t+"."+u]),[i,t]);function c(u){o(u),e.onChange&&e.onChange(u)}return a.jsxs(Y,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(ae,{placeholder:"System",required:((s==null?void 0:s.min)??0)>0,defaultValue:r==null?void 0:r.system,onChange:u=>c({...r,system:u.currentTarget.value}),error:ze(n,t+".system")}),a.jsx(ae,{placeholder:"Value",required:((l==null?void 0:l.min)??0)>0,defaultValue:r==null?void 0:r.value,onChange:u=>c({...r,value:u.currentTarget.value}),error:ze(n,t+".value")})]})}const zF=["USD","EUR","CAD","GBP","AUD"];function BF(e){var c;const{onChange:t}=e,[n,r]=p.useState(e.defaultValue),o=p.useCallback(u=>{r(u),t&&t(u)},[t]),i=p.useCallback(u=>{o({...n,currency:u.currentTarget.value})},[n,o]),s=p.useCallback(u=>{o({...n,value:u.currentTarget.valueAsNumber})},[n,o]),l=a.jsx(wt,{defaultValue:n==null?void 0:n.currency,data:zF,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:i});return a.jsx(ae,{type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:((c=n==null?void 0:n.value)==null?void 0:c.toString())??"USD",leftSection:a.jsx(q7,{size:14}),rightSection:l,rightSectionWidth:92,onChange:s})}function UF(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return a.jsxs(Y,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(as,{name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:o=>r({...t,start:o})}),a.jsx(as,{name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:o=>r({...t,end:o})})]})}function ls(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return a.jsxs(Y,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(wt,{style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:o=>r({...t,comparator:o.currentTarget.value})}),a.jsx(ae,{id:e.name,name:e.name,required:e.required,"data-autofocus":e.autoFocus,"data-testid":e.name+"-value",type:"number",placeholder:"Value",defaultValue:t==null?void 0:t.value,autoFocus:e.autoFocus,step:"any",onWheel:o=>{e.disableWheel&&o.currentTarget.blur()},onChange:o=>{r({...t,value:VF(o.currentTarget.value)})}}),a.jsx(ae,{placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:o=>r({...t,unit:o.currentTarget.value})})]})}function VF(e){if(e)return parseFloat(e)}function Xv(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return a.jsxs(Y,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(ls,{name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:o=>r({...t,low:o})}),a.jsx(ls,{name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:o=>r({...t,high:o})})]})}function WF(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return a.jsxs(Y,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(ls,{name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:o=>r({...t,numerator:o})}),a.jsx(ls,{name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:o=>r({...t,denominator:o})})]})}const HF={Observation:"code",User:"email:contains"},qF=["AccessPolicy","Account","ActivityDefinition","Bot","CapabilityStatement","CareTeam","ClientApplication","CodeSystem","CompartmentDefinition","ConceptMap","EffectEvidenceSynthesis","Endpoint","EventDefinition","Evidence","EvidenceVariable","ExampleScenario","GraphDefinition","Group","HealthcareService","ImplementationGuide","InsurancePlan","Library","Location","Measure","MedicinalProduct","MessageDefinition","NamingSystem","OperationDefinition","Organization","Patient","Person","PlanDefinition","Practitioner","Project","Questionnaire","RelatedPerson","ResearchDefinition","ResearchElementDefinition","RiskEvidenceSynthesis","SearchParameter","StructureDefinition","StructureMap","TerminologyCapabilities","TestScript","UserConfiguration","ValueSet"];function GF(e){return{value:ht(e),label:Do(e),resource:e}}function Qa(e){const t=ne(),{resourceType:n,searchCriteria:r}=e,[o,i]=p.useState(),s=ct(e.defaultValue,i),l=e.onChange,c=p.useCallback(async(d,f)=>{const h=KF(n),m=new URLSearchParams({[h]:d??"",_count:"10",...r});return await t.searchResources(n,m,{signal:f})},[t,n,r]),u=p.useCallback(d=>{l&&l(d[0])},[l]);return Nt(e.defaultValue)&&!o&&!s?null:a.jsx(Hv,{name:e.name,required:e.required,itemComponent:QF,defaultValue:s,placeholder:e.placeholder,maxValues:1,toOption:GF,loadOptions:c,onChange:u,clearable:!0})}const QF=p.forwardRef(({label:e,resource:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsxs(Y,{wrap:"nowrap",children:[a.jsx(Pi,{value:t}),a.jsxs("div",{children:[a.jsx(se,{children:e}),a.jsx(se,{size:"xs",c:"dimmed",children:t.birthDate})]})]})}));function KF(e){return HF[e]??(qF.includes(e)?"name":"_id")}function eh(e){const{onChange:t}=e,n=ne(),[r,o]=p.useState(e.defaultValue),[i,s]=p.useState(()=>YF(e.targetTypes)),[l,c]=p.useState(()=>XF(e.defaultValue,i)),u=p.useRef(new $P),d=p.useMemo(()=>(l==null?void 0:l.type)==="profile"?{...e.searchCriteria,_profile:l.value}:e.searchCriteria,[e.searchCriteria,l]);p.useEffect(()=>{let m=!1;const g=i==null?void 0:i.map(y=>{if(!ZF(y))return Promise.resolve(y);m=!0;const S=y.value,v=u.current.get(S);if(v)return v;const x=JF(n,y.value).then(b=>{const j={...y};return b?Nt(b.type)?(j.resourceType=b.type,j.name=b.name,j.title=b.title):(console.error(`StructureDefinition.type missing for ${y.value}`),j.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${y.value}`),j.error="StructureDefinition not found"),j}).catch(b=>(console.error(b),{...y,error:b})),w=new Pr(x);return u.current.set(S,w),w});!g||!m||Promise.all(g).then(y=>{if(s(y),!l)return;const S=y.findIndex(v=>v.value===l.value||v.resourceType===l.resourceType);if(S===-1){console.debug(`defaultValue had unexpected resourceType: ${l.resourceType}`);return}c(y[S])}).catch(console.error)},[n,l,i]);const f=p.useCallback(m=>{const g=m?ft(m):void 0;o(g),t&&t(g)},[t]),h=p.useMemo(()=>i?i.map(m=>({value:m.value,label:m.type==="profile"?m.title??m.name??m.resourceType??m.value:m.value})):[],[i]);return a.jsxs(Y,{gap:"xs",grow:!0,wrap:"nowrap",children:[i&&i.length>1&&a.jsx(wt,{"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:l==null?void 0:l.resourceType,autoFocus:e.autoFocus,onChange:m=>{const g=m.currentTarget.value,y=i.find(S=>S.value===g);c(y)},data:h}),!i&&a.jsx(Gv,{autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:l==null?void 0:l.resourceType,onChange:m=>{c(m?{type:"resourceType",value:m,resourceType:m}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),a.jsx(Qa,{resourceType:l==null?void 0:l.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:d,onChange:f})]})}function YF(e){if(!e||e.length===0||e.length===1&&e[0]==="Resource")return;const t=[];for(const n of e)n.includes("/")?t.push({type:"profile",value:n}):t.push({type:"resourceType",value:n,resourceType:n});return t}function XF(e,t){var r;const n=(r=e==null?void 0:e.reference)==null?void 0:r.split("/")[0];if(n){const o=t==null?void 0:t.find(i=>i.resourceType===n);return o||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function JF(e,t){const n=Cs(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
509
+ StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
510
+ type,
511
+ name,
512
+ title,
513
+ }
514
+ }`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function ZF(e){return e.type==="profile"&&!(e!=null&&e.error)&&Ot(e.resourceType)}function gT({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?a.jsx(te,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:a.jsx(Od,{size:"1.25rem"}),onClick:t,children:r}):a.jsx(qt,{title:r,color:"green.6","data-testid":n,onClick:t,children:a.jsx(Od,{size:"1.25rem"})})}function yT({propertyDisplayName:e,onClick:t,testId:n}){return a.jsx(qt,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:a.jsx(Nd,{size:"1.25rem"})})}const e8="_indented_ldk1d_1",vT={indented:e8};function t8(e){var h,m;const{slice:t,property:n}=e,[r,o]=p.useState(e.defaultValue),i=((h=t.typeSchema)==null?void 0:h.elements)??t.elements,s=p.useContext(Jt),l=p.useMemo(()=>{var g;if(Nt(i))return Da({parentContext:s,elements:i,path:e.path,profileUrl:(g=t.typeSchema)==null?void 0:g.url})},[s,e.path,(m=t.typeSchema)==null?void 0:m.url,i]);function c(g){o(g),e.onChange&&e.onChange(g)}const u=t.min>0,d=Ot(t.elements),f=DP(t.name);return Zf(Jt.Provider,l,a.jsx(at,{title:f,description:t.definition,withAsterisk:u,fhirPath:`${n.path}:${t.name}`,testId:e.testId,children:a.jsxs(be,{className:d?vT.indented:void 0,children:[r.map((g,y)=>a.jsxs(Y,{wrap:"nowrap",children:[a.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${y}`,children:a.jsx(Jv,{elementDefinitionType:t.type[0],name:t.name,defaultValue:g,onChange:S=>{const v=[...r];v[y]=S,c(v)},outcome:e.outcome,min:t.min,max:t.max,binding:t.binding,path:e.path})}),r.length>t.min&&a.jsx(yT,{propertyDisplayName:f,testId:e.testId&&`${e.testId}-remove-${y}`,onClick:S=>{it(S);const v=[...r];v.splice(y,1),c(v)}})]},`${y}-${r.length}`)),r.length<t.max&&a.jsx(Y,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(gT,{propertyDisplayName:f,onClick:g=>{it(g);const y=[...r,void 0];c(y)},testId:e.testId&&`${e.testId}-add`})})]})}))}function n8(e){var v;const{property:t}=e,n=ne(),[r,o]=p.useState(!0),[i,s]=p.useState([]),[l]=p.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[c,u]=p.useState(()=>[l]),d=p.useContext(Jt),f=(v=t.type[0])==null?void 0:v.code;p.useEffect(()=>{lT({medplum:n,property:t}).then(x=>{s(x);const w=aT(l,x,t.slicing,d.profileUrl);r8(w,x),u(w),o(!1)}).catch(x=>{console.error(x),o(!1)})},[n,t,l,d.profileUrl,u]);function h(x,w){const b=[...c];if(b[w]=x,u(b),e.onChange){const j=b.flat().filter(E=>E!==void 0);e.onChange(j)}}if(r)return a.jsx("div",{children:"Loading..."});const m=i.length,g=c[m],y=!(e.hideNonSliceValues??(f==="Extension"&&i.length>0)),S=ss(t.path);return a.jsxs(be,{className:e.indent?vT.indented:void 0,children:[i.map((x,w)=>a.jsx(t8,{slice:x,path:e.path,property:t,defaultValue:c[w],onChange:b=>{h(b,w)},testId:`slice-${x.name}`},x.name)),y&&g.map((x,w)=>a.jsxs(Y,{wrap:"nowrap",style:{flexGrow:1},children:[a.jsx("div",{style:{flexGrow:1},children:a.jsx(Ka,{arrayElement:!0,property:e.property,name:e.name+"."+w,path:e.path,defaultValue:x,onChange:b=>{const j=[...g];j[w]=b,h(j,m)},defaultPropertyType:void 0,outcome:e.outcome})}),a.jsx(yT,{propertyDisplayName:S,testId:`nonsliced-remove-${w}`,onClick:b=>{it(b);const j=[...g];j.splice(w,1),h(j,m)}})]},`${w}-${g.length}`)),y&&c.flat().length<t.max&&a.jsx(Y,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(gT,{propertyDisplayName:S,onClick:x=>{it(x);const w=[...g];w.push(void 0),h(w,m)},testId:"nonsliced-add"})})]})}function r8(e,t){for(let n=0;n<t.length;n++){const r=t[n],o=e[n];for(;o.length<r.min;)o.push(void 0)}}function o8(e){const[t,n]=p.useState(!1),r=NS(),o=p.useRef(null),i={...e.styles};return t||(i.input||(i.input={}),i.input.WebkitTextSecurity="disc"),a.jsxs(rs,{gap:"xs",children:[a.jsx(ws,{...e,styles:{...i,root:{...i.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),a.jsx(qt,{title:"Copy secret",onClick:()=>{var s;r.copy((s=o.current)==null?void 0:s.value),fe({color:"green",message:"Copied"})},children:a.jsx(KP,{})})]})}const i8=["sun","mon","tue","wed","thu","fri","sat"];function s8(e){const[t,n]=p.useState(e.defaultValue),[r,o]=p.useState(!1),i=p.useRef();return i.current=t,a.jsxs(a.Fragment,{children:[a.jsxs(Y,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx("span",{children:TP(i.current)||"No repeat"}),a.jsx(te,{onClick:()=>o(!0),children:"Edit"})]}),a.jsx(a8,{visible:r,defaultValue:i.current,onOk:s=>{e.onChange&&e.onChange(s),n(s),o(!1)},onCancel:()=>o(!1)})]})}const gw={repeat:{period:1,periodUnit:"d"}};function a8(e){const[t,n]=p.useState(e.defaultValue||gw),r=p.useRef();r.current=t;function o(u){n({...r.current,event:[u]})}function i(u){n({...r.current,repeat:u})}function s(u){var d;i({...(d=r.current)==null?void 0:d.repeat,period:u})}function l(u){var d;i({...(d=r.current)==null?void 0:d.repeat,periodUnit:u})}function c(u){var d;i({...(d=r.current)==null?void 0:d.repeat,dayOfWeek:u})}return a.jsx(Dn,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:a.jsxs(be,{children:[a.jsx(at,{title:"Starts on",htmlFor:"timing-dialog-start",children:a.jsx(as,{name:"timing-dialog-start",onChange:u=>o(u)})}),a.jsx(Ac,{label:"Repeat",checked:!!t.repeat,onChange:u=>i(u.currentTarget.checked?gw.repeat:void 0)}),t.repeat&&a.jsxs(a.Fragment,{children:[a.jsx(at,{title:"Repeat every",htmlFor:"timing-dialog-period",children:a.jsxs(Y,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(ae,{type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:u=>s(parseInt(u.currentTarget.value,10)||1)}),a.jsx(wt,{id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:u=>l(u.currentTarget.value),data:[{label:"second",value:"s"},{label:"minute",value:"min"},{label:"hour",value:"h"},{label:"day",value:"d"},{label:"week",value:"wk"},{label:"month",value:"mo"},{label:"year",value:"a"}]})]})}),t.repeat.periodUnit==="wk"&&a.jsx(at,{title:"Repeat on",children:a.jsx(rc.Group,{multiple:!0,onChange:c,children:a.jsx(Y,{justify:"space-between",mt:"md",gap:"xs",children:i8.map(u=>a.jsx(rc,{value:u,size:"xs",radius:"xl",children:u.charAt(0).toUpperCase()},u))})})})]}),a.jsx(Y,{justify:"flex-end",children:a.jsx(te,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Ka(e){var l;const{property:t,name:n,onChange:r,defaultValue:o}=e,i=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,s=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(i===V.Attachment)return a.jsx(gF,{name:n,defaultValue:o,onChange:r});const c=((l=s[0])==null?void 0:l.code)!==V.Extension;return a.jsx(n8,{property:t,name:n,path:e.path,defaultValue:o,indent:c,onChange:r,outcome:e.outcome})}else return s.length>1?a.jsx(l8,{elementDefinitionTypes:s,...e}):a.jsx(Jv,{name:n,defaultValue:o,onChange:c=>{if(e.onChange){const u=e.name.replace("[x]",Vt(s[0].code));e.onChange(c,u)}},outcome:e.outcome,elementDefinitionType:s[0],min:t.min,max:t.min,binding:t.binding,path:e.path})}function l8(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(i=>i.code===e.defaultPropertyType)),n||(n=t[0]);const[r,o]=p.useState(n);return a.jsxs(Y,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(wt,{style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:i=>{o(t.find(s=>s.code===i.currentTarget.value))},data:t.map(i=>({value:i.code,label:i.code}))}),a.jsx(Jv,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:i=>{e.onChange&&e.onChange(i,e.name.replace("[x]",Vt(r.code)))},min:e.property.min,max:e.property.max,binding:e.property.binding,path:e.property.path})]})}function Jv(e){const{name:t,onChange:n,outcome:r,binding:o,path:i}=e,s=e.min!==void 0&&e.min>0,l=e.elementDefinitionType.code,c=p.useContext(Jt),u=p.useMemo(()=>{if(!kv(l)||!Ot(e.defaultValue))return e.defaultValue;const f=Object.create(null);if(c.path===e.path)iw(f,c.elements);else{const h=ic(c.path,e.path);if(h===void 0)return e.defaultValue;iw(f,c.elements,h)}return Nt(f)?f:e.defaultValue},[l,c.path,c.elements,e.path,e.defaultValue]);if(!l)return a.jsx("div",{children:"Property type not specified "});const d={name:t,defaultValue:u,onChange:n,outcome:r,path:i};switch(l){case V.SystemString:case V.canonical:case V.string:case V.time:case V.uri:case V.url:return e.path==="Project.secret.value[x]"?a.jsx(o8,{id:t,name:t,"data-testid":t,defaultValue:u,required:s,onChange:f=>{e.onChange&&e.onChange(f.currentTarget.value)},error:ze(e.outcome,t)}):a.jsx(ae,{id:t,name:t,"data-testid":t,defaultValue:u,required:s,onChange:f=>{n&&n(f.currentTarget.value)},error:ze(r,t)});case V.date:return a.jsx(ae,{type:"date",id:t,name:t,"data-testid":t,defaultValue:u,required:s,onChange:f=>{n&&n(f.currentTarget.value)},error:ze(r,t)});case V.dateTime:case V.instant:return a.jsx(as,{name:t,defaultValue:u,onChange:n,outcome:r});case V.decimal:case V.integer:case V.positiveInt:case V.unsignedInt:return a.jsx(ae,{type:"number",step:l===V.decimal?"any":"1",id:t,name:t,"data-testid":t,defaultValue:u,required:s,onChange:f=>{n&&n(f.currentTarget.valueAsNumber)}});case V.code:return a.jsx(nT,{...d,binding:o==null?void 0:o.valueSet});case V.boolean:return a.jsx(gr,{id:t,name:t,"data-testid":t,defaultChecked:!!u,onChange:f=>{n&&n(f.currentTarget.checked)}});case V.base64Binary:case V.markdown:return a.jsx(ws,{id:t,spellCheck:l!==V.base64Binary,name:t,"data-testid":t,defaultValue:u,required:s,onChange:f=>{n&&n(f.currentTarget.value)}});case V.Address:return a.jsx(D7,{...d});case V.Annotation:return a.jsx(I7,{...d});case V.Attachment:return a.jsx(rT,{...d});case V.CodeableConcept:return a.jsx(kF,{binding:o==null?void 0:o.valueSet,...d});case V.Coding:return a.jsx(hT,{binding:o==null?void 0:o.valueSet,...d});case V.ContactDetail:return a.jsx(AF,{...d});case V.ContactPoint:return a.jsx(pT,{...d});case V.Extension:return a.jsx(LF,{...d,propertyType:e.elementDefinitionType});case V.HumanName:return a.jsx($F,{...d});case V.Identifier:return a.jsx(FF,{...d});case V.Money:return a.jsx(BF,{...d});case V.Period:return a.jsx(UF,{...d});case V.Duration:case V.Quantity:return a.jsx(ls,{...d});case V.Range:return a.jsx(Xv,{...d});case V.Ratio:return a.jsx(WF,{...d});case V.Reference:return a.jsx(eh,{...d,targetTypes:u8(e.elementDefinitionType)});case V.Timing:return a.jsx(s8,{...d});case V.Dosage:case V.UsageContext:default:return a.jsx(e0,{typeName:l,path:d.path,defaultValue:u,onChange:n,outcome:r})}}const c8=[`${WO}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function u8(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=c8.find(o=>n.startsWith(o));return r?n.slice(r.length):n})}const Zv=["extension","modifierExtension"],d8=["id",...oT].filter(e=>!Zv.includes(e));function f8(e){const[t,n]=p.useState(e.defaultValue??{}),r=p.useContext(Jt),o=p.useMemo(()=>h8(r.elements),[r.elements]);function i(l){n(l),e.onChange&&e.onChange(l)}const s={type:e.type,value:t};return a.jsx(be,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([l,c])=>{const[u,d]=EF(s,l,c),f=c.min!==void 0&&c.min>0,h=a.jsx(Ka,{property:c,name:l,path:e.path+"."+l,defaultValue:u,defaultPropertyType:d,onChange:(m,g)=>{i(fT({...t},l,g??l,c,m))},arrayElement:void 0,outcome:e.outcome},l);return e.type==="Extension"||Zv.includes(l)?h:c.type.length===1&&c.type[0].code==="boolean"?a.jsx(uT,{title:ss(l),description:c.description,htmlFor:l,fhirPath:c.path,withAsterisk:f,children:h},l):a.jsx(at,{title:ss(l),description:c.description,withAsterisk:f,htmlFor:l,outcome:e.outcome,fhirPath:c.path,children:h},l)})})}function h8(e){return Object.entries(e).filter(([n,r])=>{var o;return!Nt(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||Zv.includes(n)&&!Nt((o=r.slicing)==null?void 0:o.slices)||d8.includes(n)?!1:!(iT.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function e0(e){const[t]=p.useState(()=>e.defaultValue??{}),n=p.useContext(Jt),r=e.profileUrl??(n==null?void 0:n.profileUrl),o=p.useMemo(()=>Wf(e.typeName,r),[e.typeName,r]),i=(o==null?void 0:o.type)??e.typeName,s=p.useMemo(()=>{if(o)return Da({parentContext:n,elements:o.elements,path:e.path,profileUrl:o.url})},[o,e.path,n]);return o?Zf(Jt.Provider,s,a.jsx(f8,{path:e.path,type:i,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):a.jsxs("div",{children:[i," not implemented"]})}const p8="_root_1vii2_1",m8={root:p8};function qc(e){const{children:t,...n}=e;return a.jsx(Hy,{className:m8.root,...n,children:t})}const g8="_noteBody_10swh_1",y8="_noteCite_10swh_5",v8="_noteRoot_10swh_10",yw={noteBody:g8,noteCite:y8,noteRoot:v8};function xT({value:e}){return e?a.jsx(be,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&a.jsx(Uy,{classNames:{cite:yw.noteCite,root:yw.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function Ya(e){const{value:t,link:n,...r}=e,[o,i]=p.useState(),s=ct(t,i);let l;if(o&&!lP(o))l=`[${Te(o)}]`;else if(s)l=Do(s);else return null;return n?a.jsx(Fe,{to:t,...r,children:l}):a.jsx(se,{component:"span",...r,children:l})}function ma(e){return a.jsxs(Y,{gap:"xs",children:[a.jsx(Pi,{size:24,radius:12,value:e.value,link:e.link}),a.jsx(Ya,{value:e.value,link:e.link})]})}const x8={draft:"blue",active:"blue","on-hold":"yellow",revoked:"red",completed:"green","entered-in-error":"red",unknown:"gray",retired:"gray",registered:"blue",preliminary:"blue",final:"green",amended:"yellow",corrected:"yellow",cancelled:"red",requested:"blue",received:"blue",accepted:"blue",rejected:"red",ready:"blue","in-progress":"blue",failed:"red",proposed:"blue",pending:"blue",booked:"blue",arrived:"blue",fulfilled:"green",noshow:"red","checked-in":"blue",waitlist:"gray",routine:"gray",urgent:"red",asap:"red",stat:"red","not-done":"red",connected:"green",disconnected:"red"};function t0(e){return a.jsx(kc,{color:x8[e.status],children:e.status})}const w8="_table_pe9td_1",S8="_criticalRow_pe9td_12",b8="_noteBody_pe9td_23",C8="_noteCite_pe9td_27",E8="_noteRoot_pe9td_32",wT={table:w8,criticalRow:S8,noteBody:b8,noteCite:C8,noteRoot:E8};n0.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function n0(e){var s;const t=ne(),n=ct(e.value),[r,o]=p.useState();if(p.useEffect(()=>{n!=null&&n.specimen&&Promise.allSettled(n.specimen.map(l=>t.readReference(l))).then(l=>l.filter(c=>c.status==="fulfilled").map(c=>c.value)).then(o).catch(console.error)},[t,n]),!n)return null;const i=(r==null?void 0:r.flatMap(l=>l.note||[]))||[];if(n.presentedForm&&n.presentedForm.length>0){const l=n.presentedForm[0];(s=l.contentType)!=null&&s.startsWith("text/plain")&&l.data&&i.push({text:window.atob(l.data)})}return a.jsxs(be,{children:[a.jsx(ue,{children:"Diagnostic Report"}),a.jsx(j8,{value:n}),r&&!e.hideSpecimenInfo&&P8(r),n.result&&a.jsx(T8,{hideObservationNotes:e.hideObservationNotes,value:n.result}),i.length>0&&a.jsx(xT,{value:i})]})}function j8({value:e}){var t,n;return a.jsxs(Y,{mt:"md",gap:30,children:[e.subject&&a.jsxs("div",{children:[a.jsx(se,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),a.jsx(ma,{value:e.subject,link:!0})]}),(t=e.resultsInterpreter)==null?void 0:t.map(r=>a.jsxs("div",{children:[a.jsx(se,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),a.jsx(ma,{value:r,link:!0})]},r.reference)),(n=e.performer)==null?void 0:n.map(r=>a.jsxs("div",{children:[a.jsx(se,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),a.jsx(ma,{value:r,link:!0})]},r.reference)),e.issued&&a.jsxs("div",{children:[a.jsx(se,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),a.jsx(se,{children:jn(e.issued)})]}),e.status&&a.jsxs("div",{children:[a.jsx(se,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),a.jsx(se,{children:Vt(e.status)})]})]})}function P8(e){return a.jsxs(be,{gap:"xs",children:[a.jsx(ue,{order:2,size:"h6",children:"Specimens"}),a.jsx(Cn,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return a.jsx(Cn.Item,{ml:"sm",children:a.jsxs(Y,{gap:20,children:[a.jsxs(Y,{gap:5,children:[a.jsx(se,{fw:500,children:"Collected:"})," ",jn((n=t.collection)==null?void 0:n.collectedDateTime)]}),a.jsxs(Y,{gap:5,children:[a.jsx(se,{fw:500,children:"Received:"})," ",jn(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function T8(e){return a.jsxs("table",{className:wT.table,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Test"}),a.jsx("th",{children:"Value"}),a.jsx("th",{children:"Reference Range"}),a.jsx("th",{children:"Interpretation"}),a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Performer"}),a.jsx("th",{children:"Status"})]})}),a.jsx("tbody",{children:a.jsx(ST,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function ST(e){var t;return a.jsx(a.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>a.jsx(k8,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Ps(n)?n.reference:n.id}`))})}function k8(e){var o,i;const t=ct(e.value);if(!t||(o=e.ancestorIds)!=null&&o.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=I8(t);return a.jsxs(a.Fragment,{children:[a.jsxs("tr",{className:et({[wT.criticalRow]:r}),children:[a.jsx("td",{rowSpan:n?2:1,children:a.jsx(Fe,{to:t,children:a.jsx(io,{value:t.code})})}),a.jsx("td",{children:a.jsx(R8,{value:t})}),a.jsx("td",{children:a.jsx(D8,{value:t.referenceRange})}),a.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&a.jsx(io,{value:t.interpretation[0]})}),a.jsx("td",{children:t.category&&t.category.length>0&&a.jsx(a.Fragment,{children:t.category.map(s=>a.jsx("div",{children:a.jsx(io,{value:s})},`category-${wi(s)}`))})}),a.jsx("td",{children:(i=t.performer)==null?void 0:i.map(s=>a.jsx(Ld,{value:s},s.reference))}),a.jsx("td",{children:t.status&&a.jsx(t0,{status:t.status})})]}),t.hasMember&&a.jsx(ST,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,children:a.jsx(xT,{value:t.note})})})]})}function R8(e){const t=e.value;return a.jsx(a.Fragment,{children:kP(t)})}function D8(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?a.jsx(a.Fragment,{children:t.text}):a.jsx(Yv,{value:t}):null}function I8(e){var n,r,o,i;const t=(i=(o=(r=(n=e.interpretation)==null?void 0:n[0])==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}const _8="_paper_1igaj_1",A8="_fill_1igaj_20",vw={paper:_8,fill:A8};function r0(e){const{width:t,fill:n,className:r,children:o,...i}=e,s=t?{maxWidth:t}:void 0;return a.jsx(zn,{className:et(vw.paper,n&&vw.fill,r),style:s,shadow:"sm",radius:"sm",withBorder:!0,...i,children:o})}var bT={},Gc={};Object.defineProperty(Gc,"__esModule",{value:!0});Gc.Pointer=void 0;function N8(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function O8(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var M8=function(){function e(t){t===void 0&&(t=[""]),this.tokens=t}return e.fromJSON=function(t){var n=t.split("/").map(N8);if(n[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(t));return new e(n)},e.prototype.toString=function(){return this.tokens.map(O8).join("/")},e.prototype.evaluate=function(t){for(var n=null,r="",o=t,i=1,s=this.tokens.length;i<s;i++)n=o,r=this.tokens[i],!(r=="__proto__"||r=="constructor"||r=="prototype")&&(o=(n||{})[r]);return{parent:n,key:r,value:o}},e.prototype.get=function(t){return this.evaluate(t).value},e.prototype.set=function(t,n){var r=this.evaluate(t);r.parent&&(r.parent[r.key]=n)},e.prototype.push=function(t){this.tokens.push(t)},e.prototype.add=function(t){var n=this.tokens.concat(String(t));return new e(n)},e}();Gc.Pointer=M8;var It={},o0={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(o){return o===void 0?"undefined":o===null?"null":Array.isArray(o)?"array":typeof o}e.objectType=t;function n(o){return o!=null&&typeof o=="object"}function r(o){if(!n(o))return o;if(o.constructor==Array){for(var i=o.length,s=new Array(i),l=0;l<i;l++)s[l]=r(o[l]);return s}if(o.constructor==Date){var c=new Date(+o);return c}var u={};for(var d in o)e.hasOwnProperty.call(o,d)&&(u[d]=r(o[d]));return u}e.clone=r})(o0);var bn={};Object.defineProperty(bn,"__esModule",{value:!0});bn.diffAny=bn.diffObjects=bn.diffArrays=bn.intersection=bn.subtract=bn.isDestructive=void 0;var uc=o0;function L8(e){var t=e.op;return t==="remove"||t==="replace"||t==="copy"||t==="move"}bn.isDestructive=L8;function _m(e,t){var n={};for(var r in e)uc.hasOwnProperty.call(e,r)&&e[r]!==void 0&&(n[r]=1);for(var o in t)uc.hasOwnProperty.call(t,o)&&t[o]!==void 0&&delete n[o];return Object.keys(n)}bn.subtract=_m;function CT(e){for(var t=e.length,n={},r=0;r<t;r++){var o=e[r];for(var i in o)uc.hasOwnProperty.call(o,i)&&o[i]!==void 0&&(n[i]=(n[i]||0)+1)}for(var i in n)n[i]<t&&delete n[i];return Object.keys(n)}bn.intersection=CT;function $8(e){return e.op==="add"}function F8(e){return e.op==="remove"}function ip(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function ET(e,t,n,r){r===void 0&&(r=th);var o={"0,0":{operations:[],cost:0}};function i(d,f){var h="".concat(d,",").concat(f),m=o[h];if(m===void 0){if(d>0&&f>0&&!r(e[d-1],t[f-1],n.add(String(d-1))).length)m=i(d-1,f-1);else{var g=[];if(d>0){var y=i(d-1,f),S={op:"remove",index:d-1};g.push(ip(y,S))}if(f>0){var v=i(d,f-1),x={op:"add",index:d-1,value:t[f-1]};g.push(ip(v,x))}if(d>0&&f>0){var w=i(d-1,f-1),b={op:"replace",index:d-1,original:e[d-1],value:t[f-1]};g.push(ip(w,b))}var j=g.sort(function(E,P){return E.cost-P.cost})[0];m=j}o[h]=m}return m}var s=isNaN(e.length)||e.length<=0?0:e.length,l=isNaN(t.length)||t.length<=0?0:t.length,c=i(s,l).operations,u=c.reduce(function(d,f){var h=d[0],m=d[1];if($8(f)){var g=f.index+1+m,y=g<s+m?String(g):"-",S={op:f.op,path:n.add(y).toString(),value:f.value};return[h.concat(S),m+1]}else if(F8(f)){var S={op:f.op,path:n.add(String(f.index+m)).toString()};return[h.concat(S),m-1]}else{var v=n.add(String(f.index+m)),x=r(f.original,f.value,v);return[h.concat.apply(h,x),m]}},[[],0])[0];return u}bn.diffArrays=ET;function jT(e,t,n,r){r===void 0&&(r=th);var o=[];return _m(e,t).forEach(function(i){o.push({op:"remove",path:n.add(i).toString()})}),_m(t,e).forEach(function(i){o.push({op:"add",path:n.add(i).toString(),value:t[i]})}),CT([e,t]).forEach(function(i){o.push.apply(o,r(e[i],t[i],n.add(i)))}),o}bn.diffObjects=jT;function th(e,t,n,r){if(r===void 0&&(r=th),e===t)return[];var o=(0,uc.objectType)(e),i=(0,uc.objectType)(t);return o=="array"&&i=="array"?ET(e,t,n,r):o=="object"&&i=="object"?jT(e,t,n,r):[{op:"replace",path:n.toString(),value:t}]}bn.diffAny=th;var i0=j0&&j0.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(It,"__esModule",{value:!0});It.apply=It.InvalidOperationError=It.test=It.copy=It.move=It.replace=It.remove=It.add=It.TestError=It.MissingError=void 0;var _o=Gc,s0=o0,z8=bn,so=function(e){i0(t,e);function t(n){var r=e.call(this,"Value required at path: ".concat(n))||this;return r.path=n,r.name="MissingError",r}return t}(Error);It.MissingError=so;var PT=function(e){i0(t,e);function t(n,r){var o=e.call(this,"Test failed: ".concat(n," != ").concat(r))||this;return o.actual=n,o.expected=r,o.name="TestError",o}return t}(Error);It.TestError=PT;function a0(e,t,n){if(Array.isArray(e))if(t=="-")e.push(n);else{var r=parseInt(t,10);e.splice(r,0,n)}else e[t]=n}function TT(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function kT(e,t){var n=_o.Pointer.fromJSON(t.path).evaluate(e);return n.parent===void 0?new so(t.path):(a0(n.parent,n.key,(0,s0.clone)(t.value)),null)}It.add=kT;function RT(e,t){var n=_o.Pointer.fromJSON(t.path).evaluate(e);return n.value===void 0?new so(t.path):(TT(n.parent,n.key),null)}It.remove=RT;function DT(e,t){var n=_o.Pointer.fromJSON(t.path).evaluate(e);if(n.parent===null)return new so(t.path);if(Array.isArray(n.parent)){if(parseInt(n.key,10)>=n.parent.length)return new so(t.path)}else if(n.value===void 0)return new so(t.path);return n.parent[n.key]=(0,s0.clone)(t.value),null}It.replace=DT;function IT(e,t){var n=_o.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new so(t.from);var r=_o.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new so(t.path):(TT(n.parent,n.key),a0(r.parent,r.key,n.value),null)}It.move=IT;function _T(e,t){var n=_o.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new so(t.from);var r=_o.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new so(t.path):(a0(r.parent,r.key,(0,s0.clone)(n.value)),null)}It.copy=_T;function AT(e,t){var n=_o.Pointer.fromJSON(t.path).evaluate(e);return(0,z8.diffAny)(n.value,t.value,new _o.Pointer).length?new PT(n.value,t.value):null}It.test=AT;var NT=function(e){i0(t,e);function t(n){var r=e.call(this,"Invalid operation: ".concat(n.op))||this;return r.operation=n,r.name="InvalidOperationError",r}return t}(Error);It.InvalidOperationError=NT;function B8(e,t){switch(t.op){case"add":return kT(e,t);case"remove":return RT(e,t);case"replace":return DT(e,t);case"move":return IT(e,t);case"copy":return _T(e,t);case"test":return AT(e,t)}return new NT(t)}It.apply=B8;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=Gc;Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=It,r=bn;function o(u,d){return d.map(function(f){return(0,n.apply)(u,f)})}e.applyPatch=o;function i(u){function d(f,h,m){var g=u(f,h,m);return Array.isArray(g)?g:(0,r.diffAny)(f,h,m,d)}return d}function s(u,d,f){var h=new t.Pointer;return(f?i(f):r.diffAny)(u,d,h)}e.createPatch=s;function l(u,d){var f=t.Pointer.fromJSON(d).evaluate(u);if(f!==void 0)return{op:"test",path:d,value:f.value}}function c(u,d){var f=new Array;return d.filter(r.isDestructive).forEach(function(h){var m=l(u,h.path);if(m&&f.push(m),"from"in h){var g=l(u,h.from);g&&f.push(g)}}),f}e.createTests=c})(bT);const U8="_root_w6lfx_1",V8="_removed_w6lfx_16",W8="_added_w6lfx_21",sp={root:U8,removed:V8,added:W8};function H8(e){const t=ne(),{original:n,revised:r}=e,[o,i]=p.useState(!1);p.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>i(!0)).catch(console.log)},[t,e.original.resourceType]);const s=p.useMemo(()=>{if(!o)return null;const l=[lo(n)],c=[lo(r)],u=[],d=q8(bT.createPatch(n,r));for(const f of d){const h=f.path,m=G8(h),g=Q8(n.resourceType,m),y=f.op==="add"?void 0:lc(m,l),S=f.op==="remove"?void 0:lc(m,c);u.push({key:`op-${f.op}-${f.path}`,name:`${Vt(f.op)} ${m}`,path:(g==null?void 0:g.path)??n.resourceType+"."+m,property:g,originalValue:xw(g,y),revisedValue:xw(g,S)})}return u},[o,n,r]);return s?a.jsxs(le,{className:sp.root,children:[a.jsx(le.Thead,{children:a.jsxs(le.Tr,{children:[a.jsx(le.Th,{}),a.jsx(le.Th,{children:"Before"}),a.jsx(le.Th,{children:"After"})]})}),a.jsx(le.Tbody,{children:s.map(l=>a.jsxs(le.Tr,{children:[a.jsx(le.Td,{children:l.name}),a.jsx(le.Td,{className:sp.removed,children:l.originalValue&&a.jsx(Fr,{path:l.path,property:l.property,propertyType:l.originalValue.type,value:l.originalValue.value,ignoreMissingValues:!0})}),a.jsx(le.Td,{className:sp.added,children:l.revisedValue&&a.jsx(Fr,{path:l.path,property:l.property,propertyType:l.revisedValue.type,value:l.revisedValue.value,ignoreMissingValues:!0})})]},l.key))})]}):null}function q8(e){const t=[];for(const n of e){const{op:r,path:o}=n;if(o.startsWith("/meta/author")||o.startsWith("/meta/compartment")||o.startsWith("/meta/lastUpdated")||o.startsWith("/meta/versionId"))continue;const i=e.filter(l=>l.op===r&&l.path===o).length,s={op:r,path:o};i>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(o)&&(s.op="replace",s.path=o.replace(/\/[^/]+$/,"")),t.some(l=>l.op===s.op&&l.path===s.path)||t.push(s)}return t}function G8(e){const t=e.split("/").filter(Boolean);let n="";for(let r=0;r<t.length;r++){const o=t[r];o==="-"?n+=".last()":/^\d+$/.test(o)?n+=`[${o}]`:(r>0&&(n+="."),n+=o)}return n.endsWith(".url")&&(n=n.replace(/\.url$/,"")),n}function Q8(e,t){var r;const n=Gf(e,{resourceType:"SearchParameter",base:[e],code:e+"."+t,expression:e+"."+t});return(r=n==null?void 0:n.elementDefinitions)==null?void 0:r[0]}function xw(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:K8(t,!!(e!=null&&e.isArray))}}function K8(e,t){const n=jL(e).flatMap(r=>r.value);return t?n:n[0]}function l0(e){const{profileUrl:t}=e,n=ne(),r=ct(e.value),[o,i]=p.useState();return p.useEffect(()=>{if(r)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{const s=Cs(t);s?i(s.name):console.error(`Schema not found for ${t}`)}).catch(s=>{console.error("Error in requestProfileSchema",s)});else{const s=r.resourceType;n.requestSchema(s).then(()=>{i(s)}).catch(console.error)}},[n,t,r]),!o||!r?null:a.jsx($d,{path:r.resourceType,value:{type:o,value:e.forceUseInput?e.value:r},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues})}function Y8(e){return a.jsx(qc,{children:e.children})}function cs(e){var c,u;const{resource:t,profile:n,padding:r,popupMenuItems:o,...i}=e,s=n??((c=t.meta)==null?void 0:c.author),l=e.dateTime??((u=t.meta)==null?void 0:u.lastUpdated);return a.jsxs(r0,{"data-testid":"timeline-item",fill:!0,...i,children:[a.jsxs(Y,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[a.jsx(Pi,{value:s,link:!0,size:"md"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(se,{size:"sm",children:a.jsx(Ya,{c:"dark",fw:500,value:s,link:!0})}),a.jsxs(se,{size:"xs",children:[a.jsx(Fe,{c:"dimmed",to:e.resource,children:jn(l)}),a.jsx(se,{component:"span",c:"dimmed",mx:8,children:"·"}),a.jsx(Fe,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&a.jsxs(Z,{position:"bottom-end",shadow:"md",width:200,children:[a.jsx(Z.Target,{children:a.jsx(qt,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${ht(e.resource)}`,children:a.jsx(Q7,{})})}),o]})]}),a.jsxs(ZP,{children:[r&&a.jsx("div",{style:{padding:"0 16px 16px 16px"},children:e.children}),!r&&a.jsx(a.Fragment,{children:e.children})]})]})}function OT(e,t){e.sort((n,r)=>{const o=ww(n,t),i=ww(r,t);return o>i?1:o<i?-1:Sw(n,t)-Sw(r,t)})}function ww(e,t){if(!MT(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function Sw(e,t){var r;if(!MT(e,t)){if(e.resourceType==="Communication"&&e.sent)return new Date(e.sent).getTime();if((e.resourceType==="DiagnosticReport"||e.resourceType==="Media"||e.resourceType==="Observation")&&e.issued)return new Date(e.issued).getTime();if(e.resourceType==="DocumentReference"&&e.date)return new Date(e.date).getTime()}const n=(r=e.meta)==null?void 0:r.lastUpdated;return n?new Date(n).getTime():0}function MT(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const X8="_pinnedComment_5uxzi_2",J8={pinnedComment:X8};function nh(e){const t=ne(),n=Yf(),r=t.getProfile(),o=p.useRef(null),i=ct(e.value),[s,l]=p.useState(),[c,u]=p.useState([]),d=e.loadTimelineResources,f=p.useRef(c);f.current=c;const h=p.useCallback(I=>{OT(I,i),I.reverse(),u(I)},[i]),m=p.useCallback(I=>{const $=[];for(const N of I){if(N.status!=="fulfilled")continue;const L=N.value;if(L.type==="history"&&l(L),L.entry)for(const M of L.entry)$.push(M.resource)}h($)},[h]),g=p.useCallback(I=>h([...f.current,I]),[h]),y=p.useCallback(()=>{var N;let I,$;"resourceType"in e.value?(I=e.value.resourceType,$=e.value.id):[I,$]=(N=e.value.reference)==null?void 0:N.split("/"),d(t,I,$).then(m).catch(console.log)},[t,e.value,d,m]);p.useEffect(()=>y(),[y]);function S(I){!i||!e.createCommunication||t.createResource(e.createCommunication(i,r,I)).then($=>g($)).catch(console.log)}function v(I){!i||!e.createMedia||t.createResource(e.createMedia(i,r,I)).then($=>g($)).then(()=>El({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:a.jsx(Jf,{size:16}),autoClose:2e3})).catch($=>El({id:"upload-notification",color:"red",title:"Upload error",message:Te($),icon:a.jsx(uw,{size:16}),autoClose:2e3}))}function x(I,$){return t.updateResource({...I,priority:$})}function w(I){x(I,"stat").then(y).catch(console.log)}function b(I){x(I,"routine").then(y).catch(console.log)}function j(I){n(`/${I.resourceType}/${I.id}`)}function E(I){n(`/${I.resourceType}/${I.id}/edit`)}function P(I){n(`/${I.resourceType}/${I.id}/delete`)}function T(I){var $;n(`/${I.resourceType}/${I.id}/_history/${($=I.meta)==null?void 0:$.versionId}`)}function D(){fe({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function _(I){El({id:"upload-notification",loading:!0,title:"Uploading...",message:iz(I),autoClose:!1,withCloseButton:!1})}function O(I){El({id:"upload-notification",color:"red",title:"Upload error",message:Te(I),icon:a.jsx(uw,{size:16}),autoClose:2e3})}return i?a.jsxs(Y8,{children:[e.createCommunication&&a.jsx(r0,{children:a.jsx(We,{testid:"timeline-form",onSubmit:I=>{S(I.text);const $=o.current;$&&($.value="",$.focus())},children:a.jsxs(Y,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[a.jsx(Pi,{value:r}),a.jsx(ae,{name:"text",ref:o,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),a.jsx(qt,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:a.jsx(o6,{size:16})}),a.jsx(Kv,{securityContext:ft(i),onUpload:v,onUploadStart:D,onUploadProgress:_,onUploadError:O,children:I=>a.jsx(qt,{...I,radius:"xl",color:"blue",variant:"filled",children:a.jsx(Bv,{size:16})})})]})})}),c.map(I=>{var N;if(!I)return null;const $=`${I.resourceType}/${I.id}/${(N=I.meta)==null?void 0:N.versionId}`;if(I.resourceType===i.resourceType&&I.id===i.id)return a.jsx(Z8,{history:s,resource:I,onDetails:T},$);switch(I.resourceType){case"AuditEvent":return a.jsx(rz,{resource:I,onDetails:j},$);case"Communication":return a.jsx(tz,{resource:I,onPin:I.priority!=="stat"?w:void 0,onUnpin:I.priority==="stat"?b:void 0,onDetails:j,onEdit:E,onDelete:P},$);case"DiagnosticReport":return a.jsx(oz,{resource:I,onDetails:j,onEdit:E,onDelete:P},$);case"Media":return a.jsx(nz,{resource:I,onDetails:j,onEdit:E,onDelete:P},$);default:return a.jsx(cs,{resource:I,padding:!0,children:a.jsx(l0,{value:I,ignoreMissingValues:!0})},$)}})]}):a.jsx(on,{style:{width:"100%",height:"100%"},children:a.jsx(Vn,{})})}function _a(e){return a.jsxs(Z.Dropdown,{children:[a.jsx(Z.Label,{children:"Resource"}),e.onPin&&a.jsx(Z.Item,{leftSection:a.jsx(a6,{size:14}),onClick:()=>e.onPin(e.resource),"aria-label":`Pin ${ht(e.resource)}`,children:"Pin"}),e.onUnpin&&a.jsx(Z.Item,{leftSection:a.jsx(l6,{size:14}),onClick:()=>e.onUnpin(e.resource),"aria-label":`Unpin ${ht(e.resource)}`,children:"Unpin"}),e.onDetails&&a.jsx(Z.Item,{leftSection:a.jsx(e6,{size:14}),onClick:()=>e.onDetails(e.resource),"aria-label":`Details ${ht(e.resource)}`,children:"Details"}),e.onEdit&&a.jsx(Z.Item,{leftSection:a.jsx(K7,{size:14}),onClick:()=>e.onEdit(e.resource),"aria-label":`Edit ${ht(e.resource)}`,children:"Edit"}),e.onDelete&&a.jsxs(a.Fragment,{children:[a.jsx(Z.Divider,{}),a.jsx(Z.Label,{children:"Danger zone"}),a.jsx(Z.Item,{color:"red",leftSection:a.jsx(JP,{size:14}),onClick:()=>e.onDelete(e.resource),"aria-label":`Delete ${ht(e.resource)}`,children:"Delete"})]})]})}function Z8(e){const t=ez(e.history,e.resource);return t?a.jsx(cs,{resource:e.resource,padding:!0,popupMenuItems:a.jsx(_a,{...e}),children:a.jsx(H8,{original:t,revised:e.resource})}):a.jsxs(cs,{resource:e.resource,padding:!0,popupMenuItems:a.jsx(_a,{...e}),children:[a.jsx("h3",{children:"Created"}),a.jsx(l0,{value:e.resource,ignoreMissingValues:!0,forceUseInput:!0})]})}function ez(e,t){const n=e.entry,r=n.findIndex(o=>{var i,s,l;return((s=(i=o.resource)==null?void 0:i.meta)==null?void 0:s.versionId)===((l=t.meta)==null?void 0:l.versionId)});if(!(r>=n.length-1))return n[r+1].resource}function tz(e){var r,o;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:J8.pinnedComment;return a.jsx(cs,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:a.jsx(_a,{...e}),children:a.jsx("p",{children:(o=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:o.contentString})})}function nz(e){var r;const t=(r=e.resource.content)==null?void 0:r.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return a.jsx(cs,{resource:e.resource,padding:!!n,popupMenuItems:a.jsx(_a,{...e}),children:a.jsx(Vc,{value:e.resource.content})})}function rz(e){return a.jsx(cs,{resource:e.resource,padding:!0,popupMenuItems:a.jsx(_a,{...e}),children:a.jsx(vr,{children:a.jsx("pre",{children:e.resource.outcomeDesc})})})}function oz(e){return a.jsx(cs,{resource:e.resource,padding:!0,popupMenuItems:a.jsx(_a,{...e}),children:a.jsx(n0,{value:e.resource})})}function iz(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${ap(e.loaded)} / ${ap(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${ap(e.loaded)}`}function ap(e){if(e===0)return"0.00 B";const t=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,t)).toFixed(2)+" "+" KMGTP".charAt(t)+"B"}function sz(e){return a.jsx(nh,{value:e.resource,loadTimelineResources:async(t,n,r)=>{const o=`${n}/${r}`;return Promise.allSettled([t.readHistory(n,r),t.search("Task",{_filter:`based-on eq ${o} or focus eq ${o} or subject eq ${o}`,_count:100})])}})}function Se(e){const{children:t,...n}=e;return a.jsx(qc,{children:a.jsx(r0,{...n,children:t})})}function az(e){return a.jsx(nh,{value:e.encounter,loadTimelineResources:async(t,n,r)=>Promise.allSettled([t.readHistory("Encounter",r),t.search("Communication","encounter=Encounter/"+r),t.search("Media","encounter=Encounter/"+r)]),createCommunication:(t,n,r)=>({resourceType:"Communication",status:"completed",encounter:ft(t),subject:t.subject,sender:ft(n),sent:new Date().toISOString(),payload:[{contentString:r}]}),createMedia:(t,n,r)=>({resourceType:"Media",status:"completed",encounter:ft(t),subject:t.subject,operator:ft(n),issued:new Date().toISOString(),content:r})})}function lz(e){let t;try{t=y$(e.path,e.resource)}catch(n){return console.warn("FhirPathDisplay:",n),null}if(t.length>1)throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. Received ${t.length} elements [${JSON.stringify(t,null,2)}]`);return a.jsx(Fr,{value:t[0]||"",propertyType:e.propertyType})}function cz(e){return a.jsxs(Dn,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[a.jsxs(W,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&a.jsx(bw,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&a.jsx(bw,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),a.jsx(se,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function bw(e){return a.jsx(te,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const uz={string:[ie.EQUALS,ie.NOT,ie.CONTAINS,ie.EXACT],fulltext:[ie.EQUALS,ie.NOT,ie.CONTAINS,ie.EXACT],token:[ie.EQUALS,ie.NOT],reference:[ie.EQUALS,ie.NOT],numeric:[ie.EQUALS,ie.NOT_EQUALS,ie.GREATER_THAN,ie.LESS_THAN,ie.GREATER_THAN_OR_EQUALS,ie.LESS_THAN_OR_EQUALS],quantity:[ie.EQUALS,ie.NOT_EQUALS,ie.GREATER_THAN,ie.LESS_THAN,ie.GREATER_THAN_OR_EQUALS,ie.LESS_THAN_OR_EQUALS],date:[ie.EQUALS,ie.NOT_EQUALS,ie.GREATER_THAN,ie.LESS_THAN,ie.GREATER_THAN_OR_EQUALS,ie.LESS_THAN_OR_EQUALS,ie.STARTS_AFTER,ie.ENDS_BEFORE,ie.APPROXIMATELY],datetime:[ie.EQUALS,ie.NOT_EQUALS,ie.GREATER_THAN,ie.LESS_THAN,ie.GREATER_THAN_OR_EQUALS,ie.LESS_THAN_OR_EQUALS,ie.STARTS_AFTER,ie.ENDS_BEFORE,ie.APPROXIMATELY]},dz={eq:"equals",ne:"not equals",gt:"greater than",lt:"less than",ge:"greater than or equals",le:"less than or equals",sa:"starts after",eb:"ends before",ap:"approximately",contains:"contains",exact:"exact",text:"text",not:"not",above:"above",below:"below",in:"in","not-in":"not in","of-type":"of type",missing:"missing",identifier:"identifier",iterate:"iterate"};function c0(e,t){return{...e,filters:t,offset:0,name:void 0}}function u0(e,t){return c0(e,(e.filters??[]).filter(n=>n.code!==t))}function rh(e,t,n,r,o){o&&(e=u0(e,t));const i=[];return e.filters&&i.push(...e.filters),i.push({code:t,operator:n,value:r??""}),c0(e,i)}function fz(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function hz(e,t){return d0(e,t,-1)}function pz(e,t){return d0(e,t,0)}function mz(e,t){return d0(e,t,1)}function d0(e,t,n){const r=new Date;r.setDate(r.getDate()+n),r.setHours(0,0,0,0);const o=new Date(r.getTime());return o.setDate(o.getDate()+1),o.setTime(o.getTime()-1),h0(e,t,r,o)}function gz(e,t){return f0(e,t,-1)}function yz(e,t){return f0(e,t,0)}function vz(e,t){return f0(e,t,1)}function f0(e,t,n){const r=new Date;r.setMonth(r.getMonth()+n),r.setDate(1),r.setHours(0,0,0,0);const o=new Date(r.getTime());return o.setMonth(o.getMonth()+1),o.setDate(1),o.setHours(0,0,0,0),o.setTime(o.getTime()-1),h0(e,t,r,o)}function xz(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),h0(e,t,n,new Date)}function h0(e,t,n,r){return e=u0(e,t),e=Cw(e,t,ie.GREATER_THAN_OR_EQUALS,n),e=Cw(e,t,ie.LESS_THAN_OR_EQUALS,r),e}function Cw(e,t,n,r){return rh(e,t,n,r.toISOString())}function Ew(e,t,n=!0){return rh(e,t,ie.MISSING,n.toString())}function wz(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function Sz(e,t){const n=e.count??Qf,r=(t-1)*n;return wz(e,r)}function bz(e,t,n){return t===Cz(e)&&n!==void 0&&n===Ez(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function Cz(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function Ez(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function jz(e){return uz[e.type]}function p0(e){return dz[e]??""}function Si(e){let t=e;return t.includes(".")&&(t=t.split(".").pop()),t==="versionId"?"Version ID":(t=t.replace("[x]",""),t=t.replace(/([A-Z])/g," $1"),t=t.replace(/[-_]/g," "),t=t.replace(/\s+/g," "),t=t.trim(),t.toLowerCase()==="id"?"ID":t.split(/\s/).map(Vt).join(" "))}function Pz(e,t){var r,o;const n=t.name;return n==="id"?e.id:n==="meta.versionId"?(r=e.meta)==null?void 0:r.versionId:n==="_lastUpdated"?jn((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?Tz(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?kz(e,t.searchParams[0]):null}function Tz(e,t){var i,s,l;const n=((l=(s=(i=t.path)==null?void 0:i.split("."))==null?void 0:s.pop())==null?void 0:l.replaceAll("[x]",""))??"",[r,o]=Wc({type:e.resourceType,value:e},n);return r?a.jsx(Fr,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function kz(e,t){const n=lc(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:a.jsx(a.Fragment,{children:n.map((r,o)=>a.jsx(Fr,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function Rz(e){const t=p.useRef(!1),[n,r]=p.useState({search:JSON.parse(tr(e.search))}),[o,i]=p.useState(!1);p.useEffect(()=>{r({search:e.search})},[e.search]);const s=p.useMemo(()=>{if(!e.visible)return[];const c=e.search.resourceType,u=pP(c),d=Rv(c);return Dz(u,d).sort((f,h)=>f.localeCompare(h)).map(f=>({value:f,label:Si(f)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function l(c){r({search:{...n.search,fields:c}})}return a.jsx(Dn,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=o},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:a.jsx("div",{"data-testid":"overlay-child"})},children:a.jsxs(be,{children:[a.jsx(Of,{style:{width:550},placeholder:"Select fields to display",data:s,value:n.search.fields??[],onChange:l,onDropdownOpen:()=>i(!0),onDropdownClose:()=>i(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),a.jsx(Y,{justify:"flex-end",children:a.jsx(te,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function Dz(e,t){const n=[],r=new Set,o=new Set;for(const i of Object.keys(e.elements))n.push(i),r.add(i.toLowerCase()),o.add(Si(i));if(t)for(const i of Object.keys(t)){const s=Si(i);!r.has(i)&&!o.has(s)&&(n.push(i),r.add(i),o.add(s))}return n}function LT(e){var o;const{resourceType:t,filter:n}=e,r=(o=Io.types[t].searchParams)==null?void 0:o[n.code];if(r){if(r.type==="reference"&&(n.operator===ie.EQUALS||n.operator===ie.NOT_EQUALS))return a.jsx(Ya,{value:{reference:n.value}});const i=Gf(t,r);if(n.code==="_lastUpdated"||i.type===Jo.DATETIME)return a.jsx(a.Fragment,{children:jn(n.value)})}return a.jsx(a.Fragment,{children:n.value})}function $T(e){const t=Gf(e.resourceType,e.searchParam),n="filter-value";switch(t.type){case Jo.REFERENCE:return a.jsx(eh,{name:n,defaultValue:e.defaultValue?{reference:e.defaultValue}:void 0,targetTypes:e.searchParam.target,autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(r.reference):e.onChange("")}});case Jo.BOOLEAN:return a.jsx(gr,{name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultChecked:e.defaultValue==="true",autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.checked.toString())});case Jo.DATE:return a.jsx(ae,{type:"date",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case Jo.DATETIME:return a.jsx(as,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case Jo.NUMBER:return a.jsx(ae,{type:"number",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case Jo.QUANTITY:return a.jsx(ls,{name:n,defaultValue:Iz(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return a.jsx(ae,{name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value),placeholder:"Search value"})}}function Iz(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function _z(e){const[t,n]=p.useState(JSON.parse(tr(e.search))),[r,o]=p.useState(-1),i=p.useRef(t);i.current=t,p.useEffect(()=>{n(JSON.parse(tr(e.search)))},[e.search]);function s(d){n(rh(i.current,d.code,d.operator,d.value))}if(!e.visible)return null;const l=e.search.resourceType,c=Rv(l)??{},u=t.filters||[];return a.jsxs(Dn,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:[a.jsx("div",{children:a.jsxs("table",{children:[a.jsxs("colgroup",{children:[a.jsx("col",{style:{width:200}}),a.jsx("col",{style:{width:200}}),a.jsx("col",{style:{width:380}}),a.jsx("col",{style:{width:120}})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Field"}),a.jsx("th",{children:"Operation"}),a.jsx("th",{children:"Value"}),a.jsx("th",{children:"Actions"})]})}),a.jsxs("tbody",{children:[u.map((d,f)=>f===r?a.jsx(jw,{resourceType:l,searchParams:c,defaultValue:d,okText:"Save",onOk:h=>{const m=[...u];m[f]=h,n(c0(i.current,m)),o(-1)},onCancel:()=>o(-1)},`filter-${d.code}-${d.operator}-${d.value}-input`):a.jsx(Az,{resourceType:l,filter:d,onEdit:()=>o(f),onDelete:()=>n(fz(i.current,f))},`filter-${d.code}-${d.operator}-${d.value}-display`)),a.jsx(jw,{resourceType:l,searchParams:c,okText:"Add",onOk:s})]})]})}),a.jsx(Y,{justify:"flex-end",mt:"xl",children:a.jsx(te,{onClick:()=>e.onOk(i.current),children:"OK"})})]})}function Az(e){const{filter:t}=e;return a.jsxs("tr",{children:[a.jsx("td",{children:Si(t.code)}),a.jsx("td",{children:p0(t.operator)}),a.jsx("td",{children:a.jsx(LT,{resourceType:e.resourceType,filter:t})}),a.jsxs("td",{children:[a.jsx(te,{size:"compact-md",variant:"outline",onClick:e.onEdit,children:"Edit"}),a.jsx(te,{size:"compact-md",variant:"outline",onClick:e.onDelete,children:"Delete"})]})]})}function jw(e){const[t,n]=p.useState(e.defaultValue??{}),r=p.useRef(t);r.current=t;function o(u){n({...r.current,code:u})}function i(u){n({...r.current,operator:u})}function s(u){n({...r.current,value:u})}const l=e.searchParams[t.code],c=l&&jz(l);return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(wt,{"data-testid":"filter-field",defaultValue:r.current.code,onChange:u=>o(u.currentTarget.value),data:["",...Object.keys(e.searchParams).map(u=>({value:u,label:Si(u)}))]})}),a.jsx("td",{children:c&&a.jsx(wt,{"data-testid":"filter-operation",defaultValue:t.operator,onChange:u=>i(u.currentTarget.value),data:["",...c.map(u=>({value:u,label:p0(u)}))]})}),a.jsx("td",{children:l&&t.operator&&a.jsx($T,{resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:s})}),a.jsxs("td",{children:[t.code&&t.operator&&a.jsx(te,{size:"compact-md",variant:"outline",onClick:()=>{e.onOk(r.current),n({})},children:e.okText}),e.onCancel&&a.jsx(te,{size:"compact-md",variant:"outline",onClick:e.onCancel,children:"Cancel"})]})]})}function Nz(e){const[t,n]=p.useState(e.defaultValue??"");if(!e.visible||!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return a.jsx(Dn,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:a.jsx(We,{onSubmit:r,children:a.jsxs(Kn,{children:[a.jsx(Kn.Col,{span:10,children:a.jsx($T,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),a.jsx(Kn.Col,{span:2,children:a.jsx(te,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function Oz(e){if(!e.searchParams)return null;function t(i,s){o(bz(e.search,i.code,s))}function n(i){o(u0(e.search,i.code))}function r(i,s){e.onPrompt(i,{code:i.code,operator:s,value:""})}function o(i){e.onChange(i)}return e.searchParams.length===1?a.jsx(Mz,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):a.jsx(Z.Dropdown,{children:e.searchParams.map(i=>a.jsx(Z.Item,{children:Si(i.code)},i.code))})}function Mz(e){switch(e.searchParam.type){case"date":return a.jsx(Lz,{...e});case"number":case"quantity":return a.jsx($z,{...e});case"reference":return a.jsx(Fz,{...e});case"string":return a.jsx(zz,{...e});case"token":case"uri":return a.jsx(Bz,{...e});default:return a.jsxs(a.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function Lz(e){const{searchParam:t}=e,n=t.code;return a.jsxs(Z.Dropdown,{children:[a.jsx(Z.Item,{leftSection:a.jsx(Uv,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),a.jsx(Z.Item,{leftSection:a.jsx(Vv,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),a.jsx(Z.Divider,{}),a.jsx(Z.Item,{leftSection:a.jsx(Uc,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Equals..."}),a.jsx(Z.Item,{leftSection:a.jsx(Bc,{size:14}),onClick:()=>e.onPrompt(t,ie.NOT_EQUALS),children:"Does not equal..."}),a.jsx(Z.Divider,{}),a.jsx(Z.Item,{leftSection:a.jsx(XP,{size:14}),onClick:()=>e.onPrompt(t,ie.ENDS_BEFORE),children:"Before..."}),a.jsx(Z.Item,{leftSection:a.jsx(YP,{size:14}),onClick:()=>e.onPrompt(t,ie.STARTS_AFTER),children:"After..."}),a.jsx(Z.Item,{leftSection:a.jsx(F7,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Between..."}),a.jsx(Z.Divider,{}),a.jsx(Z.Item,{leftSection:a.jsx(Ai,{size:14}),onClick:()=>e.onChange(mz(e.search,n)),children:"Tomorrow"}),a.jsx(Z.Item,{leftSection:a.jsx(Ai,{size:14}),onClick:()=>e.onChange(pz(e.search,n)),children:"Today"}),a.jsx(Z.Item,{leftSection:a.jsx(Ai,{size:14}),onClick:()=>e.onChange(hz(e.search,n)),children:"Yesterday"}),a.jsx(Z.Divider,{}),a.jsx(Z.Item,{leftSection:a.jsx(Ai,{size:14}),onClick:()=>e.onChange(vz(e.search,n)),children:"Next Month"}),a.jsx(Z.Item,{leftSection:a.jsx(Ai,{size:14}),onClick:()=>e.onChange(yz(e.search,n)),children:"This Month"}),a.jsx(Z.Item,{leftSection:a.jsx(Ai,{size:14}),onClick:()=>e.onChange(gz(e.search,n)),children:"Last Month"}),a.jsx(Z.Divider,{}),a.jsx(Z.Item,{leftSection:a.jsx(Ai,{size:14}),onClick:()=>e.onChange(xz(e.search,n)),children:"Year to date"}),a.jsx(Qc,{...e})]})}function $z(e){const{searchParam:t}=e;return a.jsxs(Z.Dropdown,{children:[a.jsx(Z.Item,{leftSection:a.jsx(Uv,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),a.jsx(Z.Item,{leftSection:a.jsx(Vv,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),a.jsx(Z.Divider,{}),a.jsx(Z.Item,{leftSection:a.jsx(Uc,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Equals..."}),a.jsx(Z.Item,{leftSection:a.jsx(Bc,{size:14}),onClick:()=>e.onPrompt(t,ie.NOT_EQUALS),children:"Does not equal..."}),a.jsx(Z.Divider,{}),a.jsx(Z.Item,{leftSection:a.jsx(YP,{size:14}),onClick:()=>e.onPrompt(t,ie.GREATER_THAN),children:"Greater than..."}),a.jsx(Z.Item,{leftSection:a.jsx(Dm,{size:14}),onClick:()=>e.onPrompt(t,ie.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),a.jsx(Z.Item,{leftSection:a.jsx(XP,{size:14}),onClick:()=>e.onPrompt(t,ie.LESS_THAN),children:"Less than..."}),a.jsx(Z.Item,{leftSection:a.jsx(Dm,{size:14}),onClick:()=>e.onPrompt(t,ie.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),a.jsx(Qc,{...e})]})}function Fz(e){const{searchParam:t}=e;return a.jsxs(Z.Dropdown,{children:[a.jsx(Z.Item,{leftSection:a.jsx(Uc,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Equals..."}),a.jsx(Z.Item,{leftSection:a.jsx(Bc,{size:14}),onClick:()=>e.onPrompt(t,ie.NOT),children:"Does not equal..."}),a.jsx(Qc,{...e})]})}function zz(e){const{searchParam:t}=e;return a.jsxs(Z.Dropdown,{children:[a.jsx(Z.Item,{leftSection:a.jsx(Uv,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),a.jsx(Z.Item,{leftSection:a.jsx(Vv,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),a.jsx(Z.Divider,{}),a.jsx(Z.Item,{leftSection:a.jsx(Uc,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Equals..."}),a.jsx(Z.Item,{leftSection:a.jsx(Bc,{size:14}),onClick:()=>e.onPrompt(t,ie.NOT),children:"Does not equal..."}),a.jsx(Z.Divider,{}),a.jsx(Z.Item,{leftSection:a.jsx(U7,{size:14}),onClick:()=>e.onPrompt(t,ie.CONTAINS),children:"Contains..."}),a.jsx(Z.Item,{leftSection:a.jsx(B7,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Does not contain..."}),a.jsx(Qc,{...e})]})}function Bz(e){const{searchParam:t}=e;return a.jsxs(Z.Dropdown,{children:[a.jsx(Z.Item,{leftSection:a.jsx(Uc,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Equals..."}),a.jsx(Z.Item,{leftSection:a.jsx(Bc,{size:14}),onClick:()=>e.onPrompt(t,ie.NOT),children:"Does not equal..."}),a.jsx(Qc,{...e})]})}function Qc(e){const{searchParam:t}=e,n=t.code;return a.jsxs(a.Fragment,{children:[a.jsx(Z.Divider,{}),a.jsx(Z.Item,{leftSection:a.jsx(L7,{size:14}),onClick:()=>e.onChange(Ew(e.search,n)),children:"Missing"}),a.jsx(Z.Item,{leftSection:a.jsx(M7,{size:14}),onClick:()=>e.onChange(Ew(e.search,n,!1)),children:"Not missing"}),a.jsx(Z.Divider,{}),a.jsx(Z.Item,{leftSection:a.jsx(Md,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const Uz="_root_vlout_1",Vz="_table_vlout_8",Wz="_tr_vlout_12",Hz="_th_vlout_18",qz="_control_vlout_22",Gz="_icon_vlout_31",hl={root:Uz,table:Vz,tr:Wz,th:Hz,control:qz,icon:Gz};function Qz(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(Kz(t,r));return n}function Kz(e,t){var o;if(t==="_lastUpdated")return{name:"_lastUpdated",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_lastUpdated",name:"_lastUpdated",type:"date",expression:"Resource.meta.lastUpdated"}]};if(t==="meta.versionId")return{name:"meta.versionId",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_versionId",name:"_versionId",type:"token",expression:"Resource.meta.versionId"}]};const n=js(e,t),r=BL(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const i=Rv(e);let s;if(i){const l=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);s=Object.values(i).filter(c=>!!c.expression&&l.test(c==null?void 0:c.expression)),s.length===0&&(s=void 0)}return{name:t,elementDefinition:n,searchParams:s}}if(r){const i=Gf(e,r);return{name:t,elementDefinition:(o=i.elementDefinitions)==null?void 0:o[0],searchParams:[r]}}return{name:t}}class Yz extends Event{constructor(t){super("change"),this.definition=t}}class Xz extends Event{constructor(t){super("load"),this.response=t}}class Fd extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function Jz(e){var N,L,M;const t=ne(),[n,r]=p.useState(),[o,i]=p.useState(),{search:s,onLoad:l}=e,[c,u]=p.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),d=p.useRef(c);d.current=c;const f=s.total??"accurate",h=p.useCallback(R=>{i(void 0),t.search(s.resourceType,ra({...s,total:f,fields:void 0}),R).then(k=>{u({...d.current,searchResponse:k}),l&&l(new Xz(k))}).catch(k=>{u({...d.current,searchResponse:void 0}),i(k)})},[t,s,f,l]),m=p.useCallback(()=>{u({...d.current,searchResponse:void 0}),h({cache:"reload"})},[h]);p.useEffect(()=>{h()},[h]);function g(R,k){R.stopPropagation();const q=R.target.checked,G={...d.current.selected};q?G[k]=!0:delete G[k],u({...d.current,selected:G})}function y(R){R.stopPropagation();const F=R.target.checked,q={},G=d.current.searchResponse;F&&(G!=null&&G.entry)&&G.entry.forEach(oe=>{var xe;(xe=oe.resource)!=null&&xe.id&&(q[oe.resource.id]=!0)}),u({...d.current,selected:q})}function S(){var k,F;const R=d.current;if(!((k=R.searchResponse)!=null&&k.entry)||R.searchResponse.entry.length===0)return!1;for(const q of R.searchResponse.entry)if((F=q.resource)!=null&&F.id&&!R.selected[q.resource.id])return!1;return!0}function v(R){e.onChange&&e.onChange(new Yz(R))}function x(R,k){if(eT(R.target)||R.button===2)return;it(R);const F=R.button===1||R.ctrlKey||R.metaKey;!F&&e.onClick&&e.onClick(new Fd(k,R)),F&&e.onAuxClick&&e.onAuxClick(new Fd(k,R))}function w(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(p.useEffect(()=>{r(e.search.resourceType),t.requestSchema(e.search.resourceType).catch(console.error).finally(()=>r(void 0))},[t,e.search.resourceType]),!hP(e.search.resourceType)||n===e.search.resourceType)return a.jsx(on,{style:{width:"100%",height:"100%"},children:a.jsx(Vn,{})});const b=e.checkboxesEnabled,j=Qz(s),E=s.resourceType,P=c.searchResponse,T=P==null?void 0:P.entry,D=T==null?void 0:T.map(R=>R.resource),_="subtle",O="gray",I=16,$=window.innerWidth<768;return a.jsxs("div",{className:hl.root,"data-testid":"search-control",children:[!e.hideToolbar&&a.jsxs(Y,{justify:"space-between",mb:"xl",children:[a.jsxs(Y,{gap:2,children:[a.jsx(te,{size:"compact-md",variant:_,color:O,leftSection:a.jsx(H7,{size:I}),onClick:()=>u({...d.current,fieldEditorVisible:!0}),children:"Fields"}),a.jsx(te,{size:"compact-md",variant:_,color:O,leftSection:a.jsx(X7,{size:I}),onClick:()=>u({...d.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&a.jsx(te,{size:"compact-md",variant:_,color:O,leftSection:a.jsx(Y7,{size:I}),onClick:e.onNew,children:"New..."}),!$&&w()&&a.jsx(te,{size:"compact-md",variant:_,color:O,leftSection:a.jsx(x6,{size:I}),onClick:e.onExport?e.onExport:()=>u({...d.current,exportDialogVisible:!0}),children:"Export..."}),!$&&e.onDelete&&a.jsx(te,{size:"compact-md",variant:_,color:O,leftSection:a.jsx(JP,{size:I}),onClick:()=>e.onDelete(Object.keys(c.selected)),children:"Delete..."}),!$&&e.onBulk&&a.jsx(te,{size:"compact-md",variant:_,color:O,leftSection:a.jsx($7,{size:I}),onClick:()=>e.onBulk(Object.keys(c.selected)),children:"Bulk..."})]}),a.jsxs(Y,{gap:2,children:[P&&a.jsxs(se,{size:"xs",c:"dimmed","data-testid":"count-display",children:[FT(s,P).toLocaleString(),"-",nB(s,P).toLocaleString(),P.total!==void 0&&` of ${s.total==="estimate"?"~":""}${(N=P.total)==null?void 0:N.toLocaleString()}`]}),a.jsx(qt,{variant:_,color:O,title:"Refresh",onClick:m,children:a.jsx(f6,{size:I})})]})]}),a.jsxs(le,{className:hl.table,children:[a.jsxs(le.Thead,{children:[a.jsxs(le.Tr,{children:[b&&a.jsx(le.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:S(),onChange:R=>y(R)})}),j.map(R=>a.jsx(le.Th,{children:a.jsxs(Z,{shadow:"md",width:240,position:"bottom-end",children:[a.jsx(Z.Target,{children:a.jsx(Jn,{className:hl.control,p:2,children:a.jsxs(Y,{justify:"space-between",wrap:"nowrap",children:[a.jsx(se,{fw:500,children:Si(R.name)}),a.jsx(on,{className:hl.icon,children:a.jsx(A7,{size:14,stroke:1.5})})]})})}),a.jsx(Oz,{search:e.search,searchParams:R.searchParams,onPrompt:(k,F)=>{u({...d.current,filterDialogVisible:!0,filterDialogSearchParam:k,filterDialogFilter:F})},onChange:k=>{v(k)}})]})},R.name))]}),!e.hideFilters&&a.jsxs(le.Tr,{children:[b&&a.jsx(le.Th,{}),j.map(R=>a.jsx(le.Th,{children:R.searchParams&&a.jsx(Zz,{resourceType:E,searchParams:R.searchParams,filters:e.search.filters})},R.name))]})]}),a.jsx(le.Tbody,{children:D==null?void 0:D.map(R=>R&&a.jsxs(le.Tr,{className:hl.tr,"data-testid":"search-control-row",onClick:k=>x(k,R),onAuxClick:k=>x(k,R),children:[b&&a.jsx(le.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${R.id}`,checked:!!c.selected[R.id],onChange:k=>g(k,R.id)})}),j.map(k=>a.jsx(le.Td,{children:Pz(R,k)},k.name))]},R.id))})]}),(D==null?void 0:D.length)===0&&a.jsx(qc,{children:a.jsx(on,{style:{height:150},children:a.jsx(se,{size:"xl",c:"dimmed",children:"No results"})})}),P&&a.jsx(on,{m:"md",p:"md",children:a.jsx(Ur,{value:eB(s),total:tB(s,P),onChange:R=>v(Sz(s,R)),getControlProps:R=>{switch(R){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),o&&a.jsx("div",{"data-testid":"search-error",children:a.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),a.jsx(Rz,{search:e.search,visible:d.current.fieldEditorVisible,onOk:R=>{v(R),u({...d.current,fieldEditorVisible:!1})},onCancel:()=>{u({...d.current,fieldEditorVisible:!1})}}),a.jsx(_z,{search:e.search,visible:d.current.filterEditorVisible,onOk:R=>{v(R),u({...d.current,filterEditorVisible:!1})},onCancel:()=>{u({...d.current,filterEditorVisible:!1})}}),a.jsx(cz,{visible:d.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{u({...d.current,exportDialogVisible:!1})}}),a.jsx(Nz,{visible:d.current.filterDialogVisible,title:(L=c.filterDialogSearchParam)!=null&&L.code?Si(c.filterDialogSearchParam.code):"",resourceType:E,searchParam:c.filterDialogSearchParam,filter:c.filterDialogFilter,defaultValue:"",onOk:R=>{v(rh(e.search,R.code,R.operator,R.value)),u({...d.current,filterDialogVisible:!1})},onCancel:()=>{u({...d.current,filterDialogVisible:!1})}},(M=c.filterDialogSearchParam)==null?void 0:M.code)]})}const Kc=p.memo(Jz);function Zz(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?a.jsx("span",{children:"no filters"}):a.jsx(a.Fragment,{children:t.map(n=>a.jsxs("div",{children:[p0(n.operator)," ",a.jsx(LT,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function eB(e){return Math.floor((e.offset??0)/(e.count??Qf))+1}function tB(e,t){const n=e.count??Qf,r=zT(e,t);return Math.ceil(r/n)}function FT(e,t){return Math.min(zT(e,t),(e.offset??0)+1)}function nB(e,t){var n;return Math.max(FT(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function zT(e,t){var r,o;let n=t.total;return n===void 0&&(n=(e.offset??0)+(((r=t.entry)==null?void 0:r.length)??0)+((o=t.link)!=null&&o.some(i=>i.relation==="next")?1:0)),n}function rB(e){const t=ne(),[n,r]=p.useState(!1),[o,i]=p.useState(),{query:s,fields:l}=e,[c,u]=p.useState(),[d,f]=p.useState({}),h=p.useRef();h.current=c;const m=p.useRef({});m.current=d,p.useEffect(()=>{i(void 0),t.graphql(s).then(u).catch(w=>i(lt(w)))},[t,s]);function g(w,b){w.stopPropagation();const E=w.target.checked,P={...m.current};E?P[b]=!0:delete P[b],f(P)}function y(w){var T;w.stopPropagation();const j=w.target.checked,E={},P=(T=h.current)==null?void 0:T.data.ResourceList;j&&P&&P.forEach(D=>{D.id&&(E[D.id]=!0)}),f(E)}function S(){var b;const w=(b=h.current)==null?void 0:b.data.ResourceList;if(!w||w.length===0)return!1;for(const j of w)if(j.id&&!m.current[j.id])return!1;return!0}function v(w,b){eT(w.target)||(it(w),w.button!==1&&e.onClick&&e.onClick(new Fd(b,w)),w.button===1&&e.onAuxClick&&e.onAuxClick(new Fd(b,w)))}if(p.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return a.jsx(Vn,{});const x=e.checkboxesEnabled;return a.jsxs("div",{onContextMenu:w=>it(w),"data-testid":"search-control",children:[a.jsxs(le,{children:[a.jsx(le.Thead,{children:a.jsxs(le.Tr,{children:[x&&a.jsx(le.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:S(),onChange:w=>y(w)})}),l.map(w=>a.jsx(le.Th,{children:w.name},w.name))]})}),a.jsx(le.Tbody,{children:c==null?void 0:c.data.ResourceList.map(w=>w&&a.jsxs(le.Tr,{"data-testid":"search-control-row",onClick:b=>v(b,w),onAuxClick:b=>v(b,w),children:[x&&a.jsx(le.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${w.id}`,checked:!!d[w.id],onChange:b=>g(b,w.id)})}),l.map(b=>a.jsx(le.Td,{children:a.jsx(lz,{propertyType:b.propertyType,path:b.fhirPath,resource:w})},b.name))]},w.id))})]}),(c==null?void 0:c.data.ResourceList.length)===0&&a.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&a.jsx("div",{"data-testid":"search-error",children:a.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&a.jsx(te,{onClick:()=>e.onBulk(Object.keys(m.current)),children:"Bulk..."})]})}const oB=p.memo(rB);function Vr(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[a.jsx("title",{children:"Medplum Logo"}),a.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),a.jsx("path",{fill:e.fill??"#946af9",d:"M311 63c-17 0-33 4-48 11-16-7-32-11-49-11-87 0-158 96-158 214s71 214 158 214c17 0 33-4 49-11 15 7 31 11 48 11 87 0 158-96 158-214S398 63 311 63z"}),a.jsx("path",{fill:e.fill??"#7857c5",d:"M231 489l-17 2c-87 0-158-96-158-214S127 63 214 63l17 1c-39 12-70 102-70 213s31 201 70 212z"}),a.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),a.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function iB(e){const{group:t}=e;return a.jsx(zn,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:a.jsxs(Y,{children:[t.measureScore&&a.jsx(lB,{group:t}),!t.measureScore&&a.jsx(aB,{group:t})]})})}function sB(e){const{measure:t}=e;return a.jsxs(a.Fragment,{children:[a.jsx(se,{fz:"md",fw:500,mb:8,children:t.title}),a.jsx(se,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function aB(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(c=>wi(c.code)==="numerator"),o=n==null?void 0:n.find(c=>wi(c.code)==="denominator"),i=r==null?void 0:r.count,s=o==null?void 0:o.count;if(s===0)return a.jsxs(W,{children:[a.jsx(ue,{order:3,children:"Not Applicable"}),a.jsx(se,{children:`Denominator: ${s}`})]});if(i===void 0||s===void 0)return a.jsxs(W,{children:[a.jsx(ue,{order:3,children:"Insufficient Data"}),a.jsx(se,{children:`Numerator: ${i}`}),a.jsx(se,{children:`Denominator: ${s}`})]});const l=i/s*100;return a.jsx(Bf,{size:120,thickness:12,roundCaps:!0,sections:[{value:l,color:BT(l)}],label:a.jsx(rs,{justify:"center",children:a.jsxs(se,{fw:700,fz:18,children:[i," / ",s]})})})}function lB(e){var r,o,i;const{group:t}=e,n=((r=t.measureScore)==null?void 0:r.unit)??((o=t.measureScore)==null?void 0:o.code);return a.jsx(a.Fragment,{children:n==="%"?a.jsx(Bf,{size:120,thickness:12,roundCaps:!0,sections:[{value:cB(t),color:BT(((i=t==null?void 0:t.measureScore)==null?void 0:i.value)??0)}],label:a.jsx(rs,{justify:"center",children:a.jsx(se,{fw:700,fz:18,children:a.jsx(cc,{value:t.measureScore})})})}):a.jsx(rs,{h:120,align:"center",children:a.jsx(ue,{order:3,children:a.jsx(cc,{value:t.measureScore})})})})}function cB(e){var r,o;const t=(r=e.measureScore)==null?void 0:r.value,n=(o=e.measureScore)==null?void 0:o.unit;return t?t<=1&&n==="%"?t*100:t:0}function BT(e){return e<=33?"red":e<=67?"yellow":"green"}function uB(e){var r;const t=ct(e.measureReport),[n]=k7("Measure",{url:t==null?void 0:t.measure});return t?a.jsxs(W,{children:[n&&a.jsx(sB,{measure:n}),a.jsx(dv,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((o,i)=>a.jsx(iB,{group:o},o.id??i))})]}):null}function Wr(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:a.jsx(xs,{icon:a.jsx(zc,{size:16}),color:"red",children:t.map(r=>{var o;return a.jsx("div",{"data-testid":"text-field-error",children:uP(r)},(o=r.details)==null?void 0:o.text)})})}function dB(e){const t=p.useCallback((n,r,o)=>{const i=`${r}/${o}`,s=100;return Promise.allSettled([n.readHistory("Patient",o),n.search("Communication",{subject:i,_count:s}),n.search("Device",{patient:i,_count:s}),n.search("DeviceRequest",{patient:i,_count:s}),n.search("DiagnosticReport",{subject:i,_count:s}),n.search("Media",{subject:i,_count:s}),n.search("ServiceRequest",{subject:i,_count:s}),n.search("Task",{subject:i,_count:s})])},[]);return a.jsx(nh,{value:e.patient,loadTimelineResources:t,createCommunication:(n,r,o)=>({resourceType:"Communication",status:"completed",subject:ft(n),sender:ft(r),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(n,r,o)=>({resourceType:"Media",status:"completed",subject:ft(n),operator:ft(r),issued:new Date().toISOString(),content:o})})}const fB="_section_14dzq_2",hB="_hovering_14dzq_11",pB="_editing_14dzq_15",mB="_bottomActions_14dzq_20",oa={section:fB,hovering:hB,editing:pB,bottomActions:mB};function gB(e){const t=ne(),n=ct(e.value),[r,o]=p.useState(!1),[i,s]=p.useState(),[l,c]=p.useState(),[u,d]=p.useState();function f(){c(void 0)}function h(){s(void 0)}const m=p.useRef();if(m.current=u,p.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),p.useEffect(()=>(d(bB(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",f),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",f),document.removeEventListener("click",h)}),[n]),!r||!u)return null;function g(y,S){d({...m.current,[y]:S})}return a.jsx("div",{children:a.jsxs(We,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(u),children:[a.jsx(ae,{label:"Plan Title",defaultValue:u.title,onChange:y=>g("title",y.currentTarget.value)}),a.jsx(UT,{actions:u.action||[],selectedKey:i,setSelectedKey:s,hoverKey:l,setHoverKey:c,onChange:y=>g("action",y)}),a.jsx(te,{type:"submit",children:"Save"})]})})}function UT(e){const t=p.useRef();t.current=e.actions;function n(i){e.onChange(t.current.map(s=>s.id===i.id?i:s))}function r(i){e.onChange([...t.current,i]),e.setSelectedKey(i.id)}function o(i){e.onChange(t.current.filter(s=>s!==i))}return a.jsxs("div",{className:oa.section,children:[e.actions.map(i=>a.jsx("div",{children:a.jsx(yB,{action:i,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>o(i)})},i.id)),a.jsx("div",{className:oa.bottomActions,children:a.jsx(He,{href:"#",onClick:i=>{it(i),r({id:WT()})},children:"Add action"})})]})}function yB(e){const{action:t}=e,n=SB(t),r=e.selectedKey===e.action.id,o=e.hoverKey===e.action.id;function i(c){c.stopPropagation(),e.setSelectedKey(e.action.id)}function s(c){it(c),e.setHoverKey(e.action.id)}const l=et(oa.section,{[oa.editing]:r,[oa.hovering]:o&&!r});return a.jsxs("div",{"data-testid":t.id,className:l,onClick:i,onMouseOver:s,onFocus:s,children:[r?a.jsx(xB,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):a.jsx(vB,{action:t,actionType:n}),a.jsx("div",{className:oa.bottomActions,children:a.jsx(He,{href:"#",onClick:c=>{c.preventDefault(),e.onRemove()},children:"Remove"})})]})}const Am={path:"PlanDefinition.action.timing[x]",min:0,max:1,description:"",isArray:!1,constraints:[],type:["dateTime","Period","Range","Timing"].map(e=>({code:e}))};function vB(e){const{action:t,actionType:n}=e,[r,o]=VT(t);return a.jsxs("div",{children:[a.jsxs("div",{children:[t.title||"Untitled"," ",n&&`(${n})`]}),t.definitionCanonical&&a.jsx("div",{children:a.jsx(Ld,{value:{reference:t.definitionCanonical}})}),r&&a.jsx("div",{children:a.jsx(Fr,{property:Am,propertyType:o,value:r})})]})}function xB(e){const{action:t}=e,[n,r]=p.useState(e.actionType);function o(i,s){e.onChange({...t,[i]:s})}return a.jsxs(be,{gap:"xl",children:[a.jsx(ae,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:i=>o("title",i.currentTarget.value)}),a.jsx(ae,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:i=>o("description",i.currentTarget.value)}),a.jsx(wt,{label:"Type of Action",description:"The type of the action to be performed.",name:`actionType-${t.id}`,defaultValue:n,onChange:i=>r(i.currentTarget.value),data:["","appointment","lab","questionnaire","task"]}),t.action&&t.action.length>0&&a.jsx(UT,{actions:t.action,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:i=>o("action",i)}),(()=>{switch(n){case"appointment":return a.jsx(Du,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return a.jsx(Du,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return a.jsx(Du,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return a.jsx(Du,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),a.jsx(at,{title:"Timing",description:"When the action should take place.",children:a.jsx(wB,{name:"timing-"+t.id,action:t,onChange:e.onChange})})]})}function Du(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return a.jsx(Qa,{name:t,resourceType:e.resourceType,defaultValue:r,loadOnFocus:!0,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:ht(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function wB(e){const t=e.action,n="timing",[r,o]=VT(t);return a.jsx(Ka,{property:Am,name:"timing[x]",path:"PlanDefinition.timing[x]",defaultValue:r,defaultPropertyType:o,onChange:(i,s)=>{e.onChange(fT(t,n,s??n,Am,i))},outcome:void 0})}function SB(e){var t,n,r;if((t=e.definitionCanonical)!=null&&t.startsWith("Schedule"))return"appointment";if((n=e.definitionCanonical)!=null&&n.startsWith("Questionnaire/"))return"questionnaire";if((r=e.definitionCanonical)!=null&&r.startsWith("ActivityDefinition/"))return"task"}function VT(e){return Wc({type:"PlanDefinitionAction",value:e},"timing")}let lp=1;function WT(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(lp=Math.max(lp,t+1))}return e}return"id-"+lp++}function bB(e){return{...e,action:HT(e.action)}}function HT(e){if(e)return e.map(t=>({...t,id:WT(t.id),action:HT(t.action)}))}var ut=(e=>(e.group="group",e.display="display",e.question="question",e.boolean="boolean",e.decimal="decimal",e.integer="integer",e.date="date",e.dateTime="dateTime",e.time="time",e.string="string",e.text="text",e.url="url",e.choice="choice",e.openChoice="open-choice",e.attachment="attachment",e.reference="reference",e.quantity="quantity",e))(ut||{});function CB(e){return e.type==="choice"||e.type==="open-choice"}function EB(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const o=qT(t,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!(o!=null&&o.length)){if(n==="any")return!0;continue}const{anyMatch:i,allMatch:s}=TB(r,o,n);if(n==="any"&&i)return!0;if(n==="all"&&!s)return!1}return n!=="any"}function jB(e,t,n){return e.map(r=>{var s;const o=(s=n.answerOption)==null?void 0:s.find(l=>Es(l.valueCoding)===r||l[t]===r),i=Xt({type:"QuestionnaireItemAnswerOption",value:o},"value");return{[t]:i==null?void 0:i.value}})}function qT(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=qT(n.item,t);if(r)return r}}}function PB(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n==null?void 0:n.replace("=","~"):n,[{value:o}]=lc(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function TB(e,t,n){const r=t||[],o=Xt({type:"QuestionnaireItemEnableWhen",value:e},"answer[x]");let i=!1,s=!0;for(const l of r){const c=Xt({type:"QuestionnaireResponseItemAnswer",value:l},"value[x]"),{operator:u}=e;if(PB(c,o,u)?i=!0:s=!1,n==="any"&&i)break}return{anyMatch:i,allMatch:s}}function GT(e){var n,r;const t=Lc(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return(r=(n=t.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:r.map(o=>o.code)}}function cp(e,t){var o;const n=co(e);let r=Lc(n,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?(r&&(n.extension=(o=n.extension)==null?void 0:o.filter(i=>i!==r)),n):(r||(n.extension||(n.extension=[]),r={url:"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource"},n.extension.push(r)),t.length===1?(r.valueCode=t[0],delete r.valueCodeableConcept):(r.valueCodeableConcept={coding:t.map(i=>({code:i}))},delete r.valueCode),n)}function kB(e,t,n){const r=Lc(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter");if(!(r!=null&&r.valueString))return;let o=r.valueString;t!=null&&t.reference&&(o=o.replaceAll("$subj",t.reference)),n!=null&&n.reference&&(o=o.replaceAll("$encounter",n.reference));const i={},s=o.split("&");for(const l of s){const[c,u]=PL(l,"=",2);i[c]=u}return i}function RB(e){return{resourceType:"QuestionnaireResponse",questionnaire:ht(e),item:QT(e.item),status:"in-progress"}}function QT(e){return(e==null?void 0:e.map(KT))??[]}function KT(e){var t;return{id:IB(),linkId:e.linkId,text:e.text,item:QT(e.item),answer:((t=e.initial)==null?void 0:t.map(_B))??[]}}let DB=1;function IB(){return"id-"+DB++}function _B(e){return{...e}}function AB(e){return e.value.display||e.value.reference||tr(e.value)}function NB(e){var n,r,o,i;const t=(n=e==null?void 0:e.item)==null?void 0:n[0];if(t){const s=Lc(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((i=(o=(r=s==null?void 0:s.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code)==="page")return e.item.length}return 1}const YT=p.createContext({});function Nm(e){const t=p.useContext(YT),n=e.item,r=e.response;function o(u){var f,h,m,g;let d;Array.isArray(u)?d=u:e.index>=(((h=(f=e.response)==null?void 0:f.answer)==null?void 0:h.length)??0)?d=(((m=e.response)==null?void 0:m.answer)??[]).concat([u]):d=(((g=e.response)==null?void 0:g.answer)??[]).map((S,v)=>v===e.index?u:S)??[],e.onChange({id:r==null?void 0:r.id,linkId:r==null?void 0:r.linkId,text:n.text,answer:d})}const i=n.type;if(!i)return null;const s=n.linkId;if(!s)return null;const l=n.initial&&n.initial.length>0?n.initial[0]:void 0,c=m0(r,e.index)??Xt({type:"QuestionnaireItemInitial",value:l},"value");switch(i){case ut.display:return a.jsx("p",{children:e.item.text},e.item.linkId);case ut.boolean:return a.jsx(uT,{title:e.item.text,htmlFor:e.item.linkId,children:a.jsx(gr,{id:e.item.linkId,name:e.item.linkId,defaultChecked:c==null?void 0:c.value,onChange:u=>o({valueBoolean:u.currentTarget.checked})})},e.item.linkId);case ut.decimal:return a.jsx(ae,{type:"number",step:"any",id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDecimal:u.currentTarget.valueAsNumber})});case ut.integer:return a.jsx(ae,{type:"number",step:1,id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueInteger:u.currentTarget.valueAsNumber})});case ut.date:return a.jsx(ae,{type:"date",id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDate:u.currentTarget.value})});case ut.dateTime:return a.jsx(as,{name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDateTime:u})});case ut.time:return a.jsx(ae,{type:"time",id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueTime:u.currentTarget.value})});case ut.string:case ut.url:return a.jsx(ae,{id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case ut.text:return a.jsx(ws,{id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case ut.attachment:return a.jsx(Y,{py:4,children:a.jsx(rT,{name:s,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueAttachment:u})})});case ut.reference:return a.jsx(eh,{name:s,required:n.required,targetTypes:GT(n),searchCriteria:kB(n,t.subject,t.encounter),defaultValue:c==null?void 0:c.value,onChange:u=>o({valueReference:u})});case ut.quantity:return a.jsx(ls,{name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueQuantity:u}),disableWheel:!0});case ut.choice:case ut.openChoice:return zB(n)&&!n.answerValueSet?a.jsx(OB,{name:s,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)}):a.jsx(MB,{name:s,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)});default:return null}}function OB(e){var c;const{name:t,item:n,initial:r,response:o}=e;if(!((c=n.answerOption)!=null&&c.length))return a.jsx(XT,{});const i=Xt({type:"QuestionnaireItemInitial",value:r},"value"),s=[""];for(const u of n.answerOption){const d=Xt({type:"QuestionnaireItemAnswerOption",value:u},"value");s.push(Pw(d))}const l=m0(o)??i;if(n.repeats){const{propertyName:u,data:d}=BB(e.item),f=$B(o);return a.jsx(Of,{data:d,placeholder:"Select items",searchable:!0,defaultValue:f||[Pw(i)],onChange:h=>{const m=jB(h,u,n);e.onChangeAnswer(m)}})}return a.jsx(wt,{id:t,name:t,onChange:u=>{const d=u.currentTarget.selectedIndex;if(d===0){e.onChangeAnswer({});return}const f=n.answerOption[d-1],h=Xt({type:"QuestionnaireItemAnswerOption",value:f},"value"),m="value"+Vt(h.type);e.onChangeAnswer({[m]:h.value})},defaultValue:Es(l==null?void 0:l.value)||(l==null?void 0:l.value),data:s})}function MB(e){var s;const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e;return!((s=n.answerOption)!=null&&s.length)&&!n.answerValueSet?a.jsx(XT,{}):n.answerValueSet?a.jsx(hT,{name:t,binding:n.answerValueSet,onChange:l=>o({valueCoding:l}),creatable:n.type===ut.openChoice}):a.jsx(LB,{name:(i==null?void 0:i.id)??t,item:n,initial:r,response:i,onChangeAnswer:o})}function LB(e){const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e,s=js("QuestionnaireItemAnswerOption","value[x]"),l=Xt({type:"QuestionnaireItemInitial",value:r},"value"),c=[];let u;if(n.answerOption)for(let h=0;h<n.answerOption.length;h++){const m=n.answerOption[h],g=`${t}-option-${h}`,y=Xt({type:"QuestionnaireItemAnswerOption",value:m},"value");y!=null&&y.value&&(l&&tr(y)===tr(l)&&(u=g),c.push([g,y]))}const d=m0(i),f=FB(c,d);return a.jsx(oc.Group,{name:t,value:f??u,onChange:h=>{const m=c.find(g=>g[0]===h);if(m){const g=m[1],y="value"+Vt(g.type);o({[y]:g.value})}},children:c.map(([h,m])=>a.jsx(oc,{id:h,value:h,py:4,label:a.jsx(Fr,{property:s,propertyType:m.type,value:m.value})},h))})}function XT(){return a.jsx(ae,{disabled:!0,placeholder:"No Answers Defined"})}function JT(e){return Xt({type:"QuestionnaireItemAnswer",value:e},"value")}function m0(e,t=0){const n=e.answer;return JT((n==null?void 0:n[t])??{})}function $B(e){const t=e.answer;return t?t.map(r=>JT(r)).map(r=>Es(r==null?void 0:r.value)||(r==null?void 0:r.value)):[]}function FB(e,t){var n;return(n=e.find(r=>$c(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function Pw(e){if(e)return e.type==="CodeableConcept"?wi(e.value):e.type==="Coding"?Es(e.value):e.type==="Reference"?AB(e):e.value.toString()}function zB(e){var t;return!!((t=e.extension)!=null&&t.some(n=>{var r,o,i;return n.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"&&((i=(o=(r=n.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code)==="drop-down"}))}function BB(e){var i;if(((i=e.answerOption)==null?void 0:i.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=Xt({type:"QuestionnaireItemAnswerOption",value:t},"value"),r="value"+Vt(n.type),o=(e.answerOption??[]).map(s=>({value:Tw(s,r),label:Tw(s,r)}));return{propertyName:r,data:o}}function Tw(e,t){var n;return Es(e.valueCoding)||((n=e[t])==null?void 0:n.toString())}const UB="_section_cpwxo_1",VB="_hovering_cpwxo_10",WB="_editing_cpwxo_14",HB="_questionBody_cpwxo_19",qB="_topActions_cpwxo_23",GB="_bottomActions_cpwxo_32",QB="_movementActions_cpwxo_43",KB="_movementIcons_cpwxo_55",YB="_columnAlignment_cpwxo_59",XB="_linkIdInput_cpwxo_64",JB="_typeSelect_cpwxo_69",ar={section:UB,hovering:VB,editing:WB,questionBody:HB,topActions:qB,bottomActions:GB,movementActions:QB,movementIcons:KB,columnAlignment:YB,linkIdInput:XB,typeSelect:JB};function ZB(e){const t=ne(),n=ct(e.questionnaire),[r,o]=p.useState(!1),[i,s]=p.useState(),[l,c]=p.useState(),[u,d]=p.useState();function f(){d(void 0)}function h(){c(void 0)}p.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),p.useEffect(()=>(s(rU(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",f),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",f),document.removeEventListener("click",h)}),[n]);const m=(g,y)=>{s(g),e.autoSave&&!y&&e.onSubmit&&e.onSubmit(g)};return!r||!i?null:a.jsx("div",{children:a.jsxs(We,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(i),children:[a.jsx(ZT,{item:i,selectedKey:l,setSelectedKey:c,hoverKey:u,setHoverKey:d,onChange:m}),a.jsx(te,{type:"submit",children:"Save"})]})})}function ZT(e){var w;const t=e.item,n=e.item,r=Uo(e.item),o=r||n.type===ut.group,i=n.linkId??"[untitled]",s=e.selectedKey===e.item.id,l=e.hoverKey===e.item.id,c=p.useRef();c.current=e.item;function u(b){it(b),e.setSelectedKey(e.item.id)}function d(b){it(b),e.setHoverKey(e.item.id)}function f(b){var E;const j=c.current;e.onChange({...j,item:(E=j.item)==null?void 0:E.map(P=>P.id===b.id?b:P)})}function h(b,j){e.onChange({...e.item,item:[...e.item.item??[],b]},j)}function m(b){var j;e.onChange({...e.item,item:(j=e.item.item)==null?void 0:j.filter(E=>E!==b)})}function g(b,j){e.onChange({...c.current,[b]:j})}function y(b){e.onChange({...e.item,...b})}function S(b){var j;e.onChange({...e.item,item:(j=e.item.item)==null?void 0:j.map(E=>E===b?{...E,repeats:!E.repeats}:E)})}function v(b,j){const E=sU(e.item.item,b,j);e.onChange({...e.item,item:E})}const x=et(ar.section,{[ar.editing]:s,[ar.hovering]:l&&!s});return a.jsxs("div",{"data-testid":n.linkId,className:x,onClick:u,onMouseOver:d,onFocus:d,children:[a.jsx("div",{className:ar.questionBody,children:s?a.jsxs(a.Fragment,{children:[r&&a.jsx(ae,{size:"xl",defaultValue:t.title,onBlur:b=>g("title",b.currentTarget.value)}),!r&&a.jsx(ws,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:b=>g("text",b.currentTarget.value)}),n.type==="reference"&&a.jsx(nU,{item:n,onChange:y}),CB(n)&&a.jsx(eU,{item:n,onChange:b=>y(b)})]}):a.jsxs(a.Fragment,{children:[t.title&&a.jsx(ue,{children:t.title}),n.text&&a.jsx("div",{children:n.text}),!o&&a.jsx(Nm,{item:n,index:0,onChange:()=>{},response:{linkId:n.linkId}})]})}),(w=n.item)==null?void 0:w.map((b,j)=>a.jsx("div",{children:a.jsx(ZT,{item:b,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:j===0,isLast:j===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:f,onRemove:()=>m(b),onRepeatable:S,onMoveUp:()=>v(j,-1),onMoveDown:()=>v(j,1)})},b.id)),!o&&a.jsx("div",{className:ar.topActions,children:s?a.jsxs(a.Fragment,{children:[a.jsx(ae,{size:"xs",className:ar.linkIdInput,defaultValue:n.linkId,onBlur:b=>g("linkId",b.currentTarget.value)}),!o&&a.jsx(wt,{size:"xs",className:ar.typeSelect,defaultValue:n.type,onChange:b=>g("type",b.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):a.jsx("div",{children:i})}),!r&&a.jsx(W,{className:ar.movementActions,children:a.jsxs(W,{className:ar.columnAlignment,children:[!e.isFirst&&a.jsx(He,{href:"#",onClick:b=>{b.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:a.jsx(O7,{"data-testid":"up-button",size:15,className:ar.movementIcons})}),!e.isLast&&a.jsx(He,{href:"#",onClick:b=>{b.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:a.jsx(N7,{"data-testid":"down-button",size:15,className:ar.movementIcons})})]})}),a.jsxs("div",{className:ar.bottomActions,children:[o&&a.jsxs(a.Fragment,{children:[a.jsx(He,{href:"#",onClick:b=>{b.preventDefault(),h({id:us(),linkId:Lm("q"),type:"string",text:"Question"})},children:"Add item"}),a.jsx(He,{href:"#",onClick:b=>{b.preventDefault(),h({id:us(),linkId:Lm("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&a.jsx(He,{href:"#",onClick:b=>{b.preventDefault(),h(iU(),!0)},children:"Add Page"}),s&&!r&&a.jsxs(a.Fragment,{children:[a.jsx(He,{href:"#",onClick:b=>{b.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),a.jsx(He,{href:"#",onClick:b=>{b.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function eU(e){const t=js("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return a.jsxs("div",{children:[e.item.answerValueSet!==void 0?a.jsx(ae,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):a.jsx(tU,{options:n,property:t,item:e.item,onChange:e.onChange}),a.jsxs(W,{display:"flex",children:[a.jsx(He,{href:"#",onClick:r=>{it(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:us()}]})},children:"Add choice"}),a.jsx(Uf,{w:"lg"}),a.jsx(He,{href:"#",onClick:r=>{it(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function tU(e){return a.jsx("div",{children:e.options.map(t=>{const[n,r]=Wc({type:"QuestionnaireItemAnswerOption",value:t},"value");return a.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[a.jsx("div",{children:a.jsx(Ka,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(o,i)=>{const s=[...e.options],l=s.findIndex(c=>c.id===t.id);s[l]={id:t.id,[i]:o},e.onChange({...e.item,answerOption:s})},outcome:void 0},t.id)}),a.jsx("div",{children:a.jsx(He,{href:"#",onClick:o=>{it(o),e.onChange({...e.item,answerOption:e.options.filter(i=>i.id!==t.id)})},children:"Remove"})})]},t.id)})})}function nU(e){const t=GT(e.item)??[];return a.jsxs(a.Fragment,{children:[t.map((n,r)=>a.jsxs(Y,{children:[a.jsx(Gv,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(cp(e.item,t.map(i=>i===n?o:i)))}}),a.jsx(He,{href:"#",onClick:o=>{it(o),e.onChange(cp(e.item,t.filter(i=>i!==n)))},children:"Remove"})]},`${n}-${r}`)),a.jsx(He,{href:"#",onClick:n=>{it(n),e.onChange(cp(e.item,[...t,""]))},children:"Add Resource Type"})]})}let Om=1,Mm=1;function Lm(e){return e+Om++}function us(){return"id-"+Mm++}function rU(e){return{...e,id:e.id||us(),item:ek(e.item)}}function ek(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(Mm=Math.max(Mm,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(Om=Math.max(Om,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||us(),item:ek(t.item),answerOption:oU(t.answerOption)}))}function oU(e){if(e)return e.map(t=>({...t,id:t.id||us()}))}function iU(){return{id:us(),linkId:Lm("s"),type:"group",text:"New Page",extension:[{url:"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function sU(e,t,n){const r=e??[],o=t+n;if(o<0||o>=r.length)return r;const i=[...r];return[i[t],i[o]]=[i[o],i[t]],i}function tk(e){const{item:t,response:n,onChange:r}=e,[o,i]=p.useState(aU(t,n??{linkId:t.linkId}));if(!e.checkForQuestionEnabled(t)||!n)return null;if(t.type===ut.display)return a.jsx("p",{children:t.text},t.linkId);const s=(t==null?void 0:t.repeats)&&t.type!==ut.choice&&t.type!==ut.openChoice;return t.type===ut.boolean?a.jsx(Nm,{item:t,response:n,onChange:l=>r([l]),index:0},t.linkId):a.jsxs(at,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(o)].map((l,c)=>a.jsx(Nm,{item:t,response:n,onChange:u=>r([u]),index:c},`${t.linkId}-${c}`)),s&&a.jsx(He,{onClick:()=>i(l=>l+1),children:"Add Item"})]},e.item.linkId)}function aU(e,t){if(e.type===ut.choice||e.type===ut.openChoice)return 1;const n=t.answer;return n!=null&&n.length?n.length:1}function nk(e){const[t,n]=p.useState(e.response);if(t.length===0)return null;function r(i,s){const l=t.map((c,u)=>u===s?i[0]:c);n(l),e.onChange(l)}function o(){const i=KT(e.item);n([...t,i])}return a.jsxs(a.Fragment,{children:[t.map((i,s)=>a.jsx(rk,{item:e.item,response:i,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:l=>r(l,s)},i.id)),e.item.repeats&&a.jsx(He,{onClick:o,children:`Add Group: ${e.item.text}`})]})}function rk(e){var i;const{response:t,checkForQuestionEnabled:n,onChange:r}=e;function o(s){var d;const l=(d=t.item)==null?void 0:d.map(f=>s.find(m=>m.id===f.id)??f),c=l==null?void 0:l.concat(s.slice(1)),u={...t,item:c};r([u])}return e.checkForQuestionEnabled(e.item)?a.jsxs("div",{children:[e.item.text&&a.jsx(ue,{order:3,mb:"md",children:e.item.text}),a.jsx(be,{children:(i=e.item.item)==null?void 0:i.map(s=>{var l,c,u;return s.type===ut.group?s.repeats?a.jsx(nk,{item:s,response:((l=t.item)==null?void 0:l.filter(d=>d.linkId===s.linkId))??[],checkForQuestionEnabled:n,onChange:o},s.linkId):a.jsx(rk,{item:s,checkForQuestionEnabled:n,response:((c=t.item)==null?void 0:c.find(d=>d.linkId===s.linkId))??{linkId:s.linkId},onChange:o},s.linkId):a.jsx(tk,{item:s,response:(u=t.item)==null?void 0:u.find(d=>d.linkId===s.linkId),onChange:o,checkForQuestionEnabled:n},s.linkId)})})]},e.item.linkId):null}function lU(e){const{items:t,response:n,activePage:r,onChange:o,nextStep:i,prevStep:s,numberOfPages:l,renderPages:c,submitButtonText:u,checkForQuestionEnabled:d}=e,f=t.map(h=>{var y;const m=((y=n==null?void 0:n.item)==null?void 0:y.filter(S=>S.linkId===h.linkId))??[],g=h.type===ut.group?a.jsx(nk,{item:h,response:m,onChange:o,checkForQuestionEnabled:d},h.linkId):a.jsx(tk,{item:h,response:m==null?void 0:m[0],onChange:o,checkForQuestionEnabled:d},h.linkId);return c?a.jsx(Ra.Step,{label:h.text,children:g},h.linkId):g});return a.jsxs(a.Fragment,{children:[c&&a.jsx(Ra,{active:r??0,allowNextStepsSelect:!1,p:6,children:f}),!c&&a.jsx(be,{children:f}),a.jsx(cU,{activePage:r??0,numberOfPages:l,nextStep:i,prevStep:s,submitButtonText:u})]})}function cU(e){const t=e.activePage>0,n=e.activePage<e.numberOfPages-1,r=e.activePage===e.numberOfPages-1;return a.jsxs(Y,{justify:"flex-end",mt:"xl",gap:"xs",children:[t&&a.jsx(te,{onClick:e.prevStep,children:"Back"}),n&&a.jsx(te,{onClick:o=>{o.currentTarget.closest("form").reportValidity()&&e.nextStep()},children:"Next"}),r&&a.jsx(te,{type:"submit",children:e.submitButtonText??"Submit"})]})}function ok(e){const t=ne(),n=t.getProfile(),[r,o]=p.useState(!1),i=ct(e.questionnaire),[s,l]=p.useState(),[c,u]=p.useState(0);p.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>t.requestSchema("QuestionnaireResponse")).then(()=>o(!0)).catch(console.log)},[t]),p.useEffect(()=>{l(i?RB(i):void 0)},[i]);function d(y){const S=(s==null?void 0:s.item)??[],x={resourceType:"QuestionnaireResponse",status:"in-progress",item:ik(S,Array.isArray(y)?y:[y])};l(x)}function f(y){return EB(y,(s==null?void 0:s.item)??[])}if(!r||!i||!s)return null;const h=NB(i),m=()=>u(y=>y+1),g=()=>u(y=>y-1);return a.jsx(YT.Provider,{value:{subject:e.subject,encounter:e.encounter},children:a.jsxs(We,{testid:"questionnaire-form",onSubmit:()=>{e.onSubmit&&s&&e.onSubmit({...s,questionnaire:ht(i),subject:e.subject,source:ft(n),authored:new Date().toISOString(),status:"completed"})},children:[i.title&&a.jsx(ue,{children:i.title}),a.jsx(lU,{items:i.item??[],response:s,onChange:d,renderPages:h>1,activePage:c,numberOfPages:h,submitButtonText:e.submitButtonText,checkForQuestionEnabled:f,nextStep:m,prevStep:g})]})})}function uU(e,t){const n=ik(e.item??[],t.item??[]);return{...t,item:n.length>0?n:void 0,answer:t.answer&&t.answer.length>0?t.answer:e.answer}}function ik(e,t){const n=[],r=new Set;for(const o of e){const i=o.id,s=t.find(l=>l.id===i);s?(n.push(uU(o,s)),r.add(s.id)):n.push(o)}for(const o of t)r.has(o.id)||n.push(o);return n}const dU="_section_4m5it_1",fU={section:dU},hU=["gender","age","gestationalAge","context","appliesTo","category"],pU={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function mU(e){e=Object.assign(pU,e);const t=e.definition,[n,r]=p.useState([]),[o,i]=p.useState(1),[s,l]=p.useState(1);return p.useEffect(()=>{const g=vU(t,l);r(xU(g.qualifiedInterval||[],i))},[t]),a.jsxs(We,{testid:"reference-range-editor",onSubmit:c,children:[a.jsx(be,{children:n.map(g=>{var y;return a.jsx(gU,{unit:SU((y=t.quantitativeDetails)==null?void 0:y.unit),onChange:f,onAdd:h,onRemove:m,onRemoveGroup:d,intervalGroup:g},`group-${g.id}`)})}),a.jsx(qt,{title:"Add Group",variant:"subtle",size:"sm",onClick:g=>{it(g),u({id:`group-id-${o}`,filters:{},intervals:[]}),i(y=>y+1)},children:a.jsx(Od,{})}),a.jsx(Y,{justify:"flex-end",children:a.jsx(te,{type:"submit",children:"Save"})})]});function c(){const g=n.flatMap(y=>y.intervals).filter(y=>!bU(y));e.onSubmit({...t,qualifiedInterval:g})}function u(g){r(y=>[...y,g])}function d(g){r(y=>y.filter(S=>S.id!==g.id))}function f(g,y){r(S=>{S=[...S];const v=S.find(w=>w.id===g),x=v==null?void 0:v.intervals.findIndex(w=>w.id===y.id);return x!==void 0&&(v!=null&&v.intervals[x])&&(v.intervals[x]=y),S})}function h(g,y){y.id===void 0&&(y.id=`id-${s}`,l(S=>S+1)),r(S=>{S=[...S];const v=S.findIndex(x=>x.id===g);if(v!==-1){const x={...S[v]};y={...y,...x.filters},x.intervals=[...x.intervals,y],S[v]=x}return S})}function m(g,y){r(S=>{S=[...S];const v=S.find(x=>x.id===g);return v&&(v.intervals=v.intervals.filter(x=>x.id!==y.id)),S})}}function gU(e){const{intervalGroup:t,unit:n}=e;return a.jsx(qc,{"data-testid":t.id,className:fU.section,children:a.jsxs(be,{gap:"lg",children:[a.jsx(Y,{justify:"flex-end",children:a.jsx(qt,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{it(r),e.onRemoveGroup(t)},children:a.jsx(Nd,{})},`remove-group-button-${t.id}`)}),a.jsx(yU,{intervalGroup:t,onChange:e.onChange}),a.jsx(fn,{}),t.intervals.map(r=>a.jsxs(be,{gap:"xs",children:[a.jsxs(Y,{children:[a.jsx(ae,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{it(o),e.onChange(t.id,{...r,condition:o.currentTarget.value.trim()})}},`condition-${r.id}`),a.jsx(qt,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:o=>{it(o),e.onRemove(t.id,r)},children:a.jsx(Nd,{})},`remove-interval-${r.id}`)]}),a.jsx(Xv,{onChange:o=>{e.onChange(t.id,{...r,range:o})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),a.jsx(qt,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{it(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:a.jsx(Od,{})})]})})}function yU(e){var r,o;const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const i of["low","high"])(r=t.filters.age[i])!=null&&r.unit||(t.filters.age[i]={...t.filters.age[i],unit:"years",system:"http://unitsofmeasure.org"});return a.jsxs(be,{style:{maxWidth:"50%"},children:[a.jsx(Y,{children:a.jsx(wt,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:i=>{for(const s of t.intervals){let l=i.currentTarget.value;l===""&&(l=void 0),n(t.id,{...s,gender:l})}}})}),a.jsxs(Y,{gap:"xs",children:[a.jsx(se,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),a.jsx("div",{id:`div-age-${t.id}`,children:a.jsx(Xv,{name:`age-${t.id}`,defaultValue:t.filters.age,onChange:i=>{for(const s of t.intervals)n(t.id,{...s,age:i})}},`age-${t.id}`)})]}),a.jsx(wt,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((o=t.filters.context)==null?void 0:o.text)||"",onChange:i=>{for(const s of t.intervals){let l=i.currentTarget.value;l===""?(l=void 0,n(t.id,{...s,context:void 0})):n(t.id,{...s,context:{text:l,coding:[{code:l,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),a.jsx(wt,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:i=>{for(const s of t.intervals){const l=i.currentTarget.value;l===""?n(t.id,{...s,category:void 0}):n(t.id,{...s,category:l})}}})]})}function vU(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(o=>{var s;const i=parseInt(((s=o.id)==null?void 0:s.substring(3))||"",10);return isNaN(i)?Number.NEGATIVE_INFINITY:i}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(o=>({...o,id:o.id||`id-${r++}`}))},t(r),e}function xU(e,t){let n=1;const r={};for(const o of e){const i=wU(o);i in r||(r[i]={id:`group-id-${n++}`,filters:Object.fromEntries(hU.map(s=>[s,o[s]])),intervals:[]}),r[i].intervals.push(o)}return t(n),Object.values(r)}function wU(e){var n,r;return[`gender=${e.gender}`,`age=${sc(e.age)}`,`gestationalAge=${sc(e.gestationalAge)}`,`context=${(n=e.context)==null?void 0:n.text}`,`appliesTo=${(r=e.appliesTo)==null?void 0:r.map(o=>o.text).join("+")}`,`category=${e.category}`].join(":")}function SU(e){return e&&(EL(e,"http://unitsofmeasure.org")||e.text)}function bU(e){var t,n,r,o;return((n=(t=e.range)==null?void 0:t.low)==null?void 0:n.value)===void 0&&((o=(r=e.range)==null?void 0:r.high)==null?void 0:o.value)===void 0}function CU(e){var u;const t=ne(),n=ct(e.value),[r,o]=p.useState(!1),[i,s]=p.useState();if(p.useEffect(()=>{n&&!r&&(t.executeBatch(l(n)).then(s).catch(console.log),o(!0))},[t,n,r]),!n||!i)return null;return a.jsx(Kn,{children:(u=n.action)==null?void 0:u.map((d,f)=>{var y,S,v,x,w,b;const h=d.resource&&c(d.resource),m=(S=(y=h==null?void 0:h.input)==null?void 0:y[0])==null?void 0:S.valueReference,g=(x=(v=h==null?void 0:h.output)==null?void 0:v[0])==null?void 0:x.valueReference;return a.jsxs(p.Fragment,{children:[a.jsx(Kn.Col,{span:1,p:"md",children:(h==null?void 0:h.status)==="completed"?a.jsx(W7,{}):a.jsx(g6,{color:"gray"})}),a.jsxs(Kn.Col,{span:9,p:"xs",children:[a.jsx(se,{fw:500,children:d.title}),d.description&&a.jsx("div",{children:d.description}),a.jsxs("div",{children:["Last edited by ",a.jsx(Ya,{value:(w=h==null?void 0:h.meta)==null?void 0:w.author})," on ",jn((b=h==null?void 0:h.meta)==null?void 0:b.lastUpdated)]}),a.jsxs("div",{children:["Status: ",a.jsx(t0,{status:(h==null?void 0:h.status)||"unknown"})]})]}),a.jsxs(Kn.Col,{span:2,p:"md",children:[m&&!g&&a.jsx(te,{onClick:()=>e.onStart(h,m),children:"Start"}),m&&g&&a.jsx(te,{onClick:()=>e.onEdit(h,m,g),children:"Edit"})]})]},`action-${f}`)})});function l(d){var h;const f=[];if(d.action)for(const m of d.action)(h=m.resource)!=null&&h.reference&&f.push({request:{method:"GET",url:m.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:f}}function c(d){for(const f of i==null?void 0:i.entry)if(f.resource&&d.reference===ht(f.resource))return f.resource}}function sk(e,t){const n=EU(e,t);return jU(n,e,t)}function EU(e,t){const n=e.length,r=t.length,o=n+r+1,i=1+2*o,s=i/2|0,l=new Array(i);l[s+1]={i:0,j:-1,prev:void 0,snake:!0};for(let c=0;c<o;c++){for(let u=-c;u<=c;u+=2){const d=s+u,f=d+1,h=d-1,m=l[f],g=l[h];let y,S=0;u===-c||u!==c&&g.i<m.i?(S=m.i,y=m):(S=g.i+1,y=g),l[h]=void 0;let v=S-u,x={i:S,j:v,prev:PU(y),snake:!1};for(;S<n&&v<r&&e[S]===t[v];)S++,v++;if(S>x.i&&(x={i:S,j:v,prev:x,snake:!0}),l[d]=x,S>=n&&v>=r)return l[d]}l[s+c-1]=void 0}}function jU(e,t,n){const r=[];let o=e;for(o.snake&&(o=o.prev);o!=null&&o.prev&&o.prev.j>=0;){const i=o.i,s=o.j;o=o.prev;const l=o.i,c=o.j,u={position:l,lines:t.slice(l,i)},d={position:c,lines:n.slice(c,s)};let f;u.lines.length===0&&d.lines.length>0?f="insert":u.lines.length>0&&d.lines.length===0?f="delete":f="change",r.push({original:u,revised:d,type:f}),o.snake&&(o=o.prev)}return r}function PU(e){return e&&!e.snake&&e.prev?e.prev:e}function TU(e){const t=e.entry.filter(r=>!!r.resource).map(r=>{var o;return{meta:(o=r.resource)==null?void 0:o.meta,lines:tr(r.resource,!0).match(/[^\r\n]+/g)}}).sort((r,o)=>r.meta.lastUpdated.localeCompare(o.meta.lastUpdated)),n=t[0].lines.map(r=>({id:t[0].meta.versionId,meta:t[0].meta,value:r,span:1}));return kU(n,t),RU(n),n}function kU(e,t){for(let n=1;n<t.length;n++){const r=sk(t[n-1].lines,t[n].lines);for(const o of r){const i=o.original.position,s=o.original.lines,l=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(i,s.length),o.type==="insert"||o.type==="change")for(let c=0;c<o.revised.lines.length;c++)e.splice(i+c,0,{id:t[n].meta.versionId,meta:t[n].meta,value:l[c],span:1})}}}function RU(e){let t=0;for(;t<e.length;){let n=t;for(;n<e.length&&e[n].id===e[t].id;)e[n].span=-1,n++;e[t].span=n-t,t=n}}const DU="_container_1oj0p_1",IU="_root_1oj0p_5",_U="_startRow_1oj0p_20",AU="_normalRow_1oj0p_24",NU="_author_1oj0p_28",OU="_dateTime_1oj0p_32",MU="_lineNumber_1oj0p_37",LU="_line_1oj0p_37",$U="_pre_1oj0p_52",po={container:DU,root:IU,startRow:_U,normalRow:AU,author:NU,dateTime:OU,lineNumber:MU,line:LU,pre:$U};function FU(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function zU(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return zs(n,"year");const r=Math.floor(t/2592e3);if(r>0)return zs(r,"month");const o=Math.floor(t/86400);if(o>0)return zs(o,"day");const i=Math.floor(t/3600);if(i>0)return zs(i,"hour");const s=Math.floor(t/60);return s>0?zs(s,"minute"):zs(t,"second")}function zs(e,t){return`${e} ${e===1?t:t+"s"} ago`}function BU(e){var s,l;const t=ne(),[n,r]=p.useState(e.history);if(p.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),!n)return a.jsx("div",{children:"Loading..."});const o=(l=(s=n.entry)==null?void 0:s[0])==null?void 0:l.resource;if(!o)return null;const i=TU(n);return a.jsx("div",{className:po.container,children:a.jsx("table",{className:po.root,children:a.jsx("tbody",{children:i.map((c,u)=>a.jsxs("tr",{className:c.span>0?po.startRow:po.normalRow,children:[c.span>0&&a.jsxs(a.Fragment,{children:[a.jsx("td",{className:po.author,rowSpan:c.span,children:a.jsx(ma,{value:c.meta.author,link:!0})}),a.jsx("td",{className:po.dateTime,rowSpan:c.span,children:a.jsx(Fe,{to:FU(o,c.meta.versionId),children:zU(c.meta.lastUpdated)})})]}),a.jsx("td",{className:po.lineNumber,children:u+1}),a.jsx("td",{className:po.line,children:a.jsx("pre",{className:po.pre,children:c.value})})]},"row-"+u))})})})}const UU="_removed_mgz0k_2",VU="_added_mgz0k_7",kw={removed:UU,added:VU};function WU(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=tr(t,!0).match(/[^\r\n]+/g),o=tr(n,!0).match(/[^\r\n]+/g),i=sk(r,o);return a.jsx("pre",{style:{color:"gray"},children:i.map((s,l)=>a.jsx(HU,{delta:s},"delta"+l))})}function HU(e){return a.jsxs(a.Fragment,{children:["...",a.jsx("br",{}),e.delta.original.lines.length>0&&a.jsx("div",{className:kw.removed,children:e.delta.original.lines.join(`
515
+ `)}),e.delta.revised.lines.length>0&&a.jsx("div",{className:kw.added,children:e.delta.revised.lines.join(`
516
+ `)}),"...",a.jsx("br",{})]})}function zd(e){const{outcome:t}=e,n=ne(),r=ct(e.defaultValue),[o,i]=p.useState(),[s,l]=p.useState();return p.useEffect(()=>{if(r)if(e.profileUrl){const c=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const u=Cs(c);if(u){i(u.name);const d=C7(r,u);l(d)}else console.error(`Schema not found for ${c}`)}).catch(u=>{console.error("Error in requestProfileSchema",u)})}else{const c=e.schemaName??(r==null?void 0:r.resourceType);n.requestSchema(c).then(()=>{l(r),i(c)}).catch(console.log)}},[n,r,e.schemaName,e.profileUrl]),!o||!s?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:c=>{c.preventDefault(),e.onSubmit&&e.onSubmit(s)},children:[a.jsxs(be,{mb:"xl",children:[a.jsx(at,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:a.jsx(ae,{name:"resourceType",defaultValue:s.resourceType,disabled:!0})}),a.jsx(at,{title:"ID",htmlFor:"id",outcome:t,children:a.jsx(ae,{name:"id",defaultValue:s.id,disabled:!0})})]}),a.jsx(e0,{path:s.resourceType,typeName:o,defaultValue:s,outcome:t,onChange:l,profileUrl:e.profileUrl}),a.jsxs(Y,{justify:"flex-end",mt:"xl",children:[a.jsx(te,{type:"submit",children:"OK"}),e.onDelete&&a.jsx(te,{variant:"outline",color:"red",type:"button",onClick:()=>{e.onDelete(s)},children:"Delete"})]})]})}function qU(e){var o;const t=ne(),[n,r]=p.useState(e.history);return p.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),n?a.jsxs(le,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx(le.Thead,{children:a.jsxs(le.Tr,{children:[a.jsx(le.Th,{children:"Author"}),a.jsx(le.Th,{children:"Date"}),a.jsx(le.Th,{children:"Version"})]})}),a.jsx(le.Tbody,{children:(o=n.entry)==null?void 0:o.map((i,s)=>a.jsx(GU,{entry:i},"entry-"+s))})]}):a.jsx("div",{children:"Loading..."})}function GU(e){var r,o,i;const{response:t,resource:n}=e.entry;return n?a.jsxs(le.Tr,{children:[a.jsx(le.Td,{children:a.jsx(ma,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),a.jsx(le.Td,{children:jn((o=n.meta)==null?void 0:o.lastUpdated)}),a.jsx(le.Td,{children:a.jsx(Fe,{to:QU(n),children:(i=n.meta)==null?void 0:i.versionId})})]}):a.jsx(le.Tr,{children:a.jsx(le.Td,{colSpan:3,children:Te(t==null?void 0:t.outcome)})})}function QU(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function KU(e){return a.jsx(nh,{value:e.serviceRequest,loadTimelineResources:async(t,n,r)=>{const o=`${n}/${r}`,i=100;return Promise.allSettled([t.readHistory("ServiceRequest",r),t.search("Communication",{"based-on":o,_count:i}),t.search("DiagnosticReport",{"based-on":o,_count:i}),t.search("Media",{"based-on":o,_count:i}),t.search("DocumentReference",{related:o,_count:i}),t.search("Task",{_filter:`based-on eq ${o} or focus eq ${o} or subject eq ${o}`,_count:i})])},createCommunication:(t,n,r)=>({resourceType:"Communication",status:"completed",basedOn:[ft(t)],subject:t.subject,sender:ft(n),sent:new Date().toISOString(),payload:[{contentString:r}]}),createMedia:(t,n,r)=>({resourceType:"Media",status:"completed",basedOn:[ft(t)],subject:t.subject,operator:ft(n),issued:new Date().toISOString(),content:r})})}function YU(e){const t=ne(),{client:n,patient:r,encounter:o,children:i,...s}=e;function l(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:o}).then(c=>{const u=new URL(n.launchUri);u.searchParams.set("iss",t.getBaseUrl()+"fhir/R4"),u.searchParams.set("launch",c.id),window.location.assign(u.toString())}).catch(c=>fe({color:"red",message:Te(c),autoClose:!1}))}return a.jsx(He,{onClick:()=>l(),...s,children:i})}function ak(e){const t=ne(),[n,r]=p.useState();return a.jsxs(We,{style:{maxWidth:400},onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(i){r(lt(i))}},children:[a.jsxs(on,{style:{flexDirection:"column"},children:[a.jsx(Vr,{size:32}),a.jsx(ue,{children:"Create project"})]}),a.jsxs(be,{gap:"xl",children:[a.jsx(ae,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:ze(n,"firstName")}),a.jsxs(se,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(He,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(He,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),a.jsx(Y,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(te,{type:"submit",children:"Create project"})})]})}function lk(e,t){const n=document.getElementsByTagName("head")[0],r=document.createElement("script");r.async=!0,r.src=e,r.onload=t??null,n.appendChild(r)}function ck(e){const t=ne(),{googleClientId:n,handleGoogleCredential:r}=e,o=p.useRef(null),[i,s]=p.useState(typeof google<"u"),[l,c]=p.useState(!1),[u,d]=p.useState(!1);return p.useEffect(()=>{if(typeof google>"u"){lk("https://accounts.google.com/gsi/client",()=>s(!0));return}l||(google.accounts.id.initialize({client_id:n,callback:r}),c(!0)),o.current&&!u&&(google.accounts.id.renderButton(o.current,{}),d(!0))},[t,n,l,i,o,u,r]),n?a.jsx("div",{ref:o}):null}var XU={MEDPLUM_BASE_URL:"__MEDPLUM_BASE_URL__",MEDPLUM_CLIENT_ID:"__MEDPLUM_CLIENT_ID__",GOOGLE_CLIENT_ID:"__GOOGLE_CLIENT_ID__",RECAPTCHA_SITE_KEY:"__RECAPTCHA_SITE_KEY__",MEDPLUM_REGISTER_ENABLED:"__MEDPLUM_REGISTER_ENABLED__",MEDPLUM_VERSION:"3.0.12-787031d28",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function uk(e){var t;if(e)return e;if(typeof window<"u"){const n=window.location.protocol+"//"+window.location.host;if((((t=XU.GOOGLE_AUTH_ORIGINS)==null?void 0:t.split(","))??[]).includes(n))return"__GOOGLE_CLIENT_ID__"}}function dk(e){typeof grecaptcha>"u"&&lk("https://www.google.com/recaptcha/api.js?render="+e)}function fk(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function JU(e){const t=uk(e.googleClientId),n=e.recaptchaSiteKey,r=ne(),[o,i]=p.useState(),s=Hc(o,void 0);return p.useEffect(()=>{n&&dk(n)},[n]),a.jsxs(We,{style:{maxWidth:400},onSubmit:async l=>{try{let c="";n&&(c=await fk(n)),e.handleAuthResponse(await r.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:l.firstName,lastName:l.lastName,email:l.email,password:l.password,remember:l.remember==="true",recaptchaSiteKey:n,recaptchaToken:c}))}catch(c){i(lt(c))}},children:[a.jsx(on,{style:{flexDirection:"column"},children:e.children}),a.jsx(Wr,{issues:s}),t&&a.jsxs(a.Fragment,{children:[a.jsx(Y,{justify:"center",p:"xl",style:{height:70},children:a.jsx(ck,{googleClientId:t,handleGoogleCredential:async l=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:l.clientId,googleCredential:l.credential,createUser:!0}))}catch(c){i(lt(c))}}})}),a.jsx(fn,{label:"or",labelPosition:"center",my:"lg"})]}),a.jsxs(be,{gap:"xl",children:[a.jsx(ae,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:ze(o,"firstName")}),a.jsx(ae,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:ze(o,"lastName")}),a.jsx(ae,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:ze(o,"email")}),a.jsx(Nr,{name:"password",label:"Password",autoComplete:"off",required:!0,error:ze(o,"password")}),a.jsxs(se,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(He,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(He,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),a.jsxs(se,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",a.jsx(He,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",a.jsx(He,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),a.jsxs(Y,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(gr,{name:"remember",label:"Remember me",size:"xs"}),a.jsx(te,{type:"submit",children:"Create account"})]})]})}function ZU(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,onSuccess:s}=e,l=ne(),[c,u]=p.useState(),[d,f]=p.useState();p.useEffect(()=>{t==="patient"&&c&&l.startNewPatient({login:c,projectId:n}).then(m=>l.processCode(m.code)).then(()=>s()).catch(m=>f(lt(m)))},[l,t,n,c,s]);function h(m){m.code?l.processCode(m.code).then(()=>s()).catch(console.log):m.login&&u(m.login)}return a.jsxs(Se,{width:450,children:[d&&a.jsx("pre",{children:JSON.stringify(d,null,2)}),!c&&a.jsx(JU,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,handleAuthResponse:h,children:e.children}),c&&t==="project"&&a.jsx(ak,{login:c,handleAuthResponse:h})]})}function eV(e){const[t,n]=p.useState();return t?a.jsx(nV,{email:t,...e}):a.jsx(tV,{setEmail:n,...e})}function tV(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:i,...s}=e,l=ne(),c=!e.disableGoogleAuth&&uk(e.googleClientId),[u,d]=p.useState(),f=Hc(u,void 0),h=p.useCallback(async y=>{if(!y.authorizeUrl)return!1;const S=JSON.stringify({...await l.ensureCodeChallenge(s),domain:y.domain}),v=new URL(y.authorizeUrl);return v.searchParams.set("state",S),window.location.assign(v.toString()),!0},[l,s]),m=p.useCallback(async y=>{const S=await l.post("auth/method",{email:y.email});await h(S)||t(y.email)},[l,h,t]),g=p.useCallback(async y=>{try{const S=await l.startGoogleLogin({...s,googleCredential:y.credential});await h(S)||r(S)}catch(S){d(lt(S))}},[l,s,h,r]);return a.jsxs(We,{onSubmit:m,children:[a.jsx(on,{style:{flexDirection:"column"},children:o}),a.jsx(Wr,{issues:f}),c&&a.jsxs(a.Fragment,{children:[a.jsx(Y,{justify:"center",p:"xl",style:{height:70},children:a.jsx(ck,{googleClientId:c,handleGoogleCredential:g})}),!i&&a.jsx(fn,{label:"or",labelPosition:"center",my:"lg"})]}),!i&&a.jsx(ae,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:ze(u,"email")}),a.jsxs(Y,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[a.jsx("div",{children:n&&a.jsx(He,{component:"button",type:"button",color:"dimmed",onClick:n,size:"xs",children:"Register"})}),!i&&a.jsx(te,{type:"submit",children:"Next"})]})]})}function nV(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,i=ne(),[s,l]=p.useState(),c=Hc(s,void 0),u=p.useCallback(d=>{i.startLogin({...o,password:d.password,remember:d.remember==="on"}).then(n).catch(f=>l(lt(f)))},[i,o,n]);return a.jsxs(We,{style:{maxWidth:400},onSubmit:u,children:[a.jsx(on,{style:{flexDirection:"column"},children:r}),a.jsx(Wr,{issues:c}),a.jsx(be,{gap:"xl",children:a.jsx(Nr,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:ze(s,"password")})}),a.jsxs(Y,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&a.jsx(He,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),a.jsx(gr,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),a.jsx(te,{type:"submit",children:"Sign in"})]})]})}function rV(e){const t=ne(),n=Tc(),[r,o]=p.useState(""),[i,s]=p.useState();function l(f){var h;return!!((h=f==null?void 0:f.toLowerCase())!=null&&h.includes(r.toLowerCase()))}function c(f){var h,m;return l((h=f.profile)==null?void 0:h.display)||l((m=f.project)==null?void 0:m.display)}function u(f){t.post("auth/profile",{login:e.login,profile:f}).then(e.handleAuthResponse).catch(h=>s(lt(h)))}const d=e.memberships.filter(c).slice(0,10).map(f=>a.jsx(Ee.Option,{value:f.id,children:a.jsx(oV,{...f})},f.id));return a.jsxs(be,{children:[a.jsxs(rs,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[a.jsx(Vr,{size:32}),a.jsx(ue,{order:3,children:"Choose profile"})]}),a.jsx(Wr,{outcome:i}),a.jsxs(Ee,{store:n,onOptionSubmit:u,children:[a.jsx(Ee.EventsTarget,{children:a.jsx(ae,{placeholder:"Search",value:r,onChange:f=>{o(f.currentTarget.value),n.updateSelectedOptionIndex()}})}),a.jsx("div",{children:a.jsx(Ee.Options,{children:d.length>0?d:a.jsx(Ee.Empty,{children:"Nothing found..."})})})]})]})}function oV(e){var t,n;return a.jsxs(Y,{children:[a.jsx(os,{radius:"xl"}),a.jsxs("div",{children:[a.jsx(se,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),a.jsx(se,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}function iV(e){const t=ne();return a.jsx(We,{style:{maxWidth:400},onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:a.jsxs(be,{children:[a.jsxs(on,{style:{flexDirection:"column"},children:[a.jsx(Vr,{size:32}),a.jsx(ue,{children:"Choose scope"})]}),a.jsx(be,{children:(e.scope??"openid").split(" ").map(n=>a.jsx(gr,{id:n,name:n,label:n,defaultChecked:!0},n))}),a.jsx(Y,{justify:"flex-end",mt:"xl",children:a.jsx(te,{type:"submit",children:"Set scope"})})]})})}function sV(e){const t=ne(),[n,r]=p.useState();return a.jsx(We,{style:{maxWidth:400},onSubmit:o=>{r(void 0),t.post("auth/mfa/verify",{login:e.login,token:o.token}).then(e.handleAuthResponse).catch(i=>r(Te(i)))},children:a.jsxs(be,{children:[a.jsxs(on,{style:{flexDirection:"column"},children:[a.jsx(Vr,{size:32}),a.jsx(ue,{children:"Enter MFA code"})]}),n&&a.jsx(xs,{icon:a.jsx(zc,{size:16}),title:"Error",color:"red",children:n}),a.jsx(be,{children:a.jsx(ae,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),a.jsx(Y,{justify:"flex-end",mt:"xl",children:a.jsx(te,{type:"submit",children:"Submit code"})})]})})}function hk(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:i,onCode:s,...l}=e,c=ne(),[u,d]=p.useState(),f=p.useRef(!1),[h,m]=p.useState(!1),[g,y]=p.useState(),S=p.useCallback(w=>{s?s(w):c.processCode(w).then(()=>{r&&r()}).catch(b=>fe({color:"red",message:Te(b)}))},[c,s,r]),v=p.useCallback(w=>{m(!!w.mfaRequired),w.login&&d(w.login),w.memberships&&y(w.memberships),w.code&&(n?y(void 0):S(w.code))},[n,S]),x=p.useCallback(w=>{S(w.code)},[S]);return p.useEffect(()=>{t&&!f.current&&!u&&(f.current=!0,c.get("auth/login/"+t).then(v).catch(w=>fe({color:"red",message:Te(w)})))},[c,t,f,u,v]),a.jsx(Se,{width:450,px:"sm",py:"md",children:u?h?a.jsx(sV,{login:u,handleAuthResponse:v}):g?a.jsx(rV,{login:u,memberships:g,handleAuthResponse:v}):e.projectId==="new"?a.jsx(ak,{login:u,handleAuthResponse:v}):e.chooseScopes?a.jsx(iV,{login:u,scope:e.scope,handleAuthResponse:x}):a.jsx("div",{children:"Success"}):a.jsx(eV,{onForgotPassword:o,onRegister:i,handleAuthResponse:v,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...l,children:e.children})})}var pk,Rw=bc;pk=Rw.createRoot,Rw.hydrateRoot;/**
517
+ * @remix-run/router v1.15.3
518
+ *
519
+ * Copyright (c) Remix Software Inc.
520
+ *
521
+ * This source code is licensed under the MIT license found in the
522
+ * LICENSE.md file in the root directory of this source tree.
523
+ *
524
+ * @license MIT
525
+ */function At(){return At=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},At.apply(this,arguments)}var zt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(zt||(zt={}));const Dw="popstate";function aV(e){e===void 0&&(e={});function t(r,o){let{pathname:i,search:s,hash:l}=r.location;return dc("",{pathname:i,search:s,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Yc(o)}return cV(t,n,null,e)}function Oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Aa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function lV(){return Math.random().toString(36).substr(2,8)}function Iw(e,t){return{usr:e.state,key:e.key,idx:t}}function dc(e,t,n,r){return n===void 0&&(n=null),At({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Vo(t):t,{state:n,key:t&&t.key||r||lV()})}function Yc(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Vo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function cV(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,l=zt.Pop,c=null,u=d();u==null&&(u=0,s.replaceState(At({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function f(){l=zt.Pop;let S=d(),v=S==null?null:S-u;u=S,c&&c({action:l,location:y.location,delta:v})}function h(S,v){l=zt.Push;let x=dc(y.location,S,v);n&&n(x,S),u=d()+1;let w=Iw(x,u),b=y.createHref(x);try{s.pushState(w,"",b)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;o.location.assign(b)}i&&c&&c({action:l,location:y.location,delta:1})}function m(S,v){l=zt.Replace;let x=dc(y.location,S,v);n&&n(x,S),u=d();let w=Iw(x,u),b=y.createHref(x);s.replaceState(w,"",b),i&&c&&c({action:l,location:y.location,delta:0})}function g(S){let v=o.location.origin!=="null"?o.location.origin:o.location.href,x=typeof S=="string"?S:Yc(S);return x=x.replace(/ $/,"%20"),Oe(v,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,v)}let y={get action(){return l},get location(){return e(o,s)},listen(S){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(Dw,f),c=S,()=>{o.removeEventListener(Dw,f),c=null}},createHref(S){return t(o,S)},createURL:g,encodeLocation(S){let v=g(S);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:m,go(S){return s.go(S)}};return y}var Dt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Dt||(Dt={}));const uV=new Set(["lazy","caseSensitive","path","id","index","children"]);function dV(e){return e.index===!0}function $m(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let s=[...n,i],l=typeof o.id=="string"?o.id:s.join("-");if(Oe(o.index!==!0||!o.children,"Cannot specify children on an index route"),Oe(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),dV(o)){let c=At({},o,t(o),{id:l});return r[l]=c,c}else{let c=At({},o,t(o),{id:l,children:void 0});return r[l]=c,o.children&&(c.children=$m(o.children,t,s,r)),c}})}function ia(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Vo(t):t,o=Xc(r.pathname||"/",n);if(o==null)return null;let i=mk(e);hV(i);let s=null;for(let l=0;s==null&&l<i.length;++l){let c=jV(o);s=bV(i[l],c)}return s}function fV(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}function mk(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(i,s,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};c.relativePath.startsWith("/")&&(Oe(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=mi([r,c.relativePath]),d=n.concat(c);i.children&&i.children.length>0&&(Oe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),mk(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:wV(u,i.index),routesMeta:d})};return e.forEach((i,s)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,s);else for(let c of gk(i.path))o(i,s,c)}),t}function gk(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=gk(r.join("/")),l=[];return l.push(...s.map(c=>c===""?i:[i,c].join("/"))),o&&l.push(...s),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function hV(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:SV(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const pV=/^:[\w-]+$/,mV=3,gV=2,yV=1,vV=10,xV=-2,_w=e=>e==="*";function wV(e,t){let n=e.split("/"),r=n.length;return n.some(_w)&&(r+=xV),t&&(r+=gV),n.filter(o=>!_w(o)).reduce((o,i)=>o+(pV.test(i)?mV:i===""?yV:vV),r)}function SV(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function bV(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let s=0;s<n.length;++s){let l=n[s],c=s===n.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=CV({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u);if(!d)return null;Object.assign(r,d.params);let f=l.route;i.push({params:r,pathname:mi([o,d.pathname]),pathnameBase:kV(mi([o,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(o=mi([o,d.pathnameBase]))}return i}function CV(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=EV(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],s=i.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:m}=d;if(h==="*"){let y=l[f]||"";s=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const g=l[f];return m&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:e}}function EV(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Aa(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function jV(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Aa(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Xc(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function PV(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Vo(e):e;return{pathname:n?n.startsWith("/")?n:TV(n,t):t,search:RV(r),hash:DV(o)}}function TV(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function up(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function yk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function vk(e,t){let n=yk(e);return t?n.map((r,o)=>o===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function xk(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Vo(e):(o=At({},e),Oe(!o.pathname||!o.pathname.includes("?"),up("?","pathname","search",o)),Oe(!o.pathname||!o.pathname.includes("#"),up("#","pathname","hash",o)),Oe(!o.search||!o.search.includes("#"),up("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=n;else{let f=t.length-1;if(!r&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;o.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=PV(o,l),u=s&&s!=="/"&&s.endsWith("/"),d=(i||s===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const mi=e=>e.join("/").replace(/\/\/+/g,"/"),kV=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),RV=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,DV=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class g0{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function wk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Sk=["post","put","patch","delete"],IV=new Set(Sk),_V=["get",...Sk],AV=new Set(_V),NV=new Set([301,302,303,307,308]),OV=new Set([307,308]),dp={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},MV={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},pl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},bk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,LV=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Ck="remix-router-transitions";function $V(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Oe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let A=e.detectErrorBoundary;o=z=>({hasErrorBoundary:A(z)})}else o=LV;let i={},s=$m(e.routes,o,void 0,i),l,c=e.basename||"/",u=At({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),d=null,f=new Set,h=null,m=null,g=null,y=e.hydrationData!=null,S=ia(s,e.history.location,c),v=null;if(S==null){let A=lr(404,{pathname:e.history.location.pathname}),{matches:z,route:H}=zw(s);S=z,v={[H.id]:A}}let x,w=S.some(A=>A.route.lazy),b=S.some(A=>A.route.loader);if(w)x=!1;else if(!b)x=!0;else if(u.v7_partialHydration){let A=e.hydrationData?e.hydrationData.loaderData:null,z=e.hydrationData?e.hydrationData.errors:null,H=J=>J.route.loader?J.route.loader.hydrate===!0?!1:A&&A[J.route.id]!==void 0||z&&z[J.route.id]!==void 0:!0;if(z){let J=S.findIndex(ee=>z[ee.route.id]!==void 0);x=S.slice(0,J+1).every(H)}else x=S.every(H)}else x=e.hydrationData!=null;let j,E={historyAction:e.history.action,location:e.history.location,matches:S,initialized:x,navigation:dp,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||v,fetchers:new Map,blockers:new Map},P=zt.Pop,T=!1,D,_=!1,O=new Map,I=null,$=!1,N=!1,L=[],M=[],R=new Map,k=0,F=-1,q=new Map,G=new Set,oe=new Map,xe=new Map,me=new Set,Ce=new Map,je=new Map,Be=!1;function Me(){if(d=e.history.listen(A=>{let{action:z,location:H,delta:J}=A;if(Be){Be=!1;return}Aa(je.size===0||J!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ee=ir({currentLocation:E.location,nextLocation:H,historyAction:z});if(ee&&J!=null){Be=!0,e.history.go(J*-1),ks(ee,{state:"blocked",location:H,proceed(){ks(ee,{state:"proceeding",proceed:void 0,reset:void 0,location:H}),e.history.go(J)},reset(){let Re=new Map(E.blockers);Re.set(ee,pl),X({blockers:Re})}});return}return Ve(z,H)}),n){KV(t,O);let A=()=>YV(t,O);t.addEventListener("pagehide",A),I=()=>t.removeEventListener("pagehide",A)}return E.initialized||Ve(zt.Pop,E.location,{initialHydration:!0}),j}function Ke(){d&&d(),I&&I(),f.clear(),D&&D.abort(),E.fetchers.forEach((A,z)=>or(z)),E.blockers.forEach((A,z)=>eu(z))}function St(A){return f.add(A),()=>f.delete(A)}function X(A,z){z===void 0&&(z={}),E=At({},E,A);let H=[],J=[];u.v7_fetcherPersist&&E.fetchers.forEach((ee,Re)=>{ee.state==="idle"&&(me.has(Re)?J.push(Re):H.push(Re))}),[...f].forEach(ee=>ee(E,{deletedFetchers:J,unstable_viewTransitionOpts:z.viewTransitionOpts,unstable_flushSync:z.flushSync===!0})),u.v7_fetcherPersist&&(H.forEach(ee=>E.fetchers.delete(ee)),J.forEach(ee=>or(ee)))}function ke(A,z,H){var J,ee;let{flushSync:Re}=H===void 0?{}:H,we=E.actionData!=null&&E.navigation.formMethod!=null&&Rr(E.navigation.formMethod)&&E.navigation.state==="loading"&&((J=A.state)==null?void 0:J._isRedirect)!==!0,ye;z.actionData?Object.keys(z.actionData).length>0?ye=z.actionData:ye=null:we?ye=E.actionData:ye=null;let ge=z.loaderData?Fw(E.loaderData,z.loaderData,z.matches||[],z.errors):E.loaderData,Le=E.blockers;Le.size>0&&(Le=new Map(Le),Le.forEach((rt,Ft)=>Le.set(Ft,pl)));let $t=T===!0||E.navigation.formMethod!=null&&Rr(E.navigation.formMethod)&&((ee=A.state)==null?void 0:ee._isRedirect)!==!0;l&&(s=l,l=void 0),$||P===zt.Pop||(P===zt.Push?e.history.push(A,A.state):P===zt.Replace&&e.history.replace(A,A.state));let _e;if(P===zt.Pop){let rt=O.get(E.location.pathname);rt&&rt.has(A.pathname)?_e={currentLocation:E.location,nextLocation:A}:O.has(A.pathname)&&(_e={currentLocation:A,nextLocation:E.location})}else if(_){let rt=O.get(E.location.pathname);rt?rt.add(A.pathname):(rt=new Set([A.pathname]),O.set(E.location.pathname,rt)),_e={currentLocation:E.location,nextLocation:A}}X(At({},z,{actionData:ye,loaderData:ge,historyAction:P,location:A,initialized:!0,navigation:dp,revalidation:"idle",restoreScrollPosition:fo(A,z.matches||E.matches),preventScrollReset:$t,blockers:Le}),{viewTransitionOpts:_e,flushSync:Re===!0}),P=zt.Pop,T=!1,_=!1,$=!1,N=!1,L=[],M=[]}async function tt(A,z){if(typeof A=="number"){e.history.go(A);return}let H=Fm(E.location,E.matches,c,u.v7_prependBasename,A,u.v7_relativeSplatPath,z==null?void 0:z.fromRouteId,z==null?void 0:z.relative),{path:J,submission:ee,error:Re}=Aw(u.v7_normalizeFormMethod,!1,H,z),we=E.location,ye=dc(E.location,J,z&&z.state);ye=At({},ye,e.history.encodeLocation(ye));let ge=z&&z.replace!=null?z.replace:void 0,Le=zt.Push;ge===!0?Le=zt.Replace:ge===!1||ee!=null&&Rr(ee.formMethod)&&ee.formAction===E.location.pathname+E.location.search&&(Le=zt.Replace);let $t=z&&"preventScrollReset"in z?z.preventScrollReset===!0:void 0,_e=(z&&z.unstable_flushSync)===!0,rt=ir({currentLocation:we,nextLocation:ye,historyAction:Le});if(rt){ks(rt,{state:"blocked",location:ye,proceed(){ks(rt,{state:"proceeding",proceed:void 0,reset:void 0,location:ye}),tt(A,z)},reset(){let Ft=new Map(E.blockers);Ft.set(rt,pl),X({blockers:Ft})}});return}return await Ve(Le,ye,{submission:ee,pendingError:Re,preventScrollReset:$t,replace:z&&z.replace,enableViewTransition:z&&z.unstable_viewTransition,flushSync:_e})}function Ne(){if(qe(),X({revalidation:"loading"}),E.navigation.state!=="submitting"){if(E.navigation.state==="idle"){Ve(E.historyAction,E.location,{startUninterruptedRevalidation:!0});return}Ve(P||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation})}}async function Ve(A,z,H){D&&D.abort(),D=null,P=A,$=(H&&H.startUninterruptedRevalidation)===!0,Za(E.location,E.matches),T=(H&&H.preventScrollReset)===!0,_=(H&&H.enableViewTransition)===!0;let J=l||s,ee=H&&H.overrideNavigation,Re=ia(J,z,c),we=(H&&H.flushSync)===!0;if(!Re){let Ft=lr(404,{pathname:z.pathname}),{matches:cn,route:Ae}=zw(J);Ii(),ke(z,{matches:cn,loaderData:{},errors:{[Ae.id]:Ft}},{flushSync:we});return}if(E.initialized&&!N&&VV(E.location,z)&&!(H&&H.submission&&Rr(H.submission.formMethod))){ke(z,{matches:Re},{flushSync:we});return}D=new AbortController;let ye=gl(e.history,z,D.signal,H&&H.submission),ge,Le;if(H&&H.pendingError)Le={[Ml(Re).route.id]:H.pendingError};else if(H&&H.submission&&Rr(H.submission.formMethod)){let Ft=await Rt(ye,z,H.submission,Re,{replace:H.replace,flushSync:we});if(Ft.shortCircuited)return;ge=Ft.pendingActionData,Le=Ft.pendingActionError,ee=fp(z,H.submission),we=!1,ye=new Request(ye.url,{signal:ye.signal})}let{shortCircuited:$t,loaderData:_e,errors:rt}=await ln(ye,z,Re,ee,H&&H.submission,H&&H.fetcherSubmission,H&&H.replace,H&&H.initialHydration===!0,we,ge,Le);$t||(D=null,ke(z,At({matches:Re},ge?{actionData:ge}:{},{loaderData:_e,errors:rt})))}async function Rt(A,z,H,J,ee){ee===void 0&&(ee={}),qe();let Re=GV(z,H);X({navigation:Re},{flushSync:ee.flushSync===!0});let we,ye=Bm(J,z);if(!ye.route.action&&!ye.route.lazy)we={type:Dt.error,error:lr(405,{method:A.method,pathname:z.pathname,routeId:ye.route.id})};else if(we=await ml("action",A,ye,J,i,o,c,u.v7_relativeSplatPath),A.signal.aborted)return{shortCircuited:!0};if(qi(we)){let ge;return ee&&ee.replace!=null?ge=ee.replace:ge=we.location===E.location.pathname+E.location.search,await re(E,we,{submission:H,replace:ge}),{shortCircuited:!0}}if(sa(we)){let ge=Ml(J,ye.route.id);return(ee&&ee.replace)!==!0&&(P=zt.Push),{pendingActionData:{},pendingActionError:{[ge.route.id]:we.error}}}if(Hi(we))throw lr(400,{type:"defer-action"});return{pendingActionData:{[ye.route.id]:we.data}}}async function ln(A,z,H,J,ee,Re,we,ye,ge,Le,$t){let _e=J||fp(z,ee),rt=ee||Re||Vw(_e),Ft=l||s,[cn,Ae]=Nw(e.history,E,H,rt,z,u.v7_partialHydration&&ye===!0,N,L,M,me,oe,G,Ft,c,Le,$t);if(Ii(Ye=>!(H&&H.some(ot=>ot.route.id===Ye))||cn&&cn.some(ot=>ot.route.id===Ye)),F=++k,cn.length===0&&Ae.length===0){let Ye=Cr();return ke(z,At({matches:H,loaderData:{},errors:$t||null},Le?{actionData:Le}:{},Ye?{fetchers:new Map(E.fetchers)}:{}),{flushSync:ge}),{shortCircuited:!0}}if(!$&&(!u.v7_partialHydration||!ye)){Ae.forEach(ot=>{let An=E.fetchers.get(ot.key),nu=yl(void 0,An?An.data:void 0);E.fetchers.set(ot.key,nu)});let Ye=Le||E.actionData;X(At({navigation:_e},Ye?Object.keys(Ye).length===0?{actionData:null}:{actionData:Ye}:{},Ae.length>0?{fetchers:new Map(E.fetchers)}:{}),{flushSync:ge})}Ae.forEach(Ye=>{R.has(Ye.key)&&In(Ye.key),Ye.controller&&R.set(Ye.key,Ye.controller)});let Gr=()=>Ae.forEach(Ye=>In(Ye.key));D&&D.signal.addEventListener("abort",Gr);let{results:Ds,loaderResults:ho,fetcherResults:Qr}=await De(E.matches,H,cn,Ae,A);if(A.signal.aborted)return{shortCircuited:!0};D&&D.signal.removeEventListener("abort",Gr),Ae.forEach(Ye=>R.delete(Ye.key));let _i=Bw(Ds);if(_i){if(_i.idx>=cn.length){let Ye=Ae[_i.idx-cn.length].key;G.add(Ye)}return await re(E,_i.result,{replace:we}),{shortCircuited:!0}}let{loaderData:fh,errors:el}=$w(E,H,cn,ho,$t,Ae,Qr,Ce);Ce.forEach((Ye,ot)=>{Ye.subscribe(An=>{(An||Ye.done)&&Ce.delete(ot)})}),u.v7_partialHydration&&ye&&E.errors&&Object.entries(E.errors).filter(Ye=>{let[ot]=Ye;return!cn.some(An=>An.route.id===ot)}).forEach(Ye=>{let[ot,An]=Ye;el=Object.assign(el||{},{[ot]:An})});let hh=Cr(),Is=Ho(F),tu=hh||Is||Ae.length>0;return At({loaderData:fh,errors:el},tu?{fetchers:new Map(E.fetchers)}:{})}function br(A,z,H,J){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");R.has(A)&&In(A);let ee=(J&&J.unstable_flushSync)===!0,Re=l||s,we=Fm(E.location,E.matches,c,u.v7_prependBasename,H,u.v7_relativeSplatPath,z,J==null?void 0:J.relative),ye=ia(Re,we,c);if(!ye){Lt(A,z,lr(404,{pathname:we}),{flushSync:ee});return}let{path:ge,submission:Le,error:$t}=Aw(u.v7_normalizeFormMethod,!0,we,J);if($t){Lt(A,z,$t,{flushSync:ee});return}let _e=Bm(ye,ge);if(T=(J&&J.preventScrollReset)===!0,Le&&Rr(Le.formMethod)){en(A,z,ge,_e,ye,ee,Le);return}oe.set(A,{routeId:z,path:ge}),uo(A,z,ge,_e,ye,ee,Le)}async function en(A,z,H,J,ee,Re,we){if(qe(),oe.delete(A),!J.route.action&&!J.route.lazy){let ot=lr(405,{method:we.formMethod,pathname:H,routeId:z});Lt(A,z,ot,{flushSync:Re});return}let ye=E.fetchers.get(A);nt(A,QV(we,ye),{flushSync:Re});let ge=new AbortController,Le=gl(e.history,H,ge.signal,we);R.set(A,ge);let $t=k,_e=await ml("action",Le,J,ee,i,o,c,u.v7_relativeSplatPath);if(Le.signal.aborted){R.get(A)===ge&&R.delete(A);return}if(u.v7_fetcherPersist&&me.has(A)){if(qi(_e)||sa(_e)){nt(A,Qo(void 0));return}}else{if(qi(_e))if(R.delete(A),F>$t){nt(A,Qo(void 0));return}else return G.add(A),nt(A,yl(we)),re(E,_e,{fetcherSubmission:we});if(sa(_e)){Lt(A,z,_e.error);return}}if(Hi(_e))throw lr(400,{type:"defer-action"});let rt=E.navigation.location||E.location,Ft=gl(e.history,rt,ge.signal),cn=l||s,Ae=E.navigation.state!=="idle"?ia(cn,E.navigation.location,c):E.matches;Oe(Ae,"Didn't find any matches after fetcher action");let Gr=++k;q.set(A,Gr);let Ds=yl(we,_e.data);E.fetchers.set(A,Ds);let[ho,Qr]=Nw(e.history,E,Ae,we,rt,!1,N,L,M,me,oe,G,cn,c,{[J.route.id]:_e.data},void 0);Qr.filter(ot=>ot.key!==A).forEach(ot=>{let An=ot.key,nu=E.fetchers.get(An),Jk=yl(void 0,nu?nu.data:void 0);E.fetchers.set(An,Jk),R.has(An)&&In(An),ot.controller&&R.set(An,ot.controller)}),X({fetchers:new Map(E.fetchers)});let _i=()=>Qr.forEach(ot=>In(ot.key));ge.signal.addEventListener("abort",_i);let{results:fh,loaderResults:el,fetcherResults:hh}=await De(E.matches,Ae,ho,Qr,Ft);if(ge.signal.aborted)return;ge.signal.removeEventListener("abort",_i),q.delete(A),R.delete(A),Qr.forEach(ot=>R.delete(ot.key));let Is=Bw(fh);if(Is){if(Is.idx>=ho.length){let ot=Qr[Is.idx-ho.length].key;G.add(ot)}return re(E,Is.result)}let{loaderData:tu,errors:Ye}=$w(E,E.matches,ho,el,void 0,Qr,hh,Ce);if(E.fetchers.has(A)){let ot=Qo(_e.data);E.fetchers.set(A,ot)}Ho(Gr),E.navigation.state==="loading"&&Gr>F?(Oe(P,"Expected pending action"),D&&D.abort(),ke(E.navigation.location,{matches:Ae,loaderData:tu,errors:Ye,fetchers:new Map(E.fetchers)})):(X({errors:Ye,loaderData:Fw(E.loaderData,tu,Ae,Ye),fetchers:new Map(E.fetchers)}),N=!1)}async function uo(A,z,H,J,ee,Re,we){let ye=E.fetchers.get(A);nt(A,yl(we,ye?ye.data:void 0),{flushSync:Re});let ge=new AbortController,Le=gl(e.history,H,ge.signal);R.set(A,ge);let $t=k,_e=await ml("loader",Le,J,ee,i,o,c,u.v7_relativeSplatPath);if(Hi(_e)&&(_e=await Pk(_e,Le.signal,!0)||_e),R.get(A)===ge&&R.delete(A),!Le.signal.aborted){if(me.has(A)){nt(A,Qo(void 0));return}if(qi(_e))if(F>$t){nt(A,Qo(void 0));return}else{G.add(A),await re(E,_e);return}if(sa(_e)){Lt(A,z,_e.error);return}Oe(!Hi(_e),"Unhandled fetcher deferred data"),nt(A,Qo(_e.data))}}async function re(A,z,H){let{submission:J,fetcherSubmission:ee,replace:Re}=H===void 0?{}:H;z.revalidate&&(N=!0);let we=dc(A.location,z.location,{_isRedirect:!0});if(Oe(we,"Expected a location on the redirect navigation"),n){let rt=!1;if(z.reloadDocument)rt=!0;else if(bk.test(z.location)){const Ft=e.history.createURL(z.location);rt=Ft.origin!==t.location.origin||Xc(Ft.pathname,c)==null}if(rt){Re?t.location.replace(z.location):t.location.assign(z.location);return}}D=null;let ye=Re===!0?zt.Replace:zt.Push,{formMethod:ge,formAction:Le,formEncType:$t}=A.navigation;!J&&!ee&&ge&&Le&&$t&&(J=Vw(A.navigation));let _e=J||ee;if(OV.has(z.status)&&_e&&Rr(_e.formMethod))await Ve(ye,we,{submission:At({},_e,{formAction:z.location}),preventScrollReset:T});else{let rt=fp(we,J);await Ve(ye,we,{overrideNavigation:rt,fetcherSubmission:ee,preventScrollReset:T})}}async function De(A,z,H,J,ee){let Re=await Promise.all([...H.map(ge=>ml("loader",ee,ge,z,i,o,c,u.v7_relativeSplatPath)),...J.map(ge=>ge.matches&&ge.match&&ge.controller?ml("loader",gl(e.history,ge.path,ge.controller.signal),ge.match,ge.matches,i,o,c,u.v7_relativeSplatPath):{type:Dt.error,error:lr(404,{pathname:ge.path})})]),we=Re.slice(0,H.length),ye=Re.slice(H.length);return await Promise.all([Uw(A,H,we,we.map(()=>ee.signal),!1,E.loaderData),Uw(A,J.map(ge=>ge.match),ye,J.map(ge=>ge.controller?ge.controller.signal:null),!0)]),{results:Re,loaderResults:we,fetcherResults:ye}}function qe(){N=!0,L.push(...Ii()),oe.forEach((A,z)=>{R.has(z)&&(M.push(z),In(z))})}function nt(A,z,H){H===void 0&&(H={}),E.fetchers.set(A,z),X({fetchers:new Map(E.fetchers)},{flushSync:(H&&H.flushSync)===!0})}function Lt(A,z,H,J){J===void 0&&(J={});let ee=Ml(E.matches,z);or(A),X({errors:{[ee.route.id]:H},fetchers:new Map(E.fetchers)},{flushSync:(J&&J.flushSync)===!0})}function Hr(A){return u.v7_fetcherPersist&&(xe.set(A,(xe.get(A)||0)+1),me.has(A)&&me.delete(A)),E.fetchers.get(A)||MV}function or(A){let z=E.fetchers.get(A);R.has(A)&&!(z&&z.state==="loading"&&q.has(A))&&In(A),oe.delete(A),q.delete(A),G.delete(A),me.delete(A),E.fetchers.delete(A)}function Di(A){if(u.v7_fetcherPersist){let z=(xe.get(A)||0)-1;z<=0?(xe.delete(A),me.add(A)):xe.set(A,z)}else or(A);X({fetchers:new Map(E.fetchers)})}function In(A){let z=R.get(A);Oe(z,"Expected fetch controller: "+A),z.abort(),R.delete(A)}function qr(A){for(let z of A){let H=Hr(z),J=Qo(H.data);E.fetchers.set(z,J)}}function Cr(){let A=[],z=!1;for(let H of G){let J=E.fetchers.get(H);Oe(J,"Expected fetcher: "+H),J.state==="loading"&&(G.delete(H),A.push(H),z=!0)}return qr(A),z}function Ho(A){let z=[];for(let[H,J]of q)if(J<A){let ee=E.fetchers.get(H);Oe(ee,"Expected fetcher: "+H),ee.state==="loading"&&(In(H),q.delete(H),z.push(H))}return qr(z),z.length>0}function Ja(A,z){let H=E.blockers.get(A)||pl;return je.get(A)!==z&&je.set(A,z),H}function eu(A){E.blockers.delete(A),je.delete(A)}function ks(A,z){let H=E.blockers.get(A)||pl;Oe(H.state==="unblocked"&&z.state==="blocked"||H.state==="blocked"&&z.state==="blocked"||H.state==="blocked"&&z.state==="proceeding"||H.state==="blocked"&&z.state==="unblocked"||H.state==="proceeding"&&z.state==="unblocked","Invalid blocker state transition: "+H.state+" -> "+z.state);let J=new Map(E.blockers);J.set(A,z),X({blockers:J})}function ir(A){let{currentLocation:z,nextLocation:H,historyAction:J}=A;if(je.size===0)return;je.size>1&&Aa(!1,"A router only supports one blocker at a time");let ee=Array.from(je.entries()),[Re,we]=ee[ee.length-1],ye=E.blockers.get(Re);if(!(ye&&ye.state==="proceeding")&&we({currentLocation:z,nextLocation:H,historyAction:J}))return Re}function Ii(A){let z=[];return Ce.forEach((H,J)=>{(!A||A(J))&&(H.cancel(),z.push(J),Ce.delete(J))}),z}function dh(A,z,H){if(h=A,g=z,m=H||null,!y&&E.navigation===dp){y=!0;let J=fo(E.location,E.matches);J!=null&&X({restoreScrollPosition:J})}return()=>{h=null,g=null,m=null}}function Rs(A,z){return m&&m(A,z.map(J=>fV(J,E.loaderData)))||A.key}function Za(A,z){if(h&&g){let H=Rs(A,z);h[H]=g()}}function fo(A,z){if(h){let H=Rs(A,z),J=h[H];if(typeof J=="number")return J}return null}function _n(A){i={},l=$m(A,o,void 0,i)}return j={get basename(){return c},get future(){return u},get state(){return E},get routes(){return s},get window(){return t},initialize:Me,subscribe:St,enableScrollRestoration:dh,navigate:tt,fetch:br,revalidate:Ne,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Hr,deleteFetcher:Di,dispose:Ke,getBlocker:Ja,deleteBlocker:eu,_internalFetchControllers:R,_internalActiveDeferreds:Ce,_internalSetRoutes:_n},j}function FV(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Fm(e,t,n,r,o,i,s,l){let c,u;if(s){c=[];for(let f of t)if(c.push(f),f.route.id===s){u=f;break}}else c=t,u=t[t.length-1];let d=xk(o||".",vk(c,i),Xc(e.pathname,n)||e.pathname,l==="path");return o==null&&(d.search=e.search,d.hash=e.hash),(o==null||o===""||o===".")&&u&&u.route.index&&!y0(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:mi([n,d.pathname])),Yc(d)}function Aw(e,t,n,r){if(!r||!FV(r))return{path:n};if(r.formMethod&&!qV(r.formMethod))return{path:n,error:lr(405,{method:r.formMethod})};let o=()=>({path:n,error:lr(400,{type:"invalid-body"})}),i=r.formMethod||"get",s=e?i.toUpperCase():i.toLowerCase(),l=jk(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Rr(s))return o();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,g)=>{let[y,S]=g;return""+m+y+"="+S+`
526
+ `},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!Rr(s))return o();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:l,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return o()}}}Oe(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=zm(r.formData),u=r.formData;else if(r.body instanceof FormData)c=zm(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=Lw(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=Lw(c)}catch{return o()}let d={formMethod:s,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Rr(d.formMethod))return{path:n,submission:d};let f=Vo(n);return t&&f.search&&y0(f.search)&&c.append("index",""),f.search="?"+c,{path:Yc(f),submission:d}}function zV(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function Nw(e,t,n,r,o,i,s,l,c,u,d,f,h,m,g,y){let S=y?Object.values(y)[0]:g?Object.values(g)[0]:void 0,v=e.createURL(t.location),x=e.createURL(o),w=y?Object.keys(y)[0]:void 0,j=zV(n,w).filter((P,T)=>{let{route:D}=P;if(D.lazy)return!0;if(D.loader==null)return!1;if(i)return D.loader.hydrate?!0:t.loaderData[D.id]===void 0&&(!t.errors||t.errors[D.id]===void 0);if(BV(t.loaderData,t.matches[T],P)||l.some(I=>I===P.route.id))return!0;let _=t.matches[T],O=P;return Ow(P,At({currentUrl:v,currentParams:_.params,nextUrl:x,nextParams:O.params},r,{actionResult:S,defaultShouldRevalidate:s||v.pathname+v.search===x.pathname+x.search||v.search!==x.search||Ek(_,O)}))}),E=[];return d.forEach((P,T)=>{if(i||!n.some($=>$.route.id===P.routeId)||u.has(T))return;let D=ia(h,P.path,m);if(!D){E.push({key:T,routeId:P.routeId,path:P.path,matches:null,match:null,controller:null});return}let _=t.fetchers.get(T),O=Bm(D,P.path),I=!1;f.has(T)?I=!1:c.includes(T)?I=!0:_&&_.state!=="idle"&&_.data===void 0?I=s:I=Ow(O,At({currentUrl:v,currentParams:t.matches[t.matches.length-1].params,nextUrl:x,nextParams:n[n.length-1].params},r,{actionResult:S,defaultShouldRevalidate:s})),I&&E.push({key:T,routeId:P.routeId,path:P.path,matches:D,match:O,controller:new AbortController})}),[j,E]}function BV(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function Ek(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Ow(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function Mw(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];Oe(o,"No route found in manifest");let i={};for(let s in r){let c=o[s]!==void 0&&s!=="hasErrorBoundary";Aa(!c,'Route "'+o.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!c&&!uV.has(s)&&(i[s]=r[s])}Object.assign(o,i),Object.assign(o,At({},t(o),{lazy:void 0}))}async function ml(e,t,n,r,o,i,s,l,c){c===void 0&&(c={});let u,d,f,h=y=>{let S,v=new Promise((x,w)=>S=w);return f=()=>S(),t.signal.addEventListener("abort",f),Promise.race([y({request:t,params:n.params,context:c.requestContext}),v])};try{let y=n.route[e];if(n.route.lazy)if(y){let S,v=await Promise.all([h(y).catch(x=>{S=x}),Mw(n.route,i,o)]);if(S)throw S;d=v[0]}else if(await Mw(n.route,i,o),y=n.route[e],y)d=await h(y);else if(e==="action"){let S=new URL(t.url),v=S.pathname+S.search;throw lr(405,{method:t.method,pathname:v,routeId:n.route.id})}else return{type:Dt.data,data:void 0};else if(y)d=await h(y);else{let S=new URL(t.url),v=S.pathname+S.search;throw lr(404,{pathname:v})}Oe(d!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(y){u=Dt.error,d=y}finally{f&&t.signal.removeEventListener("abort",f)}if(HV(d)){let y=d.status;if(NV.has(y)){let v=d.headers.get("Location");if(Oe(v,"Redirects returned/thrown from loaders/actions must have a Location header"),!bk.test(v))v=Fm(new URL(t.url),r.slice(0,r.indexOf(n)+1),s,!0,v,l);else if(!c.isStaticRequest){let x=new URL(t.url),w=v.startsWith("//")?new URL(x.protocol+v):new URL(v),b=Xc(w.pathname,s)!=null;w.origin===x.origin&&b&&(v=w.pathname+w.search+w.hash)}if(c.isStaticRequest)throw d.headers.set("Location",v),d;return{type:Dt.redirect,status:y,location:v,revalidate:d.headers.get("X-Remix-Revalidate")!==null,reloadDocument:d.headers.get("X-Remix-Reload-Document")!==null}}if(c.isRouteRequest)throw{type:u===Dt.error?Dt.error:Dt.data,response:d};let S;try{let v=d.headers.get("Content-Type");v&&/\bapplication\/json\b/.test(v)?d.body==null?S=null:S=await d.json():S=await d.text()}catch(v){return{type:Dt.error,error:v}}return u===Dt.error?{type:u,error:new g0(y,d.statusText,S),headers:d.headers}:{type:Dt.data,data:S,statusCode:d.status,headers:d.headers}}if(u===Dt.error)return{type:u,error:d};if(WV(d)){var m,g;return{type:Dt.deferred,deferredData:d,statusCode:(m=d.init)==null?void 0:m.status,headers:((g=d.init)==null?void 0:g.headers)&&new Headers(d.init.headers)}}return{type:Dt.data,data:d}}function gl(e,t,n,r){let o=e.createURL(jk(t)).toString(),i={signal:n};if(r&&Rr(r.formMethod)){let{formMethod:s,formEncType:l}=r;i.method=s.toUpperCase(),l==="application/json"?(i.headers=new Headers({"Content-Type":l}),i.body=JSON.stringify(r.json)):l==="text/plain"?i.body=r.text:l==="application/x-www-form-urlencoded"&&r.formData?i.body=zm(r.formData):i.body=r.formData}return new Request(o,i)}function zm(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Lw(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function UV(e,t,n,r,o){let i={},s=null,l,c=!1,u={};return n.forEach((d,f)=>{let h=t[f].route.id;if(Oe(!qi(d),"Cannot handle redirect results in processLoaderData"),sa(d)){let m=Ml(e,h),g=d.error;r&&(g=Object.values(r)[0],r=void 0),s=s||{},s[m.route.id]==null&&(s[m.route.id]=g),i[h]=void 0,c||(c=!0,l=wk(d.error)?d.error.status:500),d.headers&&(u[h]=d.headers)}else Hi(d)?(o.set(h,d.deferredData),i[h]=d.deferredData.data):i[h]=d.data,d.statusCode!=null&&d.statusCode!==200&&!c&&(l=d.statusCode),d.headers&&(u[h]=d.headers)}),r&&(s=r,i[Object.keys(r)[0]]=void 0),{loaderData:i,errors:s,statusCode:l||200,loaderHeaders:u}}function $w(e,t,n,r,o,i,s,l){let{loaderData:c,errors:u}=UV(t,n,r,o,l);for(let d=0;d<i.length;d++){let{key:f,match:h,controller:m}=i[d];Oe(s!==void 0&&s[d]!==void 0,"Did not find corresponding fetcher result");let g=s[d];if(!(m&&m.signal.aborted))if(sa(g)){let y=Ml(e.matches,h==null?void 0:h.route.id);u&&u[y.route.id]||(u=At({},u,{[y.route.id]:g.error})),e.fetchers.delete(f)}else if(qi(g))Oe(!1,"Unhandled fetcher revalidation redirect");else if(Hi(g))Oe(!1,"Unhandled fetcher deferred data");else{let y=Qo(g.data);e.fetchers.set(f,y)}}return{loaderData:c,errors:u}}function Fw(e,t,n,r){let o=At({},t);for(let i of n){let s=i.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(o[s]=t[s]):e[s]!==void 0&&i.route.loader&&(o[s]=e[s]),r&&r.hasOwnProperty(s))break}return o}function Ml(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function zw(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function lr(e,t){let{pathname:n,routeId:r,method:o,type:i}=t===void 0?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(s="Bad Request",o&&n&&r?l="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?l="defer() is not supported in actions":i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(s="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",l='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",o&&n&&r?l="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new g0(e||500,s,new Error(l),!0)}function Bw(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(qi(n))return{result:n,idx:t}}}function jk(e){let t=typeof e=="string"?Vo(e):e;return Yc(At({},t,{hash:""}))}function VV(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Hi(e){return e.type===Dt.deferred}function sa(e){return e.type===Dt.error}function qi(e){return(e&&e.type)===Dt.redirect}function WV(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function HV(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function qV(e){return AV.has(e.toLowerCase())}function Rr(e){return IV.has(e.toLowerCase())}async function Uw(e,t,n,r,o,i){for(let s=0;s<n.length;s++){let l=n[s],c=t[s];if(!c)continue;let u=e.find(f=>f.route.id===c.route.id),d=u!=null&&!Ek(u,c)&&(i&&i[c.route.id])!==void 0;if(Hi(l)&&(o||d)){let f=r[s];Oe(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await Pk(l,f,o).then(h=>{h&&(n[s]=h||n[s])})}}}async function Pk(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Dt.data,data:e.deferredData.unwrappedData}}catch(o){return{type:Dt.error,error:o}}return{type:Dt.data,data:e.deferredData.data}}}function y0(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Bm(e,t){let n=typeof t=="string"?Vo(t).search:t.search;if(e[e.length-1].route.index&&y0(n||""))return e[e.length-1];let r=yk(e);return r[r.length-1]}function Vw(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:s}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function fp(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function GV(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function yl(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function QV(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Qo(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function KV(e,t){try{let n=e.sessionStorage.getItem(Ck);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function YV(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(Ck,JSON.stringify(n))}catch(r){Aa(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
527
+ * React Router v6.22.3
528
+ *
529
+ * Copyright (c) Remix Software Inc.
530
+ *
531
+ * This source code is licensed under the MIT license found in the
532
+ * LICENSE.md file in the root directory of this source tree.
533
+ *
534
+ * @license MIT
535
+ */function fc(){return fc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fc.apply(this,arguments)}const oh=p.createContext(null),Tk=p.createContext(null),ih=p.createContext(null),sh=p.createContext(null),Ti=p.createContext({outlet:null,matches:[],isDataRoute:!1}),kk=p.createContext(null);function ah(){return p.useContext(sh)!=null}function Wo(){return ah()||Oe(!1),p.useContext(sh).location}function Rk(e){p.useContext(ih).static||p.useLayoutEffect(e)}function Mt(){let{isDataRoute:e}=p.useContext(Ti);return e?uW():XV()}function XV(){ah()||Oe(!1);let e=p.useContext(oh),{basename:t,future:n,navigator:r}=p.useContext(ih),{matches:o}=p.useContext(Ti),{pathname:i}=Wo(),s=JSON.stringify(vk(o,n.v7_relativeSplatPath)),l=p.useRef(!1);return Rk(()=>{l.current=!0}),p.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=xk(u,JSON.parse(s),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:mi([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,s,i,e])}const JV=p.createContext(null);function ZV(e){let t=p.useContext(Ti).outlet;return t&&p.createElement(JV.Provider,{value:e},t)}function Xe(){let{matches:e}=p.useContext(Ti),t=e[e.length-1];return t?t.params:{}}function eW(e,t){return Dk(e,t)}function Dk(e,t,n,r){ah()||Oe(!1);let{navigator:o}=p.useContext(ih),{matches:i}=p.useContext(Ti),s=i[i.length-1],l=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=Wo(),d;if(t){var f;let S=typeof t=="string"?Vo(t):t;c==="/"||(f=S.pathname)!=null&&f.startsWith(c)||Oe(!1),d=S}else d=u;let h=d.pathname||"/",m=h;if(c!=="/"){let S=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(S.length).join("/")}let g=ia(e,{pathname:m}),y=iW(g&&g.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:mi([c,o.encodeLocation?o.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?c:mi([c,o.encodeLocation?o.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n,r);return t&&y?p.createElement(sh.Provider,{value:{location:fc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:zt.Pop}},y):y}function tW(){let e=cW(),t=wk(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:o},n):null,null)}const nW=p.createElement(tW,null);class rW extends p.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?p.createElement(Ti.Provider,{value:this.props.routeContext},p.createElement(kk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function oW(e){let{routeContext:t,match:n,children:r}=e,o=p.useContext(oh);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(Ti.Provider,{value:t},r)}function iW(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let s=e,l=(o=n)==null?void 0:o.errors;if(l!=null){let d=s.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id]));d>=0||Oe(!1),s=s.slice(0,Math.min(s.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<s.length;d++){let f=s[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:m}=n,g=f.route.loader&&h[f.route.id]===void 0&&(!m||m[f.route.id]===void 0);if(f.route.lazy||g){c=!0,u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((d,f,h)=>{let m,g=!1,y=null,S=null;n&&(m=l&&f.route.id?l[f.route.id]:void 0,y=f.route.errorElement||nW,c&&(u<0&&h===0?(dW("route-fallback",!1),g=!0,S=null):u===h&&(g=!0,S=f.route.hydrateFallbackElement||null)));let v=t.concat(s.slice(0,h+1)),x=()=>{let w;return m?w=y:g?w=S:f.route.Component?w=p.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,p.createElement(oW,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?p.createElement(rW,{location:n.location,revalidation:n.revalidation,component:y,error:m,children:x(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):x()},null)}var Ik=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Ik||{}),Bd=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Bd||{});function sW(e){let t=p.useContext(oh);return t||Oe(!1),t}function aW(e){let t=p.useContext(Tk);return t||Oe(!1),t}function lW(e){let t=p.useContext(Ti);return t||Oe(!1),t}function _k(e){let t=lW(),n=t.matches[t.matches.length-1];return n.route.id||Oe(!1),n.route.id}function cW(){var e;let t=p.useContext(kk),n=aW(Bd.UseRouteError),r=_k(Bd.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function uW(){let{router:e}=sW(Ik.UseNavigateStable),t=_k(Bd.UseNavigateStable),n=p.useRef(!1);return Rk(()=>{n.current=!0}),p.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,fc({fromRouteId:t},i)))},[e,t])}const Ww={};function dW(e,t,n){!t&&!Ww[e]&&(Ww[e]=!0)}function v0(e){return ZV(e.context)}function he(e){Oe(!1)}function fW(e){let{basename:t="/",children:n=null,location:r,navigationType:o=zt.Pop,navigator:i,static:s=!1,future:l}=e;ah()&&Oe(!1);let c=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:c,navigator:i,static:s,future:fc({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof r=="string"&&(r=Vo(r));let{pathname:d="/",search:f="",hash:h="",state:m=null,key:g="default"}=r,y=p.useMemo(()=>{let S=Xc(d,c);return S==null?null:{location:{pathname:S,search:f,hash:h,state:m,key:g},navigationType:o}},[c,d,f,h,m,g,o]);return y==null?null:p.createElement(ih.Provider,{value:u},p.createElement(sh.Provider,{children:n,value:y}))}function hW(e){let{children:t,location:n}=e;return eW(Um(t),n)}new Promise(()=>{});function Um(e,t){t===void 0&&(t=[]);let n=[];return p.Children.forEach(e,(r,o)=>{if(!p.isValidElement(r))return;let i=[...t,o];if(r.type===p.Fragment){n.push.apply(n,Um(r.props.children,i));return}r.type!==he&&Oe(!1),!r.props.index||!r.props.children||Oe(!1);let s={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=Um(r.props.children,i)),n.push(s)}),n}function pW(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:p.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
536
+ * React Router DOM v6.22.3
537
+ *
538
+ * Copyright (c) Remix Software Inc.
539
+ *
540
+ * This source code is licensed under the MIT license found in the
541
+ * LICENSE.md file in the root directory of this source tree.
542
+ *
543
+ * @license MIT
544
+ */function Ud(){return Ud=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ud.apply(this,arguments)}function Vm(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function mW(e,t){let n=Vm(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const gW="6";try{window.__reactRouterVersion=gW}catch{}function yW(e,t){return $V({basename:t==null?void 0:t.basename,future:Ud({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:aV({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||vW(),routes:e,mapRouteProperties:pW,window:t==null?void 0:t.window}).initialize()}function vW(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Ud({},t,{errors:xW(t.errors)})),t}function xW(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new g0(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let s=new i(o.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const wW=p.createContext({isTransitioning:!1}),SW=p.createContext(new Map),bW="startTransition",Hw=eg[bW],CW="flushSync",qw=B_[CW];function EW(e){Hw?Hw(e):e()}function vl(e){qw?qw(e):e()}class jW{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function PW(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=p.useState(n.state),[s,l]=p.useState(),[c,u]=p.useState({isTransitioning:!1}),[d,f]=p.useState(),[h,m]=p.useState(),[g,y]=p.useState(),S=p.useRef(new Map),{v7_startTransition:v}=r||{},x=p.useCallback(P=>{v?EW(P):P()},[v]),w=p.useCallback((P,T)=>{let{deletedFetchers:D,unstable_flushSync:_,unstable_viewTransitionOpts:O}=T;D.forEach($=>S.current.delete($)),P.fetchers.forEach(($,N)=>{$.data!==void 0&&S.current.set(N,$.data)});let I=n.window==null||typeof n.window.document.startViewTransition!="function";if(!O||I){_?vl(()=>i(P)):x(()=>i(P));return}if(_){vl(()=>{h&&(d&&d.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:O.currentLocation,nextLocation:O.nextLocation})});let $=n.window.document.startViewTransition(()=>{vl(()=>i(P))});$.finished.finally(()=>{vl(()=>{f(void 0),m(void 0),l(void 0),u({isTransitioning:!1})})}),vl(()=>m($));return}h?(d&&d.resolve(),h.skipTransition(),y({state:P,currentLocation:O.currentLocation,nextLocation:O.nextLocation})):(l(P),u({isTransitioning:!0,flushSync:!1,currentLocation:O.currentLocation,nextLocation:O.nextLocation}))},[n.window,h,d,S,x]);p.useLayoutEffect(()=>n.subscribe(w),[n,w]),p.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new jW)},[c]),p.useEffect(()=>{if(d&&s&&n.window){let P=s,T=d.promise,D=n.window.document.startViewTransition(async()=>{x(()=>i(P)),await T});D.finished.finally(()=>{f(void 0),m(void 0),l(void 0),u({isTransitioning:!1})}),m(D)}},[x,s,d,n.window]),p.useEffect(()=>{d&&s&&o.location.key===s.location.key&&d.resolve()},[d,h,o.location,s]),p.useEffect(()=>{!c.isTransitioning&&g&&(l(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),y(void 0))},[c.isTransitioning,g]),p.useEffect(()=>{},[]);let b=p.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:P=>n.navigate(P),push:(P,T,D)=>n.navigate(P,{state:T,preventScrollReset:D==null?void 0:D.preventScrollReset}),replace:(P,T,D)=>n.navigate(P,{replace:!0,state:T,preventScrollReset:D==null?void 0:D.preventScrollReset})}),[n]),j=n.basename||"/",E=p.useMemo(()=>({router:n,navigator:b,static:!1,basename:j}),[n,b,j]);return p.createElement(p.Fragment,null,p.createElement(oh.Provider,{value:E},p.createElement(Tk.Provider,{value:o},p.createElement(SW.Provider,{value:S.current},p.createElement(wW.Provider,{value:c},p.createElement(fW,{basename:j,location:o.location,navigationType:o.historyAction,navigator:b,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},o.initialized||n.future.v7_partialHydration?p.createElement(TW,{routes:n.routes,future:n.future,state:o}):t))))),null)}function TW(e){let{routes:t,future:n,state:r}=e;return Dk(t,void 0,r,n)}var Gw;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Gw||(Gw={}));var Qw;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Qw||(Qw={}));function x0(e){let t=p.useRef(Vm(e)),n=p.useRef(!1),r=Wo(),o=p.useMemo(()=>mW(r.search,n.current?null:t.current),[r.search]),i=Mt(),s=p.useCallback((l,c)=>{const u=Vm(typeof l=="function"?l(o):l);n.current=!0,i("?"+u,c)},[i,o]);return[o,s]}const kW=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Jc(e,t){const n=RW(e);if(typeof n.path!="string"){const{webkitRelativePath:r}=e;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function RW(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=kW.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var Xa=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(u){o(u)}},s=c=>{try{l(n.throw(c))}catch(u){o(u)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,s);l((n=n.apply(e,t)).next())});const DW=[".DS_Store","Thumbs.db"];function IW(e){return Xa(this,null,function*(){return Vd(e)&&_W(e.dataTransfer)?MW(e.dataTransfer,e.type):AW(e)?NW(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?OW(e):[]})}function _W(e){return Vd(e)}function AW(e){return Vd(e)&&Vd(e.target)}function Vd(e){return typeof e=="object"&&e!==null}function NW(e){return Wm(e.target.files).map(t=>Jc(t))}function OW(e){return Xa(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Jc(n))})}function MW(e,t){return Xa(this,null,function*(){if(e.items){const n=Wm(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(LW));return Kw(Ak(r))}return Kw(Wm(e.files).map(n=>Jc(n)))})}function Kw(e){return e.filter(t=>DW.indexOf(t.name)===-1)}function Wm(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function LW(e){if(typeof e.webkitGetAsEntry!="function")return Yw(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?Nk(t):Yw(e)}function Ak(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?Ak(n):[n]],[])}function Yw(e){const t=e.getAsFile();if(!t)return Promise.reject(`${e} is not a File`);const n=Jc(t);return Promise.resolve(n)}function $W(e){return Xa(this,null,function*(){return e.isDirectory?Nk(e):FW(e)})}function Nk(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function i(){t.readEntries(s=>Xa(this,null,function*(){if(s.length){const l=Promise.all(s.map($W));o.push(l),i()}else try{const l=yield Promise.all(o);n(l)}catch(l){r(l)}}),s=>{r(s)})}i()})}function FW(e){return Xa(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const o=Jc(r,e.fullPath);t(o)},r=>{n(r)})})})}function zW(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return n.some(s=>{const l=s.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?i===l.replace(/\/.*$/,""):o===l})}return!0}var BW=Object.defineProperty,UW=Object.defineProperties,VW=Object.getOwnPropertyDescriptors,Xw=Object.getOwnPropertySymbols,WW=Object.prototype.hasOwnProperty,HW=Object.prototype.propertyIsEnumerable,Jw=(e,t,n)=>t in e?BW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qW=(e,t)=>{for(var n in t||(t={}))WW.call(t,n)&&Jw(e,n,t[n]);if(Xw)for(var n of Xw(t))HW.call(t,n)&&Jw(e,n,t[n]);return e},GW=(e,t)=>UW(e,VW(t));const QW="file-invalid-type",KW="file-too-large",YW="file-too-small",XW="too-many-files",JW=e=>{e=Array.isArray(e)&&e.length===1?e[0]:e;const t=Array.isArray(e)?`one of ${e.join(", ")}`:e;return{code:QW,message:`File type must be ${t}`}},Zw=e=>({code:KW,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),eS=e=>({code:YW,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),ZW={code:XW,message:"Too many files"};function Ok(e,t){const n=e.type==="application/x-moz-file"||zW(e,t);return[n,n?null:JW(t)]}function Mk(e,t,n){if(Fi(e.size))if(Fi(t)&&Fi(n)){if(e.size>n)return[!1,Zw(n)];if(e.size<t)return[!1,eS(t)]}else{if(Fi(t)&&e.size<t)return[!1,eS(t)];if(Fi(n)&&e.size>n)return[!1,Zw(n)]}return[!0,null]}function Fi(e){return e!=null}function eH({files:e,accept:t,minSize:n,maxSize:r,multiple:o,maxFiles:i,validator:s}){return!o&&e.length>1||o&&i>=1&&e.length>i?!1:e.every(l=>{const[c]=Ok(l,t),[u]=Mk(l,n,r),d=s?s(l):null;return c&&u&&!d})}function Wd(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Iu(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,t=>t==="Files"||t==="application/x-moz-file"):!!e.target&&!!e.target.files}function tS(e){e.preventDefault()}function tH(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function nH(e){return e.indexOf("Edge/")!==-1}function rH(e=window.navigator.userAgent){return tH(e)||nH(e)}function Xr(...e){return(t,...n)=>e.some(r=>(!Wd(t)&&r&&r(t,...n),Wd(t)))}function oH(){return"showOpenFilePicker"in window}function iH(e){return Fi(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let o=!0;return Lk(n)||(console.warn(`Skipped "${n}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),o=!1),(!Array.isArray(r)||!r.every($k))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),o=!1),o}).reduce((n,[r,o])=>GW(qW({},n),{[r]:o}),{})}]:e}function sH(e){if(Fi(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>Lk(t)||$k(t)).join(",")}function aH(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function lH(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Lk(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function $k(e){return/^.*\.[\w]+$/.test(e)}var cH=Object.defineProperty,uH=Object.defineProperties,dH=Object.getOwnPropertyDescriptors,Hd=Object.getOwnPropertySymbols,Fk=Object.prototype.hasOwnProperty,zk=Object.prototype.propertyIsEnumerable,nS=(e,t,n)=>t in e?cH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sn=(e,t)=>{for(var n in t||(t={}))Fk.call(t,n)&&nS(e,n,t[n]);if(Hd)for(var n of Hd(t))zk.call(t,n)&&nS(e,n,t[n]);return e},Zo=(e,t)=>uH(e,dH(t)),qd=(e,t)=>{var n={};for(var r in e)Fk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Hd)for(var r of Hd(e))t.indexOf(r)<0&&zk.call(e,r)&&(n[r]=e[r]);return n};const w0=p.forwardRef((e,t)=>{var n=e,{children:r}=n,o=qd(n,["children"]);const i=Uk(o),{open:s}=i,l=qd(i,["open"]);return p.useImperativeHandle(t,()=>({open:s}),[s]),C.createElement(p.Fragment,null,r(Zo(Sn({},l),{open:s})))});w0.displayName="Dropzone";const Bk={disabled:!1,getFilesFromEvent:IW,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};w0.defaultProps=Bk;w0.propTypes={children:st.func,accept:st.objectOf(st.arrayOf(st.string)),multiple:st.bool,preventDropOnDocument:st.bool,noClick:st.bool,noKeyboard:st.bool,noDrag:st.bool,noDragEventsBubbling:st.bool,minSize:st.number,maxSize:st.number,maxFiles:st.number,disabled:st.bool,getFilesFromEvent:st.func,onFileDialogCancel:st.func,onFileDialogOpen:st.func,useFsAccessApi:st.bool,autoFocus:st.bool,onDragEnter:st.func,onDragLeave:st.func,onDragOver:st.func,onDrop:st.func,onDropAccepted:st.func,onDropRejected:st.func,onError:st.func,validator:st.func};const Hm={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Uk(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:o,minSize:i,multiple:s,maxFiles:l,onDragEnter:c,onDragLeave:u,onDragOver:d,onDrop:f,onDropAccepted:h,onDropRejected:m,onFileDialogCancel:g,onFileDialogOpen:y,useFsAccessApi:S,autoFocus:v,preventDropOnDocument:x,noClick:w,noKeyboard:b,noDrag:j,noDragEventsBubbling:E,onError:P,validator:T}=Sn(Sn({},Bk),e),D=p.useMemo(()=>sH(t),[t]),_=p.useMemo(()=>iH(t),[t]),O=p.useMemo(()=>typeof y=="function"?y:rS,[y]),I=p.useMemo(()=>typeof g=="function"?g:rS,[g]),$=p.useRef(null),N=p.useRef(null),[L,M]=p.useReducer(fH,Hm),{isFocused:R,isFileDialogActive:k}=L,F=p.useRef(typeof window<"u"&&window.isSecureContext&&S&&oH()),q=()=>{!F.current&&k&&setTimeout(()=>{if(N.current){const{files:re}=N.current;re.length||(M({type:"closeDialog"}),I())}},300)};p.useEffect(()=>(window.addEventListener("focus",q,!1),()=>{window.removeEventListener("focus",q,!1)}),[N,k,I,F]);const G=p.useRef([]),oe=re=>{$.current&&$.current.contains(re.target)||(re.preventDefault(),G.current=[])};p.useEffect(()=>(x&&(document.addEventListener("dragover",tS,!1),document.addEventListener("drop",oe,!1)),()=>{x&&(document.removeEventListener("dragover",tS),document.removeEventListener("drop",oe))}),[$,x]),p.useEffect(()=>(!n&&v&&$.current&&$.current.focus(),()=>{}),[$,v,n]);const xe=p.useCallback(re=>{P?P(re):console.error(re)},[P]),me=p.useCallback(re=>{re.preventDefault(),re.persist(),ln(re),G.current=[...G.current,re.target],Iu(re)&&Promise.resolve(r(re)).then(De=>{if(Wd(re)&&!E)return;const qe=De.length,nt=qe>0&&eH({files:De,accept:D,minSize:i,maxSize:o,multiple:s,maxFiles:l,validator:T}),Lt=qe>0&&!nt;M({isDragAccept:nt,isDragReject:Lt,isDragActive:!0,type:"setDraggedFiles"}),c&&c(re)}).catch(De=>xe(De))},[r,c,xe,E,D,i,o,s,l,T]),Ce=p.useCallback(re=>{re.preventDefault(),re.persist(),ln(re);const De=Iu(re);if(De&&re.dataTransfer)try{re.dataTransfer.dropEffect="copy"}catch{}return De&&d&&d(re),!1},[d,E]),je=p.useCallback(re=>{re.preventDefault(),re.persist(),ln(re);const De=G.current.filter(nt=>$.current&&$.current.contains(nt)),qe=De.indexOf(re.target);qe!==-1&&De.splice(qe,1),G.current=De,!(De.length>0)&&(M({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Iu(re)&&u&&u(re))},[$,u,E]),Be=p.useCallback((re,De)=>{const qe=[],nt=[];re.forEach(Lt=>{const[Hr,or]=Ok(Lt,D),[Di,In]=Mk(Lt,i,o),qr=T?T(Lt):null;if(Hr&&Di&&!qr)qe.push(Lt);else{let Cr=[or,In];qr&&(Cr=Cr.concat(qr)),nt.push({file:Lt,errors:Cr.filter(Ho=>Ho)})}}),(!s&&qe.length>1||s&&l>=1&&qe.length>l)&&(qe.forEach(Lt=>{nt.push({file:Lt,errors:[ZW]})}),qe.splice(0)),M({acceptedFiles:qe,fileRejections:nt,type:"setFiles"}),f&&f(qe,nt,De),nt.length>0&&m&&m(nt,De),qe.length>0&&h&&h(qe,De)},[M,s,D,i,o,l,f,h,m,T]),Me=p.useCallback(re=>{re.preventDefault(),re.persist(),ln(re),G.current=[],Iu(re)&&Promise.resolve(r(re)).then(De=>{Wd(re)&&!E||Be(De,re)}).catch(De=>xe(De)),M({type:"reset"})},[r,Be,xe,E]),Ke=p.useCallback(()=>{if(F.current){M({type:"openDialog"}),O();const re={multiple:s,types:_};window.showOpenFilePicker(re).then(De=>r(De)).then(De=>{Be(De,null),M({type:"closeDialog"})}).catch(De=>{aH(De)?(I(De),M({type:"closeDialog"})):lH(De)?(F.current=!1,N.current?(N.current.value=null,N.current.click()):xe(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):xe(De)});return}N.current&&(M({type:"openDialog"}),O(),N.current.value=null,N.current.click())},[M,O,I,S,Be,xe,_,s]),St=p.useCallback(re=>{!$.current||!$.current.isEqualNode(re.target)||(re.key===" "||re.key==="Enter"||re.keyCode===32||re.keyCode===13)&&(re.preventDefault(),Ke())},[$,Ke]),X=p.useCallback(()=>{M({type:"focus"})},[]),ke=p.useCallback(()=>{M({type:"blur"})},[]),tt=p.useCallback(()=>{w||(rH()?setTimeout(Ke,0):Ke())},[w,Ke]),Ne=re=>n?null:re,Ve=re=>b?null:Ne(re),Rt=re=>j?null:Ne(re),ln=re=>{E&&re.stopPropagation()},br=p.useMemo(()=>(re={})=>{var De=re,{refKey:qe="ref",role:nt,onKeyDown:Lt,onFocus:Hr,onBlur:or,onClick:Di,onDragEnter:In,onDragOver:qr,onDragLeave:Cr,onDrop:Ho}=De,Ja=qd(De,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return Sn(Sn({onKeyDown:Ve(Xr(Lt,St)),onFocus:Ve(Xr(Hr,X)),onBlur:Ve(Xr(or,ke)),onClick:Ne(Xr(Di,tt)),onDragEnter:Rt(Xr(In,me)),onDragOver:Rt(Xr(qr,Ce)),onDragLeave:Rt(Xr(Cr,je)),onDrop:Rt(Xr(Ho,Me)),role:typeof nt=="string"&&nt!==""?nt:"presentation",[qe]:$},!n&&!b?{tabIndex:0}:{}),Ja)},[$,St,X,ke,tt,me,Ce,je,Me,b,j,n]),en=p.useCallback(re=>{re.stopPropagation()},[]),uo=p.useMemo(()=>(re={})=>{var De=re,{refKey:qe="ref",onChange:nt,onClick:Lt}=De,Hr=qd(De,["refKey","onChange","onClick"]);const or={accept:D,multiple:s,type:"file",style:{display:"none"},onChange:Ne(Xr(nt,Me)),onClick:Ne(Xr(Lt,en)),tabIndex:-1,[qe]:N};return Sn(Sn({},or),Hr)},[N,t,s,Me,n]);return Zo(Sn({},L),{isFocused:R&&!n,getRootProps:br,getInputProps:uo,rootRef:$,inputRef:N,open:Ne(Ke)})}function fH(e,t){switch(t.type){case"focus":return Zo(Sn({},e),{isFocused:!0});case"blur":return Zo(Sn({},e),{isFocused:!1});case"openDialog":return Zo(Sn({},Hm),{isFileDialogActive:!0});case"closeDialog":return Zo(Sn({},e),{isFileDialogActive:!1});case"setDraggedFiles":return Zo(Sn({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Zo(Sn({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Sn({},Hm);default:return e}}function rS(){}const[hH,pH]=Tn("Dropzone component was not found in tree");function S0(e){const t=n=>{const{children:r,...o}=U(`Dropzone${O0(e)}`,{},n),i=pH(),s=Ao(r)?r:C.createElement("span",null,r);return i[e]?p.cloneElement(s,o):null};return t.displayName=`@mantine/dropzone/${O0(e)}`,t}const mH=S0("accept"),gH=S0("reject"),yH=S0("idle");var hc={root:"m-d46a4834",inner:"m-b85f7144",fullScreen:"m-96f6e9ad",dropzone:"m-7946116d"};const vH={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},xH=(e,{radius:t,variant:n,acceptColor:r,rejectColor:o})=>{const i=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),s=e.variantColorResolver({color:o||"red",theme:e,variant:n});return{root:{"--dropzone-radius":gt(t),"--dropzone-accept-color":i.color,"--dropzone-accept-bg":i.background,"--dropzone-reject-color":s.color,"--dropzone-reject-bg":s.background}}},ki=Q((e,t)=>{const n=U("Dropzone",vH,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,radius:u,disabled:d,loading:f,multiple:h,maxSize:m,accept:g,children:y,onDropAny:S,onDrop:v,onReject:x,openRef:w,name:b,maxFiles:j,autoFocus:E,activateOnClick:P,activateOnDrag:T,dragEventsBubbling:D,activateOnKeyboard:_,onDragEnter:O,onDragLeave:I,onDragOver:$,onFileDialogCancel:N,onFileDialogOpen:L,preventDropOnDocument:M,useFsAccessApi:R,getFilesFromEvent:k,validator:F,rejectColor:q,acceptColor:G,enablePointerEvents:oe,loaderProps:xe,inputProps:me,mod:Ce,...je}=n,Be=de({name:"Dropzone",classes:hc,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:xH}),{getRootProps:Me,getInputProps:Ke,isDragAccept:St,isDragReject:X,open:ke}=Uk({onDrop:S,onDropAccepted:v,onDropRejected:x,disabled:d||f,accept:Array.isArray(g)?g.reduce((Ne,Ve)=>({...Ne,[Ve]:[]}),{}):g,multiple:h,maxSize:m,maxFiles:j,autoFocus:E,noClick:!P,noDrag:!T,noDragEventsBubbling:!D,noKeyboard:!_,onDragEnter:O,onDragLeave:I,onDragOver:$,onFileDialogCancel:N,onFileDialogOpen:L,preventDropOnDocument:M,useFsAccessApi:R,validator:F,...k?{getFilesFromEvent:k}:null});ig(w,ke);const tt=!St&&!X;return C.createElement(hH,{value:{accept:St,reject:X,idle:tt}},C.createElement(W,{...Me({ref:t}),...Be("root",{focusable:!0}),...je,mod:[{accept:St,reject:X,idle:tt,loading:f,"activate-on-click":P},Ce]},C.createElement(Xy,{visible:f,overlayProps:{radius:u},unstyled:l,loaderProps:xe}),C.createElement("input",{...Ke(me),name:b}),C.createElement("div",{...Be("inner"),"data-enable-pointer-events":oe||void 0},y)))});ki.classes=hc;ki.displayName="@mantine/dropzone/Dropzone";ki.Accept=mH;ki.Idle=yH;ki.Reject=gH;const wH={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:zr("max"),withinPortal:!0},b0=Q((e,t)=>{const n=U("DropzoneFullScreen",wH,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,active:u,onDrop:d,onReject:f,zIndex:h,withinPortal:m,portalProps:g,...y}=n,S=de({name:"DropzoneFullScreen",classes:hc,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"fullScreen"}),{resolvedClassNames:v,resolvedStyles:x}=Jd({classNames:r,styles:s,props:n}),[w,b]=p.useState(0),[j,{open:E,close:P}]=I2(!1),T=_=>{var O;(O=_.dataTransfer)!=null&&O.types.includes("Files")&&(b(I=>I+1),E())},D=()=>{b(_=>_-1)};return p.useEffect(()=>{w===0&&P()},[w]),p.useEffect(()=>{if(u)return document.addEventListener("dragenter",T,!1),document.addEventListener("dragleave",D,!1),()=>{document.removeEventListener("dragenter",T,!1),document.removeEventListener("dragleave",D,!1)}},[u]),C.createElement(ys,{...g,withinPortal:m},C.createElement(W,{...S("fullScreen",{style:{opacity:j?1:0,pointerEvents:j?"all":"none",zIndex:h}}),ref:t},C.createElement(ki,{...y,classNames:v,styles:x,unstyled:l,className:hc.dropzone,onDrop:_=>{d==null||d(_),P(),b(0)},onReject:_=>{f==null||f(_),P(),b(0)}})))});b0.classes=hc;b0.displayName="@mantine/dropzone/DropzoneFullScreen";ki.FullScreen=b0;const _u=ki,SH='{"resourceType": "Bundle"}';function hp({id:e,title:t,message:n,color:r,icon:o,withCloseButton:i=!1,method:s="show",loading:l}){oo[s]({id:e,loading:l,title:t,message:n,color:r,icon:o,withCloseButton:i,autoClose:!1})}function bH(){const e=kt(),t=ne(),[n,r]=p.useState({}),o=p.useCallback(async(l,c)=>{const u="batch-upload";hp({id:u,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let d=JSON.parse(l);d.type!=="batch"&&d.type!=="transaction"&&(d=MP(d));const f=await t.executeBatch(d);r(h=>({...h,[c]:f})),hp({id:u,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:a.jsx(Jf,{size:"1rem"}),withCloseButton:!0})}catch(d){hp({id:u,title:"Batch Upload Failed",color:"red",message:Te(d),method:"update",icon:a.jsx(Md,{size:"1rem"}),withCloseButton:!0})}},[t]),i=p.useCallback(async l=>{for(const c of l){const u=new FileReader;u.onload=d=>{var f;return o((f=d.target)==null?void 0:f.result,c.name)},u.readAsText(c)}},[o]),s=p.useCallback(async l=>{await o(l.input,"JSON Data")},[o]);return a.jsxs(Se,{children:[a.jsx(ue,{children:"Batch Create"}),a.jsxs("p",{children:["Use this page to create, read, or update multiple resources. For more details, see ",a.jsx("a",{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Input"}),a.jsxs(Ge,{defaultValue:"upload",children:[a.jsxs(Ge.List,{children:[a.jsx(Ge.Tab,{value:"upload",children:"File Upload"}),a.jsx(Ge.Tab,{value:"json",children:"JSON"})]}),a.jsx(Ge.Panel,{value:"upload",pt:"xs",children:a.jsx(_u,{onDrop:i,accept:["application/json"],children:a.jsxs(Y,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[a.jsx(_u.Accept,{children:a.jsx(dw,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),a.jsx(_u.Reject,{children:a.jsx(Md,{size:50,stroke:1.5,color:e.colors.red[5]})}),a.jsx(_u.Idle,{children:a.jsx(dw,{size:50,stroke:1.5})}),a.jsxs("div",{children:[a.jsx(se,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),a.jsx(se,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),a.jsx(Ge.Panel,{value:"json",pt:"xs",children:a.jsxs(We,{onSubmit:s,children:[a.jsx(Va,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:SH,deserialize:JSON.parse}),a.jsx(Y,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(te,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Output"}),a.jsxs(Ge,{defaultValue:Object.keys(n)[0],children:[a.jsx(Ge.List,{children:Object.keys(n).map(l=>a.jsx(Ge.Tab,{value:l,children:l},l))}),Object.keys(n).map(l=>a.jsx(Ge.Panel,{value:l,children:a.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[l],void 0,2)})},l))]}),a.jsx(Y,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(te,{onClick:()=>r({}),children:"Start over"})})]})]})}function CH(){const{resourceType:e}=Xe(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=Ia("Questionnaire",`subject-type=${e}`);return r?r.length===0?a.jsxs(Se,{children:[a.jsxs(ue,{children:["No apps for ",e]}),a.jsx(Fe,{to:`/${e}`,children:"Return to search page"})]}):a.jsx(Se,{children:a.jsx("div",{children:r.map(o=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(Fe,{to:`/forms/${o.id}?subject=`+n.map(i=>`${e}/${i}`).join(","),children:o.name})}),a.jsx("p",{children:o.description})]},o.id))})}):a.jsx($r,{})}function EH(){const e=ne(),[t,n]=p.useState(),[r,o]=p.useState(!1);return a.jsx(Se,{width:450,children:a.jsxs(We,{style:{maxWidth:400},onSubmit:i=>{n(void 0),e.post("auth/changepassword",i).then(()=>o(!0)).catch(s=>n(lt(s)))},children:[a.jsxs(on,{style:{flexDirection:"column"},children:[a.jsx(Vr,{size:32}),a.jsx(ue,{children:"Change password"})]}),!r&&a.jsxs(be,{gap:"xl",mt:"xl",children:[a.jsx(Nr,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:ze(t,"oldPassword")}),a.jsx(Nr,{name:"newPassword",label:"New password",required:!0,error:ze(t,"newPassword")}),a.jsx(Nr,{name:"confirmPassword",label:"Confirm new password",required:!0,error:ze(t,"confirmPassword")}),a.jsx(Y,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(te,{type:"submit",children:"Change password"})})]}),r&&a.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const qm=["Form","JSON","Profiles"],jH=["Profiles"],pp=qm[0].toLowerCase();function PH(){const e=Mt(),t=kt(),{resourceType:n}=Xe(),[r,o]=p.useState(()=>{const s=window.location.pathname.split("/").pop();return s&&qm.map(l=>l.toLowerCase()).includes(s)?s:pp});function i(s){s||(s=pp),o(s),e(`/${n}/new/${s}`)}return a.jsxs(a.Fragment,{children:[a.jsxs(zn,{children:[a.jsxs(se,{p:"md",fw:500,children:["New ",n]}),a.jsx(vr,{children:a.jsx(Ge,{defaultValue:pp,value:r,onChange:i,children:a.jsx(Ge.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:qm.map(s=>a.jsx(Ge.Tab,{value:s.toLowerCase(),px:"md",children:jH.includes(s)?a.jsxs(Y,{gap:"xs",wrap:"nowrap",children:[s,a.jsx(kc,{color:t.primaryColor,size:"sm",children:"Beta"})]}):s},s))})})})]}),a.jsx(v0,{})]})}function TH(){return a.jsx(Se,{children:a.jsxs(be,{children:[a.jsx(ue,{order:1,children:"Unexpected Error"}),a.jsx(se,{children:"We're sorry, something went wrong."}),a.jsxs(se,{children:["Please contact ",a.jsx(He,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}const kH="_root_1fbwr_1",RH="_entry_1fbwr_8",DH="_key_1fbwr_13",IH="_value_1fbwr_20",lh={root:kH,entry:RH,key:DH,value:IH};function Ie(e){return a.jsx(vr,{children:a.jsx("div",{className:lh.root,children:e.children})})}Ie.Entry=function(t){return a.jsx("div",{className:lh.entry,children:t.children})};Ie.Key=function(t){return a.jsx("div",{className:lh.key,children:t.children})};Ie.Value=function(t){return a.jsx("div",{className:lh.value,children:t.children})};function _H(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function Vk(e){var n,r;const t=ct(e.patient);return t?a.jsxs(Ie,{children:[a.jsx(Pi,{value:t,size:"lg",color:_H(t)}),a.jsxs(Ie.Entry,{children:[a.jsx(Ie.Key,{children:"Name"}),a.jsx(Ie.Value,{children:a.jsx(Fe,{to:t,fw:500,children:t.name?a.jsx(Wv,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&a.jsxs(a.Fragment,{children:[a.jsxs(Ie.Entry,{children:[a.jsx(Ie.Key,{children:"DoB"}),a.jsx(Ie.Value,{children:t.birthDate})]}),a.jsxs(Ie.Entry,{children:[a.jsx(Ie.Key,{children:"Age"}),a.jsx(Ie.Value,{children:fL(t.birthDate)})]})]}),t.gender&&a.jsxs(Ie.Entry,{children:[a.jsx(Ie.Key,{children:"Gender"}),a.jsx(Ie.Value,{children:t.gender})]}),t.address&&a.jsxs(Ie.Entry,{children:[a.jsx(Ie.Key,{children:"State"}),a.jsx(Ie.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(o=>a.jsxs(Ie.Entry,{children:[a.jsx(Ie.Key,{children:o==null?void 0:o.system}),a.jsx(Ie.Value,{children:o==null?void 0:o.value})]},`${o==null?void 0:o.system}-${o==null?void 0:o.value}`))]}):null}function Wk(e){const t=ct(e.resource);if(!t)return null;const n=[{key:"Type",value:a.jsx(Fe,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(s,l){s&&l&&n.push({key:s,value:l})}function o(s){s&&r(s.system,s.value)}function i(s,l){Array.isArray(l)?l.forEach(c=>i(s,c)):typeof l=="string"?r(s,l):l&&(Array.isArray(l.coding)?r(s,l.coding.map(c=>c.display||c.code).join(", ")):r(s,l.text))}if("name"in t){const s=Do(t);s!==ht(t)&&r("Name",s)}return"category"in t&&i("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&i("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(o):o(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),a.jsx(Ie,{children:n.map(s=>a.jsxs(Ie.Entry,{children:[a.jsx(Ie.Key,{children:s.key}),a.jsx(Ie.Value,{children:s.value})]},`${s.key}-${s.value}`))})}function C0(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function AH(e){var t;if(e.resourceType==="Specimen")return e;if(e.resourceType==="Observation")return e.specimen;if(e.resourceType==="DiagnosticReport"||e.resourceType==="ServiceRequest")return(t=e.specimen)==null?void 0:t[0]}function Xu(e,t){return new Promise((n,r)=>{var i;const o=new MessageChannel;o.port1.onmessage=({data:s})=>{o.port1.close(),s.error?r(s.error):n(s.result)},(i=e.contentWindow)==null||i.postMessage(t,"https://codeeditor.medplum.com",[o.port2])})}function Ri(e){var t;return Hf((t=e.getActiveLogin())==null?void 0:t.project)}function NH(e,t){const n=new Blob([e],{type:Gt.JSON}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r;const i=t??new Date().toISOString().replace(/\D/g,"");o.download=`${i}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(r)}function OH(){const{id:e}=Xe(),t=Wo(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=ne(),[i,s]=p.useState(!0),[l,c]=p.useState(),[u,d]=p.useState(),[f,h]=p.useState(),[m,g]=p.useState(),[y,S]=p.useState();if(p.useEffect(()=>{const w={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const b=r.split(",").filter(j=>!!j);b.length===1&&w.entry.push({request:{method:"GET",url:b[0]}}),d(b)}o.executeBatch(w).then(b=>{var j,E,P,T,D,_,O,I;((P=(E=(j=b.entry)==null?void 0:j[0])==null?void 0:E.response)==null?void 0:P.status)!=="200"?g((_=(D=(T=b.entry)==null?void 0:T[0])==null?void 0:D.response)==null?void 0:_.outcome):(c((O=b.entry[0])==null?void 0:O.resource),h((I=b.entry[1])==null?void 0:I.resource)),s(!1)}).catch(b=>{g(b),s(!1)})},[o,e,r]),m)return a.jsx(Se,{children:a.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)})});if(y)return a.jsxs(Se,{children:[a.jsx(ue,{children:l==null?void 0:l.title}),a.jsx("p",{children:"Your response has been recorded."}),a.jsxs("ul",{children:[y.length===1&&a.jsx("li",{children:a.jsx(Fe,{to:y[0],children:"Review your answers"})}),y.length>1&&a.jsxs("li",{children:["Review your answers:",a.jsx("ul",{children:y.map(w=>a.jsx("li",{children:a.jsx(Fe,{to:w,children:ht(w)})},w.id))})]}),f&&a.jsx("li",{children:a.jsxs(Fe,{to:f,children:["Back to ",Do(f)]})}),a.jsx("li",{children:a.jsx(Fe,{to:"/",children:"Go back home"})})]})]});if(i||!l)return a.jsx($r,{});const v=f&&C0(f);return a.jsxs(a.Fragment,{children:[a.jsxs(zn,{shadow:"xs",radius:0,children:[v&&a.jsx(Vk,{patient:v}),f&&f.resourceType!=="Patient"&&a.jsx(Wk,{resource:f}),a.jsx(W,{px:"xl",py:"md",children:a.jsxs(se,{children:[Do(l),u&&u.length>1&&a.jsxs(a.Fragment,{children:[" (for ",u.length," resources)"]})]})})]}),a.jsx(Se,{children:a.jsx(ok,{questionnaire:l,subject:f&&ft(f),onSubmit:x})})]});async function x(w){const b=[];if(!u||u.length===0)b.push(await o.createResource(w));else for(const j of u)b.push(await o.createResource({...w,subject:{reference:j}}));S(b)}}const MH="_paper_unw9o_1",LH={paper:MH},$H={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function Hk(e,t){const n=e.resourceType||FH(t),r=e.fields??zH(n),o=e.filters??(e.resourceType?void 0:BH(n)),i=e.sortRules??UH(n),s=e.offset??0,l=e.count??Qf;return{...e,resourceType:n,fields:r,filters:o,sortRules:i,offset:s,count:l}}function FH(e){var t,n;return localStorage.getItem("defaultResourceType")??((n=(t=e==null?void 0:e.option)==null?void 0:t.find(r=>r.id==="defaultResourceType"))==null?void 0:n.valueString)??"Patient"}function zH(e){const t=E0(e);if(t!=null&&t.fields)return t.fields;const n=["id","_lastUpdated"];switch(e){case"Patient":n.push("name","birthDate","gender");break;case"AccessPolicy":case"Bot":case"ClientApplication":case"Practitioner":case"Project":case"Organization":case"Questionnaire":case"UserConfiguration":n.push("name");break;case"CodeSystem":case"ValueSet":n.push("name","title","status");break;case"Condition":n.push("subject","code","clinicalStatus");break;case"Device":n.push("manufacturer","deviceName","patient");break;case"DeviceDefinition":n.push("manufacturer[x]","deviceName");break;case"DeviceRequest":n.push("code[x]","subject");break;case"DiagnosticReport":case"Observation":n.push("subject","code","status");break;case"Encounter":n.push("subject");break;case"ServiceRequest":n.push("subject","code","status","orderDetail");break;case"Subscription":n.push("criteria");break;case"User":n.push("email");break}return n}function BH(e){var t;return(t=E0(e))==null?void 0:t.filters}function UH(e){const t=E0(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function E0(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function VH(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function WH(e,t){const n={resourceType:e.resourceType,count:1e3,offset:0,filters:e.filters},r=Hk(n,t.getUserConfiguration()),o=await t.search(r.resourceType,ra({...r,total:"accurate",fields:void 0}));return MP(o)}function oS(){const e=ne(),t=Mt(),n=Wo(),[r,o]=p.useState();return p.useEffect(()=>{const i=j$(n.pathname+n.search),s=Hk(i,e.getUserConfiguration());n.pathname===`/${s.resourceType}`&&n.search===ra(s)?(VH(s),o(s)):t(`/${s.resourceType}${ra(s)}`)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?a.jsx($r,{}):a.jsx(zn,{shadow:"xs",m:"md",p:"xs",className:LH.paper,children:a.jsx(Kc,{checkboxesEnabled:!0,search:r,onClick:i=>t(`/${i.resource.resourceType}/${i.resource.id}`),onAuxClick:i=>window.open(`/${i.resource.resourceType}/${i.resource.id}`,"_blank"),onChange:i=>{t(`/${r.resourceType}${ra(i.definition)}`)},onNew:()=>{t($H[r.resourceType]??`/${r.resourceType}/new`)},onExportCsv:()=>{const i=e.fhirUrl(r.resourceType,"$csv")+ra(r);e.download(i).then(s=>{window.open(window.URL.createObjectURL(s),"_blank")}).catch(s=>fe({color:"red",message:Te(s),autoClose:!1}))},onExportTransactionBundle:async()=>{WH(r,e).then(i=>NH(JSON.stringify(i,void 0,2))).catch(i=>fe({color:"red",message:Te(i),autoClose:!1}))},onDelete:i=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:i.map(s=>({request:{method:"DELETE",url:`${r.resourceType}/${s}`}}))}).then(()=>o({...r})).catch(s=>fe({color:"red",message:Te(s),autoClose:!1})))},onBulk:i=>{t(`/bulk/${r.resourceType}?ids=${i.join(",")}`)}})})}function HH(){const e=ne(),[t,n]=p.useState(),[r,o]=p.useState(void 0);p.useEffect(()=>{e.get("auth/mfa/status").then(l=>{const c=new URL("https://chart.googleapis.com/chart");c.searchParams.set("chs","300x300"),c.searchParams.set("cht","qr"),c.searchParams.set("chl",l.enrollUri),c.searchParams.set("choe","UTF-8"),n(c.toString()),o(l.enrolled)}).catch(l=>fe({color:"red",message:Te(l),autoClose:!1}))},[e]);const i=p.useCallback(l=>{e.post("auth/mfa/enroll",l).then(()=>{o(!0),fe({color:"green",message:"Success"})}).catch(c=>fe({color:"red",message:Te(c),autoClose:!1}))},[e]),s=p.useCallback(()=>{e.post("auth/mfa/disable",{}).catch(console.log)},[e]);return r===void 0?null:r?a.jsx(Se,{children:a.jsxs(Y,{children:[a.jsx(ue,{children:"MFA is enabled"}),a.jsx(te,{onClick:s,children:"Disable MFA"})]})}):a.jsx(Se,{width:400,children:a.jsxs(We,{onSubmit:i,children:[a.jsx(ue,{children:"Multi Factor Auth Setup"}),a.jsx(on,{children:a.jsx("img",{src:t})}),a.jsx(ae,{name:"token",label:"Code"}),a.jsx(Y,{justify:"flex-end",mt:"xl",children:a.jsx(te,{type:"submit",children:"Enroll"})})]})})}const Gm={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__"};function Zc(){return Gm}function qk(){try{return Gm.registerEnabled!==!1&&Gm.registerEnabled!=="false"}catch{return!0}}function qH(){const e=Mt(),[t]=x0(),n=t.get("client_id");if(!n)return null;const r=t.get("scope")||"openid";function o(i){const s=new URL(t.get("redirect_uri"));for(const l of["scope","state","nonce"])t.has(l)&&s.searchParams.set(l,t.get(l));s.searchParams.set("code",i),window.location.assign(s.toString())}return a.jsxs(hk,{onCode:o,onForgotPassword:()=>e("/resetpassword"),onRegister:()=>e("/register"),googleClientId:Zc().googleClientId,clientId:n||void 0,redirectUri:t.get("redirect_uri")||void 0,scope:r,nonce:t.get("nonce")||void 0,launch:t.get("launch")||void 0,codeChallenge:t.get("code_challenge")||void 0,codeChallengeMethod:t.get("code_challenge_method")||void 0,chooseScopes:r!=="openid",children:[a.jsx(Vr,{size:32}),a.jsx(ue,{children:"Sign in to Medplum"})]})}function GH(){const e=ne(),t=Mt(),n=Zc();return p.useEffect(()=>{e.getProfile()&&t("/signin?project=new")},[e,t]),qk()?a.jsxs(ZU,{type:"project",onSuccess:()=>t("/"),googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[a.jsx(Vr,{size:32}),a.jsx(ue,{children:"Create a new account"})]}):a.jsx(Se,{width:450,children:a.jsx(xs,{icon:a.jsx(zc,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function QH(){const e=Mt(),t=ne(),[n,r]=p.useState(),[o,i]=p.useState(!1),s=Zc().recaptchaSiteKey;return p.useEffect(()=>{dk(s)},[s]),a.jsx(Se,{width:450,children:a.jsxs(We,{style:{maxWidth:400},onSubmit:async l=>{let c="";c=await fk(s),t.post("auth/resetpassword",{...l,recaptchaToken:c}).then(()=>i(!0)).catch(u=>r(lt(u)))},children:[a.jsxs(be,{gap:"lg",mb:"xl",align:"center",children:[a.jsx(Vr,{size:32}),a.jsx(ue,{children:"Medplum Password Reset"})]}),a.jsxs(be,{gap:"xl",children:[a.jsx(Wr,{issues:Hc(n,void 0)}),!o&&a.jsxs(a.Fragment,{children:[a.jsx(ae,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:ze(n,"email")}),a.jsxs(Y,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(He,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register"),size:"xs",children:"Register"}),a.jsx(te,{type:"submit",children:"Reset password"})]})]}),o&&a.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function KH(){var i;const e=Mt(),t=ne(),[n,r]=p.useState();p.useEffect(()=>{t.get("auth/me").then(r).catch(s=>fe({color:"red",message:Te(s),autoClose:!1}))},[t]);function o(s){t.post("auth/revoke",{loginId:s}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>fe({color:"green",message:"Login revoked"})).catch(l=>fe({color:"red",message:Te(l),autoClose:!1}))}return n?a.jsxs(a.Fragment,{children:[a.jsxs(Se,{children:[a.jsx(ue,{children:"Security"}),a.jsxs(Qv,{children:[a.jsx(bo,{term:"ID",children:a.jsx(He,{href:`/${ht(n.profile)}`,children:n.profile.id})}),a.jsx(bo,{term:"Resource Type",children:n.profile.resourceType}),a.jsx(bo,{term:"Name",children:Fc((i=n.profile.name)==null?void 0:i[0])})]})]}),a.jsxs(Se,{children:[a.jsx(ue,{children:"Sessions"}),a.jsxs(le,{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"OS"}),a.jsx("th",{children:"Browser"}),a.jsx("th",{children:"IP Address"}),a.jsx("th",{children:"Auth Method"}),a.jsx("th",{children:"Last Updated"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:n.security.sessions.map(s=>a.jsxs("tr",{children:[a.jsx("td",{children:s.os}),a.jsx("td",{children:s.browser}),a.jsx("td",{children:s.remoteAddress}),a.jsx("td",{children:s.authMethod}),a.jsx("td",{children:jn(s.lastUpdated)}),a.jsx("td",{children:a.jsx(He,{href:"#",onClick:()=>o(s.id),children:"Revoke"})})]},s.id))})]})]}),a.jsxs(Se,{children:[a.jsx(ue,{children:"Password"}),a.jsx(te,{onClick:()=>e("/changepassword"),children:"Change password"})]}),a.jsxs(Se,{children:[a.jsx(ue,{children:"Multi Factor Auth"}),a.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&a.jsx(te,{onClick:()=>e("/mfa"),children:"Enroll"})]})]}):null}function YH(){const{id:e,secret:t}=Xe(),n=ne(),[r,o]=p.useState(),[i,s]=p.useState(!1),l=Hc(r,void 0);return a.jsxs(Se,{width:450,children:[a.jsx(Wr,{issues:l}),a.jsxs(We,{style:{maxWidth:400},onSubmit:c=>{if(c.password!==c.confirmPassword){o(pi("Passwords do not match","confirmPassword"));return}o(void 0);const u={id:e,secret:t,password:c.password};n.post("auth/setpassword",u).then(()=>s(!0)).catch(d=>o(lt(d)))},children:[a.jsxs(on,{style:{flexDirection:"column"},children:[a.jsx(Vr,{size:32}),a.jsx(ue,{children:"Set password"})]}),!i&&a.jsxs(be,{children:[a.jsx(Nr,{name:"password",label:"New password",required:!0,error:ze(r,"password")}),a.jsx(Nr,{name:"confirmPassword",label:"Confirm new password",required:!0,error:ze(r,"confirmPassword")}),a.jsx(Y,{justify:"flex-end",mt:"xl",children:a.jsx(te,{type:"submit",children:"Set password"})})]}),i&&a.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",a.jsx(Fe,{to:"/signin",children:"sign in"}),"."]})]})]})}function XH(){const e=Xf(),t=Mt(),[n]=x0(),r=Zc(),o=p.useCallback(()=>{const i=n.get("next");t(i!=null&&i.startsWith("/")?i:"/")},[n,t]);return p.useEffect(()=>{e&&n.has("next")&&o()},[e,n,o]),a.jsxs(hk,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword"),onRegister:qk()?()=>t("/register"):void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[a.jsx(Vr,{size:32}),a.jsx(ue,{children:"Sign in to Medplum"}),n.get("project")==="new"&&a.jsx("div",{children:"Sign in again to create a new project"})]})}function JH(){const e=Mt(),t=Wo(),[n,r]=p.useState(),[o,i]=p.useState(),[s,l]=p.useState();return p.useEffect(()=>{const c=Object.fromEntries(new URLSearchParams(t.search).entries());r(c.resourceType),i(c.query),l(JSON.parse(c.fields))},[t]),!n||!o||!s?null:a.jsx(oB,{resourceType:n,checkboxesEnabled:!0,query:o,fields:s,onClick:c=>e(`/${n}/${c.resource.id}`),onAuxClick:c=>window.open(`/${n}/${c.resource.id}`,"_blank"),onBulk:c=>{e(`/bulk/${n}?ids=${c.join(",")}`)}})}function ch(e){const t=ne(),n=Ri(t),r=Mt(),[o,i]=p.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:ie.EQUALS,value:"Project/"+n},{code:"profile-type",operator:ie.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return a.jsx(Kc,{search:o,onClick:s=>r(`/admin/members/${s.resource.id}`),onChange:s=>i(s.definition),hideFilters:!0,hideToolbar:!0})}function ZH(){return a.jsxs(a.Fragment,{children:[a.jsx(ue,{children:"Bots"}),a.jsx(ch,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(Y,{justify:"flex-end",children:a.jsx(Fe,{to:"/admin/bots/new",children:"Create new bot"})})]})}function eq(){return a.jsxs(a.Fragment,{children:[a.jsx(ue,{children:"Clients"}),a.jsx(ch,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(Y,{justify:"flex-end",children:a.jsx(Fe,{to:"/admin/clients/new",children:"Create new client"})})]})}function uh(e){return a.jsx(Qa,{resourceType:"AccessPolicy",name:"accessPolicy",defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{Uo(t)?e.onChange(ft(t)):e.onChange(void 0)}})}function tq(){const e=ne(),t=Ri(e),[n,r]=p.useState(""),[o,i]=p.useState(""),[s,l]=p.useState(),[c,u]=p.useState(),[d,f]=p.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(ue,{children:"Create new Bot"}),a.jsxs(We,{onSubmit:()=>{const h={name:n,description:o,accessPolicy:s};e.post("admin/projects/"+t+"/bot",h).then(m=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),f(m),fe({color:"green",message:"Bot created"})}).catch(m=>{fe({color:"red",message:Te(m),autoClose:!1}),u(lt(m))})},children:[!d&&a.jsxs(be,{children:[a.jsx(at,{title:"Name",htmlFor:"name",outcome:c,children:a.jsx(ae,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:h=>r(h.currentTarget.value),error:ze(c,"name")})}),a.jsx(at,{title:"Description",htmlFor:"description",outcome:c,children:a.jsx(ae,{id:"description",name:"description",onChange:h=>i(h.currentTarget.value),error:ze(c,"description")})}),a.jsx(at,{title:"Access Policy",htmlFor:"accessPolicy",outcome:c,children:a.jsx(uh,{name:"accessPolicy",onChange:l})}),a.jsx(Y,{justify:"flex-end",children:a.jsx(te,{type:"submit",children:"Create Bot"})})]}),d&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(se,{children:"Bot created"}),a.jsxs(Cn,{children:[a.jsx(Cn.Item,{children:a.jsx(Fe,{to:d,children:"Go to new bot"})}),a.jsx(Cn.Item,{children:a.jsx(Fe,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function nq(){const e=ne(),t=Ri(e),[n,r]=p.useState(""),[o,i]=p.useState(""),[s,l]=p.useState(""),[c,u]=p.useState(),[d,f]=p.useState(),[h,m]=p.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(ue,{children:"Create new Client"}),a.jsxs(We,{onSubmit:()=>{const g={name:n,description:o,redirectUri:s,accessPolicy:c};e.post("admin/projects/"+t+"/client",g).then(y=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),m(y),fe({color:"green",message:"Client created"})}).catch(y=>{fe({color:"red",message:Te(y),autoClose:!1}),f(lt(y))})},children:[!h&&a.jsxs(be,{children:[a.jsx(at,{title:"Name",htmlFor:"name",outcome:d,children:a.jsx(ae,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:g=>r(g.currentTarget.value),error:ze(d,"name")})}),a.jsx(at,{title:"Description",htmlFor:"description",outcome:d,children:a.jsx(ae,{id:"description",name:"description",onChange:g=>i(g.currentTarget.value),error:ze(d,"description")})}),a.jsx(at,{title:"Redirect URI",htmlFor:"redirectUri",outcome:d,children:a.jsx(ae,{id:"redirectUri",name:"redirectUri",onChange:g=>l(g.currentTarget.value),error:ze(d,"redirectUri")})}),a.jsx(at,{title:"Access Policy",htmlFor:"accessPolicy",outcome:d,children:a.jsx(uh,{name:"accessPolicy",onChange:u})}),a.jsx(Y,{justify:"flex-end",children:a.jsx(te,{type:"submit",children:"Create Client"})})]}),h&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(se,{children:"Client created"}),a.jsxs(Cn,{children:[a.jsx(Cn.Item,{children:a.jsx(Fe,{to:h,children:"Go to new client"})}),a.jsx(Cn.Item,{children:a.jsx(Fe,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function rq(e){return a.jsx(Qa,{resourceType:"UserConfiguration",name:"userConfiguration",defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{Uo(t)?e.onChange(ft(t)):e.onChange(void 0)}})}function oq(){const{membershipId:e}=Xe(),t=ne(),n=Ri(t),r=Mt(),o=t.get(`admin/projects/${n}/members/${e}`).read(),[i,s]=p.useState(o.accessPolicy),[l,c]=p.useState(o.userConfiguration),[u,d]=p.useState(o.admin),[f,h]=p.useState(),[m,g]=p.useState(!1);function y(){window.confirm("Are you sure?")&&t.delete(`admin/projects/${n}/members/${e}`).then(()=>t.get(`admin/projects/${n}`,{cache:"no-cache"})).then(()=>r("/admin/project")).catch(S=>h(lt(S)))}return a.jsxs(a.Fragment,{children:[a.jsx(ue,{children:"Edit membership"}),a.jsx("h3",{children:a.jsx(ma,{value:o.profile,link:!0})}),a.jsxs(We,{onSubmit:()=>{const S={...o,accessPolicy:i,userConfiguration:l,admin:u};t.post(`admin/projects/${n}/members/${e}`,S).then(()=>g(!0)).catch(v=>h(lt(v)))},children:[!m&&a.jsxs(be,{children:[a.jsx(at,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:a.jsx(uh,{name:"accessPolicy",defaultValue:i,onChange:s})}),a.jsx(at,{title:"User Configuration",htmlFor:"userConfiguration",outcome:f,children:a.jsx(rq,{name:"userConfiguration",defaultValue:l,onChange:c})}),a.jsx(at,{title:"Admin",htmlFor:"admin",outcome:f,children:a.jsx(gr,{id:"admin",name:"admin",defaultChecked:u,onChange:S=>d(S.currentTarget.checked)})}),a.jsxs(Y,{justify:"flex-end",mt:"xl",children:[a.jsx(te,{type:"submit",children:"Save"}),a.jsx(te,{type:"button",color:"red",variant:"outline",onClick:y,children:"Remove user"})]})]}),m&&a.jsxs("div",{"data-testid":"success",children:[a.jsx("p",{children:"User updated"}),a.jsx("pre",{children:JSON.stringify(f,void 0,2)}),a.jsxs("p",{children:["Click ",a.jsx(Fe,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function iq(){const e=ne(),[t,n]=p.useState(e.getProject()),[r,o]=p.useState(),[i,s]=p.useState(),[l,c]=p.useState(!1),[u,d]=p.useState(void 0),f=p.useCallback(h=>{const m={resourceType:h.resourceType,firstName:h.firstName,lastName:h.lastName,email:h.email,sendEmail:h.sendEmail==="on",accessPolicy:r,admin:h.isAdmin==="on"};e.invite(t==null?void 0:t.id,m).then(g=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),Vf(g)?s(g):d(g),c(m.sendEmail??!1),fe({color:"green",message:"Invite success"})}).catch(g=>{fe({color:"red",message:Te(g),autoClose:!1}),s(lt(g))})},[e,t,r]);return a.jsxs(We,{onSubmit:f,children:[!u&&!i&&a.jsxs(be,{children:[a.jsx(ue,{children:"Invite new member"}),e.isSuperAdmin()&&a.jsx(at,{title:"Project",htmlFor:"project",outcome:i,children:a.jsx(Qa,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),a.jsx(wt,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:ze(i,"resourceType")}),a.jsx(ae,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:ze(i,"firstName")}),a.jsx(ae,{name:"lastName",label:"Last Name",required:!0,error:ze(i,"lastName")}),a.jsx(ae,{name:"email",type:"email",label:"Email",required:!0,error:ze(i,"email")}),a.jsx(at,{title:"Access Policy",htmlFor:"accessPolicy",outcome:i,children:a.jsx(uh,{name:"accessPolicy",onChange:o})}),a.jsx(gr,{name:"sendEmail",label:"Send email",defaultChecked:!0}),a.jsx(gr,{name:"isAdmin",label:"Admin"}),a.jsx(Y,{justify:"flex-end",children:a.jsx(te,{type:"submit",children:"Invite"})})]}),i&&a.jsxs("div",{"data-testid":"success",children:[a.jsx("p",{children:"User created, email couldn't be sent"}),a.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),a.jsxs("p",{children:["Click ",a.jsx(Fe,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),u&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(se,{children:"User created"}),l&&a.jsx(se,{children:"Email sent"}),a.jsxs(Cn,{children:[a.jsx(Cn.Item,{children:a.jsx(Fe,{to:u,children:"Go to new membership"})}),a.jsx(Cn.Item,{children:a.jsx(Fe,{to:u.profile,children:"Go to new profile"})}),a.jsx(Cn.Item,{children:a.jsx(Fe,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function sq(){return a.jsxs(a.Fragment,{children:[a.jsx(ue,{children:"Patients"}),a.jsx(ch,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),a.jsx(Y,{justify:"flex-end",children:a.jsx(Fe,{to:"/admin/invite",children:"Invite new patient"})})]})}function aq(){const e=ne();if(!e.isLoading()&&!e.isProjectAdmin())return a.jsx(Wr,{outcome:aP});function t(n){e.post("admin/projects/setpassword",n).then(()=>fe({color:"green",message:"Done"})).catch(r=>fe({color:"red",message:Te(r),autoClose:!1}))}return a.jsxs(Se,{width:600,children:[a.jsx(ue,{order:1,children:"Project Admin"}),a.jsx(fn,{my:"lg"}),a.jsx(ue,{order:2,children:"Force Set Password"}),a.jsx(se,{children:"Sets the password for the specified user in this project."}),a.jsx(se,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),a.jsx(We,{onSubmit:t,children:a.jsxs(be,{children:[a.jsx(ae,{name:"email",label:"Email",required:!0}),a.jsx(Nr,{name:"password",label:"Password",required:!0}),a.jsx(te,{type:"submit",children:"Force Set Password"})]})})]})}function iS(){const e=ne(),t=Ri(e),n=e.get(`admin/projects/${t}`).read();return a.jsxs(a.Fragment,{children:[a.jsx(ue,{children:"Details"}),a.jsxs(Qv,{children:[a.jsx(bo,{term:"ID",children:n.project.id}),a.jsx(bo,{term:"Name",children:n.project.name})]})]})}const sS=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function lq(){const e=Mt(),n=Wo().pathname.replace("/admin/","")||sS[0],r=ne(),o=Ri(r),i=p.useMemo(()=>r.get("admin/projects/"+o).read(),[r,o]);function s(l){e(`/admin/${l}`)}return a.jsxs(a.Fragment,{children:[a.jsxs(zn,{children:[a.jsx(Ie,{children:a.jsxs(Ie.Entry,{children:[a.jsx(Ie.Key,{children:"Project"}),a.jsx(Ie.Value,{children:i.project.name})]})}),a.jsx(vr,{children:a.jsx(Ge,{value:n.toLowerCase(),onChange:s,children:a.jsx(Ge.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:sS.map(l=>a.jsx(Ge.Tab,{value:l.toLowerCase(),children:l},l))})})})]}),a.jsx(Se,{children:a.jsx(v0,{})})]})}function cq(){const e=ne(),t=Ri(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=p.useState(!1),[i,s]=p.useState();return p.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),p.useEffect(()=>{n&&s(co(n.project.secret||[]))},[e,n]),!r||!i?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.post(`admin/projects/${t}/secrets`,i).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>fe({color:"green",message:"Saved"})).catch(console.log)},children:[a.jsx(ue,{children:"Project Secrets"}),a.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),a.jsx(Ka,{property:js("Project","secret"),name:"secret",path:"Project.secret",defaultValue:i,onChange:s,outcome:void 0}),a.jsx(te,{type:"submit",children:"Save"})]})}function uq(){const e=ne(),t=Ri(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=p.useState(!1),[i,s]=p.useState();return p.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),p.useEffect(()=>{n&&s(co(n.project.site||[]))},[e,n]),!r||!i?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.post(`admin/projects/${t}/sites`,i).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>fe({color:"green",message:"Saved"})).catch(c=>{var d,f,h,m;const u=lt(c);fe({color:"red",message:`Error ${(f=(d=u.issue)==null?void 0:d[0].details)==null?void 0:f.text} ${(m=(h=u.issue)==null?void 0:h[0].expression)==null?void 0:m[0]}`,autoClose:!1})})},children:[a.jsx(ue,{children:"Project Sites"}),a.jsx("p",{children:"Use project sites configure your project on a separate domain."}),a.jsx(Ka,{property:js("Project","site"),name:"site",path:"Project.site",defaultValue:i,onChange:s,outcome:void 0}),a.jsx(te,{type:"submit",children:"Save"})]})}function dq(){const e=ne();if(!e.isLoading()&&!e.isSuperAdmin())return a.jsx(Wr,{outcome:aP});function t(){xl(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function n(){xl(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function r(){xl(e,"Rebuilding Value Sets","admin/super/valuesets")}function o(u){xl(e,"Reindexing Resources","admin/super/reindex",u)}function i(u){xl(e,"Rebuilding Compartments","admin/super/compartments",u)}function s(u){e.post("admin/super/removebotidjobsfromqueue",u).then(()=>fe({color:"green",message:"Done"})).catch(d=>fe({color:"red",message:Te(d),autoClose:!1}))}function l(u){e.post("admin/super/purge",{...u,before:mT(u.before)}).then(()=>fe({color:"green",message:"Done"})).catch(d=>fe({color:"red",message:Te(d),autoClose:!1}))}function c(u){e.post("admin/super/setpassword",u).then(()=>fe({color:"green",message:"Done"})).catch(d=>fe({color:"red",message:Te(d),autoClose:!1}))}return a.jsxs(Se,{width:600,children:[a.jsx(ue,{order:1,children:"Super Admin"}),a.jsx(fn,{my:"lg"}),a.jsx(ue,{order:2,children:"Structure Definitions"}),a.jsx("p",{children:"StructureDefinition resources contain the metadata about resource types. They are provided with the FHIR specification. Medplum also includes some custom StructureDefinition resources for internal data types. Press this button to update the database StructureDefinitions from the FHIR specification."}),a.jsx(We,{children:a.jsx(te,{onClick:t,children:"Rebuild StructureDefinitions"})}),a.jsx(fn,{my:"lg"}),a.jsx(ue,{order:2,children:"Search Parameters"}),a.jsx("p",{children:"SearchParameter resources contain the metadata about filters and sorting. They are provided with the FHIR specification. Medplum also includes some custom SearchParameter resources for internal data types. Press this button to update the database SearchParameters from the FHIR specification."}),a.jsx(We,{children:a.jsx(te,{onClick:n,children:"Rebuild SearchParameters"})}),a.jsx(fn,{my:"lg"}),a.jsx(ue,{order:2,children:"Value Sets"}),a.jsx("p",{children:"ValueSet resources enum values for a wide variety of use cases. Press this button to update the database ValueSets from the FHIR specification."}),a.jsx(We,{children:a.jsx(te,{onClick:r,children:"Rebuild ValueSets"})}),a.jsx(fn,{my:"lg"}),a.jsx(ue,{order:2,children:"Reindex Resources"}),a.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),a.jsx(We,{onSubmit:o,children:a.jsxs(be,{children:[a.jsx(at,{title:"Resource Type",children:a.jsx(ae,{name:"resourceType",placeholder:"Reindex Resource Type"})}),a.jsx(te,{type:"submit",children:"Reindex"})]})}),a.jsx(fn,{my:"lg"}),a.jsx(ue,{order:2,children:"Rebuild Compartments"}),a.jsx("p",{children:"When Medplum changes how resource compartments are derived, the system may require a rebuild for old resources to take effect."}),a.jsx(We,{onSubmit:i,children:a.jsxs(be,{children:[a.jsx(at,{title:"Resource Type",children:a.jsx(ae,{name:"resourceType",placeholder:"Compartments Resource Type"})}),a.jsx(te,{type:"submit",children:"Rebuild Compartments"})]})}),a.jsx(fn,{my:"lg"}),a.jsx(ue,{order:2,children:"Purge Resources"}),a.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),a.jsx(We,{onSubmit:l,children:a.jsxs(be,{children:[a.jsx(at,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:a.jsx(wt,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),a.jsx(at,{title:"Purge Before",htmlFor:"before",children:a.jsx(as,{name:"before",placeholder:"Before Date"})}),a.jsx(te,{type:"submit",children:"Purge"})]})}),a.jsx(fn,{my:"lg"}),a.jsx(ue,{order:2,children:"Remove Bot ID Jobs from Queue"}),a.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),a.jsx(We,{onSubmit:s,children:a.jsxs(be,{children:[a.jsx(at,{title:"Bot ID",children:a.jsx(ae,{name:"botId",placeholder:"Bot Id"})}),a.jsx(te,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),a.jsx(fn,{my:"lg"}),a.jsx(ue,{order:2,children:"Force Set Password"}),a.jsx("p",{children:'Note that this applies to all projects for the user. Therefore, this should only be used in extreme circumstances. Always prefer to use the "Forgot Password" flow first.'}),a.jsx(We,{onSubmit:c,children:a.jsxs(be,{children:[a.jsx(ae,{name:"email",label:"Email",required:!0}),a.jsx(Nr,{name:"password",label:"Password",required:!0}),a.jsx(ae,{name:"projectId",label:"Project ID"}),a.jsx(te,{type:"submit",children:"Force Set Password"})]})})]})}function xl(e,t,n,r){oo.show({id:n,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const o={method:"POST",pollStatusOnAccepted:!0};r&&(o.body=JSON.stringify(r)),e.startAsyncRequest(n,o).then(()=>{oo.update({id:n,color:"green",title:t,message:"Done",icon:a.jsx(Jf,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}).catch(i=>{oo.update({id:n,color:"red",title:t,message:Te(i),icon:a.jsx(Md,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})})}function fq(){return a.jsxs(a.Fragment,{children:[a.jsx(ue,{children:"Users"}),a.jsx(ch,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(Y,{justify:"flex-end",children:a.jsx(Fe,{to:"/admin/invite",children:"Invite new user"})})]})}function hq(){const[e]=Ia("ObservationDefinition","_count=100");return e?a.jsxs(le,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Code"}),a.jsx("th",{children:"Method"}),a.jsx("th",{children:"Unit"}),a.jsx("th",{children:"Precision"}),a.jsx("th",{children:"Ranges"})]})}),a.jsx("tbody",{children:e.map(t=>{var n,r,o,i;return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(io,{value:(n=t.category)==null?void 0:n[0]})}),a.jsx("td",{children:a.jsx(io,{value:t.code})}),a.jsx("td",{children:a.jsx(io,{value:t.method})}),a.jsx("td",{children:(o=(r=t.quantitativeDetails)==null?void 0:r.unit)==null?void 0:o.text}),a.jsx("td",{children:(i=t.quantitativeDetails)==null?void 0:i.decimalPrecision}),a.jsx("td",{children:a.jsx(Qm,{ranges:t.qualifiedInterval})})]},t.id)})})]}):a.jsx($r,{})}function Qm(e){const{ranges:t}=e;if(!t)return null;const n=aS(t.map(o=>o.gender));if(n.length>1)return n.sort((o,i)=>o.localeCompare(i)),a.jsx(a.Fragment,{children:n.map(o=>{var i;return a.jsxs(p.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:Vt(o)})}),a.jsx(Qm,{ranges:(i=e.ranges)==null?void 0:i.filter(s=>s.gender===o)})]},o)})});const r=aS(t.map(o=>o.age&&sc(o.age)));return r.length>1?(r.sort((o,i)=>o.localeCompare(i)),a.jsx(a.Fragment,{children:r.map(o=>{var i;return a.jsxs(p.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:Vt(o)})}),a.jsx(Qm,{ranges:(i=e.ranges)==null?void 0:i.filter(s=>sc(s.age)===o)})]},o)})})):a.jsx(a.Fragment,{children:t.map(o=>a.jsx("table",{children:a.jsx("tbody",{children:a.jsxs("tr",{children:[a.jsx("td",{children:o.condition}),a.jsx("td",{children:a.jsx(Yv,{value:o.range})})]})})},`range-${o.condition}`))})}function aS(e){return[...new Set(e.filter(t=>!!t))]}function pq(){const[e]=Ia("ActivityDefinition","_count=100"),[t]=Ia("ObservationDefinition","_count=100");return!e||!t?a.jsx($r,{}):a.jsxs(le,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Assay"}),e.map(n=>a.jsx("th",{children:n.name},n.id))]})}),a.jsx("tbody",{children:t.map(n=>{var r;return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(io,{value:(r=n.category)==null?void 0:r[0]})}),a.jsx("td",{children:a.jsx(io,{value:n.code})}),e.map(o=>{var i;return a.jsx("td",{children:(i=o.observationResultRequirement)!=null&&i.find(s=>{var l;return(l=s.reference)==null?void 0:l.includes(n.id)})?"✅":""},o.id)})]},n.id)})})]})}function mq(e){var s;const t=ne(),[n,r]=p.useState(),[o,i]=p.useState();return o?a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"Request group created successfully."}),a.jsxs("ul",{children:[a.jsxs("li",{children:["Go to the"," ",a.jsx(Fe,{to:o,suffix:"checklist",children:"Request Group"})]}),a.jsxs("li",{children:["Back to the ",a.jsx(Fe,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):a.jsx(We,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueReference:n}]}).then(i).catch(console.log)},children:a.jsxs(be,{children:[a.jsxs(ue,{children:['Start "',e.planDefinition.title,'"']}),a.jsxs(se,{children:["Use the ",a.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),a.jsx(se,{children:"The following tasks will be created:"}),a.jsx("ul",{children:(s=e.planDefinition.action)==null?void 0:s.map((l,c)=>{var u;return a.jsxs("li",{children:[((u=l.definitionCanonical)==null?void 0:u.startsWith("Questionnaire/"))&&"Questionnaire request: ",l.title&&a.jsx(a.Fragment,{children:l.title}),l.code&&a.jsx(io,{value:l.code[0]})]},`action-${c}`)})}),a.jsx(at,{title:"Subject",children:a.jsx(eh,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),a.jsx(Y,{justify:"flex-end",mt:"xl",children:a.jsx(te,{type:"submit",children:"Go"})})]})})}function gq(){const{resourceType:e,id:t}=Xe(),n=ct({reference:e+"/"+t});return n?a.jsx(Se,{children:a.jsx(mq,{planDefinition:n})}):null}function yq(){const{resourceType:e,id:t}=Xe(),n=ct({reference:e+"/"+t}),[r,o]=Ia("Questionnaire","subject-type="+e),[i,s]=Ia("ClientApplication",{_count:1e3});if(!n||o||s)return a.jsx($r,{});const l=i==null?void 0:i.filter(d=>vq(e)&&!!d.launchUri);if((!r||r.length===0)&&(!l||l.length===0))return a.jsxs(Se,{children:[a.jsx(ue,{children:"Apps"}),a.jsxs("p",{children:["No apps found. Contact your administrator or ",a.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let c,u;return n.resourceType==="Patient"?c=ft(n):n.resourceType==="Encounter"&&(c=n.subject,u=ft(n)),a.jsxs(Se,{children:[r==null?void 0:r.map(d=>a.jsxs("div",{children:[a.jsx(ue,{order:3,children:a.jsx(Fe,{to:`/forms/${d.id}?subject=${ht(n)}`,children:d.title||d.name})}),a.jsx(se,{children:d.description})]},d.id)),l==null?void 0:l.map(d=>a.jsxs("div",{children:[a.jsx(ue,{order:3,children:a.jsx(YU,{client:d,patient:c,encounter:u,children:d.name})}),a.jsx(se,{children:d.description})]},d.id))]})}function vq(e){return e==="Patient"||e==="Encounter"}function xq(){const{resourceType:e,id:t}=Xe(),n=Mt(),[r,o]=p.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:ie.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return a.jsx(Se,{children:a.jsx(Kc,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function wq(){const e=ne(),{resourceType:t,id:n}=Xe(),r=e.readHistory(t,n).read();return a.jsx(Se,{children:a.jsx(BU,{history:r})})}const Sq="_hl7Input_k5xm3_1",bq={hl7Input:Sq};function Cq(e){return a.jsx("iframe",{frameBorder:"0",src:"https://codeeditor.medplum.com/bot-runner.html",className:e.className,ref:e.iframeRef,"data-testid":e.testId,style:{width:"100%",height:"100%",minHeight:e.minHeight}})}function Eq(e){const t=e.defaultValue,n=new URL(`https://codeeditor.medplum.com/${e.language}-editor.html`);return e.module&&n.searchParams.set("module",e.module),a.jsx("iframe",{frameBorder:"0",src:n.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:r=>{Xu(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const jq=`{
545
+ "resourceType": "Patient",
546
+ "name": [
547
+ {
548
+ "given": [
549
+ "Alice"
550
+ ],
551
+ "family": "Smith"
552
+ }
553
+ ]
554
+ }`,Pq="MSH|^~\\&|ADT1|MCM|LABADT|MCM|198808181126|SECURITY|ADT|MSG00001|P|2.1\rPID|||PATID1234^5^M11||JONES^WILLIAM^A^III||19610615|M-||C|1200 N ELM STREET^^GREENSBORO^NC^27401-1020|GL|(919)379-1212|(919)271-3434||S||PATID12345001^2^M10|123456789|987654^NC\rNK1|1|JONES^BARBARA^K|SPO|||||20011105\rPV1|1|I|2000^2012^01||||004777^LEBAUER^SIDNEY^J.|||SUR||-||1|A0-";function Tq(){const e=ne(),{id:t}=Xe(),[n,r]=p.useState(),[o,i]=p.useState(),[s,l]=p.useState(jq),[c,u]=p.useState(Pq),[d,f]=p.useState(Gt.FHIR_JSON),h=p.useRef(null),m=p.useRef(null),[g,y]=p.useState(!1);p.useEffect(()=>{e.readResource("Bot",t).then(async E=>{r(E),i(await kq(e,E))}).catch(E=>fe({color:"red",message:Te(E),autoClose:!1}))},[e,t]);const S=p.useCallback(()=>Xu(h.current,{command:"getValue"}),[]),v=p.useCallback(()=>Xu(h.current,{command:"getOutput"}),[]),x=p.useCallback(async()=>d===Gt.FHIR_JSON?JSON.parse(s):c,[d,s,c]),w=p.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),y(!0);try{const P=await S(),T=await e.createAttachment(P,"index.ts","text/typescript"),D=[];n!=null&&n.sourceCode?D.push({op:"replace",path:"/sourceCode",value:T}):D.push({op:"add",path:"/sourceCode",value:T}),await e.patchResource("Bot",t,D),fe({color:"green",message:"Saved"})}catch(P){fe({color:"red",message:Te(P),autoClose:!1})}finally{y(!1)}},[e,t,n,S]),b=p.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),y(!0);try{const P=await v();await e.post(e.fhirUrl("Bot",t,"$deploy"),{code:P}),fe({color:"green",message:"Deployed"})}catch(P){fe({color:"red",message:Te(P),autoClose:!1})}finally{y(!1)}},[e,t,v]),j=p.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),y(!0);try{const P=await x(),T=await e.post(e.fhirUrl("Bot",t,"$execute"),P,d);await Xu(m.current,{command:"setValue",value:T}),fe({color:"green",message:"Success"})}catch(P){fe({color:"red",message:Te(P),autoClose:!1})}finally{y(!1)}},[e,t,x,d]);return!n||o===void 0?null:a.jsxs(Kn,{m:0,gutter:0,style:{overflow:"hidden"},children:[a.jsx(Kn.Col,{span:8,children:a.jsxs(zn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[a.jsx(Eq,{iframeRef:h,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),a.jsxs(Y,{justify:"flex-end",gap:"xs",children:[a.jsx(te,{type:"button",onClick:w,loading:g,leftSection:a.jsx(G7,{size:"1rem"}),children:"Save"}),a.jsx(te,{type:"button",onClick:b,loading:g,leftSection:a.jsx(Bv,{size:"1rem"}),children:"Deploy"}),a.jsx(te,{type:"button",onClick:j,loading:g,leftSection:a.jsx(c6,{size:"1rem"}),children:"Execute"})]})]})}),a.jsxs(Kn.Col,{span:4,children:[a.jsxs(zn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[a.jsx(wt,{data:[{label:"FHIR",value:Gt.FHIR_JSON},{label:"HL7",value:Gt.HL7_V2}],onChange:E=>f(E.currentTarget.value)}),d===Gt.FHIR_JSON?a.jsx(Va,{value:s,onChange:E=>l(E),autosize:!0,minRows:15}):a.jsx("textarea",{className:bq.hl7Input,value:c,onChange:E=>u(E.currentTarget.value),rows:15})]}),a.jsx(zn,{m:2,p:"xs",shadow:"md",children:a.jsx(Cq,{iframeRef:m,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function kq(e,t){var n,r,o;if((n=t.sourceCode)!=null&&n.url){const i=(o=(r=t.sourceCode.url)==null?void 0:r.split("/"))==null?void 0:o.find(jP);return(await e.download(e.fhirUrl("Binary",i))).text()}return t.code??""}function Ts(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function Gk(e,t){var n,r;(r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)||(e.meta=e.meta??{},e.meta.profile=e.meta.profile??[],e.meta.profile.push(t))}function Rq(e,t){var n,r;if((r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)){const o=e.meta.profile.indexOf(t);e.meta.profile.splice(o,1)}}function Dq(){const e=ne(),{resourceType:t,id:n}=Xe(),r={reference:t+"/"+n},o=p.useCallback(i=>{e.updateResource(Ts(i)).then(()=>{fe({color:"green",message:"Success"})}).catch(s=>{fe({color:"red",message:Te(s),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return a.jsx(Se,{children:a.jsx(gB,{value:r,onSubmit:o})});case"Questionnaire":return a.jsx(Se,{children:a.jsx(ZB,{questionnaire:r,onSubmit:o})});default:return null}}function Iq(){const{resourceType:e,id:t}=Xe(),n=ct({reference:e+"/"+t}),r=Mt();return n?a.jsx(Se,{children:a.jsx(CU,{value:n,onStart:(o,i)=>r(`/forms/${Hf(i)}`),onEdit:(o,i,s)=>r(`/${s.reference}}`)})}):null}function _q(){const e=ne(),{resourceType:t,id:n}=Xe(),r=Mt();return a.jsxs(Se,{children:[a.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),a.jsx(te,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)).catch(o=>fe({color:"red",message:Te(o),autoClose:!1}))},children:"Delete"})]})}const Aq="_selectProfileBtn_tbaz6_1",Nq="_chevron_tbaz6_13",lS={selectProfileBtn:Aq,chevron:Nq};function Oq(){var c,u;const{resourceType:e,id:t}=Xe(),n=ct({reference:e+"/"+t}),[r,o]=p.useState(),i=Tc({onDropdownClose:()=>i.resetSelectedOption()}),s=p.useMemo(()=>{var d;if(Nt((d=n==null?void 0:n.meta)==null?void 0:d.profile))return[a.jsx(Ee.Option,{value:"",children:"None"},""),...n.meta.profile.map(f=>a.jsx(Ee.Option,{value:f,children:f},f))]},[(c=n==null?void 0:n.meta)==null?void 0:c.profile]);if(p.useEffect(()=>{var d,f;((f=(d=n==null?void 0:n.meta)==null?void 0:d.profile)==null?void 0:f.length)===1&&o(n.meta.profile[0])},[(u=n==null?void 0:n.meta)==null?void 0:u.profile]),!n)return null;let l;return Nt(s)&&(l=a.jsx(Y,{justify:"flex-end",children:a.jsxs(be,{align:"flex-end",gap:"xs",children:[a.jsxs(Ee,{store:i,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:d=>{o(d),i.closeDropdown()},children:[a.jsx(Ee.Target,{children:a.jsx(Jn,{onClick:()=>i.toggleDropdown(),children:a.jsxs(Wy,{fw:"bold",fs:"sm",className:lS.selectProfileBtn,children:[a.jsx("span",{children:"Pick profile"}),a.jsx(QP,{stroke:1.5,className:lS.chevron})]})})}),a.jsx(Ee.Dropdown,{w:"max-content",children:a.jsx(Ee.Options,{children:s})})]}),a.jsx(W,{children:r?a.jsxs(a.Fragment,{children:[a.jsx(se,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),a.jsx(se,{span:!0,size:"sm",children:r||"Nothing selected"})]}):a.jsx(se,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),a.jsx(Se,{children:a.jsxs(be,{gap:"xl",children:[l,a.jsx(l0,{value:n,profileUrl:r})]})})}function Mq(){const e=ne(),{resourceType:t,id:n}=Xe(),[r,o]=p.useState(),i=Mt(),[s,l]=p.useState();p.useEffect(()=>{e.readResource(t,n).then(d=>o(co(d))).catch(d=>{l(lt(d)),fe({color:"red",message:Te(d),autoClose:!1})})},[e,t,n]);const c=p.useCallback(d=>{l(void 0),e.updateResource(Ts(d)).then(()=>{i(`/${t}/${n}/details`),fe({color:"green",message:"Success"})}).catch(f=>{l(lt(f)),fe({color:"red",message:Te(f),autoClose:!1})})},[e,t,n,i]),u=p.useCallback(()=>i(`/${t}/${n}/delete`),[i,t,n]);return r?a.jsx(Se,{children:a.jsx(zd,{defaultValue:r,onSubmit:c,onDelete:u,outcome:s})}):null}function Qk(e,t){const n=ne(),r=Mt();return{defaultValue:{resourceType:e},handleSubmit:s=>{t&&t(void 0),n.createResource(s).then(l=>r("/"+l.resourceType+"/"+l.id)).catch(l=>{t&&t(lt(l)),fe({color:"red",message:Te(l),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function Kk({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,o=ne(),[i,s]=p.useState();return p.useEffect(()=>{o.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(l=>{s(l.filter(TF))}).catch(console.error)},[o,n,r]),a.jsx(Ge,{value:t==null?void 0:t.url,onChange:l=>{const c=i==null?void 0:i.find(u=>u.url===l);c&&n(c)},children:a.jsx(Ge.List,{children:i==null?void 0:i.map(l=>{var d,f;const c=(f=(d=e.meta)==null?void 0:d.profile)==null?void 0:f.includes(l.url),u=c?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return a.jsx(Ge.Tab,{value:l.url,title:u,rightSection:c&&a.jsx(Sv,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:a.jsx(S6,{size:"90%"})}),children:l.title||l.name},l.url)})})})}function mp(){const{resourceType:e}=Xe(),t=Wo(),[n,r]=p.useState(),{defaultValue:o,handleSubmit:i}=Qk(e,r),[s,l]=p.useState(),c=t.pathname.toLowerCase().endsWith("profiles"),u=p.useCallback(d=>{const f=Ts(d);s&&Gk(f,s.url),i(f)},[s,i]);return c?a.jsx(Se,{children:a.jsxs(be,{children:[a.jsx(Kk,{resource:o,currentProfile:s,onChange:l}),s?a.jsx(zd,{defaultValue:o,onSubmit:u,outcome:n,profileUrl:s.url},s.url):a.jsx(se,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):a.jsx(Se,{children:a.jsx(zd,{defaultValue:o,onSubmit:i,outcome:n})})}function Lq(){const e=ne(),{resourceType:t,id:n}=Xe(),r=e.readHistory(t,n).read();return a.jsx(Se,{children:a.jsx(qU,{history:r})})}function $q(){const{resourceType:e}=Xe(),[t,n]=p.useState(),{defaultValue:r,handleSubmit:o}=Qk(e,n),i=p.useCallback(s=>{o(JSON.parse(s["new-resource"]))},[o]);return a.jsxs(Se,{children:[t&&a.jsx(Wr,{outcome:t}),a.jsxs(We,{onSubmit:i,children:[a.jsx(Va,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:tr(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(Y,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(te,{type:"submit",children:"OK"})})]})]})}function Fq(){const e=ne(),{resourceType:t,id:n}=Xe(),r=ct({reference:t+"/"+n}),o=Mt(),[i,s]=p.useState(),l=p.useCallback(c=>{e.updateResource(Ts(JSON.parse(c.resource))).then(()=>{s(void 0),o(`/${t}/${n}/details`),fe({color:"green",message:"Success"})}).catch(u=>{fe({color:"red",message:Te(u),autoClose:!1})})},[e,t,n,o]);return r?a.jsxs(Se,{children:[i&&a.jsx(Wr,{outcome:i}),a.jsxs(We,{onSubmit:l,children:[a.jsx(Va,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:tr(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(Y,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(te,{type:"submit",children:"OK"})})]})]}):null}function zq(){const{resourceType:e,id:t}=Xe();return ct({reference:e+"/"+t})?a.jsxs(Se,{children:[a.jsxs(xs,{icon:a.jsx(zc,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",a.jsx("br",{}),a.jsx(He,{href:`/forms/${t}`,children:`/forms/${t}`})]}),a.jsx(ok,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function Bq(){const e=ne(),{resourceType:t,id:n}=Xe(),[r,o]=p.useState(),[i,s]=p.useState();return p.useEffect(()=>{e.readResource(t,n).then(l=>o(co(l))).catch(l=>{fe({color:"red",message:Te(l)})})},[e,t,n]),r?a.jsxs(Se,{children:[a.jsxs(ue,{order:2,children:["Available ",t," profiles"]}),a.jsx(be,{children:a.jsxs(a.Fragment,{children:[a.jsx(Kk,{resource:r,currentProfile:i,onChange:s}),i?a.jsx(Uq,{profile:i,resource:r,onResourceUpdated:l=>o(l)},i.url):a.jsx(se,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const Uq=({profile:e,resource:t,onResourceUpdated:n})=>{const r=ne(),[o,i]=p.useState(),[s,l]=p.useState(()=>{var u,d;return(d=(u=t.meta)==null?void 0:u.profile)==null?void 0:d.includes(e.url)}),c=p.useCallback(u=>{i(void 0);const d=Ts(u);s?Gk(d,e.url):Rq(d,e.url),r.updateResource(d).then(f=>{n(f),fe({color:"green",message:"Success"})}).catch(f=>{i(lt(f)),fe({color:"red",message:Te(f),autoClose:!1})})},[r,e.url,n,s]);return a.jsxs(be,{children:[a.jsx(Ac,{size:"md",checked:s,label:`Conform resource to ${e.title}`,onChange:u=>l(u.currentTarget.checked),"data-testid":"profile-toggle"}),s?a.jsx(zd,{profileUrl:e.url,defaultValue:t,onSubmit:c,outcome:o}):a.jsx("form",{noValidate:!0,onSubmit:u=>{u.preventDefault(),c(t)},children:a.jsx(Y,{justify:"flex-end",mt:"xl",children:a.jsx(te,{type:"submit",children:"OK"})})})]})};function Vq(){const e=ne(),{id:t}=Xe(),[n,r]=p.useState(),[o,i]=p.useState(0),s=e.searchResources("Subscription","status=active&_count=100").read().filter(c=>Wq(c,t));function l(){n&&e.createResource({resourceType:"Subscription",status:"active",reason:`Connect bot ${n.name} to questionnaire responses`,criteria:"QuestionnaireResponse?questionnaire=Questionnaire/"+t,channel:{type:"rest-hook",endpoint:ht(n)}}).then(()=>{r(void 0),i(Date.now()),e.invalidateSearches("Subscription"),fe({color:"green",message:"Success"})}).catch(c=>fe({color:"red",message:Te(c),autoClose:!1}))}return a.jsxs(Se,{children:[a.jsx(ue,{children:"Bots"}),s.length===0&&a.jsx("p",{children:"No bots found."}),s.map(c=>{var u;return a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(Ya,{value:{reference:(u=c.channel)==null?void 0:u.endpoint},link:!0})}),a.jsxs("p",{children:["Criteria: ",c.criteria]})]},c.id)}),a.jsx("hr",{}),a.jsx(ue,{children:"Connect to bot"}),a.jsxs(Y,{children:[a.jsx(Qa,{name:"bot",resourceType:"Bot",onChange:c=>r(c)}),a.jsx(te,{onClick:l,children:"Connect"})]}),a.jsx("div",{style:{display:"none"},children:o})]})}function Wq(e,t){var o;const n=e.criteria||"",r=((o=e.channel)==null?void 0:o.endpoint)||"";return n.startsWith("QuestionnaireResponse?")&&n.includes(t)&&r.startsWith("Bot/")}function Hq(){const{id:e}=Xe(),t=Mt(),[n,r]=p.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:ie.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return a.jsx(Se,{children:a.jsx(Kc,{search:n,onClick:o=>t(`/${o.resource.resourceType}/${o.resource.id}`),onChange:o=>r(o.definition),hideFilters:!0,hideToolbar:!0})})}function qq(){const e=ne(),{resourceType:t,id:n}=Xe(),r=ct({reference:t+"/"+n}),o=p.useCallback(i=>{e.updateResource(Ts(i)).then(()=>{fe({color:"green",message:"Success"})}).catch(s=>{fe({color:"red",message:Te(s),autoClose:!1})})},[e]);return r?a.jsx(Se,{children:a.jsx(mU,{onSubmit:o,definition:r})}):null}function Gq(){const{resourceType:e,id:t}=Xe(),n=ct({reference:e+"/"+t});return n?a.jsx(Se,{children:e==="MeasureReport"?a.jsx(uB,{measureReport:n}):a.jsx(n0,{value:n})}):null}const Qq="_container_1ue98_1",Kq="_entry_1ue98_14",Yq="_active_1ue98_21",gp={container:Qq,entry:Kq,active:Yq};function Xq(e){const t=ne(),n=ct(e.value),[r,o]=p.useState();return p.useEffect(()=>{if(!n)return;const i=C0(n);if(!i)return;const s="reference"in i?i.reference:ht(i);t.search("ServiceRequest","subject="+s).then(l=>{const u=l.entry.map(d=>d.resource);OT(u),u.reverse(),o(u)}).catch(l=>fe({color:"red",message:Te(l),autoClose:!1}))},[t,n]),r?a.jsx("div",{"data-testid":"quick-service-requests",className:gp.container,children:r.map(i=>{var s,l,c,u,d,f,h;return a.jsxs("div",{className:et(gp.entry,{[gp.active]:i.id===(n==null?void 0:n.id)}),children:[a.jsx("p",{children:a.jsx(Fe,{to:i,children:Jq(i)})}),((l=(s=i.category)==null?void 0:s[0])==null?void 0:l.text)&&a.jsx("p",{children:(c=i.category[0])==null?void 0:c.text}),((f=(d=(u=i.code)==null?void 0:u.coding)==null?void 0:d[0])==null?void 0:f.code)&&a.jsx("p",{children:(h=i.code.coding[0])==null?void 0:h.code}),a.jsx("p",{children:Zq(i)})]},i.id)})}):null}function Jq(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function Zq(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const eG="_container_1l2dh_1",tG={container:eG};function nG(e){var o,i,s,l;const t=ct(e.valueSet);if(!t)return null;const n=[""],r=(l=(s=(i=(o=t.compose)==null?void 0:o.include)==null?void 0:i[0])==null?void 0:s.concept)==null?void 0:l.map(c=>c.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),a.jsx("div",{className:tG.container,children:a.jsx(wt,{defaultValue:e.defaultValue,onChange:c=>e.onChange(c.currentTarget.value),data:n})})}function rG(e){var n,r;const t=ct(e.specimen);return t?a.jsxs(Ie,{children:[a.jsxs(Ie.Entry,{children:[a.jsx(Ie.Key,{children:"Type"}),a.jsx(Ie.Value,{children:"Specimen"})]}),a.jsxs(Ie.Entry,{children:[a.jsx(Ie.Key,{children:"Collected"}),a.jsx(Ie.Value,{children:jn((n=t.collection)==null?void 0:n.collectedDateTime)})]}),a.jsxs(Ie.Entry,{children:[a.jsx(Ie.Key,{children:"Specimen Age"}),a.jsx(Ie.Value,{children:oG(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?a.jsxs(Ie.Entry,{children:[a.jsx(Ie.Key,{children:"Specimen Stability"}),a.jsx(Ie.Value,{children:iG(t)})]}):a.jsx(a.Fragment,{})]}):null}function oG(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const n=new Date(t);return Yk(Xk(n,new Date))}function iG(e){var r;if(!((r=e.collection)!=null&&r.collectedDateTime)||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return Yk(Xk(t,n))}function Yk(e){return e.toString().padStart(3,"0")+"D"}function Xk(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function sG(e){const t=["Timeline"];return e==="Bot"&&t.push("Editor","Subscriptions"),e==="PlanDefinition"&&t.push("Apply","Builder"),e==="Questionnaire"&&t.push("Preview","Builder","Bots","Responses"),(e==="DiagnosticReport"||e==="MeasureReport")&&t.push("Report"),e==="RequestGroup"&&t.push("Checklist"),e==="ObservationDefinition"&&t.push("Ranges"),e==="Agent"&&t.push("Tools"),t.push("Details","Edit","Event","History","Blame","JSON","Apps","Profiles"),t}const aG=["Profiles"];function lG(){var w,b,j,E,P,T,D;const e=ne(),{resourceType:t,id:n}=Xe(),r={reference:t+"/"+n},o=Mt(),[i,s]=p.useState(),l=ct(r,s),c=sG(t),[u,d]=p.useState(()=>{const _=window.location.pathname.split("/").pop();return _&&c.map(O=>O.toLowerCase()).includes(_)?_:c[0].toLowerCase()}),f=kt();async function h(){var I,$;const O=($=(I=(await e.readHistory(t,n)).entry)==null?void 0:I.find(N=>!!N.resource))==null?void 0:$.resource;O?m(O):fe({color:"red",message:"No history to restore",autoClose:!1})}function m(_){e.updateResource(Ts(_)).then(()=>{s(void 0),fe({color:"green",message:"Success"})}).catch(O=>{fe({color:"red",message:Te(O),autoClose:!1})})}if(i)return eM(i)?a.jsxs(Se,{children:[a.jsx(ue,{children:"Deleted"}),a.jsx("p",{children:"The resource was deleted."}),a.jsx(te,{color:"red",onClick:h,children:"Restore"})]}):a.jsx(Wr,{outcome:i});function g(_){_||(_=c[0].toLowerCase()),d(_),o(`/${t}/${n}/${_}`)}function y(_){const O=l,I=O.orderDetail||[];I.length===0&&I.push({}),I[0].text!==_&&(I[0].text=_,m({...O,orderDetail:I}))}const S=l&&C0(l),v=l&&AH(l),x=(j=(b=(w=e.getUserConfiguration())==null?void 0:w.option)==null?void 0:b.find(_=>_.id==="statusValueSet"))==null?void 0:j.valueString;return a.jsxs(a.Fragment,{children:[(l==null?void 0:l.resourceType)==="ServiceRequest"&&x&&a.jsx(nG,{valueSet:{reference:x},defaultValue:(P=(E=l.orderDetail)==null?void 0:E[0])==null?void 0:P.text,onChange:y},ht(l)+"-"+((D=(T=l.orderDetail)==null?void 0:T[0])==null?void 0:D.text)),l&&a.jsx(Xq,{value:l}),l&&a.jsxs(zn,{children:[S&&a.jsx(Vk,{patient:S}),v&&a.jsx(rG,{specimen:v}),t!=="Patient"&&a.jsx(Wk,{resource:r}),a.jsx(vr,{children:a.jsx(Ge,{value:u.toLowerCase(),onChange:g,children:a.jsx(Ge.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:c.map(_=>a.jsx(Ge.Tab,{value:_.toLowerCase(),children:aG.includes(_)?a.jsxs(Y,{gap:"xs",wrap:"nowrap",children:[_,a.jsx(kc,{color:f.primaryColor,size:"sm",children:"Beta"})]}):_},_))})})})]}),a.jsx(v0,{})]})}function cS(){var v,x,w,b;const e=Mt(),{resourceType:t,id:n,versionId:r,tab:o}=Xe(),i=ne(),[s,l]=p.useState(!0),[c,u]=p.useState(),[d,f]=p.useState();if(p.useEffect(()=>{f(void 0),l(!0),i.readHistory(t,n).then(j=>u(j)).then(()=>l(!1)).catch(j=>{f(j),l(!1)})},[i,t,n]),s)return a.jsx($r,{});if(!c)return a.jsxs(Se,{children:[a.jsx(ue,{children:"Resource not found"}),a.jsx(Fe,{to:`/${t}`,children:"Return to search page"})]});const h=c.entry,m=h.findIndex(j=>{var E,P;return((P=(E=j.resource)==null?void 0:E.meta)==null?void 0:P.versionId)===r});if(m===-1)return a.jsxs(Se,{children:[a.jsx(ue,{children:"Version not found"}),a.jsx(Fe,{to:`/${t}/${n}`,children:"Return to resource"})]});const g=h[m].resource,y=m<h.length-1?h[m+1].resource:void 0,S="diff";return a.jsx(a.Fragment,{children:a.jsxs(Ge,{value:o||S,onChange:j=>e(`/${t}/${n}/_history/${r}/${j||S}`),children:[a.jsxs(zn,{children:[a.jsx(qc,{fluid:!0,p:"md",children:a.jsx(se,{children:`${t} ${n}`})}),a.jsxs(Ge.List,{children:[a.jsx(Ge.Tab,{value:"diff",children:"Diff"}),a.jsx(Ge.Tab,{value:"raw",children:"Raw"})]})]}),a.jsxs(Se,{children:[d&&a.jsx("pre",{"data-testid":"error",children:JSON.stringify(d,void 0,2)}),a.jsx(Ge.Panel,{value:"diff",children:y?a.jsxs(a.Fragment,{children:[a.jsxs("ul",{children:[a.jsxs("li",{children:["Current: ",(v=g.meta)==null?void 0:v.versionId]}),a.jsxs("li",{children:["Previous:"," ",a.jsx(Fe,{to:`/${t}/${n}/_history/${(x=y.meta)==null?void 0:x.versionId}`,children:(w=y.meta)==null?void 0:w.versionId})]})]}),a.jsx(WU,{original:y,revised:g})]}):a.jsxs(a.Fragment,{children:[a.jsxs("ul",{children:[a.jsxs("li",{children:["Current: ",(b=g.meta)==null?void 0:b.versionId]}),a.jsx("li",{children:"Previous: (none)"})]}),a.jsx("pre",{children:JSON.stringify(g,void 0,2)})]})}),a.jsx(Ge.Panel,{value:"raw",children:a.jsx("pre",{children:JSON.stringify(g,void 0,2)})})]})]})})}function cG(){const{resourceType:e,id:t}=Xe(),n=Mt(),[r,o]=p.useState({resourceType:"Subscription",filters:[{code:"url",operator:ie.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return a.jsx(Se,{children:a.jsx(Kc,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function uS(){const{resourceType:e,id:t}=Xe(),n={reference:e+"/"+t};switch(e){case"Encounter":return a.jsx(az,{encounter:n});case"Patient":return a.jsx(dB,{patient:n});case"ServiceRequest":return a.jsx(KU,{serviceRequest:n});default:return a.jsx(sz,{resource:n})}}function uG(){const e=ne(),{id:t}=Xe(),n=p.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,o]=p.useState(!1),[i,s]=p.useState(),[l,c]=p.useState(),[u,d]=p.useState(),[f,h]=p.useState(!1),m=p.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(S=>{var v,x,w,b;s((x=(v=S.parameter)==null?void 0:v.find(j=>j.name==="status"))==null?void 0:x.valueCode),c((b=(w=S.parameter)==null?void 0:w.find(j=>j.name==="lastUpdated"))==null?void 0:b.valueInstant)}).catch(S=>y(Te(S))).finally(()=>o(!1))},[e,t]),g=p.useCallback(S=>{const v=S.ip;v&&(h(!0),e.pushToAgent(n,v,"PING",Gt.PING,!0).then(x=>d(x)).catch(x=>y(Te(x))).finally(()=>h(!1)))},[e,n]);function y(S){fe({color:"red",title:"Error",message:S,autoClose:!1})}return a.jsxs(Se,{children:[a.jsx(ue,{order:1,children:"Agent Tools"}),a.jsxs("div",{style:{marginBottom:10},children:["Agent: ",a.jsx(Ya,{value:n,link:!0})]}),a.jsx(fn,{my:"lg"}),a.jsx(ue,{order:2,children:"Agent Status"}),a.jsx("p",{children:"Retrieve the status of the agent. This tests whether the agent is connected to the Medplum server, and the last time it was able to communicate."}),a.jsx(te,{onClick:m,loading:r,children:"Get Status"}),!r&&i&&a.jsx(le,{children:a.jsxs(le.Tbody,{children:[a.jsxs(le.Tr,{children:[a.jsx(le.Td,{children:"Status"}),a.jsx(le.Td,{children:a.jsx(t0,{status:i})})]}),a.jsxs(le.Tr,{children:[a.jsx(le.Td,{children:"Last Updated"}),a.jsx(le.Td,{children:jn(l)})]})]})}),a.jsx(fn,{my:"lg"}),a.jsx(ue,{order:2,children:"Ping from Agent"}),a.jsx("p",{children:"Send a ping command from the agent to an IP address. Use this tool to troubleshoot local network connectivity."}),a.jsx(We,{onSubmit:g,children:a.jsx(ae,{id:"ip",name:"ip",placeholder:"IP Address",rightSection:a.jsx(qt,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:f,children:a.jsx(p6,{style:{width:"1rem",height:"1rem"},stroke:1.5})})})}),!f&&u&&a.jsxs(a.Fragment,{children:[a.jsx(ue,{order:5,mt:"sm",mb:0,children:"Last Ping"}),a.jsx("pre",{children:u})]})]})}function dG(){return a.jsx(hW,{children:a.jsxs(he,{errorElement:a.jsx(TH,{}),children:[a.jsx(he,{path:"/signin",element:a.jsx(XH,{})}),a.jsx(he,{path:"/oauth",element:a.jsx(qH,{})}),a.jsx(he,{path:"/resetpassword",element:a.jsx(QH,{})}),a.jsx(he,{path:"/setpassword/:id/:secret",element:a.jsx(YH,{})}),a.jsx(he,{path:"/register",element:a.jsx(GH,{})}),a.jsx(he,{path:"/changepassword",element:a.jsx(EH,{})}),a.jsx(he,{path:"/security",element:a.jsx(KH,{})}),a.jsx(he,{path:"/mfa",element:a.jsx(HH,{})}),a.jsx(he,{path:"/batch",element:a.jsx(bH,{})}),a.jsx(he,{path:"/bulk/:resourceType",element:a.jsx(CH,{})}),a.jsx(he,{path:"/smart",element:a.jsx(JH,{})}),a.jsx(he,{path:"/forms/:id",element:a.jsx(OH,{})}),a.jsx(he,{path:"/admin/super",element:a.jsx(dq,{})}),a.jsx(he,{path:"/admin/config",element:a.jsx(aq,{})}),a.jsxs(he,{path:"/admin",element:a.jsx(lq,{}),children:[a.jsx(he,{path:"patients",element:a.jsx(sq,{})}),a.jsx(he,{path:"bots/new",element:a.jsx(tq,{})}),a.jsx(he,{path:"bots",element:a.jsx(ZH,{})}),a.jsx(he,{path:"clients/new",element:a.jsx(nq,{})}),a.jsx(he,{path:"clients",element:a.jsx(eq,{})}),a.jsx(he,{path:"details",element:a.jsx(iS,{})}),a.jsx(he,{path:"invite",element:a.jsx(iq,{})}),a.jsx(he,{path:"users",element:a.jsx(fq,{})}),a.jsx(he,{path:"project",element:a.jsx(iS,{})}),a.jsx(he,{path:"secrets",element:a.jsx(cq,{})}),a.jsx(he,{path:"sites",element:a.jsx(uq,{})}),a.jsx(he,{path:"members/:membershipId",element:a.jsx(oq,{})})]}),a.jsx(he,{path:"/lab/assays",element:a.jsx(hq,{})}),a.jsx(he,{path:"/lab/panels",element:a.jsx(pq,{})}),a.jsx(he,{path:"/:resourceType/:id/_history/:versionId/:tab",element:a.jsx(cS,{})}),a.jsx(he,{path:"/:resourceType/:id/_history/:versionId",element:a.jsx(cS,{})}),a.jsxs(he,{path:"/:resourceType/new",element:a.jsx(PH,{}),children:[a.jsx(he,{index:!0,element:a.jsx(mp,{})}),a.jsx(he,{path:"form",element:a.jsx(mp,{})}),a.jsx(he,{path:"json",element:a.jsx($q,{})}),a.jsx(he,{path:"profiles",element:a.jsx(mp,{})})]}),a.jsxs(he,{path:"/:resourceType/:id",element:a.jsx(lG,{}),children:[a.jsx(he,{index:!0,element:a.jsx(uS,{})}),a.jsx(he,{path:"apply",element:a.jsx(gq,{})}),a.jsx(he,{path:"apps",element:a.jsx(yq,{})}),a.jsx(he,{path:"event",element:a.jsx(xq,{})}),a.jsx(he,{path:"blame",element:a.jsx(wq,{})}),a.jsx(he,{path:"bots",element:a.jsx(Vq,{})}),a.jsx(he,{path:"builder",element:a.jsx(Dq,{})}),a.jsx(he,{path:"checklist",element:a.jsx(Iq,{})}),a.jsx(he,{path:"delete",element:a.jsx(_q,{})}),a.jsx(he,{path:"details",element:a.jsx(Oq,{})}),a.jsx(he,{path:"edit",element:a.jsx(Mq,{})}),a.jsx(he,{path:"editor",element:a.jsx(Tq,{})}),a.jsx(he,{path:"history",element:a.jsx(Lq,{})}),a.jsx(he,{path:"json",element:a.jsx(Fq,{})}),a.jsx(he,{path:"preview",element:a.jsx(zq,{})}),a.jsx(he,{path:"responses",element:a.jsx(Hq,{})}),a.jsx(he,{path:"report",element:a.jsx(Gq,{})}),a.jsx(he,{path:"ranges",element:a.jsx(qq,{})}),a.jsx(he,{path:"subscriptions",element:a.jsx(cG,{})}),a.jsx(he,{path:"timeline",element:a.jsx(uS,{})}),a.jsx(he,{path:"tools",element:a.jsx(uG,{})}),a.jsx(he,{path:"profiles",element:a.jsx(Bq,{})})]}),a.jsx(he,{path:"/:resourceType",element:a.jsx(oS,{})}),a.jsx(he,{path:"/",element:a.jsx(oS,{})})]})})}function fG(){const e=ne(),t=e.getUserConfiguration(),n=Wo(),[r]=x0();return e.isLoading()?a.jsx($r,{}):a.jsx(dF,{logo:a.jsx(Vr,{size:24}),pathname:n.pathname,searchParams:r,version:l7,menus:hG(t),displayAddBookmark:!!(t!=null&&t.id),children:a.jsx(p.Suspense,{fallback:a.jsx($r,{}),children:a.jsx(dG,{})})})}function hG(e){var n;const t=((n=e==null?void 0:e.menu)==null?void 0:n.map(r=>{var o;return{title:r.title,links:((o=r.link)==null?void 0:o.map(i=>({label:i.name,href:i.target,icon:pG(i.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:a.jsx(n6,{})}]}),t}const dS={Patient:y6,Practitioner:Z7,Organization:V7,ServiceRequest:d6,DiagnosticReport:h6,Questionnaire:J7,admin:z7,AccessPolicy:t6,Subscription:w6,batch:s6,Observation:i6};function pG(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in dS){const n=dS[t];return a.jsx(n,{})}}catch{}return a.jsx(Uf,{w:30})}"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.getRegistrations().then(e=>Promise.all(e.map(t=>t.unregister()))).catch(e=>console.error("SW registration failed: ",e))});async function mG(){const e=Zc(),t=new BP({baseUrl:e.baseUrl,clientId:e.clientId,cacheTime:6e4,autoBatchTime:100,onUnauthenticated:()=>{window.location.pathname!=="/signin"&&window.location.pathname!=="/oauth"&&(window.location.href="/signin?next="+encodeURIComponent(window.location.pathname+window.location.search))}}),n={headings:{sizes:{h1:{fontSize:"1.125rem",fontWeight:"500",lineHeight:"2.0"}}},fontSizes:{xs:"0.6875rem",sm:"0.875rem",md:"0.875rem",lg:"1.0rem",xl:"1.125rem"}},r=yW([{path:"*",element:a.jsx(fG,{})}]),o=s=>r.navigate(s);pk(document.getElementById("root")).render(a.jsx(p.StrictMode,{children:a.jsx(P7,{medplum:t,navigate:o,children:a.jsxs(qS,{theme:n,children:[a.jsx(Bo,{position:"bottom-right"}),a.jsx(PW,{router:r})]})})}))}mG().catch(console.error);
555
+ //# sourceMappingURL=index-BO3wit9F.js.map